1import{r as d,j as l}from"./app-YI4vRmAj.js";/* empty css */function m(a){const r=a.trim(),t=r.split(/\s+/).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join("").padEnd(1,"?");let o=0;for(let e=0;e<r.length;e++)o=o*31+r.charCodeAt(e)|0;const n=Math.abs(o)%360,s=(n+30)%360;return{from:`hsl(${n}, 65%, 55%)`,to:`hsl(${s}, 70%, 45%)`,initials:t}}function u(a,r,t){const o=r/100,n=t/100,s=o*Math.min(n,1-n),e=h=>{const i=(h+a/30)%12,c=n-s*Math.max(-1,Math.min(i-3,9-i,1));return Math.round(255*c).toString(16).padStart(2,"0")};return`#${e(0)}${e(8)}${e(4)}`}function p(a){const r=a.trim();let t=0;for(let n=0;n<r.length;n++)t=t*31+r.charCodeAt(n)|0;const o=Math.abs(t)%360;return u(o,65,55)}function x({name:a,media:r,size:t,iconColor:o=null}){const[n,s]=d.useState(!1);if(r&&!n)return l.jsx("img",{src:r,alt:"",width:t,height:t,loading:"lazy",onError:()=>s(!0),className:"shrink-0 rounded-lg object-cover",style:{width:t,height:t}});const{from:e,to:h,initials:i}=m(a),c=o??`linear-gradient(135deg, ${e}, ${h})`;return l.jsx("div",{className:"flex shrink-0 items-center justify-center rounded-lg font-semibold text-white shadow-inner",style:{width:t,height:t,fontSize:Math.round(t*.4),background:c},"aria-hidden":!0,children:i})}export{x as CommunityAvatar,p as autoColorHex,m as avatarFromName};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.