import{s as f}from"./simplifyTailwindClasses.275301d3.js";import{g,d as x,Z as L,$ as k,o,b as _,w as B,r as m,n as u,l as v,I as $,h as z,c,e as h,k as i}from"./framework.3f630664.js";import{u as M}from"./useFlowbiteThemable.013ea29e.js";const T={danger:"text-red-500 bg-red-100 dark:bg-red-800 dark:text-red-200",empty:"",success:"text-green-500 bg-green-100 dark:bg-green-800 dark:text-green-200",warning:"text-orange-500 bg-orange-100 dark:bg-orange-700 dark:text-orange-200"},A={center:"items-center",end:"items-end",start:"items-start"},C="flex w-full max-w-xs p-4 text-gray-500 bg-white rounded-lg shadow dark:text-gray-400 dark:bg-gray-800",b="text-sm font-normal";function S(e){const n=g(()=>T[e.type.value]),r=g(()=>{const t=A[e.alignment.value];return e.divide.value?f(C,"dark:divide-gray-700 divide-x divide-gray-200",t):f(C,t)}),s=g(()=>e.type.value!=="empty"&&e.divide.value?f(b,"pl-3"):b);return{typeClasses:n,wrapperClasses:r,contentClasses:s}}function F(e){var a;const{backgroundClasses:n,borderClasses:r,disabledClasses:s,focusClasses:t,hoverClasses:d,isActive:y,textClasses:p}=M((a=e.theme)==null?void 0:a.value);return{classes:g(()=>{if(!y.value)return"";const l=[];return e.apply.value.includes("text")&&l.push(p.value),e.apply.value.includes("border")&&l.push(r.value),e.apply.value.includes("background")&&l.push(n.value),e.apply.value.includes("hover")&&l.push(d.value),e.apply.value.includes("disabled")&&l.push(s.value),e.apply.value.includes("focus")&&l.push(t.value),l.join(" ")})}}const V=x({__name:"FlowbiteThemableChild",props:{apply:{type:Array,required:!0},tag:{type:String,default:"div"},theme:{type:String,default:void 0}},setup(e){const n=L(),r=e,{classes:s}=F(k(r)),t=g(()=>n.class||"");return(d,y)=>(o(),_($(e.tag),{class:u(v(f)(t.value,v(s)))},{default:B(()=>[m(d.$slots,"default")]),_:3},8,["class"]))}}),j={key:1,"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},N=i("path",{"clip-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","fill-rule":"evenodd"},null,-1),q=[N],D={key:2,"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},E=i("path",{"clip-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","fill-rule":"evenodd"},null,-1),H=[E],I={key:3,"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},R=i("path",{"clip-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","fill-rule":"evenodd"},null,-1),W=[R],Z=i("span",{class:"sr-only"},"Close",-1),G=i("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[i("path",{"clip-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","fill-rule":"evenodd"})],-1),J=[Z,G],Q=x({__name:"FwbToast",props:{type:{type:String,default:"empty"},alignment:{type:String,default:"center"},closable:{type:Boolean,default:!1},divide:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:n}){const r=e,s=z(!0),t=n,{typeClasses:d,wrapperClasses:y,contentClasses:p}=S(k(r)),w=()=>{t("close"),s.value=!1};return(a,l)=>s.value?(o(),c("div",{key:0,id:"toast-default",class:u(v(y)),role:"alert"},[e.type!=="empty"||a.$slots.icon?(o(),_(V,{key:0,apply:["background","text"],class:u(["inline-flex flex-shrink-0 justify-center items-center w-8 h-8 rounded-lg",v(d)])},{default:B(()=>[a.$slots.icon?m(a.$slots,"icon",{key:0,class:u({"ml-3":e.type!=="empty"})}):e.type==="success"?(o(),c("svg",j,q)):e.type==="danger"?(o(),c("svg",D,H)):e.type==="warning"?(o(),c("svg",I,W)):h("",!0)]),_:3},8,["class"])):h("",!0),i("div",{class:u([v(p),{"ml-3":a.$slots.icon||e.type!=="empty"}])},[m(a.$slots,"default")],2),e.closable?(o(),c("button",{key:1,"aria-label":"Close",class:"border-none ml-auto -mx-1.5 -my-1.5 bg-white text-gray-400 hover:text-gray-900 rounded-lg focus:ring-2 focus:ring-gray-300 p-1.5 hover:bg-gray-100 inline-flex h-8 w-8 dark:text-gray-500 dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700",type:"button",onClick:w},J)):h("",!0)],2)):h("",!0)}});export{Q as _};
