import{Ot as e,U as t,X as n,Y as r,dt as i,et as a,jt as o,kt as s,lt as c,q as l,tt as u,xt as d}from"./BOiFqXHJ.js";import{i as f}from"./DahdqIKi.js";var p={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:`color-mix(in oklch, var(--color-base-200) 80%, transparent)`,borderBottom:`1px solid var(--modal-border)`,backdropFilter:`blur(12px)`}},m={class:`flex items-center gap-3 text-lg font-bold text-base-content [&>svg]:text-primary`},h={class:`flex-1 overflow-y-auto p-5`},g={key:0,class:`sticky bottom-0 z-10 flex items-center justify-end px-5 py-4`,style:{background:`color-mix(in oklch, var(--color-base-200) 80%, transparent)`,borderTop:`1px solid var(--modal-border)`,backdropFilter:`blur(12px)`}},_={class:`flex justify-end gap-2`},v=u({__name:`Modal`,props:{title:{}},emits:[`close`],setup(u,{expose:v,emit:y}){let b=y,x=d(),S=d(!1);function C(){x.value?.showModal(),S.value=!0}function w(){S.value=!1,setTimeout(()=>{x.value?.close(),b(`close`)},200)}return v({open:C,close:w}),(d,v)=>(c(),n(`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)`}},[l(`div`,{class:s([`flex max-h-[90vh] flex-col overflow-hidden rounded-2xl p-0 transition-all duration-200 ease-[cubic-bezier(0.4,0,0.2,1)]`,e(S)?`translate-y-0 scale-100 opacity-100`:`translate-y-2.5 scale-95 opacity-0`]),style:{background:`color-mix(in oklch, var(--color-base-100) 98%, transparent)`,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)`,backdropFilter:`blur(16px)`},onContextmenu:v[2]||=t(()=>{},[`prevent`])},[l(`div`,p,[l(`div`,m,[i(d.$slots,`icon`),l(`span`,null,o(u.title),1)]),l(`button`,{class:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg bg-transparent transition-all duration-200 ease-in-out hover:rotate-90 hover:text-error`,style:{border:`1px solid var(--modal-border)`,color:`color-mix(in oklch, var(--color-base-content) 60%, transparent)`},onMouseover:v[0]||=e=>{e.target.style.background=`color-mix(in oklch, var(--color-error) 15%, transparent)`,e.target.style.borderColor=`color-mix(in oklch, var(--color-error) 30%, transparent)`},onMouseleave:v[1]||=e=>{e.target.style.background=`transparent`,e.target.style.borderColor=`var(--modal-border)`},onClick:w},[a(e(f),{size:18})],32)]),l(`div`,h,[i(d.$slots,`default`)]),d.$slots.actions?(c(),n(`div`,g,[l(`div`,_,[i(d.$slots,`actions`)])])):r(``,!0)],34),l(`form`,{method:`dialog`,class:`fixed inset-0 modal-backdrop -z-[1] backdrop-blur-[8px]`,style:{background:`color-mix(in oklch, var(--color-base-content) 50%, transparent)`}},[l(`button`,{class:`absolute inset-0 h-full w-full cursor-pointer border-none bg-transparent`,onClick:w})])],512))}}),y=Object.assign(v,{__name:`Modal`});export{y as t};