import{r as p,K as M,N,V as b,j as c,Q as j,W as w,a3 as Z,$ as z,Y as F,_ as V,b8 as $}from"./index-Db-xuq0b.js";const G=p.createContext(null),P=G.Provider;function B(){return{withinGroup:!!p.useContext(G)}}var C={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const U={},K=w((r,{spacing:a})=>({group:{"--ag-spacing":Z(a)}})),h=M((r,a)=>{const t=N("AvatarGroup",U,r),{classNames:e,className:n,style:l,styles:u,unstyled:i,vars:d,spacing:s,...o}=t,m=b({name:"AvatarGroup",classes:C,props:t,className:n,style:l,classNames:e,styles:u,unstyled:i,vars:d,varsResolver:K,rootSelector:"group"});return c.jsx(P,{value:!0,children:c.jsx(j,{ref:a,...m("group"),...o})})});h.classes=C;h.displayName="@mantine/core/AvatarGroup";function Q(r){return c.jsx("svg",{...r,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function W(r){let a=0;for(let t=0;t<r.length;t+=1){const e=r.charCodeAt(t);a=(a<<5)-a+e,a|=0}return a}const Y=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function q(r,a=Y){const t=W(r),e=Math.abs(t)%a.length;return a[e]}function D(r,a=2){const t=r.split(" ");return t.length===1?r.slice(0,a).toUpperCase():t?.map(e=>e[0]).slice(0,a).join("").toUpperCase()}const H={},J=w((r,{size:a,radius:t,variant:e,gradient:n,color:l,autoContrast:u,name:i,allowedInitialsColors:d})=>{const s=l==="initials"&&typeof i=="string"?q(i,d):l,o=r.variantColorResolver({color:s||"gray",theme:r,gradient:n,variant:e||"light",autoContrast:u});return{root:{"--avatar-size":V(a,"avatar-size"),"--avatar-radius":t===void 0?void 0:F(t),"--avatar-bg":s||e?o.background:void 0,"--avatar-color":s||e?o.color:void 0,"--avatar-bd":s||e?o.border:void 0}}}),g=z((r,a)=>{const t=N("Avatar",H,r),{classNames:e,className:n,style:l,styles:u,unstyled:i,vars:d,src:s,alt:o,radius:m,color:X,gradient:aa,imageProps:v,children:R,autoContrast:ra,mod:E,name:x,allowedInitialsColors:ta,...I}=t,S=B(),[_,y]=p.useState(!s),f=b({name:"Avatar",props:t,classes:C,className:n,style:l,classNames:e,styles:u,unstyled:i,vars:d,varsResolver:J});return p.useEffect(()=>y(!s),[s]),c.jsx(j,{...f("root"),mod:[{"within-group":S.withinGroup},E],ref:a,...I,children:_?c.jsx("span",{...f("placeholder"),title:o,children:R||typeof x=="string"&&D(x)||c.jsx(Q,{})}):c.jsx("img",{...v,...f("image"),src:s,alt:o,onError:k=>{var A;y(!0),(A=v==null?void 0:v.onError)==null||A.call(v,k)}})})});g.classes=C;g.displayName="@mantine/core/Avatar";g.Group=h;p.createContext({});function L({className:r,children:a,...t}){const e=p.Children.toArray(a),n=e.find(s=>{var o;return p.isValidElement(s)&&((o=s.type)==null?void 0:o.displayName)==="AvatarImage"}),l=e.find(s=>{var o;return p.isValidElement(s)&&((o=s.type)==null?void 0:o.displayName)==="AvatarFallback"}),u=n==null?void 0:n.props.src,i=(n==null?void 0:n.props.alt)??"",d=l==null?void 0:l.props.children;return c.jsx(g,{src:u,alt:i,radius:"xl",className:$("relative flex size-8 shrink-0 overflow-hidden rounded-full",r),...t,children:d})}L.displayName="Avatar";function O({className:r,src:a,alt:t,...e}){return null}O.displayName="AvatarImage";function T({className:r,children:a,...t}){return null}T.displayName="AvatarFallback";export{L as A,T as a,g as b,O as c};
