import{a as G,r as A,$,c as D,ew as J,aE as K,ca as Q,aa as w,ae as N,p as U,bw as H,a5 as o,i as u,_ as B,eo as Z,a6 as h,Y as ee,a3 as ae,bd as re,dB as te}from"./index.ae52ebae.js";import{u as ne,a as ie}from"./useSize.9b10dc05.js";import{e as le}from"./eagerComputed.94e91cab.js";var oe=function(){return{prefixCls:String,shape:{type:String,default:"circle"},size:{type:[Number,String,Object],default:function(){return"default"}},src:String,srcset:String,icon:ee.any,alt:String,gap:Number,draggable:{type:Boolean,default:void 0},crossOrigin:String,loadError:{type:Function}}},se=G({name:"AAvatar",inheritAttrs:!1,props:oe(),slots:["icon"],setup:function(e,S){var P=S.slots,i=S.attrs,g=A(!0),p=A(!1),x=A(1),l=A(null),y=A(null),E=$("avatar",e),m=E.prefixCls,T=ne(),n=D(function(){return e.size==="default"?T.value:e.size}),k=J(),c=le(function(){if(K(e.size)==="object"){var a=Q.find(function(t){return k.value[t]}),r=e.size[a];return r}}),O=function(r){return c.value?{width:"".concat(c.value,"px"),height:"".concat(c.value,"px"),lineHeight:"".concat(c.value,"px"),fontSize:"".concat(r?c.value/2:18,"px")}:{}},v=function(){if(!(!l.value||!y.value)){var r=l.value.offsetWidth,t=y.value.offsetWidth;if(r!==0&&t!==0){var s=e.gap,z=s===void 0?4:s;z*2