{#if data.title}

{data.title}

{/if} {#if !visibleItems.length}

Nothing is available to book right now — please check back soon.

{/if}
{#each visibleItems as item (item.id)} {@const ui = cardStates[item.id]} {@const isService = item.type === 'item_with_time'} {@const duration = isService ? selectedDuration(item, ui) : null} {@const bookable = !isService || !!duration} {@const soldOut = item.type === 'item' && item.stock === 0} {@const itemInBasket = !isService && basket.lines.some((l) => l.item === item.id)}
{#if item.imageUrl} {item.name} {:else} {/if}

{item.name}

{#if item.description}

{item.description}

{/if} {#if item.type === 'bundle'}
    {#each item.bundleParts as part (`${part.item}|${part.minutes}`)}
  • {part.count}× {itemNames.get(part.item) ?? 'Item'}{part.minutes ? ` (${formatDuration(part.minutes)})` : ''}
  • {/each}

You get a code to book the sessions whenever suits you{item.validMonths ? ` — valid ${item.validMonths} months` : ''}. It can be given as a gift.

{/if}
{#if isService && item.durations.length > 1}
from {formatPrice(lowestPrice(item.durations) ?? item.price, currency)} {formatDuration(item.durations[0].minutes)} – {formatDuration(item.durations[item.durations.length - 1].minutes)}
{:else} {@const listPrice = item.type === 'bundle' ? bundleListPrice(item.bundleParts, items) : null}
{formatPrice(duration?.price ?? lowestPrice(item.durations) ?? item.price, currency)} {#if listPrice != null && listPrice > item.price} Bought separately: {formatPrice(listPrice, currency)} {/if} {#if duration} {formatDuration(duration.minutes)} {:else if !isService && item.stock != null && item.stock > 0 && item.stock <= 5} Only {item.stock} left {:else if soldOut} Sold out {/if}
{/if}
{#if ui?.errorMsg} {/if}
{#if isService} {:else} {#if itemInBasket} ✓ In basket {/if} {/if}
{#if isService && ui?.pickerOpen && duration} {@const byDay = entriesByDay(item, ui, duration.minutes)} {@const availableKeys = [...byDay.keys()].sort()} {@const months = pickerMonths(ui.monthOffset)} {@const shown = shownRange(ui.monthOffset)} {@const anyShown = availableKeys.some((key) => key >= shown.from && key <= shown.to)}
{#if item.durations.length > 1}
{/if}

{#if ui.loading}{/if} Select a date · {formatDuration(duration.minutes)}

{#if ui.loadError} {:else if !ui.loading && !anyShown}
{#if ui.next} The next available date for {formatDuration(duration.minutes)} is {longDate(zonedDateKey(ui.next, timezone))}. {:else} No times are available for {formatDuration(duration.minutes)} in these months{item.durations.length > 1 ? ' — try another length' : ''}. {/if}
{/if}
{#each months as month (month.label)}

{month.label}

{#each weekdayLetters as letter, i (i)} {letter} {/each} {#each month.days as day (day.dateKey)} {@const selectable = day.inMonth && byDay.has(day.dateKey)} {@const selected = selectable && ui.selectedDayKey === day.dateKey} {/each}
{/each}
{#if ui.selectedDayKey && byDay.has(ui.selectedDayKey)}

Available times · {longDate(ui.selectedDayKey)}

{#each byDay.get(ui.selectedDayKey) ?? [] as entry (`${entry.slot}|${entry.start}`)} {@const isGroup = (entry.time?.capacity ?? entry.line?.slotCapacity ?? 1) > 1} {@const free = entry.time?.free ?? 0} {@const pending = ui.pendingKey === `${entry.slot}|${entry.start}`} {@const label = `${formatTime(entry.start)}–${formatTime(entry.end)}`} {#if isGroup && entry.line}
{label} · {placesLeft(free)} {#if pending}{:else}{entry.line.quantity}{/if} {entry.line.quantity === 1 ? 'place' : 'places'} in your basket
{:else} {/if} {/each}
{:else if anyShown}

Days with availability are highlighted.

{/if} {#if ui.justAdded}

Added ✓ — view basket

{/if}
{/if}
{/each}