import { e as escape_html, a as ensure_array_like, b as attr, s as stringify, c as attr_class } from "../../../chunks/index3.js"; function _page($$renderer, $$props) { $$renderer.component(($$renderer2) => { let { data } = $$props; const stateConfig = { CREATED: { label: "Created", color: "text-text-secondary" }, LOBBY: { label: "In Lobby", color: "text-yellow-400" }, ROLLING: { label: "Rolling", color: "text-yellow-400", dot: "bg-yellow-400" }, PICKING: { label: "Picking", color: "text-blue-400", dot: "bg-blue-400" }, PLAYING: { label: "Live", color: "text-green-400", dot: "bg-green-400" }, FINISHED: { label: "Finished", color: "text-text-secondary" }, CANCELLED: { label: "Cancelled", color: "text-red-400" } }; let queueLoading = false; 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`; } if (!data.user) { $$renderer2.push(""); $$renderer2.push(`
V

Welcome to Vash Esports

Automated tournament match management for osu! — lobbies, mappools, picks, bans, and ELO tracking all in one place.

Sign in with osu!

Uses your osu! account. No extra registration needed.

`); } else { $$renderer2.push(""); $$renderer2.push(`

Welcome back, ${escape_html(data.user.name)}

Automated esports match management for osu!

${escape_html(data.stats.matches)}

Total Matches

${escape_html(data.stats.finished)}

Completed

${escape_html(data.stats.teams)}

Teams

${escape_html(data.stats.mappools)}

Mappools

`); if (data.liveMatches.length > 0) { $$renderer2.push(""); $$renderer2.push(`

Live Now

`); const each_array = ensure_array_like(data.liveMatches); for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) { let m = each_array[$$index]; const p1 = m.participants[0]; const p2 = m.participants[1]; const sc = stateConfig[m.state]; $$renderer2.push(`
`); if (p1?.team.avatarUrl) { $$renderer2.push(""); $$renderer2.push(``); } else { $$renderer2.push(""); } $$renderer2.push(` ${escape_html(p1?.team.name ?? "?")}
${escape_html(p1?.score ?? 0)} vs ${escape_html(p2?.score ?? 0)}
${escape_html(p2?.team.name ?? "?")} `); if (p2?.team.avatarUrl) { $$renderer2.push(""); $$renderer2.push(``); } else { $$renderer2.push(""); } $$renderer2.push(`
`); if (sc?.dot) { $$renderer2.push(""); $$renderer2.push(``); } else { $$renderer2.push(""); } $$renderer2.push(` ${escape_html(sc?.label)}`); } $$renderer2.push(`
`); } else { $$renderer2.push(""); } $$renderer2.push(`

Ranked Queue

Find a match at your skill level

`); { $$renderer2.push(""); $$renderer2.push(`${escape_html("Find Match")}`); } $$renderer2.push(`

Recent Matches

`); const each_array_1 = ensure_array_like(data.recentMatches); if (each_array_1.length !== 0) { $$renderer2.push(""); for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) { let m = each_array_1[$$index_1]; const p1 = m.participants[0]; const p2 = m.participants[1]; const config = m.config; const sc = stateConfig[m.state]; $$renderer2.push(`
${escape_html(p1?.team.name ?? "?")} `); if (m.state === "FINISHED") { $$renderer2.push(""); $$renderer2.push(` (p2?.score ?? 0) ? "text-green-400" : "text-text-secondary")}`)}>${escape_html(p1?.score ?? 0)} - (p1?.score ?? 0) ? "text-green-400" : "text-text-secondary")}`)}>${escape_html(p2?.score ?? 0)}`); } else { $$renderer2.push(""); $$renderer2.push(`vs`); } $$renderer2.push(` ${escape_html(p2?.team.name ?? "?")}

${escape_html(m.name ? `${m.name} · ` : "")}BO${escape_html(config.bestOf)} · ${escape_html(timeAgo(m.finishedAt ?? m.createdAt))}

`); if (m.state === "FINISHED" && m.winnerId) { $$renderer2.push(""); const winner = m.participants.find((p) => p.teamId === m.winnerId); $$renderer2.push(`🏆 ${escape_html(winner?.team.name)}`); } else { $$renderer2.push(""); } $$renderer2.push(` ${escape_html(sc?.label)}`); } } else { $$renderer2.push(""); $$renderer2.push(`

No matches yet. Create one

`); } $$renderer2.push(`
`); } $$renderer2.push(``); }); } export { _page as default };