radix-vue
Version:
Vue port for Radix UI Primitives.
1,705 lines • 595 kB
JavaScript
import * as Mo from "vue";
import { inject as ll, provide as sl, shallowRef as Mn, watchEffect as ge, readonly as Ka, customRef as rl, ref as I, computed as $, watch as te, nextTick as oe, getCurrentScope as fr, onScopeDispose as il, effectScope as ul, unref as o, onBeforeUnmount as Vn, onMounted as le, isRef as Xe, reactive as Ma, getCurrentInstance as vt, onUpdated as dl, Fragment as we, defineComponent as x, toRefs as ae, renderSlot as w, onBeforeUpdate as vr, toHandlerKey as mr, camelize as cl, toRef as hr, onUnmounted as Be, mergeProps as k, h as pt, Comment as pl, cloneVNode as Fn, openBlock as b, createBlock as S, withCtx as y, createVNode as q, createCommentVNode as ce, withKeys as ie, Teleport as jt, normalizeProps as H, guardReactiveProps as j, normalizeStyle as Oe, withModifiers as ue, createElementBlock as ve, withDirectives as Ha, vShow as Nn, createElementVNode as Ue, toDisplayString as De, createTextVNode as me, mergeDefaults as fl, watchPostEffect as yr, renderList as va, markRaw as gr, watchSyncEffect as br, resolveDynamicComponent as Ge, toHandlers as Ln, triggerRef as Vo, useSlots as Wa, onBeforeMount as vl, vModelSelect as Cr, toRaw as wr } from "vue";
import { CalendarDateTime as _r, CalendarDate as xr, DateFormatter as lt, today as Sr, getLocalTimeZone as zn, isEqualMonth as Fo, isSameDay as Te, isEqualDay as Ee, isToday as ml, isSameMonth as hl } from "@internationalized/date";
import { k as ra, t as Fe, j as yl, d as _t, n as Sa, m as Ne, l as Pt, o as Er, x as gl, u as Pr, r as Dr } from "./calendar-ChFCRr4K.js";
import { useFloating as $r, autoUpdate as Br, offset as Ir, flip as No, shift as Tr, limitShift as Rr, size as Ar, arrow as Or, hide as kr } from "@floating-ui/vue";
import { NumberFormatter as Mr, NumberParser as Vr } from "@internationalized/number";
function Q(a, t) {
const e = typeof a == "string" && !t ? `${a}Context` : t, n = Symbol(e);
return [(r) => {
const i = ll(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) => (sl(n, r), r)];
}
function Kt(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 Ht(a, t = Number.NEGATIVE_INFINITY, e = Number.POSITIVE_INFINITY) {
return Math.min(Math.max(a, t), e);
}
function Ea(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 Fr(a, t, e, n) {
t = Number(t), e = Number(e);
const l = (a - (Number.isNaN(t) ? 0 : t)) % n;
let s = Ea(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(Ea(e / n, n)) * n) : s < t ? s = t : !Number.isNaN(e) && s > e && (s = t + Math.floor(Ea((e - t) / n, n)) * n), s = Ea(s, n), s;
}
function Nr(a) {
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
}
var Lr = 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 Ye = /* @__PURE__ */ Nr(Lr);
function zr(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 Et(a, t, e) {
const n = a.findIndex((i) => Ye(i, t)), l = a.findIndex((i) => Ye(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 ma = typeof document < "u";
function zt(a) {
return a == null;
}
function Ut(a) {
const { defaultValue: t, defaultPlaceholder: e, granularity: n = "day" } = 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 l = /* @__PURE__ */ new Date(), s = l.getFullYear(), r = l.getMonth() + 1, i = l.getDate();
return ["hour", "minute", "second"].includes(n ?? "day") ? new _r(s, r, i, 0, 0, 0) : new xr(s, r, i);
}
const Kr = [
"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"
], Hr = ["year", "month", "day"], hn = {
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 Wr(a) {
if (Lo(a))
return hn[a];
{
const t = qr(a);
return Lo(t) ? hn[t] : hn.en;
}
}
function yn(a, t, e) {
return jr(a) ? Wr(e)[a] : Gr(a) ? t : Ur(a) ? "––" : "";
}
function Lo(a) {
return Kr.includes(a);
}
function jr(a) {
return Hr.includes(a);
}
function Ur(a) {
return a === "hour" || a === "minute" || a === "second";
}
function Gr(a) {
return a === "era" || a === "dayPeriod";
}
function qr(a) {
return Intl.Locale ? new Intl.Locale(a).language : a.split("-")[0];
}
const Kn = ["day", "month", "year"], bl = ["hour", "minute", "second", "dayPeriod"], Cl = [...Kn, ...bl];
function Yr(a) {
return Kn.includes(a);
}
function wl(a) {
return Cl.includes(a);
}
function Xr(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 _l(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 Zr(a, t) {
var e;
const n = Mn();
return ge(() => {
n.value = a();
}, {
...t,
flush: (e = void 0) != null ? e : "sync"
}), Ka(n);
}
function Jr(a, t) {
let e, n, l;
const s = I(!0), r = () => {
s.value = !0, l();
};
te(a, r, { flush: "sync" });
const i = typeof t == "function" ? t : t.get, u = typeof t == "function" ? void 0 : t.set, d = rl((c, p) => (n = c, l = p, {
get() {
return s.value && (e = i(), s.value = !1), n(), e;
},
set(f) {
u == null || u(f);
}
}));
return Object.isExtensible(d) && (d.trigger = r), d;
}
function mt(a) {
return fr() ? (il(a), !0) : !1;
}
function ia() {
const a = /* @__PURE__ */ new Set(), t = (l) => {
a.delete(l);
};
return {
on: (l) => {
a.add(l);
const s = () => t(l);
return mt(s), {
off: s
};
},
off: t,
trigger: (...l) => Promise.all(Array.from(a).map((s) => s(...l)))
};
}
function Qr(a) {
let t = !1, e;
const n = ul(!0);
return (...l) => (t || (e = n.run(() => a(...l)), t = !0), e);
}
function xl(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 = ul(!0), e = n.run(() => a(...s))), mt(l), e);
}
function Ke(a) {
return typeof a == "function" ? a() : o(a);
}
function ei(a) {
if (!Xe(a))
return Ma(a);
const t = new Proxy({}, {
get(e, n, l) {
return o(Reflect.get(a.value, n, l));
},
set(e, n, l) {
return Xe(a.value[n]) && !Xe(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 Ma(t);
}
function Sl(a) {
return ei($(a));
}
const qe = typeof window < "u" && typeof document < "u";
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const ti = (a) => typeof a < "u", ai = (a) => a != null, ni = Object.prototype.toString, oi = (a) => ni.call(a) === "[object Object]", Va = () => {
}, zo = /* @__PURE__ */ li();
function li() {
var a, t;
return qe && ((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 El(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 Pl = (a) => a();
function si(a, t = {}) {
let e, n, l = Va;
const s = (i) => {
clearTimeout(i), l(), l = Va;
};
return (i) => {
const u = Ke(a), d = Ke(t.maxWait);
return e && s(e), u <= 0 || d !== void 0 && d <= 0 ? (n && (s(n), n = null), Promise.resolve(i())) : new Promise((c, p) => {
l = t.rejectOnCancel ? p : c, d && !n && (n = setTimeout(() => {
e && s(e), n = null, c(i());
}, d)), e = setTimeout(() => {
n && s(n), n = null, c(i());
}, u);
});
};
}
function ri(a = Pl) {
const t = I(!0);
function e() {
t.value = !1;
}
function n() {
t.value = !0;
}
const l = (...s) => {
t.value && a(...s);
};
return { isActive: Ka(t), pause: e, resume: n, eventFilter: l };
}
function Dl(a) {
return vt();
}
function $t(a, t = 1e4) {
return rl((e, n) => {
let l = Ke(a), s;
const r = () => setTimeout(() => {
l = Ke(a), n();
}, Ke(t));
return mt(() => {
clearTimeout(s);
}), {
get() {
return e(), l;
},
set(i) {
l = i, n(), clearTimeout(s), s = r();
}
};
});
}
function Hn(a, t = 200, e = {}) {
return El(
si(t, e),
a
);
}
function ii(a, t, e = {}) {
const {
eventFilter: n = Pl,
...l
} = e;
return te(
a,
El(
n,
t
),
l
);
}
function Ko(a, t, e = {}) {
const {
eventFilter: n,
...l
} = e, { eventFilter: s, pause: r, resume: i, isActive: u } = ri(n);
return { stop: ii(
a,
t,
{
...l,
eventFilter: s
}
), pause: r, resume: i, isActive: u };
}
function ui(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 || ((f) => f), c = "rtl" in i && i.rtl || ((f) => f);
return (r === "both" || r === "ltr") && u.push(Ko(
a,
(f) => {
u.forEach((v) => v.pause()), t.value = d(f), u.forEach((v) => v.resume());
},
{ flush: n, deep: l, immediate: s }
)), (r === "both" || r === "rtl") && u.push(Ko(
t,
(f) => {
u.forEach((v) => v.pause()), a.value = c(f), u.forEach((v) => v.resume());
},
{ flush: n, deep: l, immediate: s }
)), () => {
u.forEach((f) => f.stop());
};
}
function di(a, t) {
Dl() && Vn(a, t);
}
function ci(a, t = !0, e) {
Dl() ? le(a, e) : t ? a() : oe(a);
}
function Wn(a, t, e = {}) {
const {
immediate: n = !0
} = e, l = I(!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);
}, Ke(t));
}
return n && (l.value = !0, qe && u()), mt(i), {
isPending: Ka(l),
start: u,
stop: i
};
}
function pi(a = 1e3, t = {}) {
const {
controls: e = !1,
callback: n
} = t, l = Wn(
n ?? Va,
a,
t
), s = $(() => !l.isPending.value);
return e ? {
ready: s,
...l
} : s;
}
function fi(a, t, e) {
const n = te(a, (...l) => (oe(() => n()), t(...l)), e);
return n;
}
function $e(a) {
var t;
const e = Ke(a);
return (t = e == null ? void 0 : e.$el) != null ? t : e;
}
const Gt = qe ? window : void 0;
function Le(...a) {
let t, e, n, l;
if (typeof a[0] == "string" || Array.isArray(a[0]) ? ([e, n, l] = a, t = Gt) : [t, e, n, l] = a, !t)
return Va;
Array.isArray(e) || (e = [e]), Array.isArray(n) || (n = [n]);
const s = [], r = () => {
s.forEach((c) => c()), s.length = 0;
}, i = (c, p, f, v) => (c.addEventListener(p, f, v), () => c.removeEventListener(p, f, v)), u = te(
() => [$e(t), Ke(l)],
([c, p]) => {
if (r(), !c)
return;
const f = oi(p) ? { ...p } : p;
s.push(
...e.flatMap((v) => n.map((g) => i(c, v, g, f)))
);
},
{ immediate: !0, flush: "post" }
), d = () => {
u(), r();
};
return mt(d), d;
}
function vi(a) {
return typeof a == "function" ? a : typeof a == "string" ? (t) => t.key === a : Array.isArray(a) ? (t) => a.includes(t.key) : () => !0;
}
function jn(...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 = Gt,
eventName: s = "keydown",
passive: r = !1,
dedupe: i = !1
} = n, u = vi(t);
return Le(l, s, (c) => {
c.repeat && Ke(i) || u(c) && e(c);
}, r);
}
function ja() {
const a = I(!1), t = vt();
return t && le(() => {
a.value = !0;
}, t), a;
}
function $l(a) {
const t = ja();
return $(() => (t.value, !!a()));
}
function Bl(a, t, e = {}) {
const { window: n = Gt, ...l } = e;
let s;
const r = $l(() => n && "MutationObserver" in n), i = () => {
s && (s.disconnect(), s = void 0);
}, u = $(() => {
const f = Ke(a), v = (Array.isArray(f) ? f : [f]).map($e).filter(ai);
return new Set(v);
}), d = te(
() => u.value,
(f) => {
i(), r.value && f.size && (s = new MutationObserver(t), f.forEach((v) => s.observe(v, l)));
},
{ immediate: !0, flush: "post" }
), c = () => s == null ? void 0 : s.takeRecords(), p = () => {
i(), d();
};
return mt(p), {
isSupported: r,
stop: p,
takeRecords: c
};
}
function mi(a = {}) {
var t;
const {
window: e = Gt,
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 = I(), u = () => {
i.value = r();
};
return e && (Le(e, "blur", (d) => {
d.relatedTarget === null && u();
}, !0), Le(e, "focus", u, !0)), l && Bl(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 Il(a, t = {}) {
const {
immediate: e = !0,
fpsLimit: n = void 0,
window: l = Gt
} = t, s = I(!1), r = n ? 1e3 / n : null;
let i = 0, u = null;
function d(f) {
if (!s.value || !l)
return;
i || (i = f);
const v = f - i;
if (r && v < r) {
u = l.requestAnimationFrame(d);
return;
}
i = f, a({ delta: v, timestamp: f }), u = l.requestAnimationFrame(d);
}
function c() {
!s.value && l && (s.value = !0, i = 0, u = l.requestAnimationFrame(d));
}
function p() {
s.value = !1, u != null && l && (l.cancelAnimationFrame(u), u = null);
}
return e && c(), mt(p), {
isActive: Ka(s),
pause: p,
resume: c
};
}
function hi(a) {
return JSON.parse(JSON.stringify(a));
}
function yi(a) {
const t = vt(), e = Jr(
() => null,
() => t.proxy.$el
);
return dl(e.trigger), le(e.trigger), e;
}
function Ze(a, t, e = {}) {
const { window: n = Gt, ...l } = e;
let s;
const r = $l(() => n && "ResizeObserver" in n), i = () => {
s && (s.disconnect(), s = void 0);
}, u = $(() => Array.isArray(a) ? a.map((p) => $e(p)) : [$e(a)]), d = te(
u,
(p) => {
if (i(), r.value && n) {
s = new ResizeObserver(t);
for (const f of p)
f && s.observe(f, l);
}
},
{ immediate: !0, flush: "post" }
), c = () => {
i(), d();
};
return mt(c), {
isSupported: r,
stop: c
};
}
function gi(a, t = {}) {
const e = mi(t), n = $(() => $e(a));
return { focused: $(() => n.value && e.value ? n.value.contains(e.value) : !1) };
}
function Tl(a = yi()) {
const t = Mn(), e = () => {
const n = $e(a);
n && (t.value = n.parentElement);
};
return ci(e), te(() => Ke(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: p,
shouldEmit: f
} = n, v = vt(), g = e || (v == null ? void 0 : v.emit) || ((l = v == null ? void 0 : v.$emit) == null ? void 0 : l.bind(v)) || ((r = (s = v == null ? void 0 : v.proxy) == null ? void 0 : s.$emit) == null ? void 0 : r.bind(v == null ? void 0 : v.proxy));
let m = d;
t || (t = "modelValue"), m = m || `update:${t.toString()}`;
const C = (h) => i ? typeof i == "function" ? i(h) : hi(h) : h, _ = () => ti(a[t]) ? C(a[t]) : p, D = (h) => {
f ? f(h) && g(m, h) : g(m, h);
};
if (u) {
const h = _(), E = I(h);
let P = !1;
return te(
() => a[t],
(B) => {
P || (P = !0, E.value = C(B), oe(() => P = !1));
}
), te(
E,
(B) => {
!P && (B !== a[t] || c) && D(B);
},
{ deep: c }
), E;
} else
return $({
get() {
return _();
},
set(h) {
D(h);
}
});
}
function Ua(a) {
return a ? a.flatMap((t) => t.type === we ? Ua(t.children) : [t]) : [];
}
const bi = ["INPUT", "TEXTAREA"];
function Bt(a, t, e, n = {}) {
if (!t || n.enableIgnoredElement && bi.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, [p, f, v, g, m, C] = [
a.key === "ArrowRight",
a.key === "ArrowLeft",
a.key === "ArrowUp",
a.key === "ArrowDown",
a.key === "Home",
a.key === "End"
], _ = v || g, D = p || f;
if (!m && !C && (!_ && !D || l === "vertical" && D || l === "horizontal" && _))
return null;
const h = e ? Array.from(e.querySelectorAll(s)) : r;
if (!h.length)
return null;
d && a.preventDefault();
let E = null;
return D || _ ? E = Rl(h, t, {
goForward: _ ? g : u === "ltr" ? p : f,
loop: i
}) : m ? E = h.at(0) || null : C && (E = h.at(-1) || null), c && (E == null || E.focus()), E;
}
function Rl(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" ? Rl(
a,
i,
e,
n
) : i : null;
}
function gn(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 Pn(a, t, e = ".", n) {
if (!gn(t))
return Pn(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]] : gn(r) && gn(l[s]) ? l[s] = Pn(
r,
l[s],
(e ? `${e}.` : "") + s.toString(),
n
) : l[s] = r));
}
return l;
}
function Ci(a) {
return (...t) => (
// eslint-disable-next-line unicorn/no-array-reduce
t.reduce((e, n) => Pn(e, n, "", a), {})
);
}
const wi = Ci(), [Ga, _i] = Q("ConfigProvider"), mv = /* @__PURE__ */ x({
__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 xi = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", Si = (a = 21) => {
let t = "", e = a;
for (; e--; )
t += xi[Math.random() * 64 | 0];
return t;
};
const Ei = xl(() => {
const a = I(/* @__PURE__ */ new Map()), t = I(), e = $(() => {
for (const r of a.value.values())
if (r)
return !0;
return !1;
}), n = Ga({
scrollBody: I(!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 ?? "", zo && (l == null || l()), t.value = void 0;
};
return te(e, (r, i) => {
var p;
if (!qe)
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 = (p = n.scrollBody) != null && p.value ? typeof n.scrollBody.value == "object" ? wi({
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 = `${c.padding}px`, document.body.style.marginRight = `${c.margin}px`, document.body.style.setProperty("--scrollbar-width", `${u}px`), document.body.style.overflow = "hidden"), zo && (l = Le(
document,
"touchmove",
(f) => {
var v;
f.target === document.documentElement && (f.touches.length > 1 || (v = f.preventDefault) == null || v.call(f));
},
{ passive: !1 }
)), oe(() => {
document.body.style.pointerEvents = "none", document.body.style.overflow = "hidden";
});
}, { immediate: !0, flush: "sync" }), a;
});
function ha(a) {
const t = Si(6), e = Ei();
e.value.set(t, a ?? !1);
const n = $({
get: () => e.value.get(t) ?? !1,
set: (l) => e.value.set(t, l)
});
return di(() => {
e.value.delete(t);
}), n;
}
const Pi = "data-radix-vue-collection-item";
function Me(a, t = Pi) {
const e = a ?? Symbol();
return { createCollection: (s) => {
const r = I([]);
function i() {
const u = $e(s);
return u ? r.value = Array.from(
u.querySelectorAll(`[${t}]:not([data-disabled])`)
) : r.value = [];
}
return vr(() => {
r.value = [];
}), le(i), dl(i), te(() => s == null ? void 0 : s.value, i, { immediate: !0 }), sl(e, r), r;
}, injectCollection: () => ll(e, I([])) };
}
function Un(a) {
const t = I(a);
function e() {
return t.value;
}
function n(m) {
t.value = m;
}
function l(m, C) {
return new lt(t.value, C).format(m);
}
function s(m, C = !0) {
return ra(m) && C ? l(Fe(m), {
dateStyle: "long",
timeStyle: "long"
}) : l(Fe(m), {
dateStyle: "long"
});
}
function r(m, C = {}) {
return new lt(t.value, { month: "long", year: "numeric", ...C }).format(m);
}
function i(m, C = {}) {
return new lt(t.value, { month: "long", ...C }).format(m);
}
function u() {
const m = Sr(zn());
return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((_) => ({ label: i(Fe(m.set({ month: _ }))), value: _ }));
}
function d(m, C = {}) {
return new lt(t.value, { year: "numeric", ...C }).format(m);
}
function c(m, C) {
return yl(m) ? new lt(t.value, {
...C,
timeZone: m.timeZone
}).formatToParts(Fe(m)) : new lt(t.value, C).formatToParts(Fe(m));
}
function p(m, C = "narrow") {
return new lt(t.value, { weekday: C }).format(m);
}
function f(m) {
var D;
return ((D = new lt(t.value, {
hour: "numeric",
minute: "numeric"
}).formatToParts(m).find((h) => h.type === "dayPeriod")) == null ? void 0 : D.value) === "PM" ? "PM" : "AM";
}
const v = {
year: "numeric",
month: "numeric",
day: "numeric",
hour: "numeric",
minute: "numeric",
second: "numeric"
};
function g(m, C, _ = {}) {
const D = { ...v, ..._ }, E = c(m, D).find((P) => P.type === C);
return E ? E.value : "";
}
return {
setLocale: n,
getLocale: e,
fullMonth: i,
fullYear: d,
fullMonthAndYear: r,
toParts: c,
custom: l,
part: g,
dayPeriod: f,
selectedDate: s,
dayOfWeek: p,
getMonths: u
};
}
function be(a) {
const t = Ga({
dir: I("ltr")
});
return $(() => {
var e;
return (a == null ? void 0 : a.value) || ((e = t.dir) == null ? void 0 : e.value) || "ltr";
});
}
function Re(a) {
const t = vt(), 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[mr(cl(l))] = (...s) => a(l, ...s);
}), n;
}
let bn = 0;
function Gn() {
ge((a) => {
if (!qe)
return;
const t = document.querySelectorAll("[data-radix-focus-guard]");
document.body.insertAdjacentElement(
"afterbegin",
t[0] ?? Ho()
), document.body.insertAdjacentElement(
"beforeend",
t[1] ?? Ho()
), bn++, a(() => {
bn === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((e) => e.remove()), bn--;
});
});
}
function Ho() {
const a = document.createElement("span");
return a.setAttribute("data-radix-focus-guard", ""), a.tabIndex = 0, a.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", a;
}
function Je(a) {
return $(() => {
var t;
return Ke(a) ? !!((t = $e(a)) != null && t.closest("form")) : !0;
});
}
function It(a) {
const t = vt(), 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 = hr(a);
return $(() => {
const l = {}, s = (t == null ? void 0 : t.vnode.props) ?? {};
return Object.keys(s).forEach((r) => {
l[cl(r)] = s[r];
}), Object.keys({ ...e, ...l }).reduce((r, i) => (n.value[i] !== void 0 && (r[i] = n.value[i]), r), {});
});
}
function xe(a, t) {
const e = It(a), n = t ? Re(t) : {};
return $(() => ({
...e.value,
...n
}));
}
function R() {
const a = vt(), t = I(), e = $(() => {
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 instanceof Element || !r) && (Object.defineProperty(l, "$el", {
enumerable: !0,
configurable: !0,
get: () => r.$el
}), a.exposed = l);
}
return { forwardRef: s, currentRef: t, currentElement: e };
}
function Al(a, t) {
const e = $t(!1, 300), n = I(null), l = ia();
function s() {
n.value = null, e.value = !1;
}
function r(i, u) {
const d = i.currentTarget, c = { x: i.clientX, y: i.clientY }, p = Di(c, d.getBoundingClientRect()), f = $i(c, p), v = Bi(u.getBoundingClientRect()), g = Ti([...f, ...v]);
n.value = g, e.value = !0;
}
return ge((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, p;
(c = a.value) == null || c.removeEventListener("pointerleave", u), (p = t.value) == null || p.removeEventListener("pointerleave", d);
});
}
}), ge((i) => {
if (n.value) {
const u = (d) => {
var m, C;
if (!n.value)
return;
const c = d.target, p = { x: d.clientX, y: d.clientY }, f = ((m = a.value) == null ? void 0 : m.contains(c)) || ((C = t.value) == null ? void 0 : C.contains(c)), v = !Ii(p, n.value), g = c.hasAttribute("data-grace-area-trigger");
f ? s() : (v || g) && (s(), l.trigger());
};
document.addEventListener("pointermove", u), i(() => document.removeEventListener("pointermove", u));
}
}), {
isPointerInTransit: e,
onPointerExit: l.on
};
}
function Di(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 $i(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 Bi(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 Ii(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 Ti(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), Ri(t);
}
function Ri(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 Ai = function(a) {
if (typeof document > "u")
return null;
var t = Array.isArray(a) ? a[0] : a;
return t.ownerDocument.body;
}, Ft = /* @__PURE__ */ new WeakMap(), Pa = /* @__PURE__ */ new WeakMap(), Da = {}, Cn = 0, Ol = function(a) {
return a && (a.host || Ol(a.parentNode));
}, Oi = function(a, t) {
return t.map(function(e) {
if (a.contains(e))
return e;
var n = Ol(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 = Oi(t, Array.isArray(a) ? a : [a]);
Da[e] || (Da[e] = /* @__PURE__ */ new WeakMap());
var s = Da[e], r = [], i = /* @__PURE__ */ new Set(), u = new Set(l), d = function(p) {
!p || i.has(p) || (i.add(p), d(p.parentNode));
};
l.forEach(d);
var c = function(p) {
!p || u.has(p) || Array.prototype.forEach.call(p.children, function(f) {
if (i.has(f))
c(f);
else
try {
var v = f.getAttribute(n), g = v !== null && v !== "false", m = (Ft.get(f) || 0) + 1, C = (s.get(f) || 0) + 1;
Ft.set(f, m), s.set(f, C), r.push(f), m === 1 && g && Pa.set(f, !0), C === 1 && f.setAttribute(e, "true"), g || f.setAttribute(n, "true");
} catch (_) {
console.error("aria-hidden: cannot operate on ", f, _);
}
});
};
return c(t), i.clear(), Cn++, function() {
r.forEach(function(p) {
var f = Ft.get(p) - 1, v = s.get(p) - 1;
Ft.set(p, f), s.set(p, v), f || (Pa.has(p) || p.removeAttribute(n), Pa.delete(p)), v || p.removeAttribute(e);
}), Cn--, Cn || (Ft = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), Pa = /* @__PURE__ */ new WeakMap(), Da = {});
};
}, Mi = function(a, t, e) {
e === void 0 && (e = "data-aria-hidden");
var n = Array.from(Array.isArray(a) ? a : [a]), l = Ai(a);
return l ? (n.push.apply(n, Array.from(l.querySelectorAll("[aria-live]"))), ki(n, l, e, "aria-hidden")) : function() {
return null;
};
};
function ya(a) {
let t;
te(() => $e(a), (e) => {
e ? t = Mi(e) : t && t();
}), Be(() => {
t && t();
});
}
let Vi = 0;
function he(a, t = "radix") {
if (a)
return a;
const e = Ga({ useId: void 0 });
return Mo.useId ? `${t}-${Mo.useId()}` : e.useId ? `${t}-${e.useId()}` : `${t}-${++Vi}`;
}
function Fi(a, t) {
const e = I(), 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 f;
if (!(e != null && e.value) || !t.multiple || !Array.isArray(a.value))
return;
const c = (f = i().filter((v) => v.ref.dataset.disabled !== "").find((v) => v.ref === r)) == null ? void 0 : f.value;
if (!c)
return;
let p = null;
switch (s) {
case "prev":
case "next": {
p = Et(u, e.value, c);
break;
}
case "first": {
p = Et(u, e.value, u == null ? void 0 : u[0]);
break;
}
case "last": {
p = Et(u, e.value, u == null ? void 0 : u[u.length - 1]);
break;
}
}
a.value = p;
}
return {
firstValue: e,
onSelectItem: n,
handleMultipleReplace: l
};
}
function kl(a) {
const t = I(), e = $(() => {
var l;
return ((l = t.value) == null ? void 0 : l.width) ?? 0;
}), n = $(() => {
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, p = Array.isArray(c) ? c[0] : c;
u = p.inlineSize, d = p.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 Ml(a, t) {
const e = I(a);
function n(s) {
return t[e.value][s] ?? e.value;
}
return {
state: e,
dispatch: (s) => {
e.value = n(s);
}
};
}
function ga(a) {
const t = $t("", 1e3);
return {
search: t,
handleTypeaheadSearch: (l, s) => {
var f, v;
if (!(a != null && a.value) && !s)
return;
t.value = t.value + l;
const r = (a == null ? void 0 : a.value) ?? s, i = document.activeElement, u = ((v = (f = r.find((g) => g === i)) == null ? void 0 : f.textContent) == null ? void 0 : v.trim()) ?? "", d = r.map((g) => {
var m;
return ((m = g.textContent) == null ? void 0 : m.trim()) ?? "";
}), c = Yn(d, t.value, u), p = r.find(
(g) => {
var m;
return ((m = g.textContent) == null ? void 0 : m.trim()) === c;
}
);
return p && p.focus(), p;
},
resetTypeahead: () => {
t.value = "";
}
};
}
function qn(a, t) {
return a.map((e, n) => a[(t + n) % a.length]);
}
function Yn(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 = qn(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 hv(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 pt(a, { ...r, ref: s }, n.slots);
};
}
};
}
function Qe() {
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 Xn = x({
name: "PrimitiveSlot",
inheritAttrs: !1,
setup(a, { attrs: t, slots: e }) {
return () => {
var u, d;
if (!e.default)
return null;
const n = Ua(e.default()), l = n.findIndex((c) => c.type !== pl);
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 = Fn(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) ? () => pt(n, t) : n !== "template" ? () => pt(a.as, t, { default: e.default }) : () => pt(Xn, t, { default: e.default });
}
});
function ke() {
const a = I(), t = $(() => {
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 [Vl, Ni] = Q("CollapsibleRoot"), Li = /* @__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 Ni({
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": n.open ? "open" : "closed",
"data-disabled": n.disabled ? "" : void 0
}, {
default: y(() => [
w(i.$slots, "default", { open: o(s) })
]),
_: 3
}, 8, ["as", "as-child", "data-state", "data-disabled"]));
}
}), zi = /* @__PURE__ */ x({
__name: "CollapsibleTrigger",
props: {
asChild: { type: Boolean },
as: { default: "button" }
},
setup(a) {
const t = a;
R();
const e = Vl();
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 Ki(a, t) {
const e = I({}), n = I("none"), l = a.value ? "mounted" : "unmounted", { state: s, dispatch: r } = Ml(l, {
mounted: {
UNMOUNT: "unmounted",
ANIMATION_OUT: "unmountSuspended"
},
unmountSuspended: {
MOUNT: "mounted",
ANIMATION_END: "unmounted"
},
unmounted: {
MOUNT: "mounted"
}
}), i = (v) => {
var g;
if (qe) {
const m = new CustomEvent(v, { bubbles: !1, cancelable: !1 });
(g = t.value) == null || g.dispatchEvent(m);
}
};
te(
a,
async (v, g) => {
var C;
const m = g !== v;
if (await oe(), m) {
const _ = n.value, D = $a(t.value);
v ? (r("MOUNT"), i("enter"), D === "none" && i("after-enter")) : D === "none" || ((C = e.value) == null ? void 0 : C.display) === "none" ? (r("UNMOUNT"), i("leave"), i("after-leave")) : g && _ !== D ? (r("ANIMATION_OUT"), i("leave")) : (r("UNMOUNT"), i("after-leave"));
}
},
{ immediate: !0 }
);
const u = (v) => {
const g = $a(t.value), m = g.includes(
v.animationName
), C = s.value === "mounted" ? "enter" : "leave";
v.target === t.value && m && (i(`after-${C}`), r("ANIMATION_END")), v.target === t.value && g === "none" && r("ANIMATION_END");
}, d = (v) => {
v.target === t.value && (n.value = $a(t.value));
}, c = te(
t,
(v, g) => {
v ? (e.value = getComputedStyle(v), v.addEventListener("animationstart", d), v.addEventListener("animationcancel", u), v.addEventListener("animationend", u)) : (r("ANIMATION_END"), g == null || g.removeEventListener("animationstart", d), g == null || g.removeEventListener("animationcancel", u), g == null || g.removeEventListener("animationend", u));
},
{ immediate: !0 }
), p = te(s, () => {
const v = $a(t.value);
n.value = s.value === "mounted" ? v : "none";
});
return Be(() => {
c(), p();
}), {
isPresent: $(
() => ["mounted", "unmountSuspended"].includes(s.value)
)
};
}
function $a(a) {
return a && getComputedStyle(a).animationName || "none";
}
const Pe = x({
name: "Presence",
props: {
present: {
type: Boolean,
required: !0
},
forceMount: {
type: Boolean
}
},
slots: {},
setup(a, { slots: t, expose: e }) {
var d;
const { present: n, forceMount: l } = ae(a), s = I(), { isPresent: r } = Ki(n, s);
e({ present: r });
let i = t.default({ present: r });
i = Ua(i || []);
const u = vt();
if (i && (i == null ? void 0 : i.length) > 1) {
const c = (d = u == null ? void 0 : u.parent) != null && d.type.name ? `<${u.parent.type.name} />` : "component";
throw new Error(
[
`Detected an invalid children for \`${c}\` 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