'use client';import { a } from './chunk-2PAFMHQ4.js';
import { Overlay, Content, Root, Trigger, Portal, Title, Close, Description } from '@radix-ui/react-dialog';
import { cx } from '@onbeam/styled-system/css';
import { forwardRef, useRef, useEffect } from 'react';
import { CloseIcon } from '@onbeam/icons';
import { modal, customScrollbar } from '@onbeam/styled-system/recipes';
import { jsx, jsxs } from 'react/jsx-runtime';

var u=forwardRef(({className:t,...n},r)=>{let a=modal();return jsx(Overlay,{ref:r,className:cx(a.bgOverlay,t),...n})});u.displayName="ModalBackgroundOverlay";var C=forwardRef(({className:t,children:n,...r},a)=>{let s=modal();return jsx(Content,{ref:a,className:cx(customScrollbar(),s.content,t),onInteractOutside:l=>{let d=l.detail.originalEvent.target;d instanceof Element&&d.closest("[data-sonner-toast]")&&l.preventDefault();},...r,children:n})});C.displayName="ModalContent";var k=forwardRef(({children:t,open:n,onOpenChange:r,trigger:a$1,title:s,description:l,size:d="lg",hideTitle:p,hideDescription:I,hideCloseButton:N,...W},w)=>{let i=useRef(null),v=useRef(),o=modal();return useEffect(()=>{if(!i.current)return;i.current.getRootNode().nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(v.current=i.current.getRootNode());},[]),jsxs(Root,{open:n,onOpenChange:r,children:[jsx(Trigger,{ref:i,asChild:!0,children:a$1??jsx("div",{"aria-hidden":!0,className:o.hidden})}),jsx(Portal,{container:v.current,children:jsx(u,{onWheel:c=>c.stopPropagation(),onTouchMove:c=>c.stopPropagation(),children:jsx(C,{ref:w,...W,children:jsxs(a,{size:d,children:[!p||!N?jsxs("div",{className:o.header,children:[jsx(Title,{className:o.title,"data-hidden":p,children:s}),!N&&jsx(Close,{className:o.close,children:jsx(CloseIcon,{height:16,width:16})})]}):jsx(Title,{className:o.title,"data-hidden":p,children:s}),jsxs("div",{className:o.cardContent,children:[jsx(Description,{className:o.description,"data-hidden":I,children:l}),t]})]})})})})]})});k.displayName="Modal";var _={Root:Root,Trigger:Trigger,Portal:Portal,Close:Close,Overlay:u,Content:C,Title:Title,Description:Description};

export { k as a, _ as b };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-TOIWDFR7.js.map