1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9826],{4284:(e,t,n)=>{"use strict";n.d(t,{_:()=>a});var r=n(95155);n(12115),n(69079);let a=e=>{let{size:t=20,className:n="",style:a,...l}=e,s="number"==typeof t?String(t)+"px":t;return(0,r.jsx)("span",{className:["neo-spinner",n].filter(Boolean).join(" "),style:{"--neo-spinner-size":s,...a},"aria-hidden":"true",...l})}},5096:(e,t,n)=>{"use strict";n.d(t,{L:()=>u});var r=n(95155),a=n(12115),l=n(12758),s=n.n(l),o=n(34801),i=n(62796),c=n(67106);let u=e=>{let{value:t="",onChange:n,query:l,placeholder:s,clearable:u=!0,disabled:d=!1,delay:m=500,className:p="",variant:h="small",ariaLabel:f,onFocus:v,...g}=e,b=(0,a.useRef)(null),w=(0,i.S)(l,m,()=>{}),x=null!=t?t:"",y=e=>{l&&w.search(e&&e.length>=3?e:null)},j=()=>{var e;null==n||n(""),y(""),null==(e=b.current)||e.focus()},k=u&&!!x&&!d;return(0,r.jsx)(o.k,{inputRef:b,className:"width-full ".concat(p).trim(),variant:h,placeholder:s,value:x,disabled:d,type:"text",onChange:e=>{let t=e.target.value;null==n||n(t),y(t)},onKeyUp:e=>{"Escape"===e.key&&x&&j()},onFocus:v,"aria-label":f||s||"Search",trailing:u&&!d?(0,r.jsx)("span",{className:"input-affix-slot",children:k?(0,r.jsx)("button",{type:"button",className:"input-affix input-affix--clear","aria-label":"Clear search",onClick:j,children:(0,r.jsx)(c.I,{name:"x"})}):(0,r.jsx)("span",{className:"input-affix-placeholder","aria-hidden":"true"})}):null,...g})};u.propTypes={value:s().string,onChange:s().func,query:s().func,placeholder:s().string,clearable:s().bool,disabled:s().bool,delay:s().number,className:s().string,variant:s().oneOf(["small","large"]),ariaLabel:s().string,onFocus:s().func}},11765:()=>{},11867:(e,t,n)=>{"use strict";n.d(t,{d:()=>a});var r=n(12115);let a=()=>{let e=(0,r.useRef)(),[t,n]=(0,r.useState)(null),a=(0,r.useCallback)(()=>{if(!e.current)return;let t=e.current.getBoundingClientRect(),r={left:t.left+window.scrollX,right:t.right+window.scrollX,top:t.top+window.scrollY,bottom:t.bottom+window.scrollY,width:t.width,height:t.height};n(e=>e&&e.left===r.left&&e.top===r.top&&e.width===r.width&&e.height===r.height?e:r)},[]);return(0,r.useEffect)(()=>(window.addEventListener("resize",a),window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0)}),[a]),(0,r.useEffect)(()=>{a()}),[(0,r.useCallback)(t=>{t&&(e.current=t,a())},[a]),t,e.current,a]}},19826:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>eo});var r=n(95155),a=n(12115),l=n(50546),s=n(20063),o=n(5459),i=n(78508),c=n(16070),u=n(76802),d=n(68810),m=n(18579),p=n(5677),h=n(94905),f=n(59012),v=n(21547),g=n(40747),b=n(87699),w=n(47522),x=n(5096),y=n(67106),j=n(35380),k=n(92262),N=n(97162),E=n(94466);let I=(0,a.forwardRef)((e,t)=>{let{item:n,index:a,highlightQuery:l,className:s,...o}=e;return n?(0,r.jsxs)("li",{ref:t,className:"competitions-item ".concat(null!=s?s:"").trim(),...o,children:[(0,r.jsx)("span",{className:"competitions-item-name",children:n.name}),n.badge?(0,r.jsx)(N.ic,{variant:n.badge.variant,children:n.badge.label}):null,n.latest?(0,r.jsx)(N.ic,{children:n.latestLabel}):null]}):null}),S=(0,l.PA)(e=>{let{competitions:t,selectedId:n,onSelect:a,loading:l,showViews:s,view:i,onViewChange:c,latestId:u}=e,{i18n:d}=(0,o.e)(),m=e=>d.getString(e),p=t.map(e=>{let t=E.zS[e.status];return{value:e.id,name:e.name,badge:t?{variant:t.variant,label:m(t.key)}:null,latest:e.id===u,latestLabel:m("competitions.latest")}});return(0,r.jsxs)("div",{className:"competitions-picker",children:[s?(0,r.jsx)(k.X,{ariaLabel:m("competitions.view_label"),options:[{value:"ongoing",name:m("competitions.ongoing")},{value:"past",name:m("competitions.past")}],selectedValue:i,onChange:c}):null,(0,r.jsx)(j.m,{className:"competitions-dropdown",options:p,value:n,onChange:e=>a(e.value),searchable:!0,ItemComponent:I,disabled:l,placeholder:l?m("competitions.loading"):"",ariaLabel:m("competitions.picker_label"),emptyLabel:m("common.no_results"),fill:!1})]})});var C=n(62468),L=n(79390),A=n(47650),R=n(60965),_=n(95259),M=n(67950);let T={full:0,half:.46},P=M.WV.duration,B="transform ".concat(P,"ms ").concat(M.WV.easing);n(56153);let H=e=>{let{open:t,onClose:n,label:l,children:s,contentKey:i,className:c=""}=e,{i18n:u}=(0,o.e)(),d=(0,_.j)(),m=(0,a.useRef)(null),p=(0,a.useRef)(null),h=(0,a.useRef)(null),{detent:f,handleProps:v,goTo:g}=function(e){let{sheetRef:t,open:n,onClose:r,reduced:l}=e,[s,o]=(0,a.useState)("half"),i=(0,a.useRef)("half"),c=(0,a.useRef)(null),u=(0,a.useRef)(n);u.current=n;let d=(0,a.useCallback)((e,n)=>{let r=t.current;r&&(r.style.transition=n?B:"none",r.style.transform="translate3d(0, ".concat(e,"px, 0)"))},[t]),m=(0,a.useCallback)((e,n)=>{let r=t.current;r&&d(("closed"===e?1:T[e])*r.offsetHeight,n)},[d,t]),p=(0,a.useCallback)(e=>{i.current=e,o(e),m(e,!0)},[m]);(0,a.useEffect)(()=>{let e=t.current;if(e){if(!n)return void m("closed",!l);if(i.current="half",o("half"),l)return void m("half",!1);m("closed",!1),e.offsetHeight,m("half",!0)}},[n,l,m,t]);let h=(0,a.useCallback)(e=>{let n=t.current;if(!n||!u.current||!e.isPrimary||"mouse"===e.pointerType&&0!==e.button)return;e.currentTarget.setPointerCapture(e.pointerId);let r=n.offsetHeight;c.current={height:r,startY:e.clientY,startPx:T[i.current]*r,samples:[{y:e.clientY,t:e.timeStamp}],moved:!1},n.style.transition="none"},[t]),f=(0,a.useCallback)(e=>{let t=c.current;if(!t)return;let n=e.clientY-t.startY;!t.moved&&Math.abs(n)>3&&(t.moved=!0);let r=t.startPx+n;r<0&&(r*=.35),t.samples.push({y:e.clientY,t:e.timeStamp}),t.samples.length>5&&t.samples.shift(),d(r,!1)},[d]),v=(0,a.useCallback)(e=>{let t=c.current;if(!t)return;c.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}if(!t.moved)return void p("full"===i.current?"half":"full");let n=t.samples[0],a=t.samples[t.samples.length-1],l=a.t-n.t,s=l>0?(a.y-n.y)/l:0,o=t.startPx+(e.clientY-t.startY)+250*s;if(s>.5)return void r();if(s<-.5)return void p("full");let u=[{key:"full",px:T.full*t.height},{key:"half",px:T.half*t.height},{key:"closed",px:+t.height}].reduce((e,t)=>
1Math.abs(t.px-o)<Math.abs(e.px-o)?t:e);"closed"===u.key?r():p(u.key)},[p,r]);return{detent:s,handleProps:{onPointerDown:h,onPointerMove:f,onPointerUp:v,onPointerCancel:v,style:{touchAction:"none"}},goTo:p}}({sheetRef:m,open:t,onClose:n,reduced:d});(0,a.useEffect)(()=>{if(!t)return;let e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,n]),(0,a.useEffect)(()=>{var e,n;t?(h.current=document.activeElement,null==(n=m.current)||n.focus({preventScroll:!0})):(null==(e=h.current)?void 0:e.isConnected)&&(h.current.focus({preventScroll:!0}),h.current=null)},[t]);let b=(0,a.useRef)(!0);return(0,a.useEffect)(()=>{if(b.current){b.current=!1;return}let e=p.current;e&&!d&&(e.classList.remove("is-swapping"),e.offsetWidth,e.classList.add("is-swapping"))},[i,d]),(0,r.jsxs)("div",{className:"neo-sheet is-".concat(f).concat(t?" is-open":""," ").concat(c).trim(),ref:m,tabIndex:-1,role:"dialog","aria-modal":"false","aria-label":l,inert:!t,children:[(0,r.jsx)("div",{className:"neo-sheet-grip",...v,children:(0,r.jsx)("button",{type:"button",className:"neo-sheet-handle","aria-label":u.getString("common.resize_details"),"aria-expanded":"full"===f,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),g("full"===f?"half":"full"))}})}),(0,r.jsx)("div",{className:"neo-sheet-body",ref:p,children:s({detent:f})})]})};var O=n(96250);let F="competitions-breakdown-title",z=e=>{let{player:t,scenarioNames:n,locale:a,t:l,headingId:s,onClose:o}=e,i=new Intl.NumberFormat(a),c=(0,O.dE)(n),u=l("competitions.not_played");return(0,r.jsxs)("div",{className:"competitions-breakdown",children:[(0,r.jsx)("h2",{id:s,className:"competitions-breakdown-title",children:l("competitions.player_breakdown").replace(/\{NAME\}/g,t.name)}),(0,r.jsx)("button",{type:"button",className:"competitions-breakdown-close","aria-label":l("common.close"),onClick:o,children:(0,r.jsx)(y.I,{name:"x",size:20})}),(0,r.jsxs)("div",{className:"competitions-breakdown-summary",children:[(0,r.jsxs)("span",{className:"competitions-breakdown-rank",children:[(0,r.jsx)(h.Xs,{rank:t.rank}),(0,r.jsx)("span",{className:"competitions-breakdown-rank-value",children:i.format(t.rank)}),(0,r.jsx)("span",{className:"competitions-breakdown-label",children:l("common.rank")})]}),(0,r.jsxs)("span",{className:"competitions-breakdown-total",children:[(0,r.jsx)("span",{className:"competitions-breakdown-total-value",children:i.format(t.total)}),(0,r.jsx)("span",{className:"competitions-breakdown-label",children:l("competitions.total")})]})]}),(0,r.jsx)("div",{className:"competitions-breakdown-scroll",children:(0,r.jsxs)("table",{className:"competitions-breakdown-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",children:l("common.scenario")}),(0,r.jsx)("th",{scope:"col",className:"numeric",children:l("competitions.scenario_rank")}),(0,r.jsx)("th",{scope:"col",className:"numeric",children:l("common.score")}),(0,r.jsx)("th",{scope:"col",className:"numeric",children:l("common.points")})]})}),(0,r.jsx)("tbody",{children:n.map((e,n)=>{var a;let l=t.scenarios[e];return(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"row",title:e,children:null!=(a=c[n])?a:e}),l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"numeric",children:i.format(l.rank)}),(0,r.jsx)("td",{className:"numeric",children:i.format(Math.round(l.score))}),(0,r.jsx)("td",{className:"numeric strong",children:i.format(l.points)})]}):(0,r.jsx)("td",{className:"numeric muted",colSpan:3,children:u})]},e)})})]})})]})},D=(0,l.PA)(e=>{let{player:t,scenarioNames:n,locale:l,onClose:s,asSheet:i=!1}=e,{i18n:c}=(0,o.e)(),u=e=>c.getString(e),[d,m]=(0,a.useState)(t);(0,a.useEffect)(()=>{t&&m(t)},[t]);let[p,h]=(0,a.useState)(null);if((0,a.useEffect)(()=>{h(document.getElementById("modal")||document.body)},[]),i){if(!p)return null;let e=d?u("competitions.player_breakdown").replace(/\{NAME\}/g,d.name):u("competitions.overall");return A.createPortal((0,r.jsx)("div",{className:"competitions-sheet-host",children:(0,r.jsx)(H,{open:!!t,onClose:s,label:e,contentKey:null==d?void 0:d.steamId,className:"competitions-breakdown-sheet",children:()=>d?(0,r.jsx)(z,{player:d,scenarioNames:n,locale:l,t:u,onClose:s}):null})}),p)}return t?(0,r.jsx)(R.u,{open:!0,onClose:s,titleId:F,children:(0,r.jsx)("div",{className:"neo-modal-panel competitions-breakdown-panel",children:(0,r.jsx)(z,{player:t,scenarioNames:n,locale:l,t:u,headingId:F,onClose:s})})}):null});var V=n(45142),Y=n(95125),X=n(738),W=n(97958);let q=e=>{let t=Number(e);return Number.isFinite(t)?t<1?1:t:null},K={username:"DrUninstall",steamId:"76561198066375616"},Q=new Map,U=new Map,J=new Map,Z=new Map;function G(e,t,n,r){let a=e.get(t);
1if(a&&(!r||Date.now()-a.at<r))return a.promise;let l=n().catch(n=>{var r;throw(null==(r=e.get(t))?void 0:r.promise)===l&&e.delete(t),n});return e.set(t,{promise:l,at:Date.now()}),l}async function $(e){let t=await e.fetchBenchmarkRows(K.username);return t.complete||(t=await e.fetchBenchmarkRows(K.username)),t.rows.filter(e=>{var t;return(null==e||null==(t=e.type)?void 0:t.toLowerCase())==="competition"}).map(e=>({id:e.benchmarkId,name:e.benchmarkName,icon:e.benchmarkIcon,author:e.benchmarkAuthor})).sort((e,t)=>t.id-e.id)}async function ee(e){let{data:t}=await Y.A.get("".concat(X.nv,"/benchmarks/player-progress-rank-benchmark"),{params:{benchmarkId:e,steamId:K.steamId,page:0,max:100}});if(!(null==t?void 0:t.categories))throw Error("competition ".concat(e," returned no categories"));let n=new Set;return Object.entries(t.categories).flatMap(e=>{var t;let[n,r]=e;return Object.entries(null!=(t=null==r?void 0:r.scenarios)?t:{}).map(e=>{var t;let[r,a]=e;return{name:r,category:n,leaderboardId:null!=(t=null==a?void 0:a.leaderboard_id)?t:null}})}).filter(e=>!n.has(e.name)&&(n.add(e.name),!0))}async function et(e){let t=await W.M.getLiveBenchmarkById(e);if((null==t?void 0:t.status)!==200||!t.data)throw Error("schedule ".concat(e," unavailable"));let{start:n,end:r,banner:a,description:l}=t.data;return{start:n||null,end:r||null,banner:a||null,description:(null==l?void 0:l.trim())||null}}async function en(e){let{data:t}=await Y.A.get("".concat(X.yO,"/leaderboard/tkl/scenario"),{params:{scenario_name:e}});if(!Array.isArray(t))throw Error("standings for ".concat(e," returned no array"));return t}var er=n(57);n(71205);let ea={className:"neo-dt-row--current-user"},el=e=>"live"===e.status||"upcoming"===e.status?"ongoing":"past",es=e=>{let{message:t,onRetry:n,label:a}=e;return(0,r.jsxs)(v.RV,{className:"competitions-callout",children:[(0,r.jsx)("span",{className:"competitions-callout-text",children:t}),(0,r.jsx)(g.X,{variant:"small",className:"secondary competitions-callout-action",onClick:n,children:a})]})},eo=(0,l.PA)(()=>{var e,t,n,l,j,k,N,I;let{i18n:A}=(0,o.e)(),{currentUser:R,isUserLoading:_}=(0,i.Jd)(),M=(0,s.useSearchParams)(),T=(0,c.Qs)(),P="xs"===T,B=P?h.xR:h.N8,H=(0,d.C)(A.locale),F=e=>A.getString(e),z=!!R,Y=function(){let{benchmark:e}=(0,o.e)(),[t,n]=(0,a.useState)(0),[r,l]=(0,a.useState)({status:"loading",competitions:[]});(0,a.useEffect)(()=>{let t=!1;return l(e=>"loading"===e.status?e:{...e,status:"loading"}),G(Q,"competitions",()=>$(e)).then(e=>{t||l({status:"ready",competitions:e})},()=>{t||l({status:"error",competitions:[]})}),()=>{t=!0}},[e,t]);let s=(0,a.useCallback)(()=>n(e=>e+1),[]);return{...r,retry:s}}(),X=function(e,t){let[n,r]=(0,a.useState)({status:"idle",byId:{}}),l=e.map(e=>e.id).join(",");(0,a.useEffect)(()=>{if(!t||!l)return void r({status:"idle",byId:{}});let e=!1,n=l.split(",").map(Number);return r(e=>({...e,status:"loading"})),Promise.allSettled(n.map(e=>G(J,e,()=>et(e)))).then(t=>{if(e)return;let a={};t.forEach((e,t)=>{a[n[t]]="fulfilled"===e.status?e.value:null}),r({status:"ready",byId:a})}),()=>{e=!0}},[t,l]);let s=(0,a.useMemo)(()=>Object.values(n.byId).some(e=>e&&(e.start||e.end)),[n.byId]);return{...n,known:s}}(Y.competitions,z),W=function(){let[e,t]=(0,a.useState)(()=>Date.now());return(0,a.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),6e4);return()=>clearInterval(e)},[]),e}(),K=(0,a.useMemo)(()=>Y.competitions.map(e=>{var t;let n=null!=(t=X.byId[e.id])?t:null;return{...e,schedule:n,status:(0,E.kE)(n,W)}}),[Y.competitions,X.byId,W]),eo=function(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:null}(M.get("competition_id")),[ei,ec]=(0,a.useState)(null),[eu,ed]=(0,a.useState)(""),[em,ep]=(0,a.useState)(1),[eh,ef]=(0,a.useState)(null),[ev,eg]=(0,a.useState)("standings"),eb=null!=(j=null!=(l=null!=(n=K.find(e=>e.id===eo))?n:K.find(e=>"live"===e.status))?l:K[0])?j:null,ew=null!=(k=null==eb?void 0:eb.id)?k:null,ex=null!=(N=null==(e=K[0])?void 0:e.id)?N:null,ey=(0,a.useCallback)(e=>{ed(""),ep(1),ef(null),window.history.replaceState(null,"","".concat("/kovaaks/competitions","?competition_id=").concat(e))},[]),ej=e=>{ed(e),ep(1)},ek=!_&&(!z||"ready"===X.status);(0,a.useEffect)(()=>{ek&&null!=ew&&ew!==eo&&ey(ew)},[ek,ew,eo,ey]);let eN=X.known,eE=null!=ei?ei:eb?el(eb):"ongoing",eI=eN?K.filter(e=>el(e)===eE):K,eS=!!eb&&(!eN||el(eb)===eE),eC=e=>{if(ec(e),eb&&el(eb)===e)return;let t=K.find(t=>el(t)===e);t&&ey(t.id)},eL=function(e){let[t,n]=(0,a.useState)(0),[r,l]=(0,a.useState)({status:"loading",scenarios:[],standings:[],failedScenarios:[]});(0,a.useEffect)(()=>
1{if(null==e)return;let t=!1;return l({status:"loading",scenarios:[],standings:[],failedScenarios:[]}),(async()=>{let n;try{n=await G(U,e,()=>ee(e))}catch(e){t||l({status:"error",scenarios:[],standings:[],failedScenarios:[]});return}if(t)return;l(e=>({...e,scenarios:n,status:"standings"}));let r=n.map(e=>e.name),a=await Promise.allSettled(r.map(e=>G(Z,e,()=>en(e),3e5)));if(t)return;let s={},o=[];if(a.forEach((e,t)=>{"fulfilled"===e.status?s[r[t]]=e.value:o.push(r[t])}),r.length>0&&o.length===r.length)return l({status:"error",scenarios:n,standings:[],failedScenarios:o});l({status:"ready",scenarios:n,standings:function(e,t){let n=new Map;for(let a of e){let e=t[a];if(Array.isArray(e))for(let t of e){var r;let e=(null==t?void 0:t.steamId)==null?"":String(t.steamId),l=q(null==t?void 0:t.rank);if(!e||null==l)continue;let s=n.get(e);s||(s={steamId:e,name:"",total:0,rank:0,scenarios:{}},n.set(e,s)),!s.name&&t.steamAccountName&&(s.name=t.steamAccountName);let o=s.scenarios[a];if(o&&o.rank<=l)continue;let i=1===l?100:2===l?97:3===l?95:l>=4&&l<=98?98-l:0;s.total+=i-(null!=(r=null==o?void 0:o.points)?r:0),s.scenarios[a]={rank:l,score:Number(t.score)||0,points:i}}}let a=[...n.values()].sort((e,t)=>t.total-e.total||e.name.localeCompare(t.name)||e.steamId.localeCompare(t.steamId));return a.forEach((e,t)=>{e.rank=t>0&&a[t-1].total===e.total?a[t-1].rank:t+1}),a}(r,s),failedScenarios:o})})(),()=>{t=!0}},[e,t]);let s=(0,a.useCallback)(()=>n(e=>e+1),[]);return{...r,retry:s}}(eS?ew:null),eA="loading"===Y.status,eR=eA||"loading"===eL.status||"standings"===eL.status,e_=(0,a.useRef)(null),eM=eL.scenarios.length,[eT,eP]=(0,u.K)((0,O.qv)(T,eM)),eB=(0,a.useCallback)(e=>{e_.current=e,eT(e)},[eT]),eH=!P&&eM>0&&!0===eP,eO=!eH&&(P||eM>0),eF=eO?er.H:B,ez=(0,a.useMemo)(()=>eL.scenarios.map(e=>e.name),[eL.scenarios]),eD=(0,a.useMemo)(()=>(0,V.s)({i18n:A,scenarioNames:ez,isPhone:P}),[A,A.locale,ez,P]),eV=null!=(I=null==(t=eL.standings[0])?void 0:t.total)?I:0,eY=(0,a.useMemo)(()=>(0,O.bS)({i18n:A,breakpoint:T,locale:H,scenarioNames:ez,currentUser:R,scenarioColumns:eH,leaderTotal:eV}),[A,A.locale,T,H,ez,R,eH,eV]),eX=(null==R?void 0:R.steamId)!=null?String(R.steamId):null,eW=eX?eL.standings.find(e=>e.steamId===eX):null,eq=(0,a.useCallback)(e=>e.steamId===eX?ea:null,[eX]),eK=(0,a.useMemo)(()=>[F("competitions.standings"),F("competitions.scenarios")],[A,A.locale]),eQ=eu.trim().toLowerCase(),eU=(0,a.useMemo)(()=>eQ?eL.standings.filter(e=>e.name.toLowerCase().includes(eQ)):eL.standings,[eL.standings,eQ]),eJ=Math.min(em,Math.max(1,Math.ceil(eU.length/er.m))),eZ=(0,a.useMemo)(()=>eU.slice((eJ-1)*er.m,eJ*er.m),[eU,eJ]),eG=(0,a.useRef)(null),[e$,e0]=(0,a.useState)(null);(0,a.useEffect)(()=>()=>clearTimeout(eG.current),[]);let e1=()=>{eW&&(ed(""),ep(Math.floor(eL.standings.indexOf(eW)/er.m)+1),clearTimeout(eG.current),e0(null),requestAnimationFrame(()=>{var e;null==(e=e_.current)||e.scrollIntoView({block:"nearest"}),e0(eW.steamId),eG.current=setTimeout(()=>e0(null),900)}))},e5=(0,a.useCallback)((e,t)=>ef(null!=t?t:null),[]),e2=(0,a.useCallback)(()=>ef(null),[]),e9=eR?er.m:eZ.length||4,e6=eU.length>0?F("pagination.showing_range").replace(/\{FIRST\}/g,(eJ-1)*er.m+1).replace(/\{LAST\}/g,Math.min(eJ*er.m,eU.length)).replace(/\{TOTAL\}/g,eU.length):"",e7=e6||(eQ&&!eR?F("competitions.no_matching_players_title"):"");return(0,r.jsxs)(m.M,{className:"competitions-page",h1:F("competitions.title"),controls:()=>(0,r.jsx)(S,{competitions:eI,selectedId:eS?ew:null,onSelect:ey,loading:eA,showViews:eN,view:eE,onViewChange:eC,latestId:ex}),children:[(0,r.jsx)("div",{className:"competitions-body",children:(()=>{var e;if("error"===Y.status)return(0,r.jsx)(es,{message:F("competitions.load_failed"),onRetry:Y.retry,label:F("common.try_again")});if("ready"===Y.status&&0===K.length)return(0,r.jsx)(v.RV,{variant:"information",className:"competitions-callout",children:(0,r.jsxs)("span",{className:"competitions-callout-text",children:[(0,r.jsx)("span",{className:"competitions-callout-title",children:F("competitions.no_competitions_title")}),(0,r.jsx)("span",{children:F("competitions.no_competitions_body")})]})});if(!eA&&!eS){let e="past"===eE?"no_past":"no_ongoing",t="past"===eE?"ongoing":"past";return(0,r.jsxs)(v.RV,{variant:"information",className:"competitions-callout",children:[(0,r.jsxs)("span",{className:"competitions-callout-text",children:[(0,r.jsx)("span",{className:"competitions-callout-title",children:F("competitions.".concat(e,"_title"))}),(0,r.jsx)("span",{children:F("competitions.".concat(e,"_body"))})]}),(0,r.jsx)(g.X,{variant:"small",className:"secondary competitions-callout-action",onClick:()=>eC(t),children:F("past"===eE?"competitions.view_ongoing":"competitions.view_past")})]})}let t="error"===eL.status&&0===eL.scenarios.length,n="competitions-section-title".concat(P?" neo-sr-only":""),a=P?{role:"tabpanel"}:null,l=(0,r.jsx)(C.t,{competition:eA?null:eb,signedIn:z,schedulesLoading:"ready"!==X.status,now:W,playerCount:eL.standings.length,scenarioCount:eM,statsLoading:eR}),s=(0,r.jsxs)("section",{className:"competitions-section competitions-scenarios","aria-labelledby":"
1competitions-scenarios-title",...a,children:[(0,r.jsx)("h3",{id:"competitions-scenarios-title",className:n,children:F("competitions.scenarios")}),t?(0,r.jsx)(es,{message:F("competitions.competition_failed"),onRetry:eL.retry,label:F("common.try_again")}):(0,r.jsx)(h.dr,{columns:eD,staticData:eL.scenarios,rowKey:"name",hideHeader:!0,loading:eA||"loading"===eL.status,fixedHeight:Math.min(Math.max(eL.scenarios.length,2),10)*B,resetScrollKey:ew})]}),o=(0,r.jsx)(L.D,{rows:eU,scenarioNames:ez,locale:H,loading:eR,currentUser:R}),i=(0,r.jsxs)("section",{ref:eB,className:"competitions-section competitions-overall","aria-labelledby":"competitions-overall-title",style:{"--competitions-list-min":"".concat(6*eF,"px")},...a,children:[(0,r.jsxs)("div",{className:"competitions-overall-head",children:[(0,r.jsxs)("div",{className:"competitions-overall-heading",children:[(0,r.jsx)("h3",{id:"competitions-overall-title",className:n,children:F("competitions.overall")}),(0,r.jsx)("p",{className:"competitions-hint",children:F("competitions.points_hint")}),(0,r.jsx)("p",{className:"competitions-range",children:e6}),(0,r.jsx)("p",{className:"neo-sr-only",role:"status",children:e7})]}),(0,r.jsxs)("div",{className:"competitions-overall-tools",children:[eW?(0,r.jsx)(g.X,{variant:"small",className:"secondary",icon:(0,r.jsx)(y.I,{name:"search",size:18}),onClick:e1,children:F("global_leaderboards.find_me")}):null,(0,r.jsx)(x.L,{className:"competitions-search",value:eu,onChange:ej,placeholder:F("competitions.filter_standings"),disabled:0===eL.standings.length})]})]}),"ready"===eL.status&&eL.failedScenarios.length>0?(0,r.jsx)(v.RV,{variant:"warning",className:"competitions-callout",children:(0,r.jsx)("span",{className:"competitions-callout-text",children:F("competitions.partial_failed").replace(/\{NAME\}/g,new Intl.ListFormat(H,{type:"conjunction"}).format(eL.failedScenarios))})}):null,"error"===eL.status?(0,r.jsx)(es,{message:F("competitions.competition_failed"),onRetry:eL.retry,label:F("common.try_again")}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"competitions-standings",children:(0,r.jsx)(h.dr,{className:eO?"neo-dt--fits neo-dt--browse":"neo-dt--fits",columns:eY,staticData:eZ,rowKey:"steamId",itemHeight:eO?er.H:void 0,loading:eR,fixedHeight:e9*eF,rowStateResolver:eq,arrivalId:e$,resetScrollKey:"".concat(ew,"-").concat(eJ),selectable:!0,selectedId:null!=(e=null==eh?void 0:eh.steamId)?e:null,onSelectId:e5,emptyState:eQ?(0,r.jsx)(f.P,{title:F("competitions.no_matching_players_title"),body:F("competitions.no_matching_players_body"),action:(0,r.jsx)(g.X,{variant:"small",className:"secondary",onClick:()=>ej(""),children:F("common.clear_filter")})}):(0,r.jsx)(f.P,{title:F("competitions.no_standings_title"),body:F("competitions.no_standings_body")})})}),eR?(0,r.jsx)(b.MU,{className:"competitions-pagination"}):eU.length>er.m?(0,r.jsx)(b.fV,{className:"competitions-pagination",variant:"bottom",currentPage:eJ,totalItems:eU.length,pageSize:er.m,onChoosePage:ep}):null]})]});return P?t?(0,r.jsxs)(r.Fragment,{children:[l,s]}):(0,r.jsxs)(r.Fragment,{children:[l,o,(0,r.jsx)("div",{className:"competitions-tabs",children:(0,r.jsx)(w.B,{tabs:eK,selectedValue:eK[+("scenarios"===ev)],onSelect:e=>eg(e===eK[1]?"scenarios":"standings")})}),"scenarios"===ev?s:i]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(p.xA,{cols:{base:1,1200:2},className:"competitions-top",children:[l,s]}),t?null:(0,r.jsxs)(r.Fragment,{children:[o,i]})]})})()}),(0,r.jsx)(D,{player:eh,scenarioNames:ez,locale:H,onClose:e2,asSheet:P})]})})},20982:()=>{},21547:(e,t,n)=>{"use strict";n.d(t,{RV:()=>i});var r=n(95155);n(12115);var a=n(67106);let l=new Set(["error","warning","success","information"]),s={error:"x",warning:"danger",success:"check",information:"info"},o=function(){let{variant:e="error",inline:t,page:n,className:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return["neo-callout",l.has(e)&&"error"!==e?"neo-callout--".concat(e):null,t?"neo-callout--inline":null,n?"neo-callout--page":null,r].filter(Boolean).join(" ")},i=e=>
1{let{variant:t="error",inline:n=!1,page:i=!1,icon:c,className:u,children:d,...m}=e,p=!1===c?null:null!=c?c:(0,r.jsx)(a.I,{name:s[l.has(t)?t:"error"],className:"neo-callout-icon"});return(0,r.jsxs)("div",{className:o({variant:t,inline:n,page:i,className:u}),role:"status",...m,children:[p,d]})}},29562:(e,t,n)=>{"use strict";n.d(t,{AZ:()=>v,IY:()=>g,RO:()=>b,kn:()=>w,sq:()=>y});var r=n(95155),a=n(12115),l=n(47650),s=n(12758),o=n.n(s),i=n(11867),c=n(67950);n(53553);let u=0,d=null,m=["top","bottom","left","right"],p={top:"y",bottom:"y",left:"x",right:"x"},h=a.useLayoutEffect,f=e=>{var t;let{label:n,side:s="top",delay:o=350,disabled:f=!1}=e,[v,g]=(0,a.useState)(!1),[b,w]=(0,a.useState)(null),[x,y]=(0,a.useState)({side:s,top:0,left:0,arrowLeft:null,arrowTop:null}),[j,k]=(0,a.useState)(!1),[N,E]=(0,i.d)(),I=(0,a.useRef)(null),S=(0,a.useRef)(null),C=(0,a.useRef)(!1),L=(0,a.useRef)(!1),A=(0,a.useId)();(0,a.useEffect)(()=>w(document.getElementById("dropdown-container")),[]),(0,a.useEffect)(()=>()=>clearTimeout(S.current),[]);let R=(0,a.useCallback)(()=>{C.current=!0,L.current=!1,g(!0)},[]),_=(0,a.useCallback)((e,t)=>{if(f||!(null!=t?t:n))return;clearTimeout(S.current);let r=performance.now()-u<400;if(!e||r)return void R();S.current=setTimeout(R,o)},[f,n,o,R]),M=(0,a.useCallback)(()=>{if(clearTimeout(S.current),C.current){u=performance.now(),C.current=!1;let e=I.current;d=e?(e=>{var t,n;let r=e.getBoundingClientRect(),a=null==(t=e.offsetParent)?void 0:t.getBoundingClientRect();return{left:r.left-(a?a.left:-window.scrollX),top:r.top-(a?a.top:-window.scrollY),width:r.width,height:r.height,side:null!=(n=m.find(t=>e.classList.contains("neo-tooltip--".concat(t))))?n:"top"}})(e):null}k(!1),g(!1)},[]);(0,a.useEffect)(()=>{if(!v)return;let e=e=>{"Escape"===e.key&&M()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v,M]);let T=(0,a.useCallback)(()=>{let e,t,n,r=I.current;if(!r||!v)return;if(!E)return void k(!0);let{offsetWidth:a,offsetHeight:l}=r,o=(e,t,n,r,a)=>{let l=e+t/2,s=l-n/2,o=Math.max(r+8,Math.min(s,r+a-n-8));if(.5>=Math.abs(o-s))return[o,null];let i=n-14,c=i>14?Math.max(14,Math.min(l-o,i)):null;return[o,c]},i=null,c=null;if("x"===p[s]){let r=E.left-window.scrollX,i=r+E.width,u=r-12-8,d=window.innerWidth-i-12-8;n="left"==(e="left"===s?u<a&&d>u?"right":"left":d<a&&u>d?"left":"right")?E.left-a-12:E.left+E.width+12,[t,c]=o(E.top,E.bottom-E.top,l,window.scrollY,window.innerHeight)}else{let r=E.top-window.scrollY,c=E.bottom-window.scrollY,u=r-12-8,d=window.innerHeight-c-12-8;t="top"==(e="top"===s?u<l&&d>u?"bottom":"top":d<l&&u>d?"top":"bottom")?E.top-l-12:E.bottom+12,[n,i]=o(E.left,E.width,a,window.scrollX,window.innerWidth)}y(r=>r.side===e&&r.top===t&&r.left===n&&r.arrowLeft===i&&r.arrowTop===c?r:{side:e,top:t,left:n,arrowLeft:i,arrowTop:c}),k(!0)},[v,E,s]);h(T),h(()=>{let e=I.current;if(!e||!j||L.current||(L.current=!0,!d||performance.now()-u>400||window.matchMedia("(prefers-reduced-motion: reduce)").matches||d.side!==x.side||Math.round(d.height)!==e.offsetHeight))return;let t=d.left+d.width/2-(e.offsetLeft+e.offsetWidth/2),n=d.top-e.offsetTop;(t||n)&&(Math.hypot(t,n)>320||(e.style.animation="none",e.animate([{translate:"".concat(t,"px ").concat(n,"px")},{translate:"0px 0px"}],c.l_)))},[j]),(0,a.useEffect)(()=>{if(!v)return;let e=0,t=()=>{e||(e=requestAnimationFrame(()=>{e=0,T()}))};return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{e&&cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[v,T]);let P=v&&!!n&&!f;return{show:_,hide:M,setAnchorRef:N,bubble:P&&b&&l.createPortal((0,r.jsxs)("div",{ref:I,id:A,role:"tooltip",className:"neo-tooltip neo-tooltip--".concat(x.side),style:{top:x.top,left:x.left,visibility:j?void 0:"hidden"},children:[n,(null!=(t=x.arrowLeft)?t:x.arrowTop)!=null&&(0,r.jsx)("span",{className:"neo-tooltip-arrow","aria-hidden":"true",style:null!=x.arrowTop?{top:x.arrowTop}:{left:x.arrowLeft}})]}),b),tooltipId:A,showTooltip:P}},v=e=>{var t;let{label:n,children:l,side:s="top",delay:o=350,disabled:i=!1}=e,{show:c,hide:u,setAnchorRef:d,bubble:m,tooltipId:p,showTooltip:h}=f({label:n,side:s,delay:o,disabled:i});if(!(0,a.isValidElement)(l))return null!=l?l:null;let v=null==(t=l.props)?void 0:t.ref,g=(0,a.cloneElement)(l,{ref:e=>{d(e),"function"==typeof v?v(e):v&&"object"==typeof v&&(v.current=e)},"aria-describedby":h?p:l.props["aria-describedby"],onMouseEnter:e=>{var t,n;null==(t=(n=l.props).onMouseEnter)||t.call(n,e),c(!0)},onMouseLeave:e=>{var t,n;null==(t=(n=l.props).onMouseLeave)||t.call(n,e),u()},onFocus:e=>{var t,n,r,a;null==(t=(n=l.props).onFocus)||t.call(n,e),(null==(r=(a=e.target).matches)?void 0:r.call(a,":focus-visible"))&&c(!1)},onBlur:e=>{var t,n;null==(t=(n=l.props).onBlur)||t.call(n,e),u()},onPointerDown:e=>{var t,n;null==(t=(n=l.props).onPointerDown)||t.call(n,e),u()}});return(0,r.jsxs)(r.Fragment,{children:[g,m]})},g="data-tooltip",b="data-tooltip-truncated",w="data-tooltip-tap",x="data-tooltip-host",y=e=>{let{children:t,side:n="top",delay:l=350,className:s=""}=e,[o,i]=(0,a.useState)(null),c=(0,a.useRef)(null),u=(0,a.useRef)(null),{show:d,hide:m,setAnchorRef:p,bubble:h}=f({label:o,side:n,delay:l}),v=(0,a.useCallback)(()=>{u.current=null,m()},[m]);return(0,a.useEffect)(()=>
1{let e=c.current;if(!e)return;let t=t=>{if(!(null==t?void 0:t.closest))return null;let n=t.closest("[".concat(g,"]")),r=!n&&t.closest("[".concat(b,"]")),a=n?{el:n,text:n.getAttribute(g)}:r&&r.scrollWidth>r.clientWidth+1?{el:r,text:r.textContent.trim()}:null;return a&&a.el.closest("[".concat(x,"]"))===e?a:null},n=(e,t)=>{e.el!==u.current&&(u.current=e.el,p(e.el),i(e.text),d(t,e.text))},r=e=>{if("touch"===e.pointerType)return;let r=t(e.target);if(!r){u.current&&v();return}n(r,!0)},a=e=>{var r,a;if(!(null==(r=(a=e.target).matches)?void 0:r.call(a,":focus-visible")))return;let l=t(e.target);l&&n(l,!1)},l=e=>{let t=u.current;t&&t.contains(e.target)&&!t.contains(e.relatedTarget)&&v()},s="mouse",o=null,m=e=>{s=e.pointerType,o=u.current,v()},h=e=>{if("mouse"===s||0===e.detail)return;let r=t(e.target);r&&r.el.hasAttribute(w)&&r.el!==o&&n(r,!1)},f=t=>{u.current&&!e.contains(t.target)&&v()},y=e=>{let t=u.current;t&&(e.relatedTarget&&t.contains(e.relatedTarget)||v())};return e.addEventListener("pointerover",r),e.addEventListener("pointerout",y),e.addEventListener("pointerdown",m),e.addEventListener("click",h),e.addEventListener("focusin",a),e.addEventListener("focusout",l),document.addEventListener("pointerdown",f,!0),()=>{e.removeEventListener("pointerover",r),e.removeEventListener("pointerout",y),e.removeEventListener("pointerdown",m),e.removeEventListener("click",h),e.removeEventListener("focusin",a),e.removeEventListener("focusout",l),document.removeEventListener("pointerdown",f,!0)}},[d,v,p]),(0,r.jsxs)("div",{ref:c,className:s||void 0,[x]:"",children:[t,h]})};y.propTypes={children:o().node,side:o().oneOf(m),delay:o().number,className:o().string},v.propTypes={label:o().node,children:o().element,side:o().oneOf(m),delay:o().number,disabled:o().bool}},34801:(e,t,n)=>{"use strict";n.d(t,{k:()=>o});var r=n(95155),a=n(12115),l=n(50546),s=n(67106);n(20982);let o=(0,l.PA)(e=>{let{placeholder:t,onInput:n,className:l,icon:o="search",variant:i="small",label:c=null,style:u,value:d,invalid:m=!1,errorMessage:p=null,type:h="text",id:f,trailing:v=null,inputRef:g=null,...b}=e,{"aria-describedby":w,disabled:x,...y}=b,j=(0,a.useRef)(null),[k,N]=(0,a.useState)(!1),E="password"===h,I=(0,a.useId)(),S=f||I,C="".concat(S,"-error"),L=m||!!p,A=[w,p?C:null].filter(Boolean).join(" ")||void 0;return(0,r.jsxs)("div",{className:"text-input-container ".concat(l||""," ").concat(L?"invalid":""," ").concat(x?"disabled":""),style:u,children:[c&&(0,r.jsx)("label",{htmlFor:S,children:c}),(0,r.jsxs)("div",{className:"text-input ".concat(i," ").concat(l||""),onClick:()=>{var e;x||null==(e=j.current)||e.focus()},children:[o&&(0,r.jsx)(s.I,{name:o}),(0,r.jsx)("input",{id:S,type:E?k?"text":"password":h,placeholder:t,onInput:n,ref:e=>{j.current=e,"function"==typeof g?g(e):g&&(g.current=e)},...void 0!==d?{value:d}:{},...!y.onChange&&n?{onChange:n}:{},"aria-invalid":L||void 0,"aria-describedby":A,disabled:x,...y}),v,E&&(0,r.jsx)("button",{type:"button",className:"password-toggle",disabled:x,onClick:()=>N(!k),"aria-label":k?"Hide password":"Show password",children:(0,r.jsx)(s.I,{name:k?"eye-off":"eye"})})]}),p&&(0,r.jsx)("p",{className:"text-input-error",id:C,children:p})]})})},35380:(e,t,n)=>{"use strict";n.d(t,{m:()=>w});var r=n(95155),a=n(12115),l=n(12758),s=n.n(l),o=n(91996),i=n(93736),c=n(5459),u=n(11867),d=n(67106),m=n(69235);n(95199);let p={keys:["name"],includeScore:!0},h=e=>{let{hideHandle:t,toggleProps:n,label:a="Show options"}=e;if(t)return null;let l=(0,r.jsx)(d.I,{name:"chevron_vertical",size:16,className:"neo-dropdown-chevron"});return n?(0,r.jsx)("button",{type:"button",className:"neo-dropdown-handle","aria-label":a,...n,children:l}):l},f=e=>{let{ItemComponent:t,resolved:n,label:a,isPlaceholder:l}=e;return t&&n?(0,r.jsx)(t,{item:n,className:"neo-dropdown-value"}):(0,r.jsx)("span",{className:"neo-dropdown-value ".concat(l?"placeholder":""),children:a})},v=e=>{let{isOpen:t,disabled:n,className:a,anchor:l,children:s}=e;return(0,r.jsx)("div",{ref:l,className:"neo-dropdown ".concat(t?"open":""," ").concat(n?"disabled":""," ").concat(a),children:s})},g=e=>{let{items:t,resolved:n,label:l,isPlaceholder:s,onSelect:i,disabled:c,ItemComponent:u,hideHandle:d,className:p,emptyLabel:g,anchor:b,anchorPos:w,refreshAnchor:x,ariaLabel:y,size:j}=e,{isOpen:k,highlightedIndex:N,getItemProps:E,getMenuProps:I,getToggleButtonProps:S}=(0,o.useSelect)({items:t,selectedItem:n,onSelectedItemChange:e=>{let{selectedItem:t}=e;return i(t)},itemToString:e=>{var t;return null!=(t=null==e?void 0:e.name)?t:""}}),C=I({},{suppressRefError:!0});return(0,a.useEffect)(()=>{k&&x()}
1,[k,x]),(0,r.jsxs)(v,{isOpen:k,disabled:c,className:p,anchor:b,children:[(0,r.jsxs)("button",{type:"button",...S({disabled:c,"aria-label":y,className:"neo-dropdown-trigger size-".concat(j," ").concat(d?"bare":"")}),children:[(0,r.jsx)(f,{ItemComponent:u,resolved:n,label:l,isPlaceholder:s}),(0,r.jsx)(h,{hideHandle:d})]}),(0,r.jsx)(m.Q,{items:t,ItemComponent:u,highlightedIndex:N,selectedValue:null==n?void 0:n.value,getItemProps:E,menuProps:C,anchorPos:w,isOpen:k,emptyLabel:g})]})},b=e=>{let{items:t,resolved:n,placeholder:l,onSelect:s,disabled:i,setQuery:c,ItemComponent:u,hideHandle:d,className:p,emptyLabel:f,anchor:g,anchorPos:b,refreshAnchor:w,ariaLabel:x,filterLabel:y,showOptionsLabel:j,size:k,highlightQuery:N}=e,E=(0,a.useRef)(null),{isOpen:I,highlightedIndex:S,getItemProps:C,getMenuProps:L,getInputProps:A,getToggleButtonProps:R}=(0,o.useCombobox)({items:t,selectedItem:n,onInputValueChange:e=>{let{inputValue:t}=e;return c(null!=t?t:"")},onIsOpenChange:e=>{let{isOpen:t}=e;t&&c("")},onSelectedItemChange:e=>{let{selectedItem:t}=e;return s(t)},itemToString:e=>{var t;return null!=(t=null==e?void 0:e.name)?t:""},stateReducer:(e,t)=>{let{type:n,changes:r}=t;return n===o.useCombobox.stateChangeTypes.InputChange?{...r,highlightedIndex:r.inputValue?0:-1}:r}}),_=L({},{suppressRefError:!0});(0,a.useEffect)(()=>{var e,t,r;if(!I){E.current&&(E.current.value=null!=(r=null==n?void 0:n.name)?r:"");return}w(),null==(e=E.current)||e.focus(),null==(t=E.current)||t.select()},[I,w,n]);let M=!!(!I&&u&&n);return(0,r.jsxs)(v,{isOpen:I,disabled:i,className:p,anchor:g,children:[(0,r.jsxs)("div",{className:"neo-dropdown-trigger size-".concat(k),children:[(0,r.jsx)("input",{...A({ref:E,disabled:i,placeholder:l,"aria-label":x||l||(null==n?void 0:n.name)||y,className:"neo-dropdown-input ".concat(M?"masked":"")})}),M?(0,r.jsx)(u,{item:n,className:"neo-dropdown-selected-item"}):null,(0,r.jsx)(h,{hideHandle:d,toggleProps:R({disabled:i}),label:j})]}),(0,r.jsx)(m.Q,{items:t,ItemComponent:u,highlightedIndex:S,selectedValue:null==n?void 0:n.value,getItemProps:C,menuProps:_,anchorPos:b,isOpen:I,highlightQuery:N,emptyLabel:f})]})},w=e=>{var t,n;let{options:l=[],value:s,onChange:o,placeholder:d="",disabled:m=!1,searchable:h=!1,ItemComponent:f=null,selectedItem:v,hideHandle:w=!1,fill:x=!0,className:y="",emptyLabel:j=null,ariaLabel:k,size:N="xs"}=e,{i18n:E}=(0,c.e)(),[I,S,,C]=(0,u.d)(),[L,A]=(0,a.useState)(""),R=(0,a.useMemo)(()=>new i.A(l,p),[l]),_=(0,a.useMemo)(()=>h&&L?R.search(L).map(e=>e.item):l,[h,L,l,R]),M=null!=(t=null!=v?v:l.find(e=>e.value===s))?t:null,T=!(null==M?void 0:M.name),P=null!=(n=null==M?void 0:M.name)?n:d,B={items:_,resolved:M,label:P,isPlaceholder:T,placeholder:d,onSelect:e=>{e&&(A(""),null==o||o(e))},disabled:m,ItemComponent:f,hideHandle:w,anchor:I,anchorPos:S,refreshAnchor:C,emptyLabel:L?E.getString("common.no_matches_for").replace(/\{QUERY\}/g,L):null!=j?j:E.getString("common.no_results"),ariaLabel:k,size:N,highlightQuery:L,filterLabel:E.getString("common.filter_options"),showOptionsLabel:E.getString("common.show_options"),className:"".concat(x?"fill":""," ").concat(y).trim()};return h?(0,r.jsx)(b,{...B,setQuery:A}):(0,r.jsx)(g,{...B})};w.propTypes={options:s().arrayOf(s().shape({value:s().any,name:s().node})),value:s().any,onChange:s().func,placeholder:s().string,disabled:s().bool,searchable:s().bool,ItemComponent:s().elementType,selectedItem:s().object,hideHandle:s().bool,fill:s().bool,className:s().string,emptyLabel:s().string,ariaLabel:s().string,size:s().oneOf(["xs","sm","md","lg"])}},38490:(e,t,n)=>{"use strict";n.d(t,{z:()=>l});var r=n(95155),a=n(12115);let l=e=>{let{value:t,query:n}=e,l=String(null!=t?t:""),s=String(null!=n?n:"").trim();if(!s)return l;let o=l.toLocaleLowerCase(),i=s.toLocaleLowerCase(),c=[],u=0,d=o.indexOf(i);for(;-1!==d;)d>u&&c.push({text:l.slice(u,d),match:!1}),c.push({text:l.slice(d,d+s.length),match:!0}),u=d+s.length,d=o.indexOf(i,u);return 0===u?l:(u<l.length&&c.push({text:l.slice(u),match:!1}),(0,r.jsx)("span",{children:c.map((e,t)=>e.match?(0,r.jsx)("span",{className:"neo-dropdown-match",children:e.text},"match-"+t):(0,r.jsx)(a.Fragment,{children:e.text},"text-"+t))}))}},45920:(e,t,n)=>{"use strict";n.d(t,{n:()=>s});let r="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,a=new Map;function l(e){let t=a.get(e);t&&(t.count-=1,!(t.count>0)&&(a.delete(e),t.wasInert||e.removeAttribute("inert"),r||(null===t.priorAriaHidden?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t.priorAriaHidden))))}
1function s(e){let t=(Array.isArray(e)?e:[e]).filter(Boolean);if(0===t.length||"undefined"==typeof document)return()=>{};let n=new Set;t.forEach(e=>{for(let t=e;t&&t!==document.body;t=t.parentElement)n.add(t)});let s=[];return n.forEach(e=>{var t;let l=null==(t=e.parentElement)?void 0:t.children;l&&Array.from(l).forEach(e=>{n.has(e)||s.includes(e)||(s.push(e),function(e){let t=a.get(e);if(t){t.count+=1;return}a.set(e,{count:1,wasInert:e.hasAttribute("inert"),priorAriaHidden:e.getAttribute("aria-hidden")}),e.setAttribute("inert",""),r||e.setAttribute("aria-hidden","true")}(e))})}),()=>s.forEach(l)}},53553:()=>{},56153:()=>{},59012:(e,t,n)=>{"use strict";n.d(t,{P:()=>s});var r=n(95155);n(12115);var a=n(12758),l=n.n(a);let s=e=>{let{title:t,body:n,action:a}=e;return(0,r.jsxs)(r.Fragment,{children:[t?(0,r.jsx)("span",{className:"neo-empty-title",children:t}):null,n?(0,r.jsx)("span",{className:"neo-empty-body",children:n}):null,a?(0,r.jsx)("span",{className:"neo-empty-action",children:a}):null]})};s.propTypes={title:l().node,body:l().node,action:l().node}},60965:(e,t,n)=>{"use strict";n.d(t,{u:()=>u});var r=n(95155),a=n(12115),l=n(47650),s=n(67106),o=n(45920);n(67339);let i={position:"fixed",width:0,height:0,opacity:0,pointerEvents:"none"},c=e=>[...e.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), iframe, audio[controls], video[controls], details > summary, [tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("data-neo-modal-sentinel")),u=e=>{let{open:t,onClose:n=()=>{},label:u,titleId:d,descriptionId:m,showClose:p=!1,closeLabel:h="Close",dismissOnBackdrop:f=!0,portalId:v="modal",className:g="",children:b,...w}=e,x=(0,a.useRef)(null),[y,j]=(0,a.useState)(null),[k,N]=function(e){let{animationName:t,timeout:n=400}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[r,l]=(0,a.useState)(!1),s=(0,a.useRef)(null);return(0,a.useEffect)(()=>()=>clearTimeout(s.current),[]),[r,(0,a.useCallback)(r=>{let a=e.current,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!a||o){l(!1),r();return}l(!0);let i=!1,c=()=>{i||(i=!0,a.removeEventListener("animationend",u),clearTimeout(s.current),l(!1),r())};function u(e){e.target===a&&(t&&e.animationName!==t||c())}a.addEventListener("animationend",u),s.current=setTimeout(c,n)},[e,t,n])]}(x,{animationName:"neoModalOverlayOut",timeout:400});(0,a.useEffect)(()=>{j(document.getElementById(v)||document.body)},[v]);let E=()=>N(n);return((0,a.useEffect)(()=>{if(!t||!y)return;let e=x.current;if(!e)return;let n=document.activeElement,r=(0,o.n)([e,document.getElementById("dropdown-container")]),a=t=>{if("Escape"===t.key)return void E();if("Tab"!==t.key)return;let n=c(e);if(0===n.length){t.preventDefault(),e.focus();return}let r=n[0],a=n[n.length-1];if(!e.contains(document.activeElement)){t.preventDefault(),r.focus();return}t.shiftKey?(document.activeElement===r||document.activeElement===e)&&(t.preventDefault(),a.focus()):(document.activeElement===a||document.activeElement===e)&&(t.preventDefault(),r.focus())};return document.addEventListener("keydown",a),e.focus(),()=>{document.removeEventListener("keydown",a),r(),(null==n?void 0:n.isConnected)&&n.focus()}},[t,y]),t&&y)?l.createPortal((0,r.jsxs)("div",{ref:x,role:"dialog","aria-modal":"true","aria-label":d?void 0:u,"aria-labelledby":d,"aria-describedby":m,tabIndex:-1,className:"neo-modal-overlay ".concat(k?"closing":""," ").concat(g).trim(),onClick:e=>{f&&e.target===x.current&&E()},...w,children:[(0,r.jsx)("div",{"data-neo-modal-sentinel":"",tabIndex:0,style:i,onFocus:()=>{var e;let t=x.current;if(!t)return;let n=c(t);(null!=(e=n[n.length-1])?e:t).focus()}}),p&&(0,r.jsx)("button",{type:"button",className:"neo-modal-close neo-modal-close--overlay","aria-label":h,onClick:E,children:(0,r.jsx)(s.I,{name:"x",size:20})}),"function"==typeof b?b({requestClose:E}):b,(0,r.jsx)("div",{"data-neo-modal-sentinel":"",tabIndex:0,style:i,onFocus:()=>{let e=x.current;if(!e)return;let[t]=c(e);(null!=t?t:e).focus()}})]}),y):null}},62796:(e,t,n)=>{"use strict";n.d(t,{S:()=>a});var r=n(12115);let a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2?arguments[2]:void 0,a=(0,r.useRef)(""),l=(0,r.useRef)(),s=(0,r.useRef)(),o=function(r){let i=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return i?(a.current=r,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{o(a.current,!1)},t),new Promise((e,t)=>
1{s.current=e})):void(n(!0),e(a.current).then(e=>{n(!1),s.current(e)}))};return{search:o}}},67339:()=>{},69079:()=>{},69235:(e,t,n)=>{"use strict";n.d(t,{Q:()=>d});var r=n(95155),a=n(12115),l=n(47650),s=n(12758),o=n.n(s),i=n(4284),c=n(38490);n(95199);let u=a.useLayoutEffect,d=e=>{let{items:t,ItemComponent:n,highlightedIndex:s,selectedValue:o,getItemProps:d,menuProps:m,anchorPos:p,isOpen:h,emptyLabel:f,note:v=null,pending:g=!1,onEndReached:b=null,endReachedThreshold:w=48,stableWidth:x=!1,highlightQuery:y=""}=e,[j,k]=(0,a.useState)(null),[N,E]=(0,a.useState)(!1),[I,S]=(0,a.useState)({side:"bottom",height:0,maxHeight:null}),[C,L]=(0,a.useState)(null),A=(0,a.useRef)(null),R=(0,a.useRef)(null),_=(0,a.useRef)(!1);(0,a.useEffect)(()=>k(document.getElementById("dropdown-container")),[]),(0,a.useEffect)(()=>{if(h){_.current=!0,E(!1);return}if(!_.current)return;E(!0);let e=setTimeout(()=>{E(!1),_.current=!1},220);return()=>clearTimeout(e)},[h]);let M=h||N,{ref:T,onAnimationEnd:P,...B}=m,H=(0,a.useCallback)(()=>{let e=A.current;if(!e||!h||!p)return;if(null==R.current){let t=parseFloat(window.getComputedStyle(e).maxHeight);R.current=Number.isFinite(t)?t:1/0}let t=R.current,n=Math.min(e.scrollHeight,t),r=p.top-window.scrollY,a=p.bottom-window.scrollY,l=window.innerHeight-a-14-8,s=r-14-8,o=l<n&&s>l?"top":"bottom",i="top"===o?s:l,c=i<n?Math.max(96,Math.min(i,t)):null,u=null==c?n:Math.min(n,c);S(e=>e.side===o&&e.maxHeight===c&&e.height===u?e:{side:o,maxHeight:c,height:u})},[h,p]);u(H),(0,a.useEffect)(()=>{if(!h)return;let e=0,t=()=>{e||(e=requestAnimationFrame(()=>{e=0,H()}))};return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{e&&cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[h,H]);let O=p?{minWidth:p.width,...x?{maxWidth:"calc(100vw - 16px)"}:null,...x&&null!=C?{width:C}:null,left:p.left,top:"top"===I.side?p.top-I.height-14:p.bottom+14,transformOrigin:"top"===I.side?"bottom left":"top left",...null!=I.maxHeight?{maxHeight:I.maxHeight}:null}:void 0;u(()=>{if(!x){null!=C&&L(null);return}if(!h){_.current||null==C||L(null);return}if(p&&A.current){if(null!=C){p.width>C&&L(p.width);return}t.length&&L(Math.max(p.width,320,A.current.scrollWidth))}},[p,h,t.length,C,x]);let F=(0,r.jsxs)("ul",{ref:e=>{A.current=e,"function"==typeof T?T(e):T&&(T.current=e)},className:"neo-dropdown-list ".concat(M?"open":""," ").concat(N?"closing":""," ").concat("top"===I.side?"flipped":""," ").concat(x?"stable-width":""),"aria-busy":g?"true":void 0,style:O,...B,onScroll:e=>{var t;if(null==(t=B.onScroll)||t.call(B,e),!b)return;let n=e.currentTarget;n.scrollHeight-n.scrollTop-n.clientHeight<=w&&b()},"aria-hidden":N?"true":B["aria-hidden"],onAnimationEnd:e=>{null==P||P(e),e.target===e.currentTarget&&N&&(E(!1),_.current=!1)},children:[M&&!g&&0===t.length?(0,r.jsx)("li",{className:"neo-dropdown-empty",children:f}):null,M&&t.map((e,t)=>{var a,l,i,u;let m=["neo-dropdown-item",s===t?"highlighted":"",void 0!==e.value&&e.value===o?"selected":""].filter(Boolean).join(" "),p=null!=(l=null!=(a=null==e?void 0:e.name)?a:null==e?void 0:e.username)?l:null==e?void 0:e.steamAccountName,h={...d({item:e,index:t,className:m}),...p?{title:p}:{}},f=null!=(u=null!=(i=e.value)?i:e.id)?u:"neo-dd-".concat(t);return n?(0,r.jsx)(n,{item:e,...h,...y?{highlightQuery:y}:{}},f):(0,r.jsx)("li",{...h,children:(0,r.jsx)("span",{className:"neo-dropdown-item-label",children:(0,r.jsx)(c.z,{value:e.name,query:y})})},f)}),M&&v?(0,r.jsx)("li",{className:"neo-dropdown-note","aria-live":"polite",children:v}):null,M&&g?(0,r.jsx)("li",{className:t.length||v?"neo-dropdown-note":"neo-dropdown-empty","aria-hidden":"true",style:{display:"flex",justifyContent:"center"},children:(0,r.jsx)(i._,{size:20})}):null]});return j?l.createPortal(F,j):null};d.propTypes={items:o().array.isRequired,ItemComponent:o().elementType,highlightedIndex:o().number,selectedValue:o().any,getItemProps:o().func.isRequired,menuProps:o().object.isRequired,anchorPos:o().object,isOpen:o().bool,emptyLabel:o().node,note:o().node,pending:o().bool,onEndReached:o().func,endReachedThreshold:o().number,stableWidth:o().bool,highlightQuery:o().string}}
1,76802:(e,t,n)=>{"use strict";n.d(t,{K:()=>l});var r=n(12115);let a=r.useLayoutEffect;function l(e){let[t,n]=(0,r.useState)(null),[l,s]=(0,r.useState)(null);return a(()=>{if(!t)return;let n=()=>s(t.getBoundingClientRect().width>=e);n();let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},[t,e]),[n,l]}},92262:(e,t,n)=>{"use strict";n.d(t,{X:()=>u});var r=n(95155),a=n(12115),l=n(52619),s=n.n(l),o=n(67106),i=n(67950),c=n(29562);n(11765);let u=e=>{let{options:t,selectedValue:n,onChange:l,onClick:u,className:d="",leftLabel:m,ariaLabel:p,size:h="xs",...f}=e,v=(0,a.useId)(),g=(0,a.useRef)(null),b=(0,a.useRef)(null),w=(0,a.useRef)([]),x=(0,a.useRef)({x:0,w:0}),[y,j]=(0,a.useState)(!1),k=t.length>0&&t.every(e=>e.href),N=()=>{var e;let r=t.findIndex(e=>e.value===n);if(r<0)return;let a=null==(e=g.current)?void 0:e.querySelectorAll(".option")[r];if(!a||!b.current)return;let{offsetLeft:l,offsetWidth:s}=a,o=x.current;x.current={x:l,w:s},b.current.style.setProperty("--thumb-x","".concat(l,"px")),b.current.style.setProperty("--thumb-w","".concat(s,"px")),!(o.w>0)||o.x===l&&o.w===s||y||window.matchMedia("(prefers-reduced-motion: reduce)").matches||b.current.animate([{transform:"translateX(".concat(o.x,"px) scaleX(").concat(o.w/s,")")},{transform:"translateX(".concat(l,"px) scaleX(1)")}],i.l_)};(0,a.useLayoutEffect)(N,[n,t]);let E=(0,a.useRef)(N);E.current=N,(0,a.useEffect)(()=>{let e=new ResizeObserver(()=>E.current());return g.current&&e.observe(g.current),()=>e.disconnect()},[]),(0,a.useEffect)(()=>{let e=()=>j(!0),t=()=>j(!1);return window.addEventListener("keydown",e,{passive:!0}),window.addEventListener("pointerdown",t,{passive:!0}),()=>{window.removeEventListener("keydown",e),window.removeEventListener("pointerdown",t)}},[]);let I=e=>{null==l||l(e),null==u||u(e)},S=t.findIndex(e=>e.value===n&&!e.disabled),C=t.findIndex(e=>!e.disabled),L=S<0?C:S,A=(e,n)=>{if(C<0)return -1;let r=e;for(let e=0;e<t.length;e+=1)if(r=(r+n+t.length)%t.length,!t[r].disabled)return r;return -1};return(0,r.jsxs)("div",{className:"segmented-select-inline",children:[m&&(0,r.jsx)("span",{className:"neo-control-label",id:v,children:m}),(0,r.jsxs)(k?"nav":"div",{ref:g,className:"segmented-select size-".concat(h," ").concat(d," ").concat(y?"no-motion":""),role:k?void 0:"tablist","aria-labelledby":m?v:void 0,"aria-label":m?void 0:p,onKeyDown:k?void 0:e=>{let n,r=g.current&&"rtl"===getComputedStyle(g.current).direction;switch(e.key){case"ArrowRight":n=A(L,r?-1:1);break;case"ArrowLeft":n=A(L,r?1:-1);break;case"Home":n=C;break;case"End":n=[...t].map(e=>!e.disabled).lastIndexOf(!0);break;default:return}e.preventDefault(),(e=>{var n;let r=t[e];r&&!r.disabled&&(null==(n=w.current[e])||n.focus(),I(r.value))})(n)},...f,children:[(0,r.jsx)("span",{ref:b,className:"thumb"}),t.map((e,t)=>{let{value:l,name:i,icon:u,ariaLabel:d,tooltip:m,disabled:p,href:h}=e,f=k?(0,r.jsxs)(s(),{href:h,"aria-current":n===l?"page":void 0,"aria-disabled":p||void 0,"aria-label":i?void 0:null!=d?d:m,tabIndex:p?-1:void 0,ref:e=>{w.current[t]=e},className:"option ".concat(n===l?"selected":""),onClick:p?e=>e.preventDefault():void 0,children:[u&&(0,r.jsx)(o.I,{name:u}),i&&(0,r.jsx)("span",{className:"label",children:i})]}):(0,r.jsxs)("button",{type:"button",role:"tab","aria-selected":n===l,"aria-disabled":p||void 0,"aria-label":i?void 0:null!=d?d:m,tabIndex:p||t!==L?-1:0,ref:e=>{w.current[t]=e},className:"option ".concat(n===l?"selected":""),onClick:()=>{p||I(l)},children:[u&&(0,r.jsx)(o.I,{name:u}),i&&(0,r.jsx)("span",{className:"label",children:i})]});return m?(0,r.jsx)(c.AZ,{label:m,children:f},l):(0,r.jsx)(a.Fragment,{children:f},l)})]})]})}},95199:()=>{},95259:(e,t,n)=>{"use strict";n.d(t,{j:()=>a});var r=n(12115);function a(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>t(e.matches);return n(),e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),e}},97958:(e,t,n)=>{"use strict";n.d(t,{M:()=>l});var r=n(95125),a=n(738);class l{static async getBenchmarkTemplate(){try{return await r.A.get("".concat(a.nv,"/benchmarks/template"))}catch(e){return e}}static async getPendingBenchmarks(){try{return await r.A.get("".concat(a.nv,"/benchmarks/pending/list"))}catch(e){return e}}static async getPendingBenchmarkById(e){try{return await r.A.get("".concat(a.nv,"/benchmarks/pending/benchmark?benchmarkId=").concat(e))}catch(e){return e}}static async getLiveBenchmarkById(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{return await r.A.get("".concat(a.Pw,"/benchmarks/webapp/benchmark"),{params:{benchmarkId:e}})}catch(e){return e}}static async postBenchmarkJSON(e){try{return await r.A.post("".concat(a.nv,"/benchmarks"),e)}catch(e){return e.response}}static async saveBenchmark(e,t){try{return await r.A.put("".concat(a.nv,"/benchmarks?benchmarkId=").concat(t),e)}catch(e){return e.response}}static async deleteBenchmark(e){try{return await r.A.delete("".concat(a.nv,"/benchmarks/unpublished?benchmarkId=").concat(e))}catch(e){return e.response}}static async submitBenchmark(e,t){try{return await r.A.put("".concat(a.nv,"/benchmarks/status/pending"),{benchmarkId:e,notes:t})}catch(e){return e.response}}static async unpublishBenchmark(e){try{return await r.A.put("".concat(a.nv,"/benchmarks/status/unpublish"),{benchmarkId:e})}catch(e){return e.response}}static async markBenchmarkAsInReview(e){try{return await r.A.put("".concat(a.nv,"/benchmarks/status/in-review"),{benchmarkId:e})}catch(e){return e}}static async approveBenchmark(e,t){try{return await r.A.put("".concat(a.nv,"/benchmarks/status/approved"),{benchmarkId:e,notes:t})}catch(e){return e}}static async rejectBenchmark(e,t){try{return await r.A.put("".concat(a.nv,"/benchmarks/status/rejected"),{benchmarkId:e,notes:t})}catch(e){return e}}static async getLiveBenchmarks(){try{return await r.A.get("".concat(a.Pw,"/benchmarks/webapp/benchmarks"))}catch(e){return e}}static async getAllBenchmarks(){try{let e=await this.getLiveBenchmarks(),t=await this.getPendingBenchmarks();return{data:[...t.data.map(e=>({...e,id:e.benchmarkId,name:e.name,status:e.status,version:e.version})),...e.data.filter(e=>!!e.name&&!t.data.find(t=>t.benchmarkId===e.id)).map(e=>
1({...e,status:"Approved",version:e.version||1,name:e.name}))],status:e.status}}catch(e){return e}}static async setBenchmarkData(e,t){try{let e={videos:videos.toString()};return await r.A.put("".concat(a.nv,"/benchmark?benchmarkId=").concat(t),e)}catch(e){return e}}static async deleteAStaffPickScenarioById(e){try{return await r.A.delete("".concat(a.nv,"/staff-picks/scenario"),{scenarioId:e})}catch(e){return e}}static async getIcons(e){try{return await r.A.get("".concat(a.nv,"/benchmarks/icons?type=").concat(e))}catch(e){return e}}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.