{#if data.currentrace} Next Race Guess
Step {data.currentrace.step}: {data.currentrace.name} {#if data.currentrace.sprintdate}
SQuali: {formatdate(data.currentrace.sprintqualidate)}
SRace: {formatdate(data.currentrace.sprintdate)}
{/if}
Quali: {formatdate(data.currentrace.qualidate)}
Race: {formatdate(data.currentrace.racedate)}

Track Layout:

{#if data.user}

Your P{data.currentrace.pxx} Pick:

{#await data.graphics then graphics} {#await data.drivers then drivers} {/await} {/await}

Your DNF Pick:

{#await data.graphics then graphics} {#await data.drivers then drivers} {/await} {/await}
{/if}

Picked ({pickedusers.length}/{data.currentpickedusers.length}):

{#await data.graphics then graphics} {#each pickedusers.slice(0, 16) as user} {/each} {/await}

Outstanding ({outstandingusers.length}/{data.currentpickedusers.length}):

{#await data.graphics then graphics} {#each outstandingusers.slice(0, 16) as user} {/each} {/await}
{/if}
{#await data.races then races} {#each data.raceresults as result} {@const race = get_by_value(races, "id", result.race)}
{race?.name.slice(0, 8)}{(race?.name.length ?? 8) > 8 ? "." : ""}
Result:
{#await data.drivers then drivers} {#each result.pxxs as pxx, index} {@const driver = get_by_value(drivers, "id", pxx)}
P{(race?.pxx ?? -100) - 3 + index}: {driver?.code}
{/each} {#if result.dnfs.length > 0}
{/if} {#each result.dnfs as dnf} {@const driver = get_by_value(drivers, "id", dnf)}
DNF: {driver?.code}
{/each} {/await}
{/each} {/await}
{#each data.currentpickedusers as user} {@const picks = data.racepicks.filter((pick: RacePick) => pick.user === user.id)}
{#await data.graphics then graphics} {/await}
{#await data.races then races} {#await data.drivers then drivers} {#each data.raceresults as result} {@const race = get_by_value(races, "id", result.race)} {@const pick = picks.filter((pick: RacePick) => pick.race === race?.id)[0]} {@const pxxcolor = PXX_COLORS[result.pxxs.indexOf(pick?.pxx ?? "Invalid")]} {@const dnfcolor = result.dnfs.indexOf(pick?.dnf ?? "Invalid") >= 0 ? PXX_COLORS[3] : PXX_COLORS[-1]} {#if pick}
{get_by_value(drivers, "id", pick?.pxx ?? "")?.code} {get_by_value(drivers, "id", pick?.dnf ?? "")?.code}
{:else}
{/if} {/each} {/await} {/await}
{/each}