import{r as i,B as t,h as o}from"./p-f8363b1b.js";const r=class{constructor(t){i(this,t)}getCssVarColor(i){return(null==t?void 0:t.isBrowser)?getComputedStyle(document.documentElement).getPropertyValue(`--ion-color-${i}`).replace(" ",""):i}render(){var i,t,r;return o("div",{class:"avatar-image",style:{background:this.color,backgroundImage:!(null===(i=this.src)||void 0===i?void 0:i.length)&&this.initials?`url('https://avatars.dicebear.com/api/initials/${this.initials}.svg${this.color&&(this.color.includes("#")||this.color.includes("rgb(")||this.color.includes("rgba(")||this.color.includes("hsl(")||this.color.includes("hsla("))?`?b=${this.color.replace("#","%23")}`:this.color?`?b=${this.getCssVarColor(this.color).replace("#","%23")}`:""}')`:`url('${(null===(t=this.src)||void 0===t?void 0:t.length)?this.src:(null===(r=this.fallback)||void 0===r?void 0:r.length)?this.fallback:"/assets/images/default-icon.png"}')`,height:this.size?this.size:"50px",width:this.size?this.size:"50px"}})}};r.style="fireenjin-avatar{position:relative}fireenjin-avatar .avatar-image{display:block;border-radius:4px;border:1px solid var(--ion-color-light-shade);background-color:var(--ion-color-light);background-size:cover;background-position:center;font-weight:bolder;text-align:center;color:var(--ion-color-medium);text-decoration:none;margin:auto !important}";export{r as fireenjin_avatar}