1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2268],{28337:function(e,a,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/leaderboard",function(){return s(89029)}])},89029:function(e,a,s){"use strict";s.r(a),s.d(a,{default:function(){return P}});var l=s(52322),n=s(94049),r=s(87724),i=s(65568);let t="This trader has progressed to the live trading stage and is trading real capital.",c=[{key:"all",label:"All"},{key:"sim",label:"Sim"},{key:"live",label:"Live"}];var d=s(17191);let o=e=>{let a=(null!=e?e:"").match(/[A-Za-z0-9]/);return a?a[0].toUpperCase():"?"},h=e=>Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),m=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;if("number"==typeof e.days_funded&&Number.isFinite(e.days_funded))return Math.max(0,Math.floor(e.days_funded));if(!e.account_created_at)return null;let s=new Date(e.account_created_at);return Number.isNaN(s.getTime())?null:Math.max(0,Math.round((h(a)-h(s))/864e5))},u=e=>null===e?"â":"".concat(e,"d"),x=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return"number"==typeof e&&Number.isFinite(e)?"".concat(e.toFixed(a),"%"):"â"},j=e=>"number"==typeof e&&Number.isFinite(e)?e.toFixed(2):"â",b=e=>"number"==typeof e&&Number.isFinite(e)?Math.min(100,Math.max(0,e)):0,p=e=>e?"https://hatscripts.github.io/circle-flags/flags/".concat(e.toLowerCase(),".svg"):null,N=e=>{let{country:a,placement:s="top",size:n="md"}=e,r=p(a),i="lb-flag".concat("md"===n?"":" ".concat(n));return r?(0,l.jsx)(d.Z,{placement:s,title:a,children:(0,l.jsx)("img",{alt:a,className:i,loading:"lazy",src:r})}):(0,l.jsx)("span",{"aria-hidden":!0,className:i})},v=[{label:"Champion",medal:"g1",modifier:"champ"},{label:"Runner-up",medal:"g2",modifier:"silver"},{label:"Third place",medal:"g3",modifier:"bronze"}],f=e=>{let{onSelect:a,profile:s,rank:r}=e,i=v[r-1],c=1===r;return(0,l.jsxs)("div",{className:"lb2-pod ".concat(i.modifier),onClick:a,onKeyDown:e=>{a&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),a())},role:a?"button":void 0,style:a?{cursor:"pointer"}:void 0,tabIndex:a?0:void 0,children:[(0,l.jsx)("span",{"aria-hidden":!0,className:"lb2-ghost",children:r}),(0,l.jsxs)("span",{className:"lb2-place",children:[(0,l.jsx)("span",{className:"lb-medal ".concat(i.medal),children:r}),i.label]}),(0,l.jsxs)("div",{className:"lb2-who",children:[(0,l.jsx)(N,{country:s.country,size:c?"xl":"lg"}),(0,l.jsx)("span",{className:"lb2-name",children:s.username||"â"}),s.is_live_trader&&(0,l.jsx)(d.Z,{title:t,placement:"top",arrow:!0,children:(0,l.jsx)("span",{className:"lb-live",children:"Live"})})]}),(0,l.jsxs)("div",{className:"lb2-bigprofit",children:["$",(0,n.b1)(s.totalProfit,2,!0)]}),(0,l.jsxs)("div",{className:"lb2-chip",children:["Realized profit \xb7 $",(0,n.b1)(s.balance)," account"]}),(0,l.jsxs)("div",{className:"lb2-stats",children:[(0,l.jsxs)("div",{className:"s",children:[(0,l.jsx)("div",{className:"k",children:"Gain"}),(0,l.jsx)("div",{className:"v",children:x(s.percentReturn,1)})]}),(0,l.jsxs)("div",{className:"s",children:[(0,l.jsx)("div",{className:"k",children:"Win"}),(0,l.jsx)("div",{className:"v",children:x(s.win_rate,1)})]}),(0,l.jsxs)("div",{className:"s",children:[(0,l.jsx)("div",{className:"k",children:"Days Funded"}),(0,l.jsx)("div",{className:"v",children:u(m(s))})]}),c&&(0,l.jsxs)("div",{className:"s",children:[(0,l.jsx)("div",{className:"k",children:"P. Factor"}),(0,l.jsx)("div",{className:"v",children:j(s.profit_factor)})]})]})]})},g=e=>{let{onSelect:a,rows:s}=e;return(0,l.jsx)("div",{className:"lb-scroll",children:(0,l.jsxs)("table",{className:"lb-table ".concat(a?"clickable":""),children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:"Rank"}),(0,l.jsx)("th",{children:"Trader"}),(0,l.jsx)("th",{className:"num",children:"Profit"}),(0,l.jsx)("th",{className:"num col-account",children:"Account"}),(0,l.jsx)("th",{className:"num",children:"% Gain"}),(0,l.jsx)("th",{className:"num",children:"Win Rate"}),(0,l.jsx)("th",{className:"num",children:"Days Funded"}),(0,l.jsx)("th",{className:"ctr",children:"Country"})]})}),(0,l.jsx)("tbody",{children:s.map(e=>{var s;let{profile:r,rank:i}=e,c=r.username||"â";return(0,l.jsxs)("tr",{onClick:a?()=>
1a(r):void 0,children:[(0,l.jsx)("td",{children:(0,l.jsx)("div",{className:"lb-rankcell",children:(0,l.jsx)("span",{className:"lb-medal plain",children:i})})}),(0,l.jsx)("td",{children:(0,l.jsxs)("div",{className:"lb-trader",children:[(0,l.jsx)("span",{"aria-hidden":!0,className:"lb-avatar",children:o(c)}),a?(0,l.jsx)("button",{"aria-label":"View account for ".concat(c),className:"lb-uname",onClick:e=>{e.stopPropagation(),a(r)},type:"button",children:c}):(0,l.jsx)("span",{className:"lb-uname",children:c}),r.is_live_trader&&(0,l.jsx)(d.Z,{title:t,placement:"top",arrow:!0,children:(0,l.jsx)("span",{className:"lb-live",children:"Live"})})]})}),(0,l.jsx)("td",{className:"num",children:(0,l.jsxs)("span",{className:"lb-profit",children:["$",(0,n.b1)(r.totalProfit,2,!0)]})}),(0,l.jsx)("td",{className:"num col-account",children:(0,l.jsxs)("span",{className:"lb-money",children:["$",(0,n.b1)(r.balance)]})}),(0,l.jsx)("td",{className:"num",children:(0,l.jsx)("span",{className:"lb-gain",children:x(r.percentReturn)})}),(0,l.jsx)("td",{className:"num",children:(0,l.jsxs)("span",{className:"lb-win",children:[(0,l.jsx)("span",{className:"lb-winbar",children:(0,l.jsx)("i",{style:{width:"".concat(b(r.win_rate),"%")}})}),(0,l.jsx)("span",{className:"lb-winval",children:x(r.win_rate,1)})]})}),(0,l.jsx)("td",{className:"num",children:(0,l.jsx)("span",{className:"lb-money",children:u(m(r))})}),(0,l.jsx)("td",{className:"ctr",children:(0,l.jsx)(N,{country:r.country,placement:"left"})})]},null!==(s=r.accountUuid)&&void 0!==s?s:i)})})]})})},y=e=>{let{filter:a,hasError:s=!1,isLoading:n=!1,onFilterChange:r,onSelectProfile:i,profiles:t}=e,d=t.map((e,a)=>({profile:e,rank:a+1})),o=d.slice(0,3),h=d.slice(3);return(0,l.jsxs)("div",{className:"leaderboard-page",children:[(0,l.jsx)("div",{className:"lb-glow"}),(0,l.jsxs)("div",{className:"lb-wrap",children:[(0,l.jsxs)("div",{className:"lb-head",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("h1",{className:"lb-title",children:["Top ",(0,l.jsx)("span",{className:"gold",children:"Funded"})," Traders"]}),(0,l.jsx)("p",{className:"lb-sub",children:"Ranked by realized profit across every funded account â the traders turning evaluations into real payouts."})]}),(0,l.jsx)("div",{className:"lb-seg",children:c.map(e=>{let{key:s,label:n}=e;return(0,l.jsx)("button",{"aria-pressed":a===s,className:a===s?"on":"",onClick:()=>{s!==a&&r(s)},type:"button",children:n},s)})})]}),n&&(0,l.jsx)(w,{}),!n&&0===d.length&&(0,l.jsx)("div",{className:"lb-panel",children:(0,l.jsx)("div",{className:"lb-empty",children:s?"We could not load the leaderboard right now. Please try again shortly.":"No ranked traders to show for this filter yet."})}),!n&&d.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"lb2-podium",children:o.map(e=>{var a;let{profile:s,rank:n}=e;return(0,l.jsx)(f,{onSelect:i?()=>i(s):void 0,profile:s,rank:n},null!==(a=s.accountUuid)&&void 0!==a?a:n)})}),h.length>0&&(0,l.jsx)("div",{className:"lb-panel",children:(0,l.jsx)(g,{onSelect:i,rows:h})})]})]})]})},w=()=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"lb2-podium",children:[0,1,2].map(e=>(0,l.jsx)(i.Z,{height:308,sx:{bgcolor:"rgba(255,255,255,0.05)",borderRadius:"16px"},variant:"rectangular"},e))}),(0,l.jsx)("div",{className:"lb-secthead",children:(0,l.jsx)("h2",{children:"Full Ranking"})}),(0,l.jsx)("div",{className:"lb-panel",children:(0,l.jsx)(i.Z,{height:520,sx:{bgcolor:"rgba(255,255,255,0.04)"},variant:"rectangular"})})]});var k=s(97729),_=s.n(k),F=s(2784),C=s(59889),T=s(58497),P=()=>{let{user:e}=(0,r.aF)(),a=(null==e?void 0:e.role)==="staff",[s,i]=(0,F.useState)("all"),[t,c]=(0,F.useState)([]),[d,o]=(0,F.useState)(!0),[h,m]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{let e=new AbortController;return o(!0),m(!1),(0,C.j)({body:{filter:s},method:"POST",secure:!0,signal:e.signal,url:"getLeaderboardData/"},e=>{var a;Array.isArray(null==e?void 0:null===(a=e.ok)||void 0===a?void 0:a.topProfiles)?c(e.ok.topProfiles):(c([]),m(!0)),o(!1)},()=>{c([]),m(!0),o(!1)}),()=>e.abort()},[s]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(_(),{children:[(0,l.jsx)("title",{children:"Leaderboard | ".concat(n.Wg.firm_name)}),(0,l.jsx)("meta",{name:"description",content:"See the top funded traders on ".concat(n.Wg.firm_name,", ranked daily by realized profit with gain, win rate and days funded.")}),(0,l.jsx)("link",{rel:"canonical",href:(0,T.Z)("/leaderboard")})]}),(0,l.jsx)(y,{filter:s,hasError:h,isLoading:d,onFilterChange:i,onSelectProfile:a?e=>{window.location.href="/admin/accountview/".concat(e.accountUuid)}:void 0,profiles:t})]})}}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=28337)}),_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.