UNPKG

@uhcougarnet/ui

Version:

UH Components Library

1,920 lines 632 kB
import { jsx as y, jsxs as ne, Fragment as Xe } from "react/jsx-runtime"; import * as x from "react"; import Y, { createContext as Oe, useMemo as Ie, createElement as h, useContext as Be, useCallback as X, forwardRef as P, Children as Ve, isValidElement as kt, cloneElement as yn, Fragment as ze, useRef as M, useEffect as V, useState as H, useLayoutEffect as br, useReducer as _s } from "react"; import * as Hm from "react-dom"; import Ps, { flushSync as $r, createPortal as Es } from "react-dom"; function C() { return C = Object.assign ? Object.assign.bind() : function(e) { for (var n = 1; n < arguments.length; n++) { var t = arguments[n]; for (var o in t) ({}).hasOwnProperty.call(t, o) && (e[o] = t[o]); } return e; }, C.apply(null, arguments); } function zm(e, n) { const t = /* @__PURE__ */ Oe(n); function o(a) { const { children: s, ...i } = a, c = Ie( () => i, Object.values(i) ); return /* @__PURE__ */ h(t.Provider, { value: c }, s); } function r(a) { const s = Be(t); if (s) return s; if (n !== void 0) return n; throw new Error(`\`${a}\` must be used within \`${e}\``); } return o.displayName = e + "Provider", [ o, r ]; } function $e(e, n = []) { let t = []; function o(a, s) { const i = /* @__PURE__ */ Oe(s), c = t.length; t = [ ...t, s ]; function l(d) { const { scope: p, children: f, ...m } = d, g = (p == null ? void 0 : p[e][c]) || i, v = Ie( () => m, Object.values(m) ); return /* @__PURE__ */ h(g.Provider, { value: v }, f); } function u(d, p) { const f = (p == null ? void 0 : p[e][c]) || i, m = Be(f); if (m) return m; if (s !== void 0) return s; throw new Error(`\`${d}\` must be used within \`${a}\``); } return l.displayName = a + "Provider", [ l, u ]; } const r = () => { const a = t.map((s) => /* @__PURE__ */ Oe(s)); return function(i) { const c = (i == null ? void 0 : i[e]) || a; return Ie( () => ({ [`__scope${e}`]: { ...i, [e]: c } }), [ i, c ] ); }; }; return r.scopeName = e, [ o, Bm(r, ...n) ]; } function Bm(...e) { const n = e[0]; if (e.length === 1) return n; const t = () => { const o = e.map( (r) => ({ useScope: r(), scopeName: r.scopeName }) ); return function(a) { const s = o.reduce((i, { useScope: c, scopeName: l }) => { const d = c(a)[`__scope${l}`]; return { ...i, ...d }; }, {}); return Ie( () => ({ [`__scope${n.scopeName}`]: s }), [ s ] ); }; }; return t.scopeName = n.scopeName, t; } function Gm(e, n) { typeof e == "function" ? e(n) : e != null && (e.current = n); } function so(...e) { return (n) => e.forEach( (t) => Gm(t, n) ); } function ee(...e) { return X(so(...e), e); } const lt = /* @__PURE__ */ P((e, n) => { const { children: t, ...o } = e, r = Ve.toArray(t), a = r.find(Wm); if (a) { const s = a.props.children, i = r.map((c) => c === a ? Ve.count(s) > 1 ? Ve.only(null) : /* @__PURE__ */ kt(s) ? s.props.children : null : c); return /* @__PURE__ */ h(ka, C({}, o, { ref: n }), /* @__PURE__ */ kt(s) ? /* @__PURE__ */ yn(s, void 0, i) : null); } return /* @__PURE__ */ h(ka, C({}, o, { ref: n }), t); }); lt.displayName = "Slot"; const ka = /* @__PURE__ */ P((e, n) => { const { children: t, ...o } = e; return /* @__PURE__ */ kt(t) ? /* @__PURE__ */ yn(t, { ...Km(o, t.props), ref: n ? so(n, t.ref) : t.ref }) : Ve.count(t) > 1 ? Ve.only(null) : null; }); ka.displayName = "SlotClone"; const Rs = ({ children: e }) => /* @__PURE__ */ h(ze, null, e); function Wm(e) { return /* @__PURE__ */ kt(e) && e.type === Rs; } function Km(e, n) { const t = { ...n }; for (const o in n) { const r = e[o], a = n[o]; /^on[A-Z]/.test(o) ? r && a ? t[o] = (...i) => { a(...i), r(...i); } : r && (t[o] = r) : o === "style" ? t[o] = { ...r, ...a } : o === "className" && (t[o] = [ r, a ].filter(Boolean).join(" ")); } return { ...e, ...t }; } function Ct(e) { const n = e + "CollectionProvider", [t, o] = $e(n), [r, a] = t(n, { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }), s = (f) => { const { scope: m, children: g } = f, v = Y.useRef(null), b = Y.useRef(/* @__PURE__ */ new Map()).current; return /* @__PURE__ */ Y.createElement(r, { scope: m, itemMap: b, collectionRef: v }, g); }, i = e + "CollectionSlot", c = /* @__PURE__ */ Y.forwardRef((f, m) => { const { scope: g, children: v } = f, b = a(i, g), $ = ee(m, b.collectionRef); return /* @__PURE__ */ Y.createElement(lt, { ref: $ }, v); }), l = e + "CollectionItemSlot", u = "data-radix-collection-item", d = /* @__PURE__ */ Y.forwardRef((f, m) => { const { scope: g, children: v, ...b } = f, $ = Y.useRef(null), w = ee(m, $), S = a(l, g); return Y.useEffect(() => (S.itemMap.set($, { ref: $, ...b }), () => void S.itemMap.delete($))), /* @__PURE__ */ Y.createElement(lt, { [u]: "", ref: w }, v); }); function p(f) { const m = a(e + "CollectionConsumer", f); return Y.useCallback(() => { const v = m.collectionRef.current; if (!v) return []; const b = Array.from(v.querySelectorAll(`[${u}]`)); return Array.from(m.itemMap.values()).sort( (S, _) => b.indexOf(S.ref.current) - b.indexOf(_.ref.current) ); }, [ m.collectionRef, m.itemMap ]); } return [ { Provider: s, Slot: c, ItemSlot: d }, p, o ]; } function T(e, n, { checkForDefaultPrevented: t = !0 } = {}) { return function(r) { if (e == null || e(r), t === !1 || !r.defaultPrevented) return n == null ? void 0 : n(r); }; } function me(e) { const n = M(e); return V(() => { n.current = e; }), Ie( () => (...t) => { var o; return (o = n.current) === null || o === void 0 ? void 0 : o.call(n, ...t); }, [] ); } function Ce({ prop: e, defaultProp: n, onChange: t = () => { } }) { const [o, r] = Um({ defaultProp: n, onChange: t }), a = e !== void 0, s = a ? e : o, i = me(t), c = X((l) => { if (a) { const d = typeof l == "function" ? l(e) : l; d !== e && i(d); } else r(l); }, [ a, e, r, i ]); return [ s, c ]; } function Um({ defaultProp: e, onChange: n }) { const t = H(e), [o] = t, r = M(o), a = me(n); return V(() => { r.current !== o && (a(o), r.current = o); }, [ o, r, a ]), t; } const jm = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "span", "svg", "ul" ], W = jm.reduce((e, n) => { const t = /* @__PURE__ */ P((o, r) => { const { asChild: a, ...s } = o, i = a ? lt : n; return V(() => { window[Symbol.for("radix-ui")] = !0; }, []), /* @__PURE__ */ h(i, C({}, s, { ref: r })); }); return t.displayName = `Primitive.${n}`, { ...e, [n]: t }; }, {}); function Kn(e, n) { e && $r( () => e.dispatchEvent(n) ); } const Pe = globalThis != null && globalThis.document ? br : () => { }; function Ym(e, n) { return _s((t, o) => { const r = n[t][o]; return r ?? t; }, e); } const Se = (e) => { const { present: n, children: t } = e, o = qm(n), r = typeof t == "function" ? t({ present: o.isPresent }) : Ve.only(t), a = ee(o.ref, r.ref); return typeof t == "function" || o.isPresent ? /* @__PURE__ */ yn(r, { ref: a }) : null; }; Se.displayName = "Presence"; function qm(e) { const [n, t] = H(), o = M({}), r = M(e), a = M("none"), s = e ? "mounted" : "unmounted", [i, c] = Ym(s, { mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" }, unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" }, unmounted: { MOUNT: "mounted" } }); return V(() => { const l = Ao(o.current); a.current = i === "mounted" ? l : "none"; }, [ i ]), Pe(() => { const l = o.current, u = r.current; if (u !== e) { const p = a.current, f = Ao(l); e ? c("MOUNT") : f === "none" || (l == null ? void 0 : l.display) === "none" ? c("UNMOUNT") : c(u && p !== f ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e; } }, [ e, c ]), Pe(() => { if (n) { const l = (d) => { const f = Ao(o.current).includes(d.animationName); d.target === n && f && $r( () => c("ANIMATION_END") ); }, u = (d) => { d.target === n && (a.current = Ao(o.current)); }; return n.addEventListener("animationstart", u), n.addEventListener("animationcancel", l), n.addEventListener("animationend", l), () => { n.removeEventListener("animationstart", u), n.removeEventListener("animationcancel", l), n.removeEventListener("animationend", l); }; } else c("ANIMATION_END"); }, [ n, c ]), { isPresent: [ "mounted", "unmountSuspended" ].includes(i), ref: X((l) => { l && (o.current = getComputedStyle(l)), t(l); }, []) }; } function Ao(e) { return (e == null ? void 0 : e.animationName) || "none"; } const Xm = x.useId || (() => { }); let Qm = 0; function Ee(e) { const [n, t] = x.useState(Xm()); return Pe(() => { e || t( (o) => o ?? String(Qm++) ); }, [ e ]), e || (n ? `radix-${n}` : ""); } const Ol = "Collapsible", [Zm, Il] = $e(Ol), [Jm, Ms] = Zm(Ol), ev = /* @__PURE__ */ P((e, n) => { const { __scopeCollapsible: t, open: o, defaultOpen: r, disabled: a, onOpenChange: s, ...i } = e, [c = !1, l] = Ce({ prop: o, defaultProp: r, onChange: s }); return /* @__PURE__ */ h(Jm, { scope: t, disabled: a, contentId: Ee(), open: c, onOpenToggle: X( () => l( (u) => !u ), [ l ] ) }, /* @__PURE__ */ h(W.div, C({ "data-state": Ns(c), "data-disabled": a ? "" : void 0 }, i, { ref: n }))); }), tv = "CollapsibleTrigger", Al = /* @__PURE__ */ P((e, n) => { const { __scopeCollapsible: t, ...o } = e, r = Ms(tv, t); return /* @__PURE__ */ h(W.button, C({ type: "button", "aria-controls": r.contentId, "aria-expanded": r.open || !1, "data-state": Ns(r.open), "data-disabled": r.disabled ? "" : void 0, disabled: r.disabled }, o, { ref: n, onClick: T(e.onClick, r.onOpenToggle) })); }), kl = "CollapsibleContent", Fl = /* @__PURE__ */ P((e, n) => { const { forceMount: t, ...o } = e, r = Ms(kl, e.__scopeCollapsible); return /* @__PURE__ */ h( Se, { present: t || r.open }, ({ present: a }) => /* @__PURE__ */ h(nv, C({}, o, { ref: n, present: a })) ); }), nv = /* @__PURE__ */ P((e, n) => { const { __scopeCollapsible: t, present: o, children: r, ...a } = e, s = Ms(kl, t), [i, c] = H(o), l = M(null), u = ee(n, l), d = M(0), p = d.current, f = M(0), m = f.current, g = s.open || i, v = M(g), b = M(); return V(() => { const $ = requestAnimationFrame( () => v.current = !1 ); return () => cancelAnimationFrame($); }, []), Pe(() => { const $ = l.current; if ($) { b.current = b.current || { transitionDuration: $.style.transitionDuration, animationName: $.style.animationName }, $.style.transitionDuration = "0s", $.style.animationName = "none"; const w = $.getBoundingClientRect(); d.current = w.height, f.current = w.width, v.current || ($.style.transitionDuration = b.current.transitionDuration, $.style.animationName = b.current.animationName), c(o); } }, [ s.open, o ]), /* @__PURE__ */ h(W.div, C({ "data-state": Ns(s.open), "data-disabled": s.disabled ? "" : void 0, id: s.contentId, hidden: !g }, a, { ref: u, style: { "--radix-collapsible-content-height": p ? `${p}px` : void 0, "--radix-collapsible-content-width": m ? `${m}px` : void 0, ...e.style } }), g && r); }); function Ns(e) { return e ? "open" : "closed"; } const Ll = ev, ov = Al, rv = Fl, av = /* @__PURE__ */ Oe(void 0); function rt(e) { const n = Be(av); return e || n || "ltr"; } const Ht = "Accordion", sv = [ "Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight" ], [Ds, iv, cv] = Ct(Ht), [wr, h3] = $e(Ht, [ cv, Il ]), Ts = Il(), Vl = /* @__PURE__ */ Y.forwardRef((e, n) => { const { type: t, ...o } = e, r = o, a = o; return /* @__PURE__ */ Y.createElement(Ds.Provider, { scope: e.__scopeAccordion }, t === "multiple" ? /* @__PURE__ */ Y.createElement(fv, C({}, a, { ref: n })) : /* @__PURE__ */ Y.createElement(dv, C({}, r, { ref: n }))); }); Vl.propTypes = { type(e) { const n = e.value || e.defaultValue; return e.type && ![ "single", "multiple" ].includes(e.type) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.") : e.type === "multiple" && typeof n == "string" ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.") : e.type === "single" && Array.isArray(n) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.") : null; } }; const [Hl, lv] = wr(Ht), [zl, uv] = wr(Ht, { collapsible: !1 }), dv = /* @__PURE__ */ Y.forwardRef((e, n) => { const { value: t, defaultValue: o, onValueChange: r = () => { }, collapsible: a = !1, ...s } = e, [i, c] = Ce({ prop: t, defaultProp: o, onChange: r }); return /* @__PURE__ */ Y.createElement(Hl, { scope: e.__scopeAccordion, value: i ? [ i ] : [], onItemOpen: c, onItemClose: Y.useCallback( () => a && c(""), [ a, c ] ) }, /* @__PURE__ */ Y.createElement(zl, { scope: e.__scopeAccordion, collapsible: a }, /* @__PURE__ */ Y.createElement(Bl, C({}, s, { ref: n })))); }), fv = /* @__PURE__ */ Y.forwardRef((e, n) => { const { value: t, defaultValue: o, onValueChange: r = () => { }, ...a } = e, [s = [], i] = Ce({ prop: t, defaultProp: o, onChange: r }), c = Y.useCallback( (u) => i( (d = []) => [ ...d, u ] ), [ i ] ), l = Y.useCallback( (u) => i( (d = []) => d.filter( (p) => p !== u ) ), [ i ] ); return /* @__PURE__ */ Y.createElement(Hl, { scope: e.__scopeAccordion, value: s, onItemOpen: c, onItemClose: l }, /* @__PURE__ */ Y.createElement(zl, { scope: e.__scopeAccordion, collapsible: !0 }, /* @__PURE__ */ Y.createElement(Bl, C({}, a, { ref: n })))); }), [pv, yr] = wr(Ht), Bl = /* @__PURE__ */ Y.forwardRef((e, n) => { const { __scopeAccordion: t, disabled: o, dir: r, orientation: a = "vertical", ...s } = e, i = Y.useRef(null), c = ee(i, n), l = iv(t), d = rt(r) === "ltr", p = T(e.onKeyDown, (f) => { var m; if (!sv.includes(f.key)) return; const g = f.target, v = l().filter((N) => { var F; return !((F = N.ref.current) !== null && F !== void 0 && F.disabled); }), b = v.findIndex( (N) => N.ref.current === g ), $ = v.length; if (b === -1) return; f.preventDefault(); let w = b; const S = 0, _ = $ - 1, R = () => { w = b + 1, w > _ && (w = S); }, E = () => { w = b - 1, w < S && (w = _); }; switch (f.key) { case "Home": w = S; break; case "End": w = _; break; case "ArrowRight": a === "horizontal" && (d ? R() : E()); break; case "ArrowDown": a === "vertical" && R(); break; case "ArrowLeft": a === "horizontal" && (d ? E() : R()); break; case "ArrowUp": a === "vertical" && E(); break; } const O = w % $; (m = v[O].ref.current) === null || m === void 0 || m.focus(); }); return /* @__PURE__ */ Y.createElement(pv, { scope: t, disabled: o, direction: r, orientation: a }, /* @__PURE__ */ Y.createElement(Ds.Slot, { scope: t }, /* @__PURE__ */ Y.createElement(W.div, C({}, s, { "data-orientation": a, ref: c, onKeyDown: o ? void 0 : p })))); }), Fa = "AccordionItem", [gv, Os] = wr(Fa), mv = /* @__PURE__ */ Y.forwardRef((e, n) => { const { __scopeAccordion: t, value: o, ...r } = e, a = yr(Fa, t), s = lv(Fa, t), i = Ts(t), c = Ee(), l = o && s.value.includes(o) || !1, u = a.disabled || e.disabled; return /* @__PURE__ */ Y.createElement(gv, { scope: t, open: l, disabled: u, triggerId: c }, /* @__PURE__ */ Y.createElement(Ll, C({ "data-orientation": a.orientation, "data-state": Gl(l) }, i, r, { ref: n, disabled: u, open: l, onOpenChange: (d) => { d ? s.onItemOpen(o) : s.onItemClose(o); } }))); }), vv = "AccordionHeader", hv = /* @__PURE__ */ Y.forwardRef((e, n) => { const { __scopeAccordion: t, ...o } = e, r = yr(Ht, t), a = Os(vv, t); return /* @__PURE__ */ Y.createElement(W.h3, C({ "data-orientation": r.orientation, "data-state": Gl(a.open), "data-disabled": a.disabled ? "" : void 0 }, o, { ref: n })); }), uc = "AccordionTrigger", bv = /* @__PURE__ */ Y.forwardRef((e, n) => { const { __scopeAccordion: t, ...o } = e, r = yr(Ht, t), a = Os(uc, t), s = uv(uc, t), i = Ts(t); return /* @__PURE__ */ Y.createElement(Ds.ItemSlot, { scope: t }, /* @__PURE__ */ Y.createElement(ov, C({ "aria-disabled": a.open && !s.collapsible || void 0, "data-orientation": r.orientation, id: a.triggerId }, i, o, { ref: n }))); }), $v = "AccordionContent", wv = /* @__PURE__ */ Y.forwardRef((e, n) => { const { __scopeAccordion: t, ...o } = e, r = yr(Ht, t), a = Os($v, t), s = Ts(t); return /* @__PURE__ */ Y.createElement(rv, C({ role: "region", "aria-labelledby": a.triggerId, "data-orientation": r.orientation }, s, o, { ref: n, style: { "--radix-accordion-content-height": "var(--radix-collapsible-content-height)", "--radix-accordion-content-width": "var(--radix-collapsible-content-width)", ...e.style } })); }); function Gl(e) { return e ? "open" : "closed"; } const yv = Vl, xv = mv, Cv = hv, Wl = bv, Kl = wv; /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ var Sv = { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }; /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const _v = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim(), Ge = (e, n) => { const t = P( ({ color: o = "currentColor", size: r = 24, strokeWidth: a = 2, absoluteStrokeWidth: s, className: i = "", children: c, ...l }, u) => h( "svg", { ref: u, ...Sv, width: r, height: r, stroke: o, strokeWidth: s ? Number(a) * 24 / Number(r) : a, className: ["lucide", `lucide-${_v(e)}`, i].join(" "), ...l }, [ ...n.map(([d, p]) => h(d, p)), ...Array.isArray(c) ? c : [c] ] ) ); return t.displayName = `${e}`, t; }; /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Ul = Ge("AlertCircle", [ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }], ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }], ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Pv = Ge("ArrowLeft", [ ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }], ["path", { d: "M19 12H5", key: "x3x0zl" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Ev = Ge("ArrowRight", [ ["path", { d: "M5 12h14", key: "1ays0h" }], ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Rv = Ge("CheckCircle2", [ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }], ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const io = Ge("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const xr = Ge("ChevronDown", [ ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Mv = Ge("ChevronLeft", [ ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Cr = Ge("ChevronRight", [ ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Nv = Ge("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Sr = Ge("Circle", [ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Dv = Ge("Eye", [ ["path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z", key: "rwhkz3" }], ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Tv = Ge("Search", [ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }], ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Ov = Ge("XCircle", [ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }], ["path", { d: "m15 9-6 6", key: "1uzhvr" }], ["path", { d: "m9 9 6 6", key: "z0biqf" }] ]); /** * @license lucide-react v0.341.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Is = Ge("X", [ ["path", { d: "M18 6 6 18", key: "1bl5f8" }], ["path", { d: "m6 6 12 12", key: "d8bk6v" }] ]); function jl(e) { var n, t, o = ""; if (typeof e == "string" || typeof e == "number") o += e; else if (typeof e == "object") if (Array.isArray(e)) { var r = e.length; for (n = 0; n < r; n++) e[n] && (t = jl(e[n])) && (o && (o += " "), o += t); } else for (t in e) e[t] && (o && (o += " "), o += t); return o; } function Iv() { for (var e, n, t = 0, o = "", r = arguments.length; t < r; t++) (e = arguments[t]) && (n = jl(e)) && (o && (o += " "), o += n); return o; } const As = "-"; function Av(e) { const n = Fv(e), { conflictingClassGroups: t, conflictingClassGroupModifiers: o } = e; function r(s) { const i = s.split(As); return i[0] === "" && i.length !== 1 && i.shift(), Yl(i, n) || kv(s); } function a(s, i) { const c = t[s] || []; return i && o[s] ? [...c, ...o[s]] : c; } return { getClassGroupId: r, getConflictingClassGroupIds: a }; } function Yl(e, n) { var s; if (e.length === 0) return n.classGroupId; const t = e[0], o = n.nextPart.get(t), r = o ? Yl(e.slice(1), o) : void 0; if (r) return r; if (n.validators.length === 0) return; const a = e.join(As); return (s = n.validators.find(({ validator: i }) => i(a))) == null ? void 0 : s.classGroupId; } const dc = /^\[(.+)\]$/; function kv(e) { if (dc.test(e)) { const n = dc.exec(e)[1], t = n == null ? void 0 : n.substring(0, n.indexOf(":")); if (t) return "arbitrary.." + t; } } function Fv(e) { const { theme: n, prefix: t } = e, o = { nextPart: /* @__PURE__ */ new Map(), validators: [] }; return Vv(Object.entries(e.classGroups), t).forEach(([a, s]) => { La(s, o, a, n); }), o; } function La(e, n, t, o) { e.forEach((r) => { if (typeof r == "string") { const a = r === "" ? n : fc(n, r); a.classGroupId = t; return; } if (typeof r == "function") { if (Lv(r)) { La(r(o), n, t, o); return; } n.validators.push({ validator: r, classGroupId: t }); return; } Object.entries(r).forEach(([a, s]) => { La(s, fc(n, a), t, o); }); }); } function fc(e, n) { let t = e; return n.split(As).forEach((o) => { t.nextPart.has(o) || t.nextPart.set(o, { nextPart: /* @__PURE__ */ new Map(), validators: [] }), t = t.nextPart.get(o); }), t; } function Lv(e) { return e.isThemeGetter; } function Vv(e, n) { return n ? e.map(([t, o]) => { const r = o.map((a) => typeof a == "string" ? n + a : typeof a == "object" ? Object.fromEntries(Object.entries(a).map(([s, i]) => [n + s, i])) : a); return [t, r]; }) : e; } function Hv(e) { if (e < 1) return { get: () => { }, set: () => { } }; let n = 0, t = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(); function r(a, s) { t.set(a, s), n++, n > e && (n = 0, o = t, t = /* @__PURE__ */ new Map()); } return { get(a) { let s = t.get(a); if (s !== void 0) return s; if ((s = o.get(a)) !== void 0) return r(a, s), s; }, set(a, s) { t.has(a) ? t.set(a, s) : r(a, s); } }; } const ql = "!"; function zv(e) { const n = e.separator, t = n.length === 1, o = n[0], r = n.length; return function(s) { const i = []; let c = 0, l = 0, u; for (let g = 0; g < s.length; g++) { let v = s[g]; if (c === 0) { if (v === o && (t || s.slice(g, g + r) === n)) { i.push(s.slice(l, g)), l = g + r; continue; } if (v === "/") { u = g; continue; } } v === "[" ? c++ : v === "]" && c--; } const d = i.length === 0 ? s : s.substring(l), p = d.startsWith(ql), f = p ? d.substring(1) : d, m = u && u > l ? u - l : void 0; return { modifiers: i, hasImportantModifier: p, baseClassName: f, maybePostfixModifierPosition: m }; }; } function Bv(e) { if (e.length <= 1) return e; const n = []; let t = []; return e.forEach((o) => { o[0] === "[" ? (n.push(...t.sort(), o), t = []) : t.push(o); }), n.push(...t.sort()), n; } function Gv(e) { return { cache: Hv(e.cacheSize), splitModifiers: zv(e), ...Av(e) }; } const Wv = /\s+/; function Kv(e, n) { const { splitModifiers: t, getClassGroupId: o, getConflictingClassGroupIds: r } = n, a = /* @__PURE__ */ new Set(); return e.trim().split(Wv).map((s) => { const { modifiers: i, hasImportantModifier: c, baseClassName: l, maybePostfixModifierPosition: u } = t(s); let d = o(u ? l.substring(0, u) : l), p = !!u; if (!d) { if (!u) return { isTailwindClass: !1, originalClassName: s }; if (d = o(l), !d) return { isTailwindClass: !1, originalClassName: s }; p = !1; } const f = Bv(i).join(":"); return { isTailwindClass: !0, modifierId: c ? f + ql : f, classGroupId: d, originalClassName: s, hasPostfixModifier: p }; }).reverse().filter((s) => { if (!s.isTailwindClass) return !0; const { modifierId: i, classGroupId: c, hasPostfixModifier: l } = s, u = i + c; return a.has(u) ? !1 : (a.add(u), r(c, l).forEach((d) => a.add(i + d)), !0); }).reverse().map((s) => s.originalClassName).join(" "); } function Uv() { let e = 0, n, t, o = ""; for (; e < arguments.length; ) (n = arguments[e++]) && (t = Xl(n)) && (o && (o += " "), o += t); return o; } function Xl(e) { if (typeof e == "string") return e; let n, t = ""; for (let o = 0; o < e.length; o++) e[o] && (n = Xl(e[o])) && (t && (t += " "), t += n); return t; } function jv(e, ...n) { let t, o, r, a = s; function s(c) { const l = n.reduce((u, d) => d(u), e()); return t = Gv(l), o = t.cache.get, r = t.cache.set, a = i, i(c); } function i(c) { const l = o(c); if (l) return l; const u = Kv(c, t); return r(c, u), u; } return function() { return a(Uv.apply(null, arguments)); }; } function xe(e) { const n = (t) => t[e] || []; return n.isThemeGetter = !0, n; } const Ql = /^\[(?:([a-z-]+):)?(.+)\]$/i, Yv = /^\d+\/\d+$/, qv = /* @__PURE__ */ new Set(["px", "full", "screen"]), Xv = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Qv = /\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$/, Zv = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, Jv = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, eh = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/; function vt(e) { return jt(e) || qv.has(e) || Yv.test(e); } function Rt(e) { return xn(e, "length", ch); } function jt(e) { return !!e && !Number.isNaN(Number(e)); } function ko(e) { return xn(e, "number", jt); } function In(e) { return !!e && Number.isInteger(Number(e)); } function th(e) { return e.endsWith("%") && jt(e.slice(0, -1)); } function ue(e) { return Ql.test(e); } function Mt(e) { return Xv.test(e); } const nh = /* @__PURE__ */ new Set(["length", "size", "percentage"]); function oh(e) { return xn(e, nh, Zl); } function rh(e) { return xn(e, "position", Zl); } const ah = /* @__PURE__ */ new Set(["image", "url"]); function sh(e) { return xn(e, ah, uh); } function ih(e) { return xn(e, "", lh); } function An() { return !0; } function xn(e, n, t) { const o = Ql.exec(e); return o ? o[1] ? typeof n == "string" ? o[1] === n : n.has(o[1]) : t(o[2]) : !1; } function ch(e) { return Qv.test(e) && !Zv.test(e); } function Zl() { return !1; } function lh(e) { return Jv.test(e); } function uh(e) { return eh.test(e); } function dh() { const e = xe("colors"), n = xe("spacing"), t = xe("blur"), o = xe("brightness"), r = xe("borderColor"), a = xe("borderRadius"), s = xe("borderSpacing"), i = xe("borderWidth"), c = xe("contrast"), l = xe("grayscale"), u = xe("hueRotate"), d = xe("invert"), p = xe("gap"), f = xe("gradientColorStops"), m = xe("gradientColorStopPositions"), g = xe("inset"), v = xe("margin"), b = xe("opacity"), $ = xe("padding"), w = xe("saturate"), S = xe("scale"), _ = xe("sepia"), R = xe("skew"), E = xe("space"), O = xe("translate"), N = () => ["auto", "contain", "none"], F = () => ["auto", "hidden", "clip", "visible", "scroll"], j = () => ["auto", ue, n], z = () => [ue, n], te = () => ["", vt, Rt], A = () => ["auto", jt, ue], K = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], J = () => ["solid", "dashed", "dotted", "double", "none"], k = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], L = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], G = () => ["", "0", ue], I = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], B = () => [jt, ko], Q = () => [jt, ue]; return { cacheSize: 500, separator: ":", theme: { colors: [An], spacing: [vt, Rt], blur: ["none", "", Mt, ue], brightness: B(), borderColor: [e], borderRadius: ["none", "", "full", Mt, ue], borderSpacing: z(), borderWidth: te(), contrast: B(), grayscale: G(), hueRotate: Q(), invert: G(), gap: z(), gradientColorStops: [e], gradientColorStopPositions: [th, Rt], inset: j(), margin: j(), opacity: B(), padding: z(), saturate: B(), scale: B(), sepia: G(), skew: Q(), space: z(), translate: z() }, classGroups: { // Layout /** * Aspect Ratio * @see https://tailwindcss.com/docs/aspect-ratio */ aspect: [{ aspect: ["auto", "square", "video", ue] }], /** * Container * @see https://tailwindcss.com/docs/container */ container: ["container"], /** * Columns * @see https://tailwindcss.com/docs/columns */ columns: [{ columns: [Mt] }], /** * Break After * @see https://tailwindcss.com/docs/break-after */ "break-after": [{ "break-after": I() }], /** * Break Before * @see https://tailwindcss.com/docs/break-before */ "break-before": [{ "break-before": I() }], /** * Break Inside * @see https://tailwindcss.com/docs/break-inside */ "break-inside": [{ "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"] }], /** * Box Decoration Break * @see https://tailwindcss.com/docs/box-decoration-break */ "box-decoration": [{ "box-decoration": ["slice", "clone"] }], /** * Box Sizing * @see https://tailwindcss.com/docs/box-sizing */ box: [{ box: ["border", "content"] }], /** * Display * @see https://tailwindcss.com/docs/display */ 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"], /** * Floats * @see https://tailwindcss.com/docs/float */ float: [{ float: ["right", "left", "none", "start", "end"] }], /** * Clear * @see https://tailwindcss.com/docs/clear */ clear: [{ clear: ["left", "right", "both", "none", "start", "end"] }], /** * Isolation * @see https://tailwindcss.com/docs/isolation */ isolation: ["isolate", "isolation-auto"], /** * Object Fit * @see https://tailwindcss.com/docs/object-fit */ "object-fit": [{ object: ["contain", "cover", "fill", "none", "scale-down"] }], /** * Object Position * @see https://tailwindcss.com/docs/object-position */ "object-position": [{ object: [...K(), ue] }], /** * Overflow * @see https://tailwindcss.com/docs/overflow */ overflow: [{ overflow: F() }], /** * Overflow X * @see https://tailwindcss.com/docs/overflow */ "overflow-x": [{ "overflow-x": F() }], /** * Overflow Y * @see https://tailwindcss.com/docs/overflow */ "overflow-y": [{ "overflow-y": F() }], /** * Overscroll Behavior * @see https://tailwindcss.com/docs/overscroll-behavior */ overscroll: [{ overscroll: N() }], /** * Overscroll Behavior X * @see https://tailwindcss.com/docs/overscroll-behavior */ "overscroll-x": [{ "overscroll-x": N() }], /** * Overscroll Behavior Y * @see https://tailwindcss.com/docs/overscroll-behavior */ "overscroll-y": [{ "overscroll-y": N() }], /** * Position * @see https://tailwindcss.com/docs/position */ position: ["static", "fixed", "absolute", "relative", "sticky"], /** * Top / Right / Bottom / Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ inset: [{ inset: [g] }], /** * Right / Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ "inset-x": [{ "inset-x": [g] }], /** * Top / Bottom * @see https://tailwindcss.com/docs/top-right-bottom-left */ "inset-y": [{ "inset-y": [g] }], /** * Start * @see https://tailwindcss.com/docs/top-right-bottom-left */ start: [{ start: [g] }], /** * End * @see https://tailwindcss.com/docs/top-right-bottom-left */ end: [{ end: [g] }], /** * Top * @see https://tailwindcss.com/docs/top-right-bottom-left */ top: [{ top: [g] }], /** * Right * @see https://tailwindcss.com/docs/top-right-bottom-left */ right: [{ right: [g] }], /** * Bottom * @see https://tailwindcss.com/docs/top-right-bottom-left */ bottom: [{ bottom: [g] }], /** * Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ left: [{ left: [g] }], /** * Visibility * @see https://tailwindcss.com/docs/visibility */ visibility: ["visible", "invisible", "collapse"], /** * Z-Index * @see https://tailwindcss.com/docs/z-index */ z: [{ z: ["auto", In, ue] }], // Flexbox and Grid /** * Flex Basis * @see https://tailwindcss.com/docs/flex-basis */ basis: [{ basis: j() }], /** * Flex Direction * @see https://tailwindcss.com/docs/flex-direction */ "flex-direction": [{ flex: ["row", "row-reverse", "col", "col-reverse"] }], /** * Flex Wrap * @see https://tailwindcss.com/docs/flex-wrap */ "flex-wrap": [{ flex: ["wrap", "wrap-reverse", "nowrap"] }], /** * Flex * @see https://tailwindcss.com/docs/flex */ flex: [{ flex: ["1", "auto", "initial", "none", ue] }], /** * Flex Grow * @see https://tailwindcss.com/docs/flex-grow */ grow: [{ grow: G() }], /** * Flex Shrink * @see https://tailwindcss.com/docs/flex-shrink */ shrink: [{ shrink: G() }], /** * Order * @see https://tailwindcss.com/docs/order */ order: [{ order: ["first", "last", "none", In, ue] }], /** * Grid Template Columns * @see https://tailwindcss.com/docs/grid-template-columns */ "grid-cols": [{ "grid-cols": [An] }], /** * Grid Column Start / End * @see https://tailwindcss.com/docs/grid-column */ "col-start-end": [{ col: ["auto", { span: ["full", In, ue] }, ue] }], /** * Grid Column Start * @see https://tailwindcss.com/docs/grid-column */ "col-start": [{ "col-start": A() }], /** * Grid Column End * @see https://tailwindcss.com/docs/grid-column */ "col-end": [{ "col-end": A() }], /** * Grid Template Rows * @see https://tailwindcss.com/docs/grid-template-rows */ "grid-rows": [{ "grid-rows": [An] }], /** * Grid Row Start / End * @see https://tailwindcss.com/docs/grid-row */ "row-start-end": [{ row: ["auto", { span: [In, ue] }, ue] }], /** * Grid Row Start * @see https://tailwindcss.com/docs/grid-row */ "row-start": [{ "row-start": A() }], /** * Grid Row End * @see https://tailwindcss.com/docs/grid-row */ "row-end": [{ "row-end": A() }], /** * Grid Auto Flow * @see https://tailwindcss.com/docs/grid-auto-flow */ "grid-flow": [{ "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"] }], /** * Grid Auto Columns * @see https://tailwindcss.com/docs/grid-auto-columns */ "auto-cols": [{ "auto-cols": ["auto", "min", "max", "fr", ue] }], /** * Grid Auto Rows * @see https://tailwindcss.com/docs/grid-auto-rows */ "auto-rows": [{ "auto-rows": ["auto", "min", "max", "fr", ue] }], /** * Gap * @see https://tailwindcss.com/docs/gap */ gap: [{ gap: [p] }], /** * Gap X * @see https://tailwindcss.com/docs/gap */ "gap-x": [{ "gap-x": [p] }], /** * Gap Y * @see https://tailwindcss.com/docs/gap */ "gap-y": [{ "gap-y": [p] }], /** * Justify Content * @see https://tailwindcss.com/docs/justify-content */ "justify-content": [{ justify: ["normal", ...L()] }], /** * Justify Items * @see https://tailwindcss.com/docs/justify-items */ "justify-items": [{ "justify-items": ["start", "end", "center", "stretch"] }], /** * Justify Self * @see https://tailwindcss.com/docs/justify-self */ "justify-self": [{ "justify-self": ["auto", "start", "end", "center", "stretch"] }], /** * Align Content * @see https://tailwindcss.com/docs/align-content */ "align-content": [{ content: ["normal", ...L(), "baseline"] }], /** * Align Items * @see https://tailwindcss.com/docs/align-items */ "align-items": [{ items: ["start", "end", "center", "baseline", "stretch"] }], /** * Align Self * @see https://tailwindcss.com/docs/align-self */ "align-self": [{ self: ["auto", "start", "end", "center", "stretch", "baseline"] }], /** * Place Content * @see https://tailwindcss.com/docs/place-content */ "place-content": [{ "place-content": [...L(), "baseline"] }], /** * Place Items * @see https://tailwindcss.com/docs/place-items */ "place-items": [{ "place-items": ["start", "end", "center", "baseline", "stretch"] }], /** * Place Self * @see https://tailwindcss.com/docs/place-self */ "place-self": [{ "place-self": ["auto", "start", "end", "center", "stretch"] }], // Spacing /** * Padding * @see https://tailwindcss.com/docs/padding */ p: [{ p: [$] }], /** * Padding X * @see https://tailwindcss.com/docs/padding */ px: [{ px: [$] }], /** * Padding Y * @see https://tailwindcss.com/docs/padding */ py: [{ py: [$] }], /** * Padding Start * @see https://tailwindcss.com/docs/padding */ ps: [{ ps: [$] }], /** * Padding End * @see https://tailwindcss.com/docs/padding */ pe: [{ pe: [$] }], /** * Padding Top * @see https://tailwindcss.com/docs/padding */ pt: [{ pt: [$] }], /** * Padding Right * @see https://tailwindcss.com/docs/padding */ pr: [{ pr: [$] }], /** * Padding Bottom * @see https://tailwindcss.com/docs/padding */ pb: [{ pb: [$] }], /** * Padding Left * @see https://tailwindcss.com/docs/padding */ pl: [{ pl: [$] }], /** * Margin * @see https://tailwindcss.com/docs/margin */ m: [{ m: [v] }], /** * Margin X * @see https://tailwindcss.com/docs/margin */ mx: [{ mx: [v] }], /** * Margin Y * @see https://tailwindcss.com/docs/margin */ my: [{ my: [v] }], /** * Margin Start * @see https://tailwindcss.com/docs/margin */ ms: [{ ms: [v] }], /** * Margin End * @see https://tailwindcss.com/docs/margin */ me: [{ me: [v] }], /** * Margin Top * @see https://tailwindcss.com/docs/margin */ mt: [{ mt: [v] }], /** * Margin Right * @see https://tailwindcss.com/docs/margin */ mr: [{ mr: [v] }], /** * Margin Bottom * @see https://tailwindcss.com/docs/margin */ mb: [{ mb: [v] }], /** * Margin Left * @see https://tailwindcss.com/docs/margin */ ml: [{ ml: [v] }], /** * Space Between X * @see https://tailwindcss.com/docs/space */ "space-x": [{ "space-x": [E] }], /** * Space Between X Reverse * @see https://tailwindcss.com/docs/space */ "space-x-reverse": ["space-x-reverse"], /** * Space Between Y * @see https://tailwindcss.com/docs/space */ "space-y": [{ "space-y": [E] }], /** * Space Between Y Reverse * @see https://tailwindcss.com/docs/space */ "space-y-reverse": ["space-y-reverse"], // Sizing /** * Width * @see https://tailwindcss.com/docs/width */ w: [{ w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", ue, n] }], /** * Min-Width * @see https://tailwindcss.com/docs/min-width */ "min-w": [{ "min-w": [ue, n, "min", "max", "fit"] }], /** * Max-Width * @see https://tailwindcss.com/docs/max-width */ "max-w": [{ "max-w": [ue, n, "none", "full", "min", "max", "fit", "prose", { screen: [Mt] }, Mt] }], /** * Height * @see https://tailwindcss.com/docs/height */ h: [{ h: [ue, n, "auto", "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Min-Height * @see https://tailwindcss.com/docs/min-height */ "min-h": [{ "min-h": [ue, n, "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Max-Height * @see https://tailwindcss.com/docs/max-height */ "max-h": [{ "max-h": [ue, n, "min", "max", "fit", "svh", "lvh", "dvh"] }], /** * Size * @see https://tailwindcss.com/docs/size */ size: [{ size: [ue, n, "auto", "min", "max", "fit"] }], // Typography /** * Font Size * @see https://tailwindcss.com/docs/font-size */ "font-size": [{ text: ["base", Mt, Rt] }], /** * Font Smoothing * @see https://tailwindcss.com/docs/font-smoothing */ "font-smoothing": ["antialiased", "subpixel-antialiased"], /** * Font Style * @see https://tailwindcss.com/docs/font-style */ "font-style": ["italic", "not-italic"], /** * Font Weight * @see https://tailwindcss.com/docs/font-weight */ "font-weight": [{ font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", ko] }], /** * Font Family * @see https://tailwindcss.com/docs/font-family */ "font-family": [{ font: [An] }], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ "fvn-normal": ["normal-nums"], /** * Font Variant Numeric * @see ht