{ if (shortcut && e.key.toLowerCase() === 'k' && (e.metaKey || e.ctrlKey) && !e.altKey) { e.preventDefault(); open = !open; } }} /> (open = false)} onpointerdown={(e) => (pressedBackdrop = e.target === dialog)} onclick={(e) => { if (pressedBackdrop && e.target === dialog) dialog.close(); }} >
{#each groups as [name, cs] (name)}
{#if name}{/if} {#each cs as c (c.id)}
{ viaPointer = true; active = flat.indexOf(c); }} onpointerdown={(e) => e.preventDefault()} onclick={() => run(c)} > {#if c.icon}{/if} {#if c.description} {c.label} {c.description} {:else} {c.label} {/if} {#if c.shortcut} {/if}
{/each}
{/each}
{#if !flat.length}

{empty}

{/if}

{query.trim() ? `${flat.length} ${flat.length === 1 ? 'result' : 'results'}` : ''}