{#if fileLoading}
{:else if fileImageUrl !== null}
{:else if fileVideoUrl !== null}
{$i18n.t('Your browser does not support the video tag.')}
{:else if fileAudioUrl !== null}
{$i18n.t('Your browser does not support the audio tag.')}
{:else if filePdfData !== null}
{:else if fileModelData !== null} {#key fileModelData} {#await import('../../common/ModelPreview.svelte')}
{:then { default: ModelPreview }}
{ const result = await downloadFileBlob( baseUrl, apiKey, path, chatId ?? undefined, signal ); if (!result) throw new Error('Could not load model resource.'); return result.blob; } : undefined} /> {:catch}
{$i18n.t('Preview failed')}
{/await} {/key} {:else if fileSqliteData !== null}
{:else if fileDocxData !== null}
{:else if fileOfficeHtml !== null}
{:else if fileOfficeSlides !== null && fileOfficeSlides.length > 0}
{:else if fileContent !== null} {#if searchTarget}
{:else if isHtml && !showRaw && serveUrl} {#if overlay}
{/if}
{:else if isHtml && !showRaw} {#if overlay}
{/if}
{:else if isHtml && showRaw}
{:else if isMarkdown && !showRaw && onSave && !readOnly} {#key selectedFile}
{/key} {:else if isMarkdown && !showRaw} {#key selectedFile}
{/key} {:else if isMarkdown && showRaw}
{:else if isCsv && !showRaw && csvRows.length > 0}
#
{#each csvHeader as cell}
{cell}
{/each}
{#each csvBody as row, i}
{i + 1}
{#each row as cell}
{cell}
{/each} {#each Array(Math.max(0, csvHeader.length - row.length)) as _}
{/each}
{/each}
{:else if isNotebook && !showRaw && parsedNotebook}
{:else if isJson && !showRaw && parsedJson !== undefined}
{:else if isJson && !showRaw && jsonError}
{$i18n.t('JSON parse error: {{error}}', { error: jsonError })}
{fileContent}
{:else if isSvg && !showRaw && fileContent}
{@html sanitizeSvg(fileContent)}
{:else if isCode && !showRaw}
{:else if isSvg && highlightedHtml && !showRaw}
{@html highlightedHtml}
{:else if editing}
{:else}
{fileContent}
{/if} {:else}
{$i18n.t('Could not read file.')}
{/if} {#if !fileLoading && fileImageUrl !== null}
panzoomRef?.zoomOut()} aria-label={$i18n.t('Zoom out')} >
panzoomRef?.reset()} aria-label={$i18n.t('Reset zoom')} > {Math.round(imageZoomLevel * 100)}%
panzoomRef?.zoomIn()} aria-label={$i18n.t('Zoom in')} >
{/if}