{#if !grouped && embeds && Array.isArray(embeds) && embeds.length > 0}
{attributes.name}
{#each embeds as embed, idx}
{/each}
{:else}
{#if open}
{#if args}
{$i18n.t('Input')}
{#if parsedArgs}
{#each Object.entries(parsedArgs) as [key, value]}
{key}
{typeof value === 'object' ? JSON.stringify(value) : value}
{/each}
{:else}
{formatJSONString(
args
)}
{/if}
{/if}
{#if isDone && result}
{$i18n.t('Output')}
{#if typeof parsedResult === 'object' && parsedResult !== null}
{JSON.stringify(
parsedResult,
null,
2
)}
{:else}
{@const resultStr = String(parsedResult)}
{@const isTruncated = resultStr.length > RESULT_PREVIEW_LIMIT && !expandedResult}
{isTruncated
? resultStr.slice(0, RESULT_PREVIEW_LIMIT)
: resultStr}
{#if isTruncated}
{/if}
{/if}
{/if}
{/if}
{/if}
{#if isDone}
{#if typeof files === 'object'}
{#each files ?? [] as file, idx}
{#if typeof file === 'string'}
{#if file.startsWith('data:image/')}
{/if}
{:else if typeof file === 'object'}
{#if (file.type === 'image' || (file?.content_type ?? '').startsWith('image/')) && file.url}
{/if}
{/if}
{/each}
{/if}
{/if}