@moondreamsdev/dreamer-ui 1.7.7-test.13 → 1.7.7-test.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ "use strict";const t=require("react/jsx-runtime"),a=require("react"),I=require("react-dom"),g=require("./X-CgjeP2OI.cjs"),S=require("./utils.cjs.js");function h(...e){return e.filter(n=>typeof n=="string"&&n).join(" ").trim()||void 0}function M({size:e=15,color:n="currentColor",className:l="inline",...r}){return t.jsx("svg",{...r,width:e,height:e,className:l,viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"})})}function y(...e){return e.filter(n=>typeof n=="string"&&n).join(" ").trim()||void 0}a.createContext(void 0);a.createContext(null);a.createContext(null);a.createContext(null);function O(){const[e,n]=a.useState(0);return a.useEffect(()=>{const l=setInterval(()=>{n(r=>(r+1)%3)},500);return()=>clearInterval(l)},[]),t.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(l=>t.jsx("div",{className:h("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",e===l&&"transform -translate-y-1")},l))})}const $={base:"",primary:"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary-foreground disabled:text-muted",outline:"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"},V={stripped:"",fitted:"size-fit",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},D={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},p={variant:"primary",size:"md",rounded:"md"};function H({variant:e=p.variant,size:n,rounded:l=p.rounded,loading:r,linkTo:s,linkProps:i,type:o="button",className:c,...d}){let u;e==="link"&&!n?u="fitted":u=n||p.size;const m=h("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",$[e],V[u],D[l],r&&"relative pointer-events-none",s&&"relative",c);return t.jsxs("button",{...d,role:s?"link":d.role,"aria-label":d["aria-label"]||(i==null?void 0:i["aria-label"]),"aria-description":d["aria-description"]||(i==null?void 0:i["aria-description"]),"aria-disabled":d.disabled||r,"aria-busy":r,type:o,className:m,children:[r&&t.jsx(O,{}),t.jsx("span",{className:h(r&&"invisible"),children:d.children}),s&&!d.disabled&&t.jsx("a",{...i,"aria-hidden":!0,href:s,rel:(i==null?void 0:i.rel)||"noreferrer",className:"absolute inset-0"})]})}function P(e){const[n,l]=a.useState(!1),[r,s]=a.useState(!1);return a.useEffect(()=>{e?(s(!0),setTimeout(()=>l(!0),10)):(l(!1),setTimeout(()=>s(!1),150))},[e]),{show:n,shouldRender:r}}function X(e,n){a.useEffect(()=>{const l=r=>{r.key==="Escape"&&e&&n()};return document.addEventListener("keydown",l),e&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",l),document.body.style.overflow="auto"}},[e,n])}function F(e,n){const l=a.useRef(null),r=a.useCallback(()=>{const s=document.getElementById(e);if(!s)return;const i=s.querySelectorAll('[data-modal-action="true"]');if(i.length>0){i[0].focus();return}const o=s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(o.length>0){const c=Array.from(o).filter(d=>!(d instanceof HTMLButtonElement&&d.getAttribute("data-modal-close-button")==="true"));if(c.length>0){c[0].focus();return}o[0].focus();return}s.focus()},[e]);a.useEffect(()=>(n&&(l.current=document.activeElement,r()),()=>{document.body.style.overflow="auto",l.current instanceof HTMLElement&&l.current.focus()}),[n,r])}function J({id:e,isOpen:n,onClose:l,title:r,children:s,contentOnly:i=!1,className:o,overlayClassName:c,hideCloseButton:d=!1,actions:u=[],disableCloseOnOverlayClick:m=!1,ariaLabelledBy:f,ariaDescribedBy:b}){const x=a.useId(),j=e||`modal-${x}`,k=e?`${e}-title`:`modal-title-${x}`,{show:C,shouldRender:v}=P(n);if(F(j,v),X(v,l),!v)return null;const E=()=>r?a.isValidElement(r)?t.jsx("div",{className:"mb-4",children:r}):t.jsx("h2",{className:"mb-4 text-xl font-semibold",id:k,children:r}):null,T=()=>u.length===0?null:t.jsx("div",{className:"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3",children:u.map((z,L)=>{const{label:A,className:q,...B}=z;return t.jsx(H,{className:q,type:"button",...B,"data-modal-action":"true",children:A},L)})});return t.jsx(t.Fragment,{children:I.createPortal(t.jsx("div",{"aria-labelledby":f??r?k:void 0,"aria-describedby":b,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:t.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[t.jsx("div",{className:y("fixed inset-0 bg-black/20 transition-all",c),onClick:()=>{m||l()}}),i&&t.jsx("div",{className:y("relative w-fit",o),children:s}),!i&&t.jsxs("div",{id:j,tabIndex:-1,className:y("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",C?"opacity-100 scale-100":"opacity-0 scale-90",o),children:[!d&&t.jsx("button",{type:"button",onClick:l,"data-modal-close-button":"true",className:"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:t.jsx(M,{size:18})}),E(),s,T()]})]})}),document.body)})}function K({type:e,message:n,cancelText:l,confirmText:r,onConfirm:s,onClose:i,destructive:o=!1,title:c,...d}){const u=a.useMemo(()=>e==="confirm"?{confirm:r||"Confirm",cancel:l||"Cancel",defaultTitle:c||"Confirm Action"}:{confirm:r||"OK",cancel:null,defaultTitle:c||"Alert"},[e,r,c,l]),m=a.useMemo(()=>[...u.cancel?[{label:u.cancel,variant:"secondary",onClick:i}]:[],{label:u.confirm,variant:o?"destructive":"primary",onClick:()=>{s==null||s(),i()}}],[u,o,s,i]);return t.jsx(J,{...d,title:c||u.defaultTitle,onClose:i,actions:m,disableCloseOnOverlayClick:e==="confirm",hideCloseButton:e==="confirm",children:typeof n=="string"?t.jsx("p",{className:"text-sm",children:n}):n})}const N=a.createContext(null),R=()=>{const e=a.useContext(N);if(!e)throw new Error("Tabs components must be used within a Tabs component");return e},w={info:{className:"bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",icon:t.jsx(g.InfoCircled,{size:20})},warning:{className:"bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",icon:t.jsx(g.ExclamationTriangle,{size:20})},error:{className:"bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",icon:t.jsx(g.CrossCircled,{size:20})}};function Z({id:e,title:n,description:l,type:r="info",action:s,duration:i=5e3,onRemove:o,customTypes:c,customComponent:d}){const[u,m]=a.useState(!1),f=a.useCallback(()=>{m(!0),setTimeout(()=>{o==null||o(e)},150)},[e,o]);if(a.useEffect(()=>{if(i>0){const x=setTimeout(()=>{f()},i);return()=>clearTimeout(x)}},[i,e,o,f]),d)return t.jsx(d,{id:e,title:n,description:l,type:r,action:s,duration:i,onRemove:o});const b=(c==null?void 0:c[r])||w[r]||w.info;return t.jsxs("div",{role:r==="error"?"alert":"status","aria-live":r==="error"?void 0:"polite",className:S.join("relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",s&&"pb-3",b.className,u?"opacity-0 translate-x-full":"opacity-100 translate-x-0"),children:[t.jsx("div",{className:"flex-shrink-0 mr-3",children:b.icon}),t.jsxs("div",{className:"flex-grow min-w-0",children:[t.jsx("div",{className:"font-medium text-sm leading-5",children:n}),l&&t.jsx("div",{className:"mt-1 text-sm opacity-90 leading-5",children:l}),s&&t.jsx("div",{className:"mt-1.5",children:t.jsx("button",{onClick:s.onClick,className:"text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer",children:s.label})})]}),t.jsx("button",{onClick:f,className:"flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0",children:t.jsx(g.X,{size:16})})]})}exports.ActionModal=K;exports.TabsContext=N;exports.Toast=Z;exports.n=h;exports.useTabsContext=R;
2
+ //# sourceMappingURL=Toast-CkxIjis9.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toast-CkxIjis9.cjs","sources":["utils.esm.js","X-CIoyLewf.js","Toast-cdFf2Gbf.js","components.esm.js","../src/components/actionmodal/ActionModal.tsx","../src/components/tabs/TabsContext.tsx","../src/components/toast/Toast.tsx"],"sourcesContent":["function n(...t) {\n return t.filter((s) => typeof s == \"string\" && s).join(\" \").trim() || void 0;\n}\nexport {\n n as join\n};\n//# sourceMappingURL=utils.esm.js.map\n","import { jsx as e } from \"react/jsx-runtime\";\nfunction t({\n size: C = 15,\n color: l = \"currentColor\",\n className: n = \"inline\",\n ...i\n}) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704ZM9.85358 5.14644C10.0488 5.3417 10.0488 5.65829 9.85358 5.85355L8.20713 7.49999L9.85358 9.14644C10.0488 9.3417 10.0488 9.65829 9.85358 9.85355C9.65832 10.0488 9.34173 10.0488 9.14647 9.85355L7.50002 8.2071L5.85358 9.85355C5.65832 10.0488 5.34173 10.0488 5.14647 9.85355C4.95121 9.65829 4.95121 9.3417 5.14647 9.14644L6.79292 7.49999L5.14647 5.85355C4.95121 5.65829 4.95121 5.3417 5.14647 5.14644C5.34173 4.95118 5.65832 4.95118 5.85358 5.14644L7.50002 6.79289L9.14647 5.14644C9.34173 4.95118 9.65832 4.95118 9.85358 5.14644Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction o({\n size: C = 15,\n color: l = \"currentColor\",\n className: n = \"inline\",\n ...i\n}) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction d({\n size: C = 15,\n color: l = \"currentColor\",\n className: n = \"inline\",\n ...i\n}) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction h({ size: C = 15, color: l = \"currentColor\", className: n = \"inline\", ...i }) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nexport {\n t as C,\n o as E,\n d as I,\n h as X\n};\n//# sourceMappingURL=X-CIoyLewf.js.map\n","import { jsx as r, Fragment as $, jsxs as f } from \"react/jsx-runtime\";\nimport q, { createContext as v, useId as V, useState as p, useEffect as b, useRef as H, useCallback as z, useMemo as E, useContext as P } from \"react\";\nimport { createPortal as D } from \"react-dom\";\nimport { X as F, C as J, E as K, I as X } from \"./X-CIoyLewf.js\";\nimport { join as Z } from \"./utils.esm.js\";\nfunction k(...e) {\n return e.filter((l) => typeof l == \"string\" && l).join(\" \").trim() || void 0;\n}\nfunction G({ size: e = 15, color: l = \"currentColor\", className: n = \"inline\", ...t }) {\n return /* @__PURE__ */ r(\n \"svg\",\n {\n ...t,\n width: e,\n height: e,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ r(\n \"path\",\n {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction x(...e) {\n return e.filter((l) => typeof l == \"string\" && l).join(\" \").trim() || void 0;\n}\nv(void 0);\nv(null);\nv(null);\nfunction Q() {\n const [e, l] = p(0);\n return b(() => {\n const n = setInterval(() => {\n l((t) => (t + 1) % 3);\n }, 500);\n return () => clearInterval(n);\n }, []), /* @__PURE__ */ r(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((n) => /* @__PURE__ */ r(\n \"div\",\n {\n className: k(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n e === n && \"transform -translate-y-1\"\n )\n },\n n\n )) });\n}\nconst R = {\n base: \"\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80\",\n tertiary: \"text-primary hover:text-primary-foreground disabled:text-muted\",\n outline: \"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted\",\n link: \"underline-offset-4 hover:underline disabled:underline disabled:text-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground\"\n}, U = {\n stripped: \"\",\n fitted: \"size-fit\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n icon: \"p-1 w-fit aspect-square\",\n full: \"p-2 w-full\"\n}, W = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, w = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction Y({\n variant: e = w.variant,\n size: l,\n rounded: n = w.rounded,\n loading: t,\n linkTo: i,\n linkProps: a,\n type: o = \"button\",\n className: d,\n ...s\n}) {\n let c;\n e === \"link\" && !l ? c = \"fitted\" : c = l || w.size;\n const u = k(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n R[e],\n U[c],\n W[n],\n t && \"relative pointer-events-none\",\n i && \"relative\",\n d\n );\n return /* @__PURE__ */ f(\n \"button\",\n {\n ...s,\n role: i ? \"link\" : s.role,\n \"aria-label\": s[\"aria-label\"] || (a == null ? void 0 : a[\"aria-label\"]),\n \"aria-description\": s[\"aria-description\"] || (a == null ? void 0 : a[\"aria-description\"]),\n \"aria-disabled\": s.disabled || t,\n \"aria-busy\": t,\n type: o,\n className: u,\n children: [\n t && /* @__PURE__ */ r(Q, {}),\n /* @__PURE__ */ r(\"span\", { className: k(t && \"invisible\"), children: s.children }),\n i && !s.disabled && /* @__PURE__ */ r(\n \"a\",\n {\n ...a,\n \"aria-hidden\": !0,\n href: i,\n rel: (a == null ? void 0 : a.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction _(e) {\n const [l, n] = p(!1), [t, i] = p(!1);\n return b(() => {\n e ? (i(!0), setTimeout(() => n(!0), 10)) : (n(!1), setTimeout(() => i(!1), 150));\n }, [e]), { show: l, shouldRender: t };\n}\nfunction ee(e, l) {\n b(() => {\n const n = (t) => {\n t.key === \"Escape\" && e && l();\n };\n return document.addEventListener(\"keydown\", n), e && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", n), document.body.style.overflow = \"auto\";\n };\n }, [e, l]);\n}\nfunction te(e, l) {\n const n = H(null), t = z(() => {\n const i = document.getElementById(e);\n if (!i) return;\n const a = i.querySelectorAll('[data-modal-action=\"true\"]');\n if (a.length > 0) {\n a[0].focus();\n return;\n }\n const o = i.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (o.length > 0) {\n const d = Array.from(o).filter((s) => !(s instanceof HTMLButtonElement && s.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (d.length > 0) {\n d[0].focus();\n return;\n }\n o[0].focus();\n return;\n }\n i.focus();\n }, [e]);\n b(() => (l && (n.current = document.activeElement, t()), () => {\n document.body.style.overflow = \"auto\", n.current instanceof HTMLElement && n.current.focus();\n }), [l, t]);\n}\nfunction re({\n id: e,\n isOpen: l,\n onClose: n,\n title: t,\n children: i,\n contentOnly: a = !1,\n className: o,\n overlayClassName: d,\n hideCloseButton: s = !1,\n actions: c = [],\n disableCloseOnOverlayClick: u = !1,\n ariaLabelledBy: m,\n ariaDescribedBy: g\n}) {\n const h = V(), N = e || `modal-${h}`, C = e ? `${e}-title` : `modal-title-${h}`, { show: L, shouldRender: y } = _(l);\n if (te(N, y), ee(y, n), !y) return null;\n const j = () => t ? q.isValidElement(t) ? /* @__PURE__ */ r(\"div\", { className: \"mb-4\", children: t }) : /* @__PURE__ */ r(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: C, children: t }) : null, A = () => c.length === 0 ? null : /* @__PURE__ */ r(\"div\", { className: \"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3\", children: c.map((I, B) => {\n const { label: O, className: M, ...S } = I;\n return /* @__PURE__ */ r(Y, { className: M, type: \"button\", ...S, \"data-modal-action\": \"true\", children: O }, B);\n }) });\n return /* @__PURE__ */ r($, { children: D(\n /* @__PURE__ */ r(\n \"div\",\n {\n \"aria-labelledby\": m ?? t ? C : void 0,\n \"aria-describedby\": g,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ f(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ r(\n \"div\",\n {\n className: x(\"fixed inset-0 bg-black/20 transition-all\", d),\n onClick: () => {\n u || n();\n }\n }\n ),\n a && /* @__PURE__ */ r(\"div\", { className: x(\"relative w-fit\", o), children: i }),\n !a && /* @__PURE__ */ f(\n \"div\",\n {\n id: N,\n tabIndex: -1,\n className: x(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75\",\n L ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n o\n ),\n children: [\n !s && /* @__PURE__ */ r(\n \"button\",\n {\n type: \"button\",\n onClick: n,\n \"data-modal-close-button\": \"true\",\n className: \"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0\",\n children: /* @__PURE__ */ r(G, { size: 18 })\n }\n ),\n j(),\n i,\n A()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction de({\n type: e,\n message: l,\n cancelText: n,\n confirmText: t,\n onConfirm: i,\n onClose: a,\n destructive: o = !1,\n title: d,\n ...s\n}) {\n const c = E(() => e === \"confirm\" ? {\n confirm: t || \"Confirm\",\n cancel: n || \"Cancel\",\n defaultTitle: d || \"Confirm Action\"\n } : {\n confirm: t || \"OK\",\n cancel: null,\n defaultTitle: d || \"Alert\"\n }, [e, t, d, n]), u = E(\n () => [\n ...c.cancel ? [\n {\n label: c.cancel,\n variant: \"secondary\",\n onClick: a\n }\n ] : [],\n {\n label: c.confirm,\n variant: o ? \"destructive\" : \"primary\",\n onClick: () => {\n i == null || i(), a();\n }\n }\n ],\n [c, o, i, a]\n );\n return /* @__PURE__ */ r(\n re,\n {\n ...s,\n title: d || c.defaultTitle,\n onClose: a,\n actions: u,\n disableCloseOnOverlayClick: e === \"confirm\",\n hideCloseButton: e === \"confirm\",\n children: typeof l == \"string\" ? /* @__PURE__ */ r(\"p\", { className: \"text-sm\", children: l }) : l\n }\n );\n}\nconst le = v(null), ce = () => {\n const e = P(le);\n if (!e)\n throw new Error(\"Tabs components must be used within a Tabs component\");\n return e;\n}, T = {\n info: {\n className: \"bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100\",\n icon: /* @__PURE__ */ r(X, { size: 20 })\n },\n warning: {\n className: \"bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100\",\n icon: /* @__PURE__ */ r(K, { size: 20 })\n },\n error: {\n className: \"bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100\",\n icon: /* @__PURE__ */ r(J, { size: 20 })\n }\n};\nfunction ue({\n id: e,\n title: l,\n description: n,\n type: t = \"info\",\n action: i,\n duration: a = 5e3,\n onRemove: o,\n customTypes: d,\n customComponent: s\n}) {\n const [c, u] = p(!1), m = z(() => {\n u(!0), setTimeout(() => {\n o == null || o(e);\n }, 150);\n }, [e, o]);\n if (b(() => {\n if (a > 0) {\n const h = setTimeout(() => {\n m();\n }, a);\n return () => clearTimeout(h);\n }\n }, [a, e, o, m]), s)\n return /* @__PURE__ */ r(\n s,\n {\n id: e,\n title: l,\n description: n,\n type: t,\n action: i,\n duration: a,\n onRemove: o\n }\n );\n const g = (d == null ? void 0 : d[t]) || T[t] || T.info;\n return /* @__PURE__ */ f(\n \"div\",\n {\n role: t === \"error\" ? \"alert\" : \"status\",\n \"aria-live\": t === \"error\" ? void 0 : \"polite\",\n className: Z(\n \"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out\",\n i && \"pb-3\",\n g.className,\n c ? \"opacity-0 translate-x-full\" : \"opacity-100 translate-x-0\"\n ),\n children: [\n /* @__PURE__ */ r(\"div\", { className: \"flex-shrink-0 mr-3\", children: g.icon }),\n /* @__PURE__ */ f(\"div\", { className: \"flex-grow min-w-0\", children: [\n /* @__PURE__ */ r(\"div\", { className: \"font-medium text-sm leading-5\", children: l }),\n n && /* @__PURE__ */ r(\"div\", { className: \"mt-1 text-sm opacity-90 leading-5\", children: n }),\n i && /* @__PURE__ */ r(\"div\", { className: \"mt-1.5\", children: /* @__PURE__ */ r(\n \"button\",\n {\n onClick: i.onClick,\n className: \"text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer\",\n children: i.label\n }\n ) })\n ] }),\n /* @__PURE__ */ r(\n \"button\",\n {\n onClick: m,\n className: \"flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0\",\n children: /* @__PURE__ */ r(F, { size: 16 })\n }\n )\n ]\n }\n );\n}\nexport {\n de as A,\n ue as T,\n le as a,\n k as n,\n ce as u\n};\n//# sourceMappingURL=Toast-cdFf2Gbf.js.map\n","import { jsxs as C, jsx as c, Fragment as O } from \"react/jsx-runtime\";\nimport j, { useId as z, useState as A, createElement as le, useEffect as $, useCallback as I, useMemo as ee, useRef as F, isValidElement as ue, cloneElement as fe } from \"react\";\nimport { join as w } from \"./utils.esm.js\";\nimport { d as me, C as be, a as he, g as pe, E as ge, Q as ve, b as ye, e as we, f as xe, c as Ne } from \"./QuestionMarkCircled-CY81euqP.js\";\nimport { n as L, a as Ee, u as te } from \"./Toast-cdFf2Gbf.js\";\nimport { A as Rt, T as zt } from \"./Toast-cdFf2Gbf.js\";\nimport { E as Ce, X as ce } from \"./X-CIoyLewf.js\";\nimport { createPortal as re } from \"react-dom\";\nfunction Z({\n id: n,\n title: o,\n content: t,\n children: a,\n className: e = \"\",\n disabled: r = !1,\n isOpen: s = !1,\n onToggle: i,\n triggerClassName: u = \"\",\n bodyClassName: d = \"\"\n}) {\n const m = z(), l = n || `accordion-item-${m}`, g = `${l}-header`, f = `${l}-panel`, b = () => {\n !r && i && i();\n }, v = (h) => {\n (h.key === \"Enter\" || h.key === \" \") && (h.preventDefault(), b());\n };\n return /* @__PURE__ */ C(\"div\", { className: w(\"border-b border-gray-200\", r && \"opacity-60 cursor-not-allowed\", e), children: [\n /* @__PURE__ */ C(\n \"button\",\n {\n id: g,\n type: \"button\",\n className: w(\n \"w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary\",\n r ? \"cursor-not-allowed\" : \"hover:bg-gray-50/10 cursor-pointer\",\n u\n ),\n \"aria-expanded\": s,\n \"aria-controls\": f,\n disabled: r,\n onClick: b,\n onKeyDown: v,\n children: [\n /* @__PURE__ */ c(\"span\", { children: o }),\n /* @__PURE__ */ c(\n \"span\",\n {\n className: w(\n \"transform transition-transform duration-300 ease-linear\",\n s ? \"rotate-180\" : \"rotate-0\"\n ),\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */ c(me, { size: 18 })\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: f,\n role: \"region\",\n \"aria-labelledby\": g,\n className: w(\n \"transition-all duration-300 ease-linear px-4\",\n s ? \"max-h-96 opacity-100 overflow-auto py-3\" : \"max-h-0 opacity-0 overflow-hidden\",\n d\n ),\n children: s && (a || t)\n }\n )\n ] });\n}\nfunction dt({\n id: n,\n items: o = [],\n children: t,\n className: a = \"\",\n itemClassName: e = \"\",\n allowMultiple: r = !1,\n defaultOpenItems: s = [],\n triggersClassName: i = \"\",\n bodiesClassName: u = \"\"\n}) {\n const d = z(), m = n || `accordion-group-${d}`, [l, g] = A(new Set(s)), f = (h) => {\n g((y) => {\n const p = new Set(y);\n return p.has(h) ? p.delete(h) : (r || p.clear(), p.add(h)), p;\n });\n }, b = (h) => `${d}-item-${h}`, v = (h) => l.has(h);\n return /* @__PURE__ */ C(\"div\", { id: m, className: a, children: [\n o.length > 0 && o.map((h, y) => {\n const p = h.id || b(y);\n return /* @__PURE__ */ c(\n Z,\n {\n id: p,\n title: h.title,\n content: h.content,\n disabled: h.disabled,\n isOpen: v(p),\n onToggle: () => f(p),\n className: e,\n triggerClassName: i,\n bodyClassName: u\n },\n p\n );\n }),\n o.length === 0 && t && j.Children.map(t, (h, y) => {\n if (j.isValidElement(h) && h.type === Z) {\n const p = h.props.id || b(y);\n return /* @__PURE__ */ le(\n Z,\n {\n ...h.props,\n key: p,\n id: p,\n className: w(e, h.props.className),\n isOpen: v(p),\n onToggle: () => f(p),\n triggerClassName: w(i, h.props.triggerClassName),\n bodyClassName: w(u, h.props.bodyClassName)\n }\n );\n }\n return null;\n })\n ] });\n}\nfunction Ae() {\n const [n, o] = A(0);\n return $(() => {\n const t = setInterval(() => {\n o((a) => (a + 1) % 3);\n }, 500);\n return () => clearInterval(t);\n }, []), /* @__PURE__ */ c(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((t) => /* @__PURE__ */ c(\n \"div\",\n {\n className: w(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n n === t && \"transform -translate-y-1\"\n )\n },\n t\n )) });\n}\nconst Ie = {\n base: \"\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80\",\n tertiary: \"text-primary hover:text-primary-foreground disabled:text-muted\",\n outline: \"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted\",\n link: \"underline-offset-4 hover:underline disabled:underline disabled:text-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground\"\n}, ke = {\n stripped: \"\",\n fitted: \"size-fit\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n icon: \"p-1 w-fit aspect-square\",\n full: \"p-2 w-full\"\n}, Te = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, J = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction $e({\n variant: n = J.variant,\n size: o,\n rounded: t = J.rounded,\n loading: a,\n linkTo: e,\n linkProps: r,\n type: s = \"button\",\n className: i,\n ...u\n}) {\n let d;\n n === \"link\" && !o ? d = \"fitted\" : d = o || J.size;\n const l = w(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n Ie[n],\n ke[d],\n Te[t],\n a && \"relative pointer-events-none\",\n e && \"relative\",\n i\n );\n return /* @__PURE__ */ C(\n \"button\",\n {\n ...u,\n role: e ? \"link\" : u.role,\n \"aria-label\": u[\"aria-label\"] || (r == null ? void 0 : r[\"aria-label\"]),\n \"aria-description\": u[\"aria-description\"] || (r == null ? void 0 : r[\"aria-description\"]),\n \"aria-disabled\": u.disabled || a,\n \"aria-busy\": a,\n type: s,\n className: l,\n children: [\n a && /* @__PURE__ */ c(Ae, {}),\n /* @__PURE__ */ c(\"span\", { className: w(a && \"invisible\"), children: u.children }),\n e && !u.disabled && /* @__PURE__ */ c(\n \"a\",\n {\n ...r,\n \"aria-hidden\": !0,\n href: e,\n rel: (r == null ? void 0 : r.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction De(n) {\n const [o, t] = A(\"\"), a = I((e) => {\n let r = e, s = \"\";\n for (; r && !s; ) {\n const i = window.getComputedStyle(r).backgroundColor;\n i && i !== \"transparent\" && i !== \"rgba(0, 0, 0, 0)\" && (s = i), r = r.parentElement;\n }\n return s || \"transparent\";\n }, []);\n return $(() => {\n const e = document.getElementById(n);\n if (e) {\n const r = a(e.parentElement);\n t(r);\n }\n }, [n, a]), o;\n}\nfunction ut({\n ref: n,\n id: o,\n size: t = 20,\n color: a,\n filled: e = !1,\n rounded: r = !0,\n checked: s = !1,\n onCheckedChange: i,\n disabled: u,\n className: d = \"\",\n ...m\n}) {\n const l = z(), g = ee(() => o || `checkbox-${l}`, [o, l]), f = De(g), [b, v] = A(s);\n $(() => {\n v(s);\n }, [s]);\n const h = () => {\n u || (v(!b), i == null || i(!b));\n }, y = (x) => {\n x.key === \" \" && (x.preventDefault(), h());\n }, p = w(\n \"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2\",\n r && \"rounded\",\n u && \"opacity-40 cursor-not-allowed\",\n !u && \"cursor-pointer\",\n d\n );\n return /* @__PURE__ */ c(\n \"button\",\n {\n id: g,\n type: \"button\",\n ref: n,\n tabIndex: 0,\n role: \"checkbox\",\n onClick: h,\n \"aria-checked\": b,\n \"aria-disabled\": u,\n onKeyDownCapture: y,\n style: {\n width: t,\n height: t,\n color: a,\n backgroundColor: b && e ? \"currentcolor\" : \"transparent\"\n },\n className: p,\n ...m,\n children: b && /* @__PURE__ */ c(be, { size: t, color: e ? f : void 0 })\n }\n );\n}\nfunction ft({\n children: n,\n className: o,\n linkTo: t,\n linkProps: a,\n onButtonClick: e,\n buttonProps: r,\n ...s\n}) {\n return t && e && console.warn('Clickable: Both \"linkTo\" and \"onButtonClick\" props are provided. Only \"linkTo\" will be used.'), /* @__PURE__ */ C(\"div\", { className: w(\"relative w-fit\", o), ...s, children: [\n n,\n t && /* @__PURE__ */ c(\n \"a\",\n {\n ...a,\n rel: (a == null ? void 0 : a.rel) || \"noreferrer\",\n href: t,\n className: w(\"absolute inset-0\", a == null ? void 0 : a.className)\n }\n ),\n !t && e && /* @__PURE__ */ c(\n \"button\",\n {\n ...r,\n type: \"button\",\n onClick: e,\n className: w(\"absolute inset-0 cursor-pointer\", r == null ? void 0 : r.className)\n }\n )\n ] });\n}\nfunction Q({ elementId: n, type: o, message: t }) {\n return $(() => {\n const a = document.getElementById(n);\n if (a) {\n if (!t && o === \"error\") {\n a.removeAttribute(\"data-error\");\n return;\n }\n if (!t && o === \"success\") {\n a.removeAttribute(\"data-success\");\n return;\n }\n return a.setAttribute(\"aria-describedby\", `${n}-${o}-message`), a.setAttribute(\"aria-invalid\", o === \"error\" ? \"true\" : \"false\"), o === \"error\" && a.setAttribute(\"data-error\", \"true\"), o === \"success\" && a.setAttribute(\"data-success\", \"true\"), () => {\n a.removeAttribute(\"aria-describedby\"), a.removeAttribute(\"aria-invalid\"), a.removeAttribute(\"data-error\"), a.removeAttribute(\"data-success\");\n };\n }\n }, [n, o, t]), t ? /* @__PURE__ */ C(\n \"small\",\n {\n className: w(\n \"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start\",\n o === \"error\" && \"text-destructive\",\n o === \"success\" && \"text-success\"\n ),\n role: \"status\",\n children: [\n o === \"error\" ? /* @__PURE__ */ c(Ce, {}) : /* @__PURE__ */ c(he, {}),\n /* @__PURE__ */ c(\"span\", { id: `${n}-${o}-message`, children: t })\n ]\n }\n ) : null;\n}\nconst Le = {\n base: \"\",\n default: \"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success\",\n underline: \"border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\",\n outline: \"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\"\n}, Re = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, ne = {\n variant: \"default\",\n rounded: \"none\"\n};\nfunction mt({\n variant: n = ne.variant,\n rounded: o,\n displayOnlyMode: t = !1,\n errorMessage: a,\n successMessage: e,\n type: r = \"text\",\n className: s,\n ...i\n}) {\n const u = z(), [d, m] = A(!1);\n let l = o;\n n === \"outline\" && !o && (l = \"md\"), l = l || ne.rounded;\n const b = w(\n \"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all\",\n \"file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors\",\n !t && Le[n],\n !t && Re[l],\n r === \"password\" && \"pr-10\",\n !t && \"px-2 py-1\",\n t && \"pointer-events-none\",\n s\n );\n return /* @__PURE__ */ C(\"div\", { className: w(t && \"cursor-text\"), style: { height: i.height, width: i.width }, children: [\n /* @__PURE__ */ C(\"div\", { className: w(r === \"password\" && \"relative\"), children: [\n /* @__PURE__ */ c(\n \"input\",\n {\n ...i,\n id: u,\n type: r === \"password\" && d ? \"text\" : r,\n \"aria-disabled\": i.disabled,\n readOnly: t,\n \"aria-readonly\": t || i[\"aria-readonly\"],\n \"data-error\": a ? !0 : void 0,\n \"data-success\": e ? !0 : void 0,\n className: b\n }\n ),\n r === \"password\" && /* @__PURE__ */ c(\n \"button\",\n {\n onClick: () => m(!d),\n className: \"absolute inset-y-0 right-0 px-2 hover:cursor-pointer\",\n \"aria-label\": \"Toggle password visibility\",\n \"data-state\": d ? \"visible\" : \"hidden\",\n children: d ? /* @__PURE__ */ c(pe, { size: 20 }) : /* @__PURE__ */ c(ge, { size: 20 })\n }\n )\n ] }),\n !t && /* @__PURE__ */ c(Q, { elementId: u, type: \"error\", message: a }),\n !t && /* @__PURE__ */ c(Q, { elementId: u, type: \"success\", message: e })\n ] });\n}\nfunction bt({\n display: n = \"inline\",\n width: o = \"fit-content\",\n className: t = \"\",\n required: a,\n helpMessage: e,\n suffix: r,\n htmlFor: s,\n children: i,\n ...u\n}) {\n const d = z(), m = w(\"font-medium\", n, t), l = e ? `${s ?? d}-help` : void 0;\n return /* @__PURE__ */ C(\"div\", { style: { display: n === \"inline\" ? \"inline-flex\" : \"flex\", width: o }, className: \"relative\", children: [\n /* @__PURE__ */ C(\"label\", { className: m, htmlFor: s, ...u, children: [\n i,\n a && /* @__PURE__ */ c(\"span\", { className: \"text-red-500 font-medium ml-1\", \"aria-label\": \"required\", children: \"*\" })\n ] }),\n e && /* @__PURE__ */ c(\n \"span\",\n {\n className: \"text-gray-500 ml-1 size-fit -translate-y-1/3\",\n \"aria-describedby\": l,\n \"aria-label\": \"Help information\",\n title: e,\n children: /* @__PURE__ */ c(ve, {})\n }\n ),\n e && /* @__PURE__ */ c(\"div\", { id: l, className: \"sr-only\", children: e }),\n r && /* @__PURE__ */ c(\"span\", { className: \"ml-1\", children: r })\n ] });\n}\nfunction ze(n) {\n const [o, t] = A(!1), [a, e] = A(!1);\n return $(() => {\n n ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));\n }, [n]), { show: o, shouldRender: a };\n}\nfunction Ve(n, o) {\n $(() => {\n const t = (a) => {\n a.key === \"Escape\" && n && o();\n };\n return document.addEventListener(\"keydown\", t), n && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", t), document.body.style.overflow = \"auto\";\n };\n }, [n, o]);\n}\nfunction Be(n, o) {\n const t = F(null), a = I(() => {\n const e = document.getElementById(n);\n if (!e) return;\n const r = e.querySelectorAll('[data-modal-action=\"true\"]');\n if (r.length > 0) {\n r[0].focus();\n return;\n }\n const s = e.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (s.length > 0) {\n const i = Array.from(s).filter((u) => !(u instanceof HTMLButtonElement && u.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (i.length > 0) {\n i[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n e.focus();\n }, [n]);\n $(() => (o && (t.current = document.activeElement, a()), () => {\n document.body.style.overflow = \"auto\", t.current instanceof HTMLElement && t.current.focus();\n }), [o, a]);\n}\nfunction ht({\n id: n,\n isOpen: o,\n onClose: t,\n title: a,\n children: e,\n contentOnly: r = !1,\n className: s,\n overlayClassName: i,\n hideCloseButton: u = !1,\n actions: d = [],\n disableCloseOnOverlayClick: m = !1,\n ariaLabelledBy: l,\n ariaDescribedBy: g\n}) {\n const f = z(), b = n || `modal-${f}`, v = n ? `${n}-title` : `modal-title-${f}`, { show: h, shouldRender: y } = ze(o);\n if (Be(b, y), Ve(y, t), !y) return null;\n const p = () => a ? j.isValidElement(a) ? /* @__PURE__ */ c(\"div\", { className: \"mb-4\", children: a }) : /* @__PURE__ */ c(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: v, children: a }) : null, x = () => d.length === 0 ? null : /* @__PURE__ */ c(\"div\", { className: \"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3\", children: d.map((N, E) => {\n const { label: V, className: k, ...R } = N;\n return /* @__PURE__ */ c($e, { className: k, type: \"button\", ...R, \"data-modal-action\": \"true\", children: V }, E);\n }) });\n return /* @__PURE__ */ c(O, { children: re(\n /* @__PURE__ */ c(\n \"div\",\n {\n \"aria-labelledby\": l ?? a ? v : void 0,\n \"aria-describedby\": g,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ C(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ c(\n \"div\",\n {\n className: L(\"fixed inset-0 bg-black/20 transition-all\", i),\n onClick: () => {\n m || t();\n }\n }\n ),\n r && /* @__PURE__ */ c(\"div\", { className: L(\"relative w-fit\", s), children: e }),\n !r && /* @__PURE__ */ C(\n \"div\",\n {\n id: b,\n tabIndex: -1,\n className: L(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75\",\n h ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n s\n ),\n children: [\n !u && /* @__PURE__ */ c(\n \"button\",\n {\n type: \"button\",\n onClick: t,\n \"data-modal-close-button\": \"true\",\n className: \"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0\",\n children: /* @__PURE__ */ c(ce, { size: 18 })\n }\n ),\n p(),\n e,\n x()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nconst Se = {\n link: \"text-primary hover:text-primary-foreground hover:bg-primary/10 aria-current:text-primary-foreground aria-current:bg-primary\",\n outline: \"border border-primary text-primary hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground aria-current:border-primary\",\n filled: \"bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground\"\n}, je = {\n sm: \"px-2 py-1 text-sm min-w-[32px] min-h-8\",\n md: \"px-2 py-1 text-base min-w-[40px] min-h-10\"\n};\nfunction pt({\n page: n,\n pageCount: o = 5,\n maxVisiblePages: t = 5,\n showFirstLast: a = !0,\n onPageChange: e,\n size: r = \"md\",\n variant: s = \"link\",\n className: i,\n ref: u,\n buttonsClassName: d,\n ...m\n}) {\n const l = o === 1 / 0, f = I(() => {\n if (l) return [];\n const N = o, E = Math.min(t, N);\n if (N <= E)\n return Array.from({ length: N }, (q, G) => G + 1);\n const V = Math.floor(E / 2);\n let k = Math.max(1, n - V), R = Math.min(N, k + E - 1);\n return R - k + 1 < E && (k = Math.max(1, R - E + 1), R = Math.min(N, k + E - 1)), Array.from({ length: R - k + 1 }, (q, G) => k + G);\n }, [l, t, n, o])(), b = n > 1, v = l || n < o, h = a && !l, y = a && !l, p = (N) => {\n N >= 1 && (l || N <= o) && e(N);\n }, x = I(() => {\n const N = L(\n \"flex items-center justify-center min-w-fit\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n je[r],\n \"rounded-md\"\n );\n return L(N, Se[s], d);\n }, [s, r, d]);\n return /* @__PURE__ */ C(\n \"nav\",\n {\n ref: u,\n className: L(\"flex items-center justify-center gap-1\", i),\n role: \"navigation\",\n \"aria-label\": \"Pagination\",\n \"data-page\": n,\n \"data-page-count\": l ? \"infinite\" : o,\n ...m,\n children: [\n h && /* @__PURE__ */ C(\n \"button\",\n {\n onClick: () => p(1),\n className: x(),\n disabled: n === 1,\n \"aria-label\": \"Go to first page\",\n children: [\n /* @__PURE__ */ c(ye, { size: r === \"sm\" ? 12 : 15 }),\n /* @__PURE__ */ c(\"span\", { className: \"ml-1\", children: \"First\" })\n ]\n }\n ),\n /* @__PURE__ */ C(\n \"button\",\n {\n onClick: () => p(n - 1),\n className: x(),\n disabled: !b,\n \"aria-label\": \"Go to previous page\",\n children: [\n /* @__PURE__ */ c(we, { size: r === \"sm\" ? 12 : 15 }),\n /* @__PURE__ */ c(\"span\", { className: \"ml-1\", children: \"Previous\" })\n ]\n }\n ),\n !l && f.map((N) => /* @__PURE__ */ c(\n \"button\",\n {\n onClick: () => p(N),\n className: L(x(), \"aspect-square\"),\n \"aria-label\": `Go to page ${N}`,\n \"aria-current\": N === n ? !0 : void 0,\n children: N\n },\n N\n )),\n /* @__PURE__ */ C(\n \"button\",\n {\n onClick: () => p(n + 1),\n className: x(),\n disabled: !v,\n \"aria-label\": \"Go to next page\",\n children: [\n /* @__PURE__ */ c(\"span\", { className: \"mr-1\", children: \"Next\" }),\n /* @__PURE__ */ c(xe, { size: r === \"sm\" ? 12 : 15 })\n ]\n }\n ),\n y && /* @__PURE__ */ C(\n \"button\",\n {\n onClick: () => p(o),\n className: x(),\n disabled: n === o,\n \"aria-label\": \"Go to last page\",\n children: [\n /* @__PURE__ */ c(\"span\", { className: \"mr-1\", children: \"Last\" }),\n /* @__PURE__ */ c(Ne, { size: r === \"sm\" ? 12 : 15 })\n ]\n }\n )\n ]\n }\n );\n}\nfunction Fe(n) {\n const [o, t] = A(!1), [a, e] = A(!1);\n return $(() => {\n n ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 300));\n }, [n]), { show: o, shouldRender: a };\n}\nfunction Ge(n, o) {\n $(() => {\n const t = (a) => {\n a.key === \"Escape\" && n && o();\n };\n return document.addEventListener(\"keydown\", t), n && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", t), document.body.style.overflow = \"auto\";\n };\n }, [n, o]);\n}\nfunction qe(n, o) {\n const t = F(null), a = I(() => {\n const e = document.getElementById(n);\n if (!e) return;\n const r = e.querySelectorAll('[data-panel-action=\"true\"]');\n if (r.length > 0) {\n r[0].focus();\n return;\n }\n const s = e.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (s.length > 0) {\n const i = Array.from(s).filter((u) => !(u instanceof HTMLButtonElement && u.getAttribute(\"data-panel-close-button\") === \"true\"));\n if (i.length > 0) {\n i[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n e.focus();\n }, [n]);\n $(() => (o && (t.current = document.activeElement, a()), () => {\n document.body.style.overflow = \"auto\", t.current instanceof HTMLElement && t.current.focus();\n }), [o, a]);\n}\nconst He = {\n size: {\n sm: \"max-w-sm\",\n md: \"max-w-md\",\n lg: \"max-w-lg\",\n xl: \"max-w-xl\",\n \"2xl\": \"max-w-2xl\",\n full: \"w-full\",\n screen: \"w-screen\"\n }\n};\nfunction gt({\n ref: n,\n id: o,\n isOpen: t,\n onClose: a,\n title: e,\n children: r,\n footer: s,\n size: i = \"md\",\n className: u,\n overlayClassName: d,\n hideCloseButton: m = !1,\n disableCloseOnOverlayClick: l = !1,\n ariaLabelledBy: g,\n ariaDescribedBy: f\n}) {\n const b = z(), v = o || `panel-${b}`, h = o ? `${o}-title` : `panel-title-${b}`, { show: y, shouldRender: p } = Fe(t);\n if (qe(v, p), Ge(p, a), !p) return null;\n const x = () => e ? j.isValidElement(e) ? /* @__PURE__ */ c(\"div\", { children: e }) : /* @__PURE__ */ c(\"h2\", { className: \"text-2xl font-semibold\", id: h, children: e }) : null, N = () => {\n if (!s) return null;\n if (j.isValidElement(s)) {\n const E = s, V = E.props.className || \"\";\n return j.cloneElement(E, { className: L(\"px-6 py-4\", V) });\n }\n return /* @__PURE__ */ c(\"div\", { className: \"px-6 py-4\", children: s });\n };\n return /* @__PURE__ */ c(O, { children: re(\n /* @__PURE__ */ C(\n \"div\",\n {\n \"aria-labelledby\": g ?? e ? h : void 0,\n \"aria-describedby\": f,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-hidden\",\n \"data-panel-open\": t,\n children: [\n /* @__PURE__ */ c(\n \"div\",\n {\n className: L(\n \"fixed inset-0 bg-black/40 transition-opacity duration-300\",\n y ? \"opacity-100\" : \"opacity-0\",\n d\n ),\n onClick: () => {\n l || a();\n }\n }\n ),\n /* @__PURE__ */ c(\"div\", { className: \"fixed inset-y-0 right-0 flex max-w-full\", children: /* @__PURE__ */ c(\n \"div\",\n {\n id: v,\n ref: n,\n tabIndex: -1,\n className: L(\n \"relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out\",\n i !== \"screen\" && \"border-l border-border\",\n He.size[i],\n y ? \"translate-x-0\" : \"translate-x-full\",\n u\n ),\n \"data-panel-size\": i,\n children: /* @__PURE__ */ C(\"div\", { className: \"flex h-full flex-col\", children: [\n e && /* @__PURE__ */ c(\"div\", { className: \"px-6 pt-6\", children: x() }),\n !m && /* @__PURE__ */ c(\n \"button\",\n {\n type: \"button\",\n onClick: a,\n \"data-panel-close-button\": \"true\",\n \"aria-label\": \"Close panel\",\n className: \"rounded-md p-0.5 top-3 right-3 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0\",\n children: /* @__PURE__ */ c(ce, { size: 18 })\n }\n ),\n /* @__PURE__ */ c(\"div\", { className: L(\"flex-1 overflow-y-auto px-6 pb-6\", e ? \"pt-6\" : \"pt-10\"), children: r }),\n N()\n ] })\n }\n ) })\n ]\n }\n ),\n document.body\n ) });\n}\nfunction Me({ itemId: n, checked: o, onChange: t, name: a, disabled: e = !1, className: r = \"\" }) {\n const s = \"relative inline-flex items-center justify-center rounded-full\", i = () => {\n e || t();\n }, u = w(\n s,\n !o && \"hover:border-current/60\",\n !e && \"border-current cursor-pointer\",\n e && \"border-muted/60 cursor-not-allowed\",\n r\n );\n return /* @__PURE__ */ c(\n \"div\",\n {\n id: n,\n role: \"radio\",\n tabIndex: -1,\n \"aria-checked\": o,\n \"aria-disabled\": e,\n \"aria-description\": `Radio button for ${a}`,\n \"aria-labelledby\": `${n}-label`,\n onClick: i,\n className: u,\n style: {\n width: \"1em\",\n height: \"1em\",\n padding: \"0.1em\",\n borderWidth: \"0.06em\"\n },\n children: o && /* @__PURE__ */ c(\n \"div\",\n {\n className: w(\"size-full aspect-square rounded-full\", e && \"bg-muted/60\", !e && \"bg-current\")\n }\n )\n }\n );\n}\nfunction Y({\n value: n,\n children: o,\n className: t = \"\",\n isSelected: a = !1,\n onChange: e,\n disabled: r = !1,\n hideInput: s = !1,\n description: i,\n name: u\n}) {\n const m = `radio-${z()}-${n}`, l = () => {\n r || e == null || e(n);\n };\n return /* @__PURE__ */ C(\n \"div\",\n {\n title: i,\n className: w(\n \"relative flex items-center\",\n t,\n // Uses text color for borders\n s && `p-2 border-2 focus-within:border-dashed focus-within:${r ? \"border-current/50\" : \"border-current/80\"}`,\n s && !a && `border-transparent ${r ? \"\" : \"not-focus-within:hover:border-border/60\"}`,\n s && a && \"border-border\",\n r && \"opacity-60 cursor-not-allowed\"\n ),\n style: {\n gap: \"0.5em\"\n },\n children: [\n !s && /* @__PURE__ */ c(\n Me,\n {\n itemId: m,\n name: u || \"\",\n checked: a,\n onChange: l,\n disabled: r,\n className: w(s && \"\")\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: s ? m : void 0,\n tabIndex: s ? -1 : void 0,\n role: s ? \"radio\" : void 0,\n onClick: s ? l : void 0,\n \"aria-checked\": s ? a ? \"true\" : \"false\" : void 0,\n \"aria-disabled\": s ? r : void 0,\n \"aria-description\": s ? i || `Radio button for ${u}` : void 0,\n \"aria-labelledby\": s ? `${m}-label` : void 0,\n className: w(s && \"size-full\", typeof o == \"object\" && \"grow focus:outline-none\"),\n children: /* @__PURE__ */ c(\n \"label\",\n {\n id: `${m}-label`,\n onClick: s ? void 0 : l,\n className: w(r && \"cursor-not-allowed\", !r && \"cursor-pointer\"),\n children: o\n }\n )\n }\n )\n ]\n }\n );\n}\nfunction Pe(n, o) {\n const [t, a] = A(o), [e, r] = A(-1), [s, i] = A(!1), u = I((f, b) => {\n var y;\n const v = f[b];\n v.hasAttribute(\"disabled\") || v.getAttribute(\"aria-disabled\") === \"true\" || ((y = f[b]) == null || y.click(), r(b));\n }, []), d = I(\n (f, b) => {\n var h;\n if (f.preventDefault(), s || !b.length) return;\n const v = o !== -1 ? o : 0;\n (h = b[v]) == null || h.focus(), a(v), o !== -1 && u(b, v);\n },\n [o, s, u]\n ), m = I(\n (f) => {\n var y;\n if (!f.shiftKey)\n return;\n f.preventDefault();\n const b = Array.from(\n document.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter((p) => !p.hasAttribute(\"disabled\") && p.tabIndex >= 0), v = b.findIndex((p) => p.id === n), h = v > 0 ? v - 1 : b.length - 1;\n (y = b[h]) == null || y.focus();\n },\n [n]\n ), l = I(\n (f, b) => {\n var x;\n if (!b.length) return;\n const v = f.target;\n if (!b.some((N) => N.id === v.id)) return;\n const y = t !== -1 ? t : 0;\n let p = y;\n switch (f.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n f.preventDefault(), p = y > 0 ? y - 1 : b.length - 1;\n break;\n case \"ArrowDown\":\n case \"ArrowRight\":\n f.preventDefault(), p = (y + 1) % b.length;\n break;\n // Select the option when the space key is pressed\n case \" \":\n f.preventDefault(), u(b, y);\n return;\n case \"Tab\":\n m(f);\n return;\n default:\n return;\n }\n (x = b[p]) == null || x.focus(), a(p), e !== -1 && u(b, p);\n },\n [t, e, m, u]\n ), g = I(() => {\n const f = document.querySelector(`[id=\"${n}\"][role=\"radiogroup\"]`);\n return f ? Array.from(f.querySelectorAll('[role=\"radio\"]')) : [];\n }, [n]);\n $(() => {\n const f = document.querySelector(`[id=\"${n}\"][role=\"radiogroup\"]`);\n if (!f) return;\n const b = g(), v = (x) => d(x, b), h = (x) => l(x, b), y = () => i(!0), p = () => i(!1);\n return document.addEventListener(\"keydown\", h), f.addEventListener(\"focus\", v), f.addEventListener(\"mousedown\", y), document.addEventListener(\"mouseup\", p), () => {\n document.removeEventListener(\"keydown\", h), f.removeEventListener(\"focus\", v), f.removeEventListener(\"mousedown\", y), document.removeEventListener(\"mouseup\", p);\n };\n }, [n, g, d, l]);\n}\nfunction vt({\n options: n = [],\n value: o,\n onChange: t,\n id: a,\n children: e,\n className: r = \"\",\n childrenClassName: s = \"\",\n hideInputs: i = !1\n}) {\n const u = z(), d = a || `radio-group-${u}`;\n Pe(\n d,\n n.findIndex((l) => l === o)\n );\n const m = ee(() => n.reduce((l, g) => (typeof g == \"string\" ? l.some((f) => f.value === g) || l.push({ label: g, value: g }) : l.push(g), l), []), [n]);\n return /* @__PURE__ */ C(\"div\", { id: d, role: \"radiogroup\", tabIndex: 0, className: w(r, \"focus:outline-none\"), children: [\n m.length > 0 && m.map((l, g) => /* @__PURE__ */ c(\n Y,\n {\n value: l.value,\n isSelected: o === l.value,\n onChange: t,\n name: d,\n disabled: l.disabled,\n description: l.description,\n hideInput: i,\n className: s,\n children: l.label\n },\n `${l.value}-${g}`\n )),\n m.length === 0 && e && j.Children.map(e, (l) => j.isValidElement(l) && l.type === Y ? /* @__PURE__ */ c(\n Y,\n {\n ...l.props,\n className: w(s, l.props.className),\n hideInput: l.props.hideInput || i,\n isSelected: o === l.props.value,\n onChange: t,\n name: d,\n children: l.props.children\n }\n ) : null)\n ] });\n}\nconst Ke = {\n thin: {\n horizontal: \"h-px\",\n vertical: \"w-px\"\n },\n medium: {\n horizontal: \"h-0.5\",\n vertical: \"w-0.5\"\n },\n thick: {\n horizontal: \"h-1\",\n vertical: \"w-1\"\n },\n \"extra-thick\": {\n horizontal: \"h-2\",\n vertical: \"w-2\"\n }\n}, Ue = {\n horizontal: \"w-full\",\n vertical: \"min-h-4 h-full\"\n};\nfunction yt({\n orientation: n = \"horizontal\",\n decorative: o = !1,\n thickness: t = \"thin\",\n className: a,\n ...e\n}) {\n const r = w(\n \"shrink-0 bg-border\",\n Ue[n],\n Ke[t][n],\n a\n );\n return /* @__PURE__ */ c(\n \"div\",\n {\n ...e,\n className: r,\n role: o ? \"presentation\" : \"separator\",\n \"aria-orientation\": o ? void 0 : n,\n \"aria-hidden\": o,\n \"data-orientation\": n,\n \"data-thickness\": t\n }\n );\n}\nconst ae = {\n shape: {\n rectangle: \"rounded-md min-h-1\",\n circle: \"rounded-full aspect-square min-h-1\",\n text: \"rounded-sm min-h-1 h-4\"\n },\n lineSpacing: {\n xs: \"space-y-1\",\n sm: \"space-y-2\",\n md: \"space-y-3\",\n lg: \"space-y-4\",\n xl: \"space-y-6\"\n }\n};\nfunction wt({\n shape: n = \"rectangle\",\n lineSpacing: o = \"sm\",\n className: t,\n lines: a = 1,\n animate: e = !0,\n ref: r,\n ...s\n}) {\n const i = w(\"bg-muted/70\", e && \"animate-pulse\", ae.shape[n], t);\n return a > 1 ? /* @__PURE__ */ c(\n \"div\",\n {\n ref: r,\n className: ae.lineSpacing[o],\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n \"data-testid\": \"skeleton-container\",\n \"data-lines\": a,\n \"data-shape\": n,\n \"data-animate\": e,\n ...s,\n children: Array.from({ length: a }, (u, d) => /* @__PURE__ */ c(\n \"div\",\n {\n className: w(\n i,\n // Make last line shorter for a more natural text appearance\n d === a - 1 && \"w-3/4\"\n ),\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n \"data-testid\": \"skeleton-line\",\n \"data-line-index\": d\n },\n d\n ))\n }\n ) : /* @__PURE__ */ c(\n \"div\",\n {\n ref: r,\n className: i,\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n \"data-testid\": \"skeleton\",\n \"data-shape\": n,\n \"data-animate\": e,\n ...s\n }\n );\n}\nfunction xt({\n id: n,\n value: o,\n defaultValue: t = 0,\n onValueChange: a,\n min: e = 0,\n max: r = 100,\n step: s = 1,\n disabled: i = !1,\n trackClassName: u,\n rangeClassName: d,\n thumbClassName: m,\n className: l,\n ref: g,\n ariaLabel: f,\n ariaLabelledBy: b,\n ...v\n}) {\n const [h, y] = A(t), p = o !== void 0, x = p ? o : h, N = F(null), E = F(!1), V = F(0), k = I(\n (T) => {\n const D = Math.max(e, Math.min(r, T)), B = Math.round(D / s) * s;\n p || y(B), a == null || a(B);\n },\n [e, r, s, p, a]\n ), R = I(\n (T, D = !1) => {\n var K;\n const B = (K = N.current) == null ? void 0 : K.getBoundingClientRect();\n if (!B) return x;\n let M = T.clientX;\n D && (M = M - V.current);\n const _ = Math.max(0, Math.min(1, (M - B.left) / B.width));\n return e + (r - e) * _;\n },\n [e, r, x]\n ), q = I(\n (T) => {\n if (i || T.target !== T.currentTarget) return;\n const D = R(T);\n k(D);\n },\n [i, R, k]\n ), G = I(\n (T) => {\n var K;\n if (i) return;\n T.stopPropagation(), E.current = !0;\n const D = (K = N.current) == null ? void 0 : K.getBoundingClientRect(), B = T.currentTarget.getBoundingClientRect();\n if (D && B) {\n const P = B.left + B.width / 2;\n V.current = T.clientX - P;\n }\n T.currentTarget.setPointerCapture(T.pointerId);\n const M = (P) => {\n if (!E.current) return;\n const de = R(P, !0);\n k(de);\n }, _ = (P) => {\n if (P.pointerId === T.pointerId) {\n E.current = !1, V.current = 0;\n try {\n T.currentTarget.releasePointerCapture(P.pointerId);\n } catch {\n }\n document.removeEventListener(\"pointermove\", M), document.removeEventListener(\"pointerup\", _);\n }\n };\n document.addEventListener(\"pointermove\", M), document.addEventListener(\"pointerup\", _);\n },\n [i, R, k]\n ), U = I(\n (T) => {\n if (i) return;\n let D = x;\n switch (T.key) {\n case \"ArrowRight\":\n case \"ArrowUp\":\n D = x + s;\n break;\n case \"ArrowLeft\":\n case \"ArrowDown\":\n D = x - s;\n break;\n case \"Home\":\n D = e;\n break;\n case \"End\":\n D = r;\n break;\n case \"PageUp\":\n D = x + s * 10;\n break;\n case \"PageDown\":\n D = x - s * 10;\n break;\n default:\n return;\n }\n T.preventDefault(), k(D);\n },\n [i, x, s, e, r, k]\n ), H = r === e ? 0 : (x - e) / (r - e) * 100;\n return /* @__PURE__ */ c(\n \"div\",\n {\n id: n,\n ref: g,\n className: L(\n \"relative flex items-center w-full touch-none select-none\",\n i && \"opacity-50 cursor-not-allowed\",\n l\n ),\n \"data-disabled\": i,\n \"data-value\": x,\n \"data-min\": e,\n \"data-max\": r,\n \"data-step\": s,\n ...v,\n children: /* @__PURE__ */ C(\n \"div\",\n {\n ref: N,\n className: L(\n \"relative h-1.5 w-full rounded-full bg-muted cursor-pointer\",\n i && \"cursor-not-allowed\",\n u\n ),\n onPointerDown: q,\n children: [\n /* @__PURE__ */ c(\n \"div\",\n {\n className: L(\n \"absolute h-full rounded-full pointer-events-none\",\n // pointer-events are disabled so that user interactions are handled by the track element, enabling correct slider behavior\n !E.current && \"transition-all\",\n d\n ),\n style: { width: `${H}%` }\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n className: L(\n \"absolute size-5 -top-2 rounded-full shadow-md cursor-grab\",\n i && \"cursor-not-allowed\",\n !i && \"cursor-grab focus:outline-none focus:ring-2\",\n E.current ? \"cursor-grabbing scale-110\" : \"transition-all\",\n m\n ),\n style: { left: `calc(${H}% - 10px)` },\n tabIndex: i ? -1 : 0,\n role: \"slider\",\n \"aria-valuemin\": e,\n \"aria-valuemax\": r,\n \"aria-valuenow\": x,\n \"aria-label\": f,\n \"aria-labelledby\": b,\n \"aria-disabled\": i,\n onKeyDown: U,\n onPointerDown: G\n }\n )\n ]\n }\n )\n }\n );\n}\nfunction Nt({ children: n, ref: o, ...t }) {\n if (ue(n)) {\n let a = { ...t };\n return n.props && (a = { ...a, ...n.props }), fe(n, {\n ...a,\n ref: (e) => {\n typeof o == \"function\" ? o(e) : o && (o.current = e);\n }\n });\n }\n return le(\"div\", { ...t, ref: o }, n);\n}\nconst _e = ({ defaultValue: n, value: o, onValueChange: t } = {}) => {\n const [a, e] = A(n || \"\"), r = o !== void 0, s = r ? o : a, i = I((u) => {\n r || e(u), t == null || t(u);\n }, [r, t]);\n return {\n value: s,\n onValueChange: i\n };\n};\nfunction Et({\n defaultValue: n,\n value: o,\n onValueChange: t,\n tabsWidth: a = \"fit\",\n variant: e = \"underline\",\n className: r,\n children: s,\n ref: i,\n id: u,\n triggersClassName: d,\n contentClassName: m\n}) {\n const { value: l, onValueChange: g } = _e({\n defaultValue: n,\n value: o,\n onValueChange: t\n }), f = {\n selectedValue: l,\n onValueChange: g,\n tabsWidth: a,\n variant: e,\n triggersClassName: d,\n contentClassName: m\n };\n return /* @__PURE__ */ c(Ee.Provider, { value: f, children: /* @__PURE__ */ c(\"div\", { id: u, ref: i, className: r, \"data-tabs-width\": a, \"data-variant\": e, children: s }) });\n}\nfunction Ct({ value: n, className: o, children: t, ref: a }) {\n const { selectedValue: e, contentClassName: r } = te(), s = e === n;\n return s ? /* @__PURE__ */ c(\n \"div\",\n {\n ref: a,\n role: \"tabpanel\",\n id: `tabs-content-${n}`,\n \"aria-labelledby\": `tabs-trigger-${n}`,\n \"data-state\": s ? \"active\" : \"inactive\",\n \"data-value\": n,\n className: w(\"mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2\", r, o),\n tabIndex: 0,\n children: t\n }\n ) : null;\n}\nconst oe = {\n width: {\n fit: \"w-fit\",\n full: \"w-full *:flex-1\"\n },\n variant: {\n underline: \"border-b border-border\",\n pills: \"\",\n bordered: \"border border-border rounded-lg p-1\"\n }\n}, We = {\n underline: \"border-b-2 border-transparent data-[state=active]:border-accent data-[state=active]:text-accent hover:text-accent-foreground\",\n pills: \"rounded-md data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30\",\n bordered: \"rounded data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30\"\n};\nfunction At({ children: n, className: o, id: t, ref: a }) {\n const { tabsWidth: e, variant: r } = te();\n return /* @__PURE__ */ c(\n \"div\",\n {\n id: t,\n ref: a,\n role: \"tablist\",\n className: w(\"flex\", oe.width[e], oe.variant[r], o),\n \"data-tabs-width\": e,\n \"data-variant\": r,\n children: n\n }\n );\n}\nfunction It({ value: n, disabled: o = !1, className: t, children: a, onClick: e, id: r, ref: s }) {\n const { selectedValue: i, onValueChange: u, variant: d, triggersClassName: m } = te(), l = i === n, g = (b) => {\n o || u(n), e == null || e(b);\n };\n return /* @__PURE__ */ c(\n \"button\",\n {\n id: r,\n ref: s,\n role: \"tab\",\n type: \"button\",\n \"aria-selected\": l,\n \"aria-controls\": `tabs-content-${n}`,\n \"data-state\": l ? \"active\" : \"inactive\",\n \"data-value\": n,\n disabled: o,\n className: w(\n \"inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n l ? \"font-medium\" : \"font-light\",\n We[d],\n m,\n t\n ),\n onClick: g,\n children: a\n }\n );\n}\nfunction Xe({ elementId: n, maxLength: o }) {\n const [t, a] = A(0);\n return $(() => {\n const e = document.getElementById(n);\n if (!e)\n return;\n const r = () => {\n const s = e.value.length;\n a(s);\n const i = s >= o;\n e.setAttribute(\"aria-describedby\", `${n}-character-count`), e.setAttribute(\"aria-invalid\", i ? \"true\" : \"false\"), i ? e.setAttribute(\"data-error\", \"true\") : e.removeAttribute(\"data-error\");\n };\n return r(), e.addEventListener(\"input\", r), e.setAttribute(\"maxlength\", String(o)), () => {\n e.removeEventListener(\"input\", r), e.removeAttribute(\"maxlength\"), e.removeAttribute(\"aria-describedby\"), e.removeAttribute(\"aria-invalid\"), e.removeAttribute(\"data-error\");\n };\n }, [n, o]), /* @__PURE__ */ c(\n \"small\",\n {\n className: w(\n \"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end\",\n t >= o && \"text-destructive\",\n t < o && \"text-current\"\n ),\n role: \"status\",\n children: /* @__PURE__ */ C(\"span\", { id: `${n}-character-count`, children: [\n t,\n \" / \",\n o,\n \" characters\"\n ] })\n }\n );\n}\nfunction Qe(n, o) {\n $(() => {\n const t = document.getElementById(n);\n if (!t)\n return;\n if (!o) {\n t.style.height = \"auto\";\n return;\n }\n const a = () => {\n t.style.height = \"auto\", t.style.height = `${t.scrollHeight}px`;\n };\n return a(), t.addEventListener(\"input\", a), t.addEventListener(\"resize\", a), window.addEventListener(\"resize\", a), () => {\n t.removeEventListener(\"input\", a), t.removeEventListener(\"resize\", a), window.removeEventListener(\"resize\", a);\n };\n }, [n, o]);\n}\nconst Ze = {\n base: \"\",\n \"left-line\": \"border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\",\n outline: \"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\"\n}, Je = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, se = {\n variant: \"outline\",\n rounded: \"none\"\n};\nfunction kt({\n variant: n = se.variant,\n rounded: o,\n displayOnlyMode: t = !1,\n errorMessage: a,\n successMessage: e,\n hideResizeHandle: r = !1,\n autoExpand: s = !1,\n characterLimit: i = 0,\n className: u,\n ...d\n}) {\n const m = z();\n Qe(m, s || t);\n let l = o;\n n === \"outline\" && !o && (l = \"md\"), l = l || se.rounded;\n let g = r;\n (t || n === \"left-line\" && !r) && (g = !0);\n const b = w(\n \"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all\",\n !t && Ze[n],\n !t && Je[l],\n !t && \"px-2 py-1\",\n t && \"pointer-events-none\",\n g && \"no-resize-handle\",\n u\n );\n return /* @__PURE__ */ C(\"div\", { className: w(\"-space-y-1.5\", t && \"cursor-text\"), children: [\n /* @__PURE__ */ c(\n \"textarea\",\n {\n ...d,\n id: m,\n \"aria-disabled\": d.disabled,\n readOnly: t,\n \"aria-readonly\": t || d[\"aria-readonly\"],\n style: {\n resize: s ? \"none\" : void 0\n },\n className: b\n }\n ),\n i > 0 && /* @__PURE__ */ c(Xe, { elementId: m, maxLength: i }),\n !t && /* @__PURE__ */ c(Q, { elementId: m, type: \"error\", message: a }),\n !t && /* @__PURE__ */ c(Q, { elementId: m, type: \"success\", message: e })\n ] });\n}\nconst Ye = {\n sm: {\n container: \"h-5 min-w-9 w-9\",\n thumb: \"h-4 w-4\",\n translate: \"translate-x-4\"\n },\n md: {\n container: \"h-6 min-w-11 w-11\",\n thumb: \"h-5 w-5\",\n translate: \"translate-x-5\"\n },\n lg: {\n container: \"h-7 min-w-13 w-13\",\n thumb: \"h-6 w-6\",\n translate: \"translate-x-6\"\n }\n}, Oe = {\n default: {\n unchecked: \"bg-muted\",\n checked: \"bg-primary\"\n },\n success: {\n unchecked: \"bg-muted\",\n checked: \"bg-success\"\n },\n destructive: {\n unchecked: \"bg-muted\",\n checked: \"bg-destructive\"\n }\n}, ie = {\n variant: \"default\",\n size: \"md\"\n};\nfunction Tt({\n ref: n,\n id: o,\n size: t = ie.size,\n variant: a = ie.variant,\n checked: e,\n onCheckedChange: r,\n disabled: s = !1,\n className: i,\n thumbClassName: u,\n backgroundClassNames: d,\n ...m\n}) {\n const l = z(), g = ee(() => o || `toggle-${l}`, [o, l]), [f, b] = A(e);\n $(() => {\n b(e);\n }, [e]);\n const v = () => {\n if (!s) {\n const E = !f;\n e === void 0 && b(E), r == null || r(E);\n }\n }, h = (E) => {\n (E.key === \" \" || E.key === \"Enter\") && (E.preventDefault(), v());\n }, y = Ye[t], p = Oe[a], x = w(\n // Base styles\n \"relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out\",\n \"focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2\",\n // Size\n y.container,\n // Variant and state\n f ? (d == null ? void 0 : d.checked) || p.checked : (d == null ? void 0 : d.unchecked) || p.unchecked,\n // Disabled state\n s && \"opacity-50 cursor-not-allowed\",\n !s && \"cursor-pointer\",\n i\n ), N = w(\n // Base thumb styles\n \"absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out\",\n // Size\n y.thumb,\n // Position based on state\n f && y.translate,\n u\n );\n return /* @__PURE__ */ C(\n \"button\",\n {\n ref: n,\n id: g,\n type: \"button\",\n role: \"switch\",\n tabIndex: 0,\n \"aria-checked\": f,\n \"aria-disabled\": s,\n disabled: s,\n onClick: v,\n onKeyDown: h,\n className: x,\n ...m,\n children: [\n /* @__PURE__ */ c(\"span\", { className: N }),\n /* @__PURE__ */ c(\"span\", { className: \"sr-only\", children: f ? \"Enabled\" : \"Disabled\" })\n ]\n }\n );\n}\nconst W = 8, X = 4, S = 6;\nfunction et(n) {\n return { calculatePosition: I(\n (t, a) => {\n const e = t.getBoundingClientRect(), r = a.getBoundingClientRect(), s = {\n width: window.innerWidth,\n height: window.innerHeight\n }, i = (g, f, b, v) => g < 0 || f < 0 || g + b > s.width || f + v > s.height, u = {\n top: {\n x: e.left + e.width / 2 - r.width / 2,\n y: e.top - r.height - X,\n arrow: {\n x: r.width / 2 - S,\n y: r.height\n }\n },\n bottom: {\n x: e.left + e.width / 2 - r.width / 2,\n y: e.bottom + X,\n arrow: {\n x: r.width / 2 - S,\n y: -6\n }\n },\n left: {\n x: e.left - r.width - X,\n y: e.top + e.height / 2 - r.height / 2,\n arrow: {\n x: r.width,\n y: r.height / 2 - S\n }\n },\n right: {\n x: e.right + X,\n y: e.top + e.height / 2 - r.height / 2,\n arrow: {\n x: -6,\n y: r.height / 2 - S\n }\n }\n };\n let d = n, m = u[n];\n if (i(m.x, m.y, r.width, r.height)) {\n const g = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\"\n }, f = u[g[n]];\n if (!i(f.x, f.y, r.width, r.height))\n d = g[n], m = f;\n else {\n const b = [\"top\", \"bottom\", \"left\", \"right\"].filter(\n (v) => v !== n && v !== g[n]\n );\n for (const v of b) {\n const h = u[v];\n if (!i(h.x, h.y, r.width, r.height)) {\n d = v, m = h;\n break;\n }\n }\n }\n }\n m.x = Math.max(\n W,\n Math.min(m.x, s.width - r.width - W)\n ), m.y = Math.max(\n W,\n Math.min(m.y, s.height - r.height - W)\n );\n const l = {\n x: e.left + e.width / 2,\n y: e.top + e.height / 2\n };\n return d === \"top\" || d === \"bottom\" ? m.arrow.x = Math.max(\n S,\n Math.min(l.x - m.x - S, r.width - S * 2)\n ) : m.arrow.y = Math.max(\n S,\n Math.min(l.y - m.y - S, r.height - S * 2)\n ), {\n ...m,\n placement: d\n };\n },\n [n]\n ) };\n}\nfunction tt(n, o, t) {\n const a = F(null), e = F(null), r = I(() => {\n if (!a.current || !e.current) return;\n const s = n(a.current, e.current);\n t(s);\n }, [n, t]);\n return $(() => {\n if (!o) return;\n const s = () => r();\n return window.addEventListener(\"resize\", s), () => {\n window.removeEventListener(\"resize\", s);\n };\n }, [o, r]), {\n triggerRef: a,\n tooltipRef: e,\n updatePosition: r\n };\n}\nfunction rt(n, o, t, a, e, r, s, i, u) {\n const d = F(null), m = I(() => {\n n || (d.current && clearTimeout(d.current), d.current = window.setTimeout(() => {\n t(!0), requestAnimationFrame(() => {\n e(), a(!0);\n });\n }, o));\n }, [n, o, t, e, a]), l = I(\n (g = !1) => {\n if (d.current && clearTimeout(d.current), g) {\n a(!1), setTimeout(() => t(!1), 150);\n return;\n }\n d.current = window.setTimeout(() => {\n a(!1), setTimeout(() => t(!1), 150);\n }, 100);\n },\n [a, t]\n );\n return $(() => {\n !r && !s && !i && u && l();\n }, [r, s, i, u, l]), $(() => () => {\n d.current && clearTimeout(d.current);\n }, []), {\n showTooltip: m,\n hideTooltip: l,\n timeoutRef: d\n };\n}\nfunction $t({\n id: n,\n children: o,\n message: t,\n placement: a = \"top\",\n disabled: e = !1,\n delay: r = 200,\n className: s\n}) {\n const [i, u] = A(!1), [d, m] = A(!1), [l, g] = A(null), [f, b] = A(!1), [v, h] = A(!1), [y, p] = A(!1), { calculatePosition: x } = et(a), { triggerRef: N, tooltipRef: E, updatePosition: V } = tt(x, d, g), { showTooltip: k, hideTooltip: R, timeoutRef: q } = rt(\n e,\n r,\n m,\n u,\n V,\n f,\n v,\n y,\n i\n ), G = z(), U = n ?? G;\n return /* @__PURE__ */ C(O, { children: [\n j.cloneElement(o, {\n ref: (H) => {\n N.current = H;\n },\n onMouseEnter: () => {\n b(!0), k();\n },\n onMouseLeave: () => {\n b(!1);\n },\n onFocus: () => {\n p(!0), k();\n },\n onBlur: () => {\n p(!1), R(!0);\n },\n onKeyDown: (H) => {\n H.key === \"Escape\" && R(!0);\n },\n \"aria-describedby\": e ? void 0 : U\n }),\n d && re(\n /* @__PURE__ */ c(\n \"div\",\n {\n ref: E,\n id: U,\n role: \"tooltip\",\n className: w(\n \"fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out\",\n i ? \"opacity-100\" : \"opacity-0\",\n s\n ),\n style: l ? { left: l.x, top: l.y } : { opacity: 0 },\n onMouseEnter: () => {\n h(!0), q.current && clearTimeout(q.current);\n },\n onMouseLeave: () => {\n h(!1);\n },\n children: t\n }\n ),\n document.body\n )\n ] });\n}\nexport {\n dt as Accordion,\n Z as AccordionItem,\n Rt as ActionModal,\n $e as Button,\n Ae as ButtonLoadingDots,\n ut as Checkbox,\n ft as Clickable,\n mt as Input,\n bt as Label,\n ht as Modal,\n pt as Pagination,\n gt as Panel,\n vt as RadioGroup,\n Y as RadioGroupItem,\n Me as RadioInput,\n yt as Separator,\n wt as Skeleton,\n xt as Slider,\n Nt as Slot,\n Et as Tabs,\n Ct as TabsContent,\n At as TabsList,\n It as TabsTrigger,\n kt as Textarea,\n zt as Toast,\n Tt as Toggle,\n $t as Tooltip\n};\n//# sourceMappingURL=components.esm.js.map\n","import { Modal, ModalProps } from '@moondreamsdev/dreamer-ui/components';\nimport React, { useMemo } from 'react';\n\ninterface BaseActionModalProps extends Omit<ModalProps, 'children' | 'actions'> {\n message: React.ReactNode;\n destructive?: boolean;\n}\n\ninterface AlertModalProps extends BaseActionModalProps {\n type: 'alert';\n confirmText?: string;\n onConfirm?: () => void;\n // Cancel-related props are not allowed for alerts\n cancelText?: never;\n}\n\ninterface ConfirmModalProps extends BaseActionModalProps {\n type: 'confirm';\n confirmText?: string;\n cancelText?: string;\n onConfirm?: () => void;\n}\n\nexport type ActionModalProps = AlertModalProps | ConfirmModalProps;\n\nexport function ActionModal({\n type,\n message,\n cancelText,\n confirmText,\n onConfirm,\n onClose,\n destructive = false,\n title,\n ...modalProps\n}: ActionModalProps) {\n const defaultTexts = useMemo(() => {\n if (type === 'confirm') {\n return {\n confirm: confirmText || 'Confirm',\n cancel: cancelText || 'Cancel',\n defaultTitle: title || 'Confirm Action',\n };\n }\n return {\n confirm: confirmText || 'OK',\n cancel: null,\n defaultTitle: title || 'Alert',\n };\n }, [type, confirmText, title, cancelText]);\n\n const actions: ModalProps['actions'] = useMemo(\n () => [\n ...(defaultTexts.cancel\n ? [\n {\n label: defaultTexts.cancel,\n variant: 'secondary' as const,\n onClick: onClose,\n },\n ]\n : []),\n {\n label: defaultTexts.confirm,\n variant: destructive ? 'destructive' : 'primary',\n onClick: () => {\n onConfirm?.();\n onClose();\n },\n },\n ],\n [defaultTexts, destructive, onConfirm, onClose]\n );\n\n return (\n <Modal\n {...modalProps}\n title={title || defaultTexts.defaultTitle}\n onClose={onClose}\n actions={actions}\n disableCloseOnOverlayClick={type === 'confirm'}\n hideCloseButton={type === 'confirm'}\n >\n {typeof message === 'string' ? <p className='text-sm'>{message}</p> : message}\n </Modal>\n );\n}\n","import { createContext, useContext } from 'react';\nimport { TabsVariant, TabsWidth } from './variants';\n\nexport interface TabsContextValue {\n selectedValue: string;\n onValueChange: (value: string) => void;\n tabsWidth: TabsWidth;\n variant: TabsVariant;\n triggersClassName?: string;\n contentClassName?: string;\n}\n\nexport const TabsContext = createContext<TabsContextValue | null>(null);\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext);\n if (!context) {\n throw new Error('Tabs components must be used within a Tabs component');\n }\n return context;\n};\n","import { ReactNode, useCallback, useEffect, useState } from 'react';\nimport { CrossCircled, ExclamationTriangle, InfoCircled, X } from '../../symbols';\nimport { join } from '../../utils';\nexport type ToastType = 'info' | 'warning' | 'error';\n\nexport interface ToastAction {\n label: string;\n onClick: () => void;\n}\n\nexport interface ToastData {\n id: string;\n title: string;\n description?: string;\n type?: ToastType;\n action?: ToastAction;\n duration?: number;\n onRemove?: (id: string) => void;\n}\n\ninterface ToastProps extends ToastData {\n customTypes?: Record<string, { className: string; icon?: ReactNode }>;\n customComponent?: React.ComponentType<ToastData>;\n}\n\nconst defaultTypeStyles: Record<ToastType, { className: string; icon: ReactNode }> = {\n info: {\n className: 'bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100',\n icon: <InfoCircled size={20} />,\n },\n warning: {\n className:\n 'bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100',\n icon: <ExclamationTriangle size={20} />,\n },\n error: {\n className: 'bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100',\n icon: <CrossCircled size={20} />,\n },\n};\n\nexport function Toast({\n id,\n title,\n description,\n type = 'info',\n action,\n duration = 5000,\n onRemove,\n customTypes,\n customComponent: CustomComponent,\n}: ToastProps) {\n const [isExiting, setIsExiting] = useState(false);\n\n const handleRemove = useCallback(() => {\n setIsExiting(true);\n setTimeout(() => {\n onRemove?.(id);\n }, 150); // Match animation duration\n }, [id, onRemove]);\n\n useEffect(() => {\n if (duration > 0) {\n const timer = setTimeout(() => {\n handleRemove();\n }, duration);\n\n return () => clearTimeout(timer);\n }\n }, [duration, id, onRemove, handleRemove]);\n\n if (CustomComponent) {\n return (\n <CustomComponent\n id={id}\n title={title}\n description={description}\n type={type}\n action={action}\n duration={duration}\n onRemove={onRemove}\n />\n );\n }\n\n // Check custom types first, then fall back to default\n const typeStyle = customTypes?.[type] || defaultTypeStyles[type as ToastType] || defaultTypeStyles.info;\n\n return (\n <div\n role={type === 'error' ? 'alert' : 'status'}\n aria-live={type === 'error' ? undefined : 'polite'}\n className={join(\n 'relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out',\n action && 'pb-3',\n typeStyle.className,\n isExiting ? 'opacity-0 translate-x-full' : 'opacity-100 translate-x-0'\n )}\n >\n {/* Icon */}\n <div className='flex-shrink-0 mr-3'>{typeStyle.icon}</div>\n\n {/* Content */}\n <div className='flex-grow min-w-0'>\n <div className='font-medium text-sm leading-5'>{title}</div>\n {description && <div className='mt-1 text-sm opacity-90 leading-5'>{description}</div>}\n {action && (\n <div className='mt-1.5'>\n <button\n onClick={action.onClick}\n className='text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer'\n >\n {action.label}\n </button>\n </div>\n )}\n </div>\n\n {/* Close button */}\n <button\n onClick={handleRemove}\n className='flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0'\n >\n <X size={16} />\n </button>\n </div>\n );\n}\n"],"names":["n","t","s","h","C","l","i","e","k","v","Ae","o","A","$","a","c","w","Ie","ke","Te","J","$e","r","u","d","ze","Ve","Be","F","I","ht","g","f","z","b","y","p","j","x","N","E","V","R","O","re","L","ce","ActionModal","type","message","cancelText","confirmText","onConfirm","onClose","destructive","title","modalProps","defaultTexts","useMemo","actions","jsx","Modal","TabsContext","createContext","useTabsContext","context","useContext","defaultTypeStyles","InfoCircled","ExclamationTriangle","CrossCircled","Toast","id","description","action","duration","onRemove","customTypes","CustomComponent","isExiting","setIsExiting","useState","handleRemove","useCallback","useEffect","timer","typeStyle","jsxs","join","X"],"mappings":"sJAAA,SAASA,KAAKC,EAAG,CACf,OAAOA,EAAE,OAAQC,GAAM,OAAOA,GAAK,UAAYA,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,GAAI,MACxE,CCgFA,SAASC,EAAE,CAAE,KAAMC,EAAI,GAAI,MAAOC,EAAI,eAAgB,UAAWL,EAAI,SAAU,GAAGM,CAAC,EAAI,CACrF,OAAuBC,EAAC,IACtB,MACA,CACE,GAAGD,EACH,MAAOF,EACP,OAAQA,EACR,UAAWJ,EACX,QAAS,YACT,MAAO,6BACP,SAA0BO,EAAC,IACzB,OACA,CACE,EAAG,0gBACH,KAAMF,EACN,SAAU,UACV,SAAU,SACpB,CACA,CACA,CACG,CACH,CClGA,SAASG,KAAK,EAAG,CACf,OAAO,EAAE,OAAQH,GAAM,OAAOA,GAAK,UAAYA,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,GAAI,MACxE,CA0BAI,EAAC,cAAC,MAAM,EACRA,EAAC,cAAC,IAAI,EACNA,EAAC,cAAC,IAAI,EAwQKA,EAAC,cAAC,IAAI,ECzKjB,SAASC,GAAK,CACZ,KAAM,CAACV,EAAGW,CAAC,EAAIC,EAAAA,SAAE,CAAC,EAClB,OAAOC,EAAC,UAAC,IAAM,CACb,MAAMZ,EAAI,YAAY,IAAM,CAC1BU,EAAGG,IAAOA,EAA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oBACb,SAAA,CAAC3B,EAAA,IAAA,MAAA,CAAI,UAAU,gCAAiC,SAAML,EAAA,EACrDkB,GAAeb,EAAA,IAAC,MAAI,CAAA,UAAU,oCAAqC,SAAYa,EAAA,EAC/EC,GACCd,EAAA,IAAC,MAAI,CAAA,UAAU,SACb,SAAAA,EAAA,IAAC,SAAA,CACC,QAASc,EAAO,QAChB,UAAU,+IAET,SAAOA,EAAA,KAAA,CAAA,CAEZ,CAAA,CAAA,EAEJ,EAGAd,EAAA,IAAC,SAAA,CACC,QAASsB,EACT,UAAU,0IAEV,SAAAtB,EAAAA,IAAC6B,EAAAA,EAAE,CAAA,KAAM,EAAI,CAAA,CAAA,CAAA,CACf,CAAA,CACF,CAEJ"}
@@ -1,26 +1,26 @@
1
1
  import { jsx as r, Fragment as $, jsxs as f } from "react/jsx-runtime";
2
- import q, { createContext as v, useId as V, useState as p, useEffect as b, useRef as H, useCallback as z, useMemo as E, useContext as P } from "react";
2
+ import q, { createContext as b, useId as V, useState as v, useEffect as g, useRef as H, useCallback as z, useMemo as E, useContext as P } from "react";
3
3
  import { createPortal as D } from "react-dom";
4
4
  import { X as F, C as J, E as K, I as X } from "./X-CIoyLewf.js";
5
5
  import { join as Z } from "./utils.esm.js";
6
6
  function k(...e) {
7
- return e.filter((l) => typeof l == "string" && l).join(" ").trim() || void 0;
7
+ return e.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
8
8
  }
9
- function G({ size: e = 15, color: l = "currentColor", className: n = "inline", ...t }) {
9
+ function G({ size: e = 15, color: n = "currentColor", className: l = "inline", ...t }) {
10
10
  return /* @__PURE__ */ r(
11
11
  "svg",
12
12
  {
13
13
  ...t,
14
14
  width: e,
15
15
  height: e,
16
- className: n,
16
+ className: l,
17
17
  viewBox: "0 0 15 15",
18
18
  xmlns: "http://www.w3.org/2000/svg",
19
19
  children: /* @__PURE__ */ r(
20
20
  "path",
21
21
  {
22
22
  d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
23
- fill: l,
23
+ fill: n,
24
24
  fillRule: "evenodd",
25
25
  clipRule: "evenodd"
26
26
  }
@@ -29,27 +29,28 @@ function G({ size: e = 15, color: l = "currentColor", className: n = "inline", .
29
29
  );
30
30
  }
31
31
  function x(...e) {
32
- return e.filter((l) => typeof l == "string" && l).join(" ").trim() || void 0;
32
+ return e.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
33
33
  }
34
- v(void 0);
35
- v(null);
36
- v(null);
34
+ b(void 0);
35
+ b(null);
36
+ b(null);
37
+ b(null);
37
38
  function Q() {
38
- const [e, l] = p(0);
39
- return b(() => {
40
- const n = setInterval(() => {
41
- l((t) => (t + 1) % 3);
39
+ const [e, n] = v(0);
40
+ return g(() => {
41
+ const l = setInterval(() => {
42
+ n((t) => (t + 1) % 3);
42
43
  }, 500);
43
- return () => clearInterval(n);
44
- }, []), /* @__PURE__ */ r("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((n) => /* @__PURE__ */ r(
44
+ return () => clearInterval(l);
45
+ }, []), /* @__PURE__ */ r("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((l) => /* @__PURE__ */ r(
45
46
  "div",
46
47
  {
47
48
  className: k(
48
49
  "rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
49
- e === n && "transform -translate-y-1"
50
+ e === l && "transform -translate-y-1"
50
51
  )
51
52
  },
52
- n
53
+ l
53
54
  )) });
54
55
  }
55
56
  const R = {
@@ -81,8 +82,8 @@ const R = {
81
82
  };
82
83
  function Y({
83
84
  variant: e = w.variant,
84
- size: l,
85
- rounded: n = w.rounded,
85
+ size: n,
86
+ rounded: l = w.rounded,
86
87
  loading: t,
87
88
  linkTo: i,
88
89
  linkProps: a,
@@ -91,12 +92,12 @@ function Y({
91
92
  ...s
92
93
  }) {
93
94
  let c;
94
- e === "link" && !l ? c = "fitted" : c = l || w.size;
95
+ e === "link" && !n ? c = "fitted" : c = n || w.size;
95
96
  const u = k(
96
97
  "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
97
98
  R[e],
98
99
  U[c],
99
- W[n],
100
+ W[l],
100
101
  t && "relative pointer-events-none",
101
102
  i && "relative",
102
103
  d
@@ -130,23 +131,23 @@ function Y({
130
131
  );
131
132
  }
132
133
  function _(e) {
133
- const [l, n] = p(!1), [t, i] = p(!1);
134
- return b(() => {
135
- e ? (i(!0), setTimeout(() => n(!0), 10)) : (n(!1), setTimeout(() => i(!1), 150));
136
- }, [e]), { show: l, shouldRender: t };
134
+ const [n, l] = v(!1), [t, i] = v(!1);
135
+ return g(() => {
136
+ e ? (i(!0), setTimeout(() => l(!0), 10)) : (l(!1), setTimeout(() => i(!1), 150));
137
+ }, [e]), { show: n, shouldRender: t };
137
138
  }
138
- function ee(e, l) {
139
- b(() => {
140
- const n = (t) => {
141
- t.key === "Escape" && e && l();
139
+ function ee(e, n) {
140
+ g(() => {
141
+ const l = (t) => {
142
+ t.key === "Escape" && e && n();
142
143
  };
143
- return document.addEventListener("keydown", n), e && (document.body.style.overflow = "hidden"), () => {
144
- document.removeEventListener("keydown", n), document.body.style.overflow = "auto";
144
+ return document.addEventListener("keydown", l), e && (document.body.style.overflow = "hidden"), () => {
145
+ document.removeEventListener("keydown", l), document.body.style.overflow = "auto";
145
146
  };
146
- }, [e, l]);
147
+ }, [e, n]);
147
148
  }
148
- function te(e, l) {
149
- const n = H(null), t = z(() => {
149
+ function te(e, n) {
150
+ const l = H(null), t = z(() => {
150
151
  const i = document.getElementById(e);
151
152
  if (!i) return;
152
153
  const a = i.querySelectorAll('[data-modal-action="true"]');
@@ -168,14 +169,14 @@ function te(e, l) {
168
169
  }
169
170
  i.focus();
170
171
  }, [e]);
171
- b(() => (l && (n.current = document.activeElement, t()), () => {
172
- document.body.style.overflow = "auto", n.current instanceof HTMLElement && n.current.focus();
173
- }), [l, t]);
172
+ g(() => (n && (l.current = document.activeElement, t()), () => {
173
+ document.body.style.overflow = "auto", l.current instanceof HTMLElement && l.current.focus();
174
+ }), [n, t]);
174
175
  }
175
176
  function re({
176
177
  id: e,
177
- isOpen: l,
178
- onClose: n,
178
+ isOpen: n,
179
+ onClose: l,
179
180
  title: t,
180
181
  children: i,
181
182
  contentOnly: a = !1,
@@ -185,10 +186,10 @@ function re({
185
186
  actions: c = [],
186
187
  disableCloseOnOverlayClick: u = !1,
187
188
  ariaLabelledBy: m,
188
- ariaDescribedBy: g
189
+ ariaDescribedBy: h
189
190
  }) {
190
- const h = V(), N = e || `modal-${h}`, C = e ? `${e}-title` : `modal-title-${h}`, { show: L, shouldRender: y } = _(l);
191
- if (te(N, y), ee(y, n), !y) return null;
191
+ const p = V(), N = e || `modal-${p}`, C = e ? `${e}-title` : `modal-title-${p}`, { show: L, shouldRender: y } = _(n);
192
+ if (te(N, y), ee(y, l), !y) return null;
192
193
  const j = () => t ? q.isValidElement(t) ? /* @__PURE__ */ r("div", { className: "mb-4", children: t }) : /* @__PURE__ */ r("h2", { className: "mb-4 text-xl font-semibold", id: C, children: t }) : null, A = () => c.length === 0 ? null : /* @__PURE__ */ r("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: c.map((I, B) => {
193
194
  const { label: O, className: M, ...S } = I;
194
195
  return /* @__PURE__ */ r(Y, { className: M, type: "button", ...S, "data-modal-action": "true", children: O }, B);
@@ -198,7 +199,7 @@ function re({
198
199
  "div",
199
200
  {
200
201
  "aria-labelledby": m ?? t ? C : void 0,
201
- "aria-describedby": g,
202
+ "aria-describedby": h,
202
203
  role: "dialog",
203
204
  "aria-modal": "true",
204
205
  className: "fixed inset-0 z-[100] overflow-y-auto",
@@ -208,7 +209,7 @@ function re({
208
209
  {
209
210
  className: x("fixed inset-0 bg-black/20 transition-all", d),
210
211
  onClick: () => {
211
- u || n();
212
+ u || l();
212
213
  }
213
214
  }
214
215
  ),
@@ -228,7 +229,7 @@ function re({
228
229
  "button",
229
230
  {
230
231
  type: "button",
231
- onClick: n,
232
+ onClick: l,
232
233
  "data-modal-close-button": "true",
233
234
  className: "rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
234
235
  children: /* @__PURE__ */ r(G, { size: 18 })
@@ -248,8 +249,8 @@ function re({
248
249
  }
249
250
  function de({
250
251
  type: e,
251
- message: l,
252
- cancelText: n,
252
+ message: n,
253
+ cancelText: l,
253
254
  confirmText: t,
254
255
  onConfirm: i,
255
256
  onClose: a,
@@ -259,13 +260,13 @@ function de({
259
260
  }) {
260
261
  const c = E(() => e === "confirm" ? {
261
262
  confirm: t || "Confirm",
262
- cancel: n || "Cancel",
263
+ cancel: l || "Cancel",
263
264
  defaultTitle: d || "Confirm Action"
264
265
  } : {
265
266
  confirm: t || "OK",
266
267
  cancel: null,
267
268
  defaultTitle: d || "Alert"
268
- }, [e, t, d, n]), u = E(
269
+ }, [e, t, d, l]), u = E(
269
270
  () => [
270
271
  ...c.cancel ? [
271
272
  {
@@ -293,12 +294,12 @@ function de({
293
294
  actions: u,
294
295
  disableCloseOnOverlayClick: e === "confirm",
295
296
  hideCloseButton: e === "confirm",
296
- children: typeof l == "string" ? /* @__PURE__ */ r("p", { className: "text-sm", children: l }) : l
297
+ children: typeof n == "string" ? /* @__PURE__ */ r("p", { className: "text-sm", children: n }) : n
297
298
  }
298
299
  );
299
300
  }
300
- const le = v(null), ce = () => {
301
- const e = P(le);
301
+ const ne = b(null), ce = () => {
302
+ const e = P(ne);
302
303
  if (!e)
303
304
  throw new Error("Tabs components must be used within a Tabs component");
304
305
  return e;
@@ -318,8 +319,8 @@ const le = v(null), ce = () => {
318
319
  };
319
320
  function ue({
320
321
  id: e,
321
- title: l,
322
- description: n,
322
+ title: n,
323
+ description: l,
323
324
  type: t = "info",
324
325
  action: i,
325
326
  duration: a = 5e3,
@@ -327,32 +328,32 @@ function ue({
327
328
  customTypes: d,
328
329
  customComponent: s
329
330
  }) {
330
- const [c, u] = p(!1), m = z(() => {
331
+ const [c, u] = v(!1), m = z(() => {
331
332
  u(!0), setTimeout(() => {
332
333
  o == null || o(e);
333
334
  }, 150);
334
335
  }, [e, o]);
335
- if (b(() => {
336
+ if (g(() => {
336
337
  if (a > 0) {
337
- const h = setTimeout(() => {
338
+ const p = setTimeout(() => {
338
339
  m();
339
340
  }, a);
340
- return () => clearTimeout(h);
341
+ return () => clearTimeout(p);
341
342
  }
342
343
  }, [a, e, o, m]), s)
343
344
  return /* @__PURE__ */ r(
344
345
  s,
345
346
  {
346
347
  id: e,
347
- title: l,
348
- description: n,
348
+ title: n,
349
+ description: l,
349
350
  type: t,
350
351
  action: i,
351
352
  duration: a,
352
353
  onRemove: o
353
354
  }
354
355
  );
355
- const g = (d == null ? void 0 : d[t]) || T[t] || T.info;
356
+ const h = (d == null ? void 0 : d[t]) || T[t] || T.info;
356
357
  return /* @__PURE__ */ f(
357
358
  "div",
358
359
  {
@@ -361,14 +362,14 @@ function ue({
361
362
  className: Z(
362
363
  "relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
363
364
  i && "pb-3",
364
- g.className,
365
+ h.className,
365
366
  c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
366
367
  ),
367
368
  children: [
368
- /* @__PURE__ */ r("div", { className: "flex-shrink-0 mr-3", children: g.icon }),
369
+ /* @__PURE__ */ r("div", { className: "flex-shrink-0 mr-3", children: h.icon }),
369
370
  /* @__PURE__ */ f("div", { className: "flex-grow min-w-0", children: [
370
- /* @__PURE__ */ r("div", { className: "font-medium text-sm leading-5", children: l }),
371
- n && /* @__PURE__ */ r("div", { className: "mt-1 text-sm opacity-90 leading-5", children: n }),
371
+ /* @__PURE__ */ r("div", { className: "font-medium text-sm leading-5", children: n }),
372
+ l && /* @__PURE__ */ r("div", { className: "mt-1 text-sm opacity-90 leading-5", children: l }),
372
373
  i && /* @__PURE__ */ r("div", { className: "mt-1.5", children: /* @__PURE__ */ r(
373
374
  "button",
374
375
  {
@@ -393,8 +394,8 @@ function ue({
393
394
  export {
394
395
  de as A,
395
396
  ue as T,
396
- le as a,
397
+ ne as a,
397
398
  k as n,
398
399
  ce as u
399
400
  };
400
- //# sourceMappingURL=Toast-cdFf2Gbf.js.map
401
+ //# sourceMappingURL=Toast-CuxloQs8.js.map