"use client"
import{a as c}from"./chunk-NWME2ANF.mjs";import{j as l}from"./chunk-IE56MXNA.mjs";import*as o from"@radix-ui/react-dialog";import*as g from"@radix-ui/react-visually-hidden";import{useRouter as h}from"next/navigation";import{Drawer as a}from"vaul";import{jsx as t,jsxs as r}from"react/jsx-runtime";function C({children:n,className:d,showModal:s,setShowModal:i,onClose:p,desktopOnly:u,preventDefaultClose:f,drawerRootProps:b}){let D=h(),m=({dragged:e}={})=>{f&&!e||(p&&p(),i?i(!1):D.back())},{isMobile:y}=c();return y&&!u?t(a.Root,{open:i?s:!0,onOpenChange:e=>{e||m({dragged:!0})},...b,children:r(a.Portal,{children:[t(a.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),r(a.Content,{className:l("fixed bottom-0 left-0 right-0 z-50 rounded-t-[10px] border-t border-gray-200 bg-white",d),children:[t("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:t("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})}),n]}),t(a.Overlay,{})]})}):t(o.Root,{open:i?s:!0,onOpenChange:e=>{e||m()},children:r(o.Portal,{children:[t(o.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-gray-100 bg-opacity-50 backdrop-blur-md"}),r(o.Content,{title:"Modal",onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault(),className:l("animate-scale-in fixed inset-0 z-40 m-auto max-h-fit w-full max-w-md overflow-hidden border border-gray-200 bg-white p-0 shadow-xl sm:rounded-2xl",d),children:[r(g.Root,{children:[t(o.Title,{children:"Modal"}),t(o.Description,{children:"This is a modal"})]}),n]})]})})}export{C as a};
