import{z as _,B as b,o as i,c,b as r,y as p,d as m,A as v,a as w,w as h,n as g,C as x,q as k,p as f,h as C,u as $,i as S,F as B,e as z,t as y,Q as E}from"./app-z_grtNg1.js";const D={class:"relative"},V={__name:"Dropdown",props:{align:{type:String,default:"right"},width:{type:String,default:"48"},contentClasses:{type:String,default:"py-1 bg-white"}},setup(a){const t=a,n=o=>{e.value&&o.key==="Escape"&&(e.value=!1)};_(()=>document.addEventListener("keydown",n)),b(()=>document.removeEventListener("keydown",n));const u=f(()=>({48:"w-48"})[t.width.toString()]),d=f(()=>t.align==="left"?"ltr:origin-top-left rtl:origin-top-right start-0":t.align==="right"?"ltr:origin-top-right rtl:origin-top-left end-0":"origin-top"),e=k(!1);return(o,s)=>(i(),c("div",D,[r("div",{onClick:s[0]||(s[0]=l=>e.value=!e.value)},[p(o.$slots,"trigger")]),m(r("div",{class:"fixed inset-0 z-40",onClick:s[1]||(s[1]=l=>e.value=!1)},null,512),[[v,e.value]]),w(x,{"enter-active-class":"transition ease-out duration-200","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:h(()=>[m(r("div",{class:g(["absolute z-50 mt-2 rounded-md shadow-lg",[u.value,d.value]]),style:{display:"none"},onClick:s[2]||(s[2]=l=>e.value=!1)},[r("div",{class:g(["rounded-md ring-1 ring-black ring-opacity-5",a.contentClasses])},[p(o.$slots,"content")],2)],2),[[v,e.value]])]),_:3})]))}},A={__name:"DropdownLink",props:{href:{type:String,required:!0}},setup(a){return(t,n)=>(i(),C($(S),{href:a.href,class:"block w-full px-4 py-2 text-start text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out"},{default:h(()=>[p(t.$slots,"default")]),_:3},8,["href"]))}},L={class:"fixed right-4 top-4 z-[70] space-y-2"},F={class:"flex items-start gap-2"},q={class:"mt-[1px] text-base leading-none"},N={class:"font-medium"},M={__name:"ToastStack",setup(a){const t=E(),n=f(()=>{const e=t.props.flash||{};return[e.success?{type:"success",message:e.success}:null,e.error?{type:"error",message:e.error}:null,e.warning?{type:"warning",message:e.warning}:null].filter(Boolean)}),u=e=>e==="success"?"border-emerald-300 bg-emerald-50 text-emerald-900 ring-emerald-200":e==="error"?"border-rose-500 bg-rose-50 text-rose-900 ring-rose-300":"border-amber-300 bg-amber-50 text-amber-900 ring-amber-200",d=e=>e==="success"?"✓":e==="error"?"⚠":"!";return(e,o)=>(i(),c("div",L,[(i(!0),c(B,null,z(n.value,(s,l)=>(i(),c("div",{key:`${s.type}-${l}`,class:g(["max-w-sm rounded-xl border px-3 py-2.5 text-sm shadow-md ring-1",u(s.type)])},[r("div",F,[r("span",q,y(d(s.type)),1),r("span",N,y(s.message),1)])],2))),128))]))}};export{M as _,A as a,V as b};
