{#each config.groups as groupId} {@const group = event.groups.find((g) => g.id === groupId)!!} {@const fights = event.fights.filter((f) => f.group?.id === groupId)} {@const rounds = detectRounds(fights)} {@const roundRows = config.roundRows ?? 1} {@const roundRowsChunked = chunkIntoRows(rounds, roundRows)}
{#each Object.entries(group.points ?? {}).sort((v1, v2) => v2[1] - v1[1]) as points} {@const [teamId, point] = points} {@const team = event.teams.find((t) => t.id.toString() === teamId)!!} {/each}
{#each roundRowsChunked as row}
{#each row as round, index (round)} {@const roundIndex = rounds.indexOf(round)} {@const teams = Array.from(new Set(round.flatMap((f) => [f.redTeam, f.blueTeam])))}
{#each round as fight} {/each}
{/each}
{/each}
{/each}