import h from"./Icon.30f6becb.js";import j from"./Avatar.a7ca17e7.js";import O from"./Button.8a478b7a.js";import{g as U,E as o,G as w,j as y,H as N,O as z,o as t,c as n,a as c,k as r,y as u,l,L as p,I as g,d as $,t as B,F as C,x as b,P as f}from"./entry.eb978f24.js";import{_ as I}from"./_plugin-vue_export-helper.c27b6911.js";import"./Link.a86a4ec7.js";import"./nuxt-link.0033bf2d.js";import"./_baseIsEqual.8f3c5dea.js";import"./_MapCache.e1952f2e.js";const V=U({components:{UIcon:h,UAvatar:j,UButton:O},props:{title:{type:String,required:!0},description:{type:String,default:null},icon:{type:String,default:()=>o.ui.alert.default.icon},avatar:{type:Object,default:null},closeButton:{type:Object,default:()=>o.ui.alert.default.closeButton},actions:{type:Array,default:()=>[]},color:{type:String,default:()=>o.ui.alert.default.color,validator(e){return[...o.ui.colors,...Object.keys(o.ui.alert.color)].includes(e)}},variant:{type:String,default:()=>o.ui.alert.default.variant,validator(e){return[...Object.keys(o.ui.alert.variant),...Object.values(o.ui.alert.color).flatMap(a=>Object.keys(a))].includes(e)}},ui:{type:Object,default:()=>o.ui.alert}},emits:["close"],setup(e){const a=w(),s=y(()=>N({},e.ui,a.ui.alert)),v=y(()=>{const k=s.value.color?.[e.color]?.[e.variant]||s.value.variant[e.variant];return z(s.value.wrapper,s.value.rounded,s.value.shadow,s.value.padding,k?.replaceAll("{color}",e.color))});return{ui:s,alertClass:v}}}),E={class:"w-0 flex-1"},F={key:1,class:"mt-3 flex items-center gap-2"},L={class:"flex-shrink-0 flex items-center gap-3"},M={key:0,class:"flex items-center gap-2"};function P(e,a,s,v,k,q){const S=h,A=j,d=O;return t(),n("div",{class:u(e.alertClass)},[c("div",{class:u(["flex gap-3",{"items-start":e.description||e.$slots.description,"items-center":!e.description&&!e.$slots.description}])},[e.icon?(t(),r(S,{key:0,name:e.icon,class:u(e.ui.icon.base)},null,8,["name","class"])):l("",!0),e.avatar?(t(),r(A,p({key:1},{size:e.ui.avatar.size,...e.avatar},{class:e.ui.avatar.base}),null,16,["class"])):l("",!0),c("div",E,[c("p",{class:u(e.ui.title)},[g(e.$slots,"title",{title:e.title},()=>[$(B(e.title),1)])],2),e.description||e.$slots.description?(t(),n("p",{key:0,class:u(e.ui.description)},[g(e.$slots,"description",{description:e.description},()=>[$(B(e.description),1)])],2)):l("",!0),(e.description||e.$slots.description)&&e.actions.length?(t(),n("div",F,[(t(!0),n(C,null,b(e.actions,(i,m)=>(t(),r(d,p({key:m},{...e.ui.default.actionButton,...i},{onClick:f(i.click,["stop"])}),null,16,["onClick"]))),128))])):l("",!0)]),c("div",L,[!e.description&&!e.$slots.description&&e.actions.length?(t(),n("div",M,[(t(!0),n(C,null,b(e.actions,(i,m)=>(t(),r(d,p({key:m},{...e.ui.default.actionButton,...i},{onClick:f(i.click,["stop"])}),null,16,["onClick"]))),128))])):l("",!0),e.closeButton?(t(),r(d,p({key:1},{...e.ui.default.closeButton,...e.closeButton},{onClick:a[0]||(a[0]=f(i=>e.$emit("close"),["stop"]))}),null,16)):l("",!0)])],2)],2)}const X=I(V,[["render",P]]);export{X as default};
