const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Overview-HByjq9OC.js","assets/rolldown-runtime-S-ySWqyJ.js","assets/vendor-DlcENO3s.js","assets/MatchRow-BsrqBnkj.js","assets/MapImage-XWjBlAx6.js","assets/useValorantAssets-kVSZN29d.js","assets/PrefetchLink-BXZ4zKk8.js","assets/api-CXYc3eA_.js","assets/tooltip-hczLph4b.js","assets/match-status-utils-DwQOYIBi.js","assets/time-3ByDQDsN.js","assets/registry-C2BC-slE.js","assets/AgentIcon-CVW-vTHi.js","assets/SparkLine-Q1OgFo2P.js","assets/StreamWatchChip-2JNW5gUI.js","assets/RatingBadge-DqYye0hU.js","assets/TournamentHero-XbUDRie8.js","assets/status-pill-CuNjPX3c.js","assets/rank-medal-BxLhrGYx.js","assets/widget-footer-link-N0I5ueMv.js","assets/useLeaderboardV2-DxqZ3tZd.js","assets/useNews-DUZTElbA.js","assets/adminApi-D3msE52a.js","assets/flags-B3Juk3B9.js","assets/job-auto-flags-CJFzk1Bz.js","assets/FeaturedMatchCard-BqQ7Aj73.js","assets/TeamMomentumWidget-C5q-W3dv.js","assets/useTeams-DZNP8D04.js","assets/QueryError-BCtgB-Cz.js","assets/TeamFormBar-D6zOPQeV.js","assets/useMeasuredSpan-D72wIjAQ.js","assets/FilterBar-D7y00Q6P.js","assets/sheet-BCd52vbM.js","assets/button-BSGb0Fo3.js","assets/useMatch-BBLaD3n5.js","assets/useTeam-B1GeOv22.js","assets/useTournament-BDnaHO82.js","assets/seo-helpers-BPEHfU_C.js","assets/WidgetStateContainer-DKdzaXnA.js","assets/WidgetEmpty-DVgBQKKz.js","assets/Teams-ND_MTe_k.js","assets/RailPeek-BFPwIvFR.js","assets/EntityNotFound-C2iifr1i.js","assets/RatingChartWidget-DIe3AvN9.js","assets/Skeleton-CoYE3fh0.js","assets/EditWidgetsButton-BymaIiO_.js","assets/StaticBentoGrid-DrjeWOcP.js","assets/TrendArrow-BEztFRKG.js","assets/WatchButton-BeokgxCW.js","assets/FormDots-DNOt4g4v.js","assets/expandable-search-CFZmQJC0.js","assets/timeAgo-B6pbOu-Q.js","assets/Players-DBppu7yK.js","assets/vendor-charts-TJs8E7y_.js","assets/formatters-_uoOtv7v.js","assets/Matches-BAb3lcCO.js","assets/TaleOfTape-DMaYAP_r.js","assets/tabs-CixBK6QN.js","assets/MatchDetail-Blbzi-pe.js","assets/delta-pill-BgDtzdYx.js","assets/pick-stream-link-Bb85eftn.js","assets/team-color-presets-BEIGJLlz.js","assets/Stats-Ba_Icc1Z.js","assets/seo-BcYyLOae.js","assets/PlayerRankings-DhoUBIaM.js","assets/Tournaments-C3tdqXdB.js","assets/UpcomingSeedRow-Ch8vB-mn.js","assets/TournamentDetail-DcWlSWXj.js","assets/BracketView-l7_KxHRC.js","assets/News-odtwfM5n.js","assets/text-Crh_1lrG.js","assets/AdminLayout-UZd7vwNY.js","assets/adminNoindex-DuVfG8bh.js","assets/AdminLogin-D1jvQkFR.js","assets/Overview-eSbJoBGP.js","assets/MiniAreaChart-C91f3KVT.js","assets/Content-lzrlFkWT.js","assets/Issues-6_B943Da.js","assets/useDialogDismiss-D3TxxLvB.js","assets/Jobs-D-ydh0wi.js","assets/useJobRuns-DehMKv4l.js","assets/TypeDashboard-ZDn6f3nV.js","assets/RunDetail-B5YKU290.js","assets/Competitions-DJSio2xz.js","assets/useAdminLeagues-Cdb6AjMY.js","assets/Entities-CnJsOjZV.js","assets/Coaches-CTm7CuY6.js","assets/System-D2gE5hwX.js","assets/DuplicateMatchTriage-DUQVX6rQ.js","assets/Analytics-Baq_W0s5.js","assets/AnalyticsMediaKit-ewmgdzmU.js","assets/Drafts-BZ9aYmeg.js","assets/useAdminNews-jgFrNQnT.js","assets/Config-DAGuoHWk.js","assets/Calibration-BCYIZ3Sa.js","assets/Clips-B_1hKCl5.js","assets/ClipDetail-ByjHYE66.js","assets/SensitiveTopics-CHNnOm2k.js","assets/Feed-B1mX4gkM.js","assets/StatChip-PWL0C4BD.js","assets/Story-BdcrdfmE.js","assets/StoryArticle-DPHJ3JMP.js","assets/Review-ClkpM_fs.js","assets/Privacy-CrUFJVxA.js","assets/About-kELYc4eX.js","assets/Methodology-CfMQ3e15.js"])))=>i.map(i=>d[i]);
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{$n as t,$t as n,Ar as r,At as i,Bn as a,Br as o,Ci as s,Ct as c,Dr as l,Dt as u,Et as d,Fn as f,Ft as p,In as m,It as h,Jn as g,Jt as _,Kr as v,Mt as y,Nn as b,Nr as x,Nt as S,Or as C,Ot as w,Pn as ee,Pt as T,Qr as te,Rn as ne,Rt as re,Sn as ie,St as E,Tn as ae,Tt as D,Ut as oe,Xn as se,Zn as ce,_i as le,_n as ue,_r as de,_t as O,an as fe,bi as k,bt as A,cn as pe,di as me,dn as he,er as ge,fi as j,gi as M,gr as _e,gt as N,hi as ve,ht as P,ii as ye,in as be,jt as xe,kt as Se,li as Ce,mi as F,mn as we,mt as Te,oi as Ee,pi as De,qt as Oe,ri as ke,si as Ae,ti as je,ui as Me,vi as I,vt as Ne,wn as Pe,wt as Fe,xi as Ie,xn as Le,xt as L,yi as Re,yr as ze,yt as R,zr as Be}from"./vendor-DlcENO3s.js";import{n as Ve,o as He,r as Ue,t as We}from"./api-CXYc3eA_.js";import{a as Ge,n as Ke,o as qe,r as Je,s as Ye}from"./match-status-utils-DwQOYIBi.js";import{t as Xe}from"./team-color-presets-BEIGJLlz.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var z=e(s(),1),Ze=Ie(),Qe=2,$e=1500;function et(e,t){return e>=Qe||t instanceof Ve?!1:t instanceof We?t.status>=500:!0}var tt=new Ae({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:et,retryDelay:e=>Math.min(600*(e+1),$e)}}}),B=Ee(),nt=(0,z.createContext)(null);function rt(){let e=(0,z.useContext)(nt);if(!e)throw Error(`useToast must be used within a ToastProvider`);return e}function it(){return(0,z.useContext)(nt)||{toast:{success:()=>{},error:()=>{},warning:()=>{},info:()=>{}}}}var at=3,ot=4e3,st={success:{border:`border-l-green-500`,icon:x,iconClass:`text-green-500`,progressBg:`bg-green-500`},error:{border:`border-l-red-500`,icon:r,iconClass:`text-red-500`,progressBg:`bg-red-500`},warning:{border:`border-l-amber-500`,icon:_,iconClass:`text-amber-500`,progressBg:`bg-amber-500`},info:{border:`border-l-blue-500`,icon:t,iconClass:`text-blue-500`,progressBg:`bg-blue-500`}};function ct({toast:e,onDismiss:t}){let{border:n,icon:r,iconClass:i,progressBg:a}=st[e.type];return(0,B.jsxs)(`div`,{className:`
        relative overflow-hidden rounded-lg border-l-4 ${n}
        bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800
        shadow-lg w-80 pointer-events-auto
        ${e.dismissing?`animate-toast-out`:`animate-toast-in`}
      `,role:e.type===`error`||e.type===`warning`?`alert`:`status`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5 px-3 py-2.5`,children:[(0,B.jsx)(r,{size:16,className:`flex-shrink-0 mt-0.5 ${i}`}),(0,B.jsx)(`p`,{className:`text-sm text-zinc-800 dark:text-zinc-200 flex-1 break-words leading-snug`,children:e.message}),(0,B.jsx)(`button`,{onClick:()=>t(e.id),className:`flex-shrink-0 p-0.5 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200 transition-colors`,"aria-label":`Close`,children:(0,B.jsx)(re,{size:14})})]}),(0,B.jsx)(`div`,{className:`h-0.5 w-full bg-zinc-100 dark:bg-zinc-800`,children:(0,B.jsx)(`div`,{className:`h-full ${a} opacity-60`,style:{animation:`toast-progress ${ot}ms linear forwards`}})})]})}function lt({toasts:e,onDismiss:t}){return(0,B.jsx)(`div`,{role:`region`,"aria-live":`polite`,"aria-label":`Notifications`,className:`fixed bottom-4 right-4 z-[9999] flex flex-col-reverse gap-2 pointer-events-none`,children:e.map(e=>(0,B.jsx)(ct,{toast:e,onDismiss:t},e.id))})}function ut({children:e}){let[t,n]=(0,z.useState)([]),r=(0,z.useCallback)(e=>{n(t=>t.map(t=>t.id===e?{...t,dismissing:!0}:t)),setTimeout(()=>{n(t=>t.filter(t=>t.id!==e))},250)},[]),i=(0,z.useCallback)((e,t)=>{let i=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;n(n=>{let r=[...n,{id:i,type:e,message:t}];return r.length>at?r.slice(-at):r}),setTimeout(()=>r(i),ot)},[r]),a={success:(0,z.useCallback)(e=>i(`success`,e),[i]),error:(0,z.useCallback)(e=>i(`error`,e),[i]),warning:(0,z.useCallback)(e=>i(`warning`,e),[i]),info:(0,z.useCallback)(e=>i(`info`,e),[i])};return(0,z.useEffect)(()=>{let e=`toast-keyframes`;if(document.getElementById(e))return;let t=document.createElement(`style`);t.id=e,t.textContent=`
      @keyframes toast-in {
        from { opacity: 0; transform: translateX(100%); }
        to   { opacity: 1; transform: translateX(0); }
      }
      @keyframes toast-out {
        from { opacity: 1; transform: translateX(0); }
        to   { opacity: 0; transform: translateX(100%); }
      }
      @keyframes toast-progress {
        from { width: 100%; }
        to   { width: 0%; }
      }
      .animate-toast-in {
        animation: toast-in 0.25s ease-out forwards;
      }
      .animate-toast-out {
        animation: toast-out 0.25s ease-in forwards;
      }
    `,document.head.appendChild(t)},[]),(0,B.jsxs)(nt.Provider,{value:{toast:a},children:[e,(0,B.jsx)(lt,{toasts:t,onDismiss:r})]})}var dt=!1;function ft(){T({dsn:`https://e036e502a42998e91f6633e95eeeef35@o4511272420311040.ingest.de.sentry.io/4511272422539344`,environment:`production`,release:``,tracesSampleRate:0,integrations:[]}),dt=!0}function V(e,t){if(dt)try{t&&Object.keys(t).length>0?h(n=>{n.setExtras(t),p(e)}):p(e)}catch{}}var pt=/[A-Za-z]:\\[^\s)]+/g,mt=/\/[A-Za-z0-9_./-]+\.(?:tsx?|jsx?|mjs|cjs|map)\b/g,ht=/[\w.+-]+@[\w-]+\.[\w.-]+/g,gt=/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,_t=/\bBearer\s+[A-Za-z0-9._~+/-]+=*\b/gi,vt=/\b[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g,yt=/([?&](?:token|api[_-]?key|access[_-]?token|secret|session|sig|auth)=)([^&\s"'<>]+)/gi;function bt(e){return e.replace(pt,`<path>`).replace(mt,`<path>`).replace(_t,`<token>`).replace(vt,`<token>`).replace(yt,`$1<query-secret>`).replace(ht,`<email>`).replace(gt,`<ip>`)}function xt(e){let t=e,n=`${t?.name??``} ${t?.message??``}`;return n.trim()?/dynamically imported module/i.test(n)||/ChunkLoadError/i.test(n)||/Importing a module script failed/i.test(n)||/is not a valid (?:JavaScript|MIME)|valid JavaScript MIME type/i.test(n)||/Expected a JavaScript module script/i.test(n)||/MIME type of (?:["']?)text\/html/i.test(n)||/Failed to load module script/i.test(n)||/Failed to fetch dynamically/i.test(n):!1}function St(e=`glicko.chunkReloadedAt`){try{if(typeof window>`u`)return!1;if(typeof sessionStorage<`u`){if(sessionStorage.getItem(e))return!1;sessionStorage.setItem(e,String(Date.now()))}return window.location.reload(),!0}catch{return!1}}var Ct=class extends z.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){if(!(xt(e)&&St())){try{let t=JSON.stringify({sessionId:wt(),route:typeof window<`u`?window.location.pathname:``,metric:`error`,value:1,rating:`poor`,userAgent:typeof navigator<`u`?navigator.userAgent:``,message:bt(e.message??`app render error`),stack:bt((e.stack??``).slice(0,4096)),boundary:`app`});typeof navigator<`u`&&typeof navigator.sendBeacon==`function`&&navigator.sendBeacon(`/api/metrics/web-vitals`,t)}catch{}V(e,{boundary:`app`,route:typeof window<`u`?window.location.pathname:``,componentStack:t.componentStack}),this.props.onError?.(e,t)}}reload=()=>{typeof window<`u`&&window.location.reload()};render(){return this.state.hasError?(0,B.jsx)(`div`,{role:`alert`,style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`2rem`,fontFamily:`Inter, system-ui, sans-serif`,background:`#0a0a0c`,color:`#fafafa`},children:(0,B.jsxs)(`div`,{style:{maxWidth:`32rem`,textAlign:`center`},children:[(0,B.jsx)(`div`,{style:{width:`4rem`,height:`4rem`,margin:`0 auto 1.25rem`,borderRadius:`1rem`,background:`rgba(255,70,85,0.12)`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#ff4655`,fontWeight:800,fontSize:`1.75rem`},children:`!`}),(0,B.jsx)(`h1`,{style:{fontSize:`1.25rem`,fontWeight:700,marginBottom:`0.5rem`},children:`Glicko hit an unexpected error`}),(0,B.jsx)(`p`,{style:{fontSize:`0.875rem`,color:`#a1a1aa`,marginBottom:`1.25rem`},children:`The page failed to render. Reload to try again — your scroll position will reset, but your filters are kept in the URL.`}),this.state.error&&(0,B.jsx)(`pre`,{style:{textAlign:`left`,background:`#18181b`,border:`1px solid #27272a`,borderRadius:`0.5rem`,padding:`0.75rem`,fontSize:`0.75rem`,color:`#a1a1aa`,maxHeight:`8rem`,overflow:`auto`,marginBottom:`1.25rem`},children:this.state.error.message}),(0,B.jsx)(`button`,{type:`button`,onClick:this.reload,style:{background:`#ff4655`,color:`#fff`,border:`none`,padding:`0.625rem 1.25rem`,borderRadius:`0.5rem`,fontSize:`0.875rem`,fontWeight:600,cursor:`pointer`},children:`Reload app`})]})}):this.props.children}};function wt(){try{if(typeof sessionStorage>`u`)return`ssr`;let e=sessionStorage.getItem(`glicko.sessionId`);return e||(e=`s_${Math.random().toString(36).slice(2)}_${Date.now().toString(36)}`,sessionStorage.setItem(`glicko.sessionId`,e)),e}catch{return`anon`}}function H(...e){return w(Se(e))}var Tt=y,Et=S,Dt=z.forwardRef(({className:e,align:t=`start`,sideOffset:n=4,...r},a)=>(0,B.jsx)(xe,{children:(0,B.jsx)(i,{ref:a,align:t,sideOffset:n,className:H(`z-50 min-w-[12rem] rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lg outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,e),...r})}));Dt.displayName=i.displayName;var Ot=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`,`[contenteditable="true"]`].join(`,`);function kt(e){let t=e,n=typeof window<`u`&&typeof window.getComputedStyle==`function`?window.getComputedStyle.bind(window):null;for(;t;){if(t.hidden||t.getAttribute(`aria-hidden`)===`true`)return!1;if(n){let e=n(t);if(e.display===`none`||e.visibility===`hidden`)return!1}t=t.parentElement}return!0}function At(e){return Array.from(e.querySelectorAll(Ot)).filter(e=>e.hasAttribute(`disabled`)?!1:kt(e))}function jt(e,{active:t,initialFocusRef:n,restoreFocusRef:r}){let i=(0,z.useRef)(null);(0,z.useEffect)(()=>{if(!t)return;let a=e.current;if(!a)return;let o=r??i;r||(i.current=document.activeElement instanceof HTMLElement?document.activeElement:null);let s=n?.current;s&&s.isConnected&&s.focus();let c=e=>{if(e.key!==`Tab`)return;let t=At(a);if(t.length===0){e.preventDefault();return}let n=t[0],r=t[t.length-1],i=document.activeElement instanceof HTMLElement?document.activeElement:null;e.shiftKey?(i===n||!a.contains(i))&&(e.preventDefault(),r.focus()):(i===r||!a.contains(i))&&(e.preventDefault(),n.focus())};return a.addEventListener(`keydown`,c,!0),()=>{a.removeEventListener(`keydown`,c,!0);let e=o.current;e&&e.isConnected&&e.focus()}},[t])}var Mt={TEAM_MOMENTUM:`Team Momentum`,SENTIMENT_SWING:`Sentiment Swing`,UPSET:`Upset`,ROSTER_CHANGE:`Roster Change`,TOURNAMENT_MILESTONE:`Tournament Milestone`,REGION_SHIFT:`Region Shift`,PLAYER_BREAKOUT:`Player Breakout`,HEAD_TO_HEAD:`Head to Head`,EVENT_PREVIEW:`Event Preview`,COMEBACK:`Comeback`},Nt={LEAD:`The Lead`,ABOVE_FOLD:`Above the Fold`,WIRE:`The Wire`,COMMUNITY_PULSE:`Community Pulse`,WATCH:`Watch`,RESULTS:`Results`},Pt={REPORT:`Reports`,REDDIT:`Community`,VLR_FORUM:`Community`,YOUTUBE:`Watch`,MATCH_PAGE:`Match`},Ft=E({created:L().int().nonnegative(),updated:L().int().nonnegative(),deleted:L().int().nonnegative().optional()}),It=E({apiCalls:L().int().nonnegative().optional(),dbQueries:L().int().nonnegative().optional(),pages:L().int().nonnegative().optional()}).default({}),Lt=E({code:D().min(1),msg:D(),count:L().int().positive().optional(),sample:u().optional()}),Rt=E({min:L(),max:L(),mean:L(),median:L()}),zt=E({teamsUpdated:L().int().nonnegative(),ratingRange:Rt.nullable(),provisional:L().int().nonnegative(),calibrated:L().int().nonnegative()}),Bt=E({duelist:L().int().nonnegative(),initiator:L().int().nonnegative(),controller:L().int().nonnegative(),sentinel:L().int().nonnegative(),unknown:L().int().nonnegative()}),Vt=E({legacy:L().int().nonnegative(),pure:L().int().nonnegative()}),Ht=Ne(`kind`,[E({kind:A(`team`),pool:E({vct:zt,vcl:zt,gc:zt}),unpooled:zt,snapshotRows:Vt,computeDurationMs:L().int().nonnegative(),advisoryLockWaitMs:L().int().nonnegative(),matchesProcessed:L().int().nonnegative(),pureGlickoEnabled:N()}),E({kind:A(`player`),playersUpdated:L().int().nonnegative(),byRole:Bt,ratingRange:Rt.nullable(),provisional:L().int().nonnegative(),calibrated:L().int().nonnegative(),snapshotRows:Vt,computeDurationMs:L().int().nonnegative(),advisoryLockWaitMs:L().int().nonnegative(),mapsProcessed:L().int().nonnegative(),pureGlickoEnabled:N()})]),Ut=E({datasetItemCount:L().int().nonnegative(),mapped:L().int().nonnegative(),filtered:L().int().nonnegative(),new:L().int().nonnegative(),skipped:L().int().nonnegative()}),Wt=E({cursor:E({pulled:L().int().nonnegative(),acked:L().int().nonnegative()}),bufferDepth:L().int().nonnegative().optional(),oldestUnackedAgeS:L().nonnegative().optional(),itemsPulled:L().int().nonnegative(),itemsAcked:L().int().nonnegative(),pages:L().int().nonnegative().default(0),epochReset:N().default(!1)}),Gt=E({baseUrl:D().min(1),calls:L().int().nonnegative(),lastWallClockS:L().nonnegative().optional(),cacheHits:L().int().nonnegative().default(0),diagnostic:Fe(D(),u()).optional(),pull:Wt.optional()}),Kt=E({actor:D().min(1),runId:D(),datasetItemCount:L().int().nonnegative(),runDurationMs:L().int().nonnegative(),computeUnits:L().nonnegative(),runTimeSecs:L().nonnegative(),usageTotalUsd:L().nonnegative(),consecutiveEmptyRuns:L().int().nonnegative(),orphanedRunId:D().nullable(),empty:N(),funnel:Ut.optional()}),qt=E({summary:D().max(280),writes:Fe(D(),Ft).default({}),reads:It,warnings:P(Lt).default([]),invariantsViolated:P(D()).default([]),durationMs:L().int().nonnegative(),jobRunId:D().optional(),notes:D().max(8e3).optional(),ratingDomain:Ht.optional(),apify:Kt.optional(),sidecar:Gt.optional(),quotaUnitsConsumed:L().int().nonnegative().optional(),matchDrivenSearches:E({executedQueries:P(D()).default([])}).optional()});Fe(D(),E({created:L().int().nonnegative(),updated:L().int().nonnegative(),deleted:L().int().nonnegative()})),P(E({tone:R([`primary`,`info`,`warning`,`neutral`,`danger`]),text:D().max(500).refine(e=>e.trim().length>0,{message:`text must be a non-empty string`}),order:L().finite().optional()}).strict()).max(12);var Jt=E({vlrId:D().nullish(),teamId:D().nullish(),name:D().nullish(),wins:L().int().nullish(),losses:L().int().nullish(),mapDiff:D().nullish(),position:L().int().nullish(),qualified:N().nullish()}).strict();P(E({group:D().min(1),teams:P(Jt)}).strict()),P(E({platform:D().min(1),url:D().url(),kind:R([`live-official`,`live-co-stream`,`vod-official`,`vod-co-stream`,`unknown`]).optional(),channelId:D().optional(),channelTitle:D().optional(),videoId:D().optional(),language:D().optional(),concurrentViewers:L().int().nonnegative().optional(),viewCount:L().int().nonnegative().optional(),publishedAt:D().datetime().optional()}).strict()),E({playerId:D().min(1),playerSlug:D().min(1),playerName:D().min(1),kdr:L().finite(),matches:L().int().nonnegative()}).strict(),P(E({teamSlug:D().max(120).optional(),name:D().max(120).refine(e=>e.trim().length>0,{message:`name must be a non-empty string`}),addedAt:D().regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/,{message:`addedAt must be an ISO date (YYYY-MM-DD or full ISO)`}).optional()}).strict()).max(50),E({riotStageId:D().optional()}).passthrough(),E({riotBlockName:D().optional()}).passthrough();var Yt=E({id:D(),type:D(),severity:D(),title:D(),jobType:D().nullable(),detectedAt:D().datetime(),context:Fe(u()).optional(),suggestedAction:D().optional()}),Xt=E({jobHistoryId:D(),type:D(),status:D(),startedAt:D().datetime(),finishedAt:D().datetime().nullable(),errorMessage:D().nullable(),errorClass:D().nullable()}),Zt=E({id:D(),name:D(),jobType:D(),intervalMinutes:L(),nextRunAt:D().datetime(),overdueMinutes:L(),lastRunAt:D().datetime().nullable()}),Qt=E({id:D(),entityType:D(),entityId:D(),field:D(),sourceA:D(),valueA:D(),sourceB:D(),valueB:D(),detectedAt:D().datetime()});E({capturedAt:D().datetime(),issues:E({open:P(Yt),totalOpen:L(),topPatterns:P(E({type:D(),subType:D().optional(),count:L(),suggestedAction:D()})),cursor:D().optional()}),jobs:E({failedLast24h:P(Xt),stuckSubSources:P(Zt),staleSnapshotTeams:P(E({teamId:D(),teamName:D(),slug:D(),lastMatchAt:D().datetime().nullable(),latestSnapshotAt:D().datetime().nullable(),hoursStale:L()})).optional(),recentDuplicateMatchPairs:E({count:L(),last90Days:L()}).optional()}),dataConflicts:E({unresolved:P(Qt),totalUnresolved:L()}),systemHealth:E({openIssueCount:L(),failedJobCount:L(),stuckSubSourceCount:L(),unresolvedConflictCount:L(),staleSnapshotTeamCount:L().optional(),recentDuplicateMatchPairCount:L().optional()})}),E({targetId:D(),targetType:R([`issue`,`conflict`,`subSource`]),action:R([`repair:cross-region-refusal-ignore`,`repair:data-gap-auto-close`,`mission:investigate`,`mission:custom`]),missionContext:D().optional()}),d([E({type:A(`job`),jobHistoryId:D(),status:D()}),E({type:A(`mission`),missionId:D(),missionPath:D()})]);var U={RIOT:`riot`,GCD:`gcd`,VLR:`vlr`,BO3:`bo3`},W={MATCH_SCHEDULED_AT:`match.scheduledAt`,MATCH_STATUS:`match.status`,MATCH_FORMAT:`match.format`,TEAM_NAME:`team.name`,TEAM_ABBREVIATION:`team.abbreviation`,TEAM_REGION:`team.region`,TEAM_LOGO_URL:`team.logoUrl`,PLAYER_REAL_NAME:`player.realName`,PLAYER_STATUS:`player.status`,PLAYER_ROLE:`player.role`,PLAYER_COUNTRY:`player.country`,PLAYER_CONTRACT_END_DATE:`player.contractEndDate`,PLAYER_RESIDENT_STATUS:`player.residentStatus`,PLAYER_IGN:`player.ign`,PLAYER_TEAM_ID:`player.teamId`,PLAYER_IS_COACH:`player.isCoach`};W.MATCH_SCHEDULED_AT,U.RIOT,U.VLR,U.BO3,W.MATCH_STATUS,U.RIOT,U.VLR,U.BO3,W.MATCH_FORMAT,U.VLR,U.RIOT,U.BO3,W.TEAM_NAME,U.RIOT,U.GCD,U.VLR,U.BO3,W.TEAM_ABBREVIATION,U.RIOT,U.GCD,U.VLR,U.BO3,W.TEAM_REGION,U.RIOT,U.GCD,U.VLR,U.BO3,W.TEAM_LOGO_URL,U.RIOT,U.GCD,U.VLR,U.BO3,W.PLAYER_REAL_NAME,U.GCD,U.VLR,U.BO3,W.PLAYER_STATUS,U.GCD,U.VLR,U.BO3,W.PLAYER_ROLE,U.GCD,U.VLR,U.BO3,W.PLAYER_COUNTRY,U.GCD,U.VLR,U.BO3,W.PLAYER_CONTRACT_END_DATE,U.GCD,W.PLAYER_RESIDENT_STATUS,U.GCD,W.PLAYER_IGN,U.VLR,U.GCD,U.BO3,W.PLAYER_TEAM_ID,U.GCD,U.VLR,U.BO3,W.PLAYER_IS_COACH,U.GCD,U.VLR,U.BO3;var G={RIOT:1,GCD:2,VLR:3};G.RIOT,G.RIOT,G.RIOT,G.RIOT,G.RIOT,G.RIOT,G.RIOT,G.VLR,G.VLR,G.VLR,G.RIOT,G.RIOT,G.RIOT,G.RIOT,G.GCD,G.GCD,G.GCD,G.GCD,G.GCD,G.GCD,G.VLR,G.VLR;var $t={OFFICIAL:1,COMMUNITY:2};$t.OFFICIAL,$t.OFFICIAL,$t.COMMUNITY,$t.COMMUNITY;var en=new Set([`t1`,`t2`,`gc`]);function tn(e){return e?en.has(e):!1}var nn=new Map([[`game-changers`,`gc`]]),rn=[[`t1`,`vct`],[`t2`,`vcl`],[`gc`,`gc`],[`t3`,`t3`]];new Map(rn);var an=new Map(rn.map(([e,t])=>[t,e]));function on(e){return e===`vct`||e===`vcl`||e===`gc`||e===`t3`}function sn(e){return e==null?null:on(e)?e:nn.get(e)??null}function cn(e){let t=sn(e);return t==null?null:an.get(t)??null}var ln={url:`https://www.twitch.tv/valorant`,platform:`Twitch`},un={url:`https://www.twitch.tv/valorant_americas`,platform:`Twitch`},dn={url:`https://www.twitch.tv/valorant_emea`,platform:`Twitch`},fn={url:`https://www.twitch.tv/valorant_pacific`,platform:`Twitch`},pn={url:`https://www.twitch.tv/VALORANT_CN`,platform:`Twitch`},K=[{url:`https://www.twitch.tv/tarik`,platform:`Twitch`},{url:`https://www.twitch.tv/kyedae`,platform:`Twitch`},{url:`https://www.twitch.tv/plaborant`,platform:`Twitch`}],mn={url:`https://www.youtube.com/@ValorantEsports/live`,platform:`YouTube`},hn={url:`https://www.youtube.com/@ValorantEsports_NA/live`,platform:`YouTube`},gn={url:`https://www.youtube.com/@ValorantEsports_EMEA/live`,platform:`YouTube`},_n={url:`https://www.youtube.com/@ValorantEsports_APAC/live`,platform:`YouTube`},vn={url:`https://www.youtube.com/@valorant_CN/live`,platform:`YouTube`},yn={url:`https://www.youtube.com/@ValorantEsports_SA/live`,platform:`YouTube`},bn={url:`https://www.youtube.com/@ValorantEsports_MENA/live`,platform:`YouTube`},xn=[{pattern:/VCT.*Americas/i,primary:hn,coStreams:[un,...K]},{pattern:/VCT.*EMEA/i,primary:gn,coStreams:[dn,...K]},{pattern:/VCT.*Pacific/i,primary:_n,coStreams:[fn,...K]},{pattern:/VCT.*China/i,primary:vn,coStreams:[pn]},{pattern:/Champions|Masters/i,primary:mn,coStreams:[ln,...K]},{pattern:/Esports World Cup.*EMEA|EWC.*EMEA/i,primary:gn,coStreams:[dn,...K]},{pattern:/Esports World Cup.*Americas|EWC.*Americas/i,primary:hn,coStreams:[un,...K]},{pattern:/Esports World Cup.*Pacific|EWC.*Pacific/i,primary:_n,coStreams:[fn,...K]},{pattern:/Esports World Cup.*China|EWC.*China/i,primary:vn,coStreams:[pn]},{pattern:/Esports World Cup|\bEWC\b/i,primary:mn,coStreams:[ln,...K]},{pattern:/Challengers.*MENA/i,primary:bn,coStreams:[]},{pattern:/Challengers.*NA|Challengers.*North America/i,primary:hn,coStreams:[un]},{pattern:/Challengers.*EMEA/i,primary:gn,coStreams:[dn]},{pattern:/Challengers.*SA|Challengers.*South Asia/i,primary:yn,coStreams:[]},{pattern:/Game Changers/i,primary:mn,coStreams:[ln]}];function Sn(e){for(let t of xn)if(t.pattern.test(e))return{primary:t.primary,coStreams:t.coStreams};return null}var Cn=[{slug:`valorant`,name:`Valorant`,letterMark:`V`,status:`live`,topLeague:`VCT`,accent:`var(--glk-brand)`},{slug:`cs2`,name:`Counter-Strike 2`,letterMark:`C`,status:`coming-soon`,topLeague:`BLAST · ESL Pro`},{slug:`lol`,name:`League of Legends`,letterMark:`L`,status:`coming-soon`,topLeague:`LCK · LEC · LCS`},{slug:`dota2`,name:`Dota 2`,letterMark:`D`,status:`coming-soon`,topLeague:`The International`}];function wn(e){if(e)return Cn.find(t=>t.slug===e)}var Tn=new Map,En=new Map;function Dn(e){let t=[...e].sort((e,t)=>(typeof e.startedAt==`string`?Date.parse(e.startedAt):e.startedAt.getTime())-(typeof t.startedAt==`string`?Date.parse(t.startedAt):t.startedAt.getTime()));return t.map((e,n)=>{let r=t[n+1],i=typeof e.startedAt==`string`?new Date(e.startedAt):e.startedAt,a=r?typeof r.startedAt==`string`?new Date(r.startedAt):r.startedAt:null;return{id:e.id,startedAt:i,endsAt:a}})}function On(e,t=`valorant`){Tn.set(t,Dn(e)),En.set(t,Date.now())}function kn(e){return Tn.get(e)??[]}function An(e=new Date,t=`valorant`){let n=e.getTime();for(let e of kn(t)){let t=e.startedAt.getTime(),r=e.endsAt?.getTime()??1/0;if(n>=t&&n<r)return e}return null}function jn(e,t=`valorant`){return kn(t).find(t=>t.id===e)??null}function Mn(e,t=`valorant`){let n=kn(t),r=n.findIndex(t=>t.id===e);return r<=0?null:n[r-1]??null}function Nn(e,t=new Date){let n=t.getTime()-e.startedAt.getTime(),r=Math.floor(n/(1440*60*1e3))+1;if(r<1)return 1;let i=Pn(e);return Math.min(r,i)}function Pn(e){if(e.endsAt){let t=e.endsAt.getTime()-e.startedAt.getTime();return Math.max(1,Math.round(t/(1440*60*1e3)))}return 14}function Fn(e=`valorant`){return[...kn(e)]}function In(e,t){throw Error(`assertNever: unexpected value ${JSON.stringify(e)}${t?` (${t})`:``}`)}var Ln=[`performance`,`match_result`,`roster`,`analysis`,`community`,`org_news`,`tournament`,`meta_change`,`coaching`,`praise`,`criticism`,`health`,`interview`,`general`];new Set(Ln);var Rn=[...Ln,`clutch`,`elimination`,`mvp`,`highlights`,`leadership`,`igl`,`teamwork`,`mentality`,`mechanical_skill`,`agent_pool`,`comeback`,`upset`,`dominance`,`controversy`,`ban`,`visa`,`injury`,`milestone`,`comparison`,`rivalry`,`fan_favorite`,`villain`,`underrated`,`overhyped`,`rising`,`declining`,`inconsistent`];new Set(Rn);var zn=new Map([[`individual_performance`,`performance`],[`poor_performance`,`performance`],[`underperformance`,`performance`],[`impressive_form`,`performance`],[`strong_start`,`performance`],[`form`,`performance`],[`skill`,`performance`],[`stats`,`performance`],[`player_skill`,`performance`],[`player_development`,`performance`],[`mechanical_skill_label`,`performance`],[`consistency`,`performance`],[`improvement`,`performance`],[`match_win`,`match_result`],[`match_loss`,`match_result`],[`win`,`match_result`],[`loss`,`match_result`],[`victory`,`match_result`],[`dominant_win`,`match_result`],[`upset_label`,`match_result`],[`comeback_label`,`match_result`],[`match_vod`,`match_result`],[`playoff_result`,`match_result`],[`roster_move`,`roster`],[`roster_change`,`roster`],[`roster_changes`,`roster`],[`roster_acquisition`,`roster`],[`roster_departure`,`roster`],[`roster_instability`,`roster`],[`roster_doubt`,`roster`],[`roster_return`,`roster`],[`roster_speculation`,`roster`],[`roster_management`,`roster`],[`roster_criticism`,`roster`],[`roster_signing`,`roster`],[`roster_issues`,`roster`],[`transfer`,`roster`],[`transfer_rumor`,`roster`],[`signing`,`roster`],[`new_signing`,`roster`],[`departure`,`roster`],[`benching`,`roster`],[`rebuild`,`roster`],[`return`,`roster`],[`comparison_label`,`analysis`],[`comparison`,`analysis`],[`predictions`,`analysis`],[`prediction`,`analysis`],[`tactics`,`analysis`],[`strategy`,`analysis`],[`playstyle`,`analysis`],[`all_time_ranking`,`analysis`],[`narrative`,`analysis`],[`speculation`,`analysis`],[`fall_off_debate`,`analysis`],[`goat_debate`,`analysis`],[`rivalry`,`analysis`],[`national_team`,`analysis`],[`momentum`,`analysis`],[`community_discussion`,`community`],[`community_appreciation`,`community`],[`community_praise`,`community`],[`community_reaction`,`community`],[`community_excitement`,`community`],[`fan_despair`,`community`],[`mockery`,`community`],[`hot_take`,`community`],[`player_culture`,`community`],[`sympathy`,`community`],[`org_culture`,`org_news`],[`org_management`,`org_news`],[`org_issues`,`org_news`],[`org`,`org_news`],[`misconduct`,`org_news`],[`management`,`org_news`],[`dysfunction`,`org_news`],[`nepotism`,`org_news`],[`sponsorship`,`org_news`],[`branding`,`org_news`],[`academy`,`org_news`],[`roster_changes_org`,`org_news`],[`ban`,`org_news`],[`tournament_news`,`tournament`],[`tournament_run`,`tournament`],[`playoffs`,`tournament`],[`qualifier`,`tournament`],[`grand_final`,`tournament`],[`playoff_qualification`,`tournament`],[`regional_standings`,`tournament`],[`standings`,`tournament`],[`elimination_label`,`tournament`],[`elimination`,`tournament`],[`redemption`,`tournament`],[`lower_bracket`,`tournament`],[`upper_bracket`,`tournament`],[`survival`,`tournament`],[`championship`,`tournament`],[`stage1`,`tournament`],[`stage_1`,`tournament`],[`stage2`,`tournament`],[`stage_2`,`tournament`],[`meta`,`meta_change`],[`balance`,`meta_change`],[`patch`,`meta_change`],[`agent_pool_label`,`meta_change`],[`duelist`,`meta_change`],[`controller`,`meta_change`],[`sentinel`,`meta_change`],[`initiator`,`meta_change`],[`coaching_change`,`coaching`],[`leadership_label`,`coaching`],[`leadership`,`coaching`],[`igl_label`,`coaching`],[`igl`,`coaching`],[`mentor`,`coaching`],[`teamplay`,`coaching`],[`team_chemistry`,`coaching`],[`teamwork_label`,`coaching`],[`role`,`coaching`],[`support`,`coaching`],[`mvp_label`,`praise`],[`mvp`,`praise`],[`achievement`,`praise`],[`milestone_label`,`praise`],[`milestone`,`praise`],[`legacy`,`praise`],[`highlights_label`,`praise`],[`highlights`,`praise`],[`clutch_label`,`praise`],[`clutch`,`praise`],[`dominance_label`,`praise`],[`dominance`,`praise`],[`resilience`,`praise`],[`recognition`,`praise`],[`world_class`,`praise`],[`comeback`,`praise`],[`controversy_label`,`criticism`],[`controversy`,`criticism`],[`humiliation`,`criticism`],[`blunder`,`criticism`],[`drama`,`criticism`],[`roster_drama`,`criticism`],[`frustration`,`criticism`],[`injury_label`,`health`],[`injury`,`health`],[`visa_label`,`health`],[`visa`,`health`],[`availability`,`health`],[`player_welfare`,`health`],[`burnout`,`health`],[`player_interview`,`interview`],[`press`,`interview`],[`presser`,`interview`],[`news`,`general`],[`update`,`general`],[`miscellaneous`,`general`]]);new Map([...Array.from(zn.entries()).map(([e,t])=>[e,t]),[`clutch_play`,`clutch`],[`clutch_moment`,`clutch`],[`elimination`,`elimination`],[`mvp_performance`,`mvp`],[`highlight_reel`,`highlights`],[`highlight`,`highlights`],[`leader`,`leadership`],[`captain`,`leadership`],[`in_game_leader`,`igl`],[`team_chemistry_theme`,`teamwork`],[`teamplay_theme`,`teamwork`],[`confidence`,`mentality`],[`mental_state`,`mentality`],[`aim`,`mechanical_skill`],[`mechanics`,`mechanical_skill`],[`agent_picks`,`agent_pool`],[`agent_choice`,`agent_pool`],[`reverse_sweep`,`comeback`],[`upset_win`,`upset`],[`dominant`,`dominance`],[`dominance_theme`,`dominance`],[`controversy_theme`,`controversy`],[`scandal`,`controversy`],[`banned`,`ban`],[`suspension`,`ban`],[`visa_issues`,`visa`],[`health_issue`,`injury`],[`wrist_injury`,`injury`],[`milestone_theme`,`milestone`],[`record`,`milestone`],[`comparison_theme`,`comparison`],[`versus`,`comparison`],[`fan_favorite_theme`,`fan_favorite`],[`crowd_favorite`,`fan_favorite`],[`beloved`,`fan_favorite`],[`villain_theme`,`villain`],[`heel`,`villain`],[`underrated_theme`,`underrated`],[`sleeper`,`underrated`],[`overhyped_theme`,`overhyped`],[`overrated`,`overhyped`],[`rising_star`,`rising`],[`breakout`,`rising`],[`declining_form`,`declining`],[`fall_off`,`declining`],[`inconsistent_form`,`inconsistent`],[`streaky`,`inconsistent`],[`rivalry_theme`,`rivalry`]]);var Bn=[`TEAM_MOMENTUM`,`SENTIMENT_SWING`,`UPSET`,`ROSTER_CHANGE`,`TOURNAMENT_MILESTONE`,`REGION_SHIFT`,`PLAYER_BREAKOUT`,`HEAD_TO_HEAD`,`EVENT_PREVIEW`,`COMEBACK`,`FREE_AGENCY`,`BRACKET_FINALIZED`,`QUALIFICATION_CLINCH`,`VIRAL_TAKE`,`FAN_OUTCRY`,`HYPE_WAVE`,`DIVIDED_COMMUNITY`,`FORUM_DEBATE`,`MEME_MOMENT`],Vn=[`VIRAL_TAKE`,`FAN_OUTCRY`,`HYPE_WAVE`,`DIVIDED_COMMUNITY`,`FORUM_DEBATE`,`MEME_MOMENT`];E({teamId:D(),ratingStart:L(),ratingEnd:L(),ratingDelta:L(),windowDays:A(7),ratingSnapshotIds:P(D()),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D(),avgCurrent:L(),avgPrior:L(),delta:L(),currentVolume:L(),priorVolume:L(),sentimentHeadlineId:D().optional(),windowDays:A(7),leagueSlug:D().optional(),tier:D().optional()}),E({matchId:D(),winnerTeamId:D(),loserTeamId:D(),winnerRating:L(),loserRating:L(),ratingGap:L(),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D(),rosterEntryIds:P(D()),changeCount:L().int(),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D(),matchId:D(),tournamentId:D(),tournamentName:D().optional(),stageName:D(),result:R([`win`,`loss`]),isFinal:N(),leagueSlug:D().optional(),tier:D().optional()}),E({heroTeamId:D(),leagueSlug:D(),currentStrength:L(),priorStrength:L(),pctChange:L(),windowDays:A(7),tier:D().optional()});var Hn=E({playerId:D(),playerIgn:D(),shortAcsAvg:L(),longAcsAvg:L(),acsRatio:L(),shortKdAvg:L(),longKdAvg:L(),kdRatio:L(),breakoutRatio:L(),magnitude:L()});E({teamId:D(),playerId:D(),playerIgn:D(),shortAcsAvg:L(),longAcsAvg:L(),acsRatio:L(),shortKdAvg:L(),longKdAvg:L(),kdRatio:L(),breakoutRatio:L(),shortDays:A(14),longDays:A(90),leagueSlug:D().optional(),tier:D().optional(),contributingPlayers:P(Hn).optional()}),E({team1Id:D(),team2Id:D(),rivalTeamName:D().optional(),upcomingMatchId:D(),historicalMeetings:L().int(),windowDays:L().int(),leagueSlug:D().optional(),tier:D().optional()}),E({team1Id:D(),team2Id:D(),rivalTeamName:D().optional(),upcomingMatchId:D(),tournamentId:D(),tournamentName:D().optional(),scheduledAt:D(),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D(),ratingSnapshotIds:P(D()),priorDrop:L(),recovery:L(),comebackLowRating:L(),windowDays:A(14),leagueSlug:D().optional(),tier:D().optional()}),E({playerId:D(),playerIgn:D(),teamId:D(),formerTeamName:D().optional(),rosterEntryId:D(),leftAt:D(),source:R([`roster_left`,`status_free_agent`]),leagueSlug:D().optional(),tier:D().optional()}),E({tournamentId:D(),tournamentName:D().optional(),stageId:D(),stageName:D(),stageType:D(),seededTeamCount:L().int(),matchCount:L().int(),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D(),matchId:D(),tournamentId:D(),tournamentName:D().optional(),stageName:D(),clinchedSlot:D().optional(),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D().optional(),playerId:D().optional(),contentItemId:D(),contentType:R([`social_post`,`forum_thread`,`video`,`tweet`,`reddit_post`]),engagementScore:L(),baseline:L(),ratio:L(),windowHours:A(72),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D().optional(),playerId:D().optional(),avgSentiment:L(),totalComments:L().int(),snapshotCount:L().int(),contentItemIds:P(D()),windowHours:A(48),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D().optional(),playerId:D().optional(),avgSentiment:L(),totalComments:L().int(),priorVolumeScaled:L(),volumeRatio:L(),contentItemIds:P(D()),windowHours:A(48),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D().optional(),playerId:D().optional(),negShare:L(),middleShare:L(),posShare:L(),bimodality:L(),totalComments:L().int(),snapshotCount:L().int(),contentItemIds:P(D()),windowHours:A(48),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D().optional(),playerId:D().optional(),threadContentItemId:D(),distinctDays:L().int(),totalComments:L().int(),velocity:L(),windowDays:L().int(),leagueSlug:D().optional(),tier:D().optional()}),E({teamId:D().optional(),playerId:D().optional(),velocity:L(),totalComments:L().int(),latestAt:D(),contentItemIds:P(D()),windowHours:A(6),leagueSlug:D().optional(),tier:D().optional()});var Un=new Set([`americas`,`emea`,`pacific`,`cn`,`global`]);new Set([`United States`,`Canada`,`Brazil`,`Argentina`,`Chile`,`Colombia`,`Mexico`,`Venezuela`,`Costa Rica`,`Peru`,`Uruguay`,`Ecuador`,`Bolivia`,`Paraguay`,`Dominican Republic`]),new Set([`South Korea`,`Japan`,`Thailand`,`Philippines`,`Indonesia`,`Vietnam`,`Singapore`,`Malaysia`,`Taiwan`,`India`,`Australia`,`New Zealand`,`Cambodia`,`Myanmar`,`Bangladesh`,`Pakistan`,`Mongolia`,`Hong Kong`,`Nepal`,`Sri Lanka`,`Laos`]);function Wn(e){let t=e.toLowerCase();return t?t.includes(`americas`)?`americas`:t.includes(`china`)?`cn`:t.includes(`pacific`)||t.includes(`east_asia`)||t.includes(`east asia`)||t.includes(`_sea`)||t.includes(`oceania`)||t.includes(`south_asia`)||t.includes(`_kr`)||t.includes(`korea`)||t.includes(`_jpn`)||t.includes(`japan`)?`pacific`:t.includes(`emea`)?`emea`:null:null}function Gn(e){let t=e.region?.trim().toLowerCase(),n=t&&Un.has(t)?t:null,r=Wn(e.slug??``);return r&&n&&r!==n&&n!==`global`?r:n||r||null}var Kn={vct:{},vcl:{americas:[`challengers_br`,`challengers_latam_n`,`challengers_latam_s`,`challengers_na`],emea:[`challengers_emea`,`challengers_italy`,`challengers_portugal`,`mena_resilence`,`vrl_cis`,`vrl_dach`,`vrl_east`,`vrl_france`,`vrl_north_east`,`vrl_spain`,`vrl_turkey`],pacific:[`challengers_jpn`,`challengers_kr`,`challengers_sea`,`challengers_sea_hk_and_tw`,`challengers_sea_id`,`challengers_sea_ph`,`challengers_sea_sg_and_my`,`challengers_sea_th`,`challengers_sea_vn`,`challengers_south_asia`,`valorant_oceania_tour`]},gc:{americas:[`game_changers_latam`,`game_changers_na`,`game_changers_series_brazil`],emea:[`game_changers_emea`],pacific:[`game_changers_east_asia`,`game_changers_jpn`,`game_changers_kr`,`game_changers_oceania`,`game_changers_pacific`,`game_changers_sa`,`game_changers_sea`]},t3:{}},qn=R([`development`,`test`,`production`]).default(`development`),Jn=qn.parse(`production`)===`production`;function q(e){return D().optional().refine(e=>!Jn||e!==void 0&&e.length>0,{message:`${e} is required in production`})}var Yn=d([D(),L()]).transform(e=>typeof e==`string`?Number.parseInt(e,10):e).refine(e=>Number.isInteger(e)&&e>=0&&e<=65535,{message:`must be an integer port in [0, 65535]`}),Xn=D().transform(e=>e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)),Zn=D().regex(/^\d{4}-\d{2}-\d{2}$/,`must be ISO date YYYY-MM-DD`).refine(e=>!Number.isNaN(new Date(`${e}T00:00:00Z`).getTime()),{message:`must be a valid ISO date`});E({NODE_ENV:qn,DATABASE_URL:D({required_error:`DATABASE_URL is required`}).refine(e=>e.startsWith(`postgres://`)||e.startsWith(`postgresql://`),{message:`DATABASE_URL must be a postgres:// or postgresql:// URL`}),API_PORT:Yn.default(3001),ALLOWED_ORIGINS:Xn.default(`http://localhost:3000`),ANALYTICS_SALT_SECRET:D().optional().default(``).refine(e=>!Jn||e!==void 0&&e.length>=32,{message:`ANALYTICS_SALT_SECRET must be set to a random string >=32 chars in production`}),ADMIN_API_KEY:q(`ADMIN_API_KEY`),DISCORD_ALERT_WEBHOOK_URL:c(e=>e===``?void 0:e,D().url(`DISCORD_ALERT_WEBHOOK_URL must be a valid URL`).optional()),GLICKO_SEASON_START:Zn.default(`2026-01-01`),APPDATA_DIR:D().min(1).default(`/app/data`),STORY_RATING_FLOOR:O.number().finite().optional(),STORY_SENTIMENT_FLOOR:O.number().finite().optional(),STORY_MIN_VOLUME:O.number().finite().optional(),STORY_VCT_QUOTA_PERCENT:O.number().finite().optional(),STORY_INFLIGHT_DEDUP_MINUTES:O.number().finite().optional(),STORY_MAX_STORIES_PER_RUN:O.number().finite().optional()}).extend({REDDIT_CLIENT_ID:q(`REDDIT_CLIENT_ID`),REDDIT_CLIENT_SECRET:q(`REDDIT_CLIENT_SECRET`),REDDIT_USERNAME:q(`REDDIT_USERNAME`),REDDIT_PASSWORD:q(`REDDIT_PASSWORD`),YOUTUBE_API_KEY:q(`YOUTUBE_API_KEY`)});var Qn=.5,$n=Vn,er=[`ROSTER_CHANGE`,`FREE_AGENCY`];function tr(e,t){return e.archetypeBoost[t[0]]??0}function nr(e,t,n){let r=e.archetypeBoost;for(let e of t)r[e]=n}function J(e){return e.tuningSignals||={sustainHotThreshold:.5,developingWindowHours:3,proseCopiedProportionMax:.5,proseLongRunTokens:15},e.tuningSignals}var rr=[{systemKey:`news.weight.w1`,label:`Fresh weight (w1)`,help:`Weight on FreshScore in StoryScore. Higher = a fresh spike beats a sustained story.`,min:0,max:1,step:.05,get:e=>e.w1,set:(e,t)=>{e.w1=t}},{systemKey:`news.weight.w2`,label:`Sustain weight (w2)`,help:`Weight on SustainScore in StoryScore. Higher = the newspaper holds the day's big story.`,min:0,max:1,step:.05,get:e=>e.w2,set:(e,t)=>{e.w2=t}},{systemKey:`news.weight.g`,label:`Gravity (G)`,help:`FreshScore decay exponent. Higher = older stories sink faster.`,min:.5,max:3,step:.1,get:e=>e.g,set:(e,t)=>{e.g=t}},{systemKey:`news.weight.preview_cap`,label:`Max event previews / edition`,help:`Cap on EVENT_PREVIEW briefs per edition (the highest-scoring survive). Lower to tame the quiet-day preview flood.`,min:0,max:10,step:1,get:e=>e.previewCap,set:(e,t)=>{e.previewCap=t}},{systemKey:`news.weight.boost_community`,label:`Community boost`,help:`Additive StoryScore boost applied to every community archetype (viral takes, outcry, hype, debate, memes). Raise on quiet days to surface fan stories.`,min:0,max:.2,step:.01,get:e=>tr(e,$n),set:(e,t)=>{nr(e,$n,t)}},{systemKey:`news.weight.boost_roster`,label:`Roster boost`,help:`Additive StoryScore boost applied to roster archetypes (roster changes + free agency). Raise to surface roster-move stories.`,min:0,max:.2,step:.01,get:e=>tr(e,er),set:(e,t)=>{nr(e,er,t)}},{systemKey:`news.weight.sustain_hot_threshold`,label:`Heat: all-day threshold`,help:`sustainScore at/above which a brief shows the "All day" heat badge.`,min:0,max:1,step:.05,get:e=>J(e).sustainHotThreshold,set:(e,t)=>{J(e).sustainHotThreshold=t}},{systemKey:`news.weight.developing_window_hours`,label:`Heat: developing window (h)`,help:`A brief first seen within this many hours shows the "Developing" badge.`,min:0,max:12,step:.5,get:e=>J(e).developingWindowHours,set:(e,t)=>{J(e).developingWindowHours=t}},{systemKey:`news.weight.prose_copied_proportion_max`,label:`Prose gate: copied proportion max`,help:`Hold a brief when more than this fraction of its summary is verbatim-copied from a source.`,min:.1,max:1,step:.05,get:e=>J(e).proseCopiedProportionMax,set:(e,t)=>{J(e).proseCopiedProportionMax=t}},{systemKey:`news.weight.prose_long_run_tokens`,label:`Prose gate: long-run tokens`,help:`Hold a brief when a single verbatim run reaches this many tokens (a sentence lifted whole).`,min:5,max:40,step:1,get:e=>J(e).proseLongRunTokens,set:(e,t)=>{J(e).proseLongRunTokens=t}},...[`ABOVE_FOLD`,`WIRE`,`COMMUNITY_PULSE`,`WATCH`,`RESULTS`].map(e=>({systemKey:`news.weight.floor_${e.toLowerCase()}`,label:`${e} score floor`,help:`Minimum StoryScore for a brief to enter the ${e} band (below = dropped, not padded).`,min:0,max:1,step:.01,get:t=>t.sectionScoreFloors[e],set:(t,n)=>{t.sectionScoreFloors[e]=n}}))];rr.map(e=>e.systemKey),new Map(rr.map(e=>[e.systemKey,e]));var ir=[`vct`,`vcl`,`gc`,`game-changers`];function ar(e){return e?ir.includes(e):!1}var or={vct:0,vcl:1,gc:2,"game-changers":2,t3:3,"S-tier":0,"A-tier":1,"B-tier":2,"C-tier":3};function sr(e){return e?or[e]??999:999}function cr(e,t){let n=sr(e.tournament?.tier)-sr(t.tournament?.tier);return n===0?(new Date(e.scheduledAt||e.playedAt||``).getTime()||0)-(new Date(t.scheduledAt||t.playedAt||``).getTime()||0):n}function lr(e,t){let n=sr(e.tournament?.tier)-sr(t.tournament?.tier);if(n!==0)return n;let r=new Date(e.playedAt||e.scheduledAt||``).getTime()||0;return(new Date(t.playedAt||t.scheduledAt||``).getTime()||0)-r}function ur(e){switch(e){case`t1`:return`bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400`;case`t2`:return`bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400`;case`gc`:return`bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400`;case`t3`:return`bg-teal-100 text-teal-700 dark:bg-teal-900/30 dark:text-teal-400`;default:return`bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400`}}function dr(e){switch(e){case`t1`:return`VCT`;case`t2`:return`CHAL`;case`gc`:return`GC`;case`t3`:return`OPEN`;default:return e}}function fr(e){switch(e){case`vct`:case`t1`:case`S-tier`:return`bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400`;case`vcl`:case`t2`:case`A-tier`:return`bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400`;case`game-changers`:case`gc`:case`B-tier`:return`bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400`;case`t3`:case`C-tier`:return`bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-400`;default:return`bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-500`}}function pr(e){if(!e)return null;switch(e){case`vct`:case`t1`:return`VCT`;case`vcl`:case`t2`:return`CHAL`;case`game-changers`:case`gc`:return`GC`;case`t3`:return`OPEN`;default:return e.endsWith(`-tier`)?e.replace(`-tier`,``).toUpperCase():null}}function mr(e){switch(e){case`vct`:case`t1`:case`international`:return`VCT International`;case`vcl`:case`t2`:case`challengers`:return`Challengers`;case`gc`:case`game-changers`:return`Game Changers`;case`t3`:return`Open / Community`;default:return e??`Unknown`}}function hr(e){return cn(e)}function gr(e){if(!e)return null;switch(e){case`americas`:return`Americas`;case`emea`:return`EMEA`;case`pacific`:return`Pacific`;case`cn`:return`CN`;case`global`:return`Global`;default:return null}}var _r={vct:[`vct`],vcl:[`vcl`],gc:[`gc`,`game-changers`],t3:[`t3`]};function vr(e,t){if(t.tier===null)return!0;let n=_r[t.tier];return n?e?n.includes(e):t.tier===`t3`:!0}var yr={americas:`americas`,emea:`emea`,pacific:`pacific`,china:`cn`,cn:`cn`};function br(e){return e?yr[e.trim().toLowerCase()]??null:null}function xr(e,t){return t===null?!0:br(e)===t}var Sr=[`w-full`,`w-11/12`,`w-5/6`,`w-full`,`w-10/12`,`w-11/12`,`w-4/5`,`w-full`,`w-9/12`,`w-11/12`];function Y({className:e}){return(0,B.jsx)(`div`,{className:H(`relative overflow-hidden rounded-lg bg-zinc-100 dark:bg-zinc-900/80`,`before:absolute before:inset-0 before:-translate-x-full`,`before:animate-[shimmer-slide_1.6s_infinite]`,`before:bg-gradient-to-r before:from-transparent before:via-white/20 before:to-transparent`,`dark:before:via-white/5`,e)})}function Cr({kind:e}){return e===`grid`?(0,B.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4`,role:`status`,"aria-busy":`true`,"aria-label":`Loading content`,children:Array.from({length:6}).map((e,t)=>(0,B.jsxs)(`div`,{className:`glk-card !p-0 overflow-hidden`,children:[(0,B.jsx)(`div`,{className:`h-1 w-full bg-gradient-to-r from-[var(--glk-brand)]/60 via-[var(--glk-brand)]/20 to-transparent`}),(0,B.jsxs)(`div`,{className:`p-4 space-y-3`,children:[(0,B.jsx)(Y,{className:`h-3 w-1/3`}),(0,B.jsx)(Y,{className:`h-7 w-2/3`}),(0,B.jsx)(Y,{className:`h-3 w-full`}),(0,B.jsx)(Y,{className:`h-3 w-5/6`})]})]},t))}):e===`rankings`?(0,B.jsxs)(`div`,{role:`status`,"aria-busy":`true`,"aria-label":`Loading rankings`,className:`mx-auto w-full max-w-5xl px-3 sm:px-4 md:px-5 lg:px-6 xl:px-8`,children:[(0,B.jsx)(`div`,{className:`mt-3 flex justify-end px-2 sm:px-3`,children:(0,B.jsx)(Y,{className:`h-3 w-20`})}),(0,B.jsxs)(`div`,{className:`mt-1 glk-card !p-0 overflow-hidden`,children:[(0,B.jsx)(`div`,{className:`h-1 w-full bg-gradient-to-r from-[var(--glk-brand)]/60 via-[var(--glk-brand)]/20 to-transparent`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 sm:gap-3 border-b border-zinc-200/80 px-2 sm:px-3 py-1.5 dark:border-zinc-800`,children:[(0,B.jsx)(Y,{className:`h-3 w-7 sm:w-8`}),(0,B.jsx)(`span`,{className:`hidden sm:block w-9 flex-shrink-0`,"aria-hidden":`true`}),(0,B.jsx)(Y,{className:`h-3 w-16 flex-1 max-w-[80px]`}),(0,B.jsx)(Y,{className:`hidden sm:block h-3 w-10`}),(0,B.jsx)(Y,{className:`h-3 w-20`})]}),(0,B.jsx)(`div`,{className:`divide-y divide-zinc-100 dark:divide-zinc-800/50`,children:Array.from({length:10}).map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-2 sm:gap-3 px-2 sm:px-3 py-2`,children:[(0,B.jsx)(Y,{className:`h-6 w-7 sm:w-8 flex-shrink-0 rounded-md`}),(0,B.jsx)(Y,{className:`hidden sm:block h-9 w-9 flex-shrink-0`}),(0,B.jsx)(Y,{className:`h-4 flex-1 max-w-[180px]`}),(0,B.jsx)(Y,{className:`h-6 w-16 flex-shrink-0`})]},t))})]})]}):e===`table`?(0,B.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-color)] overflow-hidden`,role:`status`,"aria-busy":`true`,"aria-label":`Loading rows`,children:[(0,B.jsx)(`div`,{className:`h-1 w-full bg-gradient-to-r from-[var(--glk-brand)]/60 via-[var(--glk-brand)]/20 to-transparent`}),(0,B.jsx)(`div`,{className:`p-4 space-y-2`,children:Sr.map((e,t)=>(0,B.jsx)(Y,{className:H(`h-10`,e)},t))})]}):(0,B.jsxs)(`div`,{className:`space-y-4`,role:`status`,"aria-busy":`true`,"aria-label":`Loading detail`,children:[(0,B.jsxs)(`div`,{className:`glk-card !p-0 overflow-hidden`,children:[(0,B.jsx)(`div`,{className:`h-1 w-full bg-gradient-to-r from-[var(--glk-brand)]/60 via-[var(--glk-brand)]/20 to-transparent`}),(0,B.jsxs)(`div`,{className:`p-5 space-y-3`,children:[(0,B.jsx)(Y,{className:`h-3 w-24`}),(0,B.jsx)(Y,{className:`h-9 w-1/2`}),(0,B.jsx)(Y,{className:`h-3 w-3/4`})]})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,B.jsx)(Y,{className:`h-64`}),(0,B.jsx)(Y,{className:`h-64`})]})]})}function wr({tone:e,icon:t,eyebrow:n,headline:r,body:i,children:a}){let o=e===`error`?`var(--glk-brand)`:`var(--color-primary, #6366f1)`;return(0,B.jsxs)(`div`,{role:e===`error`?`alert`:`status`,className:H(`relative overflow-hidden rounded-xl border border-[var(--border-color)]`,`min-h-[320px] flex items-center justify-center px-6 py-16`),style:{backgroundImage:`radial-gradient(circle at 50% 0%, color-mix(in srgb, ${o} 14%, transparent), transparent 60%)`},children:[(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 opacity-[0.04] dark:opacity-[0.06]`,style:{backgroundImage:`linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px)`,backgroundSize:`32px 32px`,color:`var(--text-muted)`}}),(0,B.jsxs)(`div`,{className:`relative z-10 mx-auto flex max-w-md flex-col items-center text-center`,children:[(0,B.jsx)(`div`,{className:H(`mb-5 inline-flex h-12 w-12 items-center justify-center rounded-full border`,e===`error`?`border-red-500/20 bg-red-500/10 text-red-500`:`border-[var(--border-color)] bg-[var(--bg-card)] text-zinc-500 dark:text-zinc-400`),children:t}),(0,B.jsx)(`span`,{className:`glk-eyebrow mb-2`,children:n}),(0,B.jsx)(`h2`,{className:`glk-h3 text-zinc-900 dark:text-zinc-100`,children:r}),i&&(0,B.jsx)(`p`,{className:`mt-2 text-sm text-zinc-500 dark:text-zinc-400 max-w-sm leading-relaxed`,children:i}),a&&(0,B.jsx)(`div`,{className:`mt-5 flex flex-wrap items-center justify-center gap-2`,children:a})]})]})}function Tr({message:e,headline:t,icon:n,action:r}){return(0,B.jsx)(wr,{tone:`empty`,eyebrow:`No data`,icon:n??(0,B.jsx)(ge,{size:22,strokeWidth:1.75}),headline:t??`Nothing here yet`,body:e,children:r&&(0,B.jsx)(`button`,{type:`button`,onClick:r.onClick,className:`inline-flex items-center rounded-md bg-[var(--glk-brand)] px-3.5 py-1.5 text-xs font-semibold uppercase tracking-wide text-white transition-opacity hover:opacity-90`,children:r.label})})}var Er=`https://github.com/aburt1/Glicko/issues/new`;function Dr(e){let t=`UI error: ${e.message.slice(0,80)}`,n=[`## What happened`,``,`<!-- Briefly describe what you were doing when the error appeared. -->`,``,`## Error`,``,"```",(e.stack??e.message).slice(0,1500),"```",``,`## Page`,``,typeof window<`u`?window.location.href:`(unknown)`].join(`
`);return`${Er}?${new URLSearchParams({title:t,body:n,labels:`bug,ui`}).toString()}`}function Or({error:e,retry:t}){return(0,B.jsxs)(wr,{tone:`error`,eyebrow:`Error`,icon:(0,B.jsx)(_,{size:22,strokeWidth:1.75}),headline:`Something broke loading this page`,body:e.message,children:[t&&(0,B.jsxs)(`button`,{type:`button`,onClick:t,className:`inline-flex items-center gap-1.5 rounded-md bg-[var(--glk-brand)] px-3.5 py-1.5 text-xs font-semibold uppercase tracking-wide text-white transition-opacity hover:opacity-90`,children:[(0,B.jsx)(ae,{size:12}),`Try again`]}),(0,B.jsx)(`a`,{href:Dr(e),target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center rounded-md border border-[var(--border-color)] px-3.5 py-1.5 text-xs font-medium text-zinc-600 dark:text-zinc-300 hover:bg-[var(--bg-card)] transition-colors`,children:`Report issue`})]})}var kr=[{id:`all`,label:`All`},{id:`teams`,label:`Teams`},{id:`players`,label:`Players`},{id:`tournaments`,label:`Tournaments`},{id:`matches`,label:`Matches`}],Ar={Teams:he,Players:oe,Tournaments:Oe,Matches:be},jr=`glicko.search.recent`,Mr=10,Nr=150,X=8;function Pr(){if(typeof window>`u`)return[];try{let e=window.localStorage.getItem(jr);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>e&&typeof e.query==`string`&&typeof e.at==`number`):[]}catch{return[]}}function Fr(e){if(!(typeof window>`u`))try{window.localStorage.setItem(jr,JSON.stringify(e.slice(0,Mr)))}catch{}}function Ir(e){let t=e.trim();if(!t)return Pr();let n=Pr().filter(e=>e.query.toLowerCase()!==t.toLowerCase()),r=[{query:t,at:Date.now()},...n].slice(0,Mr);return Fr(r),r}function Lr(){if(!(typeof window>`u`))try{window.localStorage.removeItem(jr)}catch{}}function Rr({text:e,query:t}){let n=t.trim();if(!n)return(0,B.jsx)(B.Fragment,{children:e});let r=e.toLowerCase(),i=n.toLowerCase(),a=[],o=0;for(;o<e.length;){let t=r.indexOf(i,o);if(t===-1){a.push({chunk:e.slice(o),match:!1});break}t>o&&a.push({chunk:e.slice(o,t),match:!1}),a.push({chunk:e.slice(t,t+n.length),match:!0}),o=t+n.length}return(0,B.jsx)(B.Fragment,{children:a.map((e,t)=>e.match?(0,B.jsx)(`mark`,{className:`rounded bg-[var(--glk-brand)]/20 px-0.5 text-[var(--glk-brand)] dark:bg-[var(--glk-brand)]/30`,children:e.chunk},t):(0,B.jsx)(`span`,{children:e.chunk},t))})}function zr({open:e,onClose:t}){let n=M().pathname.split(`/`)[1]||void 0,r=le(),i=(0,z.useRef)(null),a=(0,z.useRef)(null),o=(0,z.useRef)(null),s=(0,z.useRef)(!1);e&&!s.current&&(o.current=document.activeElement instanceof HTMLElement?document.activeElement:null),s.current=e,jt(a,{active:e,restoreFocusRef:o});let[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(null),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(null),[_,v]=(0,z.useState)(`all`),[y,b]=(0,z.useState)([]);(0,z.useEffect)(()=>{e&&b(Pr())},[e]),(0,z.useEffect)(()=>{let e=c.trim();if(!e||!n){d(null),p(!1),h(null);return}let t=!1;p(!0),h(null);let r=setTimeout(async()=>{try{let r=await He(n,e,{category:`all`,limit:X});if(t)return;d(r)}catch(e){if(t)return;d(null),h(e instanceof Error?e:Error(`Search failed`))}finally{t||p(!1)}},Nr);return()=>{t=!0,clearTimeout(r)}},[c,n]);let x=(0,z.useMemo)(()=>{if(!u||!n)return[];let e=[],t=e=>_===`all`||_===e;if(t(`teams`))for(let t of u.teams)e.push({kind:`team`,category:`Teams`,label:t.name,sublabel:t.abbreviation??t.region??void 0,tier:t.currentTier,path:`/${n}/teams/${t.slug}`});if(t(`players`))for(let t of u.players)e.push({kind:`player`,category:`Players`,label:t.ign,sublabel:t.team?.name??t.role??void 0,path:`/${n}/players/${t.slug}`});if(t(`tournaments`))for(let t of u.tournaments)e.push({kind:`tournament`,category:`Tournaments`,label:t.name,sublabel:t.region??void 0,tier:t.tier,path:`/${n}/tournaments/${t.slug}`});if(t(`matches`))for(let t of u.matches)e.push({kind:`match`,category:`Matches`,label:`${t.team1?.name??`TBD`} vs ${t.team2?.name??`TBD`}`,sublabel:t.tournament?.name??void 0,path:`/${n}/matches/${t.id}`});return e},[u,n,_]),S=(0,z.useCallback)(e=>{b(Ir(c)),r(e.path),t()},[r,t,c]),[C,w]=(0,z.useState)(0);(0,z.useEffect)(()=>{w(0)},[`${c}|${_}`]),(0,z.useEffect)(()=>{if(x.length===0){w(0);return}w(e=>Math.min(e,x.length-1))},[x.length]);let ee=(0,z.useCallback)(e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),t();return}if(x.length!==0){if(e.key===`ArrowDown`)e.preventDefault(),w(e=>Math.min(e+1,x.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),w(e=>Math.max(e-1,0));else if(e.key===`Home`)e.preventDefault(),w(0);else if(e.key===`End`)e.preventDefault(),w(x.length-1);else if(e.key===`Enter`){e.preventDefault();let t=x[C];t&&S(t)}}},[C,x,S,t]);if((0,z.useEffect)(()=>{if(e){l(``),d(null),v(`all`),h(null),i.current?.focus();let e=requestAnimationFrame(()=>i.current?.focus());return()=>cancelAnimationFrame(e)}},[e]),(0,z.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),(0,z.useEffect)(()=>{if(!e||typeof document>`u`)return;let t=document.body,n=window.scrollY,r={position:t.style.position,top:t.style.top,left:t.style.left,right:t.style.right,width:t.style.width,overflow:t.style.overflow};return t.style.position=`fixed`,t.style.top=`-${n}px`,t.style.left=`0`,t.style.right=`0`,t.style.width=`100%`,t.style.overflow=`hidden`,()=>{t.style.position=r.position,t.style.top=r.top,t.style.left=r.left,t.style.right=r.right,t.style.width=r.width,t.style.overflow=r.overflow,typeof window.scrollTo==`function`&&window.scrollTo({top:n,left:0,behavior:`instant`})}},[e]),!e)return null;let T=u?.counts;return(0,B.jsxs)(`div`,{className:`overlay-enter fixed inset-0 z-[100] flex items-start justify-center pt-[15vh] px-4`,onClick:t,children:[(0,B.jsx)(`div`,{className:`absolute inset-0 bg-black/50 backdrop-blur-sm`}),(0,B.jsxs)(`div`,{ref:a,role:`dialog`,"aria-modal":`true`,"aria-label":`Search`,className:`dialog-enter relative w-full sm:max-w-lg overflow-hidden rounded-xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-700 dark:bg-zinc-900`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-zinc-200 px-5 py-4 dark:border-zinc-700`,children:[(0,B.jsx)(ue,{size:20,className:`shrink-0 text-zinc-400`}),(0,B.jsx)(`input`,{ref:i,autoFocus:!0,type:`text`,value:c,onChange:e=>l(e.target.value),onKeyDown:ee,placeholder:`Search teams, players, matches, tournaments...`,className:`flex-1 bg-transparent text-sm sm:text-base text-zinc-900 outline-none placeholder:text-zinc-400 dark:text-zinc-100 dark:placeholder:text-zinc-500`,"aria-label":`Search query`}),f&&(0,B.jsx)(g,{size:16,className:`shrink-0 animate-spin text-zinc-400`}),(0,B.jsx)(`button`,{onClick:t,className:`shrink-0 rounded p-0.5 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300`,"aria-label":`Close search`,children:(0,B.jsx)(re,{size:16})})]}),c.trim()&&(0,B.jsx)(`div`,{role:`tablist`,"aria-label":`Search categories`,className:`flex items-center gap-0.5 sm:gap-1 border-b border-zinc-200 px-2 sm:px-3 py-2 dark:border-zinc-700`,children:kr.map(e=>{let t=T?e.id===`all`?T.teams+T.players+T.tournaments+T.matches:T[e.id]:null,n=T==null?!1:e.id===`all`?T.teams>=X||T.players>=X||T.tournaments>=X||T.matches>=X:T[e.id]>=X,r=t===null?null:n?`${t}+`:`${t}`,i=_===e.id;return(0,B.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":i,onClick:()=>v(e.id),className:`rounded-md px-2.5 py-1 text-xs font-medium transition-colors ${i?`bg-[var(--glk-brand)]/10 text-[var(--glk-brand)]`:`text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800`}`,children:[e.label,r!==null&&(0,B.jsx)(`span`,{className:`ml-1.5 text-2xs tabular-nums opacity-70`,children:r})]},e.id)})}),(0,B.jsxs)(`div`,{className:`max-h-96 overflow-y-auto overscroll-contain p-2`,children:[m&&!f&&(0,B.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-red-500`,children:m.message||`Search failed. Try again.`}),!c.trim()&&!m&&(0,B.jsx)(Br,{entries:y,onPick:e=>l(e),onClear:()=>{Lr(),b([])}}),c.trim()&&f&&!u&&(0,B.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-zinc-400 dark:text-zinc-500`,children:`Searching...`}),c.trim()&&!f&&u&&x.length===0&&(0,B.jsx)(`div`,{className:`px-2 py-4`,children:(0,B.jsx)(Tr,{headline:`No matches`,message:`Nothing matched "${c.trim()}" in this game.`})}),x.length>0&&(0,B.jsx)(`ul`,{role:`listbox`,"aria-label":`Search results`,className:`space-y-0.5`,children:(()=>{let e=``;return x.map((t,n)=>{let r=t.category!==e;e=t.category;let i=Ar[t.category],a=n===C;return(0,B.jsxs)(`li`,{role:`option`,"aria-selected":a,children:[r&&(0,B.jsxs)(`div`,{className:`mt-2 mb-1 flex items-center gap-2 px-3 first:mt-0`,children:[(0,B.jsx)(i,{size:12,className:`text-zinc-400 dark:text-zinc-500`}),(0,B.jsx)(`span`,{className:`glk-eyebrow`,children:t.category})]}),(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors ${a?`bg-[var(--glk-brand)]/10 text-[var(--glk-brand)]`:`text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800`}`,onClick:()=>S(t),onMouseEnter:()=>w(n),children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:(0,B.jsx)(Rr,{text:t.label,query:c})}),t.tier&&(()=>{let e=t.kind===`tournament`,n=e?fr(t.tier):ur(t.tier),r=e?pr(t.tier):dr(t.tier);return r?(0,B.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 text-2xs font-semibold uppercase tracking-wide ${n}`,children:r}):null})(),t.sublabel&&(0,B.jsx)(`span`,{className:`shrink-0 truncate text-xs text-zinc-400 dark:text-zinc-500`,children:t.sublabel})]})]},`${t.category}-${t.path}`)})})()})]}),(0,B.jsx)(`div`,{className:`border-t border-zinc-200 px-4 py-2 dark:border-zinc-700`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-zinc-400 dark:text-zinc-500`,children:[(0,B.jsxs)(`span`,{className:`hidden [@media(pointer:fine)]:inline-flex items-center gap-1`,children:[(0,B.jsx)(`kbd`,{className:`rounded border border-zinc-300 px-1 py-0.5 font-mono dark:border-zinc-600`,children:`↑↓`}),` `,`navigate`]}),(0,B.jsxs)(`span`,{className:`hidden [@media(pointer:fine)]:inline-flex items-center gap-1`,children:[(0,B.jsx)(`kbd`,{className:`rounded border border-zinc-300 px-1 py-0.5 font-mono dark:border-zinc-600`,children:`Enter`}),` `,`select`]}),(0,B.jsxs)(`span`,{className:`hidden [@media(pointer:fine)]:inline-flex items-center gap-1`,children:[(0,B.jsx)(`kbd`,{className:`rounded border border-zinc-300 px-1 py-0.5 font-mono dark:border-zinc-600`,children:`Esc`}),` `,`close`]}),u?.fuzzy===`ilike`&&(0,B.jsx)(`span`,{className:`ml-auto text-2xs opacity-70`,children:`legacy matching`}),u?.fuzzy===`trigram`&&(0,B.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-1 text-2xs opacity-70`,children:[(0,B.jsx)(pe,{size:10}),` Smart match`]})]})})]})]})}function Br({entries:e,onPick:t,onClear:n}){return e.length===0?(0,B.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-zinc-400 dark:text-zinc-500`,children:`Type to search teams, players, matches, or tournaments.`}):(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`mt-1 mb-1 flex items-center justify-between px-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(C,{size:12,className:`text-zinc-400 dark:text-zinc-500`}),(0,B.jsx)(`span`,{className:`glk-eyebrow`,children:`Recent`})]}),(0,B.jsx)(`button`,{type:`button`,onClick:n,className:`text-xs text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300`,children:`Clear recent`})]}),(0,B.jsx)(`ul`,{className:`space-y-0.5`,children:e.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800`,onClick:()=>t(e.query),children:[(0,B.jsx)(ue,{size:12,className:`shrink-0 text-zinc-400 dark:text-zinc-500`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.query})]})},`${e.query}-${e.at}`))})]})}function Vr({activeSlug:e,activeName:t}){let n=le(),r=M(),[i,a]=(0,z.useState)(!1),o=(0,z.useRef)(new Map),s=(0,z.useMemo)(()=>Cn.filter(e=>e.status===`live`),[]),c=(0,z.useCallback)(e=>{let t=r.pathname.split(`/`).filter(Boolean)[1];return t?`/${e}/${t}`:`/${e}`},[r.pathname]),l=(0,z.useMemo)(()=>{let t=s.findIndex(t=>t.slug===e);return t>=0?t:0},[s,e]),[,u]=(0,z.useState)(l),[d,f]=(0,z.useState)(null);(!d||d.open!==i||d.activeIndex!==l||d.liveGames!==s)&&(f({open:i,activeIndex:l,liveGames:s}),i&&u(l)),(0,z.useEffect)(()=>{if(!i)return;let e=requestAnimationFrame(()=>{let e=s[l]?.slug;e&&o.current.get(e)?.focus()});return()=>cancelAnimationFrame(e)},[i,l,s]);let p=(0,z.useCallback)(e=>{e.status===`live`&&(n(c(e.slug)),a(!1))},[n,c]),m=(0,z.useCallback)(e=>{if(s.length!==0){if(e.key===`ArrowDown`)e.preventDefault(),u(e=>{let t=Math.min(e+1,s.length-1);return o.current.get(s[t].slug)?.focus(),t});else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>{let t=Math.max(e-1,0);return o.current.get(s[t].slug)?.focus(),t});else if(e.key===`Home`)e.preventDefault(),u(0),o.current.get(s[0].slug)?.focus();else if(e.key===`End`){e.preventDefault();let t=s.length-1;u(t),o.current.get(s[t].slug)?.focus()}}},[s]),h=(t??Cn.find(t=>t.slug===e)?.name??``).toUpperCase();return(0,B.jsxs)(Tt,{open:i,onOpenChange:a,children:[(0,B.jsx)(Et,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,"aria-label":`Switch game`,"aria-haspopup":`menu`,"aria-expanded":i,className:H(`flex items-center gap-1.5 rounded-md border border-zinc-200 bg-zinc-50 px-2 py-1`,`transition-colors hover:bg-zinc-100 hover:border-zinc-300`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)]`,`dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/[0.06] dark:hover:border-white/20`),children:[(0,B.jsx)(`span`,{className:`h-1.5 w-1.5 flex-shrink-0 rounded-full`,style:{backgroundColor:`var(--glk-brand)`},"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`glk-eyebrow hidden sm:inline`,children:`Game`}),h&&(0,B.jsx)(`span`,{className:`hidden text-xs font-semibold tracking-wide text-zinc-800 sm:inline dark:text-zinc-100`,style:{fontFamily:`var(--font-display)`,letterSpacing:`0.02em`},children:h}),(0,B.jsx)(`span`,{className:`text-2xs text-zinc-400 dark:text-zinc-500`,"aria-hidden":`true`,children:`▾`})]})}),(0,B.jsx)(Dt,{align:`start`,sideOffset:8,className:`w-64 p-1.5`,onKeyDown:m,children:(0,B.jsx)(`div`,{role:`menu`,"aria-label":`Available games`,className:`flex flex-col gap-0.5`,children:Cn.map(t=>{let n=t.slug===e,r=t.status===`live`;return(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!r,"aria-disabled":!r,"aria-current":n?`page`:void 0,ref:e=>{r&&(e?o.current.set(t.slug,e):o.current.delete(t.slug))},onClick:()=>p(t),onKeyDown:e=>{r&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p(t))},className:H(`group flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-left transition-colors`,`focus-visible:outline-none focus-visible:bg-zinc-100 dark:focus-visible:bg-white/[0.06]`,r?`hover:bg-zinc-100 dark:hover:bg-white/[0.06]`:`cursor-not-allowed opacity-50`),children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md text-xs font-bold text-white`,style:{backgroundColor:r?t.accent??`var(--glk-brand)`:`rgb(113 113 122)`,fontFamily:`var(--font-display)`},children:t.letterMark}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[!r&&(0,B.jsx)(`span`,{className:`glk-eyebrow text-[9px] text-zinc-400 dark:text-zinc-500`,children:`Coming soon`}),(0,B.jsx)(`span`,{className:`truncate text-sm font-semibold text-zinc-900 dark:text-zinc-100`,style:{fontFamily:`var(--font-display)`,letterSpacing:`-0.01em`},children:t.name}),t.topLeague&&(0,B.jsx)(`span`,{className:`truncate text-xs text-zinc-500 dark:text-zinc-400`,children:t.topLeague})]}),n&&r&&(0,B.jsx)(`span`,{className:`flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full`,style:{backgroundColor:`var(--glk-brand)`},"aria-label":`Active game`,children:(0,B.jsx)(Be,{size:12,className:`text-white`,strokeWidth:3})})]},t.slug)})})})]})}var Hr=[{value:`compact`,label:`Compact`,icon:Le},{value:`comfortable`,label:`Comfortable`,icon:ie},{value:`expanded`,label:`Expanded`,icon:n}];function Ur({gameConfig:e,darkMode:t,hideSpoilers:n,feedDensity:r,hideScoreboard:i,showControls:a,onToggleDarkMode:o,onToggleSpoilers:s,onChangeDensity:c,onToggleScoreboard:l,onResetPreferences:u}){let[d,f]=(0,z.useState)(!1),p=M().pathname.split(`/`)[1]||void 0,m=(0,z.useCallback)(()=>f(!1),[]);return(0,z.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),f(e=>!e))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]),(0,z.useEffect)(()=>{let e=()=>f(!0);return window.addEventListener(`open-search`,e),()=>window.removeEventListener(`open-search`,e)},[]),a?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`header`,{className:`sticky top-0 z-50 border-b border-zinc-200 dark:border-white/8`,style:{backgroundColor:`var(--header-bg, rgba(255,255,255,0.9))`,backdropFilter:`saturate(180%) blur(12px)`,WebkitBackdropFilter:`saturate(180%) blur(12px)`},children:(0,B.jsxs)(`div`,{className:`px-4 py-2 flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`div`,{className:`h-3 w-3 flex-shrink-0 rounded-sm`,style:{backgroundColor:`var(--glk-brand)`},"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`hidden text-[18px] font-bold tracking-tight text-zinc-900 sm:inline dark:text-zinc-50`,style:{fontFamily:`var(--font-display)`,letterSpacing:`-0.03em`},children:`glicko`})]}),(0,B.jsx)(Vr,{activeSlug:p,activeName:e?.name})]}),a&&(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:()=>f(!0),className:`relative z-10 flex items-center justify-center h-9 w-9 rounded-md text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-400 dark:hover:bg-white/[0.06] dark:hover:text-zinc-200`,title:`Search (Ctrl+K)`,"aria-label":`Open search`,children:(0,B.jsx)(ue,{size:16})}),(0,B.jsxs)(Tt,{children:[(0,B.jsx)(Et,{asChild:!0,children:(0,B.jsx)(`button`,{className:`flex items-center justify-center h-7 w-7 rounded-md text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-400 dark:hover:bg-white/[0.06] dark:hover:text-zinc-200`,title:`Settings`,"aria-label":`Settings`,children:(0,B.jsx)(we,{size:16})})}),(0,B.jsxs)(Dt,{align:`end`,sideOffset:8,className:`w-56 p-1.5`,children:[(0,B.jsxs)(`button`,{onClick:s,className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-700/50`,children:[(0,B.jsx)(`span`,{className:H(`flex h-6 w-6 items-center justify-center rounded`,n?`text-[var(--glk-brand)]`:`text-zinc-400 dark:text-zinc-500`),children:n?(0,B.jsx)(de,{size:14}):(0,B.jsx)(_e,{size:14})}),(0,B.jsx)(`span`,{className:`flex-1 text-xs font-medium text-zinc-700 dark:text-zinc-200`,children:n?`Spoilers off`:`Spoilers on`}),(0,B.jsx)(`div`,{className:H(`h-3.5 w-6 rounded-full transition-colors relative`,n?`bg-[var(--glk-brand)]`:`bg-zinc-200 dark:bg-zinc-600`),children:(0,B.jsx)(`div`,{className:H(`absolute top-0.5 h-2.5 w-2.5 rounded-full bg-white shadow-sm transition-transform`,n?`translate-x-3`:`translate-x-0.5`)})})]}),(0,B.jsxs)(`button`,{onClick:l,className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-700/50`,children:[(0,B.jsx)(`span`,{className:H(`flex h-6 w-6 items-center justify-center rounded`,i?`text-zinc-400 dark:text-zinc-500`:`text-[var(--glk-brand)]`),children:(0,B.jsx)(ce,{size:14})}),(0,B.jsx)(`span`,{className:`flex-1 text-xs font-medium text-zinc-700 dark:text-zinc-200`,children:i?`Scoreboard off`:`Scoreboard on`}),(0,B.jsx)(`div`,{className:H(`h-3.5 w-6 rounded-full transition-colors relative`,i?`bg-zinc-200 dark:bg-zinc-600`:`bg-[var(--glk-brand)]`),children:(0,B.jsx)(`div`,{className:H(`absolute top-0.5 h-2.5 w-2.5 rounded-full bg-white shadow-sm transition-transform`,i?`translate-x-0.5`:`translate-x-3`)})})]}),(0,B.jsx)(`div`,{className:`mx-2 my-0.5 h-px bg-zinc-100 dark:bg-zinc-700`}),(0,B.jsxs)(`div`,{className:`px-2.5 py-2`,children:[(0,B.jsx)(`div`,{className:`glk-eyebrow mb-1.5`,children:`Density`}),(0,B.jsx)(`div`,{className:`flex rounded-md bg-zinc-100 p-0.5 dark:bg-zinc-700`,children:Hr.map(({value:e,label:t})=>(0,B.jsx)(`button`,{onClick:()=>c(e),className:H(`flex flex-1 items-center justify-center gap-1 rounded py-1 text-2xs font-medium transition-colors`,r===e?`bg-white text-zinc-900 shadow-sm dark:bg-zinc-600 dark:text-zinc-100`:`text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300`),children:t},e))})]}),(0,B.jsx)(`div`,{className:`mx-2 my-0.5 h-px bg-zinc-100 dark:bg-zinc-700`}),(0,B.jsxs)(`button`,{onClick:o,className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-700/50`,children:[(0,B.jsx)(`span`,{className:`flex h-6 w-6 items-center justify-center rounded text-zinc-400 dark:text-zinc-500`,children:t?(0,B.jsx)(fe,{size:14}):(0,B.jsx)(ne,{size:14})}),(0,B.jsx)(`span`,{className:`text-xs font-medium text-zinc-700 dark:text-zinc-200`,children:t?`Light mode`:`Dark mode`})]}),(0,B.jsx)(`div`,{className:`mx-2 my-0.5 h-px bg-zinc-100 dark:bg-zinc-700`}),(0,B.jsxs)(`button`,{onClick:u,className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-700/50`,children:[(0,B.jsx)(`span`,{className:`flex h-6 w-6 items-center justify-center rounded text-zinc-400 dark:text-zinc-500`,children:(0,B.jsx)(Pe,{size:14})}),(0,B.jsx)(`span`,{className:`text-xs font-medium text-zinc-700 dark:text-zinc-200`,children:`Reset to defaults`})]})]})]})]})]})}),(0,B.jsx)(zr,{open:d,onClose:m})]}):(0,B.jsx)(zr,{open:d,onClose:m})}function Wr(e,t,n={}){let r=n.recent===!0&&t===`completed`,i=r?`&recent=true`:``,a=n.tournament,o=a?`&tournament=${encodeURIComponent(a)}`:``,s=t===`upcoming`||t===`live`;return ke({queryKey:[`matches`,e,t,r?`recent`:`all`,a??null],queryFn:()=>Ue(`/games/${e}/matches?status=${t}&limit=50${i}${o}`),staleTime:s?30*1e3:60*1e3,refetchInterval:s?60*1e3:void 0})}var Gr=100;function Kr(e,t={}){let n=t.tournament,r=n?`&tournament=${encodeURIComponent(n)}`:``;return je({queryKey:[`matchesInfinite`,e,`completed`,n??null],queryFn:({pageParam:t=0})=>Ue(`/games/${e}/matches?status=completed&limit=${Gr}&offset=${t}${r}`),initialPageParam:0,getNextPageParam:(e,t,n)=>e.length===Gr?n+Gr:void 0,staleTime:60*1e3})}var qr=[`matches`,`latestStories`,`powerRankings`,`watchNow`,`agentMeta`,`trendingTeams`,`hotTakes`,`teamForm`,`tournamentContext`,`leaderboard`,`gameMood`,`watchedPlayers`,`ad`],Jr={matches:`small`,powerRankings:`small`,watchNow:`small`,leaderboard:`small`,hotTakes:`small`,gameMood:`small`,tournamentContext:`small`,teamForm:`small`,agentMeta:`small`,ad:`small`,watchedPlayers:`small`},Yr=`glicko-preferences`,Z={darkMode:!1,hideSpoilers:!1,feedDensity:`comfortable`,sidebarExpanded:!1,contentTypeFilters:[`article`,`video`,`clip`,`social_post`,`livestream`],favoriteTags:[],regionFilter:``,tierFilter:[],watchlist:[],dashboardWidgets:{matches:!0,leaderboard:!0,teamForm:!0,tournamentContext:!0,agentMeta:!0,watchedPlayers:!0,powerRankings:!0,watchNow:!0,hotTakes:!0,trendingTeams:!0,gameMood:!0,latestStories:!0},widgetOrder:[...qr],widgetSizes:{...Jr},savedLeaderboardViews:[],hideScoreboard:!1,rankingsProvisionalCollapsed:!0,rankingsShowProvisional:!1,pageWidgets:{},teamColors:{team1:`#ff4655`,team2:`#4ade80`},defaultTier:`vct`},Xr=[`#06b6d4`,`#22d3ee`];function Zr(e){let t=Z.teamColors;if(e&&typeof e==`object`&&`team1`in e&&`team2`in e){let n=e;if(typeof n.team1==`string`&&typeof n.team2==`string`)return Xr.includes(n.team2.toLowerCase())?t:{team1:n.team1,team2:n.team2}}try{let e=localStorage.getItem(`glicko-team-colors`);if(e){let n=JSON.parse(e);if(localStorage.removeItem(`glicko-team-colors`),typeof n.team1==`string`&&typeof n.team2==`string`)return Xr.includes(n.team2.toLowerCase())?t:{team1:n.team1,team2:n.team2}}}catch{}return t}function Qr(e,t){if(!Array.isArray(e))return[...t];let n=new Set(t),r=new Set,i=[];for(let t of e)typeof t!=`string`||r.has(t)||(n.has(t)||t.startsWith(`pinned-`))&&(r.add(t),i.push(t));for(let e of t)r.has(e)||i.push(e);return i}function $r(){return typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches}function ei(){try{let e=localStorage.getItem(Yr);if(!e)return{...Z,darkMode:$r()};let t=JSON.parse(e);return t._schemaVersion===2?{...Z,...t,contentTypeFilters:Array.isArray(t.contentTypeFilters)?t.contentTypeFilters:Z.contentTypeFilters,dashboardWidgets:{...Z.dashboardWidgets,...t.dashboardWidgets??{}},widgetOrder:Qr(t.widgetOrder,qr),widgetSizes:{...Jr,...t.widgetSizes??{}},watchlist:Array.isArray(t.watchlist)?t.watchlist:[],savedLeaderboardViews:Array.isArray(t.savedLeaderboardViews)?t.savedLeaderboardViews:[],regionFilter:typeof t.regionFilter==`string`?t.regionFilter:``,tierFilter:Array.isArray(t.tierFilter)?t.tierFilter:[],rankingsProvisionalCollapsed:typeof t.rankingsProvisionalCollapsed==`boolean`?t.rankingsProvisionalCollapsed:Z.rankingsProvisionalCollapsed,rankingsShowProvisional:typeof t.rankingsShowProvisional==`boolean`?t.rankingsShowProvisional:Z.rankingsShowProvisional,pageWidgets:t.pageWidgets??{},teamColors:Zr(t.teamColors),defaultTier:ti(t.defaultTier)?t.defaultTier:Z.defaultTier}:{...Z,watchlist:Array.isArray(t.watchlist)?t.watchlist:[],savedLeaderboardViews:Array.isArray(t.savedLeaderboardViews)?t.savedLeaderboardViews:[]}}catch{return Z}}function ti(e){return e===null||e===`vct`||e===`vcl`||e===`gc`||e===`t3`}var ni=(0,z.createContext)(null);function ri({children:e}){let t=ai();return(0,B.jsx)(ni.Provider,{value:t,children:e})}function ii(){let e=(0,z.useContext)(ni);if(!e)throw Error(`usePreferences must be used inside <PreferencesProvider>`);return e}function ai(){let[e,t]=(0,z.useState)(ei);(0,z.useEffect)(()=>{localStorage.setItem(Yr,JSON.stringify({...e,_schemaVersion:2}))},[e]),(0,z.useEffect)(()=>{document.documentElement.classList.toggle(`dark`,e.darkMode)},[e.darkMode]),(0,z.useEffect)(()=>{let t=document.documentElement;t.style.setProperty(`--color-team1`,e.teamColors.team1),t.style.setProperty(`--color-team2`,e.teamColors.team2)},[e.teamColors]);function n(e,n){t(t=>({...t,[e]:n}))}function r(){n(`darkMode`,!e.darkMode)}function i(t){let r=e.contentTypeFilters;n(`contentTypeFilters`,r.includes(t)?r.filter(e=>e!==t):[...r,t])}function a(t){let r=e.favoriteTags;n(`favoriteTags`,r.includes(t)?r.filter(e=>e!==t):[...r,t])}function o(t){e.watchlist.some(e=>e.slug===t.slug)||n(`watchlist`,[...e.watchlist,t])}function s(t){n(`watchlist`,e.watchlist.filter(e=>e.slug!==t))}function c(t){return e.watchlist.some(e=>e.slug===t)}function l(t){n(`dashboardWidgets`,{...e.dashboardWidgets,[t]:!e.dashboardWidgets[t]})}function u(e){n(`widgetOrder`,e)}function d(t,r){n(`widgetSizes`,{...e.widgetSizes,[t]:r})}function f(t){n(`savedLeaderboardViews`,[...e.savedLeaderboardViews.filter(e=>e.name!==t.name),t])}function p(t){n(`savedLeaderboardViews`,e.savedLeaderboardViews.filter(e=>e.name!==t))}function m(t,n){let r=e.pageWidgets[t];if(!r)return{order:n.order,sizes:n.sizes,hidden:[]};let i=new Set(n.order),a=new Set,o=[];for(let e of r.order??[])i.has(e)&&!a.has(e)&&(a.add(e),o.push(e));for(let e of n.order)a.has(e)||o.push(e);return{order:o,sizes:{...n.sizes,...r.sizes??{}},hidden:r.hidden??[]}}function h(t,r){let i=e.pageWidgets[t]??{order:[],sizes:{},hidden:[]};n(`pageWidgets`,{...e.pageWidgets,[t]:{...i,...r}})}function g(){t(e=>({...e,dashboardWidgets:{...Z.dashboardWidgets},widgetOrder:[...qr]}))}function _(){t(e=>({...Z,darkMode:e.darkMode,watchlist:e.watchlist,savedLeaderboardViews:e.savedLeaderboardViews}))}return(0,z.useMemo)(()=>({preferences:e,updatePreference:n,toggleDarkMode:r,toggleContentType:i,toggleFavoriteTag:a,addToWatchlist:o,removeFromWatchlist:s,isWatching:c,toggleWidget:l,reorderWidgets:u,setWidgetSize:d,saveLeaderboardView:f,deleteSavedLeaderboardView:p,getPageWidgetConfig:m,updatePageWidgetConfig:h,resetDashboardToDefaults:g,resetAllToDefaults:_}),[e])}var oi=`valorant`,si=/^[a-z0-9][a-z0-9._-]{0,127}$/i;function ci(e){return e.normalize(`NFD`).replace(/[̀-ͯ]/g,``)}function li(e){return typeof e==`string`&&si.test(e)}function ui(e,t,n=oi,r={}){if(typeof t!=`string`)return null;let i=ci(t);if(!li(i)||!li(n))return null;let a=`/api/assets/${e}/${encodeURIComponent(i)}?game=${encodeURIComponent(n)}`;return r.fallback===`upstream`?`${a}&fallback=upstream`:a}var di={xs:`h-4 w-4`,sm:`h-5 w-5`,md:`h-8 w-8`,lg:`h-10 w-10`},fi={xs:16,sm:20,md:32,lg:40},pi={xs:`text-[7px]`,sm:`text-[8px]`,md:`text-xs`,lg:`text-xs`},mi=`[filter:drop-shadow(0_0_1px_rgba(0,0,0,0.95))_drop-shadow(0_0_3px_rgba(0,0,0,0.65))_drop-shadow(0_0_8px_rgba(0,0,0,0.3))] dark:[filter:drop-shadow(0_0_2px_rgba(255,255,255,0.35))]`;function hi(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return`hsl(${Math.abs(t)%360} 55% 42%)`}function gi(e){return e&&(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`))?e:null}function _i({name:e,slug:t,abbreviation:n,logoUrl:r,gameSlug:i=`valorant`,size:a=`md`,className:o}){let s=(0,z.useMemo)(()=>ui(`teams`,t,i,{fallback:`upstream`}),[t,i]),c=(0,z.useMemo)(()=>gi(r),[r]),[l,u]=(0,z.useState)(s?`local`:c?`upstream`:`generic`);return vi({tier:l,setTier:u,local:s,upstream:c,size:a,className:o,alt:e,initials:(n||e||`?`).slice(0,3).toUpperCase(),title:e,colorSeed:t??e})}function vi({tier:e,setTier:t,local:n,upstream:r,size:i,className:a,alt:o,initials:s,title:c,colorSeed:l}){let u=fi[i],d=di[i],f=pi[i];return e===`local`&&n?(0,B.jsx)(`img`,{src:n,alt:o,width:u,height:u,className:H(d,`rounded object-contain`,mi,a),onError:()=>t(r?`upstream`:`generic`),loading:`lazy`}):e!==`generic`&&r?(0,B.jsx)(`img`,{src:r,alt:o,width:u,height:u,className:H(d,`rounded object-contain`,mi,a),onError:()=>t(`generic`),loading:`lazy`}):l?(0,B.jsx)(`div`,{className:H(d,f,`flex items-center justify-center rounded font-bold tracking-tight select-none text-white`,a),style:{backgroundColor:hi(l)},title:c,children:s}):(0,B.jsx)(`div`,{className:H(d,f,`flex items-center justify-center rounded font-bold tracking-tight select-none`,`bg-zinc-200 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-500`,a),title:c,children:s})}var yi=300*1e3,bi=20,xi=8,Si=1440*60*1e3,Ci=[`t1`,`t2`,`gc`,`t3`];function wi(e){let t=new Date(e).getTime()-Date.now();return t>-yi&&t<Si}function Ti(e){let t=e.stats?.streamLinks;if(Array.isArray(t)&&t.length>0)return!0;let n=e.tournament?.name;return!!(n&&Sn(n))}function Ei(e){if(!e.team1||!e.team2||Ye(e))return!1;if(Ti(e))return!0;let t=e.mapResults?.some(e=>e.team1Score>0||e.team2Score>0)??!1,n=e.team1Maps!=null&&e.team1Maps>0||e.team2Maps!=null&&e.team2Maps>0,r=e.stats?.team1Maps!=null&&e.stats.team1Maps>0||e.stats?.team2Maps!=null&&e.stats.team2Maps>0;return t||n||r}function Di(e){if(!e.mapResults)return null;for(let t=e.mapResults.length-1;t>=0;t--){let n=e.mapResults[t];if(!Je(n)&&(n.team1Score>0||n.team2Score>0))return{mapName:n.mapName,t1:n.team1Score,t2:n.team2Score}}return null}function Oi(e,t){let n=new Date(e).getTime(),r=Date.now(),i=t===`upcoming`?n-r:r-n;if(i<0)return t===`upcoming`?`Now`:`Just now`;let a=Math.floor(i/6e4);if(t===`upcoming`){if(a<1)return`Now`;if(a<60)return`in ${a}m`;let t=Math.floor(a/60);if(t<24)return`in ${t}h`;let n=Math.floor(t/24);return n===1?`Tomorrow`:n<7?`in ${n}d`:new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}if(a<1)return`Just now`;if(a<60)return`${a}m ago`;let o=Math.floor(a/60);if(o<24)return`${o}h ago`;let s=Math.floor(o/24);return s===1?`Yesterday`:s<7?`${s}d ago`:new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function ki({gameSlug:e}={}){let t=I(),n=e??t.gameSlug,{data:r}=Wr(n,`upcoming`),{data:i}=Wr(n,`live`),{data:a}=Wr(n,`completed`,{recent:!0}),{preferences:o,updatePreference:s,toggleDarkMode:c}=ii(),l=[...i??[],...r??[],...a??[]],u=new Set,d=l.filter(e=>u.has(e.id)?!1:(u.add(e.id),!0)),f=d.filter(e=>Ke(e)&&Ei(e)&&!qe(e)&&ar(e.tournament?.tier)).sort(cr),p=new Set(f.map(e=>e.id)),m=d.filter(e=>!(p.has(e.id)||!e.team1||!e.team2||Ye(e)||!e.playedAt||!ar(e.tournament?.tier))).sort(lr).slice(0,bi),h=m,g=d.filter(e=>e.status!==`scheduled`||!e.team1||!e.team2||Ye(e)||!ar(e.tournament?.tier)||!e.scheduledAt?!1:wi(e.scheduledAt)).sort((e,t)=>(e.scheduledAt?new Date(e.scheduledAt).getTime():0)-(t.scheduledAt?new Date(t.scheduledAt).getTime():0)).slice(0,xi),_=(0,z.useMemo)(()=>{let e=new Map;for(let t of f){let n=hr(t.tournament?.tier)??`t3`,r=e.get(n)??{live:[],upcoming:[],completed:[]};r.live.push(t),e.set(n,r)}for(let t of g){let n=hr(t.tournament?.tier)??`t3`,r=e.get(n)??{live:[],upcoming:[],completed:[]};r.upcoming.push(t),e.set(n,r)}for(let t of h){let n=hr(t.tournament?.tier)??`t3`,r=e.get(n)??{live:[],upcoming:[],completed:[]};r.completed.push(t),e.set(n,r)}let t=[];for(let n of Ci){let r=e.get(n);if(!r)continue;let i=[...r.live,...r.completed,...r.upcoming];i.length>0&&t.push({tier:n,matches:i})}for(let[n,r]of e){if(Ci.includes(n))continue;let e=[...r.live,...r.completed,...r.upcoming];e.length>0&&t.push({tier:n,matches:e})}return t},[f,g,h]),v=f.length>0||g.length>0||m.length>0,y=f.length;return(0,B.jsxs)(`section`,{"aria-label":`Live scoreboard`,className:`relative hidden flex-shrink-0 items-stretch border-b border-zinc-200 bg-zinc-50 sm:flex dark:border-white/[0.06] dark:bg-glk-bg-app`,children:[y>0&&(0,B.jsx)(`div`,{className:`absolute inset-x-0 top-0 h-0.5 bg-[var(--glk-brand)]`}),(0,B.jsxs)(`div`,{"aria-live":`polite`,"aria-atomic":`false`,className:`contents`,children:[y>0&&(0,B.jsx)(`div`,{className:`flex flex-shrink-0 items-center border-r border-zinc-200 px-2.5 dark:border-white/[0.06]`,children:(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-sm bg-red-500/10 px-2 py-0.5 dark:bg-red-500/15`,children:[(0,B.jsx)(`span`,{className:`glk-live-dot`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`glk-metric text-2xs text-red-500`,children:y})]})}),v?(0,B.jsx)(Mi,{children:_.map(e=>(0,B.jsxs)(z.Fragment,{children:[(0,B.jsx)(ji,{tier:e.tier}),e.matches.map(e=>(0,B.jsx)(Ni,{match:e,gameSlug:n,isLive:p.has(e.id)},e.id))]},e.tier))}):(0,B.jsx)(`div`,{className:`flex flex-1 items-center px-3`,children:(0,B.jsx)(`span`,{className:`glk-eyebrow text-zinc-500 dark:text-zinc-400`,children:`No matches in the last 24h — check back soon`})})]}),(0,B.jsx)(Ai,{hideSpoilers:o.hideSpoilers,darkMode:o.darkMode,teamColors:o.teamColors,onToggleSpoilers:()=>s(`hideSpoilers`,!o.hideSpoilers),onToggleDarkMode:c,onToggleScoreboard:()=>s(`hideScoreboard`,!0),onSetTeamColors:e=>s(`teamColors`,e),hasLeftBorder:v})]})}function Ai({hideSpoilers:e,darkMode:t,teamColors:n,onToggleSpoilers:r,onToggleDarkMode:i,onToggleScoreboard:a,onSetTeamColors:o,hasLeftBorder:s}){return(0,B.jsxs)(`div`,{className:H(`flex flex-shrink-0 items-center gap-1.5 px-2.5`,s&&`border-l border-zinc-200 dark:border-white/[0.06]`),children:[(0,B.jsx)(`button`,{onClick:()=>window.dispatchEvent(new Event(`open-search`)),className:`flex h-7 w-7 items-center justify-center rounded-md border border-zinc-200 bg-transparent text-zinc-500 transition-colors hover:border-zinc-300 hover:bg-zinc-100 hover:text-zinc-700 dark:border-white/10 dark:text-zinc-400 dark:hover:border-white/20 dark:hover:bg-white/[0.04] dark:hover:text-zinc-200`,title:`Search (Ctrl+K)`,"aria-label":`Open search`,children:(0,B.jsx)(ue,{size:14})}),(0,B.jsxs)(Tt,{children:[(0,B.jsx)(Et,{asChild:!0,children:(0,B.jsx)(`button`,{className:`flex h-7 w-7 items-center justify-center rounded-md border border-zinc-200 bg-transparent text-zinc-500 transition-colors hover:border-zinc-300 hover:bg-zinc-100 hover:text-zinc-700 dark:border-white/10 dark:text-zinc-400 dark:hover:border-white/20 dark:hover:bg-white/[0.04] dark:hover:text-zinc-200`,title:`Settings`,"aria-label":`Settings`,children:(0,B.jsx)(we,{size:14})})}),(0,B.jsxs)(Dt,{align:`end`,sideOffset:8,className:`w-52 p-1.5`,children:[(0,B.jsxs)(`button`,{onClick:r,className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-700/50`,children:[(0,B.jsx)(`span`,{className:H(`flex h-5 w-5 items-center justify-center rounded`,e?`text-emerald-500`:`text-zinc-400 dark:text-zinc-500`),children:e?(0,B.jsx)(de,{size:13}):(0,B.jsx)(_e,{size:13})}),(0,B.jsx)(`span`,{className:`flex-1 text-xs font-medium text-zinc-700 dark:text-zinc-200`,children:e?`Scores hidden`:`Scores visible`}),(0,B.jsx)(`div`,{className:H(`h-3 w-5.5 rounded-full transition-colors relative`,e?`bg-emerald-500`:`bg-zinc-200 dark:bg-zinc-600`),children:(0,B.jsx)(`div`,{className:H(`absolute top-0.5 h-2 w-2 rounded-full bg-white shadow-sm transition-transform`,e?`translate-x-2.5`:`translate-x-0.5`)})})]}),(0,B.jsxs)(`button`,{onClick:a,className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-700/50`,children:[(0,B.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded text-emerald-500`,children:(0,B.jsx)(`svg`,{className:`h-3 w-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,B.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`5`,rx:`1`})})}),(0,B.jsx)(`span`,{className:`flex-1 text-xs font-medium text-zinc-700 dark:text-zinc-200`,children:`Scoreboard on`}),(0,B.jsx)(`div`,{className:`h-3 w-5.5 rounded-full bg-emerald-500 relative`,children:(0,B.jsx)(`div`,{className:`absolute top-0.5 h-2 w-2 rounded-full bg-white shadow-sm translate-x-2.5`})})]}),(0,B.jsx)(`div`,{className:`mx-2 my-0.5 h-px bg-zinc-100 dark:bg-zinc-700`}),(0,B.jsxs)(`div`,{className:`px-2.5 py-2`,children:[(0,B.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5`,children:[(0,B.jsx)(f,{size:11,className:`text-zinc-400 dark:text-zinc-500`}),(0,B.jsx)(`span`,{className:`glk-eyebrow`,children:`Team Colors`})]}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:Xe.slice(0,6).map(e=>(0,B.jsxs)(`button`,{onClick:()=>o({team1:e.team1,team2:e.team2}),className:H(`flex items-center gap-0.5 rounded-md px-1.5 py-1 transition-colors`,n.team1===e.team1&&n.team2===e.team2?`bg-zinc-100 ring-1 ring-zinc-300 dark:bg-zinc-700 dark:ring-zinc-600`:`hover:bg-zinc-50 dark:hover:bg-zinc-700/50`),title:e.label,"aria-label":e.label,children:[(0,B.jsx)(`span`,{className:`h-3 w-3 rounded-full border border-black/10 dark:border-white/10`,style:{backgroundColor:e.team1}}),(0,B.jsx)(`span`,{className:`h-3 w-3 rounded-full border border-black/10 dark:border-white/10`,style:{backgroundColor:e.team2}})]},e.label))})]}),(0,B.jsx)(`div`,{className:`mx-2 my-0.5 h-px bg-zinc-100 dark:bg-zinc-700`}),(0,B.jsxs)(`button`,{onClick:i,className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-700/50`,children:[(0,B.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded text-zinc-400 dark:text-zinc-500`,children:t?(0,B.jsx)(fe,{size:13}):(0,B.jsx)(ne,{size:13})}),(0,B.jsx)(`span`,{className:`text-xs font-medium text-zinc-700 dark:text-zinc-200`,children:t?`Light mode`:`Dark mode`})]})]})]})]})}function ji({tier:e}){let t=dr(e);return t?(0,B.jsx)(`div`,{className:`flex flex-shrink-0 items-center border-r border-zinc-200 px-2 dark:border-white/[0.06]`,children:(0,B.jsx)(`span`,{className:H(`rounded-sm px-1.5 py-0.5 text-2xs font-bold uppercase leading-none`,ur(e)),style:{letterSpacing:`0.08em`},children:t})}):null}function Mi({children:e}){let t=(0,z.useRef)(null),[n,r]=(0,z.useState)(!1),[i,a]=(0,z.useState)(!1),o=(0,z.useCallback)(()=>{let e=t.current;e&&(r(e.scrollLeft>2),a(e.scrollLeft+e.clientWidth<e.scrollWidth-2))},[]);(0,z.useEffect)(()=>{o();let e=t.current;if(!e)return;e.addEventListener(`scroll`,o,{passive:!0});let n=new ResizeObserver(o);return n.observe(e),()=>{e.removeEventListener(`scroll`,o),n.disconnect()}},[o]),(0,z.useEffect)(()=>{let e=t.current;if(!e)return;let n=t=>{Math.abs(t.deltaY)>Math.abs(t.deltaX)&&(t.preventDefault(),e.scrollLeft+=t.deltaY)};return e.addEventListener(`wheel`,n,{passive:!1}),()=>e.removeEventListener(`wheel`,n)},[]);let s=e=>{t.current?.scrollBy({left:e===`left`?-200:200,behavior:`smooth`})};return(0,B.jsxs)(`div`,{className:`relative flex min-w-0 flex-1 items-stretch`,children:[(0,B.jsx)(`div`,{className:H(`pointer-events-none absolute inset-y-0 left-0 z-[2] w-[30px] bg-gradient-to-r from-zinc-50 to-transparent transition-opacity duration-150 dark:from-glk-bg-app`,n?`opacity-100`:`opacity-0`),"aria-hidden":`true`}),(0,B.jsx)(`div`,{className:H(`pointer-events-none absolute inset-y-0 right-0 z-[2] w-[30px] bg-gradient-to-l from-zinc-50 to-transparent transition-opacity duration-150 dark:from-glk-bg-app`,i?`opacity-100`:`opacity-0`),"aria-hidden":`true`}),n&&(0,B.jsx)(`button`,{onClick:()=>s(`left`),"aria-label":`Scroll left`,className:`absolute left-0.5 top-1/2 z-[3] grid h-8 w-6 -translate-y-1/2 place-items-center rounded-[4px] border border-zinc-200 bg-white text-zinc-700 opacity-90 transition-opacity hover:opacity-100 dark:border-white/[0.1] dark:bg-zinc-900 dark:text-zinc-100`,children:(0,B.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,B.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})}),i&&(0,B.jsx)(`button`,{onClick:()=>s(`right`),"aria-label":`Scroll right`,className:`absolute right-0.5 top-1/2 z-[3] grid h-8 w-6 -translate-y-1/2 place-items-center rounded-[4px] border border-zinc-200 bg-white text-zinc-700 opacity-90 transition-opacity hover:opacity-100 dark:border-white/[0.1] dark:bg-zinc-900 dark:text-zinc-100`,children:(0,B.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,B.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})}),(0,B.jsx)(`div`,{ref:t,className:`flex min-w-0 flex-1 items-stretch gap-0 overflow-x-auto scrollbar-none`,children:e})]})}function Ni({match:e,gameSlug:t,isLive:n}){let r=e.team1,i=e.team2,a=n?e.mapResults?.filter(e=>Je(e)&&e.winnerId===r.id).length??0:(()=>{let t=e.team1Maps,n=e.stats?.team1Maps,i=e.mapResults?.filter(e=>Je(e)&&e.winnerId===r.id).length;if(t!=null&&e.team2Maps!=null&&e.winner){let i=e.winner.id===r.id;if(i&&t<e.team2Maps&&n!=null||!i&&t>e.team2Maps&&n!=null)return n}return t??n??i??0})(),o=n?e.mapResults?.filter(e=>Je(e)&&e.winnerId===i.id).length??0:(()=>{let t=e.team2Maps,n=e.stats?.team2Maps,r=e.mapResults?.filter(e=>Je(e)&&e.winnerId===i.id).length;if(t!=null&&e.team1Maps!=null&&e.winner){let r=e.winner.id===i.id;if(r&&t<e.team1Maps&&n!=null||!r&&t>e.team1Maps&&n!=null)return n}return t??n??r??0})(),s=Ge(e)&&!n,c=e.winner?.id===r.id,l=e.winner?.id===i.id,u=s&&(c||!l&&a>o),d=s&&(l||!c&&o>a),f=n?Di(e):null,p=!n&&!s&&e.scheduledAt?Oi(e.scheduledAt,`upcoming`):null,m=s&&e.playedAt?Oi(e.playedAt,`completed`):null;return(0,B.jsxs)(Me,{to:`/${t}/matches/${e.id}`,className:H(`group relative flex flex-shrink-0 items-center gap-3 border-r border-zinc-200 px-3.5 py-2 transition-colors dark:border-white/[0.06]`,n?`bg-red-500/[0.04] hover:bg-red-500/[0.08] dark:bg-red-500/[0.05] dark:hover:bg-red-500/[0.1]`:`hover:bg-zinc-100 dark:hover:bg-white/[0.04]`),children:[(0,B.jsxs)(`div`,{className:`flex flex-col justify-center gap-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(_i,{name:r.name,slug:r.slug,abbreviation:r.abbreviation,logoUrl:r.logoUrl,size:`sm`}),(0,B.jsx)(`span`,{className:H(`w-10 truncate text-xs font-bold leading-none`,s&&u&&`text-zinc-900 dark:text-zinc-50`,s&&!u&&`text-zinc-400 dark:text-zinc-500`,!s&&`text-zinc-900 dark:text-zinc-100`),style:{fontFamily:`var(--font-display)`,letterSpacing:`-0.01em`},children:r.abbreviation??r.name}),(0,B.jsx)(`span`,{className:H(`glk-metric w-3 text-right text-sm leading-none`,n&&`glk-score-slide-in`,s&&u&&`text-zinc-900 dark:text-zinc-50`,s&&!u&&`text-zinc-400 dark:text-zinc-500`,!s&&`text-zinc-900 dark:text-zinc-100`),children:a},n?`t1-${a}`:void 0)]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(_i,{name:i.name,slug:i.slug,abbreviation:i.abbreviation,logoUrl:i.logoUrl,size:`sm`}),(0,B.jsx)(`span`,{className:H(`w-10 truncate text-xs font-bold leading-none`,s&&d&&`text-zinc-900 dark:text-zinc-50`,s&&!d&&`text-zinc-400 dark:text-zinc-500`,!s&&`text-zinc-900 dark:text-zinc-100`),style:{fontFamily:`var(--font-display)`,letterSpacing:`-0.01em`},children:i.abbreviation??i.name}),(0,B.jsx)(`span`,{className:H(`glk-metric w-3 text-right text-sm leading-none`,n&&`glk-score-slide-in`,s&&d&&`text-zinc-900 dark:text-zinc-50`,s&&!d&&`text-zinc-400 dark:text-zinc-500`,!s&&`text-zinc-900 dark:text-zinc-100`),children:o},n?`t2-${o}`:void 0)]})]}),(0,B.jsx)(`div`,{className:`flex min-w-[44px] flex-col items-start justify-center gap-1`,children:n?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`glk-pulse-halo inline-flex items-center gap-1 rounded-sm bg-red-500/15 px-1.5 py-[2px] text-[9px] font-bold uppercase leading-none text-red-500`,style:{letterSpacing:`0.1em`},children:[(0,B.jsx)(`span`,{className:`glk-live-dot`,"aria-hidden":`true`,style:{width:4,height:4}}),`Live`]}),f&&(0,B.jsxs)(`span`,{className:`flex items-center gap-1 leading-none`,children:[(0,B.jsx)(`span`,{className:`glk-tabular text-[9px] capitalize text-zinc-500 dark:text-zinc-400`,children:f.mapName.toLowerCase()}),(0,B.jsxs)(`span`,{className:`glk-metric glk-score-slide-in text-xs text-zinc-900 dark:text-zinc-100`,children:[f.t1,`–`,f.t2]},`${f.t1}-${f.t2}`)]})]}):s?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`text-2xs font-bold uppercase leading-none text-zinc-400 dark:text-zinc-500`,style:{letterSpacing:`0.12em`},children:`Final`}),m&&(0,B.jsx)(`span`,{className:`glk-tabular text-[9px] leading-none text-zinc-500 dark:text-zinc-500`,children:m})]}):p?(0,B.jsx)(`span`,{className:`glk-tabular text-xs font-semibold leading-none text-blue-600 dark:text-blue-400`,title:e.scheduledAt?new Date(e.scheduledAt).toLocaleString():void 0,children:p}):null})]})}var Pi=`Glicko`;function Fi(e){(0,z.useEffect)(()=>(document.title=e?`${e} · ${Pi}`:Pi,()=>{document.title=Pi}),[e])}var Ii=class extends z.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){try{let t=JSON.stringify({sessionId:Li(),route:typeof window<`u`?window.location.pathname:``,metric:`error`,value:1,rating:`poor`,userAgent:typeof navigator<`u`?navigator.userAgent:``,message:bt(e.message??`render error`),stack:bt((e.stack??``).slice(0,4096))});typeof navigator<`u`&&typeof navigator.sendBeacon==`function`&&navigator.sendBeacon(`/api/metrics/web-vitals`,t)}catch{}V(e,{boundary:`shell`,route:typeof window<`u`?window.location.pathname:``,componentStack:t.componentStack}),this.props.onError?.(e,t)}reset=()=>this.setState({hasError:!1,error:null});render(){return this.state.hasError&&this.state.error?(0,B.jsx)(Or,{error:this.state.error,retry:this.reset}):this.props.children}};function Li(){try{if(typeof sessionStorage>`u`)return`ssr`;let e=sessionStorage.getItem(`glicko.sessionId`);return e||(e=`s_${Math.random().toString(36).slice(2)}_${Date.now().toString(36)}`,sessionStorage.setItem(`glicko.sessionId`,e)),e}catch{return`anon`}}var Ri=`Glicko`,zi=`Live esports rankings, sentiment, and team intelligence.`,Bi=`https://glicko.app`,Vi=Bi,Hi=`${Bi}/og-image.png`;function Ui(e){if(e!==void 0)return/^(https?:)?\/\//i.test(e)?e:`${Bi}${e.startsWith(`/`)?``:`/`}${e}`}var Wi=`1200`,Gi=`630`,Ki=`image/png`,qi=`Glicko — Esports stats, ratings, and scene pulse.`;function Ji(e,t,n){let r=e.description??zi,i=e.image?e.imageAlt??r??qi:void 0,a=Ui(e.image),o=a&&(e.imageIsBranded??!0)?a:void 0;return[{selector:`meta[name="description"]`,attr:`name`,key:`description`,value:r},{selector:`meta[property="og:title"]`,attr:`property`,key:`og:title`,value:t},{selector:`meta[property="og:description"]`,attr:`property`,key:`og:description`,value:r},{selector:`meta[property="og:type"]`,attr:`property`,key:`og:type`,value:e.type??`website`},{selector:`meta[property="og:url"]`,attr:`property`,key:`og:url`,value:Ui(n)},{selector:`meta[property="og:image"]`,attr:`property`,key:`og:image`,value:a},{selector:`meta[property="og:image:width"]`,attr:`property`,key:`og:image:width`,value:o?Wi:void 0},{selector:`meta[property="og:image:height"]`,attr:`property`,key:`og:image:height`,value:o?Gi:void 0},{selector:`meta[property="og:image:type"]`,attr:`property`,key:`og:image:type`,value:o?Ki:void 0},{selector:`meta[property="og:image:alt"]`,attr:`property`,key:`og:image:alt`,value:i},{selector:`meta[property="og:site_name"]`,attr:`property`,key:`og:site_name`,value:`Glicko`},{selector:`meta[name="twitter:card"]`,attr:`name`,key:`twitter:card`,value:a?`summary_large_image`:`summary`},{selector:`meta[name="twitter:title"]`,attr:`name`,key:`twitter:title`,value:t},{selector:`meta[name="twitter:description"]`,attr:`name`,key:`twitter:description`,value:r},{selector:`meta[name="twitter:image"]`,attr:`name`,key:`twitter:image`,value:a},{selector:`meta[name="twitter:image:alt"]`,attr:`name`,key:`twitter:image:alt`,value:i}]}function Yi(e){if(typeof document>`u`)return{restore:()=>{}};let t=document.head.querySelector(e.selector),n=t?.getAttribute(`content`)??null,r=!t;return t||(t=document.createElement(`meta`),t.setAttribute(e.attr,e.key),document.head.appendChild(t)),e.value===void 0?(r&&t.remove(),{restore:()=>{}}):(t.setAttribute(`content`,e.value),{restore:()=>{r?t?.remove():n!==null&&t?.setAttribute(`content`,n)}})}function Xi(e){if(typeof document>`u`)return{restore:()=>{}};let t=document.head.querySelector(`link[rel="canonical"]`),n=t?.getAttribute(`href`)??null,r=!t;return t||(t=document.createElement(`link`),t.setAttribute(`rel`,`canonical`),document.head.appendChild(t)),t.setAttribute(`href`,e),{restore:()=>{r?t?.remove():n!==null&&t?.setAttribute(`href`,n)}}}function Zi(e){if(typeof document>`u`)return()=>{};let t=e.title?`${e.title} · ${Ri}`:Ri,n=e.canonical??(typeof window<`u`?window.location.href:Vi),r=document.title;document.title=t;let i=[];for(let r of Ji(e,t,n))i.push(Yi(r).restore);return i.push(Xi(n).restore),()=>{document.title=r;for(let e of i)e()}}function Qi(e,t=155){if(e.length<=t)return e;let n=e.slice(0,t),r=n.lastIndexOf(` `);return(r>80?n.slice(0,r):n).trim()+`…`}function $i(e,t){if(e<0)return`just now`;let n=Math.floor(e/6e4);if(n<1)return`just now`;if(n<60)return`${n} min ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function ea(e,t=Date.now()){if(!e||e<=0)return null;let n=t-e,r=Math.max(0,Math.floor(n/6e4));return{lastUpdatedAt:e,label:$i(n,new Date(e)),isFresh:r<60,minutesSince:r}}function ta({data:e}){return(0,z.useEffect)(()=>{if(typeof document>`u`)return;let t=document.createElement(`script`);return t.type=`application/ld+json`,t.text=JSON.stringify(e),document.head.appendChild(t),()=>{t.remove()}},[e]),null}function na(e){return{"@context":`https://schema.org`,"@type":`BreadcrumbList`,itemListElement:e.map((e,t)=>({"@type":`ListItem`,position:t+1,name:e.name,item:e.url}))}}function ra(e){let t={"@context":`https://schema.org`,"@type":`SportsTeam`,name:e.name,url:e.url,sport:e.sport};return e.logo&&(t.logo=e.logo),e.location&&(t.location={"@type":`Place`,name:e.location}),t}function ia(e){let t={"@context":`https://schema.org`,"@type":`Person`,name:e.name,url:e.url};return e.alternateName&&(t.alternateName=e.alternateName),e.nationality&&(t.nationality={"@type":`Country`,name:e.nationality}),e.image&&(t.image=e.image),e.jobTitle&&(t.jobTitle=e.jobTitle),e.affiliation&&(t.affiliation={"@type":`SportsTeam`,name:e.affiliation.name,url:e.affiliation.url}),e.memberOf&&(t.memberOf={"@type":`SportsTeam`,name:e.memberOf.name,url:e.memberOf.url}),t}function aa(e){switch(e){case`live`:case`completed`:return null;case`cancelled`:return`https://schema.org/EventCancelled`;case`postponed`:return`https://schema.org/EventPostponed`;case`scheduled`:case void 0:return`https://schema.org/EventScheduled`;default:return`https://schema.org/EventScheduled`}}function oa(e){let t={"@context":`https://schema.org`,"@type":`CollectionPage`,name:e.name,url:e.url};return e.description&&(t.description=e.description),e.items&&e.items.length>0&&(t.hasPart=e.items.map(e=>({"@type":`Thing`,name:e.name,url:e.url}))),t}function sa(e){let t=e.publisher??`Glicko`,n={"@context":`https://schema.org`,"@type":`NewsArticle`,headline:e.headline,datePublished:e.datePublished,dateModified:e.dateModified??e.datePublished,author:{"@type":`Organization`,name:e.author},publisher:{"@type":`Organization`,name:t,...e.publisherLogo?{logo:{"@type":`ImageObject`,url:e.publisherLogo}}:{}},url:e.url};return e.description&&(n.description=e.description),e.image&&(n.image=e.image),n}function ca(e,t){return{"@context":`https://schema.org`,"@type":`ItemList`,name:e,itemListElement:t.map((e,t)=>({"@type":`ListItem`,position:t+1,name:e.name,url:e.url}))}}function la(e){return{"@context":`https://schema.org`,"@type":`WebSite`,name:e.name,url:e.url,potentialAction:{"@type":`SearchAction`,target:{"@type":`EntryPoint`,urlTemplate:e.searchUrlTemplate},"query-input":`required name=search_term_string`}}}function ua(e){let t={"@context":`https://schema.org`,"@type":`Organization`,name:e.name,url:e.url};return e.logo&&(t.logo=e.logo),e.description&&(t.description=e.description),e.sameAs&&e.sameAs.length>0&&(t.sameAs=e.sameAs),t}function da(e){return{"@context":`https://schema.org`,"@type":`FAQPage`,mainEntity:e.map(e=>({"@type":`Question`,name:e.question,acceptedAnswer:{"@type":`Answer`,text:e.answer}}))}}function fa(e){let t={"@context":`https://schema.org`,"@type":`SportsEvent`,name:e.name,url:e.url,startDate:e.startDate,eventAttendanceMode:`https://schema.org/OnlineEventAttendanceMode`},n=e.eventStatus===void 0?aa(e.status):e.eventStatus;if(n&&(t.eventStatus=n),e.endDate&&(t.endDate=e.endDate),e.location&&(t.location={"@type":`VirtualLocation`,url:e.url,name:e.location}),e.homeTeam){let n={"@type":`SportsTeam`,name:e.homeTeam.name,url:e.homeTeam.url};e.homeTeam.score!=null&&(n.score=e.homeTeam.score),e.winnerUrl&&e.winnerUrl===e.homeTeam.url&&(n.winner=!0),t.homeTeam=n}if(e.awayTeam){let n={"@type":`SportsTeam`,name:e.awayTeam.name,url:e.awayTeam.url};e.awayTeam.score!=null&&(n.score=e.awayTeam.score),e.winnerUrl&&e.winnerUrl===e.awayTeam.url&&(n.winner=!0),t.awayTeam=n}return e.organizer&&(t.organizer={"@type":`Organization`,name:e.organizer.name,url:e.organizer.url}),t}function pa({title:e,subtitle:t,breadcrumbs:n,tabs:r,actions:i,status:a,loadingKind:o,emptyMessage:s,emptyIcon:c,children:l,className:u,seo:d,lightVignette:f,freshness:p}){let m=ea(p?.lastUpdatedAt instanceof Date?p.lastUpdatedAt.getTime():p?.lastUpdatedAt);(0,z.useEffect)(()=>Zi({title:e,...d}),[e,d?.description,d?.canonical,d?.image,d?.imageAlt,d?.type]);let h=(0,z.useMemo)(()=>{if(!n||n.length===0||typeof window>`u`)return null;let t=window.location.origin,r=n.filter(e=>!!e.href).map(e=>({name:e.label,url:`${t}${e.href}`}));return r.push({name:e,url:window.location.href}),r.length<2?null:na(r)},[n,e]);return(0,B.jsxs)(`div`,{className:H(`page-enter px-3 sm:px-4 md:px-5 lg:px-6 xl:px-8 py-4`,u),children:[h&&(0,B.jsx)(ta,{data:h}),(0,B.jsxs)(`header`,{className:`mb-4 flex-shrink-0`,"data-light-vignette":f?``:void 0,children:[n&&n.length>0&&(0,B.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`mb-2 flex flex-wrap items-center gap-1 text-xs text-zinc-500 dark:text-zinc-400`,children:n.map((e,t)=>(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0&&(0,B.jsx)(`span`,{className:`text-zinc-400 dark:text-zinc-600`,children:`/`}),e.href?(0,B.jsx)(Me,{to:e.href,className:`hover:text-zinc-700 dark:hover:text-zinc-200 transition-colors`,children:e.label}):(0,B.jsx)(`span`,{className:`text-zinc-700 dark:text-zinc-300`,children:e.label})]},t))}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 md:flex-row md:items-end md:justify-between`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h1`,{className:`relative inline-flex items-baseline font-[var(--font-display)] text-[26px] md:text-[28px] font-bold uppercase text-zinc-900 dark:text-zinc-100`,style:{letterSpacing:`0.02em`},children:(0,B.jsxs)(`span`,{className:`relative`,children:[e,(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`absolute -bottom-1 left-0 h-[3px] w-7 rounded-full bg-[var(--glk-brand)]`})]})}),(t||m)&&(0,B.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-baseline gap-x-3 gap-y-0.5`,children:[t&&(0,B.jsx)(`p`,{className:`text-sm text-zinc-500 dark:text-zinc-400`,children:t}),m&&(0,B.jsxs)(`span`,{"data-testid":`page-shell-freshness`,title:new Date(m.lastUpdatedAt).toLocaleString(),className:`glk-eyebrow text-zinc-400 dark:text-zinc-500`,children:[`Updated `,m.label]})]})]}),i&&(0,B.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-shrink-0 md:justify-end`,children:i})]}),r&&(0,B.jsx)(`div`,{className:`mt-3`,children:r})]}),(0,B.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:a?.isLoading?(0,B.jsx)(Cr,{kind:o??`grid`}):a?.isError&&a.error?(0,B.jsx)(Or,{error:a.error,retry:a.retry}):a?.isEmpty?(0,B.jsx)(Tr,{message:s??`Nothing here yet.`,icon:c}):(0,B.jsx)(Ii,{children:l})})]})}function ma({children:e,className:t,as:n=`div`}){return(0,B.jsx)(n,{className:H(`w-full px-3 sm:px-4 md:px-5 lg:px-6 xl:px-8`,`pb-[max(1rem,env(safe-area-inset-bottom))]`,t),children:e})}function ha({label:e,description:t,action:n,className:r}){return(0,B.jsxs)(`div`,{className:H(`flex items-baseline justify-between mb-3`,r),children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`glk-eyebrow font-[var(--font-display)]`,children:e}),t&&(0,B.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:t})]}),n]})}function ga(){if(typeof window>`u`||!window.matchMedia)return!1;try{return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}function _a({to:e,from:t=0,duration:n=500,disabled:r=!1}){let i=ga(),a=!r&&!i,[o,s]=(0,z.useState)(a?t:e),c=(0,z.useRef)(null),l=(0,z.useRef)(null),u=(0,z.useRef)(a?t:e),[d,f]=(0,z.useState)({to:e,shouldAnimate:a});return(d.to!==e||d.shouldAnimate!==a)&&(f({to:e,shouldAnimate:a}),a||s(e)),(0,z.useEffect)(()=>{if(!a)return;let t=u.current,r=e-t;if(r===0)return c.current=requestAnimationFrame(()=>{s(e),u.current=e,c.current=null}),()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null)};l.current=null;let i=a=>{l.current===null&&(l.current=a);let o=a-l.current,d=Math.min(1,o/n),f=t+r*(1-(1-d)**3);s(f),u.current=f,d<1?c.current=requestAnimationFrame(i):(u.current=e,c.current=null)};return c.current=requestAnimationFrame(i),()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null)}},[e,n,a]),o}function va({label:e,value:t,sub:n,delta:r,displayValue:i=!1,accent:a=!1,pulse:o=!1,trail:s,href:c,size:l=`md`,countUp:u=!1,multilineValue:d=!1,className:f,loading:p=!1}){let m=u&&typeof t==`number`&&Number.isFinite(t),h=_a({to:m&&!p?t:0,duration:500,disabled:!m});if(p)return(0,B.jsxs)(`div`,{className:H(`min-w-0 flex flex-col`,f),role:`status`,"aria-label":`${e} loading`,"aria-busy":`true`,children:[(0,B.jsx)(`div`,{className:`glk-eyebrow mb-1.5`,children:(0,B.jsx)(`span`,{className:`truncate`,children:e})}),(0,B.jsx)(`div`,{className:H(`h-7 rounded skeleton-shimmer`,l===`lg`?`w-28`:`w-20`)}),n!==void 0&&(0,B.jsx)(`div`,{className:`mt-1.5 h-3 w-24 rounded skeleton-shimmer`})]});let g=m?Math.round(h):t,_=H(`transition-colors`,d?`leading-snug`:`leading-none truncate`,i?`font-bold tracking-tight`:H(`glk-metric`,l===`lg`?`glk-metric-xl`:`glk-metric-lg`),a?`text-[var(--glk-brand)]`:`text-zinc-900 dark:text-zinc-50`,c&&`group-hover:text-[var(--glk-brand)]`),v=i?{fontFamily:`var(--font-display)`,fontSize:l===`lg`?36:28,letterSpacing:`-0.02em`}:void 0,y=(0,B.jsxs)(`div`,{className:H(`min-w-0 flex flex-col`,f),children:[(0,B.jsxs)(`div`,{className:`glk-eyebrow mb-1.5 flex items-center gap-1.5`,children:[o&&(0,B.jsx)(`span`,{className:`glk-live-dot`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`truncate`,children:e})]}),(0,B.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:_,style:v,children:g}),r&&(0,B.jsx)(ya,{...r})]}),n&&(0,B.jsx)(`div`,{className:`mt-1.5 truncate text-xs text-zinc-500 dark:text-zinc-400`,children:n}),s&&(0,B.jsx)(`div`,{className:`mt-3`,children:s})]});return c?(0,B.jsx)(Me,{to:c,className:`group block min-w-0 cursor-pointer`,children:y}):y}function ya({direction:e,value:t,label:n}){let r=e===`up`?`text-emerald-600 dark:text-emerald-400`:e===`down`?`text-red-500`:`text-zinc-500`,i=e===`up`?v:e===`down`?te:a;return(0,B.jsxs)(`span`,{className:H(`inline-flex items-center gap-0.5 text-xs font-semibold tabular-nums`,r),"aria-label":n??`${e===`up`?`Up`:e===`down`?`Down`:`Flat`} ${t}`,children:[(0,B.jsx)(i,{size:11,strokeWidth:2.5,"aria-hidden":`true`}),t]})}function ba({children:e,cols:t=4,className:n}){return(0,B.jsxs)(`div`,{className:H(`glk-card relative grid grid-cols-2 overflow-hidden`,`divide-zinc-200 dark:divide-white/[0.06]`,`sm:divide-x sm:[&>*:not(:first-child)]:pl-4`,t===2?`sm:grid-cols-2`:t===3?`sm:grid-cols-3`:`sm:grid-cols-4`,n),children:[(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-x-0 top-0 h-[2px]`,style:{background:`linear-gradient(to right, var(--glk-brand), color-mix(in srgb, var(--glk-brand) 20%, transparent) 80%, transparent)`}}),e]})}function xa({className:e,size:t=`default`,...n}){return(0,B.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:H(`group/card flex flex-col gap-4 overflow-hidden rounded-xl py-4 text-sm text-card-foreground bg-[linear-gradient(180deg,var(--glk-surface-card-top)_0%,var(--glk-surface-card-bottom)_100%)] shadow-[0_0_0_1px_var(--glk-surface-card-edge),inset_0_1px_0_var(--glk-surface-card-inset),0_1px_3px_var(--glk-surface-card-shadow-md),0_1px_2px_var(--glk-surface-card-shadow-sm)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function Sa({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card-content`,className:H(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}var Ca=Te(``,{variants:{variant:{player:``,team:``,tournament:``,match:``},size:{md:`px-4 py-4 sm:px-5 sm:py-5`,sm:`px-3 py-3`}},defaultVariants:{variant:`team`,size:`md`}});function wa({variant:e,size:t,className:n,children:r,...i}){return(0,B.jsx)(xa,{"data-variant":e??`team`,"data-size":t??`md`,className:H(Ca({variant:e,size:t}),n),...i,children:r})}function Ta({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`hero-identity`,className:H(`flex items-start gap-3 sm:gap-4`,e),...t})}function Ea({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`hero-meta`,className:H(`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-zinc-400`,e),...t})}function Da({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`hero-badges`,className:H(`flex flex-wrap items-center gap-1.5 sm:gap-2`,e),...t})}function Oa({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`hero-actions`,className:H(`flex flex-wrap items-center gap-2`,e),...t})}var ka=Object.assign(wa,{Identity:Ta,Meta:Ea,Badges:Da,Actions:Oa}),Aa=Te(`grid gap-2 sm:gap-4 transition-opacity`,{variants:{cols:{3:`grid-cols-3`,4:`grid-cols-4`,5:`grid-cols-3 sm:grid-cols-5`},isFetching:{true:`opacity-50`,false:``}},defaultVariants:{cols:5,isFetching:!1}});function ja({cols:e,isFetching:t,className:n,children:r,...i}){return(0,B.jsx)(`div`,{"data-slot":`hero-stat-row`,"data-cols":e??5,className:H(Aa({cols:e,isFetching:t}),n),...i,children:r})}function Ma({label:e,value:t,className:n,...r}){return(0,B.jsxs)(`div`,{"data-slot":`hero-stat-item`,className:H(n),...r,children:[(0,B.jsx)(`div`,{className:`glk-eyebrow`,children:e}),(0,B.jsx)(`div`,{className:`glk-metric text-lg sm:text-2xl font-bold text-zinc-900 dark:text-zinc-100`,children:t})]})}var Na=Object.assign(ja,{Item:Ma}),Pa=[{label:`Home`,href:`/`},{label:`About`,href:`/about`},{label:`Methodology`,href:`/methodology`},{label:`Privacy`,href:`/privacy`}];function Fa({currentPath:e,label:t,testid:n,outerClass:r,navClass:i}){return(0,B.jsx)(`nav`,{"aria-label":t,"data-testid":n,className:r,children:(0,B.jsx)(`ul`,{className:i,children:Pa.map(t=>(0,B.jsx)(`li`,{children:t.href===e?(0,B.jsx)(`span`,{"aria-current":`page`,className:`text-zinc-700 dark:text-zinc-300`,children:t.label}):(0,B.jsx)(Me,{to:t.href,className:`rounded-sm hover:text-zinc-700 dark:hover:text-zinc-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)]`,children:t.label})},t.href))})})}function Ia({currentPath:e}){return Fa({currentPath:e,label:`Static pages`,testid:`static-page-sibling-nav`,outerClass:`mb-6 text-xs text-zinc-500 dark:text-zinc-400`,navClass:`flex flex-wrap items-center gap-x-4 gap-y-1 list-none p-0`})}function La({currentPath:e}){let t=new Date().getFullYear();return(0,B.jsxs)(`footer`,{"data-testid":`static-page-footer`,className:`mt-12 border-t border-zinc-200 dark:border-zinc-800 pt-6`,children:[Fa({currentPath:e,label:`Static page navigation`,testid:`static-page-footer-nav`,outerClass:`text-xs text-zinc-500 dark:text-zinc-400`,navClass:`flex flex-wrap items-center gap-x-4 gap-y-1 list-none p-0`}),(0,B.jsxs)(`p`,{className:`mt-3 text-xs text-zinc-400 dark:text-zinc-500`,children:[`Glicko · `,t]})]})}function Ra({className:e=``}){return Fa({label:`Site pages`,testid:`static-page-link-row`,outerClass:`text-xs text-zinc-500 dark:text-zinc-400 ${e}`.trim(),navClass:`flex flex-wrap items-center justify-center gap-x-4 gap-y-1 list-none p-0`})}function za(){if(typeof document>`u`)return()=>{};let e=document.head.querySelector(`meta[name="robots"]`),t=e?.getAttribute(`content`)??null;e&&e.setAttribute(`content`,`noindex,follow`);let n=document.head.querySelector(`meta[name="prerender-status-code"]`),r=!n;return n||(n=document.createElement(`meta`),n.setAttribute(`name`,`prerender-status-code`),document.head.appendChild(n)),n.setAttribute(`content`,`404`),()=>{e&&t!==null&&e.setAttribute(`content`,t),r&&n?.remove()}}function Ba(){(0,z.useEffect)(()=>za(),[])}function Va(){return Fi(`Not Found`),Ba(),(0,B.jsx)(`div`,{className:`h-full w-full overflow-y-auto`,children:(0,B.jsxs)(`div`,{className:`page-enter flex min-h-[60vh] flex-col items-center justify-center px-4 py-12 text-center`,children:[(0,B.jsx)(`div`,{className:`mb-6 flex h-20 w-20 items-center justify-center rounded-xl bg-[var(--glk-brand)]/10`,children:(0,B.jsx)(l,{size:36,className:`text-[var(--glk-brand)]`,strokeWidth:1.5})}),(0,B.jsx)(`p`,{"aria-hidden":`true`,className:`mb-2 text-6xl font-black text-[var(--glk-brand)] font-[var(--font-display)]`,children:`404`}),(0,B.jsx)(`h1`,{className:`mb-1 text-lg font-semibold text-zinc-900 dark:text-zinc-100`,children:`Page not found`}),(0,B.jsx)(`p`,{className:`mb-6 text-sm text-zinc-400 dark:text-zinc-500`,children:`The page you're looking for doesn't exist or has been moved.`}),(0,B.jsx)(`a`,{href:`/`,className:`inline-flex items-center rounded-md bg-[var(--glk-brand)] px-3.5 py-1.5 text-xs font-semibold uppercase tracking-wide text-white transition-opacity hover:opacity-90`,children:`Back to home`}),(0,B.jsx)(Ra,{className:`mt-8`})]})})}function Ha(){let e=window.location.pathname.split(`/`).filter(Boolean);return e.length>0&&e[0]!==`admin`?e[0]:`valorant`}function Ua(){let e=Ha(),t=ke({queryKey:[`gameConfig`,e],queryFn:()=>Ue(`/games/${e}/config`),staleTime:300*1e3,retry:2});return(0,z.useEffect)(()=>{if(t.data?.theme){let e=document.documentElement;e.style.setProperty(`--color-primary`,t.data.theme.primary),e.style.setProperty(`--color-secondary`,t.data.theme.secondary),e.style.setProperty(`--color-accent`,t.data.theme.accent)}},[t.data?.theme]),{...t,slug:e}}function Wa(e){let[t,n]=(0,z.useState)(()=>window.matchMedia(e).matches);return(0,z.useEffect)(()=>{let t=window.matchMedia(e),r=e=>n(e.matches);return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var Ga=(0,z.createContext)({user:null,loading:!0,logout:async()=>{}});function Ka({children:e}){let[t,n]=(0,z.useState)(()=>null),[r,i]=(0,z.useState)(!0);return(0,z.useEffect)(()=>{fetch(`/api/auth/me`,{credentials:`include`}).then(e=>e.ok?e.json():null).then(e=>n(e?.user??null)).catch(()=>n(null)).finally(()=>i(!1))},[]),(0,B.jsx)(Ga.Provider,{value:{user:t,loading:r,logout:async()=>{await fetch(`/api/auth/logout`,{method:`POST`,credentials:`include`}),n(null),window.location.href=`/admin/login`}},children:e})}function qa(){return(0,z.useContext)(Ga)}var Ja=[`a[href]`,`button:not([disabled])`,`[tabindex]:not([tabindex="-1"])`,`[role="tab"]:not([aria-disabled="true"])`,`[role="menuitem"]:not([aria-disabled="true"])`,`[role="option"]:not([aria-disabled="true"])`,`[role="gridcell"]:not([aria-disabled="true"])`,`[data-roving-focus-item]`].join(`, `);function Ya(e){return!!(e.getAttribute(`aria-disabled`)===`true`||`disabled`in e&&e.disabled)}function Xa({containerRef:e,orientation:t=`both`,itemSelector:n=Ja,enabled:r=!0}){(0,z.useEffect)(()=>{if(!r)return;let i=e.current;if(!i)return;let a=e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;let r=e.key===`ArrowDown`||e.key===`ArrowUp`,a=e.key===`ArrowLeft`||e.key===`ArrowRight`;if(!r&&!a||t===`vertical`&&!r||t===`horizontal`&&!a)return;let o=Array.from(i.querySelectorAll(n)).filter(e=>!Ya(e));if(o.length===0)return;let s=document.activeElement;if(!s||!i.contains(s))return;let c=o.indexOf(s);if(c===-1)return;let l=o[(c+(e.key===`ArrowDown`||e.key===`ArrowRight`?1:-1)+o.length)%o.length];l&&(e.preventDefault(),l.focus())};return i.addEventListener(`keydown`,a),()=>i.removeEventListener(`keydown`,a)},[e,t,n,r])}var Za=[{id:`overview`,label:`Home`,desktopLabel:`Overview`,icon:se,path:``,desktopSidebar:!0,mobileTab:!0,mobileSheet:!1},{id:`teams`,label:`Teams`,icon:he,path:`/teams`,desktopSidebar:!0,mobileTab:!0,mobileSheet:!1},{id:`players`,label:`Players`,icon:oe,path:`/players`,desktopSidebar:!0,mobileTab:!0,mobileSheet:!1},{id:`matches`,label:`Matches`,icon:be,path:`/matches`,desktopSidebar:!0,mobileTab:!0,mobileSheet:!1},{id:`stats`,label:`Stats`,icon:o,path:`/stats`,desktopSidebar:!0,mobileTab:!1,mobileSheet:!0},{id:`tournaments`,label:`Tournaments`,icon:Oe,path:`/tournaments`,desktopSidebar:!0,mobileTab:!1,mobileSheet:!0},{id:`news`,label:`News`,icon:m,path:`/news`,desktopSidebar:!0,mobileTab:!1,mobileSheet:!0}],Qa=Za.filter(e=>e.desktopSidebar),$a=Za.filter(e=>e.mobileTab),eo=Za.filter(e=>e.mobileSheet);function to(){let{gameSlug:e}=I(),t=le(),n=M(),[r,i]=(0,z.useState)(!1),a=(0,z.useRef)(null),o=(0,z.useRef)(null),s=(0,z.useRef)(null);Xa({containerRef:o,orientation:`horizontal`}),Xa({containerRef:s,orientation:`vertical`,enabled:r});let c=`?${new URLSearchParams(n.search).toString()}`,l=eo.some(t=>{if(n.pathname!==`/${e}${t.path}`)return!1;if(t.search)return c===t.search;let r=eo.find(e=>e!==t&&e.path===t.path&&e.search);return!r||c!==r.search});(0,z.useEffect)(()=>{if(!r)return;let e=e=>{a.current&&!a.current.contains(e.target)&&i(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[r]);let[u,d]=(0,z.useState)(n.pathname);return u!==n.pathname&&(d(n.pathname),i(!1)),(0,B.jsxs)(B.Fragment,{children:[r&&(0,B.jsx)(`div`,{className:`fixed inset-0 z-30 bg-black/40 backdrop-blur-sm max-md:block md:hidden hidden`}),(0,B.jsxs)(`div`,{ref:a,inert:!r,className:H(`fixed left-0 right-0 z-50 rounded-t-xl border-t bg-white dark:bg-zinc-900 shadow-2xl transition-transform duration-200 ease-out max-md:block md:hidden hidden overflow-hidden`,r?`translate-y-0`:`translate-y-full`),style:{bottom:`calc(4rem + var(--safe-area-bottom, 0px))`,borderColor:`color-mix(in srgb, var(--glk-brand) 20%, transparent)`},children:[(0,B.jsx)(`div`,{className:`h-px w-full`,style:{background:`linear-gradient(to right, transparent, var(--glk-brand), transparent)`,opacity:.5}}),(0,B.jsxs)(`div`,{className:`px-4 pt-3 pb-2`,children:[(0,B.jsx)(`div`,{className:`mx-auto mb-2 h-1 w-8 rounded-full`,style:{backgroundColor:`color-mix(in srgb, var(--glk-brand) 30%, transparent)`}}),(0,B.jsx)(`div`,{ref:s,className:`flex flex-col gap-0.5`,role:`menu`,"aria-label":`More navigation`,children:eo.map(r=>{let i=r.icon,a=`/${e}${r.path}`,o=n.pathname===a&&(r.search?c===r.search:!eo.some(e=>e!==r&&e.path===r.path&&e.search&&c===e.search));return(0,B.jsxs)(`button`,{onClick:()=>t(`${a}${r.search??``}`),role:`menuitem`,"aria-current":o?`page`:void 0,className:H(`flex items-center gap-3 rounded-xl px-3 py-2.5 text-sm font-medium transition-all duration-150`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)]`,o?`text-[var(--glk-brand)]`:`text-zinc-500 dark:text-zinc-400 active:bg-zinc-100 dark:active:bg-zinc-800`),style:o?{backgroundColor:`color-mix(in srgb, var(--glk-brand) 10%, transparent)`,boxShadow:`inset 0 0 12px color-mix(in srgb, var(--glk-brand) 6%, transparent)`}:{},children:[(0,B.jsx)(i,{size:18}),r.label]},r.id)})})]})]}),(0,B.jsxs)(`nav`,{ref:o,"aria-label":`Bottom tabs`,className:`fixed bottom-0 left-0 right-0 z-40 max-md:flex md:hidden hidden border-t border-zinc-200/80 bg-white/95 backdrop-blur-md dark:border-zinc-800/60 dark:bg-zinc-950/95`,style:{height:`calc(4rem + var(--safe-area-bottom, 0px))`,paddingBottom:`var(--safe-area-bottom, 0px)`},children:[$a.map(t=>{let r=t.icon,i=`/${e}${t.path}`,a=t.path===``?n.pathname===i:n.pathname===i||n.pathname.startsWith(`${i}/`);return(0,B.jsx)(me,{to:i,end:t.path===``,"aria-label":t.label,"aria-current":a?`page`:void 0,className:({isActive:e})=>H(`relative flex flex-1 flex-col items-center justify-center gap-0.5 text-xs font-medium transition-all duration-150 active:scale-90`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--glk-brand)]`,e?`text-[var(--glk-brand)]`:`text-zinc-400`),children:({isActive:e})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:H(`absolute top-0 left-1/4 right-1/4 h-0.5 rounded-full bg-[var(--glk-brand)] transition-opacity duration-150`,e?`opacity-100`:`opacity-0`)}),(0,B.jsx)(r,{size:20}),(0,B.jsx)(`span`,{children:t.label})]})},t.id)}),(0,B.jsxs)(`button`,{onClick:()=>i(e=>!e),"aria-label":`More`,"aria-expanded":r,"aria-haspopup":`menu`,"aria-current":l?`page`:void 0,className:H(`relative flex flex-1 flex-col items-center justify-center gap-0.5 text-xs font-medium transition-all duration-150 active:scale-90`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--glk-brand)]`,l||r?`text-[var(--glk-brand)]`:`text-zinc-400`),children:[(0,B.jsx)(`span`,{className:H(`absolute top-0 left-1/4 right-1/4 h-0.5 rounded-full bg-[var(--glk-brand)] transition-opacity duration-150`,l?`opacity-100`:`opacity-0`)}),(0,B.jsx)(ze,{size:20}),(0,B.jsx)(`span`,{children:`More`})]})]})]})}var Q=300*1e3,no=900*1e3,ro=120*1e3;function io(e){return e.data}var ao={snapshotOverview:{name:`snapshot-overview`,path:({gameSlug:e})=>`/games/${e}/snapshots/overview`,staleTime:Q,select:io},snapshotRankings:{name:`snapshot-rankings-top-100`,path:({gameSlug:e})=>`/games/${e}/snapshots/rankings-top-100`,staleTime:Q,select:io},snapshotAgentMeta:{name:`snapshot-agent-meta`,path:({gameSlug:e})=>`/games/${e}/snapshots/agent-meta`,staleTime:no,select:io},snapshotLeaderboard:{name:`snapshot-leaderboard-top-500`,path:({gameSlug:e})=>`/games/${e}/snapshots/leaderboard-top-500`,staleTime:no,select:io},gameConfig:{name:`game-config`,path:({gameSlug:e})=>`/games/${e}/config`,staleTime:1800*1e3},leagues:{name:`leagues`,path:({gameSlug:e})=>`/games/${e}/leagues`,staleTime:no},team:{name:`team`,path:({gameSlug:e,teamSlug:t})=>`/games/${e}/teams/${t}`,staleTime:Q},teamRatingHistory:{name:`team-rating-history`,path:({gameSlug:e,teamId:t})=>`/games/${e}/teams/${t}/rating-history`,staleTime:Q},teamSentiment:{name:`team-sentiment`,path:({gameSlug:e,teamSlug:t})=>`/games/${e}/sentiment/teams/${t}`,staleTime:ro},player:{name:`player`,path:({gameSlug:e,playerSlug:t,limit:n,offset:r})=>{let i=`/games/${e}/players/${t}?limit=${n}`;return typeof r==`number`&&r>0?`${i}&offset=${r}`:i},staleTime:Q},playerRatingHistory:{name:`player-rating-history`,path:({gameSlug:e,playerSlug:t})=>`/games/${e}/players/${t}/rating-history`,staleTime:Q},playerSentiment:{name:`player-sentiment`,path:({gameSlug:e,playerSlug:t})=>`/games/${e}/sentiment/players/${t}`,staleTime:ro},tournament:{name:`tournament`,path:({gameSlug:e,tournamentSlug:t})=>`/games/${e}/tournaments/${t}`,staleTime:Q},standings:{name:`standings`,path:({gameSlug:e,tournamentSlug:t,groupId:n})=>`/games/${e}/tournaments/${t}/standings${n?`?groupId=${n}`:``}`,staleTime:Q},ratingMovers:{name:`rating-movers`,path:({gameSlug:e,tournamentSlug:t})=>`/games/${e}/tournaments/${t}/rating-movers`,staleTime:Q},playerRankings:{name:`player-rankings`,path:({gameSlug:e,limit:t,sort:n,pool:r})=>{let i=`/games/${e}/players/rankings`,a=[];typeof t==`number`&&t>0&&a.push(`limit=${t}`),n===`acs`&&a.push(`sort=acs`);let o=r===`vct`?`t1`:r===`vcl`?`t2`:r===`gc`?`gc`:null;return o&&a.push(`tier=${o}`),a.length>0?`${i}?${a.join(`&`)}`:i},staleTime:Q},teamsList:{name:`teams`,path:({gameSlug:e,limit:t})=>`/games/${e}/teams?limit=${typeof t==`number`&&t>0?t:1e3}`,staleTime:Q},ratingHistory:{name:`rankings-history`,path:({gameSlug:e,teamId:t})=>`/games/${e}/rankings/history?teamId=${t}`,staleTime:Q}},oo=300*1e3;function so(e,t={},n={}){let{name:r,path:i,select:a,staleTime:o=oo,gcTime:s,retry:c}=e,l=n.retry??c;return ke({queryKey:[r,t],queryFn:async()=>{let e=await Ue(i(t));return a?a(e):e},staleTime:n.staleTime??o,gcTime:n.gcTime??s,...l===void 0?{}:{retry:l},enabled:n.enabled,refetchInterval:n.refetchInterval,placeholderData:n.placeholderData})}function co(){let{gameSlug:e}=I();return so(ao.leagues,{gameSlug:e},{enabled:!!e,staleTime:1/0})}var lo=(0,z.createContext)(null),uo={international:`vct`,challengers:`vcl`,"game-changers":`gc`,open:`t3`};function fo(e){if(!e)return[];let t=[];for(let n of e.groups){let e=uo[n.key];if(e)for(let r of n.leagues)t.push({id:r.id,slug:r.slug,region:r.region,tier:e})}return t}function po(e){let t=Gn({region:e.region,slug:e.slug,tier:e.tier});if(!t||t===`global`)return null;let n=(Kn[e.tier]?.[t])?.includes(e.slug)?e.slug:null;return{tier:e.tier,region:t,subRegion:n}}function mo(e,t,n,r){return t?e.filter(e=>{if(e.tier!==t)return!1;let i=po(e);return!i||n&&i.region!==n?!1:r?i.subRegion===r:!0}).map(e=>e.id):[]}function ho(e,t){if(e.length===0)return{ok:!0,triple:{tier:null,region:null,subRegion:null}};let n=[],r=new Map(t.map(e=>[e.id,e]));for(let t of e){let e=r.get(t);if(!e)return{ok:!1,reason:`unknown`};let i=po(e);if(!i)return{ok:!1,reason:`unknown`};n.push(i)}let i=n[0].tier;for(let e of n)if(e.tier!==i)return{ok:!1,reason:`multi-triple`};if(!n.every(e=>e.region===n[0].region))return{ok:!0,triple:{tier:i,region:null,subRegion:null}};let a=n.every(e=>e.subRegion===n[0].subRegion);return{ok:!0,triple:{tier:i,region:n[0].region,subRegion:a?n[0].subRegion:null}}}var go=new Set([`vct`,`vcl`,`gc`,`t3`]),_o=new Set([`americas`,`emea`,`pacific`,`cn`]);function vo(e){return e&&go.has(e)?e:null}function yo(e){return e&&_o.has(e)?e:null}function bo({children:e}){let[t,n]=Re(),{data:r}=co(),{toast:i}=it(),{preferences:a,updatePreference:o}=ii(),s=(0,z.useMemo)(()=>fo(r),[r]),c=t.get(`tier`),l=vo(c),u=c===`all`?null:l??a.defaultTier,d=yo(t.get(`region`)),f=t.get(`sub`)||null,p=t.get(`time`)??``,m=t.get(`stat`)??`acs`,h=t.get(`role`)??``,g=(0,z.useMemo)(()=>mo(s,u,d,f),[s,u,d,f]),_=(0,z.useCallback)(()=>u?s.length===0?null:g:[],[u,s,g]),v=(0,z.useMemo)(()=>({tier:u,region:d,subRegion:f,timeRange:p,stat:m,role:h}),[u,d,f,p,m,h]),y=(0,z.useCallback)(e=>{let t=u;o(`defaultTier`,e),n(n=>(e?n.set(`tier`,e):n.delete(`tier`),t!==e&&(n.delete(`region`),n.delete(`sub`)),n),{replace:!0})},[o,n,u]),b=(0,z.useCallback)(e=>{n(t=>(e?t.set(`region`,e):t.delete(`region`),t.delete(`sub`),t),{replace:!0})},[n]),x=(0,z.useCallback)(e=>{if(e!==null){let t=u&&d?Kn[u]?.[d]:void 0;if(!t||!t.includes(e)){console.warn(`[FilterProvider] setSubRegion(${JSON.stringify(e)}) ignored — not a valid sub for tier=${u} region=${d}.`);return}}n(t=>(e?t.set(`sub`,e):t.delete(`sub`),t),{replace:!0})},[n,u,d]),S=(0,z.useCallback)(e=>{n(t=>(e?t.set(`time`,e):t.delete(`time`),t),{replace:!0})},[n]),C=(0,z.useCallback)(e=>{n(t=>(e&&e!==`acs`?t.set(`stat`,e):t.delete(`stat`),t),{replace:!0})},[n]),w=(0,z.useCallback)(e=>{n(t=>(e?t.set(`role`,e):t.delete(`role`),t),{replace:!0})},[n]),ee=(0,z.useCallback)(()=>{o(`defaultTier`,`vct`),n(e=>(e.delete(`tier`),e.delete(`region`),e.delete(`sub`),e.delete(`leagues`),e.delete(`time`),e.delete(`stat`),e.delete(`role`),e),{replace:!0})},[o,n]),T=(0,z.useRef)(!1),te=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=t.get(`leagues`);if(!e||t.get(`tier`)||s.length===0||te.current===e)return;te.current=e;let r=ho(e.split(`,`).filter(Boolean),s);if(!r.ok){T.current||(T.current=!0,i.info(`Filter URL upgraded — pick a tier above.`)),n(e=>(e.delete(`leagues`),e),{replace:!0});return}let{tier:a,region:c,subRegion:l}=r.triple;a&&o(`defaultTier`,a),n(e=>(e.delete(`leagues`),c&&e.set(`region`,c),l&&e.set(`sub`,l),e),{replace:!0})},[t,s,n,i,o]);let ne=l!==null||d!==null||f!==null||p!==``||h!==``,re=(0,z.useMemo)(()=>({filters:v,setTier:y,setRegion:b,setSubRegion:x,setTimeRange:S,setStat:C,setRole:w,clearAll:ee,hasActiveFilters:ne,derivedLeagueIds:_}),[v,y,b,x,S,C,w,ee,ne,_]);return(0,B.jsx)(lo.Provider,{value:re,children:e})}function xo(){let e=(0,z.useContext)(lo);if(!e)throw Error(`useFilters must be used within a FilterProvider`);return e}function So(){return(0,z.useContext)(lo)}function Co(){let{gameSlug:e}=I(),{preferences:t,updatePreference:n}=ii(),r=M(),i=t.sidebarExpanded,a=(0,z.useRef)(null);return Ua(),Xa({containerRef:a,orientation:`vertical`}),(0,B.jsxs)(`div`,{className:`flex h-full overflow-hidden bg-white dark:bg-glk-bg-app`,children:[(0,B.jsxs)(`nav`,{"aria-label":`Primary`,className:H(`hidden flex-shrink-0 flex-col border-r border-zinc-200/80 py-3 dark:border-white/[0.06] md:flex transition-all duration-150`,i?`w-44 px-3`:`w-13 items-center`),children:[(0,B.jsxs)(Me,{to:`/`,className:H(`mb-3 flex items-center gap-2`,i?`px-1.5`:`justify-center`),"aria-label":`Glicko home`,children:[(0,B.jsx)(`span`,{className:`h-3 w-3 flex-shrink-0 rounded-sm`,style:{backgroundColor:`var(--glk-brand)`},"aria-hidden":`true`}),i&&(0,B.jsx)(`span`,{className:`text-[18px] font-bold leading-none tracking-tight text-zinc-900 dark:text-zinc-50`,style:{fontFamily:`var(--font-display)`,letterSpacing:`-0.03em`},children:`glicko`})]}),(0,B.jsx)(`div`,{className:`mb-2 h-px w-full bg-zinc-200/80 dark:bg-white/[0.06]`}),(0,B.jsx)(`div`,{ref:a,className:`flex flex-col`,children:Qa.map(t=>{let n=t.icon,a=`/${e}${t.path}`,o=Qa.some(e=>e!==t&&e.path===t.path),s=t.path===``?r.pathname===a:r.pathname===a||r.pathname.startsWith(`${a}/`),c=t.search===void 0?!o||Array.from(new URLSearchParams(r.search).entries()).every(([e])=>e!==`tab`):`?${new URLSearchParams(r.search).toString()}`===t.search,l=s&&c,u=t.desktopLabel??t.label;return(0,B.jsxs)(me,{to:{pathname:a,search:t.search??``},end:t.path===``||t.path===`/stats`,title:i?void 0:u,"aria-label":i?void 0:u,"aria-current":l?`page`:void 0,className:H(`relative mb-0.5 flex items-center rounded-md transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] focus-visible:ring-offset-1`,i?`gap-2.5 px-2.5 py-2`:`h-9 w-9 justify-center`,l?`text-[var(--glk-brand)]`:`text-zinc-400 hover:bg-zinc-100 hover:text-zinc-600 dark:hover:bg-white/[0.04] dark:hover:text-zinc-300`),children:[l&&(0,B.jsx)(`span`,{className:`absolute -left-2 top-1/2 h-5 w-[2px] -translate-y-1/2 rounded-r-sm bg-[var(--glk-brand)]`,"aria-hidden":`true`}),(0,B.jsx)(n,{size:18,strokeWidth:l?2.2:1.8,className:`flex-shrink-0`}),i&&(0,B.jsx)(`span`,{className:H(`truncate text-xs`,l?`font-semibold`:`font-medium`),children:u})]},t.id)})}),(0,B.jsxs)(`div`,{className:H(`mt-auto mb-2 flex items-center`,i?`gap-2 px-1.5`:`justify-center`),children:[(0,B.jsx)(`div`,{className:`flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-md text-xs font-bold text-white`,style:{backgroundColor:`var(--glk-brand)`,fontFamily:`var(--font-display)`},"aria-hidden":`true`,children:`V`}),i&&(0,B.jsx)(`span`,{className:`glk-eyebrow text-zinc-600 dark:text-zinc-300`,style:{fontFamily:`var(--font-display)`,letterSpacing:`0.08em`},children:`Valorant`})]}),(0,B.jsx)(`button`,{onClick:()=>n(`sidebarExpanded`,!i),className:`flex items-center justify-center h-8 w-8 self-center rounded-lg text-zinc-300 hover:text-zinc-500 hover:bg-zinc-100 dark:text-zinc-600 dark:hover:text-zinc-400 dark:hover:bg-zinc-800/50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)]`,title:i?`Collapse sidebar`:`Expand sidebar`,"aria-label":i?`Collapse sidebar`:`Expand sidebar`,children:i?(0,B.jsx)(ee,{size:16}):(0,B.jsx)(b,{size:16})})]}),(0,B.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden pb-[calc(4rem+var(--safe-area-bottom,0px))] md:pb-0`,children:(0,B.jsx)(bo,{children:(0,B.jsx)(`div`,{className:`page-enter flex h-full flex-col overflow-hidden`,children:(0,B.jsx)(De,{})},r.key)})}),(0,B.jsx)(to,{})]})}var wo={position:`absolute`,top:0,left:0,zIndex:1e3,transform:`translateY(-200%)`,transition:`transform 0.15s ease-out`};function To({href:e=`#main-content`,children:t=`Skip to main content`}){return(0,B.jsx)(`a`,{href:e,className:`skip-link inline-flex items-center gap-2 rounded-md bg-[var(--glk-brand)] px-4 py-2 text-sm font-medium text-white shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950`,style:wo,children:t})}var Eo=`main-content`,Do={position:`absolute`,width:1,height:1,margin:-1,padding:0,border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`};function Oo(e){let t=e.trim();if(!t)return`Page loaded`;let n=t.indexOf(` · `),r=n>=0?t.slice(0,n).trim():t;return r?`${r}, page loaded`:`Page loaded`}function ko(){let e=M(),[t,n]=(0,z.useState)(``),r=(0,z.useRef)(!0);return(0,z.useEffect)(()=>{if(r.current){r.current=!1;return}let e=window.setTimeout(()=>{n(Oo(document.title));let e=document.getElementById(Eo);e&&e.focus({preventScroll:!0})},0);return()=>window.clearTimeout(e)},[e.pathname,e.search]),(0,B.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,role:`status`,style:Do,"data-testid":`route-announcer`,children:t})}var Ao=(0,z.lazy)(()=>k(()=>import(`./Overview-HByjq9OC.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]))),jo=(0,z.lazy)(()=>k(()=>import(`./Teams-ND_MTe_k.js`),__vite__mapDeps([40,1,2,41,42,43,8,4,5,6,7,28,44,13,45,46,30,47,48,31,15,49,50,18,32,33,20,35,27,23,37,10,51]))),Mo=(0,z.lazy)(()=>k(()=>import(`./Players-DBppu7yK.js`),__vite__mapDeps([52,1,2,53,12,5,41,42,43,8,11,3,4,6,7,9,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,44,45,46,30,48,31,50,54,37,38,39]))),No=(0,z.lazy)(()=>k(()=>import(`./Matches-BAb3lcCO.js`),__vite__mapDeps([55,1,2,3,4,5,6,7,8,9,10,28,29,31,56,57,34,27,37,25,17]))),Po=(0,z.lazy)(()=>k(()=>import(`./MatchDetail-Blbzi-pe.js`),__vite__mapDeps([58,1,2,12,5,4,45,46,30,14,48,56,33,59,17,8,34,7,9,60,37,61]))),Fo=(0,z.lazy)(()=>k(()=>import(`./Stats-Ba_Icc1Z.js`),__vite__mapDeps([62,1,2,12,5,28,44,31,63,57,46,30,7]))),Io=(0,z.lazy)(()=>k(()=>import(`./PlayerRankings-DhoUBIaM.js`),__vite__mapDeps([64,1,2,28,13,31,15,8,50,18,23,54,37]))),Lo=(0,z.lazy)(()=>k(()=>import(`./Tournaments-C3tdqXdB.js`),__vite__mapDeps([65,1,2,41,3,4,5,6,7,8,9,10,28,48,31,66,17,19,36,37,51]))),Ro=(0,z.lazy)(()=>k(()=>import(`./TournamentDetail-DcWlSWXj.js`),__vite__mapDeps([67,1,2,12,5,3,4,6,7,8,9,10,42,28,13,48,66,68,33,16,17,49,59,36,23,37]))),zo=(0,z.lazy)(()=>k(()=>import(`./News-odtwfM5n.js`),__vite__mapDeps([69,1,2,7,37,70,10]))),Bo=(0,z.lazy)(()=>k(()=>import(`./AdminLayout-UZd7vwNY.js`),__vite__mapDeps([71,1,2,8,22,72]))),Vo=(0,z.lazy)(()=>k(()=>import(`./AdminLogin-D1jvQkFR.js`),__vite__mapDeps([73,1,2,72]))),Ho=(0,z.lazy)(()=>k(()=>import(`./Overview-eSbJoBGP.js`),__vite__mapDeps([74,2,1,11,12,5,3,4,6,7,8,9,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,75,51]))),Uo=(0,z.lazy)(()=>k(()=>import(`./Content-lzrlFkWT.js`),__vite__mapDeps([76,1,2,22]))),Wo=(0,z.lazy)(()=>k(()=>import(`./Issues-6_B943Da.js`),__vite__mapDeps([77,1,2,78,22,51]))),Go=(0,z.lazy)(()=>k(()=>import(`./Jobs-D-ydh0wi.js`),__vite__mapDeps([79,1,2,32,33,17,80,22,51]))),Ko=(0,z.lazy)(()=>k(()=>import(`./TypeDashboard-ZDn6f3nV.js`),__vite__mapDeps([81,1,2,75,17,22,24,51,39]))),qo=(0,z.lazy)(()=>k(()=>import(`./RunDetail-B5YKU290.js`),__vite__mapDeps([82,1,2,17,78,80,22,51]))),Jo=(0,z.lazy)(()=>k(()=>import(`./Competitions-DJSio2xz.js`),__vite__mapDeps([83,1,2,84,22,78]))),Yo=(0,z.lazy)(()=>k(()=>import(`./Entities-CnJsOjZV.js`),__vite__mapDeps([85,1,2,78,22,86]))),Xo=(0,z.lazy)(()=>k(()=>import(`./System-D2gE5hwX.js`),__vite__mapDeps([87,1,2,53,17,22,51,39]))),Zo=(0,z.lazy)(()=>k(()=>import(`./Coaches-CTm7CuY6.js`),__vite__mapDeps([86,1,2,78,22]))),Qo=(0,z.lazy)(()=>k(()=>import(`./DuplicateMatchTriage-DUQVX6rQ.js`),__vite__mapDeps([88,1,2,78,22]))),$o=(0,z.lazy)(()=>k(()=>import(`./Analytics-Baq_W0s5.js`),__vite__mapDeps([89,1,2,22]))),es=(0,z.lazy)(()=>k(()=>import(`./AnalyticsMediaKit-ewmgdzmU.js`),__vite__mapDeps([90,1,2,22]))),ts=(0,z.lazy)(()=>k(()=>import(`./Drafts-BZ9aYmeg.js`),__vite__mapDeps([91,1,2,17,84,22,92,51]))),ns=(0,z.lazy)(()=>k(()=>import(`./Config-DAGuoHWk.js`),__vite__mapDeps([93,1,2,22]))),rs=(0,z.lazy)(()=>k(()=>import(`./Calibration-BCYIZ3Sa.js`),__vite__mapDeps([94,1,2,53,59,22]))),is=(0,z.lazy)(()=>k(()=>import(`./Clips-B_1hKCl5.js`),__vite__mapDeps([95,1,2,17,22]))),as=(0,z.lazy)(()=>k(()=>import(`./ClipDetail-ByjHYE66.js`),__vite__mapDeps([96,1,2,22]))),os=(0,z.lazy)(()=>k(()=>import(`./SensitiveTopics-CHNnOm2k.js`),__vite__mapDeps([97,1,2,17,22]))),ss=(0,z.lazy)(()=>k(()=>import(`./Feed-B1mX4gkM.js`),__vite__mapDeps([98,1,2,3,4,5,6,7,8,9,10,44,13,47,99,68,33,18,17,36,60,37,70,38,39,26,27]))),cs=(0,z.lazy)(()=>k(()=>import(`./Story-BdcrdfmE.js`),__vite__mapDeps([100,1,2,101,44,13,99,63,21,37]))),ls=(0,z.lazy)(()=>k(()=>import(`./Review-ClkpM_fs.js`),__vite__mapDeps([102,1,2,101,44,13,99,17,92,22,51]))),us=(0,z.lazy)(()=>k(()=>import(`./Privacy-CrUFJVxA.js`),__vite__mapDeps([103,2,1,63]))),ds=(0,z.lazy)(()=>k(()=>import(`./About-kELYc4eX.js`),__vite__mapDeps([104,2,1]))),fs=(0,z.lazy)(()=>k(()=>import(`./Methodology-CfMQ3e15.js`),__vite__mapDeps([105,1,2,63])));function ps(){let{gameSlug:e}=I();return(0,B.jsx)(j,{to:`/${e??`valorant`}/stats?tab=maps`,replace:!0})}function $({to:e}){let t=M(),[n,r=``,...i]=e.split(/([?#])/),a=``,o=``;if(r===`?`){a=`?`+(i[0]??``);let e=i.findIndex(e=>e===`#`);e>=0&&(o=`#`+(i[e+1]??``))}else r===`#`&&(o=`#`+(i[0]??``));let s=new URLSearchParams(a);new URLSearchParams(t.search).forEach((e,t)=>{s.set(t,e)});let c=s.toString();return(0,B.jsx)(j,{to:n+(c?`?${c}`:``)+o,replace:!0})}function ms(){let{gameSlug:e}=I(),t=e?wn(e):void 0;return e&&!t?e.includes(`.`)?(0,B.jsx)(j,{to:`/valorant`,replace:!0}):(0,B.jsx)(Va,{}):t&&t.status!==`live`?(0,B.jsx)(j,{to:`/valorant`,replace:!0}):(0,B.jsx)(Co,{})}function hs(){let{data:e}=Ua(),{preferences:t,toggleDarkMode:n,updatePreference:r,resetAllToDefaults:i}=ii(),a=M().pathname.split(`/`).filter(Boolean),o=a[0],s=o?wn(o):void 0,c=s?.status===`live`?s.slug:void 0,l=a.length>=3,u=Wa(`(min-width: 768px)`);return(0,B.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-white dark:bg-zinc-950`,children:[(0,B.jsx)(To,{}),(0,B.jsx)(ko,{}),c&&!t.hideScoreboard&&!l&&(0,B.jsx)(ki,{gameSlug:c}),(0,B.jsx)(Ur,{gameConfig:e,darkMode:t.darkMode,hideSpoilers:t.hideSpoilers,feedDensity:t.feedDensity,hideScoreboard:t.hideScoreboard,showControls:t.hideScoreboard||l||!u,onToggleDarkMode:n,onToggleSpoilers:()=>r(`hideSpoilers`,!t.hideSpoilers),onChangeDensity:e=>r(`feedDensity`,e),onToggleScoreboard:()=>r(`hideScoreboard`,!t.hideScoreboard),onResetPreferences:i}),(0,B.jsx)(`main`,{id:`main-content`,tabIndex:-1,className:`min-h-0 flex-1 w-full overflow-hidden focus:outline-none`,children:(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(Cr,{kind:`detail`}),children:(0,B.jsxs)(ve,{children:[(0,B.jsx)(F,{path:`/`,element:(0,B.jsx)(j,{to:`/valorant`,replace:!0})}),(0,B.jsx)(F,{path:`/news`,element:(0,B.jsx)(j,{to:`/valorant/news`,replace:!0})}),(0,B.jsx)(F,{path:`/about`,element:(0,B.jsx)(ds,{})}),(0,B.jsx)(F,{path:`/methodology`,element:(0,B.jsx)(fs,{})}),(0,B.jsxs)(F,{path:`/:gameSlug`,element:(0,B.jsx)(ms,{}),children:[(0,B.jsx)(F,{index:!0,element:(0,B.jsx)(Ao,{})}),(0,B.jsx)(F,{path:`teams`,element:(0,B.jsx)(jo,{})}),(0,B.jsx)(F,{path:`teams/:teamSlug`,element:(0,B.jsx)(jo,{})}),(0,B.jsx)(F,{path:`teams/:teamSlug/players/:playerSlug`,element:(0,B.jsx)(jo,{})}),(0,B.jsx)(F,{path:`players`,element:(0,B.jsx)(Mo,{})}),(0,B.jsx)(F,{path:`players/rankings`,element:(0,B.jsx)(Io,{})}),(0,B.jsx)(F,{path:`players/:playerSlug`,element:(0,B.jsx)(Mo,{})}),(0,B.jsx)(F,{path:`matches`,element:(0,B.jsx)(No,{})}),(0,B.jsx)(F,{path:`matches/:matchId`,element:(0,B.jsx)(Po,{})}),(0,B.jsx)(F,{path:`news`,element:(0,B.jsx)(ss,{})}),(0,B.jsx)(F,{path:`news/wire`,element:(0,B.jsx)(zo,{})}),(0,B.jsx)(F,{path:`news/:slug`,element:(0,B.jsx)(cs,{})}),(0,B.jsx)(F,{path:`stats`,element:(0,B.jsx)(Fo,{})}),(0,B.jsx)(F,{path:`transfers`,element:(0,B.jsx)(j,{to:`../news`,replace:!0})}),(0,B.jsx)(F,{path:`stats/maps`,element:(0,B.jsx)(ps,{})}),(0,B.jsx)(F,{path:`tournaments`,element:(0,B.jsx)(Lo,{})}),(0,B.jsx)(F,{path:`tournaments/:tournamentSlug`,element:(0,B.jsx)(Ro,{})}),(0,B.jsx)(F,{path:`pulse`,element:(0,B.jsx)(j,{to:`../news`,replace:!0})}),(0,B.jsx)(F,{path:`overview`,element:(0,B.jsx)(j,{to:`..`,replace:!0})}),(0,B.jsx)(F,{path:`methodology`,element:(0,B.jsx)(fs,{})})]}),(0,B.jsx)(F,{path:`*`,element:(0,B.jsx)(Va,{})})]})})})]})}function gs(){return(0,B.jsx)(Ct,{children:(0,B.jsx)(ye,{client:tt,children:(0,B.jsx)(ut,{children:(0,B.jsx)(ri,{children:(0,B.jsx)(Ce,{children:(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(Cr,{kind:`detail`}),children:(0,B.jsxs)(ve,{children:[(0,B.jsxs)(F,{element:(0,B.jsx)(Ka,{children:(0,B.jsx)(De,{})}),children:[(0,B.jsx)(F,{path:`/admin/login`,element:(0,B.jsx)(Vo,{})}),(0,B.jsxs)(F,{path:`/admin/*`,element:(0,B.jsx)(Bo,{}),children:[(0,B.jsx)(F,{index:!0,element:(0,B.jsx)(Ho,{})}),(0,B.jsx)(F,{path:`issues`,element:(0,B.jsx)(Wo,{})}),(0,B.jsx)(F,{path:`jobs`,element:(0,B.jsx)(Go,{})}),(0,B.jsx)(F,{path:`jobs/types/:type`,element:(0,B.jsx)(Ko,{})}),(0,B.jsx)(F,{path:`jobs/runs/:id`,element:(0,B.jsx)(qo,{})}),(0,B.jsx)(F,{path:`competitions`,element:(0,B.jsx)(Jo,{})}),(0,B.jsx)(F,{path:`entities`,element:(0,B.jsx)(Yo,{})}),(0,B.jsx)(F,{path:`content`,element:(0,B.jsx)(Uo,{})}),(0,B.jsx)(F,{path:`analytics`,element:(0,B.jsx)($o,{})}),(0,B.jsx)(F,{path:`analytics/media-kit`,element:(0,B.jsx)(es,{})}),(0,B.jsx)(F,{path:`system`,element:(0,B.jsx)(Xo,{})}),(0,B.jsx)(F,{path:`coaches`,element:(0,B.jsx)(Zo,{})}),(0,B.jsx)(F,{path:`duplicate-matches/:issueId`,element:(0,B.jsx)(Qo,{})}),(0,B.jsx)(F,{path:`news/drafts`,element:(0,B.jsx)(ts,{})}),(0,B.jsx)(F,{path:`news/drafts/:id/review`,element:(0,B.jsx)(ls,{})}),(0,B.jsx)(F,{path:`news/config`,element:(0,B.jsx)(ns,{})}),(0,B.jsx)(F,{path:`news/calibration`,element:(0,B.jsx)(rs,{})}),(0,B.jsx)(F,{path:`clips`,element:(0,B.jsx)(is,{})}),(0,B.jsx)(F,{path:`clips/:id`,element:(0,B.jsx)(as,{})}),(0,B.jsx)(F,{path:`sensitive-topics`,element:(0,B.jsx)(os,{})}),(0,B.jsx)(F,{path:`leagues`,element:(0,B.jsx)($,{to:`/admin/competitions?tab=leagues`})}),(0,B.jsx)(F,{path:`tournaments`,element:(0,B.jsx)($,{to:`/admin/competitions?tab=tournaments`})}),(0,B.jsx)(F,{path:`tournaments/slug-overhaul`,element:(0,B.jsx)($,{to:`/admin/competitions?tab=tournaments`})}),(0,B.jsx)(F,{path:`teams`,element:(0,B.jsx)($,{to:`/admin/entities?tab=teams`})}),(0,B.jsx)(F,{path:`patches`,element:(0,B.jsx)($,{to:`/admin/entities?tab=patches`})}),(0,B.jsx)(F,{path:`duplicate-matches`,element:(0,B.jsx)($,{to:`/admin/issues?type=DUPLICATE_MATCH`})}),(0,B.jsx)(F,{path:`data-conflicts`,element:(0,B.jsx)($,{to:`/admin/issues`})}),(0,B.jsx)(F,{path:`entity-review`,element:(0,B.jsx)($,{to:`/admin/issues`})}),(0,B.jsx)(F,{path:`suspected-mislabels`,element:(0,B.jsx)($,{to:`/admin/issues`})}),(0,B.jsx)(F,{path:`news`,element:(0,B.jsx)($,{to:`/admin/content`})}),(0,B.jsx)(F,{path:`asset-cache`,element:(0,B.jsx)($,{to:`/admin/system?tab=assets`})}),(0,B.jsx)(F,{path:`performance`,element:(0,B.jsx)($,{to:`/admin/system?tab=performance`})}),(0,B.jsx)(F,{path:`llm-usage`,element:(0,B.jsx)($,{to:`/admin/system?tab=llm-usage`})}),(0,B.jsx)(F,{path:`signals`,element:(0,B.jsx)($,{to:`/admin/system?tab=signals`})}),(0,B.jsx)(F,{path:`snapshots`,element:(0,B.jsx)($,{to:`/admin/system?tab=snapshots`})}),(0,B.jsx)(F,{path:`jsonb-drift`,element:(0,B.jsx)($,{to:`/admin/system?tab=jsonb-drift`})}),(0,B.jsx)(F,{path:`regional-strength`,element:(0,B.jsx)($,{to:`/admin/analytics`})}),(0,B.jsx)(F,{path:`rating-compare`,element:(0,B.jsx)($,{to:`/admin/analytics`})}),(0,B.jsx)(F,{path:`sentiment-pipeline`,element:(0,B.jsx)($,{to:`/admin/jobs`})}),(0,B.jsx)(F,{path:`sentiment-pipeline/reextract`,element:(0,B.jsx)($,{to:`/admin/jobs`})}),(0,B.jsx)(F,{path:`pipelines`,element:(0,B.jsx)($,{to:`/admin/jobs`})})]})]}),(0,B.jsx)(F,{path:`/privacy`,element:(0,B.jsx)(us,{})}),(0,B.jsx)(F,{path:`/*`,element:(0,B.jsx)(hs,{})})]})})})})})})})}var _s=`glicko.sessionId`;function vs(){try{if(typeof sessionStorage>`u`)return`ssr`;let e=sessionStorage.getItem(_s);return e||(e=`s_${Math.random().toString(36).slice(2)}_${Date.now().toString(36)}`,sessionStorage.setItem(_s,e)),e}catch{return`anon`}}function ys(e){if(typeof navigator>`u`)return;let t=JSON.stringify({sessionId:vs(),route:typeof window<`u`?window.location.pathname:``,metric:e.name,value:e.value,rating:e.rating,userAgent:navigator.userAgent??``});try{if(typeof navigator.sendBeacon==`function`){let e=new Blob([t],{type:`application/json`});navigator.sendBeacon(`/api/metrics/web-vitals`,e);return}fetch(`/api/metrics/web-vitals`,{method:`POST`,headers:{"Content-Type":`application/json`},body:t,keepalive:!0})}catch{}}function bs(){if(typeof window>`u`)return;let e=()=>{k(()=>import(`./vendor-DlcENO3s.js`).then(e=>e.pt).then(e=>{try{e.onLCP(ys),e.onINP(ys),e.onCLS(ys)}catch{}}),__vite__mapDeps([2,1])).catch(()=>{})};`requestIdleCallback`in window?window.requestIdleCallback?.(e):setTimeout(e,1e3)}var xs=new Set(Cn.filter(e=>e.status===`live`).map(e=>e.slug));function Ss(){if(typeof document>`u`)return null;let e=document.getElementById(`__GLICKO_DATA__`);if(!e)return null;let t=e.textContent?.trim()??``;if(!t||t===`{}`)return null;try{let e=JSON.parse(t);return e.queryKey&&e.data?e:null}catch{return null}}function Cs(e){let t=e.replace(/^\/+/,``).split(`/`)[0]??``;return t&&xs.has(t)?t:null}function ws(e,t){let n=[...t.queryKey];e.setQueryData(n,t.data)}async function Ts(e){let t=Ss();if(t){ws(e,t);return}let n=Cs(window.location.pathname);if(!n)return;let r=window.location.pathname,i=`/api/games/${n}/bootstrap?route=${encodeURIComponent(r)}`;try{let t=new AbortController,n=setTimeout(()=>t.abort(),400),r=await fetch(i,{signal:t.signal,credentials:`same-origin`});if(clearTimeout(n),!r.ok)return;let a=await r.json();a.queryKey&&a.data&&ws(e,a)}catch{}}ft();function Es(e){e.reason?.name!==`AbortError`&&(xt(e.reason)&&St()||V(e.reason,{source:`window.unhandledrejection`}))}typeof window<`u`&&(window.addEventListener(`vite:preloadError`,(e=>{St()&&e.preventDefault()})),window.addEventListener(`error`,e=>{xt(e.error??e.message)&&St()||V(e.error??e.message,{source:`window.error`})}),window.addEventListener(`unhandledrejection`,Es)),Ts(tt),(0,Ze.createRoot)(document.getElementById(`root`)).render((0,B.jsx)(z.StrictMode,{children:(0,B.jsx)(gs,{})})),bs();export{fr as $,fa as A,rt as At,Wr as B,na as C,Mt as Ct,sa as D,H as Dt,ca as E,Et,Qi as F,Y as G,Tr as H,Fi as I,hr as J,lr as K,Ti as L,la as M,Hi as N,ua as O,V as Ot,Zi as P,gr as Q,_i as R,ta as S,Pt as St,da as T,Dt as Tt,Or as U,Kr as V,Cr as W,xr as X,ar as Y,vr as Z,va as _,Sn as _t,ao as a,Qn as at,ma as b,qt as bt,Wa as c,Bn as ct,La as d,An as dt,mr as et,Ia as f,jn as ft,Sa as g,On as gt,xa as h,Fn as ht,so as i,sr as it,ra as j,ia as k,it as kt,Va as l,In as lt,ka as m,Pn as mt,So as n,ur as nt,Xa as o,Kn as ot,Na as p,Mn as pt,cr as q,co as r,dr as rt,qa as s,Gn as st,xo as t,pr as tt,Ba as u,Nn as ut,ba as v,cn as vt,oa as w,Tt as wt,pa as x,Nt as xt,ha as y,tn as yt,ii as z};