import{Cr as e,E as t,Fr as n,Nr as r,S as i,_r as a,gr as o,ii as s,jr as c,mr as l,ni as u,qr as d,ti as f,ur as p,xr as m}from"./ChQ2IioC.js";var h=[`aria-labelledby`],g={class:`sticky top-0 z-10 flex items-center justify-between px-5 py-4 max-sm:pt-[max(1rem,env(safe-area-inset-top))]`,style:{background:`var(--color-base-200)`,borderBottom:`1px solid var(--modal-border)`}},_={class:`flex items-center gap-3 text-lg font-bold text-base-content [&>svg]:text-primary`},v=[`id`],y={key:0,class:`flex-1 overflow-y-auto p-5 max-sm:pb-[max(1.25rem,env(safe-area-inset-bottom))]`},b={key:1,class:`sticky bottom-0 z-10 flex items-center justify-end px-5 py-4 max-sm:pb-[max(1rem,env(safe-area-inset-bottom))]`,style:{background:`var(--color-base-200)`,borderTop:`1px solid var(--modal-border)`}},x={class:`flex justify-end gap-2`},S=360,C=e({__name:`Modal`,props:{title:{}},emits:[`close`],setup(e,{expose:i,emit:C}){let w=C,T=d(),E=d(!1),D=d(!1),O=n(),k;function A(){return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function j(){k!==void 0&&(clearTimeout(k),k=void 0)}function M(){j(),T.value?.showModal(),D.value=!0,requestAnimationFrame(()=>{E.value=!0})}function N(){E.value=!1,j(),k=setTimeout(()=>{k=void 0,T.value?.close(),D.value=!1,w(`close`)},A()?0:S)}return i({open:M,close:N}),(n,i)=>(c(),a(`dialog`,{ref_key:`dialogRef`,ref:T,class:`modal modal-bottom sm:modal-middle`,"aria-modal":`true`,"aria-labelledby":e.title?f(O):void 0,style:{"--modal-border":`color-mix(in oklch, var(--color-base-content) 10%, transparent)`},onCancel:p(N,[`prevent`])},[l(`div`,{class:u([`modal-shell flex max-h-[90vh] w-[95%] max-w-2xl flex-col overflow-hidden rounded-2xl p-0 sm:w-11/12`,f(E)?`is-open`:``]),style:{background:`var(--color-base-100)`,border:`1px solid var(--modal-border)`,boxShadow:`0 25px 50px -12px color-mix(in oklch, var(--color-base-content) 25%, transparent), 0 0 0 1px var(--modal-border), inset 0 1px 0 0 color-mix(in oklch, var(--color-base-content) 6%, transparent)`},onContextmenu:i[0]||=p(()=>{},[`prevent`])},[l(`div`,g,[l(`div`,_,[r(n.$slots,`icon`,{},void 0,!0),l(`span`,{id:f(O)},s(e.title),9,v)]),l(`button`,{class:`modal-close flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg bg-transparent`,style:{border:`1px solid var(--modal-border)`,color:`color-mix(in oklch, var(--color-base-content) 60%, transparent)`},onClick:N},[m(f(t),{size:18})])]),f(D)?(c(),a(`div`,y,[r(n.$slots,`default`,{},void 0,!0)])):o(``,!0),f(D)&&n.$slots.actions?(c(),a(`div`,b,[l(`div`,x,[r(n.$slots,`actions`,{},void 0,!0)])])):o(``,!0)],34),l(`form`,{method:`dialog`,class:u([`fixed inset-0 modal-backdrop -z-[1]`,f(E)?`is-open`:``])},[l(`button`,{class:`absolute inset-0 h-full w-full cursor-pointer border-none bg-transparent`,onClick:N})],2)],40,h))}}),w=Object.assign(i(C,[[`__scopeId`,`data-v-e1552053`]]),{__name:`Modal`});export{w as t};