import { i as isClient, a as isArray, b as isObject, c as isString, d as isNil, e as isFunction, n as nextTick, Y, s as set, g as get, f as fromPairs, h as hasOwn, w as warn, j as computed, k as getCurrentInstance, u as useResizeObserver, l as shallowRef, r as ref, m as watch, o as unref, p as capitalize$1, q as camelize, t as onMounted, v as watchEffect, x as onBeforeUnmount, y as inject, z as isRef, A as onScopeDispose, B as wn, N as NOOP, C as tryOnScopeDispose, D as computedEager, E as onBeforeMount, F as provide, G as isVNode, H as Fragment, I as Comment, J as defineComponent, K as h, L as triggerRef, M as useEventListener, O as isEqual, P as pick, Q as isPlainObject, R as renderSlot, S as openBlock, T as createBlock, U as Teleport, V as useWindowSize, W as useElementBounding, X as onActivated, Z as onDeactivated, _ as createElementBlock, $ as createVNode, a0 as withCtx, a1 as createBaseVNode, a2 as normalizeStyle, a3 as normalizeClass, a4 as mergeProps, a5 as useSlots, a6 as withDirectives, a7 as resolveDynamicComponent, a8 as createCommentVNode, a9 as createTextVNode, aa as toDisplayString, ab as vShow, ac as Transition, ad as cloneVNode, ae as Text, af as unrefElement, ag as Ee, ah as onUnmounted, ai as toRef, aj as castArray$1, ak as reactive, al as toRefs, am as cloneDeep, an as onUpdated, ao as refDebounced, ap as TransitionGroup, aq as Schema, ar as isUndefined$1, as as onClickOutside, at as readonly, au as markRaw, av as useAttrs$1, aw as withModifiers, ax as createSlots, ay as renderList, az as useDebounceFn, aA as useThrottleFn, aB as TinyColor, aC as isDate, aD as dayjs, aE as toValue, aF as debounce, aG as union, aH as customParseFormat, aI as toRaw, aJ as useMutationObserver, aK as isPlainObject$1, aL as isIOS, aM as clamp, aN as findLastIndex, aO as resolveComponent, aP as resolveDirective, aQ as toHandlerKey, aR as localeData, aS as normalizeProps, aT as guardReactiveProps, aU as throttle, aV as vModelCheckbox, aW as omit, aX as vModelRadio, aY as onBeforeUpdate, aZ as flattenDeep, a_ as withKeys, a$ as vModelText, b0 as isPromise, b1 as useCssVar, b2 as toHandlers, b3 as reactiveComputed, b4 as flatten, b5 as advancedFormat, b6 as weekOfYear, b7 as weekYear, b8 as dayOfYear, b9 as isSameOrAfter, ba as isSameOrBefore, bb as useTimeoutFn, bc as clamp$1, bd as effectScope, be as useIntersectionObserver, bf as memoize, bg as memoizeOne, bh as isNull, bi as merge, bj as render, bk as flatMap, bl as useDocumentVisibility, bm as useWindowFocus, bn as useElementSize, bo as useVModel, bp as autoUpdate, bq as computePosition, br as offset, bs as flip, bt as shift, bu as arrow, bv as detectOverflow, bw as useActiveElement, bx as createApp, by as hyphenate, bz as shallowReactive } from "./.pnpm.BW3P1y8f.js"; const EVENT_CODE = { tab: "Tab", enter: "Enter", space: "Space", left: "ArrowLeft", up: "ArrowUp", right: "ArrowRight", down: "ArrowDown", esc: "Escape", delete: "Delete", backspace: "Backspace", numpadEnter: "NumpadEnter", pageUp: "PageUp", pageDown: "PageDown", home: "Home", end: "End" }; const columnAlignment = [ "left", "center", "right" ]; const datePickTypes = [ "year", "years", "month", "months", "date", "dates", "week", "datetime", "datetimerange", "daterange", "monthrange", "yearrange" ]; const WEEK_DAYS = [ "sun", "mon", "tue", "wed", "thu", "fri", "sat" ]; const UPDATE_MODEL_EVENT = "update:modelValue"; const CHANGE_EVENT = "change"; const INPUT_EVENT = "input"; const MINIMUM_INPUT_WIDTH = 11; const BORDER_HORIZONTAL_WIDTH = 2; const INSTALLED_KEY = Symbol("INSTALLED_KEY"); const componentSizes = [ "", "default", "small", "large" ]; const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent); const isAndroid = () => isClient && /android/i.test(window.navigator.userAgent); const isUndefined = (val) => val === void 0; const isBoolean = (val) => typeof val === "boolean"; const isNumber = (val) => typeof val === "number"; const isEmpty = (val) => !val && val !== 0 || isArray(val) && val.length === 0 || isObject(val) && !Object.keys(val).length; const isElement = (e) => { if (typeof Element === "undefined") return false; return e instanceof Element; }; const isPropAbsent = (prop) => isNil(prop); const isStringNumber = (val) => { if (!isString(val)) return false; return !Number.isNaN(Number(val)); }; const isWindow = (val) => val === window; const nodeList = /* @__PURE__ */ new Map(); if (isClient) { let startClick; document.addEventListener("mousedown", (e) => startClick = e); document.addEventListener("mouseup", (e) => { if (startClick) { for (const handlers of nodeList.values()) for (const { documentHandler } of handlers) documentHandler(e, startClick); startClick = void 0; } }); } function createDocumentHandler(el, binding) { let excludes = []; if (isArray(binding.arg)) excludes = binding.arg; else if (isElement(binding.arg)) excludes.push(binding.arg); return function(mouseup, mousedown) { const popperRef = binding.instance.popperRef; const mouseUpTarget = mouseup.target; const mouseDownTarget = mousedown == null ? void 0 : mousedown.target; const isBound = !binding || !binding.instance; const isTargetExists = !mouseUpTarget || !mouseDownTarget; const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget); const isSelf = el === mouseUpTarget; const isTargetExcluded = excludes.length && excludes.some((item) => item == null ? void 0 : item.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget); const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget)); if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) return; binding.value(mouseup, mousedown); }; } const ClickOutside = { beforeMount(el, binding) { if (!nodeList.has(el)) nodeList.set(el, []); nodeList.get(el).push({ documentHandler: createDocumentHandler(el, binding), bindingFn: binding.value }); }, updated(el, binding) { if (!nodeList.has(el)) nodeList.set(el, []); const handlers = nodeList.get(el); const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue); const newHandler = { documentHandler: createDocumentHandler(el, binding), bindingFn: binding.value }; if (oldHandlerIndex >= 0) handlers.splice(oldHandlerIndex, 1, newHandler); else handlers.push(newHandler); }, unmounted(el) { nodeList.delete(el); } }; const REPEAT_INTERVAL = 100; const REPEAT_DELAY = 600; const SCOPE$c = "_RepeatClick"; const vRepeatClick = { beforeMount(el, binding) { const value = binding.value; const { interval = REPEAT_INTERVAL, delay = REPEAT_DELAY } = isFunction(value) ? {} : value; let intervalId; let delayId; const handler = () => isFunction(value) ? value() : value.handler(); const clear = () => { if (delayId) { clearTimeout(delayId); delayId = void 0; } if (intervalId) { clearInterval(intervalId); intervalId = void 0; } }; const start = (evt) => { if (evt.button !== 0) return; clear(); handler(); document.addEventListener("mouseup", clear, { once: true }); delayId = setTimeout(() => { intervalId = setInterval(() => { handler(); }, interval); }, delay); }; el[SCOPE$c] = { start, clear }; el.addEventListener("mousedown", start); }, unmounted(el) { if (!el[SCOPE$c]) return; const { start, clear } = el[SCOPE$c]; if (start) el.removeEventListener("mousedown", start); if (clear) { clear(); document.removeEventListener("mouseup", clear); } el[SCOPE$c] = null; } }; const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])`; const isShadowRoot = (e) => { if (typeof ShadowRoot === "undefined") return false; return e instanceof ShadowRoot; }; const isHTMLElement = (e) => { if (typeof Element === "undefined") return false; return e instanceof Element; }; const isVisible = (element) => { return getComputedStyle(element).position === "fixed" ? false : element.offsetParent !== null; }; const obtainAllFocusableElements$1 = (element) => { return Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter((item) => isFocusable(item) && isVisible(item)); }; const isFocusable = (element) => { if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) return true; if (element.tabIndex < 0 || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true") return false; switch (element.nodeName) { case "A": return !!element.href && element.rel !== "ignore"; case "INPUT": return !(element.type === "hidden" || element.type === "file"); case "BUTTON": case "SELECT": case "TEXTAREA": return true; default: return false; } }; const triggerEvent = function(elm, name, ...opts) { let eventName; if (name.includes("mouse") || name.includes("click")) eventName = "MouseEvents"; else if (name.includes("key")) eventName = "KeyboardEvent"; else eventName = "HTMLEvents"; const evt = document.createEvent(eventName); evt.initEvent(name, ...opts); elm.dispatchEvent(evt); return elm; }; const isLeaf = (el) => !el.getAttribute("aria-owns"); const getSibling = (el, distance, elClass) => { const { parentNode } = el; if (!parentNode) return null; const siblings = parentNode.querySelectorAll(elClass); return siblings[Array.prototype.indexOf.call(siblings, el) + distance] || null; }; const focusElement = (el, options) => { if (!el || !el.focus) return; let cleanup = false; if (isHTMLElement(el) && !isFocusable(el) && !el.getAttribute("tabindex")) { el.setAttribute("tabindex", "-1"); cleanup = true; } el.focus(options); if (isHTMLElement(el) && cleanup) el.removeAttribute("tabindex"); }; const focusNode = (el) => { if (!el) return; focusElement(el); !isLeaf(el) && el.click(); }; const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => { const handleEvent = (event) => { const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event); if (checkForDefaultPrevented === false || !shouldPrevent) return oursHandler == null ? void 0 : oursHandler(event); }; return handleEvent; }; const whenMouse = (handler) => { return (e) => e.pointerType === "mouse" ? handler(e) : void 0; }; const getEventCode = (event) => { if (event.code && event.code !== "Unidentified") return event.code; const key = getEventKey(event); if (key) { if (Object.values(EVENT_CODE).includes(key)) return key; switch (key) { case " ": return EVENT_CODE.space; default: return ""; } } return ""; }; const getEventKey = (event) => { let key = event.key && event.key !== "Unidentified" ? event.key : ""; if (!key && event.type === "keyup" && isAndroid()) { const target = event.target; key = target.value.charAt(target.selectionStart - 1); } return key; }; const FOCUSABLE_CHILDREN = "_trap-focus-children"; const FOCUS_STACK = []; const FOCUS_HANDLER = (e) => { if (FOCUS_STACK.length === 0) return; const code = getEventCode(e); const focusableElement = FOCUS_STACK[FOCUS_STACK.length - 1][FOCUSABLE_CHILDREN]; if (focusableElement.length > 0 && code === EVENT_CODE.tab) { if (focusableElement.length === 1) { e.preventDefault(); if (document.activeElement !== focusableElement[0]) focusableElement[0].focus(); return; } const goingBackward = e.shiftKey; const isFirst = e.target === focusableElement[0]; const isLast = e.target === focusableElement[focusableElement.length - 1]; if (isFirst && goingBackward) { e.preventDefault(); focusableElement[focusableElement.length - 1].focus(); } if (isLast && !goingBackward) { e.preventDefault(); focusableElement[0].focus(); } } }; const TrapFocus = { beforeMount(el) { el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el); FOCUS_STACK.push(el); if (FOCUS_STACK.length <= 1) document.addEventListener("keydown", FOCUS_HANDLER); }, updated(el) { nextTick(() => { el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el); }); }, unmounted() { FOCUS_STACK.shift(); if (FOCUS_STACK.length === 0) document.removeEventListener("keydown", FOCUS_HANDLER); } }; const SCOPE$b = "_Mousewheel"; const mousewheel = function(element, callback) { if (element && element.addEventListener) { removeWheelHandler(element); const fn = function(event) { const normalized = Y(event); callback && Reflect.apply(callback, this, [event, normalized]); }; element[SCOPE$b] = { wheelHandler: fn }; element.addEventListener("wheel", fn, { passive: true }); } }; const removeWheelHandler = (element) => { var _a; if ((_a = element[SCOPE$b]) == null ? void 0 : _a.wheelHandler) { element.removeEventListener("wheel", element[SCOPE$b].wheelHandler); element[SCOPE$b] = null; } }; const Mousewheel = { beforeMount(el, binding) { mousewheel(el, binding.value); }, unmounted(el) { removeWheelHandler(el); }, updated(el, binding) { if (binding.value !== binding.oldValue) mousewheel(el, binding.value); } }; const keysOf = (arr) => Object.keys(arr); const entriesOf = (arr) => Object.entries(arr); const getProp = (obj, path, defaultValue) => { return { get value() { return get(obj, path, defaultValue); }, set value(val) { set(obj, path, val); } }; }; const epPropKey = "__epPropKey"; const definePropType = (val) => val; const isEpProp = (val) => isObject(val) && !!val[epPropKey]; const buildProp = (prop, key) => { if (!isObject(prop) || isEpProp(prop)) return prop; const { values, required, default: defaultValue, type, validator } = prop; const epProp = { type, required: !!required, validator: values || validator ? (val) => { let valid = false; let allowedValues = []; if (values) { allowedValues = Array.from(values); if (hasOwn(prop, "default")) allowedValues.push(defaultValue); valid || (valid = allowedValues.includes(val)); } if (validator) valid || (valid = validator(val)); if (!valid && allowedValues.length > 0) { const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", "); warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`); } return valid; } : void 0, [epPropKey]: true }; if (hasOwn(prop, "default")) epProp.default = defaultValue; return epProp; }; const buildProps = (props2) => fromPairs(Object.entries(props2).map(([key, option]) => [key, buildProp(option, key)])); const teleportProps = buildProps({ to: { type: definePropType([String, Object]), required: true }, disabled: Boolean }); const affixProps = buildProps({ zIndex: { type: definePropType([Number, String]), default: 100 }, target: { type: String, default: "" }, offset: { type: Number, default: 0 }, position: { type: String, values: ["top", "bottom"], default: "top" }, teleported: Boolean, appendTo: { type: teleportProps.to.type, default: "body" } }); const affixEmits = { scroll: ({ scrollTop, fixed }) => isNumber(scrollTop) && isBoolean(fixed), [CHANGE_EVENT]: (fixed) => isBoolean(fixed) }; var ElementPlusError = class extends Error { constructor(m) { super(m); this.name = "ElementPlusError"; } }; function throwError(scope, m) { throw new ElementPlusError(`[${scope}] ${m}`); } function debugWarn(scope, message2) { { const error = isString(scope) ? new ElementPlusError(`[${scope}] ${message2}`) : scope; console.warn(error); } } const DEFAULT_EXCLUDE_KEYS = ["class", "style"]; const LISTENER_PREFIX = /^on[A-Z]/; const useAttrs = (params = {}) => { const { excludeListeners = false, excludeKeys } = params; const allExcludeKeys = computed(() => { return ((excludeKeys == null ? void 0 : excludeKeys.value) || []).concat(DEFAULT_EXCLUDE_KEYS); }); const instance = getCurrentInstance(); if (!instance) { debugWarn("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"); return computed(() => ({})); } return computed(() => { var _a; return fromPairs(Object.entries((_a = instance.proxy) == null ? void 0 : _a.$attrs).filter(([key]) => !allExcludeKeys.value.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key)))); }); }; function useCalcInputWidth() { const calculatorRef = shallowRef(); const calculatorWidth = ref(0); const inputStyle = computed(() => ({ minWidth: `${Math.max(calculatorWidth.value, MINIMUM_INPUT_WIDTH)}px` })); const resetCalculatorWidth = () => { var _a; calculatorWidth.value = ((_a = calculatorRef.value) == null ? void 0 : _a.getBoundingClientRect().width) ?? 0; }; useResizeObserver(calculatorRef, resetCalculatorWidth); return { calculatorRef, calculatorWidth, inputStyle }; } const useDeprecated = ({ from, replacement, scope, version: version2, ref: ref2, type = "API" }, condition) => { watch(() => unref(condition), (val) => { if (val) debugWarn(scope, `[${type}] ${from} is about to be deprecated in version ${version2}, please use ${replacement} instead. For more detail, please visit: ${ref2} `); }, { immediate: true }); }; const escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); const capitalize = (str) => capitalize$1(str); const SCOPE$a = "utils/dom/style"; const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim()); const hasClass = (el, cls) => { if (!el || !cls) return false; if (cls.includes(" ")) throw new Error("className should not contain space."); return el.classList.contains(cls); }; const addClass = (el, cls) => { if (!el || !cls.trim()) return; el.classList.add(...classNameToArray(cls)); }; const removeClass = (el, cls) => { if (!el || !cls.trim()) return; el.classList.remove(...classNameToArray(cls)); }; const getStyle = (element, styleName) => { var _a; if (!isClient || !element || !styleName || isShadowRoot(element)) return ""; let key = camelize(styleName); if (key === "float") key = "cssFloat"; try { const style = element.style[key]; if (style) return style; const computed2 = (_a = document.defaultView) == null ? void 0 : _a.getComputedStyle(element, ""); return computed2 ? computed2[key] : ""; } catch { return element.style[key]; } }; const setStyle = (element, styleName, value) => { if (!element || !styleName) return; if (isObject(styleName)) entriesOf(styleName).forEach(([prop, value2]) => setStyle(element, prop, value2)); else { const key = camelize(styleName); element.style[key] = value; } }; function addUnit(value, defaultUnit = "px") { if (!value && value !== 0) return ""; if (isNumber(value) || isStringNumber(value)) return `${value}${defaultUnit}`; else if (isString(value)) return value; debugWarn(SCOPE$a, "binding value must be a string or number"); } const useDraggable = (targetRef, dragRef, draggable2, overflow) => { const transform = { offsetX: 0, offsetY: 0 }; const isDragging2 = ref(false); const adjustPosition = (moveX, moveY) => { if (targetRef.value) { const { offsetX, offsetY } = transform; const targetRect = targetRef.value.getBoundingClientRect(); const targetLeft = targetRect.left; const targetTop = targetRect.top; const targetWidth = targetRect.width; const targetHeight = targetRect.height; const clientWidth = document.documentElement.clientWidth; const clientHeight = document.documentElement.clientHeight; const minLeft = -targetLeft + offsetX; const minTop = -targetTop + offsetY; const maxLeft = clientWidth - targetLeft - targetWidth + offsetX; const maxTop = clientHeight - targetTop - (targetHeight < clientHeight ? targetHeight : 0) + offsetY; if (!(overflow == null ? void 0 : overflow.value)) { moveX = Math.min(Math.max(moveX, minLeft), maxLeft); moveY = Math.min(Math.max(moveY, minTop), maxTop); } transform.offsetX = moveX; transform.offsetY = moveY; targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(moveY)})`; } }; const onMousedown = (e) => { const downX = e.clientX; const downY = e.clientY; const { offsetX, offsetY } = transform; const onMousemove = (e2) => { if (!isDragging2.value) isDragging2.value = true; adjustPosition(offsetX + e2.clientX - downX, offsetY + e2.clientY - downY); }; const onMouseup = () => { isDragging2.value = false; document.removeEventListener("mousemove", onMousemove); document.removeEventListener("mouseup", onMouseup); }; document.addEventListener("mousemove", onMousemove); document.addEventListener("mouseup", onMouseup); }; const onDraggable = () => { if (dragRef.value && targetRef.value) { dragRef.value.addEventListener("mousedown", onMousedown); window.addEventListener("resize", updatePosition); } }; const offDraggable = () => { if (dragRef.value && targetRef.value) { dragRef.value.removeEventListener("mousedown", onMousedown); window.removeEventListener("resize", updatePosition); } }; const resetPosition = () => { transform.offsetX = 0; transform.offsetY = 0; if (targetRef.value) targetRef.value.style.transform = ""; }; const updatePosition = () => { const { offsetX, offsetY } = transform; adjustPosition(offsetX, offsetY); }; onMounted(() => { watchEffect(() => { if (draggable2.value) onDraggable(); else offDraggable(); }); }); onBeforeUnmount(() => { offDraggable(); }); return { isDragging: isDragging2, resetPosition, updatePosition }; }; var en_default = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value", alphaDescription: "alpha {alpha}, current color is {color}", hueLabel: "pick hue value", hueDescription: "hue {hue}, current color is {color}", svLabel: "pick saturation and brightness value", svDescription: "saturation {saturation}, brightness {brightness}, current color is {color}", predefineDescription: "select {value} as the color" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum", selectAllLabel: "Select all rows", selectRowLabel: "Select this row", expandRowLabel: "Expand this row", collapseRowLabel: "Collapse this row", sortLabel: "Sort by {column}", filterLabel: "Filter by {column}" }, tag: { close: "Close this tag" }, tour: { next: "Next", previous: "Previous", finish: "Finish", close: "Close this dialog" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale)); const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => `${(option == null ? void 0 : option[key]) ?? `{${key}}`}`); const buildLocaleContext = (locale) => { return { lang: computed(() => unref(locale).name), locale: isRef(locale) ? locale : ref(locale), t: buildTranslator(locale) }; }; const localeContextKey = Symbol("localeContextKey"); const useLocale = (localeOverrides) => { const locale = localeOverrides || inject(localeContextKey, ref()); return buildLocaleContext(computed(() => locale.value || en_default)); }; const defaultNamespace = "el"; const statePrefix = "is-"; const _bem = (namespace, block, blockSuffix, element, modifier) => { let cls = `${namespace}-${block}`; if (blockSuffix) cls += `-${blockSuffix}`; if (element) cls += `__${element}`; if (modifier) cls += `--${modifier}`; return cls; }; const namespaceContextKey = Symbol("namespaceContextKey"); const useGetDerivedNamespace = (namespaceOverrides) => { const derivedNamespace = namespaceOverrides || (getCurrentInstance() ? inject(namespaceContextKey, ref(defaultNamespace)) : ref(defaultNamespace)); return computed(() => { return unref(derivedNamespace) || defaultNamespace; }); }; const useNamespace = (block, namespaceOverrides) => { const namespace = useGetDerivedNamespace(namespaceOverrides); const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", ""); const e = (element) => element ? _bem(namespace.value, block, "", element, "") : ""; const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : ""; const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : ""; const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : ""; const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : ""; const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : ""; const is = (name, ...args) => { const state = args.length >= 1 ? args[0] : true; return name && state ? `${statePrefix}${name}` : ""; }; const cssVar = (object) => { const styles = {}; for (const key in object) if (object[key]) styles[`--${namespace.value}-${key}`] = object[key]; return styles; }; const cssVarBlock = (object) => { const styles = {}; for (const key in object) if (object[key]) styles[`--${namespace.value}-${block}-${key}`] = object[key]; return styles; }; const cssVarName = (name) => `--${namespace.value}-${name}`; const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`; return { namespace, b, e, m, be, em, bm, bem, is, cssVar, cssVarName, cssVarBlock, cssVarBlockName }; }; function easeInOutCubic(t, b, c, d) { const cc = c - b; t /= d / 2; if (t < 1) return cc / 2 * t * t * t + b; return cc / 2 * ((t -= 2) * t * t + 2) + b; } const rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16); const cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle); const isScroll = (el, isVertical) => { if (!isClient) return false; const key = { undefined: "overflow", true: "overflow-y", false: "overflow-x" }[String(isVertical)]; const overflow = getStyle(el, key); return [ "scroll", "auto", "overlay" ].some((s) => overflow.includes(s)); }; const getScrollContainer = (el, isVertical) => { if (!isClient) return; let parent = el; while (parent) { if ([ window, document, document.documentElement ].includes(parent)) return window; if (isScroll(parent, isVertical)) return parent; if (isShadowRoot(parent)) parent = parent.host; else parent = parent.parentNode; } return parent; }; let scrollBarWidth; const getScrollBarWidth = (namespace) => { var _a; if (!isClient) return 0; if (scrollBarWidth !== void 0) return scrollBarWidth; const outer = document.createElement("div"); outer.className = `${namespace}-scrollbar__wrap`; outer.style.visibility = "hidden"; outer.style.width = "100px"; outer.style.position = "absolute"; outer.style.top = "-9999px"; document.body.appendChild(outer); const widthNoScroll = outer.offsetWidth; outer.style.overflow = "scroll"; const inner = document.createElement("div"); inner.style.width = "100%"; outer.appendChild(inner); const widthWithScroll = inner.offsetWidth; (_a = outer.parentNode) == null ? void 0 : _a.removeChild(outer); scrollBarWidth = widthNoScroll - widthWithScroll; return scrollBarWidth; }; function scrollIntoView(container, selected) { if (!isClient) return; if (!selected) { container.scrollTop = 0; return; } const offsetParents = []; let pointer = selected.offsetParent; while (pointer !== null && container !== pointer && container.contains(pointer)) { offsetParents.push(pointer); pointer = pointer.offsetParent; } const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0); const bottom = top + selected.offsetHeight; const viewRectTop = container.scrollTop; const viewRectBottom = viewRectTop + container.clientHeight; if (top < viewRectTop) container.scrollTop = top; else if (bottom > viewRectBottom) container.scrollTop = bottom - container.clientHeight; } function animateScrollTo(container, from, to, duration, callback) { const startTime = Date.now(); let handle; const scroll = () => { const time = Date.now() - startTime; const nextScrollTop = easeInOutCubic(time > duration ? duration : time, from, to, duration); if (isWindow(container)) container.scrollTo(window.pageXOffset, nextScrollTop); else container.scrollTop = nextScrollTop; if (time < duration) handle = rAF(scroll); else if (isFunction(callback)) callback(); }; scroll(); return () => { handle && cAF(handle); }; } const getScrollElement = (target, container) => { if (isWindow(container)) return target.ownerDocument.documentElement; return container; }; const getScrollTop = (container) => { if (isWindow(container)) return window.scrollY; return container.scrollTop; }; const useLockscreen = (trigger, options = {}) => { if (!isRef(trigger)) throwError("[useLockscreen]", "You need to pass a ref param to this function"); const ns = options.ns || useNamespace("popup"); const hiddenCls = computed(() => ns.bm("parent", "hidden")); let scrollBarWidth2 = 0; let withoutHiddenClass = false; let bodyWidth = "0"; let cleaned = false; const cleanup = () => { if (cleaned) return; cleaned = true; setTimeout(() => { if (typeof document === "undefined") return; if (withoutHiddenClass && document) { document.body.style.width = bodyWidth; removeClass(document.body, hiddenCls.value); } }, 200); }; watch(trigger, (val) => { if (!val) { cleanup(); return; } cleaned = false; withoutHiddenClass = !hasClass(document.body, hiddenCls.value); if (withoutHiddenClass) { bodyWidth = document.body.style.width; addClass(document.body, hiddenCls.value); } scrollBarWidth2 = getScrollBarWidth(ns.namespace.value); const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight; const bodyOverflowY = getStyle(document.body, "overflowY"); if (scrollBarWidth2 > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) document.body.style.width = `calc(100% - ${scrollBarWidth2}px)`; }); onScopeDispose(() => cleanup()); }; const _prop = buildProp({ type: definePropType(Boolean), default: null }); const _event = buildProp({ type: definePropType(Function) }); const createModelToggleComposable = (name) => { const updateEventKey = `update:${name}`; const updateEventKeyRaw2 = `onUpdate:${name}`; const useModelToggleEmits = [updateEventKey]; const useModelToggleProps = { [name]: _prop, [updateEventKeyRaw2]: _event }; const useModelToggle = ({ indicator, toggleReason, shouldHideWhenRouteChanges, shouldProceed, onShow, onHide }) => { const instance = getCurrentInstance(); const { emit } = instance; const props2 = instance.props; const hasUpdateHandler = computed(() => isFunction(props2[updateEventKeyRaw2])); const isModelBindingAbsent = computed(() => props2[name] === null); const doShow = (event) => { if (indicator.value === true) return; indicator.value = true; if (toggleReason) toggleReason.value = event; if (isFunction(onShow)) onShow(event); }; const doHide = (event) => { if (indicator.value === false) return; indicator.value = false; if (toggleReason) toggleReason.value = event; if (isFunction(onHide)) onHide(event); }; const show = (event) => { if (props2.disabled === true || isFunction(shouldProceed) && !shouldProceed()) return; const shouldEmit = hasUpdateHandler.value && isClient; if (shouldEmit) emit(updateEventKey, true); if (isModelBindingAbsent.value || !shouldEmit) doShow(event); }; const hide = (event) => { if (props2.disabled === true || !isClient) return; const shouldEmit = hasUpdateHandler.value && isClient; if (shouldEmit) emit(updateEventKey, false); if (isModelBindingAbsent.value || !shouldEmit) doHide(event); }; const onChange = (val) => { if (!isBoolean(val)) return; if (props2.disabled && val) { if (hasUpdateHandler.value) emit(updateEventKey, false); } else if (indicator.value !== val) if (val) doShow(); else doHide(); }; const toggle = () => { if (indicator.value) hide(); else show(); }; watch(() => props2[name], onChange); if (shouldHideWhenRouteChanges && instance.appContext.config.globalProperties.$route !== void 0) watch(() => ({ ...instance.proxy.$route }), () => { if (shouldHideWhenRouteChanges.value && indicator.value) hide(); }); onMounted(() => { onChange(props2[name]); }); return { hide, show, toggle, hasUpdateHandler }; }; return { useModelToggle, useModelToggleProps, useModelToggleEmits }; }; const useProp = (name) => { const vm = getCurrentInstance(); return computed(() => { var _a, _b; return (_b = (_a = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a.$props) == null ? void 0 : _b[name]; }); }; const usePopper = (referenceElementRef, popperElementRef, opts = {}) => { const stateUpdater = { name: "updateState", enabled: true, phase: "write", fn: ({ state }) => { const derivedState = deriveState(state); Object.assign(states.value, derivedState); }, requires: ["computeStyles"] }; const options = computed(() => { const { onFirstUpdate, placement, strategy, modifiers } = unref(opts); return { onFirstUpdate, placement: placement || "bottom", strategy: strategy || "absolute", modifiers: [ ...modifiers || [], stateUpdater, { name: "applyStyles", enabled: false } ] }; }); const instanceRef = shallowRef(); const states = ref({ styles: { popper: { position: unref(options).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }); const destroy = () => { if (!instanceRef.value) return; instanceRef.value.destroy(); instanceRef.value = void 0; }; watch(options, (newOptions) => { const instance = unref(instanceRef); if (instance) instance.setOptions(newOptions); }, { deep: true }); watch([referenceElementRef, popperElementRef], ([referenceElement, popperElement]) => { destroy(); if (!referenceElement || !popperElement) return; instanceRef.value = wn(referenceElement, popperElement, unref(options)); }); onBeforeUnmount(() => { destroy(); }); return { state: computed(() => { var _a; return { ...((_a = unref(instanceRef)) == null ? void 0 : _a.state) || {} }; }), styles: computed(() => unref(states).styles), attributes: computed(() => unref(states).attributes), update: () => { var _a; return (_a = unref(instanceRef)) == null ? void 0 : _a.update(); }, forceUpdate: () => { var _a; return (_a = unref(instanceRef)) == null ? void 0 : _a.forceUpdate(); }, instanceRef: computed(() => unref(instanceRef)) }; }; function deriveState(state) { const elements = Object.keys(state.elements); return { styles: fromPairs(elements.map((element) => [element, state.styles[element] || {}])), attributes: fromPairs(elements.map((element) => [element, state.attributes[element]])) }; } const useSameTarget = (handleClick) => { if (!handleClick) return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP }; let mousedownTarget = false; let mouseupTarget = false; const onClick = (e) => { if (mousedownTarget && mouseupTarget) handleClick(e); mousedownTarget = mouseupTarget = false; }; const onMousedown = (e) => { mousedownTarget = e.target === e.currentTarget; }; const onMouseup = (e) => { mouseupTarget = e.target === e.currentTarget; }; return { onClick, onMousedown, onMouseup }; }; const useThrottleRender = (loading, throttle2 = 0) => { if (throttle2 === 0) return loading; const throttled = ref(isObject(throttle2) && Boolean(throttle2.initVal)); let timeoutHandle = null; const dispatchThrottling = (timer) => { if (isUndefined(timer)) { throttled.value = loading.value; return; } if (timeoutHandle) clearTimeout(timeoutHandle); timeoutHandle = setTimeout(() => { throttled.value = loading.value; }, timer); }; const dispatcher = (type) => { if (type === "leading") if (isNumber(throttle2)) dispatchThrottling(throttle2); else dispatchThrottling(throttle2.leading); else if (isObject(throttle2)) dispatchThrottling(throttle2.trailing); else throttled.value = false; }; onMounted(() => dispatcher("leading")); watch(() => loading.value, (val) => { dispatcher(val ? "leading" : "trailing"); }); return throttled; }; function useTimeout() { let timeoutHandle; const registerTimeout = (fn, delay) => { cancelTimeout(); timeoutHandle = globalThis.setTimeout(fn, delay); }; const cancelTimeout = () => { if (timeoutHandle === void 0) return; globalThis.clearTimeout(timeoutHandle); timeoutHandle = void 0; }; tryOnScopeDispose(() => cancelTimeout()); return { registerTimeout, cancelTimeout }; } const defaultIdInjection = { prefix: Math.floor(Math.random() * 1e4), current: 0 }; const ID_INJECTION_KEY = Symbol("elIdInjection"); const useIdInjection = () => { return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection; }; const useId = (deterministicId) => { const idInjection = useIdInjection(); if (!isClient && idInjection === defaultIdInjection) debugWarn("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed usage: app.provide(ID_INJECTION_KEY, { prefix: number, current: number, })`); const namespace = useGetDerivedNamespace(); return computedEager(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`); }; let registeredEscapeHandlers = []; const cachedHandler = (event) => { if (getEventCode(event) === EVENT_CODE.esc) registeredEscapeHandlers.forEach((registeredHandler) => registeredHandler(event)); }; const useEscapeKeydown = (handler) => { onMounted(() => { if (registeredEscapeHandlers.length === 0) document.addEventListener("keydown", cachedHandler); if (isClient) registeredEscapeHandlers.push(handler); }); onBeforeUnmount(() => { registeredEscapeHandlers = registeredEscapeHandlers.filter((registeredHandler) => registeredHandler !== handler); if (registeredEscapeHandlers.length === 0) { if (isClient) document.removeEventListener("keydown", cachedHandler); } }); }; const usePopperContainerId = () => { const namespace = useGetDerivedNamespace(); const idInjection = useIdInjection(); const id = computed(() => { return `${namespace.value}-popper-container-${idInjection.prefix}`; }); return { id, selector: computed(() => `#${id.value}`) }; }; const createContainer = (id) => { const container = document.createElement("div"); container.id = id; document.body.appendChild(container); return container; }; const usePopperContainer = () => { const { id, selector } = usePopperContainerId(); onBeforeMount(() => { if (!isClient) return; if (!document.body.querySelector(selector.value)) createContainer(id.value); }); return { id, selector }; }; const useDelayedToggleProps = buildProps({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }); const useDelayedToggle = ({ showAfter, hideAfter, autoClose, open, close: close2 }) => { const { registerTimeout } = useTimeout(); const { registerTimeout: registerTimeoutForAutoClose, cancelTimeout: cancelTimeoutForAutoClose } = useTimeout(); const onOpen = (event, delay = unref(showAfter)) => { registerTimeout(() => { open(event); const _autoClose = unref(autoClose); if (isNumber(_autoClose) && _autoClose > 0) registerTimeoutForAutoClose(() => { close2(event); }, _autoClose); }, delay); }; const onClose = (event, delay = unref(hideAfter)) => { cancelTimeoutForAutoClose(); registerTimeout(() => { close2(event); }, delay); }; return { onOpen, onClose }; }; const FORWARD_REF_INJECTION_KEY = Symbol("elForwardRef"); const useForwardRef = (forwardRef) => { const setForwardRef = ((el) => { forwardRef.value = el; }); provide(FORWARD_REF_INJECTION_KEY, { setForwardRef }); }; const useForwardRefDirective = (setForwardRef) => { return { mounted(el) { setForwardRef(el); }, updated(el) { setForwardRef(el); }, unmounted() { setForwardRef(null); } }; }; const initial = { current: 0 }; const zIndex = ref(0); const defaultInitialZIndex = 2e3; const ZINDEX_INJECTION_KEY = Symbol("elZIndexContextKey"); const zIndexContextKey = Symbol("zIndexContextKey"); const useZIndex = (zIndexOverrides) => { const increasingInjection = getCurrentInstance() ? inject(ZINDEX_INJECTION_KEY, initial) : initial; const zIndexInjection = zIndexOverrides || (getCurrentInstance() ? inject(zIndexContextKey, void 0) : void 0); const initialZIndex = computed(() => { const zIndexFromInjection = unref(zIndexInjection); return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex; }); const currentZIndex = computed(() => initialZIndex.value + zIndex.value); const nextZIndex = () => { increasingInjection.current++; zIndex.value = increasingInjection.current; return currentZIndex.value; }; if (!isClient && !inject(ZINDEX_INJECTION_KEY)) debugWarn("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`); return { initialZIndex, currentZIndex, nextZIndex }; }; function useCursor(input) { let selectionInfo; function recordCursor() { if (input.value == void 0) return; const { selectionStart, selectionEnd, value } = input.value; if (selectionStart == null || selectionEnd == null) return; selectionInfo = { selectionStart, selectionEnd, value, beforeTxt: value.slice(0, Math.max(0, selectionStart)), afterTxt: value.slice(Math.max(0, selectionEnd)) }; } function setCursor() { if (input.value == void 0 || selectionInfo == void 0) return; const { value } = input.value; const { beforeTxt, afterTxt, selectionStart } = selectionInfo; if (beforeTxt == void 0 || afterTxt == void 0 || selectionStart == void 0) return; let startPos = value.length; if (value.endsWith(afterTxt)) startPos = value.length - afterTxt.length; else if (value.startsWith(beforeTxt)) startPos = beforeTxt.length; else { const beforeLastChar = beforeTxt[selectionStart - 1]; const newIndex = value.indexOf(beforeLastChar, selectionStart - 1); if (newIndex !== -1) startPos = newIndex + 1; } input.value.setSelectionRange(startPos, startPos); } return [recordCursor, setCursor]; } const SCOPE$9 = "utils/vue/vnode"; let PatchFlags = /* @__PURE__ */ (function(PatchFlags2) { PatchFlags2[PatchFlags2["TEXT"] = 1] = "TEXT"; PatchFlags2[PatchFlags2["CLASS"] = 2] = "CLASS"; PatchFlags2[PatchFlags2["STYLE"] = 4] = "STYLE"; PatchFlags2[PatchFlags2["PROPS"] = 8] = "PROPS"; PatchFlags2[PatchFlags2["FULL_PROPS"] = 16] = "FULL_PROPS"; PatchFlags2[PatchFlags2["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS"; PatchFlags2[PatchFlags2["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT"; PatchFlags2[PatchFlags2["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT"; PatchFlags2[PatchFlags2["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT"; PatchFlags2[PatchFlags2["NEED_PATCH"] = 512] = "NEED_PATCH"; PatchFlags2[PatchFlags2["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS"; PatchFlags2[PatchFlags2["HOISTED"] = -1] = "HOISTED"; PatchFlags2[PatchFlags2["BAIL"] = -2] = "BAIL"; return PatchFlags2; })({}); function isFragment(node) { return isVNode(node) && node.type === Fragment; } function isComment(node) { return isVNode(node) && node.type === Comment; } function isValidElementNode(node) { return isVNode(node) && !isFragment(node) && !isComment(node); } const getNormalizedProps = (node) => { if (!isVNode(node)) { debugWarn(SCOPE$9, "[getNormalizedProps] must be a VNode"); return {}; } const raw = node.props || {}; const type = (isVNode(node.type) ? node.type.props : void 0) || {}; const props2 = {}; Object.keys(type).forEach((key) => { if (hasOwn(type[key], "default")) props2[key] = type[key].default; }); Object.keys(raw).forEach((key) => { props2[camelize(key)] = raw[key]; }); return props2; }; const flattedChildren = (children) => { const vNodes = isArray(children) ? children : [children]; const result = []; vNodes.forEach((child) => { var _a; if (isArray(child)) result.push(...flattedChildren(child)); else if (isVNode(child) && ((_a = child.component) == null ? void 0 : _a.subTree)) result.push(child, ...flattedChildren(child.component.subTree)); else if (isVNode(child) && isArray(child.children)) result.push(...flattedChildren(child.children)); else if (isVNode(child) && child.shapeFlag === 2) result.push(...flattedChildren(child.type())); else result.push(child); }); return result; }; const getOrderedChildren = (vm, childComponentName, children) => { return flattedChildren(vm.subTree).filter((n) => { var _a; return isVNode(n) && ((_a = n.type) == null ? void 0 : _a.name) === childComponentName && !!n.component; }).map((n) => n.component.uid).map((uid2) => children[uid2]).filter((p) => !!p); }; const useOrderedChildren = (vm, childComponentName) => { const children = shallowRef({}); const orderedChildren = shallowRef([]); const nodesMap = /* @__PURE__ */ new WeakMap(); const addChild = (child) => { children.value[child.uid] = child; triggerRef(children); onMounted(() => { const childNode = child.getVnode().el; const parentNode = childNode.parentNode; if (!nodesMap.has(parentNode)) { nodesMap.set(parentNode, []); const originalFn = parentNode.insertBefore.bind(parentNode); parentNode.insertBefore = (node, anchor) => { if (nodesMap.get(parentNode).some((el) => node === el || anchor === el)) triggerRef(children); return originalFn(node, anchor); }; } nodesMap.get(parentNode).push(childNode); }); }; const removeChild = (child) => { delete children.value[child.uid]; triggerRef(children); const childNode = child.getVnode().el; const parentNode = childNode.parentNode; const childNodes = nodesMap.get(parentNode); const index = childNodes.indexOf(childNode); childNodes.splice(index, 1); }; const sortChildren = () => { orderedChildren.value = getOrderedChildren(vm, childComponentName, children.value); }; const IsolatedRenderer = (props2) => { return props2.render(); }; return { children: orderedChildren, addChild, removeChild, ChildrenSorter: defineComponent({ setup(_, { slots }) { return () => { sortChildren(); return slots.default ? h(IsolatedRenderer, { render: slots.default }) : null; }; } }) }; }; const useSizeProp = buildProp({ type: String, values: componentSizes, required: false }); const SIZE_INJECTION_KEY = Symbol("size"); const useGlobalSize = () => { const injectedSize = inject(SIZE_INJECTION_KEY, {}); return computed(() => { return unref(injectedSize.size) || ""; }); }; function useFocusController(target, { disabled, beforeFocus, afterFocus, beforeBlur, afterBlur } = {}) { const { emit } = getCurrentInstance(); const wrapperRef = shallowRef(); const isFocused = ref(false); const handleFocus = (event) => { const cancelFocus = isFunction(beforeFocus) ? beforeFocus(event) : false; if (unref(disabled) || isFocused.value || cancelFocus) return; isFocused.value = true; emit("focus", event); afterFocus == null ? void 0 : afterFocus(); }; const handleBlur = (event) => { var _a; const cancelBlur = isFunction(beforeBlur) ? beforeBlur(event) : false; if (unref(disabled) || event.relatedTarget && ((_a = wrapperRef.value) == null ? void 0 : _a.contains(event.relatedTarget)) || cancelBlur) return; isFocused.value = false; emit("blur", event); afterBlur == null ? void 0 : afterBlur(); }; const handleClick = (event) => { var _a, _b; if (unref(disabled) || isFocusable(event.target) || ((_a = wrapperRef.value) == null ? void 0 : _a.contains(document.activeElement)) && wrapperRef.value !== document.activeElement) return; (_b = target.value) == null ? void 0 : _b.focus(); }; watch([wrapperRef, () => unref(disabled)], ([el, disabled2]) => { if (!el) return; if (disabled2) el.removeAttribute("tabindex"); else el.setAttribute("tabindex", "-1"); }); useEventListener(wrapperRef, "focus", handleFocus, true); useEventListener(wrapperRef, "blur", handleBlur, true); useEventListener(wrapperRef, "click", handleClick, true); return { isFocused, wrapperRef, handleFocus, handleBlur }; } function useComposition({ afterComposition, emit }) { const isComposing = ref(false); const handleCompositionStart = (event) => { emit == null ? void 0 : emit("compositionstart", event); isComposing.value = true; }; const handleCompositionUpdate = (event) => { emit == null ? void 0 : emit("compositionupdate", event); isComposing.value = true; }; const handleCompositionEnd = (event) => { emit == null ? void 0 : emit("compositionend", event); if (isComposing.value) { isComposing.value = false; nextTick(() => afterComposition(event)); } }; const handleComposition = (event) => { event.type === "compositionend" ? handleCompositionEnd(event) : handleCompositionUpdate(event); }; return { isComposing, handleComposition, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd }; } const emptyValuesContextKey = Symbol("emptyValuesContextKey"); const SCOPE$8 = "use-empty-values"; const DEFAULT_EMPTY_VALUES = [ "", void 0, null ]; const DEFAULT_VALUE_ON_CLEAR = void 0; const useEmptyValuesProps = buildProps({ emptyValues: Array, valueOnClear: { type: definePropType([ String, Number, Boolean, Function ]), default: void 0, validator: (val) => { val = isFunction(val) ? val() : val; if (isArray(val)) return val.every((item) => !item); return !val; } } }); const useEmptyValues = (props2, defaultValue) => { const config = getCurrentInstance() ? inject(emptyValuesContextKey, ref({})) : ref({}); const emptyValues = computed(() => props2.emptyValues || config.value.emptyValues || DEFAULT_EMPTY_VALUES); const valueOnClear = computed(() => { if (isFunction(props2.valueOnClear)) return props2.valueOnClear(); else if (props2.valueOnClear !== void 0) return props2.valueOnClear; else if (isFunction(config.value.valueOnClear)) return config.value.valueOnClear(); else if (config.value.valueOnClear !== void 0) return config.value.valueOnClear; return defaultValue !== void 0 ? defaultValue : DEFAULT_VALUE_ON_CLEAR; }); const isEmptyValue = (value) => { let result = true; if (isArray(value)) result = emptyValues.value.some((emptyValue) => { return isEqual(value, emptyValue); }); else result = emptyValues.value.includes(value); return result; }; if (!isEmptyValue(valueOnClear.value)) debugWarn(SCOPE$8, "value-on-clear should be a value of empty-values"); return { emptyValues, valueOnClear, isEmptyValue }; }; const ariaProps = buildProps({ ariaLabel: String, ariaOrientation: { type: String, values: [ "horizontal", "vertical", "undefined" ] }, ariaControls: String }); const useAriaProps = (arias) => { return pick(ariaProps, arias); }; const withPropsDefaultsSetter = (target) => { const _p = target.props; const props2 = isArray(_p) ? fromPairs(_p.map((key) => [key, {}])) : _p; target.setPropsDefaults = (defaults) => { if (!props2) return; for (const [key, value] of Object.entries(defaults)) { const prop = props2[key]; if (!hasOwn(props2, key)) continue; if (isPlainObject(prop)) { props2[key] = { ...prop, default: value }; continue; } props2[key] = { type: prop, default: value }; } target.props = props2; }; }; const withInstall = (main, extra) => { main.install = (app) => { for (const comp of [main, ...Object.values(extra ?? {})]) app.component(comp.name, comp); }; if (extra) for (const [key, comp] of Object.entries(extra)) main[key] = comp; withPropsDefaultsSetter(main); return main; }; const withInstallFunction = (fn, name) => { fn.install = (app) => { fn._context = app._context; app.config.globalProperties[name] = fn; }; return fn; }; const withInstallDirective = (directive, name) => { directive.install = (app) => { app.directive(name, directive); }; return directive; }; const withNoopInstall = (component2) => { component2.install = NOOP; withPropsDefaultsSetter(component2); return component2; }; var teleport_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "teleport", props: teleportProps, setup(__props) { return (_ctx, _cache) => { return _ctx.disabled ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport, { key: 1, to: _ctx.to }, [renderSlot(_ctx.$slots, "default")], 8, ["to"])); }; } }); var teleport_default = teleport_vue_vue_type_script_setup_true_lang_default; const ElTeleport = withInstall(teleport_default); const COMPONENT_NAME$m = "ElAffix"; var affix_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$m, __name: "affix", props: affixProps, emits: affixEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("affix"); const target = shallowRef(); const root = shallowRef(); const scrollContainer = shallowRef(); const { height: windowHeight } = useWindowSize(); const { height: rootHeight, width: rootWidth, top: rootTop, bottom: rootBottom, left: rootLeft, update: updateRoot } = useElementBounding(root, { windowScroll: false }); const targetRect = useElementBounding(target); const fixed = ref(false); const scrollTop = ref(0); const transform = ref(0); const teleportDisabled = computed(() => { return !props2.teleported || !fixed.value; }); const rootStyle = computed(() => { return { display: "flow-root", height: fixed.value ? `${rootHeight.value}px` : "", width: fixed.value ? `${rootWidth.value}px` : "" }; }); const affixStyle = computed(() => { if (!fixed.value) return {}; const offset2 = addUnit(props2.offset); return { height: `${rootHeight.value}px`, width: `${rootWidth.value}px`, top: props2.position === "top" ? offset2 : "", bottom: props2.position === "bottom" ? offset2 : "", left: props2.teleported ? `${rootLeft.value}px` : "", transform: transform.value ? `translateY(${transform.value}px)` : "", zIndex: props2.zIndex }; }); const update = () => { if (!scrollContainer.value) return; scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0; const { position, target: target2, offset: offset2 } = props2; const rootHeightOffset = offset2 + rootHeight.value; if (position === "top") if (target2) { const difference = targetRect.bottom.value - rootHeightOffset; fixed.value = offset2 > rootTop.value && targetRect.bottom.value > 0; transform.value = difference < 0 ? difference : 0; } else fixed.value = offset2 > rootTop.value; else if (target2) { const difference = windowHeight.value - targetRect.top.value - rootHeightOffset; fixed.value = windowHeight.value - offset2 < rootBottom.value && windowHeight.value > targetRect.top.value; transform.value = difference < 0 ? -difference : 0; } else fixed.value = windowHeight.value - offset2 < rootBottom.value; }; const updateRootRect = async () => { if (!fixed.value) { updateRoot(); return; } fixed.value = false; await nextTick(); updateRoot(); fixed.value = true; }; const handleScroll2 = async () => { updateRoot(); await nextTick(); emit("scroll", { scrollTop: scrollTop.value, fixed: fixed.value }); }; watch(fixed, (val) => emit(CHANGE_EVENT, val)); onMounted(() => { if (props2.target) { target.value = document.querySelector(props2.target) ?? void 0; if (!target.value) throwError(COMPONENT_NAME$m, `Target does not exist: ${props2.target}`); } else target.value = document.documentElement; scrollContainer.value = getScrollContainer(root.value, true); updateRoot(); }); onActivated(() => { nextTick(updateRootRect); }); onDeactivated(() => { fixed.value = false; }); useEventListener(scrollContainer, "scroll", handleScroll2); watchEffect(update); __expose({ update, updateRoot: updateRootRect }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "root", ref: root, class: normalizeClass(unref(ns).b()), style: normalizeStyle(rootStyle.value) }, [createVNode(unref(ElTeleport), { disabled: teleportDisabled.value, to: __props.appendTo }, { default: withCtx(() => [createBaseVNode("div", { class: normalizeClass({ [unref(ns).m("fixed")]: fixed.value }), style: normalizeStyle(affixStyle.value) }, [renderSlot(_ctx.$slots, "default")], 6)]), _: 3 }, 8, ["disabled", "to"])], 6); }; } }); var affix_default = affix_vue_vue_type_script_setup_true_lang_default; const ElAffix = withInstall(affix_default); /*! Element Plus Icons Vue v2.3.2 */ var _sfc_main = /* @__PURE__ */ defineComponent({ name: "AddLocation", __name: "add-location", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M288 896h448q32 0 32 32t-32 32H288q-32 0-32-32t32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544" }), createBaseVNode("path", { fill: "currentColor", d: "M544 384h96a32 32 0 1 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64h96v-96a32 32 0 0 1 64 0z" }) ])); } }), add_location_default = _sfc_main; var _sfc_main2 = /* @__PURE__ */ defineComponent({ name: "Aim", __name: "aim", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32" }) ])); } }), aim_default = _sfc_main2; var _sfc_main3 = /* @__PURE__ */ defineComponent({ name: "AlarmClock", __name: "alarm-clock", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 832a320 320 0 1 0 0-640 320 320 0 0 0 0 640m0 64a384 384 0 1 1 0-768 384 384 0 0 1 0 768" }), createBaseVNode("path", { fill: "currentColor", d: "m292.288 824.576 55.424 32-48 83.136a32 32 0 1 1-55.424-32zm439.424 0-55.424 32 48 83.136a32 32 0 1 0 55.424-32zM512 512h160a32 32 0 1 1 0 64H480a32 32 0 0 1-32-32V320a32 32 0 0 1 64 0zM90.496 312.256A160 160 0 0 1 312.32 90.496l-46.848 46.848a96 96 0 0 0-128 128L90.56 312.256zm835.264 0A160 160 0 0 0 704 90.496l46.848 46.848a96 96 0 0 1 128 128z" }) ])); } }), alarm_clock_default = _sfc_main3; var _sfc_main4 = /* @__PURE__ */ defineComponent({ name: "Apple", __name: "apple", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M599.872 203.776a189.4 189.4 0 0 1 64.384-4.672l2.624.128c31.168 1.024 51.2 4.096 79.488 16.32 37.632 16.128 74.496 45.056 111.488 89.344 96.384 115.264 82.752 372.8-34.752 521.728-7.68 9.728-32 41.6-30.72 39.936a427 427 0 0 1-30.08 35.776c-31.232 32.576-65.28 49.216-110.08 50.048-31.36.64-53.568-5.312-84.288-18.752l-6.528-2.88c-20.992-9.216-30.592-11.904-47.296-11.904-18.112 0-28.608 2.88-51.136 12.672l-6.464 2.816c-28.416 12.224-48.32 18.048-76.16 19.2-74.112 2.752-116.928-38.08-180.672-132.16-96.64-142.08-132.608-349.312-55.04-486.4 46.272-81.92 129.92-133.632 220.672-135.04 32.832-.576 60.288 6.848 99.648 22.72 27.136 10.88 34.752 13.76 37.376 14.272 16.256-20.16 27.776-36.992 34.56-50.24 13.568-26.304 27.2-59.968 40.704-100.8a32 32 0 1 1 60.8 20.224c-12.608 37.888-25.408 70.4-38.528 97.664m-51.52 78.08c-14.528 17.792-31.808 37.376-51.904 58.816a32 32 0 1 1-46.72-43.776l12.288-13.248c-28.032-11.2-61.248-26.688-95.68-26.112-70.4 1.088-135.296 41.6-171.648 105.792C121.6 492.608 176 684.16 247.296 788.992c34.816 51.328 76.352 108.992 130.944 106.944 52.48-2.112 72.32-34.688 135.872-34.688s81.28 34.688 136.96 33.536c56.448-1.088 75.776-39.04 126.848-103.872 107.904-136.768 107.904-362.752 35.776-449.088-72.192-86.272-124.672-84.096-151.68-85.12-41.472-4.288-81.6 12.544-113.664 25.152" }) ])); } }), apple_default = _sfc_main4; var _sfc_main5 = /* @__PURE__ */ defineComponent({ name: "ArrowDownBold", __name: "arrow-down-bold", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M104.704 338.752a64 64 0 0 1 90.496 0l316.8 316.8 316.8-316.8a64 64 0 0 1 90.496 90.496L557.248 791.296a64 64 0 0 1-90.496 0L104.704 429.248a64 64 0 0 1 0-90.496" }) ])); } }), arrow_down_bold_default = _sfc_main5; var _sfc_main6 = /* @__PURE__ */ defineComponent({ name: "ArrowDown", __name: "arrow-down", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z" }) ])); } }), arrow_down_default = _sfc_main6; var _sfc_main7 = /* @__PURE__ */ defineComponent({ name: "ArrowLeftBold", __name: "arrow-left-bold", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M685.248 104.704a64 64 0 0 1 0 90.496L368.448 512l316.8 316.8a64 64 0 0 1-90.496 90.496L232.704 557.248a64 64 0 0 1 0-90.496l362.048-362.048a64 64 0 0 1 90.496 0" }) ])); } }), arrow_left_bold_default = _sfc_main7; var _sfc_main8 = /* @__PURE__ */ defineComponent({ name: "ArrowLeft", __name: "arrow-left", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0" }) ])); } }), arrow_left_default = _sfc_main8; var _sfc_main9 = /* @__PURE__ */ defineComponent({ name: "ArrowRightBold", __name: "arrow-right-bold", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M338.752 104.704a64 64 0 0 0 0 90.496l316.8 316.8-316.8 316.8a64 64 0 0 0 90.496 90.496l362.048-362.048a64 64 0 0 0 0-90.496L429.248 104.704a64 64 0 0 0-90.496 0" }) ])); } }), arrow_right_bold_default = _sfc_main9; var _sfc_main10 = /* @__PURE__ */ defineComponent({ name: "ArrowRight", __name: "arrow-right", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z" }) ])); } }), arrow_right_default = _sfc_main10; var _sfc_main11 = /* @__PURE__ */ defineComponent({ name: "ArrowUpBold", __name: "arrow-up-bold", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M104.704 685.248a64 64 0 0 0 90.496 0l316.8-316.8 316.8 316.8a64 64 0 0 0 90.496-90.496L557.248 232.704a64 64 0 0 0-90.496 0L104.704 594.752a64 64 0 0 0 0 90.496" }) ])); } }), arrow_up_bold_default = _sfc_main11; var _sfc_main12 = /* @__PURE__ */ defineComponent({ name: "ArrowUp", __name: "arrow-up", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0" }) ])); } }), arrow_up_default = _sfc_main12; var _sfc_main13 = /* @__PURE__ */ defineComponent({ name: "Avatar", __name: "avatar", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M628.736 528.896A416 416 0 0 1 928 928H96a415.87 415.87 0 0 1 299.264-399.104L512 704zM720 304a208 208 0 1 1-416 0 208 208 0 0 1 416 0" }) ])); } }), avatar_default$1 = _sfc_main13; var _sfc_main14 = /* @__PURE__ */ defineComponent({ name: "Back", __name: "back", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64" }), createBaseVNode("path", { fill: "currentColor", d: "m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312z" }) ])); } }), back_default = _sfc_main14; var _sfc_main15 = /* @__PURE__ */ defineComponent({ name: "Baseball", __name: "baseball", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M195.2 828.8a448 448 0 1 1 633.6-633.6 448 448 0 0 1-633.6 633.6m45.248-45.248a384 384 0 1 0 543.104-543.104 384 384 0 0 0-543.104 543.104" }), createBaseVNode("path", { fill: "currentColor", d: "M497.472 96.896c22.784 4.672 44.416 9.472 64.896 14.528a256.128 256.128 0 0 0 350.208 350.208c5.056 20.48 9.856 42.112 14.528 64.896A320.128 320.128 0 0 1 497.472 96.896M108.48 491.904a320.128 320.128 0 0 1 423.616 423.68c-23.04-3.648-44.992-7.424-65.728-11.52a256.128 256.128 0 0 0-346.496-346.432 1737 1737 0 0 1-11.392-65.728" }) ])); } }), baseball_default = _sfc_main15; var _sfc_main16 = /* @__PURE__ */ defineComponent({ name: "Basketball", __name: "basketball", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M778.752 788.224a382.46 382.46 0 0 0 116.032-245.632 256.51 256.51 0 0 0-241.728-13.952 762.9 762.9 0 0 1 125.696 259.584m-55.04 44.224a699.65 699.65 0 0 0-125.056-269.632 256.13 256.13 0 0 0-56.064 331.968 382.7 382.7 0 0 0 181.12-62.336m-254.08 61.248A320.13 320.13 0 0 1 557.76 513.6a716 716 0 0 0-48.192-48.128 320.13 320.13 0 0 1-379.264 88.384 382.4 382.4 0 0 0 110.144 229.696 382.4 382.4 0 0 0 229.184 110.08zM129.28 481.088a256.13 256.13 0 0 0 331.072-56.448 699.65 699.65 0 0 0-268.8-124.352 382.66 382.66 0 0 0-62.272 180.8m106.56-235.84a762.9 762.9 0 0 1 258.688 125.056 256.51 256.51 0 0 0-13.44-241.088A382.46 382.46 0 0 0 235.84 245.248m318.08-114.944c40.576 89.536 37.76 193.92-8.448 281.344a780 780 0 0 1 66.176 66.112 320.83 320.83 0 0 1 282.112-8.128 382.4 382.4 0 0 0-110.144-229.12 382.4 382.4 0 0 0-229.632-110.208zM828.8 828.8a448 448 0 1 1-633.6-633.6 448 448 0 0 1 633.6 633.6" }) ])); } }), basketball_default = _sfc_main16; var _sfc_main17 = /* @__PURE__ */ defineComponent({ name: "BellFilled", __name: "bell-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M640 832a128 128 0 0 1-256 0zm192-64H134.4a38.4 38.4 0 0 1 0-76.8H192V448c0-154.88 110.08-284.16 256.32-313.6a64 64 0 1 1 127.36 0A320.13 320.13 0 0 1 832 448v243.2h57.6a38.4 38.4 0 0 1 0 76.8z" }) ])); } }), bell_filled_default = _sfc_main17; var _sfc_main18 = /* @__PURE__ */ defineComponent({ name: "Bell", __name: "bell", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a64 64 0 0 1 64 64v64H448v-64a64 64 0 0 1 64-64" }), createBaseVNode("path", { fill: "currentColor", d: "M256 768h512V448a256 256 0 1 0-512 0zm256-640a320 320 0 0 1 320 320v384H192V448a320 320 0 0 1 320-320" }), createBaseVNode("path", { fill: "currentColor", d: "M96 768h832q32 0 32 32t-32 32H96q-32 0-32-32t32-32m352 128h128a64 64 0 0 1-128 0" }) ])); } }), bell_default = _sfc_main18; var _sfc_main19 = /* @__PURE__ */ defineComponent({ name: "Bicycle", __name: "bicycle", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 832a128 128 0 1 0 0-256 128 128 0 0 0 0 256m0 64a192 192 0 1 1 0-384 192 192 0 0 1 0 384" }), createBaseVNode("path", { fill: "currentColor", d: "M288 672h320q32 0 32 32t-32 32H288q-32 0-32-32t32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M768 832a128 128 0 1 0 0-256 128 128 0 0 0 0 256m0 64a192 192 0 1 1 0-384 192 192 0 0 1 0 384" }), createBaseVNode("path", { fill: "currentColor", d: "M480 192a32 32 0 0 1 0-64h160a32 32 0 0 1 31.04 24.256l96 384a32 32 0 0 1-62.08 15.488L615.04 192zM96 384a32 32 0 0 1 0-64h128a32 32 0 0 1 30.336 21.888l64 192a32 32 0 1 1-60.672 20.224L200.96 384z" }), createBaseVNode("path", { fill: "currentColor", d: "m373.376 599.808-42.752-47.616 320-288 42.752 47.616z" }) ])); } }), bicycle_default = _sfc_main19; var _sfc_main20 = /* @__PURE__ */ defineComponent({ name: "BottomLeft", __name: "bottom-left", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 768h416a32 32 0 1 1 0 64H224a32 32 0 0 1-32-32V352a32 32 0 0 1 64 0z" }), createBaseVNode("path", { fill: "currentColor", d: "M246.656 822.656a32 32 0 0 1-45.312-45.312l544-544a32 32 0 0 1 45.312 45.312z" }) ])); } }), bottom_left_default = _sfc_main20; var _sfc_main21 = /* @__PURE__ */ defineComponent({ name: "BottomRight", __name: "bottom-right", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M352 768a32 32 0 1 0 0 64h448a32 32 0 0 0 32-32V352a32 32 0 0 0-64 0v416z" }), createBaseVNode("path", { fill: "currentColor", d: "M777.344 822.656a32 32 0 0 0 45.312-45.312l-544-544a32 32 0 0 0-45.312 45.312z" }) ])); } }), bottom_right_default = _sfc_main21; var _sfc_main22 = /* @__PURE__ */ defineComponent({ name: "Bottom", __name: "bottom", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M544 805.888V168a32 32 0 1 0-64 0v637.888L246.656 557.952a30.72 30.72 0 0 0-45.312 0 35.52 35.52 0 0 0 0 48.064l288 306.048a30.72 30.72 0 0 0 45.312 0l288-306.048a35.52 35.52 0 0 0 0-48 30.72 30.72 0 0 0-45.312 0L544 805.824z" }) ])); } }), bottom_default = _sfc_main22; var _sfc_main23 = /* @__PURE__ */ defineComponent({ name: "Bowl", __name: "bowl", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M714.432 704a351.74 351.74 0 0 0 148.16-256H161.408a351.74 351.74 0 0 0 148.16 256zM288 766.592A415.68 415.68 0 0 1 96 416a32 32 0 0 1 32-32h768a32 32 0 0 1 32 32 415.68 415.68 0 0 1-192 350.592V832a64 64 0 0 1-64 64H352a64 64 0 0 1-64-64zM493.248 320h-90.496l254.4-254.4a32 32 0 1 1 45.248 45.248zm187.328 0h-128l269.696-155.712a32 32 0 0 1 32 55.424zM352 768v64h320v-64z" }) ])); } }), bowl_default = _sfc_main23; var _sfc_main24 = /* @__PURE__ */ defineComponent({ name: "Box", __name: "box", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M317.056 128 128 344.064V896h768V344.064L706.944 128zm-14.528-64h418.944a32 32 0 0 1 24.064 10.88l206.528 236.096A32 32 0 0 1 960 332.032V928a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V332.032a32 32 0 0 1 7.936-21.12L278.4 75.008A32 32 0 0 1 302.528 64" }), createBaseVNode("path", { fill: "currentColor", d: "M64 320h896v64H64z" }), createBaseVNode("path", { fill: "currentColor", d: "M448 327.872V640h128V327.872L526.08 128h-28.16zM448 64h128l64 256v352a32 32 0 0 1-32 32H416a32 32 0 0 1-32-32V320z" }) ])); } }), box_default = _sfc_main24; var _sfc_main25 = /* @__PURE__ */ defineComponent({ name: "Briefcase", __name: "briefcase", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M320 320V128h384v192h192v192H128V320zM128 576h768v320H128zm256-256h256.064V192H384z" }) ])); } }), briefcase_default = _sfc_main25; var _sfc_main26 = /* @__PURE__ */ defineComponent({ name: "BrushFilled", __name: "brush-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M608 704v160a96 96 0 0 1-192 0V704h-96a128 128 0 0 1-128-128h640a128 128 0 0 1-128 128zM192 512V128.064h640V512z" }) ])); } }), brush_filled_default = _sfc_main26; var _sfc_main27 = /* @__PURE__ */ defineComponent({ name: "Brush", __name: "brush", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M896 448H128v192a64 64 0 0 0 64 64h192v192h256V704h192a64 64 0 0 0 64-64zm-770.752-64c0-47.552 5.248-90.24 15.552-128 14.72-54.016 42.496-107.392 83.2-160h417.28l-15.36 70.336L736 96h211.2c-24.832 42.88-41.92 96.256-51.2 160a664 664 0 0 0-6.144 128H960v256a128 128 0 0 1-128 128H704v160a32 32 0 0 1-32 32H352a32 32 0 0 1-32-32V768H192A128 128 0 0 1 64 640V384zm64 0h636.544c-2.048-45.824.256-91.584 6.848-137.216 4.48-30.848 10.688-59.776 18.688-86.784h-96.64l-221.12 141.248L561.92 160H256.512c-25.856 37.888-43.776 75.456-53.952 112.832-8.768 32.064-13.248 69.12-13.312 111.168" }) ])); } }), brush_default = _sfc_main27; var _sfc_main28 = /* @__PURE__ */ defineComponent({ name: "Burger", __name: "burger", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 512a32 32 0 0 0-32 32v64a32 32 0 0 0 30.08 32H864a32 32 0 0 0 32-32v-64a32 32 0 0 0-32-32zm736-58.56A96 96 0 0 1 960 544v64a96 96 0 0 1-51.968 85.312L855.36 833.6a96 96 0 0 1-89.856 62.272H258.496A96 96 0 0 1 168.64 833.6l-52.608-140.224A96 96 0 0 1 64 608v-64a96 96 0 0 1 64-90.56V448a384 384 0 1 1 768 5.44M832 448a320 320 0 0 0-640 0zM512 704H188.352l40.192 107.136a32 32 0 0 0 29.952 20.736h507.008a32 32 0 0 0 29.952-20.736L835.648 704z" }) ])); } }), burger_default = _sfc_main28; var _sfc_main29 = /* @__PURE__ */ defineComponent({ name: "Calendar", __name: "calendar", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 384v512h768V192H768v32a32 32 0 1 1-64 0v-32H320v32a32 32 0 0 1-64 0v-32H128v128h768v64zm192-256h384V96a32 32 0 1 1 64 0v32h160a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h160V96a32 32 0 0 1 64 0zm-32 384h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64" }) ])); } }), calendar_default$1 = _sfc_main29; var _sfc_main30 = /* @__PURE__ */ defineComponent({ name: "CameraFilled", __name: "camera-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 224a64 64 0 0 0-64 64v512a64 64 0 0 0 64 64h704a64 64 0 0 0 64-64V288a64 64 0 0 0-64-64H748.416l-46.464-92.672A64 64 0 0 0 644.736 96H379.328a64 64 0 0 0-57.216 35.392L275.776 224zm352 435.2a115.2 115.2 0 1 0 0-230.4 115.2 115.2 0 0 0 0 230.4m0 140.8a256 256 0 1 1 0-512 256 256 0 0 1 0 512" }) ])); } }), camera_filled_default = _sfc_main30; var _sfc_main31 = /* @__PURE__ */ defineComponent({ name: "Camera", __name: "camera", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M896 256H128v576h768zm-199.424-64-32.064-64h-304.96l-32 64zM96 192h160l46.336-92.608A64 64 0 0 1 359.552 64h304.96a64 64 0 0 1 57.216 35.328L768.192 192H928a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32m416 512a160 160 0 1 0 0-320 160 160 0 0 0 0 320m0 64a224 224 0 1 1 0-448 224 224 0 0 1 0 448" }) ])); } }), camera_default = _sfc_main31; var _sfc_main32 = /* @__PURE__ */ defineComponent({ name: "CaretBottom", __name: "caret-bottom", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m192 384 320 384 320-384z" }) ])); } }), caret_bottom_default = _sfc_main32; var _sfc_main33 = /* @__PURE__ */ defineComponent({ name: "CaretLeft", __name: "caret-left", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M672 192 288 511.936 672 832z" }) ])); } }), caret_left_default = _sfc_main33; var _sfc_main34 = /* @__PURE__ */ defineComponent({ name: "CaretRight", __name: "caret-right", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M384 192v640l384-320.064z" }) ])); } }), caret_right_default = _sfc_main34; var _sfc_main35 = /* @__PURE__ */ defineComponent({ name: "CaretTop", __name: "caret-top", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 320 192 704h639.936z" }) ])); } }), caret_top_default = _sfc_main35; var _sfc_main36 = /* @__PURE__ */ defineComponent({ name: "Cellphone", __name: "cellphone", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 128a64 64 0 0 0-64 64v640a64 64 0 0 0 64 64h512a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h512a128 128 0 0 1 128 128v640a128 128 0 0 1-128 128H256a128 128 0 0 1-128-128V192A128 128 0 0 1 256 64m128 128h256a32 32 0 1 1 0 64H384a32 32 0 0 1 0-64m128 640a64 64 0 1 1 0-128 64 64 0 0 1 0 128" }) ])); } }), cellphone_default = _sfc_main36; var _sfc_main37 = /* @__PURE__ */ defineComponent({ name: "ChatDotRound", __name: "chat-dot-round", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m174.72 855.68 135.296-45.12 23.68 11.84C388.096 849.536 448.576 864 512 864c211.84 0 384-166.784 384-352S723.84 160 512 160 128 326.784 128 512c0 69.12 24.96 139.264 70.848 199.232l22.08 28.8-46.272 115.584zm-45.248 82.56A32 32 0 0 1 89.6 896l58.368-145.92C94.72 680.32 64 596.864 64 512 64 299.904 256 96 512 96s448 203.904 448 416-192 416-448 416a461.06 461.06 0 0 1-206.912-48.384l-175.616 58.56z" }), createBaseVNode("path", { fill: "currentColor", d: "M512 563.2a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4m192 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4m-384 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4" }) ])); } }), chat_dot_round_default = _sfc_main37; var _sfc_main38 = /* @__PURE__ */ defineComponent({ name: "ChatDotSquare", __name: "chat-dot-square", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M273.536 736H800a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64H224a64 64 0 0 0-64 64v570.88zM296 800 147.968 918.4A32 32 0 0 1 96 893.44V256a128 128 0 0 1 128-128h576a128 128 0 0 1 128 128v416a128 128 0 0 1-128 128z" }), createBaseVNode("path", { fill: "currentColor", d: "M512 499.2a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4m192 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4m-384 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4" }) ])); } }), chat_dot_square_default = _sfc_main38; var _sfc_main39 = /* @__PURE__ */ defineComponent({ name: "ChatLineRound", __name: "chat-line-round", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m174.72 855.68 135.296-45.12 23.68 11.84C388.096 849.536 448.576 864 512 864c211.84 0 384-166.784 384-352S723.84 160 512 160 128 326.784 128 512c0 69.12 24.96 139.264 70.848 199.232l22.08 28.8-46.272 115.584zm-45.248 82.56A32 32 0 0 1 89.6 896l58.368-145.92C94.72 680.32 64 596.864 64 512 64 299.904 256 96 512 96s448 203.904 448 416-192 416-448 416a461.06 461.06 0 0 1-206.912-48.384l-175.616 58.56z" }), createBaseVNode("path", { fill: "currentColor", d: "M352 576h320q32 0 32 32t-32 32H352q-32 0-32-32t32-32m32-192h256q32 0 32 32t-32 32H384q-32 0-32-32t32-32" }) ])); } }), chat_line_round_default = _sfc_main39; var _sfc_main40 = /* @__PURE__ */ defineComponent({ name: "ChatLineSquare", __name: "chat-line-square", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 826.88 273.536 736H800a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64H224a64 64 0 0 0-64 64zM296 800 147.968 918.4A32 32 0 0 1 96 893.44V256a128 128 0 0 1 128-128h576a128 128 0 0 1 128 128v416a128 128 0 0 1-128 128z" }), createBaseVNode("path", { fill: "currentColor", d: "M352 512h320q32 0 32 32t-32 32H352q-32 0-32-32t32-32m0-192h320q32 0 32 32t-32 32H352q-32 0-32-32t32-32" }) ])); } }), chat_line_square_default = _sfc_main40; var _sfc_main41 = /* @__PURE__ */ defineComponent({ name: "ChatRound", __name: "chat-round", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m174.72 855.68 130.048-43.392 23.424 11.392C382.4 849.984 444.352 864 512 864c223.744 0 384-159.872 384-352 0-192.832-159.104-352-384-352S128 319.168 128 512a341.12 341.12 0 0 0 69.248 204.288l21.632 28.8-44.16 110.528zm-45.248 82.56A32 32 0 0 1 89.6 896l56.512-141.248A405.12 405.12 0 0 1 64 512C64 299.904 235.648 96 512 96s448 203.904 448 416-173.44 416-448 416c-79.68 0-150.848-17.152-211.712-46.72l-170.88 56.96z" }) ])); } }), chat_round_default = _sfc_main41; var _sfc_main42 = /* @__PURE__ */ defineComponent({ name: "ChatSquare", __name: "chat-square", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M273.536 736H800a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64H224a64 64 0 0 0-64 64v570.88zM296 800 147.968 918.4A32 32 0 0 1 96 893.44V256a128 128 0 0 1 128-128h576a128 128 0 0 1 128 128v416a128 128 0 0 1-128 128z" }) ])); } }), chat_square_default = _sfc_main42; var _sfc_main43 = /* @__PURE__ */ defineComponent({ name: "Check", __name: "check", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" }) ])); } }), check_default = _sfc_main43; var _sfc_main44 = /* @__PURE__ */ defineComponent({ name: "Checked", __name: "checked", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M704 192h160v736H160V192h160.064v64H704zM311.616 537.28l-45.312 45.248L447.36 763.52l316.8-316.8-45.312-45.184L447.36 673.024zM384 192V96h256v96z" }) ])); } }), checked_default = _sfc_main44; var _sfc_main45 = /* @__PURE__ */ defineComponent({ name: "Cherry", __name: "cherry", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M261.056 449.6c13.824-69.696 34.88-128.96 63.36-177.728 23.744-40.832 61.12-88.64 112.256-143.872H320a32 32 0 0 1 0-64h384a32 32 0 1 1 0 64H554.752c14.912 39.168 41.344 86.592 79.552 141.76 47.36 68.48 84.8 106.752 106.304 114.304a224 224 0 1 1-84.992 14.784c-22.656-22.912-47.04-53.76-73.92-92.608-38.848-56.128-67.008-105.792-84.352-149.312-55.296 58.24-94.528 107.52-117.76 147.2-23.168 39.744-41.088 88.768-53.568 147.072a224.064 224.064 0 1 1-64.96-1.6M288 832a160 160 0 1 0 0-320 160 160 0 0 0 0 320m448-64a160 160 0 1 0 0-320 160 160 0 0 0 0 320" }) ])); } }), cherry_default = _sfc_main45; var _sfc_main46 = /* @__PURE__ */ defineComponent({ name: "Chicken", __name: "chicken", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M349.952 716.992 478.72 588.16a106.7 106.7 0 0 1-26.176-19.072 106.7 106.7 0 0 1-19.072-26.176L304.704 671.744c.768 3.072 1.472 6.144 2.048 9.216l2.048 31.936 31.872 1.984c3.136.64 6.208 1.28 9.28 2.112m57.344 33.152a128 128 0 1 1-216.32 114.432l-1.92-32-32-1.92a128 128 0 1 1 114.432-216.32L416.64 469.248c-2.432-101.44 58.112-239.104 149.056-330.048 107.328-107.328 231.296-85.504 316.8 0 85.44 85.44 107.328 209.408 0 316.8-91.008 90.88-228.672 151.424-330.112 149.056L407.296 750.08zm90.496-226.304c49.536 49.536 233.344-7.04 339.392-113.088 78.208-78.208 63.232-163.072 0-226.304-63.168-63.232-148.032-78.208-226.24 0C504.896 290.496 448.32 474.368 497.792 523.84M244.864 708.928a64 64 0 1 0-59.84 59.84l56.32-3.52zm8.064 127.68a64 64 0 1 0 59.84-59.84l-56.32 3.52z" }) ])); } }), chicken_default = _sfc_main46; var _sfc_main47 = /* @__PURE__ */ defineComponent({ name: "ChromeFilled", __name: "chrome-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xml:space": "preserve", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M938.67 512.01c0-44.59-6.82-87.6-19.54-128H682.67a212.37 212.37 0 0 1 42.67 128c.06 38.71-10.45 76.7-30.42 109.87l-182.91 316.8c235.65-.01 426.66-191.02 426.66-426.67" }), createBaseVNode("path", { fill: "currentColor", d: "M576.79 401.63a127.9 127.9 0 0 0-63.56-17.6c-22.36-.22-44.39 5.43-63.89 16.38s-35.79 26.82-47.25 46.02a128 128 0 0 0-2.16 127.44l1.24 2.13a127.9 127.9 0 0 0 46.36 46.61 127.9 127.9 0 0 0 63.38 17.44c22.29.2 44.24-5.43 63.68-16.33a127.94 127.94 0 0 0 47.16-45.79v-.01l1.11-1.92a127.98 127.98 0 0 0 .29-127.46 127.96 127.96 0 0 0-46.36-46.91" }), createBaseVNode("path", { fill: "currentColor", d: "M394.45 333.96A213.34 213.34 0 0 1 512 298.67h369.58A426.5 426.5 0 0 0 512 85.34a425.6 425.6 0 0 0-171.74 35.98 425.6 425.6 0 0 0-142.62 102.22l118.14 204.63a213.4 213.4 0 0 1 78.67-94.21m117.56 604.72H512zm-97.25-236.73a213.3 213.3 0 0 1-89.54-86.81L142.48 298.6c-36.35 62.81-57.13 135.68-57.13 213.42 0 203.81 142.93 374.22 333.95 416.55h.04l118.19-204.71a213.3 213.3 0 0 1-122.77-21.91" }) ])); } }), chrome_filled_default = _sfc_main47; var _sfc_main48 = /* @__PURE__ */ defineComponent({ name: "CircleCheckFilled", __name: "circle-check-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z" }) ])); } }), circle_check_filled_default = _sfc_main48; var _sfc_main49 = /* @__PURE__ */ defineComponent({ name: "CircleCheck", __name: "circle-check", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z" }) ])); } }), circle_check_default = _sfc_main49; var _sfc_main50 = /* @__PURE__ */ defineComponent({ name: "CircleCloseFilled", __name: "circle-close-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z" }) ])); } }), circle_close_filled_default = _sfc_main50; var _sfc_main51 = /* @__PURE__ */ defineComponent({ name: "CircleClose", __name: "circle-close", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z" }), createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }), circle_close_default = _sfc_main51; var _sfc_main52 = /* @__PURE__ */ defineComponent({ name: "CirclePlusFilled", __name: "circle-plus-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z" }) ])); } }), circle_plus_filled_default = _sfc_main52; var _sfc_main53 = /* @__PURE__ */ defineComponent({ name: "CirclePlus", __name: "circle-plus", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64" }), createBaseVNode("path", { fill: "currentColor", d: "M480 672V352a32 32 0 1 1 64 0v320a32 32 0 0 1-64 0" }), createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }), circle_plus_default = _sfc_main53; var _sfc_main54 = /* @__PURE__ */ defineComponent({ name: "Clock", __name: "clock", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M480 256a32 32 0 0 1 32 32v256a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M480 512h256q32 0 32 32t-32 32H480q-32 0-32-32t32-32" }) ])); } }), clock_default = _sfc_main54; var _sfc_main55 = /* @__PURE__ */ defineComponent({ name: "CloseBold", __name: "close-bold", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496" }) ])); } }), close_bold_default = _sfc_main55; var _sfc_main56 = /* @__PURE__ */ defineComponent({ name: "Close", __name: "close", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z" }) ])); } }), close_default = _sfc_main56; var _sfc_main57 = /* @__PURE__ */ defineComponent({ name: "Cloudy", __name: "cloudy", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M598.4 831.872H328.192a256 256 0 0 1-34.496-510.528A352 352 0 1 1 598.4 831.872m-271.36-64h272.256a288 288 0 1 0-248.512-417.664L335.04 381.44l-34.816 3.584a192 192 0 0 0 26.88 382.848z" }) ])); } }), cloudy_default = _sfc_main57; var _sfc_main58 = /* @__PURE__ */ defineComponent({ name: "CoffeeCup", __name: "coffee-cup", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M768 192a192 192 0 1 1-8 383.808A256.13 256.13 0 0 1 512 768H320A256 256 0 0 1 64 512V160a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 64v256a128 128 0 1 0 0-256M96 832h640a32 32 0 1 1 0 64H96a32 32 0 1 1 0-64m32-640v320a192 192 0 0 0 192 192h192a192 192 0 0 0 192-192V192z" }) ])); } }), coffee_cup_default = _sfc_main58; var _sfc_main59 = /* @__PURE__ */ defineComponent({ name: "Coffee", __name: "coffee", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M822.592 192h14.272a32 32 0 0 1 31.616 26.752l21.312 128A32 32 0 0 1 858.24 384h-49.344l-39.04 546.304A32 32 0 0 1 737.92 960H285.824a32 32 0 0 1-32-29.696L214.912 384H165.76a32 32 0 0 1-31.552-37.248l21.312-128A32 32 0 0 1 187.136 192h14.016l-6.72-93.696A32 32 0 0 1 226.368 64h571.008a32 32 0 0 1 31.936 34.304zm-64.128 0 4.544-64H260.736l4.544 64zm-548.16 128H820.48l-10.688-64H214.208l-10.688 64zm68.736 64 36.544 512H708.16l36.544-512z" }) ])); } }), coffee_default = _sfc_main59; var _sfc_main60 = /* @__PURE__ */ defineComponent({ name: "Coin", __name: "coin", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m161.92 580.736 29.888 58.88C171.328 659.776 160 681.728 160 704c0 82.304 155.328 160 352 160s352-77.696 352-160c0-22.272-11.392-44.16-31.808-64.32l30.464-58.432C903.936 615.808 928 657.664 928 704c0 129.728-188.544 224-416 224S96 833.728 96 704c0-46.592 24.32-88.576 65.92-123.264" }), createBaseVNode("path", { fill: "currentColor", d: "m161.92 388.736 29.888 58.88C171.328 467.84 160 489.792 160 512c0 82.304 155.328 160 352 160s352-77.696 352-160c0-22.272-11.392-44.16-31.808-64.32l30.464-58.432C903.936 423.808 928 465.664 928 512c0 129.728-188.544 224-416 224S96 641.728 96 512c0-46.592 24.32-88.576 65.92-123.264" }), createBaseVNode("path", { fill: "currentColor", d: "M512 544c-227.456 0-416-94.272-416-224S284.544 96 512 96s416 94.272 416 224-188.544 224-416 224m0-64c196.672 0 352-77.696 352-160S708.672 160 512 160s-352 77.696-352 160 155.328 160 352 160" }) ])); } }), coin_default = _sfc_main60; var _sfc_main61 = /* @__PURE__ */ defineComponent({ name: "ColdDrink", __name: "cold-drink", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M768 64a192 192 0 1 1-69.952 370.88L480 725.376V896h96a32 32 0 1 1 0 64H320a32 32 0 1 1 0-64h96V725.376L76.8 273.536a64 64 0 0 1-12.8-38.4v-10.688a32 32 0 0 1 32-32h71.808l-65.536-83.84a32 32 0 0 1 50.432-39.424l96.256 123.264h337.728A192.06 192.06 0 0 1 768 64M656.896 192.448H800a32 32 0 0 1 32 32v10.624a64 64 0 0 1-12.8 38.4l-80.448 107.2a128 128 0 1 0-81.92-188.16v-.064zm-357.888 64 129.472 165.76a32 32 0 0 1-50.432 39.36l-160.256-205.12H144l304 404.928 304-404.928z" }) ])); } }), cold_drink_default = _sfc_main61; var _sfc_main62 = /* @__PURE__ */ defineComponent({ name: "CollectionTag", __name: "collection-tag", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 128v698.88l196.032-156.864a96 96 0 0 1 119.936 0L768 826.816V128zm-32-64h576a32 32 0 0 1 32 32v797.44a32 32 0 0 1-51.968 24.96L531.968 720a32 32 0 0 0-39.936 0L243.968 918.4A32 32 0 0 1 192 893.44V96a32 32 0 0 1 32-32" }) ])); } }), collection_tag_default = _sfc_main62; var _sfc_main63 = /* @__PURE__ */ defineComponent({ name: "Collection", __name: "collection", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M192 736h640V128H256a64 64 0 0 0-64 64zm64-672h608a32 32 0 0 1 32 32v672a32 32 0 0 1-32 32H160l-32 57.536V192A128 128 0 0 1 256 64" }), createBaseVNode("path", { fill: "currentColor", d: "M240 800a48 48 0 1 0 0 96h592v-96zm0-64h656v160a64 64 0 0 1-64 64H240a112 112 0 0 1 0-224m144-608v250.88l96-76.8 96 76.8V128zm-64-64h320v381.44a32 32 0 0 1-51.968 24.96L480 384l-108.032 86.4A32 32 0 0 1 320 445.44z" }) ])); } }), collection_default$1 = _sfc_main63; var _sfc_main64 = /* @__PURE__ */ defineComponent({ name: "Comment", __name: "comment", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112M128 128v640h192v160l224-160h352V128z" }) ])); } }), comment_default = _sfc_main64; var _sfc_main65 = /* @__PURE__ */ defineComponent({ name: "Compass", __name: "compass", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M725.888 315.008C676.48 428.672 624 513.28 568.576 568.64c-55.424 55.424-139.968 107.904-253.568 157.312a12.8 12.8 0 0 1-16.896-16.832c49.536-113.728 102.016-198.272 157.312-253.632 55.36-55.296 139.904-107.776 253.632-157.312a12.8 12.8 0 0 1 16.832 16.832" }) ])); } }), compass_default = _sfc_main65; var _sfc_main66 = /* @__PURE__ */ defineComponent({ name: "Connection", __name: "connection", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M640 384v64H448a128 128 0 0 0-128 128v128a128 128 0 0 0 128 128h320a128 128 0 0 0 128-128V576a128 128 0 0 0-64-110.848V394.88c74.56 26.368 128 97.472 128 181.056v128a192 192 0 0 1-192 192H448a192 192 0 0 1-192-192V576a192 192 0 0 1 192-192z" }), createBaseVNode("path", { fill: "currentColor", d: "M384 640v-64h192a128 128 0 0 0 128-128V320a128 128 0 0 0-128-128H256a128 128 0 0 0-128 128v128a128 128 0 0 0 64 110.848v70.272A192.06 192.06 0 0 1 64 448V320a192 192 0 0 1 192-192h320a192 192 0 0 1 192 192v128a192 192 0 0 1-192 192z" }) ])); } }), connection_default = _sfc_main66; var _sfc_main67 = /* @__PURE__ */ defineComponent({ name: "Coordinate", __name: "coordinate", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M480 512h64v320h-64z" }), createBaseVNode("path", { fill: "currentColor", d: "M192 896h640a64 64 0 0 0-64-64H256a64 64 0 0 0-64 64m64-128h512a128 128 0 0 1 128 128v64H128v-64a128 128 0 0 1 128-128m256-256a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512" }) ])); } }), coordinate_default = _sfc_main67; var _sfc_main68 = /* @__PURE__ */ defineComponent({ name: "CopyDocument", __name: "copy-document", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z" }), createBaseVNode("path", { fill: "currentColor", d: "M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64" }) ])); } }), copy_document_default = _sfc_main68; var _sfc_main69 = /* @__PURE__ */ defineComponent({ name: "Cpu", __name: "cpu", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M320 256a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64V320a64 64 0 0 0-64-64zm0-64h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128H320a128 128 0 0 1-128-128V320a128 128 0 0 1 128-128" }), createBaseVNode("path", { fill: "currentColor", d: "M512 64a32 32 0 0 1 32 32v128h-64V96a32 32 0 0 1 32-32m160 0a32 32 0 0 1 32 32v128h-64V96a32 32 0 0 1 32-32m-320 0a32 32 0 0 1 32 32v128h-64V96a32 32 0 0 1 32-32m160 896a32 32 0 0 1-32-32V800h64v128a32 32 0 0 1-32 32m160 0a32 32 0 0 1-32-32V800h64v128a32 32 0 0 1-32 32m-320 0a32 32 0 0 1-32-32V800h64v128a32 32 0 0 1-32 32M64 512a32 32 0 0 1 32-32h128v64H96a32 32 0 0 1-32-32m0-160a32 32 0 0 1 32-32h128v64H96a32 32 0 0 1-32-32m0 320a32 32 0 0 1 32-32h128v64H96a32 32 0 0 1-32-32m896-160a32 32 0 0 1-32 32H800v-64h128a32 32 0 0 1 32 32m0-160a32 32 0 0 1-32 32H800v-64h128a32 32 0 0 1 32 32m0 320a32 32 0 0 1-32 32H800v-64h128a32 32 0 0 1 32 32" }) ])); } }), cpu_default = _sfc_main69; var _sfc_main70 = /* @__PURE__ */ defineComponent({ name: "CreditCard", __name: "credit-card", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M896 324.096c0-42.368-2.496-55.296-9.536-68.48a52.35 52.35 0 0 0-22.144-22.08c-13.12-7.04-26.048-9.536-68.416-9.536H228.096c-42.368 0-55.296 2.496-68.48 9.536a52.35 52.35 0 0 0-22.08 22.144c-7.04 13.12-9.536 26.048-9.536 68.416v375.808c0 42.368 2.496 55.296 9.536 68.48a52.35 52.35 0 0 0 22.144 22.08c13.12 7.04 26.048 9.536 68.416 9.536h567.808c42.368 0 55.296-2.496 68.48-9.536a52.35 52.35 0 0 0 22.08-22.144c7.04-13.12 9.536-26.048 9.536-68.416zm64 0v375.808c0 57.088-5.952 77.76-17.088 98.56-11.136 20.928-27.52 37.312-48.384 48.448S852.928 864 795.968 864H228.032c-57.088 0-77.76-5.952-98.56-17.088a116.3 116.3 0 0 1-48.448-48.384c-11.136-20.864-17.088-41.6-17.088-98.56V324.032c0-57.088 5.952-77.76 17.088-98.56 11.136-20.928 27.52-37.312 48.384-48.448s41.6-17.088 98.56-17.088H795.84c57.088 0 77.76 5.952 98.56 17.088 20.928 11.136 37.312 27.52 48.448 48.384s17.088 41.6 17.088 98.56z" }), createBaseVNode("path", { fill: "currentColor", d: "M64 320h896v64H64zm0 128h896v64H64zm128 192h256v64H192z" }) ])); } }), credit_card_default = _sfc_main70; var _sfc_main71 = /* @__PURE__ */ defineComponent({ name: "Crop", __name: "crop", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 768h672a32 32 0 1 1 0 64H224a32 32 0 0 1-32-32V96a32 32 0 0 1 64 0z" }), createBaseVNode("path", { fill: "currentColor", d: "M832 224v704a32 32 0 1 1-64 0V256H96a32 32 0 0 1 0-64h704a32 32 0 0 1 32 32" }) ])); } }), crop_default = _sfc_main71; var _sfc_main72 = /* @__PURE__ */ defineComponent({ name: "DArrowLeft", __name: "d-arrow-left", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M529.408 149.376a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L259.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L197.76 534.272a32 32 0 0 1 0-44.672zm256 0a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L515.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L453.76 534.272a32 32 0 0 1 0-44.672z" }) ])); } }), d_arrow_left_default = _sfc_main72; var _sfc_main73 = /* @__PURE__ */ defineComponent({ name: "DArrowRight", __name: "d-arrow-right", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M452.864 149.312a29.12 29.12 0 0 1 41.728.064L826.24 489.664a32 32 0 0 1 0 44.672L494.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L764.736 512 452.864 192a30.59 30.59 0 0 1 0-42.688m-256 0a29.12 29.12 0 0 1 41.728.064L570.24 489.664a32 32 0 0 1 0 44.672L238.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L508.736 512 196.864 192a30.59 30.59 0 0 1 0-42.688" }) ])); } }), d_arrow_right_default = _sfc_main73; var _sfc_main74 = /* @__PURE__ */ defineComponent({ name: "DCaret", __name: "d-caret", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m512 128 288 320H224zM224 576h576L512 896z" }) ])); } }), d_caret_default = _sfc_main74; var _sfc_main75 = /* @__PURE__ */ defineComponent({ name: "DataAnalysis", __name: "data-analysis", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m665.216 768 110.848 192h-73.856L591.36 768H433.024L322.176 960H248.32l110.848-192H160a32 32 0 0 1-32-32V192H64a32 32 0 0 1 0-64h896a32 32 0 1 1 0 64h-64v544a32 32 0 0 1-32 32zM832 192H192v512h640zM352 448a32 32 0 0 1 32 32v64a32 32 0 0 1-64 0v-64a32 32 0 0 1 32-32m160-64a32 32 0 0 1 32 32v128a32 32 0 0 1-64 0V416a32 32 0 0 1 32-32m160-64a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V352a32 32 0 0 1 32-32" }) ])); } }), data_analysis_default = _sfc_main75; var _sfc_main76 = /* @__PURE__ */ defineComponent({ name: "DataBoard", __name: "data-board", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M32 128h960v64H32z" }), createBaseVNode("path", { fill: "currentColor", d: "M192 192v512h640V192zm-64-64h768v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32z" }), createBaseVNode("path", { fill: "currentColor", d: "M322.176 960H248.32l144.64-250.56 55.424 32zm453.888 0h-73.856L576 741.44l55.424-32z" }) ])); } }), data_board_default = _sfc_main76; var _sfc_main77 = /* @__PURE__ */ defineComponent({ name: "DataLine", __name: "data-line", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M359.168 768H160a32 32 0 0 1-32-32V192H64a32 32 0 0 1 0-64h896a32 32 0 1 1 0 64h-64v544a32 32 0 0 1-32 32H665.216l110.848 192h-73.856L591.36 768H433.024L322.176 960H248.32zM832 192H192v512h640zM342.656 534.656a32 32 0 1 1-45.312-45.312L444.992 341.76l125.44 94.08L679.04 300.032a32 32 0 1 1 49.92 39.936L581.632 524.224 451.008 426.24 342.656 534.592z" }) ])); } }), data_line_default = _sfc_main77; var _sfc_main78 = /* @__PURE__ */ defineComponent({ name: "DeleteFilled", __name: "delete-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M352 192V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64H96a32 32 0 0 1 0-64zm64 0h192v-64H416zM192 960a32 32 0 0 1-32-32V256h704v672a32 32 0 0 1-32 32zm224-192a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32m192 0a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32" }) ])); } }), delete_filled_default = _sfc_main78; var _sfc_main79 = /* @__PURE__ */ defineComponent({ name: "DeleteLocation", __name: "delete-location", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M288 896h448q32 0 32 32t-32 32H288q-32 0-32-32t32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544" }), createBaseVNode("path", { fill: "currentColor", d: "M384 384h256q32 0 32 32t-32 32H384q-32 0-32-32t32-32" }) ])); } }), delete_location_default = _sfc_main79; var _sfc_main80 = /* @__PURE__ */ defineComponent({ name: "Delete", __name: "delete", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32" }) ])); } }), delete_default = _sfc_main80; var _sfc_main81 = /* @__PURE__ */ defineComponent({ name: "Dessert", __name: "dessert", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 416v-48a144 144 0 0 1 168.64-141.888 224.128 224.128 0 0 1 430.72 0A144 144 0 0 1 896 368v48a384 384 0 0 1-352 382.72V896h-64v-97.28A384 384 0 0 1 128 416m287.104-32.064h193.792a143.81 143.81 0 0 1 58.88-132.736 160.064 160.064 0 0 0-311.552 0 143.81 143.81 0 0 1 58.88 132.8zm-72.896 0a72 72 0 1 0-140.48 0zm339.584 0h140.416a72 72 0 1 0-140.48 0zM512 736a320 320 0 0 0 318.4-288.064H193.6A320 320 0 0 0 512 736M384 896.064h256a32 32 0 1 1 0 64H384a32 32 0 1 1 0-64" }) ])); } }), dessert_default = _sfc_main81; var _sfc_main82 = /* @__PURE__ */ defineComponent({ name: "Discount", __name: "discount", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 704h576V318.336L552.512 115.84a64 64 0 0 0-81.024 0L224 318.336zm0 64v128h576V768zM593.024 66.304l259.2 212.096A32 32 0 0 1 864 303.168V928a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V303.168a32 32 0 0 1 11.712-24.768l259.2-212.096a128 128 0 0 1 162.112 0" }), createBaseVNode("path", { fill: "currentColor", d: "M512 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256" }) ])); } }), discount_default = _sfc_main82; var _sfc_main83 = /* @__PURE__ */ defineComponent({ name: "DishDot", __name: "dish-dot", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m384.064 274.56.064-50.688A128 128 0 0 1 512.128 96c70.528 0 127.68 57.152 127.68 127.68v50.752A448.19 448.19 0 0 1 955.392 768H68.544A448.19 448.19 0 0 1 384 274.56zM96 832h832a32 32 0 1 1 0 64H96a32 32 0 1 1 0-64m32-128h768a384 384 0 1 0-768 0m447.808-448v-32.32a63.68 63.68 0 0 0-63.68-63.68 64 64 0 0 0-64 63.936V256z" }) ])); } }), dish_dot_default = _sfc_main83; var _sfc_main84 = /* @__PURE__ */ defineComponent({ name: "Dish", __name: "dish", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M480 257.152V192h-96a32 32 0 0 1 0-64h256a32 32 0 1 1 0 64h-96v65.152A448 448 0 0 1 955.52 768H68.48A448 448 0 0 1 480 257.152M128 704h768a384 384 0 1 0-768 0M96 832h832a32 32 0 1 1 0 64H96a32 32 0 1 1 0-64" }) ])); } }), dish_default = _sfc_main84; var _sfc_main85 = /* @__PURE__ */ defineComponent({ name: "DocumentAdd", __name: "document-add", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m320 512V448h64v128h128v64H544v128h-64V640H352v-64z" }) ])); } }), document_add_default = _sfc_main85; var _sfc_main86 = /* @__PURE__ */ defineComponent({ name: "DocumentChecked", __name: "document-checked", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M805.504 320 640 154.496V320zM832 384H576V128H192v768h640zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m318.4 582.144 180.992-180.992L704.64 510.4 478.4 736.64 320 578.304l45.248-45.312z" }) ])); } }), document_checked_default = _sfc_main86; var _sfc_main87 = /* @__PURE__ */ defineComponent({ name: "DocumentCopy", __name: "document-copy", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 320v576h576V320zm-32-64h640a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32M960 96v704a32 32 0 0 1-32 32h-96v-64h64V128H384v64h-64V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32M256 672h320v64H256zm0-192h320v64H256z" }) ])); } }), document_copy_default = _sfc_main87; var _sfc_main88 = /* @__PURE__ */ defineComponent({ name: "DocumentDelete", __name: "document-delete", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M805.504 320 640 154.496V320zM832 384H576V128H192v768h640zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m308.992 546.304-90.496-90.624 45.248-45.248 90.56 90.496 90.496-90.432 45.248 45.248-90.496 90.56 90.496 90.496-45.248 45.248-90.496-90.496-90.56 90.496-45.248-45.248z" }) ])); } }), document_delete_default = _sfc_main88; var _sfc_main89 = /* @__PURE__ */ defineComponent({ name: "DocumentRemove", __name: "document-remove", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M805.504 320 640 154.496V320zM832 384H576V128H192v768h640zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m192 512h320v64H352z" }) ])); } }), document_remove_default = _sfc_main89; var _sfc_main90 = /* @__PURE__ */ defineComponent({ name: "Document", __name: "document", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z" }) ])); } }), document_default = _sfc_main90; var _sfc_main91 = /* @__PURE__ */ defineComponent({ name: "Download", __name: "download", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z" }) ])); } }), download_default = _sfc_main91; var _sfc_main92 = /* @__PURE__ */ defineComponent({ name: "Drizzling", __name: "drizzling", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m739.328 291.328-35.2-6.592-12.8-33.408a192.064 192.064 0 0 0-365.952 23.232l-9.92 40.896-41.472 7.04a176.32 176.32 0 0 0-146.24 173.568c0 97.28 78.72 175.936 175.808 175.936h400a192 192 0 0 0 35.776-380.672M959.552 480a256 256 0 0 1-256 256h-400A239.81 239.81 0 0 1 63.744 496.192a240.32 240.32 0 0 1 199.488-236.8 256.128 256.128 0 0 1 487.872-30.976A256.064 256.064 0 0 1 959.552 480M288 800h64v64h-64zm192 0h64v64h-64zm-96 96h64v64h-64zm192 0h64v64h-64zm96-96h64v64h-64z" }) ])); } }), drizzling_default = _sfc_main92; var _sfc_main93 = /* @__PURE__ */ defineComponent({ name: "EditPen", __name: "edit-pen", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z" }) ])); } }), edit_pen_default = _sfc_main93; var _sfc_main94 = /* @__PURE__ */ defineComponent({ name: "Edit", __name: "edit", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z" }), createBaseVNode("path", { fill: "currentColor", d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z" }) ])); } }), edit_default = _sfc_main94; var _sfc_main95 = /* @__PURE__ */ defineComponent({ name: "ElemeFilled", __name: "eleme-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M176 64h672c61.824 0 112 50.176 112 112v672a112 112 0 0 1-112 112H176A112 112 0 0 1 64 848V176c0-61.824 50.176-112 112-112m150.528 173.568c-152.896 99.968-196.544 304.064-97.408 456.96a330.69 330.69 0 0 0 456.96 96.64c9.216-5.888 17.6-11.776 25.152-18.56a18.24 18.24 0 0 0 4.224-24.32L700.352 724.8a47.55 47.55 0 0 0-65.536-14.272A234.56 234.56 0 0 1 310.592 641.6C240 533.248 271.104 387.968 379.456 316.48a234.3 234.3 0 0 1 276.352 15.168c1.664.832 2.56 2.56 3.392 4.224 5.888 8.384 3.328 19.328-5.12 25.216L456.832 489.6a47.55 47.55 0 0 0-14.336 65.472l16 24.384c5.888 8.384 16.768 10.88 25.216 5.056l308.224-199.936a19.584 19.584 0 0 0 6.72-23.488v-.896c-4.992-9.216-10.048-17.6-15.104-26.88-99.968-151.168-304.064-194.88-456.96-95.744zM786.88 504.704l-62.208 40.32c-8.32 5.888-10.88 16.768-4.992 25.216L760 632.32c5.888 8.448 16.768 11.008 25.152 5.12l31.104-20.16a55.36 55.36 0 0 0 16-76.48l-20.224-31.04a19.52 19.52 0 0 0-25.152-5.12z" }) ])); } }), eleme_filled_default = _sfc_main95; var _sfc_main96 = /* @__PURE__ */ defineComponent({ name: "Eleme", __name: "eleme", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M300.032 188.8c174.72-113.28 408-63.36 522.24 109.44 5.76 10.56 11.52 20.16 17.28 30.72v.96a22.4 22.4 0 0 1-7.68 26.88l-352.32 228.48c-9.6 6.72-22.08 3.84-28.8-5.76l-18.24-27.84a54.336 54.336 0 0 1 16.32-74.88l225.6-146.88c9.6-6.72 12.48-19.2 5.76-28.8-.96-1.92-1.92-3.84-3.84-4.8a267.84 267.84 0 0 0-315.84-17.28c-123.84 81.6-159.36 247.68-78.72 371.52a268.096 268.096 0 0 0 370.56 78.72 54.336 54.336 0 0 1 74.88 16.32l17.28 26.88c5.76 9.6 3.84 21.12-4.8 27.84-8.64 7.68-18.24 14.4-28.8 21.12a377.92 377.92 0 0 1-522.24-110.4c-113.28-174.72-63.36-408 111.36-522.24m526.08 305.28a22.336 22.336 0 0 1 28.8 5.76l23.04 35.52a63.23 63.23 0 0 1-18.24 87.36l-35.52 23.04c-9.6 6.72-22.08 3.84-28.8-5.76l-46.08-71.04c-6.72-9.6-3.84-22.08 5.76-28.8z" }) ])); } }), eleme_default = _sfc_main96; var _sfc_main97 = /* @__PURE__ */ defineComponent({ name: "ElementPlus", __name: "element-plus", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M839.7 734.7c0 33.3-17.9 41-17.9 41S519.7 949.8 499.2 960c-10.2 5.1-20.5 5.1-30.7 0 0 0-314.9-184.3-325.1-192-5.1-5.1-10.2-12.8-12.8-20.5V368.6c0-17.9 20.5-28.2 20.5-28.2L466 158.6q19.2-7.65 38.4 0s279 161.3 309.8 179.2c17.9 7.7 28.2 25.6 25.6 46.1-.1-5-.1 317.5-.1 350.8M714.2 371.2c-64-35.8-217.6-125.4-217.6-125.4-7.7-5.1-20.5-5.1-30.7 0L217.6 389.1s-17.9 10.2-17.9 23v297c0 5.1 5.1 12.8 7.7 17.9 7.7 5.1 256 148.5 256 148.5 7.7 5.1 17.9 5.1 25.6 0 15.4-7.7 250.9-145.9 250.9-145.9s12.8-5.1 12.8-30.7v-74.2l-276.5 169v-64c0-17.9 7.7-30.7 20.5-46.1L745 535c5.1-7.7 10.2-20.5 10.2-30.7v-66.6l-279 169v-69.1c0-15.4 5.1-30.7 17.9-38.4zM919 135.7c0-5.1-5.1-7.7-7.7-7.7h-58.9V66.6c0-5.1-5.1-5.1-10.2-5.1l-30.7 5.1c-5.1 0-5.1 2.6-5.1 5.1V128h-56.3c-5.1 0-5.1 5.1-7.7 5.1v38.4h69.1v64c0 5.1 5.1 5.1 10.2 5.1l30.7-5.1c5.1 0 5.1-2.6 5.1-5.1v-56.3h64z" }) ])); } }), element_plus_default$1 = _sfc_main97; var _sfc_main98 = /* @__PURE__ */ defineComponent({ name: "Expand", __name: "expand", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 192h768v128H128zm0 256h512v128H128zm0 256h768v128H128zm576-352 192 160-192 128z" }) ])); } }), expand_default = _sfc_main98; var _sfc_main99 = /* @__PURE__ */ defineComponent({ name: "Failed", __name: "failed", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m557.248 608 135.744-135.744-45.248-45.248-135.68 135.744-135.808-135.68-45.248 45.184L466.752 608l-135.68 135.68 45.184 45.312L512 653.248l135.744 135.744 45.248-45.248L557.312 608zM704 192h160v736H160V192h160v64h384zm-320 0V96h256v96z" }) ])); } }), failed_default = _sfc_main99; var _sfc_main100 = /* @__PURE__ */ defineComponent({ name: "Female", __name: "female", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 640a256 256 0 1 0 0-512 256 256 0 0 0 0 512m0 64a320 320 0 1 1 0-640 320 320 0 0 1 0 640" }), createBaseVNode("path", { fill: "currentColor", d: "M512 640q32 0 32 32v256q0 32-32 32t-32-32V672q0-32 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M352 800h320q32 0 32 32t-32 32H352q-32 0-32-32t32-32" }) ])); } }), female_default = _sfc_main100; var _sfc_main101 = /* @__PURE__ */ defineComponent({ name: "Files", __name: "files", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 384v448h768V384zm-32-64h832a32 32 0 0 1 32 32v512a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V352a32 32 0 0 1 32-32m64-128h704v64H160zm96-128h512v64H256z" }) ])); } }), files_default = _sfc_main101; var _sfc_main102 = /* @__PURE__ */ defineComponent({ name: "Film", __name: "film", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 160v704h704V160zm-32-64h768a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H128a32 32 0 0 1-32-32V128a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M320 288V128h64v352h256V128h64v160h160v64H704v128h160v64H704v128h160v64H704v160h-64V544H384v352h-64V736H128v-64h192V544H128v-64h192V352H128v-64z" }) ])); } }), film_default = _sfc_main102; var _sfc_main103 = /* @__PURE__ */ defineComponent({ name: "Filter", __name: "filter", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M384 523.392V928a32 32 0 0 0 46.336 28.608l192-96A32 32 0 0 0 640 832V523.392l280.768-343.104a32 32 0 1 0-49.536-40.576l-288 352A32 32 0 0 0 576 512v300.224l-128 64V512a32 32 0 0 0-7.232-20.288L195.52 192H704a32 32 0 1 0 0-64H128a32 32 0 0 0-24.768 52.288z" }) ])); } }), filter_default = _sfc_main103; var _sfc_main104 = /* @__PURE__ */ defineComponent({ name: "Finished", __name: "finished", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z" }) ])); } }), finished_default = _sfc_main104; var _sfc_main105 = /* @__PURE__ */ defineComponent({ name: "FirstAidKit", __name: "first-aid-kit", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M192 256a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V320a64 64 0 0 0-64-64zm0-64h640a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H192A128 128 0 0 1 64 768V320a128 128 0 0 1 128-128" }), createBaseVNode("path", { fill: "currentColor", d: "M544 512h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64h96v-96a32 32 0 0 1 64 0zM352 128v64h320v-64zm-32-64h384a32 32 0 0 1 32 32v128a32 32 0 0 1-32 32H320a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32" }) ])); } }), first_aid_kit_default = _sfc_main105; var _sfc_main106 = /* @__PURE__ */ defineComponent({ name: "Flag", __name: "flag", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M288 128h608L736 384l160 256H288v320h-96V64h96z" }) ])); } }), flag_default = _sfc_main106; var _sfc_main107 = /* @__PURE__ */ defineComponent({ name: "Fold", __name: "fold", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M896 192H128v128h768zm0 256H384v128h512zm0 256H128v128h768zM320 384 128 512l192 128z" }) ])); } }), fold_default = _sfc_main107; var _sfc_main108 = /* @__PURE__ */ defineComponent({ name: "FolderAdd", __name: "folder-add", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32m384 416V416h64v128h128v64H544v128h-64V608H352v-64z" }) ])); } }), folder_add_default = _sfc_main108; var _sfc_main109 = /* @__PURE__ */ defineComponent({ name: "FolderChecked", __name: "folder-checked", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32m414.08 502.144 180.992-180.992L736.32 494.4 510.08 720.64l-158.4-158.336 45.248-45.312z" }) ])); } }), folder_checked_default = _sfc_main109; var _sfc_main110 = /* @__PURE__ */ defineComponent({ name: "FolderDelete", __name: "folder-delete", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32m370.752 448-90.496-90.496 45.248-45.248L512 530.752l90.496-90.496 45.248 45.248L557.248 576l90.496 90.496-45.248 45.248L512 621.248l-90.496 90.496-45.248-45.248z" }) ])); } }), folder_delete_default = _sfc_main110; var _sfc_main111 = /* @__PURE__ */ defineComponent({ name: "FolderOpened", __name: "folder-opened", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M878.08 448H241.92l-96 384h636.16zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896" }) ])); } }), folder_opened_default = _sfc_main111; var _sfc_main112 = /* @__PURE__ */ defineComponent({ name: "FolderRemove", __name: "folder-remove", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32m256 416h320v64H352z" }) ])); } }), folder_remove_default = _sfc_main112; var _sfc_main113 = /* @__PURE__ */ defineComponent({ name: "Folder", __name: "folder", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32" }) ])); } }), folder_default = _sfc_main113; var _sfc_main114 = /* @__PURE__ */ defineComponent({ name: "Food", __name: "food", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 352.576V352a288 288 0 0 1 491.072-204.224 192 192 0 0 1 274.24 204.48 64 64 0 0 1 57.216 74.24C921.6 600.512 850.048 710.656 736 756.992V800a96 96 0 0 1-96 96H384a96 96 0 0 1-96-96v-43.008c-114.048-46.336-185.6-156.48-214.528-330.496A64 64 0 0 1 128 352.64zm64-.576h64a160 160 0 0 1 320 0h64a224 224 0 0 0-448 0m128 0h192a96 96 0 0 0-192 0m439.424 0h68.544A128.256 128.256 0 0 0 704 192c-15.36 0-29.952 2.688-43.52 7.616 11.328 18.176 20.672 37.76 27.84 58.304A64.128 64.128 0 0 1 759.424 352M672 768H352v32a32 32 0 0 0 32 32h256a32 32 0 0 0 32-32zm-342.528-64h365.056c101.504-32.64 165.76-124.928 192.896-288H136.576c27.136 163.072 91.392 255.36 192.896 288" }) ])); } }), food_default = _sfc_main114; var _sfc_main115 = /* @__PURE__ */ defineComponent({ name: "Football", __name: "football", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 960a448 448 0 1 1 0-896 448 448 0 0 1 0 896m0-64a384 384 0 1 0 0-768 384 384 0 0 0 0 768" }), createBaseVNode("path", { fill: "currentColor", d: "M186.816 268.288c16-16.384 31.616-31.744 46.976-46.08 17.472 30.656 39.808 58.112 65.984 81.28l-32.512 56.448a386 386 0 0 1-80.448-91.648m653.696-5.312a385.9 385.9 0 0 1-83.776 96.96l-32.512-56.384a322.9 322.9 0 0 0 68.48-85.76c15.552 14.08 31.488 29.12 47.808 45.184M465.984 445.248l11.136-63.104a323.6 323.6 0 0 0 69.76 0l11.136 63.104a388 388 0 0 1-92.032 0m-62.72-12.8A381.8 381.8 0 0 1 320 396.544l32-55.424a320 320 0 0 0 62.464 27.712l-11.2 63.488zm300.8-35.84a381.8 381.8 0 0 1-83.328 35.84l-11.2-63.552A320 320 0 0 0 672 341.184l32 55.424zm-520.768 364.8a385.9 385.9 0 0 1 83.968-97.28l32.512 56.32c-26.88 23.936-49.856 52.352-67.52 84.032-16-13.44-32.32-27.712-48.96-43.072m657.536.128a1443 1443 0 0 1-49.024 43.072 321.4 321.4 0 0 0-67.584-84.16l32.512-56.32c33.216 27.456 61.696 60.352 84.096 97.408M465.92 578.752a388 388 0 0 1 92.032 0l-11.136 63.104a323.6 323.6 0 0 0-69.76 0zm-62.72 12.8 11.2 63.552a320 320 0 0 0-62.464 27.712L320 627.392a381.8 381.8 0 0 1 83.264-35.84zm300.8 35.84-32 55.424a318.3 318.3 0 0 0-62.528-27.712l11.2-63.488c29.44 8.64 57.28 20.736 83.264 35.776z" }) ])); } }), football_default = _sfc_main115; var _sfc_main116 = /* @__PURE__ */ defineComponent({ name: "ForkSpoon", __name: "fork-spoon", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 410.304V96a32 32 0 0 1 64 0v314.304a96 96 0 0 0 64-90.56V96a32 32 0 0 1 64 0v223.744a160 160 0 0 1-128 156.8V928a32 32 0 1 1-64 0V476.544a160 160 0 0 1-128-156.8V96a32 32 0 0 1 64 0v223.744a96 96 0 0 0 64 90.56M672 572.48C581.184 552.128 512 446.848 512 320c0-141.44 85.952-256 192-256s192 114.56 192 256c0 126.848-69.184 232.128-160 252.48V928a32 32 0 1 1-64 0zM704 512c66.048 0 128-82.56 128-192s-61.952-192-128-192-128 82.56-128 192 61.952 192 128 192" }) ])); } }), fork_spoon_default = _sfc_main116; var _sfc_main117 = /* @__PURE__ */ defineComponent({ name: "Fries", __name: "fries", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M608 224v-64a32 32 0 0 0-64 0v336h26.88A64 64 0 0 0 608 484.096zm101.12 160A64 64 0 0 0 672 395.904V384h64V224a32 32 0 1 0-64 0v160zm74.88 0a92.928 92.928 0 0 1 91.328 110.08l-60.672 323.584A96 96 0 0 1 720.32 896H303.68a96 96 0 0 1-94.336-78.336L148.672 494.08A92.928 92.928 0 0 1 240 384h-16V224a96 96 0 0 1 188.608-25.28A95.74 95.74 0 0 1 480 197.44V160a96 96 0 0 1 188.608-25.28A96 96 0 0 1 800 224v160zM670.784 512a128 128 0 0 1-99.904 48H453.12a128 128 0 0 1-99.84-48H352v-1.536a128 128 0 0 1-9.984-14.976L314.88 448H240a28.928 28.928 0 0 0-28.48 34.304L241.088 640h541.824l29.568-157.696A28.928 28.928 0 0 0 784 448h-74.88l-27.136 47.488A132 132 0 0 1 672 510.464V512zM480 288a32 32 0 0 0-64 0v196.096A64 64 0 0 0 453.12 496H480zm-128 96V224a32 32 0 0 0-64 0v160zh-37.12A64 64 0 0 1 352 395.904zm-98.88 320 19.072 101.888A32 32 0 0 0 303.68 832h416.64a32 32 0 0 0 31.488-26.112L770.88 704z" }) ])); } }), fries_default = _sfc_main117; var _sfc_main118 = /* @__PURE__ */ defineComponent({ name: "FullScreen", __name: "full-screen", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z" }) ])); } }), full_screen_default = _sfc_main118; var _sfc_main119 = /* @__PURE__ */ defineComponent({ name: "GobletFull", __name: "goblet-full", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 320h512c0-78.592-12.608-142.4-36.928-192h-434.24C269.504 192.384 256 256.256 256 320m503.936 64H264.064a256.128 256.128 0 0 0 495.872 0M544 638.4V896h96a32 32 0 1 1 0 64H384a32 32 0 1 1 0-64h96V638.4A320 320 0 0 1 192 320c0-85.632 21.312-170.944 64-256h512c42.688 64.32 64 149.632 64 256a320 320 0 0 1-288 318.4" }) ])); } }), goblet_full_default = _sfc_main119; var _sfc_main120 = /* @__PURE__ */ defineComponent({ name: "GobletSquareFull", __name: "goblet-square-full", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 270.912c10.048 6.72 22.464 14.912 28.992 18.624a220.16 220.16 0 0 0 114.752 30.72c30.592 0 49.408-9.472 91.072-41.152l.64-.448c52.928-40.32 82.368-55.04 132.288-54.656 55.552.448 99.584 20.8 142.72 57.408l1.536 1.28V128H256zm.96 76.288C266.368 482.176 346.88 575.872 512 576c157.44.064 237.952-85.056 253.248-209.984a952 952 0 0 1-40.192-35.712c-32.704-27.776-63.36-41.92-101.888-42.24-31.552-.256-50.624 9.28-93.12 41.6l-.576.448c-52.096 39.616-81.024 54.208-129.792 54.208-54.784 0-100.48-13.376-142.784-37.056zM480 638.848C250.624 623.424 192 442.496 192 319.68V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32v224c0 122.816-58.624 303.68-288 318.912V896h96a32 32 0 1 1 0 64H384a32 32 0 1 1 0-64h96z" }) ])); } }), goblet_square_full_default = _sfc_main120; var _sfc_main121 = /* @__PURE__ */ defineComponent({ name: "GobletSquare", __name: "goblet-square", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M544 638.912V896h96a32 32 0 1 1 0 64H384a32 32 0 1 1 0-64h96V638.848C250.624 623.424 192 442.496 192 319.68V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32v224c0 122.816-58.624 303.68-288 318.912M256 319.68c0 149.568 80 256.192 256 256.256C688.128 576 768 469.568 768 320V128H256z" }) ])); } }), goblet_square_default = _sfc_main121; var _sfc_main122 = /* @__PURE__ */ defineComponent({ name: "Goblet", __name: "goblet", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M544 638.4V896h96a32 32 0 1 1 0 64H384a32 32 0 1 1 0-64h96V638.4A320 320 0 0 1 192 320c0-85.632 21.312-170.944 64-256h512c42.688 64.32 64 149.632 64 256a320 320 0 0 1-288 318.4M256 320a256 256 0 1 0 512 0c0-78.592-12.608-142.4-36.928-192h-434.24C269.504 192.384 256 256.256 256 320" }) ])); } }), goblet_default = _sfc_main122; var _sfc_main123 = /* @__PURE__ */ defineComponent({ name: "GoldMedal", __name: "gold-medal", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xml:space": "preserve", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m772.13 452.84 53.86-351.81c1.32-10.01-1.17-18.68-7.49-26.02S804.35 64 795.01 64H228.99v-.01h-.06c-9.33 0-17.15 3.67-23.49 11.01s-8.83 16.01-7.49 26.02l53.87 351.89C213.54 505.73 193.59 568.09 192 640c2 90.67 33.17 166.17 93.5 226.5S421.33 957.99 512 960c90.67-2 166.17-33.17 226.5-93.5 60.33-60.34 91.49-135.83 93.5-226.5-1.59-71.94-21.56-134.32-59.87-187.16M640.01 128h117.02l-39.01 254.02c-20.75-10.64-40.74-19.73-59.94-27.28-5.92-3-11.95-5.8-18.08-8.41V128zM576 128v198.76c-13.18-2.58-26.74-4.43-40.67-5.55-8.07-.8-15.85-1.2-23.33-1.2-10.54 0-21.09.66-31.64 1.96a360 360 0 0 0-32.36 4.79V128zm-192 0h.04v218.3c-6.22 2.66-12.34 5.5-18.36 8.56-19.13 7.54-39.02 16.6-59.66 27.16L267.01 128zm308.99 692.99c-48 48-108.33 73-180.99 75.01-72.66-2.01-132.99-27.01-180.99-75.01S258.01 712.66 256 640c2.01-72.66 27.01-132.99 75.01-180.99 19.67-19.67 41.41-35.47 65.22-47.41 38.33-15.04 71.15-23.92 98.44-26.65 5.07-.41 10.2-.7 15.39-.88.63-.01 1.28-.03 1.91-.03.66 0 1.35.03 2.02.04 5.11.17 10.15.46 15.13.86 27.4 2.71 60.37 11.65 98.91 26.79 23.71 11.93 45.36 27.69 64.96 47.29 48 48 73 108.33 75.01 180.99-2.01 72.65-27.01 132.98-75.01 180.98" }), createBaseVNode("path", { fill: "currentColor", d: "M544 480H416v64h64v192h-64v64h192v-64h-64z" }) ])); } }), gold_medal_default = _sfc_main123; var _sfc_main124 = /* @__PURE__ */ defineComponent({ name: "GoodsFilled", __name: "goods-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M192 352h640l64 544H128zm128 224h64V448h-64zm320 0h64V448h-64zM384 288h-64a192 192 0 1 1 384 0h-64a128 128 0 1 0-256 0" }) ])); } }), goods_filled_default = _sfc_main124; var _sfc_main125 = /* @__PURE__ */ defineComponent({ name: "Goods", __name: "goods", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M320 288v-22.336C320 154.688 405.504 64 512 64s192 90.688 192 201.664v22.4h131.072a32 32 0 0 1 31.808 28.8l57.6 576a32 32 0 0 1-31.808 35.2H131.328a32 32 0 0 1-31.808-35.2l57.6-576a32 32 0 0 1 31.808-28.8H320zm64 0h256v-22.336C640 189.248 582.272 128 512 128s-128 61.248-128 137.664v22.4zm-64 64H217.92l-51.2 512h690.56l-51.264-512H704v96a32 32 0 1 1-64 0v-96H384v96a32 32 0 0 1-64 0z" }) ])); } }), goods_default = _sfc_main125; var _sfc_main126 = /* @__PURE__ */ defineComponent({ name: "Grape", __name: "grape", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M544 195.2a160 160 0 0 1 96 60.8 160 160 0 1 1 146.24 254.976 160 160 0 0 1-128 224 160 160 0 1 1-292.48 0 160 160 0 0 1-128-224A160 160 0 1 1 384 256a160 160 0 0 1 96-60.8V128h-64a32 32 0 0 1 0-64h192a32 32 0 0 1 0 64h-64zM512 448a96 96 0 1 0 0-192 96 96 0 0 0 0 192m-256 0a96 96 0 1 0 0-192 96 96 0 0 0 0 192m128 224a96 96 0 1 0 0-192 96 96 0 0 0 0 192m128 224a96 96 0 1 0 0-192 96 96 0 0 0 0 192m128-224a96 96 0 1 0 0-192 96 96 0 0 0 0 192m128-224a96 96 0 1 0 0-192 96 96 0 0 0 0 192" }) ])); } }), grape_default = _sfc_main126; var _sfc_main127 = /* @__PURE__ */ defineComponent({ name: "Grid", __name: "grid", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M640 384v256H384V384zm64 0h192v256H704zm-64 512H384V704h256zm64 0V704h192v192zm-64-768v192H384V128zm64 0h192v192H704zM320 384v256H128V384zm0 512H128V704h192zm0-768v192H128V128z" }) ])); } }), grid_default = _sfc_main127; var _sfc_main128 = /* @__PURE__ */ defineComponent({ name: "Guide", __name: "guide", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M640 608h-64V416h64zm0 160v160a32 32 0 0 1-32 32H416a32 32 0 0 1-32-32V768h64v128h128V768zM384 608V416h64v192zm256-352h-64V128H448v128h-64V96a32 32 0 0 1 32-32h192a32 32 0 0 1 32 32z" }), createBaseVNode("path", { fill: "currentColor", d: "m220.8 256-71.232 80 71.168 80H768V256zm-14.4-64H800a32 32 0 0 1 32 32v224a32 32 0 0 1-32 32H206.4a32 32 0 0 1-23.936-10.752l-99.584-112a32 32 0 0 1 0-42.496l99.584-112A32 32 0 0 1 206.4 192m678.784 496-71.104 80H266.816V608h547.2zm-56.768-144H234.88a32 32 0 0 0-32 32v224a32 32 0 0 0 32 32h593.6a32 32 0 0 0 23.936-10.752l99.584-112a32 32 0 0 0 0-42.496l-99.584-112A32 32 0 0 0 828.48 544z" }) ])); } }), guide_default = _sfc_main128; var _sfc_main129 = /* @__PURE__ */ defineComponent({ name: "Handbag", __name: "handbag", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xml:space": "preserve", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M887.01 264.99c-6-5.99-13.67-8.99-23.01-8.99H704c-1.34-54.68-20.01-100.01-56-136s-81.32-54.66-136-56c-54.68 1.34-100.01 20.01-136 56s-54.66 81.32-56 136H160c-9.35 0-17.02 3-23.01 8.99-5.99 6-8.99 13.67-8.99 23.01v640c0 9.35 2.99 17.02 8.99 23.01S150.66 960 160 960h704c9.35 0 17.02-2.99 23.01-8.99S896 937.34 896 928V288c0-9.35-2.99-17.02-8.99-23.01M421.5 165.5c24.32-24.34 54.49-36.84 90.5-37.5 35.99.68 66.16 13.18 90.5 37.5s36.84 54.49 37.5 90.5H384c.68-35.99 13.18-66.16 37.5-90.5M832 896H192V320h128v128h64V320h256v128h64V320h128z" }) ])); } }), handbag_default = _sfc_main129; var _sfc_main130 = /* @__PURE__ */ defineComponent({ name: "Headset", __name: "headset", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M896 529.152V512a384 384 0 1 0-768 0v17.152A128 128 0 0 1 320 640v128a128 128 0 1 1-256 0V512a448 448 0 1 1 896 0v256a128 128 0 1 1-256 0V640a128 128 0 0 1 192-110.848M896 640a64 64 0 0 0-128 0v128a64 64 0 0 0 128 0zm-768 0v128a64 64 0 0 0 128 0V640a64 64 0 1 0-128 0" }) ])); } }), headset_default = _sfc_main130; var _sfc_main131 = /* @__PURE__ */ defineComponent({ name: "HelpFilled", __name: "help-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M926.784 480H701.312A192.51 192.51 0 0 0 544 322.688V97.216A416.064 416.064 0 0 1 926.784 480m0 64A416.064 416.064 0 0 1 544 926.784V701.312A192.51 192.51 0 0 0 701.312 544zM97.28 544h225.472A192.51 192.51 0 0 0 480 701.312v225.472A416.064 416.064 0 0 1 97.216 544zm0-64A416.064 416.064 0 0 1 480 97.216v225.472A192.51 192.51 0 0 0 322.688 480H97.216z" }) ])); } }), help_filled_default = _sfc_main131; var _sfc_main132 = /* @__PURE__ */ defineComponent({ name: "Help", __name: "help", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m759.936 805.248-90.944-91.008A254.9 254.9 0 0 1 512 768a254.9 254.9 0 0 1-156.992-53.76l-90.944 91.008A382.46 382.46 0 0 0 512 896c94.528 0 181.12-34.176 247.936-90.752m45.312-45.312A382.46 382.46 0 0 0 896 512c0-94.528-34.176-181.12-90.752-247.936l-91.008 90.944C747.904 398.4 768 452.864 768 512s-20.096 113.6-53.76 156.992zm-45.312-541.184A382.46 382.46 0 0 0 512 128c-94.528 0-181.12 34.176-247.936 90.752l90.944 91.008A254.9 254.9 0 0 1 512 256c59.136 0 113.6 20.096 156.992 53.76zm-541.184 45.312A382.46 382.46 0 0 0 128 512c0 94.528 34.176 181.12 90.752 247.936l91.008-90.944A254.9 254.9 0 0 1 256 512c0-59.136 20.096-113.6 53.76-156.992zm417.28 394.496a194.6 194.6 0 0 0 22.528-22.528C686.912 602.56 704 559.232 704 512a191.23 191.23 0 0 0-67.968-146.56A191.3 191.3 0 0 0 512 320a191.23 191.23 0 0 0-146.56 67.968C337.088 421.44 320 464.768 320 512a191.23 191.23 0 0 0 67.968 146.56C421.44 686.912 464.768 704 512 704c47.296 0 90.56-17.088 124.032-45.44M512 960a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }), help_default = _sfc_main132; var _sfc_main133 = /* @__PURE__ */ defineComponent({ name: "Hide", __name: "hide", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176" }), createBaseVNode("path", { fill: "currentColor", d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48" }) ])); } }), hide_default = _sfc_main133; var _sfc_main134 = /* @__PURE__ */ defineComponent({ name: "Histogram", __name: "histogram", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M416 896V128h192v768zm-288 0V448h192v448zm576 0V320h192v576z" }) ])); } }), histogram_default = _sfc_main134; var _sfc_main135 = /* @__PURE__ */ defineComponent({ name: "HomeFilled", __name: "home-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 128 128 447.936V896h255.936V640H640v256h255.936V447.936z" }) ])); } }), home_filled_default = _sfc_main135; var _sfc_main136 = /* @__PURE__ */ defineComponent({ name: "HotWater", __name: "hot-water", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M273.067 477.867h477.866V409.6H273.067zm0 68.266v51.2A187.733 187.733 0 0 0 460.8 785.067h102.4a187.733 187.733 0 0 0 187.733-187.734v-51.2zm-34.134-204.8h546.134a34.133 34.133 0 0 1 34.133 34.134v221.866a256 256 0 0 1-256 256H460.8a256 256 0 0 1-256-256V375.467a34.133 34.133 0 0 1 34.133-34.134M512 34.133a34.133 34.133 0 0 1 34.133 34.134v170.666a34.133 34.133 0 0 1-68.266 0V68.267A34.133 34.133 0 0 1 512 34.133M375.467 102.4a34.133 34.133 0 0 1 34.133 34.133v102.4a34.133 34.133 0 0 1-68.267 0v-102.4a34.133 34.133 0 0 1 34.134-34.133m273.066 0a34.133 34.133 0 0 1 34.134 34.133v102.4a34.133 34.133 0 1 1-68.267 0v-102.4a34.133 34.133 0 0 1 34.133-34.133M170.667 921.668h682.666a34.133 34.133 0 1 1 0 68.267H170.667a34.133 34.133 0 1 1 0-68.267" }) ])); } }), hot_water_default = _sfc_main136; var _sfc_main137 = /* @__PURE__ */ defineComponent({ name: "House", __name: "house", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M192 413.952V896h640V413.952L512 147.328zM139.52 374.4l352-293.312a32 32 0 0 1 40.96 0l352 293.312A32 32 0 0 1 896 398.976V928a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V398.976a32 32 0 0 1 11.52-24.576" }) ])); } }), house_default = _sfc_main137; var _sfc_main138 = /* @__PURE__ */ defineComponent({ name: "IceCreamRound", __name: "ice-cream-round", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m308.352 489.344 226.304 226.304a32 32 0 0 0 45.248 0L783.552 512A192 192 0 1 0 512 240.448L308.352 444.16a32 32 0 0 0 0 45.248zm135.744 226.304L308.352 851.392a96 96 0 0 1-135.744-135.744l135.744-135.744-45.248-45.248a96 96 0 0 1 0-135.808L466.752 195.2A256 256 0 0 1 828.8 557.248L625.152 760.96a96 96 0 0 1-135.808 0l-45.248-45.248zM398.848 670.4 353.6 625.152 217.856 760.896a32 32 0 0 0 45.248 45.248zm248.96-384.64a32 32 0 0 1 0 45.248L466.624 512a32 32 0 1 1-45.184-45.248l180.992-181.056a32 32 0 0 1 45.248 0zm90.496 90.496a32 32 0 0 1 0 45.248L557.248 602.496A32 32 0 1 1 512 557.248l180.992-180.992a32 32 0 0 1 45.312 0" }) ])); } }), ice_cream_round_default = _sfc_main138; var _sfc_main139 = /* @__PURE__ */ defineComponent({ name: "IceCreamSquare", __name: "ice-cream-square", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M416 640h256a32 32 0 0 0 32-32V160a32 32 0 0 0-32-32H352a32 32 0 0 0-32 32v448a32 32 0 0 0 32 32zm192 64v160a96 96 0 0 1-192 0V704h-64a96 96 0 0 1-96-96V160a96 96 0 0 1 96-96h320a96 96 0 0 1 96 96v448a96 96 0 0 1-96 96zm-64 0h-64v160a32 32 0 1 0 64 0z" }) ])); } }), ice_cream_square_default = _sfc_main139; var _sfc_main140 = /* @__PURE__ */ defineComponent({ name: "IceCream", __name: "ice-cream", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128.64 448a208 208 0 0 1 193.536-191.552 224 224 0 0 1 445.248 15.488A208.13 208.13 0 0 1 894.784 448H896L548.8 983.68a32 32 0 0 1-53.248.704L128 448zm64.256 0h286.208a144 144 0 0 0-286.208 0m351.36 0h286.272a144 144 0 0 0-286.272 0m-294.848 64 271.808 396.608L778.24 512zM511.68 352.64a207.87 207.87 0 0 1 189.184-96.192 160 160 0 0 0-314.752 5.632c52.608 12.992 97.28 46.08 125.568 90.56" }) ])); } }), ice_cream_default = _sfc_main140; var _sfc_main141 = /* @__PURE__ */ defineComponent({ name: "IceDrink", __name: "ice-drink", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 448v128h239.68l16.064-128zm-64 0H256.256l16.064 128H448zm64-255.36V384h247.744A256.13 256.13 0 0 0 512 192.64m-64 8.064A256.45 256.45 0 0 0 264.256 384H448zm64-72.064A320.13 320.13 0 0 1 825.472 384H896a32 32 0 1 1 0 64h-64v1.92l-56.96 454.016A64 64 0 0 1 711.552 960H312.448a64 64 0 0 1-63.488-56.064L192 449.92V448h-64a32 32 0 0 1 0-64h70.528A320.38 320.38 0 0 1 448 135.04V96a96 96 0 0 1 96-96h128a32 32 0 1 1 0 64H544a32 32 0 0 0-32 32zM743.68 640H280.32l32.128 256h399.104z" }) ])); } }), ice_drink_default = _sfc_main141; var _sfc_main142 = /* @__PURE__ */ defineComponent({ name: "IceTea", __name: "ice-tea", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M197.696 259.648a320.128 320.128 0 0 1 628.608 0A96 96 0 0 1 896 352v64a96 96 0 0 1-71.616 92.864l-49.408 395.072A64 64 0 0 1 711.488 960H312.512a64 64 0 0 1-63.488-56.064l-49.408-395.072A96 96 0 0 1 128 416v-64a96 96 0 0 1 69.696-92.352M264.064 256h495.872a256.128 256.128 0 0 0-495.872 0m495.424 256H264.512l48 384h398.976zM224 448h576a32 32 0 0 0 32-32v-64a32 32 0 0 0-32-32H224a32 32 0 0 0-32 32v64a32 32 0 0 0 32 32m160 192h64v64h-64zm192 64h64v64h-64zm-128 64h64v64h-64zm64-192h64v64h-64z" }) ])); } }), ice_tea_default = _sfc_main142; var _sfc_main143 = /* @__PURE__ */ defineComponent({ name: "InfoFilled", __name: "info-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z" }) ])); } }), info_filled_default = _sfc_main143; var _sfc_main144 = /* @__PURE__ */ defineComponent({ name: "Iphone", __name: "iphone", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 768v96.064a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V768zm0-64h576V160a64 64 0 0 0-64-64H288a64 64 0 0 0-64 64zm32 288a96 96 0 0 1-96-96V128a96 96 0 0 1 96-96h512a96 96 0 0 1 96 96v768a96 96 0 0 1-96 96zm304-144a48 48 0 1 1-96 0 48 48 0 0 1 96 0" }) ])); } }), iphone_default = _sfc_main144; var _sfc_main145 = /* @__PURE__ */ defineComponent({ name: "Key", __name: "key", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M448 456.064V96a32 32 0 0 1 32-32.064L672 64a32 32 0 0 1 0 64H512v128h160a32 32 0 0 1 0 64H512v128a256 256 0 1 1-64 8.064M512 896a192 192 0 1 0 0-384 192 192 0 0 0 0 384" }) ])); } }), key_default = _sfc_main145; var _sfc_main146 = /* @__PURE__ */ defineComponent({ name: "KnifeFork", __name: "knife-fork", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 410.56V96a32 32 0 0 1 64 0v314.56A96 96 0 0 0 384 320V96a32 32 0 0 1 64 0v224a160 160 0 0 1-128 156.8V928a32 32 0 1 1-64 0V476.8A160 160 0 0 1 128 320V96a32 32 0 0 1 64 0v224a96 96 0 0 0 64 90.56m384-250.24V544h126.72c-3.328-78.72-12.928-147.968-28.608-207.744-14.336-54.528-46.848-113.344-98.112-175.872zM640 608v320a32 32 0 1 1-64 0V64h64c85.312 89.472 138.688 174.848 160 256s32 177.152 32 288z" }) ])); } }), knife_fork_default = _sfc_main146; var _sfc_main147 = /* @__PURE__ */ defineComponent({ name: "Lightning", __name: "lightning", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M288 671.36v64.128A239.81 239.81 0 0 1 63.744 496.192a240.32 240.32 0 0 1 199.488-236.8 256.128 256.128 0 0 1 487.872-30.976A256.064 256.064 0 0 1 736 734.016v-64.768a192 192 0 0 0 3.328-377.92l-35.2-6.592-12.8-33.408a192.064 192.064 0 0 0-365.952 23.232l-9.92 40.896-41.472 7.04a176.32 176.32 0 0 0-146.24 173.568c0 91.968 70.464 167.36 160.256 175.232z" }), createBaseVNode("path", { fill: "currentColor", d: "M416 736a32 32 0 0 1-27.776-47.872l128-224a32 32 0 1 1 55.552 31.744L471.168 672H608a32 32 0 0 1 27.776 47.872l-128 224a32 32 0 1 1-55.68-31.744L552.96 736z" }) ])); } }), lightning_default = _sfc_main147; var _sfc_main148 = /* @__PURE__ */ defineComponent({ name: "Link", __name: "link", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M715.648 625.152 670.4 579.904l90.496-90.56c75.008-74.944 85.12-186.368 22.656-248.896-62.528-62.464-173.952-52.352-248.96 22.656L444.16 353.6l-45.248-45.248 90.496-90.496c100.032-99.968 251.968-110.08 339.456-22.656 87.488 87.488 77.312 239.424-22.656 339.456l-90.496 90.496zm-90.496 90.496-90.496 90.496C434.624 906.112 282.688 916.224 195.2 828.8c-87.488-87.488-77.312-239.424 22.656-339.456l90.496-90.496 45.248 45.248-90.496 90.56c-75.008 74.944-85.12 186.368-22.656 248.896 62.528 62.464 173.952 52.352 248.96-22.656l90.496-90.496zm0-362.048 45.248 45.248L398.848 670.4 353.6 625.152z" }) ])); } }), link_default$1 = _sfc_main148; var _sfc_main149 = /* @__PURE__ */ defineComponent({ name: "List", __name: "list", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M704 192h160v736H160V192h160v64h384zM288 512h448v-64H288zm0 256h448v-64H288zm96-576V96h256v96z" }) ])); } }), list_default = _sfc_main149; var _sfc_main150 = /* @__PURE__ */ defineComponent({ name: "Loading", __name: "loading", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0" }) ])); } }), loading_default = _sfc_main150; var _sfc_main151 = /* @__PURE__ */ defineComponent({ name: "LocationFilled", __name: "location-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 928c23.936 0 117.504-68.352 192.064-153.152C803.456 661.888 864 535.808 864 416c0-189.632-155.84-320-352-320S160 226.368 160 416c0 120.32 60.544 246.4 159.936 359.232C394.432 859.84 488 928 512 928m0-435.2a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 140.8a204.8 204.8 0 1 1 0-409.6 204.8 204.8 0 0 1 0 409.6" }) ])); } }), location_filled_default = _sfc_main151; var _sfc_main152 = /* @__PURE__ */ defineComponent({ name: "LocationInformation", __name: "location-information", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M288 896h448q32 0 32 32t-32 32H288q-32 0-32-32t32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544" }), createBaseVNode("path", { fill: "currentColor", d: "M512 512a96 96 0 1 0 0-192 96 96 0 0 0 0 192m0 64a160 160 0 1 1 0-320 160 160 0 0 1 0 320" }) ])); } }), location_information_default = _sfc_main152; var _sfc_main153 = /* @__PURE__ */ defineComponent({ name: "Location", __name: "location", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544" }), createBaseVNode("path", { fill: "currentColor", d: "M512 512a96 96 0 1 0 0-192 96 96 0 0 0 0 192m0 64a160 160 0 1 1 0-320 160 160 0 0 1 0 320" }) ])); } }), location_default = _sfc_main153; var _sfc_main154 = /* @__PURE__ */ defineComponent({ name: "Lock", __name: "lock", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96" }), createBaseVNode("path", { fill: "currentColor", d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64" }) ])); } }), lock_default = _sfc_main154; var _sfc_main155 = /* @__PURE__ */ defineComponent({ name: "Lollipop", __name: "lollipop", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M513.28 448a64 64 0 1 1 76.544 49.728A96 96 0 0 0 768 448h64a160 160 0 0 1-320 0zm-126.976-29.696a256 256 0 1 0 43.52-180.48A256 256 0 0 1 832 448h-64a192 192 0 0 0-381.696-29.696m105.664 249.472L285.696 874.048a96 96 0 0 1-135.68-135.744l206.208-206.272a320 320 0 1 1 135.744 135.744m-54.464-36.032a322 322 0 0 1-45.248-45.248L195.2 783.552a32 32 0 1 0 45.248 45.248l197.056-197.12z" }) ])); } }), lollipop_default = _sfc_main155; var _sfc_main156 = /* @__PURE__ */ defineComponent({ name: "MagicStick", __name: "magic-stick", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64h64v192h-64zm0 576h64v192h-64zM160 480v-64h192v64zm576 0v-64h192v64zM249.856 199.04l45.248-45.184L430.848 289.6 385.6 334.848 249.856 199.104zM657.152 606.4l45.248-45.248 135.744 135.744-45.248 45.248zM114.048 923.2 68.8 877.952l316.8-316.8 45.248 45.248zM702.4 334.848 657.152 289.6l135.744-135.744 45.248 45.248z" }) ])); } }), magic_stick_default = _sfc_main156; var _sfc_main157 = /* @__PURE__ */ defineComponent({ name: "Magnet", __name: "magnet", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M832 320V192H704v320a192 192 0 1 1-384 0V192H192v128h128v64H192v128a320 320 0 0 0 640 0V384H704v-64zM640 512V128h256v384a384 384 0 1 1-768 0V128h256v384a128 128 0 1 0 256 0" }) ])); } }), magnet_default = _sfc_main157; var _sfc_main158 = /* @__PURE__ */ defineComponent({ name: "Male", __name: "male", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M399.5 849.5a225 225 0 1 0 0-450 225 225 0 0 0 0 450m0 56.25a281.25 281.25 0 1 1 0-562.5 281.25 281.25 0 0 1 0 562.5m253.125-787.5h225q28.125 0 28.125 28.125T877.625 174.5h-225q-28.125 0-28.125-28.125t28.125-28.125" }), createBaseVNode("path", { fill: "currentColor", d: "M877.625 118.25q28.125 0 28.125 28.125v225q0 28.125-28.125 28.125T849.5 371.375v-225q0-28.125 28.125-28.125" }), createBaseVNode("path", { fill: "currentColor", d: "M604.813 458.9 565.1 419.131l292.613-292.668 39.825 39.824z" }) ])); } }), male_default = _sfc_main158; var _sfc_main159 = /* @__PURE__ */ defineComponent({ name: "Management", __name: "management", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M576 128v288l96-96 96 96V128h128v768H320V128zm-448 0h128v768H128z" }) ])); } }), management_default = _sfc_main159; var _sfc_main160 = /* @__PURE__ */ defineComponent({ name: "MapLocation", __name: "map-location", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544" }), createBaseVNode("path", { fill: "currentColor", d: "M512 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256m345.6 192L960 960H672v-64H352v64H64l102.4-256zm-68.928 0H235.328l-76.8 192h706.944z" }) ])); } }), map_location_default = _sfc_main160; var _sfc_main161 = /* @__PURE__ */ defineComponent({ name: "Medal", __name: "medal", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a256 256 0 1 0 0-512 256 256 0 0 0 0 512m0 64a320 320 0 1 1 0-640 320 320 0 0 1 0 640" }), createBaseVNode("path", { fill: "currentColor", d: "M576 128H448v200a286.7 286.7 0 0 1 64-8c19.52 0 40.832 2.688 64 8zm64 0v219.648c24.448 9.088 50.56 20.416 78.4 33.92L757.44 128zm-256 0H266.624l39.04 253.568c27.84-13.504 53.888-24.832 78.336-33.92zM229.312 64h565.376a32 32 0 0 1 31.616 36.864L768 480c-113.792-64-199.104-96-256-96s-142.208 32-256 96l-58.304-379.136A32 32 0 0 1 229.312 64" }) ])); } }), medal_default = _sfc_main161; var _sfc_main162 = /* @__PURE__ */ defineComponent({ name: "Memo", __name: "memo", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xml:space": "preserve", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M480 320h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32" }), createBaseVNode("path", { fill: "currentColor", d: "M887.01 72.99C881.01 67 873.34 64 864 64H160c-9.35 0-17.02 3-23.01 8.99C131 78.99 128 86.66 128 96v832c0 9.35 2.99 17.02 8.99 23.01S150.66 960 160 960h704c9.35 0 17.02-2.99 23.01-8.99S896 937.34 896 928V96c0-9.35-3-17.02-8.99-23.01M192 896V128h96v768zm640 0H352V128h480z" }), createBaseVNode("path", { fill: "currentColor", d: "M480 512h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32m0 192h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32" }) ])); } }), memo_default = _sfc_main162; var _sfc_main163 = /* @__PURE__ */ defineComponent({ name: "Menu", __name: "menu", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z" }) ])); } }), menu_default$2 = _sfc_main163; var _sfc_main164 = /* @__PURE__ */ defineComponent({ name: "MessageBox", __name: "message-box", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M288 384h448v64H288zm96-128h256v64H384zM131.456 512H384v128h256V512h252.544L721.856 192H302.144zM896 576H704v128H320V576H128v256h768zM275.776 128h472.448a32 32 0 0 1 28.608 17.664l179.84 359.552A32 32 0 0 1 960 519.552V864a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V519.552a32 32 0 0 1 3.392-14.336l179.776-359.552A32 32 0 0 1 275.776 128" }) ])); } }), message_box_default = _sfc_main164; var _sfc_main165 = /* @__PURE__ */ defineComponent({ name: "Message", __name: "message", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 224v512a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V224zm0-64h768a64 64 0 0 1 64 64v512a128 128 0 0 1-128 128H192A128 128 0 0 1 64 736V224a64 64 0 0 1 64-64" }), createBaseVNode("path", { fill: "currentColor", d: "M904 224 656.512 506.88a192 192 0 0 1-289.024 0L120 224zm-698.944 0 210.56 240.704a128 128 0 0 0 192.704 0L818.944 224z" }) ])); } }), message_default$1 = _sfc_main165; var _sfc_main166 = /* @__PURE__ */ defineComponent({ name: "Mic", __name: "mic", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M480 704h160a64 64 0 0 0 64-64v-32h-96a32 32 0 0 1 0-64h96v-96h-96a32 32 0 0 1 0-64h96v-96h-96a32 32 0 0 1 0-64h96v-32a64 64 0 0 0-64-64H384a64 64 0 0 0-64 64v32h96a32 32 0 0 1 0 64h-96v96h96a32 32 0 0 1 0 64h-96v96h96a32 32 0 0 1 0 64h-96v32a64 64 0 0 0 64 64zm64 64v128h192a32 32 0 1 1 0 64H288a32 32 0 1 1 0-64h192V768h-96a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64h256a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128z" }) ])); } }), mic_default = _sfc_main166; var _sfc_main167 = /* @__PURE__ */ defineComponent({ name: "Microphone", __name: "microphone", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 128a128 128 0 0 0-128 128v256a128 128 0 1 0 256 0V256a128 128 0 0 0-128-128m0-64a192 192 0 0 1 192 192v256a192 192 0 1 1-384 0V256A192 192 0 0 1 512 64m-32 832v-64a288 288 0 0 1-288-288v-32a32 32 0 0 1 64 0v32a224 224 0 0 0 224 224h64a224 224 0 0 0 224-224v-32a32 32 0 1 1 64 0v32a288 288 0 0 1-288 288v64h64a32 32 0 1 1 0 64H416a32 32 0 1 1 0-64z" }) ])); } }), microphone_default = _sfc_main167; var _sfc_main168 = /* @__PURE__ */ defineComponent({ name: "MilkTea", __name: "milk-tea", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M416 128V96a96 96 0 0 1 96-96h128a32 32 0 1 1 0 64H512a32 32 0 0 0-32 32v32h320a96 96 0 0 1 11.712 191.296l-39.68 581.056A64 64 0 0 1 708.224 960H315.776a64 64 0 0 1-63.872-59.648l-39.616-581.056A96 96 0 0 1 224 128zM276.48 320l39.296 576h392.448l4.8-70.784a224.064 224.064 0 0 1 30.016-439.808L747.52 320zM224 256h576a32 32 0 1 0 0-64H224a32 32 0 0 0 0 64m493.44 503.872 21.12-309.12a160 160 0 0 0-21.12 309.12" }) ])); } }), milk_tea_default = _sfc_main168; var _sfc_main169 = /* @__PURE__ */ defineComponent({ name: "Minus", __name: "minus", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64" }) ])); } }), minus_default = _sfc_main169; var _sfc_main170 = /* @__PURE__ */ defineComponent({ name: "Money", __name: "money", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 640v192h640V384H768v-64h150.976c14.272 0 19.456 1.472 24.64 4.288a29.06 29.06 0 0 1 12.16 12.096c2.752 5.184 4.224 10.368 4.224 24.64v493.952c0 14.272-1.472 19.456-4.288 24.64a29.06 29.06 0 0 1-12.096 12.16c-5.184 2.752-10.368 4.224-24.64 4.224H233.024c-14.272 0-19.456-1.472-24.64-4.288a29.06 29.06 0 0 1-12.16-12.096c-2.688-5.184-4.224-10.368-4.224-24.576V640z" }), createBaseVNode("path", { fill: "currentColor", d: "M768 192H128v448h640zm64-22.976v493.952c0 14.272-1.472 19.456-4.288 24.64a29.06 29.06 0 0 1-12.096 12.16c-5.184 2.752-10.368 4.224-24.64 4.224H105.024c-14.272 0-19.456-1.472-24.64-4.288a29.06 29.06 0 0 1-12.16-12.096C65.536 682.432 64 677.248 64 663.04V169.024c0-14.272 1.472-19.456 4.288-24.64a29.06 29.06 0 0 1 12.096-12.16C85.568 129.536 90.752 128 104.96 128h685.952c14.272 0 19.456 1.472 24.64 4.288a29.06 29.06 0 0 1 12.16 12.096c2.752 5.184 4.224 10.368 4.224 24.64z" }), createBaseVNode("path", { fill: "currentColor", d: "M448 576a160 160 0 1 1 0-320 160 160 0 0 1 0 320m0-64a96 96 0 1 0 0-192 96 96 0 0 0 0 192" }) ])); } }), money_default = _sfc_main170; var _sfc_main171 = /* @__PURE__ */ defineComponent({ name: "Monitor", __name: "monitor", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M544 768v128h192a32 32 0 1 1 0 64H288a32 32 0 1 1 0-64h192V768H192A128 128 0 0 1 64 640V256a128 128 0 0 1 128-128h640a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128zM192 192a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64z" }) ])); } }), monitor_default = _sfc_main171; var _sfc_main172 = /* @__PURE__ */ defineComponent({ name: "MoonNight", __name: "moon-night", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M384 512a448 448 0 0 1 215.872-383.296A384 384 0 0 0 213.76 640h188.8A448.3 448.3 0 0 1 384 512M171.136 704a448 448 0 0 1 636.992-575.296A384 384 0 0 0 499.328 704h-328.32z" }), createBaseVNode("path", { fill: "currentColor", d: "M32 640h960q32 0 32 32t-32 32H32q-32 0-32-32t32-32m128 128h384a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m160 127.68 224 .256a32 32 0 0 1 32 32V928a32 32 0 0 1-32 32l-224-.384a32 32 0 0 1-32-32v-.064a32 32 0 0 1 32-32z" }) ])); } }), moon_night_default = _sfc_main172; var _sfc_main173 = /* @__PURE__ */ defineComponent({ name: "Moon", __name: "moon", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M240.448 240.448a384 384 0 1 0 559.424 525.696 448 448 0 0 1-542.016-542.08 391 391 0 0 0-17.408 16.384m181.056 362.048a384 384 0 0 0 525.632 16.384A448 448 0 1 1 405.056 76.8a384 384 0 0 0 16.448 525.696" }) ])); } }), moon_default = _sfc_main173; var _sfc_main174 = /* @__PURE__ */ defineComponent({ name: "MoreFilled", __name: "more-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224" }) ])); } }), more_filled_default = _sfc_main174; var _sfc_main175 = /* @__PURE__ */ defineComponent({ name: "More", __name: "more", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M176 416a112 112 0 1 0 0 224 112 112 0 0 0 0-224m0 64a48 48 0 1 1 0 96 48 48 0 0 1 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96" }) ])); } }), more_default = _sfc_main175; var _sfc_main176 = /* @__PURE__ */ defineComponent({ name: "MostlyCloudy", __name: "mostly-cloudy", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M737.216 357.952 704 349.824l-11.776-32a192.064 192.064 0 0 0-367.424 23.04l-8.96 39.04-39.04 8.96A192.064 192.064 0 0 0 320 768h368a207.81 207.81 0 0 0 207.808-208 208.32 208.32 0 0 0-158.592-202.048m15.168-62.208A272.32 272.32 0 0 1 959.744 560a271.81 271.81 0 0 1-271.552 272H320a256 256 0 0 1-57.536-505.536 256.128 256.128 0 0 1 489.92-30.72" }) ])); } }), mostly_cloudy_default = _sfc_main176; var _sfc_main177 = /* @__PURE__ */ defineComponent({ name: "Mouse", __name: "mouse", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M438.144 256c-68.352 0-92.736 4.672-117.76 18.112q-30.144 16.128-46.272 46.272C260.672 345.408 256 369.792 256 438.144v275.712c0 68.352 4.672 92.736 18.112 117.76q16.128 30.144 46.272 46.272C345.408 891.328 369.792 896 438.144 896h147.712c68.352 0 92.736-4.672 117.76-18.112q30.144-16.128 46.272-46.272C763.328 806.592 768 782.208 768 713.856V438.144c0-68.352-4.672-92.736-18.112-117.76a110.46 110.46 0 0 0-46.272-46.272C678.592 260.672 654.208 256 585.856 256zm0-64h147.712c85.568 0 116.608 8.96 147.904 25.6 31.36 16.768 55.872 41.344 72.576 72.64C823.104 321.536 832 352.576 832 438.08v275.84c0 85.504-8.96 116.544-25.6 147.84a174.46 174.46 0 0 1-72.64 72.576C702.464 951.104 671.424 960 585.92 960H438.08c-85.504 0-116.544-8.96-147.84-25.6a174.46 174.46 0 0 1-72.64-72.704c-16.768-31.296-25.664-62.336-25.664-147.84v-275.84c0-85.504 8.96-116.544 25.6-147.84a174.46 174.46 0 0 1 72.768-72.576c31.232-16.704 62.272-25.6 147.776-25.6z" }), createBaseVNode("path", { fill: "currentColor", d: "M512 320q32 0 32 32v128q0 32-32 32t-32-32V352q0-32 32-32m32-96a32 32 0 0 1-64 0v-64a32 32 0 0 0-32-32h-96a32 32 0 0 1 0-64h96a96 96 0 0 1 96 96z" }) ])); } }), mouse_default = _sfc_main177; var _sfc_main178 = /* @__PURE__ */ defineComponent({ name: "Mug", __name: "mug", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M736 800V160H160v640a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64m64-544h63.552a96 96 0 0 1 96 96v224a96 96 0 0 1-96 96H800v128a128 128 0 0 1-128 128H224A128 128 0 0 1 96 800V128a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 64v288h63.552a32 32 0 0 0 32-32V352a32 32 0 0 0-32-32z" }) ])); } }), mug_default = _sfc_main178; var _sfc_main179 = /* @__PURE__ */ defineComponent({ name: "MuteNotification", __name: "mute-notification", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m241.216 832 63.616-64H768V448c0-42.368-10.24-82.304-28.48-117.504l46.912-47.232C815.36 331.392 832 387.84 832 448v320h96a32 32 0 1 1 0 64zm-90.24 0H96a32 32 0 1 1 0-64h96V448a320.13 320.13 0 0 1 256-313.6V128a64 64 0 1 1 128 0v6.4a319.55 319.55 0 0 1 171.648 97.088l-45.184 45.44A256 256 0 0 0 256 448v278.336L151.04 832zM448 896h128a64 64 0 0 1-128 0" }), createBaseVNode("path", { fill: "currentColor", d: "M150.72 859.072a32 32 0 0 1-45.44-45.056l704-708.544a32 32 0 0 1 45.44 45.056z" }) ])); } }), mute_notification_default = _sfc_main179; var _sfc_main180 = /* @__PURE__ */ defineComponent({ name: "Mute", __name: "mute", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m412.16 592.128-45.44 45.44A191.23 191.23 0 0 1 320 512V256a192 192 0 1 1 384 0v44.352l-64 64V256a128 128 0 1 0-256 0v256c0 30.336 10.56 58.24 28.16 80.128m51.968 38.592A128 128 0 0 0 640 512v-57.152l64-64V512a192 192 0 0 1-287.68 166.528zM314.88 779.968l46.144-46.08A223 223 0 0 0 480 768h64a224 224 0 0 0 224-224v-32a32 32 0 1 1 64 0v32a288 288 0 0 1-288 288v64h64a32 32 0 1 1 0 64H416a32 32 0 1 1 0-64h64v-64c-61.44 0-118.4-19.2-165.12-52.032M266.752 737.6A286.98 286.98 0 0 1 192 544v-32a32 32 0 0 1 64 0v32c0 56.832 21.184 108.8 56.064 148.288z" }), createBaseVNode("path", { fill: "currentColor", d: "M150.72 859.072a32 32 0 0 1-45.44-45.056l704-708.544a32 32 0 0 1 45.44 45.056z" }) ])); } }), mute_default = _sfc_main180; var _sfc_main181 = /* @__PURE__ */ defineComponent({ name: "NoSmoking", __name: "no-smoking", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M440.256 576H256v128h56.256l-64 64H224a32 32 0 0 1-32-32V544a32 32 0 0 1 32-32h280.256zm143.488 128H704V583.744L775.744 512H928a32 32 0 0 1 32 32v192a32 32 0 0 1-32 32H519.744zM768 576v128h128V576zm-29.696-207.552 45.248 45.248-497.856 497.856-45.248-45.248zM256 64h64v320h-64zM128 192h64v192h-64zM64 512h64v256H64z" }) ])); } }), no_smoking_default = _sfc_main181; var _sfc_main182 = /* @__PURE__ */ defineComponent({ name: "Notebook", __name: "notebook", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32" }) ])); } }), notebook_default = _sfc_main182; var _sfc_main183 = /* @__PURE__ */ defineComponent({ name: "Notification", __name: "notification", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 128v64H256a64 64 0 0 0-64 64v512a64 64 0 0 0 64 64h512a64 64 0 0 0 64-64V512h64v256a128 128 0 0 1-128 128H256a128 128 0 0 1-128-128V256a128 128 0 0 1 128-128z" }), createBaseVNode("path", { fill: "currentColor", d: "M768 384a128 128 0 1 0 0-256 128 128 0 0 0 0 256m0 64a192 192 0 1 1 0-384 192 192 0 0 1 0 384" }) ])); } }), notification_default$1 = _sfc_main183; var _sfc_main184 = /* @__PURE__ */ defineComponent({ name: "Odometer", __name: "odometer", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M192 512a320 320 0 1 1 640 0 32 32 0 1 1-64 0 256 256 0 1 0-512 0 32 32 0 0 1-64 0" }), createBaseVNode("path", { fill: "currentColor", d: "M570.432 627.84A96 96 0 1 1 509.568 608l60.992-187.776A32 32 0 1 1 631.424 440l-60.992 187.776zM502.08 734.464a32 32 0 1 0 19.84-60.928 32 32 0 0 0-19.84 60.928" }) ])); } }), odometer_default = _sfc_main184; var _sfc_main185 = /* @__PURE__ */ defineComponent({ name: "OfficeBuilding", __name: "office-building", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M192 128v704h384V128zm-32-64h448a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M256 256h256v64H256zm0 192h256v64H256zm0 192h256v64H256zm384-128h128v64H640zm0 128h128v64H640zM64 832h896v64H64z" }), createBaseVNode("path", { fill: "currentColor", d: "M640 384v448h192V384zm-32-64h256a32 32 0 0 1 32 32v512a32 32 0 0 1-32 32H608a32 32 0 0 1-32-32V352a32 32 0 0 1 32-32" }) ])); } }), office_building_default = _sfc_main185; var _sfc_main186 = /* @__PURE__ */ defineComponent({ name: "Open", __name: "open", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M329.956 257.138a254.862 254.862 0 0 0 0 509.724h364.088a254.862 254.862 0 0 0 0-509.724zm0-72.818h364.088a327.68 327.68 0 1 1 0 655.36H329.956a327.68 327.68 0 1 1 0-655.36" }), createBaseVNode("path", { fill: "currentColor", d: "M694.044 621.227a109.227 109.227 0 1 0 0-218.454 109.227 109.227 0 0 0 0 218.454m0 72.817a182.044 182.044 0 1 1 0-364.088 182.044 182.044 0 0 1 0 364.088" }) ])); } }), open_default = _sfc_main186; var _sfc_main187 = /* @__PURE__ */ defineComponent({ name: "Operation", __name: "operation", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M389.44 768a96.064 96.064 0 0 1 181.12 0H896v64H570.56a96.064 96.064 0 0 1-181.12 0H128v-64zm192-288a96.064 96.064 0 0 1 181.12 0H896v64H762.56a96.064 96.064 0 0 1-181.12 0H128v-64zm-320-288a96.064 96.064 0 0 1 181.12 0H896v64H442.56a96.064 96.064 0 0 1-181.12 0H128v-64z" }) ])); } }), operation_default = _sfc_main187; var _sfc_main188 = /* @__PURE__ */ defineComponent({ name: "Opportunity", __name: "opportunity", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M384 960v-64h192.064v64zm448-544a350.66 350.66 0 0 1-128.32 271.424C665.344 719.04 640 763.776 640 813.504V832H320v-14.336c0-48-19.392-95.36-57.216-124.992a351.55 351.55 0 0 1-128.448-344.256c25.344-136.448 133.888-248.128 269.76-276.48A352.384 352.384 0 0 1 832 416m-544 32c0-132.288 75.904-224 192-224v-64c-154.432 0-256 122.752-256 288z" }) ])); } }), opportunity_default = _sfc_main188; var _sfc_main189 = /* @__PURE__ */ defineComponent({ name: "Orange", __name: "orange", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M544 894.72a382.34 382.34 0 0 0 215.936-89.472L577.024 622.272c-10.24 6.016-21.248 10.688-33.024 13.696v258.688zm261.248-134.784A382.34 382.34 0 0 0 894.656 544H635.968c-3.008 11.776-7.68 22.848-13.696 33.024zM894.656 480a382.34 382.34 0 0 0-89.408-215.936L622.272 446.976c6.016 10.24 10.688 21.248 13.696 33.024zm-134.72-261.248A382.34 382.34 0 0 0 544 129.344v258.688c11.776 3.008 22.848 7.68 33.024 13.696zM480 129.344a382.34 382.34 0 0 0-215.936 89.408l182.912 182.976c10.24-6.016 21.248-10.688 33.024-13.696zm-261.248 134.72A382.34 382.34 0 0 0 129.344 480h258.688c3.008-11.776 7.68-22.848 13.696-33.024zM129.344 544a382.34 382.34 0 0 0 89.408 215.936l182.976-182.912A127.2 127.2 0 0 1 388.032 544zm134.72 261.248A382.34 382.34 0 0 0 480 894.656V635.968a127.2 127.2 0 0 1-33.024-13.696zM512 960a448 448 0 1 1 0-896 448 448 0 0 1 0 896m0-384a64 64 0 1 0 0-128 64 64 0 0 0 0 128" }) ])); } }), orange_default = _sfc_main189; var _sfc_main190 = /* @__PURE__ */ defineComponent({ name: "Paperclip", __name: "paperclip", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M602.496 240.448A192 192 0 1 1 874.048 512l-316.8 316.8A256 256 0 0 1 195.2 466.752L602.496 59.456l45.248 45.248L240.448 512A192 192 0 0 0 512 783.552l316.8-316.8a128 128 0 1 0-181.056-181.056L353.6 579.904a32 32 0 1 0 45.248 45.248l294.144-294.144 45.312 45.248L444.096 670.4a96 96 0 1 1-135.744-135.744z" }) ])); } }), paperclip_default = _sfc_main190; var _sfc_main191 = /* @__PURE__ */ defineComponent({ name: "PartlyCloudy", __name: "partly-cloudy", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M598.4 895.872H328.192a256 256 0 0 1-34.496-510.528A352 352 0 1 1 598.4 895.872m-271.36-64h272.256a288 288 0 1 0-248.512-417.664L335.04 445.44l-34.816 3.584a192 192 0 0 0 26.88 382.848z" }), createBaseVNode("path", { fill: "currentColor", d: "M139.84 501.888a256 256 0 1 1 417.856-277.12c-17.728 2.176-38.208 8.448-61.504 18.816A192 192 0 1 0 189.12 460.48a6004 6004 0 0 0-49.28 41.408" }) ])); } }), partly_cloudy_default = _sfc_main191; var _sfc_main192 = /* @__PURE__ */ defineComponent({ name: "Pear", __name: "pear", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M542.336 258.816a443 443 0 0 0-9.024 25.088 32 32 0 1 1-60.8-20.032l1.088-3.328a162.69 162.69 0 0 0-122.048 131.392l-17.088 102.72-20.736 15.36C256.192 552.704 224 610.88 224 672c0 120.576 126.4 224 288 224s288-103.424 288-224c0-61.12-32.192-119.296-89.728-161.92l-20.736-15.424-17.088-102.72a162.69 162.69 0 0 0-130.112-133.12m-40.128-66.56c7.936-15.552 16.576-30.08 25.92-43.776 23.296-33.92 49.408-59.776 78.528-77.12a32 32 0 1 1 32.704 55.04c-20.544 12.224-40.064 31.552-58.432 58.304a317 317 0 0 0-9.792 15.104 226.69 226.69 0 0 1 164.48 181.568l12.8 77.248C819.456 511.36 864 587.392 864 672c0 159.04-157.568 288-352 288S160 831.04 160 672c0-84.608 44.608-160.64 115.584-213.376l12.8-77.248a226.624 226.624 0 0 1 213.76-189.184z" }) ])); } }), pear_default = _sfc_main192; var _sfc_main193 = /* @__PURE__ */ defineComponent({ name: "PhoneFilled", __name: "phone-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M199.232 125.568 90.624 379.008a32 32 0 0 0 6.784 35.2l512.384 512.384a32 32 0 0 0 35.2 6.784l253.44-108.608a32 32 0 0 0 10.048-52.032L769.6 633.92a32 32 0 0 0-36.928-5.952l-130.176 65.088-271.488-271.552 65.024-130.176a32 32 0 0 0-5.952-36.928L251.2 115.52a32 32 0 0 0-51.968 10.048" }) ])); } }), phone_filled_default = _sfc_main193; var _sfc_main194 = /* @__PURE__ */ defineComponent({ name: "Phone", __name: "phone", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M79.36 432.256 591.744 944.64a32 32 0 0 0 35.2 6.784l253.44-108.544a32 32 0 0 0 9.984-52.032l-153.856-153.92a32 32 0 0 0-36.928-6.016l-69.888 34.944L358.08 394.24l35.008-69.888a32 32 0 0 0-5.952-36.928L233.152 133.568a32 32 0 0 0-52.032 10.048L72.512 397.056a32 32 0 0 0 6.784 35.2zm60.48-29.952 81.536-190.08L325.568 316.48l-24.64 49.216-20.608 41.216 32.576 32.64 271.552 271.552 32.64 32.64 41.216-20.672 49.28-24.576 104.192 104.128-190.08 81.472zM512 320v-64a256 256 0 0 1 256 256h-64a192 192 0 0 0-192-192m0-192V64a448 448 0 0 1 448 448h-64a384 384 0 0 0-384-384" }) ])); } }), phone_default = _sfc_main194; var _sfc_main195 = /* @__PURE__ */ defineComponent({ name: "PictureFilled", __name: "picture-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M96 896a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h832a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zm315.52-228.48-68.928-68.928a32 32 0 0 0-45.248 0L128 768.064h778.688l-242.112-290.56a32 32 0 0 0-49.216 0L458.752 665.408a32 32 0 0 1-47.232 2.112M256 384a96 96 0 1 0 192.064-.064A96 96 0 0 0 256 384" }) ])); } }), picture_filled_default = _sfc_main195; var _sfc_main196 = /* @__PURE__ */ defineComponent({ name: "PictureRounded", __name: "picture-rounded", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 128a384 384 0 1 0 0 768 384 384 0 0 0 0-768m0-64a448 448 0 1 1 0 896 448 448 0 0 1 0-896" }), createBaseVNode("path", { fill: "currentColor", d: "M640 288q64 0 64 64t-64 64-64-64 64-64M214.656 790.656l-45.312-45.312 185.664-185.6a96 96 0 0 1 123.712-10.24l138.24 98.688a32 32 0 0 0 39.872-2.176L906.688 422.4l42.624 47.744L699.52 693.696a96 96 0 0 1-119.808 6.592l-138.24-98.752a32 32 0 0 0-41.152 3.456l-185.664 185.6z" }) ])); } }), picture_rounded_default = _sfc_main196; var _sfc_main197 = /* @__PURE__ */ defineComponent({ name: "Picture", __name: "picture", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 160v704h704V160zm-32-64h768a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H128a32 32 0 0 1-32-32V128a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M384 288q64 0 64 64t-64 64-64-64 64-64M185.408 876.992l-50.816-38.912L350.72 556.032a96 96 0 0 1 134.592-17.856l1.856 1.472 122.88 99.136a32 32 0 0 0 44.992-4.864l216-269.888 49.92 39.936-215.808 269.824-.256.32a96 96 0 0 1-135.04 14.464l-122.88-99.072-.64-.512a32 32 0 0 0-44.8 5.952z" }) ])); } }), picture_default = _sfc_main197; var _sfc_main198 = /* @__PURE__ */ defineComponent({ name: "PieChart", __name: "pie-chart", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M448 68.48v64.832A384.128 384.128 0 0 0 512 896a384.13 384.13 0 0 0 378.688-320h64.768A448.128 448.128 0 0 1 64 512 448.13 448.13 0 0 1 448 68.48" }), createBaseVNode("path", { fill: "currentColor", d: "M576 97.28V448h350.72A384.064 384.064 0 0 0 576 97.28M512 64V33.152A448 448 0 0 1 990.848 512H512z" }) ])); } }), pie_chart_default = _sfc_main198; var _sfc_main199 = /* @__PURE__ */ defineComponent({ name: "Place", __name: "place", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 512a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512" }), createBaseVNode("path", { fill: "currentColor", d: "M512 512a32 32 0 0 1 32 32v256a32 32 0 1 1-64 0V544a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M384 649.088v64.96C269.76 732.352 192 771.904 192 800c0 37.696 139.904 96 320 96s320-58.304 320-96c0-28.16-77.76-67.648-192-85.952v-64.96C789.12 671.04 896 730.368 896 800c0 88.32-171.904 160-384 160s-384-71.68-384-160c0-69.696 106.88-128.96 256-150.912" }) ])); } }), place_default = _sfc_main199; var _sfc_main200 = /* @__PURE__ */ defineComponent({ name: "Platform", __name: "platform", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M448 832v-64h128v64h192v64H256v-64zM128 704V128h768v576z" }) ])); } }), platform_default = _sfc_main200; var _sfc_main201 = /* @__PURE__ */ defineComponent({ name: "Plus", __name: "plus", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z" }) ])); } }), plus_default = _sfc_main201; var _sfc_main202 = /* @__PURE__ */ defineComponent({ name: "Pointer", __name: "pointer", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M511.552 128c-35.584 0-64.384 28.8-64.384 64.448v516.48L274.048 570.88a94.27 94.27 0 0 0-112.896-3.456 44.416 44.416 0 0 0-8.96 62.208L332.8 870.4A64 64 0 0 0 384 896h512V575.232a64 64 0 0 0-45.632-61.312l-205.952-61.76A96 96 0 0 1 576 360.192V192.448C576 156.8 547.2 128 511.552 128M359.04 556.8l24.128 19.2V192.448a128.448 128.448 0 1 1 256.832 0v167.744a32 32 0 0 0 22.784 30.656l206.016 61.76A128 128 0 0 1 960 575.232V896a64 64 0 0 1-64 64H384a128 128 0 0 1-102.4-51.2L101.056 668.032A108.416 108.416 0 0 1 128 512.512a158.27 158.27 0 0 1 185.984 8.32z" }) ])); } }), pointer_default = _sfc_main202; var _sfc_main203 = /* @__PURE__ */ defineComponent({ name: "Position", __name: "position", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992z" }) ])); } }), position_default = _sfc_main203; var _sfc_main204 = /* @__PURE__ */ defineComponent({ name: "Postcard", __name: "postcard", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 224a32 32 0 0 0-32 32v512a32 32 0 0 0 32 32h704a32 32 0 0 0 32-32V256a32 32 0 0 0-32-32zm0-64h704a96 96 0 0 1 96 96v512a96 96 0 0 1-96 96H160a96 96 0 0 1-96-96V256a96 96 0 0 1 96-96" }), createBaseVNode("path", { fill: "currentColor", d: "M704 320a64 64 0 1 1 0 128 64 64 0 0 1 0-128M288 448h256q32 0 32 32t-32 32H288q-32 0-32-32t32-32m0 128h256q32 0 32 32t-32 32H288q-32 0-32-32t32-32" }) ])); } }), postcard_default = _sfc_main204; var _sfc_main205 = /* @__PURE__ */ defineComponent({ name: "Pouring", __name: "pouring", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m739.328 291.328-35.2-6.592-12.8-33.408a192.064 192.064 0 0 0-365.952 23.232l-9.92 40.896-41.472 7.04a176.32 176.32 0 0 0-146.24 173.568c0 97.28 78.72 175.936 175.808 175.936h400a192 192 0 0 0 35.776-380.672M959.552 480a256 256 0 0 1-256 256h-400A239.81 239.81 0 0 1 63.744 496.192a240.32 240.32 0 0 1 199.488-236.8 256.128 256.128 0 0 1 487.872-30.976A256.064 256.064 0 0 1 959.552 480M224 800a32 32 0 0 1 32 32v96a32 32 0 1 1-64 0v-96a32 32 0 0 1 32-32m192 0a32 32 0 0 1 32 32v96a32 32 0 1 1-64 0v-96a32 32 0 0 1 32-32m192 0a32 32 0 0 1 32 32v96a32 32 0 1 1-64 0v-96a32 32 0 0 1 32-32m192 0a32 32 0 0 1 32 32v96a32 32 0 1 1-64 0v-96a32 32 0 0 1 32-32" }) ])); } }), pouring_default = _sfc_main205; var _sfc_main206 = /* @__PURE__ */ defineComponent({ name: "Present", __name: "present", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M480 896V640H192v-64h288V320H192v576zm64 0h288V320H544v256h288v64H544zM128 256h768v672a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32z" }), createBaseVNode("path", { fill: "currentColor", d: "M96 256h832q32 0 32 32t-32 32H96q-32 0-32-32t32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M416 256a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256" }), createBaseVNode("path", { fill: "currentColor", d: "M608 256a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256" }) ])); } }), present_default = _sfc_main206; var _sfc_main207 = /* @__PURE__ */ defineComponent({ name: "PriceTag", __name: "price-tag", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 318.336V896h576V318.336L552.512 115.84a64 64 0 0 0-81.024 0zM593.024 66.304l259.2 212.096A32 32 0 0 1 864 303.168V928a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V303.168a32 32 0 0 1 11.712-24.768l259.2-212.096a128 128 0 0 1 162.112 0" }), createBaseVNode("path", { fill: "currentColor", d: "M512 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256" }) ])); } }), price_tag_default = _sfc_main207; var _sfc_main208 = /* @__PURE__ */ defineComponent({ name: "Printer", __name: "printer", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 768H105.024c-14.272 0-19.456-1.472-24.64-4.288a29.06 29.06 0 0 1-12.16-12.096C65.536 746.432 64 741.248 64 727.04V379.072c0-42.816 4.48-58.304 12.8-73.984 8.384-15.616 20.672-27.904 36.288-36.288 15.68-8.32 31.168-12.8 73.984-12.8H256V64h512v192h68.928c42.816 0 58.304 4.48 73.984 12.8 15.616 8.384 27.904 20.672 36.288 36.288 8.32 15.68 12.8 31.168 12.8 73.984v347.904c0 14.272-1.472 19.456-4.288 24.64a29.06 29.06 0 0 1-12.096 12.16c-5.184 2.752-10.368 4.224-24.64 4.224H768v192H256zm64-192v320h384V576zm-64 128V512h512v192h128V379.072c0-29.376-1.408-36.48-5.248-43.776a23.3 23.3 0 0 0-10.048-10.048c-7.232-3.84-14.4-5.248-43.776-5.248H187.072c-29.376 0-36.48 1.408-43.776 5.248a23.3 23.3 0 0 0-10.048 10.048c-3.84 7.232-5.248 14.4-5.248 43.776V704zm64-448h384V128H320zm-64 128h64v64h-64zm128 0h64v64h-64z" }) ])); } }), printer_default = _sfc_main208; var _sfc_main209 = /* @__PURE__ */ defineComponent({ name: "Promotion", __name: "promotion", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m64 448 832-320-128 704-446.08-243.328L832 192 242.816 545.472zm256 512V657.024L512 768z" }) ])); } }), promotion_default = _sfc_main209; var _sfc_main210 = /* @__PURE__ */ defineComponent({ name: "QuartzWatch", __name: "quartz-watch", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xml:space": "preserve", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M422.02 602.01v-.03c-6.68-5.99-14.35-8.83-23.01-8.51q-13.005.48-22.5 10.02c-6.33 6.36-9.5 13.7-9.5 22.02s3 15.82 8.99 22.5c8.68 8.68 19.02 11.35 31.01 8s19.49-10.85 22.5-22.5.51-22.15-7.49-31.49zM384 512c0-9.35-3-17.02-8.99-23.01-6-5.99-13.66-8.99-23.01-8.99s-17.02 3-23.01 8.99c-5.99 6-8.99 13.66-8.99 23.01s3 17.02 8.99 23.01c6 5.99 13.66 8.99 23.01 8.99s17.02-3 23.01-8.99c5.99-6 8.99-13.67 8.99-23.01m6.53-82.49c11.65 3.01 22.15.51 31.49-7.49h.04c5.99-6.68 8.83-14.34 8.51-23.01s-3.66-16.16-10.02-22.5c-6.36-6.33-13.7-9.5-22.02-9.5s-15.82 3-22.5 8.99c-8.68 8.69-11.35 19.02-8 31.01q5.025 17.985 22.5 22.5m242.94 0q17.505-4.545 22.02-22.02c3.01-11.65.51-22.15-7.49-31.49h.01c-6.68-5.99-14.18-8.99-22.5-8.99s-15.66 3.16-22.02 9.5q-9.54 9.51-10.02 22.5c-.32 8.66 2.52 16.33 8.51 23.01 9.32 8.02 19.82 10.52 31.49 7.49M512 640c-9.35 0-17.02 3-23.01 8.99-5.99 6-8.99 13.66-8.99 23.01s3 17.02 8.99 23.01c6 5.99 13.67 8.99 23.01 8.99 9.35 0 17.02-3 23.01-8.99 5.99-6 8.99-13.66 8.99-23.01s-3-17.02-8.99-23.01c-6-5.99-13.66-8.99-23.01-8.99m183.01-151.01c-6-5.99-13.66-8.99-23.01-8.99s-17.02 3-23.01 8.99c-5.99 6-8.99 13.66-8.99 23.01s3 17.02 8.99 23.01c6 5.99 13.66 8.99 23.01 8.99s17.02-3 23.01-8.99c5.99-6 8.99-13.67 8.99-23.01 0-9.35-3-17.02-8.99-23.01" }), createBaseVNode("path", { fill: "currentColor", d: "M832 512c-2-90.67-33.17-166.17-93.5-226.5-20.43-20.42-42.6-37.49-66.5-51.23V64H352v170.26c-23.9 13.74-46.07 30.81-66.5 51.24-60.33 60.33-91.49 135.83-93.5 226.5 2 90.67 33.17 166.17 93.5 226.5 20.43 20.43 42.6 37.5 66.5 51.24V960h320V789.74c23.9-13.74 46.07-30.81 66.5-51.24 60.33-60.34 91.49-135.83 93.5-226.5M416 128h192v78.69c-29.85-9.03-61.85-13.93-96-14.69-34.15.75-66.15 5.65-96 14.68zm192 768H416v-78.68c29.85 9.03 61.85 13.93 96 14.68 34.15-.75 66.15-5.65 96-14.68zm-96-128c-72.66-2.01-132.99-27.01-180.99-75.01S258.01 584.66 256 512c2.01-72.66 27.01-132.99 75.01-180.99S439.34 258.01 512 256c72.66 2.01 132.99 27.01 180.99 75.01S765.99 439.34 768 512c-2.01 72.66-27.01 132.99-75.01 180.99S584.66 765.99 512 768" }), createBaseVNode("path", { fill: "currentColor", d: "M512 320c-9.35 0-17.02 3-23.01 8.99-5.99 6-8.99 13.66-8.99 23.01s3 17.02 8.99 23.01c6 5.99 13.67 8.99 23.01 8.99 9.35 0 17.02-3 23.01-8.99 5.99-6 8.99-13.66 8.99-23.01s-3-17.02-8.99-23.01c-6-5.99-13.66-8.99-23.01-8.99m112.99 273.5c-8.66-.32-16.33 2.52-23.01 8.51-7.98 9.32-10.48 19.82-7.49 31.49s10.49 19.17 22.5 22.5 22.35.66 31.01-8v.04c5.99-6.68 8.99-14.18 8.99-22.5s-3.16-15.66-9.5-22.02-13.84-9.7-22.5-10.02" }) ])); } }), quartz_watch_default = _sfc_main210; var _sfc_main211 = /* @__PURE__ */ defineComponent({ name: "QuestionFilled", __name: "question-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784" }) ])); } }), question_filled_default = _sfc_main211; var _sfc_main212 = /* @__PURE__ */ defineComponent({ name: "Rank", __name: "rank", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m186.496 544 41.408 41.344a32 32 0 1 1-45.248 45.312l-96-96a32 32 0 0 1 0-45.312l96-96a32 32 0 1 1 45.248 45.312L186.496 480h290.816V186.432l-41.472 41.472a32 32 0 1 1-45.248-45.184l96-96.128a32 32 0 0 1 45.312 0l96 96.064a32 32 0 0 1-45.248 45.184l-41.344-41.28V480H832l-41.344-41.344a32 32 0 0 1 45.248-45.312l96 96a32 32 0 0 1 0 45.312l-96 96a32 32 0 0 1-45.248-45.312L832 544H541.312v293.44l41.344-41.28a32 32 0 1 1 45.248 45.248l-96 96a32 32 0 0 1-45.312 0l-96-96a32 32 0 1 1 45.312-45.248l41.408 41.408V544z" }) ])); } }), rank_default = _sfc_main212; var _sfc_main213 = /* @__PURE__ */ defineComponent({ name: "ReadingLamp", __name: "reading-lamp", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M352 896h320q32 0 32 32t-32 32H352q-32 0-32-32t32-32m-44.672-768-99.52 448h608.384l-99.52-448zm-25.6-64h460.608a32 32 0 0 1 31.232 25.088l113.792 512A32 32 0 0 1 856.128 640H167.872a32 32 0 0 1-31.232-38.912l113.792-512A32 32 0 0 1 281.664 64z" }), createBaseVNode("path", { fill: "currentColor", d: "M672 576q32 0 32 32v128q0 32-32 32t-32-32V608q0-32 32-32m-192-.064h64V960h-64z" }) ])); } }), reading_lamp_default = _sfc_main213; var _sfc_main214 = /* @__PURE__ */ defineComponent({ name: "Reading", __name: "reading", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m512 863.36 384-54.848v-638.72L525.568 222.72a96 96 0 0 1-27.136 0L128 169.792v638.72zM137.024 106.432l370.432 52.928a32 32 0 0 0 9.088 0l370.432-52.928A64 64 0 0 1 960 169.792v638.72a64 64 0 0 1-54.976 63.36l-388.48 55.488a32 32 0 0 1-9.088 0l-388.48-55.488A64 64 0 0 1 64 808.512v-638.72a64 64 0 0 1 73.024-63.36" }), createBaseVNode("path", { fill: "currentColor", d: "M480 192h64v704h-64z" }) ])); } }), reading_default = _sfc_main214; var _sfc_main215 = /* @__PURE__ */ defineComponent({ name: "RefreshLeft", __name: "refresh-left", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z" }) ])); } }), refresh_left_default = _sfc_main215; var _sfc_main216 = /* @__PURE__ */ defineComponent({ name: "RefreshRight", __name: "refresh-right", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88" }) ])); } }), refresh_right_default = _sfc_main216; var _sfc_main217 = /* @__PURE__ */ defineComponent({ name: "Refresh", __name: "refresh", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z" }) ])); } }), refresh_default = _sfc_main217; var _sfc_main218 = /* @__PURE__ */ defineComponent({ name: "Refrigerator", __name: "refrigerator", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 448h512V160a32 32 0 0 0-32-32H288a32 32 0 0 0-32 32zm0 64v352a32 32 0 0 0 32 32h448a32 32 0 0 0 32-32V512zm32-448h448a96 96 0 0 1 96 96v704a96 96 0 0 1-96 96H288a96 96 0 0 1-96-96V160a96 96 0 0 1 96-96m32 224h64v96h-64zm0 288h64v96h-64z" }) ])); } }), refrigerator_default = _sfc_main218; var _sfc_main219 = /* @__PURE__ */ defineComponent({ name: "RemoveFilled", __name: "remove-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512" }) ])); } }), remove_filled_default = _sfc_main219; var _sfc_main220 = /* @__PURE__ */ defineComponent({ name: "Remove", __name: "remove", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64" }), createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }), remove_default = _sfc_main220; var _sfc_main221 = /* @__PURE__ */ defineComponent({ name: "Right", __name: "right", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M754.752 480H160a32 32 0 1 0 0 64h594.752L521.344 777.344a32 32 0 0 0 45.312 45.312l288-288a32 32 0 0 0 0-45.312l-288-288a32 32 0 1 0-45.312 45.312z" }) ])); } }), right_default = _sfc_main221; var _sfc_main222 = /* @__PURE__ */ defineComponent({ name: "ScaleToOriginal", __name: "scale-to-original", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118m-361.412 0a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118M512 361.412a30.12 30.12 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.12 30.12 0 0 0 512 361.412M512 512a30.12 30.12 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.12 30.12 0 0 0 512 512" }) ])); } }), scale_to_original_default = _sfc_main222; var _sfc_main223 = /* @__PURE__ */ defineComponent({ name: "School", __name: "school", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 128v704h576V128zm-32-64h640a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M64 832h896v64H64zm256-640h128v96H320z" }), createBaseVNode("path", { fill: "currentColor", d: "M384 832h256v-64a128 128 0 1 0-256 0zm128-256a192 192 0 0 1 192 192v128H320V768a192 192 0 0 1 192-192M320 384h128v96H320zm256-192h128v96H576zm0 192h128v96H576z" }) ])); } }), school_default = _sfc_main223; var _sfc_main224 = /* @__PURE__ */ defineComponent({ name: "Scissor", __name: "scissor", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m512.064 578.368-106.88 152.768a160 160 0 1 1-23.36-78.208L472.96 522.56 196.864 128.256a32 32 0 1 1 52.48-36.736l393.024 561.344a160 160 0 1 1-23.36 78.208l-106.88-152.704zm54.4-189.248 208.384-297.6a32 32 0 0 1 52.48 36.736l-221.76 316.672-39.04-55.808zm-376.32 425.856a96 96 0 1 0 110.144-157.248 96 96 0 0 0-110.08 157.248zm643.84 0a96 96 0 1 0-110.08-157.248 96 96 0 0 0 110.08 157.248" }) ])); } }), scissor_default = _sfc_main224; var _sfc_main225 = /* @__PURE__ */ defineComponent({ name: "Search", __name: "search", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704" }) ])); } }), search_default = _sfc_main225; var _sfc_main226 = /* @__PURE__ */ defineComponent({ name: "Select", __name: "select", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M77.248 415.04a64 64 0 0 1 90.496 0l226.304 226.304L846.528 188.8a64 64 0 1 1 90.56 90.496l-543.04 543.04-316.8-316.8a64 64 0 0 1 0-90.496" }) ])); } }), select_default$2 = _sfc_main226; var _sfc_main227 = /* @__PURE__ */ defineComponent({ name: "Sell", __name: "sell", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M704 288h131.072a32 32 0 0 1 31.808 28.8L886.4 512h-64.384l-16-160H704v96a32 32 0 1 1-64 0v-96H384v96a32 32 0 0 1-64 0v-96H217.92l-51.2 512H512v64H131.328a32 32 0 0 1-31.808-35.2l57.6-576a32 32 0 0 1 31.808-28.8H320v-22.336C320 154.688 405.504 64 512 64s192 90.688 192 201.664v22.4zm-64 0v-22.336C640 189.248 582.272 128 512 128s-128 61.248-128 137.664v22.4h256zm201.408 483.84L768 698.496V928a32 32 0 1 1-64 0V698.496l-73.344 73.344a32 32 0 1 1-45.248-45.248l128-128a32 32 0 0 1 45.248 0l128 128a32 32 0 1 1-45.248 45.248" }) ])); } }), sell_default = _sfc_main227; var _sfc_main228 = /* @__PURE__ */ defineComponent({ name: "SemiSelect", __name: "semi-select", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 448h768q64 0 64 64t-64 64H128q-64 0-64-64t64-64" }) ])); } }), semi_select_default = _sfc_main228; var _sfc_main229 = /* @__PURE__ */ defineComponent({ name: "Service", __name: "service", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M864 409.6a192 192 0 0 1-37.888 349.44A256.064 256.064 0 0 1 576 960h-96a32 32 0 1 1 0-64h96a192.06 192.06 0 0 0 181.12-128H736a32 32 0 0 1-32-32V416a32 32 0 0 1 32-32h32c10.368 0 20.544.832 30.528 2.432a288 288 0 0 0-573.056 0A193 193 0 0 1 256 384h32a32 32 0 0 1 32 32v320a32 32 0 0 1-32 32h-32a192 192 0 0 1-96-358.4 352 352 0 0 1 704 0M256 448a128 128 0 1 0 0 256zm640 128a128 128 0 0 0-128-128v256a128 128 0 0 0 128-128" }) ])); } }), service_default = _sfc_main229; var _sfc_main230 = /* @__PURE__ */ defineComponent({ name: "SetUp", __name: "set-up", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 160a64 64 0 0 0-64 64v576a64 64 0 0 0 64 64h576a64 64 0 0 0 64-64V224a64 64 0 0 0-64-64zm0-64h576a128 128 0 0 1 128 128v576a128 128 0 0 1-128 128H224A128 128 0 0 1 96 800V224A128 128 0 0 1 224 96" }), createBaseVNode("path", { fill: "currentColor", d: "M384 416a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256" }), createBaseVNode("path", { fill: "currentColor", d: "M480 320h256q32 0 32 32t-32 32H480q-32 0-32-32t32-32m160 416a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256" }), createBaseVNode("path", { fill: "currentColor", d: "M288 640h256q32 0 32 32t-32 32H288q-32 0-32-32t32-32" }) ])); } }), set_up_default = _sfc_main230; var _sfc_main231 = /* @__PURE__ */ defineComponent({ name: "Setting", __name: "setting", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256" }) ])); } }), setting_default = _sfc_main231; var _sfc_main232 = /* @__PURE__ */ defineComponent({ name: "Share", __name: "share", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m679.872 348.8-301.76 188.608a127.8 127.8 0 0 1 5.12 52.16l279.936 104.96a128 128 0 1 1-22.464 59.904l-279.872-104.96a128 128 0 1 1-16.64-166.272l301.696-188.608a128 128 0 1 1 33.92 54.272z" }) ])); } }), share_default = _sfc_main232; var _sfc_main233 = /* @__PURE__ */ defineComponent({ name: "Ship", __name: "ship", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 386.88V448h405.568a32 32 0 0 1 30.72 40.768l-76.48 267.968A192 192 0 0 1 687.168 896H336.832a192 192 0 0 1-184.64-139.264L75.648 488.768A32 32 0 0 1 106.368 448H448V117.888a32 32 0 0 1 47.36-28.096l13.888 7.616L512 96v2.88l231.68 126.4a32 32 0 0 1-2.048 57.216zm0-70.272 144.768-65.792L512 171.84zM512 512H148.864l18.24 64H856.96l18.24-64zM185.408 640l28.352 99.2A128 128 0 0 0 336.832 832h350.336a128 128 0 0 0 123.072-92.8l28.352-99.2z" }) ])); } }), ship_default = _sfc_main233; var _sfc_main234 = /* @__PURE__ */ defineComponent({ name: "Shop", __name: "shop", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M704 704h64v192H256V704h64v64h384zm188.544-152.192C894.528 559.616 896 567.616 896 576a96 96 0 1 1-192 0 96 96 0 1 1-192 0 96 96 0 1 1-192 0 96 96 0 1 1-192 0c0-8.384 1.408-16.384 3.392-24.192L192 128h640z" }) ])); } }), shop_default = _sfc_main234; var _sfc_main235 = /* @__PURE__ */ defineComponent({ name: "ShoppingBag", __name: "shopping-bag", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M704 320v96a32 32 0 0 1-32 32h-32V320H384v128h-32a32 32 0 0 1-32-32v-96H192v576h640V320zm-384-64a192 192 0 1 1 384 0h160a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32zm64 0h256a128 128 0 1 0-256 0" }), createBaseVNode("path", { fill: "currentColor", d: "M192 704h640v64H192z" }) ])); } }), shopping_bag_default = _sfc_main235; var _sfc_main236 = /* @__PURE__ */ defineComponent({ name: "ShoppingCartFull", __name: "shopping-cart-full", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M432 928a48 48 0 1 1 0-96 48 48 0 0 1 0 96m320 0a48 48 0 1 1 0-96 48 48 0 0 1 0 96M96 128a32 32 0 0 1 0-64h160a32 32 0 0 1 31.36 25.728L320.64 256H928a32 32 0 0 1 31.296 38.72l-96 448A32 32 0 0 1 832 768H384a32 32 0 0 1-31.36-25.728L229.76 128zm314.24 576h395.904l82.304-384H333.44z" }), createBaseVNode("path", { fill: "currentColor", d: "M699.648 256 608 145.984 516.352 256zm-140.8-151.04a64 64 0 0 1 98.304 0L836.352 320H379.648z" }) ])); } }), shopping_cart_full_default = _sfc_main236; var _sfc_main237 = /* @__PURE__ */ defineComponent({ name: "ShoppingCart", __name: "shopping-cart", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M432 928a48 48 0 1 1 0-96 48 48 0 0 1 0 96m320 0a48 48 0 1 1 0-96 48 48 0 0 1 0 96M96 128a32 32 0 0 1 0-64h160a32 32 0 0 1 31.36 25.728L320.64 256H928a32 32 0 0 1 31.296 38.72l-96 448A32 32 0 0 1 832 768H384a32 32 0 0 1-31.36-25.728L229.76 128zm314.24 576h395.904l82.304-384H333.44z" }) ])); } }), shopping_cart_default = _sfc_main237; var _sfc_main238 = /* @__PURE__ */ defineComponent({ name: "ShoppingTrolley", __name: "shopping-trolley", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xml:space": "preserve", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M368 833c-13.3 0-24.5 4.5-33.5 13.5S321 866.7 321 880s4.5 24.5 13.5 33.5 20.2 13.8 33.5 14.5c13.3-.7 24.5-5.5 33.5-14.5S415 893.3 415 880s-4.5-24.5-13.5-33.5S381.3 833 368 833m439-193c7.4 0 13.8-2.2 19.5-6.5S836 623.3 838 616l112-448c2-10-.2-19.2-6.5-27.5S929 128 919 128H96c-9.3 0-17 3-23 9s-9 13.7-9 23 3 17 9 23 13.7 9 23 9h96v576h672c9.3 0 17-3 23-9s9-13.7 9-23-3-17-9-23-13.7-9-23-9H256v-64zM256 192h622l-96 384H256zm432 641c-13.3 0-24.5 4.5-33.5 13.5S641 866.7 641 880s4.5 24.5 13.5 33.5 20.2 13.8 33.5 14.5c13.3-.7 24.5-5.5 33.5-14.5S735 893.3 735 880s-4.5-24.5-13.5-33.5S701.3 833 688 833" }) ])); } }), shopping_trolley_default = _sfc_main238; var _sfc_main239 = /* @__PURE__ */ defineComponent({ name: "Smoking", __name: "smoking", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 576v128h640V576zm-32-64h704a32 32 0 0 1 32 32v192a32 32 0 0 1-32 32H224a32 32 0 0 1-32-32V544a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M704 576h64v128h-64zM256 64h64v320h-64zM128 192h64v192h-64zM64 512h64v256H64z" }) ])); } }), smoking_default = _sfc_main239; var _sfc_main240 = /* @__PURE__ */ defineComponent({ name: "Soccer", __name: "soccer", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M418.496 871.04 152.256 604.8c-16.512 94.016-2.368 178.624 42.944 224 44.928 44.928 129.344 58.752 223.296 42.24m72.32-18.176a573.06 573.06 0 0 0 224.832-137.216 573.1 573.1 0 0 0 137.216-224.832L533.888 171.84a578.56 578.56 0 0 0-227.52 138.496A567.7 567.7 0 0 0 170.432 532.48zM871.04 418.496c16.512-93.952 2.688-178.368-42.24-223.296-44.544-44.544-128.704-58.048-222.592-41.536zM149.952 874.048c-112.96-112.96-88.832-408.96 111.168-608.96C461.056 65.152 760.96 36.928 874.048 149.952c113.024 113.024 86.784 411.008-113.152 610.944s-497.92 226.112-610.944 113.152m452.544-497.792 22.656-22.656a32 32 0 0 1 45.248 45.248l-22.656 22.656 45.248 45.248A32 32 0 1 1 647.744 512l-45.248-45.248L557.248 512l45.248 45.248a32 32 0 1 1-45.248 45.248L512 557.248l-45.248 45.248L512 647.744a32 32 0 1 1-45.248 45.248l-45.248-45.248-22.656 22.656a32 32 0 1 1-45.248-45.248l22.656-22.656-45.248-45.248A32 32 0 1 1 376.256 512l45.248 45.248L466.752 512l-45.248-45.248a32 32 0 1 1 45.248-45.248L512 466.752l45.248-45.248L512 376.256a32 32 0 0 1 45.248-45.248z" }) ])); } }), soccer_default = _sfc_main240; var _sfc_main241 = /* @__PURE__ */ defineComponent({ name: "SoldOut", __name: "sold-out", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M704 288h131.072a32 32 0 0 1 31.808 28.8L886.4 512h-64.384l-16-160H704v96a32 32 0 1 1-64 0v-96H384v96a32 32 0 0 1-64 0v-96H217.92l-51.2 512H512v64H131.328a32 32 0 0 1-31.808-35.2l57.6-576a32 32 0 0 1 31.808-28.8H320v-22.336C320 154.688 405.504 64 512 64s192 90.688 192 201.664v22.4zm-64 0v-22.336C640 189.248 582.272 128 512 128s-128 61.248-128 137.664v22.4h256zm201.408 476.16a32 32 0 1 1 45.248 45.184l-128 128a32 32 0 0 1-45.248 0l-128-128a32 32 0 1 1 45.248-45.248L704 837.504V608a32 32 0 1 1 64 0v229.504l73.408-73.408z" }) ])); } }), sold_out_default = _sfc_main241; var _sfc_main242 = /* @__PURE__ */ defineComponent({ name: "SortDown", __name: "sort-down", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M576 96v709.568L333.312 562.816A32 32 0 1 0 288 608l297.408 297.344A32 32 0 0 0 640 882.688V96a32 32 0 0 0-64 0" }) ])); } }), sort_down_default = _sfc_main242; var _sfc_main243 = /* @__PURE__ */ defineComponent({ name: "SortUp", __name: "sort-up", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M384 141.248V928a32 32 0 1 0 64 0V218.56l242.688 242.688A32 32 0 1 0 736 416L438.592 118.656A32 32 0 0 0 384 141.248" }) ])); } }), sort_up_default = _sfc_main243; var _sfc_main244 = /* @__PURE__ */ defineComponent({ name: "Sort", __name: "sort", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M384 96a32 32 0 0 1 64 0v786.752a32 32 0 0 1-54.592 22.656L95.936 608a32 32 0 0 1 0-45.312h.128a32 32 0 0 1 45.184 0L384 805.632zm192 45.248a32 32 0 0 1 54.592-22.592L928.064 416a32 32 0 0 1 0 45.312h-.128a32 32 0 0 1-45.184 0L640 218.496V928a32 32 0 1 1-64 0z" }) ])); } }), sort_default = _sfc_main244; var _sfc_main245 = /* @__PURE__ */ defineComponent({ name: "Stamp", __name: "stamp", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M624 475.968V640h144a128 128 0 0 1 128 128H128a128 128 0 0 1 128-128h144V475.968a192 192 0 1 1 224 0M128 896v-64h768v64z" }) ])); } }), stamp_default = _sfc_main245; var _sfc_main246 = /* @__PURE__ */ defineComponent({ name: "StarFilled", __name: "star-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M313.6 924.48a70.4 70.4 0 0 1-74.152-5.365 70.4 70.4 0 0 1-27.992-68.875l37.888-220.928L88.96 472.96a70.4 70.4 0 0 1 3.788-104.225A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 100.246-28.595 70.4 70.4 0 0 1 25.962 28.595l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z" }) ])); } }), star_filled_default = _sfc_main246; var _sfc_main247 = /* @__PURE__ */ defineComponent({ name: "Star", __name: "star", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m512 747.84 228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72zM313.6 924.48a70.4 70.4 0 0 1-102.144-74.24l37.888-220.928L88.96 472.96A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 126.208 0l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z" }) ])); } }), star_default = _sfc_main247; var _sfc_main248 = /* @__PURE__ */ defineComponent({ name: "Stopwatch", __name: "stopwatch", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M672 234.88c-39.168 174.464-80 298.624-122.688 372.48-64 110.848-202.624 30.848-138.624-80C453.376 453.44 540.48 355.968 672 234.816z" }) ])); } }), stopwatch_default = _sfc_main248; var _sfc_main249 = /* @__PURE__ */ defineComponent({ name: "SuccessFilled", __name: "success-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z" }) ])); } }), success_filled_default = _sfc_main249; var _sfc_main250 = /* @__PURE__ */ defineComponent({ name: "Sugar", __name: "sugar", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m801.728 349.184 4.48 4.48a128 128 0 0 1 0 180.992L534.656 806.144a128 128 0 0 1-181.056 0l-4.48-4.48-19.392 109.696a64 64 0 0 1-108.288 34.176L78.464 802.56a64 64 0 0 1 34.176-108.288l109.76-19.328-4.544-4.544a128 128 0 0 1 0-181.056l271.488-271.488a128 128 0 0 1 181.056 0l4.48 4.48 19.392-109.504a64 64 0 0 1 108.352-34.048l142.592 143.04a64 64 0 0 1-34.24 108.16zm-548.8 198.72h447.168v2.24l60.8-60.8a63.8 63.8 0 0 0 18.752-44.416h-426.88l-89.664 89.728a64 64 0 0 0-10.24 13.248zm0 64q4.128 7.104 10.176 13.248l135.744 135.744a64 64 0 0 0 90.496 0L638.4 611.904zm490.048-230.976L625.152 263.104a64 64 0 0 0-90.496 0L416.768 380.928zM123.712 757.312l142.976 142.976 24.32-137.6a25.6 25.6 0 0 0-29.696-29.632zm633.6-633.344-24.32 137.472a25.6 25.6 0 0 0 29.632 29.632l137.28-24.064-142.656-143.04z" }) ])); } }), sugar_default = _sfc_main250; var _sfc_main251 = /* @__PURE__ */ defineComponent({ name: "SuitcaseLine", __name: "suitcase-line", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xml:space": "preserve", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M922.5 229.5c-24.32-24.34-54.49-36.84-90.5-37.5H704v-64c-.68-17.98-7.02-32.98-19.01-44.99S658.01 64.66 640 64H384c-17.98.68-32.98 7.02-44.99 19.01S320.66 110 320 128v64H192c-35.99.68-66.16 13.18-90.5 37.5S64.66 283.99 64 320v448c.68 35.99 13.18 66.16 37.5 90.5s54.49 36.84 90.5 37.5h640c35.99-.68 66.16-13.18 90.5-37.5s36.84-54.49 37.5-90.5V320c-.68-35.99-13.18-66.16-37.5-90.5M384 128h256v64H384zM256 832h-64c-17.98-.68-32.98-7.02-44.99-19.01S128.66 786.01 128 768V448h128zm448 0H320V448h384zm192-64c-.68 17.98-7.02 32.98-19.01 44.99S850.01 831.34 832 832h-64V448h128zm0-384H128v-64c.69-17.98 7.02-32.98 19.01-44.99S173.99 256.66 192 256h640c17.98.69 32.98 7.02 44.99 19.01S895.34 301.99 896 320z" }) ])); } }), suitcase_line_default = _sfc_main251; var _sfc_main252 = /* @__PURE__ */ defineComponent({ name: "Suitcase", __name: "suitcase", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 384h768v-64a64 64 0 0 0-64-64H192a64 64 0 0 0-64 64zm0 64v320a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V448zm64-256h640a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H192A128 128 0 0 1 64 768V320a128 128 0 0 1 128-128" }), createBaseVNode("path", { fill: "currentColor", d: "M384 128v64h256v-64zm0-64h256a64 64 0 0 1 64 64v64a64 64 0 0 1-64 64H384a64 64 0 0 1-64-64v-64a64 64 0 0 1 64-64" }) ])); } }), suitcase_default = _sfc_main252; var _sfc_main253 = /* @__PURE__ */ defineComponent({ name: "Sunny", __name: "sunny", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 704a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512m0-704a32 32 0 0 1 32 32v64a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 768a32 32 0 0 1 32 32v64a32 32 0 1 1-64 0v-64a32 32 0 0 1 32-32M195.2 195.2a32 32 0 0 1 45.248 0l45.248 45.248a32 32 0 1 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m543.104 543.104a32 32 0 0 1 45.248 0l45.248 45.248a32 32 0 0 1-45.248 45.248l-45.248-45.248a32 32 0 0 1 0-45.248M64 512a32 32 0 0 1 32-32h64a32 32 0 0 1 0 64H96a32 32 0 0 1-32-32m768 0a32 32 0 0 1 32-32h64a32 32 0 1 1 0 64h-64a32 32 0 0 1-32-32M195.2 828.8a32 32 0 0 1 0-45.248l45.248-45.248a32 32 0 0 1 45.248 45.248L240.448 828.8a32 32 0 0 1-45.248 0m543.104-543.104a32 32 0 0 1 0-45.248l45.248-45.248a32 32 0 0 1 45.248 45.248l-45.248 45.248a32 32 0 0 1-45.248 0" }) ])); } }), sunny_default = _sfc_main253; var _sfc_main254 = /* @__PURE__ */ defineComponent({ name: "Sunrise", __name: "sunrise", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M32 768h960a32 32 0 1 1 0 64H32a32 32 0 1 1 0-64m129.408-96a352 352 0 0 1 701.184 0h-64.32a288 288 0 0 0-572.544 0zM512 128a32 32 0 0 1 32 32v96a32 32 0 0 1-64 0v-96a32 32 0 0 1 32-32m407.296 168.704a32 32 0 0 1 0 45.248l-67.84 67.84a32 32 0 1 1-45.248-45.248l67.84-67.84a32 32 0 0 1 45.248 0m-814.592 0a32 32 0 0 1 45.248 0l67.84 67.84a32 32 0 1 1-45.248 45.248l-67.84-67.84a32 32 0 0 1 0-45.248" }) ])); } }), sunrise_default = _sfc_main254; var _sfc_main255 = /* @__PURE__ */ defineComponent({ name: "Sunset", __name: "sunset", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M82.56 640a448 448 0 1 1 858.88 0h-67.2a384 384 0 1 0-724.288 0zM32 704h960q32 0 32 32t-32 32H32q-32 0-32-32t32-32m256 128h448q32 0 32 32t-32 32H288q-32 0-32-32t32-32" }) ])); } }), sunset_default = _sfc_main255; var _sfc_main256 = /* @__PURE__ */ defineComponent({ name: "SwitchButton", __name: "switch-button", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M352 159.872V230.4a352 352 0 1 0 320 0v-70.528A416.128 416.128 0 0 1 512 960a416 416 0 0 1-160-800.128" }), createBaseVNode("path", { fill: "currentColor", d: "M512 64q32 0 32 32v320q0 32-32 32t-32-32V96q0-32 32-32" }) ])); } }), switch_button_default = _sfc_main256; var _sfc_main257 = /* @__PURE__ */ defineComponent({ name: "SwitchFilled", __name: "switch-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xml:space": "preserve", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M247.47 358.4v.04c.07 19.17 7.72 37.53 21.27 51.09s31.92 21.2 51.09 21.27c39.86 0 72.41-32.6 72.41-72.4s-32.6-72.36-72.41-72.36-72.36 32.55-72.36 72.36" }), createBaseVNode("path", { fill: "currentColor", d: "M492.38 128H324.7c-52.16 0-102.19 20.73-139.08 57.61a196.66 196.66 0 0 0-57.61 139.08V698.7c-.01 25.84 5.08 51.42 14.96 75.29s24.36 45.56 42.63 63.83 39.95 32.76 63.82 42.65a196.7 196.7 0 0 0 75.28 14.98h167.68c3.03 0 5.46-2.43 5.46-5.42V133.42c.6-2.99-1.83-5.42-5.46-5.42m-56.11 705.88H324.7c-17.76.13-35.36-3.33-51.75-10.18s-31.22-16.94-43.61-29.67c-25.3-25.35-39.81-59.1-39.81-95.32V324.69c-.13-17.75 3.33-35.35 10.17-51.74a131.7 131.7 0 0 1 29.64-43.62c25.39-25.3 59.14-39.81 95.36-39.81h111.57zm402.12-647.67a196.66 196.66 0 0 0-139.08-57.61H580.48c-3.03 0-4.82 2.43-4.82 4.82v757.16c-.6 2.99 1.79 5.42 5.42 5.42h118.23a196.7 196.7 0 0 0 139.08-57.61A196.66 196.66 0 0 0 896 699.31V325.29a196.7 196.7 0 0 0-57.61-139.08m-111.3 441.92c-42.83 0-77.82-34.99-77.82-77.82s34.98-77.82 77.82-77.82c42.83 0 77.82 34.99 77.82 77.82s-34.99 77.82-77.82 77.82" }) ])); } }), switch_filled_default = _sfc_main257; var _sfc_main258 = /* @__PURE__ */ defineComponent({ name: "Switch", __name: "switch", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M118.656 438.656a32 32 0 0 1 0-45.248L416 96l4.48-3.776A32 32 0 0 1 461.248 96l3.712 4.48a32.064 32.064 0 0 1-3.712 40.832L218.56 384H928a32 32 0 1 1 0 64H141.248a32 32 0 0 1-22.592-9.344M64 608a32 32 0 0 1 32-32h786.752a32 32 0 0 1 22.656 54.592L608 928l-4.48 3.776a32.064 32.064 0 0 1-40.832-49.024L805.632 640H96a32 32 0 0 1-32-32" }) ])); } }), switch_default$1 = _sfc_main258; var _sfc_main259 = /* @__PURE__ */ defineComponent({ name: "TakeawayBox", __name: "takeaway-box", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M832 384H192v448h640zM96 320h832V128H96zm800 64v480a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V384H64a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32h896a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zM416 512h192a32 32 0 0 1 0 64H416a32 32 0 0 1 0-64" }) ])); } }), takeaway_box_default = _sfc_main259; var _sfc_main260 = /* @__PURE__ */ defineComponent({ name: "Ticket", __name: "ticket", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M640 832H64V640a128 128 0 1 0 0-256V192h576v160h64V192h256v192a128 128 0 1 0 0 256v192H704V672h-64zm0-416v192h64V416z" }) ])); } }), ticket_default = _sfc_main260; var _sfc_main261 = /* @__PURE__ */ defineComponent({ name: "Tickets", __name: "tickets", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h192v64H320zm0 384h384v64H320z" }) ])); } }), tickets_default = _sfc_main261; var _sfc_main262 = /* @__PURE__ */ defineComponent({ name: "Timer", __name: "timer", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a320 320 0 1 0 0-640 320 320 0 0 0 0 640m0 64a384 384 0 1 1 0-768 384 384 0 0 1 0 768" }), createBaseVNode("path", { fill: "currentColor", d: "M512 320a32 32 0 0 1 32 32l-.512 224a32 32 0 1 1-64 0L480 352a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M448 576a64 64 0 1 0 128 0 64 64 0 1 0-128 0m96-448v128h-64V128h-96a32 32 0 0 1 0-64h256a32 32 0 1 1 0 64z" }) ])); } }), timer_default = _sfc_main262; var _sfc_main263 = /* @__PURE__ */ defineComponent({ name: "ToiletPaper", __name: "toilet-paper", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M595.2 128H320a192 192 0 0 0-192 192v576h384V352c0-90.496 32.448-171.2 83.2-224M736 64c123.712 0 224 128.96 224 288S859.712 640 736 640H576v320H64V320A256 256 0 0 1 320 64zM576 352v224h160c84.352 0 160-97.28 160-224s-75.648-224-160-224-160 97.28-160 224" }), createBaseVNode("path", { fill: "currentColor", d: "M736 448c-35.328 0-64-43.008-64-96s28.672-96 64-96 64 43.008 64 96-28.672 96-64 96" }) ])); } }), toilet_paper_default = _sfc_main263; var _sfc_main264 = /* @__PURE__ */ defineComponent({ name: "Tools", __name: "tools", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M764.416 254.72a351.7 351.7 0 0 1 86.336 149.184H960v192.064H850.752a351.7 351.7 0 0 1-86.336 149.312l54.72 94.72-166.272 96-54.592-94.72a352.64 352.64 0 0 1-172.48 0L371.136 936l-166.272-96 54.72-94.72a351.7 351.7 0 0 1-86.336-149.312H64v-192h109.248a351.7 351.7 0 0 1 86.336-149.312L204.8 160l166.208-96h.192l54.656 94.592a352.64 352.64 0 0 1 172.48 0L652.8 64h.128L819.2 160l-54.72 94.72zM704 499.968a192 192 0 1 0-384 0 192 192 0 0 0 384 0" }) ])); } }), tools_default = _sfc_main264; var _sfc_main265 = /* @__PURE__ */ defineComponent({ name: "TopLeft", __name: "top-left", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M256 256h416a32 32 0 1 0 0-64H224a32 32 0 0 0-32 32v448a32 32 0 0 0 64 0z" }), createBaseVNode("path", { fill: "currentColor", d: "M246.656 201.344a32 32 0 0 0-45.312 45.312l544 544a32 32 0 0 0 45.312-45.312z" }) ])); } }), top_left_default = _sfc_main265; var _sfc_main266 = /* @__PURE__ */ defineComponent({ name: "TopRight", __name: "top-right", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M768 256H353.6a32 32 0 1 1 0-64H800a32 32 0 0 1 32 32v448a32 32 0 0 1-64 0z" }), createBaseVNode("path", { fill: "currentColor", d: "M777.344 201.344a32 32 0 0 1 45.312 45.312l-544 544a32 32 0 0 1-45.312-45.312z" }) ])); } }), top_right_default = _sfc_main266; var _sfc_main267 = /* @__PURE__ */ defineComponent({ name: "Top", __name: "top", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M572.235 205.282v600.365a30.118 30.118 0 1 1-60.235 0V205.282L292.382 438.633a28.913 28.913 0 0 1-42.646 0 33.43 33.43 0 0 1 0-45.236l271.058-288.045a28.913 28.913 0 0 1 42.647 0L834.5 393.397a33.43 33.43 0 0 1 0 45.176 28.913 28.913 0 0 1-42.647 0l-219.618-233.23z" }) ])); } }), top_default = _sfc_main267; var _sfc_main268 = /* @__PURE__ */ defineComponent({ name: "TrendCharts", __name: "trend-charts", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 896V128h768v768zm291.712-327.296 128 102.4 180.16-201.792-47.744-42.624-139.84 156.608-128-102.4-180.16 201.792 47.744 42.624zM816 352a48 48 0 1 0-96 0 48 48 0 0 0 96 0" }) ])); } }), trend_charts_default = _sfc_main268; var _sfc_main269 = /* @__PURE__ */ defineComponent({ name: "TrophyBase", __name: "trophy-base", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xml:space": "preserve", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M918.4 201.6c-6.4-6.4-12.8-9.6-22.4-9.6H768V96c0-9.6-3.2-16-9.6-22.4S745.6 64 736 64H288c-9.6 0-16 3.2-22.4 9.6S256 86.4 256 96v96H128c-9.6 0-16 3.2-22.4 9.6S96 217.6 96 224c3.2 108.8 25.6 185.6 64 224 34.4 34.4 77.56 55.65 127.65 61.99 10.91 20.44 24.78 39.25 41.95 56.41 40.86 40.86 91 65.47 150.4 71.9V768h-96c-9.6 0-16 3.2-22.4 9.6S352 790.4 352 800s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6h256c9.6 0 16-3.2 22.4-9.6s9.6-12.8 9.6-22.4-3.2-16-9.6-22.4-12.8-9.6-22.4-9.6h-96V637.26c59.4-7.71 109.54-30.01 150.4-70.86 17.2-17.2 31.51-36.06 42.81-56.55 48.93-6.51 90.02-27.7 126.79-61.85 38.4-38.4 60.8-112 64-224 0-6.4-3.2-16-9.6-22.4M256 438.4c-19.2-6.4-35.2-19.2-51.2-35.2-22.4-22.4-35.2-70.4-41.6-147.2H256zm390.4 80C608 553.6 566.4 576 512 576s-99.2-19.2-134.4-57.6S320 438.4 320 384V128h384v256q0 81.6-57.6 134.4m172.8-115.2c-16 16-32 25.6-51.2 35.2V256h92.8c-6.4 76.8-19.2 124.8-41.6 147.2M768 896H256c-9.6 0-16 3.2-22.4 9.6S224 918.4 224 928s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6h512c9.6 0 16-3.2 22.4-9.6s9.6-12.8 9.6-22.4-3.2-16-9.6-22.4-12.8-9.6-22.4-9.6" }) ])); } }), trophy_base_default = _sfc_main269; var _sfc_main270 = /* @__PURE__ */ defineComponent({ name: "Trophy", __name: "trophy", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M480 896V702.08A256.26 256.26 0 0 1 264.064 512h-32.64a96 96 0 0 1-91.968-68.416L93.632 290.88a76.8 76.8 0 0 1 73.6-98.88H256V96a32 32 0 0 1 32-32h448a32 32 0 0 1 32 32v96h88.768a76.8 76.8 0 0 1 73.6 98.88L884.48 443.52A96 96 0 0 1 792.576 512h-32.64A256.26 256.26 0 0 1 544 702.08V896h128a32 32 0 1 1 0 64H352a32 32 0 1 1 0-64zm224-448V128H320v320a192 192 0 1 0 384 0m64 0h24.576a32 32 0 0 0 30.656-22.784l45.824-152.768A12.8 12.8 0 0 0 856.768 256H768zm-512 0V256h-88.768a12.8 12.8 0 0 0-12.288 16.448l45.824 152.768A32 32 0 0 0 231.424 448z" }) ])); } }), trophy_default = _sfc_main270; var _sfc_main271 = /* @__PURE__ */ defineComponent({ name: "TurnOff", __name: "turn-off", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M329.956 257.138a254.862 254.862 0 0 0 0 509.724h364.088a254.862 254.862 0 0 0 0-509.724zm0-72.818h364.088a327.68 327.68 0 1 1 0 655.36H329.956a327.68 327.68 0 1 1 0-655.36" }), createBaseVNode("path", { fill: "currentColor", d: "M329.956 621.227a109.227 109.227 0 1 0 0-218.454 109.227 109.227 0 0 0 0 218.454m0 72.817a182.044 182.044 0 1 1 0-364.088 182.044 182.044 0 0 1 0 364.088" }) ])); } }), turn_off_default = _sfc_main271; var _sfc_main272 = /* @__PURE__ */ defineComponent({ name: "Umbrella", __name: "umbrella", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M320 768a32 32 0 1 1 64 0 64 64 0 0 0 128 0V512H64a448 448 0 1 1 896 0H576v256a128 128 0 1 1-256 0m570.688-320a384.128 384.128 0 0 0-757.376 0z" }) ])); } }), umbrella_default = _sfc_main272; var _sfc_main273 = /* @__PURE__ */ defineComponent({ name: "Unlock", __name: "unlock", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96" }), createBaseVNode("path", { fill: "currentColor", d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z" }) ])); } }), unlock_default = _sfc_main273; var _sfc_main274 = /* @__PURE__ */ defineComponent({ name: "UploadFilled", __name: "upload-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M544 864V672h128L512 480 352 672h128v192H320v-1.6c-5.376.32-10.496 1.6-16 1.6A240 240 0 0 1 64 624c0-123.136 93.12-223.488 212.608-237.248A239.81 239.81 0 0 1 512 192a239.87 239.87 0 0 1 235.456 194.752c119.488 13.76 212.48 114.112 212.48 237.248a240 240 0 0 1-240 240c-5.376 0-10.56-1.28-16-1.6v1.6z" }) ])); } }), upload_filled_default = _sfc_main274; var _sfc_main275 = /* @__PURE__ */ defineComponent({ name: "Upload", __name: "upload", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z" }) ])); } }), upload_default$1 = _sfc_main275; var _sfc_main276 = /* @__PURE__ */ defineComponent({ name: "UserFilled", __name: "user-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M288 320a224 224 0 1 0 448 0 224 224 0 1 0-448 0m544 608H160a32 32 0 0 1-32-32v-96a160 160 0 0 1 160-160h448a160 160 0 0 1 160 160v96a32 32 0 0 1-32 32z" }) ])); } }), user_filled_default = _sfc_main276; var _sfc_main277 = /* @__PURE__ */ defineComponent({ name: "User", __name: "user", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 512a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512m320 320v-96a96 96 0 0 0-96-96H288a96 96 0 0 0-96 96v96a32 32 0 1 1-64 0v-96a160 160 0 0 1 160-160h448a160 160 0 0 1 160 160v96a32 32 0 1 1-64 0" }) ])); } }), user_default = _sfc_main277; var _sfc_main278 = /* @__PURE__ */ defineComponent({ name: "Van", __name: "van", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128.896 736H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32v96h164.544a32 32 0 0 1 31.616 27.136l54.144 352A32 32 0 0 1 922.688 736h-91.52a144 144 0 1 1-286.272 0H415.104a144 144 0 1 1-286.272 0zm23.36-64a143.872 143.872 0 0 1 239.488 0H568.32c17.088-25.6 42.24-45.376 71.744-55.808V256H128v416zm655.488 0h77.632l-19.648-128H704v64.896A144 144 0 0 1 807.744 672m48.128-192-14.72-96H704v96zM688 832a80 80 0 1 0 0-160 80 80 0 0 0 0 160m-416 0a80 80 0 1 0 0-160 80 80 0 0 0 0 160" }) ])); } }), van_default = _sfc_main278; var _sfc_main279 = /* @__PURE__ */ defineComponent({ name: "VideoCameraFilled", __name: "video-camera-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m768 576 192-64v320l-192-64v96a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zM192 768v64h384v-64zm192-480a160 160 0 0 1 320 0 160 160 0 0 1-320 0m64 0a96 96 0 1 0 192.064-.064A96 96 0 0 0 448 288m-320 32a128 128 0 1 1 256.064.064A128 128 0 0 1 128 320m64 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0" }) ])); } }), video_camera_filled_default = _sfc_main279; var _sfc_main280 = /* @__PURE__ */ defineComponent({ name: "VideoCamera", __name: "video-camera", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M704 768V256H128v512zm64-416 192-96v512l-192-96v128a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 71.552v176.896l128 64V359.552zM192 320h192v64H192z" }) ])); } }), video_camera_default = _sfc_main280; var _sfc_main281 = /* @__PURE__ */ defineComponent({ name: "VideoPause", __name: "video-pause", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-96-544q32 0 32 32v256q0 32-32 32t-32-32V384q0-32 32-32m192 0q32 0 32 32v256q0 32-32 32t-32-32V384q0-32 32-32" }) ])); } }), video_pause_default = _sfc_main281; var _sfc_main282 = /* @__PURE__ */ defineComponent({ name: "VideoPlay", __name: "video-play", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-48-247.616L668.608 512 464 375.616zm10.624-342.656 249.472 166.336a48 48 0 0 1 0 79.872L474.624 718.272A48 48 0 0 1 400 678.336V345.6a48 48 0 0 1 74.624-39.936z" }) ])); } }), video_play_default = _sfc_main282; var _sfc_main283 = /* @__PURE__ */ defineComponent({ name: "View", __name: "view", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160" }) ])); } }), view_default = _sfc_main283; var _sfc_main284 = /* @__PURE__ */ defineComponent({ name: "WalletFilled", __name: "wallet-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M688 512a112 112 0 1 0 0 224h208v160H128V352h768v160zm32 160h-32a48 48 0 0 1 0-96h32a48 48 0 0 1 0 96m-80-544 128 160H384z" }) ])); } }), wallet_filled_default = _sfc_main284; var _sfc_main285 = /* @__PURE__ */ defineComponent({ name: "Wallet", __name: "wallet", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M640 288h-64V128H128v704h384v32a32 32 0 0 0 32 32H96a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32h512a32 32 0 0 1 32 32z" }), createBaseVNode("path", { fill: "currentColor", d: "M128 320v512h768V320zm-32-64h832a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M704 640a64 64 0 1 1 0-128 64 64 0 0 1 0 128" }) ])); } }), wallet_default = _sfc_main285; var _sfc_main286 = /* @__PURE__ */ defineComponent({ name: "WarnTriangleFilled", __name: "warn-triangle-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xml:space": "preserve", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M928.99 755.83 574.6 203.25c-12.89-20.16-36.76-32.58-62.6-32.58s-49.71 12.43-62.6 32.58L95.01 755.83c-12.91 20.12-12.9 44.91.01 65.03 12.92 20.12 36.78 32.51 62.59 32.49h708.78c25.82.01 49.68-12.37 62.59-32.49s12.92-44.91.01-65.03M554.67 768h-85.33v-85.33h85.33zm0-426.67v298.66h-85.33V341.32z" }) ])); } }), warn_triangle_filled_default = _sfc_main286; var _sfc_main287 = /* @__PURE__ */ defineComponent({ name: "WarningFilled", __name: "warning-filled", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4" }) ])); } }), warning_filled_default = _sfc_main287; var _sfc_main288 = /* @__PURE__ */ defineComponent({ name: "Warning", __name: "warning", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32" }) ])); } }), warning_default = _sfc_main288; var _sfc_main289 = /* @__PURE__ */ defineComponent({ name: "Watch", __name: "watch", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 768a256 256 0 1 0 0-512 256 256 0 0 0 0 512m0 64a320 320 0 1 1 0-640 320 320 0 0 1 0 640" }), createBaseVNode("path", { fill: "currentColor", d: "M480 352a32 32 0 0 1 32 32v160a32 32 0 0 1-64 0V384a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M480 512h128q32 0 32 32t-32 32H480q-32 0-32-32t32-32m128-256V128H416v128h-64V64h320v192zM416 768v128h192V768h64v192H352V768z" }) ])); } }), watch_default = _sfc_main289; var _sfc_main290 = /* @__PURE__ */ defineComponent({ name: "Watermelon", __name: "watermelon", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m683.072 600.32-43.648 162.816-61.824-16.512 53.248-198.528L576 493.248l-158.4 158.4-45.248-45.248 158.4-158.4-55.616-55.616-198.528 53.248-16.512-61.824 162.816-43.648L282.752 200A384 384 0 0 0 824 741.248zm231.552 141.056a448 448 0 1 1-632-632z" }) ])); } }), watermelon_default = _sfc_main290; var _sfc_main291 = /* @__PURE__ */ defineComponent({ name: "WindPower", __name: "wind-power", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 64q32 0 32 32v832q0 32-32 32t-32-32V96q0-32 32-32m416 354.624 128-11.584V168.96l-128-11.52v261.12zm-64 5.824V151.552L320 134.08V160h-64V64l616.704 56.064A96 96 0 0 1 960 215.68v144.64a96 96 0 0 1-87.296 95.616L256 512V224h64v217.92zm256-23.232 98.88-8.96A32 32 0 0 0 896 360.32V215.68a32 32 0 0 0-29.12-31.872l-98.88-8.96z" }) ])); } }), wind_power_default = _sfc_main291; var _sfc_main292 = /* @__PURE__ */ defineComponent({ name: "ZoomIn", __name: "zoom-in", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z" }) ])); } }), zoom_in_default = _sfc_main292; var _sfc_main293 = /* @__PURE__ */ defineComponent({ name: "ZoomOut", __name: "zoom-out", setup(__props) { return (_ctx, _cache) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64" }) ])); } }), zoom_out_default = _sfc_main293; const ElementPlusIconsVue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, AddLocation: add_location_default, Aim: aim_default, AlarmClock: alarm_clock_default, Apple: apple_default, ArrowDown: arrow_down_default, ArrowDownBold: arrow_down_bold_default, ArrowLeft: arrow_left_default, ArrowLeftBold: arrow_left_bold_default, ArrowRight: arrow_right_default, ArrowRightBold: arrow_right_bold_default, ArrowUp: arrow_up_default, ArrowUpBold: arrow_up_bold_default, Avatar: avatar_default$1, Back: back_default, Baseball: baseball_default, Basketball: basketball_default, Bell: bell_default, BellFilled: bell_filled_default, Bicycle: bicycle_default, Bottom: bottom_default, BottomLeft: bottom_left_default, BottomRight: bottom_right_default, Bowl: bowl_default, Box: box_default, Briefcase: briefcase_default, Brush: brush_default, BrushFilled: brush_filled_default, Burger: burger_default, Calendar: calendar_default$1, Camera: camera_default, CameraFilled: camera_filled_default, CaretBottom: caret_bottom_default, CaretLeft: caret_left_default, CaretRight: caret_right_default, CaretTop: caret_top_default, Cellphone: cellphone_default, ChatDotRound: chat_dot_round_default, ChatDotSquare: chat_dot_square_default, ChatLineRound: chat_line_round_default, ChatLineSquare: chat_line_square_default, ChatRound: chat_round_default, ChatSquare: chat_square_default, Check: check_default, Checked: checked_default, Cherry: cherry_default, Chicken: chicken_default, ChromeFilled: chrome_filled_default, CircleCheck: circle_check_default, CircleCheckFilled: circle_check_filled_default, CircleClose: circle_close_default, CircleCloseFilled: circle_close_filled_default, CirclePlus: circle_plus_default, CirclePlusFilled: circle_plus_filled_default, Clock: clock_default, Close: close_default, CloseBold: close_bold_default, Cloudy: cloudy_default, Coffee: coffee_default, CoffeeCup: coffee_cup_default, Coin: coin_default, ColdDrink: cold_drink_default, Collection: collection_default$1, CollectionTag: collection_tag_default, Comment: comment_default, Compass: compass_default, Connection: connection_default, Coordinate: coordinate_default, CopyDocument: copy_document_default, Cpu: cpu_default, CreditCard: credit_card_default, Crop: crop_default, DArrowLeft: d_arrow_left_default, DArrowRight: d_arrow_right_default, DCaret: d_caret_default, DataAnalysis: data_analysis_default, DataBoard: data_board_default, DataLine: data_line_default, Delete: delete_default, DeleteFilled: delete_filled_default, DeleteLocation: delete_location_default, Dessert: dessert_default, Discount: discount_default, Dish: dish_default, DishDot: dish_dot_default, Document: document_default, DocumentAdd: document_add_default, DocumentChecked: document_checked_default, DocumentCopy: document_copy_default, DocumentDelete: document_delete_default, DocumentRemove: document_remove_default, Download: download_default, Drizzling: drizzling_default, Edit: edit_default, EditPen: edit_pen_default, Eleme: eleme_default, ElemeFilled: eleme_filled_default, ElementPlus: element_plus_default$1, Expand: expand_default, Failed: failed_default, Female: female_default, Files: files_default, Film: film_default, Filter: filter_default, Finished: finished_default, FirstAidKit: first_aid_kit_default, Flag: flag_default, Fold: fold_default, Folder: folder_default, FolderAdd: folder_add_default, FolderChecked: folder_checked_default, FolderDelete: folder_delete_default, FolderOpened: folder_opened_default, FolderRemove: folder_remove_default, Food: food_default, Football: football_default, ForkSpoon: fork_spoon_default, Fries: fries_default, FullScreen: full_screen_default, Goblet: goblet_default, GobletFull: goblet_full_default, GobletSquare: goblet_square_default, GobletSquareFull: goblet_square_full_default, GoldMedal: gold_medal_default, Goods: goods_default, GoodsFilled: goods_filled_default, Grape: grape_default, Grid: grid_default, Guide: guide_default, Handbag: handbag_default, Headset: headset_default, Help: help_default, HelpFilled: help_filled_default, Hide: hide_default, Histogram: histogram_default, HomeFilled: home_filled_default, HotWater: hot_water_default, House: house_default, IceCream: ice_cream_default, IceCreamRound: ice_cream_round_default, IceCreamSquare: ice_cream_square_default, IceDrink: ice_drink_default, IceTea: ice_tea_default, InfoFilled: info_filled_default, Iphone: iphone_default, Key: key_default, KnifeFork: knife_fork_default, Lightning: lightning_default, Link: link_default$1, List: list_default, Loading: loading_default, Location: location_default, LocationFilled: location_filled_default, LocationInformation: location_information_default, Lock: lock_default, Lollipop: lollipop_default, MagicStick: magic_stick_default, Magnet: magnet_default, Male: male_default, Management: management_default, MapLocation: map_location_default, Medal: medal_default, Memo: memo_default, Menu: menu_default$2, Message: message_default$1, MessageBox: message_box_default, Mic: mic_default, Microphone: microphone_default, MilkTea: milk_tea_default, Minus: minus_default, Money: money_default, Monitor: monitor_default, Moon: moon_default, MoonNight: moon_night_default, More: more_default, MoreFilled: more_filled_default, MostlyCloudy: mostly_cloudy_default, Mouse: mouse_default, Mug: mug_default, Mute: mute_default, MuteNotification: mute_notification_default, NoSmoking: no_smoking_default, Notebook: notebook_default, Notification: notification_default$1, Odometer: odometer_default, OfficeBuilding: office_building_default, Open: open_default, Operation: operation_default, Opportunity: opportunity_default, Orange: orange_default, Paperclip: paperclip_default, PartlyCloudy: partly_cloudy_default, Pear: pear_default, Phone: phone_default, PhoneFilled: phone_filled_default, Picture: picture_default, PictureFilled: picture_filled_default, PictureRounded: picture_rounded_default, PieChart: pie_chart_default, Place: place_default, Platform: platform_default, Plus: plus_default, Pointer: pointer_default, Position: position_default, Postcard: postcard_default, Pouring: pouring_default, Present: present_default, PriceTag: price_tag_default, Printer: printer_default, Promotion: promotion_default, QuartzWatch: quartz_watch_default, QuestionFilled: question_filled_default, Rank: rank_default, Reading: reading_default, ReadingLamp: reading_lamp_default, Refresh: refresh_default, RefreshLeft: refresh_left_default, RefreshRight: refresh_right_default, Refrigerator: refrigerator_default, Remove: remove_default, RemoveFilled: remove_filled_default, Right: right_default, ScaleToOriginal: scale_to_original_default, School: school_default, Scissor: scissor_default, Search: search_default, Select: select_default$2, Sell: sell_default, SemiSelect: semi_select_default, Service: service_default, SetUp: set_up_default, Setting: setting_default, Share: share_default, Ship: ship_default, Shop: shop_default, ShoppingBag: shopping_bag_default, ShoppingCart: shopping_cart_default, ShoppingCartFull: shopping_cart_full_default, ShoppingTrolley: shopping_trolley_default, Smoking: smoking_default, Soccer: soccer_default, SoldOut: sold_out_default, Sort: sort_default, SortDown: sort_down_default, SortUp: sort_up_default, Stamp: stamp_default, Star: star_default, StarFilled: star_filled_default, Stopwatch: stopwatch_default, SuccessFilled: success_filled_default, Sugar: sugar_default, Suitcase: suitcase_default, SuitcaseLine: suitcase_line_default, Sunny: sunny_default, Sunrise: sunrise_default, Sunset: sunset_default, Switch: switch_default$1, SwitchButton: switch_button_default, SwitchFilled: switch_filled_default, TakeawayBox: takeaway_box_default, Ticket: ticket_default, Tickets: tickets_default, Timer: timer_default, ToiletPaper: toilet_paper_default, Tools: tools_default, Top: top_default, TopLeft: top_left_default, TopRight: top_right_default, TrendCharts: trend_charts_default, Trophy: trophy_default, TrophyBase: trophy_base_default, TurnOff: turn_off_default, Umbrella: umbrella_default, Unlock: unlock_default, Upload: upload_default$1, UploadFilled: upload_filled_default, User: user_default, UserFilled: user_filled_default, Van: van_default, VideoCamera: video_camera_default, VideoCameraFilled: video_camera_filled_default, VideoPause: video_pause_default, VideoPlay: video_play_default, View: view_default, Wallet: wallet_default, WalletFilled: wallet_filled_default, WarnTriangleFilled: warn_triangle_filled_default, Warning: warning_default, WarningFilled: warning_filled_default, Watch: watch_default, Watermelon: watermelon_default, WindPower: wind_power_default, ZoomIn: zoom_in_default, ZoomOut: zoom_out_default }, Symbol.toStringTag, { value: "Module" })); const iconPropType = definePropType([ String, Object, Function ]); const CloseComponents = { Close: close_default }; const TypeComponents = { Close: close_default, SuccessFilled: success_filled_default, InfoFilled: info_filled_default, WarningFilled: warning_filled_default, CircleCloseFilled: circle_close_filled_default }; const TypeComponentsMap = { primary: info_filled_default, success: success_filled_default, warning: warning_filled_default, error: circle_close_filled_default, info: info_filled_default }; const ValidateComponentsMap = { validating: loading_default, success: circle_check_default, error: circle_close_default }; const alertEffects = ["light", "dark"]; const alertProps = buildProps({ title: { type: String, default: "" }, description: { type: String, default: "" }, type: { type: String, values: keysOf(TypeComponentsMap), default: "info" }, closable: { type: Boolean, default: true }, closeText: { type: String, default: "" }, showIcon: Boolean, center: Boolean, effect: { type: String, values: alertEffects, default: "light" } }); const alertEmits = { close: (evt) => evt instanceof MouseEvent }; const iconProps = buildProps({ size: { type: definePropType([Number, String]) }, color: { type: String } }); var icon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElIcon", inheritAttrs: false, __name: "icon", props: iconProps, setup(__props) { const props2 = __props; const ns = useNamespace("icon"); const style = computed(() => { const { size, color } = props2; const fontSize = addUnit(size); if (!fontSize && !color) return {}; return { fontSize, "--color": color }; }); return (_ctx, _cache) => { return openBlock(), createElementBlock("i", mergeProps({ class: unref(ns).b(), style: style.value }, _ctx.$attrs), [renderSlot(_ctx.$slots, "default")], 16); }; } }); var icon_default = icon_vue_vue_type_script_setup_true_lang_default; const ElIcon = withInstall(icon_default); var alert_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElAlert", __name: "alert", props: alertProps, emits: alertEmits, setup(__props, { emit: __emit }) { const { Close } = TypeComponents; const props2 = __props; const emit = __emit; const slots = useSlots(); const ns = useNamespace("alert"); const visible = ref(true); const iconComponent = computed(() => TypeComponentsMap[props2.type]); const hasDesc = computed(() => { var _a; if (props2.description) return true; const slotContent = (_a = slots.default) == null ? void 0 : _a.call(slots); if (!slotContent) return false; return flattedChildren(slotContent).some((child) => !isComment(child)); }); const close2 = (evt) => { visible.value = false; emit("close", evt); }; return (_ctx, _cache) => { return openBlock(), createBlock(Transition, { name: unref(ns).b("fade"), persisted: "" }, { default: withCtx(() => [withDirectives(createBaseVNode("div", { class: normalizeClass([ unref(ns).b(), unref(ns).m(__props.type), unref(ns).is("center", __props.center), unref(ns).is(__props.effect) ]), role: "alert" }, [__props.showIcon && (_ctx.$slots.icon || iconComponent.value) ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass([unref(ns).e("icon"), unref(ns).is("big", hasDesc.value)]) }, { default: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [(openBlock(), createBlock(resolveDynamicComponent(iconComponent.value)))])]), _: 3 }, 8, ["class"])) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [ __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass([unref(ns).e("title"), { "with-description": hasDesc.value }]) }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2)) : createCommentVNode("v-if", true), hasDesc.value ? (openBlock(), createElementBlock("p", { key: 1, class: normalizeClass(unref(ns).e("description")) }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])], 2)) : createCommentVNode("v-if", true), __props.closable ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [__props.closeText ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass([unref(ns).e("close-btn"), unref(ns).is("customed")]), onClick: close2 }, toDisplayString(__props.closeText), 3)) : (openBlock(), createBlock(unref(ElIcon), { key: 1, class: normalizeClass(unref(ns).e("close-btn")), onClick: close2 }, { default: withCtx(() => [createVNode(unref(Close))]), _: 1 }, 8, ["class"]))], 64)) : createCommentVNode("v-if", true) ], 2)], 2), [[vShow, visible.value]])]), _: 3 }, 8, ["name"]); }; } }); var alert_default = alert_vue_vue_type_script_setup_true_lang_default; const ElAlert = withInstall(alert_default); const roleTypes = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ]; const popperProps = buildProps({ role: { type: String, values: roleTypes, default: "tooltip" } }); const POPPER_INJECTION_KEY = Symbol("popper"); const POPPER_CONTENT_INJECTION_KEY = Symbol("popperContent"); var arrow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPopperArrow", inheritAttrs: false, __name: "arrow", setup(__props, { expose: __expose }) { const ns = useNamespace("popper"); const { arrowRef, arrowStyle } = inject(POPPER_CONTENT_INJECTION_KEY, void 0); onBeforeUnmount(() => { arrowRef.value = void 0; }); __expose({ arrowRef }); return (_ctx, _cache) => { return openBlock(), createElementBlock("span", { ref_key: "arrowRef", ref: arrowRef, class: normalizeClass(unref(ns).e("arrow")), style: normalizeStyle(unref(arrowStyle)), "data-popper-arrow": "" }, null, 6); }; } }); var arrow_default = arrow_vue_vue_type_script_setup_true_lang_default; const popperTriggerProps = buildProps({ virtualRef: { type: definePropType(Object) }, virtualTriggering: Boolean, onMouseenter: { type: definePropType(Function) }, onMouseleave: { type: definePropType(Function) }, onClick: { type: definePropType(Function) }, onKeydown: { type: definePropType(Function) }, onFocus: { type: definePropType(Function) }, onBlur: { type: definePropType(Function) }, onContextmenu: { type: definePropType(Function) }, id: String, open: Boolean }); const NAME = "ElOnlyChild"; const OnlyChild = /* @__PURE__ */ defineComponent({ name: NAME, setup(_, { slots, attrs }) { var _a; const forwardRefDirective = useForwardRefDirective(((_a = inject(FORWARD_REF_INJECTION_KEY)) == null ? void 0 : _a.setForwardRef) ?? NOOP); return () => { var _a2; const defaultSlot = (_a2 = slots.default) == null ? void 0 : _a2.call(slots, attrs); if (!defaultSlot) return null; const [firstLegitNode, length] = findFirstLegitChild(defaultSlot); if (!firstLegitNode) { debugWarn(NAME, "no valid child node found"); return null; } if (length > 1) debugWarn(NAME, "requires exact only one valid child."); return withDirectives(cloneVNode(firstLegitNode, attrs), [[forwardRefDirective]]); }; } }); function findFirstLegitChild(node) { if (!node) return [null, 0]; const children = node; const len = children.filter((c) => c.type !== Comment).length; for (const child of children) { if (isObject(child)) switch (child.type) { case Comment: continue; case Text: case "svg": return [wrapTextContent(child), len]; case Fragment: return findFirstLegitChild(child.children); default: return [child, len]; } return [wrapTextContent(child), len]; } return [null, 0]; } function wrapTextContent(s) { const ns = useNamespace("only-child"); return createVNode("span", { "class": ns.e("content") }, [s]); } var trigger_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ defineComponent({ name: "ElPopperTrigger", inheritAttrs: false, __name: "trigger", props: popperTriggerProps, setup(__props, { expose: __expose }) { const props2 = __props; const { role, triggerRef: triggerRef2 } = inject(POPPER_INJECTION_KEY, void 0); useForwardRef(triggerRef2); const ariaControls = computed(() => { return ariaHaspopup.value ? props2.id : void 0; }); const ariaDescribedby = computed(() => { if (role && role.value === "tooltip") return props2.open && props2.id ? props2.id : void 0; }); const ariaHaspopup = computed(() => { if (role && role.value !== "tooltip") return role.value; }); const ariaExpanded = computed(() => { return ariaHaspopup.value ? `${props2.open}` : void 0; }); let virtualTriggerAriaStopWatch = void 0; const TRIGGER_ELE_EVENTS = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; onMounted(() => { watch(() => props2.virtualRef, (virtualEl) => { if (virtualEl) triggerRef2.value = unrefElement(virtualEl); }, { immediate: true }); watch(triggerRef2, (el, prevEl) => { virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch(); virtualTriggerAriaStopWatch = void 0; if (isElement(prevEl)) TRIGGER_ELE_EVENTS.forEach((eventName) => { const handler = props2[eventName]; if (handler) prevEl.removeEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName)); }); if (isElement(el)) { TRIGGER_ELE_EVENTS.forEach((eventName) => { const handler = props2[eventName]; if (handler) el.addEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName)); }); if (isFocusable(el)) virtualTriggerAriaStopWatch = watch([ ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded ], (watches) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((key, idx) => { isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]); }); }, { immediate: true }); } if (isElement(prevEl) && isFocusable(prevEl)) [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((key) => prevEl.removeAttribute(key)); }, { immediate: true }); }); onBeforeUnmount(() => { virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch(); virtualTriggerAriaStopWatch = void 0; if (triggerRef2.value && isElement(triggerRef2.value)) { const el = triggerRef2.value; TRIGGER_ELE_EVENTS.forEach((eventName) => { const handler = props2[eventName]; if (handler) el.removeEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName)); }); triggerRef2.value = void 0; } }); __expose({ triggerRef: triggerRef2 }); return (_ctx, _cache) => { return !__props.virtualTriggering ? (openBlock(), createBlock(unref(OnlyChild), mergeProps({ key: 0 }, _ctx.$attrs, { "aria-controls": ariaControls.value, "aria-describedby": ariaDescribedby.value, "aria-expanded": ariaExpanded.value, "aria-haspopup": ariaHaspopup.value }), { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup" ])) : createCommentVNode("v-if", true); }; } }); var trigger_default$1 = trigger_vue_vue_type_script_setup_true_lang_default$1; const popperArrowProps = buildProps({ arrowOffset: { type: Number, default: 5 } }); const POSITIONING_STRATEGIES = ["fixed", "absolute"]; const popperCoreConfigProps = buildProps({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: definePropType(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: true }, offset: { type: Number, default: 12 }, placement: { type: String, values: Ee, default: "bottom" }, popperOptions: { type: definePropType(Object), default: () => ({}) }, strategy: { type: String, values: POSITIONING_STRATEGIES, default: "absolute" } }); const popperContentProps = buildProps({ ...popperCoreConfigProps, ...popperArrowProps, id: String, style: { type: definePropType([ String, Array, Object ]) }, className: { type: definePropType([ String, Array, Object ]) }, effect: { type: definePropType(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: true }, pure: Boolean, focusOnShow: Boolean, trapping: Boolean, popperClass: { type: definePropType([ String, Array, Object ]) }, popperStyle: { type: definePropType([ String, Array, Object ]) }, referenceEl: { type: definePropType(Object) }, triggerTargetEl: { type: definePropType(Object) }, stopPopperMouseEvent: { type: Boolean, default: true }, virtualTriggering: Boolean, zIndex: Number, ...useAriaProps(["ariaLabel"]), loop: Boolean }); const popperContentEmits = { mouseenter: (evt) => evt instanceof MouseEvent, mouseleave: (evt) => evt instanceof MouseEvent, focus: () => true, blur: () => true, close: () => true }; const formMetaProps = buildProps({ size: { type: String, values: componentSizes }, disabled: Boolean }); const formProps = buildProps({ ...formMetaProps, model: Object, rules: { type: definePropType(Object) }, labelPosition: { type: String, values: [ "left", "right", "top" ], default: "right" }, requireAsteriskPosition: { type: String, values: ["left", "right"], default: "left" }, labelWidth: { type: [String, Number], default: "" }, labelSuffix: { type: String, default: "" }, inline: Boolean, inlineMessage: Boolean, statusIcon: Boolean, showMessage: { type: Boolean, default: true }, validateOnRuleChange: { type: Boolean, default: true }, hideRequiredAsterisk: Boolean, scrollToError: Boolean, scrollIntoViewOptions: { type: definePropType([Object, Boolean]), default: true } }); const formEmits = { validate: (prop, isValid, message2) => (isArray(prop) || isString(prop)) && isBoolean(isValid) && isString(message2) }; const formContextKey = Symbol("formContextKey"); const formItemContextKey = Symbol("formItemContextKey"); const useFormSize = (fallback, ignore = {}) => { const emptyRef = ref(void 0); const size = ignore.prop ? emptyRef : useProp("size"); const globalConfig2 = ignore.global ? emptyRef : useGlobalSize(); const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0); const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0); return computed(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig2.value || ""); }; const useFormDisabled = (fallback) => { const disabled = useProp("disabled"); const form = inject(formContextKey, void 0); return computed(() => { return disabled.value ?? unref(fallback) ?? (form == null ? void 0 : form.disabled) ?? false; }); }; const useFormItem = () => { return { form: inject(formContextKey, void 0), formItem: inject(formItemContextKey, void 0) }; }; const useFormItemInputId = (props2, { formItemContext, disableIdGeneration, disableIdManagement }) => { if (!disableIdGeneration) disableIdGeneration = ref(false); if (!disableIdManagement) disableIdManagement = ref(false); const instance = getCurrentInstance(); const inLabel = () => { let parent = instance == null ? void 0 : instance.parent; while (parent) { if (parent.type.name === "ElFormItem") return false; if (parent.type.name === "ElLabelWrap") return true; parent = parent.parent; } return false; }; const inputId = ref(); let idUnwatch = void 0; const isLabeledByFormItem = computed(() => { var _a; return !!(!(props2.label || props2.ariaLabel) && formItemContext && formItemContext.inputIds && ((_a = formItemContext.inputIds) == null ? void 0 : _a.length) <= 1); }); onMounted(() => { idUnwatch = watch([toRef(props2, "id"), disableIdGeneration], ([id, disableIdGeneration2]) => { const newId = id ?? (!disableIdGeneration2 ? useId().value : void 0); if (newId !== inputId.value) { if ((formItemContext == null ? void 0 : formItemContext.removeInputId) && !inLabel()) { inputId.value && formItemContext.removeInputId(inputId.value); if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) formItemContext.addInputId(newId); } inputId.value = newId; } }, { immediate: true }); }); onUnmounted(() => { idUnwatch && idUnwatch(); if (formItemContext == null ? void 0 : formItemContext.removeInputId) inputId.value && formItemContext.removeInputId(inputId.value); }); return { isLabeledByFormItem, inputId }; }; const formItemValidateStates = [ "", "error", "validating", "success" ]; const formItemProps = buildProps({ label: String, labelWidth: { type: [String, Number] }, labelPosition: { type: String, values: [ "left", "right", "top", "" ], default: "" }, prop: { type: definePropType([String, Array]) }, required: { type: Boolean, default: void 0 }, rules: { type: definePropType([Object, Array]) }, error: String, validateStatus: { type: String, values: formItemValidateStates }, for: String, inlineMessage: { type: Boolean, default: void 0 }, showMessage: { type: Boolean, default: true }, size: { type: String, values: componentSizes } }); const unique = (arr) => [...new Set(arr)]; const extractFirst = (arr) => { return isArray(arr) ? arr[0] : arr; }; const castArray = (arr) => { if (!arr && arr !== 0) return []; return isArray(arr) ? arr : [arr]; }; const SCOPE$7 = "ElForm"; function useFormLabelWidth() { const potentialLabelWidthArr = ref([]); const autoLabelWidth = computed(() => { if (!potentialLabelWidthArr.value.length) return "0"; const max2 = Math.max(...potentialLabelWidthArr.value); return max2 ? `${max2}px` : ""; }); function getLabelWidthIndex(width) { const index = potentialLabelWidthArr.value.indexOf(width); if (index === -1 && autoLabelWidth.value === "0") debugWarn(SCOPE$7, `unexpected width ${width}`); return index; } function registerLabelWidth(val, oldVal) { if (val && oldVal) { const index = getLabelWidthIndex(oldVal); potentialLabelWidthArr.value.splice(index, 1, val); } else if (val) potentialLabelWidthArr.value.push(val); } function deregisterLabelWidth(val) { const index = getLabelWidthIndex(val); if (index > -1) potentialLabelWidthArr.value.splice(index, 1); } return { autoLabelWidth, registerLabelWidth, deregisterLabelWidth }; } const filterFields = (fields, props2) => { const normalized = castArray$1(props2).map((prop) => isArray(prop) ? prop.join(".") : prop); return normalized.length > 0 ? fields.filter((field) => field.propString && normalized.includes(field.propString)) : fields; }; const COMPONENT_NAME$l = "ElForm"; var form_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$l, __name: "form", props: formProps, emits: formEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const formRef = ref(); const fields = reactive([]); const initialValues = /* @__PURE__ */ new Map(); const formSize = useFormSize(); const ns = useNamespace("form"); const formClasses = computed(() => { const { labelPosition, inline } = props2; return [ ns.b(), ns.m(formSize.value || "default"), { [ns.m(`label-${labelPosition}`)]: labelPosition, [ns.m("inline")]: inline } ]; }); const getField = (prop) => { return filterFields(fields, [prop])[0]; }; const addField = (field) => { if (!fields.includes(field)) fields.push(field); if (field.propString) if (initialValues.has(field.propString)) field.setInitialValue(initialValues.get(field.propString)); else initialValues.set(field.propString, cloneDeep(field.fieldValue)); }; const removeField = (field, oldPropString) => { if (oldPropString) { initialValues.delete(oldPropString); return; } const idx = fields.indexOf(field); if (idx > -1) { fields.splice(idx, 1); if (field.propString) initialValues.set(field.propString, cloneDeep(field.getInitialValue())); } }; const setInitialValues = (initModel) => { if (!props2.model) { debugWarn(COMPONENT_NAME$l, "model is required for setInitialValues to work."); return; } if (!initModel) { debugWarn(COMPONENT_NAME$l, "initModel is required for setInitialValues to work."); return; } for (const key of initialValues.keys()) initialValues.set(key, cloneDeep(getProp(initModel, key).value)); fields.forEach((field) => { if (field.prop) field.setInitialValue(getProp(initModel, field.prop).value); }); }; const resetFields = (properties = []) => { if (!props2.model) { debugWarn(COMPONENT_NAME$l, "model is required for resetFields to work."); return; } filterFields(fields, properties).forEach((field) => field.resetField()); const activePropStrings = new Set(fields.map((f) => f.propString).filter(Boolean)); const propsToCheck = properties.length > 0 ? castArray$1(properties).map((p) => isArray(p) ? p.join(".") : p) : [...initialValues.keys()]; for (const propString of propsToCheck) if (!activePropStrings.has(propString) && initialValues.has(propString)) getProp(props2.model, propString).value = cloneDeep(initialValues.get(propString)); }; const clearValidate = (props3 = []) => { filterFields(fields, props3).forEach((field) => field.clearValidate()); }; const isValidatable = computed(() => { const hasModel = !!props2.model; if (!hasModel) debugWarn(COMPONENT_NAME$l, "model is required for validate to work."); return hasModel; }); const obtainValidateFields = (props3) => { if (fields.length === 0) return []; const filteredFields = filterFields(fields, props3); if (!filteredFields.length) { debugWarn(COMPONENT_NAME$l, "please pass correct props!"); return []; } return filteredFields; }; const validate = async (callback) => validateField(void 0, callback); const doValidateField = async (props3 = []) => { if (!isValidatable.value) return false; const fields2 = obtainValidateFields(props3); if (fields2.length === 0) return true; let validationErrors = {}; for (const field of fields2) try { await field.validate(""); if (field.validateState === "error" && !field.error) field.resetField(); } catch (fields3) { validationErrors = { ...validationErrors, ...fields3 }; } if (Object.keys(validationErrors).length === 0) return true; return Promise.reject(validationErrors); }; const validateField = async (modelProps = [], callback) => { var _a; let result = false; const shouldThrow = !isFunction(callback); try { result = await doValidateField(modelProps); if (result === true) await (callback == null ? void 0 : callback(result)); return result; } catch (e) { if (e instanceof Error) throw e; const invalidFields = e; if (props2.scrollToError) { if (formRef.value) (_a = formRef.value.querySelector(`.${ns.b()}-item.is-error`)) == null ? void 0 : _a.scrollIntoView(props2.scrollIntoViewOptions); } !result && await (callback == null ? void 0 : callback(false, invalidFields)); return shouldThrow && Promise.reject(invalidFields); } }; const scrollToField = (prop) => { var _a; const field = getField(prop); if (field) (_a = field.$el) == null ? void 0 : _a.scrollIntoView(props2.scrollIntoViewOptions); }; watch(() => props2.rules, () => { if (props2.validateOnRuleChange) validate().catch((err) => debugWarn(err)); }, { deep: true, flush: "post" }); provide(formContextKey, reactive({ ...toRefs(props2), emit, resetFields, clearValidate, validateField, getField, addField, removeField, setInitialValues, ...useFormLabelWidth() })); __expose({ validate, validateField, resetFields, clearValidate, scrollToField, getField, fields, setInitialValues }); return (_ctx, _cache) => { return openBlock(), createElementBlock("form", { ref_key: "formRef", ref: formRef, class: normalizeClass(formClasses.value) }, [renderSlot(_ctx.$slots, "default")], 2); }; } }); var form_default = form_vue_vue_type_script_setup_true_lang_default; const COMPONENT_NAME$k = "ElLabelWrap"; var form_label_wrap_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$k, props: { isAutoWidth: Boolean, updateAll: Boolean }, setup(props2, { slots }) { const formContext = inject(formContextKey, void 0); const formItemContext = inject(formItemContextKey); if (!formItemContext) throwError(COMPONENT_NAME$k, "usage: "); const ns = useNamespace("form"); const el = ref(); const computedWidth = ref(0); const getLabelWidth = () => { var _a; if ((_a = el.value) == null ? void 0 : _a.firstElementChild) { const width = window.getComputedStyle(el.value.firstElementChild).width; return Math.ceil(Number.parseFloat(width)); } else return 0; }; const updateLabelWidth = (action = "update") => { nextTick(() => { if (slots.default && props2.isAutoWidth) { if (action === "update") computedWidth.value = getLabelWidth(); else if (action === "remove") formContext == null ? void 0 : formContext.deregisterLabelWidth(computedWidth.value); } }); }; const updateLabelWidthFn = () => updateLabelWidth("update"); onMounted(() => { updateLabelWidthFn(); }); onBeforeUnmount(() => { updateLabelWidth("remove"); }); onUpdated(() => updateLabelWidthFn()); watch(computedWidth, (val, oldVal) => { if (props2.updateAll) formContext == null ? void 0 : formContext.registerLabelWidth(val, oldVal); }); useResizeObserver(computed(() => { var _a; return ((_a = el.value) == null ? void 0 : _a.firstElementChild) ?? null; }), updateLabelWidthFn); return () => { var _a, _b; if (!slots) return null; const { isAutoWidth } = props2; if (isAutoWidth) { const autoLabelWidth = formContext == null ? void 0 : formContext.autoLabelWidth; const hasLabel = formItemContext == null ? void 0 : formItemContext.hasLabel; const style = {}; if (hasLabel && autoLabelWidth && autoLabelWidth !== "auto") { const marginWidth = Math.max(0, Number.parseInt(autoLabelWidth, 10) - computedWidth.value); const marginPosition = (formItemContext.labelPosition || formContext.labelPosition) === "left" ? "marginRight" : "marginLeft"; if (marginWidth) style[marginPosition] = `${marginWidth}px`; } return createVNode("div", { "ref": el, "class": [ns.be("item", "label-wrap")], "style": style }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]); } else return createVNode(Fragment, { "ref": el }, [(_b = slots.default) == null ? void 0 : _b.call(slots)]); }; } }); const _hoisted_1$1e = ["role", "aria-labelledby"]; var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElFormItem", __name: "form-item", props: formItemProps, setup(__props, { expose: __expose }) { const props2 = __props; const slots = useSlots(); const formContext = inject(formContextKey, void 0); const parentFormItemContext = inject(formItemContextKey, void 0); const _size = useFormSize(void 0, { formItem: false }); const ns = useNamespace("form-item"); const labelId = useId().value; const inputIds = ref([]); const validateState = ref(""); const validateStateDebounced = refDebounced(validateState, 100); const validateMessage = ref(""); const formItemRef = ref(); let initialValue = void 0; let isResettingField = false; const labelPosition = computed(() => props2.labelPosition || (formContext == null ? void 0 : formContext.labelPosition)); const labelStyle = computed(() => { if (labelPosition.value === "top") return {}; return { width: addUnit(props2.labelWidth ?? (formContext == null ? void 0 : formContext.labelWidth)) }; }); const contentStyle = computed(() => { if (labelPosition.value === "top" || (formContext == null ? void 0 : formContext.inline)) return {}; if (!props2.label && !props2.labelWidth && isNested) return {}; const labelWidth = addUnit(props2.labelWidth ?? (formContext == null ? void 0 : formContext.labelWidth)); if (!props2.label && !slots.label) return { marginLeft: labelWidth }; return {}; }); const formItemClasses = computed(() => [ ns.b(), ns.m(_size.value), ns.is("error", validateState.value === "error"), ns.is("validating", validateState.value === "validating"), ns.is("success", validateState.value === "success"), ns.is("required", isRequired.value || props2.required), ns.is("no-asterisk", formContext == null ? void 0 : formContext.hideRequiredAsterisk), (formContext == null ? void 0 : formContext.requireAsteriskPosition) === "right" ? "asterisk-right" : "asterisk-left", { [ns.m("feedback")]: formContext == null ? void 0 : formContext.statusIcon, [ns.m(`label-${labelPosition.value}`)]: labelPosition.value } ]); const _inlineMessage = computed(() => isBoolean(props2.inlineMessage) ? props2.inlineMessage : (formContext == null ? void 0 : formContext.inlineMessage) || false); const validateClasses = computed(() => [ns.e("error"), { [ns.em("error", "inline")]: _inlineMessage.value }]); const propString = computed(() => { if (!props2.prop) return ""; return isArray(props2.prop) ? props2.prop.join(".") : props2.prop; }); const hasLabel = computed(() => { return !!(props2.label || slots.label); }); const labelFor = computed(() => { return props2.for ?? (inputIds.value.length === 1 ? inputIds.value[0] : void 0); }); const isGroup = computed(() => { return !labelFor.value && hasLabel.value; }); const isNested = !!parentFormItemContext; const fieldValue = computed(() => { const model = formContext == null ? void 0 : formContext.model; if (!model || !props2.prop) return; return getProp(model, props2.prop).value; }); const normalizedRules = computed(() => { const { required } = props2; const rules = []; if (props2.rules) rules.push(...castArray$1(props2.rules)); const formRules = formContext == null ? void 0 : formContext.rules; if (formRules && props2.prop) { const _rules = getProp(formRules, props2.prop).value; if (_rules) rules.push(...castArray$1(_rules)); } if (required !== void 0) { const requiredRules = rules.map((rule, i) => [rule, i]).filter(([rule]) => "required" in rule); if (requiredRules.length > 0) for (const [rule, i] of requiredRules) { if (rule.required === required) continue; rules[i] = { ...rule, required }; } else rules.push({ required }); } return rules; }); const validateEnabled = computed(() => normalizedRules.value.length > 0); const getFilteredRule = (trigger) => { return normalizedRules.value.filter((rule) => { if (!rule.trigger || !trigger) return true; if (isArray(rule.trigger)) return rule.trigger.includes(trigger); else return rule.trigger === trigger; }).map(({ trigger: trigger2, ...rule }) => rule); }; const isRequired = computed(() => normalizedRules.value.some((rule) => rule.required)); const shouldShowError = computed(() => validateStateDebounced.value === "error" && props2.showMessage && ((formContext == null ? void 0 : formContext.showMessage) ?? true)); const currentLabel = computed(() => `${props2.label || ""}${(formContext == null ? void 0 : formContext.labelSuffix) || ""}`); const setValidationState = (state) => { validateState.value = state; }; const onValidationFailed = (error) => { var _a; const { errors, fields } = error; if (!errors || !fields) console.error(error); setValidationState("error"); validateMessage.value = errors ? ((_a = errors == null ? void 0 : errors[0]) == null ? void 0 : _a.message) ?? `${props2.prop} is required` : ""; formContext == null ? void 0 : formContext.emit("validate", props2.prop, false, validateMessage.value); }; const onValidationSucceeded = () => { setValidationState("success"); formContext == null ? void 0 : formContext.emit("validate", props2.prop, true, ""); }; const doValidate = async (rules) => { const modelName = propString.value; return new Schema({ [modelName]: rules }).validate({ [modelName]: fieldValue.value }, { firstFields: true }).then(() => { onValidationSucceeded(); return true; }).catch((err) => { onValidationFailed(err); return Promise.reject(err); }); }; const validate = async (trigger, callback) => { if (isResettingField || !props2.prop) return false; const hasCallback = isFunction(callback); if (!validateEnabled.value) { callback == null ? void 0 : callback(false); return false; } const rules = getFilteredRule(trigger); if (rules.length === 0) { callback == null ? void 0 : callback(true); return true; } setValidationState("validating"); return doValidate(rules).then(() => { callback == null ? void 0 : callback(true); return true; }).catch((err) => { const { fields } = err; callback == null ? void 0 : callback(false, fields); return hasCallback ? false : Promise.reject(fields); }); }; const clearValidate = () => { setValidationState(""); validateMessage.value = ""; isResettingField = false; }; const resetField = async () => { const model = formContext == null ? void 0 : formContext.model; if (!model || !props2.prop) return; const computedValue = getProp(model, props2.prop); isResettingField = true; computedValue.value = cloneDeep(initialValue); await nextTick(); clearValidate(); isResettingField = false; }; const addInputId = (id) => { if (!inputIds.value.includes(id)) inputIds.value.push(id); }; const removeInputId = (id) => { inputIds.value = inputIds.value.filter((listId) => listId !== id); }; const setInitialValue = (value) => { initialValue = cloneDeep(value); }; const getInitialValue = () => initialValue; watch(() => props2.error, (val) => { validateMessage.value = val || ""; setValidationState(val ? "error" : ""); }, { immediate: true }); watch(() => props2.validateStatus, (val) => setValidationState(val || "")); const context = reactive({ ...toRefs(props2), $el: formItemRef, size: _size, validateMessage, validateState, labelId, inputIds, isGroup, hasLabel, fieldValue, addInputId, removeInputId, resetField, clearValidate, validate, propString, setInitialValue, getInitialValue }); provide(formItemContextKey, context); watch(propString, (newPropString, oldPropString) => { if (!formContext || !oldPropString) return; formContext.removeField(context, oldPropString); if (newPropString) { setInitialValue(fieldValue.value); formContext.addField(context); } }); onMounted(() => { if (props2.prop) { setInitialValue(fieldValue.value); formContext == null ? void 0 : formContext.addField(context); } }); onBeforeUnmount(() => { formContext == null ? void 0 : formContext.removeField(context); }); __expose({ size: _size, validateMessage, validateState, validate, clearValidate, resetField, setInitialValue }); return (_ctx, _cache) => { var _a; return openBlock(), createElementBlock("div", { ref_key: "formItemRef", ref: formItemRef, class: normalizeClass(formItemClasses.value), role: isGroup.value ? "group" : void 0, "aria-labelledby": isGroup.value ? unref(labelId) : void 0 }, [createVNode(unref(form_label_wrap_default), { "is-auto-width": labelStyle.value.width === "auto", "update-all": ((_a = unref(formContext)) == null ? void 0 : _a.labelWidth) === "auto" }, { default: withCtx(() => [!!(__props.label || _ctx.$slots.label) ? (openBlock(), createBlock(resolveDynamicComponent(labelFor.value ? "label" : "div"), { key: 0, id: unref(labelId), for: labelFor.value, class: normalizeClass(unref(ns).e("label")), style: normalizeStyle(labelStyle.value) }, { default: withCtx(() => [renderSlot(_ctx.$slots, "label", { label: currentLabel.value }, () => [createTextVNode(toDisplayString(currentLabel.value), 1)])]), _: 3 }, 8, [ "id", "for", "class", "style" ])) : createCommentVNode("v-if", true)]), _: 3 }, 8, ["is-auto-width", "update-all"]), createBaseVNode("div", { class: normalizeClass(unref(ns).e("content")), style: normalizeStyle(contentStyle.value) }, [renderSlot(_ctx.$slots, "default"), createVNode(TransitionGroup, { name: `${unref(ns).namespace.value}-zoom-in-top` }, { default: withCtx(() => [shouldShowError.value ? renderSlot(_ctx.$slots, "error", { key: 0, error: validateMessage.value }, () => [createBaseVNode("div", { class: normalizeClass(validateClasses.value) }, toDisplayString(validateMessage.value), 3)]) : createCommentVNode("v-if", true)]), _: 3 }, 8, ["name"])], 6)], 10, _hoisted_1$1e); }; } }); var form_item_default = form_item_vue_vue_type_script_setup_true_lang_default; const ElForm = withInstall(form_default, { FormItem: form_item_default }); const ElFormItem = withNoopInstall(form_item_default); const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped"; const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released"; const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented"; const FOCUS_AFTER_TRAPPED_OPTS = { cancelable: true, bubbles: false }; const FOCUSOUT_PREVENTED_OPTS = { cancelable: true, bubbles: false }; const ON_TRAP_FOCUS_EVT = "focusAfterTrapped"; const ON_RELEASE_FOCUS_EVT = "focusAfterReleased"; const FOCUS_TRAP_INJECTION_KEY = Symbol("elFocusTrap"); const focusReason = ref(); const lastUserFocusTimestamp = ref(0); const lastAutomatedFocusTimestamp = ref(0); let focusReasonUserCount = 0; const obtainAllFocusableElements = (element) => { const nodes = []; const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => { const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden"; if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; return node.tabIndex >= 0 || node === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); while (walker.nextNode()) nodes.push(walker.currentNode); return nodes; }; const getVisibleElement = (elements, container) => { for (const element of elements) if (!isHidden(element, container)) return element; }; const isHidden = (element, container) => { if (getComputedStyle(element).visibility === "hidden") return true; while (element) { if (container && element === container) return false; if (getComputedStyle(element).display === "none") return true; element = element.parentElement; } return false; }; const getEdges = (container) => { const focusable = obtainAllFocusableElements(container); return [getVisibleElement(focusable, container), getVisibleElement(focusable.reverse(), container)]; }; const isSelectable = (element) => { return element instanceof HTMLInputElement && "select" in element; }; const tryFocus = (element, shouldSelect) => { if (element) { const prevFocusedElement = document.activeElement; focusElement(element, { preventScroll: true }); lastAutomatedFocusTimestamp.value = window.performance.now(); if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) element.select(); } }; function removeFromStack(list, item) { const copy = [...list]; const idx = list.indexOf(item); if (idx !== -1) copy.splice(idx, 1); return copy; } const createFocusableStack = () => { let stack = []; const push = (layer) => { const currentLayer = stack[0]; if (currentLayer && layer !== currentLayer) currentLayer.pause(); stack = removeFromStack(stack, layer); stack.unshift(layer); }; const remove = (layer) => { var _a, _b; stack = removeFromStack(stack, layer); (_b = (_a = stack[0]) == null ? void 0 : _a.resume) == null ? void 0 : _b.call(_a); }; return { push, remove }; }; const focusFirstDescendant = (elements, shouldSelect = false) => { const prevFocusedElement = document.activeElement; for (const element of elements) { tryFocus(element, shouldSelect); if (document.activeElement !== prevFocusedElement) return; } }; const focusableStack = createFocusableStack(); const isFocusCausedByUserEvent = () => { return lastUserFocusTimestamp.value > lastAutomatedFocusTimestamp.value; }; const notifyFocusReasonPointer = () => { focusReason.value = "pointer"; lastUserFocusTimestamp.value = window.performance.now(); }; const notifyFocusReasonKeydown = () => { focusReason.value = "keyboard"; lastUserFocusTimestamp.value = window.performance.now(); }; const useFocusReason = () => { onMounted(() => { if (focusReasonUserCount === 0) { document.addEventListener("mousedown", notifyFocusReasonPointer); document.addEventListener("touchstart", notifyFocusReasonPointer); document.addEventListener("keydown", notifyFocusReasonKeydown); } focusReasonUserCount++; }); onBeforeUnmount(() => { focusReasonUserCount--; if (focusReasonUserCount <= 0) { document.removeEventListener("mousedown", notifyFocusReasonPointer); document.removeEventListener("touchstart", notifyFocusReasonPointer); document.removeEventListener("keydown", notifyFocusReasonKeydown); } }); return { focusReason, lastUserFocusTimestamp, lastAutomatedFocusTimestamp }; }; const createFocusOutPreventedEvent = (detail) => { return new CustomEvent(FOCUSOUT_PREVENTED, { ...FOCUSOUT_PREVENTED_OPTS, detail }); }; var focus_trap_vue_vue_type_script_lang_default = defineComponent({ name: "ElFocusTrap", inheritAttrs: false, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ ON_TRAP_FOCUS_EVT, ON_RELEASE_FOCUS_EVT, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(props2, { emit }) { const forwardRef = ref(); let lastFocusBeforeTrapped; let lastFocusAfterTrapped; const { focusReason: focusReason2 } = useFocusReason(); useEscapeKeydown((event) => { if (props2.trapped && !focusLayer.paused) emit("release-requested", event); }); const focusLayer = { paused: false, pause() { this.paused = true; }, resume() { this.paused = false; } }; const onKeydown = (e) => { if (!props2.loop && !props2.trapped) return; if (focusLayer.paused) return; const { altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e; const { loop } = props2; const isTabbing = getEventCode(e) === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey; const currentFocusingEl = document.activeElement; if (isTabbing && currentFocusingEl) { const container = currentTarget; const [first, last] = getEdges(container); if (!(first && last)) { if (currentFocusingEl === container) { const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason2.value }); emit("focusout-prevented", focusoutPreventedEvent); if (!focusoutPreventedEvent.defaultPrevented) e.preventDefault(); } } else if (!shiftKey && currentFocusingEl === last) { const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason2.value }); emit("focusout-prevented", focusoutPreventedEvent); if (!focusoutPreventedEvent.defaultPrevented) { e.preventDefault(); if (loop) tryFocus(first, true); } } else if (shiftKey && [first, container].includes(currentFocusingEl)) { const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason2.value }); emit("focusout-prevented", focusoutPreventedEvent); if (!focusoutPreventedEvent.defaultPrevented) { e.preventDefault(); if (loop) tryFocus(last, true); } } } }; provide(FOCUS_TRAP_INJECTION_KEY, { focusTrapRef: forwardRef, onKeydown }); watch(() => props2.focusTrapEl, (focusTrapEl) => { if (focusTrapEl) forwardRef.value = focusTrapEl; }, { immediate: true }); watch([forwardRef], ([forwardRef2], [oldForwardRef]) => { if (forwardRef2) { forwardRef2.addEventListener("keydown", onKeydown); forwardRef2.addEventListener("focusin", onFocusIn); forwardRef2.addEventListener("focusout", onFocusOut); } if (oldForwardRef) { oldForwardRef.removeEventListener("keydown", onKeydown); oldForwardRef.removeEventListener("focusin", onFocusIn); oldForwardRef.removeEventListener("focusout", onFocusOut); } }); const trapOnFocus = (e) => { emit(ON_TRAP_FOCUS_EVT, e); }; const releaseOnFocus = (e) => emit(ON_RELEASE_FOCUS_EVT, e); const onFocusIn = (e) => { const trapContainer = unref(forwardRef); if (!trapContainer) return; const target = e.target; const relatedTarget = e.relatedTarget; const isFocusedInTrap = target && trapContainer.contains(target); if (!props2.trapped) { if (!(relatedTarget && trapContainer.contains(relatedTarget))) lastFocusBeforeTrapped = relatedTarget; } if (isFocusedInTrap) emit("focusin", e); if (focusLayer.paused) return; if (props2.trapped) if (isFocusedInTrap) lastFocusAfterTrapped = target; else tryFocus(lastFocusAfterTrapped, true); }; const onFocusOut = (e) => { const trapContainer = unref(forwardRef); if (focusLayer.paused || !trapContainer) return; if (props2.trapped) { const relatedTarget = e.relatedTarget; if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) setTimeout(() => { if (!focusLayer.paused && props2.trapped) { const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason2.value }); emit("focusout-prevented", focusoutPreventedEvent); if (!focusoutPreventedEvent.defaultPrevented) tryFocus(lastFocusAfterTrapped, true); } }, 0); } else { const target = e.target; if (!(target && trapContainer.contains(target))) emit("focusout", e); } }; async function startTrap() { await nextTick(); const trapContainer = unref(forwardRef); if (trapContainer) { focusableStack.push(focusLayer); const prevFocusedElement = trapContainer.contains(document.activeElement) ? lastFocusBeforeTrapped : document.activeElement; lastFocusBeforeTrapped = prevFocusedElement; if (!trapContainer.contains(prevFocusedElement)) { const focusEvent = new Event(FOCUS_AFTER_TRAPPED, FOCUS_AFTER_TRAPPED_OPTS); trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus); trapContainer.dispatchEvent(focusEvent); if (!focusEvent.defaultPrevented) nextTick(() => { let focusStartEl = props2.focusStartEl; if (!isString(focusStartEl)) { tryFocus(focusStartEl); if (document.activeElement !== focusStartEl) focusStartEl = "first"; } if (focusStartEl === "first") focusFirstDescendant(obtainAllFocusableElements(trapContainer), true); if (document.activeElement === prevFocusedElement || focusStartEl === "container") tryFocus(trapContainer); }); } } } function stopTrap() { const trapContainer = unref(forwardRef); if (trapContainer) { trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus); const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, { ...FOCUS_AFTER_TRAPPED_OPTS, detail: { focusReason: focusReason2.value } }); trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus); trapContainer.dispatchEvent(releasedEvent); if (!releasedEvent.defaultPrevented && (focusReason2.value == "keyboard" || !isFocusCausedByUserEvent() || trapContainer.contains(document.activeElement))) tryFocus(lastFocusBeforeTrapped ?? document.body); trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus); focusableStack.remove(focusLayer); lastFocusBeforeTrapped = null; lastFocusAfterTrapped = null; } } onMounted(() => { if (props2.trapped) startTrap(); watch(() => props2.trapped, (trapped) => { if (trapped) startTrap(); else stopTrap(); }); }); onBeforeUnmount(() => { if (props2.trapped) stopTrap(); if (forwardRef.value) { forwardRef.value.removeEventListener("keydown", onKeydown); forwardRef.value.removeEventListener("focusin", onFocusIn); forwardRef.value.removeEventListener("focusout", onFocusOut); forwardRef.value = void 0; } lastFocusBeforeTrapped = null; lastFocusAfterTrapped = null; }); return { onKeydown }; } }); var _plugin_vue_export_helper_default = (sfc, props2) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props2) target[key] = val; return target; }; function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) { return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown }); } var focus_trap_default = /* @__PURE__ */ _plugin_vue_export_helper_default(focus_trap_vue_vue_type_script_lang_default, [["render", _sfc_render$l]]); var focus_trap_default$1 = focus_trap_default; const buildPopperOptions = (props2, modifiers = []) => { const { placement, strategy, popperOptions } = props2; const options = { placement, strategy, ...popperOptions, modifiers: [...genModifiers(props2), ...modifiers] }; deriveExtraModifiers(options, popperOptions == null ? void 0 : popperOptions.modifiers); return options; }; const unwrapMeasurableEl = ($el) => { if (!isClient) return; return unrefElement($el); }; function genModifiers(options) { const { offset: offset2, gpuAcceleration, fallbackPlacements } = options; return [ { name: "offset", options: { offset: [0, offset2 ?? 12] } }, { name: "preventOverflow", options: { padding: { top: 0, bottom: 0, left: 0, right: 0 } } }, { name: "flip", options: { padding: 5, fallbackPlacements } }, { name: "computeStyles", options: { gpuAcceleration } } ]; } function deriveExtraModifiers(options, modifiers) { if (modifiers) options.modifiers = [...options.modifiers, ...modifiers ?? []]; } const DEFAULT_ARROW_OFFSET = 0; const usePopperContent = (props2) => { const { popperInstanceRef, contentRef, triggerRef: triggerRef2, role } = inject(POPPER_INJECTION_KEY, void 0); const arrowRef = ref(); const arrowOffset = computed(() => props2.arrowOffset); const eventListenerModifier = computed(() => { return { name: "eventListeners", enabled: !!props2.visible }; }); const arrowModifier = computed(() => { const arrowEl = unref(arrowRef); const offset2 = unref(arrowOffset) ?? DEFAULT_ARROW_OFFSET; return { name: "arrow", enabled: !isUndefined$1(arrowEl), options: { element: arrowEl, padding: offset2 } }; }); const options = computed(() => { return { onFirstUpdate: () => { update(); }, ...buildPopperOptions(props2, [unref(arrowModifier), unref(eventListenerModifier)]) }; }); const computedReference = computed(() => unwrapMeasurableEl(props2.referenceEl) || unref(triggerRef2)); const { attributes: attributes2, state, styles, update, forceUpdate, instanceRef } = usePopper(computedReference, contentRef, options); watch(instanceRef, (instance) => popperInstanceRef.value = instance, { flush: "sync" }); onMounted(() => { watch(() => { var _a, _b; return (_b = (_a = unref(computedReference)) == null ? void 0 : _a.getBoundingClientRect) == null ? void 0 : _b.call(_a); }, () => { update(); }); }); let stopResizeObserver; watch(() => props2.visible, (visible) => { stopResizeObserver == null ? void 0 : stopResizeObserver(); stopResizeObserver = void 0; if (visible) stopResizeObserver = useResizeObserver(contentRef, update).stop; }); onBeforeUnmount(() => { popperInstanceRef.value = void 0; stopResizeObserver == null ? void 0 : stopResizeObserver(); stopResizeObserver = void 0; }); return { attributes: attributes2, arrowRef, contentRef, instanceRef, state, styles, role, forceUpdate, update }; }; const usePopperContentDOM = (props2, { attributes: attributes2, styles, role }) => { const { nextZIndex } = useZIndex(); const ns = useNamespace("popper"); const contentAttrs = computed(() => unref(attributes2).popper); const contentZIndex = ref(isNumber(props2.zIndex) ? props2.zIndex : nextZIndex()); const contentClass = computed(() => [ ns.b(), ns.is("pure", props2.pure), ns.is(props2.effect), props2.popperClass ]); const contentStyle = computed(() => { return [ { zIndex: unref(contentZIndex) }, unref(styles).popper, props2.popperStyle || {} ]; }); const ariaModal = computed(() => role.value === "dialog" ? "false" : void 0); const arrowStyle = computed(() => unref(styles).arrow || {}); const updateZIndex = () => { contentZIndex.value = isNumber(props2.zIndex) ? props2.zIndex : nextZIndex(); }; return { ariaModal, arrowStyle, contentAttrs, contentClass, contentStyle, contentZIndex, updateZIndex }; }; const usePopperContentFocusTrap = (props2, emit) => { const trapped = ref(false); const focusStartRef = ref(); const onFocusAfterTrapped = () => { emit("focus"); }; const onFocusAfterReleased = (event) => { var _a; if (((_a = event.detail) == null ? void 0 : _a.focusReason) !== "pointer") { focusStartRef.value = "first"; emit("blur"); } }; const onFocusInTrap = (event) => { if (props2.visible && !trapped.value) { if (event.target) focusStartRef.value = event.target; trapped.value = true; } }; const onFocusoutPrevented = (event) => { if (!props2.trapping) { if (event.detail.focusReason === "pointer") event.preventDefault(); trapped.value = false; } }; const onReleaseRequested = () => { trapped.value = false; emit("close"); }; onBeforeUnmount(() => { focusStartRef.value = void 0; }); return { focusStartRef, trapped, onFocusAfterReleased, onFocusAfterTrapped, onFocusInTrap, onFocusoutPrevented, onReleaseRequested }; }; var content_vue_vue_type_script_setup_true_lang_default$2 = /* @__PURE__ */ defineComponent({ name: "ElPopperContent", __name: "content", props: popperContentProps, emits: popperContentEmits, setup(__props, { expose: __expose, emit: __emit }) { const emit = __emit; const props2 = __props; const { focusStartRef, trapped, onFocusAfterReleased, onFocusAfterTrapped, onFocusInTrap, onFocusoutPrevented, onReleaseRequested } = usePopperContentFocusTrap(props2, emit); const { attributes: attributes2, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props2); const { ariaModal, arrowStyle, contentAttrs, contentClass, contentStyle, updateZIndex } = usePopperContentDOM(props2, { styles, attributes: attributes2, role }); const formItemContext = inject(formItemContextKey, void 0); provide(POPPER_CONTENT_INJECTION_KEY, { arrowStyle, arrowRef }); if (formItemContext) provide(formItemContextKey, { ...formItemContext, addInputId: NOOP, removeInputId: NOOP }); let triggerTargetAriaStopWatch = void 0; const updatePopper = (shouldUpdateZIndex = true) => { update(); shouldUpdateZIndex && updateZIndex(); }; const togglePopperAlive = () => { updatePopper(false); if (props2.visible && props2.focusOnShow) trapped.value = true; else if (props2.visible === false) trapped.value = false; }; onMounted(() => { watch(() => props2.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => { triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch(); triggerTargetAriaStopWatch = void 0; const el = unref(triggerTargetEl || contentRef.value); const prevEl = unref(prevTriggerTargetEl || contentRef.value); if (isElement(el)) triggerTargetAriaStopWatch = watch([ role, () => props2.ariaLabel, ariaModal, () => props2.id ], (watches) => { [ "role", "aria-label", "aria-modal", "id" ].forEach((key, idx) => { isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]); }); }, { immediate: true }); if (prevEl !== el && isElement(prevEl)) [ "role", "aria-label", "aria-modal", "id" ].forEach((key) => { prevEl.removeAttribute(key); }); }, { immediate: true }); watch(() => props2.visible, togglePopperAlive, { immediate: true }); }); onBeforeUnmount(() => { triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch(); triggerTargetAriaStopWatch = void 0; contentRef.value = void 0; }); __expose({ popperContentRef: contentRef, popperInstanceRef: instanceRef, updatePopper, contentStyle }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", mergeProps({ ref_key: "contentRef", ref: contentRef }, unref(contentAttrs), { style: unref(contentStyle), class: unref(contentClass), tabindex: "-1", onMouseenter: _cache[0] || (_cache[0] = (e) => _ctx.$emit("mouseenter", e)), onMouseleave: _cache[1] || (_cache[1] = (e) => _ctx.$emit("mouseleave", e)) }), [createVNode(unref(focus_trap_default$1), { loop: __props.loop, trapped: unref(trapped), "trap-on-focus-in": true, "focus-trap-el": unref(contentRef), "focus-start-el": unref(focusStartRef), onFocusAfterTrapped: unref(onFocusAfterTrapped), onFocusAfterReleased: unref(onFocusAfterReleased), onFocusin: unref(onFocusInTrap), onFocusoutPrevented: unref(onFocusoutPrevented), onReleaseRequested: unref(onReleaseRequested) }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "loop", "trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested" ])], 16); }; } }); var content_default$2 = content_vue_vue_type_script_setup_true_lang_default$2; var popper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPopper", inheritAttrs: false, __name: "popper", props: popperProps, setup(__props, { expose: __expose }) { const props2 = __props; const popperProvides = { triggerRef: ref(), popperInstanceRef: ref(), contentRef: ref(), referenceRef: ref(), role: computed(() => props2.role) }; __expose(popperProvides); provide(POPPER_INJECTION_KEY, popperProvides); return (_ctx, _cache) => { return renderSlot(_ctx.$slots, "default"); }; } }); var popper_default = popper_vue_vue_type_script_setup_true_lang_default; const ElPopper = withInstall(popper_default); const useTooltipContentProps = buildProps({ ...useDelayedToggleProps, ...popperContentProps, appendTo: { type: teleportProps.to.type }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: definePropType(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: true }, disabled: Boolean, ...useAriaProps(["ariaLabel"]) }); const useTooltipTriggerProps = buildProps({ ...popperTriggerProps, disabled: Boolean, trigger: { type: definePropType([String, Array]), default: "hover" }, triggerKeys: { type: definePropType(Array), default: () => [ EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space ] }, focusOnTarget: Boolean }); const { useModelToggleProps: useTooltipModelToggleProps, useModelToggleEmits: useTooltipModelToggleEmits, useModelToggle: useTooltipModelToggle } = createModelToggleComposable("visible"); const useTooltipProps = buildProps({ ...popperProps, ...useTooltipModelToggleProps, ...useTooltipContentProps, ...useTooltipTriggerProps, ...popperArrowProps, showArrow: { type: Boolean, default: true } }); const tooltipEmits = [ ...useTooltipModelToggleEmits, "before-show", "before-hide", "show", "hide", "open", "close" ]; const TOOLTIP_INJECTION_KEY = Symbol("elTooltip"); const isTriggerType = (trigger, type) => { if (isArray(trigger)) return trigger.includes(type); return trigger === type; }; const whenTrigger = (trigger, type, handler) => { return (e) => { isTriggerType(unref(trigger), type) && handler(e); }; }; var trigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTooltipTrigger", __name: "trigger", props: useTooltipTriggerProps, setup(__props, { expose: __expose }) { const props2 = __props; const ns = useNamespace("tooltip"); const { controlled, id, open, onOpen, onClose, onToggle } = inject(TOOLTIP_INJECTION_KEY, void 0); const triggerRef2 = ref(null); const stopWhenControlledOrDisabled = () => { if (unref(controlled) || props2.disabled) return true; }; const trigger = toRef(props2, "trigger"); const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", (e) => { onOpen(e); if (props2.focusOnTarget && e.target) nextTick(() => { focusElement(e.target, { preventScroll: true }); }); })); const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", onClose)); const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "click", (e) => { if (e.button === 0) onToggle(e); })); const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onOpen)); const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onClose)); const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "contextmenu", (e) => { e.preventDefault(); onToggle(e); })); const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => { const code = getEventCode(e); if (props2.triggerKeys.includes(code)) { e.preventDefault(); onToggle(e); } }); __expose({ triggerRef: triggerRef2 }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(trigger_default$1), { id: unref(id), "virtual-ref": __props.virtualRef, open: unref(open), "virtual-triggering": __props.virtualTriggering, class: normalizeClass(unref(ns).e("trigger")), onBlur: unref(onBlur), onClick: unref(onClick), onContextmenu: unref(onContextMenu), onFocus: unref(onFocus), onMouseenter: unref(onMouseenter), onMouseleave: unref(onMouseleave), onKeydown: unref(onKeydown) }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown" ]); }; } }); var trigger_default = trigger_vue_vue_type_script_setup_true_lang_default; var content_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ defineComponent({ name: "ElTooltipContent", inheritAttrs: false, __name: "content", props: useTooltipContentProps, setup(__props, { expose: __expose }) { const props2 = __props; const { selector } = usePopperContainerId(); const ns = useNamespace("tooltip"); const contentRef = ref(); const popperContentRef = computedEager(() => { var _a; return (_a = contentRef.value) == null ? void 0 : _a.popperContentRef; }); let stopHandle; const { controlled, id, open, trigger, onClose, onOpen, onShow, onHide, onBeforeShow, onBeforeHide } = inject(TOOLTIP_INJECTION_KEY, void 0); const transitionClass = computed(() => { return props2.transition || `${ns.namespace.value}-fade-in-linear`; }); const persistentRef = computed(() => { return props2.persistent; }); onBeforeUnmount(() => { stopHandle == null ? void 0 : stopHandle(); }); const shouldRender = computed(() => { return unref(persistentRef) ? true : unref(open); }); const shouldShow = computed(() => { return props2.disabled ? false : unref(open); }); const appendTo = computed(() => { return props2.appendTo || selector.value; }); const contentStyle = computed(() => props2.style ?? {}); const ariaHidden = ref(true); const onTransitionLeave = () => { onHide(); isFocusInsideContent() && focusElement(document.body, { preventScroll: true }); ariaHidden.value = true; }; const stopWhenControlled = () => { if (unref(controlled)) return true; }; const onContentEnter = composeEventHandlers(stopWhenControlled, () => { if (props2.enterable && isTriggerType(unref(trigger), "hover")) onOpen(); }); const onContentLeave = composeEventHandlers(stopWhenControlled, () => { if (isTriggerType(unref(trigger), "hover")) onClose(); }); const onBeforeEnter = () => { var _a, _b; (_b = (_a = contentRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a); onBeforeShow == null ? void 0 : onBeforeShow(); }; const onBeforeLeave = () => { onBeforeHide == null ? void 0 : onBeforeHide(); }; const onAfterShow = () => { onShow(); }; const onBlur = () => { if (!props2.virtualTriggering) onClose(); }; const isFocusInsideContent = (event) => { var _a; const popperContent = (_a = contentRef.value) == null ? void 0 : _a.popperContentRef; const activeElement = (event == null ? void 0 : event.relatedTarget) || document.activeElement; return popperContent == null ? void 0 : popperContent.contains(activeElement); }; watch(() => unref(open), (val) => { if (!val) stopHandle == null ? void 0 : stopHandle(); else { ariaHidden.value = false; stopHandle = onClickOutside(popperContentRef, () => { if (unref(controlled)) return; if (castArray(unref(trigger)).every((item) => { return item !== "hover" && item !== "focus"; })) onClose(); }, { detectIframe: true }); } }, { flush: "post" }); __expose({ contentRef, isFocusInsideContent }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTeleport), { disabled: !__props.teleported, to: appendTo.value }, { default: withCtx(() => [shouldRender.value || !ariaHidden.value ? (openBlock(), createBlock(Transition, { key: 0, name: transitionClass.value, appear: !persistentRef.value, onAfterLeave: onTransitionLeave, onBeforeEnter, onAfterEnter: onAfterShow, onBeforeLeave, persisted: "" }, { default: withCtx(() => [withDirectives(createVNode(unref(content_default$2), mergeProps({ id: unref(id), ref_key: "contentRef", ref: contentRef }, _ctx.$attrs, { "aria-label": __props.ariaLabel, "aria-hidden": ariaHidden.value, "boundaries-padding": __props.boundariesPadding, "fallback-placements": __props.fallbackPlacements, "gpu-acceleration": __props.gpuAcceleration, offset: __props.offset, placement: __props.placement, "popper-options": __props.popperOptions, "arrow-offset": __props.arrowOffset, strategy: __props.strategy, effect: __props.effect, enterable: __props.enterable, pure: __props.pure, "popper-class": __props.popperClass, "popper-style": [__props.popperStyle, contentStyle.value], "reference-el": __props.referenceEl, "trigger-target-el": __props.triggerTargetEl, visible: shouldShow.value, "z-index": __props.zIndex, loop: __props.loop, onMouseenter: unref(onContentEnter), onMouseleave: unref(onContentLeave), onBlur, onClose: unref(onClose) }), { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "arrow-offset", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "loop", "onMouseenter", "onMouseleave", "onClose" ]), [[vShow, shouldShow.value]])]), _: 3 }, 8, ["name", "appear"])) : createCommentVNode("v-if", true)]), _: 3 }, 8, ["disabled", "to"]); }; } }); var content_default$1 = content_vue_vue_type_script_setup_true_lang_default$1; const _hoisted_1$1d = ["innerHTML"]; const _hoisted_2$H = { key: 1 }; var tooltip_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTooltip", __name: "tooltip", props: useTooltipProps, emits: tooltipEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; usePopperContainer(); const ns = useNamespace("tooltip"); const id = useId(); const popperRef = ref(); const contentRef = ref(); const updatePopper = () => { var _a; const popperComponent = unref(popperRef); if (popperComponent) (_a = popperComponent.popperInstanceRef) == null ? void 0 : _a.update(); }; const open = ref(false); const toggleReason = ref(); const { show, hide, hasUpdateHandler } = useTooltipModelToggle({ indicator: open, toggleReason }); const { onOpen, onClose } = useDelayedToggle({ showAfter: toRef(props2, "showAfter"), hideAfter: toRef(props2, "hideAfter"), autoClose: toRef(props2, "autoClose"), open: show, close: hide }); const controlled = computed(() => isBoolean(props2.visible) && !hasUpdateHandler.value); const kls = computed(() => { return [ns.b(), props2.popperClass]; }); provide(TOOLTIP_INJECTION_KEY, { controlled, id, open: readonly(open), trigger: toRef(props2, "trigger"), onOpen, onClose, onToggle: (event) => { if (unref(open)) onClose(event); else onOpen(event); }, onShow: () => { emit("show", toggleReason.value); }, onHide: () => { emit("hide", toggleReason.value); }, onBeforeShow: () => { emit("before-show", toggleReason.value); }, onBeforeHide: () => { emit("before-hide", toggleReason.value); }, updatePopper }); watch(() => props2.disabled, (disabled) => { if (disabled && open.value) open.value = false; if (!disabled && isBoolean(props2.visible)) open.value = props2.visible; }); const isFocusInsideContent = (event) => { var _a; return (_a = contentRef.value) == null ? void 0 : _a.isFocusInsideContent(event); }; onDeactivated(() => open.value && hide()); onBeforeUnmount(() => { toggleReason.value = void 0; }); __expose({ popperRef, contentRef, isFocusInsideContent, updatePopper, onOpen, onClose, hide }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElPopper), { ref_key: "popperRef", ref: popperRef, role: __props.role }, { default: withCtx(() => [createVNode(trigger_default, { disabled: __props.disabled, trigger: __props.trigger, "trigger-keys": __props.triggerKeys, "virtual-ref": __props.virtualRef, "virtual-triggering": __props.virtualTriggering, "focus-on-target": __props.focusOnTarget }, { default: withCtx(() => [_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)]), _: 3 }, 8, [ "disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering", "focus-on-target" ]), createVNode(content_default$1, { ref_key: "contentRef", ref: contentRef, "aria-label": __props.ariaLabel, "boundaries-padding": __props.boundariesPadding, content: __props.content, disabled: __props.disabled, effect: __props.effect, enterable: __props.enterable, "fallback-placements": __props.fallbackPlacements, "hide-after": __props.hideAfter, "gpu-acceleration": __props.gpuAcceleration, offset: __props.offset, persistent: __props.persistent, "popper-class": kls.value, "popper-style": __props.popperStyle, placement: __props.placement, "popper-options": __props.popperOptions, "arrow-offset": __props.arrowOffset, pure: __props.pure, "raw-content": __props.rawContent, "reference-el": __props.referenceEl, "trigger-target-el": __props.triggerTargetEl, "show-after": __props.showAfter, strategy: __props.strategy, teleported: __props.teleported, transition: __props.transition, "virtual-triggering": __props.virtualTriggering, "z-index": __props.zIndex, "append-to": __props.appendTo, loop: __props.loop }, { default: withCtx(() => [renderSlot(_ctx.$slots, "content", {}, () => [__props.rawContent ? (openBlock(), createElementBlock("span", { key: 0, innerHTML: __props.content }, null, 8, _hoisted_1$1d)) : (openBlock(), createElementBlock("span", _hoisted_2$H, toDisplayString(__props.content), 1))]), __props.showArrow ? (openBlock(), createBlock(unref(arrow_default), { key: 0 })) : createCommentVNode("v-if", true)]), _: 3 }, 8, [ "aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "arrow-offset", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to", "loop" ])]), _: 3 }, 8, ["role"]); }; } }); var tooltip_default = tooltip_vue_vue_type_script_setup_true_lang_default; const ElTooltip = withInstall(tooltip_default); const mutable = (val) => val; const inputProps = buildProps({ id: { type: String, default: void 0 }, size: useSizeProp, disabled: { type: Boolean, default: void 0 }, modelValue: { type: definePropType([ String, Number, Object ]), default: "" }, modelModifiers: { type: definePropType(Object), default: () => ({}) }, maxlength: { type: [String, Number] }, minlength: { type: [String, Number] }, type: { type: definePropType(String), default: "text" }, resize: { type: String, values: [ "none", "both", "horizontal", "vertical" ] }, autosize: { type: definePropType([Boolean, Object]), default: false }, autocomplete: { type: definePropType(String), default: "off" }, formatter: { type: Function }, parser: { type: Function }, placeholder: { type: String }, form: { type: String }, readonly: Boolean, clearable: Boolean, clearIcon: { type: iconPropType, default: circle_close_default }, showPassword: Boolean, showWordLimit: Boolean, wordLimitPosition: { type: String, values: ["inside", "outside"], default: "inside" }, suffixIcon: { type: iconPropType }, prefixIcon: { type: iconPropType }, containerRole: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, validateEvent: { type: Boolean, default: true }, inputStyle: { type: definePropType([ Object, Array, String ]), default: () => mutable({}) }, countGraphemes: { type: definePropType(Function) }, autofocus: Boolean, rows: { type: Number, default: 2 }, ...useAriaProps(["ariaLabel"]), inputmode: { type: definePropType(String), default: void 0 }, name: String }); const inputEmits = { [UPDATE_MODEL_EVENT]: (value) => isString(value), input: (value) => isString(value), change: (value, evt) => isString(value) && (evt instanceof Event || evt === void 0), focus: (evt) => evt instanceof FocusEvent, blur: (evt) => evt instanceof FocusEvent, clear: (evt) => evt === void 0 || evt instanceof MouseEvent, mouseleave: (evt) => evt instanceof MouseEvent, mouseenter: (evt) => evt instanceof MouseEvent, keydown: (evt) => evt instanceof Event, compositionstart: (evt) => evt instanceof CompositionEvent, compositionupdate: (evt) => evt instanceof CompositionEvent, compositionend: (evt) => evt instanceof CompositionEvent }; ({ clearIcon: markRaw(circle_close_default) }); let hiddenTextarea = void 0; const HIDDEN_STYLE = { height: "0", visibility: "hidden", overflow: isFirefox() ? "" : "hidden", position: "absolute", "z-index": "-1000", top: "0", right: "0" }; const CONTEXT_STYLE = [ "letter-spacing", "line-height", "padding-top", "padding-bottom", "font-family", "font-weight", "font-size", "text-rendering", "text-transform", "width", "text-indent", "padding-left", "padding-right", "border-width", "box-sizing", "word-break" ]; const looseToNumber = (val) => { const n = Number.parseFloat(val); return Number.isNaN(n) ? val : n; }; function calculateNodeStyling(targetElement) { const style = window.getComputedStyle(targetElement); const boxSizing = style.getPropertyValue("box-sizing"); const paddingSize = Number.parseFloat(style.getPropertyValue("padding-bottom")) + Number.parseFloat(style.getPropertyValue("padding-top")); const borderSize = Number.parseFloat(style.getPropertyValue("border-bottom-width")) + Number.parseFloat(style.getPropertyValue("border-top-width")); return { contextStyle: CONTEXT_STYLE.map((name) => [name, style.getPropertyValue(name)]), paddingSize, borderSize, boxSizing }; } function calcTextareaHeight(targetElement, minRows = 1, maxRows) { var _a; if (!hiddenTextarea) { hiddenTextarea = document.createElement("textarea"); let hostNode = document.body; if (!isFirefox() && targetElement.parentNode) hostNode = targetElement.parentNode; hostNode.appendChild(hiddenTextarea); } const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement); contextStyle.forEach(([key, value]) => hiddenTextarea == null ? void 0 : hiddenTextarea.style.setProperty(key, value)); Object.entries(HIDDEN_STYLE).forEach(([key, value]) => hiddenTextarea == null ? void 0 : hiddenTextarea.style.setProperty(key, value, "important")); hiddenTextarea.value = targetElement.value || targetElement.placeholder || ""; let height = hiddenTextarea.scrollHeight; const result = {}; if (boxSizing === "border-box") height = height + borderSize; else if (boxSizing === "content-box") height = height - paddingSize; hiddenTextarea.value = ""; const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize; if (isNumber(minRows)) { let minHeight = singleRowHeight * minRows; if (boxSizing === "border-box") minHeight = minHeight + paddingSize + borderSize; height = Math.max(minHeight, height); result.minHeight = `${minHeight}px`; } if (isNumber(maxRows)) { let maxHeight = singleRowHeight * maxRows; if (boxSizing === "border-box") maxHeight = maxHeight + paddingSize + borderSize; height = Math.min(maxHeight, height); } result.height = `${height}px`; (_a = hiddenTextarea.parentNode) == null ? void 0 : _a.removeChild(hiddenTextarea); hiddenTextarea = void 0; return result; } const _hoisted_1$1c = [ "id", "name", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "role", "inputmode" ]; const _hoisted_2$G = [ "id", "name", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "role", "inputmode" ]; const COMPONENT_NAME$j = "ElInput"; var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$j, inheritAttrs: false, __name: "input", props: inputProps, emits: inputEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const rawAttrs = useAttrs$1(); const slots = useSlots(); const containerKls = computed(() => [ props2.type === "textarea" ? nsTextarea.b() : nsInput.b(), nsInput.m(inputSize.value), nsInput.is("disabled", inputDisabled.value), nsInput.is("exceed", inputExceed.value), { [nsInput.b("group")]: slots.prepend || slots.append, [nsInput.m("prefix")]: slots.prefix || props2.prefixIcon, [nsInput.m("suffix")]: slots.suffix || props2.suffixIcon || props2.clearable || props2.showPassword, [nsInput.bm("suffix", "password-clear")]: showClear.value && showPwdVisible.value, [nsInput.b("hidden")]: props2.type === "hidden" }, rawAttrs.class ]); const wrapperKls = computed(() => [nsInput.e("wrapper"), nsInput.is("focus", isFocused.value)]); const attrs = useAttrs(); const maxlength = computed(() => { var _a; return (_a = props2.maxlength) == null ? void 0 : _a.toString(); }); const { form: elForm, formItem: elFormItem } = useFormItem(); const { inputId } = useFormItemInputId(props2, { formItemContext: elFormItem }); const inputSize = useFormSize(); const inputDisabled = useFormDisabled(); const nsInput = useNamespace("input"); const nsTextarea = useNamespace("textarea"); const input = shallowRef(); const textarea = shallowRef(); const hovering = ref(false); const passwordVisible = ref(false); const countStyle = ref(); const textareaCalcStyle = shallowRef(props2.inputStyle); const saveValue = ref(""); const _ref = computed(() => input.value || textarea.value); const { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(_ref, { disabled: inputDisabled, afterBlur() { var _a; if (props2.validateEvent) (_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "blur").catch((err) => debugWarn(err)); } }); const needStatusIcon = computed(() => (elForm == null ? void 0 : elForm.statusIcon) ?? false); const validateState = computed(() => (elFormItem == null ? void 0 : elFormItem.validateState) || ""); const validateIcon = computed(() => validateState.value && ValidateComponentsMap[validateState.value]); const passwordIcon = computed(() => passwordVisible.value ? view_default : hide_default); const containerStyle = computed(() => [rawAttrs.style]); const textareaStyle = computed(() => [ props2.inputStyle, textareaCalcStyle.value, { resize: props2.resize } ]); const nativeInputValue = computed(() => isNil(props2.modelValue) ? "" : String(props2.modelValue)); const showClear = computed(() => props2.clearable && !inputDisabled.value && !props2.readonly && !!nativeInputValue.value && (isFocused.value || hovering.value)); const showPwdVisible = computed(() => props2.showPassword && !inputDisabled.value && !!nativeInputValue.value); const isWordLimitVisible = computed(() => props2.showWordLimit && !!maxlength.value && (props2.type === "text" || props2.type === "textarea") && !inputDisabled.value && !props2.readonly && !props2.showPassword); const textLength = computed(() => { if (props2.countGraphemes && props2.showWordLimit) return props2.countGraphemes(nativeInputValue.value); return nativeInputValue.value.length; }); const inputExceed = computed(() => !!isWordLimitVisible.value && textLength.value > Number(maxlength.value)); const suffixVisible = computed(() => !!slots.suffix || !!props2.suffixIcon || showClear.value || props2.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value); const hasModelModifiers = computed(() => !!Object.keys(props2.modelModifiers).length); const [recordCursor, setCursor] = useCursor(input); useResizeObserver(textarea, (entries) => { onceInitSizeTextarea(); if (!isWordLimitVisible.value || props2.resize !== "both" && props2.resize !== "horizontal") return; const { width } = entries[0].contentRect; countStyle.value = { right: `calc(100% - ${width + 22 - 10}px)` }; }); const resizeTextarea = () => { const { type, autosize } = props2; if (!isClient || type !== "textarea" || !textarea.value) return; if (autosize) { const minRows = isObject(autosize) ? autosize.minRows : void 0; const maxRows = isObject(autosize) ? autosize.maxRows : void 0; const textareaStyle2 = calcTextareaHeight(textarea.value, minRows, maxRows); textareaCalcStyle.value = { overflowY: "hidden", ...textareaStyle2 }; nextTick(() => { textarea.value.offsetHeight; textareaCalcStyle.value = textareaStyle2; }); } else textareaCalcStyle.value = { minHeight: calcTextareaHeight(textarea.value).minHeight }; }; const createOnceInitResize = (resizeTextarea2) => { let isInit = false; return () => { var _a; if (isInit || !props2.autosize) return; if (!(((_a = textarea.value) == null ? void 0 : _a.offsetParent) === null)) { setTimeout(resizeTextarea2); isInit = true; } }; }; const onceInitSizeTextarea = createOnceInitResize(resizeTextarea); const setNativeInputValue = () => { const input2 = _ref.value; const formatterValue = props2.formatter ? props2.formatter(nativeInputValue.value) : nativeInputValue.value; if (!input2 || input2.value === formatterValue || props2.type === "file") return; input2.value = formatterValue; }; const formatValue = (value) => { const { trim, number } = props2.modelModifiers; if (trim) value = value.trim(); if (number) value = `${looseToNumber(value)}`; if (props2.formatter && props2.parser) value = props2.parser(value); return value; }; const handleInput = async (event) => { if (isComposing.value) return; const { lazy } = props2.modelModifiers; let { value } = event.target; let shouldForceNativeUpdate = false; if (lazy) { emit(INPUT_EVENT, value); return; } value = formatValue(value); if (props2.countGraphemes && maxlength.value != null) { const limit = Number(maxlength.value); const graphemes = props2.countGraphemes(value); const saveGraphemes = props2.countGraphemes(saveValue.value); if (graphemes > limit && graphemes > saveGraphemes) if (saveGraphemes > limit) { value = saveValue.value; shouldForceNativeUpdate = true; } else { const prevValue = saveValue.value; const nextValue = value; let prefixLen = 0; while (prefixLen < prevValue.length && prefixLen < nextValue.length && prevValue[prefixLen] === nextValue[prefixLen]) prefixLen++; let prevSuffixIndex = prevValue.length; let nextSuffixIndex = nextValue.length; while (prevSuffixIndex > prefixLen && nextSuffixIndex > prefixLen && prevValue[prevSuffixIndex - 1] === nextValue[nextSuffixIndex - 1]) { prevSuffixIndex--; nextSuffixIndex--; } const before = nextValue.slice(0, prefixLen); const removed = prevValue.slice(prefixLen, prevSuffixIndex); const inserted = nextValue.slice(prefixLen, nextSuffixIndex); const after = nextValue.slice(nextSuffixIndex); const baseCount = saveGraphemes - props2.countGraphemes(removed); const availableInserted = Math.max(0, limit - baseCount); let acceptedInserted = ""; if (availableInserted > 0) if (typeof Intl !== "undefined" && "Segmenter" in Intl) { const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" }); for (const { segment } of segmenter.segment(inserted)) { const candidate = acceptedInserted + segment; if (props2.countGraphemes(candidate) > availableInserted) break; acceptedInserted = candidate; } } else for (const char of Array.from(inserted)) { const candidate = acceptedInserted + char; if (props2.countGraphemes(candidate) > availableInserted) break; acceptedInserted = candidate; } value = before + acceptedInserted + after; shouldForceNativeUpdate = true; } } if (String(value) === nativeInputValue.value) { if (props2.formatter || shouldForceNativeUpdate) { const target = event.target; const blockedValue = target.value; const selectionStart = target.selectionStart; const selectionEnd = target.selectionEnd; setNativeInputValue(); if (shouldForceNativeUpdate && _ref.value && selectionStart != null && selectionEnd != null) { const restoredValue = _ref.value.value; const afterTxt = blockedValue.slice(Math.max(0, selectionEnd)); let caretPos = Math.min(selectionStart, restoredValue.length); if (afterTxt && restoredValue.endsWith(afterTxt)) caretPos = restoredValue.length - afterTxt.length; _ref.value.setSelectionRange(caretPos, caretPos); } } return; } saveValue.value = value; recordCursor(); emit(UPDATE_MODEL_EVENT, value); emit(INPUT_EVENT, value); await nextTick(); if (props2.formatter && props2.parser || !hasModelModifiers.value) setNativeInputValue(); setCursor(); }; const handleChange = async (event) => { let { value } = event.target; value = formatValue(value); if (props2.modelModifiers.lazy) emit(UPDATE_MODEL_EVENT, value); emit(CHANGE_EVENT, value, event); await nextTick(); setNativeInputValue(); }; const { isComposing, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposition({ emit, afterComposition: handleInput }); const handlePasswordVisible = () => { passwordVisible.value = !passwordVisible.value; }; const focus = () => { var _a; return (_a = _ref.value) == null ? void 0 : _a.focus(); }; const blur = () => { var _a; return (_a = _ref.value) == null ? void 0 : _a.blur(); }; const handleMouseLeave = (evt) => { hovering.value = false; emit("mouseleave", evt); }; const handleMouseEnter = (evt) => { hovering.value = true; emit("mouseenter", evt); }; const handleKeydown = (evt) => { emit("keydown", evt); }; const select = () => { var _a; (_a = _ref.value) == null ? void 0 : _a.select(); }; const clear = (evt) => { emit(UPDATE_MODEL_EVENT, ""); emit(CHANGE_EVENT, ""); emit("clear", evt); emit(INPUT_EVENT, ""); }; watch(() => props2.modelValue, () => { var _a; nextTick(() => resizeTextarea()); if (props2.validateEvent) (_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn(err)); }); watch(() => nativeInputValue.value, (val) => { saveValue.value = val; }, { immediate: true }); watch(nativeInputValue, (newValue) => { if (!_ref.value) return; const { trim, number } = props2.modelModifiers; const elValue = _ref.value.value; const displayValue = (number || props2.type === "number") && !/^0\d/.test(elValue) ? `${looseToNumber(elValue)}` : elValue; if (displayValue === newValue) return; if (document.activeElement === _ref.value && _ref.value.type !== "range") { if (trim && displayValue.trim() === newValue) return; } setNativeInputValue(); }); watch(() => props2.type, async () => { await nextTick(); setNativeInputValue(); resizeTextarea(); }); onMounted(() => { if (!props2.formatter && props2.parser) debugWarn(COMPONENT_NAME$j, "If you set the parser, you also need to set the formatter."); setNativeInputValue(); nextTick(resizeTextarea); }); __expose({ input, textarea, ref: _ref, textareaStyle, autosize: toRef(props2, "autosize"), isComposing, passwordVisible, focus, blur, select, clear, resizeTextarea }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([containerKls.value, { [unref(nsInput).bm("group", "append")]: _ctx.$slots.append, [unref(nsInput).bm("group", "prepend")]: _ctx.$slots.prepend }]), style: normalizeStyle(containerStyle.value), onMouseenter: handleMouseEnter, onMouseleave: handleMouseLeave }, [createCommentVNode(" input "), __props.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createCommentVNode(" prepend slot "), _ctx.$slots.prepend ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(nsInput).be("group", "prepend")) }, [renderSlot(_ctx.$slots, "prepend")], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref_key: "wrapperRef", ref: wrapperRef, class: normalizeClass(wrapperKls.value) }, [ createCommentVNode(" prefix slot "), _ctx.$slots.prefix || __props.prefixIcon ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(nsInput).e("prefix")) }, [createBaseVNode("span", { class: normalizeClass(unref(nsInput).e("prefix-inner")) }, [renderSlot(_ctx.$slots, "prefix"), __props.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(unref(nsInput).e("icon")) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.prefixIcon)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true)], 2)], 2)) : createCommentVNode("v-if", true), createBaseVNode("input", mergeProps({ id: unref(inputId), ref_key: "input", ref: input, class: unref(nsInput).e("inner") }, unref(attrs), { name: __props.name, minlength: __props.countGraphemes ? void 0 : __props.minlength, maxlength: __props.countGraphemes ? void 0 : maxlength.value, type: __props.showPassword ? passwordVisible.value ? "text" : "password" : __props.type, disabled: unref(inputDisabled), readonly: __props.readonly, autocomplete: __props.autocomplete, tabindex: __props.tabindex, "aria-label": __props.ariaLabel, placeholder: __props.placeholder, style: __props.inputStyle, form: __props.form, autofocus: __props.autofocus, role: __props.containerRole, inputmode: __props.inputmode, onCompositionstart: _cache[0] || (_cache[0] = (...args) => unref(handleCompositionStart) && unref(handleCompositionStart)(...args)), onCompositionupdate: _cache[1] || (_cache[1] = (...args) => unref(handleCompositionUpdate) && unref(handleCompositionUpdate)(...args)), onCompositionend: _cache[2] || (_cache[2] = (...args) => unref(handleCompositionEnd) && unref(handleCompositionEnd)(...args)), onInput: handleInput, onChange: handleChange, onKeydown: handleKeydown }), null, 16, _hoisted_1$1c), createCommentVNode(" suffix slot "), suffixVisible.value ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(unref(nsInput).e("suffix")) }, [createBaseVNode("span", { class: normalizeClass(unref(nsInput).e("suffix-inner")) }, [ !showClear.value || !showPwdVisible.value || !isWordLimitVisible.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [renderSlot(_ctx.$slots, "suffix"), __props.suffixIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(unref(nsInput).e("icon")) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.suffixIcon)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true)], 64)) : createCommentVNode("v-if", true), showClear.value ? (openBlock(), createBlock(unref(ElIcon), { key: 1, class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")]), onMousedown: withModifiers(unref(NOOP), ["prevent"]), onClick: clear }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))]), _: 1 }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true), showPwdVisible.value ? (openBlock(), createBlock(unref(ElIcon), { key: 2, class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("password")]), onClick: handlePasswordVisible, onMousedown: withModifiers(unref(NOOP), ["prevent"]), onMouseup: withModifiers(unref(NOOP), ["prevent"]) }, { default: withCtx(() => [renderSlot(_ctx.$slots, "password-icon", { visible: passwordVisible.value }, () => [(openBlock(), createBlock(resolveDynamicComponent(passwordIcon.value)))])]), _: 3 }, 8, [ "class", "onMousedown", "onMouseup" ])) : createCommentVNode("v-if", true), isWordLimitVisible.value ? (openBlock(), createElementBlock("span", { key: 3, class: normalizeClass([unref(nsInput).e("count"), unref(nsInput).is("outside", __props.wordLimitPosition === "outside")]) }, [createBaseVNode("span", { class: normalizeClass(unref(nsInput).e("count-inner")) }, toDisplayString(textLength.value) + " / " + toDisplayString(maxlength.value), 3)], 2)) : createCommentVNode("v-if", true), validateState.value && validateIcon.value && needStatusIcon.value ? (openBlock(), createBlock(unref(ElIcon), { key: 4, class: normalizeClass([ unref(nsInput).e("icon"), unref(nsInput).e("validateIcon"), unref(nsInput).is("loading", validateState.value === "validating") ]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(validateIcon.value)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2)], 2)) : createCommentVNode("v-if", true) ], 2), createCommentVNode(" append slot "), _ctx.$slots.append ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(nsInput).be("group", "append")) }, [renderSlot(_ctx.$slots, "append")], 2)) : createCommentVNode("v-if", true) ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createCommentVNode(" textarea "), createBaseVNode("textarea", mergeProps({ id: unref(inputId), ref_key: "textarea", ref: textarea, class: [ unref(nsTextarea).e("inner"), unref(nsInput).is("focus", unref(isFocused)), unref(nsTextarea).is("clearable", __props.clearable) ] }, unref(attrs), { name: __props.name, minlength: __props.countGraphemes ? void 0 : __props.minlength, maxlength: __props.countGraphemes ? void 0 : maxlength.value, tabindex: __props.tabindex, disabled: unref(inputDisabled), readonly: __props.readonly, autocomplete: __props.autocomplete, style: textareaStyle.value, "aria-label": __props.ariaLabel, placeholder: __props.placeholder, form: __props.form, autofocus: __props.autofocus, rows: __props.rows, role: __props.containerRole, inputmode: __props.inputmode, onCompositionstart: _cache[3] || (_cache[3] = (...args) => unref(handleCompositionStart) && unref(handleCompositionStart)(...args)), onCompositionupdate: _cache[4] || (_cache[4] = (...args) => unref(handleCompositionUpdate) && unref(handleCompositionUpdate)(...args)), onCompositionend: _cache[5] || (_cache[5] = (...args) => unref(handleCompositionEnd) && unref(handleCompositionEnd)(...args)), onInput: handleInput, onFocus: _cache[6] || (_cache[6] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)), onBlur: _cache[7] || (_cache[7] = (...args) => unref(handleBlur) && unref(handleBlur)(...args)), onChange: handleChange, onKeydown: handleKeydown }), null, 16, _hoisted_2$G), showClear.value ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass([unref(nsTextarea).e("icon"), unref(nsTextarea).e("clear")]), onMousedown: withModifiers(unref(NOOP), ["prevent"]), onClick: clear }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))]), _: 1 }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true), isWordLimitVisible.value ? (openBlock(), createElementBlock("span", { key: 1, style: normalizeStyle(countStyle.value), class: normalizeClass([unref(nsInput).e("count"), unref(nsInput).is("outside", __props.wordLimitPosition === "outside")]) }, toDisplayString(textLength.value) + " / " + toDisplayString(maxlength.value), 7)) : createCommentVNode("v-if", true) ], 64))], 38); }; } }); var input_default = input_vue_vue_type_script_setup_true_lang_default; const ElInput = withInstall(input_default); const autocompleteProps = buildProps({ ...inputProps, valueKey: { type: String, default: "value" }, modelValue: { type: [String, Number], default: "" }, debounce: { type: Number, default: 300 }, placement: { type: definePropType(String), values: [ "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end" ], default: "bottom-start" }, fetchSuggestions: { type: definePropType([Function, Array]), default: NOOP }, popperClass: useTooltipContentProps.popperClass, popperStyle: useTooltipContentProps.popperStyle, triggerOnFocus: { type: Boolean, default: true }, selectWhenUnmatched: Boolean, hideLoading: Boolean, teleported: useTooltipContentProps.teleported, appendTo: useTooltipContentProps.appendTo, highlightFirstItem: Boolean, fitInputWidth: Boolean, loopNavigation: { type: Boolean, default: true } }); const autocompleteEmits = { [UPDATE_MODEL_EVENT]: (value) => isString(value) || isNumber(value), [INPUT_EVENT]: (value) => isString(value) || isNumber(value), [CHANGE_EVENT]: (value) => isString(value) || isNumber(value), focus: (evt) => evt instanceof FocusEvent, blur: (evt) => evt instanceof FocusEvent, clear: () => true, select: (item) => isObject(item) }; const scrollbarProps = buildProps({ distance: { type: Number, default: 0 }, height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: Boolean, wrapStyle: { type: definePropType([ String, Object, Array ]), default: "" }, wrapClass: { type: [String, Array], default: "" }, viewClass: { type: [String, Array], default: "" }, viewStyle: { type: [ String, Array, Object ], default: "" }, noresize: Boolean, tag: { type: String, default: "div" }, always: Boolean, minSize: { type: Number, default: 20 }, tabindex: { type: [String, Number], default: void 0 }, id: String, role: String, ...useAriaProps(["ariaLabel", "ariaOrientation"]) }); const scrollbarEmits = { "end-reached": (direction2) => [ "left", "right", "top", "bottom" ].includes(direction2), scroll: ({ scrollTop, scrollLeft }) => [scrollTop, scrollLeft].every(isNumber) }; const GAP = 4; const BAR_MAP = { vertical: { offset: "offsetHeight", scroll: "scrollTop", scrollSize: "scrollHeight", size: "height", key: "vertical", axis: "Y", client: "clientY", direction: "top" }, horizontal: { offset: "offsetWidth", scroll: "scrollLeft", scrollSize: "scrollWidth", size: "width", key: "horizontal", axis: "X", client: "clientX", direction: "left" } }; const renderThumbStyle$1 = ({ move, size, bar }) => ({ [bar.size]: size, transform: `translate${bar.axis}(${move}%)` }); const thumbProps = buildProps({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: true }, always: Boolean }); const scrollbarContextKey = Symbol("scrollbarContextKey"); function isGreaterThan(a, b, epsilon = 0.03) { return a - b > epsilon; } const barProps = buildProps({ always: { type: Boolean, default: true }, minSize: { type: Number, required: true } }); const COMPONENT_NAME$i = "Thumb"; var thumb_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "thumb", props: thumbProps, setup(__props) { const props2 = __props; const scrollbar = inject(scrollbarContextKey); const ns = useNamespace("scrollbar"); if (!scrollbar) throwError(COMPONENT_NAME$i, "can not inject scrollbar context"); const instance = ref(); const thumb = ref(); const thumbState = ref({}); const visible = ref(false); let cursorDown = false; let cursorLeave = false; let baseScrollHeight = 0; let baseScrollWidth = 0; let originalOnSelectStart = isClient ? document.onselectstart : null; const bar = computed(() => BAR_MAP[props2.vertical ? "vertical" : "horizontal"]); const thumbStyle = computed(() => renderThumbStyle$1({ size: props2.size, move: props2.move, bar: bar.value })); const offsetRatio = computed(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props2.ratio / thumb.value[bar.value.offset]); const clickThumbHandler = (e) => { var _a; e.stopPropagation(); if (e.ctrlKey || [1, 2].includes(e.button)) return; (_a = window.getSelection()) == null ? void 0 : _a.removeAllRanges(); startDrag(e); const el = e.currentTarget; if (!el) return; thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]); }; const clickTrackHandler = (e) => { if (!thumb.value || !instance.value || !scrollbar.wrapElement) return; const thumbPositionPercentage = (Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) - thumb.value[bar.value.offset] / 2) * 100 * offsetRatio.value / instance.value[bar.value.offset]; scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100; }; const startDrag = (e) => { e.stopImmediatePropagation(); cursorDown = true; baseScrollHeight = scrollbar.wrapElement.scrollHeight; baseScrollWidth = scrollbar.wrapElement.scrollWidth; document.addEventListener("mousemove", mouseMoveDocumentHandler); document.addEventListener("mouseup", mouseUpDocumentHandler); originalOnSelectStart = document.onselectstart; document.onselectstart = () => false; }; const mouseMoveDocumentHandler = (e) => { if (!instance.value || !thumb.value) return; if (cursorDown === false) return; const prevPage = thumbState.value[bar.value.axis]; if (!prevPage) return; const thumbPositionPercentage = ((instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1 - (thumb.value[bar.value.offset] - prevPage)) * 100 * offsetRatio.value / instance.value[bar.value.offset]; if (bar.value.scroll === "scrollLeft") scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * baseScrollWidth / 100; else scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * baseScrollHeight / 100; }; const mouseUpDocumentHandler = () => { cursorDown = false; thumbState.value[bar.value.axis] = 0; document.removeEventListener("mousemove", mouseMoveDocumentHandler); document.removeEventListener("mouseup", mouseUpDocumentHandler); restoreOnselectstart(); if (cursorLeave) visible.value = false; }; const mouseMoveScrollbarHandler = () => { cursorLeave = false; visible.value = !!props2.size; }; const mouseLeaveScrollbarHandler = () => { cursorLeave = true; visible.value = cursorDown; }; onBeforeUnmount(() => { restoreOnselectstart(); document.removeEventListener("mouseup", mouseUpDocumentHandler); }); const restoreOnselectstart = () => { if (document.onselectstart !== originalOnSelectStart) document.onselectstart = originalOnSelectStart; }; useEventListener(toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler); useEventListener(toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler); return (_ctx, _cache) => { return openBlock(), createBlock(Transition, { name: unref(ns).b("fade"), persisted: "" }, { default: withCtx(() => [withDirectives(createBaseVNode("div", { ref_key: "instance", ref: instance, class: normalizeClass([unref(ns).e("bar"), unref(ns).is(bar.value.key)]), onMousedown: clickTrackHandler, onClick: _cache[0] || (_cache[0] = withModifiers(() => { }, ["stop"])) }, [createBaseVNode("div", { ref_key: "thumb", ref: thumb, class: normalizeClass(unref(ns).e("thumb")), style: normalizeStyle(thumbStyle.value), onMousedown: clickThumbHandler }, null, 38)], 34), [[vShow, __props.always || visible.value]])]), _: 1 }, 8, ["name"]); }; } }); var thumb_default = thumb_vue_vue_type_script_setup_true_lang_default; var bar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "bar", props: barProps, setup(__props, { expose: __expose }) { const props2 = __props; const scrollbar = inject(scrollbarContextKey); const moveX = ref(0); const moveY = ref(0); const sizeWidth = ref(""); const sizeHeight = ref(""); const ratioY = ref(1); const ratioX = ref(1); const handleScroll2 = (wrap) => { if (wrap) { const offsetHeight = wrap.offsetHeight - GAP; const offsetWidth = wrap.offsetWidth - GAP; moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value; moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value; } }; const update = () => { const wrap = scrollbar == null ? void 0 : scrollbar.wrapElement; if (!wrap) return; const offsetHeight = wrap.offsetHeight - GAP; const offsetWidth = wrap.offsetWidth - GAP; const originalHeight = offsetHeight ** 2 / wrap.scrollHeight; const originalWidth = offsetWidth ** 2 / wrap.scrollWidth; const height = Math.max(originalHeight, props2.minSize); const width = Math.max(originalWidth, props2.minSize); ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height)); ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width)); sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : ""; sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : ""; }; __expose({ handleScroll: handleScroll2, update }); return (_ctx, _cache) => { return openBlock(), createElementBlock(Fragment, null, [createVNode(thumb_default, { move: moveX.value, ratio: ratioX.value, size: sizeWidth.value, always: __props.always }, null, 8, [ "move", "ratio", "size", "always" ]), createVNode(thumb_default, { move: moveY.value, ratio: ratioY.value, size: sizeHeight.value, vertical: "", always: __props.always }, null, 8, [ "move", "ratio", "size", "always" ])], 64); }; } }); var bar_default = bar_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$1b = ["tabindex"]; const COMPONENT_NAME$h = "ElScrollbar"; var scrollbar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$h, __name: "scrollbar", props: scrollbarProps, emits: scrollbarEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("scrollbar"); let stopResizeObserver = void 0; let stopWrapResizeObserver = void 0; let stopResizeListener = void 0; let wrapScrollTop = 0; let wrapScrollLeft = 0; let direction2 = ""; const distanceScrollState = { bottom: false, top: false, right: false, left: false }; const scrollbarRef = ref(); const wrapRef = ref(); const resizeRef = ref(); const barRef = ref(); const wrapStyle = computed(() => { const style = {}; const height = addUnit(props2.height); const maxHeight = addUnit(props2.maxHeight); if (height) style.height = height; if (maxHeight) style.maxHeight = maxHeight; return [props2.wrapStyle, style]; }); const wrapKls = computed(() => { return [ props2.wrapClass, ns.e("wrap"), { [ns.em("wrap", "hidden-default")]: !props2.native } ]; }); const resizeKls = computed(() => { return [ns.e("view"), props2.viewClass]; }); const shouldSkipDirection = (direction3) => { return distanceScrollState[direction3] ?? false; }; const DIRECTION_PAIRS = { top: "bottom", bottom: "top", left: "right", right: "left" }; const updateTriggerStatus = (arrivedStates) => { const oppositeDirection = DIRECTION_PAIRS[direction2]; if (!oppositeDirection) return; const arrived = arrivedStates[direction2]; const oppositeArrived = arrivedStates[oppositeDirection]; if (arrived && !distanceScrollState[direction2]) distanceScrollState[direction2] = true; if (!oppositeArrived && distanceScrollState[oppositeDirection]) distanceScrollState[oppositeDirection] = false; }; const handleScroll2 = () => { var _a; if (wrapRef.value) { (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value); const prevTop = wrapScrollTop; const prevLeft = wrapScrollLeft; wrapScrollTop = wrapRef.value.scrollTop; wrapScrollLeft = wrapRef.value.scrollLeft; const arrivedStates = { bottom: !isGreaterThan(wrapRef.value.scrollHeight - props2.distance, wrapRef.value.clientHeight + wrapScrollTop), top: wrapScrollTop <= props2.distance && prevTop !== 0, right: !isGreaterThan(wrapRef.value.scrollWidth - props2.distance, wrapRef.value.clientWidth + wrapScrollLeft) && prevLeft !== wrapScrollLeft, left: wrapScrollLeft <= props2.distance && prevLeft !== 0 }; emit("scroll", { scrollTop: wrapScrollTop, scrollLeft: wrapScrollLeft }); if (prevTop !== wrapScrollTop) direction2 = wrapScrollTop > prevTop ? "bottom" : "top"; if (prevLeft !== wrapScrollLeft) direction2 = wrapScrollLeft > prevLeft ? "right" : "left"; if (props2.distance > 0) { if (shouldSkipDirection(direction2)) return; updateTriggerStatus(arrivedStates); } if (arrivedStates[direction2]) emit("end-reached", direction2); } }; function scrollTo(arg1, arg2) { if (isObject(arg1)) wrapRef.value.scrollTo(arg1); else if (isNumber(arg1) && isNumber(arg2)) wrapRef.value.scrollTo(arg1, arg2); } const setScrollTop = (value) => { if (!isNumber(value)) { debugWarn(COMPONENT_NAME$h, "value must be a number"); return; } wrapRef.value.scrollTop = value; }; const setScrollLeft = (value) => { if (!isNumber(value)) { debugWarn(COMPONENT_NAME$h, "value must be a number"); return; } wrapRef.value.scrollLeft = value; }; const update = () => { var _a, _b; (_a = barRef.value) == null ? void 0 : _a.update(); distanceScrollState[direction2] = false; if (wrapRef.value) (_b = barRef.value) == null ? void 0 : _b.handleScroll(wrapRef.value); }; watch(() => props2.noresize, (noresize) => { if (noresize) { stopResizeObserver == null ? void 0 : stopResizeObserver(); stopWrapResizeObserver == null ? void 0 : stopWrapResizeObserver(); stopResizeListener == null ? void 0 : stopResizeListener(); } else { ({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update)); ({ stop: stopWrapResizeObserver } = useResizeObserver(wrapRef, update)); stopResizeListener = useEventListener("resize", update); } }, { immediate: true }); watch(() => [props2.maxHeight, props2.height], () => { if (!props2.native) nextTick(() => { update(); }); }); provide(scrollbarContextKey, reactive({ scrollbarElement: scrollbarRef, wrapElement: wrapRef })); onActivated(() => { if (wrapRef.value) { wrapRef.value.scrollTop = wrapScrollTop; wrapRef.value.scrollLeft = wrapScrollLeft; } }); onMounted(() => { if (!props2.native) nextTick(() => { update(); }); }); onUpdated(() => update()); __expose({ wrapRef, update, scrollTo, setScrollTop, setScrollLeft, handleScroll: handleScroll2 }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "scrollbarRef", ref: scrollbarRef, class: normalizeClass(unref(ns).b()) }, [createBaseVNode("div", { ref_key: "wrapRef", ref: wrapRef, class: normalizeClass(wrapKls.value), style: normalizeStyle(wrapStyle.value), tabindex: __props.tabindex, onScroll: handleScroll2 }, [(openBlock(), createBlock(resolveDynamicComponent(__props.tag), { id: __props.id, ref_key: "resizeRef", ref: resizeRef, class: normalizeClass(resizeKls.value), style: normalizeStyle(__props.viewStyle), role: __props.role, "aria-label": __props.ariaLabel, "aria-orientation": __props.ariaOrientation }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "id", "class", "style", "role", "aria-label", "aria-orientation" ]))], 46, _hoisted_1$1b), !__props.native ? (openBlock(), createBlock(bar_default, { key: 0, ref_key: "barRef", ref: barRef, always: __props.always, "min-size": __props.minSize }, null, 8, ["always", "min-size"])) : createCommentVNode("v-if", true)], 2); }; } }); var scrollbar_default = scrollbar_vue_vue_type_script_setup_true_lang_default; const ElScrollbar = withInstall(scrollbar_default); const _hoisted_1$1a = ["aria-expanded", "aria-owns"]; const _hoisted_2$F = { key: 0 }; const _hoisted_3$i = [ "id", "aria-selected", "onClick" ]; const COMPONENT_NAME$g = "ElAutocomplete"; var autocomplete_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$g, inheritAttrs: false, __name: "autocomplete", props: autocompleteProps, emits: autocompleteEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const passInputProps = computed(() => { const inputProps2 = ElInput.props ?? []; return pick(props2, isArray(inputProps2) ? inputProps2 : Object.keys(inputProps2)); }); const rawAttrs = useAttrs$1(); const disabled = useFormDisabled(); const ns = useNamespace("autocomplete"); const inputRef = ref(); const regionRef = ref(); const popperRef = ref(); const listboxRef = ref(); let readonly2 = false; let ignoreFocusEvent = false; const suggestions = ref([]); const highlightedIndex = ref(-1); const dropdownWidth = ref(""); const activated = ref(false); const suggestionDisabled = ref(false); const loading = ref(false); const listboxId = useId(); const styles = computed(() => rawAttrs.style); const suggestionVisible = computed(() => { return (suggestions.value.length > 0 || loading.value) && activated.value; }); const suggestionLoading = computed(() => !props2.hideLoading && loading.value); const refInput = computed(() => { if (inputRef.value) return Array.from(inputRef.value.$el.querySelectorAll("input")); return []; }); const onSuggestionShow = () => { if (suggestionVisible.value) dropdownWidth.value = `${inputRef.value.$el.offsetWidth}px`; }; const onHide = () => { highlightedIndex.value = -1; }; const getData = async (queryString) => { if (suggestionDisabled.value) return; const cb = (suggestionList) => { loading.value = false; if (suggestionDisabled.value) return; if (isArray(suggestionList)) { suggestions.value = suggestionList; highlightedIndex.value = props2.highlightFirstItem ? 0 : -1; } else throwError(COMPONENT_NAME$g, "autocomplete suggestions must be an array"); }; loading.value = true; if (isArray(props2.fetchSuggestions)) cb(props2.fetchSuggestions); else { const result = await props2.fetchSuggestions(queryString, cb); if (isArray(result)) cb(result); } }; const debouncedGetData = useDebounceFn(getData, computed(() => props2.debounce)); const handleInput = (value) => { const valuePresented = !!value; emit(INPUT_EVENT, value); emit(UPDATE_MODEL_EVENT, value); suggestionDisabled.value = false; activated.value || (activated.value = valuePresented); if (!props2.triggerOnFocus && !value) { suggestionDisabled.value = true; suggestions.value = []; return; } debouncedGetData(value); }; const handleMouseDown = (event) => { var _a; if (disabled.value) return; if (((_a = event.target) == null ? void 0 : _a.tagName) !== "INPUT" || refInput.value.includes(document.activeElement)) activated.value = true; }; const handleChange = (value) => { emit(CHANGE_EVENT, value); }; const handleFocus = (evt) => { if (!ignoreFocusEvent) { activated.value = true; emit("focus", evt); const queryString = props2.modelValue ?? ""; if (props2.triggerOnFocus && !readonly2) debouncedGetData(String(queryString)); } else ignoreFocusEvent = false; }; const handleBlur = (evt) => { setTimeout(() => { var _a; if ((_a = popperRef.value) == null ? void 0 : _a.isFocusInsideContent()) { ignoreFocusEvent = true; return; } activated.value && close2(); emit("blur", evt); }); }; const handleClear = () => { activated.value = false; emit(UPDATE_MODEL_EVENT, ""); emit("clear"); }; const handleKeyEnter = async () => { var _a; if ((_a = inputRef.value) == null ? void 0 : _a.isComposing) return; if (suggestionVisible.value && highlightedIndex.value >= 0 && highlightedIndex.value < suggestions.value.length) handleSelect(suggestions.value[highlightedIndex.value]); else { if (props2.selectWhenUnmatched) { emit("select", { value: props2.modelValue }); suggestions.value = []; highlightedIndex.value = -1; } activated.value = true; debouncedGetData(String(props2.modelValue)); } }; const handleKeyEscape = (evt) => { if (suggestionVisible.value) { evt.preventDefault(); evt.stopPropagation(); close2(); } }; const close2 = () => { activated.value = false; }; const focus = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.blur(); }; const handleSelect = async (item) => { emit(INPUT_EVENT, item[props2.valueKey]); emit(UPDATE_MODEL_EVENT, item[props2.valueKey]); emit("select", item); suggestions.value = []; highlightedIndex.value = -1; }; const highlight = (index) => { var _a, _b; if (!suggestionVisible.value || loading.value) return; if (index < 0) { if (!props2.loopNavigation) { highlightedIndex.value = -1; return; } index = suggestions.value.length - 1; } if (index >= suggestions.value.length) index = props2.loopNavigation ? 0 : suggestions.value.length - 1; const [suggestion, suggestionList] = getSuggestionContext(); const highlightItem = suggestionList[index]; const scrollTop = suggestion.scrollTop; const { offsetTop, scrollHeight } = highlightItem; if (offsetTop + scrollHeight > scrollTop + suggestion.clientHeight) suggestion.scrollTop = offsetTop + scrollHeight - suggestion.clientHeight; if (offsetTop < scrollTop) suggestion.scrollTop = offsetTop; highlightedIndex.value = index; (_b = (_a = inputRef.value) == null ? void 0 : _a.ref) == null ? void 0 : _b.setAttribute("aria-activedescendant", `${listboxId.value}-item-${highlightedIndex.value}`); }; const getSuggestionContext = () => { const suggestion = regionRef.value.querySelector(`.${ns.be("suggestion", "wrap")}`); return [suggestion, suggestion.querySelectorAll(`.${ns.be("suggestion", "list")} li`)]; }; const stopHandle = onClickOutside(listboxRef, (event) => { var _a; if ((_a = popperRef.value) == null ? void 0 : _a.isFocusInsideContent()) return; const hadIgnoredFocus = ignoreFocusEvent; ignoreFocusEvent = false; if (!suggestionVisible.value) return; if (hadIgnoredFocus) handleBlur(new FocusEvent("blur", event)); else close2(); }); const handleKeydown = (e) => { switch (getEventCode(e)) { case EVENT_CODE.up: e.preventDefault(); highlight(highlightedIndex.value - 1); break; case EVENT_CODE.down: e.preventDefault(); highlight(highlightedIndex.value + 1); break; case EVENT_CODE.enter: case EVENT_CODE.numpadEnter: e.preventDefault(); handleKeyEnter(); break; case EVENT_CODE.tab: close2(); break; case EVENT_CODE.esc: handleKeyEscape(e); break; case EVENT_CODE.home: e.preventDefault(); highlight(0); break; case EVENT_CODE.end: e.preventDefault(); highlight(suggestions.value.length - 1); break; case EVENT_CODE.pageUp: e.preventDefault(); highlight(Math.max(0, highlightedIndex.value - 10)); break; case EVENT_CODE.pageDown: e.preventDefault(); highlight(Math.min(suggestions.value.length - 1, highlightedIndex.value + 10)); break; } }; onBeforeUnmount(() => { stopHandle == null ? void 0 : stopHandle(); }); onMounted(() => { var _a; const inputElement = (_a = inputRef.value) == null ? void 0 : _a.ref; if (!inputElement) return; [ { key: "role", value: "textbox" }, { key: "aria-autocomplete", value: "list" }, { key: "aria-controls", value: listboxId.value }, { key: "aria-activedescendant", value: `${listboxId.value}-item-${highlightedIndex.value}` } ].forEach(({ key, value }) => inputElement.setAttribute(key, value)); readonly2 = inputElement.hasAttribute("readonly"); }); __expose({ highlightedIndex, activated, loading, inputRef, popperRef, suggestions, handleSelect, handleKeyEnter, focus, blur, close: close2, highlight, getData }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTooltip), { ref_key: "popperRef", ref: popperRef, visible: suggestionVisible.value, placement: __props.placement, "fallback-placements": ["bottom-start", "top-start"], "popper-class": [unref(ns).e("popper"), __props.popperClass], "popper-style": __props.popperStyle, teleported: __props.teleported, "append-to": __props.appendTo, "gpu-acceleration": false, pure: "", "manual-mode": "", effect: "light", trigger: "click", transition: `${unref(ns).namespace.value}-zoom-in-top`, persistent: "", role: "listbox", onBeforeShow: onSuggestionShow, onHide }, { content: withCtx(() => [createBaseVNode("div", { ref_key: "regionRef", ref: regionRef, class: normalizeClass([unref(ns).b("suggestion"), unref(ns).is("loading", suggestionLoading.value)]), style: normalizeStyle({ [__props.fitInputWidth ? "width" : "minWidth"]: dropdownWidth.value, outline: "none" }), role: "region" }, [ _ctx.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).be("suggestion", "header")), onClick: _cache[0] || (_cache[0] = withModifiers(() => { }, ["stop"])) }, [renderSlot(_ctx.$slots, "header")], 2)) : createCommentVNode("v-if", true), createVNode(unref(ElScrollbar), { id: unref(listboxId), tag: "ul", "wrap-class": unref(ns).be("suggestion", "wrap"), "view-class": unref(ns).be("suggestion", "list"), role: "listbox" }, { default: withCtx(() => [suggestionLoading.value ? (openBlock(), createElementBlock("li", _hoisted_2$F, [renderSlot(_ctx.$slots, "loading", {}, () => [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).is("loading")) }, { default: withCtx(() => [createVNode(unref(loading_default))]), _: 1 }, 8, ["class"])])])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(suggestions.value, (item, index) => { return openBlock(), createElementBlock("li", { id: `${unref(listboxId)}-item-${index}`, key: index, class: normalizeClass({ highlighted: highlightedIndex.value === index }), role: "option", "aria-selected": highlightedIndex.value === index, onClick: ($event) => handleSelect(item) }, [renderSlot(_ctx.$slots, "default", { item }, () => [createTextVNode(toDisplayString(item[__props.valueKey]), 1)])], 10, _hoisted_3$i); }), 128))]), _: 3 }, 8, [ "id", "wrap-class", "view-class" ]), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).be("suggestion", "footer")), onClick: _cache[1] || (_cache[1] = withModifiers(() => { }, ["stop"])) }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true) ], 6)]), default: withCtx(() => [createBaseVNode("div", { ref_key: "listboxRef", ref: listboxRef, class: normalizeClass([unref(ns).b(), _ctx.$attrs.class]), style: normalizeStyle(styles.value), role: "combobox", "aria-haspopup": "listbox", "aria-expanded": suggestionVisible.value, "aria-owns": unref(listboxId) }, [createVNode(unref(ElInput), mergeProps({ ref_key: "inputRef", ref: inputRef }, mergeProps(passInputProps.value, _ctx.$attrs), { "model-value": __props.modelValue, disabled: unref(disabled), onInput: handleInput, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onClear: handleClear, onKeydown: handleKeydown, onMousedown: handleMouseDown }), createSlots({ _: 2 }, [ _ctx.$slots.prepend ? { name: "prepend", fn: withCtx(() => [renderSlot(_ctx.$slots, "prepend")]), key: "0" } : void 0, _ctx.$slots.append ? { name: "append", fn: withCtx(() => [renderSlot(_ctx.$slots, "append")]), key: "1" } : void 0, _ctx.$slots.prefix ? { name: "prefix", fn: withCtx(() => [renderSlot(_ctx.$slots, "prefix")]), key: "2" } : void 0, _ctx.$slots.suffix ? { name: "suffix", fn: withCtx(() => [renderSlot(_ctx.$slots, "suffix")]), key: "3" } : void 0 ]), 1040, ["model-value", "disabled"])], 14, _hoisted_1$1a)]), _: 3 }, 8, [ "visible", "placement", "popper-class", "popper-style", "teleported", "append-to", "transition" ]); }; } }); var autocomplete_default = autocomplete_vue_vue_type_script_setup_true_lang_default; const ElAutocomplete = withInstall(autocomplete_default); const avatarProps = buildProps({ size: { type: [Number, String], values: componentSizes, validator: (val) => isNumber(val) }, shape: { type: String, values: ["circle", "square"] }, icon: { type: iconPropType }, src: { type: String, default: "" }, alt: String, srcSet: String, fit: { type: definePropType(String), default: "cover" } }); const avatarEmits = { error: (evt) => evt instanceof Event }; const avatarGroupContextKey = Symbol("avatarGroupContextKey"); const avatarGroupProps = { size: { type: definePropType([Number, String]), values: componentSizes, validator: (val) => isNumber(val) }, shape: { type: definePropType(String), values: ["circle", "square"] }, collapseAvatars: Boolean, collapseAvatarsTooltip: Boolean, maxCollapseAvatars: { type: Number, default: 1 }, effect: { type: definePropType(String), default: "light" }, placement: { type: definePropType(String), values: Ee, default: "top" }, popperClass: useTooltipContentProps.popperClass, popperStyle: useTooltipContentProps.popperStyle, collapseClass: String, collapseStyle: { type: definePropType([ String, Array, Object ]) } }; const _hoisted_1$19 = [ "src", "alt", "srcset" ]; var avatar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElAvatar", __name: "avatar", props: avatarProps, emits: avatarEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const avatarGroupContext = inject(avatarGroupContextKey, void 0); const ns = useNamespace("avatar"); const hasLoadError = ref(false); const size = computed(() => props2.size ?? (avatarGroupContext == null ? void 0 : avatarGroupContext.size)); const shape = computed(() => props2.shape ?? (avatarGroupContext == null ? void 0 : avatarGroupContext.shape) ?? "circle"); const avatarClass = computed(() => { const { icon } = props2; const classList = [ns.b()]; if (isString(size.value)) classList.push(ns.m(size.value)); if (icon) classList.push(ns.m("icon")); if (shape.value) classList.push(ns.m(shape.value)); return classList; }); const sizeStyle = computed(() => { return isNumber(size.value) ? ns.cssVarBlock({ size: addUnit(size.value) }) : void 0; }); const fitStyle = computed(() => ({ objectFit: props2.fit })); watch(() => [props2.src, props2.srcSet], () => hasLoadError.value = false); function handleError(e) { hasLoadError.value = true; emit("error", e); } return (_ctx, _cache) => { return openBlock(), createElementBlock("span", { class: normalizeClass(avatarClass.value), style: normalizeStyle(sizeStyle.value) }, [(__props.src || __props.srcSet) && !hasLoadError.value ? (openBlock(), createElementBlock("img", { key: 0, src: __props.src, alt: __props.alt, srcset: __props.srcSet, style: normalizeStyle(fitStyle.value), onError: handleError }, null, 44, _hoisted_1$19)) : __props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]), _: 1 })) : renderSlot(_ctx.$slots, "default", { key: 2 })], 6); }; } }); var avatar_default = avatar_vue_vue_type_script_setup_true_lang_default; var avatar_group_default = /* @__PURE__ */ defineComponent({ name: "ElAvatarGroup", props: avatarGroupProps, setup(props2, { slots }) { const ns = useNamespace("avatar-group"); provide(avatarGroupContextKey, reactive({ size: toRef(props2, "size"), shape: toRef(props2, "shape") })); return () => { var _a; const avatars = flattedChildren(((_a = slots.default) == null ? void 0 : _a.call(slots)) ?? []); let visibleAvatars = avatars; if (props2.collapseAvatars && avatars.length > props2.maxCollapseAvatars) { visibleAvatars = avatars.slice(0, props2.maxCollapseAvatars); const hiddenAvatars = avatars.slice(props2.maxCollapseAvatars); visibleAvatars.push(createVNode(ElTooltip, { "popperClass": props2.popperClass, "popperStyle": props2.popperStyle, "placement": props2.placement, "effect": props2.effect, "disabled": !props2.collapseAvatarsTooltip }, { default: () => createVNode(avatar_default, { "size": props2.size, "shape": props2.shape, "class": props2.collapseClass, "style": props2.collapseStyle }, { default: () => [createTextVNode("+ "), hiddenAvatars.length] }), content: () => createVNode("div", { "class": ns.e("collapse-avatars") }, [hiddenAvatars.map((node, idx) => isVNode(node) ? cloneVNode(node, { key: node.key ?? idx }) : node)]) })); } return createVNode("div", { "class": ns.b() }, [visibleAvatars]); }; } }); const ElAvatar = withInstall(avatar_default, { AvatarGroup: avatar_group_default }); const ElAvatarGroup = withNoopInstall(avatar_group_default); const backtopProps = { visibilityHeight: { type: Number, default: 200 }, target: { type: String, default: "" }, right: { type: Number, default: 40 }, bottom: { type: Number, default: 40 } }; const backtopEmits = { click: (evt) => evt instanceof MouseEvent }; const useBackTop = (props2, emit, componentName2) => { const el = shallowRef(); const container = shallowRef(); const visible = ref(false); const handleScroll2 = () => { if (el.value) visible.value = el.value.scrollTop >= props2.visibilityHeight; }; const handleClick = (event) => { var _a; (_a = el.value) == null ? void 0 : _a.scrollTo({ top: 0, behavior: "smooth" }); emit("click", event); }; useEventListener(container, "scroll", useThrottleFn(handleScroll2, 300, true)); onMounted(() => { container.value = document; el.value = document.documentElement; if (props2.target) { el.value = document.querySelector(props2.target) ?? void 0; if (!el.value) throwError(componentName2, `target does not exist: ${props2.target}`); container.value = el.value; } handleScroll2(); }); return { visible, handleClick }; }; const COMPONENT_NAME$f = "ElBacktop"; var backtop_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$f, __name: "backtop", props: backtopProps, emits: backtopEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("backtop"); const { handleClick, visible } = useBackTop(props2, emit, COMPONENT_NAME$f); const backTopStyle = computed(() => ({ right: `${props2.right}px`, bottom: `${props2.bottom}px` })); return (_ctx, _cache) => { return openBlock(), createBlock(Transition, { name: `${unref(ns).namespace.value}-fade-in` }, { default: withCtx(() => [unref(visible) ? (openBlock(), createElementBlock("div", { key: 0, style: normalizeStyle(backTopStyle.value), class: normalizeClass(unref(ns).b()), onClick: _cache[0] || (_cache[0] = withModifiers((...args) => unref(handleClick) && unref(handleClick)(...args), ["stop"])) }, [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).e("icon")) }, { default: withCtx(() => [createVNode(unref(caret_top_default))]), _: 1 }, 8, ["class"])])], 6)) : createCommentVNode("v-if", true)]), _: 3 }, 8, ["name"]); }; } }); var backtop_default = backtop_vue_vue_type_script_setup_true_lang_default; const ElBacktop = withInstall(backtop_default); const badgeProps = buildProps({ value: { type: [String, Number], default: "" }, max: { type: Number, default: 99 }, isDot: Boolean, hidden: Boolean, type: { type: String, values: [ "primary", "success", "warning", "info", "danger" ], default: "danger" }, showZero: { type: Boolean, default: true }, color: String, badgeStyle: { type: definePropType([ String, Object, Array ]) }, offset: { type: definePropType(Array), default: () => [0, 0] }, badgeClass: { type: String } }); var badge_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElBadge", __name: "badge", props: badgeProps, setup(__props, { expose: __expose }) { const props2 = __props; const ns = useNamespace("badge"); const content = computed(() => { if (props2.isDot) return ""; if (isNumber(props2.value) && isNumber(props2.max)) return props2.max < props2.value ? `${props2.max}+` : `${props2.value}`; return `${props2.value}`; }); const style = computed(() => { return [{ backgroundColor: props2.color, marginRight: addUnit(-props2.offset[0]), marginTop: addUnit(props2.offset[1]) }, props2.badgeStyle ?? {}]; }); __expose({ content }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [renderSlot(_ctx.$slots, "default"), createVNode(Transition, { name: `${unref(ns).namespace.value}-zoom-in-center` }, { default: withCtx(() => [!__props.hidden && (content.value || __props.isDot || _ctx.$slots.content) ? (openBlock(), createElementBlock("sup", { key: 0, class: normalizeClass([ unref(ns).e("content"), unref(ns).em("content", __props.type), unref(ns).is("fixed", !!_ctx.$slots.default), unref(ns).is("dot", __props.isDot), unref(ns).is("hide-zero", !__props.showZero && __props.value === 0), __props.badgeClass ]), style: normalizeStyle(style.value) }, [renderSlot(_ctx.$slots, "content", { value: content.value }, () => [createTextVNode(toDisplayString(content.value), 1)])], 6)) : createCommentVNode("v-if", true)]), _: 3 }, 8, ["name"])], 2); }; } }); var badge_default = badge_vue_vue_type_script_setup_true_lang_default; const ElBadge = withInstall(badge_default); const breadcrumbProps = buildProps({ separator: { type: String, default: "/" }, separatorIcon: { type: iconPropType } }); const breadcrumbKey = Symbol("breadcrumbKey"); const breadcrumbItemProps = buildProps({ to: { type: definePropType([String, Object]), default: "" }, replace: Boolean }); const _hoisted_1$18 = ["aria-label"]; var breadcrumb_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElBreadcrumb", __name: "breadcrumb", props: breadcrumbProps, setup(__props) { const { t } = useLocale(); const props2 = __props; const ns = useNamespace("breadcrumb"); const breadcrumb = ref(); provide(breadcrumbKey, props2); onMounted(() => { const items = breadcrumb.value.querySelectorAll(`.${ns.e("item")}`); if (items.length) items[items.length - 1].setAttribute("aria-current", "page"); }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "breadcrumb", ref: breadcrumb, class: normalizeClass(unref(ns).b()), "aria-label": unref(t)("el.breadcrumb.label"), role: "navigation" }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$18); }; } }); var breadcrumb_default = breadcrumb_vue_vue_type_script_setup_true_lang_default; var breadcrumb_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElBreadcrumbItem", __name: "breadcrumb-item", props: breadcrumbItemProps, setup(__props) { const props2 = __props; const instance = getCurrentInstance(); const breadcrumbContext = inject(breadcrumbKey, void 0); const ns = useNamespace("breadcrumb"); const router = instance.appContext.config.globalProperties.$router; const onClick = () => { if (!props2.to || !router) return; props2.replace ? router.replace(props2.to) : router.push(props2.to); }; return (_ctx, _cache) => { var _a, _b; return openBlock(), createElementBlock("span", { class: normalizeClass(unref(ns).e("item")) }, [createBaseVNode("span", { class: normalizeClass([unref(ns).e("inner"), unref(ns).is("link", !!__props.to)]), role: "link", onClick }, [renderSlot(_ctx.$slots, "default")], 2), ((_a = unref(breadcrumbContext)) == null ? void 0 : _a.separatorIcon) ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(unref(ns).e("separator")) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(unref(breadcrumbContext).separatorIcon)))]), _: 1 }, 8, ["class"])) : (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(unref(ns).e("separator")), role: "presentation" }, toDisplayString((_b = unref(breadcrumbContext)) == null ? void 0 : _b.separator), 3))], 2); }; } }); var breadcrumb_item_default = breadcrumb_item_vue_vue_type_script_setup_true_lang_default; const ElBreadcrumb = withInstall(breadcrumb_default, { BreadcrumbItem: breadcrumb_item_default }); const ElBreadcrumbItem = withNoopInstall(breadcrumb_item_default); const buttonTypes = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ]; const buttonNativeTypes = [ "button", "submit", "reset" ]; const buttonProps = buildProps({ size: useSizeProp, disabled: { type: Boolean, default: void 0 }, type: { type: String, values: buttonTypes, default: "" }, icon: { type: iconPropType }, nativeType: { type: String, values: buttonNativeTypes, default: "button" }, loading: Boolean, loadingIcon: { type: iconPropType, default: () => loading_default }, plain: { type: Boolean, default: void 0 }, text: { type: Boolean, default: void 0 }, link: Boolean, bg: Boolean, autofocus: Boolean, round: { type: Boolean, default: void 0 }, circle: Boolean, dashed: { type: Boolean, default: void 0 }, color: String, dark: Boolean, autoInsertSpace: { type: Boolean, default: void 0 }, tag: { type: definePropType([String, Object]), default: "button" } }); const buttonEmits = { click: (evt) => evt instanceof MouseEvent }; const configProviderContextKey = Symbol(); const globalConfig = ref(); function useGlobalConfig(key, defaultValue = void 0) { const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig; if (key) return computed(() => { var _a; return ((_a = config.value) == null ? void 0 : _a[key]) ?? defaultValue; }); else return config; } function useGlobalComponentSettings(block, sizeFallback) { const config = useGlobalConfig(); const ns = useNamespace(block, computed(() => { var _a; return ((_a = config.value) == null ? void 0 : _a.namespace) || defaultNamespace; })); const locale = useLocale(computed(() => { var _a; return (_a = config.value) == null ? void 0 : _a.locale; })); const zIndex2 = useZIndex(computed(() => { var _a; return ((_a = config.value) == null ? void 0 : _a.zIndex) || defaultInitialZIndex; })); const size = computed(() => { var _a; return unref(sizeFallback) || ((_a = config.value) == null ? void 0 : _a.size) || ""; }); provideGlobalConfig(computed(() => unref(config) || {})); return { ns, locale, zIndex: zIndex2, size }; } const provideGlobalConfig = (config, app, global = false) => { const inSetup = !!getCurrentInstance(); const oldConfig = inSetup ? useGlobalConfig() : void 0; const provideFn = (app == null ? void 0 : app.provide) ?? (inSetup ? provide : void 0); if (!provideFn) { debugWarn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup()."); return; } const context = computed(() => { const cfg = unref(config); if (!(oldConfig == null ? void 0 : oldConfig.value)) return cfg; return mergeConfig(oldConfig.value, cfg); }); provideFn(configProviderContextKey, context); provideFn(localeContextKey, computed(() => context.value.locale)); provideFn(namespaceContextKey, computed(() => context.value.namespace)); provideFn(zIndexContextKey, computed(() => context.value.zIndex)); provideFn(SIZE_INJECTION_KEY, { size: computed(() => context.value.size || "") }); provideFn(emptyValuesContextKey, computed(() => ({ emptyValues: context.value.emptyValues, valueOnClear: context.value.valueOnClear }))); if (global || !globalConfig.value) globalConfig.value = context.value; return context; }; const mergeConfig = (a, b) => { const keys = [.../* @__PURE__ */ new Set([...keysOf(a), ...keysOf(b)])]; const obj = {}; for (const key of keys) obj[key] = b[key] !== void 0 ? b[key] : a[key]; return obj; }; const configProviderProps = buildProps({ a11y: { type: Boolean, default: true }, locale: { type: definePropType(Object) }, size: useSizeProp, button: { type: definePropType(Object) }, card: { type: definePropType(Object) }, dialog: { type: definePropType(Object) }, link: { type: definePropType(Object) }, experimentalFeatures: { type: definePropType(Object) }, keyboardNavigation: { type: Boolean, default: true }, message: { type: definePropType(Object) }, zIndex: Number, namespace: { type: String, default: "el" }, table: { type: definePropType(Object) }, ...useEmptyValuesProps }); const messageConfig = { placement: "top" }; const ConfigProvider = defineComponent({ name: "ElConfigProvider", props: configProviderProps, setup(props2, { slots }) { const config = provideGlobalConfig(props2); watch(() => props2.message, (val) => { var _a; Object.assign(messageConfig, ((_a = config == null ? void 0 : config.value) == null ? void 0 : _a.message) ?? {}, val ?? {}); }, { immediate: true, deep: true }); return () => renderSlot(slots, "default", { config: config == null ? void 0 : config.value }); } }); const ElConfigProvider = withInstall(ConfigProvider); const buttonGroupContextKey = Symbol("buttonGroupContextKey"); const useButton = (props2, emit) => { useDeprecated({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, computed(() => props2.type === "text")); const buttonGroupContext = inject(buttonGroupContextKey, void 0); const globalConfig2 = useGlobalConfig("button"); const { form } = useFormItem(); const _size = useFormSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size)); const _disabled = useFormDisabled(); const _ref = ref(); const slots = useSlots(); const _type = computed(() => { var _a; return props2.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || ((_a = globalConfig2.value) == null ? void 0 : _a.type) || ""; }); const autoInsertSpace = computed(() => { var _a; return props2.autoInsertSpace ?? ((_a = globalConfig2.value) == null ? void 0 : _a.autoInsertSpace) ?? false; }); const _plain = computed(() => { var _a; return props2.plain ?? ((_a = globalConfig2.value) == null ? void 0 : _a.plain) ?? false; }); const _round = computed(() => { var _a; return props2.round ?? ((_a = globalConfig2.value) == null ? void 0 : _a.round) ?? false; }); const _text = computed(() => { var _a; return props2.text ?? ((_a = globalConfig2.value) == null ? void 0 : _a.text) ?? false; }); const _dashed = computed(() => { var _a; return props2.dashed ?? ((_a = globalConfig2.value) == null ? void 0 : _a.dashed) ?? false; }); const _props = computed(() => { if (props2.tag === "button") return { ariaDisabled: _disabled.value || props2.loading, disabled: _disabled.value || props2.loading, autofocus: props2.autofocus, type: props2.nativeType }; return {}; }); const shouldAddSpace = computed(() => { var _a; const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots); if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) { const slot = defaultSlot[0]; if ((slot == null ? void 0 : slot.type) === Text) { const text = slot.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(text.trim()); } } return false; }); const handleClick = (evt) => { if (_disabled.value || props2.loading) { evt.stopPropagation(); return; } if (props2.nativeType === "reset") form == null ? void 0 : form.resetFields(); emit("click", evt); }; return { _disabled, _size, _type, _ref, _props, _plain, _round, _text, _dashed, shouldAddSpace, handleClick }; }; function darken(color, amount = 20) { return color.mix("#141414", amount).toString(); } function useButtonCustomStyle(props2) { const _disabled = useFormDisabled(); const ns = useNamespace("button"); return computed(() => { let styles = {}; let buttonColor = props2.color; if (buttonColor) { const match = buttonColor.match(/var\((.*?)\)/); if (match) buttonColor = window.getComputedStyle(window.document.documentElement).getPropertyValue(match[1]); const color = new TinyColor(buttonColor); const activeBgColor = props2.dark ? color.tint(20).toString() : darken(color, 20); if (props2.plain) { styles = ns.cssVarBlock({ "bg-color": props2.dark ? darken(color, 90) : color.tint(90).toString(), "text-color": buttonColor, "border-color": props2.dark ? darken(color, 50) : color.tint(50).toString(), "hover-text-color": `var(${ns.cssVarName("color-white")})`, "hover-bg-color": buttonColor, "hover-border-color": buttonColor, "active-bg-color": activeBgColor, "active-text-color": `var(${ns.cssVarName("color-white")})`, "active-border-color": activeBgColor }); if (_disabled.value) { styles[ns.cssVarBlockName("disabled-bg-color")] = props2.dark ? darken(color, 90) : color.tint(90).toString(); styles[ns.cssVarBlockName("disabled-text-color")] = props2.dark ? darken(color, 50) : color.tint(50).toString(); styles[ns.cssVarBlockName("disabled-border-color")] = props2.dark ? darken(color, 80) : color.tint(80).toString(); } } else if (props2.link || props2.text) { const hoverColor = props2.dark ? darken(color, 30) : color.tint(30).toString(); styles = ns.cssVarBlock({ "text-color": buttonColor, "hover-text-color": hoverColor, "active-text-color": activeBgColor }); if (props2.link) { styles[ns.cssVarBlockName("hover-link-text-color")] = hoverColor; styles[ns.cssVarBlockName("active-color")] = activeBgColor; } if (_disabled.value) { const disabledColor = props2.dark ? darken(color, 50) : color.tint(50).toString(); styles[ns.cssVarBlockName("disabled-bg-color")] = "transparent"; styles[ns.cssVarBlockName("disabled-text-color")] = disabledColor; styles[ns.cssVarBlockName("disabled-border-color")] = "transparent"; } } else { const hoverBgColor = props2.dark ? darken(color, 30) : color.tint(30).toString(); const textColor = color.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`; styles = ns.cssVarBlock({ "bg-color": buttonColor, "text-color": textColor, "border-color": buttonColor, "hover-bg-color": hoverBgColor, "hover-text-color": textColor, "hover-border-color": hoverBgColor, "active-bg-color": activeBgColor, "active-border-color": activeBgColor }); if (_disabled.value) { const disabledButtonColor = props2.dark ? darken(color, 50) : color.tint(50).toString(); styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor; styles[ns.cssVarBlockName("disabled-text-color")] = props2.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`; styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor; } } } return styles; }); } var button_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ defineComponent({ name: "ElButton", __name: "button", props: buttonProps, emits: buttonEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const buttonStyle = useButtonCustomStyle(props2); const ns = useNamespace("button"); const { _ref, _size, _type, _disabled, _props, _plain, _round, _text, _dashed, shouldAddSpace, handleClick } = useButton(props2, emit); const buttonKls = computed(() => [ ns.b(), ns.m(_type.value), ns.m(_size.value), ns.is("disabled", _disabled.value), ns.is("loading", props2.loading), ns.is("plain", _plain.value), ns.is("round", _round.value), ns.is("circle", props2.circle), ns.is("text", _text.value), ns.is("dashed", _dashed.value), ns.is("link", props2.link), ns.is("has-bg", props2.bg) ]); __expose({ ref: _ref, size: _size, type: _type, disabled: _disabled, shouldAddSpace }); return (_ctx, _cache) => { return openBlock(), createBlock(resolveDynamicComponent(__props.tag), mergeProps({ ref_key: "_ref", ref: _ref }, unref(_props), { class: buttonKls.value, style: unref(buttonStyle), onClick: unref(handleClick) }), { default: withCtx(() => [__props.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), { key: 1, class: normalizeClass(unref(ns).is("loading")) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.loadingIcon)))]), _: 1 }, 8, ["class"]))], 64)) : __props.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, { default: withCtx(() => [__props.icon ? (openBlock(), createBlock(resolveDynamicComponent(__props.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })]), _: 3 })) : createCommentVNode("v-if", true), _ctx.$slots.default ? (openBlock(), createElementBlock("span", { key: 2, class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) }) }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true)]), _: 3 }, 16, [ "class", "style", "onClick" ]); }; } }); var button_default$1 = button_vue_vue_type_script_setup_true_lang_default$1; const buttonGroupProps = { size: buttonProps.size, type: buttonProps.type, direction: { type: definePropType(String), values: ["horizontal", "vertical"], default: "horizontal" } }; var button_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElButtonGroup", __name: "button-group", props: buttonGroupProps, setup(__props) { const props2 = __props; provide(buttonGroupContextKey, reactive({ size: toRef(props2, "size"), type: toRef(props2, "type") })); const ns = useNamespace("button"); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b("group"), unref(ns).bm("group", props2.direction)]) }, [renderSlot(_ctx.$slots, "default")], 2); }; } }); var button_group_default = button_group_vue_vue_type_script_setup_true_lang_default; const ElButton = withInstall(button_default$1, { ButtonGroup: button_group_default }); const ElButtonGroup$1 = withNoopInstall(button_group_default); const isValidRange$1 = (range) => isArray(range) && range.length === 2 && range.every((item) => isDate(item)); const calendarProps = buildProps({ modelValue: { type: Date }, range: { type: definePropType(Array), validator: isValidRange$1 }, controllerType: { type: String, values: ["button", "select"], default: "button" }, formatter: { type: definePropType(Function) } }); const calendarEmits = { [UPDATE_MODEL_EVENT]: (value) => isDate(value), [INPUT_EVENT]: (value) => isDate(value) }; const timeUnits$1 = [ "hours", "minutes", "seconds" ]; const PICKER_BASE_INJECTION_KEY = "EP_PICKER_BASE"; const PICKER_POPPER_OPTIONS_INJECTION_KEY = "ElPopperOptions"; const ROOT_COMMON_PICKER_INJECTION_KEY = Symbol("commonPickerContextKey"); const DEFAULT_FORMATS_TIME = "HH:mm:ss"; const DEFAULT_FORMATS_DATE = "YYYY-MM-DD"; const DEFAULT_FORMATS_DATEPICKER = { date: DEFAULT_FORMATS_DATE, dates: DEFAULT_FORMATS_DATE, week: "gggg[w]ww", year: "YYYY", years: "YYYY", month: "YYYY-MM", months: "YYYY-MM", datetime: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`, monthrange: "YYYY-MM", yearrange: "YYYY", daterange: DEFAULT_FORMATS_DATE, datetimerange: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}` }; const buildTimeList = (value, bound) => { return [ value > 0 ? value - 1 : void 0, value, value < bound ? value + 1 : void 0 ]; }; const rangeArr = (n) => Array.from(Array.from({ length: n }).keys()); const extractDateFormat = (format) => { return format.replace(/\W?m{1,2}|\W?ZZ/g, "").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, "").trim(); }; const extractTimeFormat = (format) => { return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g, "").trim(); }; const dateEquals = function(a, b) { const aIsDate = isDate(a); const bIsDate = isDate(b); if (aIsDate && bIsDate) return a.getTime() === b.getTime(); if (!aIsDate && !bIsDate) return a === b; return false; }; const valueEquals = function(a, b) { const aIsArray = isArray(a); const bIsArray = isArray(b); if (aIsArray && bIsArray) { if (a.length !== b.length) return false; return a.every((item, index) => dateEquals(item, b[index])); } if (!aIsArray && !bIsArray) return dateEquals(a, b); return false; }; const parseDate = function(date, format, lang) { const day = isEmpty(format) || format === "x" ? dayjs(date).locale(lang) : dayjs(date, format).locale(lang); return day.isValid() ? day : void 0; }; const formatter = function(date, format, lang) { if (isEmpty(format)) return date; if (format === "x") return +date; return dayjs(date).locale(lang).format(format); }; const makeList = (total2, method) => { const arr = []; const disabledArr = method == null ? void 0 : method(); for (let i = 0; i < total2; i++) arr.push((disabledArr == null ? void 0 : disabledArr.includes(i)) ?? false); return arr; }; const dayOrDaysToDate = (dayOrDays) => { return isArray(dayOrDays) ? dayOrDays.map((d) => d.toDate()) : dayOrDays.toDate(); }; const disabledTimeListsProps = buildProps({ disabledHours: { type: definePropType(Function) }, disabledMinutes: { type: definePropType(Function) }, disabledSeconds: { type: definePropType(Function) } }); const timePanelSharedProps = buildProps({ visible: Boolean, actualVisible: { type: Boolean, default: void 0 }, format: { type: String, default: "" } }); const timePickerDefaultProps = buildProps({ automaticDropdown: { type: Boolean, default: true }, id: { type: definePropType([Array, String]) }, name: { type: definePropType([Array, String]) }, popperClass: useTooltipContentProps.popperClass, popperStyle: useTooltipContentProps.popperStyle, format: String, valueFormat: String, dateFormat: String, timeFormat: String, type: { type: String, default: "" }, clearable: { type: Boolean, default: true }, clearIcon: { type: definePropType([String, Object]), default: circle_close_default }, editable: { type: Boolean, default: true }, saveOnBlur: { type: Boolean, default: true }, prefixIcon: { type: definePropType([String, Object]), default: "" }, size: useSizeProp, readonly: Boolean, disabled: { type: Boolean, default: void 0 }, placeholder: { type: String, default: "" }, popperOptions: { type: definePropType(Object), default: () => ({}) }, modelValue: { type: definePropType([ Date, Array, String, Number ]), default: "" }, rangeSeparator: { type: String, default: "-" }, startPlaceholder: String, endPlaceholder: String, defaultValue: { type: definePropType([Date, Array]) }, defaultTime: { type: definePropType([Date, Array]) }, isRange: Boolean, ...disabledTimeListsProps, disabledDate: { type: Function }, cellClassName: { type: Function }, shortcuts: { type: Array, default: () => [] }, arrowControl: Boolean, tabindex: { type: definePropType([String, Number]), default: 0 }, validateEvent: { type: Boolean, default: true }, unlinkPanels: Boolean, placement: { type: definePropType(String), values: Ee, default: "bottom" }, fallbackPlacements: { type: definePropType(Array), default: [ "bottom", "top", "right", "left" ] }, ...useEmptyValuesProps, ...useAriaProps(["ariaLabel"]), showNow: { type: Boolean, default: true }, showConfirm: { type: Boolean, default: true }, showFooter: { type: Boolean, default: true }, showWeekNumber: Boolean }); const timePickerRangeTriggerProps = buildProps({ id: { type: definePropType(Array) }, name: { type: definePropType(Array) }, modelValue: { type: definePropType([Array, String]) }, startPlaceholder: String, endPlaceholder: String, disabled: Boolean }); const useCommonPicker = (props2, emit) => { const { lang } = useLocale(); const pickerVisible = ref(false); const pickerActualVisible = ref(false); const userInput = ref(null); const valueIsEmpty = computed(() => { const { modelValue } = props2; return !modelValue || isArray(modelValue) && !modelValue.filter(Boolean).length; }); const emitInput = (input) => { if (!valueEquals(props2.modelValue, input)) { let formatted; if (isArray(input)) formatted = input.map((item) => formatter(item, props2.valueFormat, lang.value)); else if (input) formatted = formatter(input, props2.valueFormat, lang.value); emit(UPDATE_MODEL_EVENT, input ? formatted : input, lang.value); } }; const parsedValue = computed(() => { let dayOrDays; if (valueIsEmpty.value) { if (pickerOptions.value.getDefaultValue) dayOrDays = pickerOptions.value.getDefaultValue(); } else if (isArray(props2.modelValue)) dayOrDays = props2.modelValue.map((d) => parseDate(d, props2.valueFormat, lang.value)); else dayOrDays = parseDate(props2.modelValue ?? "", props2.valueFormat, lang.value); if (pickerOptions.value.getRangeAvailableTime) { const availableResult = pickerOptions.value.getRangeAvailableTime(dayOrDays); if (!isEqual(availableResult, dayOrDays)) { dayOrDays = availableResult; if (!valueIsEmpty.value) emitInput(dayOrDaysToDate(dayOrDays)); } } if (isArray(dayOrDays) && dayOrDays.some((day) => !day)) dayOrDays = []; return dayOrDays; }); const pickerOptions = ref({}); const onSetPickerOption = (e) => { pickerOptions.value[e[0]] = e[1]; pickerOptions.value.panelReady = true; }; const onCalendarChange = (e) => { emit("calendar-change", e); }; const onPanelChange = (value, mode, view) => { emit("panel-change", value, mode, view); }; const onPick = (date = "", visible = false) => { pickerVisible.value = visible; let result; if (isArray(date)) result = date.map((_) => _.toDate()); else result = date ? date.toDate() : date; userInput.value = null; emitInput(result); }; return { parsedValue, pickerActualVisible, pickerOptions, pickerVisible, userInput, valueIsEmpty, emitInput, onCalendarChange, onPanelChange, onPick, onSetPickerOption }; }; const _hoisted_1$17 = [ "id", "name", "placeholder", "value", "disabled" ]; const _hoisted_2$E = [ "id", "name", "placeholder", "value", "disabled" ]; var picker_range_trigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "PickerRangeTrigger", inheritAttrs: false, __name: "picker-range-trigger", props: timePickerRangeTriggerProps, emits: [ "mouseenter", "mouseleave", "click", "touchstart", "focus", "blur", "startInput", "endInput", "startChange", "endChange" ], setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const { formItem } = useFormItem(); const { inputId } = useFormItemInputId(reactive({ id: computed(() => { var _a; return (_a = props2.id) == null ? void 0 : _a[0]; }) }), { formItemContext: formItem }); const attrs = useAttrs(); const nsDate = useNamespace("date"); const nsRange = useNamespace("range"); const inputRef = ref(); const endInputRef = ref(); const { wrapperRef, isFocused } = useFocusController(inputRef, { disabled: computed(() => props2.disabled) }); const handleClick = (evt) => { emit("click", evt); }; const handleMouseEnter = (evt) => { emit("mouseenter", evt); }; const handleMouseLeave = (evt) => { emit("mouseleave", evt); }; const handleTouchStart = (evt) => { emit("touchstart", evt); }; const handleStartInput = (evt) => { emit("startInput", evt); }; const handleEndInput = (evt) => { emit("endInput", evt); }; const handleStartChange = (evt) => { emit("startChange", evt); }; const handleEndChange = (evt) => { emit("endChange", evt); }; const focus = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.focus(); }; const blur = () => { var _a, _b; (_a = inputRef.value) == null ? void 0 : _a.blur(); (_b = endInputRef.value) == null ? void 0 : _b.blur(); }; __expose({ focus, blur }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "wrapperRef", ref: wrapperRef, class: normalizeClass([unref(nsDate).is("active", unref(isFocused)), _ctx.$attrs.class]), style: normalizeStyle(_ctx.$attrs.style), onClick: handleClick, onMouseenter: handleMouseEnter, onMouseleave: handleMouseLeave, onTouchstartPassive: handleTouchStart }, [ renderSlot(_ctx.$slots, "prefix"), createBaseVNode("input", mergeProps(unref(attrs), { id: unref(inputId), ref_key: "inputRef", ref: inputRef, name: _ctx.name && _ctx.name[0], placeholder: _ctx.startPlaceholder, value: _ctx.modelValue && _ctx.modelValue[0], class: unref(nsRange).b("input"), disabled: _ctx.disabled, onInput: handleStartInput, onChange: handleStartChange }), null, 16, _hoisted_1$17), renderSlot(_ctx.$slots, "range-separator"), createBaseVNode("input", mergeProps(unref(attrs), { id: _ctx.id && _ctx.id[1], ref_key: "endInputRef", ref: endInputRef, name: _ctx.name && _ctx.name[1], placeholder: _ctx.endPlaceholder, value: _ctx.modelValue && _ctx.modelValue[1], class: unref(nsRange).b("input"), disabled: _ctx.disabled, onInput: handleEndInput, onChange: handleEndChange }), null, 16, _hoisted_2$E), renderSlot(_ctx.$slots, "suffix") ], 38); }; } }); var picker_range_trigger_default = picker_range_trigger_vue_vue_type_script_setup_true_lang_default; var picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "Picker", __name: "picker", props: timePickerDefaultProps, emits: [ UPDATE_MODEL_EVENT, CHANGE_EVENT, "focus", "blur", "clear", "calendar-change", "panel-change", "visible-change", "keydown" ], setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const attrs = useAttrs$1(); const nsDate = useNamespace("date"); const nsInput = useNamespace("input"); const nsRange = useNamespace("range"); const { formItem } = useFormItem(); const elPopperOptions = inject(PICKER_POPPER_OPTIONS_INJECTION_KEY, {}); const emptyValues = useEmptyValues(props2, null); const refPopper = ref(); const inputRef = ref(); const valueOnOpen = ref(null); let hasJustTabExitedInput = false; const pickerDisabled = useFormDisabled(); const commonPicker = useCommonPicker(props2, emit); const { parsedValue, pickerActualVisible, userInput, pickerVisible, pickerOptions, valueIsEmpty, emitInput, onPick, onSetPickerOption, onCalendarChange, onPanelChange } = commonPicker; const { isFocused, handleFocus, handleBlur } = useFocusController(inputRef, { disabled: pickerDisabled, beforeFocus() { return props2.readonly; }, afterFocus() { if (!props2.automaticDropdown) return; pickerVisible.value = true; }, beforeBlur(event) { var _a; return !hasJustTabExitedInput && ((_a = refPopper.value) == null ? void 0 : _a.isFocusInsideContent(event)); }, afterBlur() { var _a, _b; if (isTimePicker.value && !props2.saveOnBlur) { if (!valueIsEmpty.value) (_b = (_a = pickerOptions.value).handleCancel) == null ? void 0 : _b.call(_a); } else handleChange(); pickerVisible.value = false; hasJustTabExitedInput = false; props2.validateEvent && (formItem == null ? void 0 : formItem.validate("blur").catch((err) => debugWarn(err))); } }); const hovering = ref(false); const rangeInputKls = computed(() => [ nsDate.b("editor"), nsDate.bm("editor", props2.type), nsInput.e("wrapper"), nsDate.is("disabled", pickerDisabled.value), nsDate.is("active", pickerVisible.value), nsRange.b("editor"), pickerSize ? nsRange.bm("editor", pickerSize.value) : "", attrs.class ]); const clearIconKls = computed(() => [ nsInput.e("icon"), nsRange.e("close-icon"), !showClearBtn.value ? nsRange.em("close-icon", "hidden") : "" ]); watch(pickerVisible, (val) => { if (!val) { userInput.value = null; nextTick(() => { emitChange(props2.modelValue); }); } else nextTick(() => { if (val) valueOnOpen.value = props2.modelValue; }); }); const emitChange = (val, isClear) => { if (isClear || !valueEquals(val, valueOnOpen.value)) { emit(CHANGE_EVENT, val); isClear && (valueOnOpen.value = val); props2.validateEvent && (formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err))); } }; const emitKeydown = (e) => { emit("keydown", e); }; const refInput = computed(() => { if (inputRef.value) return Array.from(inputRef.value.$el.querySelectorAll("input")); return []; }); const setSelectionRange = (start, end, pos) => { const _inputs = refInput.value; if (!_inputs.length) return; if (!pos || pos === "min") { _inputs[0].setSelectionRange(start, end); _inputs[0].focus(); } else if (pos === "max") { _inputs[1].setSelectionRange(start, end); _inputs[1].focus(); } }; const onBeforeShow = () => { pickerActualVisible.value = true; }; const onShow = () => { emit("visible-change", true); }; const onHide = () => { pickerActualVisible.value = false; pickerVisible.value = false; emit("visible-change", false); }; const handleOpen = () => { pickerVisible.value = true; }; const handleClose = () => { pickerVisible.value = false; }; const displayValue = computed(() => { const formattedValue = formatToString(parsedValue.value); if (isArray(userInput.value)) return [userInput.value[0] ?? (formattedValue && formattedValue[0]) ?? "", userInput.value[1] ?? (formattedValue && formattedValue[1]) ?? ""]; else if (userInput.value !== null) return userInput.value; if (isTimePicker.value && valueIsEmpty.value && !props2.saveOnBlur) return ""; if (!isTimePicker.value && valueIsEmpty.value) return ""; if (!pickerVisible.value && valueIsEmpty.value) return ""; if (formattedValue) return isDatesPicker.value || isMonthsPicker.value || isYearsPicker.value ? formattedValue.join(", ") : formattedValue; return ""; }); const isTimeLikePicker = computed(() => props2.type.includes("time")); const isTimePicker = computed(() => props2.type.startsWith("time")); const isDatesPicker = computed(() => props2.type === "dates"); const isMonthsPicker = computed(() => props2.type === "months"); const isYearsPicker = computed(() => props2.type === "years"); const triggerIcon = computed(() => props2.prefixIcon || (isTimeLikePicker.value ? clock_default : calendar_default$1)); const showClearBtn = computed(() => props2.clearable && !pickerDisabled.value && !props2.readonly && !valueIsEmpty.value && (hovering.value || isFocused.value)); const onClear = (event) => { if (props2.readonly || pickerDisabled.value) return; if (showClearBtn.value) { event == null ? void 0 : event.stopPropagation(); if (pickerOptions.value.handleClear) pickerOptions.value.handleClear(); else emitInput(emptyValues.valueOnClear.value); emitChange(emptyValues.valueOnClear.value, true); onHide(); } emit("clear"); }; const onMouseDownInput = async (event) => { var _a; if (props2.readonly || pickerDisabled.value) return; if (((_a = event.target) == null ? void 0 : _a.tagName) !== "INPUT" || isFocused.value || !props2.automaticDropdown) pickerVisible.value = true; }; const onMouseEnter = () => { if (props2.readonly || pickerDisabled.value) return; if (!valueIsEmpty.value && props2.clearable) hovering.value = true; }; const onMouseLeave = () => { hovering.value = false; }; const onTouchStartInput = (event) => { var _a; if (props2.readonly || pickerDisabled.value) return; if (((_a = event.touches[0].target) == null ? void 0 : _a.tagName) !== "INPUT" || isFocused.value || !props2.automaticDropdown) pickerVisible.value = true; }; const isRangeInput = computed(() => { return props2.type.includes("range"); }); const pickerSize = useFormSize(); const popperEl = computed(() => { var _a, _b; return (_b = (_a = unref(refPopper)) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef; }); const stophandle = onClickOutside(inputRef, (e) => { const unrefedPopperEl = unref(popperEl); const inputEl = unrefElement(inputRef); if (unrefedPopperEl && (e.target === unrefedPopperEl || e.composedPath().includes(unrefedPopperEl)) || e.target === inputEl || inputEl && e.composedPath().includes(inputEl)) return; pickerVisible.value = false; }); onBeforeUnmount(() => { stophandle == null ? void 0 : stophandle(); }); const handleChange = () => { if (isTimePicker.value && !props2.saveOnBlur) return; const isRangeEmpty = isArray(userInput.value) && userInput.value.every((v) => v === ""); if (userInput.value && !isRangeEmpty) { const value = parseUserInputToDayjs(displayValue.value); if (value) { if (isValidValue2(value)) emitInput(dayOrDaysToDate(value)); userInput.value = null; } } if (userInput.value === "" || isRangeEmpty) { emitInput(emptyValues.valueOnClear.value); emitChange(emptyValues.valueOnClear.value, true); userInput.value = null; } }; const parseUserInputToDayjs = (value) => { if (!value) return null; return pickerOptions.value.parseUserInput(value); }; const formatToString = (value) => { if (!value) return null; return isArray(value) ? value.map((_) => _.format(props2.format)) : value.format(props2.format); }; const isValidValue2 = (value) => { return pickerOptions.value.isValidValue(value); }; const handleKeydownInput = async (event) => { if (props2.readonly || pickerDisabled.value) return; const code = getEventCode(event); emitKeydown(event); if (code === EVENT_CODE.esc) { if (pickerVisible.value === true) { pickerVisible.value = false; event.preventDefault(); event.stopPropagation(); } return; } if (code === EVENT_CODE.down) { if (pickerOptions.value.handleFocusPicker) { event.preventDefault(); event.stopPropagation(); } if (pickerVisible.value === false) { pickerVisible.value = true; await nextTick(); } if (pickerOptions.value.handleFocusPicker) { pickerOptions.value.handleFocusPicker(); return; } } if (code === EVENT_CODE.tab) { hasJustTabExitedInput = true; return; } if (code === EVENT_CODE.enter || code === EVENT_CODE.numpadEnter) { if (!pickerVisible.value) pickerVisible.value = true; else if (userInput.value === null || userInput.value === "" || isValidValue2(parseUserInputToDayjs(displayValue.value))) { handleChange(); pickerVisible.value = false; } event.preventDefault(); event.stopPropagation(); return; } if (userInput.value) { event.stopPropagation(); return; } if (pickerOptions.value.handleKeydownInput) pickerOptions.value.handleKeydownInput(event); }; const onUserInput = (e) => { userInput.value = e; if (!pickerVisible.value) pickerVisible.value = true; }; const handleStartInput = (event) => { const target = event.target; if (userInput.value) userInput.value = [target.value, userInput.value[1]]; else userInput.value = [target.value, null]; }; const handleEndInput = (event) => { const target = event.target; if (userInput.value) userInput.value = [userInput.value[0], target.value]; else userInput.value = [null, target.value]; }; const handleStartChange = () => { var _a; const values = userInput.value; const value = parseUserInputToDayjs(values && values[0]); const parsedVal = unref(parsedValue); if (value && value.isValid()) { userInput.value = [formatToString(value), ((_a = displayValue.value) == null ? void 0 : _a[1]) || null]; const newValue = [value, parsedVal && (parsedVal[1] || null)]; if (isValidValue2(newValue)) { emitInput(dayOrDaysToDate(newValue)); userInput.value = null; } } }; const handleEndChange = () => { var _a; const values = unref(userInput); const value = parseUserInputToDayjs(values && values[1]); const parsedVal = unref(parsedValue); if (value && value.isValid()) { userInput.value = [((_a = unref(displayValue)) == null ? void 0 : _a[0]) || null, formatToString(value)]; const newValue = [parsedVal && parsedVal[0], value]; if (isValidValue2(newValue)) { emitInput(dayOrDaysToDate(newValue)); userInput.value = null; } } }; const focus = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.blur(); }; provide(PICKER_BASE_INJECTION_KEY, { props: props2, emptyValues }); provide(ROOT_COMMON_PICKER_INJECTION_KEY, commonPicker); __expose({ focus, blur, handleOpen, handleClose, onPick }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTooltip), mergeProps({ ref_key: "refPopper", ref: refPopper, visible: unref(pickerVisible), effect: "light", pure: "", trigger: "click" }, _ctx.$attrs, { role: "dialog", teleported: "", transition: `${unref(nsDate).namespace.value}-zoom-in-top`, "popper-class": [`${unref(nsDate).namespace.value}-picker__popper`, _ctx.popperClass], "popper-style": _ctx.popperStyle, "popper-options": unref(elPopperOptions), "fallback-placements": _ctx.fallbackPlacements, "gpu-acceleration": false, placement: _ctx.placement, "stop-popper-mouse-event": false, "hide-after": 0, persistent: "", onBeforeShow, onShow, onHide }), { default: withCtx(() => [!isRangeInput.value ? (openBlock(), createBlock(unref(ElInput), { key: 0, id: _ctx.id, ref_key: "inputRef", ref: inputRef, "container-role": "combobox", "model-value": displayValue.value, name: _ctx.name, size: unref(pickerSize), disabled: unref(pickerDisabled), placeholder: _ctx.placeholder, class: normalizeClass([ unref(nsDate).b("editor"), unref(nsDate).bm("editor", _ctx.type), unref(nsDate).is("focus", unref(pickerVisible)), _ctx.$attrs.class ]), style: normalizeStyle(_ctx.$attrs.style), readonly: !_ctx.editable || _ctx.readonly || isDatesPicker.value || isMonthsPicker.value || isYearsPicker.value || _ctx.type === "week", "aria-label": _ctx.ariaLabel, tabindex: _ctx.tabindex, "validate-event": false, onInput: onUserInput, onFocus: unref(handleFocus), onBlur: unref(handleBlur), onKeydown: handleKeydownInput, onChange: handleChange, onMousedown: onMouseDownInput, onMouseenter: onMouseEnter, onMouseleave: onMouseLeave, onTouchstartPassive: onTouchStartInput, onClick: _cache[0] || (_cache[0] = withModifiers(() => { }, ["stop"])) }, { prefix: withCtx(() => [triggerIcon.value ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(unref(nsInput).e("icon")), onMousedown: withModifiers(onMouseDownInput, ["prevent"]), onTouchstartPassive: onTouchStartInput }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(triggerIcon.value)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true)]), suffix: withCtx(() => [showClearBtn.value && _ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(`${unref(nsInput).e("icon")} clear-icon`), onMousedown: withModifiers(unref(NOOP), ["prevent"]), onClick: onClear }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))]), _: 1 }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)]), _: 1 }, 8, [ "id", "model-value", "name", "size", "disabled", "placeholder", "class", "style", "readonly", "aria-label", "tabindex", "onFocus", "onBlur" ])) : (openBlock(), createBlock(picker_range_trigger_default, { key: 1, id: _ctx.id, ref_key: "inputRef", ref: inputRef, "model-value": displayValue.value, name: _ctx.name, disabled: unref(pickerDisabled), readonly: !_ctx.editable || _ctx.readonly, "start-placeholder": _ctx.startPlaceholder, "end-placeholder": _ctx.endPlaceholder, class: normalizeClass(rangeInputKls.value), style: normalizeStyle(_ctx.$attrs.style), "aria-label": _ctx.ariaLabel, tabindex: _ctx.tabindex, autocomplete: "off", role: "combobox", onClick: onMouseDownInput, onFocus: unref(handleFocus), onBlur: unref(handleBlur), onStartInput: handleStartInput, onStartChange: handleStartChange, onEndInput: handleEndInput, onEndChange: handleEndChange, onMousedown: onMouseDownInput, onMouseenter: onMouseEnter, onMouseleave: onMouseLeave, onTouchstartPassive: onTouchStartInput, onKeydown: handleKeydownInput }, { prefix: withCtx(() => [triggerIcon.value ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass([unref(nsInput).e("icon"), unref(nsRange).e("icon")]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(triggerIcon.value)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true)]), "range-separator": withCtx(() => [renderSlot(_ctx.$slots, "range-separator", {}, () => [createBaseVNode("span", { class: normalizeClass(unref(nsRange).b("separator")) }, toDisplayString(_ctx.rangeSeparator), 3)])]), suffix: withCtx(() => [_ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(clearIconKls.value), onMousedown: withModifiers(unref(NOOP), ["prevent"]), onClick: onClear }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))]), _: 1 }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)]), _: 3 }, 8, [ "id", "model-value", "name", "disabled", "readonly", "start-placeholder", "end-placeholder", "class", "style", "aria-label", "tabindex", "onFocus", "onBlur" ]))]), content: withCtx(() => [renderSlot(_ctx.$slots, "default", { visible: unref(pickerVisible), actualVisible: unref(pickerActualVisible), parsedValue: unref(parsedValue), format: _ctx.format, dateFormat: _ctx.dateFormat, timeFormat: _ctx.timeFormat, unlinkPanels: _ctx.unlinkPanels, type: _ctx.type, defaultValue: _ctx.defaultValue, showNow: _ctx.showNow, showConfirm: _ctx.showConfirm, showFooter: _ctx.showFooter, showWeekNumber: _ctx.showWeekNumber, onPick: _cache[1] || (_cache[1] = (...args) => unref(onPick) && unref(onPick)(...args)), onSelectRange: setSelectionRange, onSetPickerOption: _cache[2] || (_cache[2] = (...args) => unref(onSetPickerOption) && unref(onSetPickerOption)(...args)), onCalendarChange: _cache[3] || (_cache[3] = (...args) => unref(onCalendarChange) && unref(onCalendarChange)(...args)), onClear, onPanelChange: _cache[4] || (_cache[4] = (...args) => unref(onPanelChange) && unref(onPanelChange)(...args)), onMousedown: _cache[5] || (_cache[5] = withModifiers(() => { }, ["stop"])) })]), _: 3 }, 16, [ "visible", "transition", "popper-class", "popper-style", "popper-options", "fallback-placements", "placement" ]); }; } }); var picker_default = picker_vue_vue_type_script_setup_true_lang_default; const panelTimePickerProps = buildProps({ ...timePanelSharedProps, datetimeRole: String, parsedValue: { type: definePropType(Object) } }); const useTimePanel = ({ getAvailableHours, getAvailableMinutes, getAvailableSeconds }) => { const getAvailableTime = (date, role, first, compareDate) => { const availableTimeGetters = { hour: getAvailableHours, minute: getAvailableMinutes, second: getAvailableSeconds }; let result = date; [ "hour", "minute", "second" ].forEach((type) => { if (availableTimeGetters[type]) { let availableTimeSlots; const method = availableTimeGetters[type]; switch (type) { case "minute": availableTimeSlots = method(result.hour(), role, compareDate); break; case "second": availableTimeSlots = method(result.hour(), result.minute(), role, compareDate); break; default: availableTimeSlots = method(role, compareDate); break; } if ((availableTimeSlots == null ? void 0 : availableTimeSlots.length) && !availableTimeSlots.includes(result[type]())) { const pos = first ? 0 : availableTimeSlots.length - 1; result = result[type](availableTimeSlots[pos]); } } }); return result; }; const timePickerOptions = {}; const onSetOption = ([key, val]) => { timePickerOptions[key] = val; }; return { timePickerOptions, getAvailableTime, onSetOption }; }; const makeAvailableArr = (disabledList) => { const trueOrNumber = (isDisabled, index) => isDisabled || index; const getNumber = (predicate) => predicate !== true; return disabledList.map(trueOrNumber).filter(getNumber); }; const getTimeLists = (disabledHours, disabledMinutes, disabledSeconds) => { const getHoursList = (role, compare) => { return makeList(24, disabledHours && (() => disabledHours == null ? void 0 : disabledHours(role, compare))); }; const getMinutesList = (hour, role, compare) => { return makeList(60, disabledMinutes && (() => disabledMinutes == null ? void 0 : disabledMinutes(hour, role, compare))); }; const getSecondsList = (hour, minute, role, compare) => { return makeList(60, disabledSeconds && (() => disabledSeconds == null ? void 0 : disabledSeconds(hour, minute, role, compare))); }; return { getHoursList, getMinutesList, getSecondsList }; }; const buildAvailableTimeSlotGetter = (disabledHours, disabledMinutes, disabledSeconds) => { const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(disabledHours, disabledMinutes, disabledSeconds); const getAvailableHours = (role, compare) => { return makeAvailableArr(getHoursList(role, compare)); }; const getAvailableMinutes = (hour, role, compare) => { return makeAvailableArr(getMinutesList(hour, role, compare)); }; const getAvailableSeconds = (hour, minute, role, compare) => { return makeAvailableArr(getSecondsList(hour, minute, role, compare)); }; return { getAvailableHours, getAvailableMinutes, getAvailableSeconds }; }; const useOldValue = (props2, options) => { const oldValue = ref(props2.parsedValue); watch(() => props2.visible, (val) => { const modelValue = toValue(options.modelValue); const valueOnClear = toValue(options.valueOnClear); if (val && modelValue === valueOnClear) { oldValue.value = valueOnClear; return; } if (!val) oldValue.value = props2.parsedValue; }); return oldValue; }; const basicTimeSpinnerProps = buildProps({ role: { type: String, required: true }, spinnerDate: { type: definePropType(Object), required: true }, showSeconds: { type: Boolean, default: true }, arrowControl: Boolean, amPmMode: { type: definePropType(String), default: "" }, ...disabledTimeListsProps }); const _hoisted_1$16 = ["onClick"]; const _hoisted_2$D = ["onMouseenter"]; var basic_time_spinner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "basic-time-spinner", props: basicTimeSpinnerProps, emits: [ CHANGE_EVENT, "select-range", "set-option" ], setup(__props, { emit: __emit }) { const props2 = __props; const { isRange, format, saveOnBlur } = inject(PICKER_BASE_INJECTION_KEY).props; const emit = __emit; const ns = useNamespace("time"); const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(props2.disabledHours, props2.disabledMinutes, props2.disabledSeconds); let isScrolling = false; const ignoreScroll = { hours: false, minutes: false, seconds: false }; const currentScrollbar = ref(); const listRefsMap = { hours: ref(), minutes: ref(), seconds: ref() }; const spinnerItems = computed(() => { return props2.showSeconds ? timeUnits$1 : timeUnits$1.slice(0, 2); }); const timePartials = computed(() => { const { spinnerDate } = props2; return { hours: spinnerDate.hour(), minutes: spinnerDate.minute(), seconds: spinnerDate.second() }; }); const timeList = computed(() => { const { hours, minutes } = unref(timePartials); const { role, spinnerDate } = props2; const compare = !isRange ? spinnerDate : void 0; return { hours: getHoursList(role, compare), minutes: getMinutesList(hours, role, compare), seconds: getSecondsList(hours, minutes, role, compare) }; }); const arrowControlTimeList = computed(() => { const { hours, minutes, seconds } = unref(timePartials); return { hours: buildTimeList(hours, 23), minutes: buildTimeList(minutes, 59), seconds: buildTimeList(seconds, 59) }; }); const debouncedResetScroll = debounce((type) => { isScrolling = false; adjustCurrentSpinner(type); }, 200); const getAmPmFlag = (hour) => { if (!!!props2.amPmMode) return ""; const isCapital = props2.amPmMode === "A"; let content = hour < 12 ? " am" : " pm"; if (isCapital) content = content.toUpperCase(); return content; }; const emitSelectRange = (type) => { let range = [0, 0]; const actualFormat = format || DEFAULT_FORMATS_TIME; const hourIndex = actualFormat.indexOf("HH"); const minuteIndex = actualFormat.indexOf("mm"); const secondIndex = actualFormat.indexOf("ss"); switch (type) { case "hours": if (hourIndex !== -1) range = [hourIndex, hourIndex + 2]; break; case "minutes": if (minuteIndex !== -1) range = [minuteIndex, minuteIndex + 2]; break; case "seconds": if (secondIndex !== -1) range = [secondIndex, secondIndex + 2]; break; } const [left, right] = range; emit("select-range", left, right); currentScrollbar.value = type; }; const adjustCurrentSpinner = (type) => { adjustSpinner(type, unref(timePartials)[type]); }; const adjustSpinners = () => { adjustCurrentSpinner("hours"); adjustCurrentSpinner("minutes"); adjustCurrentSpinner("seconds"); }; const getScrollbarElement = (el) => el.querySelector(`.${ns.namespace.value}-scrollbar__wrap`); const adjustSpinner = (type, value) => { if (props2.arrowControl) return; const scrollbar = unref(listRefsMap[type]); if (scrollbar && scrollbar.$el) { if (!saveOnBlur) { ignoreScroll[type] = true; rAF(() => { ignoreScroll[type] = false; }); } getScrollbarElement(scrollbar.$el).scrollTop = Math.max(0, value * typeItemHeight(type)); } }; const typeItemHeight = (type) => { var _a; const listItem = (_a = unref(listRefsMap[type])) == null ? void 0 : _a.$el.querySelector("li"); if (listItem) return Number.parseFloat(getStyle(listItem, "height")) || 0; return 0; }; const onIncrement = () => { scrollDown(1); }; const onDecrement = () => { scrollDown(-1); }; const scrollDown = (step2) => { if (!currentScrollbar.value) emitSelectRange("hours"); const label = currentScrollbar.value; const now = unref(timePartials)[label]; const next = findNextUnDisabled(label, now, step2, currentScrollbar.value === "hours" ? 24 : 60); modifyDateField(label, next); adjustSpinner(label, next); nextTick(() => emitSelectRange(label)); }; const findNextUnDisabled = (type, now, step2, total2) => { let next = (now + step2 + total2) % total2; const list = unref(timeList)[type]; while (list[next] && next !== now) next = (next + step2 + total2) % total2; return next; }; const modifyDateField = (type, value) => { if (unref(timeList)[type][value]) return; const { hours, minutes, seconds } = unref(timePartials); let changeTo; switch (type) { case "hours": changeTo = props2.spinnerDate.hour(value).minute(minutes).second(seconds); break; case "minutes": changeTo = props2.spinnerDate.hour(hours).minute(value).second(seconds); break; case "seconds": changeTo = props2.spinnerDate.hour(hours).minute(minutes).second(value); break; } emit(CHANGE_EVENT, changeTo); }; const handleClick = (type, { value, disabled }) => { if (!disabled) { modifyDateField(type, value); emitSelectRange(type); adjustSpinner(type, value); } }; const handleScroll2 = (type) => { if (!saveOnBlur && ignoreScroll[type]) return; const scrollbar = unref(listRefsMap[type]); if (!scrollbar) return; isScrolling = true; debouncedResetScroll(type); modifyDateField(type, Math.min(Math.round((getScrollbarElement(scrollbar.$el).scrollTop - (scrollBarHeight(type) * 0.5 - 10) / typeItemHeight(type) + 3) / typeItemHeight(type)), type === "hours" ? 23 : 59)); }; const scrollBarHeight = (type) => { return unref(listRefsMap[type]).$el.offsetHeight; }; const bindScrollEvent = () => { const bindFunction = (type) => { const scrollbar = unref(listRefsMap[type]); if (scrollbar && scrollbar.$el) getScrollbarElement(scrollbar.$el).onscroll = () => { handleScroll2(type); }; }; bindFunction("hours"); bindFunction("minutes"); bindFunction("seconds"); }; onMounted(() => { nextTick(() => { !props2.arrowControl && bindScrollEvent(); adjustSpinners(); if (props2.role === "start") emitSelectRange("hours"); }); }); const setRef = (scrollbar, type) => { listRefsMap[type].value = scrollbar ?? void 0; }; emit("set-option", [`${props2.role}_scrollDown`, scrollDown]); emit("set-option", [`${props2.role}_emitSelectRange`, emitSelectRange]); watch(() => props2.spinnerDate, () => { if (isScrolling) return; adjustSpinners(); }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b("spinner"), { "has-seconds": _ctx.showSeconds }]) }, [!_ctx.arrowControl ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(spinnerItems.value, (item) => { return openBlock(), createBlock(unref(ElScrollbar), { key: item, ref_for: true, ref: (scrollbar) => setRef(scrollbar, item), class: normalizeClass(unref(ns).be("spinner", "wrapper")), "wrap-style": "max-height: inherit;", "view-class": unref(ns).be("spinner", "list"), noresize: "", tag: "ul", onMouseenter: ($event) => emitSelectRange(item), onMousemove: ($event) => adjustCurrentSpinner(item) }, { default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(timeList.value[item], (disabled, key) => { return openBlock(), createElementBlock("li", { key, class: normalizeClass([ unref(ns).be("spinner", "item"), unref(ns).is("active", key === timePartials.value[item]), unref(ns).is("disabled", disabled) ]), onClick: ($event) => handleClick(item, { value: key, disabled }) }, [item === "hours" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(("0" + (_ctx.amPmMode ? key % 12 || 12 : key)).slice(-2)) + toDisplayString(getAmPmFlag(key)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(("0" + key).slice(-2)), 1)], 64))], 10, _hoisted_1$16); }), 128))]), _: 2 }, 1032, [ "class", "view-class", "onMouseenter", "onMousemove" ]); }), 128)) : createCommentVNode("v-if", true), _ctx.arrowControl ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(spinnerItems.value, (item) => { return openBlock(), createElementBlock("div", { key: item, class: normalizeClass([unref(ns).be("spinner", "wrapper"), unref(ns).is("arrow")]), onMouseenter: ($event) => emitSelectRange(item) }, [ withDirectives((openBlock(), createBlock(unref(ElIcon), { class: normalizeClass(["arrow-up", unref(ns).be("spinner", "arrow")]) }, { default: withCtx(() => [createVNode(unref(arrow_up_default))]), _: 1 }, 8, ["class"])), [[unref(vRepeatClick), onDecrement]]), withDirectives((openBlock(), createBlock(unref(ElIcon), { class: normalizeClass(["arrow-down", unref(ns).be("spinner", "arrow")]) }, { default: withCtx(() => [createVNode(unref(arrow_down_default))]), _: 1 }, 8, ["class"])), [[unref(vRepeatClick), onIncrement]]), createBaseVNode("ul", { class: normalizeClass(unref(ns).be("spinner", "list")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(arrowControlTimeList.value[item], (time, key) => { return openBlock(), createElementBlock("li", { key, class: normalizeClass([ unref(ns).be("spinner", "item"), unref(ns).is("active", time === timePartials.value[item]), unref(ns).is("disabled", timeList.value[item][time]) ]) }, [unref(isNumber)(time) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [item === "hours" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(("0" + (_ctx.amPmMode ? time % 12 || 12 : time)).slice(-2)) + toDisplayString(getAmPmFlag(time)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(("0" + time).slice(-2)), 1)], 64))], 64)) : createCommentVNode("v-if", true)], 2); }), 128))], 2) ], 42, _hoisted_2$D); }), 128)) : createCommentVNode("v-if", true)], 2); }; } }); var basic_time_spinner_default = basic_time_spinner_vue_vue_type_script_setup_true_lang_default; var panel_time_pick_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "panel-time-pick", props: panelTimePickerProps, emits: [ "pick", "select-range", "set-picker-option" ], setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const pickerBase = inject(PICKER_BASE_INJECTION_KEY); const { arrowControl, disabledHours, disabledMinutes, disabledSeconds, defaultValue } = pickerBase.props; const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours, disabledMinutes, disabledSeconds); const ns = useNamespace("time"); const { t, lang } = useLocale(); const selectionRange = ref([0, 2]); const oldValue = useOldValue(props2, { modelValue: computed(() => pickerBase.props.modelValue), valueOnClear: computed(() => (pickerBase == null ? void 0 : pickerBase.emptyValues) ? pickerBase.emptyValues.valueOnClear.value : null) }); const transitionName = computed(() => { return isUndefined(props2.actualVisible) ? `${ns.namespace.value}-zoom-in-top` : ""; }); const showSeconds = computed(() => { return props2.format.includes("ss"); }); const amPmMode = computed(() => { if (props2.format.includes("A")) return "A"; if (props2.format.includes("a")) return "a"; return ""; }); const isValidValue2 = (_date) => { const parsedDate = dayjs(_date).locale(lang.value); const result = getRangeAvailableTime(parsedDate); return parsedDate.isSame(result); }; const handleCancel = () => { const old = oldValue.value; emit("pick", old, false); nextTick(() => { oldValue.value = old; }); }; const handleConfirm = (visible = false, first = false) => { if (first) return; emit("pick", props2.parsedValue, visible); }; const handleChange = (_date) => { if (!props2.visible) return; emit("pick", getRangeAvailableTime(_date).millisecond(0), true); }; const setSelectionRange = (start, end) => { emit("select-range", start, end); selectionRange.value = [start, end]; }; const changeSelectionRange = (step2) => { const actualFormat = props2.format; const hourIndex = actualFormat.indexOf("HH"); const minuteIndex = actualFormat.indexOf("mm"); const secondIndex = actualFormat.indexOf("ss"); const list = []; const mapping = []; if (hourIndex !== -1) { list.push(hourIndex); mapping.push("hours"); } if (minuteIndex !== -1) { list.push(minuteIndex); mapping.push("minutes"); } if (secondIndex !== -1 && showSeconds.value) { list.push(secondIndex); mapping.push("seconds"); } const next = (list.indexOf(selectionRange.value[0]) + step2 + list.length) % list.length; timePickerOptions["start_emitSelectRange"](mapping[next]); }; const handleKeydown = (event) => { const code = getEventCode(event); const { left, right, up, down } = EVENT_CODE; if ([left, right].includes(code)) { changeSelectionRange(code === left ? -1 : 1); event.preventDefault(); return; } if ([up, down].includes(code)) { const step2 = code === up ? -1 : 1; timePickerOptions["start_scrollDown"](step2); event.preventDefault(); return; } }; const { timePickerOptions, onSetOption, getAvailableTime } = useTimePanel({ getAvailableHours, getAvailableMinutes, getAvailableSeconds }); const getRangeAvailableTime = (date) => { return getAvailableTime(date, props2.datetimeRole || "", true); }; const parseUserInput = (value) => { if (!value) return null; return dayjs(value, props2.format).locale(lang.value); }; const getDefaultValue2 = () => { return dayjs(defaultValue).locale(lang.value); }; emit("set-picker-option", ["isValidValue", isValidValue2]); emit("set-picker-option", ["parseUserInput", parseUserInput]); emit("set-picker-option", ["handleKeydownInput", handleKeydown]); emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]); emit("set-picker-option", ["getDefaultValue", getDefaultValue2]); emit("set-picker-option", ["handleCancel", handleCancel]); return (_ctx, _cache) => { return openBlock(), createBlock(Transition, { name: transitionName.value }, { default: withCtx(() => [_ctx.actualVisible || _ctx.visible ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).b("panel")) }, [createBaseVNode("div", { class: normalizeClass([unref(ns).be("panel", "content"), { "has-seconds": showSeconds.value }]) }, [createVNode(basic_time_spinner_default, { ref: "spinner", role: _ctx.datetimeRole || "start", "arrow-control": unref(arrowControl), "show-seconds": showSeconds.value, "am-pm-mode": amPmMode.value, "spinner-date": _ctx.parsedValue, "disabled-hours": unref(disabledHours), "disabled-minutes": unref(disabledMinutes), "disabled-seconds": unref(disabledSeconds), onChange: handleChange, onSetOption: unref(onSetOption), onSelectRange: setSelectionRange }, null, 8, [ "role", "arrow-control", "show-seconds", "am-pm-mode", "spinner-date", "disabled-hours", "disabled-minutes", "disabled-seconds", "onSetOption" ])], 2), createBaseVNode("div", { class: normalizeClass(unref(ns).be("panel", "footer")) }, [createBaseVNode("button", { type: "button", class: normalizeClass([unref(ns).be("panel", "btn"), "cancel"]), onClick: handleCancel }, toDisplayString(unref(t)("el.datepicker.cancel")), 3), createBaseVNode("button", { type: "button", class: normalizeClass([unref(ns).be("panel", "btn"), "confirm"]), onClick: _cache[0] || (_cache[0] = ($event) => handleConfirm()) }, toDisplayString(unref(t)("el.datepicker.confirm")), 3)], 2)], 2)) : createCommentVNode("v-if", true)]), _: 1 }, 8, ["name"]); }; } }); var panel_time_pick_default = panel_time_pick_vue_vue_type_script_setup_true_lang_default; const panelTimeRangeProps = buildProps({ ...timePanelSharedProps, parsedValue: { type: definePropType(Array) } }); const _hoisted_1$15 = ["disabled"]; var panel_time_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "panel-time-range", props: panelTimeRangeProps, emits: [ "pick", "select-range", "set-picker-option" ], setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const makeSelectRange = (start, end) => { const result = []; for (let i = start; i <= end; i++) result.push(i); return result; }; const { t, lang } = useLocale(); const nsTime = useNamespace("time"); const nsPicker = useNamespace("picker"); const pickerBase = inject(PICKER_BASE_INJECTION_KEY); const { arrowControl, disabledHours, disabledMinutes, disabledSeconds, defaultValue } = pickerBase.props; const startContainerKls = computed(() => [ nsTime.be("range-picker", "body"), nsTime.be("panel", "content"), nsTime.is("arrow", arrowControl), showSeconds.value ? "has-seconds" : "" ]); const endContainerKls = computed(() => [ nsTime.be("range-picker", "body"), nsTime.be("panel", "content"), nsTime.is("arrow", arrowControl), showSeconds.value ? "has-seconds" : "" ]); const startTime = computed(() => props2.parsedValue[0]); const endTime = computed(() => props2.parsedValue[1]); const oldValue = useOldValue(props2, { modelValue: computed(() => pickerBase.props.modelValue), valueOnClear: computed(() => (pickerBase == null ? void 0 : pickerBase.emptyValues) ? pickerBase.emptyValues.valueOnClear.value : null) }); const handleCancel = () => { const old = oldValue.value; emit("pick", old, false); nextTick(() => { oldValue.value = old; }); }; const showSeconds = computed(() => { return props2.format.includes("ss"); }); const amPmMode = computed(() => { if (props2.format.includes("A")) return "A"; if (props2.format.includes("a")) return "a"; return ""; }); const handleConfirm = (visible = false) => { emit("pick", [startTime.value, endTime.value], visible); }; const handleMinChange = (date) => { handleChange(date.millisecond(0), endTime.value); }; const handleMaxChange = (date) => { handleChange(startTime.value, date.millisecond(0)); }; const isValidValue2 = (_date) => { const parsedDate = _date.map((_) => dayjs(_).locale(lang.value)); const result = getRangeAvailableTime(parsedDate); return parsedDate[0].isSame(result[0]) && parsedDate[1].isSame(result[1]); }; const handleChange = (start, end) => { if (!props2.visible) return; emit("pick", [start, end], true); }; const btnConfirmDisabled = computed(() => { return startTime.value > endTime.value; }); const selectionRange = ref([0, 2]); const setMinSelectionRange = (start, end) => { emit("select-range", start, end, "min"); selectionRange.value = [start, end]; }; const offset2 = computed(() => showSeconds.value ? 11 : 8); const setMaxSelectionRange = (start, end) => { emit("select-range", start, end, "max"); const _offset = unref(offset2); selectionRange.value = [start + _offset, end + _offset]; }; const changeSelectionRange = (step2) => { const list = showSeconds.value ? [ 0, 3, 6, 11, 14, 17 ] : [ 0, 3, 8, 11 ]; const mapping = ["hours", "minutes"].concat(showSeconds.value ? ["seconds"] : []); const next = (list.indexOf(selectionRange.value[0]) + step2 + list.length) % list.length; const half = list.length / 2; if (next < half) timePickerOptions["start_emitSelectRange"](mapping[next]); else timePickerOptions["end_emitSelectRange"](mapping[next - half]); }; const handleKeydown = (event) => { const code = getEventCode(event); const { left, right, up, down } = EVENT_CODE; if ([left, right].includes(code)) { changeSelectionRange(code === left ? -1 : 1); event.preventDefault(); return; } if ([up, down].includes(code)) { const step2 = code === up ? -1 : 1; timePickerOptions[`${selectionRange.value[0] < offset2.value ? "start" : "end"}_scrollDown`](step2); event.preventDefault(); return; } }; const disabledHours_ = (role, compare) => { const defaultDisable = disabledHours ? disabledHours(role) : []; const isStart = role === "start"; const compareHour = (compare || (isStart ? endTime.value : startTime.value)).hour(); return union(defaultDisable, isStart ? makeSelectRange(compareHour + 1, 23) : makeSelectRange(0, compareHour - 1)); }; const disabledMinutes_ = (hour, role, compare) => { const defaultDisable = disabledMinutes ? disabledMinutes(hour, role) : []; const isStart = role === "start"; const compareDate = compare || (isStart ? endTime.value : startTime.value); if (hour !== compareDate.hour()) return defaultDisable; const compareMinute = compareDate.minute(); return union(defaultDisable, isStart ? makeSelectRange(compareMinute + 1, 59) : makeSelectRange(0, compareMinute - 1)); }; const disabledSeconds_ = (hour, minute, role, compare) => { const defaultDisable = disabledSeconds ? disabledSeconds(hour, minute, role) : []; const isStart = role === "start"; const compareDate = compare || (isStart ? endTime.value : startTime.value); const compareHour = compareDate.hour(); const compareMinute = compareDate.minute(); if (hour !== compareHour || minute !== compareMinute) return defaultDisable; const compareSecond = compareDate.second(); return union(defaultDisable, isStart ? makeSelectRange(compareSecond + 1, 59) : makeSelectRange(0, compareSecond - 1)); }; const getRangeAvailableTime = ([start, end]) => { return [getAvailableTime(start, "start", true, end), getAvailableTime(end, "end", false, start)]; }; const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours_, disabledMinutes_, disabledSeconds_); const { timePickerOptions, getAvailableTime, onSetOption } = useTimePanel({ getAvailableHours, getAvailableMinutes, getAvailableSeconds }); const parseUserInput = (days) => { if (!days) return null; if (isArray(days)) return days.map((d) => dayjs(d, props2.format).locale(lang.value)); return dayjs(days, props2.format).locale(lang.value); }; const getDefaultValue2 = () => { if (isArray(defaultValue)) return defaultValue.map((d) => dayjs(d).locale(lang.value)); const defaultDay = dayjs(defaultValue).locale(lang.value); return [defaultDay, defaultDay.add(60, "m")]; }; emit("set-picker-option", ["parseUserInput", parseUserInput]); emit("set-picker-option", ["isValidValue", isValidValue2]); emit("set-picker-option", ["handleKeydownInput", handleKeydown]); emit("set-picker-option", ["getDefaultValue", getDefaultValue2]); emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]); emit("set-picker-option", ["handleCancel", handleCancel]); return (_ctx, _cache) => { return _ctx.actualVisible ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass([unref(nsTime).b("range-picker"), unref(nsPicker).b("panel")]) }, [createBaseVNode("div", { class: normalizeClass(unref(nsTime).be("range-picker", "content")) }, [createBaseVNode("div", { class: normalizeClass(unref(nsTime).be("range-picker", "cell")) }, [createBaseVNode("div", { class: normalizeClass(unref(nsTime).be("range-picker", "header")) }, toDisplayString(unref(t)("el.datepicker.startTime")), 3), createBaseVNode("div", { class: normalizeClass(startContainerKls.value) }, [createVNode(basic_time_spinner_default, { ref: "minSpinner", role: "start", "show-seconds": showSeconds.value, "am-pm-mode": amPmMode.value, "arrow-control": unref(arrowControl), "spinner-date": startTime.value, "disabled-hours": disabledHours_, "disabled-minutes": disabledMinutes_, "disabled-seconds": disabledSeconds_, onChange: handleMinChange, onSetOption: unref(onSetOption), onSelectRange: setMinSelectionRange }, null, 8, [ "show-seconds", "am-pm-mode", "arrow-control", "spinner-date", "onSetOption" ])], 2)], 2), createBaseVNode("div", { class: normalizeClass(unref(nsTime).be("range-picker", "cell")) }, [createBaseVNode("div", { class: normalizeClass(unref(nsTime).be("range-picker", "header")) }, toDisplayString(unref(t)("el.datepicker.endTime")), 3), createBaseVNode("div", { class: normalizeClass(endContainerKls.value) }, [createVNode(basic_time_spinner_default, { ref: "maxSpinner", role: "end", "show-seconds": showSeconds.value, "am-pm-mode": amPmMode.value, "arrow-control": unref(arrowControl), "spinner-date": endTime.value, "disabled-hours": disabledHours_, "disabled-minutes": disabledMinutes_, "disabled-seconds": disabledSeconds_, onChange: handleMaxChange, onSetOption: unref(onSetOption), onSelectRange: setMaxSelectionRange }, null, 8, [ "show-seconds", "am-pm-mode", "arrow-control", "spinner-date", "onSetOption" ])], 2)], 2)], 2), createBaseVNode("div", { class: normalizeClass(unref(nsTime).be("panel", "footer")) }, [createBaseVNode("button", { type: "button", class: normalizeClass([unref(nsTime).be("panel", "btn"), "cancel"]), onClick: _cache[0] || (_cache[0] = ($event) => handleCancel()) }, toDisplayString(unref(t)("el.datepicker.cancel")), 3), createBaseVNode("button", { type: "button", class: normalizeClass([unref(nsTime).be("panel", "btn"), "confirm"]), disabled: btnConfirmDisabled.value, onClick: _cache[1] || (_cache[1] = ($event) => handleConfirm()) }, toDisplayString(unref(t)("el.datepicker.confirm")), 11, _hoisted_1$15)], 2)], 2)) : createCommentVNode("v-if", true); }; } }); var panel_time_range_default = panel_time_range_vue_vue_type_script_setup_true_lang_default; dayjs.extend(customParseFormat); var time_picker_default = /* @__PURE__ */ defineComponent({ name: "ElTimePicker", install: null, props: { ...timePickerDefaultProps, isRange: Boolean }, emits: [UPDATE_MODEL_EVENT], setup(props2, ctx) { const commonPicker = ref(); const [type, Panel] = props2.isRange ? ["timerange", panel_time_range_default] : ["time", panel_time_pick_default]; const modelUpdater = (value) => ctx.emit(UPDATE_MODEL_EVENT, value); provide(PICKER_POPPER_OPTIONS_INJECTION_KEY, props2.popperOptions); ctx.expose({ focus: () => { var _a; (_a = commonPicker.value) == null ? void 0 : _a.focus(); }, blur: () => { var _a; (_a = commonPicker.value) == null ? void 0 : _a.blur(); }, handleOpen: () => { var _a; (_a = commonPicker.value) == null ? void 0 : _a.handleOpen(); }, handleClose: () => { var _a; (_a = commonPicker.value) == null ? void 0 : _a.handleClose(); } }); return () => { const format = props2.format ?? DEFAULT_FORMATS_TIME; return createVNode(picker_default, mergeProps(props2, { "ref": commonPicker, "type": type, "format": format, "onUpdate:modelValue": modelUpdater }), { default: (props3) => createVNode(Panel, props3, null) }); }; } }); const ElTimePicker = withInstall(time_picker_default); const tagProps = buildProps({ type: { type: String, values: [ "primary", "success", "info", "warning", "danger" ], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: componentSizes }, effect: { type: String, values: [ "dark", "light", "plain" ], default: "light" }, round: Boolean }); const tagEmits = { close: (evt) => evt instanceof MouseEvent, click: (evt) => evt instanceof MouseEvent }; const _hoisted_1$14 = ["aria-label"]; const _hoisted_2$C = ["aria-label"]; var tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTag", __name: "tag", props: tagProps, emits: tagEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const tagSize = useFormSize(); const { t } = useLocale(); const ns = useNamespace("tag"); const containerKls = computed(() => { const { type, hit, effect, closable, round } = props2; return [ ns.b(), ns.is("closable", closable), ns.m(type || "primary"), ns.m(tagSize.value), ns.m(effect), ns.is("hit", hit), ns.is("round", round) ]; }); const handleClose = (event) => { emit("close", event); }; const handleClick = (event) => { emit("click", event); }; const handleVNodeMounted = (vnode) => { var _a, _b, _c; if ((_c = (_b = (_a = vnode == null ? void 0 : vnode.component) == null ? void 0 : _a.subTree) == null ? void 0 : _b.component) == null ? void 0 : _c.bum) vnode.component.subTree.component.bum = null; }; return (_ctx, _cache) => { return __props.disableTransitions ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(containerKls.value), style: normalizeStyle({ backgroundColor: __props.color }), onClick: handleClick }, [createBaseVNode("span", { class: normalizeClass(unref(ns).e("content")) }, [renderSlot(_ctx.$slots, "default")], 2), __props.closable ? (openBlock(), createElementBlock("button", { key: 0, "aria-label": unref(t)("el.tag.close"), class: normalizeClass(unref(ns).e("close")), type: "button", onClick: withModifiers(handleClose, ["stop"]) }, [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(close_default))]), _: 1 })], 10, _hoisted_1$14)) : createCommentVNode("v-if", true)], 6)) : (openBlock(), createBlock(Transition, { key: 1, name: `${unref(ns).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: handleVNodeMounted }, { default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(containerKls.value), style: normalizeStyle({ backgroundColor: __props.color }), onClick: handleClick }, [createBaseVNode("span", { class: normalizeClass(unref(ns).e("content")) }, [renderSlot(_ctx.$slots, "default")], 2), __props.closable ? (openBlock(), createElementBlock("button", { key: 0, "aria-label": unref(t)("el.tag.close"), class: normalizeClass(unref(ns).e("close")), type: "button", onClick: withModifiers(handleClose, ["stop"]) }, [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(close_default))]), _: 1 })], 10, _hoisted_2$C)) : createCommentVNode("v-if", true)], 6)]), _: 3 }, 8, ["name"])); }; } }); var tag_default = tag_vue_vue_type_script_setup_true_lang_default; const ElTag = withInstall(tag_default); const selectGroupKey = Symbol("ElSelectGroup"); const selectKey = Symbol("ElSelect"); const defaultProps$2 = { label: "label", value: "value", disabled: "disabled", options: "options" }; function useProps(props2) { const aliasProps = ref({ ...defaultProps$2, ...props2.props }); let cache2 = { ...props2.props }; watch(() => props2.props, (val) => { if (!isEqual(val, cache2)) { aliasProps.value = { ...defaultProps$2, ...val }; cache2 = { ...val }; } }, { deep: true }); const getLabel = (option) => get(option, aliasProps.value.label); const getValue = (option) => get(option, aliasProps.value.value); const getDisabled = (option) => get(option, aliasProps.value.disabled); const getOptions = (option) => get(option, aliasProps.value.options); return { aliasProps, getLabel, getValue, getDisabled, getOptions }; } const selectProps = buildProps({ name: String, id: String, modelValue: { type: definePropType([ Array, String, Number, Boolean, Object ]), default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: useSizeProp, effect: { type: definePropType(String), default: "light" }, disabled: { type: Boolean, default: void 0 }, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperStyle: { type: definePropType([String, Object]) }, popperOptions: { type: definePropType(Object), default: () => ({}) }, remote: Boolean, debounce: { type: Number, default: 300 }, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: { type: definePropType(Function) }, filterMethod: { type: definePropType(Function) }, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: true }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, tagTooltip: { type: definePropType(Object), default: () => ({}) }, maxCollapseTags: { type: Number, default: 1 }, teleported: useTooltipContentProps.teleported, persistent: { type: Boolean, default: true }, clearIcon: { type: iconPropType, default: circle_close_default }, fitInputWidth: Boolean, suffixIcon: { type: iconPropType, default: arrow_down_default }, tagType: { ...tagProps.type, default: "info" }, tagEffect: { ...tagProps.effect, default: "light" }, validateEvent: { type: Boolean, default: true }, remoteShowSuffix: Boolean, showArrow: { type: Boolean, default: true }, offset: { type: Number, default: 12 }, placement: { type: definePropType(String), values: Ee, default: "bottom-start" }, fallbackPlacements: { type: definePropType(Array), default: [ "bottom-start", "top-start", "right", "left" ] }, tabindex: { type: [String, Number], default: 0 }, appendTo: useTooltipContentProps.appendTo, options: { type: definePropType(Array) }, props: { type: definePropType(Object), default: () => defaultProps$2 }, ...useEmptyValuesProps, ...useAriaProps(["ariaLabel"]) }); ({ "popup-scroll": scrollbarEmits.scroll }); const COMPONENT_NAME$e = "ElOption"; const optionProps = buildProps({ value: { type: [ String, Number, Boolean, Object ], required: true }, label: { type: [String, Number] }, created: Boolean, disabled: Boolean }); function useOption$1(props2, states) { const select = inject(selectKey); if (!select) throwError(COMPONENT_NAME$e, "usage: "); const selectGroup = inject(selectGroupKey, { disabled: false }); const itemSelected = computed(() => { return contains(castArray$1(select.props.modelValue), props2.value); }); const limitReached = computed(() => { if (select.props.multiple) { const modelValue = castArray$1(select.props.modelValue ?? []); return !itemSelected.value && modelValue.length >= select.props.multipleLimit && select.props.multipleLimit > 0; } else return false; }); const currentLabel = computed(() => { return props2.label ?? (isObject(props2.value) ? "" : props2.value); }); const currentValue = computed(() => { return props2.value || props2.label || ""; }); const isDisabled = computed(() => { return props2.disabled || states.groupDisabled || limitReached.value; }); const instance = getCurrentInstance(); const contains = (arr = [], target) => { if (!isObject(props2.value)) return arr && arr.includes(target); else { const valueKey = select.props.valueKey; return arr && arr.some((item) => { return toRaw(get(item, valueKey)) === get(target, valueKey); }); } }; const hoverItem = () => { if (!isDisabled.value) select.states.hoveringIndex = select.optionsArray.indexOf(instance.proxy); }; const updateOption = (query) => { states.visible = new RegExp(escapeStringRegexp(query), "i").test(String(currentLabel.value)) || props2.created; }; watch(() => currentLabel.value, () => { if (!props2.created && !select.props.remote) select.setSelected(); }); watch(() => props2.value, (val, oldVal) => { const { remote, valueKey } = select.props; if (remote ? val !== oldVal : !isEqual(val, oldVal)) { select.onOptionDestroy(oldVal, instance.proxy); select.onOptionCreate(instance.proxy); } if (!props2.created && !remote) { if (valueKey && isObject(val) && isObject(oldVal) && val[valueKey] === oldVal[valueKey]) return; select.setSelected(); } }); watch(() => selectGroup.disabled, () => { states.groupDisabled = selectGroup.disabled; }, { immediate: true }); return { select, currentLabel, currentValue, itemSelected, isDisabled, hoverItem, updateOption }; } var option_vue_vue_type_script_lang_default = defineComponent({ name: COMPONENT_NAME$e, componentName: COMPONENT_NAME$e, props: optionProps, setup(props2) { const ns = useNamespace("select"); const id = useId(); const containerKls = computed(() => [ ns.be("dropdown", "item"), ns.is("disabled", unref(isDisabled)), ns.is("selected", unref(itemSelected)), ns.is("hovering", unref(hover)) ]); const states = reactive({ index: -1, groupDisabled: false, visible: true, hover: false }); const { currentLabel, itemSelected, isDisabled, select, hoverItem, updateOption } = useOption$1(props2, states); const { visible, hover } = toRefs(states); const vm = getCurrentInstance().proxy; select.onOptionCreate(vm); onBeforeUnmount(() => { const key = vm.value; nextTick(() => { const { selected: selectedOptions } = select.states; const doesSelected = selectedOptions.some((item) => { return item.value === vm.value; }); if (select.states.cachedOptions.get(key) === vm && !doesSelected) select.states.cachedOptions.delete(key); }); select.onOptionDestroy(key, vm); }); function selectOptionClick() { if (!isDisabled.value) select.handleOptionSelect(vm); } const handleMousedown = (event) => { let target = event.target; const currentTarget = event.currentTarget; while (target && target !== currentTarget) { if (isFocusable(target)) return; target = target.parentElement; } event.preventDefault(); }; return { ns, id, containerKls, currentLabel, itemSelected, isDisabled, select, visible, hover, states, hoverItem, handleMousedown, updateOption, selectOptionClick }; } }); const _hoisted_1$13 = [ "id", "aria-disabled", "aria-selected" ]; function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) { return withDirectives((openBlock(), createElementBlock("li", { id: _ctx.id, class: normalizeClass(_ctx.containerKls), role: "option", "aria-disabled": _ctx.isDisabled || void 0, "aria-selected": _ctx.itemSelected, onMousemove: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)), onMousedown: _cache[1] || (_cache[1] = (...args) => _ctx.handleMousedown && _ctx.handleMousedown(...args)), onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"])) }, [renderSlot(_ctx.$slots, "default", {}, () => [createBaseVNode("span", null, toDisplayString(_ctx.currentLabel), 1)])], 42, _hoisted_1$13)), [[vShow, _ctx.visible]]); } var option_default = /* @__PURE__ */ _plugin_vue_export_helper_default(option_vue_vue_type_script_lang_default, [["render", _sfc_render$k]]); var option_group_vue_vue_type_script_lang_default = defineComponent({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(props2) { const ns = useNamespace("select"); const groupRef = ref(); const instance = getCurrentInstance(); const children = ref([]); provide(selectGroupKey, reactive({ ...toRefs(props2) })); const visible = computed(() => children.value.some((option) => option.visible === true)); const isOption = (node) => { var _a; return node.type.name === "ElOption" && !!((_a = node.component) == null ? void 0 : _a.proxy); }; const flattedChildren2 = (node) => { const nodes = castArray$1(node); const children2 = []; nodes.forEach((child) => { var _a; if (!isVNode(child)) return; if (isOption(child)) children2.push(child.component.proxy); else if (isArray(child.children) && child.children.length) children2.push(...flattedChildren2(child.children)); else if ((_a = child.component) == null ? void 0 : _a.subTree) children2.push(...flattedChildren2(child.component.subTree)); }); return children2; }; const updateChildren = () => { children.value = flattedChildren2(instance.subTree); }; onMounted(() => { updateChildren(); }); useMutationObserver(groupRef, updateChildren, { attributes: true, subtree: true, childList: true }); return { groupRef, visible, ns }; } }); function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) { return withDirectives((openBlock(), createElementBlock("ul", { ref: "groupRef", class: normalizeClass(_ctx.ns.be("group", "wrap")) }, [createBaseVNode("li", { class: normalizeClass(_ctx.ns.be("group", "title")) }, toDisplayString(_ctx.label), 3), createBaseVNode("li", null, [createBaseVNode("ul", { class: normalizeClass(_ctx.ns.b("group")) }, [renderSlot(_ctx.$slots, "default")], 2)])], 2)), [[vShow, _ctx.visible]]); } var option_group_default = /* @__PURE__ */ _plugin_vue_export_helper_default(option_group_vue_vue_type_script_lang_default, [["render", _sfc_render$j]]); var select_dropdown_vue_vue_type_script_lang_default = defineComponent({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const select = inject(selectKey); const ns = useNamespace("select"); const popperClass = computed(() => select.props.popperClass); const isMultiple = computed(() => select.props.multiple); const isFitInputWidth = computed(() => select.props.fitInputWidth); const minWidth = ref(""); function updateMinWidth() { var _a; const offsetWidth = (_a = select.selectRef) == null ? void 0 : _a.offsetWidth; if (offsetWidth) minWidth.value = `${offsetWidth - BORDER_HORIZONTAL_WIDTH}px`; else minWidth.value = ""; } onMounted(() => { updateMinWidth(); useResizeObserver(select.selectRef, updateMinWidth); }); return { ns, minWidth, popperClass, isMultiple, isFitInputWidth }; } }); function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("div", { class: normalizeClass([ _ctx.ns.b("dropdown"), _ctx.ns.is("multiple", _ctx.isMultiple), _ctx.popperClass ]), style: normalizeStyle({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth }) }, [ _ctx.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(_ctx.ns.be("dropdown", "header")) }, [renderSlot(_ctx.$slots, "header")], 2)) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default"), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(_ctx.ns.be("dropdown", "footer")) }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true) ], 6); } var select_dropdown_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(select_dropdown_vue_vue_type_script_lang_default, [["render", _sfc_render$i]]); const useSelect$2 = (props2, emit) => { const { t } = useLocale(); const slots = useSlots(); const contentId = useId(); const nsSelect = useNamespace("select"); const nsInput = useNamespace("input"); const states = reactive({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: false, menuVisibleOnFocus: false, isBeforeHide: false }); const selectRef = ref(); const selectionRef = ref(); const tooltipRef = ref(); const tagTooltipRef = ref(); const inputRef = ref(); const prefixRef = ref(); const suffixRef = ref(); const menuRef = ref(); const tagMenuRef = ref(); const collapseItemRef = ref(); const scrollbarRef = ref(); const expanded = ref(false); const hoverOption = ref(); const debouncing = ref(false); const { form, formItem } = useFormItem(); const { inputId } = useFormItemInputId(props2, { formItemContext: formItem }); const { valueOnClear, isEmptyValue } = useEmptyValues(props2); const { isComposing, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposition({ afterComposition: (e) => onInput(e) }); const selectDisabled = useFormDisabled(); const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, { disabled: selectDisabled, afterFocus() { if (props2.automaticDropdown && !expanded.value) { expanded.value = true; states.menuVisibleOnFocus = true; } }, beforeBlur(event) { var _a, _b; return ((_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event)) || ((_b = tagTooltipRef.value) == null ? void 0 : _b.isFocusInsideContent(event)); }, afterBlur() { var _a; expanded.value = false; states.menuVisibleOnFocus = false; if (props2.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err)); } }); const hasModelValue = computed(() => { return isArray(props2.modelValue) ? props2.modelValue.length > 0 : !isEmptyValue(props2.modelValue); }); const needStatusIcon = computed(() => (form == null ? void 0 : form.statusIcon) ?? false); const showClearBtn = computed(() => { return props2.clearable && !selectDisabled.value && hasModelValue.value && (isFocused.value || states.inputHovering); }); const iconComponent = computed(() => props2.remote && props2.filterable && !props2.remoteShowSuffix ? "" : props2.suffixIcon); const iconReverse = computed(() => nsSelect.is("reverse", !!(iconComponent.value && expanded.value))); const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || ""); const validateIcon = computed(() => validateState.value && ValidateComponentsMap[validateState.value]); const debounce2 = computed(() => props2.remote ? props2.debounce : 0); const isRemoteSearchEmpty = computed(() => props2.remote && !states.inputValue && states.options.size === 0); const emptyText = computed(() => { if (props2.loading) return props2.loadingText || t("el.select.loading"); else { if (props2.filterable && states.inputValue && states.options.size > 0 && filteredOptionsCount.value === 0) return props2.noMatchText || t("el.select.noMatch"); if (states.options.size === 0) return props2.noDataText || t("el.select.noData"); } return null; }); const filteredOptionsCount = computed(() => optionsArray.value.filter((option) => option.visible).length); const optionsArray = computed(() => { const list = Array.from(states.options.values()); const newList = []; states.optionValues.forEach((item) => { const index = list.findIndex((i) => i.value === item); if (index > -1) newList.push(list[index]); }); return newList.length >= list.length ? newList : list; }); const cachedOptionsArray = computed(() => Array.from(states.cachedOptions.values())); const showNewOption = computed(() => { const hasExistingOption = optionsArray.value.filter((option) => { return !option.created; }).some((option) => { return option.currentLabel === states.inputValue; }); return props2.filterable && props2.allowCreate && states.inputValue !== "" && !hasExistingOption; }); const updateOptions2 = () => { if (props2.filterable && isFunction(props2.filterMethod)) return; if (props2.filterable && props2.remote && isFunction(props2.remoteMethod)) return; optionsArray.value.forEach((option) => { var _a; (_a = option.updateOption) == null ? void 0 : _a.call(option, states.inputValue); }); }; const selectSize = useFormSize(); const collapseTagSize = computed(() => ["small"].includes(selectSize.value) ? "small" : "default"); const dropdownMenuVisible = computed({ get() { return expanded.value && (props2.loading || !isRemoteSearchEmpty.value || props2.remote && !!slots.empty) && (!debouncing.value || !isEmpty(states.previousQuery) || states.options.size > 0); }, set(val) { expanded.value = val; } }); const shouldShowPlaceholder = computed(() => { if (props2.multiple && !isUndefined(props2.modelValue)) return castArray$1(props2.modelValue).length === 0 && !states.inputValue; const value = isArray(props2.modelValue) ? props2.modelValue[0] : props2.modelValue; return props2.filterable || isUndefined(value) ? !states.inputValue : true; }); const currentPlaceholder = computed(() => { const _placeholder = props2.placeholder ?? t("el.select.placeholder"); return props2.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel; }); const mouseEnterEventName = computed(() => isIOS ? null : "mouseenter"); watch(() => props2.modelValue, (val, oldVal) => { if (props2.multiple) { if (props2.filterable && !props2.reserveKeyword) { states.inputValue = ""; handleQueryChange(""); } } setSelected(); if (!isEqual(val, oldVal) && props2.validateEvent) formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err)); }, { flush: "post", deep: true }); watch(() => expanded.value, (val) => { if (val) handleQueryChange(states.inputValue); else { states.inputValue = ""; states.previousQuery = null; states.isBeforeHide = true; states.menuVisibleOnFocus = false; } }); watch(() => states.options.entries(), () => { if (!isClient) return; setSelected(); if (props2.defaultFirstOption && (props2.filterable || props2.remote) && filteredOptionsCount.value) checkDefaultFirstOption(); }, { flush: "post" }); watch([() => states.hoveringIndex, optionsArray], ([val]) => { if (isNumber(val) && val > -1) hoverOption.value = optionsArray.value[val] || {}; else hoverOption.value = {}; optionsArray.value.forEach((option) => { option.hover = hoverOption.value === option; }); }); watchEffect(() => { if (states.isBeforeHide) return; updateOptions2(); }); const handleQueryChange = (val) => { if (states.previousQuery === val || isComposing.value) return; states.previousQuery = val; if (props2.filterable && isFunction(props2.filterMethod)) props2.filterMethod(val); else if (props2.filterable && props2.remote && isFunction(props2.remoteMethod)) props2.remoteMethod(val); if (props2.defaultFirstOption && (props2.filterable || props2.remote) && filteredOptionsCount.value) nextTick(checkDefaultFirstOption); else nextTick(updateHoveringIndex); }; const checkDefaultFirstOption = () => { const optionsInDropdown = optionsArray.value.filter((n) => n.visible && !n.disabled && !n.states.groupDisabled); const userCreatedOption = optionsInDropdown.find((n) => n.created); const firstOriginOption = optionsInDropdown[0]; states.hoveringIndex = getValueIndex(optionsArray.value.map((item) => item.value), userCreatedOption || firstOriginOption); }; const setSelected = () => { if (!props2.multiple) { const option = getOption(isArray(props2.modelValue) ? props2.modelValue[0] : props2.modelValue); states.selectedLabel = option.currentLabel; states.selected = [option]; return; } else states.selectedLabel = ""; const result = []; if (!isUndefined(props2.modelValue)) castArray$1(props2.modelValue).forEach((value) => { result.push(getOption(value)); }); states.selected = result; }; const getOption = (value) => { let option; const isObjectValue = isPlainObject$1(value); for (let i = states.cachedOptions.size - 1; i >= 0; i--) { const cachedOption = cachedOptionsArray.value[i]; if (isObjectValue ? get(cachedOption.value, props2.valueKey) === get(value, props2.valueKey) : cachedOption.value === value) { option = { index: optionsArray.value.filter((opt) => !opt.created).indexOf(cachedOption), value, currentLabel: cachedOption.currentLabel, get isDisabled() { return cachedOption.isDisabled; } }; break; } } if (option) return option; return { index: -1, value, currentLabel: isObjectValue ? value.label : value ?? "" }; }; const updateHoveringIndex = () => { const length = states.selected.length; if (length > 0) { const lastOption = states.selected[length - 1]; states.hoveringIndex = optionsArray.value.findIndex((item) => getValueKey(lastOption) === getValueKey(item)); } else states.hoveringIndex = -1; }; const resetSelectionWidth = () => { states.selectionWidth = Number.parseFloat(window.getComputedStyle(selectionRef.value).width); }; const resetCollapseItemWidth = () => { states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width; }; const updateTooltip = () => { var _a, _b; (_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a); }; const updateTagTooltip = () => { var _a, _b; (_b = (_a = tagTooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a); }; const onInputChange = () => { if (states.inputValue.length > 0 && !expanded.value) expanded.value = true; handleQueryChange(states.inputValue); }; const onInput = (event) => { states.inputValue = event.target.value; if (props2.remote) { debouncing.value = true; debouncedOnInputChange(); } else return onInputChange(); }; const debouncedOnInputChange = useDebounceFn(() => { onInputChange(); debouncing.value = false; }, debounce2); const emitChange = (val) => { if (!isEqual(props2.modelValue, val)) emit(CHANGE_EVENT, val); }; const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) => { const option = states.cachedOptions.get(it); return !(option == null ? void 0 : option.disabled) && !(option == null ? void 0 : option.states.groupDisabled); }); const deletePrevTag = (e) => { const code = getEventCode(e); if (!props2.multiple) return; if (code === EVENT_CODE.delete) return; if (e.target.value.length <= 0) { const value = castArray$1(props2.modelValue).slice(); const lastNotDisabledIndex = getLastNotDisabledIndex(value); if (lastNotDisabledIndex < 0) return; const removeTagValue = value[lastNotDisabledIndex]; value.splice(lastNotDisabledIndex, 1); emit(UPDATE_MODEL_EVENT, value); emitChange(value); emit("remove-tag", removeTagValue); } }; const deleteTag = (event, tag) => { const index = states.selected.indexOf(tag); if (index > -1 && !selectDisabled.value) { const value = castArray$1(props2.modelValue).slice(); value.splice(index, 1); emit(UPDATE_MODEL_EVENT, value); emitChange(value); emit("remove-tag", tag.value); } event.stopPropagation(); focus(); }; const deleteSelected = (event) => { event.stopPropagation(); const value = props2.multiple ? [] : valueOnClear.value; if (props2.multiple) { for (const item of states.selected) if (item.isDisabled) value.push(item.value); } emit(UPDATE_MODEL_EVENT, value); emitChange(value); states.hoveringIndex = -1; expanded.value = false; emit("clear"); focus(); }; const handleOptionSelect = (option) => { if (props2.multiple) { const value = castArray$1(props2.modelValue ?? []).slice(); const optionIndex = getValueIndex(value, option); if (optionIndex > -1) value.splice(optionIndex, 1); else if (props2.multipleLimit <= 0 || value.length < props2.multipleLimit) value.push(option.value); emit(UPDATE_MODEL_EVENT, value); emitChange(value); if (option.created) handleQueryChange(""); if (props2.filterable && (option.created || !props2.reserveKeyword)) states.inputValue = ""; } else { !isEqual(props2.modelValue, option.value) && emit(UPDATE_MODEL_EVENT, option.value); emitChange(option.value); expanded.value = false; } focus(); if (expanded.value) return; nextTick(() => { scrollToOption(option); }); }; const getValueIndex = (arr, option) => { if (isUndefined(option)) return -1; if (!isObject(option.value)) return arr.indexOf(option.value); return arr.findIndex((item) => { return isEqual(get(item, props2.valueKey), getValueKey(option)); }); }; const scrollToOption = (option) => { var _a, _b, _c, _d, _e; const targetOption = isArray(option) ? option[option.length - 1] : option; let target = null; if (!isNil(targetOption == null ? void 0 : targetOption.value)) { const options = optionsArray.value.filter((item) => item.value === targetOption.value); if (options.length > 0) target = options[0].$el; } if (tooltipRef.value && target) { const menu = (_d = (_c = (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef) == null ? void 0 : _c.querySelector) == null ? void 0 : _d.call(_c, `.${nsSelect.be("dropdown", "wrap")}`); if (menu) scrollIntoView(menu, target); } (_e = scrollbarRef.value) == null ? void 0 : _e.handleScroll(); }; const onOptionCreate = (vm) => { states.options.set(vm.value, vm); states.cachedOptions.set(vm.value, vm); }; const onOptionDestroy = (key, vm) => { if (states.options.get(key) === vm) states.options.delete(key); }; const popperRef = computed(() => { var _a, _b; return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef; }); const handleMenuEnter = () => { states.isBeforeHide = false; nextTick(() => { var _a; (_a = scrollbarRef.value) == null ? void 0 : _a.update(); scrollToOption(states.selected); }); }; const focus = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.focus(); }; const blur = () => { var _a; if (expanded.value) { expanded.value = false; nextTick(() => { var _a2; return (_a2 = inputRef.value) == null ? void 0 : _a2.blur(); }); return; } (_a = inputRef.value) == null ? void 0 : _a.blur(); }; const handleClearClick = (event) => { deleteSelected(event); }; const handleClickOutside = (event) => { expanded.value = false; if (isFocused.value) { const _event2 = new FocusEvent("blur", event); nextTick(() => handleBlur(_event2)); } }; const handleEsc = () => { if (states.inputValue.length > 0) states.inputValue = ""; else expanded.value = false; }; const toggleMenu = (event) => { var _a; if (selectDisabled.value || props2.filterable && expanded.value && event && !((_a = suffixRef.value) == null ? void 0 : _a.contains(event.target))) return; if (isIOS) states.inputHovering = true; if (states.menuVisibleOnFocus) states.menuVisibleOnFocus = false; else expanded.value = !expanded.value; }; const selectOption = () => { if (!expanded.value) toggleMenu(); else { const option = optionsArray.value[states.hoveringIndex]; if (option && !option.isDisabled) handleOptionSelect(option); } }; const getValueKey = (item) => { return isObject(item.value) ? get(item.value, props2.valueKey) : item.value; }; const optionsAllDisabled = computed(() => optionsArray.value.filter((option) => option.visible).every((option) => option.isDisabled)); const showTagList = computed(() => { if (!props2.multiple) return []; return props2.collapseTags ? states.selected.slice(0, props2.maxCollapseTags) : states.selected; }); const collapseTagList = computed(() => { if (!props2.multiple) return []; return props2.collapseTags ? states.selected.slice(props2.maxCollapseTags) : []; }); const navigateOptions = (direction2) => { if (!expanded.value) { expanded.value = true; return; } if (states.options.size === 0 || filteredOptionsCount.value === 0 || isComposing.value) return; if (!optionsAllDisabled.value) { if (direction2 === "next") { states.hoveringIndex++; if (states.hoveringIndex === states.options.size) states.hoveringIndex = 0; } else if (direction2 === "prev") { states.hoveringIndex--; if (states.hoveringIndex < 0) states.hoveringIndex = states.options.size - 1; } const option = optionsArray.value[states.hoveringIndex]; if (option.isDisabled || !option.visible) navigateOptions(direction2); nextTick(() => scrollToOption(hoverOption.value)); } }; const findFocusableIndex = (arr, start, step2, len) => { for (let i = start; i >= 0 && i < len; i += step2) { const obj = arr[i]; if (!(obj == null ? void 0 : obj.isDisabled) && (obj == null ? void 0 : obj.visible)) return i; } return null; }; const focusOption = (targetIndex, mode) => { const len = states.options.size; if (len === 0) return; const start = clamp(targetIndex, 0, len - 1); const options = optionsArray.value; const direction2 = mode === "up" ? -1 : 1; const newIndex = findFocusableIndex(options, start, direction2, len) ?? findFocusableIndex(options, start - direction2, -direction2, len); if (newIndex != null) { states.hoveringIndex = newIndex; nextTick(() => scrollToOption(hoverOption.value)); } }; const handleKeydown = (e) => { const code = getEventCode(e); let isPreventDefault = true; switch (code) { case EVENT_CODE.up: navigateOptions("prev"); break; case EVENT_CODE.down: navigateOptions("next"); break; case EVENT_CODE.enter: case EVENT_CODE.numpadEnter: if (!isComposing.value) selectOption(); break; case EVENT_CODE.esc: handleEsc(); break; case EVENT_CODE.backspace: isPreventDefault = false; deletePrevTag(e); return; case EVENT_CODE.home: if (!expanded.value) return; focusOption(0, "down"); break; case EVENT_CODE.end: if (!expanded.value) return; focusOption(states.options.size - 1, "up"); break; case EVENT_CODE.pageUp: if (!expanded.value) return; focusOption(states.hoveringIndex - 10, "up"); break; case EVENT_CODE.pageDown: if (!expanded.value) return; focusOption(states.hoveringIndex + 10, "down"); break; default: isPreventDefault = false; break; } if (isPreventDefault) { e.preventDefault(); e.stopPropagation(); } }; const getGapWidth = () => { if (!selectionRef.value) return 0; const style = window.getComputedStyle(selectionRef.value); return Number.parseFloat(style.gap || "6px"); }; const tagStyle = computed(() => { const gapWidth = getGapWidth(); const inputSlotWidth = props2.filterable ? gapWidth + MINIMUM_INPUT_WIDTH : 0; return { maxWidth: `${collapseItemRef.value && props2.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.selectionWidth - inputSlotWidth}px` }; }); const collapseTagStyle = computed(() => { return { maxWidth: `${states.selectionWidth}px` }; }); const popupScroll = (data) => { emit("popup-scroll", data); }; useResizeObserver(selectionRef, resetSelectionWidth); useResizeObserver(wrapperRef, updateTooltip); useResizeObserver(tagMenuRef, updateTagTooltip); useResizeObserver(collapseItemRef, resetCollapseItemWidth); let stop; watch(() => dropdownMenuVisible.value, (newVal) => { if (newVal) stop = useResizeObserver(menuRef, updateTooltip).stop; else { stop == null ? void 0 : stop(); stop = void 0; } emit("visible-change", newVal); }); onMounted(() => { setSelected(); }); return { inputId, contentId, nsSelect, nsInput, states, isFocused, expanded, optionsArray, hoverOption, selectSize, filteredOptionsCount, updateTooltip, updateTagTooltip, debouncedOnInputChange, onInput, deletePrevTag, deleteTag, deleteSelected, handleOptionSelect, scrollToOption, hasModelValue, shouldShowPlaceholder, currentPlaceholder, mouseEnterEventName, needStatusIcon, showClearBtn, iconComponent, iconReverse, validateState, validateIcon, showNewOption, updateOptions: updateOptions2, collapseTagSize, setSelected, selectDisabled, emptyText, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd, handleKeydown, onOptionCreate, onOptionDestroy, handleMenuEnter, focus, blur, handleClearClick, handleClickOutside, handleEsc, toggleMenu, selectOption, getValueKey, navigateOptions, dropdownMenuVisible, showTagList, collapseTagList, popupScroll, getOption, tagStyle, collapseTagStyle, popperRef, inputRef, tooltipRef, tagTooltipRef, prefixRef, suffixRef, selectRef, wrapperRef, selectionRef, scrollbarRef, menuRef, tagMenuRef, collapseItemRef }; }; var options_default = defineComponent({ name: "ElOptions", setup(_, { slots }) { const select = inject(selectKey); let cachedValueList = []; return () => { var _a, _b; const children = (_a = slots.default) == null ? void 0 : _a.call(slots); const valueList = []; function filterOptions(children2) { if (!isArray(children2)) return; children2.forEach((item) => { var _a2, _b2, _c, _d; const name = (_a2 = (item == null ? void 0 : item.type) || {}) == null ? void 0 : _a2.name; if (name === "ElOptionGroup") filterOptions(!isString(item.children) && !isArray(item.children) && isFunction((_b2 = item.children) == null ? void 0 : _b2.default) ? (_c = item.children) == null ? void 0 : _c.default() : item.children); else if (name === "ElOption") valueList.push((_d = item.props) == null ? void 0 : _d.value); else if (isArray(item.children)) filterOptions(item.children); }); } if (children.length) filterOptions((_b = children[0]) == null ? void 0 : _b.children); if (!isEqual(valueList, cachedValueList)) { cachedValueList = valueList; if (select) select.states.optionValues = valueList; } return children; }; } }); const COMPONENT_NAME$d = "ElSelect"; const warnHandlerMap = /* @__PURE__ */ new WeakMap(); const createSelectWarnHandler = (appContext) => { return (...args) => { var _a, _b; const message2 = args[0]; if (!message2 || message2.includes('Slot "default" invoked outside of the render function') && ((_a = args[2]) == null ? void 0 : _a.includes("ElTreeSelect"))) return; const original = (_b = warnHandlerMap.get(appContext)) == null ? void 0 : _b.originalWarnHandler; if (original) { original(...args); return; } console.warn(...args); }; }; const getWarnHandlerRecord = (appContext) => { let record = warnHandlerMap.get(appContext); if (!record) { record = { originalWarnHandler: appContext.config.warnHandler, handler: createSelectWarnHandler(appContext), count: 0 }; warnHandlerMap.set(appContext, record); } return record; }; var select_vue_vue_type_script_lang_default$1 = defineComponent({ name: COMPONENT_NAME$d, componentName: COMPONENT_NAME$d, components: { ElSelectMenu: select_dropdown_default$1, ElOption: option_default, ElOptions: options_default, ElOptionGroup: option_group_default, ElTag, ElScrollbar, ElTooltip, ElIcon }, directives: { ClickOutside }, props: selectProps, emits: [ UPDATE_MODEL_EVENT, CHANGE_EVENT, "remove-tag", "clear", "visible-change", "focus", "blur", "popup-scroll" ], setup(props2, { emit, slots }) { const instance = getCurrentInstance(); const warnRecord = getWarnHandlerRecord(instance.appContext); warnRecord.count += 1; instance.appContext.config.warnHandler = warnRecord.handler; const modelValue = computed(() => { const { modelValue: rawModelValue, multiple } = props2; const fallback = multiple ? [] : void 0; if (isArray(rawModelValue)) return multiple ? rawModelValue : fallback; return multiple ? fallback : rawModelValue; }); const _props = reactive({ ...toRefs(props2), modelValue }); const API = useSelect$2(_props, emit); const { calculatorRef, inputStyle } = useCalcInputWidth(); const { getLabel, getValue, getOptions, getDisabled } = useProps(props2); const getOptionProps = (option) => ({ label: getLabel(option), value: getValue(option), disabled: getDisabled(option) }); const flatTreeSelectData = (data) => { return data.reduce((acc, item) => { acc.push(item); if (item.children && item.children.length > 0) acc.push(...flatTreeSelectData(item.children)); return acc; }, []); }; const manuallyRenderSlots = (vnodes) => { flattedChildren(vnodes || []).forEach((item) => { var _a; if (isObject(item) && (item.type.name === "ElOption" || item.type.name === "ElTree")) { const _name = item.type.name; if (_name === "ElTree") flatTreeSelectData(((_a = item.props) == null ? void 0 : _a.data) || []).forEach((treeItem) => { treeItem.currentLabel = treeItem.label ?? (isObject(treeItem.value) ? "" : treeItem.value); API.onOptionCreate(treeItem); }); else if (_name === "ElOption") { const obj = { ...item.props }; obj.currentLabel = obj.label ?? (isObject(obj.value) ? "" : obj.value); API.onOptionCreate(obj); } } }); }; watch(() => { var _a; return [props2.persistent || API.expanded.value || !slots.default ? void 0 : (_a = slots.default) == null ? void 0 : _a.call(slots), modelValue.value]; }, () => { var _a; if (props2.persistent || API.expanded.value) return; if (!slots.default) return; API.states.options.clear(); manuallyRenderSlots((_a = slots.default) == null ? void 0 : _a.call(slots)); }, { immediate: true }); provide(selectKey, reactive({ props: _props, states: API.states, selectRef: API.selectRef, optionsArray: API.optionsArray, setSelected: API.setSelected, handleOptionSelect: API.handleOptionSelect, onOptionCreate: API.onOptionCreate, onOptionDestroy: API.onOptionDestroy })); const selectedLabel = computed(() => { if (!props2.multiple) return API.states.selectedLabel; return API.states.selected.map((i) => i.currentLabel); }); onBeforeUnmount(() => { const record = warnHandlerMap.get(instance.appContext); if (!record) return; record.count -= 1; if (record.count <= 0) { instance.appContext.config.warnHandler = record.originalWarnHandler; warnHandlerMap.delete(instance.appContext); } }); return { ...API, modelValue, selectedLabel, calculatorRef, inputStyle, getLabel, getValue, getOptions, getDisabled, getOptionProps }; } }); const _hoisted_1$12 = [ "id", "value", "name", "disabled", "autocomplete", "tabindex", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label" ]; const _hoisted_2$B = ["textContent"]; const _hoisted_3$h = { key: 1 }; function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_tag = resolveComponent("el-tag"); const _component_el_tooltip = resolveComponent("el-tooltip"); const _component_el_icon = resolveComponent("el-icon"); const _component_el_option = resolveComponent("el-option"); const _component_el_option_group = resolveComponent("el-option-group"); const _component_el_options = resolveComponent("el-options"); const _component_el_scrollbar = resolveComponent("el-scrollbar"); const _component_el_select_menu = resolveComponent("el-select-menu"); const _directive_click_outside = resolveDirective("click-outside"); return withDirectives((openBlock(), createElementBlock("div", mergeProps({ ref: "selectRef", class: [_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)] }, { [toHandlerKey(_ctx.mouseEnterEventName)]: _cache[11] || (_cache[11] = ($event) => _ctx.states.inputHovering = true) }, { onMouseleave: _cache[12] || (_cache[12] = ($event) => _ctx.states.inputHovering = false) }), [createVNode(_component_el_tooltip, { ref: "tooltipRef", visible: _ctx.dropdownMenuVisible, placement: _ctx.placement, teleported: _ctx.teleported, "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass], "popper-style": _ctx.popperStyle, "popper-options": _ctx.popperOptions, "fallback-placements": _ctx.fallbackPlacements, effect: _ctx.effect, pure: "", trigger: "click", transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": false, "gpu-acceleration": false, persistent: _ctx.persistent, "append-to": _ctx.appendTo, "show-arrow": _ctx.showArrow, offset: _ctx.offset, onBeforeShow: _ctx.handleMenuEnter, onHide: _cache[10] || (_cache[10] = ($event) => _ctx.states.isBeforeHide = false) }, { default: withCtx(() => { var _a; return [createBaseVNode("div", { ref: "wrapperRef", class: normalizeClass([ _ctx.nsSelect.e("wrapper"), _ctx.nsSelect.is("focused", _ctx.isFocused), _ctx.nsSelect.is("hovering", _ctx.states.inputHovering), _ctx.nsSelect.is("filterable", _ctx.filterable), _ctx.nsSelect.is("disabled", _ctx.selectDisabled) ]), onClick: _cache[7] || (_cache[7] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["prevent"])) }, [ _ctx.$slots.prefix ? (openBlock(), createElementBlock("div", { key: 0, ref: "prefixRef", class: normalizeClass(_ctx.nsSelect.e("prefix")) }, [renderSlot(_ctx.$slots, "prefix")], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref: "selectionRef", class: normalizeClass([_ctx.nsSelect.e("selection"), _ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.states.selected.length)]) }, [ _ctx.multiple ? renderSlot(_ctx.$slots, "tag", { key: 0, data: _ctx.states.selected, deleteTag: _ctx.deleteTag, selectDisabled: _ctx.selectDisabled }, () => { var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m; return [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => { return openBlock(), createElementBlock("div", { key: _ctx.getValueKey(item), class: normalizeClass(_ctx.nsSelect.e("selected-item")) }, [createVNode(_component_el_tag, { closable: !_ctx.selectDisabled && !item.isDisabled, size: _ctx.collapseTagSize, type: _ctx.tagType, effect: _ctx.tagEffect, "disable-transitions": "", style: normalizeStyle(_ctx.tagStyle), onClose: ($event) => _ctx.deleteTag($event, item) }, { default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, [renderSlot(_ctx.$slots, "label", { index: item.index, label: item.currentLabel, value: item.value }, () => [createTextVNode(toDisplayString(item.currentLabel), 1)])], 2)]), _: 2 }, 1032, [ "closable", "size", "type", "effect", "style", "onClose" ])], 2); }), 128)), _ctx.collapseTags && _ctx.states.selected.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, { key: 0, ref: "tagTooltipRef", disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip, "fallback-placements": ((_a2 = _ctx.tagTooltip) == null ? void 0 : _a2.fallbackPlacements) ?? [ "bottom", "top", "right", "left" ], effect: ((_b = _ctx.tagTooltip) == null ? void 0 : _b.effect) ?? _ctx.effect, placement: ((_c = _ctx.tagTooltip) == null ? void 0 : _c.placement) ?? "bottom", "popper-class": ((_d = _ctx.tagTooltip) == null ? void 0 : _d.popperClass) ?? _ctx.popperClass, "popper-style": ((_e = _ctx.tagTooltip) == null ? void 0 : _e.popperStyle) ?? _ctx.popperStyle, teleported: ((_f = _ctx.tagTooltip) == null ? void 0 : _f.teleported) ?? _ctx.teleported, "append-to": ((_g = _ctx.tagTooltip) == null ? void 0 : _g.appendTo) ?? _ctx.appendTo, "popper-options": ((_h = _ctx.tagTooltip) == null ? void 0 : _h.popperOptions) ?? _ctx.popperOptions, transition: (_i = _ctx.tagTooltip) == null ? void 0 : _i.transition, "show-after": (_j = _ctx.tagTooltip) == null ? void 0 : _j.showAfter, "hide-after": (_k = _ctx.tagTooltip) == null ? void 0 : _k.hideAfter, "auto-close": (_l = _ctx.tagTooltip) == null ? void 0 : _l.autoClose, offset: (_m = _ctx.tagTooltip) == null ? void 0 : _m.offset }, { default: withCtx(() => [createBaseVNode("div", { ref: "collapseItemRef", class: normalizeClass(_ctx.nsSelect.e("selected-item")) }, [createVNode(_component_el_tag, { closable: false, size: _ctx.collapseTagSize, type: _ctx.tagType, effect: _ctx.tagEffect, "disable-transitions": "", style: normalizeStyle(_ctx.collapseTagStyle) }, { default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, " + " + toDisplayString(_ctx.states.selected.length - _ctx.maxCollapseTags), 3)]), _: 1 }, 8, [ "size", "type", "effect", "style" ])], 2)]), content: withCtx(() => [createBaseVNode("div", { ref: "tagMenuRef", class: normalizeClass(_ctx.nsSelect.e("selection")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (item) => { return openBlock(), createElementBlock("div", { key: _ctx.getValueKey(item), class: normalizeClass(_ctx.nsSelect.e("selected-item")) }, [createVNode(_component_el_tag, { class: "in-tooltip", closable: !_ctx.selectDisabled && !item.isDisabled, size: _ctx.collapseTagSize, type: _ctx.tagType, effect: _ctx.tagEffect, "disable-transitions": "", onClose: ($event) => _ctx.deleteTag($event, item) }, { default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, [renderSlot(_ctx.$slots, "label", { index: item.index, label: item.currentLabel, value: item.value }, () => [createTextVNode(toDisplayString(item.currentLabel), 1)])], 2)]), _: 2 }, 1032, [ "closable", "size", "type", "effect", "onClose" ])], 2); }), 128))], 2)]), _: 3 }, 8, [ "disabled", "fallback-placements", "effect", "placement", "popper-class", "popper-style", "teleported", "append-to", "popper-options", "transition", "show-after", "hide-after", "auto-close", "offset" ])) : createCommentVNode("v-if", true)]; }) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass([ _ctx.nsSelect.e("selected-item"), _ctx.nsSelect.e("input-wrapper"), _ctx.nsSelect.is("hidden", !_ctx.filterable || _ctx.selectDisabled || !_ctx.states.inputValue && !_ctx.isFocused) ]) }, [createBaseVNode("input", { id: _ctx.inputId, ref: "inputRef", value: _ctx.states.inputValue, type: "text", name: _ctx.name, class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]), disabled: _ctx.selectDisabled, autocomplete: _ctx.autocomplete, style: normalizeStyle(_ctx.inputStyle), tabindex: _ctx.tabindex, role: "combobox", readonly: !_ctx.filterable, spellcheck: "false", "aria-activedescendant": ((_a = _ctx.hoverOption) == null ? void 0 : _a.id) || "", "aria-controls": _ctx.contentId, "aria-expanded": _ctx.dropdownMenuVisible, "aria-label": _ctx.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: _cache[0] || (_cache[0] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args)), onCompositionstart: _cache[1] || (_cache[1] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)), onCompositionupdate: _cache[2] || (_cache[2] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)), onCompositionend: _cache[3] || (_cache[3] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)), onInput: _cache[4] || (_cache[4] = (...args) => _ctx.onInput && _ctx.onInput(...args)), onChange: _cache[5] || (_cache[5] = withModifiers(() => { }, ["stop"])), onClick: _cache[6] || (_cache[6] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"])) }, null, 46, _hoisted_1$12), _ctx.filterable ? (openBlock(), createElementBlock("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: normalizeClass(_ctx.nsSelect.e("input-calculator")), textContent: toDisplayString(_ctx.states.inputValue) }, null, 10, _hoisted_2$B)) : createCommentVNode("v-if", true)], 2), _ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([ _ctx.nsSelect.e("selected-item"), _ctx.nsSelect.e("placeholder"), _ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue) ]) }, [_ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", { key: 0, index: _ctx.getOption(_ctx.modelValue).index, label: _ctx.currentPlaceholder, value: _ctx.modelValue }, () => [createBaseVNode("span", null, toDisplayString(_ctx.currentPlaceholder), 1)]) : (openBlock(), createElementBlock("span", _hoisted_3$h, toDisplayString(_ctx.currentPlaceholder), 1))], 2)) : createCommentVNode("v-if", true) ], 2), createBaseVNode("div", { ref: "suffixRef", class: normalizeClass(_ctx.nsSelect.e("suffix")) }, [ _ctx.iconComponent && !_ctx.showClearBtn ? (openBlock(), createBlock(_component_el_icon, { key: 0, class: normalizeClass([ _ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.iconReverse ]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), _ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, { key: 1, class: normalizeClass([ _ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.nsSelect.e("clear") ]), onClick: _ctx.handleClearClick }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), _ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, { key: 2, class: normalizeClass([ _ctx.nsInput.e("icon"), _ctx.nsInput.e("validateIcon"), _ctx.nsInput.is("loading", _ctx.validateState === "validating") ]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)]; }), content: withCtx(() => [createVNode(_component_el_select_menu, { ref: "menuRef" }, { default: withCtx(() => [ _ctx.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(_ctx.nsSelect.be("dropdown", "header")), onClick: _cache[8] || (_cache[8] = withModifiers(() => { }, ["stop"])) }, [renderSlot(_ctx.$slots, "header")], 2)) : createCommentVNode("v-if", true), withDirectives(createVNode(_component_el_scrollbar, { id: _ctx.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": _ctx.nsSelect.be("dropdown", "wrap"), "view-class": _ctx.nsSelect.be("dropdown", "list"), class: normalizeClass([_ctx.nsSelect.is("empty", _ctx.filteredOptionsCount === 0)]), role: "listbox", "aria-label": _ctx.ariaLabel, "aria-orientation": "vertical", onScroll: _ctx.popupScroll }, { default: withCtx(() => [_ctx.showNewOption ? (openBlock(), createBlock(_component_el_option, { key: 0, value: _ctx.states.inputValue, created: true }, null, 8, ["value"])) : createCommentVNode("v-if", true), createVNode(_component_el_options, null, { default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index) => { var _a; return openBlock(), createElementBlock(Fragment, { key: index }, [((_a = _ctx.getOptions(option)) == null ? void 0 : _a.length) ? (openBlock(), createBlock(_component_el_option_group, { key: 0, label: _ctx.getLabel(option), disabled: _ctx.getDisabled(option) }, { default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.getOptions(option), (item) => { return openBlock(), createBlock(_component_el_option, mergeProps({ key: _ctx.getValue(item) }, { ref_for: true }, _ctx.getOptionProps(item)), null, 16); }), 128))]), _: 2 }, 1032, ["label", "disabled"])) : (openBlock(), createBlock(_component_el_option, mergeProps({ key: 1, ref_for: true }, _ctx.getOptionProps(option)), null, 16))], 64); }), 128))])]), _: 3 })]), _: 3 }, 8, [ "id", "wrap-class", "view-class", "class", "aria-label", "onScroll" ]), [[vShow, _ctx.states.options.size > 0 && !_ctx.loading]]), _ctx.$slots.loading && _ctx.loading ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading")) }, [renderSlot(_ctx.$slots, "loading")], 2)) : _ctx.loading || _ctx.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createBaseVNode("span", null, toDisplayString(_ctx.emptyText), 1)])], 2)) : createCommentVNode("v-if", true), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", { key: 3, class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer")), onClick: _cache[9] || (_cache[9] = withModifiers(() => { }, ["stop"])) }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true) ]), _: 3 }, 512)]), _: 3 }, 8, [ "visible", "placement", "teleported", "popper-class", "popper-style", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow" ])], 16)), [[ _directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef ]]); } var select_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(select_vue_vue_type_script_lang_default$1, [["render", _sfc_render$h]]); const ElSelect = withInstall(select_default$1, { Option: option_default, OptionGroup: option_group_default }); const ElOption = withNoopInstall(option_default); const ElOptionGroup = withNoopInstall(option_group_default); const getPrevMonthLastDays = (date, count) => { const lastDay = date.subtract(1, "month").endOf("month").date(); return rangeArr(count).map((_, index) => lastDay - (count - index - 1)); }; const getMonthDays = (date) => { return rangeArr(date.daysInMonth()).map((_, index) => index + 1); }; const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => { const start = index * 7; return days.slice(start, start + 7); }); const dateTableProps = buildProps({ selectedDay: { type: definePropType(Object) }, range: { type: definePropType(Array) }, date: { type: definePropType(Object), required: true }, hideHeader: { type: Boolean } }); const dateTableEmits = { pick: (value) => isObject(value) }; const useDateTable = (props2, emit) => { dayjs.extend(localeData); const firstDayOfWeek = dayjs.localeData().firstDayOfWeek(); const { t, lang } = useLocale(); const now = dayjs().locale(lang.value); const isInRange = computed(() => !!props2.range && !!props2.range.length); const rows = computed(() => { let days = []; if (isInRange.value) { const [start, end] = props2.range; const currentMonthRange = rangeArr(end.date() - start.date() + 1).map((index) => ({ text: start.date() + index, type: "current" })); let remaining = currentMonthRange.length % 7; remaining = remaining === 0 ? 0 : 7 - remaining; const nextMonthRange = rangeArr(remaining).map((_, index) => ({ text: index + 1, type: "next" })); days = currentMonthRange.concat(nextMonthRange); } else { const firstDay = props2.date.startOf("month").day(); const prevMonthDays = getPrevMonthLastDays(props2.date, (firstDay - firstDayOfWeek + 7) % 7).map((day) => ({ text: day, type: "prev" })); const currentMonthDays = getMonthDays(props2.date).map((day) => ({ text: day, type: "current" })); days = [...prevMonthDays, ...currentMonthDays]; const nextMonthDays = rangeArr(7 - (days.length % 7 || 7)).map((_, index) => ({ text: index + 1, type: "next" })); days = days.concat(nextMonthDays); } return toNestedArr(days); }); const weekDays = computed(() => { const start = firstDayOfWeek; if (start === 0) return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`)); else return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start)).map((_) => t(`el.datepicker.weeks.${_}`)); }); const getFormattedDate = (day, type) => { switch (type) { case "prev": return props2.date.startOf("month").subtract(1, "month").date(day); case "next": return props2.date.startOf("month").add(1, "month").date(day); case "current": return props2.date.date(day); } }; const handlePickDay = ({ text, type }) => { emit("pick", getFormattedDate(text, type)); }; const getSlotData = ({ text, type }) => { const day = getFormattedDate(text, type); return { isSelected: day.isSame(props2.selectedDay), type: `${type}-month`, day: day.format(DEFAULT_FORMATS_DATE), date: day.toDate() }; }; return { now, isInRange, rows, weekDays, getFormattedDate, handlePickDay, getSlotData }; }; const _hoisted_1$11 = { key: 0 }; const _hoisted_2$A = ["onClick"]; var date_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "DateTable", __name: "date-table", props: dateTableProps, emits: dateTableEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const { isInRange, now, rows, weekDays, getFormattedDate, handlePickDay, getSlotData } = useDateTable(props2, __emit); const nsTable = useNamespace("calendar-table"); const nsDay = useNamespace("calendar-day"); const getCellClass = ({ text, type }) => { const classes = [type]; if (type === "current") { const date = getFormattedDate(text, type); if (date.isSame(props2.selectedDay, "day")) classes.push(nsDay.is("selected")); if (date.isSame(now, "day")) classes.push(nsDay.is("today")); } return classes; }; __expose({ getFormattedDate }); return (_ctx, _cache) => { return openBlock(), createElementBlock("table", { class: normalizeClass([unref(nsTable).b(), unref(nsTable).is("range", unref(isInRange))]), cellspacing: "0", cellpadding: "0" }, [!__props.hideHeader ? (openBlock(), createElementBlock("thead", _hoisted_1$11, [createBaseVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(weekDays), (day) => { return openBlock(), createElementBlock("th", { key: day, scope: "col" }, toDisplayString(day), 1); }), 128))])])) : createCommentVNode("v-if", true), createBaseVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, index) => { return openBlock(), createElementBlock("tr", { key: index, class: normalizeClass({ [unref(nsTable).e("row")]: true, [unref(nsTable).em("row", "hide-border")]: index === 0 && __props.hideHeader }) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key) => { return openBlock(), createElementBlock("td", { key, class: normalizeClass(getCellClass(cell)), onClick: ($event) => unref(handlePickDay)(cell) }, [createBaseVNode("div", { class: normalizeClass(unref(nsDay).b()) }, [renderSlot(_ctx.$slots, "date-cell", { data: unref(getSlotData)(cell) }, () => [createBaseVNode("span", null, toDisplayString(cell.text), 1)])], 2)], 10, _hoisted_2$A); }), 128))], 2); }), 128))])], 2); }; } }); var date_table_default = date_table_vue_vue_type_script_setup_true_lang_default; const adjacentMonth = (start, end) => { const firstMonthLastDay = start.endOf("month"); const lastMonthFirstDay = end.startOf("month"); const lastMonthStartDay = firstMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay; return [[start, firstMonthLastDay], [lastMonthStartDay.startOf("week"), end]]; }; const threeConsecutiveMonth = (start, end) => { const firstMonthLastDay = start.endOf("month"); const secondMonthFirstDay = start.add(1, "month").startOf("month"); const secondMonthStartDay = firstMonthLastDay.isSame(secondMonthFirstDay, "week") ? secondMonthFirstDay.add(1, "week") : secondMonthFirstDay; const secondMonthLastDay = secondMonthStartDay.endOf("month"); const lastMonthFirstDay = end.startOf("month"); const lastMonthStartDay = secondMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay; return [ [start, firstMonthLastDay], [secondMonthStartDay.startOf("week"), secondMonthLastDay], [lastMonthStartDay.startOf("week"), end] ]; }; const useCalendar = (props2, emit, componentName2) => { const { lang } = useLocale(); const selectedDay = ref(); const now = dayjs().locale(lang.value); const realSelectedDay = computed({ get() { if (!props2.modelValue) return selectedDay.value; return date.value; }, set(val) { if (!val) return; selectedDay.value = val; const result = val.toDate(); emit(INPUT_EVENT, result); emit(UPDATE_MODEL_EVENT, result); } }); const validatedRange = computed(() => { if (!props2.range || !isArray(props2.range) || props2.range.length !== 2 || props2.range.some((item) => !isDate(item))) return []; const [startDayjs, endDayjs] = props2.range.map((_) => dayjs(_).locale(lang.value)); if (startDayjs.isAfter(endDayjs)) { debugWarn(componentName2, "end time should be greater than start time"); return []; } if (startDayjs.isSame(endDayjs, "month")) return calculateValidatedDateRange(startDayjs, endDayjs); else { if (startDayjs.add(1, "month").month() !== endDayjs.month()) { debugWarn(componentName2, "start time and end time interval must not exceed two months"); return []; } return calculateValidatedDateRange(startDayjs, endDayjs); } }); const date = computed(() => { if (!props2.modelValue) return realSelectedDay.value || (validatedRange.value.length ? validatedRange.value[0][0] : now); else return dayjs(props2.modelValue).locale(lang.value); }); const prevMonthDayjs = computed(() => date.value.subtract(1, "month").date(1)); const nextMonthDayjs = computed(() => date.value.add(1, "month").date(1)); const prevYearDayjs = computed(() => date.value.subtract(1, "year").date(1)); const nextYearDayjs = computed(() => date.value.add(1, "year").date(1)); const calculateValidatedDateRange = (startDayjs, endDayjs) => { const firstDay = startDayjs.startOf("week"); const lastDay = endDayjs.endOf("week"); const firstMonth = firstDay.get("month"); const lastMonth = lastDay.get("month"); if (firstMonth === lastMonth) return [[firstDay, lastDay]]; else if ((firstMonth + 1) % 12 === lastMonth) return adjacentMonth(firstDay, lastDay); else if (firstMonth + 2 === lastMonth || (firstMonth + 1) % 11 === lastMonth) return threeConsecutiveMonth(firstDay, lastDay); else { debugWarn(componentName2, "start time and end time interval must not exceed two months"); return []; } }; const pickDay = (day) => { realSelectedDay.value = day; }; const selectDate = (type) => { const day = { "prev-month": prevMonthDayjs.value, "next-month": nextMonthDayjs.value, "prev-year": prevYearDayjs.value, "next-year": nextYearDayjs.value, today: now }[type]; if (!day.isSame(date.value, "day")) pickDay(day); }; const handleDateChange = (date2) => { if (date2 === "today") selectDate("today"); else pickDay(date2); }; return { calculateValidatedDateRange, date, realSelectedDay, pickDay, selectDate, validatedRange, handleDateChange }; }; const selectControllerProps = buildProps({ date: { type: definePropType(Object), required: true }, formatter: { type: definePropType(Function) } }); const selectControllerEmits = { "date-change": (date) => isObject(date) || isString(date) }; var select_controller_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "SelectController", __name: "select-controller", props: selectControllerProps, emits: selectControllerEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const nsSelect = useNamespace("calendar-select"); const { t, lang } = useLocale(); const monthOptions = Array.from({ length: 12 }, (_, index) => { const actualMonth = index + 1; return { value: actualMonth, label: isFunction(props2.formatter) ? props2.formatter(actualMonth, "month") : actualMonth }; }); const yearValue = computed(() => props2.date.year()); const monthValue = computed(() => props2.date.month() + 1); const yearOptions = computed(() => { const years = []; for (let i = -10; i < 10; i++) { const year = yearValue.value + i; if (year > 0) { const label = isFunction(props2.formatter) ? props2.formatter(year, "year") : year; years.push({ value: year, label }); } } return years; }); const handleYearChange = (year) => { emit("date-change", dayjs(new Date(year, monthValue.value - 1, 1)).locale(lang.value)); }; const handleMonthChange = (month) => { emit("date-change", dayjs(new Date(yearValue.value, month - 1, 1)).locale(lang.value)); }; const selectToday = () => { emit("date-change", "today"); }; return (_ctx, _cache) => { return openBlock(), createElementBlock(Fragment, null, [ createVNode(unref(ElSelect), { "model-value": yearValue.value, size: "small", class: normalizeClass(unref(nsSelect).e("year")), "validate-event": false, options: yearOptions.value, onChange: handleYearChange }, null, 8, [ "model-value", "class", "options" ]), createVNode(unref(ElSelect), { "model-value": monthValue.value, size: "small", class: normalizeClass(unref(nsSelect).e("month")), "validate-event": false, options: unref(monthOptions), onChange: handleMonthChange }, null, 8, [ "model-value", "class", "options" ]), createVNode(unref(ElButton), { size: "small", onClick: selectToday }, { default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.today")), 1)]), _: 1 }) ], 64); }; } }); var select_controller_default = select_controller_vue_vue_type_script_setup_true_lang_default; const COMPONENT_NAME$c = "ElCalendar"; var calendar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$c, __name: "calendar", props: calendarProps, emits: calendarEmits, setup(__props, { expose: __expose, emit: __emit }) { const ns = useNamespace("calendar"); const { calculateValidatedDateRange, date, pickDay, realSelectedDay, selectDate, validatedRange, handleDateChange } = useCalendar(__props, __emit, COMPONENT_NAME$c); const { t } = useLocale(); const i18nDate = computed(() => { const pickedMonth = `el.datepicker.month${date.value.format("M")}`; return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`; }); __expose({ selectedDay: realSelectedDay, pickDay, selectDate, calculateValidatedDateRange }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [createBaseVNode("div", { class: normalizeClass(unref(ns).e("header")) }, [renderSlot(_ctx.$slots, "header", { date: i18nDate.value }, () => [createBaseVNode("div", { class: normalizeClass(unref(ns).e("title")) }, toDisplayString(i18nDate.value), 3), unref(validatedRange).length === 0 && __props.controllerType === "button" ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("button-group")) }, [createVNode(unref(ElButtonGroup$1), null, { default: withCtx(() => [ createVNode(unref(ElButton), { size: "small", onClick: _cache[0] || (_cache[0] = ($event) => unref(selectDate)("prev-month")) }, { default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.prevMonth")), 1)]), _: 1 }), createVNode(unref(ElButton), { size: "small", onClick: _cache[1] || (_cache[1] = ($event) => unref(selectDate)("today")) }, { default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.today")), 1)]), _: 1 }), createVNode(unref(ElButton), { size: "small", onClick: _cache[2] || (_cache[2] = ($event) => unref(selectDate)("next-month")) }, { default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.nextMonth")), 1)]), _: 1 }) ]), _: 1 })], 2)) : unref(validatedRange).length === 0 && __props.controllerType === "select" ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("select-controller")) }, [createVNode(select_controller_default, { date: unref(date), formatter: __props.formatter, onDateChange: unref(handleDateChange) }, null, 8, [ "date", "formatter", "onDateChange" ])], 2)) : createCommentVNode("v-if", true)])], 2), unref(validatedRange).length === 0 ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("body")) }, [createVNode(date_table_default, { date: unref(date), "selected-day": unref(realSelectedDay), onPick: unref(pickDay) }, createSlots({ _: 2 }, [_ctx.$slots["date-cell"] ? { name: "date-cell", fn: withCtx((data) => [renderSlot(_ctx.$slots, "date-cell", normalizeProps(guardReactiveProps(data)))]), key: "0" } : void 0]), 1032, [ "date", "selected-day", "onPick" ])], 2)) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("body")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(validatedRange), (range_, index) => { return openBlock(), createBlock(date_table_default, { key: index, date: range_[0], "selected-day": unref(realSelectedDay), range: range_, "hide-header": index !== 0, onPick: unref(pickDay) }, createSlots({ _: 2 }, [_ctx.$slots["date-cell"] ? { name: "date-cell", fn: withCtx((data) => [renderSlot(_ctx.$slots, "date-cell", mergeProps({ ref_for: true }, data))]), key: "0" } : void 0]), 1032, [ "date", "selected-day", "range", "hide-header", "onPick" ]); }), 128))], 2))], 2); }; } }); var calendar_default = calendar_vue_vue_type_script_setup_true_lang_default; const ElCalendar = withInstall(calendar_default); const cardProps = buildProps({ header: { type: String, default: "" }, footer: { type: String, default: "" }, bodyStyle: { type: definePropType([ String, Object, Array ]), default: "" }, headerClass: String, bodyClass: String, footerClass: String, shadow: { type: String, values: [ "always", "hover", "never" ], default: void 0 } }); var card_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCard", __name: "card", props: cardProps, setup(__props) { const globalConfig2 = useGlobalConfig("card"); const ns = useNamespace("card"); return (_ctx, _cache) => { var _a; return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b(), unref(ns).is(`${__props.shadow || ((_a = unref(globalConfig2)) == null ? void 0 : _a.shadow) || "always"}-shadow`)]) }, [ _ctx.$slots.header || __props.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass([unref(ns).e("header"), __props.headerClass]) }, [renderSlot(_ctx.$slots, "header", {}, () => [createTextVNode(toDisplayString(__props.header), 1)])], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass([unref(ns).e("body"), __props.bodyClass]), style: normalizeStyle(__props.bodyStyle) }, [renderSlot(_ctx.$slots, "default")], 6), _ctx.$slots.footer || __props.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([unref(ns).e("footer"), __props.footerClass]) }, [renderSlot(_ctx.$slots, "footer", {}, () => [createTextVNode(toDisplayString(__props.footer), 1)])], 2)) : createCommentVNode("v-if", true) ], 2); }; } }); var card_default = card_vue_vue_type_script_setup_true_lang_default; const ElCard = withInstall(card_default); const carouselProps = buildProps({ initialIndex: { type: Number, default: 0 }, height: { type: String, default: "" }, trigger: { type: String, values: ["hover", "click"], default: "hover" }, autoplay: { type: Boolean, default: true }, interval: { type: Number, default: 3e3 }, indicatorPosition: { type: String, values: [ "", "none", "outside" ], default: "" }, arrow: { type: String, values: [ "always", "hover", "never" ], default: "hover" }, type: { type: String, values: ["", "card"], default: "" }, cardScale: { type: Number, default: 0.83 }, loop: { type: Boolean, default: true }, direction: { type: String, values: ["horizontal", "vertical"], default: "horizontal" }, pauseOnHover: { type: Boolean, default: true }, motionBlur: Boolean }); const carouselEmits = { change: (current, prev) => [current, prev].every(isNumber) }; const carouselContextKey = Symbol("carouselContextKey"); const CAROUSEL_ITEM_NAME = "ElCarouselItem"; const carouselItemProps = buildProps({ name: { type: String, default: "" }, label: { type: [String, Number], default: "" } }); const THROTTLE_TIME = 300; const useCarousel = (props2, emit, componentName2) => { const { children: items, addChild: addItem, removeChild: removeItem, ChildrenSorter: ItemsSorter } = useOrderedChildren(getCurrentInstance(), CAROUSEL_ITEM_NAME); const slots = useSlots(); const activeIndex = ref(-1); const timer = ref(null); const hover = ref(false); const root = ref(); const containerHeight = ref(0); const isItemsTwoLength = ref(true); const arrowDisplay = computed(() => props2.arrow !== "never" && !unref(isVertical)); const hasLabel = computed(() => { return items.value.some((item) => item.props.label.toString().length > 0); }); const isCardType = computed(() => props2.type === "card"); const isVertical = computed(() => props2.direction === "vertical"); const containerStyle = computed(() => { if (props2.height !== "auto") return { height: props2.height }; return { height: `${containerHeight.value}px`, overflow: "hidden" }; }); const throttledArrowClick = throttle((index) => { setActiveItem(index); }, THROTTLE_TIME, { trailing: true }); const throttledIndicatorHover = throttle((index) => { handleIndicatorHover(index); }, THROTTLE_TIME); const isTwoLengthShow = (index) => { if (!isItemsTwoLength.value) return true; return activeIndex.value <= 1 ? index <= 1 : index > 1; }; function pauseTimer() { if (timer.value) { clearInterval(timer.value); timer.value = null; } } function startTimer() { if (props2.interval <= 0 || !props2.autoplay || timer.value) return; timer.value = setInterval(() => playSlides(), props2.interval); } const playSlides = () => { if (activeIndex.value < items.value.length - 1) activeIndex.value = activeIndex.value + 1; else if (props2.loop) activeIndex.value = 0; }; function setActiveItem(index) { if (isString(index)) { const filteredItems = items.value.filter((item) => item.props.name === index); if (filteredItems.length > 0) index = items.value.indexOf(filteredItems[0]); } index = Number(index); if (Number.isNaN(index) || index !== Math.floor(index)) { debugWarn(componentName2, "index must be integer."); return; } const itemCount = items.value.length; const oldIndex = activeIndex.value; if (index < 0) activeIndex.value = props2.loop ? itemCount - 1 : 0; else if (index >= itemCount) activeIndex.value = props2.loop ? 0 : itemCount - 1; else activeIndex.value = index; if (oldIndex === activeIndex.value) resetItemPosition(oldIndex); resetTimer(); } function resetItemPosition(oldIndex) { items.value.forEach((item, index) => { item.translateItem(index, activeIndex.value, oldIndex); }); } function itemInStage(item, index) { var _a, _b, _c, _d; const _items = unref(items); const itemCount = _items.length; if (itemCount === 0 || !item.states.inStage) return false; const nextItemIndex = index + 1; const prevItemIndex = index - 1; const lastItemIndex = itemCount - 1; const isLastItemActive = _items[lastItemIndex].states.active; const isFirstItemActive = _items[0].states.active; const isNextItemActive = (_b = (_a = _items[nextItemIndex]) == null ? void 0 : _a.states) == null ? void 0 : _b.active; const isPrevItemActive = (_d = (_c = _items[prevItemIndex]) == null ? void 0 : _c.states) == null ? void 0 : _d.active; if (index === lastItemIndex && isFirstItemActive || isNextItemActive) return "left"; else if (index === 0 && isLastItemActive || isPrevItemActive) return "right"; return false; } function handleMouseEnter() { hover.value = true; if (props2.pauseOnHover) pauseTimer(); } function handleMouseLeave() { hover.value = false; startTimer(); } function handleButtonEnter(arrow2) { if (unref(isVertical)) return; items.value.forEach((item, index) => { if (arrow2 === itemInStage(item, index)) item.states.hover = true; }); } function handleButtonLeave() { if (unref(isVertical)) return; items.value.forEach((item) => { item.states.hover = false; }); } function handleIndicatorClick(index) { activeIndex.value = index; } function handleIndicatorHover(index) { if (props2.trigger === "hover" && index !== activeIndex.value) activeIndex.value = index; } function prev() { setActiveItem(activeIndex.value - 1); } function next() { setActiveItem(activeIndex.value + 1); } function resetTimer() { pauseTimer(); if (!props2.pauseOnHover || !hover.value) startTimer(); } function setContainerHeight(height) { if (props2.height !== "auto") return; containerHeight.value = height; } function PlaceholderItem() { var _a; const defaultSlots = (_a = slots.default) == null ? void 0 : _a.call(slots); if (!defaultSlots) return null; const normalizeSlots = flattedChildren(defaultSlots).filter((slot) => { return isVNode(slot) && slot.type.name === CAROUSEL_ITEM_NAME; }); if ((normalizeSlots == null ? void 0 : normalizeSlots.length) === 2 && props2.loop && !isCardType.value) { isItemsTwoLength.value = true; return normalizeSlots; } isItemsTwoLength.value = false; return null; } watch(() => activeIndex.value, (current, prev2) => { resetItemPosition(prev2); if (isItemsTwoLength.value) { current = current % 2; prev2 = prev2 % 2; } if (prev2 > -1) emit(CHANGE_EVENT, current, prev2); }); const exposeActiveIndex = computed({ get: () => { return isItemsTwoLength.value ? activeIndex.value % 2 : activeIndex.value; }, set: (value) => activeIndex.value = value }); watch(() => props2.autoplay, (autoplay) => { autoplay ? startTimer() : pauseTimer(); }); watch(() => props2.loop, () => { setActiveItem(activeIndex.value); }); watch(() => props2.interval, () => { resetTimer(); }); const resizeObserver = shallowRef(); onMounted(() => { watch(() => items.value, () => { if (items.value.length > 0) setActiveItem(props2.initialIndex); }, { immediate: true }); resizeObserver.value = useResizeObserver(root.value, () => { resetItemPosition(); }); startTimer(); }); onBeforeUnmount(() => { pauseTimer(); if (root.value && resizeObserver.value) resizeObserver.value.stop(); }); provide(carouselContextKey, { root, isCardType, isVertical, items, loop: props2.loop, cardScale: props2.cardScale, addItem, removeItem, setActiveItem, setContainerHeight }); return { root, activeIndex, exposeActiveIndex, arrowDisplay, hasLabel, hover, isCardType, items, isVertical, containerStyle, isItemsTwoLength, handleButtonEnter, handleButtonLeave, handleIndicatorClick, handleMouseEnter, handleMouseLeave, setActiveItem, prev, next, PlaceholderItem, isTwoLengthShow, ItemsSorter, throttledArrowClick, throttledIndicatorHover }; }; const _hoisted_1$10 = ["aria-label"]; const _hoisted_2$z = ["aria-label"]; const _hoisted_3$g = ["onMouseenter", "onClick"]; const _hoisted_4$c = ["aria-label"]; const _hoisted_5$9 = { key: 0 }; const _hoisted_6$4 = { key: 2, xmlns: "http://www.w3.org/2000/svg", version: "1.1", style: { "display": "none" } }; const COMPONENT_NAME$b = "ElCarousel"; var carousel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$b, __name: "carousel", props: carouselProps, emits: carouselEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const { root, activeIndex, exposeActiveIndex, arrowDisplay, hasLabel, hover, isCardType, items, isVertical, containerStyle, handleButtonEnter, handleButtonLeave, handleIndicatorClick, handleMouseEnter, handleMouseLeave, setActiveItem, prev, next, PlaceholderItem, isTwoLengthShow, ItemsSorter, throttledArrowClick, throttledIndicatorHover } = useCarousel(props2, __emit, COMPONENT_NAME$b); const ns = useNamespace("carousel"); const { t } = useLocale(); const carouselClasses = computed(() => { const classes = [ns.b(), ns.m(props2.direction)]; if (unref(isCardType)) classes.push(ns.m("card")); classes.push(ns.is("vertical-outside", unref(isVertical) && props2.indicatorPosition === "outside")); return classes; }); const indicatorsClasses = computed(() => { const classes = [ns.e("indicators"), ns.em("indicators", props2.direction)]; if (unref(hasLabel)) classes.push(ns.em("indicators", "labels")); if (props2.indicatorPosition === "outside") classes.push(ns.em("indicators", "outside")); if (unref(isVertical)) classes.push(ns.em("indicators", "right")); return classes; }); function handleTransitionStart(e) { if (!props2.motionBlur) return; const kls = unref(isVertical) ? `${ns.namespace.value}-transitioning-vertical` : `${ns.namespace.value}-transitioning`; e.currentTarget.classList.add(kls); } function handleTransitionEnd(e) { if (!props2.motionBlur) return; const kls = unref(isVertical) ? `${ns.namespace.value}-transitioning-vertical` : `${ns.namespace.value}-transitioning`; e.currentTarget.classList.remove(kls); } __expose({ activeIndex: exposeActiveIndex, setActiveItem, prev, next }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "root", ref: root, class: normalizeClass(carouselClasses.value), onMouseenter: _cache[6] || (_cache[6] = withModifiers((...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args), ["stop"])), onMouseleave: _cache[7] || (_cache[7] = withModifiers((...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args), ["stop"])) }, [ unref(arrowDisplay) ? (openBlock(), createBlock(Transition, { key: 0, name: "carousel-arrow-left", persisted: "" }, { default: withCtx(() => [withDirectives(createBaseVNode("button", { type: "button", class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "left")]), "aria-label": unref(t)("el.carousel.leftArrow"), onMouseenter: _cache[0] || (_cache[0] = ($event) => unref(handleButtonEnter)("left")), onMouseleave: _cache[1] || (_cache[1] = (...args) => unref(handleButtonLeave) && unref(handleButtonLeave)(...args)), onClick: _cache[2] || (_cache[2] = withModifiers(($event) => unref(throttledArrowClick)(unref(activeIndex) - 1), ["stop"])) }, [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_left_default))]), _: 1 })], 42, _hoisted_1$10), [[vShow, (__props.arrow === "always" || unref(hover)) && (__props.loop || unref(activeIndex) > 0)]])]), _: 1 })) : createCommentVNode("v-if", true), unref(arrowDisplay) ? (openBlock(), createBlock(Transition, { key: 1, name: "carousel-arrow-right", persisted: "" }, { default: withCtx(() => [withDirectives(createBaseVNode("button", { type: "button", class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "right")]), "aria-label": unref(t)("el.carousel.rightArrow"), onMouseenter: _cache[3] || (_cache[3] = ($event) => unref(handleButtonEnter)("right")), onMouseleave: _cache[4] || (_cache[4] = (...args) => unref(handleButtonLeave) && unref(handleButtonLeave)(...args)), onClick: _cache[5] || (_cache[5] = withModifiers(($event) => unref(throttledArrowClick)(unref(activeIndex) + 1), ["stop"])) }, [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_right_default))]), _: 1 })], 42, _hoisted_2$z), [[vShow, (__props.arrow === "always" || unref(hover)) && (__props.loop || unref(activeIndex) < unref(items).length - 1)]])]), _: 1 })) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("container")), style: normalizeStyle(unref(containerStyle)), onTransitionstart: handleTransitionStart, onTransitionend: handleTransitionEnd }, [createVNode(unref(PlaceholderItem)), renderSlot(_ctx.$slots, "default")], 38), createVNode(unref(ItemsSorter), null, { default: withCtx(() => [__props.indicatorPosition !== "none" ? (openBlock(), createElementBlock("ul", { key: 0, class: normalizeClass(indicatorsClasses.value) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item, index) => { return withDirectives((openBlock(), createElementBlock("li", { key: index, class: normalizeClass([ unref(ns).e("indicator"), unref(ns).em("indicator", __props.direction), unref(ns).is("active", index === unref(activeIndex)) ]), onMouseenter: ($event) => unref(throttledIndicatorHover)(index), onClick: withModifiers(($event) => unref(handleIndicatorClick)(index), ["stop"]) }, [createBaseVNode("button", { class: normalizeClass(unref(ns).e("button")), "aria-label": unref(t)("el.carousel.indicator", { index: index + 1 }) }, [unref(hasLabel) ? (openBlock(), createElementBlock("span", _hoisted_5$9, toDisplayString(item.props.label), 1)) : createCommentVNode("v-if", true)], 10, _hoisted_4$c)], 42, _hoisted_3$g)), [[vShow, unref(isTwoLengthShow)(index)]]); }), 128))], 2)) : createCommentVNode("v-if", true)]), _: 1 }), __props.motionBlur ? (openBlock(), createElementBlock("svg", _hoisted_6$4, [..._cache[8] || (_cache[8] = [createBaseVNode("defs", null, [createBaseVNode("filter", { id: "elCarouselHorizontal" }, [createBaseVNode("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "12,0" })]), createBaseVNode("filter", { id: "elCarouselVertical" }, [createBaseVNode("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "0,10" })])], -1)])])) : createCommentVNode("v-if", true) ], 34); }; } }); var carousel_default = carousel_vue_vue_type_script_setup_true_lang_default; const useCarouselItem = (props2) => { const carouselContext = inject(carouselContextKey); const instance = getCurrentInstance(); if (!carouselContext) debugWarn(CAROUSEL_ITEM_NAME, "usage: "); if (!instance) debugWarn(CAROUSEL_ITEM_NAME, "compositional hook can only be invoked inside setups"); const carouselItemRef = ref(); const hover = ref(false); const translate2 = ref(0); const scale = ref(1); const active = ref(false); const ready = ref(false); const inStage = ref(false); const animating = ref(false); const { isCardType, isVertical, cardScale } = carouselContext; function processIndex(index, activeIndex, length) { const lastItemIndex = length - 1; const prevItemIndex = activeIndex - 1; const nextItemIndex = activeIndex + 1; const halfItemIndex = length / 2; if (activeIndex === 0 && index === lastItemIndex) return -1; else if (activeIndex === lastItemIndex && index === 0) return length; else if (index < prevItemIndex && activeIndex - index >= halfItemIndex) return length + 1; else if (index > nextItemIndex && index - activeIndex >= halfItemIndex) return -2; return index; } function calcCardTranslate(index, activeIndex) { var _a, _b; const parentWidth = unref(isVertical) ? ((_a = carouselContext.root.value) == null ? void 0 : _a.offsetHeight) || 0 : ((_b = carouselContext.root.value) == null ? void 0 : _b.offsetWidth) || 0; if (inStage.value) return parentWidth * ((2 - cardScale) * (index - activeIndex) + 1) / 4; else if (index < activeIndex) return -(1 + cardScale) * parentWidth / 4; else return (3 + cardScale) * parentWidth / 4; } function calcTranslate(index, activeIndex, isVertical2) { const rootEl = carouselContext.root.value; if (!rootEl) return 0; return ((isVertical2 ? rootEl.offsetHeight : rootEl.offsetWidth) || 0) * (index - activeIndex); } const translateItem = (index, activeIndex, oldIndex) => { const _isCardType = unref(isCardType); const carouselItemLength = carouselContext.items.value.length ?? NaN; const isActive = index === activeIndex; if (!_isCardType && !isUndefined(oldIndex)) animating.value = isActive || index === oldIndex; if (!isActive && carouselItemLength > 2 && carouselContext.loop) index = processIndex(index, activeIndex, carouselItemLength); const _isVertical = unref(isVertical); active.value = isActive; if (_isCardType) { inStage.value = Math.round(Math.abs(index - activeIndex)) <= 1; translate2.value = calcCardTranslate(index, activeIndex); scale.value = unref(active) ? 1 : cardScale; } else translate2.value = calcTranslate(index, activeIndex, _isVertical); ready.value = true; if (isActive && carouselItemRef.value) carouselContext.setContainerHeight(carouselItemRef.value.offsetHeight); }; function handleItemClick() { if (carouselContext && unref(isCardType)) { const index = carouselContext.items.value.findIndex(({ uid: uid2 }) => uid2 === instance.uid); carouselContext.setActiveItem(index); } } const carouselItemContext = { props: props2, states: reactive({ hover, translate: translate2, scale, active, ready, inStage, animating }), uid: instance.uid, getVnode: () => instance.vnode, translateItem }; carouselContext.addItem(carouselItemContext); onBeforeUnmount(() => { carouselContext.removeItem(carouselItemContext); }); return { carouselItemRef, active, animating, hover, inStage, isVertical, translate: translate2, isCardType, scale, ready, handleItemClick }; }; var carousel_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: CAROUSEL_ITEM_NAME, __name: "carousel-item", props: carouselItemProps, setup(__props) { const props2 = __props; const ns = useNamespace("carousel"); const { carouselItemRef, active, animating, hover, inStage, isVertical, translate: translate2, isCardType, scale, ready, handleItemClick } = useCarouselItem(props2); const itemKls = computed(() => [ ns.e("item"), ns.is("active", active.value), ns.is("in-stage", inStage.value), ns.is("hover", hover.value), ns.is("animating", animating.value), { [ns.em("item", "card")]: isCardType.value, [ns.em("item", "card-vertical")]: isCardType.value && isVertical.value } ]); const itemStyle = computed(() => { return { transform: [`${`translate${unref(isVertical) ? "Y" : "X"}`}(${unref(translate2)}px)`, `scale(${unref(scale)})`].join(" ") }; }); return (_ctx, _cache) => { return withDirectives((openBlock(), createElementBlock("div", { ref_key: "carouselItemRef", ref: carouselItemRef, class: normalizeClass(itemKls.value), style: normalizeStyle(itemStyle.value), onClick: _cache[0] || (_cache[0] = (...args) => unref(handleItemClick) && unref(handleItemClick)(...args)) }, [unref(isCardType) ? withDirectives((openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("mask")) }, null, 2)), [[vShow, !unref(active)]]) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 6)), [[vShow, unref(ready)]]); }; } }); var carousel_item_default = carousel_item_vue_vue_type_script_setup_true_lang_default; const ElCarousel = withInstall(carousel_default, { CarouselItem: carousel_item_default }); const ElCarouselItem = withNoopInstall(carousel_item_default); const CommonProps = buildProps({ modelValue: { type: definePropType([ Number, String, Array, Object ]) }, options: { type: definePropType(Array), default: () => [] }, props: { type: definePropType(Object), default: () => ({}) } }); const DefaultProps = { expandTrigger: "click", multiple: false, checkStrictly: false, emitPath: true, lazy: false, lazyLoad: NOOP, value: "value", label: "label", children: "children", leaf: "leaf", disabled: "disabled", hoverThreshold: 500, checkOnClickNode: false, checkOnClickLeaf: true, showPrefix: true }; const cascaderPanelProps = buildProps({ ...CommonProps, border: { type: Boolean, default: true }, renderLabel: { type: Function } }); const emitChangeFn$2 = (value) => true; const cascaderPanelEmits = { [UPDATE_MODEL_EVENT]: emitChangeFn$2, [CHANGE_EVENT]: emitChangeFn$2, close: () => true, "expand-change": (value) => value }; const useCascaderConfig = (props2) => { return computed(() => ({ ...DefaultProps, ...props2.props })); }; const checkboxProps = { modelValue: { type: [ Number, String, Boolean ], default: void 0 }, label: { type: [ String, Boolean, Number, Object ], default: void 0 }, value: { type: [ String, Boolean, Number, Object ], default: void 0 }, indeterminate: Boolean, disabled: { type: Boolean, default: void 0 }, checked: Boolean, name: { type: String, default: void 0 }, trueValue: { type: [String, Number], default: void 0 }, falseValue: { type: [String, Number], default: void 0 }, trueLabel: { type: [String, Number], default: void 0 }, falseLabel: { type: [String, Number], default: void 0 }, id: { type: String, default: void 0 }, border: Boolean, size: useSizeProp, tabindex: [String, Number], validateEvent: { type: Boolean, default: true }, ariaLabel: String, ...useAriaProps(["ariaControls"]) }; const checkboxEmits = { [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val), change: (val) => isString(val) || isNumber(val) || isBoolean(val) }; const checkboxGroupContextKey = Symbol("checkboxGroupContextKey"); const checkboxGroupProps = buildProps({ modelValue: { type: definePropType(Array), default: () => [] }, disabled: { type: Boolean, default: void 0 }, min: Number, max: Number, size: useSizeProp, fill: String, textColor: String, tag: { type: String, default: "div" }, validateEvent: { type: Boolean, default: true }, options: { type: definePropType(Array) }, props: { type: definePropType(Object), default: () => checkboxDefaultProps }, type: { type: String, values: ["checkbox", "button"], default: "checkbox" }, ...useAriaProps(["ariaLabel"]) }); const checkboxGroupEmits = { [UPDATE_MODEL_EVENT]: (val) => isArray(val), change: (val) => isArray(val) }; const checkboxDefaultProps = { label: "label", value: "value", disabled: "disabled" }; const useCheckboxDisabled = ({ model, isChecked }) => { const checkboxGroup = inject(checkboxGroupContextKey, void 0); const formContext = inject(formContextKey, void 0); const isLimitDisabled = computed(() => { var _a, _b; const max2 = (_a = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a.value; const min2 = (_b = checkboxGroup == null ? void 0 : checkboxGroup.min) == null ? void 0 : _b.value; return !isUndefined(max2) && model.value.length >= max2 && !isChecked.value || !isUndefined(min2) && model.value.length <= min2 && isChecked.value; }); return { isDisabled: useFormDisabled(computed(() => { var _a; if (checkboxGroup === void 0) return (formContext == null ? void 0 : formContext.disabled) ?? isLimitDisabled.value; else return ((_a = checkboxGroup.disabled) == null ? void 0 : _a.value) || isLimitDisabled.value; })), isLimitDisabled }; }; const useCheckboxEvent = (props2, { model, isLimitExceeded, hasOwnLabel, isDisabled, isLabeledByFormItem }) => { const checkboxGroup = inject(checkboxGroupContextKey, void 0); const { formItem } = useFormItem(); const { emit } = getCurrentInstance(); function getLabeledValue(value) { return [ true, props2.trueValue, props2.trueLabel ].includes(value) ? props2.trueValue ?? props2.trueLabel ?? true : props2.falseValue ?? props2.falseLabel ?? false; } function emitChangeEvent(checked, e) { emit(CHANGE_EVENT, getLabeledValue(checked), e); } function handleChange(e) { if (isLimitExceeded.value) return; const target = e.target; emit(CHANGE_EVENT, getLabeledValue(target.checked), e); } async function onClickRoot(e) { if (isLimitExceeded.value) return; if (!hasOwnLabel.value && !isDisabled.value && isLabeledByFormItem.value) { if (!e.composedPath().some((item) => item.tagName === "LABEL")) { model.value = getLabeledValue([ false, props2.falseValue, props2.falseLabel ].includes(model.value)); await nextTick(); emitChangeEvent(model.value, e); } } } const validateEvent = computed(() => (checkboxGroup == null ? void 0 : checkboxGroup.validateEvent) || props2.validateEvent); watch(() => props2.modelValue, () => { if (validateEvent.value) formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err)); }); return { handleChange, onClickRoot }; }; const useCheckboxModel = (props2) => { const selfModel = ref(false); const { emit, vnode } = getCurrentInstance(); const checkboxGroup = inject(checkboxGroupContextKey, void 0); const isGroup = computed(() => isUndefined(checkboxGroup) === false); const isLimitExceeded = ref(false); const isControlled = computed(() => { const rawProps = vnode.props ?? {}; return "modelValue" in rawProps || "model-value" in rawProps; }); const model = computed({ get() { var _a; return isGroup.value ? (_a = checkboxGroup == null ? void 0 : checkboxGroup.modelValue) == null ? void 0 : _a.value : !isControlled.value ? selfModel.value : props2.modelValue; }, set(val) { var _a, _b; if (isGroup.value && isArray(val)) { isLimitExceeded.value = ((_a = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a.value) !== void 0 && val.length > (checkboxGroup == null ? void 0 : checkboxGroup.max.value) && val.length > model.value.length; isLimitExceeded.value === false && ((_b = checkboxGroup == null ? void 0 : checkboxGroup.changeEvent) == null ? void 0 : _b.call(checkboxGroup, val)); } else { emit(UPDATE_MODEL_EVENT, val); selfModel.value = val; } } }); return { model, isGroup, isLimitExceeded }; }; const useCheckboxStatus = (props2, slots, { model }) => { const checkboxGroup = inject(checkboxGroupContextKey, void 0); const isFocused = ref(false); const actualValue = computed(() => { if (!isPropAbsent(props2.value)) return props2.value; return props2.label; }); const isChecked = computed(() => { const value = model.value; if (isBoolean(value)) return value; else if (isArray(value)) if (isObject(actualValue.value)) return value.map(toRaw).some((o) => isEqual(o, actualValue.value)); else return value.map(toRaw).includes(actualValue.value); else if (value !== null && value !== void 0) return value === props2.trueValue || value === props2.trueLabel; else return !!value; }); return { checkboxButtonSize: useFormSize(computed(() => { var _a; return (_a = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a.value; }), { prop: true }), isChecked, isFocused, checkboxSize: useFormSize(computed(() => { var _a; return (_a = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a.value; })), hasOwnLabel: computed(() => { return !!slots.default || !isPropAbsent(actualValue.value); }), actualValue }; }; const useCheckbox = (props2, slots) => { const { formItem: elFormItem } = useFormItem(); const { model, isGroup, isLimitExceeded } = useCheckboxModel(props2); const { isFocused, isChecked, checkboxButtonSize, checkboxSize, hasOwnLabel, actualValue } = useCheckboxStatus(props2, slots, { model }); const { isDisabled } = useCheckboxDisabled({ model, isChecked }); const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, { formItemContext: elFormItem, disableIdGeneration: hasOwnLabel, disableIdManagement: isGroup }); const { handleChange, onClickRoot } = useCheckboxEvent(props2, { model, isLimitExceeded, hasOwnLabel, isDisabled, isLabeledByFormItem }); const setStoreValue = () => { function addToStore() { if (isArray(model.value) && !model.value.includes(actualValue.value)) model.value.push(actualValue.value); else model.value = props2.trueValue ?? props2.trueLabel ?? true; } props2.checked && addToStore(); }; setStoreValue(); useDeprecated({ from: "label act as value", replacement: "value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => isGroup.value && isPropAbsent(props2.value))); useDeprecated({ from: "true-label", replacement: "true-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => !!props2.trueLabel)); useDeprecated({ from: "false-label", replacement: "false-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => !!props2.falseLabel)); return { inputId, isLabeledByFormItem, isChecked, isDisabled, isFocused, checkboxButtonSize, checkboxSize, hasOwnLabel, model, actualValue, handleChange, onClickRoot }; }; const _hoisted_1$$ = [ "id", "indeterminate", "name", "tabindex", "disabled" ]; var checkbox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCheckbox", __name: "checkbox", props: checkboxProps, emits: checkboxEmits, setup(__props) { const props2 = __props; const { inputId, isLabeledByFormItem, isChecked, isDisabled, isFocused, checkboxSize, hasOwnLabel, model, actualValue, handleChange, onClickRoot } = useCheckbox(props2, useSlots()); const inputBindings = computed(() => { if (props2.trueValue || props2.falseValue || props2.trueLabel || props2.falseLabel) return { "true-value": props2.trueValue ?? props2.trueLabel ?? true, "false-value": props2.falseValue ?? props2.falseLabel ?? false }; return { value: actualValue.value }; }); const ns = useNamespace("checkbox"); const compKls = computed(() => { return [ ns.b(), ns.m(checkboxSize.value), ns.is("disabled", isDisabled.value), ns.is("bordered", props2.border), ns.is("checked", isChecked.value) ]; }); const spanKls = computed(() => { return [ ns.e("input"), ns.is("disabled", isDisabled.value), ns.is("checked", isChecked.value), ns.is("indeterminate", props2.indeterminate), ns.is("focus", isFocused.value) ]; }); return (_ctx, _cache) => { return openBlock(), createBlock(resolveDynamicComponent(!unref(hasOwnLabel) && unref(isLabeledByFormItem) ? "span" : "label"), { for: !unref(hasOwnLabel) && unref(isLabeledByFormItem) ? null : unref(inputId), class: normalizeClass(compKls.value), "aria-controls": __props.indeterminate ? __props.ariaControls : null, "aria-checked": __props.indeterminate ? "mixed" : void 0, "aria-label": __props.ariaLabel, onClick: unref(onClickRoot) }, { default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(spanKls.value) }, [withDirectives(createBaseVNode("input", mergeProps({ id: unref(inputId), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null), class: unref(ns).e("original"), type: "checkbox", indeterminate: __props.indeterminate, name: __props.name, tabindex: __props.tabindex, disabled: unref(isDisabled) }, inputBindings.value, { onChange: _cache[1] || (_cache[1] = (...args) => unref(handleChange) && unref(handleChange)(...args)), onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true), onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false), onClick: _cache[4] || (_cache[4] = withModifiers(() => { }, ["stop"])) }), null, 16, _hoisted_1$$), [[vModelCheckbox, unref(model)]]), createBaseVNode("span", { class: normalizeClass(unref(ns).e("inner")) }, null, 2)], 2), unref(hasOwnLabel) ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(ns).e("label")) }, [renderSlot(_ctx.$slots, "default"), !_ctx.$slots.default ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(__props.label), 1)], 64)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true)]), _: 3 }, 8, [ "for", "class", "aria-controls", "aria-checked", "aria-label", "onClick" ]); }; } }); var checkbox_default = checkbox_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$_ = [ "name", "tabindex", "disabled" ]; var checkbox_button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCheckboxButton", __name: "checkbox-button", props: checkboxProps, emits: checkboxEmits, setup(__props) { const props2 = __props; const { isFocused, isChecked, isDisabled, checkboxButtonSize, model, actualValue, handleChange } = useCheckbox(props2, useSlots()); const inputBindings = computed(() => { if (props2.trueValue || props2.falseValue || props2.trueLabel || props2.falseLabel) return { "true-value": props2.trueValue ?? props2.trueLabel ?? true, "false-value": props2.falseValue ?? props2.falseLabel ?? false }; return { value: actualValue.value }; }); const checkboxGroup = inject(checkboxGroupContextKey, void 0); const ns = useNamespace("checkbox"); const activeStyle = computed(() => { var _a, _b; const fillValue = ((_a = checkboxGroup == null ? void 0 : checkboxGroup.fill) == null ? void 0 : _a.value) ?? ""; return { backgroundColor: fillValue, borderColor: fillValue, color: ((_b = checkboxGroup == null ? void 0 : checkboxGroup.textColor) == null ? void 0 : _b.value) ?? "", boxShadow: fillValue ? `-1px 0 0 0 ${fillValue}` : void 0 }; }); const labelKls = computed(() => { return [ ns.b("button"), ns.bm("button", checkboxButtonSize.value), ns.is("disabled", isDisabled.value), ns.is("checked", isChecked.value), ns.is("focus", isFocused.value) ]; }); return (_ctx, _cache) => { return openBlock(), createElementBlock("label", { class: normalizeClass(labelKls.value) }, [withDirectives(createBaseVNode("input", mergeProps({ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null), class: unref(ns).be("button", "original"), type: "checkbox", name: __props.name, tabindex: __props.tabindex, disabled: unref(isDisabled) }, inputBindings.value, { onChange: _cache[1] || (_cache[1] = (...args) => unref(handleChange) && unref(handleChange)(...args)), onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true), onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false), onClick: _cache[4] || (_cache[4] = withModifiers(() => { }, ["stop"])) }), null, 16, _hoisted_1$_), [[vModelCheckbox, unref(model)]]), _ctx.$slots.default || __props.label ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(ns).be("button", "inner")), style: normalizeStyle(unref(isChecked) ? activeStyle.value : void 0) }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 6)) : createCommentVNode("v-if", true)], 2); }; } }); var checkbox_button_default = checkbox_button_vue_vue_type_script_setup_true_lang_default; var checkbox_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCheckboxGroup", __name: "checkbox-group", props: checkboxGroupProps, emits: checkboxGroupEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("checkbox"); const checkboxDisabled = useFormDisabled(); const { formItem } = useFormItem(); const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props2, { formItemContext: formItem }); const changeEvent = async (value) => { emit(UPDATE_MODEL_EVENT, value); await nextTick(); emit(CHANGE_EVENT, value); }; const modelValue = computed({ get() { return props2.modelValue; }, set(val) { changeEvent(val); } }); const aliasProps = computed(() => ({ ...checkboxDefaultProps, ...props2.props })); const getOptionProps = (option) => { const { label, value, disabled } = aliasProps.value; const base = { label: option[label], value: option[value], disabled: option[disabled] }; return { ...omit(option, [ label, value, disabled ]), ...base }; }; const optionComponent = computed(() => props2.type === "button" ? checkbox_button_default : checkbox_default); provide(checkboxGroupContextKey, { ...pick(toRefs(props2), [ "size", "min", "max", "validateEvent", "fill", "textColor" ]), disabled: checkboxDisabled, modelValue, changeEvent }); watch(() => props2.modelValue, (newVal, oldValue) => { if (props2.validateEvent && !isEqual(newVal, oldValue)) formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err)); }); return (_ctx, _cache) => { var _a; return openBlock(), createBlock(resolveDynamicComponent(__props.tag), { id: unref(groupId), class: normalizeClass(unref(ns).b("group")), role: "group", "aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "checkbox-group" : void 0, "aria-labelledby": unref(isLabeledByFormItem) ? (_a = unref(formItem)) == null ? void 0 : _a.labelId : void 0 }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => { return openBlock(), createBlock(resolveDynamicComponent(optionComponent.value), mergeProps({ key: index }, { ref_for: true }, getOptionProps(item)), null, 16); }), 128))])]), _: 3 }, 8, [ "id", "class", "aria-label", "aria-labelledby" ]); }; } }); var checkbox_group_default = checkbox_group_vue_vue_type_script_setup_true_lang_default; const ElCheckbox = withInstall(checkbox_default, { CheckboxButton: checkbox_button_default, CheckboxGroup: checkbox_group_default }); const ElCheckboxButton = withNoopInstall(checkbox_button_default); const ElCheckboxGroup = withNoopInstall(checkbox_group_default); const radioPropsBase = buildProps({ modelValue: { type: [ String, Number, Boolean ], default: void 0 }, size: useSizeProp, disabled: { type: Boolean, default: void 0 }, label: { type: [ String, Number, Boolean ], default: void 0 }, value: { type: [ String, Number, Boolean ], default: void 0 }, name: { type: String, default: void 0 } }); const radioProps = buildProps({ ...radioPropsBase, border: Boolean }); const radioEmits = { [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val), [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val) }; const radioGroupKey = Symbol("radioGroupKey"); const radioButtonProps = buildProps({ ...radioPropsBase }); const radioDefaultProps = { label: "label", value: "value", disabled: "disabled" }; const radioGroupProps = buildProps({ id: { type: String, default: void 0 }, size: useSizeProp, disabled: { type: Boolean, default: void 0 }, modelValue: { type: [ String, Number, Boolean ], default: void 0 }, fill: { type: String, default: "" }, textColor: { type: String, default: "" }, name: { type: String, default: void 0 }, validateEvent: { type: Boolean, default: true }, options: { type: definePropType(Array) }, props: { type: definePropType(Object), default: () => radioDefaultProps }, type: { type: String, values: ["radio", "button"], default: "radio" }, ...useAriaProps(["ariaLabel"]) }); const radioGroupEmits = radioEmits; const useRadio = (props2, emit) => { const radioRef = ref(); const radioGroup = inject(radioGroupKey, void 0); const isGroup = computed(() => !!radioGroup); const actualValue = computed(() => { if (!isPropAbsent(props2.value)) return props2.value; return props2.label; }); const modelValue = computed({ get() { return isGroup.value ? radioGroup.modelValue : props2.modelValue; }, set(val) { if (isGroup.value) radioGroup.changeEvent(val); else emit && emit(UPDATE_MODEL_EVENT, val); radioRef.value.checked = props2.modelValue === actualValue.value; } }); const size = useFormSize(computed(() => radioGroup == null ? void 0 : radioGroup.size)); const disabled = useFormDisabled(computed(() => radioGroup == null ? void 0 : radioGroup.disabled)); const focus = ref(false); const tabIndex = computed(() => { return disabled.value || isGroup.value && modelValue.value !== actualValue.value ? -1 : 0; }); useDeprecated({ from: "label act as value", replacement: "value", version: "3.0.0", scope: "el-radio", ref: "https://element-plus.org/en-US/component/radio.html" }, computed(() => isGroup.value && isPropAbsent(props2.value))); return { radioRef, isGroup, radioGroup, focus, size, disabled, tabIndex, modelValue, actualValue }; }; const _hoisted_1$Z = [ "value", "name", "disabled", "checked" ]; var radio_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElRadio", __name: "radio", props: radioProps, emits: radioEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("radio"); const { radioRef, radioGroup, focus, size, disabled, modelValue, actualValue } = useRadio(props2, emit); function handleChange() { nextTick(() => emit(CHANGE_EVENT, modelValue.value)); } return (_ctx, _cache) => { var _a; return openBlock(), createElementBlock("label", { class: normalizeClass([ unref(ns).b(), unref(ns).is("disabled", unref(disabled)), unref(ns).is("focus", unref(focus)), unref(ns).is("bordered", __props.border), unref(ns).is("checked", unref(modelValue) === unref(actualValue)), unref(ns).m(unref(size)) ]) }, [createBaseVNode("span", { class: normalizeClass([ unref(ns).e("input"), unref(ns).is("disabled", unref(disabled)), unref(ns).is("checked", unref(modelValue) === unref(actualValue)) ]) }, [withDirectives(createBaseVNode("input", { ref_key: "radioRef", ref: radioRef, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null), class: normalizeClass(unref(ns).e("original")), value: unref(actualValue), name: __props.name || ((_a = unref(radioGroup)) == null ? void 0 : _a.name), disabled: unref(disabled), checked: unref(modelValue) === unref(actualValue), type: "radio", onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true), onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false), onChange: handleChange, onClick: _cache[3] || (_cache[3] = withModifiers(() => { }, ["stop"])) }, null, 42, _hoisted_1$Z), [[vModelRadio, unref(modelValue)]]), createBaseVNode("span", { class: normalizeClass(unref(ns).e("inner")) }, null, 2)], 2), createBaseVNode("span", { class: normalizeClass(unref(ns).e("label")), onKeydown: _cache[4] || (_cache[4] = withModifiers(() => { }, ["stop"])) }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 34)], 2); }; } }); var radio_default = radio_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$Y = [ "value", "name", "disabled" ]; var radio_button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElRadioButton", __name: "radio-button", props: radioButtonProps, setup(__props) { const props2 = __props; const ns = useNamespace("radio"); const { radioRef, focus, size, disabled, modelValue, radioGroup, actualValue } = useRadio(props2); const activeStyle = computed(() => { return { backgroundColor: (radioGroup == null ? void 0 : radioGroup.fill) || "", borderColor: (radioGroup == null ? void 0 : radioGroup.fill) || "", boxShadow: (radioGroup == null ? void 0 : radioGroup.fill) ? `-1px 0 0 0 ${radioGroup.fill}` : "", color: (radioGroup == null ? void 0 : radioGroup.textColor) || "" }; }); return (_ctx, _cache) => { var _a; return openBlock(), createElementBlock("label", { class: normalizeClass([ unref(ns).b("button"), unref(ns).is("active", unref(modelValue) === unref(actualValue)), unref(ns).is("disabled", unref(disabled)), unref(ns).is("focus", unref(focus)), unref(ns).bm("button", unref(size)) ]) }, [withDirectives(createBaseVNode("input", { ref_key: "radioRef", ref: radioRef, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null), class: normalizeClass(unref(ns).be("button", "original-radio")), value: unref(actualValue), type: "radio", name: __props.name || ((_a = unref(radioGroup)) == null ? void 0 : _a.name), disabled: unref(disabled), onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true), onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false), onClick: _cache[3] || (_cache[3] = withModifiers(() => { }, ["stop"])) }, null, 42, _hoisted_1$Y), [[vModelRadio, unref(modelValue)]]), createBaseVNode("span", { class: normalizeClass(unref(ns).be("button", "inner")), style: normalizeStyle(unref(modelValue) === unref(actualValue) ? activeStyle.value : {}), onKeydown: _cache[4] || (_cache[4] = withModifiers(() => { }, ["stop"])) }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 38)], 2); }; } }); var radio_button_default = radio_button_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$X = [ "id", "aria-label", "aria-labelledby" ]; var radio_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElRadioGroup", __name: "radio-group", props: radioGroupProps, emits: radioGroupEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("radio"); const radioId = useId(); const radioGroupRef = ref(); const { formItem } = useFormItem(); const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props2, { formItemContext: formItem }); const changeEvent = (value) => { emit(UPDATE_MODEL_EVENT, value); nextTick(() => emit(CHANGE_EVENT, value)); }; onMounted(() => { const radios = radioGroupRef.value.querySelectorAll("[type=radio]"); const firstLabel = radios[0]; if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) firstLabel.tabIndex = 0; }); const name = computed(() => { return props2.name || radioId.value; }); const aliasProps = computed(() => ({ ...radioDefaultProps, ...props2.props })); const getOptionProps = (option) => { const { label, value, disabled } = aliasProps.value; const base = { label: option[label], value: option[value], disabled: option[disabled] }; return { ...omit(option, [ label, value, disabled ]), ...base }; }; const optionComponent = computed(() => props2.type === "button" ? radio_button_default : radio_default); provide(radioGroupKey, reactive({ ...toRefs(props2), changeEvent, name })); watch(() => props2.modelValue, (newVal, oldValue) => { if (props2.validateEvent && !isEqual(newVal, oldValue)) formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err)); }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { id: unref(groupId), ref_key: "radioGroupRef", ref: radioGroupRef, class: normalizeClass(unref(ns).b("group")), role: "radiogroup", "aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "radio-group" : void 0, "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0 }, [renderSlot(_ctx.$slots, "default", {}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => { return openBlock(), createBlock(resolveDynamicComponent(optionComponent.value), mergeProps({ key: index }, { ref_for: true }, getOptionProps(item)), null, 16); }), 128))])], 10, _hoisted_1$X); }; } }); var radio_group_default = radio_group_vue_vue_type_script_setup_true_lang_default; const ElRadio = withInstall(radio_default, { RadioButton: radio_button_default, RadioGroup: radio_group_default }); const ElRadioGroup = withNoopInstall(radio_group_default); const ElRadioButton = withNoopInstall(radio_button_default); const CASCADER_PANEL_INJECTION_KEY = Symbol(); function isVNodeEmpty(vnodes) { return !!(isArray(vnodes) ? vnodes.every(({ type }) => type === Comment) : (vnodes == null ? void 0 : vnodes.type) === Comment); } var node_content_default = /* @__PURE__ */ defineComponent({ name: "NodeContent", props: { node: { type: Object, required: true } }, setup(props2) { const ns = useNamespace("cascader-node"); const { renderLabelFn } = inject(CASCADER_PANEL_INJECTION_KEY); const { node } = props2; const { data, label: nodeLabel } = node; const label = () => { const renderLabel = renderLabelFn == null ? void 0 : renderLabelFn({ node, data }); return isVNodeEmpty(renderLabel) ? nodeLabel : renderLabel ?? nodeLabel; }; return () => createVNode("span", { "class": ns.e("label") }, [label()]); } }); const _hoisted_1$W = [ "id", "aria-haspopup", "aria-owns", "aria-expanded", "tabindex" ]; var node_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCascaderNode", __name: "node", props: { node: { type: Object, required: true }, menuId: String }, emits: ["expand"], setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const panel = inject(CASCADER_PANEL_INJECTION_KEY); const ns = useNamespace("cascader-node"); const isHoverMenu = computed(() => panel.isHoverMenu); const multiple = computed(() => panel.config.multiple); const checkStrictly = computed(() => panel.config.checkStrictly); const showPrefix = computed(() => panel.config.showPrefix); const checkedNodeId = computed(() => { var _a; return (_a = panel.checkedNodes[0]) == null ? void 0 : _a.uid; }); const isDisabled = computed(() => props2.node.isDisabled); const isLeaf2 = computed(() => props2.node.isLeaf); const expandable = computed(() => checkStrictly.value && !isLeaf2.value || !isDisabled.value); const inExpandingPath = computed(() => isInPath(panel.expandingNode)); const inCheckedPath = computed(() => checkStrictly.value && panel.checkedNodes.some(isInPath)); const isInPath = (node) => { var _a; const { level, uid: uid2 } = props2.node; return ((_a = node == null ? void 0 : node.pathNodes[level - 1]) == null ? void 0 : _a.uid) === uid2; }; const doExpand = () => { if (inExpandingPath.value) return; panel.expandNode(props2.node); }; const doCheck = (checked) => { const { node } = props2; if (checked === node.checked) return; panel.handleCheckChange(node, checked); }; const doLoad = () => { panel.lazyLoad(props2.node, () => { if (!isLeaf2.value) doExpand(); }); }; const handleHoverExpand = (e) => { if (!isHoverMenu.value) return; handleExpand(); !isLeaf2.value && emit("expand", e); }; const handleExpand = () => { const { node } = props2; if (!expandable.value || node.loading) return; node.loaded ? doExpand() : doLoad(); }; const handleClick = () => { if (isLeaf2.value && !isDisabled.value && !checkStrictly.value && !multiple.value) handleCheck(true); else if ((panel.config.checkOnClickNode && (multiple.value || checkStrictly.value) || isLeaf2.value && panel.config.checkOnClickLeaf) && !isDisabled.value) handleSelectCheck(!props2.node.checked); else if (!isHoverMenu.value) handleExpand(); }; const handleSelectCheck = (checked) => { if (checkStrictly.value) { doCheck(checked); if (props2.node.loaded) doExpand(); } else handleCheck(checked); }; const handleCheck = (checked) => { if (!props2.node.loaded) doLoad(); else { doCheck(checked); !checkStrictly.value && doExpand(); } }; return (_ctx, _cache) => { return openBlock(), createElementBlock("li", { id: `${__props.menuId}-${__props.node.uid}`, role: "menuitem", "aria-haspopup": !isLeaf2.value, "aria-owns": isLeaf2.value ? void 0 : __props.menuId, "aria-expanded": inExpandingPath.value, tabindex: expandable.value ? -1 : void 0, class: normalizeClass([ unref(ns).b(), unref(ns).is("selectable", checkStrictly.value), unref(ns).is("active", __props.node.checked), unref(ns).is("disabled", !expandable.value), inExpandingPath.value && "in-active-path", inCheckedPath.value && "in-checked-path" ]), onMouseenter: handleHoverExpand, onFocus: handleHoverExpand, onClick: handleClick }, [ createCommentVNode(" prefix "), multiple.value && showPrefix.value ? (openBlock(), createBlock(unref(ElCheckbox), { key: 0, "model-value": __props.node.checked, indeterminate: __props.node.indeterminate, disabled: isDisabled.value, onClick: _cache[0] || (_cache[0] = withModifiers(() => { }, ["stop"])), "onUpdate:modelValue": handleSelectCheck }, null, 8, [ "model-value", "indeterminate", "disabled" ])) : checkStrictly.value && showPrefix.value ? (openBlock(), createBlock(unref(ElRadio), { key: 1, "model-value": checkedNodeId.value, label: __props.node.uid, disabled: isDisabled.value, "onUpdate:modelValue": handleSelectCheck, onClick: _cache[1] || (_cache[1] = withModifiers(() => { }, ["stop"])) }, { default: withCtx(() => [createCommentVNode("\n Add an empty element to avoid render label,\n do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485\n "), _cache[2] || (_cache[2] = createBaseVNode("span", null, null, -1))]), _: 1 }, 8, [ "model-value", "label", "disabled" ])) : isLeaf2.value && __props.node.checked ? (openBlock(), createBlock(unref(ElIcon), { key: 2, class: normalizeClass(unref(ns).e("prefix")) }, { default: withCtx(() => [createVNode(unref(check_default))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), createCommentVNode(" content "), createVNode(unref(node_content_default), { node: __props.node }, null, 8, ["node"]), createCommentVNode(" postfix "), !isLeaf2.value ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [__props.node.loading ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass([unref(ns).is("loading"), unref(ns).e("postfix")]) }, { default: withCtx(() => [createVNode(unref(loading_default))]), _: 1 }, 8, ["class"])) : (openBlock(), createBlock(unref(ElIcon), { key: 1, class: normalizeClass(["arrow-right", unref(ns).e("postfix")]) }, { default: withCtx(() => [createVNode(unref(arrow_right_default))]), _: 1 }, 8, ["class"]))], 64)) : createCommentVNode("v-if", true) ], 42, _hoisted_1$W); }; } }); var node_default = node_vue_vue_type_script_setup_true_lang_default; var menu_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCascaderMenu", __name: "menu", props: { nodes: { type: Array, required: true }, index: { type: Number, required: true } }, setup(__props) { const props2 = __props; const instance = getCurrentInstance(); const ns = useNamespace("cascader-menu"); const { t } = useLocale(); const id = useId(); let activeNode; let hoverTimer; const panel = inject(CASCADER_PANEL_INJECTION_KEY); const hoverZone = ref(); const isEmpty2 = computed(() => !props2.nodes.length); const isLoading = computed(() => !panel.initialLoaded); const menuId = computed(() => `${id.value}-${props2.index}`); const handleExpand = (e) => { activeNode = e.target; }; const handleMouseMove = (e) => { var _a; if (!panel.isHoverMenu || !activeNode || !hoverZone.value) return; if (activeNode.contains(e.target)) { clearHoverTimer(); const el = instance.vnode.el; const { left } = el.getBoundingClientRect(); const { offsetWidth, offsetHeight } = el; const startX = e.clientX - left; const top = activeNode.offsetTop; const bottom = top + activeNode.offsetHeight; const scrollTop = ((_a = el.querySelector(`.${ns.e("wrap")}`)) == null ? void 0 : _a.scrollTop) || 0; hoverZone.value.innerHTML = ` `; } else if (!hoverTimer) hoverTimer = window.setTimeout(clearHoverZone, panel.config.hoverThreshold); }; const clearHoverTimer = () => { if (!hoverTimer) return; clearTimeout(hoverTimer); hoverTimer = void 0; }; const clearHoverZone = () => { if (!hoverZone.value) return; hoverZone.value.innerHTML = ""; clearHoverTimer(); }; return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElScrollbar), { key: menuId.value, tag: "ul", role: "menu", class: normalizeClass(unref(ns).b()), "wrap-class": unref(ns).e("wrap"), "view-class": [unref(ns).e("list"), unref(ns).is("empty", isEmpty2.value)], onMousemove: handleMouseMove, onMouseleave: clearHoverZone }, { default: withCtx(() => { var _a; return [ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes, (node) => { return openBlock(), createBlock(node_default, { key: node.uid, node, "menu-id": menuId.value, onExpand: handleExpand }, null, 8, ["node", "menu-id"]); }), 128)), isLoading.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("empty-text")) }, [createVNode(unref(ElIcon), { size: "14", class: normalizeClass(unref(ns).is("loading")) }, { default: withCtx(() => [createVNode(unref(loading_default))]), _: 1 }, 8, ["class"]), createTextVNode(" " + toDisplayString(unref(t)("el.cascader.loading")), 1)], 2)) : isEmpty2.value ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("empty-text")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref(t)("el.cascader.noData")), 1)])], 2)) : ((_a = unref(panel)) == null ? void 0 : _a.isHoverMenu) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" eslint-disable vue/html-self-closing "), (openBlock(), createElementBlock("svg", { ref_key: "hoverZone", ref: hoverZone, class: normalizeClass(unref(ns).e("hover-zone")) }, null, 2))], 2112)) : createCommentVNode("v-if", true), createCommentVNode(" eslint-enable vue/html-self-closing ") ]; }), _: 3 }, 8, [ "class", "wrap-class", "view-class" ]); }; } }); var menu_default$1 = menu_vue_vue_type_script_setup_true_lang_default; let uid = 0; const calculatePathNodes = (node) => { const nodes = [node]; let { parent } = node; while (parent) { nodes.unshift(parent); parent = parent.parent; } return nodes; }; var Node$1 = class Node { constructor(data, config, parent, root = false) { this.data = data; this.config = config; this.parent = parent; this.root = root; this.uid = uid++; this.checked = false; this.indeterminate = false; this.loading = false; const { value: valueKey, label: labelKey, children: childrenKey } = config; const childrenData = data[childrenKey]; const pathNodes = calculatePathNodes(this); this.level = root ? 0 : parent ? parent.level + 1 : 1; this.value = data[valueKey]; this.label = data[labelKey]; this.pathNodes = pathNodes; this.pathValues = pathNodes.map((node) => node.value); this.pathLabels = pathNodes.map((node) => node.label); this.childrenData = childrenData; this.children = (childrenData || []).map((child) => new Node(child, config, this)); this.loaded = !config.lazy || this.isLeaf || !isEmpty(childrenData); this.text = ""; } get isDisabled() { const { data, parent, config } = this; const { disabled, checkStrictly } = config; return (isFunction(disabled) ? disabled(data, this) : !!data[disabled]) || !checkStrictly && !!(parent == null ? void 0 : parent.isDisabled); } get isLeaf() { const { data, config, childrenData, loaded } = this; const { lazy, leaf } = config; const isLeaf2 = isFunction(leaf) ? leaf(data, this) : data[leaf]; return isUndefined(isLeaf2) ? lazy && !loaded ? false : !(isArray(childrenData) && childrenData.length) : !!isLeaf2; } get valueByOption() { return this.config.emitPath ? this.pathValues : this.value; } appendChild(childData) { const { childrenData, children } = this; const node = new Node(childData, this.config, this); if (isArray(childrenData)) childrenData.push(childData); else this.childrenData = [childData]; children.push(node); return node; } calcText(allLevels, separator) { const text = allLevels ? this.pathLabels.join(separator) : this.label; this.text = text; return text; } broadcast(checked) { this.children.forEach((child) => { var _a; if (child) { child.broadcast(checked); (_a = child.onParentCheck) == null ? void 0 : _a.call(child, checked); } }); } emit() { var _a; const { parent } = this; if (parent) { (_a = parent.onChildCheck) == null ? void 0 : _a.call(parent); parent.emit(); } } onParentCheck(checked) { if (!this.isDisabled) this.setCheckState(checked); } onChildCheck() { const { children } = this; const validChildren = children.filter((child) => !child.isDisabled); const checked = validChildren.length ? validChildren.every((child) => child.checked) : false; this.setCheckState(checked); } setCheckState(checked) { const totalNum = this.children.length; const checkedNum = this.children.reduce((c, p) => { return c + (p.checked ? 1 : p.indeterminate ? 0.5 : 0); }, 0); this.checked = this.loaded && this.children.filter((child) => !child.isDisabled).every((child) => child.loaded && child.checked) && checked; this.indeterminate = this.loaded && checkedNum !== totalNum && checkedNum > 0; } doCheck(checked) { if (this.checked === checked) return; const { checkStrictly, multiple } = this.config; if (checkStrictly || !multiple) this.checked = checked; else { this.broadcast(checked); this.setCheckState(checked); this.emit(); } } }; const flatNodes = (nodes, leafOnly) => { return nodes.reduce((res, node) => { if (node.isLeaf) res.push(node); else { !leafOnly && res.push(node); res = res.concat(flatNodes(node.children, leafOnly)); } return res; }, []); }; var Store = class { constructor(data, config) { this.config = config; const nodes = (data || []).map((nodeData) => new Node$1(nodeData, this.config)); this.nodes = nodes; this.allNodes = flatNodes(nodes, false); this.leafNodes = flatNodes(nodes, true); } getNodes() { return this.nodes; } getFlattedNodes(leafOnly) { return leafOnly ? this.leafNodes : this.allNodes; } appendNode(nodeData, parentNode) { const node = parentNode ? parentNode.appendChild(nodeData) : new Node$1(nodeData, this.config); if (!parentNode) this.nodes.push(node); this.appendAllNodesAndLeafNodes(node); } appendNodes(nodeDataList, parentNode) { if (nodeDataList.length > 0) nodeDataList.forEach((nodeData) => this.appendNode(nodeData, parentNode)); else parentNode && parentNode.isLeaf && this.leafNodes.push(parentNode); } appendAllNodesAndLeafNodes(node) { this.allNodes.push(node); node.isLeaf && this.leafNodes.push(node); if (node.children) node.children.forEach((subNode) => { this.appendAllNodesAndLeafNodes(subNode); }); } getNodeByValue(value, leafOnly = false) { if (isPropAbsent(value)) return null; return this.getFlattedNodes(leafOnly).find((node) => isEqual(node.value, value) || isEqual(node.pathValues, value)) || null; } getSameNode(node) { if (!node) return null; return this.getFlattedNodes(false).find(({ value, level }) => isEqual(node.value, value) && node.level === level) || null; } }; const getMenuIndex = (el) => { if (!el) return 0; const pieces = el.id.split("-"); return Number(pieces[pieces.length - 2]); }; const checkNode = (el) => { if (!el) return; const input = el.querySelector("input"); if (input) input.click(); else if (isLeaf(el)) el.click(); }; const sortByOriginalOrder = (oldNodes, newNodes) => { const newNodesCopy = newNodes.slice(0); const newIds = newNodesCopy.map((node) => node.uid); const res = oldNodes.reduce((acc, item) => { const index = newIds.indexOf(item.uid); if (index > -1) { acc.push(item); newNodesCopy.splice(index, 1); newIds.splice(index, 1); } return acc; }, []); res.push(...newNodesCopy); return res; }; var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCascaderPanel", __name: "index", props: cascaderPanelProps, emits: cascaderPanelEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; let manualChecked = false; const ns = useNamespace("cascader"); const config = useCascaderConfig(props2); const slots = useSlots(); let store; const initialLoaded = ref(true); const initialLoadedOnce = ref(false); const menuList = ref([]); const checkedValue = ref(); const menus = ref([]); const expandingNode = ref(); const checkedNodes = ref([]); const isHoverMenu = computed(() => config.value.expandTrigger === "hover"); const renderLabelFn = computed(() => props2.renderLabel || slots.default); const initStore = () => { const { options } = props2; const cfg = config.value; manualChecked = false; store = new Store(options, cfg); menus.value = [store.getNodes()]; if (cfg.lazy && isEmpty(props2.options)) { initialLoaded.value = false; lazyLoad(void 0, (list) => { if (list) { store = new Store(list, cfg); menus.value = [store.getNodes()]; } initialLoaded.value = true; syncCheckedValue(false, true); }); } else syncCheckedValue(false, true); }; const lazyLoad = (node, cb) => { const cfg = config.value; node = node || new Node$1({}, cfg, void 0, true); node.loading = true; const resolve = (dataList) => { const _node = node; const parent = _node.root ? null : _node; _node.loading = false; _node.loaded = true; _node.childrenData = _node.childrenData || []; dataList && (store == null ? void 0 : store.appendNodes(dataList, parent)); dataList && (cb == null ? void 0 : cb(dataList)); if (node.level === 0) initialLoadedOnce.value = true; }; const reject = () => { node.loading = false; node.loaded = false; if (node.level === 0) initialLoaded.value = true; }; cfg.lazyLoad(node, resolve, reject); }; const expandNode = (node, silent) => { var _a; const { level } = node; const newMenus = menus.value.slice(0, level); let newExpandingNode; if (node.isLeaf) newExpandingNode = node.pathNodes[level - 2]; else { newExpandingNode = node; newMenus.push(node.children); } if (((_a = expandingNode.value) == null ? void 0 : _a.uid) !== (newExpandingNode == null ? void 0 : newExpandingNode.uid)) { expandingNode.value = node; menus.value = newMenus; !silent && emit("expand-change", (node == null ? void 0 : node.pathValues) || []); } }; const handleCheckChange = (node, checked, emitClose = true) => { const { checkStrictly, multiple } = config.value; const oldNode = checkedNodes.value[0]; manualChecked = true; !multiple && (oldNode == null ? void 0 : oldNode.doCheck(false)); node.doCheck(checked); calculateCheckedValue(); emitClose && !multiple && !checkStrictly && emit("close"); !emitClose && !multiple && expandParentNode(node); }; const expandParentNode = (node) => { if (!node) return; node = node.parent; expandParentNode(node); node && expandNode(node); }; const getFlattedNodes = (leafOnly) => store == null ? void 0 : store.getFlattedNodes(leafOnly); const getCheckedNodes = (leafOnly) => { var _a; return (_a = getFlattedNodes(leafOnly)) == null ? void 0 : _a.filter(({ checked }) => checked !== false); }; const clearCheckedNodes = () => { checkedNodes.value.forEach((node) => node.doCheck(false)); calculateCheckedValue(); menus.value = menus.value.slice(0, 1); expandingNode.value = void 0; emit("expand-change", []); }; const calculateCheckedValue = () => { const { checkStrictly, multiple } = config.value; const oldNodes = checkedNodes.value; const nodes = sortByOriginalOrder(oldNodes, getCheckedNodes(!checkStrictly)); const values = nodes.map((node) => node.valueByOption); checkedNodes.value = nodes; checkedValue.value = multiple ? values : values[0] ?? null; }; const syncCheckedValue = (loaded = false, forced = false) => { const { modelValue } = props2; const { lazy, multiple, checkStrictly } = config.value; const leafOnly = !checkStrictly; if (!initialLoaded.value || manualChecked || !forced && isEqual(modelValue, checkedValue.value)) return; if (lazy && !loaded) { const nodes = unique(flattenDeep(castArray(modelValue))).map((val) => store == null ? void 0 : store.getNodeByValue(val)).filter((node) => !!node && !node.loaded && !node.loading); if (nodes.length) nodes.forEach((node) => { lazyLoad(node, () => syncCheckedValue(false, forced)); }); else syncCheckedValue(true, forced); } else { syncMenuState(unique((multiple ? castArray(modelValue) : [modelValue]).map((val) => store == null ? void 0 : store.getNodeByValue(val, leafOnly))), forced); checkedValue.value = cloneDeep(modelValue ?? void 0); } }; const syncMenuState = (newCheckedNodes, reserveExpandingState = true) => { const { checkStrictly } = config.value; const oldNodes = checkedNodes.value; const newNodes = newCheckedNodes.filter((node) => !!node && (checkStrictly || node.isLeaf)); const oldExpandingNode = store == null ? void 0 : store.getSameNode(expandingNode.value); const newExpandingNode = reserveExpandingState && oldExpandingNode || newNodes[0]; if (newExpandingNode) newExpandingNode.pathNodes.forEach((node) => expandNode(node, true)); else expandingNode.value = void 0; oldNodes.forEach((node) => node.doCheck(false)); reactive(newNodes).forEach((node) => node.doCheck(true)); checkedNodes.value = newNodes; nextTick(scrollToExpandingNode); }; const scrollToExpandingNode = () => { if (!isClient) return; menuList.value.forEach((menu) => { const menuElement = menu == null ? void 0 : menu.$el; if (menuElement) { const container = menuElement.querySelector(`.${ns.namespace.value}-scrollbar__wrap`); let activeNode = menuElement.querySelector(`.${ns.b("node")}.in-active-path`); if (!activeNode) { const activeElements = menuElement.querySelectorAll(`.${ns.b("node")}.${ns.is("active")}`); activeNode = activeElements[activeElements.length - 1]; } scrollIntoView(container, activeNode); } }); }; const handleKeyDown = (e) => { var _a, _b; const target = e.target; const code = getEventCode(e); switch (code) { case EVENT_CODE.up: case EVENT_CODE.down: e.preventDefault(); focusNode(getSibling(target, code === EVENT_CODE.up ? -1 : 1, `.${ns.b("node")}[tabindex="-1"]`)); break; case EVENT_CODE.left: { e.preventDefault(); const expandedNode = (_a = menuList.value[getMenuIndex(target) - 1]) == null ? void 0 : _a.$el.querySelector(`.${ns.b("node")}[aria-expanded="true"]`); focusNode(expandedNode); break; } case EVENT_CODE.right: { e.preventDefault(); const firstNode = (_b = menuList.value[getMenuIndex(target) + 1]) == null ? void 0 : _b.$el.querySelector(`.${ns.b("node")}[tabindex="-1"]`); focusNode(firstNode); break; } case EVENT_CODE.enter: case EVENT_CODE.numpadEnter: checkNode(target); break; } }; provide(CASCADER_PANEL_INJECTION_KEY, reactive({ config, expandingNode, checkedNodes, isHoverMenu, initialLoaded, renderLabelFn, lazyLoad, expandNode, handleCheckChange })); watch(config, (newVal, oldVal) => { if (isEqual(newVal, oldVal)) return; initStore(); }, { immediate: true }); watch(() => props2.options, initStore, { deep: true }); watch(() => props2.modelValue, () => { manualChecked = false; syncCheckedValue(); }, { deep: true }); watch(() => checkedValue.value, (val) => { if (!isEqual(val, props2.modelValue)) { emit(UPDATE_MODEL_EVENT, val); emit(CHANGE_EVENT, val); } }); const loadLazyRootNodes = () => { if (initialLoadedOnce.value) return; initStore(); }; onBeforeUpdate(() => menuList.value = []); onMounted(() => !isEmpty(props2.modelValue) && syncCheckedValue()); __expose({ menuList, menus, checkedNodes, handleKeyDown, handleCheckChange, getFlattedNodes, getCheckedNodes, clearCheckedNodes, calculateCheckedValue, scrollToExpandingNode, loadLazyRootNodes }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b("panel"), unref(ns).is("bordered", __props.border)]), onKeydown: handleKeyDown }, [(openBlock(true), createElementBlock(Fragment, null, renderList(menus.value, (menu, index) => { return openBlock(), createBlock(menu_default$1, { key: index, ref_for: true, ref: (item) => menuList.value[index] = item, index, nodes: [...menu] }, { empty: withCtx(() => [renderSlot(_ctx.$slots, "empty")]), _: 3 }, 8, ["index", "nodes"]); }), 128))], 34); }; } }); var src_default$1 = index_vue_vue_type_script_setup_true_lang_default; const ElCascaderPanel = withInstall(src_default$1); const cascaderProps = buildProps({ ...CommonProps, size: useSizeProp, placeholder: String, disabled: { type: Boolean, default: void 0 }, clearable: Boolean, clearIcon: { type: iconPropType, default: circle_close_default }, filterable: Boolean, filterMethod: { type: definePropType(Function), default: (node, keyword) => node.text.includes(keyword) }, separator: { type: String, default: " / " }, showAllLevels: { type: Boolean, default: true }, collapseTags: Boolean, maxCollapseTags: { type: Number, default: 1 }, collapseTagsTooltip: Boolean, maxCollapseTagsTooltipHeight: { type: [String, Number] }, debounce: { type: Number, default: 300 }, beforeFilter: { type: definePropType(Function), default: () => true }, placement: { type: definePropType(String), values: Ee, default: "bottom-start" }, fallbackPlacements: { type: definePropType(Array), default: [ "bottom-start", "bottom", "top-start", "top", "right", "left" ] }, popperClass: useTooltipContentProps.popperClass, popperStyle: useTooltipContentProps.popperStyle, teleported: useTooltipContentProps.teleported, effect: { type: definePropType(String), default: "light" }, tagType: { ...tagProps.type, default: "info" }, tagEffect: { ...tagProps.effect, default: "light" }, validateEvent: { type: Boolean, default: true }, persistent: { type: Boolean, default: true }, showCheckedStrategy: { type: String, values: ["parent", "child"], default: "child" }, checkOnClickNode: Boolean, showPrefix: { type: Boolean, default: true }, ...useEmptyValuesProps }); const emitChangeFn$1 = (value) => true; const cascaderEmits = { [UPDATE_MODEL_EVENT]: emitChangeFn$1, [CHANGE_EVENT]: emitChangeFn$1, focus: (evt) => evt instanceof FocusEvent, blur: (evt) => evt instanceof FocusEvent, clear: () => true, visibleChange: (val) => isBoolean(val), expandChange: (val) => !!val, removeTag: (val) => !!val }; const _hoisted_1$V = ["placeholder"]; const _hoisted_2$y = ["onClick"]; var cascader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCascader", __name: "cascader", props: cascaderProps, emits: cascaderEmits, setup(__props, { expose: __expose, emit: __emit }) { const popperOptions = { modifiers: [{ name: "arrowPosition", enabled: true, phase: "main", fn: ({ state }) => { const { modifiersData, placement } = state; if ([ "right", "left", "bottom", "top" ].includes(placement)) return; if (modifiersData.arrow) modifiersData.arrow.x = 35; }, requires: ["arrow"] }] }; const props2 = __props; const emit = __emit; const attrs = useAttrs$1(); const slots = useSlots(); let inputInitialHeight = 0; let pressDeleteCount = 0; const nsCascader = useNamespace("cascader"); const nsInput = useNamespace("input"); const sizeMapPadding = { small: 7, default: 11, large: 15 }; const { t } = useLocale(); const { formItem } = useFormItem(); const isDisabled = useFormDisabled(); const { valueOnClear } = useEmptyValues(props2); const { isComposing, handleComposition } = useComposition({ afterComposition(event) { var _a; const text = (_a = event.target) == null ? void 0 : _a.value; handleInput(text); } }); const tooltipRef = ref(); const tagTooltipRef = ref(); const inputRef = ref(); const tagWrapper = ref(); const cascaderPanelRef = ref(); const suggestionPanel = ref(); const popperVisible = ref(false); const inputHover = ref(false); const filtering = ref(false); const inputValue = ref(""); const searchInputValue = ref(""); const tags = ref([]); const suggestions = ref([]); const showTagList = computed(() => { if (!props2.props.multiple) return []; return props2.collapseTags ? tags.value.slice(0, props2.maxCollapseTags) : tags.value; }); const collapseTagList = computed(() => { if (!props2.props.multiple) return []; return props2.collapseTags ? tags.value.slice(props2.maxCollapseTags) : []; }); const cascaderStyle = computed(() => { return attrs.style; }); const inputPlaceholder = computed(() => props2.placeholder ?? t("el.cascader.placeholder")); const currentPlaceholder = computed(() => searchInputValue.value || tags.value.length > 0 || isComposing.value ? "" : inputPlaceholder.value); const realSize = useFormSize(); const tagSize = computed(() => realSize.value === "small" ? "small" : "default"); const multiple = computed(() => !!props2.props.multiple); const readonly2 = computed(() => !props2.filterable || multiple.value); const searchKeyword = computed(() => multiple.value ? searchInputValue.value : inputValue.value); const checkedNodes = computed(() => { var _a; return ((_a = cascaderPanelRef.value) == null ? void 0 : _a.checkedNodes) || []; }); const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, { disabled: isDisabled, beforeBlur(event) { var _a, _b; return ((_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event)) || ((_b = tagTooltipRef.value) == null ? void 0 : _b.isFocusInsideContent(event)); }, afterBlur() { var _a; if (props2.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err)); } }); const clearBtnVisible = computed(() => { if (!props2.clearable || isDisabled.value || filtering.value || !inputHover.value && !isFocused.value) return false; return !!checkedNodes.value.length; }); const presentText = computed(() => { const { showAllLevels, separator } = props2; const nodes = checkedNodes.value; return nodes.length ? multiple.value ? "" : nodes[0].calcText(showAllLevels, separator) : ""; }); const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || ""); const checkedValue = computed({ get() { return cloneDeep(props2.modelValue); }, set(val) { const value = val ?? valueOnClear.value; emit(UPDATE_MODEL_EVENT, value); emit(CHANGE_EVENT, value); if (props2.validateEvent) formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err)); } }); const cascaderKls = computed(() => { return [ nsCascader.b(), nsCascader.m(realSize.value), nsCascader.is("disabled", isDisabled.value), attrs.class ]; }); const cascaderIconKls = computed(() => { return [ nsInput.e("icon"), "icon-arrow-down", nsCascader.is("reverse", popperVisible.value) ]; }); const inputClass = computed(() => nsCascader.is("focus", isFocused.value)); const contentRef = computed(() => { var _a, _b; return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef; }); const handleClickOutside = (event) => { if (isFocused.value) handleBlur(new FocusEvent("blur", event)); togglePopperVisible(false); }; const togglePopperVisible = (visible) => { var _a, _b; if (isDisabled.value) return; visible = visible ?? !popperVisible.value; if (visible !== popperVisible.value) { popperVisible.value = visible; (_b = (_a = inputRef.value) == null ? void 0 : _a.input) == null ? void 0 : _b.setAttribute("aria-expanded", `${visible}`); if (visible) { updatePopperPosition(); cascaderPanelRef.value && nextTick(cascaderPanelRef.value.scrollToExpandingNode); } else if (props2.filterable) syncPresentTextValue(); emit("visibleChange", visible); } }; const updatePopperPosition = () => { nextTick(() => { var _a; (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper(); }); }; const hideSuggestionPanel = () => { filtering.value = false; }; const genTag = (node) => { const { showAllLevels, separator } = props2; return { node, key: node.uid, text: node.calcText(showAllLevels, separator), hitState: false, closable: !isDisabled.value && !node.isDisabled }; }; const deleteTag = (tag) => { var _a; const node = tag.node; node.doCheck(false); (_a = cascaderPanelRef.value) == null ? void 0 : _a.calculateCheckedValue(); emit("removeTag", node.valueByOption); }; const getStrategyCheckedNodes = () => { switch (props2.showCheckedStrategy) { case "child": return checkedNodes.value; case "parent": { const clickedNodes = getCheckedNodes(false); const clickedNodesValue = clickedNodes.map((o) => o.value); return clickedNodes.filter((o) => !o.parent || !clickedNodesValue.includes(o.parent.value)); } default: return []; } }; const calculatePresentTags = () => { if (!multiple.value) return; const nodes = getStrategyCheckedNodes(); const allTags = []; nodes.forEach((node) => allTags.push(genTag(node))); tags.value = allTags; }; const calculateSuggestions = () => { var _a, _b; const { filterMethod, showAllLevels, separator } = props2; const res = (_b = (_a = cascaderPanelRef.value) == null ? void 0 : _a.getFlattedNodes(!props2.props.checkStrictly)) == null ? void 0 : _b.filter((node) => { if (node.isDisabled) return false; node.calcText(showAllLevels, separator); return filterMethod(node, searchKeyword.value); }); if (multiple.value) tags.value.forEach((tag) => { tag.hitState = false; }); filtering.value = true; suggestions.value = res; updatePopperPosition(); }; const focusFirstNode = () => { var _a; let firstNode; if (filtering.value && suggestionPanel.value) firstNode = suggestionPanel.value.$el.querySelector(`.${nsCascader.e("suggestion-item")}`); else firstNode = (_a = cascaderPanelRef.value) == null ? void 0 : _a.$el.querySelector(`.${nsCascader.b("node")}[tabindex="-1"]`); if (firstNode) { firstNode.focus(); if (!filtering.value && firstNode.getAttribute("aria-haspopup") === "true") firstNode.click(); } }; const updateStyle = () => { var _a, _b, _c; const inputInner = (_a = inputRef.value) == null ? void 0 : _a.input; const tagWrapperEl = tagWrapper.value; const suggestionPanelEl = (_b = suggestionPanel.value) == null ? void 0 : _b.$el; if (!isClient || !inputInner) return; if (suggestionPanelEl) { const suggestionList = suggestionPanelEl.querySelector(`.${nsCascader.e("suggestion-list")}`); suggestionList.style.minWidth = `${inputInner.offsetWidth}px`; } if (tagWrapperEl) { const { offsetHeight } = tagWrapperEl; const height = tags.value.length > 0 ? `${Math.max(offsetHeight, inputInitialHeight) - 2}px` : `${inputInitialHeight}px`; inputInner.style.height = height; if (slots.prefix) { const prefix = (_c = inputRef.value) == null ? void 0 : _c.$el.querySelector(`.${nsInput.e("prefix")}`); let left = 0; if (prefix) { left = prefix.offsetWidth; if (left > 0) left += sizeMapPadding[realSize.value || "default"]; } tagWrapperEl.style.left = `${left}px`; } else tagWrapperEl.style.left = `0`; updatePopperPosition(); } }; const getCheckedNodes = (leafOnly) => { var _a; return (_a = cascaderPanelRef.value) == null ? void 0 : _a.getCheckedNodes(leafOnly); }; const handleExpandChange = (value) => { updatePopperPosition(); emit("expandChange", value); }; const handleKeyDown = (e) => { if (isComposing.value) return; switch (getEventCode(e)) { case EVENT_CODE.enter: case EVENT_CODE.numpadEnter: togglePopperVisible(); break; case EVENT_CODE.down: togglePopperVisible(true); nextTick(focusFirstNode); e.preventDefault(); break; case EVENT_CODE.esc: if (popperVisible.value === true) { e.preventDefault(); e.stopPropagation(); togglePopperVisible(false); } break; case EVENT_CODE.tab: togglePopperVisible(false); break; } }; const handleClear = () => { var _a; (_a = cascaderPanelRef.value) == null ? void 0 : _a.clearCheckedNodes(); if (!popperVisible.value && props2.filterable) syncPresentTextValue(); togglePopperVisible(false); emit("clear"); }; const syncPresentTextValue = () => { const { value } = presentText; inputValue.value = value; searchInputValue.value = value; }; const handleSuggestionClick = (node) => { var _a, _b; const { checked } = node; if (multiple.value) (_a = cascaderPanelRef.value) == null ? void 0 : _a.handleCheckChange(node, !checked, false); else { !checked && ((_b = cascaderPanelRef.value) == null ? void 0 : _b.handleCheckChange(node, true, false)); togglePopperVisible(false); } }; const handleSuggestionKeyDown = (e) => { const target = e.target; const code = getEventCode(e); switch (code) { case EVENT_CODE.up: case EVENT_CODE.down: e.preventDefault(); focusNode(getSibling(target, code === EVENT_CODE.up ? -1 : 1, `.${nsCascader.e("suggestion-item")}[tabindex="-1"]`)); break; case EVENT_CODE.enter: case EVENT_CODE.numpadEnter: target.click(); break; } }; const handleDelete = () => { const lastTag = tags.value[tags.value.length - 1]; pressDeleteCount = searchInputValue.value ? 0 : pressDeleteCount + 1; if (!lastTag || !pressDeleteCount || props2.collapseTags && tags.value.length > 1) return; if (lastTag.hitState) deleteTag(lastTag); else lastTag.hitState = true; }; const handleFilter = useDebounceFn(() => { const { value } = searchKeyword; if (!value) return; const passed = props2.beforeFilter(value); if (isPromise(passed)) passed.then(calculateSuggestions).catch(() => { }); else if (passed !== false) calculateSuggestions(); else hideSuggestionPanel(); }, computed(() => props2.debounce)); const handleInput = (val, e) => { !popperVisible.value && togglePopperVisible(true); if (e == null ? void 0 : e.isComposing) return; if (val) handleFilter(); else { const passed = props2.beforeFilter(""); if (isPromise(passed)) passed.catch(() => { }); hideSuggestionPanel(); } }; const getInputInnerHeight = (inputInner) => Number.parseFloat(useCssVar(nsInput.cssVarName("input-height"), inputInner).value) - 2; const focus = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.blur(); }; watch(filtering, updatePopperPosition); watch([ checkedNodes, isDisabled, () => props2.collapseTags, () => props2.maxCollapseTags ], calculatePresentTags); watch(tags, () => { nextTick(() => updateStyle()); }); watch(realSize, async () => { await nextTick(); const inputInner = inputRef.value.input; inputInitialHeight = getInputInnerHeight(inputInner) || inputInitialHeight; updateStyle(); }); watch(presentText, syncPresentTextValue, { immediate: true }); watch(() => popperVisible.value, (val) => { var _a; if (val && props2.props.lazy && props2.props.lazyLoad) (_a = cascaderPanelRef.value) == null ? void 0 : _a.loadLazyRootNodes(); }); onMounted(() => { const inputInner = inputRef.value.input; const inputInnerHeight = getInputInnerHeight(inputInner); inputInitialHeight = inputInner.offsetHeight || inputInnerHeight; useResizeObserver(inputInner, updateStyle); }); __expose({ getCheckedNodes, cascaderPanelRef, togglePopperVisible, contentRef, presentText, focus, blur }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTooltip), { ref_key: "tooltipRef", ref: tooltipRef, visible: popperVisible.value, teleported: __props.teleported, "popper-class": [unref(nsCascader).e("dropdown"), __props.popperClass], "popper-style": __props.popperStyle, "popper-options": popperOptions, "fallback-placements": __props.fallbackPlacements, "stop-popper-mouse-event": false, "gpu-acceleration": false, placement: __props.placement, transition: `${unref(nsCascader).namespace.value}-zoom-in-top`, effect: __props.effect, pure: "", persistent: __props.persistent, onHide: hideSuggestionPanel }, { default: withCtx(() => [withDirectives((openBlock(), createElementBlock("div", { ref_key: "wrapperRef", ref: wrapperRef, class: normalizeClass(cascaderKls.value), style: normalizeStyle(cascaderStyle.value), onClick: _cache[8] || (_cache[8] = () => togglePopperVisible(readonly2.value ? void 0 : true)), onKeydown: handleKeyDown, onMouseenter: _cache[9] || (_cache[9] = ($event) => inputHover.value = true), onMouseleave: _cache[10] || (_cache[10] = ($event) => inputHover.value = false) }, [createVNode(unref(ElInput), { ref_key: "inputRef", ref: inputRef, modelValue: inputValue.value, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event), placeholder: currentPlaceholder.value, readonly: readonly2.value, disabled: unref(isDisabled), "validate-event": false, size: unref(realSize), class: normalizeClass(inputClass.value), tabindex: multiple.value && __props.filterable && !unref(isDisabled) ? -1 : void 0, onCompositionstart: unref(handleComposition), onCompositionupdate: unref(handleComposition), onCompositionend: unref(handleComposition), onInput: handleInput }, createSlots({ suffix: withCtx(() => [clearBtnVisible.value ? (openBlock(), createBlock(unref(ElIcon), { key: "clear", class: normalizeClass([unref(nsInput).e("icon"), "icon-circle-close"]), onClick: withModifiers(handleClear, ["stop"]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))]), _: 1 }, 8, ["class"])) : (openBlock(), createBlock(unref(ElIcon), { key: "arrow-down", class: normalizeClass(cascaderIconKls.value), onClick: _cache[0] || (_cache[0] = withModifiers(($event) => togglePopperVisible(), ["stop"])) }, { default: withCtx(() => [createVNode(unref(arrow_down_default))]), _: 1 }, 8, ["class"]))]), _: 2 }, [_ctx.$slots.prefix ? { name: "prefix", fn: withCtx(() => [renderSlot(_ctx.$slots, "prefix")]), key: "0" } : void 0]), 1032, [ "modelValue", "placeholder", "readonly", "disabled", "size", "class", "tabindex", "onCompositionstart", "onCompositionupdate", "onCompositionend" ]), multiple.value ? (openBlock(), createElementBlock("div", { key: 0, ref_key: "tagWrapper", ref: tagWrapper, class: normalizeClass([unref(nsCascader).e("tags"), unref(nsCascader).is("validate", Boolean(validateState.value))]) }, [ renderSlot(_ctx.$slots, "tag", { data: tags.value, deleteTag }, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(showTagList.value, (tag) => { return openBlock(), createBlock(unref(ElTag), { key: tag.key, type: __props.tagType, size: tagSize.value, effect: __props.tagEffect, hit: tag.hitState, closable: tag.closable, "disable-transitions": "", onClose: ($event) => deleteTag(tag) }, { default: withCtx(() => [createBaseVNode("span", null, toDisplayString(tag.text), 1)]), _: 2 }, 1032, [ "type", "size", "effect", "hit", "closable", "onClose" ]); }), 128))]), __props.collapseTags && tags.value.length > __props.maxCollapseTags ? (openBlock(), createBlock(unref(ElTooltip), { key: 0, ref_key: "tagTooltipRef", ref: tagTooltipRef, disabled: popperVisible.value || !__props.collapseTagsTooltip, "fallback-placements": [ "bottom", "top", "right", "left" ], placement: "bottom", "popper-class": __props.popperClass, "popper-style": __props.popperStyle, effect: __props.effect, persistent: __props.persistent }, { default: withCtx(() => [createVNode(unref(ElTag), { closable: false, size: tagSize.value, type: __props.tagType, effect: __props.tagEffect, "disable-transitions": "" }, { default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(unref(nsCascader).e("tags-text")) }, " + " + toDisplayString(tags.value.length - __props.maxCollapseTags), 3)]), _: 1 }, 8, [ "size", "type", "effect" ])]), content: withCtx(() => [createVNode(unref(ElScrollbar), { "max-height": __props.maxCollapseTagsTooltipHeight }, { default: withCtx(() => [createBaseVNode("div", { class: normalizeClass(unref(nsCascader).e("collapse-tags")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(collapseTagList.value, (tag, idx) => { return openBlock(), createElementBlock("div", { key: idx, class: normalizeClass(unref(nsCascader).e("collapse-tag")) }, [(openBlock(), createBlock(unref(ElTag), { key: tag.key, class: "in-tooltip", type: __props.tagType, size: tagSize.value, effect: __props.tagEffect, hit: tag.hitState, closable: tag.closable, "disable-transitions": "", onClose: ($event) => deleteTag(tag) }, { default: withCtx(() => [createBaseVNode("span", null, toDisplayString(tag.text), 1)]), _: 2 }, 1032, [ "type", "size", "effect", "hit", "closable", "onClose" ]))], 2); }), 128))], 2)]), _: 1 }, 8, ["max-height"])]), _: 1 }, 8, [ "disabled", "popper-class", "popper-style", "effect", "persistent" ])) : createCommentVNode("v-if", true), __props.filterable && !unref(isDisabled) ? withDirectives((openBlock(), createElementBlock("input", { key: 1, "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => searchInputValue.value = $event), type: "text", class: normalizeClass(unref(nsCascader).e("search-input")), placeholder: presentText.value ? "" : inputPlaceholder.value, onInput: _cache[3] || (_cache[3] = (e) => handleInput(searchInputValue.value, e)), onClick: _cache[4] || (_cache[4] = withModifiers(($event) => togglePopperVisible(true), ["stop"])), onKeydown: withKeys(handleDelete, ["delete"]), onCompositionstart: _cache[5] || (_cache[5] = (...args) => unref(handleComposition) && unref(handleComposition)(...args)), onCompositionupdate: _cache[6] || (_cache[6] = (...args) => unref(handleComposition) && unref(handleComposition)(...args)), onCompositionend: _cache[7] || (_cache[7] = (...args) => unref(handleComposition) && unref(handleComposition)(...args)) }, null, 42, _hoisted_1$V)), [[vModelText, searchInputValue.value]]) : createCommentVNode("v-if", true) ], 2)) : createCommentVNode("v-if", true)], 38)), [[ unref(ClickOutside), handleClickOutside, contentRef.value ]])]), content: withCtx(() => [ _ctx.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(nsCascader).e("header")), onClick: _cache[11] || (_cache[11] = withModifiers(() => { }, ["stop"])) }, [renderSlot(_ctx.$slots, "header")], 2)) : createCommentVNode("v-if", true), withDirectives(createVNode(unref(ElCascaderPanel), { ref_key: "cascaderPanelRef", ref: cascaderPanelRef, modelValue: checkedValue.value, "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => checkedValue.value = $event), options: __props.options, props: props2.props, border: false, "render-label": _ctx.$slots.default, onExpandChange: handleExpandChange, onClose: _cache[13] || (_cache[13] = ($event) => _ctx.$nextTick(() => togglePopperVisible(false))) }, { empty: withCtx(() => [renderSlot(_ctx.$slots, "empty")]), _: 3 }, 8, [ "modelValue", "options", "props", "render-label" ]), [[vShow, !filtering.value]]), __props.filterable ? withDirectives((openBlock(), createBlock(unref(ElScrollbar), { key: 1, ref_key: "suggestionPanel", ref: suggestionPanel, tag: "ul", class: normalizeClass(unref(nsCascader).e("suggestion-panel")), "view-class": unref(nsCascader).e("suggestion-list"), onKeydown: handleSuggestionKeyDown }, { default: withCtx(() => [suggestions.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(suggestions.value, (item) => { return openBlock(), createElementBlock("li", { key: item.uid, class: normalizeClass([unref(nsCascader).e("suggestion-item"), unref(nsCascader).is("checked", item.checked)]), tabindex: -1, onClick: ($event) => handleSuggestionClick(item) }, [renderSlot(_ctx.$slots, "suggestion-item", { item }, () => [createBaseVNode("span", null, toDisplayString(item.text), 1), item.checked ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, { default: withCtx(() => [createVNode(unref(check_default))]), _: 1 })) : createCommentVNode("v-if", true)])], 10, _hoisted_2$y); }), 128)) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [createBaseVNode("li", { class: normalizeClass(unref(nsCascader).e("empty-text")) }, toDisplayString(unref(t)("el.cascader.noMatch")), 3)])]), _: 3 }, 8, ["class", "view-class"])), [[vShow, filtering.value]]) : createCommentVNode("v-if", true), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(unref(nsCascader).e("footer")), onClick: _cache[14] || (_cache[14] = withModifiers(() => { }, ["stop"])) }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true) ]), _: 3 }, 8, [ "visible", "teleported", "popper-class", "popper-style", "fallback-placements", "placement", "transition", "effect", "persistent" ]); }; } }); var cascader_default = cascader_vue_vue_type_script_setup_true_lang_default; const ElCascader = withInstall(cascader_default); const checkTagProps = buildProps({ checked: Boolean, disabled: Boolean, type: { type: String, values: [ "primary", "success", "info", "warning", "danger" ], default: "primary" } }); const checkTagEmits = { "update:checked": (value) => isBoolean(value), [CHANGE_EVENT]: (value) => isBoolean(value) }; var check_tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCheckTag", __name: "check-tag", props: checkTagProps, emits: checkTagEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("check-tag"); const containerKls = computed(() => [ ns.b(), ns.is("checked", props2.checked), ns.is("disabled", props2.disabled), ns.m(props2.type || "primary") ]); const handleChange = () => { if (props2.disabled) return; const checked = !props2.checked; emit(CHANGE_EVENT, checked); emit("update:checked", checked); }; return (_ctx, _cache) => { return openBlock(), createElementBlock("span", { class: normalizeClass(containerKls.value), onClick: handleChange }, [renderSlot(_ctx.$slots, "default")], 2); }; } }); var check_tag_default = check_tag_vue_vue_type_script_setup_true_lang_default; const ElCheckTag = withInstall(check_tag_default); const colProps = buildProps({ tag: { type: String, default: "div" }, span: { type: Number, default: 24 }, offset: { type: Number, default: 0 }, pull: { type: Number, default: 0 }, push: { type: Number, default: 0 }, xs: { type: definePropType([Number, Object]), default: () => mutable({}) }, sm: { type: definePropType([Number, Object]), default: () => mutable({}) }, md: { type: definePropType([Number, Object]), default: () => mutable({}) }, lg: { type: definePropType([Number, Object]), default: () => mutable({}) }, xl: { type: definePropType([Number, Object]), default: () => mutable({}) } }); const RowJustify = [ "start", "center", "end", "space-around", "space-between", "space-evenly" ]; const RowAlign = [ "top", "middle", "bottom" ]; const rowProps = buildProps({ tag: { type: String, default: "div" }, gutter: { type: Number, default: 0 }, justify: { type: String, values: RowJustify, default: "start" }, align: { type: String, values: RowAlign } }); const rowContextKey = Symbol("rowContextKey"); var row_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElRow", __name: "row", props: rowProps, setup(__props) { const props2 = __props; const ns = useNamespace("row"); provide(rowContextKey, { gutter: computed(() => props2.gutter) }); const style = computed(() => { const styles = {}; if (!props2.gutter) return styles; styles.marginRight = styles.marginLeft = `-${props2.gutter / 2}px`; return styles; }); const rowKls = computed(() => [ ns.b(), ns.is(`justify-${props2.justify}`, props2.justify !== "start"), ns.is(`align-${props2.align}`, !!props2.align) ]); return (_ctx, _cache) => { return openBlock(), createBlock(resolveDynamicComponent(__props.tag), { class: normalizeClass(rowKls.value), style: normalizeStyle(style.value) }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, ["class", "style"]); }; } }); var row_default = row_vue_vue_type_script_setup_true_lang_default; const ElRow = withInstall(row_default); var col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCol", __name: "col", props: colProps, setup(__props) { const props2 = __props; const { gutter } = inject(rowContextKey, { gutter: computed(() => 0) }); const ns = useNamespace("col"); const style = computed(() => { const styles = {}; if (gutter.value) styles.paddingLeft = styles.paddingRight = `${gutter.value / 2}px`; return styles; }); const colKls = computed(() => { const classes = []; [ "span", "offset", "pull", "push" ].forEach((prop) => { const size = props2[prop]; if (isNumber(size)) { if (prop === "span") classes.push(ns.b(`${props2[prop]}`)); else if (size > 0) classes.push(ns.b(`${prop}-${props2[prop]}`)); } }); [ "xs", "sm", "md", "lg", "xl" ].forEach((size) => { if (isNumber(props2[size])) classes.push(ns.b(`${size}-${props2[size]}`)); else if (isObject(props2[size])) Object.entries(props2[size]).forEach(([prop, sizeProp]) => { classes.push(prop !== "span" ? ns.b(`${size}-${prop}-${sizeProp}`) : ns.b(`${size}-${sizeProp}`)); }); }); if (gutter.value) classes.push(ns.is("guttered")); return [ns.b(), classes]; }); return (_ctx, _cache) => { return openBlock(), createBlock(resolveDynamicComponent(__props.tag), { class: normalizeClass(colKls.value), style: normalizeStyle(style.value) }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, ["class", "style"]); }; } }); var col_default = col_vue_vue_type_script_setup_true_lang_default; const ElCol = withInstall(col_default); const emitChangeFn = (value) => isNumber(value) || isString(value) || isArray(value); const collapseProps = buildProps({ accordion: Boolean, modelValue: { type: definePropType([ Array, String, Number ]), default: () => mutable([]) }, expandIconPosition: { type: definePropType([String]), default: "right" }, beforeCollapse: { type: definePropType(Function) } }); const collapseEmits = { [UPDATE_MODEL_EVENT]: emitChangeFn, [CHANGE_EVENT]: emitChangeFn }; const collapseContextKey = Symbol("collapseContextKey"); const collapseItemProps = buildProps({ title: { type: String, default: "" }, name: { type: definePropType([String, Number]), default: void 0 }, icon: { type: iconPropType, default: arrow_right_default }, disabled: Boolean }); var collapse_transition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCollapseTransition", __name: "collapse-transition", setup(__props) { const ns = useNamespace("collapse-transition"); const reset = (el) => { el.style.maxHeight = ""; el.style.overflow = el.dataset.oldOverflow; el.style.paddingTop = el.dataset.oldPaddingTop; el.style.paddingBottom = el.dataset.oldPaddingBottom; }; const on = { beforeEnter(el) { if (!el.dataset) el.dataset = {}; el.dataset.oldPaddingTop = el.style.paddingTop; el.dataset.oldPaddingBottom = el.style.paddingBottom; if (el.style.height) el.dataset.elExistsHeight = el.style.height; el.style.maxHeight = 0; el.style.paddingTop = 0; el.style.paddingBottom = 0; }, enter(el) { requestAnimationFrame(() => { el.dataset.oldOverflow = el.style.overflow; if (el.dataset.elExistsHeight) el.style.maxHeight = el.dataset.elExistsHeight; else if (el.scrollHeight !== 0) el.style.maxHeight = `${el.scrollHeight}px`; else el.style.maxHeight = 0; el.style.paddingTop = el.dataset.oldPaddingTop; el.style.paddingBottom = el.dataset.oldPaddingBottom; el.style.overflow = "hidden"; }); }, afterEnter(el) { el.style.maxHeight = ""; el.style.overflow = el.dataset.oldOverflow; }, enterCancelled(el) { reset(el); }, beforeLeave(el) { if (!el.dataset) el.dataset = {}; el.dataset.oldPaddingTop = el.style.paddingTop; el.dataset.oldPaddingBottom = el.style.paddingBottom; el.dataset.oldOverflow = el.style.overflow; el.style.maxHeight = `${el.scrollHeight}px`; el.style.overflow = "hidden"; }, leave(el) { if (el.scrollHeight !== 0) { el.style.maxHeight = 0; el.style.paddingTop = 0; el.style.paddingBottom = 0; } }, afterLeave(el) { reset(el); }, leaveCancelled(el) { reset(el); } }; return (_ctx, _cache) => { return openBlock(), createBlock(Transition, mergeProps({ name: unref(ns).b() }, toHandlers(on)), { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["name"]); }; } }); var collapse_transition_default = collapse_transition_vue_vue_type_script_setup_true_lang_default; const ElCollapseTransition = withInstall(collapse_transition_default); const SCOPE$6 = "ElCollapse"; const useCollapse = (props2, emit) => { const activeNames = ref(castArray$1(props2.modelValue)); const setActiveNames = (_activeNames) => { activeNames.value = _activeNames; const value = props2.accordion ? activeNames.value[0] : activeNames.value; emit(UPDATE_MODEL_EVENT, value); emit(CHANGE_EVENT, value); }; const handleChange = (name) => { if (props2.accordion) setActiveNames([activeNames.value[0] === name ? "" : name]); else { const _activeNames = [...activeNames.value]; const index = _activeNames.indexOf(name); if (index > -1) _activeNames.splice(index, 1); else _activeNames.push(name); setActiveNames(_activeNames); } }; const handleItemClick = async (name) => { const { beforeCollapse } = props2; if (!beforeCollapse) { handleChange(name); return; } const shouldChange = beforeCollapse(name); if (![isPromise(shouldChange), isBoolean(shouldChange)].includes(true)) throwError(SCOPE$6, "beforeCollapse must return type `Promise` or `boolean`"); if (isPromise(shouldChange)) shouldChange.then((result) => { if (result !== false) handleChange(name); }).catch((e) => { debugWarn(SCOPE$6, `some error occurred: ${e}`); }); else if (shouldChange) handleChange(name); }; watch(() => props2.modelValue, () => activeNames.value = castArray$1(props2.modelValue), { deep: true }); provide(collapseContextKey, { activeNames, handleItemClick }); return { activeNames, setActiveNames }; }; const useCollapseDOM = (props2) => { const ns = useNamespace("collapse"); return { rootKls: computed(() => [ns.b(), ns.b(`icon-position-${props2.expandIconPosition}`)]) }; }; var collapse_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCollapse", __name: "collapse", props: collapseProps, emits: collapseEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const { activeNames, setActiveNames } = useCollapse(props2, __emit); const { rootKls } = useCollapseDOM(props2); __expose({ activeNames, setActiveNames }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)) }, [renderSlot(_ctx.$slots, "default")], 2); }; } }); var collapse_default = collapse_vue_vue_type_script_setup_true_lang_default; const useCollapseItem = (props2) => { const collapse = inject(collapseContextKey); const { namespace } = useNamespace("collapse"); const focusing = ref(false); const isClick = ref(false); const idInjection = useIdInjection(); const id = computed(() => idInjection.current++); const name = computed(() => { return props2.name ?? `${namespace.value}-id-${idInjection.prefix}-${unref(id)}`; }); const isActive = computed(() => collapse == null ? void 0 : collapse.activeNames.value.includes(unref(name))); const handleFocus = () => { setTimeout(() => { if (!isClick.value) focusing.value = true; else isClick.value = false; }, 50); }; const handleHeaderClick = (e) => { var _a; if (props2.disabled) return; if ((_a = e.target) == null ? void 0 : _a.closest("input, textarea, select")) return; collapse == null ? void 0 : collapse.handleItemClick(unref(name)); focusing.value = false; isClick.value = true; }; const handleEnterClick = (e) => { var _a; if ((_a = e.target) == null ? void 0 : _a.closest("input, textarea, select")) return; e.preventDefault(); collapse == null ? void 0 : collapse.handleItemClick(unref(name)); }; return { focusing, id, isActive, handleFocus, handleHeaderClick, handleEnterClick }; }; const useCollapseItemDOM = (props2, { focusing, isActive, id }) => { const ns = useNamespace("collapse"); const rootKls = computed(() => [ ns.b("item"), ns.is("active", unref(isActive)), ns.is("disabled", props2.disabled) ]); const headKls = computed(() => [ ns.be("item", "header"), ns.is("active", unref(isActive)), { focusing: unref(focusing) && !props2.disabled } ]); const arrowKls = computed(() => [ns.be("item", "arrow"), ns.is("active", unref(isActive))]); return { itemTitleKls: computed(() => [ns.be("item", "title")]), arrowKls, headKls, rootKls, itemWrapperKls: computed(() => ns.be("item", "wrap")), itemContentKls: computed(() => ns.be("item", "content")), scopedContentId: computed(() => ns.b(`content-${unref(id)}`)), scopedHeadId: computed(() => ns.b(`head-${unref(id)}`)) }; }; const _hoisted_1$U = [ "id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "aria-disabled" ]; const _hoisted_2$x = [ "id", "aria-hidden", "aria-labelledby" ]; var collapse_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCollapseItem", __name: "collapse-item", props: collapseItemProps, setup(__props, { expose: __expose }) { const props2 = __props; const { focusing, id, isActive, handleFocus, handleHeaderClick, handleEnterClick } = useCollapseItem(props2); const { arrowKls, headKls, rootKls, itemTitleKls, itemWrapperKls, itemContentKls, scopedContentId, scopedHeadId } = useCollapseItemDOM(props2, { focusing, isActive, id }); __expose({ isActive }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)) }, [createBaseVNode("div", { id: unref(scopedHeadId), class: normalizeClass(unref(headKls)), "aria-expanded": unref(isActive), "aria-controls": unref(scopedContentId), "aria-describedby": unref(scopedContentId), tabindex: __props.disabled ? void 0 : 0, "aria-disabled": __props.disabled, role: "button", onClick: _cache[0] || (_cache[0] = (...args) => unref(handleHeaderClick) && unref(handleHeaderClick)(...args)), onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers((...args) => unref(handleEnterClick) && unref(handleEnterClick)(...args), ["stop"]), ["space", "enter"])), onFocus: _cache[2] || (_cache[2] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)), onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false) }, [createBaseVNode("span", { class: normalizeClass(unref(itemTitleKls)) }, [renderSlot(_ctx.$slots, "title", { isActive: unref(isActive) }, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2), renderSlot(_ctx.$slots, "icon", { isActive: unref(isActive) }, () => [createVNode(unref(ElIcon), { class: normalizeClass(unref(arrowKls)) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]), _: 1 }, 8, ["class"])])], 42, _hoisted_1$U), createVNode(unref(ElCollapseTransition), null, { default: withCtx(() => [withDirectives(createBaseVNode("div", { id: unref(scopedContentId), role: "region", class: normalizeClass(unref(itemWrapperKls)), "aria-hidden": !unref(isActive), "aria-labelledby": unref(scopedHeadId) }, [createBaseVNode("div", { class: normalizeClass(unref(itemContentKls)) }, [renderSlot(_ctx.$slots, "default")], 2)], 10, _hoisted_2$x), [[vShow, unref(isActive)]])]), _: 3 })], 2); }; } }); var collapse_item_default = collapse_item_vue_vue_type_script_setup_true_lang_default; const ElCollapse = withInstall(collapse_default, { CollapseItem: collapse_item_default }); const ElCollapseItem = withNoopInstall(collapse_item_default); const colorPickerPanelProps = buildProps({ modelValue: { type: definePropType(String), default: void 0 }, border: { type: Boolean, default: true }, showAlpha: Boolean, colorFormat: { type: definePropType(String) }, disabled: Boolean, predefine: { type: definePropType(Array) }, validateEvent: { type: Boolean, default: true }, hueSliderClass: { type: definePropType([ String, Array, Object ]) }, hueSliderStyle: { type: definePropType([ String, Array, Object ]) } }); const colorPickerPanelEmits = { [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val) }; const ROOT_COMMON_COLOR_INJECTION_KEY = Symbol("colorCommonPickerKey"); const colorPickerPanelContextKey = Symbol("colorPickerPanelContextKey"); const alphaSliderProps = buildProps({ color: { type: definePropType(Object), required: true }, vertical: Boolean, disabled: Boolean }); const hueSliderProps = alphaSliderProps; const getOffsetTop = (el) => { let offset2 = 0; let parent = el; while (parent) { offset2 += parent.offsetTop; parent = parent.offsetParent; } return offset2; }; const getOffsetTopDistance = (el, containerEl) => { return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl)); }; const getClientXY = (event) => { let clientX; let clientY; if (event.type === "touchend") { clientY = event.changedTouches[0].clientY; clientX = event.changedTouches[0].clientX; } else if (event.type.startsWith("touch")) { clientY = event.touches[0].clientY; clientX = event.touches[0].clientX; } else { clientY = event.clientY; clientX = event.clientX; } return { clientX, clientY }; }; let isDragging = false; function draggable(element, options) { if (!isClient) return; const moveFn = function(event) { var _a; (_a = options.drag) == null ? void 0 : _a.call(options, event); }; const upFn = function(event) { var _a; document.removeEventListener("mousemove", moveFn); document.removeEventListener("mouseup", upFn); document.removeEventListener("touchmove", moveFn); document.removeEventListener("touchend", upFn); document.onselectstart = null; document.ondragstart = null; isDragging = false; (_a = options.end) == null ? void 0 : _a.call(options, event); }; const downFn = function(event) { var _a; if (isDragging) return; document.onselectstart = () => false; document.ondragstart = () => false; document.addEventListener("mousemove", moveFn); document.addEventListener("mouseup", upFn); document.addEventListener("touchmove", moveFn); document.addEventListener("touchend", upFn); isDragging = true; (_a = options.start) == null ? void 0 : _a.call(options, event); }; element.addEventListener("mousedown", downFn); element.addEventListener("touchstart", downFn, { passive: false }); } const useSlider = (props2, { key, minValue: minValue2, maxValue: maxValue2 }) => { const instance = getCurrentInstance(); const thumb = shallowRef(); const bar = shallowRef(); const currentValue = computed(() => props2.color.get(key)); function handleClick(event) { var _a; if (props2.disabled) return; if (event.target !== thumb.value) handleDrag(event); (_a = thumb.value) == null ? void 0 : _a.focus(); } function handleDrag(event) { if (!bar.value || !thumb.value || props2.disabled) return; const rect = instance.vnode.el.getBoundingClientRect(); const { clientX, clientY } = getClientXY(event); let value; if (!props2.vertical) { let left = clientX - rect.left; left = Math.max(thumb.value.offsetWidth / 2, left); left = Math.min(left, rect.width - thumb.value.offsetWidth / 2); value = Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * maxValue2); } else { let top = clientY - rect.top; top = Math.max(thumb.value.offsetHeight / 2, top); top = Math.min(top, rect.height - thumb.value.offsetHeight / 2); value = Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * maxValue2); } props2.color.set(key, value); } function handleKeydown(event) { if (props2.disabled) return; const { shiftKey } = event; const code = getEventCode(event); const step2 = shiftKey ? 10 : 1; const reverse = key === "hue" ? -1 : 1; let isPreventDefault = true; switch (code) { case EVENT_CODE.left: case EVENT_CODE.down: incrementPosition(-step2 * reverse); break; case EVENT_CODE.right: case EVENT_CODE.up: incrementPosition(step2 * reverse); break; case EVENT_CODE.home: props2.color.set(key, key === "hue" ? maxValue2 : minValue2); break; case EVENT_CODE.end: props2.color.set(key, key === "hue" ? minValue2 : maxValue2); break; case EVENT_CODE.pageDown: incrementPosition(-4 * reverse); break; case EVENT_CODE.pageUp: incrementPosition(4 * reverse); break; default: isPreventDefault = false; break; } isPreventDefault && event.preventDefault(); } function incrementPosition(step2) { let next = currentValue.value + step2; next = next < minValue2 ? minValue2 : next > maxValue2 ? maxValue2 : next; props2.color.set(key, next); } return { thumb, bar, currentValue, handleDrag, handleClick, handleKeydown }; }; const useSliderDOM = (props2, { namespace, maxValue: maxValue2, bar, thumb, currentValue, handleDrag, getBackground }) => { const instance = getCurrentInstance(); const ns = useNamespace(namespace); const thumbLeft = ref(0); const thumbTop = ref(0); const background = ref(); function getThumbLeft() { if (!thumb.value) return 0; if (props2.vertical) return 0; const el = instance.vnode.el; const value = currentValue.value; if (!el) return 0; return Math.round(value * (el.offsetWidth - thumb.value.offsetWidth / 2) / maxValue2); } function getThumbTop() { if (!thumb.value) return 0; const el = instance.vnode.el; if (!props2.vertical) return 0; const value = currentValue.value; if (!el) return 0; return Math.round(value * (el.offsetHeight - thumb.value.offsetHeight / 2) / maxValue2); } function update() { thumbLeft.value = getThumbLeft(); thumbTop.value = getThumbTop(); background.value = getBackground == null ? void 0 : getBackground(); } onMounted(() => { if (!bar.value || !thumb.value) return; const dragConfig = { drag: (event) => { handleDrag(event); }, end: (event) => { handleDrag(event); } }; draggable(bar.value, dragConfig); draggable(thumb.value, dragConfig); update(); }); watch(currentValue, () => update()); watch(() => props2.color.value, () => update()); const rootKls = computed(() => [ ns.b(), ns.is("vertical", props2.vertical), ns.is("disabled", props2.disabled) ]); const barKls = computed(() => ns.e("bar")); const thumbKls = computed(() => ns.e("thumb")); return { rootKls, barKls, barStyle: computed(() => ({ background: background.value })), thumbKls, thumbStyle: computed(() => ({ left: addUnit(thumbLeft.value), top: addUnit(thumbTop.value) })), thumbLeft, thumbTop, update }; }; const _hoisted_1$T = [ "aria-label", "aria-valuenow", "aria-valuetext", "aria-orientation", "tabindex", "aria-disabled" ]; const minValue$1 = 0; const maxValue$1 = 100; var alpha_slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElColorAlphaSlider", __name: "alpha-slider", props: alphaSliderProps, setup(__props, { expose: __expose }) { const props2 = __props; const { currentValue, bar, thumb, handleDrag, handleClick, handleKeydown } = useSlider(props2, { key: "alpha", minValue: minValue$1, maxValue: maxValue$1 }); const { rootKls, barKls, barStyle, thumbKls, thumbStyle, update } = useSliderDOM(props2, { namespace: "color-alpha-slider", maxValue: maxValue$1, currentValue, bar, thumb, handleDrag, getBackground }); const { t } = useLocale(); const ariaLabel = computed(() => t("el.colorpicker.alphaLabel")); const ariaValuetext = computed(() => { return t("el.colorpicker.alphaDescription", { alpha: currentValue.value, color: props2.color.value }); }); function getBackground() { if (props2.color && props2.color.value) { const { r, g, b } = props2.color.toRgb(); return `linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0) 0%, rgba(${r}, ${g}, ${b}, 1) 100%)`; } return ""; } __expose({ update, bar, thumb }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)) }, [createBaseVNode("div", { ref_key: "bar", ref: bar, class: normalizeClass(unref(barKls)), style: normalizeStyle(unref(barStyle)), onClick: _cache[0] || (_cache[0] = (...args) => unref(handleClick) && unref(handleClick)(...args)) }, null, 6), createBaseVNode("div", { ref_key: "thumb", ref: thumb, class: normalizeClass(unref(thumbKls)), style: normalizeStyle(unref(thumbStyle)), "aria-label": ariaLabel.value, "aria-valuenow": unref(currentValue), "aria-valuetext": ariaValuetext.value, "aria-orientation": __props.vertical ? "vertical" : "horizontal", "aria-valuemin": minValue$1, "aria-valuemax": maxValue$1, role: "slider", tabindex: __props.disabled ? void 0 : 0, "aria-disabled": __props.disabled, onKeydown: _cache[1] || (_cache[1] = (...args) => unref(handleKeydown) && unref(handleKeydown)(...args)) }, null, 46, _hoisted_1$T)], 2); }; } }); var alpha_slider_default = alpha_slider_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$S = [ "aria-label", "aria-valuenow", "aria-valuetext", "aria-orientation", "tabindex", "aria-disabled" ]; const minValue = 0; const maxValue = 360; var hue_slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElColorHueSlider", __name: "hue-slider", props: hueSliderProps, setup(__props, { expose: __expose }) { const props2 = __props; const { currentValue, bar, thumb, handleDrag, handleClick, handleKeydown } = useSlider(props2, { key: "hue", minValue, maxValue }); const { rootKls, barKls, thumbKls, thumbStyle, thumbTop, update } = useSliderDOM(props2, { namespace: "color-hue-slider", maxValue, currentValue, bar, thumb, handleDrag }); const { t } = useLocale(); const ariaLabel = computed(() => t("el.colorpicker.hueLabel")); const ariaValuetext = computed(() => { return t("el.colorpicker.hueDescription", { hue: currentValue.value, color: props2.color.value }); }); __expose({ bar, thumb, thumbTop, update }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)) }, [createBaseVNode("div", { ref_key: "bar", ref: bar, class: normalizeClass(unref(barKls)), onClick: _cache[0] || (_cache[0] = (...args) => unref(handleClick) && unref(handleClick)(...args)) }, null, 2), createBaseVNode("div", { ref_key: "thumb", ref: thumb, class: normalizeClass(unref(thumbKls)), style: normalizeStyle(unref(thumbStyle)), "aria-label": ariaLabel.value, "aria-valuenow": unref(currentValue), "aria-valuetext": ariaValuetext.value, "aria-orientation": __props.vertical ? "vertical" : "horizontal", "aria-valuemin": minValue, "aria-valuemax": maxValue, role: "slider", tabindex: __props.disabled ? void 0 : 0, "aria-disabled": __props.disabled, onKeydown: _cache[1] || (_cache[1] = (...args) => unref(handleKeydown) && unref(handleKeydown)(...args)) }, null, 46, _hoisted_1$S)], 2); }; } }); var hue_slider_default = hue_slider_vue_vue_type_script_setup_true_lang_default; const predefineProps = buildProps({ colors: { type: definePropType(Array), required: true }, color: { type: definePropType(Object), required: true }, enableAlpha: { type: Boolean, required: true }, disabled: Boolean }); var Color = class { constructor(options = {}) { this._hue = 0; this._saturation = 100; this._value = 100; this._alpha = 100; this._tiny = new TinyColor(); this._isValid = false; this.enableAlpha = false; this.format = ""; this.value = ""; for (const option in options) if (hasOwn(options, option)) this[option] = options[option]; if (options.value) this.fromString(options.value); else this.doOnChange(); } set(prop, value) { if (arguments.length === 1 && typeof prop === "object") { for (const p in prop) if (hasOwn(prop, p)) this.set(p, prop[p]); return; } this[`_${prop}`] = value; this._isValid = true; this.doOnChange(); } get(prop) { if ([ "hue", "saturation", "value", "alpha" ].includes(prop)) return Math.round(this[`_${prop}`]); return this[`_${prop}`]; } toRgb() { return this._isValid ? this._tiny.toRgb() : { r: 255, g: 255, b: 255, a: 0 }; } fromString(value) { const color = new TinyColor(value); this._isValid = color.isValid; if (color.isValid) { const { h: h2, s, v, a } = color.toHsv(); this._hue = h2; this._saturation = s * 100; this._value = v * 100; this._alpha = a * 100; } else { this._hue = 0; this._saturation = 100; this._value = 100; this._alpha = 100; } this.doOnChange(); } clear() { this._isValid = false; this.value = ""; this._hue = 0; this._saturation = 100; this._value = 100; this._alpha = 100; } compare(color) { const compareColor = new TinyColor({ h: color._hue, s: color._saturation / 100, v: color._value / 100, a: color._alpha / 100 }); return this._tiny.equals(compareColor); } doOnChange() { const { _hue, _saturation, _value, _alpha, format, enableAlpha } = this; let _format = format || (enableAlpha ? "rgb" : "hex"); if (format === "hex" && enableAlpha) _format = "hex8"; this._tiny = new TinyColor({ h: _hue, s: _saturation / 100, v: _value / 100, a: _alpha / 100 }); this.value = this._isValid ? this._tiny.toString(_format) : ""; } }; const usePredefine = (props2) => { const { currentColor } = inject(colorPickerPanelContextKey); const rgbaColors = ref(parseColors(props2.colors, props2.color)); watch(() => currentColor.value, (val) => { const color = new Color({ value: val, enableAlpha: props2.enableAlpha }); rgbaColors.value.forEach((item) => { item.selected = color.compare(item); }); }); watchEffect(() => { rgbaColors.value = parseColors(props2.colors, props2.color); }); function handleSelect(index) { props2.color.fromString(props2.colors[index]); } function parseColors(colors, color) { return colors.map((value) => { const c = new Color({ value, enableAlpha: props2.enableAlpha }); c.selected = c.compare(color); return c; }); } return { rgbaColors, handleSelect }; }; const usePredefineDOM = (props2) => { const ns = useNamespace("color-predefine"); const rootKls = computed(() => [ns.b(), ns.is("disabled", props2.disabled)]); const colorsKls = computed(() => ns.e("colors")); function colorSelectorKls(item) { return [ ns.e("color-selector"), ns.is("alpha", item.get("alpha") < 100), { selected: item.selected } ]; } return { rootKls, colorsKls, colorSelectorKls }; }; const _hoisted_1$R = [ "disabled", "aria-label", "onClick" ]; var predefine_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElColorPredefine", __name: "predefine", props: predefineProps, setup(__props) { const props2 = __props; const { rgbaColors, handleSelect } = usePredefine(props2); const { rootKls, colorsKls, colorSelectorKls } = usePredefineDOM(props2); const { t } = useLocale(); const ariaLabel = (value) => { return t("el.colorpicker.predefineDescription", { value }); }; return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)) }, [createBaseVNode("div", { class: normalizeClass(unref(colorsKls)) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(rgbaColors), (item, index) => { return openBlock(), createElementBlock("button", { key: __props.colors[index], type: "button", disabled: __props.disabled, "aria-label": ariaLabel(item.value), class: normalizeClass(unref(colorSelectorKls)(item)), onClick: ($event) => unref(handleSelect)(index) }, [createBaseVNode("div", { style: normalizeStyle({ backgroundColor: item.value }) }, null, 4)], 10, _hoisted_1$R); }), 128))], 2)], 2); }; } }); var predefine_default = predefine_vue_vue_type_script_setup_true_lang_default; const svPanelProps = buildProps({ color: { type: definePropType(Object), required: true }, disabled: Boolean }); const useSvPanel = (props2) => { const instance = getCurrentInstance(); const cursorRef = ref(); const cursorTop = ref(0); const cursorLeft = ref(0); const background = ref("hsl(0, 100%, 50%)"); const saturation = computed(() => props2.color.get("saturation")); const brightness = computed(() => props2.color.get("value")); const hue = computed(() => props2.color.get("hue")); function handleClick(event) { var _a; if (props2.disabled) return; if (event.target !== cursorRef.value) handleDrag(event); (_a = cursorRef.value) == null ? void 0 : _a.focus({ preventScroll: true }); } function handleDrag(event) { if (props2.disabled) return; const rect = instance.vnode.el.getBoundingClientRect(); const { clientX, clientY } = getClientXY(event); let left = clientX - rect.left; let top = clientY - rect.top; left = Math.max(0, left); left = Math.min(left, rect.width); top = Math.max(0, top); top = Math.min(top, rect.height); cursorLeft.value = left; cursorTop.value = top; props2.color.set({ saturation: left / rect.width * 100, value: 100 - top / rect.height * 100 }); } function handleKeydown(event) { if (props2.disabled) return; const { shiftKey } = event; const code = getEventCode(event); const step2 = shiftKey ? 10 : 1; let isPreventDefault = true; switch (code) { case EVENT_CODE.left: incrementSaturation(-step2); break; case EVENT_CODE.right: incrementSaturation(step2); break; case EVENT_CODE.up: incrementBrightness(step2); break; case EVENT_CODE.down: incrementBrightness(-step2); break; default: isPreventDefault = false; break; } isPreventDefault && event.preventDefault(); } function incrementSaturation(step2) { let next = saturation.value + step2; next = next < 0 ? 0 : next > 100 ? 100 : next; props2.color.set("saturation", next); } function incrementBrightness(step2) { let next = brightness.value + step2; next = next < 0 ? 0 : next > 100 ? 100 : next; props2.color.set("value", next); } return { cursorRef, cursorTop, cursorLeft, background, saturation, brightness, hue, handleClick, handleDrag, handleKeydown }; }; const useSvPanelDOM = (props2, { cursorTop, cursorLeft, background, handleDrag }) => { const instance = getCurrentInstance(); const ns = useNamespace("color-svpanel"); function update() { const saturation = props2.color.get("saturation"); const brightness = props2.color.get("value"); const { clientWidth: width, clientHeight: height } = instance.vnode.el; cursorLeft.value = saturation * width / 100; cursorTop.value = (100 - brightness) * height / 100; background.value = `hsl(${props2.color.get("hue")}, 100%, 50%)`; } onMounted(() => { draggable(instance.vnode.el, { drag: (event) => { handleDrag(event); }, end: (event) => { handleDrag(event); } }); update(); }); watch([ () => props2.color.get("hue"), () => props2.color.get("value"), () => props2.color.value ], () => update()); return { rootKls: computed(() => ns.b()), cursorKls: computed(() => ns.e("cursor")), rootStyle: computed(() => ({ backgroundColor: background.value })), cursorStyle: computed(() => ({ top: addUnit(cursorTop.value), left: addUnit(cursorLeft.value) })), update }; }; const _hoisted_1$Q = [ "tabindex", "aria-disabled", "aria-label", "aria-valuenow", "aria-valuetext" ]; var sv_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElSvPanel", __name: "sv-panel", props: svPanelProps, setup(__props, { expose: __expose }) { const props2 = __props; const { cursorRef, cursorTop, cursorLeft, background, saturation, brightness, handleClick, handleDrag, handleKeydown } = useSvPanel(props2); const { rootKls, cursorKls, rootStyle, cursorStyle, update } = useSvPanelDOM(props2, { cursorTop, cursorLeft, background, handleDrag }); const { t } = useLocale(); const ariaLabel = computed(() => t("el.colorpicker.svLabel")); const ariaValuetext = computed(() => { return t("el.colorpicker.svDescription", { saturation: saturation.value, brightness: brightness.value, color: props2.color.value }); }); __expose({ update }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)), style: normalizeStyle(unref(rootStyle)), onClick: _cache[1] || (_cache[1] = (...args) => unref(handleClick) && unref(handleClick)(...args)) }, [createBaseVNode("div", { ref_key: "cursorRef", ref: cursorRef, class: normalizeClass(unref(cursorKls)), style: normalizeStyle(unref(cursorStyle)), tabindex: __props.disabled ? void 0 : 0, "aria-disabled": __props.disabled, role: "slider", "aria-valuemin": "0,0", "aria-valuemax": "100,100", "aria-label": ariaLabel.value, "aria-valuenow": `${unref(saturation)},${unref(brightness)}`, "aria-valuetext": ariaValuetext.value, onKeydown: _cache[0] || (_cache[0] = (...args) => unref(handleKeydown) && unref(handleKeydown)(...args)) }, null, 46, _hoisted_1$Q)], 6); }; } }); var sv_panel_default = sv_panel_vue_vue_type_script_setup_true_lang_default; const useCommonColor = (props2, emit) => { const color = reactive(new Color({ enableAlpha: props2.showAlpha, format: props2.colorFormat || "", value: props2.modelValue })); watch(() => [props2.colorFormat, props2.showAlpha], () => { color.enableAlpha = props2.showAlpha; color.format = props2.colorFormat || color.format; color.doOnChange(); emit(UPDATE_MODEL_EVENT, color.value); }); return { color }; }; var color_picker_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElColorPickerPanel", __name: "color-picker-panel", props: colorPickerPanelProps, emits: colorPickerPanelEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("color-picker-panel"); const { formItem } = useFormItem(); const disabled = useFormDisabled(); const hueRef = ref(); const svRef = ref(); const alphaRef = ref(); const inputRef = ref(); const customInput = ref(""); const { color } = inject(ROOT_COMMON_COLOR_INJECTION_KEY, () => useCommonColor(props2, emit), true); function handleConfirm() { color.fromString(customInput.value); if (color.value !== customInput.value) customInput.value = color.value; } function handleFocusout() { var _a; if (props2.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err)); } function update() { var _a, _b, _c; (_a = hueRef.value) == null ? void 0 : _a.update(); (_b = svRef.value) == null ? void 0 : _b.update(); (_c = alphaRef.value) == null ? void 0 : _c.update(); } onMounted(() => { if (props2.modelValue) customInput.value = color.value; nextTick(update); }); watch(() => props2.modelValue, (newVal) => { if (newVal !== color.value) newVal ? color.fromString(newVal) : color.clear(); }); watch(() => color.value, (val) => { emit(UPDATE_MODEL_EVENT, val); customInput.value = val; if (props2.validateEvent) formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err)); }); provide(colorPickerPanelContextKey, { currentColor: computed(() => color.value) }); __expose({ color, inputRef, update }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([ unref(ns).b(), unref(ns).is("disabled", unref(disabled)), unref(ns).is("border", __props.border) ]), onFocusout: handleFocusout }, [ createBaseVNode("div", { class: normalizeClass(unref(ns).e("wrapper")) }, [createVNode(hue_slider_default, { ref_key: "hueRef", ref: hueRef, color: unref(color), vertical: "", disabled: unref(disabled), class: normalizeClass(["hue-slider", __props.hueSliderClass]), style: normalizeStyle(__props.hueSliderStyle) }, null, 8, [ "color", "disabled", "class", "style" ]), createVNode(sv_panel_default, { ref_key: "svRef", ref: svRef, color: unref(color), disabled: unref(disabled) }, null, 8, ["color", "disabled"])], 2), __props.showAlpha ? (openBlock(), createBlock(alpha_slider_default, { key: 0, ref_key: "alphaRef", ref: alphaRef, color: unref(color), disabled: unref(disabled) }, null, 8, ["color", "disabled"])) : createCommentVNode("v-if", true), __props.predefine ? (openBlock(), createBlock(predefine_default, { key: 1, ref: "predefine", "enable-alpha": __props.showAlpha, color: unref(color), colors: __props.predefine, disabled: unref(disabled) }, null, 8, [ "enable-alpha", "color", "colors", "disabled" ])) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("footer")) }, [createVNode(unref(ElInput), { ref_key: "inputRef", ref: inputRef, modelValue: customInput.value, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event), "validate-event": false, size: "small", disabled: unref(disabled), onChange: handleConfirm }, null, 8, ["modelValue", "disabled"]), renderSlot(_ctx.$slots, "footer")], 2) ], 34); }; } }); var color_picker_panel_default = color_picker_panel_vue_vue_type_script_setup_true_lang_default; const ElColorPickerPanel = withInstall(color_picker_panel_default); const colorPickerProps = buildProps({ persistent: { type: Boolean, default: true }, modelValue: { type: definePropType(String), default: void 0 }, id: String, showAlpha: Boolean, colorFormat: { type: definePropType(String) }, disabled: { type: Boolean, default: void 0 }, clearable: { type: Boolean, default: true }, size: useSizeProp, popperClass: useTooltipContentProps.popperClass, popperStyle: useTooltipContentProps.popperStyle, tabindex: { type: [String, Number], default: 0 }, teleported: useTooltipContentProps.teleported, appendTo: useTooltipContentProps.appendTo, predefine: { type: definePropType(Array) }, validateEvent: { type: Boolean, default: true }, ...useEmptyValuesProps, ...useAriaProps(["ariaLabel"]) }); const colorPickerEmits = { [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val), [CHANGE_EVENT]: (val) => isString(val) || isNil(val), activeChange: (val) => isString(val) || isNil(val), focus: (evt) => evt instanceof FocusEvent, blur: (evt) => evt instanceof FocusEvent, clear: () => true }; const _hoisted_1$P = [ "id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex" ]; var color_picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElColorPicker", __name: "color-picker", props: colorPickerProps, emits: colorPickerEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const { t } = useLocale(); const ns = useNamespace("color"); const { formItem } = useFormItem(); const colorSize = useFormSize(); const colorDisabled = useFormDisabled(); const { valueOnClear, isEmptyValue } = useEmptyValues(props2, null); const commonColor = useCommonColor(props2, emit); const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props2, { formItemContext: formItem }); const popper = ref(); const triggerRef2 = ref(); const pickerPanelRef = ref(); const showPicker = ref(false); const showPanelColor = ref(false); let shouldActiveChange = true; const { isFocused, handleFocus, handleBlur } = useFocusController(triggerRef2, { disabled: colorDisabled, beforeBlur(event) { var _a; return (_a = popper.value) == null ? void 0 : _a.isFocusInsideContent(event); }, afterBlur() { var _a; setShowPicker(false); resetColor(); if (props2.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err)); } }); const color = reactiveComputed(() => { var _a; return ((_a = pickerPanelRef.value) == null ? void 0 : _a.color) ?? commonColor.color; }); const panelProps = computed(() => pick(props2, Object.keys(colorPickerPanelProps))); const displayedColor = computed(() => { if (!props2.modelValue && !showPanelColor.value) return "transparent"; return displayedRgb(color, props2.showAlpha); }); const currentColor = computed(() => { return !props2.modelValue && !showPanelColor.value ? "" : color.value; }); const buttonAriaLabel = computed(() => { return !isLabeledByFormItem.value ? props2.ariaLabel || t("el.colorpicker.defaultLabel") : void 0; }); const buttonAriaLabelledby = computed(() => { return isLabeledByFormItem.value ? formItem == null ? void 0 : formItem.labelId : void 0; }); const btnKls = computed(() => { return [ ns.b("picker"), ns.is("disabled", colorDisabled.value), ns.bm("picker", colorSize.value), ns.is("focused", isFocused.value) ]; }); function displayedRgb(color2, showAlpha) { const { r, g, b, a } = color2.toRgb(); return showAlpha ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`; } function setShowPicker(value) { showPicker.value = value; } const debounceSetShowPicker = debounce(setShowPicker, 100, { leading: true }); function show() { if (colorDisabled.value) return; setShowPicker(true); } function hide() { debounceSetShowPicker(false); resetColor(); } function resetColor() { nextTick(() => { if (props2.modelValue) color.fromString(props2.modelValue); else { color.value = ""; nextTick(() => { showPanelColor.value = false; }); } }); } function handleTrigger() { if (colorDisabled.value) return; if (showPicker.value) resetColor(); debounceSetShowPicker(!showPicker.value); } function confirmValue() { const value = isEmptyValue(color.value) ? valueOnClear.value : color.value; emit(UPDATE_MODEL_EVENT, value); emit(CHANGE_EVENT, value); if (props2.validateEvent) formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err)); debounceSetShowPicker(false); nextTick(() => { const newColor = new Color({ enableAlpha: props2.showAlpha, format: props2.colorFormat || "", value: props2.modelValue }); if (!color.compare(newColor)) resetColor(); }); } function clear() { debounceSetShowPicker(false); emit(UPDATE_MODEL_EVENT, valueOnClear.value); emit(CHANGE_EVENT, valueOnClear.value); if (props2.modelValue !== valueOnClear.value && props2.validateEvent) formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err)); resetColor(); emit("clear"); } function handleShowTooltip() { var _a, _b; (_b = (_a = pickerPanelRef == null ? void 0 : pickerPanelRef.value) == null ? void 0 : _a.inputRef) == null ? void 0 : _b.focus(); } function handleClickOutside() { if (!showPicker.value) return; hide(); isFocused.value && focus(); } function handleEsc(event) { event.preventDefault(); event.stopPropagation(); setShowPicker(false); resetColor(); } function handleKeyDown(event) { switch (getEventCode(event)) { case EVENT_CODE.enter: case EVENT_CODE.numpadEnter: case EVENT_CODE.space: event.preventDefault(); event.stopPropagation(); show(); break; case EVENT_CODE.esc: handleEsc(event); break; } } function focus() { triggerRef2.value.focus(); } function blur() { triggerRef2.value.blur(); } watch(() => currentColor.value, (val) => { shouldActiveChange && emit("activeChange", val); shouldActiveChange = true; }); watch(() => color.value, () => { if (!props2.modelValue && !showPanelColor.value) showPanelColor.value = true; }); watch(() => props2.modelValue, (newVal) => { if (!newVal) showPanelColor.value = false; else if (newVal && newVal !== color.value) { shouldActiveChange = false; color.fromString(newVal); } }); watch(() => showPicker.value, () => { pickerPanelRef.value && nextTick(pickerPanelRef.value.update); }); provide(ROOT_COMMON_COLOR_INJECTION_KEY, commonColor); __expose({ color, show, hide, focus, blur }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTooltip), { ref_key: "popper", ref: popper, visible: showPicker.value, "show-arrow": false, "fallback-placements": [ "bottom", "top", "right", "left" ], offset: 0, "gpu-acceleration": false, "popper-class": [unref(ns).be("picker", "panel"), __props.popperClass], "popper-style": __props.popperStyle, "stop-popper-mouse-event": false, pure: "", loop: "", role: "dialog", effect: "light", trigger: "click", teleported: __props.teleported, transition: `${unref(ns).namespace.value}-zoom-in-top`, persistent: __props.persistent, "append-to": __props.appendTo, onShow: handleShowTooltip, onHide: _cache[2] || (_cache[2] = ($event) => setShowPicker(false)) }, { content: withCtx(() => [withDirectives((openBlock(), createBlock(unref(ElColorPickerPanel), mergeProps({ ref_key: "pickerPanelRef", ref: pickerPanelRef }, panelProps.value, { border: false, "validate-event": false, onKeydown: withKeys(handleEsc, ["esc"]) }), { footer: withCtx(() => [createBaseVNode("div", null, [__props.clearable ? (openBlock(), createBlock(unref(ElButton), { key: 0, class: normalizeClass(unref(ns).be("footer", "link-btn")), text: "", size: "small", onClick: clear }, { default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.colorpicker.clear")), 1)]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), createVNode(unref(ElButton), { plain: "", size: "small", class: normalizeClass(unref(ns).be("footer", "btn")), onClick: confirmValue }, { default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.colorpicker.confirm")), 1)]), _: 1 }, 8, ["class"])])]), _: 1 }, 16)), [[ unref(ClickOutside), handleClickOutside, triggerRef2.value ]])]), default: withCtx(() => [createBaseVNode("div", mergeProps({ id: unref(buttonId), ref_key: "triggerRef", ref: triggerRef2 }, _ctx.$attrs, { class: btnKls.value, role: "button", "aria-label": buttonAriaLabel.value, "aria-labelledby": buttonAriaLabelledby.value, "aria-description": unref(t)("el.colorpicker.description", { color: __props.modelValue || "" }), "aria-disabled": unref(colorDisabled), tabindex: unref(colorDisabled) ? void 0 : __props.tabindex, onKeydown: handleKeyDown, onFocus: _cache[0] || (_cache[0] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)), onBlur: _cache[1] || (_cache[1] = (...args) => unref(handleBlur) && unref(handleBlur)(...args)) }), [createBaseVNode("div", { class: normalizeClass(unref(ns).be("picker", "trigger")), onClick: handleTrigger }, [createBaseVNode("span", { class: normalizeClass([unref(ns).be("picker", "color"), unref(ns).is("alpha", __props.showAlpha)]) }, [createBaseVNode("span", { class: normalizeClass(unref(ns).be("picker", "color-inner")), style: normalizeStyle({ backgroundColor: displayedColor.value }) }, [withDirectives(createVNode(unref(ElIcon), { class: normalizeClass([unref(ns).be("picker", "icon"), unref(ns).is("icon-arrow-down")]) }, { default: withCtx(() => [createVNode(unref(arrow_down_default))]), _: 1 }, 8, ["class"]), [[vShow, __props.modelValue || showPanelColor.value]]), withDirectives(createVNode(unref(ElIcon), { class: normalizeClass([unref(ns).be("picker", "empty"), unref(ns).is("icon-close")]) }, { default: withCtx(() => [createVNode(unref(close_default))]), _: 1 }, 8, ["class"]), [[vShow, !__props.modelValue && !showPanelColor.value]])], 6)], 2)], 2)], 16, _hoisted_1$P)]), _: 1 }, 8, [ "visible", "popper-class", "popper-style", "teleported", "transition", "persistent", "append-to" ]); }; } }); var color_picker_default = color_picker_vue_vue_type_script_setup_true_lang_default; const ElColorPicker = withInstall(color_picker_default); var container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElContainer", __name: "container", props: { direction: { type: String, required: false } }, setup(__props) { const props2 = __props; const slots = useSlots(); const ns = useNamespace("container"); const isVertical = computed(() => { if (props2.direction === "vertical") return true; else if (props2.direction === "horizontal") return false; if (slots && slots.default) return slots.default().some((vNode) => { const tag = vNode.type.name; return tag === "ElHeader" || tag === "ElFooter"; }); else return false; }); return (_ctx, _cache) => { return openBlock(), createElementBlock("section", { class: normalizeClass([unref(ns).b(), unref(ns).is("vertical", isVertical.value)]) }, [renderSlot(_ctx.$slots, "default")], 2); }; } }); var container_default = container_vue_vue_type_script_setup_true_lang_default; var aside_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElAside", __name: "aside", props: { width: { type: [String, null], required: false, default: null } }, setup(__props) { const props2 = __props; const ns = useNamespace("aside"); const style = computed(() => props2.width ? ns.cssVarBlock({ width: props2.width }) : {}); return (_ctx, _cache) => { return openBlock(), createElementBlock("aside", { class: normalizeClass(unref(ns).b()), style: normalizeStyle(style.value) }, [renderSlot(_ctx.$slots, "default")], 6); }; } }); var aside_default = aside_vue_vue_type_script_setup_true_lang_default; var footer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElFooter", __name: "footer", props: { height: { type: [String, null], required: false, default: null } }, setup(__props) { const props2 = __props; const ns = useNamespace("footer"); const style = computed(() => props2.height ? ns.cssVarBlock({ height: props2.height }) : {}); return (_ctx, _cache) => { return openBlock(), createElementBlock("footer", { class: normalizeClass(unref(ns).b()), style: normalizeStyle(style.value) }, [renderSlot(_ctx.$slots, "default")], 6); }; } }); var footer_default = footer_vue_vue_type_script_setup_true_lang_default; var header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElHeader", __name: "header", props: { height: { type: [String, null], required: false, default: null } }, setup(__props) { const props2 = __props; const ns = useNamespace("header"); const style = computed(() => { return props2.height ? ns.cssVarBlock({ height: props2.height }) : {}; }); return (_ctx, _cache) => { return openBlock(), createElementBlock("header", { class: normalizeClass(unref(ns).b()), style: normalizeStyle(style.value) }, [renderSlot(_ctx.$slots, "default")], 6); }; } }); var header_default = header_vue_vue_type_script_setup_true_lang_default; var main_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElMain", __name: "main", setup(__props) { const ns = useNamespace("main"); return (_ctx, _cache) => { return openBlock(), createElementBlock("main", { class: normalizeClass(unref(ns).b()) }, [renderSlot(_ctx.$slots, "default")], 2); }; } }); var main_default = main_vue_vue_type_script_setup_true_lang_default; const ElContainer = withInstall(container_default, { Aside: aside_default, Footer: footer_default, Header: header_default, Main: main_default }); const ElAside = withNoopInstall(aside_default); const ElFooter = withNoopInstall(footer_default); const ElHeader = withNoopInstall(header_default); const ElMain = withNoopInstall(main_default); const datePickerPanelProps = buildProps({ valueFormat: String, dateFormat: String, timeFormat: String, disabled: { type: Boolean, default: void 0 }, modelValue: { type: definePropType([ Date, Array, String, Number ]), default: "" }, defaultValue: { type: definePropType([Date, Array]) }, defaultTime: { type: definePropType([Date, Array]) }, isRange: Boolean, ...disabledTimeListsProps, disabledDate: { type: Function }, cellClassName: { type: Function }, shortcuts: { type: Array, default: () => [] }, arrowControl: Boolean, unlinkPanels: Boolean, showNow: { type: Boolean, default: true }, showConfirm: Boolean, showFooter: Boolean, showWeekNumber: Boolean, type: { type: definePropType(String), default: "date" }, clearable: { type: Boolean, default: true }, border: { type: Boolean, default: true }, editable: { type: Boolean, default: true } }); const ROOT_PICKER_INJECTION_KEY = Symbol("rootPickerContextKey"); const ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY = "ElIsDefaultFormat"; const selectionModes = [ "date", "dates", "year", "years", "month", "months", "week", "range" ]; const datePickerSharedProps = buildProps({ cellClassName: { type: definePropType(Function) }, disabledDate: { type: definePropType(Function) }, date: { type: definePropType(Object), required: true }, minDate: { type: definePropType(Object) }, maxDate: { type: definePropType(Object) }, parsedValue: { type: definePropType([Object, Array]) }, rangeState: { type: definePropType(Object), default: () => ({ endDate: null, selecting: false }) }, disabled: Boolean }); const panelSharedProps = buildProps({ type: { type: definePropType(String), required: true, values: datePickTypes }, dateFormat: String, timeFormat: String, showNow: { type: Boolean, default: true }, showConfirm: Boolean, showFooter: { type: Boolean, default: true }, showWeekNumber: Boolean, border: Boolean, disabled: Boolean, editable: { type: Boolean, default: true } }); const panelRangeSharedProps = buildProps({ unlinkPanels: Boolean, visible: { type: Boolean, default: true }, showConfirm: Boolean, showFooter: { type: Boolean, default: true }, border: Boolean, disabled: Boolean, parsedValue: { type: definePropType(Array) } }); const selectionModeWithDefault = (mode) => { return { type: String, values: selectionModes, default: mode }; }; const panelDatePickProps = buildProps({ ...panelSharedProps, parsedValue: { type: definePropType([Object, Array]) }, visible: { type: Boolean, default: true }, format: { type: String, default: "" } }); const isValidRange = (range) => { if (!isArray(range)) return false; const [left, right] = range; return dayjs.isDayjs(left) && dayjs.isDayjs(right) && dayjs(left).isValid() && dayjs(right).isValid() && left.isSameOrBefore(right); }; const getDefaultValue = (defaultValue, { lang, step: step2 = 1, unit: unit2, unlinkPanels }) => { let start; if (isArray(defaultValue)) { let [left, right] = defaultValue.map((d) => dayjs(d).locale(lang)); if (!unlinkPanels) right = left.add(step2, unit2); return [left, right]; } else if (defaultValue) start = dayjs(defaultValue); else start = dayjs(); start = start.locale(lang); return [start, start.add(step2, unit2)]; }; const buildPickerTable = (dimension, rows, { columnIndexOffset, startDate, nextEndDate, now, unit: unit2, relativeDateGetter, setCellMetadata, setRowMetadata }) => { for (let rowIndex = 0; rowIndex < dimension.row; rowIndex++) { const row = rows[rowIndex]; for (let columnIndex = 0; columnIndex < dimension.column; columnIndex++) { let cell = row[columnIndex + columnIndexOffset]; if (!cell) cell = { row: rowIndex, column: columnIndex, type: "normal", inRange: false, start: false, end: false }; const nextStartDate = relativeDateGetter(rowIndex * dimension.column + columnIndex); cell.dayjs = nextStartDate; cell.date = nextStartDate.toDate(); cell.timestamp = nextStartDate.valueOf(); cell.type = "normal"; cell.inRange = !!(startDate && nextStartDate.isSameOrAfter(startDate, unit2) && nextEndDate && nextStartDate.isSameOrBefore(nextEndDate, unit2)) || !!(startDate && nextStartDate.isSameOrBefore(startDate, unit2) && nextEndDate && nextStartDate.isSameOrAfter(nextEndDate, unit2)); if (startDate == null ? void 0 : startDate.isSameOrAfter(nextEndDate)) { cell.start = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit2); cell.end = startDate && nextStartDate.isSame(startDate, unit2); } else { cell.start = !!startDate && nextStartDate.isSame(startDate, unit2); cell.end = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit2); } if (nextStartDate.isSame(now, unit2)) cell.type = "today"; setCellMetadata == null ? void 0 : setCellMetadata(cell, { rowIndex, columnIndex }); row[columnIndex + columnIndexOffset] = cell; } setRowMetadata == null ? void 0 : setRowMetadata(row); } }; const datesInMonth = (date, year, month, lang) => { const firstDay = dayjs().locale(lang).startOf("month").month(month).year(year).hour(date.hour()).minute(date.minute()).second(date.second()); return rangeArr(firstDay.daysInMonth()).map((n) => firstDay.add(n, "day").toDate()); }; const getValidDateOfMonth = (date, year, month, lang, disabledDate) => { const _value = dayjs().year(year).month(month).startOf("month").hour(date.hour()).minute(date.minute()).second(date.second()); const _date = datesInMonth(date, year, month, lang).find((date2) => { return !(disabledDate == null ? void 0 : disabledDate(date2)); }); if (_date) return dayjs(_date).locale(lang); return _value.locale(lang); }; const getValidDateOfYear = (value, lang, disabledDate) => { const year = value.year(); if (!(disabledDate == null ? void 0 : disabledDate(value.toDate()))) return value.locale(lang); const month = value.month(); if (!datesInMonth(value, year, month, lang).every(disabledDate)) return getValidDateOfMonth(value, year, month, lang, disabledDate); for (let i = 0; i < 12; i++) if (!datesInMonth(value, year, i, lang).every(disabledDate)) return getValidDateOfMonth(value, year, i, lang, disabledDate); return value; }; const correctlyParseUserInput = (value, format, lang, defaultFormat) => { if (isArray(value)) return value.map((v) => correctlyParseUserInput(v, format, lang, defaultFormat)); if (isString(value)) { const dayjsValue = (defaultFormat == null ? void 0 : defaultFormat.value) ? dayjs(value) : dayjs(value, format); if (!dayjsValue.isValid()) return dayjsValue; } return dayjs(value, format).locale(lang); }; const basicDateTableProps = buildProps({ ...datePickerSharedProps, showWeekNumber: Boolean, selectionMode: selectionModeWithDefault("date") }); const basicDateTableEmits = [ "changerange", "pick", "select" ]; const isNormalDay = (type = "") => { return ["normal", "today"].includes(type); }; const useBasicDateTable = (props2, emit) => { const { lang } = useLocale(); const tbodyRef = ref(); const currentCellRef = ref(); const lastRow = ref(); const lastColumn = ref(); const tableRows = ref([ [], [], [], [], [], [] ]); let focusWithClick = false; const firstDayOfWeek = props2.date.$locale().weekStart || 7; const WEEKS_CONSTANT = props2.date.locale("en").localeData().weekdaysShort().map((_) => _.toLowerCase()); const offsetDay = computed(() => { return firstDayOfWeek > 3 ? 7 - firstDayOfWeek : -firstDayOfWeek; }); const startDate = computed(() => { const startDayOfMonth = props2.date.startOf("month"); return startDayOfMonth.subtract(startDayOfMonth.day() || 7, "day"); }); const WEEKS = computed(() => { return WEEKS_CONSTANT.concat(WEEKS_CONSTANT).slice(firstDayOfWeek, firstDayOfWeek + 7); }); const hasCurrent = computed(() => { return flatten(unref(rows)).some((row) => { return row.isCurrent; }); }); const days = computed(() => { const startOfMonth = props2.date.startOf("month"); return { startOfMonthDay: startOfMonth.day() || 7, dateCountOfMonth: startOfMonth.daysInMonth(), dateCountOfLastMonth: startOfMonth.subtract(1, "month").daysInMonth() }; }); const selectedDate = computed(() => { return props2.selectionMode === "dates" ? castArray(props2.parsedValue) : []; }); const setDateText = (cell, { count, rowIndex, columnIndex }) => { const { startOfMonthDay, dateCountOfMonth, dateCountOfLastMonth } = unref(days); const offset2 = unref(offsetDay); if (rowIndex >= 0 && rowIndex <= 1) { const numberOfDaysFromPreviousMonth = startOfMonthDay + offset2 < 0 ? 7 + startOfMonthDay + offset2 : startOfMonthDay + offset2; if (columnIndex + rowIndex * 7 >= numberOfDaysFromPreviousMonth) { cell.text = count; return true; } else { cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - columnIndex % 7) + 1 + rowIndex * 7; cell.type = "prev-month"; } } else { if (count <= dateCountOfMonth) cell.text = count; else { cell.text = count - dateCountOfMonth; cell.type = "next-month"; } return true; } return false; }; const setCellMetadata = (cell, { columnIndex, rowIndex }, count) => { const { disabledDate, cellClassName } = props2; const _selectedDate = unref(selectedDate); const shouldIncrement = setDateText(cell, { count, rowIndex, columnIndex }); const cellDate = cell.dayjs.toDate(); cell.selected = _selectedDate.find((d) => d.isSame(cell.dayjs, "day")); cell.isSelected = !!cell.selected; cell.isCurrent = isCurrent(cell); cell.disabled = disabledDate == null ? void 0 : disabledDate(cellDate); cell.customClass = cellClassName == null ? void 0 : cellClassName(cellDate); return shouldIncrement; }; const setRowMetadata = (row) => { if (props2.selectionMode === "week") { const [start, end] = props2.showWeekNumber ? [1, 7] : [0, 6]; const isActive = isWeekActive(row[start + 1]); row[start].inRange = isActive; row[start].start = isActive; row[end].inRange = isActive; row[end].end = isActive; } }; const rows = computed(() => { const { minDate, maxDate, rangeState, showWeekNumber } = props2; const offset2 = unref(offsetDay); const rows_ = unref(tableRows); const dateUnit = "day"; let count = 1; buildPickerTable({ row: 6, column: 7 }, rows_, { startDate: minDate, columnIndexOffset: showWeekNumber ? 1 : 0, nextEndDate: rangeState.endDate || maxDate || rangeState.selecting && minDate || null, now: dayjs().locale(unref(lang)).startOf(dateUnit), unit: dateUnit, relativeDateGetter: (idx) => unref(startDate).add(idx - offset2, dateUnit), setCellMetadata: (...args) => { if (setCellMetadata(...args, count)) count += 1; }, setRowMetadata }); if (showWeekNumber) { for (let rowIndex = 0; rowIndex < 6; rowIndex++) if (rows_[rowIndex][1].dayjs) rows_[rowIndex][0] = { type: "week", text: rows_[rowIndex][1].dayjs.week() }; } return rows_; }); watch(() => props2.date, async () => { var _a; if ((_a = unref(tbodyRef)) == null ? void 0 : _a.contains(document.activeElement)) { await nextTick(); await focus(); } }); const focus = async () => { var _a; return (_a = unref(currentCellRef)) == null ? void 0 : _a.focus(); }; const isCurrent = (cell) => { return props2.selectionMode === "date" && isNormalDay(cell.type) && cellMatchesDate(cell, props2.parsedValue); }; const cellMatchesDate = (cell, date) => { if (!date) return false; return dayjs(date).locale(unref(lang)).isSame(props2.date.date(Number(cell.text)), "day"); }; const getDateOfCell = (row, column) => { const startOfMonthDay = unref(days).startOfMonthDay; const offset2 = unref(offsetDay); const numberOfDaysFromPreviousMonth = startOfMonthDay + offset2 < 0 ? 7 + startOfMonthDay + offset2 : startOfMonthDay + offset2; const offsetFromStart = row * 7 + (column - (props2.showWeekNumber ? 1 : 0)); return props2.date.startOf("month").subtract(numberOfDaysFromPreviousMonth, "day").add(offsetFromStart, "day"); }; const handleMouseMove = (event) => { var _a; if (!props2.rangeState.selecting) return; let target = event.target; if (target.tagName === "SPAN") target = (_a = target.parentNode) == null ? void 0 : _a.parentNode; if (target.tagName === "DIV") target = target.parentNode; if (target.tagName !== "TD") return; const row = target.parentNode.rowIndex - 1; const column = target.cellIndex; if (unref(rows)[row][column].disabled) return; if (row !== unref(lastRow) || column !== unref(lastColumn)) { lastRow.value = row; lastColumn.value = column; emit("changerange", { selecting: true, endDate: getDateOfCell(row, column) }); } }; const isSelectedCell = (cell) => { return !unref(hasCurrent) && (cell == null ? void 0 : cell.text) === 1 && isNormalDay(cell.type) || cell.isCurrent; }; const handleFocus = (event) => { if (focusWithClick || unref(hasCurrent) || props2.selectionMode !== "date") return; handlePickDate(event, true); }; const handleMouseDown = (event) => { if (!event.target.closest("td")) return; focusWithClick = true; }; const handleMouseUp = (event) => { if (!event.target.closest("td")) return; focusWithClick = false; }; const handleRangePick = (newDate) => { if (!props2.rangeState.selecting || !props2.minDate) { emit("pick", { minDate: newDate, maxDate: null }); emit("select", true); } else { if (newDate >= props2.minDate) emit("pick", { minDate: props2.minDate, maxDate: newDate }); else emit("pick", { minDate: newDate, maxDate: props2.minDate }); emit("select", false); } }; const handleWeekPick = (newDate) => { const weekNumber = newDate.week(); const value = `${newDate.year()}w${weekNumber}`; emit("pick", { year: newDate.year(), week: weekNumber, value, date: newDate.startOf("week") }); }; const handleDatesPick = (newDate, selected) => { emit("pick", selected ? castArray(props2.parsedValue).filter((d) => (d == null ? void 0 : d.valueOf()) !== newDate.valueOf()) : castArray(props2.parsedValue).concat([newDate])); }; const handlePickDate = (event, isKeyboardMovement = false) => { if (props2.disabled) return; const target = event.target.closest("td"); if (!target) return; const row = target.parentNode.rowIndex - 1; const column = target.cellIndex; const cell = unref(rows)[row][column]; if (cell.disabled || cell.type === "week") return; const newDate = getDateOfCell(row, column); switch (props2.selectionMode) { case "range": handleRangePick(newDate); break; case "date": emit("pick", newDate, isKeyboardMovement); break; case "week": handleWeekPick(newDate); break; case "dates": handleDatesPick(newDate, !!cell.selected); break; } }; const isWeekActive = (cell) => { if (props2.selectionMode !== "week") return false; let newDate = props2.date.startOf("day"); if (cell.type === "prev-month") newDate = newDate.subtract(1, "month"); if (cell.type === "next-month") newDate = newDate.add(1, "month"); newDate = newDate.date(Number.parseInt(cell.text, 10)); if (props2.parsedValue && !isArray(props2.parsedValue)) { const dayOffset = (props2.parsedValue.day() - firstDayOfWeek + 7) % 7 - 1; return props2.parsedValue.subtract(dayOffset, "day").isSame(newDate, "day"); } return false; }; return { WEEKS, rows, tbodyRef, currentCellRef, focus, isCurrent, isWeekActive, isSelectedCell, handlePickDate, handleMouseUp, handleMouseDown, handleMouseMove, handleFocus }; }; const useBasicDateTableDOM = (props2, { isCurrent, isWeekActive }) => { const ns = useNamespace("date-table"); const { t } = useLocale(); const tableKls = computed(() => [ns.b(), ns.is("week-mode", props2.selectionMode === "week" && !props2.disabled)]); const tableLabel = computed(() => t("el.datepicker.dateTablePrompt")); const getCellClasses = (cell) => { const classes = []; if (isNormalDay(cell.type) && !cell.disabled) { classes.push("available"); if (cell.type === "today") classes.push("today"); } else classes.push(cell.type); if (isCurrent(cell)) classes.push("current"); if (cell.inRange && (isNormalDay(cell.type) || props2.selectionMode === "week")) { classes.push("in-range"); if (cell.start) classes.push("start-date"); if (cell.end) classes.push("end-date"); } if (cell.disabled || props2.disabled) classes.push("disabled"); if (cell.selected) classes.push("selected"); if (cell.customClass) classes.push(cell.customClass); return classes.join(" "); }; const getRowKls = (cell) => [ns.e("row"), { current: isWeekActive(cell) }]; return { tableKls, tableLabel, weekHeaderClass: ns.e("week-header"), getCellClasses, getRowKls, t }; }; const basicCellProps = buildProps({ cell: { type: definePropType(Object) } }); var basic_cell_render_default = /* @__PURE__ */ defineComponent({ name: "ElDatePickerCell", props: basicCellProps, setup(props2) { const ns = useNamespace("date-table-cell"); const { slots } = inject(ROOT_PICKER_INJECTION_KEY); return () => { const { cell } = props2; return renderSlot(slots, "default", { ...cell }, () => [createVNode("div", { "class": ns.b() }, [createVNode("span", { "class": ns.e("text") }, [(cell == null ? void 0 : cell.renderText) ?? (cell == null ? void 0 : cell.text)])])]); }; } }); const _hoisted_1$O = ["aria-label"]; const _hoisted_2$w = ["aria-label"]; const _hoisted_3$f = [ "aria-current", "aria-selected", "tabindex", "aria-disabled" ]; var basic_date_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "basic-date-table", props: basicDateTableProps, emits: basicDateTableEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const { WEEKS, rows, tbodyRef, currentCellRef, focus, isCurrent, isWeekActive, isSelectedCell, handlePickDate, handleMouseUp, handleMouseDown, handleMouseMove, handleFocus } = useBasicDateTable(props2, __emit); const { tableLabel, tableKls, getCellClasses, getRowKls, weekHeaderClass, t } = useBasicDateTableDOM(props2, { isCurrent, isWeekActive }); let isUnmounting = false; onBeforeUnmount(() => { isUnmounting = true; }); __expose({ focus }); return (_ctx, _cache) => { return openBlock(), createElementBlock("table", { "aria-label": unref(tableLabel), class: normalizeClass(unref(tableKls)), cellspacing: "0", cellpadding: "0", role: "grid", onClick: _cache[1] || (_cache[1] = (...args) => unref(handlePickDate) && unref(handlePickDate)(...args)), onMousemove: _cache[2] || (_cache[2] = (...args) => unref(handleMouseMove) && unref(handleMouseMove)(...args)), onMousedown: _cache[3] || (_cache[3] = (...args) => unref(handleMouseDown) && unref(handleMouseDown)(...args)), onMouseup: _cache[4] || (_cache[4] = (...args) => unref(handleMouseUp) && unref(handleMouseUp)(...args)) }, [createBaseVNode("tbody", { ref_key: "tbodyRef", ref: tbodyRef }, [createBaseVNode("tr", null, [_ctx.showWeekNumber ? (openBlock(), createElementBlock("th", { key: 0, scope: "col", class: normalizeClass(unref(weekHeaderClass)) }, null, 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(WEEKS), (week, key) => { return openBlock(), createElementBlock("th", { key, "aria-label": unref(t)("el.datepicker.weeksFull." + week), scope: "col" }, toDisplayString(unref(t)("el.datepicker.weeks." + week)), 9, _hoisted_2$w); }), 128))]), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, rowKey2) => { return openBlock(), createElementBlock("tr", { key: rowKey2, class: normalizeClass(unref(getRowKls)(_ctx.showWeekNumber ? row[2] : row[1])) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, columnKey) => { return openBlock(), createElementBlock("td", { key: `${rowKey2}.${columnKey}`, ref_for: true, ref: (el) => !unref(isUnmounting) && unref(isSelectedCell)(cell) && (currentCellRef.value = el), class: normalizeClass(unref(getCellClasses)(cell)), "aria-current": cell.isCurrent ? "date" : void 0, "aria-selected": cell.isCurrent, tabindex: _ctx.disabled ? void 0 : unref(isSelectedCell)(cell) ? 0 : -1, "aria-disabled": _ctx.disabled, onFocus: _cache[0] || (_cache[0] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)) }, [createVNode(unref(basic_cell_render_default), { cell }, null, 8, ["cell"])], 42, _hoisted_3$f); }), 128))], 2); }), 128))], 512)], 42, _hoisted_1$O); }; } }); var basic_date_table_default = basic_date_table_vue_vue_type_script_setup_true_lang_default; const basicMonthTableProps = buildProps({ ...datePickerSharedProps, selectionMode: selectionModeWithDefault("month") }); const _hoisted_1$N = ["aria-label"]; const _hoisted_2$v = [ "aria-selected", "aria-label", "tabindex", "onKeydown" ]; var basic_month_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "basic-month-table", props: basicMonthTableProps, emits: [ "changerange", "pick", "select" ], setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("month-table"); const { t, lang } = useLocale(); const tbodyRef = ref(); const currentCellRef = ref(); const months = ref(props2.date.locale("en").localeData().monthsShort().map((_) => _.toLowerCase())); const tableRows = ref([ [], [], [] ]); const lastRow = ref(); const lastColumn = ref(); const rows = computed(() => { var _a, _b, _c; const rows2 = tableRows.value; const now = dayjs().locale(lang.value).startOf("month"); for (let i = 0; i < 3; i++) { const row = rows2[i]; for (let j = 0; j < 4; j++) { const cell = row[j] || (row[j] = { row: i, column: j, type: "normal", inRange: false, start: false, end: false, text: -1, disabled: false, isSelected: false, customClass: void 0, date: void 0, dayjs: void 0, isCurrent: void 0, selected: void 0, renderText: void 0, timestamp: void 0 }); cell.type = "normal"; const index = i * 4 + j; const calTime = props2.date.startOf("year").month(index); const calEndDate = props2.rangeState.endDate || props2.maxDate || props2.rangeState.selecting && props2.minDate || null; cell.inRange = !!(props2.minDate && calTime.isSameOrAfter(props2.minDate, "month") && calEndDate && calTime.isSameOrBefore(calEndDate, "month")) || !!(props2.minDate && calTime.isSameOrBefore(props2.minDate, "month") && calEndDate && calTime.isSameOrAfter(calEndDate, "month")); if ((_a = props2.minDate) == null ? void 0 : _a.isSameOrAfter(calEndDate)) { cell.start = !!(calEndDate && calTime.isSame(calEndDate, "month")); cell.end = props2.minDate && calTime.isSame(props2.minDate, "month"); } else { cell.start = !!(props2.minDate && calTime.isSame(props2.minDate, "month")); cell.end = !!(calEndDate && calTime.isSame(calEndDate, "month")); } if (now.isSame(calTime)) cell.type = "today"; const cellDate = calTime.toDate(); cell.text = index; cell.disabled = ((_b = props2.disabledDate) == null ? void 0 : _b.call(props2, cellDate)) || false; cell.date = cellDate; cell.customClass = (_c = props2.cellClassName) == null ? void 0 : _c.call(props2, cellDate); cell.dayjs = calTime; cell.timestamp = calTime.valueOf(); cell.isSelected = isSelectedCell(cell); } } return rows2; }); const focus = () => { var _a; (_a = currentCellRef.value) == null ? void 0 : _a.focus(); }; const getCellStyle = (cell) => { const style = {}; const year = props2.date.year(); const today = /* @__PURE__ */ new Date(); const month = cell.text; style.disabled = props2.disabled || (props2.disabledDate ? datesInMonth(props2.date, year, month, lang.value).every(props2.disabledDate) : false); style.current = castArray(props2.parsedValue).some((date) => dayjs.isDayjs(date) && date.year() === year && date.month() === month); style.today = today.getFullYear() === year && today.getMonth() === month; if (cell.customClass) style[cell.customClass] = true; if (cell.inRange) { style["in-range"] = true; if (cell.start) style["start-date"] = true; if (cell.end) style["end-date"] = true; } return style; }; const isSelectedCell = (cell) => { const year = props2.date.year(); const month = cell.text; return castArray(props2.date).some((date) => date.year() === year && date.month() === month); }; const handleMouseMove = (event) => { var _a; if (!props2.rangeState.selecting) return; let target = event.target; if (target.tagName === "SPAN") target = (_a = target.parentNode) == null ? void 0 : _a.parentNode; if (target.tagName === "DIV") target = target.parentNode; if (target.tagName !== "TD") return; const row = target.parentNode.rowIndex; const column = target.cellIndex; if (rows.value[row][column].disabled) return; if (row !== lastRow.value || column !== lastColumn.value) { lastRow.value = row; lastColumn.value = column; emit("changerange", { selecting: true, endDate: props2.date.startOf("year").month(row * 4 + column) }); } }; const handleMonthTableClick = (event) => { var _a; if (props2.disabled) return; const target = (_a = event.target) == null ? void 0 : _a.closest("td"); if ((target == null ? void 0 : target.tagName) !== "TD") return; if (hasClass(target, "disabled")) return; const column = target.cellIndex; const month = target.parentNode.rowIndex * 4 + column; const newDate = props2.date.startOf("year").month(month); if (props2.selectionMode === "months") { if (event.type === "keydown") { emit("pick", castArray(props2.parsedValue), false); return; } const newMonth = getValidDateOfMonth(props2.date, props2.date.year(), month, lang.value, props2.disabledDate); emit("pick", hasClass(target, "current") ? castArray(props2.parsedValue).filter((d) => (d == null ? void 0 : d.year()) !== newMonth.year() || (d == null ? void 0 : d.month()) !== newMonth.month()) : castArray(props2.parsedValue).concat([dayjs(newMonth)])); } else if (props2.selectionMode === "range") if (!props2.rangeState.selecting) { emit("pick", { minDate: newDate, maxDate: null }); emit("select", true); } else { if (props2.minDate && newDate >= props2.minDate) emit("pick", { minDate: props2.minDate, maxDate: newDate }); else emit("pick", { minDate: newDate, maxDate: props2.minDate }); emit("select", false); } else emit("pick", month); }; watch(() => props2.date, async () => { var _a, _b; if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) { await nextTick(); (_b = currentCellRef.value) == null ? void 0 : _b.focus(); } }); __expose({ focus }); return (_ctx, _cache) => { return openBlock(), createElementBlock("table", { role: "grid", "aria-label": unref(t)("el.datepicker.monthTablePrompt"), class: normalizeClass(unref(ns).b()), onClick: handleMonthTableClick, onMousemove: handleMouseMove }, [createBaseVNode("tbody", { ref_key: "tbodyRef", ref: tbodyRef }, [(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, key) => { return openBlock(), createElementBlock("tr", { key }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key_) => { return openBlock(), createElementBlock("td", { key: key_, ref_for: true, ref: (el) => cell.isSelected && (currentCellRef.value = el), class: normalizeClass(getCellStyle(cell)), "aria-selected": !!cell.isSelected, "aria-label": unref(t)(`el.datepicker.month${+cell.text + 1}`), tabindex: cell.isSelected ? 0 : -1, onKeydown: [withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["space"]), withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["enter"])] }, [createVNode(unref(basic_cell_render_default), { cell: { ...cell, renderText: unref(t)("el.datepicker.months." + months.value[cell.text]) } }, null, 8, ["cell"])], 42, _hoisted_2$v); }), 128))]); }), 128))], 512)], 42, _hoisted_1$N); }; } }); var basic_month_table_default = basic_month_table_vue_vue_type_script_setup_true_lang_default; const basicYearTableProps = buildProps({ ...datePickerSharedProps, selectionMode: selectionModeWithDefault("year") }); const _hoisted_1$M = ["aria-label"]; const _hoisted_2$u = [ "aria-selected", "aria-label", "tabindex", "onKeydown" ]; var basic_year_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "basic-year-table", props: basicYearTableProps, emits: [ "changerange", "pick", "select" ], setup(__props, { expose: __expose, emit: __emit }) { const datesInYear = (year, lang2) => { const firstDay = dayjs(String(year)).locale(lang2).startOf("year"); return rangeArr(firstDay.endOf("year").dayOfYear()).map((n) => firstDay.add(n, "day").toDate()); }; const props2 = __props; const emit = __emit; const ns = useNamespace("year-table"); const { t, lang } = useLocale(); const tbodyRef = ref(); const currentCellRef = ref(); const startYear = computed(() => { return Math.floor(props2.date.year() / 10) * 10; }); const tableRows = ref([ [], [], [] ]); const lastRow = ref(); const lastColumn = ref(); const rows = computed(() => { var _a, _b, _c; const rows2 = tableRows.value; const now = dayjs().locale(lang.value).startOf("year"); for (let i = 0; i < 3; i++) { const row = rows2[i]; for (let j = 0; j < 4; j++) { if (i * 4 + j >= 10) break; let cell = row[j]; if (!cell) cell = { row: i, column: j, type: "normal", inRange: false, start: false, end: false, text: -1, disabled: false, isSelected: false, customClass: void 0, date: void 0, dayjs: void 0, isCurrent: void 0, selected: void 0, renderText: void 0, timestamp: void 0 }; cell.type = "normal"; const index = i * 4 + j + startYear.value; const calTime = dayjs().year(index); const calEndDate = props2.rangeState.endDate || props2.maxDate || props2.rangeState.selecting && props2.minDate || null; cell.inRange = !!(props2.minDate && calTime.isSameOrAfter(props2.minDate, "year") && calEndDate && calTime.isSameOrBefore(calEndDate, "year")) || !!(props2.minDate && calTime.isSameOrBefore(props2.minDate, "year") && calEndDate && calTime.isSameOrAfter(calEndDate, "year")); if ((_a = props2.minDate) == null ? void 0 : _a.isSameOrAfter(calEndDate)) { cell.start = !!(calEndDate && calTime.isSame(calEndDate, "year")); cell.end = !!(props2.minDate && calTime.isSame(props2.minDate, "year")); } else { cell.start = !!(props2.minDate && calTime.isSame(props2.minDate, "year")); cell.end = !!(calEndDate && calTime.isSame(calEndDate, "year")); } if (now.isSame(calTime)) cell.type = "today"; cell.text = index; const cellDate = calTime.toDate(); cell.disabled = ((_b = props2.disabledDate) == null ? void 0 : _b.call(props2, cellDate)) || false; cell.date = cellDate; cell.customClass = (_c = props2.cellClassName) == null ? void 0 : _c.call(props2, cellDate); cell.dayjs = calTime; cell.timestamp = calTime.valueOf(); cell.isSelected = isSelectedCell(cell); row[j] = cell; } } return rows2; }); const focus = () => { var _a; (_a = currentCellRef.value) == null ? void 0 : _a.focus(); }; const getCellKls = (cell) => { const kls = {}; const today = dayjs().locale(lang.value); const year = cell.text; kls.disabled = props2.disabled || (props2.disabledDate ? datesInYear(year, lang.value).every(props2.disabledDate) : false); kls.today = today.year() === year; kls.current = castArray(props2.parsedValue).some((d) => d.year() === year); if (cell.customClass) kls[cell.customClass] = true; if (cell.inRange) { kls["in-range"] = true; if (cell.start) kls["start-date"] = true; if (cell.end) kls["end-date"] = true; } return kls; }; const isSelectedCell = (cell) => { const year = cell.text; return castArray(props2.date).some((date) => date.year() === year); }; const handleYearTableClick = (event) => { var _a; if (props2.disabled) return; const target = (_a = event.target) == null ? void 0 : _a.closest("td"); if (!target || !target.textContent || hasClass(target, "disabled")) return; const column = target.cellIndex; const selectedYear = target.parentNode.rowIndex * 4 + column + startYear.value; const newDate = dayjs().year(selectedYear); if (props2.selectionMode === "range") if (!props2.rangeState.selecting) { emit("pick", { minDate: newDate, maxDate: null }); emit("select", true); } else { if (props2.minDate && newDate >= props2.minDate) emit("pick", { minDate: props2.minDate, maxDate: newDate }); else emit("pick", { minDate: newDate, maxDate: props2.minDate }); emit("select", false); } else if (props2.selectionMode === "years") { if (event.type === "keydown") { emit("pick", castArray(props2.parsedValue), false); return; } const vaildYear = getValidDateOfYear(newDate.startOf("year"), lang.value, props2.disabledDate); emit("pick", hasClass(target, "current") ? castArray(props2.parsedValue).filter((d) => (d == null ? void 0 : d.year()) !== selectedYear) : castArray(props2.parsedValue).concat([vaildYear])); } else emit("pick", selectedYear); }; const handleMouseMove = (event) => { var _a; if (!props2.rangeState.selecting) return; const target = (_a = event.target) == null ? void 0 : _a.closest("td"); if (!target) return; const row = target.parentNode.rowIndex; const column = target.cellIndex; if (rows.value[row][column].disabled) return; if (row !== lastRow.value || column !== lastColumn.value) { lastRow.value = row; lastColumn.value = column; emit("changerange", { selecting: true, endDate: dayjs().year(startYear.value).add(row * 4 + column, "year") }); } }; watch(() => props2.date, async () => { var _a, _b; if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) { await nextTick(); (_b = currentCellRef.value) == null ? void 0 : _b.focus(); } }); __expose({ focus }); return (_ctx, _cache) => { return openBlock(), createElementBlock("table", { role: "grid", "aria-label": unref(t)("el.datepicker.yearTablePrompt"), class: normalizeClass(unref(ns).b()), onClick: handleYearTableClick, onMousemove: handleMouseMove }, [createBaseVNode("tbody", { ref_key: "tbodyRef", ref: tbodyRef }, [(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, rowKey2) => { return openBlock(), createElementBlock("tr", { key: rowKey2 }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, cellKey) => { return openBlock(), createElementBlock("td", { key: `${rowKey2}_${cellKey}`, ref_for: true, ref: (el) => cell.isSelected && (currentCellRef.value = el), class: normalizeClass(["available", getCellKls(cell)]), "aria-selected": cell.isSelected, "aria-label": String(cell.text), tabindex: cell.isSelected ? 0 : -1, onKeydown: [withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["space"]), withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["enter"])] }, [createVNode(unref(basic_cell_render_default), { cell }, null, 8, ["cell"])], 42, _hoisted_2$u); }), 128))]); }), 128))], 512)], 42, _hoisted_1$M); }; } }); var basic_year_table_default = basic_year_table_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$L = ["disabled", "onClick"]; const _hoisted_2$t = ["aria-label", "disabled"]; const _hoisted_3$e = ["aria-label", "disabled"]; const _hoisted_4$b = ["tabindex", "aria-disabled"]; const _hoisted_5$8 = ["tabindex", "aria-disabled"]; const _hoisted_6$3 = ["aria-label", "disabled"]; const _hoisted_7$2 = ["aria-label", "disabled"]; var panel_date_pick_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "panel-date-pick", props: panelDatePickProps, emits: [ "pick", "set-picker-option", "panel-change" ], setup(__props, { emit: __emit }) { const timeWithinRange = (_, __, ___) => true; const props2 = __props; const contextEmit = __emit; const ppNs = useNamespace("picker-panel"); const dpNs = useNamespace("date-picker"); const attrs = useAttrs$1(); const slots = useSlots(); const { t, lang } = useLocale(); const pickerBase = inject(PICKER_BASE_INJECTION_KEY); const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0); const { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props; const defaultValue = toRef(pickerBase.props, "defaultValue"); const currentViewRef = ref(); const innerDate = ref(dayjs().locale(lang.value)); const isChangeToNow = ref(false); let isShortcut = false; const defaultTimeD = computed(() => { return dayjs(defaultTime).locale(lang.value); }); const month = computed(() => { return innerDate.value.month(); }); const year = computed(() => { return innerDate.value.year(); }); const selectableRange = ref([]); const userInputDate = ref(null); const userInputTime = ref(null); const checkDateWithinRange = (date) => { return selectableRange.value.length > 0 ? timeWithinRange(date, selectableRange.value, props2.format || DEFAULT_FORMATS_TIME) : true; }; const formatEmit = (emitDayjs) => { if (defaultTime && !visibleTime.value && !isChangeToNow.value && !isShortcut) return defaultTimeD.value.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date()); if (showTime.value) return emitDayjs.millisecond(0); return emitDayjs.startOf("day"); }; const emit = (value, ...args) => { if (!value) contextEmit("pick", value, ...args); else if (isArray(value)) contextEmit("pick", value.map(formatEmit), ...args); else contextEmit("pick", formatEmit(value), ...args); userInputDate.value = null; userInputTime.value = null; isChangeToNow.value = false; isShortcut = false; }; const handleDatePick = async (value, keepOpen) => { if (selectionMode.value === "date" && dayjs.isDayjs(value)) { const parsedDateValue = extractFirst(props2.parsedValue); let newDate = parsedDateValue ? parsedDateValue.year(value.year()).month(value.month()).date(value.date()) : value; if (!checkDateWithinRange(newDate)) ; innerDate.value = newDate; emit(newDate, showTime.value || keepOpen); } else if (selectionMode.value === "week") emit(value.date); else if (selectionMode.value === "dates") emit(value, true); }; const moveByMonth = (forward) => { const action = forward ? "add" : "subtract"; innerDate.value = innerDate.value[action](1, "month"); handlePanelChange("month"); }; const moveByYear = (forward) => { const currentDate = innerDate.value; const action = forward ? "add" : "subtract"; innerDate.value = currentView.value === "year" ? currentDate[action](10, "year") : currentDate[action](1, "year"); handlePanelChange("year"); }; const currentView = ref("date"); const yearLabel = computed(() => { const yearTranslation = t("el.datepicker.year"); if (currentView.value === "year") { const startYear = Math.floor(year.value / 10) * 10; if (yearTranslation) return `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}`; return `${startYear} - ${startYear + 9}`; } return `${year.value} ${yearTranslation}`; }); const handleShortcutClick = (shortcut) => { const shortcutValue = isFunction(shortcut.value) ? shortcut.value() : shortcut.value; if (shortcutValue) { isShortcut = true; emit(dayjs(shortcutValue).locale(lang.value)); return; } if (shortcut.onClick) shortcut.onClick({ attrs, slots, emit: contextEmit }); }; const selectionMode = computed(() => { const { type } = props2; if ([ "week", "month", "months", "year", "years", "dates" ].includes(type)) return type; return "date"; }); const isMultipleType = computed(() => { return selectionMode.value === "dates" || selectionMode.value === "months" || selectionMode.value === "years"; }); const keyboardMode = computed(() => { return selectionMode.value === "date" ? currentView.value : selectionMode.value; }); const hasShortcuts = computed(() => !!shortcuts.length); const handleMonthPick = async (month2, keepOpen) => { if (selectionMode.value === "month") { innerDate.value = getValidDateOfMonth(innerDate.value, innerDate.value.year(), month2, lang.value, disabledDate); emit(innerDate.value, false); } else if (selectionMode.value === "months") emit(month2, keepOpen ?? true); else { innerDate.value = getValidDateOfMonth(innerDate.value, innerDate.value.year(), month2, lang.value, disabledDate); currentView.value = "date"; if ([ "month", "year", "date", "week" ].includes(selectionMode.value)) { emit(innerDate.value, true); await nextTick(); handleFocusPicker(); } } handlePanelChange("month"); }; const handleYearPick = async (year2, keepOpen) => { if (selectionMode.value === "year") { innerDate.value = getValidDateOfYear(innerDate.value.startOf("year").year(year2), lang.value, disabledDate); emit(innerDate.value, false); } else if (selectionMode.value === "years") emit(year2, keepOpen ?? true); else { innerDate.value = getValidDateOfYear(innerDate.value.year(year2), lang.value, disabledDate); currentView.value = "month"; if ([ "month", "year", "date", "week" ].includes(selectionMode.value)) { emit(innerDate.value, true); await nextTick(); handleFocusPicker(); } } handlePanelChange("year"); }; const dateDisabled = useFormDisabled(); const showPicker = async (view) => { if (dateDisabled.value) return; currentView.value = view; await nextTick(); handleFocusPicker(); }; const showTime = computed(() => props2.type === "datetime" || props2.type === "datetimerange"); const footerVisible = computed(() => { const showDateFooter = showTime.value || selectionMode.value === "dates"; const showYearFooter = selectionMode.value === "years"; const showMonthFooter = selectionMode.value === "months"; const isDateView = currentView.value === "date"; const isYearView = currentView.value === "year"; const isMonthView = currentView.value === "month"; return showDateFooter && isDateView || showYearFooter && isYearView || showMonthFooter && isMonthView; }); const footerFilled = computed(() => !isMultipleType.value && props2.showNow || props2.showConfirm); const disabledConfirm = computed(() => { if (!disabledDate) return false; if (!props2.parsedValue) return true; if (isArray(props2.parsedValue)) return disabledDate(props2.parsedValue[0].toDate()); return disabledDate(props2.parsedValue.toDate()); }); const onConfirm = () => { if (isMultipleType.value) emit(props2.parsedValue); else { let result = extractFirst(props2.parsedValue); if (!result) { const defaultTimeD2 = dayjs(defaultTime).locale(lang.value); const defaultValueD = getDefaultValue2(); result = defaultTimeD2.year(defaultValueD.year()).month(defaultValueD.month()).date(defaultValueD.date()); } innerDate.value = result; emit(result); } }; const disabledNow = computed(() => { if (!disabledDate) return false; return disabledDate(dayjs().locale(lang.value).toDate()); }); const changeToNow = () => { const nowDate = dayjs().locale(lang.value).toDate(); isChangeToNow.value = true; if ((!disabledDate || !disabledDate(nowDate)) && checkDateWithinRange(nowDate)) { innerDate.value = dayjs().locale(lang.value); emit(innerDate.value); } }; const timeFormat = computed(() => { return props2.timeFormat || extractTimeFormat(props2.format) || DEFAULT_FORMATS_TIME; }); const dateFormat = computed(() => { return props2.dateFormat || extractDateFormat(props2.format) || DEFAULT_FORMATS_DATE; }); const visibleTime = computed(() => { if (userInputTime.value) return userInputTime.value; if (!props2.parsedValue && !defaultValue.value) return; return (extractFirst(props2.parsedValue) || innerDate.value).format(timeFormat.value); }); const visibleDate = computed(() => { if (userInputDate.value) return userInputDate.value; if (!props2.parsedValue && !defaultValue.value) return; return (extractFirst(props2.parsedValue) || innerDate.value).format(dateFormat.value); }); const timePickerVisible = ref(false); const onTimePickerInputFocus = () => { timePickerVisible.value = true; }; const handleTimePickClose = () => { timePickerVisible.value = false; }; const getUnits = (date) => { return { hour: date.hour(), minute: date.minute(), second: date.second(), year: date.year(), month: date.month(), date: date.date() }; }; const handleTimePick = (value, visible, first) => { const { hour, minute, second } = getUnits(value); const parsedDateValue = extractFirst(props2.parsedValue); innerDate.value = parsedDateValue ? parsedDateValue.hour(hour).minute(minute).second(second) : value; emit(innerDate.value, true); if (!first) timePickerVisible.value = visible; }; const handleVisibleTimeChange = (value) => { const newDate = dayjs(value, timeFormat.value).locale(lang.value); if (newDate.isValid() && checkDateWithinRange(newDate)) { const { year: year2, month: month2, date } = getUnits(innerDate.value); innerDate.value = newDate.year(year2).month(month2).date(date); userInputTime.value = null; timePickerVisible.value = false; emit(innerDate.value, true); } }; const handleVisibleDateChange = (value) => { const newDate = correctlyParseUserInput(value, dateFormat.value, lang.value, isDefaultFormat); if (newDate.isValid()) { if (disabledDate && disabledDate(newDate.toDate())) return; const { hour, minute, second } = getUnits(innerDate.value); innerDate.value = newDate.hour(hour).minute(minute).second(second); userInputDate.value = null; emit(innerDate.value, true); } }; const isValidValue2 = (date) => { return dayjs.isDayjs(date) && date.isValid() && (disabledDate ? !disabledDate(date.toDate()) : true); }; const parseUserInput = (value) => { return correctlyParseUserInput(value, props2.format, lang.value, isDefaultFormat); }; const getDefaultValue2 = () => { const parseDate2 = dayjs(defaultValue.value).locale(lang.value); if (!defaultValue.value) { const defaultTimeDValue = defaultTimeD.value; return dayjs().hour(defaultTimeDValue.hour()).minute(defaultTimeDValue.minute()).second(defaultTimeDValue.second()).locale(lang.value); } return parseDate2; }; const handleFocusPicker = () => { var _a; if ([ "week", "month", "year", "date" ].includes(selectionMode.value)) (_a = currentViewRef.value) == null ? void 0 : _a.focus(); }; const _handleFocusPicker = () => { handleFocusPicker(); if (selectionMode.value === "week") handleKeyControl(EVENT_CODE.down); }; const handleKeydownTable = (event) => { const code = getEventCode(event); if ([ EVENT_CODE.up, EVENT_CODE.down, EVENT_CODE.left, EVENT_CODE.right, EVENT_CODE.home, EVENT_CODE.end, EVENT_CODE.pageUp, EVENT_CODE.pageDown ].includes(code)) { handleKeyControl(code); event.stopPropagation(); event.preventDefault(); } if ([ EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter ].includes(code) && userInputDate.value === null && userInputTime.value === null) { event.preventDefault(); emit(innerDate.value, false); } }; const handleKeyControl = (code) => { const { up, down, left, right, home, end, pageUp, pageDown } = EVENT_CODE; const mapping = { year: { [up]: -4, [down]: 4, [left]: -1, [right]: 1, offset: (date, step2) => date.setFullYear(date.getFullYear() + step2) }, month: { [up]: -4, [down]: 4, [left]: -1, [right]: 1, offset: (date, step2) => date.setMonth(date.getMonth() + step2) }, week: { [up]: -1, [down]: 1, [left]: -1, [right]: 1, offset: (date, step2) => date.setDate(date.getDate() + step2 * 7) }, date: { [up]: -7, [down]: 7, [left]: -1, [right]: 1, [home]: (date) => -date.getDay(), [end]: (date) => -date.getDay() + 6, [pageUp]: (date) => -new Date(date.getFullYear(), date.getMonth(), 0).getDate(), [pageDown]: (date) => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(), offset: (date, step2) => date.setDate(date.getDate() + step2) } }; const newDate = innerDate.value.toDate(); while (Math.abs(innerDate.value.diff(newDate, "year", true)) < 1) { const map = mapping[keyboardMode.value]; if (!map) return; map.offset(newDate, isFunction(map[code]) ? map[code](newDate) : map[code] ?? 0); if (disabledDate && disabledDate(newDate)) break; const result = dayjs(newDate).locale(lang.value); innerDate.value = result; contextEmit("pick", result, true); break; } }; const handlePanelChange = (mode) => { contextEmit("panel-change", innerDate.value.toDate(), mode, currentView.value); }; watch(() => selectionMode.value, (val) => { if (["month", "year"].includes(val)) { currentView.value = val; return; } else if (val === "years") { currentView.value = "year"; return; } else if (val === "months") { currentView.value = "month"; return; } currentView.value = "date"; }, { immediate: true }); watch(() => defaultValue.value, (val) => { if (val) innerDate.value = getDefaultValue2(); }, { immediate: true }); watch(() => props2.parsedValue, (val) => { if (val) { if (isMultipleType.value) return; if (isArray(val)) return; innerDate.value = val; } else innerDate.value = getDefaultValue2(); }, { immediate: true }); contextEmit("set-picker-option", ["isValidValue", isValidValue2]); contextEmit("set-picker-option", ["parseUserInput", parseUserInput]); contextEmit("set-picker-option", ["handleFocusPicker", _handleFocusPicker]); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([ unref(ppNs).b(), unref(dpNs).b(), unref(ppNs).is("border", _ctx.border), unref(ppNs).is("disabled", unref(dateDisabled)), { "has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value, "has-time": showTime.value } ]) }, [createBaseVNode("div", { class: normalizeClass(unref(ppNs).e("body-wrapper")) }, [ renderSlot(_ctx.$slots, "sidebar", { class: normalizeClass(unref(ppNs).e("sidebar")) }), hasShortcuts.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ppNs).e("sidebar")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => { return openBlock(), createElementBlock("button", { key, type: "button", disabled: unref(dateDisabled), class: normalizeClass(unref(ppNs).e("shortcut")), onClick: ($event) => handleShortcutClick(shortcut) }, toDisplayString(shortcut.text), 11, _hoisted_1$L); }), 128))], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ppNs).e("body")) }, [ showTime.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(dpNs).e("time-header")) }, [createBaseVNode("span", { class: normalizeClass(unref(dpNs).e("editor-wrap")) }, [createVNode(unref(ElInput), { placeholder: unref(t)("el.datepicker.selectDate"), "model-value": visibleDate.value, size: "small", "validate-event": false, disabled: unref(dateDisabled), readonly: !_ctx.editable, onInput: _cache[0] || (_cache[0] = (val) => userInputDate.value = val), onChange: handleVisibleDateChange }, null, 8, [ "placeholder", "model-value", "disabled", "readonly" ])], 2), withDirectives((openBlock(), createElementBlock("span", { class: normalizeClass(unref(dpNs).e("editor-wrap")) }, [createVNode(unref(ElInput), { placeholder: unref(t)("el.datepicker.selectTime"), "model-value": visibleTime.value, size: "small", "validate-event": false, disabled: unref(dateDisabled), readonly: !_ctx.editable, onFocus: onTimePickerInputFocus, onInput: _cache[1] || (_cache[1] = (val) => userInputTime.value = val), onChange: handleVisibleTimeChange }, null, 8, [ "placeholder", "model-value", "disabled", "readonly" ]), createVNode(unref(panel_time_pick_default), { visible: timePickerVisible.value, format: timeFormat.value, "parsed-value": innerDate.value, onPick: handleTimePick }, null, 8, [ "visible", "format", "parsed-value" ])], 2)), [[unref(ClickOutside), handleTimePickClose]])], 2)) : createCommentVNode("v-if", true), withDirectives(createBaseVNode("div", { class: normalizeClass([unref(dpNs).e("header"), (currentView.value === "year" || currentView.value === "month") && unref(dpNs).em("header", "bordered")]) }, [ createBaseVNode("span", { class: normalizeClass(unref(dpNs).e("prev-btn")) }, [createBaseVNode("button", { type: "button", "aria-label": unref(t)(`el.datepicker.prevYear`), class: normalizeClass(["d-arrow-left", unref(ppNs).e("icon-btn")]), disabled: unref(dateDisabled), onClick: _cache[2] || (_cache[2] = ($event) => moveByYear(false)) }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_left_default))]), _: 1 })])], 10, _hoisted_2$t), withDirectives(createBaseVNode("button", { type: "button", "aria-label": unref(t)(`el.datepicker.prevMonth`), class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]), disabled: unref(dateDisabled), onClick: _cache[3] || (_cache[3] = ($event) => moveByMonth(false)) }, [renderSlot(_ctx.$slots, "prev-month", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_left_default))]), _: 1 })])], 10, _hoisted_3$e), [[vShow, currentView.value === "date"]])], 2), createBaseVNode("span", { role: "button", class: normalizeClass(unref(dpNs).e("header-label")), "aria-live": "polite", tabindex: _ctx.disabled ? void 0 : 0, "aria-disabled": _ctx.disabled, onKeydown: _cache[4] || (_cache[4] = withKeys(($event) => showPicker("year"), ["enter"])), onClick: _cache[5] || (_cache[5] = ($event) => showPicker("year")) }, toDisplayString(yearLabel.value), 43, _hoisted_4$b), withDirectives(createBaseVNode("span", { role: "button", "aria-live": "polite", tabindex: _ctx.disabled ? void 0 : 0, "aria-disabled": _ctx.disabled, class: normalizeClass([unref(dpNs).e("header-label"), { active: currentView.value === "month" }]), onKeydown: _cache[6] || (_cache[6] = withKeys(($event) => showPicker("month"), ["enter"])), onClick: _cache[7] || (_cache[7] = ($event) => showPicker("month")) }, toDisplayString(unref(t)(`el.datepicker.month${month.value + 1}`)), 43, _hoisted_5$8), [[vShow, currentView.value === "date"]]), createBaseVNode("span", { class: normalizeClass(unref(dpNs).e("next-btn")) }, [withDirectives(createBaseVNode("button", { type: "button", "aria-label": unref(t)(`el.datepicker.nextMonth`), class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]), disabled: unref(dateDisabled), onClick: _cache[8] || (_cache[8] = ($event) => moveByMonth(true)) }, [renderSlot(_ctx.$slots, "next-month", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_right_default))]), _: 1 })])], 10, _hoisted_6$3), [[vShow, currentView.value === "date"]]), createBaseVNode("button", { type: "button", "aria-label": unref(t)(`el.datepicker.nextYear`), class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]), disabled: unref(dateDisabled), onClick: _cache[9] || (_cache[9] = ($event) => moveByYear(true)) }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_right_default))]), _: 1 })])], 10, _hoisted_7$2)], 2) ], 2), [[vShow, currentView.value !== "time"]]), createBaseVNode("div", { class: normalizeClass(unref(ppNs).e("content")), onKeydown: handleKeydownTable }, [ currentView.value === "date" ? (openBlock(), createBlock(basic_date_table_default, { key: 0, ref_key: "currentViewRef", ref: currentViewRef, "selection-mode": selectionMode.value, date: innerDate.value, "parsed-value": _ctx.parsedValue, "disabled-date": unref(disabledDate), disabled: unref(dateDisabled), "cell-class-name": unref(cellClassName), "show-week-number": _ctx.showWeekNumber, onPick: handleDatePick }, null, 8, [ "selection-mode", "date", "parsed-value", "disabled-date", "disabled", "cell-class-name", "show-week-number" ])) : createCommentVNode("v-if", true), currentView.value === "year" ? (openBlock(), createBlock(basic_year_table_default, { key: 1, ref_key: "currentViewRef", ref: currentViewRef, "selection-mode": selectionMode.value, date: innerDate.value, "disabled-date": unref(disabledDate), disabled: unref(dateDisabled), "parsed-value": _ctx.parsedValue, "cell-class-name": unref(cellClassName), onPick: handleYearPick }, null, 8, [ "selection-mode", "date", "disabled-date", "disabled", "parsed-value", "cell-class-name" ])) : createCommentVNode("v-if", true), currentView.value === "month" ? (openBlock(), createBlock(basic_month_table_default, { key: 2, ref_key: "currentViewRef", ref: currentViewRef, "selection-mode": selectionMode.value, date: innerDate.value, "parsed-value": _ctx.parsedValue, "disabled-date": unref(disabledDate), disabled: unref(dateDisabled), "cell-class-name": unref(cellClassName), onPick: handleMonthPick }, null, 8, [ "selection-mode", "date", "parsed-value", "disabled-date", "disabled", "cell-class-name" ])) : createCommentVNode("v-if", true) ], 34) ], 2) ], 2), _ctx.showFooter && footerVisible.value && footerFilled.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ppNs).e("footer")) }, [withDirectives(createVNode(unref(ElButton), { text: "", size: "small", class: normalizeClass(unref(ppNs).e("link-btn")), disabled: disabledNow.value, onClick: changeToNow }, { default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.now")), 1)]), _: 1 }, 8, ["class", "disabled"]), [[vShow, !isMultipleType.value && _ctx.showNow]]), _ctx.showConfirm ? (openBlock(), createBlock(unref(ElButton), { key: 0, plain: "", size: "small", class: normalizeClass(unref(ppNs).e("link-btn")), disabled: disabledConfirm.value, onClick: onConfirm }, { default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.confirm")), 1)]), _: 1 }, 8, ["class", "disabled"])) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true)], 2); }; } }); var panel_date_pick_default = panel_date_pick_vue_vue_type_script_setup_true_lang_default; const panelDateRangeProps = buildProps({ ...panelSharedProps, ...panelRangeSharedProps }); const useShortcut = (lang) => { const { emit } = getCurrentInstance(); const attrs = useAttrs$1(); const slots = useSlots(); const handleShortcutClick = (shortcut) => { const shortcutValues = isFunction(shortcut.value) ? shortcut.value() : shortcut.value; if (shortcutValues) { emit("pick", [dayjs(shortcutValues[0]).locale(lang.value), dayjs(shortcutValues[1]).locale(lang.value)]); return; } if (shortcut.onClick) shortcut.onClick({ attrs, slots, emit }); }; return handleShortcutClick; }; const useRangePicker = (props2, { defaultValue, defaultTime, leftDate, rightDate, step: step2, unit: unit2, sortDates }) => { const { emit } = getCurrentInstance(); const { pickerNs } = inject(ROOT_PICKER_INJECTION_KEY); const drpNs = useNamespace("date-range-picker"); const { t, lang } = useLocale(); const handleShortcutClick = useShortcut(lang); const minDate = ref(); const maxDate = ref(); const rangeState = ref({ endDate: null, selecting: false }); const handleChangeRange = (val) => { rangeState.value = val; }; const handleRangeConfirm = (visible = false) => { const _minDate = unref(minDate); const _maxDate = unref(maxDate); if (isValidRange([_minDate, _maxDate])) emit("pick", [_minDate, _maxDate], visible); }; const onSelect = (selecting) => { rangeState.value.selecting = selecting; if (!selecting) rangeState.value.endDate = null; }; const parseValue = (parsedValue) => { if (isArray(parsedValue) && parsedValue.length === 2) { const [start, end] = parsedValue; minDate.value = start; leftDate.value = start; maxDate.value = end; sortDates(unref(minDate), unref(maxDate)); } else restoreDefault(); }; const restoreDefault = () => { let [start, end] = getDefaultValue(unref(defaultValue), { lang: unref(lang), step: step2, unit: unit2, unlinkPanels: props2.unlinkPanels }); const getShift = (day) => { return day.diff(day.startOf("d"), "ms"); }; const maybeTimes = unref(defaultTime); if (maybeTimes) { let leftShift = 0; let rightShift = 0; if (isArray(maybeTimes)) { const [timeStart, timeEnd] = maybeTimes.map(dayjs); leftShift = getShift(timeStart); rightShift = getShift(timeEnd); } else { const shift2 = getShift(dayjs(maybeTimes)); leftShift = shift2; rightShift = shift2; } start = start.startOf("d").add(leftShift, "ms"); end = end.startOf("d").add(rightShift, "ms"); } minDate.value = void 0; maxDate.value = void 0; leftDate.value = start; rightDate.value = end; }; watch(defaultValue, (val) => { if (val) restoreDefault(); }, { immediate: true }); watch(() => props2.parsedValue, (parsedValue) => { if (!(parsedValue == null ? void 0 : parsedValue.length) || !isEqual(parsedValue, [minDate.value, maxDate.value])) parseValue(parsedValue); }, { immediate: true }); watch(() => props2.visible, () => { if (props2.visible) parseValue(props2.parsedValue); }, { immediate: true }); return { minDate, maxDate, rangeState, lang, ppNs: pickerNs, drpNs, handleChangeRange, handleRangeConfirm, handleShortcutClick, onSelect, parseValue, t }; }; const usePanelDateRange = (props2, emit, leftDate, rightDate) => { const leftCurrentView = ref("date"); const leftCurrentViewRef = ref(); const rightCurrentView = ref("date"); const rightCurrentViewRef = ref(); const { disabledDate } = inject(PICKER_BASE_INJECTION_KEY).props; const { t, lang } = useLocale(); const leftYear = computed(() => { return leftDate.value.year(); }); const leftMonth = computed(() => { return leftDate.value.month(); }); const rightYear = computed(() => { return rightDate.value.year(); }); const rightMonth = computed(() => { return rightDate.value.month(); }); function computedYearLabel(currentView, yearValue) { const yearTranslation = t("el.datepicker.year"); if (currentView.value === "year") { const startYear = Math.floor(yearValue.value / 10) * 10; return yearTranslation ? `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}` : `${startYear} - ${startYear + 9}`; } return `${yearValue.value} ${yearTranslation}`; } function focusPicker(currentViewRef) { currentViewRef == null ? void 0 : currentViewRef.focus(); } async function showPicker(pickerType, view) { if (props2.disabled) return; const currentView = pickerType === "left" ? leftCurrentView : rightCurrentView; const currentViewRef = pickerType === "left" ? leftCurrentViewRef : rightCurrentViewRef; currentView.value = view; await nextTick(); focusPicker(currentViewRef.value); } async function handlePick(mode, pickerType, value) { if (props2.disabled) return; const isLeftPicker = pickerType === "left"; const startDate = isLeftPicker ? leftDate : rightDate; const endDate = isLeftPicker ? rightDate : leftDate; const currentView = isLeftPicker ? leftCurrentView : rightCurrentView; const currentViewRef = isLeftPicker ? leftCurrentViewRef : rightCurrentViewRef; if (mode === "year") startDate.value = getValidDateOfYear(startDate.value.year(value), lang.value, disabledDate); if (mode === "month") startDate.value = getValidDateOfMonth(startDate.value, startDate.value.year(), value, lang.value, disabledDate); if (!props2.unlinkPanels) endDate.value = pickerType === "left" ? startDate.value.add(1, "month") : startDate.value.subtract(1, "month"); currentView.value = mode === "year" ? "month" : "date"; await nextTick(); focusPicker(currentViewRef.value); handlePanelChange(mode); } function handlePanelChange(mode) { emit("panel-change", [leftDate.value.toDate(), rightDate.value.toDate()], mode); } function adjustDateByView(currentView, date, forward) { const action = forward ? "add" : "subtract"; return currentView === "year" ? date[action](10, "year") : date[action](1, "year"); } return { leftCurrentView, rightCurrentView, leftCurrentViewRef, rightCurrentViewRef, leftYear, rightYear, leftMonth, rightMonth, leftYearLabel: computed(() => computedYearLabel(leftCurrentView, leftYear)), rightYearLabel: computed(() => computedYearLabel(rightCurrentView, rightYear)), showLeftPicker: (view) => showPicker("left", view), showRightPicker: (view) => showPicker("right", view), handleLeftYearPick: (year) => handlePick("year", "left", year), handleRightYearPick: (year) => handlePick("year", "right", year), handleLeftMonthPick: (month) => handlePick("month", "left", month), handleRightMonthPick: (month) => handlePick("month", "right", month), handlePanelChange, adjustDateByView }; }; const _hoisted_1$K = ["disabled", "onClick"]; const _hoisted_2$s = ["aria-label", "disabled"]; const _hoisted_3$d = ["aria-label", "disabled"]; const _hoisted_4$a = ["disabled", "aria-label"]; const _hoisted_5$7 = ["disabled", "aria-label"]; const _hoisted_6$2 = ["tabindex", "aria-disabled"]; const _hoisted_7$1 = ["tabindex", "aria-disabled"]; const _hoisted_8$1 = ["disabled", "aria-label"]; const _hoisted_9$1 = ["disabled", "aria-label"]; const _hoisted_10$1 = ["aria-label", "disabled"]; const _hoisted_11$1 = ["disabled", "aria-label"]; const _hoisted_12$1 = ["tabindex", "aria-disabled"]; const _hoisted_13$1 = ["tabindex", "aria-disabled"]; const unit$2 = "month"; var panel_date_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ __name: "panel-date-range", props: panelDateRangeProps, emits: [ "pick", "set-picker-option", "calendar-change", "panel-change", "clear" ], setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const pickerBase = inject(PICKER_BASE_INJECTION_KEY); const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0); const { disabledDate, cellClassName, defaultTime, clearable } = pickerBase.props; const format = toRef(pickerBase.props, "format"); const shortcuts = toRef(pickerBase.props, "shortcuts"); const defaultValue = toRef(pickerBase.props, "defaultValue"); const { lang } = useLocale(); const leftDate = ref(dayjs().locale(lang.value)); const rightDate = ref(dayjs().locale(lang.value).add(1, unit$2)); const { minDate, maxDate, rangeState, ppNs, drpNs, handleChangeRange, handleRangeConfirm, handleShortcutClick, onSelect, parseValue, t } = useRangePicker(props2, { defaultValue, defaultTime, leftDate, rightDate, unit: unit$2, sortDates }); watch(() => props2.visible, (visible) => { if (!visible && rangeState.value.selecting) { parseValue(props2.parsedValue); onSelect(false); } }); const dateUserInput = ref({ min: null, max: null }); const timeUserInput = ref({ min: null, max: null }); const { leftCurrentView, rightCurrentView, leftCurrentViewRef, rightCurrentViewRef, leftYear, rightYear, leftMonth, rightMonth, leftYearLabel, rightYearLabel, showLeftPicker, showRightPicker, handleLeftYearPick, handleRightYearPick, handleLeftMonthPick, handleRightMonthPick, handlePanelChange, adjustDateByView } = usePanelDateRange(props2, emit, leftDate, rightDate); const hasShortcuts = computed(() => !!shortcuts.value.length); const minVisibleDate = computed(() => { if (dateUserInput.value.min !== null) return dateUserInput.value.min; if (minDate.value) return minDate.value.format(dateFormat.value); return ""; }); const maxVisibleDate = computed(() => { if (dateUserInput.value.max !== null) return dateUserInput.value.max; if (maxDate.value || minDate.value) return (maxDate.value || minDate.value).format(dateFormat.value); return ""; }); const minVisibleTime = computed(() => { if (timeUserInput.value.min !== null) return timeUserInput.value.min; if (minDate.value) return minDate.value.format(timeFormat.value); return ""; }); const maxVisibleTime = computed(() => { if (timeUserInput.value.max !== null) return timeUserInput.value.max; if (maxDate.value || minDate.value) return (maxDate.value || minDate.value).format(timeFormat.value); return ""; }); const timeFormat = computed(() => { return props2.timeFormat || extractTimeFormat(format.value || "") || DEFAULT_FORMATS_TIME; }); const dateFormat = computed(() => { return props2.dateFormat || extractDateFormat(format.value || "") || DEFAULT_FORMATS_DATE; }); const isValidValue2 = (date) => { return isValidRange(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true); }; const leftPrevYear = () => { leftDate.value = adjustDateByView(leftCurrentView.value, leftDate.value, false); if (!props2.unlinkPanels) rightDate.value = leftDate.value.add(1, "month"); handlePanelChange("year"); }; const leftPrevMonth = () => { leftDate.value = leftDate.value.subtract(1, "month"); if (!props2.unlinkPanels) rightDate.value = leftDate.value.add(1, "month"); handlePanelChange("month"); }; const rightNextYear = () => { if (!props2.unlinkPanels) { leftDate.value = adjustDateByView(rightCurrentView.value, leftDate.value, true); rightDate.value = leftDate.value.add(1, "month"); } else rightDate.value = adjustDateByView(rightCurrentView.value, rightDate.value, true); handlePanelChange("year"); }; const rightNextMonth = () => { if (!props2.unlinkPanels) { leftDate.value = leftDate.value.add(1, "month"); rightDate.value = leftDate.value.add(1, "month"); } else rightDate.value = rightDate.value.add(1, "month"); handlePanelChange("month"); }; const leftNextYear = () => { leftDate.value = adjustDateByView(leftCurrentView.value, leftDate.value, true); handlePanelChange("year"); }; const leftNextMonth = () => { leftDate.value = leftDate.value.add(1, "month"); handlePanelChange("month"); }; const rightPrevYear = () => { rightDate.value = adjustDateByView(rightCurrentView.value, rightDate.value, false); handlePanelChange("year"); }; const rightPrevMonth = () => { rightDate.value = rightDate.value.subtract(1, "month"); handlePanelChange("month"); }; const enableMonthArrow = computed(() => { const nextMonth = (leftMonth.value + 1) % 12; const yearOffset = leftMonth.value + 1 >= 12 ? 1 : 0; return props2.unlinkPanels && new Date(leftYear.value + yearOffset, nextMonth) < new Date(rightYear.value, rightMonth.value); }); const enableYearArrow = computed(() => { return props2.unlinkPanels && rightYear.value * 12 + rightMonth.value - (leftYear.value * 12 + leftMonth.value + 1) >= 12; }); const dateRangeDisabled = useFormDisabled(); const btnDisabled = computed(() => { return !(minDate.value && maxDate.value && !rangeState.value.selecting && isValidRange([minDate.value, maxDate.value]) && !dateRangeDisabled.value); }); const showTime = computed(() => props2.type === "datetime" || props2.type === "datetimerange"); const formatEmit = (emitDayjs, index) => { if (!emitDayjs) return; if (defaultTime) return dayjs(defaultTime[index] || defaultTime).locale(lang.value).year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date()); return emitDayjs; }; const handleRangePick = (val, close2 = true) => { const min_ = val.minDate; const max_ = val.maxDate; const minDate_ = formatEmit(min_, 0); const maxDate_ = formatEmit(max_, 1); if (maxDate.value === maxDate_ && minDate.value === minDate_) return; emit("calendar-change", [min_.toDate(), max_ && max_.toDate()]); maxDate.value = maxDate_; minDate.value = minDate_; if (!showTime.value && close2) close2 = !minDate_ || !maxDate_; handleRangeConfirm(close2); }; const minTimePickerVisible = ref(false); const maxTimePickerVisible = ref(false); const handleMinTimeClose = () => { minTimePickerVisible.value = false; }; const handleMaxTimeClose = () => { maxTimePickerVisible.value = false; }; const handleDateInput = (value, type) => { dateUserInput.value[type] = value; const parsedValueD = dayjs(value, dateFormat.value).locale(lang.value); if (parsedValueD.isValid()) { if (disabledDate && disabledDate(parsedValueD.toDate())) return; if (type === "min") { leftDate.value = parsedValueD; minDate.value = (minDate.value || leftDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date()); if (!props2.unlinkPanels && (!maxDate.value || maxDate.value.isBefore(minDate.value))) { rightDate.value = parsedValueD.add(1, "month"); maxDate.value = minDate.value.add(1, "month"); } } else { rightDate.value = parsedValueD; maxDate.value = (maxDate.value || rightDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date()); if (!props2.unlinkPanels && (!minDate.value || minDate.value.isAfter(maxDate.value))) { leftDate.value = parsedValueD.subtract(1, "month"); minDate.value = maxDate.value.subtract(1, "month"); } } sortDates(minDate.value, maxDate.value); handleRangeConfirm(true); } }; const handleDateChange = (_, type) => { dateUserInput.value[type] = null; }; const handleTimeInput = (value, type) => { timeUserInput.value[type] = value; const parsedValueD = dayjs(value, timeFormat.value).locale(lang.value); if (parsedValueD.isValid()) if (type === "min") { minTimePickerVisible.value = true; minDate.value = (minDate.value || leftDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second()); leftDate.value = minDate.value; } else { maxTimePickerVisible.value = true; maxDate.value = (maxDate.value || rightDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second()); rightDate.value = maxDate.value; } }; const handleTimeChange = (_value, type) => { timeUserInput.value[type] = null; if (type === "min") { leftDate.value = minDate.value; minTimePickerVisible.value = false; if (!maxDate.value || maxDate.value.isBefore(minDate.value)) maxDate.value = minDate.value; } else { rightDate.value = maxDate.value; maxTimePickerVisible.value = false; if (maxDate.value && maxDate.value.isBefore(minDate.value)) minDate.value = maxDate.value; } handleRangeConfirm(true); }; const handleMinTimePick = (value, visible, first) => { if (timeUserInput.value.min) return; if (value) minDate.value = (minDate.value || leftDate.value).hour(value.hour()).minute(value.minute()).second(value.second()); if (!first) minTimePickerVisible.value = visible; if (!maxDate.value || maxDate.value.isBefore(minDate.value)) { maxDate.value = minDate.value; rightDate.value = value; nextTick(() => { parseValue(props2.parsedValue); }); } handleRangeConfirm(true); }; const handleMaxTimePick = (value, visible, first) => { if (timeUserInput.value.max) return; if (value) maxDate.value = (maxDate.value || rightDate.value).hour(value.hour()).minute(value.minute()).second(value.second()); if (!first) maxTimePickerVisible.value = visible; if (maxDate.value && maxDate.value.isBefore(minDate.value)) minDate.value = maxDate.value; handleRangeConfirm(true); }; const onClear = () => { handleClear(); emit("clear"); }; const handleClear = () => { let valueOnClear = null; if (pickerBase == null ? void 0 : pickerBase.emptyValues) valueOnClear = pickerBase.emptyValues.valueOnClear.value; leftDate.value = getDefaultValue(unref(defaultValue), { lang: unref(lang), unit: "month", unlinkPanels: props2.unlinkPanels })[0]; rightDate.value = leftDate.value.add(1, "month"); maxDate.value = void 0; minDate.value = void 0; handleRangeConfirm(true); emit("pick", valueOnClear); }; const parseUserInput = (value) => { return correctlyParseUserInput(value, format.value || "", lang.value, isDefaultFormat); }; function sortDates(minDate2, maxDate2) { if (props2.unlinkPanels && maxDate2) { const minDateYear = (minDate2 == null ? void 0 : minDate2.year()) || 0; const minDateMonth = (minDate2 == null ? void 0 : minDate2.month()) || 0; const maxDateYear = maxDate2.year(); const maxDateMonth = maxDate2.month(); rightDate.value = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? maxDate2.add(1, unit$2) : maxDate2; } else { rightDate.value = leftDate.value.add(1, unit$2); if (maxDate2) rightDate.value = rightDate.value.hour(maxDate2.hour()).minute(maxDate2.minute()).second(maxDate2.second()); } } emit("set-picker-option", ["isValidValue", isValidValue2]); emit("set-picker-option", ["parseUserInput", parseUserInput]); emit("set-picker-option", ["handleClear", handleClear]); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([ unref(ppNs).b(), unref(drpNs).b(), unref(ppNs).is("border", _ctx.border), unref(ppNs).is("disabled", unref(dateRangeDisabled)), { "has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value, "has-time": showTime.value } ]) }, [createBaseVNode("div", { class: normalizeClass(unref(ppNs).e("body-wrapper")) }, [ renderSlot(_ctx.$slots, "sidebar", { class: normalizeClass(unref(ppNs).e("sidebar")) }), hasShortcuts.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ppNs).e("sidebar")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(shortcuts.value, (shortcut, key) => { return openBlock(), createElementBlock("button", { key, type: "button", disabled: unref(dateRangeDisabled), class: normalizeClass(unref(ppNs).e("shortcut")), onClick: ($event) => unref(handleShortcutClick)(shortcut) }, toDisplayString(shortcut.text), 11, _hoisted_1$K); }), 128))], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ppNs).e("body")) }, [ showTime.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(drpNs).e("time-header")) }, [ createBaseVNode("span", { class: normalizeClass(unref(drpNs).e("editors-wrap")) }, [createBaseVNode("span", { class: normalizeClass(unref(drpNs).e("time-picker-wrap")) }, [createVNode(unref(ElInput), { size: "small", disabled: unref(rangeState).selecting || unref(dateRangeDisabled), placeholder: unref(t)("el.datepicker.startDate"), class: normalizeClass(unref(drpNs).e("editor")), "model-value": minVisibleDate.value, "validate-event": false, readonly: !_ctx.editable, onInput: _cache[0] || (_cache[0] = (val) => handleDateInput(val, "min")), onChange: _cache[1] || (_cache[1] = (val) => handleDateChange(val, "min")) }, null, 8, [ "disabled", "placeholder", "class", "model-value", "readonly" ])], 2), withDirectives((openBlock(), createElementBlock("span", { class: normalizeClass(unref(drpNs).e("time-picker-wrap")) }, [createVNode(unref(ElInput), { size: "small", class: normalizeClass(unref(drpNs).e("editor")), disabled: unref(rangeState).selecting || unref(dateRangeDisabled), placeholder: unref(t)("el.datepicker.startTime"), "model-value": minVisibleTime.value, "validate-event": false, readonly: !_ctx.editable, onFocus: _cache[2] || (_cache[2] = ($event) => minTimePickerVisible.value = true), onInput: _cache[3] || (_cache[3] = (val) => handleTimeInput(val, "min")), onChange: _cache[4] || (_cache[4] = (val) => handleTimeChange(val, "min")) }, null, 8, [ "class", "disabled", "placeholder", "model-value", "readonly" ]), createVNode(unref(panel_time_pick_default), { visible: minTimePickerVisible.value, format: timeFormat.value, "datetime-role": "start", "parsed-value": unref(minDate) || leftDate.value, onPick: handleMinTimePick }, null, 8, [ "visible", "format", "parsed-value" ])], 2)), [[unref(ClickOutside), handleMinTimeClose]])], 2), createBaseVNode("span", null, [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_right_default))]), _: 1 })]), createBaseVNode("span", { class: normalizeClass([unref(drpNs).e("editors-wrap"), "is-right"]) }, [createBaseVNode("span", { class: normalizeClass(unref(drpNs).e("time-picker-wrap")) }, [createVNode(unref(ElInput), { size: "small", class: normalizeClass(unref(drpNs).e("editor")), disabled: unref(rangeState).selecting || unref(dateRangeDisabled), placeholder: unref(t)("el.datepicker.endDate"), "model-value": maxVisibleDate.value, readonly: !unref(minDate) || !_ctx.editable, "validate-event": false, onInput: _cache[5] || (_cache[5] = (val) => handleDateInput(val, "max")), onChange: _cache[6] || (_cache[6] = (val) => handleDateChange(val, "max")) }, null, 8, [ "class", "disabled", "placeholder", "model-value", "readonly" ])], 2), withDirectives((openBlock(), createElementBlock("span", { class: normalizeClass(unref(drpNs).e("time-picker-wrap")) }, [createVNode(unref(ElInput), { size: "small", class: normalizeClass(unref(drpNs).e("editor")), disabled: unref(rangeState).selecting || unref(dateRangeDisabled), placeholder: unref(t)("el.datepicker.endTime"), "model-value": maxVisibleTime.value, readonly: !unref(minDate) || !_ctx.editable, "validate-event": false, onFocus: _cache[7] || (_cache[7] = ($event) => unref(minDate) && (maxTimePickerVisible.value = true)), onInput: _cache[8] || (_cache[8] = (val) => handleTimeInput(val, "max")), onChange: _cache[9] || (_cache[9] = (val) => handleTimeChange(val, "max")) }, null, 8, [ "class", "disabled", "placeholder", "model-value", "readonly" ]), createVNode(unref(panel_time_pick_default), { "datetime-role": "end", visible: maxTimePickerVisible.value, format: timeFormat.value, "parsed-value": unref(maxDate) || rightDate.value, onPick: handleMaxTimePick }, null, 8, [ "visible", "format", "parsed-value" ])], 2)), [[unref(ClickOutside), handleMaxTimeClose]])], 2) ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"]) }, [ createBaseVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [ createBaseVNode("button", { type: "button", class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]), "aria-label": unref(t)(`el.datepicker.prevYear`), disabled: unref(dateRangeDisabled), onClick: leftPrevYear }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_left_default))]), _: 1 })])], 10, _hoisted_2$s), withDirectives(createBaseVNode("button", { type: "button", class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]), "aria-label": unref(t)(`el.datepicker.prevMonth`), disabled: unref(dateRangeDisabled), onClick: leftPrevMonth }, [renderSlot(_ctx.$slots, "prev-month", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_left_default))]), _: 1 })])], 10, _hoisted_3$d), [[vShow, unref(leftCurrentView) === "date"]]), _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", { key: 0, type: "button", disabled: !enableYearArrow.value || unref(dateRangeDisabled), class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableYearArrow.value || unref(dateRangeDisabled))], "d-arrow-right"]), "aria-label": unref(t)(`el.datepicker.nextYear`), onClick: leftNextYear }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_right_default))]), _: 1 })])], 10, _hoisted_4$a)) : createCommentVNode("v-if", true), _ctx.unlinkPanels && unref(leftCurrentView) === "date" ? (openBlock(), createElementBlock("button", { key: 1, type: "button", disabled: !enableMonthArrow.value || unref(dateRangeDisabled), class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableMonthArrow.value || unref(dateRangeDisabled))], "arrow-right"]), "aria-label": unref(t)(`el.datepicker.nextMonth`), onClick: leftNextMonth }, [renderSlot(_ctx.$slots, "next-month", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_right_default))]), _: 1 })])], 10, _hoisted_5$7)) : createCommentVNode("v-if", true), createBaseVNode("div", null, [createBaseVNode("span", { role: "button", class: normalizeClass(unref(drpNs).e("header-label")), "aria-live": "polite", tabindex: _ctx.disabled ? void 0 : 0, "aria-disabled": _ctx.disabled, onKeydown: _cache[10] || (_cache[10] = withKeys(($event) => unref(showLeftPicker)("year"), ["enter"])), onClick: _cache[11] || (_cache[11] = ($event) => unref(showLeftPicker)("year")) }, toDisplayString(unref(leftYearLabel)), 43, _hoisted_6$2), withDirectives(createBaseVNode("span", { role: "button", "aria-live": "polite", tabindex: _ctx.disabled ? void 0 : 0, "aria-disabled": _ctx.disabled, class: normalizeClass([unref(drpNs).e("header-label"), { active: unref(leftCurrentView) === "month" }]), onKeydown: _cache[12] || (_cache[12] = withKeys(($event) => unref(showLeftPicker)("month"), ["enter"])), onClick: _cache[13] || (_cache[13] = ($event) => unref(showLeftPicker)("month")) }, toDisplayString(unref(t)(`el.datepicker.month${leftDate.value.month() + 1}`)), 43, _hoisted_7$1), [[vShow, unref(leftCurrentView) === "date"]])]) ], 2), unref(leftCurrentView) === "date" ? (openBlock(), createBlock(basic_date_table_default, { key: 0, ref_key: "leftCurrentViewRef", ref: leftCurrentViewRef, "selection-mode": "range", date: leftDate.value, "min-date": unref(minDate), "max-date": unref(maxDate), "range-state": unref(rangeState), "disabled-date": unref(disabledDate), "cell-class-name": unref(cellClassName), "show-week-number": _ctx.showWeekNumber, disabled: unref(dateRangeDisabled), onChangerange: unref(handleChangeRange), onPick: handleRangePick, onSelect: unref(onSelect) }, null, 8, [ "date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "show-week-number", "disabled", "onChangerange", "onSelect" ])) : createCommentVNode("v-if", true), unref(leftCurrentView) === "year" ? (openBlock(), createBlock(basic_year_table_default, { key: 1, ref_key: "leftCurrentViewRef", ref: leftCurrentViewRef, "selection-mode": "year", date: leftDate.value, "disabled-date": unref(disabledDate), "parsed-value": _ctx.parsedValue, disabled: unref(dateRangeDisabled), onPick: unref(handleLeftYearPick) }, null, 8, [ "date", "disabled-date", "parsed-value", "disabled", "onPick" ])) : createCommentVNode("v-if", true), unref(leftCurrentView) === "month" ? (openBlock(), createBlock(basic_month_table_default, { key: 2, ref_key: "leftCurrentViewRef", ref: leftCurrentViewRef, "selection-mode": "month", date: leftDate.value, "parsed-value": _ctx.parsedValue, "disabled-date": unref(disabledDate), disabled: unref(dateRangeDisabled), onPick: unref(handleLeftMonthPick) }, null, 8, [ "date", "parsed-value", "disabled-date", "disabled", "onPick" ])) : createCommentVNode("v-if", true) ], 2), createBaseVNode("div", { class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"]) }, [ createBaseVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [ _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", { key: 0, type: "button", disabled: !enableYearArrow.value || unref(dateRangeDisabled), class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableYearArrow.value || unref(dateRangeDisabled))], "d-arrow-left"]), "aria-label": unref(t)(`el.datepicker.prevYear`), onClick: rightPrevYear }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_left_default))]), _: 1 })])], 10, _hoisted_8$1)) : createCommentVNode("v-if", true), _ctx.unlinkPanels && unref(rightCurrentView) === "date" ? (openBlock(), createElementBlock("button", { key: 1, type: "button", disabled: !enableMonthArrow.value || unref(dateRangeDisabled), class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableMonthArrow.value || unref(dateRangeDisabled))], "arrow-left"]), "aria-label": unref(t)(`el.datepicker.prevMonth`), onClick: rightPrevMonth }, [renderSlot(_ctx.$slots, "prev-month", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_left_default))]), _: 1 })])], 10, _hoisted_9$1)) : createCommentVNode("v-if", true), createBaseVNode("button", { type: "button", "aria-label": unref(t)(`el.datepicker.nextYear`), class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]), disabled: unref(dateRangeDisabled), onClick: rightNextYear }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_right_default))]), _: 1 })])], 10, _hoisted_10$1), withDirectives(createBaseVNode("button", { type: "button", class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]), disabled: unref(dateRangeDisabled), "aria-label": unref(t)(`el.datepicker.nextMonth`), onClick: rightNextMonth }, [renderSlot(_ctx.$slots, "next-month", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_right_default))]), _: 1 })])], 10, _hoisted_11$1), [[vShow, unref(rightCurrentView) === "date"]]), createBaseVNode("div", null, [createBaseVNode("span", { role: "button", class: normalizeClass(unref(drpNs).e("header-label")), "aria-live": "polite", tabindex: _ctx.disabled ? void 0 : 0, "aria-disabled": _ctx.disabled, onKeydown: _cache[14] || (_cache[14] = withKeys(($event) => unref(showRightPicker)("year"), ["enter"])), onClick: _cache[15] || (_cache[15] = ($event) => unref(showRightPicker)("year")) }, toDisplayString(unref(rightYearLabel)), 43, _hoisted_12$1), withDirectives(createBaseVNode("span", { role: "button", "aria-live": "polite", tabindex: _ctx.disabled ? void 0 : 0, "aria-disabled": _ctx.disabled, class: normalizeClass([unref(drpNs).e("header-label"), { active: unref(rightCurrentView) === "month" }]), onKeydown: _cache[16] || (_cache[16] = withKeys(($event) => unref(showRightPicker)("month"), ["enter"])), onClick: _cache[17] || (_cache[17] = ($event) => unref(showRightPicker)("month")) }, toDisplayString(unref(t)(`el.datepicker.month${rightDate.value.month() + 1}`)), 43, _hoisted_13$1), [[vShow, unref(rightCurrentView) === "date"]])]) ], 2), unref(rightCurrentView) === "date" ? (openBlock(), createBlock(basic_date_table_default, { key: 0, ref_key: "rightCurrentViewRef", ref: rightCurrentViewRef, "selection-mode": "range", date: rightDate.value, "min-date": unref(minDate), "max-date": unref(maxDate), "range-state": unref(rangeState), "disabled-date": unref(disabledDate), "cell-class-name": unref(cellClassName), "show-week-number": _ctx.showWeekNumber, disabled: unref(dateRangeDisabled), onChangerange: unref(handleChangeRange), onPick: handleRangePick, onSelect: unref(onSelect) }, null, 8, [ "date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "show-week-number", "disabled", "onChangerange", "onSelect" ])) : createCommentVNode("v-if", true), unref(rightCurrentView) === "year" ? (openBlock(), createBlock(basic_year_table_default, { key: 1, ref_key: "rightCurrentViewRef", ref: rightCurrentViewRef, "selection-mode": "year", date: rightDate.value, "disabled-date": unref(disabledDate), "parsed-value": _ctx.parsedValue, disabled: unref(dateRangeDisabled), onPick: unref(handleRightYearPick) }, null, 8, [ "date", "disabled-date", "parsed-value", "disabled", "onPick" ])) : createCommentVNode("v-if", true), unref(rightCurrentView) === "month" ? (openBlock(), createBlock(basic_month_table_default, { key: 2, ref_key: "rightCurrentViewRef", ref: rightCurrentViewRef, "selection-mode": "month", date: rightDate.value, "parsed-value": _ctx.parsedValue, "disabled-date": unref(disabledDate), disabled: unref(dateRangeDisabled), onPick: unref(handleRightMonthPick) }, null, 8, [ "date", "parsed-value", "disabled-date", "disabled", "onPick" ])) : createCommentVNode("v-if", true) ], 2) ], 2) ], 2), _ctx.showFooter && showTime.value && (_ctx.showConfirm || unref(clearable)) ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ppNs).e("footer")) }, [unref(clearable) ? (openBlock(), createBlock(unref(ElButton), { key: 0, text: "", size: "small", class: normalizeClass(unref(ppNs).e("link-btn")), onClick: onClear }, { default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.clear")), 1)]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), _ctx.showConfirm ? (openBlock(), createBlock(unref(ElButton), { key: 1, plain: "", size: "small", class: normalizeClass(unref(ppNs).e("link-btn")), disabled: btnDisabled.value, onClick: _cache[18] || (_cache[18] = ($event) => unref(handleRangeConfirm)(false)) }, { default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.confirm")), 1)]), _: 1 }, 8, ["class", "disabled"])) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true)], 2); }; } }); var panel_date_range_default = panel_date_range_vue_vue_type_script_setup_true_lang_default; const panelMonthRangeProps = buildProps({ ...panelRangeSharedProps }); const panelMonthRangeEmits = [ "pick", "set-picker-option", "calendar-change" ]; const useMonthRangeHeader = ({ unlinkPanels, leftDate, rightDate }) => { const { t } = useLocale(); const leftPrevYear = () => { leftDate.value = leftDate.value.subtract(1, "year"); if (!unlinkPanels.value) rightDate.value = rightDate.value.subtract(1, "year"); }; const rightNextYear = () => { if (!unlinkPanels.value) leftDate.value = leftDate.value.add(1, "year"); rightDate.value = rightDate.value.add(1, "year"); }; const leftNextYear = () => { leftDate.value = leftDate.value.add(1, "year"); }; const rightPrevYear = () => { rightDate.value = rightDate.value.subtract(1, "year"); }; return { leftPrevYear, rightNextYear, leftNextYear, rightPrevYear, leftLabel: computed(() => { return `${leftDate.value.year()} ${t("el.datepicker.year")}`; }), rightLabel: computed(() => { return `${rightDate.value.year()} ${t("el.datepicker.year")}`; }), leftYear: computed(() => { return leftDate.value.year(); }), rightYear: computed(() => { return rightDate.value.year() === leftDate.value.year() ? leftDate.value.year() + 1 : rightDate.value.year(); }) }; }; const _hoisted_1$J = ["disabled", "onClick"]; const _hoisted_2$r = ["disabled"]; const _hoisted_3$c = ["disabled"]; const _hoisted_4$9 = ["disabled"]; const _hoisted_5$6 = ["disabled"]; const unit$1 = "year"; var panel_month_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "DatePickerMonthRange", __name: "panel-month-range", props: panelMonthRangeProps, emits: panelMonthRangeEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const { lang } = useLocale(); const pickerBase = inject(PICKER_BASE_INJECTION_KEY); const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0); const { shortcuts, disabledDate, cellClassName } = pickerBase.props; const format = toRef(pickerBase.props, "format"); const defaultValue = toRef(pickerBase.props, "defaultValue"); const leftDate = ref(dayjs().locale(lang.value)); const rightDate = ref(dayjs().locale(lang.value).add(1, unit$1)); const { minDate, maxDate, rangeState, ppNs, drpNs, handleChangeRange, handleRangeConfirm, handleShortcutClick, onSelect, parseValue } = useRangePicker(props2, { defaultValue, leftDate, rightDate, unit: unit$1, sortDates }); const hasShortcuts = computed(() => !!shortcuts.length); const { leftPrevYear, rightNextYear, leftNextYear, rightPrevYear, leftLabel, rightLabel, leftYear, rightYear } = useMonthRangeHeader({ unlinkPanels: toRef(props2, "unlinkPanels"), leftDate, rightDate }); const enableYearArrow = computed(() => { return props2.unlinkPanels && rightYear.value > leftYear.value + 1; }); const handleRangePick = (val, close2 = true) => { const minDate_ = val.minDate; const maxDate_ = val.maxDate; if (maxDate.value === maxDate_ && minDate.value === minDate_) return; emit("calendar-change", [minDate_.toDate(), maxDate_ && maxDate_.toDate()]); maxDate.value = maxDate_; minDate.value = minDate_; if (!close2) return; handleRangeConfirm(); }; const handleClear = () => { let valueOnClear = null; if (pickerBase == null ? void 0 : pickerBase.emptyValues) valueOnClear = pickerBase.emptyValues.valueOnClear.value; leftDate.value = getDefaultValue(unref(defaultValue), { lang: unref(lang), unit: "year", unlinkPanels: props2.unlinkPanels })[0]; rightDate.value = leftDate.value.add(1, "year"); emit("pick", valueOnClear); }; const parseUserInput = (value) => { return correctlyParseUserInput(value, format.value, lang.value, isDefaultFormat); }; function sortDates(minDate2, maxDate2) { if (props2.unlinkPanels && maxDate2) rightDate.value = ((minDate2 == null ? void 0 : minDate2.year()) || 0) === maxDate2.year() ? maxDate2.add(1, unit$1) : maxDate2; else rightDate.value = leftDate.value.add(1, unit$1); } const monthRangeDisabled = useFormDisabled(); watch(() => props2.visible, (visible) => { if (!visible && rangeState.value.selecting) { parseValue(props2.parsedValue); onSelect(false); } }); emit("set-picker-option", ["isValidValue", isValidRange]); emit("set-picker-option", ["parseUserInput", parseUserInput]); emit("set-picker-option", ["handleClear", handleClear]); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([ unref(ppNs).b(), unref(drpNs).b(), unref(ppNs).is("border", _ctx.border), unref(ppNs).is("disabled", unref(monthRangeDisabled)), { "has-sidebar": Boolean(_ctx.$slots.sidebar) || hasShortcuts.value } ]) }, [createBaseVNode("div", { class: normalizeClass(unref(ppNs).e("body-wrapper")) }, [ renderSlot(_ctx.$slots, "sidebar", { class: normalizeClass(unref(ppNs).e("sidebar")) }), hasShortcuts.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ppNs).e("sidebar")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => { return openBlock(), createElementBlock("button", { key, type: "button", class: normalizeClass(unref(ppNs).e("shortcut")), disabled: unref(monthRangeDisabled), onClick: ($event) => unref(handleShortcutClick)(shortcut) }, toDisplayString(shortcut.text), 11, _hoisted_1$J); }), 128))], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ppNs).e("body")) }, [createBaseVNode("div", { class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"]) }, [createBaseVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [ createBaseVNode("button", { type: "button", class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]), disabled: unref(monthRangeDisabled), onClick: _cache[0] || (_cache[0] = (...args) => unref(leftPrevYear) && unref(leftPrevYear)(...args)) }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_left_default))]), _: 1 })])], 10, _hoisted_2$r), _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", { key: 0, type: "button", disabled: !enableYearArrow.value || unref(monthRangeDisabled), class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableYearArrow.value || unref(monthRangeDisabled))], "d-arrow-right"]), onClick: _cache[1] || (_cache[1] = (...args) => unref(leftNextYear) && unref(leftNextYear)(...args)) }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_right_default))]), _: 1 })])], 10, _hoisted_3$c)) : createCommentVNode("v-if", true), createBaseVNode("div", null, toDisplayString(unref(leftLabel)), 1) ], 2), createVNode(basic_month_table_default, { "selection-mode": "range", date: leftDate.value, "min-date": unref(minDate), "max-date": unref(maxDate), "range-state": unref(rangeState), "disabled-date": unref(disabledDate), disabled: unref(monthRangeDisabled), "cell-class-name": unref(cellClassName), onChangerange: unref(handleChangeRange), onPick: handleRangePick, onSelect: unref(onSelect) }, null, 8, [ "date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect" ])], 2), createBaseVNode("div", { class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"]) }, [createBaseVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [ _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", { key: 0, type: "button", disabled: !enableYearArrow.value || unref(monthRangeDisabled), class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableYearArrow.value || unref(monthRangeDisabled))], "d-arrow-left"]), onClick: _cache[2] || (_cache[2] = (...args) => unref(rightPrevYear) && unref(rightPrevYear)(...args)) }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_left_default))]), _: 1 })])], 10, _hoisted_4$9)) : createCommentVNode("v-if", true), createBaseVNode("button", { type: "button", class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]), disabled: unref(monthRangeDisabled), onClick: _cache[3] || (_cache[3] = (...args) => unref(rightNextYear) && unref(rightNextYear)(...args)) }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_right_default))]), _: 1 })])], 10, _hoisted_5$6), createBaseVNode("div", null, toDisplayString(unref(rightLabel)), 1) ], 2), createVNode(basic_month_table_default, { "selection-mode": "range", date: rightDate.value, "min-date": unref(minDate), "max-date": unref(maxDate), "range-state": unref(rangeState), "disabled-date": unref(disabledDate), disabled: unref(monthRangeDisabled), "cell-class-name": unref(cellClassName), onChangerange: unref(handleChangeRange), onPick: handleRangePick, onSelect: unref(onSelect) }, null, 8, [ "date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect" ])], 2)], 2) ], 2)], 2); }; } }); var panel_month_range_default = panel_month_range_vue_vue_type_script_setup_true_lang_default; const panelYearRangeProps = buildProps({ ...panelRangeSharedProps }); const panelYearRangeEmits = [ "pick", "set-picker-option", "calendar-change" ]; const useYearRangeHeader = ({ unlinkPanels, leftDate, rightDate }) => { const leftPrevYear = () => { leftDate.value = leftDate.value.subtract(10, "year"); if (!unlinkPanels.value) rightDate.value = rightDate.value.subtract(10, "year"); }; const rightNextYear = () => { if (!unlinkPanels.value) leftDate.value = leftDate.value.add(10, "year"); rightDate.value = rightDate.value.add(10, "year"); }; const leftNextYear = () => { leftDate.value = leftDate.value.add(10, "year"); }; const rightPrevYear = () => { rightDate.value = rightDate.value.subtract(10, "year"); }; return { leftPrevYear, rightNextYear, leftNextYear, rightPrevYear, leftLabel: computed(() => { const leftStartDate = Math.floor(leftDate.value.year() / 10) * 10; return `${leftStartDate}-${leftStartDate + 9}`; }), rightLabel: computed(() => { const rightStartDate = Math.floor(rightDate.value.year() / 10) * 10; return `${rightStartDate}-${rightStartDate + 9}`; }), leftYear: computed(() => { return Math.floor(leftDate.value.year() / 10) * 10 + 9; }), rightYear: computed(() => { return Math.floor(rightDate.value.year() / 10) * 10; }) }; }; const _hoisted_1$I = ["disabled", "onClick"]; const _hoisted_2$q = ["disabled"]; const _hoisted_3$b = ["disabled"]; const _hoisted_4$8 = ["disabled"]; const _hoisted_5$5 = ["disabled"]; const step = 10; const unit = "year"; var panel_year_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "DatePickerYearRange", __name: "panel-year-range", props: panelYearRangeProps, emits: panelYearRangeEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const { lang } = useLocale(); const leftDate = ref(dayjs().locale(lang.value)); const rightDate = ref(dayjs().locale(lang.value).add(step, unit)); const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0); const pickerBase = inject(PICKER_BASE_INJECTION_KEY); const { shortcuts, disabledDate, cellClassName } = pickerBase.props; const format = toRef(pickerBase.props, "format"); const defaultValue = toRef(pickerBase.props, "defaultValue"); const { minDate, maxDate, rangeState, ppNs, drpNs, handleChangeRange, handleRangeConfirm, handleShortcutClick, onSelect, parseValue } = useRangePicker(props2, { defaultValue, leftDate, rightDate, step, unit, sortDates }); const { leftPrevYear, rightNextYear, leftNextYear, rightPrevYear, leftLabel, rightLabel, leftYear, rightYear } = useYearRangeHeader({ unlinkPanels: toRef(props2, "unlinkPanels"), leftDate, rightDate }); const yearRangeDisabled = useFormDisabled(); const hasShortcuts = computed(() => !!shortcuts.length); const panelKls = computed(() => [ ppNs.b(), drpNs.b(), ppNs.is("border", props2.border), ppNs.is("disabled", yearRangeDisabled.value), { "has-sidebar": Boolean(useSlots().sidebar) || hasShortcuts.value } ]); const leftPanelKls = computed(() => { return { content: [ ppNs.e("content"), drpNs.e("content"), "is-left" ], arrowLeftBtn: [ppNs.e("icon-btn"), "d-arrow-left"], arrowRightBtn: [ ppNs.e("icon-btn"), ppNs.is("disabled", !enableYearArrow.value || yearRangeDisabled.value), "d-arrow-right" ] }; }); const rightPanelKls = computed(() => { return { content: [ ppNs.e("content"), drpNs.e("content"), "is-right" ], arrowLeftBtn: [ ppNs.e("icon-btn"), ppNs.is("disabled", !enableYearArrow.value || yearRangeDisabled.value), "d-arrow-left" ], arrowRightBtn: [ppNs.e("icon-btn"), "d-arrow-right"] }; }); const enableYearArrow = computed(() => { return props2.unlinkPanels && rightYear.value > leftYear.value + 1; }); const handleRangePick = (val, close2 = true) => { const minDate_ = val.minDate; const maxDate_ = val.maxDate; if (maxDate.value === maxDate_ && minDate.value === minDate_) return; emit("calendar-change", [minDate_.toDate(), maxDate_ && maxDate_.toDate()]); maxDate.value = maxDate_; minDate.value = minDate_; if (!close2) return; handleRangeConfirm(); }; const parseUserInput = (value) => { return correctlyParseUserInput(value, format.value, lang.value, isDefaultFormat); }; const isValidValue2 = (date) => { return isValidRange(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true); }; const handleClear = () => { let valueOnClear = null; if (pickerBase == null ? void 0 : pickerBase.emptyValues) valueOnClear = pickerBase.emptyValues.valueOnClear.value; const defaultArr = getDefaultValue(unref(defaultValue), { lang: unref(lang), step, unit, unlinkPanels: props2.unlinkPanels }); leftDate.value = defaultArr[0]; rightDate.value = defaultArr[1]; emit("pick", valueOnClear); }; function sortDates(minDate2, maxDate2) { if (props2.unlinkPanels && maxDate2) { const minDateYear = (minDate2 == null ? void 0 : minDate2.year()) || 0; const maxDateYear = maxDate2.year(); rightDate.value = minDateYear + step > maxDateYear ? maxDate2.add(step, unit) : maxDate2; } else rightDate.value = leftDate.value.add(step, unit); } watch(() => props2.visible, (visible) => { if (!visible && rangeState.value.selecting) { parseValue(props2.parsedValue); onSelect(false); } }); emit("set-picker-option", ["isValidValue", isValidValue2]); emit("set-picker-option", ["parseUserInput", parseUserInput]); emit("set-picker-option", ["handleClear", handleClear]); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(panelKls.value) }, [createBaseVNode("div", { class: normalizeClass(unref(ppNs).e("body-wrapper")) }, [ renderSlot(_ctx.$slots, "sidebar", { class: normalizeClass(unref(ppNs).e("sidebar")) }), hasShortcuts.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ppNs).e("sidebar")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => { return openBlock(), createElementBlock("button", { key, type: "button", class: normalizeClass(unref(ppNs).e("shortcut")), disabled: unref(yearRangeDisabled), onClick: ($event) => unref(handleShortcutClick)(shortcut) }, toDisplayString(shortcut.text), 11, _hoisted_1$I); }), 128))], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ppNs).e("body")) }, [createBaseVNode("div", { class: normalizeClass(leftPanelKls.value.content) }, [createBaseVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [ createBaseVNode("button", { type: "button", class: normalizeClass(leftPanelKls.value.arrowLeftBtn), disabled: unref(yearRangeDisabled), onClick: _cache[0] || (_cache[0] = (...args) => unref(leftPrevYear) && unref(leftPrevYear)(...args)) }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_left_default))]), _: 1 })])], 10, _hoisted_2$q), _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", { key: 0, type: "button", disabled: !enableYearArrow.value || unref(yearRangeDisabled), class: normalizeClass(leftPanelKls.value.arrowRightBtn), onClick: _cache[1] || (_cache[1] = (...args) => unref(leftNextYear) && unref(leftNextYear)(...args)) }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_right_default))]), _: 1 })])], 10, _hoisted_3$b)) : createCommentVNode("v-if", true), createBaseVNode("div", null, toDisplayString(unref(leftLabel)), 1) ], 2), createVNode(basic_year_table_default, { "selection-mode": "range", date: leftDate.value, "min-date": unref(minDate), "max-date": unref(maxDate), "range-state": unref(rangeState), "disabled-date": unref(disabledDate), disabled: unref(yearRangeDisabled), "cell-class-name": unref(cellClassName), onChangerange: unref(handleChangeRange), onPick: handleRangePick, onSelect: unref(onSelect) }, null, 8, [ "date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect" ])], 2), createBaseVNode("div", { class: normalizeClass(rightPanelKls.value.content) }, [createBaseVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [ _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", { key: 0, type: "button", disabled: !enableYearArrow.value || unref(yearRangeDisabled), class: normalizeClass(rightPanelKls.value.arrowLeftBtn), onClick: _cache[2] || (_cache[2] = (...args) => unref(rightPrevYear) && unref(rightPrevYear)(...args)) }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_left_default))]), _: 1 })])], 10, _hoisted_4$8)) : createCommentVNode("v-if", true), createBaseVNode("button", { type: "button", class: normalizeClass(rightPanelKls.value.arrowRightBtn), disabled: unref(yearRangeDisabled), onClick: _cache[3] || (_cache[3] = (...args) => unref(rightNextYear) && unref(rightNextYear)(...args)) }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(d_arrow_right_default))]), _: 1 })])], 10, _hoisted_5$5), createBaseVNode("div", null, toDisplayString(unref(rightLabel)), 1) ], 2), createVNode(basic_year_table_default, { "selection-mode": "range", date: rightDate.value, "min-date": unref(minDate), "max-date": unref(maxDate), "range-state": unref(rangeState), "disabled-date": unref(disabledDate), disabled: unref(yearRangeDisabled), "cell-class-name": unref(cellClassName), onChangerange: unref(handleChangeRange), onPick: handleRangePick, onSelect: unref(onSelect) }, null, 8, [ "date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect" ])], 2)], 2) ], 2)], 2); }; } }); var panel_year_range_default = panel_year_range_vue_vue_type_script_setup_true_lang_default; const getPanel = function(type) { switch (type) { case "daterange": case "datetimerange": return panel_date_range_default; case "monthrange": return panel_month_range_default; case "yearrange": return panel_year_range_default; default: return panel_date_pick_default; } }; function _isSlot$7(s) { return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s); } dayjs.extend(localeData); dayjs.extend(advancedFormat); dayjs.extend(customParseFormat); dayjs.extend(weekOfYear); dayjs.extend(weekYear); dayjs.extend(dayOfYear); dayjs.extend(isSameOrAfter); dayjs.extend(isSameOrBefore); var date_picker_panel_default = /* @__PURE__ */ defineComponent({ name: "ElDatePickerPanel", install: null, inheritAttrs: false, props: datePickerPanelProps, emits: [ UPDATE_MODEL_EVENT, "calendar-change", "panel-change", "visible-change", "clear" ], setup(props2, { slots, emit, attrs }) { const ns = useNamespace("picker-panel"); if (isUndefined(inject(PICKER_BASE_INJECTION_KEY, void 0))) provide(PICKER_BASE_INJECTION_KEY, { props: reactive({ ...toRefs(props2) }) }); provide(ROOT_PICKER_INJECTION_KEY, { slots, pickerNs: ns }); const { parsedValue, onCalendarChange, onPanelChange, onSetPickerOption, onPick } = inject(ROOT_COMMON_PICKER_INJECTION_KEY, () => useCommonPicker(props2, emit), true); return () => { return createVNode(getPanel(props2.type), mergeProps(omit(attrs, "onPick"), props2, { "parsedValue": parsedValue.value, "onSet-picker-option": onSetPickerOption, "onCalendar-change": onCalendarChange, "onPanel-change": onPanelChange, "onClear": () => emit("clear"), "onPick": onPick }), _isSlot$7(slots) ? slots : { default: () => [slots] }); }; } }); const ElDatePickerPanel = withInstall(date_picker_panel_default); const datePickerProps = buildProps({ ...timePickerDefaultProps, type: { type: definePropType(String), default: "date" } }); function _isSlot$6(s) { return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s); } var date_picker_default = /* @__PURE__ */ defineComponent({ name: "ElDatePicker", install: null, props: datePickerProps, emits: [UPDATE_MODEL_EVENT], setup(props2, { expose, emit, slots }) { provide(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, computed(() => { return !props2.format; })); provide(PICKER_POPPER_OPTIONS_INJECTION_KEY, reactive(toRef(props2, "popperOptions"))); const commonPicker = ref(); expose({ focus: () => { var _a; (_a = commonPicker.value) == null ? void 0 : _a.focus(); }, blur: () => { var _a; (_a = commonPicker.value) == null ? void 0 : _a.blur(); }, handleOpen: () => { var _a; (_a = commonPicker.value) == null ? void 0 : _a.handleOpen(); }, handleClose: () => { var _a; (_a = commonPicker.value) == null ? void 0 : _a.handleClose(); } }); const onModelValueUpdated = (val) => { emit(UPDATE_MODEL_EVENT, val); }; return () => { const format = props2.format ?? (DEFAULT_FORMATS_DATEPICKER[props2.type] || DEFAULT_FORMATS_DATE); return createVNode(picker_default, mergeProps(props2, { "format": format, "type": props2.type, "ref": commonPicker, "onUpdate:modelValue": onModelValueUpdated }), { default: (scopedProps) => createVNode(ElDatePickerPanel, mergeProps({ "disabled": props2.disabled, "editable": props2.editable, "border": false }, scopedProps), _isSlot$6(slots) ? slots : { default: () => [slots] }), "range-separator": slots["range-separator"] }); }; } }); const ElDatePicker = withInstall(date_picker_default); const descriptionProps = buildProps({ border: Boolean, column: { type: Number, default: 3 }, direction: { type: String, values: ["horizontal", "vertical"], default: "horizontal" }, size: useSizeProp, title: { type: String, default: "" }, extra: { type: String, default: "" }, labelWidth: { type: [String, Number] } }); const COMPONENT_NAME$a = "ElDescriptionsItem"; const descriptionItemProps = buildProps({ label: { type: String, default: "" }, span: { type: Number, default: 1 }, rowspan: { type: Number, default: 1 }, width: { type: [String, Number], default: "" }, minWidth: { type: [String, Number], default: "" }, labelWidth: { type: [String, Number] }, align: { type: String, values: columnAlignment, default: "left" }, labelAlign: { type: String, values: columnAlignment }, className: { type: String, default: "" }, labelClassName: { type: String, default: "" } }); const DescriptionItem = defineComponent({ name: COMPONENT_NAME$a, props: descriptionItemProps }); const descriptionsKey = Symbol("elDescriptions"); const descriptionsRowProps = buildProps({ row: { type: definePropType(Array), default: () => [] } }); var descriptions_cell_default = defineComponent({ name: "ElDescriptionsCell", props: { cell: { type: Object }, tag: { type: String, default: "td" }, type: { type: String } }, setup() { return { descriptions: inject(descriptionsKey, {}) }; }, render() { var _a; const item = getNormalizedProps(this.cell); const directives = (((_a = this.cell) == null ? void 0 : _a.dirs) || []).map((dire) => { const { dir, arg, modifiers, value } = dire; return [ dir, value, arg, modifiers ]; }); const { border, direction: direction2 } = this.descriptions; const isVertical = direction2 === "vertical"; const renderLabel = () => { var _a2, _b, _c; return ((_c = (_b = (_a2 = this.cell) == null ? void 0 : _a2.children) == null ? void 0 : _b.label) == null ? void 0 : _c.call(_b)) || item.label; }; const renderContent = () => { var _a2, _b, _c; return (_c = (_b = (_a2 = this.cell) == null ? void 0 : _a2.children) == null ? void 0 : _b.default) == null ? void 0 : _c.call(_b); }; const span = item.span; const rowspan = item.rowspan; const align = item.align ? `is-${item.align}` : ""; const labelAlign = item.labelAlign ? `is-${item.labelAlign}` : align; const className = item.className; const labelClassName = item.labelClassName; const style = { width: addUnit(this.type === "label" ? item.labelWidth ?? this.descriptions.labelWidth ?? item.width : item.width), minWidth: addUnit(item.minWidth) }; const ns = useNamespace("descriptions"); switch (this.type) { case "label": return withDirectives(h(this.tag, { style, class: [ ns.e("cell"), ns.e("label"), ns.is("bordered-label", border), ns.is("vertical-label", isVertical), labelAlign, labelClassName ], colSpan: isVertical ? span : 1, rowspan: isVertical ? 1 : rowspan }, renderLabel()), directives); case "content": return withDirectives(h(this.tag, { style, class: [ ns.e("cell"), ns.e("content"), ns.is("bordered-content", border), ns.is("vertical-content", isVertical), align, className ], colSpan: isVertical ? span : span * 2 - 1, rowspan: isVertical ? rowspan * 2 - 1 : rowspan }, renderContent()), directives); default: { const label = renderLabel(); const labelStyle = {}; const width = addUnit(item.labelWidth ?? this.descriptions.labelWidth); if (width) { labelStyle.width = width; labelStyle.display = "inline-block"; } return withDirectives(h("td", { style, class: [ns.e("cell"), align], colSpan: span, rowspan }, [!isNil(label) ? h("span", { style: labelStyle, class: [ns.e("label"), labelClassName] }, label) : void 0, h("span", { class: [ns.e("content"), className] }, renderContent())]), directives); } } } }); const _hoisted_1$H = { key: 1 }; var descriptions_row_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElDescriptionsRow", __name: "descriptions-row", props: descriptionsRowProps, setup(__props) { const descriptions = inject(descriptionsKey, {}); return (_ctx, _cache) => { return unref(descriptions).direction === "vertical" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createBaseVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.row, (cell, _index) => { return openBlock(), createBlock(unref(descriptions_cell_default), { key: `tr1-${_index}`, cell, tag: "th", type: "label" }, null, 8, ["cell"]); }), 128))]), createBaseVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.row, (cell, _index) => { return openBlock(), createBlock(unref(descriptions_cell_default), { key: `tr2-${_index}`, cell, tag: "td", type: "content" }, null, 8, ["cell"]); }), 128))])], 64)) : (openBlock(), createElementBlock("tr", _hoisted_1$H, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.row, (cell, _index) => { return openBlock(), createElementBlock(Fragment, { key: `tr3-${_index}` }, [unref(descriptions).border ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(descriptions_cell_default), { cell, tag: "td", type: "label" }, null, 8, ["cell"]), createVNode(unref(descriptions_cell_default), { cell, tag: "td", type: "content" }, null, 8, ["cell"])], 64)) : (openBlock(), createBlock(unref(descriptions_cell_default), { key: 1, cell, tag: "td", type: "both" }, null, 8, ["cell"]))], 64); }), 128))])); }; } }); var descriptions_row_default = descriptions_row_vue_vue_type_script_setup_true_lang_default; var description_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElDescriptions", __name: "description", props: descriptionProps, setup(__props) { const props2 = __props; const ns = useNamespace("descriptions"); const descriptionsSize = useFormSize(); const slots = useSlots(); provide(descriptionsKey, props2); const descriptionKls = computed(() => [ns.b(), ns.m(descriptionsSize.value)]); const filledNode = (node, span, count, isLast = false) => { if (!node.props) node.props = {}; if (span > count) node.props.span = count; if (isLast) node.props.span = span; return node; }; const getRows = () => { if (!slots.default) return []; const children = flattedChildren(slots.default()).filter((node) => { var _a; return ((_a = node == null ? void 0 : node.type) == null ? void 0 : _a.name) === COMPONENT_NAME$a; }); const rows = []; let temp = []; let count = props2.column; let totalSpan = 0; const rowspanTemp = []; children.forEach((node, index) => { var _a, _b, _c; const span = ((_a = node.props) == null ? void 0 : _a.span) || 1; const rowspan = ((_b = node.props) == null ? void 0 : _b.rowspan) || 1; const rowNo = rows.length; rowspanTemp[rowNo] || (rowspanTemp[rowNo] = 0); if (rowspan > 1) for (let i = 1; i < rowspan; i++) { rowspanTemp[_c = rowNo + i] || (rowspanTemp[_c] = 0); rowspanTemp[rowNo + i]++; totalSpan++; } if (rowspanTemp[rowNo] > 0) { count -= rowspanTemp[rowNo]; rowspanTemp[rowNo] = 0; } if (index < children.length - 1) totalSpan += span > count ? count : span; if (index === children.length - 1) { const lastSpan = props2.column - totalSpan % props2.column; temp.push(filledNode(node, lastSpan, count, true)); rows.push(temp); return; } if (span < count) { count -= span; temp.push(node); } else { temp.push(filledNode(node, span, count)); rows.push(temp); count = props2.column; temp = []; } }); return rows; }; return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(descriptionKls.value) }, [__props.title || __props.extra || _ctx.$slots.title || _ctx.$slots.extra ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("header")) }, [createBaseVNode("div", { class: normalizeClass(unref(ns).e("title")) }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2), createBaseVNode("div", { class: normalizeClass(unref(ns).e("extra")) }, [renderSlot(_ctx.$slots, "extra", {}, () => [createTextVNode(toDisplayString(__props.extra), 1)])], 2)], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("body")) }, [createBaseVNode("table", { class: normalizeClass([unref(ns).e("table"), unref(ns).is("bordered", __props.border)]) }, [createBaseVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(getRows(), (row, _index) => { return openBlock(), createBlock(descriptions_row_default, { key: _index, row }, null, 8, ["row"]); }), 128))])], 2)], 2)], 2); }; } }); var description_default = description_vue_vue_type_script_setup_true_lang_default; const ElDescriptions = withInstall(description_default, { DescriptionsItem: DescriptionItem }); const ElDescriptionsItem = withNoopInstall(DescriptionItem); const dialogContentProps = buildProps({ center: Boolean, alignCenter: { type: Boolean, default: void 0 }, closeIcon: { type: iconPropType }, draggable: { type: Boolean, default: void 0 }, overflow: { type: Boolean, default: void 0 }, fullscreen: Boolean, headerClass: String, bodyClass: String, footerClass: String, showClose: { type: Boolean, default: true }, title: { type: String, default: "" }, ariaLevel: { type: String, default: "2" } }); const dialogContentEmits = { close: () => true }; const dialogProps = buildProps({ ...dialogContentProps, appendToBody: Boolean, appendTo: { type: teleportProps.to.type, default: "body" }, beforeClose: { type: definePropType(Function) }, destroyOnClose: Boolean, closeOnClickModal: { type: Boolean, default: true }, closeOnPressEscape: { type: Boolean, default: true }, lockScroll: { type: Boolean, default: true }, modal: { type: Boolean, default: true }, modalPenetrable: Boolean, openDelay: { type: Number, default: 0 }, closeDelay: { type: Number, default: 0 }, top: { type: String }, modelValue: Boolean, modalClass: String, headerClass: String, bodyClass: String, footerClass: String, width: { type: [String, Number] }, zIndex: { type: Number }, trapFocus: Boolean, headerAriaLevel: { type: String, default: "2" }, transition: { type: definePropType([String, Object]), default: void 0 } }); const dialogEmits = { open: () => true, opened: () => true, close: () => true, closed: () => true, [UPDATE_MODEL_EVENT]: (value) => isBoolean(value), openAutoFocus: () => true, closeAutoFocus: () => true }; const overlayProps = buildProps({ mask: { type: Boolean, default: true }, customMaskEvent: Boolean, overlayClass: { type: definePropType([ String, Array, Object ]) }, zIndex: { type: definePropType([String, Number]) } }); const overlayEmits = { click: (evt) => evt instanceof MouseEvent }; const BLOCK = "overlay"; var overlay_default = defineComponent({ name: "ElOverlay", props: overlayProps, emits: overlayEmits, setup(props2, { slots, emit }) { const ns = useNamespace(BLOCK); const onMaskClick = (e) => { emit("click", e); }; const { onClick, onMousedown, onMouseup } = useSameTarget(props2.customMaskEvent ? void 0 : onMaskClick); return () => { return props2.mask ? createVNode("div", { class: [ns.b(), props2.overlayClass], style: { zIndex: props2.zIndex }, onClick, onMousedown, onMouseup }, [renderSlot(slots, "default")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, [ "onClick", "onMouseup", "onMousedown" ]) : h("div", { class: props2.overlayClass, style: { zIndex: props2.zIndex, position: "fixed", top: "0px", right: "0px", bottom: "0px", left: "0px" } }, [renderSlot(slots, "default")]); }; } }); const ElOverlay = overlay_default; const dialogInjectionKey = Symbol("dialogInjectionKey"); const DEFAULT_DIALOG_TRANSITION = "dialog-fade"; const COMPONENT_NAME$9 = "ElDialog"; const useDialog = (props2, targetRef) => { const emit = getCurrentInstance().emit; const { nextZIndex } = useZIndex(); let lastPosition = ""; const titleId = useId(); const bodyId = useId(); const visible = ref(false); const closed = ref(false); const rendered = ref(false); const zIndex2 = ref(props2.zIndex ?? nextZIndex()); const closing = ref(false); let openTimer = void 0; let closeTimer = void 0; const config = useGlobalConfig(); const namespace = computed(() => { var _a; return ((_a = config.value) == null ? void 0 : _a.namespace) ?? defaultNamespace; }); const globalConfig2 = computed(() => { var _a; return (_a = config.value) == null ? void 0 : _a.dialog; }); const style = computed(() => { const style2 = {}; const varPrefix = `--${namespace.value}-dialog`; if (!props2.fullscreen) { if (props2.top) style2[`${varPrefix}-margin-top`] = props2.top; const width = addUnit(props2.width); if (width) style2[`${varPrefix}-width`] = width; } return style2; }); const _draggable = computed(() => { var _a; return (props2.draggable ?? ((_a = globalConfig2.value) == null ? void 0 : _a.draggable) ?? false) && !props2.fullscreen; }); const _alignCenter = computed(() => { var _a; return props2.alignCenter ?? ((_a = globalConfig2.value) == null ? void 0 : _a.alignCenter) ?? false; }); const _overflow = computed(() => { var _a; return props2.overflow ?? ((_a = globalConfig2.value) == null ? void 0 : _a.overflow) ?? false; }); const penetrable = computed(() => props2.modalPenetrable && !props2.modal && !props2.fullscreen); const overlayDialogStyle = computed(() => { if (_alignCenter.value) return { display: "flex" }; return {}; }); const transitionConfig = computed(() => { var _a; const transition = props2.transition ?? ((_a = globalConfig2.value) == null ? void 0 : _a.transition) ?? DEFAULT_DIALOG_TRANSITION; const baseConfig = { name: transition, onAfterEnter: afterEnter, onBeforeLeave: beforeLeave, onAfterLeave: afterLeave }; if (isObject(transition)) { const config2 = { ...transition }; const _mergeHook = (userHook, defaultHook) => { return (el) => { if (isArray(userHook)) userHook.forEach((fn) => { if (isFunction(fn)) fn(el); }); else if (isFunction(userHook)) userHook(el); defaultHook(); }; }; config2.onAfterEnter = _mergeHook(config2.onAfterEnter, afterEnter); config2.onBeforeLeave = _mergeHook(config2.onBeforeLeave, beforeLeave); config2.onAfterLeave = _mergeHook(config2.onAfterLeave, afterLeave); if (!config2.name) { config2.name = DEFAULT_DIALOG_TRANSITION; debugWarn(COMPONENT_NAME$9, `transition.name is missing when using object syntax, fallback to '${DEFAULT_DIALOG_TRANSITION}'`); } return config2; } return baseConfig; }); function afterEnter() { emit("opened"); } function afterLeave() { emit("closed"); emit(UPDATE_MODEL_EVENT, false); if (props2.destroyOnClose) rendered.value = false; closing.value = false; } function beforeLeave() { closing.value = true; emit("close"); } function open() { closeTimer == null ? void 0 : closeTimer(); openTimer == null ? void 0 : openTimer(); if (props2.openDelay && props2.openDelay > 0) ({ stop: openTimer } = useTimeoutFn(() => doOpen(), props2.openDelay)); else doOpen(); } function close2() { openTimer == null ? void 0 : openTimer(); closeTimer == null ? void 0 : closeTimer(); if (props2.closeDelay && props2.closeDelay > 0) ({ stop: closeTimer } = useTimeoutFn(() => doClose(), props2.closeDelay)); else doClose(); } function handleClose() { function hide(shouldCancel) { if (shouldCancel) return; closed.value = true; visible.value = false; } if (props2.beforeClose) props2.beforeClose(hide); else close2(); } function onModalClick() { if (props2.closeOnClickModal) handleClose(); } function doOpen() { if (!isClient) return; visible.value = true; } function doClose() { visible.value = false; } function onOpenAutoFocus() { emit("openAutoFocus"); } function onCloseAutoFocus() { emit("closeAutoFocus"); } function onFocusoutPrevented(event) { var _a; if (((_a = event.detail) == null ? void 0 : _a.focusReason) === "pointer") event.preventDefault(); } if (props2.lockScroll) useLockscreen(visible); function onCloseRequested() { if (props2.closeOnPressEscape) handleClose(); } function bringToFront() { if (!visible.value || !penetrable.value || props2.zIndex !== void 0) return; zIndex2.value = nextZIndex(); } watch(() => props2.zIndex, () => { zIndex2.value = props2.zIndex ?? nextZIndex(); }); watch(() => props2.modelValue, (val) => { if (val) { closed.value = false; closing.value = false; open(); rendered.value = true; zIndex2.value = props2.zIndex ?? nextZIndex(); nextTick(() => { emit("open"); if (targetRef.value) { targetRef.value.parentElement.scrollTop = 0; targetRef.value.parentElement.scrollLeft = 0; targetRef.value.scrollTop = 0; } }); } else if (visible.value) close2(); }); watch(() => props2.fullscreen, (val) => { if (!targetRef.value) return; if (val) { lastPosition = targetRef.value.style.transform; targetRef.value.style.transform = ""; } else targetRef.value.style.transform = lastPosition; }); onMounted(() => { if (props2.modelValue) { visible.value = true; rendered.value = true; open(); } }); return { afterEnter, afterLeave, beforeLeave, handleClose, onModalClick, close: close2, doClose, onOpenAutoFocus, onCloseAutoFocus, onCloseRequested, onFocusoutPrevented, bringToFront, titleId, bodyId, closed, style, overlayDialogStyle, rendered, visible, zIndex: zIndex2, transitionConfig, _draggable, _alignCenter, _overflow, closing, penetrable }; }; const composeRefs = (...refs) => { return (el) => { refs.forEach((ref2) => { ref2.value = el; }); }; }; const _hoisted_1$G = ["aria-level"]; const _hoisted_2$p = ["aria-label"]; const _hoisted_3$a = ["id"]; var dialog_content_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElDialogContent", __name: "dialog-content", props: dialogContentProps, emits: dialogContentEmits, setup(__props, { expose: __expose }) { const { t } = useLocale(); const { Close } = CloseComponents; const props2 = __props; const { dialogRef, headerRef, bodyId, ns, style } = inject(dialogInjectionKey); const { focusTrapRef } = inject(FOCUS_TRAP_INJECTION_KEY); const composedDialogRef = composeRefs(focusTrapRef, dialogRef); const draggable2 = computed(() => !!props2.draggable); const { resetPosition, updatePosition, isDragging: isDragging2 } = useDraggable(dialogRef, headerRef, draggable2, computed(() => !!props2.overflow)); const dialogKls = computed(() => [ ns.b(), ns.is("fullscreen", props2.fullscreen), ns.is("draggable", draggable2.value), ns.is("dragging", isDragging2.value), ns.is("align-center", !!props2.alignCenter), { [ns.m("center")]: props2.center } ]); __expose({ resetPosition, updatePosition }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref: unref(composedDialogRef), class: normalizeClass(dialogKls.value), style: normalizeStyle(unref(style)), tabindex: "-1" }, [ createBaseVNode("header", { ref_key: "headerRef", ref: headerRef, class: normalizeClass([ unref(ns).e("header"), __props.headerClass, { "show-close": __props.showClose } ]) }, [renderSlot(_ctx.$slots, "header", {}, () => [createBaseVNode("span", { role: "heading", "aria-level": __props.ariaLevel, class: normalizeClass(unref(ns).e("title")) }, toDisplayString(__props.title), 11, _hoisted_1$G)]), __props.showClose ? (openBlock(), createElementBlock("button", { key: 0, "aria-label": unref(t)("el.dialog.close"), class: normalizeClass(unref(ns).e("headerbtn")), type: "button", onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close")) }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).e("close")) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.closeIcon || unref(Close))))]), _: 1 }, 8, ["class"])], 10, _hoisted_2$p)) : createCommentVNode("v-if", true)], 2), createBaseVNode("div", { id: unref(bodyId), class: normalizeClass([unref(ns).e("body"), __props.bodyClass]) }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_3$a), _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", { key: 0, class: normalizeClass([unref(ns).e("footer"), __props.footerClass]) }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true) ], 6); }; } }); var dialog_content_default = dialog_content_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$F = [ "aria-label", "aria-labelledby", "aria-describedby" ]; var dialog_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElDialog", inheritAttrs: false, __name: "dialog", props: dialogProps, emits: dialogEmits, setup(__props, { expose: __expose }) { const props2 = __props; const slots = useSlots(); useDeprecated({ scope: "el-dialog", from: "the title slot", replacement: "the header slot", version: "3.0.0", ref: "https://element-plus.org/en-US/component/dialog.html#slots" }, computed(() => !!slots.title)); const ns = useNamespace("dialog"); const dialogRef = ref(); const headerRef = ref(); const dialogContentRef = ref(); const { visible, titleId, bodyId, style, overlayDialogStyle, rendered, transitionConfig, zIndex: zIndex2, _draggable, _alignCenter, _overflow, penetrable, handleClose, onModalClick, onOpenAutoFocus, onCloseAutoFocus, onCloseRequested, onFocusoutPrevented, bringToFront, closing } = useDialog(props2, dialogRef); provide(dialogInjectionKey, { dialogRef, headerRef, bodyId, ns, rendered, style }); const overlayEvent = useSameTarget(onModalClick); const resetPosition = () => { var _a; (_a = dialogContentRef.value) == null ? void 0 : _a.resetPosition(); }; __expose({ visible, dialogContentRef, resetPosition, handleClose }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTeleport), { to: __props.appendTo, disabled: __props.appendTo !== "body" ? false : !__props.appendToBody }, { default: withCtx(() => [createVNode(Transition, mergeProps(unref(transitionConfig), { persisted: "" }), { default: withCtx(() => [withDirectives(createVNode(unref(ElOverlay), { "custom-mask-event": "", mask: __props.modal, "overlay-class": [ __props.modalClass ?? "", `${unref(ns).namespace.value}-modal-dialog`, unref(ns).is("penetrable", unref(penetrable)) ], "z-index": unref(zIndex2) }, { default: withCtx(() => [createBaseVNode("div", { role: "dialog", "aria-modal": "true", "aria-label": __props.title || void 0, "aria-labelledby": !__props.title ? unref(titleId) : void 0, "aria-describedby": unref(bodyId), class: normalizeClass([`${unref(ns).namespace.value}-overlay-dialog`, unref(ns).is("closing", unref(closing))]), style: normalizeStyle(unref(overlayDialogStyle)), onClick: _cache[0] || (_cache[0] = (...args) => unref(overlayEvent).onClick && unref(overlayEvent).onClick(...args)), onMousedown: _cache[1] || (_cache[1] = (...args) => unref(overlayEvent).onMousedown && unref(overlayEvent).onMousedown(...args)), onMouseup: _cache[2] || (_cache[2] = (...args) => unref(overlayEvent).onMouseup && unref(overlayEvent).onMouseup(...args)) }, [createVNode(unref(focus_trap_default$1), { loop: "", trapped: unref(visible), "focus-start-el": "container", onFocusAfterTrapped: unref(onOpenAutoFocus), onFocusAfterReleased: unref(onCloseAutoFocus), onFocusoutPrevented: unref(onFocusoutPrevented), onReleaseRequested: unref(onCloseRequested) }, { default: withCtx(() => [unref(rendered) ? (openBlock(), createBlock(dialog_content_default, mergeProps({ key: 0, ref_key: "dialogContentRef", ref: dialogContentRef }, _ctx.$attrs, { center: __props.center, "align-center": unref(_alignCenter), "close-icon": __props.closeIcon, draggable: unref(_draggable), overflow: unref(_overflow), fullscreen: __props.fullscreen, "header-class": __props.headerClass, "body-class": __props.bodyClass, "footer-class": __props.footerClass, "show-close": __props.showClose, title: __props.title, "aria-level": __props.headerAriaLevel, onClose: unref(handleClose), onMousedown: unref(bringToFront) }), createSlots({ header: withCtx(() => [!_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", { key: 0, close: unref(handleClose), titleId: unref(titleId), titleClass: unref(ns).e("title") }) : renderSlot(_ctx.$slots, "title", { key: 1 })]), default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 2 }, [_ctx.$slots.footer ? { name: "footer", fn: withCtx(() => [renderSlot(_ctx.$slots, "footer")]), key: "0" } : void 0]), 1040, [ "center", "align-center", "close-icon", "draggable", "overflow", "fullscreen", "header-class", "body-class", "footer-class", "show-close", "title", "aria-level", "onClose", "onMousedown" ])) : createCommentVNode("v-if", true)]), _: 3 }, 8, [ "trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested" ])], 46, _hoisted_1$F)]), _: 3 }, 8, [ "mask", "overlay-class", "z-index" ]), [[vShow, unref(visible)]])]), _: 3 }, 16)]), _: 3 }, 8, ["to", "disabled"]); }; } }); var dialog_default = dialog_vue_vue_type_script_setup_true_lang_default; const ElDialog = withInstall(dialog_default); const dividerProps = buildProps({ direction: { type: String, values: ["horizontal", "vertical"], default: "horizontal" }, contentPosition: { type: String, values: [ "left", "center", "right" ], default: "center" }, borderStyle: { type: definePropType(String), default: "solid" } }); var divider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElDivider", __name: "divider", props: dividerProps, setup(__props) { const props2 = __props; const ns = useNamespace("divider"); const dividerStyle = computed(() => { return ns.cssVar({ "border-style": props2.borderStyle }); }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b(), unref(ns).m(__props.direction)]), style: normalizeStyle(dividerStyle.value), role: "separator" }, [_ctx.$slots.default && __props.direction !== "vertical" ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass([unref(ns).e("text"), unref(ns).is(__props.contentPosition)]) }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true)], 6); }; } }); var divider_default = divider_vue_vue_type_script_setup_true_lang_default; const ElDivider = withInstall(divider_default); const drawerProps = buildProps({ ...dialogProps, direction: { type: String, default: "rtl", values: [ "ltr", "rtl", "ttb", "btt" ] }, resizable: Boolean, size: { type: [String, Number], default: "30%" }, withHeader: { type: Boolean, default: true }, modalFade: { type: Boolean, default: true }, headerAriaLevel: { type: String, default: "2" } }); const drawerEmits = { ...dialogEmits, "resize-start": (evt, size) => evt instanceof MouseEvent && typeof size === "number", resize: (evt, size) => evt instanceof MouseEvent && typeof size === "number", "resize-end": (evt, size) => evt instanceof MouseEvent && typeof size === "number" }; function useResizable(props2, target, emit) { const { width, height } = useWindowSize(); const isHorizontal2 = computed(() => ["ltr", "rtl"].includes(props2.direction)); const sign = computed(() => ["ltr", "ttb"].includes(props2.direction) ? 1 : -1); const windowSize = computed(() => isHorizontal2.value ? width.value : height.value); const getSize = computed(() => { return clamp$1(startSize.value + sign.value * offset2.value, 4, windowSize.value); }); const startSize = ref(0); const offset2 = ref(0); const isResizing = ref(false); const hasStartedDragging = ref(false); let startPos = []; let cleanups = []; const getActualSize = () => { var _a; const drawerEl = (_a = target.value) == null ? void 0 : _a.closest('[aria-modal="true"]'); if (drawerEl) return isHorizontal2.value ? drawerEl.offsetWidth : drawerEl.offsetHeight; return 100; }; watch(() => [props2.size, props2.resizable], () => { hasStartedDragging.value = false; startSize.value = 0; offset2.value = 0; onMouseUp(); }); const onMousedown = (e) => { if (!props2.resizable) return; if (!hasStartedDragging.value) { startSize.value = getActualSize(); hasStartedDragging.value = true; } startPos = [e.pageX, e.pageY]; isResizing.value = true; emit("resize-start", e, startSize.value); cleanups.push(useEventListener(window, "mouseup", onMouseUp), useEventListener(window, "mousemove", onMouseMove)); }; const onMouseMove = (e) => { const { pageX, pageY } = e; const offsetX = pageX - startPos[0]; const offsetY = pageY - startPos[1]; offset2.value = isHorizontal2.value ? offsetX : offsetY; emit("resize", e, getSize.value); }; const onMouseUp = (e) => { if (!isResizing.value) return; startPos = []; startSize.value = getSize.value; offset2.value = 0; isResizing.value = false; cleanups.forEach((cleanup2) => cleanup2 == null ? void 0 : cleanup2()); cleanups = []; if (e) emit("resize-end", e, startSize.value); }; const cleanup = useEventListener(target, "mousedown", onMousedown); onBeforeUnmount(() => { cleanup(); onMouseUp(); }); return { size: computed(() => { return hasStartedDragging.value ? `${getSize.value}px` : addUnit(props2.size); }), isResizing, isHorizontal: isHorizontal2 }; } const _hoisted_1$E = [ "aria-label", "aria-labelledby", "aria-describedby" ]; const _hoisted_2$o = ["id", "aria-level"]; const _hoisted_3$9 = ["aria-label"]; const _hoisted_4$7 = ["id"]; var drawer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElDrawer", inheritAttrs: false, __name: "drawer", props: drawerProps, emits: drawerEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const slots = useSlots(); useDeprecated({ scope: "el-drawer", from: "the title slot", replacement: "the header slot", version: "3.0.0", ref: "https://element-plus.org/en-US/component/drawer.html#slots" }, computed(() => !!slots.title)); const drawerRef = ref(); const focusStartRef = ref(); const draggerRef = ref(); const ns = useNamespace("drawer"); const { t } = useLocale(); const { afterEnter, afterLeave, beforeLeave, visible, rendered, titleId, bodyId, zIndex: zIndex2, onModalClick, onOpenAutoFocus, onCloseAutoFocus, onFocusoutPrevented, onCloseRequested, handleClose } = useDialog(props2, drawerRef); const { isHorizontal: isHorizontal2, size, isResizing } = useResizable(props2, draggerRef, emit); const penetrable = computed(() => props2.modalPenetrable && !props2.modal); __expose({ handleClose, afterEnter, afterLeave }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTeleport), { to: __props.appendTo, disabled: __props.appendTo !== "body" ? false : !__props.appendToBody }, { default: withCtx(() => [createVNode(Transition, { name: unref(ns).b("fade"), onAfterEnter: unref(afterEnter), onAfterLeave: unref(afterLeave), onBeforeLeave: unref(beforeLeave), persisted: "" }, { default: withCtx(() => [withDirectives(createVNode(unref(ElOverlay), { mask: __props.modal, "overlay-class": [ unref(ns).is("drawer"), __props.modalClass ?? "", `${unref(ns).namespace.value}-modal-drawer`, unref(ns).is("penetrable", penetrable.value) ], "z-index": unref(zIndex2), onClick: unref(onModalClick) }, { default: withCtx(() => [createVNode(unref(focus_trap_default$1), { loop: "", trapped: unref(visible), "focus-trap-el": drawerRef.value, "focus-start-el": focusStartRef.value, onFocusAfterTrapped: unref(onOpenAutoFocus), onFocusAfterReleased: unref(onCloseAutoFocus), onFocusoutPrevented: unref(onFocusoutPrevented), onReleaseRequested: unref(onCloseRequested) }, { default: withCtx(() => [createBaseVNode("div", mergeProps({ ref_key: "drawerRef", ref: drawerRef, "aria-modal": "true", "aria-label": __props.title || void 0, "aria-labelledby": !__props.title ? unref(titleId) : void 0, "aria-describedby": unref(bodyId) }, _ctx.$attrs, { class: [ unref(ns).b(), __props.direction, unref(visible) && "open", unref(ns).is("dragging", unref(isResizing)) ], style: { [unref(isHorizontal2) ? "width" : "height"]: unref(size) }, role: "dialog", onClick: _cache[1] || (_cache[1] = withModifiers(() => { }, ["stop"])) }), [ createBaseVNode("span", { ref_key: "focusStartRef", ref: focusStartRef, class: normalizeClass(unref(ns).e("sr-focus")), tabindex: "-1" }, null, 2), __props.withHeader ? (openBlock(), createElementBlock("header", { key: 0, class: normalizeClass([unref(ns).e("header"), __props.headerClass]) }, [!_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", { key: 0, close: unref(handleClose), titleId: unref(titleId), titleClass: unref(ns).e("title") }, () => [createBaseVNode("span", { id: unref(titleId), role: "heading", "aria-level": __props.headerAriaLevel, class: normalizeClass(unref(ns).e("title")) }, toDisplayString(__props.title), 11, _hoisted_2$o)]) : renderSlot(_ctx.$slots, "title", { key: 1 }, () => [createCommentVNode(" DEPRECATED SLOT ")]), __props.showClose ? (openBlock(), createElementBlock("button", { key: 2, "aria-label": unref(t)("el.drawer.close"), class: normalizeClass(unref(ns).e("close-btn")), type: "button", onClick: _cache[0] || (_cache[0] = (...args) => unref(handleClose) && unref(handleClose)(...args)) }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).e("close")) }, { default: withCtx(() => [createVNode(unref(close_default))]), _: 1 }, 8, ["class"])], 10, _hoisted_3$9)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true), unref(rendered) ? (openBlock(), createElementBlock("div", { key: 1, id: unref(bodyId), class: normalizeClass([unref(ns).e("body"), __props.bodyClass]) }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_4$7)) : createCommentVNode("v-if", true), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass([unref(ns).e("footer"), __props.footerClass]) }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true), __props.resizable ? (openBlock(), createElementBlock("div", { key: 3, ref_key: "draggerRef", ref: draggerRef, style: normalizeStyle({ zIndex: unref(zIndex2) }), class: normalizeClass(unref(ns).e("dragger")) }, null, 6)) : createCommentVNode("v-if", true) ], 16, _hoisted_1$E)]), _: 3 }, 8, [ "trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested" ])]), _: 3 }, 8, [ "mask", "overlay-class", "z-index", "onClick" ]), [[vShow, unref(visible)]])]), _: 3 }, 8, [ "name", "onAfterEnter", "onAfterLeave", "onBeforeLeave" ])]), _: 3 }, 8, ["to", "disabled"]); }; } }); var drawer_default = drawer_vue_vue_type_script_setup_true_lang_default; const ElDrawer = withInstall(drawer_default); const dropdownProps = buildProps({ trigger: { ...useTooltipTriggerProps.trigger, type: definePropType([String, Array]) }, triggerKeys: { type: definePropType(Array), default: () => [ EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space, EVENT_CODE.down ] }, virtualTriggering: useTooltipTriggerProps.virtualTriggering, virtualRef: useTooltipTriggerProps.virtualRef, effect: { ...useTooltipContentProps.effect, default: "light" }, type: { type: definePropType(String) }, placement: { type: definePropType(String), default: "bottom" }, popperOptions: { type: definePropType(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: true }, loop: { type: Boolean, default: true }, showArrow: { type: Boolean, default: true }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: definePropType([Number, String]), default: 0 }, maxHeight: { type: definePropType([Number, String]), default: "" }, popperClass: useTooltipContentProps.popperClass, popperStyle: useTooltipContentProps.popperStyle, disabled: Boolean, role: { type: String, values: roleTypes, default: "menu" }, buttonProps: { type: definePropType(Object) }, teleported: useTooltipContentProps.teleported, appendTo: useTooltipContentProps.appendTo, persistent: { type: Boolean, default: true } }); const dropdownItemProps = buildProps({ command: { type: [ Object, String, Number ], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: iconPropType } }); const dropdownMenuProps = buildProps({ onKeydown: { type: definePropType(Function) } }); const DROPDOWN_INJECTION_KEY = Symbol("elDropdown"); const DROPDOWN_INSTANCE_INJECTION_KEY = "elDropdown"; var collection_vue_vue_type_script_lang_default = defineComponent({ inheritAttrs: false }); function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) { return renderSlot(_ctx.$slots, "default"); } var collection_default = /* @__PURE__ */ _plugin_vue_export_helper_default(collection_vue_vue_type_script_lang_default, [["render", _sfc_render$g]]); var collection_item_vue_vue_type_script_lang_default = defineComponent({ name: "ElCollectionItem", inheritAttrs: false }); function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) { return renderSlot(_ctx.$slots, "default"); } var collection_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(collection_item_vue_vue_type_script_lang_default, [["render", _sfc_render$f]]); const COLLECTION_ITEM_SIGN = `data-el-collection-item`; const createCollectionWithScope = (name) => { const COLLECTION_NAME = `El${name}Collection`; const COLLECTION_ITEM_NAME = `${COLLECTION_NAME}Item`; const COLLECTION_INJECTION_KEY2 = Symbol(COLLECTION_NAME); const COLLECTION_ITEM_INJECTION_KEY2 = Symbol(COLLECTION_ITEM_NAME); return { COLLECTION_INJECTION_KEY: COLLECTION_INJECTION_KEY2, COLLECTION_ITEM_INJECTION_KEY: COLLECTION_ITEM_INJECTION_KEY2, ElCollection: Object.assign({}, collection_default, { name: COLLECTION_NAME, setup() { const collectionRef = ref(); const itemMap = /* @__PURE__ */ new Map(); const getItems = (() => { const collectionEl = unref(collectionRef); if (!collectionEl) return []; const orderedNodes = Array.from(collectionEl.querySelectorAll(`[${COLLECTION_ITEM_SIGN}]`)); return [...itemMap.values()].sort((a, b) => orderedNodes.indexOf(a.ref) - orderedNodes.indexOf(b.ref)); }); provide(COLLECTION_INJECTION_KEY2, { itemMap, getItems, collectionRef }); } }), ElCollectionItem: Object.assign({}, collection_item_default, { name: COLLECTION_ITEM_NAME, setup(_, { attrs }) { const collectionItemRef = ref(); const collectionInjection = inject(COLLECTION_INJECTION_KEY2, void 0); provide(COLLECTION_ITEM_INJECTION_KEY2, { collectionItemRef }); onMounted(() => { const collectionItemEl = unref(collectionItemRef); if (collectionItemEl) collectionInjection.itemMap.set(collectionItemEl, { ref: collectionItemEl, ...attrs }); }); onBeforeUnmount(() => { const collectionItemEl = unref(collectionItemRef); collectionInjection.itemMap.delete(collectionItemEl); }); } }) }; }; const rovingFocusGroupProps = buildProps({ style: { type: definePropType([ String, Array, Object ]) }, currentTabId: { type: definePropType(String) }, defaultCurrentTabId: String, loop: Boolean, dir: { type: String, values: ["ltr", "rtl"], default: "ltr" }, orientation: { type: definePropType(String) }, onBlur: Function, onFocus: Function, onMousedown: Function }); const { ElCollection, ElCollectionItem, COLLECTION_INJECTION_KEY, COLLECTION_ITEM_INJECTION_KEY } = createCollectionWithScope("RovingFocusGroup"); const ROVING_FOCUS_GROUP_INJECTION_KEY = Symbol("elRovingFocusGroup"); const ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY = Symbol("elRovingFocusGroupItem"); const MAP_KEY_TO_FOCUS_INTENT = { ArrowLeft: "prev", ArrowUp: "prev", ArrowRight: "next", ArrowDown: "next", PageUp: "first", Home: "first", PageDown: "last", End: "last" }; const getDirectionAwareKey = (key, dir) => { return key; }; const getFocusIntent = (event, orientation, dir) => { const key = getDirectionAwareKey(getEventCode(event)); return MAP_KEY_TO_FOCUS_INTENT[key]; }; const reorderArray = (array, atIdx) => { return array.map((_, idx) => array[(idx + atIdx) % array.length]); }; const focusFirst = (elements) => { const { activeElement: prevActive } = document; for (const element of elements) { if (element === prevActive) return; element.focus(); if (prevActive !== document.activeElement) return; } }; const CURRENT_TAB_ID_CHANGE_EVT = "currentTabIdChange"; const ENTRY_FOCUS_EVT = "rovingFocusGroup.entryFocus"; const EVT_OPTS = { bubbles: false, cancelable: true }; var roving_focus_group_impl_vue_vue_type_script_lang_default = defineComponent({ name: "ElRovingFocusGroupImpl", inheritAttrs: false, props: rovingFocusGroupProps, emits: [CURRENT_TAB_ID_CHANGE_EVT, "entryFocus"], setup(props2, { emit }) { const currentTabbedId = ref((props2.currentTabId || props2.defaultCurrentTabId) ?? null); const isBackingOut = ref(false); const isClickFocus = ref(false); const rovingFocusGroupRef = ref(); const { getItems } = inject(COLLECTION_INJECTION_KEY, void 0); const rovingFocusGroupRootStyle = computed(() => { return [{ outline: "none" }, props2.style]; }); const onItemFocus = (tabbedId) => { emit(CURRENT_TAB_ID_CHANGE_EVT, tabbedId); }; const onItemShiftTab = () => { isBackingOut.value = true; }; const onMousedown = composeEventHandlers((e) => { var _a; (_a = props2.onMousedown) == null ? void 0 : _a.call(props2, e); }, () => { isClickFocus.value = true; }); const onFocus = composeEventHandlers((e) => { var _a; (_a = props2.onFocus) == null ? void 0 : _a.call(props2, e); }, (e) => { const isKeyboardFocus = !unref(isClickFocus); const { target, currentTarget } = e; if (target === currentTarget && isKeyboardFocus && !unref(isBackingOut)) { const entryFocusEvt = new Event(ENTRY_FOCUS_EVT, EVT_OPTS); currentTarget == null ? void 0 : currentTarget.dispatchEvent(entryFocusEvt); if (!entryFocusEvt.defaultPrevented) { const items = getItems().filter((item) => item.focusable); focusFirst([ items.find((item) => item.active), items.find((item) => item.id === unref(currentTabbedId)), ...items ].filter(Boolean).map((item) => item.ref)); } } isClickFocus.value = false; }); const onBlur = composeEventHandlers((e) => { var _a; (_a = props2.onBlur) == null ? void 0 : _a.call(props2, e); }, () => { isBackingOut.value = false; }); const handleEntryFocus = (...args) => { emit("entryFocus", ...args); }; const onKeydown = (e) => { const focusIntent = getFocusIntent(e); if (focusIntent) { e.preventDefault(); let elements = getItems().filter((item) => item.focusable).map((item) => item.ref); switch (focusIntent) { case "last": elements.reverse(); break; case "prev": case "next": { if (focusIntent === "prev") elements.reverse(); const currentIdx = elements.indexOf(e.currentTarget); elements = props2.loop ? reorderArray(elements, currentIdx + 1) : elements.slice(currentIdx + 1); break; } } nextTick(() => { focusFirst(elements); }); } }; provide(ROVING_FOCUS_GROUP_INJECTION_KEY, { currentTabbedId: readonly(currentTabbedId), loop: toRef(props2, "loop"), tabIndex: computed(() => { return unref(isBackingOut) ? -1 : 0; }), rovingFocusGroupRef, rovingFocusGroupRootStyle, orientation: toRef(props2, "orientation"), dir: toRef(props2, "dir"), onItemFocus, onItemShiftTab, onBlur, onFocus, onMousedown, onKeydown }); watch(() => props2.currentTabId, (val) => { currentTabbedId.value = val ?? null; }); useEventListener(rovingFocusGroupRef, ENTRY_FOCUS_EVT, handleEntryFocus); } }); function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) { return renderSlot(_ctx.$slots, "default"); } var roving_focus_group_impl_default = /* @__PURE__ */ _plugin_vue_export_helper_default(roving_focus_group_impl_vue_vue_type_script_lang_default, [["render", _sfc_render$e]]); var roving_focus_group_vue_vue_type_script_lang_default = defineComponent({ name: "ElRovingFocusGroup", components: { ElFocusGroupCollection: ElCollection, ElRovingFocusGroupImpl: roving_focus_group_impl_default } }); function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_roving_focus_group_impl = resolveComponent("el-roving-focus-group-impl"); const _component_el_focus_group_collection = resolveComponent("el-focus-group-collection"); return openBlock(), createBlock(_component_el_focus_group_collection, null, { default: withCtx(() => [createVNode(_component_el_roving_focus_group_impl, normalizeProps(guardReactiveProps(_ctx.$attrs)), { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 16)]), _: 3 }); } var roving_focus_group_default = /* @__PURE__ */ _plugin_vue_export_helper_default(roving_focus_group_vue_vue_type_script_lang_default, [["render", _sfc_render$d]]); var roving_focus_item_vue_vue_type_script_lang_default = defineComponent({ components: { ElRovingFocusCollectionItem: ElCollectionItem }, props: { focusable: { type: Boolean, default: true }, active: Boolean }, emits: [ "mousedown", "focus", "keydown" ], setup(props2, { emit }) { const { currentTabbedId, onItemFocus, onItemShiftTab, onKeydown } = inject(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0); const id = useId(); const rovingFocusGroupItemRef = ref(); const handleMousedown = composeEventHandlers((e) => { emit("mousedown", e); }, (e) => { if (!props2.focusable) e.preventDefault(); else onItemFocus(unref(id)); }); const handleFocus = composeEventHandlers((e) => { emit("focus", e); }, () => { onItemFocus(unref(id)); }); const handleKeydown = composeEventHandlers((e) => { emit("keydown", e); }, (e) => { const { shiftKey, target, currentTarget } = e; if (getEventCode(e) === EVENT_CODE.tab && shiftKey) { onItemShiftTab(); return; } if (target !== currentTarget) return; onKeydown(e); }); const isCurrentTab = computed(() => currentTabbedId.value === unref(id)); provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, { rovingFocusGroupItemRef, tabIndex: computed(() => unref(isCurrentTab) ? 0 : -1), handleMousedown, handleFocus, handleKeydown }); return { id, handleKeydown, handleFocus, handleMousedown }; } }); function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_roving_focus_collection_item = resolveComponent("el-roving-focus-collection-item"); return openBlock(), createBlock(_component_el_roving_focus_collection_item, { id: _ctx.id, focusable: _ctx.focusable, active: _ctx.active }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "id", "focusable", "active" ]); } var roving_focus_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(roving_focus_item_vue_vue_type_script_lang_default, [["render", _sfc_render$c]]); var roving_focus_group_default$1 = roving_focus_group_default; const { ButtonGroup: ElButtonGroup } = ElButton; var dropdown_vue_vue_type_script_lang_default = defineComponent({ name: "ElDropdown", components: { ElButton, ElButtonGroup, ElScrollbar, ElTooltip, ElRovingFocusGroup: roving_focus_group_default$1, ElOnlyChild: OnlyChild, ElIcon, ArrowDown: arrow_down_default }, props: dropdownProps, emits: [ "visible-change", "click", "command" ], setup(props2, { emit }) { const _instance = getCurrentInstance(); const ns = useNamespace("dropdown"); const { t } = useLocale(); const triggeringElementRef = ref(); const referenceElementRef = ref(); const popperRef = ref(); const contentRef = ref(); const scrollbar = ref(null); const currentTabId = ref(null); const isUsingKeyboard = ref(false); const wrapStyle = computed(() => ({ maxHeight: addUnit(props2.maxHeight) })); const dropdownTriggerKls = computed(() => [ns.m(dropdownSize.value)]); const trigger = computed(() => castArray$1(props2.trigger)); const defaultTriggerId = useId().value; const triggerId = computed(() => props2.id || defaultTriggerId); function handleClick() { var _a; (_a = popperRef.value) == null ? void 0 : _a.onClose(void 0, 0); } function handleClose() { var _a; (_a = popperRef.value) == null ? void 0 : _a.onClose(); } function handleOpen() { var _a; (_a = popperRef.value) == null ? void 0 : _a.onOpen(); } const dropdownSize = useFormSize(); function commandHandler(...args) { emit("command", ...args); } function onItemEnter() { } function onItemLeave() { const contentEl = unref(contentRef); trigger.value.includes("hover") && (contentEl == null ? void 0 : contentEl.focus({ preventScroll: true })); currentTabId.value = null; } function handleCurrentTabIdChange(id) { currentTabId.value = id; } function handleBeforeShowTooltip() { emit("visible-change", true); } function handleShowTooltip(event) { var _a; isUsingKeyboard.value = (event == null ? void 0 : event.type) === "keydown"; (_a = contentRef.value) == null ? void 0 : _a.focus(); } function handleBeforeHideTooltip() { emit("visible-change", false); } provide(DROPDOWN_INJECTION_KEY, { contentRef, role: computed(() => props2.role), triggerId, isUsingKeyboard, onItemEnter, onItemLeave, handleClose }); provide(DROPDOWN_INSTANCE_INJECTION_KEY, { instance: _instance, dropdownSize, handleClick, commandHandler, trigger: toRef(props2, "trigger"), hideOnClick: toRef(props2, "hideOnClick") }); const handlerMainButtonClick = (event) => { emit("click", event); }; return { t, ns, scrollbar, wrapStyle, dropdownTriggerKls, dropdownSize, triggerId, currentTabId, handleCurrentTabIdChange, handlerMainButtonClick, handleClose, handleOpen, handleBeforeShowTooltip, handleShowTooltip, handleBeforeHideTooltip, popperRef, contentRef, triggeringElementRef, referenceElementRef }; } }); function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_roving_focus_group = resolveComponent("el-roving-focus-group"); const _component_el_scrollbar = resolveComponent("el-scrollbar"); const _component_el_only_child = resolveComponent("el-only-child"); const _component_el_tooltip = resolveComponent("el-tooltip"); const _component_el_button = resolveComponent("el-button"); const _component_arrow_down = resolveComponent("arrow-down"); const _component_el_icon = resolveComponent("el-icon"); const _component_el_button_group = resolveComponent("el-button-group"); return openBlock(), createElementBlock("div", { class: normalizeClass([_ctx.ns.b(), _ctx.ns.is("disabled", _ctx.disabled)]) }, [createVNode(_component_el_tooltip, { ref: "popperRef", role: _ctx.role, effect: _ctx.effect, "fallback-placements": ["bottom", "top"], "popper-options": _ctx.popperOptions, "gpu-acceleration": false, placement: _ctx.placement, "popper-class": [_ctx.ns.e("popper"), _ctx.popperClass], "popper-style": _ctx.popperStyle, trigger: _ctx.trigger, "trigger-keys": _ctx.triggerKeys, "trigger-target-el": _ctx.contentRef, "show-arrow": _ctx.showArrow, "show-after": _ctx.trigger === "hover" ? _ctx.showTimeout : 0, "hide-after": _ctx.trigger === "hover" ? _ctx.hideTimeout : 0, "virtual-ref": _ctx.virtualRef ?? _ctx.triggeringElementRef, "virtual-triggering": _ctx.virtualTriggering || _ctx.splitButton, disabled: _ctx.disabled, transition: `${_ctx.ns.namespace.value}-zoom-in-top`, teleported: _ctx.teleported, "append-to": _ctx.appendTo, pure: "", "focus-on-target": "", persistent: _ctx.persistent, onBeforeShow: _ctx.handleBeforeShowTooltip, onShow: _ctx.handleShowTooltip, onBeforeHide: _ctx.handleBeforeHideTooltip }, createSlots({ content: withCtx(() => [createVNode(_component_el_scrollbar, { ref: "scrollbar", "wrap-style": _ctx.wrapStyle, tag: "div", "view-class": _ctx.ns.e("list") }, { default: withCtx(() => [createVNode(_component_el_roving_focus_group, { loop: _ctx.loop, "current-tab-id": _ctx.currentTabId, orientation: "horizontal", onCurrentTabIdChange: _ctx.handleCurrentTabIdChange }, { default: withCtx(() => [renderSlot(_ctx.$slots, "dropdown")]), _: 3 }, 8, [ "loop", "current-tab-id", "onCurrentTabIdChange" ])]), _: 3 }, 8, ["wrap-style", "view-class"])]), _: 2 }, [!_ctx.splitButton ? { name: "default", fn: withCtx(() => [createVNode(_component_el_only_child, { id: _ctx.triggerId, ref: "triggeringElementRef", role: "button", tabindex: _ctx.tabindex }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, ["id", "tabindex"])]), key: "0" } : void 0]), 1032, [ "role", "effect", "popper-options", "placement", "popper-class", "popper-style", "trigger", "trigger-keys", "trigger-target-el", "show-arrow", "show-after", "hide-after", "virtual-ref", "virtual-triggering", "disabled", "transition", "teleported", "append-to", "persistent", "onBeforeShow", "onShow", "onBeforeHide" ]), _ctx.splitButton ? (openBlock(), createBlock(_component_el_button_group, { key: 0 }, { default: withCtx(() => [createVNode(_component_el_button, mergeProps({ ref: "referenceElementRef" }, _ctx.buttonProps, { size: _ctx.dropdownSize, type: _ctx.type, disabled: _ctx.disabled, tabindex: _ctx.tabindex, onClick: _ctx.handlerMainButtonClick }), { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "size", "type", "disabled", "tabindex", "onClick" ]), createVNode(_component_el_button, mergeProps({ id: _ctx.triggerId, ref: "triggeringElementRef" }, _ctx.buttonProps, { role: "button", size: _ctx.dropdownSize, type: _ctx.type, class: _ctx.ns.e("caret-button"), disabled: _ctx.disabled, tabindex: _ctx.tabindex, "aria-label": _ctx.t("el.dropdown.toggleDropdown") }), { default: withCtx(() => [createVNode(_component_el_icon, { class: normalizeClass(_ctx.ns.e("icon")) }, { default: withCtx(() => [createVNode(_component_arrow_down)]), _: 1 }, 8, ["class"])]), _: 1 }, 16, [ "id", "size", "type", "class", "disabled", "tabindex", "aria-label" ])]), _: 3 })) : createCommentVNode("v-if", true)], 2); } var dropdown_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_vue_vue_type_script_lang_default, [["render", _sfc_render$b]]); var dropdown_item_impl_vue_vue_type_script_lang_default = defineComponent({ name: "DropdownItemImpl", components: { ElIcon }, props: dropdownItemProps, emits: [ "pointermove", "pointerleave", "click", "clickimpl" ], setup(_, { emit }) { const ns = useNamespace("dropdown"); const { role: menuRole } = inject(DROPDOWN_INJECTION_KEY, void 0); const { collectionItemRef: rovingFocusCollectionItemRef } = inject(COLLECTION_ITEM_INJECTION_KEY, void 0); const { rovingFocusGroupItemRef, tabIndex, handleFocus, handleKeydown: handleItemKeydown, handleMousedown } = inject(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, void 0); const itemRef = composeRefs(rovingFocusCollectionItemRef, rovingFocusGroupItemRef); const role = computed(() => { if (menuRole.value === "menu") return "menuitem"; else if (menuRole.value === "navigation") return "link"; return "button"; }); const handleKeydown = composeEventHandlers((e) => { const code = getEventCode(e); if ([ EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space ].includes(code)) { e.preventDefault(); e.stopImmediatePropagation(); emit("clickimpl", e); return true; } }, handleItemKeydown); return { ns, itemRef, dataset: { [COLLECTION_ITEM_SIGN]: "" }, role, tabIndex, handleFocus, handleKeydown, handleMousedown }; } }); const _hoisted_1$D = [ "aria-disabled", "tabindex", "role" ]; function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_icon = resolveComponent("el-icon"); return openBlock(), createElementBlock(Fragment, null, [_ctx.divided ? (openBlock(), createElementBlock("li", { key: 0, role: "separator", class: normalizeClass(_ctx.ns.bem("menu", "item", "divided")) }, null, 2)) : createCommentVNode("v-if", true), createBaseVNode("li", mergeProps({ ref: _ctx.itemRef }, { ..._ctx.dataset, ..._ctx.$attrs }, { "aria-disabled": _ctx.disabled, class: [_ctx.ns.be("menu", "item"), _ctx.ns.is("disabled", _ctx.disabled)], tabindex: _ctx.tabIndex, role: _ctx.role, onClick: _cache[0] || (_cache[0] = (e) => _ctx.$emit("clickimpl", e)), onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)), onKeydown: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args), ["self"])), onMousedown: _cache[3] || (_cache[3] = (...args) => _ctx.handleMousedown && _ctx.handleMousedown(...args)), onPointermove: _cache[4] || (_cache[4] = (e) => _ctx.$emit("pointermove", e)), onPointerleave: _cache[5] || (_cache[5] = (e) => _ctx.$emit("pointerleave", e)) }), [_ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, { default: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))])]), _: 3 })) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 16, _hoisted_1$D)], 64); } var dropdown_item_impl_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_item_impl_vue_vue_type_script_lang_default, [["render", _sfc_render$a]]); const useDropdown = () => { const elDropdown = inject(DROPDOWN_INSTANCE_INJECTION_KEY, {}); return { elDropdown, _elDropdownSize: computed(() => elDropdown == null ? void 0 : elDropdown.dropdownSize) }; }; var dropdown_item_vue_vue_type_script_lang_default = defineComponent({ name: "ElDropdownItem", components: { ElRovingFocusItem: roving_focus_item_default, ElDropdownItemImpl: dropdown_item_impl_default }, inheritAttrs: false, props: dropdownItemProps, emits: [ "pointermove", "pointerleave", "click" ], setup(props2, { emit, attrs }) { const { elDropdown } = useDropdown(); const _instance = getCurrentInstance(); const { onItemEnter, onItemLeave } = inject(DROPDOWN_INJECTION_KEY, void 0); const handlePointerMove = composeEventHandlers((e) => { emit("pointermove", e); return e.defaultPrevented; }, whenMouse((e) => { if (props2.disabled) { onItemLeave(e); return; } const target = e.currentTarget; if (target === document.activeElement || target.contains(document.activeElement)) return; onItemEnter(e); if (!e.defaultPrevented) target == null ? void 0 : target.focus({ preventScroll: true }); })); const handlePointerLeave = composeEventHandlers((e) => { emit("pointerleave", e); return e.defaultPrevented; }, whenMouse(onItemLeave)); return { handleClick: composeEventHandlers((e) => { if (props2.disabled) return; emit("click", e); return e.type !== "keydown" && e.defaultPrevented; }, (e) => { var _a, _b, _c; if (props2.disabled) { e.stopImmediatePropagation(); return; } if ((_a = elDropdown == null ? void 0 : elDropdown.hideOnClick) == null ? void 0 : _a.value) (_b = elDropdown.handleClick) == null ? void 0 : _b.call(elDropdown); (_c = elDropdown.commandHandler) == null ? void 0 : _c.call(elDropdown, props2.command, _instance, e); }), handlePointerMove, handlePointerLeave, propsAndAttrs: computed(() => ({ ...props2, ...attrs })) }; } }); function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_dropdown_item_impl = resolveComponent("el-dropdown-item-impl"); const _component_el_roving_focus_item = resolveComponent("el-roving-focus-item"); return openBlock(), createBlock(_component_el_roving_focus_item, { focusable: !_ctx.disabled }, { default: withCtx(() => [createVNode(_component_el_dropdown_item_impl, mergeProps(_ctx.propsAndAttrs, { onPointerleave: _ctx.handlePointerLeave, onPointermove: _ctx.handlePointerMove, onClickimpl: _ctx.handleClick }), createSlots({ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 2 }, [_ctx.$slots.icon ? { name: "icon", fn: withCtx(() => [renderSlot(_ctx.$slots, "icon")]), key: "0" } : void 0]), 1040, [ "onPointerleave", "onPointermove", "onClickimpl" ])]), _: 3 }, 8, ["focusable"]); } var dropdown_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_item_vue_vue_type_script_lang_default, [["render", _sfc_render$9]]); var dropdown_menu_vue_vue_type_script_lang_default = defineComponent({ name: "ElDropdownMenu", props: dropdownMenuProps, setup(props2) { const ns = useNamespace("dropdown"); const { _elDropdownSize } = useDropdown(); const size = _elDropdownSize.value; const { contentRef, role, triggerId, isUsingKeyboard, handleClose } = inject(DROPDOWN_INJECTION_KEY, void 0); const { rovingFocusGroupRef, rovingFocusGroupRootStyle, onBlur, onFocus, onKeydown, onMousedown } = inject(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0); const { collectionRef: rovingFocusGroupCollectionRef } = inject(COLLECTION_INJECTION_KEY, void 0); const dropdownKls = computed(() => { return [ns.b("menu"), ns.bm("menu", size == null ? void 0 : size.value)]; }); const dropdownListWrapperRef = composeRefs(contentRef, rovingFocusGroupRef, rovingFocusGroupCollectionRef); const handleKeydown = composeEventHandlers((e) => { var _a; (_a = props2.onKeydown) == null ? void 0 : _a.call(props2, e); }, (e) => { const { currentTarget, target } = e; const code = getEventCode(e); if (currentTarget.contains(target)) ; if (EVENT_CODE.tab === code) return handleClose(); onKeydown(e); }); function handleFocus(e) { isUsingKeyboard.value && onFocus(e); } return { size, rovingFocusGroupRootStyle, dropdownKls, role, triggerId, dropdownListWrapperRef, handleKeydown, onBlur, handleFocus, onMousedown }; } }); const _hoisted_1$C = ["role", "aria-labelledby"]; function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("ul", { ref: _ctx.dropdownListWrapperRef, class: normalizeClass(_ctx.dropdownKls), style: normalizeStyle(_ctx.rovingFocusGroupRootStyle), tabindex: -1, role: _ctx.role, "aria-labelledby": _ctx.triggerId, onFocusin: _cache[0] || (_cache[0] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)), onFocusout: _cache[1] || (_cache[1] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)), onKeydown: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args), ["self"])), onMousedown: _cache[3] || (_cache[3] = withModifiers((...args) => _ctx.onMousedown && _ctx.onMousedown(...args), ["self"])) }, [renderSlot(_ctx.$slots, "default")], 46, _hoisted_1$C); } var dropdown_menu_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_menu_vue_vue_type_script_lang_default, [["render", _sfc_render$8]]); const ElDropdown = withInstall(dropdown_default, { DropdownItem: dropdown_item_default, DropdownMenu: dropdown_menu_default }); const ElDropdownItem = withNoopInstall(dropdown_item_default); const ElDropdownMenu = withNoopInstall(dropdown_menu_default); const emptyProps = buildProps({ image: { type: String, default: "" }, imageSize: Number, description: { type: String, default: "" } }); const _hoisted_1$B = { viewBox: "0 0 79 86", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink" }; const _hoisted_2$n = ["id"]; const _hoisted_3$8 = ["stop-color"]; const _hoisted_4$6 = ["stop-color"]; const _hoisted_5$4 = ["id"]; const _hoisted_6$1 = ["stop-color"]; const _hoisted_7 = ["stop-color"]; const _hoisted_8 = ["id"]; const _hoisted_9 = { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }; const _hoisted_10 = { transform: "translate(-1268.000000, -535.000000)" }; const _hoisted_11 = { transform: "translate(1268.000000, 535.000000)" }; const _hoisted_12 = ["fill"]; const _hoisted_13 = ["fill"]; const _hoisted_14 = { transform: "translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)" }; const _hoisted_15 = ["fill"]; const _hoisted_16 = ["fill"]; const _hoisted_17 = ["fill"]; const _hoisted_18 = ["fill"]; const _hoisted_19 = ["fill"]; const _hoisted_20 = { transform: "translate(53.000000, 45.000000)" }; const _hoisted_21 = ["fill", "xlink:href"]; const _hoisted_22 = ["fill", "mask"]; const _hoisted_23 = ["fill"]; var img_empty_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ImgEmpty", __name: "img-empty", setup(__props) { const ns = useNamespace("empty"); const id = useId(); return (_ctx, _cache) => { return openBlock(), createElementBlock("svg", _hoisted_1$B, [createBaseVNode("defs", null, [ createBaseVNode("linearGradient", { id: `linearGradient-1-${unref(id)}`, x1: "38.8503086%", y1: "0%", x2: "61.1496914%", y2: "100%" }, [createBaseVNode("stop", { "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-1")})`, offset: "0%" }, null, 8, _hoisted_3$8), createBaseVNode("stop", { "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-4")})`, offset: "100%" }, null, 8, _hoisted_4$6)], 8, _hoisted_2$n), createBaseVNode("linearGradient", { id: `linearGradient-2-${unref(id)}`, x1: "0%", y1: "9.5%", x2: "100%", y2: "90.5%" }, [createBaseVNode("stop", { "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-1")})`, offset: "0%" }, null, 8, _hoisted_6$1), createBaseVNode("stop", { "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-6")})`, offset: "100%" }, null, 8, _hoisted_7)], 8, _hoisted_5$4), createBaseVNode("rect", { id: `path-3-${unref(id)}`, x: "0", y: "0", width: "17", height: "36" }, null, 8, _hoisted_8) ]), createBaseVNode("g", _hoisted_9, [createBaseVNode("g", _hoisted_10, [createBaseVNode("g", _hoisted_11, [ createBaseVNode("path", { d: "M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z", fill: `var(${unref(ns).cssVarBlockName("fill-color-3")})` }, null, 8, _hoisted_12), createBaseVNode("polygon", { fill: `var(${unref(ns).cssVarBlockName("fill-color-7")})`, transform: "translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ", points: "13 58 53 58 42 45 2 45" }, null, 8, _hoisted_13), createBaseVNode("g", _hoisted_14, [ createBaseVNode("polygon", { fill: `var(${unref(ns).cssVarBlockName("fill-color-7")})`, transform: "translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ", points: "2.84078316e-14 3 18 3 23 7 5 7" }, null, 8, _hoisted_15), createBaseVNode("polygon", { fill: `var(${unref(ns).cssVarBlockName("fill-color-5")})`, points: "-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43" }, null, 8, _hoisted_16), createBaseVNode("rect", { fill: `url(#linearGradient-1-${unref(id)})`, transform: "translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ", x: "38", y: "7", width: "17", height: "36" }, null, 8, _hoisted_17), createBaseVNode("polygon", { fill: `var(${unref(ns).cssVarBlockName("fill-color-2")})`, transform: "translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ", points: "24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12" }, null, 8, _hoisted_18) ]), createBaseVNode("rect", { fill: `url(#linearGradient-2-${unref(id)})`, x: "13", y: "45", width: "40", height: "36" }, null, 8, _hoisted_19), createBaseVNode("g", _hoisted_20, [createBaseVNode("use", { fill: `var(${unref(ns).cssVarBlockName("fill-color-8")})`, transform: "translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ", "xlink:href": `#path-3-${unref(id)}` }, null, 8, _hoisted_21), createBaseVNode("polygon", { fill: `var(${unref(ns).cssVarBlockName("fill-color-9")})`, mask: `url(#mask-4-${unref(id)})`, transform: "translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ", points: "7 0 24 0 20 18 7 16.5" }, null, 8, _hoisted_22)]), createBaseVNode("polygon", { fill: `var(${unref(ns).cssVarBlockName("fill-color-2")})`, transform: "translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ", points: "62 45 79 45 70 58 53 58" }, null, 8, _hoisted_23) ])])])]); }; } }); var img_empty_default = img_empty_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$A = ["src"]; const _hoisted_2$m = { key: 1 }; var empty_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElEmpty", __name: "empty", props: emptyProps, setup(__props) { const props2 = __props; const { t } = useLocale(); const ns = useNamespace("empty"); const emptyDescription = computed(() => props2.description || t("el.table.emptyText")); const imageStyle = computed(() => ({ width: addUnit(props2.imageSize) })); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [ createBaseVNode("div", { class: normalizeClass(unref(ns).e("image")), style: normalizeStyle(imageStyle.value) }, [__props.image ? (openBlock(), createElementBlock("img", { key: 0, src: __props.image, ondragstart: "return false" }, null, 8, _hoisted_1$A)) : renderSlot(_ctx.$slots, "image", { key: 1 }, () => [createVNode(img_empty_default)])], 6), createBaseVNode("div", { class: normalizeClass(unref(ns).e("description")) }, [_ctx.$slots.description ? renderSlot(_ctx.$slots, "description", { key: 0 }) : (openBlock(), createElementBlock("p", _hoisted_2$m, toDisplayString(emptyDescription.value), 1))], 2), _ctx.$slots.default ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("bottom")) }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true) ], 2); }; } }); var empty_default = empty_vue_vue_type_script_setup_true_lang_default; const ElEmpty = withInstall(empty_default); const imageProps = buildProps({ hideOnClickModal: Boolean, src: { type: String, default: "" }, fit: { type: String, values: [ "", "contain", "cover", "fill", "none", "scale-down" ], default: "" }, loading: { type: String, values: ["eager", "lazy"] }, lazy: Boolean, scrollContainer: { type: definePropType([String, Object]) }, previewSrcList: { type: definePropType(Array), default: () => mutable([]) }, previewTeleported: Boolean, zIndex: { type: Number }, initialIndex: { type: Number, default: 0 }, infinite: { type: Boolean, default: true }, closeOnPressEscape: { type: Boolean, default: true }, zoomRate: { type: Number, default: 1.2 }, scale: { type: Number, default: 1 }, minScale: { type: Number, default: 0.2 }, maxScale: { type: Number, default: 7 }, showProgress: Boolean, crossorigin: { type: definePropType(String) } }); const imageEmits = { load: (evt) => evt instanceof Event, error: (evt) => evt instanceof Event, switch: (val) => isNumber(val), close: () => true, show: () => true }; const imageViewerProps = buildProps({ urlList: { type: definePropType(Array), default: () => mutable([]) }, zIndex: { type: Number }, initialIndex: { type: Number, default: 0 }, infinite: { type: Boolean, default: true }, hideOnClickModal: Boolean, teleported: Boolean, closeOnPressEscape: { type: Boolean, default: true }, zoomRate: { type: Number, default: 1.2 }, scale: { type: Number, default: 1 }, minScale: { type: Number, default: 0.2 }, maxScale: { type: Number, default: 7 }, showProgress: Boolean, crossorigin: { type: definePropType(String) } }); const imageViewerEmits = { close: () => true, error: (evt) => evt instanceof Event, switch: (index) => isNumber(index), rotate: (deg) => isNumber(deg) }; const _hoisted_1$z = ["src", "crossorigin"]; var image_viewer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElImageViewer", __name: "image-viewer", props: imageViewerProps, emits: imageViewerEmits, setup(__props, { expose: __expose, emit: __emit }) { const modes = { CONTAIN: { name: "contain", icon: markRaw(full_screen_default) }, ORIGINAL: { name: "original", icon: markRaw(scale_to_original_default) } }; const props2 = __props; const emit = __emit; let stopWheelListener; const { t } = useLocale(); const ns = useNamespace("image-viewer"); const { nextZIndex } = useZIndex(); const wrapper = ref(); const imgRef = ref(); const scopeEventListener = effectScope(); const scaleClamped = computed(() => { const { scale, minScale, maxScale } = props2; return clamp$1(scale, minScale, maxScale); }); const loading = ref(true); const loadError = ref(false); const visible = ref(false); const activeIndex = ref(props2.initialIndex); const mode = shallowRef(modes.CONTAIN); const transform = ref({ scale: scaleClamped.value, deg: 0, offsetX: 0, offsetY: 0, enableTransition: false }); const zIndex2 = ref(props2.zIndex ?? nextZIndex()); useLockscreen(visible, { ns }); const isSingle = computed(() => { const { urlList } = props2; return urlList.length <= 1; }); const isFirst = computed(() => activeIndex.value === 0); const isLast = computed(() => activeIndex.value === props2.urlList.length - 1); const currentImg = computed(() => props2.urlList[activeIndex.value]); const arrowPrevKls = computed(() => [ ns.e("btn"), ns.e("prev"), ns.is("disabled", !props2.infinite && isFirst.value) ]); const arrowNextKls = computed(() => [ ns.e("btn"), ns.e("next"), ns.is("disabled", !props2.infinite && isLast.value) ]); const imgStyle = computed(() => { const { scale, deg, offsetX, offsetY, enableTransition } = transform.value; let translateX = offsetX / scale; let translateY = offsetY / scale; const radian = deg * Math.PI / 180; const cosRadian = Math.cos(radian); const sinRadian = Math.sin(radian); translateX = translateX * cosRadian + translateY * sinRadian; translateY = translateY * cosRadian - offsetX / scale * sinRadian; const style = { transform: `scale(${scale}) rotate(${deg}deg) translate(${translateX}px, ${translateY}px)`, transition: enableTransition ? "transform .3s" : "" }; if (mode.value.name === modes.CONTAIN.name) style.maxWidth = style.maxHeight = "100%"; return style; }); const progress = computed(() => `${activeIndex.value + 1} / ${props2.urlList.length}`); function hide() { unregisterEventListener(); stopWheelListener == null ? void 0 : stopWheelListener(); visible.value = false; emit("close"); } function registerEventListener() { const keydownHandler = throttle((e) => { switch (getEventCode(e)) { case EVENT_CODE.esc: props2.closeOnPressEscape && hide(); break; case EVENT_CODE.space: toggleMode(); break; case EVENT_CODE.left: prev(); break; case EVENT_CODE.up: handleActions("zoomIn"); break; case EVENT_CODE.right: next(); break; case EVENT_CODE.down: handleActions("zoomOut"); break; } }); const mousewheelHandler = throttle((e) => { handleActions((e.deltaY || e.deltaX) < 0 ? "zoomIn" : "zoomOut", { zoomRate: props2.zoomRate, enableTransition: false }); }); scopeEventListener.run(() => { useEventListener(document, "keydown", keydownHandler); useEventListener(wrapper, "wheel", mousewheelHandler); }); } function unregisterEventListener() { scopeEventListener.stop(); } function handleImgLoad() { loading.value = false; } function handleImgError(e) { loadError.value = true; loading.value = false; emit("error", e); e.target.alt = t("el.image.error"); } function handleMouseDown(e) { if (loading.value || e.button !== 0 || !wrapper.value) return; transform.value.enableTransition = false; const { offsetX, offsetY } = transform.value; const startX = e.pageX; const startY = e.pageY; const dragHandler = throttle((ev) => { transform.value = { ...transform.value, offsetX: offsetX + ev.pageX - startX, offsetY: offsetY + ev.pageY - startY }; }); const removeMousemove = useEventListener(document, "mousemove", dragHandler); const removeMouseup = useEventListener(document, "mouseup", () => { removeMousemove(); removeMouseup(); }); e.preventDefault(); } function handleTouchStart(e) { if (loading.value || !wrapper.value || e.touches.length !== 1) return; transform.value.enableTransition = false; const { offsetX, offsetY } = transform.value; const { pageX: startX, pageY: startY } = e.touches[0]; const dragHandler = throttle((ev) => { const targetTouch = ev.touches[0]; transform.value = { ...transform.value, offsetX: offsetX + targetTouch.pageX - startX, offsetY: offsetY + targetTouch.pageY - startY }; }); const removeTouchmove = useEventListener(document, "touchmove", dragHandler); const removeTouchend = useEventListener(document, "touchend", () => { removeTouchmove(); removeTouchend(); }); e.preventDefault(); } function reset() { transform.value = { scale: scaleClamped.value, deg: 0, offsetX: 0, offsetY: 0, enableTransition: false }; } function toggleMode() { if (loading.value || loadError.value) return; const modeNames = keysOf(modes); const modeValues = Object.values(modes); const currentMode = mode.value.name; mode.value = modes[modeNames[(modeValues.findIndex((i) => i.name === currentMode) + 1) % modeNames.length]]; reset(); } function setActiveItem(index) { loadError.value = false; const len = props2.urlList.length; activeIndex.value = (index + len) % len; } function prev() { if (isFirst.value && !props2.infinite) return; setActiveItem(activeIndex.value - 1); } function next() { if (isLast.value && !props2.infinite) return; setActiveItem(activeIndex.value + 1); } function handleActions(action, options = {}) { if (loading.value || loadError.value) return; const { minScale, maxScale } = props2; const { zoomRate, rotateDeg, enableTransition } = { zoomRate: props2.zoomRate, rotateDeg: 90, enableTransition: true, ...options }; switch (action) { case "zoomOut": if (transform.value.scale > minScale) transform.value.scale = Number.parseFloat((transform.value.scale / zoomRate).toFixed(3)); break; case "zoomIn": if (transform.value.scale < maxScale) transform.value.scale = Number.parseFloat((transform.value.scale * zoomRate).toFixed(3)); break; case "clockwise": transform.value.deg += rotateDeg; emit("rotate", transform.value.deg); break; case "anticlockwise": transform.value.deg -= rotateDeg; emit("rotate", transform.value.deg); break; } transform.value.enableTransition = enableTransition; } function onFocusoutPrevented(event) { var _a; if (((_a = event.detail) == null ? void 0 : _a.focusReason) === "pointer") event.preventDefault(); } function onCloseRequested() { if (props2.closeOnPressEscape) hide(); } function wheelHandler(e) { if (!e.ctrlKey) return; if (e.deltaY < 0) { e.preventDefault(); return false; } else if (e.deltaY > 0) { e.preventDefault(); return false; } } watch(() => scaleClamped.value, (val) => { transform.value.scale = val; }); watch(currentImg, () => { nextTick(() => { var _a; if (!((_a = imgRef.value) == null ? void 0 : _a.complete)) loading.value = true; }); }); watch(activeIndex, (val) => { reset(); emit("switch", val); }); onMounted(() => { visible.value = true; registerEventListener(); stopWheelListener = useEventListener("wheel", wheelHandler, { passive: false }); }); __expose({ setActiveItem }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTeleport), { to: "body", disabled: !__props.teleported }, { default: withCtx(() => [createVNode(Transition, { name: "viewer-fade", appear: "" }, { default: withCtx(() => [createBaseVNode("div", { ref_key: "wrapper", ref: wrapper, tabindex: -1, class: normalizeClass(unref(ns).e("wrapper")), style: normalizeStyle({ zIndex: zIndex2.value }) }, [createVNode(unref(focus_trap_default$1), { loop: "", trapped: "", "focus-trap-el": wrapper.value, "focus-start-el": "container", onFocusoutPrevented, onReleaseRequested: onCloseRequested }, { default: withCtx(() => [ createBaseVNode("div", { class: normalizeClass(unref(ns).e("mask")), onClick: _cache[0] || (_cache[0] = withModifiers(($event) => __props.hideOnClickModal && hide(), ["self"])) }, null, 2), createCommentVNode(" CLOSE "), createBaseVNode("span", { class: normalizeClass([unref(ns).e("btn"), unref(ns).e("close")]), onClick: hide }, [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(close_default))]), _: 1 })], 2), createCommentVNode(" ARROW "), !isSingle.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createBaseVNode("span", { class: normalizeClass(arrowPrevKls.value), onClick: prev }, [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_left_default))]), _: 1 })], 2), createBaseVNode("span", { class: normalizeClass(arrowNextKls.value), onClick: next }, [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_right_default))]), _: 1 })], 2)], 64)) : createCommentVNode("v-if", true), _ctx.$slots.progress || __props.showProgress ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([unref(ns).e("btn"), unref(ns).e("progress")]) }, [renderSlot(_ctx.$slots, "progress", { activeIndex: activeIndex.value, total: __props.urlList.length }, () => [createTextVNode(toDisplayString(progress.value), 1)])], 2)) : createCommentVNode("v-if", true), createCommentVNode(" ACTIONS "), createBaseVNode("div", { class: normalizeClass([unref(ns).e("btn"), unref(ns).e("actions")]) }, [createBaseVNode("div", { class: normalizeClass(unref(ns).e("actions__inner")) }, [renderSlot(_ctx.$slots, "toolbar", { actions: handleActions, prev, next, reset: toggleMode, activeIndex: activeIndex.value, setActiveItem }, () => [ createVNode(unref(ElIcon), { onClick: _cache[1] || (_cache[1] = ($event) => handleActions("zoomOut")) }, { default: withCtx(() => [createVNode(unref(zoom_out_default))]), _: 1 }), createVNode(unref(ElIcon), { onClick: _cache[2] || (_cache[2] = ($event) => handleActions("zoomIn")) }, { default: withCtx(() => [createVNode(unref(zoom_in_default))]), _: 1 }), createBaseVNode("i", { class: normalizeClass(unref(ns).e("actions__divider")) }, null, 2), createVNode(unref(ElIcon), { onClick: toggleMode }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(mode.value.icon)))]), _: 1 }), createBaseVNode("i", { class: normalizeClass(unref(ns).e("actions__divider")) }, null, 2), createVNode(unref(ElIcon), { onClick: _cache[3] || (_cache[3] = ($event) => handleActions("anticlockwise")) }, { default: withCtx(() => [createVNode(unref(refresh_left_default))]), _: 1 }), createVNode(unref(ElIcon), { onClick: _cache[4] || (_cache[4] = ($event) => handleActions("clockwise")) }, { default: withCtx(() => [createVNode(unref(refresh_right_default))]), _: 1 }) ])], 2)], 2), createCommentVNode(" CANVAS "), createBaseVNode("div", { class: normalizeClass(unref(ns).e("canvas")) }, [loadError.value && _ctx.$slots["viewer-error"] ? renderSlot(_ctx.$slots, "viewer-error", { key: 0, activeIndex: activeIndex.value, src: currentImg.value }) : (openBlock(), createElementBlock("img", { ref_key: "imgRef", ref: imgRef, key: currentImg.value, src: currentImg.value, style: normalizeStyle(imgStyle.value), class: normalizeClass(unref(ns).e("img")), crossorigin: __props.crossorigin, onLoad: handleImgLoad, onError: handleImgError, onMousedown: handleMouseDown, onTouchstart: handleTouchStart }, null, 46, _hoisted_1$z))], 2), renderSlot(_ctx.$slots, "default") ]), _: 3 }, 8, ["focus-trap-el"])], 6)]), _: 3 })]), _: 3 }, 8, ["disabled"]); }; } }); var image_viewer_default = image_viewer_vue_vue_type_script_setup_true_lang_default; const ElImageViewer = withInstall(image_viewer_default); const _hoisted_1$y = [ "src", "loading", "crossorigin" ]; const _hoisted_2$l = { key: 0 }; var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElImage", inheritAttrs: false, __name: "image", props: imageProps, emits: imageEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const { t } = useLocale(); const ns = useNamespace("image"); const rawAttrs = useAttrs$1(); const containerAttrs = computed(() => { return fromPairs(Object.entries(rawAttrs).filter(([key]) => /^(data-|on[A-Z])/i.test(key) || ["id", "style"].includes(key))); }); const imgAttrs = useAttrs({ excludeListeners: true, excludeKeys: computed(() => { return Object.keys(containerAttrs.value); }) }); const imageSrc = ref(); const hasLoadError = ref(false); const isLoading = ref(true); const showViewer = ref(false); const container = ref(); const _scrollContainer = ref(); const supportLoading = isClient && "loading" in HTMLImageElement.prototype; let stopScrollListener; const imageKls = computed(() => [ ns.e("inner"), preview.value && ns.e("preview"), isLoading.value && ns.is("loading") ]); const imageStyle = computed(() => { const { fit } = props2; if (isClient && fit) return { objectFit: fit }; return {}; }); const preview = computed(() => { const { previewSrcList } = props2; return isArray(previewSrcList) && previewSrcList.length > 0; }); const imageIndex = computed(() => { const { previewSrcList, initialIndex } = props2; let previewIndex = initialIndex; if (initialIndex > previewSrcList.length - 1) previewIndex = 0; return previewIndex; }); const isManual = computed(() => { if (props2.loading === "eager") return false; return !supportLoading && props2.loading === "lazy" || props2.lazy; }); const loadImage = () => { if (!isClient) return; isLoading.value = true; hasLoadError.value = false; imageSrc.value = props2.src; }; function handleLoad(event) { isLoading.value = false; hasLoadError.value = false; emit("load", event); } function handleError(event) { isLoading.value = false; hasLoadError.value = true; emit("error", event); } function handleLazyLoad(isIntersecting) { if (isIntersecting) { loadImage(); removeLazyLoadListener(); } } const lazyLoadHandler = useThrottleFn(handleLazyLoad, 200, true); async function addLazyLoadListener() { if (!isClient) return; await nextTick(); const { scrollContainer } = props2; if (isElement(scrollContainer)) _scrollContainer.value = scrollContainer; else if (isString(scrollContainer) && scrollContainer !== "") _scrollContainer.value = document.querySelector(scrollContainer) ?? void 0; else if (container.value) { const scrollContainer2 = getScrollContainer(container.value); _scrollContainer.value = isWindow(scrollContainer2) ? void 0 : scrollContainer2; } const { stop } = useIntersectionObserver(container, ([entry]) => { lazyLoadHandler(entry.isIntersecting); }, { root: _scrollContainer }); stopScrollListener = stop; } function removeLazyLoadListener() { if (!isClient || !lazyLoadHandler) return; stopScrollListener == null ? void 0 : stopScrollListener(); _scrollContainer.value = void 0; stopScrollListener = void 0; } function clickHandler() { if (!preview.value) return; showViewer.value = true; emit("show"); } function closeViewer() { showViewer.value = false; emit("close"); } function switchViewer(val) { emit("switch", val); } watch(() => props2.src, () => { if (isManual.value) { isLoading.value = true; hasLoadError.value = false; removeLazyLoadListener(); addLazyLoadListener(); } else loadImage(); }); onMounted(() => { if (isManual.value) addLazyLoadListener(); else loadImage(); }); __expose({ showPreview: clickHandler }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", mergeProps({ ref_key: "container", ref: container }, containerAttrs.value, { class: [unref(ns).b(), _ctx.$attrs.class] }), [hasLoadError.value ? renderSlot(_ctx.$slots, "error", { key: 0 }, () => [createBaseVNode("div", { class: normalizeClass(unref(ns).e("error")) }, toDisplayString(unref(t)("el.image.error")), 3)]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [imageSrc.value !== void 0 ? (openBlock(), createElementBlock("img", mergeProps({ key: 0 }, unref(imgAttrs), { src: imageSrc.value, loading: __props.loading, style: imageStyle.value, class: imageKls.value, crossorigin: __props.crossorigin, onClick: clickHandler, onLoad: handleLoad, onError: handleError }), null, 16, _hoisted_1$y)) : createCommentVNode("v-if", true), isLoading.value ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("wrapper")) }, [renderSlot(_ctx.$slots, "placeholder", {}, () => [createBaseVNode("div", { class: normalizeClass(unref(ns).e("placeholder")) }, null, 2)])], 2)) : createCommentVNode("v-if", true)], 64)), preview.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [showViewer.value ? (openBlock(), createBlock(unref(ElImageViewer), { key: 0, "z-index": __props.zIndex, "initial-index": imageIndex.value, infinite: __props.infinite, "zoom-rate": __props.zoomRate, "min-scale": __props.minScale, "max-scale": __props.maxScale, "show-progress": __props.showProgress, "url-list": __props.previewSrcList, scale: __props.scale, crossorigin: __props.crossorigin, "hide-on-click-modal": __props.hideOnClickModal, teleported: __props.previewTeleported, "close-on-press-escape": __props.closeOnPressEscape, onClose: closeViewer, onSwitch: switchViewer }, createSlots({ toolbar: withCtx((toolbar) => [renderSlot(_ctx.$slots, "toolbar", normalizeProps(guardReactiveProps(toolbar)))]), default: withCtx(() => [_ctx.$slots.viewer ? (openBlock(), createElementBlock("div", _hoisted_2$l, [renderSlot(_ctx.$slots, "viewer")])) : createCommentVNode("v-if", true)]), _: 2 }, [_ctx.$slots.progress ? { name: "progress", fn: withCtx((progress) => [renderSlot(_ctx.$slots, "progress", normalizeProps(guardReactiveProps(progress)))]), key: "0" } : void 0, _ctx.$slots["viewer-error"] ? { name: "viewer-error", fn: withCtx((viewerError) => [renderSlot(_ctx.$slots, "viewer-error", normalizeProps(guardReactiveProps(viewerError)))]), key: "1" } : void 0]), 1032, [ "z-index", "initial-index", "infinite", "zoom-rate", "min-scale", "max-scale", "show-progress", "url-list", "scale", "crossorigin", "hide-on-click-modal", "teleported", "close-on-press-escape" ])) : createCommentVNode("v-if", true)], 64)) : createCommentVNode("v-if", true)], 16); }; } }); var image_default = image_vue_vue_type_script_setup_true_lang_default; const ElImage = withInstall(image_default); const inputNumberProps = buildProps({ id: { type: String, default: void 0 }, step: { type: Number, default: 1 }, stepStrictly: Boolean, max: { type: Number, default: Number.MAX_SAFE_INTEGER }, min: { type: Number, default: Number.MIN_SAFE_INTEGER }, modelValue: { type: [Number, null] }, readonly: Boolean, disabled: { type: Boolean, default: void 0 }, size: useSizeProp, controls: { type: Boolean, default: true }, controlsPosition: { type: String, default: "", values: ["", "right"] }, valueOnClear: { type: definePropType([ String, Number, null ]), validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val), default: null }, name: String, placeholder: String, precision: { type: Number, validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10) }, validateEvent: { type: Boolean, default: true }, ...useAriaProps(["ariaLabel"]), inputmode: { type: definePropType(String), default: void 0 }, align: { type: definePropType(String), default: "center" }, disabledScientific: Boolean }); const inputNumberEmits = { [CHANGE_EVENT]: (cur, prev) => prev !== cur, blur: (e) => e instanceof FocusEvent, focus: (e) => e instanceof FocusEvent, [INPUT_EVENT]: (val) => isNumber(val) || isNil(val), [UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val) }; const _hoisted_1$x = ["aria-label"]; const _hoisted_2$k = ["aria-label"]; var input_number_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElInputNumber", __name: "input-number", props: inputNumberProps, emits: inputNumberEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const { t } = useLocale(); const ns = useNamespace("input-number"); const input = ref(); const data = reactive({ currentValue: props2.modelValue, userInput: null }); const { formItem } = useFormItem(); const minDisabled = computed(() => isNumber(props2.modelValue) && props2.modelValue <= props2.min); const maxDisabled = computed(() => isNumber(props2.modelValue) && props2.modelValue >= props2.max); const numPrecision = computed(() => { const stepPrecision = getPrecision(props2.step); if (!isUndefined(props2.precision)) { if (stepPrecision > props2.precision) debugWarn("InputNumber", "precision should not be less than the decimal places of step"); return props2.precision; } else return Math.max(getPrecision(props2.modelValue), stepPrecision); }); const controlsAtRight = computed(() => { return props2.controls && props2.controlsPosition === "right"; }); const inputNumberSize = useFormSize(); const inputNumberDisabled = useFormDisabled(); const displayValue = computed(() => { if (data.userInput !== null) return data.userInput; let currentValue = data.currentValue; if (isNil(currentValue)) return ""; if (isNumber(currentValue)) { if (Number.isNaN(currentValue)) return ""; if (!isUndefined(props2.precision)) currentValue = currentValue.toFixed(props2.precision); } return currentValue; }); const toPrecision = (num, pre) => { if (isUndefined(pre)) pre = numPrecision.value; if (pre === 0) return Math.round(num); let snum = String(num); const pointPos = snum.indexOf("."); if (pointPos === -1) return num; if (!snum.replace(".", "").split("")[pointPos + pre]) return num; const length = snum.length; if (snum.charAt(length - 1) === "5") snum = `${snum.slice(0, Math.max(0, length - 1))}6`; return Number.parseFloat(Number(snum).toFixed(pre)); }; const getPrecision = (value) => { if (isNil(value)) return 0; const valueString = value.toString(); const dotPosition = valueString.indexOf("."); let precision = 0; if (dotPosition !== -1) precision = valueString.length - dotPosition - 1; return precision; }; const ensurePrecision = (val, coefficient = 1) => { if (!isNumber(val)) return data.currentValue; if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) { debugWarn("InputNumber", "The value has reached the maximum safe integer limit."); return val; } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) { debugWarn("InputNumber", "The value has reached the minimum safe integer limit."); return val; } return toPrecision(val + props2.step * coefficient); }; const handleKeydown = (event) => { const code = getEventCode(event); const key = getEventKey(event); if (props2.disabledScientific && ["e", "E"].includes(key)) { event.preventDefault(); return; } switch (code) { case EVENT_CODE.up: event.preventDefault(); increase(); break; case EVENT_CODE.down: event.preventDefault(); decrease(); break; } }; const increase = () => { if (props2.readonly || inputNumberDisabled.value || maxDisabled.value) return; setCurrentValue(ensurePrecision(Number(displayValue.value) || 0)); emit(INPUT_EVENT, data.currentValue); setCurrentValueToModelValue(); }; const decrease = () => { if (props2.readonly || inputNumberDisabled.value || minDisabled.value) return; setCurrentValue(ensurePrecision(Number(displayValue.value) || 0, -1)); emit(INPUT_EVENT, data.currentValue); setCurrentValueToModelValue(); }; const verifyValue = (value, update) => { const { max: max2, min: min2, step: step2, precision, stepStrictly, valueOnClear } = props2; if (max2 < min2) throwError("InputNumber", "min should not be greater than max."); let newVal = Number(value); if (isNil(value) || Number.isNaN(newVal)) return null; if (value === "") { if (valueOnClear === null) return null; newVal = isString(valueOnClear) ? { min: min2, max: max2 }[valueOnClear] : valueOnClear; } if (stepStrictly) { newVal = toPrecision(Math.round(toPrecision(newVal / step2)) * step2, precision); if (newVal !== value) update && emit(UPDATE_MODEL_EVENT, newVal); } if (!isUndefined(precision)) newVal = toPrecision(newVal, precision); if (newVal > max2 || newVal < min2) { newVal = newVal > max2 ? max2 : min2; update && emit(UPDATE_MODEL_EVENT, newVal); } return newVal; }; const setCurrentValue = (value, emitChange = true) => { var _a; const oldVal = data.currentValue; const newVal = verifyValue(value); if (!emitChange) { emit(UPDATE_MODEL_EVENT, newVal); return; } data.userInput = null; if (oldVal === newVal && value) return; emit(UPDATE_MODEL_EVENT, newVal); if (oldVal !== newVal) emit(CHANGE_EVENT, newVal, oldVal); if (props2.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err)); data.currentValue = newVal; }; const handleInput = (value) => { data.userInput = value; const newVal = value === "" ? null : Number(value); emit(INPUT_EVENT, newVal); setCurrentValue(newVal, false); }; const handleInputChange = (value) => { const newVal = value !== "" ? Number(value) : ""; if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") setCurrentValue(newVal); setCurrentValueToModelValue(); data.userInput = null; }; const focus = () => { var _a, _b; (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a); }; const blur = () => { var _a, _b; (_b = (_a = input.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a); }; const handleFocus = (event) => { emit("focus", event); }; const handleBlur = (event) => { var _a, _b; data.userInput = null; if (data.currentValue === null && ((_a = input.value) == null ? void 0 : _a.input)) input.value.input.value = ""; emit("blur", event); if (props2.validateEvent) (_b = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _b.call(formItem, "blur").catch((err) => debugWarn(err)); }; const setCurrentValueToModelValue = () => { if (data.currentValue !== props2.modelValue) data.currentValue = props2.modelValue; }; const handleWheel = (e) => { if (document.activeElement === e.target) e.preventDefault(); }; watch(() => props2.modelValue, (value, oldValue) => { const newValue = verifyValue(value, true); if (data.userInput === null && newValue !== oldValue) data.currentValue = newValue; }, { immediate: true }); watch(() => props2.precision, () => { data.currentValue = verifyValue(props2.modelValue); }); onMounted(() => { var _a; const { min: min2, max: max2, modelValue } = props2; const innerInput = (_a = input.value) == null ? void 0 : _a.input; innerInput.setAttribute("role", "spinbutton"); if (Number.isFinite(max2)) innerInput.setAttribute("aria-valuemax", String(max2)); else innerInput.removeAttribute("aria-valuemax"); if (Number.isFinite(min2)) innerInput.setAttribute("aria-valuemin", String(min2)); else innerInput.removeAttribute("aria-valuemin"); innerInput.setAttribute("aria-valuenow", data.currentValue || data.currentValue === 0 ? String(data.currentValue) : ""); innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value)); if (!isNumber(modelValue) && modelValue != null) { let val = Number(modelValue); if (Number.isNaN(val)) val = null; emit(UPDATE_MODEL_EVENT, val); } innerInput.addEventListener("wheel", handleWheel, { passive: false }); }); onUpdated(() => { var _a, _b; (_b = (_a = input.value) == null ? void 0 : _a.input) == null ? void 0 : _b.setAttribute("aria-valuenow", `${data.currentValue ?? ""}`); }); __expose({ focus, blur }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([ unref(ns).b(), unref(ns).m(unref(inputNumberSize)), unref(ns).is("disabled", unref(inputNumberDisabled)), unref(ns).is("without-controls", !__props.controls), unref(ns).is("controls-right", controlsAtRight.value), unref(ns).is(__props.align, !!__props.align) ]), onDragstart: _cache[0] || (_cache[0] = withModifiers(() => { }, ["prevent"])) }, [ __props.controls ? withDirectives((openBlock(), createElementBlock("span", { key: 0, role: "button", "aria-label": unref(t)("el.inputNumber.decrease"), class: normalizeClass([unref(ns).e("decrease"), unref(ns).is("disabled", minDisabled.value)]), onKeydown: withKeys(decrease, ["enter"]) }, [renderSlot(_ctx.$slots, "decrease-icon", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [controlsAtRight.value ? (openBlock(), createBlock(unref(arrow_down_default), { key: 0 })) : (openBlock(), createBlock(unref(minus_default), { key: 1 }))]), _: 1 })])], 42, _hoisted_1$x)), [[unref(vRepeatClick), decrease]]) : createCommentVNode("v-if", true), __props.controls ? withDirectives((openBlock(), createElementBlock("span", { key: 1, role: "button", "aria-label": unref(t)("el.inputNumber.increase"), class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", maxDisabled.value)]), onKeydown: withKeys(increase, ["enter"]) }, [renderSlot(_ctx.$slots, "increase-icon", {}, () => [createVNode(unref(ElIcon), null, { default: withCtx(() => [controlsAtRight.value ? (openBlock(), createBlock(unref(arrow_up_default), { key: 0 })) : (openBlock(), createBlock(unref(plus_default), { key: 1 }))]), _: 1 })])], 42, _hoisted_2$k)), [[unref(vRepeatClick), increase]]) : createCommentVNode("v-if", true), createVNode(unref(ElInput), { id: __props.id, ref_key: "input", ref: input, type: "number", step: __props.step, "model-value": displayValue.value, placeholder: __props.placeholder, readonly: __props.readonly, disabled: unref(inputNumberDisabled), size: unref(inputNumberSize), max: __props.max, min: __props.min, name: __props.name, "aria-label": __props.ariaLabel, "validate-event": false, inputmode: __props.inputmode, onKeydown: handleKeydown, onBlur: handleBlur, onFocus: handleFocus, onInput: handleInput, onChange: handleInputChange }, createSlots({ _: 2 }, [_ctx.$slots.prefix ? { name: "prefix", fn: withCtx(() => [renderSlot(_ctx.$slots, "prefix")]), key: "0" } : void 0, _ctx.$slots.suffix ? { name: "suffix", fn: withCtx(() => [renderSlot(_ctx.$slots, "suffix")]), key: "1" } : void 0]), 1032, [ "id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "inputmode" ]) ], 34); }; } }); var input_number_default = input_number_vue_vue_type_script_setup_true_lang_default; const ElInputNumber = withInstall(input_number_default); const inputTagProps = buildProps({ modelValue: { type: definePropType(Array) }, max: Number, tagType: { ...tagProps.type, default: "info" }, tagEffect: tagProps.effect, effect: { type: definePropType(String), default: "light" }, trigger: { type: definePropType(String), default: EVENT_CODE.enter }, draggable: Boolean, delimiter: { type: [String, RegExp], default: "" }, size: useSizeProp, clearable: Boolean, clearIcon: { type: iconPropType, default: circle_close_default }, disabled: { type: Boolean, default: void 0 }, validateEvent: { type: Boolean, default: true }, readonly: Boolean, autofocus: Boolean, id: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, maxlength: { type: [String, Number] }, minlength: { type: [String, Number] }, placeholder: String, autocomplete: { type: definePropType(String), default: "off" }, saveOnBlur: { type: Boolean, default: true }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, ariaLabel: String }); const inputTagEmits = { [UPDATE_MODEL_EVENT]: (value) => isArray(value) || isUndefined(value), [CHANGE_EVENT]: (value) => isArray(value) || isUndefined(value), [INPUT_EVENT]: (value) => isString(value), "add-tag": (value) => isString(value) || isArray(value), "remove-tag": (value, index) => isString(value) && isNumber(index), "drag-tag": (oldIndex, newIndex, value) => isNumber(oldIndex) && isNumber(newIndex) && isString(value), focus: (evt) => evt instanceof FocusEvent, blur: (evt) => evt instanceof FocusEvent, clear: () => true }; function useDragTag({ wrapperRef, handleDragged, afterDragged }) { const ns = useNamespace("input-tag"); const dropIndicatorRef = shallowRef(); const showDropIndicator = ref(false); let draggingIndex; let draggingTag; let dropIndex; let dropType; function getTagClassName(index) { return `.${ns.e("inner")} .${ns.namespace.value}-tag:nth-child(${index + 1})`; } function handleDragStart(event, index) { draggingIndex = index; draggingTag = wrapperRef.value.querySelector(getTagClassName(index)); if (draggingTag) draggingTag.style.opacity = "0.5"; event.dataTransfer.effectAllowed = "move"; } function handleDragOver(event, index) { dropIndex = index; event.preventDefault(); event.dataTransfer.dropEffect = "move"; if (isUndefined(draggingIndex) || draggingIndex === index) { showDropIndicator.value = false; return; } const dropPosition = wrapperRef.value.querySelector(getTagClassName(index)).getBoundingClientRect(); const dropPrev = !(draggingIndex + 1 === index); const dropNext = !(draggingIndex - 1 === index); const distance = event.clientX - dropPosition.left; const prevPercent = dropPrev ? dropNext ? 0.5 : 1 : -1; const nextPercent = dropNext ? dropPrev ? 0.5 : 0 : 1; if (distance <= dropPosition.width * prevPercent) dropType = "before"; else if (distance > dropPosition.width * nextPercent) dropType = "after"; else dropType = void 0; const innerEl = wrapperRef.value.querySelector(`.${ns.e("inner")}`); const innerPosition = innerEl.getBoundingClientRect(); const gap = Number.parseFloat(getStyle(innerEl, "gap")) / 2; const indicatorTop = dropPosition.top - innerPosition.top; let indicatorLeft = -9999; if (dropType === "before") indicatorLeft = Math.max(dropPosition.left - innerPosition.left - gap, Math.floor(-gap / 2)); else if (dropType === "after") { const left = dropPosition.right - innerPosition.left; indicatorLeft = left + (innerPosition.width === left ? Math.floor(gap / 2) : gap); } setStyle(dropIndicatorRef.value, { top: `${indicatorTop}px`, left: `${indicatorLeft}px` }); showDropIndicator.value = !!dropType; } function handleDragEnd(event) { event.preventDefault(); if (draggingTag) draggingTag.style.opacity = ""; if (dropType && !isUndefined(draggingIndex) && !isUndefined(dropIndex) && draggingIndex !== dropIndex) handleDragged(draggingIndex, dropIndex, dropType); showDropIndicator.value = false; draggingIndex = void 0; draggingTag = null; dropIndex = void 0; dropType = void 0; afterDragged == null ? void 0 : afterDragged(); } return { dropIndicatorRef, showDropIndicator, handleDragStart, handleDragOver, handleDragEnd }; } function useHovering() { const hovering = ref(false); const handleMouseEnter = () => { hovering.value = true; }; const handleMouseLeave = () => { hovering.value = false; }; return { hovering, handleMouseEnter, handleMouseLeave }; } function useInputTag({ props: props2, emit, formItem }) { const disabled = useFormDisabled(); const size = useFormSize(); const inputRef = shallowRef(); const inputValue = ref(); const tagTooltipRef = ref(); const tagSize = computed(() => { return ["small"].includes(size.value) ? "small" : "default"; }); const placeholder = computed(() => { var _a; return ((_a = props2.modelValue) == null ? void 0 : _a.length) ? void 0 : props2.placeholder; }); const closable = computed(() => !(props2.readonly || disabled.value)); const inputLimit = computed(() => { var _a; return isUndefined(props2.max) ? false : (((_a = props2.modelValue) == null ? void 0 : _a.length) ?? 0) >= props2.max; }); const showTagList = computed(() => { var _a; return props2.collapseTags ? (_a = props2.modelValue) == null ? void 0 : _a.slice(0, props2.maxCollapseTags) : props2.modelValue; }); const collapseTagList = computed(() => { var _a; return props2.collapseTags ? (_a = props2.modelValue) == null ? void 0 : _a.slice(props2.maxCollapseTags) : []; }); const addTagsEmit = (value) => { const list = [...props2.modelValue ?? [], ...castArray$1(value)]; emit(UPDATE_MODEL_EVENT, list); emit(CHANGE_EVENT, list); emit("add-tag", value); inputValue.value = void 0; }; const getDelimitedTags = (input) => { var _a; const parts = input.split(props2.delimiter); const tags = parts.length > 1 ? parts.map((val) => val.trim()).filter(Boolean) : []; if (props2.max) { const maxInsert = props2.max - (((_a = props2.modelValue) == null ? void 0 : _a.length) ?? 0); tags.splice(maxInsert); } return tags.length === 1 ? tags[0] : tags; }; const handlePaste = (event) => { var _a; const pasted = (_a = event.clipboardData) == null ? void 0 : _a.getData("text"); if (props2.readonly || inputLimit.value || !props2.delimiter || !pasted) return; const { selectionStart = 0, selectionEnd = 0, value } = event.target; const nextValue = value.slice(0, selectionStart) + pasted + value.slice(selectionEnd); const tags = getDelimitedTags(nextValue); if (tags.length) { addTagsEmit(tags); emit(INPUT_EVENT, nextValue); event.preventDefault(); } }; const handleInput = (event) => { if (inputLimit.value) { inputValue.value = void 0; return; } if (isComposing.value) return; if (props2.delimiter && inputValue.value) { const tags = getDelimitedTags(inputValue.value); if (tags.length) addTagsEmit(tags); } emit(INPUT_EVENT, event.target.value); }; const handleKeydown = (event) => { var _a; if (isComposing.value) return; switch (getEventCode(event)) { case props2.trigger: event.preventDefault(); event.stopPropagation(); handleAddTag(); break; case EVENT_CODE.numpadEnter: if (props2.trigger === EVENT_CODE.enter) { event.preventDefault(); event.stopPropagation(); handleAddTag(); } break; case EVENT_CODE.backspace: if (!inputValue.value && ((_a = props2.modelValue) == null ? void 0 : _a.length)) { event.preventDefault(); event.stopPropagation(); handleRemoveTag(props2.modelValue.length - 1); } break; } }; const handleKeyup = (event) => { if (isComposing.value || !isAndroid()) return; switch (getEventCode(event)) { case EVENT_CODE.space: if (props2.trigger === EVENT_CODE.space) { event.preventDefault(); event.stopPropagation(); handleAddTag(); } break; } }; const handleAddTag = () => { var _a; const value = (_a = inputValue.value) == null ? void 0 : _a.trim(); if (!value || inputLimit.value) return; addTagsEmit(value); }; const handleRemoveTag = (index) => { const value = (props2.modelValue ?? []).slice(); const [item] = value.splice(index, 1); emit(UPDATE_MODEL_EVENT, value); emit(CHANGE_EVENT, value); emit("remove-tag", item, index); }; const handleClear = () => { inputValue.value = void 0; emit(UPDATE_MODEL_EVENT, void 0); emit(CHANGE_EVENT, void 0); emit("clear"); }; const handleDragged = (draggingIndex, dropIndex, type) => { const value = (props2.modelValue ?? []).slice(); const [draggedItem] = value.splice(draggingIndex, 1); const step2 = dropIndex > draggingIndex && type === "before" ? -1 : dropIndex < draggingIndex && type === "after" ? 1 : 0; value.splice(dropIndex + step2, 0, draggedItem); emit(UPDATE_MODEL_EVENT, value); emit(CHANGE_EVENT, value); emit("drag-tag", draggingIndex, dropIndex + step2, draggedItem); }; const focus = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.blur(); }; const { wrapperRef, isFocused } = useFocusController(inputRef, { disabled, beforeBlur(event) { var _a; return (_a = tagTooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event); }, afterBlur() { var _a; if (props2.saveOnBlur) handleAddTag(); else inputValue.value = void 0; if (props2.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err)); } }); const { isComposing, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposition({ afterComposition: handleInput }); watch(() => props2.modelValue, () => { var _a; if (props2.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, CHANGE_EVENT).catch((err) => debugWarn(err)); }); return { inputRef, wrapperRef, tagTooltipRef, isFocused, isComposing, inputValue, size, tagSize, placeholder, closable, disabled, inputLimit, showTagList, collapseTagList, handleDragged, handlePaste, handleInput, handleKeydown, handleKeyup, handleAddTag, handleRemoveTag, handleClear, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd, focus, blur }; } function useInputTagDom({ props: props2, isFocused, hovering, disabled, inputValue, size, validateState, validateIcon, needStatusIcon }) { const attrs = useAttrs$1(); const slots = useSlots(); const ns = useNamespace("input-tag"); const nsInput = useNamespace("input"); const collapseItemRef = ref(); const innerRef = ref(); const containerKls = computed(() => [ ns.b(), ns.is("focused", isFocused.value), ns.is("hovering", hovering.value), ns.is("disabled", disabled.value), ns.m(size.value), ns.e("wrapper"), attrs.class ]); const containerStyle = computed(() => [attrs.style]); const innerKls = computed(() => { var _a, _b; return [ ns.e("inner"), ns.is("draggable", props2.draggable), ns.is("left-space", !((_a = props2.modelValue) == null ? void 0 : _a.length) && !slots.prefix), ns.is("right-space", !((_b = props2.modelValue) == null ? void 0 : _b.length) && !showSuffix.value) ]; }); const showClear = computed(() => { var _a; return props2.clearable && !disabled.value && !props2.readonly && (((_a = props2.modelValue) == null ? void 0 : _a.length) || inputValue.value) && (isFocused.value || hovering.value); }); const showSuffix = computed(() => { return slots.suffix || showClear.value || validateState.value && validateIcon.value && needStatusIcon.value; }); const states = reactive({ innerWidth: 0, collapseItemWidth: 0 }); const getGapWidth = () => { if (!innerRef.value) return 0; const style = window.getComputedStyle(innerRef.value); return Number.parseFloat(style.gap || "6px"); }; const resetInnerWidth = () => { states.innerWidth = Number.parseFloat(window.getComputedStyle(innerRef.value).width); }; const resetCollapseItemWidth = () => { states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width; }; const tagStyle = computed(() => { if (!props2.collapseTags) return {}; const gapWidth = getGapWidth(); const inputSlotWidth = gapWidth + MINIMUM_INPUT_WIDTH; const maxWidth = collapseItemRef.value && props2.maxCollapseTags === 1 ? states.innerWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.innerWidth - inputSlotWidth; return { maxWidth: `${Math.max(maxWidth, 0)}px` }; }); useResizeObserver(innerRef, resetInnerWidth); useResizeObserver(collapseItemRef, resetCollapseItemWidth); return { ns, nsInput, containerKls, containerStyle, innerKls, showClear, showSuffix, tagStyle, collapseItemRef, innerRef }; } const _hoisted_1$w = [ "id", "minlength", "maxlength", "disabled", "readonly", "autocomplete", "tabindex", "placeholder", "autofocus", "ariaLabel" ]; const _hoisted_2$j = ["textContent"]; var input_tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElInputTag", inheritAttrs: false, __name: "input-tag", props: inputTagProps, emits: inputTagEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const attrs = useAttrs(); const slots = useSlots(); const { form, formItem } = useFormItem(); const { inputId } = useFormItemInputId(props2, { formItemContext: formItem }); const needStatusIcon = computed(() => (form == null ? void 0 : form.statusIcon) ?? false); const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || ""); const validateIcon = computed(() => { return validateState.value && ValidateComponentsMap[validateState.value]; }); const { inputRef, wrapperRef, tagTooltipRef, isFocused, inputValue, size, tagSize, placeholder, closable, disabled, showTagList, collapseTagList, handleDragged, handlePaste, handleInput, handleKeydown, handleKeyup, handleRemoveTag, handleClear, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd, focus, blur } = useInputTag({ props: props2, emit, formItem }); const { hovering, handleMouseEnter, handleMouseLeave } = useHovering(); const { calculatorRef, inputStyle } = useCalcInputWidth(); const { dropIndicatorRef, showDropIndicator, handleDragStart, handleDragOver, handleDragEnd } = useDragTag({ wrapperRef, handleDragged, afterDragged: focus }); const { ns, nsInput, containerKls, containerStyle, innerKls, showClear, showSuffix, tagStyle, collapseItemRef, innerRef } = useInputTagDom({ props: props2, hovering, isFocused, inputValue, disabled, size, validateState, validateIcon, needStatusIcon }); __expose({ focus, blur }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "wrapperRef", ref: wrapperRef, class: normalizeClass(unref(containerKls)), style: normalizeStyle(unref(containerStyle)), onMouseenter: _cache[9] || (_cache[9] = (...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)), onMouseleave: _cache[10] || (_cache[10] = (...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)) }, [ unref(slots).prefix ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("prefix")) }, [renderSlot(_ctx.$slots, "prefix")], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref_key: "innerRef", ref: innerRef, class: normalizeClass(unref(innerKls)) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(showTagList), (item, index) => { return openBlock(), createBlock(unref(ElTag), { key: index, size: unref(tagSize), closable: unref(closable), type: __props.tagType, effect: __props.tagEffect, draggable: unref(closable) && __props.draggable, style: normalizeStyle(unref(tagStyle)), "disable-transitions": "", onClose: ($event) => unref(handleRemoveTag)(index), onDragstart: (event) => unref(handleDragStart)(event, index), onDragover: (event) => unref(handleDragOver)(event, index), onDragend: unref(handleDragEnd), onDrop: _cache[0] || (_cache[0] = withModifiers(() => { }, ["stop"])) }, { default: withCtx(() => [renderSlot(_ctx.$slots, "tag", { value: item, index }, () => [createTextVNode(toDisplayString(item), 1)])]), _: 2 }, 1032, [ "size", "closable", "type", "effect", "draggable", "style", "onClose", "onDragstart", "onDragover", "onDragend" ]); }), 128)), __props.collapseTags && __props.modelValue && __props.modelValue.length > __props.maxCollapseTags ? (openBlock(), createBlock(unref(ElTooltip), { key: 0, ref_key: "tagTooltipRef", ref: tagTooltipRef, disabled: !__props.collapseTagsTooltip, "fallback-placements": [ "bottom", "top", "right", "left" ], effect: __props.effect, placement: "bottom" }, { default: withCtx(() => [createBaseVNode("div", { ref_key: "collapseItemRef", ref: collapseItemRef, class: normalizeClass(unref(ns).e("collapse-tag")) }, [createVNode(unref(ElTag), { closable: false, size: unref(tagSize), type: __props.tagType, effect: __props.tagEffect, "disable-transitions": "" }, { default: withCtx(() => [createTextVNode(" + " + toDisplayString(__props.modelValue.length - __props.maxCollapseTags), 1)]), _: 1 }, 8, [ "size", "type", "effect" ])], 2)]), content: withCtx(() => [createBaseVNode("div", { class: normalizeClass(unref(ns).e("input-tag-list")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(collapseTagList), (item, index) => { return openBlock(), createBlock(unref(ElTag), { key: index, size: unref(tagSize), closable: unref(closable), type: __props.tagType, effect: __props.tagEffect, "disable-transitions": "", onClose: ($event) => unref(handleRemoveTag)(index + __props.maxCollapseTags) }, { default: withCtx(() => [renderSlot(_ctx.$slots, "tag", { value: item, index: index + __props.maxCollapseTags }, () => [createTextVNode(toDisplayString(item), 1)])]), _: 2 }, 1032, [ "size", "closable", "type", "effect", "onClose" ]); }), 128))], 2)]), _: 3 }, 8, ["disabled", "effect"])) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("input-wrapper")) }, [withDirectives(createBaseVNode("input", mergeProps({ id: unref(inputId), ref_key: "inputRef", ref: inputRef, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(inputValue) ? inputValue.value = $event : null) }, unref(attrs), { type: "text", minlength: __props.minlength, maxlength: __props.maxlength, disabled: unref(disabled), readonly: __props.readonly, autocomplete: __props.autocomplete, tabindex: __props.tabindex, placeholder: unref(placeholder), autofocus: __props.autofocus, ariaLabel: __props.ariaLabel, class: unref(ns).e("input"), style: unref(inputStyle), onCompositionstart: _cache[2] || (_cache[2] = (...args) => unref(handleCompositionStart) && unref(handleCompositionStart)(...args)), onCompositionupdate: _cache[3] || (_cache[3] = (...args) => unref(handleCompositionUpdate) && unref(handleCompositionUpdate)(...args)), onCompositionend: _cache[4] || (_cache[4] = (...args) => unref(handleCompositionEnd) && unref(handleCompositionEnd)(...args)), onPaste: _cache[5] || (_cache[5] = (...args) => unref(handlePaste) && unref(handlePaste)(...args)), onInput: _cache[6] || (_cache[6] = (...args) => unref(handleInput) && unref(handleInput)(...args)), onKeydown: _cache[7] || (_cache[7] = (...args) => unref(handleKeydown) && unref(handleKeydown)(...args)), onKeyup: _cache[8] || (_cache[8] = (...args) => unref(handleKeyup) && unref(handleKeyup)(...args)) }), null, 16, _hoisted_1$w), [[vModelText, unref(inputValue)]]), createBaseVNode("span", { ref_key: "calculatorRef", ref: calculatorRef, "aria-hidden": "true", class: normalizeClass(unref(ns).e("input-calculator")), textContent: toDisplayString(unref(inputValue)) }, null, 10, _hoisted_2$j)], 2), withDirectives(createBaseVNode("div", { ref_key: "dropIndicatorRef", ref: dropIndicatorRef, class: normalizeClass(unref(ns).e("drop-indicator")) }, null, 2), [[vShow, unref(showDropIndicator)]]) ], 2), unref(showSuffix) ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("suffix")) }, [ renderSlot(_ctx.$slots, "suffix"), unref(showClear) ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass([unref(ns).e("icon"), unref(ns).e("clear")]), onMousedown: withModifiers(unref(NOOP), ["prevent"]), onClick: unref(handleClear) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))]), _: 1 }, 8, [ "class", "onMousedown", "onClick" ])) : createCommentVNode("v-if", true), validateState.value && validateIcon.value && needStatusIcon.value ? (openBlock(), createBlock(unref(ElIcon), { key: 1, class: normalizeClass([ unref(nsInput).e("icon"), unref(nsInput).e("validateIcon"), unref(nsInput).is("loading", validateState.value === "validating") ]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(validateIcon.value)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2)) : createCommentVNode("v-if", true) ], 38); }; } }); var input_tag_default = input_tag_vue_vue_type_script_setup_true_lang_default; const ElInputTag = withInstall(input_tag_default); const linkProps = buildProps({ type: { type: String, values: [ "primary", "success", "warning", "info", "danger", "default" ], default: void 0 }, underline: { type: [Boolean, String], values: [ true, false, "always", "never", "hover" ], default: void 0 }, disabled: Boolean, href: { type: String, default: "" }, target: { type: String, default: "_self" }, icon: { type: iconPropType } }); const linkEmits = { click: (evt) => evt instanceof MouseEvent }; const _hoisted_1$v = ["href", "target"]; var link_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElLink", __name: "link", props: linkProps, emits: linkEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const globalConfig2 = useGlobalConfig("link"); useDeprecated({ scope: "el-link", from: "The underline option (boolean)", replacement: "'always' | 'hover' | 'never'", version: "3.0.0", ref: "https://element-plus.org/en-US/component/link.html#underline" }, computed(() => isBoolean(props2.underline))); const ns = useNamespace("link"); const linkKls = computed(() => { var _a; return [ ns.b(), ns.m(props2.type ?? ((_a = globalConfig2.value) == null ? void 0 : _a.type) ?? "default"), ns.is("disabled", props2.disabled), ns.is("underline", underline.value === "always"), ns.is("hover-underline", underline.value === "hover" && !props2.disabled) ]; }); const underline = computed(() => { var _a; if (isBoolean(props2.underline)) return props2.underline ? "hover" : "never"; else return props2.underline ?? ((_a = globalConfig2.value) == null ? void 0 : _a.underline) ?? "hover"; }); function handleClick(event) { if (!props2.disabled) emit("click", event); } return (_ctx, _cache) => { return openBlock(), createElementBlock("a", { class: normalizeClass(linkKls.value), href: __props.disabled || !__props.href ? void 0 : __props.href, target: __props.disabled || !__props.href ? void 0 : __props.target, onClick: handleClick }, [ __props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]), _: 1 })) : createCommentVNode("v-if", true), _ctx.$slots.default ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(unref(ns).e("inner")) }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true), _ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 2 }) : createCommentVNode("v-if", true) ], 10, _hoisted_1$v); }; } }); var link_default = link_vue_vue_type_script_setup_true_lang_default; const ElLink = withInstall(link_default); const MENU_INJECTION_KEY = "rootMenu"; const SUB_MENU_INJECTION_KEY = "subMenu:"; function useMenu(instance, currentIndex) { const indexPath = computed(() => { let parent = instance.parent; const path = [currentIndex.value]; while (parent.type.name !== "ElMenu") { if (parent.props.index) path.unshift(parent.props.index); parent = parent.parent; } return path; }); return { parentMenu: computed(() => { let parent = instance.parent; while (parent && !["ElMenu", "ElSubMenu"].includes(parent.type.name)) parent = parent.parent; return parent; }), indexPath }; } function useMenuColor(props2) { return computed(() => { const color = props2.backgroundColor; return color ? new TinyColor(color).shade(20).toString() : ""; }); } const useMenuCssVar = (props2, level) => { const ns = useNamespace("menu"); return computed(() => ns.cssVarBlock({ "text-color": props2.textColor || "", "hover-text-color": props2.textColor || "", "bg-color": props2.backgroundColor || "", "hover-bg-color": useMenuColor(props2).value || "", "active-color": props2.activeTextColor || "", level: `${level}` })); }; const subMenuProps = buildProps({ index: { type: String, required: true }, showTimeout: Number, hideTimeout: Number, popperClass: String, popperStyle: { type: definePropType([String, Object]) }, disabled: Boolean, teleported: { type: Boolean, default: void 0 }, popperOffset: Number, expandCloseIcon: { type: iconPropType }, expandOpenIcon: { type: iconPropType }, collapseCloseIcon: { type: iconPropType }, collapseOpenIcon: { type: iconPropType } }); const COMPONENT_NAME$8 = "ElSubMenu"; var sub_menu_default = defineComponent({ name: COMPONENT_NAME$8, props: subMenuProps, setup(props2, { slots, expose }) { const instance = getCurrentInstance(); const { indexPath, parentMenu } = useMenu(instance, computed(() => props2.index)); const nsMenu = useNamespace("menu"); const nsSubMenu = useNamespace("sub-menu"); const rootMenu = inject(MENU_INJECTION_KEY); if (!rootMenu) throwError(COMPONENT_NAME$8, "can not inject root menu"); const subMenu = inject(`${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`); if (!subMenu) throwError(COMPONENT_NAME$8, "can not inject sub menu"); const items = ref({}); const subMenus = ref({}); let timeout; const mouseInChild = ref(false); const verticalTitleRef = ref(); const vPopper = ref(); const isFirstLevel = computed(() => subMenu.level === 0); const currentPlacement = computed(() => mode.value === "horizontal" && isFirstLevel.value ? "bottom-start" : "right-start"); const subMenuTitleIcon = computed(() => { if (mode.value === "horizontal" && isFirstLevel.value || mode.value === "vertical" && !rootMenu.props.collapse) { if (props2.expandCloseIcon && props2.expandOpenIcon) return opened.value ? props2.expandOpenIcon : props2.expandCloseIcon; return arrow_down_default; } else { if (props2.collapseCloseIcon && props2.collapseOpenIcon) return opened.value ? props2.collapseOpenIcon : props2.collapseCloseIcon; return arrow_right_default; } }); const appendToBody = computed(() => { const value = props2.teleported; return isUndefined(value) ? isFirstLevel.value : value; }); const menuTransitionName = computed(() => rootMenu.props.collapse ? `${nsMenu.namespace.value}-zoom-in-left` : `${nsMenu.namespace.value}-zoom-in-top`); const fallbackPlacements = computed(() => mode.value === "horizontal" && isFirstLevel.value ? [ "bottom-start", "bottom-end", "top-start", "top-end", "right-start", "left-start" ] : [ "right-start", "right", "right-end", "left-start", "bottom-start", "bottom-end", "top-start", "top-end" ]); const opened = computed(() => rootMenu.openedMenus.includes(props2.index)); const active = computed(() => [...Object.values(items.value), ...Object.values(subMenus.value)].some(({ active: active2 }) => active2)); const mode = computed(() => rootMenu.props.mode); const persistent = computed(() => rootMenu.props.persistent); const item = reactive({ index: props2.index, indexPath, active }); const ulStyle = useMenuCssVar(rootMenu.props, subMenu.level + 1); const subMenuPopperOffset = computed(() => props2.popperOffset ?? rootMenu.props.popperOffset); const subMenuPopperClass = computed(() => props2.popperClass ?? rootMenu.props.popperClass); const subMenuPopperStyle = computed(() => props2.popperStyle ?? rootMenu.props.popperStyle); const subMenuShowTimeout = computed(() => props2.showTimeout ?? rootMenu.props.showTimeout); const subMenuHideTimeout = computed(() => props2.hideTimeout ?? rootMenu.props.hideTimeout); const doDestroy = () => { var _a, _b, _c; return (_c = (_b = (_a = vPopper.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.popperInstanceRef) == null ? void 0 : _c.destroy(); }; const handleCollapseToggle = (value) => { if (!value) doDestroy(); }; const handleClick = () => { if (rootMenu.props.menuTrigger === "hover" && rootMenu.props.mode === "horizontal" || rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props2.disabled) return; rootMenu.handleSubMenuClick({ index: props2.index, indexPath: indexPath.value, active: active.value }); }; const handleMouseenter = (event, showTimeout = subMenuShowTimeout.value) => { var _a; if (event.type === "focus") return; if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props2.disabled) { subMenu.mouseInChild.value = true; return; } subMenu.mouseInChild.value = true; timeout == null ? void 0 : timeout(); ({ stop: timeout } = useTimeoutFn(() => { rootMenu.openMenu(props2.index, indexPath.value); }, showTimeout)); if (appendToBody.value) (_a = parentMenu.value.vnode.el) == null ? void 0 : _a.dispatchEvent(new MouseEvent("mouseenter")); if (event.type === "mouseenter" && event.target) nextTick(() => { focusElement(event.target, { preventScroll: true }); }); }; const handleMouseleave = (deepDispatch = false) => { var _a; if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical") { subMenu.mouseInChild.value = false; return; } timeout == null ? void 0 : timeout(); subMenu.mouseInChild.value = false; ({ stop: timeout } = useTimeoutFn(() => !mouseInChild.value && rootMenu.closeMenu(props2.index, indexPath.value), subMenuHideTimeout.value)); if (appendToBody.value && deepDispatch) (_a = subMenu.handleMouseleave) == null ? void 0 : _a.call(subMenu, true); }; watch(() => rootMenu.props.collapse, (value) => handleCollapseToggle(Boolean(value))); { const addSubMenu = (item2) => { subMenus.value[item2.index] = item2; }; const removeSubMenu = (item2) => { delete subMenus.value[item2.index]; }; provide(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, { addSubMenu, removeSubMenu, handleMouseleave, mouseInChild, level: subMenu.level + 1 }); } expose({ opened }); onMounted(() => { rootMenu.addSubMenu(item); subMenu.addSubMenu(item); }); onBeforeUnmount(() => { subMenu.removeSubMenu(item); rootMenu.removeSubMenu(item); }); return () => { var _a; const titleTag = [(_a = slots.title) == null ? void 0 : _a.call(slots), h(ElIcon, { class: nsSubMenu.e("icon-arrow"), style: { transform: opened.value ? props2.expandCloseIcon && props2.expandOpenIcon || props2.collapseCloseIcon && props2.collapseOpenIcon && rootMenu.props.collapse ? "none" : "rotateZ(180deg)" : "none" } }, { default: () => isString(subMenuTitleIcon.value) ? h(instance.appContext.components[subMenuTitleIcon.value]) : h(subMenuTitleIcon.value) })]; const child = rootMenu.isMenuPopup ? h(ElTooltip, { ref: vPopper, visible: opened.value, effect: "light", pure: true, offset: subMenuPopperOffset.value, showArrow: false, persistent: persistent.value, popperClass: subMenuPopperClass.value, popperStyle: subMenuPopperStyle.value, placement: currentPlacement.value, teleported: appendToBody.value, fallbackPlacements: fallbackPlacements.value, transition: menuTransitionName.value, gpuAcceleration: false }, { content: () => { var _a2; return h("div", { class: [ nsMenu.m(mode.value), nsMenu.m("popup-container"), subMenuPopperClass.value ], onMouseenter: (evt) => handleMouseenter(evt, 100), onMouseleave: () => handleMouseleave(true), onFocus: (evt) => handleMouseenter(evt, 100) }, [h("ul", { class: [ nsMenu.b(), nsMenu.m("popup"), nsMenu.m(`popup-${currentPlacement.value}`) ], style: ulStyle.value }, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)])]); }, default: () => h("div", { class: nsSubMenu.e("title"), onClick: handleClick }, titleTag) }) : h(Fragment, {}, [h("div", { class: nsSubMenu.e("title"), ref: verticalTitleRef, onClick: handleClick }, titleTag), h(ElCollapseTransition, {}, { default: () => { var _a2; return withDirectives(h("ul", { role: "menu", class: [nsMenu.b(), nsMenu.m("inline")], style: ulStyle.value }, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)]), [[vShow, opened.value]]); } })]); return h("li", { class: [ nsSubMenu.b(), nsSubMenu.is("active", active.value), nsSubMenu.is("opened", opened.value), nsSubMenu.is("disabled", props2.disabled) ], role: "menuitem", ariaHaspopup: true, ariaExpanded: opened.value, onMouseenter: handleMouseenter, onMouseleave: () => handleMouseleave(), onFocus: handleMouseenter }, [child]); }; } }); var SubMenu = class { constructor(parent, domNode) { this.parent = parent; this.domNode = domNode; this.subIndex = 0; this.subIndex = 0; this.init(); } init() { this.subMenuItems = this.domNode.querySelectorAll("li"); this.addListeners(); } gotoSubIndex(idx) { if (idx === this.subMenuItems.length) idx = 0; else if (idx < 0) idx = this.subMenuItems.length - 1; this.subMenuItems[idx].focus(); this.subIndex = idx; } addListeners() { const parentNode = this.parent.domNode; Array.prototype.forEach.call(this.subMenuItems, (el) => { el.addEventListener("keydown", (event) => { const code = getEventCode(event); let prevDef = false; switch (code) { case EVENT_CODE.down: this.gotoSubIndex(this.subIndex + 1); prevDef = true; break; case EVENT_CODE.up: this.gotoSubIndex(this.subIndex - 1); prevDef = true; break; case EVENT_CODE.tab: triggerEvent(parentNode, "mouseleave"); break; case EVENT_CODE.enter: case EVENT_CODE.numpadEnter: case EVENT_CODE.space: prevDef = true; event.currentTarget.click(); break; } if (prevDef) { event.preventDefault(); event.stopPropagation(); } return false; }); }); } }; var MenuItem = class { constructor(domNode, namespace) { this.domNode = domNode; this.submenu = null; this.submenu = null; this.init(namespace); } init(namespace) { this.domNode.setAttribute("tabindex", "0"); const menuChild = this.domNode.querySelector(`.${namespace}-menu`); if (menuChild) this.submenu = new SubMenu(this, menuChild); this.addListeners(); } addListeners() { this.domNode.addEventListener("keydown", (event) => { const code = getEventCode(event); let prevDef = false; switch (code) { case EVENT_CODE.down: triggerEvent(event.currentTarget, "mouseenter"); this.submenu && this.submenu.gotoSubIndex(0); prevDef = true; break; case EVENT_CODE.up: triggerEvent(event.currentTarget, "mouseenter"); this.submenu && this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1); prevDef = true; break; case EVENT_CODE.tab: triggerEvent(event.currentTarget, "mouseleave"); break; case EVENT_CODE.enter: case EVENT_CODE.numpadEnter: case EVENT_CODE.space: prevDef = true; event.currentTarget.click(); break; } if (prevDef) event.preventDefault(); }); } }; var Menu = class { constructor(domNode, namespace) { this.domNode = domNode; this.init(namespace); } init(namespace) { const menuChildren = this.domNode.childNodes; Array.from(menuChildren).forEach((child) => { if (child.nodeType === 1) new MenuItem(child, namespace); }); } }; var menu_collapse_transition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElMenuCollapseTransition", __name: "menu-collapse-transition", setup(__props) { const ns = useNamespace("menu"); const listeners = { onBeforeEnter: (el) => el.style.opacity = "0.2", onEnter(el, done) { addClass(el, `${ns.namespace.value}-opacity-transition`); el.style.opacity = "1"; done(); }, onAfterEnter(el) { removeClass(el, `${ns.namespace.value}-opacity-transition`); el.style.opacity = ""; }, onBeforeLeave(el) { if (!el.dataset) el.dataset = {}; if (hasClass(el, ns.m("collapse"))) { removeClass(el, ns.m("collapse")); el.dataset.oldOverflow = el.style.overflow; el.dataset.scrollWidth = el.clientWidth.toString(); addClass(el, ns.m("collapse")); } else { addClass(el, ns.m("collapse")); el.dataset.oldOverflow = el.style.overflow; el.dataset.scrollWidth = el.clientWidth.toString(); removeClass(el, ns.m("collapse")); } el.style.width = `${el.scrollWidth}px`; el.style.overflow = "hidden"; }, onLeave(el) { addClass(el, "horizontal-collapse-transition"); el.style.width = `${el.dataset.scrollWidth}px`; } }; return (_ctx, _cache) => { return openBlock(), createBlock(Transition, mergeProps({ mode: "out-in" }, listeners), { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var menu_collapse_transition_default = menu_collapse_transition_vue_vue_type_script_setup_true_lang_default; const menuProps = buildProps({ mode: { type: String, values: ["horizontal", "vertical"], default: "vertical" }, defaultActive: { type: String, default: "" }, defaultOpeneds: { type: definePropType(Array), default: () => mutable([]) }, uniqueOpened: Boolean, router: Boolean, menuTrigger: { type: String, values: ["hover", "click"], default: "hover" }, collapse: Boolean, backgroundColor: String, textColor: String, activeTextColor: String, closeOnClickOutside: Boolean, collapseTransition: { type: Boolean, default: true }, ellipsis: { type: Boolean, default: true }, popperOffset: { type: Number, default: 6 }, ellipsisIcon: { type: iconPropType, default: () => more_default }, popperEffect: { type: definePropType(String), default: "dark" }, popperClass: String, popperStyle: { type: definePropType([String, Object]) }, showTimeout: { type: Number, default: 300 }, hideTimeout: { type: Number, default: 300 }, persistent: { type: Boolean, default: true } }); const checkIndexPath = (indexPath) => isArray(indexPath) && indexPath.every((path) => isString(path)); const menuEmits = { close: (index, indexPath) => isString(index) && checkIndexPath(indexPath), open: (index, indexPath) => isString(index) && checkIndexPath(indexPath), select: (index, indexPath, item, routerResult) => isString(index) && checkIndexPath(indexPath) && isObject(item) && (isUndefined(routerResult) || routerResult instanceof Promise) }; const DEFAULT_MORE_ITEM_WIDTH = 64; var menu_default = defineComponent({ name: "ElMenu", props: menuProps, emits: menuEmits, setup(props2, { emit, slots, expose }) { const instance = getCurrentInstance(); const router = instance.appContext.config.globalProperties.$router; const menu = ref(); const subMenu = ref(); const nsMenu = useNamespace("menu"); const nsSubMenu = useNamespace("sub-menu"); let moreItemWidth = DEFAULT_MORE_ITEM_WIDTH; const sliceIndex = ref(-1); const openedMenus = ref(props2.defaultOpeneds && !props2.collapse ? props2.defaultOpeneds.slice(0) : []); const activeIndex = ref(props2.defaultActive); const items = ref({}); const subMenus = ref({}); const isMenuPopup = computed(() => props2.mode === "horizontal" || props2.mode === "vertical" && props2.collapse); const initMenu = () => { const activeItem = activeIndex.value && items.value[activeIndex.value]; if (!activeItem || props2.mode === "horizontal" || props2.collapse) return; activeItem.indexPath.forEach((index) => { const subMenu2 = subMenus.value[index]; subMenu2 && openMenu(index, subMenu2.indexPath); }); }; const openMenu = (index, indexPath) => { if (openedMenus.value.includes(index)) return; if (props2.uniqueOpened) openedMenus.value = openedMenus.value.filter((index2) => indexPath.includes(index2)); openedMenus.value.push(index); emit("open", index, indexPath); }; const close2 = (index) => { const i = openedMenus.value.indexOf(index); if (i !== -1) openedMenus.value.splice(i, 1); }; const closeMenu = (index, indexPath) => { close2(index); emit("close", index, indexPath); }; const handleSubMenuClick = ({ index, indexPath }) => { openedMenus.value.includes(index) ? closeMenu(index, indexPath) : openMenu(index, indexPath); }; const handleMenuItemClick = (menuItem) => { if (props2.mode === "horizontal" || props2.collapse) openedMenus.value = []; const { index, indexPath } = menuItem; if (isNil(index) || isNil(indexPath)) return; if (props2.router && router) { const route = menuItem.route || index; const routerResult = router.push(route).then((res) => { if (!res) activeIndex.value = index; return res; }); emit("select", index, indexPath, { index, indexPath, route }, routerResult); } else { activeIndex.value = index; emit("select", index, indexPath, { index, indexPath }); } }; const updateActiveIndex = (val) => { var _a; const itemsInData = items.value; activeIndex.value = ((_a = itemsInData[val] || activeIndex.value && itemsInData[activeIndex.value] || itemsInData[props2.defaultActive]) == null ? void 0 : _a.index) ?? val; }; const calcMenuItemWidth = (menuItem) => { const computedStyle = getComputedStyle(menuItem); const marginLeft = Number.parseInt(computedStyle.marginLeft, 10); const marginRight = Number.parseInt(computedStyle.marginRight, 10); return menuItem.offsetWidth + marginLeft + marginRight || 0; }; const calcSliceIndex = () => { if (!menu.value) return -1; const items2 = Array.from(menu.value.childNodes).filter((item) => item.nodeName !== "#comment" && (item.nodeName !== "#text" || item.nodeValue)); const computedMenuStyle = getComputedStyle(menu.value); const paddingLeft = Number.parseInt(computedMenuStyle.paddingLeft, 10); const paddingRight = Number.parseInt(computedMenuStyle.paddingRight, 10); const menuWidth = menu.value.clientWidth - paddingLeft - paddingRight; let calcWidth = 0; let sliceIndex2 = 0; items2.forEach((item, index) => { calcWidth += calcMenuItemWidth(item); if (calcWidth <= menuWidth - moreItemWidth) sliceIndex2 = index + 1; }); return sliceIndex2 === items2.length ? -1 : sliceIndex2; }; const getIndexPath = (index) => subMenus.value[index].indexPath; const debounce2 = (fn, wait = 33.34) => { let timer; return () => { timer && clearTimeout(timer); timer = setTimeout(() => { fn(); }, wait); }; }; let isFirstTimeRender = true; const handleResize = () => { const el = unrefElement(subMenu); if (el) moreItemWidth = calcMenuItemWidth(el) || DEFAULT_MORE_ITEM_WIDTH; if (sliceIndex.value === calcSliceIndex()) return; const callback = () => { sliceIndex.value = -1; nextTick(() => { sliceIndex.value = calcSliceIndex(); }); }; isFirstTimeRender ? callback() : debounce2(callback)(); isFirstTimeRender = false; }; watch(() => props2.defaultActive, (currentActive) => { if (!items.value[currentActive]) activeIndex.value = ""; updateActiveIndex(currentActive); }); watch(() => props2.collapse, (value) => { if (value) openedMenus.value = []; }); watch(items.value, initMenu); let resizeStopper; watchEffect(() => { if (props2.mode === "horizontal" && props2.ellipsis) resizeStopper = useResizeObserver(menu, handleResize).stop; else resizeStopper == null ? void 0 : resizeStopper(); }); const mouseInChild = ref(false); { const addSubMenu = (item) => { subMenus.value[item.index] = item; }; const removeSubMenu = (item) => { delete subMenus.value[item.index]; }; const addMenuItem = (item) => { items.value[item.index] = item; }; const removeMenuItem = (item) => { delete items.value[item.index]; }; provide(MENU_INJECTION_KEY, reactive({ props: props2, openedMenus, items, subMenus, activeIndex, isMenuPopup, addMenuItem, removeMenuItem, addSubMenu, removeSubMenu, openMenu, closeMenu, handleMenuItemClick, handleSubMenuClick })); provide(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, { addSubMenu, removeSubMenu, mouseInChild, level: 0 }); } onMounted(() => { if (props2.mode === "horizontal") new Menu(instance.vnode.el, nsMenu.namespace.value); }); { const open = (index) => { const { indexPath } = subMenus.value[index]; indexPath.forEach((i) => openMenu(i, indexPath)); }; expose({ open, close: close2, updateActiveIndex, handleResize }); } const ulStyle = useMenuCssVar(props2, 0); return () => { var _a; let slot = ((_a = slots.default) == null ? void 0 : _a.call(slots)) ?? []; const vShowMore = []; if (props2.mode === "horizontal" && menu.value) { const originalSlot = flattedChildren(slot).filter((vnode) => { return (vnode == null ? void 0 : vnode.shapeFlag) !== 8; }); const slotDefault = sliceIndex.value === -1 ? originalSlot : originalSlot.slice(0, sliceIndex.value); const slotMore = sliceIndex.value === -1 ? [] : originalSlot.slice(sliceIndex.value); if ((slotMore == null ? void 0 : slotMore.length) && props2.ellipsis) { slot = slotDefault; vShowMore.push(h(sub_menu_default, { ref: subMenu, index: "sub-menu-more", class: nsSubMenu.e("hide-arrow"), popperOffset: props2.popperOffset }, { title: () => h(ElIcon, { class: nsSubMenu.e("icon-more") }, { default: () => h(props2.ellipsisIcon) }), default: () => slotMore })); } } const directives = props2.closeOnClickOutside ? [[ClickOutside, () => { if (!openedMenus.value.length) return; if (!mouseInChild.value) { openedMenus.value.forEach((openedMenu) => emit("close", openedMenu, getIndexPath(openedMenu))); openedMenus.value = []; } }]] : []; const vMenu = withDirectives(h("ul", { key: String(props2.collapse), role: "menubar", ref: menu, style: ulStyle.value, class: { [nsMenu.b()]: true, [nsMenu.m(props2.mode)]: true, [nsMenu.m("collapse")]: props2.collapse } }, [...slot, ...vShowMore]), directives); if (props2.collapseTransition && props2.mode === "vertical") return h(menu_collapse_transition_default, () => vMenu); return vMenu; }; } }); const menuItemProps = buildProps({ index: { type: definePropType([String, null]), default: null }, route: { type: definePropType([String, Object]) }, disabled: Boolean }); const menuItemEmits = { click: (item) => isString(item.index) && isArray(item.indexPath) }; const menuItemGroupProps = { title: String }; const COMPONENT_NAME$7 = "ElMenuItem"; var menu_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$7, __name: "menu-item", props: menuItemProps, emits: menuItemEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; isPropAbsent(props2.index) && debugWarn(COMPONENT_NAME$7, 'Missing required prop: "index"'); const instance = getCurrentInstance(); const rootMenu = inject(MENU_INJECTION_KEY); const nsMenu = useNamespace("menu"); const nsMenuItem = useNamespace("menu-item"); if (!rootMenu) throwError(COMPONENT_NAME$7, "can not inject root menu"); const { parentMenu, indexPath } = useMenu(instance, toRef(props2, "index")); const subMenu = inject(`${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`); if (!subMenu) throwError(COMPONENT_NAME$7, "can not inject sub menu"); const active = computed(() => props2.index === rootMenu.activeIndex); const item = reactive({ index: props2.index, indexPath, active }); const handleClick = () => { if (!props2.disabled) { rootMenu.handleMenuItemClick({ index: props2.index, indexPath: indexPath.value, route: props2.route }); emit("click", item); } }; onMounted(() => { subMenu.addSubMenu(item); rootMenu.addMenuItem(item); }); onBeforeUnmount(() => { subMenu.removeSubMenu(item); rootMenu.removeMenuItem(item); }); __expose({ parentMenu, rootMenu, active, nsMenu, nsMenuItem, handleClick }); return (_ctx, _cache) => { return openBlock(), createElementBlock("li", { class: normalizeClass([ unref(nsMenuItem).b(), unref(nsMenuItem).is("active", active.value), unref(nsMenuItem).is("disabled", __props.disabled) ]), role: "menuitem", tabindex: "-1", onClick: handleClick }, [unref(parentMenu).type.name === "ElMenu" && unref(rootMenu).props.collapse && _ctx.$slots.title ? (openBlock(), createBlock(unref(ElTooltip), { key: 0, effect: unref(rootMenu).props.popperEffect, placement: "right", "fallback-placements": ["left"], "popper-class": unref(rootMenu).props.popperClass, "popper-style": unref(rootMenu).props.popperStyle, persistent: unref(rootMenu).props.persistent, "focus-on-target": "" }, { content: withCtx(() => [renderSlot(_ctx.$slots, "title")]), default: withCtx(() => [createBaseVNode("div", { class: normalizeClass(unref(nsMenu).be("tooltip", "trigger")) }, [renderSlot(_ctx.$slots, "default")], 2)]), _: 3 }, 8, [ "effect", "popper-class", "popper-style", "persistent" ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [renderSlot(_ctx.$slots, "default"), renderSlot(_ctx.$slots, "title")], 64))], 2); }; } }); var menu_item_default = menu_item_vue_vue_type_script_setup_true_lang_default; var menu_item_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElMenuItemGroup", __name: "menu-item-group", props: menuItemGroupProps, setup(__props) { const ns = useNamespace("menu-item-group"); return (_ctx, _cache) => { return openBlock(), createElementBlock("li", { class: normalizeClass(unref(ns).b()) }, [createBaseVNode("div", { class: normalizeClass(unref(ns).e("title")) }, [!_ctx.$slots.title ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(__props.title), 1)], 64)) : renderSlot(_ctx.$slots, "title", { key: 1 })], 2), createBaseVNode("ul", null, [renderSlot(_ctx.$slots, "default")])], 2); }; } }); var menu_item_group_default = menu_item_group_vue_vue_type_script_setup_true_lang_default; const ElMenu = withInstall(menu_default, { MenuItem: menu_item_default, MenuItemGroup: menu_item_group_default, SubMenu: sub_menu_default }); const ElMenuItem = withNoopInstall(menu_item_default); const ElMenuItemGroup = withNoopInstall(menu_item_group_default); const ElSubMenu = withNoopInstall(sub_menu_default); const pageHeaderProps = buildProps({ icon: { type: iconPropType, default: () => back_default }, title: String, content: { type: String, default: "" } }); const pageHeaderEmits = { back: () => true }; const _hoisted_1$u = ["aria-label"]; var page_header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPageHeader", __name: "page-header", props: pageHeaderProps, emits: pageHeaderEmits, setup(__props, { emit: __emit }) { const emit = __emit; const { t } = useLocale(); const ns = useNamespace("page-header"); function handleClick() { emit("back"); } return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([ unref(ns).b(), unref(ns).is("contentful", !!_ctx.$slots.default), { [unref(ns).m("has-breadcrumb")]: !!_ctx.$slots.breadcrumb, [unref(ns).m("has-extra")]: !!_ctx.$slots.extra } ]) }, [ _ctx.$slots.breadcrumb ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("breadcrumb")) }, [renderSlot(_ctx.$slots, "breadcrumb")], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("header")) }, [createBaseVNode("div", { class: normalizeClass(unref(ns).e("left")) }, [ createBaseVNode("div", { class: normalizeClass(unref(ns).e("back")), role: "button", tabindex: "0", onClick: handleClick }, [__props.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", { key: 0, "aria-label": __props.title || unref(t)("el.pageHeader.title"), class: normalizeClass(unref(ns).e("icon")) }, [renderSlot(_ctx.$slots, "icon", {}, () => [__props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]), _: 1 })) : createCommentVNode("v-if", true)])], 10, _hoisted_1$u)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("title")) }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title || unref(t)("el.pageHeader.title")), 1)])], 2)], 2), createVNode(unref(ElDivider), { direction: "vertical" }), createBaseVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [renderSlot(_ctx.$slots, "content", {}, () => [createTextVNode(toDisplayString(__props.content), 1)])], 2) ], 2), _ctx.$slots.extra ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("extra")) }, [renderSlot(_ctx.$slots, "extra")], 2)) : createCommentVNode("v-if", true)], 2), _ctx.$slots.default ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("main")) }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true) ], 2); }; } }); var page_header_default = page_header_vue_vue_type_script_setup_true_lang_default; const ElPageHeader = withInstall(page_header_default); const elPaginationKey = Symbol("elPaginationKey"); const paginationPrevProps = buildProps({ disabled: Boolean, currentPage: { type: Number, default: 1 }, prevText: { type: String }, prevIcon: { type: iconPropType } }); const paginationPrevEmits = { click: (evt) => evt instanceof MouseEvent }; const _hoisted_1$t = [ "disabled", "aria-label", "aria-disabled" ]; const _hoisted_2$i = { key: 0 }; var prev_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPaginationPrev", __name: "prev", props: paginationPrevProps, emits: paginationPrevEmits, setup(__props) { const props2 = __props; const { t } = useLocale(); const internalDisabled = computed(() => props2.disabled || props2.currentPage <= 1); return (_ctx, _cache) => { return openBlock(), createElementBlock("button", { type: "button", class: "btn-prev", disabled: internalDisabled.value, "aria-label": _ctx.prevText || unref(t)("el.pagination.prev"), "aria-disabled": internalDisabled.value, onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event)) }, [_ctx.prevText ? (openBlock(), createElementBlock("span", _hoisted_2$i, toDisplayString(_ctx.prevText), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon)))]), _: 1 }))], 8, _hoisted_1$t); }; } }); var prev_default = prev_vue_vue_type_script_setup_true_lang_default; const paginationNextProps = buildProps({ disabled: Boolean, currentPage: { type: Number, default: 1 }, pageCount: { type: Number, default: 50 }, nextText: { type: String }, nextIcon: { type: iconPropType } }); const _hoisted_1$s = [ "disabled", "aria-label", "aria-disabled" ]; const _hoisted_2$h = { key: 0 }; var next_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPaginationNext", __name: "next", props: paginationNextProps, emits: ["click"], setup(__props) { const props2 = __props; const { t } = useLocale(); const internalDisabled = computed(() => props2.disabled || props2.currentPage === props2.pageCount || props2.pageCount === 0); return (_ctx, _cache) => { return openBlock(), createElementBlock("button", { type: "button", class: "btn-next", disabled: internalDisabled.value, "aria-label": _ctx.nextText || unref(t)("el.pagination.next"), "aria-disabled": internalDisabled.value, onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event)) }, [_ctx.nextText ? (openBlock(), createElementBlock("span", _hoisted_2$h, toDisplayString(_ctx.nextText), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon)))]), _: 1 }))], 8, _hoisted_1$s); }; } }); var next_default = next_vue_vue_type_script_setup_true_lang_default; const usePagination = () => inject(elPaginationKey, {}); const paginationSizesProps = buildProps({ pageSize: { type: Number, required: true }, pageSizes: { type: definePropType(Array), default: () => mutable([ 10, 20, 30, 40, 50, 100 ]) }, popperClass: { type: String }, popperStyle: { type: definePropType([String, Object]) }, disabled: Boolean, teleported: Boolean, size: { type: String, values: componentSizes }, appendSizeTo: String }); var sizes_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPaginationSizes", __name: "sizes", props: paginationSizesProps, emits: ["page-size-change"], setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const { t } = useLocale(); const ns = useNamespace("pagination"); const pagination = usePagination(); const innerPageSize = ref(props2.pageSize); watch(() => props2.pageSizes, (newVal, oldVal) => { if (isEqual(newVal, oldVal)) return; if (isArray(newVal)) emit("page-size-change", newVal.includes(props2.pageSize) ? props2.pageSize : props2.pageSizes[0]); }); watch(() => props2.pageSize, (newVal) => { innerPageSize.value = newVal; }); const innerPageSizes = computed(() => props2.pageSizes); function handleChange(val) { var _a; if (val !== innerPageSize.value) { innerPageSize.value = val; (_a = pagination.handleSizeChange) == null ? void 0 : _a.call(pagination, Number(val)); } } return (_ctx, _cache) => { return openBlock(), createElementBlock("span", { class: normalizeClass(unref(ns).e("sizes")) }, [createVNode(unref(ElSelect), { "model-value": innerPageSize.value, disabled: _ctx.disabled, "popper-class": _ctx.popperClass, "popper-style": _ctx.popperStyle, size: _ctx.size, teleported: _ctx.teleported, "validate-event": false, "append-to": _ctx.appendSizeTo, onChange: handleChange }, { default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(innerPageSizes.value, (item) => { return openBlock(), createBlock(unref(ElOption), { key: item, value: item, label: item + unref(t)("el.pagination.pagesize") }, null, 8, ["value", "label"]); }), 128))]), _: 1 }, 8, [ "model-value", "disabled", "popper-class", "popper-style", "size", "teleported", "append-to" ])], 2); }; } }); var sizes_default = sizes_vue_vue_type_script_setup_true_lang_default; const paginationJumperProps = buildProps({ size: { type: String, values: componentSizes } }); const _hoisted_1$r = ["disabled"]; var jumper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPaginationJumper", __name: "jumper", props: paginationJumperProps, setup(__props) { const { t } = useLocale(); const ns = useNamespace("pagination"); const { pageCount, disabled, currentPage, changeEvent } = usePagination(); const userInput = ref(); const innerValue = computed(() => userInput.value ?? (currentPage == null ? void 0 : currentPage.value)); function handleInput(val) { userInput.value = val ? +val : ""; } function handleChange(val) { val = Math.trunc(+val); changeEvent == null ? void 0 : changeEvent(val); userInput.value = void 0; } return (_ctx, _cache) => { return openBlock(), createElementBlock("span", { class: normalizeClass(unref(ns).e("jump")), disabled: unref(disabled) }, [ createBaseVNode("span", { class: normalizeClass([unref(ns).e("goto")]) }, toDisplayString(unref(t)("el.pagination.goto")), 3), createVNode(unref(ElInput), { size: _ctx.size, class: normalizeClass([unref(ns).e("editor"), unref(ns).is("in-pagination")]), min: 1, max: unref(pageCount), disabled: unref(disabled), "model-value": innerValue.value, "validate-event": false, "aria-label": unref(t)("el.pagination.page"), type: "number", "onUpdate:modelValue": handleInput, onChange: handleChange }, null, 8, [ "size", "class", "max", "disabled", "model-value", "aria-label" ]), createBaseVNode("span", { class: normalizeClass([unref(ns).e("classifier")]) }, toDisplayString(unref(t)("el.pagination.pageClassifier")), 3) ], 10, _hoisted_1$r); }; } }); var jumper_default = jumper_vue_vue_type_script_setup_true_lang_default; const paginationTotalProps = buildProps({ total: { type: Number, default: 1e3 } }); const _hoisted_1$q = ["disabled"]; var total_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPaginationTotal", __name: "total", props: paginationTotalProps, setup(__props) { const { t } = useLocale(); const ns = useNamespace("pagination"); const { disabled } = usePagination(); return (_ctx, _cache) => { return openBlock(), createElementBlock("span", { class: normalizeClass(unref(ns).e("total")), disabled: unref(disabled) }, toDisplayString(unref(t)("el.pagination.total", { total: _ctx.total })), 11, _hoisted_1$q); }; } }); var total_default = total_vue_vue_type_script_setup_true_lang_default; const paginationPagerProps = buildProps({ currentPage: { type: Number, default: 1 }, pageCount: { type: Number, required: true }, pagerCount: { type: Number, default: 7 }, disabled: Boolean }); const _hoisted_1$p = [ "aria-current", "aria-label", "tabindex" ]; const _hoisted_2$g = ["tabindex", "aria-label"]; const _hoisted_3$7 = [ "aria-current", "aria-label", "tabindex" ]; const _hoisted_4$5 = ["tabindex", "aria-label"]; const _hoisted_5$3 = [ "aria-current", "aria-label", "tabindex" ]; var pager_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPaginationPager", __name: "pager", props: paginationPagerProps, emits: [CHANGE_EVENT], setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const nsPager = useNamespace("pager"); const nsIcon = useNamespace("icon"); const { t } = useLocale(); const showPrevMore = ref(false); const showNextMore = ref(false); const quickPrevHover = ref(false); const quickNextHover = ref(false); const quickPrevFocus = ref(false); const quickNextFocus = ref(false); const pagers = computed(() => { const pagerCount = props2.pagerCount; const halfPagerCount = (pagerCount - 1) / 2; const currentPage = Number(props2.currentPage); const pageCount = Number(props2.pageCount); let showPrevMore2 = false; let showNextMore2 = false; if (pageCount > pagerCount) { if (currentPage > pagerCount - halfPagerCount) showPrevMore2 = true; if (currentPage < pageCount - halfPagerCount) showNextMore2 = true; } const array = []; if (showPrevMore2 && !showNextMore2) { const startPage = pageCount - (pagerCount - 2); for (let i = startPage; i < pageCount; i++) array.push(i); } else if (!showPrevMore2 && showNextMore2) for (let i = 2; i < pagerCount; i++) array.push(i); else if (showPrevMore2 && showNextMore2) { const offset2 = Math.floor(pagerCount / 2) - 1; for (let i = currentPage - offset2; i <= currentPage + offset2; i++) array.push(i); } else for (let i = 2; i < pageCount; i++) array.push(i); return array; }); const prevMoreKls = computed(() => [ "more", "btn-quickprev", nsIcon.b(), nsPager.is("disabled", props2.disabled) ]); const nextMoreKls = computed(() => [ "more", "btn-quicknext", nsIcon.b(), nsPager.is("disabled", props2.disabled) ]); const tabindex = computed(() => props2.disabled ? -1 : 0); watch(() => [ props2.pageCount, props2.pagerCount, props2.currentPage ], ([pageCount, pagerCount, currentPage]) => { const halfPagerCount = (pagerCount - 1) / 2; let showPrev = false; let showNext = false; if (pageCount > pagerCount) { showPrev = currentPage > pagerCount - halfPagerCount; showNext = currentPage < pageCount - halfPagerCount; } quickPrevHover.value && (quickPrevHover.value = showPrev); quickNextHover.value && (quickNextHover.value = showNext); showPrevMore.value = showPrev; showNextMore.value = showNext; }, { immediate: true }); function onMouseEnter(forward = false) { if (props2.disabled) return; if (forward) quickPrevHover.value = true; else quickNextHover.value = true; } function onFocus(forward = false) { if (forward) quickPrevFocus.value = true; else quickNextFocus.value = true; } function onEnter(e) { const target = e.target; if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) { const newPage = Number(target.textContent); if (newPage !== props2.currentPage) emit(CHANGE_EVENT, newPage); } else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) onPagerClick(e); } function onPagerClick(event) { const target = event.target; if (target.tagName.toLowerCase() === "ul" || props2.disabled) return; let newPage = Number(target.textContent); const pageCount = props2.pageCount; const currentPage = props2.currentPage; const pagerCountOffset = props2.pagerCount - 2; if (target.className.includes("more")) { if (target.className.includes("quickprev")) newPage = currentPage - pagerCountOffset; else if (target.className.includes("quicknext")) newPage = currentPage + pagerCountOffset; } if (!Number.isNaN(+newPage)) { if (newPage < 1) newPage = 1; if (newPage > pageCount) newPage = pageCount; } if (newPage !== currentPage) emit(CHANGE_EVENT, newPage); } return (_ctx, _cache) => { return openBlock(), createElementBlock("ul", { class: normalizeClass(unref(nsPager).b()), onClick: onPagerClick, onKeyup: withKeys(onEnter, ["enter"]) }, [ _ctx.pageCount > 0 ? (openBlock(), createElementBlock("li", { key: 0, class: normalizeClass([[unref(nsPager).is("active", _ctx.currentPage === 1), unref(nsPager).is("disabled", _ctx.disabled)], "number"]), "aria-current": _ctx.currentPage === 1, "aria-label": unref(t)("el.pagination.currentPage", { pager: 1 }), tabindex: tabindex.value }, " 1 ", 10, _hoisted_1$p)) : createCommentVNode("v-if", true), showPrevMore.value ? (openBlock(), createElementBlock("li", { key: 1, class: normalizeClass(prevMoreKls.value), tabindex: tabindex.value, "aria-label": unref(t)("el.pagination.prevPages", { pager: _ctx.pagerCount - 2 }), onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)), onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false), onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)), onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false) }, [(quickPrevHover.value || quickPrevFocus.value) && !_ctx.disabled ? (openBlock(), createBlock(unref(d_arrow_left_default), { key: 0 })) : (openBlock(), createBlock(unref(more_filled_default), { key: 1 }))], 42, _hoisted_2$g)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(pagers.value, (pager) => { return openBlock(), createElementBlock("li", { key: pager, class: normalizeClass([[unref(nsPager).is("active", _ctx.currentPage === pager), unref(nsPager).is("disabled", _ctx.disabled)], "number"]), "aria-current": _ctx.currentPage === pager, "aria-label": unref(t)("el.pagination.currentPage", { pager }), tabindex: tabindex.value }, toDisplayString(pager), 11, _hoisted_3$7); }), 128)), showNextMore.value ? (openBlock(), createElementBlock("li", { key: 2, class: normalizeClass(nextMoreKls.value), tabindex: tabindex.value, "aria-label": unref(t)("el.pagination.nextPages", { pager: _ctx.pagerCount - 2 }), onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()), onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false), onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()), onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false) }, [(quickNextHover.value || quickNextFocus.value) && !_ctx.disabled ? (openBlock(), createBlock(unref(d_arrow_right_default), { key: 0 })) : (openBlock(), createBlock(unref(more_filled_default), { key: 1 }))], 42, _hoisted_4$5)) : createCommentVNode("v-if", true), _ctx.pageCount > 1 ? (openBlock(), createElementBlock("li", { key: 3, class: normalizeClass([[unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount), unref(nsPager).is("disabled", _ctx.disabled)], "number"]), "aria-current": _ctx.currentPage === _ctx.pageCount, "aria-label": unref(t)("el.pagination.currentPage", { pager: _ctx.pageCount }), tabindex: tabindex.value }, toDisplayString(_ctx.pageCount), 11, _hoisted_5$3)) : createCommentVNode("v-if", true) ], 34); }; } }); var pager_default = pager_vue_vue_type_script_setup_true_lang_default; const isAbsent = (v) => typeof v !== "number"; const paginationProps = buildProps({ pageSize: Number, defaultPageSize: Number, total: Number, pageCount: Number, pagerCount: { type: Number, validator: (value) => { return isNumber(value) && Math.trunc(value) === value && value > 4 && value < 22 && value % 2 === 1; }, default: 7 }, currentPage: Number, defaultCurrentPage: Number, layout: { type: String, default: [ "prev", "pager", "next", "jumper", "->", "total" ].join(", ") }, pageSizes: { type: definePropType(Array), default: () => mutable([ 10, 20, 30, 40, 50, 100 ]) }, popperClass: { type: String, default: "" }, popperStyle: { type: definePropType([String, Object]) }, prevText: { type: String, default: "" }, prevIcon: { type: iconPropType, default: () => arrow_left_default }, nextText: { type: String, default: "" }, nextIcon: { type: iconPropType, default: () => arrow_right_default }, teleported: { type: Boolean, default: true }, small: Boolean, size: useSizeProp, background: Boolean, disabled: Boolean, hideOnSinglePage: Boolean, appendSizeTo: String }); const paginationEmits = { "update:current-page": (val) => isNumber(val), "update:page-size": (val) => isNumber(val), "size-change": (val) => isNumber(val), change: (currentPage, pageSize) => isNumber(currentPage) && isNumber(pageSize), "current-change": (val) => isNumber(val), "prev-click": (val) => isNumber(val), "next-click": (val) => isNumber(val) }; const componentName = "ElPagination"; var pagination_default = defineComponent({ name: componentName, props: paginationProps, emits: paginationEmits, setup(props2, { emit, slots }) { const { t } = useLocale(); const ns = useNamespace("pagination"); const vnodeProps = getCurrentInstance().vnode.props || {}; const _globalSize = useGlobalSize(); const _size = computed(() => props2.small ? "small" : props2.size ?? _globalSize.value); useDeprecated({ from: "small", replacement: "size", version: "3.0.0", scope: "el-pagination", ref: "https://element-plus.org/zh-CN/component/pagination.html" }, computed(() => !!props2.small)); const hasCurrentPageListener = "onUpdate:currentPage" in vnodeProps || "onUpdate:current-page" in vnodeProps || "onCurrentChange" in vnodeProps; const hasPageSizeListener = "onUpdate:pageSize" in vnodeProps || "onUpdate:page-size" in vnodeProps || "onSizeChange" in vnodeProps; const assertValidUsage = computed(() => { if (isAbsent(props2.total) && isAbsent(props2.pageCount)) return false; if (!isAbsent(props2.currentPage) && !hasCurrentPageListener) return false; if (props2.layout.includes("sizes")) { if (!isAbsent(props2.pageCount)) { if (!hasPageSizeListener) return false; } else if (!isAbsent(props2.total)) { if (!isAbsent(props2.pageSize)) { if (!hasPageSizeListener) return false; } } } return true; }); const innerPageSize = ref(isAbsent(props2.defaultPageSize) ? 10 : props2.defaultPageSize); const innerCurrentPage = ref(isAbsent(props2.defaultCurrentPage) ? 1 : props2.defaultCurrentPage); const pageSizeBridge = computed({ get() { return isAbsent(props2.pageSize) ? innerPageSize.value : props2.pageSize; }, set(v) { if (isAbsent(props2.pageSize)) innerPageSize.value = v; if (hasPageSizeListener) { emit("update:page-size", v); emit("size-change", v); } } }); const pageCountBridge = computed(() => { let pageCount = 0; if (!isAbsent(props2.pageCount)) pageCount = props2.pageCount; else if (!isAbsent(props2.total)) pageCount = Math.max(1, Math.ceil(props2.total / pageSizeBridge.value)); return pageCount; }); const currentPageBridge = computed({ get() { return isAbsent(props2.currentPage) ? innerCurrentPage.value : props2.currentPage; }, set(v) { let newCurrentPage = v; if (v < 1) newCurrentPage = 1; else if (v > pageCountBridge.value) newCurrentPage = pageCountBridge.value; if (isAbsent(props2.currentPage)) innerCurrentPage.value = newCurrentPage; if (hasCurrentPageListener) { emit("update:current-page", newCurrentPage); emit("current-change", newCurrentPage); } } }); watch(pageCountBridge, (val) => { if (currentPageBridge.value > val) currentPageBridge.value = val; }); watch([currentPageBridge, pageSizeBridge], (value) => { emit(CHANGE_EVENT, ...value); }, { flush: "post" }); function handleCurrentChange2(val) { currentPageBridge.value = val; } function handleSizeChange(val) { pageSizeBridge.value = val; const newPageCount = pageCountBridge.value; if (currentPageBridge.value > newPageCount) currentPageBridge.value = newPageCount; } function prev() { if (props2.disabled) return; currentPageBridge.value -= 1; emit("prev-click", currentPageBridge.value); } function next() { if (props2.disabled) return; currentPageBridge.value += 1; emit("next-click", currentPageBridge.value); } function addClass2(element, cls) { if (element) { if (!element.props) element.props = {}; element.props.class = [element.props.class, cls].join(" "); } } provide(elPaginationKey, { pageCount: pageCountBridge, disabled: computed(() => props2.disabled), currentPage: currentPageBridge, changeEvent: handleCurrentChange2, handleSizeChange }); return () => { var _a; if (!assertValidUsage.value) { debugWarn(componentName, t("el.pagination.deprecationWarning")); return null; } if (!props2.layout) return null; if (props2.hideOnSinglePage && pageCountBridge.value <= 1) return null; const rootChildren = []; const rightWrapperChildren = []; const rightWrapperRoot = h("div", { class: ns.e("rightwrapper") }, rightWrapperChildren); const TEMPLATE_MAP = { prev: h(prev_default, { disabled: props2.disabled, currentPage: currentPageBridge.value, prevText: props2.prevText, prevIcon: props2.prevIcon, onClick: prev }), jumper: h(jumper_default, { size: _size.value }), pager: h(pager_default, { currentPage: currentPageBridge.value, pageCount: pageCountBridge.value, pagerCount: props2.pagerCount, onChange: handleCurrentChange2, disabled: props2.disabled }), next: h(next_default, { disabled: props2.disabled, currentPage: currentPageBridge.value, pageCount: pageCountBridge.value, nextText: props2.nextText, nextIcon: props2.nextIcon, onClick: next }), sizes: h(sizes_default, { pageSize: pageSizeBridge.value, pageSizes: props2.pageSizes, popperClass: props2.popperClass, popperStyle: props2.popperStyle, disabled: props2.disabled, teleported: props2.teleported, size: _size.value, appendSizeTo: props2.appendSizeTo }), slot: ((_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)) ?? null, total: h(total_default, { total: isAbsent(props2.total) ? 0 : props2.total }) }; const components = props2.layout.split(",").map((item) => item.trim()); let haveRightWrapper = false; components.forEach((c) => { if (c === "->") { haveRightWrapper = true; return; } if (!haveRightWrapper) rootChildren.push(TEMPLATE_MAP[c]); else rightWrapperChildren.push(TEMPLATE_MAP[c]); }); addClass2(rootChildren[0], ns.is("first")); addClass2(rootChildren[rootChildren.length - 1], ns.is("last")); if (haveRightWrapper && rightWrapperChildren.length > 0) { addClass2(rightWrapperChildren[0], ns.is("first")); addClass2(rightWrapperChildren[rightWrapperChildren.length - 1], ns.is("last")); rootChildren.push(rightWrapperRoot); } return h("div", { class: [ ns.b(), ns.is("background", props2.background), ns.m(_size.value) ] }, rootChildren); }; } }); const ElPagination = withInstall(pagination_default); const popconfirmProps = buildProps({ title: String, confirmButtonText: String, cancelButtonText: String, confirmButtonType: { type: String, values: buttonTypes, default: "primary" }, cancelButtonType: { type: String, values: buttonTypes, default: "text" }, icon: { type: iconPropType, default: () => question_filled_default }, iconColor: { type: String, default: "#f90" }, hideIcon: Boolean, hideAfter: { type: Number, default: 200 }, effect: { ...useTooltipContentProps.effect, default: "light" }, teleported: useTooltipContentProps.teleported, persistent: useTooltipContentProps.persistent, width: { type: [String, Number], default: 150 }, virtualTriggering: useTooltipTriggerProps.virtualTriggering, virtualRef: useTooltipTriggerProps.virtualRef }); const popconfirmEmits = { confirm: (e) => e instanceof MouseEvent, cancel: (e) => e instanceof MouseEvent }; var popconfirm_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPopconfirm", __name: "popconfirm", props: popconfirmProps, emits: popconfirmEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const { t } = useLocale(); const ns = useNamespace("popconfirm"); const tooltipRef = ref(); const rootRef = ref(); const popperRef = computed(() => { var _a; return (_a = unref(tooltipRef)) == null ? void 0 : _a.popperRef; }); const showPopper = () => { var _a, _b; (_b = (_a = rootRef.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a); }; const hidePopper = () => { var _a, _b; (_b = (_a = tooltipRef.value) == null ? void 0 : _a.onClose) == null ? void 0 : _b.call(_a); }; const style = computed(() => { return { width: addUnit(props2.width) }; }); const confirm = (e) => { emit("confirm", e); hidePopper(); }; const cancel = (e) => { emit("cancel", e); hidePopper(); }; const finalConfirmButtonText = computed(() => props2.confirmButtonText || t("el.popconfirm.confirmButtonText")); const finalCancelButtonText = computed(() => props2.cancelButtonText || t("el.popconfirm.cancelButtonText")); __expose({ popperRef, hide: hidePopper }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTooltip), mergeProps({ ref_key: "tooltipRef", ref: tooltipRef, trigger: "click", effect: __props.effect }, _ctx.$attrs, { "virtual-triggering": __props.virtualTriggering, "virtual-ref": __props.virtualRef, "popper-class": `${unref(ns).namespace.value}-popover`, "popper-style": style.value, teleported: __props.teleported, "fallback-placements": [ "bottom", "top", "right", "left" ], "hide-after": __props.hideAfter, persistent: __props.persistent, loop: "", onShow: showPopper }), { content: withCtx(() => [createBaseVNode("div", { ref_key: "rootRef", ref: rootRef, tabindex: "-1", class: normalizeClass(unref(ns).b()) }, [createBaseVNode("div", { class: normalizeClass(unref(ns).e("main")) }, [!__props.hideIcon && __props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(unref(ns).e("icon")), style: normalizeStyle({ color: __props.iconColor }) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]), _: 1 }, 8, ["class", "style"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(__props.title), 1)], 2), createBaseVNode("div", { class: normalizeClass(unref(ns).e("action")) }, [renderSlot(_ctx.$slots, "actions", { confirm, cancel }, () => [createVNode(unref(ElButton), { size: "small", type: __props.cancelButtonType === "text" ? "" : __props.cancelButtonType, text: __props.cancelButtonType === "text", onClick: cancel }, { default: withCtx(() => [createTextVNode(toDisplayString(finalCancelButtonText.value), 1)]), _: 1 }, 8, ["type", "text"]), createVNode(unref(ElButton), { size: "small", type: __props.confirmButtonType === "text" ? "" : __props.confirmButtonType, text: __props.confirmButtonType === "text", onClick: confirm }, { default: withCtx(() => [createTextVNode(toDisplayString(finalConfirmButtonText.value), 1)]), _: 1 }, 8, ["type", "text"])])], 2)], 2)]), default: withCtx(() => [_ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)]), _: 3 }, 16, [ "effect", "virtual-triggering", "virtual-ref", "popper-class", "popper-style", "teleported", "hide-after", "persistent" ]); }; } }); var popconfirm_default = popconfirm_vue_vue_type_script_setup_true_lang_default; const ElPopconfirm = withInstall(popconfirm_default); const popoverProps = buildProps({ trigger: useTooltipTriggerProps.trigger, triggerKeys: useTooltipTriggerProps.triggerKeys, placement: dropdownProps.placement, disabled: useTooltipTriggerProps.disabled, visible: useTooltipContentProps.visible, transition: useTooltipContentProps.transition, popperOptions: dropdownProps.popperOptions, tabindex: dropdownProps.tabindex, content: useTooltipContentProps.content, popperStyle: useTooltipContentProps.popperStyle, popperClass: useTooltipContentProps.popperClass, enterable: { ...useTooltipContentProps.enterable, default: true }, effect: { ...useTooltipContentProps.effect, default: "light" }, teleported: useTooltipContentProps.teleported, appendTo: useTooltipContentProps.appendTo, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: true }, persistent: { type: Boolean, default: true }, "onUpdate:visible": { type: Function } }); const popoverEmits = { "update:visible": (value) => isBoolean(value), "before-enter": () => true, "before-leave": () => true, "after-enter": () => true, "after-leave": () => true }; const updateEventKeyRaw = `onUpdate:visible`; var popover_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElPopover", __name: "popover", props: popoverProps, emits: popoverEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const onUpdateVisible = computed(() => { return props2[updateEventKeyRaw]; }); const ns = useNamespace("popover"); const tooltipRef = ref(); const popperRef = computed(() => { var _a; return (_a = unref(tooltipRef)) == null ? void 0 : _a.popperRef; }); const style = computed(() => { return [{ width: addUnit(props2.width) }, props2.popperStyle]; }); const kls = computed(() => { return [ ns.b(), props2.popperClass, { [ns.m("plain")]: !!props2.content } ]; }); const gpuAcceleration = computed(() => { return props2.transition === `${ns.namespace.value}-fade-in-linear`; }); const hide = () => { var _a; (_a = tooltipRef.value) == null ? void 0 : _a.hide(); }; const beforeEnter = () => { emit("before-enter"); }; const beforeLeave = () => { emit("before-leave"); }; const afterEnter = () => { emit("after-enter"); }; const afterLeave = () => { emit("update:visible", false); emit("after-leave"); }; __expose({ popperRef, hide }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTooltip), mergeProps({ ref_key: "tooltipRef", ref: tooltipRef }, _ctx.$attrs, { trigger: __props.trigger, "trigger-keys": __props.triggerKeys, placement: __props.placement, disabled: __props.disabled, visible: __props.visible, transition: __props.transition, "popper-options": __props.popperOptions, tabindex: __props.tabindex, content: __props.content, offset: __props.offset, "show-after": __props.showAfter, "hide-after": __props.hideAfter, "auto-close": __props.autoClose, "show-arrow": __props.showArrow, "aria-label": __props.title, effect: __props.effect, enterable: __props.enterable, "popper-class": kls.value, "popper-style": style.value, teleported: __props.teleported, "append-to": __props.appendTo, persistent: __props.persistent, "gpu-acceleration": gpuAcceleration.value, "onUpdate:visible": onUpdateVisible.value, onBeforeShow: beforeEnter, onBeforeHide: beforeLeave, onShow: afterEnter, onHide: afterLeave }), { content: withCtx(() => [__props.title ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("title")), role: "title" }, toDisplayString(__props.title), 3)) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default", { hide }, () => [createTextVNode(toDisplayString(__props.content), 1)])]), default: withCtx(() => [_ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)]), _: 3 }, 16, [ "trigger", "trigger-keys", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "append-to", "persistent", "gpu-acceleration", "onUpdate:visible" ]); }; } }); var popover_default = popover_vue_vue_type_script_setup_true_lang_default; const attachEvents = (el, binding) => { var _a; const popover = (_a = binding.arg || binding.value) == null ? void 0 : _a.popperRef; if (popover) popover.triggerRef = el; }; var directive_default = { mounted(el, binding) { attachEvents(el, binding); }, updated(el, binding) { attachEvents(el, binding); } }; const VPopover = "popover"; const ElPopoverDirective = withInstallDirective(directive_default, VPopover); const ElPopover = withInstall(popover_default, { directive: ElPopoverDirective }); const progressProps = buildProps({ type: { type: String, default: "line", values: [ "line", "circle", "dashboard" ] }, percentage: { type: Number, default: 0, validator: (val) => val >= 0 && val <= 100 }, status: { type: String, default: "", values: [ "", "success", "exception", "warning" ] }, indeterminate: Boolean, duration: { type: Number, default: 3 }, strokeWidth: { type: Number, default: 6 }, strokeLinecap: { type: definePropType(String), default: "round" }, textInside: Boolean, width: { type: Number, default: 126 }, showText: { type: Boolean, default: true }, color: { type: definePropType([ String, Array, Function ]), default: "" }, striped: Boolean, stripedFlow: Boolean, format: { type: definePropType(Function), default: (percentage) => `${percentage}%` } }); const _hoisted_1$o = ["aria-valuenow"]; const _hoisted_2$f = { viewBox: "0 0 100 100" }; const _hoisted_3$6 = [ "d", "stroke", "stroke-linecap", "stroke-width" ]; const _hoisted_4$4 = [ "d", "stroke", "opacity", "stroke-linecap", "stroke-width" ]; const _hoisted_5$2 = { key: 0 }; var progress_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElProgress", __name: "progress", props: progressProps, setup(__props) { const STATUS_COLOR_MAP = { success: "#13ce66", exception: "#ff4949", warning: "#e6a23c", default: "#20a0ff" }; const props2 = __props; const ns = useNamespace("progress"); const barStyle = computed(() => { const barStyle2 = { width: `${props2.percentage}%`, animationDuration: `${props2.duration}s` }; const color = getCurrentColor(props2.percentage); if (color.includes("gradient")) barStyle2.background = color; else barStyle2.backgroundColor = color; return barStyle2; }); const relativeStrokeWidth = computed(() => (props2.strokeWidth / props2.width * 100).toFixed(1)); const radius = computed(() => { if (["circle", "dashboard"].includes(props2.type)) return Number.parseInt(`${50 - Number.parseFloat(relativeStrokeWidth.value) / 2}`, 10); return 0; }); const trackPath = computed(() => { const r = radius.value; const isDashboard = props2.type === "dashboard"; return ` M 50 50 m 0 ${isDashboard ? "" : "-"}${r} a ${r} ${r} 0 1 1 0 ${isDashboard ? "-" : ""}${r * 2} a ${r} ${r} 0 1 1 0 ${isDashboard ? "" : "-"}${r * 2} `; }); const perimeter = computed(() => 2 * Math.PI * radius.value); const rate = computed(() => props2.type === "dashboard" ? 0.75 : 1); const strokeDashoffset = computed(() => { return `${-1 * perimeter.value * (1 - rate.value) / 2}px`; }); const trailPathStyle = computed(() => ({ strokeDasharray: `${perimeter.value * rate.value}px, ${perimeter.value}px`, strokeDashoffset: strokeDashoffset.value })); const circlePathStyle = computed(() => ({ strokeDasharray: `${perimeter.value * rate.value * (props2.percentage / 100)}px, ${perimeter.value}px`, strokeDashoffset: strokeDashoffset.value, transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s" })); const stroke = computed(() => { let ret; if (props2.color) ret = getCurrentColor(props2.percentage); else ret = STATUS_COLOR_MAP[props2.status] || STATUS_COLOR_MAP.default; return ret; }); const statusIcon = computed(() => { if (props2.status === "warning") return warning_filled_default; if (props2.type === "line") return props2.status === "success" ? circle_check_default : circle_close_default; else return props2.status === "success" ? check_default : close_default; }); const progressTextSize = computed(() => { return props2.type === "line" ? 12 + props2.strokeWidth * 0.4 : props2.width * 0.111111 + 2; }); const content = computed(() => props2.format(props2.percentage)); function getColors(color) { const span = 100 / color.length; return color.map((seriesColor, index) => { if (isString(seriesColor)) return { color: seriesColor, percentage: (index + 1) * span }; return seriesColor; }).sort((a, b) => a.percentage - b.percentage); } const getCurrentColor = (percentage) => { var _a; const { color } = props2; if (isFunction(color)) return color(percentage); else if (isString(color)) return color; else { const colors = getColors(color); for (const color2 of colors) if (color2.percentage > percentage) return color2.color; return (_a = colors[colors.length - 1]) == null ? void 0 : _a.color; } }; return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([ unref(ns).b(), unref(ns).m(__props.type), unref(ns).is(__props.status), { [unref(ns).m("without-text")]: !__props.showText, [unref(ns).m("text-inside")]: __props.textInside } ]), role: "progressbar", "aria-valuenow": __props.percentage, "aria-valuemin": "0", "aria-valuemax": "100" }, [__props.type === "line" ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).b("bar")) }, [createBaseVNode("div", { class: normalizeClass(unref(ns).be("bar", "outer")), style: normalizeStyle({ height: `${__props.strokeWidth}px` }) }, [createBaseVNode("div", { class: normalizeClass([ unref(ns).be("bar", "inner"), { [unref(ns).bem("bar", "inner", "indeterminate")]: __props.indeterminate }, { [unref(ns).bem("bar", "inner", "striped")]: __props.striped }, { [unref(ns).bem("bar", "inner", "striped-flow")]: __props.stripedFlow } ]), style: normalizeStyle(barStyle.value) }, [(__props.showText || _ctx.$slots.default) && __props.textInside ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).be("bar", "innerText")) }, [renderSlot(_ctx.$slots, "default", { percentage: __props.percentage }, () => [createBaseVNode("span", null, toDisplayString(content.value), 1)])], 2)) : createCommentVNode("v-if", true)], 6)], 6)], 2)) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).b("circle")), style: normalizeStyle({ height: `${__props.width}px`, width: `${__props.width}px` }) }, [(openBlock(), createElementBlock("svg", _hoisted_2$f, [createBaseVNode("path", { class: normalizeClass(unref(ns).be("circle", "track")), d: trackPath.value, stroke: `var(${unref(ns).cssVarName("fill-color-light")}, #e5e9f2)`, "stroke-linecap": __props.strokeLinecap, "stroke-width": relativeStrokeWidth.value, fill: "none", style: normalizeStyle(trailPathStyle.value) }, null, 14, _hoisted_3$6), createBaseVNode("path", { class: normalizeClass(unref(ns).be("circle", "path")), d: trackPath.value, stroke: stroke.value, fill: "none", opacity: __props.percentage ? 1 : 0, "stroke-linecap": __props.strokeLinecap, "stroke-width": relativeStrokeWidth.value, style: normalizeStyle(circlePathStyle.value) }, null, 14, _hoisted_4$4)]))], 6)), (__props.showText || _ctx.$slots.default) && !__props.textInside ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(unref(ns).e("text")), style: normalizeStyle({ fontSize: `${progressTextSize.value}px` }) }, [renderSlot(_ctx.$slots, "default", { percentage: __props.percentage }, () => [!__props.status ? (openBlock(), createElementBlock("span", _hoisted_5$2, toDisplayString(content.value), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(statusIcon.value)))]), _: 1 }))])], 6)) : createCommentVNode("v-if", true)], 10, _hoisted_1$o); }; } }); var progress_default = progress_vue_vue_type_script_setup_true_lang_default; const ElProgress = withInstall(progress_default); const rateProps = buildProps({ modelValue: { type: Number, default: 0 }, id: { type: String, default: void 0 }, lowThreshold: { type: Number, default: 2 }, highThreshold: { type: Number, default: 4 }, max: { type: Number, default: 5 }, colors: { type: definePropType([Array, Object]), default: () => mutable([ "", "", "" ]) }, voidColor: { type: String, default: "" }, disabledVoidColor: { type: String, default: "" }, icons: { type: definePropType([Array, Object]), default: () => [ star_filled_default, star_filled_default, star_filled_default ] }, voidIcon: { type: iconPropType, default: () => star_default }, disabledVoidIcon: { type: iconPropType, default: () => star_filled_default }, disabled: { type: Boolean, default: void 0 }, allowHalf: Boolean, showText: Boolean, showScore: Boolean, textColor: { type: String, default: "" }, texts: { type: definePropType(Array), default: () => mutable([ "Extremely bad", "Disappointed", "Fair", "Satisfied", "Surprise" ]) }, scoreTemplate: { type: String, default: "{value}" }, size: useSizeProp, clearable: Boolean, ...useAriaProps(["ariaLabel"]) }); const rateEmits = { [CHANGE_EVENT]: (value) => isNumber(value), [UPDATE_MODEL_EVENT]: (value) => isNumber(value) }; const _hoisted_1$n = [ "id", "aria-label", "aria-labelledby", "aria-valuenow", "aria-valuetext", "aria-valuemax", "tabindex", "aria-disabled" ]; const _hoisted_2$e = ["onMousemove", "onClick"]; var rate_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElRate", __name: "rate", props: rateProps, emits: rateEmits, setup(__props, { expose: __expose, emit: __emit }) { function getValueFromMap(value, map) { const isExcludedObject = (val) => isObject(val); const matchedValue = map[Object.keys(map).map((key) => +key).filter((key) => { const val = map[key]; return (isExcludedObject(val) ? val.excluded : false) ? value < key : value <= key; }).sort((a, b) => a - b)[0]]; return isExcludedObject(matchedValue) && matchedValue.value || matchedValue; } const props2 = __props; const emit = __emit; const formItemContext = inject(formItemContextKey, void 0); const rateSize = useFormSize(); const ns = useNamespace("rate"); const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, { formItemContext }); const currentValue = ref(clamp(props2.modelValue, 0, props2.max)); const hoverIndex = ref(-1); const pointerAtLeftHalf = ref(true); const iconRefs = ref([]); const iconClientWidths = computed(() => iconRefs.value.map((icon) => icon.$el.clientWidth)); const rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)]); const rateDisabled = useFormDisabled(); const rateStyles = computed(() => { return ns.cssVarBlock({ "void-color": props2.voidColor, "disabled-void-color": props2.disabledVoidColor, "fill-color": activeColor.value }); }); const text = computed(() => { let result = ""; if (props2.showScore) result = props2.scoreTemplate.replace(/\{\s*value\s*\}/, rateDisabled.value ? `${props2.modelValue}` : `${currentValue.value}`); else if (props2.showText) result = props2.texts[Math.ceil(currentValue.value) - 1]; return result; }); const valueDecimal = computed(() => props2.modelValue * 100 - Math.floor(props2.modelValue) * 100); const colorMap = computed(() => isArray(props2.colors) ? { [props2.lowThreshold]: props2.colors[0], [props2.highThreshold]: { value: props2.colors[1], excluded: true }, [props2.max]: props2.colors[2] } : props2.colors); const activeColor = computed(() => { const color = getValueFromMap(currentValue.value, colorMap.value); return isObject(color) ? "" : color; }); const decimalStyle = computed(() => { let width = ""; if (rateDisabled.value) width = `${valueDecimal.value}%`; else if (props2.allowHalf) width = "50%"; return { color: activeColor.value, width }; }); const componentMap = computed(() => { let icons = isArray(props2.icons) ? [...props2.icons] : { ...props2.icons }; icons = markRaw(icons); return isArray(icons) ? { [props2.lowThreshold]: icons[0], [props2.highThreshold]: { value: icons[1], excluded: true }, [props2.max]: icons[2] } : icons; }); const decimalIconComponent = computed(() => getValueFromMap(props2.modelValue, componentMap.value)); const voidComponent = computed(() => rateDisabled.value ? isString(props2.disabledVoidIcon) ? props2.disabledVoidIcon : markRaw(props2.disabledVoidIcon) : isString(props2.voidIcon) ? props2.voidIcon : markRaw(props2.voidIcon)); const activeComponent = computed(() => getValueFromMap(currentValue.value, componentMap.value)); function showDecimalIcon(item) { const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props2.modelValue && item > props2.modelValue; const showWhenAllowHalf = props2.allowHalf && pointerAtLeftHalf.value && item - 0.5 <= currentValue.value && item > currentValue.value; return showWhenDisabled || showWhenAllowHalf; } function emitValue(value) { if (props2.clearable && value === props2.modelValue) value = 0; emit(UPDATE_MODEL_EVENT, value); if (props2.modelValue !== value) emit(CHANGE_EVENT, value); } function selectValue(value) { if (rateDisabled.value) return; if (props2.allowHalf && pointerAtLeftHalf.value) emitValue(currentValue.value); else emitValue(value); } function handleKey(e) { if (rateDisabled.value) return; const code = getEventCode(e); const step2 = props2.allowHalf ? 0.5 : 1; let _currentValue = currentValue.value; switch (code) { case EVENT_CODE.up: case EVENT_CODE.right: _currentValue += step2; break; case EVENT_CODE.left: case EVENT_CODE.down: _currentValue -= step2; break; } _currentValue = clamp(_currentValue, 0, props2.max); if (_currentValue === currentValue.value) return; e.stopPropagation(); e.preventDefault(); emit(UPDATE_MODEL_EVENT, _currentValue); emit(CHANGE_EVENT, _currentValue); return _currentValue; } function setCurrentValue(value, event) { if (rateDisabled.value) return; if (props2.allowHalf && event) { pointerAtLeftHalf.value = event.offsetX * 2 <= iconClientWidths.value[value - 1]; currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value; } else currentValue.value = value; hoverIndex.value = value; } function resetCurrentValue() { if (rateDisabled.value) return; if (props2.allowHalf) pointerAtLeftHalf.value = props2.modelValue !== Math.floor(props2.modelValue); currentValue.value = clamp(props2.modelValue, 0, props2.max); hoverIndex.value = -1; } watch(() => props2.modelValue, (val) => { currentValue.value = clamp(val, 0, props2.max); pointerAtLeftHalf.value = props2.modelValue !== Math.floor(props2.modelValue); }); if (!props2.modelValue) emit(UPDATE_MODEL_EVENT, 0); __expose({ setCurrentValue, resetCurrentValue }); return (_ctx, _cache) => { var _a; return openBlock(), createElementBlock("div", { id: unref(inputId), class: normalizeClass([rateClasses.value, unref(ns).is("disabled", unref(rateDisabled))]), role: "slider", "aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "rating" : void 0, "aria-labelledby": unref(isLabeledByFormItem) ? (_a = unref(formItemContext)) == null ? void 0 : _a.labelId : void 0, "aria-valuenow": currentValue.value, "aria-valuetext": text.value || void 0, "aria-valuemin": "0", "aria-valuemax": __props.max, style: normalizeStyle(rateStyles.value), tabindex: unref(rateDisabled) ? void 0 : 0, "aria-disabled": unref(rateDisabled), onKeydown: handleKey }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.max, (item, key) => { return openBlock(), createElementBlock("span", { key, class: normalizeClass(unref(ns).e("item")), onMousemove: ($event) => setCurrentValue(item, $event), onMouseleave: resetCurrentValue, onClick: ($event) => selectValue(item) }, [createVNode(unref(ElIcon), { ref_for: true, ref_key: "iconRefs", ref: iconRefs, class: normalizeClass([ unref(ns).e("icon"), { hover: hoverIndex.value === item }, unref(ns).is("active", item <= currentValue.value), unref(ns).is("focus-visible", item === Math.ceil(currentValue.value || 1)) ]) }, { default: withCtx(() => [ withDirectives((openBlock(), createBlock(resolveDynamicComponent(activeComponent.value), null, null, 512)), [[vShow, !showDecimalIcon(item) && item <= currentValue.value]]), withDirectives((openBlock(), createBlock(resolveDynamicComponent(voidComponent.value), null, null, 512)), [[vShow, !showDecimalIcon(item) && item > currentValue.value]]), withDirectives((openBlock(), createBlock(resolveDynamicComponent(voidComponent.value), { class: normalizeClass([unref(ns).em("decimal", "box")]) }, null, 8, ["class"])), [[vShow, showDecimalIcon(item)]]), withDirectives(createVNode(unref(ElIcon), { style: normalizeStyle(decimalStyle.value), class: normalizeClass([unref(ns).e("icon"), unref(ns).e("decimal")]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(decimalIconComponent.value)))]), _: 1 }, 8, ["style", "class"]), [[vShow, showDecimalIcon(item)]]) ]), _: 2 }, 1032, ["class"])], 42, _hoisted_2$e); }), 128)), __props.showText || __props.showScore ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(ns).e("text")), style: normalizeStyle({ color: __props.textColor }) }, toDisplayString(text.value), 7)) : createCommentVNode("v-if", true)], 46, _hoisted_1$n); }; } }); var rate_default = rate_vue_vue_type_script_setup_true_lang_default; const ElRate = withInstall(rate_default); const IconMap = { primary: "icon-primary", success: "icon-success", warning: "icon-warning", error: "icon-error", info: "icon-info" }; const IconComponentMap = { [IconMap.primary]: info_filled_default, [IconMap.success]: circle_check_filled_default, [IconMap.warning]: warning_filled_default, [IconMap.error]: circle_close_filled_default, [IconMap.info]: info_filled_default }; const resultProps = buildProps({ title: { type: String, default: "" }, subTitle: { type: String, default: "" }, icon: { type: String, values: [ "primary", "success", "warning", "info", "error" ], default: "info" } }); var result_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElResult", __name: "result", props: resultProps, setup(__props) { const props2 = __props; const ns = useNamespace("result"); const resultIcon = computed(() => { const icon = props2.icon; const iconClass = icon && IconMap[icon] ? IconMap[icon] : "icon-info"; return { class: iconClass, component: IconComponentMap[iconClass] || IconComponentMap["icon-info"] }; }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [ createBaseVNode("div", { class: normalizeClass(unref(ns).e("icon")) }, [renderSlot(_ctx.$slots, "icon", {}, () => [resultIcon.value.component ? (openBlock(), createBlock(resolveDynamicComponent(resultIcon.value.component), { key: 0, class: normalizeClass(resultIcon.value.class) }, null, 8, ["class"])) : createCommentVNode("v-if", true)])], 2), __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("title")) }, [renderSlot(_ctx.$slots, "title", {}, () => [createBaseVNode("p", null, toDisplayString(__props.title), 1)])], 2)) : createCommentVNode("v-if", true), __props.subTitle || _ctx.$slots["sub-title"] ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("subtitle")) }, [renderSlot(_ctx.$slots, "sub-title", {}, () => [createBaseVNode("p", null, toDisplayString(__props.subTitle), 1)])], 2)) : createCommentVNode("v-if", true), _ctx.$slots.extra ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(unref(ns).e("extra")) }, [renderSlot(_ctx.$slots, "extra")], 2)) : createCommentVNode("v-if", true) ], 2); }; } }); var result_default = result_vue_vue_type_script_setup_true_lang_default; const ElResult = withInstall(result_default); const DEFAULT_DYNAMIC_LIST_ITEM_SIZE = 50; const ITEM_RENDER_EVT = "itemRendered"; const SCROLL_EVT = "scroll"; const FORWARD = "forward"; const BACKWARD = "backward"; const AUTO_ALIGNMENT = "auto"; const SMART_ALIGNMENT = "smart"; const START_ALIGNMENT = "start"; const CENTERED_ALIGNMENT = "center"; const END_ALIGNMENT = "end"; const HORIZONTAL = "horizontal"; const VERTICAL = "vertical"; const LTR = "ltr"; const RTL = "rtl"; const RTL_OFFSET_NAG = "negative"; const RTL_OFFSET_POS_ASC = "positive-ascending"; const RTL_OFFSET_POS_DESC = "positive-descending"; const ScrollbarDirKey = { [HORIZONTAL]: "left", [VERTICAL]: "top" }; const SCROLLBAR_MIN_SIZE = 20; const itemSize$1 = buildProp({ type: definePropType([Number, Function]), required: true }); const estimatedItemSize = buildProp({ type: Number }); const cache = buildProp({ type: Number, default: 2 }); const direction = buildProp({ type: String, values: ["ltr", "rtl"], default: "ltr" }); const initScrollOffset = buildProp({ type: Number, default: 0 }); const total = buildProp({ type: Number, required: true }); const layout = buildProp({ type: String, values: ["horizontal", "vertical"], default: VERTICAL }); const virtualizedProps = buildProps({ className: { type: String, default: "" }, containerElement: { type: definePropType([String, Object]), default: "div" }, data: { type: definePropType(Array), default: () => mutable([]) }, direction, height: { type: [String, Number], required: true }, innerElement: { type: [String, Object], default: "div" }, innerProps: { type: definePropType(Object), default: () => ({}) }, style: { type: definePropType([ Object, String, Array ]) }, useIsScrolling: Boolean, width: { type: [Number, String], required: false }, perfMode: { type: Boolean, default: true }, scrollbarAlwaysOn: Boolean }); const virtualizedListProps = buildProps({ cache, estimatedItemSize, layout, initScrollOffset, total, itemSize: itemSize$1, ...virtualizedProps }); const scrollbarSize = { type: Number, default: 6 }; const startGap = { type: Number, default: 0 }; const endGap = { type: Number, default: 2 }; const virtualizedGridProps = buildProps({ columnCache: cache, columnWidth: itemSize$1, estimatedColumnWidth: estimatedItemSize, estimatedRowHeight: estimatedItemSize, initScrollLeft: initScrollOffset, initScrollTop: initScrollOffset, itemKey: { type: definePropType(Function), default: ({ columnIndex, rowIndex }) => `${rowIndex}:${columnIndex}` }, rowCache: cache, rowHeight: itemSize$1, totalColumn: total, totalRow: total, hScrollbarSize: scrollbarSize, vScrollbarSize: scrollbarSize, scrollbarStartGap: startGap, scrollbarEndGap: endGap, role: String, ...virtualizedProps }); const virtualizedScrollbarProps = buildProps({ alwaysOn: Boolean, class: String, layout, total, ratio: { type: Number, required: true }, clientSize: { type: Number, required: true }, scrollFrom: { type: Number, required: true }, scrollbarSize, startGap, endGap, visible: Boolean }); const getScrollDir = (prev, cur) => prev < cur ? FORWARD : BACKWARD; const isHorizontal = (dir) => dir === LTR || dir === RTL || dir === HORIZONTAL; const isRTL = (dir) => dir === RTL; let cachedRTLResult = null; function getRTLOffsetType(recalculate = false) { if (cachedRTLResult === null || recalculate) { const outerDiv = document.createElement("div"); const outerStyle = outerDiv.style; outerStyle.width = "50px"; outerStyle.height = "50px"; outerStyle.overflow = "scroll"; outerStyle.direction = "rtl"; const innerDiv = document.createElement("div"); const innerStyle = innerDiv.style; innerStyle.width = "100px"; innerStyle.height = "100px"; outerDiv.appendChild(innerDiv); document.body.appendChild(outerDiv); if (outerDiv.scrollLeft > 0) cachedRTLResult = RTL_OFFSET_POS_DESC; else { outerDiv.scrollLeft = 1; if (outerDiv.scrollLeft === 0) cachedRTLResult = RTL_OFFSET_NAG; else cachedRTLResult = RTL_OFFSET_POS_ASC; } document.body.removeChild(outerDiv); return cachedRTLResult; } return cachedRTLResult; } function renderThumbStyle({ move, size, bar }, layout2) { const style = {}; const translate2 = `translate${bar.axis}(${move}px)`; style[bar.size] = size; style.transform = translate2; if (layout2 === "horizontal") style.height = "100%"; else style.width = "100%"; return style; } const useCache = () => { const props2 = getCurrentInstance().proxy.$props; return computed(() => { const _getItemStyleCache = (_, __, ___) => ({}); return props2.perfMode ? memoize(_getItemStyleCache) : memoizeOne(_getItemStyleCache); }); }; const useWheel = ({ atEndEdge, atStartEdge, layout: layout2 }, onWheelDelta) => { let frameHandle; let offset2 = 0; const hasReachedEdge = (offset3) => { return offset3 < 0 && atStartEdge.value || offset3 > 0 && atEndEdge.value; }; const onWheel = (e) => { cAF(frameHandle); let { deltaX, deltaY } = e; if (e.shiftKey && deltaY !== 0) { deltaX = deltaY; deltaY = 0; } const newOffset = layout2.value === HORIZONTAL ? deltaX : deltaY; if (hasReachedEdge(newOffset)) return; offset2 += newOffset; if (!isFirefox() && newOffset !== 0) e.preventDefault(); frameHandle = rAF(() => { onWheelDelta(offset2); offset2 = 0; }); }; return { hasReachedEdge, onWheel }; }; const ScrollBar = defineComponent({ name: "ElVirtualScrollBar", props: virtualizedScrollbarProps, emits: [ "scroll", "start-move", "stop-move" ], setup(props2, { emit }) { const GAP2 = computed(() => props2.startGap + props2.endGap); const nsVirtualScrollbar = useNamespace("virtual-scrollbar"); const nsScrollbar = useNamespace("scrollbar"); const trackRef = ref(); const thumbRef = ref(); let frameHandle = null; let onselectstartStore = null; const state = reactive({ isDragging: false, traveled: 0 }); const bar = computed(() => BAR_MAP[props2.layout]); const trackSize = computed(() => props2.clientSize - unref(GAP2)); const trackStyle = computed(() => ({ position: "absolute", width: `${HORIZONTAL === props2.layout ? trackSize.value : props2.scrollbarSize}px`, height: `${HORIZONTAL === props2.layout ? props2.scrollbarSize : trackSize.value}px`, [ScrollbarDirKey[props2.layout]]: "2px", right: "2px", bottom: "2px", borderRadius: "4px" })); const thumbSize = computed(() => { const ratio = props2.ratio; if (ratio >= 100) return Number.POSITIVE_INFINITY; if (ratio >= 50) return ratio * trackSize.value / 100; const SCROLLBAR_MAX_SIZE = trackSize.value / 3; return Math.floor(Math.min(Math.max(ratio * trackSize.value / 100, SCROLLBAR_MIN_SIZE), SCROLLBAR_MAX_SIZE)); }); const thumbStyle = computed(() => { if (!Number.isFinite(thumbSize.value)) return { display: "none" }; const thumb = `${thumbSize.value}px`; return renderThumbStyle({ bar: bar.value, size: thumb, move: state.traveled }, props2.layout); }); const totalSteps = computed(() => Math.ceil(props2.clientSize - thumbSize.value - unref(GAP2))); const attachEvents2 = () => { window.addEventListener("mousemove", onMouseMove); window.addEventListener("mouseup", onMouseUp); const thumbEl = unref(thumbRef); if (!thumbEl) return; onselectstartStore = document.onselectstart; document.onselectstart = () => false; thumbEl.addEventListener("touchmove", onMouseMove, { passive: true }); thumbEl.addEventListener("touchend", onMouseUp); }; const detachEvents = () => { window.removeEventListener("mousemove", onMouseMove); window.removeEventListener("mouseup", onMouseUp); document.onselectstart = onselectstartStore; onselectstartStore = null; const thumbEl = unref(thumbRef); if (!thumbEl) return; thumbEl.removeEventListener("touchmove", onMouseMove); thumbEl.removeEventListener("touchend", onMouseUp); }; const onThumbMouseDown = (e) => { e.stopImmediatePropagation(); if (e.ctrlKey || [1, 2].includes(e.button)) return; state.isDragging = true; state[bar.value.axis] = e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]); emit("start-move"); attachEvents2(); }; const onMouseUp = () => { state.isDragging = false; state[bar.value.axis] = 0; emit("stop-move"); detachEvents(); }; const onMouseMove = (e) => { const { isDragging: isDragging2 } = state; if (!isDragging2) return; if (!thumbRef.value || !trackRef.value) return; const prevPage = state[bar.value.axis]; if (!prevPage) return; cAF(frameHandle); const distance = (trackRef.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1 - (thumbRef.value[bar.value.offset] - prevPage); frameHandle = rAF(() => { state.traveled = Math.max(0, Math.min(distance, totalSteps.value)); emit("scroll", distance, totalSteps.value); }); }; const clickTrackHandler = (e) => { const distance = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) - thumbRef.value[bar.value.offset] / 2; state.traveled = Math.max(0, Math.min(distance, totalSteps.value)); emit("scroll", distance, totalSteps.value); }; watch(() => props2.scrollFrom, (v) => { if (state.isDragging) return; state.traveled = Math.ceil(v * totalSteps.value); }); onBeforeUnmount(() => { detachEvents(); }); return () => { return h("div", { role: "presentation", ref: trackRef, class: [ nsVirtualScrollbar.b(), props2.class, (props2.alwaysOn || state.isDragging) && "always-on" ], style: trackStyle.value, onMousedown: withModifiers(clickTrackHandler, ["stop", "prevent"]), onTouchstartPrevent: onThumbMouseDown }, h("div", { ref: thumbRef, class: nsScrollbar.e("thumb"), style: thumbStyle.value, onMousedown: onThumbMouseDown }, [])); }; } }); const createList = ({ name, getOffset: getOffset2, getItemSize, getItemOffset, getEstimatedTotalSize: getEstimatedTotalSize2, getStartIndexForOffset, getStopIndexForStartIndex, initCache, clearCache, validateProps }) => { return defineComponent({ name: name ?? "ElVirtualList", props: virtualizedListProps, emits: [ITEM_RENDER_EVT, SCROLL_EVT], setup(props2, { emit, expose }) { validateProps(props2); const instance = getCurrentInstance(); const ns = useNamespace("vl"); const dynamicSizeCache = ref(initCache(props2, instance)); const getItemStyleCache = useCache(); const windowRef = ref(); const innerRef = ref(); const scrollbarRef = ref(); const states = ref({ isScrolling: false, scrollDir: "forward", scrollOffset: isNumber(props2.initScrollOffset) ? props2.initScrollOffset : 0, updateRequested: false, isScrollbarDragging: false, scrollbarAlwaysOn: props2.scrollbarAlwaysOn }); const itemsToRender = computed(() => { const { total: total2, cache: cache2 } = props2; const { isScrolling, scrollDir, scrollOffset } = unref(states); if (total2 === 0) return [ 0, 0, 0, 0 ]; const startIndex = getStartIndexForOffset(props2, scrollOffset, unref(dynamicSizeCache)); const stopIndex = getStopIndexForStartIndex(props2, startIndex, scrollOffset, unref(dynamicSizeCache)); const cacheBackward = !isScrolling || scrollDir === BACKWARD ? Math.max(1, cache2) : 1; const cacheForward = !isScrolling || scrollDir === FORWARD ? Math.max(1, cache2) : 1; return [ Math.max(0, startIndex - cacheBackward), Math.max(0, Math.min(total2 - 1, stopIndex + cacheForward)), startIndex, stopIndex ]; }); const estimatedTotalSize = computed(() => getEstimatedTotalSize2(props2, unref(dynamicSizeCache))); const _isHorizontal = computed(() => isHorizontal(props2.layout)); const windowStyle = computed(() => [ { position: "relative", [`overflow-${_isHorizontal.value ? "x" : "y"}`]: "scroll", WebkitOverflowScrolling: "touch", willChange: "transform" }, { direction: props2.direction, height: isNumber(props2.height) ? `${props2.height}px` : props2.height, width: isNumber(props2.width) ? `${props2.width}px` : props2.width }, props2.style ]); const innerStyle = computed(() => { const size = unref(estimatedTotalSize); const horizontal = unref(_isHorizontal); return { height: horizontal ? "100%" : `${size}px`, pointerEvents: unref(states).isScrolling ? "none" : void 0, width: horizontal ? `${size}px` : "100%", margin: 0, boxSizing: "border-box" }; }); const clientSize = computed(() => _isHorizontal.value ? props2.width : props2.height); const { onWheel } = useWheel({ atStartEdge: computed(() => states.value.scrollOffset <= 0), atEndEdge: computed(() => states.value.scrollOffset >= estimatedTotalSize.value), layout: computed(() => props2.layout) }, (offset2) => { var _a, _b; (_b = (_a = scrollbarRef.value).onMouseUp) == null ? void 0 : _b.call(_a); scrollTo(Math.min(states.value.scrollOffset + offset2, estimatedTotalSize.value - clientSize.value)); }); useEventListener(windowRef, "wheel", onWheel, { passive: false }); const emitEvents = () => { const { total: total2 } = props2; if (total2 > 0) { const [cacheStart, cacheEnd, visibleStart, visibleEnd] = unref(itemsToRender); emit(ITEM_RENDER_EVT, cacheStart, cacheEnd, visibleStart, visibleEnd); } const { scrollDir, scrollOffset, updateRequested } = unref(states); emit(SCROLL_EVT, scrollDir, scrollOffset, updateRequested); }; const scrollVertically = (e) => { const { clientHeight, scrollHeight, scrollTop } = e.currentTarget; const _states = unref(states); if (_states.scrollOffset === scrollTop) return; const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight)); states.value = { ..._states, isScrolling: true, scrollDir: getScrollDir(_states.scrollOffset, scrollOffset), scrollOffset, updateRequested: false }; nextTick(resetIsScrolling); }; const scrollHorizontally = (e) => { const { clientWidth, scrollLeft, scrollWidth } = e.currentTarget; const _states = unref(states); if (_states.scrollOffset === scrollLeft) return; const { direction: direction2 } = props2; let scrollOffset = scrollLeft; if (direction2 === RTL) switch (getRTLOffsetType()) { case RTL_OFFSET_NAG: scrollOffset = -scrollLeft; break; case RTL_OFFSET_POS_DESC: scrollOffset = scrollWidth - clientWidth - scrollLeft; break; } scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth)); states.value = { ..._states, isScrolling: true, scrollDir: getScrollDir(_states.scrollOffset, scrollOffset), scrollOffset, updateRequested: false }; nextTick(resetIsScrolling); }; const onScroll = (e) => { unref(_isHorizontal) ? scrollHorizontally(e) : scrollVertically(e); emitEvents(); }; const onScrollbarScroll = (distanceToGo, totalSteps) => { const offset2 = (estimatedTotalSize.value - clientSize.value) / totalSteps * distanceToGo; scrollTo(Math.min(estimatedTotalSize.value - clientSize.value, offset2)); }; const scrollTo = (offset2) => { offset2 = Math.max(offset2, 0); if (offset2 === unref(states).scrollOffset) return; states.value = { ...unref(states), scrollOffset: offset2, scrollDir: getScrollDir(unref(states).scrollOffset, offset2), updateRequested: true }; nextTick(resetIsScrolling); }; const scrollToItem = (idx, alignment = AUTO_ALIGNMENT) => { const { scrollOffset } = unref(states); idx = Math.max(0, Math.min(idx, props2.total - 1)); scrollTo(getOffset2(props2, idx, alignment, scrollOffset, unref(dynamicSizeCache))); }; const getItemStyle = (idx) => { const { direction: direction2, itemSize: itemSize2, layout: layout2 } = props2; const itemStyleCache = getItemStyleCache.value(clearCache && itemSize2, clearCache && layout2, clearCache && direction2); let style; if (hasOwn(itemStyleCache, String(idx))) style = itemStyleCache[idx]; else { const offset2 = getItemOffset(props2, idx, unref(dynamicSizeCache)); const size = getItemSize(props2, idx, unref(dynamicSizeCache)); const horizontal = unref(_isHorizontal); const isRtl = direction2 === RTL; const offsetHorizontal = horizontal ? offset2 : 0; itemStyleCache[idx] = style = { position: "absolute", left: isRtl ? void 0 : `${offsetHorizontal}px`, right: isRtl ? `${offsetHorizontal}px` : void 0, top: !horizontal ? `${offset2}px` : 0, height: !horizontal ? `${size}px` : "100%", width: horizontal ? `${size}px` : "100%" }; } return style; }; const resetIsScrolling = () => { states.value.isScrolling = false; nextTick(() => { getItemStyleCache.value(-1, null, null); }); }; const resetScrollTop = () => { const window2 = windowRef.value; if (window2) window2.scrollTop = 0; }; onMounted(() => { if (!isClient) return; const { initScrollOffset: initScrollOffset2 } = props2; const windowElement = unref(windowRef); if (isNumber(initScrollOffset2) && windowElement) if (unref(_isHorizontal)) windowElement.scrollLeft = initScrollOffset2; else windowElement.scrollTop = initScrollOffset2; emitEvents(); }); onUpdated(() => { const { direction: direction2, layout: layout2 } = props2; const { scrollOffset, updateRequested } = unref(states); const windowElement = unref(windowRef); if (updateRequested && windowElement) if (layout2 === HORIZONTAL) if (direction2 === RTL) switch (getRTLOffsetType()) { case RTL_OFFSET_NAG: windowElement.scrollLeft = -scrollOffset; break; case RTL_OFFSET_POS_ASC: windowElement.scrollLeft = scrollOffset; break; default: { const { clientWidth, scrollWidth } = windowElement; windowElement.scrollLeft = scrollWidth - clientWidth - scrollOffset; break; } } else windowElement.scrollLeft = scrollOffset; else windowElement.scrollTop = scrollOffset; }); onActivated(() => { unref(windowRef).scrollTop = unref(states).scrollOffset; }); const api = { ns, clientSize, estimatedTotalSize, windowStyle, windowRef, innerRef, innerStyle, itemsToRender, scrollbarRef, states, getItemStyle, onScroll, onScrollbarScroll, onWheel, scrollTo, scrollToItem, resetScrollTop }; expose({ windowRef, innerRef, getItemStyleCache, scrollTo, scrollToItem, resetScrollTop, states }); return api; }, render(ctx) { var _a; const { $slots, className, clientSize, containerElement, data, getItemStyle, innerElement, itemsToRender, innerStyle, layout: layout2, total: total2, onScroll, onScrollbarScroll, states, useIsScrolling, windowStyle, ns } = ctx; const [start, end] = itemsToRender; const Container = resolveDynamicComponent(containerElement); const Inner = resolveDynamicComponent(innerElement); const children = []; if (total2 > 0) for (let i = start; i <= end; i++) children.push(h(Fragment, { key: i }, (_a = $slots.default) == null ? void 0 : _a.call($slots, { data, index: i, isScrolling: useIsScrolling ? states.isScrolling : void 0, style: getItemStyle(i) }))); const InnerNode = [h(Inner, mergeProps(ctx.innerProps, { style: innerStyle, ref: "innerRef" }), !isString(Inner) ? { default: () => children } : children)]; const scrollbar = h(ScrollBar, { ref: "scrollbarRef", clientSize, layout: layout2, onScroll: onScrollbarScroll, ratio: clientSize * 100 / this.estimatedTotalSize, scrollFrom: states.scrollOffset / (this.estimatedTotalSize - clientSize), total: total2, alwaysOn: states.scrollbarAlwaysOn }); const listContainer = h(Container, { class: [ns.e("window"), className], style: windowStyle, onScroll, ref: "windowRef", key: 0 }, !isString(Container) ? { default: () => [InnerNode] } : [InnerNode]); return h("div", { key: 0, class: [ns.e("wrapper"), states.scrollbarAlwaysOn ? "always-on" : ""] }, [listContainer, scrollbar]); } }); }; const FixedSizeList = createList({ name: "ElFixedSizeList", getItemOffset: ({ itemSize: itemSize2 }, index) => index * itemSize2, getItemSize: ({ itemSize: itemSize2 }) => itemSize2, getEstimatedTotalSize: ({ total: total2, itemSize: itemSize2 }) => itemSize2 * total2, getOffset: ({ height, total: total2, itemSize: itemSize2, layout: layout2, width }, index, alignment, scrollOffset) => { const size = isHorizontal(layout2) ? width : height; if (isString(size)) throwError("[ElVirtualList]", ` You should set width/height to number when your layout is horizontal/vertical `); const lastItemOffset = Math.max(0, total2 * itemSize2 - size); const maxOffset = Math.min(lastItemOffset, index * itemSize2); const minOffset = Math.max(0, (index + 1) * itemSize2 - size); if (alignment === SMART_ALIGNMENT) if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) alignment = AUTO_ALIGNMENT; else alignment = CENTERED_ALIGNMENT; switch (alignment) { case START_ALIGNMENT: return maxOffset; case END_ALIGNMENT: return minOffset; case CENTERED_ALIGNMENT: { const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2); if (middleOffset < Math.ceil(size / 2)) return 0; else if (middleOffset > lastItemOffset + Math.floor(size / 2)) return lastItemOffset; else return middleOffset; } case AUTO_ALIGNMENT: default: if (scrollOffset >= minOffset && scrollOffset <= maxOffset) return scrollOffset; else if (scrollOffset < minOffset) return minOffset; else return maxOffset; } }, getStartIndexForOffset: ({ total: total2, itemSize: itemSize2 }, offset2) => Math.max(0, Math.min(total2 - 1, Math.floor(offset2 / itemSize2))), getStopIndexForStartIndex: ({ height, total: total2, itemSize: itemSize2, layout: layout2, width }, startIndex, scrollOffset) => { const offset2 = startIndex * itemSize2; const size = isHorizontal(layout2) ? width : height; const numVisibleItems = Math.ceil((size + scrollOffset - offset2) / itemSize2); return Math.max(0, Math.min(total2 - 1, startIndex + numVisibleItems - 1)); }, initCache() { }, clearCache: true, validateProps() { } }); const SCOPE$5 = "ElDynamicSizeList"; const getItemFromCache$1 = (props2, index, listCache) => { const { itemSize: itemSize2 } = props2; const { items, lastVisitedIndex } = listCache; if (index > lastVisitedIndex) { let offset2 = 0; if (lastVisitedIndex >= 0) { const item = items[lastVisitedIndex]; offset2 = item.offset + item.size; } for (let i = lastVisitedIndex + 1; i <= index; i++) { const size = itemSize2(i); items[i] = { offset: offset2, size }; offset2 += size; } listCache.lastVisitedIndex = index; } return items[index]; }; const findItem$1 = (props2, listCache, offset2) => { const { items, lastVisitedIndex } = listCache; if ((lastVisitedIndex > 0 ? items[lastVisitedIndex].offset : 0) >= offset2) return bs$1(props2, listCache, 0, lastVisitedIndex, offset2); return es$1(props2, listCache, Math.max(0, lastVisitedIndex), offset2); }; const bs$1 = (props2, listCache, low, high, offset2) => { while (low <= high) { const mid = low + Math.floor((high - low) / 2); const currentOffset = getItemFromCache$1(props2, mid, listCache).offset; if (currentOffset === offset2) return mid; else if (currentOffset < offset2) low = mid + 1; else if (currentOffset > offset2) high = mid - 1; } return Math.max(0, low - 1); }; const es$1 = (props2, listCache, index, offset2) => { const { total: total2 } = props2; let exponent = 1; while (index < total2 && getItemFromCache$1(props2, index, listCache).offset < offset2) { index += exponent; exponent *= 2; } return bs$1(props2, listCache, Math.floor(index / 2), Math.min(index, total2 - 1), offset2); }; const getEstimatedTotalSize = ({ total: total2 }, { items, estimatedItemSize: estimatedItemSize2, lastVisitedIndex }) => { let totalSizeOfMeasuredItems = 0; if (lastVisitedIndex >= total2) lastVisitedIndex = total2 - 1; if (lastVisitedIndex >= 0) { const item = items[lastVisitedIndex]; totalSizeOfMeasuredItems = item.offset + item.size; } const totalSizeOfUnmeasuredItems = (total2 - lastVisitedIndex - 1) * estimatedItemSize2; return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems; }; const DynamicSizeList = createList({ name: "ElDynamicSizeList", getItemOffset: (props2, index, listCache) => getItemFromCache$1(props2, index, listCache).offset, getItemSize: (_, index, { items }) => items[index].size, getEstimatedTotalSize, getOffset: (props2, index, alignment, scrollOffset, listCache) => { const { height, layout: layout2, width } = props2; const size = isHorizontal(layout2) ? width : height; const item = getItemFromCache$1(props2, index, listCache); const estimatedTotalSize = getEstimatedTotalSize(props2, listCache); const maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, item.offset)); const minOffset = Math.max(0, item.offset - size + item.size); if (alignment === SMART_ALIGNMENT) if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) alignment = AUTO_ALIGNMENT; else alignment = CENTERED_ALIGNMENT; switch (alignment) { case START_ALIGNMENT: return maxOffset; case END_ALIGNMENT: return minOffset; case CENTERED_ALIGNMENT: return Math.round(minOffset + (maxOffset - minOffset) / 2); case AUTO_ALIGNMENT: default: if (scrollOffset >= minOffset && scrollOffset <= maxOffset) return scrollOffset; else if (scrollOffset < minOffset) return minOffset; else return maxOffset; } }, getStartIndexForOffset: (props2, offset2, listCache) => findItem$1(props2, listCache, offset2), getStopIndexForStartIndex: (props2, startIndex, scrollOffset, listCache) => { const { height, total: total2, layout: layout2, width } = props2; const size = isHorizontal(layout2) ? width : height; const item = getItemFromCache$1(props2, startIndex, listCache); const maxOffset = scrollOffset + size; let offset2 = item.offset + item.size; let stopIndex = startIndex; while (stopIndex < total2 - 1 && offset2 < maxOffset) { stopIndex++; offset2 += getItemFromCache$1(props2, stopIndex, listCache).size; } return stopIndex; }, initCache({ estimatedItemSize: estimatedItemSize2 = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }, instance) { const cache2 = { items: {}, estimatedItemSize: estimatedItemSize2, lastVisitedIndex: -1 }; cache2.clearCacheAfterIndex = (index, forceUpdate = true) => { var _a, _b; cache2.lastVisitedIndex = Math.min(cache2.lastVisitedIndex, index - 1); (_a = instance.exposed) == null ? void 0 : _a.getItemStyleCache(-1); if (forceUpdate) (_b = instance.proxy) == null ? void 0 : _b.$forceUpdate(); }; return cache2; }, clearCache: false, validateProps: ({ itemSize: itemSize2 }) => { if (typeof itemSize2 !== "function") throwError(SCOPE$5, ` itemSize is required as function, but the given value was ${typeof itemSize2} `); } }); const useGridWheel = ({ atXEndEdge, atXStartEdge, atYEndEdge, atYStartEdge }, onWheelDelta) => { let frameHandle = null; let xOffset = 0; let yOffset = 0; const hasReachedEdge = (x, y) => { const xEdgeReached = x < 0 && atXStartEdge.value || x > 0 && atXEndEdge.value; const yEdgeReached = y < 0 && atYStartEdge.value || y > 0 && atYEndEdge.value; return xEdgeReached || yEdgeReached; }; const onWheel = (e) => { cAF(frameHandle); let x = e.deltaX; let y = e.deltaY; if (Math.abs(x) > Math.abs(y)) y = 0; else x = 0; if (e.shiftKey && y !== 0) { x = y; y = 0; } if (hasReachedEdge(x, y)) { if (e.deltaX !== 0 && x === 0) e.preventDefault(); return; } xOffset += x; yOffset += y; e.preventDefault(); frameHandle = rAF(() => { onWheelDelta(xOffset, yOffset); xOffset = 0; yOffset = 0; }); }; return { hasReachedEdge, onWheel }; }; const useGridTouch = (windowRef, states, scrollTo, estimatedTotalWidth, estimatedTotalHeight, parsedWidth, parsedHeight) => { const touchStartX = ref(0); const touchStartY = ref(0); let frameHandle; let deltaX = 0; let deltaY = 0; const handleTouchStart = (event) => { cAF(frameHandle); touchStartX.value = event.touches[0].clientX; touchStartY.value = event.touches[0].clientY; deltaX = 0; deltaY = 0; }; const handleTouchMove = (event) => { event.preventDefault(); cAF(frameHandle); deltaX += touchStartX.value - event.touches[0].clientX; deltaY += touchStartY.value - event.touches[0].clientY; touchStartX.value = event.touches[0].clientX; touchStartY.value = event.touches[0].clientY; frameHandle = rAF(() => { const maxScrollLeft = estimatedTotalWidth.value - unref(parsedWidth); const maxScrollTop = estimatedTotalHeight.value - unref(parsedHeight); scrollTo({ scrollLeft: Math.min(states.value.scrollLeft + deltaX, maxScrollLeft), scrollTop: Math.min(states.value.scrollTop + deltaY, maxScrollTop) }); deltaX = 0; deltaY = 0; }); }; useEventListener(windowRef, "touchstart", handleTouchStart, { passive: true }); useEventListener(windowRef, "touchmove", handleTouchMove, { passive: false }); return { touchStartX, touchStartY, handleTouchStart, handleTouchMove }; }; const createGrid = ({ name, clearCache, getColumnPosition, getColumnStartIndexForOffset, getColumnStopIndexForStartIndex, getEstimatedTotalHeight: getEstimatedTotalHeight2, getEstimatedTotalWidth: getEstimatedTotalWidth2, getColumnOffset, getRowOffset, getRowPosition, getRowStartIndexForOffset, getRowStopIndexForStartIndex, initCache, injectToInstance, validateProps }) => { return defineComponent({ name: name ?? "ElVirtualList", props: virtualizedGridProps, emits: [ITEM_RENDER_EVT, SCROLL_EVT], setup(props2, { emit, expose, slots }) { const ns = useNamespace("vl"); validateProps(props2); const instance = getCurrentInstance(); const cache2 = ref(initCache(props2, instance)); injectToInstance == null ? void 0 : injectToInstance(instance, cache2); const windowRef = ref(); const hScrollbar = ref(); const vScrollbar = ref(); const innerRef = ref(); const states = ref({ isScrolling: false, scrollLeft: isNumber(props2.initScrollLeft) ? props2.initScrollLeft : 0, scrollTop: isNumber(props2.initScrollTop) ? props2.initScrollTop : 0, updateRequested: false, xAxisScrollDir: FORWARD, yAxisScrollDir: FORWARD }); const getItemStyleCache = useCache(); const parsedHeight = computed(() => Number.parseInt(`${props2.height}`, 10)); const parsedWidth = computed(() => Number.parseInt(`${props2.width}`, 10)); const columnsToRender = computed(() => { const { totalColumn, totalRow, columnCache } = props2; const { isScrolling, xAxisScrollDir, scrollLeft } = unref(states); if (totalColumn === 0 || totalRow === 0) return [ 0, 0, 0, 0 ]; const startIndex = getColumnStartIndexForOffset(props2, scrollLeft, unref(cache2)); const stopIndex = getColumnStopIndexForStartIndex(props2, startIndex, scrollLeft, unref(cache2)); const cacheBackward = !isScrolling || xAxisScrollDir === BACKWARD ? Math.max(1, columnCache) : 1; const cacheForward = !isScrolling || xAxisScrollDir === FORWARD ? Math.max(1, columnCache) : 1; return [ Math.max(0, startIndex - cacheBackward), Math.max(0, Math.min(totalColumn - 1, stopIndex + cacheForward)), startIndex, stopIndex ]; }); const rowsToRender = computed(() => { const { totalColumn, totalRow, rowCache } = props2; const { isScrolling, yAxisScrollDir, scrollTop } = unref(states); if (totalColumn === 0 || totalRow === 0) return [ 0, 0, 0, 0 ]; const startIndex = getRowStartIndexForOffset(props2, scrollTop, unref(cache2)); const stopIndex = getRowStopIndexForStartIndex(props2, startIndex, scrollTop, unref(cache2)); const cacheBackward = !isScrolling || yAxisScrollDir === BACKWARD ? Math.max(1, rowCache) : 1; const cacheForward = !isScrolling || yAxisScrollDir === FORWARD ? Math.max(1, rowCache) : 1; return [ Math.max(0, startIndex - cacheBackward), Math.max(0, Math.min(totalRow - 1, stopIndex + cacheForward)), startIndex, stopIndex ]; }); const estimatedTotalHeight = computed(() => getEstimatedTotalHeight2(props2, unref(cache2))); const estimatedTotalWidth = computed(() => getEstimatedTotalWidth2(props2, unref(cache2))); const windowStyle = computed(() => [ { position: "relative", overflow: "hidden", WebkitOverflowScrolling: "touch", willChange: "transform" }, { direction: props2.direction, height: isNumber(props2.height) ? `${props2.height}px` : props2.height, width: isNumber(props2.width) ? `${props2.width}px` : props2.width }, props2.style ?? {} ]); const innerStyle = computed(() => { const width = `${unref(estimatedTotalWidth)}px`; return { height: `${unref(estimatedTotalHeight)}px`, pointerEvents: unref(states).isScrolling ? "none" : void 0, width, margin: 0, boxSizing: "border-box" }; }); const emitEvents = () => { const { totalColumn, totalRow } = props2; if (totalColumn > 0 && totalRow > 0) { const [columnCacheStart, columnCacheEnd, columnVisibleStart, columnVisibleEnd] = unref(columnsToRender); const [rowCacheStart, rowCacheEnd, rowVisibleStart, rowVisibleEnd] = unref(rowsToRender); emit(ITEM_RENDER_EVT, { columnCacheStart, columnCacheEnd, rowCacheStart, rowCacheEnd, columnVisibleStart, columnVisibleEnd, rowVisibleStart, rowVisibleEnd }); } const { scrollLeft, scrollTop, updateRequested, xAxisScrollDir, yAxisScrollDir } = unref(states); emit(SCROLL_EVT, { xAxisScrollDir, scrollLeft, yAxisScrollDir, scrollTop, updateRequested }); }; const onScroll = (e) => { const { clientHeight, clientWidth, scrollHeight, scrollLeft, scrollTop, scrollWidth } = e.currentTarget; const _states = unref(states); if (_states.scrollTop === scrollTop && _states.scrollLeft === scrollLeft) return; let _scrollLeft = scrollLeft; if (isRTL(props2.direction)) switch (getRTLOffsetType()) { case RTL_OFFSET_NAG: _scrollLeft = -scrollLeft; break; case RTL_OFFSET_POS_DESC: _scrollLeft = scrollWidth - clientWidth - scrollLeft; break; } states.value = { ..._states, isScrolling: true, scrollLeft: _scrollLeft, scrollTop: Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight)), updateRequested: true, xAxisScrollDir: getScrollDir(_states.scrollLeft, _scrollLeft), yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop) }; nextTick(() => resetIsScrolling()); onUpdated2(); emitEvents(); }; const onVerticalScroll = (distance, totalSteps) => { const height = unref(parsedHeight); const offset2 = (estimatedTotalHeight.value - height) / totalSteps * distance; scrollTo({ scrollTop: Math.min(estimatedTotalHeight.value - height, offset2) }); }; const onHorizontalScroll = (distance, totalSteps) => { const width = unref(parsedWidth); const offset2 = (estimatedTotalWidth.value - width) / totalSteps * distance; scrollTo({ scrollLeft: Math.min(estimatedTotalWidth.value - width, offset2) }); }; const { onWheel } = useGridWheel({ atXStartEdge: computed(() => states.value.scrollLeft <= 0), atXEndEdge: computed(() => states.value.scrollLeft >= estimatedTotalWidth.value - unref(parsedWidth)), atYStartEdge: computed(() => states.value.scrollTop <= 0), atYEndEdge: computed(() => states.value.scrollTop >= estimatedTotalHeight.value - unref(parsedHeight)) }, (x, y) => { var _a, _b, _c, _d; (_b = (_a = hScrollbar.value) == null ? void 0 : _a.onMouseUp) == null ? void 0 : _b.call(_a); (_d = (_c = vScrollbar.value) == null ? void 0 : _c.onMouseUp) == null ? void 0 : _d.call(_c); const width = unref(parsedWidth); const height = unref(parsedHeight); scrollTo({ scrollLeft: Math.min(states.value.scrollLeft + x, estimatedTotalWidth.value - width), scrollTop: Math.min(states.value.scrollTop + y, estimatedTotalHeight.value - height) }); }); useEventListener(windowRef, "wheel", onWheel, { passive: false }); const scrollTo = ({ scrollLeft = states.value.scrollLeft, scrollTop = states.value.scrollTop }) => { scrollLeft = Math.max(scrollLeft, 0); scrollTop = Math.max(scrollTop, 0); const _states = unref(states); if (scrollTop === _states.scrollTop && scrollLeft === _states.scrollLeft) return; states.value = { ..._states, xAxisScrollDir: getScrollDir(_states.scrollLeft, scrollLeft), yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop), scrollLeft, scrollTop, updateRequested: true }; nextTick(() => resetIsScrolling()); onUpdated2(); emitEvents(); }; const { touchStartX, touchStartY, handleTouchStart, handleTouchMove } = useGridTouch(windowRef, states, scrollTo, estimatedTotalWidth, estimatedTotalHeight, parsedWidth, parsedHeight); const scrollToItem = (rowIndex = 0, columnIdx = 0, alignment = AUTO_ALIGNMENT) => { const _states = unref(states); columnIdx = Math.max(0, Math.min(columnIdx, props2.totalColumn - 1)); rowIndex = Math.max(0, Math.min(rowIndex, props2.totalRow - 1)); const scrollBarWidth2 = getScrollBarWidth(ns.namespace.value); const _cache = unref(cache2); const estimatedHeight = getEstimatedTotalHeight2(props2, _cache); const estimatedWidth = getEstimatedTotalWidth2(props2, _cache); scrollTo({ scrollLeft: getColumnOffset(props2, columnIdx, alignment, _states.scrollLeft, _cache, estimatedWidth > props2.width ? scrollBarWidth2 : 0), scrollTop: getRowOffset(props2, rowIndex, alignment, _states.scrollTop, _cache, estimatedHeight > props2.height ? scrollBarWidth2 : 0) }); }; const getItemStyle = (rowIndex, columnIndex) => { const { columnWidth, direction: direction2, rowHeight } = props2; const itemStyleCache = getItemStyleCache.value(clearCache && columnWidth, clearCache && rowHeight, clearCache && direction2); const key = `${rowIndex},${columnIndex}`; if (hasOwn(itemStyleCache, key)) return itemStyleCache[key]; else { const [, left] = getColumnPosition(props2, columnIndex, unref(cache2)); const _cache = unref(cache2); const rtl = isRTL(direction2); const [height, top] = getRowPosition(props2, rowIndex, _cache); const [width] = getColumnPosition(props2, columnIndex, _cache); itemStyleCache[key] = { position: "absolute", left: rtl ? void 0 : `${left}px`, right: rtl ? `${left}px` : void 0, top: `${top}px`, height: `${height}px`, width: `${width}px` }; return itemStyleCache[key]; } }; const resetIsScrolling = () => { states.value.isScrolling = false; nextTick(() => { getItemStyleCache.value(-1, null, null); }); }; onMounted(() => { if (!isClient) return; const { initScrollLeft, initScrollTop } = props2; const windowElement = unref(windowRef); if (windowElement) { if (isNumber(initScrollLeft)) windowElement.scrollLeft = initScrollLeft; if (isNumber(initScrollTop)) windowElement.scrollTop = initScrollTop; } emitEvents(); }); const onUpdated2 = () => { const { direction: direction2 } = props2; const { scrollLeft, scrollTop, updateRequested } = unref(states); const windowElement = unref(windowRef); if (updateRequested && windowElement) { if (direction2 === RTL) switch (getRTLOffsetType()) { case RTL_OFFSET_NAG: windowElement.scrollLeft = -scrollLeft; break; case RTL_OFFSET_POS_ASC: windowElement.scrollLeft = scrollLeft; break; default: { const { clientWidth, scrollWidth } = windowElement; windowElement.scrollLeft = scrollWidth - clientWidth - scrollLeft; break; } } else windowElement.scrollLeft = Math.max(0, scrollLeft); windowElement.scrollTop = Math.max(0, scrollTop); } }; const { resetAfterColumnIndex, resetAfterRowIndex, resetAfter } = instance.proxy; expose({ windowRef, innerRef, getItemStyleCache, touchStartX, touchStartY, handleTouchStart, handleTouchMove, scrollTo, scrollToItem, states, resetAfterColumnIndex, resetAfterRowIndex, resetAfter }); const renderScrollbars = () => { const { scrollbarAlwaysOn, scrollbarStartGap, scrollbarEndGap, totalColumn, totalRow } = props2; const width = unref(parsedWidth); const height = unref(parsedHeight); const estimatedWidth = unref(estimatedTotalWidth); const estimatedHeight = unref(estimatedTotalHeight); const { scrollLeft, scrollTop } = unref(states); return { horizontalScrollbar: h(ScrollBar, { ref: hScrollbar, alwaysOn: scrollbarAlwaysOn, startGap: scrollbarStartGap, endGap: scrollbarEndGap, class: ns.e("horizontal"), clientSize: width, layout: "horizontal", onScroll: onHorizontalScroll, ratio: width * 100 / estimatedWidth, scrollFrom: scrollLeft / (estimatedWidth - width), total: totalRow, visible: true }), verticalScrollbar: h(ScrollBar, { ref: vScrollbar, alwaysOn: scrollbarAlwaysOn, startGap: scrollbarStartGap, endGap: scrollbarEndGap, class: ns.e("vertical"), clientSize: height, layout: "vertical", onScroll: onVerticalScroll, ratio: height * 100 / estimatedHeight, scrollFrom: scrollTop / (estimatedHeight - height), total: totalColumn, visible: true }) }; }; const renderItems = () => { var _a; const [columnStart, columnEnd] = unref(columnsToRender); const [rowStart, rowEnd] = unref(rowsToRender); const { data, totalColumn, totalRow, useIsScrolling, itemKey } = props2; const children = []; if (totalRow > 0 && totalColumn > 0) for (let row = rowStart; row <= rowEnd; row++) for (let column = columnStart; column <= columnEnd; column++) { const key = itemKey({ columnIndex: column, data, rowIndex: row }); children.push(h(Fragment, { key }, (_a = slots.default) == null ? void 0 : _a.call(slots, { columnIndex: column, data, isScrolling: useIsScrolling ? unref(states).isScrolling : void 0, style: getItemStyle(row, column), rowIndex: row }))); } return children; }; const renderInner = () => { const Inner = resolveDynamicComponent(props2.innerElement); const children = renderItems(); return [h(Inner, mergeProps(props2.innerProps, { style: unref(innerStyle), ref: innerRef }), !isString(Inner) ? { default: () => children } : children)]; }; const renderWindow = () => { const Container = resolveDynamicComponent(props2.containerElement); const { horizontalScrollbar, verticalScrollbar } = renderScrollbars(); const Inner = renderInner(); return h("div", { key: 0, class: ns.e("wrapper"), role: props2.role }, [ h(Container, { class: props2.className, style: unref(windowStyle), onScroll, ref: windowRef }, !isString(Container) ? { default: () => Inner } : Inner), horizontalScrollbar, verticalScrollbar ]); }; return renderWindow; } }); }; const SCOPE$4 = "ElFixedSizeGrid"; const FixedSizeGrid = createGrid({ name: "ElFixedSizeGrid", getColumnPosition: ({ columnWidth }, index) => [columnWidth, index * columnWidth], getRowPosition: ({ rowHeight }, index) => [rowHeight, index * rowHeight], getEstimatedTotalHeight: ({ totalRow, rowHeight }) => rowHeight * totalRow, getEstimatedTotalWidth: ({ totalColumn, columnWidth }) => columnWidth * totalColumn, getColumnOffset: ({ totalColumn, columnWidth, width }, columnIndex, alignment, scrollLeft, _, scrollBarWidth2) => { width = Number(width); const lastColumnOffset = Math.max(0, totalColumn * columnWidth - width); const maxOffset = Math.min(lastColumnOffset, columnIndex * columnWidth); const minOffset = Math.max(0, columnIndex * columnWidth - width + scrollBarWidth2 + columnWidth); if (alignment === "smart") if (scrollLeft >= minOffset - width && scrollLeft <= maxOffset + width) alignment = AUTO_ALIGNMENT; else alignment = CENTERED_ALIGNMENT; switch (alignment) { case START_ALIGNMENT: return maxOffset; case END_ALIGNMENT: return minOffset; case CENTERED_ALIGNMENT: { const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2); if (middleOffset < Math.ceil(width / 2)) return 0; else if (middleOffset > lastColumnOffset + Math.floor(width / 2)) return lastColumnOffset; else return middleOffset; } case AUTO_ALIGNMENT: default: if (scrollLeft >= minOffset && scrollLeft <= maxOffset) return scrollLeft; else if (minOffset > maxOffset) return minOffset; else if (scrollLeft < minOffset) return minOffset; else return maxOffset; } }, getRowOffset: ({ rowHeight, height, totalRow }, rowIndex, align, scrollTop, _, scrollBarWidth2) => { height = Number(height); const lastRowOffset = Math.max(0, totalRow * rowHeight - height); const maxOffset = Math.min(lastRowOffset, rowIndex * rowHeight); const minOffset = Math.max(0, rowIndex * rowHeight - height + scrollBarWidth2 + rowHeight); if (align === SMART_ALIGNMENT) if (scrollTop >= minOffset - height && scrollTop <= maxOffset + height) align = AUTO_ALIGNMENT; else align = CENTERED_ALIGNMENT; switch (align) { case START_ALIGNMENT: return maxOffset; case END_ALIGNMENT: return minOffset; case CENTERED_ALIGNMENT: { const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2); if (middleOffset < Math.ceil(height / 2)) return 0; else if (middleOffset > lastRowOffset + Math.floor(height / 2)) return lastRowOffset; else return middleOffset; } case AUTO_ALIGNMENT: default: if (scrollTop >= minOffset && scrollTop <= maxOffset) return scrollTop; else if (minOffset > maxOffset) return minOffset; else if (scrollTop < minOffset) return minOffset; else return maxOffset; } }, getColumnStartIndexForOffset: ({ columnWidth, totalColumn }, scrollLeft) => Math.max(0, Math.min(totalColumn - 1, Math.floor(scrollLeft / columnWidth))), getColumnStopIndexForStartIndex: ({ columnWidth, totalColumn, width }, startIndex, scrollLeft) => { const left = startIndex * columnWidth; const visibleColumnsCount = Math.ceil((width + scrollLeft - left) / columnWidth); return Math.max(0, Math.min(totalColumn - 1, startIndex + visibleColumnsCount - 1)); }, getRowStartIndexForOffset: ({ rowHeight, totalRow }, scrollTop) => Math.max(0, Math.min(totalRow - 1, Math.floor(scrollTop / rowHeight))), getRowStopIndexForStartIndex: ({ rowHeight, totalRow, height }, startIndex, scrollTop) => { const top = startIndex * rowHeight; const numVisibleRows = Math.ceil((height + scrollTop - top) / rowHeight); return Math.max(0, Math.min(totalRow - 1, startIndex + numVisibleRows - 1)); }, initCache: () => void 0, clearCache: true, validateProps: ({ columnWidth, rowHeight }) => { if (!isNumber(columnWidth)) throwError(SCOPE$4, ` "columnWidth" must be passed as number, instead ${typeof columnWidth} was given. `); if (!isNumber(rowHeight)) throwError(SCOPE$4, ` "columnWidth" must be passed as number, instead ${typeof rowHeight} was given. `); } }); const { max, min, floor } = Math; const SCOPE$3 = "ElDynamicSizeGrid"; const ACCESS_SIZER_KEY_MAP = { column: "columnWidth", row: "rowHeight" }; const ACCESS_LAST_VISITED_KEY_MAP = { column: "lastVisitedColumnIndex", row: "lastVisitedRowIndex" }; const getItemFromCache = (props2, index, gridCache, type) => { const [cachedItems, sizer, lastVisited] = [ gridCache[type], props2[ACCESS_SIZER_KEY_MAP[type]], gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]] ]; if (index > lastVisited) { let offset2 = 0; if (lastVisited >= 0) { const item = cachedItems[lastVisited]; offset2 = item.offset + item.size; } for (let i = lastVisited + 1; i <= index; i++) { const size = sizer(i); cachedItems[i] = { offset: offset2, size }; offset2 += size; } gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]] = index; } return cachedItems[index]; }; const bs = (props2, gridCache, low, high, offset2, type) => { while (low <= high) { const mid = low + floor((high - low) / 2); const currentOffset = getItemFromCache(props2, mid, gridCache, type).offset; if (currentOffset === offset2) return mid; else if (currentOffset < offset2) low = mid + 1; else high = mid - 1; } return max(0, low - 1); }; const es = (props2, gridCache, idx, offset2, type) => { const total2 = type === "column" ? props2.totalColumn : props2.totalRow; let exponent = 1; while (idx < total2 && getItemFromCache(props2, idx, gridCache, type).offset < offset2) { idx += exponent; exponent *= 2; } return bs(props2, gridCache, floor(idx / 2), min(idx, total2 - 1), offset2, type); }; const findItem = (props2, gridCache, offset2, type) => { const [cache2, lastVisitedIndex] = [gridCache[type], gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]]; if ((lastVisitedIndex > 0 ? cache2[lastVisitedIndex].offset : 0) >= offset2) return bs(props2, gridCache, 0, lastVisitedIndex, offset2, type); return es(props2, gridCache, max(0, lastVisitedIndex), offset2, type); }; const getEstimatedTotalHeight = ({ totalRow }, { estimatedRowHeight, lastVisitedRowIndex, row }) => { let sizeOfVisitedRows = 0; if (lastVisitedRowIndex >= totalRow) lastVisitedRowIndex = totalRow - 1; if (lastVisitedRowIndex >= 0) { const item = row[lastVisitedRowIndex]; sizeOfVisitedRows = item.offset + item.size; } const sizeOfUnvisitedItems = (totalRow - lastVisitedRowIndex - 1) * estimatedRowHeight; return sizeOfVisitedRows + sizeOfUnvisitedItems; }; const getEstimatedTotalWidth = ({ totalColumn }, { column, estimatedColumnWidth, lastVisitedColumnIndex }) => { let sizeOfVisitedColumns = 0; if (lastVisitedColumnIndex > totalColumn) lastVisitedColumnIndex = totalColumn - 1; if (lastVisitedColumnIndex >= 0) { const item = column[lastVisitedColumnIndex]; sizeOfVisitedColumns = item.offset + item.size; } const sizeOfUnvisitedItems = (totalColumn - lastVisitedColumnIndex - 1) * estimatedColumnWidth; return sizeOfVisitedColumns + sizeOfUnvisitedItems; }; const ACCESS_ESTIMATED_SIZE_KEY_MAP = { column: getEstimatedTotalWidth, row: getEstimatedTotalHeight }; const getOffset$1 = (props2, index, alignment, scrollOffset, cache2, type, scrollBarWidth2) => { const [size, estimatedSizeAssociates] = [type === "row" ? props2.height : props2.width, ACCESS_ESTIMATED_SIZE_KEY_MAP[type]]; const item = getItemFromCache(props2, index, cache2, type); const maxOffset = max(0, min(estimatedSizeAssociates(props2, cache2) - size, item.offset)); const minOffset = max(0, item.offset - size + scrollBarWidth2 + item.size); if (alignment === SMART_ALIGNMENT) if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) alignment = AUTO_ALIGNMENT; else alignment = CENTERED_ALIGNMENT; switch (alignment) { case START_ALIGNMENT: return maxOffset; case END_ALIGNMENT: return minOffset; case CENTERED_ALIGNMENT: return Math.round(minOffset + (maxOffset - minOffset) / 2); case AUTO_ALIGNMENT: default: if (scrollOffset >= minOffset && scrollOffset <= maxOffset) return scrollOffset; else if (minOffset > maxOffset) return minOffset; else if (scrollOffset < minOffset) return minOffset; else return maxOffset; } }; const DynamicSizeGrid = createGrid({ name: "ElDynamicSizeGrid", getColumnPosition: (props2, idx, cache2) => { const item = getItemFromCache(props2, idx, cache2, "column"); return [item.size, item.offset]; }, getRowPosition: (props2, idx, cache2) => { const item = getItemFromCache(props2, idx, cache2, "row"); return [item.size, item.offset]; }, getColumnOffset: (props2, columnIndex, alignment, scrollLeft, cache2, scrollBarWidth2) => getOffset$1(props2, columnIndex, alignment, scrollLeft, cache2, "column", scrollBarWidth2), getRowOffset: (props2, rowIndex, alignment, scrollTop, cache2, scrollBarWidth2) => getOffset$1(props2, rowIndex, alignment, scrollTop, cache2, "row", scrollBarWidth2), getColumnStartIndexForOffset: (props2, scrollLeft, cache2) => findItem(props2, cache2, scrollLeft, "column"), getColumnStopIndexForStartIndex: (props2, startIndex, scrollLeft, cache2) => { const item = getItemFromCache(props2, startIndex, cache2, "column"); const maxOffset = scrollLeft + props2.width; let offset2 = item.offset + item.size; let stopIndex = startIndex; while (stopIndex < props2.totalColumn - 1 && offset2 < maxOffset) { stopIndex++; offset2 += getItemFromCache(props2, startIndex, cache2, "column").size; } return stopIndex; }, getEstimatedTotalHeight, getEstimatedTotalWidth, getRowStartIndexForOffset: (props2, scrollTop, cache2) => findItem(props2, cache2, scrollTop, "row"), getRowStopIndexForStartIndex: (props2, startIndex, scrollTop, cache2) => { const { totalRow, height } = props2; const item = getItemFromCache(props2, startIndex, cache2, "row"); const maxOffset = scrollTop + height; let offset2 = item.size + item.offset; let stopIndex = startIndex; while (stopIndex < totalRow - 1 && offset2 < maxOffset) { stopIndex++; offset2 += getItemFromCache(props2, stopIndex, cache2, "row").size; } return stopIndex; }, injectToInstance: (instance, cache2) => { const resetAfter = ({ columnIndex, rowIndex }, forceUpdate) => { var _a, _b; forceUpdate = isUndefined(forceUpdate) ? true : forceUpdate; if (isNumber(columnIndex)) cache2.value.lastVisitedColumnIndex = Math.min(cache2.value.lastVisitedColumnIndex, columnIndex - 1); if (isNumber(rowIndex)) cache2.value.lastVisitedRowIndex = Math.min(cache2.value.lastVisitedRowIndex, rowIndex - 1); (_a = instance.exposed) == null ? void 0 : _a.getItemStyleCache.value(-1, null, null); if (forceUpdate) (_b = instance.proxy) == null ? void 0 : _b.$forceUpdate(); }; const resetAfterColumnIndex = (columnIndex, forceUpdate) => { resetAfter({ columnIndex }, forceUpdate); }; const resetAfterRowIndex = (rowIndex, forceUpdate) => { resetAfter({ rowIndex }, forceUpdate); }; Object.assign(instance.proxy, { resetAfterColumnIndex, resetAfterRowIndex, resetAfter }); }, initCache: ({ estimatedColumnWidth = DEFAULT_DYNAMIC_LIST_ITEM_SIZE, estimatedRowHeight = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }) => { return { column: {}, estimatedColumnWidth, estimatedRowHeight, lastVisitedColumnIndex: -1, lastVisitedRowIndex: -1, row: {} }; }, clearCache: false, validateProps: ({ columnWidth, rowHeight }) => { if (!isFunction(columnWidth)) throwError(SCOPE$3, ` "columnWidth" must be passed as function, instead ${typeof columnWidth} was given. `); if (!isFunction(rowHeight)) throwError(SCOPE$3, ` "rowHeight" must be passed as function, instead ${typeof rowHeight} was given. `); } }); const selectV2InjectionKey = Symbol("ElSelectV2Injection"); const selectV2Props = buildProps({ allowCreate: Boolean, autocomplete: { type: definePropType(String), default: "none" }, automaticDropdown: Boolean, clearable: Boolean, clearIcon: { type: iconPropType, default: circle_close_default }, effect: { type: definePropType(String), default: "light" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, tagTooltip: { type: definePropType(Object), default: () => ({}) }, maxCollapseTags: { type: Number, default: 1 }, defaultFirstOption: Boolean, disabled: { type: Boolean, default: void 0 }, estimatedOptionHeight: { type: Number, default: void 0 }, filterable: Boolean, filterMethod: { type: definePropType(Function) }, height: { type: Number, default: 274 }, itemHeight: { type: Number, default: 34 }, id: String, loading: Boolean, loadingText: String, modelValue: { type: definePropType([ Array, String, Number, Boolean, Object ]), default: void 0 }, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, name: String, noDataText: String, noMatchText: String, remoteMethod: { type: definePropType(Function) }, reserveKeyword: { type: Boolean, default: true }, options: { type: definePropType(Array), required: true }, placeholder: { type: String }, teleported: useTooltipContentProps.teleported, persistent: { type: Boolean, default: true }, popperClass: useTooltipContentProps.popperClass, popperStyle: useTooltipContentProps.popperStyle, popperOptions: { type: definePropType(Object), default: () => ({}) }, remote: Boolean, debounce: { type: Number, default: 300 }, size: useSizeProp, props: { type: definePropType(Object), default: () => defaultProps$2 }, valueKey: { type: String, default: "value" }, scrollbarAlwaysOn: Boolean, validateEvent: { type: Boolean, default: true }, offset: { type: Number, default: 12 }, remoteShowSuffix: Boolean, showArrow: { type: Boolean, default: true }, placement: { type: definePropType(String), values: Ee, default: "bottom-start" }, fallbackPlacements: { type: definePropType(Array), default: [ "bottom-start", "top-start", "right", "left" ] }, tagType: { ...tagProps.type, default: "info" }, tagEffect: { ...tagProps.effect, default: "light" }, tabindex: { type: [String, Number], default: 0 }, appendTo: useTooltipContentProps.appendTo, fitInputWidth: { type: [Boolean, Number], default: true, validator(val) { return isBoolean(val) || isNumber(val); } }, suffixIcon: { type: iconPropType, default: arrow_down_default }, ...useEmptyValuesProps, ...useAriaProps(["ariaLabel"]) }); const optionV2Props = buildProps({ data: Array, disabled: Boolean, hovering: Boolean, item: { type: definePropType(Object), required: true }, index: Number, style: Object, selected: Boolean, created: Boolean }); const selectV2Emits = { [UPDATE_MODEL_EVENT]: (val) => true, [CHANGE_EVENT]: (val) => true, "remove-tag": (val) => true, "visible-change": (visible) => true, focus: (evt) => evt instanceof FocusEvent, blur: (evt) => evt instanceof FocusEvent, clear: () => true }; const optionV2Emits = { hover: (index) => isNumber(index), select: (val, index) => true }; var group_item_vue_vue_type_script_lang_default = defineComponent({ props: { item: { type: Object, required: true }, style: { type: Object }, height: Number }, setup() { return { ns: useNamespace("select") }; } }); function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("div", { class: normalizeClass(_ctx.ns.be("group", "title")), style: normalizeStyle({ ..._ctx.style, lineHeight: `${_ctx.height}px` }) }, toDisplayString(_ctx.item.label), 7); } var group_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(group_item_vue_vue_type_script_lang_default, [["render", _sfc_render$7]]); function useOption(props2, { emit }) { return { hoverItem: () => { if (!props2.disabled) emit("hover", props2.index); }, selectOptionClick: () => { if (!props2.disabled) emit("select", props2.item, props2.index); } }; } var option_item_vue_vue_type_script_lang_default = defineComponent({ props: optionV2Props, emits: optionV2Emits, setup(props2, { emit }) { const select = inject(selectV2InjectionKey); const ns = useNamespace("select"); const { hoverItem, selectOptionClick } = useOption(props2, { emit }); const { getLabel } = useProps(select.props); const contentId = select.contentId; const handleMousedown = (event) => { let target = event.target; const currentTarget = event.currentTarget; while (target && target !== currentTarget) { if (isFocusable(target)) return; target = target.parentElement; } event.preventDefault(); }; return { ns, contentId, hoverItem, handleMousedown, selectOptionClick, getLabel }; } }); const _hoisted_1$m = [ "id", "aria-selected", "aria-disabled" ]; function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("li", { id: `${_ctx.contentId}-${_ctx.index}`, role: "option", "aria-selected": _ctx.selected, "aria-disabled": _ctx.disabled || void 0, style: normalizeStyle(_ctx.style), class: normalizeClass([ _ctx.ns.be("dropdown", "item"), _ctx.ns.is("selected", _ctx.selected), _ctx.ns.is("disabled", _ctx.disabled), _ctx.ns.is("created", _ctx.created), _ctx.ns.is("hovering", _ctx.hovering) ]), onMousemove: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)), onMousedown: _cache[1] || (_cache[1] = (...args) => _ctx.handleMousedown && _ctx.handleMousedown(...args)), onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"])) }, [renderSlot(_ctx.$slots, "default", { item: _ctx.item, index: _ctx.index, disabled: _ctx.disabled }, () => [createBaseVNode("span", null, toDisplayString(_ctx.getLabel(_ctx.item)), 1)])], 46, _hoisted_1$m); } var option_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(option_item_vue_vue_type_script_lang_default, [["render", _sfc_render$6]]); const props = { loading: Boolean, data: { type: Array, required: true }, hoveringIndex: Number, width: Number, id: String, ariaLabel: String }; var select_dropdown_default = /* @__PURE__ */ defineComponent({ name: "ElSelectDropdown", props, setup(props2, { slots, expose }) { const select = inject(selectV2InjectionKey); const ns = useNamespace("select"); const { getLabel, getValue, getDisabled } = useProps(select.props); const cachedHeights = ref([]); const listRef = ref(); const size = computed(() => props2.data.length); watch(() => size.value, () => { var _a, _b; (_b = (_a = select.tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a); }); const isSized = computed(() => isUndefined(select.props.estimatedOptionHeight)); const listProps = computed(() => { if (isSized.value) return { itemSize: select.props.itemHeight }; return { estimatedSize: select.props.estimatedOptionHeight, itemSize: (idx) => cachedHeights.value[idx] }; }); const contains = (arr = [], target) => { const { props: { valueKey } } = select; if (!isObject(target)) return arr.includes(target); return arr && arr.some((item) => { return toRaw(get(item, valueKey)) === get(target, valueKey); }); }; const isEqual2 = (selected, target) => { if (!isObject(target)) return selected === target; else { const { valueKey } = select.props; return get(selected, valueKey) === get(target, valueKey); } }; const isItemSelected = (modelValue, target) => { if (select.props.multiple) return contains(modelValue, getValue(target)); return isEqual2(modelValue, getValue(target)); }; const isItemDisabled = (modelValue, selected) => { const { disabled, multiple, multipleLimit } = select.props; return disabled || !selected && (multiple ? multipleLimit > 0 && modelValue.length >= multipleLimit : false); }; const isItemHovering = (target) => props2.hoveringIndex === target; const scrollToItem = (index) => { const list = listRef.value; if (list) list.scrollToItem(index); }; const resetScrollTop = () => { const list = listRef.value; if (list) list.resetScrollTop(); }; expose({ listRef, isSized, isItemDisabled, isItemHovering, isItemSelected, scrollToItem, resetScrollTop }); const Item = (itemProps) => { const { index, data, style } = itemProps; const sized = unref(isSized); const { itemSize: itemSize2, estimatedSize } = unref(listProps); const { modelValue } = select.props; const { onSelect, onHover } = select; const item = data[index]; if (item.type === "Group") return createVNode(group_item_default, { "item": item, "style": style, "height": sized ? itemSize2 : estimatedSize }, null); const isSelected = isItemSelected(modelValue, item); const isDisabled = isItemDisabled(modelValue, isSelected); const isHovering = isItemHovering(index); return createVNode(option_item_default, mergeProps(itemProps, { "selected": isSelected, "disabled": getDisabled(item) || isDisabled, "created": !!item.created, "hovering": isHovering, "item": item, "onSelect": onSelect, "onHover": onHover }), { default: (props3) => { var _a; return ((_a = slots.default) == null ? void 0 : _a.call(slots, props3)) || createVNode("span", null, [getLabel(item)]); } }); }; const { onKeyboardNavigate, onKeyboardSelect } = select; const onForward = () => { onKeyboardNavigate("forward"); }; const onBackward = () => { onKeyboardNavigate("backward"); }; const onKeydown = (e) => { const code = getEventCode(e); const { tab, esc, down, up, enter, numpadEnter } = EVENT_CODE; if ([ esc, down, up, enter, numpadEnter ].includes(code)) { e.preventDefault(); e.stopPropagation(); } switch (code) { case tab: case esc: break; case down: onForward(); break; case up: onBackward(); break; case enter: case numpadEnter: onKeyboardSelect(); break; } }; return () => { var _a, _b, _c, _d; const { data, width } = props2; const { height, multiple, scrollbarAlwaysOn } = select.props; const isScrollbarAlwaysOn = computed(() => { return isIOS ? true : scrollbarAlwaysOn; }); const List = unref(isSized) ? FixedSizeList : DynamicSizeList; return createVNode("div", { "class": [ns.b("dropdown"), ns.is("multiple", multiple)], "style": { width: `${width}px` } }, [ (_a = slots.header) == null ? void 0 : _a.call(slots), ((_b = slots.loading) == null ? void 0 : _b.call(slots)) || ((_c = slots.empty) == null ? void 0 : _c.call(slots)) || createVNode(List, mergeProps({ "ref": listRef }, unref(listProps), { "className": ns.be("dropdown", "list"), "scrollbarAlwaysOn": isScrollbarAlwaysOn.value, "data": data, "height": height, "width": width, "total": data.length, "innerElement": "ul", "innerProps": { id: props2.id, role: "listbox", "aria-label": props2.ariaLabel, "aria-orientation": "vertical" }, "onKeydown": onKeydown }), { default: (props3) => createVNode(Item, props3, null) }), (_d = slots.footer) == null ? void 0 : _d.call(slots) ]); }; } }); function useAllowCreate(props2, states) { const { aliasProps, getLabel, getValue } = useProps(props2); const createOptionCount = ref(0); const cachedSelectedOption = ref(); const enableAllowCreateMode = computed(() => { return props2.allowCreate && props2.filterable; }); watch(() => props2.options, (options) => { const optionLabelsSet = new Set(options.map((option) => getLabel(option))); states.createdOptions = states.createdOptions.filter((createdOption) => !optionLabelsSet.has(getLabel(createdOption))); }); function hasExistingOption(query) { const hasOption = (option) => getLabel(option) === query; return props2.options && props2.options.some(hasOption) || states.createdOptions.some(hasOption); } function selectNewOption(option) { if (!enableAllowCreateMode.value) return; if (props2.multiple && option.created) createOptionCount.value++; else cachedSelectedOption.value = option; } function createNewOption(query) { if (enableAllowCreateMode.value) if (query && query.length > 0) { if (hasExistingOption(query)) { states.createdOptions = states.createdOptions.filter((createdOption) => getLabel(createdOption) !== states.previousQuery); return; } const newOption = { [aliasProps.value.value]: query, [aliasProps.value.label]: query, created: true, [aliasProps.value.disabled]: false }; if (states.createdOptions.length >= createOptionCount.value) states.createdOptions[createOptionCount.value] = newOption; else states.createdOptions.push(newOption); } else if (props2.multiple) states.createdOptions.length = createOptionCount.value; else { const selectedOption = cachedSelectedOption.value; states.createdOptions.length = 0; if (selectedOption && selectedOption.created) states.createdOptions.push(selectedOption); } } function removeNewOption(option) { if (!enableAllowCreateMode.value || !option || !option.created || option.created && props2.reserveKeyword && states.inputValue === getLabel(option)) return; const idx = states.createdOptions.findIndex((it) => getValue(it) === getValue(option)); if (~idx) { states.createdOptions.splice(idx, 1); createOptionCount.value--; } } function clearAllNewOption() { if (enableAllowCreateMode.value) { states.createdOptions.length = 0; createOptionCount.value = 0; } } return { createNewOption, removeNewOption, selectNewOption, clearAllNewOption }; } const useSelect$1 = (props2, emit) => { const { t } = useLocale(); const slots = useSlots(); const nsSelect = useNamespace("select"); const nsInput = useNamespace("input"); const { form: elForm, formItem: elFormItem } = useFormItem(); const { inputId } = useFormItemInputId(props2, { formItemContext: elFormItem }); const { aliasProps, getLabel, getValue, getDisabled, getOptions } = useProps(props2); const { valueOnClear, isEmptyValue } = useEmptyValues(props2); const states = reactive({ inputValue: "", cachedOptions: [], createdOptions: [], hoveringIndex: -1, inputHovering: false, selectionWidth: 0, collapseItemWidth: 0, previousQuery: null, previousValue: void 0, selectedLabel: "", menuVisibleOnFocus: false, isBeforeHide: false }); const popperSize = ref(-1); const debouncing = ref(false); const selectRef = ref(); const selectionRef = ref(); const tooltipRef = ref(); const tagTooltipRef = ref(); const inputRef = ref(); const prefixRef = ref(); const suffixRef = ref(); const menuRef = ref(); const tagMenuRef = ref(); const collapseItemRef = ref(); const { isComposing, handleCompositionStart, handleCompositionEnd, handleCompositionUpdate } = useComposition({ afterComposition: (e) => onInput(e) }); const selectDisabled = useFormDisabled(); const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, { disabled: selectDisabled, afterFocus() { if (props2.automaticDropdown && !expanded.value) { expanded.value = true; states.menuVisibleOnFocus = true; } }, beforeBlur(event) { var _a, _b; return ((_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event)) || ((_b = tagTooltipRef.value) == null ? void 0 : _b.isFocusInsideContent(event)); }, afterBlur() { var _a; expanded.value = false; states.menuVisibleOnFocus = false; if (props2.validateEvent) (_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "blur").catch((err) => debugWarn(err)); } }); const allOptions = computed(() => filterOptions("")); const hasOptions = computed(() => { if (props2.loading) return false; return props2.options.length > 0 || states.createdOptions.length > 0; }); const filteredOptions = ref([]); const expanded = ref(false); const needStatusIcon = computed(() => (elForm == null ? void 0 : elForm.statusIcon) ?? false); const popupHeight = computed(() => { const totalHeight = filteredOptions.value.length * props2.itemHeight; return totalHeight > props2.height ? props2.height : totalHeight; }); const hasModelValue = computed(() => { return props2.multiple ? isArray(props2.modelValue) && props2.modelValue.length > 0 : !isEmptyValue(props2.modelValue); }); const showClearBtn = computed(() => { return props2.clearable && !selectDisabled.value && hasModelValue.value && (isFocused.value || states.inputHovering); }); const iconComponent = computed(() => props2.remote && props2.filterable && !props2.remoteShowSuffix ? "" : props2.suffixIcon); const iconReverse = computed(() => iconComponent.value && nsSelect.is("reverse", expanded.value)); const validateState = computed(() => (elFormItem == null ? void 0 : elFormItem.validateState) || ""); const validateIcon = computed(() => { if (!validateState.value) return; return ValidateComponentsMap[validateState.value]; }); const debounce2 = computed(() => props2.remote ? props2.debounce : 0); const isRemoteSearchEmpty = computed(() => props2.remote && !states.inputValue && !hasOptions.value); const emptyText = computed(() => { if (props2.loading) return props2.loadingText || t("el.select.loading"); else { if (props2.filterable && states.inputValue && hasOptions.value && filteredOptions.value.length === 0) return props2.noMatchText || t("el.select.noMatch"); if (!hasOptions.value) return props2.noDataText || t("el.select.noData"); } return null; }); const isFilterMethodValid = computed(() => props2.filterable && isFunction(props2.filterMethod)); const isRemoteMethodValid = computed(() => props2.filterable && props2.remote && isFunction(props2.remoteMethod)); const filterOptions = (query) => { const regexp = new RegExp(escapeStringRegexp(query), "i"); const isValidOption = (o) => { if (isFilterMethodValid.value || isRemoteMethodValid.value) return true; return query ? regexp.test(getLabel(o) || "") : true; }; if (props2.loading) return []; return [...states.createdOptions, ...props2.options].reduce((all, item) => { const options = getOptions(item); if (isArray(options)) { const filtered = options.filter(isValidOption); if (filtered.length > 0) all.push({ label: getLabel(item), type: "Group" }, ...filtered); } else if (props2.remote || isValidOption(item)) all.push(item); return all; }, []); }; const updateOptions2 = () => { filteredOptions.value = filterOptions(states.inputValue); }; const allOptionsValueMap = computed(() => { const valueMap = /* @__PURE__ */ new Map(); allOptions.value.forEach((option, index) => { valueMap.set(getValueKey(getValue(option)), { option, index }); }); return valueMap; }); const filteredOptionsValueMap = computed(() => { const valueMap = /* @__PURE__ */ new Map(); filteredOptions.value.forEach((option, index) => { valueMap.set(getValueKey(getValue(option)), { option, index }); }); return valueMap; }); const optionsAllDisabled = computed(() => filteredOptions.value.every((option) => getDisabled(option))); const selectSize = useFormSize(); const collapseTagSize = computed(() => "small" === selectSize.value ? "small" : "default"); const calculatePopperSize = () => { var _a; if (isNumber(props2.fitInputWidth)) { popperSize.value = props2.fitInputWidth; return; } const width = ((_a = selectRef.value) == null ? void 0 : _a.offsetWidth) || 200; if (!props2.fitInputWidth && hasOptions.value) nextTick(() => { popperSize.value = Math.max(width, calculateLabelMaxWidth()); }); else popperSize.value = width; }; const calculateLabelMaxWidth = () => { var _a, _b; const ctx = document.createElement("canvas").getContext("2d"); const selector = nsSelect.be("dropdown", "item"); const dropdownItemEl = (((_b = (_a = menuRef.value) == null ? void 0 : _a.listRef) == null ? void 0 : _b.innerRef) || document).querySelector(`.${selector}`); if (dropdownItemEl === null || ctx === null) return 0; const style = getComputedStyle(dropdownItemEl); const padding = Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight); ctx.font = `bold ${style.font.replace(new RegExp(`\\b${style.fontWeight}\\b`), "")}`; return filteredOptions.value.reduce((max2, option) => { const metrics = ctx.measureText(getLabel(option)); return Math.max(metrics.width, max2); }, 0) + padding; }; const getGapWidth = () => { if (!selectionRef.value) return 0; const style = window.getComputedStyle(selectionRef.value); return Number.parseFloat(style.gap || "6px"); }; const tagStyle = computed(() => { const gapWidth = getGapWidth(); const inputSlotWidth = props2.filterable ? gapWidth + MINIMUM_INPUT_WIDTH : 0; return { maxWidth: `${collapseItemRef.value && props2.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.selectionWidth - inputSlotWidth}px` }; }); const collapseTagStyle = computed(() => { return { maxWidth: `${states.selectionWidth}px` }; }); const shouldShowPlaceholder = computed(() => { if (isArray(props2.modelValue)) return props2.modelValue.length === 0 && !states.inputValue; return props2.filterable ? !states.inputValue : true; }); const currentPlaceholder = computed(() => { const _placeholder = props2.placeholder ?? t("el.select.placeholder"); return props2.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel; }); const popperRef = computed(() => { var _a, _b; return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef; }); const indexRef = computed(() => { if (props2.multiple) { const len = props2.modelValue.length; if (len > 0 && filteredOptionsValueMap.value.has(props2.modelValue[len - 1])) { const { index } = filteredOptionsValueMap.value.get(props2.modelValue[len - 1]); return index; } } else if (!isEmptyValue(props2.modelValue) && filteredOptionsValueMap.value.has(props2.modelValue)) { const { index } = filteredOptionsValueMap.value.get(props2.modelValue); return index; } return -1; }); const dropdownMenuVisible = computed({ get() { return expanded.value && (props2.loading || !isRemoteSearchEmpty.value || props2.remote && !!slots.empty) && (!debouncing.value || !isEmpty(states.previousQuery) || hasOptions.value); }, set(val) { expanded.value = val; } }); const showTagList = computed(() => { if (!props2.multiple) return []; return props2.collapseTags ? states.cachedOptions.slice(0, props2.maxCollapseTags) : states.cachedOptions; }); const collapseTagList = computed(() => { if (!props2.multiple) return []; return props2.collapseTags ? states.cachedOptions.slice(props2.maxCollapseTags) : []; }); const { createNewOption, removeNewOption, selectNewOption, clearAllNewOption } = useAllowCreate(props2, states); const toggleMenu = (event) => { var _a; if (selectDisabled.value || props2.filterable && expanded.value && event && !((_a = suffixRef.value) == null ? void 0 : _a.contains(event.target))) return; if (states.menuVisibleOnFocus) states.menuVisibleOnFocus = false; else expanded.value = !expanded.value; }; const onInputChange = () => { if (states.inputValue.length > 0 && !expanded.value) expanded.value = true; createNewOption(states.inputValue); nextTick(() => { handleQueryChange(states.inputValue); }); }; const debouncedOnInputChange = useDebounceFn(() => { onInputChange(); debouncing.value = false; }, debounce2); const handleQueryChange = (val) => { if (states.previousQuery === val || isComposing.value) return; states.previousQuery = val; if (props2.filterable && isFunction(props2.filterMethod)) props2.filterMethod(val); else if (props2.filterable && props2.remote && isFunction(props2.remoteMethod)) props2.remoteMethod(val); if (props2.defaultFirstOption && (props2.filterable || props2.remote) && filteredOptions.value.length) nextTick(checkDefaultFirstOption); else nextTick(updateHoveringIndex); }; const checkDefaultFirstOption = () => { const optionsInDropdown = filteredOptions.value.filter((n) => !n.disabled && n.type !== "Group"); const userCreatedOption = optionsInDropdown.find((n) => n.created); const firstOriginOption = optionsInDropdown[0]; states.hoveringIndex = getValueIndex(filteredOptions.value, userCreatedOption || firstOriginOption); }; const emitChange = (val) => { if (!isEqual(props2.modelValue, val)) emit(CHANGE_EVENT, val); }; const update = (val) => { emit(UPDATE_MODEL_EVENT, val); emitChange(val); states.previousValue = props2.multiple ? String(val) : val; nextTick(() => { if (props2.multiple && isArray(props2.modelValue)) { const cachedOptions = states.cachedOptions.slice(); const selectedOptions = props2.modelValue.map((value) => getOption(value, cachedOptions)); if (!isEqual(states.cachedOptions, selectedOptions)) states.cachedOptions = selectedOptions; } else initStates(true); }); }; const getValueIndex = (arr = [], value) => { if (!isObject(value)) return arr.indexOf(value); const valueKey = props2.valueKey; let index = -1; arr.some((item, i) => { if (get(item, valueKey) === get(value, valueKey)) { index = i; return true; } return false; }); return index; }; const getValueKey = (item) => { return isObject(item) ? get(item, props2.valueKey) : item; }; const handleResize = () => { calculatePopperSize(); }; const resetSelectionWidth = () => { states.selectionWidth = Number.parseFloat(window.getComputedStyle(selectionRef.value).width); }; const resetCollapseItemWidth = () => { states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width; }; const updateTooltip = () => { var _a, _b; (_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a); }; const updateTagTooltip = () => { var _a, _b; (_b = (_a = tagTooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a); }; const onSelect = (option) => { const optionValue = getValue(option); if (props2.multiple) { let selectedOptions = props2.modelValue.slice(); const index = getValueIndex(selectedOptions, optionValue); if (index > -1) { selectedOptions = [...selectedOptions.slice(0, index), ...selectedOptions.slice(index + 1)]; states.cachedOptions.splice(index, 1); removeNewOption(option); } else if (props2.multipleLimit <= 0 || selectedOptions.length < props2.multipleLimit) { selectedOptions = [...selectedOptions, optionValue]; states.cachedOptions.push(option); selectNewOption(option); } update(selectedOptions); if (option.created) handleQueryChange(""); if (props2.filterable && (option.created || !props2.reserveKeyword)) states.inputValue = ""; } else { states.selectedLabel = getLabel(option); !isEqual(props2.modelValue, optionValue) && update(optionValue); expanded.value = false; selectNewOption(option); if (!option.created) clearAllNewOption(); } focus(); }; const deleteTag = (event, option) => { let selectedOptions = props2.modelValue.slice(); const index = getValueIndex(selectedOptions, getValue(option)); if (index > -1 && !selectDisabled.value) { selectedOptions = [...props2.modelValue.slice(0, index), ...props2.modelValue.slice(index + 1)]; states.cachedOptions.splice(index, 1); update(selectedOptions); emit("remove-tag", getValue(option)); removeNewOption(option); } event.stopPropagation(); focus(); }; const focus = () => { var _a; (_a = inputRef.value) == null ? void 0 : _a.focus(); }; const blur = () => { var _a; if (expanded.value) { expanded.value = false; nextTick(() => { var _a2; return (_a2 = inputRef.value) == null ? void 0 : _a2.blur(); }); return; } (_a = inputRef.value) == null ? void 0 : _a.blur(); }; const handleEsc = () => { if (states.inputValue.length > 0) states.inputValue = ""; else expanded.value = false; }; const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) => !states.cachedOptions.some((option) => getValue(option) === it && getDisabled(option))); const handleDel = (e) => { const code = getEventCode(e); if (!props2.multiple) return; if (code === EVENT_CODE.delete) return; if (states.inputValue.length === 0) { e.preventDefault(); const selected = props2.modelValue.slice(); const lastNotDisabledIndex = getLastNotDisabledIndex(selected); if (lastNotDisabledIndex < 0) return; const removeTagValue = selected[lastNotDisabledIndex]; selected.splice(lastNotDisabledIndex, 1); const option = states.cachedOptions[lastNotDisabledIndex]; states.cachedOptions.splice(lastNotDisabledIndex, 1); removeNewOption(option); update(selected); emit("remove-tag", removeTagValue); } }; const handleClear = () => { let emptyValue; if (isArray(props2.modelValue)) emptyValue = []; else emptyValue = valueOnClear.value; states.selectedLabel = ""; expanded.value = false; update(emptyValue); emit("clear"); clearAllNewOption(); focus(); }; const onKeyboardNavigate = (direction2, hoveringIndex = void 0) => { const options = filteredOptions.value; if (!["forward", "backward"].includes(direction2) || selectDisabled.value || options.length <= 0 || optionsAllDisabled.value || isComposing.value) return; if (!expanded.value) return toggleMenu(); if (isUndefined(hoveringIndex)) hoveringIndex = states.hoveringIndex; let newIndex = -1; if (direction2 === "forward") { newIndex = hoveringIndex + 1; if (newIndex >= options.length) newIndex = 0; } else if (direction2 === "backward") { newIndex = hoveringIndex - 1; if (newIndex < 0 || newIndex >= options.length) newIndex = options.length - 1; } const option = options[newIndex]; if (getDisabled(option) || option.type === "Group") return onKeyboardNavigate(direction2, newIndex); else { states.hoveringIndex = newIndex; scrollToItem(newIndex); } }; const onKeyboardSelect = () => { if (!expanded.value) return toggleMenu(); else if (~states.hoveringIndex && filteredOptions.value[states.hoveringIndex]) onSelect(filteredOptions.value[states.hoveringIndex]); }; const onHoverOption = (idx) => { states.hoveringIndex = idx ?? -1; }; const updateHoveringIndex = () => { if (!props2.multiple) states.hoveringIndex = filteredOptions.value.findIndex((item) => { return getValueKey(getValue(item)) === getValueKey(props2.modelValue); }); else { const length = props2.modelValue.length; if (length > 0) { const lastValue = props2.modelValue[length - 1]; states.hoveringIndex = filteredOptions.value.findIndex((item) => getValueKey(lastValue) === getValueKey(getValue(item))); } else states.hoveringIndex = -1; } }; const onInput = (event) => { states.inputValue = event.target.value; if (props2.remote) { debouncing.value = true; debouncedOnInputChange(); } else return onInputChange(); }; const handleClickOutside = (event) => { expanded.value = false; if (isFocused.value) handleBlur(new FocusEvent("blur", event)); }; const handleMenuEnter = () => { states.isBeforeHide = false; return nextTick(() => { if (~indexRef.value) scrollToItem(indexRef.value); }); }; const scrollToItem = (index) => { menuRef.value.scrollToItem(index); }; const getOption = (value, cachedOptions) => { const selectValue = getValueKey(value); if (allOptionsValueMap.value.has(selectValue)) { const { option } = allOptionsValueMap.value.get(selectValue); return option; } if (cachedOptions && cachedOptions.length) { const option = cachedOptions.find((option2) => getValueKey(getValue(option2)) === selectValue); if (option) return option; } return { [aliasProps.value.value]: value, [aliasProps.value.label]: value }; }; const getIndex = (option) => { var _a; return ((_a = allOptionsValueMap.value.get(getValue(option))) == null ? void 0 : _a.index) ?? -1; }; const initStates = (needUpdateSelectedLabel = false) => { if (props2.multiple) if (props2.modelValue.length > 0) { const cachedOptions = states.cachedOptions.slice(); states.cachedOptions.length = 0; states.previousValue = props2.modelValue.toString(); for (const value of props2.modelValue) { const option = getOption(value, cachedOptions); states.cachedOptions.push(option); } } else { states.cachedOptions = []; states.previousValue = void 0; } else if (hasModelValue.value) { states.previousValue = props2.modelValue; const options = filteredOptions.value; const selectedItemIndex = options.findIndex((option) => getValueKey(getValue(option)) === getValueKey(props2.modelValue)); if (~selectedItemIndex) states.selectedLabel = getLabel(options[selectedItemIndex]); else if (!states.selectedLabel || needUpdateSelectedLabel) states.selectedLabel = getValueKey(props2.modelValue); } else { states.selectedLabel = ""; states.previousValue = void 0; } clearAllNewOption(); calculatePopperSize(); }; watch(() => props2.fitInputWidth, () => { calculatePopperSize(); }); watch(expanded, (val) => { if (val) { if (!props2.persistent) calculatePopperSize(); handleQueryChange(""); } else { states.inputValue = ""; states.previousQuery = null; states.isBeforeHide = true; states.menuVisibleOnFocus = false; createNewOption(""); } }); watch(() => props2.modelValue, (val, oldVal) => { var _a; if (!val || isArray(val) && val.length === 0 || props2.multiple && !isEqual(val.toString(), states.previousValue) || !props2.multiple && getValueKey(val) !== getValueKey(states.previousValue)) initStates(true); if (!isEqual(val, oldVal) && props2.validateEvent) (_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn(err)); }, { deep: true }); watch(() => props2.options, () => { const input = inputRef.value; if (!input || input && document.activeElement !== input) initStates(); }, { deep: true, flush: "post" }); watch(() => filteredOptions.value, () => { calculatePopperSize(); return menuRef.value && nextTick(menuRef.value.resetScrollTop); }); watchEffect(() => { if (states.isBeforeHide) return; updateOptions2(); }); watchEffect(() => { const { valueKey, options } = props2; const duplicateValue = /* @__PURE__ */ new Map(); for (const item of options) { const optionValue = getValue(item); let v = optionValue; if (isObject(v)) v = get(optionValue, valueKey); if (duplicateValue.get(v)) { debugWarn("ElSelectV2", `The option values you provided seem to be duplicated, which may cause some problems, please check.`); break; } else duplicateValue.set(v, true); } }); onMounted(() => { initStates(); }); useResizeObserver(selectRef, handleResize); useResizeObserver(selectionRef, resetSelectionWidth); useResizeObserver(wrapperRef, updateTooltip); useResizeObserver(tagMenuRef, updateTagTooltip); useResizeObserver(collapseItemRef, resetCollapseItemWidth); let stop; watch(() => dropdownMenuVisible.value, (newVal) => { if (newVal) stop = useResizeObserver(menuRef, updateTooltip).stop; else { stop == null ? void 0 : stop(); stop = void 0; } emit("visible-change", newVal); }); return { inputId, collapseTagSize, currentPlaceholder, expanded, emptyText, popupHeight, debounce: debounce2, allOptions, allOptionsValueMap, filteredOptions, iconComponent, iconReverse, tagStyle, collapseTagStyle, popperSize, dropdownMenuVisible, hasModelValue, shouldShowPlaceholder, selectDisabled, selectSize, needStatusIcon, showClearBtn, states, isFocused, nsSelect, nsInput, inputRef, menuRef, tagMenuRef, tooltipRef, tagTooltipRef, selectRef, wrapperRef, selectionRef, prefixRef, suffixRef, collapseItemRef, popperRef, validateState, validateIcon, showTagList, collapseTagList, debouncedOnInputChange, deleteTag, getLabel, getValue, getDisabled, getValueKey, getIndex, handleClear, handleClickOutside, handleDel, handleEsc, focus, blur, handleMenuEnter, handleResize, resetSelectionWidth, updateTooltip, updateTagTooltip, updateOptions: updateOptions2, toggleMenu, scrollTo: scrollToItem, onInput, onKeyboardNavigate, onKeyboardSelect, onSelect, onHover: onHoverOption, handleCompositionStart, handleCompositionEnd, handleCompositionUpdate }; }; var select_vue_vue_type_script_lang_default = defineComponent({ name: "ElSelectV2", components: { ElSelectMenu: select_dropdown_default, ElTag, ElTooltip, ElIcon }, directives: { ClickOutside }, props: selectV2Props, emits: selectV2Emits, setup(props2, { emit }) { const modelValue = computed(() => { const { modelValue: rawModelValue, multiple } = props2; const fallback = multiple ? [] : void 0; if (isArray(rawModelValue)) return multiple ? rawModelValue : fallback; return multiple ? fallback : rawModelValue; }); const API = useSelect$1(reactive({ ...toRefs(props2), modelValue }), emit); const { calculatorRef, inputStyle } = useCalcInputWidth(); const contentId = useId(); provide(selectV2InjectionKey, { props: reactive({ ...toRefs(props2), height: API.popupHeight, modelValue }), expanded: API.expanded, tooltipRef: API.tooltipRef, contentId, onSelect: API.onSelect, onHover: API.onHover, onKeyboardNavigate: API.onKeyboardNavigate, onKeyboardSelect: API.onKeyboardSelect }); const selectedLabel = computed(() => { if (!props2.multiple) return API.states.selectedLabel; return API.states.cachedOptions.map((i) => API.getLabel(i)); }); return { ...API, modelValue, selectedLabel, calculatorRef, inputStyle, contentId, BORDER_HORIZONTAL_WIDTH }; } }); const _hoisted_1$l = [ "id", "value", "autocomplete", "tabindex", "aria-expanded", "aria-label", "disabled", "aria-controls", "aria-activedescendant", "readonly", "name" ]; const _hoisted_2$d = ["textContent"]; const _hoisted_3$5 = { key: 1 }; function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_tag = resolveComponent("el-tag"); const _component_el_tooltip = resolveComponent("el-tooltip"); const _component_el_icon = resolveComponent("el-icon"); const _component_el_select_menu = resolveComponent("el-select-menu"); const _directive_click_outside = resolveDirective("click-outside"); return withDirectives((openBlock(), createElementBlock("div", { ref: "selectRef", class: normalizeClass([_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]), onMouseenter: _cache[15] || (_cache[15] = ($event) => _ctx.states.inputHovering = true), onMouseleave: _cache[16] || (_cache[16] = ($event) => _ctx.states.inputHovering = false) }, [createVNode(_component_el_tooltip, { ref: "tooltipRef", visible: _ctx.dropdownMenuVisible, teleported: _ctx.teleported, "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass], "popper-style": _ctx.popperStyle, "gpu-acceleration": false, "stop-popper-mouse-event": false, "popper-options": _ctx.popperOptions, "fallback-placements": _ctx.fallbackPlacements, effect: _ctx.effect, placement: _ctx.placement, pure: "", transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`, trigger: "click", persistent: _ctx.persistent, "append-to": _ctx.appendTo, "show-arrow": _ctx.showArrow, offset: _ctx.offset, onBeforeShow: _ctx.handleMenuEnter, onHide: _cache[14] || (_cache[14] = ($event) => _ctx.states.isBeforeHide = false) }, { default: withCtx(() => { var _a; return [createBaseVNode("div", { ref: "wrapperRef", class: normalizeClass([ _ctx.nsSelect.e("wrapper"), _ctx.nsSelect.is("focused", _ctx.isFocused), _ctx.nsSelect.is("hovering", _ctx.states.inputHovering), _ctx.nsSelect.is("filterable", _ctx.filterable), _ctx.nsSelect.is("disabled", _ctx.selectDisabled) ]), onClick: _cache[11] || (_cache[11] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["prevent"])) }, [ _ctx.$slots.prefix ? (openBlock(), createElementBlock("div", { key: 0, ref: "prefixRef", class: normalizeClass(_ctx.nsSelect.e("prefix")) }, [renderSlot(_ctx.$slots, "prefix")], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref: "selectionRef", class: normalizeClass([_ctx.nsSelect.e("selection"), _ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.modelValue.length)]) }, [ _ctx.multiple ? renderSlot(_ctx.$slots, "tag", { key: 0, data: _ctx.states.cachedOptions, deleteTag: _ctx.deleteTag, selectDisabled: _ctx.selectDisabled }, () => { var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m; return [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => { return openBlock(), createElementBlock("div", { key: _ctx.getValueKey(_ctx.getValue(item)), class: normalizeClass(_ctx.nsSelect.e("selected-item")) }, [createVNode(_component_el_tag, { closable: !_ctx.selectDisabled && !_ctx.getDisabled(item), size: _ctx.collapseTagSize, type: _ctx.tagType, effect: _ctx.tagEffect, "disable-transitions": "", style: normalizeStyle(_ctx.tagStyle), onClose: ($event) => _ctx.deleteTag($event, item) }, { default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, [renderSlot(_ctx.$slots, "label", { index: _ctx.getIndex(item), label: _ctx.getLabel(item), value: _ctx.getValue(item) }, () => [createTextVNode(toDisplayString(_ctx.getLabel(item)), 1)])], 2)]), _: 2 }, 1032, [ "closable", "size", "type", "effect", "style", "onClose" ])], 2); }), 128)), _ctx.collapseTags && _ctx.states.cachedOptions.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, { key: 0, ref: "tagTooltipRef", disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip, "fallback-placements": ((_a2 = _ctx.tagTooltip) == null ? void 0 : _a2.fallbackPlacements) ?? [ "bottom", "top", "right", "left" ], effect: ((_b = _ctx.tagTooltip) == null ? void 0 : _b.effect) ?? _ctx.effect, placement: ((_c = _ctx.tagTooltip) == null ? void 0 : _c.placement) ?? "bottom", "popper-class": ((_d = _ctx.tagTooltip) == null ? void 0 : _d.popperClass) ?? _ctx.popperClass, "popper-style": ((_e = _ctx.tagTooltip) == null ? void 0 : _e.popperStyle) ?? _ctx.popperStyle, teleported: ((_f = _ctx.tagTooltip) == null ? void 0 : _f.teleported) ?? _ctx.teleported, "append-to": ((_g = _ctx.tagTooltip) == null ? void 0 : _g.appendTo) ?? _ctx.appendTo, "popper-options": ((_h = _ctx.tagTooltip) == null ? void 0 : _h.popperOptions) ?? _ctx.popperOptions, transition: (_i = _ctx.tagTooltip) == null ? void 0 : _i.transition, "show-after": (_j = _ctx.tagTooltip) == null ? void 0 : _j.showAfter, "hide-after": (_k = _ctx.tagTooltip) == null ? void 0 : _k.hideAfter, "auto-close": (_l = _ctx.tagTooltip) == null ? void 0 : _l.autoClose, offset: (_m = _ctx.tagTooltip) == null ? void 0 : _m.offset }, { default: withCtx(() => [createBaseVNode("div", { ref: "collapseItemRef", class: normalizeClass(_ctx.nsSelect.e("selected-item")) }, [createVNode(_component_el_tag, { closable: false, size: _ctx.collapseTagSize, type: _ctx.tagType, effect: _ctx.tagEffect, style: normalizeStyle(_ctx.collapseTagStyle), "disable-transitions": "" }, { default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, " + " + toDisplayString(_ctx.states.cachedOptions.length - _ctx.maxCollapseTags), 3)]), _: 1 }, 8, [ "size", "type", "effect", "style" ])], 2)]), content: withCtx(() => [createBaseVNode("div", { ref: "tagMenuRef", class: normalizeClass(_ctx.nsSelect.e("selection")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (selected) => { return openBlock(), createElementBlock("div", { key: _ctx.getValueKey(_ctx.getValue(selected)), class: normalizeClass(_ctx.nsSelect.e("selected-item")) }, [createVNode(_component_el_tag, { class: "in-tooltip", closable: !_ctx.selectDisabled && !_ctx.getDisabled(selected), size: _ctx.collapseTagSize, type: _ctx.tagType, effect: _ctx.tagEffect, "disable-transitions": "", onClose: ($event) => _ctx.deleteTag($event, selected) }, { default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, [renderSlot(_ctx.$slots, "label", { index: _ctx.getIndex(selected), label: _ctx.getLabel(selected), value: _ctx.getValue(selected) }, () => [createTextVNode(toDisplayString(_ctx.getLabel(selected)), 1)])], 2)]), _: 2 }, 1032, [ "closable", "size", "type", "effect", "onClose" ])], 2); }), 128))], 2)]), _: 3 }, 8, [ "disabled", "fallback-placements", "effect", "placement", "popper-class", "popper-style", "teleported", "append-to", "popper-options", "transition", "show-after", "hide-after", "auto-close", "offset" ])) : createCommentVNode("v-if", true)]; }) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass([ _ctx.nsSelect.e("selected-item"), _ctx.nsSelect.e("input-wrapper"), _ctx.nsSelect.is("hidden", !_ctx.filterable || _ctx.selectDisabled || !_ctx.states.inputValue && !_ctx.isFocused) ]) }, [createBaseVNode("input", { id: _ctx.inputId, ref: "inputRef", value: _ctx.states.inputValue, style: normalizeStyle(_ctx.inputStyle), autocomplete: _ctx.autocomplete, tabindex: _ctx.tabindex, "aria-autocomplete": "none", "aria-haspopup": "listbox", autocapitalize: "off", "aria-expanded": _ctx.expanded, "aria-label": _ctx.ariaLabel, class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]), disabled: _ctx.selectDisabled, role: "combobox", "aria-controls": _ctx.contentId, "aria-activedescendant": _ctx.states.hoveringIndex >= 0 ? `${_ctx.contentId}-${_ctx.states.hoveringIndex}` : "", readonly: !_ctx.filterable, spellcheck: "false", type: "text", name: _ctx.name, onInput: _cache[0] || (_cache[0] = (...args) => _ctx.onInput && _ctx.onInput(...args)), onChange: _cache[1] || (_cache[1] = withModifiers(() => { }, ["stop"])), onCompositionstart: _cache[2] || (_cache[2] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)), onCompositionupdate: _cache[3] || (_cache[3] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)), onCompositionend: _cache[4] || (_cache[4] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)), onKeydown: [ _cache[5] || (_cache[5] = withKeys(withModifiers(($event) => _ctx.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"])), _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => _ctx.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"])), _cache[7] || (_cache[7] = withKeys(withModifiers((...args) => _ctx.onKeyboardSelect && _ctx.onKeyboardSelect(...args), ["stop", "prevent"]), ["enter"])), _cache[8] || (_cache[8] = withKeys(withModifiers((...args) => _ctx.handleEsc && _ctx.handleEsc(...args), ["stop", "prevent"]), ["esc"])), _cache[9] || (_cache[9] = withKeys(withModifiers((...args) => _ctx.handleDel && _ctx.handleDel(...args), ["stop"]), ["delete"])) ], onClick: _cache[10] || (_cache[10] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"])) }, null, 46, _hoisted_1$l), _ctx.filterable ? (openBlock(), createElementBlock("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: normalizeClass(_ctx.nsSelect.e("input-calculator")), textContent: toDisplayString(_ctx.states.inputValue) }, null, 10, _hoisted_2$d)) : createCommentVNode("v-if", true)], 2), _ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([ _ctx.nsSelect.e("selected-item"), _ctx.nsSelect.e("placeholder"), _ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue) ]) }, [_ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", { key: 0, index: ((_a = _ctx.allOptionsValueMap.get(_ctx.modelValue)) == null ? void 0 : _a.index) ?? -1, label: _ctx.currentPlaceholder, value: _ctx.modelValue }, () => [createBaseVNode("span", null, toDisplayString(_ctx.currentPlaceholder), 1)]) : (openBlock(), createElementBlock("span", _hoisted_3$5, toDisplayString(_ctx.currentPlaceholder), 1))], 2)) : createCommentVNode("v-if", true) ], 2), createBaseVNode("div", { ref: "suffixRef", class: normalizeClass(_ctx.nsSelect.e("suffix")) }, [ _ctx.iconComponent ? withDirectives((openBlock(), createBlock(_component_el_icon, { key: 0, class: normalizeClass([ _ctx.nsSelect.e("caret"), _ctx.nsInput.e("icon"), _ctx.iconReverse ]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))]), _: 1 }, 8, ["class"])), [[vShow, !_ctx.showClearBtn]]) : createCommentVNode("v-if", true), _ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, { key: 1, class: normalizeClass([ _ctx.nsSelect.e("caret"), _ctx.nsInput.e("icon"), _ctx.nsSelect.e("clear") ]), onClick: withModifiers(_ctx.handleClear, ["prevent", "stop"]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), _ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, { key: 2, class: normalizeClass([ _ctx.nsInput.e("icon"), _ctx.nsInput.e("validateIcon"), _ctx.nsInput.is("loading", _ctx.validateState === "validating") ]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)]; }), content: withCtx(() => [createVNode(_component_el_select_menu, { id: _ctx.contentId, ref: "menuRef", data: _ctx.filteredOptions, width: _ctx.popperSize - _ctx.BORDER_HORIZONTAL_WIDTH, "hovering-index": _ctx.states.hoveringIndex, "scrollbar-always-on": _ctx.scrollbarAlwaysOn, "aria-label": _ctx.ariaLabel }, createSlots({ default: withCtx((scope) => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)))]), _: 2 }, [ _ctx.$slots.header ? { name: "header", fn: withCtx(() => [createBaseVNode("div", { class: normalizeClass(_ctx.nsSelect.be("dropdown", "header")), onClick: _cache[12] || (_cache[12] = withModifiers(() => { }, ["stop"])) }, [renderSlot(_ctx.$slots, "header")], 2)]), key: "0" } : void 0, _ctx.$slots.loading && _ctx.loading ? { name: "loading", fn: withCtx(() => [createBaseVNode("div", { class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading")) }, [renderSlot(_ctx.$slots, "loading")], 2)]), key: "1" } : _ctx.loading || _ctx.filteredOptions.length === 0 ? { name: "empty", fn: withCtx(() => [createBaseVNode("div", { class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createBaseVNode("span", null, toDisplayString(_ctx.emptyText), 1)])], 2)]), key: "2" } : void 0, _ctx.$slots.footer ? { name: "footer", fn: withCtx(() => [createBaseVNode("div", { class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer")), onClick: _cache[13] || (_cache[13] = withModifiers(() => { }, ["stop"])) }, [renderSlot(_ctx.$slots, "footer")], 2)]), key: "3" } : void 0 ]), 1032, [ "id", "data", "width", "hovering-index", "scrollbar-always-on", "aria-label" ])]), _: 3 }, 8, [ "visible", "teleported", "popper-class", "popper-style", "popper-options", "fallback-placements", "effect", "placement", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow" ])], 34)), [[ _directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef ]]); } var select_default = /* @__PURE__ */ _plugin_vue_export_helper_default(select_vue_vue_type_script_lang_default, [["render", _sfc_render$5]]); const ElSelectV2 = withInstall(select_default); const skeletonProps = buildProps({ animated: Boolean, count: { type: Number, default: 1 }, rows: { type: Number, default: 3 }, loading: { type: Boolean, default: true }, throttle: { type: definePropType([Number, Object]) } }); const skeletonItemProps = buildProps({ variant: { type: String, values: [ "circle", "rect", "h1", "h3", "text", "caption", "p", "image", "button" ], default: "text" } }); var skeleton_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElSkeletonItem", __name: "skeleton-item", props: skeletonItemProps, setup(__props) { const ns = useNamespace("skeleton"); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).e("item"), unref(ns).e(__props.variant)]) }, [__props.variant === "image" ? (openBlock(), createBlock(unref(picture_filled_default), { key: 0 })) : createCommentVNode("v-if", true)], 2); }; } }); var skeleton_item_default = skeleton_item_vue_vue_type_script_setup_true_lang_default; var skeleton_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElSkeleton", __name: "skeleton", props: skeletonProps, setup(__props, { expose: __expose }) { const props2 = __props; const ns = useNamespace("skeleton"); const uiLoading = useThrottleRender(toRef(props2, "loading"), props2.throttle); __expose({ uiLoading }); return (_ctx, _cache) => { return unref(uiLoading) ? (openBlock(), createElementBlock("div", mergeProps({ key: 0, class: [unref(ns).b(), unref(ns).is("animated", __props.animated)] }, _ctx.$attrs), [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.count, (i) => { return openBlock(), createElementBlock(Fragment, { key: i }, [unref(uiLoading) ? renderSlot(_ctx.$slots, "template", { key: i }, () => [createVNode(skeleton_item_default, { class: normalizeClass(unref(ns).is("first")), variant: "p" }, null, 8, ["class"]), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.rows, (item) => { return openBlock(), createBlock(skeleton_item_default, { key: item, class: normalizeClass([unref(ns).e("paragraph"), unref(ns).is("last", item === __props.rows && __props.rows > 1)]), variant: "p" }, null, 8, ["class"]); }), 128))]) : createCommentVNode("v-if", true)], 64); }), 128))], 16)) : renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs))); }; } }); var skeleton_default = skeleton_vue_vue_type_script_setup_true_lang_default; const ElSkeleton = withInstall(skeleton_default, { SkeletonItem: skeleton_item_default }); const ElSkeletonItem = withNoopInstall(skeleton_item_default); const sliderContextKey = Symbol("sliderContextKey"); const sliderProps = buildProps({ modelValue: { type: definePropType([Number, Array]), default: 0 }, id: { type: String, default: void 0 }, min: { type: Number, default: 0 }, max: { type: Number, default: 100 }, step: { type: definePropType([Number, String]), default: 1 }, showInput: Boolean, showInputControls: { type: Boolean, default: true }, size: useSizeProp, inputSize: useSizeProp, showStops: Boolean, showTooltip: { type: Boolean, default: true }, formatTooltip: { type: definePropType(Function), default: void 0 }, disabled: { type: Boolean, default: void 0 }, range: Boolean, vertical: Boolean, height: String, rangeStartLabel: { type: String, default: void 0 }, rangeEndLabel: { type: String, default: void 0 }, formatValueText: { type: definePropType(Function), default: void 0 }, tooltipClass: { type: String, default: void 0 }, placement: { type: String, values: Ee, default: "top" }, marks: { type: definePropType(Object) }, validateEvent: { type: Boolean, default: true }, persistent: { type: Boolean, default: true }, ...useAriaProps(["ariaLabel"]) }); const isValidValue$1 = (value) => isNumber(value) || isArray(value) && value.every(isNumber); const sliderEmits = { [UPDATE_MODEL_EVENT]: isValidValue$1, [INPUT_EVENT]: isValidValue$1, [CHANGE_EVENT]: isValidValue$1 }; const useLifecycle = (props2, initData, resetSize) => { const sliderWrapper = ref(); onMounted(async () => { if (props2.range) { if (isArray(props2.modelValue)) { initData.firstValue = Math.max(props2.min, props2.modelValue[0]); initData.secondValue = Math.min(props2.max, props2.modelValue[1]); } else { initData.firstValue = props2.min; initData.secondValue = props2.max; } initData.oldValue = [initData.firstValue, initData.secondValue]; } else { if (!isNumber(props2.modelValue) || Number.isNaN(props2.modelValue)) initData.firstValue = props2.min; else initData.firstValue = Math.min(props2.max, Math.max(props2.min, props2.modelValue)); initData.oldValue = initData.firstValue; } useEventListener(window, "resize", resetSize); await nextTick(); resetSize(); }); return { sliderWrapper }; }; const useMarks = (props2) => { const markList = computed(() => { if (!props2.marks) return []; return Object.keys(props2.marks).map(Number.parseFloat).sort((a, b) => a - b).filter((point) => point <= props2.max && point >= props2.min).map((point) => ({ point, position: (point - props2.min) * 100 / (props2.max - props2.min), mark: props2.marks[point] })); }); watchEffect(() => { if (props2.step === "mark" && !props2.marks) debugWarn("ElSlider", "marks prop must be provided when step is mark"); if (props2.marks) { const keys = Object.keys(props2.marks); const validPoints = markList.value.map((m) => m.point); const invalidKeys = keys.filter((key) => { const parsed = Number.parseFloat(key); return Number.isNaN(parsed) || !validPoints.includes(parsed); }); if (invalidKeys.length > 0) debugWarn("ElSlider", `Some marks keys are invalid (not a number or out of [min, max]): [${invalidKeys.map((k) => `'${k}'`).join(", ")}] and will be ignored.`); } }); return markList; }; const useSlide = (props2, initData, emit) => { const { formItem: elFormItem } = useFormItem(); const slider = shallowRef(); const firstButton = ref(); const secondButton = ref(); const buttonRefs = { firstButton, secondButton }; const sliderDisabled = useFormDisabled(); const minValue2 = computed(() => { return Math.min(initData.firstValue, initData.secondValue); }); const maxValue2 = computed(() => { return Math.max(initData.firstValue, initData.secondValue); }); const barSize = computed(() => { return props2.range ? `${100 * (maxValue2.value - minValue2.value) / (props2.max - props2.min)}%` : `${100 * (initData.firstValue - props2.min) / (props2.max - props2.min)}%`; }); const barStart = computed(() => { return props2.range ? `${100 * (minValue2.value - props2.min) / (props2.max - props2.min)}%` : "0%"; }); const runwayStyle = computed(() => { return props2.vertical ? { height: props2.height } : {}; }); const barStyle = computed(() => { return props2.vertical ? { height: barSize.value, bottom: barStart.value } : { width: barSize.value, left: barStart.value }; }); const resetSize = () => { if (slider.value) initData.sliderSize = slider.value.getBoundingClientRect()[props2.vertical ? "height" : "width"]; }; const getButtonRefByPercent = (percent) => { const targetValue = props2.min + percent * (props2.max - props2.min) / 100; if (!props2.range) return firstButton; let buttonRefName; if (Math.abs(minValue2.value - targetValue) < Math.abs(maxValue2.value - targetValue)) buttonRefName = initData.firstValue < initData.secondValue ? "firstButton" : "secondButton"; else buttonRefName = initData.firstValue > initData.secondValue ? "firstButton" : "secondButton"; return buttonRefs[buttonRefName]; }; const setPosition = (percent) => { const buttonRef = getButtonRefByPercent(percent); buttonRef.value.setPosition(percent); return buttonRef; }; const setFirstValue = (firstValue) => { initData.firstValue = firstValue ?? props2.min; _emit(props2.range ? [minValue2.value, maxValue2.value] : firstValue ?? props2.min); }; const setSecondValue = (secondValue) => { initData.secondValue = secondValue; if (props2.range) _emit([minValue2.value, maxValue2.value]); }; const _emit = (val) => { emit(UPDATE_MODEL_EVENT, val); emit(INPUT_EVENT, val); }; const emitChange = async () => { await nextTick(); emit(CHANGE_EVENT, props2.range ? [minValue2.value, maxValue2.value] : props2.modelValue); }; const handleSliderPointerEvent = (event) => { var _a, _b, _c, _d; if (sliderDisabled.value || initData.dragging) return; resetSize(); let newPercent = 0; if (props2.vertical) { const clientY = ((_b = (_a = event.touches) == null ? void 0 : _a.item(0)) == null ? void 0 : _b.clientY) ?? event.clientY; newPercent = (slider.value.getBoundingClientRect().bottom - clientY) / initData.sliderSize * 100; } else newPercent = ((((_d = (_c = event.touches) == null ? void 0 : _c.item(0)) == null ? void 0 : _d.clientX) ?? event.clientX) - slider.value.getBoundingClientRect().left) / initData.sliderSize * 100; if (newPercent < 0 || newPercent > 100) return; return setPosition(newPercent); }; const onSliderWrapperPrevent = (event) => { var _a, _b; if (((_a = buttonRefs["firstButton"].value) == null ? void 0 : _a.dragging) || ((_b = buttonRefs["secondButton"].value) == null ? void 0 : _b.dragging)) event.preventDefault(); }; const onSliderDown = async (event) => { const buttonRef = handleSliderPointerEvent(event); if (buttonRef) { await nextTick(); buttonRef.value.onButtonDown(event); } }; const onSliderClick = (event) => { if (handleSliderPointerEvent(event)) emitChange(); }; const onSliderMarkerDown = (position) => { if (sliderDisabled.value || initData.dragging) return; if (setPosition(position)) emitChange(); }; return { elFormItem, slider, firstButton, secondButton, sliderDisabled, minValue: minValue2, maxValue: maxValue2, runwayStyle, barStyle, resetSize, setPosition, emitChange, onSliderWrapperPrevent, onSliderClick, onSliderDown, onSliderMarkerDown, setFirstValue, setSecondValue }; }; const useStops = (props2, initData, minValue2, maxValue2) => { const stops = computed(() => { if (!props2.showStops || props2.min > props2.max) return []; if (props2.step === "mark" || props2.step === 0) { if (props2.step === 0) debugWarn("ElSlider", "step should not be 0."); return []; } const stopCount = Math.ceil((props2.max - props2.min) / props2.step); const stepWidth = 100 * props2.step / (props2.max - props2.min); const result = Array.from({ length: stopCount - 1 }).map((_, index) => (index + 1) * stepWidth); if (props2.range) return result.filter((step2) => { return step2 < 100 * (minValue2.value - props2.min) / (props2.max - props2.min) || step2 > 100 * (maxValue2.value - props2.min) / (props2.max - props2.min); }); else return result.filter((step2) => step2 > 100 * (initData.firstValue - props2.min) / (props2.max - props2.min)); }); const getStopStyle = (position) => { return props2.vertical ? { bottom: `${position}%` } : { left: `${position}%` }; }; return { stops, getStopStyle }; }; const useWatch = (props2, initData, minValue2, maxValue2, emit, elFormItem) => { const _emit = (val) => { emit(UPDATE_MODEL_EVENT, val); emit(INPUT_EVENT, val); }; const valueChanged = () => { if (props2.range) return ![minValue2.value, maxValue2.value].every((item, index) => item === initData.oldValue[index]); else return props2.modelValue !== initData.oldValue; }; const setValues = () => { var _a, _b; if (props2.min > props2.max) throwError("Slider", "min should not be greater than max."); const val = props2.modelValue; if (props2.range && isArray(val)) if (val[1] < props2.min) _emit([props2.min, props2.min]); else if (val[0] > props2.max) _emit([props2.max, props2.max]); else if (val[0] < props2.min) _emit([props2.min, val[1]]); else if (val[1] > props2.max) _emit([val[0], props2.max]); else { initData.firstValue = val[0]; initData.secondValue = val[1]; if (valueChanged()) { if (props2.validateEvent) (_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn(err)); initData.oldValue = val.slice(); } } else if (!props2.range && isNumber(val) && !Number.isNaN(val)) if (val < props2.min) _emit(props2.min); else if (val > props2.max) _emit(props2.max); else { initData.firstValue = val; if (valueChanged()) { if (props2.validateEvent) (_b = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _b.call(elFormItem, "change").catch((err) => debugWarn(err)); initData.oldValue = val; } } }; setValues(); watch(() => initData.dragging, (val) => { if (!val) setValues(); }); watch(() => props2.modelValue, (val, oldVal) => { if (initData.dragging || isArray(val) && isArray(oldVal) && val.every((item, index) => item === oldVal[index]) && initData.firstValue === val[0] && initData.secondValue === val[1]) return; setValues(); }, { deep: true }); watch(() => [props2.min, props2.max], () => { setValues(); }); }; const useTooltip = (props2, formatTooltip, showTooltip) => { const tooltip = ref(); const tooltipVisible = ref(false); const enableFormat = computed(() => { return formatTooltip.value instanceof Function; }); return { tooltip, tooltipVisible, formatValue: computed(() => { return enableFormat.value && formatTooltip.value(props2.modelValue) || props2.modelValue; }), displayTooltip: debounce(() => { showTooltip.value && (tooltipVisible.value = true); }, 50), hideTooltip: debounce(() => { showTooltip.value && (tooltipVisible.value = false); }, 50) }; }; const useSliderButton = (props2, initData, emit) => { const { disabled, min: min2, max: max2, step: step2, showTooltip, persistent, precision, sliderSize, formatTooltip, emitChange, resetSize, updateDragging, markList } = inject(sliderContextKey); const { tooltip, tooltipVisible, formatValue, displayTooltip, hideTooltip } = useTooltip(props2, formatTooltip, showTooltip); const button = ref(); const currentPosition = computed(() => { return `${(props2.modelValue - min2.value) / (max2.value - min2.value) * 100}%`; }); const wrapperStyle = computed(() => { return props2.vertical ? { bottom: currentPosition.value } : { left: currentPosition.value }; }); const shouldMoveToMark = computed(() => { return step2.value === "mark" && markList.value.length > 0; }); const handleMouseEnter = () => { initData.hovering = true; displayTooltip(); }; const handleMouseLeave = () => { initData.hovering = false; if (!initData.dragging) hideTooltip(); }; const onButtonDown = (event) => { if (disabled.value) return; event.preventDefault(); onDragStart(event); window.addEventListener("mousemove", onDragging); window.addEventListener("touchmove", onDragging); window.addEventListener("mouseup", onDragEnd); window.addEventListener("touchend", onDragEnd); window.addEventListener("contextmenu", onDragEnd); button.value.focus(); }; const incrementPosition = (amount) => { if (disabled.value) return; initData.newPosition = Number.parseFloat(currentPosition.value) + amount / (max2.value - min2.value) * 100; setPosition(initData.newPosition); emitChange(); }; const moveToMark = (amount) => { if (disabled.value || !markList.value.length) return; const current = props2.modelValue; const epsilon = Number.EPSILON; const stride = Math.abs(amount); let target; if (amount > 0) { const startIndex = markList.value.findIndex((m) => m.point > current + epsilon); if (startIndex !== -1) { const targetIndex = Math.min(startIndex + stride - 1, markList.value.length - 1); target = markList.value[targetIndex].point; } } else { let startIndex = -1; for (let i = markList.value.length - 1; i >= 0; i--) if (markList.value[i].point < current - epsilon) { startIndex = i; break; } if (startIndex !== -1) { const targetIndex = Math.max(startIndex - (stride - 1), 0); target = markList.value[targetIndex].point; } } if (target !== void 0 && target !== current) { setPosition((target - min2.value) / (max2.value - min2.value) * 100); emitChange(); } }; const onLeftKeyDown = () => { if (shouldMoveToMark.value) moveToMark(-1); else if (isNumber(step2.value)) incrementPosition(-step2.value); }; const onRightKeyDown = () => { if (shouldMoveToMark.value) moveToMark(1); else if (isNumber(step2.value)) incrementPosition(step2.value); }; const onPageDownKeyDown = () => { if (shouldMoveToMark.value) moveToMark(-4); else if (isNumber(step2.value)) incrementPosition(-step2.value * 4); }; const onPageUpKeyDown = () => { if (shouldMoveToMark.value) moveToMark(4); else if (isNumber(step2.value)) incrementPosition(step2.value * 4); }; const onHomeKeyDown = () => { if (disabled.value) return; setPosition(0); emitChange(); }; const onEndKeyDown = () => { if (disabled.value) return; setPosition(100); emitChange(); }; const onKeyDown = (event) => { const code = getEventCode(event); let isPreventDefault = true; switch (code) { case EVENT_CODE.left: case EVENT_CODE.down: onLeftKeyDown(); break; case EVENT_CODE.right: case EVENT_CODE.up: onRightKeyDown(); break; case EVENT_CODE.home: onHomeKeyDown(); break; case EVENT_CODE.end: onEndKeyDown(); break; case EVENT_CODE.pageDown: onPageDownKeyDown(); break; case EVENT_CODE.pageUp: onPageUpKeyDown(); break; default: isPreventDefault = false; break; } isPreventDefault && event.preventDefault(); }; const getClientXY2 = (event) => { let clientX; let clientY; if (event.type.startsWith("touch")) { clientY = event.touches[0].clientY; clientX = event.touches[0].clientX; } else { clientY = event.clientY; clientX = event.clientX; } return { clientX, clientY }; }; const onDragStart = (event) => { initData.dragging = true; initData.isClick = true; const { clientX, clientY } = getClientXY2(event); if (props2.vertical) initData.startY = clientY; else initData.startX = clientX; initData.startPosition = Number.parseFloat(currentPosition.value); initData.newPosition = initData.startPosition; }; const onDragging = (event) => { if (initData.dragging) { initData.isClick = false; displayTooltip(); resetSize(); let diff; const { clientX, clientY } = getClientXY2(event); if (props2.vertical) { initData.currentY = clientY; diff = (initData.startY - initData.currentY) / sliderSize.value * 100; } else { initData.currentX = clientX; diff = (initData.currentX - initData.startX) / sliderSize.value * 100; } initData.newPosition = initData.startPosition + diff; setPosition(initData.newPosition); } }; const onDragEnd = () => { if (initData.dragging) { setTimeout(() => { initData.dragging = false; if (!initData.hovering) hideTooltip(); if (!initData.isClick) setPosition(initData.newPosition); emitChange(); }, 0); window.removeEventListener("mousemove", onDragging); window.removeEventListener("touchmove", onDragging); window.removeEventListener("mouseup", onDragEnd); window.removeEventListener("touchend", onDragEnd); window.removeEventListener("contextmenu", onDragEnd); } }; const setPosition = async (newPosition) => { if (newPosition === null || Number.isNaN(+newPosition)) return; newPosition = clamp(newPosition, 0, 100); let value; if (step2.value === "mark") if (markList.value.length === 0) value = newPosition <= 50 ? min2.value : max2.value; else value = markList.value.reduce((prev, curr) => { return Math.abs(curr.position - newPosition) < Math.abs(prev.position - newPosition) ? curr : prev; }).point; else { const fullSteps = Math.floor((max2.value - min2.value) / step2.value); const fullRangePercentage = fullSteps * step2.value / (max2.value - min2.value) * 100; const threshold = fullRangePercentage + (100 - fullRangePercentage) / 2; if (newPosition < fullRangePercentage) { const valueBetween = fullRangePercentage / fullSteps; const steps = Math.round(newPosition / valueBetween); value = min2.value + steps * step2.value; } else if (newPosition < threshold) value = min2.value + fullSteps * step2.value; else value = max2.value; value = Number.parseFloat(value.toFixed(precision.value)); } if (value !== props2.modelValue) emit(UPDATE_MODEL_EVENT, value); if (!initData.dragging && props2.modelValue !== initData.oldValue) initData.oldValue = props2.modelValue; await nextTick(); initData.dragging && displayTooltip(); tooltip.value.updatePopper(); }; watch(() => initData.dragging, (val) => { updateDragging(val); }); useEventListener(button, "touchstart", onButtonDown, { passive: false }); return { disabled, button, tooltip, tooltipVisible, showTooltip, persistent, wrapperStyle, formatValue, handleMouseEnter, handleMouseLeave, onButtonDown, onKeyDown, setPosition }; }; const sliderButtonProps = buildProps({ modelValue: { type: Number, default: 0 }, vertical: Boolean, tooltipClass: String, placement: { type: String, values: Ee, default: "top" } }); const sliderButtonEmits = { [UPDATE_MODEL_EVENT]: (value) => isNumber(value) }; const _hoisted_1$k = ["tabindex"]; var button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElSliderButton", __name: "button", props: sliderButtonProps, emits: sliderButtonEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("slider"); const initData = reactive({ hovering: false, dragging: false, isClick: false, startX: 0, currentX: 0, startY: 0, currentY: 0, startPosition: 0, newPosition: 0, oldValue: props2.modelValue }); const tooltipPersistent = computed(() => !showTooltip.value ? false : persistent.value); const { disabled, button, tooltip, showTooltip, persistent, tooltipVisible, wrapperStyle, formatValue, handleMouseEnter, handleMouseLeave, onButtonDown, onKeyDown, setPosition } = useSliderButton(props2, initData, emit); const { hovering, dragging } = toRefs(initData); __expose({ onButtonDown, onKeyDown, setPosition, hovering, dragging }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "button", ref: button, class: normalizeClass([unref(ns).e("button-wrapper"), { hover: unref(hovering), dragging: unref(dragging) }]), style: normalizeStyle(unref(wrapperStyle)), tabindex: unref(disabled) ? void 0 : 0, onMouseenter: _cache[0] || (_cache[0] = (...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)), onMouseleave: _cache[1] || (_cache[1] = (...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)), onMousedown: _cache[2] || (_cache[2] = (...args) => unref(onButtonDown) && unref(onButtonDown)(...args)), onFocus: _cache[3] || (_cache[3] = (...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)), onBlur: _cache[4] || (_cache[4] = (...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)), onKeydown: _cache[5] || (_cache[5] = (...args) => unref(onKeyDown) && unref(onKeyDown)(...args)) }, [createVNode(unref(ElTooltip), { ref_key: "tooltip", ref: tooltip, visible: unref(tooltipVisible), placement: _ctx.placement, "fallback-placements": [ "top", "bottom", "right", "left" ], "stop-popper-mouse-event": false, "popper-class": _ctx.tooltipClass, disabled: !unref(showTooltip), persistent: tooltipPersistent.value }, { content: withCtx(() => [createBaseVNode("span", null, toDisplayString(unref(formatValue)), 1)]), default: withCtx(() => [createBaseVNode("div", { class: normalizeClass([unref(ns).e("button"), { hover: unref(hovering), dragging: unref(dragging) }]) }, null, 2)]), _: 1 }, 8, [ "visible", "placement", "popper-class", "disabled", "persistent" ])], 46, _hoisted_1$k); }; } }); var button_default = button_vue_vue_type_script_setup_true_lang_default; const sliderMarkerProps = buildProps({ mark: { type: definePropType([String, Object]), default: void 0 } }); var marker_default = defineComponent({ name: "ElSliderMarker", props: sliderMarkerProps, setup(props2) { const ns = useNamespace("slider"); const label = computed(() => { return isString(props2.mark) ? props2.mark : props2.mark.label; }); const style = computed(() => isString(props2.mark) ? void 0 : props2.mark.style); return () => h("div", { class: ns.e("marks-text"), style: style.value }, label.value); } }); const _hoisted_1$j = [ "id", "role", "aria-label", "aria-labelledby" ]; const _hoisted_2$c = { key: 1 }; var slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElSlider", __name: "slider", props: sliderProps, emits: sliderEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("slider"); const { t } = useLocale(); const initData = reactive({ firstValue: 0, secondValue: 0, oldValue: 0, dragging: false, sliderSize: 1 }); const { elFormItem, slider, firstButton, secondButton, sliderDisabled, minValue: minValue2, maxValue: maxValue2, runwayStyle, barStyle, resetSize, emitChange, onSliderWrapperPrevent, onSliderClick, onSliderDown, onSliderMarkerDown, setFirstValue, setSecondValue } = useSlide(props2, initData, emit); const { stops, getStopStyle } = useStops(props2, initData, minValue2, maxValue2); const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, { formItemContext: elFormItem }); const sliderWrapperSize = useFormSize(); const sliderInputSize = computed(() => props2.inputSize || sliderWrapperSize.value); const renderInput = computed(() => { return props2.showInput && !props2.range && props2.step !== "mark"; }); const groupLabel = computed(() => { return props2.ariaLabel || t("el.slider.defaultLabel", { min: props2.min, max: props2.max }); }); const firstButtonLabel = computed(() => { if (props2.range) return props2.rangeStartLabel || t("el.slider.defaultRangeStartLabel"); else return groupLabel.value; }); const firstValueText = computed(() => { return props2.formatValueText ? props2.formatValueText(firstValue.value) : `${firstValue.value}`; }); const secondButtonLabel = computed(() => { return props2.rangeEndLabel || t("el.slider.defaultRangeEndLabel"); }); const secondValueText = computed(() => { return props2.formatValueText ? props2.formatValueText(secondValue.value) : `${secondValue.value}`; }); const sliderKls = computed(() => [ ns.b(), ns.m(sliderWrapperSize.value), ns.is("vertical", props2.vertical), { [ns.m("with-input")]: renderInput.value } ]); const markList = useMarks(props2); useWatch(props2, initData, minValue2, maxValue2, emit, elFormItem); const sliderInputStep = computed(() => { return isNumber(props2.step) ? props2.step : 1; }); const precision = computed(() => { const stepValue = isNumber(props2.step) ? props2.step : 1; const precisions = [ props2.min, props2.max, stepValue ].map((item) => { const decimal = `${item}`.split(".")[1]; return decimal ? decimal.length : 0; }); return Math.max.apply(null, precisions); }); const { sliderWrapper } = useLifecycle(props2, initData, resetSize); const { firstValue, secondValue, sliderSize } = toRefs(initData); const updateDragging = (val) => { initData.dragging = val; }; useEventListener(sliderWrapper, "touchstart", onSliderWrapperPrevent, { passive: false }); useEventListener(sliderWrapper, "touchmove", onSliderWrapperPrevent, { passive: false }); provide(sliderContextKey, { ...toRefs(props2), sliderSize, disabled: sliderDisabled, precision, markList, emitChange, resetSize, updateDragging }); __expose({ onSliderClick }); return (_ctx, _cache) => { var _a, _b; return openBlock(), createElementBlock("div", { id: _ctx.range ? unref(inputId) : void 0, ref_key: "sliderWrapper", ref: sliderWrapper, class: normalizeClass(sliderKls.value), role: _ctx.range ? "group" : void 0, "aria-label": _ctx.range && !unref(isLabeledByFormItem) ? groupLabel.value : void 0, "aria-labelledby": _ctx.range && unref(isLabeledByFormItem) ? (_a = unref(elFormItem)) == null ? void 0 : _a.labelId : void 0 }, [createBaseVNode("div", { ref_key: "slider", ref: slider, class: normalizeClass([ unref(ns).e("runway"), { "show-input": renderInput.value }, unref(ns).is("disabled", unref(sliderDisabled)) ]), style: normalizeStyle(unref(runwayStyle)), onMousedown: _cache[0] || (_cache[0] = (...args) => unref(onSliderDown) && unref(onSliderDown)(...args)), onTouchstartPassive: _cache[1] || (_cache[1] = (...args) => unref(onSliderDown) && unref(onSliderDown)(...args)) }, [ createBaseVNode("div", { class: normalizeClass(unref(ns).e("bar")), style: normalizeStyle(unref(barStyle)) }, null, 6), createVNode(button_default, { id: !_ctx.range ? unref(inputId) : void 0, ref_key: "firstButton", ref: firstButton, "model-value": unref(firstValue), vertical: _ctx.vertical, "tooltip-class": _ctx.tooltipClass, placement: _ctx.placement, role: "slider", "aria-label": _ctx.range || !unref(isLabeledByFormItem) ? firstButtonLabel.value : void 0, "aria-labelledby": !_ctx.range && unref(isLabeledByFormItem) ? (_b = unref(elFormItem)) == null ? void 0 : _b.labelId : void 0, "aria-valuemin": _ctx.min, "aria-valuemax": _ctx.range ? unref(secondValue) : _ctx.max, "aria-valuenow": unref(firstValue), "aria-valuetext": firstValueText.value, "aria-orientation": _ctx.vertical ? "vertical" : "horizontal", "aria-disabled": unref(sliderDisabled), "onUpdate:modelValue": unref(setFirstValue) }, null, 8, [ "id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue" ]), _ctx.range ? (openBlock(), createBlock(button_default, { key: 0, ref_key: "secondButton", ref: secondButton, "model-value": unref(secondValue), vertical: _ctx.vertical, "tooltip-class": _ctx.tooltipClass, placement: _ctx.placement, role: "slider", "aria-label": secondButtonLabel.value, "aria-valuemin": unref(firstValue), "aria-valuemax": _ctx.max, "aria-valuenow": unref(secondValue), "aria-valuetext": secondValueText.value, "aria-orientation": _ctx.vertical ? "vertical" : "horizontal", "aria-disabled": unref(sliderDisabled), "onUpdate:modelValue": unref(setSecondValue) }, null, 8, [ "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue" ])) : createCommentVNode("v-if", true), _ctx.showStops ? (openBlock(), createElementBlock("div", _hoisted_2$c, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(stops), (item, key) => { return openBlock(), createElementBlock("div", { key, class: normalizeClass(unref(ns).e("stop")), style: normalizeStyle(unref(getStopStyle)(item)) }, null, 6); }), 128))])) : createCommentVNode("v-if", true), unref(markList).length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createBaseVNode("div", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(markList), (item, key) => { return openBlock(), createElementBlock("div", { key, style: normalizeStyle(unref(getStopStyle)(item.position)), class: normalizeClass([unref(ns).e("stop"), unref(ns).e("marks-stop")]) }, null, 6); }), 128))]), createBaseVNode("div", { class: normalizeClass(unref(ns).e("marks")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(markList), (item, key) => { return openBlock(), createBlock(unref(marker_default), { key, mark: item.mark, style: normalizeStyle(unref(getStopStyle)(item.position)), onMousedown: withModifiers(($event) => unref(onSliderMarkerDown)(item.position), ["stop"]) }, null, 8, [ "mark", "style", "onMousedown" ]); }), 128))], 2)], 64)) : createCommentVNode("v-if", true) ], 38), renderInput.value ? (openBlock(), createBlock(unref(ElInputNumber), { key: 0, ref: "input", "model-value": unref(firstValue), class: normalizeClass(unref(ns).e("input")), step: sliderInputStep.value, disabled: unref(sliderDisabled), controls: _ctx.showInputControls, min: _ctx.min, max: _ctx.max, precision: precision.value, size: sliderInputSize.value, "onUpdate:modelValue": unref(setFirstValue), onChange: unref(emitChange) }, null, 8, [ "model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "size", "onUpdate:modelValue", "onChange" ])) : createCommentVNode("v-if", true)], 10, _hoisted_1$j); }; } }); var slider_default = slider_vue_vue_type_script_setup_true_lang_default; const ElSlider = withInstall(slider_default); const spaceItemProps = buildProps({ prefixCls: { type: String } }); const SpaceItem = defineComponent({ name: "ElSpaceItem", props: spaceItemProps, setup(props2, { slots }) { const ns = useNamespace("space"); const classes = computed(() => `${props2.prefixCls || ns.b()}__item`); return () => h("div", { class: classes.value }, renderSlot(slots, "default")); } }); const SIZE_MAP = { small: 8, default: 12, large: 16 }; function useSpace(props2) { const ns = useNamespace("space"); const classes = computed(() => [ ns.b(), ns.m(props2.direction), props2.class ]); const horizontalSize = ref(0); const verticalSize = ref(0); const containerStyle = computed(() => { return [ props2.wrap || props2.fill ? { flexWrap: "wrap" } : {}, { alignItems: props2.alignment }, { rowGap: `${verticalSize.value}px`, columnGap: `${horizontalSize.value}px` }, props2.style ]; }); const itemStyle = computed(() => { return props2.fill ? { flexGrow: 1, minWidth: `${props2.fillRatio}%` } : {}; }); watchEffect(() => { const { size = "small", wrap, direction: dir, fill } = props2; if (isArray(size)) { const [h2 = 0, v = 0] = size; horizontalSize.value = h2; verticalSize.value = v; } else { let val; if (isNumber(size)) val = size; else val = SIZE_MAP[size || "small"] || SIZE_MAP.small; if ((wrap || fill) && dir === "horizontal") horizontalSize.value = verticalSize.value = val; else if (dir === "horizontal") { horizontalSize.value = val; verticalSize.value = 0; } else { verticalSize.value = val; horizontalSize.value = 0; } } }); return { classes, containerStyle, itemStyle }; } const spaceProps = buildProps({ direction: { type: String, values: ["horizontal", "vertical"], default: "horizontal" }, class: { type: definePropType([ String, Object, Array ]), default: "" }, style: { type: definePropType([ String, Array, Object ]), default: "" }, alignment: { type: definePropType(String), default: "center" }, prefixCls: { type: String }, spacer: { type: definePropType([ Object, String, Number, Array ]), default: null, validator: (val) => isVNode(val) || isNumber(val) || isString(val) }, wrap: Boolean, fill: Boolean, fillRatio: { type: Number, default: 100 }, size: { type: [ String, Array, Number ], values: componentSizes, validator: (val) => { return isNumber(val) || isArray(val) && val.length === 2 && val.every(isNumber); } } }); const Space = defineComponent({ name: "ElSpace", props: spaceProps, setup(props2, { slots }) { const { classes, containerStyle, itemStyle } = useSpace(props2); function extractChildren(children, parentKey = "", extractedChildren = []) { const { prefixCls } = props2; children.forEach((child, loopKey) => { if (isFragment(child)) { if (isArray(child.children)) child.children.forEach((nested, key) => { if (isFragment(nested) && isArray(nested.children)) extractChildren(nested.children, `${parentKey + key}-`, extractedChildren); else if (isVNode(nested) && (nested == null ? void 0 : nested.type) === Comment) extractedChildren.push(nested); else extractedChildren.push(createVNode(SpaceItem, { style: itemStyle.value, prefixCls, key: `nested-${parentKey + key}` }, { default: () => [nested] }, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"])); }); } else if (isValidElementNode(child)) extractedChildren.push(createVNode(SpaceItem, { style: itemStyle.value, prefixCls, key: `LoopKey${parentKey + loopKey}` }, { default: () => [child] }, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"])); }); return extractedChildren; } return () => { const { spacer, direction: direction2 } = props2; const children = renderSlot(slots, "default", { key: 0 }, () => []); if ((children.children ?? []).length === 0) return null; if (isArray(children.children)) { let extractedChildren = extractChildren(children.children); if (spacer) { const len = extractedChildren.length - 1; extractedChildren = extractedChildren.reduce((acc, child, idx) => { const children2 = [...acc, child]; if (idx !== len) children2.push(createVNode("span", { style: [itemStyle.value, direction2 === "vertical" ? "width: 100%" : null], key: idx }, [isVNode(spacer) ? spacer : createTextVNode(spacer, PatchFlags.TEXT)], PatchFlags.STYLE)); return children2; }, []); } return createVNode("div", { class: classes.value, style: containerStyle.value }, extractedChildren, PatchFlags.STYLE | PatchFlags.CLASS); } return children.children; }; } }); const ElSpace = withInstall(Space); const statisticProps = buildProps({ decimalSeparator: { type: String, default: "." }, groupSeparator: { type: String, default: "," }, precision: { type: Number, default: 0 }, formatter: Function, value: { type: definePropType([Number, Object]), default: 0 }, prefix: String, suffix: String, title: String, valueStyle: { type: definePropType([ String, Object, Array ]) } }); var statistic_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElStatistic", __name: "statistic", props: statisticProps, setup(__props, { expose: __expose }) { const props2 = __props; const ns = useNamespace("statistic"); const displayValue = computed(() => { const { value, formatter: formatter2, precision, decimalSeparator, groupSeparator } = props2; if (isFunction(formatter2)) return formatter2(value); if (!isNumber(value) || Number.isNaN(value)) return value; let [integer, decimal = ""] = String(value).split("."); decimal = decimal.padEnd(precision, "0").slice(0, precision > 0 ? precision : 0); integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator); return [integer, decimal].join(decimal ? decimalSeparator : ""); }); __expose({ displayValue }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [_ctx.$slots.title || __props.title ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("head")) }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [ _ctx.$slots.prefix || __props.prefix ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("prefix")) }, [renderSlot(_ctx.$slots, "prefix", {}, () => [createBaseVNode("span", null, toDisplayString(__props.prefix), 1)])], 2)) : createCommentVNode("v-if", true), createBaseVNode("span", { class: normalizeClass(unref(ns).e("number")), style: normalizeStyle(__props.valueStyle) }, toDisplayString(displayValue.value), 7), _ctx.$slots.suffix || __props.suffix ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("suffix")) }, [renderSlot(_ctx.$slots, "suffix", {}, () => [createBaseVNode("span", null, toDisplayString(__props.suffix), 1)])], 2)) : createCommentVNode("v-if", true) ], 2)], 2); }; } }); var statistic_default = statistic_vue_vue_type_script_setup_true_lang_default; const ElStatistic = withInstall(statistic_default); const countdownProps = buildProps({ format: { type: String, default: "HH:mm:ss" }, prefix: String, suffix: String, title: String, value: { type: definePropType([Number, Object]), default: 0 }, valueStyle: { type: definePropType([ String, Object, Array ]) } }); const countdownEmits = { finish: () => true, [CHANGE_EVENT]: (value) => isNumber(value) }; const timeUnits = [ ["Y", 1e3 * 60 * 60 * 24 * 365], ["M", 1e3 * 60 * 60 * 24 * 30], ["D", 1e3 * 60 * 60 * 24], ["H", 1e3 * 60 * 60], ["m", 1e3 * 60], ["s", 1e3], ["S", 1] ]; const getTime = (value) => { return isNumber(value) ? new Date(value).getTime() : value.valueOf(); }; const formatTime$1 = (timestamp, format) => { let timeLeft = timestamp; return timeUnits.reduce((current, [name, unit2]) => { const replaceRegex = new RegExp(`${name}+(?![^\\[\\]]*\\])`, "g"); if (replaceRegex.test(current)) { const value = Math.floor(timeLeft / unit2); timeLeft -= value * unit2; return current.replace(replaceRegex, (match) => String(value).padStart(match.length, "0")); } return current; }, format).replace(/\[([^\]]*)]/g, "$1"); }; var countdown_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElCountdown", __name: "countdown", props: countdownProps, emits: countdownEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; let timer; const rawValue = ref(0); const displayValue = computed(() => formatTime$1(rawValue.value, props2.format)); const formatter2 = (val) => formatTime$1(val, props2.format); const stopTimer = () => { if (timer) { cAF(timer); timer = void 0; } }; const startTimer = () => { const timestamp = getTime(props2.value); const frameFunc = () => { let diff = timestamp - Date.now(); emit(CHANGE_EVENT, diff); if (diff <= 0) { diff = 0; stopTimer(); emit("finish"); } else timer = rAF(frameFunc); rawValue.value = diff; }; timer = rAF(frameFunc); }; onMounted(() => { rawValue.value = getTime(props2.value) - Date.now(); watch(() => [props2.value, props2.format], () => { stopTimer(); startTimer(); }, { immediate: true }); }); onBeforeUnmount(() => { stopTimer(); }); __expose({ displayValue }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElStatistic), { value: rawValue.value, title: __props.title, prefix: __props.prefix, suffix: __props.suffix, "value-style": __props.valueStyle, formatter: formatter2 }, createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, name) => { return { name, fn: withCtx(() => [renderSlot(_ctx.$slots, name)]) }; })]), 1032, [ "value", "title", "prefix", "suffix", "value-style" ]); }; } }); var countdown_default = countdown_vue_vue_type_script_setup_true_lang_default; const ElCountdown = withInstall(countdown_default); const stepsProps = buildProps({ space: { type: [Number, String], default: "" }, active: { type: Number, default: 0 }, direction: { type: String, default: "horizontal", values: ["horizontal", "vertical"] }, alignCenter: { type: Boolean }, simple: { type: Boolean }, finishStatus: { type: String, values: [ "wait", "process", "finish", "error", "success" ], default: "finish" }, processStatus: { type: String, values: [ "wait", "process", "finish", "error", "success" ], default: "process" } }); const stepsEmits = { [CHANGE_EVENT]: (newVal, oldVal) => [newVal, oldVal].every(isNumber) }; const STEPS_INJECTION_KEY = "ElSteps"; const stepProps = buildProps({ title: { type: String, default: "" }, icon: { type: iconPropType }, description: { type: String, default: "" }, status: { type: String, values: [ "", "wait", "process", "finish", "error", "success" ], default: "" } }); var steps_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElSteps", __name: "steps", props: stepsProps, emits: stepsEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("steps"); const { children: steps, addChild: addStep, removeChild: removeStep, ChildrenSorter: StepsSorter } = useOrderedChildren(getCurrentInstance(), "ElStep"); watch(steps, () => { steps.value.forEach((instance, index) => { instance.setIndex(index); }); }); provide(STEPS_INJECTION_KEY, { props: props2, steps, addStep, removeStep }); watch(() => props2.active, (newVal, oldVal) => { emit(CHANGE_EVENT, newVal, oldVal); }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b(), unref(ns).m(__props.simple ? "simple" : __props.direction)]) }, [renderSlot(_ctx.$slots, "default"), createVNode(unref(StepsSorter))], 2); }; } }); var steps_default$1 = steps_vue_vue_type_script_setup_true_lang_default; var item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElStep", __name: "item", props: stepProps, setup(__props) { const props2 = __props; const ns = useNamespace("step"); const index = ref(-1); const lineStyle = ref({}); const internalStatus = ref(""); const parent = inject(STEPS_INJECTION_KEY); const currentInstance = getCurrentInstance(); let stepDiff = 0; let beforeActive = 0; onMounted(() => { watch([ () => parent.props.active, () => parent.props.processStatus, () => parent.props.finishStatus ], ([active], [oldActive]) => { beforeActive = oldActive || 0; stepDiff = active - beforeActive; updateStatus(active); }, { immediate: true }); }); const currentStatus = computed(() => { return props2.status || internalStatus.value; }); const prevInternalStatus = computed(() => { const prevStep = parent.steps.value[index.value - 1]; return prevStep ? prevStep.internalStatus.value : "wait"; }); const isCenter = computed(() => { return parent.props.alignCenter; }); const isVertical = computed(() => { return parent.props.direction === "vertical"; }); const isSimple = computed(() => { return parent.props.simple; }); const stepsCount = computed(() => { return parent.steps.value.length; }); const isLast = computed(() => { var _a; return ((_a = parent.steps.value[stepsCount.value - 1]) == null ? void 0 : _a.uid) === currentInstance.uid; }); const space = computed(() => { return isSimple.value ? "" : parent.props.space; }); const containerKls = computed(() => { return [ ns.b(), ns.is(isSimple.value ? "simple" : parent.props.direction), ns.is("flex", isLast.value && !space.value && !isCenter.value), ns.is("center", isCenter.value && !isVertical.value && !isSimple.value) ]; }); const style = computed(() => { const style2 = { flexBasis: isNumber(space.value) ? `${space.value}px` : space.value ? space.value : `${100 / (stepsCount.value - (isCenter.value ? 0 : 1))}%` }; if (isVertical.value) return style2; if (isLast.value) style2.maxWidth = `${100 / stepsCount.value}%`; return style2; }); const setIndex = (val) => { index.value = val; }; const calcProgress = (status) => { const isWait = status === "wait"; const style2 = { transitionDelay: `${Math.abs(stepDiff) === 1 ? 0 : stepDiff > 0 ? (index.value + 1 - beforeActive) * 150 : -(index.value + 1 - parent.props.active) * 150}ms` }; const step2 = status === parent.props.processStatus || isWait ? 0 : 100; style2.borderWidth = step2 && !isSimple.value ? "1px" : 0; style2[parent.props.direction === "vertical" ? "height" : "width"] = `${step2}%`; lineStyle.value = style2; }; const updateStatus = (activeIndex) => { if (activeIndex > index.value) internalStatus.value = parent.props.finishStatus; else if (activeIndex === index.value && prevInternalStatus.value !== "error") internalStatus.value = parent.props.processStatus; else internalStatus.value = "wait"; const prevChild = parent.steps.value[index.value - 1]; if (prevChild) prevChild.calcProgress(internalStatus.value); }; const stepItemState = { uid: currentInstance.uid, getVnode: () => currentInstance.vnode, currentStatus, internalStatus, setIndex, calcProgress }; parent.addStep(stepItemState); onBeforeUnmount(() => { parent.removeStep(stepItemState); }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { style: normalizeStyle(style.value), class: normalizeClass(containerKls.value) }, [ createCommentVNode(" icon & line "), createBaseVNode("div", { class: normalizeClass([unref(ns).e("head"), unref(ns).is(currentStatus.value)]) }, [!isSimple.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("line")) }, [createBaseVNode("i", { class: normalizeClass(unref(ns).e("line-inner")), style: normalizeStyle(lineStyle.value) }, null, 6)], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass([unref(ns).e("icon"), unref(ns).is(__props.icon || _ctx.$slots.icon ? "icon" : "text")]) }, [renderSlot(_ctx.$slots, "icon", {}, () => [__props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(unref(ns).e("icon-inner")) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]), _: 1 }, 8, ["class"])) : currentStatus.value === "success" ? (openBlock(), createBlock(unref(ElIcon), { key: 1, class: normalizeClass([unref(ns).e("icon-inner"), unref(ns).is("status")]) }, { default: withCtx(() => [createVNode(unref(check_default))]), _: 1 }, 8, ["class"])) : currentStatus.value === "error" ? (openBlock(), createBlock(unref(ElIcon), { key: 2, class: normalizeClass([unref(ns).e("icon-inner"), unref(ns).is("status")]) }, { default: withCtx(() => [createVNode(unref(close_default))]), _: 1 }, 8, ["class"])) : !isSimple.value ? (openBlock(), createElementBlock("div", { key: 3, class: normalizeClass(unref(ns).e("icon-inner")) }, toDisplayString(index.value + 1), 3)) : createCommentVNode("v-if", true)])], 2)], 2), createCommentVNode(" title & description "), createBaseVNode("div", { class: normalizeClass(unref(ns).e("main")) }, [createBaseVNode("div", { class: normalizeClass([unref(ns).e("title"), unref(ns).is(currentStatus.value)]) }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2), isSimple.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("arrow")) }, null, 2)) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([unref(ns).e("description"), unref(ns).is(currentStatus.value)]) }, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])], 2))], 2) ], 6); }; } }); var item_default = item_vue_vue_type_script_setup_true_lang_default; const ElSteps = withInstall(steps_default$1, { Step: item_default }); const ElStep = withNoopInstall(item_default); const isValidComponentSize = (val) => ["", ...componentSizes].includes(val); const switchProps = buildProps({ modelValue: { type: [ Boolean, String, Number ], default: false }, disabled: { type: Boolean, default: void 0 }, loading: Boolean, size: { type: String, validator: isValidComponentSize }, width: { type: [String, Number], default: "" }, inlinePrompt: Boolean, inactiveActionIcon: { type: iconPropType }, activeActionIcon: { type: iconPropType }, activeIcon: { type: iconPropType }, inactiveIcon: { type: iconPropType }, activeText: { type: String, default: "" }, inactiveText: { type: String, default: "" }, activeValue: { type: [ Boolean, String, Number ], default: true }, inactiveValue: { type: [ Boolean, String, Number ], default: false }, name: { type: String, default: "" }, validateEvent: { type: Boolean, default: true }, beforeChange: { type: definePropType(Function) }, id: String, tabindex: { type: [String, Number] }, ...useAriaProps(["ariaLabel"]) }); const switchEmits = { [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val), [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val), [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val) }; const _hoisted_1$i = [ "id", "aria-checked", "aria-disabled", "aria-label", "name", "true-value", "false-value", "disabled", "tabindex" ]; const _hoisted_2$b = ["aria-hidden"]; const _hoisted_3$4 = { key: 1 }; const _hoisted_4$3 = { key: 1 }; const _hoisted_5$1 = ["aria-hidden"]; const COMPONENT_NAME$6 = "ElSwitch"; var switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$6, __name: "switch", props: switchProps, emits: switchEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const { formItem } = useFormItem(); const switchSize = useFormSize(); const ns = useNamespace("switch"); const { inputId } = useFormItemInputId(props2, { formItemContext: formItem }); const switchDisabled = useFormDisabled(computed(() => { if (props2.loading) return true; })); const isControlled = ref(props2.modelValue !== false); const input = shallowRef(); const switchKls = computed(() => [ ns.b(), ns.m(switchSize.value), ns.is("disabled", switchDisabled.value), ns.is("checked", checked.value) ]); const labelLeftKls = computed(() => [ ns.e("label"), ns.em("label", "left"), ns.is("active", !checked.value) ]); const labelRightKls = computed(() => [ ns.e("label"), ns.em("label", "right"), ns.is("active", checked.value) ]); const coreStyle = computed(() => ({ width: addUnit(props2.width) })); watch(() => props2.modelValue, () => { isControlled.value = true; }); const actualValue = computed(() => { return isControlled.value ? props2.modelValue : false; }); const checked = computed(() => actualValue.value === props2.activeValue); if (![props2.activeValue, props2.inactiveValue].includes(actualValue.value)) { emit(UPDATE_MODEL_EVENT, props2.inactiveValue); emit(CHANGE_EVENT, props2.inactiveValue); emit(INPUT_EVENT, props2.inactiveValue); } watch(checked, (val) => { var _a; input.value.checked = val; if (props2.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err)); }); const handleChange = () => { const val = checked.value ? props2.inactiveValue : props2.activeValue; emit(UPDATE_MODEL_EVENT, val); emit(CHANGE_EVENT, val); emit(INPUT_EVENT, val); nextTick(() => { input.value.checked = checked.value; }); }; const switchValue = () => { if (switchDisabled.value) return; const { beforeChange } = props2; if (!beforeChange) { handleChange(); return; } const shouldChange = beforeChange(); if (![isPromise(shouldChange), isBoolean(shouldChange)].includes(true)) throwError(COMPONENT_NAME$6, "beforeChange must return type `Promise` or `boolean`"); if (isPromise(shouldChange)) shouldChange.then((result) => { if (result) handleChange(); }).catch((e) => { debugWarn(COMPONENT_NAME$6, `some error occurred: ${e}`); }); else if (shouldChange) handleChange(); }; const focus = () => { var _a, _b; (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a); }; onMounted(() => { input.value.checked = checked.value; }); __expose({ focus, checked }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(switchKls.value), onClick: withModifiers(switchValue, ["prevent"]) }, [ createBaseVNode("input", { id: unref(inputId), ref_key: "input", ref: input, class: normalizeClass(unref(ns).e("input")), type: "checkbox", role: "switch", "aria-checked": checked.value, "aria-disabled": unref(switchDisabled), "aria-label": __props.ariaLabel, name: __props.name, "true-value": __props.activeValue, "false-value": __props.inactiveValue, disabled: unref(switchDisabled), tabindex: __props.tabindex, onChange: handleChange, onKeydown: withKeys(switchValue, ["enter"]) }, null, 42, _hoisted_1$i), !__props.inlinePrompt && (__props.inactiveIcon || __props.inactiveText || _ctx.$slots.inactive) ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(labelLeftKls.value) }, [renderSlot(_ctx.$slots, "inactive", {}, () => [__props.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.inactiveIcon)))]), _: 1 })) : createCommentVNode("v-if", true), !__props.inactiveIcon && __props.inactiveText ? (openBlock(), createElementBlock("span", { key: 1, "aria-hidden": checked.value }, toDisplayString(__props.inactiveText), 9, _hoisted_2$b)) : createCommentVNode("v-if", true)])], 2)) : createCommentVNode("v-if", true), createBaseVNode("span", { class: normalizeClass(unref(ns).e("core")), style: normalizeStyle(coreStyle.value) }, [__props.inlinePrompt ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("inner")) }, [!checked.value ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("inner-wrapper")) }, [renderSlot(_ctx.$slots, "inactive", {}, () => [__props.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.inactiveIcon)))]), _: 1 })) : createCommentVNode("v-if", true), !__props.inactiveIcon && __props.inactiveText ? (openBlock(), createElementBlock("span", _hoisted_3$4, toDisplayString(__props.inactiveText), 1)) : createCommentVNode("v-if", true)])], 2)) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("inner-wrapper")) }, [renderSlot(_ctx.$slots, "active", {}, () => [__props.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.activeIcon)))]), _: 1 })) : createCommentVNode("v-if", true), !__props.activeIcon && __props.activeText ? (openBlock(), createElementBlock("span", _hoisted_4$3, toDisplayString(__props.activeText), 1)) : createCommentVNode("v-if", true)])], 2))], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("action")) }, [__props.loading ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(unref(ns).is("loading")) }, { default: withCtx(() => [createVNode(unref(loading_default))]), _: 1 }, 8, ["class"])) : checked.value ? renderSlot(_ctx.$slots, "active-action", { key: 1 }, () => [__props.activeActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.activeActionIcon)))]), _: 1 })) : createCommentVNode("v-if", true)]) : !checked.value ? renderSlot(_ctx.$slots, "inactive-action", { key: 2 }, () => [__props.inactiveActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.inactiveActionIcon)))]), _: 1 })) : createCommentVNode("v-if", true)]) : createCommentVNode("v-if", true)], 2)], 6), !__props.inlinePrompt && (__props.activeIcon || __props.activeText || _ctx.$slots.active) ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(labelRightKls.value) }, [renderSlot(_ctx.$slots, "active", {}, () => [__props.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.activeIcon)))]), _: 1 })) : createCommentVNode("v-if", true), !__props.activeIcon && __props.activeText ? (openBlock(), createElementBlock("span", { key: 1, "aria-hidden": !checked.value }, toDisplayString(__props.activeText), 9, _hoisted_5$1)) : createCommentVNode("v-if", true)])], 2)) : createCommentVNode("v-if", true) ], 2); }; } }); var switch_default = switch_vue_vue_type_script_setup_true_lang_default; const ElSwitch = withInstall(switch_default); const getCell = function(event) { var _a; return (_a = event.target) == null ? void 0 : _a.closest("td"); }; const orderBy = function(array, sortKey, reverse, sortMethod, sortBy) { if (!sortKey && !sortMethod && (!sortBy || isArray(sortBy) && !sortBy.length)) return array; if (isString(reverse)) reverse = reverse === "descending" ? -1 : 1; else reverse = reverse && reverse < 0 ? -1 : 1; const getKey = sortMethod ? null : function(value, index) { if (sortBy) return flatMap(castArray$1(sortBy), (by) => { if (isString(by)) return get(value, by); else return by(value, index, array); }); if (sortKey !== "$key") { if (isObject(value) && "$value" in value) value = value.$value; } return [isObject(value) ? sortKey ? get(value, sortKey) : null : value]; }; const compare = function(a, b) { var _a, _b, _c, _d, _e; if (sortMethod) return sortMethod(a.value, b.value); for (let i = 0, len = ((_a = a.key) == null ? void 0 : _a.length) ?? 0; i < len; i++) { if (((_b = a.key) == null ? void 0 : _b[i]) < ((_c = b.key) == null ? void 0 : _c[i])) return -1; if (((_d = a.key) == null ? void 0 : _d[i]) > ((_e = b.key) == null ? void 0 : _e[i])) return 1; } return 0; }; return array.map((value, index) => { return { value, index, key: getKey ? getKey(value, index) : null }; }).sort((a, b) => { let order = compare(a, b); if (!order) order = a.index - b.index; return order * +reverse; }).map((item) => item.value); }; const getColumnById = function(table, columnId) { let column = null; table.columns.forEach((item) => { if (item.id === columnId) column = item; }); return column; }; const getColumnByKey = function(table, columnKey) { let column = null; for (let i = 0; i < table.columns.length; i++) { const item = table.columns[i]; if (item.columnKey === columnKey) { column = item; break; } } if (!column) throwError("ElTable", `No column matching with column-key: ${columnKey}`); return column; }; const getColumnByCell = function(table, cell, namespace) { const matches = (cell.className || "").match(new RegExp(`${namespace}-table_[^\\s]+`, "gm")); if (matches) return getColumnById(table, matches[0]); return null; }; const getRowIdentity = (row, rowKey2) => { if (!row) throw new Error("Row is required when get row identity"); if (isString(rowKey2)) { if (!rowKey2.includes(".")) return `${row[rowKey2]}`; const key = rowKey2.split("."); let current = row; for (const element of key) current = current[element]; return `${current}`; } else if (isFunction(rowKey2)) return rowKey2.call(null, row); return ""; }; const getKeysMap = function(array, rowKey2, flatten2 = false, childrenKey = "children") { const data = array || []; const arrayMap = {}; data.forEach((row, index) => { arrayMap[getRowIdentity(row, rowKey2)] = { row, index }; if (flatten2) { const children = row[childrenKey]; if (isArray(children)) Object.assign(arrayMap, getKeysMap(children, rowKey2, true, childrenKey)); } }); return arrayMap; }; function mergeOptions(defaults, config) { const options = {}; let key; for (key in defaults) options[key] = defaults[key]; for (key in config) if (hasOwn(config, key)) { const value = config[key]; if (!isUndefined(value)) options[key] = value; } return options; } function parseWidth(width) { if (width === "") return width; if (!isUndefined(width)) { width = Number.parseInt(width, 10); if (Number.isNaN(width)) width = ""; } return width; } function parseMinWidth(minWidth) { if (minWidth === "") return minWidth; if (!isUndefined(minWidth)) { minWidth = parseWidth(minWidth); if (Number.isNaN(minWidth)) minWidth = 80; } return minWidth; } function parseHeight(height) { if (isNumber(height)) return height; if (isString(height)) if (/^\d+(?:px)?$/.test(height)) return Number.parseInt(height, 10); else return height; return null; } function compose(...funcs) { if (funcs.length === 0) return (arg) => arg; if (funcs.length === 1) return funcs[0]; return funcs.reduce((a, b) => (...args) => a(b(...args))); } function toggleRowStatus(statusArr, row, newVal, tableTreeProps, selectable, rowIndex, rowKey2) { let _rowIndex = rowIndex ?? 0; let changed = false; const getIndex = () => { if (!rowKey2) return statusArr.indexOf(row); const id = getRowIdentity(row, rowKey2); return statusArr.findIndex((item) => getRowIdentity(item, rowKey2) === id); }; const index = getIndex(); const included = index !== -1; const isRowSelectable = selectable == null ? void 0 : selectable.call(null, row, _rowIndex); const toggleStatus = (type) => { if (type === "add") statusArr.push(row); else statusArr.splice(index, 1); changed = true; }; const getChildrenCount = (row2) => { let count = 0; const children = (tableTreeProps == null ? void 0 : tableTreeProps.children) && row2[tableTreeProps.children]; if (children && isArray(children)) { count += children.length; children.forEach((item) => { count += getChildrenCount(item); }); } return count; }; if (!selectable || isRowSelectable) if (isBoolean(newVal)) { if (newVal && !included) toggleStatus("add"); else if (!newVal && included) toggleStatus("remove"); } else included ? toggleStatus("remove") : toggleStatus("add"); if (!(tableTreeProps == null ? void 0 : tableTreeProps.checkStrictly) && (tableTreeProps == null ? void 0 : tableTreeProps.children) && isArray(row[tableTreeProps.children])) row[tableTreeProps.children].forEach((item) => { const childChanged = toggleRowStatus(statusArr, item, newVal ?? !included, tableTreeProps, selectable, _rowIndex + 1, rowKey2); _rowIndex += getChildrenCount(item) + 1; if (childChanged) changed = childChanged; }); return changed; } function walkTreeNode(root, cb, childrenKey = "children", lazyKey = "hasChildren", lazy = false) { const isNil2 = (array) => !(isArray(array) && array.length); function _walker(parent, children, level) { cb(parent, children, level); children.forEach((item) => { if (item[lazyKey] && lazy) { cb(item, null, level + 1); return; } const children2 = item[childrenKey]; if (!isNil2(children2)) _walker(item, children2, level + 1); }); } root.forEach((item) => { if (item[lazyKey] && lazy) { cb(item, null, 0); return; } const children = item[childrenKey]; if (!isNil2(children)) _walker(item, children, 0); }); } const getTableOverflowTooltipProps = (props2, innerText, row, column) => { const popperOptions = { strategy: "fixed", ...props2.popperOptions }; const tooltipFormatterContent = isFunction(column == null ? void 0 : column.tooltipFormatter) ? column.tooltipFormatter({ row, column, cellValue: getProp(row, column.property).value }) : void 0; if (isVNode(tooltipFormatterContent)) return { slotContent: tooltipFormatterContent, content: null, ...props2, popperOptions }; return { slotContent: null, content: tooltipFormatterContent ?? innerText, ...props2, popperOptions }; }; let removePopper = null; function createTablePopper(props2, popperContent, row, column, trigger, table) { var _a; const tableOverflowTooltipProps = getTableOverflowTooltipProps(props2, popperContent, row, column); const mergedProps = { ...tableOverflowTooltipProps, slotContent: void 0 }; if ((removePopper == null ? void 0 : removePopper.trigger) === trigger) { const comp = (_a = removePopper.vm) == null ? void 0 : _a.component; merge(comp == null ? void 0 : comp.props, mergedProps); if (comp && tableOverflowTooltipProps.slotContent) comp.slots.content = () => [tableOverflowTooltipProps.slotContent]; return; } removePopper == null ? void 0 : removePopper(); const parentNode = table == null ? void 0 : table.refs.tableWrapper; const ns = parentNode == null ? void 0 : parentNode.dataset.prefix; const vm = createVNode(ElTooltip, { virtualTriggering: true, virtualRef: trigger, appendTo: parentNode, placement: "top", transition: "none", offset: 0, hideAfter: 0, ...mergedProps }, tableOverflowTooltipProps.slotContent ? { content: () => tableOverflowTooltipProps.slotContent } : void 0); vm.appContext = { ...table.appContext, ...table }; const container = document.createElement("div"); render(vm, container); vm.component.exposed.onOpen(); const scrollContainer = parentNode == null ? void 0 : parentNode.querySelector(`.${ns}-scrollbar__wrap`); removePopper = () => { var _a2, _b; if ((_b = (_a2 = vm.component) == null ? void 0 : _a2.exposed) == null ? void 0 : _b.onClose) vm.component.exposed.onClose(); render(null, container); const currentRemovePopper = removePopper; scrollContainer == null ? void 0 : scrollContainer.removeEventListener("scroll", currentRemovePopper); currentRemovePopper.trigger = void 0; currentRemovePopper.vm = void 0; removePopper = null; }; removePopper.trigger = trigger ?? void 0; removePopper.vm = vm; scrollContainer == null ? void 0 : scrollContainer.addEventListener("scroll", removePopper); } function getCurrentColumns(column) { if (column.children) return flatMap(column.children, getCurrentColumns); else return [column]; } function getColSpan(colSpan, column) { return colSpan + column.colSpan; } const isFixedColumn = (index, fixed, store, realColumns) => { let start = 0; let after = index; const columns2 = store.states.columns.value; if (realColumns) { const curColumns = getCurrentColumns(realColumns[index]); start = columns2.slice(0, columns2.indexOf(curColumns[0])).reduce(getColSpan, 0); after = start + curColumns.reduce(getColSpan, 0) - 1; } else start = index; let fixedLayout; switch (fixed) { case "left": if (after < store.states.fixedLeafColumnsLength.value) fixedLayout = "left"; break; case "right": if (start >= columns2.length - store.states.rightFixedLeafColumnsLength.value) fixedLayout = "right"; break; default: if (after < store.states.fixedLeafColumnsLength.value) fixedLayout = "left"; else if (start >= columns2.length - store.states.rightFixedLeafColumnsLength.value) fixedLayout = "right"; } return fixedLayout ? { direction: fixedLayout, start, after } : {}; }; const getFixedColumnsClass = (namespace, index, fixed, store, realColumns, offset2 = 0) => { const classes = []; const { direction: direction2, start, after } = isFixedColumn(index, fixed, store, realColumns); if (direction2) { const isLeft = direction2 === "left"; classes.push(`${namespace}-fixed-column--${direction2}`); if (isLeft && after + offset2 === store.states.fixedLeafColumnsLength.value - 1) classes.push("is-last-column"); else if (!isLeft && start - offset2 === store.states.columns.value.length - store.states.rightFixedLeafColumnsLength.value) classes.push("is-first-column"); } return classes; }; function getOffset(offset2, column) { return offset2 + (isNull(column.realWidth) || Number.isNaN(column.realWidth) ? Number(column.width) : column.realWidth); } const getFixedColumnOffset = (index, fixed, store, realColumns) => { const { direction: direction2, start = 0, after = 0 } = isFixedColumn(index, fixed, store, realColumns); if (!direction2) return; const styles = {}; const isLeft = direction2 === "left"; const columns2 = store.states.columns.value; if (isLeft) styles.left = columns2.slice(0, start).reduce(getOffset, 0); else styles.right = columns2.slice(after + 1).reverse().reduce(getOffset, 0); return styles; }; const ensurePosition = (style, key) => { if (!style) return; if (!Number.isNaN(style[key])) style[key] = `${style[key]}px`; }; 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 useExpand(watcherData) { const instance = getCurrentInstance(); const defaultExpandAll = ref(false); const expandRows = ref([]); const canRowExpand = (row, index) => { const expandableFn = instance.store.states.rowExpandable.value; return (expandableFn == null ? void 0 : expandableFn(row, index)) ?? true; }; const updateExpandRows = () => { const data = watcherData.data.value || []; const rowKey2 = watcherData.rowKey.value; if (defaultExpandAll.value) expandRows.value = instance.store.states.rowExpandable.value ? data.filter(canRowExpand) : data.slice(); else if (rowKey2) { const expandRowsMap = getKeysMap(expandRows.value, rowKey2); expandRows.value = data.filter((row, index) => { return !!expandRowsMap[getRowIdentity(row, rowKey2)] && canRowExpand(row, index); }); } else expandRows.value = []; }; const toggleRowExpansion = (row, expanded) => { const rowIndex = (watcherData.data.value || []).indexOf(row); if (rowIndex > -1 && !canRowExpand(row, rowIndex)) return; if (toggleRowStatus(expandRows.value, row, expanded, void 0, void 0, void 0, watcherData.rowKey.value)) instance.emit("expand-change", row, expandRows.value.slice()); }; const setExpandRowKeys = (rowKeys) => { instance.store.assertRowKey(); const data = watcherData.data.value || []; const rowKey2 = watcherData.rowKey.value; const keysMap = getKeysMap(data, rowKey2); expandRows.value = rowKeys.reduce((prev, cur) => { const info = keysMap[cur]; if (info && canRowExpand(info.row, info.index)) prev.push(info.row); return prev; }, []); }; const isRowExpanded = (row) => { const rowKey2 = watcherData.rowKey.value; if (rowKey2) return !!getKeysMap(expandRows.value, rowKey2)[getRowIdentity(row, rowKey2)]; return expandRows.value.includes(row); }; return { updateExpandRows, toggleRowExpansion, setExpandRowKeys, isRowExpanded, states: { expandRows, defaultExpandAll } }; } function useCurrent(watcherData) { const instance = getCurrentInstance(); const _currentRowKey = ref(null); const currentRow = ref(null); const setCurrentRowKey = (key) => { instance.store.assertRowKey(); _currentRowKey.value = key; setCurrentRowByKey(key); }; const restoreCurrentRowKey = () => { _currentRowKey.value = null; }; const setCurrentRowByKey = (key) => { const { data, rowKey: rowKey2 } = watcherData; const oldCurrentRow = currentRow.value; let _currentRow = null; if (rowKey2.value) _currentRow = (unref(data) || []).find((item) => getRowIdentity(item, rowKey2.value) === key) ?? null; currentRow.value = _currentRow ?? null; instance.emit("current-change", currentRow.value, oldCurrentRow); }; const updateCurrentRow = (_currentRow) => { const oldCurrentRow = currentRow.value; if (_currentRow && _currentRow !== oldCurrentRow) { currentRow.value = _currentRow; instance.emit("current-change", currentRow.value, oldCurrentRow); return; } if (!_currentRow && oldCurrentRow) { currentRow.value = null; instance.emit("current-change", null, oldCurrentRow); } }; const updateCurrentRowData = () => { const rowKey2 = watcherData.rowKey.value; const data = watcherData.data.value || []; const oldCurrentRow = currentRow.value; if (oldCurrentRow && !data.includes(oldCurrentRow)) if (rowKey2) setCurrentRowByKey(getRowIdentity(oldCurrentRow, rowKey2)); else { currentRow.value = null; instance.emit("current-change", null, oldCurrentRow); } else if (_currentRowKey.value) { setCurrentRowByKey(_currentRowKey.value); restoreCurrentRowKey(); } }; return { setCurrentRowKey, restoreCurrentRowKey, setCurrentRowByKey, updateCurrentRow, updateCurrentRowData, states: { _currentRowKey, currentRow } }; } function useTree$2(watcherData) { const expandRowKeys = ref([]); const treeData = ref({}); const indent = ref(16); const lazy = ref(false); const lazyTreeNodeMap = ref({}); const lazyColumnIdentifier = ref("hasChildren"); const childrenColumnName = ref("children"); const checkStrictly = ref(false); const instance = getCurrentInstance(); const normalizedData = computed(() => { if (!watcherData.rowKey.value) return {}; return normalize(watcherData.data.value || []); }); const normalizedLazyNode = computed(() => { const rowKey2 = watcherData.rowKey.value; const keys = Object.keys(lazyTreeNodeMap.value); const res = {}; if (!keys.length) return res; keys.forEach((key) => { if (lazyTreeNodeMap.value[key].length) { const item = { children: [] }; lazyTreeNodeMap.value[key].forEach((row) => { const currentRowKey = getRowIdentity(row, rowKey2); item.children.push(currentRowKey); if (row[lazyColumnIdentifier.value] && !res[currentRowKey]) res[currentRowKey] = { children: [] }; }); res[key] = item; } }); return res; }); const normalize = (data) => { const rowKey2 = watcherData.rowKey.value; const res = {}; walkTreeNode(data, (parent, children, level) => { const parentId = getRowIdentity(parent, rowKey2); if (isArray(children)) res[parentId] = { children: children.map((row) => getRowIdentity(row, rowKey2)), level }; else if (lazy.value) res[parentId] = { children: [], lazy: true, level }; }, childrenColumnName.value, lazyColumnIdentifier.value, lazy.value); return res; }; const updateTreeData = (ifChangeExpandRowKeys = false, ifExpandAll) => { var _a, _b; ifExpandAll || (ifExpandAll = (_a = instance.store) == null ? void 0 : _a.states.defaultExpandAll.value); const nested = normalizedData.value; const normalizedLazyNode_ = normalizedLazyNode.value; const keys = Object.keys(nested); const newTreeData = {}; if (keys.length) { const oldTreeData = unref(treeData); const rootLazyRowKeys = []; const getExpanded = (oldValue, key) => { if (ifChangeExpandRowKeys) if (expandRowKeys.value) return ifExpandAll || expandRowKeys.value.includes(key); else return !!(ifExpandAll || (oldValue == null ? void 0 : oldValue.expanded)); else { const included = ifExpandAll || expandRowKeys.value && expandRowKeys.value.includes(key); return !!((oldValue == null ? void 0 : oldValue.expanded) || included); } }; keys.forEach((key) => { const oldValue = oldTreeData[key]; const newValue = { ...nested[key] }; newValue.expanded = getExpanded(oldValue, key); if (newValue.lazy) { const { loaded = false, loading = false } = oldValue || {}; newValue.loaded = !!loaded; newValue.loading = !!loading; rootLazyRowKeys.push(key); } newTreeData[key] = newValue; }); const lazyKeys = Object.keys(normalizedLazyNode_); if (lazy.value && lazyKeys.length && rootLazyRowKeys.length) lazyKeys.forEach((key) => { var _a2; const oldValue = oldTreeData[key]; const lazyNodeChildren = normalizedLazyNode_[key].children; if (rootLazyRowKeys.includes(key)) { if (((_a2 = newTreeData[key].children) == null ? void 0 : _a2.length) !== 0) throw new Error("[ElTable]children must be an empty array."); newTreeData[key].children = lazyNodeChildren; } else { const { loaded = false, loading = false } = oldValue || {}; newTreeData[key] = { lazy: true, loaded: !!loaded, loading: !!loading, expanded: getExpanded(oldValue, key), children: lazyNodeChildren, level: void 0 }; } }); } treeData.value = newTreeData; (_b = instance.store) == null ? void 0 : _b.updateTableScrollY(); }; watch(() => expandRowKeys.value, () => { updateTreeData(true); }, { deep: true }); watch(() => normalizedData.value, () => { updateTreeData(); }); watch(() => normalizedLazyNode.value, () => { updateTreeData(); }); const updateTreeExpandKeys = (value) => { expandRowKeys.value = value; updateTreeData(); }; const isUseLazy = (data) => { return lazy.value && data && "loaded" in data && !data.loaded; }; const toggleTreeExpansion = (row, expanded) => { instance.store.assertRowKey(); const rowKey2 = watcherData.rowKey.value; const id = getRowIdentity(row, rowKey2); const data = id && treeData.value[id]; if (id && data && "expanded" in data) { const oldExpanded = data.expanded; expanded = isUndefined(expanded) ? !data.expanded : expanded; treeData.value[id].expanded = expanded; if (oldExpanded !== expanded) instance.emit("expand-change", row, expanded); expanded && isUseLazy(data) && loadData(row, id, data); instance.store.updateTableScrollY(); } }; const loadOrToggle = (row) => { instance.store.assertRowKey(); const rowKey2 = watcherData.rowKey.value; const id = getRowIdentity(row, rowKey2); const data = treeData.value[id]; if (isUseLazy(data)) loadData(row, id, data); else toggleTreeExpansion(row, void 0); }; const loadData = (row, key, treeNode) => { const { load } = instance.props; if (load && !treeData.value[key].loaded) { treeData.value[key].loading = true; load(row, treeNode, (data) => { if (!isArray(data)) throw new TypeError("[ElTable] data must be an array"); treeData.value[key].loading = false; treeData.value[key].loaded = true; treeData.value[key].expanded = true; if (data.length) lazyTreeNodeMap.value[key] = data; instance.emit("expand-change", row, true); }); } }; const updateKeyChildren = (key, data) => { const { lazy: lazy2, rowKey: rowKey2 } = instance.props; if (!lazy2) return; if (!rowKey2) throw new Error("[Table] rowKey is required in updateKeyChild"); if (lazyTreeNodeMap.value[key]) lazyTreeNodeMap.value[key] = data; }; return { loadData, loadOrToggle, toggleTreeExpansion, updateTreeExpandKeys, updateTreeData, updateKeyChildren, normalize, states: { expandRowKeys, treeData, indent, lazy, lazyTreeNodeMap, lazyColumnIdentifier, childrenColumnName, checkStrictly } }; } const sortData = (data, states) => { const sortingColumn = states.sortingColumn; if (!sortingColumn || isString(sortingColumn.sortable)) return data; return orderBy(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy); }; const doFlattenColumns = (columns2) => { const result = []; columns2.forEach((column) => { if (column.children && column.children.length > 0) result.push.apply(result, doFlattenColumns(column.children)); else result.push(column); }); return result; }; function useWatcher$1() { var _a; const instance = getCurrentInstance(); const { size: tableSize } = toRefs((_a = instance.proxy) == null ? void 0 : _a.$props); const rowKey2 = ref(null); const data = ref([]); const _data = ref([]); const isComplex = ref(false); const _columns = ref([]); const originColumns = ref([]); const columns2 = ref([]); const fixedColumns = ref([]); const rightFixedColumns = ref([]); const leafColumns = ref([]); const fixedLeafColumns = ref([]); const rightFixedLeafColumns = ref([]); const updateOrderFns = []; const leafColumnsLength = ref(0); const fixedLeafColumnsLength = ref(0); const rightFixedLeafColumnsLength = ref(0); const isAllSelected = ref(false); const selection = ref([]); const reserveSelection = ref(false); const selectOnIndeterminate = ref(false); const selectable = ref(null); const rowExpandable = ref(null); const filters = ref({}); const filteredData = ref(null); const sortingColumn = ref(null); const sortProp = ref(null); const sortOrder = ref(null); const hoverRow = ref(null); const selectedMap = computed(() => { return rowKey2.value ? getKeysMap(selection.value, rowKey2.value) : void 0; }); watch(data, () => { var _a2; if (instance.state) { scheduleLayout(false); if (instance.props.tableLayout === "auto") (_a2 = instance.refs.tableHeaderRef) == null ? void 0 : _a2.updateFixedColumnStyle(); } }, { deep: true }); const assertRowKey = () => { if (!rowKey2.value) throw new Error("[ElTable] prop row-key is required"); }; const updateChildFixed = (column) => { var _a2; (_a2 = column.children) == null ? void 0 : _a2.forEach((childColumn) => { childColumn.fixed = column.fixed; updateChildFixed(childColumn); }); }; const updateColumns = () => { _columns.value.forEach((column) => { updateChildFixed(column); }); fixedColumns.value = _columns.value.filter((column) => [true, "left"].includes(column.fixed)); const selectColumn = _columns.value.find((column) => column.type === "selection"); let selectColFixLeft; if (selectColumn && selectColumn.fixed !== "right" && !fixedColumns.value.includes(selectColumn)) { if (_columns.value.indexOf(selectColumn) === 0 && fixedColumns.value.length) { fixedColumns.value.unshift(selectColumn); selectColFixLeft = true; } } rightFixedColumns.value = _columns.value.filter((column) => column.fixed === "right"); const notFixedColumns = _columns.value.filter((column) => (selectColFixLeft ? column.type !== "selection" : true) && !column.fixed); originColumns.value = Array.from(fixedColumns.value).concat(notFixedColumns).concat(rightFixedColumns.value); const leafColumns2 = doFlattenColumns(notFixedColumns); const fixedLeafColumns2 = doFlattenColumns(fixedColumns.value); const rightFixedLeafColumns2 = doFlattenColumns(rightFixedColumns.value); leafColumnsLength.value = leafColumns2.length; fixedLeafColumnsLength.value = fixedLeafColumns2.length; rightFixedLeafColumnsLength.value = rightFixedLeafColumns2.length; columns2.value = Array.from(fixedLeafColumns2).concat(leafColumns2).concat(rightFixedLeafColumns2); isComplex.value = fixedColumns.value.length > 0 || rightFixedColumns.value.length > 0; }; const scheduleLayout = (needUpdateColumns, immediate = false) => { if (needUpdateColumns) updateColumns(); if (immediate) instance.state.doLayout(); else instance.state.debouncedUpdateLayout(); }; const isSelected = (row) => { if (selectedMap.value) return !!selectedMap.value[getRowIdentity(row, rowKey2.value)]; else return selection.value.includes(row); }; const clearSelection = () => { isAllSelected.value = false; const oldSelection = selection.value; selection.value = []; if (oldSelection.length) instance.emit("selection-change", []); }; const cleanSelection = () => { var _a2, _b; let deleted; if (rowKey2.value) { deleted = []; const childrenKey = (_b = (_a2 = instance == null ? void 0 : instance.store) == null ? void 0 : _a2.states) == null ? void 0 : _b.childrenColumnName.value; const dataMap = getKeysMap(data.value, rowKey2.value, true, childrenKey); for (const key in selectedMap.value) if (hasOwn(selectedMap.value, key) && !dataMap[key]) deleted.push(selectedMap.value[key].row); } else deleted = selection.value.filter((item) => !data.value.includes(item)); if (deleted.length) { const newSelection = selection.value.filter((item) => !deleted.includes(item)); selection.value = newSelection; instance.emit("selection-change", newSelection.slice()); } }; const getSelectionRows = () => { return (selection.value || []).slice(); }; const toggleRowSelection = (row, selected, emitChange = true, ignoreSelectable = false) => { var _a2, _b, _c, _d; const treeProps2 = { children: (_b = (_a2 = instance == null ? void 0 : instance.store) == null ? void 0 : _a2.states) == null ? void 0 : _b.childrenColumnName.value, checkStrictly: (_d = (_c = instance == null ? void 0 : instance.store) == null ? void 0 : _c.states) == null ? void 0 : _d.checkStrictly.value }; if (toggleRowStatus(selection.value, row, selected, treeProps2, ignoreSelectable ? void 0 : selectable.value, data.value.indexOf(row), rowKey2.value)) { const newSelection = (selection.value || []).slice(); if (emitChange) instance.emit("select", newSelection, row); instance.emit("selection-change", newSelection); } }; const _toggleAllSelection = () => { var _a2, _b; const value = selectOnIndeterminate.value ? !isAllSelected.value : !(isAllSelected.value || selection.value.length); isAllSelected.value = value; let selectionChanged = false; let childrenCount = 0; const rowKey3 = (_b = (_a2 = instance == null ? void 0 : instance.store) == null ? void 0 : _a2.states) == null ? void 0 : _b.rowKey.value; const { childrenColumnName } = instance.store.states; const treeProps2 = { children: childrenColumnName.value, checkStrictly: false }; data.value.forEach((row, index) => { const rowIndex = index + childrenCount; if (toggleRowStatus(selection.value, row, value, treeProps2, selectable.value, rowIndex, rowKey3)) selectionChanged = true; childrenCount += getChildrenCount(getRowIdentity(row, rowKey3)); }); if (selectionChanged) instance.emit("selection-change", selection.value ? selection.value.slice() : []); instance.emit("select-all", (selection.value || []).slice()); }; const updateAllSelected = () => { var _a2; if (((_a2 = data.value) == null ? void 0 : _a2.length) === 0) { isAllSelected.value = false; return; } const { childrenColumnName } = instance.store.states; let rowIndex = 0; let selectedCount = 0; const checkSelectedStatus = (data2) => { var _a3; for (const row of data2) { const isRowSelectable = selectable.value && selectable.value.call(null, row, rowIndex); if (!isSelected(row)) { if (!selectable.value || isRowSelectable) return false; } else selectedCount++; rowIndex++; if (((_a3 = row[childrenColumnName.value]) == null ? void 0 : _a3.length) && !checkSelectedStatus(row[childrenColumnName.value])) return false; } return true; }; const isAllSelected_ = checkSelectedStatus(data.value || []); isAllSelected.value = selectedCount === 0 ? false : isAllSelected_; }; const getChildrenCount = (rowKey3) => { var _a2; if (!instance || !instance.store) return 0; const { treeData } = instance.store.states; let count = 0; const children = (_a2 = treeData.value[rowKey3]) == null ? void 0 : _a2.children; if (children) { count += children.length; children.forEach((childKey) => { count += getChildrenCount(childKey); }); } return count; }; const updateFilters = (column, values) => { const filters_ = {}; castArray$1(column).forEach((col) => { filters.value[col.id] = values; filters_[col.columnKey || col.id] = values; }); return filters_; }; const updateSort = (column, prop, order) => { if (sortingColumn.value && sortingColumn.value !== column) sortingColumn.value.order = null; sortingColumn.value = column; sortProp.value = prop; sortOrder.value = order; }; const execFilter = () => { let sourceData = unref(_data); Object.keys(filters.value).forEach((columnId) => { const values = filters.value[columnId]; if (!values || values.length === 0) return; const column = getColumnById({ columns: columns2.value }, columnId); if (column && column.filterMethod) sourceData = sourceData.filter((row) => { return values.some((value) => column.filterMethod.call(null, value, row, column)); }); }); filteredData.value = sourceData; }; const execSort = () => { data.value = sortData(filteredData.value ?? [], { sortingColumn: sortingColumn.value, sortProp: sortProp.value, sortOrder: sortOrder.value }); }; const execQuery = (ignore = void 0) => { if (!(ignore == null ? void 0 : ignore.filter)) execFilter(); execSort(); }; const clearFilter = (columnKeys) => { const { tableHeaderRef } = instance.refs; if (!tableHeaderRef) return; const panels = Object.assign({}, tableHeaderRef.filterPanels); const keys = Object.keys(panels); if (!keys.length) return; if (isString(columnKeys)) columnKeys = [columnKeys]; if (isArray(columnKeys)) { const columns_ = columnKeys.map((key) => getColumnByKey({ columns: columns2.value }, key)); keys.forEach((key) => { const column = columns_.find((col) => col.id === key); if (column) column.filteredValue = []; }); instance.store.commit("filterChange", { column: columns_, values: [], silent: true, multi: true }); } else { keys.forEach((key) => { const column = columns2.value.find((col) => col.id === key); if (column) column.filteredValue = []; }); filters.value = {}; instance.store.commit("filterChange", { column: {}, values: [], silent: true }); } }; const clearSort = () => { if (!sortingColumn.value) return; updateSort(null, null, null); instance.store.commit("changeSortCondition", { silent: true }); }; const { setExpandRowKeys, toggleRowExpansion, updateExpandRows, states: expandStates, isRowExpanded } = useExpand({ data, rowKey: rowKey2 }); const { updateTreeExpandKeys, toggleTreeExpansion, updateTreeData, updateKeyChildren, loadOrToggle, states: treeStates } = useTree$2({ data, rowKey: rowKey2 }); const { updateCurrentRowData, updateCurrentRow, setCurrentRowKey, states: currentData } = useCurrent({ data, rowKey: rowKey2 }); const setExpandRowKeysAdapter = (val) => { setExpandRowKeys(val); updateTreeExpandKeys(val); }; const toggleRowExpansionAdapter = (row, expanded) => { if (columns2.value.some(({ type }) => type === "expand")) toggleRowExpansion(row, expanded); else toggleTreeExpansion(row, expanded); }; return { assertRowKey, updateColumns, scheduleLayout, isSelected, clearSelection, cleanSelection, getSelectionRows, toggleRowSelection, _toggleAllSelection, toggleAllSelection: null, updateAllSelected, updateFilters, updateCurrentRow, updateSort, execFilter, execSort, execQuery, clearFilter, clearSort, toggleRowExpansion, setExpandRowKeysAdapter, setCurrentRowKey, toggleRowExpansionAdapter, isRowExpanded, updateExpandRows, updateCurrentRowData, loadOrToggle, updateTreeData, updateKeyChildren, states: { tableSize, rowKey: rowKey2, data, _data, isComplex, _columns, originColumns, columns: columns2, fixedColumns, rightFixedColumns, leafColumns, fixedLeafColumns, rightFixedLeafColumns, updateOrderFns, leafColumnsLength, fixedLeafColumnsLength, rightFixedLeafColumnsLength, isAllSelected, selection, reserveSelection, selectOnIndeterminate, selectable, rowExpandable, filters, filteredData, sortingColumn, sortProp, sortOrder, hoverRow, ...expandStates, ...treeStates, ...currentData } }; } function replaceColumn(array, column) { return array.map((item) => { var _a; if (item.id === column.id) return column; else if ((_a = item.children) == null ? void 0 : _a.length) item.children = replaceColumn(item.children, column); return item; }); } function sortColumn(array) { array.forEach((item) => { var _a, _b; item.no = (_a = item.getColumnIndex) == null ? void 0 : _a.call(item); if ((_b = item.children) == null ? void 0 : _b.length) sortColumn(item.children); }); array.sort((cur, pre) => cur.no - pre.no); } function useStore() { const instance = getCurrentInstance(); const watcher = useWatcher$1(); const ns = useNamespace("table"); const { t } = useLocale(); const mutations = { setData(states, data) { const dataInstanceChanged = unref(states._data) !== data; states.data.value = data; states._data.value = data; instance.store.execQuery(); instance.store.updateCurrentRowData(); instance.store.updateExpandRows(); instance.store.updateTreeData(instance.store.states.defaultExpandAll.value); if (unref(states.reserveSelection)) instance.store.assertRowKey(); else if (dataInstanceChanged) instance.store.clearSelection(); else instance.store.cleanSelection(); instance.store.updateAllSelected(); if (instance.$ready) instance.store.scheduleLayout(); }, insertColumn(states, column, parent, updateColumnOrder) { var _a; const array = unref(states._columns); let newColumns = []; if (!parent) { array.push(column); newColumns = array; } else { if (parent && !parent.children) parent.children = []; (_a = parent.children) == null ? void 0 : _a.push(column); newColumns = replaceColumn(array, parent); } sortColumn(newColumns); states._columns.value = newColumns; states.updateOrderFns.push(updateColumnOrder); if (column.type === "selection") { states.selectable.value = column.selectable; states.reserveSelection.value = column.reserveSelection; } if (instance.$ready) { instance.store.updateColumns(); instance.store.scheduleLayout(); } }, updateColumnOrder(states, column) { var _a; if (((_a = column.getColumnIndex) == null ? void 0 : _a.call(column)) === column.no) return; sortColumn(states._columns.value); if (instance.$ready) instance.store.updateColumns(); }, removeColumn(states, column, parent, updateColumnOrder) { var _a; const array = unref(states._columns) || []; if (parent) { (_a = parent.children) == null ? void 0 : _a.splice(parent.children.findIndex((item) => item.id === column.id), 1); nextTick(() => { var _a2; if (((_a2 = parent.children) == null ? void 0 : _a2.length) === 0) delete parent.children; }); states._columns.value = replaceColumn(array, parent); } else { const index = array.indexOf(column); if (index > -1) { array.splice(index, 1); states._columns.value = array; } } const updateFnIndex = states.updateOrderFns.indexOf(updateColumnOrder); updateFnIndex > -1 && states.updateOrderFns.splice(updateFnIndex, 1); if (instance.$ready) { instance.store.updateColumns(); instance.store.scheduleLayout(); } }, sort(states, options) { const { prop, order, init } = options; if (prop) { const column = unref(states.columns).find((column2) => column2.property === prop); if (column) { column.order = order; instance.store.updateSort(column, prop, order); instance.store.commit("changeSortCondition", { init }); } } }, changeSortCondition(states, options) { const { sortingColumn, sortProp, sortOrder } = states; const columnValue = unref(sortingColumn), propValue = unref(sortProp), orderValue = unref(sortOrder); if (isNull(orderValue)) { states.sortingColumn.value = null; states.sortProp.value = null; } instance.store.execQuery({ filter: true }); if (!options || !(options.silent || options.init)) instance.emit("sort-change", { column: columnValue, prop: propValue, order: orderValue }); instance.store.updateTableScrollY(); }, filterChange(_states, options) { const { column, values, silent } = options; const newFilters = instance.store.updateFilters(column, values); instance.store.execQuery(); if (!silent) instance.emit("filter-change", newFilters); instance.store.updateTableScrollY(); }, toggleAllSelection() { var _a, _b; (_b = (_a = instance.store).toggleAllSelection) == null ? void 0 : _b.call(_a); }, rowSelectedChanged(_states, row) { instance.store.toggleRowSelection(row); instance.store.updateAllSelected(); }, setHoverRow(states, row) { states.hoverRow.value = row; }, setCurrentRow(_states, row) { instance.store.updateCurrentRow(row); } }; const commit = function(name, ...args) { const mutations2 = instance.store.mutations; if (mutations2[name]) mutations2[name].apply(instance, [instance.store.states, ...args]); else throw new Error(`Action not found: ${name}`); }; const updateTableScrollY = function() { nextTick(() => instance.layout.updateScrollY.apply(instance.layout)); }; return { ns, t, ...watcher, mutations, commit, updateTableScrollY }; } const InitialStateMap = { rowKey: "rowKey", defaultExpandAll: "defaultExpandAll", rowExpandable: "rowExpandable", selectOnIndeterminate: "selectOnIndeterminate", indent: "indent", lazy: "lazy", ["treeProps.hasChildren"]: { key: "lazyColumnIdentifier", default: "hasChildren" }, ["treeProps.children"]: { key: "childrenColumnName", default: "children" }, ["treeProps.checkStrictly"]: { key: "checkStrictly", default: false } }; function createStore(table, props2) { if (!table) throw new Error("Table is required."); const store = useStore(); store.toggleAllSelection = debounce(store._toggleAllSelection, 10); Object.keys(InitialStateMap).forEach((key) => { handleValue(getArrKeysValue(props2, key), key, store); }); proxyTableProps(store, props2); return store; } function proxyTableProps(store, props2) { Object.keys(InitialStateMap).forEach((key) => { watch(() => getArrKeysValue(props2, key), (value) => { handleValue(value, key, store); }); }); } function handleValue(value, propsKey, store) { let newVal = value; let storeKey = InitialStateMap[propsKey]; if (isObject(storeKey)) { newVal = newVal || storeKey.default; storeKey = storeKey.key; } store.states[storeKey].value = newVal; } function getArrKeysValue(props2, key) { if (key.includes(".")) { const keyList = key.split("."); let value = props2; keyList.forEach((k) => { value = value[k]; }); return value; } else return props2[key]; } var TableLayout = class { constructor(options) { this.observers = []; this.table = null; this.store = null; this.columns = []; this.fit = true; this.showHeader = true; this.height = ref(null); this.scrollX = ref(false); this.scrollY = ref(false); this.bodyWidth = ref(null); this.fixedWidth = ref(null); this.rightFixedWidth = ref(null); this.gutterWidth = 0; for (const name in options) if (hasOwn(options, name)) if (isRef(this[name])) this[name].value = options[name]; else this[name] = options[name]; if (!this.table) throw new Error("Table is required for Table Layout"); if (!this.store) throw new Error("Store is required for Table Layout"); } updateScrollY() { const height = this.height.value; if (isNull(height)) return false; const scrollBarRef = this.table.refs.scrollBarRef; if (this.table.vnode.el && (scrollBarRef == null ? void 0 : scrollBarRef.wrapRef)) { let scrollY = true; const prevScrollY = this.scrollY.value; scrollY = scrollBarRef.wrapRef.scrollHeight > scrollBarRef.wrapRef.clientHeight; this.scrollY.value = scrollY; return prevScrollY !== scrollY; } return false; } setHeight(value, prop = "height") { if (!isClient) return; const el = this.table.vnode.el; value = parseHeight(value); this.height.value = Number(value); if (!el && (value || value === 0)) { nextTick(() => this.setHeight(value, prop)); return; } if (el && isNumber(value)) { el.style[prop] = `${value}px`; this.updateElsHeight(); } else if (el && isString(value)) { el.style[prop] = value; this.updateElsHeight(); } } setMaxHeight(value) { this.setHeight(value, "max-height"); } getFlattenColumns() { const flattenColumns = []; this.table.store.states.columns.value.forEach((column) => { if (column.isColumnGroup) flattenColumns.push.apply(flattenColumns, column.columns); else flattenColumns.push(column); }); return flattenColumns; } updateElsHeight() { this.updateScrollY(); this.notifyObservers("scrollable"); } headerDisplayNone(elm) { if (!elm) return true; let headerChild = elm; while (headerChild.tagName !== "DIV") { if (getComputedStyle(headerChild).display === "none") return true; headerChild = headerChild.parentElement; } return false; } updateColumnsWidth() { var _a; if (!isClient) return; const fit = this.fit; const bodyWidth = (_a = this.table.vnode.el) == null ? void 0 : _a.clientWidth; let bodyMinWidth = 0; const flattenColumns = this.getFlattenColumns(); const flexColumns = flattenColumns.filter((column) => !isNumber(column.width)); flattenColumns.forEach((column) => { if (isNumber(column.width) && column.realWidth) column.realWidth = null; }); if (flexColumns.length > 0 && fit) { flattenColumns.forEach((column) => { bodyMinWidth += Number(column.width || column.minWidth || 80); }); if (bodyMinWidth <= bodyWidth) { this.scrollX.value = false; const totalFlexWidth = bodyWidth - bodyMinWidth; if (flexColumns.length === 1) flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth; else { const flexWidthPerPixel = totalFlexWidth / flexColumns.reduce((prev, column) => prev + Number(column.minWidth || 80), 0); let noneFirstWidth = 0; flexColumns.forEach((column, index) => { if (index === 0) return; const flexWidth = Math.floor(Number(column.minWidth || 80) * flexWidthPerPixel); noneFirstWidth += flexWidth; column.realWidth = Number(column.minWidth || 80) + flexWidth; }); flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth; } } else { this.scrollX.value = true; flexColumns.forEach((column) => { column.realWidth = Number(column.minWidth); }); } this.bodyWidth.value = Math.max(bodyMinWidth, bodyWidth); this.table.state.resizeState.value.width = this.bodyWidth.value; } else { flattenColumns.forEach((column) => { if (!column.width && !column.minWidth) column.realWidth = 80; else column.realWidth = Number(column.width || column.minWidth); bodyMinWidth += column.realWidth; }); this.scrollX.value = bodyMinWidth > bodyWidth; this.bodyWidth.value = bodyMinWidth; } const fixedColumns = this.store.states.fixedColumns.value; if (fixedColumns.length > 0) { let fixedWidth = 0; fixedColumns.forEach((column) => { fixedWidth += Number(column.realWidth || column.width); }); this.fixedWidth.value = fixedWidth; } const rightFixedColumns = this.store.states.rightFixedColumns.value; if (rightFixedColumns.length > 0) { let rightFixedWidth = 0; rightFixedColumns.forEach((column) => { rightFixedWidth += Number(column.realWidth || column.width); }); this.rightFixedWidth.value = rightFixedWidth; } this.notifyObservers("columns"); } addObserver(observer) { this.observers.push(observer); } removeObserver(observer) { const index = this.observers.indexOf(observer); if (index !== -1) this.observers.splice(index, 1); } notifyObservers(event) { this.observers.forEach((observer) => { var _a, _b; switch (event) { case "columns": (_a = observer.state) == null ? void 0 : _a.onColumnsChange(this); break; case "scrollable": (_b = observer.state) == null ? void 0 : _b.onScrollableChange(this); break; default: throw new Error(`Table Layout don't have event ${event}.`); } }); } }; const TABLE_INJECTION_KEY = Symbol("ElTable"); const getAllColumns = (columns2) => { const result = []; columns2.forEach((column) => { if (column.children) { result.push(column); result.push.apply(result, getAllColumns(column.children)); } else result.push(column); }); return result; }; const convertToRows = (originColumns) => { let maxLevel = 1; const traverse = (column, parent) => { if (parent) { column.level = parent.level + 1; if (maxLevel < column.level) maxLevel = column.level; } if (column.children) { let colSpan = 0; column.children.forEach((subColumn) => { traverse(subColumn, column); colSpan += subColumn.colSpan; }); column.colSpan = colSpan; } else column.colSpan = 1; }; originColumns.forEach((column) => { column.level = 1; traverse(column, void 0); }); const rows = []; for (let i = 0; i < maxLevel; i++) rows.push([]); getAllColumns(originColumns).forEach((column) => { if (!column.children) column.rowSpan = maxLevel - column.level + 1; else { column.rowSpan = 1; column.children.forEach((col) => col.isSubColumn = true); } rows[column.level - 1].push(column); }); return rows; }; function useUtils$1(props2) { const parent = inject(TABLE_INJECTION_KEY); const columnRows = computed(() => { return convertToRows(props2.store.states.originColumns.value); }); const isGroup = computed(() => { const result = columnRows.value.length > 1; if (result && parent) parent.state.isGroup.value = true; return result; }); const toggleAllSelection = (event) => { event.stopPropagation(); parent == null ? void 0 : parent.store.commit("toggleAllSelection"); }; return { isGroup, toggleAllSelection, columnRows }; } var filter_panel_vue_vue_type_script_lang_default = defineComponent({ name: "ElTableFilterPanel", components: { ElCheckbox, ElCheckboxGroup, ElScrollbar, ElTooltip, ElIcon, ArrowDown: arrow_down_default, ArrowUp: arrow_up_default }, props: { placement: { type: String, default: "bottom-start" }, store: { type: Object }, column: { type: Object }, upDataColumn: { type: Function }, appendTo: useTooltipContentProps.appendTo }, setup(props2) { const instance = getCurrentInstance(); const { t } = useLocale(); const ns = useNamespace("table-filter"); const parent = instance == null ? void 0 : instance.parent; if (props2.column && !parent.filterPanels.value[props2.column.id]) parent.filterPanels.value[props2.column.id] = instance; const tooltipRef = ref(null); const rootRef = ref(null); const checkedIndex = ref(0); const filters = computed(() => { return props2.column && props2.column.filters; }); const filterClassName = computed(() => { if (props2.column && props2.column.filterClassName) return `${ns.b()} ${props2.column.filterClassName}`; return ns.b(); }); const filterValue = computed({ get: () => { var _a; return (((_a = props2.column) == null ? void 0 : _a.filteredValue) || [])[0]; }, set: (value) => { if (filteredValue.value) if (!isPropAbsent(value)) filteredValue.value.splice(0, 1, value); else filteredValue.value.splice(0, 1); } }); const filteredValue = computed({ get() { if (props2.column) return props2.column.filteredValue || []; return []; }, set(value) { var _a; if (props2.column) (_a = props2.upDataColumn) == null ? void 0 : _a.call(props2, "filteredValue", value); } }); const multiple = computed(() => { if (props2.column) return props2.column.filterMultiple; return true; }); const isActive = (filter) => { return filter.value === filterValue.value; }; const hidden = () => { var _a; (_a = tooltipRef.value) == null ? void 0 : _a.onClose(); }; const handleConfirm = () => { confirmFilter(filteredValue.value); hidden(); }; const handleReset = () => { filteredValue.value = []; confirmFilter(filteredValue.value); hidden(); }; const handleSelect = (_filterValue, index) => { filterValue.value = _filterValue; checkedIndex.value = index; if (!isPropAbsent(_filterValue)) confirmFilter(filteredValue.value); else confirmFilter([]); hidden(); }; const confirmFilter = (filteredValue2) => { var _a, _b; (_a = props2.store) == null ? void 0 : _a.commit("filterChange", { column: props2.column, values: filteredValue2 }); (_b = props2.store) == null ? void 0 : _b.updateAllSelected(); }; const handleShowTooltip = () => { var _a, _b; (_a = rootRef.value) == null ? void 0 : _a.focus(); !multiple.value && initCheckedIndex(); if (props2.column) (_b = props2.upDataColumn) == null ? void 0 : _b.call(props2, "filterOpened", true); }; const handleHideTooltip = () => { var _a; if (props2.column) (_a = props2.upDataColumn) == null ? void 0 : _a.call(props2, "filterOpened", false); }; const initCheckedIndex = () => { if (isPropAbsent(filterValue)) { checkedIndex.value = 0; return; } const idx = (filters.value || []).findIndex((item) => { return item.value === filterValue.value; }); checkedIndex.value = idx >= 0 ? idx + 1 : 0; }; const handleKeydown = (event) => { var _a, _b; const code = getEventCode(event); const len = (filters.value ? filters.value.length : 0) + 1; let index = checkedIndex.value; let isPreventDefault = true; switch (code) { case EVENT_CODE.down: case EVENT_CODE.right: index = (index + 1) % len; break; case EVENT_CODE.up: case EVENT_CODE.left: index = (index - 1 + len) % len; break; case EVENT_CODE.tab: hidden(); isPreventDefault = false; break; case EVENT_CODE.enter: case EVENT_CODE.space: if (index === 0) handleSelect(null, 0); else { const item = (filters.value || [])[index - 1]; item.value && handleSelect(item.value, index); } break; default: isPreventDefault = false; break; } isPreventDefault && event.preventDefault(); checkedIndex.value = index; (_b = (_a = rootRef.value) == null ? void 0 : _a.querySelector(`.${ns.e("list-item")}:nth-child(${index + 1})`)) == null ? void 0 : _b.focus(); }; return { multiple, filterClassName, filteredValue, filterValue, filters, handleConfirm, handleReset, handleSelect, isPropAbsent, isActive, t, ns, tooltipRef, rootRef, checkedIndex, handleShowTooltip, handleHideTooltip, handleKeydown }; } }); const _hoisted_1$h = ["disabled"]; const _hoisted_2$a = ["tabindex", "aria-checked"]; const _hoisted_3$3 = [ "tabindex", "aria-checked", "onClick" ]; const _hoisted_4$2 = ["aria-label"]; function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_checkbox = resolveComponent("el-checkbox"); const _component_el_checkbox_group = resolveComponent("el-checkbox-group"); const _component_el_scrollbar = resolveComponent("el-scrollbar"); const _component_arrow_up = resolveComponent("arrow-up"); const _component_arrow_down = resolveComponent("arrow-down"); const _component_el_icon = resolveComponent("el-icon"); const _component_el_tooltip = resolveComponent("el-tooltip"); return openBlock(), createBlock(_component_el_tooltip, { ref: "tooltipRef", offset: 0, placement: _ctx.placement, "show-arrow": false, trigger: "click", role: "dialog", teleported: "", effect: "light", pure: "", loop: "", "popper-class": _ctx.filterClassName, persistent: "", "append-to": _ctx.appendTo, onShow: _ctx.handleShowTooltip, onHide: _ctx.handleHideTooltip }, { content: withCtx(() => [_ctx.multiple ? (openBlock(), createElementBlock("div", { key: 0, ref: "rootRef", tabindex: "-1", class: normalizeClass(_ctx.ns.e("multiple")) }, [createBaseVNode("div", { class: normalizeClass(_ctx.ns.e("content")) }, [createVNode(_component_el_scrollbar, { "wrap-class": _ctx.ns.e("wrap") }, { default: withCtx(() => [createVNode(_component_el_checkbox_group, { modelValue: _ctx.filteredValue, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.filteredValue = $event), class: normalizeClass(_ctx.ns.e("checkbox-group")) }, { default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filters, (filter) => { return openBlock(), createBlock(_component_el_checkbox, { key: filter.value, value: filter.value }, { default: withCtx(() => [createTextVNode(toDisplayString(filter.text), 1)]), _: 2 }, 1032, ["value"]); }), 128))]), _: 1 }, 8, ["modelValue", "class"])]), _: 1 }, 8, ["wrap-class"])], 2), createBaseVNode("div", { class: normalizeClass(_ctx.ns.e("bottom")) }, [createBaseVNode("button", { class: normalizeClass(_ctx.ns.is("disabled", _ctx.filteredValue.length === 0)), disabled: _ctx.filteredValue.length === 0, type: "button", onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleConfirm && _ctx.handleConfirm(...args)) }, toDisplayString(_ctx.t("el.table.confirmFilter")), 11, _hoisted_1$h), createBaseVNode("button", { type: "button", onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleReset && _ctx.handleReset(...args)) }, toDisplayString(_ctx.t("el.table.resetFilter")), 1)], 2)], 2)) : (openBlock(), createElementBlock("ul", { key: 1, ref: "rootRef", tabindex: "-1", role: "radiogroup", class: normalizeClass(_ctx.ns.e("list")), onKeydown: _cache[4] || (_cache[4] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args)) }, [createBaseVNode("li", { role: "radio", class: normalizeClass([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isPropAbsent(_ctx.filterValue))]), tabindex: _ctx.checkedIndex === 0 ? 0 : -1, "aria-checked": _ctx.isPropAbsent(_ctx.filterValue), onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleSelect(null, 0)) }, toDisplayString(_ctx.t("el.table.clearFilter")), 11, _hoisted_2$a), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filters, (filter, idx) => { return openBlock(), createElementBlock("li", { key: filter.value, role: "radio", class: normalizeClass([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isActive(filter))]), tabindex: _ctx.checkedIndex === idx + 1 ? 0 : -1, "aria-checked": _ctx.isActive(filter), onClick: ($event) => _ctx.handleSelect(filter.value, idx + 1) }, toDisplayString(filter.text), 11, _hoisted_3$3); }), 128))], 34))]), default: withCtx(() => { var _a; return [createBaseVNode("button", { type: "button", class: normalizeClass(`${_ctx.ns.namespace.value}-table__column-filter-trigger`), "aria-label": _ctx.t("el.table.filterLabel", { column: ((_a = _ctx.column) == null ? void 0 : _a.label) || "" }) }, [createVNode(_component_el_icon, null, { default: withCtx(() => [renderSlot(_ctx.$slots, "filter-icon", {}, () => { var _a2; return [((_a2 = _ctx.column) == null ? void 0 : _a2.filterOpened) ? (openBlock(), createBlock(_component_arrow_up, { key: 0 })) : (openBlock(), createBlock(_component_arrow_down, { key: 1 }))]; })]), _: 3 })], 10, _hoisted_4$2)]; }), _: 3 }, 8, [ "placement", "popper-class", "append-to", "onShow", "onHide" ]); } var filter_panel_default = /* @__PURE__ */ _plugin_vue_export_helper_default(filter_panel_vue_vue_type_script_lang_default, [["render", _sfc_render$4]]); function useLayoutObserver(root) { const instance = getCurrentInstance(); onBeforeMount(() => { tableLayout.value.addObserver(instance); }); onMounted(() => { onColumnsChange(tableLayout.value); onScrollableChange(tableLayout.value); }); onUpdated(() => { onColumnsChange(tableLayout.value); onScrollableChange(tableLayout.value); }); onUnmounted(() => { tableLayout.value.removeObserver(instance); }); const tableLayout = computed(() => { const layout2 = root.layout; if (!layout2) throw new Error("Can not find table layout."); return layout2; }); const onColumnsChange = (layout2) => { var _a; const cols = ((_a = root.vnode.el) == null ? void 0 : _a.querySelectorAll("colgroup > col")) || []; if (!cols.length) return; const flattenColumns = layout2.getFlattenColumns(); const columnsMap = {}; flattenColumns.forEach((column) => { columnsMap[column.id] = column; }); for (let i = 0, j = cols.length; i < j; i++) { const col = cols[i]; const column = columnsMap[col.getAttribute("name")]; if (column) col.setAttribute("width", column.realWidth || column.width); } }; const onScrollableChange = (layout2) => { var _a, _b; const cols = ((_a = root.vnode.el) == null ? void 0 : _a.querySelectorAll("colgroup > col[name=gutter]")) || []; for (let i = 0, j = cols.length; i < j; i++) cols[i].setAttribute("width", layout2.scrollY.value ? layout2.gutterWidth : "0"); const ths = ((_b = root.vnode.el) == null ? void 0 : _b.querySelectorAll("th.gutter")) || []; for (let i = 0, j = ths.length; i < j; i++) { const th = ths[i]; th.style.width = layout2.scrollY.value ? `${layout2.gutterWidth}px` : "0"; th.style.display = layout2.scrollY.value ? "" : "none"; } }; return { tableLayout: tableLayout.value, onColumnsChange, onScrollableChange }; } function useEvent(props2, emit) { const instance = getCurrentInstance(); const parent = inject(TABLE_INJECTION_KEY); const handleFilterClick = (event) => { event.stopPropagation(); }; const handleHeaderClick = (event, column) => { if (!column.filters && column.sortable) handleSortClick(event, column, false); else if (column.filterable && !column.sortable) handleFilterClick(event); parent == null ? void 0 : parent.emit("header-click", column, event); }; const handleHeaderContextMenu = (event, column) => { parent == null ? void 0 : parent.emit("header-contextmenu", column, event); }; const draggingColumn = ref(null); const dragging = ref(false); const dragState = ref(); const handleMouseDown = (event, column) => { var _a, _b, _c; if (!isClient) return; if (column.children && column.children.length > 0) return; if (draggingColumn.value && props2.border && draggingColumn.value.id === column.id) { dragging.value = true; const table = parent; emit("set-drag-visible", true); const tableLeft = (_a = table == null ? void 0 : table.vnode.el) == null ? void 0 : _a.getBoundingClientRect().left; const columnEl = (_c = (_b = instance == null ? void 0 : instance.vnode) == null ? void 0 : _b.el) == null ? void 0 : _c.querySelector(`th.${column.id}`); const columnRect = columnEl.getBoundingClientRect(); const minLeft = columnRect.left - tableLeft + 30; addClass(columnEl, "noclick"); dragState.value = { startMouseLeft: event.clientX, startLeft: columnRect.right - tableLeft, startColumnLeft: columnRect.left - tableLeft, tableLeft }; const resizeProxy = table == null ? void 0 : table.refs.resizeProxy; resizeProxy.style.left = `${dragState.value.startLeft}px`; document.onselectstart = function() { return false; }; document.ondragstart = function() { return false; }; const handleMouseMove2 = (event2) => { const deltaLeft = event2.clientX - dragState.value.startMouseLeft; const proxyLeft = dragState.value.startLeft + deltaLeft; resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`; }; const handleMouseUp = () => { if (dragging.value) { const { startColumnLeft, startLeft } = dragState.value; column.width = column.realWidth = Number.parseInt(resizeProxy.style.left, 10) - startColumnLeft; table == null ? void 0 : table.emit("header-dragend", column.width, startLeft - startColumnLeft, column, event); requestAnimationFrame(() => { props2.store.scheduleLayout(false, true); }); document.body.style.cursor = ""; dragging.value = false; draggingColumn.value = null; dragState.value = void 0; emit("set-drag-visible", false); } document.removeEventListener("mousemove", handleMouseMove2); document.removeEventListener("mouseup", handleMouseUp); document.onselectstart = null; document.ondragstart = null; setTimeout(() => { removeClass(columnEl, "noclick"); }, 0); }; document.addEventListener("mousemove", handleMouseMove2); document.addEventListener("mouseup", handleMouseUp); } }; const handleMouseMove = (event, column) => { var _a; if (!props2.border || column.children && column.children.length > 0) return; const el = event.target; const target = isElement(el) ? el.closest("th") : null; if (!target) return; const isSortable = hasClass(target, "is-sortable"); if (isSortable) { const cursor2 = dragging.value ? "col-resize" : ""; target.style.cursor = cursor2; const caret = target.querySelector(".caret-wrapper"); if (caret) caret.style.cursor = cursor2; } if (!column.resizable || dragging.value) { draggingColumn.value = null; return; } const rect = target.getBoundingClientRect(); const isLastTh = ((_a = target.parentNode) == null ? void 0 : _a.lastElementChild) === target; const allowDrag = props2.allowDragLastColumn || !isLastTh; const isResizeHandleActive = rect.width > 12 && rect.right - event.clientX < 8 && allowDrag; const cursor = isResizeHandleActive ? "col-resize" : ""; document.body.style.cursor = cursor; draggingColumn.value = isResizeHandleActive ? column : null; if (isSortable) target.style.cursor = cursor; }; const handleMouseOut = () => { if (!isClient || dragging.value) return; document.body.style.cursor = ""; }; const toggleOrder = ({ order, sortOrders }) => { if (order === "") return sortOrders[0]; const index = sortOrders.indexOf(order || null); return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1]; }; const handleSortClick = (event, column, givenOrder) => { var _a; event.stopPropagation(); const order = column.order === givenOrder ? null : givenOrder || toggleOrder(column); const target = (_a = event.target) == null ? void 0 : _a.closest("th"); if (target) { if (hasClass(target, "noclick")) { removeClass(target, "noclick"); return; } } if (!column.sortable) return; const clickTarget = event.currentTarget; if (["ascending", "descending"].some((str) => hasClass(clickTarget, str) && !column.sortOrders.includes(str))) return; const states = props2.store.states; let sortProp = states.sortProp.value; let sortOrder; const sortingColumn = states.sortingColumn.value; if (sortingColumn !== column || sortingColumn === column && isNull(sortingColumn.order)) { if (sortingColumn) sortingColumn.order = null; states.sortingColumn.value = column; sortProp = column.property; } if (!order) sortOrder = column.order = null; else sortOrder = column.order = order; states.sortProp.value = sortProp; states.sortOrder.value = sortOrder; parent == null ? void 0 : parent.store.commit("changeSortCondition"); }; return { handleHeaderClick, handleHeaderContextMenu, handleMouseDown, handleMouseMove, handleMouseOut, handleSortClick, handleFilterClick }; } function useStyle$2(props2) { const parent = inject(TABLE_INJECTION_KEY); const ns = useNamespace("table"); const getHeaderRowStyle = (rowIndex) => { const headerRowStyle = parent == null ? void 0 : parent.props.headerRowStyle; if (isFunction(headerRowStyle)) return headerRowStyle.call(null, { rowIndex }); return headerRowStyle; }; const getHeaderRowClass = (rowIndex) => { const classes = []; const headerRowClassName = parent == null ? void 0 : parent.props.headerRowClassName; if (isString(headerRowClassName)) classes.push(headerRowClassName); else if (isFunction(headerRowClassName)) classes.push(headerRowClassName.call(null, { rowIndex })); return classes.join(" "); }; const getHeaderCellStyle = (rowIndex, columnIndex, row, column) => { let headerCellStyles = (parent == null ? void 0 : parent.props.headerCellStyle) ?? {}; if (isFunction(headerCellStyles)) headerCellStyles = headerCellStyles.call(null, { rowIndex, columnIndex, row, column }); const fixedStyle = getFixedColumnOffset(columnIndex, column.fixed, props2.store, row); ensurePosition(fixedStyle, "left"); ensurePosition(fixedStyle, "right"); return Object.assign({}, headerCellStyles, fixedStyle); }; const getHeaderCellClass = (rowIndex, columnIndex, row, column) => { const fixedClasses = getFixedColumnsClass(ns.b(), columnIndex, column.fixed, props2.store, row); const classes = [ column.id, column.order, column.headerAlign, column.className, column.labelClassName, ...fixedClasses ]; if (!column.children) classes.push("is-leaf"); if (column.sortable) classes.push("is-sortable"); const headerCellClassName = parent == null ? void 0 : parent.props.headerCellClassName; if (isString(headerCellClassName)) classes.push(headerCellClassName); else if (isFunction(headerCellClassName)) classes.push(headerCellClassName.call(null, { rowIndex, columnIndex, row, column })); classes.push(ns.e("cell")); return classes.filter((className) => Boolean(className)).join(" "); }; return { getHeaderRowStyle, getHeaderRowClass, getHeaderCellStyle, getHeaderCellClass }; } var table_header_default = defineComponent({ name: "ElTableHeader", components: { ElCheckbox }, props: { fixed: { type: String, default: "" }, store: { required: true, type: Object }, border: Boolean, defaultSort: { type: Object, default: () => { return { prop: "", order: "" }; } }, appendFilterPanelTo: { type: String }, allowDragLastColumn: { type: Boolean } }, setup(props2, { emit }) { const instance = getCurrentInstance(); const parent = inject(TABLE_INJECTION_KEY); const ns = useNamespace("table"); const filterPanels = ref({}); const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent); const isTableLayoutAuto = (parent == null ? void 0 : parent.props.tableLayout) === "auto"; const saveIndexSelection = reactive(/* @__PURE__ */ new Map()); const theadRef = ref(); let delayId; const updateFixedColumnStyle = () => { delayId = setTimeout(() => { if (saveIndexSelection.size > 0) { saveIndexSelection.forEach((column, key) => { const el = theadRef.value.querySelector(`.${key.replace(/\s/g, ".")}`); if (el) column.width = el.getBoundingClientRect().width || column.width; }); saveIndexSelection.clear(); } }); }; watch(saveIndexSelection, updateFixedColumnStyle); onBeforeUnmount(() => { if (delayId) { clearTimeout(delayId); delayId = void 0; } }); onMounted(async () => { await nextTick(); await nextTick(); const { prop, order } = props2.defaultSort; parent == null ? void 0 : parent.store.commit("sort", { prop, order, init: true }); updateFixedColumnStyle(); }); const { handleHeaderClick, handleHeaderContextMenu, handleMouseDown, handleMouseMove, handleMouseOut, handleSortClick, handleFilterClick } = useEvent(props2, emit); const { getHeaderRowStyle, getHeaderRowClass, getHeaderCellStyle, getHeaderCellClass } = useStyle$2(props2); const { isGroup, toggleAllSelection, columnRows } = useUtils$1(props2); const { t } = useLocale(); instance.state = { onColumnsChange, onScrollableChange }; instance.filterPanels = filterPanels; return { ns, t, filterPanels, onColumnsChange, onScrollableChange, columnRows, getHeaderRowClass, getHeaderRowStyle, getHeaderCellClass, getHeaderCellStyle, handleHeaderClick, handleHeaderContextMenu, handleMouseDown, handleMouseMove, handleMouseOut, handleSortClick, handleFilterClick, isGroup, toggleAllSelection, saveIndexSelection, isTableLayoutAuto, theadRef, updateFixedColumnStyle }; }, render() { const { ns, t, isGroup, columnRows, getHeaderCellStyle, getHeaderCellClass, getHeaderRowClass, getHeaderRowStyle, handleHeaderClick, handleHeaderContextMenu, handleMouseDown, handleMouseMove, handleSortClick, handleMouseOut, store, $parent, saveIndexSelection, isTableLayoutAuto } = this; let rowSpan = 1; return h("thead", { ref: "theadRef", class: ns.is("group", isGroup) }, columnRows.map((subColumns, rowIndex) => h("tr", { class: getHeaderRowClass(rowIndex), key: rowIndex, style: getHeaderRowStyle(rowIndex) }, subColumns.map((column, cellIndex) => { if (column.rowSpan > rowSpan) rowSpan = column.rowSpan; const _class = getHeaderCellClass(rowIndex, cellIndex, subColumns, column); if (isTableLayoutAuto && column.fixed) saveIndexSelection.set(_class, column); return h("th", { class: _class, colspan: column.colSpan, key: `${column.id}-thead`, rowspan: column.rowSpan, scope: column.colSpan > 1 ? "colgroup" : "col", ariaSort: column.sortable ? column.order : void 0, style: getHeaderCellStyle(rowIndex, cellIndex, subColumns, column), onClick: ($event) => { var _a; if ((_a = $event.currentTarget) == null ? void 0 : _a.classList.contains("noclick")) return; handleHeaderClick($event, column); }, onContextmenu: ($event) => handleHeaderContextMenu($event, column), onMousedown: ($event) => handleMouseDown($event, column), onMousemove: ($event) => handleMouseMove($event, column), onMouseout: handleMouseOut }, [h("div", { class: ["cell", column.filteredValue && column.filteredValue.length > 0 ? "highlight" : ""] }, [ column.renderHeader ? column.renderHeader({ column, $index: cellIndex, store, _self: $parent }) : column.label, column.sortable && h("button", { type: "button", class: "caret-wrapper", "aria-label": t("el.table.sortLabel", { column: column.label || "" }), onClick: ($event) => handleSortClick($event, column) }, [h("i", { onClick: ($event) => handleSortClick($event, column, "ascending"), class: "sort-caret ascending" }), h("i", { onClick: ($event) => handleSortClick($event, column, "descending"), class: "sort-caret descending" })]), column.filterable && h(filter_panel_default, { store, placement: column.filterPlacement || "bottom-start", appendTo: $parent == null ? void 0 : $parent.appendFilterPanelTo, column, upDataColumn: (key, value) => { column[key] = value; } }, { "filter-icon": () => column.renderFilterIcon ? column.renderFilterIcon({ filterOpened: column.filterOpened }) : null }) ])]); })))); } }); function useEvents(props2) { const parent = inject(TABLE_INJECTION_KEY); const tooltipContent = ref(""); const tooltipTrigger = ref(h("div")); const handleEvent = (event, row, name) => { var _a, _b; const table = parent; const cell = getCell(event); let column = null; const namespace = (_a = table == null ? void 0 : table.vnode.el) == null ? void 0 : _a.dataset.prefix; if (cell) { column = getColumnByCell({ columns: ((_b = props2.store) == null ? void 0 : _b.states.columns.value) ?? [] }, cell, namespace); if (column) table == null ? void 0 : table.emit(`cell-${name}`, row, column, cell, event); } table == null ? void 0 : table.emit(`row-${name}`, row, column, event); }; const handleDoubleClick = (event, row) => { handleEvent(event, row, "dblclick"); }; const handleClick = (event, row) => { var _a; (_a = props2.store) == null ? void 0 : _a.commit("setCurrentRow", row); handleEvent(event, row, "click"); }; const handleContextMenu = (event, row) => { handleEvent(event, row, "contextmenu"); }; const handleMouseEnter = debounce((index) => { var _a; (_a = props2.store) == null ? void 0 : _a.commit("setHoverRow", index); }, 30); const handleMouseLeave = debounce(() => { var _a; (_a = props2.store) == null ? void 0 : _a.commit("setHoverRow", null); }, 30); const getPadding = (el) => { const style = window.getComputedStyle(el, null); return { left: Number.parseInt(style.paddingLeft, 10) || 0, right: Number.parseInt(style.paddingRight, 10) || 0, top: Number.parseInt(style.paddingTop, 10) || 0, bottom: Number.parseInt(style.paddingBottom, 10) || 0 }; }; const toggleRowClassByCell = (rowSpan, event, toggle) => { var _a; let node = (_a = event == null ? void 0 : event.target) == null ? void 0 : _a.parentNode; while (rowSpan > 1) { node = node == null ? void 0 : node.nextSibling; if (!node || node.nodeName !== "TR") break; toggle(node, "hover-row hover-fixed-row"); rowSpan--; } }; const handleCellMouseEnter = (event, row, tooltipOptions) => { var _a, _b, _c; if (!parent) return; const table = parent; const cell = getCell(event); const namespace = (_a = table == null ? void 0 : table.vnode.el) == null ? void 0 : _a.dataset.prefix; let column = null; if (cell) { column = getColumnByCell({ columns: ((_b = props2.store) == null ? void 0 : _b.states.columns.value) ?? [] }, cell, namespace); if (!column) return; if (cell.rowSpan > 1) toggleRowClassByCell(cell.rowSpan, event, addClass); const hoverState = table.hoverState = { cell, column, row }; table == null ? void 0 : table.emit("cell-mouse-enter", hoverState.row, hoverState.column, hoverState.cell, event); } if (!tooltipOptions) { if ((removePopper == null ? void 0 : removePopper.trigger) === cell) removePopper == null ? void 0 : removePopper(); return; } const cellChild = event.target.querySelector(".cell"); if (!(hasClass(cellChild, `${namespace}-tooltip`) && cellChild.childNodes.length && ((_c = cellChild.textContent) == null ? void 0 : _c.trim()))) return; const range = document.createRange(); range.setStart(cellChild, 0); range.setEnd(cellChild, cellChild.childNodes.length); const { width: rangeWidth, height: rangeHeight } = range.getBoundingClientRect(); const { width: cellChildWidth, height: cellChildHeight } = cellChild.getBoundingClientRect(); const { top, left, right, bottom } = getPadding(cellChild); const horizontalPadding = left + right; const verticalPadding = top + bottom; if (isGreaterThan(rangeWidth + horizontalPadding, cellChildWidth) || isGreaterThan(rangeHeight + verticalPadding, cellChildHeight) || isGreaterThan(cellChild.scrollWidth, cellChildWidth)) createTablePopper(tooltipOptions, ((cell == null ? void 0 : cell.innerText) || (cell == null ? void 0 : cell.textContent)) ?? "", row, column, cell, table); else if ((removePopper == null ? void 0 : removePopper.trigger) === cell) removePopper == null ? void 0 : removePopper(); }; const handleCellMouseLeave = (event) => { const cell = getCell(event); if (!cell) return; if (cell.rowSpan > 1) toggleRowClassByCell(cell.rowSpan, event, removeClass); const oldHoverState = parent == null ? void 0 : parent.hoverState; parent == null ? void 0 : parent.emit("cell-mouse-leave", oldHoverState == null ? void 0 : oldHoverState.row, oldHoverState == null ? void 0 : oldHoverState.column, oldHoverState == null ? void 0 : oldHoverState.cell, event); }; return { handleDoubleClick, handleClick, handleContextMenu, handleMouseEnter, handleMouseLeave, handleCellMouseEnter, handleCellMouseLeave, tooltipContent, tooltipTrigger }; } function useStyles$1(props2) { const parent = inject(TABLE_INJECTION_KEY); const ns = useNamespace("table"); const getRowStyle = (row, rowIndex) => { const rowStyle = parent == null ? void 0 : parent.props.rowStyle; if (isFunction(rowStyle)) return rowStyle.call(null, { row, rowIndex }); return rowStyle || null; }; const getRowClass = (row, rowIndex, displayIndex) => { var _a; const classes = [ns.e("row")]; if ((parent == null ? void 0 : parent.props.highlightCurrentRow) && row === ((_a = props2.store) == null ? void 0 : _a.states.currentRow.value)) classes.push("current-row"); if (props2.stripe && displayIndex % 2 === 1) classes.push(ns.em("row", "striped")); const rowClassName = parent == null ? void 0 : parent.props.rowClassName; if (isString(rowClassName)) classes.push(rowClassName); else if (isFunction(rowClassName)) classes.push(rowClassName.call(null, { row, rowIndex })); return classes; }; const getCellStyle = (rowIndex, columnIndex, row, column) => { const cellStyle = parent == null ? void 0 : parent.props.cellStyle; let cellStyles = cellStyle ?? {}; if (isFunction(cellStyle)) cellStyles = cellStyle.call(null, { rowIndex, columnIndex, row, column }); const fixedStyle = getFixedColumnOffset(columnIndex, props2 == null ? void 0 : props2.fixed, props2.store); ensurePosition(fixedStyle, "left"); ensurePosition(fixedStyle, "right"); return Object.assign({}, cellStyles, fixedStyle); }; const getCellClass = (rowIndex, columnIndex, row, column, offset2) => { const fixedClasses = getFixedColumnsClass(ns.b(), columnIndex, props2 == null ? void 0 : props2.fixed, props2.store, void 0, offset2); const classes = [ column.id, column.align, column.className, ...fixedClasses ]; const cellClassName = parent == null ? void 0 : parent.props.cellClassName; if (isString(cellClassName)) classes.push(cellClassName); else if (isFunction(cellClassName)) classes.push(cellClassName.call(null, { rowIndex, columnIndex, row, column })); classes.push(ns.e("cell")); return classes.filter((className) => Boolean(className)).join(" "); }; const getSpan = (row, column, rowIndex, columnIndex) => { let rowspan = 1; let colspan = 1; const fn = parent == null ? void 0 : parent.props.spanMethod; if (isFunction(fn)) { const result = fn({ row, column, rowIndex, columnIndex }); if (isArray(result)) { rowspan = result[0]; colspan = result[1]; } else if (isObject(result)) { rowspan = result.rowspan; colspan = result.colspan; } } return { rowspan, colspan }; }; const getColspanRealWidth = (columns2, colspan, index) => { if (colspan < 1) return columns2[index].realWidth; const widthArr = columns2.map(({ realWidth, width }) => realWidth || width).slice(index, index + colspan); return Number(widthArr.reduce((acc, width) => Number(acc) + Number(width), -1)); }; return { getRowStyle, getRowClass, getCellStyle, getCellClass, getSpan, getColspanRealWidth }; } const _hoisted_1$g = ["colspan", "rowspan"]; var td_wrapper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "TableTdWrapper", __name: "td-wrapper", props: { colspan: { type: Number, default: 1 }, rowspan: { type: Number, default: 1 } }, setup(__props) { return (_ctx, _cache) => { return openBlock(), createElementBlock("td", { colspan: __props.colspan, rowspan: __props.rowspan }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$g); }; } }); var td_wrapper_default = td_wrapper_vue_vue_type_script_setup_true_lang_default; function useRender$1(props2) { const parent = inject(TABLE_INJECTION_KEY); const ns = useNamespace("table"); const { handleDoubleClick, handleClick, handleContextMenu, handleMouseEnter, handleMouseLeave, handleCellMouseEnter, handleCellMouseLeave, tooltipContent, tooltipTrigger } = useEvents(props2); const { getRowStyle, getRowClass, getCellStyle, getCellClass, getSpan, getColspanRealWidth } = useStyles$1(props2); let displayIndex = -1; const firstDefaultColumnIndex = computed(() => { var _a; return (_a = props2.store) == null ? void 0 : _a.states.columns.value.findIndex(({ type }) => type === "default"); }); const getKeyOfRow = (row, index) => { var _a; const rowKey2 = (_a = parent == null ? void 0 : parent.props) == null ? void 0 : _a.rowKey; if (rowKey2) return getRowIdentity(row, rowKey2); return index; }; const rowRender = (row, $index, treeRowData, expanded = false) => { const { tooltipEffect, tooltipOptions, store } = props2; const { indent, columns: columns2 } = store.states; const rowClasses = []; let display = true; if (treeRowData) { rowClasses.push(ns.em("row", `level-${treeRowData.level}`)); display = !!treeRowData.display; } if ($index === 0) displayIndex = -1; if (props2.stripe && display) displayIndex++; rowClasses.push(...getRowClass(row, $index, displayIndex)); return h("tr", { style: [display ? null : { display: "none" }, getRowStyle(row, $index)], class: rowClasses, key: getKeyOfRow(row, $index), onDblclick: ($event) => handleDoubleClick($event, row), onClick: ($event) => handleClick($event, row), onContextmenu: ($event) => handleContextMenu($event, row), onMouseenter: () => handleMouseEnter($index), onMouseleave: handleMouseLeave }, columns2.value.map((column, cellIndex) => { const { rowspan, colspan } = getSpan(row, column, $index, cellIndex); if (!rowspan || !colspan) return null; const columnData = Object.assign({}, column); columnData.realWidth = getColspanRealWidth(columns2.value, colspan, cellIndex); const data = { store, _self: props2.context || parent, column: columnData, row, $index, cellIndex, expanded }; if (cellIndex === firstDefaultColumnIndex.value && treeRowData) { data.treeNode = { indent: treeRowData.level && treeRowData.level * indent.value, level: treeRowData.level }; if (isBoolean(treeRowData.expanded)) { data.treeNode.expanded = treeRowData.expanded; if ("loading" in treeRowData) data.treeNode.loading = treeRowData.loading; if ("noLazyChildren" in treeRowData) data.treeNode.noLazyChildren = treeRowData.noLazyChildren; } } const baseKey = `${getKeyOfRow(row, $index)},${cellIndex}`; const patchKey = columnData.columnKey || columnData.rawColumnKey || ""; const mergedTooltipOptions = column.showOverflowTooltip && merge({ effect: tooltipEffect }, tooltipOptions, column.showOverflowTooltip); return h(td_wrapper_default, { style: getCellStyle($index, cellIndex, row, column), class: getCellClass($index, cellIndex, row, column, colspan - 1), key: `${patchKey}${baseKey}`, rowspan, colspan, onMouseenter: ($event) => handleCellMouseEnter($event, row, mergedTooltipOptions), onMouseleave: handleCellMouseLeave }, { default: () => cellChildren(cellIndex, column, data) }); })); }; const cellChildren = (_cellIndex, column, data) => { return column.renderCell(data); }; const wrappedRowRender = (row, $index) => { const store = props2.store; const { isRowExpanded, assertRowKey } = store; const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey: rowKey2 } = store.states; const columns2 = store.states.columns.value; if (columns2.some(({ type }) => type === "expand")) { const expanded = isRowExpanded(row); const tr = rowRender(row, $index, void 0, expanded); const renderExpanded = parent == null ? void 0 : parent.renderExpanded; if (!renderExpanded) { console.error("[Element Error]renderExpanded is required."); return tr; } const rows = [[tr]]; if (parent.props.preserveExpandedContent || expanded) rows[0].push(h("tr", { key: `expanded-row__${tr.key}`, style: { display: expanded ? "" : "none" } }, [h("td", { colspan: columns2.length, class: `${ns.e("cell")} ${ns.e("expanded-cell")}` }, [renderExpanded({ row, $index, store, expanded })])])); return rows; } else if (Object.keys(treeData.value).length) { assertRowKey(); const key = getRowIdentity(row, rowKey2.value); let cur = treeData.value[key]; let treeRowData = null; if (cur) { treeRowData = { expanded: cur.expanded, level: cur.level, display: true, noLazyChildren: void 0, loading: void 0 }; if (isBoolean(cur.lazy)) { if (treeRowData && isBoolean(cur.loaded) && cur.loaded) treeRowData.noLazyChildren = !(cur.children && cur.children.length); treeRowData.loading = cur.loading; } } const tmp = [rowRender(row, $index, treeRowData ?? void 0)]; if (cur) { let i = 0; const traverse = (children, parent2) => { if (!(children && children.length && parent2)) return; children.forEach((node) => { const innerTreeRowData = { display: parent2.display && parent2.expanded, level: parent2.level + 1, expanded: false, noLazyChildren: false, loading: false }; const childKey = getRowIdentity(node, rowKey2.value); if (isPropAbsent(childKey)) throw new Error("For nested data item, row-key is required."); cur = { ...treeData.value[childKey] }; if (cur) { innerTreeRowData.expanded = cur.expanded; cur.level = cur.level || innerTreeRowData.level; cur.display = !!(cur.expanded && innerTreeRowData.display); if (isBoolean(cur.lazy)) { if (isBoolean(cur.loaded) && cur.loaded) innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length); innerTreeRowData.loading = cur.loading; } } i++; tmp.push(rowRender(node, $index + i, innerTreeRowData)); if (cur) traverse(lazyTreeNodeMap.value[childKey] || node[childrenColumnName.value], cur); }); }; cur.display = true; traverse(lazyTreeNodeMap.value[key] || row[childrenColumnName.value], cur); } return tmp; } else return rowRender(row, $index, void 0); }; return { wrappedRowRender, tooltipContent, tooltipTrigger }; } const defaultProps$1 = { store: { required: true, type: Object }, stripe: Boolean, tooltipEffect: String, tooltipOptions: { type: Object }, context: { default: () => ({}), type: Object }, rowClassName: [String, Function], rowStyle: [Object, Function], fixed: { type: String, default: "" }, highlight: Boolean }; var table_body_default = defineComponent({ name: "ElTableBody", props: defaultProps$1, setup(props2) { var _a; const instance = getCurrentInstance(); const parent = inject(TABLE_INJECTION_KEY); const ns = useNamespace("table"); const { wrappedRowRender, tooltipContent, tooltipTrigger } = useRender$1(props2); const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent); const hoveredCellList = []; watch((_a = props2.store) == null ? void 0 : _a.states.hoverRow, (newVal, oldVal) => { var _a2, _b; const el = instance == null ? void 0 : instance.vnode.el; const rows = Array.from((el == null ? void 0 : el.children) || []).filter((e) => e == null ? void 0 : e.classList.contains(`${ns.e("row")}`)); let rowNum = newVal; const childNodes = (_a2 = rows[rowNum]) == null ? void 0 : _a2.childNodes; if (childNodes == null ? void 0 : childNodes.length) { let control = 0; Array.from(childNodes).reduce((acc, item, index) => { var _a3, _b2; if (((_a3 = childNodes[index]) == null ? void 0 : _a3.colSpan) > 1) control = (_b2 = childNodes[index]) == null ? void 0 : _b2.colSpan; if (item.nodeName !== "TD" && control === 0) acc.push(index); control > 0 && control--; return acc; }, []).forEach((rowIndex) => { var _a3; rowNum = newVal; while (rowNum > 0) { const preChildNodes = (_a3 = rows[rowNum - 1]) == null ? void 0 : _a3.childNodes; if (preChildNodes[rowIndex] && preChildNodes[rowIndex].nodeName === "TD" && preChildNodes[rowIndex].rowSpan > 1) { addClass(preChildNodes[rowIndex], "hover-cell"); hoveredCellList.push(preChildNodes[rowIndex]); break; } rowNum--; } }); } else { hoveredCellList.forEach((item) => removeClass(item, "hover-cell")); hoveredCellList.length = 0; } if (!((_b = props2.store) == null ? void 0 : _b.states.isComplex.value) || !isClient) return; rAF(() => { const oldRow = rows[oldVal]; const newRow = rows[newVal]; if (oldRow && !oldRow.classList.contains("hover-fixed-row")) removeClass(oldRow, "hover-row"); if (newRow) addClass(newRow, "hover-row"); }); }); onUnmounted(() => { removePopper == null ? void 0 : removePopper(); }); return { ns, onColumnsChange, onScrollableChange, wrappedRowRender, tooltipContent, tooltipTrigger }; }, render() { const { wrappedRowRender, store } = this; return h("tbody", { tabIndex: -1 }, [((store == null ? void 0 : store.states.data.value) || []).reduce((acc, row) => { return acc.concat(wrappedRowRender(row, acc.length)); }, [])]); } }); function useMapState() { var _a; const store = (_a = inject(TABLE_INJECTION_KEY)) == null ? void 0 : _a.store; return { leftFixedLeafCount: computed(() => { return (store == null ? void 0 : store.states.fixedLeafColumnsLength.value) ?? 0; }), rightFixedLeafCount: computed(() => { return (store == null ? void 0 : store.states.rightFixedColumns.value.length) ?? 0; }), columnsCount: computed(() => { return (store == null ? void 0 : store.states.columns.value.length) ?? 0; }), leftFixedCount: computed(() => { return (store == null ? void 0 : store.states.fixedColumns.value.length) ?? 0; }), rightFixedCount: computed(() => { return (store == null ? void 0 : store.states.rightFixedColumns.value.length) ?? 0; }), columns: computed(() => (store == null ? void 0 : store.states.columns.value) ?? []) }; } function useStyle$1(props2) { const { columns: columns2 } = useMapState(); const ns = useNamespace("table"); const getCellClasses = (columns3, cellIndex) => { const column = columns3[cellIndex]; const classes = [ ns.e("cell"), column.id, column.align, column.labelClassName, ...getFixedColumnsClass(ns.b(), cellIndex, column.fixed, props2.store) ]; if (column.className) classes.push(column.className); if (!column.children) classes.push(ns.is("leaf")); return classes; }; const getCellStyles = (column, cellIndex) => { const fixedStyle = getFixedColumnOffset(cellIndex, column.fixed, props2.store); ensurePosition(fixedStyle, "left"); ensurePosition(fixedStyle, "right"); return fixedStyle; }; return { getCellClasses, getCellStyles, columns: columns2 }; } var table_footer_default = defineComponent({ name: "ElTableFooter", props: { fixed: { type: String, default: "" }, store: { required: true, type: Object }, summaryMethod: Function, sumText: String, border: Boolean, defaultSort: { type: Object, default: () => { return { prop: "", order: "" }; } } }, setup(props2) { const parent = inject(TABLE_INJECTION_KEY); const ns = useNamespace("table"); const { getCellClasses, getCellStyles, columns: columns2 } = useStyle$1(props2); const { onScrollableChange, onColumnsChange } = useLayoutObserver(parent); return { ns, onScrollableChange, onColumnsChange, getCellClasses, getCellStyles, columns: columns2 }; }, render() { const { columns: columns2, getCellStyles, getCellClasses, summaryMethod, sumText } = this; const data = this.store.states.data.value; let sums = []; if (summaryMethod) sums = summaryMethod({ columns: columns2, data }); else columns2.forEach((column, index) => { if (index === 0) { sums[index] = sumText; return; } const values = data.map((item) => Number(item[column.property])); const precisions = []; let notNumber = true; values.forEach((value) => { if (!Number.isNaN(+value)) { notNumber = false; const decimal = `${value}`.split(".")[1]; precisions.push(decimal ? decimal.length : 0); } }); const precision = Math.max.apply(null, precisions); if (!notNumber) sums[index] = values.reduce((prev, curr) => { const value = Number(curr); if (!Number.isNaN(+value)) return Number.parseFloat((prev + curr).toFixed(Math.min(precision, 20))); else return prev; }, 0); else sums[index] = ""; }); return h(h("tfoot", [h("tr", {}, [...columns2.map((column, cellIndex) => h("td", { key: cellIndex, colspan: column.colSpan, rowspan: column.rowSpan, class: getCellClasses(columns2, cellIndex), style: getCellStyles(column, cellIndex) }, [h("div", { class: ["cell", column.labelClassName] }, [sums[cellIndex]])]))])])); } }); function useUtils(store) { const setCurrentRow = (row) => { store.commit("setCurrentRow", row); }; const getSelectionRows = () => { return store.getSelectionRows(); }; const toggleRowSelection = (row, selected, ignoreSelectable = true) => { store.toggleRowSelection(row, selected, false, ignoreSelectable); store.updateAllSelected(); }; const clearSelection = () => { store.clearSelection(); }; const clearFilter = (columnKeys) => { store.clearFilter(columnKeys); }; const toggleAllSelection = () => { store.commit("toggleAllSelection"); }; const toggleRowExpansion = (row, expanded) => { store.toggleRowExpansionAdapter(row, expanded); }; const clearSort = () => { store.clearSort(); }; const sort = (prop, order) => { store.commit("sort", { prop, order }); }; const updateKeyChildren = (key, data) => { store.updateKeyChildren(key, data); }; return { setCurrentRow, getSelectionRows, toggleRowSelection, clearSelection, clearFilter, toggleAllSelection, toggleRowExpansion, clearSort, sort, updateKeyChildren }; } function useStyle(props2, layout2, store, table) { const isHidden2 = ref(false); const renderExpanded = ref(null); const resizeProxyVisible = ref(false); const setDragVisible = (visible) => { resizeProxyVisible.value = visible; }; const resizeState = ref({ width: null, height: null, headerHeight: null }); const isGroup = ref(false); const scrollbarViewStyle = { display: "inline-block", verticalAlign: "middle" }; const tableWidth = ref(); const tableScrollHeight = ref(0); const bodyScrollHeight = ref(0); const headerScrollHeight = ref(0); const footerScrollHeight = ref(0); const appendScrollHeight = ref(0); watch(() => props2.height, (value) => { layout2.setHeight(value ?? null); }, { immediate: true }); watch(() => props2.maxHeight, (value) => { layout2.setMaxHeight(value ?? null); }, { immediate: true }); watch(() => [props2.currentRowKey, store.states.rowKey], ([currentRowKey, rowKey2]) => { if (!unref(rowKey2) || !unref(currentRowKey)) return; store.setCurrentRowKey(`${currentRowKey}`); }, { immediate: true }); watch(() => props2.data, (data) => { table.store.commit("setData", data); }, { immediate: true, deep: true }); watchEffect(() => { if (props2.expandRowKeys) store.setExpandRowKeysAdapter(props2.expandRowKeys); }); const handleMouseLeave = () => { table.store.commit("setHoverRow", null); if (table.hoverState) table.hoverState = null; }; const handleHeaderFooterMousewheel = (_event2, data) => { const { pixelX, pixelY } = data; if (Math.abs(pixelX) >= Math.abs(pixelY)) table.refs.bodyWrapper.scrollLeft += data.pixelX / 5; }; const shouldUpdateHeight = computed(() => { return props2.height || props2.maxHeight || store.states.fixedColumns.value.length > 0 || store.states.rightFixedColumns.value.length > 0; }); const tableBodyStyles = computed(() => { return { width: layout2.bodyWidth.value ? `${layout2.bodyWidth.value}px` : "" }; }); const doLayout = () => { if (shouldUpdateHeight.value) layout2.updateElsHeight(); layout2.updateColumnsWidth(); if (typeof window === "undefined") return; requestAnimationFrame(syncPosition); }; onMounted(async () => { await nextTick(); store.updateColumns(); bindEvents(); requestAnimationFrame(doLayout); const el = table.vnode.el; const tableHeader = table.refs.headerWrapper; if (props2.flexible && el && el.parentElement) el.parentElement.style.minWidth = "0"; resizeState.value = { width: tableWidth.value = el.offsetWidth, height: el.offsetHeight, headerHeight: props2.showHeader && tableHeader ? tableHeader.offsetHeight : null }; store.states.columns.value.forEach((column) => { if (column.filteredValue && column.filteredValue.length) table.store.commit("filterChange", { column, values: column.filteredValue, silent: true }); }); table.$ready = true; }); const setScrollClassByEl = (el, className) => { if (!el) return; const classList = Array.from(el.classList).filter((item) => !item.startsWith("is-scrolling-")); classList.push(layout2.scrollX.value ? className : "is-scrolling-none"); el.className = classList.join(" "); }; const setScrollClass = (className) => { const { tableWrapper } = table.refs; setScrollClassByEl(tableWrapper, className); }; const hasScrollClass = (className) => { const { tableWrapper } = table.refs; return !!(tableWrapper && tableWrapper.classList.contains(className)); }; const syncPosition = function() { if (!table.refs.scrollBarRef) return; if (!layout2.scrollX.value) { const scrollingNoneClass = "is-scrolling-none"; if (!hasScrollClass(scrollingNoneClass)) setScrollClass(scrollingNoneClass); return; } const scrollContainer = table.refs.scrollBarRef.wrapRef; if (!scrollContainer) return; const { scrollLeft, offsetWidth, scrollWidth } = scrollContainer; const { headerWrapper, footerWrapper } = table.refs; if (headerWrapper) headerWrapper.scrollLeft = scrollLeft; if (footerWrapper) footerWrapper.scrollLeft = scrollLeft; if (scrollLeft >= scrollWidth - offsetWidth - 1) setScrollClass("is-scrolling-right"); else if (scrollLeft === 0) setScrollClass("is-scrolling-left"); else setScrollClass("is-scrolling-middle"); }; const bindEvents = () => { if (!table.refs.scrollBarRef) return; if (table.refs.scrollBarRef.wrapRef) useEventListener(table.refs.scrollBarRef.wrapRef, "scroll", syncPosition, { passive: true }); if (props2.fit) useResizeObserver(table.vnode.el, resizeListener); else useEventListener(window, "resize", resizeListener); useResizeObserver(table.refs.tableInnerWrapper, () => { var _a, _b; resizeListener(); (_b = (_a = table.refs) == null ? void 0 : _a.scrollBarRef) == null ? void 0 : _b.update(); }); }; const resizeListener = () => { var _a, _b, _c, _d; const el = table.vnode.el; if (!table.$ready || !el) return; let shouldUpdateLayout = false; const { width: oldWidth, height: oldHeight, headerHeight: oldHeaderHeight } = resizeState.value; const width = tableWidth.value = el.offsetWidth; if (oldWidth !== width) shouldUpdateLayout = true; const height = el.offsetHeight; if ((props2.height || shouldUpdateHeight.value) && oldHeight !== height) shouldUpdateLayout = true; const tableHeader = props2.tableLayout === "fixed" ? table.refs.headerWrapper : (_a = table.refs.tableHeaderRef) == null ? void 0 : _a.$el; if (props2.showHeader && (tableHeader == null ? void 0 : tableHeader.offsetHeight) !== oldHeaderHeight) shouldUpdateLayout = true; tableScrollHeight.value = ((_b = table.refs.tableWrapper) == null ? void 0 : _b.scrollHeight) || 0; headerScrollHeight.value = (tableHeader == null ? void 0 : tableHeader.scrollHeight) || 0; footerScrollHeight.value = ((_c = table.refs.footerWrapper) == null ? void 0 : _c.offsetHeight) || 0; appendScrollHeight.value = ((_d = table.refs.appendWrapper) == null ? void 0 : _d.offsetHeight) || 0; bodyScrollHeight.value = tableScrollHeight.value - headerScrollHeight.value - footerScrollHeight.value - appendScrollHeight.value; if (shouldUpdateLayout) { resizeState.value = { width, height, headerHeight: props2.showHeader && (tableHeader == null ? void 0 : tableHeader.offsetHeight) || 0 }; doLayout(); } }; const tableSize = useFormSize(); const bodyWidth = computed(() => { const { bodyWidth: bodyWidth_, scrollY, gutterWidth } = layout2; return bodyWidth_.value ? `${bodyWidth_.value - (scrollY.value ? gutterWidth : 0)}px` : ""; }); const tableLayout = computed(() => { if (props2.maxHeight) return "fixed"; return props2.tableLayout; }); return { isHidden: isHidden2, renderExpanded, setDragVisible, isGroup, handleMouseLeave, handleHeaderFooterMousewheel, tableSize, emptyBlockStyle: computed(() => { if (props2.data && props2.data.length) return; let height = "100%"; if (props2.height && bodyScrollHeight.value) height = `${bodyScrollHeight.value}px`; const width = tableWidth.value; return { width: width ? `${width}px` : "", height }; }), resizeProxyVisible, bodyWidth, resizeState, doLayout, tableBodyStyles, tableLayout, scrollbarViewStyle, scrollbarStyle: computed(() => { if (props2.height) return { height: "100%" }; if (props2.maxHeight) if (!Number.isNaN(Number(props2.maxHeight))) return { maxHeight: `${+props2.maxHeight - headerScrollHeight.value - footerScrollHeight.value}px` }; else return { maxHeight: `calc(${props2.maxHeight} - ${headerScrollHeight.value + footerScrollHeight.value}px)` }; return {}; }) }; } function useKeyRender(table) { let observer; const initWatchDom = () => { const columnsWrapper = table.vnode.el.querySelector(".hidden-columns"); const config = { childList: true, subtree: true }; const updateOrderFns = table.store.states.updateOrderFns; observer = new MutationObserver(() => { updateOrderFns.forEach((fn) => fn()); }); observer.observe(columnsWrapper, config); }; onMounted(() => { initWatchDom(); }); onUnmounted(() => { observer == null ? void 0 : observer.disconnect(); }); } var defaults_default$2 = { data: { type: Array, default: () => [] }, size: useSizeProp, width: [String, Number], height: [String, Number], maxHeight: [String, Number], fit: { type: Boolean, default: true }, stripe: Boolean, border: Boolean, rowKey: [String, Function], showHeader: { type: Boolean, default: true }, showSummary: Boolean, sumText: String, summaryMethod: Function, rowClassName: [String, Function], rowStyle: [Object, Function], cellClassName: [String, Function], cellStyle: [Object, Function], headerRowClassName: [String, Function], headerRowStyle: [Object, Function], headerCellClassName: [String, Function], headerCellStyle: [Object, Function], highlightCurrentRow: Boolean, currentRowKey: [String, Number], emptyText: String, expandRowKeys: Array, defaultExpandAll: Boolean, rowExpandable: { type: Function }, defaultSort: Object, tooltipEffect: String, tooltipOptions: Object, spanMethod: Function, selectOnIndeterminate: { type: Boolean, default: true }, indent: { type: Number, default: 16 }, treeProps: { type: Object, default: () => { return { hasChildren: "hasChildren", children: "children", checkStrictly: false }; } }, lazy: Boolean, load: Function, style: { type: [ String, Object, Array ], default: () => ({}) }, className: { type: String, default: "" }, tableLayout: { type: String, default: "fixed" }, scrollbarAlwaysOn: Boolean, flexible: Boolean, showOverflowTooltip: { type: [Boolean, Object], default: void 0 }, tooltipFormatter: Function, appendFilterPanelTo: String, scrollbarTabindex: { type: [Number, String], default: void 0 }, allowDragLastColumn: { type: Boolean, default: true }, preserveExpandedContent: Boolean, nativeScrollbar: Boolean }; function hColgroup(props2) { const isAuto = props2.tableLayout === "auto"; let columns2 = props2.columns || []; if (isAuto) { if (columns2.every(({ width }) => isUndefined(width))) columns2 = []; } const getPropsData = (column) => { const propsData = { key: `${props2.tableLayout}_${column.id}`, style: {}, name: void 0 }; if (isAuto) propsData.style = { width: `${column.width}px` }; else propsData.name = column.id; return propsData; }; return h("colgroup", {}, columns2.map((column) => h("col", getPropsData(column)))); } hColgroup.props = ["columns", "tableLayout"]; const useScrollbar$1 = () => { const scrollBarRef = ref(); const scrollTo = (options, yCoord) => { const scrollbar = scrollBarRef.value; if (scrollbar) scrollbar.scrollTo(options, yCoord); }; const setScrollPosition = (position, offset2) => { const scrollbar = scrollBarRef.value; if (scrollbar && isNumber(offset2) && ["Top", "Left"].includes(position)) scrollbar[`setScroll${position}`](offset2); }; const setScrollTop = (top) => setScrollPosition("Top", top); const setScrollLeft = (left) => setScrollPosition("Left", left); return { scrollBarRef, scrollTo, setScrollTop, setScrollLeft }; }; let tableIdSeed = 1; var table_vue_vue_type_script_lang_default = defineComponent({ name: "ElTable", directives: { Mousewheel }, components: { TableHeader: table_header_default, TableBody: table_body_default, TableFooter: table_footer_default, ElScrollbar, hColgroup }, props: defaults_default$2, emits: [ "select", "select-all", "selection-change", "cell-mouse-enter", "cell-mouse-leave", "cell-contextmenu", "cell-click", "cell-dblclick", "row-click", "row-contextmenu", "row-dblclick", "header-click", "header-contextmenu", "sort-change", "filter-change", "current-change", "header-dragend", "expand-change", "scroll" ], setup(props2) { const { t } = useLocale(); const ns = useNamespace("table"); const globalConfig2 = useGlobalConfig("table"); const table = getCurrentInstance(); provide(TABLE_INJECTION_KEY, table); const store = createStore(table, props2); table.store = store; const layout2 = new TableLayout({ store: table.store, table, fit: props2.fit, showHeader: props2.showHeader }); table.layout = layout2; const isEmpty2 = computed(() => (store.states.data.value || []).length === 0); const { setCurrentRow, getSelectionRows, toggleRowSelection, clearSelection, clearFilter, toggleAllSelection, toggleRowExpansion, clearSort, sort, updateKeyChildren } = useUtils(store); const { isHidden: isHidden2, renderExpanded, setDragVisible, isGroup, handleMouseLeave, handleHeaderFooterMousewheel, tableSize, emptyBlockStyle, resizeProxyVisible, bodyWidth, resizeState, doLayout, tableBodyStyles, tableLayout, scrollbarViewStyle, scrollbarStyle } = useStyle(props2, layout2, store, table); const { scrollBarRef, scrollTo, setScrollLeft, setScrollTop } = useScrollbar$1(); const debouncedUpdateLayout = debounce(doLayout, 50); const tableId = `${ns.namespace.value}-table_${tableIdSeed++}`; table.tableId = tableId; table.state = { isGroup, resizeState, doLayout, debouncedUpdateLayout }; const computedSumText = computed(() => props2.sumText ?? t("el.table.sumText")); const computedEmptyText = computed(() => { return props2.emptyText ?? t("el.table.emptyText"); }); const computedTooltipEffect = computed(() => { var _a; return props2.tooltipEffect ?? ((_a = globalConfig2.value) == null ? void 0 : _a.tooltipEffect); }); const computedTooltipOptions = computed(() => { var _a; return props2.tooltipOptions ?? ((_a = globalConfig2.value) == null ? void 0 : _a.tooltipOptions); }); const columns2 = computed(() => { return convertToRows(store.states.originColumns.value)[0]; }); useKeyRender(table); onBeforeUnmount(() => { debouncedUpdateLayout.cancel(); }); return { ns, layout: layout2, store, columns: columns2, handleHeaderFooterMousewheel, handleMouseLeave, tableId, tableSize, isHidden: isHidden2, isEmpty: isEmpty2, renderExpanded, resizeProxyVisible, resizeState, isGroup, bodyWidth, tableBodyStyles, emptyBlockStyle, debouncedUpdateLayout, setCurrentRow, getSelectionRows, toggleRowSelection, clearSelection, clearFilter, toggleAllSelection, toggleRowExpansion, clearSort, doLayout, sort, updateKeyChildren, t, setDragVisible, context: table, computedSumText, computedEmptyText, computedTooltipEffect, computedTooltipOptions, tableLayout, scrollbarViewStyle, scrollbarStyle, scrollBarRef, scrollTo, setScrollLeft, setScrollTop, allowDragLastColumn: props2.allowDragLastColumn }; } }); const _hoisted_1$f = ["data-prefix"]; const _hoisted_2$9 = { ref: "hiddenColumns", class: "hidden-columns" }; function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { const _component_hColgroup = resolveComponent("hColgroup"); const _component_table_header = resolveComponent("table-header"); const _component_table_body = resolveComponent("table-body"); const _component_table_footer = resolveComponent("table-footer"); const _component_el_scrollbar = resolveComponent("el-scrollbar"); const _directive_mousewheel = resolveDirective("mousewheel"); return openBlock(), createElementBlock("div", { ref: "tableWrapper", class: normalizeClass([ { [_ctx.ns.m("fit")]: _ctx.fit, [_ctx.ns.m("striped")]: _ctx.stripe, [_ctx.ns.m("border")]: _ctx.border || _ctx.isGroup, [_ctx.ns.m("hidden")]: _ctx.isHidden, [_ctx.ns.m("group")]: _ctx.isGroup, [_ctx.ns.m("fluid-height")]: _ctx.maxHeight, [_ctx.ns.m("scrollable-x")]: _ctx.layout.scrollX.value, [_ctx.ns.m("scrollable-y")]: _ctx.layout.scrollY.value, [_ctx.ns.m("enable-row-hover")]: !_ctx.store.states.isComplex.value, [_ctx.ns.m("enable-row-transition")]: (_ctx.store.states.data.value || []).length !== 0 && (_ctx.store.states.data.value || []).length < 100, "has-footer": _ctx.showSummary }, _ctx.ns.m(_ctx.tableSize), _ctx.className, _ctx.ns.b(), _ctx.ns.m(`layout-${_ctx.tableLayout}`) ]), style: normalizeStyle(_ctx.style), "data-prefix": _ctx.ns.namespace.value, onMouseleave: _cache[1] || (_cache[1] = (...args) => _ctx.handleMouseLeave && _ctx.handleMouseLeave(...args)) }, [createBaseVNode("div", { ref: "tableInnerWrapper", class: normalizeClass(_ctx.ns.e("inner-wrapper")) }, [ createBaseVNode("div", _hoisted_2$9, [renderSlot(_ctx.$slots, "default")], 512), _ctx.showHeader && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock("div", { key: 0, ref: "headerWrapper", class: normalizeClass(_ctx.ns.e("header-wrapper")) }, [createBaseVNode("table", { ref: "tableHeader", class: normalizeClass(_ctx.ns.e("header")), style: normalizeStyle(_ctx.tableBodyStyles), border: "0", cellpadding: "0", cellspacing: "0" }, [createVNode(_component_hColgroup, { columns: _ctx.store.states.columns.value, "table-layout": _ctx.tableLayout }, null, 8, ["columns", "table-layout"]), createVNode(_component_table_header, { ref: "tableHeaderRef", border: _ctx.border, "default-sort": _ctx.defaultSort, store: _ctx.store, "append-filter-panel-to": _ctx.appendFilterPanelTo, "allow-drag-last-column": _ctx.allowDragLastColumn, onSetDragVisible: _ctx.setDragVisible }, null, 8, [ "border", "default-sort", "store", "append-filter-panel-to", "allow-drag-last-column", "onSetDragVisible" ])], 6)], 2)), [[_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]]) : createCommentVNode("v-if", true), createBaseVNode("div", { ref: "bodyWrapper", class: normalizeClass(_ctx.ns.e("body-wrapper")) }, [createVNode(_component_el_scrollbar, { ref: "scrollBarRef", "view-style": _ctx.scrollbarViewStyle, "wrap-style": _ctx.scrollbarStyle, always: _ctx.scrollbarAlwaysOn, tabindex: _ctx.scrollbarTabindex, native: _ctx.nativeScrollbar, onScroll: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("scroll", $event)) }, { default: withCtx(() => [ createBaseVNode("table", { ref: "tableBody", class: normalizeClass(_ctx.ns.e("body")), cellspacing: "0", cellpadding: "0", border: "0", style: normalizeStyle({ width: _ctx.bodyWidth, tableLayout: _ctx.tableLayout }) }, [ createVNode(_component_hColgroup, { columns: _ctx.store.states.columns.value, "table-layout": _ctx.tableLayout }, null, 8, ["columns", "table-layout"]), _ctx.showHeader && _ctx.tableLayout === "auto" ? (openBlock(), createBlock(_component_table_header, { key: 0, ref: "tableHeaderRef", class: normalizeClass(_ctx.ns.e("body-header")), border: _ctx.border, "default-sort": _ctx.defaultSort, store: _ctx.store, "append-filter-panel-to": _ctx.appendFilterPanelTo, onSetDragVisible: _ctx.setDragVisible }, null, 8, [ "class", "border", "default-sort", "store", "append-filter-panel-to", "onSetDragVisible" ])) : createCommentVNode("v-if", true), createVNode(_component_table_body, { context: _ctx.context, highlight: _ctx.highlightCurrentRow, "row-class-name": _ctx.rowClassName, "tooltip-effect": _ctx.computedTooltipEffect, "tooltip-options": _ctx.computedTooltipOptions, "row-style": _ctx.rowStyle, store: _ctx.store, stripe: _ctx.stripe }, null, 8, [ "context", "highlight", "row-class-name", "tooltip-effect", "tooltip-options", "row-style", "store", "stripe" ]), _ctx.showSummary && _ctx.tableLayout === "auto" ? (openBlock(), createBlock(_component_table_footer, { key: 1, class: normalizeClass(_ctx.ns.e("body-footer")), border: _ctx.border, "default-sort": _ctx.defaultSort, store: _ctx.store, "sum-text": _ctx.computedSumText, "summary-method": _ctx.summaryMethod }, null, 8, [ "class", "border", "default-sort", "store", "sum-text", "summary-method" ])) : createCommentVNode("v-if", true) ], 6), _ctx.isEmpty ? (openBlock(), createElementBlock("div", { key: 0, ref: "emptyBlock", style: normalizeStyle(_ctx.emptyBlockStyle), class: normalizeClass(_ctx.ns.e("empty-block")) }, [createBaseVNode("span", { class: normalizeClass(_ctx.ns.e("empty-text")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(_ctx.computedEmptyText), 1)])], 2)], 6)) : createCommentVNode("v-if", true), _ctx.$slots.append ? (openBlock(), createElementBlock("div", { key: 1, ref: "appendWrapper", class: normalizeClass(_ctx.ns.e("append-wrapper")) }, [renderSlot(_ctx.$slots, "append")], 2)) : createCommentVNode("v-if", true) ]), _: 3 }, 8, [ "view-style", "wrap-style", "always", "tabindex", "native" ])], 2), _ctx.showSummary && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock("div", { key: 1, ref: "footerWrapper", class: normalizeClass(_ctx.ns.e("footer-wrapper")) }, [createBaseVNode("table", { class: normalizeClass(_ctx.ns.e("footer")), cellspacing: "0", cellpadding: "0", border: "0", style: normalizeStyle(_ctx.tableBodyStyles) }, [createVNode(_component_hColgroup, { columns: _ctx.store.states.columns.value, "table-layout": _ctx.tableLayout }, null, 8, ["columns", "table-layout"]), createVNode(_component_table_footer, { border: _ctx.border, "default-sort": _ctx.defaultSort, store: _ctx.store, "sum-text": _ctx.computedSumText, "summary-method": _ctx.summaryMethod }, null, 8, [ "border", "default-sort", "store", "sum-text", "summary-method" ])], 6)], 2)), [[vShow, !_ctx.isEmpty], [_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]]) : createCommentVNode("v-if", true), _ctx.border || _ctx.isGroup ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(_ctx.ns.e("border-left-patch")) }, null, 2)) : createCommentVNode("v-if", true) ], 2), withDirectives(createBaseVNode("div", { ref: "resizeProxy", class: normalizeClass(_ctx.ns.e("column-resize-proxy")) }, null, 2), [[vShow, _ctx.resizeProxyVisible]])], 46, _hoisted_1$f); } var table_default = /* @__PURE__ */ _plugin_vue_export_helper_default(table_vue_vue_type_script_lang_default, [["render", _sfc_render$3]]); const defaultClassNames = { selection: "table-column--selection", expand: "table__expand-column" }; const cellStarts = { default: { order: "" }, selection: { width: 48, minWidth: 48, realWidth: 48, order: "" }, expand: { width: 48, minWidth: 48, realWidth: 48, order: "" }, index: { width: 48, minWidth: 48, realWidth: 48, order: "" } }; const getDefaultClassName = (type) => { return defaultClassNames[type] || ""; }; const cellForced = { selection: { renderHeader({ store }) { function isDisabled() { return store.states.data.value && store.states.data.value.length === 0; } return h(ElCheckbox, { disabled: isDisabled(), size: store.states.tableSize.value, indeterminate: store.states.selection.value.length > 0 && !store.states.isAllSelected.value, "onUpdate:modelValue": store.toggleAllSelection ?? void 0, modelValue: store.states.isAllSelected.value, ariaLabel: store.t("el.table.selectAllLabel") }); }, renderCell({ row, column, store, $index }) { return h(ElCheckbox, { disabled: column.selectable ? !column.selectable.call(null, row, $index) : false, size: store.states.tableSize.value, onChange: () => { store.commit("rowSelectedChanged", row); }, onClick: (event) => event.stopPropagation(), modelValue: store.isSelected(row), ariaLabel: store.t("el.table.selectRowLabel") }); }, sortable: false, resizable: false }, index: { renderHeader({ column }) { return column.label || "#"; }, renderCell({ column, $index }) { let i = $index + 1; const index = column.index; if (isNumber(index)) i = $index + index; else if (isFunction(index)) i = index($index); return h("div", {}, [i]); }, sortable: false }, expand: { renderHeader({ column }) { return column.label || ""; }, renderCell({ column, row, store, expanded, $index }) { var _a, _b; const { ns } = store; const classes = [ns.e("expand-icon")]; if (!column.renderExpand && expanded) classes.push(ns.em("expand-icon", "expanded")); const callback = function(e) { e.stopPropagation(); store.toggleRowExpansion(row); }; const isRowExpandable = ((_b = (_a = store.states.rowExpandable).value) == null ? void 0 : _b.call(_a, row, $index)) ?? true; if (!isRowExpandable) classes.push(ns.is("disabled")); return h("button", { type: "button", disabled: !isRowExpandable, "aria-label": store.t(expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"), "aria-expanded": expanded, class: classes, onClick: callback }, { default: () => { if (column.renderExpand) return [column.renderExpand({ expanded, expandable: isRowExpandable })]; return [h(ElIcon, null, { default: () => { return [h(arrow_right_default)]; } })]; } }); }, sortable: false, resizable: false } }; function defaultRenderCell({ row, column, $index }) { var _a; const property = column.property; const value = property && getProp(row, property).value; if (column && column.formatter) return column.formatter(row, column, value, $index); return ((_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) || ""; } function treeCellPrefix({ row, treeNode, store }, createPlaceholder = false) { const { ns } = store; if (!treeNode) { if (createPlaceholder) return [h("span", { class: ns.e("placeholder") })]; return null; } const ele = []; const callback = function(e) { e.stopPropagation(); if (treeNode.loading) return; store.loadOrToggle(row); }; if (treeNode.indent) ele.push(h("span", { class: ns.e("indent"), style: { "padding-left": `${treeNode.indent}px` } })); if (isBoolean(treeNode.expanded) && !treeNode.noLazyChildren) { const expandClasses = [ns.e("expand-icon"), treeNode.expanded ? ns.em("expand-icon", "expanded") : ""]; let icon = arrow_right_default; if (treeNode.loading) icon = loading_default; ele.push(h("button", { type: "button", "aria-label": store.t(treeNode.expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"), "aria-expanded": treeNode.expanded, class: expandClasses, onClick: callback }, { default: () => { return [h(ElIcon, { class: ns.is("loading", treeNode.loading) }, { default: () => [h(icon)] })]; } })); } else ele.push(h("span", { class: ns.e("placeholder") })); return ele; } function getAllAliases(props2, aliases) { return props2.reduce((prev, cur) => { prev[cur] = cur; return prev; }, aliases); } function useWatcher(owner, props_) { const instance = getCurrentInstance(); const registerComplexWatchers = () => { const props2 = ["fixed"]; const aliases = { realWidth: "width", realMinWidth: "minWidth" }; const allAliases = getAllAliases(props2, aliases); Object.keys(allAliases).forEach((key) => { const columnKey = aliases[key]; if (hasOwn(props_, columnKey)) watch(() => props_[columnKey], (newVal) => { let value = newVal; if (columnKey === "width" && key === "realWidth") value = parseWidth(newVal); if (columnKey === "minWidth" && key === "realMinWidth") value = parseMinWidth(newVal); instance.columnConfig.value[columnKey] = value; instance.columnConfig.value[key] = value; const updateColumns = columnKey === "fixed"; owner.value.store.scheduleLayout(updateColumns); }); }); }; const registerNormalWatchers = () => { const props2 = [ "label", "filters", "filterMultiple", "filteredValue", "sortable", "index", "formatter", "className", "labelClassName", "filterClassName", "showOverflowTooltip", "tooltipFormatter", "resizable" ]; const parentProps = ["showOverflowTooltip"]; const aliases = { property: "prop", align: "realAlign", headerAlign: "realHeaderAlign" }; const allAliases = getAllAliases(props2, aliases); Object.keys(allAliases).forEach((key) => { const columnKey = aliases[key]; if (hasOwn(props_, columnKey)) watch(() => props_[columnKey], (newVal) => { instance.columnConfig.value[key] = newVal; if (key === "filters" || key === "filterMethod") instance.columnConfig.value["filterable"] = !!(instance.columnConfig.value["filters"] || instance.columnConfig.value["filterMethod"]); }); }); parentProps.forEach((key) => { if (hasOwn(owner.value.props, key)) watch(() => owner.value.props[key], (newVal) => { if (instance.columnConfig.value.type === "selection") return; if (!isUndefined(props_[key])) return; instance.columnConfig.value[key] = newVal; }); }); const globalConfig2 = useGlobalConfig("table"); if (globalConfig2.value && hasOwn(globalConfig2.value, "showOverflowTooltip")) watch(() => { var _a; return (_a = globalConfig2.value) == null ? void 0 : _a.showOverflowTooltip; }, (newVal) => { if (instance.columnConfig.value.type === "selection") return; if (!isUndefined(props_.showOverflowTooltip) || !isUndefined(owner.value.props.showOverflowTooltip)) return; instance.columnConfig.value.showOverflowTooltip = newVal; }); }; return { registerComplexWatchers, registerNormalWatchers }; } function useRender(props2, slots, owner) { const instance = getCurrentInstance(); const columnId = ref(""); const isSubColumn = ref(false); const realAlign = ref(); const realHeaderAlign = ref(); const ns = useNamespace("table"); watchEffect(() => { realAlign.value = props2.align ? `is-${props2.align}` : null; realAlign.value; }); watchEffect(() => { realHeaderAlign.value = props2.headerAlign ? `is-${props2.headerAlign}` : realAlign.value; realHeaderAlign.value; }); const columnOrTableParent = computed(() => { let parent = instance.vnode.vParent || instance.parent; while (parent && !parent.tableId && !parent.columnId) parent = parent.vnode.vParent || parent.parent; return parent; }); const hasTreeColumn = computed(() => { const { store } = instance.parent; if (!store) return false; const { treeData } = store.states; const treeDataValue = treeData.value; return treeDataValue && Object.keys(treeDataValue).length > 0; }); const realWidth = ref(parseWidth(props2.width)); const realMinWidth = ref(parseMinWidth(props2.minWidth)); const setColumnWidth = (column) => { if (realWidth.value) column.width = realWidth.value; if (realMinWidth.value) column.minWidth = realMinWidth.value; if (!realWidth.value && realMinWidth.value) column.width = void 0; if (!column.minWidth) column.minWidth = 80; column.realWidth = Number(isUndefined(column.width) ? column.minWidth : column.width); return column; }; const setColumnForcedProps = (column) => { const type = column.type; const source = cellForced[type] || {}; Object.keys(source).forEach((prop) => { const value = source[prop]; if (prop !== "className" && !isUndefined(value)) column[prop] = value; }); const className = getDefaultClassName(type); if (className) { const forceClass = `${unref(ns.namespace)}-${className}`; column.className = column.className ? `${column.className} ${forceClass}` : forceClass; } return column; }; const checkSubColumn = (children) => { if (isArray(children)) children.forEach((child) => check(child)); else check(children); function check(item) { var _a; if (((_a = item == null ? void 0 : item.type) == null ? void 0 : _a.name) === "ElTableColumn") item.vParent = instance; } }; const setColumnRenders = (column) => { if (props2.renderHeader) debugWarn("TableColumn", "Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."); else if (column.type !== "selection") column.renderHeader = (scope) => { instance.columnConfig.value["label"]; if (slots.header) { const slotResult = slots.header(scope); if (ensureValidVNode(slotResult)) return h(Fragment, slotResult); } return createTextVNode(column.label); }; if (slots["filter-icon"]) column.renderFilterIcon = (scope) => { return renderSlot(slots, "filter-icon", scope); }; if (slots.expand) column.renderExpand = (scope) => { return renderSlot(slots, "expand", scope); }; let originRenderCell = column.renderCell; if (column.type === "expand") { column.renderCell = (data) => h("div", { class: "cell" }, [originRenderCell(data)]); owner.value.renderExpanded = (row) => { return slots.default ? slots.default(row) : slots.default; }; } else { originRenderCell = originRenderCell || defaultRenderCell; column.renderCell = (data) => { let children = null; if (slots.default) { const vnodes = slots.default(data); children = vnodes.some((v) => v.type !== Comment) ? vnodes : originRenderCell(data); } else children = originRenderCell(data); const { columns: columns2 } = owner.value.store.states; const firstUserColumnIndex = columns2.value.findIndex((item) => item.type === "default"); const prefix = treeCellPrefix(data, hasTreeColumn.value && data.cellIndex === firstUserColumnIndex); const props3 = { class: "cell", style: {} }; if (column.showOverflowTooltip) { props3.class = `${props3.class} ${unref(ns.namespace)}-tooltip`; props3.style = { width: `${(data.column.realWidth || Number(data.column.width)) - 1}px` }; } checkSubColumn(children); return h("div", props3, [prefix, children]); }; } return column; }; const getPropsData = (...propsKey) => { return propsKey.reduce((prev, cur) => { if (isArray(cur)) cur.forEach((key) => { prev[key] = props2[key]; }); return prev; }, {}); }; const getColumnElIndex = (children, child) => { return Array.prototype.indexOf.call(children, child); }; const updateColumnOrder = () => { owner.value.store.commit("updateColumnOrder", instance.columnConfig.value); }; return { columnId, realAlign, isSubColumn, realHeaderAlign, columnOrTableParent, setColumnWidth, setColumnForcedProps, setColumnRenders, getPropsData, getColumnElIndex, updateColumnOrder }; } var defaults_default$1 = { type: { type: String, default: "default" }, label: String, className: String, labelClassName: String, property: String, prop: String, width: { type: [String, Number], default: "" }, minWidth: { type: [String, Number], default: "" }, renderHeader: Function, sortable: { type: [Boolean, String], default: false }, sortMethod: Function, sortBy: [ String, Function, Array ], resizable: { type: Boolean, default: true }, columnKey: String, align: String, headerAlign: String, showOverflowTooltip: { type: [Boolean, Object], default: void 0 }, tooltipFormatter: Function, fixed: [Boolean, String], formatter: Function, selectable: Function, reserveSelection: Boolean, filterMethod: Function, filteredValue: Array, filters: Array, filterPlacement: String, filterMultiple: { type: Boolean, default: true }, filterClassName: String, index: [Number, Function], sortOrders: { type: Array, default: () => { return [ "ascending", "descending", null ]; }, validator: (val) => { return val.every((order) => [ "ascending", "descending", null ].includes(order)); } } }; let columnIdSeed = 1; var table_column_default = defineComponent({ name: "ElTableColumn", components: { ElCheckbox }, props: defaults_default$1, setup(props2, { slots }) { const instance = getCurrentInstance(); const globalConfig2 = useGlobalConfig("table"); const columnConfig = ref({}); const owner = computed(() => { let parent2 = instance.parent; while (parent2 && !parent2.tableId) parent2 = parent2.parent; return parent2; }); const { registerNormalWatchers, registerComplexWatchers } = useWatcher(owner, props2); const { columnId, isSubColumn, realHeaderAlign, columnOrTableParent, setColumnWidth, setColumnForcedProps, setColumnRenders, getPropsData, getColumnElIndex, realAlign, updateColumnOrder } = useRender(props2, slots, owner); const parent = columnOrTableParent.value; columnId.value = `${"tableId" in parent && parent.tableId || "columnId" in parent && parent.columnId}_column_${columnIdSeed++}`; onBeforeMount(() => { var _a, _b; isSubColumn.value = owner.value !== parent; const type = props2.type || "default"; const sortable = props2.sortable === "" ? true : props2.sortable; const showOverflowTooltip = type === "selection" ? false : isUndefined(props2.showOverflowTooltip) ? parent.props.showOverflowTooltip ?? ((_a = globalConfig2.value) == null ? void 0 : _a.showOverflowTooltip) : props2.showOverflowTooltip; const tooltipFormatter = isUndefined(props2.tooltipFormatter) ? parent.props.tooltipFormatter ?? ((_b = globalConfig2.value) == null ? void 0 : _b.tooltipFormatter) : props2.tooltipFormatter; const defaults = { ...cellStarts[type], id: columnId.value, type, property: props2.prop || props2.property, align: realAlign, headerAlign: realHeaderAlign, showOverflowTooltip, tooltipFormatter, filterable: props2.filters || props2.filterMethod, filteredValue: [], filterPlacement: "", filterClassName: "", isColumnGroup: false, isSubColumn: false, filterOpened: false, sortable, index: props2.index, rawColumnKey: instance.vnode.key }; let column = getPropsData([ "columnKey", "label", "className", "labelClassName", "type", "renderHeader", "formatter", "fixed", "resizable" ], [ "sortMethod", "sortBy", "sortOrders" ], ["selectable", "reserveSelection"], [ "filterMethod", "filters", "filterMultiple", "filterOpened", "filteredValue", "filterPlacement", "filterClassName" ]); column = mergeOptions(defaults, column); column = compose(setColumnRenders, setColumnWidth, setColumnForcedProps)(column); columnConfig.value = column; registerNormalWatchers(); registerComplexWatchers(); }); onMounted(() => { var _a, _b; const parent2 = columnOrTableParent.value; const children = isSubColumn.value ? (_a = parent2.vnode.el) == null ? void 0 : _a.children : (_b = parent2.refs.hiddenColumns) == null ? void 0 : _b.children; const getColumnIndex = () => getColumnElIndex(children || [], instance.vnode.el); columnConfig.value.getColumnIndex = getColumnIndex; getColumnIndex() > -1 && owner.value.store.commit("insertColumn", columnConfig.value, isSubColumn.value ? "columnConfig" in parent2 && parent2.columnConfig.value : null, updateColumnOrder); }); onBeforeUnmount(() => { const getColumnIndex = columnConfig.value.getColumnIndex; (getColumnIndex ? getColumnIndex() : -1) > -1 && owner.value.store.commit("removeColumn", columnConfig.value, isSubColumn.value ? "columnConfig" in parent && parent.columnConfig.value : null, updateColumnOrder); }); instance.columnId = columnId.value; instance.columnConfig = columnConfig; }, render() { var _a, _b, _c; try { const renderDefault = (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a, { row: {}, column: {}, $index: -1 }); const children = []; if (isArray(renderDefault)) { for (const childNode of renderDefault) if (((_c = childNode.type) == null ? void 0 : _c.name) === "ElTableColumn" || childNode.shapeFlag & 2) children.push(childNode); else if (childNode.type === Fragment && isArray(childNode.children)) childNode.children.forEach((vnode) => { if ((vnode == null ? void 0 : vnode.patchFlag) !== 1024 && !isString(vnode == null ? void 0 : vnode.children)) children.push(vnode); }); } return h("div", children); } catch { return h("div", []); } } }); var tableColumn_default = table_column_default; const ElTable = withInstall(table_default, { TableColumn: tableColumn_default }); const ElTableColumn = withNoopInstall(tableColumn_default); let SortOrder = /* @__PURE__ */ (function(SortOrder2) { SortOrder2["ASC"] = "asc"; SortOrder2["DESC"] = "desc"; return SortOrder2; })({}); let Alignment = /* @__PURE__ */ (function(Alignment2) { Alignment2["LEFT"] = "left"; Alignment2["CENTER"] = "center"; Alignment2["RIGHT"] = "right"; return Alignment2; })({}); let FixedDir = /* @__PURE__ */ (function(FixedDir2) { FixedDir2["LEFT"] = "left"; FixedDir2["RIGHT"] = "right"; return FixedDir2; })({}); const oppositeOrderMap = { [SortOrder.ASC]: SortOrder.DESC, [SortOrder.DESC]: SortOrder.ASC }; const placeholderSign = Symbol("placeholder"); const classType = String; const columns = { type: definePropType(Array), required: true }; const fixedDataType = { type: definePropType(Array) }; const dataType = { ...fixedDataType, required: true }; const expandColumnKey = String; const expandKeys = { type: definePropType(Array), default: () => mutable([]) }; const requiredNumber = { type: Number, required: true }; const rowKey = { type: definePropType([ String, Number, Symbol ]), default: "id" }; const styleType = { type: definePropType(Object) }; const tableV2RowProps = buildProps({ class: String, columns, columnsStyles: { type: definePropType(Object), required: true }, depth: Number, expandColumnKey, estimatedRowHeight: { ...virtualizedGridProps.estimatedRowHeight, default: void 0 }, isScrolling: Boolean, onRowExpand: { type: definePropType(Function) }, onRowHover: { type: definePropType(Function) }, onRowHeightChange: { type: definePropType(Function) }, rowData: { type: definePropType(Object), required: true }, rowEventHandlers: { type: definePropType(Object) }, rowIndex: { type: Number, required: true }, rowKey, style: { type: definePropType(Object) } }); const requiredNumberType = { type: Number, required: true }; const tableV2HeaderProps = buildProps({ class: String, columns, fixedHeaderData: { type: definePropType(Array) }, headerData: { type: definePropType(Array), required: true }, headerHeight: { type: definePropType([Number, Array]), default: 50 }, rowWidth: requiredNumberType, rowHeight: { type: Number, default: 50 }, height: requiredNumberType, width: requiredNumberType }); const tableV2GridProps = buildProps({ columns, data: dataType, fixedData: fixedDataType, estimatedRowHeight: tableV2RowProps.estimatedRowHeight, width: requiredNumber, height: requiredNumber, headerWidth: requiredNumber, headerHeight: tableV2HeaderProps.headerHeight, bodyWidth: requiredNumber, rowHeight: requiredNumber, cache: virtualizedListProps.cache, useIsScrolling: Boolean, scrollbarAlwaysOn: virtualizedGridProps.scrollbarAlwaysOn, scrollbarStartGap: virtualizedGridProps.scrollbarStartGap, scrollbarEndGap: virtualizedGridProps.scrollbarEndGap, class: classType, style: styleType, containerStyle: styleType, getRowHeight: { type: definePropType(Function), required: true }, rowKey: tableV2RowProps.rowKey, onRowsRendered: { type: definePropType(Function) }, onScroll: { type: definePropType(Function) } }); const tableV2Props = buildProps({ cache: tableV2GridProps.cache, estimatedRowHeight: tableV2RowProps.estimatedRowHeight, rowKey, headerClass: { type: definePropType([String, Function]) }, headerProps: { type: definePropType([Object, Function]) }, headerCellProps: { type: definePropType([Object, Function]) }, headerHeight: tableV2HeaderProps.headerHeight, footerHeight: { type: Number, default: 0 }, rowClass: { type: definePropType([String, Function]) }, rowProps: { type: definePropType([Object, Function]) }, rowHeight: { type: Number, default: 50 }, cellProps: { type: definePropType([Object, Function]) }, columns, data: dataType, dataGetter: { type: definePropType(Function) }, fixedData: fixedDataType, expandColumnKey: tableV2RowProps.expandColumnKey, expandedRowKeys: expandKeys, defaultExpandedRowKeys: expandKeys, class: classType, fixed: Boolean, style: { type: definePropType(Object) }, width: requiredNumber, height: requiredNumber, maxHeight: Number, useIsScrolling: Boolean, indentSize: { type: Number, default: 12 }, iconSize: { type: Number, default: 12 }, hScrollbarSize: virtualizedGridProps.hScrollbarSize, vScrollbarSize: virtualizedGridProps.vScrollbarSize, scrollbarAlwaysOn: virtualizedScrollbarProps.alwaysOn, sortBy: { type: definePropType(Object), default: () => ({}) }, sortState: { type: definePropType(Object), default: void 0 }, onColumnSort: { type: definePropType(Function) }, onExpandedRowsChange: { type: definePropType(Function) }, onEndReached: { type: definePropType(Function) }, onRowExpand: tableV2RowProps.onRowExpand, onScroll: tableV2GridProps.onScroll, onRowsRendered: tableV2GridProps.onRowsRendered, rowEventHandlers: tableV2RowProps.rowEventHandlers }); const calcColumnStyle = (column, fixedColumn, fixed) => { const flex = { flexGrow: 0, flexShrink: 0, ...fixed ? {} : { flexGrow: column.flexGrow ?? 0, flexShrink: column.flexShrink ?? 1 } }; const style = { ...column.style ?? {}, ...flex, flexBasis: "auto", width: column.width }; if (!fixedColumn) { if (column.maxWidth) style.maxWidth = column.maxWidth; if (column.minWidth) style.minWidth = column.minWidth; } return style; }; function useColumns(props2, columns2, fixed) { const _columns = computed(() => unref(columns2).map((column, index) => ({ ...column, key: column.key ?? column.dataKey ?? index }))); const visibleColumns = computed(() => { return unref(_columns).filter((column) => !column.hidden); }); const fixedColumnsOnLeft = computed(() => unref(visibleColumns).filter((column) => column.fixed === "left" || column.fixed === true)); const fixedColumnsOnRight = computed(() => unref(visibleColumns).filter((column) => column.fixed === "right")); const normalColumns = computed(() => unref(visibleColumns).filter((column) => !column.fixed)); const mainColumns = computed(() => { const ret = []; unref(fixedColumnsOnLeft).forEach((column) => { ret.push({ ...column, placeholderSign }); }); unref(normalColumns).forEach((column) => { ret.push(column); }); unref(fixedColumnsOnRight).forEach((column) => { ret.push({ ...column, placeholderSign }); }); return ret; }); const hasFixedColumns = computed(() => { return unref(fixedColumnsOnLeft).length || unref(fixedColumnsOnRight).length; }); const columnsStyles = computed(() => { return unref(_columns).reduce((style, column) => { style[column.key] = calcColumnStyle(column, unref(fixed), props2.fixed); return style; }, {}); }); const columnsTotalWidth = computed(() => { return unref(visibleColumns).reduce((width, column) => width + column.width, 0); }); const getColumn = (key) => { return unref(_columns).find((column) => column.key === key); }; const getColumnStyle = (key) => { return unref(columnsStyles)[key]; }; const updateColumnWidth = (column, width) => { column.width = width; }; function onColumnSorted(e) { var _a; const { key } = e.currentTarget.dataset; if (!key) return; const { sortState, sortBy } = props2; let order = SortOrder.ASC; if (isObject(sortState)) order = oppositeOrderMap[sortState[key]]; else order = oppositeOrderMap[sortBy.order]; (_a = props2.onColumnSort) == null ? void 0 : _a.call(props2, { column: getColumn(key), key, order }); } return { columns: _columns, columnsStyles, columnsTotalWidth, fixedColumnsOnLeft, fixedColumnsOnRight, hasFixedColumns, mainColumns, normalColumns, visibleColumns, getColumn, getColumnStyle, updateColumnWidth, onColumnSorted }; } const useScrollbar = (props2, { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached }) => { const scrollPos = ref({ scrollLeft: 0, scrollTop: 0 }); function doScroll(params) { var _a, _b, _c; const { scrollTop } = params; (_a = mainTableRef.value) == null ? void 0 : _a.scrollTo(params); (_b = leftTableRef.value) == null ? void 0 : _b.scrollToTop(scrollTop); (_c = rightTableRef.value) == null ? void 0 : _c.scrollToTop(scrollTop); } function scrollTo(params) { scrollPos.value = params; doScroll(params); } function scrollToTop(scrollTop) { scrollPos.value.scrollTop = scrollTop; doScroll(unref(scrollPos)); } function scrollToLeft(scrollLeft) { var _a, _b; scrollPos.value.scrollLeft = scrollLeft; (_b = (_a = mainTableRef.value) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, unref(scrollPos)); } function onScroll(params) { var _a; scrollTo(params); (_a = props2.onScroll) == null ? void 0 : _a.call(props2, params); } function onVerticalScroll({ scrollTop }) { const { scrollTop: currentScrollTop } = unref(scrollPos); if (scrollTop !== currentScrollTop) scrollToTop(scrollTop); } function scrollToRow(row, strategy = "auto") { var _a; (_a = mainTableRef.value) == null ? void 0 : _a.scrollToRow(row, strategy); } watch(() => unref(scrollPos).scrollTop, (cur, prev) => { if (cur > prev) onMaybeEndReached(); }); return { scrollPos, scrollTo, scrollToLeft, scrollToTop, scrollToRow, onScroll, onVerticalScroll }; }; const useRow = (props2, { mainTableRef, leftTableRef, rightTableRef, tableInstance, ns, isScrolling }) => { const vm = getCurrentInstance(); const { emit } = vm; const isResetting = shallowRef(false); const expandedRowKeys = ref(props2.defaultExpandedRowKeys || []); const lastRenderedRowIndex = ref(-1); const resetIndex = shallowRef(null); const rowHeights = ref({}); const pendingRowHeights = ref({}); const leftTableHeights = shallowRef({}); const mainTableHeights = shallowRef({}); const rightTableHeights = shallowRef({}); const isDynamic = computed(() => isNumber(props2.estimatedRowHeight)); function onRowsRendered(params) { var _a; (_a = props2.onRowsRendered) == null ? void 0 : _a.call(props2, params); if (params.rowCacheEnd > unref(lastRenderedRowIndex)) lastRenderedRowIndex.value = params.rowCacheEnd; } function onRowHovered({ hovered, rowKey: rowKey2 }) { if (isScrolling.value) return; tableInstance.vnode.el.querySelectorAll(`[rowkey="${String(rowKey2)}"]`).forEach((row) => { if (hovered) row.classList.add(ns.is("hovered")); else row.classList.remove(ns.is("hovered")); }); } function onRowExpanded({ expanded, rowData, rowIndex, rowKey: rowKey2 }) { var _a, _b; const _expandedRowKeys = [...unref(expandedRowKeys)]; const currentKeyIndex = _expandedRowKeys.indexOf(rowKey2); if (expanded) { if (currentKeyIndex === -1) _expandedRowKeys.push(rowKey2); } else if (currentKeyIndex > -1) _expandedRowKeys.splice(currentKeyIndex, 1); expandedRowKeys.value = _expandedRowKeys; emit("update:expandedRowKeys", _expandedRowKeys); (_a = props2.onRowExpand) == null ? void 0 : _a.call(props2, { expanded, rowData, rowIndex, rowKey: rowKey2 }); (_b = props2.onExpandedRowsChange) == null ? void 0 : _b.call(props2, _expandedRowKeys); if (tableInstance.vnode.el.querySelector(`.${ns.is("hovered")}[rowkey="${String(rowKey2)}"]`)) nextTick(() => onRowHovered({ hovered: true, rowKey: rowKey2 })); } const flushingRowHeights = debounce(() => { var _a, _b, _c, _d; isResetting.value = true; rowHeights.value = { ...unref(rowHeights), ...unref(pendingRowHeights) }; resetAfterIndex(unref(resetIndex), false); pendingRowHeights.value = {}; resetIndex.value = null; (_a = mainTableRef.value) == null ? void 0 : _a.forceUpdate(); (_b = leftTableRef.value) == null ? void 0 : _b.forceUpdate(); (_c = rightTableRef.value) == null ? void 0 : _c.forceUpdate(); (_d = vm.proxy) == null ? void 0 : _d.$forceUpdate(); isResetting.value = false; }, 0); function resetAfterIndex(index, forceUpdate = false) { if (!unref(isDynamic)) return; [ mainTableRef, leftTableRef, rightTableRef ].forEach((tableRef) => { const table = unref(tableRef); if (table) table.resetAfterRowIndex(index, forceUpdate); }); } function resetHeights(rowKey2, height, rowIdx) { const resetIdx = unref(resetIndex); if (resetIdx === null) resetIndex.value = rowIdx; else if (resetIdx > rowIdx) resetIndex.value = rowIdx; pendingRowHeights.value[rowKey2] = height; } function onRowHeightChange({ rowKey: rowKey2, height, rowIndex }, fixedDir) { if (!fixedDir) mainTableHeights.value[rowKey2] = height; else if (fixedDir === FixedDir.RIGHT) rightTableHeights.value[rowKey2] = height; else leftTableHeights.value[rowKey2] = height; const maximumHeight = Math.max(...[ leftTableHeights, rightTableHeights, mainTableHeights ].map((records) => records.value[rowKey2] || 0)); if (unref(rowHeights)[rowKey2] !== maximumHeight) { resetHeights(rowKey2, maximumHeight, rowIndex); flushingRowHeights(); } } return { expandedRowKeys, lastRenderedRowIndex, isDynamic, isResetting, rowHeights, resetAfterIndex, onRowExpanded, onRowHovered, onRowsRendered, onRowHeightChange }; }; const useData = (props2, { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }) => { const depthMap = ref({}); const flattenedData = computed(() => { const depths = {}; const { data: data2, rowKey: rowKey2 } = props2; const _expandedRowKeys = unref(expandedRowKeys); if (!_expandedRowKeys || !_expandedRowKeys.length) return data2; const array = []; const keysSet = /* @__PURE__ */ new Set(); _expandedRowKeys.forEach((x) => keysSet.add(x)); let copy = data2.slice(); copy.forEach((x) => depths[x[rowKey2]] = 0); while (copy.length > 0) { const item = copy.shift(); array.push(item); if (keysSet.has(item[rowKey2]) && isArray(item.children) && item.children.length > 0) { copy = [...item.children, ...copy]; item.children.forEach((child) => depths[child[rowKey2]] = depths[item[rowKey2]] + 1); } } depthMap.value = depths; return array; }); const data = computed(() => { const { data: data2, expandColumnKey: expandColumnKey2 } = props2; return expandColumnKey2 ? unref(flattenedData) : data2; }); watch(data, (val, prev) => { if (val !== prev) { lastRenderedRowIndex.value = -1; resetAfterIndex(0, true); } }); return { data, depthMap }; }; const sumReducer = (sum2, num) => sum2 + num; const sum = (listLike) => { return isArray(listLike) ? listLike.reduce(sumReducer, 0) : listLike; }; const tryCall = (fLike, params, defaultRet = {}) => { return isFunction(fLike) ? fLike(params) : fLike ?? defaultRet; }; const enforceUnit = (style) => { [ "width", "maxWidth", "minWidth", "height" ].forEach((key) => { style[key] = addUnit(style[key]); }); return style; }; const componentToSlot = (ComponentLike) => isVNode(ComponentLike) ? (props2) => h(ComponentLike, props2) : ComponentLike; const useStyles = (props2, { columnsTotalWidth, rowsHeight, fixedColumnsOnLeft, fixedColumnsOnRight }) => { const bodyWidth = computed(() => { const { fixed, width, vScrollbarSize } = props2; const ret = width - vScrollbarSize; return fixed ? Math.max(Math.round(unref(columnsTotalWidth)), ret) : ret; }); const mainTableHeight = computed(() => { const { height = 0, maxHeight = 0, footerHeight, hScrollbarSize } = props2; if (maxHeight > 0) { const _fixedRowsHeight = unref(fixedRowsHeight); const _rowsHeight = unref(rowsHeight); const total2 = unref(headerHeight) + _fixedRowsHeight + _rowsHeight + hScrollbarSize; return Math.min(total2, maxHeight - footerHeight); } return height - footerHeight; }); const fixedTableHeight = computed(() => { const { maxHeight } = props2; const tableHeight = unref(mainTableHeight); if (isNumber(maxHeight) && maxHeight > 0) return tableHeight; const totalHeight = unref(rowsHeight) + unref(headerHeight) + unref(fixedRowsHeight); return Math.min(tableHeight, totalHeight); }); const mapColumn = (column) => column.width; const leftTableWidth = computed(() => sum(unref(fixedColumnsOnLeft).map(mapColumn))); const rightTableWidth = computed(() => sum(unref(fixedColumnsOnRight).map(mapColumn))); const headerHeight = computed(() => sum(props2.headerHeight)); const fixedRowsHeight = computed(() => { var _a; return (((_a = props2.fixedData) == null ? void 0 : _a.length) || 0) * props2.rowHeight; }); const windowHeight = computed(() => { return unref(mainTableHeight) - unref(headerHeight) - unref(fixedRowsHeight); }); const rootStyle = computed(() => { const { style = {}, height, width } = props2; return enforceUnit({ ...style, height, width }); }); return { bodyWidth, fixedTableHeight, mainTableHeight, leftTableWidth, rightTableWidth, windowHeight, footerHeight: computed(() => enforceUnit({ height: props2.footerHeight })), emptyStyle: computed(() => ({ top: addUnit(unref(headerHeight)), bottom: addUnit(props2.footerHeight), width: addUnit(props2.width) })), rootStyle, headerHeight }; }; function useTable(props2) { const mainTableRef = ref(); const leftTableRef = ref(); const rightTableRef = ref(); const { columns: columns2, columnsStyles, columnsTotalWidth, fixedColumnsOnLeft, fixedColumnsOnRight, hasFixedColumns, mainColumns, onColumnSorted } = useColumns(props2, toRef(props2, "columns"), toRef(props2, "fixed")); const { scrollTo, scrollToLeft, scrollToTop, scrollToRow, onScroll, onVerticalScroll, scrollPos } = useScrollbar(props2, { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached }); const ns = useNamespace("table-v2"); const instance = getCurrentInstance(); const isScrolling = shallowRef(false); const { expandedRowKeys, lastRenderedRowIndex, isDynamic, isResetting, rowHeights, resetAfterIndex, onRowExpanded, onRowHeightChange, onRowHovered, onRowsRendered } = useRow(props2, { mainTableRef, leftTableRef, rightTableRef, tableInstance: instance, ns, isScrolling }); const { data, depthMap } = useData(props2, { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }); const rowsHeight = computed(() => { const { estimatedRowHeight, rowHeight } = props2; const _data = unref(data); if (isNumber(estimatedRowHeight)) return Object.values(unref(rowHeights)).reduce((acc, curr) => acc + curr, 0); return _data.length * rowHeight; }); const { bodyWidth, fixedTableHeight, mainTableHeight, leftTableWidth, rightTableWidth, windowHeight, footerHeight, emptyStyle, rootStyle, headerHeight } = useStyles(props2, { columnsTotalWidth, fixedColumnsOnLeft, fixedColumnsOnRight, rowsHeight }); const containerRef = ref(); const showEmpty = computed(() => { const noData = unref(data).length === 0; return isArray(props2.fixedData) ? props2.fixedData.length === 0 && noData : noData; }); function getRowHeight(rowIndex) { const { estimatedRowHeight, rowHeight, rowKey: rowKey2 } = props2; if (!estimatedRowHeight) return rowHeight; return unref(rowHeights)[unref(data)[rowIndex][rowKey2]] || estimatedRowHeight; } const isEndReached = ref(false); function onMaybeEndReached() { const { onEndReached } = props2; if (!onEndReached) return; const { scrollTop } = unref(scrollPos); const _totalHeight = unref(rowsHeight); const remainDistance = _totalHeight - (scrollTop + unref(windowHeight)) + props2.hScrollbarSize; if (!isEndReached.value && unref(lastRenderedRowIndex) >= 0 && _totalHeight <= scrollTop + unref(mainTableHeight) - unref(headerHeight)) { isEndReached.value = true; onEndReached(remainDistance); } else isEndReached.value = false; } watch(() => unref(rowsHeight), () => isEndReached.value = false); watch(() => props2.expandedRowKeys, (val) => expandedRowKeys.value = val, { deep: true }); return { columns: columns2, containerRef, mainTableRef, leftTableRef, rightTableRef, isDynamic, isResetting, isScrolling, hasFixedColumns, columnsStyles, columnsTotalWidth, data, expandedRowKeys, depthMap, fixedColumnsOnLeft, fixedColumnsOnRight, mainColumns, bodyWidth, emptyStyle, rootStyle, footerHeight, mainTableHeight, fixedTableHeight, leftTableWidth, rightTableWidth, showEmpty, getRowHeight, onColumnSorted, onRowHovered, onRowExpanded, onRowsRendered, onRowHeightChange, scrollTo, scrollToLeft, scrollToTop, scrollToRow, onScroll, onVerticalScroll }; } const TableV2InjectionKey = Symbol("tableV2"); const TABLE_V2_GRID_INJECTION_KEY = "tableV2GridScrollLeft"; const TableV2Header = /* @__PURE__ */ defineComponent({ name: "ElTableV2Header", props: tableV2HeaderProps, setup(props2, { slots, expose }) { const ns = useNamespace("table-v2"); const scrollLeftInfo = inject(TABLE_V2_GRID_INJECTION_KEY); const headerRef = ref(); const headerStyle = computed(() => enforceUnit({ width: props2.width, height: props2.height })); const rowStyle = computed(() => enforceUnit({ width: props2.rowWidth, height: props2.height })); const headerHeights = computed(() => castArray$1(unref(props2.headerHeight))); const scrollToLeft = (left) => { const headerEl = unref(headerRef); nextTick(() => { (headerEl == null ? void 0 : headerEl.scroll) && headerEl.scroll({ left }); }); }; const renderFixedRows = () => { const fixedRowClassName = ns.e("fixed-header-row"); const { columns: columns2, fixedHeaderData, rowHeight } = props2; return fixedHeaderData == null ? void 0 : fixedHeaderData.map((fixedRowData, fixedRowIndex) => { var _a; const style = enforceUnit({ height: rowHeight, width: "100%" }); return (_a = slots.fixed) == null ? void 0 : _a.call(slots, { class: fixedRowClassName, columns: columns2, rowData: fixedRowData, rowIndex: -(fixedRowIndex + 1), style }); }); }; const renderDynamicRows = () => { const dynamicRowClassName = ns.e("dynamic-header-row"); const { columns: columns2 } = props2; return unref(headerHeights).map((rowHeight, rowIndex) => { var _a; const style = enforceUnit({ width: "100%", height: rowHeight }); return (_a = slots.dynamic) == null ? void 0 : _a.call(slots, { class: dynamicRowClassName, columns: columns2, headerIndex: rowIndex, style }); }); }; onUpdated(() => { if (scrollLeftInfo == null ? void 0 : scrollLeftInfo.value) scrollToLeft(scrollLeftInfo.value); }); expose({ scrollToLeft }); return () => { if (props2.height <= 0) return; return createVNode("div", { "ref": headerRef, "class": props2.class, "style": unref(headerStyle), "role": "rowgroup" }, [createVNode("div", { "style": unref(rowStyle), "class": ns.e("header") }, [renderDynamicRows(), renderFixedRows()])]); }; } }); const COMPONENT_NAME$5 = "ElTableV2Grid"; const useTableGrid = (props2) => { const headerRef = ref(); const bodyRef = ref(); const scrollLeft = ref(0); const totalHeight = computed(() => { const { data, rowHeight, estimatedRowHeight } = props2; if (estimatedRowHeight) return; return data.length * rowHeight; }); const fixedRowHeight = computed(() => { const { fixedData, rowHeight } = props2; return ((fixedData == null ? void 0 : fixedData.length) || 0) * rowHeight; }); const headerHeight = computed(() => sum(props2.headerHeight)); const gridHeight = computed(() => { const { height } = props2; return Math.max(0, height - unref(headerHeight) - unref(fixedRowHeight)); }); const hasHeader = computed(() => { return unref(headerHeight) + unref(fixedRowHeight) > 0; }); const itemKey = ({ data, rowIndex }) => data[rowIndex][props2.rowKey]; function onItemRendered({ rowCacheStart, rowCacheEnd, rowVisibleStart, rowVisibleEnd }) { var _a; (_a = props2.onRowsRendered) == null ? void 0 : _a.call(props2, { rowCacheStart, rowCacheEnd, rowVisibleStart, rowVisibleEnd }); } function resetAfterRowIndex(index, forceUpdate2) { var _a; (_a = bodyRef.value) == null ? void 0 : _a.resetAfterRowIndex(index, forceUpdate2); } function scrollTo(leftOrOptions, top) { const header$ = unref(headerRef); const body$ = unref(bodyRef); if (isObject(leftOrOptions)) { header$ == null ? void 0 : header$.scrollToLeft(leftOrOptions.scrollLeft); scrollLeft.value = leftOrOptions.scrollLeft; body$ == null ? void 0 : body$.scrollTo(leftOrOptions); } else { header$ == null ? void 0 : header$.scrollToLeft(leftOrOptions); scrollLeft.value = leftOrOptions; body$ == null ? void 0 : body$.scrollTo({ scrollLeft: leftOrOptions, scrollTop: top }); } } function scrollToTop(scrollTop) { var _a; (_a = unref(bodyRef)) == null ? void 0 : _a.scrollTo({ scrollTop }); } function scrollToRow(row, strategy) { const body = unref(bodyRef); if (!body) return; const prevScrollLeft = scrollLeft.value; body.scrollToItem(row, 0, strategy); if (prevScrollLeft) scrollTo({ scrollLeft: prevScrollLeft }); } function forceUpdate() { var _a, _b; (_a = unref(bodyRef)) == null ? void 0 : _a.$forceUpdate(); (_b = unref(headerRef)) == null ? void 0 : _b.$forceUpdate(); } watch(() => props2.bodyWidth, () => { var _a; if (isNumber(props2.estimatedRowHeight)) (_a = bodyRef.value) == null ? void 0 : _a.resetAfter({ columnIndex: 0 }, false); }); return { bodyRef, forceUpdate, fixedRowHeight, gridHeight, hasHeader, headerHeight, headerRef, totalHeight, itemKey, onItemRendered, resetAfterRowIndex, scrollTo, scrollToTop, scrollToRow, scrollLeft }; }; const TableGrid = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$5, props: tableV2GridProps, setup(props2, { slots, expose }) { const { ns } = inject(TableV2InjectionKey); const { bodyRef, fixedRowHeight, gridHeight, hasHeader, headerRef, headerHeight, totalHeight, forceUpdate, itemKey, onItemRendered, resetAfterRowIndex, scrollTo, scrollToTop, scrollToRow, scrollLeft } = useTableGrid(props2); provide(TABLE_V2_GRID_INJECTION_KEY, scrollLeft); onActivated(async () => { var _a; await nextTick(); const scrollTop = (_a = bodyRef.value) == null ? void 0 : _a.states.scrollTop; scrollTop && scrollToTop(Math.round(scrollTop) + 1); }); expose({ forceUpdate, totalHeight, scrollTo, scrollToTop, scrollToRow, resetAfterRowIndex }); const getColumnWidth = () => props2.bodyWidth; return () => { const { cache: cache2, columns: columns2, data, fixedData, useIsScrolling, scrollbarAlwaysOn, scrollbarEndGap, scrollbarStartGap, style, rowHeight, bodyWidth, estimatedRowHeight, headerWidth, height, width, getRowHeight, onScroll } = props2; const isDynamicRowEnabled = isNumber(estimatedRowHeight); const Grid = isDynamicRowEnabled ? DynamicSizeGrid : FixedSizeGrid; const _headerHeight = unref(headerHeight); return createVNode("div", { "role": "table", "class": [ns.e("table"), props2.class], "style": style }, [createVNode(Grid, { "ref": bodyRef, "data": data, "useIsScrolling": useIsScrolling, "itemKey": itemKey, "columnCache": 0, "columnWidth": isDynamicRowEnabled ? getColumnWidth : bodyWidth, "totalColumn": 1, "totalRow": data.length, "rowCache": cache2, "rowHeight": isDynamicRowEnabled ? getRowHeight : rowHeight, "width": width, "height": unref(gridHeight), "class": ns.e("body"), "role": "rowgroup", "scrollbarStartGap": scrollbarStartGap, "scrollbarEndGap": scrollbarEndGap, "scrollbarAlwaysOn": scrollbarAlwaysOn, "onScroll": onScroll, "onItemRendered": onItemRendered, "perfMode": false }, { default: (params) => { var _a; const rowData = data[params.rowIndex]; return (_a = slots.row) == null ? void 0 : _a.call(slots, { ...params, columns: columns2, rowData }); } }), unref(hasHeader) && createVNode(TableV2Header, { "ref": headerRef, "class": ns.e("header-wrapper"), "columns": columns2, "headerData": data, "headerHeight": props2.headerHeight, "fixedHeaderData": fixedData, "rowWidth": headerWidth, "rowHeight": rowHeight, "width": width, "height": Math.min(_headerHeight + unref(fixedRowHeight), height) }, { dynamic: slots.header, fixed: slots.row })]); }; } }); function _isSlot$5(s) { return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s); } const MainTable = (props2, { slots }) => { const { mainTableRef, ...rest } = props2; return createVNode(TableGrid, mergeProps({ "ref": mainTableRef }, rest), _isSlot$5(slots) ? slots : { default: () => [slots] }); }; function _isSlot$4(s) { return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s); } const LeftTable = (props2, { slots }) => { if (!props2.columns.length) return; const { leftTableRef, ...rest } = props2; return createVNode(TableGrid, mergeProps({ "ref": leftTableRef }, rest), _isSlot$4(slots) ? slots : { default: () => [slots] }); }; function _isSlot$3(s) { return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s); } const RightTable = (props2, { slots }) => { if (!props2.columns.length) return; const { rightTableRef, ...rest } = props2; return createVNode(TableGrid, mergeProps({ "ref": rightTableRef }, rest), _isSlot$3(slots) ? slots : { default: () => [slots] }); }; const useTableRow = (props2) => { const { isScrolling } = inject(TableV2InjectionKey); const measured = ref(false); const rowRef = ref(); const measurable = computed(() => { return isNumber(props2.estimatedRowHeight) && props2.rowIndex >= 0; }); const doMeasure = (isInit = false) => { const $rowRef = unref(rowRef); if (!$rowRef) return; const { columns: columns2, onRowHeightChange, rowKey: rowKey2, rowIndex, style } = props2; const { height } = $rowRef.getBoundingClientRect(); measured.value = true; nextTick(() => { if (isInit || height !== Number.parseInt(style.height)) { const firstColumn = columns2[0]; const isPlaceholder = (firstColumn == null ? void 0 : firstColumn.placeholderSign) === placeholderSign; onRowHeightChange == null ? void 0 : onRowHeightChange({ rowKey: rowKey2, height, rowIndex }, firstColumn && !isPlaceholder && firstColumn.fixed); } }); }; const eventHandlers = computed(() => { const { rowData, rowIndex, rowKey: rowKey2, onRowHover } = props2; const handlers = props2.rowEventHandlers || {}; const eventHandlers2 = {}; Object.entries(handlers).forEach(([eventName, handler]) => { if (isFunction(handler)) eventHandlers2[eventName] = (event) => { handler({ event, rowData, rowIndex, rowKey: rowKey2 }); }; }); if (onRowHover) [{ name: "onMouseleave", hovered: false }, { name: "onMouseenter", hovered: true }].forEach(({ name, hovered }) => { const existedHandler = eventHandlers2[name]; eventHandlers2[name] = (event) => { onRowHover({ event, hovered, rowData, rowIndex, rowKey: rowKey2 }); existedHandler == null ? void 0 : existedHandler(event); }; }); return eventHandlers2; }); const onExpand = (expanded) => { const { onRowExpand, rowData, rowIndex, rowKey: rowKey2 } = props2; onRowExpand == null ? void 0 : onRowExpand({ expanded, rowData, rowIndex, rowKey: rowKey2 }); }; onMounted(() => { if (unref(measurable)) doMeasure(true); }); return { isScrolling, measurable, measured, rowRef, eventHandlers, onExpand }; }; const TableV2Row = /* @__PURE__ */ defineComponent({ name: "ElTableV2TableRow", props: tableV2RowProps, setup(props2, { expose, slots, attrs }) { const { eventHandlers, isScrolling, measurable, measured, rowRef, onExpand } = useTableRow(props2); expose({ onExpand }); return () => { const { columns: columns2, columnsStyles, expandColumnKey: expandColumnKey2, depth, rowData, rowIndex, style } = props2; let ColumnCells = columns2.map((column, columnIndex) => { const expandable = isArray(rowData.children) && rowData.children.length > 0 && column.key === expandColumnKey2; return slots.cell({ column, columns: columns2, columnIndex, depth, style: columnsStyles[column.key], rowData, rowIndex, isScrolling: unref(isScrolling), expandIconProps: expandable ? { rowData, rowIndex, onExpand } : void 0 }); }); if (slots.row) ColumnCells = slots.row({ cells: ColumnCells.map((node) => { if (isArray(node) && node.length === 1) return node[0]; return node; }), style, columns: columns2, depth, rowData, rowIndex, isScrolling: unref(isScrolling) }); if (unref(measurable)) { const { height, ...exceptHeightStyle } = style || {}; const _measured = unref(measured); return createVNode("div", mergeProps({ "ref": rowRef, "class": props2.class, "style": _measured ? style : exceptHeightStyle, "role": "row" }, attrs, unref(eventHandlers)), [ColumnCells]); } return createVNode("div", mergeProps(attrs, { "ref": rowRef, "class": props2.class, "style": style, "role": "row" }, unref(eventHandlers)), [ColumnCells]); }; } }); function _isSlot$2(s) { return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s); } const RowRenderer = (props2, { slots }) => { const { columns: columns2, columnsStyles, depthMap, expandColumnKey: expandColumnKey2, expandedRowKeys, estimatedRowHeight, hasFixedColumns, rowData, rowIndex, style, isScrolling, rowProps: rowProps2, rowClass, rowKey: rowKey2, rowEventHandlers, ns, onRowHovered, onRowExpanded } = props2; const rowKls = tryCall(rowClass, { columns: columns2, rowData, rowIndex }, ""); const additionalProps = tryCall(rowProps2, { columns: columns2, rowData, rowIndex }); const _rowKey = rowData[rowKey2]; const depth = depthMap[_rowKey] || 0; const canExpand = Boolean(expandColumnKey2); const isFixedRow = rowIndex < 0; const kls = [ ns.e("row"), rowKls, ns.is("expanded", canExpand && expandedRowKeys.includes(_rowKey)), ns.is("fixed", !depth && isFixedRow), ns.is("customized", Boolean(slots.row)), { [ns.e(`row-depth-${depth}`)]: canExpand && rowIndex >= 0 } ]; const onRowHover = hasFixedColumns ? onRowHovered : void 0; const _rowProps = { ...additionalProps, columns: columns2, columnsStyles, class: kls, depth, expandColumnKey: expandColumnKey2, estimatedRowHeight: isFixedRow ? void 0 : estimatedRowHeight, isScrolling, rowIndex, rowData, rowKey: _rowKey, rowEventHandlers, style }; const handlerMouseEnter = (e) => { onRowHover == null ? void 0 : onRowHover({ hovered: true, rowKey: _rowKey, event: e, rowData, rowIndex }); }; const handlerMouseLeave = (e) => { onRowHover == null ? void 0 : onRowHover({ hovered: false, rowKey: _rowKey, event: e, rowData, rowIndex }); }; return createVNode(TableV2Row, mergeProps(_rowProps, { "onRowExpand": onRowExpanded, "onMouseenter": handlerMouseEnter, "onMouseleave": handlerMouseLeave, "rowkey": _rowKey }), _isSlot$2(slots) ? slots : { default: () => [slots] }); }; const TableV2Cell = (props2, { slots }) => { var _a; const { cellData, style } = props2; const displayText = ((_a = cellData == null ? void 0 : cellData.toString) == null ? void 0 : _a.call(cellData)) || ""; const defaultSlot = renderSlot(slots, "default", props2, () => [displayText]); return createVNode("div", { "class": props2.class, "title": displayText, "style": style }, [defaultSlot]); }; TableV2Cell.displayName = "ElTableV2Cell"; TableV2Cell.inheritAttrs = false; const ExpandIcon = (props2) => { const { expanded, expandable, onExpand, style, size, ariaLabel } = props2; return createVNode("button", mergeProps({ onClick: expandable ? () => onExpand(!expanded) : void 0, ariaLabel, ariaExpanded: expanded, class: props2.class }, { "type": "button" }), [createVNode(ElIcon, { "size": size, "style": style }, { default: () => [createVNode(arrow_right_default, null, null)] })]); }; ExpandIcon.inheritAttrs = false; const CellRenderer = ({ columns: columns2, column, columnIndex, depth, expandIconProps, isScrolling, rowData, rowIndex, style, expandedRowKeys, ns, t, cellProps: _cellProps, expandColumnKey: expandColumnKey2, indentSize, iconSize, rowKey: rowKey2 }, { slots }) => { const cellStyle = enforceUnit(style); if (column.placeholderSign === placeholderSign) return createVNode("div", { "class": ns.em("row-cell", "placeholder"), "style": cellStyle }, null); const { cellRenderer, dataKey, dataGetter } = column; const cellData = isFunction(dataGetter) ? dataGetter({ columns: columns2, column, columnIndex, rowData, rowIndex }) : get(rowData, dataKey ?? ""); const extraCellProps = tryCall(_cellProps, { cellData, columns: columns2, column, columnIndex, rowIndex, rowData }); const cellProps = { class: ns.e("cell-text"), columns: columns2, column, columnIndex, cellData, isScrolling, rowData, rowIndex }; const columnCellRenderer = componentToSlot(cellRenderer); const Cell = columnCellRenderer ? columnCellRenderer(cellProps) : renderSlot(slots, "default", cellProps, () => [createVNode(TableV2Cell, cellProps, null)]); const kls = [ ns.e("row-cell"), column.class, column.align === Alignment.CENTER && ns.is("align-center"), column.align === Alignment.RIGHT && ns.is("align-right") ]; const expandable = rowIndex >= 0 && expandColumnKey2 && column.key === expandColumnKey2; const expanded = rowIndex >= 0 && expandedRowKeys.includes(rowData[rowKey2]); let IconOrPlaceholder; const iconStyle = `margin-inline-start: ${depth * indentSize}px;`; if (expandable) if (isObject(expandIconProps)) IconOrPlaceholder = createVNode(ExpandIcon, mergeProps(expandIconProps, { "class": [ns.e("expand-icon"), ns.is("expanded", expanded)], "size": iconSize, "expanded": expanded, "ariaLabel": t(expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"), "style": iconStyle, "expandable": true }), null); else IconOrPlaceholder = createVNode("div", { "style": [iconStyle, `width: ${iconSize}px; height: ${iconSize}px;`].join(" ") }, null); return createVNode("div", mergeProps({ "class": kls, "style": cellStyle }, extraCellProps, { "role": "cell" }), [IconOrPlaceholder, Cell]); }; CellRenderer.inheritAttrs = false; const tableV2HeaderRowProps = buildProps({ class: String, columns, columnsStyles: { type: definePropType(Object), required: true }, headerIndex: Number, style: { type: definePropType(Object) } }); const TableV2HeaderRow = /* @__PURE__ */ defineComponent({ name: "ElTableV2HeaderRow", props: tableV2HeaderRowProps, setup(props2, { slots }) { return () => { const { columns: columns2, columnsStyles, headerIndex, style } = props2; let Cells = columns2.map((column, columnIndex) => { return slots.cell({ columns: columns2, column, columnIndex, headerIndex, style: columnsStyles[column.key] }); }); if (slots.header) Cells = slots.header({ cells: Cells.map((node) => { if (isArray(node) && node.length === 1) return node[0]; return node; }), columns: columns2, headerIndex }); return createVNode("div", { "class": props2.class, "style": style, "role": "row" }, [Cells]); }; } }); function _isSlot$1(s) { return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s); } const HeaderRenderer = ({ columns: columns2, columnsStyles, headerIndex, style, headerClass, headerProps, ns }, { slots }) => { const param = { columns: columns2, headerIndex }; const kls = [ ns.e("header-row"), tryCall(headerClass, param, ""), ns.is("customized", Boolean(slots.header)) ]; return createVNode(TableV2HeaderRow, { ...tryCall(headerProps, param), columnsStyles, class: kls, columns: columns2, headerIndex, style }, _isSlot$1(slots) ? slots : { default: () => [slots] }); }; const HeaderCell = (props2, { slots }) => renderSlot(slots, "default", props2, () => { var _a, _b; return [createVNode("div", { "class": props2.class, "title": (_a = props2.column) == null ? void 0 : _a.title }, [(_b = props2.column) == null ? void 0 : _b.title])]; }); HeaderCell.displayName = "ElTableV2HeaderCell"; HeaderCell.inheritAttrs = false; const SortIcon = (props2) => { const { sortOrder } = props2; return createVNode("button", { "type": "button", "aria-label": props2.ariaLabel, "class": props2.class }, [createVNode(ElIcon, { "size": 14 }, { default: () => [sortOrder === SortOrder.ASC ? createVNode(sort_up_default, null, null) : createVNode(sort_down_default, null, null)] })]); }; const HeaderCellRenderer = (props2, { slots }) => { const { column, ns, t, style, onColumnSorted } = props2; const cellStyle = enforceUnit(style); if (column.placeholderSign === placeholderSign) return createVNode("div", { "class": ns.em("header-row-cell", "placeholder"), "style": cellStyle }, null); const { headerCellRenderer, headerClass, sortable } = column; const cellProps = { ...props2, class: ns.e("header-cell-text") }; const columnCellRenderer = componentToSlot(headerCellRenderer); const Cell = columnCellRenderer ? columnCellRenderer(cellProps) : renderSlot(slots, "default", cellProps, () => [createVNode(HeaderCell, cellProps, null)]); const { sortBy, sortState, headerCellProps } = props2; let sorting, sortOrder, ariaSort; if (sortState) { const order = sortState[column.key]; sorting = Boolean(oppositeOrderMap[order]); sortOrder = sorting ? order : SortOrder.ASC; } else { sorting = column.key === sortBy.key; sortOrder = sorting ? sortBy.order : SortOrder.ASC; } if (sortOrder === SortOrder.ASC) ariaSort = "ascending"; else if (sortOrder === SortOrder.DESC) ariaSort = "descending"; else ariaSort = void 0; const cellKls = [ ns.e("header-cell"), tryCall(headerClass, props2, ""), column.align === Alignment.CENTER && ns.is("align-center"), column.align === Alignment.RIGHT && ns.is("align-right"), sortable && ns.is("sortable") ]; return createVNode("div", mergeProps({ ...tryCall(headerCellProps, props2), onClick: column.sortable ? onColumnSorted : void 0, ariaSort: sortable ? ariaSort : void 0, class: cellKls, style: cellStyle, ["data-key"]: column.key }, { "role": "columnheader" }), [Cell, sortable && createVNode(SortIcon, { "class": [ns.e("sort-icon"), sorting && ns.is("sorting")], "sortOrder": sortOrder, "ariaLabel": t("el.table.sortLabel", { column: column.title || "" }) }, null)]); }; const Footer$1 = (props2, { slots }) => { var _a; return createVNode("div", { "class": props2.class, "style": props2.style }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]); }; Footer$1.displayName = "ElTableV2Footer"; const Footer = (props2, { slots }) => { const defaultSlot = renderSlot(slots, "default", {}, () => [createVNode(ElEmpty, null, null)]); return createVNode("div", { "class": props2.class, "style": props2.style }, [defaultSlot]); }; Footer.displayName = "ElTableV2Empty"; const Overlay = (props2, { slots }) => { var _a; return createVNode("div", { "class": props2.class, "style": props2.style }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]); }; Overlay.displayName = "ElTableV2Overlay"; function _isSlot(s) { return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s); } const TableV2 = /* @__PURE__ */ defineComponent({ name: "ElTableV2", props: tableV2Props, slots: Object, setup(props2, { slots, expose }) { const ns = useNamespace("table-v2"); const { t } = useLocale(); const { columnsStyles, fixedColumnsOnLeft, fixedColumnsOnRight, mainColumns, mainTableHeight, fixedTableHeight, leftTableWidth, rightTableWidth, data, depthMap, expandedRowKeys, hasFixedColumns, mainTableRef, leftTableRef, rightTableRef, isDynamic, isResetting, isScrolling, bodyWidth, emptyStyle, rootStyle, footerHeight, showEmpty, scrollTo, scrollToLeft, scrollToTop, scrollToRow, getRowHeight, onColumnSorted, onRowHeightChange, onRowHovered, onRowExpanded, onRowsRendered, onScroll, onVerticalScroll } = useTable(props2); expose({ scrollTo, scrollToLeft, scrollToTop, scrollToRow }); provide(TableV2InjectionKey, { ns, isResetting, isScrolling }); return () => { const { cache: cache2, cellProps, estimatedRowHeight, expandColumnKey: expandColumnKey2, fixedData, headerHeight, headerClass, headerProps, headerCellProps, sortBy, sortState, rowHeight, rowClass, rowEventHandlers, rowKey: rowKey2, rowProps: rowProps2, scrollbarAlwaysOn, indentSize, iconSize, useIsScrolling, vScrollbarSize, width } = props2; const _data = unref(data); const mainTableProps = { cache: cache2, class: ns.e("main"), columns: unref(mainColumns), data: _data, fixedData, estimatedRowHeight, bodyWidth: unref(bodyWidth), headerHeight, headerWidth: unref(bodyWidth), height: unref(mainTableHeight), mainTableRef, rowKey: rowKey2, rowHeight, scrollbarAlwaysOn, scrollbarStartGap: 2, scrollbarEndGap: vScrollbarSize, useIsScrolling, width, getRowHeight, onRowsRendered, onScroll }; const leftColumnsWidth = unref(leftTableWidth); const _fixedTableHeight = unref(fixedTableHeight); const leftTableProps = { cache: cache2, class: ns.e("left"), columns: unref(fixedColumnsOnLeft), data: _data, fixedData, estimatedRowHeight, leftTableRef, rowHeight, bodyWidth: leftColumnsWidth, headerWidth: leftColumnsWidth, headerHeight, height: _fixedTableHeight, rowKey: rowKey2, scrollbarAlwaysOn, scrollbarStartGap: 2, scrollbarEndGap: vScrollbarSize, useIsScrolling, width: leftColumnsWidth, getRowHeight, onScroll: onVerticalScroll }; const rightColumnsWidth = unref(rightTableWidth); const rightTableProps = { cache: cache2, class: ns.e("right"), columns: unref(fixedColumnsOnRight), data: _data, fixedData, estimatedRowHeight, rightTableRef, rowHeight, bodyWidth: rightColumnsWidth, headerWidth: rightColumnsWidth, headerHeight, height: _fixedTableHeight, rowKey: rowKey2, scrollbarAlwaysOn, scrollbarStartGap: 2, scrollbarEndGap: vScrollbarSize, width: rightColumnsWidth, style: `${ns.cssVarName("table-scrollbar-size")}: ${vScrollbarSize}px`, useIsScrolling, getRowHeight, onScroll: onVerticalScroll }; const _columnsStyles = unref(columnsStyles); const tableRowProps = { ns, depthMap: unref(depthMap), columnsStyles: _columnsStyles, expandColumnKey: expandColumnKey2, expandedRowKeys: unref(expandedRowKeys), estimatedRowHeight, hasFixedColumns: unref(hasFixedColumns), rowProps: rowProps2, rowClass, rowKey: rowKey2, rowEventHandlers, onRowHovered, onRowExpanded, onRowHeightChange }; const tableCellProps = { cellProps, expandColumnKey: expandColumnKey2, indentSize, iconSize, rowKey: rowKey2, expandedRowKeys: unref(expandedRowKeys), ns, t }; const tableHeaderProps = { ns, headerClass, headerProps, columnsStyles: _columnsStyles }; const tableHeaderCellProps = { ns, t, sortBy, sortState, headerCellProps, onColumnSorted }; const tableSlots = { row: (props3) => createVNode(RowRenderer, mergeProps(props3, tableRowProps), { row: slots.row, cell: (props4) => { let _slot; return slots.cell ? createVNode(CellRenderer, mergeProps(props4, tableCellProps, { "style": _columnsStyles[props4.column.key] }), _isSlot(_slot = slots.cell(props4)) ? _slot : { default: () => [_slot] }) : createVNode(CellRenderer, mergeProps(props4, tableCellProps, { "style": _columnsStyles[props4.column.key] }), null); } }), header: (props3) => createVNode(HeaderRenderer, mergeProps(props3, tableHeaderProps), { header: slots.header, cell: (props4) => { let _slot2; return slots["header-cell"] ? createVNode(HeaderCellRenderer, mergeProps(props4, tableHeaderCellProps, { "style": _columnsStyles[props4.column.key] }), _isSlot(_slot2 = slots["header-cell"](props4)) ? _slot2 : { default: () => [_slot2] }) : createVNode(HeaderCellRenderer, mergeProps(props4, tableHeaderCellProps, { "style": _columnsStyles[props4.column.key] }), null); } }) }; const rootKls = [ props2.class, ns.b(), ns.e("root"), ns.is("dynamic", unref(isDynamic)) ]; const footerProps = { class: ns.e("footer"), style: unref(footerHeight) }; return createVNode("div", { "class": rootKls, "style": unref(rootStyle) }, [ createVNode(MainTable, mainTableProps, _isSlot(tableSlots) ? tableSlots : { default: () => [tableSlots] }), createVNode(LeftTable, leftTableProps, _isSlot(tableSlots) ? tableSlots : { default: () => [tableSlots] }), createVNode(RightTable, rightTableProps, _isSlot(tableSlots) ? tableSlots : { default: () => [tableSlots] }), slots.footer && createVNode(Footer$1, footerProps, { default: slots.footer }), unref(showEmpty) && createVNode(Footer, { "class": ns.e("empty"), "style": unref(emptyStyle) }, { default: slots.empty }), slots.overlay && createVNode(Overlay, { "class": ns.e("overlay") }, { default: slots.overlay }) ]); }; } }); const autoResizerProps = buildProps({ disableWidth: Boolean, disableHeight: Boolean, onResize: { type: definePropType(Function) } }); const useAutoResize = (props2) => { const sizer = ref(); const width$ = ref(0); const height$ = ref(0); let resizerStopper; onMounted(() => { resizerStopper = useResizeObserver(sizer, ([entry]) => { const { width, height } = entry.contentRect; const { paddingLeft, paddingRight, paddingTop, paddingBottom } = getComputedStyle(entry.target); const left = Number.parseInt(paddingLeft) || 0; const right = Number.parseInt(paddingRight) || 0; const top = Number.parseInt(paddingTop) || 0; const bottom = Number.parseInt(paddingBottom) || 0; width$.value = width - left - right; height$.value = height - top - bottom; }).stop; }); onBeforeUnmount(() => { resizerStopper == null ? void 0 : resizerStopper(); }); watch([width$, height$], ([width, height]) => { var _a; (_a = props2.onResize) == null ? void 0 : _a.call(props2, { width, height }); }); return { sizer, width: width$, height: height$ }; }; const AutoResizer = /* @__PURE__ */ defineComponent({ name: "ElAutoResizer", props: autoResizerProps, setup(props2, { slots }) { const ns = useNamespace("auto-resizer"); const { height, width, sizer } = useAutoResize(props2); const style = { width: "100%", height: "100%" }; return () => { var _a; return createVNode("div", { "ref": sizer, "class": ns.b(), "style": style }, [(_a = slots.default) == null ? void 0 : _a.call(slots, { height: height.value, width: width.value })]); }; } }); const ElTableV2 = withInstall(TableV2); const ElAutoResizer = withInstall(AutoResizer); const tabsRootContextKey = Symbol("tabsRootContextKey"); const tabBarProps = buildProps({ tabs: { type: definePropType(Array), default: () => mutable([]) }, tabRefs: { type: definePropType(Object), default: () => mutable({}) } }); const COMPONENT_NAME$4 = "ElTabBar"; var tab_bar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$4, __name: "tab-bar", props: tabBarProps, setup(__props, { expose: __expose }) { const props2 = __props; const rootTabs = inject(tabsRootContextKey); if (!rootTabs) throwError(COMPONENT_NAME$4, ""); const ns = useNamespace("tabs"); const barRef = ref(); const barStyle = ref(); const renderActiveBar = computed(() => { var _a; return isUndefined(rootTabs.props.defaultValue) || Boolean((_a = barStyle.value) == null ? void 0 : _a.transform); }); const getBarStyle = () => { let offset2 = 0; let tabSize = 0; const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height"; const sizeDir = sizeName === "width" ? "x" : "y"; const position = sizeDir === "x" ? "left" : "top"; props2.tabs.every((tab) => { if (isUndefined(tab.paneName)) return false; const $el = props2.tabRefs[tab.paneName]; if (!$el) return false; if (!tab.active) return true; offset2 = $el[`offset${capitalize(position)}`]; tabSize = $el[`client${capitalize(sizeName)}`]; const tabStyles = window.getComputedStyle($el); if (sizeName === "width") { tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight); offset2 += Number.parseFloat(tabStyles.paddingLeft); } return false; }); return { [sizeName]: `${tabSize}px`, transform: `translate${capitalize(sizeDir)}(${offset2}px)` }; }; const update = () => barStyle.value = getBarStyle(); const tabObservers = []; const observerTabs = () => { tabObservers.forEach((observer) => observer.stop()); tabObservers.length = 0; Object.values(props2.tabRefs).forEach((tab) => { tabObservers.push(useResizeObserver(tab, update)); }); }; watch(() => props2.tabs, async () => { await nextTick(); update(); observerTabs(); }, { immediate: true }); const barObserver = useResizeObserver(barRef, () => update()); onBeforeUnmount(() => { tabObservers.forEach((observer) => observer.stop()); tabObservers.length = 0; barObserver.stop(); }); __expose({ ref: barRef, update }); return (_ctx, _cache) => { return renderActiveBar.value ? (openBlock(), createElementBlock("div", { key: 0, ref_key: "barRef", ref: barRef, class: normalizeClass([unref(ns).e("active-bar"), unref(ns).is(unref(rootTabs).props.tabPosition)]), style: normalizeStyle(barStyle.value) }, null, 6)) : createCommentVNode("v-if", true); }; } }); var tab_bar_default = tab_bar_vue_vue_type_script_setup_true_lang_default; const tabNavProps = buildProps({ panes: { type: definePropType(Array), default: () => mutable([]) }, currentName: { type: [String, Number], default: "" }, editable: Boolean, type: { type: String, values: [ "card", "border-card", "" ], default: "" }, stretch: Boolean, tabindex: { type: [String, Number], default: void 0 } }); const tabNavEmits = { tabClick: (tab, tabName, ev) => ev instanceof Event, tabRemove: (tab, ev) => ev instanceof Event }; const COMPONENT_NAME$3 = "ElTabNav"; const TabNav = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$3, props: tabNavProps, emits: tabNavEmits, setup(props2, { expose, emit }) { const rootTabs = inject(tabsRootContextKey); if (!rootTabs) throwError(COMPONENT_NAME$3, ``); const ns = useNamespace("tabs"); const visibility = useDocumentVisibility(); const focused = useWindowFocus(); const navScroll$ = ref(); const nav$ = ref(); const el$ = ref(); const tabRefsMap = ref({}); const tabBarRef = ref(); const scrollable = ref(false); const navOffset = ref(0); const isFocus = ref(false); const focusable = ref(true); const isWheelScrolling = ref(false); const tracker = shallowRef(); const isHorizontal2 = computed(() => ["top", "bottom"].includes(rootTabs.props.tabPosition)); const sizeName = computed(() => isHorizontal2.value ? "width" : "height"); const navStyle = computed(() => { const dir = sizeName.value === "width" ? "X" : "Y"; return { transition: isWheelScrolling.value ? "none" : void 0, transform: `translate${dir}(-${navOffset.value}px)` }; }); const { width: navContainerWidth, height: navContainerHeight } = useElementSize(navScroll$); const { width: navWidth, height: navHeight } = useElementSize(nav$, { width: 0, height: 0 }, { box: "border-box" }); const navContainerSize = computed(() => isHorizontal2.value ? navContainerWidth.value : navContainerHeight.value); const navSize = computed(() => isHorizontal2.value ? navWidth.value : navHeight.value); const { onWheel } = useWheel({ atStartEdge: computed(() => navOffset.value <= 0), atEndEdge: computed(() => navSize.value - navOffset.value <= navContainerSize.value), layout: computed(() => isHorizontal2.value ? "horizontal" : "vertical") }, (offset2) => { navOffset.value = clamp(navOffset.value + offset2, 0, navSize.value - navContainerSize.value); }); const handleWheel = (event) => { isWheelScrolling.value = true; onWheel(event); rAF(() => { isWheelScrolling.value = false; }); }; const scrollPrev = () => { if (!navScroll$.value) return; const containerSize = navScroll$.value.getBoundingClientRect()[sizeName.value]; const currentOffset = navOffset.value; if (!currentOffset) return; navOffset.value = currentOffset > containerSize ? currentOffset - containerSize : 0; }; const scrollNext = () => { if (!navScroll$.value || !nav$.value) return; const navSize2 = nav$.value.getBoundingClientRect()[sizeName.value]; const containerSize = navScroll$.value.getBoundingClientRect()[sizeName.value]; const currentOffset = navOffset.value; if (!isGreaterThan(navSize2 - currentOffset, containerSize)) return; navOffset.value = navSize2 - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize2 - containerSize; }; const scrollToActiveTab = async () => { const nav = nav$.value; if (!scrollable.value || !el$.value || !navScroll$.value || !nav) return; await nextTick(); const activeTab = tabRefsMap.value[props2.currentName]; if (!activeTab) return; const navScroll = navScroll$.value; const activeTabBounding = activeTab.getBoundingClientRect(); const navScrollBounding = navScroll.getBoundingClientRect(); const navScrollLeft = navScrollBounding.left + 1; const navScrollRight = navScrollBounding.right - 1; const navBounding = nav.getBoundingClientRect(); const maxOffset = isHorizontal2.value ? navBounding.width - navScrollBounding.width : navBounding.height - navScrollBounding.height; const currentOffset = navOffset.value; let newOffset = currentOffset; if (isHorizontal2.value) { if (activeTabBounding.left < navScrollLeft) newOffset = currentOffset - (navScrollLeft - activeTabBounding.left); if (activeTabBounding.right > navScrollRight) newOffset = currentOffset + activeTabBounding.right - navScrollRight; } else { if (activeTabBounding.top < navScrollBounding.top) newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top); if (activeTabBounding.bottom > navScrollBounding.bottom) newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom); } newOffset = Math.max(newOffset, 0); navOffset.value = Math.min(newOffset, maxOffset); }; const update = () => { var _a; if (!nav$.value || !navScroll$.value) return; props2.stretch && ((_a = tabBarRef.value) == null ? void 0 : _a.update()); const navSize2 = nav$.value.getBoundingClientRect()[sizeName.value]; const containerSize = navScroll$.value.getBoundingClientRect()[sizeName.value]; const currentOffset = navOffset.value; if (containerSize < navSize2) { scrollable.value = scrollable.value || {}; scrollable.value.prev = currentOffset; scrollable.value.next = isGreaterThan(navSize2, currentOffset + containerSize); if (isGreaterThan(containerSize, navSize2 - currentOffset)) navOffset.value = navSize2 - containerSize; } else { scrollable.value = false; if (currentOffset > 0) navOffset.value = 0; } }; const changeTab = (event) => { const code = getEventCode(event); let step2 = 0; switch (code) { case EVENT_CODE.left: case EVENT_CODE.up: step2 = -1; break; case EVENT_CODE.right: case EVENT_CODE.down: step2 = 1; break; default: return; } const tabList = Array.from(event.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")); let nextIndex = tabList.indexOf(event.target) + step2; if (nextIndex < 0) nextIndex = tabList.length - 1; else if (nextIndex >= tabList.length) nextIndex = 0; tabList[nextIndex].focus({ preventScroll: true }); tabList[nextIndex].click(); setFocus(); }; const setFocus = () => { if (focusable.value) isFocus.value = true; }; const removeFocus = () => isFocus.value = false; const setRefs = (el, key) => { tabRefsMap.value[key] = el; }; const focusActiveTab = async () => { var _a; await nextTick(); (_a = tabRefsMap.value[props2.currentName]) == null ? void 0 : _a.focus({ preventScroll: true }); }; watch(visibility, (visibility2) => { if (visibility2 === "hidden") focusable.value = false; else if (visibility2 === "visible") setTimeout(() => focusable.value = true, 50); }); watch(focused, (focused2) => { if (focused2) setTimeout(() => focusable.value = true, 50); else focusable.value = false; }); useResizeObserver(el$, () => { rAF(update); }); onMounted(() => setTimeout(() => scrollToActiveTab(), 0)); onUpdated(() => update()); expose({ scrollToActiveTab, removeFocus, focusActiveTab, tabListRef: nav$, tabBarRef, scheduleRender: () => triggerRef(tracker) }); return () => { const scrollBtn = scrollable.value ? [createVNode("span", { "class": [ns.e("nav-prev"), ns.is("disabled", !scrollable.value.prev)], "onClick": scrollPrev }, [createVNode(ElIcon, null, { default: () => [createVNode(arrow_left_default, null, null)] })]), createVNode("span", { "class": [ns.e("nav-next"), ns.is("disabled", !scrollable.value.next)], "onClick": scrollNext }, [createVNode(ElIcon, null, { default: () => [createVNode(arrow_right_default, null, null)] })])] : null; const tabs = props2.panes.map((pane, index) => { var _a, _b; const uid2 = pane.uid; const disabled = pane.props.disabled; const tabName = pane.props.name ?? pane.index ?? `${index}`; const closable = !disabled && (pane.isClosable || pane.props.closable !== false && props2.editable); pane.index = `${index}`; const btnClose = closable ? createVNode(ElIcon, { "class": "is-icon-close", "onClick": (ev) => emit("tabRemove", pane, ev) }, { default: () => [createVNode(close_default, null, null)] }) : null; const tabLabelContent = ((_b = (_a = pane.slots).label) == null ? void 0 : _b.call(_a)) || pane.props.label; const tabindex = !disabled && pane.active ? props2.tabindex ?? rootTabs.props.tabindex : -1; return createVNode("div", { "ref": (el) => setRefs(el, tabName), "class": [ ns.e("item"), ns.is(rootTabs.props.tabPosition), ns.is("active", pane.active), ns.is("disabled", disabled), ns.is("closable", closable), ns.is("focus", isFocus.value) ], "id": `tab-${tabName}`, "key": `tab-${uid2}`, "aria-controls": `pane-${tabName}`, "role": "tab", "aria-selected": pane.active, "tabindex": tabindex, "onFocus": () => setFocus(), "onBlur": () => removeFocus(), "onClick": (ev) => { removeFocus(); emit("tabClick", pane, tabName, ev); }, "onKeydown": (ev) => { const code = getEventCode(ev); if (closable && (code === EVENT_CODE.delete || code === EVENT_CODE.backspace)) emit("tabRemove", pane, ev); } }, [...[tabLabelContent, btnClose]]); }); tracker.value; return createVNode("div", { "ref": el$, "class": [ ns.e("nav-wrap"), ns.is("scrollable", !!scrollable.value), ns.is(rootTabs.props.tabPosition) ] }, [scrollBtn, createVNode("div", { "class": ns.e("nav-scroll"), "ref": navScroll$ }, [props2.panes.length > 0 ? createVNode("div", { "class": [ ns.e("nav"), ns.is(rootTabs.props.tabPosition), ns.is("stretch", props2.stretch && ["top", "bottom"].includes(rootTabs.props.tabPosition)) ], "ref": nav$, "style": navStyle.value, "role": "tablist", "onKeydown": changeTab, "onWheel": handleWheel }, [...[!props2.type ? createVNode(tab_bar_default, { "ref": tabBarRef, "tabs": [...props2.panes], "tabRefs": tabRefsMap.value }, null) : null, tabs]]) : null])]); }; } }); const tabsProps = buildProps({ type: { type: String, values: [ "card", "border-card", "" ], default: "" }, closable: Boolean, addable: Boolean, modelValue: { type: [String, Number] }, defaultValue: { type: [String, Number] }, editable: Boolean, tabPosition: { type: String, values: [ "top", "right", "bottom", "left" ], default: "top" }, beforeLeave: { type: definePropType(Function), default: () => true }, stretch: Boolean, tabindex: { type: [String, Number], default: 0 } }); const isPaneName = (value) => isString(value) || isNumber(value); const tabsEmits = { [UPDATE_MODEL_EVENT]: (name) => isPaneName(name), tabClick: (pane, ev) => ev instanceof Event, tabChange: (name) => isPaneName(name), edit: (paneName, action) => ["remove", "add"].includes(action), tabRemove: (name) => isPaneName(name), tabAdd: () => true }; const Tabs = /* @__PURE__ */ defineComponent({ name: "ElTabs", props: tabsProps, emits: tabsEmits, setup(props2, { emit, slots, expose }) { const ns = useNamespace("tabs"); const isVertical = computed(() => ["left", "right"].includes(props2.tabPosition)); const { children: panes, addChild: registerPane, removeChild: unregisterPane, ChildrenSorter: PanesSorter } = useOrderedChildren(getCurrentInstance(), "ElTabPane"); const nav$ = ref(); const currentName = ref((isUndefined(props2.modelValue) ? props2.defaultValue : props2.modelValue) ?? "0"); const setCurrentName = async (value, trigger = false) => { var _a, _b, _c, _d; if (currentName.value === value || isUndefined(value)) return; try { let canLeave; if (props2.beforeLeave) { const result = props2.beforeLeave(value, currentName.value); canLeave = result instanceof Promise ? await result : result; } else canLeave = true; if (canLeave !== false) { const isFocusInsidePane = (_a = panes.value.find((item) => item.paneName === currentName.value)) == null ? void 0 : _a.isFocusInsidePane(); currentName.value = value; if (trigger) { emit(UPDATE_MODEL_EVENT, value); emit("tabChange", value); } (_c = (_b = nav$.value) == null ? void 0 : _b.removeFocus) == null ? void 0 : _c.call(_b); if (isFocusInsidePane) (_d = nav$.value) == null ? void 0 : _d.focusActiveTab(); } } catch { } }; const handleTabClick = (tab, tabName, event) => { if (tab.props.disabled) return; emit("tabClick", tab, event); setCurrentName(tabName, true); }; const handleTabRemove = (pane, ev) => { if (pane.props.disabled || isUndefined(pane.props.name)) return; ev.stopPropagation(); emit("edit", pane.props.name, "remove"); emit("tabRemove", pane.props.name); }; const handleTabAdd = () => { emit("edit", void 0, "add"); emit("tabAdd"); }; const handleKeydown = (event) => { const code = getEventCode(event); if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter].includes(code)) handleTabAdd(); }; const swapChildren = (vnode) => { const actualFirstChild = vnode.el.firstChild; const firstChild = ["bottom", "right"].includes(props2.tabPosition) ? vnode.children[0].el : vnode.children[1].el; if (actualFirstChild !== firstChild) actualFirstChild.before(firstChild); }; watch(() => props2.modelValue, (modelValue) => setCurrentName(modelValue)); watch(currentName, async () => { var _a; await nextTick(); (_a = nav$.value) == null ? void 0 : _a.scrollToActiveTab(); }); provide(tabsRootContextKey, { props: props2, currentName, registerPane, unregisterPane, nav$ }); expose({ currentName, get tabNavRef() { return omit(nav$.value, ["scheduleRender"]); } }); return () => { const addSlot = slots["add-icon"]; const newButton = props2.editable || props2.addable ? createVNode("div", { "class": [ns.e("new-tab"), isVertical.value && ns.e("new-tab-vertical")], "tabindex": props2.tabindex, "onClick": handleTabAdd, "onKeydown": handleKeydown }, [addSlot ? renderSlot(slots, "add-icon") : createVNode(ElIcon, { "class": ns.is("icon-plus") }, { default: () => [createVNode(plus_default, null, null)] })]) : null; const tabNav = () => createVNode(TabNav, { "ref": nav$, "currentName": currentName.value, "editable": props2.editable, "type": props2.type, "panes": panes.value, "stretch": props2.stretch, "onTabClick": handleTabClick, "onTabRemove": handleTabRemove }, null); const header = createVNode("div", { "class": [ ns.e("header"), isVertical.value && ns.e("header-vertical"), ns.is(props2.tabPosition) ] }, [createVNode(PanesSorter, null, { default: tabNav, $stable: true }), newButton]); const panels = createVNode("div", { "class": ns.e("content") }, [renderSlot(slots, "default")]); return createVNode("div", { "class": [ ns.b(), ns.m(props2.tabPosition), { [ns.m("card")]: props2.type === "card", [ns.m("border-card")]: props2.type === "border-card" } ], "onVnodeMounted": swapChildren, "onVnodeUpdated": swapChildren }, [panels, header]); }; } }); const tabPaneProps = buildProps({ label: { type: String, default: "" }, name: { type: [String, Number] }, closable: { type: Boolean, default: void 0 }, disabled: Boolean, lazy: Boolean }); const _hoisted_1$e = [ "id", "aria-hidden", "aria-labelledby" ]; const COMPONENT_NAME$2 = "ElTabPane"; var tab_pane_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$2, __name: "tab-pane", props: tabPaneProps, setup(__props) { const props2 = __props; const instance = getCurrentInstance(); const slots = useSlots(); const tabsRoot = inject(tabsRootContextKey); if (!tabsRoot) throwError(COMPONENT_NAME$2, "usage: "); const ns = useNamespace("tab-pane"); const paneRef = ref(); const index = ref(); const isClosable = computed(() => props2.closable ?? tabsRoot.props.closable); const active = computed(() => tabsRoot.currentName.value === (props2.name ?? index.value)); const loaded = ref(active.value); const paneName = computed(() => props2.name ?? index.value); const shouldBeRender = computed(() => !props2.lazy || loaded.value || active.value); const isFocusInsidePane = () => { var _a; return (_a = paneRef.value) == null ? void 0 : _a.contains(document.activeElement); }; watch(active, (val) => { if (val) loaded.value = true; }); const pane = reactive({ uid: instance.uid, getVnode: () => instance.vnode, slots, props: props2, paneName, active, index, isClosable, isFocusInsidePane }); tabsRoot.registerPane(pane); onBeforeUnmount(() => { tabsRoot.unregisterPane(pane); }); onBeforeUpdate(() => { var _a; if (slots.label) (_a = tabsRoot.nav$.value) == null ? void 0 : _a.scheduleRender(); }); return (_ctx, _cache) => { return shouldBeRender.value ? withDirectives((openBlock(), createElementBlock("div", { key: 0, id: `pane-${paneName.value}`, ref_key: "paneRef", ref: paneRef, class: normalizeClass(unref(ns).b()), role: "tabpanel", "aria-hidden": !active.value, "aria-labelledby": `tab-${paneName.value}` }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$e)), [[vShow, active.value]]) : createCommentVNode("v-if", true); }; } }); var tab_pane_default = tab_pane_vue_vue_type_script_setup_true_lang_default; const ElTabs = withInstall(Tabs, { TabPane: tab_pane_default }); const ElTabPane = withNoopInstall(tab_pane_default); const textProps = buildProps({ type: { type: String, values: [ "primary", "success", "info", "warning", "danger", "" ], default: "" }, size: { type: String, values: componentSizes, default: "" }, truncated: Boolean, lineClamp: { type: [String, Number] }, tag: { type: String, default: "span" } }); var text_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElText", __name: "text", props: textProps, setup(__props) { const props2 = __props; const textRef = ref(); const textSize = useFormSize(); const ns = useNamespace("text"); const textKls = computed(() => [ ns.b(), ns.m(props2.type), ns.m(textSize.value), ns.is("truncated", props2.truncated), ns.is("line-clamp", !isUndefined(props2.lineClamp)) ]); const bindTitle = () => { var _a, _b, _c, _d, _e, _f, _g; if (useAttrs$1().title) return; let shouldAddTitle = false; const text = ((_a = textRef.value) == null ? void 0 : _a.textContent) || ""; if (props2.truncated) { const width = (_b = textRef.value) == null ? void 0 : _b.offsetWidth; const scrollWidth = (_c = textRef.value) == null ? void 0 : _c.scrollWidth; if (width && scrollWidth && scrollWidth > width) shouldAddTitle = true; } else if (!isUndefined(props2.lineClamp)) { const height = (_d = textRef.value) == null ? void 0 : _d.offsetHeight; const scrollHeight = (_e = textRef.value) == null ? void 0 : _e.scrollHeight; if (height && scrollHeight && scrollHeight > height) shouldAddTitle = true; } if (shouldAddTitle) (_f = textRef.value) == null ? void 0 : _f.setAttribute("title", text); else (_g = textRef.value) == null ? void 0 : _g.removeAttribute("title"); }; onMounted(bindTitle); onUpdated(bindTitle); return (_ctx, _cache) => { return openBlock(), createBlock(resolveDynamicComponent(__props.tag), { ref_key: "textRef", ref: textRef, class: normalizeClass(textKls.value), style: normalizeStyle({ "-webkit-line-clamp": __props.lineClamp }) }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, ["class", "style"]); }; } }); var text_default = text_vue_vue_type_script_setup_true_lang_default; const ElText = withInstall(text_default); const DEFAULT_STEP = "00:30"; const timeSelectProps = buildProps({ format: { type: String, default: "HH:mm" }, modelValue: { type: definePropType(String) }, disabled: { type: Boolean, default: void 0 }, editable: { type: Boolean, default: true }, effect: { type: definePropType(String), default: "light" }, clearable: { type: Boolean, default: true }, size: useSizeProp, placeholder: String, start: { type: String, default: "09:00" }, end: { type: String, default: "18:00" }, step: { type: String, default: DEFAULT_STEP }, minTime: { type: definePropType(String) }, maxTime: { type: definePropType(String) }, includeEndTime: Boolean, name: String, prefixIcon: { type: definePropType([String, Object]), default: () => clock_default }, clearIcon: { type: definePropType([String, Object]), default: () => circle_close_default }, popperClass: { type: String, default: "" }, popperStyle: { type: definePropType([String, Object]) }, ...useEmptyValuesProps }); const parseTime = (time) => { const values = (time || "").split(":"); if (values.length >= 2) { let hours = Number.parseInt(values[0], 10); const minutes = Number.parseInt(values[1], 10); const timeUpper = time.toUpperCase(); if (timeUpper.includes("AM") && hours === 12) hours = 0; else if (timeUpper.includes("PM") && hours !== 12) hours += 12; return { hours, minutes }; } return null; }; const compareTime = (time1, time2) => { const value1 = parseTime(time1); if (!value1) return -1; const value2 = parseTime(time2); if (!value2) return -1; const minutes1 = value1.minutes + value1.hours * 60; const minutes2 = value2.minutes + value2.hours * 60; if (minutes1 === minutes2) return 0; return minutes1 > minutes2 ? 1 : -1; }; const padTime = (time) => { return `${time}`.padStart(2, "0"); }; const formatTime = (time) => { return `${padTime(time.hours)}:${padTime(time.minutes)}`; }; const nextTime = (time, step2) => { const timeValue = parseTime(time); if (!timeValue) return ""; const stepValue = parseTime(step2); if (!stepValue) return ""; const next = { hours: timeValue.hours, minutes: timeValue.minutes }; next.minutes += stepValue.minutes; next.hours += stepValue.hours; next.hours += Math.floor(next.minutes / 60); next.minutes = next.minutes % 60; return formatTime(next); }; var time_select_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTimeSelect", __name: "time-select", props: timeSelectProps, emits: [ CHANGE_EVENT, "blur", "focus", "clear", UPDATE_MODEL_EVENT ], setup(__props, { expose: __expose }) { dayjs.extend(customParseFormat); const { Option: ElOption2 } = ElSelect; const props2 = __props; const nsInput = useNamespace("input"); const select = ref(); const _disabled = useFormDisabled(); const { lang } = useLocale(); const value = computed(() => props2.modelValue); const start = computed(() => { const time = parseTime(props2.start); return time ? formatTime(time) : null; }); const end = computed(() => { const time = parseTime(props2.end); return time ? formatTime(time) : null; }); const minTime = computed(() => { const time = parseTime(props2.minTime || ""); return time ? formatTime(time) : null; }); const maxTime = computed(() => { const time = parseTime(props2.maxTime || ""); return time ? formatTime(time) : null; }); const step2 = computed(() => { const time = parseTime(props2.step); const isInvalidStep = !time || time.hours < 0 || time.minutes < 0 || Number.isNaN(time.hours) || Number.isNaN(time.minutes) || time.hours === 0 && time.minutes === 0; if (isInvalidStep) debugWarn("ElTimeSelect", `invalid step, fallback to default step (${DEFAULT_STEP}).`); return !isInvalidStep ? formatTime(time) : DEFAULT_STEP; }); const items = computed(() => { var _a; const result = []; const push = (formattedValue, rawValue) => { result.push({ value: formattedValue, rawValue, disabled: compareTime(rawValue, minTime.value || "-1:-1") <= 0 || compareTime(rawValue, maxTime.value || "100:100") >= 0 }); }; if (props2.start && props2.end && props2.step) { let current = start.value; let currentTime; while (current && end.value && compareTime(current, end.value) <= 0) { currentTime = dayjs(current, "HH:mm").locale(lang.value).format(props2.format); push(currentTime, current); current = nextTime(current, step2.value); } if (props2.includeEndTime && end.value && ((_a = result[result.length - 1]) == null ? void 0 : _a.rawValue) !== end.value) push(dayjs(end.value, "HH:mm").locale(lang.value).format(props2.format), end.value); } return result; }); const blur = () => { var _a, _b; (_b = (_a = select.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a); }; const focus = () => { var _a, _b; (_b = (_a = select.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a); }; __expose({ blur, focus }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElSelect), { ref_key: "select", ref: select, name: __props.name, "model-value": value.value, disabled: unref(_disabled), clearable: __props.clearable, "clear-icon": __props.clearIcon, size: __props.size, effect: __props.effect, placeholder: __props.placeholder, "default-first-option": "", filterable: __props.editable, "empty-values": __props.emptyValues, "value-on-clear": __props.valueOnClear, "popper-class": __props.popperClass, "popper-style": __props.popperStyle, "onUpdate:modelValue": _cache[0] || (_cache[0] = (event) => _ctx.$emit(unref(UPDATE_MODEL_EVENT), event)), onChange: _cache[1] || (_cache[1] = (event) => _ctx.$emit(unref(CHANGE_EVENT), event)), onBlur: _cache[2] || (_cache[2] = (event) => _ctx.$emit("blur", event)), onFocus: _cache[3] || (_cache[3] = (event) => _ctx.$emit("focus", event)), onClear: _cache[4] || (_cache[4] = () => _ctx.$emit("clear")) }, { prefix: withCtx(() => [__props.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(unref(nsInput).e("prefix-icon")) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.prefixIcon)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true)]), default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item) => { return openBlock(), createBlock(unref(ElOption2), { key: item.value, label: item.value, value: item.value, disabled: item.disabled }, null, 8, [ "label", "value", "disabled" ]); }), 128))]), _: 1 }, 8, [ "name", "model-value", "disabled", "clearable", "clear-icon", "size", "effect", "placeholder", "filterable", "empty-values", "value-on-clear", "popper-class", "popper-style" ]); }; } }); var time_select_default = time_select_vue_vue_type_script_setup_true_lang_default; const ElTimeSelect = withInstall(time_select_default); const TIMELINE_INJECTION_KEY = "timeline"; const timelineProps = buildProps({ mode: { type: String, values: [ "start", "alternate", "alternate-reverse", "end" ], default: "start" }, reverse: Boolean }); const Timeline = defineComponent({ name: "ElTimeline", props: timelineProps, setup(props2, { slots }) { const ns = useNamespace("timeline"); provide(TIMELINE_INJECTION_KEY, { props: props2, slots }); const timelineKls = computed(() => [ns.b(), ns.is(props2.mode)]); return () => { var _a; const children = flattedChildren(((_a = slots.default) == null ? void 0 : _a.call(slots)) ?? []); return h("ul", { class: timelineKls.value }, props2.reverse ? children.reverse() : children); }; } }); const timelineItemProps = buildProps({ timestamp: { type: String, default: "" }, hideTimestamp: Boolean, center: Boolean, placement: { type: String, values: ["top", "bottom"], default: "bottom" }, type: { type: String, values: [ "primary", "success", "warning", "danger", "info" ], default: "" }, color: { type: String, default: "" }, size: { type: String, values: ["normal", "large"], default: "normal" }, icon: { type: iconPropType }, hollow: Boolean }); var timeline_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTimelineItem", __name: "timeline-item", props: timelineItemProps, setup(__props) { const props2 = __props; const { props: timelineProps2 } = inject(TIMELINE_INJECTION_KEY); const ns = useNamespace("timeline-item"); const defaultNodeKls = computed(() => [ ns.e("node"), ns.em("node", props2.size || ""), ns.em("node", props2.type || ""), ns.is("hollow", props2.hollow) ]); const timelineItemKls = computed(() => [ ns.b(), { [ns.e("center")]: props2.center }, ns.is(timelineProps2.mode) ]); return (_ctx, _cache) => { return openBlock(), createElementBlock("li", { class: normalizeClass(timelineItemKls.value) }, [ createBaseVNode("div", { class: normalizeClass(unref(ns).e("tail")) }, null, 2), !_ctx.$slots.dot ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(defaultNodeKls.value), style: normalizeStyle({ backgroundColor: __props.color }) }, [__props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(unref(ns).e("icon")) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true)], 6)) : createCommentVNode("v-if", true), _ctx.$slots.dot ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("dot")) }, [renderSlot(_ctx.$slots, "dot")], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("wrapper")) }, [ !__props.hideTimestamp && __props.placement === "top" ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("top")]) }, toDisplayString(__props.timestamp), 3)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [renderSlot(_ctx.$slots, "default")], 2), !__props.hideTimestamp && __props.placement === "bottom" ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("bottom")]) }, toDisplayString(__props.timestamp), 3)) : createCommentVNode("v-if", true) ], 2) ], 2); }; } }); var timeline_item_default = timeline_item_vue_vue_type_script_setup_true_lang_default; const ElTimeline = withInstall(Timeline, { TimelineItem: timeline_item_default }); const ElTimelineItem = withNoopInstall(timeline_item_default); const LEFT_CHECK_CHANGE_EVENT = "left-check-change"; const RIGHT_CHECK_CHANGE_EVENT = "right-check-change"; const transferProps = buildProps({ data: { type: definePropType(Array), default: () => [] }, titles: { type: definePropType(Array), default: () => [] }, buttonTexts: { type: definePropType(Array), default: () => [] }, filterPlaceholder: String, filterMethod: { type: definePropType(Function) }, leftDefaultChecked: { type: definePropType(Array), default: () => [] }, rightDefaultChecked: { type: definePropType(Array), default: () => [] }, renderContent: { type: definePropType(Function) }, modelValue: { type: definePropType(Array), default: () => [] }, format: { type: definePropType(Object), default: () => ({}) }, filterable: Boolean, props: { type: definePropType(Object), default: () => mutable({ label: "label", key: "key", disabled: "disabled" }) }, targetOrder: { type: String, values: [ "original", "push", "unshift" ], default: "original" }, validateEvent: { type: Boolean, default: true } }); const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(isArray) || isArray(value) && isNil(movedKeys); const transferEmits = { [CHANGE_EVENT]: (value, direction2, movedKeys) => [value, movedKeys].every(isArray) && ["left", "right"].includes(direction2), [UPDATE_MODEL_EVENT]: (value) => isArray(value), [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn, [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn }; const usePropsAlias = (props2) => { const initProps = { label: "label", key: "key", disabled: "disabled" }; return computed(() => ({ ...initProps, ...props2.props })); }; const useCheckedChange = (checkedState, emit) => { const onSourceCheckedChange = (val, movedKeys) => { checkedState.leftChecked = val; if (!movedKeys) return; emit(LEFT_CHECK_CHANGE_EVENT, val, movedKeys); }; const onTargetCheckedChange = (val, movedKeys) => { checkedState.rightChecked = val; if (!movedKeys) return; emit(RIGHT_CHECK_CHANGE_EVENT, val, movedKeys); }; return { onSourceCheckedChange, onTargetCheckedChange }; }; const useComputedData = (props2) => { const propsAlias = usePropsAlias(props2); const dataObj = computed(() => props2.data.reduce((o, cur) => (o[cur[propsAlias.value.key]] = cur, o), {})); return { sourceData: computed(() => props2.data.filter((item) => !props2.modelValue.includes(item[propsAlias.value.key]))), targetData: computed(() => { if (props2.targetOrder === "original") return props2.data.filter((item) => props2.modelValue.includes(item[propsAlias.value.key])); else return props2.modelValue.reduce((arr, cur) => { const val = dataObj.value[cur]; if (val) arr.push(val); return arr; }, []); }) }; }; const useMove = (props2, checkedState, emit) => { const propsAlias = usePropsAlias(props2); const _emit = (value, direction2, movedKeys) => { emit(UPDATE_MODEL_EVENT, value); emit(CHANGE_EVENT, value, direction2, movedKeys); }; const addToLeft = () => { const currentValue = props2.modelValue.slice(); checkedState.rightChecked.forEach((item) => { const index = currentValue.indexOf(item); if (index > -1) currentValue.splice(index, 1); }); _emit(currentValue, "left", checkedState.rightChecked); }; const addToRight = () => { let currentValue = props2.modelValue.slice(); const itemsToBeMoved = props2.data.filter((item) => { const itemKey = item[propsAlias.value.key]; return checkedState.leftChecked.includes(itemKey) && !props2.modelValue.includes(itemKey); }).map((item) => item[propsAlias.value.key]); currentValue = props2.targetOrder === "unshift" ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved); if (props2.targetOrder === "original") currentValue = props2.data.filter((item) => currentValue.includes(item[propsAlias.value.key])).map((item) => item[propsAlias.value.key]); _emit(currentValue, "right", checkedState.leftChecked); }; return { addToLeft, addToRight }; }; const CHECKED_CHANGE_EVENT = "checked-change"; const transferPanelProps = buildProps({ data: transferProps.data, optionRender: { type: definePropType(Function) }, placeholder: String, title: String, filterable: Boolean, format: transferProps.format, filterMethod: transferProps.filterMethod, defaultChecked: transferProps.leftDefaultChecked, props: transferProps.props }); const transferPanelEmits = { [CHECKED_CHANGE_EVENT]: transferCheckedChangeFn }; const useCheck$1 = (props2, panelState, emit) => { const propsAlias = usePropsAlias(props2); const filteredData = computed(() => { return props2.data.filter((item) => { if (isFunction(props2.filterMethod)) return props2.filterMethod(panelState.query, item); else return String(item[propsAlias.value.label] || item[propsAlias.value.key]).toLowerCase().includes(panelState.query.toLowerCase()); }); }); const checkableData = computed(() => filteredData.value.filter((item) => !item[propsAlias.value.disabled])); const checkedSummary = computed(() => { const checkedLength = panelState.checked.length; const dataLength = props2.data.length; const { noChecked, hasChecked } = props2.format; if (noChecked && hasChecked) return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength.toString()).replace(/\${total}/g, dataLength.toString()) : noChecked.replace(/\${total}/g, dataLength.toString()); else return `${checkedLength}/${dataLength}`; }); const isIndeterminate = computed(() => { const checkedLength = panelState.checked.length; return checkedLength > 0 && checkedLength < checkableData.value.length; }); const updateAllChecked = () => { const checkableDataKeys = checkableData.value.map((item) => item[propsAlias.value.key]); panelState.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every((item) => panelState.checked.includes(item)); }; const handleAllCheckedChange = (value) => { panelState.checked = value ? checkableData.value.map((item) => item[propsAlias.value.key]) : []; }; watch(() => panelState.checked, (val, oldVal) => { updateAllChecked(); if (panelState.checkChangeByUser) emit(CHECKED_CHANGE_EVENT, val, val.concat(oldVal).filter((v) => !val.includes(v) || !oldVal.includes(v))); else { emit(CHECKED_CHANGE_EVENT, val); panelState.checkChangeByUser = true; } }); watch(checkableData, () => { updateAllChecked(); }); watch(() => props2.data, () => { const checked = []; const filteredDataKeys = filteredData.value.map((item) => item[propsAlias.value.key]); panelState.checked.forEach((item) => { if (filteredDataKeys.includes(item)) checked.push(item); }); panelState.checkChangeByUser = false; panelState.checked = checked; }); watch(() => props2.defaultChecked, (val, oldVal) => { if (oldVal && val.length === oldVal.length && val.every((item) => oldVal.includes(item))) return; const checked = []; const checkableDataKeys = checkableData.value.map((item) => item[propsAlias.value.key]); val.forEach((item) => { if (checkableDataKeys.includes(item)) checked.push(item); }); panelState.checkChangeByUser = false; panelState.checked = checked; }, { immediate: true }); return { filteredData, checkableData, checkedSummary, isIndeterminate, updateAllChecked, handleAllCheckedChange }; }; var transfer_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTransferPanel", __name: "transfer-panel", props: transferPanelProps, emits: transferPanelEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const slots = useSlots(); const OptionContent = ({ option }) => option; const { t } = useLocale(); const ns = useNamespace("transfer"); const panelState = reactive({ checked: [], allChecked: false, query: "", checkChangeByUser: true }); const propsAlias = usePropsAlias(props2); const { filteredData, checkedSummary, isIndeterminate, handleAllCheckedChange } = useCheck$1(props2, panelState, emit); const hasNoMatch = computed(() => !isEmpty(panelState.query) && isEmpty(filteredData.value)); const hasFooter = computed(() => !isEmpty(slots.default()[0].children)); const { checked, allChecked, query } = toRefs(panelState); __expose({ query }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b("panel")) }, [ createBaseVNode("p", { class: normalizeClass(unref(ns).be("panel", "header")) }, [createVNode(unref(ElCheckbox), { modelValue: unref(allChecked), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(allChecked) ? allChecked.value = $event : null), indeterminate: unref(isIndeterminate), "validate-event": false, onChange: unref(handleAllCheckedChange) }, { default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(unref(ns).be("panel", "header-title")) }, toDisplayString(__props.title), 3), createBaseVNode("span", { class: normalizeClass(unref(ns).be("panel", "header-count")) }, toDisplayString(unref(checkedSummary)), 3)]), _: 1 }, 8, [ "modelValue", "indeterminate", "onChange" ])], 2), createBaseVNode("div", { class: normalizeClass([unref(ns).be("panel", "body"), unref(ns).is("with-footer", hasFooter.value)]) }, [ __props.filterable ? (openBlock(), createBlock(unref(ElInput), { key: 0, modelValue: unref(query), "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(query) ? query.value = $event : null), class: normalizeClass(unref(ns).be("panel", "filter")), size: "default", placeholder: __props.placeholder, "prefix-icon": unref(search_default), clearable: "", "validate-event": false }, null, 8, [ "modelValue", "class", "placeholder", "prefix-icon" ])) : createCommentVNode("v-if", true), withDirectives(createVNode(unref(ElCheckboxGroup), { modelValue: unref(checked), "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(checked) ? checked.value = $event : null), "validate-event": false, class: normalizeClass([unref(ns).is("filterable", __props.filterable), unref(ns).be("panel", "list")]) }, { default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredData), (item) => { return openBlock(), createBlock(unref(ElCheckbox), { key: item[unref(propsAlias).key], class: normalizeClass(unref(ns).be("panel", "item")), value: item[unref(propsAlias).key], disabled: item[unref(propsAlias).disabled], "validate-event": false }, { default: withCtx(() => { var _a; return [createVNode(OptionContent, { option: (_a = __props.optionRender) == null ? void 0 : _a.call(__props, item) }, null, 8, ["option"])]; }), _: 2 }, 1032, [ "class", "value", "disabled" ]); }), 128))]), _: 1 }, 8, ["modelValue", "class"]), [[vShow, !hasNoMatch.value && !unref(isEmpty)(__props.data)]]), withDirectives(createBaseVNode("div", { class: normalizeClass(unref(ns).be("panel", "empty")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(hasNoMatch.value ? unref(t)("el.transfer.noMatch") : unref(t)("el.transfer.noData")), 1)])], 2), [[vShow, hasNoMatch.value || unref(isEmpty)(__props.data)]]) ], 2), hasFooter.value ? (openBlock(), createElementBlock("p", { key: 0, class: normalizeClass(unref(ns).be("panel", "footer")) }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true) ], 2); }; } }); var transfer_panel_default = transfer_panel_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$d = { key: 0 }; const _hoisted_2$8 = { key: 0 }; var transfer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTransfer", __name: "transfer", props: transferProps, emits: transferEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const slots = useSlots(); const { t } = useLocale(); const ns = useNamespace("transfer"); const { formItem } = useFormItem(); const checkedState = reactive({ leftChecked: [], rightChecked: [] }); const propsAlias = usePropsAlias(props2); const { sourceData, targetData } = useComputedData(props2); const { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(checkedState, emit); const { addToLeft, addToRight } = useMove(props2, checkedState, emit); const leftPanel = ref(); const rightPanel = ref(); const clearQuery = (which) => { switch (which) { case "left": leftPanel.value.query = ""; break; case "right": rightPanel.value.query = ""; break; } }; const hasButtonTexts = computed(() => props2.buttonTexts.length === 2); const leftPanelTitle = computed(() => props2.titles[0] || t("el.transfer.titles.0")); const rightPanelTitle = computed(() => props2.titles[1] || t("el.transfer.titles.1")); const panelFilterPlaceholder = computed(() => props2.filterPlaceholder || t("el.transfer.filterPlaceholder")); watch(() => props2.modelValue, () => { var _a; if (props2.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err)); }); const optionRender = computed(() => (option) => { var _a; if (props2.renderContent) return props2.renderContent(h, option); const defaultSlotVNodes = (((_a = slots.default) == null ? void 0 : _a.call(slots, { option })) || []).filter((node) => node.type !== Comment); if (defaultSlotVNodes.length) return defaultSlotVNodes; return h("span", option[propsAlias.value.label] || option[propsAlias.value.key]); }); __expose({ clearQuery, leftPanel, rightPanel }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [ createVNode(transfer_panel_default, { ref_key: "leftPanel", ref: leftPanel, data: unref(sourceData), "option-render": optionRender.value, placeholder: panelFilterPlaceholder.value, title: leftPanelTitle.value, filterable: __props.filterable, format: __props.format, "filter-method": __props.filterMethod, "default-checked": __props.leftDefaultChecked, props: props2.props, onCheckedChange: unref(onSourceCheckedChange) }, { empty: withCtx(() => [renderSlot(_ctx.$slots, "left-empty")]), default: withCtx(() => [renderSlot(_ctx.$slots, "left-footer")]), _: 3 }, 8, [ "data", "option-render", "placeholder", "title", "filterable", "format", "filter-method", "default-checked", "props", "onCheckedChange" ]), createBaseVNode("div", { class: normalizeClass(unref(ns).e("buttons")) }, [createVNode(unref(ElButton), { type: "primary", class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", hasButtonTexts.value)]), disabled: unref(isEmpty)(checkedState.rightChecked), onClick: unref(addToLeft) }, { default: withCtx(() => [createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_left_default))]), _: 1 }), !unref(isUndefined)(__props.buttonTexts[0]) ? (openBlock(), createElementBlock("span", _hoisted_1$d, toDisplayString(__props.buttonTexts[0]), 1)) : createCommentVNode("v-if", true)]), _: 1 }, 8, [ "class", "disabled", "onClick" ]), createVNode(unref(ElButton), { type: "primary", class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", hasButtonTexts.value)]), disabled: unref(isEmpty)(checkedState.leftChecked), onClick: unref(addToRight) }, { default: withCtx(() => [!unref(isUndefined)(__props.buttonTexts[1]) ? (openBlock(), createElementBlock("span", _hoisted_2$8, toDisplayString(__props.buttonTexts[1]), 1)) : createCommentVNode("v-if", true), createVNode(unref(ElIcon), null, { default: withCtx(() => [createVNode(unref(arrow_right_default))]), _: 1 })]), _: 1 }, 8, [ "class", "disabled", "onClick" ])], 2), createVNode(transfer_panel_default, { ref_key: "rightPanel", ref: rightPanel, data: unref(targetData), "option-render": optionRender.value, placeholder: panelFilterPlaceholder.value, filterable: __props.filterable, format: __props.format, "filter-method": __props.filterMethod, title: rightPanelTitle.value, "default-checked": __props.rightDefaultChecked, props: props2.props, onCheckedChange: unref(onTargetCheckedChange) }, { empty: withCtx(() => [renderSlot(_ctx.$slots, "right-empty")]), default: withCtx(() => [renderSlot(_ctx.$slots, "right-footer")]), _: 3 }, 8, [ "data", "option-render", "placeholder", "filterable", "format", "filter-method", "title", "default-checked", "props", "onCheckedChange" ]) ], 2); }; } }); var transfer_default = transfer_vue_vue_type_script_setup_true_lang_default; const ElTransfer = withInstall(transfer_default); const ROOT_TREE_INJECTION_KEY$1 = "RootTree"; const NODE_INSTANCE_INJECTION_KEY = "NodeInstance"; const TREE_NODE_MAP_INJECTION_KEY = "TreeNodeMap"; const treeProps$1 = buildProps({ data: { type: definePropType(Array), default: () => [] }, emptyText: { type: String }, renderAfterExpand: { type: Boolean, default: true }, nodeKey: String, checkStrictly: Boolean, defaultExpandAll: Boolean, expandOnClickNode: { type: Boolean, default: true }, checkOnClickNode: Boolean, checkOnClickLeaf: { type: Boolean, default: true }, checkDescendants: Boolean, autoExpandParent: { type: Boolean, default: true }, defaultCheckedKeys: { type: Array }, defaultExpandedKeys: { type: Array }, currentNodeKey: { type: [String, Number] }, renderContent: { type: definePropType(Function) }, showCheckbox: Boolean, draggable: Boolean, allowDrag: { type: definePropType(Function) }, allowDrop: { type: definePropType(Function) }, props: { type: Object, default: () => ({ children: "children", label: "label", disabled: "disabled" }) }, lazy: Boolean, highlightCurrent: Boolean, load: { type: Function }, filterNodeMethod: { type: Function }, accordion: Boolean, indent: { type: Number, default: 18 }, icon: { type: iconPropType } }); const treeEmits$1 = { "check-change": (data, checked, indeterminate) => data && isBoolean(checked) && isBoolean(indeterminate), "current-change": (data, node) => true, "node-click": (data, node, nodeInstance, evt) => data && node && evt instanceof Event, "node-contextmenu": (evt, data, node, nodeInstance) => evt instanceof Event && data && node, "node-collapse": (data, node, nodeInstance) => data && node, "node-expand": (data, node, nodeInstance) => data && node, check: (data, checkedInfo) => data && checkedInfo, "node-drag-start": (node, evt) => node && evt, "node-drag-end": (draggingNode, dropNode, dropType, evt) => draggingNode && evt, "node-drop": (draggingNode, dropNode, dropType, evt) => draggingNode && dropNode && evt, "node-drag-leave": (draggingNode, oldDropNode, evt) => draggingNode && oldDropNode && evt, "node-drag-enter": (draggingNode, dropNode, evt) => draggingNode && dropNode && evt, "node-drag-over": (draggingNode, dropNode, evt) => draggingNode && dropNode && evt }; const NODE_KEY = "$treeNodeId"; const markNodeData = function(node, data) { if (!data || data[NODE_KEY]) return; Object.defineProperty(data, NODE_KEY, { value: node.id, enumerable: false, configurable: false, writable: false }); }; const getNodeKey = (key, data) => data == null ? void 0 : data[key || NODE_KEY]; const handleCurrentChange = (store, emit, setCurrent) => { const preCurrentNode = store.value.currentNode; setCurrent(); const currentNode = store.value.currentNode; if (preCurrentNode === currentNode) return; emit("current-change", currentNode ? currentNode.data : null, currentNode); }; const getChildState = (node) => { let all = true; let none = true; let allWithoutDisable = true; let isEffectivelyChecked = true; for (let i = 0, j = node.length; i < j; i++) { const n = node[i]; if (n.checked !== true || n.indeterminate) { all = false; if (!n.disabled) allWithoutDisable = false; } if (n.checked !== false || n.indeterminate) none = false; if (!n.isEffectivelyChecked) isEffectivelyChecked = false; } return { all, none, allWithoutDisable, half: !all && !none, isEffectivelyChecked }; }; const reInitChecked = function(node) { if (node.childNodes.length === 0 || node.loading) { node.isEffectivelyChecked = node.disabled || node.checked; return; } const { all, none, half, isEffectivelyChecked } = getChildState(node.childNodes); node.isEffectivelyChecked = isEffectivelyChecked; if (all) { node.checked = true; node.indeterminate = false; } else if (half) { node.checked = false; node.indeterminate = true; } else if (none) { node.checked = false; node.indeterminate = false; } const parent = node.parent; if (!parent || parent.level === 0) return; if (!node.store.checkStrictly) reInitChecked(parent); }; const getPropertyFromData = function(node, prop) { const props2 = node.store.props; const data = node.data || {}; const config = props2[prop]; if (isFunction(config)) return config(data, node); else if (isString(config)) return data[config]; else if (isUndefined(config)) { const dataProp = data[prop]; return isUndefined(dataProp) ? "" : dataProp; } }; const setCanFocus = function(childNodes, focus) { childNodes.forEach((item) => { item.canFocus = focus; setCanFocus(item.childNodes, focus); }); }; let nodeIdSeed = 0; var Node2 = class Node3 { constructor(options) { this.isLeafByUser = void 0; this.isLeaf = void 0; this.isEffectivelyChecked = false; this.id = nodeIdSeed++; this.text = null; this.checked = false; this.indeterminate = false; this.data = null; this.expanded = false; this.parent = null; this.visible = true; this.isCurrent = false; this.canFocus = false; for (const name in options) if (hasOwn(options, name)) this[name] = options[name]; this.level = 0; this.loaded = false; this.childNodes = []; this.loading = false; if (this.parent) this.level = this.parent.level + 1; } initialize() { var _a; const store = this.store; if (!store) throw new Error("[Node]store is required!"); store.registerNode(this); const props2 = store.props; if (props2 && typeof props2.isLeaf !== "undefined") { const isLeaf2 = getPropertyFromData(this, "isLeaf"); if (isBoolean(isLeaf2)) this.isLeafByUser = isLeaf2; } if (store.lazy !== true && this.data) { this.setData(this.data); if (store.defaultExpandAll) { this.expanded = true; this.canFocus = true; } } else if (this.level > 0 && store.lazy && store.defaultExpandAll && !this.isLeafByUser) this.expand(); if (!isArray(this.data)) markNodeData(this, this.data); if (!this.data) return; const defaultExpandedKeys = store.defaultExpandedKeys; const key = store.key; if (key && !isNil(this.key) && defaultExpandedKeys && defaultExpandedKeys.includes(this.key)) this.expand(null, store.autoExpandParent); if (key && store.currentNodeKey !== void 0 && this.key === store.currentNodeKey) { store.currentNode && (store.currentNode.isCurrent = false); store.currentNode = this; store.currentNode.isCurrent = true; } if (store.lazy) store._initDefaultCheckedNode(this); this.updateLeafState(); if (this.level === 1 || ((_a = this.parent) == null ? void 0 : _a.expanded) === true) this.canFocus = true; } setData(data) { if (!isArray(data)) markNodeData(this, data); this.data = data; this.childNodes = []; let children; if (this.level === 0 && isArray(this.data)) children = this.data; else children = getPropertyFromData(this, "children") || []; for (let i = 0, j = children.length; i < j; i++) this.insertChild({ data: children[i] }); } get label() { return getPropertyFromData(this, "label"); } get key() { const nodeKey = this.store.key; if (this.data) return this.data[nodeKey]; return null; } get disabled() { return getPropertyFromData(this, "disabled"); } get nextSibling() { const parent = this.parent; if (parent) { const index = parent.childNodes.indexOf(this); if (index > -1) return parent.childNodes[index + 1]; } return null; } get previousSibling() { const parent = this.parent; if (parent) { const index = parent.childNodes.indexOf(this); if (index > -1) return index > 0 ? parent.childNodes[index - 1] : null; } return null; } contains(target, deep = true) { return (this.childNodes || []).some((child) => child === target || deep && child.contains(target)); } remove() { const parent = this.parent; if (parent) parent.removeChild(this); } insertChild(child, index, batch) { if (!child) throw new Error("InsertChild error: child is required."); if (!(child instanceof Node3)) { if (!batch) { const children = this.getChildren(true); if (!(children == null ? void 0 : children.includes(child.data))) if (isUndefined(index) || index < 0) children == null ? void 0 : children.push(child.data); else children == null ? void 0 : children.splice(index, 0, child.data); } Object.assign(child, { parent: this, store: this.store }); child = reactive(new Node3(child)); if (child instanceof Node3) child.initialize(); } child.level = this.level + 1; if (isUndefined(index) || index < 0) this.childNodes.push(child); else this.childNodes.splice(index, 0, child); this.updateLeafState(); } insertBefore(child, ref2) { let index; if (ref2) index = this.childNodes.indexOf(ref2); this.insertChild(child, index); } insertAfter(child, ref2) { let index; if (ref2) { index = this.childNodes.indexOf(ref2); if (index !== -1) index += 1; } this.insertChild(child, index); } removeChild(child) { const children = this.getChildren() || []; const dataIndex = children.indexOf(child.data); if (dataIndex > -1) children.splice(dataIndex, 1); const index = this.childNodes.indexOf(child); if (index > -1) { this.store && this.store.deregisterNode(child); child.parent = null; this.childNodes.splice(index, 1); } this.updateLeafState(); } removeChildByData(data) { const targetNode = this.childNodes.find((child) => child.data === data); if (targetNode) this.removeChild(targetNode); } expand(callback, expandParent) { const done = () => { if (expandParent) { let parent = this.parent; while (parent && parent.level > 0) { parent.expanded = true; parent = parent.parent; } } this.expanded = true; if (callback) callback(); setCanFocus(this.childNodes, true); }; if (this.shouldLoadData()) this.loadData((data) => { if (isArray(data)) { if (this.checked) this.setChecked(true, true); else if (!this.store.checkStrictly) reInitChecked(this); done(); } }); else done(); } doCreateChildren(array, defaultProps2 = {}) { array.forEach((item) => { this.insertChild(Object.assign({ data: item }, defaultProps2), void 0, true); }); } collapse() { this.expanded = false; setCanFocus(this.childNodes, false); } shouldLoadData() { return Boolean(this.store.lazy === true && this.store.load && !this.loaded); } updateLeafState() { if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== "undefined") { this.isLeaf = this.isLeafByUser; this.isEffectivelyChecked = this.isLeaf && this.disabled; return; } const childNodes = this.childNodes; if (!this.store.lazy || this.store.lazy === true && this.loaded === true) { this.isLeaf = !childNodes || childNodes.length === 0; this.isEffectivelyChecked = this.isLeaf && this.disabled; return; } this.isLeaf = false; } setChecked(value, deep, recursion, passValue) { this.indeterminate = value === "half"; this.checked = value === true; this.isEffectivelyChecked = !this.childNodes.length && (this.disabled || this.checked); if (this.store.checkStrictly) return; if (!(this.shouldLoadData() && !this.store.checkDescendants)) { const handleDescendants = () => { if (deep) { const childNodes = this.childNodes; for (let i = 0, j = childNodes.length; i < j; i++) { const child = childNodes[i]; passValue = passValue || value !== false; const isCheck = child.disabled && child.isLeaf ? child.checked : passValue; child.setChecked(isCheck, deep, true, passValue); } const { half, all, isEffectivelyChecked } = getChildState(childNodes); if (!all) { this.checked = all; this.indeterminate = half; } this.isEffectivelyChecked = !this.childNodes.length ? this.disabled || this.checked : isEffectivelyChecked; } }; if (this.shouldLoadData()) { this.loadData(() => { handleDescendants(); reInitChecked(this); }, { checked: value !== false }); return; } else handleDescendants(); } const parent = this.parent; if (!parent || parent.level === 0) return; if (!recursion) reInitChecked(parent); } getChildren(forceInit = false) { if (this.level === 0) return this.data; const data = this.data; if (!data) return null; const props2 = this.store.props; let children = "children"; if (props2) children = props2.children || "children"; if (isUndefined(data[children])) data[children] = null; if (forceInit && !data[children]) data[children] = []; return data[children]; } updateChildren() { const newData = this.getChildren() || []; const oldData = this.childNodes.map((node) => node.data); const newDataMap = {}; const newNodes = []; newData.forEach((item, index) => { const key = item[NODE_KEY]; if (!!key && oldData.some((data) => (data == null ? void 0 : data[NODE_KEY]) === key)) newDataMap[key] = { index, data: item }; else newNodes.push({ index, data: item }); }); if (!this.store.lazy) oldData.forEach((item) => { if (!newDataMap[item == null ? void 0 : item[NODE_KEY]]) this.removeChildByData(item); }); newNodes.forEach(({ index, data }) => { this.insertChild({ data }, index); }); this.updateLeafState(); } loadData(callback, defaultProps2 = {}) { if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps2).length)) { this.loading = true; const resolve = (children) => { this.childNodes = []; this.doCreateChildren(children, defaultProps2); this.loaded = true; this.loading = false; this.updateLeafState(); if (callback) callback.call(this, children); }; const reject = () => { this.loading = false; }; this.store.load(this, resolve, reject); } else if (callback) callback.call(this); } eachNode(callback) { const arr = [this]; while (arr.length) { const node = arr.shift(); arr.unshift(...node.childNodes); callback(node); } } reInitChecked() { if (this.store.checkStrictly) return; reInitChecked(this); } }; var TreeStore = class { constructor(options) { this.lazy = false; this.checkStrictly = false; this.autoExpandParent = false; this.defaultExpandAll = false; this.checkDescendants = false; this.currentNode = null; this.currentNodeKey = null; for (const option in options) if (hasOwn(options, option)) this[option] = options[option]; this.nodesMap = {}; } initialize() { this.root = new Node2({ data: this.data, store: this }); this.root.initialize(); if (this.lazy && this.load) { const loadFn = this.load; loadFn(this.root, (data) => { this.root.doCreateChildren(data); this._initDefaultCheckedNodes(); }, NOOP); } else this._initDefaultCheckedNodes(); } filter(value) { const filterNodeMethod = this.filterNodeMethod; const lazy = this.lazy; const traverse = async function(node) { const childNodes = node.root ? node.root.childNodes : node.childNodes; for (const [index, child] of childNodes.entries()) { child.visible = !!(filterNodeMethod == null ? void 0 : filterNodeMethod.call(child, value, child.data, child)); if (index % 80 === 0 && index > 0) await nextTick(); await traverse(child); } if (!node.visible && childNodes.length) { let allHidden = true; allHidden = !childNodes.some((child) => child.visible); if (node.root) node.root.visible = allHidden === false; else node.visible = allHidden === false; } if (!value) return; if (node.visible && !node.isLeaf) { if (!lazy || node.loaded) node.expand(); } }; traverse(this); } setData(newVal) { if (newVal !== this.root.data) { this.nodesMap = {}; this.root.setData(newVal); this._initDefaultCheckedNodes(); this.setCurrentNodeKey(this.currentNodeKey); } else this.root.updateChildren(); } getNode(data) { if (data instanceof Node2) return data; const key = isObject(data) ? getNodeKey(this.key, data) : data; return this.nodesMap[key] || null; } insertBefore(data, refData) { var _a; const refNode = this.getNode(refData); (_a = refNode.parent) == null ? void 0 : _a.insertBefore({ data }, refNode); } insertAfter(data, refData) { var _a; const refNode = this.getNode(refData); (_a = refNode.parent) == null ? void 0 : _a.insertAfter({ data }, refNode); } remove(data) { const node = this.getNode(data); if (node && node.parent) { if (node === this.currentNode) this.currentNode = null; node.parent.removeChild(node); } } append(data, parentData) { const parentNode = !isPropAbsent(parentData) ? this.getNode(parentData) : this.root; if (parentNode) parentNode.insertChild({ data }); } _initDefaultCheckedNodes() { const defaultCheckedKeys = this.defaultCheckedKeys || []; const nodesMap = this.nodesMap; defaultCheckedKeys.forEach((checkedKey) => { const node = nodesMap[checkedKey]; if (node) node.setChecked(true, !this.checkStrictly); }); } _initDefaultCheckedNode(node) { const defaultCheckedKeys = this.defaultCheckedKeys || []; if (!isNil(node.key) && defaultCheckedKeys.includes(node.key)) node.setChecked(true, !this.checkStrictly); } setDefaultCheckedKey(newVal) { if (newVal !== this.defaultCheckedKeys) { this.defaultCheckedKeys = newVal; this._initDefaultCheckedNodes(); } } registerNode(node) { const key = this.key; if (!node || !node.data) return; if (!key) this.nodesMap[node.id] = node; else { const nodeKey = node.key; if (!isNil(nodeKey)) this.nodesMap[nodeKey] = node; } } deregisterNode(node) { if (!this.key || !node || !node.data) return; node.childNodes.forEach((child) => { this.deregisterNode(child); }); delete this.nodesMap[node.key]; } getCheckedNodes(leafOnly = false, includeHalfChecked = false) { const checkedNodes = []; const traverse = function(node) { (node.root ? node.root.childNodes : node.childNodes).forEach((child) => { if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) checkedNodes.push(child.data); traverse(child); }); }; traverse(this); return checkedNodes; } getCheckedKeys(leafOnly = false) { return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]); } getHalfCheckedNodes() { const nodes = []; const traverse = function(node) { (node.root ? node.root.childNodes : node.childNodes).forEach((child) => { if (child.indeterminate) nodes.push(child.data); traverse(child); }); }; traverse(this); return nodes; } getHalfCheckedKeys() { return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]); } _getAllNodes() { const allNodes = []; const nodesMap = this.nodesMap; for (const nodeKey in nodesMap) if (hasOwn(nodesMap, nodeKey)) allNodes.push(nodesMap[nodeKey]); return allNodes; } updateChildren(key, data) { const node = this.nodesMap[key]; if (!node) return; const childNodes = node.childNodes; for (let i = childNodes.length - 1; i >= 0; i--) { const child = childNodes[i]; this.remove(child.data); } for (let i = 0, j = data.length; i < j; i++) { const child = data[i]; this.append(child, node.data); } } _setCheckedKeys(key, leafOnly = false, checkedKeys) { const allNodes = this._getAllNodes().sort((a, b) => a.level - b.level); const cache2 = /* @__PURE__ */ Object.create(null); const keys = Object.keys(checkedKeys); allNodes.forEach((node) => node.setChecked(false, false)); const cacheCheckedChild = (node) => { node.childNodes.forEach((child) => { var _a; cache2[child.data[key]] = true; if ((_a = child.childNodes) == null ? void 0 : _a.length) cacheCheckedChild(child); }); }; for (let i = 0, j = allNodes.length; i < j; i++) { const node = allNodes[i]; const nodeKey = node.data[key].toString(); if (!keys.includes(nodeKey)) { if (node.checked && !cache2[nodeKey]) node.setChecked(false, false); continue; } if (node.childNodes.length) cacheCheckedChild(node); if (node.isLeaf || this.checkStrictly) { node.setChecked(true, false); continue; } node.setChecked(true, true); if (leafOnly) { node.setChecked(false, false, true); const traverse = function(node2) { node2.childNodes.forEach((child) => { if (!child.isLeaf) child.setChecked(false, false, true); traverse(child); }); node2.reInitChecked(); }; traverse(node); } } } setCheckedNodes(array, leafOnly = false) { const key = this.key; const checkedKeys = {}; array.forEach((item) => { checkedKeys[(item || {})[key]] = true; }); this._setCheckedKeys(key, leafOnly, checkedKeys); } setCheckedKeys(keys, leafOnly = false) { this.defaultCheckedKeys = keys; const key = this.key; const checkedKeys = {}; keys.forEach((key2) => { checkedKeys[key2] = true; }); this._setCheckedKeys(key, leafOnly, checkedKeys); } setDefaultExpandedKeys(keys) { keys = keys || []; this.defaultExpandedKeys = keys; keys.forEach((key) => { const node = this.getNode(key); if (node) node.expand(null, this.autoExpandParent); }); } setChecked(data, checked, deep) { const node = this.getNode(data); if (node) node.setChecked(!!checked, deep); } getCurrentNode() { return this.currentNode; } setCurrentNode(currentNode) { const prevCurrentNode = this.currentNode; if (prevCurrentNode) prevCurrentNode.isCurrent = false; this.currentNode = currentNode; this.currentNode.isCurrent = true; } setUserCurrentNode(node, shouldAutoExpandParent = true) { var _a; const key = node[this.key]; const currNode = this.nodesMap[key]; this.setCurrentNode(currNode); if (shouldAutoExpandParent && this.currentNode && this.currentNode.level > 1) (_a = this.currentNode.parent) == null ? void 0 : _a.expand(null, true); } setCurrentNodeKey(key, shouldAutoExpandParent = true) { var _a; this.currentNodeKey = key; if (isPropAbsent(key)) { this.currentNode && (this.currentNode.isCurrent = false); this.currentNode = null; return; } const node = this.getNode(key); if (node) { this.setCurrentNode(node); if (shouldAutoExpandParent && this.currentNode && this.currentNode.level > 1) (_a = this.currentNode.parent) == null ? void 0 : _a.expand(null, true); } } }; function useNodeExpandEventBroadcast(props2) { const parentNodeMap = inject(TREE_NODE_MAP_INJECTION_KEY, null); let currentNodeMap = { treeNodeExpand: (node) => { var _a; if (props2.node !== node) (_a = props2.node) == null ? void 0 : _a.collapse(); }, children: /* @__PURE__ */ new Set() }; if (parentNodeMap) parentNodeMap.children.add(currentNodeMap); onBeforeUnmount(() => { if (parentNodeMap) parentNodeMap.children.delete(currentNodeMap); currentNodeMap = null; }); provide(TREE_NODE_MAP_INJECTION_KEY, currentNodeMap); return { broadcastExpanded: (node) => { if (!props2.accordion) return; for (const childNode of currentNodeMap.children) childNode.treeNodeExpand(node); } }; } const dragEventsKey = Symbol("dragEvents"); function useDragNodeHandler({ props: props2, ctx, el$, dropIndicator$, store }) { const ns = useNamespace("tree"); const dragState = ref({ showDropIndicator: false, draggingNode: null, dropNode: null, allowDrop: true, dropType: null }); const treeNodeDragStart = ({ event, treeNode }) => { if (!event.dataTransfer) return; if (isFunction(props2.allowDrag) && !props2.allowDrag(treeNode.node)) { event.preventDefault(); return false; } event.dataTransfer.effectAllowed = "move"; try { event.dataTransfer.setData("text/plain", ""); } catch { } dragState.value.draggingNode = treeNode; ctx.emit("node-drag-start", treeNode.node, event); }; const treeNodeDragOver = ({ event, treeNode }) => { if (!event.dataTransfer) return; const dropNode = treeNode; const oldDropNode = dragState.value.dropNode; if (oldDropNode && oldDropNode.node.id !== dropNode.node.id) removeClass(oldDropNode.$el, ns.is("drop-inner")); const draggingNode = dragState.value.draggingNode; if (!draggingNode || !dropNode) return; let dropPrev = true; let dropInner = true; let dropNext = true; let userAllowDropInner = true; if (isFunction(props2.allowDrop)) { dropPrev = props2.allowDrop(draggingNode.node, dropNode.node, "prev"); userAllowDropInner = dropInner = props2.allowDrop(draggingNode.node, dropNode.node, "inner"); dropNext = props2.allowDrop(draggingNode.node, dropNode.node, "next"); } event.dataTransfer.dropEffect = dropInner || dropPrev || dropNext ? "move" : "none"; if ((dropPrev || dropInner || dropNext) && (oldDropNode == null ? void 0 : oldDropNode.node.id) !== dropNode.node.id) { if (oldDropNode) ctx.emit("node-drag-leave", draggingNode.node, oldDropNode.node, event); ctx.emit("node-drag-enter", draggingNode.node, dropNode.node, event); } if (dropPrev || dropInner || dropNext) dragState.value.dropNode = dropNode; else dragState.value.dropNode = null; if (dropNode.node.nextSibling === draggingNode.node) dropNext = false; if (dropNode.node.previousSibling === draggingNode.node) dropPrev = false; if (dropNode.node.contains(draggingNode.node, false)) dropInner = false; if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) { dropPrev = false; dropInner = false; dropNext = false; } const dropEl = dropNode.$el; const targetPosition = dropEl.querySelector(`.${ns.be("node", "content")}`).getBoundingClientRect(); const treePosition = el$.value.getBoundingClientRect(); const treeScrollTop = el$.value.scrollTop; let dropType; const prevPercent = dropPrev ? dropInner ? 0.25 : dropNext ? 0.45 : 1 : Number.NEGATIVE_INFINITY; const nextPercent = dropNext ? dropInner ? 0.75 : dropPrev ? 0.55 : 0 : Number.POSITIVE_INFINITY; let indicatorTop = -9999; const distance = event.clientY - targetPosition.top; if (distance < targetPosition.height * prevPercent) dropType = "before"; else if (distance > targetPosition.height * nextPercent) dropType = "after"; else if (dropInner) dropType = "inner"; else dropType = "none"; const iconPosition = dropEl.querySelector(`.${ns.be("node", "expand-icon")}`).getBoundingClientRect(); const dropIndicator = dropIndicator$.value; if (dropType === "before") indicatorTop = iconPosition.top - treePosition.top + treeScrollTop; else if (dropType === "after") indicatorTop = iconPosition.bottom - treePosition.top + treeScrollTop; dropIndicator.style.top = `${indicatorTop}px`; dropIndicator.style.left = `${iconPosition.right - treePosition.left}px`; if (dropType === "inner") addClass(dropEl, ns.is("drop-inner")); else removeClass(dropEl, ns.is("drop-inner")); dragState.value.showDropIndicator = dropType === "before" || dropType === "after"; dragState.value.allowDrop = dragState.value.showDropIndicator || userAllowDropInner; dragState.value.dropType = dropType; ctx.emit("node-drag-over", draggingNode.node, dropNode.node, event); }; const treeNodeDragEnd = (event) => { var _a, _b; const { draggingNode, dropType, dropNode } = dragState.value; event.preventDefault(); if (event.dataTransfer) event.dataTransfer.dropEffect = "move"; if ((draggingNode == null ? void 0 : draggingNode.node.data) && dropNode) { const draggingNodeCopy = { data: draggingNode.node.data }; if (dropType !== "none") draggingNode.node.remove(); if (dropType === "before") (_a = dropNode.node.parent) == null ? void 0 : _a.insertBefore(draggingNodeCopy, dropNode.node); else if (dropType === "after") (_b = dropNode.node.parent) == null ? void 0 : _b.insertAfter(draggingNodeCopy, dropNode.node); else if (dropType === "inner") dropNode.node.insertChild(draggingNodeCopy); if (dropType !== "none") { store.value.registerNode(draggingNodeCopy); if (store.value.key) draggingNode.node.eachNode((node) => { var _a2; (_a2 = store.value.nodesMap[node.data[store.value.key]]) == null ? void 0 : _a2.setChecked(node.checked, !store.value.checkStrictly); }); } removeClass(dropNode.$el, ns.is("drop-inner")); ctx.emit("node-drag-end", draggingNode.node, dropNode.node, dropType, event); if (dropType !== "none") ctx.emit("node-drop", draggingNode.node, dropNode.node, dropType, event); } if (draggingNode && !dropNode) ctx.emit("node-drag-end", draggingNode.node, null, dropType, event); dragState.value.showDropIndicator = false; dragState.value.draggingNode = null; dragState.value.dropNode = null; dragState.value.allowDrop = true; }; provide(dragEventsKey, { treeNodeDragStart, treeNodeDragOver, treeNodeDragEnd }); return { dragState }; } var tree_node_content_vue_vue_type_script_lang_default = defineComponent({ name: "ElTreeNodeContent", props: { node: { type: Object, required: true }, renderContent: Function }, setup(props2) { const ns = useNamespace("tree"); const nodeInstance = inject(NODE_INSTANCE_INJECTION_KEY); const tree = inject(ROOT_TREE_INJECTION_KEY$1); return () => { const node = props2.node; const { data, store } = node; return props2.renderContent ? props2.renderContent(h, { _self: nodeInstance, node, data, store }) : renderSlot(tree.ctx.slots, "default", { node, data }, () => [h(ElText, { tag: "span", truncated: true, class: ns.be("node", "label") }, () => [node.label])]); }; } }); var tree_node_content_default$1 = tree_node_content_vue_vue_type_script_lang_default; var tree_node_vue_vue_type_script_lang_default = defineComponent({ name: "ElTreeNode", components: { ElCollapseTransition, ElCheckbox, NodeContent: tree_node_content_default$1, ElIcon, Loading: loading_default }, props: { node: { type: Node2, default: () => ({}) }, props: { type: Object, default: () => ({}) }, accordion: Boolean, renderContent: Function, renderAfterExpand: Boolean, showCheckbox: Boolean }, emits: ["node-expand"], setup(props2, ctx) { const ns = useNamespace("tree"); const { broadcastExpanded } = useNodeExpandEventBroadcast(props2); const tree = inject(ROOT_TREE_INJECTION_KEY$1); const expanded = ref(false); const childNodeRendered = ref(false); const oldChecked = ref(); const oldIndeterminate = ref(); const node$ = ref(); const dragEvents = inject(dragEventsKey); const instance = getCurrentInstance(); provide(NODE_INSTANCE_INJECTION_KEY, instance); if (!tree) debugWarn("Tree", "Can not find node's tree."); if (props2.node.expanded) { expanded.value = true; childNodeRendered.value = true; } const childrenKey = tree.props.props["children"] || "children"; watch(() => { var _a; const children = (_a = props2.node.data) == null ? void 0 : _a[childrenKey]; return children && [...children]; }, () => { props2.node.updateChildren(); }); watch(() => props2.node.indeterminate, (val) => { handleSelectChange(props2.node.checked, val); }); watch(() => props2.node.checked, (val) => { handleSelectChange(val, props2.node.indeterminate); }); watch(() => props2.node.childNodes.length, () => props2.node.reInitChecked()); watch(() => props2.node.expanded, (val) => { nextTick(() => expanded.value = val); if (val) childNodeRendered.value = true; }); const getNodeKey$1 = (node) => { return tree.props.nodeKey ? getNodeKey(tree.props.nodeKey, node.data) : node.id; }; const getNodeClass = (node) => { const nodeClassFunc = props2.props.class; if (!nodeClassFunc) return {}; let className; if (isFunction(nodeClassFunc)) { const { data } = node; className = nodeClassFunc(data, node); } else className = nodeClassFunc; if (isString(className)) return { [className]: true }; else return className; }; const handleSelectChange = (checked, indeterminate) => { if (oldChecked.value !== checked || oldIndeterminate.value !== indeterminate) tree.ctx.emit("check-change", props2.node.data, checked, indeterminate); oldChecked.value = checked; oldIndeterminate.value = indeterminate; }; const handleClick = (e) => { handleCurrentChange(tree.store, tree.ctx.emit, () => { var _a; if ((_a = tree == null ? void 0 : tree.props) == null ? void 0 : _a.nodeKey) { const curNodeKey = getNodeKey$1(props2.node); tree.store.value.setCurrentNodeKey(curNodeKey); } else tree.store.value.setCurrentNode(props2.node); }); tree.currentNode.value = props2.node; if (tree.props.expandOnClickNode) handleExpandIconClick(); if ((tree.props.checkOnClickNode || props2.node.isLeaf && tree.props.checkOnClickLeaf && props2.showCheckbox) && !props2.node.disabled) handleCheckChange(!props2.node.checked); tree.ctx.emit("node-click", props2.node.data, props2.node, instance, e); }; const handleContextMenu = (event) => { var _a; if ((_a = tree.instance.vnode.props) == null ? void 0 : _a["onNodeContextmenu"]) { event.stopPropagation(); event.preventDefault(); } tree.ctx.emit("node-contextmenu", event, props2.node.data, props2.node, instance); }; const handleExpandIconClick = () => { if (props2.node.isLeaf) return; if (expanded.value) { tree.ctx.emit("node-collapse", props2.node.data, props2.node, instance); props2.node.collapse(); } else props2.node.expand(() => { ctx.emit("node-expand", props2.node.data, props2.node, instance); }); }; const handleCheckChange = (value) => { const checkStrictly = tree == null ? void 0 : tree.props.checkStrictly; const childNodes = props2.node.childNodes; if (!checkStrictly && childNodes.length) value = childNodes.some((node) => !node.isEffectivelyChecked); props2.node.setChecked(value, !checkStrictly); nextTick(() => { const store = tree.store.value; tree.ctx.emit("check", props2.node.data, { checkedNodes: store.getCheckedNodes(), checkedKeys: store.getCheckedKeys(), halfCheckedNodes: store.getHalfCheckedNodes(), halfCheckedKeys: store.getHalfCheckedKeys() }); }); }; const handleChildNodeExpand = (nodeData, node, instance2) => { broadcastExpanded(node); tree.ctx.emit("node-expand", nodeData, node, instance2); }; const handleDragStart = (event) => { if (!tree.props.draggable) return; dragEvents.treeNodeDragStart({ event, treeNode: props2 }); }; const handleDragOver = (event) => { event.preventDefault(); if (!tree.props.draggable) return; dragEvents.treeNodeDragOver({ event, treeNode: { $el: node$.value, node: props2.node } }); }; const handleDrop = (event) => { event.preventDefault(); }; const handleDragEnd = (event) => { if (!tree.props.draggable) return; dragEvents.treeNodeDragEnd(event); }; return { ns, node$, tree, expanded, childNodeRendered, oldChecked, oldIndeterminate, getNodeKey: getNodeKey$1, getNodeClass, handleSelectChange, handleClick, handleContextMenu, handleExpandIconClick, handleCheckChange, handleChildNodeExpand, handleDragStart, handleDragOver, handleDrop, handleDragEnd, CaretRight: caret_right_default }; } }); const _hoisted_1$c = [ "aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key" ]; const _hoisted_2$7 = ["aria-expanded"]; function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_icon = resolveComponent("el-icon"); const _component_el_checkbox = resolveComponent("el-checkbox"); const _component_loading = resolveComponent("loading"); const _component_node_content = resolveComponent("node-content"); const _component_el_tree_node = resolveComponent("el-tree-node"); const _component_el_collapse_transition = resolveComponent("el-collapse-transition"); return withDirectives((openBlock(), createElementBlock("div", { ref: "node$", class: normalizeClass([ _ctx.ns.b("node"), _ctx.ns.is("expanded", _ctx.expanded), _ctx.ns.is("current", _ctx.node.isCurrent), _ctx.ns.is("hidden", !_ctx.node.visible), _ctx.ns.is("focusable", !_ctx.node.disabled), _ctx.ns.is("checked", !_ctx.node.disabled && _ctx.node.checked), _ctx.getNodeClass(_ctx.node) ]), role: "treeitem", tabindex: "-1", "aria-expanded": _ctx.expanded, "aria-disabled": _ctx.node.disabled, "aria-checked": _ctx.node.checked, draggable: _ctx.tree.props.draggable, "data-key": _ctx.getNodeKey(_ctx.node), onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"])), onContextmenu: _cache[3] || (_cache[3] = (...args) => _ctx.handleContextMenu && _ctx.handleContextMenu(...args)), onDragstart: _cache[4] || (_cache[4] = withModifiers((...args) => _ctx.handleDragStart && _ctx.handleDragStart(...args), ["stop"])), onDragover: _cache[5] || (_cache[5] = withModifiers((...args) => _ctx.handleDragOver && _ctx.handleDragOver(...args), ["stop"])), onDragend: _cache[6] || (_cache[6] = withModifiers((...args) => _ctx.handleDragEnd && _ctx.handleDragEnd(...args), ["stop"])), onDrop: _cache[7] || (_cache[7] = withModifiers((...args) => _ctx.handleDrop && _ctx.handleDrop(...args), ["stop"])) }, [createBaseVNode("div", { class: normalizeClass(_ctx.ns.be("node", "content")), style: normalizeStyle({ paddingLeft: (_ctx.node.level - 1) * _ctx.tree.props.indent + "px" }) }, [ _ctx.tree.props.icon || _ctx.CaretRight ? (openBlock(), createBlock(_component_el_icon, { key: 0, class: normalizeClass([ _ctx.ns.be("node", "expand-icon"), _ctx.ns.is("leaf", _ctx.node.isLeaf), { expanded: !_ctx.node.isLeaf && _ctx.expanded } ]), onClick: withModifiers(_ctx.handleExpandIconClick, ["stop"]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.tree.props.icon || _ctx.CaretRight)))]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), _ctx.showCheckbox ? (openBlock(), createBlock(_component_el_checkbox, { key: 1, "model-value": _ctx.node.checked, indeterminate: _ctx.node.indeterminate, disabled: !!_ctx.node.disabled, onClick: _cache[0] || (_cache[0] = withModifiers(() => { }, ["stop"])), onChange: _ctx.handleCheckChange }, null, 8, [ "model-value", "indeterminate", "disabled", "onChange" ])) : createCommentVNode("v-if", true), _ctx.node.loading ? (openBlock(), createBlock(_component_el_icon, { key: 2, class: normalizeClass([_ctx.ns.be("node", "loading-icon"), _ctx.ns.is("loading")]) }, { default: withCtx(() => [createVNode(_component_loading)]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), createVNode(_component_node_content, { node: _ctx.node, "render-content": _ctx.renderContent }, null, 8, ["node", "render-content"]) ], 6), createVNode(_component_el_collapse_transition, null, { default: withCtx(() => [!_ctx.renderAfterExpand || _ctx.childNodeRendered ? withDirectives((openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(_ctx.ns.be("node", "children")), role: "group", "aria-expanded": _ctx.expanded, onClick: _cache[1] || (_cache[1] = withModifiers(() => { }, ["stop"])) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.node.childNodes, (child) => { return openBlock(), createBlock(_component_el_tree_node, { key: _ctx.getNodeKey(child), "render-content": _ctx.renderContent, "render-after-expand": _ctx.renderAfterExpand, "show-checkbox": _ctx.showCheckbox, node: child, accordion: _ctx.accordion, props: _ctx.props, onNodeExpand: _ctx.handleChildNodeExpand }, null, 8, [ "render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand" ]); }), 128))], 10, _hoisted_2$7)), [[vShow, _ctx.expanded]]) : createCommentVNode("v-if", true)]), _: 1 })], 42, _hoisted_1$c)), [[vShow, _ctx.node.visible]]); } var tree_node_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(tree_node_vue_vue_type_script_lang_default, [["render", _sfc_render$2]]); function useKeydown({ el$ }, store) { const ns = useNamespace("tree"); onMounted(() => { initTabIndex(); }); onUpdated(() => { var _a; (_a = el$.value) == null ? void 0 : _a.querySelectorAll("input[type=checkbox]").forEach((checkbox) => { checkbox.setAttribute("tabindex", "-1"); }); }); function canNodeFocus(treeItems, nextIndex) { var _a, _b; const currentNode = store.value.getNode(treeItems[nextIndex].dataset.key); return currentNode.canFocus && currentNode.visible && (((_a = currentNode.parent) == null ? void 0 : _a.expanded) || ((_b = currentNode.parent) == null ? void 0 : _b.level) === 0); } const handleKeydown = (ev) => { const currentItem = ev.target; if (!currentItem.className.includes(ns.b("node"))) return; const code = getEventCode(ev); const treeItems = Array.from(el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`)); const currentIndex = treeItems.indexOf(currentItem); let nextIndex; if ([EVENT_CODE.up, EVENT_CODE.down].includes(code)) { ev.preventDefault(); if (code === EVENT_CODE.up) { nextIndex = currentIndex === -1 ? 0 : currentIndex !== 0 ? currentIndex - 1 : treeItems.length - 1; const startIndex = nextIndex; while (true) { if (canNodeFocus(treeItems, nextIndex)) break; nextIndex--; if (nextIndex === startIndex) { nextIndex = -1; break; } if (nextIndex < 0) nextIndex = treeItems.length - 1; } } else { nextIndex = currentIndex === -1 ? 0 : currentIndex < treeItems.length - 1 ? currentIndex + 1 : 0; const startIndex = nextIndex; while (true) { if (canNodeFocus(treeItems, nextIndex)) break; nextIndex++; if (nextIndex === startIndex) { nextIndex = -1; break; } if (nextIndex >= treeItems.length) nextIndex = 0; } } nextIndex !== -1 && treeItems[nextIndex].focus(); } if ([EVENT_CODE.left, EVENT_CODE.right].includes(code)) { ev.preventDefault(); currentItem.click(); } const hasInput = currentItem.querySelector('[type="checkbox"]'); if ([ EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space ].includes(code) && hasInput) { ev.preventDefault(); hasInput.click(); } }; useEventListener(el$, "keydown", handleKeydown); const initTabIndex = () => { var _a; if (!el$.value) return; const treeItems = Array.from(el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`)); Array.from(el$.value.querySelectorAll("input[type=checkbox]")).forEach((checkbox) => { checkbox.setAttribute("tabindex", "-1"); }); const checkedItem = el$.value.querySelectorAll(`.${ns.is("checked")}[role=treeitem]`); if (checkedItem.length) { checkedItem[0].setAttribute("tabindex", "0"); return; } (_a = treeItems[0]) == null ? void 0 : _a.setAttribute("tabindex", "0"); }; } var tree_vue_vue_type_script_lang_default = defineComponent({ name: "ElTree", components: { ElTreeNode: tree_node_default$1 }, props: treeProps$1, emits: treeEmits$1, setup(props2, ctx) { const { t } = useLocale(); const ns = useNamespace("tree"); const store = ref(new TreeStore({ key: props2.nodeKey, data: props2.data, lazy: props2.lazy, props: props2.props, load: props2.load, currentNodeKey: props2.currentNodeKey, checkStrictly: props2.checkStrictly, checkDescendants: props2.checkDescendants, defaultCheckedKeys: props2.defaultCheckedKeys, defaultExpandedKeys: props2.defaultExpandedKeys, autoExpandParent: props2.autoExpandParent, defaultExpandAll: props2.defaultExpandAll, filterNodeMethod: props2.filterNodeMethod })); store.value.initialize(); const root = ref(store.value.root); const currentNode = ref(null); const el$ = ref(null); const dropIndicator$ = ref(null); const { broadcastExpanded } = useNodeExpandEventBroadcast(props2); const { dragState } = useDragNodeHandler({ props: props2, ctx, el$, dropIndicator$, store }); useKeydown({ el$ }, store); const instance = getCurrentInstance(); const isSelectTree = computed(() => { let parent = instance == null ? void 0 : instance.parent; while (parent) { if (parent.type.name === "ElTreeSelect") return true; parent = parent.parent; } return false; }); const isEmpty2 = computed(() => { const { childNodes } = root.value; return (!childNodes || childNodes.length === 0 || childNodes.every(({ visible }) => !visible)) && !isSelectTree.value; }); watch(() => props2.currentNodeKey, (newVal) => { store.value.setCurrentNodeKey(newVal ?? null); }); watch(() => props2.defaultCheckedKeys, (newVal, oldVal) => { if (isEqual(newVal, oldVal)) return; store.value.setDefaultCheckedKey(newVal ?? []); }); watch(() => props2.defaultExpandedKeys, (newVal) => { store.value.setDefaultExpandedKeys(newVal ?? []); }); watch(() => props2.data, (newVal) => { store.value.setData(newVal); }, { deep: true }); watch(() => props2.checkStrictly, (newVal) => { store.value.checkStrictly = newVal; }); const filter = (value) => { if (!props2.filterNodeMethod) throw new Error("[Tree] filterNodeMethod is required when filter"); store.value.filter(value); }; const getNodeKey$1 = (node) => { return props2.nodeKey ? getNodeKey(props2.nodeKey, node.data) : node.id; }; const requireNodeKey = (methodName) => { if (!props2.nodeKey) throw new Error(`[Tree] nodeKey is required in ${methodName}`); }; const getNodePath = (data) => { requireNodeKey("getNodePath"); const node = store.value.getNode(data); if (!node) return []; const path = [node.data]; let parent = node.parent; while (parent && parent !== root.value) { path.push(parent.data); parent = parent.parent; } return path.reverse(); }; const getCheckedNodes = (leafOnly, includeHalfChecked) => { return store.value.getCheckedNodes(leafOnly, includeHalfChecked); }; const getCheckedKeys = (leafOnly) => { return store.value.getCheckedKeys(leafOnly); }; const getCurrentNode = () => { const currentNode2 = store.value.getCurrentNode(); return currentNode2 ? currentNode2.data : null; }; const getCurrentKey = () => { requireNodeKey("getCurrentKey"); const currentNode2 = getCurrentNode(); return currentNode2 ? currentNode2[props2.nodeKey] : null; }; const setCheckedNodes = (nodes, leafOnly) => { requireNodeKey("setCheckedNodes"); store.value.setCheckedNodes(nodes, leafOnly); }; const setCheckedKeys = (keys, leafOnly) => { requireNodeKey("setCheckedKeys"); store.value.setCheckedKeys(keys, leafOnly); }; const setChecked = (data, checked, deep) => { store.value.setChecked(data, checked, deep); }; const getHalfCheckedNodes = () => { return store.value.getHalfCheckedNodes(); }; const getHalfCheckedKeys = () => { return store.value.getHalfCheckedKeys(); }; const setCurrentNode = (node, shouldAutoExpandParent = true) => { requireNodeKey("setCurrentNode"); handleCurrentChange(store, ctx.emit, () => { broadcastExpanded(node); store.value.setUserCurrentNode(node, shouldAutoExpandParent); }); }; const setCurrentKey = (key = null, shouldAutoExpandParent = true) => { requireNodeKey("setCurrentKey"); handleCurrentChange(store, ctx.emit, () => { broadcastExpanded(); store.value.setCurrentNodeKey(key, shouldAutoExpandParent); }); }; const getNode = (data) => { return store.value.getNode(data); }; const remove = (data) => { store.value.remove(data); }; const append = (data, parentNode) => { store.value.append(data, parentNode); }; const insertBefore = (data, refNode) => { store.value.insertBefore(data, refNode); }; const insertAfter = (data, refNode) => { store.value.insertAfter(data, refNode); }; const handleNodeExpand = (nodeData, node, instance2) => { broadcastExpanded(node); ctx.emit("node-expand", nodeData, node, instance2); }; const updateKeyChildren = (key, data) => { requireNodeKey("updateKeyChildren"); store.value.updateChildren(key, data); }; provide(ROOT_TREE_INJECTION_KEY$1, { ctx, props: props2, store, root, currentNode, instance }); provide(formItemContextKey, void 0); return { ns, store, root, currentNode, dragState, el$, dropIndicator$, isEmpty: isEmpty2, filter, getNodeKey: getNodeKey$1, getNodePath, getCheckedNodes, getCheckedKeys, getCurrentNode, getCurrentKey, setCheckedNodes, setCheckedKeys, setChecked, getHalfCheckedNodes, getHalfCheckedKeys, setCurrentNode, setCurrentKey, t, getNode, remove, append, insertBefore, insertAfter, handleNodeExpand, updateKeyChildren }; } }); function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_tree_node = resolveComponent("el-tree-node"); return openBlock(), createElementBlock("div", { ref: "el$", class: normalizeClass([ _ctx.ns.b(), _ctx.ns.is("dragging", !!_ctx.dragState.draggingNode), _ctx.ns.is("drop-not-allow", !_ctx.dragState.allowDrop), _ctx.ns.is("drop-inner", _ctx.dragState.dropType === "inner"), { [_ctx.ns.m("highlight-current")]: _ctx.highlightCurrent } ]), role: "tree" }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.root.childNodes, (child) => { return openBlock(), createBlock(_component_el_tree_node, { key: _ctx.getNodeKey(child), node: child, props: _ctx.props, accordion: _ctx.accordion, "render-after-expand": _ctx.renderAfterExpand, "show-checkbox": _ctx.showCheckbox, "render-content": _ctx.renderContent, onNodeExpand: _ctx.handleNodeExpand }, null, 8, [ "node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand" ]); }), 128)), _ctx.isEmpty ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(_ctx.ns.e("empty-block")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createBaseVNode("span", { class: normalizeClass(_ctx.ns.e("empty-text")) }, toDisplayString(_ctx.emptyText ?? _ctx.t("el.tree.emptyText")), 3)])], 2)) : createCommentVNode("v-if", true), withDirectives(createBaseVNode("div", { ref: "dropIndicator$", class: normalizeClass(_ctx.ns.e("drop-indicator")) }, null, 2), [[vShow, _ctx.dragState.showDropIndicator]]) ], 2); } var tree_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(tree_vue_vue_type_script_lang_default, [["render", _sfc_render$1]]); const ElTree = withInstall(tree_default$1); const useSelect = (props2, { attrs, emit }, { select, tree, key }) => { const ns = useNamespace("tree-select"); watch(() => props2.data, () => { if (props2.filterable) nextTick(() => { var _a, _b; (_b = tree.value) == null ? void 0 : _b.filter((_a = select.value) == null ? void 0 : _a.states.inputValue); }); }, { flush: "post" }); const focusLastNode = (listNode) => { var _a, _b; const lastNode = listNode.at(-1); if (lastNode.expanded && lastNode.childNodes.at(-1)) focusLastNode([lastNode.childNodes.at(-1)]); else { (_b = (_a = tree.value.el$) == null ? void 0 : _a.querySelector(`[data-key="${listNode.at(-1).key}"]`)) == null ? void 0 : _b.focus({ preventScroll: true }); return; } }; onMounted(() => { useEventListener(() => { var _a; return (_a = select.value) == null ? void 0 : _a.$el; }, "keydown", async (evt) => { const code = getEventCode(evt); const { dropdownMenuVisible } = select.value; if ([EVENT_CODE.down, EVENT_CODE.up].includes(code) && dropdownMenuVisible) { await nextTick(); setTimeout(() => { var _a, _b, _c; if (EVENT_CODE.up === code) { const listNode = tree.value.store.root.childNodes; focusLastNode(listNode); return; } (_c = (_b = (_a = select.value.optionsArray[select.value.states.hoveringIndex].$el) == null ? void 0 : _a.parentNode) == null ? void 0 : _b.parentNode) == null ? void 0 : _c.focus({ preventScroll: true }); }); } }, { capture: true }); }); return { ...pick(toRefs(props2), Object.keys(ElSelect.props)), ...attrs, class: computed(() => attrs.class), style: computed(() => attrs.style), "onUpdate:modelValue": (value) => emit(UPDATE_MODEL_EVENT, value), valueKey: key, popperClass: computed(() => { const classes = [ns.e("popper")]; if (props2.popperClass) classes.push(props2.popperClass); return classes.join(" "); }), filterMethod: (keyword = "") => { var _a; if (props2.filterMethod) props2.filterMethod(keyword); else if (props2.remoteMethod) props2.remoteMethod(keyword); else (_a = tree.value) == null ? void 0 : _a.filter(keyword); } }; }; const component = defineComponent({ extends: ElOption, setup(props2, ctx) { const result = ElOption.setup(props2, ctx); delete result.selectOptionClick; const vm = getCurrentInstance().proxy; nextTick(() => { if (!result.select.states.cachedOptions.get(vm.value)) result.select.onOptionCreate(vm); }); watch(() => ctx.attrs.visible, (val) => { nextTick(() => { result.states.visible = val; }); }, { immediate: true }); return result; }, methods: { selectOptionClick() { this.$el.parentElement.click(); } } }); function isValidValue(val) { return val || val === 0; } function isValidArray(val) { return isArray(val) && val.length; } function toValidArray(val) { return isArray(val) ? val : isValidValue(val) ? [val] : []; } function treeFind(treeData, findCallback, getChildren, resultCallback, parent) { for (let i = 0; i < treeData.length; i++) { const data = treeData[i]; if (findCallback(data, i, treeData, parent)) return resultCallback ? resultCallback(data, i, treeData, parent) : data; else { const children = getChildren(data); if (isValidArray(children)) { const find = treeFind(children, findCallback, getChildren, resultCallback, data); if (find) return find; } } } } function treeEach(treeData, callback, getChildren, parent) { for (let i = 0; i < treeData.length; i++) { const data = treeData[i]; callback(data, i, treeData, parent); const children = getChildren(data); if (isValidArray(children)) treeEach(children, callback, getChildren, data); } } const useTree$1 = (props2, { attrs, slots, emit }, { select, tree, key }) => { watch([() => props2.modelValue, tree], () => { if (props2.showCheckbox) nextTick(() => { const treeInstance = tree.value; if (treeInstance && !isEqual(treeInstance.getCheckedKeys(), toValidArray(props2.modelValue))) treeInstance.setCheckedKeys(toValidArray(props2.modelValue)); }); }, { immediate: true, deep: true }); const propsMap = computed(() => ({ value: key.value, label: "label", children: "children", disabled: "disabled", isLeaf: "isLeaf", ...props2.props })); const getNodeValByProp = (prop, data) => { var _a; const propVal = propsMap.value[prop]; if (isFunction(propVal)) return propVal(data, (_a = tree.value) == null ? void 0 : _a.getNode(getNodeValByProp("value", data))); else return data[propVal]; }; const defaultExpandedParentKeys = toValidArray(props2.modelValue).map((value) => { return treeFind(props2.data || [], (data) => getNodeValByProp("value", data) === value, (data) => getNodeValByProp("children", data), (data, index, array, parent) => parent && getNodeValByProp("value", parent)); }).filter((item) => isValidValue(item)); const cacheOptions = computed(() => { if (!props2.renderAfterExpand && !props2.lazy) return []; const options = []; treeEach(props2.data.concat(props2.cacheData), (node) => { const value = getNodeValByProp("value", node); options.push({ value, currentLabel: getNodeValByProp("label", node), isDisabled: getNodeValByProp("disabled", node) }); }, (data) => getNodeValByProp("children", data)); return options; }); const getChildCheckedKeys = () => { var _a; return (_a = tree.value) == null ? void 0 : _a.getCheckedKeys().filter((checkedKey) => { var _a2; const node = (_a2 = tree.value) == null ? void 0 : _a2.getNode(checkedKey); return !isNil(node) && isEmpty(node.childNodes); }); }; const emitChange = (val) => { if (!isEqual(props2.modelValue, val)) emit(CHANGE_EVENT, val); }; function update(val) { emit(UPDATE_MODEL_EVENT, val); emitChange(val); } return { ...pick(toRefs(props2), Object.keys(ElTree.props)), ...attrs, nodeKey: key, expandOnClickNode: computed(() => { return !props2.checkStrictly && props2.expandOnClickNode; }), defaultExpandedKeys: computed(() => { return props2.defaultExpandedKeys ? props2.defaultExpandedKeys.concat(defaultExpandedParentKeys) : defaultExpandedParentKeys; }), renderContent: (h2, { node, data, store }) => { return h2(component, { value: getNodeValByProp("value", data), label: getNodeValByProp("label", data), disabled: getNodeValByProp("disabled", data), visible: node.visible }, props2.renderContent ? () => props2.renderContent(h2, { node, data, store }) : slots.default ? () => slots.default({ node, data, store }) : void 0); }, filterNodeMethod: (value, data, node) => { if (props2.filterNodeMethod) return props2.filterNodeMethod(value, data, node); if (!value) return true; return new RegExp(escapeStringRegexp(value), "i").test(getNodeValByProp("label", data) || ""); }, onNodeClick: (data, node, e) => { var _a, _b, _c; (_a = attrs.onNodeClick) == null ? void 0 : _a.call(attrs, data, node, e); if (props2.showCheckbox && props2.checkOnClickNode) return; if (!props2.showCheckbox && (props2.checkStrictly || node.isLeaf)) { if (!getNodeValByProp("disabled", data)) { const option = (_b = select.value) == null ? void 0 : _b.states.options.get(getNodeValByProp("value", data)); (_c = select.value) == null ? void 0 : _c.handleOptionSelect(option); } } else if (props2.expandOnClickNode) e.proxy.handleExpandIconClick(); }, onCheck: (data, params) => { var _a; if (!props2.showCheckbox) return; const dataValue = getNodeValByProp("value", data); const dataMap = {}; treeEach([tree.value.store.root], (node) => dataMap[node.key] = node, (node) => node.childNodes); const uncachedCheckedKeys = params.checkedKeys; const cachedKeys = props2.multiple ? toValidArray(props2.modelValue).filter((item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item)) : []; const checkedKeys = cachedKeys.concat(uncachedCheckedKeys); if (props2.checkStrictly) update(props2.multiple ? checkedKeys : checkedKeys.includes(dataValue) ? dataValue : void 0); else if (props2.multiple) { const childKeys = getChildCheckedKeys(); update(cachedKeys.concat(childKeys)); } else { const firstLeaf = treeFind([data], (data2) => !isValidArray(getNodeValByProp("children", data2)) && !getNodeValByProp("disabled", data2), (data2) => getNodeValByProp("children", data2)); const firstLeafKey = firstLeaf ? getNodeValByProp("value", firstLeaf) : void 0; const hasCheckedChild = isValidValue(props2.modelValue) && !!treeFind([data], (data2) => getNodeValByProp("value", data2) === props2.modelValue, (data2) => getNodeValByProp("children", data2)); update(firstLeafKey === props2.modelValue || hasCheckedChild ? void 0 : firstLeafKey); } nextTick(() => { var _a2; const checkedKeys2 = toValidArray(props2.modelValue); tree.value.setCheckedKeys(checkedKeys2); (_a2 = attrs.onCheck) == null ? void 0 : _a2.call(attrs, data, { checkedKeys: tree.value.getCheckedKeys(), checkedNodes: tree.value.getCheckedNodes(), halfCheckedKeys: tree.value.getHalfCheckedKeys(), halfCheckedNodes: tree.value.getHalfCheckedNodes() }); }); (_a = select.value) == null ? void 0 : _a.focus(); }, onNodeExpand: (data, node, e) => { var _a; (_a = attrs.onNodeExpand) == null ? void 0 : _a.call(attrs, data, node, e); nextTick(() => { if (!props2.checkStrictly && props2.lazy && props2.multiple && node.checked) { const dataMap = {}; const uncachedCheckedKeys = tree.value.getCheckedKeys(); treeEach([tree.value.store.root], (node2) => dataMap[node2.key] = node2, (node2) => node2.childNodes); const cachedKeys = toValidArray(props2.modelValue).filter((item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item)); const childKeys = getChildCheckedKeys(); update(cachedKeys.concat(childKeys)); } }); }, cacheOptions }; }; var cache_options_default = defineComponent({ props: { data: { type: Array, default: () => [] } }, setup(props2) { const select = inject(selectKey); watch(() => props2.data, () => { var _a; props2.data.forEach((item) => { if (!select.states.cachedOptions.has(item.value)) select.states.cachedOptions.set(item.value, item); }); const inputs = ((_a = select.selectRef) == null ? void 0 : _a.querySelectorAll("input")) || []; if (isClient && !Array.from(inputs).includes(document.activeElement)) select.setSelected(); }, { flush: "post", immediate: true }); return () => void 0; } }); var tree_select_vue_vue_type_script_lang_default = defineComponent({ name: "ElTreeSelect", inheritAttrs: false, props: { ...selectProps, ...treeProps$1, cacheData: { type: Array, default: () => [] } }, setup(props2, context) { const { slots, expose, emit, attrs } = context; const childAttrs = { ...attrs, onChange: void 0 }; const select = ref(); const tree = ref(); const key = computed(() => props2.nodeKey || props2.valueKey || "value"); const selectProps2 = useSelect(props2, { attrs, emit }, { select, tree, key }); const { cacheOptions, ...treeProps2 } = useTree$1(props2, { attrs: childAttrs, slots, emit }, { select, tree, key }); const methods = reactive({}); expose(methods); onMounted(() => { Object.assign(methods, { ...pick(tree.value, [ "filter", "updateKeyChildren", "getCheckedNodes", "setCheckedNodes", "getCheckedKeys", "setCheckedKeys", "setChecked", "getHalfCheckedNodes", "getHalfCheckedKeys", "getCurrentKey", "getCurrentNode", "setCurrentKey", "setCurrentNode", "getNode", "remove", "append", "insertBefore", "insertAfter" ]), ...pick(select.value, [ "focus", "blur", "selectedLabel" ]), treeRef: tree.value, selectRef: select.value }); }); return () => h( ElSelect, /** * 1. The `props` is processed into `Refs`, but `v-bind` and * render function props cannot read `Refs`, so use `reactive` * unwrap the `Refs` and keep reactive. * 2. The keyword `ref` requires `Ref`, but `reactive` broke it, * so use function. */ reactive({ ...selectProps2, ref: (ref2) => select.value = ref2 }), { ...slots, default: () => [h(cache_options_default, { data: cacheOptions.value }), h(ElTree, reactive({ ...treeProps2, ref: (ref2) => tree.value = ref2 }))] } ); } }); var tree_select_default = tree_select_vue_vue_type_script_lang_default; const ElTreeSelect = withInstall(tree_select_default); const ROOT_TREE_INJECTION_KEY = Symbol(); const EMPTY_NODE = { key: -1, level: -1, data: {} }; let TreeOptionsEnum = /* @__PURE__ */ (function(TreeOptionsEnum2) { TreeOptionsEnum2["KEY"] = "id"; TreeOptionsEnum2["LABEL"] = "label"; TreeOptionsEnum2["CHILDREN"] = "children"; TreeOptionsEnum2["DISABLED"] = "disabled"; TreeOptionsEnum2["CLASS"] = ""; return TreeOptionsEnum2; })({}); let SetOperationEnum = /* @__PURE__ */ (function(SetOperationEnum2) { SetOperationEnum2["ADD"] = "add"; SetOperationEnum2["DELETE"] = "delete"; return SetOperationEnum2; })({}); const itemSize = { type: Number, default: 26 }; const treeProps = buildProps({ data: { type: definePropType(Array), default: () => mutable([]) }, emptyText: { type: String }, height: { type: Number, default: 200 }, props: { type: definePropType(Object), default: () => mutable({ children: TreeOptionsEnum.CHILDREN, label: TreeOptionsEnum.LABEL, disabled: TreeOptionsEnum.DISABLED, value: TreeOptionsEnum.KEY, class: TreeOptionsEnum.CLASS }) }, highlightCurrent: Boolean, showCheckbox: Boolean, defaultCheckedKeys: { type: definePropType(Array), default: () => mutable([]) }, checkStrictly: Boolean, defaultExpandedKeys: { type: definePropType(Array), default: () => mutable([]) }, indent: { type: Number, default: 16 }, itemSize, icon: { type: iconPropType }, expandOnClickNode: { type: Boolean, default: true }, checkOnClickNode: Boolean, checkOnClickLeaf: { type: Boolean, default: true }, currentNodeKey: { type: definePropType([String, Number]) }, accordion: Boolean, filterMethod: { type: definePropType(Function) }, perfMode: { type: Boolean, default: true }, scrollbarAlwaysOn: Boolean }); const treeNodeProps = buildProps({ node: { type: definePropType(Object), default: () => mutable(EMPTY_NODE) }, expanded: Boolean, checked: Boolean, indeterminate: Boolean, showCheckbox: Boolean, disabled: Boolean, current: Boolean, hiddenExpandIcon: Boolean, itemSize }); const treeNodeContentProps = buildProps({ node: { type: definePropType(Object), required: true } }); const NODE_CLICK = "node-click"; const NODE_DROP = "node-drop"; const NODE_EXPAND = "node-expand"; const NODE_COLLAPSE = "node-collapse"; const CURRENT_CHANGE = "current-change"; const NODE_CHECK = "check"; const NODE_CHECK_CHANGE = "check-change"; const NODE_CONTEXTMENU = "node-contextmenu"; const treeEmits = { [NODE_CLICK]: (data, node, e) => data && node && e, [NODE_DROP]: (data, node, e) => data && node && e, [NODE_EXPAND]: (data, node) => data && node, [NODE_COLLAPSE]: (data, node) => data && node, [CURRENT_CHANGE]: (data, node) => data && node, [NODE_CHECK]: (data, checkedInfo) => data && checkedInfo, [NODE_CHECK_CHANGE]: (data, checked) => data && isBoolean(checked), [NODE_CONTEXTMENU]: (evt, data, node) => evt && data && node }; const treeNodeEmits = { click: (node, e) => !!(node && e), drop: (node, e) => !!(node && e), toggle: (node) => !!node, check: (node, checked) => node && isBoolean(checked) }; function useCheck(props2, tree) { const checkedKeys = ref(/* @__PURE__ */ new Set()); const indeterminateKeys = ref(/* @__PURE__ */ new Set()); const { emit } = getCurrentInstance(); watch([() => tree.value, () => props2.defaultCheckedKeys], () => { return nextTick(() => { _setCheckedKeys(props2.defaultCheckedKeys); }); }, { immediate: true }); const updateCheckedKeys = () => { if (!tree.value || !props2.showCheckbox || props2.checkStrictly) return; const { levelTreeNodeMap, maxLevel } = tree.value; const checkedKeySet = checkedKeys.value; const indeterminateKeySet = /* @__PURE__ */ new Set(); for (let level = maxLevel; level >= 1; --level) { const nodes = levelTreeNodeMap.get(level); if (!nodes) continue; nodes.forEach((node) => { const children = node.children; let isEffectivelyChecked = !node.isLeaf || node.disabled || checkedKeySet.has(node.key); if (children) { let allChecked = true; let hasChecked = false; for (const childNode of children) { const key = childNode.key; if (!childNode.isEffectivelyChecked) isEffectivelyChecked = false; if (checkedKeySet.has(key)) hasChecked = true; else if (indeterminateKeySet.has(key)) { allChecked = false; hasChecked = true; break; } else allChecked = false; } if (allChecked) checkedKeySet.add(node.key); else if (hasChecked) { indeterminateKeySet.add(node.key); checkedKeySet.delete(node.key); } else { checkedKeySet.delete(node.key); indeterminateKeySet.delete(node.key); } } node.isEffectivelyChecked = isEffectivelyChecked; }); } indeterminateKeys.value = indeterminateKeySet; }; const isChecked = (node) => checkedKeys.value.has(node.key); const isIndeterminate = (node) => indeterminateKeys.value.has(node.key); const toggleCheckbox = (node, isChecked2, nodeClick = true, immediateUpdate = true) => { const checkedKeySet = checkedKeys.value; const children = node.children; if (!props2.checkStrictly && nodeClick && (children == null ? void 0 : children.length)) isChecked2 = children.some((node2) => !node2.isEffectivelyChecked); const toggle = (node2, checked) => { checkedKeySet[checked ? SetOperationEnum.ADD : SetOperationEnum.DELETE](node2.key); const children2 = node2.children; if (!props2.checkStrictly && children2) children2.forEach((childNode) => { if (!childNode.disabled || childNode.children) toggle(childNode, checked); }); }; toggle(node, isChecked2); if (immediateUpdate) updateCheckedKeys(); if (nodeClick) afterNodeCheck(node, isChecked2); }; const afterNodeCheck = (node, checked) => { const { checkedNodes, checkedKeys: checkedKeys2 } = getChecked(); const { halfCheckedNodes, halfCheckedKeys } = getHalfChecked(); emit(NODE_CHECK, node.data, { checkedKeys: checkedKeys2, checkedNodes, halfCheckedKeys, halfCheckedNodes }); emit(NODE_CHECK_CHANGE, node.data, checked); }; function getCheckedKeys(leafOnly = false) { return getChecked(leafOnly).checkedKeys; } function getCheckedNodes(leafOnly = false) { return getChecked(leafOnly).checkedNodes; } function getHalfCheckedKeys() { return getHalfChecked().halfCheckedKeys; } function getHalfCheckedNodes() { return getHalfChecked().halfCheckedNodes; } function getChecked(leafOnly = false) { const checkedNodes = []; const keys = []; if ((tree == null ? void 0 : tree.value) && props2.showCheckbox) { const { treeNodeMap } = tree.value; checkedKeys.value.forEach((key) => { const node = treeNodeMap.get(key); if (node && (!leafOnly || leafOnly && node.isLeaf)) { keys.push(key); checkedNodes.push(node.data); } }); } return { checkedKeys: keys, checkedNodes }; } function getHalfChecked() { const halfCheckedNodes = []; const halfCheckedKeys = []; if ((tree == null ? void 0 : tree.value) && props2.showCheckbox) { const { treeNodeMap } = tree.value; indeterminateKeys.value.forEach((key) => { const node = treeNodeMap.get(key); if (node) { halfCheckedKeys.push(key); halfCheckedNodes.push(node.data); } }); } return { halfCheckedNodes, halfCheckedKeys }; } function setCheckedKeys(keys) { checkedKeys.value.clear(); indeterminateKeys.value.clear(); nextTick(() => { _setCheckedKeys(keys); }); } function setChecked(key, isChecked2) { if ((tree == null ? void 0 : tree.value) && props2.showCheckbox) { const node = tree.value.treeNodeMap.get(key); if (node) toggleCheckbox(node, isChecked2, false); } } function _setCheckedKeys(keys) { if (tree == null ? void 0 : tree.value) { const { treeNodeMap } = tree.value; if (props2.showCheckbox && treeNodeMap && (keys == null ? void 0 : keys.length) > 0) { for (const key of keys) { const node = treeNodeMap.get(key); if (node && !isChecked(node)) toggleCheckbox(node, true, false, false); } updateCheckedKeys(); } } } return { updateCheckedKeys, toggleCheckbox, isChecked, isIndeterminate, getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes, setChecked, setCheckedKeys }; } function useFilter(props2, tree) { const hiddenNodeKeySet = ref(/* @__PURE__ */ new Set([])); const hiddenExpandIconKeySet = ref(/* @__PURE__ */ new Set([])); const filterable = computed(() => { return isFunction(props2.filterMethod); }); function doFilter(query) { var _a; if (!filterable.value) return; const expandKeySet = /* @__PURE__ */ new Set(); const hiddenExpandIconKeys = hiddenExpandIconKeySet.value; const hiddenKeys = hiddenNodeKeySet.value; const family = []; const nodes = ((_a = tree.value) == null ? void 0 : _a.treeNodes) || []; const filter = props2.filterMethod; hiddenKeys.clear(); function traverse(nodes2) { nodes2.forEach((node) => { family.push(node); if (filter == null ? void 0 : filter(query, node.data, node)) family.forEach((member) => { expandKeySet.add(member.key); member.expanded = true; }); else { node.expanded = false; if (node.isLeaf) hiddenKeys.add(node.key); } const children = node.children; if (children) traverse(children); if (!node.isLeaf) { if (!expandKeySet.has(node.key)) hiddenKeys.add(node.key); else if (children) { let allHidden = true; for (const childNode of children) if (!hiddenKeys.has(childNode.key)) { allHidden = false; break; } if (allHidden) hiddenExpandIconKeys.add(node.key); else hiddenExpandIconKeys.delete(node.key); } } family.pop(); }); } traverse(nodes); return expandKeySet; } function isForceHiddenExpandIcon(node) { return hiddenExpandIconKeySet.value.has(node.key); } return { hiddenExpandIconKeySet, hiddenNodeKeySet, doFilter, isForceHiddenExpandIcon }; } function useTree(props2, emit) { const expandedKeySet = ref(/* @__PURE__ */ new Set()); const currentKey = ref(); const tree = shallowRef(); const listRef = ref(); const { isIndeterminate, isChecked, toggleCheckbox, getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes, setChecked, setCheckedKeys } = useCheck(props2, tree); const { doFilter, hiddenNodeKeySet, isForceHiddenExpandIcon } = useFilter(props2, tree); const valueKey = computed(() => { var _a; return ((_a = props2.props) == null ? void 0 : _a.value) || TreeOptionsEnum.KEY; }); const childrenKey = computed(() => { var _a; return ((_a = props2.props) == null ? void 0 : _a.children) || TreeOptionsEnum.CHILDREN; }); const disabledKey = computed(() => { var _a; return ((_a = props2.props) == null ? void 0 : _a.disabled) || TreeOptionsEnum.DISABLED; }); const labelKey = computed(() => { var _a; return ((_a = props2.props) == null ? void 0 : _a.label) || TreeOptionsEnum.LABEL; }); const flattenTree = computed(() => { var _a; const expandedKeys = expandedKeySet.value; const hiddenKeys = hiddenNodeKeySet.value; const flattenNodes = []; const nodes = ((_a = tree.value) == null ? void 0 : _a.treeNodes) || []; const stack = []; for (let i = nodes.length - 1; i >= 0; --i) stack.push(nodes[i]); while (stack.length) { const node = stack.pop(); if (hiddenKeys.has(node.key)) continue; flattenNodes.push(node); if (node.children && expandedKeys.has(node.key)) for (let i = node.children.length - 1; i >= 0; --i) stack.push(node.children[i]); } return flattenNodes; }); const isNotEmpty = computed(() => { return flattenTree.value.length > 0; }); function createTree(data) { const treeNodeMap = /* @__PURE__ */ new Map(); const levelTreeNodeMap = /* @__PURE__ */ new Map(); let maxLevel = 1; function traverse(nodes, level = 1, parent = void 0) { var _a; const siblings = []; for (const rawNode of nodes) { const value = getKey(rawNode); const node = { level, key: value, data: rawNode }; node.label = getLabel(rawNode); node.parent = parent; const children = getChildren(rawNode); node.disabled = getDisabled(rawNode); node.isLeaf = !children || children.length === 0; node.expanded = expandedKeySet.value.has(value); if (children && children.length) node.children = traverse(children, level + 1, node); siblings.push(node); treeNodeMap.set(value, node); if (!levelTreeNodeMap.has(level)) levelTreeNodeMap.set(level, []); (_a = levelTreeNodeMap.get(level)) == null ? void 0 : _a.push(node); } if (level > maxLevel) maxLevel = level; return siblings; } const treeNodes = traverse(data); return { treeNodeMap, levelTreeNodeMap, maxLevel, treeNodes }; } function filter(query) { const keys = doFilter(query); if (keys) expandedKeySet.value = keys; } function getChildren(node) { return node[childrenKey.value]; } function getKey(node) { if (!node) return ""; return node[valueKey.value]; } function getDisabled(node) { return node[disabledKey.value]; } function getLabel(node) { return node[labelKey.value]; } function toggleExpand(node) { if (expandedKeySet.value.has(node.key)) collapseNode(node); else expandNode(node); } function setExpandedKeys(keys) { const expandedKeys = /* @__PURE__ */ new Set(); const nodeMap = tree.value.treeNodeMap; expandedKeySet.value.forEach((key) => { const node = nodeMap.get(key); if (node) node.expanded = false; }); keys.forEach((k) => { let node = nodeMap.get(k); while (node && !expandedKeys.has(node.key)) { expandedKeys.add(node.key); node.expanded = true; node = node.parent; } }); expandedKeySet.value = expandedKeys; } function handleNodeClick(node, e) { emit(NODE_CLICK, node.data, node, e); handleCurrentChange2(node); if (props2.expandOnClickNode) toggleExpand(node); if (props2.showCheckbox && (props2.checkOnClickNode || node.isLeaf && props2.checkOnClickLeaf) && !node.disabled) toggleCheckbox(node, !isChecked(node), true); } function handleNodeDrop(node, e) { emit(NODE_DROP, node.data, node, e); } function handleCurrentChange2(node) { if (!isCurrent(node)) { currentKey.value = node.key; emit(CURRENT_CHANGE, node.data, node); } } function handleNodeCheck(node, checked) { toggleCheckbox(node, checked); } function expandNode(node) { const keySet = expandedKeySet.value; if (tree.value && props2.accordion) { const { treeNodeMap } = tree.value; keySet.forEach((key) => { const treeNode = treeNodeMap.get(key); if (node && node.level === (treeNode == null ? void 0 : treeNode.level)) { keySet.delete(key); treeNode.expanded = false; } }); } keySet.add(node.key); const _node = getNode(node.key); if (_node) { _node.expanded = true; emit(NODE_EXPAND, _node.data, _node); } } function collapseNode(node) { expandedKeySet.value.delete(node.key); const _node = getNode(node.key); if (_node) { _node.expanded = false; emit(NODE_COLLAPSE, _node.data, _node); } } function isDisabled(node) { return !!node.disabled; } function isCurrent(node) { const current = currentKey.value; return current !== void 0 && current === node.key; } function getCurrentNode() { var _a, _b; if (!currentKey.value) return void 0; return (_b = (_a = tree.value) == null ? void 0 : _a.treeNodeMap.get(currentKey.value)) == null ? void 0 : _b.data; } function getCurrentKey() { return currentKey.value; } function setCurrentKey(key) { currentKey.value = key; } function setData(data) { tree.value = createTree(data); } function getNode(data) { var _a; const key = isObject(data) ? getKey(data) : data; return (_a = tree.value) == null ? void 0 : _a.treeNodeMap.get(key); } function scrollToNode(key, strategy = "auto") { const node = getNode(key); if (node && listRef.value) listRef.value.scrollToItem(flattenTree.value.indexOf(node), strategy); } function scrollTo(offset2) { var _a; (_a = listRef.value) == null ? void 0 : _a.scrollTo(offset2); } watch(() => props2.currentNodeKey, (key) => { currentKey.value = key; }, { immediate: true }); watch(() => props2.defaultExpandedKeys, (keys) => { setExpandedKeys(keys || []); }); watch(() => props2.data, (data) => { setData(data); setExpandedKeys(props2.defaultExpandedKeys || []); }, { immediate: true }); return { tree, flattenTree, isNotEmpty, listRef, getKey, getChildren, toggleExpand, toggleCheckbox, isChecked, isIndeterminate, isDisabled, isCurrent, isForceHiddenExpandIcon, handleNodeClick, handleNodeDrop, handleNodeCheck, getCurrentNode, getCurrentKey, setCurrentKey, getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes, setChecked, setCheckedKeys, filter, setData, getNode, expandNode, collapseNode, setExpandedKeys, scrollToNode, scrollTo }; } var tree_node_content_default = defineComponent({ name: "ElTreeNodeContent", props: treeNodeContentProps, setup(props2) { const tree = inject(ROOT_TREE_INJECTION_KEY); const ns = useNamespace("tree"); return () => { const node = props2.node; const { data } = node; return (tree == null ? void 0 : tree.ctx.slots.default) ? tree.ctx.slots.default({ node, data }) : h(ElText, { tag: "span", truncated: true, class: ns.be("node", "label") }, () => [node == null ? void 0 : node.label]); }; } }); const _hoisted_1$b = [ "aria-expanded", "aria-disabled", "aria-checked", "data-key" ]; var tree_node_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTreeNode", __name: "tree-node", props: treeNodeProps, emits: treeNodeEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const tree = inject(ROOT_TREE_INJECTION_KEY); const ns = useNamespace("tree"); const indent = computed(() => (tree == null ? void 0 : tree.props.indent) ?? 16); const icon = computed(() => (tree == null ? void 0 : tree.props.icon) ?? caret_right_default); const getNodeClass = (node) => { var _a; const nodeClassFunc = (_a = tree == null ? void 0 : tree.props.props) == null ? void 0 : _a.class; if (!nodeClassFunc) return {}; let className; if (isFunction(nodeClassFunc)) { const { data } = node; className = nodeClassFunc(data, node); } else className = nodeClassFunc; return isString(className) ? { [className]: true } : className; }; const handleClick = (e) => { emit("click", props2.node, e); }; const handleDrop = (e) => { emit("drop", props2.node, e); }; const handleExpandIconClick = () => { emit("toggle", props2.node); }; const handleCheckChange = (value) => { emit("check", props2.node, value); }; const handleContextMenu = (event) => { var _a, _b, _c, _d; if ((_c = (_b = (_a = tree == null ? void 0 : tree.instance) == null ? void 0 : _a.vnode) == null ? void 0 : _b.props) == null ? void 0 : _c["onNodeContextmenu"]) { event.stopPropagation(); event.preventDefault(); } tree == null ? void 0 : tree.ctx.emit(NODE_CONTEXTMENU, event, (_d = props2.node) == null ? void 0 : _d.data, props2.node); }; return (_ctx, _cache) => { var _a, _b, _c; return openBlock(), createElementBlock("div", { ref: "node$", class: normalizeClass([ unref(ns).b("node"), unref(ns).is("expanded", __props.expanded), unref(ns).is("current", __props.current), unref(ns).is("focusable", !__props.disabled), unref(ns).is("checked", !__props.disabled && __props.checked), getNodeClass(__props.node) ]), role: "treeitem", tabindex: "-1", "aria-expanded": __props.expanded, "aria-disabled": __props.disabled, "aria-checked": __props.checked, "data-key": (_a = __props.node) == null ? void 0 : _a.key, onClick: withModifiers(handleClick, ["stop"]), onContextmenu: handleContextMenu, onDragover: _cache[1] || (_cache[1] = withModifiers(() => { }, ["prevent"])), onDragenter: _cache[2] || (_cache[2] = withModifiers(() => { }, ["prevent"])), onDrop: withModifiers(handleDrop, ["stop"]) }, [createBaseVNode("div", { class: normalizeClass(unref(ns).be("node", "content")), style: normalizeStyle({ paddingLeft: `${(__props.node.level - 1) * indent.value}px`, height: __props.itemSize + "px" }) }, [ icon.value ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass([ unref(ns).is("leaf", !!((_b = __props.node) == null ? void 0 : _b.isLeaf)), unref(ns).is("hidden", __props.hiddenExpandIcon), { expanded: !((_c = __props.node) == null ? void 0 : _c.isLeaf) && __props.expanded }, unref(ns).be("node", "expand-icon") ]), onClick: withModifiers(handleExpandIconClick, ["stop"]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(icon.value)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), __props.showCheckbox ? (openBlock(), createBlock(unref(ElCheckbox), { key: 1, "model-value": __props.checked, indeterminate: __props.indeterminate, disabled: __props.disabled, onChange: handleCheckChange, onClick: _cache[0] || (_cache[0] = withModifiers(() => { }, ["stop"])) }, null, 8, [ "model-value", "indeterminate", "disabled" ])) : createCommentVNode("v-if", true), createVNode(unref(tree_node_content_default), { node: { ...__props.node, expanded: __props.expanded } }, null, 8, ["node"]) ], 6)], 42, _hoisted_1$b); }; } }); var tree_node_default = tree_node_vue_vue_type_script_setup_true_lang_default; var tree_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTreeV2", __name: "tree", props: treeProps, emits: treeEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const slots = useSlots(); const treeNodeSize = computed(() => props2.itemSize); provide(ROOT_TREE_INJECTION_KEY, { ctx: { emit, slots }, props: props2, instance: getCurrentInstance() }); provide(formItemContextKey, void 0); const { t } = useLocale(); const ns = useNamespace("tree"); const { flattenTree, isNotEmpty, listRef, toggleExpand, isIndeterminate, isChecked, isDisabled, isCurrent, isForceHiddenExpandIcon, handleNodeClick, handleNodeDrop, handleNodeCheck, toggleCheckbox, getCurrentNode, getCurrentKey, setCurrentKey, getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes, setChecked, setCheckedKeys, filter, setData, getNode, expandNode, collapseNode, setExpandedKeys, scrollToNode, scrollTo } = useTree(props2, emit); __expose({ toggleCheckbox, getCurrentNode, getCurrentKey, setCurrentKey, getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes, setChecked, setCheckedKeys, filter, setData, getNode, expandNode, collapseNode, setExpandedKeys, scrollToNode, scrollTo }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b(), { [unref(ns).m("highlight-current")]: __props.highlightCurrent }]), role: "tree" }, [unref(isNotEmpty) ? (openBlock(), createBlock(unref(FixedSizeList), { key: 0, ref_key: "listRef", ref: listRef, "class-name": unref(ns).b("virtual-list"), data: unref(flattenTree), total: unref(flattenTree).length, height: __props.height, "item-size": treeNodeSize.value, "perf-mode": __props.perfMode, "scrollbar-always-on": __props.scrollbarAlwaysOn }, { default: withCtx(({ data, index, style }) => [(openBlock(), createBlock(tree_node_default, { key: data[index].key, style: normalizeStyle(style), node: data[index], expanded: data[index].expanded, "show-checkbox": __props.showCheckbox, checked: unref(isChecked)(data[index]), indeterminate: unref(isIndeterminate)(data[index]), "item-size": treeNodeSize.value, disabled: unref(isDisabled)(data[index]), current: unref(isCurrent)(data[index]), "hidden-expand-icon": unref(isForceHiddenExpandIcon)(data[index]), onClick: unref(handleNodeClick), onToggle: unref(toggleExpand), onCheck: unref(handleNodeCheck), onDrop: unref(handleNodeDrop) }, null, 8, [ "style", "node", "expanded", "show-checkbox", "checked", "indeterminate", "item-size", "disabled", "current", "hidden-expand-icon", "onClick", "onToggle", "onCheck", "onDrop" ]))]), _: 1 }, 8, [ "class-name", "data", "total", "height", "item-size", "perf-mode", "scrollbar-always-on" ])) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).e("empty-block")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createBaseVNode("span", { class: normalizeClass(unref(ns).e("empty-text")) }, toDisplayString(__props.emptyText ?? unref(t)("el.tree.emptyText")), 3)])], 2))], 2); }; } }); var tree_default = tree_vue_vue_type_script_setup_true_lang_default; const ElTreeV2 = withInstall(tree_default); const SCOPE$2 = "ElUpload"; var UploadAjaxError = class extends Error { constructor(message2, status, method, url) { super(message2); this.name = "UploadAjaxError"; this.status = status; this.method = method; this.url = url; } }; function getError(action, option, xhr) { let msg; if (xhr.response) msg = `${xhr.response.error || xhr.response}`; else if (xhr.responseText) msg = `${xhr.responseText}`; else msg = `fail to ${option.method} ${action} ${xhr.status}`; return new UploadAjaxError(msg, xhr.status, option.method, action); } function getBody(xhr) { const text = xhr.responseText || xhr.response; if (!text) return text; try { return JSON.parse(text); } catch { return text; } } const ajaxUpload = (option) => { if (typeof XMLHttpRequest === "undefined") throwError(SCOPE$2, "XMLHttpRequest is undefined"); const xhr = new XMLHttpRequest(); const action = option.action; if (xhr.upload) xhr.upload.addEventListener("progress", (evt) => { const progressEvt = evt; progressEvt.percent = evt.total > 0 ? evt.loaded / evt.total * 100 : 0; option.onProgress(progressEvt); }); const formData = new FormData(); if (option.data) for (const [key, value] of Object.entries(option.data)) if (isArray(value)) if (value.length === 2 && value[0] instanceof Blob && isString(value[1])) formData.append(key, value[0], value[1]); else value.forEach((item) => { formData.append(key, item); }); else formData.append(key, value); formData.append(option.filename, option.file, option.file.name); xhr.addEventListener("error", () => { option.onError(getError(action, option, xhr)); }); xhr.addEventListener("load", () => { if (xhr.status < 200 || xhr.status >= 300) return option.onError(getError(action, option, xhr)); option.onSuccess(getBody(xhr)); }); xhr.open(option.method, action, true); if (option.withCredentials && "withCredentials" in xhr) xhr.withCredentials = true; const headers = option.headers || {}; if (headers instanceof Headers) headers.forEach((value, key) => xhr.setRequestHeader(key, value)); else for (const [key, value] of Object.entries(headers)) { if (isNil(value)) continue; xhr.setRequestHeader(key, String(value)); } xhr.send(formData); return xhr; }; const uploadListTypes = [ "text", "picture", "picture-card" ]; let fileId = 1; const genFileId = () => Date.now() + fileId++; const uploadBaseProps = buildProps({ action: { type: String, default: "#" }, headers: { type: definePropType(Object) }, method: { type: String, default: "post" }, data: { type: definePropType([ Object, Function, Promise ]), default: () => mutable({}) }, multiple: Boolean, name: { type: String, default: "file" }, drag: Boolean, withCredentials: Boolean, showFileList: { type: Boolean, default: true }, accept: { type: String, default: "" }, fileList: { type: definePropType(Array), default: () => mutable([]) }, autoUpload: { type: Boolean, default: true }, listType: { type: String, values: uploadListTypes, default: "text" }, httpRequest: { type: definePropType(Function), default: ajaxUpload }, disabled: { type: Boolean, default: void 0 }, limit: Number, directory: Boolean }); const uploadProps = buildProps({ ...uploadBaseProps, beforeUpload: { type: definePropType(Function), default: NOOP }, beforeRemove: { type: definePropType(Function) }, onRemove: { type: definePropType(Function), default: NOOP }, onChange: { type: definePropType(Function), default: NOOP }, onPreview: { type: definePropType(Function), default: NOOP }, onSuccess: { type: definePropType(Function), default: NOOP }, onProgress: { type: definePropType(Function), default: NOOP }, onError: { type: definePropType(Function), default: NOOP }, onExceed: { type: definePropType(Function), default: NOOP }, crossorigin: { type: definePropType(String) } }); const uploadContextKey = Symbol("uploadContextKey"); const uploadListProps = buildProps({ files: { type: definePropType(Array), default: () => mutable([]) }, disabled: { type: Boolean, default: void 0 }, handlePreview: { type: definePropType(Function), default: NOOP }, listType: { type: String, values: uploadListTypes, default: "text" }, crossorigin: { type: definePropType(String) } }); const uploadListEmits = { remove: (file) => !!file }; const uploadContentProps = buildProps({ ...uploadBaseProps, beforeUpload: { type: definePropType(Function), default: NOOP }, onRemove: { type: definePropType(Function), default: NOOP }, onStart: { type: definePropType(Function), default: NOOP }, onSuccess: { type: definePropType(Function), default: NOOP }, onProgress: { type: definePropType(Function), default: NOOP }, onError: { type: definePropType(Function), default: NOOP }, onExceed: { type: definePropType(Function), default: NOOP } }); const uploadDraggerProps = buildProps({ disabled: { type: Boolean, default: void 0 }, directory: Boolean }); const uploadDraggerEmits = { file: (file) => isArray(file) }; const _hoisted_1$a = [ "tabindex", "aria-disabled", "onKeydown" ]; const _hoisted_2$6 = ["src", "crossorigin"]; const _hoisted_3$2 = ["onClick"]; const _hoisted_4$1 = ["title"]; const _hoisted_5 = ["onClick"]; const _hoisted_6 = ["onClick"]; var upload_list_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElUploadList", __name: "upload-list", props: uploadListProps, emits: uploadListEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const { t } = useLocale(); const nsUpload = useNamespace("upload"); const nsIcon = useNamespace("icon"); const nsList = useNamespace("list"); const disabled = useFormDisabled(); const focusing = ref(false); const containerKls = computed(() => [ nsUpload.b("list"), nsUpload.bm("list", props2.listType), nsUpload.is("disabled", disabled.value) ]); const handleRemove = (file) => { emit("remove", file); }; return (_ctx, _cache) => { return openBlock(), createBlock(TransitionGroup, { tag: "ul", class: normalizeClass(containerKls.value), name: unref(nsList).b() }, { default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.files, (file, index) => { return openBlock(), createElementBlock("li", { key: file.uid || file.name, class: normalizeClass([ unref(nsUpload).be("list", "item"), unref(nsUpload).is(file.status), { focusing: focusing.value } ]), tabindex: unref(disabled) ? void 0 : 0, "aria-disabled": unref(disabled), role: "button", onKeydown: withKeys(($event) => !unref(disabled) && handleRemove(file), ["delete"]), onFocus: _cache[0] || (_cache[0] = ($event) => focusing.value = true), onBlur: _cache[1] || (_cache[1] = ($event) => focusing.value = false), onClick: _cache[2] || (_cache[2] = ($event) => focusing.value = false) }, [renderSlot(_ctx.$slots, "default", { file, index }, () => [ __props.listType === "picture" || file.status !== "uploading" && __props.listType === "picture-card" ? (openBlock(), createElementBlock("img", { key: 0, class: normalizeClass(unref(nsUpload).be("list", "item-thumbnail")), src: file.url, crossorigin: __props.crossorigin, alt: "" }, null, 10, _hoisted_2$6)) : createCommentVNode("v-if", true), file.status === "uploading" || __props.listType !== "picture-card" ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(nsUpload).be("list", "item-info")) }, [createBaseVNode("a", { class: normalizeClass(unref(nsUpload).be("list", "item-name")), onClick: withModifiers(($event) => __props.handlePreview(file), ["prevent"]) }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(nsIcon).m("document")) }, { default: withCtx(() => [createVNode(unref(document_default))]), _: 1 }, 8, ["class"]), createBaseVNode("span", { class: normalizeClass(unref(nsUpload).be("list", "item-file-name")), title: file.name }, toDisplayString(file.name), 11, _hoisted_4$1)], 10, _hoisted_3$2), file.status === "uploading" ? (openBlock(), createBlock(unref(ElProgress), { key: 0, type: __props.listType === "picture-card" ? "circle" : "line", "stroke-width": __props.listType === "picture-card" ? 6 : 2, percentage: Number(file.percentage), style: normalizeStyle(__props.listType === "picture-card" ? "" : "margin-top: 0.5rem") }, null, 8, [ "type", "stroke-width", "percentage", "style" ])) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true), createBaseVNode("label", { class: normalizeClass(unref(nsUpload).be("list", "item-status-label")) }, [__props.listType === "text" ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass([unref(nsIcon).m("upload-success"), unref(nsIcon).m("circle-check")]) }, { default: withCtx(() => [createVNode(unref(circle_check_default))]), _: 1 }, 8, ["class"])) : ["picture-card", "picture"].includes(__props.listType) ? (openBlock(), createBlock(unref(ElIcon), { key: 1, class: normalizeClass([unref(nsIcon).m("upload-success"), unref(nsIcon).m("check")]) }, { default: withCtx(() => [createVNode(unref(check_default))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true)], 2), !unref(disabled) ? (openBlock(), createBlock(unref(ElIcon), { key: 2, class: normalizeClass(unref(nsIcon).m("close")), "aria-label": unref(t)("el.upload.delete"), role: "button", tabindex: "0", onClick: ($event) => handleRemove(file), onKeydown: withKeys(withModifiers(($event) => handleRemove(file), ["prevent"]), ["enter", "space"]) }, { default: withCtx(() => [createVNode(unref(close_default))]), _: 1 }, 8, [ "class", "aria-label", "onClick", "onKeydown" ])) : createCommentVNode("v-if", true), !unref(disabled) ? (openBlock(), createElementBlock("i", { key: 3, class: normalizeClass(unref(nsIcon).m("close-tip")) }, toDisplayString(unref(t)("el.upload.deleteTip")), 3)) : createCommentVNode("v-if", true), __props.listType === "picture-card" ? (openBlock(), createElementBlock("span", { key: 4, class: normalizeClass(unref(nsUpload).be("list", "item-actions")) }, [createBaseVNode("span", { class: normalizeClass(unref(nsUpload).be("list", "item-preview")), onClick: ($event) => __props.handlePreview(file) }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(nsIcon).m("zoom-in")) }, { default: withCtx(() => [createVNode(unref(zoom_in_default))]), _: 1 }, 8, ["class"])], 10, _hoisted_5), !unref(disabled) ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(nsUpload).be("list", "item-delete")), onClick: ($event) => handleRemove(file) }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(nsIcon).m("delete")) }, { default: withCtx(() => [createVNode(unref(delete_default))]), _: 1 }, 8, ["class"])], 10, _hoisted_6)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true) ])], 42, _hoisted_1$a); }), 128)), renderSlot(_ctx.$slots, "append")]), _: 3 }, 8, ["class", "name"]); }; } }); var upload_list_default = upload_list_vue_vue_type_script_setup_true_lang_default; const COMPONENT_NAME$1 = "ElUploadDrag"; var upload_dragger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME$1, __name: "upload-dragger", props: uploadDraggerProps, emits: uploadDraggerEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; if (!inject(uploadContextKey)) throwError(COMPONENT_NAME$1, "usage: "); const ns = useNamespace("upload"); const dragover = ref(false); const disabled = useFormDisabled(); const getFile = (entry) => { return new Promise((resolve, reject) => entry.file(resolve, reject)); }; const getAllFiles = async (entry) => { try { if (entry.isFile) { const file = await getFile(entry); file.isDirectory = false; return [file]; } if (entry.isDirectory) { const dirReader = entry.createReader(); const getEntries = () => { return new Promise((resolve, reject) => dirReader.readEntries(resolve, reject)); }; const entries = []; let readEntries = await getEntries(); while (readEntries.length > 0) { entries.push(...readEntries); readEntries = await getEntries(); } const filePromises = entries.map((entry2) => getAllFiles(entry2).catch(() => [])); return flatten(await Promise.all(filePromises)); } } catch { return []; } return []; }; const onDrop = async (e) => { if (disabled.value) return; dragover.value = false; e.stopPropagation(); const files = Array.from(e.dataTransfer.files); const items = e.dataTransfer.items || []; if (props2.directory) { const entries = Array.from(items).map((item) => { var _a; return (_a = item == null ? void 0 : item.webkitGetAsEntry) == null ? void 0 : _a.call(item); }).filter((entry) => entry); emit("file", flatten(await Promise.all(entries.map(getAllFiles)))); return; } files.forEach((file, index) => { var _a, _b; const entry = (_b = (_a = items[index]) == null ? void 0 : _a.webkitGetAsEntry) == null ? void 0 : _b.call(_a); if (entry) file.isDirectory = entry.isDirectory; }); emit("file", files); }; const onDragover = () => { if (!disabled.value) dragover.value = true; }; const onDragleave = (e) => { if (!e.currentTarget.contains(e.relatedTarget)) dragover.value = false; }; return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b("dragger"), unref(ns).is("dragover", dragover.value)]), onDrop: withModifiers(onDrop, ["prevent"]), onDragover: withModifiers(onDragover, ["prevent"]), onDragleave: withModifiers(onDragleave, ["prevent"]) }, [renderSlot(_ctx.$slots, "default")], 34); }; } }); var upload_dragger_default = upload_dragger_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$9 = [ "tabindex", "aria-disabled", "onKeydown" ]; const _hoisted_2$5 = [ "name", "disabled", "multiple", "accept", "webkitdirectory" ]; var upload_content_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElUploadContent", inheritAttrs: false, __name: "upload-content", props: uploadContentProps, setup(__props, { expose: __expose }) { const props2 = __props; const ns = useNamespace("upload"); const disabled = useFormDisabled(); const requests = shallowRef({}); const inputRef = shallowRef(); const uploadFiles = (files) => { if (files.length === 0) return; const { autoUpload, limit, fileList, multiple, onStart, onExceed } = props2; if (limit && fileList.length + files.length > limit) { onExceed(files, fileList); return; } if (!multiple) files = files.slice(0, 1); for (const file of files) { const rawFile = file; rawFile.uid = genFileId(); onStart(rawFile); if (autoUpload) upload(rawFile); } }; const upload = async (rawFile) => { inputRef.value.value = ""; if (!props2.beforeUpload) return doUpload(rawFile); let hookResult; let beforeData = {}; try { const originData = props2.data; const beforeUploadPromise = props2.beforeUpload(rawFile); beforeData = isPlainObject$1(props2.data) ? cloneDeep(props2.data) : props2.data; hookResult = await beforeUploadPromise; if (isPlainObject$1(props2.data) && isEqual(originData, beforeData)) beforeData = cloneDeep(props2.data); } catch { hookResult = false; } if (hookResult === false) { props2.onRemove(rawFile); return; } let file = rawFile; if (hookResult instanceof Blob) if (hookResult instanceof File) file = hookResult; else file = new File([hookResult], rawFile.name, { type: rawFile.type }); doUpload(Object.assign(file, { uid: rawFile.uid }), beforeData); }; const resolveData = async (data, rawFile) => { if (isFunction(data)) return data(rawFile); return data; }; const doUpload = async (rawFile, beforeData) => { const { headers, data, method, withCredentials, name: filename, action, onProgress, onSuccess, onError, httpRequest } = props2; try { beforeData = await resolveData(beforeData ?? data, rawFile); } catch { props2.onRemove(rawFile); return; } const { uid: uid2 } = rawFile; const options = { headers: headers || {}, withCredentials, file: rawFile, data: beforeData, method, filename, action, onProgress: (evt) => { onProgress(evt, rawFile); }, onSuccess: (res) => { onSuccess(res, rawFile); delete requests.value[uid2]; }, onError: (err) => { onError(err, rawFile); delete requests.value[uid2]; } }; const request = httpRequest(options); requests.value[uid2] = request; if (request instanceof Promise) request.then(options.onSuccess, options.onError); }; const handleChange = (e) => { const files = e.target.files; if (!files) return; uploadFiles(Array.from(files)); }; const handleClick = () => { if (!disabled.value) { inputRef.value.value = ""; inputRef.value.click(); } }; const handleKeydown = () => { handleClick(); }; const abort = (file) => { entriesOf(requests.value).filter(file ? ([uid2]) => String(file.uid) === uid2 : () => true).forEach(([uid2, req]) => { if (req instanceof XMLHttpRequest) req.abort(); delete requests.value[uid2]; }); }; __expose({ abort, upload }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([ unref(ns).b(), unref(ns).m(__props.listType), unref(ns).is("drag", __props.drag), unref(ns).is("disabled", unref(disabled)) ]), tabindex: unref(disabled) ? void 0 : 0, "aria-disabled": unref(disabled), role: "button", onClick: handleClick, onKeydown: withKeys(withModifiers(handleKeydown, ["self"]), ["enter", "space"]) }, [__props.drag ? (openBlock(), createBlock(upload_dragger_default, { key: 0, disabled: unref(disabled), directory: __props.directory, onFile: uploadFiles }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, ["disabled", "directory"])) : renderSlot(_ctx.$slots, "default", { key: 1 }), createBaseVNode("input", { ref_key: "inputRef", ref: inputRef, class: normalizeClass(unref(ns).e("input")), name: __props.name, disabled: unref(disabled), multiple: __props.multiple, accept: __props.accept, webkitdirectory: __props.directory || void 0, type: "file", onChange: handleChange, onClick: _cache[0] || (_cache[0] = withModifiers(() => { }, ["stop"])) }, null, 42, _hoisted_2$5)], 42, _hoisted_1$9); }; } }); var upload_content_default = upload_content_vue_vue_type_script_setup_true_lang_default; const SCOPE$1 = "ElUpload"; const revokeFileObjectURL = (file) => { var _a; if ((_a = file.url) == null ? void 0 : _a.startsWith("blob:")) URL.revokeObjectURL(file.url); }; const useHandlers = (props2, uploadRef) => { const uploadFiles = useVModel(props2, "fileList", void 0, { passive: true }); const getFile = (rawFile) => uploadFiles.value.find((file) => file.uid === rawFile.uid); function abort(file) { var _a; (_a = uploadRef.value) == null ? void 0 : _a.abort(file); } function clearFiles(states = [ "ready", "uploading", "success", "fail" ]) { uploadFiles.value = uploadFiles.value.filter((row) => !states.includes(row.status)); } function removeFile(file) { uploadFiles.value = uploadFiles.value.filter((uploadFile) => uploadFile.uid !== file.uid); } const emitChange = (file) => { nextTick(() => props2.onChange(file, uploadFiles.value)); }; const handleError = (err, rawFile) => { const file = getFile(rawFile); if (!file) return; console.error(err); file.status = "fail"; removeFile(file); props2.onError(err, file, uploadFiles.value); emitChange(file); }; const handleProgress = (evt, rawFile) => { const file = getFile(rawFile); if (!file) return; props2.onProgress(evt, file, uploadFiles.value); file.status = "uploading"; file.percentage = Math.round(evt.percent); }; const handleSuccess = (response, rawFile) => { const file = getFile(rawFile); if (!file) return; file.status = "success"; file.response = response; props2.onSuccess(response, file, uploadFiles.value); emitChange(file); }; const handleStart = (file) => { if (isNil(file.uid)) file.uid = genFileId(); const uploadFile = { name: file.name, percentage: 0, status: "ready", size: file.size, raw: file, uid: file.uid }; if (props2.listType === "picture-card" || props2.listType === "picture") try { uploadFile.url = URL.createObjectURL(file); } catch (err) { debugWarn(SCOPE$1, err.message); props2.onError(err, uploadFile, uploadFiles.value); } uploadFiles.value = [...uploadFiles.value, uploadFile]; emitChange(uploadFile); }; const handleRemove = async (file) => { const uploadFile = file instanceof File ? getFile(file) : file; if (!uploadFile) throwError(SCOPE$1, "file to be removed not found"); const doRemove = (file2) => { abort(file2); removeFile(file2); props2.onRemove(file2, uploadFiles.value); revokeFileObjectURL(file2); }; if (props2.beforeRemove) { if (await props2.beforeRemove(uploadFile, uploadFiles.value) !== false) doRemove(uploadFile); } else doRemove(uploadFile); }; function submit() { uploadFiles.value.filter(({ status }) => status === "ready").forEach(({ raw }) => { var _a; return raw && ((_a = uploadRef.value) == null ? void 0 : _a.upload(raw)); }); } watch(() => props2.listType, (val) => { if (val !== "picture-card" && val !== "picture") return; uploadFiles.value = uploadFiles.value.map((file) => { const { raw, url } = file; if (!url && raw) try { file.url = URL.createObjectURL(raw); } catch (err) { props2.onError(err, file, uploadFiles.value); } return file; }); }); watch(uploadFiles, (files) => { for (const file of files) { file.uid || (file.uid = genFileId()); file.status || (file.status = "success"); } }, { immediate: true, deep: true }); return { uploadFiles, abort, clearFiles, handleError, handleProgress, handleStart, handleSuccess, handleRemove, submit, revokeFileObjectURL }; }; var upload_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElUpload", __name: "upload", props: uploadProps, setup(__props, { expose: __expose }) { const props2 = __props; const disabled = useFormDisabled(); const uploadRef = shallowRef(); const { abort, submit, clearFiles, uploadFiles, handleStart, handleError, handleRemove, handleSuccess, handleProgress, revokeFileObjectURL: revokeFileObjectURL2 } = useHandlers(props2, uploadRef); const isPictureCard = computed(() => props2.listType === "picture-card"); const uploadContentProps2 = computed(() => ({ ...props2, fileList: uploadFiles.value, onStart: handleStart, onProgress: handleProgress, onSuccess: handleSuccess, onError: handleError, onRemove: handleRemove })); onBeforeUnmount(() => { uploadFiles.value.forEach(revokeFileObjectURL2); }); provide(uploadContextKey, { accept: toRef(props2, "accept") }); __expose({ abort, submit, clearFiles, handleStart, handleRemove }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", null, [ isPictureCard.value && __props.showFileList ? (openBlock(), createBlock(upload_list_default, { key: 0, disabled: unref(disabled), "list-type": __props.listType, files: unref(uploadFiles), crossorigin: __props.crossorigin, "handle-preview": __props.onPreview, onRemove: unref(handleRemove) }, createSlots({ append: withCtx(() => [createVNode(upload_content_default, mergeProps({ ref_key: "uploadRef", ref: uploadRef }, uploadContentProps2.value), { default: withCtx(() => [_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true), !_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)]), _: 3 }, 16)]), _: 2 }, [_ctx.$slots.file ? { name: "default", fn: withCtx(({ file, index }) => [renderSlot(_ctx.$slots, "file", { file, index })]), key: "0" } : void 0]), 1032, [ "disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove" ])) : createCommentVNode("v-if", true), !isPictureCard.value || isPictureCard.value && !__props.showFileList ? (openBlock(), createBlock(upload_content_default, mergeProps({ key: 1, ref_key: "uploadRef", ref: uploadRef }, uploadContentProps2.value), { default: withCtx(() => [_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true), !_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)]), _: 3 }, 16)) : createCommentVNode("v-if", true), _ctx.$slots.trigger ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "tip"), !isPictureCard.value && __props.showFileList ? (openBlock(), createBlock(upload_list_default, { key: 3, disabled: unref(disabled), "list-type": __props.listType, files: unref(uploadFiles), crossorigin: __props.crossorigin, "handle-preview": __props.onPreview, onRemove: unref(handleRemove) }, createSlots({ _: 2 }, [_ctx.$slots.file ? { name: "default", fn: withCtx(({ file, index }) => [renderSlot(_ctx.$slots, "file", { file, index })]), key: "0" } : void 0]), 1032, [ "disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove" ])) : createCommentVNode("v-if", true) ]); }; } }); var upload_default = upload_vue_vue_type_script_setup_true_lang_default; const ElUpload = withInstall(upload_default); const watermarkProps = buildProps({ zIndex: { type: Number, default: 9 }, rotate: { type: Number, default: -22 }, width: Number, height: Number, image: String, content: { type: definePropType([String, Array]), default: "Element Plus" }, font: { type: definePropType(Object) }, gap: { type: definePropType(Array), default: () => [100, 100] }, offset: { type: definePropType(Array) } }); function toLowercaseSeparator(key) { return key.replace(/([A-Z])/g, "-$1").toLowerCase(); } function getStyleStr(style) { return Object.keys(style).map((key) => `${toLowercaseSeparator(key)}: ${style[key]};`).join(" "); } function getPixelRatio() { return window.devicePixelRatio || 1; } const reRendering = (mutation, watermarkElement) => { let flag = false; if (mutation.removedNodes.length && watermarkElement) flag = Array.from(mutation.removedNodes).includes(watermarkElement); if (mutation.type === "attributes" && mutation.target === watermarkElement) flag = true; return flag; }; const TEXT_ALIGN_RATIO_MAP = { left: [0, 0.5], start: [0, 0.5], center: [0.5, 0], right: [1, -0.5], end: [1, -0.5] }; function prepareCanvas(width, height, ratio = 1) { const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d"); const realWidth = width * ratio; const realHeight = height * ratio; canvas.setAttribute("width", `${realWidth}px`); canvas.setAttribute("height", `${realHeight}px`); ctx.save(); return [ ctx, canvas, realWidth, realHeight ]; } function useClips() { function getClips(content, rotate, ratio, width, height, font, gapX, gapY, space) { const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(width, height, ratio); let baselineOffset = 0; if (content instanceof HTMLImageElement) ctx.drawImage(content, 0, 0, contentWidth, contentHeight); else { const { color, fontSize, fontStyle, fontWeight, fontFamily, textAlign, textBaseline } = font; const mergedFontSize = Number(fontSize) * ratio; ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${height}px ${fontFamily}`; ctx.fillStyle = color; ctx.textAlign = textAlign; ctx.textBaseline = textBaseline; const contents = isArray(content) ? content : [content]; if (textBaseline !== "top" && contents[0]) { const argumentMetrics = ctx.measureText(contents[0]); ctx.textBaseline = "top"; const topMetrics = ctx.measureText(contents[0]); baselineOffset = argumentMetrics.actualBoundingBoxAscent - topMetrics.actualBoundingBoxAscent; } contents == null ? void 0 : contents.forEach((item, index) => { const [alignRatio, spaceRatio] = TEXT_ALIGN_RATIO_MAP[textAlign]; ctx.fillText(item ?? "", contentWidth * alignRatio + space * spaceRatio, index * (mergedFontSize + font.fontGap * ratio)); }); } const angle = Math.PI / 180 * Number(rotate); const maxSize = Math.max(width, height); const [rCtx, rCanvas, realMaxSize] = prepareCanvas(maxSize, maxSize, ratio); rCtx.translate(realMaxSize / 2, realMaxSize / 2); rCtx.rotate(angle); if (contentWidth > 0 && contentHeight > 0) rCtx.drawImage(canvas, -contentWidth / 2, -contentHeight / 2); function getRotatePos(x, y) { return [x * Math.cos(angle) - y * Math.sin(angle), x * Math.sin(angle) + y * Math.cos(angle)]; } let left = 0; let right = 0; let top = 0; let bottom = 0; const halfWidth = contentWidth / 2; const halfHeight = contentHeight / 2; [ [0 - halfWidth, 0 - halfHeight], [0 + halfWidth, 0 - halfHeight], [0 + halfWidth, 0 + halfHeight], [0 - halfWidth, 0 + halfHeight] ].forEach(([x, y]) => { const [targetX, targetY] = getRotatePos(x, y); left = Math.min(left, targetX); right = Math.max(right, targetX); top = Math.min(top, targetY); bottom = Math.max(bottom, targetY); }); const cutLeft = left + realMaxSize / 2; const cutTop = top + realMaxSize / 2; const cutWidth = right - left; const cutHeight = bottom - top; const realGapX = gapX * ratio; const realGapY = gapY * ratio; const filledWidth = (cutWidth + realGapX) * 2; const filledHeight = cutHeight + realGapY; const [fCtx, fCanvas] = prepareCanvas(filledWidth, filledHeight); function drawImg(targetX = 0, targetY = 0) { fCtx.drawImage(rCanvas, cutLeft, cutTop, cutWidth, cutHeight, targetX, targetY + baselineOffset, cutWidth, cutHeight); } drawImg(); drawImg(cutWidth + realGapX, -cutHeight / 2 - realGapY / 2); drawImg(cutWidth + realGapX, +cutHeight / 2 + realGapY / 2); return [ fCanvas.toDataURL(), filledWidth / ratio, filledHeight / ratio ]; } return getClips; } var watermark_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElWatermark", __name: "watermark", props: watermarkProps, setup(__props) { const style = { position: "relative" }; const props2 = __props; const fontGap = computed(() => { var _a; return ((_a = props2.font) == null ? void 0 : _a.fontGap) ?? 3; }); const color = computed(() => { var _a; return ((_a = props2.font) == null ? void 0 : _a.color) ?? "rgba(0,0,0,.15)"; }); const fontSize = computed(() => { var _a; return ((_a = props2.font) == null ? void 0 : _a.fontSize) ?? 16; }); const fontWeight = computed(() => { var _a; return ((_a = props2.font) == null ? void 0 : _a.fontWeight) ?? "normal"; }); const fontStyle = computed(() => { var _a; return ((_a = props2.font) == null ? void 0 : _a.fontStyle) ?? "normal"; }); const fontFamily = computed(() => { var _a; return ((_a = props2.font) == null ? void 0 : _a.fontFamily) ?? "sans-serif"; }); const textAlign = computed(() => { var _a; return ((_a = props2.font) == null ? void 0 : _a.textAlign) ?? "center"; }); const textBaseline = computed(() => { var _a; return ((_a = props2.font) == null ? void 0 : _a.textBaseline) ?? "hanging"; }); const gapX = computed(() => props2.gap[0]); const gapY = computed(() => props2.gap[1]); const gapXCenter = computed(() => gapX.value / 2); const gapYCenter = computed(() => gapY.value / 2); const offsetLeft = computed(() => { var _a; return ((_a = props2.offset) == null ? void 0 : _a[0]) ?? gapXCenter.value; }); const offsetTop = computed(() => { var _a; return ((_a = props2.offset) == null ? void 0 : _a[1]) ?? gapYCenter.value; }); const getMarkStyle = () => { const markStyle = { zIndex: props2.zIndex, position: "absolute", left: 0, top: 0, width: "100%", height: "100%", pointerEvents: "none", backgroundRepeat: "repeat" }; let positionLeft = offsetLeft.value - gapXCenter.value; let positionTop = offsetTop.value - gapYCenter.value; if (positionLeft > 0) { markStyle.left = `${positionLeft}px`; markStyle.width = `calc(100% - ${positionLeft}px)`; positionLeft = 0; } if (positionTop > 0) { markStyle.top = `${positionTop}px`; markStyle.height = `calc(100% - ${positionTop}px)`; positionTop = 0; } markStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`; return markStyle; }; const containerRef = shallowRef(null); const watermarkRef = shallowRef(); const stopObservation = ref(false); const destroyWatermark = () => { if (watermarkRef.value) { watermarkRef.value.remove(); watermarkRef.value = void 0; } }; const appendWatermark = (base64Url, markWidth) => { var _a; if (containerRef.value && watermarkRef.value) { stopObservation.value = true; watermarkRef.value.setAttribute("style", getStyleStr({ ...getMarkStyle(), backgroundImage: `url('${base64Url}')`, backgroundSize: `${Math.floor(markWidth)}px` })); (_a = containerRef.value) == null ? void 0 : _a.append(watermarkRef.value); setTimeout(() => { stopObservation.value = false; }); } }; const getMarkSize = (ctx) => { let defaultWidth = 120; let defaultHeight = 64; let space = 0; const { image, content, width, height, rotate } = props2; if (!image && ctx.measureText) { ctx.font = `${Number(fontSize.value)}px ${fontFamily.value}`; const contents = isArray(content) ? content : [content]; let maxWidth = 0; let maxHeight = 0; contents.forEach((item) => { const { width: width2, fontBoundingBoxAscent, fontBoundingBoxDescent, actualBoundingBoxAscent, actualBoundingBoxDescent } = ctx.measureText(item); const height2 = isUndefined(fontBoundingBoxAscent) ? actualBoundingBoxAscent + actualBoundingBoxDescent : fontBoundingBoxAscent + fontBoundingBoxDescent; if (width2 > maxWidth) maxWidth = Math.ceil(width2); if (height2 > maxHeight) maxHeight = Math.ceil(height2); }); defaultWidth = maxWidth; defaultHeight = maxHeight * contents.length + (contents.length - 1) * fontGap.value; const angle = Math.PI / 180 * Number(rotate); space = Math.ceil(Math.abs(Math.sin(angle) * defaultHeight) / 2); defaultWidth += space; } return [ width ?? defaultWidth, height ?? defaultHeight, space ]; }; const getClips = useClips(); const renderWatermark = () => { const ctx = document.createElement("canvas").getContext("2d"); const image = props2.image; const content = props2.content; const rotate = props2.rotate; if (ctx) { if (!watermarkRef.value) watermarkRef.value = document.createElement("div"); const ratio = getPixelRatio(); const [markWidth, markHeight, space] = getMarkSize(ctx); const drawCanvas = (drawContent) => { const [textClips, clipWidth] = getClips(drawContent || "", rotate, ratio, markWidth, markHeight, { color: color.value, fontSize: fontSize.value, fontStyle: fontStyle.value, fontWeight: fontWeight.value, fontFamily: fontFamily.value, fontGap: fontGap.value, textAlign: textAlign.value, textBaseline: textBaseline.value }, gapX.value, gapY.value, space); appendWatermark(textClips, clipWidth); }; if (image) { const img = new Image(); img.onload = () => { drawCanvas(img); }; img.onerror = () => { drawCanvas(content); }; img.crossOrigin = "anonymous"; img.referrerPolicy = "no-referrer"; img.src = image; } else drawCanvas(content); } }; onMounted(() => { renderWatermark(); }); watch(() => props2, () => { renderWatermark(); }, { deep: true, flush: "post" }); onBeforeUnmount(() => { destroyWatermark(); }); const onMutate = (mutations) => { if (stopObservation.value) return; mutations.forEach((mutation) => { if (reRendering(mutation, watermarkRef.value)) { destroyWatermark(); renderWatermark(); } }); }; useMutationObserver(containerRef, onMutate, { attributes: true, subtree: true, childList: true }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "containerRef", ref: containerRef, style: normalizeStyle([style]) }, [renderSlot(_ctx.$slots, "default")], 4); }; } }); var watermark_default = watermark_vue_vue_type_script_setup_true_lang_default; const ElWatermark = withInstall(watermark_default); const tourStrategies = ["absolute", "fixed"]; const tourPlacements = [ "top-start", "top-end", "top", "bottom-start", "bottom-end", "bottom", "left-start", "left-end", "left", "right-start", "right-end", "right" ]; const tourContentProps = buildProps({ placement: { type: definePropType(String), values: tourPlacements, default: "bottom" }, reference: { type: definePropType(Object), default: null }, strategy: { type: definePropType(String), values: tourStrategies, default: "absolute" }, offset: { type: Number, default: 10 }, showArrow: Boolean, zIndex: { type: Number, default: 2001 } }); const tourContentEmits = { close: () => true }; const tourProps = buildProps({ modelValue: Boolean, current: { type: Number, default: 0 }, showArrow: { type: Boolean, default: true }, showClose: { type: Boolean, default: true }, closeIcon: { type: iconPropType }, placement: tourContentProps.placement, contentStyle: { type: definePropType([Object]) }, mask: { type: definePropType([Boolean, Object]), default: true }, gap: { type: definePropType(Object), default: () => ({ offset: 6, radius: 2 }) }, zIndex: { type: Number }, scrollIntoViewOptions: { type: definePropType([Boolean, Object]), default: () => ({ block: "center" }) }, type: { type: definePropType(String) }, appendTo: { type: teleportProps.to.type, default: "body" }, closeOnPressEscape: { type: Boolean, default: true }, targetAreaClickable: { type: Boolean, default: true } }); const tourEmits = { [UPDATE_MODEL_EVENT]: (value) => isBoolean(value), ["update:current"]: (current) => isNumber(current), close: (current) => isNumber(current), finish: () => true, change: (current) => isNumber(current) }; const tourStepProps = buildProps({ target: { type: definePropType([ String, Object, Function ]) }, title: String, description: String, showClose: { type: Boolean, default: void 0 }, closeIcon: { type: iconPropType }, showArrow: { type: Boolean, default: void 0 }, placement: tourContentProps.placement, mask: { type: definePropType([Boolean, Object]), default: void 0 }, contentStyle: { type: definePropType([Object]) }, prevButtonProps: { type: definePropType(Object) }, nextButtonProps: { type: definePropType(Object) }, scrollIntoViewOptions: { type: definePropType([Boolean, Object]), default: void 0 }, type: { type: definePropType(String) } }); const tourStepEmits = { close: () => true }; const useTarget = (target, open, gap, mergedMask, scrollIntoViewOptions) => { const posInfo = ref(null); const getTargetEl = () => { let targetEl; if (isString(target.value)) targetEl = document.querySelector(target.value); else if (isFunction(target.value)) targetEl = target.value(); else targetEl = target.value; return targetEl; }; const updatePosInfo = () => { const targetEl = getTargetEl(); if (!targetEl || !open.value) { posInfo.value = null; return; } if (!isInViewPort(targetEl)) targetEl.scrollIntoView(scrollIntoViewOptions.value); const { left, top, width, height } = targetEl.getBoundingClientRect(); posInfo.value = { left, top, width, height, radius: 0 }; }; onMounted(() => { watch([open, target], () => { updatePosInfo(); }, { immediate: true }); window.addEventListener("resize", updatePosInfo); }); onBeforeUnmount(() => { window.removeEventListener("resize", updatePosInfo); }); const getGapOffset = (index) => (isArray(gap.value.offset) ? gap.value.offset[index] : gap.value.offset) ?? 6; const mergedPosInfo = computed(() => { var _a; if (!posInfo.value) return posInfo.value; const gapOffsetX = getGapOffset(0); const gapOffsetY = getGapOffset(1); const gapRadius = ((_a = gap.value) == null ? void 0 : _a.radius) || 2; return { left: posInfo.value.left - gapOffsetX, top: posInfo.value.top - gapOffsetY, width: posInfo.value.width + gapOffsetX * 2, height: posInfo.value.height + gapOffsetY * 2, radius: gapRadius }; }); return { mergedPosInfo, triggerTarget: computed(() => { const targetEl = getTargetEl(); if (!mergedMask.value || !targetEl || !window.DOMRect) return targetEl || void 0; return { getBoundingClientRect() { var _a, _b, _c, _d; return window.DOMRect.fromRect({ width: ((_a = mergedPosInfo.value) == null ? void 0 : _a.width) || 0, height: ((_b = mergedPosInfo.value) == null ? void 0 : _b.height) || 0, x: ((_c = mergedPosInfo.value) == null ? void 0 : _c.left) || 0, y: ((_d = mergedPosInfo.value) == null ? void 0 : _d.top) || 0 }); } }; }) }; }; const tourKey = Symbol("ElTour"); function isInViewPort(element) { const viewWidth = window.innerWidth || document.documentElement.clientWidth; const viewHeight = window.innerHeight || document.documentElement.clientHeight; const { top, right, bottom, left } = element.getBoundingClientRect(); return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight; } const useFloating = (referenceRef, contentRef, arrowRef, placement, strategy, offset$1, zIndex2, showArrow) => { const x = ref(); const y = ref(); const middlewareData = ref({}); const states = { x, y, placement, strategy, middlewareData }; const middleware = computed(() => { const _middleware = [ offset(unref(offset$1)), flip(), shift(), overflowMiddleware() ]; if (unref(showArrow) && unref(arrowRef)) _middleware.push(arrow({ element: unref(arrowRef) })); return _middleware; }); const update = async () => { if (!isClient) return; const referenceEl = unref(referenceRef); const contentEl = unref(contentRef); if (!referenceEl || !contentEl) return; const data = await computePosition(referenceEl, contentEl, { placement: unref(placement), strategy: unref(strategy), middleware: unref(middleware) }); keysOf(states).forEach((key) => { states[key].value = data[key]; }); }; const contentStyle = computed(() => { if (!unref(referenceRef)) return { position: "fixed", top: "50%", left: "50%", transform: "translate3d(-50%, -50%, 0)", maxWidth: "100vw", zIndex: unref(zIndex2) }; const { overflow } = unref(middlewareData); return { position: unref(strategy), zIndex: unref(zIndex2), top: unref(y) != null ? `${unref(y)}px` : "", left: unref(x) != null ? `${unref(x)}px` : "", maxWidth: (overflow == null ? void 0 : overflow.maxWidth) ? `${overflow == null ? void 0 : overflow.maxWidth}px` : "" }; }); const arrowStyle = computed(() => { if (!unref(showArrow)) return {}; const { arrow: arrow2 } = unref(middlewareData); return { left: (arrow2 == null ? void 0 : arrow2.x) != null ? `${arrow2 == null ? void 0 : arrow2.x}px` : "", top: (arrow2 == null ? void 0 : arrow2.y) != null ? `${arrow2 == null ? void 0 : arrow2.y}px` : "" }; }); let cleanup; onMounted(() => { const referenceEl = unref(referenceRef); const contentEl = unref(contentRef); if (referenceEl && contentEl) cleanup = autoUpdate(referenceEl, contentEl, update); watchEffect(() => { update(); }); }); onBeforeUnmount(() => { cleanup && cleanup(); }); return { update, contentStyle, arrowStyle }; }; const overflowMiddleware = () => { return { name: "overflow", async fn(state) { const overflow = await detectOverflow(state); let overWidth = 0; if (overflow.left > 0) overWidth = overflow.left; if (overflow.right > 0) overWidth = overflow.right; return { data: { maxWidth: state.rects.floating.width - overWidth } }; } }; }; const maskProps = buildProps({ zIndex: { type: Number, default: 1001 }, visible: Boolean, fill: { type: String, default: "rgba(0,0,0,0.5)" }, pos: { type: definePropType(Object) }, targetAreaClickable: { type: Boolean, default: true } }); const _hoisted_1$8 = { style: { width: "100%", height: "100%" } }; const _hoisted_2$4 = ["d"]; var mask_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTourMask", inheritAttrs: false, __name: "mask", props: maskProps, setup(__props) { const props2 = __props; const { ns } = inject(tourKey); const radius = computed(() => { var _a; return ((_a = props2.pos) == null ? void 0 : _a.radius) ?? 2; }); const roundInfo = computed(() => { const v = radius.value; const baseInfo = `a${v},${v} 0 0 1`; return { topRight: `${baseInfo} ${v},${v}`, bottomRight: `${baseInfo} ${-v},${v}`, bottomLeft: `${baseInfo} ${-v},${-v}`, topLeft: `${baseInfo} ${v},${-v}` }; }); const { width: windowWidth, height: windowHeight } = useWindowSize(); const path = computed(() => { const width = windowWidth.value; const height = windowHeight.value; const info = roundInfo.value; const _path = `M${width},0 L0,0 L0,${height} L${width},${height} L${width},0 Z`; const _radius = radius.value; return props2.pos ? `${_path} M${props2.pos.left + _radius},${props2.pos.top} h${props2.pos.width - _radius * 2} ${info.topRight} v${props2.pos.height - _radius * 2} ${info.bottomRight} h${-props2.pos.width + _radius * 2} ${info.bottomLeft} v${-props2.pos.height + _radius * 2} ${info.topLeft} z` : _path; }); const maskStyle = computed(() => ({ position: "fixed", left: 0, right: 0, top: 0, bottom: 0, zIndex: props2.zIndex, pointerEvents: props2.pos && props2.targetAreaClickable ? "none" : "auto" })); const pathStyle = computed(() => ({ fill: props2.fill, pointerEvents: "auto", cursor: "auto" })); useLockscreen(toRef(props2, "visible"), { ns }); return (_ctx, _cache) => { return __props.visible ? (openBlock(), createElementBlock("div", mergeProps({ key: 0, class: unref(ns).e("mask"), style: maskStyle.value }, _ctx.$attrs), [(openBlock(), createElementBlock("svg", _hoisted_1$8, [createBaseVNode("path", { class: normalizeClass(unref(ns).e("hollow")), style: normalizeStyle(pathStyle.value), d: path.value }, null, 14, _hoisted_2$4)]))], 16)) : createCommentVNode("v-if", true); }; } }); var mask_default = mask_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$7 = ["data-side"]; var content_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTourContent", __name: "content", props: tourContentProps, emits: tourContentEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const placement = ref(props2.placement); const strategy = ref(props2.strategy); const contentRef = ref(null); const arrowRef = ref(null); watch(() => props2.placement, () => { placement.value = props2.placement; }); const { contentStyle, arrowStyle } = useFloating(toRef(props2, "reference"), contentRef, arrowRef, placement, strategy, toRef(props2, "offset"), toRef(props2, "zIndex"), toRef(props2, "showArrow")); const side = computed(() => { return placement.value.split("-")[0]; }); const { ns } = inject(tourKey); const onCloseRequested = () => { emit("close"); }; const onFocusoutPrevented = (event) => { if (event.detail.focusReason === "pointer") event.preventDefault(); }; return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "contentRef", ref: contentRef, style: normalizeStyle(unref(contentStyle)), class: normalizeClass(unref(ns).e("content")), "data-side": side.value, tabindex: "-1" }, [createVNode(unref(focus_trap_default$1), { loop: "", trapped: "", "focus-start-el": "container", "focus-trap-el": contentRef.value || void 0, onReleaseRequested: onCloseRequested, onFocusoutPrevented }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, ["focus-trap-el"]), __props.showArrow ? (openBlock(), createElementBlock("span", { key: 0, ref_key: "arrowRef", ref: arrowRef, style: normalizeStyle(unref(arrowStyle)), class: normalizeClass(unref(ns).e("arrow")) }, null, 6)) : createCommentVNode("v-if", true)], 14, _hoisted_1$7); }; } }); var content_default = content_vue_vue_type_script_setup_true_lang_default; var steps_default = defineComponent({ name: "ElTourSteps", props: { current: { type: Number, default: 0 } }, emits: ["update-total"], setup(props2, { slots, emit }) { let cacheTotal = 0; return () => { var _a, _b; const children = (_a = slots.default) == null ? void 0 : _a.call(slots); const result = []; let total2 = 0; function filterSteps(children2) { if (!isArray(children2)) return; children2.forEach((item) => { var _a2; if (((_a2 = (item == null ? void 0 : item.type) || {}) == null ? void 0 : _a2.name) === "ElTourStep") { result.push(item); total2 += 1; } }); } if (children.length) filterSteps(flattedChildren((_b = children[0]) == null ? void 0 : _b.children)); if (cacheTotal !== total2) { cacheTotal = total2; emit("update-total", total2); } if (result.length) return result[props2.current]; return null; }; } }); var tour_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTour", inheritAttrs: false, __name: "tour", props: tourProps, emits: tourEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("tour"); const total2 = ref(0); const currentStep = ref(); const current = useVModel(props2, "current", emit, { passive: true }); const currentTarget = computed(() => { var _a; return (_a = currentStep.value) == null ? void 0 : _a.target; }); const kls = computed(() => [ns.b(), mergedType.value === "primary" ? ns.m("primary") : ""]); const mergedPlacement = computed(() => { var _a; return ((_a = currentStep.value) == null ? void 0 : _a.placement) || props2.placement; }); const mergedContentStyle = computed(() => { var _a; return ((_a = currentStep.value) == null ? void 0 : _a.contentStyle) ?? props2.contentStyle; }); const mergedMask = computed(() => { var _a; return ((_a = currentStep.value) == null ? void 0 : _a.mask) ?? props2.mask; }); const mergedShowMask = computed(() => !!mergedMask.value && props2.modelValue); const mergedMaskStyle = computed(() => isBoolean(mergedMask.value) ? void 0 : mergedMask.value); const mergedShowArrow = computed(() => { var _a; return !!currentTarget.value && (((_a = currentStep.value) == null ? void 0 : _a.showArrow) ?? props2.showArrow); }); const mergedScrollIntoViewOptions = computed(() => { var _a; return ((_a = currentStep.value) == null ? void 0 : _a.scrollIntoViewOptions) ?? props2.scrollIntoViewOptions; }); const mergedType = computed(() => { var _a; return ((_a = currentStep.value) == null ? void 0 : _a.type) ?? props2.type; }); const { nextZIndex } = useZIndex(); const nowZIndex = nextZIndex(); const mergedZIndex = computed(() => props2.zIndex ?? nowZIndex); const { mergedPosInfo: pos, triggerTarget } = useTarget(currentTarget, toRef(props2, "modelValue"), toRef(props2, "gap"), mergedMask, mergedScrollIntoViewOptions); watch(() => props2.modelValue, (val) => { if (!val) current.value = 0; }); const onEscClose = () => { if (props2.closeOnPressEscape) { emit(UPDATE_MODEL_EVENT, false); emit("close", current.value); } }; const onUpdateTotal = (val) => { total2.value = val; }; const slots = useSlots(); provide(tourKey, { currentStep, current, total: total2, showClose: toRef(props2, "showClose"), closeIcon: toRef(props2, "closeIcon"), mergedType, ns, slots, updateModelValue(modelValue) { emit(UPDATE_MODEL_EVENT, modelValue); }, onClose() { emit("close", current.value); }, onFinish() { emit("finish"); }, onChange() { emit(CHANGE_EVENT, current.value); } }); return (_ctx, _cache) => { return openBlock(), createElementBlock(Fragment, null, [ createVNode(unref(ElTeleport), { to: __props.appendTo }, { default: withCtx(() => { var _a, _b; return [createBaseVNode("div", mergeProps({ class: kls.value }, _ctx.$attrs), [createVNode(mask_default, { visible: mergedShowMask.value, fill: (_a = mergedMaskStyle.value) == null ? void 0 : _a.color, style: normalizeStyle((_b = mergedMaskStyle.value) == null ? void 0 : _b.style), pos: unref(pos), "z-index": mergedZIndex.value, "target-area-clickable": __props.targetAreaClickable }, null, 8, [ "visible", "fill", "style", "pos", "z-index", "target-area-clickable" ]), __props.modelValue ? (openBlock(), createBlock(content_default, { key: unref(current), reference: unref(triggerTarget), placement: mergedPlacement.value, "show-arrow": mergedShowArrow.value, "z-index": mergedZIndex.value, style: normalizeStyle(mergedContentStyle.value), onClose: onEscClose }, { default: withCtx(() => [createVNode(unref(steps_default), { current: unref(current), onUpdateTotal }, { default: withCtx(() => [renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, ["current"])]), _: 3 }, 8, [ "reference", "placement", "show-arrow", "z-index", "style" ])) : createCommentVNode("v-if", true)], 16)]; }), _: 3 }, 8, ["to"]), createCommentVNode(" just for IDE "), createCommentVNode("v-if", true) ], 64); }; } }); var tour_default = tour_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$6 = ["aria-label"]; var step_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElTourStep", __name: "step", props: tourStepProps, emits: tourStepEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const { Close } = CloseComponents; const { t } = useLocale(); const { currentStep, current, total: total2, showClose, closeIcon, mergedType, ns, slots: tourSlots, updateModelValue, onClose: tourOnClose, onFinish: tourOnFinish, onChange } = inject(tourKey); watch(props2, (val) => { currentStep.value = val; }, { immediate: true }); const mergedShowClose = computed(() => props2.showClose ?? showClose.value); const mergedCloseIcon = computed(() => props2.closeIcon ?? closeIcon.value ?? Close); const filterButtonProps = (btnProps) => { if (!btnProps) return; return omit(btnProps, ["children", "onClick"]); }; const onPrev = () => { var _a, _b; current.value -= 1; if ((_a = props2.prevButtonProps) == null ? void 0 : _a.onClick) (_b = props2.prevButtonProps) == null ? void 0 : _b.onClick(); onChange(); }; const onNext = () => { var _a; if (current.value >= total2.value - 1) onFinish(); else current.value += 1; if ((_a = props2.nextButtonProps) == null ? void 0 : _a.onClick) props2.nextButtonProps.onClick(); onChange(); }; const onFinish = () => { onClose(); tourOnFinish(); }; const onClose = () => { updateModelValue(false); tourOnClose(); emit("close"); }; const handleKeydown = (e) => { var _a; if ((_a = e.target) == null ? void 0 : _a.isContentEditable) return; switch (getEventCode(e)) { case EVENT_CODE.left: e.preventDefault(); current.value > 0 && onPrev(); break; case EVENT_CODE.right: e.preventDefault(); onNext(); break; } }; onMounted(() => { window.addEventListener("keydown", handleKeydown); }); onBeforeUnmount(() => { window.removeEventListener("keydown", handleKeydown); }); return (_ctx, _cache) => { return openBlock(), createElementBlock(Fragment, null, [ mergedShowClose.value ? (openBlock(), createElementBlock("button", { key: 0, "aria-label": unref(t)("el.tour.close"), class: normalizeClass(unref(ns).e("closebtn")), type: "button", onClick: onClose }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).e("close")) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(mergedCloseIcon.value)))]), _: 1 }, 8, ["class"])], 10, _hoisted_1$6)) : createCommentVNode("v-if", true), createBaseVNode("header", { class: normalizeClass([unref(ns).e("header"), { "show-close": unref(showClose) }]) }, [renderSlot(_ctx.$slots, "header", {}, () => [createBaseVNode("span", { role: "heading", class: normalizeClass(unref(ns).e("title")) }, toDisplayString(__props.title), 3)])], 2), createBaseVNode("div", { class: normalizeClass(unref(ns).e("body")) }, [renderSlot(_ctx.$slots, "default", {}, () => [createBaseVNode("span", null, toDisplayString(__props.description), 1)])], 2), createBaseVNode("footer", { class: normalizeClass(unref(ns).e("footer")) }, [createBaseVNode("div", { class: normalizeClass(unref(ns).b("indicators")) }, [unref(tourSlots).indicators ? (openBlock(), createBlock(resolveDynamicComponent(unref(tourSlots).indicators), { key: 0, current: unref(current), total: unref(total2) }, null, 8, ["current", "total"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(total2), (item, index) => { return openBlock(), createElementBlock("span", { key: item, class: normalizeClass([unref(ns).b("indicator"), unref(ns).is("active", index === unref(current))]) }, null, 2); }), 128))], 2), createBaseVNode("div", { class: normalizeClass(unref(ns).b("buttons")) }, [unref(current) > 0 ? (openBlock(), createBlock(unref(ElButton), mergeProps({ key: 0, size: "small", type: unref(mergedType) }, filterButtonProps(__props.prevButtonProps), { onClick: onPrev }), { default: withCtx(() => { var _a; return [createTextVNode(toDisplayString(((_a = __props.prevButtonProps) == null ? void 0 : _a.children) ?? unref(t)("el.tour.previous")), 1)]; }), _: 1 }, 16, ["type"])) : createCommentVNode("v-if", true), unref(current) <= unref(total2) - 1 ? (openBlock(), createBlock(unref(ElButton), mergeProps({ key: 1, size: "small", type: unref(mergedType) === "primary" ? "default" : "primary" }, filterButtonProps(__props.nextButtonProps), { onClick: onNext }), { default: withCtx(() => { var _a; return [createTextVNode(toDisplayString(((_a = __props.nextButtonProps) == null ? void 0 : _a.children) ?? (unref(current) === unref(total2) - 1 ? unref(t)("el.tour.finish") : unref(t)("el.tour.next"))), 1)]; }), _: 1 }, 16, ["type"])) : createCommentVNode("v-if", true)], 2)], 2) ], 64); }; } }); var step_default = step_vue_vue_type_script_setup_true_lang_default; const ElTour = withInstall(tour_default, { TourStep: step_default }); const ElTourStep = withNoopInstall(step_default); const anchorProps = buildProps({ container: { type: definePropType([String, Object]) }, offset: { type: Number, default: 0 }, bound: { type: Number, default: 15 }, duration: { type: Number, default: 300 }, marker: { type: Boolean, default: true }, type: { type: definePropType(String), default: "default" }, direction: { type: definePropType(String), default: "vertical" }, selectScrollTop: Boolean }); const anchorEmits = { change: (href) => isString(href), click: (e, href) => e instanceof MouseEvent && (isString(href) || isUndefined(href)) }; const getElement = ((target) => { if (!isClient || target === "") return null; if (isString(target)) try { return document.querySelector(target); } catch { return null; } return target; }); function throttleByRaf(cb) { let timer = 0; const throttle2 = (...args) => { if (timer) cAF(timer); timer = rAF(() => { cb(...args); timer = 0; }); }; throttle2.cancel = () => { cAF(timer); timer = 0; }; return throttle2; } const anchorKey = Symbol("anchor"); var anchor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElAnchor", __name: "anchor", props: anchorProps, emits: anchorEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const slots = useSlots(); const currentAnchor = ref(""); const markerStyle = ref({}); const anchorRef = ref(null); const markerRef = ref(null); const containerEl = ref(); const links = {}; let isScrolling = false; let currentScrollTop = 0; const ns = useNamespace("anchor"); const cls = computed(() => [ ns.b(), props2.type === "underline" ? ns.m("underline") : "", ns.m(props2.direction) ]); const addLink = (state) => { links[state.href] = state.el; }; const removeLink = (href) => { delete links[href]; }; const setCurrentAnchor = (href) => { if (currentAnchor.value !== href) { currentAnchor.value = href; emit(CHANGE_EVENT, href); } }; let clearAnimate = null; let currentTargetHref = ""; const scrollToAnchor = (href) => { if (!containerEl.value) return; const target = getElement(href); if (!target) return; if (clearAnimate) { if (currentTargetHref === href) return; clearAnimate(); } currentTargetHref = href; isScrolling = true; const scrollEle = getScrollElement(target, containerEl.value); const distance = getOffsetTopDistance(target, scrollEle); const max2 = scrollEle.scrollHeight - scrollEle.clientHeight; const to = Math.min(distance - props2.offset, max2); clearAnimate = animateScrollTo(containerEl.value, currentScrollTop, to, props2.duration, () => { setTimeout(() => { isScrolling = false; currentTargetHref = ""; }, 20); }); }; const scrollTo = (href) => { if (href) { setCurrentAnchor(href); scrollToAnchor(href); } }; const handleClick = (e, href) => { emit("click", e, href); scrollTo(href); }; const handleScroll2 = throttleByRaf(() => { if (containerEl.value) currentScrollTop = getScrollTop(containerEl.value); const currentHref = getCurrentHref(); if (isScrolling || isUndefined(currentHref)) return; setCurrentAnchor(currentHref); }); const getCurrentHref = () => { if (!containerEl.value) return; const scrollTop = getScrollTop(containerEl.value); const anchorTopList = []; for (const href of Object.keys(links)) { const target = getElement(href); if (!target) continue; const distance = getOffsetTopDistance(target, getScrollElement(target, containerEl.value)); anchorTopList.push({ top: distance - props2.offset - props2.bound, href }); } anchorTopList.sort((prev, next) => prev.top - next.top); for (let i = 0; i < anchorTopList.length; i++) { const item = anchorTopList[i]; const next = anchorTopList[i + 1]; if (i === 0 && scrollTop === 0) return props2.selectScrollTop ? item.href : ""; if (item.top <= scrollTop && (!next || next.top > scrollTop)) return item.href; } }; const getContainer = () => { const el = getElement(props2.container); if (!el || isWindow(el)) containerEl.value = window; else containerEl.value = el; }; useEventListener(containerEl, "scroll", handleScroll2); const updateMarkerStyle = () => { nextTick(() => { if (!anchorRef.value || !markerRef.value || !currentAnchor.value) { markerStyle.value = {}; return; } const currentLinkEl = links[currentAnchor.value]; if (!currentLinkEl) { markerStyle.value = {}; return; } const anchorRect = anchorRef.value.getBoundingClientRect(); const markerRect = markerRef.value.getBoundingClientRect(); const linkRect = currentLinkEl.getBoundingClientRect(); if (props2.direction === "horizontal") markerStyle.value = { left: `${linkRect.left - anchorRect.left}px`, width: `${linkRect.width}px`, opacity: 1 }; else markerStyle.value = { top: `${linkRect.top - anchorRect.top + (linkRect.height - markerRect.height) / 2}px`, opacity: 1 }; }); }; watch(currentAnchor, updateMarkerStyle); watch(() => { var _a; return (_a = slots.default) == null ? void 0 : _a.call(slots); }, updateMarkerStyle); onMounted(() => { getContainer(); const hash = decodeURIComponent(window.location.hash); if (getElement(hash)) scrollTo(hash); else handleScroll2(); }); watch(() => props2.container, () => { getContainer(); }); provide(anchorKey, { ns, direction: props2.direction, currentAnchor, addLink, removeLink, handleClick }); __expose({ scrollTo }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "anchorRef", ref: anchorRef, class: normalizeClass(cls.value) }, [__props.marker ? (openBlock(), createElementBlock("div", { key: 0, ref_key: "markerRef", ref: markerRef, class: normalizeClass(unref(ns).e("marker")), style: normalizeStyle(markerStyle.value) }, null, 6)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("list")) }, [renderSlot(_ctx.$slots, "default")], 2)], 2); }; } }); var anchor_default = anchor_vue_vue_type_script_setup_true_lang_default; const anchorLinkProps = buildProps({ title: String, href: String }); const _hoisted_1$5 = ["href"]; var anchor_link_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElAnchorLink", __name: "anchor-link", props: anchorLinkProps, setup(__props) { const props2 = __props; const linkRef = ref(null); const { ns, direction: direction2, currentAnchor, addLink, removeLink, handleClick: contextHandleClick } = inject(anchorKey); const cls = computed(() => [ns.e("link"), ns.is("active", currentAnchor.value === props2.href)]); const handleClick = (e) => { contextHandleClick(e, props2.href); }; watch(() => props2.href, (val, oldVal) => { nextTick(() => { if (oldVal) removeLink(oldVal); if (val) addLink({ href: val, el: linkRef.value }); }); }); onMounted(() => { const { href } = props2; if (href) addLink({ href, el: linkRef.value }); }); onBeforeUnmount(() => { const { href } = props2; if (href) removeLink(href); }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).e("item")) }, [createBaseVNode("a", { ref_key: "linkRef", ref: linkRef, class: normalizeClass(cls.value), href: __props.href, onClick: handleClick }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 10, _hoisted_1$5), _ctx.$slots["sub-link"] && unref(direction2) === "vertical" ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("list")) }, [renderSlot(_ctx.$slots, "sub-link")], 2)) : createCommentVNode("v-if", true)], 2); }; } }); var anchor_link_default = anchor_link_vue_vue_type_script_setup_true_lang_default; const ElAnchor = withInstall(anchor_default, { AnchorLink: anchor_link_default }); const ElAnchorLink = withNoopInstall(anchor_link_default); const defaultProps = { label: "label", value: "value", disabled: "disabled" }; const segmentedProps = buildProps({ direction: { type: definePropType(String), default: "horizontal" }, options: { type: definePropType(Array), default: () => [] }, modelValue: { type: [ String, Number, Boolean ], default: void 0 }, props: { type: definePropType(Object), default: () => defaultProps }, block: Boolean, size: useSizeProp, disabled: { type: Boolean, default: void 0 }, validateEvent: { type: Boolean, default: true }, id: String, name: String, ...useAriaProps(["ariaLabel"]) }); const segmentedEmits = { [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val), [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val) }; const _hoisted_1$4 = [ "id", "aria-label", "aria-labelledby" ]; const _hoisted_2$3 = [ "name", "disabled", "checked", "onChange" ]; var segmented_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElSegmented", __name: "segmented", props: segmentedProps, emits: segmentedEmits, setup(__props, { emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("segmented"); const segmentedId = useId(); const segmentedSize = useFormSize(); const _disabled = useFormDisabled(); const { formItem } = useFormItem(); const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, { formItemContext: formItem }); const segmentedRef = ref(null); const activeElement = useActiveElement(); const state = reactive({ isInit: false, width: 0, height: 0, translateX: 0, translateY: 0, focusVisible: false }); const handleChange = (evt, item) => { const value = getValue(item); emit(UPDATE_MODEL_EVENT, value); emit(CHANGE_EVENT, value); evt.target.checked = value === props2.modelValue; }; const aliasProps = computed(() => ({ ...defaultProps, ...props2.props })); const getValue = (item) => { return isObject(item) ? item[aliasProps.value.value] : item; }; const getLabel = (item) => { return isObject(item) ? item[aliasProps.value.label] : item; }; const getDisabled = (item) => { return !!(_disabled.value || (isObject(item) ? item[aliasProps.value.disabled] : false)); }; const getSelected = (item) => { return props2.modelValue === getValue(item); }; const getOption = (value) => { return props2.options.find((item) => getValue(item) === value); }; const getItemCls = (item) => { return [ ns.e("item"), ns.is("selected", getSelected(item)), ns.is("disabled", getDisabled(item)) ]; }; const updateSelect = () => { if (!segmentedRef.value) return; const selectedItem = segmentedRef.value.querySelector(".is-selected"); const selectedItemInput = segmentedRef.value.querySelector(".is-selected input"); if (!selectedItem || !selectedItemInput) { state.width = 0; state.height = 0; state.translateX = 0; state.translateY = 0; state.focusVisible = false; return; } state.isInit = true; if (props2.direction === "vertical") { state.height = selectedItem.offsetHeight; state.translateY = selectedItem.offsetTop; } else { state.width = selectedItem.offsetWidth; state.translateX = selectedItem.offsetLeft; } try { state.focusVisible = selectedItemInput.matches(":focus-visible"); } catch { } }; const segmentedCls = computed(() => [ ns.b(), ns.m(segmentedSize.value), ns.is("block", props2.block) ]); const selectedStyle = computed(() => ({ width: props2.direction === "vertical" ? "100%" : `${state.width}px`, height: props2.direction === "vertical" ? `${state.height}px` : "100%", transform: props2.direction === "vertical" ? `translateY(${state.translateY}px)` : `translateX(${state.translateX}px)`, display: state.isInit ? "block" : "none" })); const selectedCls = computed(() => [ ns.e("item-selected"), ns.is("disabled", getDisabled(getOption(props2.modelValue))), ns.is("focus-visible", state.focusVisible) ]); const name = computed(() => { return props2.name || segmentedId.value; }); useResizeObserver(segmentedRef, updateSelect); watch(activeElement, updateSelect); watch(() => props2.modelValue, () => { var _a; updateSelect(); if (props2.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err)); }, { flush: "post" }); return (_ctx, _cache) => { return __props.options.length ? (openBlock(), createElementBlock("div", { key: 0, id: unref(inputId), ref_key: "segmentedRef", ref: segmentedRef, class: normalizeClass(segmentedCls.value), role: "radiogroup", "aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "segmented" : void 0, "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0 }, [createBaseVNode("div", { class: normalizeClass([unref(ns).e("group"), unref(ns).m(__props.direction)]) }, [createBaseVNode("div", { style: normalizeStyle(selectedStyle.value), class: normalizeClass(selectedCls.value) }, null, 6), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => { return openBlock(), createElementBlock("label", { key: index, class: normalizeClass(getItemCls(item)) }, [createBaseVNode("input", { class: normalizeClass(unref(ns).e("item-input")), type: "radio", name: name.value, disabled: getDisabled(item), checked: getSelected(item), onChange: ($event) => handleChange($event, item) }, null, 42, _hoisted_2$3), createBaseVNode("div", { class: normalizeClass(unref(ns).e("item-label")) }, [renderSlot(_ctx.$slots, "default", { item }, () => [createTextVNode(toDisplayString(getLabel(item)), 1)])], 2)], 2); }), 128))], 2)], 10, _hoisted_1$4)) : createCommentVNode("v-if", true); }; } }); var segmented_default = segmented_vue_vue_type_script_setup_true_lang_default; const ElSegmented = withInstall(segmented_default); const filterOption = (pattern, option) => { const lowerCase = pattern.toLowerCase(); return (option.label || option.value || "").toLowerCase().includes(lowerCase); }; const getMentionCtx = (inputEl, prefix, split) => { const { selectionEnd } = inputEl; if (selectionEnd === null) return; const inputValue = inputEl.value; const prefixArray = castArray$1(prefix); let splitIndex = -1; let mentionCtx; for (let i = selectionEnd - 1; i >= 0; --i) { const char = inputValue[i]; if (splitIndex === -1 && (char === split || char === "\n" || char === "\r")) { splitIndex = i; continue; } if (prefixArray.includes(char)) { const end = splitIndex === -1 ? selectionEnd : splitIndex; mentionCtx = { pattern: inputValue.slice(i + 1, end), start: i + 1, end, prefix: char, prefixIndex: i, splitIndex, selectionEnd }; break; } } return mentionCtx; }; const getCursorPosition = (element, options = { debug: false, useSelectionEnd: false }) => { const selectionStart = element.selectionStart !== null ? element.selectionStart : 0; const selectionEnd = element.selectionEnd !== null ? element.selectionEnd : 0; const position = options.useSelectionEnd ? selectionEnd : selectionStart; const properties = [ "direction", "boxSizing", "width", "height", "overflowX", "overflowY", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth", "borderStyle", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "fontStyle", "fontVariant", "fontWeight", "fontStretch", "fontSize", "fontSizeAdjust", "lineHeight", "fontFamily", "textAlign", "textTransform", "textIndent", "textDecoration", "letterSpacing", "wordSpacing", "tabSize", "MozTabSize" ]; if (options.debug) { const el = document.querySelector("#input-textarea-caret-position-mirror-div"); if (el == null ? void 0 : el.parentNode) el.parentNode.removeChild(el); } const div = document.createElement("div"); div.id = "input-textarea-caret-position-mirror-div"; document.body.appendChild(div); const style = div.style; const computed2 = window.getComputedStyle(element); const isInput = element.nodeName === "INPUT"; style.whiteSpace = isInput ? "nowrap" : "pre-wrap"; if (!isInput) style.wordWrap = "break-word"; style.position = "absolute"; if (!options.debug) style.visibility = "hidden"; properties.forEach((prop) => { if (isInput && prop === "lineHeight") if (computed2.boxSizing === "border-box") { const height = Number.parseInt(computed2.height); const outerHeight = Number.parseInt(computed2.paddingTop) + Number.parseInt(computed2.paddingBottom) + Number.parseInt(computed2.borderTopWidth) + Number.parseInt(computed2.borderBottomWidth); const targetHeight = outerHeight + Number.parseInt(computed2.lineHeight); if (height > targetHeight) style.lineHeight = `${height - outerHeight}px`; else if (height === targetHeight) style.lineHeight = computed2.lineHeight; else style.lineHeight = "0"; } else style.lineHeight = computed2.height; else style[prop] = computed2[prop]; }); if (isFirefox()) { if (element.scrollHeight > Number.parseInt(computed2.height)) style.overflowY = "scroll"; } else style.overflow = "hidden"; div.textContent = element.value.slice(0, Math.max(0, position)); if (isInput && div.textContent) div.textContent = div.textContent.replace(/\s/g, " "); const span = document.createElement("span"); span.textContent = element.value.slice(Math.max(0, position)) || "."; span.style.position = "relative"; span.style.left = `${-element.scrollLeft}px`; span.style.top = `${-element.scrollTop}px`; div.appendChild(span); const relativePosition = { top: span.offsetTop + Number.parseInt(computed2.borderTopWidth), left: span.offsetLeft + Number.parseInt(computed2.borderLeftWidth), height: Number.parseInt(computed2.fontSize) * 1.5 }; if (options.debug) span.style.backgroundColor = "#aaa"; else document.body.removeChild(div); if (relativePosition.left >= element.clientWidth) relativePosition.left = element.clientWidth; return relativePosition; }; const mentionProps = buildProps({ ...inputProps, options: { type: definePropType(Array), default: () => [] }, prefix: { type: definePropType([String, Array]), default: "@", validator: (val) => { if (isString(val)) return val.length === 1; return val.every((v) => isString(v) && v.length === 1); } }, split: { type: String, default: " ", validator: (val) => val.length === 1 }, filterOption: { type: definePropType([Boolean, Function]), default: () => filterOption, validator: (val) => { if (val === false) return true; return isFunction(val); } }, placement: { type: definePropType(String), default: "bottom" }, showArrow: Boolean, offset: { type: Number, default: 0 }, whole: Boolean, checkIsWhole: { type: definePropType(Function) }, modelValue: String, loading: Boolean, popperClass: useTooltipContentProps.popperClass, popperStyle: useTooltipContentProps.popperStyle, popperOptions: { type: definePropType(Object), default: () => ({}) }, props: { type: definePropType(Object), default: () => mentionDefaultProps } }); const mentionEmits = { [UPDATE_MODEL_EVENT]: (value) => isString(value), "whole-remove": (pattern, prefix) => isString(pattern) && isString(prefix), input: (value) => isString(value), search: (pattern, prefix) => isString(pattern) && isString(prefix), select: (option, prefix) => isObject(option) && isString(prefix), focus: (evt) => evt instanceof FocusEvent, blur: (evt) => evt instanceof FocusEvent }; const mentionDefaultProps = { value: "value", label: "label", disabled: "disabled" }; const mentionDropdownProps = buildProps({ options: { type: definePropType(Array), default: () => [] }, loading: Boolean, disabled: Boolean, contentId: String, ariaLabel: String }); const mentionDropdownEmits = { select: (option) => isString(option.value) }; const _hoisted_1$3 = [ "id", "aria-disabled", "aria-selected", "onMousemove", "onClick" ]; var mention_dropdown_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElMentionDropdown", __name: "mention-dropdown", props: mentionDropdownProps, emits: mentionDropdownEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const ns = useNamespace("mention"); const { t } = useLocale(); const hoveringIndex = ref(-1); const scrollbarRef = ref(); const optionRefs = ref(); const dropdownRef = ref(); const optionkls = (item, index) => [ ns.be("dropdown", "item"), ns.is("hovering", hoveringIndex.value === index), ns.is("disabled", item.disabled || props2.disabled) ]; const handleSelect = (item) => { if (item.disabled || props2.disabled) return; emit("select", item); }; const handleMouseEnter = (index) => { hoveringIndex.value = index; }; const filteredAllDisabled = computed(() => props2.disabled || props2.options.every((item) => item.disabled)); const hoverOption = computed(() => props2.options[hoveringIndex.value]); const selectHoverOption = () => { if (!hoverOption.value || hoverOption.value.disabled || props2.disabled) return; emit("select", hoverOption.value); }; const navigateOptions = (direction2) => { const { options } = props2; if (options.length === 0 || filteredAllDisabled.value) return; if (direction2 === "next") { hoveringIndex.value++; if (hoveringIndex.value === options.length) hoveringIndex.value = 0; } else if (direction2 === "prev") { hoveringIndex.value--; if (hoveringIndex.value < 0) hoveringIndex.value = options.length - 1; } const option = options[hoveringIndex.value]; if (option.disabled) { navigateOptions(direction2); return; } nextTick(() => scrollToOption(option)); }; const scrollToOption = (option) => { var _a, _b, _c, _d; const { options } = props2; const index = options.findIndex((item) => item.value === option.value); const target = (_a = optionRefs.value) == null ? void 0 : _a[index]; if (target) { const menu = (_c = (_b = dropdownRef.value) == null ? void 0 : _b.querySelector) == null ? void 0 : _c.call(_b, `.${ns.be("dropdown", "wrap")}`); if (menu) scrollIntoView(menu, target); } (_d = scrollbarRef.value) == null ? void 0 : _d.handleScroll(); }; const resetHoveringIndex = () => { if (filteredAllDisabled.value || props2.options.length === 0) hoveringIndex.value = -1; else hoveringIndex.value = props2.options.findIndex((item) => !item.disabled); }; watch(() => props2.options, resetHoveringIndex, { immediate: true }); __expose({ hoveringIndex, navigateOptions, selectHoverOption, hoverOption }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "dropdownRef", ref: dropdownRef, class: normalizeClass(unref(ns).b("dropdown")) }, [ _ctx.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).be("dropdown", "header")) }, [renderSlot(_ctx.$slots, "header")], 2)) : createCommentVNode("v-if", true), withDirectives(createVNode(unref(ElScrollbar), { id: __props.contentId, ref_key: "scrollbarRef", ref: scrollbarRef, tag: "ul", "wrap-class": unref(ns).be("dropdown", "wrap"), "view-class": unref(ns).be("dropdown", "list"), role: "listbox", "aria-label": __props.ariaLabel, "aria-orientation": "vertical" }, { default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => { return openBlock(), createElementBlock("li", { id: `${__props.contentId}-${index}`, ref_for: true, ref_key: "optionRefs", ref: optionRefs, key: index, class: normalizeClass(optionkls(item, index)), role: "option", "aria-disabled": item.disabled || __props.disabled || void 0, "aria-selected": hoveringIndex.value === index, onMousemove: ($event) => handleMouseEnter(index), onClick: withModifiers(($event) => handleSelect(item), ["stop"]) }, [renderSlot(_ctx.$slots, "label", { item, index }, () => [createBaseVNode("span", null, toDisplayString(item.label ?? item.value), 1)])], 42, _hoisted_1$3); }), 128))]), _: 3 }, 8, [ "id", "wrap-class", "view-class", "aria-label" ]), [[vShow, __props.options.length > 0 && !__props.loading]]), __props.loading ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(ns).be("dropdown", "loading")) }, [renderSlot(_ctx.$slots, "loading", {}, () => [createTextVNode(toDisplayString(unref(t)("el.mention.loading")), 1)])], 2)) : createCommentVNode("v-if", true), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(unref(ns).be("dropdown", "footer")) }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true) ], 2); }; } }); var mention_dropdown_default = mention_dropdown_vue_vue_type_script_setup_true_lang_default; var mention_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElMention", inheritAttrs: false, __name: "mention", props: mentionProps, emits: mentionEmits, setup(__props, { expose: __expose, emit: __emit }) { const props2 = __props; const emit = __emit; const passInputProps = computed(() => { const inputProps2 = ElInput.props ?? []; return pick(props2, isArray(inputProps2) ? inputProps2 : Object.keys(inputProps2)); }); const ns = useNamespace("mention"); const disabled = useFormDisabled(); const contentId = useId(); const elInputRef = ref(); const tooltipRef = ref(); const dropdownRef = ref(); const visible = ref(false); const cursorStyle = ref(); const mentionCtx = ref(); const computedPlacement = computed(() => props2.showArrow ? props2.placement : `${props2.placement}-start`); const computedFallbackPlacements = computed(() => props2.showArrow ? ["bottom", "top"] : ["bottom-start", "top-start"]); const aliasProps = computed(() => ({ ...mentionDefaultProps, ...props2.props })); const mapOption = (option) => { const base = { label: option[aliasProps.value.label], value: option[aliasProps.value.value], disabled: option[aliasProps.value.disabled] }; return { ...option, ...base }; }; const options = computed(() => props2.options.map(mapOption)); const filteredOptions = computed(() => { const { filterOption: filterOption2 } = props2; if (!mentionCtx.value || !filterOption2) return options.value; return options.value.filter((option) => filterOption2(mentionCtx.value.pattern, option)); }); const dropdownVisible = computed(() => { return visible.value && (!!filteredOptions.value.length || props2.loading); }); const hoveringId = computed(() => { var _a; return `${contentId.value}-${(_a = dropdownRef.value) == null ? void 0 : _a.hoveringIndex}`; }); const handleInputChange = (value) => { emit(UPDATE_MODEL_EVENT, value); emit(INPUT_EVENT, value); syncAfterCursorMove(); }; const handleInputKeyDown = (event) => { var _a, _b, _c, _d; if ((_a = elInputRef.value) == null ? void 0 : _a.isComposing) return; const code = getEventCode(event); switch (code) { case EVENT_CODE.left: case EVENT_CODE.right: syncAfterCursorMove(); break; case EVENT_CODE.up: case EVENT_CODE.down: if (!visible.value) return; event.preventDefault(); (_b = dropdownRef.value) == null ? void 0 : _b.navigateOptions(code === EVENT_CODE.up ? "prev" : "next"); break; case EVENT_CODE.enter: case EVENT_CODE.numpadEnter: if (!visible.value) { props2.type !== "textarea" && syncAfterCursorMove(); return; } event.preventDefault(); if ((_c = dropdownRef.value) == null ? void 0 : _c.hoverOption) (_d = dropdownRef.value) == null ? void 0 : _d.selectHoverOption(); else visible.value = false; break; case EVENT_CODE.esc: if (!visible.value) return; event.preventDefault(); visible.value = false; break; case EVENT_CODE.backspace: if (props2.whole && mentionCtx.value) { const { splitIndex, selectionEnd, pattern, prefixIndex, prefix } = mentionCtx.value; const inputEl = getInputEl(); if (!inputEl) return; const inputValue = inputEl.value; const matchOption = options.value.find((item) => item.value === pattern); if ((isFunction(props2.checkIsWhole) ? props2.checkIsWhole(pattern, prefix) : matchOption) && splitIndex !== -1 && splitIndex + 1 === selectionEnd) { event.preventDefault(); const newValue = inputValue.slice(0, prefixIndex) + inputValue.slice(splitIndex + 1); emit(UPDATE_MODEL_EVENT, newValue); emit(INPUT_EVENT, newValue); emit("whole-remove", pattern, prefix); const newSelectionEnd = prefixIndex; nextTick(() => { inputEl.selectionStart = newSelectionEnd; inputEl.selectionEnd = newSelectionEnd; syncDropdownVisible(); }); } } } }; const { wrapperRef } = useFocusController(elInputRef, { disabled, afterFocus() { syncAfterCursorMove(); }, beforeBlur(event) { var _a; return (_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event); }, afterBlur() { visible.value = false; } }); const handleInputMouseDown = () => { syncAfterCursorMove(); }; const getOriginalOption = (mentionOption) => { return props2.options.find((option) => { return mentionOption.value === option[aliasProps.value.value]; }); }; const handleSelect = (item) => { if (!mentionCtx.value) return; const inputEl = getInputEl(); if (!inputEl) return; const inputValue = inputEl.value; const { split } = props2; const newEndPart = inputValue.slice(mentionCtx.value.end); const alreadySeparated = newEndPart.startsWith(split); const newMiddlePart = `${item.value}${alreadySeparated ? "" : split}`; const newValue = inputValue.slice(0, mentionCtx.value.start) + newMiddlePart + newEndPart; emit(UPDATE_MODEL_EVENT, newValue); emit(INPUT_EVENT, newValue); emit("select", getOriginalOption(item), mentionCtx.value.prefix); const newSelectionEnd = mentionCtx.value.start + newMiddlePart.length + (alreadySeparated ? 1 : 0); nextTick(() => { inputEl.selectionStart = newSelectionEnd; inputEl.selectionEnd = newSelectionEnd; inputEl.focus(); syncDropdownVisible(); }); }; const getInputEl = () => { var _a, _b; return props2.type === "textarea" ? (_a = elInputRef.value) == null ? void 0 : _a.textarea : (_b = elInputRef.value) == null ? void 0 : _b.input; }; const syncAfterCursorMove = () => { setTimeout(() => { syncCursor(); syncDropdownVisible(); nextTick(() => { var _a; return (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper(); }); }, 0); }; const syncCursor = () => { const inputEl = getInputEl(); if (!inputEl) return; const caretPosition = getCursorPosition(inputEl); const inputRect = inputEl.getBoundingClientRect(); const wrapperRect = wrapperRef.value.getBoundingClientRect(); cursorStyle.value = { position: "absolute", width: 0, height: `${caretPosition.height}px`, left: `${caretPosition.left + inputRect.left - wrapperRect.left}px`, top: `${caretPosition.top + inputRect.top - wrapperRect.top}px` }; }; const syncDropdownVisible = () => { const inputEl = getInputEl(); if (document.activeElement !== inputEl) { visible.value = false; return; } const { prefix, split } = props2; mentionCtx.value = getMentionCtx(inputEl, prefix, split); if (mentionCtx.value && mentionCtx.value.splitIndex === -1) { visible.value = true; emit("search", mentionCtx.value.pattern, mentionCtx.value.prefix); return; } visible.value = false; }; __expose({ input: elInputRef, tooltip: tooltipRef, dropdownVisible }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "wrapperRef", ref: wrapperRef, class: normalizeClass(unref(ns).b()) }, [createVNode(unref(ElInput), mergeProps(mergeProps(passInputProps.value, _ctx.$attrs), { ref_key: "elInputRef", ref: elInputRef, "model-value": __props.modelValue, disabled: unref(disabled), role: dropdownVisible.value ? "combobox" : void 0, "aria-activedescendant": dropdownVisible.value ? hoveringId.value || "" : void 0, "aria-controls": dropdownVisible.value ? unref(contentId) : void 0, "aria-expanded": dropdownVisible.value || void 0, "aria-label": __props.ariaLabel, "aria-autocomplete": dropdownVisible.value ? "none" : void 0, "aria-haspopup": dropdownVisible.value ? "listbox" : void 0, onInput: handleInputChange, onKeydown: handleInputKeyDown, onMousedown: handleInputMouseDown }), createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, name) => { return { name, fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))]) }; })]), 1040, [ "model-value", "disabled", "role", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "aria-autocomplete", "aria-haspopup" ]), createVNode(unref(ElTooltip), { ref_key: "tooltipRef", ref: tooltipRef, visible: dropdownVisible.value, "popper-class": [unref(ns).e("popper"), __props.popperClass], "popper-style": __props.popperStyle, "popper-options": __props.popperOptions, placement: computedPlacement.value, "fallback-placements": computedFallbackPlacements.value, effect: "light", pure: "", offset: __props.offset, "show-arrow": __props.showArrow }, { default: withCtx(() => [createBaseVNode("div", { style: normalizeStyle(cursorStyle.value) }, null, 4)]), content: withCtx(() => [createVNode(mention_dropdown_default, { ref_key: "dropdownRef", ref: dropdownRef, options: filteredOptions.value, disabled: unref(disabled), loading: __props.loading, "content-id": unref(contentId), "aria-label": __props.ariaLabel, onSelect: handleSelect, onClick: _cache[0] || (_cache[0] = withModifiers(($event) => { var _a; return (_a = elInputRef.value) == null ? void 0 : _a.focus(); }, ["stop"])) }, createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, name) => { return { name, fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))]) }; })]), 1032, [ "options", "disabled", "loading", "content-id", "aria-label" ])]), _: 3 }, 8, [ "visible", "popper-class", "popper-style", "popper-options", "placement", "fallback-placements", "offset", "show-arrow" ])], 2); }; } }); var mention_default = mention_vue_vue_type_script_setup_true_lang_default; const ElMention = withInstall(mention_default); const splitterProps = buildProps({ layout: { type: String, default: "horizontal", values: ["horizontal", "vertical"] }, lazy: Boolean }); const splitterEmits = { resizeStart: (index, sizes) => true, resize: (index, sizes) => true, resizeEnd: (index, sizes) => true, collapse: (index, type, sizes) => true }; const splitterPanelProps = buildProps({ min: { type: [String, Number] }, max: { type: [String, Number] }, size: { type: [String, Number] }, resizable: { type: Boolean, default: true }, collapsible: Boolean }); const splitterPanelEmits = { "update:size": (value) => typeof value === "number" || typeof value === "string" }; function useContainer(layout2) { const containerEl = ref(); const { width, height } = useElementSize(containerEl); return { containerEl, containerSize: computed(() => { return layout2.value === "horizontal" ? width.value : height.value; }) }; } function getPct(str) { return Number(str.slice(0, -1)) / 100; } function getPx(str) { return Number(str.slice(0, -2)); } function isPct(itemSize2) { return isString(itemSize2) && itemSize2.endsWith("%"); } function isPx(itemSize2) { return isString(itemSize2) && itemSize2.endsWith("px"); } function useSize(panels, containerSize) { const propSizes = computed(() => panels.value.map((i) => i.size)); const panelCounts = computed(() => panels.value.length); const percentSizes = ref([]); watch([ propSizes, panelCounts, containerSize ], () => { var _a; let ptgList = []; let emptyCount = 0; for (let i = 0; i < panelCounts.value; i += 1) { const itemSize2 = (_a = panels.value[i]) == null ? void 0 : _a.size; if (isPct(itemSize2)) ptgList[i] = getPct(itemSize2); else if (isPx(itemSize2)) ptgList[i] = getPx(itemSize2) / containerSize.value; else if (itemSize2 || itemSize2 === 0) { const num = Number(itemSize2); if (!Number.isNaN(num)) ptgList[i] = num / containerSize.value; } else { emptyCount += 1; ptgList[i] = void 0; } } const totalPtg = ptgList.reduce((acc, ptg) => acc + (ptg || 0), 0); if (totalPtg > 1 || !emptyCount) { const scale = 1 / totalPtg; ptgList = ptgList.map((ptg) => ptg === void 0 ? 0 : ptg * scale); } else { const avgRest = (1 - totalPtg) / emptyCount; ptgList = ptgList.map((ptg) => ptg === void 0 ? avgRest : ptg); } percentSizes.value = ptgList; }); const ptg2px = (ptg) => ptg * containerSize.value; return { percentSizes, pxSizes: computed(() => percentSizes.value.map(ptg2px)) }; } function useResize(panels, containerSize, pxSizes, lazy) { const ptg2px = (ptg) => ptg * containerSize.value || 0; function getLimitSize(str, defaultLimit) { if (isPct(str)) return ptg2px(getPct(str)); else if (isPx(str)) return getPx(str); return str ?? defaultLimit; } const lazyOffset = ref(0); const movingIndex = ref(null); let cachePxSizes = []; let updatePanelSizes = NOOP; const limitSizes = computed(() => panels.value.map((item) => [item.min, item.max])); watch(lazy, () => { if (lazyOffset.value) { const mouseup = new MouseEvent("mouseup", { bubbles: true }); window.dispatchEvent(mouseup); } }); const onMoveStart = (index) => { lazyOffset.value = 0; movingIndex.value = { index, confirmed: false }; cachePxSizes = pxSizes.value; }; const onMoving = (index, offset2) => { var _a; let confirmedIndex = null; if ((!movingIndex.value || !movingIndex.value.confirmed) && offset2 !== 0) { if (offset2 > 0) { confirmedIndex = index; movingIndex.value = { index, confirmed: true }; } else for (let i = index; i >= 0; i -= 1) if (cachePxSizes[i] > 0) { confirmedIndex = i; movingIndex.value = { index: i, confirmed: true }; break; } } const mergedIndex = confirmedIndex ?? ((_a = movingIndex.value) == null ? void 0 : _a.index) ?? index; const numSizes = [...cachePxSizes]; const nextIndex = mergedIndex + 1; const startMinSize = getLimitSize(limitSizes.value[mergedIndex][0], 0); const endMinSize = getLimitSize(limitSizes.value[nextIndex][0], 0); const startMaxSize = getLimitSize(limitSizes.value[mergedIndex][1], containerSize.value || 0); const endMaxSize = getLimitSize(limitSizes.value[nextIndex][1], containerSize.value || 0); let mergedOffset = offset2; if (numSizes[mergedIndex] + mergedOffset < startMinSize) mergedOffset = startMinSize - numSizes[mergedIndex]; if (numSizes[nextIndex] - mergedOffset < endMinSize) mergedOffset = numSizes[nextIndex] - endMinSize; if (numSizes[mergedIndex] + mergedOffset > startMaxSize) mergedOffset = startMaxSize - numSizes[mergedIndex]; if (numSizes[nextIndex] - mergedOffset > endMaxSize) mergedOffset = numSizes[nextIndex] - endMaxSize; numSizes[mergedIndex] += mergedOffset; numSizes[nextIndex] -= mergedOffset; lazyOffset.value = mergedOffset; updatePanelSizes = () => { panels.value.forEach((panel, index2) => { panel.size = numSizes[index2]; }); updatePanelSizes = NOOP; }; if (!lazy.value) updatePanelSizes(); }; const onMoveEnd = () => { if (lazy.value) updatePanelSizes(); lazyOffset.value = 0; movingIndex.value = null; cachePxSizes = []; }; const cacheCollapsedSize = []; const onCollapse = (index, type) => { if (!cacheCollapsedSize.length) cacheCollapsedSize.push(...pxSizes.value); const currentSizes = pxSizes.value; const currentIndex = type === "start" ? index : index + 1; const targetIndex = type === "start" ? index + 1 : index; const currentSize = currentSizes[currentIndex]; const targetSize = currentSizes[targetIndex]; if (currentSize !== 0 && targetSize !== 0) { currentSizes[currentIndex] = 0; currentSizes[targetIndex] += currentSize; cacheCollapsedSize[index] = currentSize; } else { const totalSize = currentSize + targetSize; const targetCacheCollapsedSize = cacheCollapsedSize[index]; const currentCacheCollapsedSize = totalSize - targetCacheCollapsedSize; currentSizes[targetIndex] = targetCacheCollapsedSize; currentSizes[currentIndex] = currentCacheCollapsedSize; } panels.value.forEach((panel, index2) => { panel.size = currentSizes[index2]; }); }; return { lazyOffset, onMoveStart, onMoving, onMoveEnd, movingIndex, onCollapse }; } const splitterRootContextKey = Symbol("splitterRootContextKey"); var splitter_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElSplitter", __name: "splitter", props: splitterProps, emits: splitterEmits, setup(__props, { emit: __emit }) { const ns = useNamespace("splitter"); const emits = __emit; const props2 = __props; const layout2 = toRef(props2, "layout"); const lazy = toRef(props2, "lazy"); const { containerEl, containerSize } = useContainer(layout2); const { removeChild: unregisterPanel, children: panels, addChild: registerPanel, ChildrenSorter: PanelsSorter } = useOrderedChildren(getCurrentInstance(), "ElSplitterPanel"); watch(panels, () => { movingIndex.value = null; panels.value.forEach((instance, index) => { instance.setIndex(index); }); }); const { percentSizes, pxSizes } = useSize(panels, containerSize); const { lazyOffset, movingIndex, onMoveStart, onMoving, onMoveEnd, onCollapse } = useResize(panels, containerSize, pxSizes, lazy); const splitterStyles = computed(() => { return { [ns.cssVarBlockName("bar-offset")]: lazy.value ? `${lazyOffset.value}px` : void 0 }; }); const onResizeStart = (index) => { onMoveStart(index); emits("resizeStart", index, pxSizes.value); }; const onResize = (index, offset2) => { onMoving(index, offset2); if (!lazy.value) emits("resize", index, pxSizes.value); }; const onResizeEnd = async (index) => { onMoveEnd(); await nextTick(); emits("resizeEnd", index, pxSizes.value); }; const onCollapsible = (index, type) => { onCollapse(index, type); emits("collapse", index, type, pxSizes.value); }; provide(splitterRootContextKey, reactive({ panels, percentSizes, pxSizes, layout: layout2, lazy, movingIndex, containerSize, onMoveStart: onResizeStart, onMoving: onResize, onMoveEnd: onResizeEnd, onCollapse: onCollapsible, registerPanel, unregisterPanel })); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { ref_key: "containerEl", ref: containerEl, class: normalizeClass([unref(ns).b(), unref(ns).e(layout2.value)]), style: normalizeStyle(splitterStyles.value) }, [ renderSlot(_ctx.$slots, "default"), createVNode(unref(PanelsSorter)), createCommentVNode(" Prevent iframe touch events from breaking "), unref(movingIndex) ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass([unref(ns).e("mask"), unref(ns).e(`mask-${layout2.value}`)]) }, null, 2)) : createCommentVNode("v-if", true) ], 6); }; } }); var splitter_default = splitter_vue_vue_type_script_setup_true_lang_default; function getCollapsible(collapsible) { if (collapsible && isObject(collapsible)) return collapsible; return { start: !!collapsible, end: !!collapsible }; } function isCollapsible(panel, size, nextPanel, nextSize) { if ((panel == null ? void 0 : panel.collapsible.end) && size > 0) return true; if ((nextPanel == null ? void 0 : nextPanel.collapsible.start) && nextSize === 0 && size > 0) return true; return false; } var split_bar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElSplitterBar", __name: "split-bar", props: { index: { type: Number, required: true }, layout: { type: String, values: ["horizontal", "vertical"], default: "horizontal" }, resizable: { type: Boolean, default: true }, lazy: Boolean, startCollapsible: Boolean, endCollapsible: Boolean }, emits: [ "moveStart", "moving", "moveEnd", "collapse" ], setup(__props, { emit: __emit }) { const ns = useNamespace("splitter-bar"); const props2 = __props; const emit = __emit; const isHorizontal2 = computed(() => props2.layout === "horizontal"); const barWrapStyles = computed(() => { if (isHorizontal2.value) return { width: 0 }; return { height: 0 }; }); const draggerStyles = computed(() => { return { width: isHorizontal2.value ? "16px" : "100%", height: isHorizontal2.value ? "100%" : "16px", cursor: !props2.resizable ? "auto" : isHorizontal2.value ? "ew-resize" : "ns-resize", touchAction: "none" }; }); const draggerPseudoClass = computed(() => { const prefix = ns.e("dragger"); return { [`${prefix}-horizontal`]: isHorizontal2.value, [`${prefix}-vertical`]: !isHorizontal2.value, [`${prefix}-active`]: !!startPos.value }; }); const startPos = ref(null); const onMousedown = (e) => { if (!props2.resizable) return; startPos.value = [e.pageX, e.pageY]; emit("moveStart", props2.index); window.addEventListener("mouseup", onMouseUp); window.addEventListener("mousemove", onMouseMove); }; const onTouchStart = (e) => { if (props2.resizable && e.touches.length === 1) { e.preventDefault(); const touch = e.touches[0]; startPos.value = [touch.pageX, touch.pageY]; emit("moveStart", props2.index); window.addEventListener("touchend", onTouchEnd); window.addEventListener("touchmove", onTouchMove); } }; const onMouseMove = (e) => { const { pageX, pageY } = e; const offsetX = pageX - startPos.value[0]; const offsetY = pageY - startPos.value[1]; const offset2 = isHorizontal2.value ? offsetX : offsetY; emit("moving", props2.index, offset2); }; const onTouchMove = (e) => { if (e.touches.length === 1) { e.preventDefault(); const touch = e.touches[0]; const offsetX = touch.pageX - startPos.value[0]; const offsetY = touch.pageY - startPos.value[1]; const offset2 = isHorizontal2.value ? offsetX : offsetY; emit("moving", props2.index, offset2); } }; const onMouseUp = () => { startPos.value = null; window.removeEventListener("mouseup", onMouseUp); window.removeEventListener("mousemove", onMouseMove); emit("moveEnd", props2.index); }; const onTouchEnd = () => { startPos.value = null; window.removeEventListener("touchend", onTouchEnd); window.removeEventListener("touchmove", onTouchMove); emit("moveEnd", props2.index); }; const StartIcon = computed(() => isHorizontal2.value ? arrow_left_default : arrow_up_default); const EndIcon = computed(() => isHorizontal2.value ? arrow_right_default : arrow_down_default); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b()]), style: normalizeStyle(barWrapStyles.value) }, [ __props.startCollapsible ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass([unref(ns).e("collapse-icon"), unref(ns).e(`${__props.layout}-collapse-icon-start`)]), onClick: _cache[0] || (_cache[0] = ($event) => emit("collapse", __props.index, "start")) }, [renderSlot(_ctx.$slots, "start-collapsible", {}, () => [(openBlock(), createBlock(resolveDynamicComponent(StartIcon.value), { style: { "width": "12px", "height": "12px" } }))])], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass([ unref(ns).e("dragger"), draggerPseudoClass.value, unref(ns).is("disabled", !__props.resizable), unref(ns).is("lazy", __props.resizable && __props.lazy) ]), style: normalizeStyle(draggerStyles.value), onMousedown, onTouchstart: onTouchStart }, null, 38), __props.endCollapsible ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([unref(ns).e("collapse-icon"), unref(ns).e(`${__props.layout}-collapse-icon-end`)]), onClick: _cache[1] || (_cache[1] = ($event) => emit("collapse", __props.index, "end")) }, [renderSlot(_ctx.$slots, "end-collapsible", {}, () => [(openBlock(), createBlock(resolveDynamicComponent(EndIcon.value), { style: { "width": "12px", "height": "12px" } }))])], 2)) : createCommentVNode("v-if", true) ], 6); }; } }); var split_bar_default = split_bar_vue_vue_type_script_setup_true_lang_default; const COMPONENT_NAME = "ElSplitterPanel"; var split_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: COMPONENT_NAME, __name: "split-panel", props: splitterPanelProps, emits: splitterPanelEmits, setup(__props, { expose: __expose, emit: __emit }) { const ns = useNamespace("splitter-panel"); const props2 = __props; const emits = __emit; const splitterContext = inject(splitterRootContextKey); if (!splitterContext) throwError(COMPONENT_NAME, "usage: "); const { panels, layout: layout2, lazy, containerSize, pxSizes } = toRefs(splitterContext); const { registerPanel, unregisterPanel, onCollapse, onMoveEnd, onMoveStart, onMoving } = splitterContext; const panelEl = ref(); const instance = getCurrentInstance(); const uid2 = instance.uid; const index = ref(0); const panel = computed(() => panels.value[index.value]); const setIndex = (val) => { index.value = val; }; const panelSize = computed(() => { if (!panel.value) return 0; return pxSizes.value[index.value] ?? 0; }); const nextSize = computed(() => { if (!panel.value) return 0; return pxSizes.value[index.value + 1] ?? 0; }); const nextPanel = computed(() => { if (panel.value) return panels.value[index.value + 1]; return null; }); const isResizable = computed(() => { var _a; if (!nextPanel.value) return false; return props2.resizable && ((_a = nextPanel.value) == null ? void 0 : _a.resizable) && (panelSize.value !== 0 || !props2.min) && (nextSize.value !== 0 || !nextPanel.value.min); }); const isShowBar = computed(() => { if (!panel.value) return false; return index.value !== panels.value.length - 1; }); const startCollapsible = computed(() => isCollapsible(panel.value, panelSize.value, nextPanel.value, nextSize.value)); const endCollapsible = computed(() => isCollapsible(nextPanel.value, nextSize.value, panel.value, panelSize.value)); function sizeToPx(str) { if (isPct(str)) return getPct(str) * containerSize.value || 0; else if (isPx(str)) return getPx(str); return str ?? 0; } let isSizeUpdating = false; watch(() => props2.size, () => { if (!isSizeUpdating && panel.value) { if (!containerSize.value) { panel.value.size = props2.size; return; } const size = sizeToPx(props2.size); const maxSize = sizeToPx(props2.max); const minSize = sizeToPx(props2.min); const finalSize = Math.min(Math.max(size, minSize || 0), maxSize || size); if (finalSize !== size) emits("update:size", finalSize); panel.value.size = finalSize; } }); watch(() => { var _a; return (_a = panel.value) == null ? void 0 : _a.size; }, (val) => { if (val !== props2.size) { isSizeUpdating = true; emits("update:size", val); nextTick(() => isSizeUpdating = false); } }); watch(() => props2.resizable, (val) => { if (panel.value) panel.value.resizable = val; }); const _panel = reactive({ uid: uid2, getVnode: () => instance.vnode, setIndex, ...props2, collapsible: computed(() => getCollapsible(props2.collapsible)) }); registerPanel(_panel); onBeforeUnmount(() => unregisterPanel(_panel)); __expose({ splitterPanelRef: panelEl }); return (_ctx, _cache) => { return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("div", mergeProps({ ref_key: "panelEl", ref: panelEl, class: [unref(ns).b()], style: { flexBasis: `${panelSize.value}px` } }, _ctx.$attrs), [renderSlot(_ctx.$slots, "default")], 16), isShowBar.value ? (openBlock(), createBlock(split_bar_default, { key: 0, index: index.value, layout: unref(layout2), lazy: unref(lazy), resizable: isResizable.value, "start-collapsible": startCollapsible.value, "end-collapsible": endCollapsible.value, onMoveStart: unref(onMoveStart), onMoving: unref(onMoving), onMoveEnd: unref(onMoveEnd), onCollapse: unref(onCollapse) }, { "start-collapsible": withCtx(() => [renderSlot(_ctx.$slots, "start-collapsible")]), "end-collapsible": withCtx(() => [renderSlot(_ctx.$slots, "end-collapsible")]), _: 3 }, 8, [ "index", "layout", "lazy", "resizable", "start-collapsible", "end-collapsible", "onMoveStart", "onMoving", "onMoveEnd", "onCollapse" ])) : createCommentVNode("v-if", true)], 64); }; } }); var split_panel_default = split_panel_vue_vue_type_script_setup_true_lang_default; const ElSplitter = withInstall(splitter_default, { SplitPanel: split_panel_default }); const ElSplitterPanel = withNoopInstall(split_panel_default); const version = "2.13.7"; const makeInstaller = (components = []) => { const install = (app, options) => { if (app[INSTALLED_KEY]) return; app[INSTALLED_KEY] = true; components.forEach((c) => app.use(c)); if (options) provideGlobalConfig(options, app, true); }; return { version, install }; }; const SCOPE = "ElInfiniteScroll"; const CHECK_INTERVAL = 50; const DEFAULT_DELAY = 200; const DEFAULT_DISTANCE = 0; const attributes = { delay: { type: Number, default: DEFAULT_DELAY }, distance: { type: Number, default: DEFAULT_DISTANCE }, disabled: { type: Boolean, default: false }, immediate: { type: Boolean, default: true } }; const getScrollOptions = (el, instance) => { return Object.entries(attributes).reduce((acm, [name, option]) => { const { type, default: defaultValue } = option; const attrVal = el.getAttribute(`infinite-scroll-${name}`); let value = instance[attrVal] ?? attrVal ?? defaultValue; value = value === "false" ? false : value; value = type(value); acm[name] = Number.isNaN(value) ? defaultValue : value; return acm; }, {}); }; const destroyObserver = (el) => { const { observer } = el[SCOPE]; if (observer) { observer.disconnect(); delete el[SCOPE].observer; } }; const handleScroll = (el, cb) => { const { container, containerEl, instance, observer, lastScrollTop } = el[SCOPE]; const { disabled, distance } = getScrollOptions(el, instance); const { clientHeight, scrollHeight, scrollTop } = containerEl; const delta = scrollTop - lastScrollTop; el[SCOPE].lastScrollTop = scrollTop; if (observer || disabled || delta < 0) return; let shouldTrigger = false; if (container === el) shouldTrigger = scrollHeight - (clientHeight + scrollTop) <= distance; else { const { clientTop, scrollHeight: height } = el; const offsetTop = getOffsetTopDistance(el, containerEl); shouldTrigger = scrollTop + clientHeight >= offsetTop + clientTop + height - distance; } if (shouldTrigger) cb.call(instance); }; function checkFull(el, cb) { const { containerEl, instance } = el[SCOPE]; const { disabled } = getScrollOptions(el, instance); if (disabled || containerEl.clientHeight === 0) return; if (containerEl.scrollHeight <= containerEl.clientHeight) cb.call(instance); else destroyObserver(el); } const InfiniteScroll = { async mounted(el, binding) { const { instance, value: cb } = binding; useDeprecated({ scope: SCOPE, from: "the directive v-infinite-scroll", replacement: "the el-scrollbar infinite scroll", version: "3.0.0", ref: "https://element-plus.org/en-US/component/scrollbar#infinite-scroll" }, true); if (!isFunction(cb)) throwError(SCOPE, "'v-infinite-scroll' binding value must be a function"); await nextTick(); const { delay, immediate } = getScrollOptions(el, instance); const container = getScrollContainer(el, true); const containerEl = container === window ? document.documentElement : container; const onScroll = throttle(handleScroll.bind(null, el, cb), delay); if (!container) return; el[SCOPE] = { instance, container, containerEl, delay, cb, onScroll, lastScrollTop: containerEl.scrollTop }; if (immediate) { const observer = new MutationObserver(throttle(checkFull.bind(null, el, cb), CHECK_INTERVAL)); el[SCOPE].observer = observer; observer.observe(el, { childList: true, subtree: true }); checkFull(el, cb); } container.addEventListener("scroll", onScroll); }, unmounted(el) { if (!el[SCOPE]) return; const { container, onScroll } = el[SCOPE]; container == null ? void 0 : container.removeEventListener("scroll", onScroll); destroyObserver(el); }, async updated(el) { if (!el[SCOPE]) await nextTick(); else { const { containerEl, cb, observer } = el[SCOPE]; if (containerEl.clientHeight && observer) checkFull(el, cb); } } }; const _InfiniteScroll = InfiniteScroll; _InfiniteScroll.install = (app) => { app.directive("InfiniteScroll", _InfiniteScroll); }; const ElInfiniteScroll = _InfiniteScroll; function createLoadingComponent(options, appContext) { let afterLeaveTimer; const afterLeaveFlag = ref(false); const data = reactive({ ...options, originalPosition: "", originalOverflow: "", visible: false }); function setText(text) { data.text = text; } function destroySelf() { const target = data.parent; const ns = vm.ns; if (!target.vLoadingAddClassList) { let loadingNumber = target.getAttribute("loading-number"); loadingNumber = Number.parseInt(loadingNumber) - 1; if (!loadingNumber) { removeClass(target, ns.bm("parent", "relative")); target.removeAttribute("loading-number"); } else target.setAttribute("loading-number", loadingNumber.toString()); removeClass(target, ns.bm("parent", "hidden")); } removeElLoadingChild(); loadingInstance.unmount(); } function removeElLoadingChild() { var _a, _b; (_b = (_a = vm.$el) == null ? void 0 : _a.parentNode) == null ? void 0 : _b.removeChild(vm.$el); } function close2() { var _a; if (options.beforeClose && !options.beforeClose()) return; afterLeaveFlag.value = true; clearTimeout(afterLeaveTimer); afterLeaveTimer = setTimeout(handleAfterLeave, 400); data.visible = false; (_a = options.closed) == null ? void 0 : _a.call(options); } function handleAfterLeave() { if (!afterLeaveFlag.value) return; const target = data.parent; afterLeaveFlag.value = false; target.vLoadingAddClassList = void 0; destroySelf(); } const loadingInstance = createApp(defineComponent({ name: "ElLoading", setup(_, { expose }) { const { ns, zIndex: zIndex2 } = useGlobalComponentSettings("loading"); expose({ ns, zIndex: zIndex2 }); return () => { const svg = data.spinner || data.svg; const spinner = h("svg", { class: "circular", viewBox: data.svgViewBox ? data.svgViewBox : "0 0 50 50", ...svg ? { innerHTML: svg } : {} }, [h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" })]); const spinnerText = data.text ? h("p", { class: ns.b("text") }, [data.text]) : void 0; return h(Transition, { name: ns.b("fade"), onAfterLeave: handleAfterLeave }, { default: withCtx(() => [withDirectives(createVNode("div", { style: { backgroundColor: data.background || "" }, class: [ ns.b("mask"), data.customClass, ns.is("fullscreen", data.fullscreen) ] }, [h("div", { class: ns.b("spinner") }, [spinner, spinnerText])]), [[vShow, data.visible]])]) }); }; } })); Object.assign(loadingInstance._context, appContext ?? {}); const vm = loadingInstance.mount(document.createElement("div")); return { ...toRefs(data), setText, removeElLoadingChild, close: close2, handleAfterLeave, vm, get $el() { return vm.$el; } }; } let fullscreenInstance = void 0; const Loading = function(options = {}, context) { if (!isClient) return void 0; const resolved = resolveOptions(options); if (resolved.fullscreen && fullscreenInstance) return fullscreenInstance; const instance = createLoadingComponent({ ...resolved, closed: () => { var _a; (_a = resolved.closed) == null ? void 0 : _a.call(resolved); if (resolved.fullscreen) fullscreenInstance = void 0; } }, context ?? Loading._context); addStyle(resolved, resolved.parent, instance); addClassList(resolved, resolved.parent, instance); resolved.parent.vLoadingAddClassList = () => addClassList(resolved, resolved.parent, instance); let loadingNumber = resolved.parent.getAttribute("loading-number"); if (!loadingNumber) loadingNumber = "1"; else loadingNumber = `${Number.parseInt(loadingNumber) + 1}`; resolved.parent.setAttribute("loading-number", loadingNumber); resolved.parent.appendChild(instance.$el); nextTick(() => instance.visible.value = resolved.visible); if (resolved.fullscreen) fullscreenInstance = instance; return instance; }; const resolveOptions = (options) => { let target; if (isString(options.target)) target = document.querySelector(options.target) ?? document.body; else target = options.target || document.body; return { parent: target === document.body || options.body ? document.body : target, background: options.background || "", svg: options.svg || "", svgViewBox: options.svgViewBox || "", spinner: options.spinner || false, text: options.text || "", fullscreen: target === document.body && (options.fullscreen ?? true), lock: options.lock ?? false, customClass: options.customClass || "", visible: options.visible ?? true, beforeClose: options.beforeClose, closed: options.closed, target }; }; const addStyle = async (options, parent, instance) => { const { nextZIndex } = instance.vm.zIndex || instance.vm._.exposed.zIndex; const maskStyle = {}; if (options.fullscreen) { instance.originalPosition.value = getStyle(document.body, "position"); instance.originalOverflow.value = getStyle(document.body, "overflow"); maskStyle.zIndex = nextZIndex(); } else if (options.parent === document.body) { instance.originalPosition.value = getStyle(document.body, "position"); await nextTick(); for (const property of ["top", "left"]) { const scroll = property === "top" ? "scrollTop" : "scrollLeft"; maskStyle[property] = `${options.target.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] - Number.parseInt(getStyle(document.body, `margin-${property}`), 10)}px`; } for (const property of ["height", "width"]) maskStyle[property] = `${options.target.getBoundingClientRect()[property]}px`; } else instance.originalPosition.value = getStyle(parent, "position"); for (const [key, value] of Object.entries(maskStyle)) instance.$el.style[key] = value; }; const addClassList = (options, parent, instance) => { const ns = instance.vm.ns || instance.vm._.exposed.ns; if (![ "absolute", "fixed", "sticky" ].includes(instance.originalPosition.value)) addClass(parent, ns.bm("parent", "relative")); else removeClass(parent, ns.bm("parent", "relative")); if (options.fullscreen && options.lock) addClass(parent, ns.bm("parent", "hidden")); else removeClass(parent, ns.bm("parent", "hidden")); }; Loading._context = null; const INSTANCE_KEY = Symbol("ElLoading"); const getAttributeName = (name) => { return `element-loading-${hyphenate(name)}`; }; const createInstance = (el, binding) => { const vm = binding.instance; const getBindingProp = (key) => isObject(binding.value) ? binding.value[key] : void 0; const resolveExpression = (key) => { return ref(isString(key) && (vm == null ? void 0 : vm[key]) || key); }; const getProp2 = (name) => resolveExpression(getBindingProp(name) || el.getAttribute(getAttributeName(name))); const fullscreen = getBindingProp("fullscreen") ?? binding.modifiers.fullscreen; const options = { text: getProp2("text"), svg: getProp2("svg"), svgViewBox: getProp2("svgViewBox"), spinner: getProp2("spinner"), background: getProp2("background"), customClass: getProp2("customClass"), fullscreen, target: getBindingProp("target") ?? (fullscreen ? void 0 : el), body: getBindingProp("body") ?? binding.modifiers.body, lock: getBindingProp("lock") ?? binding.modifiers.lock }; const instance = Loading(options); instance._context = vLoading._context; el[INSTANCE_KEY] = { options, instance }; }; const updateOptions = (originalOptions, newOptions) => { for (const key of Object.keys(originalOptions)) if (isRef(originalOptions[key])) originalOptions[key].value = newOptions[key]; }; const vLoading = { mounted(el, binding) { if (binding.value) createInstance(el, binding); }, updated(el, binding) { const instance = el[INSTANCE_KEY]; if (!binding.value) { instance == null ? void 0 : instance.instance.close(); el[INSTANCE_KEY] = null; return; } if (!instance) createInstance(el, binding); else updateOptions(instance.options, isObject(binding.value) ? binding.value : { text: el.getAttribute(getAttributeName("text")), svg: el.getAttribute(getAttributeName("svg")), svgViewBox: el.getAttribute(getAttributeName("svgViewBox")), spinner: el.getAttribute(getAttributeName("spinner")), background: el.getAttribute(getAttributeName("background")), customClass: el.getAttribute(getAttributeName("customClass")) }); }, unmounted(el) { var _a; (_a = el[INSTANCE_KEY]) == null ? void 0 : _a.instance.close(); el[INSTANCE_KEY] = null; } }; vLoading._context = null; const ElLoading = { install(app) { Loading._context = app._context; vLoading._context = app._context; app.directive("loading", vLoading); app.config.globalProperties.$loading = Loading; }, directive: vLoading, service: Loading }; const messageTypes = [ "primary", "success", "info", "warning", "error" ]; const messagePlacement = [ "top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right" ]; const MESSAGE_DEFAULT_PLACEMENT = "top"; const messageDefaults = mutable({ customClass: "", dangerouslyUseHTMLString: false, duration: 3e3, icon: void 0, id: "", message: "", onClose: void 0, showClose: false, type: "info", plain: false, offset: 16, placement: void 0, zIndex: 0, grouping: false, repeatNum: 1, appendTo: isClient ? document.body : void 0 }); const messageProps = buildProps({ customClass: { type: String, default: messageDefaults.customClass }, dangerouslyUseHTMLString: { type: Boolean, default: messageDefaults.dangerouslyUseHTMLString }, duration: { type: Number, default: messageDefaults.duration }, icon: { type: iconPropType, default: messageDefaults.icon }, id: { type: String, default: messageDefaults.id }, message: { type: definePropType([ String, Object, Function ]), default: messageDefaults.message }, onClose: { type: definePropType(Function), default: messageDefaults.onClose }, showClose: { type: Boolean, default: messageDefaults.showClose }, type: { type: String, values: messageTypes, default: messageDefaults.type }, plain: { type: Boolean, default: messageDefaults.plain }, offset: { type: Number, default: messageDefaults.offset }, placement: { type: String, values: messagePlacement, default: messageDefaults.placement }, zIndex: { type: Number, default: messageDefaults.zIndex }, grouping: { type: Boolean, default: messageDefaults.grouping }, repeatNum: { type: Number, default: messageDefaults.repeatNum } }); const messageEmits = { destroy: () => true }; const placementInstances = shallowReactive({}); const getOrCreatePlacementInstances = (placement) => { if (!placementInstances[placement]) placementInstances[placement] = shallowReactive([]); return placementInstances[placement]; }; const getInstance = (id, placement) => { const instances = placementInstances[placement] || []; const idx = instances.findIndex((instance) => instance.id === id); const current = instances[idx]; let prev; if (idx > 0) prev = instances[idx - 1]; return { current, prev }; }; const getLastOffset = (id, placement) => { const { prev } = getInstance(id, placement); if (!prev) return 0; return prev.vm.exposed.bottom.value; }; const getOffsetOrSpace = (id, offset2, placement) => { return (placementInstances[placement] || []).findIndex((instance) => instance.id === id) > 0 ? 16 : offset2; }; const _hoisted_1$2 = ["id"]; const _hoisted_2$2 = ["innerHTML"]; var message_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElMessage", __name: "message", props: messageProps, emits: messageEmits, setup(__props, { expose: __expose, emit: __emit }) { const { Close } = TypeComponents; const props2 = __props; const emit = __emit; const isStartTransition = ref(false); const { ns, zIndex: zIndex2 } = useGlobalComponentSettings("message"); const { currentZIndex, nextZIndex } = zIndex2; const messageRef = ref(); const visible = ref(false); const height = ref(0); let stopTimer = void 0; const badgeType = computed(() => props2.type ? props2.type === "error" ? "danger" : props2.type : "info"); const typeClass = computed(() => { const type = props2.type; return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] }; }); const iconComponent = computed(() => props2.icon || TypeComponentsMap[props2.type] || ""); const placement = computed(() => props2.placement || MESSAGE_DEFAULT_PLACEMENT); const lastOffset = computed(() => getLastOffset(props2.id, placement.value)); const offset2 = computed(() => { return Math.max(getOffsetOrSpace(props2.id, props2.offset, placement.value) + lastOffset.value, props2.offset); }); const bottom = computed(() => height.value + offset2.value); const horizontalClass = computed(() => { if (placement.value.includes("left")) return ns.is("left"); if (placement.value.includes("right")) return ns.is("right"); return ns.is("center"); }); const verticalProperty = computed(() => placement.value.startsWith("top") ? "top" : "bottom"); const customStyle = computed(() => ({ [verticalProperty.value]: `${offset2.value}px`, zIndex: currentZIndex.value })); function startTimer() { if (props2.duration === 0) return; ({ stop: stopTimer } = useTimeoutFn(() => { close2(); }, props2.duration)); } function clearTimer() { stopTimer == null ? void 0 : stopTimer(); } function close2() { visible.value = false; nextTick(() => { var _a; if (!isStartTransition.value) { (_a = props2.onClose) == null ? void 0 : _a.call(props2); emit("destroy"); } }); } function keydown(event) { if (getEventCode(event) === EVENT_CODE.esc) close2(); } onMounted(() => { startTimer(); nextZIndex(); visible.value = true; }); watch(() => props2.repeatNum, () => { clearTimer(); startTimer(); }); useEventListener(document, "keydown", keydown); useResizeObserver(messageRef, () => { height.value = messageRef.value.getBoundingClientRect().height; }); __expose({ visible, bottom, close: close2 }); return (_ctx, _cache) => { return openBlock(), createBlock(Transition, { name: unref(ns).b("fade"), onBeforeEnter: _cache[0] || (_cache[0] = ($event) => isStartTransition.value = true), onBeforeLeave: __props.onClose, onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")), persisted: "" }, { default: withCtx(() => [withDirectives(createBaseVNode("div", { id: __props.id, ref_key: "messageRef", ref: messageRef, class: normalizeClass([ unref(ns).b(), { [unref(ns).m(__props.type)]: __props.type }, unref(ns).is("closable", __props.showClose), unref(ns).is("plain", __props.plain), unref(ns).is("bottom", verticalProperty.value === "bottom"), horizontalClass.value, __props.customClass ]), style: normalizeStyle(customStyle.value), role: "alert", onMouseenter: clearTimer, onMouseleave: startTimer }, [ __props.repeatNum > 1 ? (openBlock(), createBlock(unref(ElBadge), { key: 0, value: __props.repeatNum, type: badgeType.value, class: normalizeClass(unref(ns).e("badge")) }, null, 8, [ "value", "type", "class" ])) : createCommentVNode("v-if", true), iconComponent.value ? (openBlock(), createBlock(unref(ElIcon), { key: 1, class: normalizeClass([unref(ns).e("icon"), typeClass.value]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(iconComponent.value)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default", {}, () => [!__props.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", { key: 0, class: normalizeClass(unref(ns).e("content")) }, toDisplayString(__props.message), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "), createBaseVNode("p", { class: normalizeClass(unref(ns).e("content")), innerHTML: __props.message }, null, 10, _hoisted_2$2)], 2112))]), __props.showClose ? (openBlock(), createBlock(unref(ElIcon), { key: 2, class: normalizeClass(unref(ns).e("closeBtn")), onClick: withModifiers(close2, ["stop"]) }, { default: withCtx(() => [createVNode(unref(Close))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 46, _hoisted_1$2), [[vShow, visible.value]])]), _: 3 }, 8, ["name", "onBeforeLeave"]); }; } }); var message_default = message_vue_vue_type_script_setup_true_lang_default; let seed$1 = 1; const normalizeAppendTo = (normalized) => { if (!normalized.appendTo) normalized.appendTo = document.body; else if (isString(normalized.appendTo)) { let appendTo = document.querySelector(normalized.appendTo); if (!isElement(appendTo)) { debugWarn("ElMessage", "the appendTo option is not an HTMLElement. Falling back to document.body."); appendTo = document.body; } normalized.appendTo = appendTo; } }; const normalizePlacement = (normalized) => { if (!normalized.placement && isString(messageConfig.placement) && messageConfig.placement) normalized.placement = messageConfig.placement; if (!normalized.placement) normalized.placement = MESSAGE_DEFAULT_PLACEMENT; if (!messagePlacement.includes(normalized.placement)) { debugWarn("ElMessage", `Invalid placement: ${normalized.placement}. Falling back to '${MESSAGE_DEFAULT_PLACEMENT}'.`); normalized.placement = MESSAGE_DEFAULT_PLACEMENT; } }; const normalizeOptions = (params) => { const options = !params || isString(params) || isVNode(params) || isFunction(params) ? { message: params } : params; const normalized = { ...messageDefaults, ...options }; normalizeAppendTo(normalized); normalizePlacement(normalized); if (isBoolean(messageConfig.grouping) && !normalized.grouping) normalized.grouping = messageConfig.grouping; if (isNumber(messageConfig.duration) && normalized.duration === 3e3) normalized.duration = messageConfig.duration; if (isNumber(messageConfig.offset) && normalized.offset === 16) normalized.offset = messageConfig.offset; if (isBoolean(messageConfig.showClose) && !normalized.showClose) normalized.showClose = messageConfig.showClose; if (isBoolean(messageConfig.plain) && !normalized.plain) normalized.plain = messageConfig.plain; return normalized; }; const closeMessage = (instance) => { const instances = placementInstances[instance.props.placement || MESSAGE_DEFAULT_PLACEMENT]; const idx = instances.indexOf(instance); if (idx === -1) return; instances.splice(idx, 1); const { handler } = instance; handler.close(); }; const createMessage = ({ appendTo, ...options }, context) => { const id = `message_${seed$1++}`; const userOnClose = options.onClose; const container = document.createElement("div"); const props2 = { ...options, id, onClose: () => { userOnClose == null ? void 0 : userOnClose(); closeMessage(instance); }, onDestroy: () => { render(null, container); } }; const vnode = createVNode(message_default, props2, isFunction(props2.message) || isVNode(props2.message) ? { default: isFunction(props2.message) ? props2.message : () => props2.message } : null); vnode.appContext = context || message._context; render(vnode, container); appendTo.appendChild(container.firstElementChild); const vm = vnode.component; const instance = { id, vnode, vm, handler: { close: () => { vm.exposed.close(); } }, props: vnode.component.props }; return instance; }; const message = (options = {}, context) => { if (!isClient) return { close: () => void 0 }; const normalized = normalizeOptions(options); const instances = getOrCreatePlacementInstances(normalized.placement || MESSAGE_DEFAULT_PLACEMENT); if (normalized.grouping && instances.length) { const instance2 = instances.find(({ vnode: vm }) => { var _a; return ((_a = vm.props) == null ? void 0 : _a.message) === normalized.message; }); if (instance2) { instance2.props.repeatNum += 1; instance2.props.type = normalized.type; return instance2.handler; } } if (isNumber(messageConfig.max) && instances.length >= messageConfig.max) return { close: () => void 0 }; const instance = createMessage(normalized, context); instances.push(instance); return instance.handler; }; messageTypes.forEach((type) => { message[type] = (options = {}, appContext) => { return message({ ...normalizeOptions(options), type }, appContext); }; }); function closeAll$1(type) { for (const placement in placementInstances) if (hasOwn(placementInstances, placement)) { const instances = [...placementInstances[placement]]; for (const instance of instances) if (!type || type === instance.props.type) instance.handler.close(); } } function closeAllByPlacement(placement) { if (!placementInstances[placement]) return; [...placementInstances[placement]].forEach((instance) => instance.handler.close()); } message.closeAll = closeAll$1; message.closeAllByPlacement = closeAllByPlacement; message._context = null; const ElMessage = withInstallFunction(message, "$message"); var index_vue_vue_type_script_lang_default = defineComponent({ name: "ElMessageBox", directives: { TrapFocus }, components: { ElButton, ElFocusTrap: focus_trap_default$1, ElInput, ElOverlay, ElIcon, ...TypeComponents }, inheritAttrs: false, props: { buttonSize: { type: String, validator: isValidComponentSize }, modal: { type: Boolean, default: true }, lockScroll: { type: Boolean, default: true }, showClose: { type: Boolean, default: true }, closeOnClickModal: { type: Boolean, default: true }, closeOnPressEscape: { type: Boolean, default: true }, closeOnHashChange: { type: Boolean, default: true }, center: Boolean, draggable: Boolean, overflow: Boolean, roundButton: Boolean, container: { type: String, default: "body" }, boxType: { type: String, default: "" } }, emits: ["vanish", "action"], setup(props2, { emit }) { const { locale, zIndex: zIndex2, ns, size: btnSize } = useGlobalComponentSettings("message-box", computed(() => props2.buttonSize)); const { t } = locale; const { nextZIndex } = zIndex2; const visible = ref(false); const state = reactive({ autofocus: true, beforeClose: null, callback: null, cancelButtonText: "", cancelButtonClass: "", confirmButtonText: "", confirmButtonClass: "", cancelButtonType: "", confirmButtonType: "primary", customClass: "", customStyle: {}, dangerouslyUseHTMLString: false, distinguishCancelAndClose: false, icon: "", closeIcon: "", inputPattern: null, inputPlaceholder: "", inputType: "text", inputValue: "", inputValidator: void 0, inputErrorMessage: "", message: "", modalFade: true, modalClass: "", showCancelButton: false, showConfirmButton: true, type: "", title: void 0, showInput: false, action: "", confirmButtonLoading: false, cancelButtonLoading: false, confirmButtonLoadingIcon: markRaw(loading_default), cancelButtonLoadingIcon: markRaw(loading_default), confirmButtonDisabled: false, editorErrorMessage: "", validateError: false, zIndex: nextZIndex() }); const typeClass = computed(() => { const type = state.type; return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] }; }); const contentId = useId(); const inputId = useId(); const iconComponent = computed(() => { const type = state.type; return state.icon || type && TypeComponentsMap[type] || ""; }); const hasMessage = computed(() => !!state.message); const rootRef = ref(); const headerRef = ref(); const focusStartRef = ref(); const inputRef = ref(); const confirmRef = ref(); const confirmButtonClasses = computed(() => state.confirmButtonClass); watch(() => state.inputValue, async (val) => { await nextTick(); if (props2.boxType === "prompt" && val) validate(); }, { immediate: true }); watch(() => visible.value, (val) => { var _a; if (val) { if (props2.boxType !== "prompt") if (state.autofocus) focusStartRef.value = ((_a = confirmRef.value) == null ? void 0 : _a.$el) ?? rootRef.value; else focusStartRef.value = rootRef.value; state.zIndex = nextZIndex(); } if (props2.boxType !== "prompt") return; if (val) nextTick().then(() => { if (inputRef.value && inputRef.value.$el) if (state.autofocus) focusStartRef.value = getInputElement() ?? rootRef.value; else focusStartRef.value = rootRef.value; }); else { state.editorErrorMessage = ""; state.validateError = false; } }); const { isDragging: isDragging2 } = useDraggable(rootRef, headerRef, computed(() => props2.draggable), computed(() => props2.overflow)); onMounted(async () => { await nextTick(); if (props2.closeOnHashChange) window.addEventListener("hashchange", doClose); }); onBeforeUnmount(() => { if (props2.closeOnHashChange) window.removeEventListener("hashchange", doClose); }); function doClose() { if (!visible.value) return; visible.value = false; nextTick(() => { if (state.action) emit("action", state.action); }); } const handleWrapperClick = () => { if (props2.closeOnClickModal) handleAction(state.distinguishCancelAndClose ? "close" : "cancel"); }; const overlayEvent = useSameTarget(handleWrapperClick); const handleInputEnter = (e) => { var _a; if (state.inputType !== "textarea" && !((_a = inputRef.value) == null ? void 0 : _a.isComposing)) { e.preventDefault(); return handleAction("confirm"); } }; const handleAction = (action) => { var _a; if (props2.boxType === "prompt" && action === "confirm" && !validate()) return; state.action = action; if (state.beforeClose) (_a = state.beforeClose) == null ? void 0 : _a.call(state, action, state, doClose); else doClose(); }; const validate = () => { if (props2.boxType === "prompt") { const inputPattern = state.inputPattern; if (inputPattern && !inputPattern.test(state.inputValue || "")) { state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error"); state.validateError = true; return false; } const inputValidator = state.inputValidator; if (isFunction(inputValidator)) { const validateResult = inputValidator(state.inputValue); if (validateResult === false) { state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error"); state.validateError = true; return false; } if (isString(validateResult)) { state.editorErrorMessage = validateResult; state.validateError = true; return false; } } } state.editorErrorMessage = ""; state.validateError = false; return true; }; const getInputElement = () => { var _a; const inputRefs = (_a = inputRef.value) == null ? void 0 : _a.$refs; return (inputRefs == null ? void 0 : inputRefs.input) ?? (inputRefs == null ? void 0 : inputRefs.textarea); }; const handleClose = () => { handleAction("close"); }; const onCloseRequested = () => { if (props2.closeOnPressEscape) handleClose(); }; if (props2.lockScroll) useLockscreen(visible, { ns }); return { ...toRefs(state), ns, overlayEvent, visible, hasMessage, typeClass, contentId, inputId, btnSize, iconComponent, confirmButtonClasses, rootRef, focusStartRef, headerRef, inputRef, isDragging: isDragging2, confirmRef, doClose, handleClose, onCloseRequested, handleWrapperClick, handleInputEnter, handleAction, t }; } }); const _hoisted_1$1 = ["aria-label", "aria-describedby"]; const _hoisted_2$1 = ["aria-label"]; const _hoisted_3$1 = ["id"]; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_icon = resolveComponent("el-icon"); const _component_el_input = resolveComponent("el-input"); const _component_el_button = resolveComponent("el-button"); const _component_el_focus_trap = resolveComponent("el-focus-trap"); const _component_el_overlay = resolveComponent("el-overlay"); return openBlock(), createBlock(Transition, { name: "fade-in-linear", onAfterLeave: _cache[11] || (_cache[11] = ($event) => _ctx.$emit("vanish")), persisted: "" }, { default: withCtx(() => [withDirectives(createVNode(_component_el_overlay, { "z-index": _ctx.zIndex, "overlay-class": [_ctx.ns.is("message-box"), _ctx.modalClass], mask: _ctx.modal }, { default: withCtx(() => [createBaseVNode("div", { role: "dialog", "aria-label": _ctx.title, "aria-modal": "true", "aria-describedby": !_ctx.showInput ? _ctx.contentId : void 0, class: normalizeClass(`${_ctx.ns.namespace.value}-overlay-message-box`), onClick: _cache[8] || (_cache[8] = (...args) => _ctx.overlayEvent.onClick && _ctx.overlayEvent.onClick(...args)), onMousedown: _cache[9] || (_cache[9] = (...args) => _ctx.overlayEvent.onMousedown && _ctx.overlayEvent.onMousedown(...args)), onMouseup: _cache[10] || (_cache[10] = (...args) => _ctx.overlayEvent.onMouseup && _ctx.overlayEvent.onMouseup(...args)) }, [createVNode(_component_el_focus_trap, { loop: "", trapped: _ctx.visible, "focus-trap-el": _ctx.rootRef, "focus-start-el": _ctx.focusStartRef, onReleaseRequested: _ctx.onCloseRequested }, { default: withCtx(() => [createBaseVNode("div", { ref: "rootRef", class: normalizeClass([ _ctx.ns.b(), _ctx.customClass, _ctx.ns.is("draggable", _ctx.draggable), _ctx.ns.is("dragging", _ctx.isDragging), { [_ctx.ns.m("center")]: _ctx.center } ]), style: normalizeStyle(_ctx.customStyle), tabindex: "-1", onClick: _cache[7] || (_cache[7] = withModifiers(() => { }, ["stop"])) }, [ _ctx.title !== null && _ctx.title !== void 0 ? (openBlock(), createElementBlock("div", { key: 0, ref: "headerRef", class: normalizeClass([_ctx.ns.e("header"), { "show-close": _ctx.showClose }]) }, [createBaseVNode("div", { class: normalizeClass(_ctx.ns.e("title")) }, [_ctx.iconComponent && _ctx.center ? (openBlock(), createBlock(_component_el_icon, { key: 0, class: normalizeClass([_ctx.ns.e("status"), _ctx.typeClass]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), createBaseVNode("span", null, toDisplayString(_ctx.title), 1)], 2), _ctx.showClose ? (openBlock(), createElementBlock("button", { key: 0, type: "button", class: normalizeClass(_ctx.ns.e("headerbtn")), "aria-label": _ctx.t("el.messagebox.close"), onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel")), onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"])) }, [createVNode(_component_el_icon, { class: normalizeClass(_ctx.ns.e("close")) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || "close")))]), _: 1 }, 8, ["class"])], 42, _hoisted_2$1)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { id: _ctx.contentId, class: normalizeClass(_ctx.ns.e("content")) }, [createBaseVNode("div", { class: normalizeClass(_ctx.ns.e("container")) }, [_ctx.iconComponent && !_ctx.center && _ctx.hasMessage ? (openBlock(), createBlock(_component_el_icon, { key: 0, class: normalizeClass([_ctx.ns.e("status"), _ctx.typeClass]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), _ctx.hasMessage ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(_ctx.ns.e("message")) }, [renderSlot(_ctx.$slots, "default", {}, () => [!_ctx.dangerouslyUseHTMLString ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.showInput ? "label" : "p"), { key: 0, for: _ctx.showInput ? _ctx.inputId : void 0, textContent: toDisplayString(_ctx.message) }, null, 8, ["for", "textContent"])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.showInput ? "label" : "p"), { key: 1, for: _ctx.showInput ? _ctx.inputId : void 0, innerHTML: _ctx.message }, null, 8, ["for", "innerHTML"]))])], 2)) : createCommentVNode("v-if", true)], 2), withDirectives(createBaseVNode("div", { class: normalizeClass(_ctx.ns.e("input")) }, [createVNode(_component_el_input, { id: _ctx.inputId, ref: "inputRef", modelValue: _ctx.inputValue, "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.inputValue = $event), type: _ctx.inputType, placeholder: _ctx.inputPlaceholder, "aria-invalid": _ctx.validateError, class: normalizeClass({ invalid: _ctx.validateError }), onKeydown: withKeys(_ctx.handleInputEnter, ["enter"]) }, null, 8, [ "id", "modelValue", "type", "placeholder", "aria-invalid", "class", "onKeydown" ]), createBaseVNode("div", { class: normalizeClass(_ctx.ns.e("errormsg")), style: normalizeStyle({ visibility: !!_ctx.editorErrorMessage ? "visible" : "hidden" }) }, toDisplayString(_ctx.editorErrorMessage), 7)], 2), [[vShow, _ctx.showInput]])], 10, _hoisted_3$1), createBaseVNode("div", { class: normalizeClass(_ctx.ns.e("btns")) }, [_ctx.showCancelButton ? (openBlock(), createBlock(_component_el_button, { key: 0, type: _ctx.cancelButtonType === "text" ? "" : _ctx.cancelButtonType, text: _ctx.cancelButtonType === "text", loading: _ctx.cancelButtonLoading, "loading-icon": _ctx.cancelButtonLoadingIcon, class: normalizeClass([_ctx.cancelButtonClass]), round: _ctx.roundButton, size: _ctx.btnSize, onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleAction("cancel")), onKeydown: _cache[4] || (_cache[4] = withKeys(withModifiers(($event) => _ctx.handleAction("cancel"), ["prevent"]), ["enter"])) }, { default: withCtx(() => [createTextVNode(toDisplayString(_ctx.cancelButtonText || _ctx.t("el.messagebox.cancel")), 1)]), _: 1 }, 8, [ "type", "text", "loading", "loading-icon", "class", "round", "size" ])) : createCommentVNode("v-if", true), withDirectives(createVNode(_component_el_button, { ref: "confirmRef", type: _ctx.confirmButtonType === "text" ? "" : _ctx.confirmButtonType, text: _ctx.confirmButtonType === "text", loading: _ctx.confirmButtonLoading, "loading-icon": _ctx.confirmButtonLoadingIcon, class: normalizeClass([_ctx.confirmButtonClasses]), round: _ctx.roundButton, disabled: _ctx.confirmButtonDisabled, size: _ctx.btnSize, onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleAction("confirm")), onKeydown: _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => _ctx.handleAction("confirm"), ["prevent"]), ["enter"])) }, { default: withCtx(() => [createTextVNode(toDisplayString(_ctx.confirmButtonText || _ctx.t("el.messagebox.confirm")), 1)]), _: 1 }, 8, [ "type", "text", "loading", "loading-icon", "class", "round", "disabled", "size" ]), [[vShow, _ctx.showConfirmButton]])], 2) ], 6)]), _: 3 }, 8, [ "trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested" ])], 42, _hoisted_1$1)]), _: 3 }, 8, [ "z-index", "overlay-class", "mask" ]), [[vShow, _ctx.visible]])]), _: 3 }); } var src_default = /* @__PURE__ */ _plugin_vue_export_helper_default(index_vue_vue_type_script_lang_default, [["render", _sfc_render]]); const messageInstance = /* @__PURE__ */ new Map(); const getAppendToElement = (props2) => { let appendTo = document.body; if (props2.appendTo) { if (isString(props2.appendTo)) appendTo = document.querySelector(props2.appendTo); if (isElement(props2.appendTo)) appendTo = props2.appendTo; if (!isElement(appendTo)) { debugWarn("ElMessageBox", "the appendTo option is not an HTMLElement. Falling back to document.body."); appendTo = document.body; } } return appendTo; }; const initInstance = (props2, container, appContext = null) => { const vnode = createVNode(src_default, props2, isFunction(props2.message) || isVNode(props2.message) ? { default: isFunction(props2.message) ? props2.message : () => props2.message } : null); vnode.appContext = appContext; render(vnode, container); getAppendToElement(props2).appendChild(container.firstElementChild); return vnode.component; }; const genContainer = () => { return document.createElement("div"); }; const showMessage = (options, appContext) => { const container = genContainer(); options.onVanish = () => { render(null, container); messageInstance.delete(vm); }; options.onAction = (action) => { const currentMsg = messageInstance.get(vm); let resolve; if (options.showInput) resolve = { value: vm.inputValue, action }; else resolve = action; if (options.callback) options.callback(resolve, instance.proxy); else if (action === "cancel" || action === "close") if (options.distinguishCancelAndClose && action !== "cancel") currentMsg.reject("close"); else currentMsg.reject("cancel"); else currentMsg.resolve(resolve); }; const instance = initInstance(options, container, appContext); const vm = instance.proxy; for (const prop in options) if (hasOwn(options, prop) && !hasOwn(vm.$props, prop)) if (prop === "closeIcon" && isObject(options[prop])) vm[prop] = markRaw(options[prop]); else vm[prop] = options[prop]; vm.visible = true; return vm; }; function MessageBox(options, appContext = null) { if (!isClient) return Promise.reject(); let callback; if (isString(options) || isVNode(options)) options = { message: options }; else callback = options.callback; return new Promise((resolve, reject) => { const vm = showMessage(options, appContext ?? MessageBox._context); messageInstance.set(vm, { options, callback, resolve, reject }); }); } const MESSAGE_BOX_VARIANTS = [ "alert", "confirm", "prompt" ]; const MESSAGE_BOX_DEFAULT_OPTS = { alert: { closeOnPressEscape: false, closeOnClickModal: false }, confirm: { showCancelButton: true }, prompt: { showCancelButton: true, showInput: true } }; MESSAGE_BOX_VARIANTS.forEach((boxType) => { MessageBox[boxType] = messageBoxFactory(boxType); }); function messageBoxFactory(boxType) { return (message2, title, options, appContext) => { let titleOrOpts = ""; if (isObject(title)) { options = title; titleOrOpts = ""; } else if (isUndefined(title)) titleOrOpts = ""; else titleOrOpts = title; return MessageBox(Object.assign({ title: titleOrOpts, message: message2, type: "", ...MESSAGE_BOX_DEFAULT_OPTS[boxType] }, options, { boxType }), appContext); }; } MessageBox.close = () => { messageInstance.forEach((_, vm) => { vm.doClose(); }); messageInstance.clear(); }; MessageBox._context = null; const _MessageBox = MessageBox; _MessageBox.install = (app) => { _MessageBox._context = app._context; app.config.globalProperties.$msgbox = _MessageBox; app.config.globalProperties.$messageBox = _MessageBox; app.config.globalProperties.$alert = _MessageBox.alert; app.config.globalProperties.$confirm = _MessageBox.confirm; app.config.globalProperties.$prompt = _MessageBox.prompt; }; const ElMessageBox = _MessageBox; const notificationTypes = [ "primary", "success", "info", "warning", "error" ]; const notificationProps = buildProps({ customClass: { type: String, default: "" }, dangerouslyUseHTMLString: Boolean, duration: { type: Number, default: 4500 }, icon: { type: iconPropType }, id: { type: String, default: "" }, message: { type: definePropType([ String, Object, Function ]), default: "" }, offset: { type: Number, default: 0 }, onClick: { type: definePropType(Function), default: () => void 0 }, onClose: { type: definePropType(Function), required: true }, position: { type: String, values: [ "top-right", "top-left", "bottom-right", "bottom-left" ], default: "top-right" }, showClose: { type: Boolean, default: true }, title: { type: String, default: "" }, type: { type: String, values: [...notificationTypes, ""], default: "" }, zIndex: Number, closeIcon: { type: iconPropType, default: close_default } }); const notificationEmits = { destroy: () => true }; const _hoisted_1 = ["id"]; const _hoisted_2 = ["textContent"]; const _hoisted_3 = { key: 0 }; const _hoisted_4 = ["innerHTML"]; var notification_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ name: "ElNotification", __name: "notification", props: notificationProps, emits: notificationEmits, setup(__props, { expose: __expose }) { const props2 = __props; const { ns, zIndex: zIndex2 } = useGlobalComponentSettings("notification"); const { nextZIndex, currentZIndex } = zIndex2; const visible = ref(false); let timer = void 0; const typeClass = computed(() => { const type = props2.type; return type && TypeComponentsMap[props2.type] ? ns.m(type) : ""; }); const iconComponent = computed(() => { if (!props2.type) return props2.icon; return TypeComponentsMap[props2.type] || props2.icon; }); const horizontalClass = computed(() => props2.position.endsWith("right") ? "right" : "left"); const verticalProperty = computed(() => props2.position.startsWith("top") ? "top" : "bottom"); const positionStyle = computed(() => { return { [verticalProperty.value]: `${props2.offset}px`, zIndex: props2.zIndex ?? currentZIndex.value }; }); function startTimer() { if (props2.duration > 0) ({ stop: timer } = useTimeoutFn(() => { if (visible.value) close2(); }, props2.duration)); } function clearTimer() { timer == null ? void 0 : timer(); } function close2() { visible.value = false; } function onKeydown(event) { switch (getEventCode(event)) { case EVENT_CODE.delete: case EVENT_CODE.backspace: clearTimer(); break; case EVENT_CODE.esc: if (visible.value) close2(); break; default: startTimer(); break; } } onMounted(() => { startTimer(); nextZIndex(); visible.value = true; }); useEventListener(document, "keydown", onKeydown); __expose({ visible, close: close2 }); return (_ctx, _cache) => { return openBlock(), createBlock(Transition, { name: unref(ns).b("fade"), onBeforeLeave: __props.onClose, onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")), persisted: "" }, { default: withCtx(() => [withDirectives(createBaseVNode("div", { id: __props.id, class: normalizeClass([ unref(ns).b(), __props.customClass, horizontalClass.value ]), style: normalizeStyle(positionStyle.value), role: "alert", onMouseenter: clearTimer, onMouseleave: startTimer, onClick: _cache[0] || (_cache[0] = (...args) => __props.onClick && __props.onClick(...args)) }, [iconComponent.value ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass([unref(ns).e("icon"), typeClass.value]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(iconComponent.value)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(ns).e("group")) }, [ createBaseVNode("h2", { class: normalizeClass(unref(ns).e("title")), textContent: toDisplayString(__props.title) }, null, 10, _hoisted_2), withDirectives(createBaseVNode("div", { class: normalizeClass(unref(ns).e("content")), style: normalizeStyle(!!__props.title ? void 0 : { margin: 0 }) }, [renderSlot(_ctx.$slots, "default", {}, () => [!__props.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(__props.message), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "), createBaseVNode("p", { innerHTML: __props.message }, null, 8, _hoisted_4)], 2112))])], 6), [[vShow, __props.message]]), __props.showClose ? (openBlock(), createBlock(unref(ElIcon), { key: 0, class: normalizeClass(unref(ns).e("closeBtn")), onClick: withModifiers(close2, ["stop"]) }, { default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.closeIcon)))]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2)], 46, _hoisted_1), [[vShow, visible.value]])]), _: 3 }, 8, ["name", "onBeforeLeave"]); }; } }); var notification_default = notification_vue_vue_type_script_setup_true_lang_default; const notifications = { "top-left": [], "top-right": [], "bottom-left": [], "bottom-right": [] }; const GAP_SIZE = 16; let seed = 1; const notify = function(options = {}, context) { if (!isClient) return { close: () => void 0 }; if (isString(options) || isVNode(options)) options = { message: options }; const position = options.position || "top-right"; let verticalOffset = options.offset || 0; notifications[position].forEach(({ vm: vm2 }) => { var _a; verticalOffset += (((_a = vm2.el) == null ? void 0 : _a.offsetHeight) || 0) + GAP_SIZE; }); verticalOffset += GAP_SIZE; const id = `notification_${seed++}`; const userOnClose = options.onClose; const props2 = { ...options, offset: verticalOffset, id, onClose: () => { close(id, position, userOnClose); } }; let appendTo = document.body; if (isElement(options.appendTo)) appendTo = options.appendTo; else if (isString(options.appendTo)) appendTo = document.querySelector(options.appendTo); if (!isElement(appendTo)) { debugWarn("ElNotification", "the appendTo option is not an HTMLElement. Falling back to document.body."); appendTo = document.body; } const container = document.createElement("div"); const vm = createVNode(notification_default, props2, isFunction(props2.message) ? props2.message : isVNode(props2.message) ? () => props2.message : null); vm.appContext = isUndefined(context) ? notify._context : context; vm.props.onDestroy = () => { render(null, container); }; render(vm, container); notifications[position].push({ vm }); appendTo.appendChild(container.firstElementChild); return { close: () => { vm.component.exposed.visible.value = false; } }; }; notificationTypes.forEach((type) => { notify[type] = (options = {}, appContext) => { if (isString(options) || isVNode(options)) options = { message: options }; return notify({ ...options, type }, appContext); }; }); function close(id, position, userOnClose) { const orientedNotifications = notifications[position]; const idx = orientedNotifications.findIndex(({ vm: vm2 }) => { var _a; return ((_a = vm2.component) == null ? void 0 : _a.props.id) === id; }); if (idx === -1) return; const { vm } = orientedNotifications[idx]; if (!vm) return; userOnClose == null ? void 0 : userOnClose(vm); const removedHeight = vm.el.offsetHeight; const verticalPos = position.split("-")[0]; orientedNotifications.splice(idx, 1); const len = orientedNotifications.length; if (len < 1) return; for (let i = idx; i < len; i++) { const { el, component: component2 } = orientedNotifications[i].vm; const pos = Number.parseInt(el.style[verticalPos], 10) - removedHeight - GAP_SIZE; component2.props.offset = pos; } } function closeAll() { for (const orientedNotifications of Object.values(notifications)) orientedNotifications.forEach(({ vm }) => { vm.component.exposed.visible.value = false; }); } function updateOffsets(position = "top-right") { var _a, _b, _c, _d; let verticalOffset = ((_c = (_b = (_a = notifications[position][0]) == null ? void 0 : _a.vm.component) == null ? void 0 : _b.props) == null ? void 0 : _c.offset) || 0; for (const { vm } of notifications[position]) { vm.component.props.offset = verticalOffset; verticalOffset += (((_d = vm.el) == null ? void 0 : _d.offsetHeight) || 0) + GAP_SIZE; } } notify.closeAll = closeAll; notify.updateOffsets = updateOffsets; notify._context = null; const ElNotification = withInstallFunction(notify, "$notify"); var component_default = [ ElAffix, ElAlert, ElAutocomplete, ElAutoResizer, ElAvatar, ElAvatarGroup, ElBacktop, ElBadge, ElBreadcrumb, ElBreadcrumbItem, ElButton, ElButtonGroup$1, ElCalendar, ElCard, ElCarousel, ElCarouselItem, ElCascader, ElCascaderPanel, ElCheckTag, ElCheckbox, ElCheckboxButton, ElCheckboxGroup, ElCol, ElCollapse, ElCollapseItem, ElCollapseTransition, ElColorPickerPanel, ElColorPicker, ElConfigProvider, ElContainer, ElAside, ElFooter, ElHeader, ElMain, ElDatePicker, ElDatePickerPanel, ElDescriptions, ElDescriptionsItem, ElDialog, ElDivider, ElDrawer, ElDropdown, ElDropdownItem, ElDropdownMenu, ElEmpty, ElForm, ElFormItem, ElIcon, ElImage, ElImageViewer, ElInput, ElInputNumber, ElInputTag, ElLink, ElMenu, ElMenuItem, ElMenuItemGroup, ElSubMenu, ElPageHeader, ElPagination, ElPopconfirm, ElPopover, ElPopper, ElProgress, ElRadio, ElRadioButton, ElRadioGroup, ElRate, ElResult, ElRow, ElScrollbar, ElSelect, ElOption, ElOptionGroup, ElSelectV2, ElSkeleton, ElSkeletonItem, ElSlider, ElSpace, ElStatistic, ElCountdown, ElSteps, ElStep, ElSwitch, ElTable, ElTableColumn, ElTableV2, ElTabs, ElTabPane, ElTag, ElText, ElTimePicker, ElTimeSelect, ElTimeline, ElTimelineItem, ElTooltip, ElTransfer, ElTree, ElTreeSelect, ElTreeV2, ElUpload, ElWatermark, ElTour, ElTourStep, ElAnchor, ElAnchorLink, ElSegmented, ElMention, ElSplitter, ElSplitterPanel ]; var plugin_default = [ ElInfiniteScroll, ElLoading, ElMessage, ElMessageBox, ElNotification, ElPopoverDirective ]; var defaults_default = makeInstaller([...component_default, ...plugin_default]); defaults_default.install; defaults_default.version; var element_plus_default = defaults_default; var zh_cn_default = { name: "zh-cn", el: { breadcrumb: { label: "面包屑" }, colorpicker: { confirm: "确定", clear: "清空", defaultLabel: "颜色选择器", description: "当前颜色 {color},按 Enter 键选择新颜色", alphaLabel: "选择透明度的值", alphaDescription: "透明度 {alpha}, 当前颜色 {color}", hueLabel: "选择色相值", hueDescription: "色相 {hue}, 当前颜色 {color}", svLabel: "选择饱和度与明度的值", svDescription: "饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}", predefineDescription: "选择 {value} 作为颜色" }, datepicker: { now: "此刻", today: "今天", cancel: "取消", clear: "清空", confirm: "确定", dateTablePrompt: "使用方向键与 Enter 键可选择日期", monthTablePrompt: "使用方向键与 Enter 键可选择月份", yearTablePrompt: "使用方向键与 Enter 键可选择年份", selectedDate: "已选日期", selectDate: "选择日期", selectTime: "选择时间", startDate: "开始日期", startTime: "开始时间", endDate: "结束日期", endTime: "结束时间", prevYear: "前一年", nextYear: "后一年", prevMonth: "上个月", nextMonth: "下个月", year: "年", month1: "1 月", month2: "2 月", month3: "3 月", month4: "4 月", month5: "5 月", month6: "6 月", month7: "7 月", month8: "8 月", month9: "9 月", month10: "10 月", month11: "11 月", month12: "12 月", weeks: { sun: "日", mon: "一", tue: "二", wed: "三", thu: "四", fri: "五", sat: "六" }, weeksFull: { sun: "星期日", mon: "星期一", tue: "星期二", wed: "星期三", thu: "星期四", fri: "星期五", sat: "星期六" }, months: { jan: "一月", feb: "二月", mar: "三月", apr: "四月", may: "五月", jun: "六月", jul: "七月", aug: "八月", sep: "九月", oct: "十月", nov: "十一月", dec: "十二月" } }, inputNumber: { decrease: "减少数值", increase: "增加数值" }, select: { loading: "加载中", noMatch: "无匹配数据", noData: "无数据", placeholder: "请选择" }, mention: { loading: "加载中" }, dropdown: { toggleDropdown: "切换下拉选项" }, cascader: { noMatch: "无匹配数据", loading: "加载中", placeholder: "请选择", noData: "暂无数据" }, pagination: { goto: "前往", pagesize: "条/页", total: "共 {total} 条", pageClassifier: "页", page: "页", prev: "上一页", next: "下一页", currentPage: "第 {pager} 页", prevPages: "向前 {pager} 页", nextPages: "向后 {pager} 页", deprecationWarning: "你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档" }, dialog: { close: "关闭此对话框" }, drawer: { close: "关闭此对话框" }, messagebox: { title: "提示", confirm: "确定", cancel: "取消", error: "输入的数据不合法!", close: "关闭此对话框" }, upload: { deleteTip: "按 Delete 键可删除", delete: "删除", preview: "查看图片", continue: "继续上传" }, slider: { defaultLabel: "滑块介于 {min} 至 {max}", defaultRangeStartLabel: "选择起始值", defaultRangeEndLabel: "选择结束值" }, table: { emptyText: "暂无数据", confirmFilter: "筛选", resetFilter: "重置", clearFilter: "全部", sumText: "合计", selectAllLabel: "选择所有行", selectRowLabel: "选择当前行", expandRowLabel: "展开当前行", collapseRowLabel: "收起当前行", sortLabel: "按 {column} 排序", filterLabel: "按 {column} 过滤" }, tag: { close: "关闭此标签" }, tour: { next: "下一步", previous: "上一步", finish: "结束导览", close: "关闭此对话框" }, tree: { emptyText: "暂无数据" }, transfer: { noMatch: "无匹配数据", noData: "无数据", titles: ["列表 1", "列表 2"], filterPlaceholder: "请输入搜索内容", noCheckedFormat: "共 {total} 项", hasCheckedFormat: "已选 {checked}/{total} 项" }, image: { error: "加载失败" }, pageHeader: { title: "返回" }, popconfirm: { confirmButtonText: "确定", cancelButtonText: "取消" }, carousel: { leftArrow: "上一张幻灯片", rightArrow: "下一张幻灯片", indicator: "幻灯片切换至索引 {index}" } } }; export { ElTimelineItem as $, ElTour as A, ElTourStep as B, ElAvatar as C, ElMessageBox as D, ElMessage as E, ElScrollbar as F, ElMenuItem as G, ElSubMenu as H, ElMenu as I, document_copy_default as J, refresh_left_default as K, ElDrawer as L, ElSwitch as M, check_default as N, ElColorPicker as O, ElRadioGroup as P, ElRadio as Q, ElImage as R, ElResult as S, ElCard as T, ElRow as U, ElCol as V, connection_default as W, ElSkeleton as X, ElSkeletonItem as Y, ElRadioButton as Z, ElTimeline as _, ElNotification as a, moon_default as a$, ElAlert as a0, ElUpload as a1, camera_default as a2, ElDescriptions as a3, ElDescriptionsItem as a4, ElTabs as a5, ElTabPane as a6, loading_default as a7, circle_close_default as a8, question_filled_default as a9, clock_default as aA, monitor_default as aB, ElCheckbox as aC, ElTimePicker as aD, magic_stick_default as aE, ElSteps as aF, ElStep as aG, ElTreeSelect as aH, ElSpace as aI, ElCheckboxGroup as aJ, ElCheckboxButton as aK, ElTree as aL, close_default as aM, back_default as aN, right_default as aO, download_default as aP, folder_opened_default as aQ, ElPopconfirm as aR, ElButtonGroup$1 as aS, list_default as aT, grid_default as aU, folder_default as aV, document_default as aW, upload_filled_default as aX, ElProgress as aY, lock_default as aZ, sunny_default as a_, delete_default as aa, warning_default as ab, setting_default as ac, chat_dot_round_default as ad, user_default as ae, arrow_down_default as af, arrow_up_default as ag, copy_document_default as ah, promotion_default as ai, refresh_default as aj, plus_default as ak, ElTable as al, ElTableColumn as am, edit_default as an, vLoading as ao, ElPagination as ap, ElSelect as aq, ElOption as ar, ElSlider as as, aim_default as at, video_pause_default as au, ElInputNumber as av, ElDatePicker as aw, ElPopover as ax, view_default as ay, upload_default$1 as az, ElWatermark as b, ElContainer as b0, ElAside as b1, ElMain as b2, circle_close_filled_default as b3, video_camera_default as b4, ElConfigProvider as c, ElementPlusIconsVue as d, en_default as e, element_plus_default as f, ElBacktop as g, ElButton as h, ElIcon as i, ElBreadcrumb as j, ElBreadcrumbItem as k, ElTooltip as l, ElDropdown as m, ElDropdownMenu as n, ElDropdownItem as o, ElBadge as p, ElTag as q, ElText as r, ElDivider as s, ElLink as t, ElEmpty as u, ElDialog as v, ElForm as w, ElFormItem as x, ElInput as y, zh_cn_default as z };