UNPKG

radix-vue

Version:

Vue port for Radix UI Primitives.

1,689 lines 601 kB
import * as No from "vue"; import { inject as ul, provide as dl, shallowRef as Fn, watchEffect as Ce, readonly as Wa, customRef as cl, ref as T, computed as B, watch as ee, nextTick as oe, getCurrentScope as gr, onScopeDispose as fl, effectScope as pl, unref as o, onBeforeUnmount as Nn, onMounted as le, isRef as et, reactive as Fa, getCurrentInstance as gt, onUpdated as vl, Fragment as _e, defineComponent as x, toRefs as ae, renderSlot as w, onBeforeUpdate as br, toHandlerKey as Cr, camelize as ml, toRef as wr, onUnmounted as Be, mergeProps as k, h as mt, Comment as hl, cloneVNode as Ln, openBlock as b, createBlock as S, withCtx as y, createVNode as q, createCommentVNode as ce, withKeys as ie, Teleport as qt, normalizeProps as W, guardReactiveProps as U, normalizeStyle as Me, withModifiers as ue, createElementBlock as ve, withDirectives as ja, vShow as zn, createElementVNode as Ye, toDisplayString as De, createTextVNode as ye, mergeDefaults as yl, watchPostEffect as _r, renderList as ma, markRaw as xr, watchSyncEffect as Sr, resolveDynamicComponent as Xe, toHandlers as Kn, triggerRef as Lo, useSlots as Ua, onBeforeMount as gl, vModelSelect as Er, toRaw as Pr } from "vue"; import { DateFormatter as lt, createCalendar as Dr, toCalendar as zo, CalendarDateTime as $r, CalendarDate as Br, today as Ir, getLocalTimeZone as Hn, isEqualMonth as Ko, isSameDay as Oe, isEqualDay as ke, isToday as bl, isSameMonth as Cl } from "@internationalized/date"; import { k as ia, t as ze, j as wl, d as Pt, n as Pa, m as Ke, l as Ze, o as Tr, x as _l, u as Rr, r as Ar } from "./calendar-ChFCRr4K.js"; import { useFloating as Or, autoUpdate as kr, offset as Mr, flip as Ho, shift as Vr, limitShift as Fr, size as Nr, arrow as Lr, hide as zr } from "@floating-ui/vue"; import { NumberFormatter as Kr, NumberParser as Hr } from "@internationalized/number"; function te(a, t) { const e = typeof a == "string" && !t ? `${a}Context` : t, n = Symbol(e); return [(r) => { const i = ul(n, r); if (i || i === null) return i; throw new Error( `Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(a) ? `one of the following components: ${a.join( ", " )}` : `\`${a}\``}` ); }, (r) => (dl(n, r), r)]; } function jt(a, t, e) { const n = e.originalEvent.target, l = new CustomEvent(a, { bubbles: !1, cancelable: !0, detail: e }); t && n.addEventListener(a, t, { once: !0 }), n.dispatchEvent(l); } function Ut(a, t = Number.NEGATIVE_INFINITY, e = Number.POSITIVE_INFINITY) { return Math.min(e, Math.max(t, a)); } function Da(a, t) { let e = a; const n = t.toString(), l = n.indexOf("."), s = l >= 0 ? n.length - l : 0; if (s > 0) { const r = 10 ** s; e = Math.round(e * r) / r; } return e; } function Wr(a, t, e, n) { t = Number(t), e = Number(e); const l = (a - (Number.isNaN(t) ? 0 : t)) % n; let s = Da(Math.abs(l) * 2 >= n ? a + Math.sign(l) * (n - Math.abs(l)) : a - l, n); return Number.isNaN(t) ? !Number.isNaN(e) && s > e && (s = Math.floor(Da(e / n, n)) * n) : s < t ? s = t : !Number.isNaN(e) && s > e && (s = t + Math.floor(Da((e - t) / n, n)) * n), s = Da(s, n), s; } function jr(a) { return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a; } var Ur = function a(t, e) { if (t === e) return !0; if (t && e && typeof t == "object" && typeof e == "object") { if (t.constructor !== e.constructor) return !1; var n, l, s; if (Array.isArray(t)) { if (n = t.length, n != e.length) return !1; for (l = n; l-- !== 0; ) if (!a(t[l], e[l])) return !1; return !0; } if (t.constructor === RegExp) return t.source === e.source && t.flags === e.flags; if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === e.valueOf(); if (t.toString !== Object.prototype.toString) return t.toString() === e.toString(); if (s = Object.keys(t), n = s.length, n !== Object.keys(e).length) return !1; for (l = n; l-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(e, s[l])) return !1; for (l = n; l-- !== 0; ) { var r = s[l]; if (!a(t[r], e[r])) return !1; } return !0; } return t !== t && e !== e; }; const Qe = /* @__PURE__ */ jr(Ur); function Gr(a, t) { if (a.length !== t.length) return !1; for (let e = 0; e < a.length; e++) if (a[e] !== t[e]) return !1; return !0; } function Bt(a, t, e) { const n = a.findIndex((i) => Qe(i, t)), l = a.findIndex((i) => Qe(i, e)); if (n === -1 || l === -1) return []; const [s, r] = [n, l].sort((i, u) => i - u); return a.slice(s, r + 1); } const ha = typeof document < "u"; function ht(a) { return a == null; } function Yt(a) { const { defaultValue: t, defaultPlaceholder: e, granularity: n = "day", locale: l = "en" } = a; if (Array.isArray(t) && t.length) return t.at(-1).copy(); if (t && !Array.isArray(t)) return t.copy(); if (e) return e.copy(); const s = /* @__PURE__ */ new Date(), r = s.getFullYear(), i = s.getMonth() + 1, u = s.getDate(), d = ["hour", "minute", "second"], c = new lt(l), f = Dr(c.resolvedOptions().calendar); return d.includes(n ?? "day") ? zo(new $r(r, i, u, 0, 0, 0), f) : zo(new Br(r, i, u), f); } const qr = [ "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" ], Yr = ["year", "month", "day"], gn = { 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 Xr(a) { if (Wo(a)) return gn[a]; { const t = ei(a); return Wo(t) ? gn[t] : gn.en; } } function bn(a, t, e) { return Zr(a) ? Xr(e)[a] : Qr(a) ? t : Jr(a) ? "––" : ""; } function Wo(a) { return qr.includes(a); } function Zr(a) { return Yr.includes(a); } function Jr(a) { return a === "hour" || a === "minute" || a === "second"; } function Qr(a) { return a === "era" || a === "dayPeriod"; } function ei(a) { return Intl.Locale ? new Intl.Locale(a).language : a.split("-")[0]; } const Wn = ["day", "month", "year"], xl = ["hour", "minute", "second", "dayPeriod"], Sl = [...Wn, ...xl]; function ti(a) { return Wn.includes(a); } function El(a) { return Sl.includes(a); } function ai(a, t) { const e = { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: "short", hourCycle: t === 24 ? "h24" : void 0, hour12: t === 24 ? !1 : void 0 }; return a === "day" && (delete e.second, delete e.hour, delete e.minute, delete e.timeZoneName), a === "hour" && (delete e.minute, delete e.second), a === "minute" && delete e.second, e; } function Pl(a) { const t = a.querySelector("[data-selected]"); if (t) return t.focus(); const e = a.querySelector("[data-today]"); if (e) return e.focus(); const n = a.querySelector("[data-radix-vue-calendar-day]"); if (n) return n.focus(); } function ni(a, t) { var e; const n = Fn(); return Ce(() => { n.value = a(); }, { ...t, flush: (e = void 0) != null ? e : "sync" }), Wa(n); } function oi(a, t) { let e, n, l; const s = T(!0), r = () => { s.value = !0, l(); }; ee(a, r, { flush: "sync" }); const i = typeof t == "function" ? t : t.get, u = typeof t == "function" ? void 0 : t.set, d = cl((c, f) => (n = c, l = f, { get() { return s.value && (e = i(), s.value = !1), n(), e; }, set(v) { u == null || u(v); } })); return Object.isExtensible(d) && (d.trigger = r), d; } function bt(a) { return gr() ? (fl(a), !0) : !1; } function ua() { const a = /* @__PURE__ */ new Set(), t = (l) => { a.delete(l); }; return { on: (l) => { a.add(l); const s = () => t(l); return bt(s), { off: s }; }, off: t, trigger: (...l) => Promise.all(Array.from(a).map((s) => s(...l))) }; } function li(a) { let t = !1, e; const n = pl(!0); return (...l) => (t || (e = n.run(() => a(...l)), t = !0), e); } function Dl(a) { let t = 0, e, n; const l = () => { t -= 1, n && t <= 0 && (n.stop(), e = void 0, n = void 0); }; return (...s) => (t += 1, e || (n = pl(!0), e = n.run(() => a(...s))), bt(l), e); } function je(a) { return typeof a == "function" ? a() : o(a); } function si(a) { if (!et(a)) return Fa(a); const t = new Proxy({}, { get(e, n, l) { return o(Reflect.get(a.value, n, l)); }, set(e, n, l) { return et(a.value[n]) && !et(l) ? a.value[n].value = l : a.value[n] = l, !0; }, deleteProperty(e, n) { return Reflect.deleteProperty(a.value, n); }, has(e, n) { return Reflect.has(a.value, n); }, ownKeys() { return Object.keys(a.value); }, getOwnPropertyDescriptor() { return { enumerable: !0, configurable: !0 }; } }); return Fa(t); } function $l(a) { return si(B(a)); } const Je = typeof window < "u" && typeof document < "u"; typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope; const ri = (a) => typeof a < "u", ii = (a) => a != null, ui = Object.prototype.toString, di = (a) => ui.call(a) === "[object Object]", Na = () => { }, jo = /* @__PURE__ */ ci(); function ci() { var a, t; return Je && ((a = window == null ? void 0 : window.navigator) == null ? void 0 : a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent)); } function Bl(a, t) { function e(...n) { return new Promise((l, s) => { Promise.resolve(a(() => t.apply(this, n), { fn: t, thisArg: this, args: n })).then(l).catch(s); }); } return e; } const Il = (a) => a(); function fi(a, t = {}) { let e, n, l = Na; const s = (i) => { clearTimeout(i), l(), l = Na; }; return (i) => { const u = je(a), d = je(t.maxWait); return e && s(e), u <= 0 || d !== void 0 && d <= 0 ? (n && (s(n), n = null), Promise.resolve(i())) : new Promise((c, f) => { l = t.rejectOnCancel ? f : c, d && !n && (n = setTimeout(() => { e && s(e), n = null, c(i()); }, d)), e = setTimeout(() => { n && s(n), n = null, c(i()); }, u); }); }; } function pi(a = Il) { const t = T(!0); function e() { t.value = !1; } function n() { t.value = !0; } const l = (...s) => { t.value && a(...s); }; return { isActive: Wa(t), pause: e, resume: n, eventFilter: l }; } function Tl(a) { return gt(); } function Tt(a, t = 1e4) { return cl((e, n) => { let l = je(a), s; const r = () => setTimeout(() => { l = je(a), n(); }, je(t)); return bt(() => { clearTimeout(s); }), { get() { return e(), l; }, set(i) { l = i, n(), clearTimeout(s), s = r(); } }; }); } function jn(a, t = 200, e = {}) { return Bl( fi(t, e), a ); } function vi(a, t, e = {}) { const { eventFilter: n = Il, ...l } = e; return ee( a, Bl( n, t ), l ); } function Uo(a, t, e = {}) { const { eventFilter: n, ...l } = e, { eventFilter: s, pause: r, resume: i, isActive: u } = pi(n); return { stop: vi( a, t, { ...l, eventFilter: s } ), pause: r, resume: i, isActive: u }; } function mi(a, t, ...[e]) { const { flush: n = "sync", deep: l = !1, immediate: s = !0, direction: r = "both", transform: i = {} } = e || {}, u = [], d = "ltr" in i && i.ltr || ((v) => v), c = "rtl" in i && i.rtl || ((v) => v); return (r === "both" || r === "ltr") && u.push(Uo( a, (v) => { u.forEach((p) => p.pause()), t.value = d(v), u.forEach((p) => p.resume()); }, { flush: n, deep: l, immediate: s } )), (r === "both" || r === "rtl") && u.push(Uo( t, (v) => { u.forEach((p) => p.pause()), a.value = c(v), u.forEach((p) => p.resume()); }, { flush: n, deep: l, immediate: s } )), () => { u.forEach((v) => v.stop()); }; } function hi(a, t) { Tl() && Nn(a, t); } function yi(a, t = !0, e) { Tl() ? le(a, e) : t ? a() : oe(a); } function Un(a, t, e = {}) { const { immediate: n = !0 } = e, l = T(!1); let s = null; function r() { s && (clearTimeout(s), s = null); } function i() { l.value = !1, r(); } function u(...d) { r(), l.value = !0, s = setTimeout(() => { l.value = !1, s = null, a(...d); }, je(t)); } return n && (l.value = !0, Je && u()), bt(i), { isPending: Wa(l), start: u, stop: i }; } function gi(a = 1e3, t = {}) { const { controls: e = !1, callback: n } = t, l = Un( n ?? Na, a, t ), s = B(() => !l.isPending.value); return e ? { ready: s, ...l } : s; } function bi(a, t, e) { const n = ee(a, (...l) => (oe(() => n()), t(...l)), e); return n; } function $e(a) { var t; const e = je(a); return (t = e == null ? void 0 : e.$el) != null ? t : e; } const Rt = Je ? window : void 0; function He(...a) { let t, e, n, l; if (typeof a[0] == "string" || Array.isArray(a[0]) ? ([e, n, l] = a, t = Rt) : [t, e, n, l] = a, !t) return Na; Array.isArray(e) || (e = [e]), Array.isArray(n) || (n = [n]); const s = [], r = () => { s.forEach((c) => c()), s.length = 0; }, i = (c, f, v, p) => (c.addEventListener(f, v, p), () => c.removeEventListener(f, v, p)), u = ee( () => [$e(t), je(l)], ([c, f]) => { if (r(), !c) return; const v = di(f) ? { ...f } : f; s.push( ...e.flatMap((p) => n.map((g) => i(c, p, g, v))) ); }, { immediate: !0, flush: "post" } ), d = () => { u(), r(); }; return bt(d), d; } function Ci(a) { return typeof a == "function" ? a : typeof a == "string" ? (t) => t.key === a : Array.isArray(a) ? (t) => a.includes(t.key) : () => !0; } function Gn(...a) { let t, e, n = {}; a.length === 3 ? (t = a[0], e = a[1], n = a[2]) : a.length === 2 ? typeof a[1] == "object" ? (t = !0, e = a[0], n = a[1]) : (t = a[0], e = a[1]) : (t = !0, e = a[0]); const { target: l = Rt, eventName: s = "keydown", passive: r = !1, dedupe: i = !1 } = n, u = Ci(t); return He(l, s, (c) => { c.repeat && je(i) || u(c) && e(c); }, r); } function Ga() { const a = T(!1), t = gt(); return t && le(() => { a.value = !0; }, t), a; } function Rl(a) { const t = Ga(); return B(() => (t.value, !!a())); } function Al(a, t, e = {}) { const { window: n = Rt, ...l } = e; let s; const r = Rl(() => n && "MutationObserver" in n), i = () => { s && (s.disconnect(), s = void 0); }, u = B(() => { const v = je(a), p = (Array.isArray(v) ? v : [v]).map($e).filter(ii); return new Set(p); }), d = ee( () => u.value, (v) => { i(), r.value && v.size && (s = new MutationObserver(t), v.forEach((p) => s.observe(p, l))); }, { immediate: !0, flush: "post" } ), c = () => s == null ? void 0 : s.takeRecords(), f = () => { i(), d(); }; return bt(f), { isSupported: r, stop: f, takeRecords: c }; } function wi(a = {}) { var t; const { window: e = Rt, deep: n = !0, triggerOnRemoval: l = !1 } = a, s = (t = a.document) != null ? t : e == null ? void 0 : e.document, r = () => { var d; let c = s == null ? void 0 : s.activeElement; if (n) for (; c != null && c.shadowRoot; ) c = (d = c == null ? void 0 : c.shadowRoot) == null ? void 0 : d.activeElement; return c; }, i = T(), u = () => { i.value = r(); }; return e && (He(e, "blur", (d) => { d.relatedTarget === null && u(); }, !0), He(e, "focus", u, !0)), l && Al(s, (d) => { d.filter((c) => c.removedNodes.length).map((c) => Array.from(c.removedNodes)).flat().forEach((c) => { c === i.value && u(); }); }, { childList: !0, subtree: !0 }), u(), i; } function Ol(a, t = {}) { const { immediate: e = !0, fpsLimit: n = void 0, window: l = Rt } = t, s = T(!1), r = n ? 1e3 / n : null; let i = 0, u = null; function d(v) { if (!s.value || !l) return; i || (i = v); const p = v - i; if (r && p < r) { u = l.requestAnimationFrame(d); return; } i = v, a({ delta: p, timestamp: v }), u = l.requestAnimationFrame(d); } function c() { !s.value && l && (s.value = !0, i = 0, u = l.requestAnimationFrame(d)); } function f() { s.value = !1, u != null && l && (l.cancelAnimationFrame(u), u = null); } return e && c(), bt(f), { isActive: Wa(s), pause: f, resume: c }; } function _i(a) { return JSON.parse(JSON.stringify(a)); } function xi(a) { const t = gt(), e = oi( () => null, () => t.proxy.$el ); return vl(e.trigger), le(e.trigger), e; } function tt(a, t, e = {}) { const { window: n = Rt, ...l } = e; let s; const r = Rl(() => n && "ResizeObserver" in n), i = () => { s && (s.disconnect(), s = void 0); }, u = B(() => Array.isArray(a) ? a.map((f) => $e(f)) : [$e(a)]), d = ee( u, (f) => { if (i(), r.value && n) { s = new ResizeObserver(t); for (const v of f) v && s.observe(v, l); } }, { immediate: !0, flush: "post" } ), c = () => { i(), d(); }; return bt(c), { isSupported: r, stop: c }; } function Si(a, t = {}) { const e = wi(t), n = B(() => $e(a)); return { focused: B(() => n.value && e.value ? n.value.contains(e.value) : !1) }; } function kl(a = xi()) { const t = Fn(), e = () => { const n = $e(a); n && (t.value = n.parentElement); }; return yi(e), ee(() => je(a), e), t; } function ne(a, t, e, n = {}) { var l, s, r; const { clone: i = !1, passive: u = !1, eventName: d, deep: c = !1, defaultValue: f, shouldEmit: v } = n, p = gt(), g = e || (p == null ? void 0 : p.emit) || ((l = p == null ? void 0 : p.$emit) == null ? void 0 : l.bind(p)) || ((r = (s = p == null ? void 0 : p.proxy) == null ? void 0 : s.$emit) == null ? void 0 : r.bind(p == null ? void 0 : p.proxy)); let m = d; t || (t = "modelValue"), m = m || `update:${t.toString()}`; const _ = (h) => i ? typeof i == "function" ? i(h) : _i(h) : h, C = () => ri(a[t]) ? _(a[t]) : f, $ = (h) => { v ? v(h) && g(m, h) : g(m, h); }; if (u) { const h = C(), E = T(h); let P = !1; return ee( () => a[t], (D) => { P || (P = !0, E.value = _(D), oe(() => P = !1)); } ), ee( E, (D) => { !P && (D !== a[t] || c) && $(D); }, { deep: c } ), E; } else return B({ get() { return C(); }, set(h) { $(h); } }); } function qa(a) { return a ? a.flatMap((t) => t.type === _e ? qa(t.children) : [t]) : []; } function me() { let a = document.activeElement; if (a == null) return null; for (; a != null && a.shadowRoot != null && a.shadowRoot.activeElement != null; ) a = a.shadowRoot.activeElement; return a; } const Ei = ["INPUT", "TEXTAREA"]; function At(a, t, e, n = {}) { if (!t || n.enableIgnoredElement && Ei.includes(t.nodeName)) return null; const { arrowKeyOptions: l = "both", attributeName: s = "[data-radix-vue-collection-item]", itemsArray: r = [], loop: i = !0, dir: u = "ltr", preventScroll: d = !0, focus: c = !1 } = n, [f, v, p, g, m, _] = [ a.key === "ArrowRight", a.key === "ArrowLeft", a.key === "ArrowUp", a.key === "ArrowDown", a.key === "Home", a.key === "End" ], C = p || g, $ = f || v; if (!m && !_ && (!C && !$ || l === "vertical" && $ || l === "horizontal" && C)) return null; const h = e ? Array.from(e.querySelectorAll(s)) : r; if (!h.length) return null; d && a.preventDefault(); let E = null; return $ || C ? E = Ml(h, t, { goForward: C ? g : u === "ltr" ? f : v, loop: i }) : m ? E = h.at(0) || null : _ && (E = h.at(-1) || null), c && (E == null || E.focus()), E; } function Ml(a, t, e, n = a.length) { if (--n === 0) return null; const l = a.indexOf(t), s = e.goForward ? l + 1 : l - 1; if (!e.loop && (s < 0 || s >= a.length)) return null; const r = (s + a.length) % a.length, i = a[r]; return i ? i.hasAttribute("disabled") && i.getAttribute("disabled") !== "false" ? Ml( a, i, e, n ) : i : null; } function Cn(a) { if (a === null || typeof a != "object") return !1; const t = Object.getPrototypeOf(a); return t !== null && t !== Object.prototype && Object.getPrototypeOf(t) !== null || Symbol.iterator in a ? !1 : Symbol.toStringTag in a ? Object.prototype.toString.call(a) === "[object Module]" : !0; } function $n(a, t, e = ".", n) { if (!Cn(t)) return $n(a, {}, e, n); const l = Object.assign({}, t); for (const s in a) { if (s === "__proto__" || s === "constructor") continue; const r = a[s]; r != null && (n && n(l, s, r, e) || (Array.isArray(r) && Array.isArray(l[s]) ? l[s] = [...r, ...l[s]] : Cn(r) && Cn(l[s]) ? l[s] = $n( r, l[s], (e ? `${e}.` : "") + s.toString(), n ) : l[s] = r)); } return l; } function Pi(a) { return (...t) => ( // eslint-disable-next-line unicorn/no-array-reduce t.reduce((e, n) => $n(e, n, "", a), {}) ); } const Di = Pi(), [Ya, $i] = te("ConfigProvider"), xv = /* @__PURE__ */ x({ inheritAttrs: !1, __name: "ConfigProvider", props: { dir: { default: "ltr" }, scrollBody: { type: [Boolean, Object], default: !0 }, nonce: { default: void 0 }, useId: { type: Function, default: void 0 } }, setup(a) { const t = a, { dir: e, scrollBody: n, nonce: l } = ae(t); return $i({ dir: e, scrollBody: n, nonce: l, useId: t.useId }), (s, r) => w(s.$slots, "default"); } }); let Bi = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", Ii = (a = 21) => { let t = "", e = a; for (; e--; ) t += Bi[Math.random() * 64 | 0]; return t; }; const Ti = Dl(() => { const a = T(/* @__PURE__ */ new Map()), t = T(), e = B(() => { for (const r of a.value.values()) if (r) return !0; return !1; }), n = Ya({ scrollBody: T(!0) }); let l = null; const s = () => { document.body.style.paddingRight = "", document.body.style.marginRight = "", document.body.style.pointerEvents = "", document.body.style.removeProperty("--scrollbar-width"), document.body.style.overflow = t.value ?? "", jo && (l == null || l()), t.value = void 0; }; return ee(e, (r, i) => { var f; if (!Je) return; if (!r) { i && s(); return; } t.value === void 0 && (t.value = document.body.style.overflow); const u = window.innerWidth - document.documentElement.clientWidth, d = { padding: u, margin: 0 }, c = (f = n.scrollBody) != null && f.value ? typeof n.scrollBody.value == "object" ? Di({ padding: n.scrollBody.value.padding === !0 ? u : n.scrollBody.value.padding, margin: n.scrollBody.value.margin === !0 ? u : n.scrollBody.value.margin }, d) : d : { padding: 0, margin: 0 }; u > 0 && (document.body.style.paddingRight = typeof c.padding == "number" ? `${c.padding}px` : String(c.padding), document.body.style.marginRight = typeof c.margin == "number" ? `${c.margin}px` : String(c.margin), document.body.style.setProperty("--scrollbar-width", `${u}px`), document.body.style.overflow = "hidden"), jo && (l = He( document, "touchmove", (v) => Ri(v), { passive: !1 } )), oe(() => { document.body.style.pointerEvents = "none", document.body.style.overflow = "hidden"; }); }, { immediate: !0, flush: "sync" }), a; }); function ya(a) { const t = Ii(6), e = Ti(); e.value.set(t, a ?? !1); const n = B({ get: () => e.value.get(t) ?? !1, set: (l) => e.value.set(t, l) }); return hi(() => { e.value.delete(t); }), n; } function Vl(a) { const t = window.getComputedStyle(a); if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && a.clientWidth < a.scrollWidth || t.overflowY === "auto" && a.clientHeight < a.scrollHeight) return !0; { const e = a.parentNode; return !(e instanceof Element) || e.tagName === "BODY" ? !1 : Vl(e); } } function Ri(a) { const t = a || window.event, e = t.target; return e instanceof Element && Vl(e) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.cancelable && t.preventDefault(), !1); } const Ai = "data-radix-vue-collection-item"; function Fe(a, t = Ai) { const e = a ?? Symbol(); return { createCollection: (s) => { const r = T([]); function i() { const u = $e(s); return u ? r.value = Array.from( u.querySelectorAll(`[${t}]:not([data-disabled])`) ) : r.value = []; } return br(() => { r.value = []; }), le(i), vl(i), ee(() => s == null ? void 0 : s.value, i, { immediate: !0 }), dl(e, r), r; }, injectCollection: () => ul(e, T([])) }; } function qn(a) { const t = T(a); function e() { return t.value; } function n(m) { t.value = m; } function l(m, _) { return new lt(t.value, _).format(m); } function s(m, _ = !0) { return ia(m) && _ ? l(ze(m), { dateStyle: "long", timeStyle: "long" }) : l(ze(m), { dateStyle: "long" }); } function r(m, _ = {}) { return new lt(t.value, { month: "long", year: "numeric", ..._ }).format(m); } function i(m, _ = {}) { return new lt(t.value, { month: "long", ..._ }).format(m); } function u() { const m = Ir(Hn()); return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((C) => ({ label: i(ze(m.set({ month: C }))), value: C })); } function d(m, _ = {}) { return new lt(t.value, { year: "numeric", ..._ }).format(m); } function c(m, _) { return wl(m) ? new lt(t.value, { ..._, timeZone: m.timeZone }).formatToParts(ze(m)) : new lt(t.value, _).formatToParts(ze(m)); } function f(m, _ = "narrow") { return new lt(t.value, { weekday: _ }).format(m); } function v(m) { var $; return (($ = new lt(t.value, { hour: "numeric", minute: "numeric" }).formatToParts(m).find((h) => h.type === "dayPeriod")) == null ? void 0 : $.value) === "PM" ? "PM" : "AM"; } const p = { year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }; function g(m, _, C = {}) { const $ = { ...p, ...C }, E = c(m, $).find((P) => P.type === _); return E ? E.value : ""; } return { setLocale: n, getLocale: e, fullMonth: i, fullYear: d, fullMonthAndYear: r, toParts: c, custom: l, part: g, dayPeriod: v, selectedDate: s, dayOfWeek: f, getMonths: u }; } function we(a) { const t = Ya({ dir: T("ltr") }); return B(() => { var e; return (a == null ? void 0 : a.value) || ((e = t.dir) == null ? void 0 : e.value) || "ltr"; }); } function Te(a) { const t = gt(), e = t == null ? void 0 : t.type.emits, n = {}; return e != null && e.length || console.warn( `No emitted event found. Please check component: ${t == null ? void 0 : t.type.__name}` ), e == null || e.forEach((l) => { n[Cr(ml(l))] = (...s) => a(l, ...s); }), n; } let wn = 0; function Yn() { Ce((a) => { if (!Je) return; const t = document.querySelectorAll("[data-radix-focus-guard]"); document.body.insertAdjacentElement( "afterbegin", t[0] ?? Go() ), document.body.insertAdjacentElement( "beforeend", t[1] ?? Go() ), wn++, a(() => { wn === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((e) => e.remove()), wn--; }); }); } function Go() { const a = document.createElement("span"); return a.setAttribute("data-radix-focus-guard", ""), a.tabIndex = 0, a.style.outline = "none", a.style.opacity = "0", a.style.position = "fixed", a.style.pointerEvents = "none", a; } function at(a) { return B(() => { var t; return je(a) ? !!((t = $e(a)) != null && t.closest("form")) : !0; }); } function Ot(a) { const t = gt(), e = Object.keys((t == null ? void 0 : t.type.props) ?? {}).reduce((l, s) => { const r = (t == null ? void 0 : t.type.props[s]).default; return r !== void 0 && (l[s] = r), l; }, {}), n = wr(a); return B(() => { const l = {}, s = (t == null ? void 0 : t.vnode.props) ?? {}; return Object.keys(s).forEach((r) => { l[ml(r)] = s[r]; }), Object.keys({ ...e, ...l }).reduce((r, i) => (n.value[i] !== void 0 && (r[i] = n.value[i]), r), {}); }); } function Se(a, t) { const e = Ot(a), n = t ? Te(t) : {}; return B(() => ({ ...e.value, ...n })); } function R() { const a = gt(), t = T(), e = B(() => { var r, i; return ["#text", "#comment"].includes((r = t.value) == null ? void 0 : r.$el.nodeName) ? (i = t.value) == null ? void 0 : i.$el.nextElementSibling : $e(t); }), n = Object.assign({}, a.exposed), l = {}; for (const r in a.props) Object.defineProperty(l, r, { enumerable: !0, configurable: !0, get: () => a.props[r] }); if (Object.keys(n).length > 0) for (const r in n) Object.defineProperty(l, r, { enumerable: !0, configurable: !0, get: () => n[r] }); Object.defineProperty(l, "$el", { enumerable: !0, configurable: !0, get: () => a.vnode.el }), a.exposed = l; function s(r) { t.value = r, r && (Object.defineProperty(l, "$el", { enumerable: !0, configurable: !0, get: () => r instanceof Element ? r : r.$el }), a.exposed = l); } return { forwardRef: s, currentRef: t, currentElement: e }; } function Fl(a, t) { const e = Tt(!1, 300), n = T(null), l = ua(); function s() { n.value = null, e.value = !1; } function r(i, u) { const d = i.currentTarget, c = { x: i.clientX, y: i.clientY }, f = Oi(c, d.getBoundingClientRect()), v = ki(c, f), p = Mi(u.getBoundingClientRect()), g = Fi([...v, ...p]); n.value = g, e.value = !0; } return Ce((i) => { if (a.value && t.value) { const u = (c) => r(c, t.value), d = (c) => r(c, a.value); a.value.addEventListener("pointerleave", u), t.value.addEventListener("pointerleave", d), i(() => { var c, f; (c = a.value) == null || c.removeEventListener("pointerleave", u), (f = t.value) == null || f.removeEventListener("pointerleave", d); }); } }), Ce((i) => { var u; if (n.value) { const d = (c) => { var _, C; if (!n.value) return; const f = c.target, v = { x: c.clientX, y: c.clientY }, p = ((_ = a.value) == null ? void 0 : _.contains(f)) || ((C = t.value) == null ? void 0 : C.contains(f)), g = !Vi(v, n.value), m = !!f.closest("[data-grace-area-trigger]"); p ? s() : (g || m) && (s(), l.trigger()); }; (u = a.value) == null || u.ownerDocument.addEventListener("pointermove", d), i(() => { var c; return (c = a.value) == null ? void 0 : c.ownerDocument.removeEventListener("pointermove", d); }); } }), { isPointerInTransit: e, onPointerExit: l.on }; } function Oi(a, t) { const e = Math.abs(t.top - a.y), n = Math.abs(t.bottom - a.y), l = Math.abs(t.right - a.x), s = Math.abs(t.left - a.x); switch (Math.min(e, n, l, s)) { case s: return "left"; case l: return "right"; case e: return "top"; case n: return "bottom"; default: throw new Error("unreachable"); } } function ki(a, t, e = 5) { const n = []; switch (t) { case "top": n.push( { x: a.x - e, y: a.y + e }, { x: a.x + e, y: a.y + e } ); break; case "bottom": n.push( { x: a.x - e, y: a.y - e }, { x: a.x + e, y: a.y - e } ); break; case "left": n.push( { x: a.x + e, y: a.y - e }, { x: a.x + e, y: a.y + e } ); break; case "right": n.push( { x: a.x - e, y: a.y - e }, { x: a.x - e, y: a.y + e } ); break; } return n; } function Mi(a) { const { top: t, right: e, bottom: n, left: l } = a; return [ { x: l, y: t }, { x: e, y: t }, { x: e, y: n }, { x: l, y: n } ]; } function Vi(a, t) { const { x: e, y: n } = a; let l = !1; for (let s = 0, r = t.length - 1; s < t.length; r = s++) { const i = t[s].x, u = t[s].y, d = t[r].x, c = t[r].y; u > n != c > n && e < (d - i) * (n - u) / (c - u) + i && (l = !l); } return l; } function Fi(a) { const t = a.slice(); return t.sort((e, n) => e.x < n.x ? -1 : e.x > n.x ? 1 : e.y < n.y ? -1 : e.y > n.y ? 1 : 0), Ni(t); } function Ni(a) { if (a.length <= 1) return a.slice(); const t = []; for (let n = 0; n < a.length; n++) { const l = a[n]; for (; t.length >= 2; ) { const s = t[t.length - 1], r = t[t.length - 2]; if ((s.x - r.x) * (l.y - r.y) >= (s.y - r.y) * (l.x - r.x)) t.pop(); else break; } t.push(l); } t.pop(); const e = []; for (let n = a.length - 1; n >= 0; n--) { const l = a[n]; for (; e.length >= 2; ) { const s = e[e.length - 1], r = e[e.length - 2]; if ((s.x - r.x) * (l.y - r.y) >= (s.y - r.y) * (l.x - r.x)) e.pop(); else break; } e.push(l); } return e.pop(), t.length === 1 && e.length === 1 && t[0].x === e[0].x && t[0].y === e[0].y ? t : t.concat(e); } var Li = function(a) { if (typeof document > "u") return null; var t = Array.isArray(a) ? a[0] : a; return t.ownerDocument.body; }, Kt = /* @__PURE__ */ new WeakMap(), $a = /* @__PURE__ */ new WeakMap(), Ba = {}, _n = 0, Nl = function(a) { return a && (a.host || Nl(a.parentNode)); }, zi = function(a, t) { return t.map(function(e) { if (a.contains(e)) return e; var n = Nl(e); return n && a.contains(n) ? n : (console.error("aria-hidden", e, "in not contained inside", a, ". Doing nothing"), null); }).filter(function(e) { return !!e; }); }, Ki = function(a, t, e, n) { var l = zi(t, Array.isArray(a) ? a : [a]); Ba[e] || (Ba[e] = /* @__PURE__ */ new WeakMap()); var s = Ba[e], r = [], i = /* @__PURE__ */ new Set(), u = new Set(l), d = function(f) { !f || i.has(f) || (i.add(f), d(f.parentNode)); }; l.forEach(d); var c = function(f) { !f || u.has(f) || Array.prototype.forEach.call(f.children, function(v) { if (i.has(v)) c(v); else try { var p = v.getAttribute(n), g = p !== null && p !== "false", m = (Kt.get(v) || 0) + 1, _ = (s.get(v) || 0) + 1; Kt.set(v, m), s.set(v, _), r.push(v), m === 1 && g && $a.set(v, !0), _ === 1 && v.setAttribute(e, "true"), g || v.setAttribute(n, "true"); } catch (C) { console.error("aria-hidden: cannot operate on ", v, C); } }); }; return c(t), i.clear(), _n++, function() { r.forEach(function(f) { var v = Kt.get(f) - 1, p = s.get(f) - 1; Kt.set(f, v), s.set(f, p), v || ($a.has(f) || f.removeAttribute(n), $a.delete(f)), p || f.removeAttribute(e); }), _n--, _n || (Kt = /* @__PURE__ */ new WeakMap(), Kt = /* @__PURE__ */ new WeakMap(), $a = /* @__PURE__ */ new WeakMap(), Ba = {}); }; }, Hi = function(a, t, e) { e === void 0 && (e = "data-aria-hidden"); var n = Array.from(Array.isArray(a) ? a : [a]), l = Li(a); return l ? (n.push.apply(n, Array.from(l.querySelectorAll("[aria-live]"))), Ki(n, l, e, "aria-hidden")) : function() { return null; }; }; function ga(a) { let t; ee(() => $e(a), (e) => { e ? t = Hi(e) : t && t(); }), Be(() => { t && t(); }); } let Wi = 0; function ge(a, t = "radix") { if (a) return a; const e = Ya({ useId: void 0 }); return No.useId ? `${t}-${No.useId()}` : e.useId ? `${t}-${e.useId()}` : `${t}-${++Wi}`; } function ji(a, t) { const e = T(), n = (s, r) => { if (t.multiple && Array.isArray(a.value)) if (t.selectionBehavior === "replace") a.value = [s], e.value = s; else { const i = a.value.findIndex((u) => r(u)); i !== -1 ? a.value.splice(i, 1) : a.value.push(s); } else t.selectionBehavior === "replace" ? a.value = { ...s } : !Array.isArray(a.value) && r(a.value) ? a.value = void 0 : a.value = { ...s }; return a.value; }; function l(s, r, i, u) { var v; if (!(e != null && e.value) || !t.multiple || !Array.isArray(a.value)) return; const c = (v = i().filter((p) => p.ref.dataset.disabled !== "").find((p) => p.ref === r)) == null ? void 0 : v.value; if (!c) return; let f = null; switch (s) { case "prev": case "next": { f = Bt(u, e.value, c); break; } case "first": { f = Bt(u, e.value, u == null ? void 0 : u[0]); break; } case "last": { f = Bt(u, e.value, u == null ? void 0 : u[u.length - 1]); break; } } a.value = f; } return { firstValue: e, onSelectItem: n, handleMultipleReplace: l }; } function Ll(a) { const t = T(), e = B(() => { var l; return ((l = t.value) == null ? void 0 : l.width) ?? 0; }), n = B(() => { var l; return ((l = t.value) == null ? void 0 : l.height) ?? 0; }); return le(() => { const l = $e(a); if (l) { t.value = { width: l.offsetWidth, height: l.offsetHeight }; const s = new ResizeObserver((r) => { if (!Array.isArray(r) || !r.length) return; const i = r[0]; let u, d; if ("borderBoxSize" in i) { const c = i.borderBoxSize, f = Array.isArray(c) ? c[0] : c; u = f.inlineSize, d = f.blockSize; } else u = l.offsetWidth, d = l.offsetHeight; t.value = { width: u, height: d }; }); return s.observe(l, { box: "border-box" }), () => s.unobserve(l); } else t.value = void 0; }), { width: e, height: n }; } function zl(a, t) { const e = T(a); function n(s) { return t[e.value][s] ?? e.value; } return { state: e, dispatch: (s) => { e.value = n(s); } }; } const Ui = "data-item-text"; function ba(a) { const t = Tt("", 1e3); return { search: t, handleTypeaheadSearch: (l, s) => { if (!(a != null && a.value) && !s) return; t.value = t.value + l; const r = (a == null ? void 0 : a.value) ?? s, i = me(), u = r.map((p) => { var g; return { ref: p, textValue: ((g = (p.querySelector(`[${Ui}]`) ?? p).textContent) == null ? void 0 : g.trim()) ?? "" }; }), d = u.find((p) => p.ref === i), c = u.map((p) => p.textValue), f = Zn(c, t.value, d == null ? void 0 : d.textValue), v = u.find((p) => p.textValue === f); return v && v.ref.focus(), v == null ? void 0 : v.ref; }, resetTypeahead: () => { t.value = ""; } }; } function Xn(a, t) { return a.map((e, n) => a[(t + n) % a.length]); } function Zn(a, t, e) { const l = t.length > 1 && Array.from(t).every((d) => d === t[0]) ? t[0] : t, s = e ? a.indexOf(e) : -1; let r = Xn(a, Math.max(s, 0)); l.length === 1 && (r = r.filter((d) => d !== e)); const u = r.find( (d) => d.toLowerCase().startsWith(l.toLowerCase()) ); return u !== e ? u : void 0; } function Sv(a, t) { return { inheritAttrs: !1, name: `${a.__name ?? ""}Wrapper`, setup(e, n) { return () => { const l = typeof (t == null ? void 0 : t.props) == "function" ? t == null ? void 0 : t.props(n.attrs) : t == null ? void 0 : t.props, { forwardRef: s } = R(), r = k(l, n.attrs); return mt(a, { ...r, ref: s }, n.slots); }; } }; } function nt() { 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" }; } const Jn = x({ name: "PrimitiveSlot", inheritAttrs: !1, setup(a, { attrs: t, slots: e }) { return () => { var u, d; if (!e.default) return null; const n = qa(e.default()), l = n.findIndex((c) => c.type !== hl); if (l === -1) return n; const s = n[l]; (u = s.props) == null || delete u.ref; const r = s.props ? k(t, s.props) : t; t.class && ((d = s.props) != null && d.class) && delete s.props.class; const i = Ln(s, r); for (const c in r) c.startsWith("on") && (i.props || (i.props = {}), i.props[c] = r[c]); return n.length === 1 ? i : (n[l] = i, n); }; } }), O = x({ name: "Primitive", inheritAttrs: !1, props: { asChild: { type: Boolean, default: !1 }, as: { type: [String, Object], default: "div" } }, setup(a, { attrs: t, slots: e }) { const n = a.asChild ? "template" : a.as; return typeof n == "string" && ["area", "img", "input"].includes(n) ? () => mt(n, t) : n !== "template" ? () => mt(a.as, t, { default: e.default }) : () => mt(Jn, t, { default: e.default }); } }); function Re() { const a = T(), t = B(() => { var e, n; return ["#text", "#comment"].includes((e = a.value) == null ? void 0 : e.$el.nodeName) ? (n = a.value) == null ? void 0 : n.$el.nextElementSibling : $e(a); }); return { primitiveElement: a, currentElement: t }; } const [Kl, Gi] = te("CollapsibleRoot"), qi = /* @__PURE__ */ x({ __name: "CollapsibleRoot", props: { defaultOpen: { type: Boolean, default: !1 }, open: { type: Boolean, default: void 0 }, disabled: { type: Boolean }, asChild: { type: Boolean }, as: {} }, emits: ["update:open"], setup(a, { expose: t, emit: e }) { const n = a, s = ne(n, "open", e, { defaultValue: n.defaultOpen, passive: n.open === void 0 }), r = ne(n, "disabled"); return Gi({ contentId: "", disabled: r, open: s, onOpenToggle: () => { s.value = !s.value; } }), t({ open: s }), R(), (i, u) => (b(), S(o(O), { as: i.as, "as-child": n.asChild, "data-state": o(s) ? "open" : "closed", "data-disabled": o(r) ? "" : void 0 }, { default: y(() => [ w(i.$slots, "default", { open: o(s) }) ]), _: 3 }, 8, ["as", "as-child", "data-state", "data-disabled"])); } }), Yi = /* @__PURE__ */ x({ __name: "CollapsibleTrigger", props: { asChild: { type: Boolean }, as: { default: "button" } }, setup(a) { const t = a; R(); const e = Kl(); return (n, l) => { var s, r; return b(), S(o(O), { type: n.as === "button" ? "button" : void 0, as: n.as, "as-child": t.asChild, "aria-controls": o(e).contentId, "aria-expanded": o(e).open.value, "data-state": o(e).open.value ? "open" : "closed", "data-disabled": (s = o(e).disabled) != null && s.value ? "" : void 0, disabled: (r = o(e).disabled) == null ? void 0 : r.value, onClick: o(e).onOpenToggle }, { default: y(() => [ w(n.$slots, "default") ]), _: 3 }, 8, ["type", "as", "as-child", "aria-controls", "aria-expanded", "data-state", "data-disabled", "disabled", "onClick"]); }; } }); function Xi(a, t) { var _; const e = T({}), n = T("none"), l = T(a), s = a.value ? "mounted" : "unmounted"; let r; const i = ((_ = t.value) == null ? void 0 : _.ownerDocument.defaultView) ?? Rt, { state: u, dispatch: d } = zl(s, { mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" }, unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" }, unmounted: { MOUNT: "mounted" } }), c = (C) => { var $; if (Je) { const h = new CustomEvent(C, { bubbles: !1, cancelable: !1 }); ($ = t.value) == null || $.dispatchEvent(h); } }; ee( a, async (C, $) => { var E; const h = $ !== C; if (await oe(), h) { const P = n.value, D = Ia(t.value); C ? (d("MOUNT"), c("enter"), D === "none" && c("after-enter")) : D === "none" || ((E = e.value) == null ? void 0 : E.display) === "none" ? (d("UNMOUNT"), c("leave"), c("after-leave")) : $ && P !== D ? (d("ANIMATION_OUT"), c("leave")) : (d("UNMOUNT"), c("after-leave")); } }, { immediate: !0 } ); const f = (C) => { const $ = Ia(t.value), h = $.includes( C.animationName ), E = u.value === "mounted" ? "enter" : "leave"; if (C.target === t.value && h && (c(`after-${E}`), d("ANIMATION_END"), !l.value)) { const P = t.value.style.animationFillMode; t.value.style.animationFillMode = "forwards", r = i == null ? void 0 : i.setTimeout(() => { var D; ((D = t.value) == null ? void 0 : D.style.animationFillMode) === "forwards" && (t.value.style.animationFillMode = P); }); } C.target === t.value && $ === "none" && d("ANIMATION_END"); }, v = (C) => { C.target === t.value && (n.value = Ia(t.value)); }, p = ee( t, (C, $) => { C ? (e.value = getComputedStyle(C), C.addEventListener("animationstart", v), C.addEventListener("animationcancel", f), C.addEventListener("animationend", f)) : (d("ANIMATION_END"), r !== void 0 && (i == null || i.clearTimeout(r)), $ == null || $.removeEventListener("animationstart", v), $ == null || $.removeEventListener("animationcancel