import{j as t}from"./reactflow-vendor-DVEEOIVt.js";import{r as i,a as m}from"./react-vendor-4ldeB94U.js";function l({onClose:r,children:u,className:a="",backdrop:o="rgba(0, 0, 0, 0.5)",position:n="left"}){const e=i.useRef(null);return i.useEffect(()=>{const s=c=>{e.current&&!e.current.contains(c.target)&&r()};return document.addEventListener("mousedown",s,!0),()=>{document.removeEventListener("mousedown",s,!0)}},[]),m.createPortal(t.jsxs(t.Fragment,{children:[o&&t.jsx("div",{onClick:r,style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:o}}),t.jsx("div",{style:{height:"100vh",position:"fixed",top:0,left:n==="right"?"auto":0,right:n==="right"?0:"auto"},ref:e,className:`bg-zinc-800 ${a}`,children:u})]}),document.body)}export{l as C};
