{#if !loaded}{:else} {#if showForm}
{#if error}
{error}
{/if}
form.icon = v} />
{#if !editing}
{:else}
{t('templateConfig.providerType')} {allCapabilities[form.provider_type]?.display_name || form.provider_type}
{/if}
{t('cmdTemplateConfig.commandResponses')}

{t('cmdTemplateConfig.commandResponsesHint')}

{#each LOCALES as loc} {/each}
{#each commandSlots as slot}
{#if varsRef[slot.name]} {/if}
{ setSlotValue(slot.name, v); validateSlot(slot.name, v); }} rows={3} errorLine={slotErrorLines[slot.name] || null} variables={varsRef[slot.name] || undefined} /> {#if slotErrors[slot.name]} {#if slotErrorTypes[slot.name] === 'undefined'}

⚠ {t('common.undefinedVar')}: {slotErrors[slot.name]}

{:else}

✕ {t('common.syntaxError')}: {slotErrors[slot.name]}{slotErrorLines[slot.name] ? ` (${t('common.line')} ${slotErrorLines[slot.name]})` : ''}

{/if} {/if} {#if slotPreview[slot.name] && !slotErrors[slot.name]}
{slotPreview[slot.name]}
{/if}
{/each}
{/if} {#if !showForm && allCmdTplConfigs.length > 0}
{/if} {#if allCmdTplConfigs.length === 0 && !showForm} {:else if configs.length === 0 && !showForm} {:else}
{#each configs as config}

{config.name}

{config.provider_type} {#if config.user_id === 0} System {/if} {Object.keys(config.slots).length} slots
{#if config.description}

{config.description}

{/if}
clone(config)} /> edit(config)} /> remove(config.id)} variant="danger" />
{/each}
{/if} {/if} confirmDelete?.onconfirm()} oncancel={() => confirmDelete = null} /> showVarsFor = null}> {#if showVarsFor && varsRef[showVarsFor]}

{varsRef[showVarsFor].description}

{t('templateConfig.variables')}:

{#each Object.entries(varsRef[showVarsFor].variables || {}) as [name, desc]}
{'{{ ' + name + ' }}'} {desc}
{/each}
{#each [ ['asset_fields', 'asset', 'Asset fields'], ['album_fields', 'album', 'Album fields'], ['command_fields', 'cmd', 'Command fields'], ['event_fields', 'event', 'Event fields'], ] as [fieldKey, prefix, title]} {#if varsRef[showVarsFor][fieldKey]}

{title} (use {prefix}.field):

{#each Object.entries(varsRef[showVarsFor][fieldKey]) as [name, desc]}
{'{{ ' + prefix + '.' + name + ' }}'} {desc}
{/each}
{/if} {/each} {/if}