1import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{B as t,G as n,X as r}from"./shell-CIhyBI-S.js";import{Hd as i,Kd as a,Or as o,ld as s}from"./index-DGahafm_.js";import{t as c}from"./smart-image-BB-N9Vuh.js";import{c as l,n as u,t as d}from"./KickIcon-YVSYejzs.js";var f=e(a(),1),p={utm_source:`codmunity.gg`,utm_medium:`referral`,utm_campaign:`ranked_hub`};function m(e){if(!e)return``;try{let t=new URL(e);if(!t.hostname.toLowerCase().endsWith(`twitch.tv`))return e;for(let[e,n]of Object.entries(p))t.searchParams.set(e,n);return t.toString()}catch{return e}}var h={twitch:/twitch\.tv\/([A-Za-z0-9_]+)/i,youtube:/youtube\.com\/(?:@([A-Za-z0-9._-]+)|channel\/([A-Za-z0-9_-]+)|c\/([A-Za-z0-9._-]+)|user\/([A-Za-z0-9._-]+))/i,kick:/kick\.com\/([A-Za-z0-9_-]+)/i};function g(e,t){if(!t)return null;let n=h[e].exec(t);return n&&n.slice(1).find(Boolean)||null}function _(e,t){return`${e}:${t.toLowerCase()}`}function v(e,t){if(!e)return null;let n=[[`twitch`,t.twitchUrl],[`kick`,t.kickUrl],[`youtube`,t.youtubeUrl]];for(let[t,r]of n){let n=g(t,r);if(!n)continue;let i=e[_(t,n)];if(i)return i}return null}var y=i();function b(e){let{data:t}=s({...o(),enabled:!0});return v(t,e)}function x({live:e,compact:t=!1,className:n=``}){if(!e)return null;let r=`${u[e.platform]} live${e.title?` - ${e.title}`:``}`,i=e.platform===`twitch`?m(e.url):e.url;return(0,y.jsxs)(`a`,{href:i,target:`_blank`,rel:`noreferrer noopener`,title:r,"aria-label":r,className:`cm-live-pill inline-flex shrink-0 items-center gap-1 rounded-full border border-destructive/40 bg-destructive/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase leading-none tracking-wide text-destructive transition-colors hover:bg-destructive/25 ${n}`,children:[(0,y.jsxs)(`span`,{className:`relative flex h-1.5 w-1.5`,children:[(0,y.jsx)(`span`,{className:`absolute inline-flex h-full w-full animate-ping rounded-full bg-destructive opacity-75`}),(0,y.jsx)(`span`,{className:`relative inline-flex h-1.5 w-1.5 rounded-full bg-destructive`})]}),t?null:`Live`]})}function S({social:e,size:t=`sm`,showLive:n=!0}){let r=b({twitchUrl:e?.twitchUrl,youtubeUrl:e?.youtubeUrl,kickUrl:e?.kickUrl});return(0,y.jsx)(C,{social:e,size:t,showLive:n,live:r})}var C=(0,f.memo)(function({social:e,size:i=`sm`,showLive:a=!0,live:o}){if(!e||!e.twitchUrl&&!e.youtubeUrl&&!e.kickUrl&&!e.codmunityUrl)return null;let s=i===`sm`?`h-3.5 w-3.5`:`h-4 w-4`;return(0,y.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[a?(0,y.jsx)(x,{live:o}):null,e.twitchUrl?(0,y.jsx)(`a`,{href:m(e.twitchUrl),target:`_blank`,rel:`noreferrer noopener`,"aria-label":`Twitch channel`,className:`text-muted-foreground transition-colors hover:text-primary`,children:(0,y.jsx)(r,{className:s})}):null,e.youtubeUrl?(0,y.jsx)(`a`,{href:e.youtubeUrl,target:`_blank`,rel:`noreferrer noopener`,"aria-label":`YouTube channel`,className:`text-muted-foreground transition-colors hover:text-destructive`,children:(0,y.jsx)(t,{className:s})}):null,e.kickUrl?(0,y.jsx)(`a`,{href:e.kickUrl,target:`_blank`,rel:`noreferrer noopener`,"aria-label":`Kick channel`,className:`text-muted-foreground transition-colors hover:text-primary`,children:(0,y.jsx)(d,{className:s})}):null,e.codmunityUrl?(0,y.jsx)(`a`,{href:e.codmunityUrl,"aria-label":`CODMunity profile`,title:l(e.codmunityUrl)?`CODMunity profile: ${l(e.codmunityUrl)}`:`CODMunity profile`,className:`inline-flex items-center gap-1 text-muted-foreground transition-colors hover:text-primary`,children:(0,y.jsx)(n,{className:s})}):null]})});function w({social:e,gamertag:t,className:n=`h-7 w-7`,size:r=28}){return e?.avatarUrl?(0,y.jsx)(c,{src:e.avatarUrl,alt:`${t} profile picture`,width:r,height:r,fit:`cover`,className:`shrink-0 rounded-full object-cover ring-1 ring-border ${n}`}):null}export{v as a,x as i,S as n,C as r,w as t};
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.