#import "template.ftl" as layout>
<#import "components/atoms/alert.ftl" as alert>
<#import "components/atoms/button.ftl" as button>
<#import "components/atoms/button-group.ftl" as buttonGroup>
<#import "components/atoms/checkbox.ftl" as checkbox>
<#import "components/atoms/form.ftl" as form>
<@layout.registrationLayout script="dist/recoveryCodes.js"; section>
<#if section="header">
${msg("recovery-code-config-header")}
<#elseif section="form">
<@alert.kw color="warning">
${msg("recovery-code-config-warning-title")}
${msg("recovery-code-config-warning-message")}
@alert.kw>
<#list recoveryAuthnCodesConfigBean.generatedRecoveryAuthnCodesList as code>
- ${code[0..3]}-${code[4..7]}-${code[8..]}
#list>
<@button.kw @click="print" color="secondary" size="small" type="button">
${msg("recovery-codes-print")}
@button.kw>
<@button.kw @click="download" color="secondary" size="small" type="button">
${msg("recovery-codes-download")}
@button.kw>
<@button.kw @click="copy" color="secondary" size="small" type="button">
${msg("recovery-codes-copy")}
@button.kw>
<@form.kw action=url.loginAction method="post">
<@checkbox.kw
label=msg("recovery-codes-confirmation-message")
name="kcRecoveryCodesConfirmationCheck"
required="required"
x\-ref="confirmationCheck"
/>
<@buttonGroup.kw>
<#if isAppInitiatedAction??>
<@button.kw color="primary" type="submit">
${msg("recovery-codes-action-complete")}
@button.kw>
<@button.kw
@click="$refs.confirmationCheck.required = false"
color="secondary"
name="cancel-aia"
type="submit"
value="true"
>
${msg("recovery-codes-action-cancel")}
@button.kw>
<#else>
<@button.kw color="primary" type="submit">
${msg("recovery-codes-action-complete")}
@button.kw>
#if>
@buttonGroup.kw>
@form.kw>
#if>
@layout.registrationLayout>