PageSourceSearch

https://foxleague.ai/assets/Challenges-CiYWh5ZF.js

js foxleague.ai collected 2026-10-05 13:49:17 UTC 25,546 bytes, 1 lines download raw bytes

1import{j as e,m as A,a as l}from"./motion-vendor-CK-a2t6Y.js";import{n as X}from"./Plus.es-CGR3-VId.js";import{l as ne}from"./SlidersHorizontal.es-dmteprBF.js";import{Q,K as ie,M as ae,n as ce,a5 as de,a6 as Z,O as pe}from"./index-DEqeXHOo.js";import{l as xe}from"./tournamentList-BEYkOOHe.js";import{L as me,P as fe}from"./Pager-C-9kduDU.js";import{s as ue,m as ge}from"./Shuffle.es-CzLzzCg4.js";import{n as he}from"./Star.es-B4ieSClN.js";import{n as le}from"./Lock.es-DuTZcDfJ.js";import{M as q}from"./MatchupTeam-BIkm2K8r.js";import{O as ve}from"./OnChainProofs-ZgkBcCxQ.js";import{F as Y}from"./FoxsyPrice-CmJqgdm2.js";import{d as ee,f as be}from"./format-BRyCMDlG.js";import{d as ye,s as je}from"./scoreLabel-CVibAHfG.js";import{i as J,a as ke}from"./challengeTarget-CqEuT2GL.js";import{b as U,L as te}from"./react-vendor-Do6Gfp74.js";import{T as we}from"./TierBadge-BwLseq_h.js";import"./core-vendor-4YwYXNuQ.js";import"./three-vendor-sBiimosO.js";import"./mvx-vendor-BGMFtqkf.js";import"./screenshot-vendor-k0ITeQhV.js";import"./paging-Dcl-HuI8.js";import"./CaretLeft.es-CkxG4qpR.js";import"./tournament-CfLAereN.js";const Ne={bronze:"Bronze",silver:"Silver",gold:"Gold"},_e={bronze:"one-v-one-pill-tier-bronze",silver:"one-v-one-pill-tier-silver",gold:"one-v-one-pill-tier-gold"},oe={bronze:"var(--tier-bronze, #b87333)",silver:"var(--tier-silver, #c9d1de)",gold:"var(--tier-gold, #ffb700)"},se={bronze:"var(--tier-bronze-text)",silver:"var(--tier-silver-text)",gold:"var(--tier-gold-text)"};function re(t){if(!t)return"";const s=new Date(t);if(Number.isNaN(s.getTime()))return"";const n=String(s.getDate()).padStart(2,"0"),m=s.toLocaleString("en-US",{month:"short"}),r=String(s.getHours()).padStart(2,"0"),x=String(s.getMinutes()).padStart(2,"0");return`${n} ${m}, ${r}:${x}`}function Se({tournament:t,index:s=0,currentUserId:n=null}){const m=U(),r=t.status==="open",x=t.status==="active"||t.status==="simulating",f=t.status==="completed",u=t.status==="cancelled",i=t.status==="pending_sc",k=!r&&!f&&!u&&!x&&!i,b=(t.participant_count??0)>=2,d=t.entry_fee_foxsy,I=d*2,g=J(t,n),L=r?ee(t.deadline):null,y=L?.urgent??!1,R=L?L.label:x?"In progress":i?"Awaiting chain":f||u?re(t.completed_at)||re(t.created_at):`Kickoff ${ee(t.starts_at).label}`,j=r?{label:"Open",bg:"var(--color-fox-dim)",color:"var(--color-fox-text)",border:"transparent"}:x?{label:"Live",bg:"var(--color-fox-dim)",color:"var(--color-fox-text)",border:"transparent"}:f?{label:`FT${ye(t.decided_by)}`,bg:"rgba(0, 200, 83, 0.10)",color:"var(--color-success-text)",border:"rgba(0, 200, 83, 0.20)"}:u?{label:"Cancelled",bg:"rgba(255, 59, 48, 0.10)",color:"var(--color-foul)",border:"transparent"}:i?{label:"Awaiting chain",bg:"rgba(250, 204, 21, 0.10)",color:"var(--color-accent-yellow)",border:"rgba(250, 204, 21, 0.30)"}:{label:"Locked",bg:"var(--color-surface-w04)",color:"var(--color-kit-faded)",border:"var(--color-line)"},$=oe[t.tier]??oe.silver,M=se[t.tier]??se.silver,D=Ne[t.tier]??t.tier,w=t.home_score??null,N=t.away_score??null,G=f&&w!==null&&N!==null,E=t.decided_by,O=je(E,t.home_penalty,t.away_penalty),_=t.home_penalty??null,z=t.away_penalty??null,S=O?(_??0)>(z??0):w!==null&&N!==null&&w>N,W=O?(z??0)>(_??0):w!==null&&N!==null&&N>w,C=t.home_user_id==null||t.home_user_id===t.creator_user_id,P=C?w:N,K=C?N:w,H=C?_:z,o=C?z:_,h=C?S:W,T=C?W:S,p=n!=null&&t.creator_user_id===n,F=ke(t,n,p),a=r&&!b&&!p&&!F,v=r&&!b&&F;return e.jsxs(A.article,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:s*.04},onClick:()=>m(`/challenges/${t.id}`),"data-testid":"one-v-one-card",className:"relative overflow-hidden cursor-pointer rounded-xl",style:{background:"linear-gradient(145deg, var(--color-tunnel) 0%, var(--color-dugout) 100%)",border:g?"1px solid var(--color-fox)":r?"1px solid var(--color-line-bright)":"1px solid var(--color-line)",boxShadow:g?"0 0 0 1px var(--color-fox-dim)":void 0,padding:"16px 20px 14px 24px"},children:[e.jsx("span",{"aria-hidden":!0,className:"absolute rounded-sm pointer-events-none",style:{left:0,top:14,bottom:14,width:3,background:t.tier==="gold"?`linear-gradient(180deg, ${$}, #ffe085, ${$})`:$,boxShadow:t.tier==="gold"?"0 0 8px rgba(255, 183, 0, 0.4)":void 0,opacity:.7}}
1),r&&e.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at 100% 50%, var(--color-fox-glow), transparent 60%)"}}),e.jsxs("header",{className:"flex flex-col md:flex-row md:items-baseline md:justify-between gap-2 md:gap-4 mb-2.5 relative",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[g&&e.jsx("span",{className:"inline-block px-2 py-0.5 rounded text-[11px] font-bold uppercase flex-shrink-0",style:{background:"var(--color-fox)",color:"var(--color-on-fox)",fontFamily:"var(--font-broadcast)",letterSpacing:"0.14em"},children:"FOR YOU"}),e.jsx("h3",{className:"truncate min-w-0 flex-1",style:{fontFamily:"var(--font-broadcast)",fontSize:24,lineHeight:1,fontWeight:600,letterSpacing:"0.005em",color:f?"var(--color-kit-secondary)":"var(--color-kit-primary)"},title:t.title,children:t.title})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap flex-shrink-0",children:[t.developer_mode&&e.jsx("span",{className:"inline-flex items-center px-2.5 rounded-full text-[12px] font-semibold uppercase",style:{fontFamily:"var(--font-broadcast)",letterSpacing:"0.10em",height:22,color:"var(--color-accent-violet)",background:"rgba(167,139,250,0.12)",border:"1px solid rgba(167,139,250,0.3)"},children:"Developers"}),e.jsx("span",{className:"inline-flex items-center px-2.5 rounded-full text-[12px] font-semibold uppercase",style:{fontFamily:"var(--font-broadcast)",letterSpacing:"0.10em",height:22,background:t.tier==="gold"?"rgba(255, 183, 0, 0.10)":t.tier==="silver"?"rgba(201, 209, 222, 0.10)":"rgba(184, 115, 51, 0.10)",color:M,border:`1px solid ${M}`},"data-testid":_e[t.tier],children:D}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 rounded-full text-[12px] font-semibold uppercase",style:{fontFamily:"var(--font-broadcast)",letterSpacing:"0.10em",height:22,background:j.bg,color:j.color,border:`1px solid ${j.border}`},children:[k&&e.jsx(le,{size:9,"aria-hidden":"true"}),j.label]}),R&&e.jsxs("span",{className:"text-[12px] whitespace-nowrap",style:{fontFamily:"var(--font-mono)",color:y?"var(--color-fox-text)":"var(--color-kit-faded)",letterSpacing:"0.02em"},children:[r?"⏱ ":"",R]})]})]}),e.jsxs("div",{className:"relative grid items-center gap-3 md:gap-6 grid-cols-[minmax(0,1fr)] md:grid-cols-[minmax(0,1fr)_190px_auto]",children:[e.jsx(Ce,{tournament:t,hasOpponent:b,showScoreBlock:G,creatorScore:P,opponentScore:K,creatorWon:h,opponentWon:T,isCompleted:f,showPensScore:O,creatorPen:H,opponentPen:o}),e.jsx(Fe,{wager:d,prizePool:I,isCancelled:u,distributeTxHash:t.distribute_tx_hash??null}),e.jsx(ze,{tournamentId:t.id,showJoinButton:a,showLockedChip:v,isCancelled:u})]})]})}function Ce({tournament:t,hasOpponent:s,showScoreBlock:n,creatorScore:m,opponentScore:r,creatorWon:x,opponentWon:f,isCompleted:u,showPensScore:i,creatorPen:k,opponentPen:c}){const b=t.creator_team_name??null,d=t.opponent_team_name??null;return e.jsxs("div",{className:"flex items-start gap-2 md:gap-3 min-w-0 justify-between md:justify-start w-full",children:[e.jsx(q,{badge:e.jsx(Q,{teamName:b??"Creator",size:44,badge:t.creator_badge??void 0}),name:b??void 0,title:b??void 0,nameClassName:"text-[14px] md:text-[15px]",nameStyle:{color:"var(--color-kit-primary)"}}),n?e.jsxs("div",{className:"flex items-center justify-center gap-2 px-2 flex-shrink-0 self-start h-[48px] min-w-[64px] md:min-w-[80px]","data-testid":"score-block",children:[e.jsx("span",{className:"text-[24px]",style:{fontFamily:"var(--font-broadcast)",fontWeight:600,color:x?"var(--color-fox-text)":"var(--color-kit-secondary)",lineHeight:1},"data-testid":"home-score",children:m}),i&&e.jsxs("span",{className:"text-[14px] md:text-[16px]",style:{fontFamily:"var(--font-broadcast)",fontWeight:600,color:(k??0)>(c??0)?"var(--color-fox-text)":"var(--color-kit-faded)",lineHeight:1},"data-testid":"home-pen",children:["(",k,")"]}),e.jsx("span",{className:"text-[16px] font-semibold",style:{color:"var(--color-kit-faded)"},children:":"}),i&&e.jsxs("span",{className:"text-[14px] md:text-[16px]",style:{fontFamily:"var(--font-broadcast)",fontWeight:600,color:(c??0)>(k??0)?"var(--color-fox-text)":"var(--color-kit-faded)",lineHeight:1},"data-testid":"away-pen",children:["(",c,")"]}),e.jsx("span",{className:"text-[24px]",style:{fontFamily:"var(--font-broadcast)",fontWeight:600,color:f?"var(--color-fox-text)":"var(--color-kit-secondary)",lineHeight:1},"data-testid":"away-score",children:r})]}):e.jsx("span",{className:"inline-flex items-center justify-center flex-shrink-0 self-start h-[48px] px-2 text-[14px] md:text-[18px] min-w-[64px] md:min-w-[80px]",style:{fontFamily:"var(--font-broadcast)",fontWeight:600,color:"var(--color-kit-faded)",letterSpacing:"0.2em"},"data-testid":"vs-divider",children:"vs"}
1),e.jsx(q,{badge:s?e.jsx(Q,{teamName:d??"Opponent",size:44,badge:t.opponent_badge??void 0}):e.jsx("div",{className:"flex items-center justify-center flex-shrink-0","data-testid":"opponent-placeholder",style:{width:44,height:48,borderRadius:8,border:"1.5px dashed var(--color-kit-faded)",background:"rgba(88, 97, 116, 0.08)",color:"var(--color-kit-faded)",fontFamily:"var(--font-broadcast)",fontSize:22,fontWeight:600,opacity:.6},children:"?"}),name:s?d??"Opponent":u?"No opponent":"Awaiting opponent",title:d??void 0,nameClassName:"text-[14px] md:text-[15px]",nameStyle:{color:s?"var(--color-kit-primary)":"var(--color-kit-faded)",fontStyle:s?"normal":"italic",fontWeight:s?600:500}})]})}function Fe({wager:t,prizePool:s,isCancelled:n,distributeTxHash:m}){return e.jsxs("div",{className:"flex flex-row md:flex-col items-center md:items-end justify-between md:justify-start gap-1 flex-shrink-0 w-full md:w-auto",children:[e.jsxs("div",{className:"flex items-baseline gap-1 leading-none",children:[e.jsx(Y,{amount:t,size:"sm",tone:"kit",compact:!0}),e.jsx("span",{className:"px-0.5",style:{color:"var(--color-kit-faded)",fontFamily:"var(--font-mono)"},children:"→"}),n?e.jsx("span",{style:{color:"var(--color-kit-faded)",fontFamily:"var(--font-mono)",fontSize:14,fontWeight:600},children:"-"}):e.jsx(Y,{amount:s,size:"default",tone:"fox"})]}),m&&e.jsx("div",{className:"flex items-center",children:e.jsx(ve,{txHash:m,label:"TX"})})]})}function ze({tournamentId:t,showJoinButton:s,showLockedChip:n,isCancelled:m}){const r=U(),x=f=>{f.stopPropagation(),r(`/challenges/${t}`)};return m?e.jsx("span",{className:"inline-flex items-center justify-center text-[14px] font-medium w-full md:w-auto",style:{fontFamily:"var(--font-broadcast)",letterSpacing:"0.12em",color:"var(--color-kit-faded)",opacity:.6,padding:"8px 16px",border:"1px solid var(--color-line)",borderRadius:8,textTransform:"uppercase"},children:"Refunded"}):s?e.jsx("button",{type:"button",onClick:x,className:"cursor-pointer w-full md:w-auto",style:{background:"var(--color-fox)",color:"var(--color-on-fox)",border:"none",padding:"10px 22px",fontFamily:"var(--font-broadcast)",fontSize:17,fontWeight:600,letterSpacing:"0.14em",borderRadius:8,textTransform:"uppercase"},children:"Join"}):n?e.jsxs("button",{type:"button",onClick:x,"aria-label":"Locked to opponent. View detail",className:"cursor-pointer w-full md:w-auto inline-flex items-center justify-center gap-2",style:{background:"transparent",color:"var(--color-kit-faded)",border:"1px solid var(--color-line)",padding:"8px 16px",fontFamily:"var(--font-broadcast)",fontSize:14,fontWeight:500,letterSpacing:"0.12em",borderRadius:8,textTransform:"uppercase"},children:[e.jsx(le,{size:12,"aria-hidden":"true"}),"Locked"]}):e.jsx("button",{type:"button",onClick:x,className:"cursor-pointer w-full md:w-auto",style:{background:"transparent",color:"var(--color-kit-secondary)",border:"1px solid var(--color-line)",padding:"8px 16px",fontFamily:"var(--font-broadcast)",fontSize:14,fontWeight:500,letterSpacing:"0.12em",borderRadius:8,textTransform:"uppercase"},children:"View →"})}const Te={knockout:ae,groups_knockout:ie,round_robin:ge,swiss:ue},Le={knockout:"Knockout",groups_knockout:"Groups + KO",round_robin:"Round Robin",swiss:"Swiss"};function Oe({tournament:t,index:s=0,currentUserId:n=null}){const m=U();if(t.max_teams===2)return e.jsx(Se,{tournament:t,index:s,currentUserId:n});const r=Te[t.format]||ae,x=t.featured,f=t.status==="open",u=t.status==="active"||t.status==="simulating",i=t.status==="completed",k=t.status==="pending_sc",c=f?be(t.deadline,""):"",b=k?"Awaiting chain":i?"Completed":u?"In Progress":c?`Closes in ${c}`:"Closed",d=t.participant_count??0,I=t.max_teams>0?Math.round(d/t.max_teams*100):0;return e.jsxs(A.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:s*.05},onClick:()=>m(`/tournaments/${t.id}`),className:"card-stadium p-5 cursor-pointer",style:x?{borderColor:"rgba(255,215,0,0.4)",boxShadow:"0 0 20px rgba(255,215,0,0.08)"}:void 0,children:[x&&e.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[e.jsx(he,{size:12,style:{color:"#ffd700",fill:"#ffd700"}}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{fontFamily:"var(--font-broadcast)",color:"#ffd700"},children:"Featured"})]}),e.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--color-fox-dim)"},children:e.jsx(r,{size:20,style:{color:"var(--color-fox-text)"}})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"text-[16px] font-bold leading-tight truncate",style:{fontFamily:"var(--font-broadcast)",color:"var(--color-kit-primary)"},children:t.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[e.jsx("span",{className:"text-[11px] uppercase tracking-wider",style:{color:"var(--color-kit-faded)"},children:t.format==="round_robin"&&t.home_and_away?"Double Round Robin":Le[t.format]||t.format}),e.jsx(we,{tier:t.tier}),t.developer_mode&&e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded",style:{color:"#a78bfa",background:"rgba(167,139,250,0.12)",border:"1px solid rgba(167,139,250,0.3)"},children:"Developers"})]})]})]}),e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-[11px]",style:{color:"var(--color-kit-faded)"},children:"Teams"}),e.jsxs("span",{className:"text-[12px] font-mono font-semibold",style:{color:"var(--color-kit-secondary)"}
1,children:[d,"/",t.max_teams]})]}),e.jsx("div",{className:"w-full h-1.5 rounded-full overflow-hidden",style:{background:"var(--color-void)"},children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${I}%`,background:"var(--color-fox)"}})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[t.entry_fee_foxsy>0?e.jsx(Y,{amount:t.entry_fee_foxsy,size:"sm"}):e.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--color-success-text)"},children:"FREE"}),e.jsx("span",{className:`text-[11px] font-medium ${u?"animate-pulse":""}`,style:{color:u?"var(--color-cyan)":i?"var(--color-success-text)":"var(--color-kit-faded)"},children:b})]})]})}const B=20;function st(){const[t,s]=l.useState([]),[n,m]=l.useState(null),[r,x]=l.useState(!0),[f,u]=l.useState(""),[i,k]=l.useState(null),[c,b]=l.useState(()=>sessionStorage.getItem("ch_status")||"all"),[d,I]=l.useState(()=>sessionStorage.getItem("ch_tier")||"all"),[g,L]=l.useState(()=>sessionStorage.getItem("ch_forMe")==="true"),[y,R]=l.useState(()=>sessionStorage.getItem("ch_dev")==="true"),[j,$]=l.useState(()=>sessionStorage.getItem("ch_sort")||"newest");l.useEffect(()=>{sessionStorage.setItem("ch_status",c),sessionStorage.setItem("ch_tier",d),sessionStorage.setItem("ch_forMe",String(g)),sessionStorage.setItem("ch_dev",String(y)),sessionStorage.setItem("ch_sort",j)},[c,d,g,y,j]);const[M,D]=l.useState(!1),w=l.useId(),N=[c!=="all",d!=="all",g,y].filter(Boolean).length,[G,E]=l.useState(1);l.useEffect(()=>{let o=!1;const h=ce()?.address;if(!h){k(null);return}return de(h).then(T=>{o||k(T?.id??null)}).catch(()=>{o||k(null)}),()=>{o=!0}},[]);const O=l.useCallback(async()=>{x(!0),u("");try{const o=await xe({kind:"challenge"});s(o.rows),m(o.complete?null:{held:o.rows.length,total:o.total})}catch{u("Failed to load challenges")}finally{x(!1)}},[]);l.useEffect(()=>{O()},[O]);const _=l.useMemo(()=>t.filter(o=>o.max_teams===2&&o.status!=="cancelled"),[t]),z=l.useMemo(()=>i===null?[]:_.filter(o=>J(o,i)&&o.status==="open"),[_,i]),S=l.useMemo(()=>{const o=_.filter(a=>!(c!=="all"&&a.status!==c||d!=="all"&&a.tier!==d||g&&(i===null||!J(a,i)&&a.creator_user_id!==i)||y&&a.developer_mode!==!0)),h=a=>a.entry_fee_foxsy*a.max_teams,T={open:0,active:1,completed:2,cancelled:3},p=a=>T[a.status]??99,F=[...o];return j==="pool_desc"?F.sort((a,v)=>c==="all"&&p(a)!==p(v)?p(a)-p(v):h(v)-h(a)):j==="pool_asc"?F.sort((a,v)=>c==="all"&&p(a)!==p(v)?p(a)-p(v):h(a)-h(v)):F.sort((a,v)=>c==="all"&&p(a)!==p(v)?p(a)-p(v):v.id-a.id),F},[_,c,d,g,y,i,j]);l.useEffect(()=>{E(1)},[c,d,g,y,j]);const W=Math.max(1,Math.ceil(S.length/B)),C=Math.min(G,W),P=(C-1)*B,K=Math.min(P+B,S.length),H=S.slice(P,K);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4 sm:mb-6",children:[e.jsx("h1",{className:"page-title",children:"1vs1 CHALLENGES"}),e.jsxs(te,{to:"/challenges/create",className:"flex shrink-0 items-center gap-2 px-4 py-2.5 min-h-[44px] rounded-lg text-[14px] font-semibold no-underline cursor-pointer",style:{background:"var(--color-fox)",color:"var(--color-on-fox)"},children:[e.jsx(X,{size:16}),"Create 1vs1"]})]}),z.length>0&&e.jsxs(A.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:"rounded-lg px-4 py-3 mb-4 flex items-center gap-3",style:{background:"linear-gradient(135deg, rgba(251,146,60,0.10), rgba(251,146,60,0.02))",border:"1px solid var(--color-fox)"},children:[e.jsx(Z,{size:18,style:{color:"var(--color-fox-text)"}}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-[13px] font-bold",style:{color:"var(--color-kit-primary)"},children:z.length===1?"You've been challenged!":`${z.length} challenges waiting for you`}),e.jsx("p",{className:"text-[12px]",style:{color:"var(--color-kit-faded)"},children:"Accept before the timer runs out. Your opponent already paid in."})]}),e.jsx("button",{onClick:()=>L(!0),className:"text-[12px] font-semibold px-3 py-1.5 rounded-lg cursor-pointer",style:{background:"var(--color-fox)",color:"var(--color-on-fox)"},children:"Filter to mine"})]}),e.jsxs("div",{"data-testid":"challenges-toolbar",className:"flex sm:hidden items-center gap-3 mb-3",children:[e.jsxs("button",{type:"button",className:"btn btn-secondary inline-flex items-center gap-2 min-h-[44px]",style:M?{borderColor:"var(--color-fox)"}:void 0,"aria-expanded":M,"aria-controls":w,onClick:()=>D(o=>!o),"data-testid":"challenges-filters-toggle",children:[e.jsx(ne,{size:18}),"Filters",N>0&&e.jsx("span",{"data-testid":"challenges-filters-count",className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 rounded-full text-[11px] font-bold",style:{background:"var(--color-fox)",color:"var(--color-on-fox)"},children:N})]}),e.jsxs("span",{"data-testid":"challenges-shown-phone",className:"text-[13px] ml-auto",style:{fontFamily:"var(--font-mono)",color:"var(--color-kit-faded)"},children:[e.jsx("strong",{style:{color:"var(--color-kit-primary)",fontWeight:600},children:S.length})," shown"]})]}),e.jsxs(A.div,{id:w,"data-testid":"challenges-filters",initial:{opacity:0,y:10}
1,animate:{opacity:1,y:0},className:`${M?"":"max-sm:hidden "}grid grid-cols-2 gap-3 sm:flex sm:flex-wrap sm:items-center sm:gap-x-5 sm:gap-y-3 mb-3 rounded-lg px-4 py-3 sm:py-2.5`,style:{background:"var(--color-dugout)",border:"1px solid var(--color-line)"},children:[e.jsx(V,{label:"Status",value:c,onChange:o=>b(o),options:[{value:"all",label:"All"},{value:"open",label:"Open"},{value:"active",label:"Live"},{value:"completed",label:"Completed"}]}),e.jsx(V,{label:"Tier",value:d,onChange:o=>I(o),options:[{value:"all",label:"All"},{value:"bronze",label:"Bronze"},{value:"silver",label:"Silver"},{value:"gold",label:"Gold"}]}),e.jsx(V,{label:"Sort",value:j,onChange:o=>$(o),options:[{value:"newest",label:"Newest first"},{value:"pool_desc",label:"Highest pool"},{value:"pool_asc",label:"Lowest pool"}]}),e.jsxs("span",{className:"max-sm:hidden text-[13px] self-end pb-2 sm:self-auto sm:pb-0",style:{fontFamily:"var(--font-mono)",color:"var(--color-kit-faded)"},children:[e.jsx("strong",{style:{color:"var(--color-kit-primary)",fontWeight:600},children:S.length})," ","shown"]}),i!==null&&e.jsxs("label",{className:"col-span-2 justify-center sm:col-span-1 sm:justify-start sm:ml-auto inline-flex items-center gap-2 cursor-pointer text-[13px] font-medium px-3 rounded-full",style:{border:g?"1px solid var(--color-fox)":"1px solid var(--color-line)",color:g?"var(--color-fox-text)":"var(--color-kit-secondary)",background:g?"var(--color-fox-glow)":"transparent",height:28,minHeight:40,transition:"all 0.15s"},children:[e.jsx("input",{type:"checkbox",checked:g,onChange:o=>L(o.target.checked),className:"cursor-pointer",style:{accentColor:"var(--color-fox)"}}),"Addressed to me only"]}),e.jsxs("label",{className:`col-span-2 justify-center sm:col-span-1 sm:justify-start ${i===null?"sm:ml-auto":""} inline-flex items-center gap-2 cursor-pointer text-[13px] font-medium px-3 rounded-full`,style:{border:y?"1px solid var(--color-fox)":"1px solid var(--color-line)",color:y?"var(--color-fox-text)":"var(--color-kit-secondary)",background:y?"var(--color-fox-glow)":"transparent",height:28,minHeight:40,transition:"all 0.15s"},children:[e.jsx("input",{type:"checkbox",checked:y,onChange:o=>R(o.target.checked),className:"cursor-pointer",style:{accentColor:"var(--color-fox)"}}),"Developers only"]})]}),r?e.jsx(pe,{size:"lg",text:"Loading challenges...",fullPage:!0}):f?e.jsxs("div",{className:"card-stadium p-8 text-center",children:[e.jsx("p",{className:"text-[14px] mb-3",style:{color:"var(--color-foul)"},children:f}),e.jsx("button",{onClick:O,className:"btn-ghost text-[14px] px-4 py-2 cursor-pointer",children:"Retry"})]}):_.length===0?e.jsxs(A.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"card-stadium p-16 text-center",children:[e.jsx(Z,{size:48,style:{color:"var(--color-kit-faded)"},className:"mx-auto mb-3"}),e.jsx("p",{className:"text-[16px]",style:{color:"var(--color-kit-secondary)"},children:"No 1vs1 challenges yet"}),e.jsx("p",{className:"text-[13px] mt-1",style:{color:"var(--color-kit-faded)"},children:"Be the first to challenge someone!"}),e.jsxs(te,{to:"/challenges/create",className:"inline-flex items-center gap-2 mt-4 px-4 py-2 rounded-lg text-[13px] font-semibold no-underline cursor-pointer",style:{background:"var(--color-fox)",color:"var(--color-on-fox)"},children:[e.jsx(X,{size:14}),"Create the first one"]})]}):S.length===0?e.jsxs("div",{className:"card-stadium p-12 text-center",children:[e.jsx("p",{className:"text-[14px]",style:{color:"var(--color-kit-secondary)"},children:"No challenges match the current filters."}),e.jsx("button",{onClick:()=>{b("all"),I("all"),L(!1),R(!1)},className:"btn-ghost text-[13px] mt-3 px-4 py-2 cursor-pointer",children:"Reset filters"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2",children:H.map((o,h)=>{const T={open:"Open",active:"Active",completed:"Recently completed",cancelled:"Cancelled"},p=h>0?H[h-1]:null,F=c==="all"&&(!p||p.status!==o.status)&&T[o.status]!==void 0;return e.jsxs(l.Fragment,{children:[F&&e.jsxs("h3",{className:"flex items-center gap-3 mt-3 mb-1 first:mt-0",style:{fontFamily:"var(--font-broadcast)",fontSize:"13px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--color-kit-faded)"},children:[e.jsx("span",{"aria-hidden":!0,style:{height:1,width:28,background:"var(--color-line)"}}),T[o.status],e.jsx("span",{"aria-hidden":!0,style:{height:1,flex:1,background:"var(--color-line)"}})]}),e.jsx(Oe,{tournament:o,index:h,currentUserId:i})]},o.id)})}),n&&e.jsx(me,{testId:"challenges-incomplete",held:n.held,total:n.total,noun:"challenges"}),e.jsx(fe,{variant:"numbered",page:C-1,pageSize:B,total:S.length,onPage:o=>E(o+1)})]})]})}function V({label:t,value:s,onChange:n,options:m}){return e.jsxs("div",{className:"flex flex-col gap-1.5 min-w-0 sm:flex-row sm:items-center sm:gap-2",children:[e.jsx("span",{className:"text-[12px] uppercase font-medium flex-shrink-0",style:{fontFamily:"var(--font-broadcast)",letterSpacing:"0.18em",color:"var(--color-kit-faded)"},children:t}),e.jsx("select",{value:s,onChange:r=>n(r.target.value),className:"cursor-pointer outline-none w-full sm:w-auto",style:{background:"var(--color-tunnel)",color:"var(--color-kit-primary)",border:"1px solid var(--color-line)",borderRadius:6,padding:"5px 28px 5px 10px",fontSize:13,fontFamily:"var(--font-commentary)",fontWeight:500,minWidth:120,height:28,minHeight:40,appearance:"none",WebkitAppearance:"none",backgroundImage:`url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b97a8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 10px center"},children:m.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))})]})}export{st as TournamentChallenges};

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.