{#await schedulePromise} {:then scheduleResponse} {#if scheduleResponse} {#await scheduleResponse.json()} {:then untypedSchedule} {@const schedule = typeSchedule(untypedSchedule)} {#if schedule.lives.length === 0} {/if}
{#each schedule.lives .filter((live) => { const time = new Date(live.time); return time.getTime() > Date.now() - 12 * 60 * 60 * 1000 || time.getTime() > Date.now() || live.streaming; }) .sort((a, b) => { if (a.streaming && !b.streaming) return -1; if (!a.streaming && b.streaming) return 1; return new Date(a.time).getTime() - new Date(b.time).getTime(); }) as live}

[{#if live.streaming} LIVE{:else} Upcoming{/if}] {live.streamer} | {new Date(live.time).toLocaleString()} {#if live.guests.length > 0}
With {live.guests.join(', ').replace(/, ([^,]+)$/, ', & $1')} {/if}

Stream Thumbnail
{/each}
{:catch} {/await} {:else} {/if} {:catch} {/await}