PageSourceSearch

https://tapin.gg/_next/static/chunks/pages/admin/priority/scores-a458b79041f6621f.js

js tapin.gg collected 2026-09-29 20:35:14 UTC 14,231 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2083],{50928:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/priority/scores",function(){return n(44479)}])},4914:function(e,t,n){"use strict";n.d(t,{$T:function(){return A},GZ:function(){return p},HL:function(){return b},Ix:function(){return k},Ny:function(){return j},Tg:function(){return h},VU:function(){return I},Vz:function(){return y},i8:function(){return N},ns:function(){return S},oF:function(){return w}});var a=n(29051),r=n(84896),s=n(47553),l=n(94517);let o=(0,a.t)("categories"),i=e=>o.scope(e,"list"),u=(e,t)=>o.scope(e,"profile-settings",t);function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"admin/categories/".concat(encodeURIComponent(e)).concat(t)}function d(e){return{name:e.name,landscapeImageAssetId:e.landscapeImageAssetId,portraitImageAssetId:e.portraitImageAssetId,logoImageAssetId:e.logoImageAssetId,iconImageAssetId:e.iconImageAssetId,minOnlineTeammates:e.minOnlineTeammates,maxOnlineTeammates:e.maxOnlineTeammates,minRecentSessions:e.minRecentSessions,maxRecentSessions:e.maxRecentSessions}}function m(e){return(0,r.zr)((0,r.XZ)("admin/categories"),e)}function f(e,t){return(0,r.Nn)("post",(0,r.XZ)("admin/categories"),{key:e.key,...d(e)},t)}async function v(e,t){let n=new FormData;return n.append("file",e),function(e){let t=null!=e?e:{},n=t.id&&t.imageUrl?t:Object.values(t)[0];if(!(null==n?void 0:n.id)||!(null==n?void 0:n.imageUrl))throw Error("Upload did not return an image asset.");return{id:n.id,imageUrl:n.imageUrl}}(await (0,r.l3)((0,r.XZ)("admin/categories/image-assets"),n,t))}function p(){return(0,l.o)(i,m,{staleTime:3e4})}function h(e){return(0,l.o)(t=>u(t,e),t=>(0,r.zr)((0,r.XZ)(c(e,"/profile-settings")),t),{staleTime:15e3})}function g(e,t){let n=i(e.accountKey);return e.set(n,e=>null==e?void 0:e.map(e=>e.key===t.key?t:e)),e.invalidate(n)}function x(e,t,n){let a=u(e.accountKey,t);return e.set(a,()=>n),e.invalidate(a)}function b(){return(0,s.V9)(f,{onSuccess:(e,t,n)=>n.invalidate(i(n.accountKey))})}function j(){return(0,s.V9)((e,t)=>
1{let{categoryKey:n,draft:a}=e;return(0,r.Nn)("patch",(0,r.XZ)(c(n)),d(a),t)},{onSuccess:(e,t,n)=>g(n,e)})}function y(){return(0,s.V9)((e,t)=>{let{categoryKey:n,active:a}=e;return(0,r.Nn)("patch",(0,r.XZ)(c(n,a?"/enable":"/disable")),void 0,t)},{onSuccess:(e,t,n)=>g(n,e)})}function N(){return(0,s.V9)(v)}function I(){return(0,s.V9)((e,t)=>{let{categoryKey:n,draft:a}=e;return(0,r.Nn)("patch",(0,r.XZ)(c(n,"/profile-settings")),a,t)},{onSuccess:(e,t,n)=>{let{categoryKey:a}=t;return x(n,a,e)}})}function w(){return(0,s.V9)((e,t)=>{let{categoryKey:n,draft:a}=e;return(0,r.Nn)("post",(0,r.XZ)(c(n,"/profile-settings/options")),a,t)},{onSuccess:(e,t,n)=>{let{categoryKey:a}=t;return x(n,a,e)}})}function S(){return(0,s.V9)((e,t)=>{let{categoryKey:n,optionId:a}=e;return(0,r.Nn)("delete",(0,r.XZ)(c(n,"/profile-settings/options/".concat(a))),void 0,t)},{onSuccess:(e,t,n)=>{let{categoryKey:a}=t;return x(n,a,e)}})}function k(e,t,n){var a;return(null==e?void 0:e.categoryKey)===t&&(null==e?void 0:null===(a=e.draft)||void 0===a?void 0:a.groupKey)===n}function A(e,t,n){return(null==e?void 0:e.categoryKey)===t&&(null==e?void 0:e.optionId)===n}},32883:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var a=n(11527),r=n(4914),s=n(1123),l=n(11879),o=n(82551),i=n(15820),u=n(3885),c=n(44668),d=n(88678),m=n(51808),f=n(22043),v=n(46687),p=n(76834),h=n(18077);let g={username:null,userId:null,discordId:null};var x=n(95339),b=n(65091),j=n(79644),y=n(92941),N=n(11588);function I(e){return"".concat(e.userId,":").concat(e.categoryKey,":").concat(e.productMode)}let w=[{id:"teammate",header:"Teammate",mobileLabel:"Teammate",cell:e=>(0,a.jsx)(N.B,{username:e.username,userId:e.userId,discordId:e.discordId,className:"max-w-[200px]"})},{id:"game",header:"Game \xb7 mode",mobileLabel:"Game \xb7 mode",cell:e=>{var t;return(0,a.jsxs)("div",{className:"flex min-w-0 max-w-[170px] flex-col",children:[(0,a.jsx)(j.L,{value:null!==(t=e.gameName)&&void 0!==t?t:e.categoryKey}),(0,a.jsx)("span",{className:"text-xs text-admin-muted-foreground",children:(0,h.Nl)(e.productMode)})]})}},{id:"base",header:"Evaluated",mobileLabel:"Evaluated",align:"right",className:"tabular-nums",cell:e=>(0,h.o6)(e.baseScore)},{id:"boost",header:"Boost",mobileLabel:"Boost",align:"right",className:"tabular-nums",cell:e=>(0,a.jsx)(S,{row:e})},{id:"adjustments",header:"Adjustments",mobileLabel:"Adjustments",align:"right",className:"tabular-nums",cell:e=>(0,a.jsx)(k,{row:e})},{id:"effective",header:"Effective",mobileLabel:"Effective",align:"right",className:"text-base font-semibold tabular-nums text-admin-foreground",cell:e=>(0,h.o6)(e.effectiveScore)},{id:"superstar",header:"Superstar",mobileLabel:"Superstar",cell:e=>(0,a.jsx)(A,{row:e})},{id:"evaluatedAt",header:"Evaluated at",mobileLabel:"Evaluated at",className:"whitespace-nowrap tabular-nums text-admin-muted-foreground",cell:e=>(0,a.jsx)("span",{title:(0,h.hB)(e.evaluatedAt),children:(0,h.fG)(e.evaluatedAt)})}];function S(e){let{row:t}=e;return null===t.boostedScore?(0,a.jsx)("span",{className:"text-admin-muted-foreground",children:"—"}):t.boostInEffect?(0,a.jsx)(y.C,{variant:"default",title:"The boost is the base in effect",children:(0,h.o6)(t.boostedScore)}):(0,a.jsx)("span",{className:"text-admin-muted-foreground",title:"Dormant: the evaluated score has caught up",children:(0,h.o6)(t.boostedScore)})}function k(e){let{row:t}=e;return 0===t.activeAdjustments?(0,a.jsx)("span",{className:"text-admin-muted-foreground",children:"—"}):(0,a.jsx)(y.C,{variant:t.adjustmentTotal>=0?"success":"destructive",title:"".concat(t.activeAdjustments," in effect"),children:(0,h.tO)(t.adjustmentTotal)})}function A(e){let{row:t}=e;return"qualified"===t.superstarHeldBy?(0,a.jsx)(y.C,{variant:"success",children:"Superstar"}):"grace"===t.superstarHeldBy?(0,a.jsx)(y.C,{variant:"secondary",title:"Held by the grace period; a cell slipped on the last evaluation",children:"Superstar \xb7 grace"}):(0,a.jsx)("span",{className:"text-admin-muted-foreground",children:"—"})}let C="__any__",E=[{value:C,label:"Any mode"},...b.qd.map(e=>{let{value:t,label:n}=e;return{value:t,label:n}}
1)],T={page:c.k.page(),game:c.k.key(),mode:c.k.key(),by:c.k.oneOf(b.SS.map(e=>e.value),"username"),q:c.k.string()},Z={"data-testid":"tapin-score-row"};function _(){var e,t,n,j,y,N,S,k,A;let{values:_,set:D,replace:X}=(0,c.x)(T),{search:M}=(0,d.o)(_.q,b.Gv),L=(0,r.GZ)(),P=(0,x.hr)({limit:b.h6,offset:(0,u.h8)(_.page,b.h6),categoryKey:_.game,productMode:_.mode,...function(e,t){let n=t.trim();if(!n)return g;switch(e){case"username":return{...g,username:n};case"userId":{let e=Number(n);return Number.isInteger(e)&&e>0?{...g,userId:e}:g}case"discordId":return/^\d{1,32}$/.test(n)?{...g,discordId:n}:g;default:return g}}(_.by,M)}),O=null!==(j=null===(e=P.data)||void 0===e?void 0:e.rows)&&void 0!==j?j:[],V=null!==(y=null===(t=P.data)||void 0===t?void 0:t.total)&&void 0!==y?y:0,K=(0,u.mZ)(_.page,null===(n=P.data)||void 0===n?void 0:n.total,b.h6),U=[{value:C,label:"Any game"},...(null!==(N=L.data)&&void 0!==N?N:[]).slice().sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({value:e.key,label:e.name}))],z=null!==(S=b.SS.find(e=>e.value===_.by))&&void 0!==S?S:b.SS[0];return(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)(f.Zb,{children:[(0,a.jsxs)(f.Ol,{children:[(0,a.jsx)(f.ll,{children:"Tapin scores"}),(0,a.jsx)(f.SZ,{className:"col-start-1",children:"Every scored teammate and game mode from the last nightly evaluation, highest effective score first. Effective is what the matchmaker ranks by and the teammate sees: the boost when it is above the evaluated score, plus the adjustments in effect, clipped to 0–100. A Superstar under 100 is holding the grant through the grace period after a cell slipped."}),(0,a.jsx)(f.lY,{className:"col-span-2 col-start-1 row-span-1 row-start-3 mt-3 justify-self-stretch xl:col-span-1 xl:col-start-2 xl:row-span-2 xl:row-start-1 xl:mt-0 xl:justify-self-end",children:(0,a.jsx)(o.u,{page:K,pageCount:(0,u.mC)(V,b.h6),busy:P.isFetching,onPage:e=>void D({page:e}),summary:0===V?(0,a.jsx)("span",{children:"No scores"}):(0,h.Wx)(V,"score")})})]}),(0,a.jsxs)(f.aY,{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-end sm:gap-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:contents",children:[(0,a.jsx)(p.z,{id:"scores-game",label:"Game",value:null!==(k=_.game)&&void 0!==k?k:C,items:U,onChange:e=>void D({game:e===C?null:e},{resetPage:!0}),className:"w-full sm:w-48"}),(0,a.jsx)(p.z,{id:"scores-mode",label:"Mode",value:null!==(A=_.mode)&&void 0!==A?A:C,items:E,onChange:e=>void D({mode:e===C?null:e},{resetPage:!0}),className:"w-full sm:w-36"})]}),(0,a.jsx)(i.U,{id:"scores-teammate",label:"Teammate",value:_.q,placeholder:z.placeholder,inputMode:"username"===_.by?"text":"numeric",modes:b.SS,mode:_.by,onModeChange:e=>void D({by:e},{resetPage:!0}),onChange:e=>void D({q:e},{resetPage:!0})}),(0,a.jsx)(m.z,{type:"button",variant:"outline",className:"self-start border-admin-warning/30 bg-admin-warning/10 text-admin-warning hover:bg-admin-warning/20 sm:self-auto",onClick:()=>void X({}),children:"Reset"})]}),P.isLoading?(0,a.jsx)("p",{className:"text-sm text-admin-muted-foreground",children:"Loading scores…"}):P.isError?(0,a.jsx)(l.u,{tone:"destructive",title:"Could not load the scores."}):(0,a.jsx)(v.pn,{delay:0,children:(0,a.jsx)(s.w,{columns:w,rows:O,rowId:I,rowProps:()=>Z,empty:(0,a.jsx)(l.u,{title:"No scores match these filters."})})})]})]})})}},76834:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var a=n(11527),r=n(51793),s=n(49400);function l(e){let{id:t,label:n,value:l,items:o,onChange:i,className:u}=e;return(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)(r._,{htmlFor:t,children:n}),(0,a.jsxs)(s.Ph,{value:l,onValueChange:e=>{"string"==typeof e&&i(e)},items:o.map(e=>{let{value:t,label:n}=e;return{value:t,label:n}}),children:[(0,a.jsx)(s.i4,{id:t,className:u,children:(0,a.jsx)(s.ki,{})}),(0,a.jsx)(s.Bw,{children:(0,a.jsx)(s.DI,{children:o.map(e=>(0,a.jsx)(s.Ql,{value:e.value,children:e.label},e.value))})})]})]})}},11588:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var a=n(11527),r=n(79644),s=n(46083);function l(e){let{username:t,userId:n,discordId:l,className:o}=e;return(0,a.jsxs)("div",{className:(0,s.cn)("flex min-w-0 flex-col",o),children:[(0,a.jsx)(r.L,{value:null!=t?t:"—",className:"font-medium text-admin-foreground"}),(0,a.jsx)(r.L,{value:"ID: ".concat(n).concat(l?" \xb7 Discord: ".concat(l):""),className:"text-xs tabular-nums text-admin-muted-foreground"})]})}},18077:function(e,t,n){"use strict";n.d(t,{Nl:function(){return m},Wx:function(){return v},dC:function(){return f},e3:function(){return l},fG:function(){return d},hB:function(){return c},o6:function(){return u},tO:function(){return i},y4:function(){return o}});var a=n(52043),r=n.n(a),s=n(65091);let l={active:"active",scheduled:"scheduled",ended:"ended early",expired:"expired"},o={active:"success",scheduled:"default",ended:"secondary",expired:"outline"};function i(e){return e>0?"+".concat(e):e<0?"−".concat(Math.abs(e)):"0"}function u(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function c(e){return r()(e).format("MMM D, YYYY HH:mm")}function d(e){return r()(e).format("MMM D, YYYY")}function m(e){var t,n;return null!==(n=null===(t=s.qd.find(t=>t.value===e))||void 0===t?void 0:t.label)&&void 0!==n?n:e}function f(e,t){return null!=e?e:"user ".concat(t)}function v(e,t){return"".concat(e," ").concat(t).concat(1===e?"":"s")}},95339:function(e,t,n){"use strict";n.d(t,{A0:function(){return d},CJ:function(){return v},WJ:function(){return p},hr:function(){return m}});var a=n(29051),r=n(84896),s=n(47553),l=n(94517);let o=(0,a.t)("tapin-scores"),i=(e,t)=>o.scope(e,"adjustments",t),u=(e,t)=>
1o.scope(e,"scores",t);function c(e,t){let{userId:n,...a}=e;return(0,r.Nn)("post",(0,r.XZ)("admin/tapin-scores/teammates/".concat(n,"/adjustments")),a,t)}function d(e){return(0,l.o)(t=>i(t,e),t=>(0,r.zr)((0,r.XZ)("admin/tapin-scores/adjustments",{limit:e.limit,offset:e.offset,sort:e.sort,order:e.order,kind:e.kind,status:e.status,q:e.q}),t),{staleTime:3e4,keepPreviousData:!0})}function m(e){return(0,l.o)(t=>u(t,e),t=>(0,r.zr)((0,r.XZ)("admin/tapin-scores/scores",{limit:e.limit,offset:e.offset,categoryKey:e.categoryKey,productMode:e.productMode,username:e.username,userId:e.userId,discordId:e.discordId}),t),{staleTime:3e4,keepPreviousData:!0})}let f={refresh:()=>[o.root],refreshOn:"settled"};function v(){return(0,s.V9)(c,f)}function p(){return(0,s.V9)((e,t)=>{let{id:n}=e;return(0,r.Nn)("post",(0,r.XZ)("admin/tapin-scores/adjustments/".concat(n,"/end")),void 0,t)},f)}},65091:function(e,t,n){"use strict";n.d(t,{Gv:function(){return o},SS:function(){return d},Se:function(){return l},We:function(){return s},XC:function(){return r},cO:function(){return c},h6:function(){return m},kS:function(){return a},qd:function(){return i},rz:function(){return u}});let a=[{value:"all",label:"All"},{value:"buff",label:"Buffs"},{value:"debuff",label:"Debuffs"}],r=[{value:"any",label:"Any status"},{value:"active",label:"Active"},{value:"scheduled",label:"Scheduled"},{value:"ended",label:"Ended early"},{value:"expired",label:"Expired"}],s=[{value:"createdAt",label:"Created"},{value:"validFrom",label:"Start date"},{value:"validUntil",label:"End date"},{value:"adjustment",label:"Amount"}],l=50,o=275,i=[{value:"competitive",label:"Competitive"},{value:"companion",label:"Companion"},{value:"coaching",label:"Coaching"},{value:"tournament",label:"Tournament"}],u=365,c=100,d=[{value:"username",label:"Username",placeholder:"Part of a username"},{value:"userId",label:"User ID",placeholder:"Exact user ID"},{value:"discordId",label:"Discord ID",placeholder:"Exact Discord ID"}],m=50},44479:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return l}});var a=n(11527),r=n(10935),s=n(32883),l=!0;t.default=()=>(0,a.jsx)(r.Z,{pageTitle:"Priority",children:(0,a.jsx)(s.Z,{})})}},function(e){e.O(0,[6183,8826,4358,2591,8851,935,4244,412,2888,9774,179],function(){return e(e.s=50928)}
1),_N_E=e.O()}]);

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.