import{n as e,o as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n}from"./react-C21x__mS.js";import{n as r}from"./iframe-GrlyTB2d.js";import{t as i}from"./react-dom-2o2phaJG.js";import{a,n as o,r as s,t as c}from"./dom-B3G_GtJw.js";function l({title:e,description:t,open:n,onClose:r,minWidth:i,children:s}){let l=(0,u.useId)(),p=(0,u.useId)(),m=a({active:n,trapFocus:!0,restoreFocus:!0,initialFocus:`auto`});if(o({active:n,onDismiss:r,containerRef:m}),!n||typeof document>`u`)return null;let h=c(`dialog-root`);return h?(0,d.createPortal)((0,f.jsx)(`div`,{className:`fixed inset0 flexCenter surfaceBackdrop`,style:{zIndex:`var(--z-dialog)`},onMouseDown:e=>e.target===e.currentTarget&&r(),children:(0,f.jsxs)(`div`,{ref:m,role:`dialog`,"aria-modal":`true`,"aria-labelledby":e?l:void 0,"aria-describedby":t?p:void 0,tabIndex:-1,className:`surface0 shadowMd paddingLg radiusSm`,style:{minWidth:i},children:[e&&(0,f.jsx)(`h2`,{id:l,className:`margin0`,children:e}),t&&(0,f.jsx)(`p`,{id:p,children:t}),s]})}),h):null}var u,d,f;function p(){return(p=e((()=>{u=t(n(),1),s(),d=i(),f=r()})))()}export{p as n,l as t};