"use client";
import{e as f,n as u}from"./chunk-CLTGASR6.js";import{a as c,m as g,n as m}from"./chunk-3CHPBNY2.js";import{forwardRef as z,useState as P}from"react";import E from"clsx";var S=c("EulAvatar",["root","isImage","disabled"]),y=t=>f("EulAvatar",{root:[t.disabled&&"disabled",!!t.src&&"isImage","root"]}),i=S;import{css as C}from"@emotion/react";var b=g("span",{shouldForwardProp:t=>!["fontSize","lineHeight","size"].includes(t.toString())})(({fontSize:t,lineHeight:p,size:o=20,theme:r})=>C`
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: ${o}px;
    height: ${o}px;
    overflow: hidden;
    color: ${r.palette.common.white};
    font-size: ${t||r.typography.body2.fontSize};
    line-height: ${p||r.typography.body2.lineHeight};
    background-color: ${r.palette.background[600]};
    border: 1px solid ${r.palette.background[700]};
    border-radius: 50%;
    transition: ${r.transitions.create(["border-color"])};
    user-select: none;

    &:hover {
      border-color: ${r.palette.background[700]};
    }

    &.${i.isImage} {
      border-width: 0;
    }

    &.${i.disabled} {
      cursor: not-allowed;
      opacity: 0.5;

      &:hover {
        border-color: ${r.palette.background[700]};
      }
    }

    &:focus-visible {
      outline: ${r.spacing(.5)} solid ${r.palette.yellow[600]};
      outline-offset: ${r.spacing(.5)};
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      color: transparent;
      text-align: center;
      text-indent: 10000px;
    }
  `);import{jsx as k,jsxs as W}from"react/jsx-runtime";var h=z((t,p)=>{let{children:o,className:r,loading:v,size:e=20,src:s,...A}=t,a=m(),$=y(t),[l,n]=P(!1),x=()=>{n(!0)};u(s,()=>{n(!1)});let d=e<36?a.typography.body2:e<44?a.typography.body1:e<54?a.typography.subtitle3:e<60?a.typography.subtitle2:e<72||e<124?a.typography.subtitle1:a.typography.h5;return W(b,{...A,className:E($.root,r),fontSize:d.fontSize,lineHeight:d.lineHeight,ref:p,size:e,tabIndex:0,children:[(!s||l)&&o&&`${o.split(" ")[0][0]}${o.split(" ")[1]?o.split(" ")[1][0].toLowerCase():""}`,s&&!l&&k("img",{alt:o,loading:v,onError:x,src:s})]})});h.displayName="Avatar";var H=h;export{i as a,H as b};
