import{h as o,r as s,N as p,O as u,P as y,j as t,X as b,g as d}from"./index-B48HCCvn.js";const k=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],N=o("plus",k);const v=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],M=o("trash-2",v);const j=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],g=o("triangle-alert",j),E=({isOpen:r,onClose:n,title:f,children:h,action:l,className:m})=>{const[x,c]=s.useState(!1),i=s.useRef(null),a=s.useRef(!1);return s.useEffect(()=>{if(r){const e=setTimeout(()=>c(!0),0);return a.current||(p(),a.current=!0),()=>clearTimeout(e)}else{const e=setTimeout(()=>c(!1),200);return a.current&&(u(),a.current=!1),()=>clearTimeout(e)}},[r]),s.useEffect(()=>()=>{a.current&&(u(),a.current=!1)},[]),s.useEffect(()=>{if(!r)return;const e=i.current;!e||e.contains(document.activeElement)||e.focus()},[r]),!x&&!r?null:y.createPortal(t.jsxs("div",{className:d("fixed inset-0 z-[60] flex items-center justify-center p-4 transition-opacity duration-200",r?"opacity-100":"opacity-0"),onKeyDown:e=>{e.key==="Escape"&&(e.stopPropagation(),n())},children:[t.jsx("div",{className:"absolute inset-0 bg-white/80 backdrop-blur-sm",onClick:n}),t.jsxs("div",{ref:i,tabIndex:-1,className:d("relative flex max-h-[calc(100vh-2rem)] w-full max-w-lg flex-col overflow-hidden bg-white rounded-xl shadow-2xl shadow-neutral-200/50 border border-neutral-100 transform transition-all duration-200 outline-none",r?"scale-100 translate-y-0":"scale-95 translate-y-2",m),children:[t.jsxs("div",{className:"flex shrink-0 items-center justify-between px-6 py-4 border-b border-neutral-50",children:[t.jsx("h3",{className:"font-semibold text-neutral-900",children:f}),t.jsx("button",{onClick:n,className:"text-neutral-400 hover:text-neutral-900 transition-colors",children:t.jsx(b,{size:18})})]}),t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:h}),l?t.jsx("div",{className:"shrink-0 px-6 py-4 bg-neutral-50 rounded-b-xl border-t border-neutral-100 flex justify-end gap-3",children:l}):null]})]}),document.body)};export{E as M,N as P,M as T,g as a};
