{#if lang === 'mermaid'} {#if mermaidHtml} {:else}
{code}
{/if} {:else}
{lang}
{#if ($config?.features?.enable_code_execution ?? true) && (lang.toLowerCase() === 'python' || lang.toLowerCase() === 'py' || (lang === '' && checkPythonCode(code)))} {#if executing}
Running
{:else if run} {/if} {/if} {#if save} {/if}
{#if !collapsed} { saveCode(); }} onChange={(value) => { _code = value; }} /> {:else}
{$i18n.t('{{COUNT}} hidden lines', { COUNT: code.split('\n').length })}
{/if}
{#if !collapsed}
{#if executing || stdout || stderr || result || files}
{#if executing}
STDOUT/STDERR
Running...
{:else} {#if stdout || stderr}
STDOUT/STDERR
{stdout || stderr}
{/if} {#if result || files}
RESULT
{#if result}
{`${JSON.stringify(result)}`}
{/if} {#if files}
{#each files as file} {#if file.type.startsWith('image')} Output {/if} {/each}
{/if}
{/if} {/if}
{/if} {/if} {/if}