1import{n as e}from"./rolldown-runtime-CbXtAM7H.js";import{G as t,K as n,d as r,o as i,s as a}from"./lc-api-BH-MHTwD.js";import{j as o}from"./preload-helper-C9Pkk78C.js";import{i as s}from"./use-favorite-games-DLcMyG8G.js";import{u as c}from"./logo-v4-DbI3o6R8.js";import{t as l}from"./SiteHeader-Dw7nQ0UF.js";import{t as u}from"./chevron-right-D_mIJVKa.js";import{t as d}from"./rocket-C-n7DYvA.js";import{A as f,g as p,l as m,p as h}from"./index-DJsmE4iy.js";var g=e(n()),_=t(),v=e=>`$`+e.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2}),y=new Set([`Blackjack`,`Coinflip`,`Crash`,`Cross the Road`,`Diamonds`,`Dice`,`Dragon's Tower`,`HiLo`,`Keno`,`Limbo`,`Mines`,`Plinko`,`Roulette`,`Slider`,`Video Poker`,`Wheel`]),b=e=>({id:e.id,account:{id:e.accountId,nickname:e.nickname,isHidden:!1},game:{id:e.gameId,name:e.gameName,...e.thumb?{thumbnailUrl:e.thumb}:{},...y.has(e.gameName)?{originalKey:e.gameName}:{}},stakeUsd:e.stakeUsd,payoutUsd:e.payoutUsd,multiplier:e.multiplier,at:e.at?Date.parse(e.at):0}),x=e=>({id:e.id,account:{id:e.accountId,nickname:e.nickname,isHidden:!1},event:e.event,odds:e.odds,stakeUsd:e.stakeUsd,payoutUsd:e.payoutUsd,multiplier:e.stakeUsd>0?e.payoutUsd/e.stakeUsd:e.odds,at:e.at?Date.parse(e.at):0}),S=e=>{let t=a(e.debit,e.token.decimals),n=a(e.credit,e.token.decimals);return{id:e.id,account:e.account,game:{id:e.game.id,name:e.game.name,slug:e.game.slug,studio:e.game.
1studio,...e.game.thumbnailUrl?{thumbnailUrl:e.game.thumbnailUrl}:{}},stakeUsd:t,payoutUsd:n,multiplier:t>0?n/t:0,at:e.createdAt?Date.parse(e.createdAt):0}},C=e=>{let t=a(e.debit,e.token.decimals),n=a(e.credit,e.token.decimals);return{id:e.id,account:e.account,event:z(e),odds:e.betslip.totalOdds,stakeUsd:t,payoutUsd:n,multiplier:t>0?n/t:e.betslip.totalOdds,at:e.createdAt?Date.parse(e.createdAt):0}};function w(e,t){let n=new Map;for(let t of e)n.set(t.id,t);for(let e of t)n.set(e.id,e);return[...n.values()]}function T(e,t=500){let[n,r]=(0,g.useState)([]);return(0,g.useEffect)(()=>{e?.length&&r(n=>{let r=new Map(n.map(e=>[e.id,e]));for(let t of e)r.set(t.id,t);let i=[...r.values()];return i.length>t?i.slice(i.length-t):i})},[e,t]),n}var E=[{key:`wins`,icon:c},{key:`multi`,icon:d},{key:`sports`,icon:f}],D=10,O=30;function k(){let{t:e}=o(),{casinoSeed:t,sportsSeed:n}=m.useLoaderData(),[a,s]=(0,g.useState)(`wins`),[c,u]=(0,g.useState)(1);(0,g.useEffect)(()=>u(1),[a]);let d=r({queryKey:[`lc`,`hs`,`casino`],queryFn:()=>i.getCasinoBets({limit:100}),refetchInterval:1e4}),f=r({queryKey:[`lc`,`hs`,`sports`],queryFn:()=>i.getSportsbookBets({limit:100}),refetchInterval:12e3}),p=T(d.data),h=T(f.data),v=(0,g.useMemo)(()=>w(t.map(b),p.map(S)),[t,p]),y=(0,g.useMemo)(()=>w(n.map(x),h.map(C)),[n,h]),k=(0,g.useMemo)(()=>(a===`wins`?v.filter(e=>e.payoutUsd>0).sort((e,t)=>t.payoutUsd-e.payoutUsd):a===`multi`?v.filter(e=>e.multiplier>=2).sort((e,t)=>t.multiplier-e.multiplier):y.filter(e=>e.payoutUsd>0).sort((e,t)=>t.payoutUsd-e.payoutUsd)).slice(0,O),[a,v,y]),j=Math.max(1,Math.ceil(k.length/D)),M=Math.min(c,j),N=(M-1)*D,P=k.slice(N,N+D);return(0,_.jsxs)(`div`,{className:`min-h-screen`,children:[(0,_.jsx)(l,{}),(0,_.jsxs)(`main`,{className:`mx-auto max-w-[1180px] space-y-6 px-4 pb-16 pt-32 sm:px-6 lg:px-8 xl:px-12`,children:[(0,_.jsx)(`div`,{children:(0,_.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-3xl`,children:e(`highScores.title`)})}),(0,_.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:E.map(t=>{let n=t.icon;return(0,_.jsxs)(`button`,{type:`button`,onClick:()=>s(t.key),className:`inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-medium transition-colors ${a===t.key?`bg-secondary text-foreground`:`text-muted-foreground hover:text-foreground`}`,children:[(0,_.jsx)(n,{size:13}),e(`highScores.tabs.${t.key}`)]},t.key)})}),(0,_.jsxs)(`div`,{className:`overflow-x-auto rounded-2xl border border-border/50 bg-gradient-to-b from-white/[0.025] to-transparent px-3 py-1 sm:px-4`,children:[a===`wins`&&(0,_.jsx)(L,{rows:P,offset:N}),a===`multi`&&(0,_.jsx)(R,{rows:P,offset:N}),a===`sports`&&(0,_.jsx)(B,{rows:P,offset:N})]}),(0,_.jsx)(A,{page:M,pageCount:j,total:k.length,onPage:u})]})]})}function A({page:e,pageCount:t,total:n,onPage:r}){let{t:i}=o();return t<=1?null:(0,_.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,_.jsx)(`span`,{children:i(`highScores.pager.summary`,{total:n.toLocaleString(`en-US`),page:e,pageCount:t})}),(0,_.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,_.jsxs)(`button`,{type:`button`,onClick:()=>r(Math.max(1,e-1)),disabled:e<=1,className:`inline-flex items-center gap-1 rounded-full border border-border/60 px-3 py-1.5 font-medium transition-colors hover:text-foreground disabled:opacity-40`,children:[(0,_.jsx)(s,{size:13}),` `,i(`highScores.pager.prev`)]}),(0,_.jsxs)(`button`,{type:`button`,onClick:()=>r(Math.min(t,e+1)),disabled:e>=t,className:`inline-flex items-center gap-1 rounded-full border border-border/60 px-3 py-1.5 font-medium transition-colors hover:text-foreground disabled:opacity-40`,children:[i(`highScores.pager.next`),` `,(0,_.jsx)(u,{size:13})]})]})]})}function j({head:e,children:t,minWidth:n=640}){return(0,_.jsxs)(`table`,{className:`w-full text-left text-sm`,style:{minWidth:n},children:[(0,_.jsx)(`thead`,{children:(0,_.jsx)(`tr`,{className:`text-[11px] uppercase tracking-[0.15em] text-muted-foreground/70`,children:e.map(e=>(0,_.jsx)(`th`,{className:`py-2.5 pr-5 font-medium ${e.right?`text-right`:``}`,children:e.label},e.label))})}),(0,_.jsx)(`tbody`,{children:t})]})}var M=e=>e===0?`text-amber-300`:e===1?`text-slate-300`:e===2?`text-orange-300`:``;function N({i:e}){return(0,_.jsx)(`td`,{className:`py-3 pr-5`,children:e<3?(0,_.jsx)(c,{size:13,className:M(e)}
1):(0,_.jsx)(`span`,{className:`text-xs text-muted-foreground/70`,children:e+1})})}function P({children:e,right:t,strong:n}){return(0,_.jsx)(`td`,{className:`py-3 pr-5 tabular-nums ${t?`text-right`:``} ${n?`font-medium text-foreground`:`text-muted-foreground`}`,children:e})}function F({cols:e}){let{t}=o();return(0,_.jsx)(`tr`,{children:(0,_.jsx)(`td`,{colSpan:e,className:`py-12 text-center text-sm text-muted-foreground`,children:t(`highScores.empty`)})})}function I({children:e}){return(0,_.jsx)(`tr`,{className:`border-t border-border/50 transition-colors hover:bg-white/[0.025]`,children:e})}function L({rows:e,offset:t}){let{t:n}=o();return(0,_.jsx)(j,{head:[{label:n(`highScores.table.rank`)},{label:n(`highScores.table.player`)},{label:n(`highScores.table.game`)},{label:n(`highScores.table.multiplier`),right:!0},{label:n(`highScores.table.payout`),right:!0}],children:e.length===0?(0,_.jsx)(F,{cols:5}):e.map((e,n)=>(0,_.jsxs)(I,{children:[(0,_.jsx)(N,{i:t+n}),(0,_.jsx)(P,{strong:!0,children:(0,_.jsx)(p,{account:e.account})}),(0,_.jsx)(`td`,{className:`py-3 pr-5`,children:(0,_.jsx)(h,{game:e.game})}),(0,_.jsx)(P,{right:!0,children:e.multiplier?`${e.multiplier.toFixed(2)}Ã`:`â`}),(0,_.jsx)(`td`,{className:`py-3 pr-5 text-right font-medium tabular-nums text-emerald-300/90`,children:v(e.payoutUsd)})]},e.id))})}function R({rows:e,offset:t}){let{t:n}=o();return(0,_.jsx)(j,{head:[{label:n(`highScores.table.rank`)},{label:n(`highScores.table.player`)},{label:n(`highScores.table.game`)},{label:n(`highScores.table.stake`),right:!0},{label:n(`highScores.table.multiplier`),right:!0},{label:n(`highScores.table.payout`),right:!0}],children:e.length===0?(0,_.jsx)(F,{cols:6}):e.map((e,n)=>(0,_.jsxs)(I,{children:[(0,_.jsx)(N,{i:t+n}),(0,_.jsx)(P,{strong:!0,children:(0,_.jsx)(p,{account:e.account})}),(0,_.jsx)(`td`,{className:`py-3 pr-5`,children:(0,_.jsx)(h,{game:e.game})}),(0,_.jsx)(P,{right:!0,children:v(e.stakeUsd)}),(0,_.jsxs)(`td`,{className:`py-3 pr-5 text-right font-medium tabular-nums text-primary`,children:[e.multiplier.toFixed(2),`Ã`]}),(0,_.jsx)(`td`,{className:`py-3 pr-5 text-right font-medium tabular-nums text-emerald-300/90`,children:v(e.payoutUsd)})]},e.id))})}function z(e){let t=e.betslip.bets;if(t.length>1)return`Multi (${t.length})`;let n=t[0]?.competitors??[];return n.length?n.join(` â `):t[0]?.tournament??`Bet`}function B({rows:e,offset:t}){let{t:n}=o();return(0,_.jsx)(j,{head:[{label:n(`highScores.table.rank`)},{label:n(`highScores.table.player`)},{label:n(`highScores.table.event`)},{label:n(`highScores.table.odds`),right:!0},{label:n(`highScores.table.stake`),right:!0},{label:n(`highScores.table.payout`),right:!0}],minWidth:720,children:e.length===0?(0,_.jsx)(F,{cols:6}):e.map((e,r)=>(0,_.jsxs)(I,{children:[(0,_.jsx)(N,{i:t+r}),(0,_.jsx)(P,{strong:!0,children:(0,_.jsx)(p,{account:e.account})}),(0,_.jsx)(P,{strong:!0,children:(0,_.jsx)(`span`,{className:`block max-w-[220px] truncate`,children:e.event??n(`highScores.betFallback`)})}),(0,_.jsx)(P,{right:!0,children:e.odds?e.odds.toFixed(2):`â`}),(0,_.jsx)(P,{right:!0,children:v(e.stakeUsd)}),(0,_.jsx)(`td`,{className:`py-3 pr-5 text-right font-medium tabular-nums text-emerald-300/90`,children:v(e.payoutUsd)})]},e.id))})}export{k as component};
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.