import{e as g,c,a as o,U as d,t as k,b as h,h as s,l as u,i as _,n as w,r as m,o as p}from"./Fc7vEJt1.js";import{I as C}from"./B3RuOkKC.js";const z={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)"}},M={class:"flex items-center gap-3 text-lg font-bold text-base-content [&>svg]:text-primary"},j={key:0,class:"flex-1 overflow-y-auto p-5"},B={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)"}},N={class:"flex justify-end gap-2"},R=g({__name:"Modal",props:{title:{}},emits:["close"],setup(b,{expose:f,emit:x}){const v=x,l=m(),n=m(!1),r=m(!1);function y(){l.value?.showModal(),r.value=!0,requestAnimationFrame(()=>{n.value=!0})}function i(){n.value=!1,setTimeout(()=>{l.value?.close(),r.value=!1,v("close")},200)}return f({open:y,close:i}),(a,e)=>(p(),c("dialog",{ref_key:"dialogRef",ref:l,class:"modal modal-bottom sm:modal-middle",style:{"--modal-border":"color-mix(in oklch, var(--color-base-content) 10%, transparent)"}},[o("div",{class:w(["flex max-h-[90vh] w-[95%] max-w-2xl flex-col overflow-hidden rounded-2xl p-0 transition-all duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] sm:w-11/12",s(n)?"translate-y-0 scale-100 opacity-100":"translate-y-2.5 scale-95 opacity-0"]),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)"},onContextmenu:e[2]||(e[2]=_(()=>{},["prevent"]))},[o("div",z,[o("div",M,[d(a.$slots,"icon"),o("span",null,k(b.title),1)]),o("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:e[0]||(e[0]=t=>{t.target.style.background="color-mix(in oklch, var(--color-error) 15%, transparent)",t.target.style.borderColor="color-mix(in oklch, var(--color-error) 30%, transparent)"}),onMouseleave:e[1]||(e[1]=t=>{t.target.style.background="transparent",t.target.style.borderColor="var(--modal-border)"}),onClick:i},[h(s(C),{size:18})],32)]),s(r)?(p(),c("div",j,[d(a.$slots,"default")])):u("",!0),s(r)&&a.$slots.actions?(p(),c("div",B,[o("div",N,[d(a.$slots,"actions")])])):u("",!0)],34),o("form",{method:"dialog",class:"fixed inset-0 modal-backdrop -z-[1]",style:{background:"color-mix(in oklch, var(--color-base-content) 50%, transparent)"}},[o("button",{class:"absolute inset-0 h-full w-full cursor-pointer border-none bg-transparent",onClick:i})])],512))}}),I=Object.assign(R,{__name:"Modal"});export{I as _};
