{#if result != undefined && length != undefined && largeObject != undefined} {#if resultKind && !['json', 's3object'].includes(resultKind)}
as JSON 
{/if} {#if typeof result == 'object' && Object.keys(result).length > 0}
{#if !disableExpand}
{/if}
{/if} {#if !forceJson && resultKind == 'table-col'}
{#each Object.keys(result) as col}
{col}
{#if Array.isArray(result[col])} {#each result[col] as item}
{typeof item === 'string' ? item : JSON.stringify(item)}
{/each} {/if}
{/each}
{:else if !forceJson && resultKind == 'table-row'}
{#each asListOfList(result) as row} {#each row as v} {truncate(JSON.stringify(v), 200) ?? ''} {/each} {/each}
{:else if !forceJson && resultKind == 'html'}
{#if !requireHtmlApproval || enableHtml} {@html result.html} {:else}
Warning

Rendering HTML can expose you to XSS attacks. Only enable it if you trust the author of the script.

{/if}
{:else if !forceJson && resultKind == 'png'}
png rendered
{:else if !forceJson && resultKind == 'jpeg'}
jpeg rendered
{:else if !forceJson && resultKind == 'svg'}
Download
{@html result.svg}
{:else if !forceJson && resultKind == 'gif'}
gif rendered
{:else if !forceJson && resultKind == 'file'}
Download
{:else if !forceJson && resultKind == 'error' && result?.error}
{#if result.error.name || result.error.message}{result.error.name}: {result.error .message}{:else}{JSON.stringify(result.error, null, 4)}{/if}
{result.error.stack ?? ''}
{:else if !forceJson && resultKind == 'approval'}
{:else if !forceJson && resultKind == 's3object'}
{:else if largeObject}
Download
JSON is too large to be displayed in full
{#if result && result != 'WINDMILL_TOO_BIG'} {/if} {:else if typeof result == 'string' && result.length > 0}
{result}
{:else} {/if} {:else}
No result: {toJsonStr(result)}
{/if}
{#if !disableExpand} Download {#if largeObject}
Download JSON is too large to be displayed in full.
{:else if typeof result == 'string' && result.length > 0}
{result}
{:else} {/if}
{/if}