import{j as e,h as m}from"./codemirror-core-DIzFijqu.js";import{q as ra,c as ta,d as S}from"./index-tO5nu8Yv.js";import{aF as na,n as ia,q as ca,aG as da,x as q,i as z,r as h,t as ua,v as ma}from"./react-dom-BT-HHJs9.js";import{u as fa}from"./chunk-MLPFQTYO-lAEKjCEv.js";var va=()=>e.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"80%",role:"presentation",viewBox:"0 0 24 24",width:"80%",children:[e.jsx("path",{d:"M12 2C9.38 2 7.25 4.13 7.25 6.75C7.25 9.32 9.26 11.4 11.88 11.49C11.96 11.48 12.04 11.48 12.1 11.49C12.12 11.49 12.13 11.49 12.15 11.49C12.16 11.49 12.16 11.49 12.17 11.49C14.73 11.4 16.74 9.32 16.75 6.75C16.75 4.13 14.62 2 12 2Z",fill:"currentColor"}),e.jsx("path",{d:"M17.0809 14.1489C14.2909 12.2889 9.74094 12.2889 6.93094 14.1489C5.66094 14.9989 4.96094 16.1489 4.96094 17.3789C4.96094 18.6089 5.66094 19.7489 6.92094 20.5889C8.32094 21.5289 10.1609 21.9989 12.0009 21.9989C13.8409 21.9989 15.6809 21.5289 17.0809 20.5889C18.3409 19.7389 19.0409 18.5989 19.0409 17.3589C19.0309 16.1289 18.3409 14.9889 17.0809 14.1489Z",fill:"currentColor"})]}),[Aa,pa]=ra({name:"AvatarGroupContext",strict:!1});function ba(P={}){var f,v,p,n,b,l;const s=ta(),a=pa(),i=!!a,{as:c,ref:d,src:o,name:g,icon:A,classNames:r,fallback:Z,alt:L=g||"avatar",imgRef:T,color:F=(f=a==null?void 0:a.color)!=null?f:"default",radius:N=(v=a==null?void 0:a.radius)!=null?v:"full",size:G=(p=a==null?void 0:a.size)!=null?p:"md",isBordered:$=(n=a==null?void 0:a.isBordered)!=null?n:!1,isDisabled:k=(b=a==null?void 0:a.isDisabled)!=null?b:!1,isFocusable:M=!1,getInitials:U=na,ignoreFallback:_=!1,showFallback:V=!1,ImgComponent:w="img",imgProps:R,className:J,onError:K,disableAnimation:D,...B}=P,Q=c||"span",W=S(d),I=S(T),{isFocusVisible:X,isFocused:Y,focusProps:y}=ia(),{isHovered:aa,hoverProps:sa}=ca({isDisabled:k}),C=(l=D??(s==null?void 0:s.disableAnimation))!=null?l:!1,x=fa({src:o,onError:K,ignoreFallback:_})==="loaded",E=typeof w=="string",ea=(!o||!x)&&V,u=m.useMemo(()=>{var t;return da({color:F,radius:N,size:G,isBordered:$,isDisabled:k,isInGroup:i,disableAnimation:C,isInGridGroup:(t=a==null?void 0:a.isGrid)!=null?t:!1})},[F,N,G,$,k,C,i,a==null?void 0:a.isGrid]),O=q(r==null?void 0:r.base,J),j=m.useMemo(()=>M||c==="button",[M,c]),la=m.useCallback((t={})=>({ref:W,tabIndex:j?0:-1,"data-hover":h(aa),"data-focus":h(Y),"data-focus-visible":h(X),className:u.base({class:q(O,t==null?void 0:t.className)}),...z(B,sa,j?y:{})}),[j,u,O,y,B]),oa=m.useCallback((t={})=>({ref:I,src:o,"data-loaded":h(x),className:u.img({class:r==null?void 0:r.img}),...z(R,t,ua({disableAnimation:C},{enabled:E}))}),[u,x,R,C,o,I,E]);return{Component:Q,ImgComponent:w,src:o,alt:L,icon:A,name:g,imgRef:I,slots:u,classNames:r,fallback:Z,isImgLoaded:x,showFallback:ea,ignoreFallback:_,getInitials:U,getAvatarProps:la,getImageProps:oa}}var H=ma((P,f)=>{const{Component:v,ImgComponent:p,src:n,icon:b=e.jsx(va,{}),alt:l,classNames:s,slots:a,name:i,showFallback:c,fallback:d,getInitials:o,getAvatarProps:g,getImageProps:A}=ba({...P,ref:f}),r=m.useMemo(()=>!c&&n?null:d?e.jsx("div",{"aria-label":l,className:a.fallback({class:s==null?void 0:s.fallback}),role:"img",children:d}):i?e.jsx("span",{"aria-label":l,className:a.name({class:s==null?void 0:s.name}),role:"img",children:o(i)}):e.jsx("span",{"aria-label":l,className:a.icon({class:s==null?void 0:s.icon}),role:"img",children:b}),[c,n,d,i,s]);return e.jsxs(v,{...g(),children:[n&&e.jsx(p,{...A(),alt:l}),r]})});H.displayName="HeroUI.Avatar";var ka=H;export{ka as a};
