{#if isShowingLinkModal} { isShowingLinkModal = false; }} on:add={addAdventure} /> {/if} {#if isTransportationEditModalOpen} (isTransportationEditModalOpen = false)} on:saveEdit={saveNewTransportation} startDate={collection.start_date} endDate={collection.end_date} /> {/if} {#if isEditModalOpen} (isEditModalOpen = false)} on:saveEdit={saveEdit} startDate={collection.start_date} endDate={collection.end_date} /> {/if} {#if isNoteModalOpen} (isNoteModalOpen = false)} startDate={collection.start_date} endDate={collection.end_date} /> {/if} {#if isShowingCreateModal} (isShowingCreateModal = false)} startDate={collection.start_date} endDate={collection.end_date} /> {/if} {#if isShowingTransportationModal} (isShowingTransportationModal = false)} on:add={(event) => { transportations = [event.detail, ...transportations]; isShowingTransportationModal = false; }} {collection} startDate={collection.start_date} endDate={collection.end_date} /> {/if} {#if notFound}
Lost

Adventure not Found

The adventure you were looking for could not be found. Please try a different adventure or check back later.

{/if} {#if !collection && !notFound}
{/if} {#if collection} {#if data.user}
{/if} {#if collection.name}

{collection.name}

{/if} {#if adventures.length > 0}
Collection Stats
{numVisited}/{adventures.length} Visited
{#if numVisited === adventures.length}
You've completed this collection! 🎉!
{:else}
Keep exploring!
{/if}
{/if} {#if adventures.length == 0 && transportations.length == 0} {/if} {#if adventures.length > 0}

Linked Adventures

{#each adventures as adventure} {/each}
{/if} {#if transportations.length > 0}

Transportation

{#each transportations as transportation} { transportations = transportations.filter((t) => t.id != event.detail); }} on:edit={(event) => { transportationToEdit = event.detail; isTransportationEditModalOpen = true; }} /> {/each}
{/if} {#if collection.start_date && collection.end_date}

Itinerary by Date

{#if numberOfDays}

Duration: {numberOfDays} days

{/if}

Dates: {new Date(collection.start_date).toLocaleDateString('en-US', { timeZone: 'UTC' })} - {new Date( collection.end_date ).toLocaleDateString('en-US', { timeZone: 'UTC' })}

{#each Array(numberOfDays) as _, i} {@const currentDate = new Date(collection.start_date)} {@const temp = currentDate.setDate(currentDate.getDate() + i)} {@const dateString = currentDate.toISOString().split('T')[0]} {@const dayAdventures = groupAdventuresByDate(adventures, new Date(collection.start_date))[ dateString ]} {@const dayTransportations = groupTransportationsByDate( transportations, new Date(collection.start_date) )[dateString]}

Day {i + 1} - {currentDate.toLocaleDateString('en-US', { timeZone: 'UTC' })}

{#if dayAdventures.length > 0} {#each dayAdventures as adventure} {/each} {/if} {#if dayTransportations.length > 0} {#each dayTransportations as transportation} { transportations = transportations.filter((t) => t.id != event.detail); }} on:edit={(event) => { transportationToEdit = event.detail; isTransportationEditModalOpen = true; }} /> {/each} {/if} {#if notes.length > 0} {#each notes as note} {#if note.date && new Date(note.date).toISOString().split('T')[0] === dateString} { noteToEdit = event.detail; isNoteModalOpen = true; }} /> {/if} {/each} {/if} {#if dayAdventures.length == 0 && dayTransportations.length == 0}

No adventures or transportaions planned for this day.

{/if}
{/each} {#each adventures as adventure} {#if adventure.longitude && adventure.latitude}
{adventure.name}

{adventure.type.charAt(0).toUpperCase() + adventure.type.slice(1)}

{adventure.date ? new Date(adventure.date).toLocaleDateString('en-US', { timeZone: 'UTC' }) : ''}

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