{#if open}
{ if (e.key === 'Escape') closePalette(); }} role="button" tabindex="-1" aria-label={t('searchPalette.close')}>
0} aria-controls={listboxId} aria-activedescendant={flatResults.length > 0 ? optionId(activeIndex) : undefined} aria-autocomplete="list" />
ESC
{#if loading}
{t('common.loading')}
{:else if flatResults.length === 0}
{query ? t('searchPalette.noResults') : t('searchPalette.typeToSearch')}
{:else} {#each groupedResults as group}
{group.label}
{#each group.items as item} {@const flatIdx = flatIndexMap.get(item) ?? -1}
navigateTo(item)} onmouseenter={() => activeIndex = flatIdx} >
{item.name}
{#if item.detail}
{item.detail}
{/if}
{/each} {/each} {/if}
{/if}