import j from"./Icon.RQAIFpgh.js";import{_ as O}from"./Avatar.sEieiGia.js";import U from"./Button.n6F1xpmD.js";import{I as M,J as y,h as I,K as V,v as N,S as h,U as F,o,c as l,a as f,y as c,B as a,z as n,P as u,M as w,d as B,t as C,F as A,A as S,V as k}from"./entry.RGd0w9hd.js";import{u as J}from"./selectMenu.C9lwG85K.js";import{_ as P}from"./_plugin-vue_export-helper.x3n3nnut.js";import"./Icon.IbV_ZJvz.js";import"./index.aIcZnwHK.js";import"./Link.LD64lelx.js";import"./nuxt-link.HDpUgD9S.js";import"./link.O6hAleNp.js";import"./useButtonGroup.AoLXlm1A.js";import"./button.ljqeEZC_.js";const q={wrapper:"w-full relative overflow-hidden",inner:"w-0 flex-1",title:"text-sm font-medium",description:"mt-1 text-sm leading-4 opacity-90",actions:"flex items-center gap-2 mt-3 flex-shrink-0",shadow:"",rounded:"rounded-lg",padding:"p-4",gap:"gap-3",icon:{base:"flex-shrink-0 w-5 h-5"},avatar:{base:"flex-shrink-0 self-center",size:"md"},color:{white:{solid:"text-gray-900 dark:text-white bg-white dark:bg-gray-900 ring-1 ring-gray-200 dark:ring-gray-800"}},variant:{solid:"bg-{color}-500 dark:bg-{color}-400 text-white dark:text-gray-900",outline:"text-{color}-500 dark:text-{color}-400 ring-1 ring-inset ring-{color}-500 dark:ring-{color}-400",soft:"bg-{color}-50 dark:bg-{color}-400 dark:bg-opacity-10 text-{color}-500 dark:text-{color}-400",subtle:"bg-{color}-50 dark:bg-{color}-400 dark:bg-opacity-10 text-{color}-500 dark:text-{color}-400 ring-1 ring-inset ring-{color}-500 dark:ring-{color}-400 ring-opacity-25 dark:ring-opacity-25"},default:{color:"white",variant:"solid",icon:null,closeButton:null,actionButton:{size:"xs",color:"primary",variant:"link"}}},r=M(y.ui.strategy,y.ui.alert,q),D=I({components:{UIcon:j,UAvatar:O,UButton:U},inheritAttrs:!1,props:{title:{type:String,required:!0},description:{type:String,default:null},icon:{type:String,default:()=>r.default.icon},avatar:{type:Object,default:null},closeButton:{type:Object,default:()=>r.default.closeButton},actions:{type:Array,default:()=>[]},color:{type:String,default:()=>r.default.color,validator(e){return[...y.ui.colors,...Object.keys(r.color)].includes(e)}},variant:{type:String,default:()=>r.default.variant,validator(e){return[...Object.keys(r.variant),...Object.values(r.color).flatMap(t=>Object.keys(t))].includes(e)}},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})}},emits:["close"],setup(e){const{ui:t,attrs:v}=J("alert",V(e,"ui"),r),b=N(()=>{var d,p;const i=((p=(d=t.value.color)==null?void 0:d[e.color])==null?void 0:p[e.variant])||t.value.variant[e.variant];return h(F(t.value.wrapper,t.value.rounded,t.value.shadow,t.value.padding,i==null?void 0:i.replaceAll("{color}",e.color)),e.class)});function $(i){i.click&&i.click()}return{ui:t,attrs:v,alertClass:b,onAction:$,twMerge:h}}});function E(e,t,v,b,$,i){const d=j,p=O,g=U;return o(),l("div",u({class:e.alertClass},e.attrs),[f("div",{class:a(["flex",[e.ui.gap,{"items-start":e.description||e.$slots.description,"items-center":!e.description&&!e.$slots.description}]])},[e.icon?(o(),c(d,{key:0,name:e.icon,class:a(e.ui.icon.base)},null,8,["name","class"])):n("",!0),e.avatar?(o(),c(p,u({key:1},{size:e.ui.avatar.size,...e.avatar},{class:e.ui.avatar.base}),null,16,["class"])):n("",!0),f("div",{class:a(e.ui.inner)},[f("p",{class:a(e.ui.title)},[w(e.$slots,"title",{title:e.title},()=>[B(C(e.title),1)])],2),e.description||e.$slots.description?(o(),l("p",{key:0,class:a(e.ui.description)},[w(e.$slots,"description",{description:e.description},()=>[B(C(e.description),1)])],2)):n("",!0),(e.description||e.$slots.description)&&e.actions.length?(o(),l("div",{key:1,class:a(e.ui.actions)},[(o(!0),l(A,null,S(e.actions,(s,m)=>(o(),c(g,u({key:m},{...e.ui.default.actionButton||{},...s},{onClick:k(z=>e.onAction(s),["stop"])}),null,16,["onClick"]))),128))],2)):n("",!0)],2),e.closeButton||!e.description&&!e.$slots.description&&e.actions.length?(o(),l("div",{key:2,class:a(e.twMerge(e.ui.actions,"mt-0"))},[!e.description&&!e.$slots.description&&e.actions.length?(o(!0),l(A,{key:0},S(e.actions,(s,m)=>(o(),c(g,u({key:m},{...e.ui.default.actionButton||{},...s},{onClick:k(z=>e.onAction(s),["stop"])}),null,16,["onClick"]))),128)):n("",!0),e.closeButton?(o(),c(g,u({key:1,"aria-label":"Close"},{...e.ui.default.closeButton||{},...e.closeButton},{onClick:t[0]||(t[0]=k(s=>e.$emit("close"),["stop"]))}),null,16)):n("",!0)],2)):n("",!0)],2)],16)}const ee=P(D,[["render",E]]);export{ee as default};
