{#snippet download(size: "small" | "regular")} {#if downloadUrls} {#snippet trigger()} {/if} {/snippet} {#snippet styleSwitch(size: "small" | "regular", narrow: string)} styleHref(style) as "/" : undefined} label="Diff style" > {#each ["unified", "split"] as const as style (style)} (localStyle = style)} {size} class={narrow} > {style === "split" ? "Split" : "Unified"} {/each} {/snippet} {#if loading && !diff} {:else}
{#if treeOpen && wide.current} {/if}
{#if diff} {diff.files.length} changed {plural( diff.files.length, "file", "files" )} {/if}
{@render download("regular")}
{@render styleSwitch("regular", "")}
{#if !treeOpen}
{@render download("small")} Wrap {@render styleSwitch("small", iconOnlyNarrow)}
{#if error}
{error}
{:else if diff && diff.files.length > 0} {#key diff}
(diffScroll = max)} bind:this={files} {isOpen} onSetOpen={(key, open) => (openStates[key] = open)} patchUrl={patchUrl ?? downloadUrls?.diff} {linkLines} {onQuoteLines} />
{/key} {:else if diff} {:else}
{/if}
{#if diff} {/if} {/if}