import{D as e,H as t,K as n,T as r,b as i,lt as a,u as o,v as s,vt as c,wt as l,x as u,xt as d}from"./CaGtQlYh.js";import{a as f,t as p}from"#entry";var m={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)`}},h={class:`flex items-center gap-3 text-lg font-bold text-base-content [&>svg]:text-primary`},g={key:0,class:`flex-1 overflow-y-auto p-5`},_={key:1,class:`sticky bottom-0 z-10 flex items-center justify-end px-5 py-4`,style:{background:`var(--color-base-200)`,borderTop:`1px solid var(--modal-border)`}},v={class:`flex justify-end gap-2`},y=Object.assign(p(e({__name:`Modal`,props:{title:{}},emits:[`close`],setup(e,{expose:p,emit:y}){let b=y,x=a(),S=a(!1),C=a(!1);function w(){x.value?.showModal(),C.value=!0,requestAnimationFrame(()=>{S.value=!0})}function T(){S.value=!1,setTimeout(()=>{x.value?.close(),C.value=!1,b(`close`)},240)}return p({open:w,close:T}),(a,p)=>(t(),u(`dialog`,{ref_key:`dialogRef`,ref:x,class:`modal modal-bottom sm:modal-middle`,style:{"--modal-border":`color-mix(in oklch, var(--color-base-content) 10%, transparent)`}},[s(`div`,{class:d([`modal-shell flex max-h-[90vh] w-[95%] max-w-2xl flex-col overflow-hidden rounded-2xl p-0 sm:w-11/12`,c(S)?`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:p[0]||=o(()=>{},[`prevent`])},[s(`div`,m,[s(`div`,h,[n(a.$slots,`icon`,{},void 0,!0),s(`span`,null,l(e.title),1)]),s(`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:T},[r(c(f),{size:18})])]),c(C)?(t(),u(`div`,g,[n(a.$slots,`default`,{},void 0,!0)])):i(``,!0),c(C)&&a.$slots.actions?(t(),u(`div`,_,[s(`div`,v,[n(a.$slots,`actions`,{},void 0,!0)])])):i(``,!0)],34),s(`form`,{method:`dialog`,class:`fixed inset-0 modal-backdrop -z-[1]`,style:{background:`color-mix(in oklch, var(--color-base-content) 50%, transparent)`}},[s(`button`,{class:`absolute inset-0 h-full w-full cursor-pointer border-none bg-transparent`,onClick:T})])],512))}}),[[`__scopeId`,`data-v-ec42d534`]]),{__name:`Modal`});export{y as t};