{#if citation?.source?.name} {@const document = mergedDocuments?.[0]} {#if document?.metadata?.file_id || document.source?.url?.includes('http')} {decodeString(citation?.source?.name)} {:else} {decodeString(citation?.source?.name)} {/if} {:else} {$i18n.t('Citation')} {/if}
{#each mergedDocuments as document, documentIdx}
{#if document.metadata?.parameters}
{$i18n.t('Parameters')}
{/if}
{#if document.source?.url?.includes('http')} {@const snippetUrl = getTextFragmentUrl(document)} {#if snippetUrl} {$i18n.t('Content')} {:else} {$i18n.t('Content')} {/if} {:else} {$i18n.t('Content')} {/if} {#if showRelevance && document.distance !== undefined}
{#if showPercentage} {@const percentage = calculatePercentage(document.distance)} {#if typeof percentage === 'number'} {percentage.toFixed(2)}% {/if} {:else if typeof document?.distance === 'number'} ({(document?.distance ?? 0).toFixed(4)}) {/if}
{/if} {#if Number.isInteger(document?.metadata?.page)} ({$i18n.t('page')} {document.metadata.page + 1}) {/if}
{#if document.metadata?.html} {:else} {@const rawContent = document.document.trim().replace(/\n\n+/g, '\n\n')} {@const isTruncated = ($settings?.renderMarkdownInPreviews ?? true) && rawContent.length > CONTENT_PREVIEW_LIMIT && !expandedDocs.has(documentIdx)} {#if $settings?.renderMarkdownInPreviews ?? true}
{#if isTruncated} {/if} {:else}
{rawContent}
{/if} {/if}
{/each}