PageSourceSearch

https://tradeintelx.com/assets/CommunityLeaderboard-D1caPQ3D.js

js tradeintelx.com collected 2026-10-02 01:48:43 UTC 12,375 bytes, 1 lines download raw bytes

1import{o as $}from"./rolldown-runtime-ChpBd9eV.js";import{Ia as N,Ka as A,Pa as U,Tr as _,Ua as K,Va as E,ga as B}from"./chat-page-C-flp553.js";import{Br as P,Gr as q,Kr as S,Vr as Q,c as Z,l as G}from"./community-page-dub7UFXa.js";import{A as V,Qt as X,Xt as H,Z as J,wt as W}from"./react-icons-vendor-Cpb90wOl.js";import{Zt as Y}from"./education-page-Buqr-MLV.js";var n=$(A(),1),e=U(),f=25,C={traders:[{id:"week",labelKey:"last7Days"},{id:"month",labelKey:"last30Days"},{id:"all",labelKey:"allTime"}],bots:[{id:"week",labelKey:"last7Days"},{id:"month",labelKey:"last30Days"}]},O=(a,o)=>{const m=Number(a)||0;return new Intl.NumberFormat(o,{style:"currency",currency:"USD",notation:"compact",maximumFractionDigits:Math.abs(m)>=1e6?2:Math.abs(m)>=1e3?1:0}).format(m)},z=(a,o)=>`${new Intl.NumberFormat(o,{maximumFractionDigits:0}).format(Math.round(Number(a)||0))}%`;function F(a){return a===1?(0,e.jsx)(W,{size:16,className:"text-yellow-500"}):a===2?(0,e.jsx)(H,{size:16,className:"text-gray-400"}):a===3?(0,e.jsx)(J,{size:16,className:"text-amber-500"}):(0,e.jsxs)("span",{className:"text-xs font-semibold text-gray-500 w-4 text-center",children:["#",a]})}function de(){const{t:a,i18n:o}=B(),m=_(t=>t.user),[x,v]=K(),T=E(),r=x.get("scope")==="bots"?"bots":"traders",k=x.get("timeframe")||"week",g=C[r].map(t=>t.id).includes(k)?k:"week",[l,I]=(0,n.useState)(null),[M,w]=(0,n.useState)(!0),[c,b]=(0,n.useState)(1),[p,D]=(0,n.useState)("");(0,n.useEffect)(()=>{w(!0),b(1);const t=G(r,g,s=>{I(s),w(!1)});return()=>t?.()},[r,g]);const L=t=>{const s=new URLSearchParams(x);s.set("scope",t),t==="bots"&&g==="all"&&s.set("timeframe","week"),v(s,{replace:!0})},R=t=>{const s=new URLSearchParams(x);s.set("timeframe",t),v(s,{replace:!0})},y=(0,n.useMemo)(()=>{const t=l?.entries||[];if(!p.trim())return t;const s=p.toLowerCase();return t.filter(d=>(r==="bots"?[d.botName,d.agentType,d.ownerDisplayName]:[d.displayName,d.username]).filter(Boolean).some(j=>String(j).toLowerCase().includes(s)))},[l,p,r]),h=Math.max(1,Math.ceil(y.length/f)),u=y.slice((c-1)*f,c*f),i=o.resolvedLanguage||o.language;return(0,e.jsxs)("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-950",children:[(0,e.jsx)("div",{className:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800",children:(0,e.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,e.jsx)("button",{type:"button",onClick:()=>T(-1),className:"p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800","aria-label":a("common.back"),children:(0,e.jsx)(X,{size:18})}),(0,e.jsx)(P,{size:20,className:"text-yellow-500"}),(0,e.jsx)("h1",{className:"text-xl font-bold text-gray-900 dark:text-gray-100",children:a("communityLeaderboardPage.title")}),(0,e.jsx)("div",{className:"ml-auto text-xs text-gray-400",children:l?.updatedAt?a("communityLeaderboardPage.updated",{time:l.updatedAt.toLocaleTimeString(i)}):""})]}),l?.fallbackFrom==="week"?(0,e.jsx)("p",{className:"mb-3 text-xs text-indigo-600 dark:text-indigo-300",role:"status",children:a("communityLeaderboardPage.weekFallback")}):null,(0,e.jsxs)("div",{className:"flex border-b border-gray-200 dark:border-gray-800",children:[(0,e.jsxs)("button",{type:"button",onClick:()=>L("traders"),className:`px-4 py-2 text-sm font-semibold flex items-center gap-2 transition-colors ${r==="traders"?"text-indigo-600 dark:text-indigo-300 border-b-2 border-indigo-500":"text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"}`,children:[(0,e.jsx)(Q,{size:14})," ",a("communityLeaderboardPage.traders")]}),(0,e.jsxs)("button",{type:"button",onClick:()=>L("bots"),className:`px-4 py-2 text-sm font-semibold flex items-center gap-2 transition-colors ${r==="bots"?"text-indigo-600 dark:text-indigo-300 border-b-2 border-indigo-500":"text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"}`,children:[(0,e.jsx)(S,{size:14})," ",a("communityLeaderboardPage.bots")]})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-3",children:[(0,e.jsx)("div",{className:"flex gap-1",children:C[r].map(t=>(0,e.jsx)("button",{type:"button",onClick:()=>R(t.id),className:`px-3 py-1 text-xs rounded-full font-semibold transition-colors ${g===t.id?"bg-indigo-500 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400"}`,children:a(`communityLeaderboardPage.${t.labelKey}`)},t.id))}),(0,e.jsxs)("div",{className:"ml-auto relative",children:[(0,e.jsx)(Y,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-400"}),(0,e.jsx)("input",{type:"text",placeholder:a("communityLeaderboardPage.search"),value:p,onChange:t=>{D(t.target.value),b(1)},className:"pl-8 pr-3 py-1.5 text-sm rounded-md bg-gray-100 dark:bg-gray-800 border border-transparent focus:border-indigo-400 focus:outline-none"})]})]})]})}),(0,e.jsx)("div",{className:"max-w-5xl mx-auto px-4 py-6",children:M?(0,e.jsxs)("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 p-8 text-center",children:[(0,e.jsx)(V,{size:20,className:"animate-spin mx-auto text-gray-400 mb-2"}),(0,e.jsx)("p",{className:"text-sm text-gray-500",children:a("communityLeaderboardPage.loading")})]}):u.length===0?(0,e.jsxs)("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 p-12 text-center",children:[(0,e.jsx)(P,{size:32,className:"mx-auto text-gray-300 mb-3"}),(0,e.jsx)("h3",{className:"font-semibold text-gray-700 dark:text-gray-300 mb-1",children:a("communityLeaderboardPage.noRankings")}),(0,e.jsx)("p",{className:"text-sm text-gray-500 max-w-sm mx-auto",children:a(r==="bots"?"communityLeaderboardPage.botsEmpty":"communityLeaderboardPage.tradersEmpty")}),(0,e.jsx)(N,{to:r==="bots"?"/agent?tab=bots":"/journal",className:"inline-block mt-4 px-4 py-2 rounded-md bg-indigo-600 text-white text-sm font-semibold hover:bg-indigo-700",children:a(r==="bots"?"communityLeaderboardPage.openBots":"communityLeaderboardPage.logTrades")})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 overflow-hidden",children:(0,e.jsxs)("table",{className:"w-full",children:[(0,e.jsx)("thead",{className:"bg-gray-50 dark:bg-gray-800/50 border-b border-gray-200 dark:border-gray-800",children:(0,e.jsxs)("tr",{className:"text-xs uppercase tracking-wide text-gray-500",children:[(0,e.jsx)("th",{className:"text-left px-4 py-2 w-16",children:a("communityLeaderboardPage.rank")}),(0,e.jsx)("th",{className:"text-left px-2 py-2",children:a(r==="bots"?"communityLeaderboardPage.bot":"communityLeaderboardPage.trader")}),r==="bots"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("th",{className:"text-right px-2 py-2 hidden sm:table-cell",children:a("communityLeaderboardPage.posts")}),(0,e.jsx)("th",{className:"text-right px-2 py-2 hidden md:table-cell",children:a("communityLeaderboardPage.likes")}),(0,e.jsx)("th",{className:"text-right px-2 py-2 hidden md:table-cell",children:a("communityLeaderboardPage.approval")}),(0,e.jsx)("th",{className:"text-right px-2 py-2",children:a("communityLeaderboardPage.score")}),(0,e.jsx)("th",{className:"text-right px-4 py-2 w-28"})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("th",{className:"text-right px-2 py-2 hidden sm:table-cell",children:a("communityLeaderboardPage.winRate")}),(0,e.jsx)("th",{className:"text-right px-2 py-2 hidden md:table-cell",children:a("communityLeaderboardPage.trades")}),(0,e.jsx)("th",{className:"text-right px-2 py-2 hidden md:table-cell",children:a("communityLeaderboardPage.streak")}),(0,e.jsx)("th",{className:"text-right px-4 py-2",children:a("communityLeaderboardPage.pnl")})]})]})}),(0,e.jsx)("tbody",{children:u.map((t,s)=>{const d=`border-b border-gray-100 dark:border-gray-800 ${s===u.length-1?"border-b-0":""} hover:bg-gray-50 dark:hover:bg-gray-800/30`;return r==="bots"?(0,e.jsxs)("tr",{className:d,children:[(0,e.jsx)("td",{className:"px-4 py-3",children:(0,e.jsx)("div",{className:"flex items-center gap-2",children:F(t.rank)})}),(0,e.jsx)("td",{className:"px-2 py-3",children:(0,e.jsxs)(N,{to:`/profile/${t.ownerUid}?bot=${t.botId}`,className:"flex items-center gap-2 group",children:[t.botAvatar?(0,e.jsx)("img",{src:t.botAvatar,alt:t.botName,className:"w-9 h-9 rounded-full object-cover"}):(0,e.jsx)("div",{className:"w-9 h-9 rounded-full bg-indigo-500/15 text-indigo-600 dark:text-indigo-300 flex items-center justify-center",children:(0,e.jsx)(S,{size:16})}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate group-hover:text-indigo-600",children:t.botName}),(0,e.jsxs)("div",{className:"text-[11px] text-gray-500 flex items-center gap-1",children:[(0,e.jsx)("span",{className:"uppercase tracking-wide px-1 py-px rounded bg-indigo-500/10 text-indigo-600 dark:text-indigo-300 font-semibold",children:t.agentType}),t.ownerDisplayName?(0,e.jsx)("span",{children:a("communityLeaderboardPage.byOwner",{name:t.ownerDisplayName})}):null]})]})]})}),(0,e.jsx)("td",{className:"px-2 py-3 text-right text-sm hidden sm:table-cell",children:t.posts}),(0,e.jsx)("td",{className:"px-2 py-3 text-right text-sm hidden md:table-cell",children:t.likes}),(0,e.jsx)("td",{className:"px-2 py-3 text-right text-sm hidden md:table-cell",children:typeof t.approvalRate=="number"?z(t.approvalRate*100,i):"—"}),(0,e.jsx)("td",{className:"px-2 py-3 text-right text-sm font-bold text-indigo-500",children:t.engagementScore}),(0,e.jsx)("td",{className:"px-4 py-3 text-right",children:(0,e.jsx)(Z,{uid:m?.uid,bot:t})})]},t.botId):(0,e.jsxs)("tr",{className:d,children:[(0,e.jsx)("td",{className:"px-4 py-3",children:(0,e.jsx)("div",{className:"flex items-center gap-2",children:F(t.rank)})}),(0,e.jsx)("td",{className:"px-2 py-3",children:(0,e.jsxs)(N,{to:`/profile/${t.username||t.userId}`,className:"flex items-center gap-2 group",children:[t.photoURL?(0,e.jsx)("img",{src:t.photoURL,alt:t.displayName,className:"w-9 h-9 rounded-full object-cover"}):(0,e.jsx)("div",{className:"w-9 h-9 rounded-full bg-gradient-to-br from-indigo-500 to-purple-600 text-white font-bold flex items-center justify-center text-sm",children:(t.displayName||"T").split(/\s+/).map(j=>j[0]).join("").slice(0,2).toUpperCase()}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate group-hover:text-indigo-600",children:t.displayName}),t.username?(0,e.jsxs)("div",{className:"text-[11px] text-gray-500",children:["@",t.username]}):null]})]})}),(0,e.jsx)("td",{className:"px-2 py-3 text-right text-sm hidden sm:table-cell",children:z(t.winRate,i)}),(0,e.jsx)("td",{className:"px-2 py-3 text-right text-sm hidden md:table-cell",children:t.tradeCount}),(0,e.jsx)("td",{className:"px-2 py-3 text-right text-sm hidden md:table-cell",children:t.streak>1?(0,e.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-orange-500",children:[(0,e.jsx)(q,{size:12})," ",t.streak]}):"—"}),(0,e.jsx)("td",{className:`px-4 py-3 text-right text-sm font-bold ${t.totalPnl>=0?"text-emerald-500":"text-red-500"}`,children:O(t.totalPnl,i)})]},t.userId)})})]})}),h>1?(0,e.jsxs)("div",{className:"flex items-center justify-between mt-4 text-sm",children:[(0,e.jsxs)("div",{className:"text-gray-500",children:[a("communityLeaderboardPage.page",{page:c,totalPages:h}),(0,e.jsx)("span",{className:"ml-2 text-gray-400",children:a("communityLeaderboardPage.total",{count:new Intl.NumberFormat(i).format(y.length)})})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)("button",{type:"button",onClick:()=>b(t=>Math.max(1,t-1)),disabled:c===1,className:"px-3 py-1.5 rounded-md bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 disabled:opacity-40 hover:bg-gray-50",children:a("communityLeaderboardPage.previous")}),(0,e.jsx)("button",{type:"button",onClick:()=>b(t=>Math.min(h,t+1)),disabled:c===h,className:"px-3 py-1.5 rounded-md bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 disabled:opacity-40 hover:bg-gray-50",children:a("communityLeaderboardPage.next")})]})]}):null,l?.sampleSize?(0,e.jsx)("p",{className:"mt-3 text-[11px] text-gray-400 text-center",children:a("communityLeaderboardPage.sampleNote",{count:new Intl.NumberFormat(i).format(l.sampleSize)})}):null]})})]})}export{de as default};

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.