import { a6 as escape_html, a8 as ensure_array_like, a9 as attr, ab as stringify, aa as attr_class, a1 as derived } from './index3-C4geC3K_.js'; import './root-D12ma0No.js'; import './utils-D_bK1W85.js'; import './exports-B5ORJhfK.js'; import './state.svelte-DvHRBIfo.js'; function _page($$renderer, $$props) { $$renderer.component(($$renderer2) => { let { data } = $$props; const stateConfig = { CREATED: { label: "Created", color: "text-text-secondary border-border" }, LOBBY: { label: "In Lobby", color: "text-yellow-400 border-yellow-500/30" }, ROLLING: { label: "Rolling", color: "text-yellow-400 border-yellow-500/30", dot: "bg-yellow-400" }, PICKING: { label: "Picking", color: "text-blue-400 border-blue-500/30", dot: "bg-blue-400" }, PLAYING: { label: "Live", color: "text-green-400 border-green-500/30", dot: "bg-green-400" }, FINISHED: { label: "Finished", color: "text-text-secondary border-border" }, CANCELLED: { label: "Cancelled", color: "text-red-400 border-red-500/30" } }; const liveStates = ["LOBBY", "ROLLING", "PICKING", "PLAYING"]; const liveMatches = derived(() => data.matches.filter((m) => liveStates.includes(m.state))); const recentMatches = derived(() => data.matches.filter((m) => !liveStates.includes(m.state))); function teamDisplay(m) { const p1 = m.participants[0]; const p2 = m.participants[1]; return { p1, p2 }; } function timeAgo(date) { const d = new Date(date); const diff = Date.now() - d.getTime(); const mins = Math.floor(diff / 6e4); if (mins < 1) return "just now"; if (mins < 60) return `${mins}m ago`; const hours = Math.floor(mins / 60); if (hours < 24) return `${hours}h ago`; const days = Math.floor(hours / 24); return `${days}d ago`; } $$renderer2.push(`
${escape_html(data.matches.length)} match${escape_html(data.matches.length !== 1 ? "es" : "")} `); if (liveMatches().length > 0) { $$renderer2.push(""); $$renderer2.push(`· ${escape_html(liveMatches().length)} live`); } else { $$renderer2.push(""); } $$renderer2.push(`
${escape_html(m.name ? `${m.name} · ` : "")}BO${escape_html(config.bestOf)} `); if (m.finishedAt) { $$renderer2.push(""); $$renderer2.push(`· ${escape_html(timeAgo(m.finishedAt))}`); } else if (m.createdAt) { $$renderer2.push(""); $$renderer2.push(`· ${escape_html(timeAgo(m.createdAt))}`); } else { $$renderer2.push(""); } $$renderer2.push(`
No matches yet. Create one to get started.