{@render children(show)} {#if open && view} { // Canvas chats have CSS zoom; top-layer dialogs still inherit it. document.body.append(node); return () => node.remove(); }} class="nowheel holds-wheel" class:closing aria-label="Image viewer" oncancel={(event) => { event.preventDefault(); if (menu) menu = false; else close(); }} onkeydown={(event) => { const inMenu = (event.target as Element).closest('[role="menu"]'); if (!inMenu && event.key === 'ArrowLeft') page(-1); if (!inMenu && event.key === 'ArrowRight') page(1); event.stopPropagation(); }} onfocusout={(event) => { // Keep the arrow keys working when a hidden or removed control drops focus. if (event.relatedTarget === null && document.hasFocus()) viewport?.focus({ preventScroll: true }); }} > {#each pictures as item, at (at)} {@const fit = view.fitted[at]} {@const t = view.transforms[at]} {#if Math.abs(at - index) <= 1} loaded(at, event.currentTarget as HTMLImageElement)} onerror={() => (loads[at] = 'failed')} /> {/if} {#if loads[at] === 'loading'} {:else if loads[at] === 'failed'} Image unavailable. Try opening the original. {/if} {/each} page(-1)} > page(1)} > (menu = !menu)} > (menu = false)} >Open original {canShare ? 'Share image' : 'Copy image link'} Download image {#if pictures.length > 1} {#if pictures.length <= MAX_DOTS} {#each pictures as _, at (at)} {/each} {:else} {index + 1} / {pictures.length} {/if} {/if} {label} {index + 1} of {pictures.length} {#if notice}{notice}{/if} {/if}
Image unavailable. Try opening the original.
{label} {index + 1} of {pictures.length}
{notice}