import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{n as t,t as n}from"./jsx-runtime-BHz_hoGM.js";import{d as r}from"./useTranslation-CWZfA4RN.js";var i=new Intl.Segmenter;function a(e){if(e.length<1)return``;let t=e[0];[`@`,`#`,`+`].includes(t)&&(e=e.substring(1));let n=i.segment(e)[Symbol.iterator]().next();return n.done?``:n.value.segment}function o(e){return e.split(``).reduce((e,t)=>e+t.charCodeAt(0),0)%6+1}var s={avatar:`_avatar_va14e_8`,image:`_image_va14e_43`,"avatar-imageless":`_avatar-imageless_va14e_55`,"stacked-avatars":`_stacked-avatars_va14e_109`,"clip-path":`_clip-path_va14e_128`},c=e(r(),1),l=e(t(),1),u=n();function d(e){return!!(e.onClick||e.onKeyDown||e.onKeyUp)}var f=(0,l.forwardRef)(function({src:e,id:t,name:n=``,type:r=`round`,className:i=``,size:f,style:p={},onError:m,...h},g){return l.createElement(d(h)?`button`:`span`,{ref:g,role:`img`,"aria-label":t,...h,"data-type":r,"data-color":o(t),className:(0,c.default)(s.avatar,i,{[s[`avatar-imageless`]]:!e}),style:{...p,"--cpd-avatar-size":f}},(0,u.jsx)(l.Fragment,{children:e?(0,u.jsx)(`img`,{loading:`lazy`,alt:``,src:e,referrerPolicy:`no-referrer`,className:(0,c.default)(s.image),"data-type":r,style:p,width:f,height:f,onError:m}):a(n)}))});export{f as t};
//# sourceMappingURL=Avatar-V1mexNc2.js.map