import{$n as e,Cn as t,Dn as n,En as r,Nn as i,Un as a,Vn as o,ar as s,bn as c,cr as l,jn as u,n as d,or as f,r as p,wn as m,zn as h}from"./DLvf9lie.js";var g=[`aria-labelledby`],_={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)`}},v={class:`flex items-center gap-3 text-lg font-bold text-base-content [&>svg]:text-primary`},y=[`id`],b={key:0,class:`flex-1 overflow-y-auto p-5 max-sm:pb-[max(1.25rem,env(safe-area-inset-bottom))]`},x={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)`}},S={class:`flex justify-end gap-2`},C=360,w=i({__name:`Modal`,props:{title:{},size:{default:`md`},beforeClose:{type:Function,default:void 0}},emits:[`close`],setup(i,{expose:d,emit:w}){let T=i,E=w,D=e(),O=e(!1),k=e(!1),A=a(),j;function M(){return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function N(){j!==void 0&&(clearTimeout(j),j=void 0)}function P(){N(),D.value?.showModal(),k.value=!0,requestAnimationFrame(()=>{O.value=!0})}function F(e=!1){!e&&T.beforeClose&&!T.beforeClose()||(O.value=!1,N(),j=setTimeout(()=>{j=void 0,D.value?.close(),k.value=!1,E(`close`)},M()?0:C))}function I(){F(!1)}let L=t(()=>T.size===`xl`?`max-w-6xl`:`max-w-2xl`);return d({open:P,close:F}),(e,t)=>(h(),n(`dialog`,{ref_key:`dialogRef`,ref:D,class:`modal modal-bottom sm:modal-middle`,"aria-modal":`true`,"aria-labelledby":i.title?s(A):void 0,style:{"--modal-border":`color-mix(in oklab, var(--color-base-content) 10%, transparent)`},onCancel:c(I,[`prevent`])},[m(`div`,{class:f([`modal-shell flex max-h-[90vh] w-[95%] flex-col overflow-hidden rounded-2xl p-0 sm:w-11/12`,[s(O)?`is-open`:``,s(L)]]),style:{background:`var(--color-base-100)`,border:`1px solid var(--modal-border)`,boxShadow:`0 25px 50px -12px color-mix(in oklab, var(--color-base-content) 25%, transparent), 0 0 0 1px var(--modal-border), inset 0 1px 0 0 color-mix(in oklab, var(--color-base-content) 6%, transparent)`},onContextmenu:t[0]||=c(()=>{},[`prevent`])},[m(`div`,_,[m(`div`,v,[o(e.$slots,`icon`,{},void 0,!0),m(`span`,{id:s(A)},l(i.title),9,y)]),m(`button`,{type:`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 oklab, var(--color-base-content) 60%, transparent)`},onClick:I},[u(s(p),{size:18})])]),s(k)?(h(),n(`div`,b,[o(e.$slots,`default`,{},void 0,!0)])):r(``,!0),s(k)&&e.$slots.actions?(h(),n(`div`,x,[m(`div`,S,[o(e.$slots,`actions`,{},void 0,!0)])])):r(``,!0)],34),m(`form`,{method:`dialog`,class:f([`fixed inset-0 modal-backdrop -z-[1]`,s(O)?`is-open`:``])},[m(`button`,{type:`button`,class:`absolute inset-0 h-full w-full cursor-pointer border-none bg-transparent`,onClick:I})],2)],40,g))}}),T=Object.assign(d(w,[[`__scopeId`,`data-v-8d3eed8f`]]),{__name:`Modal`});export{T as t};