import{c as w}from"./VAvatar-RkAR0u0e.js";import{p as P,F as N,g as O,ai as R,ad as y,aD as E,aF as K,aa as j,b5 as p,bl as H,bJ as J,bK as q,ab as G,a7 as Q,av as U,c as l,aK as W,x as o,n as b,b as f,V as X,O as S,ah as k,S as Y,aH as Z,al as ee,m as ae,ae as te,bL as le,bM as ne,bm as oe,b3 as se,af as ie,a as re,ag as ce}from"./index-C5GbdPxY.js";const ue=w("v-alert-title"),de=P({iconSize:[Number,String],iconSizes:{type:Array,default:()=>[["x-small",10],["small",16],["default",24],["large",28],["x-large",32]]}},"iconSize");function ve(e,s){return{iconSize:N(()=>{const a=new Map(e.iconSizes),t=e.iconSize??s()??"default";return a.has(t)?a.get(t):t})}}const me=["success","info","warning","error"],ye=P({border:{type:[Boolean,String],validator:e=>typeof e=="boolean"||["top","end","bottom","start"].includes(e)},borderColor:String,closable:Boolean,closeIcon:{type:ce,default:"$close"},closeLabel:{type:String,default:"$vuetify.close"},icon:{type:[Boolean,String,Function,Object],default:null},modelValue:{type:Boolean,default:!0},prominent:Boolean,title:String,text:String,type:{type:String,validator:e=>me.includes(e)},...re(),...ie(),...se(),...oe(),...de(),...ne(),...le(),...te(),...ae(),...ee(),...Z({variant:"flat"})},"VAlert"),Se=O()({name:"VAlert",props:ye(),emits:{"click:close":e=>!0,"update:modelValue":e=>!0},setup(e,s){let{emit:c,slots:a}=s;const t=R(e,"modelValue"),i=y(()=>{if(e.icon!==!1)return e.type?e.icon??`$${e.type}`:e.icon}),{iconSize:V}=ve(e,()=>e.prominent?44:void 0),{themeClasses:g}=E(e),{colorClasses:z,colorStyles:C,variantClasses:x}=K(()=>({color:e.color??e.type,variant:e.variant})),{densityClasses:_}=j(e),{dimensionStyles:h}=p(e),{elevationClasses:B}=H(e),{locationStyles:I}=J(e),{positionClasses:A}=q(e),{roundedClasses:T}=G(e),{textColorClasses:D,textColorStyles:L}=Q(()=>e.borderColor),{t:F}=U(),u=y(()=>({"aria-label":F(e.closeLabel),onClick(r){t.value=!1,c("click:close",r)}}));return()=>{const r=!!(a.prepend||i.value),$=!!(a.title||e.title),M=!!(a.close||e.closable),d={density:e.density,icon:i.value,size:e.iconSize||e.prominent?V.value:void 0};return t.value&&l(e.tag,{class:f(["v-alert",e.border&&{"v-alert--border":!!e.border,[`v-alert--border-${e.border===!0?"start":e.border}`]:!0},{"v-alert--prominent":e.prominent},g.value,z.value,_.value,B.value,A.value,T.value,x.value,e.class]),style:b([C.value,h.value,I.value,e.style]),role:"alert"},{default:()=>{var v,m;return[W(!1,"v-alert"),e.border&&o("div",{key:"border",class:f(["v-alert__border",D.value]),style:b(L.value)},null),r&&o("div",{key:"prepend",class:"v-alert__prepend"},[a.prepend?l(k,{key:"prepend-defaults",disabled:!i.value,defaults:{VIcon:{...d}}},a.prepend):l(X,S({key:"prepend-icon"},d),null)]),o("div",{class:"v-alert__content"},[$&&l(ue,{key:"title"},{default:()=>{var n;return[((n=a.title)==null?void 0:n.call(a))??e.title]}}),((v=a.text)==null?void 0:v.call(a))??e.text,(m=a.default)==null?void 0:m.call(a)]),a.append&&o("div",{key:"append",class:"v-alert__append"},[a.append()]),M&&o("div",{key:"close",class:"v-alert__close"},[a.close?l(k,{key:"close-defaults",defaults:{VBtn:{icon:e.closeIcon,size:"x-small",variant:"text"}}},{default:()=>{var n;return[(n=a.close)==null?void 0:n.call(a,{props:u.value})]}}):l(Y,S({key:"close-btn",icon:e.closeIcon,size:"x-small",variant:"text"},u.value),null)])]}})}}});export{Se as V};
