import { ChangeDetectionStrategy, Component, forwardRef, inject, type TemplateRef, viewChild } from '@angular/core'; import { KcSanitizePipe } from '@keycloakify/angular/lib/pipes/kc-sanitize'; import { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css'; import { ComponentReference } from '@keycloakify/angular/login/classes/component-reference'; import type { TemplateSlots } from '@keycloakify/angular/login/classes/template-slots'; import { LogoutOtherSessionsComponent } from '@keycloakify/angular/login/components/logout-other-sessions'; import { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class'; import type { I18n } from '@keycloakify/angular/login/i18n'; import type { KcContext } from '@keycloakify/angular/login/KcContext'; import { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes'; import { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n'; import { KC_LOGIN_CONTEXT } from '@keycloakify/angular/login/tokens/kc-context'; import type { ClassKey } from 'keycloakify/login/lib/kcClsx'; @Component({ imports: [KcClassDirective, KcSanitizePipe, LogoutOtherSessionsComponent], selector: 'kc-login-config-totp', templateUrl: 'login-config-totp.component.html', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ { provide: ComponentReference, useExisting: forwardRef(() => LoginConfigTotpComponent) } ] }) export class LoginConfigTotpComponent extends ComponentReference implements TemplateSlots { kcContext = inject>(KC_LOGIN_CONTEXT); i18n = inject(LOGIN_I18N); override doUseDefaultCss = inject(USE_DEFAULT_CSS); override classes = inject>>(LOGIN_CLASSES); documentTitle: string | undefined; bodyClassName: string | undefined; displayRequiredFields = false; displayInfo = false; displayMessage = !this.kcContext.messagesPerField.existsError('totp', 'userLabel'); headerNode = viewChild>('headerNode'); infoNode = viewChild>('infoNode'); socialProvidersNode = viewChild>('socialProvidersNode'); }