PageSourceSearch

https://keralaathletics.org/assets/MeetResultDetail-BDZo4Z2W.js

js keralaathletics.org collected 2026-10-02 14:29:04 UTC 52,138 bytes, 16 lines download raw bytes

1import{c as Ne,r as p,b as wt,h as yt,a as kt,j as e,L as ae}from"./index-D3Vf-90J.js";import{N as Xe,M as Ct,b as et,j as be,f as It}from"./Footer-ByKrdv9y.js";import{B as V}from"./badge-CQ6OOA3n.js";import{I as Tt}from"./input-m6o1_p8b.js";import{T as tt,a as st,b as re,c as I,d as nt,e as T}from"./table-Btt2Z6Of.js";import{T as He,a as qe,b as H,c as q}from"./tabs-DvgSzQyM.js";import{D as $t,a as zt,b as Pt}from"./dialog-NXGkq2s3.js";import{A as Ge}from"./AthletePhoto-CoXNM-5J.js";import{n as at,E as Et,q as Mt,C as St,k as At,l as Dt,u as ee,v as G,d as rt,c as Lt,x as Ft,y as Rt,w as _e,g as We,j as it,z as Ue,e as Bt,A as Ot,B as Ht,D as Ke,F as ne,G as qt,h as Gt,H as ie,I as ve,J as oe,f as _t,o as Wt}from"./meet-results-feed-DZyUfI0F.js";import{m as Ut}from"./meet-results-Bw2eb5lZ.js";import{C as Ve,T as Kt,m as Vt}from"./meet-covers-DGo60WcJ.js";import{C as je}from"./chevron-left-DmJtvM97.js";import{C as Qt}from"./circle-check-BVR9LRcs.js";import{C as Jt}from"./circle-alert-BpTieaoP.js";import{U as Qe}from"./users-CKaxzwPa.js";import{B as ot}from"./building-2-ClyoXCZh.js";import{T as le}from"./trophy-DnaU0_1M.js";import{A as Yt}from"./award-zB4uOCw9.js";import{M as we}from"./medal-CjZ-JDCn.js";import{S as Zt}from"./search-DlAMCRz_.js";import"./index-DiyM8hgM.js";import"./index-CMi662kW.js";import"./Combination-CuxU35N_.js";import"./image-utils-Dh8CG_2V.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Xt=Ne("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const es=Ne("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const ts=Ne("Wind",[["path",{d:"M12.8 19.6A2 2 0 1 0 14 16H2",key:"148xed"}],["path",{d:"M17.5 8a2.5 2.5 0 1 1 2 4H2",key:"1u4tom"}],["path",{d:"M9.8 4.4A2 2 0 1 1 11 8H2",key:"75valh"}]]),ye={background:"var(--gradient-green-rich)"},S=({rank:s,size:i="md",showMedal:o=!1})=>{const r={1:"bg-gradient-gold text-secondary-foreground shadow-glow",2:"bg-gradient-to-br from-slate-200 to-slate-400 text-slate-900",3:"bg-gradient-to-br from-amber-500 to-amber-700 text-white"},a=i==="sm"?"w-7 h-7 text-xs":"w-9 h-9 text-sm";return e.jsx("div",{className:`${a} rounded-full flex items-center justify-center font-poppins font-bold mx-auto ${s&&r[s]||"bg-muted text-muted-foreground"}`,children:o&&s&&s<=3?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:i==="sm"?"w-3.5 h-3.5":"w-4 h-4","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:["Gold","Silver","Bronze"][s-1]})]}):s??"–"})},lt=p.createContext(at(null)),ke=({many:s,lower:i})=>{const o=p.useContext(lt),r=s?o.many:o.one;return e.jsx(e.Fragment,{children:i?r.toLowerCase():r})},te=({title:s,hint:i})=>e.jsxs("div",{className:"text-center py-16 border border-dashed border-border rounded-2xl bg-card/70",children:[e.jsx(le,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground/40"}),e.jsx("p",{className:"font-poppins font-semibold text-foreground",children:s}),i&&e.jsx("p",{className:"font-inter text-sm text-muted-foreground mt-1",children:i})]}),Je=8,Ye=s=>{const i=String(s||"").trim().toLowerCase();return!i||i==="mixed"?null:i.startsWith("m")?"men":i.startsWith("f")||i.startsWith("w")?"women":null},se=({label:s,value:i,hint:o,icon:r})=>e.jsx("div",{className:"rounded-2xl border border-border bg-card shadow-soft p-4 sm:p-5 transition-shadow hover:shadow-medium",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-inter text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:s}),e.jsx("p",{className:"font-poppins text-2xl sm:text-3xl font-bold text-foreground mt-1.5 sm:mt-2 tabular-nums",children:i}),o&&e.jsx("p",{className:"font-inter text-xs text-muted-foreground mt-1 hidden sm:block",children:o})]}),e.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(r,{className:"w-[18px] h-[18px] text-primary"})})]})}),Ze=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,ss=(s,i=1500)=>
16{const[o,r]=p.useState(s),[a,l]=p.useState(Ze);return p.useEffect(()=>{if(Ze()){r(s),l(!0);return}let c=0;const u=performance.now(),d=m=>{const h=Math.min(1,(m-u)/i);r(s*(1-Math.pow(1-h,3))),h<1?c=requestAnimationFrame(d):l(!0)};return r(0),l(!1),c=requestAnimationFrame(d),()=>cancelAnimationFrame(c)},[s,i]),{value:o,landed:a}},ns=[{left:4,delay:0,drift:22,size:"w-1.5 h-2.5",tone:"bg-gradient-gold"},{left:11,delay:.75,drift:-16,size:"w-1 h-2",tone:"bg-white/70"},{left:17,delay:1.6,drift:26,size:"w-2 h-3",tone:"bg-gradient-gold"},{left:23,delay:.35,drift:-12,size:"w-1.5 h-2.5",tone:"bg-gradient-gold"},{left:29,delay:2.15,drift:18,size:"w-1 h-2",tone:"bg-white/60"},{left:35,delay:1.1,drift:-24,size:"w-1.5 h-3",tone:"bg-gradient-gold"},{left:41,delay:.5,drift:14,size:"w-2 h-2.5",tone:"bg-white/70"},{left:47,delay:2.6,drift:-18,size:"w-1.5 h-2.5",tone:"bg-gradient-gold"},{left:53,delay:.9,drift:20,size:"w-1 h-2",tone:"bg-gradient-gold"},{left:58,delay:1.85,drift:-14,size:"w-1.5 h-2.5",tone:"bg-white/60"},{left:64,delay:.2,drift:24,size:"w-2 h-3",tone:"bg-gradient-gold"},{left:70,delay:1.35,drift:-20,size:"w-1 h-2.5",tone:"bg-gradient-gold"},{left:75,delay:2.35,drift:12,size:"w-1.5 h-2.5",tone:"bg-white/70"},{left:81,delay:.6,drift:-22,size:"w-1.5 h-3",tone:"bg-gradient-gold"},{left:86,delay:1.7,drift:16,size:"w-1 h-2",tone:"bg-gradient-gold"},{left:90,delay:1,drift:-10,size:"w-2 h-2.5",tone:"bg-white/60"},{left:95,delay:2.9,drift:20,size:"w-1.5 h-2.5",tone:"bg-gradient-gold"},{left:8,delay:2.45,drift:-18,size:"w-1.5 h-2.5",tone:"bg-gradient-gold"},{left:44,delay:3.2,drift:22,size:"w-1 h-2",tone:"bg-white/70"},{left:67,delay:3.05,drift:-16,size:"w-1.5 h-3",tone:"bg-gradient-gold"}],as=({leader:s,share:i,final:o=!1,celebrate:r=!1})=>{const{value:a,landed:l}=ss(s.totalPoints),[c,u]=p.useState(!1);p.useEffect(()=>{const m=requestAnimationFrame(()=>u(!0));return()=>cancelAnimationFrame(m)},[]);const d=Number.isInteger(s.totalPoints)?0:1;return e.jsx("div",{className:`rounded-2xl h-full shadow-strong ${r?"winner-frame p-[3px] animate-winner-card":""}`,children:e.jsxs("div",{className:`${r?"rounded-[calc(1rem-3px)]":"rounded-2xl"} p-6 text-white relative overflow-hidden h-full`,style:ye,children:[e.jsx("div",{className:"absolute -right-10 -top-10 w-40 h-40 rounded-full bg-white/5","aria-hidden":"true"}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute inset-y-0 -left-1/4 w-1/4 bg-gradient-to-r from-transparent via-white/45 to-transparent animate-winner-sweep pointer-events-none","aria-hidden":"true"}),e.jsx("div",{className:"absolute inset-0 rounded-2xl ring-2 ring-inset ring-gold animate-winner-ring pointer-events-none","aria-hidden":"true"}),e.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none","aria-hidden":"true",children:ns.map((m,h)=>e.jsx("span",{className:`absolute top-0 rounded-[1px] animate-winner-confetti ${m.size} ${m.tone}`,style:{left:`${m.left}%`,animationDelay:`${m.delay}s`,"--drift":`${m.drift}px`}},h))})]}),e.jsxs("p",{className:"label-tag-light",children:[e.jsx(le,{className:"w-3.5 h-3.5"})," ",o?"Champions":e.jsxs(e.Fragment,{children:["Leading ",e.jsx(ke,{lower:!0})]})]}),e.jsx("p",{className:"font-poppins text-xl font-bold mt-3 uppercase leading-snug break-words",children:s.organizationName||"—"}),e.jsxs("div",{className:"flex items-end justify-between gap-4 mt-5",children:[e.jsx("span",{className:`font-poppins text-5xl font-bold tabular-nums text-gold inline-block ${r&&l?"animate-winner-score":""}`,children:a.toFixed(d)}),e.jsxs("span",{className:"font-inter text-sm text-white/70 pb-2",children:[i,"% of all points"]})]}),e.jsx("div",{className:"mt-4 h-1.5 rounded-full bg-white/15 overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-gold transition-[width] duration-[1400ms] ease-out motion-reduce:transition-none",style:{width:`${c?Math.min(100,i):0}%`}})}),e.jsx("div",{className:"flex gap-8 mt-5 pt-5 border-t border-white/15",children:["Gold","Silver","Bronze"].map((m,h)=>{var f;return e.jsxs("div",{children:[e.jsx("p",{className:"font-poppins text-lg font-bold tabular-nums",children:((f=s.placeCounts)==null?void 0:f[h])??0}),e.jsx("p",{className:"font-inter text-[11px] uppercase tracking-wider text-white/60",children:m})]},m)})})]})})},rs=({rows:s,totalPoints:i})=>e.jsxs("div",{className:"rounded-2xl border border-border bg-card shadow-soft p-6 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[e.jsx(ot,{className:"w-4 h-4 text-primary"}),e.jsxs("p",{className:"font-poppins text-sm font-semibold text-foreground",children:["Top ",e.jsx(ke,{many:!0})]})]}),e.jsx("div",{className:"space-y-4",children:s.map(o=>{const r=i?Math.round(o.totalPoints/i*100):0;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-1.5",children:[e.jsx("span",{className:"font-inter text-xs text-muted-foreground truncate min-w-0",children:o.organizationName||o.organizationCode||"—"}),e.jsx("span",{className:"font-poppins text-xs font-bold text-foreground tabular-nums flex-shrink-0",children:o.totalPoints})]}),e.jsx("div",{className:"h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${o.rank===1?"bg-gradient-gold":"bg-primary/60"}`,style:{width:`${r}%`}})})]},o.teamId||o.organizationCode||o.rank)})})]}),is=({medals:s,relay:i,photos:o,measured:r,eventName:a})=>e.jsx("div",{className:"grid sm:grid-cols-3 gap-4 mb-6",children:s.map((l,c)=>{const u=l.position===1;return e.jsxs("div",{className:`rounded-2xl p-5 relative overflow-hidden ${u?"text-white shadow-strong":"bg-card border border-border shadow-soft"}`,style:u?ye:void 0,children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(S,{rank:l.position,size:"sm",showMedal:!0}),!i&&e.jsx(_,{userId:l.userId,name:ie(l),photos:o,position:l.position,size:"sm",onDark:u})]}),e.jsx("span",{className:`font-inter text-[11px] uppercase tracking-wider ${u?"text-white/60":"text-muted-foreground"}`,children:i?"Team":`Chest ${ve(l)}`})]}),e.jsx("p",{className:`font-poppins text-sm font-bold uppercase leading-snug ${u?"":"text-foreground"}`,children:ie(l)}),e.jsx("p",{className:`font-inter text-xs mt-0.5 truncate ${u?"text-white/70":"text-muted-foreground"}`,children:l.organizationName||"INDEPENDENT"}),e.jsx("p",{className:`font-poppins text-2xl font-bold tabular-nums mt-3 ${u?"text-gold":"text-primary"}`,children:l.status!=="Done"?l.status:oe(l.performance,r,a)})]},`${l.registrationId||l.teamId||c}-${c}`)})}),_=({userId:s,name:i,photos:o,position:r,size:a="md",onDark:l=!1})=>{const c=r===1||r===2||r===3?r:0,u={1:"bg-gradient-gold",2:"bg-gradient-to-br from-slate-200 to-slate-400",3:"bg-gradient-to-br from-amber-500 to-amber-700"},d=c?{sm:"w-16 h-16",md:"w-14 h-14",lg:"w-14 h-14"}[a]:{sm:"w-9 h-9",md:"w-10 h-10",lg:"w-11 h-11"}[a],m=l?"bg-white/10 text-white":"bg-muted text-muted-foreground";return c?e.jsx("div",{className:`${d} ${u[c]} rounded-2xl p-[2px] flex-shrink-0 shadow-soft`,children:e.jsx("div",{className:`w-full h-full ${m} rounded-[0.7rem] overflow-hidden flex items-center justify-center font-poppins text-xs font-bold`,children:e.jsx(Ge,{userId:s,name:i,photos:o})})}):e.jsx("div",{className:`${d} ${m} rounded-full flex-shrink-0 flex items-center justify-center overflow-hidden border-2 ${l?"border-white/25":"border-border"} font-poppins text-[10px] font-bold`,children:e.jsx(Ge,{userId:s,name:i,photos:o})})},os=({round:s,event:i,photos:o})=>{const r=G(i);return e.jsx("div",{className:"divide-y divide-border",children:s.results.map((a,l)=>{var u;const c=ie(a);return e.jsxs("div",{className:`flex items-center gap-3 p-3.5 ${a.position===1?"bg-secondary/[0.07]":""}`,children:[e.jsx(S,{rank:a.position,size:"sm"}),!r&&e.jsx(_,{userId:a.userId,name:c,photos:o,position:a.position,size:"lg"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"font-poppins font-semibold text-foreground uppercase text-[13px] leading-tight break-words",children:c}),e.jsx("span",{className:"font-poppins text-[10px] font-bold text-muted-foreground tabular-nums flex-shrink-0",children:ve(a)})]}),e.jsx("p",{className:"font-inter text-[11px] text-muted-foreground mt-0.5 break-words",children:a.organizationName||"INDEPENDENT"}),r&&((u=a.squad)!=null&&u.length)?e.jsx("p",{className:"font-inter text-[11px] text-muted-foreground
16/80 mt-1",children:a.squad.map(d=>d.athleteName).filter(Boolean).join(" · ")}):null,a.windAided&&e.jsx(V,{className:"mt-1.5 bg-accent text-accent-foreground font-inter text-[10px] hover:bg-accent",children:"Wind assisted"})]}),e.jsx("div",{className:"flex-shrink-0 text-right",children:a.status!=="Done"?e.jsx("span",{className:"font-poppins font-bold text-xs text-muted-foreground",children:a.status}):e.jsx("span",{className:`font-poppins font-bold tabular-nums whitespace-nowrap ${a.position===1?"text-lg text-primary":"text-base text-foreground"}`,children:oe(a.performance,i.measured,i.name)})})]},`${a.registrationId||a.teamId||l}-${l}`)})})},ls=({round:s,event:i,photos:o})=>{const r=G(i);return e.jsxs(tt,{children:[e.jsx(st,{children:e.jsxs(re,{className:"hover:bg-transparent border-border",children:[e.jsx(I,{className:"w-12 sm:w-16 text-center font-inter text-[11px] uppercase tracking-wider",children:"Rank"}),!r&&e.jsx(I,{className:"w-16 text-center font-inter text-[11px] uppercase tracking-wider hidden sm:table-cell",children:"Athlete"}),e.jsx(I,{className:"w-14 sm:w-20 text-center font-inter text-[11px] uppercase tracking-wider",children:"Chest"}),e.jsxs(I,{className:"font-inter text-[11px] uppercase tracking-wider",children:[r?"Team / ":"Name / ",e.jsx(ke,{})]}),e.jsxs(I,{className:"w-20 sm:w-32 text-right font-inter text-[11px] uppercase tracking-wider",children:[e.jsx("span",{className:"sm:hidden",children:"Perf"}),e.jsx("span",{className:"hidden sm:inline",children:"Performance"})]})]})}),e.jsx(nt,{children:s.results.map((a,l)=>{var u;const c=ie(a);return e.jsxs(re,{className:`border-border/70 transition-colors hover:bg-muted/40 ${a.position===1?"bg-secondary/[0.07]":""}`,children:[e.jsx(T,{className:"text-center py-3",children:e.jsx(S,{rank:a.position})}),!r&&e.jsx(T,{className:"text-center hidden sm:table-cell py-3",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(_,{userId:a.userId,name:c,photos:o,position:a.position})})}),e.jsx(T,{className:"text-center py-3",children:e.jsx("span",{className:"inline-flex min-w-[2.25rem] justify-center px-2 py-0.5 rounded-md bg-muted font-poppins text-xs font-bold text-foreground tabular-nums",children:ve(a)})}),e.jsxs(T,{className:"py-3 min-w-0",children:[e.jsx("div",{className:"font-poppins font-semibold text-foreground uppercase text-[13px] sm:text-sm leading-tight break-words",children:c}),e.jsx("div",{className:"font-inter text-[11px] sm:text-xs text-muted-foreground mt-0.5 break-words",children:a.organizationName||"INDEPENDENT"}),r&&((u=a.squad)!=null&&u.length)?e.jsx("div",{className:"font-inter text-xs text-muted-foreground/80 mt-1",children:a.squad.map(d=>d.athleteName).filter(Boolean).join(" · ")}):null,a.windAided&&e.jsx(V,{className:"mt-1.5 bg-accent text-accent-foreground font-inter text-[10px] hover:bg-accent",children:"Wind assisted"})]}),e.jsx(T,{className:"text-right py-3",children:a.status!=="Done"?e.jsx("span",{className:"font-poppins font-bold text-sm text-muted-foreground",children:a.status}):e.jsx("span",{className:`font-poppins font-bold tabular-nums whitespace-nowrap ${a.position===1?"text-lg sm:text-xl text-primary":"text-base sm:text-lg text-foreground"}`,children:oe(a.performance,i.measured,i.name)})})]},`${a.registrationId||a.teamId||l}-${l}`)})})]})},fe=({rows:s,photos:i,onSelect:o})=>e.jsx("div",{className:"rounded-2xl border border-border bg-card shadow-soft overflow-hidden divide-y divide-border",children:s.map(r=>e.jsxs("div",{role:o?"button":void 0,tabIndex:o?0:void 0,onClick:o?()=>o(r):void 0,onKeyDown:o?a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),o(r))}:void 0,className:`flex items-center gap-3 p-3 ${r.rank<=3?"bg-secondary/[0.07]":""} ${o?"group cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring":""}`,children:[e.jsx(S,{rank:r.rank,size:"sm"}),e.jsx(_,{userId:r.userId,name:r.athleteName||"—",photos:i,position:r.rank}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"font-poppins font-semibold text-foreground uppercase text-[13px] leading-tight break-words",children:[r.athleteName||"—",r.bibNumber!=null&&e.jsxs("span",{className:"font-inter text-xs text-muted-foreground",children:[" · ",r.bibNumber]})]}),e.jsx("div",{className:"font-inter text-[11px] text-muted-foreground mt-0.5 truncate",children:r.organizationName||"INDEPENDENT"})]}),e.jsx("span",{className:"font-poppins font-bold text-base text-primary tabular-nums flex-shrink-0",children:r.totalPoints}
16),o&&e.jsx(be,{className:"w-4 h-4 text-muted-foreground/50 flex-shrink-0 transition-transform group-hover:translate-x-0.5 group-hover:text-primary motion-reduce:transition-none","aria-hidden":"true"})]},r.registrationId||r.userId||r.rank))}),ge=({rows:s,pointsTable:i,nameHeader:o,renderName:r,highlightTop:a=1,onSelect:l})=>{const c=i.slice(0,8),u=Math.max(1,...s.map(d=>d.totalPoints));return e.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden bg-card shadow-soft",children:[e.jsx("div",{className:"sm:hidden divide-y divide-border",children:s.map(d=>{const m=(d.placeCounts||[]).slice(0,3),h=m.some(f=>f>0);return e.jsxs("div",{role:l?"button":void 0,tabIndex:l?0:void 0,onClick:l?()=>l(d):void 0,onKeyDown:l?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),l(d))}:void 0,className:`flex items-center gap-3 p-3.5 ${d.rank<=a?"bg-secondary/[0.07]":""} ${l?"group cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring":""}`,children:[e.jsx(S,{rank:d.rank,size:"sm"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[r(d),h&&e.jsx("div",{className:"flex items-center gap-2.5 mt-1.5",children:m.map((f,w)=>e.jsxs("span",{className:"flex items-center gap-1 font-inter text-[11px] text-muted-foreground",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${["bg-gradient-gold","bg-slate-300","bg-amber-600"][w]}`,"aria-hidden":"true"}),f]},w))})]}),e.jsx("span",{className:"font-poppins font-bold text-lg text-primary tabular-nums flex-shrink-0 whitespace-nowrap",children:d.totalPoints}),l&&e.jsx(be,{className:"w-4 h-4 text-muted-foreground/50 flex-shrink-0 transition-transform group-hover:translate-x-0.5 group-hover:text-primary motion-reduce:transition-none","aria-hidden":"true"})]},d.teamId||d.registrationId||d.rank)})}),e.jsxs(tt,{className:"hidden sm:table",children:[e.jsx(st,{className:"bg-muted/40",children:e.jsxs(re,{className:"hover:bg-transparent border-border",children:[e.jsx(I,{className:"w-12 sm:w-16 text-center font-inter text-[11px] uppercase tracking-wider",children:"Rank"}),e.jsx(I,{className:"font-inter text-[11px] uppercase tracking-wider",children:o}),c.map((d,m)=>e.jsx(I,{className:"w-12 text-center font-inter text-[11px] uppercase tracking-wider hidden md:table-cell",children:m<3?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:`w-4 h-4 mx-auto ${["text-gold","text-slate-400","text-amber-600"][m]}`,"aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:["Gold","Silver","Bronze"][m]})]}):m+1},m)),e.jsx(I,{className:"w-20 sm:w-40 text-right font-inter text-[11px] uppercase tracking-wider",children:"Points"})]})}),e.jsx(nt,{children:s.map(d=>e.jsxs(re,{role:l?"button":void 0,tabIndex:l?0:void 0,onClick:l?()=>l(d):void 0,onKeyDown:l?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l(d))}:void 0,className:`border-border/70 transition-colors hover:bg-muted/40 ${d.rank<=a?"bg-secondary/[0.07]":""} ${l?"group cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring":""}`,children:[e.jsx(T,{className:"text-center py-3",children:e.jsx(S,{rank:d.rank})}),e.jsx(T,{className:"py-3 min-w-0",children:r(d)}),c.map((m,h)=>{var f;return e.jsx(T,{className:"text-center font-inter text-sm hidden md:table-cell py-3",children:(f=d.placeCounts)!=null&&f[h]?d.placeCounts[h]:e.jsx("span",{className:"text-muted-foreground/40",children:"–"})},h)}),e.jsx(T,{className:"text-right py-3",children:e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("span",{className:"hidden sm:block w-20 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("span",{className:`block h-full rounded-full ${d.rank===1?"bg-gradient-gold":"bg-primary/60"}`,style:{width:`${Math.round(d.totalPoints/u*100)}%`}})}),e.jsx("span",{className:"font-poppins font-bold text-base sm:text-lg text-primary tabular-nums w-10 text-right whitespace-nowrap",children:d.totalPoints}),l&&e.jsx(be,{className:"w-4 h-4 text-muted-foreground/50 flex-shrink-0 transition-transform group-hover:translate-x-0.5 group-hover:text-primary motion-reduce:transition-none","aria-hidden":"true"})]})})]},d.teamId||d.registrationId||d.rank))})]})]})},ds=({category:s})=>{const i=ne(s.rows);return e.jsxs("div",{className:"rounded-2xl border border-border bg-card shadow-soft overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 sm:px-5 py-3 sm:py-4 border-b border-border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("span",{className:"w-1.5 h-5 rounded-full bg-gradient-gold flex-shrink-0","aria-hidden":"true"}),e.jsx("h3",{className:"font-poppins text-base font-bold text-foreground truncate",children:s.name})]}),e.jsx("span",{className:"font-inter text-[11px] text-muted-foreground whitespace-nowrap flex-shrink-0",children:s.rows.length===0?"N
16o points":`of ${s.rows.length} ${s.rows.length===1?"team":"teams"}`})]}),e.jsxs("div",{className:"divide-y divide-border flex-1",children:[s.rows.length===0&&e.jsx("p",{className:"font-inter text-sm text-muted-foreground text-center px-4 py-8",children:s.scoringRounds===0?"No team points available for this category.":"No team points available yet."}),i.map(o=>{const r=(o.placeCounts||[]).slice(0,3);return e.jsxs("div",{className:`flex items-center gap-3 px-3.5 sm:px-4 py-3 ${o.rank===1?"bg-secondary/[0.07]":""}`,children:[e.jsx(S,{rank:o.rank,size:"sm",showMedal:o.rank<=3}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-poppins font-semibold text-foreground uppercase text-[13px] leading-tight break-words",children:o.organizationName||o.organizationCode||"—"}),e.jsxs("div",{className:"flex items-center gap-2.5 mt-1",children:[o.organizationCode&&e.jsx("span",{className:"font-inter text-[11px] text-muted-foreground",children:o.organizationCode}),r.map((a,l)=>a?e.jsxs("span",{className:"flex items-center gap-1 font-inter text-[11px] text-muted-foreground",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${["bg-gradient-gold","bg-slate-300","bg-amber-600"][l]}`,"aria-hidden":"true"}),e.jsxs("span",{className:"sr-only",children:[["Gold","Silver","Bronze"][l]," "]}),a]},l):null)]})]}),e.jsx("span",{className:"font-poppins font-bold text-lg text-primary tabular-nums flex-shrink-0 whitespace-nowrap",children:o.totalPoints})]},o.teamId||o.organizationCode||`${o.rank}-${o.organizationName}`)})]})]})},cs=s=>{if(!s)return"—";const i=s%100;return i>=11&&i<=13?`${s}th`:`${s}${["th","st","nd","rd"][s%10]||"th"}`},ms=({row:s,appearances:i,photos:o,onClose:r})=>{const a=(s==null?void 0:s.athleteName)||"—",l=i.filter(c=>c.points>0).length;return e.jsx($t,{open:!!s,onOpenChange:c=>!c&&r(),children:e.jsx(zt,{"aria-describedby":void 0,className:"max-w-lg p-0 gap-0 overflow-hidden max-h-[85vh] flex flex-col",children:s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-5 text-white relative overflow-hidden flex-shrink-0",style:ye,children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-28 h-28 rounded-full bg-white/5","aria-hidden":"true"}),e.jsxs("div",{className:"flex items-center gap-3.5",children:[e.jsx(_,{userId:s.userId,name:a,photos:o,position:s.rank,onDark:!0}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(Pt,{className:"font-poppins text-lg font-bold uppercase leading-snug break-words text-left",children:a}),e.jsxs("p",{className:"font-inter text-xs text-white/70 mt-0.5 break-words",children:[s.organizationName||"INDEPENDENT",s.bibNumber!=null&&e.jsxs(e.Fragment,{children:[" · Chest ",s.bibNumber]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-6 mt-4 pt-4 border-t border-white/15",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-poppins text-2xl font-bold tabular-nums text-gold",children:s.totalPoints}),e.jsx("p",{className:"font-inter text-[11px] uppercase tracking-wider text-white/60",children:"Points"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-poppins text-2xl font-bold tabular-nums",children:cs(s.rank)}),e.jsx("p",{className:"font-inter text-[11px] uppercase tracking-wider text-white/60",children:"Overall"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-poppins text-2xl font-bold tabular-nums",children:i.length}),e.jsx("p",{className:"font-inter text-[11px] uppercase tracking-wider text-white/60",children:i.length===1?"Event":"Events"})]})]})]}),e.jsx("div",{className:"overflow-y-auto",children:i.length===0?e.jsx("p",{className:"font-inter text-sm text-muted-foreground text-center px-4 py-10",children:"No events recorded for this athlete yet."}):e.jsx("div",{className:"divide-y divide-border",children:i.map((c,u)=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e.jsx(S,{rank:c.position,size:"sm"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"font-poppins text-[13px] font-semibold text-foreground break-words",children:[c.eventName,e.jsxs("span",{className:"font-inter text-[11px] text-muted-foreground",children:[" · ",c.roun
16d]})]}),e.jsxs("p",{className:"font-inter text-[11px] text-muted-foreground mt-0.5 break-words",children:[c.categoryName," · ",c.status!=="Done"?c.status:oe(c.performance,c.measured,c.eventName)]})]}),e.jsx("div",{className:"text-right flex-shrink-0",children:c.points>0?e.jsxs("span",{className:"font-poppins font-bold text-base text-primary tabular-nums",children:["+",c.points]}):e.jsx("span",{className:"font-inter text-[11px] text-muted-foreground",children:c.relay?"Team points":c.counted?"No points":"Not scored"})})]},`${c.eventName}-${c.round}-${u}`))})}),e.jsx("div",{className:"px-4 py-3 border-t border-border bg-muted/30 flex-shrink-0",children:e.jsxs("p",{className:"font-inter text-[11px] text-muted-foreground text-center",children:[l," of ",i.length," ",i.length===1?"event":"events"," scored"," · ",s.totalPoints," ",s.totalPoints===1?"point":"points"," in total"]})})]})})})},xs=({categories:s,categoryId:i,eventId:o,query:r,open:a,onQueryChange:l,onToggleCategory:c,onPick:u})=>e.jsxs("div",{className:"rounded-2xl border border-border bg-card shadow-soft overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-border bg-muted/30 space-y-3",children:[e.jsx("p",{className:"font-inter text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Programme"}),e.jsxs("div",{className:"relative",children:[e.jsx(Zt,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.jsx(Tt,{value:r,onChange:d=>l(d.target.value),placeholder:"Search events...",className:"font-inter h-10 pl-9 bg-card"})]})]}),e.jsx("div",{className:"max-h-[18rem] lg:max-h-[32rem] overflow-y-auto p-2",children:s.length===0?e.jsx("p",{className:"font-inter text-sm text-muted-foreground text-center py-8",children:"No events match that search."}):s.map(d=>{const m=!!a[d.sectionId]||!!r;return e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{type:"button",onClick:()=>c(d.sectionId),className:"w-full flex items-center justify-between gap-2 px-3 py-2.5 rounded-xl hover:bg-muted/60 transition-colors text-left",children:[e.jsx("span",{className:"font-poppins text-sm font-semibold text-foreground truncate",children:d.name||d.shortName||d.sectionId}),e.jsxs("span",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("span",{className:"font-inter text-[11px] text-muted-foreground tabular-nums",children:d.events.length}),e.jsx(It,{className:`w-4 h-4 text-muted-foreground transition-transform ${m?"rotate-180":""}`})]})]}),m&&e.jsx("div",{className:"pl-3 pb-1 space-y-0.5",children:d.events.map(h=>{const f=d.sectionId===i&&h.catalogEventId===o;return e.jsxs("button",{type:"button",onClick:()=>u(d.sectionId,h.catalogEventId),className:`w-full flex items-center justify-between gap-2 px-3 py-2 rounded-lg text-left transition-colors ${f?"bg-primary text-primary-foreground shadow-soft":"hover:bg-muted/60 text-muted-foreground"}`,children:[e.jsx("span",{className:"font-inter text-sm truncate",children:h.name||h.catalogEventId}),G(h)&&e.jsx("span",{className:`font-inter text-[10px] uppercase tracking-wider flex-shrink-0 ${f?"text-primary-foreground/70":"text-muted-foreground/60"}`,children:"Relay"})]},h.catalogEventId)})})]},d.sectionId)})})]}),dt=({text:s})=>s?e.jsx("div",{className:"bg-secondary text-secondary-foreground text-center font-inter text-sm font-semibold px-4 py-2",children:s}):null,ps=({meet:s,championships:i,basePath:o,backTo:r,backLabel:a,notice:l})=>{const[c,u]=p.useState(),[d,m]=p.useState(!1);p.useEffect(()=>{let w=!1;return _t().then(F=>!w&&u(F[s.eventId])).catch(()=>{}),()=>{w=!0}},[s.eventId]);const h=c&&!d?c:Vt(s.title,0),f=rt(s)==="live";return e.jsxs("div",{className:"min-h-screen font-inter",children:[e.jsx(Xe,{}),e.jsx(dt,{text:l}),e.jsxs("main",{children:[e.jsx("section",{className:"bg-gradient-hero hero-mesh py-16",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"max-w-3xl mx-auto text-center animate-fade-in",children:[e.jsx("div",{className:"mb-5",children:e.jsxs(ae,{to:r,className:"inline-flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-white/15 border border-white/25 font-poppins text-sm font-semibold text-primary-foreground hover:bg-white/25 transition-colors",children:[e.jsx(je,{className:"w-4 h-4"})," ",a]})}),e.jsxs("p",{className:"label-tag-light mb-3",children:[e.jsx(le,{className:"w-3.5 h-3.5"})," ",f?"Live results":"Results"]}),e.jsx("h1",{className:"font-poppins text-3xl md:text-5xl font-bold text-primary-foreground mb-4 text-balance",children:s.title||"Meet Results"}),e.jsx("p",{className:"font-inter text-base md:text-lg text-primary-foreground
16/85",children:"Choose a championship to follow its placings, heats and standings."})]})})}),e.jsx("section",{className:"py-14",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsx("div",{className:`grid gap-8 md:gap-10 mx-auto ${i.length===2?"sm:grid-cols-2 max-w-4xl":"sm:grid-cols-2 lg:grid-cols-3 max-w-6xl"}`,children:i.map((w,F)=>e.jsx(ae,{to:it(s.eventId,w.id,o),className:`group block rounded-3xl transition-transform duration-300 ease-out ${F%2===0?"-rotate-[1.5deg]":"rotate-[1.5deg]"} hover:rotate-0 hover:-translate-y-2 focus-visible:rotate-0 focus-visible:-translate-y-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 motion-reduce:transform-none`,children:e.jsxs("article",{className:"relative aspect-[4/3] rounded-3xl overflow-hidden border border-border shadow-medium transition-shadow duration-300 group-hover:shadow-strong",children:[e.jsx("img",{src:h,alt:"",loading:"lazy",onError:()=>m(!0),className:"absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105 motion-reduce:transform-none"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black via-black/75 via-45% to-black/10"}),e.jsx("h2",{className:"absolute inset-x-0 bottom-0 p-5 sm:p-6 font-poppins text-lg sm:text-xl md:text-2xl font-bold text-white leading-snug img-caption",children:w.name||"Championship"})]})},w.id))})})})]}),e.jsx(et,{})]})},Rs=({basePath:s=We,loadFeed:i=Gt,notice:o}={})=>{var Le,Fe,Re,Be;const{meetId:r=""}=wt(),[a,l]=p.useState(Et),[c,u]=p.useState(!0),[d,m]=p.useState(null),[h,f]=p.useState({}),[w,F]=p.useState(""),[Ce,Ie]=p.useState(""),[de,Te]=p.useState(""),[ct,ce]=p.useState({});p.useEffect(()=>{let t=!1;return i().then(x=>!t&&l(x)).catch(x=>!t&&m(x instanceof Error?x.message:"Failed to load results")).finally(()=>!t&&u(!1)),Mt().then(x=>!t&&f(x)).catch(()=>{}),()=>{t=!0}},[i]);const W=p.useMemo(()=>a.events.find(t=>t.eventId===r)||null,[a,r]),[$e]=yt(),me=$e.get(St),n=p.useMemo(()=>At(W,me),[W,me]),ze=Dt(W),$=at(n),U=ze.length>1,mt=U&&!me;p.useEffect(()=>{var x;if(!n)return;const t=n.categories.find(j=>j.events.length);F((t==null?void 0:t.sectionId)||""),Ie(((x=t==null?void 0:t.events[0])==null?void 0:x.catalogEventId)||""),ce(t?{[t.sectionId]:!0}:{}),Te(""),D(null)},[n==null?void 0:n.eventId,(Le=n==null?void 0:n.championship)==null?void 0:Le.id]);const Q=p.useMemo(()=>(n==null?void 0:n.categories)||[],[n]),R=Q.find(t=>t.sectionId===w)||null,v=(R==null?void 0:R.events.find(t=>t.catalogEventId===Ce))||null,xt=p.useMemo(()=>{const t=de.trim().toLowerCase();return t?Q.map(x=>({...x,events:x.events.filter(j=>(j.name||"").toLowerCase().includes(t))})).filter(x=>x.events.length>0):Q},[Q,de]),J=p.useMemo(()=>[...(v==null?void 0:v.rounds)||[]].sort((t,x)=>ee(t.round)-ee(x.round)),[v]),{athleteCount:pt,institutionCount:ht}=p.useMemo(()=>{var j;const t=new Set,x=new Set;for(const ue of(n==null?void 0:n.categories)||[])for(const K of ue.events)for(const N of K.rounds)for(const y of N.results){const L=y.organizationCode||y.organizationName;if(L&&x.add(L),(j=y.squad)!=null&&j.length)for(const z of y.squad){const g=z.registrationId||z.athleteName;g&&t.add(g)}else{const z=y.registrationId||y.userId||y.athleteName;z&&t.add(z)}}return{athleteCount:t.size,institutionCount:x.size}},[n]),A=p.useMemo(()=>{var z;const t=(n==null?void 0:n.individualStandings)||[];if(!t.length)return[];const x=new Map;let j=!1;for(const g of(n==null?void 0:n.categories)||[]){const P=Ye((z=g.genders)==null?void 0:z[0]);/\b(boys?|girls?)\b/i.test(g.name||"")&&(j=!0);for(const E of g.events)for(const b of E.rounds)for(const k of b.results){const C=k.registrationId||k.userId;if(!C||x.has(C))continue;const M=Ye(k.gender)||P;M&&x.set(C,M)}}const ue=new Set(t.map(g=>g.registrationId||g.userId||"")),K=new Map;for(const g of(n==null?void 0:n.categories)||[])for(const P of g.events){if(G(P))continue;const E=[...P.rounds].sort((b,k)=>ee(b.round)-ee(k.round)).pop();if(E)for(const b of E.results){const k=b.registrationId||b.userId||"",C=b.position;if(!k||ue.has(k)||!C||C<1||C>Je)continue;const M=K.get(k),Oe=M?[...M.placeCounts]:Array(Je).fill(0);Oe[C-1]+=1,K.set(k,{rank:0,totalPoints:0,registrationId:b.registrationId||void 0,userId:b.userId,athleteName:b.athleteName,bibNumber:b.bibNumber,organizationCode:b.organizationCode??null,organizationName:b.organizationName??null,placeCounts:Oe,bestPosition:Math.min((M==null?void 0:M.bestPosition)??C,C)})}}const N={men:{scored:[],unscored:[]},women:{scored:[],unscored:[]},unknown:{scored:[],unscored:[]}};for(const g of t)N[x.get(g.registrationId||g.userId||"")||"unknown"].scored.push(g);for(const[g,P]of K)N[x.get(g)||"unknown"].unscored.push(P);if(!N.men.scored.length&&!N.women.scored.length)return[{key:"all",label:"",rows:t}];const y=g=>{const P=[...g.unscored].sort((E,b)=>E.bestPosition-b.bestPosition||(E.athleteName||"").localeCompare(b.athleteName||"")).map(({bestPosition:E,...b})=>b);return _e([...g.scored,...P])},L=[];return(N.men.scored.length||N.men.unscored.length)&&L.push({key:"men",label:j?"Boys":"Men",rows:y(N.men)}),(N.women.scored.length||N.women.unscored.length)&&L.push({key:"women",label:j?"Girls":"Women",rows:y(N.women)}),(N.unknown.scored.length||N.unknown.unscored.length)&&L.push({key:"unknown",label:"Unclassified",rows:y(N.unknown)}),L},[n]),Y=n?rt(n):null,B=n?Lt(n):null,O=Y==="completed",ut=O&&["wayanad","thrissur","thiruvananthapuram"].includes((B==null?void 0:B.toLowerCase())??""),[xe,D]=p.useState(null),ft=p.useMemo(()=>Ft(n),[n]),gt=kt(),bt=$e.get("tab")||"results",jt=t=>{var j;const x=t.teamId||t.organizationCode;x&&gt(Wt(r,x,U?(j=n==null?void 0:n.championship)==null?void 0:j.id:null,
16s))},Pe=p.useMemo(()=>Rt(n),[n]),pe=p.useMemo(()=>_e((n==null?void 0:n.standings)||[]),[n]),Z=!!(n!=null&&n.pointsEnabled&&n.standings.length),Ee=Z&&Pe.length>0,Me=!!(n!=null&&n.individualPointsEnabled&&n.individualStandings.length),he=p.useMemo(()=>((n==null?void 0:n.standings)||[]).reduce((t,x)=>t+x.totalPoints,0),[n]),X=pe[0]||null,Nt=X&&he?Math.round(X.totalPoints/he*100):0,Se=t=>e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(_,{userId:t.userId,name:t.athleteName||"—",photos:h,position:t.rank}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-poppins font-semibold text-foreground uppercase text-[13px] sm:text-sm break-words",children:[t.athleteName||"—",t.bibNumber!=null&&e.jsxs("span",{className:"font-inter text-xs text-muted-foreground",children:[" · ",t.bibNumber]})]}),e.jsx("div",{className:"font-inter text-[11px] sm:text-xs text-muted-foreground mt-0.5 break-words",children:t.organizationName||"INDEPENDENT"})]})]}),vt=(t,x)=>{F(t),Ie(x),ce(j=>({...j,[t]:!0}))},Ae=s===We?Ut(B):s,De=B?`${B} meets`:"All meets";return mt&&W?e.jsx(ps,{meet:W,championships:ze,basePath:s,backTo:Ae,backLabel:De,notice:o}):e.jsx(lt.Provider,{value:$,children:e.jsxs("div",{className:"min-h-screen font-inter",children:[e.jsx(Xe,{}),e.jsx(dt,{text:o}),e.jsxs("main",{children:[e.jsx("section",{className:"bg-gradient-hero hero-mesh py-10 sm:py-14",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"max-w-5xl mx-auto text-center animate-fade-in",children:[e.jsxs(ae,{to:U?it(r,null,s):Ae,className:"inline-flex items-center gap-1.5 mb-5 px-3.5 py-2 rounded-full bg-white/15 border border-white/25 font-poppins text-sm font-semibold text-primary-foreground hover:bg-white/25 transition-colors",children:[e.jsx(je,{className:"w-4 h-4"})," ",U?"All championships":De]}),e.jsx("h1",{className:"font-poppins text-2xl sm:text-3xl md:text-5xl font-bold text-primary-foreground mb-3 text-balance",children:(n==null?void 0:n.title)||(c?"Loading results…":"Meet Results")}),(n==null?void 0:n.organizationName)&&e.jsx("p",{className:"font-inter text-base md:text-lg text-primary-foreground/85",children:n.organizationName}),U&&((Fe=n==null?void 0:n.championship)==null?void 0:Fe.name)&&e.jsx("p",{className:"font-poppins text-base md:text-xl font-semibold text-gold mt-2",children:n.championship.name}),n&&e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 mt-6",children:[Y==="live"?e.jsxs("span",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-accent text-accent-foreground font-poppins text-xs font-bold uppercase tracking-wider shadow-soft",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-white opacity-75 motion-reduce:hidden"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-white"})]}),"Live now"]}):Y==="completed"?e.jsxs("span",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-white/20 border border-white/30 font-poppins text-xs font-bold uppercase tracking-wider text-primary-foreground",children:[e.jsx(Qt,{className:"w-3.5 h-3.5"})," Completed"]}):Y==="upcoming"?e.jsxs("span",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-white/10 border border-white/15 font-poppins text-xs font-bold uppercase tracking-wider text-primary-foreground/85",children:[e.jsx(Ve,{className:"w-3.5 h-3.5"})," Not started yet"]}):null,n.venue&&e.jsxs("span",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-white/10 border border-white/15 font-inter text-xs text-primary-foreground/85",children:[e.jsx(Ct,{className:"w-3.5 h-3.5"})," ",n.venue]}),Ue(n.startDateTime,n.endDateTime)&&e.jsxs("span",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-white/10 border border-white/15 font-inter text-xs text-primary-foreground/85",children:[e.jsx(Ve,{className:"w-3.5 h-3.5"})," ",Ue(n.startDateTime,n.endDateTime)]}),a.generatedAt&&e.jsxs("span",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-white/10 border border-white/15 font-inter text-xs text-primary-foreground
16/85",children:[e.jsx(Kt,{className:"w-3.5 h-3.5"}),O?"Final results · ":"Updated ",Bt(a.generatedAt)]})]})]})})}),e.jsx("section",{className:"py-10",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-7xl",children:[d&&e.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl border border-destructive/40 bg-destructive/10 mb-8",children:[e.jsx(Jt,{className:"w-5 h-5 text-destructive flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"font-inter text-sm text-muted-foreground",children:["Could not load the results feed. ",d]})]}),c?e.jsx(te,{title:"Loading results…"}):n?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4 mb-6",children:[e.jsx(se,{label:"Categories",value:n.totals.categories,hint:"Age groups contested",icon:Xt}),e.jsx(se,{label:"Events",value:n.totals.events,hint:"Across all categories",icon:es}),e.jsx(se,{label:"Athletes",value:pt,hint:"Competitors with results",icon:Qe}),e.jsx(se,{label:$.many,value:n.totals.enrolledTeams??ht,hint:n.totals.enrolledTeams!=null?"Teams enrolled":$.countHint,icon:ot})]}),Z&&X&&e.jsxs("div",{className:"grid lg:grid-cols-3 gap-4 mb-10",children:[e.jsx("div",{className:"lg:col-span-2 min-w-0",children:e.jsx(as,{leader:X,share:Nt,final:O,celebrate:ut})}),e.jsx(rs,{rows:pe.slice(0,5),totalPoints:he})]}),e.jsxs(He,{defaultValue:bt,className:"w-full",children:[e.jsxs(qe,{className:"mb-6 sm:mb-8 h-auto p-1 rounded-full bg-card border border-border shadow-soft flex w-full sm:inline-flex sm:w-auto",children:[e.jsxs(H,{value:"results",className:"font-poppins text-[11px] sm:text-sm rounded-full px-2 sm:px-5 py-2 whitespace-nowrap flex-1 sm:flex-none data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-soft",children:[e.jsx(le,{className:"w-4 h-4 mr-2 hidden sm:inline-block"})," Results"]}),Z&&e.jsxs(H,{value:"standings",className:"font-poppins text-[11px] sm:text-sm rounded-full px-2 sm:px-5 py-2 whitespace-nowrap flex-1 sm:flex-none data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-soft",children:[e.jsx(Qe,{className:"w-4 h-4 mr-2 hidden sm:inline-block"}),e.jsx("span",{className:"sm:hidden",children:"Teams"}),e.jsx("span",{className:"hidden sm:inline",children:"Team Standings"})]}),Ee&&e.jsxs(H,{value:"category-teams",className:"font-poppins text-[11px] sm:text-sm rounded-full px-2 sm:px-5 py-2 whitespace-nowrap flex-1 sm:flex-none data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-soft",children:[e.jsx(Yt,{className:"w-4 h-4 mr-2 hidden sm:inline-block"}),e.jsx("span",{className:"sm:hidden",children:"Category"}),e.jsx("span",{className:"hidden sm:inline",children:"By Category"})]}),Me&&e.jsxs(H,{value:"individual",className:"font-poppins text-[11px] sm:text-sm rounded-full px-2 sm:px-5 py-2 whitespace-nowrap flex-1 sm:flex-none data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-soft",children:[e.jsx(we,{className:"w-4 h-4 mr-2 hidden sm:inline-block"})," Individual"]})]}),e.jsx(q,{value:"results",className:"mt-0",children:e.jsxs("div",{className:"grid lg:grid-cols-12 gap-6",children:[e.jsx("aside",{className:"lg:col-span-4 xl:col-span-3 lg:sticky lg:top-24 lg:self-start",children:e.jsx(xs,{categories:xt,categoryId:w,eventId:Ce,query:de,open:ct,onQueryChange:Te,onToggleCategory:t=>ce(x=>({...x,[t]:!x[t]})),onPick:vt})}),e.jsx("div",{className:"lg:col-span-8 xl:col-span-9 min-w-0",children:!R||!v?e.jsx(te,{title:"Choose an event",hint:"Pick a category and event from the list to view its results."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-card shadow-soft p-4 sm:p-5 mb-5 sm:mb-6 flex flex-wrap items-center justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"label-tag",children:R.name||R.shortName}),e.jsx("h2",{className:"font-poppins text-xl sm:text-2xl font-bold text-foreground mt-1 break-words",children:v.name})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[G(v)&&e.jsx(V,{variant:"outline",className:"font-inter text-[11px]",children:"Relay"}),e.jsxs(V,{variant:"outline",className:"font-inter text-[11px]",children:[J.length," ",J.length===1?"round":"rounds"]})]})]}),J.length===0?e.jsx(te,{title:"No results published for this event yet",hint:"Placings appear here as soon as the referee signs off."}):e.jsxs(e.Fragment,{children:[((Re=v.medals)==null?void 0:Re.length)>0&&e.jsx(is,{medals:v.medals,relay:G(v),photos:h,measured:v.measured,eventName:v.name}),e.jsx("div",{className:"space-y-6",children:J.map(t=>e.jsxs("div",{className:"rounded-2xl border border-border bg-card shadow-soft overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 sm:gap-3 px-4 sm:px-5 py-3 sm:py-4 border-b border-border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"w-1.5 h-5 rounded-full bg-gradient-gold","aria-hidden":"true"}),e.jsx("h3",{className:"font-poppins text-base font-bold text-foreground",children:Ot(t.round)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 font-inter text-xs text-muted-foreground",children:[t.day&&e.jsx("span",{children:Ht(t.day)}),t.windSpeed&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ts,{className:"w-3.5 h-3.5"})," ",t.windSpeed]}),!t.countsForPoints&&e.jsx(V,{variant:"outline",className:"font-inter text-[10px]",children:"Not scored"})]})]}),e.jsx("div",{className:"sm:hidden",children:e.jsx(os,{round:t,event:v,photos:h})}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(ls,{round:t,event:v,photos:h})})]},t.schedId))})]})]})})]})}),Z&&e.jsxs(q,{value:"standings",className:"mt-0",children:[e.jsx("h2",{className:"font-poppins text-xl font-bold text-foreground mb-1",children:O?"Final Team Standings":"Team Standings"}),e.jsxs("p",{className:"font-inter text-sm text-muted-foreground mb-4",children:["Tap ",$.withArticle," to open its points sheet — every placing behind the total."]}),e.jsx(ge,{rows:pe,pointsTable:Ke(n),onSelect:jt,nameHeader:$.one,renderName:t=>e.jsxs("div",{children:[e.jsx("div",{className:"font-poppins font-semibold text-foreground uppercase text-[13px] sm:text-sm break-words",children:t.organizationName||"—"}),t.organizationCode&&e.jsx("div",{className:"font-inter text-[11px] sm:text-xs text-muted-foreground mt-0.5 break-words",children:t.organizationCode})]})})]}),Ee&&e.jsxs(q,{value:"category-teams",className:"mt-0",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3 mb-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-poppins text-xl font-bold text-foreground",children:O?"Final Team Standings by Category":"Team Standings by Category"}),e.jsxs("p",{className:"font-inter text-sm text-muted-foreground mt-1",children:["The leading ",$.many.toLowerCase()," in each age group, with every event in that group — track, jumps and throws — added together."]})]}),e.jsxs("span",{className:"font-inter text-[11px] uppercase tracking-[0.14em] text-muted-foreground",children:[Ke(n).filter(t=>t>0).join(" · ")," ","points"]})]}),e.jsx("div",{className:"grid md:grid-cols-2 xl:grid-cols-3 gap-4",children:Pe.map(t=>e.jsx(ds,{category:t},t.sectionId))})]}),Me&&e.jsxs(q,{value:"individual",className:"mt-0",children:[e.jsx("h2",{className:"font-poppins text-xl font-bold text-foreground mb-1",children:O?"Final Individual Championship":"Individual Championship"}),e.jsx("p",{className:"font-inter text-sm text-muted-foreground mb-4",children:"Tap an athlete to see the events they competed in and where their points came from."}),A.length>1?e.jsxs(He,{defaultValue:"all",className:"w-full",children:[e.jsxs(qe,{className:"mb-4 h-auto p-1 rounded-full bg-card border border-border shadow-soft flex w-full sm:inline-flex sm:w-auto",children:[e.jsx(H,{value:"all",className:"font-poppins text-[11px] sm:text-sm rounded-full px-3 sm:px-5 py-2 whitespace-nowrap flex-1 sm:flex-none data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-soft",children:"All"}),A.map(t=>e.jsx(H,{value:t.key,className:"font-poppins text-[11px] sm:text-sm rounded-full px-3 sm:px-5 py-2 whitespace-nowrap flex-1 sm:flex-none data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-soft",children:t.label},t.key))]}),e.jsxs(q,{value:"all",className:"mt-0",children:[e.jsx("div",{className:"hidden lg:grid lg:grid-cols-2 gap-6",children:A.map(t=>e.jsxs("div",{children:[e.jsx("h3",{className:"font-poppins text-sm font-bold uppercase tracking-[0.14em] text-muted-foreground mb-3",children:t.label}),e.jsx(fe,{rows:t.rows,photos:h,onSelect:D})]},t.key))}),e.jsxs("div",{className:"lg:hidden space-y-6",children:[A.map(t=>e.jsxs("div",{children:[e.jsx("h3",{className:"font-poppins text-sm font-bold uppercase tracking-[0.14em] text-muted-foreground mb-3",children:t.label}),e.jsx(fe,{rows:ne(t.rows),photos:h,onSelect:D})]},`${t.key}-podium`)),A.filter(t=>t.rows.length>ne(t.rows).length).map(t=>e.jsxs("div",{children:[e.jsxs("h3",{className:"font-poppins text-sm font-bold uppercase tracking-[0.14em] text-muted-foreground mb-3",children:[t.label," · remaining athletes"]}),e.jsx(fe,{rows:t.rows.slice(ne(t.rows).length),photos:h,onSelect:D})]},`${t.key}-rest`))]})]}),A.map(t=>e.jsx(q,{value:t.key,className:"mt-0",children:e.jsx(ge,{rows:t.rows,pointsTable:n.individualPointsTable,nameHeader:`Athlete / ${$.one}`,highlightTop:3,renderName:Se,onSelect:D})},t.key))]}):e.jsx(ge,{rows:((Be=A[0])==null?void 0:Be.rows)||n.individualStandings,pointsTable:n.individualPointsTable,nameHeader:`Athlete / ${$.one}`,highlightTop:3,renderName:Se,onSelect:D})]})]}),e.jsx(ms,{row:xe,appearances:xe?qt(ft,xe):[],photos:h,onClose:()=>D(null)})]}):e.jsxs("div",{className:"text-center",children:[e.jsx(te,{title:"That meet is not published",hint:"It may have been taken down, or the link is out of date."}),e.jsxs(ae,{to:s,className:"inline-flex items-center gap-1.5 mt-5 font-poppins text-sm font-semibold text-primary hover:underline",children:[e.jsx(je,{className:"w-4 h-4"})," Back to all meets"]})]})]})})]}),e.jsx(et,{})]})})};export{Rs 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.