// ==UserScript== // @name 征纳互动人数和在线监控v2 // @namespace https://scriptcat.org/ // @version 26.11.8-v4 // @author runos // @description 实时监控征纳互动等待人数和在线状态,支持语音播报、自定义常用语 // @license MIT // @icon https://znhd.hunan.chinatax.gov.cn:8443/favicon.ico // @homepage https://scriptcat.org/zh-CN/script-show-page/3650 // @homepageURL https://cnb.cool/bbbbaa/znhd-service // @source https://cnb.cool/bbbbaa/znhd-service.git // @supportURL https://cnb.cool/bbbbaa/znhd-service/-/issues // @match https://znhd.hunan.chinatax.gov.cn:8443/* // @match https://example.com/* // @match https://www.appinn.com/* // @require https://fastly.jsdelivr.net/npm/js-yaml@4.1.0/dist/js-yaml.min.js#md5=99f96803d123239c14d61d54de76a2bf // @require https://fastly.jsdelivr.net/npm/qrcodejs@1.0.0/qrcode.min.js#md5=517b55d3688ce9ef1085a3d9632bcb97 // @require https://fastly.jsdelivr.net/npm/heic2any@0.0.4/dist/heic2any.js#md5=a2cc4c2e524eb36ffb9396800bf07719 // @require https://fastly.jsdelivr.net/npm/vue@3.5.13/dist/vue.global.prod.js // @connect * // @grant GM_addStyle // @grant GM_getValue // @grant GM_info // @grant GM_setClipboard // @grant GM_setValue // @grant GM_xmlhttpRequest // @grant unsafeWindow // @run-at document-end // ==/UserScript== (function (vue) { 'use strict'; function _interopNamespaceDefault(e) { const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { for (const k in e) { if (k !== 'default') { const d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } } } n.default = e; return Object.freeze(n); } const vue__namespace = _interopNamespaceDefault(vue); var __defProp = Object.defineProperty; var __typeError = (msg) => { throw TypeError(msg); }; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); var _type, _type2, _type3, _type4, _a; const CONFIG = { CHECK_INTERVAL: 3e3, OFFLINE_REPEAT_INTERVAL: 5e3, MAX_LOG_ENTRIES: 20, didaUrl: "https://cnb.cool/bbbbaa/work-about/-/git/raw/main/znhd/dida.mp3", SPEECH_TIMEOUT: 15e3, MAX_SPEECH_QUEUE: 10, SPEECH_QUEUE_TTL: 3e4, MAX_SNIFF_CONV_STEMS: 2e3, MAX_SNIFF_CONV_ALIASES: 200, SNIFF_CONV_TTL: 30 * 24 * 60 * 60 * 1e3 }; const STORAGE_KEY = "scriptCat_Allvalue"; const PHRASES_CACHE_KEY = "scriptCat_PhrasesCache"; const SNIFF_CONV_INDEX_KEY = "scriptCat_SniffConvIndex"; const DEFAULTS = { voiceEnabled: true, workingHours: { morningStart: 9, morningEnd: 12, afternoonStart: 13.5, afternoonEnd: 18 }, useCdn: true, logAutoRefresh: true, sniffMinKB: 20, sniffPreMeasure: true, quickReplyTableUrl: "https://mi0cdkcaj1o.feishu.cn/wiki/HImpwjCTeiPTIbkzIB0cHOKcnDd?table=tblDmddRH7lDaNrr&view=vewE5llSJY", privacyTableUrl: "" }; let setLogEntriesCallback = null; const RECENT_LOG_COUNT = 5; const recentLogMessages = []; function addLog(message, type = "info", logenabled = false) { const timestamp = ( new Date()).toTimeString().slice(0, 8); if (recentLogMessages.indexOf(message) !== -1) { console.log("[监控] 重复日志,已忽略:", message); return; } recentLogMessages.push(message); if (recentLogMessages.length > RECENT_LOG_COUNT) { recentLogMessages.shift(); } const logItem = { timestamp, message, type }; if (setLogEntriesCallback) { setLogEntriesCallback((prevEntries) => { const newEntries = [logItem, ...prevEntries]; if (newEntries.length > CONFIG.MAX_LOG_ENTRIES) { newEntries.pop(); } return newEntries; }); } if (logenabled) { console.log(`[监控] ${timestamp} ${message}`); } } function setLogEntriesSink(cb) { setLogEntriesCallback = cb; } function clearLogs() { recentLogMessages.length = 0; if (setLogEntriesCallback) { setLogEntriesCallback(() => []); } } const scriptRel = (function detectScriptRel() { const relList = typeof document !== "undefined" && document.createElement("link").relList; return relList && relList.supports && relList.supports("modulepreload") ? "modulepreload" : "preload"; })(); const assetsURL = function(dep) { return "/" + dep; }; const seen = {}; const __vitePreload = function preload(baseModule, deps, importerUrl) { let promise = Promise.resolve(); if (deps && deps.length > 0) { let allSettled = function(promises$2) { return Promise.all(promises$2.map((p) => Promise.resolve(p).then((value$1) => ({ status: "fulfilled", value: value$1 }), (reason) => ({ status: "rejected", reason })))); }; document.getElementsByTagName("link"); const cspNonceMeta = document.querySelector("meta[property=csp-nonce]"); const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce")); promise = allSettled(deps.map((dep) => { dep = assetsURL(dep); if (dep in seen) return; seen[dep] = true; const isCss = dep.endsWith(".css"); const cssSelector = isCss ? '[rel="stylesheet"]' : ""; if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) return; const link = document.createElement("link"); link.rel = isCss ? "stylesheet" : scriptRel; if (!isCss) link.as = "script"; link.crossOrigin = ""; link.href = dep; if (cspNonce) link.setAttribute("nonce", cspNonce); document.head.appendChild(link); if (isCss) return new Promise((res, rej) => { link.addEventListener("load", res); link.addEventListener("error", () => rej( new Error(`Unable to preload CSS for ${dep}`))); }); })); } function handlePreloadError(err$2) { const e$1 = new Event("vite:preloadError", { cancelable: true }); e$1.payload = err$2; window.dispatchEvent(e$1); if (!e$1.defaultPrevented) throw err$2; } return promise.then((res) => { for (const item of res || []) { if (item.status !== "rejected") continue; handlePreloadError(item.reason); } return baseModule().catch(handlePreloadError); }); }; function toast$2(level, content) { void __vitePreload(async () => { const { toast: t } = await Promise.resolve().then(() => toast$1); return { toast: t }; }, void 0 ).then(({ toast: t }) => t[level](content)); } const notify = { success: (msg) => toast$2("success", msg), error: (msg) => toast$2("error", msg), warning: (msg) => toast$2("warning", msg), info: (msg) => toast$2("info", msg) }; function loadPhrasesCache() { try { const saved = localStorage.getItem(PHRASES_CACHE_KEY); if (saved) { const parsed = JSON.parse(saved); const d = parsed && parsed.data; if (parsed && typeof parsed.time === "number" && d && Array.isArray(d.all) && Array.isArray(d.mine)) { return parsed; } } } catch (error) { addLog("读取常用语缓存失败: " + error.message, "error", true); } return null; } function savePhrasesCache(data) { try { localStorage.setItem( PHRASES_CACHE_KEY, JSON.stringify({ time: Date.now(), data }) ); } catch (error) { addLog("保存常用语缓存失败: " + error.message, "error", true); } } function loadAllvalue() { try { const saved = localStorage.getItem(STORAGE_KEY); if (saved) { const parsed = JSON.parse(saved); const merged = { ...DEFAULTS, ...parsed }; const wh = parsed && typeof parsed.workingHours === "object" && parsed.workingHours; if (wh) { const defWh = DEFAULTS.workingHours; merged.workingHours = { morningStart: Number.isFinite(wh.morningStart) ? wh.morningStart : defWh.morningStart, morningEnd: Number.isFinite(wh.morningEnd) ? wh.morningEnd : defWh.morningEnd, afternoonStart: Number.isFinite(wh.afternoonStart) ? wh.afternoonStart : defWh.afternoonStart, afternoonEnd: Number.isFinite(wh.afternoonEnd) ? wh.afternoonEnd : defWh.afternoonEnd }; } if ("commonPhrasesUrl" in merged) { delete merged.commonPhrasesUrl; } return merged; } } catch (error) { addLog("加载存储数据失败: " + error.message, "error", true); } return { ...DEFAULTS }; } let _saveAllvalueTimer = null; let _saveAllvaluePending = null; function flushSaveAllvalue() { if (_saveAllvalueTimer) { clearTimeout(_saveAllvalueTimer); _saveAllvalueTimer = null; } if (_saveAllvaluePending === null) return; const data = _saveAllvaluePending; _saveAllvaluePending = null; try { localStorage.setItem(STORAGE_KEY, JSON.stringify(data)); addLog("数据已保存到localStorage", "success", true); } catch (error) { addLog("保存数据失败: " + error.message, "error", true); notify.error("保存设置失败: " + error.message); } } function saveAllvalue(data) { _saveAllvaluePending = data; if (!_saveAllvalueTimer) _saveAllvalueTimer = setTimeout(flushSaveAllvalue, 300); } const _initAllvalue = loadAllvalue(); const runtime$1 = { init: _initAllvalue, voiceEnabled: _initAllvalue.voiceEnabled, workingHours: _initAllvalue.workingHours, useCdn: !!_initAllvalue.useCdn, logAutoRefresh: !!_initAllvalue.logAutoRefresh }; const speechQueue = []; let isSpeaking = false; let speechTimer = null; function clearSpeechQueue() { speechQueue.length = 0; isSpeaking = false; if (speechTimer) { clearTimeout(speechTimer); speechTimer = null; } if ("speechSynthesis" in window) { try { window.speechSynthesis.cancel(); } catch (e) { } } } function pruneExpiredSpeechItems() { if (speechQueue.length === 0) return 0; const now = Date.now(); const before = speechQueue.length; for (let i = speechQueue.length - 1; i >= 0; i--) { if (now - speechQueue[i].enqueuedAt > CONFIG.SPEECH_QUEUE_TTL) { speechQueue.splice(i, 1); } } return before - speechQueue.length; } function speak(text) { if (!runtime$1.voiceEnabled || !("speechSynthesis" in window)) { return; } const utterance = new SpeechSynthesisUtterance(text); utterance.lang = "zh-CN"; utterance.rate = 1; speechQueue.push({ utterance, enqueuedAt: Date.now() }); while (speechQueue.length > CONFIG.MAX_SPEECH_QUEUE) { speechQueue.shift(); addLog("语音队列已满,丢弃最早的一条旧消息", "warning", true); } const expired = pruneExpiredSpeechItems(); if (expired > 0) { addLog(`语音队列已清理 ${expired} 条过期消息`, "warning", true); } processSpeechQueue(); } function processSpeechQueue() { if (isSpeaking) { return; } pruneExpiredSpeechItems(); if (speechQueue.length === 0) { return; } isSpeaking = true; const item = speechQueue.shift(); if (!item) { isSpeaking = false; return; } const utterance = item.utterance; if (speechTimer) { clearTimeout(speechTimer); } speechTimer = setTimeout(() => { addLog("语音播报超时,强制继续队列", "warning", true); isSpeaking = false; speechTimer = null; processSpeechQueue(); }, CONFIG.SPEECH_TIMEOUT); const clearTimer = () => { if (speechTimer) { clearTimeout(speechTimer); speechTimer = null; } }; utterance.onend = () => { clearTimer(); isSpeaking = false; processSpeechQueue(); }; utterance.onerror = (event) => { clearTimer(); isSpeaking = false; if (event.error === "not-allowed") { speechQueue.length = 0; } else { processSpeechQueue(); } }; if (window.speechSynthesis.paused) { window.speechSynthesis.resume(); } window.speechSynthesis.speak(utterance); } function clearSpeechTimer() { if (speechTimer) { clearTimeout(speechTimer); speechTimer = null; } } function getCurrentHour() { const now = new Date(); return now.getHours() + now.getMinutes() / 60; } function isWorkingHours() { const wh = runtime$1.workingHours; if (!wh) return true; const currentHour = getCurrentHour(); return currentHour >= wh.morningStart && currentHour <= wh.morningEnd || currentHour >= wh.afternoonStart && currentHour <= wh.afternoonEnd; } const domCache = { ocurrentElement: null }; let lastWaitCount = null; function resetWaitCountBaseline() { lastWaitCount = null; } let monitorState = { waiting: null, online: true, inWorkingHours: true, lastSpeak: null }; function publishState(patch) { monitorState = { ...monitorState, ...patch }; } function speakAndTrack(reason, text) { speak(text); publishState({ lastSpeak: { at: Date.now(), reason } }); } let lastWorkingState = null; let offlineActive = false; let offlineRepeatTimer = null; function scheduleOfflineRepeat() { if (offlineRepeatTimer) return; offlineRepeatTimer = setTimeout(() => { offlineRepeatTimer = null; if (!offlineActive) return; speakAndTrack("已掉线", "征纳互动已掉线"); scheduleOfflineRepeat(); }, CONFIG.OFFLINE_REPEAT_INTERVAL); } function stopOfflineRepeat() { offlineActive = false; if (offlineRepeatTimer) { clearTimeout(offlineRepeatTimer); offlineRepeatTimer = null; } } function checkCount() { var _a2, _b; const inWork = isWorkingHours(); publishState({ inWorkingHours: inWork }); if (inWork !== lastWorkingState) { lastWorkingState = inWork; addLog(inWork ? "已进入工作时间,开始监控征纳互动" : "已离开工作时间,暂停监控", inWork ? "success" : "info"); } if (!inWork) { if (offlineActive) stopOfflineRepeat(); return; } try { if (domCache.ocurrentElement && !domCache.ocurrentElement.isConnected) { domCache.ocurrentElement = null; } if (!domCache.ocurrentElement) { domCache.ocurrentElement = document.querySelector(".count:nth-child(2)"); } const ocurrentElement = domCache.ocurrentElement; if (!ocurrentElement) { addLog("找不到人数元素", "warning"); return; } const currentText = (ocurrentElement.textContent || "").trim(); const currentCount = parseInt(currentText, 10); if (isNaN(currentCount)) { addLog(`无法解析等待人数: "${currentText}"`, "warning"); return; } publishState({ waiting: currentCount }); if (currentCount === 0) { if (lastWaitCount !== 0) { addLog("当前等待人数为0", "success"); } } else { if (currentCount !== lastWaitCount) { speakAndTrack("有人进入", "征纳互动有人来了"); } addLog(`当前等待人数: ${currentCount}`, "info"); } lastWaitCount = currentCount; const offlineEl = document.querySelector(".t-dialog__body__icon:nth-child(2)") || document.querySelector(".t-dialog__body__icon:nth-of-type(2)"); const offlineText = offlineEl ? ((_b = (_a2 = offlineEl == null ? void 0 : offlineEl.innerText) != null ? _a2 : offlineEl == null ? void 0 : offlineEl.textContent) != null ? _b : "").trim() : ""; if (offlineText.includes("掉线")) { publishState({ online: false }); if (!offlineActive) { addLog( `掉线提示:${offlineText}(每 ${CONFIG.OFFLINE_REPEAT_INTERVAL / 1e3} 秒重复提醒,直到弹窗消失)`, "error" ); offlineActive = true; speakAndTrack("已掉线", "征纳互动已掉线"); scheduleOfflineRepeat(); } } else { if (offlineActive) { addLog("掉线弹窗已消失,恢复在线监控", "success"); stopOfflineRepeat(); } publishState({ online: true }); } } catch (error) { addLog(`检测错误: ${error.message}`, "error", true); } } let monitoringInterval = null; function startMonitoring() { checkCount(); monitoringInterval = setInterval(checkCount, CONFIG.CHECK_INTERVAL); } function stopMonitoring() { if (monitoringInterval) { clearInterval(monitoringInterval); monitoringInterval = null; } stopOfflineRepeat(); } const PERF_BUFFER_SIZE = 2e4; const MAX_PERF_ENTRIES = 2e4; const IMG_EXT_RE$1 = /\.(?:jpe?g|png|gif|webp|bmp|ico|avif|tiff?|svg)(?:[?#]|$)/i; const VIDEO_INITIATORS$1 = ["video", "audio"]; const perfBytes = new Map(); let observer$2 = null; let started$2 = false; function entryBytes(e) { const decoded = Number(e.decodedBodySize || 0); if (decoded > 0) return decoded; const encoded = Number(e.encodedBodySize || 0); if (encoded > 0) return encoded; const transfer = Number(e.transferSize || 0); return transfer > 0 ? transfer : 0; } function remember(name, bytes) { if (!name || bytes <= 0) return; if (!IMG_EXT_RE$1.test(name)) return; if (!perfBytes.has(name) && perfBytes.size >= MAX_PERF_ENTRIES) { const oldest = perfBytes.keys().next(); if (!oldest.done) perfBytes.delete(oldest.value); } perfBytes.set(name, bytes); } function onEntries(list) { try { const entries = list && typeof list.getEntries === "function" ? list.getEntries() : []; for (const e of entries) { const it = String(e.initiatorType || ""); if (VIDEO_INITIATORS$1.indexOf(it) >= 0) continue; remember(String(e.name || ""), entryBytes(e)); } } catch (err) { } } function startPerfCollect() { if (started$2) return; started$2 = true; try { if (typeof performance !== "undefined" && typeof performance.setResourceTimingBufferSize === "function") { performance.setResourceTimingBufferSize(PERF_BUFFER_SIZE); } } catch (e) { } try { if (typeof PerformanceObserver === "undefined") return; observer$2 = new PerformanceObserver(onEntries); observer$2.observe({ type: "resource", buffered: true }); } catch (e) { } } function perfBytesOf(url) { if (!url) return null; const b = perfBytes.get(url); return b && b > 0 ? b : null; } function perfForEach(fn) { perfBytes.forEach((bytes, url) => fn(url, bytes)); } function downloadFileName(name, mime, idx = 0) { const extByMime = { "image/jpeg": ".jpg", "image/png": ".png", "image/gif": ".gif", "image/webp": ".webp", "image/svg+xml": ".svg", "image/bmp": ".bmp" }; let n = String(name || "").trim(); if (!n) n = "znhd-image-" + (idx + 1); if (!/\.[a-z0-9]{2,5}$/i.test(n)) n += extByMime[(mime || "").toLowerCase()] || ".jpg"; return n; } const MAX_MEASURED = 2e3; const measured = new Map(); function rememberMeasured(img) { if (!img || !img.key) return; if (!measured.has(img.key) && measured.size >= MAX_MEASURED) { const oldest = measured.keys().next(); if (!oldest.done) measured.delete(oldest.value); } measured.set(img.key, img); } function measuredOf(key) { if (!key) return null; return measured.get(key) || null; } const CSS_SCAN_LIMIT = 3e3; const MAX_SNIFF = 300; const EXCLUDED_NAME_PATTERNS = ["znhd-sniff", "user-woman", "user-man"]; const EXCLUDED_NAME_SUFFIXES = [".svg"]; function isExcludedName(name) { const n = String(name || "").toLowerCase(); if (!n) return false; if (EXCLUDED_NAME_PATTERNS.some((p) => n.indexOf(p) >= 0)) return true; return EXCLUDED_NAME_SUFFIXES.some((s) => n.endsWith(s)); } const LAZY_ATTRS = [ "data-src", "data-lazy-src", "data-original", "data-actual", "data-lazy", "data-defer-src", "data-load-src", "data-echo" ]; const IMG_EXT_RE = /\.(?:jpe?g|png|gif|webp|bmp|ico|avif|tiff?|svg)(?:[?#]|$)/i; const VIDEO_EXT_RE = /\.(?:mp4|m4v|webm|ogv|ogg|avi|mov|flv|mkv|wmv|3gp|mpe?g|m3u8|mpd)(?:[?#]|$)/i; const VIDEO_INITIATORS = ["video", "audio"]; const CSS_URL_RE = /url\((['"]?)([^'")]+)\1\)/g; const HEAD_TIMEOUT = 8e3; const RANGE_TIMEOUT = 15e3; const DOWNLOAD_TIMEOUT = 3e4; const LOCAL_FETCH_TIMEOUT = 5e3; function formatBytes(n) { if (n === null || !Number.isFinite(n) || n < 0) return "大小未知"; if (n < 1024) return n + " B"; if (n < 1024 * 1024) return (n / 1024).toFixed(n < 10 * 1024 ? 1 : 0) + " KB"; return (n / 1024 / 1024).toFixed(2) + " MB"; } function sanitizeFileName(name) { return String(name || "").replace(/[<>:"/\\|?*\u0000-\u001f]/g, "_").replace(/\s+/g, " ").trim().slice(0, 100); } function sniffFileName(url, mime, idx = 0) { if (/^data:image\/svg\+xml/i.test(url)) return downloadFileName("inline-svg-" + (idx + 1), "image/svg+xml", idx); let base = ""; if (!/^(?:data|blob):/i.test(url)) { try { const u = new URL(url, location.href); const seg = u.pathname.split("/").filter(Boolean).pop() || ""; base = sanitizeFileName(decodeURIComponent(seg)); } catch (e) { base = ""; } } return downloadFileName(base || "znhd-sniff-" + (idx + 1), mime, idx); } function urlFileStem(url) { const s = String(url || ""); if (!s || /^(?:data|blob):/i.test(s)) return ""; let seg = ""; try { const u = new URL(s, location.href); seg = u.pathname.split("/").filter(Boolean).pop() || ""; } catch (e) { seg = s.split("?")[0].split("/").pop() || ""; } try { seg = decodeURIComponent(seg); } catch (e) { } return seg.trim().toLowerCase(); } function normalizeUrl(raw) { const s = String(raw || "").trim(); if (!s) return null; if (/^data:/i.test(s)) return /^data:image\//i.test(s) ? s : null; if (/^blob:/i.test(s)) return s; try { const abs = new URL(s, location.href); return /^https?:$/i.test(abs.protocol) ? abs.href : null; } catch (e) { return null; } } function isVideoUrl(url) { return /^data:video\//i.test(url) || VIDEO_EXT_RE.test(url); } function looksLikeImageUrl(url) { return /^data:image\//i.test(url) || /^blob:/i.test(url) || IMG_EXT_RE.test(url); } function isClearlyNotImage(mime) { if (!mime) return false; const m = mime.toLowerCase().split(";")[0].trim(); if (m.startsWith("image/")) return false; return m.startsWith("video/") || m.startsWith("audio/") || m.startsWith("text/") || m === "application/json" || m === "application/xml"; } function utf8Bytes(s) { try { return new TextEncoder().encode(s).length; } catch (e) { return s.length; } } function dataUrlBytes(url) { const i = url.indexOf(","); if (i < 0) return null; const meta = url.slice(0, i); const payload = url.slice(i + 1); if (/;base64/i.test(meta)) { const clean = payload.replace(/\s+/g, ""); const pad2 = (clean.match(/=+$/) || [""])[0].length; return Math.max(0, Math.floor(clean.length * 3 / 4) - pad2); } try { return utf8Bytes(decodeURIComponent(payload)); } catch (e) { return utf8Bytes(payload); } } function dataUrlMime(url) { const m = /^data:([^;,]+)/i.exec(url); return m ? m[1].toLowerCase() : null; } function svgDims(el) { const num2 = (v) => { const n = parseFloat(String(v || "")); return Number.isFinite(n) && n > 0 ? n : null; }; let width = num2(el.getAttribute("width")); let height = num2(el.getAttribute("height")); if (!width || !height) { const vb = String(el.getAttribute("viewBox") || "").trim().split(/[\s,]+/); if (vb.length === 4) { width = width || num2(vb[2]); height = height || num2(vb[3]); } } if (!width || !height) { try { const r = el.getBoundingClientRect(); width = width || Math.round(r.width) || null; height = height || Math.round(r.height) || null; } catch (e) { } } return { width, height }; } function serializeSvg(el) { let text = ""; try { text = el.outerHTML || ""; } catch (e) { text = ""; } if (!text) return ""; if (!/\sxmlns=/.test(text)) text = text.replace(/^ s.trim()).filter(Boolean); let best = ""; let bestV = -1; for (const p of parts) { const seg = p.split(/\s+/); const url = seg[0]; if (!url) continue; const d = String(seg[1] || ""); let v = 1; if (/^\d+(\.\d+)?w$/.test(d)) v = parseFloat(d); else if (/^\d+(\.\d+)?x$/.test(d)) v = parseFloat(d) * 1e3; if (v > bestV) { bestV = v; best = url; } } return best; } function backgroundUrls(bg) { const out = []; if (!bg || bg === "none") return out; CSS_URL_RE.lastIndex = 0; let m; while (m = CSS_URL_RE.exec(bg)) { if (m[2]) out.push(m[2]); } return out; } function collectCandidates(opts = {}) { const root = opts.root || document; const exclude = String(opts.excludeSelector || ""); const cssLimit = opts.cssLimit && opts.cssLimit > 0 ? opts.cssLimit : CSS_SCAN_LIMIT; const maxItems = opts.maxItems && opts.maxItems > 0 ? opts.maxItems : MAX_SNIFF; const map = new Map(); let truncated = false; const excludedKeys = new Set(); const skipped = (el) => { if (!exclude) return false; try { return !!el.closest(exclude); } catch (e) { return false; } }; const add = (raw, source, dims, extra) => { var _a2, _b, _c, _d; const url = normalizeUrl(raw); if (!url) return; if (isVideoUrl(url)) return; if (isExcludedName(sniffFileName(url, (_a2 = extra == null ? void 0 : extra.mime) != null ? _a2 : null, 0))) { excludedKeys.add(url); return; } if (!(extra == null ? void 0 : extra.force) && !looksLikeImageUrl(url)) return; const knownPerf = extra && extra.perfBytes ? extra.perfBytes : perfBytesOf(url); const key = url; const found = map.get(key); if (found) { if (found.sources.indexOf(source) < 0) found.sources.push(source); if (!found.width && dims && dims.width) found.width = dims.width; if (!found.height && dims && dims.height) found.height = dims.height; if (!found.mime && (extra == null ? void 0 : extra.mime)) found.mime = extra.mime; if (!found.perfBytes && knownPerf) found.perfBytes = knownPerf; return; } if (map.size >= maxItems) { truncated = true; return; } map.set(key, { key, url, stem: urlFileStem(url), kind: /^data:/i.test(url) ? "data" : /^blob:/i.test(url) ? "blob" : "http", sources: [source], svgText: extra == null ? void 0 : extra.svgText, width: (_b = dims == null ? void 0 : dims.width) != null ? _b : null, height: (_c = dims == null ? void 0 : dims.height) != null ? _c : null, perfBytes: knownPerf != null ? knownPerf : null, mime: (_d = extra == null ? void 0 : extra.mime) != null ? _d : null }); }; let imgs = []; try { imgs = Array.from(root.querySelectorAll("img")); } catch (e) { imgs = []; } for (const el of imgs) { if (skipped(el)) continue; const img = el; const dims = { width: img.naturalWidth || img.width || null, height: img.naturalHeight || img.height || null }; const cands = []; if (img.currentSrc) cands.push(img.currentSrc); if (img.getAttribute("src")) cands.push(img.getAttribute("src")); const ss = pickFromSrcset(img.getAttribute("srcset") || ""); if (ss) cands.push(ss); for (const a of LAZY_ATTRS) { const v = img.getAttribute(a); if (v) cands.push(v); } for (const c of cands) add(c, "dom", dims, { force: true }); } let sources = []; try { sources = Array.from(root.querySelectorAll("picture source")); } catch (e) { sources = []; } for (const el of sources) { if (skipped(el)) continue; const ss = pickFromSrcset(el.getAttribute("srcset") || ""); if (ss) add(ss, "dom", void 0, { force: true }); const s = el.getAttribute("src"); if (s) add(s, "dom", void 0, { force: true }); } let svgs = []; try { svgs = Array.from(root.querySelectorAll("svg")); } catch (e) { svgs = []; } for (const el of svgs) { if (skipped(el)) continue; const text = serializeSvg(el); if (!text) continue; const dims = svgDims(el); add("data:image/svg+xml;charset=utf-8," + encodeURIComponent(text), "svg", dims, { svgText: text, mime: "image/svg+xml", force: true }); } const scanRoot = root instanceof Document ? root.body || root.documentElement : root; if (scanRoot) { let els = []; try { els = Array.from(scanRoot.querySelectorAll("*")); } catch (e) { els = []; } if (els.length > cssLimit) truncated = true; for (let i = 0; i < els.length && i < cssLimit; i++) { const el = els[i]; const tag = el.tagName ? el.tagName.toLowerCase() : ""; if (tag === "script" || tag === "style" || tag === "link" || tag === "meta" || tag === "noscript") continue; if (skipped(el)) continue; let bg = ""; try { bg = getComputedStyle(el).backgroundImage; } catch (e) { continue; } if (!bg || bg === "none") continue; for (const u of backgroundUrls(bg)) add(u, "css"); } } perfForEach((url, bytes) => { add(url, "perf", void 0, { perfBytes: bytes }); }); try { if (typeof performance !== "undefined" && performance.getEntriesByType) { const entries = performance.getEntriesByType("resource"); for (const e of entries) { const it = String(e.initiatorType || ""); if (VIDEO_INITIATORS.indexOf(it) >= 0) continue; const name = String(e.name || ""); if (!looksLikeImageUrl(name)) continue; const bytes = Number(e.decodedBodySize || 0) || Number(e.encodedBodySize || 0) || Number(e.transferSize || 0) || 0; add(name, "perf", void 0, { perfBytes: bytes > 0 ? bytes : null }); } } } catch (e) { } return { items: Array.from(map.values()), truncated, excluded: excludedKeys.size }; } function gmRequest(details) { return new Promise((resolve, reject) => { if (typeof GM_xmlhttpRequest !== "function") { reject(new Error("GM_xmlhttpRequest 不可用")); return; } try { GM_xmlhttpRequest({ ...details, onload: (resp) => resolve(resp), onerror: (resp) => reject(new Error(resp && (resp.error || resp.statusText) || "请求失败")), ontimeout: () => reject(new Error("请求超时")), onabort: () => reject(new Error("请求已取消")) }); } catch (e) { reject(e); } }); } function headerOf(rawHeaders, name) { const lines = String(rawHeaders || "").split(/\r?\n/); const want = name.toLowerCase() + ":"; for (const line of lines) { const i = line.indexOf(":"); if (i < 0) continue; if (line.slice(0, i + 1).toLowerCase() === want) return line.slice(i + 1).trim(); } return null; } function mimeOf(headers) { const ct2 = headerOf(headers, "content-type"); return ct2 ? ct2.toLowerCase().split(";")[0].trim() || null : null; } async function probeHead(url) { try { const resp = await gmRequest({ method: "HEAD", url, timeout: HEAD_TIMEOUT }); const mime = mimeOf(resp.responseHeaders); if (resp.status >= 400) return { size: null, mime, via: "unknown", drop: false }; if (isClearlyNotImage(mime)) return { size: null, mime, via: "unknown", drop: true }; const len = Number(headerOf(resp.responseHeaders, "content-length")); if (Number.isFinite(len) && len > 0) return { size: len, mime, via: "head", drop: false }; return { size: null, mime, via: "unknown", drop: false }; } catch (e) { return { size: null, mime: null, via: "unknown", drop: false }; } } async function probeRange(url) { try { const resp = await gmRequest({ method: "GET", url, headers: { Range: "bytes=0-0" }, responseType: "blob", timeout: RANGE_TIMEOUT }); const blob = resp.response; const mime = mimeOf(resp.responseHeaders) || (blob && blob.type ? blob.type.toLowerCase() : null); if (isClearlyNotImage(mime)) return { size: null, mime, via: "unknown", drop: true }; const cr = headerOf(resp.responseHeaders, "content-range"); const m = cr ? /\/(\d+)\s*$/.exec(cr) : null; if (m) { const total = Number(m[1]); if (Number.isFinite(total) && total > 0) return { size: total, mime, via: "range", drop: false }; } if (blob && blob.size > 0) return { size: blob.size, mime, via: "range", drop: false }; return { size: null, mime, via: "unknown", drop: false }; } catch (e) { return { size: null, mime: null, via: "unknown", drop: false }; } } async function probeBlobUrl(url) { const blob = await fetchBlobInPage(url); if (!blob) return { size: null, mime: null, via: "unknown", drop: false }; const mime = blob.type ? blob.type.toLowerCase() : null; if (isClearlyNotImage(mime)) return { size: null, mime, via: "local", drop: true }; return { size: blob.size || null, mime, via: "local", drop: false }; } function fetchBlobInPage(url) { return new Promise((resolve) => { let done = false; const finish = (b) => { if (done) return; done = true; resolve(b); }; const timer2 = setTimeout(() => finish(null), LOCAL_FETCH_TIMEOUT); try { if (typeof fetch !== "function") { clearTimeout(timer2); finish(null); return; } fetch(url).then((r) => r.blob()).then((b) => { clearTimeout(timer2); finish(b && b.size ? b : null); }).catch(() => { clearTimeout(timer2); finish(null); }); } catch (e) { clearTimeout(timer2); finish(null); } }); } async function probeOne(it) { if (it.kind === "svg") { const bytes = it.svgText ? utf8Bytes(it.svgText) : null; return { size: bytes, mime: "image/svg+xml", via: bytes ? "local" : "unknown", drop: false }; } if (it.kind === "data") { const bytes = dataUrlBytes(it.url); return { size: bytes, mime: dataUrlMime(it.url), via: bytes ? "local" : "unknown", drop: false }; } if (it.perfBytes && it.perfBytes > 0) { return { size: it.perfBytes, mime: it.mime, via: "perf", drop: false }; } if (it.kind === "blob") return probeBlobUrl(it.url); const head = await probeHead(it.url); if (head.drop || head.size) return head; const range = await probeRange(it.url); return { size: range.size, mime: range.mime || head.mime, via: range.via, drop: range.drop }; } async function runPool(total, concurrency, worker) { let next = 0; const run = async () => { while (next < total) { const i = next; next++; await worker(i); } }; const n = Math.max(1, Math.min(concurrency, total)); const runners = []; for (let i = 0; i < n; i++) runners.push(run()); await Promise.all(runners); } async function resolveSizes(items, opts = {}) { const out = []; const concurrency = opts.concurrency && opts.concurrency > 0 ? opts.concurrency : 5; const stopped = () => !!(opts.shouldStop && opts.shouldStop()); await runPool(items.length, concurrency, async (i) => { const it = items[i]; if (stopped()) return; const cached = measuredOf(it.key); let img; if (cached) { img = { ...it, size: cached.size, mime: cached.mime || it.mime, sizeVia: cached.sizeVia, drop: cached.drop }; } else { let probe; try { probe = await probeOne(it); } catch (e) { probe = { size: null, mime: it.mime, via: "unknown", drop: false }; } if (stopped()) return; img = { ...it, size: probe.size, mime: probe.mime || it.mime, sizeVia: probe.via, drop: probe.drop }; rememberMeasured(img); } out.push(img); if (opts.onItem) opts.onItem(img); }); return out; } function anchorDownload(href, name) { try { const a = document.createElement("a"); a.href = href; a.download = name || ""; a.rel = "noopener"; a.style.display = "none"; const parent = document.body || document.documentElement; parent.appendChild(a); a.click(); a.remove(); return true; } catch (e) { return false; } } async function downloadImage(url, filename) { if (/^data:/i.test(url)) return anchorDownload(url, filename); if (/^blob:/i.test(url)) { const blob = await fetchBlobInPage(url); if (blob) { const objUrl = URL.createObjectURL(blob); const ok = anchorDownload(objUrl, filename); setTimeout(() => URL.revokeObjectURL(objUrl), 1e3); return ok; } return anchorDownload(url, filename); } try { const resp = await gmRequest({ method: "GET", url, responseType: "blob", timeout: DOWNLOAD_TIMEOUT }); const blob = resp.response; if (blob && blob.size > 0) { const objUrl = URL.createObjectURL(blob); const ok = anchorDownload(objUrl, filename); setTimeout(() => URL.revokeObjectURL(objUrl), 1e3); return ok; } } catch (e) { } return anchorDownload(url, filename); } const PERMANENT_HTTP_STATUS = [401, 403, 404, 410]; function sleep$2(ms) { return new Promise((r) => setTimeout(r, ms)); } function permanentError(msg) { const e = new Error(msg); e.permanent = true; return e; } function isPermanent(e) { return !!(e && e.permanent); } async function prefetchOne(item, maxRetries) { const url = item.url; if (/^data:/i.test(url)) return { href: url, obj: false }; if (/^blob:/i.test(url)) { const blob = await fetchBlobInPage(url); if (blob) return { href: URL.createObjectURL(blob), obj: true }; return { href: url, obj: false }; } let lastReason = "下载失败"; for (let attempt = 0; attempt <= maxRetries; attempt++) { try { const resp = await gmRequest({ method: "GET", url, responseType: "blob", timeout: DOWNLOAD_TIMEOUT }); if (resp.status && resp.status >= 400) { if (PERMANENT_HTTP_STATUS.indexOf(resp.status) >= 0) throw permanentError("HTTP " + resp.status); throw new Error("HTTP " + resp.status); } const blob = resp.response; if (blob && blob.size > 0) return { href: URL.createObjectURL(blob), obj: true }; throw new Error("空响应"); } catch (e) { if (isPermanent(e)) throw e; lastReason = e && e.message || String(e); if (attempt < maxRetries) await sleep$2(400 * Math.pow(2, attempt)); } } throw new Error(lastReason); } async function downloadBatch(items, opts = {}) { const total = items.length; const result = { total, ok: 0, failed: [] }; if (!total) return result; const baseConc = Math.max(1, opts.concurrency || 4); const gapMs = opts.gapMs === void 0 ? 400 : opts.gapMs; const maxRetries = Math.max(0, opts.maxRetries === void 0 ? 2 : opts.maxRetries); const maxReady = Math.max(1, opts.maxReady || 8); let nextFetch = 0; let doneCount = 0; let dynamicConc = baseConc; let consecutiveFails = 0; let fetchedAll = false; const ready = []; const failOne = (item, reason) => { doneCount++; result.failed.push({ key: item.key, filename: item.filename, reason }); if (opts.onProgress) opts.onProgress(doneCount, total); if (opts.onItem) opts.onItem(item, false, reason); }; const prefetchLoop = async () => { const inflight = new Set(); while (nextFetch < total) { if (inflight.size >= dynamicConc || ready.length >= maxReady) { await sleep$2(20); continue; } const item = items[nextFetch++]; const p = (async () => { try { const r = await prefetchOne(item, maxRetries); ready.push({ item, href: r.href, obj: r.obj }); consecutiveFails = 0; } catch (e) { const reason = e && e.message || String(e); consecutiveFails++; if (consecutiveFails >= 3) { dynamicConc = Math.max(1, dynamicConc - 1); consecutiveFails = 0; } failOne(item, reason); } })().finally(() => inflight.delete(p)); inflight.add(p); } while (inflight.size > 0) await sleep$2(20); fetchedAll = true; }; const triggerLoop = async () => { for (; ; ) { while (!ready.length) { if (fetchedAll) return; await sleep$2(30); } const one = ready.shift(); const ok = anchorDownload(one.href, one.item.filename); if (one.obj) setTimeout(() => URL.revokeObjectURL(one.href), 1e3); doneCount++; if (ok) { result.ok++; } else { result.failed.push({ key: one.item.key, filename: one.item.filename, reason: "触发下载失败" }); } if (opts.onProgress) opts.onProgress(doneCount, total); if (opts.onItem) opts.onItem(one.item, ok, ok ? void 0 : "触发下载失败"); await sleep$2(gapMs); } }; await Promise.all([prefetchLoop(), triggerLoop()]); return result; } const PANEL_HOST_ID = "__znhd_panel_host__"; const OVERLAY_HOST_ID = "__znhd_overlay_host__"; const SNIFF_EXCLUDE_SELECTOR = ["#" + PANEL_HOST_ID, "#" + OVERLAY_HOST_ID].join(","); const PRE_INITIAL_DELAY = 5e3; const PRE_INTERVAL = 6e4; const PRE_CONCURRENCY = 2; const PRE_MAX_NET_PER_ROUND = 60; const PRE_CSS_LIMIT = 1200; let enabled = false; let timer$2 = null; let running = false; let rounds = 0; function schedule(delay) { if (!enabled || timer$2 !== null) return; timer$2 = window.setTimeout(() => { timer$2 = null; void runRound(); }, delay); } function isZeroCost(it) { if (it.kind !== "http") return true; return !!(it.perfBytes && it.perfBytes > 0); } async function runRound() { if (!enabled || running) return; running = true; try { const res = collectCandidates({ excludeSelector: SNIFF_EXCLUDE_SELECTOR, cssLimit: PRE_CSS_LIMIT }); const fresh = res.items.filter((it) => !measuredOf(it.key)); if (fresh.length) { const zero = fresh.filter(isZeroCost); const paid = fresh.filter((it) => !isZeroCost(it)).slice(0, PRE_MAX_NET_PER_ROUND); if (zero.length || paid.length) { await resolveSizes(zero.concat(paid), { concurrency: PRE_CONCURRENCY }); } } rounds++; } catch (e) { } finally { running = false; if (enabled) schedule(PRE_INTERVAL); } } function setPreMeasureEnabled(v) { const next = !!v; if (next === enabled) return; enabled = next; if (next) { schedule(PRE_INITIAL_DELAY); } else if (timer$2 !== null) { window.clearTimeout(timer$2); timer$2 = null; } } const A4_W_MM = 210; const A4_H_MM = 297; const A4_PAD_MM = 10; const PRINT_BOX_W_MM = A4_W_MM; const PRINT_BOX_H_MM = A4_H_MM - 3; const IMG_AREA_W_MM = PRINT_BOX_W_MM - 2 * A4_PAD_MM; const IMG_AREA_H_MM = PRINT_BOX_H_MM - 2 * A4_PAD_MM; const PRINT_PAGE_STYLE = "@page { size: A4 portrait; margin: 0; } html, body { margin: 0; padding: 0; }"; function buildA4ImageNode(src, alt, natural) { const node = document.createElement("div"); node.style.cssText = `box-sizing:border-box;width:${PRINT_BOX_W_MM}mm;height:${PRINT_BOX_H_MM}mm;padding:${A4_PAD_MM}mm;overflow:hidden;`; const img = document.createElement("img"); img.src = src; img.alt = alt; const isLandscape = !!natural && natural.width > natural.height; if (isLandscape) { node.style.display = "flex"; node.style.alignItems = "center"; node.style.justifyContent = "center"; img.style.width = IMG_AREA_H_MM + "mm"; img.style.height = IMG_AREA_W_MM + "mm"; img.style.transform = "rotate(90deg)"; } else { img.style.width = "100%"; img.style.height = "100%"; } img.style.objectFit = "contain"; img.style.display = "block"; node.appendChild(img); return node; } function printA4Image(src, title) { const run = (natural) => { const node = buildA4ImageNode(src, title, natural); const frame = document.createElement("iframe"); frame.id = "printWindow"; frame.setAttribute("aria-hidden", "true"); frame.style.cssText = "position:fixed;right:0;bottom:0;width:0;height:0;border:0;opacity:0;pointer-events:none;"; document.body.appendChild(frame); const doc2 = frame.contentDocument; if (!doc2) { frame.remove(); return; } const safeTitle = title.replace( /[<>&"]/g, (c) => c === "<" ? "<" : c === ">" ? ">" : c === "&" ? "&" : """ ); doc2.open(); doc2.write( '' + safeTitle + "" ); doc2.close(); doc2.body.appendChild(doc2.importNode(node, true)); const fire = () => { var _a2, _b; try { (_a2 = frame.contentWindow) == null ? void 0 : _a2.focus(); (_b = frame.contentWindow) == null ? void 0 : _b.print(); } catch (e) { } window.setTimeout(() => frame.remove(), 6e4); }; const img = doc2.body.querySelector("img"); if (img && !img.complete) { img.addEventListener("load", fire, { once: true }); img.addEventListener("error", fire, { once: true }); } else { window.setTimeout(fire, 80); } }; const probe = new Image(); probe.onload = () => run({ width: probe.naturalWidth, height: probe.naturalHeight }); probe.onerror = () => run(); probe.src = src; } const PRINT_MARK = "data-znhd-print"; const IMAGE_MENU_KEY = "转存到内网"; const MIN_ITEMS = 3; let lastImage = null; let started$1 = false; let observer$1 = null; let scanTimer$1 = null; function pageDoc() { const w = typeof unsafeWindow !== "undefined" ? unsafeWindow : window; return w.document || document; } function guessName(src) { try { const name = new URL(src, location.href).pathname.split("/").pop() || ""; return decodeURIComponent(name) || "图片"; } catch { return "图片"; } } function onContextMenuCapture(e) { var _a2, _b, _c; const t = e.target; if (!t || t.nodeType !== 1) return; const img = t.tagName === "IMG" ? t : (_c = (_b = (_a2 = t.closest) == null ? void 0 : _a2.call(t, ".image-item")) == null ? void 0 : _b.querySelector("img")) != null ? _c : null; if (!img) return; const src = img.currentSrc || img.src; if (!src) return; lastImage = { src, name: img.alt || guessName(src) }; } function hideMenus() { let uls; try { uls = pageDoc().querySelectorAll("ul.v-contextmenu"); } catch { return; } uls.forEach((u) => { const vm = u.__vue__; if (!vm) return; try { if (typeof vm.hide === "function") vm.hide(); } catch { } try { vm.visible = false; } catch { } }); uls.forEach((u) => { if (getComputedStyle(u).display === "none") return; u.style.setProperty("display", "none", "important"); }); } function onPrintClick() { const ctx = lastImage; hideMenus(); window.setTimeout(hideMenus, 0); window.setTimeout(hideMenus, 350); if (!(ctx == null ? void 0 : ctx.src)) return; printA4Image(ctx.src, ctx.name); } function isImageMenu(ul) { const texts = [...ul.querySelectorAll("li > .menu-text")].map((s) => (s.textContent || "").trim()); return texts.length >= MIN_ITEMS && texts.includes(IMAGE_MENU_KEY); } function injectInto(ul) { if (ul.querySelector(`[${PRINT_MARK}]`)) return; const first = ul.querySelector("li"); if (!first) return; const li = document.createElement("li"); for (const a of [...first.attributes]) { if (a.name !== "class" && a.name !== "id") li.setAttribute(a.name, a.value); } li.className = "v-contextmenu-item"; li.setAttribute(PRINT_MARK, ""); const span = document.createElement("span"); span.className = "menu-text"; span.textContent = "打印"; li.appendChild(span); li.addEventListener("click", onPrintClick); li.addEventListener("mouseenter", () => li.classList.add("v-contextmenu-item--hover")); li.addEventListener("mouseleave", () => li.classList.remove("v-contextmenu-item--hover")); ul.appendChild(li); } function scan$1() { pageDoc().querySelectorAll("ul.v-contextmenu").forEach((ul) => { if (isImageMenu(ul)) injectInto(ul); }); } function scheduleScan$1() { if (scanTimer$1 !== null) return; scanTimer$1 = window.setTimeout(() => { scanTimer$1 = null; try { scan$1(); } catch (e) { console.warn("[打印] 右键菜单注入失败:", e); } }, 300); } function startImageContextMenu() { if (started$1) return; started$1 = true; document.addEventListener("contextmenu", onContextMenuCapture, true); scan$1(); observer$1 = new MutationObserver(scheduleScan$1); observer$1.observe(document.body, { childList: true, subtree: true }); } function stopImageContextMenu() { if (!started$1) return; started$1 = false; document.removeEventListener("contextmenu", onContextMenuCapture, true); observer$1 == null ? void 0 : observer$1.disconnect(); observer$1 = null; if (scanTimer$1 !== null) { window.clearTimeout(scanTimer$1); scanTimer$1 = null; } } const STYLE_ID = "__znhd_todo_badge_style__"; const MARK$1 = "data-znhd-todo"; const CARD_CLASS = "znhd-todo-card"; const KEYWORDS = ["待处理留言", "待处理预约"]; const CSS$2 = [ "@keyframes znhdTodoGlow{0%,100%{box-shadow:0 0 0 0 rgba(229,72,77,.65)}50%{box-shadow:0 0 0 7px rgba(229,72,77,0)}}", "@keyframes znhdTodoPing{0%{opacity:.85;transform:scale(1)}100%{opacity:0;transform:scale(1.12)}}", "." + CARD_CLASS + "{position:relative;background-color:#ffe6e6!important;border:2px solid #e5484d!important;border-radius:8px!important;animation:znhdTodoGlow 3.2s ease-in-out infinite!important;}", "." + CARD_CLASS + '::after{content:"";position:absolute;inset:-3px;border-radius:11px;border:2px solid #e5484d;pointer-events:none;animation:znhdTodoPing 1.2s cubic-bezier(0,0,.2,1) 1 both;}' ].join("\n"); let started = false; let observer = null; let scanTimer = null; function ensureStyle() { if (document.getElementById(STYLE_ID)) return; const host2 = document.head || document.documentElement; if (!host2) return; const style = document.createElement("style"); style.id = STYLE_ID; style.textContent = CSS$2; host2.appendChild(style); } function countOf(card) { const el = card == null ? void 0 : card.querySelector(".count"); if (!el) return 0; return parseInt((el.textContent || "0").trim(), 10) || 0; } function scan() { ensureStyle(); document.querySelectorAll("[" + MARK$1 + "]").forEach((title) => { const card = title.closest(".message-item"); if (card && countOf(card) > 0) return; card == null ? void 0 : card.classList.remove(CARD_CLASS); title.removeAttribute(MARK$1); }); const root = document.body || document.documentElement; if (!root) return; for (const keyword of KEYWORDS) { const xpath = '//div[contains(@class,"title")][contains(., "' + keyword + '")]'; const result = document.evaluate(xpath, root, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (let i = 0; i < result.snapshotLength; i++) { const title = result.snapshotItem(i); if (!title || title.hasAttribute(MARK$1)) continue; const card = title.closest(".message-item"); if (!card || countOf(card) <= 0) continue; card.classList.add(CARD_CLASS); title.setAttribute(MARK$1, ""); } } } function scheduleScan() { if (scanTimer !== null) return; scanTimer = window.setTimeout(() => { scanTimer = null; try { scan(); } catch (e) { console.warn("[待办提醒] 注入失败:", e); } }, 300); } function startTodoBadge() { if (started) return; const root = document.body || document.documentElement; if (!root) return; started = true; try { scan(); } catch (e) { console.warn("[待办提醒] 首扫失败:", e); } observer = new MutationObserver(scheduleScan); observer.observe(root, { childList: true, subtree: true, characterData: true }); } function stopTodoBadge() { if (!started) return; started = false; observer == null ? void 0 : observer.disconnect(); observer = null; if (scanTimer !== null) { window.clearTimeout(scanTimer); scanTimer = null; } } function resolveGithubUrl(githubUrl) { const url = githubUrl.trim(); if (!url) return url; const useCdn = runtime$1.useCdn; const ghBlob = /^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/blob\/(.+)$/i; if (ghBlob.test(url)) { if (useCdn) { return url.replace(ghBlob, "https://fastly.jsdelivr.net/gh/$1/$2@$3"); } return url.replace(ghBlob, "https://raw.githubusercontent.com/$1/$2/$3"); } const raw = /^https?:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/(.+)$/i; if (raw.test(url)) { if (useCdn) { return url.replace(raw, "https://fastly.jsdelivr.net/gh/$1/$2@$3"); } return url; } return url; } const _escapeHelper = document.createElement("div"); function escapeHtml(text) { _escapeHelper.textContent = text; return _escapeHelper.innerHTML; } function hoursToHHmm(h2) { if (typeof h2 !== "number" || isNaN(h2)) return "00:00"; let total = Math.round(h2 * 60); if (total < 0) total = 0; if (total > 24 * 60) total = 24 * 60; const H = Math.floor(total / 60) % 24; const M = total % 60; return String(H).padStart(2, "0") + ":" + String(M).padStart(2, "0"); } function pageWin() { try { if (typeof unsafeWindow !== "undefined" && unsafeWindow) return unsafeWindow; } catch (e) { } return window; } function getEditor() { var _a2, _b; const ed = (_b = (_a2 = pageWin()) == null ? void 0 : _a2.tinymce) == null ? void 0 : _b.activeEditor; return ed && typeof ed.insertContent === "function" ? ed : null; } function syncInputbox(html) { var _a2, _b; const el = (_b = (_a2 = pageWin()) == null ? void 0 : _a2.document) == null ? void 0 : _b.querySelector(".input-tinymce"); let vm = el == null ? void 0 : el.__vue__; for (let i = 0; i < 6 && vm; i++) { if (typeof vm.updateText === "function") { vm.updateText(html); return true; } vm = vm.$parent; } return false; } function replaceToTinyMCE(text = "") { const editor = getEditor(); if (!editor) { addLog("找不到 TinyMCE 编辑器(页面未就绪?)", "error", true); return ""; } const html = escapeHtml(text).replace(/\n/g, "
"); editor.setContent(html); const content = editor.getContent(); if (!syncInputbox(content)) { addLog("未能同步输入框状态(未找到 Inputbox 组件)", "warning", true); } const finalText = editor.getContent({ format: "text" }); addLog("已替换输入框文本: " + finalText, "success", true); return finalText; } function appendToTinyMCE(text2append = "") { const editor = getEditor(); if (!editor) { addLog("找不到 TinyMCE 编辑器(页面未就绪?)", "error", true); return ""; } const body = editor.getBody(); const isEmpty2 = !((body == null ? void 0 : body.textContent) || "").trim(); const html = escapeHtml(text2append).replace(/\n/g, "
"); const payload = isEmpty2 ? html : "
" + html; editor.focus(); editor.selection.select(body, true); editor.selection.collapse(false); editor.insertContent(payload); const content = editor.getContent(); if (!syncInputbox(content)) { addLog("未能同步输入框状态(未找到 Inputbox 组件)", "warning", true); } const finalText = editor.getContent({ format: "text" }); addLog("已追加文本并同步: " + finalText, "success", true); return finalText; } const MAX_MESSAGES = 10; const EMPTY = { text: "", source: "none", count: 0, org: "" }; function hostDoc$1() { try { if (typeof unsafeWindow !== "undefined" && (unsafeWindow == null ? void 0 : unsafeWindow.document)) return unsafeWindow.document; } catch { } return typeof document !== "undefined" ? document : null; } function readVueInstance$1() { const docs = [hostDoc$1(), typeof document !== "undefined" ? document : null]; for (const d of docs) { if (!d) continue; try { const el = d.querySelector("#app"); const vm = el && el.__vue__; if (vm && vm.$store && vm.$store.state) return vm; } catch { } } return null; } function textOfMessage(msg) { if (!msg || typeof msg !== "object") return ""; const m = msg; const payload = m["payload"] || {}; for (const v of [payload["text"], m["text"], m["content"], m["msg"], payload["content"], payload["msg"]]) { if (typeof v === "string" && v.trim()) return v; } return ""; } function readOrg() { var _a2; try { const vm = readVueInstance$1(); const st2 = (_a2 = vm == null ? void 0 : vm.$store) == null ? void 0 : _a2.state; if (!st2) return ""; const chat = st2["chat"]; const selectItem = chat ? chat["selectItem"] : void 0; const guide = selectItem ? selectItem["taxguideRecord"] : void 0; if (!guide || typeof guide !== "object") return ""; const rec = guide; for (const key of ["swjgMc", "swjgmc"]) { const v = rec[key]; if (typeof v === "string" && v.trim()) return v.trim(); } return ""; } catch { return ""; } } function fromStore() { var _a2; const vm = readVueInstance$1(); const st2 = (_a2 = vm == null ? void 0 : vm.$store) == null ? void 0 : _a2.state; if (!st2) return EMPTY; const chat = st2["chat"]; const list = chat ? chat["messageList"] : void 0; if (!Array.isArray(list) || !list.length) return EMPTY; const parts = []; for (let i = list.length - 1; i >= 0 && parts.length < MAX_MESSAGES; i--) { const t = textOfMessage(list[i]); if (t) parts.unshift(t); } if (!parts.length) return EMPTY; return { text: parts.join("\n"), source: "vuex", count: parts.length, org: "" }; } function fromSelector(selector) { if (!selector) return EMPTY; const docs = [hostDoc$1(), typeof document !== "undefined" ? document : null]; for (const d of docs) { if (!d) continue; try { const el = d.querySelector(selector); const t = el && el.textContent ? el.textContent.trim() : ""; if (t) return { text: t, source: "dom", count: 1, org: "" }; } catch { } } return EMPTY; } function joinOrg(text, org) { if (!org) return text; return text ? text + "\n" + org : org; } function readConversation(selector = "") { const org = readOrg(); const store = fromStore(); const base = store.text ? store : fromSelector(selector); const text = joinOrg(base.text, org); if (!text) return EMPTY; const source = base.text ? base.source : "org"; return { text, source, count: base.count, org }; } const APP_KEY = "scriptCat_FeishuApp"; const TOKEN_KEY = "scriptCat_FeishuToken"; const RULES_KEY = "scriptCat_QuickReplyRules"; const PRIVACY_RULES_KEY = "scriptCat_PrivacyRules"; const PRIVACY_TABLE_URL_KEY = "scriptCat_PrivacyTableUrl"; function read(key) { try { const raw = GM_getValue(key, ""); if (!raw) return null; if (typeof raw === "string") return JSON.parse(raw); return raw; } catch { return null; } } function write(key, value) { try { GM_setValue(key, JSON.stringify(value)); } catch { } } function remove(key) { try { GM_setValue(key, ""); } catch { } } function loadAppCred() { const v = read(APP_KEY); return v && v.clientId && v.clientSecret ? v : null; } function saveAppCred(cred) { write(APP_KEY, cred); } function loadToken() { const v = read(TOKEN_KEY); return v && v.accessToken ? v : null; } function saveToken(token) { write(TOKEN_KEY, token); } function loadRulesCache() { const v = read(RULES_KEY); return v && Array.isArray(v.rules) ? v : null; } function saveRulesCache(cache) { write(RULES_KEY, cache); } function loadPrivacyRulesCache() { const v = read(PRIVACY_RULES_KEY); return v && Array.isArray(v.rules) ? v : null; } function savePrivacyRulesCache(cache) { write(PRIVACY_RULES_KEY, cache); } function loadPrivacyTableUrl() { const v = read(PRIVACY_TABLE_URL_KEY); return v && v.trim() ? v.trim() : null; } function savePrivacyTableUrl(url) { write(PRIVACY_TABLE_URL_KEY, (url || "").trim()); } function clearAuth() { remove(TOKEN_KEY); remove(RULES_KEY); remove(PRIVACY_RULES_KEY); } function forgetApp() { remove(APP_KEY); remove(TOKEN_KEY); remove(RULES_KEY); remove(PRIVACY_RULES_KEY); } function normalize$1(input) { if (!input) return ""; let out = ""; for (let i = 0; i < input.length; i++) { const code = input.charCodeAt(i); if (code >= 65281 && code <= 65374) { out += String.fromCharCode(code - 65248); } else if (code === 12288) { out += " "; } else { out += input.charAt(i); } } return out.replace(/\s+/g, "").toLowerCase(); } function anyHit(normalizedText, words) { for (const w of words) { const k = normalize$1(w); if (k && normalizedText.indexOf(k) >= 0) return true; } return false; } function allHit(normalizedText, words) { for (const w of words) { const k = normalize$1(w); if (!k) continue; if (normalizedText.indexOf(k) < 0) return false; } return true; } function matchRules(conversationText, rules) { const text = normalize$1(conversationText); if (!text) return []; const hits2 = []; for (const rule of rules) { const musts = rule.musts || []; const excludes = rule.excludes || []; const keywords = rule.keywords || []; if (excludes.length && anyHit(text, excludes)) continue; if (!allHit(text, musts)) continue; if (!keywords.length) continue; if (anyHit(text, keywords)) hits2.push(rule); } return hits2; } function matchByOrgText(orgText, rules) { const target = normalize$1(orgText); if (!target) return []; const hits2 = []; for (const rule of rules) { const musts = rule.musts || []; for (const m of musts) { if (normalize$1(m) === target) { hits2.push(rule); break; } } } return hits2; } const RESOLVERS = { Active_Cnt: resolveActiveCnt }; function resolveActiveCnt() { var _a2; const vm = readVueInstance$1(); const st2 = (_a2 = vm == null ? void 0 : vm.$store) == null ? void 0 : _a2.state; if (st2) { const chat = st2["chat"]; const gil = chat ? chat["groupInfoList"] : void 0; if (Array.isArray(gil)) return { value: String(gil.length), source: "groupInfoList" }; const allChat = st2["allChat"]; const hm = allChat ? allChat["historyMsg"] : void 0; if (hm && typeof hm === "object") { return { value: String(Object.keys(hm).length), source: "historyMsg" }; } } return { value: "0", source: "未知" }; } function expandMagicVars(text) { if (!text || text.indexOf("${") < 0) return text; return text.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (raw, name) => { const resolver = RESOLVERS[name]; if (!resolver) return raw; const { value, source } = resolver(); addLog("正在对话人数(" + source + "):" + value + " 人", "info"); return value; }); } const dialogOpen = vue.reactive({ settings: false, phrases: false, transfer: false, sniff: false }); const voiceEnabled = vue.ref(false); const voiceToggler = vue.ref(() => { }); const orgPickRules = vue.ref(null); const orgPickSender = vue.ref(null); const MARK = "data-znhd-org-send"; const LABEL = "主管税务机关"; const MIN_FRAGMENT = 6; function doc() { return hostDoc$1(); } function isVisible(el) { try { return el.getClientRects().length > 0; } catch { return false; } } function blockOf(start, target) { var _a2; let el = start; const body = (_a2 = doc()) == null ? void 0 : _a2.body; while (el.parentElement && el.parentElement !== body) { const pt2 = normalize$1(el.parentElement.textContent || ""); if (!pt2 || target.indexOf(pt2) < 0) break; el = el.parentElement; } return el; } function findLabelEls() { const d = doc(); const root = d == null ? void 0 : d.body; const target = normalize$1(LABEL); if (!d || !root || !target) return []; const out = []; const walker = d.createTreeWalker(root, NodeFilter.SHOW_TEXT, { acceptNode(node) { const t = normalize$1(node.nodeValue || ""); if (!t || t.indexOf(target) !== 0 || t.length > target.length + 3) return NodeFilter.FILTER_REJECT; return NodeFilter.FILTER_ACCEPT; } }); for (let n = walker.nextNode(); n; n = walker.nextNode()) { const p = n.parentElement; if (!p || out.indexOf(p) >= 0 || !isVisible(p)) continue; out.push(p); } return out; } function lca(a, b) { let cur = a; while (cur) { if (cur.contains(b)) return cur; cur = cur.parentNode; } return null; } function pickCandidate(list, target) { if (!list.length) return null; const labels = findLabelEls(); if (labels.length) { const limit = target.length + normalize$1(LABEL).length + 40; const scored = []; for (const el of list) { if (!isVisible(el)) continue; let best = Infinity; for (const label of labels) { if (!(label.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING)) continue; const box = lca(label, el); if (!box) continue; const len = normalize$1(box.textContent || "").length; if (len <= limit && len < best) best = len; } if (best !== Infinity) scored.push({ el, len: best }); } if (!scored.length) return null; scored.sort((a, b) => a.len - b.len); return scored[0].el; } const seen2 = list.filter(isVisible); return seen2[0] || list[0] || null; } function pickLabel(block) { const labels = findLabelEls(); if (!labels.length) return null; if (!block) return labels[0]; let best = null; for (const label of labels) { if (!(label.compareDocumentPosition(block) & Node.DOCUMENT_POSITION_FOLLOWING)) continue; const box = lca(label, block); if (!box) continue; const len = normalize$1(box.textContent || "").length; if (!best || len < best.len) best = { el: label, len }; } return best ? best.el : labels[0]; } function findOrgValueBlock(org) { const d = doc(); const root = d == null ? void 0 : d.body; const target = normalize$1(org); if (!d || !root || !target) return null; const strict = []; const loose = []; const walker = d.createTreeWalker(root, NodeFilter.SHOW_TEXT, { acceptNode(node) { const t = normalize$1(node.nodeValue || ""); if (t.length < MIN_FRAGMENT || target.indexOf(t) < 0) return NodeFilter.FILTER_REJECT; const el = node.parentElement; if (el && el.closest("[" + MARK + "]")) return NodeFilter.FILTER_REJECT; return NodeFilter.FILTER_ACCEPT; } }); for (let n = walker.nextNode(); n; n = walker.nextNode()) { const p = n.parentElement; if (!p) continue; const block = blockOf(p, target); const text = normalize$1(block.textContent || ""); const bucket = text === target ? strict : loose; if (bucket.indexOf(block) < 0) bucket.push(block); } return pickCandidate(strict, target) || pickCandidate(loose, target); } function findOrgAnchor(org) { const block = findOrgValueBlock(org); const label = pickLabel(block); if (label) return { el: label, kind: "label" }; return block ? { el: block, kind: "value" } : null; } function readOrgFromDom() { const LABEL_RE = /主管税务机关[::]?/; for (const label of findLabelEls()) { const row = label.parentElement; if (row) { const t = normalize$1((row.textContent || "").replace(LABEL_RE, "")); if (t.length >= 4 && t.length <= 60) return t; } const sib = label.nextElementSibling; if (sib) { const t = normalize$1(sib.textContent || ""); if (t.length >= 4 && t.length <= 60) return t; } } return ""; } const DURATION = 3200; const DURATION_ERROR = 4200; const KIND_COLOR = { success: "success", error: "error", warning: "warning", info: "info", loading: "neutral" }; const KIND_ICON = { success: "i-lucide-circle-check", error: "i-lucide-circle-x", warning: "i-lucide-triangle-alert", info: "i-lucide-info" }; function durationOf(kind) { if (kind === "loading") return 0; return kind === "error" ? DURATION_ERROR : DURATION; } const NOOP_HANDLE = { close: () => void 0, update: () => void 0 }; let bound = null; const pending = []; function bindToast(instance) { bound = instance; while (pending.length > 0) { const run = pending.shift(); run == null ? void 0 : run(); } } function show(kind, input) { const title = typeof input === "string" ? input : input.title || input.msg; const description = typeof input === "string" ? "" : input.title ? input.msg : ""; const applyUpdate = (next) => { var _a2, _b, _c; if (!bound) return; const nk = typeof next === "string" ? kind : (_a2 = next.kind) != null ? _a2 : kind; const nTitle = typeof next === "string" ? next : (_b = next.title) != null ? _b : title; const nDesc = typeof next === "string" ? "" : next.title ? (_c = next.msg) != null ? _c : description : description; const patch = { title: nTitle, color: KIND_COLOR[nk], duration: durationOf(nk), open: true }; if (nk === "loading") { patch.icon = void 0; } else { patch.icon = KIND_ICON[nk]; } if (nDesc) patch.description = nDesc; else patch.description = void 0; bound.update(currentId, patch); }; const run = () => { if (!bound) return NOOP_HANDLE; const id = "znhd-" + kind + "\0" + title; currentId = id; bound.add({ id, title, ...description ? { description } : {}, color: KIND_COLOR[kind], icon: kind === "loading" ? void 0 : KIND_ICON[kind], duration: durationOf(kind), progress: false, close: false }); return { close: () => bound == null ? void 0 : bound.remove(id), update: applyUpdate }; }; let currentId = ""; if (!bound) { let handle = NOOP_HANDLE; pending.push(() => { handle = run(); }); return { close: () => handle.close(), update: (next) => handle.update(next) }; } return run(); } const toast = { success: (input) => show("success", input), error: (input) => show("error", input), warning: (input) => show("warning", input), info: (input) => show("info", input), loading: (input) => show("loading", input) }; const toast$1 = Object.freeze( Object.defineProperty({ __proto__: null, bindToast, toast }, Symbol.toStringTag, { value: "Module" })); const TICK_MS = 2e3; const SVG = ''; const CSS$1 = [ ":host{display:inline-flex;align-items:center;justify-content:center;", "width:20px;height:20px;margin:0 0 0 6px;padding:0;line-height:0;vertical-align:middle;flex:none;}", "button{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;", "margin:0;padding:0;border:0;border-radius:4px;background:transparent;color:inherit;", "cursor:pointer;opacity:.55;transition:opacity .15s ease,transform .15s ease;}", "button:hover{opacity:1;transform:translateX(1px);}", "button:active{transform:scale(.92);}", "button:focus-visible{outline:2px solid currentColor;outline-offset:1px;opacity:1;}" ].join(""); let timer$1 = null; let host = null; let shownOrg = ""; let shownRuleSig = ""; function send$1(rule) { if (!rule.reply.trim()) { toast.error("该条没有填写「内容」列:" + rule.title); return; } const text = replaceToTinyMCE(expandMagicVars(rule.reply)); if (text) toast.success("已填入:" + rule.title); else toast.error("输入框未就绪,请稍后重试"); } function buildIcon(matched) { const rule = matched[0]; const multi = matched.length > 1; const hint = multi ? "填入(共 " + matched.length + " 条可选)" : "填入:" + rule.title; const d = hostDoc$1() || document; const wrap = d.createElement("span"); wrap.setAttribute(MARK, ""); wrap.style.cssText = "display:inline-flex;align-items:center;margin:0 0 0 6px;padding:0;line-height:0;vertical-align:middle;"; const shadow = wrap.attachShadow({ mode: "open" }); const style = d.createElement("style"); style.textContent = CSS$1; shadow.appendChild(style); const btn = d.createElement("button"); btn.type = "button"; btn.title = hint; btn.setAttribute("aria-label", hint); btn.innerHTML = SVG; btn.addEventListener("click", (ev) => { ev.preventDefault(); ev.stopPropagation(); if (multi) { orgPickSender.value = send$1; orgPickRules.value = matched; } else { send$1(rule); } }); shadow.appendChild(btn); return wrap; } function clearIcon() { if (host) { try { host.remove(); } catch { } } host = null; shownOrg = ""; shownRuleSig = ""; orgPickRules.value = null; } let lastWhy = ""; function note(why) { if (why === lastWhy) return; lastWhy = why; addLog("税务机关发送图标:" + why, "info"); } function tick() { var _a2; const org = readOrg() || readOrgFromDom(); if (!org) { clearIcon(); note("未读到主管税务机关(页面上也没有可识别的该字段)"); return; } const rules = ((_a2 = loadPrivacyRulesCache()) == null ? void 0 : _a2.rules) || []; if (!rules.length) { clearIcon(); note("隐私信息表规则还没加载(去设置里选表,或点「立即刷新规则」)"); return; } const matched = matchByOrgText(org, rules); if (!matched.length) { clearIcon(); note("隐私信息表里没有「必含关键词」与该税务机关完全一致的条目"); return; } const sig = matched.map((r) => r.id).join("|"); if (host && host.isConnected && shownOrg === org && shownRuleSig === sig) return; const anchor = findOrgAnchor(org); if (!anchor) { clearIcon(); note("页面上找不到该字段的位置(站点结构可能变了)"); return; } clearIcon(); host = buildIcon(matched); anchor.el.appendChild(host); shownOrg = org; shownRuleSig = sig; if (host.isConnected) { lastWhy = ""; addLog( "主管税务机关旁已挂发送图标:" + matched[0].title + (anchor.kind === "value" ? "(挂在值的右侧:没定位到标签)" : "") + (matched.length > 1 ? "(同词 " + matched.length + " 条,点击可选择)" : ""), "info" ); } } function startOrgSendButton() { if (timer$1 !== null) return; try { tick(); } catch (e) { console.warn("[税务机关发送] 首轮失败:", e); } timer$1 = window.setInterval(() => { try { tick(); } catch (e) { console.warn("[税务机关发送] 注入失败:", e); } }, TICK_MS); } function stopOrgSendButton() { if (timer$1 !== null) window.clearInterval(timer$1); timer$1 = null; clearIcon(); orgPickRules.value = null; } const css = `@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:host,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:var(--ui-radius);--shadow-sm:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-old-neutral-50:oklch(98.5% 0 none);--color-old-neutral-100:oklch(97% 0 none);--color-old-neutral-200:oklch(92.2% 0 none);--color-old-neutral-300:oklch(87% 0 none);--color-old-neutral-400:oklch(70.8% 0 none);--color-old-neutral-500:oklch(55.6% 0 none);--color-old-neutral-600:oklch(43.9% 0 none);--color-old-neutral-700:oklch(37.1% 0 none);--color-old-neutral-800:oklch(26.9% 0 none);--color-old-neutral-900:oklch(20.5% 0 none);--color-old-neutral-950:oklch(14.5% 0 none);--color-primary:var(--ui-primary)}:host,:host{--ui-header-height:4rem;--ui-radius:.25rem;--ui-container:80rem}.light,:host,:host{--ui-text-dimmed:var(--ui-color-neutral-400);--ui-text-muted:var(--ui-color-neutral-500);--ui-text-toned:var(--ui-color-neutral-600);--ui-text:var(--ui-color-neutral-700);--ui-text-highlighted:var(--ui-color-neutral-900);--ui-text-inverted:#fff;--ui-bg:#fff;--ui-bg-muted:var(--ui-color-neutral-50);--ui-bg-elevated:var(--ui-color-neutral-100);--ui-bg-accented:var(--ui-color-neutral-200);--ui-bg-inverted:var(--ui-color-neutral-900);--ui-border:var(--ui-color-neutral-200);--ui-border-muted:var(--ui-color-neutral-200);--ui-border-accented:var(--ui-color-neutral-300);--ui-border-inverted:var(--ui-color-neutral-900);--ui-chart-1:var(--ui-primary);--ui-chart-2:var(--color-blue-500,oklch(62.3% .214 259.815));--ui-chart-3:var(--color-violet-500,oklch(60.6% .25 292.717));--ui-chart-4:var(--color-amber-500,oklch(76.9% .188 70.08));--ui-chart-5:var(--color-rose-500,oklch(64.5% .246 16.439));--ui-chart-6:var(--color-cyan-500,oklch(71.5% .143 215.221))}.dark{--ui-text-dimmed:var(--ui-color-neutral-500);--ui-text-muted:var(--ui-color-neutral-400);--ui-text-toned:var(--ui-color-neutral-300);--ui-text:var(--ui-color-neutral-200);--ui-text-highlighted:#fff;--ui-text-inverted:var(--ui-color-neutral-900);--ui-bg:var(--ui-color-neutral-900);--ui-bg-muted:var(--ui-color-neutral-800);--ui-bg-elevated:var(--ui-color-neutral-800);--ui-bg-accented:var(--ui-color-neutral-700);--ui-bg-inverted:#fff;--ui-border:var(--ui-color-neutral-800);--ui-border-muted:var(--ui-color-neutral-700);--ui-border-accented:var(--ui-color-neutral-700);--ui-border-inverted:#fff;--ui-chart-1:var(--ui-primary);--ui-chart-2:var(--color-blue-400,oklch(70.7% .165 254.624));--ui-chart-3:var(--color-violet-400,oklch(70.2% .183 293.541));--ui-chart-4:var(--color-amber-400,oklch(82.8% .189 84.429));--ui-chart-5:var(--color-rose-400,oklch(71.2% .194 13.428));--ui-chart-6:var(--color-cyan-400,oklch(78.9% .154 211.53))}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}body{background-color:var(--ui-bg);color:var(--ui-text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color-scheme:light}body:where(.dark,.dark *){color-scheme:dark}a:focus-visible{outline-offset:0}}@layer components;@layer utilities{.\\@container{container-type:inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-auto{inset:auto}.inset-x-0{inset-inline:0}.inset-x-1{inset-inline:var(--spacing)}.inset-x-4{inset-inline:calc(var(--spacing) * 4)}.inset-x-px{inset-inline:1px}.inset-y-0{inset-block:0}.inset-y-1{inset-block:var(--spacing)}.inset-y-3{inset-block:calc(var(--spacing) * 3)}.inset-y-4{inset-block:calc(var(--spacing) * 4)}.-start-px{inset-inline-start:-1px}.start-0{inset-inline-start:calc(var(--spacing) * 0)}.start-32{inset-inline-start:calc(var(--spacing) * 32)}.end-0{inset-inline-end:calc(var(--spacing) * 0)}.end-4{inset-inline-end:calc(var(--spacing) * 4)}.-top-8{top:calc(var(--spacing) * -8)}.top-0{top:0}.top-1{top:var(--spacing)}.top-1\\.5{top:calc(var(--spacing) * 1.5)}.top-1\\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-\\[50\\%\\]{top:50%}.top-\\[86\\%\\]{top:86%}.top-full{top:100%}.right-0{right:0}.right-1{right:var(--spacing)}.right-1\\.5{right:calc(var(--spacing) * 1.5)}.right-1\\/2{right:50%}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.-bottom-px{bottom:-1px}.bottom-0{bottom:0}.bottom-1{bottom:var(--spacing)}.bottom-1\\.5{bottom:calc(var(--spacing) * 1.5)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-px{bottom:1px}.left-\\(--reka-navigation-menu-viewport-left\\){left:var(--reka-navigation-menu-viewport-left)}.left-0{left:0}.left-0\\.5{left:calc(var(--spacing) * .5)}.left-1{left:var(--spacing)}.left-1\\.5{left:calc(var(--spacing) * 1.5)}.left-1\\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-\\(--index\\){z-index:var(--index)}.z-1{z-index:1}.z-2{z-index:2}.z-10{z-index:10}.z-50{z-index:50}.z-\\[2\\]{z-index:2}.z-\\[100\\]{z-index:100}.order-0{order:0}.order-first{order:-9999}.order-last{order:9999}.order-none{order:0}.col-start-1{grid-column-start:1}.row-start-1{grid-row-start:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-3{margin-block:calc(var(--spacing) * 3)}.my-5{margin-block:calc(var(--spacing) * 5)}.my-12{margin-block:calc(var(--spacing) * 12)}.-ms-1{margin-inline-start:calc(var(--spacing) * -1)}.-ms-px{margin-inline-start:-1px}.ms-2{margin-inline-start:calc(var(--spacing) * 2)}.ms-4{margin-inline-start:calc(var(--spacing) * 4)}.ms-4\\.5{margin-inline-start:calc(var(--spacing) * 4.5)}.ms-5{margin-inline-start:calc(var(--spacing) * 5)}.ms-5\\.5{margin-inline-start:calc(var(--spacing) * 5.5)}.ms-6{margin-inline-start:calc(var(--spacing) * 6)}.ms-auto{margin-inline-start:auto}.-me-1{margin-inline-end:calc(var(--spacing) * -1)}.me-1{margin-inline-end:var(--spacing)}.me-2{margin-inline-end:calc(var(--spacing) * 2)}.-mt-8{margin-top:calc(var(--spacing) * -8)}.mt-0{margin-top:0}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mt-16{margin-top:calc(var(--spacing) * 16)}.mt-24{margin-top:calc(var(--spacing) * 24)}.mt-\\[-6px\\]{margin-top:-6px}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.\\!mr-4{margin-right:calc(var(--spacing) * 4)!important}.mr-1{margin-right:var(--spacing)}.mr-1\\.5{margin-right:calc(var(--spacing) * 1.5)}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-24{margin-bottom:calc(var(--spacing) * 24)}.mb-auto{margin-bottom:auto}.\\!ml-4{margin-left:calc(var(--spacing) * 4)!important}.ml-1{margin-left:var(--spacing)}.ml-1\\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-auto{margin-left:auto}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.aspect-square{aspect-ratio:1}.size-1{width:var(--spacing);height:var(--spacing)}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-4\\.5{width:calc(var(--spacing) * 4.5);height:calc(var(--spacing) * 4.5)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-10\\/12{width:83.3333%;height:83.3333%}.size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-\\[124px\\]{width:124px;height:124px}.size-full{width:100%;height:100%}.\\!h-1\\.5{height:calc(var(--spacing) * 1.5)!important}.\\!h-12{height:calc(var(--spacing) * 12)!important}.h-\\(--percent\\){height:var(--percent)}.h-\\(--reka-navigation-menu-viewport-height\\){height:var(--reka-navigation-menu-viewport-height)}.h-\\(--reka-tabs-indicator-size\\){height:var(--reka-tabs-indicator-size)}.h-0{height:0}.h-0\\.5{height:calc(var(--spacing) * .5)}.h-1{height:var(--spacing)}.h-2{height:calc(var(--spacing) * 2)}.h-2\\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-16{height:calc(var(--spacing) * 16)}.h-38{height:calc(var(--spacing) * 38)}.h-40{height:calc(var(--spacing) * 40)}.h-42{height:calc(var(--spacing) * 42)}.h-44{height:calc(var(--spacing) * 44)}.h-46{height:calc(var(--spacing) * 46)}.h-\\[4px\\]{height:4px}.h-\\[5px\\]{height:5px}.h-\\[6px\\]{height:6px}.h-\\[7px\\]{height:7px}.h-\\[8px\\]{height:8px}.h-\\[9px\\]{height:9px}.h-\\[10px\\]{height:10px}.h-\\[11px\\]{height:11px}.h-\\[12px\\]{height:12px}.h-\\[58vh\\]{height:58vh}.h-\\[360px\\]{height:360px}.h-\\[520px\\]{height:520px}.h-\\[680px\\]{height:680px}.h-auto{height:auto}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-\\(--reka-dropdown-menu-content-available-height\\){max-height:var(--reka-dropdown-menu-content-available-height)}.max-h-14{max-height:calc(var(--spacing) * 14)}.max-h-\\[50vh\\]{max-height:50vh}.max-h-\\[70vh\\]{max-height:70vh}.max-h-\\[96\\%\\]{max-height:96%}.max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.max-h-\\[min\\(15rem\\,var\\(--reka-combobox-content-available-height\\,15rem\\)\\)\\]{max-height:min(15rem,var(--reka-combobox-content-available-height,15rem))}.max-h-full{max-height:100%}.min-h-\\(--ui-header-height\\){min-height:var(--ui-header-height)}.min-h-0{min-height:0}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-8{min-height:calc(var(--spacing) * 8)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-\\[64px\\]{min-height:64px}.min-h-fit{min-height:fit-content}.min-h-svh{min-height:100svh}.\\!w-1\\.5{width:calc(var(--spacing) * 1.5)!important}.\\!w-12{width:calc(var(--spacing) * 12)!important}.w-\\(--percent\\){width:var(--percent)}.w-\\(--reka-combobox-trigger-width\\){width:var(--reka-combobox-trigger-width)}.w-\\(--reka-navigation-menu-indicator-size\\){width:var(--reka-navigation-menu-indicator-size)}.w-\\(--reka-tabs-indicator-size\\){width:var(--reka-tabs-indicator-size)}.w-0{width:0}.w-0\\.5{width:calc(var(--spacing) * .5)}.w-1{width:var(--spacing)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-20{width:calc(var(--spacing) * 20)}.w-36{width:calc(var(--spacing) * 36)}.w-38{width:calc(var(--spacing) * 38)}.w-40{width:calc(var(--spacing) * 40)}.w-42{width:calc(var(--spacing) * 42)}.w-44{width:calc(var(--spacing) * 44)}.w-46{width:calc(var(--spacing) * 46)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-\\[360px\\]{width:360px}.w-\\[420px\\]{width:420px}.w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)}.w-\\[calc\\(100vw-2rem\\)\\]{width:calc(100vw - 2rem)}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.max-w-\\[62\\%\\]{max-width:62%}.max-w-\\[74\\%\\|78\\%\\]{max-width:74%|78%}.max-w-\\[75\\%\\]{max-width:75%}.max-w-\\[78\\%\\]{max-width:78%}.max-w-\\[240px\\]{max-width:240px}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[560px\\]{max-width:560px}.max-w-\\[calc\\(100\\%-2rem\\)\\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-16{min-width:calc(var(--spacing) * 16)}.min-w-32{min-width:calc(var(--spacing) * 32)}.min-w-\\[4px\\]{min-width:4px}.min-w-\\[5px\\]{min-width:5px}.min-w-\\[6px\\]{min-width:6px}.min-w-\\[7px\\]{min-width:7px}.min-w-\\[8px\\]{min-width:8px}.min-w-\\[9px\\]{min-width:9px}.min-w-\\[10px\\]{min-width:10px}.min-w-\\[11px\\]{min-width:11px}.min-w-\\[12px\\]{min-width:12px}.min-w-\\[16px\\]{min-width:16px}.min-w-\\[20px\\]{min-width:20px}.min-w-\\[24px\\]{min-width:24px}.min-w-fit{min-width:fit-content}.min-w-max{min-width:max-content}.flex-1{flex:1}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-\\[52px\\]{flex-basis:52px}.basis-\\[86px\\]{flex-basis:86px}.basis-\\[92px\\]{flex-basis:92px}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.border-separate{border-collapse:separate}.border-spacing-0{--tw-border-spacing-x:0px;--tw-border-spacing-y:0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.border-spacing-x-0{--tw-border-spacing-x:0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.origin-\\(--reka-combobox-content-transform-origin\\){transform-origin:var(--reka-combobox-content-transform-origin)}.origin-\\(--reka-dropdown-menu-content-transform-origin\\){transform-origin:var(--reka-dropdown-menu-content-transform-origin)}.origin-\\(--reka-popover-content-transform-origin\\){transform-origin:var(--reka-popover-content-transform-origin)}.origin-\\(--reka-tooltip-content-transform-origin\\){transform-origin:var(--reka-tooltip-content-transform-origin)}.origin-\\[top_center\\]{transform-origin:top}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\(--reka-navigation-menu-indicator-position\\){--tw-translate-x:var(--reka-navigation-menu-indicator-position);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\(--reka-tabs-indicator-position\\){--tw-translate-x:var(--reka-tabs-indicator-position);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1\\/2{--tw-translate-x: 50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-4{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\(--reka-tabs-indicator-position\\){--tw-translate-y:var(--reka-tabs-indicator-position);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1\\/2{--tw-translate-y: 50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x) var(--tw-scale-y) var(--tw-scale-z)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.transform-\\(--transform\\){transform:var(--transform)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.cursor-zoom-in{cursor:zoom-in}.cursor-zoom-out{cursor:zoom-out}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.scroll-mt-3{scroll-margin-top:calc(var(--spacing) * 3)}.scroll-mt-4{scroll-margin-top:calc(var(--spacing) * 4)}.scroll-py-1{scroll-padding-block:var(--spacing)}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.columns-1{columns:1}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\\[repeat\\(auto-fill\\,minmax\\(96px\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fill,minmax(96px,1fr))}.grid-cols-\\[repeat\\(auto-fill\\,minmax\\(220px\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.place-items-baseline{place-items:baseline}.place-items-center{place-items:center}.content-center{align-content:center}.content-start{align-content:flex-start}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-around{justify-content:space-around}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:0}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-0\\.25{gap:calc(var(--spacing) * .25)}.gap-0\\.75{gap:calc(var(--spacing) * .75)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-16{gap:calc(var(--spacing) * 16)}:where(.-space-y-px>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(-1px * var(--tw-space-y-reverse));margin-block-end:calc(-1px * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}.gap-x-1{column-gap:var(--spacing)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}:where(.-space-x-px>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(-1px * var(--tw-space-x-reverse));margin-inline-end:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}.gap-y-0{row-gap:0}.gap-y-0\\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.gap-y-6{row-gap:calc(var(--spacing) * 6)}.gap-y-8{row-gap:calc(var(--spacing) * 8)}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-default>:not(:last-child)){border-color:var(--ui-border)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:calc(var(--ui-radius) * 4)}.rounded-\\[2px\\]{border-radius:2px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--ui-radius) * 2)}.rounded-md{border-radius:calc(var(--ui-radius) * 1.5)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--ui-radius)}.rounded-xl{border-radius:calc(var(--ui-radius) * 3)}.rounded-xs{border-radius:calc(var(--ui-radius) * .5)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-lg{border-top-left-radius:calc(var(--ui-radius) * 2);border-top-right-radius:calc(var(--ui-radius) * 2)}.rounded-t-md{border-top-left-radius:calc(var(--ui-radius) * 1.5);border-top-right-radius:calc(var(--ui-radius) * 1.5)}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-l-lg{border-top-left-radius:calc(var(--ui-radius) * 2);border-bottom-left-radius:calc(var(--ui-radius) * 2)}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-r-lg{border-top-right-radius:calc(var(--ui-radius) * 2);border-bottom-right-radius:calc(var(--ui-radius) * 2)}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-lg{border-bottom-right-radius:calc(var(--ui-radius) * 2);border-bottom-left-radius:calc(var(--ui-radius) * 2)}.rounded-b-md{border-bottom-right-radius:calc(var(--ui-radius) * 1.5);border-bottom-left-radius:calc(var(--ui-radius) * 1.5)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-s-4{border-inline-start-style:var(--tw-border-style);border-inline-start-width:4px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-bs{border-block-start-style:var(--tw-border-style);border-block-start-width:1px}.border-be{border-block-end-style:var(--tw-border-style);border-block-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-\\[3px\\]{border-left-style:var(--tw-border-style);border-left-width:3px}.border-accented{border-color:var(--ui-border-accented)}.border-current{border-color:currentColor}.border-default{border-color:var(--ui-border)}.border-error{border-color:var(--ui-error)}.border-info{border-color:var(--ui-info)}.border-inverted,.border-inverted\\/10{border-color:var(--ui-border-inverted)}@supports (color:color-mix(in lab,red,red)){.border-inverted\\/10{border-color:color-mix(in oklab,var(--ui-border-inverted) 10%,transparent)}}.border-muted{border-color:var(--ui-border-muted)}.border-success{border-color:var(--ui-success)}.border-transparent{border-color:#0000}.border-warning,.border-warning\\/40{border-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.border-warning\\/40{border-color:color-mix(in oklab,var(--ui-warning) 40%,transparent)}}.border-l-error{border-left-color:var(--ui-error)}.border-l-info{border-left-color:var(--ui-info)}.border-l-success{border-left-color:var(--ui-success)}.border-l-warning{border-left-color:var(--ui-warning)}.\\!bg-accented{background-color:var(--ui-bg-accented)!important}.bg-\\(--ui-bg-accented\\){background-color:var(--ui-bg-accented)}.bg-\\(--znhd-bubble-mine\\){background-color:var(--znhd-bubble-mine)}.bg-accented{background-color:var(--ui-bg-accented)}.bg-black{background-color:var(--color-black)}.bg-black\\/55{background-color:#0000008c}@supports (color:color-mix(in lab,red,red)){.bg-black\\/55{background-color:color-mix(in oklab,var(--color-black) 55%,transparent)}}.bg-black\\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\\/80{background-color:color-mix(in oklab,var(--color-black) 80%,transparent)}}.bg-border{background-color:var(--ui-border)}.bg-default{background-color:var(--ui-bg)}.bg-elevated,.bg-elevated\\/30{background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\\/30{background-color:color-mix(in oklab,var(--ui-bg-elevated) 30%,transparent)}}.bg-elevated\\/40{background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\\/40{background-color:color-mix(in oklab,var(--ui-bg-elevated) 40%,transparent)}}.bg-elevated\\/50{background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\\/50{background-color:color-mix(in oklab,var(--ui-bg-elevated) 50%,transparent)}}.bg-elevated\\/75{background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\\/75{background-color:color-mix(in oklab,var(--ui-bg-elevated) 75%,transparent)}}.bg-error,.bg-error\\/10{background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.bg-error\\/10{background-color:color-mix(in oklab,var(--ui-error) 10%,transparent)}}.bg-info,.bg-info\\/10{background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.bg-info\\/10{background-color:color-mix(in oklab,var(--ui-info) 10%,transparent)}}.bg-inverted{background-color:var(--ui-bg-inverted)}.bg-muted{background-color:var(--ui-bg-muted)}.bg-primary,.bg-primary\\/10{background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/10{background-color:color-mix(in oklab,var(--ui-primary) 10%,transparent)}}.bg-primary\\/75{background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/75{background-color:color-mix(in oklab,var(--ui-primary) 75%,transparent)}}.bg-success,.bg-success\\/10{background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.bg-success\\/10{background-color:color-mix(in oklab,var(--ui-success) 10%,transparent)}}.bg-transparent{background-color:#0000}.bg-warning,.bg-warning\\/10{background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.bg-warning\\/10{background-color:color-mix(in oklab,var(--ui-warning) 10%,transparent)}}.bg-white{background-color:var(--color-white)}.bg-white\\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\\/10{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-white\\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\\/15{background-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.bg-white\\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\\/25{background-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.bg-white\\/30{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.bg-white\\/30{background-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.bg-white\\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\\/90{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.bg-linear-to-t{--tw-gradient-position:to top}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-t{--tw-gradient-position:to top in oklab}}.bg-linear-to-t{background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-default{--tw-gradient-from:var(--ui-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-muted{--tw-gradient-from:var(--ui-bg-muted);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-no-repeat{background-repeat:no-repeat}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.fill-bg{fill:var(--ui-bg)}.stroke-default{stroke:var(--ui-border)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-4\\.5{padding:calc(var(--spacing) * 4.5)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:0}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-12{padding-inline:calc(var(--spacing) * 12)}.px-\\[10px\\]{padding-inline:10px}.py-0{padding-block:0}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-24{padding-block:calc(var(--spacing) * 24)}.py-\\[2px\\]{padding-block:2px}.py-\\[7px\\]{padding-block:7px}.ps-1{padding-inline-start:var(--spacing)}.ps-1\\.5{padding-inline-start:calc(var(--spacing) * 1.5)}.ps-2{padding-inline-start:calc(var(--spacing) * 2)}.ps-2\\.5{padding-inline-start:calc(var(--spacing) * 2.5)}.ps-3{padding-inline-start:calc(var(--spacing) * 3)}.ps-4{padding-inline-start:calc(var(--spacing) * 4)}.ps-6{padding-inline-start:calc(var(--spacing) * 6)}.ps-7{padding-inline-start:calc(var(--spacing) * 7)}.ps-8{padding-inline-start:calc(var(--spacing) * 8)}.ps-9{padding-inline-start:calc(var(--spacing) * 9)}.ps-10{padding-inline-start:calc(var(--spacing) * 10)}.ps-11{padding-inline-start:calc(var(--spacing) * 11)}.pe-2{padding-inline-end:calc(var(--spacing) * 2)}.pe-2\\.5{padding-inline-end:calc(var(--spacing) * 2.5)}.pe-3{padding-inline-end:calc(var(--spacing) * 3)}.pe-7{padding-inline-end:calc(var(--spacing) * 7)}.pe-8{padding-inline-end:calc(var(--spacing) * 8)}.pe-9{padding-inline-end:calc(var(--spacing) * 9)}.pe-10{padding-inline-end:calc(var(--spacing) * 10)}.pe-11{padding-inline-end:calc(var(--spacing) * 11)}.pt-1{padding-top:var(--spacing)}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pr-1{padding-right:var(--spacing)}.pb-0{padding-bottom:0}.pb-0\\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-24{padding-bottom:calc(var(--spacing) * 24)}.pl-\\[9px\\]{padding-left:9px}.text-center{text-align:center}.text-end{text-align:end}.text-left{text-align:left}.text-start{text-align:start}.align-middle{vertical-align:middle}.align-sub{vertical-align:sub}.align-text-top{vertical-align:text-top}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-\\[8px\\]\\/3{font-size:8px;line-height:calc(var(--spacing) * 3)}.text-\\[10px\\]\\/3{font-size:10px;line-height:calc(var(--spacing) * 3)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-base\\/5{font-size:var(--text-base);line-height:calc(var(--spacing) * 5)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-sm\\/4{font-size:var(--text-sm);line-height:calc(var(--spacing) * 4)}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-xs\\/5{font-size:var(--text-xs);line-height:calc(var(--spacing) * 5)}.text-\\[4px\\]{font-size:4px}.text-\\[5px\\]{font-size:5px}.text-\\[6px\\]{font-size:6px}.text-\\[7px\\]{font-size:7px}.text-\\[8px\\]{font-size:8px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11\\.5px\\]{font-size:11.5px}.text-\\[11px\\]{font-size:11px}.text-\\[12\\.5px\\]{font-size:12.5px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.leading-8{--tw-leading:calc(var(--spacing) * 8);line-height:calc(var(--spacing) * 8)}.leading-\\[1\\.9\\]{--tw-leading:1.9;line-height:1.9}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-balance{text-wrap:balance}.text-pretty{text-wrap:pretty}.text-wrap{text-wrap:wrap}.break-words,.wrap-break-word{overflow-wrap:break-word}.break-all{word-break:break-all}.overflow-ellipsis{text-overflow:ellipsis}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-default{color:var(--ui-text)}.text-dimmed{color:var(--ui-text-dimmed)}.text-error,.text-error\\/75{color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.text-error\\/75{color:color-mix(in oklab,var(--ui-error) 75%,transparent)}}.text-highlighted{color:var(--ui-text-highlighted)}.text-info,.text-info\\/75{color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.text-info\\/75{color:color-mix(in oklab,var(--ui-info) 75%,transparent)}}.text-inherit{color:inherit}.text-inverted{color:var(--ui-text-inverted)}.text-muted{color:var(--ui-text-muted)}.text-primary,.text-primary\\/75{color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.text-primary\\/75{color:color-mix(in oklab,var(--ui-primary) 75%,transparent)}}.text-success,.text-success\\/75{color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.text-success\\/75{color:color-mix(in oklab,var(--ui-success) 75%,transparent)}}.text-toned{color:var(--ui-text-toned)}.text-transparent{color:#0000}.text-warning,.text-warning\\/75{color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.text-warning\\/75{color:color-mix(in oklab,var(--ui-warning) 75%,transparent)}}.text-white{color:var(--color-white)}.text-white\\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\\/50{color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.text-white\\/55{color:#ffffff8c}@supports (color:color-mix(in lab,red,red)){.text-white\\/55{color:color-mix(in oklab,var(--color-white) 55%,transparent)}}.text-white\\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\\/70{color:color-mix(in oklab,var(--color-white) 70%,transparent)}}.text-white\\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\\/80{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.text-white\\/90{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.text-white\\/90{color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-55{opacity:.55}.opacity-60{opacity:.6}.opacity-65{opacity:.65}.opacity-75{opacity:.75}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-accented{--tw-ring-color:var(--ui-border-accented)}.ring-bg{--tw-ring-color:var(--ui-bg)}.ring-default{--tw-ring-color:var(--ui-border)}.ring-error,.ring-error\\/25{--tw-ring-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.ring-error\\/25{--tw-ring-color:color-mix(in oklab, var(--ui-error) 25%, transparent)}}.ring-error\\/50{--tw-ring-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.ring-error\\/50{--tw-ring-color:color-mix(in oklab, var(--ui-error) 50%, transparent)}}.ring-info,.ring-info\\/25{--tw-ring-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.ring-info\\/25{--tw-ring-color:color-mix(in oklab, var(--ui-info) 25%, transparent)}}.ring-info\\/50{--tw-ring-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.ring-info\\/50{--tw-ring-color:color-mix(in oklab, var(--ui-info) 50%, transparent)}}.ring-inverted{--tw-ring-color:var(--ui-border-inverted)}.ring-primary,.ring-primary\\/25{--tw-ring-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.ring-primary\\/25{--tw-ring-color:color-mix(in oklab, var(--ui-primary) 25%, transparent)}}.ring-primary\\/50{--tw-ring-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.ring-primary\\/50{--tw-ring-color:color-mix(in oklab, var(--ui-primary) 50%, transparent)}}.ring-success,.ring-success\\/25{--tw-ring-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.ring-success\\/25{--tw-ring-color:color-mix(in oklab, var(--ui-success) 25%, transparent)}}.ring-success\\/50{--tw-ring-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.ring-success\\/50{--tw-ring-color:color-mix(in oklab, var(--ui-success) 50%, transparent)}}.ring-warning,.ring-warning\\/25{--tw-ring-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.ring-warning\\/25{--tw-ring-color:color-mix(in oklab, var(--ui-warning) 25%, transparent)}}.ring-warning\\/50{--tw-ring-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.ring-warning\\/50{--tw-ring-color:color-mix(in oklab, var(--ui-warning) 50%, transparent)}}.ring-white{--tw-ring-color:var(--color-white)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-error,.outline-error\\/25{outline-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.outline-error\\/25{outline-color:color-mix(in oklab,var(--ui-error) 25%,transparent)}}.outline-info,.outline-info\\/25{outline-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.outline-info\\/25{outline-color:color-mix(in oklab,var(--ui-info) 25%,transparent)}}.outline-inverted,.outline-inverted\\/25{outline-color:var(--ui-border-inverted)}@supports (color:color-mix(in lab,red,red)){.outline-inverted\\/25{outline-color:color-mix(in oklab,var(--ui-border-inverted) 25%,transparent)}}.outline-primary,.outline-primary\\/25{outline-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.outline-primary\\/25{outline-color:color-mix(in oklab,var(--ui-primary) 25%,transparent)}}.outline-success,.outline-success\\/25{outline-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.outline-success\\/25{outline-color:color-mix(in oklab,var(--ui-success) 25%,transparent)}}.outline-warning,.outline-warning\\/25{outline-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.outline-warning\\/25{outline-color:color-mix(in oklab,var(--ui-warning) 25%,transparent)}}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.sepia{--tw-sepia:sepia(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[background\\]{transition-property:background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[color\\,opacity\\]{transition-property:color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[height\\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,translate\\,height\\]{transition-property:transform,translate,height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[translate\\,width\\]{transition-property:translate,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\,height\\,left\\,right\\]{transition-property:width,height,left,right;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-transform{will-change:transform}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[--initial-transform\\:calc\\(100\\%\\+1\\.5rem\\)\\]{--initial-transform: calc(100% + 1.5rem) }.\\[vite\\:esbuild-transpile\\]{vite:esbuild-transpile}.backface-hidden{backface-visibility:hidden}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}:is(.\\*\\:size-2>*){width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}:is(.\\*\\:rounded-full>*){border-radius:3.40282e38px}:is(.\\*\\:bg-elevated>*){background-color:var(--ui-bg-elevated)}.not-last\\:not-first\\:rounded-none:not(:last-child):not(:first-child){border-radius:0}.not-has-disabled\\:border-error:not(:has(:disabled)){border-color:var(--ui-error)}.not-has-disabled\\:border-info:not(:has(:disabled)){border-color:var(--ui-info)}.not-has-disabled\\:border-inverted:not(:has(:disabled)){border-color:var(--ui-border-inverted)}.not-has-disabled\\:border-primary:not(:has(:disabled)){border-color:var(--ui-primary)}.not-has-disabled\\:border-success:not(:has(:disabled)){border-color:var(--ui-success)}.not-has-disabled\\:border-warning:not(:has(:disabled)){border-color:var(--ui-warning)}.not-has-disabled\\:not-has-aria-disabled\\:border-error:not(:has(:disabled)):not(:has([aria-disabled=true])){border-color:var(--ui-error)}.not-has-disabled\\:not-has-aria-disabled\\:border-info:not(:has(:disabled)):not(:has([aria-disabled=true])){border-color:var(--ui-info)}.not-has-disabled\\:not-has-aria-disabled\\:border-inverted:not(:has(:disabled)):not(:has([aria-disabled=true])){border-color:var(--ui-border-inverted)}.not-has-disabled\\:not-has-aria-disabled\\:border-primary:not(:has(:disabled)):not(:has([aria-disabled=true])){border-color:var(--ui-primary)}.not-has-disabled\\:not-has-aria-disabled\\:border-success:not(:has(:disabled)):not(:has([aria-disabled=true])){border-color:var(--ui-success)}.not-has-disabled\\:not-has-aria-disabled\\:border-warning:not(:has(:disabled)):not(:has([aria-disabled=true])){border-color:var(--ui-warning)}.not-data-\\[segment\\=literal\\]\\:w-8:not([data-segment=literal]){width:calc(var(--spacing) * 8)}.not-data-\\[segment\\=literal\\]\\:w-9:not([data-segment=literal]){width:calc(var(--spacing) * 9)}.not-data-\\[segment\\=literal\\]\\:w-10:not([data-segment=literal]){width:calc(var(--spacing) * 10)}.group-not-last\\:group-not-first\\:rounded-none:is(:where(.group):not(:last-child) *):is(:where(.group):not(:first-child) *){border-radius:0}.group-not-only\\:group-first\\:rounded-e-none:is(:where(.group):not(:only-child) *):is(:where(.group):first-child *){border-start-end-radius:0;border-end-end-radius:0}.group-not-only\\:group-first\\:rounded-b-none:is(:where(.group):not(:only-child) *):is(:where(.group):first-child *){border-bottom-right-radius:0;border-bottom-left-radius:0}.group-not-only\\:group-last\\:rounded-s-none:is(:where(.group):not(:only-child) *):is(:where(.group):last-child *){border-start-start-radius:0;border-end-start-radius:0}.group-not-only\\:group-last\\:rounded-t-none:is(:where(.group):not(:only-child) *):is(:where(.group):last-child *){border-top-left-radius:0;border-top-right-radius:0}@media(hover:hover){.group-hover\\:pointer-events-auto:is(:where(.group):hover *){pointer-events:auto}.group-hover\\:text-default:is(:where(.group):hover *){color:var(--ui-text)}.group-hover\\:text-primary:is(:where(.group):hover *){color:var(--ui-primary)}.group-hover\\:opacity-100:is(:where(.group):hover *),.group-hover\\/message\\:opacity-100:is(:where(.group\\/message):hover *){opacity:1}}.group-data-highlighted\\:text-default:is(:where(.group)[data-highlighted] *){color:var(--ui-text)}.group-data-highlighted\\:text-error:is(:where(.group)[data-highlighted] *){color:var(--ui-error)}.group-data-highlighted\\:text-info:is(:where(.group)[data-highlighted] *){color:var(--ui-info)}.group-data-highlighted\\:text-primary:is(:where(.group)[data-highlighted] *){color:var(--ui-primary)}.group-data-highlighted\\:text-success:is(:where(.group)[data-highlighted] *){color:var(--ui-success)}.group-data-highlighted\\:text-warning:is(:where(.group)[data-highlighted] *){color:var(--ui-warning)}.group-data-highlighted\\:not-group-data-disabled\\:text-default:is(:where(.group)[data-highlighted] *):not(:is(:where(.group)[data-disabled] *)){color:var(--ui-text)}.group-data-\\[state\\=checked\\]\\:text-error:is(:where(.group)[data-state=checked] *){color:var(--ui-error)}.group-data-\\[state\\=checked\\]\\:text-highlighted:is(:where(.group)[data-state=checked] *){color:var(--ui-text-highlighted)}.group-data-\\[state\\=checked\\]\\:text-info:is(:where(.group)[data-state=checked] *){color:var(--ui-info)}.group-data-\\[state\\=checked\\]\\:text-primary:is(:where(.group)[data-state=checked] *){color:var(--ui-primary)}.group-data-\\[state\\=checked\\]\\:text-success:is(:where(.group)[data-state=checked] *){color:var(--ui-success)}.group-data-\\[state\\=checked\\]\\:text-warning:is(:where(.group)[data-state=checked] *){color:var(--ui-warning)}.group-data-\\[state\\=checked\\]\\:opacity-100:is(:where(.group)[data-state=checked] *){opacity:1}.group-data-\\[state\\=open\\]\\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.group-data-\\[state\\=open\\]\\:text-default:is(:where(.group)[data-state=open] *){color:var(--ui-text)}.group-data-\\[state\\=open\\]\\:text-error:is(:where(.group)[data-state=open] *){color:var(--ui-error)}.group-data-\\[state\\=open\\]\\:text-highlighted:is(:where(.group)[data-state=open] *){color:var(--ui-text-highlighted)}.group-data-\\[state\\=open\\]\\:text-info:is(:where(.group)[data-state=open] *){color:var(--ui-info)}.group-data-\\[state\\=open\\]\\:text-primary:is(:where(.group)[data-state=open] *){color:var(--ui-primary)}.group-data-\\[state\\=open\\]\\:text-success:is(:where(.group)[data-state=open] *){color:var(--ui-success)}.group-data-\\[state\\=open\\]\\:text-warning:is(:where(.group)[data-state=open] *){color:var(--ui-warning)}.group-data-\\[state\\=unchecked\\]\\:text-dimmed:is(:where(.group)[data-state=unchecked] *){color:var(--ui-text-dimmed)}.group-data-\\[state\\=unchecked\\]\\:opacity-100:is(:where(.group)[data-state=unchecked] *){opacity:1}.peer-checked\\:bg-error:is(:where(.peer):checked~*){background-color:var(--ui-error)}.peer-checked\\:bg-info:is(:where(.peer):checked~*){background-color:var(--ui-info)}.peer-checked\\:bg-success:is(:where(.peer):checked~*){background-color:var(--ui-success)}.peer-checked\\:bg-warning:is(:where(.peer):checked~*){background-color:var(--ui-warning)}.peer-checked\\:text-white:is(:where(.peer):checked~*){color:var(--color-white)}.file\\:me-1\\.5::file-selector-button{margin-inline-end:calc(var(--spacing) * 1.5)}.file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\\:text-muted::file-selector-button{color:var(--ui-text-muted)}.file\\:outline-none::file-selector-button{--tw-outline-style:none;outline-style:none}.placeholder\\:text-dimmed::placeholder{color:var(--ui-text-dimmed)}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:inset-px:before{content:var(--tw-content);inset:1px}.before\\:inset-x-0:before{content:var(--tw-content);inset-inline:0}.before\\:inset-x-px:before{content:var(--tw-content);inset-inline:1px}.before\\:inset-y-0:before{content:var(--tw-content);inset-block:0}.before\\:inset-y-px:before{content:var(--tw-content);inset-block:1px}.before\\:z-\\[-1\\]:before{content:var(--tw-content);z-index:-1}.before\\:rounded-md:before{content:var(--tw-content);border-radius:calc(var(--ui-radius) * 1.5)}.before\\:bg-elevated:before{content:var(--tw-content);background-color:var(--ui-bg-elevated)}.before\\:bg-error\\/10:before{content:var(--tw-content);background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.before\\:bg-error\\/10:before{background-color:color-mix(in oklab,var(--ui-error) 10%,transparent)}}.before\\:bg-info\\/10:before{content:var(--tw-content);background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.before\\:bg-info\\/10:before{background-color:color-mix(in oklab,var(--ui-info) 10%,transparent)}}.before\\:bg-primary\\/10:before{content:var(--tw-content);background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.before\\:bg-primary\\/10:before{background-color:color-mix(in oklab,var(--ui-primary) 10%,transparent)}}.before\\:bg-success\\/10:before{content:var(--tw-content);background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.before\\:bg-success\\/10:before{background-color:color-mix(in oklab,var(--ui-success) 10%,transparent)}}.before\\:bg-warning\\/10:before{content:var(--tw-content);background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.before\\:bg-warning\\/10:before{background-color:color-mix(in oklab,var(--ui-warning) 10%,transparent)}}.before\\:outline-error\\/25:before{content:var(--tw-content);outline-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.before\\:outline-error\\/25:before{outline-color:color-mix(in oklab,var(--ui-error) 25%,transparent)}}.before\\:outline-info\\/25:before{content:var(--tw-content);outline-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.before\\:outline-info\\/25:before{outline-color:color-mix(in oklab,var(--ui-info) 25%,transparent)}}.before\\:outline-inverted\\/25:before{content:var(--tw-content);outline-color:var(--ui-border-inverted)}@supports (color:color-mix(in lab,red,red)){.before\\:outline-inverted\\/25:before{outline-color:color-mix(in oklab,var(--ui-border-inverted) 25%,transparent)}}.before\\:outline-primary\\/25:before{content:var(--tw-content);outline-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.before\\:outline-primary\\/25:before{outline-color:color-mix(in oklab,var(--ui-primary) 25%,transparent)}}.before\\:outline-success\\/25:before{content:var(--tw-content);outline-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.before\\:outline-success\\/25:before{outline-color:color-mix(in oklab,var(--ui-success) 25%,transparent)}}.before\\:outline-warning\\/25:before{content:var(--tw-content);outline-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.before\\:outline-warning\\/25:before{outline-color:color-mix(in oklab,var(--ui-warning) 25%,transparent)}}.before\\:transition-colors:before{content:var(--tw-content);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.not-first-of-type\\:before\\:me-0\\.5:not(:first-of-type):before{content:var(--tw-content);margin-inline-end:calc(var(--spacing) * .5)}.not-first-of-type\\:before\\:content-\\[\\'·\\'\\]:not(:first-of-type):before{--tw-content:"·";content:var(--tw-content)}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-2\\.5:after{content:var(--tw-content);inset-inline:calc(var(--spacing) * 2.5)}.after\\:inset-y-0\\.5:after{content:var(--tw-content);inset-block:calc(var(--spacing) * .5)}.after\\:-start-1\\.5:after{content:var(--tw-content);inset-inline-start:calc(var(--spacing) * -1.5)}.after\\:-bottom-2:after{content:var(--tw-content);bottom:calc(var(--spacing) * -2)}.after\\:ms-0\\.5:after{content:var(--tw-content);margin-inline-start:calc(var(--spacing) * .5)}.after\\:block:after{content:var(--tw-content);display:block}.after\\:hidden:after{content:var(--tw-content);display:none}.after\\:size-1:after{content:var(--tw-content);width:var(--spacing);height:var(--spacing)}.after\\:size-1\\.5:after{content:var(--tw-content);width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.after\\:size-2:after{content:var(--tw-content);width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.after\\:h-px:after{content:var(--tw-content);height:1px}.after\\:w-px:after{content:var(--tw-content);width:1px}.after\\:rounded-full:after{content:var(--tw-content);border-radius:3.40282e38px}.after\\:bg-default:after{content:var(--tw-content);background-color:var(--ui-bg)}.after\\:bg-error:after{content:var(--tw-content);background-color:var(--ui-error)}.after\\:bg-info:after{content:var(--tw-content);background-color:var(--ui-info)}.after\\:bg-inverted:after{content:var(--tw-content);background-color:var(--ui-bg-inverted)}.after\\:bg-primary:after{content:var(--tw-content);background-color:var(--ui-primary)}.after\\:bg-success:after{content:var(--tw-content);background-color:var(--ui-success)}.after\\:bg-warning:after{content:var(--tw-content);background-color:var(--ui-warning)}.after\\:text-error:after{content:var(--tw-content);color:var(--ui-error)}.after\\:transition-colors:after{content:var(--tw-content);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.after\\:content-\\[\\'\\*\\'\\]:after{--tw-content:"*";content:var(--tw-content)}.first\\:pt-0:first-child{padding-top:0}:is(.\\*\\:first\\:mt-0>*):first-child{margin-top:0}.not-only\\:first\\:rounded-e-none:not(:only-child):first-child{border-start-end-radius:0;border-end-end-radius:0}.not-only\\:first\\:rounded-b-none:not(:only-child):first-child{border-bottom-right-radius:0;border-bottom-left-radius:0}:is(.\\*\\:last\\:mb-0>*):last-child{margin-bottom:0}.not-only\\:last\\:rounded-s-none:not(:only-child):last-child{border-start-start-radius:0;border-end-start-radius:0}.not-only\\:last\\:rounded-t-none:not(:only-child):last-child{border-top-left-radius:0;border-top-right-radius:0}.first-of-type\\:rounded-s-lg:first-of-type{border-start-start-radius:calc(var(--ui-radius) * 2);border-end-start-radius:calc(var(--ui-radius) * 2)}.first-of-type\\:rounded-t-lg:first-of-type{border-top-left-radius:calc(var(--ui-radius) * 2);border-top-right-radius:calc(var(--ui-radius) * 2)}.last-of-type\\:rounded-e-lg:last-of-type{border-start-end-radius:calc(var(--ui-radius) * 2);border-end-end-radius:calc(var(--ui-radius) * 2)}.last-of-type\\:rounded-b-lg:last-of-type{border-bottom-right-radius:calc(var(--ui-radius) * 2);border-bottom-left-radius:calc(var(--ui-radius) * 2)}@media(hover:hover){.hover\\:border-accented:hover{border-color:var(--ui-border-accented)}.hover\\:border-primary:hover{border-color:var(--ui-primary)}.hover\\:border-warning:hover{border-color:var(--ui-warning)}.hover\\:bg-accented:hover,.hover\\:bg-accented\\/75:hover{background-color:var(--ui-bg-accented)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-accented\\/75:hover{background-color:color-mix(in oklab,var(--ui-bg-accented) 75%,transparent)}}.hover\\:bg-elevated:hover,.hover\\:bg-elevated\\/50:hover{background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-elevated\\/50:hover{background-color:color-mix(in oklab,var(--ui-bg-elevated) 50%,transparent)}}.hover\\:bg-error\\/10:hover{background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-error\\/10:hover{background-color:color-mix(in oklab,var(--ui-error) 10%,transparent)}}.hover\\:bg-error\\/15:hover{background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-error\\/15:hover{background-color:color-mix(in oklab,var(--ui-error) 15%,transparent)}}.hover\\:bg-error\\/75:hover{background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-error\\/75:hover{background-color:color-mix(in oklab,var(--ui-error) 75%,transparent)}}.hover\\:bg-info\\/10:hover{background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-info\\/10:hover{background-color:color-mix(in oklab,var(--ui-info) 10%,transparent)}}.hover\\:bg-info\\/15:hover{background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-info\\/15:hover{background-color:color-mix(in oklab,var(--ui-info) 15%,transparent)}}.hover\\:bg-info\\/75:hover{background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-info\\/75:hover{background-color:color-mix(in oklab,var(--ui-info) 75%,transparent)}}.hover\\:bg-inverted\\/90:hover{background-color:var(--ui-bg-inverted)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-inverted\\/90:hover{background-color:color-mix(in oklab,var(--ui-bg-inverted) 90%,transparent)}}.hover\\:bg-primary\\/10:hover{background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/10:hover{background-color:color-mix(in oklab,var(--ui-primary) 10%,transparent)}}.hover\\:bg-primary\\/15:hover{background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/15:hover{background-color:color-mix(in oklab,var(--ui-primary) 15%,transparent)}}.hover\\:bg-primary\\/75:hover{background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/75:hover{background-color:color-mix(in oklab,var(--ui-primary) 75%,transparent)}}.hover\\:bg-success\\/10:hover{background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-success\\/10:hover{background-color:color-mix(in oklab,var(--ui-success) 10%,transparent)}}.hover\\:bg-success\\/15:hover{background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-success\\/15:hover{background-color:color-mix(in oklab,var(--ui-success) 15%,transparent)}}.hover\\:bg-success\\/75:hover{background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-success\\/75:hover{background-color:color-mix(in oklab,var(--ui-success) 75%,transparent)}}.hover\\:bg-warning\\/10:hover{background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-warning\\/10:hover{background-color:color-mix(in oklab,var(--ui-warning) 10%,transparent)}}.hover\\:bg-warning\\/15:hover{background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-warning\\/15:hover{background-color:color-mix(in oklab,var(--ui-warning) 15%,transparent)}}.hover\\:bg-warning\\/75:hover{background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-warning\\/75:hover{background-color:color-mix(in oklab,var(--ui-warning) 75%,transparent)}}.hover\\:bg-white\\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/10:hover{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.hover\\:bg-white\\/15:hover{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/15:hover{background-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.hover\\:bg-white\\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/20:hover{background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.hover\\:text-default:hover{color:var(--ui-text)}.hover\\:text-error\\/75:hover{color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.hover\\:text-error\\/75:hover{color:color-mix(in oklab,var(--ui-error) 75%,transparent)}}.hover\\:text-highlighted:hover{color:var(--ui-text-highlighted)}.hover\\:text-info\\/75:hover{color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.hover\\:text-info\\/75:hover{color:color-mix(in oklab,var(--ui-info) 75%,transparent)}}.hover\\:text-primary:hover,.hover\\:text-primary\\/75:hover{color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:text-primary\\/75:hover{color:color-mix(in oklab,var(--ui-primary) 75%,transparent)}}.hover\\:text-success\\/75:hover{color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.hover\\:text-success\\/75:hover{color:color-mix(in oklab,var(--ui-success) 75%,transparent)}}.hover\\:text-warning:hover,.hover\\:text-warning\\/75:hover{color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.hover\\:text-warning\\/75:hover{color:color-mix(in oklab,var(--ui-warning) 75%,transparent)}}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}.hover\\:not-has-disabled\\:not-has-aria-disabled\\:not-has-focus-visible\\:not-has-data-\\[state\\=checked\\]\\:z-\\[1\\]:hover:not(:has(:disabled)):not(:has([aria-disabled=true])):not(:has(:focus-visible)):not(:has([data-state=checked])){z-index:1}.hover\\:not-has-disabled\\:not-has-aria-disabled\\:not-has-focus-visible\\:not-has-data-\\[state\\=checked\\]\\:border-accented:hover:not(:has(:disabled)):not(:has([aria-disabled=true])):not(:has(:focus-visible)):not(:has([data-state=checked])){border-color:var(--ui-border-accented)}.hover\\:not-has-disabled\\:not-has-aria-disabled\\:not-has-focus-visible\\:not-has-data-\\[state\\=checked\\]\\:bg-elevated\\/50:hover:not(:has(:disabled)):not(:has([aria-disabled=true])):not(:has(:focus-visible)):not(:has([data-state=checked])){background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\\:not-has-disabled\\:not-has-aria-disabled\\:not-has-focus-visible\\:not-has-data-\\[state\\=checked\\]\\:bg-elevated\\/50:hover:not(:has(:disabled)):not(:has([aria-disabled=true])):not(:has(:focus-visible)):not(:has([data-state=checked])){background-color:color-mix(in oklab,var(--ui-bg-elevated) 50%,transparent)}}.hover\\:before\\:bg-elevated\\/50:hover:before{content:var(--tw-content);background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\\:before\\:bg-elevated\\/50:hover:before{background-color:color-mix(in oklab,var(--ui-bg-elevated) 50%,transparent)}}}.focus\\:bg-accented:focus,.focus\\:bg-accented\\/50:focus{background-color:var(--ui-bg-accented)}@supports (color:color-mix(in lab,red,red)){.focus\\:bg-accented\\/50:focus{background-color:color-mix(in oklab,var(--ui-bg-accented) 50%,transparent)}}.focus\\:bg-elevated:focus{background-color:var(--ui-bg-elevated)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}@media(hover:hover){.group-hover\\:focus\\:bg-accented:is(:where(.group):hover *):focus{background-color:var(--ui-bg-accented)}}.focus-visible\\:z-\\[1\\]:focus-visible{z-index:1}.focus-visible\\:border-primary:focus-visible{border-color:var(--ui-primary)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-error:focus-visible{--tw-ring-color:var(--ui-error)}.focus-visible\\:ring-info:focus-visible{--tw-ring-color:var(--ui-info)}.focus-visible\\:ring-inverted:focus-visible{--tw-ring-color:var(--ui-border-inverted)}.focus-visible\\:ring-primary:focus-visible,.focus-visible\\:ring-primary\\/50:focus-visible{--tw-ring-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-primary\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ui-primary) 50%, transparent)}}.focus-visible\\:ring-success:focus-visible{--tw-ring-color:var(--ui-success)}.focus-visible\\:ring-warning:focus-visible{--tw-ring-color:var(--ui-warning)}.focus-visible\\:outline-3:focus-visible{outline-style:var(--tw-outline-style);outline-width:3px}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:outline-solid:focus-visible{--tw-outline-style:solid;outline-style:solid}.focus-visible\\:before\\:outline-3:focus-visible:before{content:var(--tw-content);outline-style:var(--tw-outline-style);outline-width:3px}.active\\:bg-accented\\/75:active{background-color:var(--ui-bg-accented)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-accented\\/75:active{background-color:color-mix(in oklab,var(--ui-bg-accented) 75%,transparent)}}.active\\:bg-elevated:active{background-color:var(--ui-bg-elevated)}.active\\:bg-error\\/10:active{background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-error\\/10:active{background-color:color-mix(in oklab,var(--ui-error) 10%,transparent)}}.active\\:bg-error\\/15:active{background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-error\\/15:active{background-color:color-mix(in oklab,var(--ui-error) 15%,transparent)}}.active\\:bg-error\\/75:active{background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-error\\/75:active{background-color:color-mix(in oklab,var(--ui-error) 75%,transparent)}}.active\\:bg-info\\/10:active{background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-info\\/10:active{background-color:color-mix(in oklab,var(--ui-info) 10%,transparent)}}.active\\:bg-info\\/15:active{background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-info\\/15:active{background-color:color-mix(in oklab,var(--ui-info) 15%,transparent)}}.active\\:bg-info\\/75:active{background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-info\\/75:active{background-color:color-mix(in oklab,var(--ui-info) 75%,transparent)}}.active\\:bg-inverted\\/90:active{background-color:var(--ui-bg-inverted)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-inverted\\/90:active{background-color:color-mix(in oklab,var(--ui-bg-inverted) 90%,transparent)}}.active\\:bg-primary\\/10:active{background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/10:active{background-color:color-mix(in oklab,var(--ui-primary) 10%,transparent)}}.active\\:bg-primary\\/15:active{background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/15:active{background-color:color-mix(in oklab,var(--ui-primary) 15%,transparent)}}.active\\:bg-primary\\/75:active{background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/75:active{background-color:color-mix(in oklab,var(--ui-primary) 75%,transparent)}}.active\\:bg-success\\/10:active{background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-success\\/10:active{background-color:color-mix(in oklab,var(--ui-success) 10%,transparent)}}.active\\:bg-success\\/15:active{background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-success\\/15:active{background-color:color-mix(in oklab,var(--ui-success) 15%,transparent)}}.active\\:bg-success\\/75:active{background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-success\\/75:active{background-color:color-mix(in oklab,var(--ui-success) 75%,transparent)}}.active\\:bg-warning\\/10:active{background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-warning\\/10:active{background-color:color-mix(in oklab,var(--ui-warning) 10%,transparent)}}.active\\:bg-warning\\/15:active{background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-warning\\/15:active{background-color:color-mix(in oklab,var(--ui-warning) 15%,transparent)}}.active\\:bg-warning\\/75:active{background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-warning\\/75:active{background-color:color-mix(in oklab,var(--ui-warning) 75%,transparent)}}.active\\:bg-white\\/30:active{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.active\\:bg-white\\/30:active{background-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.active\\:text-default:active{color:var(--ui-text)}.active\\:text-error\\/75:active{color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.active\\:text-error\\/75:active{color:color-mix(in oklab,var(--ui-error) 75%,transparent)}}.active\\:text-info\\/75:active{color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.active\\:text-info\\/75:active{color:color-mix(in oklab,var(--ui-info) 75%,transparent)}}.active\\:text-primary\\/75:active{color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:text-primary\\/75:active{color:color-mix(in oklab,var(--ui-primary) 75%,transparent)}}.active\\:text-success\\/75:active{color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.active\\:text-success\\/75:active{color:color-mix(in oklab,var(--ui-success) 75%,transparent)}}.active\\:text-warning\\/75:active{color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.active\\:text-warning\\/75:active{color:color-mix(in oklab,var(--ui-warning) 75%,transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-default:disabled{background-color:var(--ui-bg)}.disabled\\:bg-elevated:disabled,.disabled\\:bg-elevated\\/50:disabled{background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.disabled\\:bg-elevated\\/50:disabled{background-color:color-mix(in oklab,var(--ui-bg-elevated) 50%,transparent)}}.disabled\\:bg-error:disabled,.disabled\\:bg-error\\/10:disabled{background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.disabled\\:bg-error\\/10:disabled{background-color:color-mix(in oklab,var(--ui-error) 10%,transparent)}}.disabled\\:bg-info:disabled,.disabled\\:bg-info\\/10:disabled{background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.disabled\\:bg-info\\/10:disabled{background-color:color-mix(in oklab,var(--ui-info) 10%,transparent)}}.disabled\\:bg-inverted:disabled{background-color:var(--ui-bg-inverted)}.disabled\\:bg-primary:disabled,.disabled\\:bg-primary\\/10:disabled{background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.disabled\\:bg-primary\\/10:disabled{background-color:color-mix(in oklab,var(--ui-primary) 10%,transparent)}}.disabled\\:bg-success:disabled,.disabled\\:bg-success\\/10:disabled{background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.disabled\\:bg-success\\/10:disabled{background-color:color-mix(in oklab,var(--ui-success) 10%,transparent)}}.disabled\\:bg-transparent:disabled{background-color:#0000}.disabled\\:bg-warning:disabled,.disabled\\:bg-warning\\/10:disabled{background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.disabled\\:bg-warning\\/10:disabled{background-color:color-mix(in oklab,var(--ui-warning) 10%,transparent)}}.disabled\\:text-error:disabled{color:var(--ui-error)}.disabled\\:text-info:disabled{color:var(--ui-info)}.disabled\\:text-muted:disabled{color:var(--ui-text-muted)}.disabled\\:text-primary:disabled{color:var(--ui-primary)}.disabled\\:text-success:disabled{color:var(--ui-success)}.disabled\\:text-warning:disabled{color:var(--ui-warning)}.disabled\\:opacity-75:disabled{opacity:.75}@media(hover:hover){.hover\\:disabled\\:bg-transparent:hover:disabled{background-color:#0000}}:where(.ui-macos) .in-\\[\\.ui-macos\\]\\:hidden{display:none}:where(.ui-macos) .in-\\[\\.ui-macos\\]\\:inline{display:inline}.has-focus\\:bg-elevated:has(:focus){background-color:var(--ui-bg-elevated)}.has-focus\\:outline-none:has(:focus){--tw-outline-style:none;outline-style:none}.has-focus-visible\\:z-\\[1\\]:has(:focus-visible){z-index:1}.has-focus-visible\\:ring-error:has(:focus-visible){--tw-ring-color:var(--ui-error)}.has-focus-visible\\:ring-info:has(:focus-visible){--tw-ring-color:var(--ui-info)}.has-focus-visible\\:ring-inverted:has(:focus-visible){--tw-ring-color:var(--ui-border-inverted)}.has-focus-visible\\:ring-primary:has(:focus-visible){--tw-ring-color:var(--ui-primary)}.has-focus-visible\\:ring-success:has(:focus-visible){--tw-ring-color:var(--ui-success)}.has-focus-visible\\:ring-warning:has(:focus-visible){--tw-ring-color:var(--ui-warning)}.has-focus-visible\\:outline-3:has(:focus-visible){outline-style:var(--tw-outline-style);outline-width:3px}.not-has-disabled\\:has-focus-visible\\:border-error:not(:has(:disabled)):has(:focus-visible){border-color:var(--ui-error)}.not-has-disabled\\:has-focus-visible\\:border-info:not(:has(:disabled)):has(:focus-visible){border-color:var(--ui-info)}.not-has-disabled\\:has-focus-visible\\:border-inverted:not(:has(:disabled)):has(:focus-visible){border-color:var(--ui-border-inverted)}.not-has-disabled\\:has-focus-visible\\:border-primary:not(:has(:disabled)):has(:focus-visible){border-color:var(--ui-primary)}.not-has-disabled\\:has-focus-visible\\:border-success:not(:has(:disabled)):has(:focus-visible){border-color:var(--ui-success)}.not-has-disabled\\:has-focus-visible\\:border-warning:not(:has(:disabled)):has(:focus-visible){border-color:var(--ui-warning)}.has-data-\\[state\\=checked\\]\\:z-\\[2\\]:has([data-state=checked]){z-index:2}.has-data-\\[state\\=checked\\]\\:border-error\\/50:has([data-state=checked]){border-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:border-error\\/50:has([data-state=checked]){border-color:color-mix(in oklab,var(--ui-error) 50%,transparent)}}.has-data-\\[state\\=checked\\]\\:border-info\\/50:has([data-state=checked]){border-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:border-info\\/50:has([data-state=checked]){border-color:color-mix(in oklab,var(--ui-info) 50%,transparent)}}.has-data-\\[state\\=checked\\]\\:border-inverted\\/50:has([data-state=checked]){border-color:var(--ui-border-inverted)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:border-inverted\\/50:has([data-state=checked]){border-color:color-mix(in oklab,var(--ui-border-inverted) 50%,transparent)}}.has-data-\\[state\\=checked\\]\\:border-primary\\/50:has([data-state=checked]){border-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:border-primary\\/50:has([data-state=checked]){border-color:color-mix(in oklab,var(--ui-primary) 50%,transparent)}}.has-data-\\[state\\=checked\\]\\:border-success\\/50:has([data-state=checked]){border-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:border-success\\/50:has([data-state=checked]){border-color:color-mix(in oklab,var(--ui-success) 50%,transparent)}}.has-data-\\[state\\=checked\\]\\:border-warning\\/50:has([data-state=checked]){border-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:border-warning\\/50:has([data-state=checked]){border-color:color-mix(in oklab,var(--ui-warning) 50%,transparent)}}.has-data-\\[state\\=checked\\]\\:bg-elevated:has([data-state=checked]){background-color:var(--ui-bg-elevated)}.has-data-\\[state\\=checked\\]\\:bg-error\\/10:has([data-state=checked]){background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:bg-error\\/10:has([data-state=checked]){background-color:color-mix(in oklab,var(--ui-error) 10%,transparent)}}.has-data-\\[state\\=checked\\]\\:bg-info\\/10:has([data-state=checked]){background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:bg-info\\/10:has([data-state=checked]){background-color:color-mix(in oklab,var(--ui-info) 10%,transparent)}}.has-data-\\[state\\=checked\\]\\:bg-primary\\/10:has([data-state=checked]){background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:bg-primary\\/10:has([data-state=checked]){background-color:color-mix(in oklab,var(--ui-primary) 10%,transparent)}}.has-data-\\[state\\=checked\\]\\:bg-success\\/10:has([data-state=checked]){background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:bg-success\\/10:has([data-state=checked]){background-color:color-mix(in oklab,var(--ui-success) 10%,transparent)}}.has-data-\\[state\\=checked\\]\\:bg-warning\\/10:has([data-state=checked]){background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.has-data-\\[state\\=checked\\]\\:bg-warning\\/10:has([data-state=checked]){background-color:color-mix(in oklab,var(--ui-warning) 10%,transparent)}}.not-has-disabled\\:has-data-\\[state\\=checked\\]\\:border-error:not(:has(:disabled)):has([data-state=checked]){border-color:var(--ui-error)}.not-has-disabled\\:has-data-\\[state\\=checked\\]\\:border-info:not(:has(:disabled)):has([data-state=checked]){border-color:var(--ui-info)}.not-has-disabled\\:has-data-\\[state\\=checked\\]\\:border-inverted:not(:has(:disabled)):has([data-state=checked]){border-color:var(--ui-border-inverted)}.not-has-disabled\\:has-data-\\[state\\=checked\\]\\:border-primary:not(:has(:disabled)):has([data-state=checked]){border-color:var(--ui-primary)}.not-has-disabled\\:has-data-\\[state\\=checked\\]\\:border-success:not(:has(:disabled)):has([data-state=checked]){border-color:var(--ui-success)}.not-has-disabled\\:has-data-\\[state\\=checked\\]\\:border-warning:not(:has(:disabled)):has([data-state=checked]){border-color:var(--ui-warning)}.not-has-disabled\\:not-has-aria-disabled\\:has-data-\\[state\\=checked\\]\\:border-error:not(:has(:disabled)):not(:has([aria-disabled=true])):has([data-state=checked]){border-color:var(--ui-error)}.not-has-disabled\\:not-has-aria-disabled\\:has-data-\\[state\\=checked\\]\\:border-info:not(:has(:disabled)):not(:has([aria-disabled=true])):has([data-state=checked]){border-color:var(--ui-info)}.not-has-disabled\\:not-has-aria-disabled\\:has-data-\\[state\\=checked\\]\\:border-inverted:not(:has(:disabled)):not(:has([aria-disabled=true])):has([data-state=checked]){border-color:var(--ui-border-inverted)}.not-has-disabled\\:not-has-aria-disabled\\:has-data-\\[state\\=checked\\]\\:border-primary:not(:has(:disabled)):not(:has([aria-disabled=true])):has([data-state=checked]){border-color:var(--ui-primary)}.not-has-disabled\\:not-has-aria-disabled\\:has-data-\\[state\\=checked\\]\\:border-success:not(:has(:disabled)):not(:has([aria-disabled=true])):has([data-state=checked]){border-color:var(--ui-success)}.not-has-disabled\\:not-has-aria-disabled\\:has-data-\\[state\\=checked\\]\\:border-warning:not(:has(:disabled)):not(:has([aria-disabled=true])):has([data-state=checked]){border-color:var(--ui-warning)}.aria-disabled\\:cursor-not-allowed[aria-disabled=true]{cursor:not-allowed}.aria-disabled\\:bg-default[aria-disabled=true]{background-color:var(--ui-bg)}.aria-disabled\\:bg-elevated[aria-disabled=true]{background-color:var(--ui-bg-elevated)}.aria-disabled\\:bg-error[aria-disabled=true],.aria-disabled\\:bg-error\\/10[aria-disabled=true]{background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.aria-disabled\\:bg-error\\/10[aria-disabled=true]{background-color:color-mix(in oklab,var(--ui-error) 10%,transparent)}}.aria-disabled\\:bg-info[aria-disabled=true],.aria-disabled\\:bg-info\\/10[aria-disabled=true]{background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.aria-disabled\\:bg-info\\/10[aria-disabled=true]{background-color:color-mix(in oklab,var(--ui-info) 10%,transparent)}}.aria-disabled\\:bg-inverted[aria-disabled=true]{background-color:var(--ui-bg-inverted)}.aria-disabled\\:bg-primary[aria-disabled=true],.aria-disabled\\:bg-primary\\/10[aria-disabled=true]{background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.aria-disabled\\:bg-primary\\/10[aria-disabled=true]{background-color:color-mix(in oklab,var(--ui-primary) 10%,transparent)}}.aria-disabled\\:bg-success[aria-disabled=true],.aria-disabled\\:bg-success\\/10[aria-disabled=true]{background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.aria-disabled\\:bg-success\\/10[aria-disabled=true]{background-color:color-mix(in oklab,var(--ui-success) 10%,transparent)}}.aria-disabled\\:bg-transparent[aria-disabled=true]{background-color:#0000}.aria-disabled\\:bg-warning[aria-disabled=true],.aria-disabled\\:bg-warning\\/10[aria-disabled=true]{background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.aria-disabled\\:bg-warning\\/10[aria-disabled=true]{background-color:color-mix(in oklab,var(--ui-warning) 10%,transparent)}}.aria-disabled\\:text-error[aria-disabled=true]{color:var(--ui-error)}.aria-disabled\\:text-info[aria-disabled=true]{color:var(--ui-info)}.aria-disabled\\:text-muted[aria-disabled=true]{color:var(--ui-text-muted)}.aria-disabled\\:text-primary[aria-disabled=true]{color:var(--ui-primary)}.aria-disabled\\:text-success[aria-disabled=true]{color:var(--ui-success)}.aria-disabled\\:text-warning[aria-disabled=true]{color:var(--ui-warning)}.aria-disabled\\:opacity-75[aria-disabled=true]{opacity:.75}@media(hover:hover){.hover\\:aria-disabled\\:bg-transparent:hover[aria-disabled=true]{background-color:#0000}}.data-disabled\\:cursor-not-allowed[data-disabled]{cursor:not-allowed}.data-disabled\\:opacity-75[data-disabled]{opacity:.75}.data-highlighted\\:text-error[data-highlighted]{color:var(--ui-error)}.data-highlighted\\:text-highlighted[data-highlighted]{color:var(--ui-text-highlighted)}.data-highlighted\\:text-info[data-highlighted]{color:var(--ui-info)}.data-highlighted\\:text-primary[data-highlighted]{color:var(--ui-primary)}.data-highlighted\\:text-success[data-highlighted]{color:var(--ui-success)}.data-highlighted\\:text-warning[data-highlighted]{color:var(--ui-warning)}.data-highlighted\\:not-data-disabled\\:text-highlighted[data-highlighted]:not([data-disabled]){color:var(--ui-text-highlighted)}.data-highlighted\\:before\\:bg-elevated\\/50[data-highlighted]:before{content:var(--tw-content);background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.data-highlighted\\:before\\:bg-elevated\\/50[data-highlighted]:before{background-color:color-mix(in oklab,var(--ui-bg-elevated) 50%,transparent)}}.data-highlighted\\:before\\:bg-error\\/10[data-highlighted]:before{content:var(--tw-content);background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.data-highlighted\\:before\\:bg-error\\/10[data-highlighted]:before{background-color:color-mix(in oklab,var(--ui-error) 10%,transparent)}}.data-highlighted\\:before\\:bg-info\\/10[data-highlighted]:before{content:var(--tw-content);background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.data-highlighted\\:before\\:bg-info\\/10[data-highlighted]:before{background-color:color-mix(in oklab,var(--ui-info) 10%,transparent)}}.data-highlighted\\:before\\:bg-primary\\/10[data-highlighted]:before{content:var(--tw-content);background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.data-highlighted\\:before\\:bg-primary\\/10[data-highlighted]:before{background-color:color-mix(in oklab,var(--ui-primary) 10%,transparent)}}.data-highlighted\\:before\\:bg-success\\/10[data-highlighted]:before{content:var(--tw-content);background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.data-highlighted\\:before\\:bg-success\\/10[data-highlighted]:before{background-color:color-mix(in oklab,var(--ui-success) 10%,transparent)}}.data-highlighted\\:before\\:bg-warning\\/10[data-highlighted]:before{content:var(--tw-content);background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.data-highlighted\\:before\\:bg-warning\\/10[data-highlighted]:before{background-color:color-mix(in oklab,var(--ui-warning) 10%,transparent)}}.data-highlighted\\:not-data-disabled\\:before\\:bg-elevated\\/50[data-highlighted]:not([data-disabled]):before{content:var(--tw-content);background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.data-highlighted\\:not-data-disabled\\:before\\:bg-elevated\\/50[data-highlighted]:not([data-disabled]):before{background-color:color-mix(in oklab,var(--ui-bg-elevated) 50%,transparent)}}.data-invalid\\:text-error[data-invalid]{color:var(--ui-error)}.data-placeholder\\:text-dimmed[data-placeholder]{color:var(--ui-text-dimmed)}.data-\\[expanded\\=true\\]\\:h-\\(--height\\)[data-expanded=true]{height:var(--height)}:is(.data-\\[front\\=false\\]\\:\\*\\:transition-opacity[data-front=false]>*){transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}:is(.data-\\[front\\=false\\]\\:\\*\\:duration-100[data-front=false]>*){--tw-duration:.1s;transition-duration:.1s}.data-\\[collapsed\\=true\\]\\:data-\\[front\\=false\\]\\:h-\\(--front-height\\)[data-collapsed=true][data-front=false]{height:var(--front-height)}:is(.data-\\[collapsed\\=true\\]\\:data-\\[front\\=false\\]\\:\\*\\:opacity-0[data-collapsed=true][data-front=false]>*){opacity:0}.data-\\[motion\\=from-end\\]\\:animate-\\[enter-from-right_200ms_var\\(--ease-out\\)\\][data-motion=from-end]{animation:enter-from-right .2s var(--ease-out)}.data-\\[motion\\=from-start\\]\\:animate-\\[enter-from-left_200ms_var\\(--ease-out\\)\\][data-motion=from-start]{animation:enter-from-left .2s var(--ease-out)}.data-\\[motion\\=to-end\\]\\:animate-\\[exit-to-right_200ms_var\\(--ease-out\\)\\][data-motion=to-end]{animation:exit-to-right .2s var(--ease-out)}.data-\\[motion\\=to-start\\]\\:animate-\\[exit-to-left_200ms_var\\(--ease-out\\)\\][data-motion=to-start]{animation:exit-to-left .2s var(--ease-out)}.data-\\[segment\\=literal\\]\\:text-muted[data-segment=literal]{color:var(--ui-text-muted)}.data-\\[state\\=active\\]\\:text-error[data-state=active]{color:var(--ui-error)}.data-\\[state\\=active\\]\\:text-highlighted[data-state=active]{color:var(--ui-text-highlighted)}.data-\\[state\\=active\\]\\:text-info[data-state=active]{color:var(--ui-info)}.data-\\[state\\=active\\]\\:text-inverted[data-state=active]{color:var(--ui-text-inverted)}.data-\\[state\\=active\\]\\:text-primary[data-state=active]{color:var(--ui-primary)}.data-\\[state\\=active\\]\\:text-success[data-state=active]{color:var(--ui-success)}.data-\\[state\\=active\\]\\:text-warning[data-state=active]{color:var(--ui-warning)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:isolate[data-state=active]{isolation:isolate}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:absolute[data-state=active]:before{content:var(--tw-content);position:absolute}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:inset-0[data-state=active]:before{content:var(--tw-content);inset:0}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:-z-10[data-state=active]:before{content:var(--tw-content);z-index:-10}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:rounded-md[data-state=active]:before{content:var(--tw-content);border-radius:calc(var(--ui-radius) * 1.5)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:bg-error[data-state=active]:before{content:var(--tw-content);background-color:var(--ui-error)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:bg-info[data-state=active]:before{content:var(--tw-content);background-color:var(--ui-info)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:bg-inverted[data-state=active]:before{content:var(--tw-content);background-color:var(--ui-bg-inverted)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:bg-primary[data-state=active]:before{content:var(--tw-content);background-color:var(--ui-primary)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:bg-success[data-state=active]:before{content:var(--tw-content);background-color:var(--ui-success)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:bg-warning[data-state=active]:before{content:var(--tw-content);background-color:var(--ui-warning)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:shadow-xs[data-state=active]:before{content:var(--tw-content);--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:before\\:content-\\[\\'\\'\\][data-state=active]:before{--tw-content:"";content:var(--tw-content)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:absolute[data-state=active]:after{content:var(--tw-content);position:absolute}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:inset-x-0[data-state=active]:after{content:var(--tw-content);inset-inline:0}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:inset-y-0[data-state=active]:after{content:var(--tw-content);inset-block:0}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:-start-\\[calc\\(var\\(--spacing\\)\\+1px\\)\\][data-state=active]:after{content:var(--tw-content);inset-inline-start:calc(calc(var(--spacing) + 1px) * -1)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:-bottom-\\[calc\\(var\\(--spacing\\)\\+1px\\)\\][data-state=active]:after{content:var(--tw-content);bottom:calc(calc(var(--spacing) + 1px) * -1)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:h-px[data-state=active]:after{content:var(--tw-content);height:1px}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:w-px[data-state=active]:after{content:var(--tw-content);width:1px}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:rounded-full[data-state=active]:after{content:var(--tw-content);border-radius:3.40282e38px}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:bg-error[data-state=active]:after{content:var(--tw-content);background-color:var(--ui-error)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:bg-info[data-state=active]:after{content:var(--tw-content);background-color:var(--ui-info)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:bg-inverted[data-state=active]:after{content:var(--tw-content);background-color:var(--ui-bg-inverted)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:bg-primary[data-state=active]:after{content:var(--tw-content);background-color:var(--ui-primary)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:bg-success[data-state=active]:after{content:var(--tw-content);background-color:var(--ui-success)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:bg-warning[data-state=active]:after{content:var(--tw-content);background-color:var(--ui-warning)}:where([data-slot=list]:not(:has([data-slot=indicator]))) .in-\\[\\[data-slot\\=list\\]\\:not\\(\\:has\\(\\[data-slot\\=indicator\\]\\)\\)\\]\\:data-\\[state\\=active\\]\\:after\\:content-\\[\\'\\'\\][data-state=active]:after{--tw-content:"";content:var(--tw-content)}.data-\\[state\\=checked\\]\\:translate-x-3[data-state=checked]{--tw-translate-x:calc(var(--spacing) * 3);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:translate-x-3\\.5[data-state=checked]{--tw-translate-x:calc(var(--spacing) * 3.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:translate-x-4\\.5[data-state=checked]{--tw-translate-x:calc(var(--spacing) * 4.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:translate-x-5[data-state=checked]{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:bg-error[data-state=checked]{background-color:var(--ui-error)}.data-\\[state\\=checked\\]\\:bg-info[data-state=checked]{background-color:var(--ui-info)}.data-\\[state\\=checked\\]\\:bg-inverted[data-state=checked]{background-color:var(--ui-bg-inverted)}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:var(--ui-primary)}.data-\\[state\\=checked\\]\\:bg-success[data-state=checked]{background-color:var(--ui-success)}.data-\\[state\\=checked\\]\\:bg-warning[data-state=checked]{background-color:var(--ui-warning)}.data-\\[state\\=closed\\]\\:animate-\\[collapsible-up_200ms_var\\(--ease-out\\)\\][data-state=closed]{animation:collapsible-up .2s var(--ease-out)}.data-\\[state\\=closed\\]\\:animate-\\[fade-out_200ms_var\\(--ease-out\\)\\][data-state=closed]{animation:fade-out .2s var(--ease-out)}.data-\\[state\\=closed\\]\\:animate-\\[scale-out_100ms_var\\(--ease-out\\)\\][data-state=closed]{animation:scale-out .1s var(--ease-out)}.data-\\[state\\=closed\\]\\:animate-\\[scale-out_200ms_var\\(--ease-out\\)\\][data-state=closed]{animation:scale-out .2s var(--ease-out)}.data-\\[state\\=closed\\]\\:animate-\\[toast-closed_200ms_var\\(--ease-out\\)\\][data-state=closed]{animation:toast-closed .2s var(--ease-out)}.data-\\[state\\=closed\\]\\:overflow-hidden[data-state=closed]{overflow:hidden}.data-\\[state\\=closed\\]\\:data-\\[collapsed\\=true\\]\\:data-\\[front\\=false\\]\\:animate-\\[toast-collapsed-closed_200ms_var\\(--ease-out\\)\\][data-state=closed][data-collapsed=true][data-front=false]{animation:toast-collapsed-closed .2s var(--ease-out)}.data-\\[state\\=delayed-open\\]\\:animate-\\[scale-in_100ms_var\\(--ease-out\\)\\][data-state=delayed-open]{animation:scale-in .1s var(--ease-out)}.data-\\[state\\=hidden\\]\\:animate-\\[fade-out_100ms_var\\(--ease-out\\)\\][data-state=hidden]{animation:fade-out .1s var(--ease-out)}.data-\\[state\\=hidden\\]\\:opacity-0[data-state=hidden]{opacity:0}.data-\\[state\\=inactive\\]\\:text-muted[data-state=inactive]{color:var(--ui-text-muted)}@media(hover:hover){.hover\\:data-\\[state\\=inactive\\]\\:not-disabled\\:text-default:hover[data-state=inactive]:not(:disabled){color:var(--ui-text)}}.data-\\[state\\=open\\]\\:animate-\\[collapsible-down_200ms_var\\(--ease-out\\)\\][data-state=open]{animation:collapsible-down .2s var(--ease-out)}.data-\\[state\\=open\\]\\:animate-\\[fade-in_200ms_var\\(--ease-out\\)\\][data-state=open]{animation:fade-in .2s var(--ease-out)}.data-\\[state\\=open\\]\\:animate-\\[scale-in_100ms_var\\(--ease-out\\)\\][data-state=open]{animation:scale-in .1s var(--ease-out)}.data-\\[state\\=open\\]\\:animate-\\[scale-in_200ms_var\\(--ease-out\\)\\][data-state=open]{animation:scale-in .2s var(--ease-out)}.data-\\[state\\=open\\]\\:animate-\\[toast-slide-in-from-bottom_200ms_var\\(--ease-out\\)\\][data-state=open]{animation:toast-slide-in-from-bottom .2s var(--ease-out)}.data-\\[state\\=open\\]\\:animate-\\[toast-slide-in-from-top_200ms_var\\(--ease-out\\)\\][data-state=open]{animation:toast-slide-in-from-top .2s var(--ease-out)}.data-\\[state\\=open\\]\\:text-highlighted[data-state=open]{color:var(--ui-text-highlighted)}.data-\\[state\\=open\\]\\:before\\:bg-elevated\\/50[data-state=open]:before{content:var(--tw-content);background-color:var(--ui-bg-elevated)}@supports (color:color-mix(in lab,red,red)){.data-\\[state\\=open\\]\\:before\\:bg-elevated\\/50[data-state=open]:before{background-color:color-mix(in oklab,var(--ui-bg-elevated) 50%,transparent)}}.data-\\[state\\=open\\]\\:before\\:bg-error\\/10[data-state=open]:before{content:var(--tw-content);background-color:var(--ui-error)}@supports (color:color-mix(in lab,red,red)){.data-\\[state\\=open\\]\\:before\\:bg-error\\/10[data-state=open]:before{background-color:color-mix(in oklab,var(--ui-error) 10%,transparent)}}.data-\\[state\\=open\\]\\:before\\:bg-info\\/10[data-state=open]:before{content:var(--tw-content);background-color:var(--ui-info)}@supports (color:color-mix(in lab,red,red)){.data-\\[state\\=open\\]\\:before\\:bg-info\\/10[data-state=open]:before{background-color:color-mix(in oklab,var(--ui-info) 10%,transparent)}}.data-\\[state\\=open\\]\\:before\\:bg-primary\\/10[data-state=open]:before{content:var(--tw-content);background-color:var(--ui-primary)}@supports (color:color-mix(in lab,red,red)){.data-\\[state\\=open\\]\\:before\\:bg-primary\\/10[data-state=open]:before{background-color:color-mix(in oklab,var(--ui-primary) 10%,transparent)}}.data-\\[state\\=open\\]\\:before\\:bg-success\\/10[data-state=open]:before{content:var(--tw-content);background-color:var(--ui-success)}@supports (color:color-mix(in lab,red,red)){.data-\\[state\\=open\\]\\:before\\:bg-success\\/10[data-state=open]:before{background-color:color-mix(in oklab,var(--ui-success) 10%,transparent)}}.data-\\[state\\=open\\]\\:before\\:bg-warning\\/10[data-state=open]:before{content:var(--tw-content);background-color:var(--ui-warning)}@supports (color:color-mix(in lab,red,red)){.data-\\[state\\=open\\]\\:before\\:bg-warning\\/10[data-state=open]:before{background-color:color-mix(in oklab,var(--ui-warning) 10%,transparent)}}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=unchecked\\]\\:bg-accented[data-state=unchecked]{background-color:var(--ui-bg-accented)}.data-\\[state\\=visible\\]\\:animate-\\[fade-in_100ms_var\\(--ease-out\\)\\][data-state=visible]{animation:fade-in .1s var(--ease-out)}.data-\\[swipe\\=cancel\\]\\:translate-x-0[data-swipe=cancel]{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[swipe\\=cancel\\]\\:translate-y-0[data-swipe=cancel]{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[swipe\\=end\\]\\:translate-x-\\(--reka-toast-swipe-end-x\\)[data-swipe=end]{--tw-translate-x:var(--reka-toast-swipe-end-x);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[swipe\\=end\\]\\:translate-y-\\(--reka-toast-swipe-end-y\\)[data-swipe=end]{--tw-translate-y:var(--reka-toast-swipe-end-y);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[swipe\\=end\\]\\:animate-\\[toast-slide-down_200ms_var\\(--ease-out\\)\\][data-swipe=end]{animation:toast-slide-down .2s var(--ease-out)}.data-\\[swipe\\=end\\]\\:animate-\\[toast-slide-left_200ms_var\\(--ease-out\\)\\][data-swipe=end]{animation:toast-slide-left .2s var(--ease-out)}.data-\\[swipe\\=end\\]\\:animate-\\[toast-slide-right_200ms_var\\(--ease-out\\)\\][data-swipe=end]{animation:toast-slide-right .2s var(--ease-out)}.data-\\[swipe\\=end\\]\\:animate-\\[toast-slide-up_200ms_var\\(--ease-out\\)\\][data-swipe=end]{animation:toast-slide-up .2s var(--ease-out)}.data-\\[swipe\\=move\\]\\:translate-x-\\(--reka-toast-swipe-move-x\\)[data-swipe=move]{--tw-translate-x:var(--reka-toast-swipe-move-x);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[swipe\\=move\\]\\:translate-y-\\(--reka-toast-swipe-move-y\\)[data-swipe=move]{--tw-translate-y:var(--reka-toast-swipe-move-y);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[swipe\\=move\\]\\:transition-none[data-swipe=move]{transition-property:none}@media(prefers-reduced-motion:no-preference){.motion-safe\\:data-\\[state\\=indeterminate\\]\\:animate-\\[carousel-inverse-vertical_2s_linear_infinite\\][data-state=indeterminate]{animation:2s linear infinite carousel-inverse-vertical}.motion-safe\\:data-\\[state\\=indeterminate\\]\\:animate-\\[carousel-inverse_2s_linear_infinite\\][data-state=indeterminate]{animation:2s linear infinite carousel-inverse}.motion-safe\\:data-\\[state\\=indeterminate\\]\\:animate-\\[carousel-vertical_2s_linear_infinite\\][data-state=indeterminate]{animation:2s linear infinite carousel-vertical}.motion-safe\\:data-\\[state\\=indeterminate\\]\\:animate-\\[carousel_2s_linear_infinite\\][data-state=indeterminate]{animation:2s linear infinite carousel}.motion-safe\\:data-\\[state\\=indeterminate\\]\\:animate-\\[elastic-vertical_2s_var\\(--ease-in-out\\)_infinite\\][data-state=indeterminate]{animation:elastic-vertical 2s var(--ease-in-out) infinite}.motion-safe\\:data-\\[state\\=indeterminate\\]\\:animate-\\[elastic_2s_var\\(--ease-in-out\\)_infinite\\][data-state=indeterminate]{animation:elastic 2s var(--ease-in-out) infinite}.motion-safe\\:data-\\[state\\=indeterminate\\]\\:animate-\\[swing-vertical_2s_var\\(--ease-in-out\\)_infinite\\][data-state=indeterminate]{animation:swing-vertical 2s var(--ease-in-out) infinite}.motion-safe\\:data-\\[state\\=indeterminate\\]\\:animate-\\[swing_2s_var\\(--ease-in-out\\)_infinite\\][data-state=indeterminate]{animation:swing 2s var(--ease-in-out) infinite}.motion-safe\\:data-\\[state\\=open\\]\\:data-\\[pulsing\\=even\\]\\:animate-\\[toast-pulse-b_200ms_var\\(--ease-out\\)\\][data-state=open][data-pulsing=even]{animation:toast-pulse-b .2s var(--ease-out)}.motion-safe\\:data-\\[state\\=open\\]\\:data-\\[pulsing\\=odd\\]\\:animate-\\[toast-pulse-a_200ms_var\\(--ease-out\\)\\][data-state=open][data-pulsing=odd]{animation:toast-pulse-a .2s var(--ease-out)}}@media(prefers-reduced-motion:reduce){.motion-reduce\\:transition-none{transition-property:none}.motion-reduce\\:data-\\[state\\=indeterminate\\]\\:animate-pulse[data-state=indeterminate]{animation:var(--animate-pulse)}}@media(min-width:40rem){.sm\\:block{display:block}.sm\\:max-h-\\[calc\\(100dvh-4rem\\)\\]{max-height:calc(100dvh - 4rem)}.sm\\:w-\\(--reka-navigation-menu-viewport-width\\){width:var(--reka-navigation-menu-viewport-width)}.sm\\:w-96{width:calc(var(--spacing) * 96)}.sm\\:scroll-mt-6{scroll-margin-top:calc(var(--spacing) * 6)}.sm\\:p-6{padding:calc(var(--spacing) * 6)}.sm\\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\\:py-8{padding-block:calc(var(--spacing) * 8)}}@media(min-width:48rem){.md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}}@media(min-width:64rem){.lg\\:block{display:block}.lg\\:flex{display:flex}.lg\\:hidden{display:none}.lg\\:inline-flex{display:inline-flex}.lg\\:p-8{padding:calc(var(--spacing) * 8)}}.rtl\\:right-\\[calc\\(100\\%-var\\(--reka-navigation-menu-viewport-left\\)-var\\(--reka-navigation-menu-viewport-width\\)\\)\\]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){right:calc(100% - var(--reka-navigation-menu-viewport-left) - var(--reka-navigation-menu-viewport-width))}.rtl\\:left-auto:where(:dir(rtl),[dir=rtl],[dir=rtl] *){left:auto}.rtl\\:flex-row:where(:dir(rtl),[dir=rtl],[dir=rtl] *){flex-direction:row}.rtl\\:flex-row-reverse:where(:dir(rtl),[dir=rtl],[dir=rtl] *){flex-direction:row-reverse}.data-\\[state\\=checked\\]\\:rtl\\:-translate-x-3[data-state=checked]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(var(--spacing) * -3);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:rtl\\:-translate-x-3\\.5[data-state=checked]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(var(--spacing) * -3.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:rtl\\:-translate-x-4[data-state=checked]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(var(--spacing) * -4);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:rtl\\:-translate-x-4\\.5[data-state=checked]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(var(--spacing) * -4.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:rtl\\:-translate-x-5[data-state=checked]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(var(--spacing) * -5);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[state\\=unchecked\\]\\:rtl\\:-translate-x-0[data-state=unchecked]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}@media(prefers-reduced-motion:no-preference){.motion-safe\\:data-\\[state\\=indeterminate\\]\\:rtl\\:animate-\\[carousel-inverse-rtl_2s_linear_infinite\\][data-state=indeterminate]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){animation:2s linear infinite carousel-inverse-rtl}.motion-safe\\:data-\\[state\\=indeterminate\\]\\:rtl\\:animate-\\[carousel-rtl_2s_linear_infinite\\][data-state=indeterminate]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){animation:2s linear infinite carousel-rtl}}.dark\\:block:where(.dark,.dark *){display:block}.dark\\:hidden:where(.dark,.dark *){display:none}.dark\\:inline-block:where(.dark,.dark *){display:inline-block}.dark\\:disabled\\:bg-transparent:where(.dark,.dark *):disabled{background-color:#0000}@media(hover:hover){.dark\\:hover\\:disabled\\:bg-transparent:where(.dark,.dark *):hover:disabled{background-color:#0000}}.dark\\:aria-disabled\\:bg-transparent:where(.dark,.dark *)[aria-disabled=true]{background-color:#0000}@media(hover:hover){.dark\\:hover\\:aria-disabled\\:bg-transparent:where(.dark,.dark *):hover[aria-disabled=true]{background-color:#0000}}@media(prefers-reduced-motion:no-preference){.motion-safe\\:\\[\\&\\>\\*\\:nth-child\\(1\\)\\]\\:animate-\\[bounce_1s_infinite\\]>:first-child{animation:1s infinite bounce}.motion-safe\\:\\[\\&\\>\\*\\:nth-child\\(2\\)\\]\\:animate-\\[bounce_1s_0\\.15s_infinite\\]>:nth-child(2){animation:1s .15s infinite bounce}.motion-safe\\:\\[\\&\\>\\*\\:nth-child\\(3\\)\\]\\:animate-\\[bounce_1s_0\\.3s_infinite\\]>:nth-child(3){animation:1s .3s infinite bounce}}.\\[\\&\\>\\[data-slot\\=icon\\]\\]\\:animate-spin>[data-slot=icon]{animation:var(--animate-spin)}.\\[\\&\\>article\\]\\:last-of-type\\:min-h-\\(--last-message-height\\)>article:last-of-type{min-height:var(--last-message-height)}.\\[\\&\\>div\\]\\:min-w-0>div{min-width:0}@media(hover:hover){.\\[\\@media\\(hover\\:hover\\)\\]\\:opacity-0{opacity:0}}}@keyframes accordion-up{0%{height:var(--reka-accordion-content-height);overflow:hidden}to{height:0;overflow:hidden}}@keyframes accordion-down{0%{height:0;overflow:hidden}to{height:var(--reka-accordion-content-height);overflow:hidden}}@keyframes collapsible-up{0%{height:var(--reka-collapsible-content-height);overflow:hidden}to{height:0;overflow:hidden}}@keyframes collapsible-down{0%{height:0;overflow:hidden}to{height:var(--reka-collapsible-content-height);overflow:hidden}}@keyframes toast-slide-in-from-top{0%{transform:translateY(-100%)}to{transform:var(--transform)}}@keyframes toast-slide-in-from-bottom{0%{transform:translateY(100%)}to{transform:var(--transform)}}@keyframes toast-slide-up{0%{transform:translate(0) translateY(var(--translate))}to{transform:translate(0) translateY(calc(var(--translate) - 100%))}}@keyframes toast-slide-down{0%{transform:translate(0) translateY(var(--translate))}to{transform:translate(0) translateY(calc(var(--translate) + 100%))}}@keyframes toast-pulse-a{0%,to{scale:1}50%{scale:1.04}}@keyframes toast-pulse-b{0%,to{scale:1}50%{scale:1.04}}@keyframes toast-collapsed-closed{0%{transform:var(--transform)}to{transform:translateY(calc((var(--before) - var(--height))*var(--gap))) scale(var(--scale))}}@keyframes toast-closed{0%{transform:var(--transform)}to{transform:translateY(calc((var(--offset) - var(--height))*var(--translate-factor)))}}@keyframes toast-slide-left{0%{transform:translate(0) translateY(var(--translate))}to{transform:translate(-100%) translateY(var(--translate))}}@keyframes toast-slide-right{0%{transform:translate(0) translateY(var(--translate))}to{transform:translate(100%) translateY(var(--translate))}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}@keyframes scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes scale-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes slide-in-from-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slide-out-to-top{0%{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes slide-in-from-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes slide-out-to-right{0%{transform:translate(0)}to{transform:translate(100%)}}@keyframes slide-in-from-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slide-out-to-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slide-in-from-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slide-out-to-left{0%{transform:translate(0)}to{transform:translate(-100%)}}@keyframes slide-in-from-top-and-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-out-to-top-and-fade{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes slide-in-from-right-and-fade{0%{opacity:0;transform:translate(4px)}to{opacity:1;transform:translate(0)}}@keyframes slide-out-to-right-and-fade{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(4px)}}@keyframes slide-in-from-bottom-and-fade{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-out-to-bottom-and-fade{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}@keyframes slide-in-from-left-and-fade{0%{opacity:0;transform:translate(-4px)}to{opacity:1;transform:translate(0)}}@keyframes slide-out-to-left-and-fade{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(-4px)}}@keyframes enter-from-right{0%{opacity:0;transform:translate(200px)}to{opacity:1;transform:translate(0)}}@keyframes enter-from-left{0%{opacity:0;transform:translate(-200px)}to{opacity:1;transform:translate(0)}}@keyframes exit-to-right{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(200px)}}@keyframes exit-to-left{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(-200px)}}@keyframes carousel{0%,to{width:50%}0%{transform:translate(-100%)}to{transform:translate(200%)}}@keyframes carousel-rtl{0%,to{width:50%}0%{transform:translate(100%)}to{transform:translate(-200%)}}@keyframes carousel-vertical{0%,to{height:50%}0%{transform:translateY(-100%)}to{transform:translateY(200%)}}@keyframes carousel-inverse{0%,to{width:50%}0%{transform:translate(200%)}to{transform:translate(-100%)}}@keyframes carousel-inverse-rtl{0%,to{width:50%}0%{transform:translate(-200%)}to{transform:translate(100%)}}@keyframes carousel-inverse-vertical{0%,to{height:50%}0%{transform:translateY(200%)}to{transform:translateY(-100%)}}@keyframes swing{0%,to{width:50%}0%,to{transform:translate(-25%)}50%{transform:translate(125%)}}@keyframes swing-vertical{0%,to{height:50%}0%,to{transform:translateY(-25%)}50%{transform:translateY(125%)}}@keyframes elastic{0%,to{width:50%;left:25%}50%{width:100%;left:0}}@keyframes elastic-vertical{0%,to{height:50%;top:25%}50%{height:100%;top:0}}@keyframes marquee{0%{transform:translateZ(0)}to{transform:translate3d(calc(-100% - var(--gap)),0,0)}}@keyframes marquee-rtl{0%{transform:translateZ(0)}to{transform:translate3d(calc(100% + var(--gap)),0,0)}}@keyframes marquee-vertical{0%{transform:translateZ(0)}to{transform:translate3d(0,calc(-100% - var(--gap)),0)}}@keyframes shimmer{0%{background-position:100%}to{background-position:0}}@keyframes shimmer-rtl{0%{background-position:0}to{background-position:100%}}@media(prefers-reduced-motion:reduce){@keyframes scale-in{0%{opacity:0}to{opacity:1}}@keyframes scale-out{0%{opacity:1}to{opacity:0}}@keyframes slide-in-from-top{0%{opacity:0}to{opacity:1}}@keyframes slide-out-to-top{0%{opacity:1}to{opacity:0}}@keyframes slide-in-from-right{0%{opacity:0}to{opacity:1}}@keyframes slide-out-to-right{0%{opacity:1}to{opacity:0}}@keyframes slide-in-from-bottom{0%{opacity:0}to{opacity:1}}@keyframes slide-out-to-bottom{0%{opacity:1}to{opacity:0}}@keyframes slide-in-from-left{0%{opacity:0}to{opacity:1}}@keyframes slide-out-to-left{0%{opacity:1}to{opacity:0}}@keyframes slide-in-from-top-and-fade{0%{opacity:0}to{opacity:1}}@keyframes slide-out-to-top-and-fade{0%{opacity:1}to{opacity:0}}@keyframes slide-in-from-right-and-fade{0%{opacity:0}to{opacity:1}}@keyframes slide-out-to-right-and-fade{0%{opacity:1}to{opacity:0}}@keyframes slide-in-from-bottom-and-fade{0%{opacity:0}to{opacity:1}}@keyframes slide-out-to-bottom-and-fade{0%{opacity:1}to{opacity:0}}@keyframes slide-in-from-left-and-fade{0%{opacity:0}to{opacity:1}}@keyframes slide-out-to-left-and-fade{0%{opacity:1}to{opacity:0}}@keyframes enter-from-right{0%{opacity:0}to{opacity:1}}@keyframes enter-from-left{0%{opacity:0}to{opacity:1}}@keyframes exit-to-right{0%{opacity:1}to{opacity:0}}@keyframes exit-to-left{0%{opacity:1}to{opacity:0}}@keyframes toast-slide-in-from-top{0%{opacity:0}to{opacity:1}}@keyframes toast-slide-in-from-bottom{0%{opacity:0}to{opacity:1}}@keyframes toast-closed{0%{opacity:1}to{opacity:0}}@keyframes toast-collapsed-closed{0%{opacity:1}to{opacity:0}}}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}`; const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/; const stringToIcon = (value, validate, allowSimpleName, provider = "") => { const colonSeparated = value.split(":"); if (value.slice(0, 1) === "@") { if (colonSeparated.length < 2 || colonSeparated.length > 3) return null; provider = colonSeparated.shift().slice(1); } if (colonSeparated.length > 3 || !colonSeparated.length) return null; if (colonSeparated.length > 1) { const name2 = colonSeparated.pop(); const prefix = colonSeparated.pop(); const result = { provider: colonSeparated.length > 0 ? colonSeparated[0] : provider, prefix, name: name2 }; return validate && !validateIconName(result) ? null : result; } const name = colonSeparated[0]; const dashSeparated = name.split("-"); if (dashSeparated.length > 1) { const result = { provider, prefix: dashSeparated.shift(), name: dashSeparated.join("-") }; return validate && !validateIconName(result) ? null : result; } if (allowSimpleName && provider === "") { const result = { provider, prefix: "", name }; return validate && !validateIconName(result, allowSimpleName) ? null : result; } return null; }; const validateIconName = (icon, allowSimpleName) => { if (!icon) return false; return !!((allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name); }; function getIconsTree(data, names) { const icons = data.icons; const aliases = data.aliases || Object.create(null); const resolved = Object.create(null); function resolve(name) { if (icons[name]) return resolved[name] = []; if (!(name in resolved)) { resolved[name] = null; const parent = aliases[name] && aliases[name].parent; const value = parent && resolve(parent); if (value) resolved[name] = [parent].concat(value); } return resolved[name]; } Object.keys(icons).concat(Object.keys(aliases)).forEach(resolve); return resolved; } const defaultIconDimensions = Object.freeze({ left: 0, top: 0, width: 16, height: 16 }); const defaultIconTransformations = Object.freeze({ rotate: 0, vFlip: false, hFlip: false }); const defaultIconProps = Object.freeze({ ...defaultIconDimensions, ...defaultIconTransformations }); const defaultExtendedIconProps = Object.freeze({ ...defaultIconProps, body: "", hidden: false }); function mergeIconTransformations(obj1, obj2) { const result = {}; if (!obj1.hFlip !== !obj2.hFlip) result.hFlip = true; if (!obj1.vFlip !== !obj2.vFlip) result.vFlip = true; const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4; if (rotate) result.rotate = rotate; return result; } function mergeIconData(parent, child) { const result = mergeIconTransformations(parent, child); for (const key in defaultExtendedIconProps) if (key in defaultIconTransformations) { if (key in parent && !(key in result)) result[key] = defaultIconTransformations[key]; } else if (key in child) result[key] = child[key]; else if (key in parent) result[key] = parent[key]; return result; } function internalGetIconData(data, name, tree) { const icons = data.icons; const aliases = data.aliases || Object.create(null); let currentProps = {}; function parse(name2) { currentProps = mergeIconData(icons[name2] || aliases[name2], currentProps); } parse(name); tree.forEach(parse); return mergeIconData(data, currentProps); } function parseIconSet(data, callback) { const names = []; if (typeof data !== "object" || typeof data.icons !== "object") return names; if (data.not_found instanceof Array) data.not_found.forEach((name) => { callback(name, null); names.push(name); }); const tree = getIconsTree(data); for (const name in tree) { const item = tree[name]; if (item) { callback(name, internalGetIconData(data, name, item)); names.push(name); } } return names; } const optionalPropertyDefaults = { provider: "", aliases: {}, not_found: {}, ...defaultIconDimensions }; function checkOptionalProps(item, defaults) { for (const prop in defaults) if (prop in item && typeof item[prop] !== typeof defaults[prop]) return false; return true; } function quicklyValidateIconSet(obj) { if (typeof obj !== "object" || obj === null) return null; const data = obj; if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") return null; if (!checkOptionalProps(obj, optionalPropertyDefaults)) return null; const icons = data.icons; for (const name in icons) { const icon = icons[name]; if (!name || typeof icon.body !== "string" || !checkOptionalProps(icon, defaultExtendedIconProps)) return null; } const aliases = data.aliases || Object.create(null); for (const name in aliases) { const icon = aliases[name]; const parent = icon.parent; if (!name || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(icon, defaultExtendedIconProps)) return null; } return data; } const dataStorage = Object.create(null); function newStorage(provider, prefix) { return { provider, prefix, icons: Object.create(null), missing: new Set() }; } function getStorage(provider, prefix) { const providerStorage = dataStorage[provider] || (dataStorage[provider] = Object.create(null)); return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix)); } function addIconSet(storage2, data) { if (!quicklyValidateIconSet(data)) return []; return parseIconSet(data, (name, icon) => { if (icon) storage2.icons[name] = icon; else storage2.missing.add(name); }); } function addIconToStorage(storage2, name, icon) { try { if (typeof icon.body === "string") { storage2.icons[name] = { ...icon }; return true; } } catch (err) { } return false; } let simpleNames = false; function allowSimpleNames(allow) { if (typeof allow === "boolean") simpleNames = allow; return simpleNames; } function getIconData(name) { const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name; if (icon) { const storage2 = getStorage(icon.provider, icon.prefix); const iconName = icon.name; return storage2.icons[iconName] || (storage2.missing.has(iconName) ? null : void 0); } } function addIcon(name, data) { const icon = stringToIcon(name, true, simpleNames); if (!icon) return false; const storage2 = getStorage(icon.provider, icon.prefix); if (data) return addIconToStorage(storage2, icon.name, data); else { storage2.missing.add(icon.name); return true; } } function addCollection(data, provider) { if (typeof data !== "object") return false; if (typeof provider !== "string") provider = data.provider || ""; if (simpleNames && !provider && !data.prefix) { let added = false; if (quicklyValidateIconSet(data)) { data.prefix = ""; parseIconSet(data, (name, icon) => { if (addIcon(name, icon)) added = true; }); } return added; } const prefix = data.prefix; if (!validateIconName({ prefix, name: "a" })) return false; const storage2 = getStorage(provider, prefix); return !!addIconSet(storage2, data); } function iconLoaded(name) { return !!getIconData(name); } const defaultIconSizeCustomisations = Object.freeze({ width: null, height: null }); const defaultIconCustomisations = Object.freeze({ ...defaultIconSizeCustomisations, ...defaultIconTransformations }); const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g; const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g; function calculateSize(size2, ratio, precision) { if (ratio === 1) return size2; precision = precision || 100; if (typeof size2 === "number") return Math.ceil(size2 * ratio * precision) / precision; if (typeof size2 !== "string") return size2; const oldParts = size2.split(unitsSplit); if (oldParts === null || !oldParts.length) return size2; const newParts = []; let code = oldParts.shift(); let isNumber2 = unitsTest.test(code); while (true) { if (isNumber2) { const num2 = parseFloat(code); if (isNaN(num2)) newParts.push(code); else newParts.push(Math.ceil(num2 * ratio * precision) / precision); } else newParts.push(code); code = oldParts.shift(); if (code === void 0) return newParts.join(""); isNumber2 = !isNumber2; } } function splitSVGDefs(content, tag = "defs") { let defs = ""; const index = content.indexOf("<" + tag); while (index >= 0) { const start = content.indexOf(">", index); const end = content.indexOf("", end); if (endEnd === -1) break; defs += content.slice(start + 1, end).trim(); content = content.slice(0, index).trim() + content.slice(endEnd + 1); } return { defs, content }; } function mergeDefsAndContent(defs, content) { return defs ? "" + defs + "" + content : content; } function wrapSVGContent(body, start, end) { const split = splitSVGDefs(body); return mergeDefsAndContent(split.defs, start + split.content + end); } const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none"; function iconToSVG(icon, customisations) { const fullIcon = { ...defaultIconProps, ...icon }; const fullCustomisations = { ...defaultIconCustomisations, ...customisations }; const box = { left: fullIcon.left, top: fullIcon.top, width: fullIcon.width, height: fullIcon.height }; let body = fullIcon.body; [fullIcon, fullCustomisations].forEach((props) => { const transformations = []; const hFlip = props.hFlip; const vFlip = props.vFlip; let rotation = props.rotate; if (hFlip) { if (vFlip) rotation += 2; else { transformations.push("translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"); transformations.push("scale(-1 1)"); box.top = box.left = 0; } } else if (vFlip) { transformations.push("translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"); transformations.push("scale(1 -1)"); box.top = box.left = 0; } let tempValue; if (rotation < 0) rotation -= Math.floor(rotation / 4) * 4; rotation = rotation % 4; switch (rotation) { case 1: tempValue = box.height / 2 + box.top; transformations.unshift("rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"); break; case 2: transformations.unshift("rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"); break; case 3: tempValue = box.width / 2 + box.left; transformations.unshift("rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"); } if (rotation % 2 === 1) { if (box.left !== box.top) { tempValue = box.left; box.left = box.top; box.top = tempValue; } if (box.width !== box.height) { tempValue = box.width; box.width = box.height; box.height = tempValue; } } if (transformations.length) body = wrapSVGContent(body, '', ""); }); const customisationsWidth = fullCustomisations.width; const customisationsHeight = fullCustomisations.height; const boxWidth = box.width; const boxHeight = box.height; let width; let height; if (customisationsWidth === null) { height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight; width = calculateSize(height, boxWidth / boxHeight); } else { width = customisationsWidth === "auto" ? boxWidth : customisationsWidth; height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight; } const attributes = {}; const setAttr = (prop, value) => { if (!isUnsetKeyword(value)) attributes[prop] = value.toString(); }; setAttr("width", width); setAttr("height", height); const viewBox = [ box.left, box.top, boxWidth, boxHeight ]; attributes.viewBox = viewBox.join(" "); return { attributes, viewBox, body }; } const regex = /\sid="(\S+)"/g; const counters = new Map(); function nextID(id) { id = id.replace(/[0-9]+$/, "") || "a"; const count2 = counters.get(id) || 0; counters.set(id, count2 + 1); return count2 ? `${id}${count2}` : id; } function replaceIDs(body) { const ids = []; let match; while (match = regex.exec(body)) ids.push(match[1]); if (!ids.length) return body; const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16); ids.forEach((id) => { const newID = nextID(id); const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); body = body.replace(new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"), "$1" + newID + suffix + "$3"); }); body = body.replace(new RegExp(suffix, "g"), ""); return body; } const storage = Object.create(null); function setAPIModule(provider, item) { storage[provider] = item; } function getAPIModule(provider) { return storage[provider] || storage[""]; } function createAPIConfig(source) { let resources; if (typeof source.resources === "string") resources = [source.resources]; else { resources = source.resources; if (!(resources instanceof Array) || !resources.length) return null; } return { resources, path: source.path || "/", maxURL: source.maxURL || 500, rotate: source.rotate || 2e3, timeout: source.timeout || 1e4, random: source.random === true, index: source.index || 0, dataAfterTimeout: source.dataAfterTimeout !== false }; } const configStorage = Object.create(null); configStorage[""] = createAPIConfig({ resources: ["https://api.iconify.design", "https://api2.iconify.design"] }); function addAPIProvider(provider, customConfig) { const config2 = createAPIConfig(customConfig); if (config2 === null) return false; configStorage[provider] = config2; return true; } function getAPIConfig(provider) { return configStorage[provider]; } const detectFetch = () => { let callback; try { callback = fetch; if (typeof callback === "function") return callback; } catch (err) { } }; let fetchModule = detectFetch(); function calculateMaxLength(provider, prefix) { const config2 = getAPIConfig(provider); if (!config2) return 0; let result; if (!config2.maxURL) result = 0; else { let maxHostLength = 0; config2.resources.forEach((item) => { maxHostLength = Math.max(maxHostLength, item.length); }); const url = prefix + ".json?icons="; result = config2.maxURL - maxHostLength - config2.path.length - url.length; } return result; } function shouldAbort(status) { return status === 404; } const prepare = (provider, prefix, icons) => { const results = []; const maxLength = calculateMaxLength(provider, prefix); const type = "icons"; let item = { type, provider, prefix, icons: [] }; let length = 0; icons.forEach((name, index) => { length += name.length + 1; if (length >= maxLength && index > 0) { results.push(item); item = { type, provider, prefix, icons: [] }; length = name.length; } item.icons.push(name); }); results.push(item); return results; }; function getPath(provider) { if (typeof provider === "string") { const config2 = getAPIConfig(provider); if (config2) return config2.path; } return "/"; } const send = (host2, params, callback) => { if (!fetchModule) { callback("abort", 424); return; } let path = getPath(params.provider); switch (params.type) { case "icons": { const prefix = params.prefix; const iconsList = params.icons.join(","); const urlParams = new URLSearchParams({ icons: iconsList }); path += prefix + ".json?" + urlParams.toString(); break; } case "custom": { const uri = params.uri; path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri; break; } default: callback("abort", 400); return; } let defaultError = 503; fetchModule(host2 + path).then((response) => { const status = response.status; if (status !== 200) { setTimeout(() => { callback(shouldAbort(status) ? "abort" : "next", status); }); return; } defaultError = 501; return response.json(); }).then((data) => { if (typeof data !== "object" || data === null) { setTimeout(() => { if (data === 404) callback("abort", data); else callback("next", defaultError); }); return; } setTimeout(() => { callback("success", data); }); }).catch(() => { callback("next", defaultError); }); }; const fetchAPIModule = { prepare, send }; function removeCallback(storages, id) { storages.forEach((storage2) => { const items = storage2.loaderCallbacks; if (items) storage2.loaderCallbacks = items.filter((row) => row.id !== id); }); } function updateCallbacks(storage2) { if (!storage2.pendingCallbacksFlag) { storage2.pendingCallbacksFlag = true; setTimeout(() => { storage2.pendingCallbacksFlag = false; const items = storage2.loaderCallbacks ? storage2.loaderCallbacks.slice(0) : []; if (!items.length) return; let hasPending = false; const provider = storage2.provider; const prefix = storage2.prefix; items.forEach((item) => { const icons = item.icons; const oldLength = icons.pending.length; icons.pending = icons.pending.filter((icon) => { if (icon.prefix !== prefix) return true; const name = icon.name; if (storage2.icons[name]) icons.loaded.push({ provider, prefix, name }); else if (storage2.missing.has(name)) icons.missing.push({ provider, prefix, name }); else { hasPending = true; return true; } return false; }); if (icons.pending.length !== oldLength) { if (!hasPending) removeCallback([storage2], item.id); item.callback(icons.loaded.slice(0), icons.missing.slice(0), icons.pending.slice(0), item.abort); } }); }); } } let idCounter = 0; function storeCallback(callback, icons, pendingSources) { const id = idCounter++; const abort = removeCallback.bind(null, pendingSources, id); if (!icons.pending.length) return abort; const item = { id, icons, callback, abort }; pendingSources.forEach((storage2) => { (storage2.loaderCallbacks || (storage2.loaderCallbacks = [])).push(item); }); return abort; } function sortIcons(icons) { const result = { loaded: [], missing: [], pending: [] }; const storage2 = Object.create(null); icons.sort((a, b) => { if (a.provider !== b.provider) return a.provider.localeCompare(b.provider); if (a.prefix !== b.prefix) return a.prefix.localeCompare(b.prefix); return a.name.localeCompare(b.name); }); let lastIcon = { provider: "", prefix: "", name: "" }; icons.forEach((icon) => { if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) return; lastIcon = icon; const provider = icon.provider; const prefix = icon.prefix; const name = icon.name; const providerStorage = storage2[provider] || (storage2[provider] = Object.create(null)); const localStorage2 = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix)); let list; if (name in localStorage2.icons) list = result.loaded; else if (prefix === "" || localStorage2.missing.has(name)) list = result.missing; else list = result.pending; const item = { provider, prefix, name }; list.push(item); }); return result; } function listToIcons(list, validate = true, simpleNames2 = false) { const result = []; list.forEach((item) => { const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames2) : item; if (icon) result.push(icon); }); return result; } const defaultConfig$1 = { resources: [], index: 0, timeout: 2e3, rotate: 750, random: false, dataAfterTimeout: false }; function sendQuery(config2, payload, query, done) { const resourcesCount = config2.resources.length; const startIndex = config2.random ? Math.floor(Math.random() * resourcesCount) : config2.index; let resources; if (config2.random) { let list = config2.resources.slice(0); resources = []; while (list.length > 1) { const nextIndex = Math.floor(Math.random() * list.length); resources.push(list[nextIndex]); list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1)); } resources = resources.concat(list); } else resources = config2.resources.slice(startIndex).concat(config2.resources.slice(0, startIndex)); const startTime = Date.now(); let status = "pending"; let queriesSent = 0; let lastError; let timer2 = null; let queue = []; let doneCallbacks = []; if (typeof done === "function") doneCallbacks.push(done); function resetTimer() { if (timer2) { clearTimeout(timer2); timer2 = null; } } function abort() { if (status === "pending") status = "aborted"; resetTimer(); queue.forEach((item) => { if (item.status === "pending") item.status = "aborted"; }); queue = []; } function subscribe2(callback, overwrite) { if (overwrite) doneCallbacks = []; if (typeof callback === "function") doneCallbacks.push(callback); } function getQueryStatus() { return { startTime, payload, status, queriesSent, queriesPending: queue.length, subscribe: subscribe2, abort }; } function failQuery() { status = "failed"; doneCallbacks.forEach((callback) => { callback(void 0, lastError); }); } function clearQueue() { queue.forEach((item) => { if (item.status === "pending") item.status = "aborted"; }); queue = []; } function moduleResponse(item, response, data) { const isError = response !== "success"; queue = queue.filter((queued) => queued !== item); switch (status) { case "pending": break; case "failed": if (isError || !config2.dataAfterTimeout) return; break; default: return; } if (response === "abort") { lastError = data; failQuery(); return; } if (isError) { lastError = data; if (!queue.length) { if (!resources.length) failQuery(); else execNext(); } return; } resetTimer(); clearQueue(); if (!config2.random) { const index = config2.resources.indexOf(item.resource); if (index !== -1 && index !== config2.index) config2.index = index; } status = "completed"; doneCallbacks.forEach((callback) => { callback(data); }); } function execNext() { if (status !== "pending") return; resetTimer(); const resource = resources.shift(); if (resource === void 0) { if (queue.length) { timer2 = setTimeout(() => { resetTimer(); if (status === "pending") { clearQueue(); failQuery(); } }, config2.timeout); return; } failQuery(); return; } const item = { status: "pending", resource, callback: (status2, data) => { moduleResponse(item, status2, data); } }; queue.push(item); queriesSent++; timer2 = setTimeout(execNext, config2.rotate); query(resource, payload, item.callback); } setTimeout(execNext); return getQueryStatus; } function initRedundancy(cfg) { const config2 = { ...defaultConfig$1, ...cfg }; let queries = []; function cleanup() { queries = queries.filter((item) => item().status === "pending"); } function query(payload, queryCallback, doneCallback) { const query2 = sendQuery(config2, payload, queryCallback, (data, error) => { cleanup(); if (doneCallback) doneCallback(data, error); }); queries.push(query2); return query2; } function find(callback) { return queries.find((value) => { return callback(value); }) || null; } return { query, find, setIndex: (index) => { config2.index = index; }, getIndex: () => config2.index, cleanup }; } function emptyCallback$1() { } const redundancyCache = Object.create(null); function getRedundancyCache(provider) { if (!redundancyCache[provider]) { const config2 = getAPIConfig(provider); if (!config2) return; const cachedReundancy = { config: config2, redundancy: initRedundancy(config2) }; redundancyCache[provider] = cachedReundancy; } return redundancyCache[provider]; } function sendAPIQuery(target, query, callback) { let redundancy; let send2; if (typeof target === "string") { const api = getAPIModule(target); if (!api) { callback(void 0, 424); return emptyCallback$1; } send2 = api.send; const cached = getRedundancyCache(target); if (cached) redundancy = cached.redundancy; } else { const config2 = createAPIConfig(target); if (config2) { redundancy = initRedundancy(config2); const moduleKey = target.resources ? target.resources[0] : ""; const api = getAPIModule(moduleKey); if (api) send2 = api.send; } } if (!redundancy || !send2) { callback(void 0, 424); return emptyCallback$1; } return redundancy.query(query, send2, callback)().abort; } function emptyCallback() { } function loadedNewIcons(storage2) { if (!storage2.iconsLoaderFlag) { storage2.iconsLoaderFlag = true; setTimeout(() => { storage2.iconsLoaderFlag = false; updateCallbacks(storage2); }); } } function checkIconNamesForAPI(icons) { const valid = []; const invalid = []; icons.forEach((name) => { (name.match(matchIconName) ? valid : invalid).push(name); }); return { valid, invalid }; } function parseLoaderResponse(storage2, icons, data) { function checkMissing() { const pending2 = storage2.pendingIcons; icons.forEach((name) => { if (pending2) pending2.delete(name); if (!storage2.icons[name]) storage2.missing.add(name); }); } if (data && typeof data === "object") try { if (!addIconSet(storage2, data).length) { checkMissing(); return; } } catch (err) { console.error(err); } checkMissing(); loadedNewIcons(storage2); } function parsePossiblyAsyncResponse(response, callback) { if (response instanceof Promise) response.then((data) => { callback(data); }).catch(() => { callback(null); }); else callback(response); } function loadNewIcons(storage2, icons) { if (!storage2.iconsToLoad) storage2.iconsToLoad = icons; else storage2.iconsToLoad = storage2.iconsToLoad.concat(icons).sort(); if (!storage2.iconsQueueFlag) { storage2.iconsQueueFlag = true; setTimeout(() => { storage2.iconsQueueFlag = false; const { provider, prefix } = storage2; const icons2 = storage2.iconsToLoad; delete storage2.iconsToLoad; if (!icons2 || !icons2.length) return; const customIconLoader = storage2.loadIcon; if (storage2.loadIcons && (icons2.length > 1 || !customIconLoader)) { parsePossiblyAsyncResponse(storage2.loadIcons(icons2, prefix, provider), (data) => { parseLoaderResponse(storage2, icons2, data); }); return; } if (customIconLoader) { icons2.forEach((name) => { parsePossiblyAsyncResponse(customIconLoader(name, prefix, provider), (data) => { parseLoaderResponse(storage2, [name], data ? { prefix, icons: { [name]: data } } : null); }); }); return; } const { valid, invalid } = checkIconNamesForAPI(icons2); if (invalid.length) parseLoaderResponse(storage2, invalid, null); if (!valid.length) return; const api = prefix.match(matchIconName) ? getAPIModule(provider) : null; if (!api) { parseLoaderResponse(storage2, valid, null); return; } api.prepare(provider, prefix, valid).forEach((item) => { sendAPIQuery(provider, item, (data) => { parseLoaderResponse(storage2, item.icons, data); }); }); }); } } const loadIcons = (icons, callback) => { const cleanedIcons = listToIcons(icons, true, allowSimpleNames()); const sortedIcons = sortIcons(cleanedIcons); if (!sortedIcons.pending.length) { let callCallback = true; if (callback) setTimeout(() => { if (callCallback) callback(sortedIcons.loaded, sortedIcons.missing, sortedIcons.pending, emptyCallback); }); return () => { callCallback = false; }; } const newIcons = Object.create(null); const sources = []; let lastProvider, lastPrefix; sortedIcons.pending.forEach((icon) => { const { provider, prefix } = icon; if (prefix === lastPrefix && provider === lastProvider) return; lastProvider = provider; lastPrefix = prefix; sources.push(getStorage(provider, prefix)); const providerNewIcons = newIcons[provider] || (newIcons[provider] = Object.create(null)); if (!providerNewIcons[prefix]) providerNewIcons[prefix] = []; }); sortedIcons.pending.forEach((icon) => { const { provider, prefix, name } = icon; const storage2 = getStorage(provider, prefix); const pendingQueue = storage2.pendingIcons || (storage2.pendingIcons = new Set()); if (!pendingQueue.has(name)) { pendingQueue.add(name); newIcons[provider][prefix].push(name); } }); sources.forEach((storage2) => { const list = newIcons[storage2.provider][storage2.prefix]; if (list.length) loadNewIcons(storage2, list); }); return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback; }; function mergeCustomisations(defaults, item) { const result = { ...defaults }; for (const key in item) { const value = item[key]; const valueType = typeof value; if (key in defaultIconSizeCustomisations) { if (value === null || value && (valueType === "string" || valueType === "number")) result[key] = value; } else if (valueType === typeof result[key]) result[key] = key === "rotate" ? value % 4 : value; } return result; } const separator = /[\s,]+/; function flipFromString(custom, flip2) { flip2.split(separator).forEach((str2) => { switch (str2.trim()) { case "horizontal": custom.hFlip = true; break; case "vertical": custom.vFlip = true; } }); } function rotateFromString(value, defaultValue = 0) { const units = value.replace(/^-?[0-9.]*/, ""); function cleanup(value2) { while (value2 < 0) value2 += 4; return value2 % 4; } if (units === "") { const num2 = parseInt(value); return isNaN(num2) ? 0 : cleanup(num2); } else if (units !== value) { let split = 0; switch (units) { case "%": split = 25; break; case "deg": split = 90; } if (split) { let num2 = parseFloat(value.slice(0, value.length - units.length)); if (isNaN(num2)) return 0; num2 = num2 / split; return num2 % 1 === 0 ? cleanup(num2) : 0; } } return defaultValue; } function iconToHTML(body, attributes) { let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"'; for (const attr in attributes) renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"'; return '" + body + ""; } function encodeSVGforURL(svg) { return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(//g, "%3E").replace(/\s+/g, " ").replace(/:/g, "%3A").replace(/\//g, "%2F"); } function svgToData(svg) { return "data:image/svg+xml," + encodeSVGforURL(svg); } function svgToURL(svg) { return 'url("' + svgToData(svg) + '")'; } const defaultExtendedIconCustomisations = { ...defaultIconCustomisations, inline: false }; const svgDefaults = { "xmlns": "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", "aria-hidden": true, "role": "img" }; const commonProps = { display: "inline-block" }; const monotoneProps = { backgroundColor: "currentColor" }; const coloredProps = { backgroundColor: "transparent" }; const propsToAdd = { Image: "var(--svg)", Repeat: "no-repeat", Size: "100% 100%" }; const propsToAddTo = { webkitMask: monotoneProps, mask: monotoneProps, background: coloredProps }; for (const prefix in propsToAddTo) { const list = propsToAddTo[prefix]; for (const prop in propsToAdd) { list[prefix + prop] = propsToAdd[prop]; } } const customisationAliases = {}; ["horizontal", "vertical"].forEach((prefix) => { const attr = prefix.slice(0, 1) + "Flip"; customisationAliases[prefix + "-flip"] = attr; customisationAliases[prefix.slice(0, 1) + "-flip"] = attr; customisationAliases[prefix + "Flip"] = attr; }); function fixSize(value) { return value + (value.match(/^[-0-9.]+$/) ? "px" : ""); } const render = (icon, props) => { const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props); const componentProps = { ...svgDefaults }; const mode = props.mode || "svg"; const style = {}; const propsStyle = props.style; const customStyle = typeof propsStyle === "object" && !(propsStyle instanceof Array) ? propsStyle : {}; for (let key in props) { const value = props[key]; if (value === void 0) { continue; } switch (key) { case "icon": case "style": case "onLoad": case "mode": case "ssr": case "customise": break; case "inline": case "hFlip": case "vFlip": customisations[key] = value === true || value === "true" || value === 1; break; case "flip": break; case "color": style.color = value; break; case "rotate": if (typeof value === "string") { customisations[key] = rotateFromString(value); } else if (typeof value === "number") { customisations[key] = value; } break; case "ariaHidden": case "aria-hidden": if (value !== true && value !== "true") { delete componentProps["aria-hidden"]; } break; default: { const alias = customisationAliases[key]; if (alias) { if (value === true || value === "true" || value === 1) { customisations[alias] = true; } } else if (defaultExtendedIconCustomisations[key] === void 0) { componentProps[key] = value; } } } } if (typeof props.flip === "string") { flipFromString(customisations, props.flip); } const item = iconToSVG(icon, customisations); const renderAttribs = item.attributes; if (customisations.inline) { style.verticalAlign = "-0.125em"; } if (mode === "svg") { componentProps.style = { ...style, ...customStyle }; Object.assign(componentProps, renderAttribs); componentProps["innerHTML"] = replaceIDs(item.body); return vue.h("svg", componentProps); } const { body, width, height } = icon; const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1); const html = iconToHTML(body, { ...renderAttribs, width: width + "", height: height + "" }); componentProps.style = { ...style, "--svg": svgToURL(html), "width": fixSize(renderAttribs.width), "height": fixSize(renderAttribs.height), ...commonProps, ...useMask ? monotoneProps : coloredProps, ...customStyle }; return vue.h("span", componentProps); }; allowSimpleNames(true); setAPIModule("", fetchAPIModule); if (typeof document !== "undefined" && typeof window !== "undefined") { const _window = window; if (_window.IconifyPreload !== void 0) { const preload2 = _window.IconifyPreload; const err = "Invalid IconifyPreload syntax."; if (typeof preload2 === "object" && preload2 !== null) { (preload2 instanceof Array ? preload2 : [preload2]).forEach((item) => { try { if ( typeof item !== "object" || item === null || item instanceof Array || typeof item.icons !== "object" || typeof item.prefix !== "string" || !addCollection(item) ) { console.error(err); } } catch (e) { console.error(err); } }); } } if (_window.IconifyProviders !== void 0) { const providers = _window.IconifyProviders; if (typeof providers === "object" && providers !== null) { for (let key in providers) { const err = "IconifyProviders[" + key + "] is invalid."; try { const value = providers[key]; if (typeof value !== "object" || !value || value.resources === void 0) { continue; } if (!addAPIProvider(key, value)) { console.error(err); } } catch (e) { console.error(err); } } } } } const emptyIcon = { ...defaultIconProps, body: "" }; const Icon = vue.defineComponent((props, { emit: emit2 }) => { const loader = vue.ref(null); function abortLoading() { var _a2, _b; if (loader.value) { (_b = (_a2 = loader.value).abort) == null ? void 0 : _b.call(_a2); loader.value = null; } } const rendering = vue.ref(!!props.ssr); const lastRenderedIconName = vue.ref(""); const iconData = vue.shallowRef(null); function getIcon() { const icon = props.icon; if (typeof icon === "object" && icon !== null && typeof icon.body === "string") { lastRenderedIconName.value = ""; return { data: icon }; } let iconName; if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) { return null; } let data = getIconData(iconName); if (!data) { const oldState = loader.value; if (!oldState || oldState.name !== icon) { if (data === null) { loader.value = { name: icon }; } else { loader.value = { name: icon, abort: loadIcons([iconName], updateIconData) }; } } return null; } abortLoading(); if (lastRenderedIconName.value !== icon) { lastRenderedIconName.value = icon; vue.nextTick(() => { emit2("load", icon); }); } const customise = props.customise; if (customise) { data = Object.assign({}, data); const customised = customise(data.body, iconName.name, iconName.prefix, iconName.provider); if (typeof customised === "string") { data.body = customised; } } const classes = ["iconify"]; if (iconName.prefix !== "") { classes.push("iconify--" + iconName.prefix); } if (iconName.provider !== "") { classes.push("iconify--" + iconName.provider); } return { data, classes }; } function updateIconData() { var _a2; const icon = getIcon(); if (!icon) { iconData.value = null; } else if (icon.data !== ((_a2 = iconData.value) == null ? void 0 : _a2.data)) { iconData.value = icon; } } if (rendering.value) { updateIconData(); } else { vue.onMounted(() => { rendering.value = true; updateIconData(); }); } vue.watch(() => props.icon, updateIconData); vue.onUnmounted(abortLoading); return () => { const icon = iconData.value; if (!icon) { return render(emptyIcon, props); } let newProps = props; if (icon.classes) { newProps = { ...props, class: icon.classes.join(" ") }; } return render({ ...defaultIconProps, ...icon.data }, newProps); }; }, { props: { icon: { type: [String, Object], required: true }, mode: { type: String }, ssr: { type: Boolean }, width: { type: [String, Number] }, height: { type: [String, Number] }, style: { type: [String, Object] }, color: { type: String }, inline: { type: Boolean }, rotate: { type: [Number, String] }, hFlip: { type: Boolean }, horizontalFlip: { type: Boolean }, vFlip: { type: Boolean }, verticalFlip: { type: Boolean }, flip: { type: String }, id: { type: String }, ariaHidden: { type: [Boolean, String], default: void 0 }, customise: { type: Function }, title: { type: String } }, emits: ["load"] }); let _initialized = false; function init(addIcon2) { if (_initialized) return; const collections = JSON.parse('[{"prefix":"lucide","icons":{"arrow-down":{"width":24,"height":24,"body":""},"arrow-left":{"width":24,"height":24,"body":""},"arrow-right":{"width":24,"height":24,"body":""},"arrow-up":{"width":24,"height":24,"body":""},"arrow-up-right":{"width":24,"height":24,"body":""},"bot":{"width":24,"height":24,"body":""},"check":{"width":24,"height":24,"body":""},"chevron-down":{"width":24,"height":24,"body":""},"chevron-left":{"width":24,"height":24,"body":""},"chevron-right":{"width":24,"height":24,"body":""},"chevron-up":{"width":24,"height":24,"body":""},"chevrons-left":{"width":24,"height":24,"body":""},"chevrons-right":{"width":24,"height":24,"body":""},"circle-alert":{"width":24,"height":24,"body":""},"circle-check":{"width":24,"height":24,"body":""},"circle-x":{"width":24,"height":24,"body":""},"copy":{"width":24,"height":24,"body":""},"copy-check":{"width":24,"height":24,"body":""},"download":{"width":24,"height":24,"body":""},"ellipsis":{"width":24,"height":24,"body":""},"eye":{"width":24,"height":24,"body":""},"eye-off":{"width":24,"height":24,"body":""},"file":{"width":24,"height":24,"body":""},"file-text":{"width":24,"height":24,"body":""},"files":{"width":24,"height":24,"body":""},"folder":{"width":24,"height":24,"body":""},"folder-open":{"width":24,"height":24,"body":""},"grid-2x2":{"width":24,"height":24,"body":""},"grip-vertical":{"width":24,"height":24,"body":""},"hash":{"width":24,"height":24,"body":""},"image":{"width":24,"height":24,"body":""},"info":{"width":24,"height":24,"body":""},"lightbulb":{"width":24,"height":24,"body":""},"loader":{"width":24,"height":24,"body":""},"loader-circle":{"width":24,"height":24,"body":""},"lock":{"width":24,"height":24,"body":""},"menu":{"width":24,"height":24,"body":""},"message-circle":{"width":24,"height":24,"body":""},"minus":{"width":24,"height":24,"body":""},"monitor":{"width":24,"height":24,"body":""},"moon":{"width":24,"height":24,"body":""},"panel-left-close":{"width":24,"height":24,"body":""},"panel-left-open":{"width":24,"height":24,"body":""},"paperclip":{"width":24,"height":24,"body":""},"plus":{"width":24,"height":24,"body":""},"printer":{"width":24,"height":24,"body":""},"qr-code":{"width":24,"height":24,"body":""},"refresh-cw":{"width":24,"height":24,"body":""},"rotate-ccw":{"width":24,"height":24,"body":""},"rotate-cw":{"width":24,"height":24,"body":""},"search":{"width":24,"height":24,"body":""},"send":{"width":24,"height":24,"body":""},"settings":{"width":24,"height":24,"body":""},"smartphone":{"width":24,"height":24,"body":""},"square":{"width":24,"height":24,"body":""},"star":{"width":24,"height":24,"body":""},"sun":{"width":24,"height":24,"body":""},"trash":{"width":24,"height":24,"body":""},"triangle-alert":{"width":24,"height":24,"body":""},"upload":{"width":24,"height":24,"body":""},"volume-2":{"width":24,"height":24,"body":""},"volume-x":{"width":24,"height":24,"body":""},"x":{"width":24,"height":24,"body":""},"zoom-in":{"width":24,"height":24,"body":""},"zoom-out":{"width":24,"height":24,"body":""}}}]'); for (const collection of collections) { for (const [name, data] of Object.entries(collection.icons)) { addIcon2(collection.prefix ? collection.prefix + ":" + name : name, data); } } _initialized = true; } const D_58_47_25991_26723_47GitHub_47znhd_45service_47node_modules_47_64nuxt_47ui_47dist_47runtime_47vue_47plugins_47icons_46js = { install() { init((name, data) => { const colon = name.indexOf(":"); if (colon !== -1 && name.slice(0, colon).includes("-")) { addIcon(name.replace(":", "-"), data); } return addIcon(name, data); }); } }; function registerPlugin(head, p) { var _a2; if (typeof p === "function" && p.key && head.plugins.has(p.key)) return; const plugin = typeof p === "function" ? p(head) : p; const key = plugin.key || String(head.plugins.size + 1); if (!head.plugins.get(key)) { head.plugins.set(key, plugin); for (const k in plugin.hooks || {}) (_a2 = head.hooks) == null ? void 0 : _a2.hook(k, plugin.hooks[k]); } } function createUnhead(renderer, resolvedOptions = {}) { var _a2; const ssr = !resolvedOptions.document; const entries = new Map(); const plugins = new Map(); const head = { _entryCount: 1, _h: 0, plugins, resolvedOptions, ssr, entries, hooks: void 0, render: () => renderer(head), use: (p) => registerPlugin(head, p), push(input, _options) { var _a3; const _i = (_a3 = _options == null ? void 0 : _options._index) != null ? _a3 : head._entryCount++; const options = _options ? { ..._options } : {}; delete options.head; delete options.onRendered; delete options._index; const entry = { _i, input, options }; entries.set(_i, entry); const active = { _i, dispose() { entries.delete(_i); }, patch(input2) { if (ssr) { entry.input = input2; delete entry._tags; } else { entry._pending = input2; } if (!entries.has(_i)) entries.set(_i, entry); } }; return active; } }; (_a2 = resolvedOptions.init) == null ? void 0 : _a2.forEach((e) => e && head.push(e)); return head; } const DupeableTags = new Set(["link", "style", "script", "noscript"]); const TagsWithInnerContent = new Set(["title", "titleTemplate", "script", "style", "noscript"]); const HasElementTags = new Set(["base", "meta", "link", "style", "script", "noscript"]); const ValidHeadTags = new Set(["title", "base", "htmlAttrs", "bodyAttrs", "meta", "link", "style", "script", "noscript"]); const UniqueTags = new Set(["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"]); const TagConfigKeys = new Set(["key", "tagPosition", "tagPriority", "tagDuplicateStrategy", "innerHTML", "textContent", "processTemplateParams"]); const UsesMergeStrategy = new Set(["templateParams", "htmlAttrs", "bodyAttrs"]); const MetaTagsArrayable = new Set([ "theme-color", "google-site-verification", "author", "og:locale:alternate", "og:image", "og:video", "og:audio", "article:author", "article:tag", "book:author", "book:tag", "twitter:image" ]); const TagPriorityAliases = { critical: -8, high: -1, low: 2 }; const hasContent = (value) => typeof value === "number" ? Number.isFinite(value) : value; function isUnsafeKey(key) { return key === "__proto__" || key === "constructor" || key === "prototype"; } function flatHooks(configHooks, hooks2 = {}, parentName) { for (const key in configHooks) { const subHook = configHooks[key]; const name = parentName ? `${parentName}:${key}` : key; if (typeof subHook === "object" && subHook !== null) flatHooks(subHook, hooks2, name); else if (typeof subHook === "function") hooks2[name] = subHook; } return hooks2; } const createTask = (() => { if (console.createTask) return console.createTask; const defaultTask = { run: (fn) => fn() }; return () => defaultTask; })(); function callHooks(hooks2, args, startIndex, task) { for (let i = startIndex; i < hooks2.length; i += 1) try { const result = task ? task.run(() => hooks2[i](...args)) : hooks2[i](...args); if (result && typeof result.then === "function") return Promise.resolve(result).then(() => callHooks(hooks2, args, i + 1, task)); } catch (error) { return Promise.reject(error); } } function serialTaskCaller(hooks2, args, name) { if (hooks2.length > 0) return callHooks(hooks2, args, 0, createTask(name)); } function parallelTaskCaller(hooks2, args, name) { if (hooks2.length > 0) { const task = createTask(name); return Promise.all(hooks2.map((hook) => task.run(() => hook(...args)))); } } function callEachWith(callbacks, arg0) { for (const callback of [...callbacks]) callback(arg0); } var Hookable = class { constructor() { __publicField(this, "_hooks"); __publicField(this, "_before"); __publicField(this, "_after"); __publicField(this, "_deprecatedHooks"); __publicField(this, "_deprecatedMessages"); this._hooks = {}; this._before = void 0; this._after = void 0; this._deprecatedMessages = void 0; this._deprecatedHooks = {}; this.hook = this.hook.bind(this); this.callHook = this.callHook.bind(this); this.callHookWith = this.callHookWith.bind(this); } hook(name, function_, options = {}) { if (!name || typeof function_ !== "function") return () => { }; const originalName = name; let dep; while (this._deprecatedHooks[name]) { dep = this._deprecatedHooks[name]; name = dep.to; } if (dep && !options.allowDeprecated) { let message = dep.message; if (!message) message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : ""); if (!this._deprecatedMessages) this._deprecatedMessages = new Set(); if (!this._deprecatedMessages.has(message)) { console.warn(message); this._deprecatedMessages.add(message); } } if (!function_.name) try { Object.defineProperty(function_, "name", { get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb", configurable: true }); } catch { } this._hooks[name] = this._hooks[name] || []; this._hooks[name].push(function_); return () => { if (function_) { this.removeHook(name, function_); function_ = void 0; } }; } hookOnce(name, function_) { let _unreg; let _function = (...arguments_) => { if (typeof _unreg === "function") _unreg(); _unreg = void 0; _function = void 0; return function_(...arguments_); }; _unreg = this.hook(name, _function); return _unreg; } removeHook(name, function_) { const hooks2 = this._hooks[name]; if (hooks2) { const index = hooks2.indexOf(function_); if (index !== -1) hooks2.splice(index, 1); if (hooks2.length === 0) this._hooks[name] = void 0; } } clearHook(name) { this._hooks[name] = void 0; } deprecateHook(name, deprecated) { this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated; const _hooks = this._hooks[name] || []; this._hooks[name] = void 0; for (const hook of _hooks) this.hook(name, hook); } deprecateHooks(deprecatedHooks) { for (const name in deprecatedHooks) this.deprecateHook(name, deprecatedHooks[name]); } addHooks(configHooks) { const hooks2 = flatHooks(configHooks); const removeFns = Object.keys(hooks2).map((key) => this.hook(key, hooks2[key])); return () => { for (const unreg of removeFns) unreg(); removeFns.length = 0; }; } removeHooks(configHooks) { const hooks2 = flatHooks(configHooks); for (const key in hooks2) this.removeHook(key, hooks2[key]); } removeAllHooks() { this._hooks = {}; } callHook(name, ...args) { return this.callHookWith(serialTaskCaller, name, args); } callHookParallel(name, ...args) { return this.callHookWith(parallelTaskCaller, name, args); } callHookWith(caller, name, args) { const event = this._before || this._after ? { name, args, context: {} } : void 0; if (this._before) callEachWith(this._before, event); const result = caller(this._hooks[name] ? [...this._hooks[name]] : [], args, name); if (result instanceof Promise) return result.finally(() => { if (this._after && event) callEachWith(this._after, event); }); if (this._after && event) callEachWith(this._after, event); return result; } beforeEach(function_) { this._before = this._before || []; this._before.push(function_); return () => { if (this._before !== void 0) { const index = this._before.indexOf(function_); if (index !== -1) this._before.splice(index, 1); } }; } afterEach(function_) { this._after = this._after || []; this._after.push(function_); return () => { if (this._after !== void 0) { const index = this._after.indexOf(function_); if (index !== -1) this._after.splice(index, 1); } }; } }; function createHooks$1() { return new Hookable(); } var HookableCore = class { constructor() { __publicField(this, "_hooks"); this._hooks = {}; } hook(name, fn) { if (!name || typeof fn !== "function") return () => { }; this._hooks[name] = this._hooks[name] || []; this._hooks[name].push(fn); return () => { if (fn) { this.removeHook(name, fn); fn = void 0; } }; } removeHook(name, function_) { const hooks2 = this._hooks[name]; if (hooks2) { const index = hooks2.indexOf(function_); if (index !== -1) hooks2.splice(index, 1); if (hooks2.length === 0) this._hooks[name] = void 0; } } callHook(name, ...args) { const hooks2 = this._hooks[name]; if (!hooks2 || hooks2.length === 0) return; return callHooks(hooks2.slice(), args, 0); } }; function createHooks(hooks2) { const instance = new HookableCore(); for (const key in hooks2 || {}) { instance.hook(key, hooks2[key]); } return instance; } function callHook(head, hook, ctx) { var _a2, _b, _c; const hooks2 = (_b = (_a2 = head.hooks) == null ? void 0 : _a2._hooks) == null ? void 0 : _b[hook]; if (!(hooks2 == null ? void 0 : hooks2.length)) return; return (_c = head.hooks) == null ? void 0 : _c.callHook(hook, ctx); } function createClientHeadAdapter(core, hooks2, render2) { const corePush = core.push; const head = core; head.ssr = false; head.hooks = hooks2; head.dirty = !!head.dirty; head.use = (p) => registerPlugin(head, p); head.render = () => render2(head); function notify2() { hooks2.callHook("entries:updated", head); if (!head._b) head.render(); } head.invalidate = () => { for (const entry of head.entries.values()) delete entry._tags; head.dirty = true; notify2(); }; head.push = (input, entryOptions) => { const unhook = (entryOptions == null ? void 0 : entryOptions.onRendered) ? hooks2.hook("dom:rendered", entryOptions.onRendered) : void 0; const active = corePush(input, entryOptions); const entry = core.entries.get(active._i); if (entry) entry._o = input; head.dirty = true; notify2(); return { _i: active._i, patch(input2) { active.patch(input2); head.dirty = true; notify2(); }, dispose() { unhook == null ? void 0 : unhook(); if (core.entries.has(active._i)) { active.dispose(); head.invalidate(); } } }; }; return head; } const META_NOREWRITE_RE = /^(?:viewport|description|keywords|robots)$/; const META_KEY_ATTRS = ["name", "property", "http-equiv"]; function isMetaArrayDupeKey(v) { const i = v.indexOf(":"); if (i === -1) return false; const key = v.slice(i + 1); return MetaTagsArrayable.has(key) || key.startsWith("og:image:") || key.startsWith("og:video:") || key.startsWith("og:audio:") || key.startsWith("twitter:image:"); } function dedupeKey(tag) { const { props, tag: t, key } = tag; if (UniqueTags.has(t)) return t; if (t === "link") { if (props.rel === "canonical") return "canonical"; if (props.rel === "alternate" && props.hreflang) return `alternate:${props.hreflang}`; } if (props.charset) return "charset"; if (t === "meta") { for (const n of META_KEY_ATTRS) { const v = props[n]; if (v !== void 0) return `meta:${v}${(typeof v !== "string" || !v.includes(":")) && !META_NOREWRITE_RE.test(v) && key ? `:key:${key}` : ""}`; } } if (key) return `${t}:key:${key}`; if (props.id) return `${t}:id:${props.id}`; if (t === "link" && props.rel && props.href) return `link:${props.rel}:${props.href}`; return TagsWithInnerContent.has(t) && (tag.textContent || tag.innerHTML) ? `${t}:content:${tag.textContent || tag.innerHTML}` : void 0; } function hashTag(tag) { const identity = tag._h || tag._d || tag.textContent || tag.innerHTML; if (identity) return String(identity); const keys = Object.keys(tag.props).sort(); let hash = `${tag.tag}:`; let separator2 = ""; for (const key of keys) { hash += `${separator2}${key}:${String(tag.props[key])}`; separator2 = ","; } return hash; } function walkResolver(val, resolve, key) { if (key === "_resolver") return val; if (typeof val === "function" && (!key || key !== "titleTemplate" && !key.startsWith("on"))) val = val(); const v = resolve ? resolve(key, val) : val; if (Array.isArray(v)) { let out; for (let i = 0; i < v.length; i++) { const r = walkResolver(v[i], resolve); if (out) { out[i] = r; } else if (r !== v[i]) { out = v.slice(0, i); out[i] = r; } } return out || v; } if ((v == null ? void 0 : v.constructor) === Object) { let next; for (const k in v) { const unsafe = isUnsafeKey(k); const r = unsafe ? void 0 : walkResolver(v[k], resolve, k); if (!next && (unsafe || r !== v[k])) { next = {}; for (const pk in v) { if (pk === k) break; next[pk] = v[pk]; } } if (next && !unsafe) next[k] = r; } return next || v; } return v; } const INVALID_ATTR_NAME_RE = /[\s"'<>/=\x00-\x1F\x7F]/; function normalizeStyleClassProps(key, value) { const isStyle = key === "style"; const store = isStyle ? new Map() : new Set(); const add = (v) => { if (!v) return; if (isStyle) { const i = v.indexOf(":"); i > 0 && store.set(v.slice(0, i).trim(), v.slice(i + 1).trim()); } else { v.split(" ").forEach((c) => c && store.add(c)); } }; if (typeof value === "string") { (isStyle ? value.split(";") : [value]).forEach(add); } else if (Array.isArray(value)) { value.forEach(add); } else if (value && typeof value === "object") { for (const k in value) { const v = value[k]; v && v !== "false" && (isStyle ? store.set(k.trim(), String(v)) : add(k)); } } return store; } function normalizeProps(tag, input) { tag.props = tag.props || {}; if (!input) return tag; if (tag.tag === "templateParams") { tag.props = input; return tag; } const isHtmlTag = HasElementTags.has(tag.tag) || tag.tag === "htmlAttrs" || tag.tag === "bodyAttrs"; for (const prop in input) { if ( isUnsafeKey(prop)) continue; const isData = prop.startsWith("data-"); const isHtmlAttr = isHtmlTag && !TagConfigKeys.has(prop); const key = isHtmlAttr && !isData ? prop.toLowerCase() : prop; if (isHtmlAttr && (!key || INVALID_ATTR_NAME_RE.test(key))) continue; const value = input[prop]; if (value === null) { tag.props[key] = null; } else if (prop === "class" || prop === "style") { tag.props[prop] = normalizeStyleClassProps(prop, value); } else if (TagConfigKeys.has(prop)) { if ((prop === "textContent" || prop === "innerHTML") && typeof value === "object") { const type = input.type || "application/json"; if (type.endsWith("json") || type === "speculationrules" || type === "importmap") { tag.props.type = type; tag[prop] = JSON.stringify(value); } } else { tag[prop] = value; } } else if (value !== void 0) { const str2 = String(value); const isMeta = tag.tag === "meta" && key === "content"; tag.props[key] = str2 === "true" || str2 === "" ? isData || isMeta ? str2 : true : !value && isData && str2 === "false" ? "false" : value; } } return tag; } function resolveHeadInput(input, propResolvers) { let resolve; if (propResolvers.length) { resolve = (key, val) => { for (let i = 0; i < propResolvers.length; i++) val = propResolvers[i](key, val); return val; }; input = resolve(void 0, input); } return walkResolver(input, resolve); } function normalizeTag(tagName, _input) { const input = typeof _input === "object" && typeof _input !== "function" ? _input : { [tagName === "script" || tagName === "noscript" || tagName === "style" ? "innerHTML" : "textContent"]: _input }; const tag = normalizeProps({ tag: tagName, props: {} }, input); if (tag.key && DupeableTags.has(tag.tag)) tag.props["data-hid"] = tag._h = tag.key; if (tag.tag === "script" && typeof tag.innerHTML === "object") { tag.innerHTML = JSON.stringify(tag.innerHTML); tag.props.type = tag.props.type || "application/json"; } if (Array.isArray(tag.props.content)) { const tags = []; for (const content of tag.props.content) { tags.push({ ...tag, props: { ...tag.props, content } }); } return tags; } return tag; } function pushNormalizedTag(tags, tag) { if (Array.isArray(tag)) { for (const t of tag) tags.push(t); } else { tags.push(tag); } } function normalizeEntryToTags(input, propResolvers) { if (!input) return []; if (typeof input === "function") input = input(); input = resolveHeadInput(input, propResolvers); const tags = []; for (const key in input) { const value = input[key]; if (value !== void 0) { if (Array.isArray(value)) { for (const v of value) pushNormalizedTag(tags, normalizeTag(key, v)); } else { pushNormalizedTag(tags, normalizeTag(key, value)); } } } return tags; } const LT_RE = / a._w === b._w ? a._p - b._p : a._w - b._w; const DEFAULT_TAG_WEIGHT = () => 100; function isEmptyProps(props) { for (const _2 in props) return false; return true; } const TAG_MUTATING_HOOK_RE = /^tags:|:render/; function syncEntryHookCache(head, hooks2) { var _a2, _b; const count2 = (((_a2 = hooks2["entries:resolve"]) == null ? void 0 : _a2.length) || 0) + (((_b = hooks2["entries:normalize"]) == null ? void 0 : _b.length) || 0); if (head._h !== count2) { head._h = count2; for (const entry of head.entries.values()) delete entry._tags; } } function cloneTagsInPlace(tags) { for (let i = 0; i < tags.length; i++) { const t = tags[i]; const props = { ...t.props }; if (props.class instanceof Set) props.class = new Set(props.class); if (props.style instanceof Map) props.style = new Map(props.style); tags[i] = { ...t, props }; } } function valuesToTags(ctx, sortFlatMeta) { const tags = ctx.tags; let w = 0; for (const value of ctx.tagMap.values()) { if (Array.isArray(value)) { for (const tag of value) tags[w++] = tag; } else { tags[w++] = value; } } tags.length = w; if (sortFlatMeta) tags.sort(sortTags); } function dedupeTags(ctx) { let hasFlatMeta = false; for (const next of ctx.tags.sort(sortTags)) { const k = next._d || hashTag(next); if (!k) continue; const prev = ctx.tagMap.get(k); if (!prev) { ctx.tagMap.set(k, next); continue; } const strategy = next.tagDuplicateStrategy || (UsesMergeStrategy.has(next.tag) ? "merge" : null) || (next.key && next.key === prev.key ? "merge" : null); if (strategy === "merge") { const props = { ...prev.props }; for (const p in next.props) { props[p] = p === "style" ? new Map([...prev.props.style || new Map(), ...next.props[p]]) : p === "class" ? new Set([...prev.props.class || [], ...next.props[p]]) : next.props[p]; } ctx.tagMap.set(k, { ...next, props }); } else if (next._p >> 10 === prev._p >> 10 && next.tag === "meta" && isMetaArrayDupeKey(k)) { ctx.tagMap.set(k, Object.assign([...Array.isArray(prev) ? prev : [prev], next], next)); hasFlatMeta = true; } else if (next._w === prev._w ? next._p > prev._p : next._w < prev._w) { ctx.tagMap.set(k, next); } } return hasFlatMeta; } function resolveTitleTemplate(ctx, head) { const title = ctx.tagMap.get("title"); const tpl = ctx.tagMap.get("titleTemplate"); head._title = title == null ? void 0 : title.textContent; if (!tpl) return; const fn = tpl.textContent; head._titleTemplate = fn; if (!fn) return; let v = typeof fn === "function" ? fn(title == null ? void 0 : title.textContent) : fn; if (typeof v === "string" && !head.plugins.has("template-params")) v = v.replace("%s", (title == null ? void 0 : title.textContent) || ""); if (title) { v === null ? ctx.tagMap.delete("title") : ctx.tagMap.set("title", { ...title, textContent: v }); } else { ctx.tagMap.set("titleTemplate", { ...tpl, tag: "title", textContent: v }); } } function sanitizeTagsInPlace(tags) { let w = 0; for (let t of tags) { const { innerHTML, tag, props } = t; if (!ValidHeadTags.has(tag) || isEmptyProps(props) && !hasContent(innerHTML) && !hasContent(t.textContent)) continue; if (tag === "meta") { if (!hasContent(props.content) && !props["http-equiv"] && !props.charset) continue; } if (tag === "script" && (innerHTML || t.textContent)) { const type = String(props.type); const isJsonLike = type.endsWith("json") || type === "importmap" || type === "speculationrules"; const escape = (content) => isJsonLike ? (typeof content === "string" ? content : JSON.stringify(content)).replace(LT_RE, "\\u003C") : typeof content === "string" ? content.replace(SCRIPT_END_RE, "<\\/script") : content; t = { ...t }; if (innerHTML) t.innerHTML = escape(innerHTML); if (t.textContent) t.textContent = escape(t.textContent); t._d = dedupeKey(t); } tags[w++] = t; } tags.length = w; return tags; } function resolveTags(head, options) { var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j; const weightFn = (_b = (_a2 = options == null ? void 0 : options.tagWeight) != null ? _a2 : head.resolvedOptions._tagWeight) != null ? _b : DEFAULT_TAG_WEIGHT; const ctx = { tagMap: new Map(), tags: [] }; const hooks2 = ((_c = head.hooks) == null ? void 0 : _c._hooks) || {}; syncEntryHookCache(head, hooks2); for (const e of head.entries.values()) { if (e._pending !== void 0) { e.input = e._pending; delete e._pending; delete e._tags; delete e._precomputedTags; } } let entries; if (((_d = hooks2["entries:resolve"]) == null ? void 0 : _d.length) || ((_e2 = hooks2["entries:normalize"]) == null ? void 0 : _e2.length)) { entries = [...head.entries.values()]; if ((_f = hooks2["entries:resolve"]) == null ? void 0 : _f.length) callHook(head, "entries:resolve", { entries, ...ctx }); } syncEntryHookCache(head, hooks2); for (const e of entries || head.entries.values()) { let tags = e._tags; if (!tags) { if (e._precomputedTags && weightFn === head.resolvedOptions._tagWeight && !((_g = hooks2["entries:normalize"]) == null ? void 0 : _g.length) && !((_h = hooks2["entries:resolve"]) == null ? void 0 : _h.length) && (!e.options || isEmptyProps(e.options))) { tags = e._precomputedTags; } else { tags = normalizeEntryToTags(e.input, head.resolvedOptions.propResolvers || []); if (e.options && !isEmptyProps(e.options)) { for (const t of tags) Object.assign(t, e.options); } if ((_i = hooks2["entries:normalize"]) == null ? void 0 : _i.length) { const normalizeCtx = { tags, entry: e }; callHook(head, "entries:normalize", normalizeCtx); tags = normalizeCtx.tags; } for (let i = 0; i < tags.length; i++) { const t = tags[i]; t._w = weightFn(t); t._p = (e._i << 10) + i; t._d = dedupeKey(t); if (!t._d) t._h = hashTag(t); } e._tags = tags; } } ctx.tags.push(...tags); } for (const name in hooks2) { if (((_j = hooks2[name]) == null ? void 0 : _j.length) && TAG_MUTATING_HOOK_RE.test(name)) { cloneTagsInPlace(ctx.tags); break; } } const hasFlatMeta = dedupeTags(ctx); resolveTitleTemplate(ctx, head); valuesToTags(ctx, hasFlatMeta); callHook(head, "tags:beforeResolve", ctx); callHook(head, "tags:resolve", ctx); callHook(head, "tags:afterResolve", ctx); return sanitizeTagsInPlace(ctx.tags); } const WHITESPACE_RE = /\s+/; function createDomRenderer(options = {}) { return (head) => _renderDOMHead(head, options); } function hasPendingEntries(head) { for (const entry of head.entries.values()) { if (entry._pending !== void 0) return true; } return false; } function createDomState(head, dom) { var _a2; const state2 = { _d: dom, _t: dom.title, _e: new Map([["htmlAttrs", dom.documentElement], ["bodyAttrs", dom.body]]), _p: {}, _s: {}, _l: new Map() }; for (const entry of head.entries.values()) { if (entry._o !== void 0) { const orig = entry._o; for (const t of ["bodyAttrs", "htmlAttrs"]) { const cls = (_a2 = orig[t]) == null ? void 0 : _a2.class; if (typeof cls === "string") { const $el = state2._e.get(t); for (const c of cls.split(WHITESPACE_RE)) { if (c) state2._p[`${t}:attr:class:${c}`] = () => $el.classList.remove(c); } } } } } return state2; } function _renderDOMHead(head, options = {}) { var _a2, _b; const dom = options.document || head.resolvedOptions.document; const activeState = head._dom; if (!dom || head._du || activeState && activeState._d === dom && !head.dirty && !hasPendingEntries(head)) return false; const defaultView = dom.defaultView; head._du = true; let didRender = false; try { let track = function(key, fn, fresh) { renderState._s[key] = !fresh && previous[key] || fn; delete previous[key]; }, trackEvent = function(id, k, ev, source, $el, target) { const key = `${id}:event:${k}`; const prev = renderState._l.get(key); if (prev && prev[0] === target && prev[1] === ev && prev[2] === source) { track(key, prev[4]); return; } prev == null ? void 0 : prev[4](); const dk = `data-${k}`; const handler = ((e) => source.call($el, e)); const cleanup = () => { var _a3; target.removeEventListener(ev, handler); if ($el.getAttribute(dk) === "") $el.removeAttribute(dk); if (((_a3 = renderState._l.get(key)) == null ? void 0 : _a3[3]) === handler) renderState._l.delete(key); }; target.addEventListener(ev, handler); renderState._l.set(key, [target, ev, source, handler, cleanup]); $el.setAttribute(dk, ""); track(key, cleanup, true); }, trackCtx = function({ id, $el, tag }) { var _a3; renderState._e.set(id, $el); if (!tag.tag.endsWith("Attrs")) { const text = tag.textContent; if (text != null && text !== "") { if (text !== $el.textContent) $el.textContent = text; track(`${id}:text`, () => { if ($el.textContent === text) $el.textContent = ""; }, true); } const html = tag.innerHTML; if (html != null && html !== "") { if (html !== $el.innerHTML) $el.innerHTML = html; track(`${id}:html`, () => { if ($el.innerHTML === html) $el.innerHTML = ""; }, true); } const elKey = `${id}:el`; track(elKey, previous[elKey] || (() => { $el == null ? void 0 : $el.remove(); renderState._e.delete(id); })); } for (const k in tag.props) { const v = tag.props[k]; if (k[0] === "o" && k[1] === "n" && typeof v === "function") { const ev = k.slice(2); if ((_a3 = $el == null ? void 0 : $el.dataset) == null ? void 0 : _a3[`${k}fired`]) v.call($el, new ((defaultView == null ? void 0 : defaultView.Event) || Event)(ev)); trackEvent(id, k, ev, v, $el, tag.tag === "bodyAttrs" && defaultView ? defaultView : $el); continue; } const ck = `${id}:attr:${k}`; if (k === "class" && v) { for (const c of v) { const key = `${ck}:${c}`; track(key, previous[key] || (() => $el.classList.remove(c))); if (!$el.classList.contains(c)) $el.classList.add(c); } } else if (k === "style" && v) { for (const [sk, sv] of v) { const key = `${ck}:${sk}`; track(key, previous[key] || (() => $el.style.removeProperty(sk))); $el.style.setProperty(sk, sv); } } else if (v !== false && v !== null) { if ($el.getAttribute(k) !== v) $el.setAttribute(k, v === true ? "" : String(v)); track(ck, previous[ck] || (() => $el.removeAttribute(k))); } } }; const beforeRenderCtx = { shouldRender: true, tags: [] }; callHook(head, "dom:beforeRender", beforeRenderCtx); if (!beforeRenderCtx.shouldRender) return false; let state2 = activeState; if ((state2 == null ? void 0 : state2._d) !== dom) { if (state2) { for (const k in state2._s) state2._s[k](); for (const k in state2._p) state2._p[k](); state2._s = state2._p = {}; state2._e.clear(); state2._l.clear(); } state2 = void 0; } if (!state2) { state2 = createDomState(head, dom); } else { state2._p = state2._s; } state2._s = {}; const renderState = state2; const previous = renderState._p; const pending2 = []; const frag = {}; head.dirty = false; const rawTags = resolveTags(head, options.tagWeight ? { tagWeight: options.tagWeight } : void 0); const tags = []; const dupeKeyCounter = {}; for (const tag of rawTags) { const count2 = dupeKeyCounter[tag._d] || 0; const id = (count2 ? `${tag._d}:${count2}` : tag._d) || tag._h; const ctx = { tag, id, shouldRender: true }; if (tag.tag === "meta" && tag._d && isMetaArrayDupeKey(tag._d)) dupeKeyCounter[tag._d] = count2 + 1; tags.push(ctx); if (tag.tag === "title") { dom.title = tag.textContent; track("title:", () => dom.title = renderState._t); continue; } ctx.$el = renderState._e.get(id); if (ctx.$el) trackCtx(ctx); else if (HasElementTags.has(tag.tag)) pending2.push(ctx); } if (pending2.length) { const tracked = new Set(renderState._e.values()); for (const el of [...dom.body.children, ...dom.head.children]) { const elTag = el.tagName.toLowerCase(); if (!HasElementTags.has(elTag) || tracked.has(el)) continue; const props = { innerHTML: el.innerHTML }; for (const n of el.getAttributeNames()) props[n] = el.getAttribute(n); const next = normalizeProps({ tag: elTag, props: {} }, props); next.key = el.getAttribute("data-hid") || void 0; const dedupe = dedupeKey(next) || hashTag(next); let k = dedupe; let c = 1; while (renderState._e.has(k)) k = `${dedupe}:${c++}`; renderState._e.set(k, el); } } for (const ctx of pending2) { const found = renderState._e.get(ctx.id); ctx.$el = found || dom.createElement(ctx.tag.tag); trackCtx(ctx); if (!found) ((_b = frag[_a2 = ctx.tag.tagPosition || "head"]) != null ? _b : frag[_a2] = dom.createDocumentFragment()).appendChild(ctx.$el); } if (frag.head) dom.head.appendChild(frag.head); if (frag.bodyOpen) dom.body.insertBefore(frag.bodyOpen, dom.body.firstChild); if (frag.bodyClose) dom.body.appendChild(frag.bodyClose); for (const k in previous) previous[k](); head._dom = renderState; didRender = true; callHook(head, "dom:rendered", { renders: tags }); } catch (e) { head.dirty = true; throw e; } finally { head._du = false; } if (didRender && (head.dirty || hasPendingEntries(head))) _renderDOMHead(head, options); return didRender; } const tagWeight = (tag) => typeof tag.tagPriority === "number" ? tag.tagPriority : 100 + (TagPriorityAliases[tag.tagPriority] || 0); function createHead$1(options = {}) { var _a2, _b; options.document = options.document || (typeof window !== "undefined" ? document : void 0); const renderer = options.render || createDomRenderer({ document: options.document }); const core = createUnhead(renderer, { document: options.document, propResolvers: options.propResolvers, _tagWeight: tagWeight, init: [] }); const hooks2 = createHooks(options.hooks); const head = createClientHeadAdapter(core, hooks2, renderer); (_a2 = options.plugins) == null ? void 0 : _a2.forEach((p) => head.use(p)); (_b = options.init) == null ? void 0 : _b.forEach((e) => e && head.push(e)); return head; } const headSymbol = "usehead"; function injectHead() { if (vue.hasInjectionContext()) { const instance = vue.inject(headSymbol); if (instance) return instance; } throw new Error("useHead() was called without provide context, ensure you call it through the setup() function."); } function vueInstall(head) { const plugin = { install(app2) { app2.config.globalProperties.$unhead = head; app2.config.globalProperties.$head = head; app2.provide(headSymbol, head); } }; return plugin.install; } const VueResolver = Object.assign( (_2, value) => vue.isRef(value) ? vue.toValue(value) : value, { _static: true } ); function useHead(input, options = {}) { const head = options.head || injectHead(); return head.ssr ? head.push(input || {}, options) : clientUseHead(head, input, options); } function clientUseHead(head, input, options = {}) { const scope = vue.getCurrentScope(); if (scope && !scope.active) { return { patch() { }, dispose() { }, _i: -1 }; } const deactivated = vue.ref(false); if (options.onRendered && scope) { const _onRendered = options.onRendered; options = { ...options, onRendered: (ctx) => scope.run(() => _onRendered(ctx)) }; } let entry; vue.watchEffect(() => { const i = deactivated.value ? {} : walkResolver(input, VueResolver); if (entry) { entry.patch(i); } else { entry = head.push(i, options); } }); const vm = vue.getCurrentInstance(); if (vm) { vue.onBeforeUnmount(() => { entry.dispose(); }); vue.onDeactivated(() => { deactivated.value = true; }); vue.onActivated(() => { deactivated.value = false; }); } else if (scope) { vue.onScopeDispose(() => entry.dispose()); } return entry; } function createHead(options = {}) { const domRenderer = createDomRenderer(); let head; let renderId = 0; const debouncedRenderer = () => { const id = ++renderId; setTimeout(() => { if (id === renderId) domRenderer(head); }, 0); }; head = createHead$1({ render: debouncedRenderer, ...options }); head.install = vueInstall(head); return head; } const D_58_47_25991_26723_47GitHub_47znhd_45service_47node_modules_47_64nuxt_47ui_47dist_47runtime_47vue_47plugins_47head_46js = { install(app2) { if (app2._context.provides.usehead) { return; } const head = createHead(); app2.use(head); } }; const D_58_47_25991_26723_47GitHub_47znhd_45service_47node_modules_47_64nuxt_47ui_47dist_47runtime_47vue_47plugins_47router_46js = { install(app2, options) { if ((options == null ? void 0 : options.router) && typeof options.router === "function") { app2.provide("nuxtui:router", options.router); } } }; var o = { inherit: "inherit", current: "currentcolor", transparent: "transparent", black: "#000", white: "#fff", slate: { 50: "oklch(98.4% 0.003 247.858)", 100: "oklch(96.8% 0.007 247.896)", 200: "oklch(92.9% 0.013 255.508)", 300: "oklch(86.9% 0.022 252.894)", 400: "oklch(70.4% 0.04 256.788)", 500: "oklch(55.4% 0.046 257.417)", 600: "oklch(44.6% 0.043 257.281)", 700: "oklch(37.2% 0.044 257.287)", 800: "oklch(27.9% 0.041 260.031)", 900: "oklch(20.8% 0.042 265.755)", 950: "oklch(12.9% 0.042 264.695)" }, gray: { 50: "oklch(98.5% 0.002 247.839)", 100: "oklch(96.7% 0.003 264.542)", 200: "oklch(92.8% 0.006 264.531)", 300: "oklch(87.2% 0.01 258.338)", 400: "oklch(70.7% 0.022 261.325)", 500: "oklch(55.1% 0.027 264.364)", 600: "oklch(44.6% 0.03 256.802)", 700: "oklch(37.3% 0.034 259.733)", 800: "oklch(27.8% 0.033 256.848)", 900: "oklch(21% 0.034 264.665)", 950: "oklch(13% 0.028 261.692)" }, zinc: { 50: "oklch(98.5% 0 none)", 100: "oklch(96.7% 0.001 286.375)", 200: "oklch(92% 0.004 286.32)", 300: "oklch(87.1% 0.006 286.286)", 400: "oklch(70.5% 0.015 286.067)", 500: "oklch(55.2% 0.016 285.938)", 600: "oklch(44.2% 0.017 285.786)", 700: "oklch(37% 0.013 285.805)", 800: "oklch(27.4% 0.006 286.033)", 900: "oklch(21% 0.006 285.885)", 950: "oklch(14.1% 0.005 285.823)" }, neutral: { 50: "oklch(98.5% 0 none)", 100: "oklch(97% 0 none)", 200: "oklch(92.2% 0 none)", 300: "oklch(87% 0 none)", 400: "oklch(70.8% 0 none)", 500: "oklch(55.6% 0 none)", 600: "oklch(43.9% 0 none)", 700: "oklch(37.1% 0 none)", 800: "oklch(26.9% 0 none)", 900: "oklch(20.5% 0 none)", 950: "oklch(14.5% 0 none)" }, stone: { 50: "oklch(98.5% 0.001 106.423)", 100: "oklch(97% 0.001 106.424)", 200: "oklch(92.3% 0.003 48.717)", 300: "oklch(86.9% 0.005 56.366)", 400: "oklch(70.9% 0.01 56.259)", 500: "oklch(55.3% 0.013 58.071)", 600: "oklch(44.4% 0.011 73.639)", 700: "oklch(37.4% 0.01 67.558)", 800: "oklch(26.8% 0.007 34.298)", 900: "oklch(21.6% 0.006 56.043)", 950: "oklch(14.7% 0.004 49.25)" }, mauve: { 50: "oklch(98.5% 0 none)", 100: "oklch(96% 0.003 325.6)", 200: "oklch(92.2% 0.005 325.62)", 300: "oklch(86.5% 0.012 325.68)", 400: "oklch(71.1% 0.019 323.02)", 500: "oklch(54.2% 0.034 322.5)", 600: "oklch(43.5% 0.029 321.78)", 700: "oklch(36.4% 0.029 323.89)", 800: "oklch(26.3% 0.024 320.12)", 900: "oklch(21.2% 0.019 322.12)", 950: "oklch(14.5% 0.008 326)" }, olive: { 50: "oklch(98.8% 0.003 106.5)", 100: "oklch(96.6% 0.005 106.5)", 200: "oklch(93% 0.007 106.5)", 300: "oklch(88% 0.011 106.6)", 400: "oklch(73.7% 0.021 106.9)", 500: "oklch(58% 0.031 107.3)", 600: "oklch(46.6% 0.025 107.3)", 700: "oklch(39.4% 0.023 107.4)", 800: "oklch(28.6% 0.016 107.4)", 900: "oklch(22.8% 0.013 107.4)", 950: "oklch(15.3% 0.006 107.1)" }, mist: { 50: "oklch(98.7% 0.002 197.1)", 100: "oklch(96.3% 0.002 197.1)", 200: "oklch(92.5% 0.005 214.3)", 300: "oklch(87.2% 0.007 219.6)", 400: "oklch(72.3% 0.014 214.4)", 500: "oklch(56% 0.021 213.5)", 600: "oklch(45% 0.017 213.2)", 700: "oklch(37.8% 0.015 216)", 800: "oklch(27.5% 0.011 216.9)", 900: "oklch(21.8% 0.008 223.9)", 950: "oklch(14.8% 0.004 228.8)" }, taupe: { 50: "oklch(98.6% 0.002 67.8)", 100: "oklch(96% 0.002 17.2)", 200: "oklch(92.2% 0.005 34.3)", 300: "oklch(86.8% 0.007 39.5)", 400: "oklch(71.4% 0.014 41.2)", 500: "oklch(54.7% 0.021 43.1)", 600: "oklch(43.8% 0.017 39.3)", 700: "oklch(36.7% 0.016 35.7)", 800: "oklch(26.8% 0.011 36.5)", 900: "oklch(21.4% 0.009 43.1)", 950: "oklch(14.7% 0.004 49.3)" }, red: { 50: "oklch(97.1% 0.013 17.38)", 100: "oklch(93.6% 0.032 17.717)", 200: "oklch(88.5% 0.062 18.334)", 300: "oklch(80.8% 0.114 19.571)", 400: "oklch(70.4% 0.191 22.216)", 500: "oklch(63.7% 0.237 25.331)", 600: "oklch(57.7% 0.245 27.325)", 700: "oklch(50.5% 0.213 27.518)", 800: "oklch(44.4% 0.177 26.899)", 900: "oklch(39.6% 0.141 25.723)", 950: "oklch(25.8% 0.092 26.042)" }, orange: { 50: "oklch(98% 0.016 73.684)", 100: "oklch(95.4% 0.038 75.164)", 200: "oklch(90.1% 0.076 70.697)", 300: "oklch(83.7% 0.128 66.29)", 400: "oklch(75% 0.183 55.934)", 500: "oklch(70.5% 0.213 47.604)", 600: "oklch(64.6% 0.222 41.116)", 700: "oklch(55.3% 0.195 38.402)", 800: "oklch(47% 0.157 37.304)", 900: "oklch(40.8% 0.123 38.172)", 950: "oklch(26.6% 0.079 36.259)" }, amber: { 50: "oklch(98.7% 0.022 95.277)", 100: "oklch(96.2% 0.059 95.617)", 200: "oklch(92.4% 0.12 95.746)", 300: "oklch(87.9% 0.169 91.605)", 400: "oklch(82.8% 0.189 84.429)", 500: "oklch(76.9% 0.188 70.08)", 600: "oklch(66.6% 0.179 58.318)", 700: "oklch(55.5% 0.163 48.998)", 800: "oklch(47.3% 0.137 46.201)", 900: "oklch(41.4% 0.112 45.904)", 950: "oklch(27.9% 0.077 45.635)" }, yellow: { 50: "oklch(98.7% 0.026 102.212)", 100: "oklch(97.3% 0.071 103.193)", 200: "oklch(94.5% 0.129 101.54)", 300: "oklch(90.5% 0.182 98.111)", 400: "oklch(85.2% 0.199 91.936)", 500: "oklch(79.5% 0.184 86.047)", 600: "oklch(68.1% 0.162 75.834)", 700: "oklch(55.4% 0.135 66.442)", 800: "oklch(47.6% 0.114 61.907)", 900: "oklch(42.1% 0.095 57.708)", 950: "oklch(28.6% 0.066 53.813)" }, lime: { 50: "oklch(98.6% 0.031 120.757)", 100: "oklch(96.7% 0.067 122.328)", 200: "oklch(93.8% 0.127 124.321)", 300: "oklch(89.7% 0.196 126.665)", 400: "oklch(84.1% 0.238 128.85)", 500: "oklch(76.8% 0.233 130.85)", 600: "oklch(64.8% 0.2 131.684)", 700: "oklch(53.2% 0.157 131.589)", 800: "oklch(45.3% 0.124 130.933)", 900: "oklch(40.5% 0.101 131.063)", 950: "oklch(27.4% 0.072 132.109)" }, green: { 50: "oklch(98.2% 0.018 155.826)", 100: "oklch(96.2% 0.044 156.743)", 200: "oklch(92.5% 0.084 155.995)", 300: "oklch(87.1% 0.15 154.449)", 400: "oklch(79.2% 0.209 151.711)", 500: "oklch(72.3% 0.219 149.579)", 600: "oklch(62.7% 0.194 149.214)", 700: "oklch(52.7% 0.154 150.069)", 800: "oklch(44.8% 0.119 151.328)", 900: "oklch(39.3% 0.095 152.535)", 950: "oklch(26.6% 0.065 152.934)" }, emerald: { 50: "oklch(97.9% 0.021 166.113)", 100: "oklch(95% 0.052 163.051)", 200: "oklch(90.5% 0.093 164.15)", 300: "oklch(84.5% 0.143 164.978)", 400: "oklch(76.5% 0.177 163.223)", 500: "oklch(69.6% 0.17 162.48)", 600: "oklch(59.6% 0.145 163.225)", 700: "oklch(50.8% 0.118 165.612)", 800: "oklch(43.2% 0.095 166.913)", 900: "oklch(37.8% 0.077 168.94)", 950: "oklch(26.2% 0.051 172.552)" }, teal: { 50: "oklch(98.4% 0.014 180.72)", 100: "oklch(95.3% 0.051 180.801)", 200: "oklch(91% 0.096 180.426)", 300: "oklch(85.5% 0.138 181.071)", 400: "oklch(77.7% 0.152 181.912)", 500: "oklch(70.4% 0.14 182.503)", 600: "oklch(60% 0.118 184.704)", 700: "oklch(51.1% 0.096 186.391)", 800: "oklch(43.7% 0.078 188.216)", 900: "oklch(38.6% 0.063 188.416)", 950: "oklch(27.7% 0.046 192.524)" }, cyan: { 50: "oklch(98.4% 0.019 200.873)", 100: "oklch(95.6% 0.045 203.388)", 200: "oklch(91.7% 0.08 205.041)", 300: "oklch(86.5% 0.127 207.078)", 400: "oklch(78.9% 0.154 211.53)", 500: "oklch(71.5% 0.143 215.221)", 600: "oklch(60.9% 0.126 221.723)", 700: "oklch(52% 0.105 223.128)", 800: "oklch(45% 0.085 224.283)", 900: "oklch(39.8% 0.07 227.392)", 950: "oklch(30.2% 0.056 229.695)" }, sky: { 50: "oklch(97.7% 0.013 236.62)", 100: "oklch(95.1% 0.026 236.824)", 200: "oklch(90.1% 0.058 230.902)", 300: "oklch(82.8% 0.111 230.318)", 400: "oklch(74.6% 0.16 232.661)", 500: "oklch(68.5% 0.169 237.323)", 600: "oklch(58.8% 0.158 241.966)", 700: "oklch(50% 0.134 242.749)", 800: "oklch(44.3% 0.11 240.79)", 900: "oklch(39.1% 0.09 240.876)", 950: "oklch(29.3% 0.066 243.157)" }, blue: { 50: "oklch(97% 0.014 254.604)", 100: "oklch(93.2% 0.032 255.585)", 200: "oklch(88.2% 0.059 254.128)", 300: "oklch(80.9% 0.105 251.813)", 400: "oklch(70.7% 0.165 254.624)", 500: "oklch(62.3% 0.214 259.815)", 600: "oklch(54.6% 0.245 262.881)", 700: "oklch(48.8% 0.243 264.376)", 800: "oklch(42.4% 0.199 265.638)", 900: "oklch(37.9% 0.146 265.522)", 950: "oklch(28.2% 0.091 267.935)" }, indigo: { 50: "oklch(96.2% 0.018 272.314)", 100: "oklch(93% 0.034 272.788)", 200: "oklch(87% 0.065 274.039)", 300: "oklch(78.5% 0.115 274.713)", 400: "oklch(67.3% 0.182 276.935)", 500: "oklch(58.5% 0.233 277.117)", 600: "oklch(51.1% 0.262 276.966)", 700: "oklch(45.7% 0.24 277.023)", 800: "oklch(39.8% 0.195 277.366)", 900: "oklch(35.9% 0.144 278.697)", 950: "oklch(25.7% 0.09 281.288)" }, violet: { 50: "oklch(96.9% 0.016 293.756)", 100: "oklch(94.3% 0.029 294.588)", 200: "oklch(89.4% 0.057 293.283)", 300: "oklch(81.1% 0.111 293.571)", 400: "oklch(70.2% 0.183 293.541)", 500: "oklch(60.6% 0.25 292.717)", 600: "oklch(54.1% 0.281 293.009)", 700: "oklch(49.1% 0.27 292.581)", 800: "oklch(43.2% 0.232 292.759)", 900: "oklch(38% 0.189 293.745)", 950: "oklch(28.3% 0.141 291.089)" }, purple: { 50: "oklch(97.7% 0.014 308.299)", 100: "oklch(94.6% 0.033 307.174)", 200: "oklch(90.2% 0.063 306.703)", 300: "oklch(82.7% 0.119 306.383)", 400: "oklch(71.4% 0.203 305.504)", 500: "oklch(62.7% 0.265 303.9)", 600: "oklch(55.8% 0.288 302.321)", 700: "oklch(49.6% 0.265 301.924)", 800: "oklch(43.8% 0.218 303.724)", 900: "oklch(38.1% 0.176 304.987)", 950: "oklch(29.1% 0.149 302.717)" }, fuchsia: { 50: "oklch(97.7% 0.017 320.058)", 100: "oklch(95.2% 0.037 318.852)", 200: "oklch(90.3% 0.076 319.62)", 300: "oklch(83.3% 0.145 321.434)", 400: "oklch(74% 0.238 322.16)", 500: "oklch(66.7% 0.295 322.15)", 600: "oklch(59.1% 0.293 322.896)", 700: "oklch(51.8% 0.253 323.949)", 800: "oklch(45.2% 0.211 324.591)", 900: "oklch(40.1% 0.17 325.612)", 950: "oklch(29.3% 0.136 325.661)" }, pink: { 50: "oklch(97.1% 0.014 343.198)", 100: "oklch(94.8% 0.028 342.258)", 200: "oklch(89.9% 0.061 343.231)", 300: "oklch(82.3% 0.12 346.018)", 400: "oklch(71.8% 0.202 349.761)", 500: "oklch(65.6% 0.241 354.308)", 600: "oklch(59.2% 0.249 0.584)", 700: "oklch(52.5% 0.223 3.958)", 800: "oklch(45.9% 0.187 3.815)", 900: "oklch(40.8% 0.153 2.432)", 950: "oklch(28.4% 0.109 3.907)" }, rose: { 50: "oklch(96.9% 0.015 12.422)", 100: "oklch(94.1% 0.03 12.58)", 200: "oklch(89.2% 0.058 10.001)", 300: "oklch(81% 0.117 11.638)", 400: "oklch(71.2% 0.194 13.428)", 500: "oklch(64.5% 0.246 16.439)", 600: "oklch(58.6% 0.253 17.585)", 700: "oklch(51.4% 0.222 16.935)", 800: "oklch(45.5% 0.188 13.697)", 900: "oklch(41% 0.159 10.272)", 950: "oklch(27.1% 0.105 12.094)" } }; function computedWithControl(source, fn, options = {}) { let v = void 0; let track; let trigger; let dirty = true; const update = () => { dirty = true; trigger(); }; vue.watch(source, update, { flush: "sync", ...options }); const get2 = typeof fn === "function" ? fn : fn.get; const set = typeof fn === "function" ? void 0 : fn.set; const result = vue.customRef((_track, _trigger) => { track = _track; trigger = _trigger; return { get() { if (dirty) { v = get2(v); dirty = false; } track(); return v; }, set(v2) { set === null || set === void 0 || set(v2); } }; }); result.trigger = update; return result; } function tryOnScopeDispose(fn, failSilently) { if (vue.getCurrentScope()) { vue.onScopeDispose(fn, failSilently); return true; } return false; } function createEventHook() { const fns = new Set(); const off = (fn) => { fns.delete(fn); }; const clear = () => { fns.clear(); }; const on = (fn) => { fns.add(fn); const offFn = () => off(fn); tryOnScopeDispose(offFn); return { off: offFn }; }; const trigger = (...args) => { return Promise.all(Array.from(fns).map((fn) => fn(...args))); }; return { on, off, trigger, clear }; } function createGlobalState(stateFactory) { let initialized = false; let state2; const scope = vue.effectScope(true); return ((...args) => { if (!initialized) { state2 = scope.run(() => stateFactory(...args)); initialized = true; } return state2; }); } const isClient = typeof window !== "undefined" && typeof document !== "undefined"; typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope; const isDef = (val) => typeof val !== "undefined"; const notNullish = (val) => val != null; const toString = Object.prototype.toString; const isObject = (val) => toString.call(val) === "[object Object]"; const noop = () => { }; function toRef(...args) { if (args.length !== 1) return vue.toRef(...args); const r = args[0]; return typeof r === "function" ? vue.readonly(vue.customRef(() => ({ get: r, set: noop }))) : vue.ref(r); } function createFilterWrapper(filter, fn) { function wrapper(...args) { return new Promise((resolve, reject) => { Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject); }); } if ("cancel" in filter) Object.assign(wrapper, { cancel: filter.cancel, flush: filter.flush, isPending: filter.isPending }); return wrapper; } const bypassFilter = (invoke) => { return invoke(); }; function debounceFilter(ms, options = {}) { let timer2; let maxTimer; let lastRejector = noop; let lastResolve = noop; const _pending = vue.shallowRef(false); const _clearTimeout = (timer3) => { clearTimeout(timer3); lastRejector(); lastRejector = noop; }; let lastInvoker; const handler = (invoke) => { const duration = vue.toValue(ms); const maxDuration = vue.toValue(options.maxWait); if (timer2) _clearTimeout(timer2); if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) { if (maxTimer) { _clearTimeout(maxTimer); maxTimer = void 0; } _pending.value = false; return Promise.resolve(invoke()); } _pending.value = true; return new Promise((resolve, reject) => { lastRejector = options.rejectOnCancel ? reject : resolve; lastResolve = resolve; lastInvoker = invoke; if (maxDuration && !maxTimer) maxTimer = setTimeout(() => { if (timer2) _clearTimeout(timer2); maxTimer = void 0; _pending.value = false; resolve(lastInvoker()); }, maxDuration); timer2 = setTimeout(() => { if (maxTimer) _clearTimeout(maxTimer); maxTimer = void 0; _pending.value = false; resolve(invoke()); }, duration); }); }; return Object.assign(handler, { cancel: () => { if (timer2) { _clearTimeout(timer2); timer2 = void 0; } if (maxTimer) { _clearTimeout(maxTimer); maxTimer = void 0; } _pending.value = false; lastResolve = noop; }, flush: () => { if (_pending.value) { if (timer2) { clearTimeout(timer2); timer2 = void 0; } if (maxTimer) { clearTimeout(maxTimer); maxTimer = void 0; } _pending.value = false; const resolve = lastResolve; lastRejector = noop; lastResolve = noop; resolve(lastInvoker()); } }, isPending: vue.shallowReadonly(_pending) }); } function throttleFilter(...args) { let lastExec = 0; let timer2; let isLeading = true; let lastRejector = noop; let lastValue; let ms; let trailing; let leading; let rejectOnCancel; if (!vue.isRef(args[0]) && typeof args[0] === "object") ({ delay: ms, trailing = true, leading = true, rejectOnCancel = false } = args[0]); else [ms, trailing = true, leading = true, rejectOnCancel = false] = args; const clear = () => { if (timer2) { clearTimeout(timer2); timer2 = void 0; lastRejector(); lastRejector = noop; } }; const filter = (_invoke) => { const duration = vue.toValue(ms); const elapsed = Date.now() - lastExec; const invoke = () => { return lastValue = _invoke(); }; clear(); if (duration <= 0) { lastExec = Date.now(); return invoke(); } if (elapsed > duration) { lastExec = Date.now(); if (leading || !isLeading) invoke(); } else if (trailing) lastValue = new Promise((resolve, reject) => { lastRejector = rejectOnCancel ? reject : resolve; timer2 = setTimeout(() => { lastExec = Date.now(); isLeading = true; resolve(invoke()); clear(); }, Math.max(0, duration - elapsed)); }); if (!leading && !timer2) timer2 = setTimeout(() => isLeading = true, duration); isLeading = false; return lastValue; }; return filter; } function pausableFilter(extendFilter = bypassFilter, options = {}) { const { initialState = "active" } = options; const isActive = toRef(initialState === "active"); function pause() { isActive.value = false; } function resume() { isActive.value = true; } const eventFilter = (...args) => { if (isActive.value) extendFilter(...args); }; return { isActive: vue.shallowReadonly(isActive), pause, resume, eventFilter }; } function toArray(value) { return Array.isArray(value) ? value : [value]; } function cacheStringFunction(fn) { const cache = Object.create(null); return ((str2) => { return cache[str2] || (cache[str2] = fn(str2)); }); } const camelizeRE = /-(\w)/g; const camelize = cacheStringFunction((str2) => { return str2.replace(camelizeRE, (_2, c) => c ? c.toUpperCase() : ""); }); function getLifeCycleTarget(target) { return vue.getCurrentInstance(); } function createSharedComposable(composable) { if (!isClient) return composable; let subscribers = 0; let state2; let scope; const dispose = () => { subscribers -= 1; if (scope && subscribers <= 0) { scope.stop(); state2 = void 0; scope = void 0; } }; return ((...args) => { subscribers += 1; if (!scope) { scope = vue.effectScope(true); state2 = scope.run(() => composable(...args)); } tryOnScopeDispose(dispose); return state2; }); } function makeDestructurable(obj, arr) { if (typeof Symbol !== "undefined") { const clone = { ...obj }; Object.defineProperty(clone, Symbol.iterator, { enumerable: false, value() { let index = 0; return { next: () => ({ value: arr[index++], done: index > arr.length }) }; } }); return clone; } else return Object.assign([...arr], obj); } function toReactive(objectRef) { if (!vue.isRef(objectRef)) return vue.reactive(objectRef); return vue.reactive(new Proxy({}, { get(_2, p, receiver) { return vue.unref(Reflect.get(objectRef.value, p, receiver)); }, set(_2, p, value) { if (vue.isRef(objectRef.value[p]) && !vue.isRef(value)) objectRef.value[p].value = value; else objectRef.value[p] = value; return true; }, deleteProperty(_2, p) { return Reflect.deleteProperty(objectRef.value, p); }, has(_2, p) { return Reflect.has(objectRef.value, p); }, ownKeys() { return Object.keys(objectRef.value); }, getOwnPropertyDescriptor() { return { enumerable: true, configurable: true }; } })); } function reactiveComputed(fn) { return toReactive(vue.computed(fn)); } function reactiveOmit(obj, ...keys) { const flatKeys = keys.flat(); const predicate = flatKeys[0]; return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(vue.toRefs(obj)).filter(([k, v]) => !predicate(vue.toValue(v), k))) : Object.fromEntries(Object.entries(vue.toRefs(obj)).filter((e) => !flatKeys.includes(e[0])))); } function reactivePick(obj, ...keys) { const flatKeys = keys.flat(); const predicate = flatKeys[0]; return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(vue.toRefs(obj)).filter(([k, v]) => predicate(vue.toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)]))); } function refAutoReset(defaultValue, afterMs = 1e4) { return vue.customRef((track, trigger) => { let value = vue.toValue(defaultValue); let timer2; const resetAfter = () => setTimeout(() => { value = vue.toValue(defaultValue); trigger(); }, vue.toValue(afterMs)); tryOnScopeDispose(() => { clearTimeout(timer2); }); return { get() { track(); return value; }, set(newValue) { value = newValue; trigger(); clearTimeout(timer2); timer2 = resetAfter(); } }; }); } function useDebounceFn(fn, ms = 200, options = {}) { return createFilterWrapper(debounceFilter(ms, options), fn); } function watchWithFilter(source, cb, options = {}) { const { eventFilter = bypassFilter, ...watchOptions } = options; return vue.watch(source, createFilterWrapper(eventFilter, cb), watchOptions); } function watchPausable(source, cb, options = {}) { const { eventFilter: filter, initialState = "active", ...watchOptions } = options; const { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState }); return { stop: watchWithFilter(source, cb, { ...watchOptions, eventFilter }), pause, resume, isActive }; } function syncRef(left, right, ...[options]) { const { flush = "sync", deep = false, immediate = true, direction = "both", transform = {} } = options || {}; const watchers = []; const transformLTR = "ltr" in transform && transform.ltr || ((v) => v); const transformRTL = "rtl" in transform && transform.rtl || ((v) => v); if (direction === "both" || direction === "ltr") watchers.push(watchPausable(left, (newValue) => { watchers.forEach((w) => w.pause()); right.value = transformLTR(newValue); watchers.forEach((w) => w.resume()); }, { flush, deep, immediate })); if (direction === "both" || direction === "rtl") watchers.push(watchPausable(right, (newValue) => { watchers.forEach((w) => w.pause()); left.value = transformRTL(newValue); watchers.forEach((w) => w.resume()); }, { flush, deep, immediate })); const stop = () => { watchers.forEach((w) => w.stop()); }; return stop; } function tryOnBeforeUnmount(fn, target) { if (getLifeCycleTarget()) vue.onBeforeUnmount(fn, target); } function tryOnMounted(fn, sync = true, target) { if (getLifeCycleTarget()) vue.onMounted(fn, target); else if (sync) fn(); else vue.nextTick(fn); } function useTimeoutFn(cb, interval, options = {}) { const { immediate = true, immediateCallback = false } = options; const isPending = vue.shallowRef(false); let timer2; function clear() { if (timer2) { clearTimeout(timer2); timer2 = void 0; } } function stop() { isPending.value = false; clear(); } function start(...args) { if (immediateCallback) cb(); clear(); isPending.value = true; timer2 = setTimeout(() => { isPending.value = false; timer2 = void 0; cb(...args); }, vue.toValue(interval)); } if (immediate) { isPending.value = true; if (isClient) start(); } tryOnScopeDispose(stop); return { isPending: vue.shallowReadonly(isPending), start, stop }; } function useTimeout(interval = 1e3, options = {}) { const { controls: exposeControls = false, callback } = options; const controls = useTimeoutFn(callback !== null && callback !== void 0 ? callback : noop, interval, options); const ready = vue.computed(() => !controls.isPending.value); if (exposeControls) return { ready, ...controls }; else return ready; } function watchImmediate(source, cb, options) { return vue.watch(source, cb, { ...options, immediate: true }); } function watchThrottled(source, cb, options = {}) { const { throttle = 0, trailing = true, leading = true, ...watchOptions } = options; return watchWithFilter(source, cb, { ...watchOptions, eventFilter: throttleFilter(throttle, trailing, leading) }); } function createReusableTemplate(options = {}) { const { inheritAttrs = true, name = "ReusableTemplate" } = options; const render2 = vue.shallowRef(); const define = vue.defineComponent({ name: `${name}.define`, setup(_2, { slots }) { return () => { render2.value = slots.default; }; } }); const reuse = vue.defineComponent({ inheritAttrs, name: `${name}.reuse`, props: options.props, setup(props, { attrs, slots }) { return () => { var _render$value; if (!render2.value && true) throw new Error("[VueUse] Failed to find the definition of reusable template"); const vnode = (_render$value = render2.value) === null || _render$value === void 0 ? void 0 : _render$value.call(render2, { ...options.props == null ? keysToCamelKebabCase(attrs) : props, $slots: slots }); return inheritAttrs && (vnode === null || vnode === void 0 ? void 0 : vnode.length) === 1 ? vnode[0] : vnode; }; } }); return makeDestructurable({ define, reuse }, [define, reuse]); } function keysToCamelKebabCase(obj) { const newObj = {}; for (const key in obj) newObj[camelize(key)] = obj[key]; return newObj; } const defaultWindow$1 = isClient ? window : void 0; function unrefElement$1(elRef) { var _$el; const plain = vue.toValue(elRef); return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain; } function useEventListener$1(...args) { const register = (el, event, listener, options) => { el.addEventListener(event, listener, options); return () => el.removeEventListener(event, listener, options); }; const firstParamTargets = vue.computed(() => { const test = toArray(vue.toValue(args[0])).filter((e) => e != null); return test.every((e) => typeof e !== "string") ? test : void 0; }); return watchImmediate(() => { var _firstParamTargets$va, _firstParamTargets$va2; return [ (_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement$1(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow$1].filter((e) => e != null), toArray(vue.toValue(firstParamTargets.value ? args[1] : args[0])), toArray(vue.unref(firstParamTargets.value ? args[2] : args[1])), vue.toValue(firstParamTargets.value ? args[3] : args[2]) ]; }, ([raw_targets, raw_events, raw_listeners, raw_options], _2, onCleanup) => { if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return; const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options; const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone)))); onCleanup(() => { cleanups.forEach((fn) => fn()); }); }, { flush: "post" }); } function useMounted$1() { const isMounted = vue.shallowRef(false); const instance = vue.getCurrentInstance(); if (instance) vue.onMounted(() => { isMounted.value = true; }, instance); return isMounted; } function useSupported$1(callback) { const isMounted = useMounted$1(); return vue.computed(() => { isMounted.value; return Boolean(callback()); }); } function useMutationObserver$1(target, callback, options = {}) { const { window: window2 = defaultWindow$1, ...mutationOptions } = options; let observer2; const isSupported = useSupported$1(() => window2 && "MutationObserver" in window2); const cleanup = () => { if (observer2) { observer2.disconnect(); observer2 = void 0; } }; const stopWatch = vue.watch(vue.computed(() => { const items = toArray(vue.toValue(target)).map(unrefElement$1).filter(notNullish); return new Set(items); }), (newTargets) => { cleanup(); if (isSupported.value && newTargets.size) { observer2 = new MutationObserver(callback); newTargets.forEach((el) => observer2.observe(el, mutationOptions)); } }, { immediate: true, flush: "post" }); const takeRecords = () => { return observer2 === null || observer2 === void 0 ? void 0 : observer2.takeRecords(); }; const stop = () => { stopWatch(); cleanup(); }; tryOnScopeDispose(stop); return { isSupported, stop, takeRecords }; } function cloneFnJSON$1(source) { return JSON.parse(JSON.stringify(source)); } function useResizeObserver$1(target, callback, options = {}) { const { window: window2 = defaultWindow$1, ...observerOptions } = options; let observer2; const isSupported = useSupported$1(() => window2 && "ResizeObserver" in window2); const cleanup = () => { if (observer2) { observer2.disconnect(); observer2 = void 0; } }; const stopWatch = vue.watch(vue.computed(() => { const _targets = vue.toValue(target); return Array.isArray(_targets) ? _targets.map((el) => unrefElement$1(el)) : [unrefElement$1(_targets)]; }), (els) => { cleanup(); if (isSupported.value && window2) { observer2 = new ResizeObserver(callback); for (const _el of els) if (_el) observer2.observe(_el, observerOptions); } }, { immediate: true, flush: "post" }); const stop = () => { cleanup(); stopWatch(); }; tryOnScopeDispose(stop); return { isSupported, stop }; } function useElementBounding(target, options = {}) { const { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = "sync" } = options; const height = vue.shallowRef(0); const bottom = vue.shallowRef(0); const left = vue.shallowRef(0); const right = vue.shallowRef(0); const top = vue.shallowRef(0); const width = vue.shallowRef(0); const x = vue.shallowRef(0); const y = vue.shallowRef(0); function recalculate() { const el = unrefElement$1(target); if (!el) { if (reset) { height.value = 0; bottom.value = 0; left.value = 0; right.value = 0; top.value = 0; width.value = 0; x.value = 0; y.value = 0; } return; } const rect = el.getBoundingClientRect(); height.value = rect.height; bottom.value = rect.bottom; left.value = rect.left; right.value = rect.right; top.value = rect.top; width.value = rect.width; x.value = rect.x; y.value = rect.y; } function update() { if (updateTiming === "sync") recalculate(); else if (updateTiming === "next-frame") requestAnimationFrame(() => recalculate()); } useResizeObserver$1(target, update); vue.watch(() => unrefElement$1(target), (ele) => !ele && update()); useMutationObserver$1(target, update, { attributeFilter: ["style", "class"] }); if (windowScroll) useEventListener$1("scroll", update, { capture: true, passive: true }); if (windowResize) useEventListener$1("resize", update, { passive: true }); tryOnMounted(() => { if (immediate) update(); }); return { height, bottom, left, right, top, width, x, y, update }; } function useVModel$1(props, key, emit2, options = {}) { var _vm$$emit, _vm$proxy; const { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options; const vm = vue.getCurrentInstance(); const _emit = emit2 || (vm === null || vm === void 0 ? void 0 : vm.emit) || (vm === null || vm === void 0 || (_vm$$emit = vm.$emit) === null || _vm$$emit === void 0 ? void 0 : _vm$$emit.bind(vm)) || (vm === null || vm === void 0 || (_vm$proxy = vm.proxy) === null || _vm$proxy === void 0 || (_vm$proxy = _vm$proxy.$emit) === null || _vm$proxy === void 0 ? void 0 : _vm$proxy.bind(vm === null || vm === void 0 ? void 0 : vm.proxy)); let event = eventName; event = event || `update:${key.toString()}`; const cloneFn = (val) => !clone ? val : typeof clone === "function" ? clone(val) : cloneFnJSON$1(val); const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue; const triggerEmit = (value) => { if (shouldEmit) { if (shouldEmit(value)) _emit(event, value); } else _emit(event, value); }; if (passive) { const proxy = vue.ref(getValue()); let isUpdating = false; vue.watch(() => props[key], (v) => { if (!isUpdating) { isUpdating = true; proxy.value = cloneFn(v); vue.nextTick(() => isUpdating = false); } }); vue.watch(proxy, (v) => { if (!isUpdating && (v !== props[key] || deep)) triggerEmit(v); }, { deep }); return proxy; } else return vue.computed({ get() { return getValue(); }, set(value) { triggerEmit(value); } }); } const appConfig = { "ui": { "colors": { "primary": "sky", "success": "green", "info": "blue", "warning": "yellow", "error": "red", "neutral": "slate" }, "icons": { "arrowDown": "i-lucide-arrow-down", "arrowLeft": "i-lucide-arrow-left", "arrowRight": "i-lucide-arrow-right", "arrowUp": "i-lucide-arrow-up", "caution": "i-lucide-circle-alert", "check": "i-lucide-check", "chevronDoubleLeft": "i-lucide-chevrons-left", "chevronDoubleRight": "i-lucide-chevrons-right", "chevronDown": "i-lucide-chevron-down", "chevronLeft": "i-lucide-chevron-left", "chevronRight": "i-lucide-chevron-right", "chevronUp": "i-lucide-chevron-up", "close": "i-lucide-x", "copy": "i-lucide-copy", "copyCheck": "i-lucide-copy-check", "dark": "i-lucide-moon", "drag": "i-lucide-grip-vertical", "ellipsis": "i-lucide-ellipsis", "error": "i-lucide-circle-x", "external": "i-lucide-arrow-up-right", "eye": "i-lucide-eye", "eyeOff": "i-lucide-eye-off", "file": "i-lucide-file", "folder": "i-lucide-folder", "folderOpen": "i-lucide-folder-open", "hash": "i-lucide-hash", "info": "i-lucide-info", "light": "i-lucide-sun", "loading": "i-lucide-loader-circle", "menu": "i-lucide-menu", "minus": "i-lucide-minus", "panelClose": "i-lucide-panel-left-close", "panelOpen": "i-lucide-panel-left-open", "plus": "i-lucide-plus", "reload": "i-lucide-rotate-ccw", "search": "i-lucide-search", "stop": "i-lucide-square", "star": "i-lucide-star", "success": "i-lucide-circle-check", "system": "i-lucide-monitor", "tip": "i-lucide-lightbulb", "upload": "i-lucide-upload", "warning": "i-lucide-triangle-alert" }, "tv": { "twMergeConfig": {} } }, "colorMode": false, "icon": {} }; const _appConfig = vue.reactive(appConfig); const useAppConfig = () => _appConfig; const kbdKeysMap = { meta: "", ctrl: "", alt: "", win: "⊞", command: "⌘", shift: "⇧", control: "⌃", option: "⌥", enter: "↵", delete: "⌦", backspace: "⌫", escape: "Esc", tab: "⇥", capslock: "⇪", arrowup: "↑", arrowright: "→", arrowdown: "↓", arrowleft: "←", pageup: "⇞", pagedown: "⇟", home: "↖", end: "↘" }; const kbdKeysPlatformMap = { meta: { macos: kbdKeysMap.command, other: "Ctrl" }, ctrl: { macos: kbdKeysMap.control, other: "Ctrl" }, alt: { macos: kbdKeysMap.option, other: "Alt" } }; const _useKbd = () => { const macOS = vue.computed(() => typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.match(/Macintosh;/)); if (macOS.value) { document.documentElement.classList.add("ui-macos"); } return { macOS }; }; const useSharedKbd = createSharedComposable(_useKbd); function useKbd$1() { const { macOS } = useSharedKbd(); const mounted = vue.getCurrentInstance() ? useMounted$1() : vue.shallowRef(true); function getKbdKey(value) { if (!value) { return; } if (["meta", "alt", "ctrl"].includes(value)) { return mounted.value ? kbdKeysPlatformMap[value][macOS.value ? "macos" : "other"] : " "; } return kbdKeysMap[value] || value; } return { macOS, getKbdKey }; } function isPlainObject(value) { if (value === null || typeof value !== "object") { return false; } const prototype = Object.getPrototypeOf(value); if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) { return false; } if (Symbol.iterator in value) { return false; } if (Symbol.toStringTag in value) { return Object.prototype.toString.call(value) === "[object Module]"; } return true; } function _defu(baseObject, defaults, namespace = ".", merger) { if (!isPlainObject(defaults)) { return _defu(baseObject, {}, namespace); } const object = { ...defaults }; for (const key of Object.keys(baseObject)) { if (key === "__proto__" || key === "constructor") { continue; } const value = baseObject[key]; if (value === null || value === void 0) { continue; } if (Array.isArray(value) && Array.isArray(object[key])) { object[key] = [...value, ...object[key]]; } else if (isPlainObject(value) && isPlainObject(object[key])) { object[key] = _defu( value, object[key], (namespace ? `${namespace}.` : "") + key.toString()); } else { object[key] = value; } } return object; } function createDefu(merger) { return (...arguments_) => ( arguments_.reduce((p, c) => _defu(p, c, ""), {}) ); } const defu = createDefu(); function defineLocale(options) { return defu(options, { dir: "ltr" }); } function serialize(input) { if (typeof input === "string") return `'${input}'`; return new Serializer().serialize(input); } const asciiOrder = " _-,;:!?.'\"()[]{}@*/\\&#%`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz"; const asciiWeights = (function() { const weights = new Uint8Array(128); for (let i = 0; i < 69; i++) weights[asciiOrder.charCodeAt(i)] = i + 1; for (let code = 65; code <= 90; code++) weights[code] = weights[code + 32]; return weights; })(); function compareStrings(a, b) { if (a === b) return 0; const length = Math.min(a.length, b.length); let tieBreaker = 0; for (let i = 0; i < length; i++) { const codeA = a.charCodeAt(i); const codeB = b.charCodeAt(i); if (codeA === codeB) continue; const weightA = codeA < 128 && asciiWeights[codeA] ? asciiWeights[codeA] : codeA + 128; const weightB = codeB < 128 && asciiWeights[codeB] ? asciiWeights[codeB] : codeB + 128; if (weightA !== weightB) return weightA < weightB ? -1 : 1; if (tieBreaker === 0) tieBreaker = codeA > codeB ? -1 : 1; } if (a.length !== b.length) return a.length < b.length ? -1 : 1; return tieBreaker; } const Serializer = (function() { var _context; class Serializer2 { constructor() { __privateAdd(this, _context, new Map()); } compare(a, b) { const typeA = typeof a; const typeB = typeof b; if (typeA === "string" && typeB === "string") return compareStrings(a, b); if (typeA === "number" && typeB === "number") return a - b; return compareStrings(this.serialize(a, true), this.serialize(b, true)); } serialize(value, noQuotes) { if (value === null) return "null"; switch (typeof value) { case "string": return noQuotes ? value : `'${value}'`; case "bigint": return `${value}n`; case "object": return this.$object(value); case "function": return this.$function(value); } return String(value); } serializeObject(object) { const objString = Object.prototype.toString.call(object); if (objString !== "[object Object]") return this.serializeBuiltInType(objString.length < 10 ? `unknown:${objString}` : objString.slice(8, -1), object); const constructor = object.constructor; const objName = constructor === Object || constructor === void 0 ? "" : constructor.name; if (objName !== "" && globalThis[objName] === constructor) return this.serializeBuiltInType(objName, object); if ("toJSON" in object && typeof object.toJSON === "function") { const json = object.toJSON(); return objName + (json !== null && typeof json === "object" ? this.$object(json) : `(${this.serialize(json)})`); } const keys = Object.keys(object).sort(compareStrings); let content = `${objName}{`; for (let i = 0; i < keys.length; i++) { const key = keys[i]; content += `${key}:${this.serialize(object[key])}`; if (i < keys.length - 1) content += ","; } return content + "}"; } serializeBuiltInType(type, object) { const handler = this["$" + type]; if (handler) return handler.call(this, object); if (typeof object.entries === "function") return this.serializeObjectEntries(type, object.entries()); throw new Error(`Cannot serialize ${type}`); } serializeObjectEntries(type, entries) { const sortedEntries = Array.from(entries).sort((a, b) => this.compare(a[0], b[0])); let content = `${type}{`; for (let i = 0; i < sortedEntries.length; i++) { const [key, value] = sortedEntries[i]; content += `${this.serialize(key, true)}:${this.serialize(value)}`; if (i < sortedEntries.length - 1) content += ","; } return content + "}"; } $object(object) { let content = __privateGet(this, _context).get(object); if (content === void 0) { __privateGet(this, _context).set(object, `#${__privateGet(this, _context).size}`); content = this.serializeObject(object); __privateGet(this, _context).set(object, content); } return content; } $function(fn) { const fnStr = Function.prototype.toString.call(fn); if (fnStr.slice(-15) === "[native code] }") return `${fn.name || ""}()[native]`; return `${fn.name}(${fn.length})${fnStr.replace(/\s*\n\s*/g, "")}`; } $Array(arr) { let content = "["; for (let i = 0; i < arr.length; i++) { content += this.serialize(arr[i]); if (i < arr.length - 1) content += ","; } return content + "]"; } $Date(date) { try { return `Date(${date.toISOString()})`; } catch { return `Date(null)`; } } $ArrayBuffer(arr) { return `ArrayBuffer[${new Uint8Array(arr).join(",")}]`; } $Set(set) { return `Set${this.$Array(Array.from(set).sort((a, b) => this.compare(a, b)))}`; } $Map(map) { return this.serializeObjectEntries("Map", map.entries()); } } _context = new WeakMap(); for (const type of [ "Error", "RegExp", "URL" ]) Serializer2.prototype["$" + type] = function(val) { return `${type}(${val})`; }; for (const type of [ "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array" ]) Serializer2.prototype["$" + type] = function(arr) { return `${type}[${arr.join(",")}]`; }; for (const type of ["BigInt64Array", "BigUint64Array"]) Serializer2.prototype["$" + type] = function(arr) { return `${type}[${arr.join("n,")}${arr.length > 0 ? "n" : ""}]`; }; return Serializer2; })(); function isEqual$1(object1, object2) { if (object1 === object2) return true; if (serialize(object1) === serialize(object2)) return true; return false; } const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/; const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/; const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/; function hasProtocol(inputString, opts = {}) { if (typeof opts === "boolean") { opts = { acceptRelative: opts }; } if (opts.strict) { return PROTOCOL_STRICT_REGEX.test(inputString); } return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false); } function omit(data, keys) { const result = { ...data }; for (const key of keys) { delete result[key]; } return result; } function get(object, path, defaultValue) { const keys = typeof path === "string" ? path.split(".") : path; let result = object; for (const key of keys) { if (result === void 0 || result === null) { return defaultValue; } result = result[key]; } return result !== void 0 ? result : defaultValue; } function looseToNumber(val) { const n = Number.parseFloat(val); return Number.isNaN(n) ? val : n; } function compare$1(value, currentValue, comparator) { if (value === void 0 || currentValue === void 0) { return false; } if (typeof value === "string") { return value === currentValue; } if (typeof comparator === "function") { return comparator(value, currentValue); } if (typeof comparator === "string") { return get(value, comparator) === get(currentValue, comparator); } return isEqual$1(value, currentValue); } function isEmpty(value) { if (value == null) { return true; } if (typeof value === "boolean" || typeof value === "number") { return false; } if (typeof value === "string") { return value.trim().length === 0; } if (Array.isArray(value)) { return value.length === 0; } if (value instanceof Map || value instanceof Set) { return value.size === 0; } if (value instanceof Date || value instanceof RegExp || typeof value === "function") { return false; } if (typeof value === "object") { for (const _2 in value) { if (Object.prototype.hasOwnProperty.call(value, _2)) { return false; } } return true; } return false; } function getDisplayValue(items, value, options = {}) { const { valueKey, labelKey, by } = options; const foundItem = items.find((item) => { const itemValue = typeof item === "object" && item !== null && valueKey ? get(item, valueKey) : item; return compare$1(itemValue, value, by); }); if (isEmpty(value) && foundItem) { return labelKey ? get(foundItem, labelKey) : void 0; } if (isEmpty(value)) { return void 0; } const source = foundItem != null ? foundItem : value; if (source === null || source === void 0) { return void 0; } if (typeof source === "object") { return labelKey ? get(source, labelKey) : void 0; } return String(source); } function isArrayOfArray(item) { return Array.isArray(item[0]); } function mergeClasses(appConfigClass, propClass) { if (!appConfigClass && !propClass) { return ""; } return [ ...Array.isArray(appConfigClass) ? appConfigClass : [appConfigClass], propClass ].filter(Boolean); } function resolveAs(as, defaults) { if (typeof as === "string" || typeof as === "function" || typeof (as == null ? void 0 : as.render) === "function" || typeof (as == null ? void 0 : as.setup) === "function") { return { ...defaults, root: as }; } return defu(as, defaults); } function buildTranslator(locale) { return (path, option) => translate(path, option, vue.unref(locale)); } function translate(path, option, locale) { const prop = get(locale, `messages.${path}`, path); return prop.replace( /\{(\w+)\}/g, (_2, key) => { var _a2; return `${(_a2 = option == null ? void 0 : option[key]) != null ? _a2 : `{${key}}`}`; } ); } function buildLocaleContext(locale) { const lang = vue.computed(() => vue.unref(locale).name); const code = vue.computed(() => vue.unref(locale).code); const dir = vue.computed(() => vue.unref(locale).dir); const localeRef = vue.isRef(locale) ? locale : vue.ref(locale); return { lang, code, dir, locale: localeRef, t: buildTranslator(locale) }; } const en = defineLocale({ name: "English", code: "en", messages: { alert: { close: "Close" }, authForm: { hidePassword: "Hide password", showPassword: "Show password", submit: "Continue" }, banner: { close: "Close" }, breadcrumb: { label: "breadcrumb" }, calendar: { label: "Event date", monthPicker: "Month picker", nextMonth: "Next month", nextYear: "Next year", prevMonth: "Previous month", prevYear: "Previous year", yearPicker: "Year picker" }, carousel: { dots: "Choose slide to display", goto: "Go to slide {slide}", next: "Next", prev: "Prev", roledescription: "carousel", slide: "slide" }, chatMessages: { autoScroll: "Scroll to bottom" }, chatPrompt: { placeholder: "Type your message here…" }, chatPromptSubmit: { label: "Send prompt", reload: "Retry", stop: "Stop generating" }, colorMode: { dark: "Dark", light: "Light", switchToDark: "Switch to dark mode", switchToLight: "Switch to light mode", system: "System" }, commandPalette: { back: "Back", close: "Close", noData: "No data", noMatch: "No matching data", placeholder: "Type a command or search…", results: "Results" }, contentSearch: { links: "Links", search: "Results", theme: "Theme" }, contentSearchButton: { label: "Search…" }, contentToc: { title: "On this page" }, dropdownMenu: { noMatch: "No matching data", search: "Search…" }, dashboardSearch: { theme: "Theme" }, dashboardSearchButton: { label: "Search…" }, dashboardSidebarCollapse: { collapse: "Collapse sidebar", expand: "Expand sidebar" }, dashboardSidebarToggle: { close: "Close sidebar", open: "Open sidebar" }, drawer: { close: "Close" }, error: { clear: "Back to home" }, fileUpload: { removeFile: "Remove {filename}" }, header: { close: "Close menu", open: "Open menu" }, inputDate: { day: "day", dayPeriod: "AM/PM", era: "era", hour: "hour", minute: "minute", month: "month", second: "second", timeZoneName: "timezone", year: "year" }, inputMenu: { create: 'Create "{label}"', noData: "No data", noMatch: "No matching data", trigger: "Show options" }, inputNumber: { decrement: "Decrement", increment: "Increment", roledescription: "number field" }, inputRating: { rate: "Rate {value} out of {length}" }, inputTime: { dayPeriod: "AM/PM", hour: "hour", minute: "minute", second: "second", timeZoneName: "timezone" }, listbox: { noData: "No data", noMatch: "No matching data", search: "Search…" }, modal: { close: "Close" }, pagination: { first: "First page", last: "Last page", next: "Next page", page: "Page {page}", prev: "Previous page" }, pinInput: { input: "pin input {index} of {length}" }, pricingTable: { caption: "Pricing plan comparison" }, prose: { codeCollapse: { closeText: "Collapse", name: "code", openText: "Expand" }, collapsible: { closeText: "Hide", name: "properties", openText: "Show" }, pre: { copy: "Copy code to clipboard" }, prompt: { copy: "Copy prompt", openIn: "Open in {name}" } }, chatReasoning: { thinking: "Thinking…", thought: "Thought", thoughtFor: "Thought for {duration}" }, sidebar: { close: "Close", toggle: "Toggle" }, selectMenu: { create: 'Create "{label}"', noData: "No data", noMatch: "No matching data", search: "Search…" }, skeleton: { label: "loading" }, slideover: { close: "Close" }, slider: { max: "Maximum", min: "Minimum", thumb: "Thumb", value: "Value {index} of {total}" }, stepper: { label: "progress" }, table: { noData: "No data" }, toast: { close: "Close" }, toaster: { label: "Notification", viewport: "Notifications ({hotkey})" } } }); const localeContextInjectionKey = Symbol.for("nuxt-ui.locale-context"); const _useLocale = (localeOverrides) => { const locale = localeOverrides || vue.toRef(vue.inject(localeContextInjectionKey, en)); return buildLocaleContext(vue.computed(() => locale.value || en)); }; const useLocale$1 = createSharedComposable(_useLocale); const state$2 = {}; const useState = (key, init2) => { if (state$2[key]) { return state$2[key]; } const value = vue.ref(init2()); state$2[key] = value; return value; }; const hooks = createHooks$1(); function useNuxtApp() { return { isHydrating: true, payload: { serverRendered: false }, hooks, hook: hooks.hook }; } function defineNuxtPlugin(plugin) { return { install(app2) { app2.runWithContext(() => plugin({ vueApp: app2 })); } }; } const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950]; function getColor(color, shade) { if (color in o && typeof o[color] === "object" && shade in o[color]) { return o[color][shade]; } return ""; } function generateShades(key, value, prefix) { const prefixStr = prefix ? `${prefix}-` : ""; return `${shades.map((shade) => `--ui-color-${key}-${shade}: var(--${prefixStr}color-${value === "neutral" ? "old-neutral" : value}-${shade}, ${getColor(value, shade)});`).join("\n ")}`; } function generateColor(key, shade) { return `--ui-${key}: var(--ui-color-${key}-${shade});`; } function removeTemporaryColorsStyle() { var _a2; (_a2 = document.querySelector("[data-nuxt-ui-colors]")) == null ? void 0 : _a2.remove(); } const D_58_47_25991_26723_47GitHub_47znhd_45service_47node_modules_47_64nuxt_47ui_47dist_47runtime_47plugins_47colors_46js = defineNuxtPlugin(() => { var _a2; const appConfig2 = useAppConfig(); useNuxtApp(); const root = vue.computed(() => { const { neutral, ...colors2 } = appConfig2.ui.colors; const prefix = appConfig2.ui.prefix; return `@layer theme { :root, :host { ${Object.entries(appConfig2.ui.colors).map(([key, value]) => generateShades(key, value, prefix)).join("\n ")} } :root, :host, .light { ${Object.keys(colors2).map((key) => generateColor(key, 500)).join("\n ")} } .dark { ${Object.keys(colors2).map((key) => generateColor(key, 400)).join("\n ")} } }`; }); const headData = { style: [{ innerHTML: root, tagPriority: "critical", id: "nuxt-ui-colors" }] }; { const style = document.createElement("style"); style.innerHTML = root.value; style.setAttribute("data-nuxt-ui-colors", ""); document.head.appendChild(style); const head = injectHead(); const unhook = (_a2 = head.hooks) == null ? void 0 : _a2.hook("dom:rendered", () => { removeTemporaryColorsStyle(); unhook == null ? void 0 : unhook(); }); } useHead(headData); }); const ui = { install(app2, pluginOptions = {}) { app2.use(D_58_47_25991_26723_47GitHub_47znhd_45service_47node_modules_47_64nuxt_47ui_47dist_47runtime_47vue_47plugins_47icons_46js, pluginOptions); app2.use(D_58_47_25991_26723_47GitHub_47znhd_45service_47node_modules_47_64nuxt_47ui_47dist_47runtime_47vue_47plugins_47head_46js, pluginOptions); app2.use(D_58_47_25991_26723_47GitHub_47znhd_45service_47node_modules_47_64nuxt_47ui_47dist_47runtime_47vue_47plugins_47router_46js, pluginOptions); app2.use(D_58_47_25991_26723_47GitHub_47znhd_45service_47node_modules_47_64nuxt_47ui_47dist_47runtime_47plugins_47colors_46js, pluginOptions); } }; function findValuesBetween(array, start, end) { const startIndex = array.findIndex((i) => isEqual$1(i, start)); const endIndex = array.findIndex((i) => isEqual$1(i, end)); if (startIndex === -1 || endIndex === -1) return []; const [minIndex, maxIndex] = [startIndex, endIndex].sort((a, b) => a - b); return array.slice(minIndex, maxIndex + 1); } function roundToStepPrecision(value, step) { let roundedValue = value; const stepString = step.toString(); const pointIndex = stepString.indexOf("."); const precision = pointIndex >= 0 ? stepString.length - pointIndex : 0; if (precision > 0) { const pow = 10 ** precision; roundedValue = Math.round(roundedValue * pow) / pow; } return roundedValue; } function snapValueToStep(value, min2, max2, step) { min2 = Number(min2); max2 = Number(max2); const remainder = (value - (Number.isNaN(min2) ? 0 : min2)) % step; let snappedValue = roundToStepPrecision(Math.abs(remainder) * 2 >= step ? value + Math.sign(remainder) * (step - Math.abs(remainder)) : value - remainder, step); if (!Number.isNaN(min2)) { if (snappedValue < min2) snappedValue = min2; else if (!Number.isNaN(max2) && snappedValue > max2) snappedValue = min2 + Math.floor(roundToStepPrecision((max2 - min2) / step, step)) * step; } else if (!Number.isNaN(max2) && snappedValue > max2) snappedValue = Math.floor(roundToStepPrecision(max2 / step, step)) * step; snappedValue = roundToStepPrecision(snappedValue, step); return snappedValue; } function createContext(providerComponentName, contextName) { const symbolDescription = typeof providerComponentName === "string" && !contextName ? `${providerComponentName}Context` : contextName; const injectionKey = Symbol(symbolDescription); const injectContext = (fallback) => { const context2 = vue.inject(injectionKey, fallback); if (context2) return context2; if (context2 === null) return context2; throw new Error(`Injection \`${injectionKey.toString()}\` not found. Component must be used within ${Array.isArray(providerComponentName) ? `one of the following components: ${providerComponentName.join(", ")}` : `\`${providerComponentName}\``}`); }; const provideContext = (contextValue) => { vue.provide(injectionKey, contextValue); return contextValue; }; return [injectContext, provideContext]; } function getActiveElement() { let activeElement = document.activeElement; if (activeElement == null) return null; while (activeElement != null && activeElement.shadowRoot != null && activeElement.shadowRoot.activeElement != null) activeElement = activeElement.shadowRoot.activeElement; return activeElement; } function handleAndDispatchCustomEvent$1(name, handler, detail) { const target = detail.originalEvent.target; const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail }); if (handler) target.addEventListener(name, handler, { once: true }); target.dispatchEvent(event); } function isHTMLElement$1(node) { var _a2, _b; if (typeof window === "undefined" || typeof node !== "object" || node === null) return false; const ownerWindow = (_b = (_a2 = node.ownerDocument) == null ? void 0 : _a2.defaultView) != null ? _b : window; return node instanceof HTMLElement || node instanceof ownerWindow.HTMLElement; } function isNullish(value) { return value === null || value === void 0; } function isValueEqualOrExist(base, current) { if (isNullish(base)) return false; if (Array.isArray(base)) return base.some((val) => isEqual$1(val, current)); else return isEqual$1(base, current); } const defaultWindow = isClient ? window : void 0; function unrefElement(elRef) { var _$el; const plain = vue.toValue(elRef); return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain; } function useEventListener(...args) { const register = (el, event, listener, options) => { el.addEventListener(event, listener, options); return () => el.removeEventListener(event, listener, options); }; const firstParamTargets = vue.computed(() => { const test = toArray(vue.toValue(args[0])).filter((e) => e != null); return test.every((e) => typeof e !== "string") ? test : void 0; }); return watchImmediate(() => { var _firstParamTargets$va, _firstParamTargets$va2; return [ (_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null), toArray(vue.toValue(firstParamTargets.value ? args[1] : args[0])), toArray(vue.unref(firstParamTargets.value ? args[2] : args[1])), vue.toValue(firstParamTargets.value ? args[3] : args[2]) ]; }, ([raw_targets, raw_events, raw_listeners, raw_options], _2, onCleanup) => { if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return; const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options; const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone)))); onCleanup(() => { cleanups.forEach((fn) => fn()); }); }, { flush: "post" }); } function useMounted() { const isMounted = vue.shallowRef(false); const instance = vue.getCurrentInstance(); if (instance) vue.onMounted(() => { isMounted.value = true; }, instance); return isMounted; } function useSupported(callback) { const isMounted = useMounted(); return vue.computed(() => { isMounted.value; return Boolean(callback()); }); } function useMutationObserver(target, callback, options = {}) { const { window: window2 = defaultWindow, ...mutationOptions } = options; let observer2; const isSupported = useSupported(() => window2 && "MutationObserver" in window2); const cleanup = () => { if (observer2) { observer2.disconnect(); observer2 = void 0; } }; const stopWatch = vue.watch(vue.computed(() => { const items = toArray(vue.toValue(target)).map(unrefElement).filter(notNullish); return new Set(items); }), (newTargets) => { cleanup(); if (isSupported.value && newTargets.size) { observer2 = new MutationObserver(callback); newTargets.forEach((el) => observer2.observe(el, mutationOptions)); } }, { immediate: true, flush: "post" }); const takeRecords = () => { return observer2 === null || observer2 === void 0 ? void 0 : observer2.takeRecords(); }; const stop = () => { stopWatch(); cleanup(); }; tryOnScopeDispose(stop); return { isSupported, stop, takeRecords }; } function onElementRemoval(target, callback, options = {}) { const { window: window2 = defaultWindow, document: document2 = window2 === null || window2 === void 0 ? void 0 : window2.document, flush = "sync" } = options; if (!window2 || !document2) return noop; let stopFn; const cleanupAndUpdate = (fn) => { stopFn === null || stopFn === void 0 || stopFn(); stopFn = fn; }; const stopWatch = vue.watchEffect(() => { const el = unrefElement(target); if (el) { const { stop } = useMutationObserver(document2, (mutationsList) => { if (mutationsList.map((mutation) => [...mutation.removedNodes]).flat().some((node) => node === el || node.contains(el))) callback(mutationsList); }, { window: window2, childList: true, subtree: true }); cleanupAndUpdate(stop); } }, { flush }); const stopHandle = () => { stopWatch(); cleanupAndUpdate(); }; tryOnScopeDispose(stopHandle); return stopHandle; } function createKeyPredicate(keyFilter) { if (typeof keyFilter === "function") return keyFilter; else if (typeof keyFilter === "string") return (event) => event.key === keyFilter; else if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key); return () => true; } function onKeyStroke(...args) { let key; let handler; let options = {}; if (args.length === 3) { key = args[0]; handler = args[1]; options = args[2]; } else if (args.length === 2) if (typeof args[1] === "object") { key = true; handler = args[0]; options = args[1]; } else { key = args[0]; handler = args[1]; } else { key = true; handler = args[0]; } const { target = defaultWindow, eventName = "keydown", passive = false, dedupe = false } = options; const predicate = createKeyPredicate(key); const listener = (e) => { if (e.repeat && vue.toValue(dedupe)) return; if (predicate(e)) handler(e); }; return useEventListener(target, eventName, listener, passive); } function useActiveElement(options = {}) { var _options$document; const { window: window2 = defaultWindow, deep = true, triggerOnRemoval = false } = options; const document2 = (_options$document = options.document) !== null && _options$document !== void 0 ? _options$document : window2 === null || window2 === void 0 ? void 0 : window2.document; const getDeepActiveElement = () => { let element = document2 === null || document2 === void 0 ? void 0 : document2.activeElement; if (deep) { var _element$shadowRoot; while (element === null || element === void 0 ? void 0 : element.shadowRoot) element = element === null || element === void 0 || (_element$shadowRoot = element.shadowRoot) === null || _element$shadowRoot === void 0 ? void 0 : _element$shadowRoot.activeElement; } return element; }; const activeElement = vue.shallowRef(); const trigger = () => { activeElement.value = getDeepActiveElement(); }; if (window2) { const listenerOptions = { capture: true, passive: true }; useEventListener(window2, "blur", (event) => { if (event.relatedTarget !== null) return; trigger(); }, listenerOptions); useEventListener(window2, "focus", trigger, listenerOptions); } if (triggerOnRemoval) onElementRemoval(activeElement, trigger, { document: document2 }); trigger(); return activeElement; } function useRafFn(fn, options = {}) { const { immediate = true, fpsLimit = null, window: window2 = defaultWindow, once = false } = options; const isActive = vue.shallowRef(false); const intervalLimit = vue.computed(() => { const limit = vue.toValue(fpsLimit); return limit ? 1e3 / limit : null; }); let previousFrameTimestamp = 0; let rafId = null; function loop(timestamp) { if (!isActive.value || !window2) return; if (!previousFrameTimestamp) previousFrameTimestamp = timestamp; const delta = timestamp - previousFrameTimestamp; if (intervalLimit.value && delta < intervalLimit.value) { rafId = window2.requestAnimationFrame(loop); return; } previousFrameTimestamp = timestamp; fn({ delta, timestamp }); if (once) { isActive.value = false; rafId = null; return; } rafId = window2.requestAnimationFrame(loop); } function resume() { if (!isActive.value && window2) { isActive.value = true; previousFrameTimestamp = 0; rafId = window2.requestAnimationFrame(loop); } } function pause() { isActive.value = false; if (rafId != null && window2) { window2.cancelAnimationFrame(rafId); rafId = null; } } if (immediate) resume(); tryOnScopeDispose(pause); return { isActive: vue.shallowReadonly(isActive), pause, resume }; } function cloneFnJSON(source) { return JSON.parse(JSON.stringify(source)); } function useCurrentElement(rootComponent) { const vm = vue.getCurrentInstance(); const currentElement = computedWithControl(() => null, () => vm.proxy.$el); vue.onUpdated(currentElement.trigger); vue.onMounted(currentElement.trigger); return currentElement; } function useResizeObserver(target, callback, options = {}) { const { window: window2 = defaultWindow, ...observerOptions } = options; let observer2; const isSupported = useSupported(() => window2 && "ResizeObserver" in window2); const cleanup = () => { if (observer2) { observer2.disconnect(); observer2 = void 0; } }; const stopWatch = vue.watch(vue.computed(() => { const _targets = vue.toValue(target); return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)]; }), (els) => { cleanup(); if (isSupported.value && window2) { observer2 = new ResizeObserver(callback); for (const _el of els) if (_el) observer2.observe(_el, observerOptions); } }, { immediate: true, flush: "post" }); const stop = () => { cleanup(); stopWatch(); }; tryOnScopeDispose(stop); return { isSupported, stop }; } const EVENT_FOCUS_IN = "focusin"; const EVENT_FOCUS_OUT = "focusout"; const PSEUDO_CLASS_FOCUS_WITHIN = ":focus-within"; function useFocusWithin(target, options = {}) { const { window: window2 = defaultWindow } = options; const targetElement = vue.computed(() => unrefElement(target)); const _focused = vue.shallowRef(false); const focused = vue.computed(() => _focused.value); const activeElement = useActiveElement(options); if (!window2 || !activeElement.value) return { focused }; const listenerOptions = { passive: true }; useEventListener(targetElement, EVENT_FOCUS_IN, () => _focused.value = true, listenerOptions); useEventListener(targetElement, EVENT_FOCUS_OUT, () => { var _targetElement$value$, _targetElement$value, _targetElement$value$2; return _focused.value = (_targetElement$value$ = (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || (_targetElement$value$2 = _targetElement$value.matches) === null || _targetElement$value$2 === void 0 ? void 0 : _targetElement$value$2.call(_targetElement$value, PSEUDO_CLASS_FOCUS_WITHIN)) !== null && _targetElement$value$ !== void 0 ? _targetElement$value$ : false; }, listenerOptions); return { focused }; } function useParentElement(element = useCurrentElement()) { const parentElement = vue.shallowRef(); const update = () => { const el = unrefElement(element); if (el) parentElement.value = el.parentElement; }; tryOnMounted(update); vue.watch(() => vue.toValue(element), update); return parentElement; } function useVModel(props, key, emit2, options = {}) { var _vm$$emit, _vm$proxy; const { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options; const vm = vue.getCurrentInstance(); const _emit = emit2 || (vm === null || vm === void 0 ? void 0 : vm.emit) || (vm === null || vm === void 0 || (_vm$$emit = vm.$emit) === null || _vm$$emit === void 0 ? void 0 : _vm$$emit.bind(vm)) || (vm === null || vm === void 0 || (_vm$proxy = vm.proxy) === null || _vm$proxy === void 0 || (_vm$proxy = _vm$proxy.$emit) === null || _vm$proxy === void 0 ? void 0 : _vm$proxy.bind(vm === null || vm === void 0 ? void 0 : vm.proxy)); let event = eventName; if (!key) key = "modelValue"; event = event || `update:${key.toString()}`; const cloneFn = (val) => !clone ? val : typeof clone === "function" ? clone(val) : cloneFnJSON(val); const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue; const triggerEmit = (value) => { if (shouldEmit) { if (shouldEmit(value)) _emit(event, value); } else _emit(event, value); }; if (passive) { const proxy = vue.ref(getValue()); let isUpdating = false; vue.watch(() => props[key], (v) => { if (!isUpdating) { isUpdating = true; proxy.value = cloneFn(v); vue.nextTick(() => isUpdating = false); } }); vue.watch(proxy, (v) => { if (!isUpdating && (v !== props[key] || deep)) triggerEmit(v); }, { deep }); return proxy; } else return vue.computed({ get() { return getValue(); }, set(value) { triggerEmit(value); } }); } function renderSlotFragments(children) { if (!children) return []; return children.flatMap((child) => { if (child.type === vue.Fragment) return renderSlotFragments(child.children); return [child]; }); } const ignoredElement = ["INPUT", "TEXTAREA"]; function useArrowNavigation(e, currentElement, parentElement, options = {}) { if (!currentElement || options.enableIgnoredElement && ignoredElement.includes(currentElement.nodeName)) return null; const { arrowKeyOptions = "both", attributeName = "[data-reka-collection-item]", itemsArray = [], loop = true, dir = "ltr", preventScroll = true, focus: focus2 = false } = options; const [right, left, up, down, home, end] = [ e.key === "ArrowRight", e.key === "ArrowLeft", e.key === "ArrowUp", e.key === "ArrowDown", e.key === "Home", e.key === "End" ]; const goingVertical = up || down; const goingHorizontal = right || left; if (!home && !end && (!goingVertical && !goingHorizontal || arrowKeyOptions === "vertical" && goingHorizontal || arrowKeyOptions === "horizontal" && goingVertical)) return null; const allCollectionItems = parentElement ? Array.from(parentElement.querySelectorAll(attributeName)) : itemsArray; if (!allCollectionItems.length) return null; if (preventScroll) e.preventDefault(); let item = null; if (goingHorizontal || goingVertical) { const goForward = goingVertical ? down : dir === "ltr" ? right : left; item = findNextFocusableElement(allCollectionItems, currentElement, { goForward, loop }); } else if (home) item = allCollectionItems.at(0) || null; else if (end) item = allCollectionItems.at(-1) || null; if (focus2) item == null ? void 0 : item.focus(); return item; } function findNextFocusableElement(elements, currentElement, options, iterations = !elements.includes(currentElement) ? elements.length + 1 : elements.length) { if (--iterations === 0) return null; const index = elements.indexOf(currentElement); let newIndex; if (index === -1) newIndex = options.goForward ? 0 : elements.length - 1; else newIndex = options.goForward ? index + 1 : index - 1; if (!options.loop && (newIndex < 0 || newIndex >= elements.length)) return null; const adjustedNewIndex = (newIndex + elements.length) % elements.length; const candidate = elements[adjustedNewIndex]; if (!candidate) return null; const isDisabled = candidate.hasAttribute("disabled") && candidate.getAttribute("disabled") !== "false"; if (isDisabled) return findNextFocusableElement(elements, candidate, options, iterations); return candidate; } const [injectConfigProviderContext, provideConfigProviderContext] = createContext("ConfigProvider"); var ConfigProvider_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "ConfigProvider", props: { dir: { type: String, required: false, default: "ltr" }, locale: { type: String, required: false, default: "en" }, scrollBody: { type: [Boolean, Object], required: false, default: true }, nonce: { type: String, required: false, default: void 0 }, teleportTo: { type: null, required: false, default: void 0 }, useId: { type: Function, required: false, default: void 0 } }, setup(__props) { const props = __props; const { dir, locale, scrollBody, nonce, teleportTo } = vue.toRefs(props); provideConfigProviderContext({ dir, locale, scrollBody, nonce, teleportTo, useId: props.useId }); return (_ctx, _cache) => { return vue.renderSlot(_ctx.$slots, "default"); }; } }); var ConfigProvider_default = ConfigProvider_vue_vue_type_script_setup_true_lang_default; const locks = new WeakMap(); function acquireBodyPointerEvents(doc2, owner) { let lock = locks.get(doc2); if (!lock) { lock = { owners: new Set(), original: doc2.body.style.pointerEvents }; locks.set(doc2, lock); } lock.owners.add(owner); doc2.body.style.pointerEvents = "none"; } function releaseBodyPointerEvents(doc2, owner) { const lock = locks.get(doc2); if (!(lock == null ? void 0 : lock.owners.delete(owner))) return; if (lock.owners.size === 0) { locks.delete(doc2); doc2.body.style.pointerEvents = lock.original; } } const pointerEventsOwner = Symbol("useBodyScrollLock"); const useBodyLockStackCount = createSharedComposable(() => { const map = vue.ref( new Map()); const initialOverflow = vue.ref(); const locked = vue.computed(() => { for (const value of map.value.values()) if (value) return true; return false; }); const context2 = injectConfigProviderContext({ scrollBody: vue.ref(true) }); const resetBodyStyle = () => { var _a2; document.body.style.paddingRight = ""; document.body.style.marginRight = ""; releaseBodyPointerEvents(document, pointerEventsOwner); document.documentElement.style.removeProperty("--scrollbar-width"); document.body.style.overflow = (_a2 = initialOverflow.value) != null ? _a2 : ""; initialOverflow.value = void 0; }; vue.watch(locked, (val, oldVal) => { var _a2; if (!isClient) return; if (!val) { if (oldVal) resetBodyStyle(); return; } if (initialOverflow.value === void 0) initialOverflow.value = document.body.style.overflow; const verticalScrollbarWidth = window.innerWidth - document.documentElement.clientWidth; const defaultConfig2 = { padding: verticalScrollbarWidth, margin: 0 }; const config2 = ((_a2 = context2.scrollBody) == null ? void 0 : _a2.value) ? typeof context2.scrollBody.value === "object" ? defu({ padding: context2.scrollBody.value.padding === true ? verticalScrollbarWidth : context2.scrollBody.value.padding, margin: context2.scrollBody.value.margin === true ? verticalScrollbarWidth : context2.scrollBody.value.margin }, defaultConfig2) : defaultConfig2 : { padding: 0, margin: 0 }; if (verticalScrollbarWidth > 0) { document.body.style.paddingRight = typeof config2.padding === "number" ? `${config2.padding}px` : String(config2.padding); document.body.style.marginRight = typeof config2.margin === "number" ? `${config2.margin}px` : String(config2.margin); document.documentElement.style.setProperty("--scrollbar-width", `${verticalScrollbarWidth}px`); document.body.style.overflow = "hidden"; } vue.nextTick(() => { if (!locked.value) return; acquireBodyPointerEvents(document, pointerEventsOwner); document.body.style.overflow = "hidden"; }); }, { immediate: true, flush: "sync" }); return map; }); function useBodyScrollLock(initialState) { const id = Math.random().toString(36).substring(2, 7); const map = useBodyLockStackCount(); map.value.set(id, initialState != null ? initialState : false); const locked = vue.computed({ get: () => { var _a2; return (_a2 = map.value.get(id)) != null ? _a2 : false; }, set: (value) => map.value.set(id, value) }); tryOnBeforeUnmount(() => { map.value.delete(id); }); return locked; } function $09ec6a572d60460f$export$842a2cf37af977e1(amount, numerator) { return amount - numerator * Math.floor(amount / numerator); } const $93635573935797de$var$EPOCH = 1721426; function $93635573935797de$export$f297eb839006d339(era, year, month, day) { year = $93635573935797de$export$c36e0ecb2d4fa69d(era, year); let y1 = year - 1; let monthOffset = -2; if (month <= 2) monthOffset = 0; else if ($93635573935797de$export$553d7fa8e3805fc0(year)) monthOffset = -1; return $93635573935797de$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day); } function $93635573935797de$export$553d7fa8e3805fc0(year) { return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); } function $93635573935797de$export$c36e0ecb2d4fa69d(era, year) { return era === "BC" ? 1 - year : year; } function $93635573935797de$export$4475b7e617eb123c(year) { let era = "AD"; if (year <= 0) { era = "BC"; year = 1 - year; } return [ era, year ]; } const $93635573935797de$var$daysInMonth = { standard: [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ], leapyear: [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ] }; class $93635573935797de$export$80ee6245ec4f29ec { fromJulianDay(jd) { let jd0 = jd; let depoch = jd0 - $93635573935797de$var$EPOCH; let quadricent = Math.floor(depoch / 146097); let dqc = $09ec6a572d60460f$export$842a2cf37af977e1(depoch, 146097); let cent = Math.floor(dqc / 36524); let dcent = $09ec6a572d60460f$export$842a2cf37af977e1(dqc, 36524); let quad = Math.floor(dcent / 1461); let dquad = $09ec6a572d60460f$export$842a2cf37af977e1(dcent, 1461); let yindex = Math.floor(dquad / 365); let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0); let [era, year] = $93635573935797de$export$4475b7e617eb123c(extendedYear); let yearDay = jd0 - $93635573935797de$export$f297eb839006d339(era, year, 1, 1); let leapAdj = 2; if (jd0 < $93635573935797de$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0; else if ($93635573935797de$export$553d7fa8e3805fc0(year)) leapAdj = 1; let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367); let day = jd0 - $93635573935797de$export$f297eb839006d339(era, year, month, 1) + 1; return new $2aaf608024c21ca1$export$99faa760c7908e4f(era, year, month, day); } toJulianDay(date) { return $93635573935797de$export$f297eb839006d339(date.era, date.year, date.month, date.day); } getDaysInMonth(date) { return $93635573935797de$var$daysInMonth[$93635573935797de$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1]; } getMonthsInYear(date) { return 12; } getDaysInYear(date) { return $93635573935797de$export$553d7fa8e3805fc0(date.year) ? 366 : 365; } getMaximumMonthsInYear() { return 12; } getMaximumDaysInMonth() { return 31; } getYearsInEra(date) { return 9999; } getEras() { return [ "BC", "AD" ]; } isInverseEra(date) { return date.era === "BC"; } balanceDate(date) { if (date.year <= 0) { date.era = date.era === "BC" ? "AD" : "BC"; date.year = 1 - date.year; } } constructor() { this.identifier = "gregory"; } } function $ad063034c8620db8$export$ea39ec197993aef0(a, b) { b = $d07e34cce18680fd$export$b4a036af3fc0b032(b, a.calendar); return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day; } function $ad063034c8620db8$export$91b62ebf2ba703ee(a, b) { return $ad063034c8620db8$export$dbc69fd56b53d5e(a.calendar, b.calendar) && $ad063034c8620db8$export$ea39ec197993aef0(a, b); } function $ad063034c8620db8$export$dbc69fd56b53d5e(a, b) { var _a2, _b, _c, _d; return (_d = (_c = (_a2 = a.isEqual) == null ? void 0 : _a2.call(a, b)) != null ? _c : (_b = b.isEqual) == null ? void 0 : _b.call(b, a)) != null ? _d : a.identifier === b.identifier; } function $ad063034c8620db8$export$461939dd4422153(timeZone) { return $d07e34cce18680fd$export$1b96692a1ba042ac(Date.now(), timeZone); } function $ad063034c8620db8$export$d0bdf45af03a6ea3(timeZone) { return $d07e34cce18680fd$export$93522d1a439f3617($ad063034c8620db8$export$461939dd4422153(timeZone)); } function $ad063034c8620db8$export$68781ddf31c0090f(a, b) { return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b); } function $ad063034c8620db8$export$c19a80a9721b80f6(a, b) { return $ad063034c8620db8$var$timeToMs(a) - $ad063034c8620db8$var$timeToMs(b); } function $ad063034c8620db8$var$timeToMs(a) { return a.hour * 36e5 + a.minute * 6e4 + a.second * 1e3 + a.millisecond; } let $ad063034c8620db8$var$localTimeZone = null; function $ad063034c8620db8$export$aa8b41735afcabd2() { if ($ad063034c8620db8$var$localTimeZone == null) $ad063034c8620db8$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone; return $ad063034c8620db8$var$localTimeZone; } function $d07e34cce18680fd$export$bd4fb2bc8bb06fb(date) { date = $d07e34cce18680fd$export$b4a036af3fc0b032(date, new $93635573935797de$export$80ee6245ec4f29ec()); let year = $93635573935797de$export$c36e0ecb2d4fa69d(date.era, date.year); return $d07e34cce18680fd$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond); } function $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, millisecond) { let date = new Date(); date.setUTCHours(hour, minute, second, millisecond); date.setUTCFullYear(year, month - 1, day); return date.getTime(); } function $d07e34cce18680fd$export$59c99f3515d3493f(ms, timeZone) { if (timeZone === "UTC") return 0; if (ms > 0 && timeZone === $ad063034c8620db8$export$aa8b41735afcabd2() && true) return new Date(ms).getTimezoneOffset() * -6e4; let { year, month, day, hour, minute, second } = $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone); let utc = $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, 0); return utc - Math.floor(ms / 1e3) * 1e3; } const $d07e34cce18680fd$var$formattersByTimeZone = new Map(); function $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone) { let formatter = $d07e34cce18680fd$var$formattersByTimeZone.get(timeZone); if (!formatter) { formatter = new Intl.DateTimeFormat("en-US", { timeZone, hour12: false, era: "short", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }); $d07e34cce18680fd$var$formattersByTimeZone.set(timeZone, formatter); } let parts = formatter.formatToParts(new Date(ms)); let namedParts = {}; for (let part of parts) if (part.type !== "literal") namedParts[part.type] = part.value; return { year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year, month: +namedParts.month, day: +namedParts.day, hour: namedParts.hour === "24" ? 0 : +namedParts.hour, minute: +namedParts.minute, second: +namedParts.second }; } const $d07e34cce18680fd$var$DAYMILLIS = 864e5; function $d07e34cce18680fd$var$getValidWallTimes(date, timeZone, earlier, later) { let found = earlier === later ? [ earlier ] : [ earlier, later ]; return found.filter((absolute) => $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute)); } function $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute) { let parts = $d07e34cce18680fd$var$getTimeZoneParts(absolute, timeZone); return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second; } function $d07e34cce18680fd$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") { let dateTime = $d07e34cce18680fd$export$b21e0b124e224484(date); if (timeZone === "UTC") return $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime); if (timeZone === $ad063034c8620db8$export$aa8b41735afcabd2() && disambiguation === "compatible" && true) { dateTime = $d07e34cce18680fd$export$b4a036af3fc0b032(dateTime, new $93635573935797de$export$80ee6245ec4f29ec()); let date2 = new Date(); let year = $93635573935797de$export$c36e0ecb2d4fa69d(dateTime.era, dateTime.year); date2.setFullYear(year, dateTime.month - 1, dateTime.day); date2.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond); return date2.getTime(); } let ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime); let offsetBefore = $d07e34cce18680fd$export$59c99f3515d3493f(ms - $d07e34cce18680fd$var$DAYMILLIS, timeZone); let offsetAfter = $d07e34cce18680fd$export$59c99f3515d3493f(ms + $d07e34cce18680fd$var$DAYMILLIS, timeZone); let valid = $d07e34cce18680fd$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter); if (valid.length === 1) return valid[0]; if (valid.length > 1) switch (disambiguation) { case "compatible": case "earlier": return valid[0]; case "later": return valid[valid.length - 1]; case "reject": throw new RangeError("Multiple possible absolute times found"); } switch (disambiguation) { case "earlier": return Math.min(ms - offsetBefore, ms - offsetAfter); case "compatible": case "later": return Math.max(ms - offsetBefore, ms - offsetAfter); case "reject": throw new RangeError("No such absolute time found"); } } function $d07e34cce18680fd$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") { return new Date($d07e34cce18680fd$export$5107c82f94518f5c(dateTime, timeZone, disambiguation)); } function $d07e34cce18680fd$export$1b96692a1ba042ac(ms, timeZone) { let offset2 = $d07e34cce18680fd$export$59c99f3515d3493f(ms, timeZone); let date = new Date(ms + offset2); let year = date.getUTCFullYear(); let month = date.getUTCMonth() + 1; let day = date.getUTCDate(); let hour = date.getUTCHours(); let minute = date.getUTCMinutes(); let second = date.getUTCSeconds(); let millisecond = date.getUTCMilliseconds(); return new $2aaf608024c21ca1$export$d3b7288e7994edea(year < 1 ? "BC" : "AD", year < 1 ? -year + 1 : year, month, day, timeZone, offset2, hour, minute, second, millisecond); } function $d07e34cce18680fd$export$93522d1a439f3617(dateTime) { return new $2aaf608024c21ca1$export$99faa760c7908e4f(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day); } function $d07e34cce18680fd$export$b21e0b124e224484(date, time) { let hour = 0, minute = 0, second = 0, millisecond = 0; if ("timeZone" in date) ({ hour, minute, second, millisecond } = date); else if ("hour" in date && !time) return date; if (time) ({ hour, minute, second, millisecond } = time); return new $2aaf608024c21ca1$export$ca871e8dbb80966f(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond); } function $d07e34cce18680fd$export$b4a036af3fc0b032(date, calendar) { if ($ad063034c8620db8$export$dbc69fd56b53d5e(date.calendar, calendar)) return date; let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date)); let copy = date.copy(); copy.calendar = calendar; copy.era = calendarDate.era; copy.year = calendarDate.year; copy.month = calendarDate.month; copy.day = calendarDate.day; $435a2ceaa8778ed8$export$c4e2ecac49351ef2(copy); return copy; } function $d07e34cce18680fd$export$84c95a83c799e074(date, timeZone, disambiguation) { if (date instanceof $2aaf608024c21ca1$export$d3b7288e7994edea) { if (date.timeZone === timeZone) return date; return $d07e34cce18680fd$export$538b00033cc11c75(date, timeZone); } let ms = $d07e34cce18680fd$export$5107c82f94518f5c(date, timeZone, disambiguation); return $d07e34cce18680fd$export$1b96692a1ba042ac(ms, timeZone); } function $d07e34cce18680fd$export$83aac07b4c37b25(date) { let ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(date) - date.offset; return new Date(ms); } function $d07e34cce18680fd$export$538b00033cc11c75(date, timeZone) { let ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(date) - date.offset; return $d07e34cce18680fd$export$b4a036af3fc0b032($d07e34cce18680fd$export$1b96692a1ba042ac(ms, timeZone), date.calendar); } const $435a2ceaa8778ed8$var$ONE_HOUR = 36e5; function $435a2ceaa8778ed8$export$e16d8520af44a096(date, duration) { var _a2, _b; let mutableDate = date.copy(); let days = "hour" in mutableDate ? $435a2ceaa8778ed8$var$addTimeFields(mutableDate, duration) : 0; $435a2ceaa8778ed8$var$addYears(mutableDate, duration.years || 0); if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date); mutableDate.month += duration.months || 0; $435a2ceaa8778ed8$var$balanceYearMonth(mutableDate); $435a2ceaa8778ed8$var$constrainMonthDay(mutableDate); mutableDate.day += (duration.weeks || 0) * 7; mutableDate.day += duration.days || 0; mutableDate.day += days; $435a2ceaa8778ed8$var$balanceDay(mutableDate); if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate); if (mutableDate.year < 1) { mutableDate.year = 1; mutableDate.month = 1; mutableDate.day = 1; } let maxYear = mutableDate.calendar.getYearsInEra(mutableDate); if (mutableDate.year > maxYear) { let isInverseEra = (_b = (_a2 = mutableDate.calendar).isInverseEra) == null ? void 0 : _b.call(_a2, mutableDate); mutableDate.year = maxYear; mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate); mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate); } if (mutableDate.month < 1) { mutableDate.month = 1; mutableDate.day = 1; } let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate); if (mutableDate.month > maxMonth) { mutableDate.month = maxMonth; mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate); } mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day)); return mutableDate; } function $435a2ceaa8778ed8$var$addYears(date, years) { var _a2, _b; if ((_b = (_a2 = date.calendar).isInverseEra) == null ? void 0 : _b.call(_a2, date)) years = -years; date.year += years; } function $435a2ceaa8778ed8$var$balanceYearMonth(date) { while (date.month < 1) { $435a2ceaa8778ed8$var$addYears(date, -1); date.month += date.calendar.getMonthsInYear(date); } let monthsInYear = 0; while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) { date.month -= monthsInYear; $435a2ceaa8778ed8$var$addYears(date, 1); } } function $435a2ceaa8778ed8$var$balanceDay(date) { while (date.day < 1) { date.month--; $435a2ceaa8778ed8$var$balanceYearMonth(date); date.day += date.calendar.getDaysInMonth(date); } while (date.day > date.calendar.getDaysInMonth(date)) { date.day -= date.calendar.getDaysInMonth(date); date.month++; $435a2ceaa8778ed8$var$balanceYearMonth(date); } } function $435a2ceaa8778ed8$var$constrainMonthDay(date) { date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month)); date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day)); } function $435a2ceaa8778ed8$export$c4e2ecac49351ef2(date) { if (date.calendar.constrainDate) date.calendar.constrainDate(date); date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year)); $435a2ceaa8778ed8$var$constrainMonthDay(date); } function $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration) { let inverseDuration = {}; for (let key in duration) if (typeof duration[key] === "number") inverseDuration[key] = -duration[key]; return inverseDuration; } function $435a2ceaa8778ed8$export$4e2d2ead65e5f7e3(date, duration) { return $435a2ceaa8778ed8$export$e16d8520af44a096(date, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration)); } function $435a2ceaa8778ed8$export$adaa4cf7ef1b65be(date, fields) { let mutableDate = date.copy(); if (fields.era != null) mutableDate.era = fields.era; if (fields.year != null) mutableDate.year = fields.year; if (fields.month != null) mutableDate.month = fields.month; if (fields.day != null) mutableDate.day = fields.day; $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutableDate); return mutableDate; } function $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(value, fields) { let mutableValue = value.copy(); if (fields.hour != null) mutableValue.hour = fields.hour; if (fields.minute != null) mutableValue.minute = fields.minute; if (fields.second != null) mutableValue.second = fields.second; if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond; $435a2ceaa8778ed8$export$7555de1e070510cb(mutableValue); return mutableValue; } function $435a2ceaa8778ed8$var$balanceTime(time) { time.second += Math.floor(time.millisecond / 1e3); time.millisecond = $435a2ceaa8778ed8$var$nonNegativeMod(time.millisecond, 1e3); time.minute += Math.floor(time.second / 60); time.second = $435a2ceaa8778ed8$var$nonNegativeMod(time.second, 60); time.hour += Math.floor(time.minute / 60); time.minute = $435a2ceaa8778ed8$var$nonNegativeMod(time.minute, 60); let days = Math.floor(time.hour / 24); time.hour = $435a2ceaa8778ed8$var$nonNegativeMod(time.hour, 24); return days; } function $435a2ceaa8778ed8$export$7555de1e070510cb(time) { time.millisecond = Math.max(0, Math.min(time.millisecond, 999)); time.second = Math.max(0, Math.min(time.second, 59)); time.minute = Math.max(0, Math.min(time.minute, 59)); time.hour = Math.max(0, Math.min(time.hour, 23)); } function $435a2ceaa8778ed8$var$nonNegativeMod(a, b) { let result = a % b; if (result < 0) result += b; return result; } function $435a2ceaa8778ed8$var$addTimeFields(time, duration) { time.hour += duration.hours || 0; time.minute += duration.minutes || 0; time.second += duration.seconds || 0; time.millisecond += duration.milliseconds || 0; return $435a2ceaa8778ed8$var$balanceTime(time); } function $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, duration) { let res = time.copy(); $435a2ceaa8778ed8$var$addTimeFields(res, duration); return res; } function $435a2ceaa8778ed8$export$fe34d3a381cd7501(time, duration) { return $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration)); } function $435a2ceaa8778ed8$export$d52ced6badfb9a4c(value, field, amount, options) { var _a2, _b; let mutable = value.copy(); switch (field) { case "era": { let eras = value.calendar.getEras(); let eraIndex = eras.indexOf(value.era); if (eraIndex < 0) throw new Error("Invalid era: " + value.era); eraIndex = $435a2ceaa8778ed8$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options == null ? void 0 : options.round); mutable.era = eras[eraIndex]; $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable); break; } case "year": if ((_b = (_a2 = mutable.calendar).isInverseEra) == null ? void 0 : _b.call(_a2, mutable)) amount = -amount; mutable.year = $435a2ceaa8778ed8$var$cycleValue(value.year, amount, -Infinity, 9999, options == null ? void 0 : options.round); if (mutable.year === -Infinity) mutable.year = 1; if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value); break; case "month": mutable.month = $435a2ceaa8778ed8$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options == null ? void 0 : options.round); break; case "day": mutable.day = $435a2ceaa8778ed8$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options == null ? void 0 : options.round); break; default: throw new Error("Unsupported field " + field); } if (value.calendar.balanceDate) value.calendar.balanceDate(mutable); $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable); return mutable; } function $435a2ceaa8778ed8$export$dd02b3e0007dfe28(value, field, amount, options) { let mutable = value.copy(); switch (field) { case "hour": { let hours = value.hour; let min2 = 0; let max2 = 23; if ((options == null ? void 0 : options.hourCycle) === 12) { let isPM = hours >= 12; min2 = isPM ? 12 : 0; max2 = isPM ? 23 : 11; } mutable.hour = $435a2ceaa8778ed8$var$cycleValue(hours, amount, min2, max2, options == null ? void 0 : options.round); break; } case "minute": mutable.minute = $435a2ceaa8778ed8$var$cycleValue(value.minute, amount, 0, 59, options == null ? void 0 : options.round); break; case "second": mutable.second = $435a2ceaa8778ed8$var$cycleValue(value.second, amount, 0, 59, options == null ? void 0 : options.round); break; case "millisecond": mutable.millisecond = $435a2ceaa8778ed8$var$cycleValue(value.millisecond, amount, 0, 999, options == null ? void 0 : options.round); break; default: throw new Error("Unsupported field " + field); } return mutable; } function $435a2ceaa8778ed8$var$cycleValue(value, amount, min2, max2, round2 = false) { if (round2) { value += Math.sign(amount); if (value < min2) value = max2; let div = Math.abs(amount); if (amount > 0) value = Math.ceil(value / div) * div; else value = Math.floor(value / div) * div; if (value > max2) value = min2; } else { value += amount; if (value < min2) value = max2 - (min2 - value - 1); else if (value > max2) value = min2 + (value - max2 - 1); } return value; } function $435a2ceaa8778ed8$export$96b1d28349274637(dateTime, duration) { let ms; if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.weeks != null && duration.weeks !== 0 || duration.days != null && duration.days !== 0) { let res2 = $435a2ceaa8778ed8$export$e16d8520af44a096($d07e34cce18680fd$export$b21e0b124e224484(dateTime), { years: duration.years, months: duration.months, weeks: duration.weeks, days: duration.days }); ms = $d07e34cce18680fd$export$5107c82f94518f5c(res2, dateTime.timeZone); } else ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset; ms += duration.milliseconds || 0; ms += (duration.seconds || 0) * 1e3; ms += (duration.minutes || 0) * 6e4; ms += (duration.hours || 0) * 36e5; let res = $d07e34cce18680fd$export$1b96692a1ba042ac(ms, dateTime.timeZone); return $d07e34cce18680fd$export$b4a036af3fc0b032(res, dateTime.calendar); } function $435a2ceaa8778ed8$export$6814caac34ca03c7(dateTime, duration) { return $435a2ceaa8778ed8$export$96b1d28349274637(dateTime, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration)); } function $435a2ceaa8778ed8$export$9a297d111fc86b79(dateTime, field, amount, options) { switch (field) { case "hour": { let min2 = 0; let max2 = 23; if ((options == null ? void 0 : options.hourCycle) === 12) { let isPM = dateTime.hour >= 12; min2 = isPM ? 12 : 0; max2 = isPM ? 23 : 11; } let plainDateTime = $d07e34cce18680fd$export$b21e0b124e224484(dateTime); let minDate = $d07e34cce18680fd$export$b4a036af3fc0b032($435a2ceaa8778ed8$export$e5d5e1c1822b6e56(plainDateTime, { hour: min2 }), new $93635573935797de$export$80ee6245ec4f29ec()); let minAbsolute = [ $d07e34cce18680fd$export$5107c82f94518f5c(minDate, dateTime.timeZone, "earlier"), $d07e34cce18680fd$export$5107c82f94518f5c(minDate, dateTime.timeZone, "later") ].filter((ms2) => $d07e34cce18680fd$export$1b96692a1ba042ac(ms2, dateTime.timeZone).day === minDate.day)[0]; let maxDate = $d07e34cce18680fd$export$b4a036af3fc0b032($435a2ceaa8778ed8$export$e5d5e1c1822b6e56(plainDateTime, { hour: max2 }), new $93635573935797de$export$80ee6245ec4f29ec()); let maxAbsolute = [ $d07e34cce18680fd$export$5107c82f94518f5c(maxDate, dateTime.timeZone, "earlier"), $d07e34cce18680fd$export$5107c82f94518f5c(maxDate, dateTime.timeZone, "later") ].filter((ms2) => $d07e34cce18680fd$export$1b96692a1ba042ac(ms2, dateTime.timeZone).day === maxDate.day).pop(); let ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset; let hours = Math.floor(ms / $435a2ceaa8778ed8$var$ONE_HOUR); let remainder = ms % $435a2ceaa8778ed8$var$ONE_HOUR; ms = $435a2ceaa8778ed8$var$cycleValue(hours, amount, Math.floor(minAbsolute / $435a2ceaa8778ed8$var$ONE_HOUR), Math.floor(maxAbsolute / $435a2ceaa8778ed8$var$ONE_HOUR), options == null ? void 0 : options.round) * $435a2ceaa8778ed8$var$ONE_HOUR + remainder; return $d07e34cce18680fd$export$b4a036af3fc0b032($d07e34cce18680fd$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar); } case "minute": case "second": case "millisecond": return $435a2ceaa8778ed8$export$dd02b3e0007dfe28(dateTime, field, amount, options); case "era": case "year": case "month": case "day": { let res = $435a2ceaa8778ed8$export$d52ced6badfb9a4c($d07e34cce18680fd$export$b21e0b124e224484(dateTime), field, amount, options); let ms = $d07e34cce18680fd$export$5107c82f94518f5c(res, dateTime.timeZone); return $d07e34cce18680fd$export$b4a036af3fc0b032($d07e34cce18680fd$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar); } default: throw new Error("Unsupported field " + field); } } function $435a2ceaa8778ed8$export$31b5430eb18be4f8(dateTime, fields, disambiguation) { let plainDateTime = $d07e34cce18680fd$export$b21e0b124e224484(dateTime); let res = $435a2ceaa8778ed8$export$e5d5e1c1822b6e56($435a2ceaa8778ed8$export$adaa4cf7ef1b65be(plainDateTime, fields), fields); if (res.compare(plainDateTime) === 0) return dateTime; let ms = $d07e34cce18680fd$export$5107c82f94518f5c(res, dateTime.timeZone, disambiguation); return $d07e34cce18680fd$export$b4a036af3fc0b032($d07e34cce18680fd$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar); } function $58246871e4652552$export$f59dee82248f5ad4(time) { return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`; } function $58246871e4652552$export$60dfd74aa96791bd(date) { let gregorianDate = $d07e34cce18680fd$export$b4a036af3fc0b032(date, new $93635573935797de$export$80ee6245ec4f29ec()); let year; if (gregorianDate.era === "BC") year = gregorianDate.year === 1 ? "0000" : "-" + String(Math.abs(1 - gregorianDate.year)).padStart(6, "00"); else year = String(gregorianDate.year).padStart(4, "0"); return `${year}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`; } function $58246871e4652552$export$4223de14708adc63(date) { return `${$58246871e4652552$export$60dfd74aa96791bd(date)}T${$58246871e4652552$export$f59dee82248f5ad4(date)}`; } function $58246871e4652552$var$offsetToString(offset2) { let sign = Math.sign(offset2) < 0 ? "-" : "+"; offset2 = Math.abs(offset2); let offsetHours = Math.floor(offset2 / 36e5); let offsetMinutes = Math.floor(offset2 % 36e5 / 6e4); let offsetSeconds = Math.floor(offset2 % 36e5 % 6e4 / 1e3); let stringOffset = `${sign}${String(offsetHours).padStart(2, "0")}:${String(offsetMinutes).padStart(2, "0")}`; if (offsetSeconds !== 0) stringOffset += `:${String(offsetSeconds).padStart(2, "0")}`; return stringOffset; } function $58246871e4652552$export$bf79f1ebf4b18792(date) { return `${$58246871e4652552$export$4223de14708adc63(date)}${$58246871e4652552$var$offsetToString(date.offset)}[${date.timeZone}]`; } function $2aaf608024c21ca1$var$shiftArgs(args) { let calendar = typeof args[0] === "object" ? args.shift() : new $93635573935797de$export$80ee6245ec4f29ec(); let era; if (typeof args[0] === "string") era = args.shift(); else { let eras = calendar.getEras(); era = eras[eras.length - 1]; } let year = args.shift(); let month = args.shift(); let day = args.shift(); return [ calendar, era, year, month, day ]; } const _$2aaf608024c21ca1$export$99faa760c7908e4f = class _$2aaf608024c21ca1$export$99faa760c7908e4f { constructor(...args) { __privateAdd(this, _type); let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args); this.calendar = calendar; this.era = era; this.year = year; this.month = month; this.day = day; $435a2ceaa8778ed8$export$c4e2ecac49351ef2(this); } copy() { if (this.era) return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day); else return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day); } add(duration) { return $435a2ceaa8778ed8$export$e16d8520af44a096(this, duration); } subtract(duration) { return $435a2ceaa8778ed8$export$4e2d2ead65e5f7e3(this, duration); } set(fields) { return $435a2ceaa8778ed8$export$adaa4cf7ef1b65be(this, fields); } cycle(field, amount, options) { return $435a2ceaa8778ed8$export$d52ced6badfb9a4c(this, field, amount, options); } toDate(timeZone) { return $d07e34cce18680fd$export$e67a095c620b86fe(this, timeZone); } toString() { return $58246871e4652552$export$60dfd74aa96791bd(this); } compare(b) { return $ad063034c8620db8$export$68781ddf31c0090f(this, b); } }; _type = new WeakMap(); let $2aaf608024c21ca1$export$99faa760c7908e4f = _$2aaf608024c21ca1$export$99faa760c7908e4f; const _$2aaf608024c21ca1$export$680ea196effce5f = class _$2aaf608024c21ca1$export$680ea196effce5f { constructor(hour = 0, minute = 0, second = 0, millisecond = 0) { __privateAdd(this, _type2); this.hour = hour; this.minute = minute; this.second = second; this.millisecond = millisecond; $435a2ceaa8778ed8$export$7555de1e070510cb(this); } copy() { return new _$2aaf608024c21ca1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond); } add(duration) { return $435a2ceaa8778ed8$export$7ed87b6bc2506470(this, duration); } subtract(duration) { return $435a2ceaa8778ed8$export$fe34d3a381cd7501(this, duration); } set(fields) { return $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(this, fields); } cycle(field, amount, options) { return $435a2ceaa8778ed8$export$dd02b3e0007dfe28(this, field, amount, options); } toString() { return $58246871e4652552$export$f59dee82248f5ad4(this); } compare(b) { return $ad063034c8620db8$export$c19a80a9721b80f6(this, b); } }; _type2 = new WeakMap(); let $2aaf608024c21ca1$export$680ea196effce5f = _$2aaf608024c21ca1$export$680ea196effce5f; const _$2aaf608024c21ca1$export$ca871e8dbb80966f = class _$2aaf608024c21ca1$export$ca871e8dbb80966f { constructor(...args) { __privateAdd(this, _type3); let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args); this.calendar = calendar; this.era = era; this.year = year; this.month = month; this.day = day; this.hour = args.shift() || 0; this.minute = args.shift() || 0; this.second = args.shift() || 0; this.millisecond = args.shift() || 0; $435a2ceaa8778ed8$export$c4e2ecac49351ef2(this); } copy() { if (this.era) return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond); else return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond); } add(duration) { return $435a2ceaa8778ed8$export$e16d8520af44a096(this, duration); } subtract(duration) { return $435a2ceaa8778ed8$export$4e2d2ead65e5f7e3(this, duration); } set(fields) { return $435a2ceaa8778ed8$export$adaa4cf7ef1b65be($435a2ceaa8778ed8$export$e5d5e1c1822b6e56(this, fields), fields); } cycle(field, amount, options) { switch (field) { case "era": case "year": case "month": case "day": return $435a2ceaa8778ed8$export$d52ced6badfb9a4c(this, field, amount, options); default: return $435a2ceaa8778ed8$export$dd02b3e0007dfe28(this, field, amount, options); } } toDate(timeZone, disambiguation) { return $d07e34cce18680fd$export$e67a095c620b86fe(this, timeZone, disambiguation); } toString() { return $58246871e4652552$export$4223de14708adc63(this); } compare(b) { let res = $ad063034c8620db8$export$68781ddf31c0090f(this, b); if (res === 0) return $ad063034c8620db8$export$c19a80a9721b80f6(this, $d07e34cce18680fd$export$b21e0b124e224484(b)); return res; } }; _type3 = new WeakMap(); let $2aaf608024c21ca1$export$ca871e8dbb80966f = _$2aaf608024c21ca1$export$ca871e8dbb80966f; const _$2aaf608024c21ca1$export$d3b7288e7994edea = class _$2aaf608024c21ca1$export$d3b7288e7994edea { constructor(...args) { __privateAdd(this, _type4); let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args); let timeZone = args.shift(); let offset2 = args.shift(); this.calendar = calendar; this.era = era; this.year = year; this.month = month; this.day = day; this.timeZone = timeZone; this.offset = offset2; this.hour = args.shift() || 0; this.minute = args.shift() || 0; this.second = args.shift() || 0; this.millisecond = args.shift() || 0; $435a2ceaa8778ed8$export$c4e2ecac49351ef2(this); } copy() { if (this.era) return new _$2aaf608024c21ca1$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond); else return new _$2aaf608024c21ca1$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond); } add(duration) { return $435a2ceaa8778ed8$export$96b1d28349274637(this, duration); } subtract(duration) { return $435a2ceaa8778ed8$export$6814caac34ca03c7(this, duration); } set(fields, disambiguation) { return $435a2ceaa8778ed8$export$31b5430eb18be4f8(this, fields, disambiguation); } cycle(field, amount, options) { return $435a2ceaa8778ed8$export$9a297d111fc86b79(this, field, amount, options); } toDate() { return $d07e34cce18680fd$export$83aac07b4c37b25(this); } toString() { return $58246871e4652552$export$bf79f1ebf4b18792(this); } toAbsoluteString() { return this.toDate().toISOString(); } compare(b) { return this.toDate().getTime() - $d07e34cce18680fd$export$84c95a83c799e074(b, this.timeZone).toDate().getTime(); } }; _type4 = new WeakMap(); let $2aaf608024c21ca1$export$d3b7288e7994edea = _$2aaf608024c21ca1$export$d3b7288e7994edea; let $12a3c853105e5a70$var$formatterCache = new Map(); class $12a3c853105e5a70$export$ad991b66133851cf { constructor(locale, options = {}) { this.formatter = $12a3c853105e5a70$var$getCachedDateFormatter(locale, options); this.options = options; } format(value) { return this.formatter.format(value); } formatToParts(value) { return this.formatter.formatToParts(value); } formatRange(start, end) { if (typeof this.formatter.formatRange === "function") return this.formatter.formatRange(start, end); if (end < start) throw new RangeError("End date must be >= start date"); return `${this.formatter.format(start)} – ${this.formatter.format(end)}`; } formatRangeToParts(start, end) { if (typeof this.formatter.formatRangeToParts === "function") return this.formatter.formatRangeToParts(start, end); if (end < start) throw new RangeError("End date must be >= start date"); let startParts = this.formatter.formatToParts(start); let endParts = this.formatter.formatToParts(end); return [ ...startParts.map((p) => ({ ...p, source: "startRange" })), { type: "literal", value: " – ", source: "shared" }, ...endParts.map((p) => ({ ...p, source: "endRange" })) ]; } resolvedOptions() { let resolvedOptions = this.formatter.resolvedOptions(); if ($12a3c853105e5a70$var$hasBuggyResolvedHourCycle()) { if (!this.resolvedHourCycle) this.resolvedHourCycle = $12a3c853105e5a70$var$getResolvedHourCycle(resolvedOptions.locale, this.options); resolvedOptions.hourCycle = this.resolvedHourCycle; resolvedOptions.hour12 = this.resolvedHourCycle === "h11" || this.resolvedHourCycle === "h12"; } if (resolvedOptions.calendar === "ethiopic-amete-alem") resolvedOptions.calendar = "ethioaa"; return resolvedOptions; } } const $12a3c853105e5a70$var$hour12Preferences = { true: { ja: "h11" }, false: {} }; function $12a3c853105e5a70$var$getCachedDateFormatter(locale, options = {}) { if (typeof options.hour12 === "boolean" && $12a3c853105e5a70$var$hasBuggyHour12Behavior()) { options = { ...options }; let pref = $12a3c853105e5a70$var$hour12Preferences[String(options.hour12)][locale.split("-")[0]]; let defaultHourCycle = options.hour12 ? "h12" : "h23"; options.hourCycle = pref != null ? pref : defaultHourCycle; delete options.hour12; } let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : ""); if ($12a3c853105e5a70$var$formatterCache.has(cacheKey)) return $12a3c853105e5a70$var$formatterCache.get(cacheKey); let numberFormatter = new Intl.DateTimeFormat(locale, options); $12a3c853105e5a70$var$formatterCache.set(cacheKey, numberFormatter); return numberFormatter; } let $12a3c853105e5a70$var$_hasBuggyHour12Behavior = null; function $12a3c853105e5a70$var$hasBuggyHour12Behavior() { if ($12a3c853105e5a70$var$_hasBuggyHour12Behavior == null) $12a3c853105e5a70$var$_hasBuggyHour12Behavior = new Intl.DateTimeFormat("en-US", { hour: "numeric", hour12: false }).format(new Date(2020, 2, 3, 0)) === "24"; return $12a3c853105e5a70$var$_hasBuggyHour12Behavior; } let $12a3c853105e5a70$var$_hasBuggyResolvedHourCycle = null; function $12a3c853105e5a70$var$hasBuggyResolvedHourCycle() { if ($12a3c853105e5a70$var$_hasBuggyResolvedHourCycle == null) $12a3c853105e5a70$var$_hasBuggyResolvedHourCycle = new Intl.DateTimeFormat("fr", { hour: "numeric", hour12: false }).resolvedOptions().hourCycle === "h12"; return $12a3c853105e5a70$var$_hasBuggyResolvedHourCycle; } function $12a3c853105e5a70$var$getResolvedHourCycle(locale, options) { if (!options.timeStyle && !options.hour) return void 0; locale = locale.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, ""); locale += (locale.includes("-u-") ? "" : "-u") + "-nu-latn"; let formatter = $12a3c853105e5a70$var$getCachedDateFormatter(locale, { ...options, timeZone: void 0 }); let min2 = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 0)).find((p) => p.type === "hour").value, 10); let max2 = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 23)).find((p) => p.type === "hour").value, 10); if (min2 === 0 && max2 === 23) return "h23"; if (min2 === 24 && max2 === 23) return "h24"; if (min2 === 0 && max2 === 11) return "h11"; if (min2 === 12 && max2 === 11) return "h12"; throw new Error("Unexpected hour cycle result"); } function toDate(dateValue, tz = $ad063034c8620db8$export$aa8b41735afcabd2()) { if (isZonedDateTime(dateValue)) return dateValue.toDate(); else return dateValue.toDate(tz); } function isCalendarDateTime(dateValue) { return dateValue instanceof $2aaf608024c21ca1$export$ca871e8dbb80966f; } function isZonedDateTime(dateValue) { return dateValue instanceof $2aaf608024c21ca1$export$d3b7288e7994edea; } function hasTime(dateValue) { return isCalendarDateTime(dateValue) || isZonedDateTime(dateValue); } function getDaysInMonth(date) { if (date instanceof Date) { const year = date.getFullYear(); const month = date.getMonth() + 1; return new Date(year, month, 0).getDate(); } else return date.set({ day: 100 }).day; } function isBefore(dateToCompare, referenceDate) { return dateToCompare.compare(referenceDate) < 0; } function isBeforeOrSame(dateToCompare, referenceDate) { return dateToCompare.compare(referenceDate) <= 0; } function areAllDaysBetweenValid(start, end, isUnavailable, isDisabled, isHighlightable) { if (isUnavailable === void 0 && isDisabled === void 0 && isHighlightable === void 0) return true; let dCurrent = start.add({ days: 1 }); if ((isUnavailable == null ? void 0 : isUnavailable(dCurrent)) && true) return false; const dEnd = end; while (dCurrent.compare(dEnd) < 0) { dCurrent = dCurrent.add({ days: 1 }); if ((isUnavailable == null ? void 0 : isUnavailable(dCurrent)) && true) return false; } return true; } function getDefaultTime(props) { const { defaultValue, defaultPlaceholder } = props; if (defaultValue) return defaultValue.copy(); if (defaultPlaceholder) return defaultPlaceholder.copy(); return new $2aaf608024c21ca1$export$680ea196effce5f(0, 0, 0); } function getOptsByGranularity(granularity, hourCycle, isTimeValue = false) { const opts = { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: "short", hourCycle: normalizeHourCycle(hourCycle), hour12: normalizeHour12(hourCycle) }; if (isTimeValue) { delete opts.year; delete opts.month; delete opts.day; } if (granularity === "day") { delete opts.second; delete opts.hour; delete opts.minute; delete opts.timeZoneName; } if (granularity === "hour") { delete opts.minute; delete opts.second; } if (granularity === "minute") delete opts.second; return opts; } function normalizeDateStep(props) { return defu(props == null ? void 0 : props.step, { year: 1, month: 1, day: 1, hour: 1, minute: 1, second: 1, millisecond: 1 }); } function normalizeHourCycle(hourCycle) { if (hourCycle === 24) return "h23"; if (hourCycle === 12) return "h11"; return void 0; } function normalizeHour12(hourCycle) { if (hourCycle === 24) return false; if (hourCycle === 12) return true; return void 0; } const imeScriptRE = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}]/u; const androidRE = /android/i; function isAndroid() { return typeof navigator !== "undefined" && androidRE.test(navigator.userAgent); } function useComposing(onEnd) { const isComposing = vue.ref(false); const isImeComposition = vue.ref(true); const sawImeScript = vue.ref(false); const shouldDeferInput = vue.computed(() => isComposing.value && isImeComposition.value); function handleCompositionStart() { isComposing.value = true; isImeComposition.value = true; sawImeScript.value = false; } function handleCompositionUpdate(event) { if (!event.data) return; if (imeScriptRE.test(event.data)) { isImeComposition.value = true; sawImeScript.value = true; } else if (isAndroid() && !sawImeScript.value) isImeComposition.value = false; } function handleCompositionEnd(event) { vue.nextTick(() => { isComposing.value = false; onEnd == null ? void 0 : onEnd(event); }); } return { isComposing, shouldDeferInput, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd }; } function useDateFormatter(initialLocale, opts = {}) { const locale = vue.ref(initialLocale); function getLocale() { return locale.value; } function setLocale(newLocale) { locale.value = newLocale; } function custom(date, options) { return new $12a3c853105e5a70$export$ad991b66133851cf(locale.value, { ...opts, ...options }).format(date); } function selectedDate(date, includeTime = true) { if (hasTime(date) && includeTime) return custom(toDate(date), { dateStyle: "long", timeStyle: "long" }); else return custom(toDate(date), { dateStyle: "long" }); } function fullMonthAndYear(date, options = {}) { return new $12a3c853105e5a70$export$ad991b66133851cf(locale.value, { ...opts, month: "long", year: "numeric", ...options }).format(date); } function fullMonth(date, options = {}) { return new $12a3c853105e5a70$export$ad991b66133851cf(locale.value, { ...opts, month: "long", ...options }).format(date); } function getMonths() { const defaultDate = $ad063034c8620db8$export$d0bdf45af03a6ea3($ad063034c8620db8$export$aa8b41735afcabd2()); const months = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]; return months.map((item) => ({ label: fullMonth(toDate(defaultDate.set({ month: item }))), value: item })); } function fullYear(date, options = {}) { return new $12a3c853105e5a70$export$ad991b66133851cf(locale.value, { ...opts, year: "numeric", ...options }).format(date); } function toParts(date, options) { if (isZonedDateTime(date)) return new $12a3c853105e5a70$export$ad991b66133851cf(locale.value, { ...opts, ...options, timeZone: date.timeZone }).formatToParts(toDate(date)); else return new $12a3c853105e5a70$export$ad991b66133851cf(locale.value, { ...opts, ...options }).formatToParts(toDate(date)); } function dayOfWeek(date, length = "narrow") { return new $12a3c853105e5a70$export$ad991b66133851cf(locale.value, { ...opts, weekday: length }).format(date); } function dayPeriod(date, timeZone) { var _a2; const parts = new $12a3c853105e5a70$export$ad991b66133851cf(locale.value, { ...opts, hour: "numeric", hourCycle: "h23", hour12: void 0, numberingSystem: "latn", ...timeZone ? { timeZone } : {} }).formatToParts(date); const hour = Number((_a2 = parts.find((p) => p.type === "hour")) == null ? void 0 : _a2.value); return !Number.isNaN(hour) && hour >= 12 ? "PM" : "AM"; } const defaultPartOptions = { year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }; function part(dateObj, type, options = {}) { const opts$1 = { ...defaultPartOptions, ...options }; const parts = toParts(dateObj, opts$1); const part$1 = parts.find((p) => p.type === type); return part$1 ? part$1.value : ""; } return { setLocale, getLocale, fullMonth, fullYear, fullMonthAndYear, toParts, custom, part, dayPeriod, selectedDate, dayOfWeek, getMonths }; } function useDirection(dir) { const context2 = injectConfigProviderContext({ dir: vue.ref("ltr") }); return vue.computed(() => { var _a2; return (dir == null ? void 0 : dir.value) || ((_a2 = context2.dir) == null ? void 0 : _a2.value) || "ltr"; }); } function useEmitAsProps(emit2) { const vm = vue.getCurrentInstance(); const events = vm == null ? void 0 : vm.type.emits; const result = {}; if (!(events == null ? void 0 : events.length)) console.warn(`No emitted event found. Please check component: ${vm == null ? void 0 : vm.type.__name}`); events == null ? void 0 : events.forEach((ev) => { result[vue.toHandlerKey(vue.camelize(ev))] = (...arg) => emit2(ev, ...arg); }); return result; } function useFilter$1(options) { const computedOptions = vue.computed(() => vue.unref(options)); const collator = vue.computed(() => new Intl.Collator("en", { usage: "search", ...computedOptions.value })); const startsWith = (string, substring) => { if (substring.length === 0) return true; string = string.normalize("NFC"); substring = substring.normalize("NFC"); return collator.value.compare(string.slice(0, substring.length), substring) === 0; }; const endsWith = (string, substring) => { if (substring.length === 0) return true; string = string.normalize("NFC"); substring = substring.normalize("NFC"); return collator.value.compare(string.slice(-substring.length), substring) === 0; }; const contains = (string, substring) => { if (substring.length === 0) return true; string = string.normalize("NFC"); substring = substring.normalize("NFC"); if (substring.length > string.length) return false; const compare2 = collator.value.compare; if (string.includes(substring)) return true; const sliceLen = substring.length; for (let scan2 = 0; scan2 + sliceLen <= string.length; scan2++) if (compare2(substring, string.slice(scan2, scan2 + sliceLen)) === 0) return true; return false; }; return { startsWith, endsWith, contains }; } let count$2 = 0; function useFocusGuards() { vue.watchEffect((cleanupFn) => { var _a2, _b; if (!isClient) return; const edgeGuards = document.querySelectorAll("[data-reka-focus-guard]"); document.body.insertAdjacentElement("afterbegin", (_a2 = edgeGuards[0]) != null ? _a2 : createFocusGuard()); document.body.insertAdjacentElement("beforeend", (_b = edgeGuards[1]) != null ? _b : createFocusGuard()); count$2++; cleanupFn(() => { if (count$2 === 1) document.querySelectorAll("[data-reka-focus-guard]").forEach((node) => node.remove()); count$2--; }); }); } function createFocusGuard() { const element = document.createElement("span"); element.setAttribute("data-reka-focus-guard", ""); element.tabIndex = 0; element.style.outline = "none"; element.style.opacity = "0"; element.style.position = "fixed"; element.style.pointerEvents = "none"; return element; } function useFormControl(el) { return vue.computed(() => { var _a2; return vue.toValue(el) ? Boolean((_a2 = unrefElement(el)) == null ? void 0 : _a2.closest("form")) : true; }); } function useForwardExpose() { const instance = vue.getCurrentInstance(); const currentRef = vue.ref(); const currentElement = vue.computed(() => resolveCurrentElement()); vue.onUpdated(() => { if (currentElement.value !== resolveCurrentElement()) vue.triggerRef(currentRef); }); function resolveCurrentElement() { return currentRef.value && "$el" in currentRef.value && ["#text", "#comment"].includes(currentRef.value.$el.nodeName) ? currentRef.value.$el.nextElementSibling : unrefElement(currentRef); } const localExpose = Object.assign({}, instance.exposed); const ret = {}; for (const key in instance.props) Object.defineProperty(ret, key, { enumerable: true, configurable: true, get: () => instance.props[key] }); if (Object.keys(localExpose).length > 0) for (const key in localExpose) Object.defineProperty(ret, key, { enumerable: true, configurable: true, get: () => localExpose[key] }); Object.defineProperty(ret, "$el", { enumerable: true, configurable: true, get: () => instance.vnode.el }); instance.exposed = ret; function forwardRef(ref$1) { currentRef.value = ref$1; if (!ref$1) return; Object.defineProperty(ret, "$el", { enumerable: true, configurable: true, get: () => ref$1 instanceof Element ? ref$1 : ref$1.$el }); if (!(ref$1 instanceof Element) && !Object.hasOwn(ref$1, "$el")) { const childExposed = ref$1.$.exposed; const merged = Object.assign({}, ret); for (const key in childExposed) Object.defineProperty(merged, key, { enumerable: true, configurable: true, get: () => childExposed[key] }); instance.exposed = merged; } } return { forwardRef, currentRef, currentElement }; } function useForwardProps$1(props) { var _a2; const vm = vue.getCurrentInstance(); const defaultProps = Object.keys((_a2 = vm == null ? void 0 : vm.type.props) != null ? _a2 : {}).reduce((prev, curr) => { const defaultValue = (vm == null ? void 0 : vm.type.props[curr]).default; if (defaultValue !== void 0) prev[curr] = defaultValue; return prev; }, {}); const refProps = vue.toRef(props); return vue.computed(() => { var _a3; const preservedProps = {}; const assignedProps = (_a3 = vm == null ? void 0 : vm.vnode.props) != null ? _a3 : {}; Object.keys(assignedProps).forEach((key) => { preservedProps[vue.camelize(key)] = assignedProps[key]; }); return Object.keys({ ...defaultProps, ...preservedProps }).reduce((prev, curr) => { if (refProps.value[curr] !== void 0) prev[curr] = refProps.value[curr]; return prev; }, {}); }); } function useForwardPropsEmits(props, emit2) { const parsedProps = useForwardProps$1(props); const emitsAsProps = emit2 ? useEmitAsProps(emit2) : {}; return vue.computed(() => ({ ...parsedProps.value, ...emitsAsProps })); } function useForwardScopeId() { var _a2, _b; const scopeId = (_b = (_a2 = vue.getCurrentInstance()) == null ? void 0 : _a2.vnode) == null ? void 0 : _b.scopeId; return scopeId ? { [scopeId]: "" } : {}; } function useGraceArea(triggerElement, containerElement) { const isPointerInTransit = refAutoReset(false, 300); tryOnScopeDispose(() => { isPointerInTransit.value = false; }); const pointerGraceArea = vue.ref(null); const pointerExit = createEventHook(); function handleRemoveGraceArea() { pointerGraceArea.value = null; isPointerInTransit.value = false; } function handleCreateGraceArea(event, hoverTarget) { if (!hoverTarget) return; const currentTarget = event.currentTarget; const exitPoint = { x: event.clientX, y: event.clientY }; const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect()); const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide, 1); const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect()); const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]); pointerGraceArea.value = graceArea; isPointerInTransit.value = true; } vue.watchEffect((cleanupFn) => { if (triggerElement.value && containerElement.value) { const trigger = triggerElement.value; const container = containerElement.value; const handleTriggerLeave = (event) => handleCreateGraceArea(event, container); const handleContentLeave = (event) => handleCreateGraceArea(event, trigger); trigger.addEventListener("pointerleave", handleTriggerLeave); container.addEventListener("pointerleave", handleContentLeave); cleanupFn(() => { trigger.removeEventListener("pointerleave", handleTriggerLeave); container.removeEventListener("pointerleave", handleContentLeave); }); } }); vue.watchEffect((cleanupFn) => { var _a2; if (pointerGraceArea.value) { const handleTrackPointerGrace = (event) => { var _a3, _b; if (!pointerGraceArea.value || !(event.target instanceof Element)) return; const target = event.target; const pointerPosition = { x: event.clientX, y: event.clientY }; const hasEnteredTarget = ((_a3 = triggerElement.value) == null ? void 0 : _a3.contains(target)) || ((_b = containerElement.value) == null ? void 0 : _b.contains(target)); const isPointerOutsideGraceArea = !isPointInPolygon$1(pointerPosition, pointerGraceArea.value); const isAnotherGraceAreaTrigger = !!target.closest("[data-grace-area-trigger]"); if (hasEnteredTarget) handleRemoveGraceArea(); else if (isPointerOutsideGraceArea || isAnotherGraceAreaTrigger) { handleRemoveGraceArea(); pointerExit.trigger(); } }; const ownerDocument = (_a2 = triggerElement.value) == null ? void 0 : _a2.ownerDocument; ownerDocument == null ? void 0 : ownerDocument.addEventListener("pointermove", handleTrackPointerGrace); cleanupFn(() => ownerDocument == null ? void 0 : ownerDocument.removeEventListener("pointermove", handleTrackPointerGrace)); } }); return { isPointerInTransit, onPointerExit: pointerExit.on }; } function getExitSideFromRect(point, rect) { const top = Math.abs(rect.top - point.y); const bottom = Math.abs(rect.bottom - point.y); const right = Math.abs(rect.right - point.x); const left = Math.abs(rect.left - point.x); switch (Math.min(top, bottom, right, left)) { case left: return "left"; case right: return "right"; case top: return "top"; case bottom: return "bottom"; default: throw new Error("unreachable"); } } function getPaddedExitPoints(exitPoint, exitSide, padding = 5) { const paddedExitPoints = []; switch (exitSide) { case "top": paddedExitPoints.push({ x: exitPoint.x - padding, y: exitPoint.y + padding }, { x: exitPoint.x + padding, y: exitPoint.y + padding }); break; case "bottom": paddedExitPoints.push({ x: exitPoint.x - padding, y: exitPoint.y - padding }, { x: exitPoint.x + padding, y: exitPoint.y - padding }); break; case "left": paddedExitPoints.push({ x: exitPoint.x + padding, y: exitPoint.y - padding }, { x: exitPoint.x + padding, y: exitPoint.y + padding }); break; case "right": paddedExitPoints.push({ x: exitPoint.x - padding, y: exitPoint.y - padding }, { x: exitPoint.x - padding, y: exitPoint.y + padding }); break; } return paddedExitPoints; } function getPointsFromRect(rect) { const { top, right, bottom, left } = rect; return [ { x: left, y: top }, { x: right, y: top }, { x: right, y: bottom }, { x: left, y: bottom } ]; } function isPointInPolygon$1(point, polygon) { const { x, y } = point; let inside = false; for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { const xi = polygon[i].x; const yi = polygon[i].y; const xj = polygon[j].x; const yj = polygon[j].y; const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; if (intersect) inside = !inside; } return inside; } function getHull(points) { const newPoints = points.slice(); newPoints.sort((a, b) => { if (a.x < b.x) return -1; else if (a.x > b.x) return 1; else if (a.y < b.y) return -1; else if (a.y > b.y) return 1; else return 0; }); return getHullPresorted(newPoints); } function getHullPresorted(points) { if (points.length <= 1) return points.slice(); const upperHull = []; for (let i = 0; i < points.length; i++) { const p = points[i]; while (upperHull.length >= 2) { const q = upperHull.at(-1); const r = upperHull[upperHull.length - 2]; if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop(); else break; } upperHull.push(p); } upperHull.pop(); const lowerHull = []; for (let i = points.length - 1; i >= 0; i--) { const p = points[i]; while (lowerHull.length >= 2) { const q = lowerHull.at(-1); const r = lowerHull[lowerHull.length - 2]; if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop(); else break; } lowerHull.push(p); } lowerHull.pop(); if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) return upperHull; else return upperHull.concat(lowerHull); } var getDefaultParent = function(originalTarget) { if (typeof document === "undefined") { return null; } var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; return sampleTarget.ownerDocument.body; }; var counterMap = new WeakMap(); var uncontrolledNodes = new WeakMap(); var markerMap = {}; var lockCount = 0; var unwrapHost = function(node) { return node && (node.host || unwrapHost(node.parentNode)); }; var correctTargets = function(parent, targets) { return targets.map(function(target) { if (parent.contains(target)) { return target; } var correctedTarget = unwrapHost(target); if (correctedTarget && parent.contains(correctedTarget)) { return correctedTarget; } console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing"); return null; }).filter(function(x) { return Boolean(x); }); }; var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) { var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); if (!markerMap[markerName]) { markerMap[markerName] = new WeakMap(); } var markerCounter = markerMap[markerName]; var hiddenNodes = []; var elementsToKeep = new Set(); var elementsToStop = new Set(targets); var keep = function(el) { if (!el || elementsToKeep.has(el)) { return; } elementsToKeep.add(el); keep(el.parentNode); }; targets.forEach(keep); var deep = function(parent) { if (!parent || elementsToStop.has(parent)) { return; } Array.prototype.forEach.call(parent.children, function(node) { if (elementsToKeep.has(node)) { deep(node); } else { try { var attr = node.getAttribute(controlAttribute); var alreadyHidden = attr !== null && attr !== "false"; var counterValue = (counterMap.get(node) || 0) + 1; var markerValue = (markerCounter.get(node) || 0) + 1; counterMap.set(node, counterValue); markerCounter.set(node, markerValue); hiddenNodes.push(node); if (counterValue === 1 && alreadyHidden) { uncontrolledNodes.set(node, true); } if (markerValue === 1) { node.setAttribute(markerName, "true"); } if (!alreadyHidden) { node.setAttribute(controlAttribute, "true"); } } catch (e) { console.error("aria-hidden: cannot operate on ", node, e); } } }); }; deep(parentNode); elementsToKeep.clear(); lockCount++; return function() { hiddenNodes.forEach(function(node) { var counterValue = counterMap.get(node) - 1; var markerValue = markerCounter.get(node) - 1; counterMap.set(node, counterValue); markerCounter.set(node, markerValue); if (!counterValue) { if (!uncontrolledNodes.has(node)) { node.removeAttribute(controlAttribute); } uncontrolledNodes.delete(node); } if (!markerValue) { node.removeAttribute(markerName); } }); lockCount--; if (!lockCount) { counterMap = new WeakMap(); counterMap = new WeakMap(); uncontrolledNodes = new WeakMap(); markerMap = {}; } }; }; var hideOthers = function(originalTarget, parentNode, markerName) { if (markerName === void 0) { markerName = "data-aria-hidden"; } var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); var activeParentNode = getDefaultParent(originalTarget); if (!activeParentNode) { return function() { return null; }; } targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script"))); return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden"); }; function useHideOthers(target) { let undo; vue.watch(() => unrefElement(target), (el) => { let isInsideClosedPopover = false; try { isInsideClosedPopover = !!(el == null ? void 0 : el.closest("[popover]:not(:popover-open)")); } catch { } if (el && !isInsideClosedPopover) undo = hideOthers(el); else if (undo) undo(); }); vue.onUnmounted(() => { if (undo) undo(); }); } let count$1 = 0; function useId(deterministicId, prefix = "reka") { var _a2; if (deterministicId) return deterministicId; let id; const configProviderContext = injectConfigProviderContext({ useId: void 0 }); if (configProviderContext.useId) id = configProviderContext.useId(); else if ("useId" in vue__namespace) id = (_a2 = vue__namespace.useId) == null ? void 0 : _a2.call(vue__namespace); else id = `${++count$1}`; return prefix ? `${prefix}-${id}` : id; } function useKbd() { return { ALT: "Alt", ARROW_DOWN: "ArrowDown", ARROW_LEFT: "ArrowLeft", ARROW_RIGHT: "ArrowRight", ARROW_UP: "ArrowUp", BACKSPACE: "Backspace", CAPS_LOCK: "CapsLock", CONTROL: "Control", DELETE: "Delete", END: "End", ENTER: "Enter", ESCAPE: "Escape", F1: "F1", F10: "F10", F11: "F11", F12: "F12", F2: "F2", F3: "F3", F4: "F4", F5: "F5", F6: "F6", F7: "F7", F8: "F8", F9: "F9", HOME: "Home", META: "Meta", PAGE_DOWN: "PageDown", PAGE_UP: "PageUp", SHIFT: "Shift", SPACE: " ", TAB: "Tab", CTRL: "Control", ASTERISK: "*", SPACE_CODE: "Space" }; } function useLocale(locale) { const context2 = injectConfigProviderContext({ locale: vue.ref("en") }); return vue.computed(() => { var _a2; return (locale == null ? void 0 : locale.value) || ((_a2 = context2.locale) == null ? void 0 : _a2.value) || "en"; }); } function useSize(element) { const size2 = vue.ref(); const width = vue.computed(() => { var _a2, _b; return (_b = (_a2 = size2.value) == null ? void 0 : _a2.width) != null ? _b : 0; }); const height = vue.computed(() => { var _a2, _b; return (_b = (_a2 = size2.value) == null ? void 0 : _a2.height) != null ? _b : 0; }); let resizeObserver; vue.onMounted(() => { const el = unrefElement(element); if (el) { size2.value = { width: el.offsetWidth, height: el.offsetHeight }; resizeObserver = new ResizeObserver((entries) => { if (!Array.isArray(entries)) return; if (!entries.length) return; const entry = entries[0]; let width$1; let height$1; if ("borderBoxSize" in entry) { const borderSizeEntry = entry.borderBoxSize; const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry; width$1 = borderSize.inlineSize; height$1 = borderSize.blockSize; } else { width$1 = el.offsetWidth; height$1 = el.offsetHeight; } size2.value = { width: width$1, height: height$1 }; }); resizeObserver.observe(el, { box: "border-box" }); } else size2.value = void 0; }); vue.onUnmounted(() => { resizeObserver == null ? void 0 : resizeObserver.disconnect(); resizeObserver = void 0; }); return { width, height }; } function useStateMachine(initialState, machine) { const state2 = vue.ref(initialState); function reducer(event) { const nextState = machine[state2.value][event]; return nextState != null ? nextState : state2.value; } const dispatch = (event) => { state2.value = reducer(event); }; return { state: state2, dispatch }; } function useTypeahead(callback) { const search = refAutoReset("", 1e3); const handleTypeaheadSearch = (key, items) => { search.value = search.value + key; { const currentItem = getActiveElement(); const itemsWithTextValue = items.map((item) => { var _a2, _b, _c, _d; return { ...item, textValue: (_d = (_c = (_a2 = item.value) == null ? void 0 : _a2.textValue) != null ? _c : (_b = item.ref.textContent) == null ? void 0 : _b.trim()) != null ? _d : "" }; }); const currentMatch = itemsWithTextValue.find((item) => item.ref === currentItem); const values = itemsWithTextValue.map((item) => item.textValue); const nextMatch = getNextMatch(values, search.value, currentMatch == null ? void 0 : currentMatch.textValue); const newItem = itemsWithTextValue.find((item) => item.textValue === nextMatch); if (newItem) newItem.ref.focus(); return newItem == null ? void 0 : newItem.ref; } }; const resetTypeahead = () => { search.value = ""; }; return { search, handleTypeaheadSearch, resetTypeahead }; } function wrapArray$1(array, startIndex) { return array.map((_2, index) => array[(startIndex + index) % array.length]); } function getNextMatch(values, search, currentMatch) { const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]); const normalizedSearch = isRepeated ? search[0] : search; const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1; let wrappedValues = wrapArray$1(values, Math.max(currentMatchIndex, 0)); const excludeCurrentMatch = normalizedSearch.length === 1; if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch); const nextMatch = wrappedValues.find((value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())); return nextMatch !== currentMatch ? nextMatch : void 0; } function usePresence(present, node) { var _a2, _b; const stylesRef = vue.ref({}); const prevAnimationNameRef = vue.ref("none"); const prevPresentRef = vue.ref(present); const initialState = present.value ? "mounted" : "unmounted"; let timeoutId; const ownerWindow = (_b = (_a2 = node.value) == null ? void 0 : _a2.ownerDocument.defaultView) != null ? _b : defaultWindow; const { state: state2, dispatch } = useStateMachine(initialState, { mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" }, unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" }, unmounted: { MOUNT: "mounted" } }); const dispatchCustomEvent = (name) => { var _a3; if (isClient) { const customEvent = new CustomEvent(name, { bubbles: false, cancelable: false }); (_a3 = node.value) == null ? void 0 : _a3.dispatchEvent(customEvent); } }; vue.watch(present, async (currentPresent, prevPresent) => { var _a3; const hasPresentChanged = prevPresent !== currentPresent; await vue.nextTick(); if (hasPresentChanged) { const prevAnimationName = prevAnimationNameRef.value; const currentAnimationName = getAnimationName(node.value); if (currentPresent) { dispatch("MOUNT"); dispatchCustomEvent("enter"); if (currentAnimationName === "none") dispatchCustomEvent("after-enter"); } else if (currentAnimationName === "none" || currentAnimationName === "undefined" || ((_a3 = stylesRef.value) == null ? void 0 : _a3.display) === "none") { dispatch("UNMOUNT"); dispatchCustomEvent("leave"); dispatchCustomEvent("after-leave"); } else { const isAnimating2 = prevAnimationName !== currentAnimationName; if (prevPresent && isAnimating2) { dispatch("ANIMATION_OUT"); dispatchCustomEvent("leave"); } else { dispatch("UNMOUNT"); dispatchCustomEvent("after-leave"); } } } }, { immediate: true }); const handleAnimationEnd = (event) => { if (event.target !== node.value) return; const currentAnimationName = getAnimationName(node.value); const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName)); const directionName = state2.value === "mounted" ? "enter" : "leave"; if (isCurrentAnimation) { dispatchCustomEvent(`after-${directionName}`); dispatch("ANIMATION_END"); if (!prevPresentRef.value) { const currentFillMode = node.value.style.animationFillMode; node.value.style.animationFillMode = "forwards"; timeoutId = ownerWindow == null ? void 0 : ownerWindow.setTimeout(() => { var _a3; if (((_a3 = node.value) == null ? void 0 : _a3.style.animationFillMode) === "forwards") node.value.style.animationFillMode = currentFillMode; }); } } if (currentAnimationName === "none") dispatch("ANIMATION_END"); }; const handleAnimationStart = (event) => { if (event.target === node.value) prevAnimationNameRef.value = getAnimationName(node.value); }; const watcher2 = vue.watch(node, (newNode, oldNode) => { if (newNode) { stylesRef.value = getComputedStyle(newNode); newNode.addEventListener("animationstart", handleAnimationStart); newNode.addEventListener("animationcancel", handleAnimationEnd); newNode.addEventListener("animationend", handleAnimationEnd); } else { dispatch("ANIMATION_END"); if (timeoutId !== void 0) ownerWindow == null ? void 0 : ownerWindow.clearTimeout(timeoutId); oldNode == null ? void 0 : oldNode.removeEventListener("animationstart", handleAnimationStart); oldNode == null ? void 0 : oldNode.removeEventListener("animationcancel", handleAnimationEnd); oldNode == null ? void 0 : oldNode.removeEventListener("animationend", handleAnimationEnd); } }, { immediate: true }); const stateWatcher = vue.watch(state2, () => { const currentAnimationName = getAnimationName(node.value); prevAnimationNameRef.value = state2.value === "mounted" ? currentAnimationName : "none"; }); vue.onUnmounted(() => { watcher2(); stateWatcher(); if (node.value) { node.value.removeEventListener("animationstart", handleAnimationStart); node.value.removeEventListener("animationcancel", handleAnimationEnd); node.value.removeEventListener("animationend", handleAnimationEnd); } if (timeoutId !== void 0) ownerWindow == null ? void 0 : ownerWindow.clearTimeout(timeoutId); }); const isPresent = vue.computed(() => ["mounted", "unmountSuspended"].includes(state2.value)); return { isPresent }; } function getAnimationName(node) { return node ? getComputedStyle(node).animationName || "none" : "none"; } var Presence_default = vue.defineComponent({ name: "Presence", props: { present: { type: Boolean, required: true }, forceMount: { type: Boolean } }, slots: {}, setup(props, { slots, expose }) { var _a2; const { present, forceMount } = vue.toRefs(props); const node = vue.ref(); const { isPresent } = usePresence(present, node); expose({ present: isPresent }); let children = slots.default({ present: isPresent.value }); children = renderSlotFragments(children || []); const instance = vue.getCurrentInstance(); if (children && (children == null ? void 0 : children.length) > 1) { const componentName = ((_a2 = instance == null ? void 0 : instance.parent) == null ? void 0 : _a2.type.name) ? `<${instance.parent.type.name} />` : "component"; throw new Error([ `Detected an invalid children for \`${componentName}\` for \`Presence\` component.`, "", "Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.", "You can apply a few solutions:", ["Provide a single child element so that `presence` directive attach correctly.", "Ensure the first child is an actual element instead of a raw text node or comment node."].map((line) => ` - ${line}`).join("\n") ].join("\n")); } return () => { if (forceMount.value || present.value || isPresent.value) return vue.h(slots.default({ present: isPresent.value })[0], { ref: (v) => { const el = unrefElement(v); if (typeof (el == null ? void 0 : el.hasAttribute) === "undefined") return el; if (el == null ? void 0 : el.hasAttribute("data-reka-popper-content-wrapper")) node.value = el.firstElementChild; else node.value = el; return el; } }); else return null; }; } }); const Slot = vue.defineComponent({ name: "PrimitiveSlot", inheritAttrs: false, setup(_2, { attrs, slots }) { return () => { var _a2; if (!slots.default) return null; const children = renderSlotFragments(slots.default()); const firstNonCommentChildrenIndex = children.findIndex((child) => child.type !== vue.Comment); if (firstNonCommentChildrenIndex === -1) return children; const firstNonCommentChildren = children[firstNonCommentChildrenIndex]; (_a2 = firstNonCommentChildren.props) == null ? true : delete _a2.ref; const mergedProps = firstNonCommentChildren.props ? vue.mergeProps(attrs, firstNonCommentChildren.props) : attrs; const cloned = vue.cloneVNode({ ...firstNonCommentChildren, props: {} }, mergedProps); if (children.length === 1) return cloned; children[firstNonCommentChildrenIndex] = cloned; return children; }; } }); const SELF_CLOSING_TAGS = [ "area", "img", "input" ]; const Primitive = vue.defineComponent({ name: "Primitive", inheritAttrs: false, props: { asChild: { type: Boolean, default: false }, as: { type: [String, Object], default: "div" } }, setup(props, { attrs, slots }) { const asTag = props.asChild ? "template" : props.as; if (typeof asTag === "string" && SELF_CLOSING_TAGS.includes(asTag)) return () => vue.h(asTag, attrs); if (asTag !== "template") return () => vue.h(props.as, attrs, { default: slots.default }); return () => vue.h(Slot, attrs, { default: slots.default }); } }); function usePrimitiveElement() { const primitiveElement = vue.ref(); const currentElement = vue.computed(() => { var _a2, _b; return ["#text", "#comment"].includes((_a2 = primitiveElement.value) == null ? void 0 : _a2.$el.nodeName) ? (_b = primitiveElement.value) == null ? void 0 : _b.$el.nextElementSibling : unrefElement(primitiveElement); }); return { primitiveElement, currentElement }; } const [injectCollapsibleRootContext, provideCollapsibleRootContext] = createContext("CollapsibleRoot"); var CollapsibleRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "CollapsibleRoot", props: { defaultOpen: { type: Boolean, required: false, default: false }, open: { type: Boolean, required: false, default: void 0 }, disabled: { type: Boolean, required: false }, unmountOnHide: { type: Boolean, required: false, default: true }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["update:open"], setup(__props, { expose: __expose, emit: __emit }) { const props = __props; const emit2 = __emit; const open = useVModel(props, "open", emit2, { defaultValue: props.defaultOpen, passive: props.open === void 0 }); const { disabled, unmountOnHide } = vue.toRefs(props); provideCollapsibleRootContext({ contentId: "", disabled, open, unmountOnHide, onOpenToggle: () => { if (disabled.value) return; open.value = !open.value; } }); __expose({ open }); useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: __props.as, "as-child": props.asChild, "data-state": vue.unref(open) ? "open" : "closed", "data-disabled": vue.unref(disabled) ? "" : void 0 }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open) })]), _: 3 }, 8, [ "as", "as-child", "data-state", "data-disabled" ]); }; } }); var CollapsibleRoot_default = CollapsibleRoot_vue_vue_type_script_setup_true_lang_default; var CollapsibleContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "CollapsibleContent", props: { forceMount: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["contentFound"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectCollapsibleRootContext(); rootContext.contentId || (rootContext.contentId = useId(void 0, "reka-collapsible-content")); const presentRef = vue.ref(); const { forwardRef, currentElement } = useForwardExpose(); const width = vue.ref(0); const height = vue.ref(0); const isOpen = vue.computed(() => rootContext.open.value); const isMountAnimationPrevented = vue.ref(isOpen.value); const currentStyle = vue.ref(); vue.watch(() => { var _a2; return [isOpen.value, (_a2 = presentRef.value) == null ? void 0 : _a2.present]; }, async () => { await vue.nextTick(); const node = currentElement.value; if (!node) return; currentStyle.value = currentStyle.value || { transitionDuration: node.style.transitionDuration, animationName: node.style.animationName }; node.style.transitionDuration = "0s"; node.style.animationName = "none"; const rect = node.getBoundingClientRect(); height.value = rect.height; width.value = rect.width; if (!isMountAnimationPrevented.value) { node.style.transitionDuration = currentStyle.value.transitionDuration; node.style.animationName = currentStyle.value.animationName; } }, { immediate: true }); const skipAnimation = vue.computed(() => isMountAnimationPrevented.value && rootContext.open.value); vue.onMounted(() => { requestAnimationFrame(() => { isMountAnimationPrevented.value = false; }); }); useEventListener(currentElement, "beforematch", (ev) => { requestAnimationFrame(() => { rootContext.onOpenToggle(); emits("contentFound"); }); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { ref_key: "presentRef", ref: presentRef, present: __props.forceMount || vue.unref(rootContext).open.value, "force-mount": true }, { default: vue.withCtx(({ present }) => { var _a2; return [vue.createVNode(vue.unref(Primitive), vue.mergeProps(_ctx.$attrs, { id: vue.unref(rootContext).contentId, ref: vue.unref(forwardRef), "as-child": props.asChild, as: __props.as, hidden: !present ? vue.unref(rootContext).unmountOnHide.value ? "" : "until-found" : void 0, "data-state": skipAnimation.value ? void 0 : vue.unref(rootContext).open.value ? "open" : "closed", "data-disabled": ((_a2 = vue.unref(rootContext).disabled) == null ? void 0 : _a2.value) ? "" : void 0, style: { [`--reka-collapsible-content-height`]: `${height.value}px`, [`--reka-collapsible-content-width`]: `${width.value}px` } }), { default: vue.withCtx(() => [(vue.unref(rootContext).unmountOnHide.value ? present : true) ? vue.renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : vue.createCommentVNode("v-if", true)]), _: 2 }, 1040, [ "id", "as-child", "as", "hidden", "data-state", "data-disabled", "style" ])]; }), _: 3 }, 8, ["present"]); }; } }); var CollapsibleContent_default = CollapsibleContent_vue_vue_type_script_setup_true_lang_default; var CollapsibleTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "CollapsibleTrigger", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; useForwardExpose(); const rootContext = injectCollapsibleRootContext(); return (_ctx, _cache) => { var _a2, _b; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { type: __props.as === "button" ? "button" : void 0, as: __props.as, "as-child": props.asChild, "aria-controls": vue.unref(rootContext).contentId, "aria-expanded": vue.unref(rootContext).open.value, "data-state": vue.unref(rootContext).open.value ? "open" : "closed", "data-disabled": ((_a2 = vue.unref(rootContext).disabled) == null ? void 0 : _a2.value) ? "" : void 0, disabled: (_b = vue.unref(rootContext).disabled) == null ? void 0 : _b.value, onClick: vue.unref(rootContext).onOpenToggle }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "type", "as", "as-child", "aria-controls", "aria-expanded", "data-state", "data-disabled", "disabled", "onClick" ]); }; } }); var CollapsibleTrigger_default = CollapsibleTrigger_vue_vue_type_script_setup_true_lang_default; function validateProps({ type, defaultValue, modelValue }) { const value = modelValue || defaultValue; const canTypeBeInferred = modelValue !== void 0 || defaultValue !== void 0; if (canTypeBeInferred) return Array.isArray(value) ? "multiple" : "single"; else return type != null ? type : "single"; } function getDefaultType({ type, defaultValue, modelValue }) { if (type) return type; return validateProps({ type, defaultValue, modelValue }); } function getDefaultValue({ type, defaultValue }) { if (defaultValue !== void 0) return defaultValue; return type === "single" ? void 0 : []; } function useSingleOrMultipleValue(props, emits) { const type = vue.computed(() => getDefaultType(props)); const modelValue = useVModel(props, "modelValue", emits, { defaultValue: getDefaultValue(props), passive: props.modelValue === void 0, deep: true }); function changeModelValue(value) { if (type.value === "single") modelValue.value = isEqual$1(value, modelValue.value) ? void 0 : value; else { const modelValueArray = Array.isArray(modelValue.value) ? [...modelValue.value || []] : [modelValue.value].filter(Boolean); if (isValueEqualOrExist(modelValueArray, value)) { const index = modelValueArray.findIndex((i) => isEqual$1(i, value)); modelValueArray.splice(index, 1); } else modelValueArray.push(value); modelValue.value = modelValueArray; } } const isSingle = vue.computed(() => type.value === "single"); return { modelValue, changeModelValue, isSingle }; } const [injectAccordionRootContext, provideAccordionRootContext] = createContext("AccordionRoot"); var AccordionRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "AccordionRoot", props: { collapsible: { type: Boolean, required: false, default: false }, disabled: { type: Boolean, required: false, default: false }, dir: { type: String, required: false }, orientation: { type: String, required: false, default: "vertical" }, unmountOnHide: { type: Boolean, required: false, default: true }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, type: { type: String, required: false }, modelValue: { type: null, required: false }, defaultValue: { type: null, required: false } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { dir, disabled, unmountOnHide } = vue.toRefs(props); const direction = useDirection(dir); const { modelValue, changeModelValue, isSingle } = useSingleOrMultipleValue(props, emits); const { forwardRef, currentElement: parentElement } = useForwardExpose(); provideAccordionRootContext({ disabled, direction, orientation: props.orientation, parentElement, isSingle, collapsible: props.collapsible, modelValue, changeModelValue, unmountOnHide }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { ref: vue.unref(forwardRef), "as-child": __props.asChild, as: __props.as }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue) })]), _: 3 }, 8, ["as-child", "as"]); }; } }); var AccordionRoot_default = AccordionRoot_vue_vue_type_script_setup_true_lang_default; var AccordionItemState = (function(AccordionItemState$1) { AccordionItemState$1["Open"] = "open"; AccordionItemState$1["Closed"] = "closed"; return AccordionItemState$1; })(AccordionItemState || {}); const [injectAccordionItemContext, provideAccordionItemContext] = createContext("AccordionItem"); var AccordionItem_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "AccordionItem", props: { disabled: { type: Boolean, required: false }, value: { type: String, required: true }, unmountOnHide: { type: Boolean, required: false, default: void 0 }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props, { expose: __expose }) { const props = __props; const rootContext = injectAccordionRootContext(); const open = vue.computed(() => rootContext.isSingle.value ? props.value === rootContext.modelValue.value : Array.isArray(rootContext.modelValue.value) && rootContext.modelValue.value.includes(props.value)); const disabled = vue.computed(() => { return rootContext.disabled.value || props.disabled; }); const dataDisabled = vue.computed(() => disabled.value ? "" : void 0); const dataState = vue.computed(() => open.value ? AccordionItemState.Open : AccordionItemState.Closed); __expose({ open, dataDisabled }); const { currentRef, currentElement } = useForwardExpose(); provideAccordionItemContext({ open, dataState, disabled, dataDisabled, triggerId: "", currentRef, currentElement, value: vue.computed(() => props.value) }); function handleArrowKey(e) { var _a2, _b; const target = e.target; const allCollectionItems = Array.from((_b = (_a2 = rootContext.parentElement.value) == null ? void 0 : _a2.querySelectorAll("[data-reka-collection-item]")) != null ? _b : []); const collectionItemIndex = allCollectionItems.findIndex((item) => item === target); if (collectionItemIndex === -1) return null; useArrowNavigation(e, target, rootContext.parentElement.value, { arrowKeyOptions: rootContext.orientation, dir: rootContext.direction.value, focus: true }); } return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(CollapsibleRoot_default), { "data-orientation": vue.unref(rootContext).orientation, "data-disabled": dataDisabled.value, "data-state": dataState.value, disabled: disabled.value, open: open.value, as: props.as, "as-child": props.asChild, "unmount-on-hide": (_a2 = props.unmountOnHide) != null ? _a2 : vue.unref(rootContext).unmountOnHide.value, onKeydown: vue.withKeys(handleArrowKey, [ "up", "down", "left", "right", "home", "end" ]) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { open: open.value })]), _: 3 }, 8, [ "data-orientation", "data-disabled", "data-state", "disabled", "open", "as", "as-child", "unmount-on-hide" ]); }; } }); var AccordionItem_default = AccordionItem_vue_vue_type_script_setup_true_lang_default; var AccordionContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "AccordionContent", props: { forceMount: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const rootContext = injectAccordionRootContext(); const itemContext = injectAccordionItemContext(); useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollapsibleContent_default), { role: "region", "as-child": props.asChild, as: __props.as, "force-mount": props.forceMount, "aria-labelledby": vue.unref(itemContext).triggerId, "data-state": vue.unref(itemContext).dataState.value, "data-disabled": vue.unref(itemContext).dataDisabled.value, "data-orientation": vue.unref(rootContext).orientation, style: { "--reka-accordion-content-width": "var(--reka-collapsible-content-width)", "--reka-accordion-content-height": "var(--reka-collapsible-content-height)" }, onContentFound: _cache[0] || (_cache[0] = ($event) => vue.unref(rootContext).changeModelValue(vue.unref(itemContext).value.value)) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as-child", "as", "force-mount", "aria-labelledby", "data-state", "data-disabled", "data-orientation" ]); }; } }); var AccordionContent_default = AccordionContent_vue_vue_type_script_setup_true_lang_default; var AccordionTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "AccordionTrigger", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const rootContext = injectAccordionRootContext(); const itemContext = injectAccordionItemContext(); itemContext.triggerId || (itemContext.triggerId = useId(void 0, "reka-accordion-trigger")); function changeItem() { const triggerDisabled = rootContext.isSingle.value && itemContext.open.value && !rootContext.collapsible; if (itemContext.disabled.value || triggerDisabled) return; rootContext.changeModelValue(itemContext.value.value); } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollapsibleTrigger_default), { id: vue.unref(itemContext).triggerId, ref: vue.unref(itemContext).currentRef, "data-reka-collection-item": "", as: props.as, "as-child": props.asChild, "aria-disabled": vue.unref(itemContext).disabled.value || void 0, "aria-expanded": vue.unref(itemContext).open.value || false, "data-disabled": vue.unref(itemContext).dataDisabled.value, "data-orientation": vue.unref(rootContext).orientation, "data-state": vue.unref(itemContext).dataState.value, disabled: vue.unref(itemContext).disabled.value, onClick: changeItem }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "id", "as", "as-child", "aria-disabled", "aria-expanded", "data-disabled", "data-orientation", "data-state", "disabled" ]); }; } }); var AccordionTrigger_default = AccordionTrigger_vue_vue_type_script_setup_true_lang_default; const [injectDialogRootContext, provideDialogRootContext] = createContext("DialogRoot"); var DialogRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "DialogRoot", props: { open: { type: Boolean, required: false, default: void 0 }, defaultOpen: { type: Boolean, required: false, default: false }, modal: { type: Boolean, required: false, default: true }, unmountOnHide: { type: Boolean, required: false, default: true } }, emits: ["update:open"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; const open = useVModel(props, "open", emit2, { defaultValue: props.defaultOpen, passive: props.open === void 0 }); const triggerElement = vue.ref(); const contentElement = vue.ref(); const { modal, unmountOnHide } = vue.toRefs(props); provideDialogRootContext({ open, modal, unmountOnHide, openModal: () => { open.value = true; }, onOpenChange: (value) => { open.value = value; }, onOpenToggle: () => { open.value = !open.value; }, contentId: "", titleId: "", descriptionId: "", triggerElement, contentElement }); return (_ctx, _cache) => { return vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open), close: () => open.value = false }); }; } }); var DialogRoot_default = DialogRoot_vue_vue_type_script_setup_true_lang_default; var DialogClose_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogClose", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; useForwardExpose(); const rootContext = injectDialogRootContext(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { type: __props.as === "button" ? "button" : void 0, onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(rootContext).onOpenChange(false)) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["type"]); }; } }); var DialogClose_default = DialogClose_vue_vue_type_script_setup_true_lang_default; const POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside"; const FOCUS_OUTSIDE = "dismissableLayer.focusOutside"; function isElement$1(node) { var _a2; if (typeof node !== "object" || node === null) return false; const ownerWindow = (_a2 = node.ownerDocument) == null ? void 0 : _a2.defaultView; return typeof Element !== "undefined" && node instanceof Element || !!ownerWindow && node instanceof ownerWindow.Element; } function isLayerExist(layerElement, targetElement) { if (!isElement$1(targetElement)) return false; if (layerElement.contains(targetElement)) return true; const targetLayer = targetElement.closest("[data-dismissable-layer]"); const mainLayer = layerElement.dataset.dismissableLayer === "" ? layerElement : layerElement.querySelector("[data-dismissable-layer]"); const nodeList = Array.from(layerElement.ownerDocument.querySelectorAll("[data-dismissable-layer]")); if (targetLayer && (mainLayer === targetLayer || nodeList.indexOf(mainLayer) < nodeList.indexOf(targetLayer))) return true; else return false; } function usePointerDownOutside(onPointerDownOutside, element, enabled2 = true) { const isPointerInsideDOMTree = vue.ref(false); const handleClickRef = vue.ref(() => { }); vue.watchEffect((cleanupFn) => { var _a2, _b; if (!isClient || !vue.toValue(enabled2)) return; const ownerDocument = (_b = (_a2 = element == null ? void 0 : element.value) == null ? void 0 : _a2.ownerDocument) != null ? _b : globalThis.document; const handlePointerDown = async (event) => { const target = event.target; if (!(element == null ? void 0 : element.value) || !target) return; if (isLayerExist(element.value, target)) { ownerDocument.removeEventListener("click", handleClickRef.value); isPointerInsideDOMTree.value = false; return; } if (event.target && !isPointerInsideDOMTree.value) { let handleAndDispatchPointerDownOutsideEvent = function() { handleAndDispatchCustomEvent$1(POINTER_DOWN_OUTSIDE, onPointerDownOutside, eventDetail); }; const eventDetail = { originalEvent: event }; if (event.pointerType === "touch") { ownerDocument.removeEventListener("click", handleClickRef.value); handleClickRef.value = handleAndDispatchPointerDownOutsideEvent; ownerDocument.addEventListener("click", handleClickRef.value, { once: true }); } else handleAndDispatchPointerDownOutsideEvent(); } else ownerDocument.removeEventListener("click", handleClickRef.value); isPointerInsideDOMTree.value = false; }; const timerId = window.setTimeout(() => { ownerDocument.addEventListener("pointerdown", handlePointerDown); }, 0); cleanupFn(() => { window.clearTimeout(timerId); ownerDocument.removeEventListener("pointerdown", handlePointerDown); ownerDocument.removeEventListener("click", handleClickRef.value); }); }); return { onPointerDownCapture: () => { if (!vue.toValue(enabled2)) return; isPointerInsideDOMTree.value = true; } }; } function useFocusOutside(onFocusOutside, element, enabled2 = true) { const isFocusInsideDOMTree = vue.ref(false); vue.watchEffect((cleanupFn) => { var _a2, _b; if (!isClient || !vue.toValue(enabled2)) return; const ownerDocument = (_b = (_a2 = element == null ? void 0 : element.value) == null ? void 0 : _a2.ownerDocument) != null ? _b : globalThis.document; const handleFocus = async (event) => { if (!(element == null ? void 0 : element.value)) return; await vue.nextTick(); await vue.nextTick(); const target = event.target; if (!element.value || !target || isLayerExist(element.value, target)) return; if (event.target && !isFocusInsideDOMTree.value) { const eventDetail = { originalEvent: event }; handleAndDispatchCustomEvent$1(FOCUS_OUTSIDE, onFocusOutside, eventDetail); } }; ownerDocument.addEventListener("focusin", handleFocus); cleanupFn(() => ownerDocument.removeEventListener("focusin", handleFocus)); }); return { onFocusCapture: () => { if (!vue.toValue(enabled2)) return; isFocusInsideDOMTree.value = true; }, onBlurCapture: () => { if (!vue.toValue(enabled2)) return; isFocusInsideDOMTree.value = false; } }; } const context = vue.reactive({ layersRoot: new Set(), layersWithOutsidePointerEventsDisabled: new Set(), branches: new Set() }); var DismissableLayer_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DismissableLayer", props: { disableOutsidePointerEvents: { type: Boolean, required: false, default: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, present: { type: Boolean, required: false, default: true } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "dismiss" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { forwardRef, currentElement: layerElement } = useForwardExpose(); const ownerDocument = vue.computed(() => { var _a2, _b; return (_b = (_a2 = layerElement.value) == null ? void 0 : _a2.ownerDocument) != null ? _b : globalThis.document; }); const layers = vue.computed(() => context.layersRoot); const index = vue.computed(() => { return layerElement.value ? Array.from(layers.value).indexOf(layerElement.value) : -1; }); const isBodyPointerEventsDisabled = vue.computed(() => { return context.layersWithOutsidePointerEventsDisabled.size > 0; }); const isPointerEventsEnabled = vue.computed(() => { const localLayers = Array.from(layers.value); const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); const highestLayerWithOutsidePointerEventsDisabledIndex = localLayers.indexOf(highestLayerWithOutsidePointerEventsDisabled); return index.value >= highestLayerWithOutsidePointerEventsDisabledIndex; }); const pointerDownOutside2 = usePointerDownOutside(async (event) => { const isPointerDownOnBranch = [...context.branches].some((branch) => branch == null ? void 0 : branch.contains(event.target)); if (!props.present || !isPointerEventsEnabled.value || isPointerDownOnBranch) return; emits("pointerDownOutside", event); emits("interactOutside", event); await vue.nextTick(); if (!event.defaultPrevented) emits("dismiss"); }, layerElement, () => props.present); const focusOutside = useFocusOutside((event) => { const isFocusInBranch = [...context.branches].some((branch) => branch == null ? void 0 : branch.contains(event.target)); if (!props.present || isFocusInBranch) return; emits("focusOutside", event); emits("interactOutside", event); if (!event.defaultPrevented) emits("dismiss"); }, layerElement); onKeyStroke("Escape", (event) => { if (!props.present) return; const isHighestLayer = index.value === layers.value.size - 1; if (!isHighestLayer) return; emits("escapeKeyDown", event); if (!event.defaultPrevented) emits("dismiss"); }, { target: () => { var _a2, _b; return (_b = (_a2 = ownerDocument.value) == null ? void 0 : _a2.defaultView) != null ? _b : globalThis.window; } }); vue.watch([ layerElement, () => props.disableOutsidePointerEvents, () => props.present ], ([element, disableOutsidePointerEvents, present], _2, onCleanup) => { if (!element || !present) return; if (disableOutsidePointerEvents) { const doc2 = element.ownerDocument; acquireBodyPointerEvents(doc2, element); context.layersWithOutsidePointerEventsDisabled.add(element); onCleanup(() => { context.layersWithOutsidePointerEventsDisabled.delete(element); releaseBodyPointerEvents(doc2, element); }); } }, { immediate: true }); vue.watch([layerElement, () => props.present], ([element, present], _2, onCleanup) => { if (!element || !present) return; layers.value.add(element); onCleanup(() => { layers.value.delete(element); }); }, { immediate: true }); vue.watchEffect((cleanupFn) => { cleanupFn(() => { if (!layerElement.value) return; layers.value.delete(layerElement.value); context.layersWithOutsidePointerEventsDisabled.delete(layerElement.value); }); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { ref: vue.unref(forwardRef), "as-child": __props.asChild, as: __props.as, "data-dismissable-layer": "", style: vue.normalizeStyle({ pointerEvents: isBodyPointerEventsDisabled.value ? isPointerEventsEnabled.value ? "auto" : "none" : void 0 }), onFocusCapture: vue.unref(focusOutside).onFocusCapture, onBlurCapture: vue.unref(focusOutside).onBlurCapture, onPointerdownCapture: vue.unref(pointerDownOutside2).onPointerDownCapture }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as-child", "as", "style", "onFocusCapture", "onBlurCapture", "onPointerdownCapture" ]); }; } }); var DismissableLayer_default = DismissableLayer_vue_vue_type_script_setup_true_lang_default; var DismissableLayerBranch_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DismissableLayerBranch", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const { forwardRef, currentElement } = useForwardExpose(); let registeredElement = null; vue.onMounted(() => { registeredElement = currentElement.value; if (registeredElement) context.branches.add(registeredElement); }); vue.onUnmounted(() => { if (registeredElement) { context.branches.delete(registeredElement); registeredElement = null; } }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps({ ref: vue.unref(forwardRef) }, props), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DismissableLayerBranch_default = DismissableLayerBranch_vue_vue_type_script_setup_true_lang_default; const useFocusStackState = createGlobalState(() => { const stack = vue.ref([]); return stack; }); function createFocusScopesStack() { const stack = useFocusStackState(); return { add(focusScope) { const activeFocusScope = stack.value[0]; if (focusScope !== activeFocusScope) activeFocusScope == null ? void 0 : activeFocusScope.pause(); stack.value = arrayRemove(stack.value, focusScope); stack.value.unshift(focusScope); }, remove(focusScope) { var _a2; stack.value = arrayRemove(stack.value, focusScope); (_a2 = stack.value[0]) == null ? void 0 : _a2.resume(); } }; } function arrayRemove(array, item) { const updatedArray = [...array]; const index = updatedArray.indexOf(item); if (index !== -1) updatedArray.splice(index, 1); return updatedArray; } const AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount"; const AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount"; const EVENT_OPTIONS$1 = { bubbles: false, cancelable: true }; function containsComposed(container, node) { var _a2; let current = node; while (current) { if (container.contains(current)) return true; current = (_a2 = current.getRootNode().host) != null ? _a2 : null; } return false; } function focusFirst$3(candidates, { select = false } = {}) { const previouslyFocusedElement = getActiveElement(); for (const candidate of candidates) { focus(candidate, { select }); if (getActiveElement() !== previouslyFocusedElement) return true; } } function getTabbableEdges(container) { const candidates = getTabbableCandidates$1(container); const first = findVisible(candidates, container); const last = findVisible(candidates.reverse(), container); return [first, last]; } function getTabbableCandidates$1(container) { const nodes = []; const walker = document.createTreeWalker(container, 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 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); while (walker.nextNode()) nodes.push(walker.currentNode); return nodes.sort((a, b) => { if (a.tabIndex === b.tabIndex) return 0; if (a.tabIndex === 0) return 1; if (b.tabIndex === 0) return -1; return a.tabIndex - b.tabIndex; }); } function findVisible(elements, container) { for (const element of elements) if (!isHidden(element, { upTo: container })) return element; } function isHidden(node, { upTo }) { if (getComputedStyle(node).visibility === "hidden") return true; while (node) { if (upTo !== void 0 && node === upTo) return false; if (getComputedStyle(node).display === "none") return true; node = node.parentElement; } return false; } function isSelectableInput(element) { return element instanceof HTMLInputElement && "select" in element; } function focus(element, { select = false } = {}) { if (element && element.focus) { const previouslyFocusedElement = getActiveElement(); element.focus({ preventScroll: true }); if (element !== previouslyFocusedElement && isSelectableInput(element) && select) element.select(); } } var FocusScope_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "FocusScope", props: { loop: { type: Boolean, required: false, default: false }, trapped: { type: Boolean, required: false, default: false }, present: { type: Boolean, required: false, default: true }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["mountAutoFocus", "unmountAutoFocus"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { currentRef, currentElement } = useForwardExpose(); const lastFocusedElementRef = vue.ref(null); const focusScopesStack = createFocusScopesStack(); const focusScope = vue.reactive({ paused: false, pause() { this.paused = true; }, resume() { this.paused = false; } }); vue.watchEffect((cleanupFn) => { var _a2; if (!isClient) return; const container = currentElement.value; if (!props.trapped) return; const ownerDocument = (_a2 = container == null ? void 0 : container.ownerDocument) != null ? _a2 : document; const root = container ? container.getRootNode() : ownerDocument; function handleFocusIn(event) { if (focusScope.paused || !container) return; const target = event.target; if (container.contains(target)) lastFocusedElementRef.value = target; else focus(lastFocusedElementRef.value, { select: true }); } function handleFocusOut(event) { if (focusScope.paused || !container) return; const relatedTarget = event.relatedTarget; if (relatedTarget === null) return; if (!container.contains(relatedTarget)) focus(lastFocusedElementRef.value, { select: true }); } function handleMutations(mutations) { const lastFocusedElement = lastFocusedElementRef.value; if (lastFocusedElement === null) return; const anyNodesRemoved = mutations.some((m) => m.removedNodes.length > 0); if (!anyNodesRemoved) return; const activeElement = getActiveElement(); if (activeElement && container.contains(activeElement)) return; const isLastFocusedElementExist = container.contains(lastFocusedElement); if (!isLastFocusedElementExist) focus(container); } function handleDocumentFocusIn(event) { if (focusScope.paused || !container) return; const target = event.composedPath()[0]; if (!containsComposed(container, target)) focus(lastFocusedElementRef.value, { select: true }); } root.addEventListener("focusin", handleFocusIn); root.addEventListener("focusout", handleFocusOut); if (root !== ownerDocument) ownerDocument.addEventListener("focusin", handleDocumentFocusIn); const mutationObserver = new MutationObserver(handleMutations); if (container) mutationObserver.observe(container, { childList: true, subtree: true }); cleanupFn(() => { root.removeEventListener("focusin", handleFocusIn); root.removeEventListener("focusout", handleFocusOut); if (root !== ownerDocument) ownerDocument.removeEventListener("focusin", handleDocumentFocusIn); mutationObserver.disconnect(); }); }); function dispatchMountAutoFocus(container, previouslyFocusedElement) { const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS$1); const handleMountAutoFocus = (ev) => emits("mountAutoFocus", ev); container.addEventListener(AUTOFOCUS_ON_MOUNT, handleMountAutoFocus); container.dispatchEvent(mountEvent); container.removeEventListener(AUTOFOCUS_ON_MOUNT, handleMountAutoFocus); if (!mountEvent.defaultPrevented) { focusFirst$3(getTabbableCandidates$1(container), { select: true }); if (getActiveElement() === previouslyFocusedElement) focus(container); } } vue.watchEffect(async (cleanupFn) => { const container = currentElement.value; await vue.nextTick(); if (!container) return; if (props.present !== false) focusScopesStack.add(focusScope); const previouslyFocusedElement = getActiveElement(); const hasFocusedCandidate = container.contains(previouslyFocusedElement); if (!hasFocusedCandidate && props.present !== false) dispatchMountAutoFocus(container, previouslyFocusedElement); cleanupFn(() => { const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS$1); const unmountEventHandler = (ev) => { emits("unmountAutoFocus", ev); }; container.addEventListener(AUTOFOCUS_ON_UNMOUNT, unmountEventHandler); container.dispatchEvent(unmountEvent); container.setAttribute("data-focus-scope-unmounting", ""); setTimeout(() => { if (!unmountEvent.defaultPrevented) focus(previouslyFocusedElement != null ? previouslyFocusedElement : document.body, { select: true }); container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, unmountEventHandler); focusScopesStack.remove(focusScope); container.removeAttribute("data-focus-scope-unmounting"); }, 0); }); }); vue.watch(() => props.present, async (present, prevPresent) => { if (!isClient) return; if (present === false && prevPresent === true) { focusScopesStack.remove(focusScope); return; } if (present !== true || prevPresent !== false) return; focusScopesStack.add(focusScope); await vue.nextTick(); const container = currentElement.value; if (!container) return; const previouslyFocusedElement = getActiveElement(); if (!container.contains(previouslyFocusedElement)) dispatchMountAutoFocus(container, previouslyFocusedElement); }); function handleKeyDown(event) { if (!props.loop && !props.trapped) return; if (focusScope.paused) return; const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey; const focusedElement = getActiveElement(); if (isTabKey && focusedElement) { const container = event.currentTarget; const [first, last] = getTabbableEdges(container); const hasTabbableElementsInside = first && last; if (!hasTabbableElementsInside) { if (focusedElement === container) event.preventDefault(); } else if (!event.shiftKey && focusedElement === last) { event.preventDefault(); if (props.loop) focus(first, { select: true }); } else if (event.shiftKey && focusedElement === first) { event.preventDefault(); if (props.loop) focus(last, { select: true }); } } } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { ref_key: "currentRef", ref: currentRef, tabindex: "-1", "as-child": __props.asChild, as: __props.as, onKeydown: handleKeyDown }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, ["as-child", "as"]); }; } }); var FocusScope_default = FocusScope_vue_vue_type_script_setup_true_lang_default; const ITEM_SELECT = "menu.itemSelect"; const SELECTION_KEYS = ["Enter", " "]; const FIRST_KEYS = [ "ArrowDown", "PageUp", "Home" ]; const LAST_KEYS = [ "ArrowUp", "PageDown", "End" ]; const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS]; const SUB_OPEN_KEYS = { ltr: [...SELECTION_KEYS, "ArrowRight"], rtl: [...SELECTION_KEYS, "ArrowLeft"] }; const SUB_CLOSE_KEYS = { ltr: ["ArrowLeft"], rtl: ["ArrowRight"] }; function getOpenState$1(open) { return open ? "open" : "closed"; } function isIndeterminate$1(checked) { return checked === "indeterminate"; } function getCheckedState(checked) { return isIndeterminate$1(checked) ? "indeterminate" : checked ? "checked" : "unchecked"; } function omitEntryFocusListener(attrs) { const { onEntryFocus: _2, onEntryFocusOnce: __, ...rest } = attrs; return rest; } function focusFirst$2(candidates) { const PREVIOUSLY_FOCUSED_ELEMENT = getActiveElement(); for (const candidate of candidates) { if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; candidate.focus(); if (getActiveElement() !== PREVIOUSLY_FOCUSED_ELEMENT) return; } } function isPointInPolygon(point, polygon) { const { x, y } = point; let inside = false; for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { const xi = polygon[i].x; const yi = polygon[i].y; const xj = polygon[j].x; const yj = polygon[j].y; const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; if (intersect) inside = !inside; } return inside; } function isPointerInGraceArea(event, area) { if (!area) return false; const cursorPos = { x: event.clientX, y: event.clientY }; return isPointInPolygon(cursorPos, area); } function isMouseEvent(event) { return event.pointerType === "mouse"; } var DialogContentImpl_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogContentImpl", props: { forceMount: { type: Boolean, required: false }, trapFocus: { type: Boolean, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, present: { type: Boolean, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectDialogRootContext(); const { forwardRef, currentElement: contentElement } = useForwardExpose(); rootContext.titleId || (rootContext.titleId = useId(void 0, "reka-dialog-title")); rootContext.descriptionId || (rootContext.descriptionId = useId(void 0, "reka-dialog-description")); vue.onMounted(() => { rootContext.contentElement = contentElement; if (getActiveElement() !== document.body) rootContext.triggerElement.value = getActiveElement(); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(FocusScope_default), { "as-child": "", loop: "", trapped: props.trapFocus, present: props.present, onMountAutoFocus: _cache[5] || (_cache[5] = ($event) => emits("openAutoFocus", $event)), onUnmountAutoFocus: _cache[6] || (_cache[6] = ($event) => emits("closeAutoFocus", $event)) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(DismissableLayer_default), vue.mergeProps({ id: vue.unref(rootContext).contentId, ref: vue.unref(forwardRef), as: __props.as, "as-child": __props.asChild, present: props.present, "disable-outside-pointer-events": __props.disableOutsidePointerEvents, role: "dialog", "aria-describedby": vue.unref(rootContext).descriptionId, "aria-labelledby": vue.unref(rootContext).titleId, "data-state": vue.unref(getOpenState$1)(vue.unref(rootContext).open.value) }, _ctx.$attrs, { onDismiss: _cache[0] || (_cache[0] = ($event) => vue.unref(rootContext).onOpenChange(false)), onEscapeKeyDown: _cache[1] || (_cache[1] = ($event) => emits("escapeKeyDown", $event)), onFocusOutside: _cache[2] || (_cache[2] = ($event) => emits("focusOutside", $event)), onInteractOutside: _cache[3] || (_cache[3] = ($event) => emits("interactOutside", $event)), onPointerDownOutside: _cache[4] || (_cache[4] = ($event) => emits("pointerDownOutside", $event)) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "as", "as-child", "present", "disable-outside-pointer-events", "aria-describedby", "aria-labelledby", "data-state" ])]), _: 3 }, 8, ["trapped", "present"]); }; } }); var DialogContentImpl_default = DialogContentImpl_vue_vue_type_script_setup_true_lang_default; var DialogContentModal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogContentModal", props: { forceMount: { type: Boolean, required: false }, trapFocus: { type: Boolean, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false, default: true }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, present: { type: Boolean, required: true } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectDialogRootContext(); const emitsAsProps = useEmitAsProps(emits); const { forwardRef, currentElement } = useForwardExpose(); const ariaHiddenTarget = vue.computed(() => props.present ? currentElement.value : void 0); useHideOthers(ariaHiddenTarget); const forwardedProps = vue.computed(() => { const { present: _2, ...rest } = props; return rest; }); vue.watch(() => props.present, (isPresent, wasPresent) => { var _a2; if (!isPresent && wasPresent) (_a2 = rootContext.triggerElement.value) == null ? void 0 : _a2.focus(); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(DialogContentImpl_default, vue.mergeProps({ ...forwardedProps.value, ...vue.unref(emitsAsProps) }, { ref: vue.unref(forwardRef), present: __props.present, "trap-focus": vue.unref(rootContext).open.value, "disable-outside-pointer-events": props.disableOutsidePointerEvents, onCloseAutoFocus: _cache[0] || (_cache[0] = (event) => { var _a2; if (!event.defaultPrevented) { event.preventDefault(); (_a2 = vue.unref(rootContext).triggerElement.value) == null ? void 0 : _a2.focus(); } }), onPointerDownOutside: _cache[1] || (_cache[1] = (event) => { const originalEvent = event.detail.originalEvent; const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; const isRightClick = originalEvent.button === 2 || ctrlLeftClick; if (isRightClick) event.preventDefault(); }), onFocusOutside: _cache[2] || (_cache[2] = (event) => { event.preventDefault(); }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "present", "trap-focus", "disable-outside-pointer-events" ]); }; } }); var DialogContentModal_default = DialogContentModal_vue_vue_type_script_setup_true_lang_default; var DialogContentNonModal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogContentNonModal", props: { forceMount: { type: Boolean, required: false }, trapFocus: { type: Boolean, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, present: { type: Boolean, required: true } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const emitsAsProps = useEmitAsProps(emits); useForwardExpose(); const rootContext = injectDialogRootContext(); const hasInteractedOutsideRef = vue.ref(false); const hasPointerDownOutsideRef = vue.ref(false); const forwardedProps = vue.computed(() => { const { present: _2, ...rest } = props; return rest; }); vue.watch(() => props.present, (isPresent, wasPresent) => { var _a2; if (!isPresent && wasPresent) { if (!hasInteractedOutsideRef.value) (_a2 = rootContext.triggerElement.value) == null ? void 0 : _a2.focus(); hasInteractedOutsideRef.value = false; hasPointerDownOutsideRef.value = false; } }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(DialogContentImpl_default, vue.mergeProps({ ...forwardedProps.value, ...vue.unref(emitsAsProps) }, { present: __props.present, "trap-focus": false, "disable-outside-pointer-events": false, onCloseAutoFocus: _cache[0] || (_cache[0] = (event) => { var _a2; if (!event.defaultPrevented) { if (!hasInteractedOutsideRef.value) (_a2 = vue.unref(rootContext).triggerElement.value) == null ? void 0 : _a2.focus(); event.preventDefault(); } hasInteractedOutsideRef.value = false; hasPointerDownOutsideRef.value = false; }), onInteractOutside: _cache[1] || (_cache[1] = (event) => { var _a2; if (!event.defaultPrevented) { hasInteractedOutsideRef.value = true; if (event.detail.originalEvent.type === "pointerdown") hasPointerDownOutsideRef.value = true; } const target = event.target; const targetIsTrigger = (_a2 = vue.unref(rootContext).triggerElement.value) == null ? void 0 : _a2.contains(target); if (targetIsTrigger) event.preventDefault(); if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.value) event.preventDefault(); }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["present"]); }; } }); var DialogContentNonModal_default = DialogContentNonModal_vue_vue_type_script_setup_true_lang_default; var DialogContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogContent", props: { forceMount: { type: Boolean, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false, default: void 0 }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectDialogRootContext(); const emitsAsProps = useEmitAsProps(emits); const { forwardRef } = useForwardExpose(); const staysMounted = vue.computed(() => props.forceMount || !rootContext.unmountOnHide.value); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: vue.unref(rootContext).open.value, "force-mount": staysMounted.value }, { default: vue.withCtx(({ present }) => [vue.unref(rootContext).modal.value ? vue.withDirectives((vue.openBlock(), vue.createBlock(DialogContentModal_default, vue.mergeProps({ key: 0, ref: vue.unref(forwardRef), present: staysMounted.value ? present : true }, { ...props, ...vue.unref(emitsAsProps), ..._ctx.$attrs }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["present"])), [[vue.vShow, __props.forceMount || vue.unref(rootContext).unmountOnHide.value || present]]) : vue.withDirectives((vue.openBlock(), vue.createBlock(DialogContentNonModal_default, vue.mergeProps({ key: 1, ref: vue.unref(forwardRef), present: staysMounted.value ? present : true }, { ...props, ...vue.unref(emitsAsProps), ..._ctx.$attrs }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["present"])), [[vue.vShow, __props.forceMount || vue.unref(rootContext).unmountOnHide.value || present]])]), _: 3 }, 8, ["present", "force-mount"]); }; } }); var DialogContent_default = DialogContent_vue_vue_type_script_setup_true_lang_default; var DialogDescription_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogDescription", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "p" } }, setup(__props) { const props = __props; useForwardExpose(); const rootContext = injectDialogRootContext(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { id: vue.unref(rootContext).descriptionId }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["id"]); }; } }); var DialogDescription_default = DialogDescription_vue_vue_type_script_setup_true_lang_default; var DialogOverlayImpl_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogOverlayImpl", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false }, present: { type: Boolean, required: false, default: true } }, setup(__props) { const props = __props; const rootContext = injectDialogRootContext(); const scrollLocked = useBodyScrollLock(props.present); vue.watch(() => props.present, (val) => scrollLocked.value = val); useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: __props.as, "as-child": __props.asChild, "data-state": vue.unref(rootContext).open.value ? "open" : "closed", style: { "pointer-events": "auto" }, onPointerdown: _cache[0] || (_cache[0] = vue.withModifiers(() => { }, [ "left", "self", "prevent" ])) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as", "as-child", "data-state" ]); }; } }); var DialogOverlayImpl_default = DialogOverlayImpl_vue_vue_type_script_setup_true_lang_default; var DialogOverlay_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogOverlay", props: { forceMount: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const rootContext = injectDialogRootContext(); const { forwardRef } = useForwardExpose(); const staysMounted = vue.computed(() => props.forceMount || !rootContext.unmountOnHide.value); return (_ctx, _cache) => { var _a2; return ((_a2 = vue.unref(rootContext)) == null ? void 0 : _a2.modal.value) ? (vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { key: 0, present: vue.unref(rootContext).open.value, "force-mount": staysMounted.value }, { default: vue.withCtx(({ present }) => [vue.withDirectives(vue.createVNode(DialogOverlayImpl_default, vue.mergeProps(_ctx.$attrs, { ref: vue.unref(forwardRef), as: __props.as, "as-child": __props.asChild, present: staysMounted.value ? present : true }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "as", "as-child", "present" ]), [[vue.vShow, __props.forceMount || vue.unref(rootContext).unmountOnHide.value || present]])]), _: 3 }, 8, ["present", "force-mount"])) : vue.createCommentVNode("v-if", true); }; } }); var DialogOverlay_default = DialogOverlay_vue_vue_type_script_setup_true_lang_default; var Teleport_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "Teleport", props: { to: { type: null, required: false }, disabled: { type: Boolean, required: false }, defer: { type: Boolean, required: false }, forceMount: { type: Boolean, required: false } }, setup(__props) { const props = __props; const configContext = injectConfigProviderContext({}); const target = vue.computed(() => { var _a2, _b, _c; return (_c = (_b = props.to) != null ? _b : (_a2 = configContext.teleportTo) == null ? void 0 : _a2.value) != null ? _c : "body"; }); const isMounted = useMounted(); return (_ctx, _cache) => { return vue.unref(isMounted) || __props.forceMount ? (vue.openBlock(), vue.createBlock(vue.Teleport, { key: 0, to: target.value, disabled: __props.disabled, defer: __props.defer }, [vue.renderSlot(_ctx.$slots, "default")], 8, [ "to", "disabled", "defer" ])) : vue.createCommentVNode("v-if", true); }; } }); var Teleport_default = Teleport_vue_vue_type_script_setup_true_lang_default; var DialogPortal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogPortal", props: { to: { type: null, required: false }, disabled: { type: Boolean, required: false }, defer: { type: Boolean, required: false }, forceMount: { type: Boolean, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Teleport_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DialogPortal_default = DialogPortal_vue_vue_type_script_setup_true_lang_default; var DialogTitle_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogTitle", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "h2" } }, setup(__props) { const props = __props; const rootContext = injectDialogRootContext(); useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { id: vue.unref(rootContext).titleId }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["id"]); }; } }); var DialogTitle_default = DialogTitle_vue_vue_type_script_setup_true_lang_default; var DialogTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DialogTrigger", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; const rootContext = injectDialogRootContext(); const { forwardRef, currentElement } = useForwardExpose(); rootContext.contentId || (rootContext.contentId = useId(void 0, "reka-dialog-content")); vue.onMounted(() => { rootContext.triggerElement.value = currentElement.value; }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { ref: vue.unref(forwardRef), type: __props.as === "button" ? "button" : void 0, "aria-haspopup": "dialog", "aria-expanded": vue.unref(rootContext).open.value || false, "aria-controls": vue.unref(rootContext).open.value ? vue.unref(rootContext).contentId : void 0, "data-state": vue.unref(rootContext).open.value ? "open" : "closed", onClick: vue.unref(rootContext).onOpenToggle }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "type", "aria-expanded", "aria-controls", "data-state", "onClick" ]); }; } }); var DialogTrigger_default = DialogTrigger_vue_vue_type_script_setup_true_lang_default; const ITEM_DATA_ATTR = "data-reka-collection-item"; function useCollection(options = {}) { const { key = "", isProvider = false } = options; const injectionKey = `${key}CollectionProvider`; let context2; if (isProvider) { const itemMap = vue.ref( new Map()); const collectionRef = vue.ref(); context2 = { collectionRef, itemMap }; vue.provide(injectionKey, context2); } else context2 = vue.inject(injectionKey); const getItem = (element, includeDisabledItem = false) => { if (!context2.collectionRef.value) return void 0; const item = context2.itemMap.value.get(element); return item && (includeDisabledItem || item.ref.dataset.disabled !== "") ? item : void 0; }; const getItems = (includeDisabledItem = false) => { const collectionNode = context2.collectionRef.value; if (!collectionNode) return []; const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`)); const orderMap = new Map(orderedNodes.map((node, index) => [node, index])); const items = Array.from(context2.itemMap.value.values()); const orderedItems = items.sort((a, b) => { var _a2, _b; return ((_a2 = orderMap.get(a.ref)) != null ? _a2 : -1) - ((_b = orderMap.get(b.ref)) != null ? _b : -1); }); if (includeDisabledItem) return orderedItems; else return orderedItems.filter((i) => i.ref.dataset.disabled !== ""); }; const CollectionSlot = vue.defineComponent({ name: "CollectionSlot", inheritAttrs: false, setup(_2, { slots, attrs }) { const { primitiveElement, currentElement } = usePrimitiveElement(); vue.watch(currentElement, () => { context2.collectionRef.value = currentElement.value; }); return () => vue.h(Slot, { ref: primitiveElement, ...attrs }, slots); } }); const CollectionItem = vue.defineComponent({ name: "CollectionItem", inheritAttrs: false, props: { value: { validator: () => true } }, setup(props, { slots, attrs }) { const { primitiveElement, currentElement } = usePrimitiveElement(); vue.watchEffect((cleanupFn) => { if (currentElement.value) { const key$1 = vue.markRaw(currentElement.value); context2.itemMap.value.set(key$1, { ref: currentElement.value, value: props.value }); cleanupFn(() => context2.itemMap.value.delete(key$1)); } }); return () => vue.h(Slot, { ...attrs, [ITEM_DATA_ATTR]: "", ref: primitiveElement }, slots); } }); const reactiveItems = vue.computed(() => Array.from(context2.itemMap.value.values())); const itemMapSize = vue.computed(() => context2.itemMap.value.size); return { getItems, getItem, reactiveItems, itemMapSize, CollectionSlot, CollectionItem }; } var VisuallyHidden_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "VisuallyHidden", props: { feature: { type: String, required: false, default: "focusable" }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "span" } }, setup(__props) { return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: __props.as, "as-child": __props.asChild, "aria-hidden": __props.feature === "fully-hidden" ? "true" : void 0, "data-hidden": __props.feature === "fully-hidden" ? "" : void 0, tabindex: __props.feature === "fully-hidden" ? "-1" : void 0, style: { position: "absolute", border: 0, width: "1px", height: "1px", padding: 0, margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", clipPath: "inset(50%)", whiteSpace: "nowrap", wordWrap: "normal", top: "-1px", left: "-1px" } }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as", "as-child", "aria-hidden", "data-hidden", "tabindex" ]); }; } }); var VisuallyHidden_default = VisuallyHidden_vue_vue_type_script_setup_true_lang_default; var VisuallyHiddenInputBubble_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "VisuallyHiddenInputBubble", props: { name: { type: String, required: true }, value: { type: null, required: true }, checked: { type: Boolean, required: false, default: void 0 }, required: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, feature: { type: String, required: false, default: "fully-hidden" } }, setup(__props) { const props = __props; const { primitiveElement, currentElement } = usePrimitiveElement(); const valueState = vue.computed(() => { var _a2; return (_a2 = props.checked) != null ? _a2 : props.value; }); vue.watch(valueState, (cur, prev) => { if (!currentElement.value) return; const input = currentElement.value; const inputProto = window.HTMLInputElement.prototype; const descriptor = Object.getOwnPropertyDescriptor(inputProto, "value"); const setValue = descriptor.set; if (setValue && cur !== prev) { const inputEvent = new Event("input", { bubbles: true }); const changeEvent = new Event("change", { bubbles: true }); setValue.call(input, cur); input.dispatchEvent(inputEvent); input.dispatchEvent(changeEvent); } }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(VisuallyHidden_default, vue.mergeProps({ ref_key: "primitiveElement", ref: primitiveElement }, { ...props, ..._ctx.$attrs }, { as: "input" }), null, 16); }; } }); var VisuallyHiddenInputBubble_default = VisuallyHiddenInputBubble_vue_vue_type_script_setup_true_lang_default; var VisuallyHiddenInput_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "VisuallyHiddenInput", props: { name: { type: String, required: true }, value: { type: null, required: true }, checked: { type: Boolean, required: false, default: void 0 }, required: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, feature: { type: String, required: false, default: "fully-hidden" } }, setup(__props) { const props = __props; const isFormArrayEmptyAndRequired = vue.computed(() => typeof props.value === "object" && Array.isArray(props.value) && props.value.length === 0 && props.required); const parsedValue = vue.computed(() => { if (typeof props.value === "string" || typeof props.value === "number" || typeof props.value === "boolean" || props.value === null || props.value === void 0) return [{ name: props.name, value: props.value }]; else if (typeof props.value === "object" && Array.isArray(props.value)) return props.value.flatMap((obj, index) => { if (typeof obj === "object") return Object.entries(obj).map(([key, value]) => ({ name: `${props.name}[${index}][${key}]`, value })); else return { name: `${props.name}[${index}]`, value: obj }; }); else if (props.value !== null && typeof props.value === "object" && !Array.isArray(props.value)) return Object.entries(props.value).map(([key, value]) => ({ name: `${props.name}[${key}]`, value })); return []; }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [vue.createCommentVNode(" We render single input if it's required "), isFormArrayEmptyAndRequired.value ? (vue.openBlock(), vue.createBlock(VisuallyHiddenInputBubble_default, vue.mergeProps({ key: __props.name }, { ...props, ..._ctx.$attrs }, { name: __props.name, value: __props.value }), null, 16, ["name", "value"])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(parsedValue.value, (parsed) => { return vue.openBlock(), vue.createBlock(VisuallyHiddenInputBubble_default, vue.mergeProps({ key: parsed.name }, { ref_for: true }, { ...props, ..._ctx.$attrs }, { name: parsed.name, value: parsed.value }), null, 16, ["name", "value"]); }), 128))], 2112); }; } }); var VisuallyHiddenInput_default = VisuallyHiddenInput_vue_vue_type_script_setup_true_lang_default; function queryCheckedElement(parentEl) { return parentEl == null ? void 0 : parentEl.querySelector("[data-state=checked]"); } function valueComparator(value, currentValue, comparator) { if (value === void 0) return false; else if (Array.isArray(value)) return value.some((val) => compare(val, currentValue, comparator)); else return compare(value, currentValue, comparator); } function compare(value, currentValue, comparator) { if (value === void 0 || currentValue === void 0) return false; if (typeof value === "string") return value === currentValue; if (typeof comparator === "function") return comparator(value, currentValue); if (typeof comparator === "string") return (value == null ? void 0 : value[comparator]) === (currentValue == null ? void 0 : currentValue[comparator]); return isEqual$1(value, currentValue); } const ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus"; const EVENT_OPTIONS = { bubbles: false, cancelable: true }; const MAP_KEY_TO_FOCUS_INTENT = { ArrowLeft: "prev", ArrowUp: "prev", ArrowRight: "next", ArrowDown: "next", PageUp: "first", Home: "first", PageDown: "last", End: "last" }; function getDirectionAwareKey(key, dir) { if (dir !== "rtl") return key; return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key; } function getFocusIntent(event, orientation, dir) { const key = getDirectionAwareKey(event.key, dir); if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0; if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0; return MAP_KEY_TO_FOCUS_INTENT[key]; } function focusFirst$1(candidates, preventScroll = false) { const PREVIOUSLY_FOCUSED_ELEMENT = getActiveElement(); for (const candidate of candidates) { if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; candidate.focus({ preventScroll }); if (getActiveElement() !== PREVIOUSLY_FOCUSED_ELEMENT) return; } } function wrapArray(array, startIndex) { return array.map((_2, index) => array[(startIndex + index) % array.length]); } const [injectListboxRootContext, provideListboxRootContext] = createContext("ListboxRoot"); const [injectListboxHighlightScrollContext, provideListboxHighlightScrollContext] = createContext("ListboxHighlightScroll"); var ListboxRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ListboxRoot", props: { modelValue: { type: null, required: false }, defaultValue: { type: null, required: false }, multiple: { type: Boolean, required: false }, orientation: { type: String, required: false, default: "vertical" }, dir: { type: String, required: false }, disabled: { type: Boolean, required: false }, selectionBehavior: { type: String, required: false, default: "toggle" }, highlightOnHover: { type: Boolean, required: false }, loop: { type: Boolean, required: false }, by: { type: [String, Function], required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, name: { type: String, required: false }, required: { type: Boolean, required: false } }, emits: [ "update:modelValue", "highlight", "entryFocus", "leave" ], setup(__props, { expose: __expose, emit: __emit }) { var _a2; const props = __props; const emits = __emit; const { multiple, highlightOnHover, loop, orientation, disabled, selectionBehavior, dir: propDir } = vue.toRefs(props); const { getItems, getItem } = useCollection({ isProvider: true }); const { handleTypeaheadSearch } = useTypeahead(); const { primitiveElement, currentElement } = usePrimitiveElement(); const kbd = useKbd(); const dir = useDirection(propDir); const highlightScrollContext = injectListboxHighlightScrollContext(null); provideListboxHighlightScrollContext({ suppressHighlightScroll: vue.ref(false), onHighlightScrollRequest: () => { } }); const isFormControl = useFormControl(currentElement); const firstValue = vue.ref(); const isUserAction = vue.ref(false); const focusable = vue.ref(true); const modelValue = useVModel(props, "modelValue", emits, { defaultValue: (_a2 = props.defaultValue) != null ? _a2 : multiple.value ? [] : void 0, passive: props.modelValue === void 0, deep: true }); function onValueChange(val) { isUserAction.value = true; if (props.multiple) { const modelArray = Array.isArray(modelValue.value) ? [...modelValue.value] : []; const index = modelArray.findIndex((i) => compare(i, val, props.by)); if (props.selectionBehavior === "toggle") { index === -1 ? modelArray.push(val) : modelArray.splice(index, 1); modelValue.value = modelArray; } else { modelValue.value = [val]; firstValue.value = val; } } else if (props.selectionBehavior === "toggle") if (compare(modelValue.value, val, props.by)) modelValue.value = void 0; else modelValue.value = val; else modelValue.value = val; setTimeout(() => { isUserAction.value = false; }, 1); } const highlightedElement = vue.ref(null); const previousElement = vue.ref(null); const isVirtual = vue.ref(false); const isComposing = vue.ref(false); const virtualFocusHook = createEventHook(); const virtualKeydownHook = createEventHook(); const virtualHighlightHook = createEventHook(); function getCollectionItem() { return getItems().map((i) => i.ref).filter((i) => i.dataset.disabled !== ""); } function changeHighlight(el, scrollIntoView = true, focus2) { var _a3; if (!el) return; highlightedElement.value = el; const suppressHighlightScroll = (_a3 = highlightScrollContext == null ? void 0 : highlightScrollContext.suppressHighlightScroll.value) != null ? _a3 : false; if (focus2 != null ? focus2 : focusable.value) if (suppressHighlightScroll) highlightedElement.value.focus({ preventScroll: true }); else highlightedElement.value.focus(); if (suppressHighlightScroll) highlightScrollContext == null ? void 0 : highlightScrollContext.onHighlightScrollRequest(scrollIntoView ? () => { const element = highlightedElement.value; if (element == null ? void 0 : element.isConnected) element.scrollIntoView({ block: "nearest" }); } : void 0); else if (scrollIntoView) highlightedElement.value.scrollIntoView({ block: "nearest" }); const highlightedItem = getItem(el); emits("highlight", highlightedItem); } function highlightItem(value) { if (isVirtual.value) virtualHighlightHook.trigger(value); else { const item = getItems().find((i) => compare(i.value, value, props.by)); if (item) { highlightedElement.value = item.ref; changeHighlight(item.ref); } } } function onKeydownEnter(event) { if (highlightedElement.value && highlightedElement.value.isConnected) { if (event.ctrlKey || event.metaKey || event.altKey) return; event.preventDefault(); event.stopPropagation(); if (!isComposing.value) highlightedElement.value.click(); } } function onKeydownTypeAhead(event) { if (!focusable.value) return; isUserAction.value = true; if (isVirtual.value) virtualKeydownHook.trigger(event); else { const isMetaKey = event.altKey || event.ctrlKey || event.metaKey; if (isMetaKey && event.key === "a" && multiple.value) { const collection = getItems(); const values = collection.map((i) => i.value); modelValue.value = [...values]; event.preventDefault(); const lastItem = collection.at(-1); if (lastItem) changeHighlight(lastItem.ref); } else if (!isMetaKey) { const el = handleTypeaheadSearch(event.key, getItems()); if (el) changeHighlight(el); } } setTimeout(() => { isUserAction.value = false; }, 1); } function onCompositionStart() { isComposing.value = true; } function onCompositionEnd() { vue.nextTick(() => { isComposing.value = false; }); } function highlightFirstItem() { vue.nextTick(() => { const event = new KeyboardEvent("keydown", { key: "PageUp" }); onKeydownNavigation(event); }); } function onLeave(event) { const el = highlightedElement.value; if (el == null ? void 0 : el.isConnected) previousElement.value = el; highlightedElement.value = null; emits("leave", event); } function onEnter(event) { var _a3, _b; const entryFocusEvent = new CustomEvent("listbox.entryFocus", { bubbles: false, cancelable: true }); (_a3 = event.currentTarget) == null ? void 0 : _a3.dispatchEvent(entryFocusEvent); emits("entryFocus", entryFocusEvent); if (entryFocusEvent.defaultPrevented) return; if (previousElement.value) changeHighlight(previousElement.value); else { const el = (_b = getCollectionItem()) == null ? void 0 : _b[0]; changeHighlight(el); } } function isAtVirtualBoundary(intent) { const rendered = getItems(true).map((i) => i.ref); const edge = intent === "next" ? rendered.at(-1) : rendered[0]; if (!edge) return false; const position = Number(edge.getAttribute("aria-posinset")); const size2 = Number(edge.getAttribute("aria-setsize")); return intent === "next" ? position === size2 : position === 1; } function onKeydownNavigation(event) { const intent = getFocusIntent(event, orientation.value, dir.value); if (!intent) return; let collection = getCollectionItem(); if (highlightedElement.value) { if (intent === "last") collection.reverse(); else if (intent === "prev" || intent === "next") { if (intent === "prev") collection.reverse(); const currentIndex = collection.indexOf(highlightedElement.value); const shouldLoop = loop.value && currentIndex === collection.length - 1; if (shouldLoop && isVirtual.value) { if (isAtVirtualBoundary(intent)) { const key = intent === "next" ? kbd.HOME : kbd.END; return virtualKeydownHook.trigger(new KeyboardEvent("keydown", { key, shiftKey: event.shiftKey })); } collection = []; } else collection = shouldLoop ? collection.slice(0, 1) : collection.slice(currentIndex + 1); } handleMultipleReplace(event, collection[0]); } if (collection.length) { const index = !highlightedElement.value && intent === "prev" ? collection.length - 1 : 0; changeHighlight(collection[index]); } if (isVirtual.value) return virtualKeydownHook.trigger(event); } function handleMultipleReplace(event, targetEl) { var _a3, _b, _c; if (isVirtual.value || props.selectionBehavior !== "replace" || !multiple.value || !Array.isArray(modelValue.value)) return; const isMetaKey = event.altKey || event.ctrlKey || event.metaKey; if (isMetaKey && !event.shiftKey) return; if (event.shiftKey) { const collection = getItems().filter((i) => i.ref.dataset.disabled !== ""); let lastValue = (_a3 = collection.find((i) => i.ref === targetEl)) == null ? void 0 : _a3.value; if (event.key === kbd.END) lastValue = (_b = collection.at(-1)) == null ? void 0 : _b.value; else if (event.key === kbd.HOME) lastValue = (_c = collection[0]) == null ? void 0 : _c.value; if (!lastValue || !firstValue.value) return; const values = findValuesBetween(collection.map((i) => i.value), firstValue.value, lastValue); modelValue.value = values; } } async function highlightSelected(event, scroll = true) { if (!isClient) return; await vue.nextTick(); if (isVirtual.value) virtualFocusHook.trigger({ event, scroll }); else { const collection = getCollectionItem(); const item = collection.find((i) => i.dataset.state === "checked"); const focus2 = scroll ? void 0 : false; if (item) changeHighlight(item, scroll, focus2); else if (collection.length) changeHighlight(collection[0], scroll, focus2); } } let hasHighlightedOnMount = false; vue.watch(modelValue, () => { if (!isUserAction.value) { const scroll = hasHighlightedOnMount; hasHighlightedOnMount = true; vue.nextTick(() => { highlightSelected(void 0, scroll); }); } }, { immediate: true, deep: true }); __expose({ highlightedElement, highlightItem, highlightFirstItem, highlightSelected, getItems }); provideListboxRootContext({ modelValue, onValueChange, multiple, orientation, dir, disabled, highlightOnHover, loop, highlightedElement, isVirtual, virtualFocusHook, virtualKeydownHook, virtualHighlightHook, by: props.by, firstValue, selectionBehavior, focusable, onLeave, onEnter, changeHighlight, onKeydownEnter, onKeydownNavigation, onKeydownTypeAhead, onCompositionStart, onCompositionEnd, highlightFirstItem }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { ref_key: "primitiveElement", ref: primitiveElement, as: __props.as, "as-child": __props.asChild, dir: vue.unref(dir), "data-disabled": vue.unref(disabled) ? "" : void 0, onPointerleave: onLeave, onFocusout: _cache[0] || (_cache[0] = async (event) => { const target = event.relatedTarget || event.target; await vue.nextTick(); if (highlightedElement.value && vue.unref(currentElement) && !vue.unref(currentElement).contains(target)) onLeave(event); }) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue) }), vue.unref(isFormControl) && __props.name ? (vue.openBlock(), vue.createBlock(vue.unref(VisuallyHiddenInput_default), { key: 0, name: __props.name, value: vue.unref(modelValue), disabled: vue.unref(disabled), required: __props.required }, null, 8, [ "name", "value", "disabled", "required" ])) : vue.createCommentVNode("v-if", true)]), _: 3 }, 8, [ "as", "as-child", "dir", "data-disabled" ]); }; } }); var ListboxRoot_default = ListboxRoot_vue_vue_type_script_setup_true_lang_default; var ListboxContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ListboxContent", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const { CollectionSlot } = useCollection(); const rootContext = injectListboxRootContext(); const isClickFocus = refAutoReset(false, 10); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollectionSlot), null, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { role: "listbox", as: __props.as, "as-child": __props.asChild, tabindex: vue.unref(rootContext).focusable.value ? vue.unref(rootContext).highlightedElement.value ? "-1" : "0" : "-1", "aria-orientation": vue.unref(rootContext).orientation.value, "aria-multiselectable": !!vue.unref(rootContext).multiple.value, "data-orientation": vue.unref(rootContext).orientation.value, onMousedown: _cache[0] || (_cache[0] = vue.withModifiers(($event) => isClickFocus.value = true, ["left"])), onFocus: _cache[1] || (_cache[1] = (ev) => { if (vue.unref(isClickFocus)) return; vue.unref(rootContext).onEnter(ev); }), onKeydown: [ _cache[2] || (_cache[2] = vue.withKeys((event) => { if (vue.unref(rootContext).orientation.value === "vertical" && (event.key === "ArrowLeft" || event.key === "ArrowRight") || vue.unref(rootContext).orientation.value === "horizontal" && (event.key === "ArrowUp" || event.key === "ArrowDown")) return; event.preventDefault(); vue.unref(rootContext).focusable.value && vue.unref(rootContext).onKeydownNavigation(event); }, [ "down", "up", "left", "right", "home", "end" ])), vue.withKeys(vue.unref(rootContext).onKeydownEnter, ["enter"]), vue.unref(rootContext).onKeydownTypeAhead ] }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as", "as-child", "tabindex", "aria-orientation", "aria-multiselectable", "data-orientation", "onKeydown" ])]), _: 3 }); }; } }); var ListboxContent_default = ListboxContent_vue_vue_type_script_setup_true_lang_default; var ListboxFilter_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ListboxFilter", props: { modelValue: { type: String, required: false }, autoFocus: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "input" } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const modelValue = useVModel(props, "modelValue", emits, { defaultValue: "", passive: props.modelValue === void 0 }); const rootContext = injectListboxRootContext(); const { primitiveElement, currentElement } = usePrimitiveElement(); const disabled = vue.computed(() => props.disabled || rootContext.disabled.value || false); const activedescendant = vue.ref(); vue.watchSyncEffect(() => { var _a2; return activedescendant.value = (_a2 = rootContext.highlightedElement.value) == null ? void 0 : _a2.id; }); vue.onMounted(() => { rootContext.focusable.value = false; setTimeout(() => { var _a2; if (props.autoFocus) (_a2 = currentElement.value) == null ? void 0 : _a2.focus(); }, 1); }); vue.onUnmounted(() => { rootContext.focusable.value = true; }); const { isComposing, shouldDeferInput, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposing((event) => { modelValue.value = event.target.value; rootContext.onCompositionEnd(); rootContext.highlightFirstItem(); }); function onCompositionStart() { rootContext.onCompositionStart(); handleCompositionStart(); } function handleInput(event) { if (shouldDeferInput.value) return; modelValue.value = event.target.value; rootContext.highlightFirstItem(); } function handleKeydownNavigation(event) { if (isComposing.value) return; event.preventDefault(); rootContext.onKeydownNavigation(event); } function handleKeydownEnter(event) { if (isComposing.value) return; rootContext.onKeydownEnter(event); } return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { ref_key: "primitiveElement", ref: primitiveElement, as: __props.as, "as-child": __props.asChild, value: vue.unref(modelValue), disabled: disabled.value ? "" : void 0, "data-disabled": disabled.value ? "" : void 0, "aria-disabled": (_a2 = disabled.value) != null ? _a2 : void 0, "aria-activedescendant": activedescendant.value, type: "text", onKeydown: [vue.withKeys(handleKeydownNavigation, [ "down", "up", "home", "end" ]), vue.withKeys(handleKeydownEnter, ["enter"])], onInput: handleInput, onCompositionstart: onCompositionStart, onCompositionupdate: vue.unref(handleCompositionUpdate), onCompositionend: vue.unref(handleCompositionEnd) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue) })]), _: 3 }, 8, [ "as", "as-child", "value", "disabled", "data-disabled", "aria-disabled", "aria-activedescendant", "onCompositionupdate", "onCompositionend" ]); }; } }); var ListboxFilter_default = ListboxFilter_vue_vue_type_script_setup_true_lang_default; const [injectListboxGroupContext, provideListboxGroupContext] = createContext("ListboxGroup"); var ListboxGroup_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ListboxGroup", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const id = useId(void 0, "reka-listbox-group"); provideListboxGroupContext({ id }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps({ role: "group" }, props, { "aria-labelledby": vue.unref(id) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["aria-labelledby"]); }; } }); var ListboxGroup_default = ListboxGroup_vue_vue_type_script_setup_true_lang_default; const LISTBOX_SELECT = "listbox.select"; const [injectListboxItemContext, provideListboxItemContext] = createContext("ListboxItem"); var ListboxItem_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ListboxItem", props: { value: { type: null, required: true }, disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "div" } }, emits: ["select"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const id = useId(void 0, "reka-listbox-item"); const { CollectionItem } = useCollection(); const { forwardRef, currentElement } = useForwardExpose(); const rootContext = injectListboxRootContext(); const isHighlighted = vue.computed(() => currentElement.value != null && currentElement.value === rootContext.highlightedElement.value); const isSelected = vue.computed(() => valueComparator(rootContext.modelValue.value, props.value, rootContext.by)); const disabled = vue.computed(() => rootContext.disabled.value || props.disabled); async function handleSelect(ev) { emits("select", ev); if (ev == null ? void 0 : ev.defaultPrevented) return; if (!disabled.value && ev) { rootContext.onValueChange(props.value); rootContext.changeHighlight(currentElement.value); } } function handleSelectCustomEvent(ev) { const eventDetail = { originalEvent: ev, value: props.value }; handleAndDispatchCustomEvent$1(LISTBOX_SELECT, handleSelect, eventDetail); } provideListboxItemContext({ isSelected }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollectionItem), { value: __props.value }, { default: vue.withCtx(() => [vue.withMemo([ isHighlighted.value, isSelected.value, disabled.value, vue.unref(rootContext).focusable.value, ...Object.entries(_ctx.$attrs).flat() ], () => vue.createVNode(vue.unref(Primitive), vue.mergeProps({ id: vue.unref(id) }, _ctx.$attrs, { ref: vue.unref(forwardRef), role: "option", tabindex: vue.unref(rootContext).focusable.value ? isHighlighted.value ? "0" : "-1" : -1, "aria-selected": isSelected.value, as: __props.as, "as-child": __props.asChild, disabled: disabled.value ? "" : void 0, "data-disabled": disabled.value ? "" : void 0, "data-highlighted": isHighlighted.value ? "" : void 0, "data-state": isSelected.value ? "checked" : "unchecked", onClick: handleSelectCustomEvent, onKeydown: vue.withKeys(vue.withModifiers(handleSelectCustomEvent, ["prevent"]), ["space"]), onPointermove: _cache[0] || (_cache[0] = () => { if (vue.unref(rootContext).highlightedElement.value === vue.unref(currentElement)) return; if (vue.unref(rootContext).highlightOnHover.value) vue.unref(rootContext).changeHighlight(vue.unref(currentElement), false, false); }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { selected: isSelected.value })]), _: 3 }, 16, [ "id", "tabindex", "aria-selected", "as", "as-child", "disabled", "data-disabled", "data-highlighted", "data-state", "onKeydown" ]), _cache, 1)]), _: 3 }, 8, ["value"]); }; } }); var ListboxItem_default = ListboxItem_vue_vue_type_script_setup_true_lang_default; var ListboxItemIndicator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ListboxItemIndicator", props: { forceMount: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "span" } }, setup(__props) { const { forwardRef } = useForwardExpose(); const itemContext = injectListboxItemContext(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || vue.unref(itemContext).isSelected.value }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { ref: vue.unref(forwardRef), "aria-hidden": "true", "data-state": vue.unref(itemContext).isSelected.value ? "checked" : "unchecked", as: __props.as, "as-child": __props.asChild }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "data-state", "as", "as-child" ])]), _: 3 }, 8, ["present"]); }; } }); var ListboxItemIndicator_default = ListboxItemIndicator_vue_vue_type_script_setup_true_lang_default; function getMeasurementKey(item) { return typeof item === "object" ? item.key : item; } function createLazyMeasurementsView(cache, flat2) { const count2 = cache.length; return new Proxy(cache, { get(target, prop, receiver) { if (typeof prop === "string") { const c = prop.charCodeAt(0); if (c >= 48 && c <= 57) { const i = +prop; if (Number.isInteger(i) && i >= 0 && i < count2) { let v = target[i]; if (typeof v !== "object") { const s = flat2[i * 2]; v = target[i] = { index: i, key: v, start: s, size: flat2[i * 2 + 1], end: s + flat2[i * 2 + 1], lane: 0 }; } return v; } } if (prop === "length") return count2; } return Reflect.get(target, prop, receiver); } }); } function memo(getDeps, fn, opts) { var _a2; let deps = (_a2 = opts.initialDeps) != null ? _a2 : []; let result; let isInitial = true; function memoizedFunction() { const newDeps = getDeps(); const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep); if (!depsChanged) { return result; } deps = newDeps; result = fn(...newDeps); if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) { opts.onChange(result); } isInitial = false; return result; } memoizedFunction.updateDeps = (newDeps) => { deps = newDeps; }; return memoizedFunction; } function notUndefined(value, msg) { if (value === void 0) { throw new Error(`Unexpected undefined${""}`); } else { return value; } } const approxEqual = (a, b) => Math.abs(a - b) < 1.01; const debounce = (targetWindow, fn, ms) => { let timeoutId; return Object.assign( function(...args) { targetWindow.clearTimeout(timeoutId); timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms); }, { cancel: () => { targetWindow.clearTimeout(timeoutId); } } ); }; function classifyScrollEvent({ offset: offset2, isScrolling, elementMax, holdOffset, scrollOffset, pendingWrite, clampedMaxAtWrite }) { var _a2; if (isScrolling && pendingWrite === null && offset2 === scrollOffset) { return "spurious"; } if (pendingWrite !== null && Math.abs(offset2 - pendingWrite.target) < 1.5) { return "readBack"; } if (pendingWrite !== null && !pendingWrite.smooth && elementMax !== null && pendingWrite.target > elementMax + holdOffset + 0.5 && Math.abs(offset2 - (elementMax + holdOffset)) < 1.5) { return "clampedReadBack"; } if (pendingWrite !== null && !pendingWrite.smooth && ((_a2 = pendingWrite.lowMaxes) == null ? void 0 : _a2.some((max2) => Math.abs(offset2 - max2) < 1.5))) { return "clampedReadBack"; } if (clampedMaxAtWrite !== null && Math.abs(offset2 - clampedMaxAtWrite) < 1.5) { return "clampedEcho"; } return "external"; } const isAnimating = (phase) => phase === "smooth" || phase === "smoothFinishing"; function externalRetiresCommand({ kind, offset: offset2, command, target }) { return kind !== "spurious" && kind !== "readBack" && kind !== "clampedReadBack" && (command == null ? void 0 : command.index) != null && command.phase !== "queued" && !isAnimating(command.phase) && !approxEqual(offset2, command.lastTargetOffset) && !approxEqual(offset2, target()) && kind !== "clampedEcho"; } const FLING_WINDOW_MS = 40; function flingSpedUp(samples) { const last = samples[samples.length - 1]; if (last === void 0) return false; let j = samples.length - 2; while (j >= 0 && last.t - samples[j].t < FLING_WINDOW_MS) j--; if (j < 0) return false; const mid = samples[j]; let k = j - 1; while (k >= 0 && mid.t - samples[k].t < FLING_WINDOW_MS) k--; if (k < 0) return false; const first = samples[k]; const recent = (last.offset - mid.offset) / (last.t - mid.t); const before = (mid.offset - first.offset) / (mid.t - first.t); return recent * before >= 0 && Math.abs(recent) >= 2 * Math.abs(before) && Math.abs(recent) - Math.abs(before) >= 0.8; } function flingCaught(samples) { const last = samples[samples.length - 1]; if (last === void 0) return false; let j = samples.length - 2; while (j >= 0 && last.t - samples[j].t < FLING_WINDOW_MS) j--; if (j < 0) return false; const from = samples[j]; return Math.abs(last.offset - from.offset) / (last.t - from.t) >= 0.05; } let _isIOSResult; const isIOSWebKit = () => { if (_isIOSResult !== void 0) return _isIOSResult; if (typeof navigator === "undefined") return _isIOSResult = false; if (/iP(hone|od|ad)/.test(navigator.userAgent)) return _isIOSResult = true; const mtp = navigator.maxTouchPoints; return _isIOSResult = navigator.platform === "MacIntel" && mtp !== void 0 && mtp > 0; }; let _iosMomentumOverridesWritesResult; const iosMomentumOverridesWrites = () => { if (_iosMomentumOverridesWritesResult !== void 0) { return _iosMomentumOverridesWritesResult; } return _iosMomentumOverridesWritesResult = isIOSWebKit() && typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("overflow-anchor: auto"); }; const momentumOverridesWrites = () => !isIOSWebKit() || iosMomentumOverridesWrites(); const touchListenerOptions = { capture: true, passive: true }; class IosGesture { constructor(host2) { this.host = host2; this._touch = null; this.inMotion = () => this._touch !== null && this._touch.phase !== "lateFling"; this.dragging = () => { var _a2; return ((_a2 = this._touch) == null ? void 0 : _a2.phase) === "down" && this._touch.moved; }; this.tail = () => { var _a2; return ((_a2 = this._touch) == null ? void 0 : _a2.phase) === "tail" ? this._touch.moved ? "fling" : "tap" : null; }; this.onScroll = ({ isScrolling, ownReadBack, moved, external }) => { var _a2, _b, _c; if (isScrolling && ((_a2 = this._touch) == null ? void 0 : _a2.phase) === "tail") { this._openTail(this._touch.moved || !ownReadBack, false); } else if (((_b = this._touch) == null ? void 0 : _b.phase) === "lateFling") { if (this.host.now() > this._touch.until) { this._touch = null; } else if (external && isScrolling && moved) { this._openTail(true, false); } } if (!ownReadBack && isScrolling && moved && ((_c = this._touch) == null ? void 0 : _c.phase) === "down") { this._touch.moved = true; return true; } return false; }; this.touchStart = () => { this.end(); this._touch = { phase: "down", moved: false }; }; this.touchEnd = () => { var _a2; const moved = ((_a2 = this._touch) == null ? void 0 : _a2.phase) === "down" && this._touch.moved; this.end(); this._openTail(moved, moved); }; this.end = () => { var _a2; const win = this.host.getWindow(); if (((_a2 = this._touch) == null ? void 0 : _a2.phase) === "tail" && win != null) { win.clearTimeout(this._touch.timerId); } this._touch = null; }; this.listen = (target) => { const onTouchStart = () => this.touchStart(); const onTouchEnd = () => this.touchEnd(); target.addEventListener("touchstart", onTouchStart, touchListenerOptions); target.addEventListener("touchend", onTouchEnd, touchListenerOptions); target.addEventListener("touchcancel", onTouchEnd, touchListenerOptions); return () => { target.removeEventListener( "touchstart", onTouchStart, touchListenerOptions ); target.removeEventListener("touchend", onTouchEnd, touchListenerOptions); target.removeEventListener( "touchcancel", onTouchEnd, touchListenerOptions ); this.end(); }; }; this._openTail = (moved, awaitingFling) => { const win = this.host.getWindow(); if (win == null) return; this.end(); const tail = { phase: "tail", moved, awaitingFling, timerId: win.setTimeout(() => { if (this.host.tailStillMoving()) { this._openTail(tail.moved, tail.awaitingFling); return; } this._touch = tail.awaitingFling ? { phase: "lateFling", until: this.host.now() + 1e3 } : null; this.host.onTailClosed(); }, 150) }; this._touch = tail; }; } get touch() { return this._touch; } } const getRect = (element) => { const { clientWidth, clientHeight } = element; return { width: clientWidth, height: clientHeight }; }; const createFrameQueue = (targetWindow) => { const ids = new Set(); return { schedule: (fn) => { const id = targetWindow.requestAnimationFrame(() => { ids.delete(id); fn(); }); ids.add(id); }, cancel: () => { ids.forEach((id) => targetWindow.cancelAnimationFrame(id)); ids.clear(); } }; }; const defaultKeyExtractor = (index) => index; const defaultRangeExtractor = (range) => { var _a2; const overscan = range.overscan * Math.max((_a2 = range.lanes) != null ? _a2 : 1, 1); const start = Math.max(range.startIndex - overscan, 0); const end = Math.min(range.endIndex + overscan, range.count - 1); const len = end - start + 1; const arr = new Array(len); for (let i = 0; i < len; i++) { arr[i] = start + i; } return arr; }; const observeElementRect = (instance, cb) => { const element = instance.scrollElement; if (!element) { return; } const targetWindow = instance.targetWindow; if (!targetWindow) { return; } const handler = (rect) => { const { width, height } = rect; cb({ width: Math.round(width), height: Math.round(height) }); }; handler(getRect(element)); if (!targetWindow.ResizeObserver) { return () => { }; } const frames = createFrameQueue(targetWindow); const observer2 = new targetWindow.ResizeObserver(() => { const run = () => { handler(getRect(element)); }; instance.options.useAnimationFrameWithResizeObserver ? frames.schedule(run) : run(); }); observer2.observe(element, { box: "content-box" }); return () => { observer2.unobserve(element); frames.cancel(); }; }; const addEventListenerOptions = { passive: true }; const supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window; const observeOffset = (instance, cb, readOffset) => { const element = instance.scrollElement; if (!element) { return; } const targetWindow = instance.targetWindow; if (!targetWindow) { return; } const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend; let offset2 = 0; const fallback = registerScrollendEvent ? null : debounce( targetWindow, () => cb(readOffset(element), false), instance.options.isScrollingResetDelay ); const createHandler = (isScrolling) => () => { offset2 = readOffset(element); fallback == null ? void 0 : fallback(); cb(offset2, isScrolling); }; const handler = createHandler(true); const endHandler = createHandler(false); element.addEventListener("scroll", handler, addEventListenerOptions); if (registerScrollendEvent) { element.addEventListener("scrollend", endHandler, addEventListenerOptions); } return () => { element.removeEventListener("scroll", handler); if (registerScrollendEvent) { element.removeEventListener("scrollend", endHandler); } fallback == null ? void 0 : fallback.cancel(); }; }; const observeElementOffset = (instance, cb) => observeOffset(instance, cb, (el) => { const { horizontal, isRtl } = instance.options; return horizontal ? el.scrollLeft * (isRtl && -1 || 1) : el.scrollTop; }); const measureElement = (element, entry, instance) => { var _a2; if (instance.options.useCachedMeasurements) { const index = instance.indexFromElement(element); const key = instance.options.getItemKey(index); return (_a2 = instance.itemSizeCache.get(key)) != null ? _a2 : instance.options.estimateSize(index); } if (entry == null ? void 0 : entry.borderBoxSize) { const box = entry.borderBoxSize[0]; if (box) { const size2 = Math.round( box[instance.options.horizontal ? "inlineSize" : "blockSize"] ); return size2; } } if (!entry) { const index = instance.indexFromElement(element); const key = instance.options.getItemKey(index); const cachedSize = instance.itemSizeCache.get(key); if (cachedSize !== void 0) { return cachedSize; } } return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"]; }; const scrollWithAdjustments = (offset2, { adjustments = 0, behavior }, instance) => { var _a2; const { scrollElement, options } = instance; const adjustedOffset = offset2 + adjustments; const isRtlElement = options.horizontal && options.isRtl && scrollElement !== null && "ownerDocument" in scrollElement; (_a2 = scrollElement == null ? void 0 : scrollElement.scrollTo) == null ? void 0 : _a2.call(scrollElement, { [options.horizontal ? "left" : "top"]: isRtlElement ? -adjustedOffset : adjustedOffset, behavior }); }; const elementScroll = scrollWithAdjustments; const initialScrollPhase = (behavior, atTarget) => behavior === "smooth" ? atTarget ? "smoothLanded" : "smooth" : "instant"; const isSmoothScroll = (state2) => (state2 == null ? void 0 : state2.phase) === "smooth" || (state2 == null ? void 0 : state2.phase) === "smoothLanded"; function isAppendWithTrim(prevCount, nextCount, getPreviousKey, getNextKey) { if (nextCount === 0) return false; const firstKey = getNextKey(0); const removedKeys = new Set(); let removedCount = 0; while (removedCount < prevCount) { const key = getPreviousKey(removedCount); if (key === firstKey) break; removedKeys.add(key); removedCount++; } const retainedCount = prevCount - removedCount; if (retainedCount === 0 || retainedCount >= nextCount) return false; for (let i = 0; i < retainedCount; i++) { if (getNextKey(i) !== getPreviousKey(removedCount + i)) return false; } for (let i = retainedCount; i < nextCount; i++) { if (removedKeys.has(getNextKey(i))) return false; } return true; } class Virtualizer { constructor(opts) { this.unsubs = []; this.scrollElement = null; this.targetWindow = null; this.isScrolling = false; this.scrollState = null; this.measurementsCache = []; this._singleLaneMeasurements = null; this.itemSizeCache = new Map(); this.itemSizeCacheVersion = 0; this.laneAssignments = new Map(); this.pendingMin = null; this.prevLanes = void 0; this.lanesChangedFlag = false; this.lanesSettling = false; this.pendingScrollAnchor = null; this.scrollRect = null; this.scrollOffset = null; this.scrollDirection = null; this._holdOffset = 0; this._reportedOverscroll = false; this._iosGesture = new IosGesture({ getWindow: () => this.targetWindow, now: () => this.now(), tailStillMoving: () => { var _a2; const state2 = this.scrollState; if ((state2 == null ? void 0 : state2.phase) !== "queued" || this.pendingWrite !== null) { return false; } const now = this._readElementOffset(); if (now === null || this._lastElementOffset === null || Math.abs(now - this._lastElementOffset) < 1) { return false; } this._lastElementOffset = now; state2.samples = [...(_a2 = state2.samples) != null ? _a2 : [], { t: this.now(), offset: now }]; return true; }, onTailClosed: () => { var _a2; const state2 = this.scrollState; if ((state2 == null ? void 0 : state2.phase) === "queued" && flingCaught((_a2 = state2.samples) != null ? _a2 : [])) { this.scrollState = null; } this._flushHoldIfReady(true); this._writeAwaitingCommand(); this._retryClampedAdjustment(); } }); this._lastElementOffset = null; this.pendingWrite = null; this._clampedAdjustment = null; this.elementsCache = new Map(); this._resizeBatch = null; this.now = () => { var _a3; var _a2, _b, _c; return (_a3 = (_c = (_b = (_a2 = this.targetWindow) == null ? void 0 : _a2.performance) == null ? void 0 : _b.now) == null ? void 0 : _c.call(_b)) != null ? _a3 : Date.now(); }; this.observer = (() => { let _ro = null; let _frames = null; let delivering = false; let observeQueued = false; const pendingObservations = new Set(); const get2 = () => { if (_ro) { return _ro; } const targetWindow = this.targetWindow; if (!targetWindow || !targetWindow.ResizeObserver) { return null; } const frames = _frames = createFrameQueue(targetWindow); return _ro = new targetWindow.ResizeObserver((entries) => { const run = () => { const batch = { sync: false }; this._resizeBatch = batch; try { entries.forEach(measureEntry); } finally { this._resizeBatch = null; if (batch.notify) { this.notify(batch.sync); this._noteClampMax(); this._flushHoldIfReady(true); this._retryClampedAdjustment(); this.measureElement(null); } } }; if (this.options.useAnimationFrameWithResizeObserver) { frames.schedule(run); } else { delivering = true; try { run(); } finally { delivering = false; } } }); }; const measureEntry = (entry) => { const node = entry.target; const index = this.indexFromElement(node); if (!node.isConnected) { this.observer.unobserve(node); for (const [cacheKey, cachedNode] of this.elementsCache) { if (cachedNode === node) { this.elementsCache.delete(cacheKey); break; } } return; } if (!this.isIndexInRange(index)) return; if (this.shouldMeasureDuringScroll(index)) { this.resizeItem(index, this.options.measureElement(node, entry, this)); } }; return { disconnect: () => { var _a2; (_a2 = get2()) == null ? void 0 : _a2.disconnect(); _frames == null ? void 0 : _frames.cancel(); pendingObservations.clear(); observeQueued = false; _ro = null; _frames = null; }, observe: (target) => { const observer2 = get2(); if (!observer2) return; if (!delivering) { observer2.observe(target, { box: "border-box" }); return; } pendingObservations.add(target); if (!observeQueued) { observeQueued = true; _frames == null ? void 0 : _frames.schedule(() => { observeQueued = false; pendingObservations.forEach((node) => { if (node.isConnected) _ro == null ? void 0 : _ro.observe(node, { box: "border-box" }); }); pendingObservations.clear(); }); } }, unobserve: (target) => { var _a2; pendingObservations.delete(target); (_a2 = get2()) == null ? void 0 : _a2.unobserve(target); } }; })(); this.range = null; this.setOptions = (opts2) => { var _a3, _b; var _a2; const merged = { debug: false, initialOffset: 0, overscan: 1, paddingStart: 0, paddingEnd: 0, scrollPaddingStart: 0, scrollPaddingEnd: 0, horizontal: false, getItemKey: defaultKeyExtractor, rangeExtractor: defaultRangeExtractor, onChange: () => { }, measureElement, initialRect: { width: 0, height: 0 }, scrollMargin: 0, gap: 0, indexAttribute: "data-index", initialMeasurementsCache: [], lanes: 1, anchorTo: "start", followOnAppend: false, scrollEndThreshold: 1, isScrollingResetDelay: 150, enabled: true, isRtl: false, useScrollendEvent: false, useAnimationFrameWithResizeObserver: false, laneAssignmentMode: "estimate", useCachedMeasurements: false }; for (const key in opts2) { const v = opts2[key]; if (v !== void 0) merged[key] = v; } const prevOptions = this.options; let anchor = null; let followOnAppend = null; let edgeKeysChanged = false; if (prevOptions !== void 0 && prevOptions.enabled && merged.enabled && merged.anchorTo === "end" && this.scrollElement !== null) { const prevCount = prevOptions.count; const nextCount = merged.count; const measurements = this.getMeasurements(); const previousItems = (_a3 = (_a2 = this._singleLaneMeasurements) == null ? void 0 : _a2.items) != null ? _a3 : measurements; const getPreviousKey = (index) => getMeasurementKey(previousItems[index]); const prevFirstKey = prevCount > 0 ? getPreviousKey(0) : null; const prevLastKey = prevCount > 0 ? getPreviousKey(prevCount - 1) : null; const didCountChange = nextCount !== prevCount; const didEdgeKeysChange = didCountChange || prevCount > 0 && nextCount > 0 && (merged.getItemKey(0) !== prevFirstKey || merged.getItemKey(nextCount - 1) !== prevLastKey); if (didEdgeKeysChange) { edgeKeysChanged = true; const item = prevCount > 0 ? (_b = this.getVirtualItemForOffset(this.getScrollOffset())) != null ? _b : measurements[0] : null; if (item) { anchor = [item.key, this.getScrollOffset() - item.start]; } const behavior = merged.followOnAppend === true ? "auto" : merged.followOnAppend || null; if (behavior && nextCount > 0 && this.isAtEnd(prevOptions.scrollEndThreshold) && (prevCount === 0 || merged.getItemKey(nextCount - 1) !== prevLastKey)) { if (nextCount > prevCount || isAppendWithTrim( prevCount, nextCount, getPreviousKey, merged.getItemKey )) { followOnAppend = behavior; } } } } this.options = merged; if (edgeKeysChanged) { this.pendingMin = 0; this.itemSizeCacheVersion++; } let anchorDelta = null; if (anchor && this.scrollOffset !== null && !this._awaitingCommandReadBack()) { const [anchorKey, anchorOffset] = anchor; const newMeasurements = this.getMeasurements(); const { count: count2, getItemKey } = this.options; let idx = 0; while (idx < count2 && getItemKey(idx) !== anchorKey) { idx++; } if (idx < count2) { const anchorItem = newMeasurements[idx]; if (anchorItem) { const newOffset = Math.max(0, anchorItem.start + anchorOffset); if (!followOnAppend && newOffset !== this.scrollOffset) { anchorDelta = newOffset - this.scrollOffset; this.scrollOffset = newOffset; } } } } if (followOnAppend) { this.pendingScrollAnchor = { kind: "follow", behavior: followOnAppend }; } else if (anchorDelta !== null) { if (this._canWriteScroll()) { this.pendingScrollAnchor = { kind: "anchor", delta: anchorDelta }; } else { this._holdOffset += anchorDelta; this._followOffsetTarget(anchorDelta); } } }; this.notify = (sync) => { var _a2, _b; (_b = (_a2 = this.options).onChange) == null ? void 0 : _b.call(_a2, this, sync); }; this.maybeNotify = memo( () => { this.calculateRange(); return [ this.isScrolling, this.range ? this.range.startIndex : null, this.range ? this.range.endIndex : null ]; }, (isScrolling) => { this.notify(isScrolling); }, { key: false, debug: () => this.options.debug, initialDeps: [ this.isScrolling, this.range ? this.range.startIndex : null, this.range ? this.range.endIndex : null ] } ); this.cleanup = () => { var _a2; this.unsubs.filter(Boolean).forEach((d) => d()); this.unsubs = []; this.observer.disconnect(); if (this.rafId != null && this.targetWindow) { this.targetWindow.cancelAnimationFrame(this.rafId); this.rafId = null; } this.scrollState = null; (_a2 = this._momentumStop) == null ? void 0 : _a2.restore(); this._momentumStop = null; this.isScrolling = false; this.scrollDirection = null; this._holdOffset = 0; this._reportedOverscroll = false; this._clampedAdjustment = null; this.pendingWrite = null; this.scrollElement = null; this.targetWindow = null; }; this._didMount = () => { return () => { this.cleanup(); }; }; this._willUpdate = () => { var _a3; var _a2; const scrollElement = this.options.enabled ? this.options.getScrollElement() : null; if (this.scrollElement !== scrollElement) { this.cleanup(); if (!scrollElement) { this.maybeNotify(); return; } this.scrollElement = scrollElement; if (this.scrollElement && "ownerDocument" in this.scrollElement) { this.targetWindow = this.scrollElement.ownerDocument.defaultView; } else { this.targetWindow = (_a3 = (_a2 = this.scrollElement) == null ? void 0 : _a2.window) != null ? _a3 : null; } this.elementsCache.forEach((cached) => { this.observer.observe(cached); }); this.unsubs.push( this.options.observeElementRect(this, (rect) => { this.scrollRect = rect; this.maybeNotify(); }) ); this.unsubs.push( this.options.observeElementOffset(this, (offset2, isScrolling) => { var _a4; var _a22, _b, _c, _d; const elementMax = isScrolling ? this._elementMaxScrollOffset() : null; const wasOverscrolled = this._reportedOverscroll; this._reportedOverscroll = offset2 < 0 || elementMax !== null && offset2 > elementMax + 1; const elementOffset = offset2; this._lastElementOffset = elementOffset; offset2 = this._toLayoutOffset(offset2); const kind = this._classifyScrollEvent( offset2, isScrolling, elementMax ); if (kind === "spurious") return; if (kind === "readBack") { offset2 = this.pendingWrite.target; } else if (kind === "clampedReadBack" && ((_a22 = this.scrollState) == null ? void 0 : _a22.index) != null && offset2 < this.getMaxScrollOffset() - 1.5) { this.scrollState.lastTargetOffset = offset2; } else if (externalRetiresCommand({ kind, offset: offset2, command: this.scrollState, target: () => this.getScrollStateTarget(this.scrollState) })) { this.scrollState = null; } this.pendingWrite = null; if (this._clampedAdjustment !== null && Math.abs(offset2 - this._clampedAdjustment.maxAtWrite) >= 1.5) { this._clampedAdjustment = null; } const prevOffset = this.getScrollOffset(); const prevDirection = this.scrollDirection; this.scrollDirection = isScrolling ? prevOffset === offset2 ? this.scrollDirection : prevOffset < offset2 ? "forward" : "backward" : null; this.scrollOffset = offset2; this.isScrolling = isScrolling; const queued = this.scrollState; if ((queued == null ? void 0 : queued.phase) === "queued" && kind === "external" && isScrolling) { if (wasOverscrolled || this._reportedOverscroll) { queued.samples = []; } else { const t = this.now(); queued.samples = [ ...((_a4 = queued.samples) != null ? _a4 : []).filter( (sample) => t - sample.t <= 200 ), { t, offset: elementOffset } ]; if (prevDirection !== null && this.scrollDirection !== prevDirection || flingSpedUp(queued.samples)) { this.scrollState = null; } } } if (this._iosGesture.onScroll({ isScrolling, ownReadBack: kind === "readBack", moved: offset2 !== prevOffset, external: kind === "external" && ((_b = this.scrollState) == null ? void 0 : _b.phase) !== "smooth" && ((_c = this.scrollState) == null ? void 0 : _c.phase) !== "smoothFinishing" }) && ((_d = this.scrollState) == null ? void 0 : _d.phase) === "queued") { this.scrollState = null; } this._flushHoldIfReady(true); if (this.scrollState) { this.scheduleScrollReconcile(); } this.maybeNotify(); }) ); if ("addEventListener" in this.scrollElement) { this.unsubs.push( this._iosGesture.listen(this.scrollElement) ); } this._scrollToOffset(this.getScrollOffset()); } this._noteClampMax(); const anchor = this.pendingScrollAnchor; this.pendingScrollAnchor = null; if (anchor && this.scrollElement && this.options.enabled) { if (anchor.kind === "anchor") { if (!this._canWriteScroll()) { this._holdOffset += anchor.delta; this._followOffsetTarget(anchor.delta); this.notify(false); } else if (isSmoothScroll(this.scrollState) && !approxEqual( this.getScrollOffset() - anchor.delta, this.scrollState.lastTargetOffset )) ; else { this._followOffsetTarget(anchor.delta); this._scrollToOffset(this.getScrollOffset()); } } else { this.scrollToEnd({ behavior: anchor.behavior }); } } this._flushHoldIfReady(false); this._retryClampedAdjustment(); }; this._classifyScrollEvent = (offset2, isScrolling, elementMax) => { var _a3; var _a2; return classifyScrollEvent({ offset: offset2, isScrolling, elementMax, holdOffset: this._holdOffset, scrollOffset: this.scrollOffset, pendingWrite: this.pendingWrite, clampedMaxAtWrite: (_a3 = (_a2 = this._clampedAdjustment) == null ? void 0 : _a2.maxAtWrite) != null ? _a3 : null }); }; this._retryClampedAdjustment = () => { if (this._clampedAdjustment === null || !this.scrollElement || !this.options.enabled || !this._canWriteScroll()) { return; } const { target, maxAtWrite } = this._clampedAdjustment; const max2 = this.getMaxScrollOffset(); if (max2 > maxAtWrite + 0.5) { this._clampedAdjustment = target > max2 + 0.5 ? { target, maxAtWrite: max2 } : null; this._scrollToOffset(target); } }; this._writeAwaitingCommand = () => { const state2 = this.scrollState; if (state2 === null || state2.phase !== "queued") return; const { behavior } = state2; this.getMeasurements(); const offset2 = this.getScrollStateTarget(state2); state2.lastTargetOffset = offset2; this._clampedAdjustment = null; state2.phase = initialScrollPhase( behavior, state2.index != null && approxEqual(offset2, this.getScrollOffset()) ); this._scrollToOffset(offset2, { behavior }); this.scheduleScrollReconcile(); }; this._readElementOffset = () => { const el = this.scrollElement; if (el == null) return null; const { horizontal, isRtl } = this.options; if (typeof el.scrollTop === "number") { return horizontal ? el.scrollLeft * (isRtl && -1 || 1) : el.scrollTop; } if (typeof el.scrollY === "number") { return horizontal ? el.scrollX : el.scrollY; } return null; }; this._canWriteScroll = () => !(isIOSWebKit() && this._iosGesture.inMotion()) && !this._reportedOverscroll; this._flushHoldIfReady = (sync) => { var _a3; var _a2; if (this._holdOffset === 0) return; if (!this.scrollElement || !this.options.enabled) return; if (!this._canWriteScroll()) return; if (((_a2 = this.scrollState) == null ? void 0 : _a2.phase) === "smooth") return; this._holdOffset = 0; if (this.scrollOffset !== null && this.scrollOffset < 0) { this.scrollOffset = 0; } this.notify(sync); const target = (_a3 = this.getCommandWrittenOffset()) != null ? _a3 : this.getScrollOffset(); this._clampedAdjustment = this._clampedBy(target); this._scrollToOffset(target); }; this.rafId = null; this.getSize = () => { var _a2; if (!this.options.enabled) { this.scrollRect = null; return 0; } this.scrollRect = (_a2 = this.scrollRect) != null ? _a2 : this.options.initialRect; return this.scrollRect[this.options.horizontal ? "width" : "height"]; }; this.getScrollOffset = () => { var _a2; if (!this.options.enabled) { this.scrollOffset = null; return 0; } this.scrollOffset = (_a2 = this.scrollOffset) != null ? _a2 : typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset; return this.scrollOffset; }; this.getMeasurementOptions = memo( () => [ this.options.count, this.options.paddingStart, this.options.scrollMargin, this.options.getItemKey, this.options.enabled, this.options.lanes, this.options.laneAssignmentMode, this.options.gap ], (count2, paddingStart, scrollMargin, getItemKey, enabled2, lanes, laneAssignmentMode, gap) => { const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes; if (lanesChanged) { this.lanesChangedFlag = true; } this.prevLanes = lanes; this.pendingMin = null; return { count: count2, paddingStart, scrollMargin, getItemKey, enabled: enabled2, lanes, laneAssignmentMode, gap }; }, { key: false } ); this.isIndexInRange = (index) => index >= 0 && index < this.options.count; this.getMeasurements = memo( () => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: count2, paddingStart, scrollMargin, getItemKey, enabled: enabled2, lanes, laneAssignmentMode, gap }, _itemSizeCacheVersion) => { var _a3; var _a2; const itemSizeCache = this.itemSizeCache; if (!enabled2) { this.measurementsCache = []; this._singleLaneMeasurements = null; this.itemSizeCache.clear(); this.laneAssignments.clear(); return []; } if (this.laneAssignments.size > count2) { for (const index of this.laneAssignments.keys()) { if (index >= count2) { this.laneAssignments.delete(index); } } } if (this.lanesChangedFlag) { this.lanesChangedFlag = false; this.lanesSettling = true; this.measurementsCache = []; this._singleLaneMeasurements = null; this.itemSizeCache.clear(); this.laneAssignments.clear(); this.pendingMin = null; } if (this.measurementsCache.length === 0 && !this.lanesSettling) { this.measurementsCache = this.options.initialMeasurementsCache; this.measurementsCache.forEach((item) => { this.itemSizeCache.set(item.key, item.size); }); } const min2 = this.lanesSettling ? 0 : (_a3 = this.pendingMin) != null ? _a3 : 0; this.pendingMin = null; if (this.lanesSettling && this.measurementsCache.length === count2) { this.lanesSettling = false; } if (lanes === 1) { const need = count2 * 2; let flat2 = (_a2 = this._singleLaneMeasurements) == null ? void 0 : _a2.flat; if (!flat2 || flat2.length < need) { const next = new Float64Array(need); if (flat2 && min2 > 0) next.set(flat2.subarray(0, min2 * 2)); flat2 = next; } const items = min2 === 0 ? new Array(count2) : this._singleLaneMeasurements.items.slice(); let runningStart; if (min2 === 0) { runningStart = paddingStart + scrollMargin; } else { const prevIdx = min2 - 1; runningStart = flat2[prevIdx * 2] + flat2[prevIdx * 2 + 1] + gap; } for (let i = min2; i < count2; i++) { const key = getItemKey(i); items[i] = key; const measuredSize = itemSizeCache.get(key); const size2 = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i); flat2[i * 2] = runningStart; flat2[i * 2 + 1] = size2; runningStart += size2 + gap; } this._singleLaneMeasurements = { flat: flat2, items }; const view = createLazyMeasurementsView(items, flat2); this.measurementsCache = view; return view; } const measurements = this.measurementsCache.slice(0, min2); const laneLastIndex = new Array(lanes).fill( void 0 ); const laneEnds = new Float64Array(lanes); let filledLanes = 0; for (let m = 0; m < min2; m++) { const item = measurements[m]; if (item) { if (laneLastIndex[item.lane] === void 0) filledLanes++; laneLastIndex[item.lane] = m; laneEnds[item.lane] = item.end; } } for (let i = min2; i < count2; i++) { const key = getItemKey(i); const cachedLane = this.laneAssignments.get(i); let lane; let start; const shouldCacheLane = laneAssignmentMode === "estimate" || itemSizeCache.has(key); if (cachedLane !== void 0 && this.options.lanes > 1) { lane = cachedLane; const prevIndex = laneLastIndex[lane]; const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0; start = prevInLane ? prevInLane.end + gap : paddingStart + scrollMargin; } else if (filledLanes === lanes) { let bestLane = 0; let bestEnd = laneEnds[0]; let bestIdx = laneLastIndex[0]; for (let l = 1; l < lanes; l++) { const e = laneEnds[l]; if (e < bestEnd || e === bestEnd && laneLastIndex[l] < bestIdx) { bestLane = l; bestEnd = e; bestIdx = laneLastIndex[l]; } } lane = bestLane; start = bestEnd + gap; if (shouldCacheLane) { this.laneAssignments.set(i, lane); } } else { lane = i % this.options.lanes; start = paddingStart + scrollMargin; if (shouldCacheLane) { this.laneAssignments.set(i, lane); } } const measuredSize = itemSizeCache.get(key); const size2 = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i); const end = start + size2; measurements[i] = { index: i, start, size: size2, end, key, lane }; if (laneLastIndex[lane] === void 0) filledLanes++; laneLastIndex[lane] = i; laneEnds[lane] = end; } this.measurementsCache = measurements; return measurements; }, { key: false, debug: () => this.options.debug } ); this.calculateRange = memo( () => [ this.getMeasurements(), this.getSize(), this.getScrollOffset(), this.options.lanes, this._getLayoutTotalSize() + this.options.scrollMargin ], (measurements, outerSize, scrollOffset, lanes, listEnd) => { if (measurements.length === 0 || outerSize === 0) { this.range = null; return null; } const maxScrollOffset = Math.max(listEnd - outerSize, 0); this.range = calculateRangeImpl( measurements, outerSize, Math.min(scrollOffset, maxScrollOffset), lanes, lanes === 1 && this._singleLaneMeasurements !== null ? this._singleLaneMeasurements.flat : null ); return this.range; }, { key: false, debug: () => this.options.debug } ); this.getVirtualIndexes = memo( () => { let startIndex = null; let endIndex = null; const range = this.calculateRange(); if (range) { startIndex = range.startIndex; endIndex = range.endIndex; } this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]); return [ this.options.rangeExtractor, this.options.overscan, this.options.count, startIndex, endIndex, this.options.lanes ]; }, (rangeExtractor, overscan, count2, startIndex, endIndex, lanes) => { return startIndex === null || endIndex === null ? [] : rangeExtractor({ startIndex, endIndex, overscan, count: count2, lanes }); }, { key: false, debug: () => this.options.debug } ); this.indexFromElement = (node) => { const attributeName = this.options.indexAttribute; const indexStr = node.getAttribute(attributeName); if (!indexStr) { console.warn( `Missing attribute name '${attributeName}={index}' on measured element.` ); return -1; } return parseInt(indexStr, 10); }; this.shouldMeasureDuringScroll = (index) => { var _a3; var _a2; if (!isSmoothScroll(this.scrollState)) { return true; } const scrollIndex = (_a3 = this.scrollState.index) != null ? _a3 : (_a2 = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : _a2.index; if (scrollIndex !== void 0 && this.range) { const bufferSize = Math.max( this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2) ); const minIndex = Math.max(0, scrollIndex - bufferSize); const maxIndex = Math.min( this.options.count - 1, scrollIndex + bufferSize ); return index >= minIndex && index <= maxIndex; } return true; }; this.measureElement = (node) => { if (!node) { this.elementsCache.forEach((cached, key2) => { if (!cached.isConnected) { this.observer.unobserve(cached); this.elementsCache.delete(key2); } }); return; } const index = this.indexFromElement(node); if (!this.isIndexInRange(index)) return; const key = this.options.getItemKey(index); const prevNode = this.elementsCache.get(key); if (prevNode !== node) { if (prevNode) { this.observer.unobserve(prevNode); } this.observer.observe(node); this.elementsCache.set(key, node); } if (node.isConnected && (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(index)) { this.resizeItem(index, this.options.measureElement(node, void 0, this)); } }; this.resizeItem = (index, size2) => { var _a3, _b2; var _a2, _b, _c; if (!this.isIndexInRange(index)) return; if ((_a2 = this._resizeBatch) == null ? void 0 : _a2.sync) this.getMeasurements(); let cachedSize; let itemStart; let key; const flat2 = (_b = this._singleLaneMeasurements) == null ? void 0 : _b.flat; if (this.options.lanes === 1 && flat2 != null) { key = this.options.getItemKey(index); itemStart = flat2[index * 2]; cachedSize = flat2[index * 2 + 1]; } else { const item = this.measurementsCache[index]; if (!item) return; key = item.key; itemStart = item.start; cachedSize = item.size; } const itemSize = (_a3 = this.itemSizeCache.get(key)) != null ? _a3 : cachedSize; const delta = size2 - itemSize; if (delta !== 0) { const wasAtEnd = this.options.anchorTo === "end" && !isSmoothScroll(this.scrollState) && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold; const prevTotalSize = wasAtEnd ? this._getLayoutTotalSize() : 0; const scrollOffset = this.getScrollOffset(); const isFirstMeasure = !this.itemSizeCache.has(key); const defaultShouldAdjust = isFirstMeasure ? ( itemStart < scrollOffset ) : ( itemStart + itemSize <= scrollOffset && this.scrollDirection !== "backward" ); const shouldAdjustScroll = !isSmoothScroll(this.scrollState) && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange( (_b2 = this.measurementsCache[index]) != null ? _b2 : { index, key, start: itemStart, size: cachedSize, end: itemStart + cachedSize, lane: 0 }, delta, this ) : defaultShouldAdjust); if (this.pendingMin === null || index < this.pendingMin) { this.pendingMin = index; } this.itemSizeCache.set(key, size2); this.itemSizeCacheVersion++; let adjustedSync = false; if (!this._awaitingCommandReadBack()) { if (wasAtEnd) { adjustedSync = this.applyScrollAdjustment( this._getLayoutTotalSize() - prevTotalSize ); } else if (shouldAdjustScroll) { adjustedSync = this.applyScrollAdjustment(delta); } } if (this._resizeBatch) { this._resizeBatch.notify = true; (_c = this._resizeBatch).sync || (_c.sync = adjustedSync); return; } this.notify(adjustedSync); this._noteClampMax(); this._flushHoldIfReady(true); this._retryClampedAdjustment(); } }; this.getVirtualItems = memo( () => [this.getVirtualIndexes(), this.getMeasurements(), this._holdOffset], (indexes, measurements, hold) => { const virtualItems = []; for (let k = 0, len = indexes.length; k < len; k++) { const i = indexes[k]; const measurement = measurements[i]; virtualItems.push( hold === 0 ? measurement : { ...measurement, start: measurement.start - hold, end: measurement.end - hold } ); } return virtualItems; }, { key: false, debug: () => this.options.debug } ); this.getVirtualItemForOffset = (offset2) => { var _a2; const measurements = this.getMeasurements(); if (measurements.length === 0) { return void 0; } const flat2 = (_a2 = this._singleLaneMeasurements) == null ? void 0 : _a2.flat; const useFlat = this.options.lanes === 1 && flat2 != null; const idx = findNearestBinarySearch( 0, measurements.length - 1, useFlat ? (i) => flat2[i * 2] : (i) => notUndefined(measurements[i]).start, offset2 ); return notUndefined(measurements[idx]); }; this._noteClampMax = () => { var _a2; if (!this._awaitingCommandReadBack()) return; const elementMax = this._elementMaxScrollOffset(); if (elementMax === null) return; const write2 = this.pendingWrite; const max2 = Math.max(elementMax, 0) + this._holdOffset; if (max2 >= write2.target) return; const lowMaxes = (_a2 = write2.lowMaxes) != null ? _a2 : write2.lowMaxes = []; if (lowMaxes[lowMaxes.length - 1] !== max2) lowMaxes.push(max2); }; this.getMaxScrollOffset = () => { var _a2; return ((_a2 = this._elementMaxScrollOffset()) != null ? _a2 : 0) + this._holdOffset; }; this._toLayoutOffset = (elementOffset) => { var _a2; let offset2 = elementOffset + this._holdOffset; if (((_a2 = this.pendingScrollAnchor) == null ? void 0 : _a2.kind) === "anchor") { offset2 += this.pendingScrollAnchor.delta; } return offset2; }; this._elementMaxScrollOffset = () => { const el = this.scrollElement; if (el === null) return null; if ("scrollHeight" in el) { return this.options.horizontal ? el.scrollWidth - el.clientWidth : el.scrollHeight - el.clientHeight; } if ("document" in el) { const doc2 = el.document.documentElement; return this.options.horizontal ? doc2.scrollWidth - el.innerWidth : doc2.scrollHeight - el.innerHeight; } return null; }; this._momentumStop = null; this._stopMomentum = (done) => { const el = this.scrollElement; const win = this.targetWindow; if (el === null || win === null) return; const scroller = "document" in el ? el.document.scrollingElement : el; if (!(scroller == null ? void 0 : scroller.style)) return; if (this._momentumStop) { this._momentumStop.done = done; return; } const { style } = scroller; const property = this.options.horizontal ? "overflow-x" : "overflow-y"; const value = style.getPropertyValue(property); const priority = style.getPropertyPriority(property); const crossSize = () => this.options.horizontal ? scroller.clientHeight : scroller.clientWidth; const crossSizeBefore = crossSize(); style.setProperty(property, "hidden", "important"); if (crossSize() !== crossSizeBefore) { style.setProperty(property, value, priority); return; } const stop = { restore: () => { if (style.getPropertyValue(property) !== "hidden" || style.getPropertyPriority(property) !== "important") { return false; } style.setProperty(property, value, priority); return true; }, done }; this._momentumStop = stop; win.requestAnimationFrame( () => win.requestAnimationFrame(() => { if (this._momentumStop !== stop) return; this._momentumStop = null; if (stop.restore()) stop.done(); }) ); }; this._clampedBy = (target) => { const elementMax = this._elementMaxScrollOffset(); if (elementMax === null) return null; const maxAtWrite = elementMax + this._holdOffset; return target > maxAtWrite + 0.5 ? { target, maxAtWrite } : null; }; this.getVirtualDistanceFromEnd = () => { return Math.max( this._getLayoutTotalSize() + this.options.scrollMargin - this.getSize() - this.getScrollOffset(), 0 ); }; this.getDistanceFromEnd = () => { return Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0); }; this.isAtEnd = (threshold = this.options.scrollEndThreshold) => { return this.getDistanceFromEnd() <= threshold; }; this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => { if (!this.scrollElement) return 0; const size2 = this.getSize(); const scrollOffset = this.getScrollOffset(); if (align === "auto") { align = toOffset >= scrollOffset + size2 ? "end" : "start"; } if (align === "center") { toOffset += (itemSize - size2) / 2; } else if (align === "end") { toOffset -= size2; } const maxOffset = this.getMaxScrollOffset(); return Math.max(Math.min(maxOffset, toOffset), 0); }; this.getOffsetForIndex = (index, align = "auto") => { index = Math.max(0, Math.min(index, this.options.count - 1)); const size2 = this.getSize(); const scrollOffset = this.getScrollOffset(); const item = this.getMeasurements()[index]; if (!item) return; if (align === "auto") { if (item.end >= scrollOffset + size2 - this.options.scrollPaddingEnd) { align = "end"; } else if (item.start <= scrollOffset + this.options.scrollPaddingStart) { align = "start"; } else { return [scrollOffset, align]; } } if (align === "end" && index === this.options.count - 1) { const maxOffset = this.getMaxScrollOffset(); const toOffset2 = maxOffset - this.options.paddingEnd + this.options.scrollPaddingEnd; return [Math.max(Math.min(toOffset2, maxOffset), 0), align]; } const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart; return [ this.getOffsetForAlignment(toOffset, align, item.size), align ]; }; this.scrollToOffset = (toOffset, { align = "start", behavior = "auto" } = {}) => { this._startScroll( { index: null, align }, this.getOffsetForAlignment(toOffset, align), behavior, "absolute" ); }; this.scrollToIndex = (index, { align: initialAlign = "auto", behavior = "auto" } = {}) => { index = Math.max(0, Math.min(index, this.options.count - 1)); const offsetInfo = this.getOffsetForIndex(index, initialAlign); if (!offsetInfo) return; const [offset2, align] = offsetInfo; this._startScroll({ index, align }, offset2, behavior, "absolute"); }; this.scrollBy = (delta, { behavior = "auto" } = {}) => { var _a2; const offset2 = this.getOffsetForAlignment( ((_a2 = this.getCommandWrittenOffset()) != null ? _a2 : this.getScrollOffset()) + delta, "start" ); this._startScroll( { index: null, align: "start" }, offset2, behavior, "relative" ); }; this.scrollToEnd = ({ behavior = "auto" } = {}) => { if (this.options.count > 0) { this._startScroll( { index: this.options.count - 1, align: "end", toEnd: true }, Math.max(this.getMaxScrollOffset(), 0), behavior, "absolute" ); return; } this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), { behavior }); }; this.cancelScroll = () => { if (this.rafId != null && this.targetWindow) { this.targetWindow.cancelAnimationFrame(this.rafId); this.rafId = null; } this.scrollState = null; }; this.getTotalSize = () => Math.max(this._getLayoutTotalSize() - this._holdOffset, 0); this._getLayoutTotalSize = () => { var _a3; var _a2, _b; const measurements = this.getMeasurements(); let end; if (measurements.length === 0) { end = this.options.paddingStart; } else if (this.options.lanes === 1) { const lastIdx = measurements.length - 1; const flat2 = (_a2 = this._singleLaneMeasurements) == null ? void 0 : _a2.flat; if (flat2 != null) { end = flat2[lastIdx * 2] + flat2[lastIdx * 2 + 1]; } else { end = (_a3 = (_b = measurements[lastIdx]) == null ? void 0 : _b.end) != null ? _a3 : 0; } } else { const endByLane = Array(this.options.lanes).fill(null); let endIndex = measurements.length - 1; while (endIndex >= 0 && endByLane.some((val) => val === null)) { const item = measurements[endIndex]; if (endByLane[item.lane] === null) { endByLane[item.lane] = item.end; } endIndex--; } end = Math.max(...endByLane.filter((val) => val !== null)); } return Math.max( end - this.options.scrollMargin + this.options.paddingEnd, 0 ); }; this.takeSnapshot = () => { const snapshot = []; if (this.itemSizeCache.size === 0) return snapshot; const m = this.getMeasurements(); for (const item of m) { if (item && this.itemSizeCache.has(item.key)) { snapshot.push({ index: item.index, key: item.key, start: item.start, size: item.size, end: item.end, lane: item.lane }); } } return snapshot; }; this._scrollToOffset = (offset2, { adjustments, behavior } = {}) => { const write2 = { target: offset2 + (adjustments != null ? adjustments : 0), smooth: behavior === "smooth" }; this.pendingWrite = write2; this.options.scrollToFn( offset2 - this._holdOffset, { behavior, adjustments }, this ); return write2; }; this.getCommandWrittenOffset = () => this.scrollState !== null && this.pendingWrite !== null && !this.pendingWrite.smooth ? this.pendingWrite.target : null; this._awaitingCommandReadBack = () => { const writtenOffset = this.getCommandWrittenOffset(); return !(isIOSWebKit() && this._iosGesture.dragging()) && writtenOffset !== null && !approxEqual(writtenOffset, this.getScrollOffset()); }; this._followOffsetTarget = (delta) => { if (this.scrollState !== null && this.scrollState.index == null) { this.scrollState.lastTargetOffset += delta; } }; this.measure = () => { this.pendingMin = null; this.itemSizeCache.clear(); this.laneAssignments.clear(); this.itemSizeCacheVersion++; this.notify(false); }; this.setOptions(opts); } get scrollAdjustments() { return 0; } applyScrollAdjustment(delta, behavior) { if (delta === 0) return false; this._followOffsetTarget(delta); if (!this._canWriteScroll()) { this._holdOffset += delta; if (this.scrollOffset !== null) this.scrollOffset += delta; return true; } else { const offset2 = this.getScrollOffset(); this._clampedAdjustment = this._clampedBy(offset2 + delta); const write2 = this._scrollToOffset(offset2, { adjustments: delta, behavior }); if (this.scrollOffset !== null) { if (this.pendingWrite === write2) this.scrollOffset += delta; if (this.scrollOffset < 0) this.scrollOffset = 0; } return true; } } scheduleScrollReconcile() { if (!this.targetWindow) { this.scrollState = null; return; } if (this.rafId != null) return; this.rafId = this.targetWindow.requestAnimationFrame(() => { this.rafId = null; this.reconcileScroll(); }); } getScrollStateTarget(state2) { const offsetInfo = state2.toEnd ? [Math.max(this.getMaxScrollOffset(), 0)] : state2.index != null ? this.getOffsetForIndex(state2.index, state2.align) : void 0; return offsetInfo ? offsetInfo[0] : state2.lastTargetOffset; } reconcileScroll() { if (!this.scrollState) return; const el = this.scrollElement; if (!el) return; const MAX_RECONCILE_MS = 5e3; if (this.now() - this.scrollState.startedAt > MAX_RECONCILE_MS) { this.scrollState = null; return; } if (this.scrollState.phase === "queued") { this.scheduleScrollReconcile(); return; } this.getMeasurements(); const targetOffset = this.getScrollStateTarget(this.scrollState); const STABLE_FRAMES = this.scrollState.index == null ? 1 : this.options.useAnimationFrameWithResizeObserver ? 3 : 2; const targetChanged = targetOffset !== this.scrollState.lastTargetOffset; if (!targetChanged && approxEqual(targetOffset, this.getScrollOffset())) { if (this.scrollState.phase === "smooth") { this.scrollState.phase = "smoothLanded"; } else if (this.scrollState.phase === "smoothFinishing") { this.scrollState.phase = "instant"; } this.scrollState.stableFrames++; if (this.scrollState.stableFrames >= STABLE_FRAMES) { if (this.getScrollOffset() !== targetOffset) { this._scrollToOffset(targetOffset, { behavior: "auto" }); } this.scrollState = null; return; } } else { this.scrollState.stableFrames = 0; if (targetChanged) { const viewport = this.getSize() || 600; const distance = Math.abs(targetOffset - this.getScrollOffset()); const keepSmooth = isSmoothScroll(this.scrollState) && distance > viewport; this.scrollState.lastTargetOffset = targetOffset; if (keepSmooth) { this.scrollState.phase = "smooth"; } else if (this.scrollState.phase === "smooth") { this.scrollState.phase = "smoothFinishing"; } else if (this.scrollState.phase === "smoothLanded") { this.scrollState.phase = "instant"; } this._scrollToOffset(targetOffset, { behavior: keepSmooth ? "smooth" : "auto" }); } } this.scheduleScrollReconcile(); } _startScroll(target, offset2, behavior, kind) { this.pendingScrollAnchor = null; this._clampedAdjustment = null; const tail = this._iosGesture.tail(); if (kind === "absolute" && tail !== null) { if (tail === "fling" && momentumOverridesWrites()) { this._stopMomentum(() => { const state2 = this.scrollState; if ((state2 == null ? void 0 : state2.phase) !== "queued" || this._iosGesture.tail() !== "fling" || this._reportedOverscroll) { return; } this._iosGesture.end(); this._flushHoldIfReady(true); this._writeAwaitingCommand(); }); this.scrollState = { ...target, startedAt: this.now(), lastTargetOffset: offset2, stableFrames: 0, phase: "queued", behavior, samples: [] }; this.scheduleScrollReconcile(); return; } this._iosGesture.end(); } this.scrollState = { ...target, startedAt: this.now(), lastTargetOffset: offset2, stableFrames: 0, behavior, phase: initialScrollPhase( behavior, target.index != null && approxEqual(offset2, this.getScrollOffset()) ) }; this._scrollToOffset(offset2, { behavior }); this.scheduleScrollReconcile(); } } const findNearestBinarySearch = (low, high, getCurrentValue, value) => { while (low <= high) { const middle = (low + high) / 2 | 0; const currentValue = getCurrentValue(middle); if (currentValue < value) { low = middle + 1; } else if (currentValue > value) { high = middle - 1; } else { return middle; } } if (low > 0) { return low - 1; } else { return 0; } }; function findNearestBinarySearchFlat(flat2, high, value) { let low = 0; while (low <= high) { const middle = (low + high) / 2 | 0; const currentValue = flat2[middle * 2]; if (currentValue < value) { low = middle + 1; } else if (currentValue > value) { high = middle - 1; } else { return middle; } } return low > 0 ? low - 1 : 0; } function calculateRangeImpl(measurements, outerSize, scrollOffset, lanes, flat2) { const lastIndex = measurements.length - 1; if (measurements.length <= lanes) { return { startIndex: 0, endIndex: lastIndex }; } if (lanes === 1 && flat2 !== null) { const startIndex2 = findNearestBinarySearchFlat( flat2, lastIndex, scrollOffset ); let endIndex2 = startIndex2; const limit = scrollOffset + outerSize; while (endIndex2 < lastIndex && flat2[endIndex2 * 2] + flat2[endIndex2 * 2 + 1] < limit) { endIndex2++; } return { startIndex: startIndex2, endIndex: endIndex2 }; } const getStart = (index) => measurements[index].start; let startIndex = findNearestBinarySearch(0, lastIndex, getStart, scrollOffset); let endIndex = startIndex; if (lanes === 1) { while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) { endIndex++; } } else if (lanes > 1) { const endPerLane = Array(lanes).fill(0); while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) { const item = measurements[endIndex]; endPerLane[item.lane] = item.end; endIndex++; } const startPerLane = Array(lanes).fill(scrollOffset + outerSize); while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) { const item = measurements[startIndex]; startPerLane[item.lane] = item.start; startIndex--; } startIndex = Math.max(0, startIndex - startIndex % lanes); endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes)); } return { startIndex, endIndex }; } function useVirtualizerBase(options) { const virtualizer = new Virtualizer(vue.unref(options)); const state2 = vue.shallowRef(virtualizer); const cleanup = virtualizer._didMount(); vue.watch( () => vue.unref(options).getScrollElement(), () => { virtualizer._willUpdate(); }, { immediate: true } ); vue.watch( () => vue.unref(options), (options2) => { virtualizer.setOptions({ ...options2, onChange: (instance, sync) => { var _a2; vue.triggerRef(state2); (_a2 = options2.onChange) == null ? void 0 : _a2.call(options2, instance, sync); } }); virtualizer._willUpdate(); vue.triggerRef(state2); }, { immediate: true } ); vue.onScopeDispose(cleanup); return state2; } function useVirtualizer(options) { return useVirtualizerBase( vue.computed(() => ({ observeElementRect, observeElementOffset, scrollToFn: elementScroll, ...vue.unref(options) })) ); } var ListboxVirtualizer_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ListboxVirtualizer", props: { options: { type: Array, required: true }, overscan: { type: Number, required: false }, estimateSize: { type: [Number, Function], required: false }, textContent: { type: Function, required: false } }, setup(__props) { var _a2; const props = __props; const slots = vue.useSlots(); const rootContext = injectListboxRootContext(); const parentEl = useParentElement(); const { getItems } = useCollection(); rootContext.isVirtual.value = true; const padding = vue.computed(() => { const el = parentEl.value; if (!el) return { start: 0, end: 0 }; else { const styles = window.getComputedStyle(el); return { start: Number.parseFloat(styles.paddingBlockStart || styles.paddingTop), end: Number.parseFloat(styles.paddingBlockEnd || styles.paddingBottom) }; } }); const virtualizer = useVirtualizer({ get scrollPaddingStart() { return padding.value.start; }, get scrollPaddingEnd() { return padding.value.end; }, get count() { return props.options.length; }, get horizontal() { return rootContext.orientation.value === "horizontal"; }, estimateSize(index) { var _a3; if (typeof props.estimateSize === "function") return props.estimateSize(index); return (_a3 = props.estimateSize) != null ? _a3 : 28; }, getScrollElement() { return parentEl.value; }, overscan: (_a2 = props.overscan) != null ? _a2 : 12 }); const virtualizedItems = vue.computed(() => virtualizer.value.getVirtualItems().map((item) => { const defaultNode = slots.default({ option: props.options[item.index], virtualizer: virtualizer.value, virtualItem: item })[0]; const targetNode = defaultNode.type === vue.Fragment && Array.isArray(defaultNode.children) ? defaultNode.children.find((child) => typeof child.type !== "symbol") : defaultNode; return { item, is: vue.cloneVNode(targetNode, { "key": `${item.key}`, "data-index": item.index, "aria-setsize": props.options.length, "aria-posinset": item.index + 1, "style": { position: "absolute", top: 0, left: 0, transform: `translateY(${item.start}px)`, overflowAnchor: "none" } }) }; })); rootContext.virtualFocusHook.on(({ event, scroll }) => { const index = props.options.findIndex((option) => { if (Array.isArray(rootContext.modelValue.value)) return compare(option, rootContext.modelValue.value[0], rootContext.by); else return compare(option, rootContext.modelValue.value, rootContext.by); }); if (index !== -1) { event == null ? void 0 : event.preventDefault(); virtualizer.value.scrollToIndex(index, { align: "start" }); requestAnimationFrame(() => { const item = queryCheckedElement(parentEl.value); if (item) { const focus2 = event ? true : scroll ? void 0 : false; rootContext.changeHighlight(item, scroll, focus2); } }); } else if (scroll) rootContext.highlightFirstItem(); else requestAnimationFrame(() => { var _a3; const item = (_a3 = getItems().find((i) => i.ref.dataset.disabled !== "")) == null ? void 0 : _a3.ref; if (item) rootContext.changeHighlight(item, false, false); }); }); rootContext.virtualHighlightHook.on((value) => { const index = props.options.findIndex((option) => { return compare(option, value, rootContext.by); }); virtualizer.value.scrollToIndex(index, { align: "start" }); requestAnimationFrame(() => { const item = queryCheckedElement(parentEl.value); if (item) rootContext.changeHighlight(item); }); }); const search = refAutoReset("", 1e3); const optionsWithMetadata = vue.computed(() => { const parseTextContent = (option) => { if (props.textContent) return props.textContent(option); else return option == null ? void 0 : option.toString().toLowerCase(); }; return props.options.map((option, index) => ({ index, textContent: parseTextContent(option) })); }); function handleMultipleReplace(event, intent) { var _a3, _b, _c; if (!((_a3 = rootContext.firstValue) == null ? void 0 : _a3.value) || !rootContext.multiple.value || !Array.isArray(rootContext.modelValue.value)) return; const collection = getItems().filter((i) => i.ref.dataset.disabled !== ""); const lastValue = (_b = collection.find((i) => i.ref === rootContext.highlightedElement.value)) == null ? void 0 : _b.value; if (!lastValue) return; let value = null; switch (intent) { case "prev": case "next": { value = findValuesBetween(props.options, rootContext.firstValue.value, lastValue); break; } case "first": { value = findValuesBetween(props.options, rootContext.firstValue.value, (_c = props.options) == null ? void 0 : _c[0]); break; } case "last": { value = findValuesBetween(props.options, rootContext.firstValue.value, props.options.at(-1)); break; } } rootContext.modelValue.value = value; } rootContext.virtualKeydownHook.on((event) => { var _a3; const isMetaKey = event.altKey || event.ctrlKey || event.metaKey; const isTabKey = event.key === "Tab" && !isMetaKey; if (isTabKey) return; let intent = MAP_KEY_TO_FOCUS_INTENT[event.key]; if (isMetaKey && event.key === "a" && rootContext.multiple.value) { event.preventDefault(); rootContext.modelValue.value = [...props.options]; intent = "last"; } else if (event.shiftKey && intent) handleMultipleReplace(event, intent); if (["first", "last"].includes(intent)) { event.preventDefault(); const index = intent === "first" ? 0 : props.options.length - 1; virtualizer.value.scrollToIndex(index); requestAnimationFrame(() => { const items = getItems(); const item = intent === "first" ? items[0] : items.at(-1); if (item) rootContext.changeHighlight(item.ref); }); } else if (!intent && !isMetaKey) { search.value += event.key; const currentIndex = Number((_a3 = getActiveElement()) == null ? void 0 : _a3.getAttribute("data-index")); const currentMatch = optionsWithMetadata.value[currentIndex].textContent; const filteredOptions = optionsWithMetadata.value.map((i) => { var _a4; return (_a4 = i.textContent) != null ? _a4 : ""; }); const next = getNextMatch(filteredOptions, search.value, currentMatch); const nextMatch = optionsWithMetadata.value.find((option) => option.textContent === next); if (nextMatch) { virtualizer.value.scrollToIndex(nextMatch.index, { align: "start" }); requestAnimationFrame(() => { const item = parentEl.value.querySelector(`[data-index="${nextMatch.index}"]`); if (item instanceof HTMLElement) rootContext.changeHighlight(item); }); } } }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", { "data-reka-virtualizer": "", style: vue.normalizeStyle({ position: "relative", width: "100%", height: `${vue.unref(virtualizer).getTotalSize()}px` }) }, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(virtualizedItems.value, ({ is, item }) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(is), { key: item.index }); }), 128))], 4); }; } }); var ListboxVirtualizer_default = ListboxVirtualizer_vue_vue_type_script_setup_true_lang_default; const [injectPopperRootContext, providePopperRootContext] = createContext("PopperRoot"); var PopperRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "PopperRoot", setup(__props) { const anchor = vue.ref(); providePopperRootContext({ anchor, onAnchorChange: (element) => anchor.value = element }); return (_ctx, _cache) => { return vue.renderSlot(_ctx.$slots, "default"); }; } }); var PopperRoot_default = PopperRoot_vue_vue_type_script_setup_true_lang_default; var PopperAnchor_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "PopperAnchor", props: { reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const { forwardRef, currentElement } = useForwardExpose(); const rootContext = injectPopperRootContext(); vue.watchPostEffect(() => { var _a2; rootContext.onAnchorChange((_a2 = props.reference) != null ? _a2 : currentElement.value); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { ref: vue.unref(forwardRef), as: __props.as, "as-child": __props.asChild }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, ["as", "as-child"]); }; } }); var PopperAnchor_default = PopperAnchor_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$m = { key: 0, d: "M0 0L6 6L12 0" }; const _hoisted_2$h = { key: 1, d: "M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0" }; var Arrow_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "Arrow", props: { width: { type: Number, required: false, default: 10 }, height: { type: Number, required: false, default: 5 }, rounded: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "svg" } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { width: __props.width, height: __props.height, viewBox: __props.asChild ? void 0 : "0 0 12 6", preserveAspectRatio: __props.asChild ? void 0 : "none" }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", {}, () => [!__props.rounded ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$m)) : (vue.openBlock(), vue.createElementBlock("path", _hoisted_2$h))])]), _: 3 }, 16, [ "width", "height", "viewBox", "preserveAspectRatio" ]); }; } }); var Arrow_default = Arrow_vue_vue_type_script_setup_true_lang_default; function isNotNull(value) { return value !== null; } function transformOrigin(options) { return { name: "transformOrigin", options, fn(data) { var _a2, _b, _c, _d, _e2; const { placement, rects, middlewareData } = data; const cannotCenterArrow = ((_a2 = middlewareData.arrow) == null ? void 0 : _a2.centerOffset) !== 0; const isArrowHidden = cannotCenterArrow; const arrowWidth = isArrowHidden ? 0 : options.arrowWidth; const arrowHeight = isArrowHidden ? 0 : options.arrowHeight; const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement); const noArrowAlignX = { start: options.dir === "rtl" ? "100%" : "0%", center: "50%", end: options.dir === "rtl" ? "0%" : "100%" }[placedAlign]; const noArrowAlignY = { start: "0%", center: "50%", end: "100%" }[placedAlign]; const arrowXCenter = ((_c = (_b = middlewareData.arrow) == null ? void 0 : _b.x) != null ? _c : 0) + arrowWidth / 2; const arrowYCenter = ((_e2 = (_d = middlewareData.arrow) == null ? void 0 : _d.y) != null ? _e2 : 0) + arrowHeight / 2; let x = ""; let y = ""; if (placedSide === "bottom") { x = isArrowHidden ? noArrowAlignX : `${arrowXCenter}px`; y = `${-arrowHeight}px`; } else if (placedSide === "top") { x = isArrowHidden ? noArrowAlignX : `${arrowXCenter}px`; y = `${rects.floating.height + arrowHeight}px`; } else if (placedSide === "right") { x = `${-arrowHeight}px`; y = isArrowHidden ? noArrowAlignY : `${arrowYCenter}px`; } else if (placedSide === "left") { x = `${rects.floating.width + arrowHeight}px`; y = isArrowHidden ? noArrowAlignY : `${arrowYCenter}px`; } return { data: { x, y } }; } }; } function getSideAndAlignFromPlacement(placement) { const [side, align = "center"] = placement.split("-"); return [side, align]; } const sides = ["top", "right", "bottom", "left"]; const min = Math.min; const max = Math.max; const round = Math.round; const floor = Math.floor; const createCoords = (v) => ({ x: v, y: v }); const oppositeSideMap = { left: "right", right: "left", bottom: "top", top: "bottom" }; function clamp(start, value, end) { return max(start, min(value, end)); } function evaluate(value, param) { return typeof value === "function" ? value(param) : value; } function getSide(placement) { return placement.split("-")[0]; } function getAlignment(placement) { return placement.split("-")[1]; } function getOppositeAxis(axis) { return axis === "x" ? "y" : "x"; } function getAxisLength(axis) { return axis === "y" ? "height" : "width"; } function getSideAxis(placement) { const firstChar = placement[0]; return firstChar === "t" || firstChar === "b" ? "y" : "x"; } function getAlignmentAxis(placement) { return getOppositeAxis(getSideAxis(placement)); } function getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = getAlignment(placement); const alignmentAxis = getAlignmentAxis(placement); const length = getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; } function getExpandedPlacements(placement) { const oppositePlacement = getOppositePlacement(placement); return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; } function getOppositeAlignmentPlacement(placement) { return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start"); } const lrPlacement = ["left", "right"]; const rlPlacement = ["right", "left"]; const tbPlacement = ["top", "bottom"]; const btPlacement = ["bottom", "top"]; function getSideList(side, isStart, rtl) { switch (side) { case "top": case "bottom": if (rtl) return isStart ? rlPlacement : lrPlacement; return isStart ? lrPlacement : rlPlacement; case "left": case "right": return isStart ? tbPlacement : btPlacement; default: return []; } } function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = getAlignment(placement); let list = getSideList(getSide(placement), direction === "start", rtl); if (alignment) { list = list.map((side) => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(getOppositeAlignmentPlacement)); } } return list; } function getOppositePlacement(placement) { const side = getSide(placement); return oppositeSideMap[side] + placement.slice(side.length); } function expandPaddingObject(padding) { var _padding$top, _padding$right, _padding$bottom, _padding$left; return { top: (_padding$top = padding.top) != null ? _padding$top : 0, right: (_padding$right = padding.right) != null ? _padding$right : 0, bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0, left: (_padding$left = padding.left) != null ? _padding$left : 0 }; } function getPaddingObject(padding) { return typeof padding !== "number" ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function rectToClientRect(rect) { const { x, y, width, height } = rect; return { width, height, top: y, left: x, right: x + width, bottom: y + height, x, y }; } function computeCoordsFromPlacement(_ref, placement, rtl) { let { reference, floating } = _ref; const sideAxis = getSideAxis(placement); const alignmentAxis = getAlignmentAxis(placement); const alignLength = getAxisLength(alignmentAxis); const side = getSide(placement); const isVertical = sideAxis === "y"; const commonX = reference.x + reference.width / 2 - floating.width / 2; const commonY = reference.y + reference.height / 2 - floating.height / 2; const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; let coords; switch (side) { case "top": coords = { x: commonX, y: reference.y - floating.height }; break; case "bottom": coords = { x: commonX, y: reference.y + reference.height }; break; case "right": coords = { x: reference.x + reference.width, y: commonY }; break; case "left": coords = { x: reference.x - floating.width, y: commonY }; break; default: coords = { x: reference.x, y: reference.y }; } const alignment = getAlignment(placement); if (alignment) { coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1); } return coords; } async function detectOverflow(state2, options) { var _await$platform$isEle; if (options === void 0) { options = {}; } const { x, y, platform: platform2, rects, elements, strategy } = state2; const { boundary = "clippingAncestors", rootBoundary = "viewport", elementContext = "floating", altBoundary = false, padding = 0 } = evaluate(options, state2); const paddingObject = getPaddingObject(padding); const altContext = elementContext === "floating" ? "reference" : "floating"; const element = elements[altBoundary ? altContext : elementContext]; const clippingClientRect = rectToClientRect(await platform2.getClippingRect({ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)), boundary, rootBoundary, strategy })); const rect = elementContext === "floating" ? { x, y, width: rects.floating.width, height: rects.floating.height } : rects.reference; const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating)); const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) && await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || { x: 1, y: 1 }; const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({ elements, rect, offsetParent, strategy }) : rect); return { top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x }; } const MAX_RESET_COUNT = 50; const computePosition$1 = async (reference, floating, config2) => { const { placement = "bottom", strategy = "absolute", middleware = [], platform: platform2 } = config2; const platformWithDetectOverflow = platform2.detectOverflow ? platform2 : { ...platform2, detectOverflow }; const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating)); let rects = await platform2.getElementRects({ reference, floating, strategy }); let { x, y } = computeCoordsFromPlacement(rects, placement, rtl); let statefulPlacement = placement; let resetCount = 0; const middlewareData = {}; for (let i = 0; i < middleware.length; i++) { const currentMiddleware = middleware[i]; if (!currentMiddleware) { continue; } const { name, fn } = currentMiddleware; const { x: nextX, y: nextY, data, reset } = await fn({ x, y, initialPlacement: placement, placement: statefulPlacement, strategy, middlewareData, rects, platform: platformWithDetectOverflow, elements: { reference, floating } }); x = nextX != null ? nextX : x; y = nextY != null ? nextY : y; middlewareData[name] = { ...middlewareData[name], ...data }; if (reset && resetCount < MAX_RESET_COUNT) { resetCount++; if (typeof reset === "object") { if (reset.placement) { statefulPlacement = reset.placement; } if (reset.rects) { rects = reset.rects === true ? await platform2.getElementRects({ reference, floating, strategy }) : reset.rects; } ({ x, y } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); } i = -1; } } return { x, y, placement: statefulPlacement, strategy, middlewareData }; }; const arrow$2 = (options) => ({ name: "arrow", options, async fn(state2) { const { x, y, placement, rects, platform: platform2, elements, middlewareData } = state2; const { element, padding = 0 } = evaluate(options, state2) || {}; if (element == null) { return {}; } const paddingObject = getPaddingObject(padding); const coords = { x, y }; const axis = getAlignmentAxis(placement); const length = getAxisLength(axis); const arrowDimensions = await platform2.getDimensions(element); const isYAxis = axis === "y"; const minProp = isYAxis ? "top" : "left"; const maxProp = isYAxis ? "bottom" : "right"; const clientProp = isYAxis ? "clientHeight" : "clientWidth"; const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; const startDiff = coords[axis] - rects.reference[axis]; const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element)); let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) { clientSize = elements.floating[clientProp] || rects.floating[length]; } const centerToReference = endDiff / 2 - startDiff / 2; const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; const minPadding = min(paddingObject[minProp], largestPossiblePadding); const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); const max2 = clientSize - arrowDimensions[length] - maxPadding; const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; const offset2 = clamp(minPadding, center, max2); const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max2 : 0; return { [axis]: coords[axis] + alignmentOffset, data: { [axis]: offset2, centerOffset: center - offset2 - alignmentOffset, ...shouldAddOffset && { alignmentOffset } }, reset: shouldAddOffset }; } }); const flip$1 = function(options) { if (options === void 0) { options = {}; } return { name: "flip", options, async fn(state2) { var _middlewareData$arrow, _middlewareData$flip; const { placement, middlewareData, rects, initialPlacement, platform: platform2, elements } = state2; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = "bestFit", fallbackAxisSideDirection = "none", flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state2); if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } const side = getSide(placement); const initialSideAxis = getSideAxis(initialPlacement); const isBasePlacement = getSide(initialPlacement) === initialPlacement; const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)); const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); } const placements = [initialPlacement, ...fallbackPlacements]; const overflow = await platform2.detectOverflow(state2, detectOverflowOptions); const overflows = []; let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; if (checkMainAxis) { overflows.push(overflow[side]); } if (checkCrossAxis) { const sides2 = getAlignmentSides(placement, rects, rtl); overflows.push(overflow[sides2[0]], overflow[sides2[1]]); } overflowsData = [...overflowsData, { placement, overflows }]; if (!overflows.every((side2) => side2 <= 0)) { var _middlewareData$flip2, _overflowsData$filter; const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; const nextPlacement = placements[nextIndex]; if (nextPlacement) { const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false; if (!ignoreCrossAxisOverflow || overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { return { data: { index: nextIndex, overflows: overflowsData }, reset: { placement: nextPlacement } }; } } let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; if (!resetPlacement) { switch (fallbackStrategy) { case "bestFit": { var _overflowsData$filter2; const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => { if (hasFallbackAxisSideDirection) { const currentSideAxis = getSideAxis(d.placement); return currentSideAxis === initialSideAxis || currentSideAxis === "y"; } return true; }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; if (placement2) { resetPlacement = placement2; } break; } case "initialPlacement": resetPlacement = initialPlacement; break; } } if (placement !== resetPlacement) { return { reset: { placement: resetPlacement } }; } } return {}; } }; }; function getSideOffsets(overflow, rect) { return { top: overflow.top - rect.height, right: overflow.right - rect.width, bottom: overflow.bottom - rect.height, left: overflow.left - rect.width }; } function isAnySideFullyClipped(overflow) { return sides.some((side) => overflow[side] >= 0); } const hide$1 = function(options) { if (options === void 0) { options = {}; } return { name: "hide", options, async fn(state2) { const { rects, platform: platform2 } = state2; const { strategy = "referenceHidden", ...detectOverflowOptions } = evaluate(options, state2); switch (strategy) { case "referenceHidden": { const overflow = await platform2.detectOverflow(state2, { ...detectOverflowOptions, elementContext: "reference" }); const offsets = getSideOffsets(overflow, rects.reference); return { data: { referenceHiddenOffsets: offsets, referenceHidden: isAnySideFullyClipped(offsets) } }; } case "escaped": { const overflow = await platform2.detectOverflow(state2, { ...detectOverflowOptions, altBoundary: true }); const offsets = getSideOffsets(overflow, rects.floating); return { data: { escapedOffsets: offsets, escaped: isAnySideFullyClipped(offsets) } }; } default: { return {}; } } } }; }; const originSides = new Set(["left", "top"]); async function convertValueToCoords(state2, options) { const { placement, platform: platform2, elements } = state2; const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)); const side = getSide(placement); const alignment = getAlignment(placement); const isVertical = getSideAxis(placement) === "y"; const mainAxisMulti = originSides.has(side) ? -1 : 1; const crossAxisMulti = rtl && isVertical ? -1 : 1; const rawValue = evaluate(options, state2); let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === "number" ? { mainAxis: rawValue, crossAxis: 0, alignmentAxis: null } : { mainAxis: rawValue.mainAxis || 0, crossAxis: rawValue.crossAxis || 0, alignmentAxis: rawValue.alignmentAxis }; if (alignment && typeof alignmentAxis === "number") { crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; } return isVertical ? { x: crossAxis * crossAxisMulti, y: mainAxis * mainAxisMulti } : { x: mainAxis * mainAxisMulti, y: crossAxis * crossAxisMulti }; } const offset$1 = function(options) { if (options === void 0) { options = 0; } return { name: "offset", options, async fn(state2) { var _middlewareData$offse, _middlewareData$arrow; const { x, y, placement, middlewareData } = state2; const diffCoords = await convertValueToCoords(state2, options); if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } return { x: x + diffCoords.x, y: y + diffCoords.y, data: { ...diffCoords, placement } }; } }; }; const shift$1 = function(options) { if (options === void 0) { options = {}; } return { name: "shift", options, async fn(state2) { const { x, y, placement, platform: platform2 } = state2; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: (_ref) => { let { x: x2, y: y2 } = _ref; return { x: x2, y: y2 }; } }, ...detectOverflowOptions } = evaluate(options, state2); const coords = { x, y }; const overflow = await platform2.detectOverflow(state2, detectOverflowOptions); const crossAxis = getSideAxis(placement); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]); if (checkMainAxis) { mainAxisCoord = clampCoord(mainAxis, mainAxisCoord); } if (checkCrossAxis) { crossAxisCoord = clampCoord(crossAxis, crossAxisCoord); } const limitedCoords = limiter.fn({ ...state2, [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }); return { ...limitedCoords, data: { x: limitedCoords.x - x, y: limitedCoords.y - y, enabled: { [mainAxis]: checkMainAxis, [crossAxis]: checkCrossAxis } } }; } }; }; const limitShift$1 = function(options) { if (options === void 0) { options = {}; } return { options, fn(state2) { var _rawOffset$mainAxis, _rawOffset$crossAxis; const { x, y, placement, rects, middlewareData } = state2; const { offset: offset2 = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true } = evaluate(options, state2); const coords = { x, y }; const crossAxis = getSideAxis(placement); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; const rawOffset = evaluate(offset2, state2); const computedOffset = typeof rawOffset === "number" ? { mainAxis: rawOffset, crossAxis: 0 } : { mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0, crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0 }; if (checkMainAxis) { const len = mainAxis === "y" ? "height" : "width"; const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; if (mainAxisCoord < limitMin) { mainAxisCoord = limitMin; } else if (mainAxisCoord > limitMax) { mainAxisCoord = limitMax; } } if (checkCrossAxis) { var _middlewareData$offse, _middlewareData$offse2; const len = mainAxis === "y" ? "width" : "height"; const isOriginSide = originSides.has(getSide(placement)); const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); if (crossAxisCoord < limitMin) { crossAxisCoord = limitMin; } else if (crossAxisCoord > limitMax) { crossAxisCoord = limitMax; } } return { [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }; } }; }; const size$1 = function(options) { if (options === void 0) { options = {}; } return { name: "size", options, async fn(state2) { const { placement, rects, platform: platform2, elements } = state2; const { apply = () => { }, ...detectOverflowOptions } = evaluate(options, state2); const overflow = await platform2.detectOverflow(state2, detectOverflowOptions); const side = getSide(placement); const alignment = getAlignment(placement); const isYAxis = getSideAxis(placement) === "y"; const { width, height } = rects.floating; let heightSide; let widthSide; if (side === "top" || side === "bottom") { heightSide = side; widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right"; } else { widthSide = side; heightSide = alignment === "end" ? "top" : "bottom"; } const maximumClippingHeight = height - overflow.top - overflow.bottom; const maximumClippingWidth = width - overflow.left - overflow.right; const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); const shiftData = state2.middlewareData.shift; const noShift = !shiftData; let availableHeight = overflowAvailableHeight; let availableWidth = overflowAvailableWidth; if (shiftData != null && shiftData.enabled.x) { availableWidth = maximumClippingWidth; } if (shiftData != null && shiftData.enabled.y) { availableHeight = maximumClippingHeight; } if (noShift && !alignment) { if (isYAxis) { availableWidth = width - 2 * max(overflow.left, overflow.right); } else { availableHeight = height - 2 * max(overflow.top, overflow.bottom); } } await apply({ ...state2, availableWidth, availableHeight }); const nextDimensions = await platform2.getDimensions(elements.floating); if (width !== nextDimensions.width || height !== nextDimensions.height) { return { reset: { rects: true } }; } return {}; } }; }; function hasWindow() { return typeof window !== "undefined"; } function getNodeName(node) { if (isNode(node)) { return (node.nodeName || "").toLowerCase(); } return "#document"; } function getWindow(node) { var _node$ownerDocument; return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { if (!hasWindow()) { return false; } return value instanceof Node || value instanceof getWindow(value).Node; } function isElement(value) { if (!hasWindow()) { return false; } return value instanceof Element || value instanceof getWindow(value).Element; } function isHTMLElement(value) { if (!hasWindow()) { return false; } return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; } function isShadowRoot(value) { if (!hasWindow() || typeof ShadowRoot === "undefined") { return false; } return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; } function isOverflowElement(element) { const { overflow, overflowX, overflowY, display } = getComputedStyle$1(element); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents"; } function isTableElement(element) { return /^(table|td|th)$/.test(getNodeName(element)); } function isTopLayer(element) { try { if (element.matches(":popover-open")) { return true; } } catch (_e2) { } try { return element.matches(":modal"); } catch (_e2) { return false; } } const willChangeRe = /transform|translate|scale|rotate|perspective|filter/; const containRe = /paint|layout|strict|content/; const isNotNone = (value) => !!value && value !== "none"; let isWebKitValue; function isContainingBlock(elementOrCss) { const css2 = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss; return isNotNone(css2.transform) || isNotNone(css2.translate) || isNotNone(css2.scale) || isNotNone(css2.rotate) || isNotNone(css2.perspective) || !isWebKit() && (isNotNone(css2.backdropFilter) || isNotNone(css2.filter)) || willChangeRe.test(css2.willChange || "") || containRe.test(css2.contain || ""); } function getContainingBlock(element) { let currentNode = getParentNode(element); while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else if (isTopLayer(currentNode)) { return null; } currentNode = getParentNode(currentNode); } return null; } function isWebKit() { if (isWebKitValue == null) { isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"); } return isWebKitValue; } function isLastTraversableNode(node) { return /^(html|body|#document)$/.test(getNodeName(node)); } function getComputedStyle$1(element) { return getWindow(element).getComputedStyle(element); } function getNodeScroll(element) { if (isElement(element)) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } return { scrollLeft: element.scrollX, scrollTop: element.scrollY }; } function getParentNode(node) { if (getNodeName(node) === "html") { return node; } const result = ( node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node) ); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { return (node.ownerDocument || node).body; } if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = getWindow(scrollableAncestor); if (isBody) { const frameElement = getFrameElement(win); return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); } else { return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } } function getFrameElement(win) { return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; } function getCssDimensions(element) { const css2 = getComputedStyle$1(element); let width = parseFloat(css2.width) || 0; let height = parseFloat(css2.height) || 0; const hasOffset = isHTMLElement(element); const offsetWidth = hasOffset ? element.offsetWidth : width; const offsetHeight = hasOffset ? element.offsetHeight : height; const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; } return { width, height, $: shouldFallback }; } function unwrapElement$1(element) { return !isElement(element) ? element.contextElement : element; } function getScale(element) { const domElement = unwrapElement$1(element); if (!isHTMLElement(domElement)) { return createCoords(1); } const rect = domElement.getBoundingClientRect(); const { width, height, $ } = getCssDimensions(domElement); let x = ($ ? round(rect.width) : rect.width) / width; let y = ($ ? round(rect.height) : rect.height) / height; if (!x || !Number.isFinite(x)) { x = 1; } if (!y || !Number.isFinite(y)) { y = 1; } return { x, y }; } const noOffsets = createCoords(0); function getVisualOffsets(element) { const win = getWindow(element); if (!isWebKit() || !win.visualViewport) { return noOffsets; } return { x: win.visualViewport.offsetLeft, y: win.visualViewport.offsetTop }; } function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { if (isFixed === void 0) { isFixed = false; } return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); } function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { if (includeScale === void 0) { includeScale = false; } if (isFixedStrategy === void 0) { isFixedStrategy = false; } const clientRect = element.getBoundingClientRect(); const domElement = unwrapElement$1(element); let scale = createCoords(1); if (includeScale) { if (offsetParent) { if (isElement(offsetParent)) { scale = getScale(offsetParent); } } else { scale = getScale(element); } } const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); let x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement && offsetParent) { const win = getWindow(domElement); const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; let currentWin = win; let currentIFrame = getFrameElement(currentWin); while (currentIFrame && offsetWin !== currentWin) { const iframeScale = getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css2 = getComputedStyle$1(currentIFrame); const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css2.paddingLeft)) * iframeScale.x; const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css2.paddingTop)) * iframeScale.y; x *= iframeScale.x; y *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x += left; y += top; currentWin = getWindow(currentIFrame); currentIFrame = getFrameElement(currentWin); } } return rectToClientRect({ width, height, x, y }); } function getWindowScrollBarX(element, rect) { const leftScroll = getNodeScroll(element).scrollLeft; if (!rect) { return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; } return rect.left + leftScroll; } function getHTMLOffset(documentElement, scroll) { const htmlRect = documentElement.getBoundingClientRect(); const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); const y = htmlRect.top + scroll.scrollTop; return { x, y }; } function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { elements, rect, offsetParent, strategy } = _ref; const isFixed = strategy === "fixed"; const documentElement = getDocumentElement(offsetParent); const topLayer = elements ? isTopLayer(elements.floating) : false; if (offsetParent === documentElement || topLayer && isFixed) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; let scale = createCoords(1); const offsets = createCoords(0); const isOffsetParentAnElement = isHTMLElement(offsetParent); if (isOffsetParentAnElement || !isFixed) { if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = getBoundingClientRect(offsetParent); scale = getScale(offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); return { width: rect.width * scale.x, height: rect.height * scale.y, x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y }; } function getClientRects(element) { return element.getClientRects ? Array.from(element.getClientRects()) : []; } function getDocumentRect(html) { const scroll = getNodeScroll(html); const body = html.ownerDocument.body; const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x = -scroll.scrollLeft + getWindowScrollBarX(html); const y = -scroll.scrollTop; if (getComputedStyle$1(body).direction === "rtl") { x += max(html.clientWidth, body.clientWidth) - width; } return { width, height, x, y }; } const SCROLLBAR_MAX = 25; function getViewportRect(element, strategy, rootBoundary) { if (rootBoundary === void 0) { rootBoundary = "viewport"; } const isLayoutViewport = rootBoundary === "layoutViewport"; const win = getWindow(element); const html = getDocumentElement(element); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed"; if (isLayoutViewport) { if (!layoutRelativeClientCoords) { x = -visualViewport.offsetLeft; y = -visualViewport.offsetTop; } } else { width = visualViewport.width; height = visualViewport.height; if (layoutRelativeClientCoords) { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } } const windowScrollbarX = getWindowScrollBarX(html); if (windowScrollbarX <= 0) { const doc2 = html.ownerDocument; const body = doc2.body; const bodyStyles = getComputedStyle(body); const bodyMarginInline = doc2.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth; if (gutter <= SCROLLBAR_MAX) { width -= gutter; } } return { width, height, x, y }; } function getInnerBoundingClientRect(element, strategy) { const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); const top = clientRect.top + element.clientTop; const left = clientRect.left + element.clientLeft; const scale = getScale(element); const width = element.clientWidth * scale.x; const height = element.clientHeight * scale.y; const x = left * scale.x; const y = top * scale.y; return { width, height, x, y }; } function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { let rect; if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") { rect = getViewportRect(element, strategy, clippingAncestor); } else if (clippingAncestor === "document") { rect = getDocumentRect(getDocumentElement(element)); } else if (isElement(clippingAncestor)) { rect = getInnerBoundingClientRect(clippingAncestor, strategy); } else { const visualOffsets = getVisualOffsets(element); rect = { x: clippingAncestor.x - visualOffsets.x, y: clippingAncestor.y - visualOffsets.y, width: clippingAncestor.width, height: clippingAncestor.height }; } return rectToClientRect(rect); } function getClippingElementAncestors(element, cache) { const cachedResult = cache.get(element); if (cachedResult) { return cachedResult; } let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); let lastKeptComputedStyle = null; const elementIsFixed = getComputedStyle$1(element).position === "fixed"; let currentNode = elementIsFixed ? getParentNode(element) : element; while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { const computedStyle = getComputedStyle$1(currentNode); const currentNodeIsContaining = isContainingBlock(currentNode); const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : ""; const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static"); if (shouldDropCurrentNode) { result = result.filter((ancestor) => ancestor !== currentNode); } else { lastKeptComputedStyle = computedStyle; } currentNode = getParentNode(currentNode); } cache.set(element, result); return result; } function getClippingRect(_ref) { let { element, boundary, rootBoundary, strategy } = _ref; const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy); let top = firstRect.top; let right = firstRect.right; let bottom = firstRect.bottom; let left = firstRect.left; for (let i = 1; i < clippingAncestors.length; i++) { const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy); top = max(rect.top, top); right = min(rect.right, right); bottom = min(rect.bottom, bottom); left = max(rect.left, left); } return { width: right - left, height: bottom - top, x: left, y: top }; } function getDimensions(element) { const { width, height } = getCssDimensions(element); return { width, height }; } function getRectRelativeToOffsetParent(element, offsetParent, strategy) { const isOffsetParentAnElement = isHTMLElement(offsetParent); const documentElement = getDocumentElement(offsetParent); const isFixed = strategy === "fixed"; const rect = getBoundingClientRect(element, true, isFixed, offsetParent); let scroll = { scrollLeft: 0, scrollTop: 0 }; const offsets = createCoords(0); if (isOffsetParentAnElement || !isFixed) { if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } if (!isOffsetParentAnElement && documentElement) { offsets.x = getWindowScrollBarX(documentElement); } const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; return { x, y, width: rect.width, height: rect.height }; } function isStaticPositioned(element) { return getComputedStyle$1(element).position === "static"; } function getTrueOffsetParent(element, polyfill) { if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") { return null; } if (polyfill) { return polyfill(element); } let rawOffsetParent = element.offsetParent; if (getDocumentElement(element) === rawOffsetParent) { rawOffsetParent = rawOffsetParent.ownerDocument.body; } return rawOffsetParent; } function getOffsetParent(element, polyfill) { const win = getWindow(element); if (isTopLayer(element)) { return win; } if (!isHTMLElement(element)) { let svgOffsetParent = getParentNode(element); while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { return svgOffsetParent; } svgOffsetParent = getParentNode(svgOffsetParent); } return win; } let offsetParent = getTrueOffsetParent(element, polyfill); while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { offsetParent = getTrueOffsetParent(offsetParent, polyfill); } if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { return win; } return offsetParent || getContainingBlock(element) || win; } const getElementRects = async function(data) { const getOffsetParentFn = this.getOffsetParent || getOffsetParent; const getDimensionsFn = this.getDimensions; const floatingDimensions = await getDimensionsFn(data.floating); return { reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), floating: { x: 0, y: 0, width: floatingDimensions.width, height: floatingDimensions.height } }; }; function isRTL(element) { return getComputedStyle$1(element).direction === "rtl"; } const platform = { convertOffsetParentRelativeRectToViewportRelativeRect, getDocumentElement, getClippingRect, getOffsetParent, getElementRects, getClientRects, getDimensions, getScale, isElement, isRTL }; function rectsAreEqual(a, b) { return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; } function observeMove(element, onMove, ancestorResize) { let io = null; let timeoutId; const root = getDocumentElement(element); function cleanup() { var _io; clearTimeout(timeoutId); (_io = io) == null || _io.disconnect(); io = null; } function refresh(skip, threshold) { if (skip === void 0) { skip = false; } if (threshold === void 0) { threshold = 1; } cleanup(); const elementRectForRootMargin = element.getBoundingClientRect(); const { left, top, width, height } = elementRectForRootMargin; if (!skip) { onMove(); } if (!width || !height) { return; } const insetTop = floor(top); const insetRight = floor(root.clientWidth - (left + width)); const insetBottom = floor(root.clientHeight - (top + height)); const insetLeft = floor(left); const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; const options = { rootMargin, threshold: max(0, min(1, threshold)) || 1 }; let isFirstUpdate = true; function handleObserve(entries) { const ratio = entries[0].intersectionRatio; if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { return refresh(); } if (ratio !== threshold) { if (!isFirstUpdate) { return refresh(); } if (!ratio) { timeoutId = setTimeout(() => { refresh(false, 1e-7); }, 1e3); } else { refresh(false, ratio); } } isFirstUpdate = false; } try { io = new IntersectionObserver(handleObserve, { ...options, root: root.ownerDocument }); } catch (_e2) { io = new IntersectionObserver(handleObserve, options); } io.observe(element); } const win = getWindow(element); const handleResize = () => refresh(ancestorResize); win.addEventListener("resize", handleResize); refresh(true); return () => { win.removeEventListener("resize", handleResize); cleanup(); }; } function autoUpdate(reference, floating, update, options) { if (options === void 0) { options = {}; } const { ancestorScroll = true, ancestorResize = true, elementResize = typeof ResizeObserver === "function", layoutShift = typeof IntersectionObserver === "function", animationFrame = false } = options; const referenceEl = unwrapElement$1(reference); const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : []; ancestors.forEach((ancestor) => { ancestorScroll && ancestor.addEventListener("scroll", update); ancestorResize && ancestor.addEventListener("resize", update); }); const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null; let reobserveFrame = -1; let resizeObserver = null; if (elementResize) { resizeObserver = new ResizeObserver((_ref) => { let [firstEntry] = _ref; if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) { resizeObserver.unobserve(floating); cancelAnimationFrame(reobserveFrame); reobserveFrame = requestAnimationFrame(() => { var _resizeObserver; (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); }); } update(); }); if (referenceEl && !animationFrame) { resizeObserver.observe(referenceEl); } if (floating) { resizeObserver.observe(floating); } } let frameId; let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; if (animationFrame) { frameLoop(); } function frameLoop() { const nextRefRect = getBoundingClientRect(reference); if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { update(); } prevRefRect = nextRefRect; frameId = requestAnimationFrame(frameLoop); } update(); return () => { var _resizeObserver2; ancestors.forEach((ancestor) => { ancestorScroll && ancestor.removeEventListener("scroll", update); ancestorResize && ancestor.removeEventListener("resize", update); }); cleanupIo == null || cleanupIo(); (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); resizeObserver = null; if (animationFrame) { cancelAnimationFrame(frameId); } }; } const offset = offset$1; const shift = shift$1; const flip = flip$1; const size = size$1; const hide = hide$1; const arrow$1 = arrow$2; const limitShift = limitShift$1; const computePosition = (reference, floating, options) => { const cache = new Map(); const mergedOptions = options != null ? options : {}; const platformWithCache = { ...platform, ...mergedOptions.platform, _c: cache }; return computePosition$1(reference, floating, { ...mergedOptions, platform: platformWithCache }); }; function isComponentPublicInstance(target) { return target != null && typeof target === "object" && "$el" in target; } function unwrapElement(target) { if (isComponentPublicInstance(target)) { const element = target.$el; return isNode(element) && getNodeName(element) === "#comment" ? null : element; } return target; } function arrow(options) { return { name: "arrow", options, fn(args) { const element = unwrapElement(vue.toValue(options.element)); if (element == null) { return {}; } return arrow$1({ element, padding: options.padding }).fn(args); } }; } function getDPR(element) { if (typeof window === "undefined") { return 1; } const win = element.ownerDocument.defaultView || window; return win.devicePixelRatio || 1; } function roundByDPR(element, value) { const dpr = getDPR(element); return Math.round(value * dpr) / dpr; } function useFloating(reference, floating, options) { if (options === void 0) { options = {}; } const whileElementsMountedOption = options.whileElementsMounted; const openOption = vue.computed(() => { var _toValue; return (_toValue = vue.toValue(options.open)) != null ? _toValue : true; }); const middlewareOption = vue.computed(() => vue.toValue(options.middleware)); const placementOption = vue.computed(() => { var _toValue2; return (_toValue2 = vue.toValue(options.placement)) != null ? _toValue2 : "bottom"; }); const strategyOption = vue.computed(() => { var _toValue3; return (_toValue3 = vue.toValue(options.strategy)) != null ? _toValue3 : "absolute"; }); const transformOption = vue.computed(() => { var _toValue4; return (_toValue4 = vue.toValue(options.transform)) != null ? _toValue4 : true; }); const referenceElement = vue.computed(() => unwrapElement(reference.value)); const floatingElement = vue.computed(() => unwrapElement(floating.value)); const x = vue.ref(0); const y = vue.ref(0); const strategy = vue.ref(strategyOption.value); const placement = vue.ref(placementOption.value); const middlewareData = vue.shallowRef({}); const isPositioned = vue.ref(false); const floatingStyles = vue.computed(() => { const initialStyles = { position: strategy.value, left: "0", top: "0" }; if (!floatingElement.value) { return initialStyles; } const xVal = roundByDPR(floatingElement.value, x.value); const yVal = roundByDPR(floatingElement.value, y.value); if (transformOption.value) { return { ...initialStyles, transform: "translate(" + xVal + "px, " + yVal + "px)", ...getDPR(floatingElement.value) >= 1.5 && { willChange: "transform" } }; } return { position: strategy.value, left: xVal + "px", top: yVal + "px" }; }); let whileElementsMountedCleanup; function update() { if (referenceElement.value == null || floatingElement.value == null) { return; } const open = openOption.value; computePosition(referenceElement.value, floatingElement.value, { middleware: middlewareOption.value, placement: placementOption.value, strategy: strategyOption.value }).then((position) => { x.value = position.x; y.value = position.y; strategy.value = position.strategy; placement.value = position.placement; middlewareData.value = position.middlewareData; isPositioned.value = open !== false; }); } function cleanup() { if (typeof whileElementsMountedCleanup === "function") { whileElementsMountedCleanup(); whileElementsMountedCleanup = void 0; } } function attach() { cleanup(); if (whileElementsMountedOption === void 0) { update(); return; } if (referenceElement.value != null && floatingElement.value != null) { whileElementsMountedCleanup = whileElementsMountedOption(referenceElement.value, floatingElement.value, update); return; } } function reset() { if (!openOption.value) { isPositioned.value = false; } } vue.watch([middlewareOption, placementOption, strategyOption, openOption], update, { flush: "sync" }); vue.watch([referenceElement, floatingElement], attach, { flush: "sync" }); vue.watch(openOption, reset, { flush: "sync" }); if (vue.getCurrentScope()) { vue.onScopeDispose(cleanup); } return { x: vue.shallowReadonly(x), y: vue.shallowReadonly(y), strategy: vue.shallowReadonly(strategy), placement: vue.shallowReadonly(placement), middlewareData: vue.shallowReadonly(middlewareData), isPositioned: vue.shallowReadonly(isPositioned), floatingStyles, update }; } const _hoisted_1$l = ["dir"]; const PopperContentPropsDefaultValue = { side: "bottom", sideOffset: 0, sideFlip: true, align: "center", alignOffset: 0, alignFlip: true, arrowPadding: 0, hideShiftedArrow: true, avoidCollisions: true, collisionBoundary: () => [], collisionPadding: 0, sticky: "partial", hideWhenDetached: false, positionStrategy: "fixed", updatePositionStrategy: "optimized", prioritizePosition: false }; const [injectPopperContentContext, providePopperContentContext] = createContext("PopperContent"); var PopperContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "PopperContent", props: vue.mergeDefaults({ memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, dir: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, { ...PopperContentPropsDefaultValue }), emits: ["placed"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectPopperRootContext(); const { forwardRef, currentElement: contentElement } = useForwardExpose(); const dir = useDirection(vue.computed(() => props.dir)); const floatingRef = vue.ref(); const arrow$12 = vue.ref(); const { width: arrowWidth, height: arrowHeight } = useSize(arrow$12); const desiredPlacement = vue.computed(() => props.side + (props.align !== "center" ? `-${props.align}` : "")); const collisionPadding = vue.computed(() => { return typeof props.collisionPadding === "number" ? props.collisionPadding : { top: 0, right: 0, bottom: 0, left: 0, ...props.collisionPadding }; }); const boundary = vue.computed(() => { return Array.isArray(props.collisionBoundary) ? props.collisionBoundary : [props.collisionBoundary]; }); const detectOverflowOptions = vue.computed(() => { return { padding: collisionPadding.value, boundary: boundary.value.filter(isNotNull), altBoundary: boundary.value.length > 0 }; }); const flipOptions = vue.computed(() => { return { mainAxis: props.sideFlip, crossAxis: props.alignFlip }; }); const computedMiddleware = vue.computed(() => { return [ offset({ mainAxis: props.sideOffset + arrowHeight.value, alignmentAxis: props.alignOffset }), props.prioritizePosition && props.avoidCollisions && flip({ ...detectOverflowOptions.value, ...flipOptions.value }), props.avoidCollisions && shift({ mainAxis: true, crossAxis: !!props.prioritizePosition, limiter: props.sticky === "partial" ? limitShift() : void 0, ...detectOverflowOptions.value }), !props.prioritizePosition && props.avoidCollisions && flip({ ...detectOverflowOptions.value, ...flipOptions.value }), size({ ...detectOverflowOptions.value, apply: ({ elements, rects, availableWidth, availableHeight }) => { const { width: anchorWidth, height: anchorHeight } = rects.reference; const contentStyle = elements.floating.style; contentStyle.setProperty("--reka-popper-available-width", `${availableWidth}px`); contentStyle.setProperty("--reka-popper-available-height", `${availableHeight}px`); contentStyle.setProperty("--reka-popper-anchor-width", `${anchorWidth}px`); contentStyle.setProperty("--reka-popper-anchor-height", `${anchorHeight}px`); } }), arrow$12.value && arrow({ element: arrow$12.value, padding: props.arrowPadding }), transformOrigin({ arrowWidth: arrowWidth.value, arrowHeight: arrowHeight.value, dir: dir.value }), props.hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions.value }) ]; }); const reference = vue.computed(() => { var _a2; return (_a2 = props.reference) != null ? _a2 : rootContext.anchor.value; }); const { floatingStyles, placement, isPositioned, middlewareData } = useFloating(reference, floatingRef, { strategy: props.positionStrategy, placement: desiredPlacement, whileElementsMounted: (...args) => { const cleanup = autoUpdate(...args, { layoutShift: !props.disableUpdateOnLayoutShift, animationFrame: props.updatePositionStrategy === "always" }); return cleanup; }, middleware: computedMiddleware }); const placedSide = vue.computed(() => getSideAndAlignFromPlacement(placement.value)[0]); const placedAlign = vue.computed(() => getSideAndAlignFromPlacement(placement.value)[1]); vue.watchPostEffect(() => { if (isPositioned.value) emits("placed"); }); const shouldHideArrow = vue.computed(() => { var _a2; const cannotCenterArrow = ((_a2 = middlewareData.value.arrow) == null ? void 0 : _a2.centerOffset) !== 0; return props.hideShiftedArrow && cannotCenterArrow; }); const contentZIndex = vue.ref(""); vue.watchEffect(() => { if (contentElement.value) contentZIndex.value = window.getComputedStyle(contentElement.value).zIndex; }); const arrowX = vue.computed(() => { var _a2, _b; return (_b = (_a2 = middlewareData.value.arrow) == null ? void 0 : _a2.x) != null ? _b : 0; }); const arrowY = vue.computed(() => { var _a2, _b; return (_b = (_a2 = middlewareData.value.arrow) == null ? void 0 : _a2.y) != null ? _b : 0; }); providePopperContentContext({ placedSide, onArrowChange: (element) => arrow$12.value = element, arrowX, arrowY, shouldHideArrow }); return (_ctx, _cache) => { var _a2, _b, _c; return vue.openBlock(), vue.createElementBlock("div", { ref_key: "floatingRef", ref: floatingRef, "data-reka-popper-content-wrapper": "", dir: vue.unref(dir), style: vue.normalizeStyle({ ...vue.unref(floatingStyles), transform: vue.unref(isPositioned) ? vue.unref(floatingStyles).transform : "translate(0, -200%)", minWidth: "max-content", zIndex: contentZIndex.value, ["--reka-popper-transform-origin"]: [(_a2 = vue.unref(middlewareData).transformOrigin) == null ? void 0 : _a2.x, (_b = vue.unref(middlewareData).transformOrigin) == null ? void 0 : _b.y].join(" "), ...((_c = vue.unref(middlewareData).hide) == null ? void 0 : _c.referenceHidden) && { visibility: "hidden", pointerEvents: "none" } }) }, [props.memoDependencies ? vue.withMemo([ props.asChild, props.as, placedSide.value, placedAlign.value, vue.unref(isPositioned), ...Object.values(_ctx.$attrs), ...props.memoDependencies ], () => (vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps({ key: 0, ref: vue.unref(forwardRef) }, _ctx.$attrs, { "as-child": props.asChild, as: props.as, "data-side": placedSide.value, "data-align": placedAlign.value, style: { animation: !vue.unref(isPositioned) ? "none" : void 0 } }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "as-child", "as", "data-side", "data-align", "style" ])), _cache, 0) : (vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps({ key: 1, ref: vue.unref(forwardRef) }, _ctx.$attrs, { "as-child": props.asChild, as: props.as, "data-side": placedSide.value, "data-align": placedAlign.value, dir: vue.unref(dir), style: { animation: !vue.unref(isPositioned) ? "none" : void 0 } }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "as-child", "as", "data-side", "data-align", "dir", "style" ]))], 12, _hoisted_1$l); }; } }); var PopperContent_default = PopperContent_vue_vue_type_script_setup_true_lang_default; const OPPOSITE_SIDE = { top: "bottom", right: "left", bottom: "top", left: "right" }; var PopperArrow_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "PopperArrow", props: { width: { type: Number, required: false }, height: { type: Number, required: false }, rounded: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "svg" } }, setup(__props) { const { forwardRef } = useForwardExpose(); const contentContext = injectPopperContentContext(); const baseSide = vue.computed(() => OPPOSITE_SIDE[contentContext.placedSide.value]); return (_ctx, _cache) => { var _a2, _b, _c, _d; return vue.openBlock(), vue.createElementBlock("span", { ref: (el) => { vue.unref(contentContext).onArrowChange(el != null ? el : void 0); return void 0; }, style: vue.normalizeStyle({ position: "absolute", left: ((_a2 = vue.unref(contentContext).arrowX) == null ? void 0 : _a2.value) ? `${(_b = vue.unref(contentContext).arrowX) == null ? void 0 : _b.value}px` : void 0, top: ((_c = vue.unref(contentContext).arrowY) == null ? void 0 : _c.value) ? `${(_d = vue.unref(contentContext).arrowY) == null ? void 0 : _d.value}px` : void 0, [baseSide.value]: 0, transformOrigin: { top: "", right: "0 0", bottom: "center 0", left: "100% 0" }[vue.unref(contentContext).placedSide.value], transform: { top: "translateY(100%)", right: "translateY(50%) rotate(90deg) translateX(-50%)", bottom: `rotate(180deg)`, left: "translateY(50%) rotate(-90deg) translateX(50%)" }[vue.unref(contentContext).placedSide.value], visibility: vue.unref(contentContext).shouldHideArrow.value ? "hidden" : void 0 }) }, [vue.createVNode(Arrow_default, vue.mergeProps(_ctx.$attrs, { ref: vue.unref(forwardRef), style: { display: "block" }, as: __props.as, "as-child": __props.asChild, rounded: __props.rounded, width: __props.width, height: __props.height }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "as", "as-child", "rounded", "width", "height" ])], 4); }; } }); var PopperArrow_default = PopperArrow_vue_vue_type_script_setup_true_lang_default; function useComboboxContentPositioning(open) { const contentPosition = vue.ref("inline"); const contentPlaced = vue.ref(false); const currentContent = vue.ref(); const suppressHighlightScroll = vue.computed(() => contentPosition.value === "popper" && !contentPlaced.value); let pendingHighlightScroll; provideListboxHighlightScrollContext({ suppressHighlightScroll, onHighlightScrollRequest(scroll) { pendingHighlightScroll = scroll; } }); function onContentPositionChange(content, position) { if (currentContent.value !== content || contentPosition.value !== position) { contentPlaced.value = false; pendingHighlightScroll = void 0; } currentContent.value = content; contentPosition.value = position; } function onContentPlaced(content) { if (currentContent.value !== content || contentPosition.value !== "popper" || contentPlaced.value) return; contentPlaced.value = true; const scroll = pendingHighlightScroll; pendingHighlightScroll = void 0; if (open.value) scroll == null ? void 0 : scroll(); } function onContentUnmount(content) { if (currentContent.value !== content) return; currentContent.value = void 0; contentPosition.value = "inline"; contentPlaced.value = false; pendingHighlightScroll = void 0; } return { onContentPositionChange, onContentPlaced, onContentUnmount }; } const [injectComboboxRootContext, provideComboboxRootContext] = createContext("ComboboxRoot"); var ComboboxRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxRoot", props: { open: { type: Boolean, required: false, default: void 0 }, defaultOpen: { type: Boolean, required: false }, resetSearchTermOnBlur: { type: Boolean, required: false, default: true }, resetSearchTermOnSelect: { type: Boolean, required: false, default: true }, openOnFocus: { type: Boolean, required: false, default: false }, openOnClick: { type: Boolean, required: false, default: false }, ignoreFilter: { type: Boolean, required: false }, resetModelValueOnClear: { type: Boolean, required: false, default: false }, unmountOnHide: { type: Boolean, required: false, default: true }, modelValue: { type: null, required: false }, defaultValue: { type: null, required: false }, multiple: { type: Boolean, required: false }, dir: { type: String, required: false }, disabled: { type: Boolean, required: false }, highlightOnHover: { type: Boolean, required: false, default: true }, loop: { type: Boolean, required: false }, by: { type: [String, Function], required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, name: { type: String, required: false }, required: { type: Boolean, required: false } }, emits: [ "update:modelValue", "highlight", "update:open" ], setup(__props, { expose: __expose, emit: __emit }) { var _a2, _b, _c, _d; const props = __props; const emits = __emit; const { primitiveElement, currentElement: parentElement } = usePrimitiveElement(); const { multiple, disabled, ignoreFilter, resetSearchTermOnSelect, openOnFocus, openOnClick, dir: propDir, resetModelValueOnClear, highlightOnHover, loop, unmountOnHide } = vue.toRefs(props); const dir = useDirection(propDir); const modelValue = useVModel(props, "modelValue", emits, { defaultValue: (_a2 = props.defaultValue) != null ? _a2 : multiple.value ? [] : void 0, passive: props.modelValue === void 0, deep: true }); const open = useVModel(props, "open", emits, { defaultValue: props.defaultOpen, passive: props.open === void 0 }); async function onOpenChange(val) { var _a3, _b2; open.value = val; filterSearch.value = ""; if (val) { await vue.nextTick(); (_a3 = primitiveElement.value) == null ? void 0 : _a3.highlightSelected(); isUserInputted.value = true; (_b2 = inputElement.value) == null ? void 0 : _b2.focus(); } else { isUserInputted.value = false; setTimeout(() => { if (!val && props.resetSearchTermOnBlur) resetSearchTerm.trigger(); }, 1); } } const resetSearchTerm = createEventHook(); const isUserInputted = vue.ref(false); const isVirtual = vue.ref(false); const inputElement = vue.ref(); const triggerElement = vue.ref(); const highlightedElement = vue.computed(() => { var _a3, _b2; return (_b2 = (_a3 = primitiveElement.value) == null ? void 0 : _a3.highlightedElement) != null ? _b2 : void 0; }); const contentPositioning = useComboboxContentPositioning(open); const allItems = vue.ref( new Map()); const allGroups = vue.ref( new Map()); const { contains } = useFilter$1({ sensitivity: "base" }); const filterSearch = vue.ref(""); const filterState = vue.computed((oldValue) => { var _a3, _b2; if (!filterSearch.value || props.ignoreFilter || isVirtual.value) return { count: allItems.value.size, items: (_a3 = oldValue == null ? void 0 : oldValue.items) != null ? _a3 : new Map(), groups: (_b2 = oldValue == null ? void 0 : oldValue.groups) != null ? _b2 : new Set(allGroups.value.keys()) }; let itemCount = 0; const filteredItems = new Map(); const filteredGroups = new Set(); for (const [id, value] of allItems.value) { const score = contains(value, filterSearch.value); filteredItems.set(id, score ? 1 : 0); if (score) itemCount++; } for (const [groupId, group] of allGroups.value) for (const itemId of group) if (filteredItems.get(itemId) > 0) { filteredGroups.add(groupId); break; } return { count: itemCount, items: filteredItems, groups: filteredGroups }; }); const inst = vue.getCurrentInstance(); vue.onMounted(() => { var _a3, _b2, _c2; if (inst == null ? void 0 : inst.exposed) { inst.exposed.highlightItem = (_a3 = primitiveElement.value) == null ? void 0 : _a3.highlightItem; inst.exposed.highlightFirstItem = (_b2 = primitiveElement.value) == null ? void 0 : _b2.highlightFirstItem; inst.exposed.highlightSelected = (_c2 = primitiveElement.value) == null ? void 0 : _c2.highlightSelected; } }); __expose({ filtered: filterState, highlightedElement, highlightItem: (_b = primitiveElement.value) == null ? void 0 : _b.highlightItem, highlightFirstItem: (_c = primitiveElement.value) == null ? void 0 : _c.highlightFirstItem, highlightSelected: (_d = primitiveElement.value) == null ? void 0 : _d.highlightSelected }); provideComboboxRootContext({ modelValue, multiple, disabled, open, onOpenChange, ...contentPositioning, contentId: "", isUserInputted, isVirtual, inputElement, highlightedElement, onInputElementChange: (val) => inputElement.value = val, triggerElement, onTriggerElementChange: (val) => triggerElement.value = val, parentElement, resetSearchTermOnSelect, onResetSearchTerm: resetSearchTerm.on, allItems, allGroups, filterSearch, filterState, ignoreFilter, openOnFocus, openOnClick, resetModelValueOnClear, unmountOnHide }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperRoot_default), null, { default: vue.withCtx(() => [vue.createVNode(vue.unref(ListboxRoot_default), vue.mergeProps({ ref_key: "primitiveElement", ref: primitiveElement }, _ctx.$attrs, { modelValue: vue.unref(modelValue), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null), style: { pointerEvents: vue.unref(open) ? "auto" : void 0 }, as: __props.as, "as-child": __props.asChild, dir: vue.unref(dir), multiple: vue.unref(multiple), name: __props.name, required: __props.required, disabled: vue.unref(disabled), "highlight-on-hover": vue.unref(highlightOnHover), loop: vue.unref(loop), by: props.by, onHighlight: _cache[1] || (_cache[1] = ($event) => emits("highlight", $event)) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open), modelValue: vue.unref(modelValue) })]), _: 3 }, 16, [ "modelValue", "style", "as", "as-child", "dir", "multiple", "name", "required", "disabled", "highlight-on-hover", "loop", "by" ])]), _: 3 }); }; } }); var ComboboxRoot_default = ComboboxRoot_vue_vue_type_script_setup_true_lang_default; const [injectAutocompleteRootContext, provideAutocompleteRootContext] = createContext("AutocompleteRoot"); var AutocompleteRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "AutocompleteRoot", props: { modelValue: { type: String, required: false }, defaultValue: { type: String, required: false }, open: { type: Boolean, required: false, default: void 0 }, defaultOpen: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, dir: { type: String, required: false }, name: { type: String, required: false }, required: { type: Boolean, required: false }, resetSearchTermOnBlur: { type: Boolean, required: false, default: false }, openOnFocus: { type: Boolean, required: false, default: false }, openOnClick: { type: Boolean, required: false, default: false }, ignoreFilter: { type: Boolean, required: false }, highlightOnHover: { type: Boolean, required: false, default: true }, loop: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "update:modelValue", "highlight", "update:open" ], setup(__props, { expose: __expose, emit: __emit }) { var _a2, _b, _c, _d; const props = __props; const emits = __emit; const { primitiveElement, currentElement: parentElement } = usePrimitiveElement(); const { disabled, ignoreFilter, openOnFocus, openOnClick, dir: propDir, highlightOnHover, loop } = vue.toRefs(props); const dir = useDirection(propDir); const modelValue = useVModel(props, "modelValue", emits, { defaultValue: (_a2 = props.defaultValue) != null ? _a2 : "", passive: props.modelValue === void 0 }); const open = useVModel(props, "open", emits, { defaultValue: props.defaultOpen, passive: props.open === void 0 }); const contextModelValue = vue.computed({ get: () => modelValue.value, set: (val) => { if (val === null || val === void 0) modelValue.value = ""; else modelValue.value = String(val); } }); async function onOpenChange(val) { var _a3, _b2; open.value = val; if (val) { filterSearch.value = modelValue.value || ""; await vue.nextTick(); (_a3 = primitiveElement.value) == null ? void 0 : _a3.highlightSelected(); isUserInputted.value = true; (_b2 = inputElement.value) == null ? void 0 : _b2.focus(); } else { isUserInputted.value = false; filterSearch.value = ""; setTimeout(() => { if (!val && props.resetSearchTermOnBlur) resetSearchTerm.trigger(); }, 1); } } const resetSearchTerm = createEventHook(); const isUserInputted = vue.ref(false); const isVirtual = vue.ref(false); const inputElement = vue.ref(); const triggerElement = vue.ref(); const highlightedElement = vue.computed(() => { var _a3, _b2; return (_b2 = (_a3 = primitiveElement.value) == null ? void 0 : _a3.highlightedElement) != null ? _b2 : void 0; }); const contentPositioning = useComboboxContentPositioning(open); const allItems = vue.ref( new Map()); const allGroups = vue.ref( new Map()); const { contains } = useFilter$1({ sensitivity: "base" }); const filterSearch = vue.ref(""); const filterState = vue.computed((oldValue) => { var _a3, _b2; if (!filterSearch.value || props.ignoreFilter || isVirtual.value) return { count: allItems.value.size, items: (_a3 = oldValue == null ? void 0 : oldValue.items) != null ? _a3 : new Map(), groups: (_b2 = oldValue == null ? void 0 : oldValue.groups) != null ? _b2 : new Set(allGroups.value.keys()) }; let itemCount = 0; const filteredItems = new Map(); const filteredGroups = new Set(); for (const [id, value] of allItems.value) { const score = contains(value, filterSearch.value); filteredItems.set(id, score ? 1 : 0); if (score) itemCount++; } for (const [groupId, group] of allGroups.value) for (const itemId of group) if (filteredItems.get(itemId) > 0) { filteredGroups.add(groupId); break; } return { count: itemCount, items: filteredItems, groups: filteredGroups }; }); const inst = vue.getCurrentInstance(); vue.onMounted(() => { var _a3, _b2, _c2; if (inst == null ? void 0 : inst.exposed) { inst.exposed.highlightItem = (_a3 = primitiveElement.value) == null ? void 0 : _a3.highlightItem; inst.exposed.highlightFirstItem = (_b2 = primitiveElement.value) == null ? void 0 : _b2.highlightFirstItem; inst.exposed.highlightSelected = (_c2 = primitiveElement.value) == null ? void 0 : _c2.highlightSelected; } }); __expose({ filtered: filterState, highlightedElement, highlightItem: (_b = primitiveElement.value) == null ? void 0 : _b.highlightItem, highlightFirstItem: (_c = primitiveElement.value) == null ? void 0 : _c.highlightFirstItem, highlightSelected: (_d = primitiveElement.value) == null ? void 0 : _d.highlightSelected }); provideComboboxRootContext({ modelValue: contextModelValue, multiple: vue.ref(false), disabled, open, onOpenChange, ...contentPositioning, contentId: "", isUserInputted, isVirtual, inputElement, highlightedElement, onInputElementChange: (val) => inputElement.value = val, triggerElement, onTriggerElementChange: (val) => triggerElement.value = val, parentElement, resetSearchTermOnSelect: vue.ref(false), onResetSearchTerm: resetSearchTerm.on, allItems, allGroups, filterSearch, filterState, ignoreFilter, openOnFocus, openOnClick, resetModelValueOnClear: vue.ref(true), unmountOnHide: vue.ref(true) }); provideAutocompleteRootContext({ modelValue }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperRoot_default), null, { default: vue.withCtx(() => [vue.createVNode(vue.unref(ListboxRoot_default), vue.mergeProps({ ref_key: "primitiveElement", ref: primitiveElement }, _ctx.$attrs, { modelValue: contextModelValue.value, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => contextModelValue.value = $event), style: { pointerEvents: vue.unref(open) ? "auto" : void 0 }, as: __props.as, "as-child": __props.asChild, dir: vue.unref(dir), name: __props.name, required: __props.required, disabled: vue.unref(disabled), "highlight-on-hover": vue.unref(highlightOnHover), loop: vue.unref(loop), onHighlight: _cache[1] || (_cache[1] = ($event) => emits("highlight", $event)) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open), modelValue: vue.unref(modelValue) })]), _: 3 }, 16, [ "modelValue", "style", "as", "as-child", "dir", "name", "required", "disabled", "highlight-on-hover", "loop" ])]), _: 3 }); }; } }); var AutocompleteRoot_default = AutocompleteRoot_vue_vue_type_script_setup_true_lang_default; var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "AutocompleteInput", props: { modelValue: { type: String, required: false }, autoFocus: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "input" } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectComboboxRootContext(); const autocompleteContext = injectAutocompleteRootContext(); const listboxContext = injectListboxRootContext(); const { primitiveElement, currentElement } = usePrimitiveElement(); const modelValue = useVModel(props, "modelValue", emits, { passive: props.modelValue === void 0 }); if (autocompleteContext.modelValue.value) modelValue.value = autocompleteContext.modelValue.value; vue.onMounted(() => { if (currentElement.value) rootContext.onInputElementChange(currentElement.value); }); const { isComposing, shouldDeferInput, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposing((event) => { const el = event.target; if (el) processInputValue(el.value); }); function handleKeyDown(ev) { if (isComposing.value) return; ev.preventDefault(); if (!rootContext.open.value) rootContext.onOpenChange(true); } function processInputValue(value) { if (!rootContext.open.value) { rootContext.onOpenChange(true); vue.nextTick(() => { if (value) { rootContext.filterSearch.value = value; listboxContext.highlightFirstItem(); } }); } else rootContext.filterSearch.value = value; autocompleteContext.modelValue.value = value; } function handleInput(event) { if (shouldDeferInput.value) return; processInputValue(event.target.value); } function handleFocus() { if (rootContext.openOnFocus.value && !rootContext.open.value) rootContext.onOpenChange(true); } function handleClick() { if (rootContext.openOnClick.value && !rootContext.open.value) rootContext.onOpenChange(true); } vue.watch(autocompleteContext.modelValue, (newVal) => { const text = newVal != null ? newVal : ""; if (modelValue.value !== text) modelValue.value = text; }); rootContext.onResetSearchTerm(() => { var _a2; modelValue.value = (_a2 = autocompleteContext.modelValue.value) != null ? _a2 : ""; }); vue.watch(rootContext.filterState, (_newValue, oldValue) => { if (!rootContext.isVirtual.value && oldValue.count === 0) listboxContext.highlightFirstItem(); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(ListboxFilter_default), { ref_key: "primitiveElement", ref: primitiveElement, modelValue: vue.unref(modelValue), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null), as: __props.as, "as-child": __props.asChild, "auto-focus": __props.autoFocus, disabled: __props.disabled, "aria-expanded": vue.unref(rootContext).open.value, "aria-controls": vue.unref(rootContext).contentId, "aria-autocomplete": "list", role: "combobox", autocomplete: "off", onClick: handleClick, onInput: handleInput, onKeydown: vue.withKeys(handleKeyDown, ["down", "up"]), onFocus: handleFocus, onCompositionstart: vue.unref(handleCompositionStart), onCompositionupdate: vue.unref(handleCompositionUpdate), onCompositionend: vue.unref(handleCompositionEnd) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "modelValue", "as", "as-child", "auto-focus", "disabled", "aria-expanded", "aria-controls", "onCompositionstart", "onCompositionupdate", "onCompositionend" ]); }; } }); var AutocompleteInput_default = AutocompleteInput_vue_vue_type_script_setup_true_lang_default; var ComboboxAnchor_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxAnchor", props: { reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const { forwardRef } = useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperAnchor_default), { "as-child": "", reference: __props.reference }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), vue.mergeProps({ ref: vue.unref(forwardRef), "as-child": __props.asChild, as: __props.as }, _ctx.$attrs), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["as-child", "as"])]), _: 3 }, 8, ["reference"]); }; } }); var ComboboxAnchor_default = ComboboxAnchor_vue_vue_type_script_setup_true_lang_default; const [injectComboboxContentContext, provideComboboxContentContext] = createContext("ComboboxContent"); var ComboboxContentImpl_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxContentImpl", props: { position: { type: String, required: false, default: "inline" }, bodyLock: { type: Boolean, required: false }, hideWhenEmpty: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, dir: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false }, present: { type: Boolean, required: false, default: true } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { position } = vue.toRefs(props); const rootContext = injectComboboxRootContext(); const contentId = Symbol("ComboboxContent"); vue.watch(position, (value) => rootContext.onContentPositionChange(contentId, value), { immediate: true }); const isEmpty2 = vue.computed(() => rootContext.ignoreFilter.value ? rootContext.allItems.value.size === 0 : rootContext.filterState.value.count === 0); const { forwardRef, currentElement } = useForwardExpose(); const scrollLocked = useBodyScrollLock(props.present && props.bodyLock); vue.watch([() => props.present, () => props.bodyLock], ([present, bodyLock]) => scrollLocked.value = present && bodyLock); useFocusGuards(); const ariaHiddenTarget = vue.computed(() => props.present ? rootContext.parentElement.value : void 0); useHideOthers(ariaHiddenTarget); const pickedProps = vue.computed(() => { if (props.position === "popper") { const { present: _2, ...forwardedProps$1 } = props; return forwardedProps$1; } else return {}; }); const forwardedProps = useForwardProps$1(pickedProps); const popperStyle = { "boxSizing": "border-box", "--reka-combobox-content-transform-origin": "var(--reka-popper-transform-origin)", "--reka-combobox-content-available-width": "var(--reka-popper-available-width)", "--reka-combobox-content-available-height": "var(--reka-popper-available-height)", "--reka-combobox-trigger-width": "var(--reka-popper-anchor-width)", "--reka-combobox-trigger-height": "var(--reka-popper-anchor-height)" }; provideComboboxContentContext({ position }); const isInputWithinContent = vue.ref(false); vue.onMounted(() => { if (rootContext.inputElement.value) { isInputWithinContent.value = currentElement.value.contains(rootContext.inputElement.value); if (props.present && isInputWithinContent.value) rootContext.inputElement.value.focus(); } }); vue.watch(() => props.present, async (isPresent, wasPresent) => { var _a2; if (isPresent || !wasPresent) return; const activeElement = getActiveElement(); if (!activeElement || !currentElement.value.contains(activeElement)) return; await vue.nextTick(); (_a2 = rootContext.triggerElement.value) == null ? void 0 : _a2.focus(); }); vue.onUnmounted(() => { var _a2; rootContext.onContentUnmount(contentId); const activeElement = getActiveElement(); if (isInputWithinContent.value && (!activeElement || activeElement === document.body)) (_a2 = rootContext.triggerElement.value) == null ? void 0 : _a2.focus(); }); function isEventTargetWithinCombobox(target) { var _a2, _b; if ((_a2 = rootContext.parentElement.value) == null ? void 0 : _a2.contains(target)) return true; const label = target instanceof Element ? target.closest("label") : null; const control = label == null ? void 0 : label.control; return !!control && !!((_b = rootContext.parentElement.value) == null ? void 0 : _b.contains(control)); } const popperContentEvents = { placed: () => rootContext.onContentPlaced(contentId) }; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(ListboxContent_default), { "as-child": "" }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(FocusScope_default), { "as-child": "", present: props.present, onMountAutoFocus: _cache[5] || (_cache[5] = vue.withModifiers(() => { }, ["prevent"])), onUnmountAutoFocus: _cache[6] || (_cache[6] = vue.withModifiers(() => { }, ["prevent"])) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(DismissableLayer_default), { "as-child": "", present: props.present, "disable-outside-pointer-events": __props.disableOutsidePointerEvents, onDismiss: _cache[0] || (_cache[0] = ($event) => vue.unref(rootContext).onOpenChange(false)), onFocusOutside: _cache[1] || (_cache[1] = (ev) => { if (isEventTargetWithinCombobox(ev.target)) ev.preventDefault(); emits("focusOutside", ev); }), onInteractOutside: _cache[2] || (_cache[2] = ($event) => emits("interactOutside", $event)), onEscapeKeyDown: _cache[3] || (_cache[3] = ($event) => emits("escapeKeyDown", $event)), onPointerDownOutside: _cache[4] || (_cache[4] = (ev) => { if (isEventTargetWithinCombobox(ev.target)) ev.preventDefault(); emits("pointerDownOutside", ev); }) }, { default: vue.withCtx(() => [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(position) === "popper" ? vue.unref(PopperContent_default) : vue.unref(Primitive)), vue.mergeProps({ ..._ctx.$attrs, ...vue.unref(forwardedProps) }, { id: vue.unref(rootContext).contentId, ref: vue.unref(forwardRef), "memo-dependencies": vue.unref(position) === "popper" ? [vue.unref(rootContext).filterSearch.value, vue.unref(rootContext).filterState.value] : void 0, "data-state": vue.unref(rootContext).open.value ? "open" : "closed", "data-empty": isEmpty2.value ? "" : void 0, style: { display: props.hideWhenEmpty && isEmpty2.value ? "none" : "flex", flexDirection: "column", outline: "none", ...vue.unref(position) === "popper" ? popperStyle : {} } }, vue.toHandlers(vue.unref(position) === "popper" ? popperContentEvents : {})), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "memo-dependencies", "data-state", "data-empty", "style" ]))]), _: 3 }, 8, ["present", "disable-outside-pointer-events"])]), _: 3 }, 8, ["present"])]), _: 3 }); }; } }); var ComboboxContentImpl_default = ComboboxContentImpl_vue_vue_type_script_setup_true_lang_default; var ComboboxArrow_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxArrow", props: { width: { type: Number, required: false, default: 10 }, height: { type: Number, required: false, default: 5 }, rounded: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "svg" } }, setup(__props) { const props = __props; const rootContext = injectComboboxRootContext(); const contentContext = injectComboboxContentContext(); useForwardExpose(); return (_ctx, _cache) => { return vue.unref(rootContext).open.value && vue.unref(contentContext).position.value === "popper" ? (vue.openBlock(), vue.createBlock(vue.unref(PopperArrow_default), vue.normalizeProps(vue.mergeProps({ key: 0 }, props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16)) : vue.createCommentVNode("v-if", true); }; } }); var ComboboxArrow_default = ComboboxArrow_vue_vue_type_script_setup_true_lang_default; var ComboboxCancel_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxCancel", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; useForwardExpose(); const rootContext = injectComboboxRootContext(); function handleClick() { var _a2; if (rootContext.inputElement.value) { rootContext.inputElement.value.value = ""; rootContext.inputElement.value.focus(); } if ((_a2 = rootContext.resetModelValueOnClear) == null ? void 0 : _a2.value) rootContext.modelValue.value = rootContext.multiple.value ? [] : null; rootContext.filterSearch.value = ""; } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps({ type: __props.as === "button" ? "button" : void 0 }, props, { tabindex: "-1", onClick: handleClick }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["type"]); }; } }); var ComboboxCancel_default = ComboboxCancel_vue_vue_type_script_setup_true_lang_default; var ComboboxContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxContent", props: { forceMount: { type: Boolean, required: false }, position: { type: String, required: false }, bodyLock: { type: Boolean, required: false }, hideWhenEmpty: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, dir: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardPropsEmits(props, emits); const { forwardRef } = useForwardExpose(); const rootContext = injectComboboxRootContext(); rootContext.contentId || (rootContext.contentId = useId(void 0, "reka-combobox-content")); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || vue.unref(rootContext).open.value, "force-mount": __props.forceMount || !vue.unref(rootContext).unmountOnHide.value }, { default: vue.withCtx(({ present }) => [vue.withDirectives(vue.createVNode(ComboboxContentImpl_default, vue.mergeProps({ ...vue.unref(forwarded), ..._ctx.$attrs }, { ref: vue.unref(forwardRef), present: vue.unref(rootContext).unmountOnHide.value || present }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["present"]), [[vue.vShow, vue.unref(rootContext).unmountOnHide.value || present]])]), _: 3 }, 8, ["present", "force-mount"]); }; } }); var ComboboxContent_default = ComboboxContent_vue_vue_type_script_setup_true_lang_default; var ComboboxEmpty_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxEmpty", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const rootContext = injectComboboxRootContext(); const isRender = vue.computed(() => rootContext.ignoreFilter.value ? rootContext.allItems.value.size === 0 : rootContext.filterState.value.count === 0); return (_ctx, _cache) => { return isRender.value ? (vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.normalizeProps(vue.mergeProps({ key: 0 }, props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = vue.createTextVNode("No options", -1))])]), _: 3 }, 16)) : vue.createCommentVNode("v-if", true); }; } }); var ComboboxEmpty_default = ComboboxEmpty_vue_vue_type_script_setup_true_lang_default; const [injectComboboxGroupContext, provideComboboxGroupContext] = createContext("ComboboxGroup"); var ComboboxGroup_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxGroup", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const id = useId(void 0, "reka-combobox-group"); const rootContext = injectComboboxRootContext(); const isRender = vue.computed(() => rootContext.ignoreFilter.value ? true : !rootContext.filterSearch.value ? true : rootContext.filterState.value.groups.has(id)); const context2 = provideComboboxGroupContext({ id, labelId: "" }); vue.onMounted(() => { if (!rootContext.allGroups.value.has(id)) rootContext.allGroups.value.set(id, new Set()); }); vue.onUnmounted(() => { rootContext.allGroups.value.delete(id); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(ListboxGroup_default), vue.mergeProps({ id: vue.unref(id), "aria-labelledby": vue.unref(context2).labelId }, props, { hidden: isRender.value ? void 0 : true }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "aria-labelledby", "hidden" ]); }; } }); var ComboboxGroup_default = ComboboxGroup_vue_vue_type_script_setup_true_lang_default; var ComboboxInput_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxInput", props: { displayValue: { type: Function, required: false }, modelValue: { type: String, required: false }, autoFocus: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "input" } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectComboboxRootContext(); const listboxContext = injectListboxRootContext(); const { primitiveElement, currentElement } = usePrimitiveElement(); const modelValue = useVModel(props, "modelValue", emits, { passive: props.modelValue === void 0 }); vue.onMounted(() => { if (currentElement.value) rootContext.onInputElementChange(currentElement.value); }); const { isComposing, shouldDeferInput, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposing((event) => { const el = event.target; if (el) processInputValue(el.value); }); function handleKeyDown(ev) { if (isComposing.value) return; ev.preventDefault(); if (!rootContext.open.value) rootContext.onOpenChange(true); } function processInputValue(value) { if (!rootContext.open.value) { rootContext.onOpenChange(true); vue.nextTick(() => { if (value) { rootContext.filterSearch.value = value; listboxContext.highlightFirstItem(); } }); } else rootContext.filterSearch.value = value; } function handleInput(event) { if (shouldDeferInput.value) return; processInputValue(event.target.value); } function handleFocus() { if (rootContext.openOnFocus.value && !rootContext.open.value) rootContext.onOpenChange(true); } function handleBlur(ev) { var _a2, _b; if (!rootContext.open.value) return; const nextFocus = ev.relatedTarget; if (!nextFocus) return; const isInsideRoot = (_a2 = rootContext.parentElement.value) == null ? void 0 : _a2.contains(nextFocus); const isInsideContent = (_b = document.getElementById(rootContext.contentId)) == null ? void 0 : _b.contains(nextFocus); if (!isInsideRoot && !isInsideContent) requestAnimationFrame(() => { var _a3, _b2; if (!rootContext.open.value) return; const active = document.activeElement; const isStillOutside = !((_a3 = rootContext.parentElement.value) == null ? void 0 : _a3.contains(active)) && !((_b2 = document.getElementById(rootContext.contentId)) == null ? void 0 : _b2.contains(active)); if (isStillOutside) rootContext.onOpenChange(false); }); } function handleClick() { if (rootContext.openOnClick.value && !rootContext.open.value) rootContext.onOpenChange(true); } function resetSearchTerm() { const rootModelValue = rootContext.modelValue.value; if (props.displayValue) modelValue.value = props.displayValue(rootModelValue); else if (!rootContext.multiple.value && rootModelValue && !Array.isArray(rootModelValue)) if (typeof rootModelValue !== "object") modelValue.value = rootModelValue.toString(); else modelValue.value = ""; else modelValue.value = ""; vue.nextTick(() => { modelValue.value = modelValue.value; }); } rootContext.onResetSearchTerm(() => { resetSearchTerm(); }); vue.watch(rootContext.modelValue, async () => { if (!rootContext.isUserInputted.value && rootContext.resetSearchTermOnSelect.value) resetSearchTerm(); }, { immediate: true, deep: true }); vue.watch(rootContext.filterState, (_newValue, oldValue) => { if (!rootContext.isVirtual.value && oldValue.count === 0) listboxContext.highlightFirstItem(); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(ListboxFilter_default), { ref_key: "primitiveElement", ref: primitiveElement, modelValue: vue.unref(modelValue), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null), as: __props.as, "as-child": __props.asChild, "auto-focus": __props.autoFocus, disabled: __props.disabled, "aria-expanded": vue.unref(rootContext).open.value, "aria-controls": vue.unref(rootContext).contentId, "aria-autocomplete": "list", role: "combobox", autocomplete: "off", onClick: handleClick, onInput: handleInput, onKeydown: vue.withKeys(handleKeyDown, ["down", "up"]), onFocus: handleFocus, onBlur: handleBlur, onCompositionstart: vue.unref(handleCompositionStart), onCompositionupdate: vue.unref(handleCompositionUpdate), onCompositionend: vue.unref(handleCompositionEnd) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "modelValue", "as", "as-child", "auto-focus", "disabled", "aria-expanded", "aria-controls", "onCompositionstart", "onCompositionupdate", "onCompositionend" ]); }; } }); var ComboboxInput_default = ComboboxInput_vue_vue_type_script_setup_true_lang_default; var ComboboxItem_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxItem", props: { textValue: { type: String, required: false }, value: { type: null, required: true }, disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["select"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const id = useId(void 0, "reka-combobox-item"); const rootContext = injectComboboxRootContext(); const groupContext = injectComboboxGroupContext(null); const { primitiveElement, currentElement } = usePrimitiveElement(); if (props.value === "") throw new Error("A must have a value prop that is not an empty string. This is because the Combobox value can be set to an empty string to clear the selection and show the placeholder."); const isRender = vue.computed(() => { if (rootContext.isVirtual.value || rootContext.ignoreFilter.value || !rootContext.filterSearch.value) return true; else { const filteredCurrentItem = rootContext.filterState.value.items.get(id); if (filteredCurrentItem === void 0) return true; return filteredCurrentItem > 0; } }); vue.onMounted(() => { var _a2; rootContext.allItems.value.set(id, props.textValue || currentElement.value.textContent || currentElement.value.innerText); const groupId = groupContext == null ? void 0 : groupContext.id; if (groupId) if (!rootContext.allGroups.value.has(groupId)) rootContext.allGroups.value.set(groupId, new Set([id])); else (_a2 = rootContext.allGroups.value.get(groupId)) == null ? void 0 : _a2.add(id); }); vue.onUnmounted(() => { rootContext.allItems.value.delete(id); }); return (_ctx, _cache) => { return isRender.value ? vue.withMemo([ isRender.value, vue.unref(rootContext).filterSearch.value, vue.unref(rootContext).disabled.value, __props.disabled, props.value, props.as, props.asChild, ...Object.values(_ctx.$attrs) ], () => (vue.openBlock(), vue.createBlock(vue.unref(ListboxItem_default), vue.mergeProps({ key: 0 }, props, { id: vue.unref(id), ref_key: "primitiveElement", ref: primitiveElement, disabled: vue.unref(rootContext).disabled.value || __props.disabled, onSelect: _cache[0] || (_cache[0] = (event) => { var _a2; emits("select", event); if (event.defaultPrevented) return; if (!vue.unref(rootContext).multiple.value && !__props.disabled && !vue.unref(rootContext).disabled.value) { event.preventDefault(); vue.unref(rootContext).onOpenChange(false); vue.unref(rootContext).modelValue.value = props.value; } else if (vue.unref(rootContext).multiple.value) (_a2 = vue.unref(rootContext).inputElement.value) == null ? void 0 : _a2.focus(); }) }), { default: vue.withCtx((slotProps) => [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(slotProps)), () => [vue.createTextVNode(vue.toDisplayString(__props.value), 1)])]), _: 3 }, 16, ["id", "disabled"])), _cache, 1) : vue.createCommentVNode("v-if", true); }; } }); var ComboboxItem_default = ComboboxItem_vue_vue_type_script_setup_true_lang_default; var ComboboxItemIndicator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxItemIndicator", props: { forceMount: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "span" } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(ListboxItemIndicator_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var ComboboxItemIndicator_default = ComboboxItemIndicator_vue_vue_type_script_setup_true_lang_default; var ComboboxLabel_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxLabel", props: { for: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "div" } }, setup(__props) { const props = __props; useForwardExpose(); const groupContext = injectComboboxGroupContext({ id: "", labelId: "" }); groupContext.labelId || (groupContext.labelId = useId(void 0, "reka-combobox-group-label")); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { id: vue.unref(groupContext).labelId }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["id"]); }; } }); var ComboboxLabel_default = ComboboxLabel_vue_vue_type_script_setup_true_lang_default; var ComboboxPortal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxPortal", props: { to: { type: null, required: false }, disabled: { type: Boolean, required: false }, defer: { type: Boolean, required: false }, forceMount: { type: Boolean, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Teleport_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var ComboboxPortal_default = ComboboxPortal_vue_vue_type_script_setup_true_lang_default; var ComboboxSeparator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxSeparator", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { "aria-hidden": "true" }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var ComboboxSeparator_default = ComboboxSeparator_vue_vue_type_script_setup_true_lang_default; var ComboboxTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxTrigger", props: { disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; const { forwardRef, currentElement } = useForwardExpose(); const rootContext = injectComboboxRootContext(); const disabled = vue.computed(() => props.disabled || rootContext.disabled.value || false); vue.onMounted(() => { if (currentElement.value) rootContext.onTriggerElementChange(currentElement.value); }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { ref: vue.unref(forwardRef), type: __props.as === "button" ? "button" : void 0, tabindex: "-1", "aria-label": "Show popup", "aria-haspopup": "listbox", "aria-expanded": vue.unref(rootContext).open.value, "aria-controls": vue.unref(rootContext).contentId, "data-state": vue.unref(rootContext).open.value ? "open" : "closed", disabled: disabled.value, "data-disabled": disabled.value ? "" : void 0, "aria-disabled": (_a2 = disabled.value) != null ? _a2 : void 0, onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(rootContext).onOpenChange(!vue.unref(rootContext).open.value)) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "type", "aria-expanded", "aria-controls", "data-state", "disabled", "data-disabled", "aria-disabled" ]); }; } }); var ComboboxTrigger_default = ComboboxTrigger_vue_vue_type_script_setup_true_lang_default; var ComboboxVirtualizer_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ComboboxVirtualizer", props: { options: { type: Array, required: true }, overscan: { type: Number, required: false }, estimateSize: { type: [Number, Function], required: false }, textContent: { type: Function, required: false } }, setup(__props) { const props = __props; const rootContext = injectComboboxRootContext(); rootContext.isVirtual.value = true; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(ListboxVirtualizer_default, vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx((slotProps) => [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(slotProps)))]), _: 3 }, 16); }; } }); var ComboboxVirtualizer_default = ComboboxVirtualizer_vue_vue_type_script_setup_true_lang_default; const DATE_SEGMENT_PARTS = [ "day", "month", "year" ]; const TIME_SEGMENT_PARTS = [ "hour", "minute", "second", "dayPeriod" ]; const EDITABLE_SEGMENT_PARTS = [...DATE_SEGMENT_PARTS, ...TIME_SEGMENT_PARTS]; function isDateSegmentPart(part) { return DATE_SEGMENT_PARTS.includes(part); } function isSegmentPart(part) { return EDITABLE_SEGMENT_PARTS.includes(part); } const supportedLocales = [ "ach", "af", "am", "an", "ar", "ast", "az", "be", "bg", "bn", "br", "bs", "ca", "cak", "ckb", "cs", "cy", "da", "de", "dsb", "el", "en", "eo", "es", "et", "eu", "fa", "ff", "fi", "fr", "fy", "ga", "gd", "gl", "he", "hr", "hsb", "hu", "ia", "id", "it", "ja", "ka", "kk", "kn", "ko", "lb", "lo", "lt", "lv", "meh", "ml", "ms", "nl", "nn", "no", "oc", "pl", "pt", "rm", "ro", "ru", "sc", "scn", "sk", "sl", "sr", "sv", "szl", "tg", "th", "tr", "uk", "zh-CN", "zh-TW" ]; const placeholderFields = [ "year", "month", "day" ]; const placeholders = { "ach": { year: "mwaka", month: "dwe", day: "nino" }, "af": { year: "jjjj", month: "mm", day: "dd" }, "am": { year: "ዓዓዓዓ", month: "ሚሜ", day: "ቀቀ" }, "an": { year: "aaaa", month: "mm", day: "dd" }, "ar": { year: "سنة", month: "شهر", day: "يوم" }, "ast": { year: "aaaa", month: "mm", day: "dd" }, "az": { year: "iiii", month: "aa", day: "gg" }, "be": { year: "гггг", month: "мм", day: "дд" }, "bg": { year: "гггг", month: "мм", day: "дд" }, "bn": { year: "yyyy", month: "মিমি", day: "dd" }, "br": { year: "bbbb", month: "mm", day: "dd" }, "bs": { year: "gggg", month: "mm", day: "dd" }, "ca": { year: "aaaa", month: "mm", day: "dd" }, "cak": { year: "jjjj", month: "ii", day: "q'q'" }, "ckb": { year: "ساڵ", month: "مانگ", day: "ڕۆژ" }, "cs": { year: "rrrr", month: "mm", day: "dd" }, "cy": { year: "bbbb", month: "mm", day: "dd" }, "da": { year: "åååå", month: "mm", day: "dd" }, "de": { year: "jjjj", month: "mm", day: "tt" }, "dsb": { year: "llll", month: "mm", day: "źź" }, "el": { year: "εεεε", month: "μμ", day: "ηη" }, "en": { year: "yyyy", month: "mm", day: "dd" }, "eo": { year: "jjjj", month: "mm", day: "tt" }, "es": { year: "aaaa", month: "mm", day: "dd" }, "et": { year: "aaaa", month: "kk", day: "pp" }, "eu": { year: "uuuu", month: "hh", day: "ee" }, "fa": { year: "سال", month: "ماه", day: "روز" }, "ff": { year: "hhhh", month: "ll", day: "ññ" }, "fi": { year: "vvvv", month: "kk", day: "pp" }, "fr": { year: "aaaa", month: "mm", day: "jj" }, "fy": { year: "jjjj", month: "mm", day: "dd" }, "ga": { year: "bbbb", month: "mm", day: "ll" }, "gd": { year: "bbbb", month: "mm", day: "ll" }, "gl": { year: "aaaa", month: "mm", day: "dd" }, "he": { year: "שנה", month: "חודש", day: "יום" }, "hr": { year: "gggg", month: "mm", day: "dd" }, "hsb": { year: "llll", month: "mm", day: "dd" }, "hu": { year: "éééé", month: "hh", day: "nn" }, "ia": { year: "aaaa", month: "mm", day: "dd" }, "id": { year: "tttt", month: "bb", day: "hh" }, "it": { year: "aaaa", month: "mm", day: "gg" }, "ja": { year: " 年 ", month: "月", day: "日" }, "ka": { year: "წწწწ", month: "თთ", day: "რრ" }, "kk": { year: "жжжж", month: "аа", day: "кк" }, "kn": { year: "ವವವವ", month: "ಮಿಮೀ", day: "ದಿದಿ" }, "ko": { year: "연도", month: "월", day: "일" }, "lb": { year: "jjjj", month: "mm", day: "dd" }, "lo": { year: "ປປປປ", month: "ດດ", day: "ວວ" }, "lt": { year: "mmmm", month: "mm", day: "dd" }, "lv": { year: "gggg", month: "mm", day: "dd" }, "meh": { year: "aaaa", month: "mm", day: "dd" }, "ml": { year: "വർഷം", month: "മാസം", day: "തീയതി" }, "ms": { year: "tttt", month: "mm", day: "hh" }, "nl": { year: "jjjj", month: "mm", day: "dd" }, "nn": { year: "åååå", month: "mm", day: "dd" }, "no": { year: "åååå", month: "mm", day: "dd" }, "oc": { year: "aaaa", month: "mm", day: "jj" }, "pl": { year: "rrrr", month: "mm", day: "dd" }, "pt": { year: "aaaa", month: "mm", day: "dd" }, "rm": { year: "oooo", month: "mm", day: "dd" }, "ro": { year: "aaaa", month: "ll", day: "zz" }, "ru": { year: "гггг", month: "мм", day: "дд" }, "sc": { year: "aaaa", month: "mm", day: "dd" }, "scn": { year: "aaaa", month: "mm", day: "jj" }, "sk": { year: "rrrr", month: "mm", day: "dd" }, "sl": { year: "llll", month: "mm", day: "dd" }, "sr": { year: "гггг", month: "мм", day: "дд" }, "sv": { year: "åååå", month: "mm", day: "dd" }, "szl": { year: "rrrr", month: "mm", day: "dd" }, "tg": { year: "сссс", month: "мм", day: "рр" }, "th": { year: "ปปปป", month: "ดด", day: "วว" }, "tr": { year: "yyyy", month: "aa", day: "gg" }, "uk": { year: "рррр", month: "мм", day: "дд" }, "zh-CN": { year: "年", month: "月", day: "日" }, "zh-TW": { year: "年", month: "月", day: "日" } }; function getPlaceholderObj(locale) { if (!isSupportedLocale(locale)) { const localeLanguage = getLocaleLanguage(locale); if (!isSupportedLocale(localeLanguage)) return placeholders.en; else return placeholders[localeLanguage]; } else return placeholders[locale]; } function getPlaceholder(field, value, locale) { if (isPlaceholderField(field)) return getPlaceholderObj(locale)[field]; if (isDefaultField(field)) return value; if (isTimeField(field)) return "––"; return ""; } function isSupportedLocale(locale) { return supportedLocales.includes(locale); } function isPlaceholderField(field) { return placeholderFields.includes(field); } function isTimeField(field) { return field === "hour" || field === "minute" || field === "second"; } function isDefaultField(field) { return field === "era" || field === "dayPeriod"; } function getLocaleLanguage(locale) { if (Intl.Locale) return new Intl.Locale(locale).language; return locale.split("-")[0]; } function syncTimeSegmentValues(props) { return Object.fromEntries(TIME_SEGMENT_PARTS.map((part) => { if (part === "dayPeriod") { const timeZone = isZonedDateTime(props.value) ? props.value.timeZone : void 0; return [part, props.formatter.dayPeriod(toDate(props.value), timeZone)]; } return [part, props.value[part]]; })); } function syncSegmentValues(props) { const { formatter } = props; const dateValues = DATE_SEGMENT_PARTS.map((part) => { return [part, props.value[part]]; }); if ("hour" in props.value) { const timeValues = syncTimeSegmentValues({ value: props.value, formatter }); return { ...Object.fromEntries(dateValues), ...timeValues }; } return Object.fromEntries(dateValues); } function initializeTimeSegmentValues(granularity) { return Object.fromEntries(TIME_SEGMENT_PARTS.map((part) => { if (part === "dayPeriod") return [part, "AM"]; return [part, null]; }).filter(([key]) => { if (key === "literal" || key === null) return false; if (granularity === "minute" && key === "second") return false; if (granularity === "hour" && (key === "second" || key === "minute")) return false; else return true; })); } function createContentObj(props) { const { segmentValues, formatter, locale } = props; function getPartContent(part) { var _a2, _b; if ("hour" in segmentValues) { const value = segmentValues[part]; if (value !== null) { if (part === "day") return formatter.part(props.dateRef.set({ [part]: value, month: (_a2 = segmentValues.month) != null ? _a2 : 1 }), part, { hourCycle: normalizeHourCycle(props.hourCycle) }); return formatter.part(props.dateRef.set({ [part]: value }), part, { hourCycle: normalizeHourCycle(props.hourCycle) }); } else return getPlaceholder(part, "", locale.value); } else { if (isDateSegmentPart(part)) { const value = segmentValues[part]; if (value !== null) { if (part === "day") return formatter.part(props.dateRef.set({ [part]: value, month: (_b = segmentValues.month) != null ? _b : 1 }), part); return formatter.part(props.dateRef.set({ [part]: value }), part); } else return getPlaceholder(part, "", locale.value); } return ""; } } const content = Object.keys(segmentValues).reduce((obj, part) => { if (!isSegmentPart(part)) return obj; if ("hour" in segmentValues && part === "dayPeriod") { const value = segmentValues[part]; if (value !== null) obj[part] = value; else obj[part] = getPlaceholder(part, "AM", locale.value); } else obj[part] = getPartContent(part); return obj; }, {}); return content; } function createContentArr(props) { const { granularity, formatter, contentObj, hideTimeZone, hourCycle, isTimeValue } = props; const parts = formatter.toParts(props.dateRef, getOptsByGranularity(granularity, hourCycle, isTimeValue)); const segmentContentArr = parts.map((part) => { const defaultParts = [ "literal", "timeZoneName", null ]; if (defaultParts.includes(part.type) || !isSegmentPart(part.type)) return { part: part.type, value: part.value }; return { part: part.type, value: contentObj[part.type] }; }).filter((segment) => { if (segment.part === null || segment.value === null) return false; if (segment.part === "timeZoneName" && (!isZonedDateTime(props.dateRef) || hideTimeZone)) return false; if ((!isZonedDateTime(props.dateRef) || hideTimeZone) && segment.part === "literal" && ["[", "]"].includes(segment.value.trim())) return false; return true; }); return segmentContentArr; } function createContent(props) { const contentObj = createContentObj(props); const contentArr = createContentArr({ contentObj, ...props }); return { obj: contentObj, arr: contentArr }; } function isSegmentNavigationKey(key) { const kbd = useKbd(); if (key === kbd.ARROW_RIGHT || key === kbd.ARROW_LEFT) return true; return false; } function isNumberString(value) { if (Number.isNaN(Number.parseInt(value))) return false; return true; } function isAcceptableSegmentKey(key) { const kbd = useKbd(); const acceptableSegmentKeys = [ kbd.ENTER, kbd.ARROW_UP, kbd.ARROW_DOWN, kbd.ARROW_LEFT, kbd.ARROW_RIGHT, kbd.BACKSPACE, kbd.SPACE, "a", "A", "p", "P" ]; if (acceptableSegmentKeys.includes(key)) return true; if (isNumberString(key)) return true; return false; } function getTimeFieldSegmentElements(parentElement) { return Array.from(parentElement.querySelectorAll("[data-reka-time-field-segment]")).filter((item) => item.getAttribute("data-reka-time-field-segment") !== "literal"); } const DIGIT_REG = /^\d$/; function commonSegmentAttrs(props) { return { role: "spinbutton", contenteditable: true, tabindex: props.disabled ? void 0 : 0, spellcheck: false, inputmode: "numeric", autocorrect: "off", enterkeyhint: "next", style: "caret-color: transparent;" }; } function daySegmentAttrs(props) { const { segmentValues, placeholder } = props; const isEmpty2 = segmentValues.day === null; const dateFields = {}; if (segmentValues.day) dateFields.day = segmentValues.day; if (segmentValues.month) dateFields.month = segmentValues.month; const date = Object.keys(dateFields).length > 0 ? placeholder.set(dateFields) : placeholder; const valueNow = date.day; const valueMin = 1; const valueMax = getDaysInMonth(date); const valueText = isEmpty2 ? "Empty" : `${valueNow}`; return { ...commonSegmentAttrs(props), "aria-label": "day,", "aria-valuemin": valueMin, "aria-valuemax": valueMax, "aria-valuenow": valueNow, "aria-valuetext": valueText, "data-placeholder": isEmpty2 ? "" : void 0 }; } function monthSegmentAttrs(props) { const { segmentValues, placeholder, formatter } = props; const isEmpty2 = segmentValues.month === null; const date = segmentValues.month ? placeholder.set({ month: segmentValues.month }) : placeholder; const valueNow = date.month; const valueMin = 1; const valueMax = 12; const valueText = isEmpty2 ? "Empty" : `${valueNow} - ${formatter.fullMonth(toDate(date))}`; return { ...commonSegmentAttrs(props), "aria-label": "month, ", "contenteditable": true, "aria-valuemin": valueMin, "aria-valuemax": valueMax, "aria-valuenow": valueNow, "aria-valuetext": valueText, "data-placeholder": isEmpty2 ? "" : void 0 }; } function yearSegmentAttrs(props) { const { segmentValues, placeholder } = props; const isEmpty2 = segmentValues.year === null; const date = segmentValues.year ? placeholder.set({ year: segmentValues.year }) : placeholder; const valueMin = 1; const valueMax = 9999; const valueNow = date.year; const valueText = isEmpty2 ? "Empty" : `${valueNow}`; return { ...commonSegmentAttrs(props), "aria-label": "year, ", "aria-valuemin": valueMin, "aria-valuemax": valueMax, "aria-valuenow": valueNow, "aria-valuetext": valueText, "data-placeholder": isEmpty2 ? "" : void 0 }; } function hourSegmentAttrs(props) { var _a2; const { segmentValues, hourCycle, placeholder } = props; if (!("hour" in segmentValues) || !("hour" in placeholder)) return {}; const isEmpty2 = segmentValues.hour === null; const date = segmentValues.hour ? placeholder.set({ hour: segmentValues.hour }) : placeholder; const valueMin = hourCycle === 12 ? 1 : 0; const valueMax = hourCycle === 12 ? 12 : 23; const valueNow = date.hour; const valueText = isEmpty2 ? "Empty" : `${valueNow} ${(_a2 = segmentValues.dayPeriod) != null ? _a2 : ""}`; return { ...commonSegmentAttrs(props), "aria-label": "hour, ", "aria-valuemin": valueMin, "aria-valuemax": valueMax, "aria-valuenow": valueNow, "aria-valuetext": valueText, "data-placeholder": isEmpty2 ? "" : void 0 }; } function minuteSegmentAttrs(props) { const { segmentValues, placeholder } = props; if (!("minute" in segmentValues) || !("minute" in placeholder)) return {}; const isEmpty2 = segmentValues.minute === null; const date = segmentValues.minute ? placeholder.set({ minute: segmentValues.minute }) : placeholder; const valueNow = date.minute; const valueMin = 0; const valueMax = 59; const valueText = isEmpty2 ? "Empty" : `${valueNow}`; return { ...commonSegmentAttrs(props), "aria-label": "minute, ", "aria-valuemin": valueMin, "aria-valuemax": valueMax, "aria-valuenow": valueNow, "aria-valuetext": valueText, "data-placeholder": isEmpty2 ? "" : void 0 }; } function secondSegmentAttrs(props) { const { segmentValues, placeholder } = props; if (!("second" in segmentValues) || !("second" in placeholder)) return {}; const isEmpty2 = segmentValues.second === null; const date = segmentValues.second ? placeholder.set({ second: segmentValues.second }) : placeholder; const valueNow = date.second; const valueMin = 0; const valueMax = 59; const valueText = isEmpty2 ? "Empty" : `${valueNow}`; return { ...commonSegmentAttrs(props), "aria-label": "second, ", "aria-valuemin": valueMin, "aria-valuemax": valueMax, "aria-valuenow": valueNow, "aria-valuetext": valueText, "data-placeholder": isEmpty2 ? "" : void 0 }; } function dayPeriodSegmentAttrs(props) { var _a2; const { segmentValues } = props; if (!("dayPeriod" in segmentValues)) return {}; const valueMin = 0; const valueMax = 12; const valueNow = segmentValues.hour ? segmentValues.hour > 12 ? segmentValues.hour - 12 : segmentValues.hour : 0; const valueText = (_a2 = segmentValues.dayPeriod) != null ? _a2 : "AM"; return { ...commonSegmentAttrs(props), "inputmode": "text", "aria-label": "AM/PM", "aria-valuemin": valueMin, "aria-valuemax": valueMax, "aria-valuenow": valueNow, "aria-valuetext": valueText }; } function literalSegmentAttrs(_props) { return { "aria-hidden": true, "data-segment": "literal" }; } function timeZoneSegmentAttrs(props) { return { "role": "textbox", "aria-label": "timezone, ", "data-readonly": true, "data-segment": "timeZoneName", "tabindex": props.disabled ? void 0 : 0, "style": "caret-color: transparent;" }; } function eraSegmentAttrs(props) { const { segmentValues, placeholder } = props; const valueMin = 0; const valueMax = 0; const valueNow = 0; const valueText = "era" in segmentValues ? segmentValues.era : placeholder.era; return { ...commonSegmentAttrs(props), "aria-label": "era", "aria-valuemin": valueMin, "aria-valuemax": valueMax, "aria-valuenow": valueNow, "aria-valuetext": valueText }; } const segmentBuilders = { day: { attrs: daySegmentAttrs }, month: { attrs: monthSegmentAttrs }, year: { attrs: yearSegmentAttrs }, hour: { attrs: hourSegmentAttrs }, minute: { attrs: minuteSegmentAttrs }, second: { attrs: secondSegmentAttrs }, dayPeriod: { attrs: dayPeriodSegmentAttrs }, literal: { attrs: literalSegmentAttrs }, timeZoneName: { attrs: timeZoneSegmentAttrs }, era: { attrs: eraSegmentAttrs } }; function useDateField(props) { const kbd = useKbd(); function minuteSecondIncrementation({ e, part, dateRef, prevValue }) { var _a2; const step = (_a2 = props.step.value[part]) != null ? _a2 : 1; const sign = e.key === kbd.ARROW_UP ? step : -step; const min2 = 0; const max2 = 59; if (prevValue === null) return sign > 0 ? min2 : max2; const cycleArgs = [part, sign]; return dateRef.set({ [part]: prevValue }).cycle(...cycleArgs)[part]; } function deleteValue(prevValue) { props.hasLeftFocus.value = false; if (prevValue === null) return prevValue; const str2 = prevValue.toString(); if (str2.length === 1) { props.modelValue.value = void 0; return null; } return Number.parseInt(str2.slice(0, -1)); } function dateTimeValueIncrementation({ e, part, dateRef, prevValue }) { var _a2, _b; const step = (_a2 = props.step.value[part]) != null ? _a2 : 1; const sign = e.key === kbd.ARROW_UP ? step : -step; if (prevValue === null) return dateRef[part]; if (part === "hour" && "hour" in dateRef) { const cycleArgs$1 = [part, sign]; return dateRef.set({ [part]: prevValue }).cycle(...cycleArgs$1)[part]; } const cycleArgs = [part, sign]; if (part === "day") return dateRef.set({ [part]: prevValue, month: (_b = props.segmentValues.value.month) != null ? _b : 1 }).cycle(...cycleArgs)[part]; return dateRef.set({ [part]: prevValue }).cycle(...cycleArgs)[part]; } function updateDayOrMonth(max2, num2, prev) { let moveToNext = false; const maxStart = Math.floor(max2 / 10); if (props.hasLeftFocus.value) { props.hasLeftFocus.value = false; props.lastKeyZero.value = false; prev = null; } if (prev === null) { if (num2 === 0) { props.lastKeyZero.value = true; return { value: null, moveToNext }; } if (props.lastKeyZero.value || num2 > maxStart) moveToNext = true; props.lastKeyZero.value = false; return { value: num2, moveToNext }; } const digits = prev.toString().length; const total = Number.parseInt(prev.toString() + num2.toString()); if (digits === 2 || total > max2) { if (num2 > maxStart || total > max2) moveToNext = true; return { value: num2, moveToNext }; } moveToNext = true; return { value: total, moveToNext }; } function updateMinuteOrSecond(num2, prev) { const max2 = 59; let moveToNext = false; const maxStart = Math.floor(max2 / 10); if (props.hasLeftFocus.value) { props.hasLeftFocus.value = false; props.lastKeyZero.value = false; prev = null; } if (prev === null) { if (num2 === 0) { props.lastKeyZero.value = true; return { value: 0, moveToNext }; } if (props.lastKeyZero.value || num2 > maxStart) moveToNext = true; props.lastKeyZero.value = false; return { value: num2, moveToNext }; } const digits = prev.toString().length; const total = Number.parseInt(prev.toString() + num2.toString()); if (digits === 2 || total > max2) { if (num2 > maxStart) moveToNext = true; return { value: num2, moveToNext }; } moveToNext = true; return { value: total, moveToNext }; } function updateHour(max2, num2, prev) { let moveToNext = false; const maxStart = Math.floor(max2 / 10); if (props.hasLeftFocus.value) { props.hasLeftFocus.value = false; props.lastKeyZero.value = false; prev = null; } if (prev === null) { if (num2 === 0) { props.lastKeyZero.value = true; return { value: 0, moveToNext }; } if (props.lastKeyZero.value || num2 > maxStart) moveToNext = true; props.lastKeyZero.value = false; return { value: num2, moveToNext }; } const digits = prev.toString().length; const total = Number.parseInt(prev.toString() + num2.toString()); if (digits === 2 || total > max2) { if (num2 > maxStart) moveToNext = true; return { value: num2, moveToNext }; } moveToNext = true; return { value: total, moveToNext }; } function updateYear(num2, prev) { let moveToNext = false; if (props.hasLeftFocus.value) { props.hasLeftFocus.value = false; prev = null; } if (prev === null) return { value: num2 === 0 ? 1 : num2, moveToNext }; const str2 = prev.toString() + num2.toString(); if (str2.length > 4) return { value: num2 === 0 ? 1 : num2, moveToNext }; if (str2.length === 4) moveToNext = true; const int = Number.parseInt(str2); return { value: int, moveToNext }; } const attributes = vue.computed(() => { var _a2, _b; return (_b = (_a2 = segmentBuilders[props.part]) == null ? void 0 : _a2.attrs({ disabled: props.disabled.value, placeholder: props.placeholder.value, hourCycle: props.hourCycle, segmentValues: props.segmentValues.value, formatter: props.formatter })) != null ? _b : {}; }); function handleDaySegmentKeydown(e) { if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return; const prevValue = props.segmentValues.value.day; if (e.key === kbd.ARROW_DOWN || e.key === kbd.ARROW_UP) { props.segmentValues.value.day = dateTimeValueIncrementation({ e, part: "day", dateRef: props.placeholder.value, prevValue }); return; } if (isNumberString(e.key)) { const num2 = Number.parseInt(e.key); const segmentMonthValue = props.segmentValues.value.month; const daysInMonth = segmentMonthValue ? getDaysInMonth(props.placeholder.value.set({ month: segmentMonthValue })) : 31; const { value, moveToNext } = updateDayOrMonth(daysInMonth, num2, prevValue); props.segmentValues.value.day = value; if (moveToNext) props.focusNext(); } if (e.key === kbd.BACKSPACE) { props.hasLeftFocus.value = false; props.segmentValues.value.day = deleteValue(prevValue); } } function handleMonthSegmentKeydown(e) { if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return; const prevValue = props.segmentValues.value.month; if (e.key === kbd.ARROW_DOWN || e.key === kbd.ARROW_UP) { props.segmentValues.value.month = dateTimeValueIncrementation({ e, part: "month", dateRef: props.placeholder.value, prevValue }); return; } if (isNumberString(e.key)) { const num2 = Number.parseInt(e.key); const { value, moveToNext } = updateDayOrMonth(12, num2, prevValue); props.segmentValues.value.month = value; if (moveToNext) props.focusNext(); } if (e.key === kbd.BACKSPACE) { props.hasLeftFocus.value = false; props.segmentValues.value.month = deleteValue(prevValue); } } function handleYearSegmentKeydown(e) { if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return; const prevValue = props.segmentValues.value.year; if (e.key === kbd.ARROW_DOWN || e.key === kbd.ARROW_UP) { props.segmentValues.value.year = dateTimeValueIncrementation({ e, part: "year", dateRef: props.placeholder.value, prevValue }); return; } if (isNumberString(e.key)) { const num2 = Number.parseInt(e.key); const { value, moveToNext } = updateYear(num2, prevValue); props.segmentValues.value.year = value; if (moveToNext) props.focusNext(); } if (e.key === kbd.BACKSPACE) { props.hasLeftFocus.value = false; props.segmentValues.value.year = deleteValue(prevValue); } } function uses12HourFormat(locale) { const hourCycle = new $12a3c853105e5a70$export$ad991b66133851cf(locale, { hour: "numeric" }).resolvedOptions().hourCycle; return hourCycle === "h11" || hourCycle === "h12"; } function handleHourSegmentKeydown(e) { const dateRef = props.placeholder.value; if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key) || !("hour" in dateRef) || !("hour" in props.segmentValues.value)) return; const prevValue = props.segmentValues.value.hour; if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) { const newHour = dateTimeValueIncrementation({ e, part: "hour", dateRef: props.placeholder.value, prevValue }); props.segmentValues.value.hour = newHour; if ("dayPeriod" in props.segmentValues.value && newHour !== null) props.segmentValues.value.dayPeriod = newHour >= 12 ? "PM" : "AM"; return; } if (isNumberString(e.key)) { const num2 = Number.parseInt(e.key); const is12Hour = props.hourCycle !== void 0 ? props.hourCycle === 12 : uses12HourFormat(props.formatter.getLocale()); const max2 = is12Hour ? 12 : 24; let displayPrev = prevValue; if (is12Hour && prevValue !== null) displayPrev = prevValue % 12 === 0 ? 0 : prevValue > 12 ? prevValue - 12 : prevValue; const { value, moveToNext } = updateHour(max2, num2, displayPrev); let internalValue = value; if (is12Hour && value !== null) { const period = props.segmentValues.value.dayPeriod || "AM"; if (value === 12) internalValue = period === "AM" ? 0 : 12; else internalValue = period === "PM" ? value + 12 : value; } props.segmentValues.value.hour = internalValue; if (moveToNext) props.focusNext(); } if (e.key === kbd.BACKSPACE) { props.hasLeftFocus.value = false; props.segmentValues.value.hour = deleteValue(prevValue); } } function handleMinuteSegmentKeydown(e) { const dateRef = props.placeholder.value; if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key) || !("minute" in dateRef) || !("minute" in props.segmentValues.value)) return; const prevValue = props.segmentValues.value.minute; if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) props.segmentValues.value.minute = minuteSecondIncrementation({ e, part: "minute", dateRef: props.placeholder.value, prevValue }); if (isNumberString(e.key)) { const num2 = Number.parseInt(e.key); const { value, moveToNext } = updateMinuteOrSecond(num2, prevValue); props.segmentValues.value.minute = value; if (moveToNext) props.focusNext(); } if (e.key === kbd.BACKSPACE) { props.hasLeftFocus.value = false; props.segmentValues.value.minute = deleteValue(prevValue); } } function handleSecondSegmentKeydown(e) { const dateRef = props.placeholder.value; if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key) || !("second" in dateRef) || !("second" in props.segmentValues.value)) return; const prevValue = props.segmentValues.value.second; if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) props.segmentValues.value.second = minuteSecondIncrementation({ e, part: "second", dateRef: props.placeholder.value, prevValue }); if (isNumberString(e.key)) { const num2 = Number.parseInt(e.key); const { value, moveToNext } = updateMinuteOrSecond(num2, prevValue); props.segmentValues.value.second = value; if (moveToNext) props.focusNext(); } if (e.key === kbd.BACKSPACE) { props.hasLeftFocus.value = false; props.segmentValues.value.second = deleteValue(prevValue); } } function handleDayPeriodSegmentKeydown(e) { if ((!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) && e.key !== "a" && e.key !== "p" || !("hour" in props.placeholder.value) || !("dayPeriod" in props.segmentValues.value)) return; if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) { if (props.segmentValues.value.dayPeriod === "AM") { props.segmentValues.value.dayPeriod = "PM"; props.segmentValues.value.hour = props.segmentValues.value.hour + 12; return; } props.segmentValues.value.dayPeriod = "AM"; props.segmentValues.value.hour = props.segmentValues.value.hour - 12; return; } if (["a", "A"].includes(e.key) && props.segmentValues.value.dayPeriod !== "AM") { props.segmentValues.value.dayPeriod = "AM"; props.segmentValues.value.hour = props.segmentValues.value.hour - 12; return; } if (["p", "P"].includes(e.key) && props.segmentValues.value.dayPeriod !== "PM") { props.segmentValues.value.dayPeriod = "PM"; props.segmentValues.value.hour = props.segmentValues.value.hour + 12; } } function handleSegmentClick(e) { const disabled = props.disabled.value; if (disabled) e.preventDefault(); } function handleSegmentKeydown(e) { if (e.isComposing || e.key === "Process") return; const disabled = props.disabled.value; const readonly2 = props.readonly.value; if (disabled || readonly2) return; if (e.key !== kbd.TAB) e.preventDefault(); const segmentKeydownHandlers = { day: handleDaySegmentKeydown, month: handleMonthSegmentKeydown, year: handleYearSegmentKeydown, hour: handleHourSegmentKeydown, minute: handleMinuteSegmentKeydown, second: handleSecondSegmentKeydown, dayPeriod: handleDayPeriodSegmentKeydown, timeZoneName: () => { } }; segmentKeydownHandlers[props.part](e); if (![kbd.ARROW_LEFT, kbd.ARROW_RIGHT].includes(e.key) && e.key !== kbd.TAB && e.key !== kbd.SHIFT && isAcceptableSegmentKey(e.key)) { if (Object.values(props.segmentValues.value).every((item) => item !== null)) { const updateObject = { ...props.segmentValues.value }; const dateRef = props.placeholder.value.set(updateObject); props.modelValue.value = dateRef.copy(); } } } function handleSegmentFocusOut() { var _a2; if (!((_a2 = props.stepSnapping) == null ? void 0 : _a2.value)) return; if (props.part === "hour" && "hour" in props.segmentValues.value && props.segmentValues.value.hour !== null && props.step.value.hour && props.step.value.hour > 1) { props.segmentValues.value.hour = snapValueToStep(props.segmentValues.value.hour, 0, 23, props.step.value.hour); if ("dayPeriod" in props.segmentValues.value) { if (props.segmentValues.value.hour < 12) props.segmentValues.value.dayPeriod = "AM"; else if (props.segmentValues.value.hour) props.segmentValues.value.dayPeriod = "PM"; } } else if (props.part === "minute" && "minute" in props.segmentValues.value && props.segmentValues.value.minute !== null && props.step.value.minute && props.step.value.minute > 1) props.segmentValues.value.minute = snapValueToStep(props.segmentValues.value.minute, 0, 59, props.step.value.minute); else if (props.part === "second" && "second" in props.segmentValues.value && props.segmentValues.value.second !== null && props.step.value.second && props.step.value.second > 1) props.segmentValues.value.second = snapValueToStep(props.segmentValues.value.second, 0, 59, props.step.value.second); if (Object.values(props.segmentValues.value).every((item) => item !== null)) { const dateRef = props.placeholder.value.set({ ...props.segmentValues.value }); props.modelValue.value = dateRef.copy(); } } let preCompositionNodes = null; function handleSegmentBeforeInput(e) { if (!e.isComposing) e.preventDefault(); } function handleSegmentCompositionStart(e) { const el = e.target; preCompositionNodes = Array.from(el.childNodes, (node) => ({ node, value: node.nodeValue })); } function handleSegmentCompositionEnd(e) { const el = e.target; const original = preCompositionNodes; preCompositionNodes = null; if (original) { for (const { node, value } of original) node.nodeValue = value; el.replaceChildren(...original.map((o2) => o2.node)); } const data = e.data; if (!data) return; for (const char of data) { if (!DIGIT_REG.test(char)) continue; const target = getActiveElement(); if (!(target instanceof HTMLElement)) break; target.dispatchEvent(new KeyboardEvent("keydown", { key: char, bubbles: true, cancelable: true })); } } return { handleSegmentClick, handleSegmentKeydown, handleSegmentBeforeInput, handleSegmentCompositionStart, handleSegmentCompositionEnd, handleSegmentFocusOut, attributes }; } function useSegmentNavigation({ segmentElements, currentFocusedElement, dir, segmentAttributes }) { const currentSegmentIndex = vue.computed(() => Array.from(segmentElements.value).findIndex((el) => segmentAttributes.every((attribute) => { var _a2; return el.getAttribute(attribute) === ((_a2 = currentFocusedElement.value) == null ? void 0 : _a2.getAttribute(attribute)); }))); const nextFocusableSegment = vue.computed(() => { const sign = dir.value === "rtl" ? -1 : 1; const nextCondition = sign < 0 ? currentSegmentIndex.value < 0 : currentSegmentIndex.value > segmentElements.value.size - 1; if (nextCondition) return null; const segmentToFocus = Array.from(segmentElements.value)[currentSegmentIndex.value + sign]; return segmentToFocus; }); const prevFocusableSegment = vue.computed(() => { const sign = dir.value === "rtl" ? -1 : 1; const prevCondition = sign > 0 ? currentSegmentIndex.value < 0 : currentSegmentIndex.value > segmentElements.value.size - 1; if (prevCondition) return null; const segmentToFocus = Array.from(segmentElements.value)[currentSegmentIndex.value - sign]; return segmentToFocus; }); function focusNext() { var _a2; (_a2 = Array.from(segmentElements.value)[currentSegmentIndex.value + 1]) == null ? void 0 : _a2.focus(); } return { currentSegmentIndex, nextFocusableSegment, prevFocusableSegment, focusNext }; } const [injectRovingFocusGroupContext, provideRovingFocusGroupContext] = createContext("RovingFocusGroup"); var RovingFocusGroup_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "RovingFocusGroup", props: { orientation: { type: String, required: false, default: void 0 }, dir: { type: String, required: false }, loop: { type: Boolean, required: false, default: false }, currentTabStopId: { type: [String, null], required: false }, defaultCurrentTabStopId: { type: String, required: false }, preventScrollOnEntryFocus: { type: Boolean, required: false, default: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["entryFocus", "update:currentTabStopId"], setup(__props, { expose: __expose, emit: __emit }) { const props = __props; const emits = __emit; const { loop, orientation, dir: propDir } = vue.toRefs(props); const dir = useDirection(propDir); const currentTabStopId = useVModel(props, "currentTabStopId", emits, { defaultValue: props.defaultCurrentTabStopId, passive: props.currentTabStopId === void 0 }); const isTabbingBackOut = vue.ref(false); const isClickFocus = vue.ref(false); const focusableItemsCount = vue.ref(0); const { getItems, CollectionSlot } = useCollection({ isProvider: true }); function handleFocus(event) { const isKeyboardFocus = !isClickFocus.value; if (event.currentTarget && event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut.value) { const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS); event.currentTarget.dispatchEvent(entryFocusEvent); emits("entryFocus", entryFocusEvent); if (!entryFocusEvent.defaultPrevented) { const items = getItems().map((i) => i.ref).filter((i) => i.dataset.disabled !== ""); const activeItem = items.find((item) => item.getAttribute("data-active") === ""); const highlightedItem = items.find((item) => item.getAttribute("data-highlighted") === ""); const currentItem = items.find((item) => item.id === currentTabStopId.value); const candidateItems = [ activeItem, highlightedItem, currentItem, ...items ].filter(Boolean); focusFirst$1(candidateItems, props.preventScrollOnEntryFocus); } } isClickFocus.value = false; } function handleMouseUp() { setTimeout(() => { isClickFocus.value = false; }, 1); } __expose({ getItems }); provideRovingFocusGroupContext({ loop, dir, orientation, currentTabStopId, onItemFocus: (tabStopId) => { currentTabStopId.value = tabStopId; }, onItemShiftTab: () => { isTabbingBackOut.value = true; }, onFocusableItemAdd: () => { focusableItemsCount.value++; }, onFocusableItemRemove: () => { focusableItemsCount.value--; } }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollectionSlot), null, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { tabindex: isTabbingBackOut.value || focusableItemsCount.value === 0 ? -1 : 0, "data-orientation": vue.unref(orientation), as: __props.as, "as-child": __props.asChild, dir: vue.unref(dir), style: { "outline": "none" }, onMousedown: _cache[0] || (_cache[0] = ($event) => isClickFocus.value = true), onMouseup: handleMouseUp, onFocus: handleFocus, onBlur: _cache[1] || (_cache[1] = ($event) => isTabbingBackOut.value = false) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "tabindex", "data-orientation", "as", "as-child", "dir" ])]), _: 3 }); }; } }); var RovingFocusGroup_default = RovingFocusGroup_vue_vue_type_script_setup_true_lang_default; var RovingFocusItem_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "RovingFocusItem", props: { tabStopId: { type: String, required: false }, focusable: { type: Boolean, required: false, default: true }, active: { type: Boolean, required: false }, allowShiftKey: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "span" } }, setup(__props) { const props = __props; const context2 = injectRovingFocusGroupContext(); const randomId = useId(); const id = vue.computed(() => props.tabStopId || randomId); const isCurrentTabStop = vue.computed(() => context2.currentTabStopId.value === id.value); const { getItems, CollectionItem } = useCollection(); vue.onMounted(() => { if (props.focusable) context2.onFocusableItemAdd(); }); vue.onUnmounted(() => { if (props.focusable) context2.onFocusableItemRemove(); }); vue.watch(() => props.focusable, (newVal, oldVal) => { if (newVal === oldVal) return; if (newVal) context2.onFocusableItemAdd(); else context2.onFocusableItemRemove(); }); function handleKeydown(event) { if (event.defaultPrevented) return; if (event.key === "Tab" && event.shiftKey) { context2.onItemShiftTab(); return; } if (event.target !== event.currentTarget) return; const focusIntent = getFocusIntent(event, context2.orientation.value, context2.dir.value); if (focusIntent !== void 0) { if (event.metaKey || event.ctrlKey || event.altKey || (props.allowShiftKey ? false : event.shiftKey)) return; event.preventDefault(); let candidateNodes = [...getItems().map((i) => i.ref).filter((i) => i.dataset.disabled !== "")]; if (focusIntent === "last") candidateNodes.reverse(); else if (focusIntent === "prev" || focusIntent === "next") { if (focusIntent === "prev") candidateNodes.reverse(); const currentIndex = candidateNodes.indexOf(event.currentTarget); candidateNodes = context2.loop.value ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1); } vue.nextTick(() => focusFirst$1(candidateNodes)); } } const { forwardRef, currentElement } = useForwardExpose(); const itemElement = vue.shallowRef(); vue.watch(currentElement, (element) => { itemElement.value = element; }, { immediate: true, flush: "post" }); useEventListener(itemElement, "keydown", handleKeydown); function handleFocusIn(event) { itemElement.value = event.currentTarget; } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollectionItem), null, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { ref: vue.unref(forwardRef), tabindex: isCurrentTabStop.value ? 0 : -1, "data-orientation": vue.unref(context2).orientation.value, "data-active": __props.active ? "" : void 0, "data-disabled": !__props.focusable ? "" : void 0, as: __props.as, "as-child": __props.asChild, onMousedown: _cache[0] || (_cache[0] = (event) => { if (!__props.focusable) event.preventDefault(); else vue.unref(context2).onItemFocus(id.value); }), onFocus: _cache[1] || (_cache[1] = ($event) => vue.unref(context2).onItemFocus(id.value)), onFocusin: handleFocusIn }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "tabindex", "data-orientation", "data-active", "data-disabled", "as", "as-child" ])]), _: 3 }); }; } }); var RovingFocusItem_default = RovingFocusItem_vue_vue_type_script_setup_true_lang_default; const [injectCheckboxGroupRootContext] = createContext("CheckboxGroupRoot"); const [injectFieldRootContext] = createContext("FieldRoot"); var Label_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "Label", props: { for: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "label" } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { onMousedown: _cache[0] || (_cache[0] = (event) => { if (!event.defaultPrevented && event.detail > 1) event.preventDefault(); }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var Label_default = Label_vue_vue_type_script_setup_true_lang_default; function isIndeterminate(checked) { return checked === "indeterminate"; } function getState(checked) { return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked"; } const [injectCheckboxRootContext, provideCheckboxRootContext] = createContext("CheckboxRoot"); var CheckboxRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "CheckboxRoot", props: { defaultValue: { type: null, required: false }, modelValue: { type: null, required: false, default: void 0 }, disabled: { type: Boolean, required: false }, value: { type: null, required: false, default: "on" }, id: { type: String, required: false }, trueValue: { type: null, required: false, default: () => true }, falseValue: { type: null, required: false, default: () => false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" }, name: { type: String, required: false }, required: { type: Boolean, required: false } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { var _a2; const props = __props; const emits = __emit; const { forwardRef, currentElement } = useForwardExpose(); const checkboxGroupContext = injectCheckboxGroupRootContext(null); const fieldContext = injectFieldRootContext(null); const modelValue = useVModel(props, "modelValue", emits, { defaultValue: (_a2 = props.defaultValue) != null ? _a2 : props.falseValue, passive: props.modelValue === void 0 }); const isGroupMaxReached = vue.computed(() => { var _a3; const max2 = checkboxGroupContext == null ? void 0 : checkboxGroupContext.max.value; if (isNullish(max2)) return false; const values = (_a3 = checkboxGroupContext.modelValue.value) != null ? _a3 : []; return !isValueEqualOrExist(values, props.value) && values.length >= max2; }); const nativeDisabled = vue.computed(() => Boolean((checkboxGroupContext == null ? void 0 : checkboxGroupContext.disabled.value) || props.disabled || (fieldContext == null ? void 0 : fieldContext.disabled.value))); const disabled = vue.computed(() => nativeDisabled.value || isGroupMaxReached.value); const participatesAsControl = vue.computed(() => Boolean(fieldContext) && !checkboxGroupContext); const resolvedId = vue.computed(() => { var _a3; return (_a3 = props.id) != null ? _a3 : participatesAsControl.value ? fieldContext == null ? void 0 : fieldContext.fieldId.value : void 0; }); const resolvedName = vue.computed(() => { var _a3; return (_a3 = props.name) != null ? _a3 : fieldContext == null ? void 0 : fieldContext.name.value; }); const resolvedRequired = vue.computed(() => fieldContext ? props.required || fieldContext.required.value : props.required); const isChecked = vue.computed(() => isEqual$1(modelValue.value, props.trueValue)); const checkboxState = vue.computed(() => { if (!isNullish(checkboxGroupContext == null ? void 0 : checkboxGroupContext.modelValue.value)) return isValueEqualOrExist(checkboxGroupContext.modelValue.value, props.value); else { if (modelValue.value === "indeterminate") return "indeterminate"; return isChecked.value; } }); function handleClick() { if (disabled.value) return; const nextState = checkboxState.value !== true; if (!isNullish(checkboxGroupContext == null ? void 0 : checkboxGroupContext.modelValue.value)) { const modelValueArray = [...checkboxGroupContext.modelValue.value || []]; if (isValueEqualOrExist(modelValueArray, props.value)) { const index = modelValueArray.findIndex((i) => isEqual$1(i, props.value)); modelValueArray.splice(index, 1); } else modelValueArray.push(props.value); checkboxGroupContext.modelValue.value = modelValueArray; } else if (modelValue.value === "indeterminate") modelValue.value = props.trueValue; else modelValue.value = isChecked.value ? props.falseValue : props.trueValue; if (participatesAsControl.value) fieldContext == null ? void 0 : fieldContext.handleControlInput({ value: nextState }); } vue.watch(checkboxState, (state2) => { if (participatesAsControl.value) fieldContext == null ? void 0 : fieldContext.reportControlState({ filled: state2 === true }); }); const isFormControl = useFormControl(currentElement); const scopeIdAttrs = useForwardScopeId(); const attrs = vue.useAttrs(); const ariaLabel = vue.computed(() => { var _a3; if (attrs["aria-label"]) return void 0; return resolvedId.value && currentElement.value ? (_a3 = document.querySelector(`[for="${resolvedId.value}"]`)) == null ? void 0 : _a3.innerText : void 0; }); function getFieldAriaAttrs() { var _a3; const mergeIds = (consumerValue, fieldValue) => [consumerValue, fieldValue].filter(Boolean).join(" ") || void 0; return { "aria-labelledby": mergeIds(attrs["aria-labelledby"], participatesAsControl.value ? fieldContext == null ? void 0 : fieldContext.labelId.value : void 0), "aria-describedby": mergeIds(attrs["aria-describedby"], fieldContext == null ? void 0 : fieldContext.describedBy.value), "aria-invalid": (_a3 = attrs["aria-invalid"]) != null ? _a3 : (fieldContext == null ? void 0 : fieldContext.invalid.value) || void 0 }; } function handleFocus() { fieldContext == null ? void 0 : fieldContext.handleControlFocus(); } function handleBlur() { if (participatesAsControl.value) fieldContext == null ? void 0 : fieldContext.handleControlBlur(); else fieldContext == null ? void 0 : fieldContext.reportControlState({ focused: false, touched: true }); } let unregisterControl; vue.onMounted(() => { if (!participatesAsControl.value) return; unregisterControl = fieldContext == null ? void 0 : fieldContext.registerControl({ id: () => resolvedId.value, element: () => currentElement.value, getValue: () => checkboxState.value, required: () => props.required, isFilled: (value) => value === true }); }); vue.onBeforeUnmount(() => unregisterControl == null ? void 0 : unregisterControl()); provideCheckboxRootContext({ disabled: nativeDisabled, state: checkboxState }); return (_ctx, _cache) => { var _a3, _b, _c; return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(((_a3 = vue.unref(checkboxGroupContext)) == null ? void 0 : _a3.rovingFocus.value) ? vue.unref(RovingFocusItem_default) : vue.unref(Primitive)), vue.mergeProps({ ...(_b = vue.unref(fieldContext)) == null ? void 0 : _b.dataAttributes.value, ..._ctx.$attrs, ...vue.unref(scopeIdAttrs), ...getFieldAriaAttrs() }, { id: resolvedId.value, ref: vue.unref(forwardRef), role: "checkbox", "as-child": __props.asChild, as: __props.as, type: __props.as === "button" ? "button" : void 0, "aria-checked": vue.unref(isIndeterminate)(checkboxState.value) ? "mixed" : checkboxState.value, "aria-required": resolvedRequired.value, "aria-label": _ctx.$attrs["aria-label"] || ariaLabel.value, "data-state": vue.unref(getState)(checkboxState.value), "aria-disabled": disabled.value ? "true" : void 0, "data-disabled": nativeDisabled.value ? "" : void 0, disabled: nativeDisabled.value, focusable: ((_c = vue.unref(checkboxGroupContext)) == null ? void 0 : _c.rovingFocus.value) ? !nativeDisabled.value : void 0, onKeydown: vue.withKeys(vue.withModifiers(() => { }, ["prevent"]), ["enter"]), onClick: handleClick, onFocus: handleFocus, onBlur: handleBlur }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue), state: checkboxState.value })]), _: 3 }, 16, [ "id", "as-child", "as", "type", "aria-checked", "aria-required", "aria-label", "data-state", "aria-disabled", "data-disabled", "disabled", "focusable", "onKeydown" ])), vue.unref(isFormControl) && resolvedName.value && !vue.unref(checkboxGroupContext) ? (vue.openBlock(), vue.createBlock(vue.unref(VisuallyHiddenInput_default), vue.mergeProps({ key: 0, type: "checkbox", checked: !!checkboxState.value, name: resolvedName.value, value: __props.value, disabled: nativeDisabled.value, required: resolvedRequired.value }, vue.unref(scopeIdAttrs)), null, 16, [ "checked", "name", "value", "disabled", "required" ])) : vue.createCommentVNode("v-if", true)], 64); }; } }); var CheckboxRoot_default = CheckboxRoot_vue_vue_type_script_setup_true_lang_default; var CheckboxIndicator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "CheckboxIndicator", props: { forceMount: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "span" } }, setup(__props) { const { forwardRef } = useForwardExpose(); const rootContext = injectCheckboxRootContext(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || vue.unref(isIndeterminate)(vue.unref(rootContext).state.value) || vue.unref(rootContext).state.value === true }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), vue.mergeProps({ ref: vue.unref(forwardRef), "data-state": vue.unref(getState)(vue.unref(rootContext).state.value), "data-disabled": vue.unref(rootContext).disabled.value ? "" : void 0, style: { pointerEvents: "none" }, "as-child": __props.asChild, as: __props.as }, _ctx.$attrs), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "data-state", "data-disabled", "as-child", "as" ])]), _: 3 }, 8, ["present"]); }; } }); var CheckboxIndicator_default = CheckboxIndicator_vue_vue_type_script_setup_true_lang_default; var MenuAnchor_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuAnchor", props: { reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperAnchor_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var MenuAnchor_default = MenuAnchor_vue_vue_type_script_setup_true_lang_default; var MenuArrow_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuArrow", props: { width: { type: Number, required: false }, height: { type: Number, required: false }, rounded: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperArrow_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var MenuArrow_default = MenuArrow_vue_vue_type_script_setup_true_lang_default; function useIsUsingKeyboardImpl() { const isUsingKeyboard = vue.ref(false); vue.onMounted(() => { useEventListener("keydown", () => { isUsingKeyboard.value = true; }, { capture: true, passive: true }); useEventListener(["pointerdown", "pointermove"], () => { isUsingKeyboard.value = false; }, { capture: true, passive: true }); }); return isUsingKeyboard; } const useIsUsingKeyboard = createSharedComposable(useIsUsingKeyboardImpl); const [injectMenuContext, provideMenuContext] = createContext(["MenuRoot", "MenuSub"], "MenuContext"); const [injectMenuRootContext, provideMenuRootContext] = createContext("MenuRoot"); var MenuRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuRoot", props: { open: { type: Boolean, required: false, default: false }, dir: { type: String, required: false }, modal: { type: Boolean, required: false, default: true } }, emits: ["update:open"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { modal, dir: propDir } = vue.toRefs(props); const dir = useDirection(propDir); const open = useVModel(props, "open", emits); const content = vue.ref(); const isUsingKeyboardRef = useIsUsingKeyboard(); provideMenuContext({ open, onOpenChange: (value) => { open.value = value; }, content, onContentChange: (element) => { content.value = element; } }); provideMenuRootContext({ onClose: () => { open.value = false; }, isUsingKeyboardRef, dir, modal }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperRoot_default), null, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }); }; } }); var MenuRoot_default = MenuRoot_vue_vue_type_script_setup_true_lang_default; const [injectMenuContentContext, provideMenuContentContext] = createContext("MenuContent"); var MenuContentImpl_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuContentImpl", props: vue.mergeDefaults({ loop: { type: Boolean, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false }, disableOutsideScroll: { type: Boolean, required: false }, trapFocus: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, { ...PopperContentPropsDefaultValue }), emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "entryFocus", "openAutoFocus", "closeAutoFocus", "dismiss" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const menuContext = injectMenuContext(); const rootContext = injectMenuRootContext(); const { trapFocus, disableOutsidePointerEvents, loop } = vue.toRefs(props); useFocusGuards(); useBodyScrollLock(disableOutsidePointerEvents.value); const searchRef = vue.ref(""); const timerRef = vue.ref(0); const pointerGraceTimerRef = vue.ref(0); const pointerGraceIntentRef = vue.ref(null); const pointerDirRef = vue.ref("right"); const lastPointerXRef = vue.ref(0); const currentItemId = vue.ref(null); const rovingFocusGroupRef = vue.ref(); const { forwardRef, currentElement: contentElement } = useForwardExpose(); const { handleTypeaheadSearch } = useTypeahead(); const highlightedElement = vue.ref(); function onKeydownNavigation(event) { const el = useArrowNavigation(event, highlightedElement.value || getActiveElement(), contentElement.value, { loop: loop.value, arrowKeyOptions: "vertical", dir: rootContext == null ? void 0 : rootContext.dir.value, focus: false, attributeName: "[data-reka-collection-item]:not([data-disabled])" }); if (el) { highlightedElement.value = el; el.scrollIntoView({ block: "nearest" }); } } function onKeydownEnter() { if (highlightedElement.value) highlightedElement.value.click(); } const filterElement = vue.ref(); const activeSubmenuContext = vue.ref(); vue.watch(highlightedElement, (el) => { if (activeSubmenuContext.value && (el === void 0 || el !== activeSubmenuContext.value.trigger.value)) { if (el === void 0) return; activeSubmenuContext.value.onOpenChange(false); activeSubmenuContext.value = void 0; } }); vue.watch(contentElement, (el) => { menuContext.onContentChange(el); }); vue.onUnmounted(() => { window.clearTimeout(timerRef.value); }); function isPointerMovingToSubmenu(event) { var _a2, _b; const isMovingTowards = pointerDirRef.value === ((_a2 = pointerGraceIntentRef.value) == null ? void 0 : _a2.side); return isMovingTowards && isPointerInGraceArea(event, (_b = pointerGraceIntentRef.value) == null ? void 0 : _b.area); } async function handleMountAutoFocus(event) { var _a2; emits("openAutoFocus", event); if (event.defaultPrevented) return; event.preventDefault(); (_a2 = contentElement.value) == null ? void 0 : _a2.focus({ preventScroll: true }); } function handleKeyDown(event) { var _a2, _b; if (event.defaultPrevented) return; const target = event.target; const isKeyDownInside = target.closest("[data-reka-menu-content]") === event.currentTarget; const isKeyDownInTextField = ["input", "textarea"].includes(target.tagName.toLowerCase()); const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; const isCharacterKey = event.key.length === 1; const el = useArrowNavigation(event, getActiveElement(), contentElement.value, { loop: loop.value, arrowKeyOptions: "vertical", dir: rootContext == null ? void 0 : rootContext.dir.value, focus: true, attributeName: "[data-reka-collection-item]:not([data-disabled])" }); if (el) return el == null ? void 0 : el.focus(); if (event.code === "Space") return; const collectionItems = (_b = (_a2 = rovingFocusGroupRef.value) == null ? void 0 : _a2.getItems()) != null ? _b : []; if (isKeyDownInside) { if (event.key === "Tab" && rootContext.modal.value) event.preventDefault(); if (!isModifierKey && isCharacterKey && !isKeyDownInTextField) handleTypeaheadSearch(event.key, collectionItems); } if (event.target !== contentElement.value) return; if (!FIRST_LAST_KEYS.includes(event.key)) return; event.preventDefault(); const candidateNodes = [...collectionItems.map((item) => item.ref)]; if (LAST_KEYS.includes(event.key)) candidateNodes.reverse(); focusFirst$2(candidateNodes); } function handleBlur(event) { var _a2, _b; if (!((_b = (_a2 = event == null ? void 0 : event.currentTarget) == null ? void 0 : _a2.contains) == null ? void 0 : _b.call(_a2, event.target))) { window.clearTimeout(timerRef.value); searchRef.value = ""; } } function handlePointerMove(event) { var _a2; if (!isMouseEvent(event)) return; const target = event.target; const pointerXHasChanged = lastPointerXRef.value !== event.clientX; if (((_a2 = event == null ? void 0 : event.currentTarget) == null ? void 0 : _a2.contains(target)) && pointerXHasChanged) { const newDir = event.clientX > lastPointerXRef.value ? "right" : "left"; pointerDirRef.value = newDir; lastPointerXRef.value = event.clientX; } } function handlePointerEnter(event) { if (!isMouseEvent(event)) return; if (filterElement.value) filterElement.value.focus(); } provideMenuContentContext({ onItemEnter: (event) => { if (isPointerMovingToSubmenu(event)) return true; else return false; }, onItemLeave: (event) => { var _a2, _b; if (isPointerMovingToSubmenu(event)) return true; const isInputFocused = ["INPUT", "TEXTAREA"].includes(((_a2 = getActiveElement()) == null ? void 0 : _a2.tagName) || ""); if (!isInputFocused) (_b = contentElement.value) == null ? void 0 : _b.focus(); currentItemId.value = null; return false; }, onTriggerLeave: (event) => { if (isPointerMovingToSubmenu(event)) return true; else return false; }, searchRef, highlightedElement, onKeydownNavigation, onKeydownEnter, filterElement, onFilterElementChange: (el) => { filterElement.value = el; }, activeSubmenuContext, pointerGraceTimerRef, onPointerGraceIntentChange: (intent) => { pointerGraceIntentRef.value = intent; } }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(FocusScope_default), { "as-child": "", trapped: vue.unref(trapFocus), onMountAutoFocus: handleMountAutoFocus, onUnmountAutoFocus: _cache[7] || (_cache[7] = ($event) => emits("closeAutoFocus", $event)) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(DismissableLayer_default), { "as-child": "", "disable-outside-pointer-events": vue.unref(disableOutsidePointerEvents), onEscapeKeyDown: _cache[2] || (_cache[2] = ($event) => emits("escapeKeyDown", $event)), onPointerDownOutside: _cache[3] || (_cache[3] = ($event) => emits("pointerDownOutside", $event)), onFocusOutside: _cache[4] || (_cache[4] = ($event) => emits("focusOutside", $event)), onInteractOutside: _cache[5] || (_cache[5] = ($event) => emits("interactOutside", $event)), onDismiss: _cache[6] || (_cache[6] = ($event) => emits("dismiss")) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(RovingFocusGroup_default), { ref_key: "rovingFocusGroupRef", ref: rovingFocusGroupRef, "current-tab-stop-id": currentItemId.value, "onUpdate:currentTabStopId": _cache[0] || (_cache[0] = ($event) => currentItemId.value = $event), "as-child": "", orientation: "vertical", dir: vue.unref(rootContext).dir.value, loop: vue.unref(loop), onEntryFocus: _cache[1] || (_cache[1] = (event) => { emits("entryFocus", event); if (!vue.unref(rootContext).isUsingKeyboardRef.value) event.preventDefault(); }) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(PopperContent_default), { ref: vue.unref(forwardRef), role: "menu", as: __props.as, "as-child": __props.asChild, "aria-orientation": "vertical", "data-reka-menu-content": "", "data-state": vue.unref(getOpenState$1)(vue.unref(menuContext).open.value), dir: vue.unref(rootContext).dir.value, side: __props.side, "side-offset": __props.sideOffset, align: __props.align, "align-offset": __props.alignOffset, "avoid-collisions": __props.avoidCollisions, "collision-boundary": __props.collisionBoundary, "collision-padding": __props.collisionPadding, "arrow-padding": __props.arrowPadding, "prioritize-position": __props.prioritizePosition, "position-strategy": __props.positionStrategy, "update-position-strategy": __props.updatePositionStrategy, sticky: __props.sticky, "hide-when-detached": __props.hideWhenDetached, reference: __props.reference, onKeydown: handleKeyDown, onBlur: handleBlur, onPointermove: handlePointerMove, onPointerenter: handlePointerEnter }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as", "as-child", "data-state", "dir", "side", "side-offset", "align", "align-offset", "avoid-collisions", "collision-boundary", "collision-padding", "arrow-padding", "prioritize-position", "position-strategy", "update-position-strategy", "sticky", "hide-when-detached", "reference" ])]), _: 3 }, 8, [ "current-tab-stop-id", "dir", "loop" ])]), _: 3 }, 8, ["disable-outside-pointer-events"])]), _: 3 }, 8, ["trapped"]); }; } }); var MenuContentImpl_default = MenuContentImpl_vue_vue_type_script_setup_true_lang_default; var MenuItemImpl_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "MenuItemImpl", props: { disabled: { type: Boolean, required: false }, textValue: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const contentContext = injectMenuContentContext(); const { forwardRef, currentElement } = useForwardExpose(); const { CollectionItem } = useCollection(); const isFocused = vue.ref(false); const isHighlighted = vue.computed(() => isFocused.value || currentElement.value != null && contentContext.highlightedElement.value === currentElement.value); async function handlePointerMove(event) { var _a2; if (event.defaultPrevented || !isMouseEvent(event)) return; if (props.disabled) contentContext.onItemLeave(event); else { const defaultPrevented = contentContext.onItemEnter(event); if (!defaultPrevented) { const item = event.currentTarget; contentContext.highlightedElement.value = item; const isInputFocused = ["INPUT", "TEXTAREA"].includes(((_a2 = getActiveElement()) == null ? void 0 : _a2.tagName) || ""); if (!isInputFocused) item.focus({ preventScroll: true }); } } } async function handlePointerLeave(event) { await vue.nextTick(); if (event.defaultPrevented) return; if (!isMouseEvent(event)) return; if (contentContext.highlightedElement.value !== currentElement.value) return; const isMovingToSubmenu = contentContext.onItemLeave(event); if (!isMovingToSubmenu && contentContext.highlightedElement.value === currentElement.value) contentContext.highlightedElement.value = void 0; } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollectionItem), { value: { textValue: __props.textValue } }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), vue.mergeProps({ ref: vue.unref(forwardRef), role: "menuitem", tabindex: "-1" }, _ctx.$attrs, { as: __props.as, "as-child": __props.asChild, "aria-disabled": __props.disabled || void 0, "data-disabled": __props.disabled ? "" : void 0, "data-highlighted": isHighlighted.value ? "" : void 0, onPointermove: handlePointerMove, onPointerleave: handlePointerLeave, onFocus: _cache[0] || (_cache[0] = async (event) => { const item = event.currentTarget; await vue.nextTick(); if (event.defaultPrevented || __props.disabled) return; isFocused.value = true; vue.unref(contentContext).highlightedElement.value = item; }), onBlur: _cache[1] || (_cache[1] = async (event) => { await vue.nextTick(); if (event.defaultPrevented) return; isFocused.value = false; }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "as", "as-child", "aria-disabled", "data-disabled", "data-highlighted" ])]), _: 3 }, 8, ["value"]); }; } }); var MenuItemImpl_default = MenuItemImpl_vue_vue_type_script_setup_true_lang_default; var MenuItem_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuItem", props: { disabled: { type: Boolean, required: false }, textValue: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["select"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { forwardRef, currentElement } = useForwardExpose(); const rootContext = injectMenuRootContext(); const contentContext = injectMenuContentContext(); const isPointerDownRef = vue.ref(false); async function handleSelect() { const menuItem = currentElement.value; if (!props.disabled && menuItem) { const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true }); emits("select", itemSelectEvent); await vue.nextTick(); if (itemSelectEvent.defaultPrevented) isPointerDownRef.value = false; else rootContext.onClose(); } } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(MenuItemImpl_default, vue.mergeProps(props, { ref: vue.unref(forwardRef), onClick: handleSelect, onPointerdown: _cache[0] || (_cache[0] = () => { isPointerDownRef.value = true; }), onPointerup: _cache[1] || (_cache[1] = async (event) => { var _a2; await vue.nextTick(); if (event.defaultPrevented) return; if (!isPointerDownRef.value) (_a2 = event.currentTarget) == null ? void 0 : _a2.click(); }), onKeydown: _cache[2] || (_cache[2] = async (event) => { var _a2; const isTypingAhead = vue.unref(contentContext).searchRef.value !== ""; if (__props.disabled || isTypingAhead && event.key === " ") return; if (vue.unref(SELECTION_KEYS).includes(event.key)) { (_a2 = event.currentTarget) == null ? void 0 : _a2.click(); event.preventDefault(); } }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var MenuItem_default = MenuItem_vue_vue_type_script_setup_true_lang_default; const [injectMenuItemIndicatorContext, provideMenuItemIndicatorContext] = createContext(["MenuCheckboxItem", "MenuRadioItem"], "MenuItemIndicatorContext"); var MenuItemIndicator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuItemIndicator", props: { forceMount: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "span" } }, setup(__props) { const indicatorContext = injectMenuItemIndicatorContext({ modelValue: vue.ref(false) }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || vue.unref(isIndeterminate$1)(vue.unref(indicatorContext).modelValue.value) || vue.unref(indicatorContext).modelValue.value === true }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { as: __props.as, "as-child": __props.asChild, "data-state": vue.unref(getCheckedState)(vue.unref(indicatorContext).modelValue.value) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as", "as-child", "data-state" ])]), _: 3 }, 8, ["present"]); }; } }); var MenuItemIndicator_default = MenuItemIndicator_vue_vue_type_script_setup_true_lang_default; var MenuCheckboxItem_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuCheckboxItem", props: { modelValue: { type: [Boolean, String], required: false, default: false }, disabled: { type: Boolean, required: false }, textValue: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["select", "update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const delegatedProps = reactiveOmit(props, ["modelValue"]); const forwarded = useForwardProps$1(delegatedProps); const modelValue = useVModel(props, "modelValue", emits); provideMenuItemIndicatorContext({ modelValue }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(MenuItem_default, vue.mergeProps({ role: "menuitemcheckbox" }, vue.unref(forwarded), { "aria-checked": vue.unref(isIndeterminate$1)(vue.unref(modelValue)) ? "mixed" : vue.unref(modelValue), "data-state": vue.unref(getCheckedState)(vue.unref(modelValue)), onSelect: _cache[0] || (_cache[0] = async (event) => { emits("select", event); if (vue.unref(isIndeterminate$1)(vue.unref(modelValue))) modelValue.value = true; else modelValue.value = !vue.unref(modelValue); }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { checked: vue.unref(modelValue), modelValue: vue.unref(modelValue) })]), _: 3 }, 16, ["aria-checked", "data-state"]); }; } }); var MenuCheckboxItem_default = MenuCheckboxItem_vue_vue_type_script_setup_true_lang_default; var MenuRootContentModal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuRootContentModal", props: { loop: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "entryFocus", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardPropsEmits(props, emits); const menuContext = injectMenuContext(); const { forwardRef, currentElement } = useForwardExpose(); useHideOthers(currentElement); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(MenuContentImpl_default, vue.mergeProps(vue.unref(forwarded), { ref: vue.unref(forwardRef), "trap-focus": vue.unref(menuContext).open.value, "disable-outside-pointer-events": vue.unref(menuContext).open.value, "disable-outside-scroll": true, onDismiss: _cache[0] || (_cache[0] = ($event) => vue.unref(menuContext).onOpenChange(false)), onFocusOutside: _cache[1] || (_cache[1] = vue.withModifiers(($event) => emits("focusOutside", $event), ["prevent"])) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["trap-focus", "disable-outside-pointer-events"]); }; } }); var MenuRootContentModal_default = MenuRootContentModal_vue_vue_type_script_setup_true_lang_default; var MenuRootContentNonModal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuRootContentNonModal", props: { loop: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "entryFocus", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardPropsEmits(props, emits); const menuContext = injectMenuContext(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(MenuContentImpl_default, vue.mergeProps(vue.unref(forwarded), { "trap-focus": false, "disable-outside-pointer-events": false, "disable-outside-scroll": false, onDismiss: _cache[0] || (_cache[0] = ($event) => vue.unref(menuContext).onOpenChange(false)) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var MenuRootContentNonModal_default = MenuRootContentNonModal_vue_vue_type_script_setup_true_lang_default; var MenuContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuContent", props: { forceMount: { type: Boolean, required: false }, loop: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "entryFocus", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardPropsEmits(props, emits); const menuContext = injectMenuContext(); const rootContext = injectMenuRootContext(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || vue.unref(menuContext).open.value }, { default: vue.withCtx(() => [vue.unref(rootContext).modal.value ? (vue.openBlock(), vue.createBlock(MenuRootContentModal_default, vue.normalizeProps(vue.mergeProps({ key: 0 }, { ..._ctx.$attrs, ...vue.unref(forwarded) })), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16)) : (vue.openBlock(), vue.createBlock(MenuRootContentNonModal_default, vue.normalizeProps(vue.mergeProps({ key: 1 }, { ..._ctx.$attrs, ...vue.unref(forwarded) })), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16))]), _: 3 }, 8, ["present"]); }; } }); var MenuContent_default = MenuContent_vue_vue_type_script_setup_true_lang_default; const [injectMenuGroupContext, provideMenuGroupContext] = createContext("MenuGroup"); var MenuGroup_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuGroup", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const id = useId(void 0, "reka-menu-group"); provideMenuGroupContext({ id }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps({ role: "group" }, props, { "aria-labelledby": vue.unref(id) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["aria-labelledby"]); }; } }); var MenuGroup_default = MenuGroup_vue_vue_type_script_setup_true_lang_default; var MenuLabel_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuLabel", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "div" } }, setup(__props) { const props = __props; const groupContext = injectMenuGroupContext({ id: "" }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { id: vue.unref(groupContext).id || void 0 }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["id"]); }; } }); var MenuLabel_default = MenuLabel_vue_vue_type_script_setup_true_lang_default; var MenuPortal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuPortal", props: { to: { type: null, required: false }, disabled: { type: Boolean, required: false }, defer: { type: Boolean, required: false }, forceMount: { type: Boolean, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Teleport_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var MenuPortal_default = MenuPortal_vue_vue_type_script_setup_true_lang_default; var MenuSeparator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuSeparator", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { role: "separator", "aria-orientation": "horizontal" }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var MenuSeparator_default = MenuSeparator_vue_vue_type_script_setup_true_lang_default; const [injectMenuSubContext, provideMenuSubContext] = createContext("MenuSub"); var MenuSub_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuSub", props: { open: { type: Boolean, required: false, default: void 0 } }, emits: ["update:open"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const open = useVModel(props, "open", emits, { defaultValue: false, passive: props.open === void 0 }); const parentMenuContext = injectMenuContext(); const trigger = vue.ref(); const content = vue.ref(); vue.watchEffect((cleanupFn) => { if ((parentMenuContext == null ? void 0 : parentMenuContext.open.value) === false) open.value = false; cleanupFn(() => open.value = false); }); provideMenuContext({ open, onOpenChange: (value) => { open.value = value; }, content, onContentChange: (element) => { content.value = element; } }); provideMenuSubContext({ triggerId: "", contentId: "", trigger, onTriggerChange: (element) => { trigger.value = element; } }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperRoot_default), null, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }); }; } }); var MenuSub_default = MenuSub_vue_vue_type_script_setup_true_lang_default; var MenuSubContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuSubContent", props: { forceMount: { type: Boolean, required: false }, loop: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false, default: true }, reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "entryFocus", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardPropsEmits(props, emits); const menuContext = injectMenuContext(); const rootContext = injectMenuRootContext(); const menuSubContext = injectMenuSubContext(); const parentContentContext = injectMenuContentContext(); const { forwardRef, currentElement: subContentElement } = useForwardExpose(); menuSubContext.contentId || (menuSubContext.contentId = useId(void 0, "reka-menu-sub-content")); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || vue.unref(menuContext).open.value }, { default: vue.withCtx(() => [vue.createVNode(MenuContentImpl_default, vue.mergeProps(vue.unref(forwarded), { id: vue.unref(menuSubContext).contentId, ref: vue.unref(forwardRef), "aria-labelledby": vue.unref(menuSubContext).triggerId, align: "start", side: vue.unref(rootContext).dir.value === "rtl" ? "left" : "right", "disable-outside-pointer-events": false, "disable-outside-scroll": false, "trap-focus": false, onOpenAutoFocus: _cache[0] || (_cache[0] = vue.withModifiers((event) => { var _a2; if (vue.unref(rootContext).isUsingKeyboardRef.value) (_a2 = vue.unref(subContentElement)) == null ? void 0 : _a2.focus(); }, ["prevent"])), onCloseAutoFocus: _cache[1] || (_cache[1] = vue.withModifiers(() => { }, ["prevent"])), onFocusOutside: _cache[2] || (_cache[2] = (event) => { var _a2; if (event.defaultPrevented) return; const isMovingToParentContent = (_a2 = vue.unref(parentContentContext).filterElement.value) == null ? void 0 : _a2.contains(event.target); if (event.target !== vue.unref(menuSubContext).trigger.value && !isMovingToParentContent) vue.unref(menuContext).onOpenChange(false); }), onEscapeKeyDown: _cache[3] || (_cache[3] = (event) => { vue.unref(rootContext).onClose(); event.preventDefault(); }), onKeydown: _cache[4] || (_cache[4] = (event) => { var _a2, _b, _c; const isKeyDownInside = (_a2 = event.currentTarget) == null ? void 0 : _a2.contains(event.target); const isCloseKey = vue.unref(SUB_CLOSE_KEYS)[vue.unref(rootContext).dir.value].includes(event.key); if (isKeyDownInside && isCloseKey) { vue.unref(menuContext).onOpenChange(false); if (vue.unref(parentContentContext).filterElement.value) { vue.unref(parentContentContext).filterElement.value.focus(); vue.unref(parentContentContext).highlightedElement.value = vue.unref(menuSubContext).trigger.value; (_b = vue.unref(menuSubContext).trigger.value) == null ? void 0 : _b.scrollIntoView({ block: "nearest" }); } else (_c = vue.unref(menuSubContext).trigger.value) == null ? void 0 : _c.focus(); event.preventDefault(); } }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "aria-labelledby", "side" ])]), _: 3 }, 8, ["present"]); }; } }); var MenuSubContent_default = MenuSubContent_vue_vue_type_script_setup_true_lang_default; var MenuSubTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "MenuSubTrigger", props: { graceDuration: { type: Number, required: false, default: 300 }, disabled: { type: Boolean, required: false }, textValue: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const itemProps = reactiveOmit(props, "graceDuration"); const menuContext = injectMenuContext(); const rootContext = injectMenuRootContext(); const subContext = injectMenuSubContext(); const contentContext = injectMenuContentContext(); vue.watch(menuContext.open, (open) => { var _a2; if (open) contentContext.activeSubmenuContext.value = { onOpenChange: menuContext.onOpenChange, trigger: subContext.trigger }; else if (((_a2 = contentContext.activeSubmenuContext.value) == null ? void 0 : _a2.trigger.value) === subContext.trigger.value) contentContext.activeSubmenuContext.value = void 0; }); const openTimerRef = vue.ref(null); subContext.triggerId || (subContext.triggerId = useId(void 0, "reka-menu-sub-trigger")); function clearOpenTimer() { if (openTimerRef.value) window.clearTimeout(openTimerRef.value); openTimerRef.value = null; } vue.onUnmounted(() => { clearOpenTimer(); }); function handlePointerMove(event) { if (!isMouseEvent(event)) return; const defaultPrevented = contentContext.onItemEnter(event); if (defaultPrevented) return; if (!props.disabled && !menuContext.open.value && !openTimerRef.value) { contentContext.onPointerGraceIntentChange(null); openTimerRef.value = window.setTimeout(() => { menuContext.onOpenChange(true); clearOpenTimer(); }, 100); } } async function handlePointerLeave(event) { var _a2, _b; if (!isMouseEvent(event)) return; clearOpenTimer(); const contentRect = (_a2 = menuContext.content.value) == null ? void 0 : _a2.getBoundingClientRect(); if (contentRect == null ? void 0 : contentRect.width) { const side = (_b = menuContext.content.value) == null ? void 0 : _b.dataset.side; const rightSide = side === "right"; const bleed = rightSide ? -5 : 5; const contentNearEdge = contentRect[rightSide ? "left" : "right"]; const contentFarEdge = contentRect[rightSide ? "right" : "left"]; contentContext.onPointerGraceIntentChange({ area: [ { x: event.clientX + bleed, y: event.clientY }, { x: contentNearEdge, y: contentRect.top }, { x: contentFarEdge, y: contentRect.top }, { x: contentFarEdge, y: contentRect.bottom }, { x: contentNearEdge, y: contentRect.bottom } ], side }); window.clearTimeout(contentContext.pointerGraceTimerRef.value); contentContext.pointerGraceTimerRef.value = window.setTimeout(() => contentContext.onPointerGraceIntentChange(null), props.graceDuration); } else { const defaultPrevented = contentContext.onTriggerLeave(event); if (defaultPrevented) return; contentContext.onPointerGraceIntentChange(null); } } async function handleKeyDown(event) { var _a2; const isTypingAhead = contentContext.searchRef.value !== ""; if (props.disabled || isTypingAhead && event.key === " ") return; if (SUB_OPEN_KEYS[rootContext.dir.value].includes(event.key)) { menuContext.onOpenChange(true); await vue.nextTick(); (_a2 = menuContext.content.value) == null ? void 0 : _a2.focus(); event.preventDefault(); } } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(MenuAnchor_default, { "as-child": "" }, { default: vue.withCtx(() => [vue.createVNode(MenuItemImpl_default, vue.mergeProps(vue.unref(itemProps), { id: vue.unref(subContext).triggerId, ref: (vnode) => { var _a2; if (!vnode) return void 0; (_a2 = vue.unref(subContext)) == null ? void 0 : _a2.onTriggerChange(vnode == null ? void 0 : vnode.$el); return void 0; }, "aria-haspopup": "menu", "aria-expanded": vue.unref(menuContext).open.value, "aria-controls": vue.unref(subContext).contentId, "data-state": vue.unref(getOpenState$1)(vue.unref(menuContext).open.value), onClick: _cache[0] || (_cache[0] = async (event) => { var _a2; if (props.disabled || event.defaultPrevented) return; (_a2 = event.currentTarget) == null ? void 0 : _a2.focus(); if (!vue.unref(menuContext).open.value) vue.unref(menuContext).onOpenChange(true); }), onPointermove: handlePointerMove, onPointerleave: handlePointerLeave, onKeydown: handleKeyDown }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "aria-expanded", "aria-controls", "data-state" ])]), _: 3 }); }; } }); var MenuSubTrigger_default = MenuSubTrigger_vue_vue_type_script_setup_true_lang_default; const [injectPopoverRootContext, providePopoverRootContext] = createContext("PopoverRoot"); var PopoverRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "PopoverRoot", props: { defaultOpen: { type: Boolean, required: false, default: false }, open: { type: Boolean, required: false, default: void 0 }, modal: { type: Boolean, required: false, default: false } }, emits: ["update:open"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; const { modal } = vue.toRefs(props); const open = useVModel(props, "open", emit2, { defaultValue: props.defaultOpen, passive: props.open === void 0 }); const triggerElement = vue.ref(); const hasCustomAnchor = vue.ref(false); providePopoverRootContext({ contentId: "", triggerId: "", modal, open, onOpenChange: (value) => { open.value = value; }, onOpenToggle: () => { open.value = !open.value; }, triggerElement, hasCustomAnchor }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperRoot_default), null, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open), close: () => open.value = false })]), _: 3 }); }; } }); var PopoverRoot_default = PopoverRoot_vue_vue_type_script_setup_true_lang_default; var PopoverAnchor_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "PopoverAnchor", props: { reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; useForwardExpose(); const rootContext = injectPopoverRootContext(); vue.onBeforeMount(() => { rootContext.hasCustomAnchor.value = true; }); vue.onUnmounted(() => { rootContext.hasCustomAnchor.value = false; }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperAnchor_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var PopoverAnchor_default = PopoverAnchor_vue_vue_type_script_setup_true_lang_default; var PopoverArrow_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "PopoverArrow", props: { width: { type: Number, required: false, default: 10 }, height: { type: Number, required: false, default: 5 }, rounded: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "svg" } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperArrow_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var PopoverArrow_default = PopoverArrow_vue_vue_type_script_setup_true_lang_default; var PopoverContentImpl_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "PopoverContentImpl", props: { trapFocus: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, dir: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardProps$1(reactiveOmit(props, "trapFocus", "disableOutsidePointerEvents")); const { forwardRef } = useForwardExpose(); const rootContext = injectPopoverRootContext(); useFocusGuards(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(FocusScope_default), { "as-child": "", loop: "", trapped: __props.trapFocus, onMountAutoFocus: _cache[5] || (_cache[5] = ($event) => emits("openAutoFocus", $event)), onUnmountAutoFocus: _cache[6] || (_cache[6] = ($event) => emits("closeAutoFocus", $event)) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(DismissableLayer_default), { "as-child": "", "disable-outside-pointer-events": __props.disableOutsidePointerEvents, onPointerDownOutside: _cache[0] || (_cache[0] = ($event) => emits("pointerDownOutside", $event)), onInteractOutside: _cache[1] || (_cache[1] = ($event) => emits("interactOutside", $event)), onEscapeKeyDown: _cache[2] || (_cache[2] = ($event) => emits("escapeKeyDown", $event)), onFocusOutside: _cache[3] || (_cache[3] = ($event) => emits("focusOutside", $event)), onDismiss: _cache[4] || (_cache[4] = ($event) => vue.unref(rootContext).onOpenChange(false)) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(PopperContent_default), vue.mergeProps(vue.unref(forwarded), { id: vue.unref(rootContext).contentId, ref: vue.unref(forwardRef), "data-state": vue.unref(rootContext).open.value ? "open" : "closed", "aria-labelledby": vue.unref(rootContext).triggerId, style: { "--reka-popover-content-transform-origin": "var(--reka-popper-transform-origin)", "--reka-popover-content-available-width": "var(--reka-popper-available-width)", "--reka-popover-content-available-height": "var(--reka-popper-available-height)", "--reka-popover-trigger-width": "var(--reka-popper-anchor-width)", "--reka-popover-trigger-height": "var(--reka-popper-anchor-height)" }, role: "dialog" }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "data-state", "aria-labelledby" ])]), _: 3 }, 8, ["disable-outside-pointer-events"])]), _: 3 }, 8, ["trapped"]); }; } }); var PopoverContentImpl_default = PopoverContentImpl_vue_vue_type_script_setup_true_lang_default; var PopoverContentModal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "PopoverContentModal", props: { memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, dir: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectPopoverRootContext(); const isRightClickOutsideRef = vue.ref(false); useBodyScrollLock(true); const forwarded = useForwardPropsEmits(props, emits); const { forwardRef, currentElement } = useForwardExpose(); useHideOthers(currentElement); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(PopoverContentImpl_default, vue.mergeProps(vue.unref(forwarded), { ref: vue.unref(forwardRef), "trap-focus": vue.unref(rootContext).open.value, "disable-outside-pointer-events": "", onCloseAutoFocus: _cache[0] || (_cache[0] = vue.withModifiers((event) => { var _a2; emits("closeAutoFocus", event); if (!isRightClickOutsideRef.value) (_a2 = vue.unref(rootContext).triggerElement.value) == null ? void 0 : _a2.focus(); }, ["prevent"])), onPointerDownOutside: _cache[1] || (_cache[1] = (event) => { emits("pointerDownOutside", event); const originalEvent = event.detail.originalEvent; const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; const isRightClick = originalEvent.button === 2 || ctrlLeftClick; isRightClickOutsideRef.value = isRightClick; }), onFocusOutside: _cache[2] || (_cache[2] = vue.withModifiers(() => { }, ["prevent"])) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["trap-focus"]); }; } }); var PopoverContentModal_default = PopoverContentModal_vue_vue_type_script_setup_true_lang_default; var PopoverContentNonModal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "PopoverContentNonModal", props: { memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, dir: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectPopoverRootContext(); const hasInteractedOutsideRef = vue.ref(false); const hasPointerDownOutsideRef = vue.ref(false); const forwarded = useForwardPropsEmits(props, emits); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(PopoverContentImpl_default, vue.mergeProps(vue.unref(forwarded), { "trap-focus": false, "disable-outside-pointer-events": false, onCloseAutoFocus: _cache[0] || (_cache[0] = (event) => { var _a2; emits("closeAutoFocus", event); if (!event.defaultPrevented) { if (!hasInteractedOutsideRef.value) (_a2 = vue.unref(rootContext).triggerElement.value) == null ? void 0 : _a2.focus(); event.preventDefault(); } hasInteractedOutsideRef.value = false; hasPointerDownOutsideRef.value = false; }), onInteractOutside: _cache[1] || (_cache[1] = async (event) => { var _a2; emits("interactOutside", event); if (!event.defaultPrevented) { hasInteractedOutsideRef.value = true; if (event.detail.originalEvent.type === "pointerdown") hasPointerDownOutsideRef.value = true; } const target = event.target; const targetIsTrigger = (_a2 = vue.unref(rootContext).triggerElement.value) == null ? void 0 : _a2.contains(target); if (targetIsTrigger) event.preventDefault(); if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.value) event.preventDefault(); }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var PopoverContentNonModal_default = PopoverContentNonModal_vue_vue_type_script_setup_true_lang_default; var PopoverContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "PopoverContent", props: { forceMount: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, dir: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectPopoverRootContext(); const forwarded = useForwardPropsEmits(props, emits); const { forwardRef } = useForwardExpose(); rootContext.contentId || (rootContext.contentId = useId(void 0, "reka-popover-content")); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || vue.unref(rootContext).open.value }, { default: vue.withCtx(() => [vue.unref(rootContext).modal.value ? (vue.openBlock(), vue.createBlock(PopoverContentModal_default, vue.mergeProps({ key: 0 }, vue.unref(forwarded), { ref: vue.unref(forwardRef) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16)) : (vue.openBlock(), vue.createBlock(PopoverContentNonModal_default, vue.mergeProps({ key: 1 }, vue.unref(forwarded), { ref: vue.unref(forwardRef) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16))]), _: 3 }, 8, ["present"]); }; } }); var PopoverContent_default = PopoverContent_vue_vue_type_script_setup_true_lang_default; var PopoverPortal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "PopoverPortal", props: { to: { type: null, required: false }, disabled: { type: Boolean, required: false }, defer: { type: Boolean, required: false }, forceMount: { type: Boolean, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Teleport_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var PopoverPortal_default = PopoverPortal_vue_vue_type_script_setup_true_lang_default; var PopoverTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "PopoverTrigger", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; const rootContext = injectPopoverRootContext(); const { forwardRef, currentElement: triggerElement } = useForwardExpose(); rootContext.triggerId || (rootContext.triggerId = useId(void 0, "reka-popover-trigger")); rootContext.contentId || (rootContext.contentId = useId(void 0, "reka-popover-content")); vue.onMounted(() => { rootContext.triggerElement.value = triggerElement.value; }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(rootContext).hasCustomAnchor.value ? vue.unref(Primitive) : vue.unref(PopperAnchor_default)), { "as-child": "" }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { id: vue.unref(rootContext).triggerId, ref: vue.unref(forwardRef), type: __props.as === "button" ? "button" : void 0, "aria-haspopup": "dialog", "aria-expanded": vue.unref(rootContext).open.value, "aria-controls": vue.unref(rootContext).open.value ? vue.unref(rootContext).contentId : void 0, "data-state": vue.unref(rootContext).open.value ? "open" : "closed", as: __props.as, "as-child": props.asChild, onClick: vue.unref(rootContext).onOpenToggle }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "id", "type", "aria-expanded", "aria-controls", "data-state", "as", "as-child", "onClick" ])]), _: 3 }); }; } }); var PopoverTrigger_default = PopoverTrigger_vue_vue_type_script_setup_true_lang_default; var DropdownMenuArrow_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuArrow", props: { width: { type: Number, required: false, default: 10 }, height: { type: Number, required: false, default: 5 }, rounded: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "svg" } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuArrow_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DropdownMenuArrow_default = DropdownMenuArrow_vue_vue_type_script_setup_true_lang_default; var DropdownMenuCheckboxItem_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuCheckboxItem", props: { modelValue: { type: [Boolean, String], required: false }, disabled: { type: Boolean, required: false }, textValue: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["select", "update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const emitsAsProps = useEmitAsProps(emits); useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuCheckboxItem_default), vue.normalizeProps(vue.guardReactiveProps({ ...props, ...vue.unref(emitsAsProps) })), { default: vue.withCtx((slotProps) => [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(slotProps)))]), _: 3 }, 16); }; } }); var DropdownMenuCheckboxItem_default = DropdownMenuCheckboxItem_vue_vue_type_script_setup_true_lang_default; const [injectDropdownMenuRootContext, provideDropdownMenuRootContext] = createContext("DropdownMenuRoot"); var DropdownMenuRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuRoot", props: { defaultOpen: { type: Boolean, required: false }, open: { type: Boolean, required: false, default: void 0 }, dir: { type: String, required: false }, modal: { type: Boolean, required: false, default: true } }, emits: ["update:open"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; useForwardExpose(); const open = useVModel(props, "open", emit2, { defaultValue: props.defaultOpen, passive: props.open === void 0 }); const triggerElement = vue.ref(); const { modal, dir: propDir } = vue.toRefs(props); const dir = useDirection(propDir); provideDropdownMenuRootContext({ open, onOpenChange: (value) => { open.value = value; }, onOpenToggle: () => { open.value = !open.value; }, triggerId: "", triggerElement, contentId: "", modal, dir }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuRoot_default), { open: vue.unref(open), "onUpdate:open": _cache[0] || (_cache[0] = ($event) => vue.isRef(open) ? open.value = $event : null), dir: vue.unref(dir), modal: vue.unref(modal) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open) })]), _: 3 }, 8, [ "open", "dir", "modal" ]); }; } }); var DropdownMenuRoot_default = DropdownMenuRoot_vue_vue_type_script_setup_true_lang_default; var DropdownMenuContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "DropdownMenuContent", props: { forceMount: { type: Boolean, required: false }, loop: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardPropsEmits(props, emits); useForwardExpose(); const rootContext = injectDropdownMenuRootContext(); const hasInteractedOutsideRef = vue.ref(false); function handleCloseAutoFocus(event) { if (event.defaultPrevented) return; if (!hasInteractedOutsideRef.value) setTimeout(() => { var _a2; (_a2 = rootContext.triggerElement.value) == null ? void 0 : _a2.focus(); }, 0); hasInteractedOutsideRef.value = false; event.preventDefault(); } rootContext.contentId || (rootContext.contentId = useId(void 0, "reka-dropdown-menu-content")); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(MenuContent_default), vue.mergeProps({ id: vue.unref(rootContext).contentId, "aria-labelledby": (_a2 = vue.unref(rootContext)) == null ? void 0 : _a2.triggerId, style: { "--reka-dropdown-menu-content-transform-origin": "var(--reka-popper-transform-origin)", "--reka-dropdown-menu-content-available-width": "var(--reka-popper-available-width)", "--reka-dropdown-menu-content-available-height": "var(--reka-popper-available-height)", "--reka-dropdown-menu-trigger-width": "var(--reka-popper-anchor-width)", "--reka-dropdown-menu-trigger-height": "var(--reka-popper-anchor-height)" } }, { ...vue.unref(forwarded), ...vue.unref(omitEntryFocusListener)(_ctx.$attrs) }, { onCloseAutoFocus: handleCloseAutoFocus, onInteractOutside: _cache[0] || (_cache[0] = (event) => { var _a3; if (event.defaultPrevented) return; const originalEvent = event.detail.originalEvent; const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; const isRightClick = originalEvent.button === 2 || ctrlLeftClick; if (!vue.unref(rootContext).modal.value || isRightClick) hasInteractedOutsideRef.value = true; if ((_a3 = vue.unref(rootContext).triggerElement.value) == null ? void 0 : _a3.contains(event.target)) event.preventDefault(); }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["id", "aria-labelledby"]); }; } }); var DropdownMenuContent_default = DropdownMenuContent_vue_vue_type_script_setup_true_lang_default; var DropdownMenuFilter_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuFilter", props: { modelValue: { type: String, required: false }, autoFocus: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "input" } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const modelValue = useVModel(props, "modelValue", emits, { defaultValue: "", passive: props.modelValue === void 0 }); const rootContext = injectMenuRootContext(); const contentContext = injectMenuContentContext(); const subContext = injectMenuSubContext(null); vue.watch(modelValue, (v) => { contentContext.searchRef.value = v != null ? v : ""; }, { immediate: true }); const { primitiveElement, currentElement } = usePrimitiveElement(); const disabled = vue.computed(() => props.disabled || false); const activedescendant = vue.ref(); vue.watchSyncEffect(() => { var _a2; return activedescendant.value = (_a2 = contentContext.highlightedElement.value) == null ? void 0 : _a2.id; }); vue.onMounted(() => { contentContext.onFilterElementChange(currentElement.value); setTimeout(() => { var _a2; if (props.autoFocus) { const isSubmenu = !!subContext; if (!isSubmenu || rootContext.isUsingKeyboardRef.value) (_a2 = currentElement.value) == null ? void 0 : _a2.focus(); } }, 1); }); vue.onUnmounted(() => { contentContext.onFilterElementChange(void 0); contentContext.searchRef.value = ""; }); const { isComposing, shouldDeferInput, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposing((event) => { const el = event.target; if (el) { modelValue.value = el.value; contentContext.searchRef.value = el.value; } }); function handleInput(event) { if (disabled.value) return; if (shouldDeferInput.value) return; const target = event.target; modelValue.value = target.value; contentContext.searchRef.value = target.value; } function handleKeyDown(event) { if (disabled.value) return; if (isComposing.value) { event.stopPropagation(); return; } if ([ "ArrowDown", "ArrowUp", "Home", "End" ].includes(event.key)) { event.preventDefault(); contentContext.onKeydownNavigation(event); } else if (event.key === "Enter") { event.preventDefault(); contentContext.onKeydownEnter(event); } else if (event.key === "Escape" && modelValue.value) { event.stopPropagation(); modelValue.value = ""; contentContext.searchRef.value = ""; } } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { ref_key: "primitiveElement", ref: primitiveElement, as: __props.as, "as-child": __props.asChild, value: vue.unref(modelValue), disabled: disabled.value ? "" : void 0, "data-disabled": disabled.value ? "" : void 0, "aria-disabled": disabled.value ? true : void 0, "aria-activedescendant": activedescendant.value, type: "text", role: "searchbox", onInput: handleInput, onKeydown: handleKeyDown, onCompositionstart: vue.unref(handleCompositionStart), onCompositionupdate: vue.unref(handleCompositionUpdate), onCompositionend: vue.unref(handleCompositionEnd) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue) })]), _: 3 }, 8, [ "as", "as-child", "value", "disabled", "data-disabled", "aria-disabled", "aria-activedescendant", "onCompositionstart", "onCompositionupdate", "onCompositionend" ]); }; } }); var DropdownMenuFilter_default = DropdownMenuFilter_vue_vue_type_script_setup_true_lang_default; var DropdownMenuGroup_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuGroup", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuGroup_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DropdownMenuGroup_default = DropdownMenuGroup_vue_vue_type_script_setup_true_lang_default; var DropdownMenuItem_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuItem", props: { disabled: { type: Boolean, required: false }, textValue: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["select"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const emitsAsProps = useEmitAsProps(emits); useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuItem_default), vue.normalizeProps(vue.guardReactiveProps({ ...props, ...vue.unref(emitsAsProps) })), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DropdownMenuItem_default = DropdownMenuItem_vue_vue_type_script_setup_true_lang_default; var DropdownMenuItemIndicator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuItemIndicator", props: { forceMount: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuItemIndicator_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DropdownMenuItemIndicator_default = DropdownMenuItemIndicator_vue_vue_type_script_setup_true_lang_default; var DropdownMenuLabel_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuLabel", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuLabel_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DropdownMenuLabel_default = DropdownMenuLabel_vue_vue_type_script_setup_true_lang_default; var DropdownMenuPortal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuPortal", props: { to: { type: null, required: false }, disabled: { type: Boolean, required: false }, defer: { type: Boolean, required: false }, forceMount: { type: Boolean, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuPortal_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DropdownMenuPortal_default = DropdownMenuPortal_vue_vue_type_script_setup_true_lang_default; var DropdownMenuSeparator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuSeparator", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuSeparator_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DropdownMenuSeparator_default = DropdownMenuSeparator_vue_vue_type_script_setup_true_lang_default; var DropdownMenuSub_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuSub", props: { defaultOpen: { type: Boolean, required: false }, open: { type: Boolean, required: false, default: void 0 } }, emits: ["update:open"], setup(__props, { emit: __emit }) { var _a2; const props = __props; const emit2 = __emit; const open = useVModel(props, "open", emit2, { passive: props.open === void 0, defaultValue: (_a2 = props.defaultOpen) != null ? _a2 : false }); useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuSub_default), { open: vue.unref(open), "onUpdate:open": _cache[0] || (_cache[0] = ($event) => vue.isRef(open) ? open.value = $event : null) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open) })]), _: 3 }, 8, ["open"]); }; } }); var DropdownMenuSub_default = DropdownMenuSub_vue_vue_type_script_setup_true_lang_default; var DropdownMenuSubContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuSubContent", props: { forceMount: { type: Boolean, required: false }, loop: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "entryFocus", "openAutoFocus", "closeAutoFocus" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardPropsEmits(props, emits); useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuSubContent_default), vue.mergeProps(vue.unref(forwarded), { style: { "--reka-dropdown-menu-content-transform-origin": "var(--reka-popper-transform-origin)", "--reka-dropdown-menu-content-available-width": "var(--reka-popper-available-width)", "--reka-dropdown-menu-content-available-height": "var(--reka-popper-available-height)", "--reka-dropdown-menu-trigger-width": "var(--reka-popper-anchor-width)", "--reka-dropdown-menu-trigger-height": "var(--reka-popper-anchor-height)" } }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DropdownMenuSubContent_default = DropdownMenuSubContent_vue_vue_type_script_setup_true_lang_default; var DropdownMenuSubTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuSubTrigger", props: { graceDuration: { type: Number, required: false }, disabled: { type: Boolean, required: false }, textValue: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuSubTrigger_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var DropdownMenuSubTrigger_default = DropdownMenuSubTrigger_vue_vue_type_script_setup_true_lang_default; var DropdownMenuTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "DropdownMenuTrigger", props: { disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; const rootContext = injectDropdownMenuRootContext(); const { forwardRef, currentElement: triggerElement } = useForwardExpose(); vue.onMounted(() => { rootContext.triggerElement = triggerElement; }); rootContext.triggerId || (rootContext.triggerId = useId(void 0, "reka-dropdown-menu-trigger")); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(MenuAnchor_default), { "as-child": "" }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { id: vue.unref(rootContext).triggerId, ref: vue.unref(forwardRef), type: __props.as === "button" ? "button" : void 0, "as-child": props.asChild, as: __props.as, "aria-haspopup": "menu", "aria-expanded": vue.unref(rootContext).open.value, "aria-controls": vue.unref(rootContext).open.value ? vue.unref(rootContext).contentId : void 0, "data-disabled": __props.disabled ? "" : void 0, disabled: __props.disabled, "data-state": vue.unref(rootContext).open.value ? "open" : "closed", onClick: _cache[0] || (_cache[0] = async (event) => { var _a2; if (event.defaultPrevented) return; if (!__props.disabled && event.button === 0 && event.ctrlKey === false) { (_a2 = vue.unref(rootContext)) == null ? void 0 : _a2.onOpenToggle(); await vue.nextTick(); if (vue.unref(rootContext).open.value) event.preventDefault(); } }), onKeydown: _cache[1] || (_cache[1] = vue.withKeys((event) => { if (__props.disabled || event.defaultPrevented) return; if (["Enter", " "].includes(event.key)) vue.unref(rootContext).onOpenToggle(); if (event.key === "ArrowDown") vue.unref(rootContext).onOpenChange(true); if ([ "Enter", " ", "ArrowDown" ].includes(event.key)) event.preventDefault(); }, [ "enter", "space", "arrow-down" ])) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "id", "type", "as-child", "as", "aria-expanded", "aria-controls", "data-disabled", "disabled", "data-state" ])]), _: 3 }); }; } }); var DropdownMenuTrigger_default = DropdownMenuTrigger_vue_vue_type_script_setup_true_lang_default; var HoverCardArrow_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "HoverCardArrow", props: { width: { type: Number, required: false, default: 10 }, height: { type: Number, required: false, default: 5 }, rounded: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "svg" } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperArrow_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var HoverCardArrow_default = HoverCardArrow_vue_vue_type_script_setup_true_lang_default; const [injectHoverCardRootContext, provideHoverCardRootContext] = createContext("HoverCardRoot"); var HoverCardRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "HoverCardRoot", props: { defaultOpen: { type: Boolean, required: false, default: false }, open: { type: Boolean, required: false, default: void 0 }, openDelay: { type: Number, required: false, default: 700 }, closeDelay: { type: Number, required: false, default: 300 }, enableTouch: { type: Boolean, required: false, default: false } }, emits: ["update:open"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; const { openDelay, closeDelay, enableTouch } = vue.toRefs(props); useForwardExpose(); const open = useVModel(props, "open", emit2, { defaultValue: props.defaultOpen, passive: props.open === void 0 }); const openTimerRef = vue.ref(0); const closeTimerRef = vue.ref(0); const hasSelectionRef = vue.ref(false); const isPointerDownOnContentRef = vue.ref(false); const isPointerInTransitRef = vue.ref(false); const triggerElement = vue.ref(); function handleOpen() { clearTimeout(closeTimerRef.value); openTimerRef.value = window.setTimeout(() => open.value = true, openDelay.value); } function handleClose() { clearTimeout(openTimerRef.value); if (!hasSelectionRef.value && !isPointerDownOnContentRef.value) closeTimerRef.value = window.setTimeout(() => open.value = false, closeDelay.value); } function handleDismiss() { clearTimeout(openTimerRef.value); open.value = false; } provideHoverCardRootContext({ open, onOpenChange(value) { open.value = value; }, onOpen: handleOpen, onClose: handleClose, onDismiss: handleDismiss, hasSelectionRef, isPointerDownOnContentRef, isPointerInTransitRef, triggerElement, enableTouch }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperRoot_default), null, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open) })]), _: 3 }); }; } }); var HoverCardRoot_default = HoverCardRoot_vue_vue_type_script_setup_true_lang_default; function excludeTouch(eventHandler) { return (event) => event.pointerType === "touch" ? void 0 : eventHandler(); } function getTabbableNodes(container) { const nodes = []; const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => { return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); while (walker.nextNode()) nodes.push(walker.currentNode); return nodes; } var HoverCardContentImpl_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "HoverCardContentImpl", props: { memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, dir: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardProps$1(props); const { forwardRef, currentElement: contentElement } = useForwardExpose(); const rootContext = injectHoverCardRootContext(); const { isPointerInTransit, onPointerExit } = useGraceArea(rootContext.triggerElement, contentElement); syncRef(rootContext.isPointerInTransitRef, isPointerInTransit, { direction: "rtl" }); onPointerExit(() => { rootContext.onClose(); }); const containSelection = vue.ref(false); let originalBodyUserSelect; vue.watchEffect((cleanupFn) => { if (containSelection.value) { const body = document.body; originalBodyUserSelect = body.style.userSelect || body.style.webkitUserSelect; body.style.userSelect = "none"; body.style.webkitUserSelect = "none"; cleanupFn(() => { body.style.userSelect = originalBodyUserSelect; body.style.webkitUserSelect = originalBodyUserSelect; }); } }); function handlePointerUp() { containSelection.value = false; rootContext.isPointerDownOnContentRef.value = false; vue.nextTick(() => { var _a2; const hasSelection = ((_a2 = document.getSelection()) == null ? void 0 : _a2.toString()) !== ""; if (hasSelection) rootContext.hasSelectionRef.value = true; }); } vue.onMounted(() => { if (contentElement.value) { document.addEventListener("pointerup", handlePointerUp); const tabbables = getTabbableNodes(contentElement.value); tabbables.forEach((tabbable) => tabbable.setAttribute("tabindex", "-1")); } useEventListener(window, "scroll", (event) => { const target = event.target; if (target == null ? void 0 : target.contains(rootContext.triggerElement.value)) rootContext.onDismiss(); }, { capture: true }); }); vue.onUnmounted(() => { document.removeEventListener("pointerup", handlePointerUp); rootContext.hasSelectionRef.value = false; rootContext.isPointerDownOnContentRef.value = false; }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(DismissableLayer_default), { "as-child": "", "disable-outside-pointer-events": false, onEscapeKeyDown: _cache[1] || (_cache[1] = ($event) => emits("escapeKeyDown", $event)), onPointerDownOutside: _cache[2] || (_cache[2] = ($event) => emits("pointerDownOutside", $event)), onFocusOutside: _cache[3] || (_cache[3] = vue.withModifiers(($event) => emits("focusOutside", $event), ["prevent"])), onDismiss: vue.unref(rootContext).onDismiss }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(PopperContent_default), vue.mergeProps({ ...vue.unref(forwarded), ..._ctx.$attrs }, { ref: vue.unref(forwardRef), "data-state": vue.unref(rootContext).open.value ? "open" : "closed", style: { "userSelect": containSelection.value ? "text" : void 0, "WebkitUserSelect": containSelection.value ? "text" : void 0, "--reka-hover-card-content-transform-origin": "var(--reka-popper-transform-origin)", "--reka-hover-card-content-available-width": "var(--reka-popper-available-width)", "--reka-hover-card-content-available-height": "var(--reka-popper-available-height)", "--reka-hover-card-trigger-width": "var(--reka-popper-anchor-width)", "--reka-hover-card-trigger-height": "var(--reka-popper-anchor-height)" }, onPointerdown: _cache[0] || (_cache[0] = (event) => { if (event.currentTarget.contains(event.target)) containSelection.value = true; vue.unref(rootContext).hasSelectionRef.value = false; vue.unref(rootContext).isPointerDownOnContentRef.value = true; }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["data-state", "style"])]), _: 3 }, 8, ["onDismiss"]); }; } }); var HoverCardContentImpl_default = HoverCardContentImpl_vue_vue_type_script_setup_true_lang_default; var HoverCardContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "HoverCardContent", props: { forceMount: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, dir: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardPropsEmits(props, emits); const { forwardRef } = useForwardExpose(); const rootContext = injectHoverCardRootContext(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || vue.unref(rootContext).open.value }, { default: vue.withCtx(() => [vue.createVNode(HoverCardContentImpl_default, vue.mergeProps(vue.unref(forwarded), { ref: vue.unref(forwardRef), onPointerenter: _cache[0] || (_cache[0] = ($event) => vue.unref(excludeTouch)(vue.unref(rootContext).onOpen)($event)) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16)]), _: 3 }, 8, ["present"]); }; } }); var HoverCardContent_default = HoverCardContent_vue_vue_type_script_setup_true_lang_default; var HoverCardPortal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "HoverCardPortal", props: { to: { type: null, required: false }, disabled: { type: Boolean, required: false }, defer: { type: Boolean, required: false }, forceMount: { type: Boolean, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Teleport_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var HoverCardPortal_default = HoverCardPortal_vue_vue_type_script_setup_true_lang_default; var HoverCardTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "HoverCardTrigger", props: { reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "a" } }, setup(__props) { const { forwardRef, currentElement } = useForwardExpose(); const rootContext = injectHoverCardRootContext(); rootContext.triggerElement = currentElement; function handleLeave() { setTimeout(() => { if (!rootContext.isPointerInTransitRef.value && !rootContext.open.value) rootContext.onClose(); }, 0); } function handleTouch(event) { if (!rootContext.enableTouch.value || event.pointerType !== "touch") return; if (rootContext.open.value) rootContext.onDismiss(); else rootContext.onOpenChange(true); } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperAnchor_default), { "as-child": "", reference: __props.reference }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { ref: vue.unref(forwardRef), "as-child": __props.asChild, as: __props.as, "data-state": vue.unref(rootContext).open.value ? "open" : "closed", "data-grace-area-trigger": "", onPointerenter: _cache[0] || (_cache[0] = ($event) => vue.unref(excludeTouch)(vue.unref(rootContext).onOpen)($event)), onPointerleave: _cache[1] || (_cache[1] = ($event) => vue.unref(excludeTouch)(handleLeave)($event)), onPointerup: handleTouch, onFocus: _cache[2] || (_cache[2] = ($event) => vue.unref(rootContext).onOpen()), onBlur: _cache[3] || (_cache[3] = ($event) => vue.unref(rootContext).onClose()) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as-child", "as", "data-state" ])]), _: 3 }, 8, ["reference"]); }; } }); var HoverCardTrigger_default = HoverCardTrigger_vue_vue_type_script_setup_true_lang_default; function getOpenState(open) { return open ? "open" : "closed"; } function makeTriggerId$1(baseId, value) { return `${baseId}-trigger-${value}`; } function makeContentId$1(baseId, value) { return `${baseId}-content-${value}`; } const LINK_SELECT = "navigationMenu.linkSelect"; const EVENT_ROOT_CONTENT_DISMISS = "navigationMenu.rootContentDismiss"; function getTabbableCandidates(container) { const nodes = []; const walker = document.createTreeWalker(container, 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 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); while (walker.nextNode()) nodes.push(walker.currentNode); return nodes; } function focusFirst(candidates) { const previouslyFocusedElement = getActiveElement(); return candidates.some((candidate) => { if (candidate === previouslyFocusedElement) return true; candidate.focus(); return getActiveElement() !== previouslyFocusedElement; }); } function removeFromTabOrder(candidates) { candidates.forEach((candidate) => { candidate.dataset.tabindex = candidate.getAttribute("tabindex") || ""; candidate.setAttribute("tabindex", "-1"); }); return () => { candidates.forEach((candidate) => { const prevTabIndex = candidate.dataset.tabindex; candidate.setAttribute("tabindex", prevTabIndex); }); }; } function whenMouse(handler) { return (event) => event.pointerType === "mouse" ? handler(event) : void 0; } const [injectNavigationMenuContext, provideNavigationMenuContext] = createContext(["NavigationMenuRoot", "NavigationMenuSub"], "NavigationMenuContext"); var NavigationMenuRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "NavigationMenuRoot", props: { modelValue: { type: String, required: false, default: void 0 }, defaultValue: { type: String, required: false }, dir: { type: String, required: false }, orientation: { type: String, required: false, default: "horizontal" }, delayDuration: { type: Number, required: false, default: 200 }, skipDelayDuration: { type: Number, required: false, default: 300 }, disableClickTrigger: { type: Boolean, required: false, default: false }, disableHoverTrigger: { type: Boolean, required: false, default: false }, disablePointerLeaveClose: { type: Boolean, required: false }, unmountOnHide: { type: Boolean, required: false, default: true }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "nav" } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { var _a2; const props = __props; const emits = __emit; const modelValue = useVModel(props, "modelValue", emits, { defaultValue: (_a2 = props.defaultValue) != null ? _a2 : "", passive: props.modelValue === void 0 }); const previousValue = vue.ref(""); const { forwardRef, currentElement: rootNavigationMenu } = useForwardExpose(); const indicatorTrack = vue.ref(); const viewport = vue.ref(); const activeTrigger = vue.ref(); const { getItems, CollectionSlot } = useCollection({ key: "NavigationMenu", isProvider: true }); const { delayDuration, skipDelayDuration, dir: propDir, disableClickTrigger, disableHoverTrigger, unmountOnHide } = vue.toRefs(props); const dir = useDirection(propDir); const isDelaySkipped = refAutoReset(false, skipDelayDuration); const skipNextClose = vue.ref(false); const computedDelay = vue.computed(() => { const isOpen = modelValue.value !== ""; if (isOpen || isDelaySkipped.value) return 150; else return delayDuration.value; }); const debouncedFn = useDebounceFn((val) => { if (typeof val === "string") { if (val === "" && skipNextClose.value) { skipNextClose.value = false; return; } previousValue.value = modelValue.value; modelValue.value = val; if (val === "") isDelaySkipped.value = true; } }, computedDelay); vue.watchEffect(() => { if (!modelValue.value) return; const items = getItems().map((i) => i.ref); activeTrigger.value = items.find((item) => item.id.includes(modelValue.value)); }); useEventListener(rootNavigationMenu, EVENT_ROOT_CONTENT_DISMISS, onItemDismiss); provideNavigationMenuContext({ isRootMenu: true, modelValue, previousValue, baseId: useId(void 0, "reka-navigation-menu"), disableClickTrigger, disableHoverTrigger, dir, unmountOnHide, orientation: props.orientation, rootNavigationMenu, indicatorTrack, activeTrigger, onIndicatorTrackChange: (val) => { indicatorTrack.value = val; }, viewport, onViewportChange: (val) => { viewport.value = val; }, onTriggerEnter: (val) => { if (modelValue.value !== "") { skipNextClose.value = true; previousValue.value = modelValue.value; modelValue.value = val; } else debouncedFn(val); }, onTriggerLeave: () => { skipNextClose.value = false; debouncedFn(""); }, onContentEnter: () => { debouncedFn(); }, onContentLeave: () => { if (!props.disablePointerLeaveClose) { skipNextClose.value = false; debouncedFn(""); } }, onItemSelect: (val) => { previousValue.value = modelValue.value; modelValue.value = val; }, onItemDismiss }); function onItemDismiss() { previousValue.value = modelValue.value; modelValue.value = ""; } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollectionSlot), null, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { ref: vue.unref(forwardRef), as: __props.as, "as-child": __props.asChild, "data-orientation": __props.orientation, dir: vue.unref(dir), "data-reka-navigation-menu": "" }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue) })]), _: 3 }, 8, [ "as", "as-child", "data-orientation", "dir" ])]), _: 3 }); }; } }); var NavigationMenuRoot_default = NavigationMenuRoot_vue_vue_type_script_setup_true_lang_default; const [injectNavigationMenuItemContext, provideNavigationMenuItemContext] = createContext("NavigationMenuItem"); var NavigationMenuItem_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "NavigationMenuItem", props: { value: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "li" } }, setup(__props) { const props = __props; useForwardExpose(); const { getItems } = useCollection({ key: "NavigationMenu" }); const context2 = injectNavigationMenuContext(); const value = useId(props.value); const triggerRef$1 = vue.ref(); const focusProxyRef = vue.ref(); const contentId = makeContentId$1(context2.baseId, value); let restoreContentTabOrderRef = () => ({}); const wasEscapeCloseRef = vue.ref(false); async function handleContentEntry(side = "start") { const el = document.getElementById(contentId); if (el) { restoreContentTabOrderRef(); const candidates = getTabbableCandidates(el); if (candidates.length) focusFirst(side === "start" ? candidates : candidates.reverse()); } } function handleContentExit() { const el = document.getElementById(contentId); if (el) { const candidates = getTabbableCandidates(el); if (candidates.length) restoreContentTabOrderRef = removeFromTabOrder(candidates); } } provideNavigationMenuItemContext({ value, contentId, triggerRef: triggerRef$1, focusProxyRef, wasEscapeCloseRef, onEntryKeyDown: handleContentEntry, onFocusProxyEnter: handleContentEntry, onContentFocusOutside: handleContentExit, onRootContentClose: handleContentExit }); function handleClose() { var _a2; context2.onItemDismiss(); (_a2 = triggerRef$1.value) == null ? void 0 : _a2.focus(); } function handleKeydown(ev) { const currentFocus = getActiveElement(); if (ev.keyCode === 32 || ev.key === "Enter") if (context2.modelValue.value === value) { handleClose(); ev.preventDefault(); return; } else { ev.target.click(); ev.preventDefault(); return; } const itemsArray = getItems().filter((i) => { var _a2; return (_a2 = i.ref.parentElement) == null ? void 0 : _a2.hasAttribute("data-menu-item"); }).map((i) => i.ref); if (!itemsArray.includes(currentFocus)) return; const newSelectedElement = useArrowNavigation(ev, currentFocus, void 0, { itemsArray, loop: false }); if (newSelectedElement) newSelectedElement == null ? void 0 : newSelectedElement.focus(); ev.preventDefault(); ev.stopPropagation(); } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { "as-child": __props.asChild, as: __props.as, "data-menu-item": "", onKeydown: vue.withKeys(handleKeydown, [ "up", "down", "left", "right", "home", "end", "space" ]) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, ["as-child", "as"]); }; } }); var NavigationMenuItem_default = NavigationMenuItem_vue_vue_type_script_setup_true_lang_default; var NavigationMenuContentImpl_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "NavigationMenuContentImpl", props: { disableOutsidePointerEvents: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { getItems } = useCollection({ key: "NavigationMenu" }); const { forwardRef, currentElement } = useForwardExpose(); const menuContext = injectNavigationMenuContext(); const itemContext = injectNavigationMenuItemContext(); const triggerId = makeTriggerId$1(menuContext.baseId, itemContext.value); const contentId = makeContentId$1(menuContext.baseId, itemContext.value); const prevMotionAttributeRef = vue.ref(null); const motionAttribute = vue.computed(() => { const values = getItems().map((i) => i.ref.id.split("trigger-")[1]); if (menuContext.dir.value === "rtl") values.reverse(); const index = values.indexOf(menuContext.modelValue.value); const prevIndex = values.indexOf(menuContext.previousValue.value); const isSelected = itemContext.value === menuContext.modelValue.value; const wasSelected = prevIndex === values.indexOf(itemContext.value); if (!isSelected && !wasSelected) return prevMotionAttributeRef.value; const attribute = (() => { if (index !== prevIndex) { if (isSelected && prevIndex !== -1) return index > prevIndex ? "from-end" : "from-start"; if (wasSelected && index !== -1) return index > prevIndex ? "to-start" : "to-end"; } return null; })(); prevMotionAttributeRef.value = attribute; return attribute; }); function handleFocusOutside(ev) { var _a2, _b; emits("focusOutside", ev); emits("interactOutside", ev); const target = ev.detail.originalEvent.target; if (target.hasAttribute("data-navigation-menu-trigger")) ev.preventDefault(); if (!ev.defaultPrevented) { itemContext.onContentFocusOutside(); const target$1 = ev.target; if ((_b = (_a2 = menuContext.rootNavigationMenu) == null ? void 0 : _a2.value) == null ? void 0 : _b.contains(target$1)) ev.preventDefault(); } } function handlePointerDownOutside(ev) { var _a2; emits("pointerDownOutside", ev); if (!ev.defaultPrevented) { const target = ev.target; const isTrigger = getItems().some((i) => i.ref.contains(target)); const isRootViewport = menuContext.isRootMenu && ((_a2 = menuContext.viewport.value) == null ? void 0 : _a2.contains(target)); if (isTrigger || isRootViewport || !menuContext.isRootMenu) ev.preventDefault(); } } vue.watchEffect((cleanupFn) => { const content = currentElement.value; if (menuContext.isRootMenu && content) { const handleClose = () => { var _a2; menuContext.onItemDismiss(); itemContext.onRootContentClose(); if (content.contains(getActiveElement())) (_a2 = itemContext.triggerRef.value) == null ? void 0 : _a2.focus(); }; content.addEventListener(EVENT_ROOT_CONTENT_DISMISS, handleClose); cleanupFn(() => content.removeEventListener(EVENT_ROOT_CONTENT_DISMISS, handleClose)); } }); function handleEscapeKeyDown(ev) { var _a2, _b; emits("escapeKeyDown", ev); if (!ev.defaultPrevented) { menuContext.onItemDismiss(); (_b = (_a2 = itemContext.triggerRef) == null ? void 0 : _a2.value) == null ? void 0 : _b.focus(); itemContext.wasEscapeCloseRef.value = true; } } function handleKeydown(ev) { var _a2; if (ev.target.closest("[data-reka-navigation-menu]") !== menuContext.rootNavigationMenu.value) return; const isMetaKey = ev.altKey || ev.ctrlKey || ev.metaKey; const isTabKey = ev.key === "Tab" && !isMetaKey; const candidates = getTabbableCandidates(ev.currentTarget); if (isTabKey) { const focusedElement = getActiveElement(); const index = candidates.findIndex((candidate) => candidate === focusedElement); const isMovingBackwards = ev.shiftKey; const nextCandidates = isMovingBackwards ? candidates.slice(0, index).reverse() : candidates.slice(index + 1, candidates.length); if (focusFirst(nextCandidates)) ev.preventDefault(); else { (_a2 = itemContext.focusProxyRef.value) == null ? void 0 : _a2.focus(); return; } } const newSelectedElement = useArrowNavigation(ev, getActiveElement(), void 0, { itemsArray: candidates, loop: false, enableIgnoredElement: true }); newSelectedElement == null ? void 0 : newSelectedElement.focus(); } function handleDismiss() { var _a2; if (menuContext.modelValue.value !== itemContext.value) return; const rootContentDismissEvent = new Event(EVENT_ROOT_CONTENT_DISMISS, { bubbles: true, cancelable: true }); (_a2 = currentElement.value) == null ? void 0 : _a2.dispatchEvent(rootContentDismissEvent); } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(DismissableLayer_default), vue.mergeProps({ id: vue.unref(contentId), ref: vue.unref(forwardRef), "aria-labelledby": vue.unref(triggerId), "data-motion": motionAttribute.value, "data-state": vue.unref(getOpenState)(vue.unref(menuContext).modelValue.value === vue.unref(itemContext).value), "data-orientation": vue.unref(menuContext).orientation }, props, { onKeydown: handleKeydown, onEscapeKeyDown: handleEscapeKeyDown, onPointerDownOutside: handlePointerDownOutside, onFocusOutside: handleFocusOutside, onDismiss: handleDismiss }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "aria-labelledby", "data-motion", "data-state", "data-orientation" ]); }; } }); var NavigationMenuContentImpl_default = NavigationMenuContentImpl_vue_vue_type_script_setup_true_lang_default; var NavigationMenuContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "NavigationMenuContent", props: { forceMount: { type: Boolean, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const forwarded = useForwardPropsEmits(reactiveOmit(props, "forceMount"), emits); const { forwardRef } = useForwardExpose(); const menuContext = injectNavigationMenuContext(); const itemContext = injectNavigationMenuItemContext(); const open = vue.computed(() => itemContext.value === menuContext.modelValue.value); const isLastActiveValue = vue.computed(() => { if (menuContext.viewport.value) { if (!menuContext.modelValue.value && menuContext.previousValue.value) return menuContext.previousValue.value === itemContext.value; } return false; }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.Teleport, { to: vue.unref(isClient) && vue.unref(menuContext).viewport.value ? vue.unref(menuContext).viewport.value : "body", disabled: vue.unref(isClient) && vue.unref(menuContext).viewport.value ? !vue.unref(menuContext).viewport.value : true }, [vue.createVNode(vue.unref(Presence_default), { present: __props.forceMount || open.value || isLastActiveValue.value, "force-mount": !vue.unref(menuContext).unmountOnHide.value }, { default: vue.withCtx(({ present }) => [vue.createVNode(NavigationMenuContentImpl_default, vue.mergeProps({ ref: vue.unref(forwardRef), "data-state": vue.unref(getOpenState)(open.value), style: { pointerEvents: !open.value && vue.unref(menuContext).isRootMenu ? "none" : void 0 } }, { ..._ctx.$attrs, ...vue.unref(forwarded) }, { hidden: !present, onPointerenter: _cache[0] || (_cache[0] = ($event) => vue.unref(menuContext).onContentEnter(vue.unref(itemContext).value)), onPointerleave: _cache[1] || (_cache[1] = ($event) => vue.unref(whenMouse)(() => vue.unref(menuContext).onContentLeave())($event)), onPointerDownOutside: _cache[2] || (_cache[2] = ($event) => emits("pointerDownOutside", $event)), onFocusOutside: _cache[3] || (_cache[3] = ($event) => emits("focusOutside", $event)), onInteractOutside: _cache[4] || (_cache[4] = ($event) => emits("interactOutside", $event)) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "data-state", "style", "hidden" ])]), _: 3 }, 8, ["present", "force-mount"])], 8, ["to", "disabled"]); }; } }); var NavigationMenuContent_default = NavigationMenuContent_vue_vue_type_script_setup_true_lang_default; var NavigationMenuIndicator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "NavigationMenuIndicator", props: { forceMount: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const { forwardRef } = useForwardExpose(); const menuContext = injectNavigationMenuContext(); const indicatorStyle = vue.ref(); const isHorizontal = vue.computed(() => menuContext.orientation === "horizontal"); const isVisible2 = vue.computed(() => !!menuContext.modelValue.value); const { activeTrigger } = menuContext; function handlePositionChange() { if (!activeTrigger.value) return; indicatorStyle.value = { size: isHorizontal.value ? activeTrigger.value.offsetWidth : activeTrigger.value.offsetHeight, position: isHorizontal.value ? activeTrigger.value.offsetLeft : activeTrigger.value.offsetTop }; } vue.watchEffect(() => { if (!menuContext.modelValue.value) return; handlePositionChange(); }); useResizeObserver(activeTrigger, handlePositionChange); useResizeObserver(menuContext.indicatorTrack, handlePositionChange); return (_ctx, _cache) => { return vue.unref(menuContext).indicatorTrack.value ? (vue.openBlock(), vue.createBlock(vue.Teleport, { key: 0, to: vue.unref(menuContext).indicatorTrack.value }, [vue.createVNode(vue.unref(Presence_default), { present: __props.forceMount || isVisible2.value }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), vue.mergeProps({ ref: vue.unref(forwardRef), "aria-hidden": "true", "data-state": isVisible2.value ? "visible" : "hidden", "data-orientation": vue.unref(menuContext).orientation, "as-child": props.asChild, as: __props.as, style: { ...indicatorStyle.value ? { "--reka-navigation-menu-indicator-size": `${indicatorStyle.value.size}px`, "--reka-navigation-menu-indicator-position": `${indicatorStyle.value.position}px` } : {} } }, _ctx.$attrs), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "data-state", "data-orientation", "as-child", "as", "style" ])]), _: 3 }, 8, ["present"])], 8, ["to"])) : vue.createCommentVNode("v-if", true); }; } }); var NavigationMenuIndicator_default = NavigationMenuIndicator_vue_vue_type_script_setup_true_lang_default; var NavigationMenuLink_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "NavigationMenuLink", props: { active: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "a" } }, emits: ["select"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { CollectionItem } = useCollection({ key: "NavigationMenu" }); useForwardExpose(); async function handleClick(ev) { var _a2; const linkSelectEvent = new CustomEvent(LINK_SELECT, { bubbles: true, cancelable: true, detail: { originalEvent: ev } }); emits("select", linkSelectEvent); if (!linkSelectEvent.defaultPrevented && !ev.metaKey) { const rootContentDismissEvent = new CustomEvent(EVENT_ROOT_CONTENT_DISMISS, { bubbles: true, cancelable: true }); (_a2 = ev.target) == null ? void 0 : _a2.dispatchEvent(rootContentDismissEvent); } } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollectionItem), null, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { as: __props.as, "data-active": __props.active ? "" : void 0, "aria-current": __props.active ? "page" : void 0, "as-child": props.asChild, onClick: handleClick }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as", "data-active", "aria-current", "as-child" ])]), _: 3 }); }; } }); var NavigationMenuLink_default = NavigationMenuLink_vue_vue_type_script_setup_true_lang_default; var NavigationMenuList_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "NavigationMenuList", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "ul" } }, setup(__props) { const props = __props; const menuContext = injectNavigationMenuContext(); const { forwardRef, currentElement } = useForwardExpose(); vue.onMounted(() => { menuContext.onIndicatorTrackChange(currentElement.value); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { ref: vue.unref(forwardRef), style: { "position": "relative" } }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), vue.mergeProps(_ctx.$attrs, { "as-child": props.asChild, as: __props.as, "data-orientation": vue.unref(menuContext).orientation }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "as-child", "as", "data-orientation" ])]), _: 3 }, 512); }; } }); var NavigationMenuList_default = NavigationMenuList_vue_vue_type_script_setup_true_lang_default; const _hoisted_1$k = ["aria-owns"]; var NavigationMenuTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "NavigationMenuTrigger", props: { disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; const menuContext = injectNavigationMenuContext(); const itemContext = injectNavigationMenuItemContext(); const { CollectionItem } = useCollection({ key: "NavigationMenu" }); const { forwardRef, currentElement: triggerElement } = useForwardExpose(); const triggerId = vue.ref(""); const contentId = vue.ref(""); const hasPointerMoveOpenedRef = refAutoReset(false, 300); const wasClickCloseRef = vue.ref(false); const open = vue.computed(() => itemContext.value === menuContext.modelValue.value); vue.onMounted(() => { itemContext.triggerRef = triggerElement; triggerId.value = makeTriggerId$1(menuContext.baseId, itemContext.value); contentId.value = makeContentId$1(menuContext.baseId, itemContext.value); }); function handlePointerEnter() { if (menuContext.disableHoverTrigger.value) return; wasClickCloseRef.value = false; itemContext.wasEscapeCloseRef.value = false; } function handlePointerMove(ev) { if (ev.defaultPrevented || menuContext.disableHoverTrigger.value) return; if (ev.pointerType === "mouse") { if (props.disabled || wasClickCloseRef.value || itemContext.wasEscapeCloseRef.value || hasPointerMoveOpenedRef.value) return; menuContext.onTriggerEnter(itemContext.value); hasPointerMoveOpenedRef.value = true; } } function handlePointerLeave(ev) { if (menuContext.disableHoverTrigger.value) return; if (ev.pointerType === "mouse") { if (props.disabled) return; menuContext.onTriggerLeave(); hasPointerMoveOpenedRef.value = false; } } function handleClick(event) { if (event.defaultPrevented) return; if ((!("pointerType" in event) || event.pointerType === "mouse") && menuContext.disableClickTrigger.value) return; if (hasPointerMoveOpenedRef.value) return; if (open.value) menuContext.onItemSelect(""); else menuContext.onItemSelect(itemContext.value); wasClickCloseRef.value = open.value; } function handleKeydown(ev) { if (ev.defaultPrevented) return; const verticalEntryKey = menuContext.dir.value === "rtl" ? "ArrowLeft" : "ArrowRight"; const entryKey = { horizontal: "ArrowDown", vertical: verticalEntryKey }[menuContext.orientation]; if (open.value && ev.key === entryKey) { itemContext.onEntryKeyDown(); ev.preventDefault(); ev.stopPropagation(); } } function setFocusProxyRef(node) { if (!node) return void 0; itemContext.focusProxyRef.value = unrefElement(node); return void 0; } function handleVisuallyHiddenFocus(ev) { const content = document.getElementById(itemContext.contentId); const prevFocusedElement = ev.relatedTarget; const wasTriggerFocused = prevFocusedElement === triggerElement.value; const wasFocusFromContent = content == null ? void 0 : content.contains(prevFocusedElement); if (wasTriggerFocused || !wasFocusFromContent) itemContext.onFocusProxyEnter(wasTriggerFocused ? "start" : "end"); } return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [vue.createVNode(vue.unref(CollectionItem), null, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), vue.mergeProps({ id: triggerId.value, ref: vue.unref(forwardRef), disabled: __props.disabled, "data-disabled": __props.disabled ? "" : void 0, "data-state": vue.unref(getOpenState)(open.value), "data-navigation-menu-trigger": "", "aria-expanded": open.value, "aria-controls": contentId.value, "as-child": props.asChild, as: __props.as }, _ctx.$attrs, { onPointerenter: handlePointerEnter, onPointermove: handlePointerMove, onPointerleave: handlePointerLeave, onClick: handleClick, onKeydown: handleKeydown }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "disabled", "data-disabled", "data-state", "aria-expanded", "aria-controls", "as-child", "as" ])]), _: 3 }), open.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [vue.createVNode(vue.unref(VisuallyHidden_default), { ref: setFocusProxyRef, tabindex: 0, onFocus: handleVisuallyHiddenFocus }, null, 512), vue.unref(menuContext).viewport ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "aria-owns": contentId.value }, null, 8, _hoisted_1$k)) : vue.createCommentVNode("v-if", true)], 64)) : vue.createCommentVNode("v-if", true)], 64); }; } }); var NavigationMenuTrigger_default = NavigationMenuTrigger_vue_vue_type_script_setup_true_lang_default; var NavigationMenuViewport_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "NavigationMenuViewport", props: { forceMount: { type: Boolean, required: false }, align: { type: String, required: false, default: "center" }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { var _a2; const props = __props; const { forwardRef, currentElement } = useForwardExpose(); const menuContext = injectNavigationMenuContext(); const { activeTrigger, rootNavigationMenu, modelValue } = menuContext; const size2 = vue.ref(); const position = vue.ref(); const open = vue.computed(() => !!menuContext.modelValue.value); vue.watch(currentElement, () => { menuContext.onViewportChange(currentElement.value); }); const content = vue.ref(); vue.watch([modelValue, open], () => { vue.nextTick(() => { if (!currentElement.value) return; requestAnimationFrame(() => { var _a3; const el = (_a3 = currentElement.value) == null ? void 0 : _a3.querySelector("[data-state=open]"); content.value = el; }); }); }, { immediate: true }); function updatePosition() { if (content.value && activeTrigger.value && rootNavigationMenu.value) { const bodyWidth = document.documentElement.offsetWidth; const bodyHeight = document.documentElement.offsetHeight; const rootRect = rootNavigationMenu.value.getBoundingClientRect(); const rect = activeTrigger.value.getBoundingClientRect(); const { offsetWidth, offsetHeight } = content.value; const startPositionLeft = rect.left - rootRect.left; const startPositionTop = rect.top - rootRect.top; let posLeft = null; let posTop = null; switch (props.align) { case "start": posLeft = startPositionLeft; posTop = startPositionTop; break; case "end": posLeft = startPositionLeft - offsetWidth + rect.width; posTop = startPositionTop - offsetHeight + rect.height; break; default: posLeft = startPositionLeft - offsetWidth / 2 + rect.width / 2; posTop = startPositionTop - offsetHeight / 2 + rect.height / 2; } const screenOffset = 10; if (posLeft + rootRect.left < screenOffset) posLeft = screenOffset - rootRect.left; const rightOffset = posLeft + rootRect.left + offsetWidth; if (rightOffset > bodyWidth - screenOffset) { posLeft -= rightOffset - bodyWidth + screenOffset; if (posLeft < screenOffset - rootRect.left) posLeft = screenOffset - rootRect.left; } if (posTop + rootRect.top < screenOffset) posTop = screenOffset - rootRect.top; const bottomOffset = posTop + rootRect.top + offsetHeight; if (bottomOffset > bodyHeight - screenOffset) { posTop -= bottomOffset - bodyHeight + screenOffset; if (posTop < screenOffset - rootRect.top) posTop = screenOffset - rootRect.top; } posLeft = Math.round(posLeft); posTop = Math.round(posTop); position.value = { left: posLeft, top: posTop }; } } useResizeObserver(content, () => { if (content.value) { size2.value = { width: content.value.offsetWidth, height: content.value.offsetHeight }; updatePosition(); } }); useResizeObserver([(_a2 = globalThis.document) == null ? void 0 : _a2.body, rootNavigationMenu], () => { updatePosition(); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || open.value, "force-mount": !vue.unref(menuContext).unmountOnHide.value, onAfterLeave: _cache[2] || (_cache[2] = () => { size2.value = void 0; position.value = void 0; }) }, { default: vue.withCtx(({ present }) => { var _a3, _b, _c, _d; return [vue.createVNode(vue.unref(Primitive), vue.mergeProps(_ctx.$attrs, { ref: vue.unref(forwardRef), as: __props.as, "as-child": __props.asChild, "data-state": vue.unref(getOpenState)(open.value), "data-orientation": vue.unref(menuContext).orientation, style: { pointerEvents: !open.value && vue.unref(menuContext).isRootMenu ? "none" : void 0, ["--reka-navigation-menu-viewport-width"]: size2.value ? `${(_a3 = size2.value) == null ? void 0 : _a3.width}px` : void 0, ["--reka-navigation-menu-viewport-height"]: size2.value ? `${(_b = size2.value) == null ? void 0 : _b.height}px` : void 0, ["--reka-navigation-menu-viewport-left"]: position.value ? `${(_c = position.value) == null ? void 0 : _c.left}px` : void 0, ["--reka-navigation-menu-viewport-top"]: position.value ? `${(_d = position.value) == null ? void 0 : _d.top}px` : void 0 }, hidden: !present, onPointerenter: _cache[0] || (_cache[0] = ($event) => vue.unref(menuContext).onContentEnter(vue.unref(menuContext).modelValue.value)), onPointerleave: _cache[1] || (_cache[1] = ($event) => vue.unref(whenMouse)(() => vue.unref(menuContext).onContentLeave())($event)) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "as", "as-child", "data-state", "data-orientation", "style", "hidden" ])]; }), _: 3 }, 8, ["present", "force-mount"]); }; } }); var NavigationMenuViewport_default = NavigationMenuViewport_vue_vue_type_script_setup_true_lang_default; const DEFAULT_MAX = 100; const [injectProgressRootContext, provideProgressRootContext] = createContext("ProgressRoot"); const isNumber$1 = (v) => typeof v === "number"; function validateValue(value, max2) { const isValidValueError = isNullish(value) || isNumber$1(value) && !Number.isNaN(value) && value <= max2 && value >= 0; if (isValidValueError) return value; console.error(`Invalid prop \`value\` of value \`${value}\` supplied to \`ProgressRoot\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${DEFAULT_MAX} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. Defaulting to \`null\`.`); return null; } function validateMax(max2) { const isValidMaxError = isNumber$1(max2) && !Number.isNaN(max2) && max2 > 0; if (isValidMaxError) return max2; console.error(`Invalid prop \`max\` of value \`${max2}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${DEFAULT_MAX}\`.`); return DEFAULT_MAX; } var ProgressRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ProgressRoot", props: { modelValue: { type: [Number, null], required: false }, max: { type: Number, required: false, default: DEFAULT_MAX }, getValueLabel: { type: Function, required: false, default: (value, max2) => isNumber$1(value) ? `${Math.round(value / max2 * DEFAULT_MAX)}%` : void 0 }, getValueText: { type: Function, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["update:modelValue", "update:max"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; useForwardExpose(); const modelValue = useVModel(props, "modelValue", emit2, { passive: props.modelValue === void 0 }); const max2 = useVModel(props, "max", emit2, { passive: props.max === void 0 }); vue.watch(() => modelValue.value, async (value) => { const correctedValue = validateValue(value, props.max); if (correctedValue !== value) { await vue.nextTick(); modelValue.value = correctedValue; } }, { immediate: true }); vue.watch(() => props.max, (newMax) => { const correctedMax = validateMax(props.max); if (correctedMax !== newMax) max2.value = correctedMax; }, { immediate: true }); const progressState = vue.computed(() => { if (isNullish(modelValue.value)) return "indeterminate"; if (modelValue.value === max2.value) return "complete"; return "loading"; }); provideProgressRootContext({ modelValue, max: max2, progressState }); return (_ctx, _cache) => { var _a2, _b; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { "as-child": __props.asChild, as: __props.as, "aria-valuemax": vue.unref(max2), "aria-valuemin": 0, "aria-valuenow": isNumber$1(vue.unref(modelValue)) ? vue.unref(modelValue) : void 0, "aria-valuetext": (_a2 = __props.getValueText) == null ? void 0 : _a2.call(__props, vue.unref(modelValue), vue.unref(max2)), "aria-label": __props.getValueLabel(vue.unref(modelValue), vue.unref(max2)), role: "progressbar", "data-state": progressState.value, "data-value": (_b = vue.unref(modelValue)) != null ? _b : void 0, "data-max": vue.unref(max2) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue) })]), _: 3 }, 8, [ "as-child", "as", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-label", "data-state", "data-value", "data-max" ]); }; } }); var ProgressRoot_default = ProgressRoot_vue_vue_type_script_setup_true_lang_default; var ProgressIndicator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ProgressIndicator", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const rootContext = injectProgressRootContext(); useForwardExpose(); return (_ctx, _cache) => { var _a2, _b; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { "data-state": vue.unref(rootContext).progressState.value, "data-value": (_b = (_a2 = vue.unref(rootContext).modelValue) == null ? void 0 : _a2.value) != null ? _b : void 0, "data-max": vue.unref(rootContext).max.value }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "data-state", "data-value", "data-max" ]); }; } }); var ProgressIndicator_default = ProgressIndicator_vue_vue_type_script_setup_true_lang_default; const [injectSwitchRootContext, provideSwitchRootContext] = createContext("SwitchRoot"); var SwitchRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "SwitchRoot", props: { defaultValue: { type: null, required: false }, modelValue: { type: null, required: false, default: void 0 }, disabled: { type: Boolean, required: false }, id: { type: String, required: false }, value: { type: String, required: false, default: "on" }, trueValue: { type: null, required: false, default: () => true }, falseValue: { type: null, required: false, default: () => false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" }, name: { type: String, required: false }, required: { type: Boolean, required: false } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { var _a2; const props = __props; const emit2 = __emit; const { disabled } = vue.toRefs(props); const modelValue = useVModel(props, "modelValue", emit2, { defaultValue: (_a2 = props.defaultValue) != null ? _a2 : props.falseValue, passive: props.modelValue === void 0 }); const checked = vue.computed(() => modelValue.value === props.trueValue); function toggleCheck() { if (disabled.value) return; modelValue.value = checked.value ? props.falseValue : props.trueValue; } const { forwardRef, currentElement } = useForwardExpose(); const isFormControl = useFormControl(currentElement); const scopeIdAttrs = useForwardScopeId(); const ariaLabel = vue.computed(() => { var _a3; return props.id && currentElement.value ? (_a3 = document.querySelector(`[for="${props.id}"]`)) == null ? void 0 : _a3.innerText : void 0; }); provideSwitchRootContext({ checked, toggleCheck, disabled }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [vue.createVNode(vue.unref(Primitive), vue.mergeProps({ id: __props.id, ref: vue.unref(forwardRef), role: "switch", type: __props.as === "button" ? "button" : void 0, value: __props.value, "aria-label": _ctx.$attrs["aria-label"] || ariaLabel.value, "aria-checked": checked.value, "aria-required": __props.required, "data-state": checked.value ? "checked" : "unchecked", "data-disabled": vue.unref(disabled) ? "" : void 0, "as-child": __props.asChild, as: __props.as, disabled: vue.unref(disabled) }, { ...vue.unref(scopeIdAttrs), ..._ctx.$attrs }, { onClick: toggleCheck, onKeydown: vue.withKeys(vue.withModifiers(toggleCheck, ["prevent"]), ["enter"]) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue), checked: checked.value })]), _: 3 }, 16, [ "id", "type", "value", "aria-label", "aria-checked", "aria-required", "data-state", "data-disabled", "as-child", "as", "disabled", "onKeydown" ]), vue.unref(isFormControl) && __props.name ? (vue.openBlock(), vue.createBlock(vue.unref(VisuallyHiddenInput_default), vue.mergeProps({ key: 0, type: "checkbox", name: __props.name, disabled: vue.unref(disabled), required: __props.required, value: __props.value, checked: checked.value }, vue.unref(scopeIdAttrs)), null, 16, [ "name", "disabled", "required", "value", "checked" ])) : vue.createCommentVNode("v-if", true)], 64); }; } }); var SwitchRoot_default = SwitchRoot_vue_vue_type_script_setup_true_lang_default; var SwitchThumb_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "SwitchThumb", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "span" } }, setup(__props) { const rootContext = injectSwitchRootContext(); useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { "data-state": vue.unref(rootContext).checked.value ? "checked" : "unchecked", "data-disabled": vue.unref(rootContext).disabled.value ? "" : void 0, "as-child": __props.asChild, as: __props.as }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "data-state", "data-disabled", "as-child", "as" ]); }; } }); var SwitchThumb_default = SwitchThumb_vue_vue_type_script_setup_true_lang_default; const [injectTabsRootContext, provideTabsRootContext] = createContext("TabsRoot"); var TabsRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TabsRoot", props: { defaultValue: { type: null, required: false }, orientation: { type: String, required: false, default: "horizontal" }, dir: { type: String, required: false }, activationMode: { type: String, required: false, default: "automatic" }, modelValue: { type: null, required: false }, unmountOnHide: { type: Boolean, required: false, default: true }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { orientation, unmountOnHide, dir: propDir } = vue.toRefs(props); const dir = useDirection(propDir); useForwardExpose(); const modelValue = useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue, passive: props.modelValue === void 0 }); const tabsList = vue.ref(); const contentIds = vue.shallowRef( new Set()); provideTabsRootContext({ modelValue, changeModelValue: (value) => { modelValue.value = value; }, orientation, dir, unmountOnHide, activationMode: props.activationMode, baseId: useId(void 0, "reka-tabs"), tabsList, contentIds, registerContent: (value) => { contentIds.value = new Set([...contentIds.value, value]); }, unregisterContent: (value) => { const newSet = new Set(contentIds.value); newSet.delete(value); contentIds.value = newSet; } }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { dir: vue.unref(dir), "data-orientation": vue.unref(orientation), "as-child": __props.asChild, as: __props.as }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue) })]), _: 3 }, 8, [ "dir", "data-orientation", "as-child", "as" ]); }; } }); var TabsRoot_default = TabsRoot_vue_vue_type_script_setup_true_lang_default; function makeTriggerId(baseId, value) { return `${baseId}-trigger-${value}`; } function makeContentId(baseId, value) { return `${baseId}-content-${value}`; } var TabsContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TabsContent", props: { value: { type: [String, Number], required: true }, forceMount: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const { forwardRef } = useForwardExpose(); const rootContext = injectTabsRootContext(); const triggerId = vue.computed(() => makeTriggerId(rootContext.baseId, props.value)); const contentId = vue.computed(() => makeContentId(rootContext.baseId, props.value)); const isSelected = vue.computed(() => props.value === rootContext.modelValue.value); const isMountAnimationPreventedRef = vue.ref(isSelected.value); vue.onMounted(() => { rootContext.registerContent(props.value); requestAnimationFrame(() => { isMountAnimationPreventedRef.value = false; }); }); vue.onBeforeUnmount(() => { rootContext.unregisterContent(props.value); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || isSelected.value, "force-mount": "" }, { default: vue.withCtx(({ present }) => [vue.createVNode(vue.unref(Primitive), { id: contentId.value, ref: vue.unref(forwardRef), "as-child": __props.asChild, as: __props.as, role: "tabpanel", "data-state": isSelected.value ? "active" : "inactive", "data-orientation": vue.unref(rootContext).orientation.value, "aria-labelledby": triggerId.value, hidden: !present, tabindex: "0", style: vue.normalizeStyle({ animationDuration: isMountAnimationPreventedRef.value ? "0s" : void 0 }) }, { default: vue.withCtx(() => [(vue.unref(rootContext).unmountOnHide.value ? present : true) ? vue.renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : vue.createCommentVNode("v-if", true)]), _: 2 }, 1032, [ "id", "as-child", "as", "data-state", "data-orientation", "aria-labelledby", "hidden", "style" ])]), _: 3 }, 8, ["present"]); }; } }); var TabsContent_default = TabsContent_vue_vue_type_script_setup_true_lang_default; var TabsIndicator_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TabsIndicator", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props, { expose: __expose }) { const props = __props; const context2 = injectTabsRootContext(); __expose({ updateIndicatorStyle }); useForwardExpose(); const isMounted = useMounted(); const indicatorStyle = vue.ref({ size: null, thickness: null, position: null }); const tabs = vue.ref([]); vue.watch(() => [context2.modelValue.value, context2 == null ? void 0 : context2.dir.value], () => { updateIndicatorStyle(); }, { immediate: true, flush: "post" }); vue.watchPostEffect(() => { var _a2; tabs.value = Array.from(((_a2 = context2.tabsList.value) == null ? void 0 : _a2.querySelectorAll('[role="tab"]')) || []); }); useResizeObserver(vue.computed(() => [context2.tabsList.value, ...tabs.value]), updateIndicatorStyle); function updateIndicatorStyle() { var _a2; const activeTab = (_a2 = context2.tabsList.value) == null ? void 0 : _a2.querySelector('[role="tab"][data-state="active"]'); if (!activeTab) return; if (context2.orientation.value === "horizontal") indicatorStyle.value = { size: activeTab.offsetWidth, thickness: activeTab.offsetHeight, position: activeTab.offsetLeft }; else indicatorStyle.value = { size: activeTab.offsetHeight, thickness: activeTab.offsetWidth, position: activeTab.offsetTop }; } return (_ctx, _cache) => { return vue.unref(isMounted) && typeof indicatorStyle.value.size === "number" ? (vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps({ key: 0 }, props, { style: { "--reka-tabs-indicator-size": `${indicatorStyle.value.size}px`, "--reka-tabs-indicator-thickness": `${indicatorStyle.value.thickness}px`, "--reka-tabs-indicator-position": `${indicatorStyle.value.position}px` } }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["style"])) : vue.createCommentVNode("v-if", true); }; } }); var TabsIndicator_default = TabsIndicator_vue_vue_type_script_setup_true_lang_default; var TabsList_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TabsList", props: { loop: { type: Boolean, required: false, default: true }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const { loop } = vue.toRefs(props); const { forwardRef, currentElement } = useForwardExpose(); const context2 = injectTabsRootContext(); context2.tabsList = currentElement; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(RovingFocusGroup_default), { "as-child": "", orientation: vue.unref(context2).orientation.value, dir: vue.unref(context2).dir.value, loop: vue.unref(loop) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { ref: vue.unref(forwardRef), role: "tablist", "as-child": __props.asChild, as: __props.as, "aria-orientation": vue.unref(context2).orientation.value }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as-child", "as", "aria-orientation" ])]), _: 3 }, 8, [ "orientation", "dir", "loop" ]); }; } }); var TabsList_default = TabsList_vue_vue_type_script_setup_true_lang_default; var TabsTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TabsTrigger", props: { value: { type: [String, Number], required: true }, disabled: { type: Boolean, required: false, default: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; const { forwardRef } = useForwardExpose(); const rootContext = injectTabsRootContext(); const triggerId = vue.computed(() => makeTriggerId(rootContext.baseId, props.value)); const contentId = vue.computed(() => rootContext.contentIds.value.has(props.value) ? makeContentId(rootContext.baseId, props.value) : void 0); const isSelected = vue.computed(() => props.value === rootContext.modelValue.value); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(RovingFocusItem_default), { "as-child": "", focusable: !__props.disabled, active: isSelected.value }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { id: triggerId.value, ref: vue.unref(forwardRef), role: "tab", type: __props.as === "button" ? "button" : void 0, as: __props.as, "as-child": __props.asChild, "aria-selected": isSelected.value ? "true" : "false", "aria-controls": contentId.value, "data-state": isSelected.value ? "active" : "inactive", disabled: __props.disabled, "data-disabled": __props.disabled ? "" : void 0, "data-orientation": vue.unref(rootContext).orientation.value, onMousedown: _cache[0] || (_cache[0] = vue.withModifiers((event) => { if (event.defaultPrevented) return; if (!__props.disabled && event.ctrlKey === false) vue.unref(rootContext).changeModelValue(__props.value); else event.preventDefault(); }, ["left"])), onKeydown: _cache[1] || (_cache[1] = vue.withKeys((event) => { if (!event.defaultPrevented) vue.unref(rootContext).changeModelValue(__props.value); }, ["enter", "space"])), onFocus: _cache[2] || (_cache[2] = () => { const isAutomaticActivation = vue.unref(rootContext).activationMode !== "manual"; if (!isSelected.value && !__props.disabled && isAutomaticActivation) vue.unref(rootContext).changeModelValue(__props.value); }) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "id", "type", "as", "as-child", "aria-selected", "aria-controls", "data-state", "disabled", "data-disabled", "data-orientation" ])]), _: 3 }, 8, ["focusable", "active"]); }; } }); var TabsTrigger_default = TabsTrigger_vue_vue_type_script_setup_true_lang_default; const [injectTagsInputRootContext, provideTagsInputRootContext] = createContext("TagsInputRoot"); var TagsInputRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TagsInputRoot", props: { modelValue: { type: [Array, null], required: false }, defaultValue: { type: Array, required: false, default: () => [] }, addOnPaste: { type: Boolean, required: false }, addOnTab: { type: Boolean, required: false }, addOnBlur: { type: Boolean, required: false }, duplicate: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, delimiter: { type: null, required: false, default: "," }, dir: { type: String, required: false }, max: { type: Number, required: false, default: 0 }, id: { type: String, required: false }, convertValue: { type: Function, required: false }, displayValue: { type: Function, required: false, default: (value) => value.toString() }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, name: { type: String, required: false }, required: { type: Boolean, required: false } }, emits: [ "update:modelValue", "invalid", "addTag", "removeTag" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { addOnPaste, disabled, delimiter, max: max2, id, dir: propDir, addOnBlur, addOnTab } = vue.toRefs(props); const dir = useDirection(propDir); const modelValue = useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue, passive: true, deep: true }); const { forwardRef, currentElement } = useForwardExpose(); const { focused } = useFocusWithin(currentElement); const isFormControl = useFormControl(currentElement); const { getItems, CollectionSlot } = useCollection({ isProvider: true }); const selectedElement = vue.ref(); const isInvalidInput = vue.ref(false); const currentModelValue = vue.computed(() => Array.isArray(modelValue.value) ? [...modelValue.value] : []); function handleRemoveTag(index) { if (index !== -1) { const removedValue = modelValue.value[index]; modelValue.value = modelValue.value.filter((_2, i) => i !== index); emits("removeTag", removedValue); } } provideTagsInputRootContext({ modelValue, onAddValue: (_payload) => { const array = [...currentModelValue.value]; const modelValueIsObject = array.length > 0 && typeof array[0] === "object"; const defaultValueIsObject = array.length > 0 && typeof props.defaultValue[0] === "object"; if ((modelValueIsObject || defaultValueIsObject) && typeof props.convertValue !== "function") throw new Error("You must provide a `convertValue` function when using objects as values."); const payload = props.convertValue ? props.convertValue(_payload) : _payload; if (array.length >= max2.value && !!max2.value) { emits("invalid", payload); return false; } if (props.duplicate) { modelValue.value = [...array, payload]; emits("addTag", payload); return true; } else { const exist = array.includes(payload); if (!exist) { modelValue.value = [...array, payload]; emits("addTag", payload); return true; } else isInvalidInput.value = true; } emits("invalid", payload); return false; }, onRemoveValue: handleRemoveTag, onInputKeydown: (event) => { if (event.isComposing) return; const target = event.target; const collection = getItems().map((i) => i.ref).filter((i) => i.dataset.disabled !== ""); if (!collection.length) return; const lastTag = collection.at(-1); switch (event.key) { case "Delete": case "Backspace": { if (target.selectionStart !== 0 || target.selectionEnd !== 0) break; if (selectedElement.value) { const index = collection.findIndex((i) => i === selectedElement.value); const selectedItem = getItems().find((i) => i.ref === selectedElement.value); const modelIndex = selectedItem ? modelValue.value.findIndex((v) => isEqual$1(v, selectedItem.value)) : -1; handleRemoveTag(modelIndex); selectedElement.value = selectedElement.value === lastTag ? collection.at(index - 1) : collection.at(index + 1); event.preventDefault(); } else if (event.key === "Backspace") { selectedElement.value = lastTag; event.preventDefault(); } break; } case "Home": case "End": case "ArrowRight": case "ArrowLeft": { const isArrowRight = event.key === "ArrowRight" && dir.value === "ltr" || event.key === "ArrowLeft" && dir.value === "rtl"; const isArrowLeft = !isArrowRight; if (target.selectionStart !== 0 || target.selectionEnd !== 0) break; if (isArrowLeft && !selectedElement.value) { selectedElement.value = lastTag; event.preventDefault(); } else if (isArrowRight && lastTag && selectedElement.value === lastTag) { selectedElement.value = void 0; event.preventDefault(); } else if (selectedElement.value) { const el = useArrowNavigation(event, selectedElement.value, void 0, { itemsArray: collection, loop: false, dir: dir.value }); if (el) selectedElement.value = el; event.preventDefault(); } break; } case "ArrowUp": case "ArrowDown": { if (selectedElement.value) event.preventDefault(); break; } default: selectedElement.value = void 0; } }, selectedElement, isInvalidInput, addOnPaste, addOnBlur, addOnTab, dir, disabled, delimiter, max: max2, id, displayValue: props.displayValue }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollectionSlot), null, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { ref: vue.unref(forwardRef), dir: vue.unref(dir), as: __props.as, "as-child": __props.asChild, "data-invalid": isInvalidInput.value ? "" : void 0, "data-disabled": vue.unref(disabled) ? "" : void 0, "data-focused": vue.unref(focused) ? "" : void 0 }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue) }), vue.unref(isFormControl) && __props.name ? (vue.openBlock(), vue.createBlock(vue.unref(VisuallyHiddenInput_default), { key: 0, name: __props.name, value: vue.unref(modelValue), required: __props.required, disabled: vue.unref(disabled) }, null, 8, [ "name", "value", "required", "disabled" ])) : vue.createCommentVNode("v-if", true)]), _: 3 }, 8, [ "dir", "as", "as-child", "data-invalid", "data-disabled", "data-focused" ])]), _: 3 }); }; } }); var TagsInputRoot_default = TagsInputRoot_vue_vue_type_script_setup_true_lang_default; var TagsInputInput_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TagsInputInput", props: { placeholder: { type: String, required: false }, autoFocus: { type: Boolean, required: false }, maxLength: { type: Number, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "input" } }, setup(__props) { const props = __props; const context2 = injectTagsInputRootContext(); const { forwardRef, currentElement } = useForwardExpose(); function handleBlur(event) { context2.selectedElement.value = void 0; if (!context2.addOnBlur.value) return; const target = event.target; const relatedTarget = event.relatedTarget; const controlledId = target.getAttribute("aria-controls"); if (controlledId && (relatedTarget == null ? void 0 : relatedTarget.closest(`#${CSS.escape(controlledId)}`))) return; if (!target.value) return; const isAdded = context2.onAddValue(target.value); if (isAdded) target.value = ""; } function handleTab(event) { if (!context2.addOnTab.value) return; return handleCustomKeydown(event); } function handleEnter(event) { return handleCustomKeydown(event, { preventImplicitSubmit: true }); } const { isComposing, handleCompositionStart, handleCompositionEnd } = useComposing(); async function handleCustomKeydown(event, { preventImplicitSubmit = false } = {}) { if (isComposing.value) return; let isPreventedByOthers = event.defaultPrevented; const nativePreventDefault = event.preventDefault.bind(event); event.preventDefault = () => { isPreventedByOthers = true; nativePreventDefault(); }; const target = event.target; if (preventImplicitSubmit && target.value && !isPreventedByOthers) nativePreventDefault(); await vue.nextTick(); if (isPreventedByOthers) return; if (!target.value) return; const isAdded = context2.onAddValue(target.value); if (isAdded) target.value = ""; nativePreventDefault(); } function handleInput(event) { if (isComposing.value) return; context2.isInvalidInput.value = false; if (event.data === null) return; const delimiter = context2.delimiter.value; const matchesDelimiter = delimiter === event.data || delimiter instanceof RegExp && delimiter.test(event.data); if (matchesDelimiter) { const target = event.target; target.value = target.value.replace(delimiter, ""); if (target.value.trim() === "") { target.value = ""; return; } const isAdded = context2.onAddValue(target.value); if (isAdded) target.value = ""; } } function handleInputKeydown(event) { if (isComposing.value) return; context2.onInputKeydown(event); } function handlePaste(event) { if (context2.addOnPaste.value) { event.preventDefault(); const clipboardData = event.clipboardData; if (!clipboardData) return; const value = clipboardData.getData("text"); if (context2.delimiter.value) { const splitValue = value.split(context2.delimiter.value); splitValue.forEach((v) => { context2.onAddValue(v); }); } else context2.onAddValue(value); } } vue.onMounted(() => { const inputEl = currentElement.value.nodeName === "INPUT" ? currentElement.value : currentElement.value.querySelector("input"); if (!inputEl) return; setTimeout(() => { if (props.autoFocus) inputEl == null ? void 0 : inputEl.focus(); }, 1); }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { id: (_a2 = vue.unref(context2).id) == null ? void 0 : _a2.value, ref: vue.unref(forwardRef), type: "text", autocomplete: "off", autocorrect: "off", autocapitalize: "off", as: __props.as, "as-child": __props.asChild, maxlength: __props.maxLength, placeholder: __props.placeholder, disabled: vue.unref(context2).disabled.value, "data-invalid": vue.unref(context2).isInvalidInput.value ? "" : void 0, onInput: handleInput, onKeydown: [ vue.withKeys(handleEnter, ["enter"]), vue.withKeys(handleTab, ["tab"]), handleInputKeydown ], onBlur: handleBlur, onCompositionstart: vue.unref(handleCompositionStart), onCompositionend: vue.unref(handleCompositionEnd), onPaste: handlePaste }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "id", "as", "as-child", "maxlength", "placeholder", "disabled", "data-invalid", "onCompositionstart", "onCompositionend" ]); }; } }); var TagsInputInput_default = TagsInputInput_vue_vue_type_script_setup_true_lang_default; const [injectTagsInputItemContext, provideTagsInputItemContext] = createContext("TagsInputItem"); var TagsInputItem_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TagsInputItem", props: { value: { type: null, required: true }, disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const { value } = vue.toRefs(props); const context2 = injectTagsInputRootContext(); const { forwardRef, currentElement } = useForwardExpose(); const { CollectionItem } = useCollection(); const isSelected = vue.computed(() => context2.selectedElement.value === currentElement.value); const disabled = vue.computed(() => props.disabled || context2.disabled.value); const itemContext = provideTagsInputItemContext({ value, isSelected, disabled, textId: "", displayValue: vue.computed(() => context2.displayValue(value.value)) }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(CollectionItem), { value: vue.unref(value) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { ref: vue.unref(forwardRef), as: __props.as, "as-child": __props.asChild, "aria-labelledby": vue.unref(itemContext).textId, "aria-current": isSelected.value, "data-disabled": disabled.value ? "" : void 0, "data-state": isSelected.value ? "active" : "inactive" }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as", "as-child", "aria-labelledby", "aria-current", "data-disabled", "data-state" ])]), _: 3 }, 8, ["value"]); }; } }); var TagsInputItem_default = TagsInputItem_vue_vue_type_script_setup_true_lang_default; var TagsInputItemDelete_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TagsInputItemDelete", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; useForwardExpose(); const context2 = injectTagsInputRootContext(); const itemContext = injectTagsInputItemContext(); const disabled = vue.computed(() => { var _a2; return ((_a2 = itemContext.disabled) == null ? void 0 : _a2.value) || context2.disabled.value; }); function handleDelete() { if (disabled.value) return; const index = context2.modelValue.value.findIndex((i) => isEqual$1(i, itemContext.value.value)); context2.onRemoveValue(index); } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps({ tabindex: "-1" }, props, { "aria-labelledby": vue.unref(itemContext).textId, "aria-current": vue.unref(itemContext).isSelected.value, "data-state": vue.unref(itemContext).isSelected.value ? "active" : "inactive", "data-disabled": disabled.value ? "" : void 0, type: __props.as === "button" ? "button" : void 0, onClick: handleDelete }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "aria-labelledby", "aria-current", "data-state", "data-disabled", "type" ]); }; } }); var TagsInputItemDelete_default = TagsInputItemDelete_vue_vue_type_script_setup_true_lang_default; var TagsInputItemText_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TagsInputItemText", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "span" } }, setup(__props) { const props = __props; const itemContext = injectTagsInputItemContext(); useForwardExpose(); itemContext.textId || (itemContext.textId = useId(void 0, "reka-tags-input-item-text")); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(props, { id: vue.unref(itemContext).textId }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", {}, () => [vue.createTextVNode(vue.toDisplayString(vue.unref(itemContext).displayValue.value), 1)])]), _: 3 }, 16, ["id"]); }; } }); var TagsInputItemText_default = TagsInputItemText_vue_vue_type_script_setup_true_lang_default; const [injectTimeFieldRootContext, provideTimeFieldRootContext] = createContext("TimeFieldRoot"); function convertValue$1(value, date = $ad063034c8620db8$export$d0bdf45af03a6ea3($ad063034c8620db8$export$aa8b41735afcabd2())) { if (value && "day" in value) return value; return $d07e34cce18680fd$export$b21e0b124e224484(date, value); } var TimeFieldRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "TimeFieldRoot", props: { defaultValue: { type: Object, required: false, default: void 0 }, defaultPlaceholder: { type: Object, required: false }, placeholder: { type: Object, required: false, default: void 0 }, modelValue: { type: [Object, null], required: false }, hourCycle: { type: null, required: false }, step: { type: Object, required: false }, stepSnapping: { type: Boolean, required: false, default: false }, granularity: { type: String, required: false }, hideTimeZone: { type: Boolean, required: false }, maxValue: { type: Object, required: false }, minValue: { type: Object, required: false }, locale: { type: String, required: false }, disabled: { type: Boolean, required: false, default: false }, readonly: { type: Boolean, required: false, default: false }, id: { type: String, required: false }, dir: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, name: { type: String, required: false }, required: { type: Boolean, required: false } }, emits: ["update:modelValue", "update:placeholder"], setup(__props, { expose: __expose, emit: __emit }) { var _a2; const props = __props; const emits = __emit; const { disabled, readonly: readonly2, granularity, defaultValue, minValue, maxValue, stepSnapping, dir: propDir, locale: propLocale } = vue.toRefs(props); const locale = useLocale(propLocale); const dir = useDirection(propDir); const formatter = useDateFormatter(locale.value, { hourCycle: normalizeHourCycle(props.hourCycle) }); const { primitiveElement, currentElement: parentElement } = usePrimitiveElement(); const segmentElements = vue.ref( new Set()); const step = vue.computed(() => normalizeDateStep(props)); const convertedMinValue = vue.computed(() => minValue.value ? convertValue$1(minValue.value) : void 0); const convertedMaxValue = vue.computed(() => maxValue.value ? convertValue$1(maxValue.value) : void 0); vue.onMounted(() => { getTimeFieldSegmentElements(parentElement.value).forEach((item) => segmentElements.value.add(item)); }); const modelValue = useVModel(props, "modelValue", emits, { defaultValue: defaultValue.value, passive: props.modelValue === void 0 }); const convertedModelValue = vue.computed({ get() { if (isNullish(modelValue.value)) return modelValue.value; return convertValue$1(modelValue.value); }, set(newValue) { var _a3; if (newValue) modelValue.value = modelValue.value && "day" in modelValue.value ? newValue : new $2aaf608024c21ca1$export$680ea196effce5f(newValue.hour, newValue.minute, newValue.second, (_a3 = modelValue.value) == null ? void 0 : _a3.millisecond); else modelValue.value = newValue; return newValue; } }); const defaultDate = getDefaultTime({ defaultPlaceholder: props.placeholder, defaultValue: modelValue.value }); const placeholder = useVModel(props, "placeholder", emits, { defaultValue: (_a2 = props.defaultPlaceholder) != null ? _a2 : defaultDate.copy(), passive: props.placeholder === void 0 }); const convertedPlaceholder = vue.computed({ get() { return convertValue$1(placeholder.value); }, set(newValue) { var _a3; if (newValue) placeholder.value = "day" in placeholder.value ? newValue.copy() : new $2aaf608024c21ca1$export$680ea196effce5f(newValue.hour, newValue.minute, newValue.second, (_a3 = placeholder.value) == null ? void 0 : _a3.millisecond); return newValue; } }); const inferredGranularity = vue.computed(() => { if (granularity.value) return granularity.value; return "minute"; }); const isInvalid = vue.computed(() => { if (!modelValue.value) return false; if (convertedMinValue.value && isBefore(convertedModelValue.value, convertedMinValue.value)) return true; if (convertedMaxValue.value && isBefore(convertedMaxValue.value, convertedModelValue.value)) return true; return false; }); const initialSegments = initializeTimeSegmentValues(inferredGranularity.value); const segmentValues = vue.ref(modelValue.value ? { ...syncTimeSegmentValues({ value: convertedModelValue.value, formatter }) } : { ...initialSegments }); const allSegmentContent = vue.computed(() => createContent({ granularity: inferredGranularity.value, dateRef: convertedPlaceholder.value, formatter, hideTimeZone: props.hideTimeZone, hourCycle: props.hourCycle, segmentValues: segmentValues.value, locale, isTimeValue: true })); const segmentContents = vue.computed(() => { const contents = allSegmentContent.value.arr; if (props.hourCycle === 12) return contents.map((segment) => { if (segment.part === "hour" && "hour" in segmentValues.value) { const hour = segmentValues.value.hour; if (hour !== null) { const displayHour = hour === 0 ? 12 : hour > 12 ? hour - 12 : hour; return { ...segment, value: displayHour.toString() }; } } return segment; }); return contents; }); const editableSegmentContents = vue.computed(() => segmentContents.value.filter(({ part }) => part !== "literal")); vue.watch(locale, (value) => { if (formatter.getLocale() !== value) { formatter.setLocale(value); vue.nextTick(() => { segmentElements.value.clear(); getTimeFieldSegmentElements(parentElement.value).forEach((item) => segmentElements.value.add(item)); }); } }); vue.watch(convertedModelValue, (_modelValue) => { if (!isNullish(_modelValue) && (!$ad063034c8620db8$export$91b62ebf2ba703ee(convertedPlaceholder.value, _modelValue) || convertedPlaceholder.value.compare(_modelValue) !== 0)) placeholder.value = _modelValue.copy(); }); vue.watch([convertedModelValue, locale], ([_modelValue]) => { if (!isNullish(_modelValue)) segmentValues.value = { ...syncTimeSegmentValues({ value: _modelValue, formatter }) }; else if (Object.values(segmentValues.value).every((value) => value !== null) && isNullish(_modelValue)) segmentValues.value = { ...initialSegments }; }); const currentFocusedElement = vue.ref(null); const { nextFocusableSegment, prevFocusableSegment, focusNext } = useSegmentNavigation({ segmentElements, currentFocusedElement, dir, segmentAttributes: ["data-reka-time-field-segment"] }); const kbd = useKbd(); function handleKeydown(e) { var _a3, _b; if (e.isComposing) return; if (!isSegmentNavigationKey(e.key)) return; if (e.key === kbd.ARROW_LEFT) (_a3 = prevFocusableSegment.value) == null ? void 0 : _a3.focus(); if (e.key === kbd.ARROW_RIGHT) (_b = nextFocusableSegment.value) == null ? void 0 : _b.focus(); } function setFocusedElement(el) { currentFocusedElement.value = el; } provideTimeFieldRootContext({ locale, modelValue: convertedModelValue, placeholder: convertedPlaceholder, disabled, formatter, hourCycle: props.hourCycle, step, stepSnapping, readonly: readonly2, segmentValues, isInvalid, segmentContents: editableSegmentContents, elements: segmentElements, setFocusedElement, focusNext }); __expose({ setFocusedElement }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(_ctx.$attrs, { ref_key: "primitiveElement", ref: primitiveElement, role: "group", "aria-disabled": vue.unref(disabled) ? true : void 0, "data-disabled": vue.unref(disabled) ? "" : void 0, "data-readonly": vue.unref(readonly2) ? "" : void 0, "data-invalid": isInvalid.value ? "" : void 0, dir: vue.unref(dir), onKeydown: vue.withKeys(handleKeydown, ["left", "right"]) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue), segments: segmentContents.value, isInvalid: isInvalid.value }), vue.createVNode(vue.unref(VisuallyHidden_default), { id: __props.id, as: "input", feature: "focusable", "aria-hidden": "true", tabindex: "-1", value: vue.unref(modelValue) ? vue.unref(modelValue).toString() : "", name: __props.name, disabled: vue.unref(disabled), required: __props.required, onFocus: _cache[0] || (_cache[0] = ($event) => { var _a3, _b; return (_b = (_a3 = Array.from(segmentElements.value)) == null ? void 0 : _a3[0]) == null ? void 0 : _b.focus(); }) }, null, 8, [ "id", "value", "name", "disabled", "required" ])]), _: 3 }, 16, [ "aria-disabled", "data-disabled", "data-readonly", "data-invalid", "dir" ]); }; } }); var TimeFieldRoot_default = TimeFieldRoot_vue_vue_type_script_setup_true_lang_default; var TimeFieldInput_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TimeFieldInput", props: { part: { type: null, required: true }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const rootContext = injectTimeFieldRootContext(); const hasLeftFocus = vue.ref(true); const lastKeyZero = vue.ref(false); const { handleSegmentClick, handleSegmentKeydown, handleSegmentBeforeInput, handleSegmentCompositionStart, handleSegmentCompositionEnd, handleSegmentFocusOut, attributes } = useDateField({ hasLeftFocus, lastKeyZero, placeholder: rootContext.placeholder, hourCycle: rootContext.hourCycle, step: rootContext.step, stepSnapping: rootContext.stepSnapping, segmentValues: rootContext.segmentValues, formatter: rootContext.formatter, part: props.part, disabled: rootContext.disabled, readonly: rootContext.readonly, focusNext: rootContext.focusNext, modelValue: rootContext.modelValue }); const disabled = vue.computed(() => rootContext.disabled.value); const readonly2 = vue.computed(() => rootContext.readonly.value); const isInvalid = vue.computed(() => rootContext.isInvalid.value); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps({ as: __props.as, "as-child": __props.asChild }, vue.unref(attributes), { contenteditable: disabled.value || readonly2.value ? false : __props.part !== "literal", "data-reka-time-field-segment": __props.part, "aria-disabled": disabled.value ? true : void 0, "aria-readonly": readonly2.value ? true : void 0, "data-disabled": disabled.value ? "" : void 0, "data-invalid": isInvalid.value ? "" : void 0, "aria-invalid": isInvalid.value ? true : void 0 }, vue.toHandlers(__props.part !== "literal" ? { mousedown: vue.unref(handleSegmentClick), keydown: vue.unref(handleSegmentKeydown), beforeinput: vue.unref(handleSegmentBeforeInput), compositionstart: vue.unref(handleSegmentCompositionStart), compositionend: vue.unref(handleSegmentCompositionEnd), focusout: () => { hasLeftFocus.value = true; vue.unref(handleSegmentFocusOut)(); }, focusin: (e) => { vue.unref(rootContext).setFocusedElement(e.target); } } : {})), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "as", "as-child", "contenteditable", "data-reka-time-field-segment", "aria-disabled", "aria-readonly", "data-disabled", "data-invalid", "aria-invalid" ]); }; } }); var TimeFieldInput_default = TimeFieldInput_vue_vue_type_script_setup_true_lang_default; const [injectTimeRangeFieldRootContext, provideTimeRangeFieldRootContext] = createContext("TimeRangeFieldRoot"); function convertValue(value, date = $ad063034c8620db8$export$d0bdf45af03a6ea3($ad063034c8620db8$export$aa8b41735afcabd2())) { if (value && "day" in value) return value; return $d07e34cce18680fd$export$b21e0b124e224484(date, value); } var TimeRangeFieldRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "TimeRangeFieldRoot", props: { defaultValue: { type: Object, required: false, default: void 0 }, defaultPlaceholder: { type: Object, required: false }, placeholder: { type: Object, required: false, default: void 0 }, modelValue: { type: [Object, null], required: false }, hourCycle: { type: null, required: false }, step: { type: Object, required: false }, granularity: { type: String, required: false }, hideTimeZone: { type: Boolean, required: false }, maxValue: { type: Object, required: false }, minValue: { type: Object, required: false }, locale: { type: String, required: false }, disabled: { type: Boolean, required: false, default: false }, readonly: { type: Boolean, required: false, default: false }, id: { type: String, required: false }, dir: { type: String, required: false }, isTimeUnavailable: { type: Function, required: false, default: void 0 }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, name: { type: String, required: false }, required: { type: Boolean, required: false } }, emits: ["update:modelValue", "update:placeholder"], setup(__props, { expose: __expose, emit: __emit }) { var _a2, _b, _c, _d, _e2, _f, _g; const props = __props; const emits = __emit; const { disabled, readonly: readonly2, granularity, defaultValue, minValue, maxValue, dir: propDir, locale: propLocale, isTimeUnavailable: propsIsTimeUnavailable } = vue.toRefs(props); const locale = useLocale(propLocale); const dir = useDirection(propDir); const formatter = useDateFormatter(locale.value, { hourCycle: normalizeHourCycle(props.hourCycle) }); const { primitiveElement, currentElement: parentElement } = usePrimitiveElement(); const segmentElements = vue.ref( new Set()); const step = vue.computed(() => normalizeDateStep(props)); const convertedMinValue = vue.computed(() => minValue.value ? convertValue(minValue.value) : void 0); const convertedMaxValue = vue.computed(() => maxValue.value ? convertValue(maxValue.value) : void 0); vue.onMounted(() => { getTimeFieldSegmentElements(parentElement.value).forEach((item) => segmentElements.value.add(item)); }); const modelValue = useVModel(props, "modelValue", emits, { defaultValue: (_a2 = defaultValue.value) != null ? _a2 : { start: void 0, end: void 0 }, passive: props.modelValue === void 0 }); const isStartInvalid = vue.computed(() => { var _a3, _b2; if (!((_a3 = modelValue.value) == null ? void 0 : _a3.start)) return false; const convertedStartValue$1 = convertValue(modelValue.value.start); if ((_b2 = propsIsTimeUnavailable.value) == null ? void 0 : _b2.call(propsIsTimeUnavailable, convertedStartValue$1)) return true; if (convertedMinValue.value && isBefore(convertedStartValue$1, convertedMinValue.value)) return true; if (convertedMaxValue.value && isBefore(convertedMaxValue.value, convertedStartValue$1)) return true; return false; }); const isEndInvalid = vue.computed(() => { var _a3, _b2; if (!((_a3 = modelValue.value) == null ? void 0 : _a3.end)) return false; const convertedEndValue$1 = convertValue(modelValue.value.end); if ((_b2 = propsIsTimeUnavailable.value) == null ? void 0 : _b2.call(propsIsTimeUnavailable, convertedEndValue$1)) return true; if (convertedMinValue.value && isBefore(convertedEndValue$1, convertedMinValue.value)) return true; if (convertedMaxValue.value && isBefore(convertedMaxValue.value, convertedEndValue$1)) return true; return false; }); const isInvalid = vue.computed(() => { var _a3, _b2; if (isStartInvalid.value || isEndInvalid.value) return true; if (!((_a3 = modelValue.value) == null ? void 0 : _a3.start) || !((_b2 = modelValue.value) == null ? void 0 : _b2.end)) return false; const convertedModelValue$1 = { start: convertValue(modelValue.value.start), end: convertValue(modelValue.value.end) }; if (!isBeforeOrSame(convertedModelValue$1.start, convertedModelValue$1.end)) return true; if (propsIsTimeUnavailable.value !== void 0) { const allValid = areAllDaysBetweenValid(convertedModelValue$1.start, convertedModelValue$1.end, propsIsTimeUnavailable.value, void 0); if (!allValid) return true; } return false; }); const startValue = vue.ref((_c = (_b = modelValue.value) == null ? void 0 : _b.start) == null ? void 0 : _c.copy()); const endValue = vue.ref((_e2 = (_d = modelValue.value) == null ? void 0 : _d.end) == null ? void 0 : _e2.copy()); vue.watch([startValue, endValue], ([_startValue, _endValue]) => { modelValue.value = { start: _startValue == null ? void 0 : _startValue.copy(), end: _endValue == null ? void 0 : _endValue.copy() }; }); const convertedStartValue = vue.computed({ get() { if (isNullish(startValue.value)) return startValue.value; return convertValue(startValue.value); }, set(newValue) { var _a3; if (newValue) startValue.value = startValue.value && "day" in startValue.value ? newValue : new $2aaf608024c21ca1$export$680ea196effce5f(newValue.hour, newValue.minute, newValue.second, (_a3 = startValue.value) == null ? void 0 : _a3.millisecond); else startValue.value = newValue; return newValue; } }); const convertedEndValue = vue.computed({ get() { if (isNullish(endValue.value)) return endValue.value; return convertValue(endValue.value); }, set(newValue) { var _a3; if (newValue) endValue.value = endValue.value && "day" in endValue.value ? newValue : new $2aaf608024c21ca1$export$680ea196effce5f(newValue.hour, newValue.minute, newValue.second, (_a3 = endValue.value) == null ? void 0 : _a3.millisecond); else endValue.value = newValue; return newValue; } }); const convertedModelValue = vue.computed(() => ({ start: convertedStartValue.value, end: convertedEndValue.value })); const defaultDate = getDefaultTime({ defaultPlaceholder: props.placeholder, defaultValue: (_f = modelValue.value) == null ? void 0 : _f.start }); const placeholder = useVModel(props, "placeholder", emits, { defaultValue: (_g = props.defaultPlaceholder) != null ? _g : defaultDate.copy(), passive: props.placeholder === void 0 }); const convertedPlaceholder = vue.computed({ get() { return convertValue(placeholder.value); }, set(newValue) { var _a3; if (newValue) placeholder.value = "day" in placeholder.value ? newValue.copy() : new $2aaf608024c21ca1$export$680ea196effce5f(newValue.hour, newValue.minute, newValue.second, (_a3 = placeholder.value) == null ? void 0 : _a3.millisecond); return newValue; } }); const inferredGranularity = vue.computed(() => { if (granularity.value) return granularity.value; return "minute"; }); const initialSegments = initializeTimeSegmentValues(inferredGranularity.value); const startSegmentValues = vue.ref(convertedStartValue.value ? { ...syncTimeSegmentValues({ value: convertedStartValue.value, formatter }) } : { ...initialSegments }); const endSegmentValues = vue.ref(convertedEndValue.value ? { ...syncTimeSegmentValues({ value: convertedEndValue.value, formatter }) } : { ...initialSegments }); const startSegmentContent = vue.computed(() => createContent({ granularity: inferredGranularity.value, dateRef: convertedPlaceholder.value, formatter, hideTimeZone: props.hideTimeZone, hourCycle: props.hourCycle, segmentValues: startSegmentValues.value, locale, isTimeValue: true })); const endSegmentContent = vue.computed(() => createContent({ granularity: inferredGranularity.value, dateRef: convertedPlaceholder.value, formatter, hideTimeZone: props.hideTimeZone, hourCycle: props.hourCycle, segmentValues: endSegmentValues.value, locale, isTimeValue: true })); const segmentContents = vue.computed(() => ({ start: startSegmentContent.value.arr, end: endSegmentContent.value.arr })); const editableSegmentContents = vue.computed(() => ({ start: segmentContents.value.start.filter(({ part }) => part !== "literal"), end: segmentContents.value.end.filter(({ part }) => part !== "literal") })); vue.watch(modelValue, (_modelValue) => { var _a3, _b2; const isStartChanged = (_modelValue == null ? void 0 : _modelValue.start) && startValue.value ? convertValue(_modelValue.start).compare(convertValue(startValue.value)) !== 0 : (_modelValue == null ? void 0 : _modelValue.start) !== startValue.value; if (isStartChanged) startValue.value = (_a3 = _modelValue == null ? void 0 : _modelValue.start) == null ? void 0 : _a3.copy(); const isEndChanged = (_modelValue == null ? void 0 : _modelValue.end) && endValue.value ? convertValue(_modelValue.end).compare(convertValue(endValue.value)) !== 0 : (_modelValue == null ? void 0 : _modelValue.end) !== endValue.value; if (isEndChanged) endValue.value = (_b2 = _modelValue == null ? void 0 : _modelValue.end) == null ? void 0 : _b2.copy(); }); vue.watch([convertedStartValue, locale], ([_startValue]) => { if (_startValue !== void 0) startSegmentValues.value = { ...syncSegmentValues({ value: _startValue, formatter }) }; else if (Object.values(startSegmentValues.value).every((value) => value !== null) && _startValue === void 0) startSegmentValues.value = { ...initialSegments }; }); vue.watch(locale, (value) => { if (formatter.getLocale() !== value) { formatter.setLocale(value); vue.nextTick(() => { segmentElements.value.clear(); getTimeFieldSegmentElements(parentElement.value).forEach((item) => segmentElements.value.add(item)); }); } }); vue.watch(convertedModelValue, (_modelValue) => { if (_modelValue && _modelValue.start !== void 0 && placeholder.value.compare(_modelValue.start) !== 0) placeholder.value = _modelValue.start.copy(); }); vue.watch([convertedEndValue, locale], ([_endValue]) => { if (_endValue !== void 0) endSegmentValues.value = { ...syncSegmentValues({ value: _endValue, formatter }) }; else if (Object.values(endSegmentValues.value).every((value) => value !== null) && _endValue === void 0) endSegmentValues.value = { ...initialSegments }; }); const currentFocusedElement = vue.ref(null); const { nextFocusableSegment, prevFocusableSegment, focusNext } = useSegmentNavigation({ segmentElements, currentFocusedElement, dir, segmentAttributes: ["data-reka-time-field-segment", "data-reka-time-range-field-segment-type"] }); const kbd = useKbd(); function handleKeydown(e) { var _a3, _b2; if (e.isComposing) return; if (!isSegmentNavigationKey(e.key)) return; if (e.key === kbd.ARROW_LEFT) (_a3 = prevFocusableSegment.value) == null ? void 0 : _a3.focus(); if (e.key === kbd.ARROW_RIGHT) (_b2 = nextFocusableSegment.value) == null ? void 0 : _b2.focus(); } function setFocusedElement(el) { currentFocusedElement.value = el; } provideTimeRangeFieldRootContext({ locale, startValue: convertedStartValue, endValue: convertedEndValue, placeholder: convertedPlaceholder, disabled, formatter, hourCycle: props.hourCycle, step, readonly: readonly2, isInvalid, segmentValues: { start: startSegmentValues, end: endSegmentValues }, segmentContents: editableSegmentContents, elements: segmentElements, setFocusedElement, focusNext }); __expose({ setFocusedElement }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(_ctx.$attrs, { ref_key: "primitiveElement", ref: primitiveElement, role: "group", "aria-disabled": vue.unref(disabled) ? true : void 0, "data-disabled": vue.unref(disabled) ? "" : void 0, "data-readonly": vue.unref(readonly2) ? "" : void 0, "data-invalid": isInvalid.value ? "" : void 0, dir: vue.unref(dir), onKeydown: vue.withKeys(handleKeydown, ["left", "right"]) }), { default: vue.withCtx(() => { var _a3, _b2, _c2, _d2; return [vue.renderSlot(_ctx.$slots, "default", { modelValue: vue.unref(modelValue), segments: segmentContents.value, isInvalid: isInvalid.value }), vue.createVNode(vue.unref(VisuallyHidden_default), { id: __props.id, as: "input", feature: "focusable", "aria-hidden": "true", tabindex: "-1", value: `${(_b2 = (_a3 = vue.unref(modelValue)) == null ? void 0 : _a3.start) == null ? void 0 : _b2.toString()} - ${(_d2 = (_c2 = vue.unref(modelValue)) == null ? void 0 : _c2.end) == null ? void 0 : _d2.toString()}`, name: __props.name, disabled: vue.unref(disabled), required: __props.required, onFocus: _cache[0] || (_cache[0] = ($event) => { var _a4, _b3; return (_b3 = (_a4 = Array.from(segmentElements.value)) == null ? void 0 : _a4[0]) == null ? void 0 : _b3.focus(); }) }, null, 8, [ "id", "value", "name", "disabled", "required" ])]; }), _: 3 }, 16, [ "aria-disabled", "data-disabled", "data-readonly", "data-invalid", "dir" ]); }; } }); var TimeRangeFieldRoot_default = TimeRangeFieldRoot_vue_vue_type_script_setup_true_lang_default; var TimeRangeFieldInput_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TimeRangeFieldInput", props: { part: { type: null, required: true }, type: { type: String, required: true }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; const rootContext = injectTimeRangeFieldRootContext(); const hasLeftFocus = vue.ref(true); const lastKeyZero = vue.ref(false); const { handleSegmentClick, handleSegmentKeydown, handleSegmentBeforeInput, handleSegmentCompositionStart, handleSegmentCompositionEnd, attributes } = useDateField({ hasLeftFocus, lastKeyZero, placeholder: rootContext.placeholder, hourCycle: rootContext.hourCycle, step: rootContext.step, segmentValues: rootContext.segmentValues[props.type], formatter: rootContext.formatter, part: props.part, disabled: rootContext.disabled, readonly: rootContext.readonly, focusNext: rootContext.focusNext, modelValue: props.type === "start" ? rootContext.startValue : rootContext.endValue }); const disabled = vue.computed(() => rootContext.disabled.value); const readonly2 = vue.computed(() => rootContext.readonly.value); const isInvalid = vue.computed(() => rootContext.isInvalid.value); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps({ as: __props.as, "as-child": __props.asChild }, vue.unref(attributes), { contenteditable: disabled.value || readonly2.value ? false : __props.part !== "literal", "data-reka-time-field-segment": __props.part, "data-reka-time-range-field-segment-type": __props.type, "aria-disabled": disabled.value ? true : void 0, "aria-readonly": readonly2.value ? true : void 0, "data-disabled": disabled.value ? "" : void 0, "data-invalid": isInvalid.value ? "" : void 0, "aria-invalid": isInvalid.value ? true : void 0 }, vue.toHandlers(__props.part !== "literal" ? { mousedown: vue.unref(handleSegmentClick), keydown: vue.unref(handleSegmentKeydown), beforeinput: vue.unref(handleSegmentBeforeInput), compositionstart: vue.unref(handleSegmentCompositionStart), compositionend: vue.unref(handleSegmentCompositionEnd), focusout: () => { hasLeftFocus.value = true; }, focusin: (e) => { vue.unref(rootContext).setFocusedElement(e.target); } } : {})), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "as", "as-child", "contenteditable", "data-reka-time-field-segment", "data-reka-time-range-field-segment-type", "aria-disabled", "aria-readonly", "data-disabled", "data-invalid", "aria-invalid" ]); }; } }); var TimeRangeFieldInput_default = TimeRangeFieldInput_vue_vue_type_script_setup_true_lang_default; const TOAST_MANAGER_SUBSCRIBE = Symbol("ToastManagerSubscribe"); let count = 0; function generateToastId() { count = (count + 1) % Number.MAX_SAFE_INTEGER; return `reka-toast-${count}`; } function resolvePromiseState(state2, value) { const resolved = typeof state2 === "function" ? state2(value) : state2; return typeof resolved === "string" ? { description: resolved } : resolved; } function runToastPromise(promise, options, add, update) { const loading = typeof options.loading === "string" ? { description: options.loading } : options.loading; const id = add({ ...loading, status: "loading" }); return promise.then((value) => { update(id, { ...resolvePromiseState(options.success, value), status: "success" }); return value; }, (error) => { update(id, { ...resolvePromiseState(options.error, error), status: "error" }); throw error; }); } var ToastAnnounceExclude_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ToastAnnounceExclude", props: { altText: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: __props.as, "as-child": __props.asChild, "data-reka-toast-announce-exclude": "", "data-reka-toast-announce-alt": __props.altText || void 0 }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 8, [ "as", "as-child", "data-reka-toast-announce-alt" ]); }; } }); var ToastAnnounceExclude_default = ToastAnnounceExclude_vue_vue_type_script_setup_true_lang_default; function useToastStore() { const toasts = vue.shallowRef([]); const restartKeys = vue.reactive( new Map()); function find(id) { return toasts.value.find((toast2) => toast2.id === id); } function replace(id, next) { toasts.value = toasts.value.map((toast2) => toast2.id === id ? next : toast2); } function remove2(id) { var _a2; const toast2 = find(id); if (!toast2 || toast2.open) return; toasts.value = toasts.value.filter((item) => item.id !== id); restartKeys.delete(id); (_a2 = toast2.onRemove) == null ? void 0 : _a2.call(toast2); } function add(options) { var _a2, _b; const id = (_a2 = options.id) != null ? _a2 : generateToastId(); const existing = find(id); if (existing == null ? void 0 : existing.open) { const { id: _id, ...updates } = options; replace(id, { ...existing, ...updates, updateKey: existing.updateKey + 1 }); restartKeys.set(id, ((_b = restartKeys.get(id)) != null ? _b : 0) + 1); return id; } const rest = existing ? toasts.value.filter((toast2) => toast2.id !== id) : toasts.value; toasts.value = [{ ...options, id, open: true, updateKey: 0 }, ...rest]; return id; } function close(id) { const closing = toasts.value.filter((toast2) => toast2.open && (id === void 0 || toast2.id === id)); if (!closing.length) return; toasts.value = toasts.value.map((toast2) => closing.includes(toast2) ? { ...toast2, open: false } : toast2); closing.forEach((toast2) => { var _a2; return (_a2 = toast2.onClose) == null ? void 0 : _a2.call(toast2); }); } function update(id, updates) { const prevToast = find(id); if (!(prevToast == null ? void 0 : prevToast.open)) return; const patch = typeof updates === "function" ? updates(prevToast) : updates; const current = find(id); if (!(current == null ? void 0 : current.open)) return; replace(id, { ...current, ...patch, id, open: true, updateKey: current.updateKey + 1 }); } return { toasts, add, close, update, promise: (promise, options) => runToastPromise(promise, options, add, update), remove: remove2, getRestartKey: (id) => { var _a2; return (_a2 = restartKeys.get(id)) != null ? _a2 : 0; } }; } const [injectToastProviderContext, provideToastProviderContext] = createContext("ToastProvider"); var ToastProvider_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "ToastProvider", props: { label: { type: String, required: false, default: "Notification" }, duration: { type: Number, required: false, default: 5e3 }, disableSwipe: { type: Boolean, required: false }, swipeDirection: { type: String, required: false, default: "right" }, swipeThreshold: { type: Number, required: false, default: 50 }, limit: { type: Number, required: false }, toastManager: { type: Object, required: false } }, setup(__props) { const props = __props; const { label, duration, disableSwipe, swipeDirection, swipeThreshold } = vue.toRefs(props); useCollection({ isProvider: true }); const viewport = vue.ref(); const toastCount = vue.ref(0); const isFocusedToastEscapeKeyDownRef = vue.ref(false); const isClosePausedRef = vue.ref(false); const toastStore = useToastStore(); vue.onMounted(() => { vue.watch(() => props.toastManager, (manager, _2, onCleanup) => { if (!manager) return; const unsubscribe = manager[TOAST_MANAGER_SUBSCRIBE]((event) => { if (event.action === "add") toastStore.add(event.options); else if (event.action === "close") toastStore.close(event.id); else toastStore.update(event.id, event.updates); }); onCleanup(unsubscribe); }, { immediate: true }); }); const entries = vue.shallowReactive([]); let seq = 0; const stack = vue.computed(() => { const ordered = [...entries].sort((a, b) => b.seq - a.seq); const states = new Map(); let visibleIndex = 0; let offsetY = 0; ordered.forEach((entry, index) => { const closing = !entry.open; states.set(entry, { index: closing ? index : visibleIndex, offsetY, limited: !closing && props.limit !== void 0 && visibleIndex >= props.limit }); if (!closing) { offsetY += entry.height; visibleIndex++; } }); return { ordered, states }; }); const hovering = vue.ref(false); const focused = vue.ref(false); if (props.label && typeof props.label === "string" && !props.label.trim()) { const error = "Invalid prop `label` supplied to `ToastProvider`. Expected non-empty `string`."; throw new Error(error); } provideToastProviderContext({ label, duration, disableSwipe, swipeDirection, swipeThreshold, toastCount, viewport, onViewportChange(el) { viewport.value = el; }, onToastAdd() { toastCount.value++; }, onToastRemove() { toastCount.value--; }, isFocusedToastEscapeKeyDownRef, isClosePausedRef, toastStore, hovering, focused, expanded: vue.computed(() => hovering.value || focused.value), frontmostHeight: vue.computed(() => { var _a2; return ((_a2 = stack.value.ordered.find((entry) => entry.open)) == null ? void 0 : _a2.height) || void 0; }), closingCount: vue.computed(() => entries.filter((entry) => !entry.open).length), registerToast(entry) { entry.seq = ++seq; entries.push(entry); return () => { const index = entries.indexOf(entry); if (index !== -1) entries.splice(index, 1); }; }, reopenToast(entry) { entry.seq = ++seq; }, getToastStack(entry) { var _a2; return (_a2 = stack.value.states.get(entry)) != null ? _a2 : { index: 0, offsetY: 0, limited: false }; } }); return (_ctx, _cache) => { return vue.renderSlot(_ctx.$slots, "default"); }; } }); var ToastProvider_default = ToastProvider_vue_vue_type_script_setup_true_lang_default; var ToastAnnounce_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ToastAnnounce", setup(__props) { const providerContext = injectToastProviderContext(); const isAnnounced = useTimeout(1e3); const renderAnnounceText = vue.ref(false); let raf1 = 0; let raf2 = 0; if (isClient) { raf1 = requestAnimationFrame(() => { raf2 = requestAnimationFrame(() => { renderAnnounceText.value = true; }); }); vue.onScopeDispose(() => { cancelAnimationFrame(raf1); cancelAnimationFrame(raf2); }); } return (_ctx, _cache) => { return vue.unref(isAnnounced) || renderAnnounceText.value ? (vue.openBlock(), vue.createBlock(vue.unref(VisuallyHidden_default), { key: 0, feature: "fully-hidden" }, { default: vue.withCtx(() => [vue.createTextVNode(vue.toDisplayString(vue.unref(providerContext).label.value) + " ", 1), vue.renderSlot(_ctx.$slots, "default")]), _: 3 })) : vue.createCommentVNode("v-if", true); }; } }); var ToastAnnounce_default = ToastAnnounce_vue_vue_type_script_setup_true_lang_default; const [injectToastPositionerContext] = createContext("ToastPositioner"); const TOAST_SWIPE_START = "toast.swipeStart"; const TOAST_SWIPE_MOVE = "toast.swipeMove"; const TOAST_SWIPE_CANCEL = "toast.swipeCancel"; const TOAST_SWIPE_END = "toast.swipeEnd"; const VIEWPORT_PAUSE = "toast.viewportPause"; const VIEWPORT_RESUME = "toast.viewportResume"; function handleAndDispatchCustomEvent(name, handler, detail) { const currentTarget = detail.originalEvent.currentTarget; const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail }); if (handler) currentTarget.addEventListener(name, handler, { once: true }); currentTarget.dispatchEvent(event); } function isDeltaInDirection(delta, direction, threshold = 0) { const deltaX = Math.abs(delta.x); const deltaY = Math.abs(delta.y); const isDeltaX = deltaX > deltaY; if (direction === "left" || direction === "right") return isDeltaX && deltaX > threshold; else return !isDeltaX && deltaY > threshold; } function getAnnounceTextContent(container) { const textContent = []; const childNodes = Array.from(container.childNodes); childNodes.forEach((node) => { if (node.nodeType === node.TEXT_NODE && node.textContent) textContent.push(node.textContent); if (isHTMLElement$1(node)) { const isHidden2 = node.ariaHidden || node.hidden || node.style.display === "none"; const isExcluded = node.dataset.rekaToastAnnounceExclude === ""; if (!isHidden2) if (isExcluded) { const altText = node.dataset.rekaToastAnnounceAlt; if (altText) textContent.push(altText); } else textContent.push(...getAnnounceTextContent(node)); } }); return textContent; } const [injectToastRootContext, provideToastRootContext] = createContext("ToastRoot"); var ToastRootImpl_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "ToastRootImpl", props: { type: { type: String, required: false }, open: { type: Boolean, required: false, default: false }, duration: { type: Number, required: false }, toast: { type: Object, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "li" } }, emits: [ "close", "escapeKeyDown", "pause", "resume", "swipeStart", "swipeMove", "swipeCancel", "swipeEnd" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { forwardRef, currentElement } = useForwardExpose(); const { CollectionItem } = useCollection(); const providerContext = injectToastProviderContext(); const pointerStartRef = vue.ref(null); const swipeDeltaRef = vue.ref(null); const duration = vue.computed(() => typeof props.duration === "number" ? props.duration : providerContext.duration.value); const closeTimerStartTimeRef = vue.ref(0); const closeTimerRemainingTimeRef = vue.ref(duration.value); const closeTimerRef = vue.ref(0); const remainingTime = vue.ref(duration.value); const remainingRaf = useRafFn(() => { const elapsedTime = Date.now() - closeTimerStartTimeRef.value; remainingTime.value = Math.max(closeTimerRemainingTimeRef.value - elapsedTime, 0); }, { fpsLimit: 60 }); function startTimer(duration$1) { if (duration$1 <= 0 || duration$1 === Number.POSITIVE_INFINITY) return; if (!isClient) return; window.clearTimeout(closeTimerRef.value); closeTimerStartTimeRef.value = Date.now(); closeTimerRef.value = window.setTimeout(handleClose, duration$1); } function handleClose(event) { var _a2, _b; const isNonPointerEvent = (event == null ? void 0 : event.pointerType) === ""; const isFocusInToast = (_a2 = currentElement.value) == null ? void 0 : _a2.contains(getActiveElement()); if (isFocusInToast && isNonPointerEvent) (_b = providerContext.viewport.value) == null ? void 0 : _b.focus(); if (isNonPointerEvent) providerContext.isClosePausedRef.value = false; emits("close"); } const positionerContext = injectToastPositionerContext(null); const announceTextContent = vue.shallowRef(null); vue.watch([currentElement, () => { var _a2; return (_a2 = props.toast) == null ? void 0 : _a2.updateKey; }], ([element]) => { announceTextContent.value = element ? getAnnounceTextContent(element) : null; }, { flush: "post", immediate: true }); const stackEntry = vue.reactive({ seq: 0, height: 0, open: props.open }); const stack = vue.computed(() => providerContext.getToastStack(stackEntry)); function measureHeight() { const element = currentElement.value; if (!element) return; const previousHeight = element.style.height; element.style.height = "auto"; stackEntry.height = element.offsetHeight; element.style.height = previousHeight; } useResizeObserver(currentElement, measureHeight); vue.watch(() => { var _a2; return (_a2 = props.toast) == null ? void 0 : _a2.updateKey; }, measureHeight, { flush: "post" }); vue.watch(() => props.open, (open, wasOpen) => { stackEntry.open = open; if (open && !wasOpen) providerContext.reopenToast(stackEntry); }); if (props.type && !["foreground", "background"].includes(props.type)) { const error = "Invalid prop `type` supplied to `Toast`. Expected `foreground | background`."; throw new Error(error); } vue.watchEffect((cleanupFn) => { const viewport = providerContext.viewport.value; if (viewport) { const handleResume = () => { startTimer(closeTimerRemainingTimeRef.value); remainingRaf.resume(); emits("resume"); }; const handlePause = () => { const elapsedTime = Date.now() - closeTimerStartTimeRef.value; closeTimerRemainingTimeRef.value = closeTimerRemainingTimeRef.value - elapsedTime; window.clearTimeout(closeTimerRef.value); remainingRaf.pause(); emits("pause"); }; viewport.addEventListener(VIEWPORT_PAUSE, handlePause); viewport.addEventListener(VIEWPORT_RESUME, handleResume); cleanupFn(() => { viewport.removeEventListener(VIEWPORT_PAUSE, handlePause); viewport.removeEventListener(VIEWPORT_RESUME, handleResume); }); } }); const restartKey = vue.computed(() => props.toast ? providerContext.toastStore.getRestartKey(props.toast.id) : 0); vue.watch([ () => props.open, duration, restartKey ], () => { closeTimerRemainingTimeRef.value = duration.value; if (props.open && !providerContext.isClosePausedRef.value) startTimer(duration.value); }, { immediate: true }); onKeyStroke("Escape", (event) => { emits("escapeKeyDown", event); if (!event.defaultPrevented) { providerContext.isFocusedToastEscapeKeyDownRef.value = true; handleClose(); } }); let unregisterToast; vue.onMounted(() => { providerContext.onToastAdd(); unregisterToast = providerContext.registerToast(stackEntry); measureHeight(); }); vue.onUnmounted(() => { providerContext.onToastRemove(); unregisterToast == null ? void 0 : unregisterToast(); }); provideToastRootContext({ onClose: handleClose, toast: vue.toRef(props, "toast") }); return (_ctx, _cache) => { var _a2, _b, _c; return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [announceTextContent.value ? (vue.openBlock(), vue.createBlock(ToastAnnounce_default, { key: (_b = (_a2 = __props.toast) == null ? void 0 : _a2.updateKey) != null ? _b : 0, role: "alert", "aria-live": __props.type === "foreground" ? "assertive" : "polite" }, { default: vue.withCtx(() => [vue.createCommentVNode("\n Render each chunk as its own text node so screen readers get the\n natural pause break between nodes (see comment in utils.ts).\n Interpolating the array directly with `{{ announceTextContent }}`\n would route through Vue's `toDisplayString`, which JSON-stringifies\n arrays — the live region would then announce literal `[`, quotes\n and commas instead of the toast title and description.\n "), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(announceTextContent.value, (text, i) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: i }, [vue.createTextVNode(vue.toDisplayString(text), 1)], 64); }), 128))]), _: 1 }, 8, ["aria-live"])) : vue.createCommentVNode("v-if", true), vue.unref(providerContext).viewport.value || vue.unref(positionerContext) ? (vue.openBlock(), vue.createBlock(vue.Teleport, { key: 1, to: (_c = vue.unref(providerContext).viewport.value) != null ? _c : "body", disabled: !!vue.unref(positionerContext) }, [vue.createVNode(vue.unref(CollectionItem), null, { default: vue.withCtx(() => { var _a3; return [vue.createVNode(vue.unref(Primitive), vue.mergeProps({ ref: vue.unref(forwardRef), tabindex: "0" }, _ctx.$attrs, { as: __props.as, "as-child": __props.asChild, "data-state": __props.open ? "open" : "closed", "data-swipe-direction": vue.unref(providerContext).swipeDirection.value, "data-status": (_a3 = __props.toast) == null ? void 0 : _a3.status, "data-expanded": vue.unref(providerContext).expanded.value ? "" : void 0, "data-limited": stack.value.limited ? "" : void 0, inert: stack.value.limited || void 0, style: { ...vue.unref(providerContext).disableSwipe.value ? void 0 : { userSelect: "none", touchAction: "none" }, "--reka-toast-index": stack.value.index, "--reka-toast-offset-y": `${stack.value.offsetY}px`, "--reka-toast-height": stackEntry.height ? `${stackEntry.height}px` : void 0 }, onPointerdown: _cache[0] || (_cache[0] = vue.withModifiers((event) => { if (vue.unref(providerContext).disableSwipe.value) return; pointerStartRef.value = { x: event.clientX, y: event.clientY }; }, ["left"])), onPointermove: _cache[1] || (_cache[1] = (event) => { if (vue.unref(providerContext).disableSwipe.value || !pointerStartRef.value) return; const x = event.clientX - pointerStartRef.value.x; const y = event.clientY - pointerStartRef.value.y; const hasSwipeMoveStarted = Boolean(swipeDeltaRef.value); const isHorizontalSwipe = ["left", "right"].includes(vue.unref(providerContext).swipeDirection.value); const clamp2 = ["left", "up"].includes(vue.unref(providerContext).swipeDirection.value) ? Math.min : Math.max; const clampedX = isHorizontalSwipe ? clamp2(0, x) : 0; const clampedY = !isHorizontalSwipe ? clamp2(0, y) : 0; const moveStartBuffer = event.pointerType === "touch" ? 10 : 2; const delta = { x: clampedX, y: clampedY }; const eventDetail = { originalEvent: event, delta }; if (hasSwipeMoveStarted) { swipeDeltaRef.value = delta; vue.unref(handleAndDispatchCustomEvent)(vue.unref(TOAST_SWIPE_MOVE), (ev) => emits("swipeMove", ev), eventDetail); } else if (vue.unref(isDeltaInDirection)(delta, vue.unref(providerContext).swipeDirection.value, moveStartBuffer)) { swipeDeltaRef.value = delta; vue.unref(handleAndDispatchCustomEvent)(vue.unref(TOAST_SWIPE_START), (ev) => emits("swipeStart", ev), eventDetail); event.target.setPointerCapture(event.pointerId); } else if (Math.abs(x) > moveStartBuffer || Math.abs(y) > moveStartBuffer) pointerStartRef.value = null; }), onPointerup: _cache[2] || (_cache[2] = (event) => { if (vue.unref(providerContext).disableSwipe.value) return; const delta = swipeDeltaRef.value; const target = event.target; if (target.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId); swipeDeltaRef.value = null; pointerStartRef.value = null; if (delta) { const toast2 = event.currentTarget; const eventDetail = { originalEvent: event, delta }; if (vue.unref(isDeltaInDirection)(delta, vue.unref(providerContext).swipeDirection.value, vue.unref(providerContext).swipeThreshold.value)) vue.unref(handleAndDispatchCustomEvent)(vue.unref(TOAST_SWIPE_END), (ev) => emits("swipeEnd", ev), eventDetail); else vue.unref(handleAndDispatchCustomEvent)(vue.unref(TOAST_SWIPE_CANCEL), (ev) => emits("swipeCancel", ev), eventDetail); toast2 == null ? void 0 : toast2.addEventListener("click", (event$1) => event$1.preventDefault(), { once: true }); } }) }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { remaining: remainingTime.value, duration: duration.value })]), _: 3 }, 16, [ "as", "as-child", "data-state", "data-swipe-direction", "data-status", "data-expanded", "data-limited", "inert", "style" ])]; }), _: 3 })], 8, ["to", "disabled"])) : vue.createCommentVNode("v-if", true)], 64); }; } }); var ToastRootImpl_default = ToastRootImpl_vue_vue_type_script_setup_true_lang_default; var ToastAction_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ToastAction", props: { altText: { type: String, required: false }, closeOnClick: { type: Boolean, required: false, default: true }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; const rootContext = injectToastRootContext(); const { forwardRef } = useForwardExpose(); const slots = vue.useSlots(); const actionProps = vue.computed(() => { var _a2; return (_a2 = rootContext.toast.value) == null ? void 0 : _a2.actionProps; }); const isRendered = vue.computed(() => !!slots.default || !rootContext.toast.value || !!actionProps.value); const altText = vue.computed(() => { var _a2, _b; return (_b = props.altText) != null ? _b : (_a2 = actionProps.value) == null ? void 0 : _a2.altText; }); if (isRendered.value && !altText.value) throw new Error("Missing prop `altText` expected on `ToastAction`"); function handleClick(event) { var _a2, _b, _c, _d; (_b = (_a2 = actionProps.value) == null ? void 0 : _a2.onClick) == null ? void 0 : _b.call(_a2, event); if ((_d = (_c = actionProps.value) == null ? void 0 : _c.closeOnClick) != null ? _d : props.closeOnClick) rootContext.onClose(event); } return (_ctx, _cache) => { return isRendered.value && altText.value ? (vue.openBlock(), vue.createBlock(ToastAnnounceExclude_default, { key: 0, "alt-text": altText.value, "as-child": "" }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), { ref: vue.unref(forwardRef), as: __props.as, "as-child": __props.asChild, type: __props.as === "button" ? "button" : void 0, onClick: handleClick }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", {}, () => { var _a2; return [vue.createTextVNode(vue.toDisplayString((_a2 = actionProps.value) == null ? void 0 : _a2.label), 1)]; })]), _: 3 }, 8, [ "as", "as-child", "type" ])]), _: 3 }, 8, ["alt-text"])) : vue.createCommentVNode("v-if", true); }; } }); var ToastAction_default = ToastAction_vue_vue_type_script_setup_true_lang_default; var ToastClose_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ToastClose", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; const rootContext = injectToastRootContext(); const { forwardRef } = useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(ToastAnnounceExclude_default, { "as-child": "" }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), vue.mergeProps(props, { ref: vue.unref(forwardRef), type: __props.as === "button" ? "button" : void 0, onClick: vue.unref(rootContext).onClose }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, ["type", "onClick"])]), _: 3 }); }; } }); var ToastClose_default = ToastClose_vue_vue_type_script_setup_true_lang_default; var ToastDescription_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ToastDescription", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; useForwardExpose(); const rootContext = injectToastRootContext(null); return (_ctx, _cache) => { var _a2; return _ctx.$slots.default || !((_a2 = vue.unref(rootContext)) == null ? void 0 : _a2.toast.value) || vue.unref(rootContext).toast.value.description ? (vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.normalizeProps(vue.mergeProps({ key: 0 }, props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", {}, () => { var _a3, _b; return [vue.createTextVNode(vue.toDisplayString((_b = (_a3 = vue.unref(rootContext)) == null ? void 0 : _a3.toast.value) == null ? void 0 : _b.description), 1)]; })]), _: 3 }, 16)) : vue.createCommentVNode("v-if", true); }; } }); var ToastDescription_default = ToastDescription_vue_vue_type_script_setup_true_lang_default; var ToastPortal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ToastPortal", props: { to: { type: null, required: false }, disabled: { type: Boolean, required: false }, defer: { type: Boolean, required: false }, forceMount: { type: Boolean, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Teleport_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var ToastPortal_default = ToastPortal_vue_vue_type_script_setup_true_lang_default; var ToastRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ToastRoot", props: { defaultOpen: { type: Boolean, required: false, default: true }, forceMount: { type: Boolean, required: false }, type: { type: String, required: false, default: "foreground" }, open: { type: Boolean, required: false, default: void 0 }, duration: { type: Number, required: false }, toast: { type: Object, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "li" } }, emits: [ "escapeKeyDown", "pause", "resume", "swipeStart", "swipeMove", "swipeCancel", "swipeEnd", "update:open" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { forwardRef } = useForwardExpose(); const open = useVModel(props, "open", emits, { defaultValue: props.defaultOpen, passive: props.open === void 0 }); const providerContext = injectToastProviderContext(); const isOpen = vue.computed(() => props.toast ? props.toast.open : open.value); const resolvedType = vue.computed(() => { var _a2, _b; return (_b = (_a2 = props.toast) == null ? void 0 : _a2.type) != null ? _b : props.type; }); const resolvedDuration = vue.computed(() => { var _a2, _b, _c; return ((_a2 = props.toast) == null ? void 0 : _a2.status) === "loading" ? Number.POSITIVE_INFINITY : (_c = (_b = props.toast) == null ? void 0 : _b.duration) != null ? _c : props.duration; }); function close() { if (props.toast) { providerContext.toastStore.close(props.toast.id); emits("update:open", false); } else open.value = false; } const isContentMounted = vue.ref(false); vue.watch([() => props.toast, isContentMounted], ([toast2, mounted]) => { if (toast2 && !toast2.open && !mounted) providerContext.toastStore.remove(toast2.id); }, { immediate: true }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || isOpen.value }, { default: vue.withCtx(() => [vue.createVNode(ToastRootImpl_default, vue.mergeProps({ ref: vue.unref(forwardRef), open: isOpen.value, type: resolvedType.value, as: __props.as, "as-child": __props.asChild, duration: resolvedDuration.value, toast: __props.toast }, _ctx.$attrs, { onVnodeMounted: _cache[0] || (_cache[0] = ($event) => isContentMounted.value = true), onVnodeUnmounted: _cache[1] || (_cache[1] = ($event) => isContentMounted.value = false), onClose: close, onPause: _cache[2] || (_cache[2] = ($event) => emits("pause")), onResume: _cache[3] || (_cache[3] = ($event) => emits("resume")), onEscapeKeyDown: _cache[4] || (_cache[4] = ($event) => emits("escapeKeyDown", $event)), onSwipeStart: _cache[5] || (_cache[5] = (event) => { emits("swipeStart", event); if (!event.defaultPrevented) event.currentTarget.setAttribute("data-swipe", "start"); }), onSwipeMove: _cache[6] || (_cache[6] = (event) => { emits("swipeMove", event); if (!event.defaultPrevented) { const { x, y } = event.detail.delta; const target = event.currentTarget; target.setAttribute("data-swipe", "move"); target.style.setProperty("--reka-toast-swipe-move-x", `${x}px`); target.style.setProperty("--reka-toast-swipe-move-y", `${y}px`); } }), onSwipeCancel: _cache[7] || (_cache[7] = (event) => { emits("swipeCancel", event); if (!event.defaultPrevented) { const target = event.currentTarget; target.setAttribute("data-swipe", "cancel"); target.style.removeProperty("--reka-toast-swipe-move-x"); target.style.removeProperty("--reka-toast-swipe-move-y"); target.style.removeProperty("--reka-toast-swipe-end-x"); target.style.removeProperty("--reka-toast-swipe-end-y"); } }), onSwipeEnd: _cache[8] || (_cache[8] = (event) => { emits("swipeEnd", event); if (!event.defaultPrevented) { const { x, y } = event.detail.delta; const target = event.currentTarget; target.setAttribute("data-swipe", "end"); target.style.removeProperty("--reka-toast-swipe-move-x"); target.style.removeProperty("--reka-toast-swipe-move-y"); target.style.setProperty("--reka-toast-swipe-end-x", `${x}px`); target.style.setProperty("--reka-toast-swipe-end-y", `${y}px`); close(); } }) }), { default: vue.withCtx(({ remaining, duration: _duration }) => [vue.renderSlot(_ctx.$slots, "default", { remaining, duration: _duration, open: isOpen.value })]), _: 3 }, 16, [ "open", "type", "as", "as-child", "duration", "toast" ])]), _: 3 }, 8, ["present"]); }; } }); var ToastRoot_default = ToastRoot_vue_vue_type_script_setup_true_lang_default; var ToastTitle_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "ToastTitle", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const props = __props; useForwardExpose(); const rootContext = injectToastRootContext(null); return (_ctx, _cache) => { var _a2; return _ctx.$slots.default || !((_a2 = vue.unref(rootContext)) == null ? void 0 : _a2.toast.value) || vue.unref(rootContext).toast.value.title ? (vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.normalizeProps(vue.mergeProps({ key: 0 }, props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", {}, () => { var _a3, _b; return [vue.createTextVNode(vue.toDisplayString((_b = (_a3 = vue.unref(rootContext)) == null ? void 0 : _a3.toast.value) == null ? void 0 : _b.title), 1)]; })]), _: 3 }, 16)) : vue.createCommentVNode("v-if", true); }; } }); var ToastTitle_default = ToastTitle_vue_vue_type_script_setup_true_lang_default; var FocusProxy_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "FocusProxy", emits: ["focusFromOutsideViewport"], setup(__props, { emit: __emit }) { const emits = __emit; const providerContext = injectToastProviderContext(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(VisuallyHidden_default), { tabindex: "0", style: { "position": "fixed" }, onFocus: _cache[0] || (_cache[0] = (event) => { var _a2; const prevFocusedElement = event.relatedTarget; const isFocusFromOutsideViewport = !((_a2 = vue.unref(providerContext).viewport.value) == null ? void 0 : _a2.contains(prevFocusedElement)); if (isFocusFromOutsideViewport) emits("focusFromOutsideViewport"); }) }, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }); }; } }); var FocusProxy_default = FocusProxy_vue_vue_type_script_setup_true_lang_default; var ToastViewport_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "ToastViewport", props: { hotkey: { type: Array, required: false, default: () => ["F8"] }, label: { type: [String, Function], required: false, default: "Notifications ({hotkey})" }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "ol" } }, setup(__props) { const props = __props; const { hotkey, label } = vue.toRefs(props); const { forwardRef, currentElement } = useForwardExpose(); const { CollectionSlot, getItems } = useCollection(); const providerContext = injectToastProviderContext(); const hasToasts = vue.computed(() => providerContext.toastCount.value > 0); const headFocusProxyRef = vue.ref(); const tailFocusProxyRef = vue.ref(); const KEY_RE = /Key/g; const DIGIT_RE = /Digit/g; const hotkeyMessage = vue.computed(() => hotkey.value.join("+").replace(KEY_RE, "").replace(DIGIT_RE, "")); onKeyStroke(hotkey.value, () => { currentElement.value.focus(); }); vue.onMounted(() => { providerContext.onViewportChange(currentElement.value); }); const pendingPointerLeave = vue.ref(false); vue.watch([pendingPointerLeave, providerContext.closingCount], ([pending2, closingCount]) => { if (pending2 && closingCount === 0) { providerContext.hovering.value = false; pendingPointerLeave.value = false; } }); vue.watch(hasToasts, (value) => { if (!value) { providerContext.hovering.value = false; providerContext.focused.value = false; pendingPointerLeave.value = false; } }); vue.watchEffect((cleanupFn) => { const viewport = currentElement.value; if (hasToasts.value && viewport) { const handlePause = () => { if (!providerContext.isClosePausedRef.value) { const pauseEvent = new CustomEvent(VIEWPORT_PAUSE); viewport.dispatchEvent(pauseEvent); providerContext.isClosePausedRef.value = true; } }; const handleResume = () => { if (providerContext.isClosePausedRef.value) { const resumeEvent = new CustomEvent(VIEWPORT_RESUME); viewport.dispatchEvent(resumeEvent); providerContext.isClosePausedRef.value = false; } }; const handleFocusOutResume = (event) => { const isFocusMovingOutside = !viewport.contains(event.relatedTarget); if (isFocusMovingOutside) { providerContext.focused.value = false; handleResume(); } }; const handlePointerLeaveResume = () => { pendingPointerLeave.value = true; const isFocusInside = viewport.contains(getActiveElement()); if (!isFocusInside) handleResume(); }; const handlePointerMoveExpand = () => { pendingPointerLeave.value = false; providerContext.hovering.value = true; }; const handleFocusInExpand = () => { providerContext.focused.value = true; }; const handleKeyDown = (event) => { var _a2, _b, _c; const isMetaKey = event.altKey || event.ctrlKey || event.metaKey; const isTabKey = event.key === "Tab" && !isMetaKey; if (isTabKey) { const focusedElement = getActiveElement(); const isTabbingBackwards = event.shiftKey; const targetIsViewport = event.target === viewport; if (targetIsViewport && isTabbingBackwards) { (_a2 = headFocusProxyRef.value) == null ? void 0 : _a2.focus(); return; } const tabbingDirection = isTabbingBackwards ? "backwards" : "forwards"; const sortedCandidates = getSortedTabbableCandidates({ tabbingDirection }); const index = sortedCandidates.findIndex((candidate) => candidate === focusedElement); if (focusFirst$3(sortedCandidates.slice(index + 1))) event.preventDefault(); else isTabbingBackwards ? (_b = headFocusProxyRef.value) == null ? void 0 : _b.focus() : (_c = tailFocusProxyRef.value) == null ? void 0 : _c.focus(); } }; viewport.addEventListener("focusin", handlePause); viewport.addEventListener("focusin", handleFocusInExpand); viewport.addEventListener("focusout", handleFocusOutResume); viewport.addEventListener("pointermove", handlePause); viewport.addEventListener("pointermove", handlePointerMoveExpand); viewport.addEventListener("pointerleave", handlePointerLeaveResume); viewport.addEventListener("keydown", handleKeyDown); window.addEventListener("blur", handlePause); window.addEventListener("focus", handleResume); cleanupFn(() => { viewport.removeEventListener("focusin", handlePause); viewport.removeEventListener("focusin", handleFocusInExpand); viewport.removeEventListener("focusout", handleFocusOutResume); viewport.removeEventListener("pointermove", handlePause); viewport.removeEventListener("pointermove", handlePointerMoveExpand); viewport.removeEventListener("pointerleave", handlePointerLeaveResume); viewport.removeEventListener("keydown", handleKeyDown); window.removeEventListener("blur", handlePause); window.removeEventListener("focus", handleResume); }); } }); function getSortedTabbableCandidates({ tabbingDirection }) { const toastItems = getItems().map((i) => i.ref); const tabbableCandidates = toastItems.map((toastNode) => { const toastTabbableCandidates = [toastNode, ...getTabbableCandidates$1(toastNode)]; return tabbingDirection === "forwards" ? toastTabbableCandidates : toastTabbableCandidates.reverse(); }); return (tabbingDirection === "forwards" ? tabbableCandidates.reverse() : tabbableCandidates).flat(); } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(DismissableLayerBranch_default), { role: "region", "aria-label": typeof vue.unref(label) === "string" ? vue.unref(label).replace("{hotkey}", hotkeyMessage.value) : vue.unref(label)(hotkeyMessage.value), tabindex: "-1", style: vue.normalizeStyle({ pointerEvents: hasToasts.value ? void 0 : "none" }) }, { default: vue.withCtx(() => [ hasToasts.value ? (vue.openBlock(), vue.createBlock(FocusProxy_default, { key: 0, ref: (node) => { if (!node) return void 0; headFocusProxyRef.value = vue.unref(unrefElement)(node); return void 0; }, onFocusFromOutsideViewport: _cache[0] || (_cache[0] = () => { const tabbableCandidates = getSortedTabbableCandidates({ tabbingDirection: "forwards" }); vue.unref(focusFirst$3)(tabbableCandidates); }) }, null, 512)) : vue.createCommentVNode("v-if", true), vue.createVNode(vue.unref(CollectionSlot), null, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), vue.mergeProps({ ref: vue.unref(forwardRef), tabindex: "-1", as: __props.as, "as-child": __props.asChild, "data-expanded": vue.unref(providerContext).expanded.value ? "" : void 0, style: { "--reka-toast-frontmost-height": vue.unref(providerContext).frontmostHeight.value ? `${vue.unref(providerContext).frontmostHeight.value}px` : void 0 } }, _ctx.$attrs), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "as", "as-child", "data-expanded", "style" ])]), _: 3 }), hasToasts.value ? (vue.openBlock(), vue.createBlock(FocusProxy_default, { key: 1, ref: (node) => { if (!node) return void 0; tailFocusProxyRef.value = vue.unref(unrefElement)(node); return void 0; }, onFocusFromOutsideViewport: _cache[1] || (_cache[1] = () => { const tabbableCandidates = getSortedTabbableCandidates({ tabbingDirection: "backwards" }); vue.unref(focusFirst$3)(tabbableCandidates); }) }, null, 512)) : vue.createCommentVNode("v-if", true) ]), _: 3 }, 8, ["aria-label", "style"]); }; } }); var ToastViewport_default = ToastViewport_vue_vue_type_script_setup_true_lang_default; var TooltipArrow_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TooltipArrow", props: { width: { type: Number, required: false, default: 10 }, height: { type: Number, required: false, default: 5 }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "svg" } }, setup(__props) { const props = __props; useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperArrow_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var TooltipArrow_default = TooltipArrow_vue_vue_type_script_setup_true_lang_default; const [injectTooltipProviderContext, provideTooltipProviderContext] = createContext("TooltipProvider"); var TooltipProvider_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ inheritAttrs: false, __name: "TooltipProvider", props: { delayDuration: { type: Number, required: false, default: 700 }, skipDelayDuration: { type: Number, required: false, default: 300 }, disableHoverableContent: { type: Boolean, required: false, default: false }, disableClosingTrigger: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, ignoreNonKeyboardFocus: { type: Boolean, required: false, default: false }, content: { type: Object, required: false } }, setup(__props) { const props = __props; const { delayDuration, skipDelayDuration, disableHoverableContent, disableClosingTrigger, ignoreNonKeyboardFocus, disabled, content } = vue.toRefs(props); useForwardExpose(); const isOpenDelayed = vue.ref(true); const isPointerInTransitRef = vue.ref(false); const { start: startTimer, stop: clearTimer } = useTimeoutFn(() => { isOpenDelayed.value = true; }, skipDelayDuration, { immediate: false }); provideTooltipProviderContext({ isOpenDelayed, delayDuration, onOpen() { clearTimer(); isOpenDelayed.value = false; }, onClose() { startTimer(); }, isPointerInTransitRef, disableHoverableContent, disableClosingTrigger, disabled, ignoreNonKeyboardFocus, content }); return (_ctx, _cache) => { return vue.renderSlot(_ctx.$slots, "default"); }; } }); var TooltipProvider_default = TooltipProvider_vue_vue_type_script_setup_true_lang_default; const TOOLTIP_OPEN = "tooltip.open"; const [injectTooltipRootContext, provideTooltipRootContext] = createContext("TooltipRoot"); var TooltipRoot_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TooltipRoot", props: { defaultOpen: { type: Boolean, required: false, default: false }, open: { type: Boolean, required: false, default: void 0 }, delayDuration: { type: Number, required: false, default: void 0 }, disableHoverableContent: { type: Boolean, required: false, default: void 0 }, disableClosingTrigger: { type: Boolean, required: false, default: void 0 }, disabled: { type: Boolean, required: false, default: void 0 }, ignoreNonKeyboardFocus: { type: Boolean, required: false, default: void 0 } }, emits: ["update:open"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; useForwardExpose(); const providerContext = injectTooltipProviderContext(); const disableHoverableContent = vue.computed(() => { var _a2; return (_a2 = props.disableHoverableContent) != null ? _a2 : providerContext.disableHoverableContent.value; }); const disableClosingTrigger = vue.computed(() => { var _a2; return (_a2 = props.disableClosingTrigger) != null ? _a2 : providerContext.disableClosingTrigger.value; }); const disableTooltip = vue.computed(() => { var _a2; return (_a2 = props.disabled) != null ? _a2 : providerContext.disabled.value; }); const delayDuration = vue.computed(() => { var _a2; return (_a2 = props.delayDuration) != null ? _a2 : providerContext.delayDuration.value; }); const ignoreNonKeyboardFocus = vue.computed(() => { var _a2; return (_a2 = props.ignoreNonKeyboardFocus) != null ? _a2 : providerContext.ignoreNonKeyboardFocus.value; }); const open = useVModel(props, "open", emit2, { defaultValue: props.defaultOpen, passive: props.open === void 0 }); vue.watch(open, (isOpen) => { if (!providerContext.onClose) return; if (isOpen) { providerContext.onOpen(); document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN)); } else providerContext.onClose(); }); const wasOpenDelayedRef = vue.ref(false); const trigger = vue.ref(); const stateAttribute = vue.computed(() => { if (!open.value) return "closed"; return wasOpenDelayedRef.value ? "delayed-open" : "instant-open"; }); const { start: startTimer, stop: clearTimer } = useTimeoutFn(() => { wasOpenDelayedRef.value = true; open.value = true; }, delayDuration, { immediate: false }); function handleOpen() { clearTimer(); wasOpenDelayedRef.value = false; open.value = true; } function handleClose() { clearTimer(); open.value = false; } function handleDelayedOpen() { startTimer(); } provideTooltipRootContext({ contentId: "", open, stateAttribute, trigger, onTriggerChange(el) { trigger.value = el; }, onTriggerEnter() { if (providerContext.isOpenDelayed.value) handleDelayedOpen(); else handleOpen(); }, onTriggerLeave() { if (disableHoverableContent.value) handleClose(); else clearTimer(); }, onOpen: handleOpen, onClose: handleClose, disableHoverableContent, disableClosingTrigger, disabled: disableTooltip, ignoreNonKeyboardFocus }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(PopperRoot_default), null, { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open) })]), _: 3 }); }; } }); var TooltipRoot_default = TooltipRoot_vue_vue_type_script_setup_true_lang_default; var TooltipContentImpl_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TooltipContentImpl", props: { ariaLabel: { type: String, required: false }, asChild: { type: Boolean, required: false, default: void 0 }, as: { type: null, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, avoidCollisions: { type: Boolean, required: false, default: void 0 }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false, default: void 0 }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false } }, emits: ["escapeKeyDown", "pointerDownOutside"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectTooltipRootContext(); const providerContext = injectTooltipProviderContext(); const { forwardRef, currentElement } = useForwardExpose(); const ariaLabel = vue.computed(() => { var _a2; return props.ariaLabel || ((_a2 = currentElement.value) == null ? void 0 : _a2.textContent); }); const popperContentProps = vue.computed(() => { var _a2; const { ariaLabel: _2, ...restProps } = props; return defu(restProps, (_a2 = providerContext.content.value) != null ? _a2 : {}, { side: "top", sideOffset: 0, align: "center", avoidCollisions: true, collisionBoundary: [], collisionPadding: 0, arrowPadding: 0, sticky: "partial", hideWhenDetached: false }); }); vue.onMounted(() => { useEventListener(window, "scroll", (event) => { const target = event.target; if (target == null ? void 0 : target.contains(rootContext.trigger.value)) rootContext.onClose(); }, { capture: true }); useEventListener(document, TOOLTIP_OPEN, rootContext.onClose); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(DismissableLayer_default), { "as-child": "", "disable-outside-pointer-events": false, onEscapeKeyDown: _cache[0] || (_cache[0] = ($event) => emits("escapeKeyDown", $event)), onPointerDownOutside: _cache[1] || (_cache[1] = (event) => { var _a2; if (vue.unref(rootContext).disableClosingTrigger.value && ((_a2 = vue.unref(rootContext).trigger.value) == null ? void 0 : _a2.contains(event.target))) event.preventDefault(); emits("pointerDownOutside", event); }), onFocusOutside: _cache[2] || (_cache[2] = vue.withModifiers(() => { }, ["prevent"])), onDismiss: _cache[3] || (_cache[3] = ($event) => vue.unref(rootContext).onClose()) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(PopperContent_default), vue.mergeProps({ ref: vue.unref(forwardRef), "data-state": vue.unref(rootContext).stateAttribute.value }, { ..._ctx.$attrs, ...popperContentProps.value }, { style: { "--reka-tooltip-content-transform-origin": "var(--reka-popper-transform-origin)", "--reka-tooltip-content-available-width": "var(--reka-popper-available-width)", "--reka-tooltip-content-available-height": "var(--reka-popper-available-height)", "--reka-tooltip-trigger-width": "var(--reka-popper-anchor-width)", "--reka-tooltip-trigger-height": "var(--reka-popper-anchor-height)" } }), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default"), vue.createVNode(vue.unref(VisuallyHidden_default), { id: vue.unref(rootContext).contentId, role: "tooltip" }, { default: vue.withCtx(() => [vue.createTextVNode(vue.toDisplayString(ariaLabel.value), 1)]), _: 1 }, 8, ["id"])]), _: 3 }, 16, ["data-state"])]), _: 3 }); }; } }); var TooltipContentImpl_default = TooltipContentImpl_vue_vue_type_script_setup_true_lang_default; var TooltipContentHoverable_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TooltipContentHoverable", props: { ariaLabel: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false } }, setup(__props) { const props = __props; const forwardedProps = useForwardProps$1(props); const { forwardRef, currentElement } = useForwardExpose(); const { trigger, onClose } = injectTooltipRootContext(); const providerContext = injectTooltipProviderContext(); const { isPointerInTransit, onPointerExit } = useGraceArea(trigger, currentElement); providerContext.isPointerInTransitRef = isPointerInTransit; onPointerExit(() => { onClose(); }); useEventListener(currentElement, "pointermove", (event) => { var _a2, _b; const content = currentElement.value; if (!content || event.pointerType === "touch") return; const coversAnotherTrigger = (_b = (_a2 = content.ownerDocument).elementsFromPoint) == null ? void 0 : _b.call(_a2, event.clientX, event.clientY).some((el) => { if (content.contains(el)) return false; const coveredTrigger = el.closest("[data-grace-area-trigger]"); return !!coveredTrigger && coveredTrigger !== trigger.value; }); if (coversAnotherTrigger) onClose(); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(TooltipContentImpl_default, vue.mergeProps({ ref: vue.unref(forwardRef) }, vue.unref(forwardedProps)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var TooltipContentHoverable_default = TooltipContentHoverable_vue_vue_type_script_setup_true_lang_default; var TooltipContent_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TooltipContent", props: { forceMount: { type: Boolean, required: false }, ariaLabel: { type: String, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false } }, emits: ["escapeKeyDown", "pointerDownOutside"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const rootContext = injectTooltipRootContext(); const forwarded = useForwardPropsEmits(props, emits); const { forwardRef } = useForwardExpose(); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Presence_default), { present: __props.forceMount || vue.unref(rootContext).open.value }, { default: vue.withCtx(() => [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(rootContext).disableHoverableContent.value ? TooltipContentImpl_default : TooltipContentHoverable_default), vue.mergeProps({ ref: vue.unref(forwardRef) }, vue.unref(forwarded)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16))]), _: 3 }, 8, ["present"]); }; } }); var TooltipContent_default = TooltipContent_vue_vue_type_script_setup_true_lang_default; var TooltipPortal_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TooltipPortal", props: { to: { type: null, required: false }, disabled: { type: Boolean, required: false }, defer: { type: Boolean, required: false }, forceMount: { type: Boolean, required: false } }, setup(__props) { const props = __props; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Teleport_default), vue.normalizeProps(vue.guardReactiveProps(props)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16); }; } }); var TooltipPortal_default = TooltipPortal_vue_vue_type_script_setup_true_lang_default; var TooltipTrigger_vue_vue_type_script_setup_true_lang_default = vue.defineComponent({ __name: "TooltipTrigger", props: { reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "button" } }, setup(__props) { const props = __props; const rootContext = injectTooltipRootContext(); const providerContext = injectTooltipProviderContext(); rootContext.contentId || (rootContext.contentId = useId(void 0, "reka-tooltip-content")); const { forwardRef, currentElement: triggerElement } = useForwardExpose(); const isPointerDown = vue.ref(false); const hasPointerMoveOpened = vue.ref(false); const tooltipListeners = vue.computed(() => { if (rootContext.disabled.value) return {}; return { click: handleClick, focus: handleFocus, pointermove: handlePointerMove, pointerleave: handlePointerLeave, pointerdown: handlePointerDown, blur: handleBlur }; }); vue.watch(triggerElement, (el) => { rootContext.onTriggerChange(el); }, { immediate: true }); function handlePointerUp() { setTimeout(() => { isPointerDown.value = false; }, 1); } function handlePointerDown() { if (rootContext.open && !rootContext.disableClosingTrigger.value) rootContext.onClose(); isPointerDown.value = true; document.addEventListener("pointerup", handlePointerUp, { once: true }); } function handlePointerMove(event) { if (event.pointerType === "touch") return; if (!hasPointerMoveOpened.value && !providerContext.isPointerInTransitRef.value) { rootContext.onTriggerEnter(); hasPointerMoveOpened.value = true; } } function handlePointerLeave() { rootContext.onTriggerLeave(); hasPointerMoveOpened.value = false; } function handleFocus(event) { var _a2, _b; if (isPointerDown.value) return; if (rootContext.ignoreNonKeyboardFocus.value && !((_b = (_a2 = event.target).matches) == null ? void 0 : _b.call(_a2, ":focus-visible"))) return; rootContext.onOpen(); } function handleBlur() { rootContext.onClose(); } function handleClick() { if (!rootContext.disableClosingTrigger.value) rootContext.onClose(); } return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(PopperAnchor_default), { "as-child": "", reference: (_a2 = __props.reference) != null ? _a2 : vue.unref(triggerElement) }, { default: vue.withCtx(() => [vue.createVNode(vue.unref(Primitive), vue.mergeProps({ ref: vue.unref(forwardRef), "aria-describedby": vue.unref(rootContext).open.value ? vue.unref(rootContext).contentId : void 0, "data-state": vue.unref(rootContext).stateAttribute.value, as: __props.as, "as-child": props.asChild, "data-grace-area-trigger": "" }, vue.toHandlers(tooltipListeners.value)), { default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]), _: 3 }, 16, [ "aria-describedby", "data-state", "as", "as-child" ])]), _: 3 }, 8, ["reference"]); }; } }); var TooltipTrigger_default = TooltipTrigger_vue_vue_type_script_setup_true_lang_default; const portalTargetInjectionKey = Symbol("nuxt-ui.portal-target"); function usePortal(portal) { const globalPortal = vue.inject(portalTargetInjectionKey, void 0); const value = vue.computed(() => portal.value === true ? globalPortal == null ? void 0 : globalPortal.value : portal.value); const disabled = vue.computed(() => typeof value.value === "boolean" ? !value.value : false); const to = vue.computed(() => typeof value.value === "boolean" ? "body" : value.value); return vue.computed(() => ({ to: to.value, disabled: disabled.value })); } const [_injectThemeContext] = createContext("UTheme", "RootContext"); const defaultThemeContext = { defaults: vue.computed(() => ({})) }; function injectThemeContext(fallback = defaultThemeContext) { return _injectThemeContext(fallback); } function camelCase(str2) { return str2.replace(/-(\w)/g, (_2, c) => c.toUpperCase()); } function kebabCase(str2) { return str2.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`); } function propIsDefined(vnode, prop) { if (!vnode || !vnode.props) return false; return vnode.props[camelCase(prop)] !== void 0 || vnode.props[kebabCase(prop)] !== void 0; } function useComponentProps(name, props) { const vm = vue.getCurrentInstance(); const { defaults } = injectThemeContext(); const appConfig2 = useAppConfig(); return new Proxy(props, { get(target, prop, receiver) { var _a2, _b, _c, _d, _e2; if (prop === "__v_isReactive") return true; if (prop === "__v_raw") return target; if (typeof prop === "string" && prop.startsWith("__v_")) return void 0; const raw = Reflect.get(target, prop, receiver); if (typeof prop !== "string") return raw; const themeEntry = name.includes(".") ? get(defaults.value, name) : defaults.value[name]; if (prop === "ui") { const themeUi = themeEntry == null ? void 0 : themeEntry.ui; if (!raw && !themeUi) return raw; return defu(raw != null ? raw : {}, themeUi != null ? themeUi : {}); } if (prop === "class") { const themeClass = themeEntry == null ? void 0 : themeEntry.class; if (themeClass === void 0) return raw; if (raw === void 0) return themeClass; return [themeClass, raw]; } if (vm && propIsDefined(vm.vnode, prop)) return raw; const themeValue = themeEntry == null ? void 0 : themeEntry[prop]; if (themeValue !== void 0) return themeValue; const appConfigEntry = name.includes(".") ? get((_a2 = appConfig2.ui) != null ? _a2 : {}, name) : (_b = appConfig2.ui) == null ? void 0 : _b[name]; const appConfigValue = (_c = appConfigEntry == null ? void 0 : appConfigEntry.defaultVariants) == null ? void 0 : _c[prop]; if (appConfigValue !== void 0) return appConfigValue; const propDef = (_e2 = (_d = vm == null ? void 0 : vm.type) == null ? void 0 : _d.props) == null ? void 0 : _e2[prop]; if (propDef && Object.prototype.hasOwnProperty.call(propDef, "default")) { return raw; } return void 0; }, has: (t, p) => Reflect.has(t, p), ownKeys: (t) => Reflect.ownKeys(t), getOwnPropertyDescriptor: (t, p) => Reflect.getOwnPropertyDescriptor(t, p) }); } function useForwardProps(source, emits) { const emitAsProps = emits ? useEmitAsProps(emits) : {}; return vue.computed(() => { const src = vue.unref(source); const out = { ...emitAsProps }; for (const key in src) { const value = src[key]; if (value !== void 0) out[key] = value; } return out; }); } const toastMaxInjectionKey = Symbol("nuxt-ui.toast-max"); const ANIMATION_DURATION = 200; function useToast() { const toasts = useState("toasts", () => []); const max2 = vue.inject(toastMaxInjectionKey, void 0); const running2 = vue.ref(false); const queue = []; const generateId = () => `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`; function mergeDuplicate(index, toast2) { const existing = toasts.value[index]; const now = Date.now(); const animating = now - (existing._animatedAt || 0) < ANIMATION_DURATION; toasts.value[index] = { ...existing, ...toast2, _duplicate: animating ? existing._duplicate : (existing._duplicate || 0) + 1, _animatedAt: animating ? existing._animatedAt : now }; } async function processQueue() { var _a2; if (running2.value || queue.length === 0) { return; } running2.value = true; while (queue.length > 0) { await vue.nextTick(); const toast2 = queue.shift(); const maxValue = (_a2 = max2 == null ? void 0 : max2.value) != null ? _a2 : 5; if (maxValue <= 0) { if (toasts.value.length) { toasts.value = []; } continue; } const existingIndex = toasts.value.findIndex((t) => t.id === toast2.id); if (existingIndex !== -1) { mergeDuplicate(existingIndex, toast2); continue; } toasts.value = [...toasts.value, { ...toast2, _animatedAt: Date.now() }].slice(-maxValue); } running2.value = false; } function add(toast2) { const body = { id: generateId(), open: true, ...toast2 }; const existingIndex = toasts.value.findIndex((t) => t.id === body.id); if (existingIndex !== -1) { mergeDuplicate(existingIndex, body); return body; } queue.push(body); processQueue(); return body; } function update(id, toast2) { const index = toasts.value.findIndex((t) => t.id === id); if (index !== -1) { toasts.value[index] = { ...toasts.value[index], ...toast2, duration: toast2.duration, open: true, _updated: true }; vue.nextTick(() => { const i = toasts.value.findIndex((t) => t.id === id); if (i !== -1 && toasts.value[i]._updated) { toasts.value[i] = { ...toasts.value[i], _updated: void 0 }; } }); } } function remove2(id) { const index = toasts.value.findIndex((t) => t.id === id); if (index !== -1 && toasts.value[index]._updated) { return; } if (index !== -1) { toasts.value[index] = { ...toasts.value[index], open: false }; } setTimeout(() => { toasts.value = toasts.value.filter((t) => t.id !== id); }, 200); } function clear() { toasts.value = []; } return { toasts, add, update, remove: remove2, clear }; } function requestIdleCallback(callback) { if (typeof window === "undefined") { return; } if (typeof window.requestIdleCallback === "function") { return window.requestIdleCallback(callback); } return setTimeout(callback, 1); } function cancelIdleCallback(handle) { if (typeof window === "undefined" || handle === void 0) { return; } if (typeof window.cancelIdleCallback === "function") { window.cancelIdleCallback(handle); return; } clearTimeout(handle); } var isArray = Array.isArray; var joinClassValue = (value) => { if (!value && value !== 0 && value !== BigInt("0")) return ""; if (typeof value === "string") return value; if (typeof value === "number") { if (value !== value) return ""; return "" + value; } if (typeof value === "bigint") return "" + value; let result = ""; if (isArray(value)) { const length = value.length; for (let index = 0; index < length; index++) { const item = value[index]; if (!item && item !== 0 && item !== BigInt("0")) continue; const resolved = typeof item === "string" ? item : joinClassValue(item); if (resolved) { if (result) result += " "; result += resolved; } } return result; } if (typeof value === "object") { for (const key in value) { if (value[key]) { if (result) result += " "; result += key; } } } return result; }; var SPACE_REGEX = /\s+/g; var isArray2 = Array.isArray; var removeExtraSpaces = (str2) => { if (typeof str2 !== "string" || !str2) return str2; return str2.replace(SPACE_REGEX, " ").trim(); }; var stringNeedsNormalize = (str2) => { const len = str2.length; if (len === 0) return false; const first = str2.charCodeAt(0); const last = str2.charCodeAt(len - 1); if (first === 32 || last === 32 || first >= 9 && first <= 13 || first === 160 || last >= 9 && last <= 13 || last === 160) { return true; } for (let i = 0; i < len; i++) { const code = str2.charCodeAt(i); if (code >= 9 && code <= 13 || code === 160) return true; if (code === 32 && i + 1 < len && str2.charCodeAt(i + 1) === 32) return true; } return false; }; var cx = (...classnames) => { const result = joinClassValue(classnames); if (!result) return void 0; return stringNeedsNormalize(result) ? removeExtraSpaces(result) : result; }; var falsyToString = (value) => value === false ? "false" : value === true ? "true" : value === 0 ? "0" : value; var isEmptyObject = (obj) => { if (!obj || typeof obj !== "object") return true; for (const _2 in obj) return false; return true; }; var isEqual = (obj1, obj2) => { if (obj1 === obj2) return true; if (!obj1 || !obj2) return false; const record1 = obj1; const record2 = obj2; const keys1 = Object.keys(record1); const keys2 = Object.keys(record2); if (keys1.length !== keys2.length) return false; for (let i = 0; i < keys1.length; i++) { const key = keys1[i]; if (!keys2.includes(key)) return false; if (record1[key] !== record2[key]) return false; } return true; }; var joinObjects = (obj1, obj2) => { const target = obj1; for (const key in obj2) { if (Object.hasOwn(obj2, key)) { const val2 = obj2[key]; if (key in target) { target[key] = cx(target[key], val2); } else { target[key] = val2; } } } return obj1; }; var flat = (arr, target) => { for (let i = 0; i < arr.length; i++) { const el = arr[i]; if (isArray2(el)) flat(el, target); else if (el) target.push(el); } }; var flatMergeArrays = (...arrays) => { const result = []; flat(arrays, result); const filtered = []; for (let i = 0; i < result.length; i++) { if (result[i]) filtered.push(result[i]); } return filtered; }; var mergeObjects = (obj1, obj2) => { const record1 = obj1; const record2 = obj2; const result = {}; for (const key in record1) { const val1 = record1[key]; if (key in record2) { const val2 = record2[key]; if (isArray2(val1) || isArray2(val2)) { result[key] = flatMergeArrays(val2, val1); } else if (typeof val1 === "object" && typeof val2 === "object" && val1 && val2) { result[key] = mergeObjects(val1, val2); } else { result[key] = val2 + " " + val1; } } else { result[key] = val1; } } for (const key in record2) { if (!(key in record1)) { result[key] = record2[key]; } } return result; }; var defaultConfig = { twMerge: true, twMergeConfig: {} }; var VARIANT_CACHE_LIMIT = 256; var OVERRIDE_CACHE_LIMIT = 128; var CACHE_MISS = Symbol("tv-cache-miss"); var hasClassOverride = (props) => (props == null ? void 0 : props.class) != null && props.class !== "" || (props == null ? void 0 : props.className) != null && props.className !== ""; var serializeFingerprintValue = (value) => { if (value === void 0) return ""; if (value === null) return "null"; if (typeof value === "string") return value; if (typeof value === "boolean") return value ? "true" : "false"; if (typeof value === "number") return value === 0 ? "0" : String(value); if (typeof value === "bigint") return String(value); const mapped = falsyToString(value); const mappedType = typeof mapped; if (mappedType === "string" || mappedType === "number" || mappedType === "boolean" || mappedType === "bigint") { return String(mapped); } if (mappedType === "object") { try { return JSON.stringify(mapped); } catch { return null; } } return null; }; var appendSignatureValue = (out, value) => { if (value === void 0) return out; if (value === null) return out + "null"; const type = typeof value; if (type === "string" || type === "number" || type === "boolean" || type === "bigint") { return out + String(value); } if (Array.isArray(value)) { return out + value.join("\0"); } try { return out + JSON.stringify(value); } catch { return out + "?"; } }; var buildPropsFingerprint = (variantKeys, defaultVariants, props, slotProps) => { let fingerprint2 = ""; const seen2 = Object.create(null); for (let i = 0; i < variantKeys.length; i++) { const key = variantKeys[i]; seen2[key] = 1; let value = defaultVariants[key]; if (props && props[key] !== void 0) value = props[key]; const serialized = serializeFingerprintValue(value); if (serialized === null) return null; fingerprint2 += key + ":" + serialized + ";"; } const extras = []; for (const key in defaultVariants) { if (key === "class" || key === "className" || seen2[key]) continue; seen2[key] = 1; extras.push(key); } if (props) { for (const key in props) { if (key === "class" || key === "className" || seen2[key] || props[key] === void 0) continue; seen2[key] = 1; extras.push(key); } } if (extras.length > 1) extras.sort(); for (let i = 0; i < extras.length; i++) { const key = extras[i]; let value = defaultVariants[key]; if (props && props[key] !== void 0) value = props[key]; const serialized = serializeFingerprintValue(value); if (serialized === null) return null; fingerprint2 += key + ":" + serialized + ";"; } return fingerprint2; }; var buildCompoundsSignature = (compoundVariants, compoundSlots) => { let signature = ""; for (let i = 0; i < compoundVariants.length; i++) { const { conditionKeys, source } = compoundVariants[i]; for (let j = 0; j < conditionKeys.length; j++) { const key = conditionKeys[j]; signature += key + "="; signature = appendSignatureValue(signature, source[key]); signature += ","; } signature += "c="; signature = appendSignatureValue(signature, source.class); signature += "|cn="; signature = appendSignatureValue(signature, source.className); signature += ";"; } for (let i = 0; i < compoundSlots.length; i++) { const { conditionKeys, source } = compoundSlots[i]; for (let j = 0; j < conditionKeys.length; j++) { const key = conditionKeys[j]; signature += key + "="; signature = appendSignatureValue(signature, source[key]); signature += ","; } if (Array.isArray(source.slots)) { signature += "slots=" + source.slots.join(",") + ","; } signature += "c="; signature = appendSignatureValue(signature, source.class); signature += "|cn="; signature = appendSignatureValue(signature, source.className); signature += ";"; } return signature; }; var createBoundedCache = (limit = VARIANT_CACHE_LIMIT) => { let primary = new Map(); let secondary = null; return { get(key) { if (primary.has(key)) return primary.get(key); if (secondary == null ? void 0 : secondary.has(key)) { const value = secondary.get(key); primary.set(key, value); return value; } return CACHE_MISS; }, set(key, value) { if (primary.size >= limit) { secondary = primary; primary = new Map(); } primary.set(key, value); } }; }; var createResultCache = (limit = VARIANT_CACHE_LIMIT) => { const cache = createBoundedCache(limit); return { get(key) { return cache.get(key); }, set(key, value) { cache.set(key, value); } }; }; var createNestedOverrideCache = (limit = OVERRIDE_CACHE_LIMIT) => { let primary = new Map(); let secondary = null; let size2 = 0; return { get(coreKey, overrideKey) { const primaryInner = primary.get(coreKey); if (primaryInner) { const value = primaryInner.get(overrideKey); if (value !== void 0 || primaryInner.has(overrideKey)) return value; } if (secondary) { const secondaryInner = secondary.get(coreKey); if (secondaryInner) { const value = secondaryInner.get(overrideKey); if (value !== void 0 || secondaryInner.has(overrideKey)) { let promoteInner = primary.get(coreKey); if (!promoteInner) { promoteInner = new Map(); primary.set(coreKey, promoteInner); } if (!promoteInner.has(overrideKey)) size2++; promoteInner.set(overrideKey, value); return value; } } } return CACHE_MISS; }, set(coreKey, overrideKey, value) { if (size2 >= limit) { secondary = primary; primary = new Map(); size2 = 0; } let inner = primary.get(coreKey); if (!inner) { inner = new Map(); primary.set(coreKey, inner); } if (!inner.has(overrideKey)) size2++; inner.set(overrideKey, value); } }; }; var createLazyOverrideMerge = (cn, config2) => { let cache = null; return (core, props) => { if (!hasClassOverride(props)) return core; const classVal = props.class; const classNameVal = props.className; if (classVal != null && classVal !== "" && typeof classVal !== "string" || classNameVal != null && classNameVal !== "" && typeof classNameVal !== "string") { return cn(config2, core, classVal, classNameVal); } cache != null ? cache : cache = createNestedOverrideCache(); const coreKey = core != null ? core : ""; const overrideKey = (typeof classVal === "string" ? classVal : "") + "\0" + (typeof classNameVal === "string" ? classNameVal : ""); const cached = cache.get(coreKey, overrideKey); if (cached !== CACHE_MISS) return cached; const merged = cn(config2, core, classVal, classNameVal); cache.set(coreKey, overrideKey, merged); return merged; }; }; function createState() { let cachedTwMerge = null; let cachedTwMergeConfig = {}; let didTwMergeConfigChange = false; return { get cachedTwMerge() { return cachedTwMerge; }, set cachedTwMerge(value) { cachedTwMerge = value; }, get cachedTwMergeConfig() { return cachedTwMergeConfig; }, set cachedTwMergeConfig(value) { cachedTwMergeConfig = value; }, get didTwMergeConfigChange() { return didTwMergeConfigChange; }, set didTwMergeConfigChange(value) { didTwMergeConfigChange = value; }, reset() { cachedTwMerge = null; cachedTwMergeConfig = {}; didTwMergeConfigChange = false; } }; } var state$1 = createState(); var synchronizeTwMergeConfig = (config2) => { if (!isEmptyObject(config2.twMergeConfig) && !isEqual(config2.twMergeConfig, state$1.cachedTwMergeConfig)) { state$1.didTwMergeConfigChange = true; state$1.cachedTwMergeConfig = config2.twMergeConfig; } }; var compileVariants = (variants, variantKeys) => { const compiledVariants = []; for (let i = 0; i < variantKeys.length; i++) { const key = variantKeys[i]; const values = variants[key]; compiledVariants.push({ key, values, isEmpty: isEmptyObject(values) }); } return compiledVariants; }; var compileCompoundVariants = (compoundVariants) => { if (!Array.isArray(compoundVariants) || compoundVariants.length === 0) return []; const result = []; for (let i = 0; i < compoundVariants.length; i++) { const compoundVariant = compoundVariants[i]; const conditionKeys = []; for (const key in compoundVariant) { if (key !== "class" && key !== "className") { conditionKeys.push(key); } } result.push({ conditionKeys, source: compoundVariant }); } return result; }; var compileCompoundSlots = (compoundSlots) => { if (!Array.isArray(compoundSlots) || compoundSlots.length === 0) return []; const result = []; for (let i = 0; i < compoundSlots.length; i++) { const compoundSlot = compoundSlots[i]; const conditionKeys = []; for (const key in compoundSlot) { if (key !== "slots" && key !== "class" && key !== "className") { conditionKeys.push(key); } } result.push({ conditionKeys, source: compoundSlot }); } return result; }; var indexCompoundSlotsBySlot = (compiledCompoundSlots) => { const index = {}; for (let i = 0; i < compiledCompoundSlots.length; i++) { const compoundSlot = compiledCompoundSlots[i]; const slots = compoundSlot.source.slots; if (!Array.isArray(slots)) continue; for (let j = 0; j < slots.length; j++) { const slotKey = slots[j]; if (!index[slotKey]) index[slotKey] = []; index[slotKey].push(compoundSlot); } } return index; }; var resolveOptions = (options, configProp) => { const { extend = null, slots: slotProps = {}, variants: variantsProps = {}, compoundVariants: compoundVariantsProps = [], compoundSlots: compoundSlotsProps = [], defaultVariants: defaultVariantsProps = {} } = options; const config2 = { ...defaultConfig, ...configProp }; const hasSlots = options.slots !== void 0; const base = (extend == null ? void 0 : extend.base) ? cx(extend.base, options == null ? void 0 : options.base) : options == null ? void 0 : options.base; const variants = (extend == null ? void 0 : extend.variants) && !isEmptyObject(extend.variants) ? mergeObjects(variantsProps, extend.variants) : variantsProps; const defaultVariants = (extend == null ? void 0 : extend.defaultVariants) && !isEmptyObject(extend.defaultVariants) ? { ...extend.defaultVariants, ...defaultVariantsProps } : defaultVariantsProps; synchronizeTwMergeConfig(config2); const isExtendedSlotsEmpty = !(extend == null ? void 0 : extend.slots) || isEmptyObject(extend.slots); const componentBase = hasSlots ? isExtendedSlotsEmpty && (extend == null ? void 0 : extend.base) ? cx(options == null ? void 0 : options.base, extend.base) : typeof (options == null ? void 0 : options.base) === "string" || (options == null ? void 0 : options.base) == null ? options.base : cx(options.base) : void 0; const componentSlots = hasSlots ? { base: componentBase, ...slotProps } : {}; const slots = isExtendedSlotsEmpty ? componentSlots : joinObjects( { ...extend == null ? void 0 : extend.slots }, isEmptyObject(componentSlots) ? { base: options == null ? void 0 : options.base } : componentSlots ); const compoundVariants = !(extend == null ? void 0 : extend.compoundVariants) || isEmptyObject(extend.compoundVariants) ? compoundVariantsProps : flatMergeArrays(extend == null ? void 0 : extend.compoundVariants, compoundVariantsProps); const compoundSlots = !(extend == null ? void 0 : extend.compoundSlots) || isEmptyObject(extend.compoundSlots) ? compoundSlotsProps : flatMergeArrays(extend == null ? void 0 : extend.compoundSlots, compoundSlotsProps); const variantKeys = Object.keys(variants); const deferredError = compoundVariants && !Array.isArray(compoundVariants) ? new TypeError( `The "compoundVariants" prop must be an array. Received: ${typeof compoundVariants}` ) : compoundSlots && !Array.isArray(compoundSlots) ? new TypeError( `The "compoundSlots" prop must be an array. Received: ${typeof compoundSlots}` ) : null; const mode = hasSlots || !isExtendedSlotsEmpty ? "slots" : variantKeys.length === 0 ? "plain" : "variants"; return { config: config2, extend, base, variants, defaultVariants, slots, compoundVariants, compoundSlots, compiledVariants: null, compiledCompoundVariants: null, compiledCompoundSlots: null, compiledCompoundSlotsBySlot: null, deferredError, mode, slotKeys: null, variantKeys }; }; var compileResolvedOptions = (resolved) => { if (resolved.compiledVariants !== null) return resolved; resolved.compiledVariants = compileVariants(resolved.variants, resolved.variantKeys); resolved.compiledCompoundVariants = compileCompoundVariants(resolved.compoundVariants); resolved.compiledCompoundSlots = compileCompoundSlots(resolved.compoundSlots); resolved.compiledCompoundSlotsBySlot = indexCompoundSlotsBySlot(resolved.compiledCompoundSlots); resolved.slotKeys = resolved.slots && typeof resolved.slots === "object" ? Object.keys(resolved.slots) : []; return resolved; }; var EMPTY_ARRAY = []; var variantClassesScratch = []; var compoundClassesScratch = []; var compoundVariantBySlotScratch = []; var compoundSlotClassesScratch = []; var getCompleteProps = (defaultVariants, props, slotProps) => { const result = {}; for (const key in defaultVariants) { result[key] = defaultVariants[key]; } if (props) { for (const key in props) { if (props[key] !== void 0) result[key] = props[key]; } } if (slotProps) { for (const key in slotProps) { if (slotProps[key] !== void 0) result[key] = slotProps[key]; } } return result; }; var isNullishOrFalse = (value) => value == null || value === false; var matchesCompoundValue = (expected, actual) => { if (!Array.isArray(expected)) { return expected === actual || isNullishOrFalse(expected) && isNullishOrFalse(actual); } for (let i = 0; i < expected.length; i++) { const expectedValue = expected[i]; if (expectedValue === actual || isNullishOrFalse(expectedValue) && isNullishOrFalse(actual)) { return true; } } return false; }; var getVariantValue = (variant, defaultVariants, props, slotProps) => { var _a2; if (variant.isEmpty) return null; const variantProp = (_a2 = slotProps == null ? void 0 : slotProps[variant.key]) != null ? _a2 : props == null ? void 0 : props[variant.key]; if (variantProp === null) return null; const variantKey = falsyToString(variantProp); if (typeof variantKey === "object") return null; const defaultVariantProp = defaultVariants == null ? void 0 : defaultVariants[variant.key]; const key = variantKey != null ? variantKey : falsyToString(defaultVariantProp); return variant.values[key || "false"]; }; var matchesConditions = (compound, completeProps) => { const { conditionKeys, source } = compound; for (let i = 0; i < conditionKeys.length; i++) { const key = conditionKeys[i]; if (!matchesCompoundValue(source[key], completeProps[key])) return false; } return true; }; var pushCompoundClassForSlot = (result, slotKey, classValue) => { if (typeof classValue === "string") { if (slotKey === "base") result.push(classValue); } else if (classValue && typeof classValue === "object" && classValue[slotKey]) { result.push(classValue[slotKey]); } }; var getVariantClassNames = (variants, defaultVariants, props) => { const result = variantClassesScratch; result.length = 0; for (let i = 0; i < variants.length; i++) { const value = getVariantValue(variants[i], defaultVariants, props); if (value) result.push(value); } return result; }; var getVariantClassNamesBySlot = (slotKey, variants, defaultVariants, props, slotProps) => { const result = variantClassesScratch; result.length = 0; for (let i = 0; i < variants.length; i++) { const variantValue = getVariantValue(variants[i], defaultVariants, props, slotProps); const value = slotKey === "base" && typeof variantValue === "string" ? variantValue : variantValue && variantValue[slotKey]; if (value) result.push(value); } return result; }; var getCompoundVariantClasses = (compoundVariants, completeProps) => { const result = compoundClassesScratch; result.length = 0; for (let i = 0; i < compoundVariants.length; i++) { const compoundVariant = compoundVariants[i]; if (!matchesConditions(compoundVariant, completeProps)) continue; if (compoundVariant.source.class) result.push(compoundVariant.source.class); if (compoundVariant.source.className) result.push(compoundVariant.source.className); } return result; }; var getCompoundVariantClassesBySlot = (slotKey, compoundVariants, completeProps) => { const result = compoundVariantBySlotScratch; result.length = 0; for (let i = 0; i < compoundVariants.length; i++) { const compoundVariant = compoundVariants[i]; if (!matchesConditions(compoundVariant, completeProps)) continue; pushCompoundClassForSlot(result, slotKey, compoundVariant.source.class); pushCompoundClassForSlot(result, slotKey, compoundVariant.source.className); } return result; }; var getCompoundSlotClasses = (compoundSlotsForKey, completeProps) => { const result = compoundSlotClassesScratch; result.length = 0; for (let i = 0; i < compoundSlotsForKey.length; i++) { const compoundSlot = compoundSlotsForKey[i]; if (!matchesConditions(compoundSlot, completeProps)) continue; if (compoundSlot.source.class) result.push(compoundSlot.source.class); if (compoundSlot.source.className) result.push(compoundSlot.source.className); } return result; }; var createPlainResolver = (resolved, cn) => { const { base, config: config2 } = resolved; let core = CACHE_MISS; const mergeOverride = createLazyOverrideMerge(cn, config2); return ((props) => { if (core === CACHE_MISS) { core = cn(config2, base); } return mergeOverride(core, props); }); }; var createVariantResolver = (resolved, cn) => { const { base, config: config2, defaultVariants, deferredError, variantKeys } = resolved; let compiledCompoundVariants = resolved.compiledCompoundVariants; let compiledVariants = resolved.compiledVariants; let compiledCompoundSlots = EMPTY_ARRAY; let cache = null; const mergeOverride = createLazyOverrideMerge(cn, config2); let coldInvokesRemaining = 1; const computeCore = (props) => { const compoundClasses = compiledCompoundVariants.length > 0 ? getCompoundVariantClasses( compiledCompoundVariants, getCompleteProps(defaultVariants, props) ) : void 0; return cn( config2, base, getVariantClassNames(compiledVariants, defaultVariants, props), compoundClasses ); }; return ((props) => { var _a2; if (deferredError) throw deferredError; if (compiledVariants === null || compiledCompoundVariants === null) { compileResolvedOptions(resolved); compiledVariants = resolved.compiledVariants; compiledCompoundVariants = resolved.compiledCompoundVariants; compiledCompoundSlots = (_a2 = resolved.compiledCompoundSlots) != null ? _a2 : EMPTY_ARRAY; } let core; if (coldInvokesRemaining > 0) { coldInvokesRemaining--; core = computeCore(props); } else { cache != null ? cache : cache = createResultCache(); const propsFingerprint = buildPropsFingerprint(variantKeys, defaultVariants, props); if (propsFingerprint !== null) { const compoundsSig = compiledCompoundVariants.length > 0 || compiledCompoundSlots.length > 0 ? buildCompoundsSignature(compiledCompoundVariants, compiledCompoundSlots) : ""; const cacheKey = propsFingerprint + "#" + compoundsSig; const cached = cache.get(cacheKey); if (cached !== CACHE_MISS) { core = cached; } else { core = computeCore(props); cache.set(cacheKey, core); } } else { core = computeCore(props); } } return mergeOverride(core, props); }); }; var createSlotsResolver = (resolved, cn) => { const { config: config2, defaultVariants, deferredError, slots, variantKeys } = resolved; let compoundVariants = null; let compoundSlots = null; let keys = null; let slotComputers = null; let hasCompounds = false; let mergeOverride = null; let parentCache = null; let coldParentInvokesRemaining = 1; const ensureCompiled = () => { var _a2; if (keys !== null) return; if (resolved.compiledVariants === null || resolved.compiledCompoundVariants === null || resolved.compiledCompoundSlots === null || resolved.compiledCompoundSlotsBySlot === null || resolved.slotKeys === null) { compileResolvedOptions(resolved); } const variants = resolved.compiledVariants; compoundVariants = resolved.compiledCompoundVariants; compoundSlots = resolved.compiledCompoundSlots; const compoundSlotsBySlot = resolved.compiledCompoundSlotsBySlot; keys = resolved.slotKeys; hasCompounds = compoundVariants.length > 0 || compoundSlots.length > 0; mergeOverride = createLazyOverrideMerge(cn, config2); const computers = new Array(keys.length); for (let i = 0; i < keys.length; i++) { const slotKey = keys[i]; const compoundSlotsForKey = (_a2 = compoundSlotsBySlot[slotKey]) != null ? _a2 : EMPTY_ARRAY; computers[i] = (propsRef, slotProps) => { const completeProps = hasCompounds ? getCompleteProps(defaultVariants, propsRef, slotProps) : void 0; const compoundVariantClasses = completeProps ? getCompoundVariantClassesBySlot(slotKey, compoundVariants, completeProps) : void 0; const compoundSlotClasses = completeProps ? getCompoundSlotClasses(compoundSlotsForKey, completeProps) : void 0; return cn( config2, slots[slotKey], getVariantClassNamesBySlot(slotKey, variants, defaultVariants, propsRef, slotProps), compoundVariantClasses, compoundSlotClasses ); }; } slotComputers = computers; }; const createSlotsResult = (props) => { const slotKeys = keys; const computers = slotComputers; const overrideMerge = mergeOverride; const result = {}; for (let i = 0; i < slotKeys.length; i++) { const compute = computers[i]; const core = compute(props); result[slotKeys[i]] = (slotProps) => { if (slotProps == null) return core; let hasVariantOverride = false; for (const key in slotProps) { if (key === "class" || key === "className") continue; if (slotProps[key] !== void 0) { hasVariantOverride = true; break; } } if (!hasVariantOverride) { return overrideMerge(core, slotProps); } return overrideMerge(compute(props, slotProps), slotProps); }; } return result; }; return ((props) => { if (deferredError) throw deferredError; ensureCompiled(); if (coldParentInvokesRemaining > 0) { coldParentInvokesRemaining--; return createSlotsResult(props); } const propsFingerprint = buildPropsFingerprint(variantKeys, defaultVariants, props); if (propsFingerprint === null) { return createSlotsResult(props); } const compoundsSig = hasCompounds ? buildCompoundsSignature(compoundVariants, compoundSlots) : ""; const cacheKey = propsFingerprint + "#" + compoundsSig; parentCache != null ? parentCache : parentCache = createBoundedCache(); const cached = parentCache.get(cacheKey); if (cached !== CACHE_MISS) return cached; const next = createSlotsResult(props); parentCache.set(cacheKey, next); return next; }); }; var createClassResolver = (resolved, cn) => { if (resolved.mode === "plain") return createPlainResolver(resolved, cn); let resolver; return ((props) => { resolver != null ? resolver : resolver = resolved.mode === "slots" ? createSlotsResolver(resolved, cn) : createVariantResolver(resolved, cn); return resolver(props); }); }; var attachComponentMetadata = (component, resolved) => { component.variantKeys = resolved.variantKeys; component.extend = resolved.extend; component.base = resolved.base; component.slots = resolved.slots; component.variants = resolved.variants; component.defaultVariants = resolved.defaultVariants; component.compoundSlots = resolved.compoundSlots; component.compoundVariants = resolved.compoundVariants; }; var getTailwindVariants = (cn) => { const tv2 = (options, configProp) => { const resolved = resolveOptions(options, configProp); const component = createClassResolver(resolved, cn); attachComponentMetadata(component, resolved); return component; }; const createTV2 = (configProp) => { return (options, config2) => tv2(options, config2 ? mergeObjects(configProp, config2) : configProp); }; return { tv: tv2, createTV: createTV2 }; }; var concatArrays = (array1, array2) => { const length1 = array1.length; const length2 = array2.length; const combined = new Array(length1 + length2); for (let i = 0; i < length1; i++) combined[i] = array1[i]; for (let i = 0; i < length2; i++) combined[length1 + i] = array2[i]; return combined; }; var createClassValidatorObject = (classGroupId, validator) => ({ classGroupId, validator }); var createClassPartObject = (nextPart = new Map(), validators = null, classGroupId) => ({ nextPart, validators, classGroupId }); var CLASS_PART_SEPARATOR = "-"; var EMPTY_CONFLICTS = []; var ARBITRARY_PROPERTY_PREFIX = "arbitrary.."; var createClassGroupUtils = (config2) => { const classMap = createClassMap(config2); const { conflictingClassGroups, conflictingClassGroupModifiers } = config2; const getClassGroupId = (className) => { if (className[0] === "[" && className[className.length - 1] === "]") { return getGroupIdForArbitraryProperty(className); } const classParts = className.split(CLASS_PART_SEPARATOR); const startIndex = classParts[0] === "" && classParts.length > 1 ? 1 : 0; return getGroupRecursive(classParts, startIndex, classMap); }; const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => { if (hasPostfixModifier) { const modifierConflicts = conflictingClassGroupModifiers[classGroupId]; const baseConflicts = conflictingClassGroups[classGroupId]; if (modifierConflicts) { if (baseConflicts) { return concatArrays(baseConflicts, modifierConflicts); } return modifierConflicts; } return baseConflicts || EMPTY_CONFLICTS; } return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS; }; return { getClassGroupId, getConflictingClassGroupIds }; }; var getGroupRecursive = (classParts, startIndex, classPartObject) => { const classPathsLength = classParts.length - startIndex; if (classPathsLength === 0) { return classPartObject.classGroupId; } const currentClassPart = classParts[startIndex]; const nextClassPartObject = classPartObject.nextPart.get(currentClassPart); if (nextClassPartObject) { const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject); if (result) return result; } const validators = classPartObject.validators; if (validators === null) { return void 0; } const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR); const validatorsLength = validators.length; for (let index = 0; index < validatorsLength; index++) { const validatorObject = validators[index]; if (validatorObject.validator(classRest)) { return validatorObject.classGroupId; } } return void 0; }; var getGroupIdForArbitraryProperty = (className) => { const content = className.slice(1, -1); const colonIndex = content.indexOf(":"); if (colonIndex === -1) { return void 0; } const property = content.slice(0, colonIndex); return property ? ARBITRARY_PROPERTY_PREFIX + property : void 0; }; var createClassMap = (config2) => { const { theme: theme2, classGroups } = config2; return processClassGroups(classGroups, theme2); }; var processClassGroups = (classGroups, theme2) => { const classMap = createClassPartObject(); for (const classGroupId in classGroups) { const group = classGroups[classGroupId]; processClassesRecursively(group, classMap, classGroupId, theme2); } return classMap; }; var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme2) => { const length = classGroup.length; for (let index = 0; index < length; index++) { const classDefinition = classGroup[index]; processClassDefinition(classDefinition, classPartObject, classGroupId, theme2); } }; var processClassDefinition = (classDefinition, classPartObject, classGroupId, theme2) => { if (typeof classDefinition === "string") { processStringDefinition(classDefinition, classPartObject, classGroupId); return; } if (typeof classDefinition === "function") { processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme2); return; } processObjectDefinition( classDefinition, classPartObject, classGroupId, theme2 ); }; var processStringDefinition = (classDefinition, classPartObject, classGroupId) => { const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition); classPartObjectToEdit.classGroupId = classGroupId; }; var processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme2) => { if (isThemeGetter(classDefinition)) { processClassesRecursively(classDefinition(theme2), classPartObject, classGroupId, theme2); return; } if (classPartObject.validators === null) { classPartObject.validators = []; } classPartObject.validators.push( createClassValidatorObject(classGroupId, classDefinition) ); }; var processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme2) => { const entries = Object.entries(classDefinition); const length = entries.length; for (let index = 0; index < length; index++) { const [key, value] = entries[index]; processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme2); } }; var getPart = (classPartObject, path) => { let current = classPartObject; const parts = path.split(CLASS_PART_SEPARATOR); const length = parts.length; for (let index = 0; index < length; index++) { const part = parts[index]; let next = current.nextPart.get(part); if (!next) { next = createClassPartObject(); current.nextPart.set(part, next); } current = next; } return current; }; var isThemeGetter = (classDefinition) => "isThemeGetter" in classDefinition && classDefinition.isThemeGetter === true; var IMPORTANT_MODIFIER = "!"; var CHAR_MODIFIER_SEPARATOR = 58; var CHAR_POSTFIX_SEPARATOR = 47; var CHAR_OPEN_BRACKET = 91; var CHAR_CLOSE_BRACKET = 93; var CHAR_OPEN_PAREN = 40; var CHAR_CLOSE_PAREN = 41; var CHAR_IMPORTANT = 33; var createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition) => ({ modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal: void 0 }); var parseClassName = (className) => { const modifiers = []; let bracketDepth = 0; let parenDepth = 0; let modifierStart = 0; let postfixModifierPosition; const len = className.length; for (let index = 0; index < len; index++) { const charCode = className.charCodeAt(index); if (bracketDepth === 0 && parenDepth === 0) { if (charCode === CHAR_MODIFIER_SEPARATOR) { modifiers.push(className.slice(modifierStart, index)); modifierStart = index + 1; continue; } if (charCode === CHAR_POSTFIX_SEPARATOR) { postfixModifierPosition = index; continue; } } if (charCode === CHAR_OPEN_BRACKET) bracketDepth++; else if (charCode === CHAR_CLOSE_BRACKET) bracketDepth--; else if (charCode === CHAR_OPEN_PAREN) parenDepth++; else if (charCode === CHAR_CLOSE_PAREN) parenDepth--; } const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart); let baseClassName = baseClassNameWithImportantModifier; let hasImportantModifier = false; const lastIndex = baseClassNameWithImportantModifier.length - 1; if (baseClassNameWithImportantModifier.charCodeAt(lastIndex) === CHAR_IMPORTANT) { baseClassName = baseClassNameWithImportantModifier.slice(0, -1); hasImportantModifier = true; } else if ( baseClassNameWithImportantModifier.charCodeAt(0) === CHAR_IMPORTANT ) { baseClassName = baseClassNameWithImportantModifier.slice(1); hasImportantModifier = true; } const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0; return createResultObject( modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition ); }; var createSortModifiers = (config2) => { const orderSensitiveModifiers = new Set(config2.orderSensitiveModifiers); return (modifiers) => { const result = []; let currentSegment = []; for (let index = 0; index < modifiers.length; index++) { const modifier = modifiers[index]; const isArbitrary = modifier[0] === "["; const isOrderSensitive = orderSensitiveModifiers.has(modifier); if (isArbitrary || isOrderSensitive) { if (currentSegment.length > 0) { currentSegment.sort(); for (let segmentIndex = 0; segmentIndex < currentSegment.length; segmentIndex++) { result.push(currentSegment[segmentIndex]); } currentSegment = []; } result.push(modifier); } else { currentSegment.push(modifier); } } if (currentSegment.length > 0) { currentSegment.sort(); for (let segmentIndex = 0; segmentIndex < currentSegment.length; segmentIndex++) { result.push(currentSegment[segmentIndex]); } } return result; }; }; var EXTERNAL_DESCRIPTOR = { isExternal: true, classId: -1, conflictIds: [] }; var DESCRIPTOR_CACHE_SIZE = 4096; var MAX_CONFLICT_KEYS = 16384; var createConfigUtils = (config2) => { const sortModifiers = createSortModifiers(config2); const postfixLookupClassGroupIds = createPostfixLookupClassGroupIds(config2); const { getClassGroupId, getConflictingClassGroupIds } = createClassGroupUtils(config2); let descriptorCache = Object.create(null); let previousDescriptorCache = Object.create(null); let descriptorCacheSize = 0; let claimedGeneration = new Int32Array(256); let currentGeneration = 0; let keepFlags = new Uint8Array(64); let splitSawNonSpaceWhitespace = false; const splitClassList = (classList) => { const tokens = []; const length = classList.length; let tokenStart = -1; splitSawNonSpaceWhitespace = false; for (let index = 0; index < length; index++) { const charCode = classList.charCodeAt(index); if (charCode === 32) { if (tokenStart !== -1) { tokens.push(classList.slice(tokenStart, index)); tokenStart = -1; } } else if (charCode >= 9 && charCode <= 13) { splitSawNonSpaceWhitespace = true; if (tokenStart !== -1) { tokens.push(classList.slice(tokenStart, index)); tokenStart = -1; } } else if (tokenStart === -1) { tokenStart = index; } } if (tokenStart !== -1) { tokens.push(classList.slice(tokenStart)); } return tokens; }; const conflictKeyIds = new Map(); let nextConflictKeyId = 0; const internConflictKey = (conflictKey) => { let id = conflictKeyIds.get(conflictKey); if (id === void 0) { id = nextConflictKeyId++; conflictKeyIds.set(conflictKey, id); if (id >= claimedGeneration.length) { const grown = new Int32Array(claimedGeneration.length * 2); grown.set(claimedGeneration); claimedGeneration = grown; } } return id; }; const computeClassDescriptor = (originalClassName) => { const { isExternal, modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition } = parseClassName(originalClassName); if (isExternal) { return EXTERNAL_DESCRIPTOR; } let hasPostfixModifier = Boolean(maybePostfixModifierPosition); let classGroupId; if (hasPostfixModifier) { const baseClassNameWithoutPostfix = baseClassName.substring(0, maybePostfixModifierPosition); classGroupId = getClassGroupId(baseClassNameWithoutPostfix); const classGroupIdWithPostfix = classGroupId && postfixLookupClassGroupIds[classGroupId] ? getClassGroupId(baseClassName) : void 0; if (classGroupIdWithPostfix && classGroupIdWithPostfix !== classGroupId) { classGroupId = classGroupIdWithPostfix; hasPostfixModifier = false; } } else { classGroupId = getClassGroupId(baseClassName); } if (!classGroupId) { if (!hasPostfixModifier) { return EXTERNAL_DESCRIPTOR; } classGroupId = getClassGroupId(baseClassName); if (!classGroupId) { return EXTERNAL_DESCRIPTOR; } hasPostfixModifier = false; } const variantModifier = modifiers.length === 0 ? "" : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(":"); const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier; const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier); const conflictIds = []; for (let index = 0; index < conflictGroups.length; index++) { conflictIds.push(internConflictKey(modifierId + conflictGroups[index])); } return { isExternal: false, classId: internConflictKey(modifierId + classGroupId), conflictIds }; }; const getClassDescriptor = (originalClassName) => { let descriptor = descriptorCache[originalClassName]; if (descriptor !== void 0) { return descriptor; } descriptor = previousDescriptorCache[originalClassName]; if (descriptor === void 0) { descriptor = computeClassDescriptor(originalClassName); } descriptorCache[originalClassName] = descriptor; if (++descriptorCacheSize > DESCRIPTOR_CACHE_SIZE) { descriptorCacheSize = 0; previousDescriptorCache = descriptorCache; descriptorCache = Object.create(null); } return descriptor; }; const mergeClassList = (classList) => { const classNames = splitClassList(classList); const classCount = classNames.length; if (classCount === 1) { return classNames[0]; } if (nextConflictKeyId > MAX_CONFLICT_KEYS) { conflictKeyIds.clear(); nextConflictKeyId = 0; descriptorCache = Object.create(null); previousDescriptorCache = Object.create(null); descriptorCacheSize = 0; } currentGeneration = currentGeneration + 1 | 0; if (currentGeneration === 0) currentGeneration = 1; const generation = currentGeneration; if (classCount > keepFlags.length) { let capacity = keepFlags.length; while (capacity < classCount) capacity *= 2; keepFlags = new Uint8Array(capacity); } let didDrop = false; let tokenCharCount = 0; for (let index = classCount - 1; index >= 0; index -= 1) { const className = classNames[index]; tokenCharCount += className.length; const descriptor = getClassDescriptor(className); if (descriptor.isExternal) { keepFlags[index] = 1; continue; } const classId = descriptor.classId; if (claimedGeneration[classId] === generation) { keepFlags[index] = 0; didDrop = true; continue; } claimedGeneration[classId] = generation; const conflictIds = descriptor.conflictIds; for (let conflictIndex = 0; conflictIndex < conflictIds.length; conflictIndex++) { claimedGeneration[conflictIds[conflictIndex]] = generation; } keepFlags[index] = 1; } if (!didDrop && !splitSawNonSpaceWhitespace && classList.length === tokenCharCount + classCount - 1) { return classList; } let result = ""; for (let index = 0; index < classCount; index++) { if (keepFlags[index] === 1) { if (result) result += " "; result += classNames[index]; } } return result; }; return { parseClassName, sortModifiers, postfixLookupClassGroupIds, getClassGroupId, getConflictingClassGroupIds, getClassDescriptor, mergeClassList }; }; var createPostfixLookupClassGroupIds = (config2) => { const lookup = Object.create(null); const classGroupIds = config2.postfixLookupClassGroups; if (classGroupIds) { for (let index = 0; index < classGroupIds.length; index++) { lookup[classGroupIds[index]] = true; } } return lookup; }; var MERGE_CACHE_SIZE = 500; var createTailwindMerge = (createConfig) => { let configUtils; let mergeClassList; let cache = Object.create(null); let previousCache = Object.create(null); let cacheSize = 0; const initTailwindMerge = (classList) => { configUtils = createConfigUtils(createConfig()); mergeClassList = configUtils.mergeClassList; merge.mergeString = tailwindMerge; return tailwindMerge(classList); }; const tailwindMerge = (classList) => { let result = cache[classList]; if (result !== void 0) { return result; } result = previousCache[classList]; if (result === void 0) { result = mergeClassList(classList); } cache[classList] = result; if (++cacheSize > MERGE_CACHE_SIZE) { cacheSize = 0; previousCache = cache; cache = Object.create(null); } return result; }; const merge = (...args) => merge.mergeString(joinClassValue(args)); merge.mergeString = initTailwindMerge; return merge; }; var fallbackThemeArr = []; var fromTheme = (key) => { const themeGetter = (theme2) => theme2[key] || fallbackThemeArr; themeGetter.isThemeGetter = true; return themeGetter; }; var arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i; var arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i; var fractionRegex = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/; var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/; var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/; var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/; var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/; var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/; var toNumber = Number; var numberIsNaN = Number.isNaN; var numberIsInteger = Number.isInteger; var isFraction = (value) => fractionRegex.test(value); var isNumber = (value) => Boolean(value) && !numberIsNaN(toNumber(value)); var isInteger = (value) => Boolean(value) && numberIsInteger(toNumber(value)); var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1)); var isTshirtSize = (value) => tshirtUnitRegex.test(value); var isAny = () => true; var isLengthOnly = (value) => ( lengthUnitRegex.test(value) && !colorFunctionRegex.test(value) ); var isNever = () => false; var isShadow = (value) => shadowRegex.test(value); var isImage = (value) => imageRegex.test(value); var isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value); var isNamedContainerQuery = (value) => value.startsWith("@container") && (value[10] === "/" && value[11] !== void 0 || value[11] === "s" && value[16] !== void 0 && value.startsWith("-size/", 10) || value[11] === "n" && value[18] !== void 0 && value.startsWith("-normal/", 10)); var isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever); var isArbitraryValue = (value) => arbitraryValueRegex.test(value); var isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly); var isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber); var isArbitraryWeight = (value) => getIsArbitraryValue(value, isLabelWeight, isAny); var isArbitraryFamilyName = (value) => getIsArbitraryValue(value, isLabelFamilyName, isNever); var isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever); var isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage); var isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow); var isArbitraryVariable = (value) => arbitraryVariableRegex.test(value); var isArbitraryVariableLength = (value) => getIsArbitraryVariable(value, isLabelLength); var isArbitraryVariableFamilyName = (value) => getIsArbitraryVariable(value, isLabelFamilyName); var isArbitraryVariablePosition = (value) => getIsArbitraryVariable(value, isLabelPosition); var isArbitraryVariableSize = (value) => getIsArbitraryVariable(value, isLabelSize); var isArbitraryVariableImage = (value) => getIsArbitraryVariable(value, isLabelImage); var isArbitraryVariableShadow = (value) => getIsArbitraryVariable(value, isLabelShadow, true); var isArbitraryVariableWeight = (value) => getIsArbitraryVariable(value, isLabelWeight, true); var getIsArbitraryValue = (value, testLabel, testValue) => { const result = arbitraryValueRegex.exec(value); if (result) { if (result[1]) { return testLabel(result[1]); } return testValue(result[2]); } return false; }; var getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => { const result = arbitraryVariableRegex.exec(value); if (result) { if (result[1]) { return testLabel(result[1]); } return shouldMatchNoLabel; } return false; }; var isLabelPosition = (label) => label === "position" || label === "percentage"; var isLabelImage = (label) => label === "image" || label === "url"; var isLabelSize = (label) => label === "length" || label === "size" || label === "bg-size"; var isLabelLength = (label) => label === "length"; var isLabelNumber = (label) => label === "number"; var isLabelFamilyName = (label) => label === "family-name"; var isLabelWeight = (label) => label === "number" || label === "weight"; var isLabelShadow = (label) => label === "shadow"; var getDefaultConfig = () => { const themeColor = fromTheme("color"); const themeFont = fromTheme("font"); const themeText = fromTheme("text"); const themeFontWeight = fromTheme("font-weight"); const themeTracking = fromTheme("tracking"); const themeLeading = fromTheme("leading"); const themeBreakpoint = fromTheme("breakpoint"); const themeContainer = fromTheme("container"); const themeSpacing = fromTheme("spacing"); const themeRadius = fromTheme("radius"); const themeShadow = fromTheme("shadow"); const themeInsetShadow = fromTheme("inset-shadow"); const themeTextShadow = fromTheme("text-shadow"); const themeDropShadow = fromTheme("drop-shadow"); const themeBlur = fromTheme("blur"); const themePerspective = fromTheme("perspective"); const themeAspect = fromTheme("aspect"); const themeEase = fromTheme("ease"); const themeAnimate = fromTheme("animate"); const scaleBreak = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"]; const scalePosition = () => [ "center", "top", "bottom", "left", "right", "top-left", "left-top", "top-right", "right-top", "bottom-right", "right-bottom", "bottom-left", "left-bottom" ]; const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue]; const scaleOverflow = () => ["auto", "hidden", "clip", "visible", "scroll"]; const scaleOverscroll = () => ["auto", "contain", "none"]; const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing]; const scaleInset = () => [isFraction, "full", "auto", ...scaleUnambiguousSpacing()]; const scaleGridTemplateColsRows = () => [isInteger, "none", "subgrid", isArbitraryVariable, isArbitraryValue]; const scaleGridColRowStartAndEnd = () => [ "auto", { span: ["full", isInteger, isArbitraryVariable, isArbitraryValue] }, isInteger, isArbitraryVariable, isArbitraryValue ]; const scaleGridColRowStartOrEnd = () => [isInteger, "auto", isArbitraryVariable, isArbitraryValue]; const scaleGridAutoColsRows = () => ["auto", "min", "max", "fr", isArbitraryVariable, isArbitraryValue]; const scaleAlignPrimaryAxis = () => [ "start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe" ]; const scaleAlignSecondaryAxis = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"]; const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()]; const scaleSizing = () => [ isFraction, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...scaleUnambiguousSpacing() ]; const scaleSizingInline = () => [ isFraction, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...scaleUnambiguousSpacing() ]; const scaleSizingBlock = () => [ isFraction, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...scaleUnambiguousSpacing() ]; const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue]; const scaleBgPosition = () => [ ...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, { position: [isArbitraryVariable, isArbitraryValue] } ]; const scaleBgRepeat = () => ["no-repeat", { repeat: ["", "x", "y", "space", "round"] }]; const scaleBgSize = () => [ "auto", "cover", "contain", isArbitraryVariableSize, isArbitrarySize, { size: [isArbitraryVariable, isArbitraryValue] } ]; const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength]; const scaleRadius = () => [ "", "none", "full", themeRadius, isArbitraryVariable, isArbitraryValue ]; const scaleBorderWidth = () => ["", isNumber, isArbitraryVariableLength, isArbitraryLength]; const scaleLineStyle = () => ["solid", "dashed", "dotted", "double"]; const scaleBlendMode = () => [ "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity" ]; const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition]; const scaleBlur = () => [ "", "none", themeBlur, isArbitraryVariable, isArbitraryValue ]; const scaleRotate = () => ["none", isNumber, isArbitraryVariable, isArbitraryValue]; const scaleScale = () => ["none", isNumber, isArbitraryVariable, isArbitraryValue]; const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue]; const scaleTranslate = () => [isFraction, "full", ...scaleUnambiguousSpacing()]; return { theme: { animate: ["spin", "ping", "pulse", "bounce"], aspect: ["video"], blur: [isTshirtSize], breakpoint: [isTshirtSize], color: [isAny], container: [isTshirtSize], "drop-shadow": [isTshirtSize], ease: ["in", "out", "in-out"], font: [isAnyNonArbitrary], "font-weight": [ "thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black" ], "inset-shadow": [isTshirtSize], leading: ["none", "tight", "snug", "normal", "relaxed", "loose"], perspective: ["dramatic", "near", "normal", "midrange", "distant", "none"], radius: [isTshirtSize], shadow: [isTshirtSize], spacing: ["px", isNumber], text: [isTshirtSize], "text-shadow": [isTshirtSize], tracking: ["tighter", "tight", "normal", "wide", "wider", "widest"] }, classGroups: { aspect: [ { aspect: [ "auto", "square", isFraction, isArbitraryValue, isArbitraryVariable, themeAspect ] } ], container: ["container"], "container-type": [ { "@container": ["", "normal", "size", isArbitraryVariable, isArbitraryValue] } ], "container-named": [isNamedContainerQuery], columns: [{ columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer] }], "break-after": [{ "break-after": scaleBreak() }], "break-before": [{ "break-before": scaleBreak() }], "break-inside": [{ "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"] }], "box-decoration": [{ "box-decoration": ["slice", "clone"] }], box: [{ box: ["border", "content"] }], display: [ "block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden" ], sr: ["sr-only", "not-sr-only"], float: [{ float: ["right", "left", "none", "start", "end"] }], clear: [{ clear: ["left", "right", "both", "none", "start", "end"] }], isolation: ["isolate", "isolation-auto"], "object-fit": [{ object: ["contain", "cover", "fill", "none", "scale-down"] }], "object-position": [{ object: scalePositionWithArbitrary() }], overflow: [{ overflow: scaleOverflow() }], "overflow-x": [{ "overflow-x": scaleOverflow() }], "overflow-y": [{ "overflow-y": scaleOverflow() }], overscroll: [{ overscroll: scaleOverscroll() }], "overscroll-x": [{ "overscroll-x": scaleOverscroll() }], "overscroll-y": [{ "overscroll-y": scaleOverscroll() }], position: ["static", "fixed", "absolute", "relative", "sticky"], inset: [{ inset: scaleInset() }], "inset-x": [{ "inset-x": scaleInset() }], "inset-y": [{ "inset-y": scaleInset() }], start: [ { "inset-s": scaleInset(), start: scaleInset() } ], end: [ { "inset-e": scaleInset(), end: scaleInset() } ], "inset-bs": [{ "inset-bs": scaleInset() }], "inset-be": [{ "inset-be": scaleInset() }], top: [{ top: scaleInset() }], right: [{ right: scaleInset() }], bottom: [{ bottom: scaleInset() }], left: [{ left: scaleInset() }], visibility: ["visible", "invisible", "collapse"], z: [{ z: [isInteger, "auto", isArbitraryVariable, isArbitraryValue] }], basis: [ { basis: [isFraction, "full", "auto", themeContainer, ...scaleUnambiguousSpacing()] } ], "flex-direction": [{ flex: ["row", "row-reverse", "col", "col-reverse"] }], "flex-wrap": [{ flex: ["nowrap", "wrap", "wrap-reverse"] }], flex: [{ flex: [isNumber, isFraction, "auto", "initial", "none", isArbitraryValue] }], grow: [{ grow: ["", isNumber, isArbitraryVariable, isArbitraryValue] }], shrink: [{ shrink: ["", isNumber, isArbitraryVariable, isArbitraryValue] }], order: [ { order: [isInteger, "first", "last", "none", isArbitraryVariable, isArbitraryValue] } ], "grid-cols": [{ "grid-cols": scaleGridTemplateColsRows() }], "col-start-end": [{ col: scaleGridColRowStartAndEnd() }], "col-start": [{ "col-start": scaleGridColRowStartOrEnd() }], "col-end": [{ "col-end": scaleGridColRowStartOrEnd() }], "grid-rows": [{ "grid-rows": scaleGridTemplateColsRows() }], "row-start-end": [{ row: scaleGridColRowStartAndEnd() }], "row-start": [{ "row-start": scaleGridColRowStartOrEnd() }], "row-end": [{ "row-end": scaleGridColRowStartOrEnd() }], "grid-flow": [{ "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"] }], "auto-cols": [{ "auto-cols": scaleGridAutoColsRows() }], "auto-rows": [{ "auto-rows": scaleGridAutoColsRows() }], gap: [{ gap: scaleUnambiguousSpacing() }], "gap-x": [{ "gap-x": scaleUnambiguousSpacing() }], "gap-y": [{ "gap-y": scaleUnambiguousSpacing() }], "justify-content": [{ justify: [...scaleAlignPrimaryAxis(), "normal"] }], "justify-items": [{ "justify-items": [...scaleAlignSecondaryAxis(), "normal"] }], "justify-self": [{ "justify-self": ["auto", ...scaleAlignSecondaryAxis()] }], "align-content": [{ content: ["normal", ...scaleAlignPrimaryAxis()] }], "align-items": [{ items: [...scaleAlignSecondaryAxis(), { baseline: ["", "last"] }] }], "align-self": [{ self: ["auto", ...scaleAlignSecondaryAxis(), { baseline: ["", "last"] }] }], "place-content": [{ "place-content": scaleAlignPrimaryAxis() }], "place-items": [{ "place-items": [...scaleAlignSecondaryAxis(), "baseline"] }], "place-self": [{ "place-self": ["auto", ...scaleAlignSecondaryAxis()] }], p: [{ p: scaleUnambiguousSpacing() }], px: [{ px: scaleUnambiguousSpacing() }], py: [{ py: scaleUnambiguousSpacing() }], ps: [{ ps: scaleUnambiguousSpacing() }], pe: [{ pe: scaleUnambiguousSpacing() }], pbs: [{ pbs: scaleUnambiguousSpacing() }], pbe: [{ pbe: scaleUnambiguousSpacing() }], pt: [{ pt: scaleUnambiguousSpacing() }], pr: [{ pr: scaleUnambiguousSpacing() }], pb: [{ pb: scaleUnambiguousSpacing() }], pl: [{ pl: scaleUnambiguousSpacing() }], m: [{ m: scaleMargin() }], mx: [{ mx: scaleMargin() }], my: [{ my: scaleMargin() }], ms: [{ ms: scaleMargin() }], me: [{ me: scaleMargin() }], mbs: [{ mbs: scaleMargin() }], mbe: [{ mbe: scaleMargin() }], mt: [{ mt: scaleMargin() }], mr: [{ mr: scaleMargin() }], mb: [{ mb: scaleMargin() }], ml: [{ ml: scaleMargin() }], "space-x": [{ "space-x": scaleUnambiguousSpacing() }], "space-x-reverse": ["space-x-reverse"], "space-y": [{ "space-y": scaleUnambiguousSpacing() }], "space-y-reverse": ["space-y-reverse"], size: [{ size: scaleSizing() }], "inline-size": [{ inline: ["auto", ...scaleSizingInline()] }], "min-inline-size": [{ "min-inline": ["auto", ...scaleSizingInline()] }], "max-inline-size": [{ "max-inline": ["none", ...scaleSizingInline()] }], "block-size": [{ block: ["auto", ...scaleSizingBlock()] }], "min-block-size": [{ "min-block": ["auto", ...scaleSizingBlock()] }], "max-block-size": [{ "max-block": ["none", ...scaleSizingBlock()] }], w: [{ w: [themeContainer, "screen", ...scaleSizing()] }], "min-w": [ { "min-w": [ themeContainer, "screen", "none", ...scaleSizing() ] } ], "max-w": [ { "max-w": [ themeContainer, "screen", "none", "prose", { screen: [themeBreakpoint] }, ...scaleSizing() ] } ], h: [{ h: ["screen", "lh", ...scaleSizing()] }], "min-h": [{ "min-h": ["screen", "lh", "none", ...scaleSizing()] }], "max-h": [{ "max-h": ["screen", "lh", ...scaleSizing()] }], "font-size": [{ text: ["base", themeText, isArbitraryVariableLength, isArbitraryLength] }], "font-smoothing": ["antialiased", "subpixel-antialiased"], "font-style": ["italic", "not-italic"], "font-weight": [ { font: [themeFontWeight, isArbitraryVariableWeight, isArbitraryWeight] } ], "font-stretch": [ { "font-stretch": [ "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded", isPercent, isArbitraryValue ] } ], "font-family": [{ font: [isArbitraryVariableFamilyName, isArbitraryFamilyName, themeFont] }], "font-features": [{ "font-features": [isArbitraryValue] }], "fvn-normal": ["normal-nums"], "fvn-ordinal": ["ordinal"], "fvn-slashed-zero": ["slashed-zero"], "fvn-figure": ["lining-nums", "oldstyle-nums"], "fvn-spacing": ["proportional-nums", "tabular-nums"], "fvn-fraction": ["diagonal-fractions", "stacked-fractions"], tracking: [{ tracking: [themeTracking, isArbitraryVariable, isArbitraryValue] }], "line-clamp": [{ "line-clamp": [isNumber, "none", isArbitraryVariable, isArbitraryNumber] }], leading: [ { leading: [ themeLeading, ...scaleUnambiguousSpacing() ] } ], "list-image": [{ "list-image": ["none", isArbitraryVariable, isArbitraryValue] }], "list-style-position": [{ list: ["inside", "outside"] }], "list-style-type": [ { list: ["disc", "decimal", "none", isArbitraryVariable, isArbitraryValue] } ], "text-alignment": [{ text: ["left", "center", "right", "justify", "start", "end"] }], "placeholder-color": [{ placeholder: scaleColor() }], "text-color": [{ text: scaleColor() }], "text-decoration": ["underline", "overline", "line-through", "no-underline"], "text-decoration-style": [{ decoration: [...scaleLineStyle(), "wavy"] }], "text-decoration-thickness": [ { decoration: [isNumber, "from-font", "auto", isArbitraryVariable, isArbitraryLength] } ], "text-decoration-color": [{ decoration: scaleColor() }], "underline-offset": [ { "underline-offset": [isNumber, "auto", isArbitraryVariable, isArbitraryValue] } ], "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"], "text-overflow": ["truncate", "text-ellipsis", "text-clip"], "text-wrap": [{ text: ["wrap", "nowrap", "balance", "pretty"] }], indent: [{ indent: scaleUnambiguousSpacing() }], "tab-size": [{ tab: [isInteger, isArbitraryVariable, isArbitraryValue] }], "vertical-align": [ { align: [ "baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryVariable, isArbitraryValue ] } ], whitespace: [ { whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"] } ], break: [{ break: ["normal", "words", "all", "keep"] }], wrap: [{ wrap: ["break-word", "anywhere", "normal"] }], hyphens: [{ hyphens: ["none", "manual", "auto"] }], content: [{ content: ["none", isArbitraryVariable, isArbitraryValue] }], "bg-attachment": [{ bg: ["fixed", "local", "scroll"] }], "bg-clip": [{ "bg-clip": ["border", "padding", "content", "text"] }], "bg-origin": [{ "bg-origin": ["border", "padding", "content"] }], "bg-position": [{ bg: scaleBgPosition() }], "bg-repeat": [{ bg: scaleBgRepeat() }], "bg-size": [{ bg: scaleBgSize() }], "bg-image": [ { bg: [ "none", { linear: [ { to: ["t", "tr", "r", "br", "b", "bl", "l", "tl"] }, isInteger, isArbitraryVariable, isArbitraryValue ], radial: ["", isArbitraryVariable, isArbitraryValue], conic: [isInteger, isArbitraryVariable, isArbitraryValue] }, isArbitraryVariableImage, isArbitraryImage ] } ], "bg-color": [{ bg: scaleColor() }], "gradient-from-pos": [{ from: scaleGradientStopPosition() }], "gradient-via-pos": [{ via: scaleGradientStopPosition() }], "gradient-to-pos": [{ to: scaleGradientStopPosition() }], "gradient-from": [{ from: scaleColor() }], "gradient-via": [{ via: scaleColor() }], "gradient-to": [{ to: scaleColor() }], rounded: [{ rounded: scaleRadius() }], "rounded-s": [{ "rounded-s": scaleRadius() }], "rounded-e": [{ "rounded-e": scaleRadius() }], "rounded-t": [{ "rounded-t": scaleRadius() }], "rounded-r": [{ "rounded-r": scaleRadius() }], "rounded-b": [{ "rounded-b": scaleRadius() }], "rounded-l": [{ "rounded-l": scaleRadius() }], "rounded-ss": [{ "rounded-ss": scaleRadius() }], "rounded-se": [{ "rounded-se": scaleRadius() }], "rounded-ee": [{ "rounded-ee": scaleRadius() }], "rounded-es": [{ "rounded-es": scaleRadius() }], "rounded-tl": [{ "rounded-tl": scaleRadius() }], "rounded-tr": [{ "rounded-tr": scaleRadius() }], "rounded-br": [{ "rounded-br": scaleRadius() }], "rounded-bl": [{ "rounded-bl": scaleRadius() }], "border-w": [{ border: scaleBorderWidth() }], "border-w-x": [{ "border-x": scaleBorderWidth() }], "border-w-y": [{ "border-y": scaleBorderWidth() }], "border-w-s": [{ "border-s": scaleBorderWidth() }], "border-w-e": [{ "border-e": scaleBorderWidth() }], "border-w-bs": [{ "border-bs": scaleBorderWidth() }], "border-w-be": [{ "border-be": scaleBorderWidth() }], "border-w-t": [{ "border-t": scaleBorderWidth() }], "border-w-r": [{ "border-r": scaleBorderWidth() }], "border-w-b": [{ "border-b": scaleBorderWidth() }], "border-w-l": [{ "border-l": scaleBorderWidth() }], "divide-x": [{ "divide-x": scaleBorderWidth() }], "divide-x-reverse": ["divide-x-reverse"], "divide-y": [{ "divide-y": scaleBorderWidth() }], "divide-y-reverse": ["divide-y-reverse"], "border-style": [{ border: [...scaleLineStyle(), "hidden", "none"] }], "divide-style": [{ divide: [...scaleLineStyle(), "hidden", "none"] }], "border-color": [{ border: scaleColor() }], "border-color-x": [{ "border-x": scaleColor() }], "border-color-y": [{ "border-y": scaleColor() }], "border-color-s": [{ "border-s": scaleColor() }], "border-color-e": [{ "border-e": scaleColor() }], "border-color-bs": [{ "border-bs": scaleColor() }], "border-color-be": [{ "border-be": scaleColor() }], "border-color-t": [{ "border-t": scaleColor() }], "border-color-r": [{ "border-r": scaleColor() }], "border-color-b": [{ "border-b": scaleColor() }], "border-color-l": [{ "border-l": scaleColor() }], "divide-color": [{ divide: scaleColor() }], "outline-style": [{ outline: [...scaleLineStyle(), "none", "hidden"] }], "outline-offset": [{ "outline-offset": [isNumber, isArbitraryVariable, isArbitraryValue] }], "outline-w": [{ outline: ["", isNumber, isArbitraryVariableLength, isArbitraryLength] }], "outline-color": [{ outline: scaleColor() }], shadow: [ { shadow: [ "", "none", themeShadow, isArbitraryVariableShadow, isArbitraryShadow ] } ], "shadow-color": [{ shadow: scaleColor() }], "inset-shadow": [ { "inset-shadow": ["none", themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow] } ], "inset-shadow-color": [{ "inset-shadow": scaleColor() }], "ring-w": [{ ring: scaleBorderWidth() }], "ring-w-inset": ["ring-inset"], "ring-color": [{ ring: scaleColor() }], "ring-offset-w": [{ "ring-offset": [isNumber, isArbitraryLength] }], "ring-offset-color": [{ "ring-offset": scaleColor() }], "inset-ring-w": [{ "inset-ring": scaleBorderWidth() }], "inset-ring-color": [{ "inset-ring": scaleColor() }], "text-shadow": [ { "text-shadow": ["none", themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow] } ], "text-shadow-color": [{ "text-shadow": scaleColor() }], opacity: [{ opacity: [isNumber, isArbitraryVariable, isArbitraryValue] }], "mix-blend": [{ "mix-blend": [...scaleBlendMode(), "plus-darker", "plus-lighter"] }], "bg-blend": [{ "bg-blend": scaleBlendMode() }], "mask-clip": [ { "mask-clip": ["border", "padding", "content", "fill", "stroke", "view"] }, "mask-no-clip" ], "mask-composite": [{ mask: ["add", "subtract", "intersect", "exclude"] }], "mask-image-linear-pos": [{ "mask-linear": [isNumber] }], "mask-image-linear-from-pos": [{ "mask-linear-from": scaleMaskImagePosition() }], "mask-image-linear-to-pos": [{ "mask-linear-to": scaleMaskImagePosition() }], "mask-image-linear-from-color": [{ "mask-linear-from": scaleColor() }], "mask-image-linear-to-color": [{ "mask-linear-to": scaleColor() }], "mask-image-t-from-pos": [{ "mask-t-from": scaleMaskImagePosition() }], "mask-image-t-to-pos": [{ "mask-t-to": scaleMaskImagePosition() }], "mask-image-t-from-color": [{ "mask-t-from": scaleColor() }], "mask-image-t-to-color": [{ "mask-t-to": scaleColor() }], "mask-image-r-from-pos": [{ "mask-r-from": scaleMaskImagePosition() }], "mask-image-r-to-pos": [{ "mask-r-to": scaleMaskImagePosition() }], "mask-image-r-from-color": [{ "mask-r-from": scaleColor() }], "mask-image-r-to-color": [{ "mask-r-to": scaleColor() }], "mask-image-b-from-pos": [{ "mask-b-from": scaleMaskImagePosition() }], "mask-image-b-to-pos": [{ "mask-b-to": scaleMaskImagePosition() }], "mask-image-b-from-color": [{ "mask-b-from": scaleColor() }], "mask-image-b-to-color": [{ "mask-b-to": scaleColor() }], "mask-image-l-from-pos": [{ "mask-l-from": scaleMaskImagePosition() }], "mask-image-l-to-pos": [{ "mask-l-to": scaleMaskImagePosition() }], "mask-image-l-from-color": [{ "mask-l-from": scaleColor() }], "mask-image-l-to-color": [{ "mask-l-to": scaleColor() }], "mask-image-x-from-pos": [{ "mask-x-from": scaleMaskImagePosition() }], "mask-image-x-to-pos": [{ "mask-x-to": scaleMaskImagePosition() }], "mask-image-x-from-color": [{ "mask-x-from": scaleColor() }], "mask-image-x-to-color": [{ "mask-x-to": scaleColor() }], "mask-image-y-from-pos": [{ "mask-y-from": scaleMaskImagePosition() }], "mask-image-y-to-pos": [{ "mask-y-to": scaleMaskImagePosition() }], "mask-image-y-from-color": [{ "mask-y-from": scaleColor() }], "mask-image-y-to-color": [{ "mask-y-to": scaleColor() }], "mask-image-radial": [{ "mask-radial": [isArbitraryVariable, isArbitraryValue] }], "mask-image-radial-from-pos": [{ "mask-radial-from": scaleMaskImagePosition() }], "mask-image-radial-to-pos": [{ "mask-radial-to": scaleMaskImagePosition() }], "mask-image-radial-from-color": [{ "mask-radial-from": scaleColor() }], "mask-image-radial-to-color": [{ "mask-radial-to": scaleColor() }], "mask-image-radial-shape": [{ "mask-radial": ["circle", "ellipse"] }], "mask-image-radial-size": [ { "mask-radial": [{ closest: ["side", "corner"], farthest: ["side", "corner"] }] } ], "mask-image-radial-pos": [{ "mask-radial-at": scalePosition() }], "mask-image-conic-pos": [{ "mask-conic": [isNumber] }], "mask-image-conic-from-pos": [{ "mask-conic-from": scaleMaskImagePosition() }], "mask-image-conic-to-pos": [{ "mask-conic-to": scaleMaskImagePosition() }], "mask-image-conic-from-color": [{ "mask-conic-from": scaleColor() }], "mask-image-conic-to-color": [{ "mask-conic-to": scaleColor() }], "mask-mode": [{ mask: ["alpha", "luminance", "match"] }], "mask-origin": [{ "mask-origin": ["border", "padding", "content", "fill", "stroke", "view"] }], "mask-position": [{ mask: scaleBgPosition() }], "mask-repeat": [{ mask: scaleBgRepeat() }], "mask-size": [{ mask: scaleBgSize() }], "mask-type": [{ "mask-type": ["alpha", "luminance"] }], "mask-image": [{ mask: ["none", isArbitraryVariable, isArbitraryValue] }], filter: [ { filter: [ "", "none", isArbitraryVariable, isArbitraryValue ] } ], blur: [{ blur: scaleBlur() }], brightness: [{ brightness: [isNumber, isArbitraryVariable, isArbitraryValue] }], contrast: [{ contrast: [isNumber, isArbitraryVariable, isArbitraryValue] }], "drop-shadow": [ { "drop-shadow": [ "", "none", themeDropShadow, isArbitraryVariableShadow, isArbitraryShadow ] } ], "drop-shadow-color": [{ "drop-shadow": scaleColor() }], grayscale: [{ grayscale: ["", isNumber, isArbitraryVariable, isArbitraryValue] }], "hue-rotate": [{ "hue-rotate": [isNumber, isArbitraryVariable, isArbitraryValue] }], invert: [{ invert: ["", isNumber, isArbitraryVariable, isArbitraryValue] }], saturate: [{ saturate: [isNumber, isArbitraryVariable, isArbitraryValue] }], sepia: [{ sepia: ["", isNumber, isArbitraryVariable, isArbitraryValue] }], "backdrop-filter": [ { "backdrop-filter": [ "", "none", isArbitraryVariable, isArbitraryValue ] } ], "backdrop-blur": [{ "backdrop-blur": scaleBlur() }], "backdrop-brightness": [ { "backdrop-brightness": [isNumber, isArbitraryVariable, isArbitraryValue] } ], "backdrop-contrast": [ { "backdrop-contrast": [isNumber, isArbitraryVariable, isArbitraryValue] } ], "backdrop-grayscale": [ { "backdrop-grayscale": ["", isNumber, isArbitraryVariable, isArbitraryValue] } ], "backdrop-hue-rotate": [ { "backdrop-hue-rotate": [isNumber, isArbitraryVariable, isArbitraryValue] } ], "backdrop-invert": [ { "backdrop-invert": ["", isNumber, isArbitraryVariable, isArbitraryValue] } ], "backdrop-opacity": [{ "backdrop-opacity": [isNumber, isArbitraryVariable, isArbitraryValue] }], "backdrop-saturate": [ { "backdrop-saturate": [isNumber, isArbitraryVariable, isArbitraryValue] } ], "backdrop-sepia": [{ "backdrop-sepia": ["", isNumber, isArbitraryVariable, isArbitraryValue] }], "border-collapse": [{ border: ["collapse", "separate"] }], "border-spacing": [{ "border-spacing": scaleUnambiguousSpacing() }], "border-spacing-x": [{ "border-spacing-x": scaleUnambiguousSpacing() }], "border-spacing-y": [{ "border-spacing-y": scaleUnambiguousSpacing() }], "table-layout": [{ table: ["auto", "fixed"] }], caption: [{ caption: ["top", "bottom"] }], transition: [ { transition: [ "", "all", "colors", "opacity", "shadow", "transform", "none", isArbitraryVariable, isArbitraryValue ] } ], "transition-behavior": [{ transition: ["normal", "discrete"] }], duration: [{ duration: [isNumber, "initial", isArbitraryVariable, isArbitraryValue] }], ease: [{ ease: ["linear", "initial", themeEase, isArbitraryVariable, isArbitraryValue] }], delay: [{ delay: [isNumber, isArbitraryVariable, isArbitraryValue] }], animate: [{ animate: ["none", themeAnimate, isArbitraryVariable, isArbitraryValue] }], backface: [{ backface: ["hidden", "visible"] }], perspective: [{ perspective: [themePerspective, isArbitraryVariable, isArbitraryValue] }], "perspective-origin": [{ "perspective-origin": scalePositionWithArbitrary() }], rotate: [{ rotate: scaleRotate() }], "rotate-x": [{ "rotate-x": scaleRotate() }], "rotate-y": [{ "rotate-y": scaleRotate() }], "rotate-z": [{ "rotate-z": scaleRotate() }], scale: [{ scale: scaleScale() }], "scale-x": [{ "scale-x": scaleScale() }], "scale-y": [{ "scale-y": scaleScale() }], "scale-z": [{ "scale-z": scaleScale() }], "scale-3d": ["scale-3d"], skew: [{ skew: scaleSkew() }], "skew-x": [{ "skew-x": scaleSkew() }], "skew-y": [{ "skew-y": scaleSkew() }], transform: [{ transform: [isArbitraryVariable, isArbitraryValue, "", "none", "gpu", "cpu"] }], "transform-origin": [{ origin: scalePositionWithArbitrary() }], "transform-style": [{ transform: ["3d", "flat"] }], translate: [{ translate: scaleTranslate() }], "translate-x": [{ "translate-x": scaleTranslate() }], "translate-y": [{ "translate-y": scaleTranslate() }], "translate-z": [{ "translate-z": scaleTranslate() }], "translate-none": ["translate-none"], zoom: [{ zoom: [isInteger, isArbitraryVariable, isArbitraryValue] }], accent: [{ accent: scaleColor() }], appearance: [{ appearance: ["none", "auto"] }], "caret-color": [{ caret: scaleColor() }], "color-scheme": [ { scheme: ["normal", "dark", "light", "light-dark", "only-dark", "only-light"] } ], cursor: [ { cursor: [ "auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", isArbitraryVariable, isArbitraryValue ] } ], "field-sizing": [{ "field-sizing": ["fixed", "content"] }], "pointer-events": [{ "pointer-events": ["auto", "none"] }], resize: [{ resize: ["none", "", "y", "x"] }], "scroll-behavior": [{ scroll: ["auto", "smooth"] }], "scrollbar-thumb-color": [{ "scrollbar-thumb": scaleColor() }], "scrollbar-track-color": [{ "scrollbar-track": scaleColor() }], "scrollbar-gutter": [{ "scrollbar-gutter": ["auto", "stable", "both"] }], "scrollbar-w": [{ scrollbar: ["auto", "thin", "none"] }], "scroll-m": [{ "scroll-m": scaleUnambiguousSpacing() }], "scroll-mx": [{ "scroll-mx": scaleUnambiguousSpacing() }], "scroll-my": [{ "scroll-my": scaleUnambiguousSpacing() }], "scroll-ms": [{ "scroll-ms": scaleUnambiguousSpacing() }], "scroll-me": [{ "scroll-me": scaleUnambiguousSpacing() }], "scroll-mbs": [{ "scroll-mbs": scaleUnambiguousSpacing() }], "scroll-mbe": [{ "scroll-mbe": scaleUnambiguousSpacing() }], "scroll-mt": [{ "scroll-mt": scaleUnambiguousSpacing() }], "scroll-mr": [{ "scroll-mr": scaleUnambiguousSpacing() }], "scroll-mb": [{ "scroll-mb": scaleUnambiguousSpacing() }], "scroll-ml": [{ "scroll-ml": scaleUnambiguousSpacing() }], "scroll-p": [{ "scroll-p": scaleUnambiguousSpacing() }], "scroll-px": [{ "scroll-px": scaleUnambiguousSpacing() }], "scroll-py": [{ "scroll-py": scaleUnambiguousSpacing() }], "scroll-ps": [{ "scroll-ps": scaleUnambiguousSpacing() }], "scroll-pe": [{ "scroll-pe": scaleUnambiguousSpacing() }], "scroll-pbs": [{ "scroll-pbs": scaleUnambiguousSpacing() }], "scroll-pbe": [{ "scroll-pbe": scaleUnambiguousSpacing() }], "scroll-pt": [{ "scroll-pt": scaleUnambiguousSpacing() }], "scroll-pr": [{ "scroll-pr": scaleUnambiguousSpacing() }], "scroll-pb": [{ "scroll-pb": scaleUnambiguousSpacing() }], "scroll-pl": [{ "scroll-pl": scaleUnambiguousSpacing() }], "snap-align": [{ snap: ["start", "end", "center", "align-none"] }], "snap-stop": [{ snap: ["normal", "always"] }], "snap-type": [{ snap: ["none", "x", "y", "both"] }], "snap-strictness": [{ snap: ["mandatory", "proximity"] }], touch: [{ touch: ["auto", "none", "manipulation"] }], "touch-x": [{ "touch-pan": ["x", "left", "right"] }], "touch-y": [{ "touch-pan": ["y", "up", "down"] }], "touch-pz": ["touch-pinch-zoom"], select: [{ select: ["none", "text", "all", "auto"] }], "will-change": [ { "will-change": [ "auto", "scroll", "contents", "transform", isArbitraryVariable, isArbitraryValue ] } ], fill: [{ fill: ["none", ...scaleColor()] }], "stroke-w": [ { stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber] } ], stroke: [{ stroke: ["none", ...scaleColor()] }], "forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }] }, conflictingClassGroups: { "container-named": ["container-type"], overflow: ["overflow-x", "overflow-y"], overscroll: ["overscroll-x", "overscroll-y"], inset: [ "inset-x", "inset-y", "inset-bs", "inset-be", "start", "end", "top", "right", "bottom", "left" ], "inset-x": ["right", "left"], "inset-y": ["top", "bottom"], flex: ["basis", "grow", "shrink"], gap: ["gap-x", "gap-y"], p: ["px", "py", "ps", "pe", "pbs", "pbe", "pt", "pr", "pb", "pl"], px: ["pr", "pl"], py: ["pt", "pb"], m: ["mx", "my", "ms", "me", "mbs", "mbe", "mt", "mr", "mb", "ml"], mx: ["mr", "ml"], my: ["mt", "mb"], size: ["w", "h"], "font-size": ["leading"], "fvn-normal": [ "fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction" ], "fvn-ordinal": ["fvn-normal"], "fvn-slashed-zero": ["fvn-normal"], "fvn-figure": ["fvn-normal"], "fvn-spacing": ["fvn-normal"], "fvn-fraction": ["fvn-normal"], "line-clamp": ["display", "overflow"], rounded: [ "rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl" ], "rounded-s": ["rounded-ss", "rounded-es"], "rounded-e": ["rounded-se", "rounded-ee"], "rounded-t": ["rounded-tl", "rounded-tr"], "rounded-r": ["rounded-tr", "rounded-br"], "rounded-b": ["rounded-br", "rounded-bl"], "rounded-l": ["rounded-tl", "rounded-bl"], "border-spacing": ["border-spacing-x", "border-spacing-y"], "border-w": [ "border-w-x", "border-w-y", "border-w-s", "border-w-e", "border-w-bs", "border-w-be", "border-w-t", "border-w-r", "border-w-b", "border-w-l" ], "border-w-x": ["border-w-r", "border-w-l"], "border-w-y": ["border-w-t", "border-w-b"], "border-color": [ "border-color-x", "border-color-y", "border-color-s", "border-color-e", "border-color-bs", "border-color-be", "border-color-t", "border-color-r", "border-color-b", "border-color-l" ], "border-color-x": ["border-color-r", "border-color-l"], "border-color-y": ["border-color-t", "border-color-b"], translate: ["translate-x", "translate-y", "translate-none"], "translate-none": ["translate", "translate-x", "translate-y", "translate-z"], "scroll-m": [ "scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mbs", "scroll-mbe", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml" ], "scroll-mx": ["scroll-mr", "scroll-ml"], "scroll-my": ["scroll-mt", "scroll-mb"], "scroll-p": [ "scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pbs", "scroll-pbe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl" ], "scroll-px": ["scroll-pr", "scroll-pl"], "scroll-py": ["scroll-pt", "scroll-pb"], touch: ["touch-x", "touch-y", "touch-pz"], "touch-x": ["touch"], "touch-y": ["touch"], "touch-pz": ["touch"] }, conflictingClassGroupModifiers: { "font-size": ["leading"] }, postfixLookupClassGroups: ["container-type"], orderSensitiveModifiers: [ "*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection" ] }; }; var mergeConfigs = (baseConfig, { extend = {}, override = {} }) => { overrideConfigProperties(baseConfig.theme, override.theme); overrideConfigProperties(baseConfig.classGroups, override.classGroups); overrideConfigProperties(baseConfig.conflictingClassGroups, override.conflictingClassGroups); overrideConfigProperties( baseConfig.conflictingClassGroupModifiers, override.conflictingClassGroupModifiers ); overrideProperty(baseConfig, "postfixLookupClassGroups", override.postfixLookupClassGroups); overrideProperty(baseConfig, "orderSensitiveModifiers", override.orderSensitiveModifiers); mergeConfigProperties(baseConfig.theme, extend.theme); mergeConfigProperties(baseConfig.classGroups, extend.classGroups); mergeConfigProperties(baseConfig.conflictingClassGroups, extend.conflictingClassGroups); mergeConfigProperties( baseConfig.conflictingClassGroupModifiers, extend.conflictingClassGroupModifiers ); mergeArrayProperties(baseConfig, extend, "postfixLookupClassGroups"); mergeArrayProperties(baseConfig, extend, "orderSensitiveModifiers"); return baseConfig; }; var overrideProperty = (baseObject, overrideKey, overrideValue) => { if (overrideValue !== void 0) { baseObject[overrideKey] = overrideValue; } }; var overrideConfigProperties = (baseObject, overrideObject) => { if (overrideObject) { for (const key in overrideObject) { overrideProperty(baseObject, key, overrideObject[key]); } } }; var mergeConfigProperties = (baseObject, mergeObject) => { if (mergeObject) { for (const key in mergeObject) { mergeArrayProperties(baseObject, mergeObject, key); } } }; var mergeArrayProperties = (baseObject, mergeObject, key) => { const mergeValue = mergeObject[key]; if (mergeValue !== void 0) { baseObject[key] = baseObject[key] ? baseObject[key].concat(mergeValue) : mergeValue; } }; var createMerger = (config2) => { if (!config2) { return createTailwindMerge(getDefaultConfig); } const createConfig = typeof config2 === "function" ? () => config2(getDefaultConfig()) : () => mergeConfigs(getDefaultConfig(), config2); return createTailwindMerge(createConfig); }; var toMergerConfig = (config2) => { var _a2; if (isEmptyObject(config2)) return void 0; const source = config2; const extend = { ...(_a2 = source.extend) != null ? _a2 : {} }; for (const key of [ "theme", "classGroups", "conflictingClassGroups", "conflictingClassGroupModifiers", "postfixLookupClassGroups", "orderSensitiveModifiers", "cacheSize", "prefix", "separator", "experimentalParseClassName" ]) { if (source[key] !== void 0 && extend[key] === void 0) { extend[key] = source[key]; } } const result = {}; if (Object.keys(extend).length > 0) { result.extend = extend; } if (source.override != null && !isEmptyObject(source.override)) { result.override = source.override; } if (!result.extend && !result.override) return void 0; return result; }; var createTwMerge = (cachedTwMergeConfig) => { const extension = toMergerConfig(cachedTwMergeConfig); const merger = createMerger(extension); return (classList) => merger.mergeString(classList); }; var defaultMerger; var getDefaultMerger = () => { if (!defaultMerger) defaultMerger = createMerger(); return defaultMerger; }; var ensureConfiguredMerger = () => { if (!state$1.cachedTwMerge || state$1.didTwMergeConfigChange) { state$1.didTwMergeConfigChange = false; state$1.cachedTwMerge = createTwMerge(state$1.cachedTwMergeConfig); } return state$1.cachedTwMerge; }; var syncTwMergeConfig = (config2) => { const next = config2 == null ? void 0 : config2.twMergeConfig; if (!next || isEmptyObject(next)) return; if (!isEqual(next, state$1.cachedTwMergeConfig)) { state$1.cachedTwMergeConfig = next; state$1.didTwMergeConfigChange = true; } }; var joinArgs = (classnames) => joinClassValue(classnames); var IS_V8 = (() => { const error = new Error(); return !("line" in error) && !("lineNumber" in error); })(); var ARG_CACHE_BUCKET_SIZE = 64; var ARG_CACHE_SIZE = 500; var argCache = new Map(); var previousArgCache = new Map(); var argCacheCount = 0; var clearArgCache = () => { argCache = new Map(); previousArgCache = new Map(); argCacheCount = 0; }; var mergeStringDefault = (joined) => { if (!joined) return void 0; if (joined.indexOf(" ") === -1) return joined; return getDefaultMerger().mergeString(joined) || void 0; }; var storeArgCache = (firstKey, rest, result) => { let target = argCache.get(firstKey); if (target === void 0) { target = []; argCache.set(firstKey, target); } if (target.length >= ARG_CACHE_BUCKET_SIZE) target.shift(); target.push({ rest, result }); if (++argCacheCount > ARG_CACHE_SIZE) { argCacheCount = 0; previousArgCache = argCache; argCache = new Map(); } }; var lookupArgCache = (firstKey, firstKeyIndex, truthyStringCount, length, getItem) => { let bucket = argCache.get(firstKey); if (bucket === void 0) bucket = previousArgCache.get(firstKey); if (bucket === void 0) return void 0; for (let entryIndex = 0; entryIndex < bucket.length; entryIndex++) { const entry = bucket[entryIndex]; const rest = entry.rest; if (rest.length !== truthyStringCount - 1) continue; let restIndex = 0; let isMatch = true; for (let index = firstKeyIndex + 1; index < length; index++) { const item = getItem(index); if (!item) continue; if (item !== rest[restIndex++]) { isMatch = false; break; } } if (isMatch) return entry.result; } return void 0; }; var mergeVariadicCached = (inputs) => { var _a2; const length = inputs.length; let firstKey = ""; let firstKeyIndex = -1; let truthyStringCount = 0; let everyTruthyIsString = true; for (let index = 0; index < length; index++) { const item = inputs[index]; if (!item) continue; if (typeof item !== "string") { everyTruthyIsString = false; break; } if (firstKeyIndex === -1) { firstKey = item; firstKeyIndex = index; } truthyStringCount++; } if (!everyTruthyIsString) { return mergeStringDefault(joinArgs(inputs)); } if (truthyStringCount === 0) return void 0; if (truthyStringCount === 1) return mergeStringDefault(firstKey); const cached = lookupArgCache( firstKey, firstKeyIndex, truthyStringCount, length, (index) => inputs[index] ); if (cached !== void 0) return cached || void 0; let joined = firstKey; const rest = []; for (let index = firstKeyIndex + 1; index < length; index++) { const item = inputs[index]; if (!item) continue; joined += " " + item; rest.push(item); } const result = (_a2 = mergeStringDefault(joined)) != null ? _a2 : ""; storeArgCache(firstKey, rest, result); return result || void 0; }; var originalStateReset = state$1.reset.bind(state$1); state$1.reset = () => { defaultMerger = void 0; clearArgCache(); originalStateReset(); }; var executeMerge = (classnames, config2) => { var _a2; const base = joinArgs(classnames); if (!base || !((_a2 = config2 == null ? void 0 : config2.twMerge) != null ? _a2 : true)) return base || void 0; if (base.indexOf(" ") === -1) return base; syncTwMergeConfig(config2); const hasCustomConfig = Boolean((config2 == null ? void 0 : config2.twMergeConfig) && !isEmptyObject(config2.twMergeConfig)); const merge = hasCustomConfig ? ensureConfiguredMerger() : getDefaultMerger().mergeString; return merge(base) || void 0; }; var isDefaultMergeConfig = (config2) => { if (config2 == null) return true; if (config2.twMerge === false) return false; if (config2.twMergeConfig && !isEmptyObject(config2.twMergeConfig)) return false; return true; }; var cnAdapter = (config2, ...classnames) => executeMerge(classnames, config2); var cnMerge = (...classnames) => { return (config2) => { if (isDefaultMergeConfig(config2)) { if (IS_V8) return mergeVariadicCached(classnames); return mergeStringDefault(joinArgs(classnames)); } return executeMerge(classnames, config2); }; }; var runtime = getTailwindVariants(cnAdapter); var createTV = runtime.createTV; const appConfigTv = appConfig; const config = (_a = appConfigTv.ui) == null ? void 0 : _a.tv; const baseTv = createTV(config); function findReplacer(value) { if (typeof value === "function") { return value; } if (Array.isArray(value)) { for (let i = value.length - 1; i >= 0; i--) { const replacer = findReplacer(value[i]); if (replacer) { return replacer; } } } return void 0; } function plainClasses(value) { if (Array.isArray(value)) { return value.flatMap((item) => plainClasses(item)); } if (typeof value === "function") { return []; } return [value]; } function applyReplacer(replacer, slotProps, resolveDefaults) { var _a2; return (_a2 = cnMerge(replacer(resolveDefaults()), ...plainClasses(slotProps.class), ...plainClasses(slotProps.className))(config)) != null ? _a2 : ""; } function isMemoizable(value, depth = 0) { if (value === void 0 || value === null) { return true; } const type = typeof value; if (type === "string" || type === "boolean") { return true; } if (type === "number") { return Number.isFinite(value); } if (Array.isArray(value)) { if (depth >= 4) { return false; } for (const item of value) { if (!isMemoizable(item, depth + 1)) { return false; } } return true; } return false; } function memoKey(slotProps) { const proto = Object.getPrototypeOf(slotProps); if (proto !== Object.prototype && proto !== null) { return void 0; } for (const key of Object.keys(slotProps)) { if (!isMemoizable(slotProps[key])) { return void 0; } } return JSON.stringify(slotProps); } function wrapSlots(slots) { const memo2 = new Map(); return new Proxy(slots, { get(target, key) { const slot = target[key]; if (typeof slot !== "function") { return slot; } return (slotProps = {}) => { var _a2; const replacer = (_a2 = findReplacer(slotProps.class)) != null ? _a2 : findReplacer(slotProps.className); if (!replacer) { const cacheKey = memoKey(slotProps); if (cacheKey === void 0) { return slot(slotProps); } let cache = memo2.get(key); if (!cache) { cache = new Map(); memo2.set(key, cache); } let result = cache.get(cacheKey); if (result === void 0 && !cache.has(cacheKey)) { if (cache.size >= 500) { cache.clear(); } result = slot(slotProps); cache.set(cacheKey, result); } return result; } return applyReplacer(replacer, slotProps, () => slot({ ...slotProps, class: void 0, className: void 0 })); }; } }); } function defaultClasses(value) { var _a2; return (_a2 = cnMerge(value)(config)) != null ? _a2 : ""; } function resolveReplacers(componentConfig) { var _a2, _b, _c, _d, _e2; if (!componentConfig || typeof componentConfig !== "object") { return componentConfig; } const slots = componentConfig.slots; const replacers = slots && typeof slots === "object" ? Object.entries(slots).filter((entry) => typeof entry[1] === "function") : []; const baseReplacer = typeof componentConfig.base === "function" ? componentConfig.base : void 0; if (!replacers.length && !baseReplacer) { return componentConfig; } const extend = componentConfig.extend; const resolved = { ...componentConfig }; let extendSlots; let blankExtendBase = false; if (baseReplacer) { resolved.base = baseReplacer(defaultClasses((_b = (_a2 = extend == null ? void 0 : extend.slots) == null ? void 0 : _a2.base) != null ? _b : extend == null ? void 0 : extend.base)); if ((_c = extend == null ? void 0 : extend.slots) == null ? void 0 : _c.base) { extendSlots != null ? extendSlots : extendSlots = { ...extend.slots }; extendSlots.base = ""; } if (extend == null ? void 0 : extend.base) { blankExtendBase = true; } } if (replacers.length) { const cleaned = { ...slots }; for (const [slot, replacer] of replacers) { cleaned[slot] = replacer(defaultClasses((_d = extend == null ? void 0 : extend.slots) == null ? void 0 : _d[slot])); if ((_e2 = extend == null ? void 0 : extend.slots) == null ? void 0 : _e2[slot]) { extendSlots != null ? extendSlots : extendSlots = { ...extend.slots }; extendSlots[slot] = ""; } } resolved.slots = cleaned; } if (extendSlots || blankExtendBase) { const cleanedExtend = { ...extend }; if (extendSlots) { cleanedExtend.slots = extendSlots; } if (blankExtendBase) { cleanedExtend.base = ""; } resolved.extend = cleanedExtend; } return resolved; } const tv = ((componentConfig) => { const component = baseTv(resolveReplacers(componentConfig)); return new Proxy(component, { apply(target, thisArg, args) { var _a2, _b; const result = Reflect.apply(target, thisArg, args); if (result && typeof result === "object") { return wrapSlots(result); } if (typeof result === "string") { const slotProps = (_a2 = args[0]) != null ? _a2 : {}; const replacer = (_b = findReplacer(slotProps.class)) != null ? _b : findReplacer(slotProps.className); if (replacer) { return applyReplacer(replacer, slotProps, () => Reflect.apply(target, thisArg, [{ ...slotProps, class: void 0, className: void 0 }])); } } return result; } }); }); const theme$o = { "slots": { "viewport": "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-(--height) focus:outline-none", "base": "pointer-events-auto absolute inset-x-0 z-(--index) transform-(--transform) data-[collapsed=true]:data-[front=false]:h-(--front-height) data-[collapsed=true]:data-[front=false]:*:opacity-0 data-[front=false]:*:transition-opacity data-[front=false]:*:duration-100 data-[state=closed]:animate-[toast-closed_200ms_var(--ease-out)] data-[state=closed]:data-[collapsed=true]:data-[front=false]:animate-[toast-collapsed-closed_200ms_var(--ease-out)] motion-safe:data-[state=open]:data-[pulsing=odd]:animate-[toast-pulse-a_200ms_var(--ease-out)] motion-safe:data-[state=open]:data-[pulsing=even]:animate-[toast-pulse-b_200ms_var(--ease-out)] data-[swipe=move]:transition-none transition-[transform,translate,height] duration-200 ease-out motion-reduce:transition-none" }, "variants": { "position": { "top-left": { "viewport": "left-4" }, "top-center": { "viewport": "left-1/2 transform -translate-x-1/2" }, "top-right": { "viewport": "right-4" }, "bottom-left": { "viewport": "left-4" }, "bottom-center": { "viewport": "left-1/2 transform -translate-x-1/2" }, "bottom-right": { "viewport": "right-4" } }, "swipeDirection": { "up": "data-[swipe=end]:animate-[toast-slide-up_200ms_var(--ease-out)]", "right": "data-[swipe=end]:animate-[toast-slide-right_200ms_var(--ease-out)]", "down": "data-[swipe=end]:animate-[toast-slide-down_200ms_var(--ease-out)]", "left": "data-[swipe=end]:animate-[toast-slide-left_200ms_var(--ease-out)]" } }, "compoundVariants": [ { "position": [ "top-left", "top-center", "top-right" ], "class": { "viewport": "top-4", "base": "top-0 data-[state=open]:animate-[toast-slide-in-from-top_200ms_var(--ease-out)]" } }, { "position": [ "bottom-left", "bottom-center", "bottom-right" ], "class": { "viewport": "bottom-4", "base": "bottom-0 data-[state=open]:animate-[toast-slide-in-from-bottom_200ms_var(--ease-out)]" } }, { "swipeDirection": [ "left", "right" ], "class": "data-[swipe=move]:translate-x-(--reka-toast-swipe-move-x) data-[swipe=end]:translate-x-(--reka-toast-swipe-end-x) data-[swipe=cancel]:translate-x-0" }, { "swipeDirection": [ "up", "down" ], "class": "data-[swipe=move]:translate-y-(--reka-toast-swipe-move-y) data-[swipe=end]:translate-y-(--reka-toast-swipe-end-y) data-[swipe=cancel]:translate-y-0" } ], "defaultVariants": { "position": "bottom-right" } }; const __default__$1 = { name: "Toaster" }; const _sfc_main$O = Object.assign(__default__$1, { inheritAttrs: false }, { props: { position: { type: null, required: false }, expand: { type: Boolean, required: false, default: true }, progress: { type: Boolean, required: false, default: true }, portal: { type: [Boolean, String], required: false, skipCheck: true, default: true }, max: { type: Number, required: false, default: 5 }, class: { type: null, required: false }, ui: { type: Object, required: false }, label: { type: String, required: false }, duration: { type: Number, required: false, default: 5e3 }, disableSwipe: { type: Boolean, required: false }, swipeThreshold: { type: Number, required: false } }, setup(__props) { const _props = __props; const props = useComponentProps("toaster", _props); const loadToast = () => __vitePreload(() => Promise.resolve().then(() => Toast), void 0 ); const UToast = vue.defineAsyncComponent(loadToast); let idleId; vue.onMounted(() => { idleId = requestIdleCallback(() => { loadToast().catch(() => { }); }); }); vue.onBeforeUnmount(() => { cancelIdleCallback(idleId); }); const { toasts, remove: remove2 } = useToast(); const { t } = useLocale$1(); const appConfig2 = useAppConfig(); vue.provide(toastMaxInjectionKey, vue.toRef(() => props.max)); const providerProps = useForwardProps(reactivePick(props, "duration", "swipeThreshold", "disableSwipe")); const portalProps = usePortal(vue.toRef(() => props.portal)); const swipeDirection = vue.computed(() => { switch (props.position) { case "top-center": return "up"; case "top-right": case "bottom-right": return "right"; case "bottom-center": return "down"; case "top-left": case "bottom-left": return "left"; } return "right"; }); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$o, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.toaster) || {} })({ position: props.position, swipeDirection: swipeDirection.value }); }); function onUpdateOpen(value, id) { if (value) { return; } remove2(id); } const hovered = vue.ref(false); const expanded = vue.computed(() => props.expand || hovered.value); const refs = vue.ref([]); const height = vue.computed(() => refs.value.reduce((acc, { height: height2 }) => acc + height2 + 16, 0)); const frontHeight = vue.computed(() => { var _a2; return ((_a2 = refs.value[refs.value.length - 1]) == null ? void 0 : _a2.height) || 0; }); function getOffset(index) { return refs.value.slice(index + 1).reduce((acc, { height: height2 }) => acc + height2 + 16, 0); } return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(ToastProvider_default), vue.mergeProps({ "swipe-direction": swipeDirection.value, label: (_a2 = vue.unref(props).label) != null ? _a2 : vue.unref(t)("toaster.label") }, vue.unref(providerProps)), { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default"), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(toasts), (toast2, index) => { var _a3; return vue.openBlock(), vue.createBlock(vue.unref(UToast), vue.mergeProps({ key: toast2.id, ref_for: true, ref_key: "refs", ref: refs, progress: vue.unref(props).progress }, { ref_for: true }, vue.unref(omit)(toast2, ["id", "close", "_duplicate", "_updated", "_animatedAt", "onClick"]), { close: toast2.close, "data-collapsed": !expanded.value, "data-front": !expanded.value && index === vue.unref(toasts).length - 1, "data-pulsing": toast2._duplicate ? toast2._duplicate % 2 === 0 ? "even" : "odd" : void 0, style: { "--index": index - vue.unref(toasts).length + vue.unref(toasts).length, "--before": vue.unref(toasts).length - 1 - index, "--offset": getOffset(index), "--scale": expanded.value ? "1" : "calc(1 - var(--before) * var(--scale-factor))", "--translate": expanded.value ? "calc(var(--offset) * var(--translate-factor))" : "calc(var(--before) * var(--gap))", "--transform": "translateY(var(--translate)) scale(var(--scale))" }, "data-slot": "base", class: ui2.value.base({ class: [(_a3 = vue.unref(props).ui) == null ? void 0 : _a3.base, toast2.onClick ? "cursor-pointer" : void 0] }), "onUpdate:open": ($event) => onUpdateOpen($event, toast2.id), onClick: ($event) => toast2.onClick && toast2.onClick(toast2) }), null, 16, ["progress", "close", "data-collapsed", "data-front", "data-pulsing", "style", "class", "onUpdate:open", "onClick"]); }), 128)), vue.createVNode(vue.unref(ToastPortal_default), vue.normalizeProps(vue.guardReactiveProps(vue.unref(portalProps))), { default: vue.withCtx(() => { var _a3, _b, _c; return [ vue.createVNode(vue.unref(ToastViewport_default), { label: vue.unref(t)("toaster.viewport"), "data-expanded": expanded.value, "data-slot": "viewport", class: vue.normalizeClass(ui2.value.viewport({ class: [(_a3 = vue.unref(props).ui) == null ? void 0 : _a3.viewport, vue.unref(props).class] })), style: vue.normalizeStyle({ "--scale-factor": "0.05", "--translate-factor": ((_b = vue.unref(props).position) == null ? void 0 : _b.startsWith("top")) ? "1px" : "-1px", "--gap": ((_c = vue.unref(props).position) == null ? void 0 : _c.startsWith("top")) ? "16px" : "-16px", "--front-height": `${frontHeight.value}px`, "--height": `${height.value}px` }), onMouseenter: _cache[0] || (_cache[0] = ($event) => hovered.value = true), onMouseleave: _cache[1] || (_cache[1] = ($event) => hovered.value = false) }, null, 8, ["label", "data-expanded", "class", "style"]) ]; }), _: 1 }, 16) ]), _: 3 }, 16, ["swipe-direction", "label"]); }; } }); function _useOverlay() { const overlays = vue.shallowReactive([]); const create = (component, _options) => { const { props, defaultOpen, destroyOnClose } = _options || {}; const options = vue.reactive({ id: Symbol(undefined ? "useOverlay" : ""), isOpen: !!defaultOpen, component: vue.markRaw(component), isMounted: !!defaultOpen, destroyOnClose: !!destroyOnClose, originalProps: props || {}, props: { ...props }, resolvers: [] }); overlays.push(options); return { ...options, open: (props2) => open(options.id, props2), close: (value) => close(options.id, value), patch: (props2) => patch(options.id, props2) }; }; const open = (id, props) => { const overlay = getOverlay(id); if (props) { overlay.props = { ...overlay.originalProps, ...props }; } else { overlay.props = { ...overlay.originalProps }; } overlay.isOpen = true; overlay.isMounted = true; const result = new Promise((resolve) => overlay.resolvers.push(resolve)); return Object.assign(result, { id, isMounted: overlay.isMounted, isOpen: overlay.isOpen, result }); }; const close = (id, value) => { const overlay = getOverlay(id); overlay.isOpen = false; for (const resolve of overlay.resolvers.splice(0)) { resolve(value); } }; const closeAll = () => { overlays.forEach((overlay) => close(overlay.id)); }; const unmount = (id) => { const overlay = getOverlay(id); overlay.isMounted = false; if (overlay.destroyOnClose) { const index = overlays.findIndex((overlay2) => overlay2.id === id); overlays.splice(index, 1); } }; const patch = (id, props) => { const overlay = getOverlay(id); overlay.props = { ...overlay.props, ...props }; }; const getOverlay = (id) => { const overlay = overlays.find((overlay2) => overlay2.id === id); if (!overlay) { throw new Error("Overlay not found"); } return overlay; }; const isOpen = (id) => { const overlay = getOverlay(id); return overlay.isOpen; }; return { overlays, open, close, closeAll, create, patch, unmount, isOpen }; } const useOverlay = createSharedComposable(_useOverlay); const _sfc_main$N = { __name: "OverlayProvider", setup(__props) { const { overlays, unmount, close } = useOverlay(); const mountedOverlays = vue.computed(() => overlays.filter((overlay) => overlay.isMounted)); const onAfterLeave = (id) => { close(id); unmount(id); }; const onClose = (id, value) => { close(id, value); }; return (_ctx, _cache) => { return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(mountedOverlays.value, (overlay) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(overlay.component), vue.mergeProps({ key: overlay.id }, { ref_for: true }, overlay.props, { open: overlay.isOpen, "onUpdate:open": ($event) => overlay.isOpen = $event, onClose: (value) => onClose(overlay.id, value), "onAfter:leave": ($event) => onAfterLeave(overlay.id) }), null, 16, ["open", "onUpdate:open", "onClose", "onAfter:leave"]); }), 128); }; } }; const __default__ = { name: "App" }; const _sfc_main$M = Object.assign(__default__, { props: { tooltip: { type: Object, required: false }, toaster: { type: [Object, null], required: false }, locale: { type: Object, required: false }, portal: { type: [Boolean, String], required: false, skipCheck: true, default: "body" }, dir: { type: String, required: false }, scrollBody: { type: [Boolean, Object], required: false }, nonce: { type: String, required: false } }, setup(__props) { const props = __props; const configProviderProps = useForwardProps$1(reactivePick(props, "scrollBody", "nonce")); const tooltipProps = vue.toRef(() => props.tooltip); const toasterProps = vue.toRef(() => props.toaster); const parentLocale = vue.inject(localeContextInjectionKey, void 0); const locale = vue.toRef(() => { const value = props.locale || (parentLocale == null ? void 0 : parentLocale.value); return props.dir ? { ...value || en, dir: props.dir } : value; }); vue.provide(localeContextInjectionKey, locale); const portal = vue.toRef(() => props.portal); vue.provide(portalTargetInjectionKey, portal); return (_ctx, _cache) => { var _a2, _b; return vue.openBlock(), vue.createBlock(vue.unref(ConfigProvider_default), vue.mergeProps({ "use-id": () => vue.useId(), dir: props.dir || ((_a2 = locale.value) == null ? void 0 : _a2.dir), locale: (_b = locale.value) == null ? void 0 : _b.code }, vue.unref(configProviderProps)), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(TooltipProvider_default), vue.normalizeProps(vue.guardReactiveProps(tooltipProps.value)), { default: vue.withCtx(() => [ __props.toaster !== null ? (vue.openBlock(), vue.createBlock(_sfc_main$O, vue.normalizeProps(vue.mergeProps({ key: 0 }, toasterProps.value)), { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16)) : vue.renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1), vue.createVNode(_sfc_main$N) ]), _: 3 }, 16) ]), _: 3 }, 16, ["use-id", "dir", "locale"]); }; } }); const DEFAULT_MAX_DIM = 1600; const DEFAULT_QUALITY = 0.75; function isHeicLike(lowerMime, lowerName) { return lowerMime === "image/heic" || lowerMime === "image/heif" || lowerMime === "image/heic-sequence" || lowerMime === "image/heif-sequence" || /\.(heic|heif)$/.test(lowerName); } function isSvgLike(lowerMime, lowerName) { return lowerMime === "image/svg+xml" || /\.svg$/.test(lowerName); } function isGifLike(lowerMime, lowerName) { return lowerMime === "image/gif" || /\.gif$/.test(lowerName); } function isWebpLike(lowerMime, lowerName) { return lowerMime === "image/webp" || /\.webp$/.test(lowerName); } function decodeToCanvasSource(blob) { const decodeViaImg = () => new Promise((resolve, reject) => { const url = URL.createObjectURL(blob); const img = new Image(); img.onload = () => resolve({ source: img, width: img.naturalWidth, height: img.naturalHeight, release: () => URL.revokeObjectURL(url) }); img.onerror = () => { URL.revokeObjectURL(url); reject(new Error("图片解析失败")); }; img.src = url; }); if (typeof createImageBitmap !== "function") return decodeViaImg(); return createImageBitmap(blob).then((bmp) => ({ source: bmp, width: bmp.width, height: bmp.height, release: () => { if (bmp.close) bmp.close(); } })).catch(() => decodeViaImg()); } async function resizeToJpeg(blob, opt = {}) { const maxDim = opt.maxDim && opt.maxDim > 0 ? opt.maxDim : DEFAULT_MAX_DIM; const quality = typeof opt.quality === "number" ? opt.quality : DEFAULT_QUALITY; let dec = null; try { dec = await decodeToCanvasSource(blob); const w = Number(dec.width) || 0; const h2 = Number(dec.height) || 0; if (!w || !h2) return null; const scale = Math.min(1, maxDim / Math.max(w, h2)); const cw = Math.max(1, Math.round(w * scale)); const ch = Math.max(1, Math.round(h2 * scale)); const cv = document.createElement("canvas"); cv.width = cw; cv.height = ch; const ctx = cv.getContext("2d"); if (!ctx) return null; ctx.fillStyle = "#fff"; ctx.fillRect(0, 0, cw, ch); ctx.drawImage(dec.source, 0, 0, cw, ch); return await new Promise((resolve) => { cv.toBlob((b) => resolve(b || null), "image/jpeg", quality); }); } catch { return null; } finally { if (dec) dec.release(); } } function makeHeicConverter(heic2any2, quality = 0.9) { return (blob) => { if (typeof heic2any2 !== "function") return Promise.reject(new Error("heic2any 未加载")); return Promise.resolve( heic2any2({ blob, toType: "image/jpeg", quality }) ).then((out) => { const b = Array.isArray(out) ? out[0] : out; if (b) return b; throw new Error("heic2any 未产出图片"); }); }; } async function prepareForTransfer(file, opt = {}) { const name = String(file && file.name ? file.name : "image.jpg"); const mime = String(file && file.type || "image/jpeg"); const original = { blob: file, name, mime, compressed: false }; const lowerName = name.toLowerCase(); const lowerMime = mime.toLowerCase(); if ((opt.skipSvg === void 0 ? true : opt.skipSvg) && isSvgLike(lowerMime, lowerName)) return original; if ((opt.skipGif === void 0 ? true : opt.skipGif) && isGifLike(lowerMime, lowerName)) return original; if ((opt.skipWebp === void 0 ? true : opt.skipWebp) && isWebpLike(lowerMime, lowerName)) return original; const heic = isHeicLike(lowerMime, lowerName); let source = file; if (heic) { if (!opt.loadHeic) return original; try { const jpg = await opt.loadHeic(file); if (!jpg) return original; source = jpg; } catch { return original; } } const out = await resizeToJpeg(source, { maxDim: opt.maxDim === void 0 ? DEFAULT_MAX_DIM : opt.maxDim, quality: opt.quality === void 0 ? DEFAULT_QUALITY : opt.quality }); if (!out) return original; if (!heic && out.size >= (file.size || 0)) return original; return { blob: out, name: name.replace(/\.[a-z0-9]+$/i, "") + ".jpg", mime: "image/jpeg", compressed: true }; } const RETRY_BASE_MS = 2e3; const RETRY_MAX_MS = 6e4; function nextRetryDelay(prevMs, httpStatus) { if (httpStatus === 429) return RETRY_MAX_MS; const prev = typeof prevMs === "number" && isFinite(prevMs) && prevMs > 0 ? prevMs : 0; if (!prev) return RETRY_BASE_MS; return Math.min(prev * 2, RETRY_MAX_MS); } const DEVICE_ID_KEY = "znhd_device_id"; const RELAY_MAX_BODY = 100 * 1024 * 1024; function imagePayloadBytes(file, name, mime) { const b64Len = Math.ceil((file && file.size || 0) / 3) * 4; const enc = typeof TextEncoder === "function" ? new TextEncoder() : null; const byteLen = enc ? enc.encode(String(name || "") + String(mime || "")).length : (String(name || "") + String(mime || "")).length; return b64Len + byteLen + 120; } const PHONE_MAX_DIM = DEFAULT_MAX_DIM; const PHONE_JPEG_QUALITY = DEFAULT_QUALITY; function compressImageForPhone(file) { return prepareForTransfer(file, { maxDim: PHONE_MAX_DIM, quality: PHONE_JPEG_QUALITY, loadHeic: (blob) => makeHeicConverter(typeof heic2any === "function" ? heic2any : null)(blob) }); } function getDeviceId() { let id = ""; try { id = typeof GM_getValue === "function" ? GM_getValue(DEVICE_ID_KEY, "") || "" : ""; } catch (e) { id = ""; } if (!id) { try { id = window.crypto && crypto.randomUUID ? crypto.randomUUID() : "d" + Date.now().toString(16) + Math.random().toString(16).slice(2); } catch (e) { id = "d" + Date.now().toString(16) + Math.random().toString(16).slice(2); } try { if (typeof GM_setValue === "function") GM_setValue(DEVICE_ID_KEY, id); } catch (e) { } } return id; } function base64ToBlob(b64, mime) { const bin = atob(b64); const len = bin.length; const arr = new Uint8Array(len); for (let i = 0; i < len; i++) arr[i] = bin.charCodeAt(i); return new Blob([arr], { type: mime }); } function blobToPng(blob) { return new Promise((resolve) => { if (typeof createImageBitmap !== "function" || typeof document === "undefined") { resolve(blob); return; } try { createImageBitmap(blob).then((bmp) => { const cv = document.createElement("canvas"); cv.width = bmp.width; cv.height = bmp.height; const ctx = cv.getContext("2d"); if (!ctx) { if (bmp.close) bmp.close(); resolve(blob); return; } ctx.drawImage(bmp, 0, 0); if (bmp.close) bmp.close(); cv.toBlob((b) => { resolve(b || blob); }, "image/png"); }).catch(() => resolve(blob)); } catch (e) { resolve(blob); } }); } function errTextOf(e) { const err = e; return err && err.name ? err.name + ": " + err.message : String(err && err.message || e); } function toRealmBlob(blob, BlobCtor) { const type = blob && blob.type ? blob.type : "image/png"; try { return BlobCtor ? new BlobCtor([blob], { type }) : blob; } catch (e) { return blob; } } function writeClipboardOnce(realm, pngPromise, preferPromiseForm) { return new Promise((resolve) => { const doWrite = (item) => { try { realm.nav.clipboard.write([item]).then( () => resolve(true), (e) => { addLog("[复制] 写入剪贴板被拒(" + realm.name + "): " + errTextOf(e), "warning", true); resolve(false); } ); } catch (e) { addLog("[复制] 调用 clipboard.write 异常(" + realm.name + "): " + errTextOf(e), "error", true); resolve(false); } }; if (preferPromiseForm) { try { doWrite(new realm.CI({ "image/png": pngPromise })); return; } catch (e) { addLog("[复制] ClipboardItem 不支持 Promise 形式,改为先转换再写入: " + errTextOf(e), "warning", true); } } pngPromise.then((png) => { try { doWrite(new realm.CI({ "image/png": toRealmBlob(png, realm.BlobCtor) })); } catch (e) { addLog("[复制] 构造 ClipboardItem 失败(" + realm.name + "): " + errTextOf(e), "error", true); resolve(false); } }); }); } function copyImageToClipboard(blob) { return new Promise((resolve) => { if (!blob) { addLog("[复制] 图片数据为空", "error", true); resolve(false); return; } const pageWin2 = typeof unsafeWindow !== "undefined" ? unsafeWindow : null; const realms = []; if (pageWin2 && pageWin2.navigator && pageWin2.navigator.clipboard && typeof pageWin2.navigator.clipboard.write === "function" && pageWin2.ClipboardItem) { realms.push({ name: "页面主世界", nav: pageWin2.navigator, CI: pageWin2.ClipboardItem, BlobCtor: pageWin2.Blob, isPageRealm: true }); } if (navigator.clipboard && typeof navigator.clipboard.write === "function" && typeof ClipboardItem !== "undefined") { realms.push({ name: "隔离世界", nav: navigator, CI: ClipboardItem, BlobCtor: Blob, isPageRealm: false }); } if (!realms.length) { addLog("[复制] 当前环境不支持图片剪贴板(缺 clipboard.write 或 ClipboardItem)", "error", true); resolve(false); return; } const pngPromise = (blob.type === "image/png" ? Promise.resolve(blob) : blobToPng(blob)).then( (b) => { if (b && b.type !== "image/png") { addLog("[复制] 图片转 PNG 失败(内核不支持位图解码/Canvas),可能无法写入剪贴板", "warning", true); } return b; } ); (async () => { for (const realm of realms) { const ok = await writeClipboardOnce(realm, pngPromise, realm.isPageRealm); if (ok) { addLog("[复制] 图片已复制到剪贴板(" + realm.name + ")", "success", true); resolve(true); return; } } addLog( "[复制] 图片写入剪贴板失败:常见原因是浏览器/油猴未授予剪贴板权限、页面未获得焦点,或该内核不支持图片剪贴板;可长按图片手动保存", "error", true ); resolve(false); })(); }); } function startPhoneReceive(opt) { const server = (opt.server || "").trim().replace(/\/+$/, ""); const uuid = opt.uuid; let stopped = false; let lastXhr = null; let connected = false; let loggedConnFail = false; let firstPoll = true; let retryDelay = 0; function markConnected() { if (connected) return; connected = true; loggedConnFail = false; if (opt.onConnected) { try { opt.onConnected(); } catch (e) { } } } function poll() { if (stopped) return; if (opt.onStatus) opt.onStatus("正在等待手机上传…"); const maxwait = firstPoll ? 1e3 : 45e3; firstPoll = false; const url = server + "/recv/" + encodeURIComponent(uuid) + "?maxwait=" + maxwait + "&phones=1"; try { lastXhr = GM_xmlhttpRequest({ method: "GET", url, timeout: maxwait + 5e3, onload: function(resp) { if (stopped) return; if (resp.status === 429 || resp.status >= 500) { if (opt.onStatus) opt.onStatus("服务器繁忙,稍后重试…"); retryDelay = nextRetryDelay(retryDelay, resp.status); setTimeout(poll, retryDelay); return; } markConnected(); retryDelay = 0; try { let data = null; try { data = JSON.parse(resp.responseText); } catch (e) { data = null; } if (data && Array.isArray(data.phones)) { if (opt.onPhones) { try { opt.onPhones( data.phones.filter((p) => !!p).map((p) => ({ id: String(p.id || ""), lastSeen: Number(p.lastSeen) || 0 })) ); } catch (e) { } } } if (data && data.type === "phones") { poll(); return; } if (data && data.empty) { poll(); return; } if (data && (data.type === "image" || data.type === "file") && data.data) { const isFile = data.type === "file"; const blob = base64ToBlob( data.data, data.mime || (isFile ? "application/octet-stream" : "image/jpeg") ); const previewUrl = URL.createObjectURL(blob); if (opt.onStatus) opt.onStatus( (isFile ? "收到文件:" : "收到图片:") + (data.name || (isFile ? "file" : "image")) ); if (isFile) { if (opt.onFile) opt.onFile({ blob, previewUrl, name: data.name, mime: data.mime, from: data.from }); } else if (opt.onImage) { opt.onImage({ blob, previewUrl, name: data.name, mime: data.mime, from: data.from }); } poll(); return; } if (data && data.type === "text" && typeof data.text === "string") { if (opt.onStatus) opt.onStatus("收到文本"); if (opt.onText) opt.onText({ text: data.text, ts: data.ts, from: data.from }); poll(); return; } setTimeout(poll, 1e3); } catch (e) { addLog("[设备互联] 处理收到数据失败: " + (e && e.message ? e.message : e), "error", true); setTimeout(poll, 1e3); } }, onerror: function() { if (stopped) return; if (!loggedConnFail) { loggedConnFail = true; addLog("[设备互联] 连接服务器失败,请检查中继地址/网络(" + server + ")", "error"); } if (opt.onStatus) opt.onStatus("连接中断,正在重连…"); retryDelay = nextRetryDelay(retryDelay); setTimeout(poll, retryDelay); }, ontimeout: function() { if (stopped) return; poll(); } }); } catch (e) { if (stopped) return; if (opt.onStatus) opt.onStatus("请求异常,正在重连…"); retryDelay = nextRetryDelay(retryDelay); setTimeout(poll, retryDelay); } } poll(); return function stop() { stopped = true; try { if (lastXhr && typeof lastXhr.abort === "function") lastXhr.abort(); } catch (e) { } }; } function sendToPhone(opt) { const server = (opt.server || "").trim().replace(/\/+$/, ""); const uuid = opt.uuid; const url = server + "/phone/send/" + encodeURIComponent(uuid); try { const body = JSON.stringify(opt.payload); GM_xmlhttpRequest({ method: "POST", url, headers: { "Content-Type": "application/json" }, data: body, ...opt.onUploadProgress ? { upload: { onprogress: function(ev) { if (!ev || !ev.total) return; if (opt.onUploadProgress) opt.onUploadProgress(Math.round(ev.loaded / ev.total * 100)); } } } : {}, timeout: 2e4 + Math.round(body.length / 200), onload: function(resp) { let j = null; try { j = JSON.parse(resp.responseText); } catch (e) { j = null; } if (j && j.ok) { if (opt.onOk) opt.onOk(); } else { let msg = j && j.error ? String(j.error) : ""; if (!msg && resp.status === 413) msg = "内容过大,请压缩后再发送"; else if (!msg && resp.status >= 400) msg = "服务器错误(HTTP " + resp.status + ")"; if (opt.onFail) opt.onFail(msg || "HTTP " + resp.status); } }, onerror: function() { if (opt.onFail) opt.onFail("网络错误,请检查中继地址"); }, ontimeout: function() { if (opt.onFail) opt.onFail("发送超时"); } }); } catch (e) { if (opt.onFail) opt.onFail(e.message); } } const TRANSFER_TTL_MS = 7 * 24 * 60 * 60 * 1e3; const DB_NAME = "znhd-transfer"; const DB_VERSION = 1; const STORE = "sessions"; function openDb() { return new Promise((resolve, reject) => { const req = indexedDB.open(DB_NAME, DB_VERSION); req.onupgradeneeded = () => { const db = req.result; if (!db.objectStoreNames.contains(STORE)) db.createObjectStore(STORE, { keyPath: "key" }); }; req.onsuccess = () => resolve(req.result); req.onerror = () => reject(req.error || new Error("IndexedDB open failed")); }); } function pruneSessions(sessions, now = Date.now()) { const minTs = now - TRANSFER_TTL_MS; const out = []; sessions.forEach((s) => { const messages = s.messages.filter((m) => (m.ts || 0) >= minTs); if (messages.length) out.push({ ...s, messages, lastTs: messages[messages.length - 1].ts || s.lastTs }); }); return out; } async function loadPersistedSessions() { let rows = []; try { const db = await openDb(); rows = await new Promise((resolve, reject) => { const tx = db.transaction(STORE, "readonly"); const req = tx.objectStore(STORE).getAll(); req.onsuccess = () => resolve(req.result || []); req.onerror = () => reject(req.error || new Error("IndexedDB read failed")); }); db.close(); } catch (e) { return []; } const sessions = rows.map((r) => ({ key: r.key, unread: 0, lastTs: r.lastTs || 0, messages: (r.messages || []).map((m) => { const msg = { ...m }; if (msg.sendState === "sending") { msg.sendState = "failed"; msg.sendError = "上次会话中断,发送状态未知"; } if (msg.blob) { try { msg.previewUrl = URL.createObjectURL(msg.blob); } catch (e) { } } return msg; }) })); return pruneSessions(sessions); } async function writeSessions(sessions) { try { const db = await openDb(); await new Promise((resolve, reject) => { const tx = db.transaction(STORE, "readwrite"); const store = tx.objectStore(STORE); store.clear(); sessions.forEach((s) => { const messages = s.messages.map((m) => { const { previewUrl: _drop, ...rest } = m; return rest; }); store.put({ key: s.key, messages, unread: s.unread, lastTs: s.lastTs }); }); tx.oncomplete = () => resolve(); tx.onerror = () => reject(tx.error || new Error("IndexedDB write failed")); }); db.close(); } catch (e) { } } let persistTimer = null; function schedulePersist(sessions) { if (persistTimer) window.clearTimeout(persistTimer); persistTimer = window.setTimeout(() => { persistTimer = null; void writeSessions(pruneSessions(sessions)); }, 800); } const DEFAULT_RELAY_SERVER = "https://znhd.122050.xyz"; const TRANSFER_STORAGE_KEY = "scriptCat_TransferSettings"; const DEFAULT_TRANSFER_SETTINGS = { relayServer: DEFAULT_RELAY_SERVER, theme: "light", autoOpenOnReceive: true }; function loadTransferSettings(legacyRelayServer) { let stored = null; try { const raw = localStorage.getItem(TRANSFER_STORAGE_KEY); if (raw) { const parsed = JSON.parse(raw); if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) stored = parsed; } } catch (e) { stored = null; } const base = stored ? { ...DEFAULT_TRANSFER_SETTINGS, ...stored } : { ...DEFAULT_TRANSFER_SETTINGS, relayServer: typeof legacyRelayServer === "string" && legacyRelayServer.trim() ? legacyRelayServer.trim().replace(/\/+$/, "") : DEFAULT_TRANSFER_SETTINGS.relayServer }; return normalize(base); } function saveTransferSettings(settings) { try { localStorage.setItem(TRANSFER_STORAGE_KEY, JSON.stringify(settings)); } catch (e) { } } function normalizeTransferSettings(input) { const theme2 = input.theme === "dark" ? "dark" : "light"; return { relayServer: String(input.relayServer || "").trim().replace(/\/+$/, ""), theme: theme2, autoOpenOnReceive: input.autoOpenOnReceive === void 0 ? true : !!input.autoOpenOnReceive }; } function normalize(input) { return normalizeTransferSettings(input); } const PHONE_SESSION_KEY = "__phone__"; const PHONE_SESSION_LABEL = "手机"; function sessionKeyOf(phoneId) { return phoneId || PHONE_SESSION_KEY; } let state = { settings: loadTransferSettings(runtime$1.init.relayServer), phones: [], sessions: [], activeSessionKey: "", windowOpen: false }; const listeners = new Set(); const autoOpenListeners = new Set(); let persistReady = false; function persistSoon() { if (persistReady) schedulePersist(state.sessions); } function emit() { listeners.forEach((cb) => cb()); } function subscribe(cb) { listeners.add(cb); return () => { listeners.delete(cb); }; } function subscribeTransfer(cb) { return subscribe(cb); } function getTransferSnapshot() { return state; } function updateTransferSettings(patch) { const prev = state.settings; const next = normalizeTransferSettings({ ...prev, ...patch }); if (next.relayServer === prev.relayServer && next.theme === prev.theme && next.autoOpenOnReceive === prev.autoOpenOnReceive) { return; } saveTransferSettings(next); state = { ...state, settings: next }; emit(); if (next.relayServer !== prev.relayServer) restartLoops(); } let phoneFallbackTimer = null; let phonesSeenAt = 0; let receiveStop = null; let knownPhones = new Set(); let inited = false; function validServer() { const s = (state.settings.relayServer || "").trim().replace(/\/+$/, ""); return /^https?:\/\//i.test(s) ? s : ""; } function restartLoops() { stopLoops(); const server = validServer(); if (!server) { state = { ...state, phones: [] }; knownPhones = new Set(); emit(); return; } startPhonesWatch(); startReceive(server); } function stopLoops() { if (phoneFallbackTimer) { clearInterval(phoneFallbackTimer); phoneFallbackTimer = null; } if (receiveStop) { receiveStop(); receiveStop = null; } } function samePhones(a, b) { if (a.length !== b.length) return false; for (let i = 0; i < a.length; i++) { if (a[i].id !== b[i].id) return false; } return true; } function applyPhones(list) { const nowIds = new Set(list.map((p) => p.id).filter(Boolean)); knownPhones.forEach((id) => { if (!nowIds.has(id)) addLog("[传输助手] 手机已断开:" + id, "warning"); }); nowIds.forEach((id) => { if (!knownPhones.has(id)) addLog("[传输助手] 手机已连接:" + id, "success"); }); knownPhones = nowIds; if (samePhones(state.phones, list)) return; state = { ...state, phones: list }; emit(); if (list.length) flushQueuedTexts(); } let phoneRefreshInFlight = false; function refreshPhones() { const server = validServer(); if (!server || phoneRefreshInFlight) return; phoneRefreshInFlight = true; try { GM_xmlhttpRequest({ method: "GET", url: server + "/phone/status/" + encodeURIComponent(getDeviceId()), timeout: 8e3, onload: (r) => { phoneRefreshInFlight = false; let j = null; try { j = JSON.parse(r.responseText); } catch (e) { j = null; } const list = j && Array.isArray(j.phones) ? j.phones.map((p) => ({ id: String(p.id || ""), lastSeen: Number(p.lastSeen) || 0 })) : j && j.online ? [{ id: "", lastSeen: 0 }] : []; applyPhones(list); }, onerror: () => { phoneRefreshInFlight = false; if (state.phones.length) { state = { ...state, phones: [] }; emit(); } } }); } catch (e) { phoneRefreshInFlight = false; } } function startPhonesWatch() { const tick2 = () => { if (!validServer()) return; if (Date.now() - phonesSeenAt < 55e3) return; refreshPhones(); }; tick2(); phoneFallbackTimer = setInterval(tick2, 6e4); } function startReceive(server) { receiveStop = startPhoneReceive({ server, uuid: getDeviceId(), onConnected: () => addLog("[传输助手] 已自动开始接收(" + server + ")", "info"), onPhones: (list) => { phonesSeenAt = Date.now(); applyPhones(list); }, onImage: (img) => { addLog("[传输助手] 收到图片:" + (img.name || "image") + "(" + (img.mime || "image") + ")", "success"); const key = sessionKeyForIncoming(img.from); addMessage(key, { id: nextId(), type: "image", direction: "in", sessionKey: key, name: img.name, mime: img.mime, blob: img.blob, previewUrl: img.previewUrl, ts: Date.now() }); }, onText: (txt) => { const t = (txt.text || "").replace(/\s+$/, ""); addLog("[传输助手] 收到文本:" + (t.length > 40 ? t.slice(0, 40) + "…" : t), "success"); const key = sessionKeyForIncoming(txt.from); addMessage(key, { id: nextId(), type: "text", direction: "in", sessionKey: key, text: t, ts: txt.ts || Date.now() }); }, onFile: (f) => { addLog( "[传输助手] 收到文件:" + (f.name || "file") + "(" + (f.mime || "application/octet-stream") + ")", "success" ); const key = sessionKeyForIncoming(f.from); addMessage(key, { id: nextId(), type: "file", direction: "in", sessionKey: key, name: f.name, mime: f.mime, blob: f.blob, previewUrl: f.previewUrl, ts: Date.now() }); } }); } function sessionKeyForIncoming(from) { const sender = (from || "").trim(); if (sender) return sessionKeyOf(sender); const online = state.phones.filter((p) => p.id); if (online.length === 1) return sessionKeyOf(online[0].id); return PHONE_SESSION_KEY; } function nextId() { return Date.now().toString(36) + "-" + Math.random().toString(36).slice(2, 8); } function addMessage(sessionKey, msg) { const sessions = state.sessions.slice(); const at = sessions.findIndex((s) => s.key === sessionKey); const prev = at >= 0 ? sessions[at] : { key: sessionKey, messages: [], unread: 0, lastTs: 0 }; const isViewing = state.windowOpen && state.activeSessionKey === sessionKey; const next = { ...prev, messages: prev.messages.concat(msg), lastTs: msg.ts || Date.now(), unread: isViewing ? prev.unread : prev.unread + 1 }; if (at >= 0) sessions[at] = next; else sessions.push(next); sessions.sort((a, b) => b.lastTs - a.lastTs); const nextActive = state.windowOpen ? state.activeSessionKey : sessionKey; state = { ...state, sessions, activeSessionKey: nextActive }; emit(); persistSoon(); if (!state.windowOpen && state.settings.autoOpenOnReceive) { autoOpenListeners.forEach((cb) => cb(sessionKey)); } } function patchMessage(sessionKey, msgId, patch) { const sessions = state.sessions.slice(); const at = sessions.findIndex((s) => s.key === sessionKey); if (at < 0) return; const session = sessions[at]; const messages = session.messages.map((m) => m.id === msgId ? { ...m, ...patch } : m); sessions[at] = { ...session, messages }; state = { ...state, sessions }; emit(); persistSoon(); } function removeTransferMessage(sessionKey, msgId) { const sessions = state.sessions.slice(); const at = sessions.findIndex((s) => s.key === sessionKey); if (at < 0) return; const session = sessions[at]; const removed = session.messages.find((m) => m.id === msgId); if (removed) revokeUrl(removed.previewUrl); sessions[at] = { ...session, messages: session.messages.filter((m) => m.id !== msgId) }; state = { ...state, sessions }; emit(); persistSoon(); } function clearTransferSession(sessionKey) { const sessions = state.sessions.map((s) => { if (s.key !== sessionKey) return s; s.messages.forEach((m) => revokeUrl(m.previewUrl)); return { ...s, messages: [], unread: 0, lastTs: 0 }; }).filter((s) => s.messages.length > 0); state = { ...state, sessions }; emit(); persistSoon(); } function clearAllTransferFiles() { state.sessions.forEach((s) => s.messages.forEach((m) => revokeUrl(m.previewUrl))); state = { ...state, sessions: [] }; emit(); persistSoon(); } function revokeUrl(url) { if (!url) return; try { URL.revokeObjectURL(url); } catch (e) { } } function setActiveSession(sessionKey) { if (state.activeSessionKey === sessionKey) return; state = { ...state, activeSessionKey: sessionKey }; emit(); } function setTransferWindowOpen(open) { if (state.windowOpen === open) return; state = { ...state, windowOpen: open }; emit(); if (open) refreshPhones(); } function markSessionRead(sessionKey) { const at = state.sessions.findIndex((s) => s.key === sessionKey); if (at < 0 || state.sessions[at].unread === 0) return; const sessions = state.sessions.slice(); sessions[at] = { ...sessions[at], unread: 0 }; state = { ...state, sessions }; emit(); } function onTransferAutoOpen(cb) { autoOpenListeners.add(cb); return () => { autoOpenListeners.delete(cb); }; } function sessionSendable(sessionKey) { return state.phones.length > 0; } function healStaleSending(maxAgeMs = 3 * 60 * 1e3) { const now = Date.now(); let fixed = 0; const sessions = state.sessions.map((s) => { let changed = false; const messages = s.messages.map((m) => { if (m.sendState !== "sending") return m; if (now - (m.ts || 0) <= maxAgeMs) return m; changed = true; fixed++; return { ...m, sendState: "failed", sendError: "发送超时(未收到响应)", sendProgress: void 0 }; }); return changed ? { ...s, messages } : s; }); if (fixed) { state = { ...state, sessions }; emit(); persistSoon(); } return fixed; } function sendTargets(sessionKey) { if (sessionKey === PHONE_SESSION_KEY) return "all"; return [sessionKey]; } function sendTextToSession(sessionKey, text) { const t = (text || "").trim(); const server = validServer(); if (!t) { addLog("[传输助手] 文本为空", "error", true); return false; } if (!server) { addLog("[传输助手] 尚未配置中继服务器,无法发送", "error", true); return false; } const msg = { id: nextId(), type: "text", direction: "out", sessionKey, text: t, ts: Date.now() }; if (!sessionSendable()) { msg.sendState = "queued"; addMessage(sessionKey, msg); addLog("[传输助手] 当前无在线设备,消息已排队等设备上线", "warning"); return true; } addMessage(sessionKey, msg); deliverText(sessionKey, msg.id, t, server); return true; } function deliverText(sessionKey, msgId, t, server) { sendToPhone({ server, uuid: getDeviceId(), payload: { text: t, targets: sendTargets(sessionKey) }, onOk: () => addLog("[传输助手] 文本已发送", "success"), onFail: (e) => { patchMessage(sessionKey, msgId, { sendState: "failed", sendError: e }); addLog("[传输助手] 发送失败:" + e, "error"); } }); } function flushQueuedTexts() { const server = validServer(); if (!server) return; state.sessions.forEach((s) => { s.messages.forEach((m) => { if (m.type === "text" && m.direction === "out" && m.sendState === "queued") { patchMessage(s.key, m.id, { sendState: void 0, sendError: void 0 }); deliverText(s.key, m.id, m.text || "", server); } }); }); } function sendImagesToSession(sessionKey, files, onProgress) { const server = validServer(); if (!files.length) return false; if (!server) { addLog("[传输助手] 尚未配置中继服务器,无法发送", "error", true); return false; } if (!sessionSendable()) { addLog("[传输助手] 当前无在线设备,无法发送", "error", true); return false; } const targets = sendTargets(sessionKey); const list = files.slice(); const total = list.length; let sent = 0; const failAt = (reason, msgId) => { if (msgId) patchMessage(sessionKey, msgId, { sendState: "failed", sendError: reason, sendProgress: void 0 }); addLog( "[传输助手] 第 " + (sent + 1) + " 张发送失败:" + reason + "(已发 " + sent + "/" + total + ")", "error" ); }; const msgIds = list.map(() => nextId()); list.forEach((it, i) => { addMessage(sessionKey, { id: msgIds[i], type: "image", direction: "out", sessionKey, name: it.name, mime: it.mime, blob: it.file, previewUrl: it.url, ts: Date.now(), sendState: "sending" }); }); const sendNext = () => { if (sent >= total) { addLog("[传输助手] " + total + " 张图片已全部发送", "success"); return; } const it = list[sent]; const msgId = msgIds[sent]; addLog("[传输助手] 正在处理(" + (sent + 1) + "/" + total + "):" + (it.name || "image"), "info"); compressImageForPhone(it.file).then((out) => { if (imagePayloadBytes(out.blob, out.name, out.mime) > RELAY_MAX_BODY) { addLog( "[传输助手] 第 " + (sent + 1) + " 张压缩后仍超限(单张约 100MB 上限),已停止(已发 " + sent + "/" + total + ")", "error", true ); failAt("压缩后仍超过单张上限(约 100MB)", msgId); return; } addLog( "[传输助手] " + (out.compressed ? "已压缩 " + it.name + ":" + kbText(it.file.size) + " → " + kbText(out.blob.size) : "原图发送 " + out.name + "(" + kbText(out.blob.size) + ")") + ",正在发送(" + (sent + 1) + "/" + total + ")", "info" ); patchMessage(sessionKey, msgId, { blob: out.blob, name: out.name, mime: out.mime }); const rd = new FileReader(); rd.onload = () => { const b64 = (rd.result || "").split(",")[1] || ""; if (!b64) { failAt("读取图片失败", msgId); return; } let lastPct = -1; sendToPhone({ server, uuid: getDeviceId(), payload: { name: out.name, mime: out.mime, data: b64, targets }, onUploadProgress: (pct) => { if (pct !== lastPct) { lastPct = pct; patchMessage(sessionKey, msgId, { sendProgress: pct }); } }, onOk: () => { sent++; patchMessage(sessionKey, msgId, { sendState: void 0, sendError: void 0, sendProgress: void 0 }); sendNext(); }, onFail: (e) => failAt(e, msgId) }); }; rd.onerror = () => failAt("读取图片失败", msgId); rd.readAsDataURL(out.blob); }).catch((e) => failAt(e && e.message || "图片处理失败", msgIds[sent])); }; sendNext(); return true; } function kbText(bytes) { return Math.max(1, Math.round((Number(bytes) || 0) / 1024)) + "KB"; } function sendFilesToSession(sessionKey, files, onProgress) { const server = validServer(); if (!files.length) return false; if (!server) { addLog("[传输助手] 尚未配置中继服务器,无法发送", "error", true); return false; } if (!sessionSendable()) { addLog("[传输助手] 当前无在线设备,无法发送", "error", true); return false; } const targets = sendTargets(sessionKey); const list = files.slice(); const total = list.length; let sent = 0; const failAt = (reason, msgId) => { if (msgId) patchMessage(sessionKey, msgId, { sendState: "failed", sendError: reason, sendProgress: void 0 }); addLog( "[传输助手] 第 " + (sent + 1) + " 个文件发送失败:" + reason + "(已发 " + sent + "/" + total + ")", "error" ); }; const msgIds = list.map(() => nextId()); list.forEach((it, i) => { addMessage(sessionKey, { id: msgIds[i], type: "file", direction: "out", sessionKey, name: it.name, mime: it.mime, blob: it.file, previewUrl: it.url, ts: Date.now(), sendState: "sending" }); }); const sendNext = () => { if (sent >= total) { addLog("[传输助手] " + total + " 个文件已全部发送", "success"); return; } const it = list[sent]; const msgId = msgIds[sent]; const est = imagePayloadBytes(it.file, it.name, it.mime); if (est > RELAY_MAX_BODY) { addLog( "[传输助手] 第 " + (sent + 1) + " 个文件过大(" + kbText(it.file.size) + ",编码后约 " + kbText(est) + ",超过单次上限约 100MB),已停止(已发 " + sent + "/" + total + ")", "error", true ); failAt("文件过大(编码后约 " + kbText(est) + ",超过单次上限约 100MB)", msgId); return; } addLog( "[传输助手] 正在发送文件(" + (sent + 1) + "/" + total + "):" + it.name + "(" + kbText(it.file.size) + ")", "info" ); const rd = new FileReader(); rd.onload = () => { const b64 = (rd.result || "").split(",")[1] || ""; if (!b64) { failAt("读取文件失败", msgId); return; } let lastPct = -1; sendToPhone({ server, uuid: getDeviceId(), payload: { name: it.name, mime: it.mime, data: b64, targets }, onUploadProgress: (pct) => { if (pct !== lastPct) { lastPct = pct; patchMessage(sessionKey, msgId, { sendProgress: pct }); } }, onOk: () => { sent++; patchMessage(sessionKey, msgId, { sendState: void 0, sendError: void 0, sendProgress: void 0 }); sendNext(); }, onFail: (e) => failAt(e, msgId) }); }; rd.onerror = () => failAt("读取文件失败", msgId); rd.readAsDataURL(it.file); }; sendNext(); return true; } let pruneTimer = null; function pruneExpiredNow() { const minTs = Date.now() - TRANSFER_TTL_MS; let changed = false; const next = []; state.sessions.forEach((s) => { const kept = s.messages.filter((m) => (m.ts || 0) >= minTs); if (kept.length !== s.messages.length) { s.messages.forEach((m) => { if ((m.ts || 0) < minTs) revokeUrl(m.previewUrl); }); changed = true; } if (kept.length) next.push({ ...s, messages: kept, lastTs: kept[kept.length - 1].ts || s.lastTs }); }); if (changed) { state = { ...state, sessions: next, activeSessionKey: next.some((s) => s.key === state.activeSessionKey) ? state.activeSessionKey : "" }; emit(); persistSoon(); } } function initTransfer() { if (inited) return; inited = true; restartLoops(); void loadPersistedSessions().then((loaded) => { if (loaded.length) { const merged = state.sessions.slice(); loaded.forEach((s) => { if (!merged.some((x) => x.key === s.key)) merged.push(s); }); merged.sort((a, b) => b.lastTs - a.lastTs); state = { ...state, sessions: merged }; emit(); } }).catch(() => { }).finally(() => { persistReady = true; }); pruneExpiredNow(); if (pruneTimer) clearInterval(pruneTimer); pruneTimer = setInterval(pruneExpiredNow, 60 * 60 * 1e3); } function stopTransfer() { stopLoops(); if (pruneTimer) { clearInterval(pruneTimer); pruneTimer = null; } knownPhones = new Set(); phonesSeenAt = 0; inited = false; } const POLL_INTERVAL = 300; const POLL_TIMEOUT = 8e3; const MAX_EXPAND_ROUNDS = 12; const EXPAND_GAP = 350; const sleep$1 = (ms) => new Promise((r) => setTimeout(r, ms)); function waitFor(what, probe) { return new Promise((resolve, reject) => { const started2 = Date.now(); const tick2 = () => { let hit = null; try { hit = probe(); } catch { } if (hit) return resolve(hit); if (Date.now() - started2 > POLL_TIMEOUT) { return reject(new Error("等待「" + what + "」超时(" + POLL_TIMEOUT + "ms)——是否已进入会话页面?")); } setTimeout(tick2, POLL_INTERVAL); }; tick2(); }); } function clickEl(el) { const opts = { bubbles: true, cancelable: true }; let ev; try { ev = new MouseEvent("click", opts); } catch { ev = new Event("click", opts); } el.dispatchEvent(ev); } function findTabNav(text) { const label = [...document.querySelectorAll(".t-tabs__nav-item-text-wrapper")].find( (e) => { var _a2; return ((_a2 = e.textContent) == null ? void 0 : _a2.trim()) === text; } ); return (label == null ? void 0 : label.closest(".t-tabs__nav-item")) || null; } async function switchTab(text) { const nav = findTabNav(text); if (!nav) throw new Error("右侧栏没有「" + text + "」tab——是否已进入会话页面?"); if (!nav.className.includes("active")) { clickEl(nav); await waitFor(text + " tab 激活", () => nav.className.includes("active") ? nav : null); } } async function expandAllFolders(panel) { let lastClosed = -1; for (let round2 = 0; round2 < MAX_EXPAND_ROUNDS; round2++) { const closed = [...panel.querySelectorAll(".t-tree__item")].filter( (it) => !it.classList.contains("custom-rich-node") && !it.classList.contains("t-tree__item--open") ); if (!closed.length) return; if (closed.length === lastClosed) return; lastClosed = closed.length; for (const item of closed) { clickEl(item.querySelector(".t-folder-icon") || item); await sleep$1(EXPAND_GAP); } await sleep$1(500); } } function extractGroups(panel) { const read2 = (sel) => [...panel.querySelectorAll(sel + " .auxiliary-item")].map((i) => { var _a2; return (((_a2 = i.firstElementChild) == null ? void 0 : _a2.textContent) || "").trim(); }).filter(Boolean); return { all: read2(".verbal-trink-main"), mine: read2(".main") }; } function readPhrasesFromZnhd() { const restoreHome = () => { try { const home = findTabNav("会话人信息"); if (home && !home.className.includes("active")) clickEl(home); } catch { } }; return (async () => { try { await switchTab("常用话术"); const panel = await waitFor( "话术面板", () => [...document.querySelectorAll(".display-container")].find( (e) => e.querySelector(".t-tree__item") ) || null ); await expandAllFolders(panel); const data = extractGroups(panel); if (!data.all.length && !data.mine.length) { throw new Error("话术面板里没有读到任何条目——可能是文件夹未展开或页面结构已变化"); } return data; } finally { restoreHome(); } })(); } const _sfc_main$L = { __name: "Icon", props: { name: { type: null, required: true }, mode: { type: String, required: false }, size: { type: [String, Number], required: false }, customize: { type: [Function, Boolean, null], required: false } }, setup(__props) { const props = __props; const appConfig2 = useAppConfig(); function resolveCustomizeFn(customize2, globalCustomize) { if (customize2 === false) return void 0; if (customize2 === true || customize2 === null) return globalCustomize; return customize2; } const mode = vue.computed(() => { var _a2; const mode2 = props.mode || ((_a2 = appConfig2.icon) == null ? void 0 : _a2.mode); if (mode2 === "css") return "style"; return mode2; }); const size2 = vue.computed(() => { var _a2; return props.size || ((_a2 = appConfig2.icon) == null ? void 0 : _a2.size); }); const customize = vue.computed(() => { var _a2; return resolveCustomizeFn(props.customize, (_a2 = appConfig2.icon) == null ? void 0 : _a2.customize); }); const icon = vue.computed(() => typeof props.name === "string" ? props.name.replace(/^i-/, "") : ""); const ssr = vue.computed(() => iconLoaded(icon.value)); return (_ctx, _cache) => { return typeof __props.name === "string" ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), { key: 0, icon: icon.value, mode: mode.value, width: size2.value, height: size2.value, customise: customize.value, ssr: ssr.value }, null, 8, ["icon", "mode", "width", "height", "customise", "ssr"])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.name), { key: 1 })); }; } }; const ImageComponent = "img"; const avatarGroupInjectionKey = Symbol("nuxt-ui.avatar-group"); function useAvatarGroup(props) { const avatarGroup = vue.inject(avatarGroupInjectionKey, void 0); const size2 = vue.computed(() => { var _a2; return (_a2 = props.size) != null ? _a2 : avatarGroup == null ? void 0 : avatarGroup.value.size; }); const color = vue.computed(() => { var _a2; return (_a2 = props.color) != null ? _a2 : avatarGroup == null ? void 0 : avatarGroup.value.color; }); vue.provide(avatarGroupInjectionKey, vue.computed(() => ({ size: size2.value, color: color.value }))); return { size: size2, color }; } const theme$n = { "slots": { "root": "relative inline-flex items-center justify-center shrink-0", "base": "rounded-full ring ring-bg flex items-center justify-center text-inverted font-medium whitespace-nowrap" }, "variants": { "color": { "primary": "bg-primary", "success": "bg-success", "info": "bg-info", "warning": "bg-warning", "error": "bg-error", "neutral": "bg-inverted" }, "size": { "3xs": "h-[4px] min-w-[4px] text-[4px]", "2xs": "h-[5px] min-w-[5px] text-[5px]", "xs": "h-[6px] min-w-[6px] text-[6px]", "sm": "h-[7px] min-w-[7px] text-[7px]", "md": "h-[8px] min-w-[8px] text-[8px]", "lg": "h-[9px] min-w-[9px] text-[9px]", "xl": "h-[10px] min-w-[10px] text-[10px]", "2xl": "h-[11px] min-w-[11px] text-[11px]", "3xl": "h-[12px] min-w-[12px] text-[12px]" }, "position": { "top-right": "top-0 right-0", "bottom-right": "bottom-0 right-0", "top-left": "top-0 left-0", "bottom-left": "bottom-0 left-0" }, "inset": { "false": "" }, "standalone": { "false": "absolute" } }, "compoundVariants": [ { "position": "top-right", "inset": false, "class": "-translate-y-1/2 translate-x-1/2 transform" }, { "position": "bottom-right", "inset": false, "class": "translate-y-1/2 translate-x-1/2 transform" }, { "position": "top-left", "inset": false, "class": "-translate-y-1/2 -translate-x-1/2 transform" }, { "position": "bottom-left", "inset": false, "class": "translate-y-1/2 -translate-x-1/2 transform" } ], "defaultVariants": { "size": "md", "color": "primary", "position": "top-right" } }; const _sfc_main$K = Object.assign({ inheritAttrs: false }, { __name: "Chip", props: vue.mergeModels({ as: { type: null, required: false }, text: { type: [String, Number], required: false }, color: { type: null, required: false }, size: { type: null, required: false }, position: { type: null, required: false }, inset: { type: Boolean, required: false, default: false }, standalone: { type: Boolean, required: false, default: false }, class: { type: null, required: false }, ui: { type: Object, required: false } }, { "show": { type: Boolean, ...{ default: true } }, "showModifiers": {} }), emits: ["update:show"], setup(__props) { const _props = __props; const props = useComponentProps("chip", _props); const show2 = vue.useModel(__props, "show", { type: Boolean, ...{ default: true } }); const { size: size2 } = useAvatarGroup(_props); const appConfig2 = useAppConfig(); const ui2 = vue.computed(() => { var _a2, _b; return tv({ extend: theme$n, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.chip) || {} })({ color: props.color, size: (_b = size2.value) != null ? _b : props.size, position: props.position, inset: props.inset, standalone: props.standalone }); }); return (_ctx, _cache) => { var _a2, _b; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: vue.unref(props).as, "data-slot": (_a2 = _ctx.$attrs["data-slot"]) != null ? _a2 : "root", class: vue.normalizeClass(ui2.value.root({ class: [(_b = vue.unref(props).ui) == null ? void 0 : _b.root, vue.unref(props).class] })) }, { default: vue.withCtx(() => { var _a3; return [ vue.createVNode(vue.unref(Slot), vue.normalizeProps(vue.guardReactiveProps({ ..._ctx.$attrs, "data-slot": void 0 })), { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16), show2.value ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "data-slot": "base", class: vue.normalizeClass(ui2.value.base({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.base })) }, [ vue.renderSlot(_ctx.$slots, "content", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).text), 1) ]) ], 2)) : vue.createCommentVNode("", true) ]; }), _: 3 }, 8, ["as", "data-slot", "class"]); }; } }); const theme$m = { "slots": { "root": "inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle", "image": "h-full w-full rounded-[inherit] object-cover", "fallback": "font-medium truncate", "icon": "shrink-0" }, "variants": { "color": { "primary": { "root": "bg-primary/10", "fallback": "text-primary", "icon": "text-primary" }, "success": { "root": "bg-success/10", "fallback": "text-success", "icon": "text-success" }, "info": { "root": "bg-info/10", "fallback": "text-info", "icon": "text-info" }, "warning": { "root": "bg-warning/10", "fallback": "text-warning", "icon": "text-warning" }, "error": { "root": "bg-error/10", "fallback": "text-error", "icon": "text-error" }, "neutral": { "root": "bg-elevated", "fallback": "text-muted", "icon": "text-muted" } }, "size": { "3xs": { "root": "size-4 text-[8px]" }, "2xs": { "root": "size-5 text-[10px]" }, "xs": { "root": "size-6 text-xs" }, "sm": { "root": "size-7 text-sm" }, "md": { "root": "size-8 text-base" }, "lg": { "root": "size-9 text-lg" }, "xl": { "root": "size-10 text-xl" }, "2xl": { "root": "size-11 text-[22px]" }, "3xl": { "root": "size-12 text-2xl" } } }, "defaultVariants": { "size": "md", "color": "neutral" } }; const _sfc_main$J = Object.assign({ inheritAttrs: false }, { __name: "Avatar", props: { as: { type: null, required: false }, src: { type: String, required: false }, alt: { type: String, required: false }, icon: { type: null, required: false }, text: { type: String, required: false }, size: { type: null, required: false }, color: { type: null, required: false }, chip: { type: [Boolean, Object], required: false }, class: { type: null, required: false }, style: { type: null, required: false }, ui: { type: Object, required: false } }, setup(__props) { const _props = __props; const props = useComponentProps("avatar", _props); const as = vue.computed(() => resolveAs(props.as, { root: "span" })); const fallback = vue.computed(() => props.text || (props.alt || "").split(" ").map((word) => word.charAt(0)).join("").substring(0, 2)); const appConfig2 = useAppConfig(); const { size: size2, color } = useAvatarGroup(_props); const ui2 = vue.computed(() => { var _a2, _b, _c; return tv({ extend: theme$m, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.avatar) || {} })({ size: (_b = size2.value) != null ? _b : props.size, color: (_c = color.value) != null ? _c : props.color }); }); const rootClass = vue.computed(() => { var _a2; return ui2.value.root({ class: [(_a2 = props.ui) == null ? void 0 : _a2.root, props.class] }); }); const sizePx = vue.computed(() => { var _a2; const sizeClass = (rootClass.value || "").split(" ").find((c) => /^size-\d+$/.test(c)); if (sizeClass) { const num2 = Number.parseFloat((_a2 = sizeClass.split("-")[1]) != null ? _a2 : ""); if (!Number.isNaN(num2)) return num2 * 4; } return null; }); const error = vue.ref(false); vue.watch(() => props.src, () => { if (error.value) { error.value = false; } }); function onError() { error.value = true; } return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).chip ? _sfc_main$K : vue.unref(Primitive)), vue.mergeProps({ as: as.value.root }, vue.unref(props).chip ? typeof vue.unref(props).chip === "object" ? { inset: true, ...vue.unref(props).chip } : { inset: true } : {}, { "data-slot": (_a2 = _ctx.$attrs["data-slot"]) != null ? _a2 : "root", class: rootClass.value, style: vue.unref(props).style }), { default: vue.withCtx(() => { var _a3; return [ vue.unref(props).src && !error.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(as.value.img || vue.unref(ImageComponent)), vue.mergeProps({ key: 0, src: vue.unref(props).src, alt: vue.unref(props).alt, width: sizePx.value, height: sizePx.value }, _ctx.$attrs, { "data-slot": "image", class: ui2.value.image({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.image }), onError }), null, 16, ["src", "alt", "width", "height", "class"])) : (vue.openBlock(), vue.createBlock(vue.unref(Slot), vue.normalizeProps(vue.mergeProps({ key: 1 }, { ..._ctx.$attrs, "data-slot": void 0 })), { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default", {}, () => { var _a4, _b; return [ vue.unref(props).icon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(props).icon, "data-slot": "icon", class: vue.normalizeClass(ui2.value.icon({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.icon })) }, null, 8, ["name", "class"])) : (vue.openBlock(), vue.createElementBlock("span", { key: 1, "data-slot": "fallback", class: vue.normalizeClass(ui2.value.fallback({ class: (_b = vue.unref(props).ui) == null ? void 0 : _b.fallback })) }, vue.toDisplayString(fallback.value || " "), 3)) ]; }) ]), _: 3 }, 16)) ]; }), _: 3 }, 16, ["as", "data-slot", "class", "style"]); }; } }); function useComponentIcons(componentProps) { const appConfig2 = useAppConfig(); const props = vue.computed(() => vue.toValue(componentProps)); const isLeading = vue.computed(() => props.value.icon && props.value.leading || props.value.icon && !props.value.trailing || props.value.loading && !props.value.trailing || !!props.value.leadingIcon); const isTrailing = vue.computed(() => props.value.icon && props.value.trailing || props.value.loading && props.value.trailing && !isLeading.value || !!props.value.trailingIcon && props.value.trailing !== false); const leadingIconName = vue.computed(() => { if (props.value.loading) { return props.value.loadingIcon || appConfig2.ui.icons.loading; } return props.value.leadingIcon || props.value.icon; }); const trailingIconName = vue.computed(() => { if (props.value.loading && !isLeading.value) { return props.value.loadingIcon || appConfig2.ui.icons.loading; } return props.value.trailingIcon || props.value.icon; }); return { isLeading, isTrailing, leadingIconName, trailingIconName }; } const fieldGroupInjectionKey = Symbol("nuxt-ui.field-group"); function useFieldGroup(props) { const fieldGroup = vue.inject(fieldGroupInjectionKey, void 0); return { orientation: vue.computed(() => fieldGroup == null ? void 0 : fieldGroup.value.orientation), size: vue.computed(() => { var _a2; return (_a2 = props == null ? void 0 : props.size) != null ? _a2 : fieldGroup == null ? void 0 : fieldGroup.value.size; }) }; } const FieldGroupReset = vue.defineComponent({ name: "FieldGroupReset", setup(_2, { slots }) { vue.provide(fieldGroupInjectionKey, vue.computed(() => ({ size: void 0, orientation: void 0 }))); return () => { var _a2; return (_a2 = slots.default) == null ? void 0 : _a2.call(slots); }; } }); const formOptionsInjectionKey = Symbol("nuxt-ui.form-options"); const formBusInjectionKey = Symbol("nuxt-ui.form-events"); const formFieldInjectionKey = Symbol("nuxt-ui.form-field"); const inputIdInjectionKey = Symbol("nuxt-ui.input-id"); const formLoadingInjectionKey = Symbol("nuxt-ui.form-loading"); function useFormField(props, opts) { var _a2, _b; const formOptions = vue.inject(formOptionsInjectionKey, void 0); const formBus = vue.inject(formBusInjectionKey, void 0); const formField = vue.inject(formFieldInjectionKey, void 0); const inputId = vue.inject(inputIdInjectionKey, void 0); vue.provide(formFieldInjectionKey, void 0); if (formField && inputId) { if ((opts == null ? void 0 : opts.bind) === false) { inputId.value = void 0; } else if (props == null ? void 0 : props.id) { inputId.value = props == null ? void 0 : props.id; } } function emitFormEvent(type, name, flags) { if (formBus && formField && name) { formBus.emit({ type, name, ...flags }); } } function emitFormBlur() { emitFormEvent("blur", formField == null ? void 0 : formField.value.name); } function emitFormFocus() { emitFormEvent("focus", formField == null ? void 0 : formField.value.name); } function emitFormChange() { emitFormEvent("change", formField == null ? void 0 : formField.value.name); } let disposed = false; if (vue.getCurrentScope()) { vue.onScopeDispose(() => { disposed = true; }); } const validateInput = useDebounceFn( () => { if (disposed) return; emitFormEvent("input", formField == null ? void 0 : formField.value.name, { eager: !(opts == null ? void 0 : opts.deferInputValidation) || (formField == null ? void 0 : formField.value.eagerValidation), track: false }); }, (_b = (_a2 = formField == null ? void 0 : formField.value.validateOnInputDelay) != null ? _a2 : formOptions == null ? void 0 : formOptions.value.validateOnInputDelay) != null ? _b : 0 ); function emitFormInput() { emitFormEvent("input", formField == null ? void 0 : formField.value.name, { validate: false }); return validateInput(); } return { id: vue.computed(() => { var _a3; return (_a3 = props == null ? void 0 : props.id) != null ? _a3 : inputId == null ? void 0 : inputId.value; }), labelId: vue.computed(() => formField == null ? void 0 : formField.value.labelId), name: vue.computed(() => { var _a3; return (_a3 = props == null ? void 0 : props.name) != null ? _a3 : formField == null ? void 0 : formField.value.name; }), size: vue.computed(() => { var _a3; return (_a3 = props == null ? void 0 : props.size) != null ? _a3 : formField == null ? void 0 : formField.value.size; }), color: vue.computed(() => (formField == null ? void 0 : formField.value.error) ? "error" : props == null ? void 0 : props.color), highlight: vue.computed(() => (formField == null ? void 0 : formField.value.error) ? true : (props == null ? void 0 : props.highlight) || void 0), disabled: vue.computed(() => (formOptions == null ? void 0 : formOptions.value.disabled) || (props == null ? void 0 : props.disabled) || void 0), emitFormBlur, emitFormInput, emitFormChange, emitFormFocus, ariaAttrs: vue.computed(() => { if (!(formField == null ? void 0 : formField.value)) return; const descriptiveAttrs = ["error", "hint", "description", "help"].filter((type) => { var _a3; return (_a3 = formField == null ? void 0 : formField.value) == null ? void 0 : _a3[type]; }).map((type) => `${formField == null ? void 0 : formField.value.ariaId}-${type}`) || []; const attrs = { "aria-invalid": !!(formField == null ? void 0 : formField.value.error) }; if (descriptiveAttrs.length > 0) { attrs["aria-describedby"] = descriptiveAttrs.join(" "); } return attrs; }) }; } const linkKeys = [ "active", "activeClass", "ariaCurrentValue", "as", "disabled", "download", "exact", "exactActiveClass", "exactHash", "exactQuery", "external", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "href", "hreflang", "inactiveClass", "locale", "media", "noPrefetch", "noRel", "onClick", "ping", "prefetch", "prefetchOn", "prefetchedClass", "referrerpolicy", "rel", "replace", "target", "title", "to", "trailingSlash", "type", "viewTransition" ]; const linkKeySet = new Set(linkKeys); function pickLinkProps(link) { const picked = {}; for (const key of Object.keys(link)) { if (linkKeySet.has(key) || key.startsWith("aria-") || key.startsWith("data-")) { picked[key] = link[key]; } } return picked; } const _sfc_main$I = { __name: "LinkBase", props: { as: { type: String, required: false, default: "button" }, type: { type: String, required: false, default: "button" }, disabled: { type: Boolean, required: false }, onClick: { type: [Function, Array], required: false }, href: { type: [String, null], required: false }, navigate: { type: Function, required: false }, target: { type: [String, Object, null], required: false }, rel: { type: [String, Object, null], required: false }, active: { type: Boolean, required: false }, isExternal: { type: Boolean, required: false } }, setup(__props) { const props = __props; function onClickWrapper(e) { if (props.disabled) { e.stopPropagation(); e.preventDefault(); return; } const results = []; if (props.onClick) { for (const onClick of Array.isArray(props.onClick) ? props.onClick : [props.onClick]) { results.push(onClick(e)); } } if (props.href && props.navigate && !props.isExternal) { props.navigate(e); } return Promise.all(results); } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Primitive), vue.mergeProps(__props.href ? { "as": "a", "href": __props.disabled ? void 0 : __props.href, "aria-disabled": __props.disabled ? "true" : void 0, "role": __props.disabled ? "link" : void 0, "tabindex": __props.disabled ? -1 : void 0 } : __props.as === "button" ? { as: __props.as, type: __props.type, disabled: __props.disabled } : { as: __props.as }, { rel: __props.rel, target: __props.target, onClick: onClickWrapper }), { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["rel", "target"]); }; } }; const theme$l = { "base": "outline-primary/25 focus-visible:outline-3 rounded-md", "variants": { "active": { "true": "text-primary", "false": "text-muted" }, "disabled": { "true": "cursor-not-allowed opacity-75" } }, "compoundVariants": [ { "active": false, "disabled": false, "class": [ "hover:text-default", "transition-colors" ] } ] }; const _sfc_main$H = Object.assign({ inheritAttrs: false }, { __name: "Link", props: { as: { type: null, required: false, default: "button" }, type: { type: null, required: false, default: "button" }, disabled: { type: Boolean, required: false }, active: { type: Boolean, required: false, default: void 0 }, exact: { type: Boolean, required: false }, exactQuery: { type: [Boolean, String], required: false }, exactHash: { type: Boolean, required: false }, inactiveClass: { type: String, required: false }, activeClass: { type: String, required: false }, ariaCurrentValue: { type: String, required: false, default: "page" }, custom: { type: Boolean, required: false }, raw: { type: Boolean, required: false }, class: { type: null, required: false }, to: { type: String, required: false }, href: { type: String, required: false }, external: { type: Boolean, required: false }, target: { type: [String, Object, null], required: false }, rel: { type: [String, Object, null], required: false }, noRel: { type: Boolean, required: false } }, setup(__props) { const props = __props; const appConfig2 = useAppConfig(); const ui2 = vue.computed(() => { var _a2, _b, _c, _d, _e2, _f, _g, _h, _i; return tv({ extend: theme$l, ...defu({ variants: { active: { true: mergeClasses((_d = (_c = (_b = (_a2 = appConfig2.ui) == null ? void 0 : _a2.link) == null ? void 0 : _b.variants) == null ? void 0 : _c.active) == null ? void 0 : _d.true, props.activeClass), false: mergeClasses((_h = (_g = (_f = (_e2 = appConfig2.ui) == null ? void 0 : _e2.link) == null ? void 0 : _f.variants) == null ? void 0 : _g.active) == null ? void 0 : _h.false, props.inactiveClass) } } }, ((_i = appConfig2.ui) == null ? void 0 : _i.link) || {}) }); }); const href = vue.computed(() => { var _a2; return (_a2 = props.to) != null ? _a2 : props.href; }); const isExternal = vue.computed(() => { if (props.target === "_blank") { return true; } if (props.external) { return true; } if (!href.value) { return false; } return hasProtocol(href.value, { acceptRelative: true }); }); const hasTarget = vue.computed(() => !!props.target && props.target !== "_self"); const isLinkActive = vue.computed(() => { if (props.active !== void 0) { return props.active; } return false; }); const linkClass = vue.computed(() => { const active = isLinkActive.value; if (props.raw) { return [props.class, active ? props.activeClass : props.inactiveClass]; } return ui2.value({ class: props.class, active, disabled: props.disabled }); }); const rel = vue.computed(() => { if (props.noRel) { return null; } if (props.rel !== void 0) { return props.rel || null; } if (isExternal.value || hasTarget.value) { return "noopener noreferrer"; } return null; }); const handleNavigation = vue.inject("nuxtui:router", void 0); const navigate = handleNavigation ? (e) => { handleNavigation(e, { href: href.value || "", external: isExternal.value, target: props.target || (isExternal.value ? "_blank" : void 0) }); } : void 0; return (_ctx, _cache) => { return __props.custom ? (vue.openBlock(), vue.createBlock(vue.unref(Slot), { key: 0 }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps({ ..._ctx.$attrs, as: __props.as, type: __props.type, disabled: __props.disabled, href: href.value, navigate: vue.unref(navigate), rel: rel.value, target: __props.target || (isExternal.value ? "_blank" : void 0), isExternal: isExternal.value, active: isLinkActive.value }))) ]), _: 3 })) : (vue.openBlock(), vue.createBlock(_sfc_main$I, vue.mergeProps({ key: 1 }, { ..._ctx.$attrs, as: __props.as, type: __props.type, disabled: __props.disabled, href: href.value, navigate: vue.unref(navigate), rel: rel.value, target: __props.target || (isExternal.value ? "_blank" : void 0), isExternal: isExternal.value }, { class: linkClass.value }), { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default", { active: isLinkActive.value }) ]), _: 3 }, 16, ["class"])); }; } }); const theme$k = { "slots": { "base": [ "rounded-md font-medium inline-flex items-center disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75", "transition-colors" ], "label": "truncate", "leadingIcon": "shrink-0", "leadingAvatar": "shrink-0", "leadingAvatarSize": "", "trailingIcon": "shrink-0" }, "variants": { "fieldGroup": { "horizontal": "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]", "vertical": "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]" }, "color": { "primary": "", "success": "", "info": "", "warning": "", "error": "", "neutral": "" }, "variant": { "solid": "", "outline": "", "soft": "", "subtle": "", "ghost": "", "link": "" }, "size": { "xs": { "base": "px-2 py-1 text-xs gap-1", "leadingIcon": "size-4", "leadingAvatarSize": "3xs", "trailingIcon": "size-4" }, "sm": { "base": "px-2.5 py-1.5 text-xs gap-1.5", "leadingIcon": "size-4", "leadingAvatarSize": "3xs", "trailingIcon": "size-4" }, "md": { "base": "px-2.5 py-1.5 text-sm gap-1.5", "leadingIcon": "size-5", "leadingAvatarSize": "2xs", "trailingIcon": "size-5" }, "lg": { "base": "px-3 py-2 text-sm gap-2", "leadingIcon": "size-5", "leadingAvatarSize": "2xs", "trailingIcon": "size-5" }, "xl": { "base": "px-3 py-2 text-base gap-2", "leadingIcon": "size-6", "leadingAvatarSize": "xs", "trailingIcon": "size-6" } }, "block": { "true": { "base": "w-full justify-center", "trailingIcon": "ms-auto" } }, "square": { "true": "" }, "leading": { "true": "" }, "trailing": { "true": "" }, "loading": { "true": "" }, "active": { "true": { "base": "" }, "false": { "base": "" } } }, "compoundVariants": [ { "color": "primary", "variant": "solid", "class": "text-inverted bg-primary hover:bg-primary/75 active:bg-primary/75 disabled:bg-primary aria-disabled:bg-primary outline-primary/25 focus-visible:outline-3" }, { "color": "success", "variant": "solid", "class": "text-inverted bg-success hover:bg-success/75 active:bg-success/75 disabled:bg-success aria-disabled:bg-success outline-success/25 focus-visible:outline-3" }, { "color": "info", "variant": "solid", "class": "text-inverted bg-info hover:bg-info/75 active:bg-info/75 disabled:bg-info aria-disabled:bg-info outline-info/25 focus-visible:outline-3" }, { "color": "warning", "variant": "solid", "class": "text-inverted bg-warning hover:bg-warning/75 active:bg-warning/75 disabled:bg-warning aria-disabled:bg-warning outline-warning/25 focus-visible:outline-3" }, { "color": "error", "variant": "solid", "class": "text-inverted bg-error hover:bg-error/75 active:bg-error/75 disabled:bg-error aria-disabled:bg-error outline-error/25 focus-visible:outline-3" }, { "color": "primary", "variant": "outline", "class": "ring ring-inset ring-primary/50 text-primary hover:bg-primary/10 active:bg-primary/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary" }, { "color": "success", "variant": "outline", "class": "ring ring-inset ring-success/50 text-success hover:bg-success/10 active:bg-success/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-success/25 focus-visible:outline-3 focus-visible:ring-success" }, { "color": "info", "variant": "outline", "class": "ring ring-inset ring-info/50 text-info hover:bg-info/10 active:bg-info/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-info/25 focus-visible:outline-3 focus-visible:ring-info" }, { "color": "warning", "variant": "outline", "class": "ring ring-inset ring-warning/50 text-warning hover:bg-warning/10 active:bg-warning/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning" }, { "color": "error", "variant": "outline", "class": "ring ring-inset ring-error/50 text-error hover:bg-error/10 active:bg-error/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent outline-error/25 focus-visible:outline-3 focus-visible:ring-error" }, { "color": "primary", "variant": "soft", "class": "text-primary bg-primary/10 hover:bg-primary/15 active:bg-primary/15 outline-primary/25 focus-visible:outline-3 disabled:bg-primary/10 aria-disabled:bg-primary/10" }, { "color": "success", "variant": "soft", "class": "text-success bg-success/10 hover:bg-success/15 active:bg-success/15 outline-success/25 focus-visible:outline-3 disabled:bg-success/10 aria-disabled:bg-success/10" }, { "color": "info", "variant": "soft", "class": "text-info bg-info/10 hover:bg-info/15 active:bg-info/15 outline-info/25 focus-visible:outline-3 disabled:bg-info/10 aria-disabled:bg-info/10" }, { "color": "warning", "variant": "soft", "class": "text-warning bg-warning/10 hover:bg-warning/15 active:bg-warning/15 outline-warning/25 focus-visible:outline-3 disabled:bg-warning/10 aria-disabled:bg-warning/10" }, { "color": "error", "variant": "soft", "class": "text-error bg-error/10 hover:bg-error/15 active:bg-error/15 outline-error/25 focus-visible:outline-3 disabled:bg-error/10 aria-disabled:bg-error/10" }, { "color": "primary", "variant": "subtle", "class": "text-primary ring ring-inset ring-primary/25 bg-primary/10 hover:bg-primary/15 active:bg-primary/15 disabled:bg-primary/10 aria-disabled:bg-primary/10 outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary" }, { "color": "success", "variant": "subtle", "class": "text-success ring ring-inset ring-success/25 bg-success/10 hover:bg-success/15 active:bg-success/15 disabled:bg-success/10 aria-disabled:bg-success/10 outline-success/25 focus-visible:outline-3 focus-visible:ring-success" }, { "color": "info", "variant": "subtle", "class": "text-info ring ring-inset ring-info/25 bg-info/10 hover:bg-info/15 active:bg-info/15 disabled:bg-info/10 aria-disabled:bg-info/10 outline-info/25 focus-visible:outline-3 focus-visible:ring-info" }, { "color": "warning", "variant": "subtle", "class": "text-warning ring ring-inset ring-warning/25 bg-warning/10 hover:bg-warning/15 active:bg-warning/15 disabled:bg-warning/10 aria-disabled:bg-warning/10 outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning" }, { "color": "error", "variant": "subtle", "class": "text-error ring ring-inset ring-error/25 bg-error/10 hover:bg-error/15 active:bg-error/15 disabled:bg-error/10 aria-disabled:bg-error/10 outline-error/25 focus-visible:outline-3 focus-visible:ring-error" }, { "color": "primary", "variant": "ghost", "class": "text-primary hover:bg-primary/10 active:bg-primary/10 outline-primary/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent" }, { "color": "success", "variant": "ghost", "class": "text-success hover:bg-success/10 active:bg-success/10 outline-success/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent" }, { "color": "info", "variant": "ghost", "class": "text-info hover:bg-info/10 active:bg-info/10 outline-info/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent" }, { "color": "warning", "variant": "ghost", "class": "text-warning hover:bg-warning/10 active:bg-warning/10 outline-warning/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent" }, { "color": "error", "variant": "ghost", "class": "text-error hover:bg-error/10 active:bg-error/10 outline-error/25 focus-visible:outline-3 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent" }, { "color": "primary", "variant": "link", "class": "text-primary hover:text-primary/75 active:text-primary/75 disabled:text-primary aria-disabled:text-primary outline-primary/25 focus-visible:outline-3" }, { "color": "success", "variant": "link", "class": "text-success hover:text-success/75 active:text-success/75 disabled:text-success aria-disabled:text-success outline-success/25 focus-visible:outline-3" }, { "color": "info", "variant": "link", "class": "text-info hover:text-info/75 active:text-info/75 disabled:text-info aria-disabled:text-info outline-info/25 focus-visible:outline-3" }, { "color": "warning", "variant": "link", "class": "text-warning hover:text-warning/75 active:text-warning/75 disabled:text-warning aria-disabled:text-warning outline-warning/25 focus-visible:outline-3" }, { "color": "error", "variant": "link", "class": "text-error hover:text-error/75 active:text-error/75 disabled:text-error aria-disabled:text-error outline-error/25 focus-visible:outline-3" }, { "color": "neutral", "variant": "solid", "class": "text-inverted bg-inverted hover:bg-inverted/90 active:bg-inverted/90 disabled:bg-inverted aria-disabled:bg-inverted outline-inverted/25 focus-visible:outline-3" }, { "color": "neutral", "variant": "outline", "class": "ring ring-inset ring-accented text-default bg-default hover:bg-elevated active:bg-elevated disabled:bg-default aria-disabled:bg-default outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted" }, { "color": "neutral", "variant": "soft", "class": "text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 outline-inverted/25 focus-visible:outline-3 disabled:bg-elevated aria-disabled:bg-elevated" }, { "color": "neutral", "variant": "subtle", "class": "ring ring-inset ring-accented text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted" }, { "color": "neutral", "variant": "ghost", "class": "text-default hover:bg-elevated active:bg-elevated outline-inverted/25 focus-visible:outline-3 hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent" }, { "color": "neutral", "variant": "link", "class": "text-muted hover:text-default active:text-default disabled:text-muted aria-disabled:text-muted outline-inverted/25 focus-visible:outline-3" }, { "size": "xs", "square": true, "class": "p-1" }, { "size": "sm", "square": true, "class": "p-1.5" }, { "size": "md", "square": true, "class": "p-1.5" }, { "size": "lg", "square": true, "class": "p-2" }, { "size": "xl", "square": true, "class": "p-2" }, { "loading": true, "leading": true, "class": { "leadingIcon": "animate-spin" } }, { "loading": true, "leading": false, "trailing": true, "class": { "trailingIcon": "animate-spin" } } ], "defaultVariants": { "color": "primary", "variant": "solid", "size": "md" } }; const _sfc_main$G = { __name: "Button", props: { label: { type: String, required: false }, color: { type: null, required: false }, activeColor: { type: null, required: false }, variant: { type: null, required: false }, activeVariant: { type: null, required: false }, size: { type: null, required: false }, square: { type: Boolean, required: false }, block: { type: Boolean, required: false }, loadingAuto: { type: Boolean, required: false }, onClick: { type: [Function, Array], required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, icon: { type: null, required: false }, avatar: { type: Object, required: false }, leading: { type: Boolean, required: false }, leadingIcon: { type: null, required: false }, trailing: { type: Boolean, required: false }, trailingIcon: { type: null, required: false }, loading: { type: Boolean, required: false }, loadingIcon: { type: null, required: false }, as: { type: null, required: false }, type: { type: null, required: false }, disabled: { type: Boolean, required: false }, active: { type: Boolean, required: false }, exact: { type: Boolean, required: false }, exactQuery: { type: [Boolean, String], required: false }, exactHash: { type: Boolean, required: false }, inactiveClass: { type: String, required: false }, locale: { type: [Boolean, String], required: false }, to: { type: null, required: false }, href: { type: null, required: false }, external: { type: Boolean, required: false }, target: { type: [String, Object, null], required: false }, rel: { type: [String, Object, null], required: false }, noRel: { type: Boolean, required: false }, prefetchedClass: { type: String, required: false }, prefetch: { type: Boolean, required: false }, prefetchOn: { type: [String, Object], required: false }, noPrefetch: { type: Boolean, required: false }, trailingSlash: { type: String, required: false }, activeClass: { type: String, required: false }, exactActiveClass: { type: String, required: false }, ariaCurrentValue: { type: String, required: false }, viewTransition: { type: Boolean, required: false }, replace: { type: Boolean, required: false } }, setup(__props) { const _props = __props; const slots = vue.useSlots(); const props = useComponentProps("button", _props); const appConfig2 = useAppConfig(); const { orientation, size: buttonSize } = useFieldGroup(_props); const linkProps = useForwardProps(vue.computed(() => pickLinkProps(props))); const forwardedLinkProps = vue.computed(() => omit(linkProps.value, ["type", "disabled", "onClick"])); const loadingAutoState = vue.ref(false); const formLoading = vue.inject(formLoadingInjectionKey, void 0); async function onClickWrapper(event) { loadingAutoState.value = true; const callbacks = Array.isArray(props.onClick) ? props.onClick : [props.onClick]; try { await Promise.all(callbacks.map((fn) => fn == null ? void 0 : fn(event))); } finally { loadingAutoState.value = false; } } const isLoading = vue.computed(() => { return props.loading || props.loadingAuto && (loadingAutoState.value || (formLoading == null ? void 0 : formLoading.value) && props.type === "submit"); }); const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons( vue.computed(() => ({ icon: props.icon, leading: props.leading, leadingIcon: props.leadingIcon, trailing: props.trailing, trailingIcon: props.trailingIcon, loading: isLoading.value, loadingIcon: props.loadingIcon })) ); const ui2 = vue.computed(() => { var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l; return tv({ extend: theme$k, ...defu({ variants: { active: { true: { base: mergeClasses((_e2 = (_d = (_c = (_b = (_a2 = appConfig2.ui) == null ? void 0 : _a2.button) == null ? void 0 : _b.variants) == null ? void 0 : _c.active) == null ? void 0 : _d.true) == null ? void 0 : _e2.base, props.activeClass) }, false: { base: mergeClasses((_j = (_i = (_h = (_g = (_f = appConfig2.ui) == null ? void 0 : _f.button) == null ? void 0 : _g.variants) == null ? void 0 : _h.active) == null ? void 0 : _i.false) == null ? void 0 : _j.base, props.inactiveClass) } } } }, ((_k = appConfig2.ui) == null ? void 0 : _k.button) || {}) })({ color: props.color, variant: props.variant, size: (_l = buttonSize.value) != null ? _l : props.size, loading: isLoading.value, block: props.block, square: props.square || !slots.default && !props.label, leading: isLeading.value, trailing: isTrailing.value, fieldGroup: orientation.value }); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(_sfc_main$H, vue.mergeProps({ type: vue.unref(props).type, disabled: vue.unref(props).disabled || isLoading.value }, forwardedLinkProps.value, { custom: "" }), { default: vue.withCtx(({ active, ...slotProps }) => { var _a2; return [ vue.createVNode(_sfc_main$I, vue.mergeProps({ "data-slot": "base" }, slotProps, { class: ui2.value.base({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.base, vue.unref(props).class], active, ...active && vue.unref(props).activeVariant ? { variant: vue.unref(props).activeVariant } : {}, ...active && vue.unref(props).activeColor ? { color: vue.unref(props).activeColor } : {} }), onClick: onClickWrapper }), { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "leading", { ui: ui2.value }, () => { var _a3, _b, _c; return [ vue.unref(isLeading) && vue.unref(leadingIconName) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(leadingIconName), "data-slot": "leadingIcon", class: vue.normalizeClass(ui2.value.leadingIcon({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.leadingIcon, active })) }, null, 8, ["name", "class"])) : !!vue.unref(props).avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 1, size: ((_b = vue.unref(props).ui) == null ? void 0 : _b.leadingAvatarSize) || ui2.value.leadingAvatarSize() }, vue.unref(props).avatar, { "data-slot": "leadingAvatar", class: ui2.value.leadingAvatar({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.leadingAvatar, active }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true) ]; }), vue.renderSlot(_ctx.$slots, "default", { ui: ui2.value }, () => { var _a3; return [ vue.unref(props).label !== void 0 && vue.unref(props).label !== null ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "data-slot": "label", class: vue.normalizeClass(ui2.value.label({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.label, active })) }, vue.toDisplayString(vue.unref(props).label), 3)) : vue.createCommentVNode("", true) ]; }), vue.renderSlot(_ctx.$slots, "trailing", { ui: ui2.value }, () => { var _a3; return [ vue.unref(isTrailing) && vue.unref(trailingIconName) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(trailingIconName), "data-slot": "trailingIcon", class: vue.normalizeClass(ui2.value.trailingIcon({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.trailingIcon, active })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ]; }) ]), _: 2 }, 1040, ["class"]) ]; }), _: 3 }, 16, ["type", "disabled"]); }; } }; const theme$j = { "slots": { "root": "relative overflow-hidden w-full rounded-lg p-4 flex gap-2.5", "wrapper": "min-w-0 flex-1 flex flex-col", "title": "text-sm font-medium", "description": "text-sm opacity-90", "icon": "shrink-0 size-5", "avatar": "shrink-0", "avatarSize": "2xl", "actions": "flex flex-wrap gap-1.5 shrink-0", "close": "p-0" }, "variants": { "color": { "primary": "", "success": "", "info": "", "warning": "", "error": "", "neutral": "" }, "variant": { "solid": "", "outline": "", "soft": "", "subtle": "" }, "orientation": { "horizontal": { "root": "items-center", "actions": "items-center" }, "vertical": { "root": "items-start", "actions": "items-start mt-2.5" } }, "title": { "true": { "description": "mt-1" } } }, "compoundVariants": [ { "color": "primary", "variant": "solid", "class": { "root": "bg-primary text-inverted" } }, { "color": "success", "variant": "solid", "class": { "root": "bg-success text-inverted" } }, { "color": "info", "variant": "solid", "class": { "root": "bg-info text-inverted" } }, { "color": "warning", "variant": "solid", "class": { "root": "bg-warning text-inverted" } }, { "color": "error", "variant": "solid", "class": { "root": "bg-error text-inverted" } }, { "color": "primary", "variant": "outline", "class": { "root": "text-primary ring ring-inset ring-primary/25" } }, { "color": "success", "variant": "outline", "class": { "root": "text-success ring ring-inset ring-success/25" } }, { "color": "info", "variant": "outline", "class": { "root": "text-info ring ring-inset ring-info/25" } }, { "color": "warning", "variant": "outline", "class": { "root": "text-warning ring ring-inset ring-warning/25" } }, { "color": "error", "variant": "outline", "class": { "root": "text-error ring ring-inset ring-error/25" } }, { "color": "primary", "variant": "soft", "class": { "root": "bg-primary/10 text-primary" } }, { "color": "success", "variant": "soft", "class": { "root": "bg-success/10 text-success" } }, { "color": "info", "variant": "soft", "class": { "root": "bg-info/10 text-info" } }, { "color": "warning", "variant": "soft", "class": { "root": "bg-warning/10 text-warning" } }, { "color": "error", "variant": "soft", "class": { "root": "bg-error/10 text-error" } }, { "color": "primary", "variant": "subtle", "class": { "root": "bg-primary/10 text-primary ring ring-inset ring-primary/25" } }, { "color": "success", "variant": "subtle", "class": { "root": "bg-success/10 text-success ring ring-inset ring-success/25" } }, { "color": "info", "variant": "subtle", "class": { "root": "bg-info/10 text-info ring ring-inset ring-info/25" } }, { "color": "warning", "variant": "subtle", "class": { "root": "bg-warning/10 text-warning ring ring-inset ring-warning/25" } }, { "color": "error", "variant": "subtle", "class": { "root": "bg-error/10 text-error ring ring-inset ring-error/25" } }, { "color": "neutral", "variant": "solid", "class": { "root": "text-inverted bg-inverted" } }, { "color": "neutral", "variant": "outline", "class": { "root": "text-highlighted bg-default ring ring-inset ring-default" } }, { "color": "neutral", "variant": "soft", "class": { "root": "text-highlighted bg-elevated/50" } }, { "color": "neutral", "variant": "subtle", "class": { "root": "text-highlighted bg-elevated/50 ring ring-inset ring-accented" } } ], "defaultVariants": { "color": "primary", "variant": "solid" } }; const _sfc_main$F = { __name: "Alert", props: { as: { type: null, required: false }, title: { type: String, required: false }, description: { type: String, required: false }, icon: { type: null, required: false }, avatar: { type: Object, required: false }, color: { type: null, required: false }, variant: { type: null, required: false }, orientation: { type: null, required: false, default: "vertical" }, actions: { type: Array, required: false }, close: { type: [Boolean, Object], required: false }, closeIcon: { type: null, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false } }, emits: ["update:open"], setup(__props, { emit: __emit }) { const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("alert", _props); const { t } = useLocale$1(); const appConfig2 = useAppConfig(); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$j, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.alert) || {} })({ color: props.color, variant: props.variant, orientation: props.orientation, title: !!props.title || !!slots.title }); }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: vue.unref(props).as, "data-orientation": vue.unref(props).orientation, "data-slot": "root", class: vue.normalizeClass(ui2.value.root({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.root, vue.unref(props).class] })) }, { default: vue.withCtx(() => { var _a3, _b, _c, _d, _e2, _f, _g, _h; return [ vue.renderSlot(_ctx.$slots, "leading", { ui: ui2.value }, () => { var _a4, _b2, _c2; return [ vue.unref(props).avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 0, size: ((_a4 = vue.unref(props).ui) == null ? void 0 : _a4.avatarSize) || ui2.value.avatarSize() }, vue.unref(props).avatar, { "data-slot": "avatar", class: ui2.value.avatar({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.avatar }) }), null, 16, ["size", "class"])) : vue.unref(props).icon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 1, name: vue.unref(props).icon, "data-slot": "icon", class: vue.normalizeClass(ui2.value.icon({ class: (_c2 = vue.unref(props).ui) == null ? void 0 : _c2.icon })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ]; }), vue.createElementVNode("div", { "data-slot": "wrapper", class: vue.normalizeClass(ui2.value.wrapper({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.wrapper })) }, [ vue.unref(props).title || !!slots.title ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "title", class: vue.normalizeClass(ui2.value.title({ class: (_b = vue.unref(props).ui) == null ? void 0 : _b.title })) }, [ vue.renderSlot(_ctx.$slots, "title", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).title), 1) ]) ], 2)) : vue.createCommentVNode("", true), vue.unref(props).description || !!slots.description ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, "data-slot": "description", class: vue.normalizeClass(ui2.value.description({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.description })) }, [ vue.renderSlot(_ctx.$slots, "description", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).description), 1) ]) ], 2)) : vue.createCommentVNode("", true), vue.unref(props).orientation === "vertical" && (((_d = vue.unref(props).actions) == null ? void 0 : _d.length) || !!slots.actions) ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, "data-slot": "actions", class: vue.normalizeClass(ui2.value.actions({ class: (_e2 = vue.unref(props).ui) == null ? void 0 : _e2.actions })) }, [ vue.renderSlot(_ctx.$slots, "actions", {}, () => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).actions, (action, index) => { return vue.openBlock(), vue.createBlock(_sfc_main$G, vue.mergeProps({ key: index, size: "xs" }, { ref_for: true }, action), null, 16); }), 128)) ]) ], 2)) : vue.createCommentVNode("", true) ], 2), vue.unref(props).orientation === "horizontal" && (((_f = vue.unref(props).actions) == null ? void 0 : _f.length) || !!slots.actions) || vue.unref(props).close ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "actions", class: vue.normalizeClass(ui2.value.actions({ class: (_g = vue.unref(props).ui) == null ? void 0 : _g.actions, orientation: "horizontal" })) }, [ vue.unref(props).orientation === "horizontal" && (((_h = vue.unref(props).actions) == null ? void 0 : _h.length) || !!slots.actions) ? vue.renderSlot(_ctx.$slots, "actions", {}, () => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).actions, (action, index) => { return vue.openBlock(), vue.createBlock(_sfc_main$G, vue.mergeProps({ key: index, size: "xs" }, { ref_for: true }, action), null, 16); }), 128)) ], void 0, 0) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "close", { ui: ui2.value }, () => { var _a4; return [ vue.unref(props).close ? (vue.openBlock(), vue.createBlock(_sfc_main$G, vue.mergeProps({ key: 0, icon: vue.unref(props).closeIcon || vue.unref(appConfig2).ui.icons.close, color: "neutral", variant: "link", "aria-label": vue.unref(t)("alert.close") }, typeof vue.unref(props).close === "object" ? vue.unref(props).close : {}, { "data-slot": "close", class: ui2.value.close({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.close }), onClick: _cache[0] || (_cache[0] = ($event) => emits("update:open", false)) }), null, 16, ["icon", "aria-label", "class"])) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true) ]; }), _: 3 }, 8, ["as", "data-orientation", "class"]); }; } }; const theme$i = { "slots": { "root": "relative inline-flex items-center", "base": [ "w-full rounded-md border-0 appearance-none placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75", "transition-colors" ], "leading": "absolute inset-y-0 start-0 flex items-center", "leadingIcon": "shrink-0 text-dimmed", "leadingAvatar": "shrink-0", "leadingAvatarSize": "", "trailing": "absolute inset-y-0 end-0 flex items-center", "trailingIcon": "shrink-0 text-dimmed" }, "variants": { "fieldGroup": { "horizontal": { "root": "group has-focus-visible:z-[1]", "base": "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none" }, "vertical": { "root": "group has-focus-visible:z-[1]", "base": "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none" } }, "size": { "xs": { "base": "px-2 py-1 text-sm/4 gap-1", "leading": "ps-2", "trailing": "pe-2", "leadingIcon": "size-4", "leadingAvatarSize": "3xs", "trailingIcon": "size-4" }, "sm": { "base": "px-2.5 py-1.5 text-sm/4 gap-1.5", "leading": "ps-2.5", "trailing": "pe-2.5", "leadingIcon": "size-4", "leadingAvatarSize": "3xs", "trailingIcon": "size-4" }, "md": { "base": "px-2.5 py-1.5 text-base/5 gap-1.5", "leading": "ps-2.5", "trailing": "pe-2.5", "leadingIcon": "size-5", "leadingAvatarSize": "2xs", "trailingIcon": "size-5" }, "lg": { "base": "px-3 py-2 text-base/5 gap-2", "leading": "ps-3", "trailing": "pe-3", "leadingIcon": "size-5", "leadingAvatarSize": "2xs", "trailingIcon": "size-5" }, "xl": { "base": "px-3 py-2 text-base gap-2", "leading": "ps-3", "trailing": "pe-3", "leadingIcon": "size-6", "leadingAvatarSize": "xs", "trailingIcon": "size-6" } }, "variant": { "outline": "text-highlighted bg-default ring ring-inset ring-accented", "soft": "text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50", "subtle": "text-highlighted bg-elevated ring ring-inset ring-accented", "ghost": "text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent", "none": "text-highlighted bg-transparent focus:outline-none" }, "color": { "primary": "", "success": "", "info": "", "warning": "", "error": "", "neutral": "" }, "leading": { "true": "" }, "trailing": { "true": "" }, "loading": { "true": "" }, "highlight": { "true": "" }, "fixed": { "false": "" }, "type": { "file": "file:me-1.5 file:font-medium file:text-muted file:outline-none" } }, "compoundVariants": [ { "color": "primary", "variant": [ "outline", "subtle" ], "class": "outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary" }, { "color": "success", "variant": [ "outline", "subtle" ], "class": "outline-success/25 focus-visible:outline-3 focus-visible:ring-success" }, { "color": "info", "variant": [ "outline", "subtle" ], "class": "outline-info/25 focus-visible:outline-3 focus-visible:ring-info" }, { "color": "warning", "variant": [ "outline", "subtle" ], "class": "outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning" }, { "color": "error", "variant": [ "outline", "subtle" ], "class": "outline-error/25 focus-visible:outline-3 focus-visible:ring-error" }, { "color": "primary", "variant": [ "soft", "ghost" ], "class": "outline-primary/25 focus-visible:outline-3" }, { "color": "success", "variant": [ "soft", "ghost" ], "class": "outline-success/25 focus-visible:outline-3" }, { "color": "info", "variant": [ "soft", "ghost" ], "class": "outline-info/25 focus-visible:outline-3" }, { "color": "warning", "variant": [ "soft", "ghost" ], "class": "outline-warning/25 focus-visible:outline-3" }, { "color": "error", "variant": [ "soft", "ghost" ], "class": "outline-error/25 focus-visible:outline-3" }, { "color": "primary", "highlight": true, "class": "ring ring-inset ring-primary" }, { "color": "success", "highlight": true, "class": "ring ring-inset ring-success" }, { "color": "info", "highlight": true, "class": "ring ring-inset ring-info" }, { "color": "warning", "highlight": true, "class": "ring ring-inset ring-warning" }, { "color": "error", "highlight": true, "class": "ring ring-inset ring-error" }, { "color": "neutral", "variant": [ "outline", "subtle" ], "class": "outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted" }, { "color": "neutral", "variant": [ "soft", "ghost" ], "class": "outline-inverted/25 focus-visible:outline-3" }, { "color": "neutral", "highlight": true, "class": "ring ring-inset ring-inverted" }, { "leading": true, "size": "xs", "class": "ps-7" }, { "leading": true, "size": "sm", "class": "ps-8" }, { "leading": true, "size": "md", "class": "ps-9" }, { "leading": true, "size": "lg", "class": "ps-10" }, { "leading": true, "size": "xl", "class": "ps-11" }, { "trailing": true, "size": "xs", "class": "pe-7" }, { "trailing": true, "size": "sm", "class": "pe-8" }, { "trailing": true, "size": "md", "class": "pe-9" }, { "trailing": true, "size": "lg", "class": "pe-10" }, { "trailing": true, "size": "xl", "class": "pe-11" }, { "loading": true, "leading": true, "class": { "leadingIcon": "animate-spin" } }, { "loading": true, "leading": false, "trailing": true, "class": { "trailingIcon": "animate-spin" } }, { "fixed": false, "size": "xs", "class": "md:text-xs" }, { "fixed": false, "size": "sm", "class": "md:text-xs" }, { "fixed": false, "size": "md", "class": "md:text-sm" }, { "fixed": false, "size": "lg", "class": "md:text-sm" } ], "defaultVariants": { "size": "md", "color": "primary", "variant": "outline" } }; const _hoisted_1$j = ["id", "type", "value", "name", "placeholder", "disabled", "required", "autocomplete"]; const _sfc_main$E = Object.assign({ inheritAttrs: false }, { __name: "Input", props: { as: { type: null, required: false }, id: { type: String, required: false }, name: { type: String, required: false }, type: { type: null, required: false, default: "text" }, placeholder: { type: String, required: false }, color: { type: null, required: false }, variant: { type: null, required: false }, size: { type: null, required: false }, required: { type: Boolean, required: false }, autocomplete: { type: [String, Object], required: false, default: "off" }, autofocus: { type: Boolean, required: false }, autofocusDelay: { type: Number, required: false, default: 0 }, disabled: { type: Boolean, required: false }, highlight: { type: Boolean, required: false }, fixed: { type: Boolean, required: false }, modelValue: { type: null, required: false }, defaultValue: { type: null, required: false }, modelModifiers: { type: null, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, icon: { type: null, required: false }, avatar: { type: Object, required: false }, leading: { type: Boolean, required: false }, leadingIcon: { type: null, required: false }, trailing: { type: Boolean, required: false }, trailingIcon: { type: null, required: false }, loading: { type: Boolean, required: false }, loadingIcon: { type: null, required: false } }, emits: ["update:modelValue", "blur", "change"], setup(__props, { expose: __expose, emit: __emit }) { const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("input", _props); const modelValue = useVModel$1(props, "modelValue", emits, { defaultValue: props.defaultValue }); const appConfig2 = useAppConfig(); const { emitFormBlur, emitFormInput, emitFormChange, size: formFieldSize, color: formFieldColor, id, name, highlight: formFieldHighlight, disabled: formFieldDisabled, emitFormFocus, ariaAttrs } = useFormField(_props, { deferInputValidation: true }); const { orientation, size: fieldGroupSize } = useFieldGroup(_props); const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props); const color = vue.computed(() => { var _a2; return (_a2 = formFieldColor.value) != null ? _a2 : props.color; }); const highlight = vue.computed(() => { var _a2; return (_a2 = formFieldHighlight.value) != null ? _a2 : props.highlight; }); const size2 = vue.computed(() => { var _a2, _b; return (_b = (_a2 = fieldGroupSize.value) != null ? _a2 : formFieldSize.value) != null ? _b : props.size; }); const disabled = vue.computed(() => { var _a2; return (_a2 = formFieldDisabled.value) != null ? _a2 : props.disabled; }); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$i, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.input) || {} })({ type: props.type, color: color.value, variant: props.variant, size: size2.value, loading: props.loading, highlight: highlight.value, fixed: props.fixed, leading: isLeading.value || !!props.avatar || !!slots.leading, trailing: isTrailing.value || !!slots.trailing, fieldGroup: orientation.value }); }); const inputRef = vue.useTemplateRef("inputRef"); function updateInput(value) { var _a2, _b, _c, _d, _e2, _f; if (((_a2 = props.modelModifiers) == null ? void 0 : _a2.trim) && (typeof value === "string" || value === null || value === void 0)) { value = (_b = value == null ? void 0 : value.trim()) != null ? _b : null; } if (((_c = props.modelModifiers) == null ? void 0 : _c.number) || props.type === "number") { value = looseToNumber(value); } if (((_d = props.modelModifiers) == null ? void 0 : _d.nullable) && isEmpty(value)) { value = null; } if (((_e2 = props.modelModifiers) == null ? void 0 : _e2.optional) && !((_f = props.modelModifiers) == null ? void 0 : _f.nullable) && value !== null && isEmpty(value)) { value = void 0; } modelValue.value = value; emitFormInput(); } function onInput(event) { var _a2; if (!((_a2 = props.modelModifiers) == null ? void 0 : _a2.lazy)) { updateInput(event.target.value); } } function onChange(event) { var _a2, _b; const value = event.target.value; if ((_a2 = props.modelModifiers) == null ? void 0 : _a2.lazy) { updateInput(value); } if ((_b = props.modelModifiers) == null ? void 0 : _b.trim) { event.target.value = value.trim(); } emitFormChange(); emits("change", event); } function onBlur(event) { emitFormBlur(); emits("blur", event); } function autoFocus() { var _a2; if (props.autofocus) { (_a2 = inputRef.value) == null ? void 0 : _a2.focus(); } } let autofocusTimeoutId; vue.onMounted(() => { autofocusTimeoutId = setTimeout(() => { autoFocus(); }, props.autofocusDelay); }); vue.onScopeDispose(() => clearTimeout(autofocusTimeoutId)); __expose({ inputRef }); return (_ctx, _cache) => { var _a2, _b; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: vue.unref(props).as, "data-slot": (_a2 = _ctx.$attrs["data-slot"]) != null ? _a2 : "root", class: vue.normalizeClass(ui2.value.root({ class: [(_b = vue.unref(props).ui) == null ? void 0 : _b.root, vue.unref(props).class] })) }, { default: vue.withCtx(() => { var _a3, _b2, _c; return [ vue.createElementVNode("input", vue.mergeProps({ id: vue.unref(id), ref_key: "inputRef", ref: inputRef, type: vue.unref(props).type, value: vue.unref(modelValue), name: vue.unref(name), placeholder: vue.unref(props).placeholder, class: ui2.value.base({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.base }), disabled: disabled.value, required: vue.unref(props).required, autocomplete: vue.unref(props).autocomplete }, { ..._ctx.$attrs, ...vue.unref(ariaAttrs) }, { "data-slot": "base", onInput, onBlur, onChange, onFocus: _cache[0] || (_cache[0] = (...args) => vue.unref(emitFormFocus) && vue.unref(emitFormFocus)(...args)) }), null, 16, _hoisted_1$j), vue.renderSlot(_ctx.$slots, "default", { ui: ui2.value }), vue.unref(isLeading) || !!vue.unref(props).avatar || !!slots.leading ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "data-slot": "leading", class: vue.normalizeClass(ui2.value.leading({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.leading })) }, [ vue.renderSlot(_ctx.$slots, "leading", { ui: ui2.value }, () => { var _a4, _b3, _c2; return [ vue.unref(isLeading) && vue.unref(leadingIconName) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(leadingIconName), "data-slot": "leadingIcon", class: vue.normalizeClass(ui2.value.leadingIcon({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.leadingIcon })) }, null, 8, ["name", "class"])) : !!vue.unref(props).avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 1, size: ((_b3 = vue.unref(props).ui) == null ? void 0 : _b3.leadingAvatarSize) || ui2.value.leadingAvatarSize() }, vue.unref(props).avatar, { "data-slot": "leadingAvatar", class: ui2.value.leadingAvatar({ class: (_c2 = vue.unref(props).ui) == null ? void 0 : _c2.leadingAvatar }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true), vue.unref(isTrailing) || !!slots.trailing ? (vue.openBlock(), vue.createElementBlock("span", { key: 1, "data-slot": "trailing", class: vue.normalizeClass(ui2.value.trailing({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.trailing })) }, [ vue.renderSlot(_ctx.$slots, "trailing", { ui: ui2.value }, () => { var _a4; return [ vue.unref(trailingIconName) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(trailingIconName), "data-slot": "trailingIcon", class: vue.normalizeClass(ui2.value.trailingIcon({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.trailingIcon, leading: vue.unref(isLeading) })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true) ]; }), _: 3 }, 8, ["as", "data-slot", "class"]); }; } }); const theme$h = { "slots": { "base": [ "group relative inline-flex items-center rounded-md select-none", "transition-colors" ], "leading": "absolute inset-y-0 start-0 flex items-center", "leadingIcon": "shrink-0 text-dimmed", "leadingAvatar": "shrink-0", "leadingAvatarSize": "", "trailing": "absolute inset-y-0 end-0 flex items-center", "trailingIcon": "shrink-0 text-dimmed", "segment": [ "rounded-sm text-center outline-hidden data-placeholder:text-dimmed data-[segment=literal]:text-muted data-invalid:text-error data-disabled:cursor-not-allowed data-disabled:opacity-75", "transition-colors" ], "separatorIcon": "shrink-0 size-4 text-muted" }, "variants": { "fieldGroup": { "horizontal": "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]", "vertical": "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]" }, "size": { "xs": { "base": [ "px-2 py-1 text-sm/4 gap-1", "gap-0.25" ], "leading": "ps-2", "trailing": "pe-2", "leadingIcon": "size-4", "leadingAvatarSize": "3xs", "trailingIcon": "size-4", "segment": "not-data-[segment=literal]:w-8" }, "sm": { "base": [ "px-2.5 py-1.5 text-sm/4 gap-1.5", "gap-0.5" ], "leading": "ps-2.5", "trailing": "pe-2.5", "leadingIcon": "size-4", "leadingAvatarSize": "3xs", "trailingIcon": "size-4", "segment": "not-data-[segment=literal]:w-8" }, "md": { "base": [ "px-2.5 py-1.5 text-base/5 gap-1.5", "gap-0.5" ], "leading": "ps-2.5", "trailing": "pe-2.5", "leadingIcon": "size-5", "leadingAvatarSize": "2xs", "trailingIcon": "size-5", "segment": "not-data-[segment=literal]:w-9" }, "lg": { "base": [ "px-3 py-2 text-base/5 gap-2", "gap-0.75" ], "leading": "ps-3", "trailing": "pe-3", "leadingIcon": "size-5", "leadingAvatarSize": "2xs", "trailingIcon": "size-5", "segment": "not-data-[segment=literal]:w-9" }, "xl": { "base": [ "px-3 py-2 text-base gap-2", "gap-0.75" ], "leading": "ps-3", "trailing": "pe-3", "leadingIcon": "size-6", "leadingAvatarSize": "xs", "trailingIcon": "size-6", "segment": "not-data-[segment=literal]:w-10" } }, "variant": { "outline": "text-highlighted bg-default ring ring-inset ring-accented", "soft": "text-highlighted bg-elevated/50 hover:bg-elevated has-focus:bg-elevated disabled:bg-elevated/50", "subtle": "text-highlighted bg-elevated ring ring-inset ring-accented", "ghost": "text-highlighted bg-transparent hover:bg-elevated has-focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent", "none": "text-highlighted bg-transparent has-focus:outline-none" }, "color": { "primary": "", "success": "", "info": "", "warning": "", "error": "", "neutral": "" }, "leading": { "true": "" }, "trailing": { "true": "" }, "loading": { "true": "" }, "highlight": { "true": "" }, "fixed": { "false": "" }, "type": { "file": "file:me-1.5 file:font-medium file:text-muted file:outline-none" } }, "compoundVariants": [ { "color": "primary", "variant": [ "outline", "subtle" ], "class": "outline-primary/25 has-focus-visible:outline-3 has-focus-visible:ring-primary" }, { "color": "success", "variant": [ "outline", "subtle" ], "class": "outline-success/25 has-focus-visible:outline-3 has-focus-visible:ring-success" }, { "color": "info", "variant": [ "outline", "subtle" ], "class": "outline-info/25 has-focus-visible:outline-3 has-focus-visible:ring-info" }, { "color": "warning", "variant": [ "outline", "subtle" ], "class": "outline-warning/25 has-focus-visible:outline-3 has-focus-visible:ring-warning" }, { "color": "error", "variant": [ "outline", "subtle" ], "class": "outline-error/25 has-focus-visible:outline-3 has-focus-visible:ring-error" }, { "color": "primary", "variant": [ "soft", "ghost" ], "class": "outline-primary/25 has-focus-visible:outline-3" }, { "color": "success", "variant": [ "soft", "ghost" ], "class": "outline-success/25 has-focus-visible:outline-3" }, { "color": "info", "variant": [ "soft", "ghost" ], "class": "outline-info/25 has-focus-visible:outline-3" }, { "color": "warning", "variant": [ "soft", "ghost" ], "class": "outline-warning/25 has-focus-visible:outline-3" }, { "color": "error", "variant": [ "soft", "ghost" ], "class": "outline-error/25 has-focus-visible:outline-3" }, { "color": "primary", "highlight": true, "class": "ring ring-inset ring-primary" }, { "color": "success", "highlight": true, "class": "ring ring-inset ring-success" }, { "color": "info", "highlight": true, "class": "ring ring-inset ring-info" }, { "color": "warning", "highlight": true, "class": "ring ring-inset ring-warning" }, { "color": "error", "highlight": true, "class": "ring ring-inset ring-error" }, { "color": "neutral", "variant": [ "outline", "subtle" ], "class": "outline-inverted/25 has-focus-visible:outline-3 has-focus-visible:ring-inverted" }, { "color": "neutral", "variant": [ "soft", "ghost" ], "class": "outline-inverted/25 has-focus-visible:outline-3" }, { "color": "neutral", "highlight": true, "class": "ring ring-inset ring-inverted" }, { "leading": true, "size": "xs", "class": "ps-7" }, { "leading": true, "size": "sm", "class": "ps-8" }, { "leading": true, "size": "md", "class": "ps-9" }, { "leading": true, "size": "lg", "class": "ps-10" }, { "leading": true, "size": "xl", "class": "ps-11" }, { "trailing": true, "size": "xs", "class": "pe-7" }, { "trailing": true, "size": "sm", "class": "pe-8" }, { "trailing": true, "size": "md", "class": "pe-9" }, { "trailing": true, "size": "lg", "class": "pe-10" }, { "trailing": true, "size": "xl", "class": "pe-11" }, { "loading": true, "leading": true, "class": { "leadingIcon": "animate-spin" } }, { "loading": true, "leading": false, "trailing": true, "class": { "trailingIcon": "animate-spin" } }, { "fixed": false, "size": "xs", "class": "md:text-xs" }, { "fixed": false, "size": "sm", "class": "md:text-xs" }, { "fixed": false, "size": "md", "class": "md:text-sm" }, { "fixed": false, "size": "lg", "class": "md:text-sm" }, { "variant": "outline", "class": { "segment": "focus:bg-elevated" } }, { "variant": "soft", "class": { "segment": "focus:bg-accented/50 group-hover:focus:bg-accented" } }, { "variant": "subtle", "class": { "segment": "focus:bg-accented" } }, { "variant": "ghost", "class": { "segment": "focus:bg-elevated group-hover:focus:bg-accented" } }, { "variant": "none", "class": { "segment": "focus:bg-elevated" } } ], "defaultVariants": { "size": "md", "color": "primary", "variant": "outline" } }; const _sfc_main$D = Object.assign({ inheritAttrs: false }, { __name: "InputTime", props: { as: { type: null, required: false }, color: { type: null, required: false }, variant: { type: null, required: false }, size: { type: null, required: false }, highlight: { type: Boolean, required: false }, fixed: { type: Boolean, required: false }, autofocus: { type: Boolean, required: false }, autofocusDelay: { type: Number, required: false, default: 0 }, separatorIcon: { type: null, required: false }, range: { type: Boolean, required: false }, defaultValue: { type: null, required: false }, modelValue: { type: null, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, icon: { type: null, required: false }, avatar: { type: Object, required: false }, leading: { type: Boolean, required: false }, leadingIcon: { type: null, required: false }, trailing: { type: Boolean, required: false }, trailingIcon: { type: null, required: false }, loading: { type: Boolean, required: false }, loadingIcon: { type: null, required: false }, defaultPlaceholder: { type: Object, required: false }, placeholder: { type: Object, required: false }, hourCycle: { type: null, required: false }, step: { type: Object, required: false }, stepSnapping: { type: Boolean, required: false }, granularity: { type: String, required: false }, hideTimeZone: { type: Boolean, required: false }, maxValue: { type: Object, required: false }, minValue: { type: Object, required: false }, locale: { type: String, required: false }, disabled: { type: Boolean, required: false }, readonly: { type: Boolean, required: false }, id: { type: String, required: false }, name: { type: String, required: false }, required: { type: Boolean, required: false }, isTimeUnavailable: { type: Function, required: false } }, emits: ["update:modelValue", "change", "blur", "focus", "update:placeholder"], setup(__props, { expose: __expose, emit: __emit }) { const SingleTimeField = { Root: TimeFieldRoot_default, Input: TimeFieldInput_default }; const RangeTimeField = { Root: TimeRangeFieldRoot_default, Input: TimeRangeFieldInput_default }; const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("inputTime", _props); const { t } = useLocale$1(); const appConfig2 = useAppConfig(); const rootProps = useForwardProps(reactiveOmit(props, "id", "name", "range", "modelValue", "defaultValue", "color", "variant", "size", "highlight", "fixed", "disabled", "autofocus", "autofocusDelay", "icon", "avatar", "leading", "leadingIcon", "trailing", "trailingIcon", "loading", "loadingIcon", "separatorIcon", "class", "ui"), emits); const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color: formFieldColor, size: formFieldSize, name, highlight: formFieldHighlight, disabled: formFieldDisabled, ariaAttrs } = useFormField(_props); const { orientation, size: fieldGroupSize } = useFieldGroup(_props); const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props); const color = vue.computed(() => { var _a2; return (_a2 = formFieldColor.value) != null ? _a2 : props.color; }); const highlight = vue.computed(() => { var _a2; return (_a2 = formFieldHighlight.value) != null ? _a2 : props.highlight; }); const size2 = vue.computed(() => { var _a2, _b; return (_b = (_a2 = fieldGroupSize.value) != null ? _a2 : formFieldSize.value) != null ? _b : props.size; }); const disabled = vue.computed(() => { var _a2; return (_a2 = formFieldDisabled.value) != null ? _a2 : props.disabled; }); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$h, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.inputTime) || {} })({ color: color.value, variant: props.variant, size: size2.value, loading: props.loading, highlight: highlight.value, fixed: props.fixed, leading: isLeading.value || !!props.avatar || !!slots.leading, trailing: isTrailing.value || !!slots.trailing, fieldGroup: orientation.value }); }); const [DefineSegmentsTemplate, ReuseSegmentsTemplate] = createReusableTemplate(); const inputsRef = vue.ref([]); const TimeField = vue.computed(() => props.range ? RangeTimeField : SingleTimeField); function setInputRef(index, el) { inputsRef.value[index] = el; } function segmentLabel(part) { return part !== "literal" ? t(`inputTime.${part}`) : void 0; } function onUpdate(value) { const event = new Event("change", { target: { value } }); emits("change", event); emitFormChange(); emitFormInput(); } function onFocusOut(event) { if (event.relatedTarget && event.currentTarget.contains(event.relatedTarget)) { return; } emits("blur", event); emitFormBlur(); } function onFocusIn(event) { if (event.relatedTarget && event.currentTarget.contains(event.relatedTarget)) { return; } emits("focus", event); emitFormFocus(); } function autoFocus() { var _a2, _b; if (props.autofocus) { (_b = (_a2 = inputsRef.value[0]) == null ? void 0 : _a2.$el) == null ? void 0 : _b.focus(); } } let autofocusTimeoutId; vue.onMounted(() => { autofocusTimeoutId = setTimeout(() => { autoFocus(); }, props.autofocusDelay); }); vue.onScopeDispose(() => clearTimeout(autofocusTimeoutId)); __expose({ inputsRef }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.createVNode(vue.unref(DefineSegmentsTemplate), null, { default: vue.withCtx(({ segments, type }) => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(segments, (segment, index) => { var _a3; return vue.openBlock(), vue.createBlock(vue.unref(TimeField).Input, { key: `${segment.part}-${index}`, ref_for: true, ref: (el) => setInputRef(index, el), type, part: segment.part, "data-slot": "segment", class: vue.normalizeClass(ui2.value.segment({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.segment })), "data-segment": segment.part, "aria-label": segmentLabel(segment.part) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(segment.value.trim()), 1) ]), _: 2 }, 1032, ["type", "part", "class", "data-segment", "aria-label"]); }), 128)) ]), _: 1 }), vue.createVNode(vue.unref(TimeField).Root, vue.mergeProps({ id: vue.unref(id), "data-slot": "base" }, { ...vue.unref(rootProps), ..._ctx.$attrs, ...vue.unref(ariaAttrs) }, { name: vue.unref(name), disabled: disabled.value, "model-value": vue.unref(props).modelValue, "default-value": vue.unref(props).defaultValue, class: ui2.value.base({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.base, vue.unref(props).class] }), "onUpdate:modelValue": onUpdate, onFocusout: onFocusOut, onFocusin: onFocusIn }), { default: vue.withCtx(({ segments }) => { var _a3, _b; return [ Array.isArray(segments) ? (vue.openBlock(), vue.createBlock(vue.unref(ReuseSegmentsTemplate), { key: 0, segments }, null, 8, ["segments"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ vue.createVNode(vue.unref(ReuseSegmentsTemplate), { segments: segments.start, type: "start" }, null, 8, ["segments"]), vue.renderSlot(_ctx.$slots, "separator", { ui: ui2.value }, () => { var _a4; return [ vue.createVNode(_sfc_main$L, { name: vue.unref(props).separatorIcon || vue.unref(appConfig2).ui.icons.minus, "data-slot": "separatorIcon", class: vue.normalizeClass(ui2.value.separatorIcon({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.separatorIcon })) }, null, 8, ["name", "class"]) ]; }), vue.createVNode(vue.unref(ReuseSegmentsTemplate), { segments: segments.end, type: "end" }, null, 8, ["segments"]) ], 64)), vue.renderSlot(_ctx.$slots, "default", { ui: ui2.value }), vue.unref(isLeading) || !!vue.unref(props).avatar || !!slots.leading ? (vue.openBlock(), vue.createElementBlock("span", { key: 2, "data-slot": "leading", class: vue.normalizeClass(ui2.value.leading({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.leading })) }, [ vue.renderSlot(_ctx.$slots, "leading", { ui: ui2.value }, () => { var _a4, _b2, _c; return [ vue.unref(isLeading) && vue.unref(leadingIconName) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(leadingIconName), "data-slot": "leadingIcon", class: vue.normalizeClass(ui2.value.leadingIcon({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.leadingIcon })) }, null, 8, ["name", "class"])) : !!vue.unref(props).avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 1, size: ((_b2 = vue.unref(props).ui) == null ? void 0 : _b2.leadingAvatarSize) || ui2.value.leadingAvatarSize() }, vue.unref(props).avatar, { "data-slot": "leadingAvatar", class: ui2.value.leadingAvatar({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.leadingAvatar }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true), vue.unref(isTrailing) || !!slots.trailing ? (vue.openBlock(), vue.createElementBlock("span", { key: 3, "data-slot": "trailing", class: vue.normalizeClass(ui2.value.trailing({ class: (_b = vue.unref(props).ui) == null ? void 0 : _b.trailing })) }, [ vue.renderSlot(_ctx.$slots, "trailing", { ui: ui2.value }, () => { var _a4; return [ vue.unref(trailingIconName) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(trailingIconName), "data-slot": "trailingIcon", class: vue.normalizeClass(ui2.value.trailingIcon({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.trailingIcon, leading: vue.unref(isLeading) })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true) ]; }), _: 3 }, 16, ["id", "name", "disabled", "model-value", "default-value", "class"]) ], 64); }; } }); const theme$g = { "slots": { "base": "font-medium inline-flex items-center", "label": "truncate", "leadingIcon": "shrink-0", "leadingAvatar": "shrink-0", "leadingAvatarSize": "", "trailingIcon": "shrink-0" }, "variants": { "fieldGroup": { "horizontal": "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]", "vertical": "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]" }, "color": { "primary": "", "success": "", "info": "", "warning": "", "error": "", "neutral": "" }, "variant": { "solid": "", "outline": "", "soft": "", "subtle": "" }, "size": { "xs": { "base": "text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm", "leadingIcon": "size-3", "leadingAvatarSize": "3xs", "trailingIcon": "size-3" }, "sm": { "base": "text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm", "leadingIcon": "size-3", "leadingAvatarSize": "3xs", "trailingIcon": "size-3" }, "md": { "base": "text-xs px-2 py-1 gap-1 rounded-md", "leadingIcon": "size-4", "leadingAvatarSize": "3xs", "trailingIcon": "size-4" }, "lg": { "base": "text-sm px-2 py-1 gap-1.5 rounded-md", "leadingIcon": "size-5", "leadingAvatarSize": "2xs", "trailingIcon": "size-5" }, "xl": { "base": "text-base px-2.5 py-1 gap-1.5 rounded-md", "leadingIcon": "size-6", "leadingAvatarSize": "2xs", "trailingIcon": "size-6" } }, "square": { "true": "" } }, "compoundVariants": [ { "color": "primary", "variant": "solid", "class": "bg-primary text-inverted" }, { "color": "success", "variant": "solid", "class": "bg-success text-inverted" }, { "color": "info", "variant": "solid", "class": "bg-info text-inverted" }, { "color": "warning", "variant": "solid", "class": "bg-warning text-inverted" }, { "color": "error", "variant": "solid", "class": "bg-error text-inverted" }, { "color": "primary", "variant": "outline", "class": "text-primary ring ring-inset ring-primary/50" }, { "color": "success", "variant": "outline", "class": "text-success ring ring-inset ring-success/50" }, { "color": "info", "variant": "outline", "class": "text-info ring ring-inset ring-info/50" }, { "color": "warning", "variant": "outline", "class": "text-warning ring ring-inset ring-warning/50" }, { "color": "error", "variant": "outline", "class": "text-error ring ring-inset ring-error/50" }, { "color": "primary", "variant": "soft", "class": "bg-primary/10 text-primary" }, { "color": "success", "variant": "soft", "class": "bg-success/10 text-success" }, { "color": "info", "variant": "soft", "class": "bg-info/10 text-info" }, { "color": "warning", "variant": "soft", "class": "bg-warning/10 text-warning" }, { "color": "error", "variant": "soft", "class": "bg-error/10 text-error" }, { "color": "primary", "variant": "subtle", "class": "bg-primary/10 text-primary ring ring-inset ring-primary/25" }, { "color": "success", "variant": "subtle", "class": "bg-success/10 text-success ring ring-inset ring-success/25" }, { "color": "info", "variant": "subtle", "class": "bg-info/10 text-info ring ring-inset ring-info/25" }, { "color": "warning", "variant": "subtle", "class": "bg-warning/10 text-warning ring ring-inset ring-warning/25" }, { "color": "error", "variant": "subtle", "class": "bg-error/10 text-error ring ring-inset ring-error/25" }, { "color": "neutral", "variant": "solid", "class": "text-inverted bg-inverted" }, { "color": "neutral", "variant": "outline", "class": "ring ring-inset ring-accented text-default bg-default" }, { "color": "neutral", "variant": "soft", "class": "text-default bg-elevated" }, { "color": "neutral", "variant": "subtle", "class": "ring ring-inset ring-accented text-default bg-elevated" }, { "size": "xs", "square": true, "class": "p-0.5" }, { "size": "sm", "square": true, "class": "p-1" }, { "size": "md", "square": true, "class": "p-1" }, { "size": "lg", "square": true, "class": "p-1" }, { "size": "xl", "square": true, "class": "p-1" } ], "defaultVariants": { "color": "primary", "variant": "solid", "size": "md" } }; const _sfc_main$C = { __name: "Badge", props: { as: { type: null, required: false, default: "span" }, label: { type: [String, Number], required: false }, color: { type: null, required: false }, variant: { type: null, required: false }, size: { type: null, required: false }, square: { type: Boolean, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, icon: { type: null, required: false }, avatar: { type: Object, required: false }, leading: { type: Boolean, required: false }, leadingIcon: { type: null, required: false }, trailing: { type: Boolean, required: false }, trailingIcon: { type: null, required: false } }, setup(__props) { const _props = __props; const slots = vue.useSlots(); const props = useComponentProps("badge", _props); const appConfig2 = useAppConfig(); const { orientation, size: fieldGroupSize } = useFieldGroup(_props); const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props); const ui2 = vue.computed(() => { var _a2, _b; return tv({ extend: theme$g, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.badge) || {} })({ color: props.color, variant: props.variant, size: (_b = fieldGroupSize.value) != null ? _b : props.size, square: props.square || !slots.default && !props.label, fieldGroup: orientation.value }); }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: vue.unref(props).as, "data-slot": "base", class: vue.normalizeClass(ui2.value.base({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.base, vue.unref(props).class] })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "leading", { ui: ui2.value }, () => { var _a3, _b, _c; return [ vue.unref(isLeading) && vue.unref(leadingIconName) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(leadingIconName), "data-slot": "leadingIcon", class: vue.normalizeClass(ui2.value.leadingIcon({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.leadingIcon })) }, null, 8, ["name", "class"])) : !!vue.unref(props).avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 1, size: ((_b = vue.unref(props).ui) == null ? void 0 : _b.leadingAvatarSize) || ui2.value.leadingAvatarSize() }, vue.unref(props).avatar, { "data-slot": "leadingAvatar", class: ui2.value.leadingAvatar({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.leadingAvatar }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true) ]; }), vue.renderSlot(_ctx.$slots, "default", { ui: ui2.value }, () => { var _a3; return [ vue.unref(props).label !== void 0 && vue.unref(props).label !== null ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "data-slot": "label", class: vue.normalizeClass(ui2.value.label({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.label })) }, vue.toDisplayString(vue.unref(props).label), 3)) : vue.createCommentVNode("", true) ]; }), vue.renderSlot(_ctx.$slots, "trailing", { ui: ui2.value }, () => { var _a3; return [ vue.unref(isTrailing) && vue.unref(trailingIconName) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(trailingIconName), "data-slot": "trailingIcon", class: vue.normalizeClass(ui2.value.trailingIcon({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.trailingIcon })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ]; }) ]), _: 3 }, 8, ["as", "class"]); }; } }; function pointerDownOutside(e, options = {}) { const originalEvent = e.detail.originalEvent; const target = originalEvent.target; if (!(target == null ? void 0 : target.isConnected)) { e.preventDefault(); return; } if (options.scrollable) { if (originalEvent.offsetX > target.clientWidth || originalEvent.offsetY > target.clientHeight) { e.preventDefault(); } } } const theme$f = { "slots": { "content": "bg-default shadow-lg rounded-md ring ring-default data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-popover-content-transform-origin) focus:outline-none pointer-events-auto", "arrow": "fill-bg stroke-default" } }; const _sfc_main$B = { __name: "Popover", props: { mode: { type: null, required: false, default: "click" }, content: { type: Object, required: false }, arrow: { type: [Boolean, Object], required: false }, portal: { type: [Boolean, String], required: false, skipCheck: true, default: true }, reference: { type: null, required: false }, dismissible: { type: Boolean, required: false, default: true }, class: { type: null, required: false }, ui: { type: Object, required: false }, defaultOpen: { type: Boolean, required: false }, open: { type: Boolean, required: false }, modal: { type: Boolean, required: false }, openDelay: { type: Number, required: false, default: 0 }, closeDelay: { type: Number, required: false, default: 0 }, enableTouch: { type: Boolean, required: false } }, emits: ["close:prevent", "update:open"], setup(__props, { emit: __emit }) { const Popover = { Root: PopoverRoot_default, Trigger: PopoverTrigger_default, Portal: PopoverPortal_default, Content: PopoverContent_default, Arrow: PopoverArrow_default, Anchor: PopoverAnchor_default }; const HoverCard = { Root: HoverCardRoot_default, Trigger: HoverCardTrigger_default, Portal: HoverCardPortal_default, Content: HoverCardContent_default, Arrow: HoverCardArrow_default }; const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("popover", _props); const appConfig2 = useAppConfig(); const pick = props.mode === "hover" ? reactivePick(props, "defaultOpen", "open", "openDelay", "closeDelay", "enableTouch") : reactivePick(props, "defaultOpen", "open", "modal"); const rootProps = useForwardProps(pick, emits); const portalProps = usePortal(vue.toRef(() => props.portal)); const contentProps = vue.toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 })); const contentEvents = vue.computed(() => { if (!props.dismissible) { const events = ["interactOutside", "escapeKeyDown"]; return events.reduce((acc, curr) => { acc[curr] = (e) => { e.preventDefault(); emits("close:prevent"); }; return acc; }, {}); } return { pointerDownOutside }; }); const arrowProps = vue.toRef(() => defu(props.arrow, { rounded: true })); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$f, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.popover) || {} })({ side: contentProps.value.side }); }); const Component = vue.computed(() => props.mode === "hover" ? HoverCard : Popover); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(Component).Root, vue.normalizeProps(vue.guardReactiveProps(vue.unref(rootProps))), { default: vue.withCtx(({ open, close }) => [ !!slots.default ? (vue.openBlock(), vue.createBlock(vue.unref(Component).Trigger, { key: 0, "as-child": "", class: vue.normalizeClass(vue.unref(props).class) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default", { open }) ]), _: 2 }, 1032, ["class"])) : vue.createCommentVNode("", true), "Anchor" in Component.value && !!slots.anchor ? (vue.openBlock(), vue.createBlock(vue.unref(Component).Anchor, { key: 1, "as-child": "" }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "anchor", vue.normalizeProps(vue.guardReactiveProps(close ? { close } : {}))) ]), _: 2 }, 1024)) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(Component).Portal, vue.normalizeProps(vue.guardReactiveProps(vue.unref(portalProps))), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(FieldGroupReset), null, { default: vue.withCtx(() => { var _a2, _b, _c; return [ vue.createVNode(vue.unref(Component).Content, vue.mergeProps(contentProps.value, { reference: (_b = vue.unref(props).reference) != null ? _b : (_a2 = vue.unref(props).content) == null ? void 0 : _a2.reference, "data-slot": "content", class: ui2.value.content({ class: [!slots.default && vue.unref(props).class, (_c = vue.unref(props).ui) == null ? void 0 : _c.content] }) }, vue.toHandlers(contentEvents.value)), { default: vue.withCtx(() => { var _a3; return [ vue.renderSlot(_ctx.$slots, "content", vue.normalizeProps(vue.guardReactiveProps(close ? { close } : {}))), !!vue.unref(props).arrow ? (vue.openBlock(), vue.createBlock(vue.unref(Component).Arrow, vue.mergeProps({ key: 0 }, arrowProps.value, { "data-slot": "arrow", class: ui2.value.arrow({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.arrow }) }), null, 16, ["class"])) : vue.createCommentVNode("", true) ]; }), _: 2 }, 1040, ["reference", "class"]) ]; }), _: 2 }, 1024) ]), _: 2 }, 1040) ]), _: 3 }, 16); }; } }; function usePrefix() { var _a2; const appConfig2 = useAppConfig(); const prefix = (_a2 = appConfig2.ui) == null ? void 0 : _a2.prefix; return (classString) => { if (!prefix || !classString) { return classString; } return classString.split(/\s+/).filter(Boolean).map((cls) => `${prefix}:${cls}`).join(" "); }; } const theme$e = { "base": "inline-flex items-center justify-center px-1 rounded-sm font-medium font-sans uppercase", "variants": { "color": { "primary": "", "success": "", "info": "", "warning": "", "error": "", "neutral": "" }, "variant": { "solid": "", "outline": "", "soft": "", "subtle": "" }, "size": { "sm": "h-4 min-w-[16px] text-[10px]", "md": "h-5 min-w-[20px] text-[11px]", "lg": "h-6 min-w-[24px] text-[12px]" } }, "compoundVariants": [ { "color": "primary", "variant": "solid", "class": "text-inverted bg-primary" }, { "color": "success", "variant": "solid", "class": "text-inverted bg-success" }, { "color": "info", "variant": "solid", "class": "text-inverted bg-info" }, { "color": "warning", "variant": "solid", "class": "text-inverted bg-warning" }, { "color": "error", "variant": "solid", "class": "text-inverted bg-error" }, { "color": "primary", "variant": "outline", "class": "ring ring-inset ring-primary/50 text-primary" }, { "color": "success", "variant": "outline", "class": "ring ring-inset ring-success/50 text-success" }, { "color": "info", "variant": "outline", "class": "ring ring-inset ring-info/50 text-info" }, { "color": "warning", "variant": "outline", "class": "ring ring-inset ring-warning/50 text-warning" }, { "color": "error", "variant": "outline", "class": "ring ring-inset ring-error/50 text-error" }, { "color": "primary", "variant": "soft", "class": "text-primary bg-primary/10" }, { "color": "success", "variant": "soft", "class": "text-success bg-success/10" }, { "color": "info", "variant": "soft", "class": "text-info bg-info/10" }, { "color": "warning", "variant": "soft", "class": "text-warning bg-warning/10" }, { "color": "error", "variant": "soft", "class": "text-error bg-error/10" }, { "color": "primary", "variant": "subtle", "class": "text-primary ring ring-inset ring-primary/25 bg-primary/10" }, { "color": "success", "variant": "subtle", "class": "text-success ring ring-inset ring-success/25 bg-success/10" }, { "color": "info", "variant": "subtle", "class": "text-info ring ring-inset ring-info/25 bg-info/10" }, { "color": "warning", "variant": "subtle", "class": "text-warning ring ring-inset ring-warning/25 bg-warning/10" }, { "color": "error", "variant": "subtle", "class": "text-error ring ring-inset ring-error/25 bg-error/10" }, { "color": "neutral", "variant": "solid", "class": "text-inverted bg-inverted" }, { "color": "neutral", "variant": "outline", "class": "ring ring-inset ring-accented text-default bg-default" }, { "color": "neutral", "variant": "soft", "class": "text-default bg-elevated" }, { "color": "neutral", "variant": "subtle", "class": "ring ring-inset ring-accented text-default bg-elevated" } ], "defaultVariants": { "variant": "outline", "color": "neutral", "size": "md" } }; const _sfc_main$A = { __name: "Kbd", props: { as: { type: null, required: false, default: "kbd" }, value: { type: null, required: false }, color: { type: null, required: false }, variant: { type: null, required: false }, size: { type: null, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false } }, setup(__props) { const _props = __props; const props = useComponentProps("kbd", _props); const { getKbdKey } = useKbd$1(); const appConfig2 = useAppConfig(); const prefix = usePrefix(); const platformKey = vue.computed(() => props.value && Object.hasOwn(kbdKeysPlatformMap, props.value) ? kbdKeysPlatformMap[props.value] : void 0); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$e, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.kbd) || {} }); }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: vue.unref(props).as, class: vue.normalizeClass(ui2.value({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.base, vue.unref(props).class], color: vue.unref(props).color, variant: vue.unref(props).variant, size: vue.unref(props).size })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default", {}, () => [ platformKey.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createElementVNode("span", { class: vue.normalizeClass(vue.unref(prefix)("hidden in-[.ui-macos]:inline")) }, vue.toDisplayString(platformKey.value.macos), 3), vue.createElementVNode("span", { class: vue.normalizeClass(vue.unref(prefix)("in-[.ui-macos]:hidden")) }, vue.toDisplayString(platformKey.value.other), 3) ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ vue.createTextVNode(vue.toDisplayString(vue.unref(getKbdKey)(vue.unref(props).value)), 1) ], 64)) ]) ]), _: 3 }, 8, ["as", "class"]); }; } }; const theme$d = { "slots": { "content": "flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto", "arrow": "fill-bg stroke-default", "text": "truncate", "kbds": "hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5", "kbdsSize": "sm" } }; const _sfc_main$z = { __name: "Tooltip", props: { text: { type: String, required: false }, kbds: { type: Array, required: false }, content: { type: Object, required: false }, arrow: { type: [Boolean, Object], required: false }, portal: { type: [Boolean, String], required: false, skipCheck: true, default: true }, reference: { type: null, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, defaultOpen: { type: Boolean, required: false }, open: { type: Boolean, required: false }, delayDuration: { type: Number, required: false }, disableHoverableContent: { type: Boolean, required: false }, disableClosingTrigger: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, ignoreNonKeyboardFocus: { type: Boolean, required: false } }, emits: ["update:open"], setup(__props, { emit: __emit }) { const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("tooltip", _props); const appConfig2 = useAppConfig(); const providerContext = injectTooltipProviderContext(); const rootProps = useForwardProps(reactivePick(props, "defaultOpen", "open", "delayDuration", "disableHoverableContent", "disableClosingTrigger", "ignoreNonKeyboardFocus"), emits); const portalProps = usePortal(vue.toRef(() => props.portal)); const contentProps = vue.toRef(() => defu(props.content, providerContext.content.value, { side: "bottom", sideOffset: 8, collisionPadding: 8 })); const arrowProps = vue.toRef(() => defu(props.arrow, { rounded: true })); const { getKbdKey } = useKbd$1(); const ariaLabel = vue.computed(() => { if (contentProps.value.ariaLabel || slots.content) { return contentProps.value.ariaLabel; } return [props.text, ...(props.kbds || []).map((kbd) => getKbdKey(typeof kbd === "object" ? kbd.value : kbd))].filter(Boolean).join(" "); }); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$d, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.tooltip) || {} })({ side: contentProps.value.side }); }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(TooltipRoot_default), vue.mergeProps(vue.unref(rootProps), { disabled: !(vue.unref(props).text || ((_a2 = vue.unref(props).kbds) == null ? void 0 : _a2.length) || !!slots.content) || vue.unref(props).disabled }), { default: vue.withCtx(({ open }) => [ !!slots.default || !!vue.unref(props).reference ? (vue.openBlock(), vue.createBlock(vue.unref(TooltipTrigger_default), vue.mergeProps({ key: 0 }, _ctx.$attrs, { "as-child": "", reference: vue.unref(props).reference, class: vue.unref(props).class }), { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default", { open }) ]), _: 2 }, 1040, ["reference", "class"])) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(TooltipPortal_default), vue.normalizeProps(vue.guardReactiveProps(vue.unref(portalProps))), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(FieldGroupReset), null, { default: vue.withCtx(() => { var _a3; return [ vue.createVNode(vue.unref(TooltipContent_default), vue.mergeProps(contentProps.value, { "aria-label": ariaLabel.value, "data-slot": "content", class: ui2.value.content({ class: [!slots.default && vue.unref(props).class, (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.content] }) }), { default: vue.withCtx(() => { var _a4; return [ vue.renderSlot(_ctx.$slots, "content", { ui: ui2.value }, () => { var _a5, _b, _c; return [ vue.unref(props).text ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "data-slot": "text", class: vue.normalizeClass(ui2.value.text({ class: (_a5 = vue.unref(props).ui) == null ? void 0 : _a5.text })) }, vue.toDisplayString(vue.unref(props).text), 3)) : vue.createCommentVNode("", true), ((_b = vue.unref(props).kbds) == null ? void 0 : _b.length) ? (vue.openBlock(), vue.createElementBlock("span", { key: 1, "data-slot": "kbds", class: vue.normalizeClass(ui2.value.kbds({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.kbds })) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).kbds, (kbd, index) => { var _a6; return vue.openBlock(), vue.createBlock(_sfc_main$A, vue.mergeProps({ key: index, size: ((_a6 = vue.unref(props).ui) == null ? void 0 : _a6.kbdsSize) || ui2.value.kbdsSize() }, { ref_for: true }, typeof kbd === "string" ? { value: kbd } : kbd), null, 16, ["size"]); }), 128)) ], 2)) : vue.createCommentVNode("", true) ]; }), !!vue.unref(props).arrow ? (vue.openBlock(), vue.createBlock(vue.unref(TooltipArrow_default), vue.mergeProps({ key: 0 }, arrowProps.value, { "data-slot": "arrow", class: ui2.value.arrow({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.arrow }) }), null, 16, ["class"])) : vue.createCommentVNode("", true) ]; }), _: 3 }, 16, ["aria-label", "class"]) ]; }), _: 3 }) ]), _: 3 }, 16) ]), _: 3 }, 16, ["disabled"]); }; } }; const theme$c = { "slots": { "root": "relative flex gap-1.5 [&>div]:min-w-0", "list": "isolate min-w-0", "label": "w-full flex items-center gap-1.5 font-semibold text-xs/5 text-highlighted px-2.5 py-1.5", "item": "min-w-0", "link": "group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none focus-visible:before:outline-3", "linkLeadingIcon": "shrink-0 size-5", "linkLeadingAvatar": "shrink-0", "linkLeadingAvatarSize": "2xs", "linkLeadingChipSize": "sm", "linkTrailing": "group ms-auto inline-flex gap-1.5 items-center", "linkTrailingBadge": "shrink-0", "linkTrailingBadgeSize": "sm", "linkTrailingIcon": "size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200 ease-out motion-reduce:transition-none", "linkLabel": "truncate", "linkLabelExternalIcon": "inline-block size-3 align-top text-dimmed", "childList": "isolate", "childLabel": "text-xs text-highlighted", "childItem": "", "childLink": "group relative size-full flex items-start text-start text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none focus-visible:before:outline-3", "childLinkWrapper": "min-w-0", "childLinkIcon": "size-5 shrink-0", "childLinkLabel": "truncate", "childLinkLabelExternalIcon": "inline-block size-3 align-top text-dimmed", "childLinkDescription": "text-muted", "separator": "px-2 h-px bg-border", "viewportWrapper": "absolute top-full start-0 flex w-full", "viewport": "relative overflow-hidden bg-default shadow-lg rounded-md ring ring-default h-(--reka-navigation-menu-viewport-height) w-full transition-[width,height,left,right] duration-200 ease-out motion-reduce:transition-none origin-[top_center] data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] z-1", "content": "", "indicator": "absolute left-0 data-[state=visible]:animate-[fade-in_100ms_var(--ease-out)] data-[state=hidden]:animate-[fade-out_100ms_var(--ease-out)] data-[state=hidden]:opacity-0 bottom-0 z-2 w-(--reka-navigation-menu-indicator-size) translate-x-(--reka-navigation-menu-indicator-position) flex h-2.5 items-end justify-center overflow-hidden transition-[translate,width] duration-200 ease-out motion-reduce:transition-none", "arrow": "relative top-[50%] size-2.5 rotate-45 border border-default bg-default z-1 rounded-xs" }, "variants": { "color": { "primary": { "link": "before:outline-primary/25", "childLink": "before:outline-primary/25" }, "success": { "link": "before:outline-success/25", "childLink": "before:outline-success/25" }, "info": { "link": "before:outline-info/25", "childLink": "before:outline-info/25" }, "warning": { "link": "before:outline-warning/25", "childLink": "before:outline-warning/25" }, "error": { "link": "before:outline-error/25", "childLink": "before:outline-error/25" }, "neutral": { "link": "before:outline-inverted/25", "childLink": "before:outline-inverted/25" } }, "highlightColor": { "primary": "", "success": "", "info": "", "warning": "", "error": "", "neutral": "" }, "variant": { "pill": "", "link": "" }, "orientation": { "horizontal": { "root": "items-center justify-between", "list": "flex items-center", "item": "py-2", "link": "px-2.5 py-1.5 before:inset-x-px before:inset-y-0", "childList": "grid p-2", "childLink": "px-3 py-2 gap-2 before:inset-x-px before:inset-y-0", "childLinkLabel": "font-medium", "content": "absolute top-0 start-0 w-full max-h-[70vh] overflow-y-auto" }, "vertical": { "root": "flex-col", "link": "flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0", "childLabel": "px-1.5 py-0.5", "childLink": "p-1.5 gap-1.5 before:inset-y-px before:inset-x-0" } }, "contentOrientation": { "horizontal": { "viewportWrapper": "justify-center", "content": "data-[motion=from-start]:animate-[enter-from-left_200ms_var(--ease-out)] data-[motion=from-end]:animate-[enter-from-right_200ms_var(--ease-out)] data-[motion=to-start]:animate-[exit-to-left_200ms_var(--ease-out)] data-[motion=to-end]:animate-[exit-to-right_200ms_var(--ease-out)]" }, "vertical": { "viewport": "sm:w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left) rtl:left-auto rtl:right-[calc(100%-var(--reka-navigation-menu-viewport-left)-var(--reka-navigation-menu-viewport-width))]" } }, "active": { "true": { "childLink": "before:bg-elevated text-highlighted", "childLinkIcon": "text-default" }, "false": { "link": "text-muted", "linkLeadingIcon": "text-dimmed", "childLink": [ "hover:before:bg-elevated/50 text-default hover:text-highlighted", "transition-colors before:transition-colors" ], "childLinkIcon": [ "text-dimmed group-hover:text-default", "transition-colors" ] } }, "disabled": { "true": { "link": "cursor-not-allowed opacity-75" } }, "highlight": { "true": "" }, "level": { "true": "" }, "collapsed": { "true": "" } }, "compoundVariants": [ { "orientation": "horizontal", "contentOrientation": "horizontal", "class": { "childList": "grid-cols-2 gap-2" } }, { "orientation": "horizontal", "contentOrientation": "vertical", "class": { "childList": "gap-1", "content": "w-60" } }, { "orientation": "vertical", "collapsed": false, "class": { "childList": "ms-5 border-s border-default", "childItem": "ps-1.5 -ms-px", "content": "data-[state=open]:animate-[collapsible-down_200ms_var(--ease-out)] data-[state=closed]:animate-[collapsible-up_200ms_var(--ease-out)] data-[state=closed]:overflow-hidden" } }, { "orientation": "vertical", "collapsed": true, "class": { "link": "px-1.5", "linkLabel": "hidden", "linkTrailing": "hidden", "content": "shadow-sm rounded-sm min-h-6 p-1" } }, { "orientation": "horizontal", "highlight": true, "class": { "link": [ "after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full", "after:transition-colors" ] } }, { "orientation": "vertical", "highlight": true, "level": true, "class": { "link": [ "after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full", "after:transition-colors" ] } }, { "disabled": false, "active": false, "variant": "pill", "class": { "link": [ "hover:text-highlighted hover:before:bg-elevated/50", "transition-colors before:transition-colors" ], "linkLeadingIcon": [ "group-hover:text-default", "transition-colors" ] } }, { "disabled": false, "active": false, "variant": "pill", "orientation": "horizontal", "class": { "link": "data-[state=open]:text-highlighted", "linkLeadingIcon": "group-data-[state=open]:text-default" } }, { "disabled": false, "variant": "pill", "highlight": true, "orientation": "horizontal", "class": { "link": "data-[state=open]:before:bg-elevated/50" } }, { "disabled": false, "variant": "pill", "highlight": false, "active": false, "orientation": "horizontal", "class": { "link": "data-[state=open]:before:bg-elevated/50" } }, { "color": "primary", "variant": "pill", "active": true, "class": { "link": "text-primary", "linkLeadingIcon": "text-primary group-data-[state=open]:text-primary" } }, { "color": "success", "variant": "pill", "active": true, "class": { "link": "text-success", "linkLeadingIcon": "text-success group-data-[state=open]:text-success" } }, { "color": "info", "variant": "pill", "active": true, "class": { "link": "text-info", "linkLeadingIcon": "text-info group-data-[state=open]:text-info" } }, { "color": "warning", "variant": "pill", "active": true, "class": { "link": "text-warning", "linkLeadingIcon": "text-warning group-data-[state=open]:text-warning" } }, { "color": "error", "variant": "pill", "active": true, "class": { "link": "text-error", "linkLeadingIcon": "text-error group-data-[state=open]:text-error" } }, { "color": "neutral", "variant": "pill", "active": true, "class": { "link": "text-highlighted", "linkLeadingIcon": "text-highlighted group-data-[state=open]:text-highlighted" } }, { "variant": "pill", "active": true, "highlight": false, "class": { "link": "before:bg-elevated" } }, { "variant": "pill", "active": true, "highlight": true, "disabled": false, "class": { "link": [ "hover:before:bg-elevated/50", "before:transition-colors" ] } }, { "disabled": false, "active": false, "variant": "link", "class": { "link": [ "hover:text-highlighted", "transition-colors" ], "linkLeadingIcon": [ "group-hover:text-default", "transition-colors" ] } }, { "disabled": false, "active": false, "variant": "link", "orientation": "horizontal", "class": { "link": "data-[state=open]:text-highlighted", "linkLeadingIcon": "group-data-[state=open]:text-default" } }, { "color": "primary", "variant": "link", "active": true, "class": { "link": "text-primary", "linkLeadingIcon": "text-primary group-data-[state=open]:text-primary" } }, { "color": "success", "variant": "link", "active": true, "class": { "link": "text-success", "linkLeadingIcon": "text-success group-data-[state=open]:text-success" } }, { "color": "info", "variant": "link", "active": true, "class": { "link": "text-info", "linkLeadingIcon": "text-info group-data-[state=open]:text-info" } }, { "color": "warning", "variant": "link", "active": true, "class": { "link": "text-warning", "linkLeadingIcon": "text-warning group-data-[state=open]:text-warning" } }, { "color": "error", "variant": "link", "active": true, "class": { "link": "text-error", "linkLeadingIcon": "text-error group-data-[state=open]:text-error" } }, { "color": "neutral", "variant": "link", "active": true, "class": { "link": "text-highlighted", "linkLeadingIcon": "text-highlighted group-data-[state=open]:text-highlighted" } }, { "highlightColor": "primary", "highlight": true, "level": true, "active": true, "class": { "link": "after:bg-primary" } }, { "highlightColor": "success", "highlight": true, "level": true, "active": true, "class": { "link": "after:bg-success" } }, { "highlightColor": "info", "highlight": true, "level": true, "active": true, "class": { "link": "after:bg-info" } }, { "highlightColor": "warning", "highlight": true, "level": true, "active": true, "class": { "link": "after:bg-warning" } }, { "highlightColor": "error", "highlight": true, "level": true, "active": true, "class": { "link": "after:bg-error" } }, { "highlightColor": "neutral", "highlight": true, "level": true, "active": true, "class": { "link": "after:bg-inverted" } } ], "defaultVariants": { "color": "primary", "highlightColor": "primary", "variant": "pill" } }; const _sfc_main$y = Object.assign({ inheritAttrs: false }, { __name: "NavigationMenu", props: { as: { type: null, required: false }, type: { type: null, required: false, default: "multiple" }, modelValue: { type: null, required: false }, defaultValue: { type: null, required: false }, trailingIcon: { type: null, required: false }, externalIcon: { type: [Boolean, String], required: false, skipCheck: true, default: true }, items: { type: null, required: false }, color: { type: null, required: false }, variant: { type: null, required: false }, orientation: { type: null, required: false, default: "horizontal" }, collapsed: { type: Boolean, required: false }, tooltip: { type: [Boolean, Object], required: false }, popover: { type: [Boolean, Object], required: false }, highlight: { type: Boolean, required: false }, highlightColor: { type: null, required: false }, content: { type: Object, required: false }, contentOrientation: { type: null, required: false, default: "horizontal" }, viewport: { type: Object, required: false }, arrow: { type: Boolean, required: false }, valueKey: { type: null, required: false, default: "value" }, labelKey: { type: null, required: false, default: "label" }, class: { type: null, required: false }, ui: { type: Object, required: false }, delayDuration: { type: Number, required: false, default: 0 }, disableClickTrigger: { type: Boolean, required: false }, disableHoverTrigger: { type: Boolean, required: false }, skipDelayDuration: { type: Number, required: false }, disablePointerLeaveClose: { type: Boolean, required: false }, unmountOnHide: { type: Boolean, required: false, default: true }, disabled: { type: Boolean, required: false }, collapsible: { type: Boolean, required: false, default: true } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("navigationMenu", _props); const appConfig2 = useAppConfig(); const rootProps = useForwardProps(vue.computed(() => ({ as: props.as, delayDuration: props.delayDuration, skipDelayDuration: props.skipDelayDuration, orientation: props.orientation, disableClickTrigger: props.disableClickTrigger, disableHoverTrigger: props.disableHoverTrigger, disablePointerLeaveClose: props.disablePointerLeaveClose, unmountOnHide: props.unmountOnHide })), emits); const accordionProps = useForwardProps(reactivePick(props, "collapsible", "disabled", "type", "unmountOnHide"), emits); const contentProps = vue.toRef(() => props.content); const viewportProps = vue.toRef(() => props.viewport); const tooltipProps = vue.toRef(() => defu(typeof props.tooltip === "boolean" ? {} : props.tooltip, { ...props.orientation === "vertical" && { delayDuration: 0, content: { side: "right" } } })); const popoverProps = vue.toRef(() => defu(typeof props.popover === "boolean" ? {} : props.popover, { mode: "hover", content: { side: "right", align: "start", alignOffset: 2 } })); const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate(); const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({ props: { item: Object, index: Number, level: Number, listIndex: Number } }); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$c, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.navigationMenu) || {} })({ orientation: props.orientation, contentOrientation: props.orientation === "vertical" ? void 0 : props.contentOrientation, collapsed: props.collapsed, color: props.color, variant: props.variant, highlight: props.highlight, highlightColor: props.highlightColor || props.color }); }); const lists = vue.computed( () => { var _a2; return ((_a2 = props.items) == null ? void 0 : _a2.length) ? isArrayOfArray(props.items) ? props.items : [props.items] : []; } ); function getItemValue(item, index, level, listIndex) { var _a2; const prefix = lists.value.length > 1 ? `group-${listIndex}-` : ""; return (_a2 = get(item, props.valueKey)) != null ? _a2 : level > 0 ? `${prefix}item-${level}-${index}` : `${prefix}item-${index}`; } function getAccordionDefaultValue(list, level = 0, listIndex = 0) { const indexes = list.reduce((acc, item, index) => { if (item.defaultOpen || item.open) { acc.push(getItemValue(item, index, level, listIndex)); } return acc; }, []); return props.type === "single" ? indexes[0] : indexes; } const trailingClicks = new WeakSet(); function onLinkTrailingClick(e, item, trailingTrigger) { var _a2; if (!((_a2 = item.children) == null ? void 0 : _a2.length)) { return; } if (props.orientation === "horizontal") { trailingClicks.add(e); } else if (props.orientation === "vertical" && !props.collapsed && trailingTrigger) { e.preventDefault(); e.stopPropagation(); } } function onLinkClick(e) { if (trailingClicks.has(e)) { e.preventDefault(); } } return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.createVNode(vue.unref(DefineLinkTemplate), null, { default: vue.withCtx(({ item, active, index, trailingTrigger }) => [ vue.renderSlot(_ctx.$slots, item.slot || "item", { item, index, active, ui: ui2.value }, () => { var _a3, _b, _c, _d, _e2, _f, _g, _h, _i, _j; return [ vue.renderSlot(_ctx.$slots, item.slot ? `${item.slot}-leading` : "item-leading", { item, active, index, ui: ui2.value }, () => { var _a4, _b2, _c2, _d2, _e3, _f2, _g2, _h2; return [ item.avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 0, size: ((_a4 = item.ui) == null ? void 0 : _a4.linkLeadingAvatarSize) || ((_b2 = vue.unref(props).ui) == null ? void 0 : _b2.linkLeadingAvatarSize) || ui2.value.linkLeadingAvatarSize() }, item.avatar, { "data-slot": "linkLeadingAvatar", class: ui2.value.linkLeadingAvatar({ class: [(_c2 = vue.unref(props).ui) == null ? void 0 : _c2.linkLeadingAvatar, (_d2 = item.ui) == null ? void 0 : _d2.linkLeadingAvatar], active, disabled: !!item.disabled }) }), null, 16, ["size", "class"])) : item.icon && item.chip ? (vue.openBlock(), vue.createBlock(_sfc_main$K, vue.mergeProps({ key: 1, size: ((_e3 = item.ui) == null ? void 0 : _e3.linkLeadingChipSize) || ((_f2 = vue.unref(props).ui) == null ? void 0 : _f2.linkLeadingChipSize) || ui2.value.linkLeadingChipSize(), inset: "" }, typeof item.chip === "object" ? item.chip : {}, { "data-slot": "linkLeadingChip" }), { default: vue.withCtx(() => { var _a5, _b3; return [ vue.createVNode(_sfc_main$L, { name: item.icon, "data-slot": "linkLeadingIcon", class: vue.normalizeClass(ui2.value.linkLeadingIcon({ class: [(_a5 = vue.unref(props).ui) == null ? void 0 : _a5.linkLeadingIcon, (_b3 = item.ui) == null ? void 0 : _b3.linkLeadingIcon], active, disabled: !!item.disabled })) }, null, 8, ["name", "class"]) ]; }), _: 2 }, 1040, ["size"])) : item.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 2, name: item.icon, "data-slot": "linkLeadingIcon", class: vue.normalizeClass(ui2.value.linkLeadingIcon({ class: [(_g2 = vue.unref(props).ui) == null ? void 0 : _g2.linkLeadingIcon, (_h2 = item.ui) == null ? void 0 : _h2.linkLeadingIcon], active, disabled: !!item.disabled })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ]; }), vue.unref(get)(item, vue.unref(props).labelKey) || !!slots[item.slot ? `${item.slot}-label` : "item-label"] ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "data-slot": "linkLabel", class: vue.normalizeClass(ui2.value.linkLabel({ class: [(_a3 = vue.unref(props).ui) == null ? void 0 : _a3.linkLabel, (_b = item.ui) == null ? void 0 : _b.linkLabel] })) }, [ vue.renderSlot(_ctx.$slots, item.slot ? `${item.slot}-label` : "item-label", { item, active, index }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(get)(item, vue.unref(props).labelKey)), 1) ]), item.target === "_blank" && vue.unref(props).externalIcon !== false ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: typeof vue.unref(props).externalIcon === "string" ? vue.unref(props).externalIcon : vue.unref(appConfig2).ui.icons.external, "data-slot": "linkLabelExternalIcon", class: vue.normalizeClass(ui2.value.linkLabelExternalIcon({ class: [(_c = vue.unref(props).ui) == null ? void 0 : _c.linkLabelExternalIcon, (_d = item.ui) == null ? void 0 : _d.linkLabelExternalIcon], active })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true), item.badge || item.badge === 0 || vue.unref(props).orientation === "horizontal" && (((_e2 = item.children) == null ? void 0 : _e2.length) || !!slots[item.slot ? `${item.slot}-content` : "item-content"]) || vue.unref(props).orientation === "vertical" && ((_f = item.children) == null ? void 0 : _f.length) || item.trailingIcon || !!slots[item.slot ? `${item.slot}-trailing` : "item-trailing"] ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).orientation === "vertical" && ((_g = item.children) == null ? void 0 : _g.length) && !vue.unref(props).collapsed && trailingTrigger ? vue.unref(AccordionTrigger_default) : "span"), { key: 1, as: vue.unref(props).orientation === "vertical" && ((_h = item.children) == null ? void 0 : _h.length) && !vue.unref(props).collapsed && trailingTrigger ? "span" : void 0, "data-slot": "linkTrailing", class: vue.normalizeClass(ui2.value.linkTrailing({ class: [(_i = vue.unref(props).ui) == null ? void 0 : _i.linkTrailing, (_j = item.ui) == null ? void 0 : _j.linkTrailing] })), onClick: (e) => onLinkTrailingClick(e, item, trailingTrigger) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, item.slot ? `${item.slot}-trailing` : "item-trailing", { item, active, index, ui: ui2.value }, () => { var _a4, _b2, _c2, _d2, _e3, _f2, _g2, _h2, _i2, _j2; return [ item.badge || item.badge === 0 ? (vue.openBlock(), vue.createBlock(_sfc_main$C, vue.mergeProps({ key: 0, color: "neutral", variant: "outline", size: ((_a4 = item.ui) == null ? void 0 : _a4.linkTrailingBadgeSize) || ((_b2 = vue.unref(props).ui) == null ? void 0 : _b2.linkTrailingBadgeSize) || ui2.value.linkTrailingBadgeSize() }, typeof item.badge === "string" || typeof item.badge === "number" ? { label: item.badge } : item.badge, { "data-slot": "linkTrailingBadge", class: ui2.value.linkTrailingBadge({ class: [(_c2 = vue.unref(props).ui) == null ? void 0 : _c2.linkTrailingBadge, (_d2 = item.ui) == null ? void 0 : _d2.linkTrailingBadge] }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true), vue.unref(props).orientation === "horizontal" && (((_e3 = item.children) == null ? void 0 : _e3.length) || !!slots[item.slot ? `${item.slot}-content` : "item-content"]) || vue.unref(props).orientation === "vertical" && ((_f2 = item.children) == null ? void 0 : _f2.length) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 1, name: item.trailingIcon || vue.unref(props).trailingIcon || vue.unref(appConfig2).ui.icons.chevronDown, "data-slot": "linkTrailingIcon", class: vue.normalizeClass(ui2.value.linkTrailingIcon({ class: [(_g2 = vue.unref(props).ui) == null ? void 0 : _g2.linkTrailingIcon, (_h2 = item.ui) == null ? void 0 : _h2.linkTrailingIcon], active })) }, null, 8, ["name", "class"])) : item.trailingIcon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 2, name: item.trailingIcon, "data-slot": "linkTrailingIcon", class: vue.normalizeClass(ui2.value.linkTrailingIcon({ class: [(_i2 = vue.unref(props).ui) == null ? void 0 : _i2.linkTrailingIcon, (_j2 = item.ui) == null ? void 0 : _j2.linkTrailingIcon], active })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ]; }) ]), _: 2 }, 1032, ["as", "class", "onClick"])) : vue.createCommentVNode("", true) ]; }) ]), _: 3 }), vue.createVNode(vue.unref(DefineItemTemplate), null, { default: vue.withCtx(({ item, index, level = 0, listIndex = 0 }) => [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).orientation === "vertical" && !vue.unref(props).collapsed ? vue.unref(AccordionItem_default) : vue.unref(NavigationMenuItem_default)), vue.mergeProps({ as: "li" }, vue.unref(props).orientation === "vertical" && !vue.unref(props).collapsed ? { disabled: !!item.disabled } : {}, { value: getItemValue(item, index, level, listIndex) }), { default: vue.withCtx(() => { var _a3, _b, _c, _d, _e2, _f; return [ vue.unref(props).orientation === "vertical" && item.type === "label" && !vue.unref(props).collapsed ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "label", class: vue.normalizeClass(ui2.value.label({ class: [(_a3 = vue.unref(props).ui) == null ? void 0 : _a3.label, (_b = item.ui) == null ? void 0 : _b.label, item.class] })) }, [ vue.createVNode(vue.unref(ReuseLinkTemplate), { item, index, "trailing-trigger": true }, null, 8, ["item", "index"]) ], 2)) : item.type !== "label" ? (vue.openBlock(), vue.createBlock(_sfc_main$H, vue.mergeProps({ key: 1 }, vue.unref(props).orientation === "vertical" && ((_c = item.children) == null ? void 0 : _c.length) && !vue.unref(props).collapsed && item.type === "trigger" ? {} : vue.unref(pickLinkProps)(item), { custom: "" }), { default: vue.withCtx(({ active, ...slotProps }) => { var _a4, _b2, _c2, _d2, _e3; return [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).orientation === "horizontal" && (((_a4 = item.children) == null ? void 0 : _a4.length) || !!slots[item.slot ? `${item.slot}-content` : "item-content"]) ? vue.unref(NavigationMenuTrigger_default) : vue.unref(props).orientation === "vertical" && ((_b2 = item.children) == null ? void 0 : _b2.length) && !vue.unref(props).collapsed && !slotProps.href ? vue.unref(AccordionTrigger_default) : vue.unref(NavigationMenuLink_default)), { "as-child": "", active: active || item.active, disabled: item.disabled, onSelect: item.onSelect }, { default: vue.withCtx(() => { var _a5, _b3, _c3, _d3, _e4; return [ vue.unref(props).orientation === "vertical" && vue.unref(props).collapsed && ((_a5 = item.children) == null ? void 0 : _a5.length) && (!!vue.unref(props).popover || !!item.popover) ? (vue.openBlock(), vue.createBlock(_sfc_main$B, vue.mergeProps({ key: 0 }, { ...popoverProps.value, ...typeof item.popover === "boolean" ? {} : item.popover || {} }, { ui: { content: ui2.value.content({ class: [(_b3 = vue.unref(props).ui) == null ? void 0 : _b3.content, (_c3 = item.ui) == null ? void 0 : _c3.content] }) } }), { content: vue.withCtx(({ close }) => [ vue.renderSlot(_ctx.$slots, item.slot ? `${item.slot}-content` : "item-content", { item, active: active || item.active, index, ui: ui2.value, close }, () => { var _a6, _b4, _c4, _d4; return [ vue.createElementVNode("ul", { "data-slot": "childList", class: vue.normalizeClass(ui2.value.childList({ class: [(_a6 = vue.unref(props).ui) == null ? void 0 : _a6.childList, (_b4 = item.ui) == null ? void 0 : _b4.childList] })) }, [ vue.createElementVNode("li", { "data-slot": "childLabel", class: vue.normalizeClass(ui2.value.childLabel({ class: [(_c4 = vue.unref(props).ui) == null ? void 0 : _c4.childLabel, (_d4 = item.ui) == null ? void 0 : _d4.childLabel] })) }, vue.toDisplayString(vue.unref(get)(item, vue.unref(props).labelKey)), 3), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.children, (childItem, childIndex) => { var _a7, _b5; return vue.openBlock(), vue.createElementBlock("li", { key: childIndex, "data-slot": "childItem", class: vue.normalizeClass(ui2.value.childItem({ class: [(_a7 = vue.unref(props).ui) == null ? void 0 : _a7.childItem, (_b5 = item.ui) == null ? void 0 : _b5.childItem] })) }, [ vue.createVNode(_sfc_main$H, vue.mergeProps({ ref_for: true }, vue.unref(pickLinkProps)(childItem), { custom: "" }), { default: vue.withCtx(({ active: childActive, ...childSlotProps }) => [ vue.createVNode(vue.unref(NavigationMenuLink_default), { "as-child": "", active: childActive, onSelect: childItem.onSelect }, { default: vue.withCtx(() => { var _a8, _b6; return [ vue.createVNode(_sfc_main$I, vue.mergeProps({ ref_for: true }, childSlotProps, { "data-slot": "childLink", class: ui2.value.childLink({ class: [(_a8 = vue.unref(props).ui) == null ? void 0 : _a8.childLink, (_b6 = item.ui) == null ? void 0 : _b6.childLink, childItem.class], active: childActive }) }), { default: vue.withCtx(() => { var _a9, _b7, _c5, _d5, _e5, _f2; return [ childItem.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: childItem.icon, "data-slot": "childLinkIcon", class: vue.normalizeClass(ui2.value.childLinkIcon({ class: [(_a9 = vue.unref(props).ui) == null ? void 0 : _a9.childLinkIcon, (_b7 = item.ui) == null ? void 0 : _b7.childLinkIcon], active: childActive })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true), vue.createElementVNode("span", { "data-slot": "childLinkLabel", class: vue.normalizeClass(ui2.value.childLinkLabel({ class: [(_c5 = vue.unref(props).ui) == null ? void 0 : _c5.childLinkLabel, (_d5 = item.ui) == null ? void 0 : _d5.childLinkLabel], active: childActive })) }, [ vue.createTextVNode(vue.toDisplayString(vue.unref(get)(childItem, vue.unref(props).labelKey)) + " ", 1), childItem.target === "_blank" && vue.unref(props).externalIcon !== false ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: typeof vue.unref(props).externalIcon === "string" ? vue.unref(props).externalIcon : vue.unref(appConfig2).ui.icons.external, "data-slot": "childLinkLabelExternalIcon", class: vue.normalizeClass(ui2.value.childLinkLabelExternalIcon({ class: [(_e5 = vue.unref(props).ui) == null ? void 0 : _e5.childLinkLabelExternalIcon, (_f2 = item.ui) == null ? void 0 : _f2.childLinkLabelExternalIcon], active: childActive })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ], 2) ]; }), _: 2 }, 1040, ["class"]) ]; }), _: 2 }, 1032, ["active", "onSelect"]) ]), _: 2 }, 1040) ], 2); }), 128)) ], 2) ]; }) ]), default: vue.withCtx(() => { var _a6, _b4; return [ vue.createVNode(_sfc_main$I, vue.mergeProps(slotProps, { "data-slot": "link", class: ui2.value.link({ class: [(_a6 = vue.unref(props).ui) == null ? void 0 : _a6.link, (_b4 = item.ui) == null ? void 0 : _b4.link, item.class], active: active || item.active, disabled: !!item.disabled, level: level > 0 }) }), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(ReuseLinkTemplate), { item, active: active || item.active, index, "trailing-trigger": !!slotProps.href }, null, 8, ["item", "active", "index", "trailing-trigger"]) ]), _: 2 }, 1040, ["class"]) ]; }), _: 2 }, 1040, ["ui"])) : vue.unref(props).orientation === "vertical" && vue.unref(props).collapsed && (!!vue.unref(props).tooltip || !!item.tooltip) || vue.unref(props).orientation === "horizontal" && !!item.tooltip ? (vue.openBlock(), vue.createBlock(_sfc_main$z, vue.mergeProps({ key: 1, text: vue.unref(get)(item, vue.unref(props).labelKey) }, { ...tooltipProps.value, ...typeof item.tooltip === "boolean" ? {} : item.tooltip || {} }), { default: vue.withCtx(() => { var _a6, _b4; return [ vue.createVNode(_sfc_main$I, vue.mergeProps(slotProps, { "data-slot": "link", class: ui2.value.link({ class: [(_a6 = vue.unref(props).ui) == null ? void 0 : _a6.link, (_b4 = item.ui) == null ? void 0 : _b4.link, item.class], active: active || item.active, disabled: !!item.disabled, level: level > 0 }), onClick: onLinkClick }), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(ReuseLinkTemplate), { item, active: active || item.active, index, "trailing-trigger": !!slotProps.href }, null, 8, ["item", "active", "index", "trailing-trigger"]) ]), _: 2 }, 1040, ["class"]) ]; }), _: 2 }, 1040, ["text"])) : (vue.openBlock(), vue.createBlock(_sfc_main$I, vue.mergeProps({ key: 2 }, slotProps, { "data-slot": "link", class: ui2.value.link({ class: [(_d3 = vue.unref(props).ui) == null ? void 0 : _d3.link, (_e4 = item.ui) == null ? void 0 : _e4.link, item.class], active: active || item.active, disabled: !!item.disabled, level: vue.unref(props).orientation === "horizontal" || level > 0 }), onClick: onLinkClick }), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(ReuseLinkTemplate), { item, active: active || item.active, index, "trailing-trigger": !!slotProps.href }, null, 8, ["item", "active", "index", "trailing-trigger"]) ]), _: 2 }, 1040, ["class"])) ]; }), _: 2 }, 1064, ["active", "disabled", "onSelect"])), vue.unref(props).orientation === "horizontal" && (((_c2 = item.children) == null ? void 0 : _c2.length) || !!slots[item.slot ? `${item.slot}-content` : "item-content"]) ? (vue.openBlock(), vue.createBlock(vue.unref(NavigationMenuContent_default), vue.mergeProps({ key: 0 }, contentProps.value, { "data-slot": "content", class: ui2.value.content({ class: [(_d2 = vue.unref(props).ui) == null ? void 0 : _d2.content, (_e3 = item.ui) == null ? void 0 : _e3.content] }) }), { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, item.slot ? `${item.slot}-content` : "item-content", { item, active: active || item.active, index, ui: ui2.value }, () => { var _a5, _b3; return [ vue.createElementVNode("ul", { "data-slot": "childList", class: vue.normalizeClass(ui2.value.childList({ class: [(_a5 = vue.unref(props).ui) == null ? void 0 : _a5.childList, (_b3 = item.ui) == null ? void 0 : _b3.childList] })) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.children, (childItem, childIndex) => { var _a6, _b4; return vue.openBlock(), vue.createElementBlock("li", { key: childIndex, "data-slot": "childItem", class: vue.normalizeClass(ui2.value.childItem({ class: [(_a6 = vue.unref(props).ui) == null ? void 0 : _a6.childItem, (_b4 = item.ui) == null ? void 0 : _b4.childItem] })) }, [ vue.createVNode(_sfc_main$H, vue.mergeProps({ ref_for: true }, vue.unref(pickLinkProps)(childItem), { custom: "" }), { default: vue.withCtx(({ active: childActive, ...childSlotProps }) => [ vue.createVNode(vue.unref(NavigationMenuLink_default), { "as-child": "", active: childActive, onSelect: childItem.onSelect }, { default: vue.withCtx(() => { var _a7, _b5; return [ vue.createVNode(_sfc_main$I, vue.mergeProps({ ref_for: true }, childSlotProps, { "data-slot": "childLink", class: ui2.value.childLink({ class: [(_a7 = vue.unref(props).ui) == null ? void 0 : _a7.childLink, (_b5 = item.ui) == null ? void 0 : _b5.childLink, childItem.class], active: childActive }) }), { default: vue.withCtx(() => { var _a8, _b6, _c3, _d3, _e4, _f2, _g, _h, _i, _j; return [ childItem.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: childItem.icon, "data-slot": "childLinkIcon", class: vue.normalizeClass(ui2.value.childLinkIcon({ class: [(_a8 = vue.unref(props).ui) == null ? void 0 : _a8.childLinkIcon, (_b6 = item.ui) == null ? void 0 : _b6.childLinkIcon], active: childActive })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true), vue.createElementVNode("div", { "data-slot": "childLinkWrapper", class: vue.normalizeClass(ui2.value.childLinkWrapper({ class: [(_c3 = vue.unref(props).ui) == null ? void 0 : _c3.childLinkWrapper, (_d3 = item.ui) == null ? void 0 : _d3.childLinkWrapper] })) }, [ vue.createElementVNode("p", { "data-slot": "childLinkLabel", class: vue.normalizeClass(ui2.value.childLinkLabel({ class: [(_e4 = vue.unref(props).ui) == null ? void 0 : _e4.childLinkLabel, (_f2 = item.ui) == null ? void 0 : _f2.childLinkLabel], active: childActive })) }, [ vue.createTextVNode(vue.toDisplayString(vue.unref(get)(childItem, vue.unref(props).labelKey)) + " ", 1), childItem.target === "_blank" && vue.unref(props).externalIcon !== false ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: typeof vue.unref(props).externalIcon === "string" ? vue.unref(props).externalIcon : vue.unref(appConfig2).ui.icons.external, "data-slot": "childLinkLabelExternalIcon", class: vue.normalizeClass(ui2.value.childLinkLabelExternalIcon({ class: [(_g = vue.unref(props).ui) == null ? void 0 : _g.childLinkLabelExternalIcon, (_h = item.ui) == null ? void 0 : _h.childLinkLabelExternalIcon], active: childActive })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ], 2), childItem.description ? (vue.openBlock(), vue.createElementBlock("p", { key: 0, "data-slot": "childLinkDescription", class: vue.normalizeClass(ui2.value.childLinkDescription({ class: [(_i = vue.unref(props).ui) == null ? void 0 : _i.childLinkDescription, (_j = item.ui) == null ? void 0 : _j.childLinkDescription], active: childActive })) }, vue.toDisplayString(childItem.description), 3)) : vue.createCommentVNode("", true) ], 2) ]; }), _: 2 }, 1040, ["class"]) ]; }), _: 2 }, 1032, ["active", "onSelect"]) ]), _: 2 }, 1040) ], 2); }), 128)) ], 2) ]; }) ]), _: 2 }, 1040, ["class"])) : vue.createCommentVNode("", true) ]; }), _: 2 }, 1040)) : vue.createCommentVNode("", true), vue.unref(props).orientation === "vertical" && ((_d = item.children) == null ? void 0 : _d.length) && !vue.unref(props).collapsed ? (vue.openBlock(), vue.createBlock(vue.unref(AccordionContent_default), { key: 2, "data-slot": "content", class: vue.normalizeClass(ui2.value.content({ class: [(_e2 = vue.unref(props).ui) == null ? void 0 : _e2.content, (_f = item.ui) == null ? void 0 : _f.content] })) }, { default: vue.withCtx(() => { var _a4, _b2; return [ vue.createVNode(vue.unref(AccordionRoot_default), vue.mergeProps({ ...vue.unref(accordionProps), defaultValue: getAccordionDefaultValue(item.children, level + 1, listIndex) }, { as: "ul", "data-slot": "childList", class: ui2.value.childList({ class: [(_a4 = vue.unref(props).ui) == null ? void 0 : _a4.childList, (_b2 = item.ui) == null ? void 0 : _b2.childList] }) }), { default: vue.withCtx(() => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.children, (childItem, childIndex) => { var _a5, _b3; return vue.openBlock(), vue.createBlock(vue.unref(ReuseItemTemplate), { key: childIndex, item: childItem, index: childIndex, level: level + 1, "list-index": listIndex, "data-slot": "childItem", class: vue.normalizeClass(ui2.value.childItem({ class: [(_a5 = vue.unref(props).ui) == null ? void 0 : _a5.childItem, (_b3 = childItem.ui) == null ? void 0 : _b3.childItem] })) }, null, 8, ["item", "index", "level", "list-index", "class"]); }), 128)) ]), _: 2 }, 1040, ["class"]) ]; }), _: 2 }, 1032, ["class"])) : vue.createCommentVNode("", true) ]; }), _: 2 }, 1040, ["value"])) ]), _: 3 }), vue.createVNode(vue.unref(NavigationMenuRoot_default), vue.mergeProps({ "data-slot": "root" }, { ...vue.unref(rootProps), ...vue.unref(props).orientation === "horizontal" ? { modelValue: vue.unref(props).modelValue, defaultValue: vue.unref(props).defaultValue } : {}, ..._ctx.$attrs }, { "data-collapsed": vue.unref(props).collapsed, class: ui2.value.root({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.root, vue.unref(props).class] }) }), { default: vue.withCtx(() => { var _a3, _b, _c; return [ vue.renderSlot(_ctx.$slots, "list-leading"), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(lists.value, (list, listIndex) => { var _a4, _b2, _c2; return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: `list-${listIndex}` }, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).orientation === "vertical" ? vue.unref(AccordionRoot_default) : vue.unref(NavigationMenuList_default)), vue.mergeProps({ ref_for: true }, vue.unref(props).orientation === "vertical" && !vue.unref(props).collapsed ? { ...vue.unref(accordionProps), modelValue: vue.unref(props).modelValue, defaultValue: (_a4 = vue.unref(props).defaultValue) != null ? _a4 : getAccordionDefaultValue(list, 0, listIndex) } : {}, { as: "ul", "data-slot": "list", class: ui2.value.list({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.list }) }), { default: vue.withCtx(() => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list, (item, index) => { var _a5, _b3; return vue.openBlock(), vue.createBlock(vue.unref(ReuseItemTemplate), { key: `list-${listIndex}-${index}`, item, index, "list-index": listIndex, "data-slot": "item", class: vue.normalizeClass(ui2.value.item({ class: [(_a5 = vue.unref(props).ui) == null ? void 0 : _a5.item, (_b3 = item.ui) == null ? void 0 : _b3.item] })) }, null, 8, ["item", "index", "list-index", "class"]); }), 128)) ]), _: 2 }, 1040, ["class"])), vue.unref(props).orientation === "vertical" && listIndex < lists.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "separator", class: vue.normalizeClass(ui2.value.separator({ class: (_c2 = vue.unref(props).ui) == null ? void 0 : _c2.separator })) }, null, 2)) : vue.createCommentVNode("", true) ], 64); }), 128)), vue.renderSlot(_ctx.$slots, "list-trailing"), vue.unref(props).orientation === "horizontal" ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "viewportWrapper", class: vue.normalizeClass(ui2.value.viewportWrapper({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.viewportWrapper })) }, [ vue.unref(props).arrow ? (vue.openBlock(), vue.createBlock(vue.unref(NavigationMenuIndicator_default), { key: 0, "data-slot": "indicator", class: vue.normalizeClass(ui2.value.indicator({ class: (_b = vue.unref(props).ui) == null ? void 0 : _b.indicator })) }, { default: vue.withCtx(() => { var _a4; return [ vue.createElementVNode("div", { "data-slot": "arrow", class: vue.normalizeClass(ui2.value.arrow({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.arrow })) }, null, 2) ]; }), _: 1 }, 8, ["class"])) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(NavigationMenuViewport_default), vue.mergeProps(viewportProps.value, { "data-slot": "viewport", class: ui2.value.viewport({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.viewport }) }), null, 16, ["class"]) ], 2)) : vue.createCommentVNode("", true) ]; }), _: 3 }, 16, ["data-collapsed", "class"]) ], 64); }; } }); const theme$b = { "slots": { "root": "relative flex items-start", "base": [ "inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-3 data-[state=unchecked]:bg-accented", "transition-[background] duration-200 ease-out" ], "container": "flex items-center", "thumb": "group pointer-events-none rounded-full bg-default shadow-lg ring-0 transition-transform duration-200 ease-out motion-reduce:transition-none data-[state=unchecked]:translate-x-0 data-[state=unchecked]:rtl:-translate-x-0 flex items-center justify-center", "icon": [ "absolute shrink-0 group-data-[state=unchecked]:text-dimmed opacity-0 size-10/12", "transition-[color,opacity] duration-200 ease-out" ], "wrapper": "ms-2", "label": "block font-medium text-default", "description": "text-muted" }, "variants": { "color": { "primary": { "base": "data-[state=checked]:bg-primary outline-primary/25", "icon": "group-data-[state=checked]:text-primary" }, "success": { "base": "data-[state=checked]:bg-success outline-success/25", "icon": "group-data-[state=checked]:text-success" }, "info": { "base": "data-[state=checked]:bg-info outline-info/25", "icon": "group-data-[state=checked]:text-info" }, "warning": { "base": "data-[state=checked]:bg-warning outline-warning/25", "icon": "group-data-[state=checked]:text-warning" }, "error": { "base": "data-[state=checked]:bg-error outline-error/25", "icon": "group-data-[state=checked]:text-error" }, "neutral": { "base": "data-[state=checked]:bg-inverted outline-inverted/25", "icon": "group-data-[state=checked]:text-highlighted" } }, "size": { "xs": { "base": "w-7", "container": "h-4", "thumb": "size-3 data-[state=checked]:translate-x-3 data-[state=checked]:rtl:-translate-x-3", "wrapper": "text-xs" }, "sm": { "base": "w-8", "container": "h-4", "thumb": "size-3.5 data-[state=checked]:translate-x-3.5 data-[state=checked]:rtl:-translate-x-3.5", "wrapper": "text-xs" }, "md": { "base": "w-9", "container": "h-5", "thumb": "size-4 data-[state=checked]:translate-x-4 data-[state=checked]:rtl:-translate-x-4", "wrapper": "text-sm" }, "lg": { "base": "w-10", "container": "h-5", "thumb": "size-4.5 data-[state=checked]:translate-x-4.5 data-[state=checked]:rtl:-translate-x-4.5", "wrapper": "text-sm" }, "xl": { "base": "w-11", "container": "h-6", "thumb": "size-5 data-[state=checked]:translate-x-5 data-[state=checked]:rtl:-translate-x-5", "wrapper": "text-base" } }, "checked": { "true": { "icon": "group-data-[state=checked]:opacity-100" } }, "unchecked": { "true": { "icon": "group-data-[state=unchecked]:opacity-100" } }, "loading": { "true": { "icon": "animate-spin" } }, "highlight": { "true": "" }, "required": { "true": { "label": "after:content-['*'] after:ms-0.5 after:text-error" } }, "disabled": { "true": { "root": "opacity-75", "base": "cursor-not-allowed", "label": "cursor-not-allowed", "description": "cursor-not-allowed" } } }, "compoundVariants": [ { "color": "primary", "highlight": true, "class": { "base": "ring ring-primary" } }, { "color": "success", "highlight": true, "class": { "base": "ring ring-success" } }, { "color": "info", "highlight": true, "class": { "base": "ring ring-info" } }, { "color": "warning", "highlight": true, "class": { "base": "ring ring-warning" } }, { "color": "error", "highlight": true, "class": { "base": "ring ring-error" } }, { "color": "neutral", "highlight": true, "class": { "base": "ring ring-inverted" } } ], "defaultVariants": { "color": "primary", "size": "md" } }; const _sfc_main$x = Object.assign({ inheritAttrs: false }, { __name: "Switch", props: { as: { type: null, required: false }, color: { type: null, required: false }, size: { type: null, required: false }, highlight: { type: Boolean, required: false }, loading: { type: Boolean, required: false }, loadingIcon: { type: null, required: false }, checkedIcon: { type: null, required: false }, uncheckedIcon: { type: null, required: false }, label: { type: String, required: false }, description: { type: String, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, disabled: { type: Boolean, required: false }, id: { type: String, required: false }, name: { type: String, required: false }, required: { type: Boolean, required: false }, value: { type: String, required: false }, defaultValue: { type: null, required: false }, modelValue: { type: null, required: false }, trueValue: { type: null, required: false }, falseValue: { type: null, required: false } }, emits: ["change", "update:modelValue"], setup(__props, { emit: __emit }) { var _a2; const _props = __props; const slots = vue.useSlots(); const emits = __emit; const props = useComponentProps("switch", _props); const appConfig2 = useAppConfig(); const rootProps = useForwardProps(reactivePick(props, "required", "value", "defaultValue", "modelValue", "trueValue", "falseValue"), emits); const { id: _id, emitFormChange, emitFormInput, size: formFieldSize, color: formFieldColor, highlight: formFieldHighlight, name, disabled: formFieldDisabled, ariaAttrs } = useFormField(_props); const id = (_a2 = _id.value) != null ? _a2 : vue.useId(); const color = vue.computed(() => { var _a3; return (_a3 = formFieldColor.value) != null ? _a3 : props.color; }); const highlight = vue.computed(() => { var _a3; return (_a3 = formFieldHighlight.value) != null ? _a3 : props.highlight; }); const size2 = vue.computed(() => { var _a3; return (_a3 = formFieldSize.value) != null ? _a3 : props.size; }); const disabled = vue.computed(() => { var _a3; return (_a3 = formFieldDisabled.value) != null ? _a3 : props.disabled; }); const attrs = vue.useAttrs(); const forwardedAttrs = vue.computed(() => { const { "data-state": _2, ...rest } = attrs; return rest; }); const ui2 = vue.computed(() => { var _a3; return tv({ extend: theme$b, ...((_a3 = appConfig2.ui) == null ? void 0 : _a3.switch) || {} })({ size: size2.value, color: color.value, highlight: highlight.value, required: props.required, loading: props.loading, disabled: disabled.value || props.loading }); }); function onUpdate(value) { const event = new Event("change", { target: { value } }); emits("change", event); emitFormChange(); emitFormInput(); } return (_ctx, _cache) => { var _a3, _b; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: vue.unref(props).as, "data-slot": (_a3 = _ctx.$attrs["data-slot"]) != null ? _a3 : "root", class: vue.normalizeClass(ui2.value.root({ class: [(_b = vue.unref(props).ui) == null ? void 0 : _b.root, vue.unref(props).class] })) }, { default: vue.withCtx(() => { var _a4, _b2, _c, _d, _e2; return [ vue.createElementVNode("div", { "data-slot": "container", class: vue.normalizeClass(ui2.value.container({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.container })) }, [ vue.createVNode(vue.unref(SwitchRoot_default), vue.mergeProps({ id: vue.unref(id) }, { ...vue.unref(rootProps), ...forwardedAttrs.value, ...vue.unref(ariaAttrs) }, { name: vue.unref(name), disabled: disabled.value || vue.unref(props).loading, "data-slot": "base", class: ui2.value.base({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.base }), "onUpdate:modelValue": onUpdate }), { default: vue.withCtx(() => { var _a5; return [ vue.createVNode(vue.unref(SwitchThumb_default), { "data-slot": "thumb", class: vue.normalizeClass(ui2.value.thumb({ class: (_a5 = vue.unref(props).ui) == null ? void 0 : _a5.thumb })) }, { default: vue.withCtx(() => { var _a6, _b3, _c2; return [ vue.unref(props).loading ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(props).loadingIcon || vue.unref(appConfig2).ui.icons.loading, "data-slot": "icon", class: vue.normalizeClass(ui2.value.icon({ class: (_a6 = vue.unref(props).ui) == null ? void 0 : _a6.icon, checked: true, unchecked: true })) }, null, 8, ["name", "class"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ vue.unref(props).checkedIcon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(props).checkedIcon, "data-slot": "icon", class: vue.normalizeClass(ui2.value.icon({ class: (_b3 = vue.unref(props).ui) == null ? void 0 : _b3.icon, checked: true })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true), vue.unref(props).uncheckedIcon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 1, name: vue.unref(props).uncheckedIcon, "data-slot": "icon", class: vue.normalizeClass(ui2.value.icon({ class: (_c2 = vue.unref(props).ui) == null ? void 0 : _c2.icon, unchecked: true })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ], 64)) ]; }), _: 1 }, 8, ["class"]) ]; }), _: 1 }, 16, ["id", "name", "disabled", "class"]) ], 2), vue.unref(props).label || !!slots.label || (vue.unref(props).description || !!slots.description) ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "wrapper", class: vue.normalizeClass(ui2.value.wrapper({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.wrapper })) }, [ vue.unref(props).label || !!slots.label ? (vue.openBlock(), vue.createBlock(vue.unref(Label_default), { key: 0, for: vue.unref(id), "data-slot": "label", class: vue.normalizeClass(ui2.value.label({ class: (_d = vue.unref(props).ui) == null ? void 0 : _d.label })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "label", { label: vue.unref(props).label }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).label), 1) ]) ]), _: 3 }, 8, ["for", "class"])) : vue.createCommentVNode("", true), vue.unref(props).description || !!slots.description ? (vue.openBlock(), vue.createElementBlock("p", { key: 1, "data-slot": "description", class: vue.normalizeClass(ui2.value.description({ class: (_e2 = vue.unref(props).ui) == null ? void 0 : _e2.description })) }, [ vue.renderSlot(_ctx.$slots, "description", { description: vue.unref(props).description }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).description), 1) ]) ], 2)) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true) ]; }), _: 3 }, 8, ["as", "data-slot", "class"]); }; } }); function useTransferStore() { const state2 = vue.shallowRef(getTransferSnapshot()); const off = subscribeTransfer(() => { state2.value = getTransferSnapshot(); }); vue.onScopeDispose(off); return state2; } const theme$a = { "slots": { "overlay": "fixed inset-0", "content": "bg-default divide-y divide-default flex flex-col focus:outline-none", "header": "flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)", "wrapper": "", "body": "flex-1 p-4 sm:p-6", "footer": "flex items-center gap-1.5 p-4 sm:px-6", "title": "text-highlighted font-semibold", "description": "mt-1 text-muted text-sm", "close": "absolute top-4 end-4" }, "variants": { "transition": { "true": { "overlay": "data-[state=open]:animate-[fade-in_200ms_var(--ease-out)] data-[state=closed]:animate-[fade-out_200ms_var(--ease-out)]", "content": "data-[state=open]:animate-[scale-in_200ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_200ms_var(--ease-out)]" } }, "fullscreen": { "true": { "content": "inset-0" }, "false": { "content": "w-[calc(100vw-2rem)] max-w-lg rounded-lg shadow-lg ring ring-default" } }, "overlay": { "true": { "overlay": "bg-elevated/75" } }, "scrollable": { "true": { "overlay": "overflow-y-auto", "content": "relative" }, "false": { "content": "fixed", "body": "overflow-y-auto" } } }, "compoundVariants": [ { "scrollable": true, "fullscreen": false, "class": { "overlay": "grid place-items-center p-4 sm:py-8" } }, { "scrollable": false, "fullscreen": false, "class": { "content": "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)] overflow-hidden" } } ] }; const _sfc_main$w = { __name: "Modal", props: { title: { type: String, required: false }, description: { type: String, required: false }, content: { type: Object, required: false }, overlay: { type: Boolean, required: false, default: true }, scrollable: { type: Boolean, required: false }, transition: { type: Boolean, required: false, default: true }, fullscreen: { type: Boolean, required: false }, portal: { type: [Boolean, String], required: false, skipCheck: true, default: true }, close: { type: [Boolean, Object], required: false, default: true }, closeIcon: { type: null, required: false }, dismissible: { type: Boolean, required: false, default: true }, class: { type: null, required: false }, ui: { type: Object, required: false }, open: { type: Boolean, required: false }, defaultOpen: { type: Boolean, required: false }, modal: { type: Boolean, required: false, default: true }, unmountOnHide: { type: Boolean, required: false } }, emits: ["leave", "after:leave", "enter", "after:enter", "close:prevent", "update:open"], setup(__props, { emit: __emit }) { const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("modal", _props); const { t } = useLocale$1(); const appConfig2 = useAppConfig(); const rootProps = useForwardProps(reactivePick(props, "open", "defaultOpen", "modal", "unmountOnHide"), emits); const portalProps = usePortal(vue.toRef(() => props.portal)); const contentProps = vue.toRef(() => props.content); const contentEvents = vue.computed(() => { if (!props.dismissible) { const events = ["interactOutside", "escapeKeyDown"]; return events.reduce((acc, curr) => { acc[curr] = (e) => { e.preventDefault(); emits("close:prevent"); }; return acc; }, {}); } return { pointerDownOutside: (e) => pointerDownOutside(e, { scrollable: props.scrollable }) }; }); const [DefineContentTemplate, ReuseContentTemplate] = createReusableTemplate(); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$a, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.modal) || {} })({ transition: props.transition, fullscreen: props.fullscreen, overlay: props.overlay, scrollable: props.scrollable }); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(DialogRoot_default), vue.normalizeProps(vue.guardReactiveProps(vue.unref(rootProps))), { default: vue.withCtx(({ open, close }) => [ vue.createVNode(vue.unref(DefineContentTemplate), null, { default: vue.withCtx(() => { var _a2; return [ vue.createVNode(vue.unref(DialogContent_default), vue.mergeProps({ "data-slot": "content", class: ui2.value.content({ class: [!slots.default && vue.unref(props).class, (_a2 = vue.unref(props).ui) == null ? void 0 : _a2.content] }) }, contentProps.value, { onEnter: _cache[0] || (_cache[0] = ($event) => !vue.unref(props).scrollable && emits("enter")), onAfterEnter: _cache[1] || (_cache[1] = ($event) => !vue.unref(props).scrollable && emits("after:enter")), onLeave: _cache[2] || (_cache[2] = ($event) => !vue.unref(props).scrollable && emits("leave")), onAfterLeave: _cache[3] || (_cache[3] = ($event) => !vue.unref(props).scrollable && emits("after:leave")) }, vue.toHandlers(contentEvents.value)), { default: vue.withCtx(() => [ !vue.unref(props).title && !slots.title || !vue.unref(props).description && !slots.description || !!slots.content ? (vue.openBlock(), vue.createBlock(vue.unref(VisuallyHidden_default), { key: 0 }, { default: vue.withCtx(() => [ !vue.unref(props).title && !slots.title ? (vue.openBlock(), vue.createBlock(vue.unref(DialogTitle_default), { key: 0 })) : !!slots.content ? (vue.openBlock(), vue.createBlock(vue.unref(DialogTitle_default), { key: 1 }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "title", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).title), 1) ]) ]), _: 3 })) : vue.createCommentVNode("", true), !vue.unref(props).description && !slots.description ? (vue.openBlock(), vue.createBlock(vue.unref(DialogDescription_default), { key: 2 })) : !!slots.content ? (vue.openBlock(), vue.createBlock(vue.unref(DialogDescription_default), { key: 3 }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "description", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).description), 1) ]) ]), _: 3 })) : vue.createCommentVNode("", true) ]), _: 3 })) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "content", { close }, () => { var _a3, _b, _c; return [ !!slots.header || (vue.unref(props).title || !!slots.title) || (vue.unref(props).description || !!slots.description) || (vue.unref(props).close || !!slots.close) ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "header", class: vue.normalizeClass(ui2.value.header({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.header })) }, [ vue.renderSlot(_ctx.$slots, "header", { close }, () => { var _a4, _b2, _c2; return [ vue.unref(props).title || !!slots.title || vue.unref(props).description || !!slots.description ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "wrapper", class: vue.normalizeClass(ui2.value.wrapper({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.wrapper })) }, [ vue.unref(props).title || !!slots.title ? (vue.openBlock(), vue.createBlock(vue.unref(DialogTitle_default), { key: 0, "data-slot": "title", class: vue.normalizeClass(ui2.value.title({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.title })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "title", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).title), 1) ]) ]), _: 3 }, 8, ["class"])) : vue.createCommentVNode("", true), vue.unref(props).description || !!slots.description ? (vue.openBlock(), vue.createBlock(vue.unref(DialogDescription_default), { key: 1, "data-slot": "description", class: vue.normalizeClass(ui2.value.description({ class: (_c2 = vue.unref(props).ui) == null ? void 0 : _c2.description })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "description", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).description), 1) ]) ]), _: 3 }, 8, ["class"])) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "actions"), vue.unref(props).close || !!slots.close ? (vue.openBlock(), vue.createBlock(vue.unref(DialogClose_default), { key: 1, "as-child": "" }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "close", { ui: ui2.value }, () => { var _a5; return [ vue.unref(props).close ? (vue.openBlock(), vue.createBlock(_sfc_main$G, vue.mergeProps({ key: 0, icon: vue.unref(props).closeIcon || vue.unref(appConfig2).ui.icons.close, color: "neutral", variant: "ghost", "aria-label": vue.unref(t)("modal.close") }, typeof vue.unref(props).close === "object" ? vue.unref(props).close : {}, { "data-slot": "close", class: ui2.value.close({ class: (_a5 = vue.unref(props).ui) == null ? void 0 : _a5.close }) }), null, 16, ["icon", "aria-label", "class"])) : vue.createCommentVNode("", true) ]; }) ]), _: 2 }, 1024)) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true), !!slots.body ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, "data-slot": "body", class: vue.normalizeClass(ui2.value.body({ class: (_b = vue.unref(props).ui) == null ? void 0 : _b.body })) }, [ vue.renderSlot(_ctx.$slots, "body", { close }) ], 2)) : vue.createCommentVNode("", true), !!slots.footer ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, "data-slot": "footer", class: vue.normalizeClass(ui2.value.footer({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.footer })) }, [ vue.renderSlot(_ctx.$slots, "footer", { close }) ], 2)) : vue.createCommentVNode("", true) ]; }) ]), _: 2 }, 1040, ["class"]) ]; }), _: 2 }, 1024), !!slots.default ? (vue.openBlock(), vue.createBlock(vue.unref(DialogTrigger_default), { key: 0, "as-child": "", class: vue.normalizeClass(vue.unref(props).class) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default", { open }) ]), _: 2 }, 1032, ["class"])) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(DialogPortal_default), vue.mergeProps(vue.unref(portalProps), { "force-mount": vue.unref(portalProps).disabled && vue.unref(props).unmountOnHide === false || void 0 }), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(FieldGroupReset), null, { default: vue.withCtx(() => { var _a2, _b; return [ vue.unref(props).scrollable ? (vue.openBlock(), vue.createBlock(vue.unref(DialogOverlay_default), { key: 0, "data-slot": "overlay", class: vue.normalizeClass(ui2.value.overlay({ class: (_a2 = vue.unref(props).ui) == null ? void 0 : _a2.overlay })), onEnter: _cache[4] || (_cache[4] = ($event) => emits("enter")), onAfterEnter: _cache[5] || (_cache[5] = ($event) => emits("after:enter")), onLeave: _cache[6] || (_cache[6] = ($event) => emits("leave")), onAfterLeave: _cache[7] || (_cache[7] = ($event) => emits("after:leave")) }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(ReuseContentTemplate)) ]), _: 1 }, 8, ["class"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ vue.unref(props).overlay ? (vue.openBlock(), vue.createBlock(vue.unref(DialogOverlay_default), { key: 0, "data-slot": "overlay", class: vue.normalizeClass(ui2.value.overlay({ class: (_b = vue.unref(props).ui) == null ? void 0 : _b.overlay })) }, null, 8, ["class"])) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(ReuseContentTemplate)) ], 64)) ]; }), _: 1 }) ]), _: 1 }, 16, ["force-mount"]) ]), _: 3 }, 16); }; } }; const _hoisted_1$i = ["data-state"]; const _hoisted_2$g = { class: "mb-3 flex items-center justify-between gap-3" }; const _hoisted_3$e = { key: 0, class: "min-h-0 flex-1 overflow-y-auto" }; const _hoisted_4$d = { key: 2, class: "mt-6 flex flex-wrap items-center justify-end gap-2" }; const _sfc_main$v = vue.defineComponent({ __name: "AppModal", props: vue.mergeModels({ title: {}, description: { default: "" }, width: { default: 520 }, height: { default: 0 }, footer: { type: Boolean, default: true }, variant: { default: "default" }, stopKeydown: { type: Boolean, default: false } }, { "open": { type: Boolean, ...{ default: false } }, "openModifiers": {} }), emits: ["update:open"], setup(__props) { const open = vue.useModel(__props, "open"); const props = __props; const plain = vue.computed(() => props.variant === "plain"); function onKeydown(ev) { if (!props.stopKeydown) return; if (ev.key === "Tab") return; ev.stopPropagation(); if (ev.key === "Escape") open.value = false; } const contentStyle = vue.computed(() => { const s = { width: props.width + "px", maxWidth: "calc(100vw - 32px)" }; if (props.height > 0) s.height = props.height + "px"; return s; }); function onInteractOutside(ev) { var _a2; const detail = ev.detail; const path = typeof ((_a2 = detail == null ? void 0 : detail.originalEvent) == null ? void 0 : _a2.composedPath) === "function" ? detail.originalEvent.composedPath() : []; if (path.some((n) => n instanceof Element && n.hasAttribute("data-dismissable-layer"))) { ev.preventDefault(); } } const contentProps = vue.computed( () => ({ style: contentStyle.value, onInteractOutside }) ); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(_sfc_main$w, { open: open.value, "onUpdate:open": _cache[2] || (_cache[2] = ($event) => open.value = $event), title: props.title, "unmount-on-hide": false, content: contentProps.value }, { content: vue.withCtx(() => [ vue.createElementVNode("div", { "data-znhd": "dialog", "data-state": open.value ? "open" : "closed", class: "flex min-h-0 w-full flex-1 flex-col overflow-y-auto p-4 sm:p-6", onKeydown }, [ vue.createElementVNode("div", _hoisted_2$g, [ vue.createElementVNode("h3", { class: vue.normalizeClass( plain.value ? "min-w-0 truncate text-[15px] font-semibold leading-6" : "flex min-w-0 flex-1 items-center gap-2 text-[15px] font-semibold leading-6" ) }, [ vue.renderSlot(_ctx.$slots, "title", {}, () => [ vue.createTextVNode(vue.toDisplayString(props.title), 1) ]) ], 2), vue.createVNode(_sfc_main$G, { icon: "i-lucide-x", size: plain.value ? "sm" : "md", color: "primary", variant: "ghost", "aria-label": "关闭", onClick: _cache[0] || (_cache[0] = ($event) => open.value = false) }, null, 8, ["size"]) ]), props.height > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$e, [ vue.renderSlot(_ctx.$slots, "default") ])) : vue.renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1), (plain.value ? !!_ctx.$slots.footer : props.footer || _ctx.$slots.footer) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$d, [ vue.renderSlot(_ctx.$slots, "footer", {}, () => [ vue.createVNode(_sfc_main$G, { size: "sm", onClick: _cache[1] || (_cache[1] = ($event) => open.value = false) }, { default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [ vue.createTextVNode("确定", -1) ])]), _: 1 }) ]) ])) : vue.createCommentVNode("", true) ], 40, _hoisted_1$i) ]), _: 3 }, 8, ["open", "title", "content"]); }; } }); const gmHttp = (opts) => new Promise((resolve, reject) => { var _a2; GM_xmlhttpRequest({ method: opts.method, url: opts.url, headers: opts.headers, data: opts.body, timeout: (_a2 = opts.timeout) != null ? _a2 : 2e4, onload: (res) => resolve({ status: res.status, text: res.responseText }), onerror: () => reject(new Error("网络请求失败:" + opts.url)), ontimeout: () => reject(new Error("网络请求超时:" + opts.url)) }); }); function parseJson(text) { try { const v = JSON.parse(text); return v && typeof v === "object" ? v : null; } catch { return null; } } function formEncode(fields) { return Object.keys(fields).map((k) => encodeURIComponent(k) + "=" + encodeURIComponent(fields[k])).join("&"); } function str$1(o2, key) { const v = o2 ? o2[key] : void 0; return typeof v === "string" ? v : ""; } function num$1(o2, key) { const v = o2 ? o2[key] : void 0; const n = typeof v === "number" ? v : typeof v === "string" ? Number(v) : NaN; return Number.isFinite(n) ? n : 0; } const REG_URL = "https://accounts.feishu.cn/oauth/v1/app/registration"; const DEVICE_AUTH_URL = "https://accounts.feishu.cn/oauth/v1/device_authorization"; const TOKEN_URL = "https://accounts.feishu.cn/oauth/v3/token"; const FEISHU_SCOPE = "bitable:app:readonly wiki:wiki:readonly drive:drive:readonly search:docs:read offline_access"; function bodyOf(res) { var _a2; return (_a2 = parseJson(res.text)) != null ? _a2 : {}; } function errorText(body, fallback) { const e = str$1(body, "error"); const d = str$1(body, "error_description"); if (!e && !d) return fallback; return (e || fallback) + (d ? ":" + d : ""); } function basicAuth(clientId, clientSecret) { return "Basic " + btoa(clientId + ":" + clientSecret); } async function beginAppRegistration(http) { const res = await http({ method: "POST", url: REG_URL, headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: formEncode({ action: "begin", archetype: "PersonalAgent", auth_method: "client_secret", request_user_info: "open_id tenant_brand" }) }); const body = bodyOf(res); const deviceCode = str$1(body, "device_code"); if (!deviceCode) { throw new Error( "发起飞书应用注册失败:" + errorText(body, "响应里没有 device_code(HTTP " + res.status + ")") ); } return { deviceCode, userCode: str$1(body, "user_code"), verificationUriComplete: str$1(body, "verification_uri_complete"), expiresIn: num$1(body, "expire_in") || num$1(body, "expires_in") || 600, interval: num$1(body, "interval") || 5 }; } async function pollAppRegistration(http, deviceCode) { const res = await http({ method: "POST", url: REG_URL, headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: formEncode({ action: "poll", device_code: deviceCode }) }); const body = bodyOf(res); const err = str$1(body, "error"); if (err === "authorization_pending" || err === "slow_down") return { status: "pending" }; if (err) return { status: "error", message: errorText(body, "应用注册被拒绝") }; const clientId = str$1(body, "client_id"); if (!clientId) { return { status: "error", message: "应用注册响应里没有 client_id(HTTP " + res.status + ")" }; } const info = body["user_info"] || {}; return { status: "ok", value: { clientId, clientSecret: str$1(body, "client_secret"), openId: str$1(info, "open_id") || void 0 } }; } async function beginDeviceAuthorization(http, cred, scope = FEISHU_SCOPE) { const res = await http({ method: "POST", url: DEVICE_AUTH_URL, headers: { "Content-Type": "application/x-www-form-urlencoded", Authorization: basicAuth(cred.clientId, cred.clientSecret) }, body: formEncode({ client_id: cred.clientId, scope }) }); const body = bodyOf(res); const deviceCode = str$1(body, "device_code"); if (!deviceCode) { throw new Error( "发起飞书数据授权失败:" + errorText(body, "响应里没有 device_code(HTTP " + res.status + ")") ); } return { deviceCode, userCode: str$1(body, "user_code"), verificationUriComplete: str$1(body, "verification_uri_complete"), expiresIn: num$1(body, "expires_in") || 600, interval: num$1(body, "interval") || 5 }; } function toToken(body) { const accessToken = str$1(body, "access_token"); if (!accessToken) return null; const now = Date.now(); return { accessToken, refreshToken: str$1(body, "refresh_token"), expiresAt: now + (num$1(body, "expires_in") || 7200) * 1e3, refreshExpiresAt: now + (num$1(body, "refresh_token_expires_in") || 604800) * 1e3, scope: str$1(body, "scope") }; } async function pollDeviceToken(http, cred, deviceCode) { const res = await http({ method: "POST", url: TOKEN_URL, headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: formEncode({ grant_type: "urn:ietf:params:oauth:grant-type:device_code", device_code: deviceCode, client_id: cred.clientId, client_secret: cred.clientSecret }) }); const body = bodyOf(res); const err = str$1(body, "error"); if (err === "authorization_pending" || err === "slow_down") return { status: "pending" }; if (err === "access_denied") { return { status: "error", message: "飞书拒绝了这次授权(access_denied):当前登录的账号类型不允许把云文档权限授予应用(个人版 / 豆包等第三方登录的账号不支持)。请在浏览器里切换到有企业身份的飞书账号后,重新点「授权飞书账号」再试;若确认用的是企业账号仍被拒,则是该企业管理员禁用了第三方应用授权。" }; } if (err) return { status: "error", message: errorText(body, "换取用户 token 失败") }; const token = toToken(body); if (!token) return { status: "error", message: "token 响应里没有 access_token(HTTP " + res.status + ")" }; return { status: "ok", value: token }; } async function refreshUserToken(http, cred, refreshToken) { const res = await http({ method: "POST", url: TOKEN_URL, headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: formEncode({ grant_type: "refresh_token", refresh_token: refreshToken, client_id: cred.clientId, client_secret: cred.clientSecret }) }); const body = bodyOf(res); const token = toToken(body); if (!token) throw new Error("刷新飞书 token 失败:" + errorText(body, "HTTP " + res.status)); return token; } function remainingMs(token) { return token.expiresAt - Date.now(); } const WIKI_NODE_API = "https://open.feishu.cn/open-apis/wiki/v2/spaces/get_node"; const TABLES_API = "https://open.feishu.cn/open-apis/bitable/v1/apps"; function parseTableLink(raw) { const s = (raw || "").trim(); if (!s) return null; let url; try { url = new URL(/^https?:\/\//i.test(s) ? s : "https://" + s); } catch { return null; } const segs = url.pathname.split("/").filter(Boolean); if (segs.length < 2) return null; const kind = segs[0].toLowerCase(); const token = segs[1]; if (!token) return null; const out = { tableId: url.searchParams.get("table") || void 0, viewId: url.searchParams.get("view") || void 0 }; if (kind === "wiki") out.wikiToken = token; else if (kind === "base" || kind === "bitable") out.appToken = token; else return null; return out.wikiToken || out.appToken ? out : null; } async function resolveWikiToken(http, token, wikiToken) { const res = await http({ method: "GET", url: WIKI_NODE_API + "?token=" + encodeURIComponent(wikiToken), headers: { Authorization: "Bearer " + token } }); const body = JSON.parse(res.text || "{}"); if (Number(body["code"]) !== 0) { throw new Error("解析 wiki 链接失败:" + (str$1(body, "msg") || "HTTP " + res.status)); } const data = body["data"] || {}; const node = data["node"] || {}; if (str$1(node, "obj_type") !== "bitable") { throw new Error("该链接指向的不是多维表格(obj_type=" + (str$1(node, "obj_type") || "未知") + ")"); } const objToken = str$1(node, "obj_token"); if (!objToken) throw new Error("wiki 节点里没有 obj_token(表格可能已被删除或无权访问)"); return objToken; } async function fetchFirstTableId(http, token, appToken) { const res = await http({ method: "GET", url: TABLES_API + "/" + encodeURIComponent(appToken) + "/tables?page_size=20", headers: { Authorization: "Bearer " + token } }); const body = JSON.parse(res.text || "{}"); if (Number(body["code"]) !== 0) { throw new Error("列出数据表失败:" + (str$1(body, "msg") || "HTTP " + res.status)); } const data = body["data"] || {}; const items = Array.isArray(data["items"]) ? data["items"] : []; const first = items.length ? str$1(items[0], "table_id") : ""; if (!first) throw new Error("该多维表格里没有数据表"); return first; } async function resolveTableLink(http, token, link) { const appToken = link.appToken || (link.wikiToken ? await resolveWikiToken(http, token, link.wikiToken) : ""); if (!appToken) throw new Error("链接里既没有 wiki 节点也没有 app_token,无法定位表格"); const tableId = link.tableId || await fetchFirstTableId(http, token, appToken); const cfg = { appToken, tableId }; if (link.viewId) cfg.viewId = link.viewId; return cfg; } const RECORDS_API = "https://open.feishu.cn/open-apis/bitable/v1/apps"; const F_TAGS = "标签"; const F_EXCLUDE = "剔除关键词"; const F_MUST = "必含关键词"; const F_PINNED = "是否常显"; function cellText(v) { if (typeof v === "string") return v; if (typeof v === "number") return String(v); if (Array.isArray(v)) { return v.map((seg) => { if (typeof seg === "string") return seg; if (seg && typeof seg === "object") { const o2 = seg; return str$1(o2, "text") || str$1(o2, "name") || str$1(o2, "link"); } return ""; }).join(""); } return ""; } function cellList(v) { if (Array.isArray(v)) { return v.map(cellText).flatMap((t2) => splitLoose(t2)); } const t = cellText(v); return splitLoose(t); } function splitLoose(t) { return t.split(/[,,、;;\n\r]+/).map((s) => s.trim()).filter(Boolean); } function cellBool(v) { if (typeof v === "boolean") return v; const t = cellText(v).trim().toLowerCase(); return t === "true" || t === "是" || t === "1" || t === "√"; } function toRule(rec) { const fields = rec["fields"] || {}; const title = cellText(fields["标题"]).trim(); const reply = cellText(fields["内容"]); if (!title && !reply.trim()) return null; return { id: str$1(rec, "record_id"), title: title || reply.trim().slice(0, 12), keywords: cellList(fields[F_TAGS]), musts: cellList(fields[F_MUST]), excludes: cellList(fields[F_EXCLUDE]), reply, pinned: cellBool(fields[F_PINNED]), titleFallback: !title }; } async function fetchRules(http, token, cfg) { const rules = []; let pageToken = ""; for (let page = 0; page < 20; page++) { const query = "?page_size=500" + (cfg.viewId ? "&view_id=" + encodeURIComponent(cfg.viewId) : "") + (pageToken ? "&page_token=" + encodeURIComponent(pageToken) : ""); const res = await http({ method: "GET", url: RECORDS_API + "/" + cfg.appToken + "/tables/" + cfg.tableId + "/records" + query, headers: { Authorization: "Bearer " + token } }); const body = JSON.parse(res.text || "{}"); if (Number(body["code"]) !== 0) { const msg = str$1(body, "msg") || "HTTP " + res.status; throw new Error("读取飞书规则表失败:" + msg); } const data = body["data"] || {}; const items = Array.isArray(data["items"]) ? data["items"] : []; for (const it of items) { const rule = toRule(it); if (rule) rules.push(rule); } if (!data["has_more"]) break; pageToken = str$1(data, "page_token"); if (!pageToken) break; } return rules; } const SEARCH_API = "https://open.feishu.cn/open-apis/search/v2/doc_wiki/search"; const SEARCH_SCOPE = "search:docs:read"; const PAGE_SIZE = 15; const QUERY_MAX = 30; function stripHighlight(s) { return s.replace(/<\/?hb?>/g, ""); } function timeOf(meta) { const iso = str$1(meta, "update_time_iso"); if (iso) { const t = Date.parse(iso); if (Number.isFinite(t)) return t; } const raw = num$1(meta, "update_time"); if (!raw) return 0; return raw < 1e12 ? raw * 1e3 : raw; } function toItem(u) { const meta = u["result_meta"] || {}; const title = stripHighlight(str$1(u, "title_highlighted") || str$1(u, "title")); const types = Array.isArray(meta["doc_types"]) ? meta["doc_types"] : []; const first = typeof types[0] === "string" ? types[0] : ""; return { title: title || "(无标题)", url: str$1(meta, "url"), type: first || str$1(u, "entity_type"), editedAt: timeOf(meta) }; } const SCOPE_CODES = [99991672, 99991679, 99991663]; function searchErrorText(code, msg) { const tail = msg ? "(" + msg + ")" : ""; if (code === 99992402) { return "搜索请求被飞书拒绝(99992402 参数不合法):请重试或重新授权后重试" + tail; } if (SCOPE_CODES.indexOf(code) >= 0) { return "当前授权不含「搜索云文档」权限" + tail + ":点「重新授权」,在飞书授权页把权限全部勾选后确认。"; } return "搜索失败(" + code + ")" + tail; } async function searchBitableDocs(http, token, query, pageToken = "") { const body = { query: Array.from((query || "").trim()).slice(0, QUERY_MAX).join(""), page_size: PAGE_SIZE, doc_filter: { doc_types: ["BITABLE"] }, wiki_filter: { doc_types: ["BITABLE"] } }; if (pageToken) body["page_token"] = pageToken; const res = await http({ method: "POST", url: SEARCH_API, headers: { Authorization: "Bearer " + token, "Content-Type": "application/json; charset=utf-8" }, body: JSON.stringify(body) }); const raw = parseJson(res.text); if (!raw) throw new Error("搜索接口返回了非 JSON 响应(HTTP " + res.status + ")"); if (!("code" in raw)) throw new Error("搜索接口响应缺少 code 字段(HTTP " + res.status + ")"); const code = num$1(raw, "code"); if (code !== 0) throw new Error(searchErrorText(code, str$1(raw, "msg"))); const data = raw["data"] || {}; const units = Array.isArray(data["res_units"]) ? data["res_units"] : []; const items = units.map(toItem).filter((it) => !!it.url); return { items, pageToken: str$1(data, "page_token"), hasMore: data["has_more"] === true }; } const RULES_TTL_MS = 5 * 60 * 1e3; const TOKEN_SKEW_MS = 5 * 60 * 1e3; const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); function getStatus() { const cred = loadAppCred(); const token = loadToken(); const cache = loadRulesCache(); const scopes = ((token == null ? void 0 : token.scope) || "").split(/\s+/).filter(Boolean); return { authorized: !!(cred && token), hasCredential: !!cred, openId: (cred == null ? void 0 : cred.openId) || "", expiresAt: (token == null ? void 0 : token.expiresAt) || 0, ruleCount: (cache == null ? void 0 : cache.rules.length) || 0, rulesFetchedAt: (cache == null ? void 0 : cache.fetchedAt) || 0, searchScopeOk: !scopes.length || scopes.indexOf(SEARCH_SCOPE) >= 0 }; } async function getValidToken(http = gmHttp) { const cred = loadAppCred(); if (!cred) throw new Error("尚未授权飞书账号"); const token = loadToken(); if (!token) throw new Error("尚未授权飞书账号"); if (remainingMs(token) > TOKEN_SKEW_MS) return token.accessToken; const fresh = await refreshUserToken(http, cred, token.refreshToken); saveToken(fresh); addLog("飞书 token 已自动刷新", "success"); return fresh.accessToken; } async function authorize(handlers, http = gmHttp) { let cred = loadAppCred(); if (!cred) { const reg = await beginAppRegistration(http); handlers.onChallenge("register", reg); const regResult = await pollUntil( () => pollAppRegistration(http, reg.deviceCode), reg.interval, reg.expiresIn, handlers.isCancelled ); cred = regResult; saveAppCred(cred); addLog("飞书应用注册完成(动态签发凭证)", "success"); } const dev = await beginDeviceAuthorization(http, cred); handlers.onChallenge("data", dev); const token = await pollUntil( () => pollDeviceToken(http, cred, dev.deviceCode), dev.interval, dev.expiresIn, handlers.isCancelled ); saveToken(token); addLog("飞书账号授权完成,已获得表格读取权限", "success"); return token; } async function pollUntil(step, intervalSec, expiresInSec, isCancelled) { const deadline = Date.now() + expiresInSec * 1e3; const gap = Math.max(2, intervalSec) * 1e3; while (Date.now() < deadline) { if (isCancelled()) throw new Error("已取消授权"); const r = await step(); if (r.status === "ok") return r.value; if (r.status === "error") throw new Error(r.message); await sleep(gap); } throw new Error("授权超时(" + Math.round(expiresInSec / 60) + " 分钟内未完成确认)"); } async function getRules(force = false, http = gmHttp) { const cache = loadRulesCache(); if (!force && cache && Date.now() - cache.fetchedAt < RULES_TTL_MS) return cache.rules; const token = await getValidToken(http); const cfg = await rulesTableConfig(http, token); const rules = await fetchRules(http, token, cfg); saveRulesCache({ fetchedAt: Date.now(), rules }); addLog("飞书快捷回复规则已更新:" + rules.length + " 条", "success"); warnIfNoTitle(rules, "快捷短语规则表"); return rules; } function getPrivacyStatus() { const cache = loadPrivacyRulesCache(); return { configured: !!getPrivacyTableUrl(), ruleCount: (cache == null ? void 0 : cache.rules.length) || 0, fetchedAt: (cache == null ? void 0 : cache.fetchedAt) || 0 }; } function getPrivacyTableUrl() { const mirrored = loadPrivacyTableUrl(); if (mirrored) return mirrored; try { const v = loadAllvalue()["privacyTableUrl"]; if (typeof v === "string" && v.trim()) { savePrivacyTableUrl(v.trim()); return v.trim(); } } catch { } return DEFAULTS.privacyTableUrl; } function setPrivacyTableUrl(url) { const merged = { ...loadAllvalue(), privacyTableUrl: (url || "").trim() }; saveAllvalue(merged); flushSaveAllvalue(); savePrivacyTableUrl(url || ""); addLog("隐私信息表格链接已更新", "success"); } async function getPrivacyRules(force = false, http = gmHttp) { const cache = loadPrivacyRulesCache(); if (!force && cache && Date.now() - cache.fetchedAt < RULES_TTL_MS) return cache.rules; const url = getPrivacyTableUrl(); if (!url) throw new Error("尚未配置隐私信息表格链接"); const token = await getValidToken(http); const link = parseTableLink(url); if (!link) throw new Error("隐私信息表格链接无法识别:" + url); const cfg = await resolveTableLink(http, token, link); const rules = await fetchRules(http, token, cfg); savePrivacyRulesCache({ fetchedAt: Date.now(), rules }); addLog("隐私信息已更新:" + rules.length + " 条", "success"); warnIfNoTitle(rules, "隐私信息表"); return rules; } function warnIfNoTitle(rules, tableLabel) { const n = rules.filter((r) => r.titleFallback).length; if (!n) return; addLog( tableLabel + "有 " + n + " 条记录没有「标题」列,按钮暂用内容前 12 字显示:请在表里新增「标题」列(列名必须一字不差)", "warning" ); } async function rulesTableConfig(http, token) { const url = getTableUrl(); const link = parseTableLink(url); if (!link) throw new Error("规则表链接无法识别:" + url); return resolveTableLink(http, token, link); } async function searchDocs(query, pageToken = "", http = gmHttp) { const token = await getValidToken(http); return searchBitableDocs(http, token, query, pageToken); } function revoke() { clearAuth(); addLog("已解除飞书授权", "success"); } function forgetCredential() { forgetApp(); addLog("已作废本机飞书应用凭证,下次授权将重新注册", "success"); } function getTableUrl() { try { const v = loadAllvalue()["quickReplyTableUrl"]; if (typeof v === "string" && v.trim()) return v.trim(); } catch { } return DEFAULTS.quickReplyTableUrl; } function setTableUrl(url) { const merged = { ...loadAllvalue(), quickReplyTableUrl: (url || "").trim() }; saveAllvalue(merged); flushSaveAllvalue(); addLog("快捷回复规则表链接已更新", "success"); } function useFilter() { const { contains, startsWith } = useFilter$1({ sensitivity: "base" }); function score(value, searchTerm) { if (!contains(value, searchTerm)) return null; if (contains(searchTerm, value)) return 0; if (startsWith(value, searchTerm)) return 1; return 2; } function scoreItem(item, searchTerm, fields) { if (typeof item !== "object" || item === null) { return score(String(item), searchTerm); } let bestScore = null; for (const field of fields) { const value = get(item, field); if (value == null) continue; const values = Array.isArray(value) ? value.map(String) : [String(value)]; for (const v of values) { const s = score(v, searchTerm); if (s !== null && (bestScore === null || s < bestScore)) bestScore = s; if (bestScore === 0) return 0; } } return bestScore; } function filter(items, searchTerm, fields) { if (!searchTerm) return items; const scored = []; for (const item of items) { const s = scoreItem(item, searchTerm, fields); if (s !== null) { scored.push({ item, score: s }); } } scored.sort((a, b) => a.score - b.score); return scored.map(({ item }) => item); } function filterGroups(groups, searchTerm, options) { if (!searchTerm) return groups; return groups.map((group) => { var _a2; const result = []; for (const item of group) { if (item === void 0 || item === null) continue; if ((_a2 = options.isStructural) == null ? void 0 : _a2.call(options, item)) { result.push({ item, score: -1 }); continue; } const s = scoreItem(item, searchTerm, options.fields); if (s !== null) { result.push({ item, score: s }); } } let start = 0; for (let i = 0; i <= result.length; i++) { if (i === result.length || result[i].score === -1) { result.splice(start, i - start, ...result.slice(start, i).sort((a, b) => a.score - b.score)); start = i + 1; } } return result.map(({ item }) => item); }).filter((group) => group.some((item) => { var _a2; return !((_a2 = options.isStructural) == null ? void 0 : _a2.call(options, item)); })); } return { score, scoreItem, filter, filterGroups }; } function itemHasDescription(item, descriptionKey) { if (typeof item !== "object" || item === null) { return false; } const value = get(item, descriptionKey); return value !== void 0 && value !== null && value !== ""; } function getSize(size2, hasDescription) { var _a2; const sizes = hasDescription ? { xs: 44, sm: 48, md: 52, lg: 56, xl: 60 } : { xs: 24, sm: 28, md: 32, lg: 36, xl: 40 }; return (_a2 = sizes[size2]) != null ? _a2 : sizes.md; } function getEstimateSize(items, size2, descriptionKey, hasDescriptionSlot) { const sizeWithDescription = getSize(size2, true); const sizeWithoutDescription = getSize(size2, false); if (hasDescriptionSlot) { return () => sizeWithDescription; } if (!descriptionKey) { return () => sizeWithoutDescription; } return (index) => { return itemHasDescription(items[index], descriptionKey) ? sizeWithDescription : sizeWithoutDescription; }; } const theme$9 = { "slots": { "root": "relative inline-flex items-center", "base": [ "rounded-md", "transition-colors" ], "leading": "absolute inset-y-0 start-0 flex items-center", "leadingIcon": "shrink-0 text-dimmed", "leadingAvatar": "shrink-0", "leadingAvatarSize": "", "trailing": "group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none", "trailingIcon": "shrink-0 text-dimmed", "trailingClear": "p-0", "arrow": "fill-bg stroke-default", "content": "max-h-[min(15rem,var(--reka-combobox-content-available-height,15rem))] w-(--reka-combobox-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-combobox-content-transform-origin) pointer-events-auto flex flex-col", "viewport": "relative scroll-py-1 overflow-y-auto flex-1", "group": "p-1 isolate", "empty": "text-center text-muted", "label": "font-semibold text-highlighted", "separator": "-mx-1 my-1 h-px bg-border", "item": [ "group relative w-full flex items-start gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50", "transition-colors before:transition-colors" ], "itemLeadingIcon": [ "shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default", "transition-colors" ], "itemLeadingAvatar": "shrink-0", "itemLeadingAvatarSize": "", "itemLeadingChip": "shrink-0", "itemLeadingChipSize": "", "itemTrailing": "ms-auto inline-flex gap-1.5 items-center", "itemTrailingIcon": "shrink-0", "itemWrapper": "flex-1 flex flex-col min-w-0", "itemLabel": "truncate", "itemDescription": "truncate text-muted", "tagsItem": "px-1.5 py-0.5 rounded-sm font-medium inline-flex items-center gap-0.5 ring ring-inset ring-accented bg-elevated text-default data-disabled:cursor-not-allowed data-disabled:opacity-75", "tagsItemText": "truncate", "tagsItemDelete": [ "inline-flex items-center rounded-xs text-dimmed hover:text-default hover:bg-accented/75 disabled:pointer-events-none", "transition-colors" ], "tagsItemDeleteIcon": "shrink-0", "tagsInput": "flex-1 border-0 bg-transparent placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75" }, "variants": { "fieldGroup": { "horizontal": { "root": "group has-focus-visible:z-[1]" }, "vertical": { "root": "group has-focus-visible:z-[1]" } }, "size": { "xs": { "base": "px-2 py-1 text-sm/4 gap-1", "leading": "ps-2", "trailing": "pe-2", "leadingIcon": "size-4", "leadingAvatarSize": "3xs", "trailingIcon": "size-4", "label": "p-1 text-[10px]/3 gap-1", "item": "p-1 text-xs gap-1", "itemLeadingIcon": "size-4", "itemLeadingAvatarSize": "3xs", "itemLeadingChip": "size-4", "itemLeadingChipSize": "sm", "itemTrailingIcon": "size-4", "tagsItem": "text-[10px]/3", "tagsItemDeleteIcon": "size-3", "empty": "p-2 text-xs" }, "sm": { "base": "px-2.5 py-1.5 text-sm/4 gap-1.5", "leading": "ps-2.5", "trailing": "pe-2.5", "leadingIcon": "size-4", "leadingAvatarSize": "3xs", "trailingIcon": "size-4", "label": "p-1.5 text-[10px]/3 gap-1.5", "item": "p-1.5 text-xs gap-1.5", "itemLeadingIcon": "size-4", "itemLeadingAvatarSize": "3xs", "itemLeadingChip": "size-4", "itemLeadingChipSize": "sm", "itemTrailingIcon": "size-4", "tagsItem": "text-[10px]/3", "tagsItemDeleteIcon": "size-3", "empty": "p-2.5 text-xs" }, "md": { "base": "px-2.5 py-1.5 text-base/5 gap-1.5", "leading": "ps-2.5", "trailing": "pe-2.5", "leadingIcon": "size-5", "leadingAvatarSize": "2xs", "trailingIcon": "size-5", "label": "p-1.5 text-xs gap-1.5", "item": "p-1.5 text-sm gap-1.5", "itemLeadingIcon": "size-5", "itemLeadingAvatarSize": "2xs", "itemLeadingChip": "size-5", "itemLeadingChipSize": "md", "itemTrailingIcon": "size-5", "tagsItem": "text-xs", "tagsItemDeleteIcon": "size-3.5", "empty": "p-2.5 text-sm" }, "lg": { "base": "px-3 py-2 text-base/5 gap-2", "leading": "ps-3", "trailing": "pe-3", "leadingIcon": "size-5", "leadingAvatarSize": "2xs", "trailingIcon": "size-5", "label": "p-2 text-xs gap-2", "item": "p-2 text-sm gap-2", "itemLeadingIcon": "size-5", "itemLeadingAvatarSize": "2xs", "itemLeadingChip": "size-5", "itemLeadingChipSize": "md", "itemTrailingIcon": "size-5", "tagsItem": "text-xs", "tagsItemDeleteIcon": "size-3.5", "empty": "p-3 text-sm" }, "xl": { "base": "px-3 py-2 text-base gap-2", "leading": "ps-3", "trailing": "pe-3", "leadingIcon": "size-6", "leadingAvatarSize": "xs", "trailingIcon": "size-6", "label": "p-2 text-sm gap-2", "item": "p-2 text-base gap-2", "itemLeadingIcon": "size-6", "itemLeadingAvatarSize": "xs", "itemLeadingChip": "size-6", "itemLeadingChipSize": "lg", "itemTrailingIcon": "size-6", "tagsItem": "text-sm", "tagsItemDeleteIcon": "size-4", "empty": "p-3 text-base" } }, "variant": { "outline": "text-highlighted bg-default ring ring-inset ring-accented", "soft": "text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50", "subtle": "text-highlighted bg-elevated ring ring-inset ring-accented", "ghost": "text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent", "none": "text-highlighted bg-transparent focus:outline-none" }, "color": { "primary": "", "success": "", "info": "", "warning": "", "error": "", "neutral": "" }, "leading": { "true": "" }, "trailing": { "true": "" }, "loading": { "true": "" }, "highlight": { "true": "" }, "fixed": { "false": "" }, "type": { "file": "file:me-1.5 file:font-medium file:text-muted file:outline-none" }, "virtualize": { "true": { "viewport": "p-1 isolate" }, "false": { "viewport": "divide-y divide-default" } }, "multiple": { "true": { "root": "flex-wrap" }, "false": { "base": "w-full border-0 placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75" } } }, "compoundVariants": [ { "multiple": false, "fieldGroup": "horizontal", "class": { "base": "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none" } }, { "multiple": false, "fieldGroup": "vertical", "class": { "base": "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none" } }, { "multiple": true, "fieldGroup": "horizontal", "class": { "base": "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]" } }, { "multiple": true, "fieldGroup": "vertical", "class": { "base": "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]" } }, { "variant": "soft", "multiple": true, "class": "has-focus:bg-elevated has-focus-visible:outline-3" }, { "variant": "ghost", "multiple": true, "class": "has-focus:bg-elevated has-focus-visible:outline-3" }, { "color": "primary", "multiple": true, "variant": [ "outline", "subtle" ], "class": "has-focus-visible:outline-3 has-focus-visible:ring-primary" }, { "color": "success", "multiple": true, "variant": [ "outline", "subtle" ], "class": "has-focus-visible:outline-3 has-focus-visible:ring-success" }, { "color": "info", "multiple": true, "variant": [ "outline", "subtle" ], "class": "has-focus-visible:outline-3 has-focus-visible:ring-info" }, { "color": "warning", "multiple": true, "variant": [ "outline", "subtle" ], "class": "has-focus-visible:outline-3 has-focus-visible:ring-warning" }, { "color": "error", "multiple": true, "variant": [ "outline", "subtle" ], "class": "has-focus-visible:outline-3 has-focus-visible:ring-error" }, { "color": "neutral", "multiple": true, "variant": [ "outline", "subtle" ], "class": "has-focus-visible:outline-3 has-focus-visible:ring-inverted" }, { "color": "primary", "variant": [ "outline", "subtle" ], "class": "outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary" }, { "color": "success", "variant": [ "outline", "subtle" ], "class": "outline-success/25 focus-visible:outline-3 focus-visible:ring-success" }, { "color": "info", "variant": [ "outline", "subtle" ], "class": "outline-info/25 focus-visible:outline-3 focus-visible:ring-info" }, { "color": "warning", "variant": [ "outline", "subtle" ], "class": "outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning" }, { "color": "error", "variant": [ "outline", "subtle" ], "class": "outline-error/25 focus-visible:outline-3 focus-visible:ring-error" }, { "color": "primary", "variant": [ "soft", "ghost" ], "class": "outline-primary/25 focus-visible:outline-3" }, { "color": "success", "variant": [ "soft", "ghost" ], "class": "outline-success/25 focus-visible:outline-3" }, { "color": "info", "variant": [ "soft", "ghost" ], "class": "outline-info/25 focus-visible:outline-3" }, { "color": "warning", "variant": [ "soft", "ghost" ], "class": "outline-warning/25 focus-visible:outline-3" }, { "color": "error", "variant": [ "soft", "ghost" ], "class": "outline-error/25 focus-visible:outline-3" }, { "color": "primary", "highlight": true, "class": "ring ring-inset ring-primary" }, { "color": "success", "highlight": true, "class": "ring ring-inset ring-success" }, { "color": "info", "highlight": true, "class": "ring ring-inset ring-info" }, { "color": "warning", "highlight": true, "class": "ring ring-inset ring-warning" }, { "color": "error", "highlight": true, "class": "ring ring-inset ring-error" }, { "color": "neutral", "variant": [ "outline", "subtle" ], "class": "outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted" }, { "color": "neutral", "variant": [ "soft", "ghost" ], "class": "outline-inverted/25 focus-visible:outline-3" }, { "color": "neutral", "highlight": true, "class": "ring ring-inset ring-inverted" }, { "leading": true, "size": "xs", "class": "ps-7" }, { "leading": true, "size": "sm", "class": "ps-8" }, { "leading": true, "size": "md", "class": "ps-9" }, { "leading": true, "size": "lg", "class": "ps-10" }, { "leading": true, "size": "xl", "class": "ps-11" }, { "trailing": true, "size": "xs", "class": "pe-7" }, { "trailing": true, "size": "sm", "class": "pe-8" }, { "trailing": true, "size": "md", "class": "pe-9" }, { "trailing": true, "size": "lg", "class": "pe-10" }, { "trailing": true, "size": "xl", "class": "pe-11" }, { "loading": true, "leading": true, "class": { "leadingIcon": "animate-spin" } }, { "loading": true, "leading": false, "trailing": true, "class": { "trailingIcon": "animate-spin" } }, { "fixed": false, "size": "xs", "class": "md:text-xs" }, { "fixed": false, "size": "sm", "class": "md:text-xs" }, { "fixed": false, "size": "md", "class": "md:text-sm" }, { "fixed": false, "size": "lg", "class": "md:text-sm" } ], "defaultVariants": { "size": "md", "color": "primary", "variant": "outline" } }; const _sfc_main$u = Object.assign({ inheritAttrs: false }, { __name: "InputMenu", props: vue.mergeModels({ as: { type: null, required: false }, id: { type: String, required: false }, type: { type: null, required: false, default: "text" }, placeholder: { type: String, required: false }, color: { type: null, required: false }, variant: { type: null, required: false }, size: { type: null, required: false }, required: { type: Boolean, required: false }, autofocus: { type: Boolean, required: false }, autofocusDelay: { type: Number, required: false, default: 0 }, trailingIcon: { type: null, required: false }, selectedIcon: { type: null, required: false }, deleteIcon: { type: null, required: false }, clear: { type: [Boolean, Object], required: false }, clearIcon: { type: null, required: false }, content: { type: Object, required: false }, arrow: { type: [Boolean, Object], required: false }, portal: { type: [Boolean, String], required: false, skipCheck: true, default: true }, virtualize: { type: [Boolean, Object], required: false, default: false }, valueKey: { type: null, required: false }, labelKey: { type: null, required: false, default: "label" }, descriptionKey: { type: null, required: false, default: "description" }, items: { type: null, required: false }, defaultValue: { type: null, required: false }, modelValue: { type: null, required: false }, modelModifiers: { type: null, required: false }, multiple: { type: Boolean, required: false }, highlight: { type: Boolean, required: false }, fixed: { type: Boolean, required: false }, mode: { type: String, required: false, default: "combobox" }, createItem: { type: [Boolean, String, Object], required: false }, filterFields: { type: Array, required: false }, ignoreFilter: { type: Boolean, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, open: { type: Boolean, required: false }, defaultOpen: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, name: { type: String, required: false }, resetSearchTermOnBlur: { type: Boolean, required: false, default: true }, resetSearchTermOnSelect: { type: Boolean, required: false, default: true }, resetModelValueOnClear: { type: Boolean, required: false, default: true }, highlightOnHover: { type: Boolean, required: false }, loop: { type: Boolean, required: false }, openOnClick: { type: Boolean, required: false }, openOnFocus: { type: Boolean, required: false }, by: { type: [String, Function], required: false }, icon: { type: null, required: false }, avatar: { type: Object, required: false }, leading: { type: Boolean, required: false }, leadingIcon: { type: null, required: false }, trailing: { type: Boolean, required: false }, loading: { type: Boolean, required: false }, loadingIcon: { type: null, required: false } }, { "searchTerm": { type: String, ...{ default: "" } }, "searchTermModifiers": {} }), emits: vue.mergeModels(["change", "blur", "focus", "create", "clear", "highlight", "remove-tag", "update:modelValue", "update:open"], ["update:searchTerm"]), setup(__props, { expose: __expose, emit: __emit }) { const Combobox = { Root: ComboboxRoot_default, Input: ComboboxInput_default, Anchor: ComboboxAnchor_default, Empty: ComboboxEmpty_default, Trigger: ComboboxTrigger_default, Cancel: ComboboxCancel_default, Group: ComboboxGroup_default, Label: ComboboxLabel_default, Content: ComboboxContent_default, Virtualizer: ComboboxVirtualizer_default, Item: ComboboxItem_default, ItemIndicator: ComboboxItemIndicator_default, Separator: ComboboxSeparator_default, Arrow: ComboboxArrow_default, Portal: ComboboxPortal_default }; const Autocomplete = { Root: AutocompleteRoot_default, Input: AutocompleteInput_default, Anchor: ComboboxAnchor_default, Empty: ComboboxEmpty_default, Trigger: ComboboxTrigger_default, Cancel: ComboboxCancel_default, Group: ComboboxGroup_default, Label: ComboboxLabel_default, Content: ComboboxContent_default, Virtualizer: ComboboxVirtualizer_default, Item: ComboboxItem_default, ItemIndicator: ComboboxItemIndicator_default, Separator: ComboboxSeparator_default, Arrow: ComboboxArrow_default, Portal: ComboboxPortal_default }; const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("inputMenu", _props); const searchTerm = vue.useModel(__props, "searchTerm", { type: String, ...{ default: "" } }); const { t } = useLocale$1(); const appConfig2 = useAppConfig(); const { filterGroups } = useFilter(); const isAutocomplete = vue.computed(() => props.mode === "autocomplete"); const isMultiple = vue.computed(() => !!props.multiple && !isAutocomplete.value); const rootPropsPick = reactivePick(props, "as", "modelValue", "defaultValue", "open", "defaultOpen", "required", "multiple", "resetSearchTermOnBlur", "resetSearchTermOnSelect", "resetModelValueOnClear", "highlightOnHover", "loop", "openOnClick", "openOnFocus", "by"); const rootPropsOmitted = reactiveOmit(rootPropsPick, "multiple", "resetSearchTermOnSelect", "resetModelValueOnClear", "by"); const rootProps = useForwardProps(vue.computed(() => isAutocomplete.value ? rootPropsOmitted : rootPropsPick), emits); const Component = vue.computed(() => isAutocomplete.value ? Autocomplete : Combobox); const attrs = vue.useAttrs(); const baseDataSlot = vue.computed(() => { var _a2; return isMultiple.value ? (_a2 = attrs["data-slot"]) != null ? _a2 : "base" : "base"; }); const portalProps = usePortal(vue.toRef(() => props.portal)); const contentProps = vue.toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8, position: "popper" })); const arrowProps = vue.toRef(() => defu(props.arrow, { rounded: true })); const clearProps = vue.computed(() => typeof props.clear === "object" ? props.clear : {}); const virtualizerProps = vue.toRef(() => { var _a2; if (!props.virtualize) return false; return defu(typeof props.virtualize === "boolean" ? {} : props.virtualize, { estimateSize: getEstimateSize(filteredItems.value, (_a2 = size2.value) != null ? _a2 : "md", props.descriptionKey, !!slots["item-description"]) }); }); const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, size: formFieldSize, color: formFieldColor, id, name, highlight: formFieldHighlight, disabled: formFieldDisabled, ariaAttrs } = useFormField(_props); const { orientation, size: fieldGroupSize } = useFieldGroup(_props); const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(vue.computed(() => { var _a2; return { icon: props.icon, leading: props.leading, leadingIcon: props.leadingIcon, trailing: props.trailing, trailingIcon: (_a2 = props.trailingIcon) != null ? _a2 : appConfig2.ui.icons.chevronDown, loading: props.loading, loadingIcon: props.loadingIcon }; })); const color = vue.computed(() => { var _a2; return (_a2 = formFieldColor.value) != null ? _a2 : props.color; }); const highlight = vue.computed(() => { var _a2; return (_a2 = formFieldHighlight.value) != null ? _a2 : props.highlight; }); const size2 = vue.computed(() => { var _a2, _b; return (_b = (_a2 = fieldGroupSize.value) != null ? _a2 : formFieldSize.value) != null ? _b : props.size; }); const disabled = vue.computed(() => { var _a2; return (_a2 = formFieldDisabled.value) != null ? _a2 : props.disabled; }); const [DefineCreateItemTemplate, ReuseCreateItemTemplate] = createReusableTemplate(); const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({ props: { item: { type: [Object, String, Number, Boolean], required: true }, index: { type: Number, required: false } } }); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$9, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.inputMenu) || {} })({ color: color.value, variant: props.variant, size: size2.value, loading: props.loading, highlight: highlight.value, fixed: props.fixed, leading: isLeading.value || !!props.avatar || !!slots.leading, trailing: isTrailing.value || !!slots.trailing, multiple: isMultiple.value, fieldGroup: orientation.value, virtualize: !!props.virtualize }); }); const items = vue.computed(() => groups.value.flatMap((group) => group)); function displayValue(value) { var _a2; return (_a2 = getDisplayValue(items.value, value, { labelKey: props.labelKey, valueKey: props.valueKey, by: props.by })) != null ? _a2 : ""; } const groups = vue.computed( () => { var _a2; return ((_a2 = props.items) == null ? void 0 : _a2.length) ? isArrayOfArray(props.items) ? props.items : [props.items] : []; } ); const filteredGroups = vue.computed(() => { if (props.ignoreFilter || !searchTerm.value) { return groups.value; } const fields = Array.isArray(props.filterFields) ? props.filterFields : [props.labelKey]; return filterGroups(groups.value, searchTerm.value, { fields, isStructural: (item) => isInputItem(item) && !!item.type && ["label", "separator"].includes(item.type) }); }); const filteredItems = vue.computed(() => filteredGroups.value.flatMap((group) => group)); const createItem = vue.computed(() => { if (!props.createItem || !searchTerm.value) { return false; } const newItem = props.valueKey ? { [props.valueKey]: searchTerm.value } : searchTerm.value; if (typeof props.createItem === "object" && props.createItem.when === "always" || props.createItem === "always") { return !filteredItems.value.find((item) => { var _a2; return compare$1(item, newItem, (_a2 = props.by) != null ? _a2 : props.valueKey); }); } return !filteredItems.value.length; }); const createItemPosition = vue.computed(() => typeof props.createItem === "object" ? props.createItem.position : "bottom"); const inputRef = vue.useTemplateRef("inputRef"); function autoFocus() { var _a2, _b; if (props.autofocus) { (_b = (_a2 = inputRef.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b.focus(); } } let autofocusTimeoutId; vue.onMounted(() => { vue.nextTick(() => { var _a2, _b; if (isAutocomplete.value) { searchTerm.value = String((_b = (_a2 = props.modelValue) != null ? _a2 : props.defaultValue) != null ? _b : ""); } else { searchTerm.value = ""; } }); autofocusTimeoutId = setTimeout(() => { autoFocus(); }, props.autofocusDelay); }); vue.onScopeDispose(() => clearTimeout(autofocusTimeoutId)); vue.watch(() => props.modelValue, (newValue) => { if (isAutocomplete.value) { searchTerm.value = String(newValue != null ? newValue : ""); } }); function onUpdate(value) { var _a2, _b, _c, _d, _e2, _f; if (vue.toRaw(props.modelValue) === value) { return; } if (((_a2 = props.modelModifiers) == null ? void 0 : _a2.trim) && (typeof value === "string" || value === null || value === void 0)) { value = (_b = value == null ? void 0 : value.trim()) != null ? _b : null; } if ((_c = props.modelModifiers) == null ? void 0 : _c.number) { value = looseToNumber(value); } if ((_d = props.modelModifiers) == null ? void 0 : _d.nullable) { value != null ? value : value = null; } if (((_e2 = props.modelModifiers) == null ? void 0 : _e2.optional) && !((_f = props.modelModifiers) == null ? void 0 : _f.nullable) && value !== null) { value != null ? value : value = void 0; } const event = new Event("change", { target: { value } }); emits("change", event); emitFormChange(); emitFormInput(); if (isAutocomplete.value) { searchTerm.value = String(value != null ? value : ""); } else if (props.resetSearchTermOnSelect) { searchTerm.value = ""; } } function onInputUpdate(value) { if (!isAutocomplete.value) { searchTerm.value = value; } } function onBlur(event) { emits("blur", event); emitFormBlur(); } function onFocus(event) { emits("focus", event); emitFormFocus(); } const isOpen = vue.ref(false); let timeoutId; vue.onScopeDispose(() => clearTimeout(timeoutId)); function onUpdateOpen(value) { isOpen.value = value; if (!value) { const event = new FocusEvent("blur"); emits("blur", event); emitFormBlur(); if (!isAutocomplete.value && props.resetSearchTermOnBlur) { const STATE_ANIMATION_DELAY_MS = 100; timeoutId = setTimeout(() => { searchTerm.value = ""; }, STATE_ANIMATION_DELAY_MS); } } else { const event = new FocusEvent("focus"); emits("focus", event); emitFormFocus(); clearTimeout(timeoutId); } } function onRemoveTag(event, modelValue) { if (props.multiple) { const filteredValue = modelValue.filter((value) => !isEqual$1(value, event)); emits("update:modelValue", filteredValue); emits("remove-tag", event); onUpdate(filteredValue); } } function onCreate(e) { e.preventDefault(); e.stopPropagation(); emits("create", searchTerm.value); } function onSelect(e, item) { var _a2; if (!isInputItem(item)) { return; } if (item.disabled) { e.preventDefault(); return; } (_a2 = item.onSelect) == null ? void 0 : _a2.call(item, e); } function isInputItem(item) { return typeof item === "object" && item !== null; } function isModelValueEmpty(modelValue) { if (props.multiple && Array.isArray(modelValue)) { return modelValue.length === 0; } return modelValue === void 0 || modelValue === null || modelValue === ""; } function onClear() { if (disabled.value) { return; } emits("clear"); } function onTagsInputKeydown(event) { if (event.isComposing || !searchTerm.value) { return; } event.preventDefault(); } const viewportRef = vue.useTemplateRef("viewportRef"); const comboboxRootRef = vue.useTemplateRef("comboboxRootRef"); vue.watch(() => props.items, async () => { var _a2, _b; if (!isOpen.value || !props.createItem) { return; } await vue.nextTick(); (_b = (_a2 = comboboxRootRef.value) == null ? void 0 : _a2.highlightFirstItem) == null ? void 0 : _b.call(_a2); }, { flush: "post" }); __expose({ inputRef: vue.toRef(() => { var _a2; return (_a2 = inputRef.value) == null ? void 0 : _a2.$el; }), viewportRef: vue.toRef(() => viewportRef.value) }); return (_ctx, _cache) => { var _a2, _b; return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.createVNode(vue.unref(DefineCreateItemTemplate), null, { default: vue.withCtx(() => { var _a3; return [ vue.createVNode(vue.unref(Component).Item, { "data-slot": "item", class: vue.normalizeClass(ui2.value.item({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.item })), value: searchTerm.value, onSelect: onCreate }, { default: vue.withCtx(() => { var _a4; return [ vue.createElementVNode("span", { "data-slot": "itemLabel", class: vue.normalizeClass(ui2.value.itemLabel({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.itemLabel })) }, [ vue.renderSlot(_ctx.$slots, "create-item-label", { item: searchTerm.value }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(t)("inputMenu.create", { label: searchTerm.value })), 1) ]) ], 2) ]; }), _: 3 }, 8, ["class", "value"]) ]; }), _: 3 }), vue.createVNode(vue.unref(DefineItemTemplate), null, { default: vue.withCtx(({ item, index }) => { var _a3, _b2, _c, _d, _e2, _f; return [ isInputItem(item) && item.type === "label" ? (vue.openBlock(), vue.createBlock(vue.unref(Component).Label, { key: 0, "data-slot": "label", class: vue.normalizeClass(ui2.value.label({ class: [(_a3 = vue.unref(props).ui) == null ? void 0 : _a3.label, (_b2 = item.ui) == null ? void 0 : _b2.label, item.class] })) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(vue.unref(get)(item, vue.unref(props).labelKey)), 1) ]), _: 2 }, 1032, ["class"])) : isInputItem(item) && item.type === "separator" ? (vue.openBlock(), vue.createBlock(vue.unref(Component).Separator, { key: 1, "data-slot": "separator", class: vue.normalizeClass(ui2.value.separator({ class: [(_c = vue.unref(props).ui) == null ? void 0 : _c.separator, (_d = item.ui) == null ? void 0 : _d.separator, item.class] })) }, null, 8, ["class"])) : (vue.openBlock(), vue.createBlock(vue.unref(Component).Item, { key: 2, "data-slot": "item", class: vue.normalizeClass(ui2.value.item({ class: [(_e2 = vue.unref(props).ui) == null ? void 0 : _e2.item, isInputItem(item) && ((_f = item.ui) == null ? void 0 : _f.item), isInputItem(item) && item.class] })), disabled: isInputItem(item) && item.disabled, value: vue.unref(props).valueKey && isInputItem(item) ? vue.unref(get)(item, vue.unref(props).valueKey) : item, onSelect: ($event) => onSelect($event, item) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "item", { item, index, ui: ui2.value }, () => { var _a4, _b3, _c2, _d2, _e3, _f2, _g, _h; return [ vue.renderSlot(_ctx.$slots, "item-leading", { item, index, ui: ui2.value }, () => { var _a5, _b4, _c3, _d3, _e4, _f3, _g2, _h2, _i, _j; return [ isInputItem(item) && item.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: item.icon, "data-slot": "itemLeadingIcon", class: vue.normalizeClass(ui2.value.itemLeadingIcon({ class: [(_a5 = vue.unref(props).ui) == null ? void 0 : _a5.itemLeadingIcon, (_b4 = item.ui) == null ? void 0 : _b4.itemLeadingIcon] })) }, null, 8, ["name", "class"])) : isInputItem(item) && item.avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 1, size: ((_c3 = item.ui) == null ? void 0 : _c3.itemLeadingAvatarSize) || ((_d3 = vue.unref(props).ui) == null ? void 0 : _d3.itemLeadingAvatarSize) || ui2.value.itemLeadingAvatarSize() }, item.avatar, { "data-slot": "itemLeadingAvatar", class: ui2.value.itemLeadingAvatar({ class: [(_e4 = vue.unref(props).ui) == null ? void 0 : _e4.itemLeadingAvatar, (_f3 = item.ui) == null ? void 0 : _f3.itemLeadingAvatar] }) }), null, 16, ["size", "class"])) : isInputItem(item) && item.chip ? (vue.openBlock(), vue.createBlock(_sfc_main$K, vue.mergeProps({ key: 2, size: ((_g2 = item.ui) == null ? void 0 : _g2.itemLeadingChipSize) || ((_h2 = vue.unref(props).ui) == null ? void 0 : _h2.itemLeadingChipSize) || ui2.value.itemLeadingChipSize(), inset: "", standalone: "" }, item.chip, { "data-slot": "itemLeadingChip", class: ui2.value.itemLeadingChip({ class: [(_i = vue.unref(props).ui) == null ? void 0 : _i.itemLeadingChip, (_j = item.ui) == null ? void 0 : _j.itemLeadingChip] }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true) ]; }), vue.createElementVNode("span", { "data-slot": "itemWrapper", class: vue.normalizeClass(ui2.value.itemWrapper({ class: [(_a4 = vue.unref(props).ui) == null ? void 0 : _a4.itemWrapper, isInputItem(item) && ((_b3 = item.ui) == null ? void 0 : _b3.itemWrapper)] })) }, [ vue.createElementVNode("span", { "data-slot": "itemLabel", class: vue.normalizeClass(ui2.value.itemLabel({ class: [(_c2 = vue.unref(props).ui) == null ? void 0 : _c2.itemLabel, isInputItem(item) && ((_d2 = item.ui) == null ? void 0 : _d2.itemLabel)] })) }, [ vue.renderSlot(_ctx.$slots, "item-label", { item, index }, () => [ vue.createTextVNode(vue.toDisplayString(isInputItem(item) ? vue.unref(get)(item, vue.unref(props).labelKey) : item), 1) ]) ], 2), isInputItem(item) && (vue.unref(get)(item, vue.unref(props).descriptionKey) || !!slots["item-description"]) ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "data-slot": "itemDescription", class: vue.normalizeClass(ui2.value.itemDescription({ class: [(_e3 = vue.unref(props).ui) == null ? void 0 : _e3.itemDescription, isInputItem(item) && ((_f2 = item.ui) == null ? void 0 : _f2.itemDescription)] })) }, [ vue.renderSlot(_ctx.$slots, "item-description", { item, index }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(get)(item, vue.unref(props).descriptionKey)), 1) ]) ], 2)) : vue.createCommentVNode("", true) ], 2), vue.createElementVNode("span", { "data-slot": "itemTrailing", class: vue.normalizeClass(ui2.value.itemTrailing({ class: [(_g = vue.unref(props).ui) == null ? void 0 : _g.itemTrailing, isInputItem(item) && ((_h = item.ui) == null ? void 0 : _h.itemTrailing)] })) }, [ vue.renderSlot(_ctx.$slots, "item-trailing", { item, index, ui: ui2.value }), !isAutocomplete.value ? (vue.openBlock(), vue.createBlock(vue.unref(Component).ItemIndicator, { key: 0, "as-child": "" }, { default: vue.withCtx(() => { var _a5, _b4; return [ vue.createVNode(_sfc_main$L, { name: vue.unref(props).selectedIcon || vue.unref(appConfig2).ui.icons.check, "data-slot": "itemTrailingIcon", class: vue.normalizeClass(ui2.value.itemTrailingIcon({ class: [(_a5 = vue.unref(props).ui) == null ? void 0 : _a5.itemTrailingIcon, isInputItem(item) && ((_b4 = item.ui) == null ? void 0 : _b4.itemTrailingIcon)] })) }, null, 8, ["name", "class"]) ]; }), _: 2 }, 1024)) : vue.createCommentVNode("", true) ], 2) ]; }) ]), _: 2 }, 1032, ["class", "disabled", "value", "onSelect"])) ]; }), _: 3 }), vue.createVNode(vue.unref(Component).Root, vue.mergeProps({ ref_key: "comboboxRootRef", ref: comboboxRootRef }, vue.unref(rootProps), { name: vue.unref(name), disabled: disabled.value, "data-slot": (_a2 = _ctx.$attrs["data-slot"]) != null ? _a2 : "root", class: ui2.value.root({ class: [(_b = vue.unref(props).ui) == null ? void 0 : _b.root, vue.unref(props).class] }), "as-child": isMultiple.value, "ignore-filter": "", "onUpdate:modelValue": onUpdate, "onUpdate:open": onUpdateOpen }), { default: vue.withCtx(({ modelValue, open }) => { var _a3; return [ vue.createVNode(vue.unref(Component).Anchor, { "as-child": !isMultiple.value, "data-slot": baseDataSlot.value, class: vue.normalizeClass(ui2.value.base({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.base })) }, { default: vue.withCtx(() => { var _a4, _b2; return [ isMultiple.value ? (vue.openBlock(), vue.createBlock(vue.unref(TagsInputRoot_default), { key: 0, "model-value": modelValue, disabled: disabled.value, required: vue.unref(props).required, delimiter: "", "as-child": "", onBlur, onFocus, onRemoveTag: ($event) => onRemoveTag($event, modelValue) }, { default: vue.withCtx(({ modelValue: tags }) => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tags, (item, index) => { var _a5, _b3; return vue.openBlock(), vue.createBlock(vue.unref(TagsInputItem_default), { key: index, value: item, "data-slot": "tagsItem", class: vue.normalizeClass(ui2.value.tagsItem({ class: [(_a5 = vue.unref(props).ui) == null ? void 0 : _a5.tagsItem, isInputItem(item) && ((_b3 = item.ui) == null ? void 0 : _b3.tagsItem)] })) }, { default: vue.withCtx(() => { var _a6, _b4, _c, _d; return [ vue.createVNode(vue.unref(TagsInputItemText_default), { "data-slot": "tagsItemText", class: vue.normalizeClass(ui2.value.tagsItemText({ class: [(_a6 = vue.unref(props).ui) == null ? void 0 : _a6.tagsItemText, isInputItem(item) && ((_b4 = item.ui) == null ? void 0 : _b4.tagsItemText)] })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "tags-item-text", { item, index }, () => [ vue.createTextVNode(vue.toDisplayString(displayValue(item)), 1) ]) ]), _: 2 }, 1032, ["class"]), vue.createVNode(vue.unref(TagsInputItemDelete_default), { "data-slot": "tagsItemDelete", class: vue.normalizeClass(ui2.value.tagsItemDelete({ class: [(_c = vue.unref(props).ui) == null ? void 0 : _c.tagsItemDelete, isInputItem(item) && ((_d = item.ui) == null ? void 0 : _d.tagsItemDelete)] })), disabled: disabled.value }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "tags-item-delete", { item, index, ui: ui2.value }, () => { var _a7, _b5; return [ vue.createVNode(_sfc_main$L, { name: vue.unref(props).deleteIcon || vue.unref(appConfig2).ui.icons.close, "data-slot": "tagsItemDeleteIcon", class: vue.normalizeClass(ui2.value.tagsItemDeleteIcon({ class: [(_a7 = vue.unref(props).ui) == null ? void 0 : _a7.tagsItemDeleteIcon, isInputItem(item) && ((_b5 = item.ui) == null ? void 0 : _b5.tagsItemDeleteIcon)] })) }, null, 8, ["name", "class"]) ]; }) ]), _: 2 }, 1032, ["class", "disabled"]) ]; }), _: 2 }, 1032, ["value", "class"]); }), 128)), vue.createVNode(vue.unref(Component).Input, { modelValue: searchTerm.value, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchTerm.value = $event), "as-child": "" }, { default: vue.withCtx(() => { var _a5; return [ vue.createVNode(vue.unref(TagsInputInput_default), vue.mergeProps({ id: vue.unref(id), ref_key: "inputRef", ref: inputRef }, { ..._ctx.$attrs, ...vue.unref(ariaAttrs) }, { placeholder: vue.unref(props).placeholder, "data-slot": "tagsInput", class: ui2.value.tagsInput({ class: (_a5 = vue.unref(props).ui) == null ? void 0 : _a5.tagsInput }), onChange: _cache[0] || (_cache[0] = vue.withModifiers(() => { }, ["stop"])), onKeydown: vue.withKeys(onTagsInputKeydown, ["enter"]) }), null, 16, ["id", "placeholder", "class"]) ]; }), _: 1 }, 8, ["modelValue"]) ]), _: 3 }, 8, ["model-value", "disabled", "required", "onRemoveTag"])) : (vue.openBlock(), vue.createBlock(vue.unref(Component).Input, vue.mergeProps({ key: 1, id: vue.unref(id), ref_key: "inputRef", ref: inputRef }, { ...!isAutocomplete.value ? { displayValue } : {}, ..._ctx.$attrs, ...vue.unref(ariaAttrs) }, { "data-slot": "base", type: vue.unref(props).type, placeholder: vue.unref(props).placeholder, required: vue.unref(props).required, onBlur, onFocus, onChange: _cache[2] || (_cache[2] = vue.withModifiers(() => { }, ["stop"])), "onUpdate:modelValue": onInputUpdate }), null, 16, ["id", "type", "placeholder", "required"])), vue.renderSlot(_ctx.$slots, "default", { modelValue, open, ui: ui2.value }), vue.unref(isLeading) || !!vue.unref(props).avatar || !!slots.leading ? (vue.openBlock(), vue.createElementBlock("span", { key: 2, "data-slot": "leading", class: vue.normalizeClass(ui2.value.leading({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.leading })) }, [ vue.renderSlot(_ctx.$slots, "leading", { modelValue, open, ui: ui2.value }, () => { var _a5, _b3, _c; return [ vue.unref(isLeading) && vue.unref(leadingIconName) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(leadingIconName), "data-slot": "leadingIcon", class: vue.normalizeClass(ui2.value.leadingIcon({ class: (_a5 = vue.unref(props).ui) == null ? void 0 : _a5.leadingIcon })) }, null, 8, ["name", "class"])) : !!vue.unref(props).avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 1, size: ((_b3 = vue.unref(props).ui) == null ? void 0 : _b3.itemLeadingAvatarSize) || ui2.value.itemLeadingAvatarSize() }, vue.unref(props).avatar, { "data-slot": "itemLeadingAvatar", class: ui2.value.itemLeadingAvatar({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.itemLeadingAvatar }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true), vue.unref(isTrailing) || !!slots.trailing || !!vue.unref(props).clear ? (vue.openBlock(), vue.createBlock(vue.unref(Component).Trigger, { key: 3, "aria-label": vue.unref(t)("inputMenu.trigger"), "data-slot": "trailing", class: vue.normalizeClass(ui2.value.trailing({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.trailing })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "trailing", { modelValue, open, ui: ui2.value }, () => { var _a5; return [ !!vue.unref(props).clear && !disabled.value && !isModelValueEmpty(modelValue) ? (vue.openBlock(), vue.createBlock(vue.unref(Component).Cancel, { key: 0, "as-child": "" }, { default: vue.withCtx(() => { var _a6; return [ vue.createVNode(_sfc_main$G, vue.mergeProps({ as: "span", icon: vue.unref(props).clearIcon || vue.unref(appConfig2).ui.icons.close, size: size2.value, variant: "link", color: "neutral", tabindex: "-1" }, clearProps.value, { "data-slot": "trailingClear", class: ui2.value.trailingClear({ class: (_a6 = vue.unref(props).ui) == null ? void 0 : _a6.trailingClear }), onClick: vue.withModifiers(onClear, ["stop"]) }), null, 16, ["icon", "size", "class"]) ]; }), _: 1 })) : vue.unref(trailingIconName) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 1, name: vue.unref(trailingIconName), "data-slot": "trailingIcon", class: vue.normalizeClass(ui2.value.trailingIcon({ class: (_a5 = vue.unref(props).ui) == null ? void 0 : _a5.trailingIcon, leading: vue.unref(isLeading) })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ]; }) ]), _: 2 }, 1032, ["aria-label", "class"])) : vue.createCommentVNode("", true) ]; }), _: 2 }, 1032, ["as-child", "data-slot", "class"]), vue.createVNode(vue.unref(Component).Portal, vue.normalizeProps(vue.guardReactiveProps(vue.unref(portalProps))), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(FieldGroupReset), null, { default: vue.withCtx(() => { var _a4; return [ vue.createVNode(vue.unref(Component).Content, vue.mergeProps({ "data-slot": "content", class: ui2.value.content({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.content }) }, contentProps.value, { onFocusOutside: _cache[3] || (_cache[3] = vue.withModifiers(() => { }, ["prevent"])) }), { default: vue.withCtx(() => { var _a5, _b2, _c, _d, _e2; return [ vue.renderSlot(_ctx.$slots, "content-top"), vue.createVNode(vue.unref(Component).Empty, { "data-slot": "empty", class: vue.normalizeClass(ui2.value.empty({ class: (_a5 = vue.unref(props).ui) == null ? void 0 : _a5.empty })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "empty", { searchTerm: searchTerm.value }, () => [ vue.createTextVNode(vue.toDisplayString(searchTerm.value ? vue.unref(t)("inputMenu.noMatch", { searchTerm: searchTerm.value }) : vue.unref(t)("inputMenu.noData")), 1) ]) ]), _: 3 }, 8, ["class"]), vue.createElementVNode("div", { ref_key: "viewportRef", ref: viewportRef, role: "presentation", "data-slot": "viewport", class: vue.normalizeClass(ui2.value.viewport({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.viewport })) }, [ !!vue.unref(props).virtualize ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ createItem.value && createItemPosition.value === "top" ? (vue.openBlock(), vue.createBlock(vue.unref(ReuseCreateItemTemplate), { key: 0 })) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(Component).Virtualizer, vue.mergeProps({ options: filteredItems.value, "text-content": (item2) => isInputItem(item2) ? vue.unref(get)(item2, vue.unref(props).labelKey) : String(item2) }, virtualizerProps.value), { default: vue.withCtx(({ option: item, virtualItem }) => [ vue.createVNode(vue.unref(ReuseItemTemplate), { item, index: virtualItem.index }, null, 8, ["item", "index"]) ]), _: 1 }, 16, ["options", "text-content"]), createItem.value && createItemPosition.value === "bottom" ? (vue.openBlock(), vue.createBlock(vue.unref(ReuseCreateItemTemplate), { key: 1 })) : vue.createCommentVNode("", true) ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ createItem.value && createItemPosition.value === "top" ? (vue.openBlock(), vue.createBlock(vue.unref(Component).Group, { key: 0, "data-slot": "group", class: vue.normalizeClass(ui2.value.group({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.group })) }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(ReuseCreateItemTemplate)) ]), _: 1 }, 8, ["class"])) : vue.createCommentVNode("", true), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(filteredGroups.value, (group, groupIndex) => { var _a6; return vue.openBlock(), vue.createBlock(vue.unref(Component).Group, { key: `group-${groupIndex}`, "data-slot": "group", class: vue.normalizeClass(ui2.value.group({ class: (_a6 = vue.unref(props).ui) == null ? void 0 : _a6.group })) }, { default: vue.withCtx(() => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(group, (item, index) => { return vue.openBlock(), vue.createBlock(vue.unref(ReuseItemTemplate), { key: `group-${groupIndex}-${index}`, item, index }, null, 8, ["item", "index"]); }), 128)) ]), _: 2 }, 1032, ["class"]); }), 128)), createItem.value && createItemPosition.value === "bottom" ? (vue.openBlock(), vue.createBlock(vue.unref(Component).Group, { key: 1, "data-slot": "group", class: vue.normalizeClass(ui2.value.group({ class: (_d = vue.unref(props).ui) == null ? void 0 : _d.group })) }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(ReuseCreateItemTemplate)) ]), _: 1 }, 8, ["class"])) : vue.createCommentVNode("", true) ], 64)) ], 2), vue.renderSlot(_ctx.$slots, "content-bottom"), !!vue.unref(props).arrow ? (vue.openBlock(), vue.createBlock(vue.unref(Component).Arrow, vue.mergeProps({ key: 0 }, arrowProps.value, { "data-slot": "arrow", class: ui2.value.arrow({ class: (_e2 = vue.unref(props).ui) == null ? void 0 : _e2.arrow }) }), null, 16, ["class"])) : vue.createCommentVNode("", true) ]; }), _: 3 }, 16, ["class"]) ]; }), _: 3 }) ]), _: 3 }, 16) ]; }), _: 3 }, 16, ["name", "disabled", "data-slot", "class", "as-child"]) ], 64); }; } }); const _sfc_main$t = vue.defineComponent({ __name: "SquareLoader", props: { size: { default: 30 } }, setup(__props) { const props = __props; const cell = Math.max(2, Math.round(props.size / 3)); const grid = { gridTemplateColumns: `repeat(3, ${cell}px)`, gridTemplateRows: `repeat(3, ${cell}px)`, gap: Math.max(1, Math.round(cell / 5)) + "px" }; const delays = Array.from({ length: 9 }, (_2, i) => ({ animationDelay: (i * 0.1).toFixed(1) + "s" })); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("span", { "data-znhd-square-loader": "", class: "inline-grid shrink-0 grid-cols-3 gap-0.5 rounded", style: grid, role: "status", "aria-label": "加载中" }, [ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(9, (i) => { return vue.createElementVNode("i", { key: i, class: "block animate-pulse rounded-[2px] bg-(--ui-bg-accented)", style: vue.normalizeStyle(vue.unref(delays)[i - 1]) }, null, 4); }), 64)) ]); }; } }); const _hoisted_1$h = { "data-znhd": "feishu-auth" }; const _hoisted_2$f = { class: "flex w-full items-center justify-between gap-3 text-[15px] font-semibold" }; const _hoisted_3$d = { key: 0, class: "flex items-center gap-1 text-[12px] font-normal text-success" }; const _hoisted_4$c = { key: 1, class: "text-[12px] font-normal text-dimmed" }; const _hoisted_5$c = { key: 0, class: "pb-3 text-[12px] leading-5 text-muted tabular-nums" }; const _hoisted_6$a = { key: 1, class: "pb-3 text-[12px] leading-5 text-muted" }; const _hoisted_7$a = { class: "divide-y divide-default" }; const _hoisted_8$9 = { key: 0, class: "py-3 text-[12px] leading-5 text-muted" }; const _hoisted_9$9 = { key: 1, class: "py-3 text-[12px] break-words text-error" }; const _hoisted_10$7 = { key: 2, class: "py-3" }; const _hoisted_11$6 = { class: "grid grid-cols-2 gap-4 py-3" }; const _hoisted_12$4 = { class: "rounded-md border border-default bg-default p-4 shadow-sm" }; const _hoisted_13$4 = { class: "mb-3 flex items-center gap-2" }; const _hoisted_14$2 = ["href", "title"]; const _hoisted_15$2 = { key: 1, class: "text-[14px] font-semibold" }; const _hoisted_16$2 = { key: 1, class: "text-[11px] leading-4 text-warning" }; const _hoisted_17$2 = { key: 2, class: "text-[11px] leading-4 text-dimmed" }; const _hoisted_18$2 = { key: 3, class: "mt-1 text-[11px] leading-4 break-words text-error" }; const _hoisted_19$2 = { class: "rounded-md border border-default bg-default p-4 shadow-sm", "data-znhd": "privacy-table-block" }; const _hoisted_20$2 = { class: "mb-3 flex items-center gap-2" }; const _hoisted_21$2 = ["href", "title"]; const _hoisted_22$2 = { key: 1, class: "text-[14px] font-semibold" }; const _hoisted_23$1 = { key: 1, class: "text-[11px] leading-4 text-warning" }; const _hoisted_24$1 = { key: 2, class: "text-[11px] leading-4 text-dimmed" }; const _hoisted_25$1 = { class: "flex flex-wrap items-center gap-2 py-3" }; const _hoisted_26$1 = { key: 3, class: "flex items-center gap-1.5 py-3 text-[12px] text-muted" }; const _hoisted_27 = { key: 4, class: "py-3" }; const _hoisted_28 = { class: "rounded-md bg-elevated p-3" }; const _hoisted_29 = { class: "mb-2 text-[12px] text-muted" }; const _hoisted_30 = { class: "mb-2 text-[13px]" }; const _hoisted_31 = { class: "font-mono text-[15px] font-semibold" }; const _hoisted_32 = { class: "flex items-center gap-3" }; const _hoisted_33 = { class: "text-[11px] leading-4 text-dimmed" }; const EXAMPLE_URL = "https://mi0cdkcaj1o.feishu.cn/wiki/HImpwjCTeiPTIbkzIB0cHOKcnDd?from=from_copylink"; const _sfc_main$s = vue.defineComponent({ __name: "FeishuAuthPanel", setup(__props) { const status = vue.ref(getStatus()); const busy = vue.ref(false); const phase = vue.ref(null); const challenge = vue.ref(null); const errorText2 = vue.ref(""); const privacyStatus = vue.ref(getPrivacyStatus()); const mainUrl = vue.ref(getTableUrl()); const privacyUrl = vue.ref(getPrivacyTableUrl()); let cancelled = false; const docs = vue.ref([]); const docsLoading = vue.ref(false); const docsError = vue.ref(""); const docsKeyword = vue.ref(""); const docsOpen = vue.ref(false); const mainPicked = vue.ref(); const privacyPicked = vue.ref(); const mainOpen = vue.ref(false); const privacyOpen = vue.ref(false); let docsSeq = 0; let docsFetchedAt = 0; let kwTimer; const docItems = vue.computed( () => docs.value.map((d) => ({ label: d.title || d.url, value: d.url, icon: "i-lucide-grid-2x2", description: typeText(d.type) + (d.editedAt ? " · " + dateText(d.editedAt) : "") })) ); async function loadDocs(keyword) { const current = ++docsSeq; docsLoading.value = true; docsError.value = ""; try { const page = await searchDocs(keyword, ""); if (current !== docsSeq) return; docs.value = page.items; docsFetchedAt = Date.now(); } catch (e) { if (current !== docsSeq) return; docsError.value = (e == null ? void 0 : e.message) || "搜索失败"; } finally { if (current === docsSeq) docsLoading.value = false; } } function onDocsOpen(open) { docsOpen.value = open; if (!open) return; if (docs.value.length && Date.now() - docsFetchedAt < 6e4) return; void loadDocs(docsKeyword.value.trim()); } vue.watch(docsKeyword, (kw) => { if (!docsOpen.value) return; clearTimeout(kwTimer); kwTimer = setTimeout(() => void loadDocs(kw.trim()), 350); }); function typeText(t) { if (t === "bitable") return "多维表格"; if (t === "wiki") return "知识库"; return t || "文档"; } function dateText(ms) { const d = new Date(ms); return d.getFullYear() + "-" + String(d.getMonth() + 1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0"); } const permissionError = vue.computed( () => /forbidden|permission|denied|无权|权限|scope|99991672|91403|1254/i.test(errorText2.value) ); async function saveTable(url) { if (!url) return; setTableUrl(url); mainUrl.value = url; await reloadRules(); } async function savePrivacyTable(url) { if (!url) return; setPrivacyTableUrl(url); privacyUrl.value = url; refreshPrivacyStatus(); try { await getPrivacyRules(true); refreshPrivacyStatus(); } catch (e) { toast.error("隐私信息拉取失败:" + ((e == null ? void 0 : e.message) || "未知错误")); } } const phaseText = vue.computed( () => phase.value === "register" ? "第 1 步 / 共 2 步:注册应用" : "第 2 步 / 共 2 步:授权读取表格" ); const expiresText = vue.computed(() => { if (!status.value.expiresAt) return ""; return new Date(status.value.expiresAt).toLocaleString("zh-CN", { hour12: false }); }); const fetchedText = vue.computed(() => { if (!status.value.rulesFetchedAt) return "从未拉取"; return new Date(status.value.rulesFetchedAt).toLocaleString("zh-CN", { hour12: false }); }); const privacyFetchedText = vue.computed(() => { if (!privacyStatus.value.fetchedAt) return "从未拉取"; return new Date(privacyStatus.value.fetchedAt).toLocaleString("zh-CN", { hour12: false }); }); function refreshStatus() { status.value = getStatus(); mainUrl.value = getTableUrl(); } function refreshPrivacyStatus() { privacyStatus.value = getPrivacyStatus(); privacyUrl.value = getPrivacyTableUrl(); } function cancel() { cancelled = true; busy.value = false; challenge.value = null; phase.value = null; } async function startAuth() { if (busy.value) return; cancelled = false; errorText2.value = ""; challenge.value = null; phase.value = null; busy.value = true; try { await authorize({ onChallenge: (p, c) => { phase.value = p; challenge.value = c; }, isCancelled: () => cancelled }); refreshStatus(); toast.success("飞书授权成功"); await reloadRules(); } catch (e) { if (!cancelled) { errorText2.value = (e == null ? void 0 : e.message) || "授权失败"; toast.error(errorText2.value); } } finally { busy.value = false; challenge.value = null; phase.value = null; } } async function reloadRules() { busy.value = true; try { await getRules(true); refreshStatus(); toast.success("已更新 " + status.value.ruleCount + " 条规则"); } catch (e) { const msg = (e == null ? void 0 : e.message) || "刷新失败"; errorText2.value = msg; toast.error(msg); } if (privacyStatus.value.configured || getPrivacyTableUrl()) { try { await getPrivacyRules(true); refreshPrivacyStatus(); } catch (e) { toast.error("隐私信息刷新失败:" + ((e == null ? void 0 : e.message) || "未知错误")); } } busy.value = false; } function doRevoke() { revoke(); refreshStatus(); refreshPrivacyStatus(); toast.success("已解除飞书授权"); } function doForget() { forgetCredential(); refreshStatus(); refreshPrivacyStatus(); toast.success("已作废本机凭证,下次授权将重新注册应用"); } function onPickMain(url) { mainOpen.value = false; docsOpen.value = false; if (!url || url === mainUrl.value) return; void saveTable(url); } function onPickPrivacy(url) { privacyOpen.value = false; docsOpen.value = false; if (!url || url === privacyUrl.value) return; void savePrivacyTable(url); } vue.onMounted(() => { refreshStatus(); refreshPrivacyStatus(); }); vue.onUnmounted(() => { cancelled = true; }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [ vue.createElementVNode("div", _hoisted_2$f, [ vue.createElementVNode("span", null, [ _cache[6] || (_cache[6] = vue.createTextVNode(" 飞书快捷回复(输出框上方的快捷短语,", -1)), vue.createElementVNode("a", { class: "text-primary underline underline-offset-2", href: EXAMPLE_URL, target: "_blank", rel: "noreferrer" }, "查看案例"), _cache[7] || (_cache[7] = vue.createTextVNode(") ", -1)) ]), status.value.authorized ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$d, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-check", size: 13 }), _cache[8] || (_cache[8] = vue.createTextVNode(" 已授权 ", -1)) ])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$c, "未授权")) ]), status.value.authorized ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_5$c, " token 到期:" + vue.toDisplayString(expiresText.value) + "(到期前会自动续期) ", 1)) : (vue.openBlock(), vue.createElementBlock("p", _hoisted_6$a, " 授权后脚本会读取你飞书多维表格里的规则表,按当前对话内容在输出框上方显示快捷短语按钮。 对话文本只在本机匹配,不会上传到任何地方。 ")), vue.createElementVNode("div", _hoisted_7$a, [ !status.value.authorized && status.value.hasCredential ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_8$9, " 本机已注册过应用(第 1 步已完成),点「授权飞书账号」会直接进入第 2 步。 如果第 1 步当时用错了账号(例如豆包账号),点「作废并重新注册」可回到第 1 步。 ")) : vue.createCommentVNode("", true), errorText2.value ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_9$9, vue.toDisplayString(errorText2.value), 1)) : vue.createCommentVNode("", true), errorText2.value && permissionError.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$7, [..._cache[9] || (_cache[9] = [ vue.createElementVNode("div", { class: "rounded-md border border-warning/40 bg-warning/10 p-3 text-[12px] leading-5" }, [ vue.createElementVNode("p", { class: "mb-1 font-semibold" }, "没有读取这张多维表格的权限,依次检查:"), vue.createElementVNode("p", null, "① 表是不是当前授权账号的?别人分享的表,请让所有者把你的飞书账号加为协作者(「可阅读」即可);"), vue.createElementVNode("p", null, "② 授权时 scope 是否勾全 —— 点上方「重新授权」,弹出的授权页里**全部勾选**后再确认;"), vue.createElementVNode("p", null, "③ 表选对没有 —— 点「从飞书选择表格」重新选一张(确认选的是要用的那张表)。") ], -1) ])])) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_11$6, [ vue.createElementVNode("div", _hoisted_12$4, [ vue.createElementVNode("div", _hoisted_13$4, [ status.value.authorized && mainUrl.value ? (vue.openBlock(), vue.createElementBlock("a", { key: 0, href: mainUrl.value, target: "_blank", rel: "noopener noreferrer", class: "text-info text-[14px] font-semibold hover:underline", "data-znhd": "quick-reply-table-link", title: "在新标签页打开规则表:" + mainUrl.value }, "规则表", 8, _hoisted_14$2)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_15$2, "规则表")), status.value.authorized ? (vue.openBlock(), vue.createBlock(_sfc_main$C, { key: 2, variant: "outline", color: "neutral", size: "sm", class: "tabular-nums", title: "上次更新:" + fetchedText.value }, { default: vue.withCtx(() => [ vue.createTextVNode("已缓存 " + vue.toDisplayString(status.value.ruleCount) + " 条", 1) ]), _: 1 }, 8, ["title"])) : (vue.openBlock(), vue.createBlock(_sfc_main$C, { key: 3, variant: "outline", color: "neutral", size: "sm" }, { default: vue.withCtx(() => [..._cache[10] || (_cache[10] = [ vue.createTextVNode("未授权", -1) ])]), _: 1 })) ]), status.value.authorized && status.value.searchScopeOk ? (vue.openBlock(), vue.createBlock(_sfc_main$u, { key: 0, modelValue: mainPicked.value, "onUpdate:modelValue": [ _cache[0] || (_cache[0] = ($event) => mainPicked.value = $event), onPickMain ], open: mainOpen.value, "onUpdate:open": [ _cache[1] || (_cache[1] = ($event) => mainOpen.value = $event), onDocsOpen ], "search-term": docsKeyword.value, "onUpdate:searchTerm": _cache[2] || (_cache[2] = ($event) => docsKeyword.value = $event), items: docItems.value, "value-key": "value", loading: docsLoading.value, "open-on-click": "", icon: "i-lucide-search", size: "sm", class: "w-full", placeholder: "从飞书选择表格", "aria-label": "从飞书选择规则表", "data-znhd": "quick-reply-table-pick" }, null, 8, ["modelValue", "open", "search-term", "items", "loading"])) : status.value.authorized ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_16$2, " 当前授权不含「搜索云文档」权限,点下方「重新授权」后就能选表。 ")) : (vue.openBlock(), vue.createElementBlock("p", _hoisted_17$2, "授权后可从飞书直接选表。")), status.value.authorized && status.value.searchScopeOk && docsError.value ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_18$2, " 选表失败:" + vue.toDisplayString(docsError.value), 1)) : vue.createCommentVNode("", true) ]), vue.createElementVNode("div", _hoisted_19$2, [ vue.createElementVNode("div", _hoisted_20$2, [ status.value.authorized && privacyUrl.value ? (vue.openBlock(), vue.createElementBlock("a", { key: 0, href: privacyUrl.value, target: "_blank", rel: "noopener noreferrer", class: "text-info text-[14px] font-semibold hover:underline", "data-znhd": "privacy-table-link", title: "在新标签页打开隐私信息表:" + privacyUrl.value }, "隐私信息表", 8, _hoisted_21$2)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_22$2, "隐私信息表")), status.value.authorized && privacyStatus.value.configured ? (vue.openBlock(), vue.createBlock(_sfc_main$C, { key: 2, "data-znhd": "privacy-badge", variant: "outline", color: "neutral", size: "sm", class: "tabular-nums", title: "上次拉取:" + privacyFetchedText.value }, { default: vue.withCtx(() => [ vue.createTextVNode("已缓存 " + vue.toDisplayString(privacyStatus.value.ruleCount) + " 条", 1) ]), _: 1 }, 8, ["title"])) : status.value.authorized ? (vue.openBlock(), vue.createBlock(_sfc_main$C, { key: 3, "data-znhd": "privacy-badge", variant: "outline", color: "neutral", size: "sm" }, { default: vue.withCtx(() => [..._cache[11] || (_cache[11] = [ vue.createTextVNode("未配置", -1) ])]), _: 1 })) : (vue.openBlock(), vue.createBlock(_sfc_main$C, { key: 4, "data-znhd": "privacy-badge", variant: "outline", color: "neutral", size: "sm" }, { default: vue.withCtx(() => [..._cache[12] || (_cache[12] = [ vue.createTextVNode("未授权", -1) ])]), _: 1 })) ]), status.value.authorized && status.value.searchScopeOk ? (vue.openBlock(), vue.createBlock(_sfc_main$u, { key: 0, modelValue: privacyPicked.value, "onUpdate:modelValue": [ _cache[3] || (_cache[3] = ($event) => privacyPicked.value = $event), onPickPrivacy ], open: privacyOpen.value, "onUpdate:open": [ _cache[4] || (_cache[4] = ($event) => privacyOpen.value = $event), onDocsOpen ], "search-term": docsKeyword.value, "onUpdate:searchTerm": _cache[5] || (_cache[5] = ($event) => docsKeyword.value = $event), items: docItems.value, "value-key": "value", loading: docsLoading.value, "open-on-click": "", icon: "i-lucide-search", size: "sm", class: "w-full", placeholder: "从飞书选择表格", "aria-label": "从飞书选择隐私信息表", "data-znhd": "privacy-table-pick" }, null, 8, ["modelValue", "open", "search-term", "items", "loading"])) : status.value.authorized ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_23$1, " 授权不含搜索权限,重新授权后可配这张可选的速查表。 ")) : (vue.openBlock(), vue.createElementBlock("p", _hoisted_24$1, "可选;授权后从飞书选表。")) ]) ]), vue.createElementVNode("div", _hoisted_25$1, [ !status.value.authorized ? (vue.openBlock(), vue.createBlock(_sfc_main$G, { key: 0, color: "primary", size: "sm", class: "rounded-md", disabled: busy.value, onClick: startAuth }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(busy.value ? "等待确认…" : "授权飞书账号"), 1) ]), _: 1 }, 8, ["disabled"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ vue.createVNode(_sfc_main$G, { variant: "outline", color: "neutral", size: "sm", class: "rounded-md", disabled: busy.value, onClick: reloadRules }, { default: vue.withCtx(() => [..._cache[13] || (_cache[13] = [ vue.createTextVNode("立即刷新规则", -1) ])]), _: 1 }, 8, ["disabled"]), vue.createVNode(_sfc_main$G, { color: "primary", size: "sm", class: "rounded-md", disabled: busy.value, onClick: startAuth }, { default: vue.withCtx(() => [..._cache[14] || (_cache[14] = [ vue.createTextVNode("重新授权", -1) ])]), _: 1 }, 8, ["disabled"]), vue.createVNode(_sfc_main$G, { color: "error", size: "sm", class: "rounded-md", disabled: busy.value, onClick: doRevoke }, { default: vue.withCtx(() => [..._cache[15] || (_cache[15] = [ vue.createTextVNode("解除授权", -1) ])]), _: 1 }, 8, ["disabled"]) ], 64)), status.value.hasCredential ? (vue.openBlock(), vue.createBlock(_sfc_main$G, { key: 2, variant: "outline", color: "warning", size: "sm", class: "rounded-md", disabled: busy.value, onClick: doForget }, { default: vue.withCtx(() => [..._cache[16] || (_cache[16] = [ vue.createTextVNode(" 作废并重新注册 ", -1) ])]), _: 1 }, 8, ["disabled"])) : vue.createCommentVNode("", true), busy.value ? (vue.openBlock(), vue.createBlock(_sfc_main$G, { key: 3, variant: "ghost", color: "neutral", size: "sm", class: "rounded-md", onClick: cancel }, { default: vue.withCtx(() => [..._cache[17] || (_cache[17] = [ vue.createTextVNode("取消并返回", -1) ])]), _: 1 })) : vue.createCommentVNode("", true) ]), busy.value && !challenge.value ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_26$1, [ vue.createVNode(_sfc_main$t, { size: 14 }), _cache[18] || (_cache[18] = vue.createTextVNode("正在与飞书通信… ", -1)) ])) : vue.createCommentVNode("", true), busy.value && challenge.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_27, [ vue.createElementVNode("div", _hoisted_28, [ vue.createElementVNode("p", _hoisted_29, vue.toDisplayString(phaseText.value), 1), vue.createElementVNode("p", _hoisted_30, [ _cache[19] || (_cache[19] = vue.createTextVNode(" 在飞书里确认授权码:", -1)), vue.createElementVNode("span", _hoisted_31, vue.toDisplayString(challenge.value.userCode), 1) ]), vue.createElementVNode("div", _hoisted_32, [ vue.createVNode(_sfc_main$G, { color: "primary", size: "sm", class: "rounded-md", to: challenge.value.verificationUriComplete, target: "_blank", rel: "noreferrer" }, { default: vue.withCtx(() => [..._cache[20] || (_cache[20] = [ vue.createTextVNode(" 打开授权页 ", -1) ])]), _: 1 }, 8, ["to"]), vue.createElementVNode("p", _hoisted_33, [ vue.createTextVNode(" 授权页 " + vue.toDisplayString(Math.round(challenge.value.expiresIn / 60)) + " 分钟内有效;确认后这里会自动完成。", 1), _cache[21] || (_cache[21] = vue.createElementVNode("br", null, null, -1)), _cache[22] || (_cache[22] = vue.createTextVNode(" 授权页里要登录注册应用时的那个账号(第 1 步确认创建时用的账号)。 ", -1)) ]) ]) ]) ])) : vue.createCommentVNode("", true) ]) ]); }; } }); const SOURCE_URL = "https://cnb.cool/bbbbaa/znhd-service/-/git/raw/main/dist/znhd.user.js"; function parseScriptVersion(code) { const m = /^[ \t]*\/\/[ \t]*@version[ \t]+(\S+)/m.exec(String(code || "")); return m ? m[1].trim() : null; } function versionSegments(v) { return String(v || "").trim().replace(/^v/i, "").replace(/-v/i, ".").split(/[.\-+_]/).map((seg) => { const n = parseInt(seg, 10); return isNaN(n) ? 0 : n; }); } function compareVersion(a, b) { var _a2, _b; const pa = versionSegments(a); const pb = versionSegments(b); const len = Math.max(pa.length, pb.length); for (let i = 0; i < len; i++) { const x = (_a2 = pa[i]) != null ? _a2 : 0; const y = (_b = pb[i]) != null ? _b : 0; if (x !== y) return x > y ? 1 : -1; } return 0; } function fetchRemoteVersion(timeout = 15e3) { const url = SOURCE_URL + (SOURCE_URL.indexOf("?") >= 0 ? "&" : "?") + "_t=" + Date.now(); return new Promise((resolve, reject) => { if (typeof GM_xmlhttpRequest !== "function") { reject(new Error("GM_xmlhttpRequest 不可用")); return; } try { GM_xmlhttpRequest({ method: "GET", url, headers: { Range: "bytes=0-4095", "Cache-Control": "no-cache", Pragma: "no-cache" }, timeout, onload: (resp) => { if (resp.status < 200 || resp.status >= 300) { reject(new Error("HTTP " + resp.status)); return; } const version = parseScriptVersion(resp.responseText || ""); if (!version) { reject(new Error("响应里没有 @version")); return; } resolve({ version }); }, onerror: (resp) => reject(new Error(resp && (resp.error || resp.statusText) || "网络错误")), ontimeout: () => reject(new Error("请求超时")), onabort: () => reject(new Error("请求已取消")) }); } catch (e) { reject(e); } }); } const _hoisted_1$g = { class: "ml-auto flex items-center gap-1.5" }; const _hoisted_2$e = { class: "flex h-full items-stretch gap-4", "data-znhd": "settings-body" }; const _hoisted_3$c = { class: "min-h-0 min-w-0 flex-1 overflow-y-auto" }; const _hoisted_4$b = { key: 1, class: "divide-y divide-default", "data-znhd": "transfer-settings" }; const _hoisted_5$b = { class: "py-3 first:pt-0" }; const _hoisted_6$9 = { class: "py-3" }; const _hoisted_7$9 = { class: "flex w-full items-center justify-between gap-3 text-[13px] font-medium" }; const _hoisted_8$8 = { class: "py-3" }; const _hoisted_9$8 = { key: 2, class: "divide-y divide-default" }; const _hoisted_10$6 = { class: "py-3 first:pt-0" }; const _hoisted_11$5 = { class: "flex w-full items-center justify-between gap-3 text-[13px] font-medium" }; const _hoisted_12$3 = { class: "py-3" }; const _hoisted_13$3 = { class: "flex w-full items-center justify-between gap-3 text-[13px] font-medium" }; const _hoisted_14$1 = { class: "py-3" }; const _hoisted_15$1 = { class: "mt-2 grid grid-cols-2 gap-x-3" }; const _hoisted_16$1 = { class: "flex min-w-0 items-center gap-1.5" }; const _hoisted_17$1 = { class: "flex min-w-0 items-center gap-1.5" }; const _hoisted_18$1 = { key: 3, class: "divide-y divide-default", "data-znhd": "settings-about" }; const _hoisted_19$1 = { class: "py-3 text-[13px]" }; const _hoisted_20$1 = { class: "font-mono" }; const _hoisted_21$1 = { class: "py-3", "data-znhd": "source-update" }; const _hoisted_22$1 = { class: "flex items-center justify-between gap-3" }; const HOMEPAGE_URL = "https://cnb.cool/bbbbaa/znhd-service"; const TUTORIAL_URL = "https://mi0cdkcaj1o.feishu.cn/wiki/L3eCwdv7WiZPockZhVicxFrfnyb"; const _sfc_main$r = vue.defineComponent({ __name: "SettingsDialog", props: { open: { type: Boolean }, workingHours: {}, useCdn: { type: Boolean }, sniffPreMeasure: { type: Boolean } }, emits: ["update:open", "changeWorkingHours", "changeUseCdn", "changeSniffPreMeasure", "openLog"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; const page = vue.ref("feishu"); const pages = [ { id: "feishu", label: "飞书快捷短语" }, { id: "transfer", label: "传输助手" }, { id: "general", label: "其他设置" }, { id: "about", label: "关于" } ]; const navItems = vue.computed(() => [ pages.map((p) => ({ label: p.label, active: page.value === p.id, onSelect: () => { page.value = p.id; } })) ]); const transferStore = useTransferStore(); const relayDraft = vue.ref(transferStore.value.settings.relayServer); const confirmClear = vue.ref(false); vue.watch( () => props.open, (v) => { if (v) { relayDraft.value = transferStore.value.settings.relayServer; confirmClear.value = false; } else { commitRelay(relayDraft.value); } } ); function commitRelay(val) { const url = (val || "").trim().replace(/\/+$/, ""); if (url && url !== transferStore.value.settings.relayServer) updateTransferSettings({ relayServer: url }); } function onBlur() { const url = (relayDraft.value || "").trim(); if (!url) { relayDraft.value = DEFAULT_RELAY_SERVER; commitRelay(DEFAULT_RELAY_SERVER); } else { commitRelay(url); } } function doClearAll() { clearAllTransferFiles(); addLog("[传输助手] 已清空全部传输记录", "success"); confirmClear.value = false; } const wh = vue.computed( () => props.workingHours || { morningStart: 9, morningEnd: 12, afternoonStart: 13.5, afternoonEnd: 18 } ); function toTime(hours) { const [H, M] = hoursToHHmm(hours).split(":"); return new $2aaf608024c21ca1$export$680ea196effce5f(parseInt(H, 10), parseInt(M, 10), 0); } function toHours(t) { if (!t || typeof t.hour !== "number" || typeof t.minute !== "number") return null; if (isNaN(t.hour) || isNaN(t.minute)) return null; if (t.hour < 0 || t.hour > 23 || t.minute < 0 || t.minute > 59) return null; return t.hour + t.minute / 60; } function makeRange(from, to) { return vue.computed({ get: () => ({ start: toTime(wh.value[from]), end: toTime(wh.value[to]) }), set: (v) => { const start = toHours(v == null ? void 0 : v.start); const end = toHours(v == null ? void 0 : v.end); if (start === null || end === null) return; if (start === wh.value[from] && end === wh.value[to]) return; emit2("changeWorkingHours", { ...wh.value, [from]: start, [to]: end }); } }); } const morningRange = makeRange("morningStart", "morningEnd"); const afternoonRange = makeRange("afternoonStart", "afternoonEnd"); const UPDATE_URL = GM_info.scriptUpdateURL || GM_info.script.updateURL; const VERSION = GM_info.script.version || "?"; const sourceChecking = vue.ref(false); const sourceMsg = vue.ref(""); const sourceNewer = vue.ref(false); async function checkSourceUpdate() { if (sourceChecking.value) return; sourceChecking.value = true; sourceNewer.value = false; sourceMsg.value = ""; try { const remote = await fetchRemoteVersion(); if (compareVersion(remote.version, VERSION) > 0) { sourceNewer.value = true; sourceMsg.value = `发现新版本 ${remote.version}(当前 ${VERSION})`; } else { sourceMsg.value = `已是最新(远端 ${remote.version})`; } addLog("[设置] 源码更新检查:" + sourceMsg.value, "info"); } catch (e) { sourceMsg.value = "检查失败:" + (e instanceof Error ? e.message : String(e)); addLog("[设置] 源码更新检查失败:" + sourceMsg.value, "error"); } finally { sourceChecking.value = false; } } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(_sfc_main$v, { open: props.open, title: "设置菜单", width: 680, height: 560, footer: false, "onUpdate:open": _cache[9] || (_cache[9] = ($event) => emit2("update:open", $event)) }, { title: vue.withCtx(() => [ _cache[14] || (_cache[14] = vue.createElementVNode("span", null, "设置菜单", -1)), vue.createElementVNode("span", _hoisted_1$g, [ vue.createVNode(_sfc_main$G, { variant: "outline", color: "neutral", size: "sm", class: "rounded-md", "data-znhd": "tutorial-btn", to: TUTORIAL_URL, target: "_blank", rel: "noreferrer" }, { default: vue.withCtx(() => [..._cache[10] || (_cache[10] = [ vue.createTextVNode("使用教程", -1) ])]), _: 1 }), vue.createVNode(_sfc_main$G, { variant: "outline", color: "neutral", size: "sm", class: "rounded-md", to: HOMEPAGE_URL, target: "_blank", rel: "noreferrer" }, { default: vue.withCtx(() => [..._cache[11] || (_cache[11] = [ vue.createTextVNode("脚本主页", -1) ])]), _: 1 }), vue.createVNode(_sfc_main$G, { variant: "outline", color: "neutral", size: "sm", class: "rounded-md", "data-znhd": "update-script-btn", to: vue.unref(UPDATE_URL), target: "_blank", rel: "noreferrer" }, { default: vue.withCtx(() => [..._cache[12] || (_cache[12] = [ vue.createTextVNode("更新脚本", -1) ])]), _: 1 }, 8, ["to"]), vue.createVNode(_sfc_main$G, { variant: "outline", color: "neutral", size: "sm", class: "rounded-md", "data-znhd": "open-log-btn", onClick: _cache[0] || (_cache[0] = ($event) => emit2("openLog")) }, { default: vue.withCtx(() => [..._cache[13] || (_cache[13] = [ vue.createTextVNode("运行日志", -1) ])]), _: 1 }) ]) ]), default: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_2$e, [ vue.createVNode(_sfc_main$y, { orientation: "vertical", color: "neutral", items: navItems.value, class: "w-36 shrink-0" }, null, 8, ["items"]), vue.createElementVNode("div", _hoisted_3$c, [ page.value === "feishu" ? (vue.openBlock(), vue.createBlock(_sfc_main$s, { key: 0 })) : page.value === "transfer" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$b, [ vue.createElementVNode("div", _hoisted_5$b, [ _cache[15] || (_cache[15] = vue.createElementVNode("div", { class: "text-[13px] font-medium" }, "中继服务器地址", -1)), vue.createVNode(_sfc_main$E, { modelValue: relayDraft.value, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => relayDraft.value = $event), class: "mt-2 w-full", placeholder: "https://你的服务器:端口", onBlur, onKeydown: _cache[2] || (_cache[2] = vue.withKeys(vue.withModifiers(($event) => commitRelay(relayDraft.value), ["prevent"]), ["enter"])) }, null, 8, ["modelValue"]), _cache[16] || (_cache[16] = vue.createElementVNode("p", { class: "mt-1 whitespace-normal text-xs text-muted" }, " 手机上传的图片 / 文本经此服务器转发到本机。修改后点其他区域或按回车生效;留空失焦恢复默认地址。 ", -1)) ]), vue.createElementVNode("div", _hoisted_6$9, [ vue.createElementVNode("div", _hoisted_7$9, [ _cache[17] || (_cache[17] = vue.createElementVNode("span", null, "收到内容时自动打开传输助手", -1)), vue.createVNode(_sfc_main$x, { "model-value": vue.unref(transferStore).settings.autoOpenOnReceive, "aria-label": "收到内容时自动打开传输助手", "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue.unref(updateTransferSettings)({ autoOpenOnReceive: $event })) }, null, 8, ["model-value"]) ]), _cache[18] || (_cache[18] = vue.createElementVNode("p", { class: "mt-1 whitespace-normal text-xs text-muted" }, "关闭时仅累计未读角标,不打扰;窗口已开着则只累加,不强行切换会话。", -1)) ]), vue.createElementVNode("div", _hoisted_8$8, [ !confirmClear.value ? (vue.openBlock(), vue.createBlock(_sfc_main$G, { key: 0, color: "error", size: "sm", class: "rounded-md", onClick: _cache[4] || (_cache[4] = ($event) => confirmClear.value = true) }, { default: vue.withCtx(() => [..._cache[19] || (_cache[19] = [ vue.createTextVNode("清空全部传输记录", -1) ])]), _: 1 })) : (vue.openBlock(), vue.createBlock(_sfc_main$F, { key: 1, role: "alert", color: "error", variant: "soft", orientation: "horizontal", title: "清空全部传输记录", description: "所有会话的图片与文本都会被移除(仅清理本机内存,不影响手机上的文件)", actions: [ { label: "取消", color: "neutral", variant: "outline", size: "sm", onClick: () => { confirmClear.value = false; } }, { label: "清空", color: "error", size: "sm", onClick: doClearAll } ], ui: { title: "text-[13px]", description: "text-xs" } }, null, 8, ["actions"])) ]) ])) : page.value === "general" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$8, [ vue.createElementVNode("div", _hoisted_10$6, [ vue.createElementVNode("div", _hoisted_11$5, [ _cache[20] || (_cache[20] = vue.createElementVNode("span", null, "使用 CDN 加速(Fastly 镜像)加载资源", -1)), vue.createVNode(_sfc_main$x, { "model-value": props.useCdn, "aria-label": "使用 CDN 加速(Fastly 镜像)加载资源", "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => emit2("changeUseCdn", $event)) }, null, 8, ["model-value"]) ]) ]), vue.createElementVNode("div", _hoisted_12$3, [ vue.createElementVNode("div", _hoisted_13$3, [ _cache[21] || (_cache[21] = vue.createElementVNode("span", null, "图片嗅探:先在后台预测量图片大小", -1)), vue.createVNode(_sfc_main$x, { "model-value": props.sniffPreMeasure, "aria-label": "图片嗅探:先在后台预测量图片大小", "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => emit2("changeSniffPreMeasure", $event)) }, null, 8, ["model-value"]) ]) ]), vue.createElementVNode("div", _hoisted_14$1, [ _cache[24] || (_cache[24] = vue.createElementVNode("div", { class: "text-[13px] font-medium", "data-znhd": "general-hours-title" }, "监控时间段(点击选择时间)", -1)), vue.createElementVNode("div", _hoisted_15$1, [ vue.createElementVNode("div", _hoisted_16$1, [ _cache[22] || (_cache[22] = vue.createElementVNode("span", { class: "shrink-0 text-[12px] text-muted" }, "上午", -1)), vue.createVNode(_sfc_main$D, { modelValue: vue.unref(morningRange), "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => vue.isRef(morningRange) ? morningRange.value = $event : null), range: "", "hour-cycle": 24, size: "sm", class: "min-w-0 flex-1", "aria-label": "上午监控时间段", "data-znhd": "hours-morning" }, null, 8, ["modelValue"]) ]), vue.createElementVNode("div", _hoisted_17$1, [ _cache[23] || (_cache[23] = vue.createElementVNode("span", { class: "shrink-0 text-[12px] text-muted" }, "下午", -1)), vue.createVNode(_sfc_main$D, { modelValue: vue.unref(afternoonRange), "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => vue.isRef(afternoonRange) ? afternoonRange.value = $event : null), range: "", "hour-cycle": 24, size: "sm", class: "min-w-0 flex-1", "aria-label": "下午监控时间段", "data-znhd": "hours-afternoon" }, null, 8, ["modelValue"]) ]) ]) ]) ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$1, [ _cache[30] || (_cache[30] = vue.createElementVNode("p", { class: "whitespace-normal py-3 text-xs text-muted first:pt-0" }, [ vue.createTextVNode(" 技术栈:Vue 3 + "), vue.createElementVNode("a", { class: "text-primary hover:underline", href: "https://www.tailwindcss.cn/", target: "_blank", rel: "noreferrer" }, "Tailwind CSS 4"), vue.createTextVNode(" + "), vue.createElementVNode("a", { class: "text-primary hover:underline", href: "https://ui.nuxt.com/docs/components", target: "_blank", rel: "noreferrer" }, "Nuxt UI v4"), vue.createTextVNode(" + "), vue.createElementVNode("a", { class: "text-primary hover:underline", href: "https://lucide.dev/", target: "_blank", rel: "noreferrer" }, "Lucide 图标"), vue.createTextVNode(" + "), vue.createElementVNode("a", { class: "text-primary hover:underline", href: "https://github.com/lisonge/vite-plugin-monkey", target: "_blank", rel: "noreferrer" }, "vite-plugin-monkey") ], -1)), vue.createElementVNode("p", _hoisted_19$1, [ _cache[25] || (_cache[25] = vue.createTextVNode("脚本版本:", -1)), vue.createElementVNode("span", _hoisted_20$1, "v" + vue.toDisplayString(vue.unref(VERSION)), 1) ]), vue.createElementVNode("div", _hoisted_21$1, [ vue.createElementVNode("div", _hoisted_22$1, [ _cache[26] || (_cache[26] = vue.createElementVNode("div", { class: "text-[13px]" }, [ vue.createTextVNode(" 源码更新 "), vue.createElementVNode("span", { class: "ml-1 text-muted" }, "(直连仓库产物比对版本)") ], -1)), vue.createVNode(_sfc_main$G, { variant: "outline", color: "neutral", size: "sm", class: "shrink-0 rounded-md", "data-znhd": "source-update-check", disabled: sourceChecking.value, onClick: checkSourceUpdate }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(sourceChecking.value ? "检查中…" : "检查源码"), 1) ]), _: 1 }, 8, ["disabled"]) ]), _cache[28] || (_cache[28] = vue.createElementVNode("p", { class: "mt-1 whitespace-normal text-xs text-muted" }, " 不走脚本猫商店的同步(商店可能滞后于部署)。检查到新版本后点「立即更新」,由脚本管理器打开安装确认页。 ", -1)), sourceMsg.value ? (vue.openBlock(), vue.createElementBlock("p", { key: 0, class: vue.normalizeClass(["text-[13px]", sourceNewer.value ? "text-warning" : "text-muted"]), "data-znhd": "source-update-status" }, vue.toDisplayString(sourceMsg.value), 3)) : vue.createCommentVNode("", true), sourceNewer.value ? (vue.openBlock(), vue.createBlock(_sfc_main$G, { key: 1, color: "primary", size: "sm", class: "mt-2 rounded-md", "data-znhd": "source-update-install", to: vue.unref(SOURCE_URL), target: "_blank", rel: "noreferrer" }, { default: vue.withCtx(() => [..._cache[27] || (_cache[27] = [ vue.createTextVNode("立即更新", -1) ])]), _: 1 }, 8, ["to"])) : vue.createCommentVNode("", true) ]), vue.createElementVNode("p", { class: "py-3 text-[13px]" }, [ _cache[29] || (_cache[29] = vue.createTextVNode(" 作者 / 主页:", -1)), vue.createElementVNode("a", { class: "text-primary hover:underline", href: HOMEPAGE_URL, target: "_blank", rel: "noreferrer" }, "bbbbaa/znhd-service") ]) ])) ]) ]) ]), _: 1 }, 8, ["open"]); }; } }); const _hoisted_1$f = { class: "max-h-[50vh] overflow-y-auto" }; const _hoisted_2$d = { class: "flex flex-col gap-1.5 p-0" }; const _hoisted_3$b = ["onClick"]; const _sfc_main$q = vue.defineComponent({ __name: "OrgPickDialog", props: vue.mergeModels({ matched: {} }, { "open": { type: Boolean, ...{ default: false } }, "openModifiers": {} }), emits: vue.mergeModels(["pick"], ["update:open"]), setup(__props, { emit: __emit }) { const open = vue.useModel(__props, "open"); const props = __props; const emit2 = __emit; function pick(rule) { emit2("pick", rule); open.value = false; } function labelOf(rule) { return rule.reply.trim() ? rule.title : rule.title + "(内容为空)"; } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(_sfc_main$v, { open: open.value, "onUpdate:open": _cache[1] || (_cache[1] = ($event) => open.value = $event), title: "请选择税管员", width: 320, footer: false, "stop-keydown": "" }, { footer: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, { type: "button", size: "sm", "data-znhd-org-pick-cancel": "", onClick: _cache[0] || (_cache[0] = ($event) => open.value = false) }, { default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [ vue.createTextVNode("取消", -1) ])]), _: 1 }) ]), default: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_1$f, [ vue.createElementVNode("ul", _hoisted_2$d, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.matched, (rule) => { return vue.openBlock(), vue.createElementBlock("li", { key: rule.id }, [ vue.createElementVNode("button", { type: "button", class: "w-full rounded-md px-2.5 py-2 text-left text-[13px] font-normal whitespace-normal hover:bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50", "data-znhd-org-pick": "", onClick: ($event) => pick(rule) }, vue.toDisplayString(labelOf(rule)), 9, _hoisted_3$b) ]); }), 128)) ]) ]) ]), _: 1 }, 8, ["open"]); }; } }); (function() { var t; try { if (typeof document < "u") { var a = document.createElement("style"); a.nonce = (t = document.head.querySelector("meta[property=csp-nonce]")) == null ? void 0 : t.content, a.appendChild(document.createTextNode('[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32,.72,0,1);animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform, 100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform, 100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height, 0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height, 0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true]):after{content:"";position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]:after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]:after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]:after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]:after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:hover,[data-vaul-handle]:active{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover: hover) and (pointer: fine){[data-vaul-drawer]{-webkit-user-select:none;user-select:none}}@media (pointer: fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{0%{transform:translate3d(0,var(--initial-transform, 100%),0)}to{transform:translateZ(0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform, 100%),0)}}@keyframes slideFromTop{0%{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}to{transform:translateZ(0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}}@keyframes slideFromLeft{0%{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}to{transform:translateZ(0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}}@keyframes slideFromRight{0%{transform:translate3d(var(--initial-transform, 100%),0,0)}to{transform:translateZ(0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform, 100%),0,0)}}')), document.head.appendChild(a); } } catch (r) { console.error("vite-plugin-css-injected-by-js", r); } })(); const rt = typeof window < "u" && typeof document < "u"; typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope; const ut = (e) => typeof e < "u"; function st(e) { return JSON.parse(JSON.stringify(e)); } function $e(e, n, s, i = {}) { var t, w, d; const { clone: v = false, passive: D = false, eventName: $, deep: T = false, defaultValue: r, shouldEmit: l } = i, h2 = vue.getCurrentInstance(), m = s || (h2 == null ? void 0 : h2.emit) || ((t = h2 == null ? void 0 : h2.$emit) == null ? void 0 : t.bind(h2)) || ((d = (w = h2 == null ? void 0 : h2.proxy) == null ? void 0 : w.$emit) == null ? void 0 : d.bind(h2 == null ? void 0 : h2.proxy)); let u = $; n || (n = "modelValue"), u = u || `update:${n.toString()}`; const L = (a) => v ? typeof v == "function" ? v(a) : st(a) : a, H = () => ut(e[n]) ? L(e[n]) : r, p = (a) => { l ? l(a) && m(u, a) : m(u, a); }; if (D) { const a = H(), c = vue.ref(a); let f = false; return vue.watch( () => e[n], (y) => { f || (f = true, c.value = L(y), vue.nextTick(() => f = false)); } ), vue.watch( c, (y) => { !f && (y !== e[n] || T) && p(y); }, { deep: T } ), c; } else return vue.computed({ get() { return H(); }, set(a) { p(a); } }); } const [ee, ct] = createContext("DrawerRoot"), Ee = new WeakMap(); function C(e, n, s = false) { if (!e || !(e instanceof HTMLElement) || !n) return; const i = {}; Object.entries(n).forEach(([t, w]) => { if (t.startsWith("--")) { e.style.setProperty(t, w); return; } i[t] = e.style[t], e.style[t] = w; }), !s && Ee.set(e, i); } function dt(e, n) { if (!e || !(e instanceof HTMLElement)) return; const s = Ee.get(e); s && Object.entries(s).forEach(([i, t]) => { e.style[i] = t; }); } function ie(e, n) { const s = window.getComputedStyle(e), i = s.transform || s.webkitTransform || s.mozTransform; let t = i.match(/^matrix3d\((.+)\)$/); return t ? Number.parseFloat(t[1].split(", ")[_(n) ? 13 : 12]) : (t = i.match(/^matrix\((.+)\)$/), t ? Number.parseFloat(t[1].split(", ")[_(n) ? 5 : 4]) : null); } function vt(e) { return 8 * (Math.log(e + 1) - 2); } function _(e) { switch (e) { case "top": case "bottom": return true; case "left": case "right": return false; default: return e; } } function de(e, n) { if (!e) return () => { }; const s = e.style.cssText; return Object.assign(e.style, n), () => { e.style.cssText = s; }; } function ft(...e) { return (...n) => { for (const s of e) typeof s == "function" && s(...n); }; } const O = { DURATION: 0.5, EASE: [0.32, 0.72, 0, 1] }, _e = 0.4, pt = 0.25, gt = 100, Be = 8, re = 16, Ce = 26, Oe = "vaul-dragging"; function mt({ activeSnapPoint: e, snapPoints: n, drawerRef: s, overlayRef: i, fadeFromIndex: t, onSnapPointChange: w, direction: d }) { const v = vue.ref(typeof window < "u" ? { innerWidth: window.innerWidth, innerHeight: window.innerHeight } : void 0); function D() { v.value = { innerWidth: window.innerWidth, innerHeight: window.innerHeight }; } vue.onMounted(() => { typeof window < "u" && window.addEventListener("resize", D); }), vue.onBeforeUnmount(() => { typeof window < "u" && window.removeEventListener("resize", D); }); const $ = vue.computed( () => { var _a2; return (_a2 = n.value && e.value === n.value[n.value.length - 1]) != null ? _a2 : null; } ), T = vue.computed( () => { var _a2; return n.value && n.value.length > 0 && ((t == null ? void 0 : t.value) || (t == null ? void 0 : t.value) === 0) && !Number.isNaN(t == null ? void 0 : t.value) && n.value[(_a2 = t == null ? void 0 : t.value) != null ? _a2 : -1] === e.value || !n.value; } ), r = vue.computed( () => { var _a2; var p; return (_a2 = (p = n.value) == null ? void 0 : p.findIndex((a) => a === e.value)) != null ? _a2 : null; } ), l = vue.computed( () => { var _a2; var p; return (_a2 = (p = n.value) == null ? void 0 : p.map((a) => { const c = typeof a == "string"; let f = 0; if (c && (f = Number.parseInt(a, 10)), _(d.value)) { const P = c ? f : v.value ? a * v.value.innerHeight : 0; return v.value ? d.value === "bottom" ? v.value.innerHeight - P : -v.value.innerHeight + P : P; } const y = c ? f : v.value ? a * v.value.innerWidth : 0; return v.value ? d.value === "right" ? v.value.innerWidth - y : -v.value.innerWidth + y : y; })) != null ? _a2 : []; } ), h2 = vue.computed( () => { var p; return r.value !== null ? (p = l.value) == null ? void 0 : p[r.value] : null; } ), m = (p) => { var _a2, _b; var c, f, y, P; const a = (_a2 = (c = l.value) == null ? void 0 : c.findIndex((x) => x === p)) != null ? _a2 : null; vue.nextTick(() => { var x; w(a, l.value), C((x = s.value) == null ? void 0 : x.$el, { transition: `transform ${O.DURATION}s cubic-bezier(${O.EASE.join(",")})`, transform: _(d.value) ? `translate3d(0, ${p}px, 0)` : `translate3d(${p}px, 0, 0)` }); }), l.value && a !== l.value.length - 1 && a !== (t == null ? void 0 : t.value) ? C((f = i.value) == null ? void 0 : f.$el, { transition: `opacity ${O.DURATION}s cubic-bezier(${O.EASE.join(",")})`, opacity: "0" }) : C((y = i.value) == null ? void 0 : y.$el, { transition: `opacity ${O.DURATION}s cubic-bezier(${O.EASE.join(",")})`, opacity: "1" }), e.value = a !== null ? (_b = (P = n.value) == null ? void 0 : P[a]) != null ? _b : null : null; }; vue.watch( [e, l, n], () => { var _a2; var p; if (e.value) { const a = (_a2 = (p = n.value) == null ? void 0 : p.findIndex((c) => c === e.value)) != null ? _a2 : -1; l.value && a !== -1 && typeof l.value[a] == "number" && m(l.value[a]); } }, { immediate: true } ); function u({ draggedDistance: p, closeDrawer: a, velocity: c, dismissible: f }) { var _a2, _b, _c; var j, G, z; if (t.value === void 0) return; const y = d.value === "bottom" || d.value === "right" ? ((_a2 = h2.value) != null ? _a2 : 0) - p : ((_b = h2.value) != null ? _b : 0) + p, P = r.value === t.value - 1, x = r.value === 0, W = p > 0; if (P && C((j = i.value) == null ? void 0 : j.$el, { transition: `opacity ${O.DURATION}s cubic-bezier(${O.EASE.join(",")})` }), c > 2 && !W) { f ? a() : m(l.value[0]); return; } if (c > 2 && W && l && n.value) { m(l.value[n.value.length - 1]); return; } const te = (G = l.value) == null ? void 0 : G.reduce((M, g) => typeof M != "number" || typeof g != "number" ? M : Math.abs(g - y) < Math.abs(M - y) ? g : M), V = _(d.value) ? window.innerHeight : window.innerWidth; if (c > _e && Math.abs(p) < V * 0.4) { const M = W ? 1 : -1; if (M > 0 && $) { m(l.value[((_c = (z = n.value) == null ? void 0 : z.length) != null ? _c : 0) - 1]); return; } if (x && M < 0 && f && a(), r.value === null) return; m(l.value[r.value + M]); return; } m(te); } function L({ draggedDistance: p }) { var c; if (h2.value === null) return; const a = d.value === "bottom" || d.value === "right" ? h2.value - p : h2.value + p; (d.value === "bottom" || d.value === "right") && a < l.value[l.value.length - 1] || (d.value === "top" || d.value === "left") && a > l.value[l.value.length - 1] || C((c = s.value) == null ? void 0 : c.$el, { transform: _(d.value) ? `translate3d(0, ${a}px, 0)` : `translate3d(${a}px, 0, 0)` }); } function H(p, a) { if (!n.value || typeof r.value != "number" || !l.value || t.value === void 0) return null; const c = r.value === t.value - 1; if (r.value >= t.value && a) return 0; if (c && !a) return 1; if (!T.value && !c) return null; const y = c ? r.value + 1 : r.value - 1, P = c ? l.value[y] - l.value[y - 1] : l.value[y + 1] - l.value[y], x = p / Math.abs(P); return c ? 1 - x : x; } return { isLastSnapPoint: $, shouldFade: T, getPercentageDragged: H, activeSnapPointIndex: r, onRelease: u, onDrag: L, snapPointsOffset: l }; } function Te() { return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); } let Q = null; function wt(e) { const { isOpen: n, modal: s, nested: i, hasBeenOpened: t, preventScrollRestoration: w, noBodyStyles: d } = e, v = vue.ref(typeof window < "u" ? window.location.href : ""), D = vue.ref(0); function $() { if (Te() && Q === null && n.value && !d.value) { Q = { position: document.body.style.position, top: document.body.style.top, left: document.body.style.left, height: document.body.style.height }; const { scrollX: r, innerHeight: l } = window; document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, { top: `${-D.value}px`, left: `${-r}px`, right: "0px", height: "auto" }), setTimeout(() => { requestAnimationFrame(() => { const h2 = l - window.innerHeight; h2 && D.value >= l && (document.body.style.top = `-${D.value + h2}px`); }); }, 300); } } function T() { if (Te() && Q !== null && !d.value) { const r = -Number.parseInt(document.body.style.top, 10), l = -Number.parseInt(document.body.style.left, 10); Object.assign(document.body.style, Q), window.requestAnimationFrame(() => { if (w.value && v.value !== window.location.href) { v.value = window.location.href; return; } window.scrollTo(l, r); }), Q = null; } } return vue.onMounted(() => { function r() { D.value = window.scrollY; } r(), window.addEventListener("scroll", r), vue.onUnmounted(() => { window.removeEventListener("scroll", r); }); }), vue.watch([n, t, v], () => { i.value || !t.value || (n.value ? (window.matchMedia("(display-mode: standalone)").matches || $(), s.value || setTimeout(() => { T(); }, 500)) : T()); }), { restorePositionSetting: T }; } function ht(e, n) { return e && e.value ? e : n; } function yt(e) { var _a2; const { emitDrag: n, emitRelease: s, emitClose: i, emitOpenChange: t, open: w, dismissible: d, nested: v, modal: D, shouldScaleBackground: $, setBackgroundColorOnScale: T, scrollLockTimeout: r, closeThreshold: l, activeSnapPoint: h2, fadeFromIndex: m, direction: u, noBodyStyles: L, handleOnly: H, preventScrollRestoration: p } = e, a = vue.ref((_a2 = w.value) != null ? _a2 : false), c = vue.ref(false), f = vue.ref(false), y = vue.ref(false), P = vue.ref(null), x = vue.ref(null), W = vue.ref(null), te = vue.ref(null), V = vue.ref(null), j = vue.ref(false), G = vue.ref(null), z = vue.ref(0), M = vue.ref(false); vue.ref(0); const g = vue.ref(null); vue.ref(0); const pe = vue.computed(() => { var o2; return ((o2 = g.value) == null ? void 0 : o2.$el.getBoundingClientRect().height) || 0; }), U = ht( e.snapPoints, vue.ref(void 0) ), Ne = vue.computed(() => { var _a3; var o2; return U && ((_a3 = (o2 = U.value) == null ? void 0 : o2.length) != null ? _a3 : 0) > 0; }), Ae = vue.ref(null), { activeSnapPointIndex: ge, onRelease: xe, snapPointsOffset: He, onDrag: Ue, shouldFade: me, getPercentageDragged: Le } = mt({ snapPoints: U, activeSnapPoint: h2, drawerRef: g, fadeFromIndex: m, overlayRef: P, onSnapPointChange: Me, direction: u }); function Me(o2, R) { U.value && o2 === R.length - 1 && (x.value = new Date()); } wt({ isOpen: a, modal: D, nested: v, hasBeenOpened: c, noBodyStyles: L, preventScrollRestoration: p }); function ne() { return (window.innerWidth - Ce) / window.innerWidth; } function we(o2, R) { var k; if (!o2) return false; let b = o2; const B = (k = window.getSelection()) == null ? void 0 : k.toString(), E = g.value ? ie(g.value.$el, u.value) : null, A = new Date(); if (b.hasAttribute("data-vaul-no-drag") || b.closest("[data-vaul-no-drag]")) return false; if (u.value === "right" || u.value === "left") return true; if (x.value && A.getTime() - x.value.getTime() < 500) return false; if (E !== null && (u.value === "bottom" ? E > 0 : E < 0)) return true; if (B && B.length > 0) return false; if (V.value && A.getTime() - V.value.getTime() < r.value && E === 0 || R) return V.value = A, false; for (; b; ) { if (b.scrollHeight > b.clientHeight) { if (b.scrollTop !== 0) return V.value = new Date(), false; if (b.getAttribute("role") === "dialog") return true; } b = b.parentNode; } return true; } function ke(o2) { !d.value && !U.value || g.value && !g.value.$el.contains(o2.target) || (f.value = true, W.value = new Date(), o2.target.setPointerCapture(o2.pointerId), z.value = _(u.value) ? o2.clientY : o2.clientX); } function Ie(o2) { var R, b, B, E, A, k; if (g.value && f.value) { const X = u.value === "bottom" || u.value === "right" ? 1 : -1, ae = (z.value - (_(u.value) ? o2.clientY : o2.clientX)) * X, le = ae > 0, ye = U.value && !d.value && !le; if (ye && ge.value === 0) return; const ce = Math.abs(ae), Se = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]"); let q = ce / pe.value; const De = Le(ce, le); if (De !== null && (q = De), ye && q >= 1 || !j.value && !we(o2.target, le)) return; if ((R = g == null ? void 0 : g.value) == null || R.$el.classList.add(Oe), j.value = true, C((b = g.value) == null ? void 0 : b.$el, { transition: "none" }), C((B = P.value) == null ? void 0 : B.$el, { transition: "none" }), U.value && Ue({ draggedDistance: ae }), le && !U.value) { const Y = vt(ae), oe = Math.min(Y * -1, 0) * X; C((E = g.value) == null ? void 0 : E.$el, { transform: _(u.value) ? `translate3d(0, ${oe}px, 0)` : `translate3d(${oe}px, 0, 0)` }); return; } const qe = 1 - q; if ((me.value || m.value && ge.value === m.value - 1) && (n(q), C( (A = P.value) == null ? void 0 : A.$el, { opacity: `${qe}`, transition: "none" }, true )), Se && P.value && $.value) { const Y = Math.min(ne() + q * (1 - ne()), 1), oe = 8 - q * 8, be = Math.max(0, 14 - q * 14); C( Se, { borderRadius: `${oe}px`, transform: _(u.value) ? `scale(${Y}) translate3d(0, ${be}px, 0)` : `scale(${Y}) translate3d(${be}px, 0, 0)`, transition: "none" }, true ); } if (!U.value) { const Y = ce * X; C((k = g.value) == null ? void 0 : k.$el, { transform: _(u.value) ? `translate3d(0, ${Y}px, 0)` : `translate3d(${Y}px, 0, 0)` }); } } } function he() { var b; if (!g.value) return; const o2 = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]"), R = ie(g.value.$el, u.value); C(g.value.$el, { transform: "translate3d(0, 0, 0)", transition: `transform ${O.DURATION}s cubic-bezier(${O.EASE.join(",")})` }), C((b = P.value) == null ? void 0 : b.$el, { transition: `opacity ${O.DURATION}s cubic-bezier(${O.EASE.join(",")})`, opacity: "1" }), $.value && R && R > 0 && a.value && C( o2, { borderRadius: `${Be}px`, overflow: "hidden", ..._(u.value) ? { transform: `scale(${ne()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`, transformOrigin: "top" } : { transform: `scale(${ne()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`, transformOrigin: "left" }, transitionProperty: "transform, border-radius", transitionDuration: `${O.DURATION}s`, transitionTimingFunction: `cubic-bezier(${O.EASE.join(",")})` }, true ); } function K(o2) { g.value && (i(), o2 || (a.value = false), window.setTimeout(() => { U.value && (h2.value = U.value[0]); }, O.DURATION * 1e3)); } vue.watchEffect(() => { if (!a.value && $.value && rt) { const o2 = setTimeout(() => { dt(document.body); }, 200); return () => clearTimeout(o2); } }), vue.watch(w, () => { a.value = w.value, w.value || K(); }); function We(o2) { var _a3; if (!f.value || !g.value) return; g.value.$el.classList.remove(Oe), j.value = false, f.value = false, te.value = new Date(); const R = ie(g.value.$el, u.value); if (!we(o2.target, false) || !R || Number.isNaN(R) || W.value === null) return; const b = te.value.getTime() - W.value.getTime(), B = z.value - (_(u.value) ? o2.clientY : o2.clientX), E = Math.abs(B) / b; if (E > 0.05 && (y.value = true, window.setTimeout(() => { y.value = false; }, 200)), U.value) { const k = u.value === "bottom" || u.value === "right" ? 1 : -1; xe({ draggedDistance: B * k, closeDrawer: K, velocity: E, dismissible: d.value }), s(true); return; } if (u.value === "bottom" || u.value === "right" ? B > 0 : B < 0) { he(), s(true); return; } if (E > _e) { K(), s(false); return; } const A = Math.min( (_a3 = g.value.$el.getBoundingClientRect().height) != null ? _a3 : 0, window.innerHeight ); if (R >= A * l.value) { K(), s(false); return; } s(true), he(); } vue.watch(a, (o2) => { o2 && (x.value = new Date()), t(o2); }, { immediate: true }); function Ve(o2) { var B, E; const R = o2 ? (window.innerWidth - re) / window.innerWidth : 1, b = o2 ? -16 : 0; G.value && window.clearTimeout(G.value), C((B = g.value) == null ? void 0 : B.$el, { transition: `transform ${O.DURATION}s cubic-bezier(${O.EASE.join(",")})`, transform: `scale(${R}) translate3d(0, ${b}px, 0)` }), !o2 && ((E = g.value) != null && E.$el) && (G.value = window.setTimeout(() => { var k, X; const A = ie((k = g.value) == null ? void 0 : k.$el, u.value); C((X = g.value) == null ? void 0 : X.$el, { transition: "none", transform: _(u.value) ? `translate3d(0, ${A}px, 0)` : `translate3d(${A}px, 0, 0)` }); }, 500)); } function je(o2) { var A; if (o2 < 0) return; const R = _(u.value) ? window.innerHeight : window.innerWidth, b = (R - re) / R, B = b + o2 * (1 - b), E = -16 + o2 * re; C((A = g.value) == null ? void 0 : A.$el, { transform: _(u.value) ? `scale(${B}) translate3d(0, ${E}px, 0)` : `scale(${B}) translate3d(${E}px, 0, 0)`, transition: "none" }); } function ze(o2) { var E; const R = _(u.value) ? window.innerHeight : window.innerWidth, b = o2 ? (R - re) / R : 1, B = o2 ? -16 : 0; o2 && C((E = g.value) == null ? void 0 : E.$el, { transition: `transform ${O.DURATION}s cubic-bezier(${O.EASE.join(",")})`, transform: _(u.value) ? `scale(${b}) translate3d(0, ${B}px, 0)` : `scale(${b}) translate3d(${B}px, 0, 0)` }); } return { open: w, isOpen: a, modal: D, keyboardIsOpen: M, hasBeenOpened: c, drawerRef: g, drawerHeightRef: pe, overlayRef: P, handleRef: Ae, isDragging: f, dragStartTime: W, isAllowedToDrag: j, snapPoints: U, activeSnapPoint: h2, hasSnapPoints: Ne, pointerStart: z, dismissible: d, snapPointsOffset: He, direction: u, shouldFade: me, fadeFromIndex: m, shouldScaleBackground: $, setBackgroundColorOnScale: T, onPress: ke, onDrag: Ie, onRelease: We, closeDrawer: K, onNestedDrag: je, onNestedRelease: ze, onNestedOpenChange: Ve, emitClose: i, emitDrag: n, emitRelease: s, emitOpenChange: t, nested: v, handleOnly: H, noBodyStyles: L }; } const St = vue.defineComponent({ __name: "DrawerRoot", props: { activeSnapPoint: { default: void 0 }, closeThreshold: { default: pt }, shouldScaleBackground: { type: Boolean, default: void 0 }, setBackgroundColorOnScale: { type: Boolean, default: true }, scrollLockTimeout: { default: gt }, fixed: { type: Boolean, default: void 0 }, dismissible: { type: Boolean, default: true }, modal: { type: Boolean, default: true }, open: { type: Boolean, default: void 0 }, defaultOpen: { type: Boolean, default: void 0 }, nested: { type: Boolean, default: false }, direction: { default: "bottom" }, noBodyStyles: { type: Boolean }, handleOnly: { type: Boolean, default: false }, preventScrollRestoration: { type: Boolean }, snapPoints: { default: void 0 }, fadeFromIndex: { default: void 0 } }, emits: ["drag", "release", "close", "update:open", "update:activeSnapPoint", "animationEnd"], setup(e, { expose: n, emit: s }) { const i = e, t = s; vue.useSlots(); const w = vue.computed(() => { var _a2; return (_a2 = i.fadeFromIndex) != null ? _a2 : i.snapPoints && i.snapPoints.length - 1; }), d = $e(i, "open", t, { defaultValue: i.defaultOpen, passive: i.open === void 0 }), v = $e(i, "activeSnapPoint", t, { passive: i.activeSnapPoint === void 0 }), D = { emitDrag: (m) => t("drag", m), emitRelease: (m) => t("release", m), emitClose: () => t("close"), emitOpenChange: (m) => { t("update:open", m), setTimeout(() => { t("animationEnd", m); }, O.DURATION * 1e3); } }, { closeDrawer: $, hasBeenOpened: T, modal: r, isOpen: l } = ct( yt({ ...D, ...vue.toRefs(i), activeSnapPoint: v, fadeFromIndex: w, open: d }) ); function h2(m) { if (d.value !== void 0) { D.emitOpenChange(m); return; } l.value = m, m ? T.value = true : $(); } return n({ open: l }), (m, u) => (vue.openBlock(), vue.createBlock(vue.unref(DialogRoot_default), { open: vue.unref(l), modal: vue.unref(r), "onUpdate:open": h2 }, { default: vue.withCtx(() => [ vue.renderSlot(m.$slots, "default", { open: vue.unref(l) }) ]), _: 3 }, 8, ["open", "modal"])); } }), _t = vue.defineComponent({ __name: "DrawerRootNested", props: { activeSnapPoint: {}, closeThreshold: {}, shouldScaleBackground: { type: Boolean }, setBackgroundColorOnScale: { type: Boolean }, scrollLockTimeout: {}, fixed: { type: Boolean }, dismissible: { type: Boolean }, modal: { type: Boolean }, open: { type: Boolean }, defaultOpen: { type: Boolean }, nested: { type: Boolean }, direction: {}, noBodyStyles: { type: Boolean }, handleOnly: { type: Boolean }, preventScrollRestoration: { type: Boolean }, snapPoints: {}, fadeFromIndex: {} }, emits: ["drag", "release", "close", "update:open", "update:activeSnapPoint", "animationEnd"], setup(e, { emit: n }) { const s = e, i = n, { onNestedDrag: t, onNestedOpenChange: w, onNestedRelease: d } = ee(); function v() { w(false); } function D(r) { t(r); } function $(r) { r && w(r), i("update:open", r); } const T = useForwardPropsEmits(s, i); return (r, l) => (vue.openBlock(), vue.createBlock(St, vue.mergeProps(vue.unref(T), { nested: "", onClose: v, onDrag: D, onRelease: vue.unref(d), "onUpdate:open": $ }), { default: vue.withCtx(() => [ vue.renderSlot(r.$slots, "default") ]), _: 3 }, 16, ["onRelease"])); } }), Bt = vue.defineComponent({ __name: "DrawerOverlay", setup(e) { const { overlayRef: n, hasSnapPoints: s, isOpen: i, shouldFade: t } = ee(); return (w, d) => (vue.openBlock(), vue.createBlock(vue.unref(DialogOverlay_default), { ref_key: "overlayRef", ref: n, "data-vaul-overlay": "", "data-vaul-snap-points": vue.unref(i) && vue.unref(s) ? "true" : "false", "data-vaul-snap-points-overlay": vue.unref(i) && vue.unref(t) ? "true" : "false" }, null, 8, ["data-vaul-snap-points", "data-vaul-snap-points-overlay"])); } }), Dt = () => () => { }; function bt() { const { direction: e, isOpen: n, shouldScaleBackground: s, setBackgroundColorOnScale: i, noBodyStyles: t } = ee(), w = vue.ref(null), d = vue.ref(document.body.style.backgroundColor); function v() { return (window.innerWidth - Ce) / window.innerWidth; } vue.watchEffect((D) => { if (n.value && s.value) { w.value && clearTimeout(w.value); const $ = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]"); if (!$) return; ft( i.value && !t.value ? de(document.body, { background: "black" }) : Dt, de($, { transformOrigin: _(e.value) ? "top" : "left", transitionProperty: "transform, border-radius", transitionDuration: `${O.DURATION}s`, transitionTimingFunction: `cubic-bezier(${O.EASE.join(",")})` }) ); const T = de($, { borderRadius: `${Be}px`, overflow: "hidden", ..._(e.value) ? { transform: `scale(${v()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)` } : { transform: `scale(${v()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)` } }); D(() => { T(), w.value = window.setTimeout(() => { d.value ? document.body.style.background = d.value : document.body.style.removeProperty("background"); }, O.DURATION * 1e3); }); } }, { flush: "pre" }); } const Ct = vue.defineComponent({ __name: "DrawerContent", setup(e) { const { open: n, isOpen: s, snapPointsOffset: i, hasSnapPoints: t, drawerRef: w, onPress: d, onDrag: v, onRelease: D, modal: $, emitOpenChange: T, dismissible: r, keyboardIsOpen: l, closeDrawer: h2, direction: m, handleOnly: u } = ee(); bt(); const L = vue.ref(false), H = vue.computed(() => i.value && i.value.length > 0 ? `${i.value[0]}px` : "0"); function p(f) { if (!$.value || f.defaultPrevented) { f.preventDefault(); return; } l.value && (l.value = false), r.value ? T(false) : f.preventDefault(); } function a(f) { u.value || d(f); } function c(f) { u.value || v(f); } return vue.watchEffect(() => { t.value && window.requestAnimationFrame(() => { L.value = true; }); }), (f, y) => (vue.openBlock(), vue.createBlock(vue.unref(DialogContent_default), { ref_key: "drawerRef", ref: w, "data-vaul-drawer": "", "data-vaul-drawer-direction": vue.unref(m), "data-vaul-delayed-snap-points": L.value ? "true" : "false", "data-vaul-snap-points": vue.unref(s) && vue.unref(t) ? "true" : "false", style: vue.normalizeStyle({ "--snap-point-height": H.value }), onPointerdown: a, onPointermove: c, onPointerup: vue.unref(D), onPointerDownOutside: p, onOpenAutoFocus: y[0] || (y[0] = vue.withModifiers(() => { }, ["prevent"])), onEscapeKeyDown: y[1] || (y[1] = (P) => { vue.unref(r) || P.preventDefault(); }) }, { default: vue.withCtx(() => [ vue.renderSlot(f.$slots, "default") ]), _: 3 }, 8, ["data-vaul-drawer-direction", "data-vaul-delayed-snap-points", "data-vaul-snap-points", "style", "onPointerup"])); } }), $t = ["data-vaul-drawer-visible"], Ot = { "data-vaul-handle-hitarea": "", "aria-hidden": "true" }, Tt = 250, Pt = 120, Nt = vue.defineComponent({ __name: "DrawerHandle", props: { preventCycle: { type: Boolean, default: false } }, setup(e) { const n = e, { onPress: s, onDrag: i, handleRef: t, handleOnly: w, isOpen: d, snapPoints: v, activeSnapPoint: D, isDragging: $, dismissible: T, closeDrawer: r } = ee(), l = vue.ref(null), h2 = vue.ref(false); function m() { if (h2.value) { H(); return; } window.setTimeout(() => { u(); }, Pt); } function u() { if ($.value || n.preventCycle || h2.value) { H(); return; } if (H(), !v.value || v.value.length === 0) { T.value || r(); return; } const c = D.value === v.value[v.value.length - 1]; if (c && T.value) { r(); return; } const f = v.value.findIndex((P) => P === D.value); if (f === -1) return; const y = c ? 0 : f + 1; D.value = v.value[y]; } function L() { l.value = window.setTimeout(() => { h2.value = true; }, Tt); } function H() { l.value && window.clearTimeout(l.value), h2.value = false; } function p(c) { w.value && s(c), L(); } function a(c) { w.value && i(c); } return (c, f) => (vue.openBlock(), vue.createElementBlock("div", { ref_key: "handleRef", ref: t, "data-vaul-drawer-visible": vue.unref(d) ? "true" : "false", "data-vaul-handle": "", "aria-hidden": "true", onClick: m, onPointercancel: H, onPointerdown: p, onPointermove: a }, [ vue.createElementVNode("span", Ot, [ vue.renderSlot(c.$slots, "default") ]) ], 40, $t)); } }); const theme$8 = { "slots": { "overlay": "fixed inset-0 bg-elevated/75", "content": "fixed bg-default ring ring-default flex focus:outline-none", "handle": [ "shrink-0 !bg-accented", "transition-opacity ease-out" ], "container": "w-full flex flex-col gap-4 p-4 overflow-y-auto", "header": "flex items-center gap-1.5 min-h-8", "wrapper": "min-w-0 flex-1", "title": "text-highlighted font-semibold", "description": "mt-1 text-muted text-sm", "actions": "flex items-center gap-1.5 shrink-0 ms-auto", "body": "flex-1", "footer": "flex flex-col gap-1.5", "close": "" }, "variants": { "direction": { "top": { "content": "mb-24 flex-col-reverse", "handle": "mb-4" }, "right": { "content": "flex-row rtl:flex-row-reverse", "handle": "!ml-4" }, "bottom": { "content": "mt-24 flex-col", "handle": "mt-4" }, "left": { "content": "flex-row-reverse rtl:flex-row", "handle": "!mr-4" } }, "inset": { "true": { "content": "rounded-lg after:hidden overflow-hidden [--initial-transform:calc(100%+1.5rem)]" } }, "snapPoints": { "true": "" } }, "compoundVariants": [ { "direction": [ "top", "bottom" ], "class": { "content": "h-auto max-h-[96%]", "handle": "!w-12 !h-1.5 mx-auto" } }, { "direction": [ "top", "bottom" ], "snapPoints": true, "class": { "content": "h-full" } }, { "direction": [ "right", "left" ], "class": { "content": "w-auto max-w-[calc(100%-2rem)]", "handle": "!h-12 !w-1.5 mt-auto mb-auto" } }, { "direction": [ "right", "left" ], "snapPoints": true, "class": { "content": "w-full" } }, { "direction": "top", "inset": true, "class": { "content": "inset-x-4 top-4" } }, { "direction": "top", "inset": false, "class": { "content": "inset-x-0 top-0 rounded-b-lg" } }, { "direction": "bottom", "inset": true, "class": { "content": "inset-x-4 bottom-4" } }, { "direction": "bottom", "inset": false, "class": { "content": "inset-x-0 bottom-0 rounded-t-lg" } }, { "direction": "left", "inset": true, "class": { "content": "inset-y-4 left-4" } }, { "direction": "left", "inset": false, "class": { "content": "inset-y-0 left-0 rounded-r-lg" } }, { "direction": "right", "inset": true, "class": { "content": "inset-y-4 right-4" } }, { "direction": "right", "inset": false, "class": { "content": "inset-y-0 right-0 rounded-l-lg" } } ] }; const _sfc_main$p = { __name: "Drawer", props: { as: { type: null, required: false }, title: { type: String, required: false }, description: { type: String, required: false }, inset: { type: Boolean, required: false }, content: { type: Object, required: false }, overlay: { type: Boolean, required: false, default: true }, handle: { type: Boolean, required: false, default: true }, portal: { type: [Boolean, String], required: false, skipCheck: true, default: true }, nested: { type: Boolean, required: false }, close: { type: [Boolean, Object], required: false }, closeIcon: { type: null, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, activeSnapPoint: { type: [Number, String, null], required: false }, closeThreshold: { type: Number, required: false }, shouldScaleBackground: { type: Boolean, required: false }, setBackgroundColorOnScale: { type: Boolean, required: false }, scrollLockTimeout: { type: Number, required: false }, fixed: { type: Boolean, required: false }, dismissible: { type: Boolean, required: false, default: true }, modal: { type: Boolean, required: false, default: true }, open: { type: Boolean, required: false }, defaultOpen: { type: Boolean, required: false }, direction: { type: String, required: false, default: "bottom" }, noBodyStyles: { type: Boolean, required: false }, handleOnly: { type: Boolean, required: false }, preventScrollRestoration: { type: Boolean, required: false }, snapPoints: { type: Array, required: false } }, emits: ["after:leave", "after:enter", "close:prevent", "drag", "release", "close", "update:open", "update:activeSnapPoint", "animationEnd"], setup(__props, { emit: __emit }) { const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("drawer", _props); const { t } = useLocale$1(); const appConfig2 = useAppConfig(); const rootProps = useForwardProps(reactivePick(props, "activeSnapPoint", "closeThreshold", "shouldScaleBackground", "setBackgroundColorOnScale", "scrollLockTimeout", "fixed", "dismissible", "modal", "open", "defaultOpen", "nested", "direction", "noBodyStyles", "handleOnly", "preventScrollRestoration", "snapPoints"), emits); const portalProps = usePortal(vue.toRef(() => props.portal)); const contentProps = vue.toRef(() => props.noBodyStyles ? { disableOutsidePointerEvents: false, ...props.content } : props.content); const contentEvents = vue.computed(() => { if (!props.dismissible) { const events = ["interactOutside", "escapeKeyDown"]; return events.reduce((acc, curr) => { acc[curr] = (e) => { e.preventDefault(); emits("close:prevent"); }; return acc; }, {}); } return { pointerDownOutside }; }); let entered = false; function onAnimationEnd(open) { if (open) { entered = true; emits("after:enter"); } else if (entered) { entered = false; emits("after:leave"); } } const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$8, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.drawer) || {} })({ direction: props.direction, inset: props.inset, snapPoints: props.snapPoints && props.snapPoints.length > 0 }); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).nested ? vue.unref(_t) : vue.unref(St)), vue.mergeProps(vue.unref(rootProps), { onAnimationEnd }), { default: vue.withCtx(() => [ !!slots.default ? (vue.openBlock(), vue.createBlock(vue.unref(DialogTrigger_default), { key: 0, "as-child": "", class: vue.normalizeClass(vue.unref(props).class) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default") ]), _: 3 }, 8, ["class"])) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(DialogPortal_default), vue.normalizeProps(vue.guardReactiveProps(vue.unref(portalProps))), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(FieldGroupReset), null, { default: vue.withCtx(() => { var _a2, _b; return [ vue.unref(props).overlay ? (vue.openBlock(), vue.createBlock(vue.unref(Bt), { key: 0, "data-slot": "overlay", class: vue.normalizeClass(ui2.value.overlay({ class: (_a2 = vue.unref(props).ui) == null ? void 0 : _a2.overlay })) }, null, 8, ["class"])) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(Ct), vue.mergeProps({ "data-slot": "content", class: ui2.value.content({ class: [!slots.default && vue.unref(props).class, (_b = vue.unref(props).ui) == null ? void 0 : _b.content] }) }, contentProps.value, vue.toHandlers(contentEvents.value)), { default: vue.withCtx(() => { var _a3; return [ vue.unref(props).handle ? (vue.openBlock(), vue.createBlock(vue.unref(Nt), { key: 0, "data-slot": "handle", class: vue.normalizeClass(ui2.value.handle({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.handle })) }, null, 8, ["class"])) : vue.createCommentVNode("", true), !vue.unref(props).title && !slots.title || !vue.unref(props).description && !slots.description || !!slots.content ? (vue.openBlock(), vue.createBlock(vue.unref(VisuallyHidden_default), { key: 1 }, { default: vue.withCtx(() => [ !vue.unref(props).title && !slots.title ? (vue.openBlock(), vue.createBlock(vue.unref(DialogTitle_default), { key: 0 })) : !!slots.content ? (vue.openBlock(), vue.createBlock(vue.unref(DialogTitle_default), { key: 1 }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "title", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).title), 1) ]) ]), _: 3 })) : vue.createCommentVNode("", true), !vue.unref(props).description && !slots.description ? (vue.openBlock(), vue.createBlock(vue.unref(DialogDescription_default), { key: 2 })) : !!slots.content ? (vue.openBlock(), vue.createBlock(vue.unref(DialogDescription_default), { key: 3 }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "description", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).description), 1) ]) ]), _: 3 })) : vue.createCommentVNode("", true) ]), _: 3 })) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "content", {}, () => { var _a4, _b2, _c, _d; return [ vue.createElementVNode("div", { "data-slot": "container", class: vue.normalizeClass(ui2.value.container({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.container })) }, [ !!slots.header || (vue.unref(props).title || !!slots.title) || (vue.unref(props).description || !!slots.description) || (vue.unref(props).close || !!slots.close) || !!slots.actions ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "header", class: vue.normalizeClass(ui2.value.header({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.header })) }, [ vue.renderSlot(_ctx.$slots, "header", {}, () => { var _a5, _b3, _c2, _d2; return [ vue.unref(props).title || !!slots.title || vue.unref(props).description || !!slots.description ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "wrapper", class: vue.normalizeClass(ui2.value.wrapper({ class: (_a5 = vue.unref(props).ui) == null ? void 0 : _a5.wrapper })) }, [ vue.unref(props).title || !!slots.title ? (vue.openBlock(), vue.createBlock(vue.unref(DialogTitle_default), { key: 0, "data-slot": "title", class: vue.normalizeClass(ui2.value.title({ class: (_b3 = vue.unref(props).ui) == null ? void 0 : _b3.title })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "title", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).title), 1) ]) ]), _: 3 }, 8, ["class"])) : vue.createCommentVNode("", true), vue.unref(props).description || !!slots.description ? (vue.openBlock(), vue.createBlock(vue.unref(DialogDescription_default), { key: 1, "data-slot": "description", class: vue.normalizeClass(ui2.value.description({ class: (_c2 = vue.unref(props).ui) == null ? void 0 : _c2.description })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "description", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).description), 1) ]) ]), _: 3 }, 8, ["class"])) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true), !!slots.actions || vue.unref(props).close || !!slots.close ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, "data-slot": "actions", class: vue.normalizeClass(ui2.value.actions({ class: (_d2 = vue.unref(props).ui) == null ? void 0 : _d2.actions })) }, [ vue.renderSlot(_ctx.$slots, "actions"), vue.unref(props).close || !!slots.close ? (vue.openBlock(), vue.createBlock(vue.unref(DialogClose_default), { key: 0, "as-child": "" }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "close", { ui: ui2.value }, () => { var _a6; return [ vue.unref(props).close ? (vue.openBlock(), vue.createBlock(_sfc_main$G, vue.mergeProps({ key: 0, icon: vue.unref(props).closeIcon || vue.unref(appConfig2).ui.icons.close, color: "neutral", variant: "ghost", "aria-label": vue.unref(t)("drawer.close") }, typeof vue.unref(props).close === "object" ? vue.unref(props).close : {}, { "data-slot": "close", class: ui2.value.close({ class: (_a6 = vue.unref(props).ui) == null ? void 0 : _a6.close }) }), null, 16, ["icon", "aria-label", "class"])) : vue.createCommentVNode("", true) ]; }) ]), _: 3 })) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true), !!slots.body ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, "data-slot": "body", class: vue.normalizeClass(ui2.value.body({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.body })) }, [ vue.renderSlot(_ctx.$slots, "body") ], 2)) : vue.createCommentVNode("", true), !!slots.footer ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, "data-slot": "footer", class: vue.normalizeClass(ui2.value.footer({ class: (_d = vue.unref(props).ui) == null ? void 0 : _d.footer })) }, [ vue.renderSlot(_ctx.$slots, "footer") ], 2)) : vue.createCommentVNode("", true) ], 2) ]; }) ]; }), _: 3 }, 16, ["class"]) ]; }), _: 3 }) ]), _: 3 }, 16) ]), _: 3 }, 16); }; } }; const theme$7 = { "slots": { "root": "relative flex flex-col items-center justify-center gap-4 rounded-lg p-4 sm:p-6 lg:p-8 min-w-0", "header": "flex flex-col items-center gap-2 max-w-sm text-center", "avatar": "shrink-0 mb-2", "title": "text-highlighted text-pretty font-medium", "description": "text-balance text-center", "body": "flex flex-col items-center gap-4 max-w-sm", "actions": "flex flex-wrap justify-center gap-2 shrink-0", "footer": "flex flex-col items-center gap-2 max-w-sm" }, "variants": { "size": { "xs": { "avatar": "size-8 text-base", "title": "text-sm", "description": "text-xs" }, "sm": { "avatar": "size-9 text-lg", "title": "text-sm", "description": "text-xs" }, "md": { "avatar": "size-10 text-xl", "title": "text-base", "description": "text-sm" }, "lg": { "avatar": "size-11 text-[22px]", "title": "text-base", "description": "text-sm" }, "xl": { "avatar": "size-12 text-2xl", "title": "text-lg", "description": "text-base" } }, "variant": { "solid": { "root": "bg-inverted", "title": "text-inverted", "description": "text-dimmed" }, "outline": { "root": "bg-default ring ring-default", "description": "text-muted" }, "soft": { "root": "bg-elevated/50", "description": "text-toned" }, "subtle": { "root": "bg-elevated/50 ring ring-default", "description": "text-toned" }, "naked": { "description": "text-muted" } }, "loading": { "true": { "avatar": "[&>[data-slot=icon]]:animate-spin" } } }, "defaultVariants": { "variant": "outline", "size": "md" } }; const _sfc_main$o = { __name: "Empty", props: { as: { type: null, required: false }, icon: { type: null, required: false }, avatar: { type: Object, required: false }, loading: { type: Boolean, required: false }, loadingIcon: { type: null, required: false }, title: { type: String, required: false }, description: { type: String, required: false }, actions: { type: Array, required: false }, variant: { type: null, required: false }, size: { type: null, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false } }, setup(__props) { const _props = __props; const slots = vue.useSlots(); const props = useComponentProps("empty", _props); const appConfig2 = useAppConfig(); const iconName = vue.computed(() => props.loading ? props.loadingIcon || appConfig2.ui.icons.loading : props.icon); const as = vue.computed(() => resolveAs(props.as, { root: "div", title: "h2" })); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$7, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.empty) || {} })({ variant: props.variant, size: props.size, loading: props.loading }); }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: as.value.root, "aria-busy": vue.unref(props).loading ? "true" : void 0, "data-slot": "root", class: vue.normalizeClass(ui2.value.root({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.root, vue.unref(props).class] })) }, { default: vue.withCtx(() => { var _a3, _b, _c, _d; return [ !!slots.header || (iconName.value || vue.unref(props).avatar || !!slots.leading) || (vue.unref(props).title || !!slots.title) || (vue.unref(props).description || !!slots.description) ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "header", class: vue.normalizeClass(ui2.value.header({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.header })) }, [ vue.renderSlot(_ctx.$slots, "header", {}, () => { var _a4, _b2; return [ vue.renderSlot(_ctx.$slots, "leading", { ui: ui2.value }, () => { var _a5; return [ iconName.value || vue.unref(props).avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 0, icon: iconName.value }, typeof vue.unref(props).avatar === "object" ? vue.unref(props).avatar : {}, { "data-slot": "avatar", class: ui2.value.avatar({ class: (_a5 = vue.unref(props).ui) == null ? void 0 : _a5.avatar }) }), null, 16, ["icon", "class"])) : vue.createCommentVNode("", true) ]; }), vue.unref(props).title || !!slots.title ? (vue.openBlock(), vue.createBlock(vue.unref(Primitive), { key: 0, as: as.value.title, "data-slot": "title", class: vue.normalizeClass(ui2.value.title({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.title })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "title", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).title), 1) ]) ]), _: 3 }, 8, ["as", "class"])) : vue.createCommentVNode("", true), vue.unref(props).description || !!slots.description ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, "data-slot": "description", class: vue.normalizeClass(ui2.value.description({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.description })) }, [ vue.renderSlot(_ctx.$slots, "description", {}, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).description), 1) ]) ], 2)) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true), !!slots.body || (((_b = vue.unref(props).actions) == null ? void 0 : _b.length) || !!slots.actions) ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, "data-slot": "body", class: vue.normalizeClass(ui2.value.body({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.body })) }, [ vue.renderSlot(_ctx.$slots, "body", {}, () => { var _a4, _b2; return [ ((_a4 = vue.unref(props).actions) == null ? void 0 : _a4.length) || !!slots.actions ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "actions", class: vue.normalizeClass(ui2.value.actions({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.actions })) }, [ vue.renderSlot(_ctx.$slots, "actions", {}, () => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).actions, (action, index) => { return vue.openBlock(), vue.createBlock(_sfc_main$G, vue.mergeProps({ key: index, size: vue.unref(props).size }, { ref_for: true }, action), null, 16, ["size"]); }), 128)) ]) ], 2)) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true), !!slots.footer ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, "data-slot": "footer", class: vue.normalizeClass(ui2.value.footer({ class: (_d = vue.unref(props).ui) == null ? void 0 : _d.footer })) }, [ vue.renderSlot(_ctx.$slots, "footer") ], 2)) : vue.createCommentVNode("", true) ]; }), _: 3 }, 8, ["as", "aria-busy", "class"]); }; } }; const theme$6 = { "slots": { "root": "flex items-center gap-2", "list": "relative flex p-1 group", "indicator": "absolute transition-[translate,width] duration-200 ease-out motion-reduce:transition-none", "trigger": [ "group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75", "transition-colors" ], "leadingIcon": "shrink-0", "leadingAvatar": "shrink-0", "leadingAvatarSize": "", "label": "truncate", "trailingBadge": "shrink-0", "trailingBadgeSize": "sm", "content": "w-full rounded-md focus-visible:outline-3" }, "variants": { "color": { "primary": { "content": "outline-primary/25" }, "success": { "content": "outline-success/25" }, "info": { "content": "outline-info/25" }, "warning": { "content": "outline-warning/25" }, "error": { "content": "outline-error/25" }, "neutral": { "content": "outline-inverted/25" } }, "variant": { "pill": { "list": "bg-elevated rounded-lg", "trigger": [ "grow", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate" ], "indicator": "rounded-md shadow-xs" }, "link": { "list": "border-default", "indicator": "rounded-full", "trigger": "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full" } }, "orientation": { "horizontal": { "root": "flex-col", "list": "w-full", "indicator": "left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)", "trigger": "justify-center" }, "vertical": { "list": "flex-col", "indicator": "top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)" } }, "size": { "xs": { "trigger": "px-2 py-1 text-xs gap-1", "leadingIcon": "size-4", "leadingAvatarSize": "3xs" }, "sm": { "trigger": "px-2.5 py-1.5 text-xs gap-1.5", "leadingIcon": "size-4", "leadingAvatarSize": "3xs" }, "md": { "trigger": "px-3 py-1.5 text-sm gap-1.5", "leadingIcon": "size-5", "leadingAvatarSize": "2xs" }, "lg": { "trigger": "px-3 py-2 text-sm gap-2", "leadingIcon": "size-5", "leadingAvatarSize": "2xs" }, "xl": { "trigger": "px-3 py-2 text-base gap-2", "leadingIcon": "size-6", "leadingAvatarSize": "xs" } } }, "compoundVariants": [ { "orientation": "horizontal", "variant": "pill", "class": { "indicator": "inset-y-1" } }, { "orientation": "horizontal", "variant": "link", "class": { "list": "border-b -mb-px", "indicator": "-bottom-px h-px", "trigger": "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px" } }, { "orientation": "vertical", "variant": "pill", "class": { "indicator": "inset-x-1", "list": "items-center", "trigger": "w-full justify-center" } }, { "orientation": "vertical", "variant": "link", "class": { "list": "border-s -ms-px", "indicator": "-start-px w-px", "trigger": "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px" } }, { "color": "primary", "variant": "pill", "class": { "indicator": "bg-primary", "trigger": [ "data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary" ] } }, { "color": "success", "variant": "pill", "class": { "indicator": "bg-success", "trigger": [ "data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success" ] } }, { "color": "info", "variant": "pill", "class": { "indicator": "bg-info", "trigger": [ "data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info" ] } }, { "color": "warning", "variant": "pill", "class": { "indicator": "bg-warning", "trigger": [ "data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning" ] } }, { "color": "error", "variant": "pill", "class": { "indicator": "bg-error", "trigger": [ "data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error" ] } }, { "color": "neutral", "variant": "pill", "class": { "indicator": "bg-inverted", "trigger": [ "data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted" ] } }, { "color": "primary", "variant": "link", "class": { "indicator": "bg-primary", "trigger": [ "data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary" ] } }, { "color": "success", "variant": "link", "class": { "indicator": "bg-success", "trigger": [ "data-[state=active]:text-success outline-success/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success" ] } }, { "color": "info", "variant": "link", "class": { "indicator": "bg-info", "trigger": [ "data-[state=active]:text-info outline-info/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info" ] } }, { "color": "warning", "variant": "link", "class": { "indicator": "bg-warning", "trigger": [ "data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning" ] } }, { "color": "error", "variant": "link", "class": { "indicator": "bg-error", "trigger": [ "data-[state=active]:text-error outline-error/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error" ] } }, { "color": "neutral", "variant": "link", "class": { "indicator": "bg-inverted", "trigger": [ "data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3", "in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted" ] } } ], "defaultVariants": { "color": "primary", "variant": "pill", "size": "md" } }; const _sfc_main$n = { __name: "Tabs", props: { as: { type: null, required: false }, items: { type: Array, required: false }, color: { type: null, required: false }, variant: { type: null, required: false }, size: { type: null, required: false }, orientation: { type: null, required: false, default: "horizontal" }, content: { type: Boolean, required: false, default: true }, valueKey: { type: null, required: false, default: "value" }, labelKey: { type: null, required: false, default: "label" }, class: { type: null, required: false }, ui: { type: Object, required: false }, defaultValue: { type: [String, Number], required: false, default: "0" }, modelValue: { type: [String, Number], required: false }, activationMode: { type: String, required: false }, unmountOnHide: { type: Boolean, required: false, default: true } }, emits: ["update:modelValue"], setup(__props, { expose: __expose, emit: __emit }) { const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("tabs", _props); const appConfig2 = useAppConfig(); const rootProps = useForwardProps(reactivePick(props, "as", "unmountOnHide"), emits); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$6, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.tabs) || {} })({ color: props.color, variant: props.variant, size: props.size, orientation: props.orientation }); }); const triggersRef = vue.ref([]); function setTriggerRef(index, el) { triggersRef.value[index] = el; } __expose({ triggersRef }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(TabsRoot_default), vue.mergeProps(vue.unref(rootProps), { "model-value": vue.unref(props).modelValue, "default-value": vue.unref(props).defaultValue, orientation: vue.unref(props).orientation, "activation-mode": vue.unref(props).activationMode, "data-slot": "root", class: ui2.value.root({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.root, vue.unref(props).class] }) }), { default: vue.withCtx(() => { var _a3; return [ vue.createVNode(vue.unref(TabsList_default), { "data-slot": "list", class: vue.normalizeClass(ui2.value.list({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.list })) }, { default: vue.withCtx(() => { var _a4; return [ vue.createVNode(vue.unref(TabsIndicator_default), { "data-slot": "indicator", class: vue.normalizeClass(ui2.value.indicator({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.indicator })) }, null, 8, ["class"]), vue.renderSlot(_ctx.$slots, "list-leading"), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).items, (item, index) => { var _a5, _b, _c, _d; return vue.openBlock(), vue.createBlock(vue.unref(TabsTrigger_default), { key: (_a5 = vue.unref(get)(item, vue.unref(props).valueKey)) != null ? _a5 : index, ref_for: true, ref: (el) => setTriggerRef(index, el), value: (_b = vue.unref(get)(item, vue.unref(props).valueKey)) != null ? _b : String(index), disabled: item.disabled, "data-slot": "trigger", class: vue.normalizeClass(ui2.value.trigger({ class: [(_c = vue.unref(props).ui) == null ? void 0 : _c.trigger, (_d = item.ui) == null ? void 0 : _d.trigger] })) }, { default: vue.withCtx(() => { var _a6, _b2; return [ vue.renderSlot(_ctx.$slots, "leading", { item, index, ui: ui2.value }, () => { var _a7, _b3, _c2, _d2, _e2, _f; return [ item.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: item.icon, "data-slot": "leadingIcon", class: vue.normalizeClass(ui2.value.leadingIcon({ class: [(_a7 = vue.unref(props).ui) == null ? void 0 : _a7.leadingIcon, (_b3 = item.ui) == null ? void 0 : _b3.leadingIcon] })) }, null, 8, ["name", "class"])) : item.avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 1, size: ((_c2 = item.ui) == null ? void 0 : _c2.leadingAvatarSize) || ((_d2 = vue.unref(props).ui) == null ? void 0 : _d2.leadingAvatarSize) || ui2.value.leadingAvatarSize() }, { ref_for: true }, item.avatar, { "data-slot": "leadingAvatar", class: ui2.value.leadingAvatar({ class: [(_e2 = vue.unref(props).ui) == null ? void 0 : _e2.leadingAvatar, (_f = item.ui) == null ? void 0 : _f.leadingAvatar] }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true) ]; }), vue.unref(get)(item, vue.unref(props).labelKey) || !!slots.default ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "data-slot": "label", class: vue.normalizeClass(ui2.value.label({ class: [(_a6 = vue.unref(props).ui) == null ? void 0 : _a6.label, (_b2 = item.ui) == null ? void 0 : _b2.label] })) }, [ vue.renderSlot(_ctx.$slots, "default", { item, index }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(get)(item, vue.unref(props).labelKey)), 1) ]) ], 2)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "trailing", { item, index, ui: ui2.value }, () => { var _a7, _b3, _c2, _d2; return [ item.badge || item.badge === 0 ? (vue.openBlock(), vue.createBlock(_sfc_main$C, vue.mergeProps({ key: 0, color: "neutral", variant: "outline", size: ((_a7 = item.ui) == null ? void 0 : _a7.trailingBadgeSize) || ((_b3 = vue.unref(props).ui) == null ? void 0 : _b3.trailingBadgeSize) || ui2.value.trailingBadgeSize() }, { ref_for: true }, typeof item.badge === "string" || typeof item.badge === "number" ? { label: item.badge } : item.badge, { "data-slot": "trailingBadge", class: ui2.value.trailingBadge({ class: [(_c2 = vue.unref(props).ui) == null ? void 0 : _c2.trailingBadge, (_d2 = item.ui) == null ? void 0 : _d2.trailingBadge] }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true) ]; }) ]; }), _: 2 }, 1032, ["value", "disabled", "class"]); }), 128)), vue.renderSlot(_ctx.$slots, "list-trailing") ]; }), _: 3 }, 8, ["class"]), !!vue.unref(props).content ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(vue.unref(props).items, (item, index) => { var _a4, _b, _c, _d; return vue.openBlock(), vue.createBlock(vue.unref(TabsContent_default), { key: (_a4 = vue.unref(get)(item, vue.unref(props).valueKey)) != null ? _a4 : index, value: (_b = vue.unref(get)(item, vue.unref(props).valueKey)) != null ? _b : String(index), "data-slot": "content", class: vue.normalizeClass(ui2.value.content({ class: [(_c = vue.unref(props).ui) == null ? void 0 : _c.content, (_d = item.ui) == null ? void 0 : _d.content, item.class] })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, item.slot || "content", { item, index, ui: ui2.value }, () => [ vue.createTextVNode(vue.toDisplayString(item.content), 1) ]) ]), _: 2 }, 1032, ["value", "class"]); }), 128)) : vue.createCommentVNode("", true) ]; }), _: 3 }, 16, ["model-value", "default-value", "orientation", "activation-mode", "class"]); }; } }; let didaAudioPlayer = null; function playDidaSound() { try { if (!didaAudioPlayer) { didaAudioPlayer = new Audio(); didaAudioPlayer.volume = 0.5; } const src = resolveGithubUrl(CONFIG.didaUrl); if (didaAudioPlayer.src !== src) didaAudioPlayer.src = src; didaAudioPlayer.currentTime = 0; didaAudioPlayer.play().catch(() => { }); } catch (e) { addLog("播放提示音失败: " + e.message, "warning", true); } } function safeCopyText(text, onResult = null) { const notify2 = (v) => { if (typeof onResult === "function") { try { onResult(!!v); } catch (e) { } } }; if (!text) { notify2(false); return; } if (typeof GM_setClipboard === "function") { try { GM_setClipboard(text); addLog("[复制] 已复制到剪贴板 (GM_setClipboard)", "success", true); playDidaSound(); notify2(true); return; } catch (e) { addLog("[复制] GM_setClipboard 失败: " + e.message, "error", true); } } if (navigator.clipboard && typeof navigator.clipboard.writeText === "function") { navigator.clipboard.writeText(text).then(() => { addLog("[复制] 已复制到剪贴板 (navigator.clipboard)", "success", true); playDidaSound(); notify2(true); }).catch((err) => { addLog("[复制] 复制到剪贴板失败: " + err.message, "error", true); notify2(false); }); return; } notify2(false); } const SHADOW_ROOT_KEY = Symbol("znhd-shadow-root"); let currentShadowRoot = null; function setShadowRoot(root) { currentShadowRoot = root; } let overlayRootEl = null; function getOverlayRoot() { const root = currentShadowRoot; if (!root) { throw new Error("[znhd] getOverlayRoot(): shadowRoot 尚未挂载(mountPanel 未执行)"); } if (!overlayRootEl || !overlayRootEl.isConnected) { overlayRootEl = root.ownerDocument.createElement("div"); overlayRootEl.id = "znhd-overlay-root"; root.appendChild(overlayRootEl); } return overlayRootEl; } const _hoisted_1$e = ["data-state"]; const _hoisted_2$c = { class: "flex items-center gap-1" }; const _hoisted_3$a = { key: 0, class: "flex min-h-0 flex-1 flex-col items-center justify-center gap-2" }; const _hoisted_4$a = ["onClick"]; const _hoisted_5$a = { class: "flex items-start gap-2" }; const _hoisted_6$8 = { class: "line-clamp-3 min-w-0 flex-1 break-words text-[13px] leading-5" }; const _hoisted_7$8 = { class: "mt-0.5 shrink-0 opacity-40 transition-opacity group-hover:text-primary group-hover:opacity-100" }; const TIP_W = 300; const TIP_GAP = 10; const _sfc_main$m = vue.defineComponent({ __name: "PhrasesSheet", props: { open: { type: Boolean }, phrasesData: {}, phrasesLoading: { type: Boolean }, searchKeyword: {} }, emits: ["update:open", "update:searchKeyword", "reload"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; const keyword = vue.computed(() => props.searchKeyword.trim().toLowerCase()); const hit = (t) => !keyword.value || t.toLowerCase().includes(keyword.value); const all = vue.computed(() => (props.phrasesData.all || []).filter(hit)); const mine = vue.computed(() => (props.phrasesData.mine || []).filter(hit)); const tab = vue.ref("all"); const tabItems = vue.computed(() => [ { label: "全部话术", value: "all" }, { label: "我的话术", value: "mine" } ]); const rows = vue.computed(() => tab.value === "all" ? all.value : mine.value); const emptyText = vue.computed( () => tab.value === "all" ? "暂无全部话术,点右上角刷新抓取" : "暂无我的话术,点右上角刷新抓取" ); const boxEl = vue.ref(null); const overlayTarget = getOverlayRoot(); const tipText = vue.ref(""); const tipShow = vue.ref(false); const tipPos = vue.ref(null); const tipEl = vue.ref(null); function hideTip() { tipShow.value = false; tipPos.value = null; tipText.value = ""; } async function showTip(e) { var _a2; const hit2 = e.currentTarget; if (!hit2) return; const text = (hit2.textContent || "").trim(); if (!text) return; tipText.value = text; tipPos.value = null; tipShow.value = true; await vue.nextTick(); if (!tipShow.value) return; const el = tipEl.value; const row = hit2.getBoundingClientRect(); const box = (_a2 = boxEl.value) == null ? void 0 : _a2.getBoundingClientRect(); const w = (el == null ? void 0 : el.offsetWidth) || TIP_W; const h2 = (el == null ? void 0 : el.offsetHeight) || 0; const vw = window.innerWidth; const vh = window.innerHeight; const leftSide = (box ? box.left : row.left) - TIP_GAP - w; const rightSide = (box ? box.right : row.right) + TIP_GAP; const x = leftSide >= 8 ? leftSide : rightSide + w <= vw - 8 ? rightSide : 8; const y = Math.max(8, Math.min(row.top, vh - 8 - h2)); tipPos.value = { x: Math.round(x), y: Math.round(y) }; } vue.watch( () => props.open, (v) => { if (!v) hideTip(); } ); function pick(text) { safeCopyText(text); emit2("update:open", false); appendToTinyMCE(text); addLog(`添加文本: ${text}`, "success"); toast.success("添加文本: " + text); } return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.createVNode(_sfc_main$p, { open: props.open, title: "常用语", direction: "right", "no-body-styles": "", handle: false, class: "w-[360px]", "onUpdate:open": _cache[3] || (_cache[3] = ($event) => emit2("update:open", $event)) }, { content: vue.withCtx(() => [ vue.createElementVNode("div", { ref_key: "boxEl", ref: boxEl, "data-znhd": "dialog", "data-state": props.open ? "open" : "closed", class: "flex h-full min-h-0 w-full flex-col overflow-x-hidden overflow-y-auto p-4 sm:p-6" }, [ vue.createElementVNode("div", _hoisted_2$c, [ _cache[4] || (_cache[4] = vue.createElementVNode("h3", { class: "flex-1 text-[15px] font-semibold" }, "常用语", -1)), vue.createVNode(_sfc_main$z, { text: "重新加载常用语" }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, { icon: "i-lucide-refresh-cw", size: "md", color: "primary", variant: "ghost", "aria-label": "重新加载常用语", loading: props.phrasesLoading, "loading-icon": "i-lucide-loader", onClick: _cache[0] || (_cache[0] = ($event) => emit2("reload", true)) }, null, 8, ["loading"]) ]), _: 1 }) ]), vue.createVNode(_sfc_main$E, { class: "my-3 w-full", size: "sm", icon: "i-lucide-search", placeholder: "搜索常用语(按内容)", "model-value": props.searchKeyword, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => emit2("update:searchKeyword", $event)) }, null, 8, ["model-value"]), vue.createVNode(_sfc_main$n, { modelValue: tab.value, "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => tab.value = $event), items: tabItems.value, content: false, "unmount-on-hide": false, class: "mb-3 w-full" }, null, 8, ["modelValue", "items"]), props.phrasesLoading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$a, [ vue.createVNode(_sfc_main$t, { size: 30 }), _cache[5] || (_cache[5] = vue.createElementVNode("span", { class: "text-center text-xs leading-5 text-muted" }, " 正在抓取常用话术…(右侧栏会自动切 tab,请勿操作) ", -1)) ])) : !rows.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$o, { key: 1, description: emptyText.value, size: "xs" }, null, 8, ["description"])) : (vue.openBlock(), vue.createElementBlock("div", { key: 2, class: "flex flex-col gap-2", onScroll: hideTip }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(rows.value, (t, i) => { return vue.openBlock(), vue.createElementBlock("button", { key: tab.value + i, "data-znhd": "phrase-card", class: "group relative min-h-[64px] w-full rounded-md border border-default bg-elevated p-3 text-left transition-colors hover:border-primary hover:bg-accented focus-visible:border-primary focus-visible:outline-none", onMouseenter: showTip, onMouseleave: hideTip, onFocus: showTip, onBlur: hideTip, onClick: ($event) => pick(t) }, [ vue.createElementVNode("span", _hoisted_5$a, [ vue.createElementVNode("span", _hoisted_6$8, vue.toDisplayString(t), 1), vue.createElementVNode("span", _hoisted_7$8, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-chevron-right", size: 14 }) ]) ]) ], 40, _hoisted_4$a); }), 128)) ], 32)) ], 8, _hoisted_1$e) ]), _: 1 }, 8, ["open"]), (vue.openBlock(), vue.createBlock(vue.Teleport, { to: vue.unref(overlayTarget) }, [ tipShow.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, ref_key: "tipEl", ref: tipEl, "data-znhd": "phrase-tip", class: vue.normalizeClass(["pointer-events-none fixed z-10 max-h-[50vh] max-w-[300px] overflow-hidden rounded-md bg-inverted p-2 text-xs leading-5 break-words whitespace-pre-wrap text-inverted shadow-lg", tipPos.value ? "visible" : "invisible"]), style: vue.normalizeStyle(tipPos.value ? { left: tipPos.value.x + "px", top: tipPos.value.y + "px" } : void 0) }, vue.toDisplayString(tipText.value), 7)) : vue.createCommentVNode("", true) ], 8, ["to"])) ], 64); }; } }); const _hoisted_1$d = { class: "flex items-start justify-between gap-2" }; const _hoisted_2$b = { "data-log-filter": "1", role: "group", "aria-label": "日志类型筛选", class: "flex flex-wrap gap-1" }; const _hoisted_3$9 = ["checked", "aria-label", "title", "onChange"]; const _hoisted_4$9 = { class: "flex-none basis-[86px] opacity-55" }; const _hoisted_5$9 = { class: "min-w-0 flex-1 whitespace-pre-wrap break-words" }; const _hoisted_6$7 = { key: 1, class: "py-6 text-center opacity-55" }; const _hoisted_7$7 = { class: "mt-2 flex items-center justify-between gap-2 border-t border-default pt-1.5 text-[11.5px] text-muted" }; const _hoisted_8$7 = { class: "text-default" }; const _hoisted_9$7 = { class: "text-default" }; const _hoisted_10$5 = { class: "flex items-center gap-2.5" }; const _hoisted_11$4 = { class: "flex items-center gap-1.5", title: "开启后新日志持续刷新并自动滚到底部;关闭后列表冻结在当前快照,便于往上翻看历史" }; const _sfc_main$l = vue.defineComponent({ __name: "LogDialog", props: { open: { type: Boolean }, logEntries: {}, autoRefresh: { type: Boolean } }, emits: ["update:open", "clear", "update:autoRefresh"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; const TYPES = [ { type: "info", label: "信息", text: "text-info", bar: "border-l-info", chip: "text-info border-info peer-checked:bg-info peer-checked:text-white" }, { type: "success", label: "成功", text: "text-success", bar: "border-l-success", chip: "text-success border-success peer-checked:bg-success peer-checked:text-white" }, { type: "warning", label: "警告", text: "text-warning", bar: "border-l-warning", chip: "text-warning border-warning peer-checked:bg-warning peer-checked:text-white" }, { type: "error", label: "错误", text: "text-error", bar: "border-l-error", chip: "text-error border-error peer-checked:bg-error peer-checked:text-white" } ]; const metaOf = (t) => TYPES.find((m) => m.type === t) || TYPES[0]; const filter = vue.ref({ info: true, success: true, warning: true, error: true }); const allMode = vue.computed(() => TYPES.every((m) => filter.value[m.type])); const anyFilter = vue.computed(() => TYPES.some((m) => filter.value[m.type])); const snapshot = vue.ref([]); const scroller = vue.ref(null); vue.watch( () => props.autoRefresh, (next, prev) => { if (prev && !next) snapshot.value = props.logEntries; } ); const source = vue.computed(() => props.autoRefresh ? props.logEntries : snapshot.value); const counts = vue.computed(() => { const c = { info: 0, success: 0, warning: 0, error: 0 }; source.value.forEach((e) => c[e.type] = (c[e.type] || 0) + 1); return c; }); const shown = vue.computed(() => source.value.filter((e) => filter.value[e.type])); const rows = vue.computed(() => shown.value.slice().reverse()); const latest = vue.computed(() => source.value[0]); function selectAll() { const next = !allMode.value; filter.value = { info: next, success: next, warning: next, error: next }; } function toggleType(type, checked) { filter.value = { ...filter.value, [type]: checked }; } async function scrollToBottom() { if (!props.open || !props.autoRefresh) return; await vue.nextTick(); const el = scroller.value; if (el) el.scrollTop = el.scrollHeight; } vue.watch([() => props.open, () => props.logEntries, () => props.autoRefresh, filter], scrollToBottom); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(_sfc_main$v, { open: props.open, title: "运行日志", width: 560, footer: false, "onUpdate:open": _cache[2] || (_cache[2] = (v) => emit2("update:open", v)) }, { default: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_1$d, [ vue.createElementVNode("div", _hoisted_2$b, [ vue.createVNode(_sfc_main$G, { size: "sm", color: "neutral", variant: allMode.value ? "solid" : "ghost", class: "rounded-md", "aria-pressed": allMode.value, title: allMode.value ? "取消全部(四个类型一并取消)" : "选中全部类型", onClick: selectAll }, { default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [ vue.createTextVNode(" 全部 ", -1) ])]), _: 1 }, 8, ["variant", "aria-pressed", "title"]), (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(TYPES, (m) => { return vue.createElementVNode("label", { key: m.type, class: "relative inline-flex h-8 cursor-pointer items-center text-xs font-medium" }, [ vue.createElementVNode("input", { class: "peer sr-only", type: "checkbox", checked: filter.value[m.type], "aria-label": m.label + " " + (counts.value[m.type] || 0), title: filter.value[m.type] ? "点击隐藏该类日志" : "点击显示该类日志", onChange: ($event) => toggleType(m.type, $event.target.checked) }, null, 40, _hoisted_3$9), vue.createElementVNode("span", { class: vue.normalizeClass(["flex h-8 items-center rounded-md border border-current bg-transparent px-2.5 leading-8 transition-colors", m.chip]) }, vue.toDisplayString(m.label) + " " + vue.toDisplayString(counts.value[m.type] || 0), 3) ]); }), 64)) ]), vue.createVNode(_sfc_main$G, { color: "error", size: "sm", class: "shrink-0", disabled: props.logEntries.length === 0, onClick: _cache[0] || (_cache[0] = ($event) => emit2("clear")) }, { default: vue.withCtx(() => [..._cache[4] || (_cache[4] = [ vue.createTextVNode(" 清空 ", -1) ])]), _: 1 }, 8, ["disabled"]) ]), vue.createElementVNode("div", { ref_key: "scroller", ref: scroller, class: "mt-2.5 flex h-[360px] flex-col overflow-y-auto rounded-md border border-inverted/10 bg-inverted py-2 font-mono text-[12.5px] leading-[1.9] text-inverted" }, [ rows.value.length ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(rows.value, (entry, i) => { return vue.openBlock(), vue.createElementBlock("div", { key: i, class: vue.normalizeClass(["flex items-start gap-2 border-l-[3px] px-[10px] py-[2px] pl-[9px] hover:bg-white/10", metaOf(entry.type).bar]) }, [ vue.createElementVNode("span", _hoisted_4$9, vue.toDisplayString(entry.timestamp), 1), vue.createElementVNode("span", { class: vue.normalizeClass(["flex-none basis-[52px] font-semibold", metaOf(entry.type).text]) }, vue.toDisplayString(metaOf(entry.type).label), 3), vue.createElementVNode("span", _hoisted_5$9, vue.toDisplayString(entry.message), 1) ], 2); }), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$7, vue.toDisplayString(source.value.length ? anyFilter.value ? "没有符合当前筛选条件的日志" : "未选择任何类型" : "暂无日志"), 1)) ], 512), vue.createElementVNode("div", _hoisted_7$7, [ vue.createElementVNode("span", null, [ _cache[5] || (_cache[5] = vue.createTextVNode(" 共 ", -1)), vue.createElementVNode("b", _hoisted_8$7, vue.toDisplayString(source.value.length), 1), _cache[6] || (_cache[6] = vue.createTextVNode(" 条 · 显示 ", -1)), vue.createElementVNode("b", _hoisted_9$7, vue.toDisplayString(shown.value.length), 1), vue.createTextVNode(" 条 " + vue.toDisplayString(props.autoRefresh ? "" : " · 已冻结"), 1) ]), vue.createElementVNode("span", _hoisted_10$5, [ vue.createElementVNode("label", _hoisted_11$4, [ vue.createVNode(_sfc_main$x, { size: "sm", "model-value": props.autoRefresh, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => emit2("update:autoRefresh", $event)) }, null, 8, ["model-value"]), _cache[7] || (_cache[7] = vue.createTextVNode(" 自动刷新 ", -1)) ]), vue.createElementVNode("span", null, [ _cache[8] || (_cache[8] = vue.createTextVNode(" 最新 ", -1)), vue.createElementVNode("span", { class: vue.normalizeClass(["font-mono", latest.value ? metaOf(latest.value.type).text : "opacity-55"]) }, vue.toDisplayString(latest.value ? latest.value.timestamp : "--:--:--"), 3) ]) ]) ]) ]), _: 1 }, 8, ["open"]); }; } }); const UNNAMED_CONV_ID = ""; const MAX_WALK_DEPTH = 7; const MAX_STEMS_PER_MSG = 8; const CONV_ID_KEY_RE = /^(?:C2C|GROUP|@TIM#)/i; function str(v) { return typeof v === "string" ? v.trim() : ""; } function num(v) { return typeof v === "number" && Number.isFinite(v) ? v : null; } function msgTime(msg) { const raw = num(msg.time); if (raw !== null && raw > 0) return raw < 1e11 ? raw * 1e3 : raw; for (const k of ["systemTime", "talkTime", "timestamp"]) { const v = msg[k]; const n = num(v); if (n !== null && n > 0) return n < 1e11 ? n * 1e3 : n; const s = str(v); if (!s) continue; const m = /^(\d{4})-(\d{1,2})-(\d{1,2})[ T](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?/.exec(s); if (m) { const t = new Date( Number(m[1]), Number(m[2]) - 1, Number(m[3]), Number(m[4]), Number(m[5]), Number(m[6] || 0) ).getTime(); if (Number.isFinite(t)) return t; } } return null; } function shortId(id) { return id.length > 8 ? id.slice(-8) : id; } function isFallbackId(id) { return id.indexOf("name:") === 0; } function fallbackName(id) { return isFallbackId(id) ? id.slice(5) : ""; } function normName(name) { return str(name).replace(/[((][^(())]*[))]/g, "").replace(/\s+/g, "").toLowerCase(); } const MIN_CONTAIN_LEN = 4; function firstOf(set) { for (const v of set) return v; return null; } class AliasTable { constructor() { __publicField(this, "byExact", new Map()); __publicField(this, "byNorm", new Map()); __publicField(this, "pairs", []); } get size() { return this.byExact.size; } add(name, id) { const n = str(name); if (!n || !id || isFallbackId(id)) return; if (!this.byExact.has(n)) this.byExact.set(n, id); const k = normName(n); if (!k) return; let set = this.byNorm.get(k); if (!set) { set = new Set(); this.byNorm.set(k, set); } if (set.has(id)) return; set.add(id); this.pairs.push([k, id]); } lookup(name) { const n = str(name); if (!n) return null; const exact = this.byExact.get(n); if (exact) return exact; const k = normName(n); if (!k) return null; const hit = this.byNorm.get(k); if (hit && hit.size === 1) return firstOf(hit); if (k.length < MIN_CONTAIN_LEN) return null; const ids = new Set(); for (const pair of this.pairs) { const k2 = pair[0]; if (k2 === k || k2.length < MIN_CONTAIN_LEN) continue; if (k.indexOf(k2) >= 0 || k2.indexOf(k) >= 0) ids.add(pair[1]); } return ids.size === 1 ? firstOf(ids) : null; } entries() { return Array.from(this.byExact.entries()); } } function hostDoc() { try { if (typeof unsafeWindow !== "undefined" && unsafeWindow.document) return unsafeWindow.document; } catch (e) { } try { return document; } catch (e) { return null; } } function readVueInstance() { const docs = [hostDoc(), document]; for (const d of docs) { if (!d) continue; try { const el = d.querySelector("#app"); const vm = el && el.__vue__; if (vm && vm.$store && vm.$store.state) return vm; } catch (e) { } } return null; } function readChatState() { const vm = readVueInstance(); const st2 = vm && vm.$store && vm.$store.state; return st2 && typeof st2 === "object" ? st2 : null; } function domCurrentName() { const docs = [hostDoc(), document]; for (const d of docs) { if (!d) continue; try { const el = d.querySelector(".group-item.selected .company-name"); const t = el && el.textContent ? el.textContent.trim() : ""; if (t) return t; } catch (e) { } } return ""; } function getCurrentConv() { let id = ""; let name = ""; const st2 = readChatState(); const chat = st2 && st2.chat; const sel = chat && chat.selectItem; const ci = sel && sel.conversationInfo; if (ci) { id = str(ci.conversationID) || str(ci.conversationId) || str(ci.sessionID); const gp = ci.groupProfile; name = (gp ? str(gp.name) : "") || str(ci.name); } if (!name) name = domCurrentName(); if (!id && !name) return null; return { id: id || "name:" + name, name: name || "会话 " + shortId(id), sender: null, time: null }; } function stemKey(v) { const s = str(v); if (!s) return ""; return urlFileStem(s) || s.toLowerCase(); } function stemsOfPayload(p) { const out = []; const push = (v) => { const k = stemKey(v); if (k && out.indexOf(k) < 0) out.push(k); }; push(p.fileName); push(p.uuid); const arr = p.imageInfoArray; if (Array.isArray(arr)) { for (const x of arr) { if (x && typeof x === "object") push(x.imageUrl); } } return out.slice(0, MAX_STEMS_PER_MSG); } function convOfNode(obj, ctx) { let id = str(obj.conversationID) || str(obj.conversationId) || str(obj.sessionID) || ctx.id; let name = str(obj.conversationName) || str(obj.groupName) || ctx.name; const ci = obj.conversationInfo || obj.conversation || obj.sessionInfo; if (ci && typeof ci === "object") { id = str(ci.conversationID) || str(ci.conversationId) || str(ci.sessionID) || id; if (!name) { const gp = ci.groupProfile; name = (gp ? str(gp.name) : "") || str(ci.name) || name; } } const sender = str(obj.sendUserName) || ctx.sender; if (id === ctx.id && name === ctx.name && sender === ctx.sender) return ctx; return { id, name, sender }; } function walkAny(node, ctx, depth, visit) { if (node === null || node === void 0 || depth > MAX_WALK_DEPTH) return; if (Array.isArray(node)) { for (const x of node) walkAny(x, ctx, depth + 1, visit); return; } if (typeof node !== "object") return; const obj = node; if (obj.type === "TIMImageElem" && obj.payload) { visit(obj, ctx); return; } const next = convOfNode(obj, ctx); for (const k of Object.keys(obj)) { const childCtx = CONV_ID_KEY_RE.test(k) && !next.id ? { ...next, id: k } : next; walkAny(obj[k], childCtx, depth + 1, visit); } } function toConv(msg, ctx, current, aliases) { let id = str(msg.conversationID) || str(msg.conversationId) || str(msg.sessionID) || ctx.id; let name = str(msg.conversationName) || str(msg.groupName) || ctx.name; if (!name && current && id && id === current.id) name = current.name; if (!id || isFallbackId(id)) { const alias = aliases ? aliases.lookup(name) : null; if (alias) id = alias; } if (!id && !name) return null; const key = id || "name:" + name; return { id: key, name: name || "会话 " + shortId(key), sender: str(msg.sendUserName) || ctx.sender, time: msgTime(msg) }; } function readBucket() { try { const raw = localStorage.getItem(SNIFF_CONV_INDEX_KEY); if (!raw) return null; const parsed = JSON.parse(raw); if (!parsed || parsed.origin !== location.origin) return null; if (!parsed.items || typeof parsed.items !== "object") return null; return parsed; } catch (e) { return null; } } function loadStoredAliases(bucket) { const out = []; if (!bucket || !bucket.aliases || typeof bucket.aliases !== "object") return out; const now = Date.now(); for (const name of Object.keys(bucket.aliases)) { const r = bucket.aliases[name]; if (!r || typeof r.id !== "string" || !r.id) continue; if (!Number.isFinite(r.at) || now - r.at > CONFIG.SNIFF_CONV_TTL) continue; out.push([name, r.id]); } return out; } function loadStoredConv(bucket, aliases) { const out = []; if (!bucket) return out; const now = Date.now(); for (const k of Object.keys(bucket.items)) { const r = bucket.items[k]; if (!r || typeof r.id !== "string" || !r.id) continue; if (!Number.isFinite(r.at) || now - r.at > CONFIG.SNIFF_CONV_TTL) continue; const fb = fallbackName(r.id); const fixed = fb ? aliases.lookup(r.name) || aliases.lookup(fb) : null; const id = fixed || r.id; out.push([ k, { id, name: typeof r.name === "string" && r.name ? r.name : "会话 " + shortId(id), sender: typeof r.sender === "string" ? r.sender : null, time: num(r.time) } ]); } return out; } function pruneOldest(map, max2) { const keys = Object.keys(map); if (keys.length <= max2) return; keys.sort((a, b) => (map[a].at || 0) - (map[b].at || 0)); for (const k of keys.slice(0, keys.length - max2)) delete map[k]; } function saveStoredConv(fresh, aliases) { try { const now = Date.now(); const bucket = readBucket() || { origin: location.origin, items: {} }; bucket.origin = location.origin; if (!bucket.aliases || typeof bucket.aliases !== "object") bucket.aliases = {}; for (const [stem, conv] of fresh) { bucket.items[stem] = { id: conv.id, name: conv.name, sender: conv.sender, time: conv.time, at: now }; } for (const [name, id] of aliases.entries()) { bucket.aliases[name] = { id, at: now }; } let merged = 0; for (const k of Object.keys(bucket.items)) { const r = bucket.items[k]; if (!r || !isFallbackId(r.id)) continue; const fb = fallbackName(r.id); const id = aliases.lookup(r.name) || aliases.lookup(fb); if (!id) continue; if (!r.name) r.name = fb; r.id = id; merged++; } for (const k of Object.keys(bucket.items)) { const r = bucket.items[k]; if (!r || !Number.isFinite(r.at) || now - r.at > CONFIG.SNIFF_CONV_TTL) delete bucket.items[k]; } for (const name of Object.keys(bucket.aliases)) { const a = bucket.aliases[name]; if (!a || !Number.isFinite(a.at) || now - a.at > CONFIG.SNIFF_CONV_TTL) delete bucket.aliases[name]; } pruneOldest(bucket.items, CONFIG.MAX_SNIFF_CONV_STEMS); pruneOldest(bucket.aliases, CONFIG.MAX_SNIFF_CONV_ALIASES); localStorage.setItem(SNIFF_CONV_INDEX_KEY, JSON.stringify(bucket)); if (merged) addLog("[图片嗅探] 会话归属:合并 " + merged + " 条回退键到真实会话 ID", "info"); } catch (e) { addLog("[图片嗅探] 会话归属记录保存失败: " + e.message, "error", true); } } function buildConvContext() { let current = getCurrentConv(); const aliases = new AliasTable(); const bucket = readBucket(); for (const [name, id] of loadStoredAliases(bucket)) aliases.add(name, id); const st2 = readChatState(); const chat = st2 && st2.chat; const allChat = st2 && st2.allChat; const walkAll = (seed, visit) => { if (chat) walkAny(chat.messageList, seed, 0, visit); if (allChat) walkAny(allChat.historyMsg, { id: "", name: "", sender: null }, 0, visit); }; walkAll({ id: current ? current.id : "", name: current ? current.name : "", sender: null }, (msg, ctx) => { const conv = toConv(msg, ctx, current, aliases); if (conv && !isFallbackId(conv.id)) aliases.add(conv.name, conv.id); }); if (current && isFallbackId(current.id)) { const id = aliases.lookup(current.name) || aliases.lookup(domCurrentName()); if (id) current = { ...current, id }; } const byStem = new Map(); const fresh = []; const out = (msg, ctx) => { const conv = toConv(msg, ctx, current, aliases); if (!conv) return; const payload = msg.payload; for (const k of stemsOfPayload(payload)) { if (byStem.has(k)) continue; byStem.set(k, conv); fresh.push([k, conv]); } }; walkAll({ id: current ? current.id : "", name: current ? current.name : "", sender: null }, out); const fromPage = byStem.size; for (const [k, v] of loadStoredConv(bucket, aliases)) { if (!byStem.has(k)) byStem.set(k, v); } if (byStem.size) { addLog( "[图片嗅探] 会话归属:本次从页面读到 " + fromPage + " 个文件名(含历史记录共 " + byStem.size + " 个;会话别名 " + aliases.size + " 条;" + (current ? "当前会话「" + current.name + "」" : "当前会话未识别") + ")", "info" ); } return { current, byStem, fresh, aliases }; } function persistConvContext(ctx) { if (!ctx.fresh.length && !ctx.aliases.size) return; saveStoredConv(ctx.fresh, ctx.aliases); } function convOfItem(it, ctx) { if (!ctx || !it.stem) return null; return ctx.byStem.get(it.stem) || null; } function timeOfItem(it, ctx) { const conv = convOfItem(it, ctx); return conv ? conv.time : null; } function convKey(conv, aliases) { if (!conv) return UNNAMED_CONV_ID; if (isFallbackId(conv.id) && aliases) { const id = aliases.lookup(conv.name) || aliases.lookup(fallbackName(conv.id)); if (id) return id; } return conv.id; } function groupByConversation(items, ctx, minBytes) { const buckets = new Map(); const aliases = ctx ? ctx.aliases : null; const curKey = ctx && ctx.current ? convKey(ctx.current, aliases) : ""; const bucketOf = (conv) => { const id = convKey(conv, aliases); let b = buckets.get(id); if (!b) { b = { name: conv ? conv.name : "", current: !!(conv && curKey && id === curKey), time: conv ? conv.time : null, known: [], unknown: [] }; buckets.set(id, b); } if (conv && conv.name && !b.name) b.name = conv.name; if (conv && conv.time !== null && (b.time === null || conv.time > b.time)) b.time = conv.time; return b; }; for (const it of items) { const b = bucketOf(convOfItem(it, ctx)); if (it.size === null) b.unknown.push(it); else if (it.size >= minBytes) b.known.push(it); } const bySizeDesc = (a, b) => (b.size === null ? 0 : b.size) - (a.size === null ? 0 : a.size); const byTimeDesc = (a, b) => { const ca = convOfItem(a, ctx); const cb = convOfItem(b, ctx); const va = ca ? ca.time : null; const vb = cb ? cb.time : null; if (va !== vb) { if (va === null) return 1; if (vb === null) return -1; return vb - va; } return bySizeDesc(a, b); }; const list = []; for (const [id, bucket] of buckets) { bucket.known.sort(byTimeDesc); bucket.unknown.sort(byTimeDesc); list.push({ id, time: bucket.time, current: bucket.current, bucket }); } list.sort((a, b) => { if (a.current !== b.current) return a.current ? -1 : 1; const au = a.id === UNNAMED_CONV_ID ? 1 : 0; const bu = b.id === UNNAMED_CONV_ID ? 1 : 0; if (au !== bu) return au - bu; return (b.time || 0) - (a.time || 0); }); const sections = list.map((x) => ({ id: x.id, name: x.bucket.name, current: x.current, known: x.bucket.known, unknown: x.bucket.unknown })); return { sections, grouped: sections.some((s) => !!s.name) }; } const theme$5 = { "slots": { "root": "relative flex items-start", "container": "flex items-center", "base": "rounded-sm ring ring-inset ring-accented overflow-hidden focus-visible:outline-none", "indicator": "flex items-center justify-center size-full text-inverted", "icon": "shrink-0", "wrapper": "w-full", "label": "block font-medium text-default", "description": "text-muted" }, "variants": { "color": { "primary": { "indicator": "bg-primary" }, "success": { "indicator": "bg-success" }, "info": { "indicator": "bg-info" }, "warning": { "indicator": "bg-warning" }, "error": { "indicator": "bg-error" }, "neutral": { "indicator": "bg-inverted" } }, "variant": { "list": { "root": "" }, "card": { "root": [ "border border-default rounded-lg hover:not-has-disabled:not-has-aria-disabled:not-has-focus-visible:not-has-data-[state=checked]:bg-elevated/50", "transition-colors" ] } }, "indicator": { "start": { "root": "flex-row", "wrapper": "ms-2" }, "end": { "root": "flex-row-reverse", "wrapper": "me-2" }, "hidden": { "base": "sr-only", "wrapper": "flex flex-col items-center gap-1 text-center" } }, "size": { "xs": { "base": "size-3", "icon": "size-2.5", "container": "h-4", "wrapper": "text-xs" }, "sm": { "base": "size-3.5", "icon": "size-3", "container": "h-4", "wrapper": "text-xs" }, "md": { "base": "size-4", "icon": "size-3.5", "container": "h-5", "wrapper": "text-sm" }, "lg": { "base": "size-4.5", "icon": "size-4", "container": "h-5", "wrapper": "text-sm" }, "xl": { "base": "size-5", "icon": "size-4.5", "container": "h-6", "wrapper": "text-base" } }, "required": { "true": { "label": "after:content-['*'] after:ms-0.5 after:text-error" } }, "disabled": { "true": { "root": "opacity-75", "base": "cursor-not-allowed", "label": "cursor-not-allowed", "description": "cursor-not-allowed" } }, "highlight": { "true": "", "false": "" }, "checked": { "true": "" } }, "compoundVariants": [ { "indicator": "hidden", "class": { "container": "h-auto" } }, { "variant": "card", "highlight": false, "class": { "root": "hover:not-has-disabled:not-has-aria-disabled:not-has-focus-visible:not-has-data-[state=checked]:border-accented" } }, { "size": "xs", "indicator": "hidden", "class": { "icon": "size-3" } }, { "size": "sm", "indicator": "hidden", "class": { "icon": "size-3.5" } }, { "size": "md", "indicator": "hidden", "class": { "icon": "size-4" } }, { "size": "lg", "indicator": "hidden", "class": { "icon": "size-4.5" } }, { "size": "xl", "indicator": "hidden", "class": { "icon": "size-5" } }, { "size": "xs", "variant": "card", "class": { "root": "p-2.5" } }, { "size": "sm", "variant": "card", "class": { "root": "p-3" } }, { "size": "md", "variant": "card", "class": { "root": "p-3.5" } }, { "size": "lg", "variant": "card", "class": { "root": "p-4" } }, { "size": "xl", "variant": "card", "class": { "root": "p-4.5" } }, { "color": "primary", "variant": "list", "indicator": [ "start", "end" ], "class": { "base": "outline-primary/25 focus-visible:outline-solid focus-visible:outline-3 focus-visible:ring-primary" } }, { "color": "success", "variant": "list", "indicator": [ "start", "end" ], "class": { "base": "outline-success/25 focus-visible:outline-solid focus-visible:outline-3 focus-visible:ring-success" } }, { "color": "info", "variant": "list", "indicator": [ "start", "end" ], "class": { "base": "outline-info/25 focus-visible:outline-solid focus-visible:outline-3 focus-visible:ring-info" } }, { "color": "warning", "variant": "list", "indicator": [ "start", "end" ], "class": { "base": "outline-warning/25 focus-visible:outline-solid focus-visible:outline-3 focus-visible:ring-warning" } }, { "color": "error", "variant": "list", "indicator": [ "start", "end" ], "class": { "base": "outline-error/25 focus-visible:outline-solid focus-visible:outline-3 focus-visible:ring-error" } }, { "color": "neutral", "variant": "list", "indicator": [ "start", "end" ], "class": { "base": "outline-inverted/25 focus-visible:outline-solid focus-visible:outline-3 focus-visible:ring-inverted" } }, { "color": "primary", "variant": "card", "class": { "root": "outline-primary/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-primary has-focus-visible:z-[1]" } }, { "color": "success", "variant": "card", "class": { "root": "outline-success/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-success has-focus-visible:z-[1]" } }, { "color": "info", "variant": "card", "class": { "root": "outline-info/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-info has-focus-visible:z-[1]" } }, { "color": "warning", "variant": "card", "class": { "root": "outline-warning/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-warning has-focus-visible:z-[1]" } }, { "color": "error", "variant": "card", "class": { "root": "outline-error/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-error has-focus-visible:z-[1]" } }, { "color": "neutral", "variant": "card", "class": { "root": "outline-inverted/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-inverted has-focus-visible:z-[1]" } }, { "color": "primary", "variant": "list", "indicator": "hidden", "class": { "root": "outline-primary/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-primary has-focus-visible:z-[1]" } }, { "color": "success", "variant": "list", "indicator": "hidden", "class": { "root": "outline-success/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-success has-focus-visible:z-[1]" } }, { "color": "info", "variant": "list", "indicator": "hidden", "class": { "root": "outline-info/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-info has-focus-visible:z-[1]" } }, { "color": "warning", "variant": "list", "indicator": "hidden", "class": { "root": "outline-warning/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-warning has-focus-visible:z-[1]" } }, { "color": "error", "variant": "list", "indicator": "hidden", "class": { "root": "outline-error/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-error has-focus-visible:z-[1]" } }, { "color": "neutral", "variant": "list", "indicator": "hidden", "class": { "root": "outline-inverted/25 has-focus-visible:outline-3 not-has-disabled:has-focus-visible:border-inverted has-focus-visible:z-[1]" } }, { "color": "primary", "variant": "card", "class": { "root": "has-data-[state=checked]:border-primary/50 has-data-[state=checked]:bg-primary/10" } }, { "color": "success", "variant": "card", "class": { "root": "has-data-[state=checked]:border-success/50 has-data-[state=checked]:bg-success/10" } }, { "color": "info", "variant": "card", "class": { "root": "has-data-[state=checked]:border-info/50 has-data-[state=checked]:bg-info/10" } }, { "color": "warning", "variant": "card", "class": { "root": "has-data-[state=checked]:border-warning/50 has-data-[state=checked]:bg-warning/10" } }, { "color": "error", "variant": "card", "class": { "root": "has-data-[state=checked]:border-error/50 has-data-[state=checked]:bg-error/10" } }, { "color": "neutral", "variant": "card", "class": { "root": "has-data-[state=checked]:border-inverted/50 has-data-[state=checked]:bg-elevated" } }, { "variant": "card", "disabled": true, "class": { "root": "cursor-not-allowed" } }, { "color": "primary", "indicator": "hidden", "highlight": true, "class": { "root": "not-has-disabled:not-has-aria-disabled:border-primary not-has-disabled:not-has-aria-disabled:has-data-[state=checked]:border-primary" } }, { "color": "success", "indicator": "hidden", "highlight": true, "class": { "root": "not-has-disabled:not-has-aria-disabled:border-success not-has-disabled:not-has-aria-disabled:has-data-[state=checked]:border-success" } }, { "color": "info", "indicator": "hidden", "highlight": true, "class": { "root": "not-has-disabled:not-has-aria-disabled:border-info not-has-disabled:not-has-aria-disabled:has-data-[state=checked]:border-info" } }, { "color": "warning", "indicator": "hidden", "highlight": true, "class": { "root": "not-has-disabled:not-has-aria-disabled:border-warning not-has-disabled:not-has-aria-disabled:has-data-[state=checked]:border-warning" } }, { "color": "error", "indicator": "hidden", "highlight": true, "class": { "root": "not-has-disabled:not-has-aria-disabled:border-error not-has-disabled:not-has-aria-disabled:has-data-[state=checked]:border-error" } }, { "color": "neutral", "indicator": "hidden", "highlight": true, "class": { "root": "not-has-disabled:not-has-aria-disabled:border-inverted not-has-disabled:not-has-aria-disabled:has-data-[state=checked]:border-inverted" } }, { "color": "primary", "highlight": true, "class": { "base": "ring-primary" } }, { "color": "success", "highlight": true, "class": { "base": "ring-success" } }, { "color": "info", "highlight": true, "class": { "base": "ring-info" } }, { "color": "warning", "highlight": true, "class": { "base": "ring-warning" } }, { "color": "error", "highlight": true, "class": { "base": "ring-error" } }, { "color": "neutral", "highlight": true, "class": { "base": "ring-inverted" } } ], "defaultVariants": { "highlight": false, "size": "md", "color": "primary", "variant": "list", "indicator": "start" } }; const _sfc_main$k = Object.assign({ inheritAttrs: false }, { __name: "Checkbox", props: { as: { type: null, required: false }, label: { type: String, required: false }, description: { type: String, required: false }, color: { type: null, required: false }, variant: { type: null, required: false }, size: { type: null, required: false }, indicator: { type: null, required: false }, highlight: { type: Boolean, required: false }, icon: { type: null, required: false }, indeterminateIcon: { type: null, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, disabled: { type: Boolean, required: false }, required: { type: Boolean, required: false }, name: { type: String, required: false }, value: { type: null, required: false }, id: { type: String, required: false }, defaultValue: { type: null, required: false }, modelValue: { type: null, required: false }, trueValue: { type: null, required: false }, falseValue: { type: null, required: false } }, emits: ["change", "update:modelValue"], setup(__props, { emit: __emit }) { var _a2; const _props = __props; const slots = vue.useSlots(); const emits = __emit; const props = useComponentProps("checkbox", _props); const appConfig2 = useAppConfig(); const rootProps = useForwardProps(reactivePick(props, "required", "value", "defaultValue", "modelValue", "trueValue", "falseValue"), emits); const { id: _id, emitFormChange, emitFormInput, size: formFieldSize, color: formFieldColor, highlight: formFieldHighlight, name, disabled: formFieldDisabled, ariaAttrs } = useFormField(_props); const id = (_a2 = _id.value) != null ? _a2 : vue.useId(); const color = vue.computed(() => { var _a3; return (_a3 = formFieldColor.value) != null ? _a3 : props.color; }); const highlight = vue.computed(() => { var _a3; return (_a3 = formFieldHighlight.value) != null ? _a3 : props.highlight; }); const size2 = vue.computed(() => { var _a3; return (_a3 = formFieldSize.value) != null ? _a3 : props.size; }); const disabled = vue.computed(() => { var _a3; return (_a3 = formFieldDisabled.value) != null ? _a3 : props.disabled; }); const checkboxGroupContext = injectCheckboxGroupRootContext(null); const maxReached = vue.computed(() => { var _a3; const max2 = checkboxGroupContext == null ? void 0 : checkboxGroupContext.max.value; if (!checkboxGroupContext || max2 === null || max2 === void 0) { return false; } const values = (_a3 = checkboxGroupContext.modelValue.value) != null ? _a3 : []; const checkboxValue = props.value === void 0 ? "on" : props.value; return values.length >= max2 && !values.some((value) => isEqual$1(value, checkboxValue)); }); const labelIcon = vue.computed(() => props.indicator === "hidden" ? props.icon : void 0); const attrs = vue.useAttrs(); const forwardedAttrs = vue.computed(() => { const { "data-state": _2, ...rest } = attrs; return rest; }); const ui2 = vue.computed(() => { var _a3; return tv({ extend: theme$5, ...((_a3 = appConfig2.ui) == null ? void 0 : _a3.checkbox) || {} })({ size: size2.value, color: color.value, variant: props.variant, indicator: props.indicator, highlight: highlight.value, required: props.required, disabled: disabled.value || maxReached.value }); }); function onUpdate(value) { const event = new Event("change", { target: { value } }); emits("change", event); emitFormChange(); emitFormInput(); } return (_ctx, _cache) => { var _a3, _b; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: !vue.unref(props).variant || vue.unref(props).variant === "list" ? vue.unref(props).as : vue.unref(Label_default), "data-slot": (_a3 = _ctx.$attrs["data-slot"]) != null ? _a3 : "root", class: vue.normalizeClass(ui2.value.root({ class: [(_b = vue.unref(props).ui) == null ? void 0 : _b.root, vue.unref(props).class] })) }, { default: vue.withCtx(() => { var _a4, _b2, _c, _d, _e2, _f; return [ vue.createElementVNode("div", { "data-slot": "container", class: vue.normalizeClass(ui2.value.container({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.container })) }, [ vue.createVNode(vue.unref(CheckboxRoot_default), vue.mergeProps({ id: vue.unref(id) }, { ...vue.unref(rootProps), ...forwardedAttrs.value, ...vue.unref(ariaAttrs) }, { name: vue.unref(name), disabled: disabled.value, "data-slot": "base", class: ui2.value.base({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.base }), "onUpdate:modelValue": onUpdate }), { default: vue.withCtx(({ state: state2 }) => { var _a5; return [ vue.unref(props).indicator !== "hidden" ? (vue.openBlock(), vue.createBlock(vue.unref(CheckboxIndicator_default), { key: 0, "data-slot": "indicator", class: vue.normalizeClass(ui2.value.indicator({ class: (_a5 = vue.unref(props).ui) == null ? void 0 : _a5.indicator })) }, { default: vue.withCtx(() => { var _a6, _b3; return [ state2 === "indeterminate" ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(props).indeterminateIcon || vue.unref(appConfig2).ui.icons.minus, "data-slot": "icon", class: vue.normalizeClass(ui2.value.icon({ class: (_a6 = vue.unref(props).ui) == null ? void 0 : _a6.icon })) }, null, 8, ["name", "class"])) : (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 1, name: vue.unref(props).icon || vue.unref(appConfig2).ui.icons.check, "data-slot": "icon", class: vue.normalizeClass(ui2.value.icon({ class: (_b3 = vue.unref(props).ui) == null ? void 0 : _b3.icon })) }, null, 8, ["name", "class"])) ]; }), _: 2 }, 1032, ["class"])) : vue.createCommentVNode("", true) ]; }), _: 1 }, 16, ["id", "name", "disabled", "class"]) ], 2), labelIcon.value || (vue.unref(props).label || !!slots.label) || (vue.unref(props).description || !!slots.description) ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "wrapper", class: vue.normalizeClass(ui2.value.wrapper({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.wrapper })) }, [ labelIcon.value ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: labelIcon.value, "data-slot": "icon", class: vue.normalizeClass(ui2.value.icon({ class: (_d = vue.unref(props).ui) == null ? void 0 : _d.icon })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true), vue.unref(props).label || !!slots.label ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(!vue.unref(props).variant || vue.unref(props).variant === "list" ? vue.unref(Label_default) : "p"), { key: 1, for: vue.unref(id), "data-slot": "label", class: vue.normalizeClass(ui2.value.label({ class: (_e2 = vue.unref(props).ui) == null ? void 0 : _e2.label })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "label", { label: vue.unref(props).label }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).label), 1) ]) ]), _: 3 }, 8, ["for", "class"])) : vue.createCommentVNode("", true), vue.unref(props).description || !!slots.description ? (vue.openBlock(), vue.createElementBlock("p", { key: 2, "data-slot": "description", class: vue.normalizeClass(ui2.value.description({ class: (_f = vue.unref(props).ui) == null ? void 0 : _f.description })) }, [ vue.renderSlot(_ctx.$slots, "description", { description: vue.unref(props).description }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).description), 1) ]) ], 2)) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true) ]; }), _: 3 }, 8, ["as", "data-slot", "class"]); }; } }); const _hoisted_1$c = { class: "group relative w-full min-w-0" }; const _hoisted_2$a = { class: "pointer-events-none absolute bottom-1.5 right-1.5 z-[2] flex gap-0.5 rounded-md bg-inverted p-0.5 opacity-0 transition-opacity group-hover:pointer-events-auto group-hover:opacity-100" }; const _sfc_main$j = vue.defineComponent({ __name: "ImageActions", props: { actions: {} }, setup(__props) { return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [ vue.renderSlot(_ctx.$slots, "default"), vue.createElementVNode("div", _hoisted_2$a, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.actions, (a) => { return vue.openBlock(), vue.createBlock(_sfc_main$G, { key: a.label, icon: a.icon, size: "md", color: a.danger ? "error" : "primary", variant: "ghost", "aria-label": a.label, title: a.tooltip || a.label, disabled: a.loading, class: "text-inverted", onClick: vue.withModifiers(($event) => a.onClick(), ["stop"]) }, null, 8, ["icon", "color", "aria-label", "title", "disabled", "onClick"]); }), 128)) ]) ]); }; } }); const _hoisted_1$b = ["data-state"]; const _hoisted_2$9 = { class: "flex shrink-0 items-center px-4 py-3 text-[13px] text-white/80" }; const _hoisted_3$8 = { class: "min-w-0 flex-1 truncate" }; const _hoisted_4$8 = { key: 0, class: "shrink-0 px-2 text-white/55" }; const _hoisted_5$8 = ["src", "alt"]; const _sfc_main$i = vue.defineComponent({ __name: "ImagePreview", props: { open: { type: Boolean }, items: {}, index: { default: 0 }, names: { default: () => [] } }, emits: ["update:open"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; const current = vue.ref(0); const scale = vue.ref(1); const rotate = vue.ref(0); const total = vue.computed(() => props.items.length); const src = vue.computed(() => props.items[current.value] || ""); const title = vue.computed(() => { var _a2; return ((_a2 = props.names) == null ? void 0 : _a2[current.value]) || "图片"; }); function reset() { scale.value = 1; rotate.value = 0; } function go(step) { if (total.value < 2) return; current.value = (current.value + step + total.value) % total.value; reset(); } function onKey(e) { if (!props.open) return; if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); emit2("update:open", false); return; } if (e.key === "ArrowLeft") go(-1); if (e.key === "ArrowRight") go(1); } function onPointerDown(e) { if (!props.open) return; const path = e.composedPath(); const inPreview = path.some((n) => n instanceof Element && n.closest && n.closest('[data-znhd="image-preview"]')); if (inPreview) e.stopPropagation(); } vue.watch( () => props.open, (open) => { if (open) { current.value = Math.min(Math.max(0, props.index || 0), Math.max(0, total.value - 1)); reset(); window.addEventListener("keydown", onKey, true); window.addEventListener("pointerdown", onPointerDown, true); } else { window.removeEventListener("keydown", onKey, true); window.removeEventListener("pointerdown", onPointerDown, true); } } ); vue.onBeforeUnmount(() => { window.removeEventListener("keydown", onKey, true); window.removeEventListener("pointerdown", onPointerDown, true); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(_sfc_main$w, { open: props.open, title: title.value, fullscreen: "", transition: false, overlay: false, "unmount-on-hide": false, "onUpdate:open": _cache[10] || (_cache[10] = ($event) => emit2("update:open", $event)) }, { content: vue.withCtx(() => [ vue.createElementVNode("div", { "data-znhd": "image-preview", "data-state": props.open ? "open" : "closed", class: "fixed inset-0 flex flex-col bg-black/80" }, [ vue.createElementVNode("div", _hoisted_2$9, [ vue.createElementVNode("span", _hoisted_3$8, vue.toDisplayString(title.value), 1), total.value > 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$8, vue.toDisplayString(current.value + 1) + " / " + vue.toDisplayString(total.value), 1)) : vue.createCommentVNode("", true), vue.createElementVNode("button", { type: "button", "aria-label": "关闭预览", title: "关闭(Esc)", class: "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-white/70 outline-none hover:bg-white/10 hover:text-white", onClick: _cache[0] || (_cache[0] = ($event) => emit2("update:open", false)) }, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-x", size: 17 }) ]) ]), vue.createElementVNode("div", { class: "relative flex min-h-0 flex-1 items-center justify-center px-12", onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => emit2("update:open", false), ["self"])) }, [ total.value > 1 ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, type: "button", "aria-label": "上一张", class: "absolute left-3 inline-flex size-9 cursor-pointer items-center justify-center rounded-md border-0 bg-white/10 text-white/80 outline-none hover:bg-white/20 hover:text-white", onClick: _cache[1] || (_cache[1] = ($event) => go(-1)) }, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-chevron-left", size: 20 }) ])) : vue.createCommentVNode("", true), vue.createElementVNode("img", { src: src.value, alt: title.value, draggable: "false", class: "max-h-full max-w-full select-none object-contain", style: vue.normalizeStyle({ transform: `scale(${scale.value}) rotate(${rotate.value}deg)`, transition: "transform 120ms ease-out", cursor: scale.value > 1 ? "zoom-out" : "zoom-in" }), onClick: _cache[2] || (_cache[2] = ($event) => scale.value = scale.value > 1 ? 1 : 1.8) }, null, 12, _hoisted_5$8), total.value > 1 ? (vue.openBlock(), vue.createElementBlock("button", { key: 1, type: "button", "aria-label": "下一张", class: "absolute right-3 inline-flex size-9 cursor-pointer items-center justify-center rounded-md border-0 bg-white/10 text-white/80 outline-none hover:bg-white/20 hover:text-white", onClick: _cache[3] || (_cache[3] = ($event) => go(1)) }, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-chevron-right", size: 20 }) ])) : vue.createCommentVNode("", true) ]), vue.createElementVNode("div", { class: "flex shrink-0 items-center justify-center gap-1 py-3", onClick: _cache[9] || (_cache[9] = vue.withModifiers(($event) => emit2("update:open", false), ["self"])) }, [ vue.createElementVNode("button", { type: "button", "aria-label": "缩小", title: "缩小", class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-white/70 outline-none hover:bg-white/10 hover:text-white", onClick: _cache[5] || (_cache[5] = ($event) => scale.value = Math.max(0.4, +(scale.value - 0.2).toFixed(2))) }, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-zoom-out", size: 16 }) ]), vue.createElementVNode("button", { type: "button", "aria-label": "放大", title: "放大", class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-white/70 outline-none hover:bg-white/10 hover:text-white", onClick: _cache[6] || (_cache[6] = ($event) => scale.value = Math.min(4, +(scale.value + 0.2).toFixed(2))) }, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-zoom-in", size: 16 }) ]), vue.createElementVNode("button", { type: "button", "aria-label": "旋转", title: "旋转 90°", class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-white/70 outline-none hover:bg-white/10 hover:text-white", onClick: _cache[7] || (_cache[7] = ($event) => rotate.value = (rotate.value + 90) % 360) }, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-rotate-cw", size: 16 }) ]), vue.createElementVNode("button", { type: "button", "aria-label": "打印", title: "打印原图(A4 自适应)", class: "inline-flex size-8 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-white/70 outline-none hover:bg-white/10 hover:text-white", onClick: _cache[8] || (_cache[8] = ($event) => vue.unref(printA4Image)(src.value, title.value)) }, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-printer", size: 16 }) ]) ]) ], 8, _hoisted_1$b) ]), _: 1 }, 8, ["open", "title"]); }; } }); const _hoisted_1$a = { class: "shrink-0" }; const _hoisted_2$8 = ["data-sniff-excluded"]; const _hoisted_3$7 = { class: "text-xs text-muted" }; const _hoisted_4$7 = { class: "ml-1 flex cursor-pointer items-center gap-1.5 text-xs" }; const _hoisted_5$7 = { key: 0, class: "mb-2 text-xs text-error" }; const _hoisted_6$6 = { key: 1, class: "mb-2 text-xs text-muted" }; const _hoisted_7$6 = { key: 2, class: "flex h-[58vh] flex-col items-center justify-center" }; const _hoisted_8$6 = { class: "mt-2 text-xs text-muted" }; const _hoisted_9$6 = { key: 4, class: "h-[58vh] overflow-auto pr-1" }; const _hoisted_10$4 = ["data-sniff-group", "data-sniff-group-name", "data-sniff-group-current"]; const _hoisted_11$3 = { key: 0, "data-sniff-group-header": "", class: "mb-1.5 flex flex-wrap items-center gap-2" }; const _hoisted_12$2 = { class: "text-xs font-semibold text-default" }; const _hoisted_13$2 = { key: 1, class: "grid grid-cols-5 gap-2" }; const _hoisted_14 = ["data-sniff-no-time"]; const _hoisted_15 = { class: "relative" }; const _hoisted_16 = ["src", "alt", "onClick"]; const _hoisted_17 = ["title"]; const _hoisted_18 = ["title"]; const _hoisted_19 = { key: 2, class: "mt-2 grid grid-cols-5 gap-2" }; const _hoisted_20 = ["data-sniff-no-time"]; const _hoisted_21 = { class: "relative" }; const _hoisted_22 = ["src", "alt", "onClick"]; const _hoisted_23 = ["title"]; const _hoisted_24 = ["title"]; const _hoisted_25 = { key: 3, class: "mt-1.5 flex flex-wrap items-center gap-1.5" }; const _hoisted_26 = { key: 0, class: "text-[11px] text-muted" }; const FLUSH_MS = 150; const MIN_MEASURE_MS = 400; const BATCH_GAP_MS = 400; const DEFAULT_MIN_KB = 20; const _sfc_main$h = vue.defineComponent({ __name: "SniffDialog", props: vue.mergeModels({ minKb: {} }, { "open": { type: Boolean, ...{ default: false } }, "openModifiers": {} }), emits: vue.mergeModels(["update:minKb"], ["update:open"]), setup(__props, { emit: __emit }) { const open = vue.useModel(__props, "open"); const props = __props; const emit2 = __emit; const SOURCE_LABEL = { dom: "页面元素", svg: "内联 SVG", css: "CSS 背景", perf: "资源表" }; const VIA_LABEL = { perf: "资源表读数", local: "本地计算", head: "HEAD 响应头", range: "Range 响应头", unknown: "未测到" }; const phase = vue.ref("done"); const probed = vue.ref([]); const total = vue.ref(0); const truncated = vue.ref(false); const excluded = vue.ref(0); const openUnknown = vue.ref( new Set()); const convCtx = vue.shallowRef(null); const selected = vue.ref( new Set()); const busyKey = vue.ref(null); const batch = vue.ref(null); const previewOpen = vue.ref(false); const previewIndex = vue.ref(0); let runId = 0; let buf = []; let timer2 = null; const minKBText = vue.ref(String(props.minKb || DEFAULT_MIN_KB)); vue.watch( () => props.minKb, (v) => minKBText.value = String(v || DEFAULT_MIN_KB) ); function commitMinKB() { const n = Math.round(Number(minKBText.value)); const next = Number.isFinite(n) && n > 0 ? n : DEFAULT_MIN_KB; minKBText.value = String(next); if (next !== props.minKb) emit2("update:minKb", next); } function flush() { if (timer2 !== null) { window.clearTimeout(timer2); timer2 = null; } if (!buf.length) return; probed.value = probed.value.concat(buf); buf = []; } function scheduleFlush() { if (timer2 !== null) return; timer2 = window.setTimeout(() => { timer2 = null; flush(); }, FLUSH_MS); } function startScan() { const id = ++runId; buf = []; probed.value = []; total.value = 0; truncated.value = false; excluded.value = 0; selected.value = new Set(); openUnknown.value = new Set(); busyKey.value = null; batch.value = null; phase.value = "measuring"; const ctx = buildConvContext(); persistConvContext(ctx); convCtx.value = ctx; addLog("[图片嗅探] 开始扫描当前页面的图片…", "info"); const res = collectCandidates({ excludeSelector: SNIFF_EXCLUDE_SELECTOR }); if (runId !== id) return; total.value = res.items.length; truncated.value = res.truncated; excluded.value = res.excluded; if (!res.items.length) { phase.value = "done"; addLog("[图片嗅探] 本页未发现图片(可先滚动页面让懒加载的图出现)", "info"); return; } addLog("[图片嗅探] 候选 " + res.items.length + " 张,正在测量大小…", "info"); const startedAt = Date.now(); void resolveSizes(res.items, { onItem: (it) => { if (runId !== id) return; buf.push(it); scheduleFlush(); }, shouldStop: () => runId !== id }).then(async () => { if (runId !== id) return; const rest = MIN_MEASURE_MS - (Date.now() - startedAt); if (rest > 0) await new Promise((r) => window.setTimeout(r, rest)); if (runId !== id) return; flush(); phase.value = "done"; addLog("[图片嗅探] 测量完成,共 " + res.items.length + " 张候选", "success"); }); } vue.watch(open, (v) => { if (!v) { runId++; if (timer2 !== null) { window.clearTimeout(timer2); timer2 = null; } buf = []; previewOpen.value = false; return; } startScan(); }); vue.onBeforeUnmount(() => { runId++; if (timer2 !== null) window.clearTimeout(timer2); }); const minBytes = vue.computed(() => { const kb = Number.isFinite(props.minKb) && props.minKb > 0 ? props.minKb : DEFAULT_MIN_KB; return kb * 1024; }); const kept = vue.computed(() => probed.value.filter((i) => !i.drop)); const sections = vue.computed( () => groupByConversation(kept.value, convCtx.value, minBytes.value).sections ); const groupedView = vue.computed(() => sections.value.some((s) => !!s.name)); const known = vue.computed(() => sections.value.flatMap((s) => s.known)); const unknown = vue.computed(() => sections.value.flatMap((s) => s.unknown)); const pickable = vue.computed(() => known.value.concat(unknown.value)); const droppedCount = vue.computed(() => probed.value.length - kept.value.length); const shown = vue.computed(() => { const out = []; for (const s of sections.value) { for (const it of s.known) out.push(it); if (openUnknown.value.has(s.id)) for (const it of s.unknown) out.push(it); } return out; }); const shownIndex = vue.computed(() => { const m = new Map(); shown.value.forEach((it, i) => m.set(it.key, i)); return m; }); const fileNameOf = (it) => { const at = shownIndex.value.get(it.key); return sniffFileName(it.url, it.mime, at === void 0 ? 0 : at); }; const allSelected = vue.computed( () => pickable.value.length > 0 && pickable.value.every((i) => selected.value.has(i.key)) ); function toggleOne(key) { const next = new Set(selected.value); if (next.has(key)) next.delete(key); else next.add(key); selected.value = next; } function toggleAll() { const all = pickable.value.every((i) => selected.value.has(i.key)); selected.value = all ? new Set() : new Set(pickable.value.map((i) => i.key)); } function toggleGroup(s) { const keys = s.known.concat(s.unknown).map((i) => i.key); if (!keys.length) return; const next = new Set(selected.value); const all = keys.every((k) => next.has(k)); for (const k of keys) { if (all) next.delete(k); else next.add(k); } selected.value = next; } function toggleUnknown(sectionId) { const next = new Set(openUnknown.value); if (next.has(sectionId)) next.delete(sectionId); else next.add(sectionId); openUnknown.value = next; } const selectedCount = vue.computed(() => pickable.value.filter((i) => selected.value.has(i.key)).length); function metaOf(it) { const conv = it.stem && convCtx.value ? convCtx.value.byStem.get(it.stem) : void 0; const sender = conv && conv.sender && conv.sender !== conv.name ? ";发送者:" + conv.sender : ""; return "来源:" + it.sources.map((s) => SOURCE_LABEL[s]).join(" / ") + ";大小来源:" + VIA_LABEL[it.sizeVia] + sender; } const noTimeOf = (it) => timeOfItem(it, convCtx.value) === null; function sizeText(it) { return formatBytes(it.size) + (it.width && it.height ? " · " + it.width + "×" + it.height : ""); } async function doDownloadOne(it) { const fname = fileNameOf(it); busyKey.value = it.key; try { const ok = await downloadImage(it.url, fname); addLog(ok ? "图片已下载: " + fname : "[图片嗅探] 下载失败: " + fname, ok ? "success" : "error"); } finally { busyKey.value = null; } } function printOne(it) { const fname = fileNameOf(it); addLog("打印图片: " + fname, "success"); printA4Image(it.url, fname); } function openPreview(it) { const at = shownIndex.value.get(it.key); previewIndex.value = at === void 0 ? 0 : at; previewOpen.value = true; } async function doDownloadSelected() { const list = pickable.value.filter((i) => selected.value.has(i.key)); if (!list.length) return; batch.value = { done: 0, total: list.length }; try { const items = list.map((it, i) => { const at = shownIndex.value.get(it.key); return { key: it.key, url: it.url, filename: sniffFileName(it.url, it.mime, at === void 0 ? i : at) }; }); const res = await downloadBatch(items, { gapMs: BATCH_GAP_MS, onProgress: (done) => batch.value = { done, total: list.length } }); const failNote = res.failed.length ? "(失败 " + res.failed.length + ":" + res.failed.slice(0, 3).map((f) => f.filename).join("、") + (res.failed.length > 3 ? " 等" : "") + ")" : ""; addLog( "[图片嗅探] 批量下载完成:" + res.ok + "/" + res.total + failNote, res.failed.length ? "error" : "success" ); } finally { batch.value = null; } } vue.computed( () => total.value > 0 ? Math.min(100, Math.round(probed.value.length / total.value * 100)) : 0 ); const groupTitle = (s) => (s.name || "未归属会话") + "(" + (s.known.length + s.unknown.length) + " 张)"; const explainUnknownId = vue.computed(() => { const s = sections.value.find((x) => x.unknown.length > 0); return s ? s.id : null; }); const previewUrls = vue.computed(() => shown.value.map((i) => i.url)); const previewNames = vue.computed(() => shown.value.map((i) => fileNameOf(i))); function actionsOf(it) { return [ { label: "下载", icon: "i-lucide-download", loading: busyKey.value === it.key, onClick: () => void doDownloadOne(it) }, { label: "打印", icon: "i-lucide-printer", onClick: () => printOne(it) } ]; } const emptyText = vue.computed(() => { if (phase.value === "measuring") return "正在测量大小…"; if (total.value) return "扫描到 " + total.value + " 个候选,但都被阈值或类型过滤掉了(可调低阈值再试)"; return "未在当前页面发现图片"; }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(_sfc_main$v, { open: open.value, "onUpdate:open": _cache[8] || (_cache[8] = ($event) => open.value = $event), width: 828, title: "图片嗅探" }, { title: vue.withCtx(() => [ vue.createElementVNode("span", _hoisted_1$a, "图片嗅探(共 " + vue.toDisplayString(pickable.value.length) + " 张)", 1), vue.createVNode(_sfc_main$G, { icon: "i-lucide-refresh-cw", size: "md", color: "primary", variant: "ghost", class: "shrink-0", "aria-label": "重新扫描", loading: phase.value === "measuring", "loading-icon": "i-lucide-loader", onClick: startScan }, null, 8, ["loading"]) ]), footer: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, { size: "sm", disabled: !selectedCount.value || !!batch.value, onClick: _cache[4] || (_cache[4] = ($event) => void doDownloadSelected()) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(batch.value ? "下载中 " + batch.value.done + "/" + batch.value.total : "下载所选(" + selectedCount.value + ")"), 1) ]), _: 1 }, 8, ["disabled"]), vue.createVNode(_sfc_main$G, { variant: "outline", color: "neutral", size: "sm", disabled: !selected.value.size || !!batch.value, onClick: _cache[5] || (_cache[5] = ($event) => selected.value = new Set()) }, { default: vue.withCtx(() => [..._cache[16] || (_cache[16] = [ vue.createTextVNode(" 清空选择 ", -1) ])]), _: 1 }, 8, ["disabled"]), vue.createVNode(_sfc_main$G, { color: "secondary", size: "sm", onClick: _cache[6] || (_cache[6] = ($event) => open.value = false) }, { default: vue.withCtx(() => [..._cache[17] || (_cache[17] = [ vue.createTextVNode("关闭", -1) ])]), _: 1 }) ]), default: vue.withCtx(() => [ vue.createElementVNode("div", { class: "mb-2 flex flex-wrap items-center gap-x-2 gap-y-1.5", "data-sniff-excluded": excluded.value }, [ _cache[10] || (_cache[10] = vue.createElementVNode("span", { class: "text-xs text-muted" }, "只列出 ≥", -1)), vue.createVNode(_sfc_main$E, { modelValue: minKBText.value, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => minKBText.value = $event), type: "number", min: 1, max: 10240, step: 10, size: "sm", class: "w-20", "aria-label": "最小体积 KB", onChange: commitMinKB, onBlur: commitMinKB }, null, 8, ["modelValue"]), _cache[11] || (_cache[11] = vue.createElementVNode("span", { class: "text-[11px] opacity-60" }, "KB", -1)), vue.createElementVNode("span", _hoisted_3$7, "的图片(显示 " + vue.toDisplayString(known.value.length) + " 张)", 1), vue.createElementVNode("label", _hoisted_4$7, [ vue.createVNode(_sfc_main$k, { size: "sm", "model-value": allSelected.value, disabled: !kept.value.length, "aria-label": "全选", "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toggleAll()) }, null, 8, ["model-value", "disabled"]), _cache[9] || (_cache[9] = vue.createTextVNode(" 全选 ", -1)) ]) ], 8, _hoisted_2$8), truncated.value ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_5$7, " 页面元素太多或图片超过 " + vue.toDisplayString(vue.unref(MAX_SNIFF)) + " 张,本次只扫描了前一部分 —— 结果可能不完整。 ", 1)) : vue.createCommentVNode("", true), droppedCount.value > 0 ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6$6, " 已排除 " + vue.toDisplayString(droppedCount.value) + " 个响应不是图片的地址(视频 / 网页 / JSON 等)。 ", 1)) : vue.createCommentVNode("", true), phase.value === "measuring" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$6, [ vue.createVNode(_sfc_main$t, { size: 30 }), vue.createElementVNode("p", _hoisted_8$6, vue.toDisplayString(total.value ? "正在测量大小…(" + probed.value.length + "/" + total.value + ")" : "正在扫描页面图片…"), 1) ])) : !kept.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$o, { key: 3, class: "h-[58vh]", size: "sm", title: "没有可显示的图片", description: emptyText.value, ui: { description: "text-xs text-muted" } }, { leading: vue.withCtx(() => [ vue.createVNode(_sfc_main$L, { name: "i-lucide-image", size: 20 }) ]), _: 1 }, 8, ["description"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$6, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sections.value, (s, si) => { return vue.openBlock(), vue.createElementBlock("div", { key: s.id || "__unnamed__", "data-sniff-group": s.id, "data-sniff-group-name": s.name, "data-sniff-group-current": s.current ? "1" : void 0, class: vue.normalizeClass(si === 0 ? "" : "mt-3") }, [ groupedView.value && (s.known.length || s.unknown.length) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$3, [ vue.createElementVNode("span", _hoisted_12$2, vue.toDisplayString(groupTitle(s)), 1), s.current ? (vue.openBlock(), vue.createBlock(_sfc_main$C, { key: 0, color: "secondary", size: "sm" }, { default: vue.withCtx(() => [..._cache[12] || (_cache[12] = [ vue.createTextVNode("当前会话", -1) ])]), _: 1 })) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$G, { variant: "link", color: "primary", size: "sm", class: "h-auto px-0 text-[11px]", onClick: ($event) => toggleGroup(s) }, { default: vue.withCtx(() => [..._cache[13] || (_cache[13] = [ vue.createTextVNode(" 全选本组 ", -1) ])]), _: 1 }, 8, ["onClick"]) ])) : vue.createCommentVNode("", true), s.known.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$2, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(s.known, (it) => { return vue.openBlock(), vue.createElementBlock("div", { key: it.key, "data-sniff-card": "", "data-sniff-no-time": noTimeOf(it) ? "1" : void 0, class: "flex min-w-0 flex-col rounded-md border border-default bg-default p-1.5 transition-colors hover:border-accented" }, [ vue.createElementVNode("div", _hoisted_15, [ vue.createVNode(_sfc_main$j, { actions: actionsOf(it) }, { default: vue.withCtx(() => [ vue.createElementVNode("img", { src: it.url, alt: fileNameOf(it), draggable: "false", class: "aspect-square w-full cursor-zoom-in rounded-md object-cover", onClick: ($event) => openPreview(it) }, null, 8, _hoisted_16) ]), _: 2 }, 1032, ["actions"]), vue.createElementVNode("div", { class: "absolute left-1.5 top-1.5 z-[2]", onClick: _cache[2] || (_cache[2] = vue.withModifiers(() => { }, ["stop"])) }, [ vue.createVNode(_sfc_main$k, { size: "sm", "model-value": selected.value.has(it.key), "aria-label": "选择 " + fileNameOf(it), "onUpdate:modelValue": ($event) => toggleOne(it.key) }, null, 8, ["model-value", "aria-label", "onUpdate:modelValue"]) ]) ]), vue.createElementVNode("span", { "data-sniff-name": "", class: vue.normalizeClass(["mt-1 truncate text-[11.5px] font-medium leading-4", noTimeOf(it) ? "text-error" : "text-default"]), title: fileNameOf(it) }, vue.toDisplayString(fileNameOf(it)), 11, _hoisted_17), vue.createElementVNode("span", { class: "truncate text-[11px] leading-4 text-muted", title: metaOf(it) }, vue.toDisplayString(sizeText(it)), 9, _hoisted_18) ], 8, _hoisted_14); }), 128)) ])) : vue.createCommentVNode("", true), openUnknown.value.has(s.id) && s.unknown.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(s.unknown, (it) => { return vue.openBlock(), vue.createElementBlock("div", { key: it.key, "data-sniff-card": "", "data-sniff-no-time": noTimeOf(it) ? "1" : void 0, class: "flex min-w-0 flex-col rounded-md border border-default bg-default p-1.5 transition-colors hover:border-accented" }, [ vue.createElementVNode("div", _hoisted_21, [ vue.createVNode(_sfc_main$j, { actions: actionsOf(it) }, { default: vue.withCtx(() => [ vue.createElementVNode("img", { src: it.url, alt: fileNameOf(it), draggable: "false", class: "aspect-square w-full cursor-zoom-in rounded-md object-cover", onClick: ($event) => openPreview(it) }, null, 8, _hoisted_22) ]), _: 2 }, 1032, ["actions"]), vue.createElementVNode("div", { class: "absolute left-1.5 top-1.5 z-[2]", onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => { }, ["stop"])) }, [ vue.createVNode(_sfc_main$k, { size: "sm", "model-value": selected.value.has(it.key), "aria-label": "选择 " + fileNameOf(it), "onUpdate:modelValue": ($event) => toggleOne(it.key) }, null, 8, ["model-value", "aria-label", "onUpdate:modelValue"]) ]) ]), vue.createElementVNode("span", { "data-sniff-name": "", class: vue.normalizeClass(["mt-1 truncate text-[11.5px] font-medium leading-4", noTimeOf(it) ? "text-error" : "text-default"]), title: fileNameOf(it) }, vue.toDisplayString(fileNameOf(it)), 11, _hoisted_23), vue.createElementVNode("span", { class: "truncate text-[11px] leading-4 text-muted", title: metaOf(it) }, vue.toDisplayString(sizeText(it)), 9, _hoisted_24) ], 8, _hoisted_20); }), 128)) ])) : vue.createCommentVNode("", true), s.unknown.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_25, [ vue.createVNode(_sfc_main$G, { variant: "link", color: "primary", size: "sm", class: "h-auto px-0 text-[11px]", onClick: ($event) => toggleUnknown(s.id) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(openUnknown.value.has(s.id) ? "▾" : "▸") + " 大小未知(" + vue.toDisplayString(s.unknown.length) + ") ", 1) ]), _: 2 }, 1032, ["onClick"]), explainUnknownId.value === s.id ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_26, " 量不出字节数(跨域响应头被拒等),可能有大图,已保留 ")) : vue.createCommentVNode("", true) ])) : vue.createCommentVNode("", true) ], 10, _hoisted_10$4); }), 128)) ])), vue.createElementVNode("p", { class: vue.normalizeClass(["mt-2 text-xs leading-5 text-muted", kept.value.length ? "" : "invisible"]) }, [ _cache[14] || (_cache[14] = vue.createTextVNode(" 提示: ", -1)), groupedView.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createTextVNode("图片已按会话(纳税人)分组,组头可直接「全选本组」;") ], 64)) : vue.createCommentVNode("", true), _cache[15] || (_cache[15] = vue.createTextVNode(" 每个会话内按消息时间从新到旧排列(顶部最新、底部最旧),未取到时间的排在最后并标红; 单击缩略图可放大 / 多图切换,放大后工具栏上的「打印」按 A4 打印原图(横图自动旋转 90 度); 勾选后可批量下载。视频已在扫描阶段排除,动图(gif)按图片保留。 ", -1)) ], 2), vue.createVNode(_sfc_main$i, { open: previewOpen.value, "onUpdate:open": _cache[7] || (_cache[7] = ($event) => previewOpen.value = $event), items: previewUrls.value, index: previewIndex.value, names: previewNames.value }, null, 8, ["open", "items", "index", "names"]) ]), _: 1 }, 8, ["open"]); }; } }); const theme$4 = { "slots": { "root": "group/message relative w-full", "header": "flex mb-1.5", "container": "relative flex items-start", "body": "min-w-0", "leading": "inline-flex items-center justify-center min-h-6", "leadingIcon": "shrink-0", "leadingAvatar": "shrink-0", "leadingAvatarSize": "", "files": "flex items-center gap-1.5", "content": "relative text-pretty wrap-break-word *:first:mt-0 *:last:mb-0", "actions": [ "[@media(hover:hover)]:opacity-0 group-hover/message:opacity-100 absolute bottom-0 flex items-center", "transition-opacity ease-out" ] }, "variants": { "variant": { "solid": "", "outline": "", "soft": "", "subtle": "", "naked": "" }, "color": { "primary": "", "success": "", "info": "", "warning": "", "error": "", "neutral": "" }, "side": { "left": {}, "right": { "container": "justify-end ms-auto max-w-[75%]", "header": "justify-end", "actions": "right-0" } }, "leading": { "true": "" }, "actions": { "true": "" }, "compact": { "true": { "root": "scroll-mt-3", "container": "gap-1.5 pb-3", "content": "space-y-2", "leadingIcon": "size-5", "leadingAvatarSize": "2xs" }, "false": { "root": "scroll-mt-4 sm:scroll-mt-6", "container": "gap-3 pb-8", "content": "space-y-4", "leadingIcon": "size-8", "leadingAvatarSize": "md" } } }, "compoundVariants": [ { "compact": true, "actions": true, "class": { "container": "pb-8" } }, { "variant": [ "solid", "outline", "soft", "subtle" ], "compact": false, "class": { "content": "px-4 py-3 rounded-lg min-h-12", "leading": "mt-2" } }, { "variant": [ "solid", "outline", "soft", "subtle" ], "compact": true, "class": { "content": "px-2 py-1 rounded-lg min-h-8", "leading": "mt-1" } }, { "variant": "naked", "side": "left", "class": { "body": "w-full", "content": "w-full" } }, { "color": "primary", "variant": "solid", "class": { "content": "bg-primary text-inverted" } }, { "color": "success", "variant": "solid", "class": { "content": "bg-success text-inverted" } }, { "color": "info", "variant": "solid", "class": { "content": "bg-info text-inverted" } }, { "color": "warning", "variant": "solid", "class": { "content": "bg-warning text-inverted" } }, { "color": "error", "variant": "solid", "class": { "content": "bg-error text-inverted" } }, { "color": "primary", "variant": "outline", "class": { "content": "text-primary ring ring-primary/25" } }, { "color": "success", "variant": "outline", "class": { "content": "text-success ring ring-success/25" } }, { "color": "info", "variant": "outline", "class": { "content": "text-info ring ring-info/25" } }, { "color": "warning", "variant": "outline", "class": { "content": "text-warning ring ring-warning/25" } }, { "color": "error", "variant": "outline", "class": { "content": "text-error ring ring-error/25" } }, { "color": "primary", "variant": "soft", "class": { "content": "bg-primary/10 text-primary" } }, { "color": "success", "variant": "soft", "class": { "content": "bg-success/10 text-success" } }, { "color": "info", "variant": "soft", "class": { "content": "bg-info/10 text-info" } }, { "color": "warning", "variant": "soft", "class": { "content": "bg-warning/10 text-warning" } }, { "color": "error", "variant": "soft", "class": { "content": "bg-error/10 text-error" } }, { "color": "primary", "variant": "subtle", "class": { "content": "bg-primary/10 text-primary ring ring-primary/25" } }, { "color": "success", "variant": "subtle", "class": { "content": "bg-success/10 text-success ring ring-success/25" } }, { "color": "info", "variant": "subtle", "class": { "content": "bg-info/10 text-info ring ring-info/25" } }, { "color": "warning", "variant": "subtle", "class": { "content": "bg-warning/10 text-warning ring ring-warning/25" } }, { "color": "error", "variant": "subtle", "class": { "content": "bg-error/10 text-error ring ring-error/25" } }, { "color": "primary", "variant": "naked", "class": { "content": "text-primary" } }, { "color": "success", "variant": "naked", "class": { "content": "text-success" } }, { "color": "info", "variant": "naked", "class": { "content": "text-info" } }, { "color": "warning", "variant": "naked", "class": { "content": "text-warning" } }, { "color": "error", "variant": "naked", "class": { "content": "text-error" } }, { "color": "neutral", "variant": "solid", "class": { "content": "bg-inverted text-inverted" } }, { "color": "neutral", "variant": "outline", "class": { "content": "bg-default ring ring-default" } }, { "color": "neutral", "variant": "soft", "class": { "content": "bg-elevated/50" } }, { "color": "neutral", "variant": "subtle", "class": { "content": "bg-elevated/50 ring ring-default" } } ], "defaultVariants": { "side": "left", "variant": "naked", "color": "neutral" } }; const _sfc_main$g = { __name: "ChatMessage", props: { as: { type: null, required: false, default: "article" }, icon: { type: null, required: false }, avatar: { type: Object, required: false }, variant: { type: null, required: false }, color: { type: null, required: false }, side: { type: null, required: false }, actions: { type: Array, required: false }, compact: { type: Boolean, required: false }, content: { type: String, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, id: { type: String, required: true }, role: { type: String, required: true }, metadata: { type: null, required: false }, parts: { type: Array, required: true } }, setup(__props) { const _props = __props; const slots = vue.useSlots(); const props = useComponentProps("chatMessage", _props); const appConfig2 = useAppConfig(); const fileParts = vue.computed(() => { var _a2, _b; return (_b = (_a2 = props.parts) == null ? void 0 : _a2.filter((part) => part.type === "file")) != null ? _b : []; }); const textParts = vue.computed(() => { var _a2, _b; return (_b = (_a2 = props.parts) == null ? void 0 : _a2.filter((part) => part.type === "text")) != null ? _b : []; }); const messageProps = vue.computed(() => omit(props, ["as", "icon", "avatar", "variant", "color", "side", "actions", "compact", "class", "ui", "content"])); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$4, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.chatMessage) || {} })({ variant: props.variant, color: props.color, side: props.side, leading: !!props.icon || !!props.avatar || !!slots.leading, actions: !!props.actions || !!slots.actions, compact: props.compact }); }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: vue.unref(props).as, "data-role": vue.unref(props).role, "data-slot": "root", class: vue.normalizeClass(ui2.value.root({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.root, vue.unref(props).class] })) }, { default: vue.withCtx(() => { var _a3, _b, _c, _d; return [ !!slots.files && fileParts.value.length || !!slots.header ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "header", class: vue.normalizeClass(ui2.value.header({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.header })) }, [ vue.renderSlot(_ctx.$slots, "header", vue.normalizeProps(vue.guardReactiveProps({ ...messageProps.value })), () => { var _a4; return [ !!slots.files && fileParts.value.length ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "files", class: vue.normalizeClass(ui2.value.files({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.files })) }, [ vue.renderSlot(_ctx.$slots, "files", vue.normalizeProps(vue.guardReactiveProps({ ...messageProps.value, parts: fileParts.value }))) ], 2)) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true), vue.createElementVNode("div", { "data-slot": "container", class: vue.normalizeClass(ui2.value.container({ class: (_b = vue.unref(props).ui) == null ? void 0 : _b.container })) }, [ vue.unref(props).icon || vue.unref(props).avatar || !!slots.leading ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "leading", class: vue.normalizeClass(ui2.value.leading({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.leading })) }, [ vue.renderSlot(_ctx.$slots, "leading", vue.normalizeProps(vue.guardReactiveProps({ ...messageProps.value, avatar: vue.unref(props).avatar, ui: ui2.value })), () => { var _a4, _b2, _c2; return [ vue.unref(props).icon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: vue.unref(props).icon, "data-slot": "leadingIcon", class: vue.normalizeClass(ui2.value.leadingIcon({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.leadingIcon })) }, null, 8, ["name", "class"])) : vue.unref(props).avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 1, size: ((_b2 = vue.unref(props).ui) == null ? void 0 : _b2.leadingAvatarSize) || ui2.value.leadingAvatarSize() }, vue.unref(props).avatar, { "data-slot": "leadingAvatar", class: ui2.value.leadingAvatar({ class: (_c2 = vue.unref(props).ui) == null ? void 0 : _c2.leadingAvatar }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true), vue.unref(props).content || textParts.value.length || !!slots.content || vue.unref(props).actions || !!slots.actions || !!slots.body ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, "data-slot": "body", class: vue.normalizeClass(ui2.value.body({ class: (_d = vue.unref(props).ui) == null ? void 0 : _d.body })) }, [ vue.renderSlot(_ctx.$slots, "body", vue.normalizeProps(vue.guardReactiveProps({ ...messageProps.value })), () => { var _a4, _b2; return [ vue.unref(props).content || textParts.value.length || !!slots.content ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "content", class: vue.normalizeClass(ui2.value.content({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.content })) }, [ vue.renderSlot(_ctx.$slots, "content", vue.normalizeProps(vue.guardReactiveProps({ ...messageProps.value, content: vue.unref(props).content })), () => [ vue.unref(props).content ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).content), 1) ], 64)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(textParts.value, (part, index) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: `${vue.unref(props).id}-${part.type}-${index}` }, [ vue.createTextVNode(vue.toDisplayString(part.text), 1) ], 64); }), 128)) ]) ], 2)) : vue.createCommentVNode("", true), vue.unref(props).actions || !!slots.actions ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, "data-slot": "actions", class: vue.normalizeClass(ui2.value.actions({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.actions })) }, [ vue.renderSlot(_ctx.$slots, "actions", vue.normalizeProps(vue.guardReactiveProps({ ...messageProps.value, actions: vue.unref(props).actions })), () => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).actions, (action, index) => { return vue.openBlock(), vue.createBlock(_sfc_main$z, { key: index, text: action.label }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, vue.mergeProps({ size: "sm", color: "neutral", variant: "ghost", "aria-label": action.label }, { ref_for: true }, vue.unref(omit)(action, ["onClick"]), { label: void 0, onClick: ($event) => typeof action.onClick === "function" ? action.onClick($event, messageProps.value) : void 0 }), null, 16, ["aria-label", "onClick"]) ]), _: 2 }, 1032, ["text"]); }), 128)) ]) ], 2)) : vue.createCommentVNode("", true) ]; }) ], 2)) : vue.createCommentVNode("", true) ], 2) ]; }), _: 3 }, 8, ["as", "data-role", "class"]); }; } }; const theme$3 = { "slots": { "root": "w-full flex flex-col gap-1 flex-1 px-2.5 [&>article]:last-of-type:min-h-(--last-message-height)", "indicator": "h-6 flex items-center gap-1 py-3 *:size-2 *:rounded-full *:bg-elevated motion-safe:[&>*:nth-child(1)]:animate-[bounce_1s_infinite] motion-safe:[&>*:nth-child(2)]:animate-[bounce_1s_0.15s_infinite] motion-safe:[&>*:nth-child(3)]:animate-[bounce_1s_0.3s_infinite]", "viewport": "absolute inset-x-0 top-[86%] data-[state=open]:animate-[fade-in_200ms_var(--ease-out)] data-[state=closed]:animate-[fade-out_200ms_var(--ease-out)]", "autoScroll": "rounded-full absolute right-1/2 translate-x-1/2 bottom-0" }, "variants": { "compact": { "true": "", "false": "" } } }; const _hoisted_1$9 = ["data-status"]; const _hoisted_2$7 = ["data-state"]; const _sfc_main$f = { __name: "ChatMessages", props: { messages: { type: null, required: false }, status: { type: String, required: false }, shouldAutoScroll: { type: Boolean, required: false, default: false }, shouldScrollToBottom: { type: Boolean, required: false, default: true }, autoScroll: { type: [Boolean, Object], required: false, default: true }, autoScrollIcon: { type: null, required: false }, user: { type: Object, required: false }, assistant: { type: Object, required: false }, compact: { type: Boolean, required: false }, spacingOffset: { type: Number, required: false, default: 0 }, class: { type: null, required: false }, ui: { type: Object, required: false } }, setup(__props, { expose: __expose }) { const _props = __props; const slots = vue.useSlots(); const props = useComponentProps("chatMessages", _props); const getProxySlots = () => omit(slots, ["default", "indicator", "viewport"]); function showIndicator() { var _a2, _b; if (props.status === "submitted") return true; if (props.status !== "streaming") return false; const lastMessage = (_a2 = props.messages) == null ? void 0 : _a2[props.messages.length - 1]; return (lastMessage == null ? void 0 : lastMessage.role) === "assistant" && !((_b = lastMessage.parts) == null ? void 0 : _b.length); } const { t } = useLocale$1(); const appConfig2 = useAppConfig(); const userProps = vue.toRef(() => defu(props.user, { side: "right", variant: "soft" })); const assistantProps = vue.toRef(() => defu(props.assistant, { side: "left", variant: "naked" })); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$3, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.chatMessages) || {} })({ compact: props.compact }); }); const el = vue.ref(null); const parent = vue.ref(null); const messagesRefs = vue.ref( new Map()); const showAutoScroll = vue.ref(false); const lastMessageHeight = vue.ref(0); const lastMessageSubmitted = vue.ref(false); const lastScrollTop = vue.ref(0); const userScrolledUp = vue.ref(false); function registerMessageRef(id, element) { const elInstance = element == null ? void 0 : element.$el; if (elInstance) { messagesRefs.value.set(id, elInstance); } } function scrollToMessage(id) { const element = messagesRefs.value.get(id); if (element) { element.scrollIntoView({ behavior: "smooth", block: "start" }); } } function scrollToBottom(smooth = true) { if (!parent.value) { return; } if (smooth) { parent.value.scrollTo({ top: parent.value.scrollHeight, behavior: "smooth" }); } else { parent.value.scrollTop = parent.value.scrollHeight; } } watchThrottled([() => props.messages, () => props.status], ([_2, status]) => { var _a2; if (!((_a2 = props.messages) == null ? void 0 : _a2.length)) { showAutoScroll.value = false; userScrolledUp.value = false; lastScrollTop.value = 0; messagesRefs.value.clear(); return; } if (status !== "streaming") { return; } checkScrollPosition(); }, { deep: true, throttle: 50, leading: true }); vue.watch(() => props.status, (status) => { var _a2; if (status !== "submitted") { return; } const lastMessage = (_a2 = props.messages) == null ? void 0 : _a2[props.messages.length - 1]; if (!lastMessage || lastMessage.role !== "user") { return; } userScrolledUp.value = false; vue.nextTick(() => { lastMessageSubmitted.value = true; updateLastMessageHeight(); vue.nextTick(() => { scrollToMessage(lastMessage.id); }); }); }); function checkScrollPosition() { if (!parent.value) { return; } const scrollPosition = parent.value.scrollTop + parent.value.clientHeight; const scrollHeight = parent.value.scrollHeight; const threshold = 100; showAutoScroll.value = scrollHeight - scrollPosition >= threshold; if (parent.value.scrollTop < lastScrollTop.value) { userScrolledUp.value = true; } else if (scrollHeight - scrollPosition < threshold) { userScrolledUp.value = false; } lastScrollTop.value = parent.value.scrollTop; } function onAutoScrollClick() { userScrolledUp.value = false; scrollToBottom(); } function getScrollParent(node) { if (!node) { return document.documentElement; } const overflowRegex = /auto|scroll/; let current = node; while (current && current !== document.body && current !== document.documentElement) { const style = window.getComputedStyle(current); if (overflowRegex.test(style.overflowY)) { return current; } current = current.parentElement; } return document.documentElement; } function updateLastMessageHeight() { var _a2; if (!el.value || !parent.value || !((_a2 = props.messages) == null ? void 0 : _a2.length) || !lastMessageSubmitted.value) { return; } const { height: parentHeight } = useElementBounding(parent.value); const lastMessage = props.messages.findLast((m) => m.role === "user"); if (!lastMessage) { return; } const lastMessageEl = messagesRefs.value.get(lastMessage.id); if (!lastMessageEl) { return; } let spacingOffset = props.spacingOffset || 0; const elComputedStyle = window.getComputedStyle(el.value); const parentComputedStyle = window.getComputedStyle(parent.value); spacingOffset += Number.parseFloat(elComputedStyle.rowGap) || Number.parseFloat(elComputedStyle.gap) || 0; spacingOffset += Number.parseFloat(parentComputedStyle.paddingTop) || 0; spacingOffset += Number.parseFloat(parentComputedStyle.paddingBottom) || 0; lastMessageHeight.value = Math.max(parentHeight.value - lastMessageEl.offsetHeight - spacingOffset, 0); } vue.onMounted(() => { parent.value = getScrollParent(el.value); if (!parent.value) { return; } lastScrollTop.value = parent.value.scrollTop; if (props.shouldScrollToBottom) { scrollToBottom(false); setTimeout(() => { scrollToBottom(false); }, 100); } else { vue.nextTick(() => { checkScrollPosition(); }); } useEventListener$1(parent, "scroll", checkScrollPosition); useEventListener$1(window, "resize", () => vue.nextTick(updateLastMessageHeight)); if (el.value) { useMutationObserver$1(el, () => { if (props.shouldAutoScroll && props.status === "streaming" && !userScrolledUp.value) { scrollToBottom(false); } }, { childList: true, subtree: true }); } }); __expose({ registerMessageRef }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createElementBlock("div", { ref_key: "el", ref: el, "data-status": vue.unref(props).status, "data-slot": "root", class: vue.normalizeClass(ui2.value.root({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.root, vue.unref(props).class] })), style: vue.normalizeStyle({ "--last-message-height": `${lastMessageHeight.value}px` }) }, [ vue.renderSlot(_ctx.$slots, "default", { registerMessageRef }, () => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).messages, (message) => { var _a3; return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: message.id }, [ ((_a3 = message.parts) == null ? void 0 : _a3.length) ? (vue.openBlock(), vue.createBlock(_sfc_main$g, vue.mergeProps({ key: 0, ref_for: true }, { ...message.role === "user" ? userProps.value : assistantProps.value, ...message }, { ref_for: true, ref: (el2) => registerMessageRef(message.id, el2), compact: vue.unref(props).compact }), vue.createSlots({ _: 2 }, [ vue.renderList(getProxySlots(), (_2, name) => { return { name, fn: vue.withCtx((slotData) => [ vue.renderSlot(_ctx.$slots, name, vue.mergeProps({ ref_for: true }, { ...slotData, message })) ]) }; }) ]), 1040, ["compact"])) : vue.createCommentVNode("", true) ], 64); }), 128)) ]), showIndicator() ? (vue.openBlock(), vue.createBlock(_sfc_main$g, vue.mergeProps({ key: 0, id: "indicator", role: "assistant" }, { ...assistantProps.value, actions: void 0, parts: [] }, { compact: vue.unref(props).compact }), { content: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "indicator", { ui: ui2.value }, () => { var _a3; return [ vue.createElementVNode("div", { "data-slot": "indicator", class: vue.normalizeClass(ui2.value.indicator({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.indicator })) }, [..._cache[0] || (_cache[0] = [ vue.createElementVNode("span", null, null, -1), vue.createElementVNode("span", null, null, -1), vue.createElementVNode("span", null, null, -1) ])], 2) ]; }) ]), _: 3 }, 16, ["compact"])) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(Presence_default), { present: showAutoScroll.value }, { default: vue.withCtx(() => { var _a3; return [ vue.createElementVNode("div", { "data-state": showAutoScroll.value ? "open" : "closed", "data-slot": "viewport", class: vue.normalizeClass(ui2.value.viewport({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.viewport })) }, [ vue.renderSlot(_ctx.$slots, "viewport", { ui: ui2.value, onClick: onAutoScrollClick }, () => { var _a4; return [ vue.unref(props).autoScroll ? (vue.openBlock(), vue.createBlock(_sfc_main$G, vue.mergeProps({ key: 0, icon: vue.unref(props).autoScrollIcon || vue.unref(appConfig2).ui.icons.arrowDown, color: "neutral", variant: "outline", "aria-label": vue.unref(t)("chatMessages.autoScroll") }, typeof vue.unref(props).autoScroll === "object" ? vue.unref(props).autoScroll : {}, { "data-slot": "autoScroll", class: ui2.value.autoScroll({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.autoScroll }), onClick: onAutoScrollClick }), null, 16, ["icon", "aria-label", "class"])) : vue.createCommentVNode("", true) ]; }) ], 10, _hoisted_2$7) ]; }), _: 3 }, 8, ["present"]) ], 14, _hoisted_1$9); }; } }; const _sfc_main$e = { __name: "DropdownMenuContent", props: { items: { type: null, required: false }, portal: { type: [Boolean, String], required: false, skipCheck: true }, sub: { type: Boolean, required: false }, labelKey: { type: null, required: true }, descriptionKey: { type: null, required: true }, checkedIcon: { type: null, required: false }, loadingIcon: { type: null, required: false }, externalIcon: { type: [Boolean, String], required: false, skipCheck: true }, size: { type: null, required: false }, filter: { type: [Boolean, Object], required: false }, filterFields: { type: Array, required: false }, ignoreFilter: { type: Boolean, required: false }, searchTerm: { type: String, required: false }, class: { type: null, required: false }, ui: { type: Object, required: true }, uiOverride: { type: Object, required: false }, loop: { type: Boolean, required: false }, memoDependencies: { type: Array, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false } }, emits: ["update:searchTerm", "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"], setup(__props, { emit: __emit }) { const DropdownMenu = { Portal: DropdownMenuPortal_default, Content: DropdownMenuContent_default, Item: DropdownMenuItem_default, Group: DropdownMenuGroup_default, Separator: DropdownMenuSeparator_default, CheckboxItem: DropdownMenuCheckboxItem_default, ItemIndicator: DropdownMenuItemIndicator_default, Label: DropdownMenuLabel_default, Sub: DropdownMenuSub_default, SubContent: DropdownMenuSubContent_default, SubTrigger: DropdownMenuSubTrigger_default, Filter: DropdownMenuFilter_default }; const props = __props; const emits = __emit; const slots = vue.useSlots(); const { t, dir } = useLocale$1(); const appConfig2 = useAppConfig(); const { filterGroups } = useFilter(); const _searchTerm = vue.ref(""); const searchTerm = vue.computed({ get: () => { var _a2; return (_a2 = props.searchTerm) != null ? _a2 : _searchTerm.value; }, set: (value) => { _searchTerm.value = value; emits("update:searchTerm", value); } }); const inputProps = vue.toRef(() => defu(props.filter, { placeholder: t("dropdownMenu.search"), variant: "none" })); const portalProps = usePortal(vue.toRef(() => props.portal)); const contentProps = useForwardPropsEmits(reactiveOmit(props, "sub", "items", "portal", "labelKey", "descriptionKey", "checkedIcon", "loadingIcon", "externalIcon", "size", "filter", "filterFields", "ignoreFilter", "searchTerm", "class", "ui", "uiOverride"), emits); const getProxySlots = () => omit(slots, ["default"]); const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate(); const childrenIcon = vue.computed(() => dir.value === "rtl" ? appConfig2.ui.icons.chevronLeft : appConfig2.ui.icons.chevronRight); const groups = vue.computed(() => { var _a2; if (!((_a2 = props.items) == null ? void 0 : _a2.length)) return []; return isArrayOfArray(props.items) ? props.items : [props.items]; }); const isStructuralItem = (item) => !!item.type && ["label", "separator"].includes(item.type); const filteredGroups = vue.computed(() => { if (!props.filter || props.ignoreFilter || !searchTerm.value) { return groups.value; } const fields = Array.isArray(props.filterFields) && props.filterFields.length ? props.filterFields : [props.labelKey]; return filterGroups(groups.value, searchTerm.value, { fields, isStructural: isStructuralItem }); }); const hasFilteredItems = vue.computed(() => filteredGroups.value.some((group) => group.some((item) => !isStructuralItem(item)))); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.createVNode(vue.unref(DefineItemTemplate), null, { default: vue.withCtx(({ item, active, index }) => [ vue.renderSlot(_ctx.$slots, item.slot || "item", { item, index, ui: __props.ui }, () => { var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j; return [ vue.renderSlot(_ctx.$slots, item.slot ? `${item.slot}-leading` : "item-leading", { item, active, index, ui: __props.ui }, () => { var _a3, _b2, _c2, _d2, _e3, _f2, _g2, _h2; return [ item.loading ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: __props.loadingIcon || vue.unref(appConfig2).ui.icons.loading, "data-slot": "itemLeadingIcon", class: vue.normalizeClass(__props.ui.itemLeadingIcon({ class: [(_a3 = __props.uiOverride) == null ? void 0 : _a3.itemLeadingIcon, (_b2 = item.ui) == null ? void 0 : _b2.itemLeadingIcon], color: item == null ? void 0 : item.color, loading: true })) }, null, 8, ["name", "class"])) : item.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 1, name: item.icon, "data-slot": "itemLeadingIcon", class: vue.normalizeClass(__props.ui.itemLeadingIcon({ class: [(_c2 = __props.uiOverride) == null ? void 0 : _c2.itemLeadingIcon, (_d2 = item.ui) == null ? void 0 : _d2.itemLeadingIcon], color: item == null ? void 0 : item.color, active })) }, null, 8, ["name", "class"])) : item.avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 2, size: ((_e3 = item.ui) == null ? void 0 : _e3.itemLeadingAvatarSize) || ((_f2 = __props.uiOverride) == null ? void 0 : _f2.itemLeadingAvatarSize) || __props.ui.itemLeadingAvatarSize() }, item.avatar, { "data-slot": "itemLeadingAvatar", class: __props.ui.itemLeadingAvatar({ class: [(_g2 = __props.uiOverride) == null ? void 0 : _g2.itemLeadingAvatar, (_h2 = item.ui) == null ? void 0 : _h2.itemLeadingAvatar], active }) }), null, 16, ["size", "class"])) : vue.createCommentVNode("", true) ]; }), vue.unref(get)(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : "item-label"] || (vue.unref(get)(item, props.descriptionKey) || !!slots[item.slot ? `${item.slot}-description` : "item-description"]) ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "data-slot": "itemWrapper", class: vue.normalizeClass(__props.ui.itemWrapper({ class: [(_a2 = __props.uiOverride) == null ? void 0 : _a2.itemWrapper, (_b = item.ui) == null ? void 0 : _b.itemWrapper] })) }, [ vue.createElementVNode("span", { "data-slot": "itemLabel", class: vue.normalizeClass(__props.ui.itemLabel({ class: [(_c = __props.uiOverride) == null ? void 0 : _c.itemLabel, (_d = item.ui) == null ? void 0 : _d.itemLabel], active })) }, [ vue.renderSlot(_ctx.$slots, item.slot ? `${item.slot}-label` : "item-label", { item, active, index }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(get)(item, props.labelKey)), 1) ]), item.target === "_blank" && __props.externalIcon !== false ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: typeof __props.externalIcon === "string" ? __props.externalIcon : vue.unref(appConfig2).ui.icons.external, "data-slot": "itemLabelExternalIcon", class: vue.normalizeClass(__props.ui.itemLabelExternalIcon({ class: [(_e2 = __props.uiOverride) == null ? void 0 : _e2.itemLabelExternalIcon, (_f = item.ui) == null ? void 0 : _f.itemLabelExternalIcon], color: item == null ? void 0 : item.color, active })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ], 2), vue.unref(get)(item, props.descriptionKey) || !!slots[item.slot ? `${item.slot}-description` : "item-description"] ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, "data-slot": "itemDescription", class: vue.normalizeClass(__props.ui.itemDescription({ class: [(_g = __props.uiOverride) == null ? void 0 : _g.itemDescription, (_h = item.ui) == null ? void 0 : _h.itemDescription] })) }, [ vue.renderSlot(_ctx.$slots, item.slot ? `${item.slot}-description` : "item-description", { item, active, index }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(get)(item, props.descriptionKey)), 1) ]) ], 2)) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true), vue.createElementVNode("span", { "data-slot": "itemTrailing", class: vue.normalizeClass(__props.ui.itemTrailing({ class: [(_i = __props.uiOverride) == null ? void 0 : _i.itemTrailing, (_j = item.ui) == null ? void 0 : _j.itemTrailing] })) }, [ vue.renderSlot(_ctx.$slots, item.slot ? `${item.slot}-trailing` : "item-trailing", { item, active, index, ui: __props.ui }, () => { var _a3, _b2, _c2, _d2, _e3, _f2; return [ ((_a3 = item.children) == null ? void 0 : _a3.length) ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 0, name: childrenIcon.value, "data-slot": "itemTrailingIcon", class: vue.normalizeClass(__props.ui.itemTrailingIcon({ class: [(_b2 = __props.uiOverride) == null ? void 0 : _b2.itemTrailingIcon, (_c2 = item.ui) == null ? void 0 : _c2.itemTrailingIcon], color: item == null ? void 0 : item.color, active })) }, null, 8, ["name", "class"])) : ((_d2 = item.kbds) == null ? void 0 : _d2.length) ? (vue.openBlock(), vue.createElementBlock("span", { key: 1, "data-slot": "itemTrailingKbds", class: vue.normalizeClass(__props.ui.itemTrailingKbds({ class: [(_e3 = __props.uiOverride) == null ? void 0 : _e3.itemTrailingKbds, (_f2 = item.ui) == null ? void 0 : _f2.itemTrailingKbds] })) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.kbds, (kbd, kbdIndex) => { var _a4, _b3; return vue.openBlock(), vue.createBlock(_sfc_main$A, vue.mergeProps({ key: kbdIndex, size: ((_a4 = item.ui) == null ? void 0 : _a4.itemTrailingKbdsSize) || ((_b3 = __props.uiOverride) == null ? void 0 : _b3.itemTrailingKbdsSize) || __props.ui.itemTrailingKbdsSize() }, { ref_for: true }, typeof kbd === "string" ? { value: kbd } : kbd), null, 16, ["size"]); }), 128)) ], 2)) : vue.createCommentVNode("", true) ]; }), vue.createVNode(DropdownMenu.ItemIndicator, { "as-child": "" }, { default: vue.withCtx(() => { var _a3, _b2; return [ vue.createVNode(_sfc_main$L, { name: __props.checkedIcon || vue.unref(appConfig2).ui.icons.check, "data-slot": "itemTrailingIcon", class: vue.normalizeClass(__props.ui.itemTrailingIcon({ class: [(_a3 = __props.uiOverride) == null ? void 0 : _a3.itemTrailingIcon, (_b2 = item.ui) == null ? void 0 : _b2.itemTrailingIcon], color: item == null ? void 0 : item.color })) }, null, 8, ["name", "class"]) ]; }), _: 2 }, 1024) ], 2) ]; }) ]), _: 3 }), vue.createVNode(DropdownMenu.Portal, vue.normalizeProps(vue.guardReactiveProps(vue.unref(portalProps))), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(FieldGroupReset), null, { default: vue.withCtx(() => { var _a2; return [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.sub ? DropdownMenu.SubContent : DropdownMenu.Content), vue.mergeProps({ "data-slot": "content", class: __props.ui.content({ class: [(_a2 = __props.uiOverride) == null ? void 0 : _a2.content, props.class] }) }, vue.unref(contentProps)), { default: vue.withCtx(() => { var _a3, _b, _c, _d; return [ !!__props.filter ? (vue.openBlock(), vue.createBlock(DropdownMenu.Filter, { key: 0, modelValue: searchTerm.value, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchTerm.value = $event), "as-child": "" }, { default: vue.withCtx(() => { var _a4; return [ vue.createVNode(_sfc_main$E, vue.mergeProps({ autofocus: "", autocomplete: "off", size: __props.size }, inputProps.value, { "data-slot": "input", class: __props.ui.input({ class: (_a4 = __props.uiOverride) == null ? void 0 : _a4.input }), onChange: _cache[0] || (_cache[0] = vue.withModifiers(() => { }, ["stop"])) }), null, 16, ["size", "class"]) ]; }), _: 1 }, 8, ["modelValue"])) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "content-top", { sub: (_a3 = __props.sub) != null ? _a3 : false }), !searchTerm.value || hasFilteredItems.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, role: "presentation", "data-slot": "viewport", class: vue.normalizeClass(__props.ui.viewport({ class: (_b = __props.uiOverride) == null ? void 0 : _b.viewport })) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(filteredGroups.value, (group, groupIndex) => { var _a4; return vue.openBlock(), vue.createBlock(DropdownMenu.Group, { key: `group-${groupIndex}`, "data-slot": "group", class: vue.normalizeClass(__props.ui.group({ class: (_a4 = __props.uiOverride) == null ? void 0 : _a4.group })) }, { default: vue.withCtx(() => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(group, (item, index) => { var _a5, _b2, _c2, _d2, _e2, _f, _g; return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: `group-${groupIndex}-${index}` }, [ item.type === "label" ? (vue.openBlock(), vue.createBlock(DropdownMenu.Label, { key: 0, "data-slot": "label", class: vue.normalizeClass(__props.ui.label({ class: [(_a5 = __props.uiOverride) == null ? void 0 : _a5.label, (_b2 = item.ui) == null ? void 0 : _b2.label, item.class] })) }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(ReuseItemTemplate), { item, index }, null, 8, ["item", "index"]) ]), _: 2 }, 1032, ["class"])) : item.type === "separator" ? (vue.openBlock(), vue.createBlock(DropdownMenu.Separator, { key: 1, "data-slot": "separator", class: vue.normalizeClass(__props.ui.separator({ class: [(_c2 = __props.uiOverride) == null ? void 0 : _c2.separator, (_d2 = item.ui) == null ? void 0 : _d2.separator, item.class] })) }, null, 8, ["class"])) : ((_e2 = item == null ? void 0 : item.children) == null ? void 0 : _e2.length) ? (vue.openBlock(), vue.createBlock(DropdownMenu.Sub, { key: 2, open: item.open, "default-open": item.defaultOpen }, { default: vue.withCtx(() => { var _a6, _b3, _c3, _d3; return [ vue.createVNode(DropdownMenu.SubTrigger, { as: "button", type: "button", disabled: item.disabled, "text-value": vue.unref(get)(item, props.labelKey), "data-slot": "item", class: vue.normalizeClass(__props.ui.item({ class: [(_a6 = __props.uiOverride) == null ? void 0 : _a6.item, (_b3 = item.ui) == null ? void 0 : _b3.item, item.class], color: item == null ? void 0 : item.color })) }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(ReuseItemTemplate), { item, index }, null, 8, ["item", "index"]) ]), _: 2 }, 1032, ["disabled", "text-value", "class"]), vue.createVNode(_sfc_main$e, vue.mergeProps({ sub: "", class: (_c3 = item.ui) == null ? void 0 : _c3.content, ui: __props.ui, "ui-override": __props.uiOverride, portal: __props.portal, items: item.children, align: "start", "align-offset": -4, "side-offset": 3, "label-key": __props.labelKey, "description-key": __props.descriptionKey, "checked-icon": __props.checkedIcon, "loading-icon": __props.loadingIcon, "external-icon": __props.externalIcon, size: __props.size, filter: item.filter, "filter-fields": item.filterFields || __props.filterFields, "ignore-filter": (_d3 = item.ignoreFilter) != null ? _d3 : __props.ignoreFilter }, { ref_for: true }, item.content), vue.createSlots({ _: 2 }, [ vue.renderList(getProxySlots(), (_2, name) => { return { name, fn: vue.withCtx((slotData) => [ vue.renderSlot(_ctx.$slots, name, vue.mergeProps({ ref_for: true }, slotData)) ]) }; }) ]), 1040, ["class", "ui", "ui-override", "portal", "items", "label-key", "description-key", "checked-icon", "loading-icon", "external-icon", "size", "filter", "filter-fields", "ignore-filter"]) ]; }), _: 2 }, 1032, ["open", "default-open"])) : item.type === "checkbox" ? (vue.openBlock(), vue.createBlock(DropdownMenu.CheckboxItem, { key: 3, "model-value": item.checked, disabled: item.disabled, "text-value": vue.unref(get)(item, props.labelKey), "data-slot": "item", class: vue.normalizeClass(__props.ui.item({ class: [(_f = __props.uiOverride) == null ? void 0 : _f.item, (_g = item.ui) == null ? void 0 : _g.item, item.class], color: item == null ? void 0 : item.color })), "onUpdate:modelValue": item.onUpdateChecked, onSelect: item.onSelect }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(ReuseItemTemplate), { item, index }, null, 8, ["item", "index"]) ]), _: 2 }, 1032, ["model-value", "disabled", "text-value", "class", "onUpdate:modelValue", "onSelect"])) : (vue.openBlock(), vue.createBlock(_sfc_main$H, vue.mergeProps({ key: 4, ref_for: true }, vue.unref(pickLinkProps)(item), { custom: "" }), { default: vue.withCtx(({ active, ...slotProps }) => [ vue.createVNode(DropdownMenu.Item, { "as-child": "", disabled: item.disabled, "text-value": vue.unref(get)(item, props.labelKey), onSelect: item.onSelect }, { default: vue.withCtx(() => { var _a6, _b3; return [ vue.createVNode(_sfc_main$I, vue.mergeProps({ ref_for: true }, slotProps, { "data-slot": "item", class: __props.ui.item({ class: [(_a6 = __props.uiOverride) == null ? void 0 : _a6.item, (_b3 = item.ui) == null ? void 0 : _b3.item, item.class], color: item == null ? void 0 : item.color, active }) }), { default: vue.withCtx(() => [ vue.createVNode(vue.unref(ReuseItemTemplate), { item, active, index }, null, 8, ["item", "active", "index"]) ]), _: 2 }, 1040, ["class"]) ]; }), _: 2 }, 1032, ["disabled", "text-value", "onSelect"]) ]), _: 2 }, 1040)) ], 64); }), 128)) ]), _: 2 }, 1032, ["class"]); }), 128)) ], 2)) : vue.createCommentVNode("", true), searchTerm.value && !hasFilteredItems.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, "data-slot": "empty", class: vue.normalizeClass(__props.ui.empty({ class: (_c = __props.uiOverride) == null ? void 0 : _c.empty })) }, [ vue.renderSlot(_ctx.$slots, "empty", { searchTerm: searchTerm.value }, () => [ vue.createTextVNode(vue.toDisplayString(vue.unref(t)("dropdownMenu.noMatch", { searchTerm: searchTerm.value })), 1) ]) ], 2)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default"), vue.renderSlot(_ctx.$slots, "content-bottom", { sub: (_d = __props.sub) != null ? _d : false }) ]; }), _: 3 }, 16, ["class"])) ]; }), _: 3 }) ]), _: 3 }, 16) ], 64); }; } }; const theme$2 = { "slots": { "content": "min-w-32 max-h-(--reka-dropdown-menu-content-available-height) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-dropdown-menu-content-transform-origin) flex flex-col", "input": "border-b border-default", "empty": "text-center text-muted", "viewport": "relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1", "arrow": "fill-bg stroke-default", "group": "p-1 isolate", "label": "w-full flex items-center font-semibold text-highlighted", "separator": "-mx-1 my-1 h-px bg-border", "item": "group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75", "itemLeadingIcon": "shrink-0", "itemLeadingAvatar": "shrink-0", "itemLeadingAvatarSize": "", "itemTrailing": "ms-auto inline-flex gap-1.5 items-center", "itemTrailingIcon": "shrink-0", "itemTrailingKbds": "hidden lg:inline-flex items-center shrink-0", "itemTrailingKbdsSize": "", "itemWrapper": "flex-1 flex flex-col text-start min-w-0", "itemLabel": "truncate", "itemDescription": "truncate text-muted", "itemLabelExternalIcon": "inline-block size-3 align-top text-dimmed" }, "variants": { "color": { "primary": "", "success": "", "info": "", "warning": "", "error": "", "neutral": "" }, "active": { "true": { "item": "text-highlighted before:bg-elevated", "itemLeadingIcon": "text-default" }, "false": { "item": [ "text-default data-highlighted:text-highlighted data-[state=open]:text-highlighted data-highlighted:before:bg-elevated/50 data-[state=open]:before:bg-elevated/50", "transition-colors before:transition-colors" ], "itemLeadingIcon": [ "text-dimmed group-data-highlighted:text-default group-data-[state=open]:text-default", "transition-colors" ] } }, "loading": { "true": { "itemLeadingIcon": "animate-spin" } }, "size": { "xs": { "label": "p-1 text-xs gap-1", "item": "p-1 text-xs gap-1", "empty": "p-2 text-xs", "itemLeadingIcon": "size-4", "itemLeadingAvatarSize": "3xs", "itemTrailingIcon": "size-4", "itemTrailingKbds": "gap-0.5", "itemTrailingKbdsSize": "sm" }, "sm": { "label": "p-1.5 text-xs gap-1.5", "item": "p-1.5 text-xs gap-1.5", "empty": "p-2.5 text-xs", "itemLeadingIcon": "size-4", "itemLeadingAvatarSize": "3xs", "itemTrailingIcon": "size-4", "itemTrailingKbds": "gap-0.5", "itemTrailingKbdsSize": "sm" }, "md": { "label": "p-1.5 text-sm gap-1.5", "item": "p-1.5 text-sm gap-1.5", "empty": "p-2.5 text-sm", "itemLeadingIcon": "size-5", "itemLeadingAvatarSize": "2xs", "itemTrailingIcon": "size-5", "itemTrailingKbds": "gap-0.5", "itemTrailingKbdsSize": "md" }, "lg": { "label": "p-2 text-sm gap-2", "item": "p-2 text-sm gap-2", "empty": "p-3 text-sm", "itemLeadingIcon": "size-5", "itemLeadingAvatarSize": "2xs", "itemTrailingIcon": "size-5", "itemTrailingKbds": "gap-1", "itemTrailingKbdsSize": "md" }, "xl": { "label": "p-2 text-base gap-2", "item": "p-2 text-base gap-2", "empty": "p-3 text-base", "itemLeadingIcon": "size-6", "itemLeadingAvatarSize": "xs", "itemTrailingIcon": "size-6", "itemTrailingKbds": "gap-1", "itemTrailingKbdsSize": "lg" } } }, "compoundVariants": [ { "color": "primary", "active": false, "class": { "item": "text-primary data-highlighted:text-primary data-highlighted:before:bg-primary/10 data-[state=open]:before:bg-primary/10", "itemLeadingIcon": "text-primary/75 group-data-highlighted:text-primary group-data-[state=open]:text-primary" } }, { "color": "success", "active": false, "class": { "item": "text-success data-highlighted:text-success data-highlighted:before:bg-success/10 data-[state=open]:before:bg-success/10", "itemLeadingIcon": "text-success/75 group-data-highlighted:text-success group-data-[state=open]:text-success" } }, { "color": "info", "active": false, "class": { "item": "text-info data-highlighted:text-info data-highlighted:before:bg-info/10 data-[state=open]:before:bg-info/10", "itemLeadingIcon": "text-info/75 group-data-highlighted:text-info group-data-[state=open]:text-info" } }, { "color": "warning", "active": false, "class": { "item": "text-warning data-highlighted:text-warning data-highlighted:before:bg-warning/10 data-[state=open]:before:bg-warning/10", "itemLeadingIcon": "text-warning/75 group-data-highlighted:text-warning group-data-[state=open]:text-warning" } }, { "color": "error", "active": false, "class": { "item": "text-error data-highlighted:text-error data-highlighted:before:bg-error/10 data-[state=open]:before:bg-error/10", "itemLeadingIcon": "text-error/75 group-data-highlighted:text-error group-data-[state=open]:text-error" } }, { "color": "primary", "active": true, "class": { "item": "text-primary before:bg-primary/10", "itemLeadingIcon": "text-primary" } }, { "color": "success", "active": true, "class": { "item": "text-success before:bg-success/10", "itemLeadingIcon": "text-success" } }, { "color": "info", "active": true, "class": { "item": "text-info before:bg-info/10", "itemLeadingIcon": "text-info" } }, { "color": "warning", "active": true, "class": { "item": "text-warning before:bg-warning/10", "itemLeadingIcon": "text-warning" } }, { "color": "error", "active": true, "class": { "item": "text-error before:bg-error/10", "itemLeadingIcon": "text-error" } } ], "defaultVariants": { "size": "md" } }; const _sfc_main$d = { __name: "DropdownMenu", props: vue.mergeModels({ size: { type: null, required: false }, items: { type: null, required: false }, checkedIcon: { type: null, required: false }, loadingIcon: { type: null, required: false }, externalIcon: { type: [Boolean, String], required: false, skipCheck: true, default: true }, content: { type: Object, required: false }, arrow: { type: [Boolean, Object], required: false }, portal: { type: [Boolean, String], required: false, skipCheck: true, default: true }, labelKey: { type: null, required: false, default: "label" }, descriptionKey: { type: null, required: false, default: "description" }, filter: { type: [Boolean, Object], required: false, default: false }, filterFields: { type: Array, required: false }, ignoreFilter: { type: Boolean, required: false, default: false }, disabled: { type: Boolean, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, defaultOpen: { type: Boolean, required: false }, open: { type: Boolean, required: false }, modal: { type: Boolean, required: false, default: true } }, { "searchTerm": { type: String, ...{ default: "" } }, "searchTermModifiers": {} }), emits: vue.mergeModels(["update:open"], ["update:searchTerm"]), setup(__props, { emit: __emit }) { const _props = __props; const emits = __emit; const slots = vue.useSlots(); const searchTerm = vue.useModel(__props, "searchTerm", { type: String, ...{ default: "" } }); const props = useComponentProps("dropdownMenu", _props); const appConfig2 = useAppConfig(); const rootProps = useForwardProps(reactivePick(props, "defaultOpen", "open", "modal"), emits); const contentProps = vue.toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 })); const arrowProps = vue.toRef(() => defu(props.arrow, { rounded: true })); const getProxySlots = () => omit(slots, ["default"]); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$2, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.dropdownMenu) || {} })({ size: props.size }); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(DropdownMenuRoot_default), vue.normalizeProps(vue.guardReactiveProps(vue.unref(rootProps))), { default: vue.withCtx(({ open }) => { var _a2; return [ !!slots.default ? (vue.openBlock(), vue.createBlock(vue.unref(DropdownMenuTrigger_default), { key: 0, "as-child": "", class: vue.normalizeClass(vue.unref(props).class), disabled: vue.unref(props).disabled }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default", { open }) ]), _: 2 }, 1032, ["class", "disabled"])) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$e, vue.mergeProps({ "search-term": searchTerm.value, "onUpdate:searchTerm": _cache[0] || (_cache[0] = ($event) => searchTerm.value = $event), class: ui2.value.content({ class: [!slots.default && vue.unref(props).class, (_a2 = vue.unref(props).ui) == null ? void 0 : _a2.content] }), ui: ui2.value, "ui-override": vue.unref(props).ui }, contentProps.value, { items: vue.unref(props).items, portal: vue.unref(props).portal, "label-key": vue.unref(props).labelKey, "description-key": vue.unref(props).descriptionKey, "checked-icon": vue.unref(props).checkedIcon, "loading-icon": vue.unref(props).loadingIcon, "external-icon": vue.unref(props).externalIcon, size: vue.unref(props).size, filter: vue.unref(props).filter, "filter-fields": vue.unref(props).filterFields, "ignore-filter": vue.unref(props).ignoreFilter }), vue.createSlots({ default: vue.withCtx(() => { var _a3; return [ !!vue.unref(props).arrow ? (vue.openBlock(), vue.createBlock(vue.unref(DropdownMenuArrow_default), vue.mergeProps({ key: 0 }, arrowProps.value, { "data-slot": "arrow", class: ui2.value.arrow({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.arrow }) }), null, 16, ["class"])) : vue.createCommentVNode("", true) ]; }), _: 2 }, [ vue.renderList(getProxySlots(), (_2, name) => { return { name, fn: vue.withCtx((slotData) => [ vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(slotData))) ]) }; }) ]), 1040, ["search-term", "class", "ui", "ui-override", "items", "portal", "label-key", "description-key", "checked-icon", "loading-icon", "external-icon", "size", "filter", "filter-fields", "ignore-filter"]) ]; }), _: 3 }, 16); }; } }; const MD_SHARED = { codeBg: "var(--ui-bg-elevated)", link: "var(--ui-primary)", line: "var(--ui-border)", quote: "var(--ui-text-muted)", text: "var(--ui-text-default)", strong: "var(--ui-text-highlighted)" }; const MD_PEER = MD_SHARED; const MD_MINE = MD_SHARED; const SAFE_URL = /^(https?:\/\/|mailto:|#|\/)/i; function isSafeUrl(url) { return SAFE_URL.test(url.trim()); } const inlineRe = () => /(`+[^`]*?`+)|(\*\*[^*]+?\*\*)|(__[^_]+?__)|(\*[^*\n]+?\*)|(_[^_\n]+?_)|(~~[^~]+?~~)|(!\[[^\]]*\]\([^)\s]+\))|(\[[^\]]*\]\([^)\s]+\))|(https?:\/\/[^\s<>())]+)/g; function renderInline(text, p, keyBase) { const re2 = inlineRe(); const out = []; let last = 0; let m; let n = 0; const push = (node) => { out.push(node); n++; }; while (m = re2.exec(text)) { if (m.index > last) push(text.slice(last, m.index)); const token = m[0]; const key = keyBase + "-" + n; if (token.startsWith("`")) { const ticks = /^`+/.exec(token)[0].length; const inner = token.slice(ticks, token.length - ticks); push( vue.h( "code", { key, style: { padding: "1px 5px", borderRadius: "4px", background: p.codeBg, fontSize: "12px", fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", wordBreak: "break-all" } }, inner ) ); } else if (token.startsWith("**") || token.startsWith("__")) { push( vue.h( "strong", { key, style: { fontWeight: 600, color: p.strong } }, renderInline(token.slice(2, -2), p, key) ) ); } else if (token.startsWith("~~")) { push(vue.h("del", { key, style: { opacity: 0.7 } }, renderInline(token.slice(2, -2), p, key))); } else if (token.startsWith("*") || token.startsWith("_")) { push(vue.h("em", { key }, renderInline(token.slice(1, -1), p, key))); } else { const img = /^!\[([^\]]*)\]\(([^)\s]+)\)$/.exec(token); const link = /^\[([^\]]*)\]\(([^)\s]+)\)$/.exec(token); if (img) { const src = img[2]; push( isSafeUrl(src) ? vue.h("img", { key, src, alt: img[1], style: { maxWidth: "100%", borderRadius: "6px", display: "block", margin: "2px 0" } }) : img[0] ); } else if (link) { const href = link[2]; push( isSafeUrl(href) ? vue.h( "a", { key, href, target: "_blank", rel: "noreferrer", style: { color: p.link, textDecoration: "underline", wordBreak: "break-all" } }, renderInline(link[1] || href, p, key) ) : token ); } else { push( vue.h( "a", { key, href: token, target: "_blank", rel: "noreferrer", style: { color: p.link, textDecoration: "underline", wordBreak: "break-all" } }, token ) ); } } last = m.index + token.length; } if (last < text.length) push(text.slice(last)); return out; } function renderParagraph(lines, p, key) { const children = []; lines.forEach((line, i) => { if (i > 0) children.push(vue.h("br", { key: key + "-br" + i })); children.push(...renderInline(line, p, key + "-" + i)); }); return vue.h("p", { key, style: { margin: "0" } }, children); } const RE_FENCE = /^\s*(```+|~~~+)\s*([\w+-]*)\s*$/; const RE_HEADING = /^\s{0,3}(#{1,6})\s+(.*)$/; const RE_HR = /^\s{0,3}((?:-\s*){3,}|(?:\*\s*){3,}|(?:_\s*){3,})$/; const RE_UL = /^\s{0,3}[-*+]\s+(.*)$/; const RE_OL = /^\s{0,3}\d+[.)]\s+(.*)$/; const RE_QUOTE = /^\s{0,3}>\s?(.*)$/; const RE_TABLE_SEP = /^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/; function splitRow(line) { let s = line.trim(); if (s.startsWith("|")) s = s.slice(1); if (s.endsWith("|")) s = s.slice(0, -1); return s.split("|").map((c) => c.trim()); } function renderCode(code, lang, p, key) { return vue.h( "pre", { key, "data-lang": lang || void 0, style: { margin: "0", padding: "8px 10px", borderRadius: "6px", background: p.codeBg, fontSize: "12px", lineHeight: "1.5", overflowX: "auto", minWidth: "0", fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" } }, [vue.h("code", code.join("\n"))] ); } function renderTable(rows, p, key) { const [head, ...body] = rows; const cell = (text, tag, k) => vue.h( tag, { key: k, class: "border border-default px-2 py-1 text-left" + (tag === "th" ? " bg-elevated text-highlighted font-semibold whitespace-nowrap" : "") }, renderInline(text, p, k) ); return vue.h("div", { key, class: "min-w-0 overflow-x-auto" }, [ vue.h("table", { class: "md-table border-collapse text-xs" }, [ vue.h("thead", [ vue.h( "tr", head.map((c, i) => cell(c, "th", key + "-h" + i)) ) ]), vue.h( "tbody", body.map( (row, ri) => vue.h( "tr", { key: key + "-r" + ri }, row.map((c, ci) => cell(c, "td", key + "-r" + ri + "c" + ci)) ) ) ) ]) ]); } function renderMarkdown(content, palette) { const p = palette; const lines = (content || "").replace(/\r\n?/g, "\n").split("\n"); const out = []; let i = 0; let seq = 0; while (i < lines.length) { const line = lines[i]; const key = "md" + seq++; if (!line.trim()) { i++; continue; } const fence = RE_FENCE.exec(line); if (fence) { const marker = fence[1][0]; const lang = fence[2] || ""; const buf = []; i++; while (i < lines.length && !new RegExp("^\\s*" + marker + "{3,}\\s*$").test(lines[i])) { buf.push(lines[i]); i++; } i++; out.push(renderCode(buf, lang, p, key)); continue; } const head = RE_HEADING.exec(line); if (head) { const level = head[1].length; out.push( vue.h( "h" + level, { key, style: { margin: "0", fontSize: level === 1 ? "16px" : level === 2 ? "15px" : level === 3 ? "14px" : "13px", fontWeight: 600, lineHeight: "1.5" } }, renderInline(head[2], p, key) ) ); i++; continue; } if (RE_HR.test(line)) { out.push(vue.h("hr", { key, style: { margin: "2px 0", border: "0", borderTop: "1px solid " + p.line } })); i++; continue; } if (RE_QUOTE.test(line)) { const buf = []; while (i < lines.length && RE_QUOTE.test(lines[i])) { buf.push(RE_QUOTE.exec(lines[i])[1]); i++; } out.push( vue.h( "blockquote", { key, style: { margin: "0", paddingLeft: "10px", borderLeft: "3px solid " + p.quote, color: p.text, opacity: 0.9 } }, renderMarkdown(buf.join("\n"), p) ) ); continue; } if (line.includes("|") && i + 1 < lines.length && RE_TABLE_SEP.test(lines[i + 1])) { const rows = [splitRow(line)]; i += 2; while (i < lines.length && lines[i].includes("|") && lines[i].trim()) { rows.push(splitRow(lines[i])); i++; } out.push(renderTable(rows, p, key)); continue; } const ul = RE_UL.exec(line); const ol = ul ? null : RE_OL.exec(line); if (ul || ol) { const ordered = !!ol; const items = []; while (i < lines.length) { const m2 = (ordered ? RE_OL : RE_UL).exec(lines[i]); if (!m2) break; items.push(m2[1]); i++; } out.push( vue.h( ordered ? "ol" : "ul", { key, style: { margin: "0", paddingLeft: "20px" } }, items.map( (t, idx) => vue.h( "li", { key: key + "-i" + idx, style: { margin: "2px 0" } }, renderInline(t, p, key + "-i" + idx) ) ) ) ); continue; } const para = [line]; i++; while (i < lines.length) { const next = lines[i]; if (!next.trim() || RE_FENCE.test(next) || RE_HEADING.test(next) || RE_HR.test(next) || RE_QUOTE.test(next) || RE_UL.test(next) || RE_OL.test(next)) { break; } para.push(next); i++; } out.push(renderParagraph(para, p, key)); } return out; } const _hoisted_1$8 = ["src", "alt"]; const _hoisted_2$6 = ["src", "alt"]; const _hoisted_3$6 = ["data-chat-progress"]; const _hoisted_4$6 = { class: "h-1 min-w-0 flex-1 overflow-hidden rounded-md bg-elevated" }; const _hoisted_5$6 = { "data-chat-file-bubble": "1", class: "flex min-w-0 items-center gap-2.5" }; const _hoisted_6$5 = { class: "inline-flex size-8 shrink-0 items-center justify-center rounded-md bg-elevated" }; const _hoisted_7$5 = { class: "min-w-0 flex-1" }; const _hoisted_8$5 = ["title"]; const _hoisted_9$5 = { class: "mt-px text-[11px] opacity-75" }; const _hoisted_10$3 = { key: 0, class: "flex items-center gap-1.5" }; const _hoisted_11$2 = { class: "h-1 min-w-0 flex-1 overflow-hidden rounded-md bg-elevated" }; const _hoisted_12$1 = { key: 1, class: "text-[11px]" }; const _hoisted_13$1 = { key: 0, class: "mt-1 text-[11px]" }; const _sfc_main$c = vue.defineComponent({ __name: "ChatBubble", props: { type: {}, mine: { type: Boolean }, text: { default: "" }, name: { default: "" }, mime: { default: "" }, sizeText: { default: "" }, imageSrc: { default: "" }, progress: { default: null }, error: { default: "" }, imageActions: { default: () => [] }, clickable: { type: Boolean, default: false }, canDownload: { type: Boolean, default: true }, downloadLabel: { default: "下载" } }, emits: ["preview", "download"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; const sending = vue.computed(() => props.progress !== null); const mdNodes = vue.computed(() => renderMarkdown(props.text || "", props.mine ? MD_MINE : MD_PEER)); const imgStyle = vue.computed(() => ({ maxHeight: "360px", opacity: sending.value ? 0.55 : 1 })); return (_ctx, _cache) => { return __props.type === "image" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ __props.imageActions.length ? (vue.openBlock(), vue.createBlock(_sfc_main$j, { key: 0, actions: __props.imageActions, onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => { }, ["stop"])) }, { default: vue.withCtx(() => [ vue.createElementVNode("img", { src: __props.imageSrc, alt: __props.name || "image", class: vue.normalizeClass(["block h-auto w-auto max-w-full rounded-md", __props.clickable ? "cursor-zoom-in" : ""]), style: vue.normalizeStyle(imgStyle.value), onClick: _cache[0] || (_cache[0] = ($event) => emit2("preview")) }, null, 14, _hoisted_1$8) ]), _: 1 }, 8, ["actions"])) : (vue.openBlock(), vue.createElementBlock("img", { key: 1, src: __props.imageSrc, alt: __props.name || "image", class: vue.normalizeClass(["block h-auto w-auto max-w-full rounded-md", __props.clickable ? "cursor-zoom-in" : ""]), style: vue.normalizeStyle(imgStyle.value), onClick: _cache[2] || (_cache[2] = ($event) => emit2("preview")) }, null, 14, _hoisted_2$6)), __props.progress !== null ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, class: "mt-1 flex items-center gap-1.5", "data-chat-progress": __props.progress }, [ vue.createVNode(_sfc_main$t, { size: 14 }), vue.createElementVNode("div", _hoisted_4$6, [ vue.createElementVNode("div", { class: "h-full rounded-md bg-primary transition-[width]", style: vue.normalizeStyle({ width: __props.progress + "%" }) }, null, 4) ]) ], 8, _hoisted_3$6)) : vue.createCommentVNode("", true) ], 64)) : __props.type === "file" ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: "flex min-w-0 flex-col gap-1", style: vue.normalizeStyle(sending.value ? { opacity: 0.55 } : void 0) }, [ vue.createElementVNode("div", _hoisted_5$6, [ vue.createElementVNode("span", _hoisted_6$5, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-file-text", size: 18 }) ]), vue.createElementVNode("div", _hoisted_7$5, [ vue.createElementVNode("div", { class: "truncate text-[13px] font-medium", title: __props.name || "file" }, vue.toDisplayString(__props.name || "file"), 9, _hoisted_8$5), vue.createElementVNode("div", _hoisted_9$5, [ vue.createTextVNode(vue.toDisplayString(__props.sizeText), 1), __props.mime ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createTextVNode(" · " + vue.toDisplayString(__props.mime), 1) ], 64)) : vue.createCommentVNode("", true) ]) ]), vue.createVNode(_sfc_main$G, { size: "sm", variant: "outline", color: "neutral", disabled: !__props.canDownload, "aria-label": "下载文件 " + (__props.name || "file"), class: "shrink-0", onClick: _cache[3] || (_cache[3] = ($event) => emit2("download")) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(__props.downloadLabel), 1) ]), _: 1 }, 8, ["disabled", "aria-label"]) ]), __props.progress !== null ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$3, [ vue.createVNode(_sfc_main$t, { size: 14 }), vue.createElementVNode("div", _hoisted_11$2, [ vue.createElementVNode("div", { class: "h-full rounded-md bg-primary transition-[width]", style: vue.normalizeStyle({ width: __props.progress + "%" }) }, null, 4) ]) ])) : vue.createCommentVNode("", true), __props.error ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, vue.toDisplayString(__props.error), 1)) : vue.createCommentVNode("", true) ], 4)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(() => mdNodes.value))), __props.error ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$1, vue.toDisplayString(__props.error), 1)) : vue.createCommentVNode("", true) ], 64)); }; } }); const _hoisted_1$7 = ["placeholder", "disabled"]; const MIN_H = 32; const MAX_H = 132; const _sfc_main$b = vue.defineComponent({ __name: "ChatComposer", props: { modelValue: {}, disabled: { type: Boolean, default: false }, placeholder: { default: "" }, attach: { default: () => [] } }, emits: ["update:modelValue", "send"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; const root = vue.ref(null); function textareaEl() { var _a2, _b; return (_b = (_a2 = root.value) == null ? void 0 : _a2.querySelector("textarea")) != null ? _b : null; } function autoGrow() { const el = textareaEl(); if (!el) return; el.style.height = "auto"; const h2 = Math.min(Math.max(el.scrollHeight, MIN_H), MAX_H); el.style.height = h2 + "px"; el.style.overflowY = el.scrollHeight > MAX_H ? "auto" : "hidden"; } const model = vue.computed({ get: () => props.modelValue, set: (v) => emit2("update:modelValue", v) }); vue.watch( () => props.modelValue, () => vue.nextTick(autoGrow) ); function onKeydown(e) { if (e.key !== "Enter" || e.shiftKey) return; e.preventDefault(); if (!sendDisabled.value) emit2("send"); } const sendDisabled = vue.computed(() => !!props.disabled || !props.modelValue.trim()); const attachItems = vue.computed( () => props.attach.map((a) => ({ label: a.label, icon: a.icon, onSelect: () => a.onClick() })) ); vue.onMounted(() => { autoGrow(); }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", { ref_key: "root", ref: root, class: "flex w-full items-end gap-1 rounded-md border border-default bg-default px-2 py-1.5" }, [ __props.attach.length ? (vue.openBlock(), vue.createBlock(_sfc_main$d, { key: 0, items: attachItems.value, content: { side: "top", align: "start" } }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, { icon: "i-lucide-paperclip", size: "md", color: "primary", variant: "ghost", "aria-label": "添加图片或文件", title: "添加图片或文件" }) ]), _: 1 }, 8, ["items"])) : vue.createCommentVNode("", true), vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event), "data-znhd": "chat-composer", class: "min-h-0 w-full min-w-0 flex-1 resize-none rounded-none border-0 bg-transparent px-0 py-1.5 text-sm leading-5 shadow-none outline-none", placeholder: __props.placeholder, disabled: __props.disabled, rows: "1", onInput: autoGrow, onKeydown }, null, 40, _hoisted_1$7), [ [vue.vModelText, model.value] ]), vue.createVNode(_sfc_main$G, { icon: "i-lucide-send", size: "md", color: "primary", variant: "ghost", "aria-label": "发送", title: "发送(Enter)", disabled: sendDisabled.value, onClick: _cache[1] || (_cache[1] = ($event) => emit2("send")) }, null, 8, ["disabled"]) ], 512); }; } }); function shortPhoneId(id) { if (!id) return "未知设备(旧版中继)"; return id.length > 8 ? id.slice(0, 8) + "…" : id; } const pad = (n) => String(n).padStart(2, "0"); const dayOf = (x) => x.getFullYear() + "-" + x.getMonth() + "-" + x.getDate(); function fmtTime(ts) { const d = new Date(ts); return pad(d.getHours()) + ":" + pad(d.getMinutes()); } function sepTimeText(ts) { const d = new Date(ts); const now = new Date(); const hm = fmtTime(ts); if (dayOf(d) === dayOf(now)) return hm; const yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1); if (dayOf(d) === dayOf(yesterday)) return "昨天 " + hm; return pad(d.getMonth() + 1) + "-" + pad(d.getDate()) + " " + hm; } function fullTime(ts) { const d = new Date(ts); return pad(d.getMonth() + 1) + "-" + pad(d.getDate()) + " " + pad(d.getHours()) + ":" + pad(d.getMinutes()) + ":" + pad(d.getSeconds()); } function previewText(msg) { if (!msg) return ""; if (msg.type === "image") return "[图片]"; if (msg.type === "file") return "[文件] " + (msg.name || ""); return (msg.text || "").replace(/\s+/g, " ").slice(0, 40); } function sourceLabel(msg) { if (msg.sessionKey === PHONE_SESSION_KEY) return PHONE_SESSION_LABEL; return shortPhoneId(msg.sessionKey); } const _hoisted_1$6 = { key: 1, class: "znhd-transfer-files min-h-0 flex-1 overflow-y-auto px-3 py-2.5" }; const _hoisted_2$5 = { class: "mb-2 flex items-baseline gap-2" }; const _hoisted_3$5 = { class: "text-sm font-semibold text-default" }; const _hoisted_4$5 = { key: 0, class: "grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] content-start gap-2" }; const _hoisted_5$5 = ["src", "alt", "onClick"]; const _hoisted_6$4 = { class: "mt-0.5 truncate text-[11px] text-dimmed" }; const _hoisted_7$4 = { class: "mb-1.5 text-[13px] font-semibold text-default" }; const _hoisted_8$4 = { class: "grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] content-start gap-2" }; const _hoisted_9$4 = { class: "inline-flex size-8 shrink-0 items-center justify-center rounded-md bg-elevated/50 text-muted" }; const _hoisted_10$2 = { class: "min-w-0 flex-1" }; const _hoisted_11$1 = ["title"]; const _hoisted_12 = { class: "mt-px truncate text-[11px] text-dimmed" }; const _hoisted_13 = { class: "flex shrink-0 items-center gap-1" }; const _sfc_main$a = vue.defineComponent({ __name: "FilesView", props: { messages: {}, scopeLabel: {}, clearScope: { type: Function } }, setup(__props) { const props = __props; const imgCopy = vue.ref(null); const previewOpen = vue.ref(false); const previewIndex = vue.ref(0); const ordered = vue.computed( () => props.messages.slice().filter((m) => m.type !== "text").sort((a, b) => b.ts - a.ts) ); const images = vue.computed(() => ordered.value.filter((m) => m.type === "image")); const files = vue.computed(() => ordered.value.filter((m) => m.type === "file")); const imageUrls = vue.computed(() => images.value.map((m) => m.previewUrl)); const imageNames = vue.computed(() => images.value.map((m, i) => downloadFileName(m.name, m.mime, i))); function saveBlob(blob, name) { if (!blob) return; const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = name; document.body.appendChild(a); a.click(); a.remove(); window.setTimeout(() => URL.revokeObjectURL(a.href), 1e3); } function doCopy(msg) { imgCopy.value = { id: msg.id, state: "busy" }; copyImageToClipboard(msg.blob).then((ok) => { imgCopy.value = { id: msg.id, state: ok ? "ok" : "fail" }; if (ok) addLog("图片已复制到剪贴板: " + (msg.name || ""), "success"); window.setTimeout(() => imgCopy.value = null, 1500); }); } function copyHint(msg) { const st2 = imgCopy.value; if (!st2 || st2.id !== msg.id) return "复制"; if (st2.state === "busy") return "复制中…"; return st2.state === "ok" ? "已复制" : "复制失败"; } function doDownload(msg, idx) { const fname = downloadFileName(msg.name, msg.mime, idx); saveBlob(msg.blob, fname); addLog("图片已下载: " + fname, "success"); } function doDownloadFile(msg) { const fname = msg.name || "file.bin"; saveBlob(msg.blob, fname); addLog("文件已下载: " + fname, "success"); } function openPreview(msg) { const at = images.value.findIndex((m) => m.id === msg.id); previewIndex.value = at >= 0 ? at : 0; previewOpen.value = true; } function actionsOf(msg, idx) { return [ { label: "复制", tooltip: copyHint(msg), icon: imgCopy.value && imgCopy.value.id === msg.id && imgCopy.value.state === "ok" ? "i-lucide-check" : "i-lucide-copy", onClick: () => doCopy(msg) }, { label: "下载", icon: "i-lucide-download", onClick: () => doDownload(msg, idx) }, { label: "删除", icon: "i-lucide-trash", danger: true, onClick: () => removeTransferMessage(msg.sessionKey, msg.id) } ]; } function onClear() { if (props.clearScope) { props.clearScope(); addLog("[传输助手] 已清空该会话的文件与消息", "success"); } else { clearAllTransferFiles(); } } return (_ctx, _cache) => { return !ordered.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$o, { key: 0, class: "flex-1", size: "xs", description: __props.clearScope ? "该会话暂无图片 / 文件" : "暂无文件——手机发来的图片 / 文件会汇总在这里", ui: { description: "text-xs text-dimmed" } }, null, 8, ["description"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [ vue.createElementVNode("div", _hoisted_2$5, [ vue.createElementVNode("span", _hoisted_3$5, vue.toDisplayString(__props.scopeLabel) + "(图片 " + vue.toDisplayString(images.value.length) + " · 文件 " + vue.toDisplayString(files.value.length) + ") ", 1), _cache[1] || (_cache[1] = vue.createElementVNode("span", { class: "flex-1" }, null, -1)), vue.createElementVNode("button", { type: "button", class: "cursor-pointer rounded-md border border-error bg-transparent px-2 py-0.5 text-xs text-error outline-none hover:opacity-80", onClick: onClear }, vue.toDisplayString(__props.clearScope ? "清空本会话" : "清空全部"), 1) ]), images.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$5, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(images.value, (msg, idx) => { return vue.openBlock(), vue.createElementBlock("div", { key: msg.id, class: "flex flex-col" }, [ vue.createVNode(_sfc_main$j, { actions: actionsOf(msg, idx) }, { default: vue.withCtx(() => [ vue.createElementVNode("img", { src: msg.previewUrl, alt: msg.name || "image", class: "block aspect-square w-full cursor-zoom-in rounded-md object-cover", onClick: ($event) => openPreview(msg) }, null, 8, _hoisted_5$5) ]), _: 2 }, 1032, ["actions"]), vue.createElementVNode("div", _hoisted_6$4, vue.toDisplayString(vue.unref(sourceLabel)(msg)) + " · " + vue.toDisplayString(vue.unref(fullTime)(msg.ts)) + " · " + vue.toDisplayString(msg.direction === "in" ? "收到" : "发出"), 1) ]); }), 128)) ])) : vue.createCommentVNode("", true), files.value.length ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: vue.normalizeClass(images.value.length ? "mt-4" : "") }, [ vue.createElementVNode("div", _hoisted_7$4, "文件(" + vue.toDisplayString(files.value.length) + ")", 1), vue.createElementVNode("div", _hoisted_8$4, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(files.value, (msg) => { return vue.openBlock(), vue.createElementBlock("div", { key: msg.id, "data-transfer-file-card": "1", class: "flex min-w-0 items-center gap-2.5 rounded-md border border-default bg-elevated/30 px-2.5 py-2" }, [ vue.createElementVNode("span", _hoisted_9$4, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-file-text", size: 18 }) ]), vue.createElementVNode("div", _hoisted_10$2, [ vue.createElementVNode("div", { class: "truncate text-[13px] text-default", title: msg.name || "file" }, vue.toDisplayString(msg.name || "file"), 9, _hoisted_11$1), vue.createElementVNode("div", _hoisted_12, vue.toDisplayString(vue.unref(formatBytes)(msg.blob ? msg.blob.size : 0)) + " · " + vue.toDisplayString(vue.unref(sourceLabel)(msg)) + " · " + vue.toDisplayString(vue.unref(fullTime)(msg.ts)) + " · " + vue.toDisplayString(msg.direction === "in" ? "收到" : "发出"), 1) ]), vue.createElementVNode("div", _hoisted_13, [ vue.createVNode(_sfc_main$G, { variant: "outline", color: "neutral", size: "xs", "aria-label": "下载文件", disabled: !msg.blob, onClick: ($event) => doDownloadFile(msg) }, { default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [ vue.createTextVNode(" 下载 ", -1) ])]), _: 1 }, 8, ["disabled", "onClick"]), vue.createVNode(_sfc_main$G, { icon: "i-lucide-x", size: "xs", color: "error", variant: "ghost", "aria-label": "删除文件", class: "text-error", onClick: ($event) => vue.unref(removeTransferMessage)(msg.sessionKey, msg.id) }, null, 8, ["onClick"]) ]) ]); }), 128)) ]) ], 2)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$i, { open: previewOpen.value, "onUpdate:open": _cache[0] || (_cache[0] = ($event) => previewOpen.value = $event), items: imageUrls.value, index: previewIndex.value, names: imageNames.value }, null, 8, ["open", "items", "index", "names"]) ])); }; } }); function genQrDataUrl(text) { return new Promise((resolve) => { try { if (typeof QRCode === "undefined" || typeof QRCode !== "function") { addLog("[二维码] qrcodejs 未加载,请手动复制链接", "error", true); resolve(""); return; } const holder = document.createElement("div"); holder.style.position = "absolute"; holder.style.left = "-99999px"; holder.style.top = "-99999px"; document.body.appendChild(holder); new QRCode(holder, { text, width: 240, height: 240, colorDark: "#000000", colorLight: "#ffffff", correctLevel: QRCode.CorrectLevel.M }); setTimeout(() => { try { const canvas = holder.querySelector("canvas"); const url = canvas ? canvas.toDataURL("image/png") : ""; if (holder.parentNode) holder.parentNode.removeChild(holder); if (url) resolve(url); else { addLog("[二维码] 画布读取失败,请手动复制链接", "error", true); resolve(""); } } catch (e) { if (holder.parentNode) holder.parentNode.removeChild(holder); addLog("[二维码] 读取失败: " + e.message, "error", true); resolve(""); } }, 0); } catch (e) { addLog("[二维码] 生成异常: " + e.message, "error", true); resolve(""); } }); } const _hoisted_1$5 = { class: "mx-auto w-full max-w-[560px] overflow-auto px-4 py-4" }; const _hoisted_2$4 = { class: "mb-3 rounded-md border border-default bg-elevated/40" }; const _hoisted_3$4 = { class: "flex flex-col gap-3 p-3.5" }; const _hoisted_4$4 = { key: 0, class: "flex items-start gap-3" }; const _hoisted_5$4 = { class: "shrink-0 text-center" }; const _hoisted_6$3 = ["src"]; const _hoisted_7$3 = { key: 1, class: "flex size-[124px] flex-col items-center justify-center gap-1.5 rounded-md border border-default text-xs text-dimmed" }; const _hoisted_8$3 = { class: "inline-flex" }; const _hoisted_9$3 = { class: "min-w-0 flex-1" }; const _hoisted_10$1 = { class: "max-h-14 overflow-auto break-all rounded-md border border-default bg-elevated px-2.5 py-1.5 text-[13px] text-default" }; const _sfc_main$9 = vue.defineComponent({ __name: "PairPanel", props: { relayServer: {}, phones: {} }, setup(__props) { const props = __props; const deviceId = getDeviceId(); const qrUrl = vue.ref(""); const link = vue.ref(""); function refreshLink() { const s = (props.relayServer || "").trim().replace(/\/+$/, ""); if (!/^https?:\/\//i.test(s)) { link.value = ""; qrUrl.value = ""; return; } const lk = s + "/u/" + deviceId; link.value = lk; genQrDataUrl(lk).then((u) => qrUrl.value = u).catch((e) => addLog("[配对] 二维码失败: " + (e && e.message), "error", true)); } vue.watch(() => props.relayServer, refreshLink); vue.onMounted(refreshLink); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [ vue.createElementVNode("div", _hoisted_2$4, [ vue.createElementVNode("div", _hoisted_3$4, [ link.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, [ vue.createElementVNode("div", _hoisted_5$4, [ qrUrl.value ? (vue.openBlock(), vue.createElementBlock("img", { key: 0, src: qrUrl.value, alt: "上传链接二维码", class: "block size-[124px] rounded-md border border-default" }, null, 8, _hoisted_6$3)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$3, [ vue.createElementVNode("span", _hoisted_8$3, [ vue.createVNode(_sfc_main$t, { size: 30 }) ]), _cache[1] || (_cache[1] = vue.createTextVNode(" 二维码生成中… ", -1)) ])), _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "mt-1.5 text-xs text-muted" }, "扫一扫上传", -1)) ]), vue.createElementVNode("div", _hoisted_9$3, [ _cache[4] || (_cache[4] = vue.createElementVNode("div", { class: "mb-1.5 text-xs text-muted" }, "链接(复制到手机浏览器打开)", -1)), vue.createElementVNode("div", _hoisted_10$1, vue.toDisplayString(link.value), 1), vue.createVNode(_sfc_main$G, { size: "sm", class: "mt-2.5 w-full", onClick: _cache[0] || (_cache[0] = ($event) => link.value && vue.unref(safeCopyText)(link.value)) }, { default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [ vue.createTextVNode("复制链接", -1) ])]), _: 1 }) ]) ])) : (vue.openBlock(), vue.createBlock(_sfc_main$o, { key: 1, size: "sm", title: "尚未配置中继服务器", ui: { description: "text-[13px] text-muted" } }, { leading: vue.withCtx(() => [ vue.createVNode(_sfc_main$L, { name: "i-lucide-settings", size: 20 }) ]), description: vue.withCtx(() => [..._cache[5] || (_cache[5] = [ vue.createElementVNode("p", null, "请到主面板「设置菜单 → 传输助手」填写中继地址,保存后这里会自动生成扫码链接。", -1) ])]), _: 1 })) ]) ]) ]); }; } }); const _sfc_main$8 = vue.defineComponent({ __name: "PairDialog", props: vue.mergeModels({ relayServer: {}, phones: {} }, { "open": { type: Boolean, ...{ default: false } }, "openModifiers": {} }), emits: ["update:open"], setup(__props) { const open = vue.useModel(__props, "open"); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(_sfc_main$v, { open: open.value, "onUpdate:open": _cache[0] || (_cache[0] = ($event) => open.value = $event), variant: "plain", title: "配对设备", width: 520 }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$9, { "relay-server": __props.relayServer, phones: __props.phones }, null, 8, ["relay-server", "phones"]) ]), _: 1 }, 8, ["open"]); }; } }); const _hoisted_1$4 = { class: "flex gap-3 border-b border-default py-[7px]" }; const _hoisted_2$3 = { class: "min-w-0 flex-1 break-all text-[13px]" }; const _hoisted_3$3 = { class: "flex gap-3 border-b border-default py-[7px]" }; const _hoisted_4$3 = { class: "inline-flex min-w-0 flex-1 items-center gap-1.5" }; const _hoisted_5$3 = { class: "min-w-0 break-all text-[13px]" }; const _hoisted_6$2 = { class: "flex gap-3 border-b border-default py-[7px]" }; const _hoisted_7$2 = { class: "min-w-0 flex-1 break-all text-[13px]" }; const _hoisted_8$2 = { class: "ml-1.5 text-[11px] opacity-65" }; const _hoisted_9$2 = { key: 1, class: "text-[13px] text-muted" }; const _hoisted_10 = { class: "flex gap-3 border-b border-default py-[7px]" }; const _hoisted_11 = { class: "min-w-0 flex-1 break-all text-[13px]" }; const _sfc_main$7 = vue.defineComponent({ __name: "AboutDialog", props: { "open": { type: Boolean, ...{ default: false } }, "openModifiers": {} }, emits: ["update:open"], setup(__props) { const open = vue.useModel(__props, "open"); const store = useTransferStore(); const deviceId = getDeviceId(); const version = vue.computed(() => { var _a2; return ((_a2 = GM_info == null ? void 0 : GM_info.script) == null ? void 0 : _a2.version) || "未知"; }); const phoneIds = vue.computed(() => store.value.phones.map((p) => shortPhoneId(p.id)).join("、")); function openHome() { window.open("https://cnb.cool/bbbbaa/znhd-service", "_blank"); } return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(_sfc_main$v, { open: open.value, "onUpdate:open": _cache[2] || (_cache[2] = ($event) => open.value = $event), variant: "plain", title: "企业信息", width: 440 }, { footer: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, { size: "sm", onClick: _cache[1] || (_cache[1] = ($event) => open.value = false) }, { default: vue.withCtx(() => [..._cache[8] || (_cache[8] = [ vue.createTextVNode("关闭", -1) ])]), _: 1 }) ]), default: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_1$4, [ _cache[3] || (_cache[3] = vue.createElementVNode("span", { class: "shrink-0 basis-[92px] text-[13px] opacity-65" }, "中继服务器", -1)), vue.createElementVNode("span", _hoisted_2$3, vue.toDisplayString(vue.unref(store).settings.relayServer || "(未配置)"), 1) ]), vue.createElementVNode("div", _hoisted_3$3, [ _cache[4] || (_cache[4] = vue.createElementVNode("span", { class: "shrink-0 basis-[92px] text-[13px] opacity-65" }, "本机设备", -1)), vue.createElementVNode("span", _hoisted_4$3, [ vue.createElementVNode("span", _hoisted_5$3, vue.toDisplayString(vue.unref(deviceId)), 1), vue.createVNode(_sfc_main$G, { icon: "i-lucide-copy", size: "sm", variant: "ghost", color: "neutral", class: "shrink-0", "aria-label": "复制设备 ID", title: "复制设备 ID", onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(safeCopyText)(vue.unref(deviceId))) }) ]) ]), vue.createElementVNode("div", _hoisted_6$2, [ _cache[5] || (_cache[5] = vue.createElementVNode("span", { class: "shrink-0 basis-[92px] text-[13px] opacity-65" }, "在线手机", -1)), vue.createElementVNode("span", _hoisted_7$2, [ vue.unref(store).phones.length ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createTextVNode(vue.toDisplayString(phoneIds.value) + " ", 1), vue.createElementVNode("span", _hoisted_8$2, "共 " + vue.toDisplayString(vue.unref(store).phones.length) + " 台", 1) ], 64)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$2, "暂无(手机端打开本机链接后出现)")) ]) ]), vue.createElementVNode("div", _hoisted_10, [ _cache[6] || (_cache[6] = vue.createElementVNode("span", { class: "shrink-0 basis-[92px] text-[13px] opacity-65" }, "脚本版本", -1)), vue.createElementVNode("span", _hoisted_11, vue.toDisplayString(version.value), 1) ]), vue.createElementVNode("div", { class: "flex gap-3 border-b border-default py-[7px]" }, [ _cache[7] || (_cache[7] = vue.createElementVNode("span", { class: "shrink-0 basis-[92px] text-[13px] opacity-65" }, "项目主页", -1)), vue.createElementVNode("span", { class: "min-w-0 flex-1" }, [ vue.createElementVNode("button", { variant: "link", color: "primary", size: "sm", class: "h-auto px-0 text-[13px]", onClick: openHome }, " cnb.cool/bbbbaa/znhd-service ") ]) ]), _cache[9] || (_cache[9] = vue.createElementVNode("div", { class: "mt-2.5 text-xs text-muted" }, " 提示:排查「连不上」时先看这里 —— 中继地址是否可达、手机是否出现在在线列表里; 会话记录保存在本机(IndexedDB),仅保留最近 7 天,超期自动清理。 ", -1)) ]), _: 1 }, 8, ["open"]); }; } }); const _hoisted_1$3 = ["data-state"]; const _hoisted_2$2 = { class: "flex shrink-0 items-center gap-1 border-b border-default px-6 py-3" }; const _hoisted_3$2 = { class: "flex min-w-0 items-center gap-2" }; const _hoisted_4$2 = { class: "shrink-0 text-xs text-muted" }; const _hoisted_5$2 = { class: "ml-auto flex items-center gap-1.5" }; const _hoisted_6$1 = { key: 0, "data-znhd": "chat-header", class: "w-full text-center text-[11px] text-muted" }; const _hoisted_7$1 = { class: "shrink-0 border-t border-default px-6 py-3" }; const _hoisted_8$1 = { key: 0, class: "mt-2 text-center text-xs text-muted" }; const _hoisted_9$1 = { class: "flex h-[520px] flex-col overflow-hidden" }; const TIME_GAP = 5 * 60 * 1e3; const _sfc_main$6 = vue.defineComponent({ __name: "ChatWindow", props: { "open": { type: Boolean, ...{ default: false } }, "openModifiers": {} }, emits: ["update:open"], setup(__props) { const open = vue.useModel(__props, "open"); const store = useTransferStore(); const filesOpen = vue.ref(false); const pairOpen = vue.ref(false); const aboutOpen = vue.ref(false); const sendText = vue.ref(""); const imgCopy = vue.ref(null); const previewOpen = vue.ref(false); const previewIndex = vue.ref(0); const scroller = vue.ref(null); const messages = vue.computed( () => store.value.sessions.reduce((acc, s) => acc.concat(s.messages), []).sort((a, b) => a.ts - b.ts) ); const sendable = vue.computed(() => store.value.phones.length > 0); const onlineCount = vue.computed(() => store.value.phones.length); const sending = vue.computed(() => messages.value.some((m) => m.sendState === "sending")); const imageMessages = vue.computed(() => messages.value.filter((m) => m.type === "image")); const imageUrls = vue.computed(() => imageMessages.value.map((m) => m.previewUrl)); const imageNames = vue.computed(() => imageMessages.value.map((m, i) => downloadFileName(m.name, m.mime, i))); function uiOf(sepText) { return { header: sepText ? "justify-center" : "hidden" }; } function payloadOfRow(msg, imageIndex) { var _a2; const mine = msg.direction === "out"; return { type: msg.type, mine, text: msg.text || "", name: msg.name || "", mime: msg.mime || "", sizeText: msg.blob ? Math.max(1, Math.round(msg.blob.size / 1024)) + " KB" : "", imageSrc: msg.previewUrl || "", progress: msg.sendState === "sending" ? (_a2 = msg.sendProgress) != null ? _a2 : null : null, error: msg.sendState === "failed" ? msg.sendError || "" : "", clickable: msg.type === "image", canDownload: !!msg.blob, imageActions: msg.type === "image" ? [ { label: "复制", tooltip: "复制", icon: imgCopy.value && imgCopy.value.id === msg.id && imgCopy.value.state === "ok" ? "i-lucide-check" : "i-lucide-copy", onClick: () => doCopy(msg) }, { label: "下载", icon: "i-lucide-download", onClick: () => doDownload(msg, imageIndex) }, { label: "删除", icon: "i-lucide-trash", danger: true, onClick: () => removeTransferMessage(msg.sessionKey, msg.id) } ] : [] }; } const chatRows = vue.computed( () => messages.value.map((msg, i) => { const prev = i > 0 ? messages.value[i - 1] : void 0; const sepText = !prev || msg.ts - prev.ts > TIME_GAP ? sepTimeText(msg.ts) : ""; const imageIndex = msg.type === "image" ? imageMessages.value.findIndex((m) => m.id === msg.id) : -1; const mine = msg.direction === "out"; const peerText = !mine && msg.type === "text"; return { msg, sepText, imageIndex, payload: payloadOfRow(msg, imageIndex), message: { id: msg.id, role: mine ? "user" : "assistant", parts: [{ type: "text", text: previewText(msg) }], ui: uiOf(sepText), actions: peerText ? [ { label: "复制", icon: "i-lucide-copy", onClick: () => copyPeerText(msg) } ] : [], "data-znhd": "chat-bubble", "data-side": mine ? "end" : "start", "data-mine": mine ? "true" : "false" } }; }) ); const uiMessages = vue.computed(() => chatRows.value.map((r) => r.message)); const rowById = vue.computed(() => { const map = new Map(); for (const row of chatRows.value) map.set(row.msg.id, row); return map; }); const EMPTY_PAYLOAD = { type: "text", mine: false }; function payloadOf(id) { var _a2, _b; return (_b = (_a2 = rowById.value.get(id)) == null ? void 0 : _a2.payload) != null ? _b : EMPTY_PAYLOAD; } function sepOf(id) { var _a2, _b; return (_b = (_a2 = rowById.value.get(id)) == null ? void 0 : _a2.sepText) != null ? _b : ""; } const assistantProps = { side: "left", variant: "outline", avatar: { icon: "i-lucide-bot" }, actions: [{ label: "复制", icon: "i-lucide-copy" }] }; vue.watch(open, (v) => setTransferWindowOpen(v), { immediate: true }); vue.onBeforeUnmount(() => { setTransferWindowOpen(false); }); vue.watch( open, (v) => { if (!v) return; setActiveSession(PHONE_SESSION_KEY); store.value.sessions.forEach((s) => markSessionRead(s.key)); vue.nextTick(scrollToEnd); }, { immediate: true } ); vue.watch( () => messages.value.length, () => { if (open.value) vue.nextTick(scrollToEnd); } ); vue.onMounted(() => { const healed = healStaleSending(); if (healed) addLog("[传输助手] " + healed + " 条消息发送超时,已标记为失败", "error"); }); function scrollToEnd() { const el = scroller.value; if (el) el.scrollTop = el.scrollHeight; } function doSendText() { const t = sendText.value.trim(); if (!t) return; if (sendTextToSession(PHONE_SESSION_KEY, t)) { sendText.value = ""; scrollToEnd(); } } function pickFilesInto(accept, apply) { const inp = document.createElement("input"); inp.type = "file"; inp.accept = accept; inp.multiple = true; inp.style.display = "none"; document.body.appendChild(inp); const cleanupFocus = () => { window.removeEventListener("focus", cleanupFocus); try { inp.remove(); } catch (e) { } }; inp.onchange = () => { const files = Array.prototype.slice.call(inp.files || []); window.removeEventListener("focus", cleanupFocus); inp.remove(); if (files.length) apply(files); }; window.addEventListener("focus", cleanupFocus); inp.click(); } function canPickAttach() { if (!sendable.value) { toast.error("当前没有在线设备:先在手机上打开传输助手,再回来选文件"); addLog("[传输助手] 当前无在线设备,无法发送", "error", true); return false; } if (sending.value) { toast.warning("上一条还在发送中,稍等一下再选"); return false; } return true; } function pickImages() { if (!canPickAttach()) return; pickFilesInto("image/*", (files) => { const list = files.map((f) => ({ file: f, name: f.name || "image.jpg", mime: f.type || "image/jpeg", url: URL.createObjectURL(f) })); if (sendImagesToSession(PHONE_SESSION_KEY, list)) scrollToEnd(); }); } function pickFiles() { if (!canPickAttach()) return; pickFilesInto("", (files) => { const list = files.map((f) => ({ file: f, name: f.name || "file.bin", mime: f.type || "application/octet-stream", url: URL.createObjectURL(f) })); if (sendFilesToSession(PHONE_SESSION_KEY, list)) scrollToEnd(); }); } function doCopy(msg) { imgCopy.value = { id: msg.id, state: "busy" }; copyImageToClipboard(msg.blob).then((ok) => { imgCopy.value = { id: msg.id, state: ok ? "ok" : "fail" }; if (ok) addLog("图片已复制到剪贴板: " + (msg.name || ""), "success"); window.setTimeout(() => imgCopy.value = null, 1500); }); } function copyPeerText(msg) { safeCopyText(msg.text || ""); } function saveBlob(blob, name) { if (!blob) return; const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = name; document.body.appendChild(a); a.click(); a.remove(); window.setTimeout(() => URL.revokeObjectURL(a.href), 1e3); } function doDownload(msg, idx) { const fname = downloadFileName(msg.name, msg.mime, idx); saveBlob(msg.blob, fname); addLog("图片已下载: " + fname, "success"); } function doDownloadFile(msg) { const fname = msg.name || "file.bin"; saveBlob(msg.blob, fname); addLog("文件已下载: " + fname, "success"); } function openPreview(msg) { const at = imageMessages.value.findIndex((m) => m.id === msg.id); previewIndex.value = at >= 0 ? at : 0; previewOpen.value = true; } function onPreview(id) { const row = rowById.value.get(id); if (row) openPreview(row.msg); } function onDownload(id) { const row = rowById.value.get(id); if (!row) return; if (row.msg.type === "file") doDownloadFile(row.msg); else doDownload(row.msg, row.imageIndex); } function clearAll() { store.value.sessions.forEach((s) => clearTransferSession(s.key)); addLog("[传输助手] 已清空聊天记录", "success"); } const attachActions = vue.computed(() => [ { key: "image", label: "图片", icon: "i-lucide-image", onClick: pickImages }, { key: "file", label: "文件", icon: "i-lucide-paperclip", onClick: pickFiles } ]); const headerText = vue.computed(() => onlineCount.value ? "已连接 " + onlineCount.value + " 台设备" : "未连接设备"); const moreItems = vue.computed(() => [ { label: "关于", icon: "i-lucide-info", onSelect: () => { aboutOpen.value = true; } } ]); const footerHint = vue.computed(() => sendable.value ? "" : "当前没有在线手机,发出去的消息会在设备上线后自动送达"); const winContent = { style: { width: "768px", maxWidth: "94vw", height: "672px", maxHeight: "calc(100vh - 96px)" } }; return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.createVNode(_sfc_main$w, { open: open.value, "onUpdate:open": _cache[4] || (_cache[4] = ($event) => open.value = $event), title: "传输助手", "unmount-on-hide": false, content: winContent }, { content: vue.withCtx(() => [ vue.createElementVNode("div", { "data-znhd": "dialog", "data-state": open.value ? "open" : "closed", class: "flex min-h-0 w-full flex-1 flex-col overflow-hidden p-0" }, [ vue.createElementVNode("div", _hoisted_2$2, [ vue.createElementVNode("div", _hoisted_3$2, [ _cache[9] || (_cache[9] = vue.createElementVNode("h3", { class: "truncate text-lg font-bold" }, "传输助手", -1)), vue.createElementVNode("span", _hoisted_4$2, vue.toDisplayString(headerText.value), 1) ]), vue.createElementVNode("div", _hoisted_5$2, [ vue.createVNode(_sfc_main$z, { text: "清空聊天记录" }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, { icon: "i-lucide-refresh-cw", size: "md", color: "primary", variant: "ghost", "aria-label": "清空聊天记录", disabled: !chatRows.value.length, onClick: clearAll }, null, 8, ["disabled"]) ]), _: 1 }), vue.createVNode(_sfc_main$z, { text: "全部文件" }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, { icon: "i-lucide-files", size: "md", color: "primary", variant: "ghost", "aria-label": "全部文件", title: "全部文件", onClick: _cache[0] || (_cache[0] = ($event) => filesOpen.value = true) }) ]), _: 1 }), vue.createVNode(_sfc_main$z, { text: "扫码连接手机" }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, { icon: "i-lucide-qr-code", size: "md", color: "primary", variant: "ghost", "aria-label": "扫码连接手机", title: "扫码连接手机", onClick: _cache[1] || (_cache[1] = ($event) => pairOpen.value = true) }) ]), _: 1 }), vue.createVNode(_sfc_main$z, { text: "更多" }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$d, { items: moreItems.value, content: { align: "end" } }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, { icon: "i-lucide-ellipsis", size: "md", color: "primary", variant: "ghost", "aria-label": "更多", title: "更多" }) ]), _: 1 }, 8, ["items"]) ]), _: 1 }), vue.createVNode(_sfc_main$z, { text: "关闭" }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, { icon: "i-lucide-x", size: "md", color: "primary", variant: "ghost", "aria-label": "关闭", title: "关闭", onClick: _cache[2] || (_cache[2] = ($event) => open.value = false) }) ]), _: 1 }) ]) ]), vue.createElementVNode("div", { ref_key: "scroller", ref: scroller, "data-znhd": "chat-scroller", class: "min-h-0 flex-1 overflow-y-auto p-6" }, [ vue.createVNode(_sfc_main$f, { messages: uiMessages.value, assistant: assistantProps, "auto-scroll": false, class: "gap-0 px-0" }, { header: vue.withCtx(({ message }) => [ sepOf(message.id) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$1, vue.toDisplayString(sepOf(message.id)), 1)) : vue.createCommentVNode("", true) ]), content: vue.withCtx(({ message }) => [ vue.createVNode(_sfc_main$c, vue.mergeProps(payloadOf(message.id), { onPreview: ($event) => onPreview(message.id), onDownload: ($event) => onDownload(message.id) }), null, 16, ["onPreview", "onDownload"]) ]), _: 1 }, 8, ["messages"]) ], 512), vue.createElementVNode("div", _hoisted_7$1, [ vue.createElementVNode("form", { onSubmit: vue.withModifiers(doSendText, ["prevent"]) }, [ vue.createVNode(_sfc_main$b, { modelValue: sendText.value, "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => sendText.value = $event), placeholder: "输入要发送到手机的文本…", attach: attachActions.value, onSend: doSendText }, null, 8, ["modelValue", "attach"]) ], 32), footerHint.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$1, vue.toDisplayString(footerHint.value), 1)) : vue.createCommentVNode("", true) ]) ], 8, _hoisted_1$3) ]), _: 1 }, 8, ["open"]), vue.createVNode(_sfc_main$v, { open: filesOpen.value, "onUpdate:open": _cache[5] || (_cache[5] = ($event) => filesOpen.value = $event), variant: "plain", title: "文件", width: 780, description: "本次会话的全部图片 / 文件 / 文本" }, { default: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_9$1, [ vue.createVNode(_sfc_main$a, { messages: messages.value, "scope-label": "全部文件", "clear-scope": clearAll }, null, 8, ["messages"]) ]) ]), _: 1 }, 8, ["open"]), vue.createVNode(_sfc_main$8, { open: pairOpen.value, "onUpdate:open": _cache[6] || (_cache[6] = ($event) => pairOpen.value = $event), "relay-server": vue.unref(store).settings.relayServer, phones: vue.unref(store).phones }, null, 8, ["open", "relay-server", "phones"]), vue.createVNode(_sfc_main$7, { open: aboutOpen.value, "onUpdate:open": _cache[7] || (_cache[7] = ($event) => aboutOpen.value = $event) }, null, 8, ["open"]), vue.createVNode(_sfc_main$i, { open: previewOpen.value, "onUpdate:open": _cache[8] || (_cache[8] = ($event) => previewOpen.value = $event), items: imageUrls.value, index: previewIndex.value, names: imageNames.value }, null, 8, ["open", "items", "index", "names"]) ], 64); }; } }); const _sfc_main$5 = vue.defineComponent({ __name: "DialogHost", setup(__props) { const busDialogOpen = dialogOpen; bindToast(useToast()); const orgPickOpen = vue.computed(() => { var _a2, _b; return ((_b = (_a2 = orgPickRules.value) == null ? void 0 : _a2.length) != null ? _b : 0) > 0; }); function closeOrgPick() { orgPickRules.value = null; } function onOrgPick(rule) { var _a2; (_a2 = orgPickSender.value) == null ? void 0 : _a2.call(orgPickSender, rule); closeOrgPick(); } const allvalue = vue.ref(runtime$1.init); const voiceEnabled$1 = vue.computed(() => !!allvalue.value.voiceEnabled); const logOpen = vue.ref(false); const logEntries = vue.ref([]); const phrasesData = vue.ref({ all: [], mine: [] }); const phrasesLoading = vue.ref(false); const searchKeyword = vue.ref(""); let phrasesRequestSeq = 0; const VERSION = GM_info.script.version; let offAutoOpen = null; function patchAllvalue(kv) { const next = { ...loadAllvalue(), ...kv }; allvalue.value = next; saveAllvalue(next); runtime$1.voiceEnabled = next.voiceEnabled; runtime$1.workingHours = next.workingHours; runtime$1.useCdn = !!next.useCdn; runtime$1.logAutoRefresh = !!next.logAutoRefresh; } function toggleVoice(next) { patchAllvalue({ voiceEnabled: next }); addLog("语音播报已" + (next ? "开启" : "静音"), "info"); if (next && "speechSynthesis" in window) { window.speechSynthesis.speak(new SpeechSynthesisUtterance("")); resetWaitCountBaseline(); } else if (!next) { clearSpeechQueue(); } } vue.watch(voiceEnabled$1, (v) => voiceEnabled.value = v, { immediate: true }); voiceToggler.value = toggleVoice; function loadPhrasesData(force = false) { if (!force) { const cache = loadPhrasesCache(); if (cache && cache.data) { phrasesData.value = cache.data; const mins = Math.round((Date.now() - cache.time) / 6e4); addLog("常用语使用本地缓存(" + mins + " 分钟前抓取),如需更新请点侧边栏刷新按钮", "info"); return; } } const seq = ++phrasesRequestSeq; phrasesLoading.value = true; readPhrasesFromZnhd().then((data) => { if (seq !== phrasesRequestSeq) return; phrasesData.value = data; savePhrasesCache(data); const total = data.all.length + data.mine.length; addLog( "常用语抓取成功:全部话术 " + data.all.length + " 条、我的话术 " + data.mine.length + " 条", "success" ); toast.success("常用语抓取成功(共 " + total + " 条)"); }).catch((error) => { if (seq !== phrasesRequestSeq) return; const hasOld = phrasesData.value.all.length + phrasesData.value.mine.length > 0; const reason = (error == null ? void 0 : error.message) || "未知错误"; addLog("常用语抓取失败: " + reason + (hasOld ? ",仍显示上次内容" : ""), "error", true); toast.error("常用语抓取失败:" + reason + (hasOld ? ",仍显示上次内容" : "")); }).finally(() => { if (seq === phrasesRequestSeq) phrasesLoading.value = false; }); } vue.watch( () => busDialogOpen.phrases, (open) => { if (open) loadPhrasesData(); } ); vue.onMounted(() => { setLogEntriesSink((updater) => logEntries.value = updater(logEntries.value)); initTransfer(); offAutoOpen = onTransferAutoOpen(() => busDialogOpen.transfer = true); addLog("脚本已启动,版本 v" + (VERSION || "?"), "success"); const wh = allvalue.value.workingHours || runtime$1.workingHours; if (wh) { addLog( "监控时间段:上午 " + hoursToHHmm(wh.morningStart) + "-" + hoursToHHmm(wh.morningEnd) + ",下午 " + hoursToHHmm(wh.afternoonStart) + "-" + hoursToHHmm(wh.afternoonEnd), "info" ); } addLog("语音播报:" + (runtime$1.voiceEnabled ? "已开启" : "已静音"), "info"); }); vue.onBeforeUnmount(() => { setLogEntriesSink(null); offAutoOpen == null ? void 0 : offAutoOpen(); offAutoOpen = null; stopTransfer(); }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.createVNode(_sfc_main$r, { open: vue.unref(busDialogOpen).settings, "onUpdate:open": _cache[0] || (_cache[0] = ($event) => vue.unref(busDialogOpen).settings = $event), "working-hours": allvalue.value.workingHours, "use-cdn": !!allvalue.value.useCdn, "sniff-pre-measure": allvalue.value.sniffPreMeasure !== false, onChangeWorkingHours: _cache[1] || (_cache[1] = (wh) => { patchAllvalue({ workingHours: wh }); vue.unref(addLog)( "监控时间段已更新:上午 " + vue.unref(hoursToHHmm)(wh.morningStart) + "-" + vue.unref(hoursToHHmm)(wh.morningEnd) + ",下午 " + vue.unref(hoursToHHmm)(wh.afternoonStart) + "-" + vue.unref(hoursToHHmm)(wh.afternoonEnd), "info" ); }), onChangeUseCdn: _cache[2] || (_cache[2] = (v) => { patchAllvalue({ useCdn: !!v }); vue.unref(addLog)("CDN 加速已" + (v ? "开启" : "关闭"), "info"); }), onChangeSniffPreMeasure: _cache[3] || (_cache[3] = (v) => { patchAllvalue({ sniffPreMeasure: !!v }); vue.unref(addLog)("图片嗅探:后台预测量已" + (v ? "开启" : "关闭"), "info"); }), onOpenLog: _cache[4] || (_cache[4] = ($event) => logOpen.value = true) }, null, 8, ["open", "working-hours", "use-cdn", "sniff-pre-measure"]), vue.createVNode(_sfc_main$m, { open: vue.unref(busDialogOpen).phrases, "onUpdate:open": _cache[5] || (_cache[5] = ($event) => vue.unref(busDialogOpen).phrases = $event), "search-keyword": searchKeyword.value, "onUpdate:searchKeyword": _cache[6] || (_cache[6] = ($event) => searchKeyword.value = $event), "phrases-data": phrasesData.value, "phrases-loading": phrasesLoading.value, onReload: loadPhrasesData }, null, 8, ["open", "search-keyword", "phrases-data", "phrases-loading"]), vue.createVNode(_sfc_main$l, { open: logOpen.value, "onUpdate:open": _cache[7] || (_cache[7] = ($event) => logOpen.value = $event), "log-entries": logEntries.value, "auto-refresh": !!allvalue.value.logAutoRefresh, onClear: vue.unref(clearLogs), "onUpdate:autoRefresh": _cache[8] || (_cache[8] = (v) => patchAllvalue({ logAutoRefresh: v })) }, null, 8, ["open", "log-entries", "auto-refresh", "onClear"]), vue.createVNode(_sfc_main$6, { open: vue.unref(busDialogOpen).transfer, "onUpdate:open": _cache[9] || (_cache[9] = ($event) => vue.unref(busDialogOpen).transfer = $event) }, null, 8, ["open"]), vue.createVNode(_sfc_main$q, { open: orgPickOpen.value, matched: vue.unref(orgPickRules) || [], "onUpdate:open": _cache[10] || (_cache[10] = (v) => { if (!v) closeOrgPick(); }), onPick: onOrgPick }, null, 8, ["open", "matched"]), vue.createVNode(_sfc_main$h, { open: vue.unref(busDialogOpen).sniff, "onUpdate:open": _cache[11] || (_cache[11] = ($event) => vue.unref(busDialogOpen).sniff = $event), "min-kb": (_a2 = allvalue.value.sniffMinKB) != null ? _a2 : 20, "onUpdate:minKb": _cache[12] || (_cache[12] = (kb) => { patchAllvalue({ sniffMinKB: kb }); vue.unref(addLog)("图片嗅探:只列出 ≥ " + kb + " KB 的图片", "info"); }) }, null, 8, ["open", "min-kb"]) ], 64); }; } }); const _hoisted_1$2 = { class: "font-sans text-sm leading-normal text-left antialiased text-default" }; const _sfc_main$4 = vue.defineComponent({ __name: "App", setup(__props) { const toaster = { position: "top-center", max: 3 }; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(_sfc_main$M, { portal: vue.unref(getOverlayRoot)(), toaster }, { default: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_1$2, [ vue.createVNode(_sfc_main$5) ]) ]), _: 1 }, 8, ["portal"]); }; } }); function registerTailwindProperties(styleEl) { var _a2, _b; const re2 = /@property\s+(--[\w-]+)\s*\{([^}]*)\}/g; let m; while ((m = re2.exec((_a2 = styleEl.textContent) != null ? _a2 : "")) !== null) { const [, name, body] = m; const pick = (key) => { const hit = new RegExp(key + "\\s*:\\s*([^;}]+)").exec(body); return hit ? hit[1].trim() : void 0; }; try { CSS.registerProperty({ name, syntax: ((_b = pick("syntax")) != null ? _b : "*").replace(/^["']+|["']+$/g, ""), inherits: pick("inherits") === "true", initialValue: pick("initial-value") }); } catch { } } } let app$3 = null; function mountPanel() { const existing = document.getElementById(PANEL_HOST_ID); if (existing) return existing; const host2 = document.createElement("div"); host2.id = PANEL_HOST_ID; host2.style.cssText = "position:fixed;z-index:999999;left:0;top:0;margin:0;padding:0;"; for (const [k, v] of [ ["background", "none"], ["background-color", "transparent"], ["border", "0"], ["box-shadow", "none"], ["outline", "none"], ["border-radius", "0"], ["filter", "none"], ["backdrop-filter", "none"], ["text-shadow", "none"] ]) { host2.style.setProperty(k, v, "important"); } document.documentElement.appendChild(host2); const shadowRoot = host2.attachShadow({ mode: "open" }); setShadowRoot(shadowRoot); const style = document.createElement("style"); style.textContent = css; registerTailwindProperties(style); shadowRoot.appendChild(style); const appContainer = document.createElement("div"); appContainer.id = "app"; appContainer.style.setProperty("background-color", "transparent", "important"); shadowRoot.appendChild(appContainer); getOverlayRoot(); app$3 = vue.createApp({ render: () => vue.h(_sfc_main$4) }); app$3.provide(SHADOW_ROOT_KEY, shadowRoot); app$3.use(ui); app$3.mount(appContainer); return host2; } function unmountPanel() { var _a2; try { app$3 == null ? void 0 : app$3.unmount(); } catch { } app$3 = null; setShadowRoot(null); (_a2 = document.getElementById(PANEL_HOST_ID)) == null ? void 0 : _a2.remove(); } let watcher = null; function watchPanelHost() { if (watcher) return; let pending2 = false; watcher = new MutationObserver(() => { if (pending2) return; pending2 = true; queueMicrotask(() => { var _a2; pending2 = false; if (!((_a2 = document.getElementById(PANEL_HOST_ID)) == null ? void 0 : _a2.isConnected)) { unmountPanel(); mountPanel(); } }); }); watcher.observe(document.documentElement, { childList: true }); } function unwatchPanelHost() { watcher == null ? void 0 : watcher.disconnect(); watcher = null; } const _hoisted_1$1 = { class: "flex items-center gap-0.5" }; const _hoisted_2$1 = { class: "relative flex cursor-pointer items-center gap-1", title: "语音播报开关" }; const _hoisted_3$1 = ["checked"]; const _hoisted_4$1 = ["title", "onClick"]; const _hoisted_5$1 = { class: "rounded-md bg-white/15 px-1.5 py-0.5 text-[11px] leading-4 text-white/90", title: "脚本版本" }; const _sfc_main$3 = vue.defineComponent({ __name: "NavBarControls", setup(__props) { const VERSION = vue.ref(GM_info.script.version); const ACTIONS = [ { key: "settings", icon: "i-lucide-settings", label: "设置" }, { key: "phrases", icon: "i-lucide-message-circle", label: "常用语" }, { key: "transfer", icon: "i-lucide-send", label: "传输助手" }, { key: "sniff", icon: "i-lucide-image", label: "图片嗅探" } ]; function open(key) { dialogOpen[key] = true; } function onVoiceToggle(event) { voiceToggler.value(event.target.checked); } return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [ _cache[0] || (_cache[0] = vue.createElementVNode("span", { class: "mr-1.5 block h-5 w-px bg-white/25" }, null, -1)), vue.createElementVNode("label", _hoisted_2$1, [ vue.createElementVNode("span", { class: vue.normalizeClass(vue.unref(voiceEnabled) ? "text-white" : "text-white/50") }, [ vue.createVNode(_sfc_main$L, { name: vue.unref(voiceEnabled) ? "i-lucide-volume-2" : "i-lucide-volume-x", size: 16 }, null, 8, ["name"]) ], 2), vue.createElementVNode("input", { type: "checkbox", class: "peer sr-only", checked: vue.unref(voiceEnabled), onChange: onVoiceToggle }, null, 40, _hoisted_3$1), vue.createElementVNode("span", { class: vue.normalizeClass(["relative block h-4 w-8 rounded-full transition-colors", vue.unref(voiceEnabled) ? "bg-white/90" : "bg-white/30"]) }, [ vue.createElementVNode("span", { class: vue.normalizeClass(["absolute left-0.5 top-1/2 mt-[-6px] block size-3 rounded-full transition-transform", vue.unref(voiceEnabled) ? "translate-x-4 bg-primary" : "bg-white"]) }, null, 2) ], 2) ]), _cache[1] || (_cache[1] = vue.createElementVNode("span", { class: "mx-1 block h-5 w-px bg-white/25" }, null, -1)), (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(ACTIONS, (a) => { return vue.createElementVNode("button", { key: a.key, type: "button", title: a.label, class: "grid size-8 cursor-pointer place-items-center rounded-md text-white/90 hover:bg-white/20 active:bg-white/30", onClick: ($event) => open(a.key) }, [ vue.createVNode(_sfc_main$L, { name: a.icon, size: 17 }, null, 8, ["name"]) ], 8, _hoisted_4$1); }), 64)), _cache[2] || (_cache[2] = vue.createElementVNode("span", { class: "mx-1 block h-5 w-px bg-white/25" }, null, -1)), vue.createElementVNode("span", _hoisted_5$1, " v" + vue.toDisplayString(VERSION.value), 1) ]); }; } }); const NAV_HOST_ID = "__znhd_nav_host__"; const NAV_MENU = ".nav-bar-main"; const POLL_MS = 1e3; let app$2 = null; let timer = null; function hostVisible(host2) { const r = host2.getBoundingClientRect(); return r.width > 0 && r.height > 0 && r.left >= -1 && r.right <= window.innerWidth + 1; } function unmountHost$1() { var _a2; try { app$2 == null ? void 0 : app$2.unmount(); } catch { } app$2 = null; (_a2 = document.getElementById(NAV_HOST_ID)) == null ? void 0 : _a2.remove(); } function mountInto$1(parent) { const host2 = document.createElement("div"); host2.id = NAV_HOST_ID; host2.style.cssText = "display:inline-flex;align-items:center;align-self:center;vertical-align:middle;margin:0 0 0 10px;padding:0;background:none;border:0;box-shadow:none;outline:none;border-radius:0;"; parent.appendChild(host2); const shadowRoot = host2.attachShadow({ mode: "open" }); const style = document.createElement("style"); style.textContent = css; registerTailwindProperties(style); shadowRoot.appendChild(style); const container = document.createElement("div"); container.id = "app"; container.style.setProperty("background-color", "transparent", "important"); shadowRoot.appendChild(container); app$2 = vue.createApp({ render: () => vue.h(_sfc_main$3) }); app$2.mount(container); return host2; } function tryMount$1() { var _a2, _b; if ((_a2 = document.getElementById(NAV_HOST_ID)) == null ? void 0 : _a2.isConnected) return true; unmountHost$1(); const menu = document.querySelector(NAV_MENU); if (!menu) return false; const primary = mountInto$1((_b = menu.parentElement) != null ? _b : menu); if (hostVisible(primary)) return true; unmountHost$1(); const fallback = mountInto$1(menu); if (hostVisible(fallback)) return true; unmountHost$1(); return false; } function startNavBarAutoMount() { if (timer !== null) return; tryMount$1(); timer = setInterval(tryMount$1, POLL_MS); } function stopNavBarAutoMount() { if (timer !== null) clearInterval(timer); timer = null; unmountHost$1(); } const _hoisted_1 = { key: 0, "data-znhd": "quick-reply-bar", class: "flex flex-col gap-0.5 py-1" }; const _hoisted_2 = { key: 0, class: "flex items-center gap-2" }; const _hoisted_3 = { class: "flex shrink-0 items-center gap-1 text-[12px] text-warning" }; const _hoisted_4 = { class: "flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto pb-0.5", style: { "scrollbar-width": "thin" } }; const _hoisted_5 = { key: 0, class: "h-4 w-px shrink-0 bg-accented" }; const _hoisted_6 = { key: 1, class: "flex items-center gap-2" }; const _hoisted_7 = { class: "flex shrink-0 items-center gap-1 text-[12px] text-dimmed" }; const _hoisted_8 = { class: "flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto pb-0.5", style: { "scrollbar-width": "thin" } }; const _hoisted_9 = { key: 0, class: "h-4 w-px shrink-0 bg-accented" }; const _sfc_main$2 = vue.defineComponent({ __name: "QuickBar", props: { pinned: {}, rules: {}, privacyPinned: {}, privacy: {} }, emits: ["pick"], setup(__props, { emit: __emit }) { const props = __props; const emit2 = __emit; function onClick(rule) { emit2("pick", rule); } return (_ctx, _cache) => { return props.pinned.length || props.rules.length || props.privacyPinned.length || props.privacy.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ props.privacyPinned.length || props.privacy.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [ vue.createElementVNode("span", _hoisted_3, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-lock", size: 13 }), _cache[0] || (_cache[0] = vue.createTextVNode(" 隐私信息 ", -1)) ]), vue.createElementVNode("div", _hoisted_4, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.privacyPinned, (rule) => { return vue.openBlock(), vue.createBlock(_sfc_main$G, { key: rule.id, "data-znhd": "quick-reply-privacy-btn", type: "button", variant: "outline", color: "neutral", size: "xs", class: "shrink-0 rounded-md font-normal hover:border-warning hover:bg-warning/10 hover:text-warning", title: "(常显)" + rule.reply, onClick: ($event) => onClick(rule) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(rule.title), 1) ]), _: 2 }, 1032, ["title", "onClick"]); }), 128)), props.privacyPinned.length && props.privacy.length ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5)) : vue.createCommentVNode("", true), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.privacy, (rule) => { return vue.openBlock(), vue.createBlock(_sfc_main$G, { key: rule.id, "data-znhd": "quick-reply-privacy-btn", type: "button", variant: "outline", color: "neutral", size: "xs", class: "shrink-0 rounded-md font-normal hover:border-warning hover:bg-warning/10 hover:text-warning", title: rule.reply, onClick: ($event) => onClick(rule) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(rule.title), 1) ]), _: 2 }, 1032, ["title", "onClick"]); }), 128)) ]) ])) : vue.createCommentVNode("", true), props.pinned.length || props.rules.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [ vue.createElementVNode("span", _hoisted_7, [ vue.createVNode(_sfc_main$L, { name: "i-lucide-message-circle", size: 13 }), _cache[1] || (_cache[1] = vue.createTextVNode(" 快捷短语 ", -1)) ]), vue.createElementVNode("div", _hoisted_8, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.pinned, (rule) => { return vue.openBlock(), vue.createBlock(_sfc_main$G, { key: rule.id, "data-znhd": "quick-reply-btn", type: "button", variant: "outline", color: "neutral", size: "xs", class: "shrink-0 rounded-md font-normal hover:border-primary hover:bg-primary/10 hover:text-primary", title: "(常显)" + rule.reply, onClick: ($event) => onClick(rule) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(rule.title), 1) ]), _: 2 }, 1032, ["title", "onClick"]); }), 128)), props.pinned.length && props.rules.length ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9)) : vue.createCommentVNode("", true), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.rules, (rule) => { return vue.openBlock(), vue.createBlock(_sfc_main$G, { key: rule.id, "data-znhd": "quick-reply-btn", type: "button", variant: "outline", color: "neutral", size: "xs", class: "shrink-0 rounded-md font-normal hover:border-primary hover:bg-primary/10 hover:text-primary", title: rule.reply, onClick: ($event) => onClick(rule) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(rule.title), 1) ]), _: 2 }, 1032, ["title", "onClick"]); }), 128)) ]) ])) : vue.createCommentVNode("", true) ])) : vue.createCommentVNode("", true); }; } }); const HOST_ID = "__znhd_quick_reply_host__"; const INPUT_SEL = ".input-tinymce"; const MOUNT_POLL_MS = 1e3; const MATCH_POLL_MS = 3e3; const hits = vue.ref([]); const pinnedHits = vue.ref([]); const privacyPinnedHits = vue.ref([]); const privacyHits = vue.ref([]); let app$1 = null; let mountTimer = null; let matchTimer = null; let lastFingerprint = ""; let pinnedFingerprint = ""; let privacyPinnedFingerprint = ""; let rulesCopy = []; let rulesStamp = 0; let rulesRetryAt = 0; const RULES_RETRY_MS = 60 * 1e3; let privacyRulesCopy = []; let privacyStamp = 0; let privacyRetryAt = 0; function fingerprint(text) { return text.length + "|" + text.slice(0, 8) + "|" + text.slice(-8); } function syncRulesFromCache() { var _a2; const cache = loadRulesCache(); const stamp = (cache == null ? void 0 : cache.fetchedAt) || 0; if (stamp === rulesStamp) return; rulesStamp = stamp; rulesCopy = (_a2 = cache == null ? void 0 : cache.rules) != null ? _a2 : []; lastFingerprint = ""; pinnedFingerprint = ""; } function syncPrivacyFromCache() { var _a2; const cache = loadPrivacyRulesCache(); const stamp = (cache == null ? void 0 : cache.fetchedAt) || 0; if (stamp === privacyStamp) return; privacyStamp = stamp; privacyRulesCopy = (_a2 = cache == null ? void 0 : cache.rules) != null ? _a2 : []; privacyPinnedFingerprint = ""; lastFingerprint = ""; } async function ensureRules() { var _a2, _b, _c; if (rulesCopy.length) return; if (Date.now() < rulesRetryAt) return; try { rulesCopy = await getRules(false); rulesRetryAt = 0; } catch (e) { rulesCopy = (_b = (_a2 = loadRulesCache()) == null ? void 0 : _a2.rules) != null ? _b : []; rulesRetryAt = Date.now() + RULES_RETRY_MS; if (!rulesCopy.length) addLog("快捷回复规则不可用:" + (e == null ? void 0 : e.message), "warning"); } rulesStamp = ((_c = loadRulesCache()) == null ? void 0 : _c.fetchedAt) || 0; } async function ensurePrivacyRules() { var _a2, _b, _c; syncPrivacyFromCache(); if (privacyRulesCopy.length) return; if (Date.now() < privacyRetryAt) return; if (!getPrivacyTableUrl()) return; try { privacyRulesCopy = await getPrivacyRules(false); privacyRetryAt = 0; } catch (e) { privacyRulesCopy = (_b = (_a2 = loadPrivacyRulesCache()) == null ? void 0 : _a2.rules) != null ? _b : []; privacyRetryAt = Date.now() + RULES_RETRY_MS; if (!privacyRulesCopy.length) addLog("隐私信息读取失败:" + (e == null ? void 0 : e.message), "warning"); } privacyStamp = ((_c = loadPrivacyRulesCache()) == null ? void 0 : _c.fetchedAt) || 0; } function onPick(rule) { if (!rule.reply.trim()) { toast.error("该规则没有填写「内容」列:" + rule.title); return; } const finalText = replaceToTinyMCE(expandMagicVars(rule.reply)); if (finalText) toast.success("已填入:" + rule.title); else toast.error("输入框未就绪,请稍后重试"); } function unmountHost() { var _a2; try { app$1 == null ? void 0 : app$1.unmount(); } catch { } app$1 = null; (_a2 = document.getElementById(HOST_ID)) == null ? void 0 : _a2.remove(); } function mountInto(anchorEl) { const host2 = document.createElement("div"); host2.id = HOST_ID; host2.style.cssText = "display:block;width:100%;box-sizing:border-box;margin:0;padding:0;background:none;border:0;box-shadow:none;outline:none;border-radius:0;"; anchorEl.parentElement.insertBefore(host2, anchorEl); const shadowRoot = host2.attachShadow({ mode: "open" }); const style = document.createElement("style"); style.textContent = css; registerTailwindProperties(style); shadowRoot.appendChild(style); const container = document.createElement("div"); container.id = "app"; container.style.setProperty("background-color", "transparent", "important"); shadowRoot.appendChild(container); app$1 = vue.createApp({ render: () => vue.h(_sfc_main$2, { pinned: pinnedHits.value, rules: hits.value, privacyPinned: privacyPinnedHits.value, privacy: privacyHits.value, onPick }) }); app$1.mount(container); return host2; } function tryMount() { var _a2; if ((_a2 = document.getElementById(HOST_ID)) == null ? void 0 : _a2.isConnected) return true; unmountHost(); const anchor = findAnchor(); if (!anchor) return false; mountInto(anchor); return true; } function findAnchor() { var _a2; const inputEl = document.querySelector(INPUT_SEL); if (!inputEl) return null; const vm = inputEl.__vue__; const root = (_a2 = vm == null ? void 0 : vm.$parent) == null ? void 0 : _a2.$el; if (root instanceof HTMLElement && root.parentElement) return root; return inputEl.parentElement ? inputEl : null; } async function refreshMatches() { syncRulesFromCache(); await ensureRules(); await ensurePrivacyRules(); const pinnedNow = rulesCopy.filter((r) => r.pinned); const pinnedIds = pinnedNow.map((r) => r.id).join(","); if (pinnedIds !== pinnedFingerprint) { pinnedFingerprint = pinnedIds; pinnedHits.value = pinnedNow; } const privacyPinnedNow = privacyRulesCopy.filter((r) => r.pinned); const privacyPinnedIds = privacyPinnedNow.map((r) => r.id).join(","); if (privacyPinnedIds !== privacyPinnedFingerprint) { privacyPinnedFingerprint = privacyPinnedIds; privacyPinnedHits.value = privacyPinnedNow; } let selector = ""; try { selector = loadAllvalue()["quickReplyConversationSelector"]; } catch { } const snap = readConversation(typeof selector === "string" ? selector : ""); if (!snap.text) { if (lastFingerprint) lastFingerprint = ""; if (hits.value.length) hits.value = []; if (privacyHits.value.length) privacyHits.value = []; return; } const fp = fingerprint(snap.text) + "#" + privacyStamp; if (fp === lastFingerprint) return; lastFingerprint = fp; if (!rulesCopy.length) { if (hits.value.length) hits.value = []; lastFingerprint = ""; } else { const matched = matchRules(snap.text, rulesCopy).filter((r) => !r.pinned); const before = hits.value.map((r) => r.id).join(","); const after = matched.map((r) => r.id).join(","); if (before !== after) { hits.value = matched; if (matched.length) addLog("快捷短语命中:" + matched.map((r) => r.title).join("、"), "info"); } } const privacyMatched = privacyRulesCopy.length ? matchRules(snap.text, privacyRulesCopy).filter((r) => !r.pinned) : []; const pBefore = privacyHits.value.map((r) => r.id).join(","); const pAfter = privacyMatched.map((r) => r.id).join(","); if (pBefore !== pAfter) privacyHits.value = privacyMatched; } function startQuickReplyBar() { if (mountTimer !== null) return; tryMount(); mountTimer = setInterval(tryMount, MOUNT_POLL_MS); setTimeout(() => void refreshMatches(), 2e3); matchTimer = setInterval(() => void refreshMatches(), MATCH_POLL_MS); } function stopQuickReplyBar() { if (mountTimer !== null) clearInterval(mountTimer); if (matchTimer !== null) clearInterval(matchTimer); mountTimer = null; matchTimer = null; lastFingerprint = ""; pinnedFingerprint = ""; privacyPinnedFingerprint = ""; rulesCopy = []; rulesStamp = 0; rulesRetryAt = 0; privacyRulesCopy = []; privacyStamp = 0; privacyRetryAt = 0; hits.value = []; pinnedHits.value = []; privacyPinnedHits.value = []; privacyHits.value = []; unmountHost(); } const booted = []; let bootTried = 0; function boot(name, fn) { bootTried += 1; try { fn(); booted.push(name); } catch (error) { console.error("[监控] " + name + " 启动失败:", error); addLog(name + " 启动失败: " + ((error == null ? void 0 : error.message) || String(error)), "error"); } } const app = () => { startPerfCollect(); try { setPreMeasureEnabled(loadAllvalue().sniffPreMeasure !== false); } catch { } boot("面板挂载", () => { mountPanel(); watchPanelHost(); }); boot("导航栏注入", startNavBarAutoMount); boot("右键打印", startImageContextMenu); boot("待办提醒", startTodoBadge); boot("快捷短语", startQuickReplyBar); boot("税务机关快捷发送", startOrgSendButton); addLog("模块启动 " + booted.length + "/" + bootTried + ": " + (booted.join(" / ") || "无")); window.addEventListener("beforeunload", () => { flushSaveAllvalue(); stopMonitoring(); clearSpeechTimer(); unwatchPanelHost(); stopNavBarAutoMount(); stopImageContextMenu(); stopTodoBadge(); stopQuickReplyBar(); stopOrgSendButton(); }); if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", startMonitoring); } else { startMonitoring(); } }; app(); const theme$1 = { "slots": { "root": "gap-2", "base": "relative overflow-hidden rounded-full bg-accented", "indicator": "rounded-full size-full transition-transform duration-200 ease-out motion-reduce:transition-none motion-reduce:data-[state=indeterminate]:animate-pulse", "status": "flex text-dimmed duration-200 ease-out motion-reduce:transition-none", "steps": "grid items-end", "step": "truncate text-end row-start-1 col-start-1 transition-opacity ease-out" }, "variants": { "animation": { "carousel": "", "carousel-inverse": "", "swing": "", "elastic": "" }, "color": { "primary": { "indicator": "bg-primary", "steps": "text-primary" }, "success": { "indicator": "bg-success", "steps": "text-success" }, "info": { "indicator": "bg-info", "steps": "text-info" }, "warning": { "indicator": "bg-warning", "steps": "text-warning" }, "error": { "indicator": "bg-error", "steps": "text-error" }, "neutral": { "indicator": "bg-inverted", "steps": "text-highlighted" } }, "size": { "2xs": { "status": "text-xs", "steps": "text-xs" }, "xs": { "status": "text-xs", "steps": "text-xs" }, "sm": { "status": "text-sm", "steps": "text-sm" }, "md": { "status": "text-sm", "steps": "text-sm" }, "lg": { "status": "text-sm", "steps": "text-sm" }, "xl": { "status": "text-base", "steps": "text-base" }, "2xl": { "status": "text-base", "steps": "text-base" } }, "step": { "active": { "step": "opacity-100" }, "first": { "step": "opacity-100 text-muted" }, "other": { "step": "opacity-0" }, "last": { "step": "" } }, "orientation": { "horizontal": { "root": "w-full flex flex-col", "base": "w-full", "status": "flex-row items-center justify-end w-(--percent) min-w-fit transition-[width]" }, "vertical": { "root": "h-full flex flex-row-reverse", "base": "h-full", "status": "flex-col justify-end h-(--percent) min-h-fit transition-[height]" } }, "inverted": { "true": { "status": "self-end" } } }, "compoundVariants": [ { "inverted": true, "orientation": "horizontal", "class": { "step": "text-start", "status": "flex-row-reverse" } }, { "inverted": true, "orientation": "vertical", "class": { "steps": "items-start", "status": "flex-col-reverse" } }, { "orientation": "horizontal", "size": "2xs", "class": "h-px" }, { "orientation": "horizontal", "size": "xs", "class": "h-0.5" }, { "orientation": "horizontal", "size": "sm", "class": "h-1" }, { "orientation": "horizontal", "size": "md", "class": "h-2" }, { "orientation": "horizontal", "size": "lg", "class": "h-3" }, { "orientation": "horizontal", "size": "xl", "class": "h-4" }, { "orientation": "horizontal", "size": "2xl", "class": "h-5" }, { "orientation": "vertical", "size": "2xs", "class": "w-px" }, { "orientation": "vertical", "size": "xs", "class": "w-0.5" }, { "orientation": "vertical", "size": "sm", "class": "w-1" }, { "orientation": "vertical", "size": "md", "class": "w-2" }, { "orientation": "vertical", "size": "lg", "class": "w-3" }, { "orientation": "vertical", "size": "xl", "class": "w-4" }, { "orientation": "vertical", "size": "2xl", "class": "w-5" }, { "orientation": "horizontal", "animation": "carousel", "class": { "indicator": "motion-safe:data-[state=indeterminate]:animate-[carousel_2s_linear_infinite] motion-safe:data-[state=indeterminate]:rtl:animate-[carousel-rtl_2s_linear_infinite]" } }, { "orientation": "vertical", "animation": "carousel", "class": { "indicator": "motion-safe:data-[state=indeterminate]:animate-[carousel-vertical_2s_linear_infinite]" } }, { "orientation": "horizontal", "animation": "carousel-inverse", "class": { "indicator": "motion-safe:data-[state=indeterminate]:animate-[carousel-inverse_2s_linear_infinite] motion-safe:data-[state=indeterminate]:rtl:animate-[carousel-inverse-rtl_2s_linear_infinite]" } }, { "orientation": "vertical", "animation": "carousel-inverse", "class": { "indicator": "motion-safe:data-[state=indeterminate]:animate-[carousel-inverse-vertical_2s_linear_infinite]" } }, { "orientation": "horizontal", "animation": "swing", "class": { "indicator": "motion-safe:data-[state=indeterminate]:animate-[swing_2s_var(--ease-in-out)_infinite]" } }, { "orientation": "vertical", "animation": "swing", "class": { "indicator": "motion-safe:data-[state=indeterminate]:animate-[swing-vertical_2s_var(--ease-in-out)_infinite]" } }, { "orientation": "horizontal", "animation": "elastic", "class": { "indicator": "relative motion-safe:data-[state=indeterminate]:animate-[elastic_2s_var(--ease-in-out)_infinite]" } }, { "orientation": "vertical", "animation": "elastic", "class": { "indicator": "relative motion-safe:data-[state=indeterminate]:animate-[elastic-vertical_2s_var(--ease-in-out)_infinite]" } } ], "defaultVariants": { "animation": "carousel", "color": "primary", "size": "md" } }; const _sfc_main$1 = { __name: "Progress", props: { as: { type: null, required: false }, max: { type: [Number, Array], required: false }, status: { type: Boolean, required: false }, inverted: { type: Boolean, required: false, default: false }, size: { type: null, required: false }, color: { type: null, required: false }, orientation: { type: null, required: false, default: "horizontal" }, animation: { type: null, required: false }, class: { type: null, required: false }, ui: { type: Object, required: false }, getValueLabel: { type: Function, required: false }, getValueText: { type: Function, required: false }, modelValue: { type: [Number, null], required: false, default: null } }, emits: ["update:modelValue", "update:max"], setup(__props, { emit: __emit }) { const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("progress", _props); const { dir } = useLocale$1(); const appConfig2 = useAppConfig(); const rootProps = useForwardProps(reactivePick(props, "getValueLabel", "getValueText", "modelValue"), emits); const isIndeterminate2 = vue.computed(() => rootProps.value.modelValue === null); const hasSteps = vue.computed(() => Array.isArray(props.max)); const realMax = vue.computed(() => { if (isIndeterminate2.value || !props.max) { return void 0; } if (Array.isArray(props.max)) { return props.max.length - 1; } return Number(props.max); }); const percent = vue.computed(() => { var _a2, _b; if (isIndeterminate2.value) { return void 0; } switch (true) { case rootProps.value.modelValue < 0: return 0; case rootProps.value.modelValue > ((_a2 = realMax.value) != null ? _a2 : 100): return 100; default: return Math.round(rootProps.value.modelValue / ((_b = realMax.value) != null ? _b : 100) * 100); } }); const indicatorStyle = vue.computed(() => { if (percent.value === void 0) { return; } if (props.orientation === "vertical") { return { transform: `translateY(${props.inverted ? "" : "-"}${100 - percent.value}%)` }; } else { if (dir.value === "rtl") { return { transform: `translateX(${props.inverted ? "-" : ""}${100 - percent.value}%)` }; } else { return { transform: `translateX(${props.inverted ? "" : "-"}${100 - percent.value}%)` }; } } }); const statusStyle = vue.computed(() => { var _a2; return { "--percent": `${Math.max((_a2 = percent.value) != null ? _a2 : 0, 0)}%` }; }); function isActive(index) { return index === Number(props.modelValue); } function isFirst(index) { return index === 0; } function isLast(index) { return index === realMax.value; } function stepVariant(index) { index = Number(index); if (isActive(index) && !isFirst(index)) { return "active"; } if (isFirst(index) && isActive(index)) { return "first"; } if (isLast(index) && isActive(index)) { return "last"; } return "other"; } const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme$1, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.progress) || {} })({ animation: props.animation, size: props.size, color: props.color, orientation: props.orientation, inverted: props.inverted }); }); const themeColors = vue.computed(() => { var _a2, _b, _c, _d; return Object.keys({ ...(_a2 = theme$1.variants) == null ? void 0 : _a2.color, ...(_d = (_c = (_b = appConfig2.ui) == null ? void 0 : _b.progress) == null ? void 0 : _c.variants) == null ? void 0 : _d.color }); }); const customColor = vue.computed(() => props.color && !themeColors.value.includes(props.color) ? props.color : void 0); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(Primitive), { as: vue.unref(props).as, "data-orientation": vue.unref(props).orientation, "data-slot": "root", class: vue.normalizeClass(ui2.value.root({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.root, vue.unref(props).class] })) }, { default: vue.withCtx(() => { var _a3, _b, _c; return [ !isIndeterminate2.value && (vue.unref(props).status || !!slots.status) ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "status", class: vue.normalizeClass(ui2.value.status({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.status })), style: vue.normalizeStyle(statusStyle.value) }, [ vue.renderSlot(_ctx.$slots, "status", { percent: percent.value }, () => [ vue.createTextVNode(vue.toDisplayString(percent.value) + "% ", 1) ]) ], 6)) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(ProgressRoot_default), vue.mergeProps(vue.unref(rootProps), { max: realMax.value, "data-slot": "base", class: ui2.value.base({ class: (_b = vue.unref(props).ui) == null ? void 0 : _b.base }), style: { "transform": "translateZ(0)" } }), { default: vue.withCtx(() => { var _a4; return [ vue.createVNode(vue.unref(ProgressIndicator_default), { "data-slot": "indicator", class: vue.normalizeClass(ui2.value.indicator({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.indicator })), style: vue.normalizeStyle([indicatorStyle.value, customColor.value ? { backgroundColor: customColor.value } : void 0]) }, null, 8, ["class", "style"]) ]; }), _: 1 }, 16, ["max", "class"]), hasSteps.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, "data-slot": "steps", class: vue.normalizeClass(ui2.value.steps({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.steps })), style: vue.normalizeStyle(customColor.value ? { color: customColor.value } : void 0) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).max, (step, index) => { var _a4; return vue.openBlock(), vue.createElementBlock("div", { key: index, "data-slot": "step", class: vue.normalizeClass(ui2.value.step({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.step, step: stepVariant(index) })) }, [ vue.renderSlot(_ctx.$slots, `step-${index}`, { step }, () => [ vue.createTextVNode(vue.toDisplayString(step), 1) ]) ], 2); }), 128)) ], 6)) : vue.createCommentVNode("", true) ]; }), _: 3 }, 8, ["as", "data-orientation", "class"]); }; } }; const theme = { "slots": { "root": "relative group overflow-hidden bg-default shadow-lg rounded-lg ring ring-default p-4 flex gap-2.5", "wrapper": "w-0 flex-1 flex flex-col", "title": "text-sm font-medium text-highlighted", "description": "text-sm text-muted", "icon": "shrink-0 size-5", "avatar": "shrink-0", "avatarSize": "2xl", "actions": "flex gap-1.5 shrink-0", "progress": "absolute inset-x-0 bottom-0", "close": "p-0" }, "variants": { "color": { "primary": { "root": "outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary", "icon": "text-primary" }, "success": { "root": "outline-success/25 focus-visible:outline-3 focus-visible:ring-success", "icon": "text-success" }, "info": { "root": "outline-info/25 focus-visible:outline-3 focus-visible:ring-info", "icon": "text-info" }, "warning": { "root": "outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning", "icon": "text-warning" }, "error": { "root": "outline-error/25 focus-visible:outline-3 focus-visible:ring-error", "icon": "text-error" }, "neutral": { "root": "outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted", "icon": "text-highlighted" } }, "orientation": { "horizontal": { "root": "items-center", "actions": "items-center" }, "vertical": { "root": "items-start", "actions": "items-start mt-2.5" } }, "title": { "true": { "description": "mt-1" } } }, "defaultVariants": { "color": "primary" } }; const _sfc_main = { __name: "Toast", props: { as: { type: null, required: false }, title: { type: [String, Object, Function], required: false }, description: { type: [String, Object, Function], required: false }, icon: { type: null, required: false }, avatar: { type: Object, required: false }, color: { type: null, required: false }, orientation: { type: null, required: false, default: "vertical" }, close: { type: [Boolean, Object], required: false, default: true }, closeIcon: { type: null, required: false }, actions: { type: Array, required: false }, duration: { type: Number, required: false }, progress: { type: [Boolean, Object], required: false, default: true }, class: { type: null, required: false }, ui: { type: Object, required: false }, defaultOpen: { type: Boolean, required: false }, open: { type: Boolean, required: false }, type: { type: String, required: false } }, emits: ["escapeKeyDown", "pause", "resume", "swipeStart", "swipeMove", "swipeCancel", "swipeEnd", "update:open"], setup(__props, { expose: __expose, emit: __emit }) { const _props = __props; const emits = __emit; const slots = vue.useSlots(); const props = useComponentProps("toast", _props); const { t } = useLocale$1(); const appConfig2 = useAppConfig(); const rootProps = useForwardProps(reactivePick(props, "as", "defaultOpen", "open", "duration", "type"), emits); const ui2 = vue.computed(() => { var _a2; return tv({ extend: theme, ...((_a2 = appConfig2.ui) == null ? void 0 : _a2.toast) || {} })({ color: props.color, orientation: props.orientation, title: !!props.title || !!slots.title }); }); const rootRef = vue.useTemplateRef("rootRef"); const height = vue.ref(0); vue.onMounted(() => { var _a2, _b; if (!((_b = (_a2 = rootRef.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b.getBoundingClientRect)) { return; } height.value = rootRef.value.$el.getBoundingClientRect().height; }); __expose({ height }); return (_ctx, _cache) => { var _a2; return vue.openBlock(), vue.createBlock(vue.unref(ToastRoot_default), vue.mergeProps({ ref_key: "rootRef", ref: rootRef }, vue.unref(rootProps), { "data-orientation": vue.unref(props).orientation, "data-slot": "root", class: ui2.value.root({ class: [(_a2 = vue.unref(props).ui) == null ? void 0 : _a2.root, vue.unref(props).class] }), style: { "--height": height.value } }), { default: vue.withCtx(({ remaining, duration: totalDuration, open }) => { var _a3, _b, _c, _d, _e2, _f, _g, _h, _i; return [ vue.renderSlot(_ctx.$slots, "leading", { ui: ui2.value }, () => { var _a4, _b2, _c2; return [ vue.unref(props).avatar ? (vue.openBlock(), vue.createBlock(_sfc_main$J, vue.mergeProps({ key: 0, size: ((_a4 = vue.unref(props).ui) == null ? void 0 : _a4.avatarSize) || ui2.value.avatarSize() }, vue.unref(props).avatar, { "data-slot": "avatar", class: ui2.value.avatar({ class: (_b2 = vue.unref(props).ui) == null ? void 0 : _b2.avatar }) }), null, 16, ["size", "class"])) : vue.unref(props).icon ? (vue.openBlock(), vue.createBlock(_sfc_main$L, { key: 1, name: vue.unref(props).icon, "data-slot": "icon", class: vue.normalizeClass(ui2.value.icon({ class: (_c2 = vue.unref(props).ui) == null ? void 0 : _c2.icon })) }, null, 8, ["name", "class"])) : vue.createCommentVNode("", true) ]; }), vue.createElementVNode("div", { "data-slot": "wrapper", class: vue.normalizeClass(ui2.value.wrapper({ class: (_a3 = vue.unref(props).ui) == null ? void 0 : _a3.wrapper })) }, [ vue.unref(props).title || !!slots.title ? (vue.openBlock(), vue.createBlock(vue.unref(ToastTitle_default), { key: 0, "data-slot": "title", class: vue.normalizeClass(ui2.value.title({ class: (_b = vue.unref(props).ui) == null ? void 0 : _b.title })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "title", {}, () => [ typeof vue.unref(props).title === "function" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).title()), { key: 0 })) : typeof vue.unref(props).title === "object" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).title), { key: 1 })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).title), 1) ], 64)) ]) ]), _: 3 }, 8, ["class"])) : vue.createCommentVNode("", true), vue.unref(props).description || !!slots.description ? (vue.openBlock(), vue.createBlock(vue.unref(ToastDescription_default), { key: 1, "data-slot": "description", class: vue.normalizeClass(ui2.value.description({ class: (_c = vue.unref(props).ui) == null ? void 0 : _c.description })) }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "description", {}, () => [ typeof vue.unref(props).description === "function" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).description()), { key: 0 })) : typeof vue.unref(props).description === "object" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).description), { key: 1 })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [ vue.createTextVNode(vue.toDisplayString(vue.unref(props).description), 1) ], 64)) ]) ]), _: 3 }, 8, ["class"])) : vue.createCommentVNode("", true), vue.unref(props).orientation === "vertical" && (((_d = vue.unref(props).actions) == null ? void 0 : _d.length) || !!slots.actions) ? (vue.openBlock(), vue.createElementBlock("div", { key: 2, "data-slot": "actions", class: vue.normalizeClass(ui2.value.actions({ class: (_e2 = vue.unref(props).ui) == null ? void 0 : _e2.actions })) }, [ vue.renderSlot(_ctx.$slots, "actions", {}, () => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).actions, ({ closeOnClick, ...action }, index) => { return vue.openBlock(), vue.createBlock(vue.unref(ToastAction_default), { key: index, "alt-text": action.label || "Action", "close-on-click": closeOnClick, "as-child": "", onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => { }, ["stop"])) }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, vue.mergeProps({ size: "xs", color: vue.unref(props).color }, { ref_for: true }, action), null, 16, ["color"]) ]), _: 2 }, 1032, ["alt-text", "close-on-click"]); }), 128)) ]) ], 2)) : vue.createCommentVNode("", true) ], 2), vue.unref(props).orientation === "horizontal" && (((_f = vue.unref(props).actions) == null ? void 0 : _f.length) || !!slots.actions) || vue.unref(props).close ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, "data-slot": "actions", class: vue.normalizeClass(ui2.value.actions({ class: (_g = vue.unref(props).ui) == null ? void 0 : _g.actions, orientation: "horizontal" })) }, [ vue.unref(props).orientation === "horizontal" && (((_h = vue.unref(props).actions) == null ? void 0 : _h.length) || !!slots.actions) ? vue.renderSlot(_ctx.$slots, "actions", {}, () => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).actions, ({ closeOnClick, ...action }, index) => { return vue.openBlock(), vue.createBlock(vue.unref(ToastAction_default), { key: index, "alt-text": action.label || "Action", "close-on-click": closeOnClick, "as-child": "", onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => { }, ["stop"])) }, { default: vue.withCtx(() => [ vue.createVNode(_sfc_main$G, vue.mergeProps({ size: "xs", color: vue.unref(props).color }, { ref_for: true }, action), null, 16, ["color"]) ]), _: 2 }, 1032, ["alt-text", "close-on-click"]); }), 128)) ], void 0, 0) : vue.createCommentVNode("", true), vue.unref(props).close || !!slots.close ? (vue.openBlock(), vue.createBlock(vue.unref(ToastClose_default), { key: 1, "as-child": "" }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "close", { ui: ui2.value }, () => { var _a4; return [ vue.unref(props).close ? (vue.openBlock(), vue.createBlock(_sfc_main$G, vue.mergeProps({ key: 0, icon: vue.unref(props).closeIcon || vue.unref(appConfig2).ui.icons.close, color: "neutral", variant: "link", "aria-label": vue.unref(t)("toast.close") }, typeof vue.unref(props).close === "object" ? vue.unref(props).close : {}, { "data-slot": "close", class: ui2.value.close({ class: (_a4 = vue.unref(props).ui) == null ? void 0 : _a4.close }), onClick: _cache[2] || (_cache[2] = vue.withModifiers(() => { }, ["stop"])) }), null, 16, ["icon", "aria-label", "class"])) : vue.createCommentVNode("", true) ]; }) ]), _: 3 })) : vue.createCommentVNode("", true) ], 2)) : vue.createCommentVNode("", true), vue.unref(props).progress && open && remaining > 0 && totalDuration ? (vue.openBlock(), vue.createBlock(_sfc_main$1, vue.mergeProps({ key: 1, "model-value": remaining / totalDuration * 100, color: vue.unref(props).color }, typeof vue.unref(props).progress === "object" ? vue.unref(props).progress : {}, { size: "sm", "data-slot": "progress", class: ui2.value.progress({ class: (_i = vue.unref(props).ui) == null ? void 0 : _i.progress }) }), null, 16, ["model-value", "color", "class"])) : vue.createCommentVNode("", true) ]; }), _: 3 }, 16, ["data-orientation", "class", "style"]); }; } }; const Toast = Object.freeze( Object.defineProperty({ __proto__: null, default: _sfc_main }, Symbol.toStringTag, { value: "Module" })); })(Vue);