/**
 * @license
 * Copyright ASW (A Software World) All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file
 */
import { Component, Inject } from '@angular/core';
import { FormBuilder, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Constants, Icons } from '@asoftwareworld/form-builder-pro/common';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@angular/material/dialog";
import * as i3 from "@angular/common";
import * as i4 from "@angular/material/core";
import * as i5 from "@angular/material/button";
import * as i6 from "@angular/material/divider";
import * as i7 from "@angular/material/input";
import * as i8 from "@angular/material/form-field";
import * as i9 from "@angular/material/radio";
import * as i10 from "@angular/material/select";
import * as i11 from "@angular/material/slide-toggle";
import * as i12 from "@angular/material/tabs";
import * as i13 from "@angular/material/tooltip";
import * as i14 from "@angular/material/icon";
import * as i15 from "@asoftwareworld/form-builder-pro/common";
import * as i16 from "@asoftwareworld/form-builder-pro/editor";
import * as i17 from "@asoftwareworld/form-builder-pro/core";
export class AswSingleSelectDialog {
    formBuilder;
    dialogRef;
    data;
    constants = Constants;
    aswEditSingleSelectForm;
    status;
    icons = Icons;
    control;
    labelType = 'label';
    constructor(formBuilder, dialogRef, data) {
        this.formBuilder = formBuilder;
        this.dialogRef = dialogRef;
        this.data = data;
        this.aswEditSingleSelectForm = this.formBuilder.group({
            id: ['', [Validators.required]],
            tooltip: [''],
            label: ['', [Validators.required, Validators.minLength(2)]],
            style: [''],
            customClass: [],
            options: this.formBuilder.array([this.createOption()]),
            isRequired: [false],
            isDisabled: [false],
            labelType: ['label'],
            apiUrl: [''],
            body: [],
            method: [],
            headers: []
        });
    }
    ngOnInit() {
        this.control = this.data.control;
        this.setValue(this.control);
    }
    get options() {
        return this.aswEditSingleSelectForm.get('options');
    }
    createOption() {
        return this.formBuilder.group({
            key: ['', [Validators.required, Validators.minLength(1), Validators.maxLength(50)]],
            value: ['', [Validators.required, Validators.minLength(1), Validators.maxLength(999)]],
            isChecked: [false]
        });
    }
    addNewOption() {
        this.options.push(this.createOption());
    }
    onNoClick() {
        this.dialogRef.close();
    }
    removeOption(index) {
        this.options.removeAt(index);
    }
    onLabelTypeChange(item) {
        if (item.value) {
            this.labelType = item.value;
        }
        else {
            this.labelType = item.target.value;
        }
    }
    onSubmit() {
        if (this.aswEditSingleSelectForm.invalid) {
            return;
        }
        this.aswEditSingleSelectForm.value.options.forEach((element) => {
            if (element.isChecked) {
                this.aswEditSingleSelectForm.value.value = element.key;
            }
        });
        this.aswEditSingleSelectForm.value.controlType = this.control.controlType;
        this.aswEditSingleSelectForm.value.guid = this.control.guid;
        this.dialogRef.close(this.aswEditSingleSelectForm.value);
    }
    setValue(control) {
        this.aswEditSingleSelectForm.patchValue({
            id: control.id,
            tooltip: control.tooltip,
            label: control.label,
            style: control.style,
            value: control.value ?? '',
            customClass: control.customClass ?? '',
            isRequired: control.isRequired,
            isDisabled: control.isDisabled,
            labelType: control.labelType ?? '',
            apiUrl: control.apiUrl ?? '',
            method: control.method ?? '',
            headers: control.headers ?? '',
            body: control.body ?? {}
        });
        this.labelType = control.labelType ? control.labelType : 'label';
        const optionFormGroup = control.options.map((option) => this.formBuilder.group(option));
        const optionFormArray = this.formBuilder.array(optionFormGroup);
        this.aswEditSingleSelectForm.setControl('options', optionFormArray);
    }
    onStatusChange(event) {
        this.status = event.checked ? true : false;
        if (event.checked === undefined) {
            this.status = event.target.checked ? true : false;
        }
    }
    onKey(event, index) {
        let isError = false;
        this.options.controls.filter((element, elementIndex) => {
            if (element.value.key === event.target.value && index !== elementIndex) {
                isError = true;
            }
        });
        if (isError) {
            this.options.controls[index].get('key')?.setErrors({ unique: true });
        }
    }
    radioChange(event) {
        this.options.controls.filter((element) => {
            element.value.isChecked = element.value.key === event.value ? true : false;
        });
        const optionFormGroup = this.options.controls.map((option) => this.formBuilder.group(option.value));
        const optionFormArray = this.formBuilder.array(optionFormGroup);
        this.aswEditSingleSelectForm.setControl('options', optionFormArray);
    }
    getApiData(data) {
        this.control.body = data.body;
        this.control.headers = data.headers;
        this.control.method = data.method;
        this.control.apiUrl = data.apiUrl;
        if (data.responseData?.value) {
            this.control.options = data.responseData.value;
            this.setValue(this.control);
        }
        else {
            this.control.options = data.responseData;
            this.setValue(this.control);
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AswSingleSelectDialog, deps: [{ token: i1.FormBuilder }, { token: i2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: AswSingleSelectDialog, selector: "asw-single-select-dialog", ngImport: i0, template: "<div class=\"asw-dialog-header\">\r\n    <div class=\"asw-edit-row-dialog\">\r\n        <div class=\"asw-dialog-header clearfix\">\r\n            <div class=\"asw-dialog-about\">\r\n                <h1 mat-dialog-title class=\"asw-m-0\">{{'FormControl.Edit' | aswTranslate}} {{control.controlType != 'radio' ? control.label : 'Radio'}}</h1>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <button mat-icon-button (click)=\"onNoClick()\" aria-label=\"Close dialog\" class=\"asw-mt-2 asw-me-2\">\r\n        <div [innerHTML]=\"icons.close | aswSafeHtml\"></div>\r\n    </button>\r\n</div>\r\n<mat-divider></mat-divider>\r\n<form [formGroup]=\"aswEditSingleSelectForm\" (ngSubmit)=\"onSubmit()\">\r\n    <div mat-dialog-content class=\"mat-typography\">\r\n        <mat-tab-group dynamicHeight mat-stretch-tabs=\"false\">\r\n            <mat-tab label=\"{{'FormControl.Properties' | aswTranslate}}\">\r\n                <div class=\"asw-row asw-px-2 asw-py-3\">                    \r\n                    <ng-container *ngIf=\"data.CSSFramework === 'material'; else bootstrap\">\r\n                        <ng-container *ngIf=\"control.labelType !== undefined\">\r\n                            <div class=\"asw-col-md-12\">\r\n                                <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                    <mat-label>{{'FormControl.LabelType' | aswTranslate}}</mat-label>\r\n                                    <mat-select formControlName=\"labelType\" matTooltip=\"{{'FormControl.SelectLabelType' | aswTranslate}}\" \r\n                                        (selectionChange)=\"onLabelTypeChange($event)\">\r\n                                        <mat-option value=\"label\">Simple Label</mat-option>\r\n                                        <mat-option value=\"text-editor\">Text Editor</mat-option>\r\n                                    </mat-select>\r\n                                </mat-form-field>\r\n                            </div>\r\n                        </ng-container>\r\n                        <div class=\"asw-col-md-12 {{control.controlType == 'radio' ? 'asw-mb-2' : ''}}\">\r\n                            <ng-container *ngIf=\"labelType === 'label'; else aswEditor\">\r\n                                <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                    <mat-label>{{'FormControl.Label' | aswTranslate}}</mat-label>\r\n                                    <input matInput type=\"text\"\r\n                                        placeholder=\"{{'FormControl.Label' | aswTranslate}}\"\r\n                                        matTooltip=\"{{'FormControl.Label' | aswTranslate}}\"\r\n                                        formControlName=\"label\" required>\r\n                                    <mat-icon *ngIf=\"aswEditSingleSelectForm.get('label')?.invalid && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)\"\r\n                                        class=\"asw-error\" matSuffix>error</mat-icon>\r\n                                    <mat-error *ngFor=\"let validation of constants.accountValidationMessages.label\">\r\n                                        <ng-container *ngIf=\"aswEditSingleSelectForm.get('label')?.hasError(validation.type) && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)\">\r\n                                            {{validation.message | aswTranslate}}\r\n                                        </ng-container>\r\n                                    </mat-error>\r\n                                </mat-form-field>\r\n                            </ng-container>\r\n                            <ng-template #aswEditor>\r\n                                <asw-editor autofocus=\"true\" id=\"asw-editor\" formControlName=\"label\" [config]=\"constants.aswEditorConfig\"></asw-editor>\r\n                                <ng-container *ngFor=\"let validation of constants.accountValidationMessages.label\">\r\n                                    <mat-error *ngIf=\"aswEditSingleSelectForm.get('label')?.hasError(validation.type) && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)\">\r\n                                        {{validation.message | aswTranslate}}\r\n                                    </mat-error>\r\n                                </ng-container>\r\n                            </ng-template>\r\n                        </div>\r\n                        <ng-container *ngIf=\"!data.propertyPersonalization.includes('uniqueId')\">\r\n                            <div class=\"asw-col-md-6\">\r\n                                <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                    <mat-label>'{{'FormControl.UniqueId' | aswTranslate}}</mat-label>\r\n                                    <input matInput type=\"text\"\r\n                                        name=\"id\"\r\n                                        placeholder=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n                                        matTooltip=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n                                        formControlName=\"id\" required>\r\n                                    <mat-icon *ngIf=\"aswEditSingleSelectForm.get('id')?.invalid && (aswEditSingleSelectForm.get('id')?.dirty || aswEditSingleSelectForm.get('id')?.touched)\"\r\n                                        class=\"asw-error\" matSuffix>error</mat-icon>\r\n                                    <mat-error *ngFor=\"let validation of constants.accountValidationMessages.id\">\r\n                                        <ng-container *ngIf=\"aswEditSingleSelectForm.get('id')?.hasError(validation.type) && (aswEditSingleSelectForm.get('id')?.dirty || aswEditSingleSelectForm.get('id')?.touched)\">\r\n                                            {{validation.message | aswTranslate}}\r\n                                        </ng-container>\r\n                                    </mat-error>\r\n                                </mat-form-field>\r\n                            </div>\r\n                        </ng-container>\r\n                        <ng-container *ngIf=\"!data.propertyPersonalization.includes('customCSSClass')\">\r\n                            <div class=\"asw-col-md-6\">\r\n                                <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                    <mat-label>{{'FormControl.CustomCSSClass' | aswTranslate}}</mat-label>\r\n                                    <input matInput type=\"text\"\r\n                                        name=\"customClass\"\r\n                                        placeholder=\"{{'FormControl.CustomCSSClass' | aswTranslate}}\"\r\n                                        matTooltip=\"{{'FormControl.CustomCSSClass' | aswTranslate}}\"\r\n                                        formControlName=\"customClass\">\r\n                                </mat-form-field>\r\n                            </div>\r\n                        </ng-container>\r\n                        <div class=\"{{control.controlType != 'radio' ? 'asw-col-md-6' : 'asw-col-md-12'}}\">\r\n                            <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                <mat-label>{{'FormControl.Tooltip' | aswTranslate}}</mat-label>\r\n                                <input matInput type=\"text\"\r\n                                    placeholder=\"{{'FormControl.Tooltip' | aswTranslate}}\"\r\n                                    matTooltip=\"{{'FormControl.Tooltip' | aswTranslate}}\"\r\n                                    formControlName=\"tooltip\">\r\n                            </mat-form-field>\r\n                        </div>\r\n                        <div class=\"{{control.controlType != 'radio' ? 'asw-col-md-6' : 'asw-col-md-4'}}\" *ngIf=\"control.controlType != 'radio'\">\r\n                            <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                <mat-label>{{'FormControl.Style' | aswTranslate}}</mat-label>\r\n                                <mat-select formControlName=\"style\" matTooltip=\"{{'FormControl.SelectStyle' | aswTranslate}}\">\r\n                                    <mat-option value=\"fill\">Fill</mat-option>\r\n                                    <mat-option value=\"outline\">Outline</mat-option>\r\n                                </mat-select>\r\n                            </mat-form-field>\r\n                        </div>\r\n                    </ng-container>\r\n                    <ng-template #bootstrap>\r\n                        <ng-container *ngIf=\"control.labelType !== undefined\">\r\n                            <div class=\"asw-mb-3\">\r\n                                <label class=\"asw-input-label\">{{'FormControl.LabelType' | aswTranslate}}</label>\r\n                                <select formControlName=\"labelType\" class=\"asw-select\" matTooltip=\"{{'FormControl.SelectLabelType' | aswTranslate}}\"\r\n                                    (change)=\"onLabelTypeChange($event)\">\r\n                                    <option value=\"label\">Simple Label</option>\r\n                                    <option value=\"text-editor\">Text Editor</option>\r\n                                </select>\r\n                            </div>\r\n                        </ng-container>\r\n                        <div class=\"asw-col-md-12 {{control.controlType == 'radio' ? 'asw-mb-2' : ''}}\">\r\n                            <ng-container *ngIf=\"labelType === 'label'; else aswEditor\">\r\n                                <div class=\"asw-mb-3\">\r\n                                    <label class=\"asw-input-label asw-invalid-label {{(aswEditSingleSelectForm.get('label')?.invalid && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)) ? 'asw-red-color' : ''}}\">{{'FormControl.Label' | aswTranslate}}</label>\r\n                                    <input type=\"text\"\r\n                                        class=\"asw-input-control\"\r\n                                        [class.asw-is-invalid]=\"(aswEditSingleSelectForm.get('label')?.invalid && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched))\"\r\n                                        matTooltip=\"{{'FormControl.Label' | aswTranslate}}\"\r\n                                        formControlName=\"label\" required>\r\n                                    <div *ngFor=\"let validation of constants.accountValidationMessages.label\" class=\"invalid-feedback\">\r\n                                        <ng-container *ngIf=\"aswEditSingleSelectForm.get('label')?.hasError(validation.type) && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)\">\r\n                                            {{validation.message | aswTranslate}}\r\n                                        </ng-container>\r\n                                    </div>\r\n                                </div>\r\n                            </ng-container>\r\n                            <ng-template #aswEditor>\r\n                                <asw-editor autofocus=\"true\" id=\"asw-editor\" formControlName=\"label\" [config]=\"constants.aswEditorConfig\"></asw-editor>\r\n                                <ng-container *ngFor=\"let validation of constants.accountValidationMessages.label\" class=\"invalid-feedback\">\r\n                                    <div *ngIf=\"aswEditSingleSelectForm.get('label')?.hasError(validation.type) && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)\">\r\n                                        {{validation.message | aswTranslate}}\r\n                                    </div>\r\n                                </ng-container>\r\n                            </ng-template>\r\n                        </div>\r\n                        <ng-container *ngIf=\"!data.propertyPersonalization.includes('uniqueId')\">\r\n                            <div class=\"asw-col-md-6\">\r\n                                <div class=\"asw-mb-3\">\r\n                                    <label class=\"asw-input-label asw-invalid-label {{(aswEditSingleSelectForm.get('id')?.invalid && (aswEditSingleSelectForm.get('id')?.dirty || aswEditSingleSelectForm.get('id')?.touched)) ? 'asw-red-color' : ''}}\">{{'FormControl.UniqueId' | aswTranslate}}</label>\r\n                                    <input type=\"text\"\r\n                                        name=\"id\"\r\n                                        class=\"asw-input-control\"\r\n                                        [class.asw-is-invalid]=\"(aswEditSingleSelectForm.get('id')?.invalid && (aswEditSingleSelectForm.get('id')?.dirty || aswEditSingleSelectForm.get('id')?.touched))\"\r\n                                        matTooltip=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n                                        formControlName=\"id\" required>\r\n                                    <div *ngFor=\"let validation of constants.accountValidationMessages.id\" class=\"invalid-feedback\">\r\n                                        <ng-container *ngIf=\"aswEditSingleSelectForm.get('id')?.hasError(validation.type) && (aswEditSingleSelectForm.get('id')?.dirty || aswEditSingleSelectForm.get('id')?.touched)\">\r\n                                            {{validation.message | aswTranslate}}\r\n                                        </ng-container>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </ng-container>\r\n                        <ng-container *ngIf=\"!data.propertyPersonalization.includes('customCSSClass')\">\r\n                            <div class=\"asw-col-md-6\">\r\n                                <div class=\"asw-mb-3\">\r\n                                    <label class=\"asw-input-label\">{{'FormControl.CustomCSSClass' | aswTranslate}}</label>\r\n                                    <input type=\"text\"\r\n                                        name=\"customClass\"\r\n                                        class=\"asw-input-control\"\r\n                                        matTooltip=\"{{'FormControl.CustomCSSClass' | aswTranslate}}\"\r\n                                        formControlName=\"customClass\">\r\n                                </div>\r\n                            </div>\r\n                        </ng-container>                        \r\n                        <div class=\"asw-col-md-12\">\r\n                            <div class=\"asw-mb-3\">\r\n                                <label class=\"asw-input-label\">{{'FormControl.Tooltip' | aswTranslate}}</label>\r\n                                <input type=\"text\"\r\n                                    class=\"asw-input-control\"\r\n                                    matTooltip=\"{{'FormControl.Tooltip' | aswTranslate}}\"\r\n                                    formControlName=\"tooltip\">\r\n                            </div>\r\n                        </div>\r\n                    </ng-template>\r\n                    <div class=\"asw-col-md-12\">\r\n                        <table class=\"asw-table asw-table-sm asw-table-bordered\">\r\n                            <thead>\r\n                                <tr>\r\n                                    <th></th>\r\n                                    <th>{{'FormControl.Key' | aswTranslate}}</th>\r\n                                    <th>{{'FormControl.Value' | aswTranslate}}</th>\r\n                                    <th></th>\r\n                                </tr>\r\n                            </thead>\r\n                            <tbody>\r\n                                <ng-container formArrayName=\"options\">\r\n                                    <tr *ngFor=\"let option of options.controls; let index = index; let last=last;\" \r\n                                    [formGroupName]=\"index\">\r\n                                        <td class=\"asw-text-center\">\r\n                                            <mat-radio-group formControlName=\"key\" color=\"primary\">\r\n                                                <mat-radio-button  \r\n                                                [value]=\"option.value.key\"\r\n                                                (change)=\"radioChange($event)\"\r\n                                                [checked]=\"option.value.isChecked\"></mat-radio-button>\r\n                                            </mat-radio-group>\r\n                                        </td>\r\n                                        <td>\r\n                                            <input type=\"text\"\r\n                                                placeholder=\"{{'FormControl.OptionKey' | aswTranslate}} {{index+1}}\"\r\n                                                class=\"asw-input-control\"\r\n                                                formControlName=\"key\"\r\n                                                matTooltip=\"{{'FormControl.OptionKey' | aswTranslate}} {{index+1}}\"\r\n                                                minlength=\"1\"\r\n                                                maxlength=\"50\"\r\n                                                (keyup)=\"onKey($event, index)\"\r\n                                                pattern=\"^[a-zA-Z0-9_\\-]{1,50}$\"\r\n                                                [class.asw-is-invalid]=\"options.controls[index].get('key')?.invalid && (options.controls[index].get('key')?.dirty || options.controls[index].get('key')?.touched)\"\r\n                                                required>\r\n                                            <ng-container *ngFor=\"let validation of constants.accountValidationMessages.key\">\r\n                                                <mat-error *ngIf=\"options.controls[index].get('key')?.hasError(validation.type) && (options.controls[index].get('key')?.dirty || options.controls[index].get('key')?.touched || options.controls[index].get('key')?.errors?.unique)\">\r\n                                                    {{validation.message | aswTranslate}}\r\n                                                </mat-error>\r\n                                            </ng-container>\r\n                                        </td>\r\n                                        <td>\r\n                                            <input type=\"text\"\r\n                                                placeholder=\"{{'FormControl.OptionValue' | aswTranslate}} {{index+1}}\"\r\n                                                formControlName=\"value\"\r\n                                                class=\"asw-input-control\"\r\n                                                matTooltip=\"{{'FormControl.OptionValue' | aswTranslate}} {{index+1}}\"\r\n                                                minlength=\"1\"\r\n                                                maxlength=\"999\"\r\n                                                [class.asw-is-invalid]=\"options.controls[index].get('value')?.invalid && (options.controls[index].get('value')?.dirty || options.controls[index].get('value')?.touched)\"\r\n                                                required>\r\n                                            <ng-container *ngFor=\"let validation of constants.accountValidationMessages.value\">\r\n                                                <mat-error *ngIf=\"options.controls[index].get('value')?.hasError(validation.type) && (options.controls[index].get('value')?.dirty || options.controls[index].get('value')?.touched)\">\r\n                                                    {{validation.message | aswTranslate}}\r\n                                                </mat-error>\r\n                                            </ng-container>\r\n                                        </td>\r\n                                        <td class=\"asw-text-center\">                                                \r\n                                            <button mat-icon-button *ngIf=\"index != 0\"\r\n                                                type=\"button\" \r\n                                                matTooltip=\"{{'FormControl.Delete' | aswTranslate}}\" \r\n                                                [matTooltipPosition]=\"'below'\" \r\n                                                (click)=\"removeOption(index)\">\r\n                                                <span [innerHTML]=\"icons.delete2 | aswSafeHtml\"></span>\r\n                                            </button>\r\n                                        </td>\r\n                                    </tr>\r\n                                </ng-container>\r\n                                <tr>\r\n                                    <td colspan=\"4\">\r\n                                        <button class=\"asw-button asw-button-primary asw-button-sm\"\r\n                                            type=\"button\" \r\n                                            matTooltip=\"{{'FormControl.Add' | aswTranslate}}\" \r\n                                            [matTooltipPosition]=\"'below'\"\r\n                                            (click)=\"addNewOption()\">\r\n                                            <span class=\"asw-icon asw-me-1\" [innerHTML]=\"icons.add | aswSafeHtml\"></span>\r\n                                            {{'FormControl.AddOption' | aswTranslate}}\r\n                                        </button>\r\n                                    </td>\r\n                                </tr>\r\n                            </tbody>\r\n                        </table>\r\n                    </div>\r\n                    <ng-container *ngIf=\"data.CSSFramework === 'material'; else bootstrap1\">\r\n                        <div class=\"asw-col-md-3\">\r\n                            <mat-slide-toggle color=\"primary\"\r\n                                    #isActive\r\n                                    formControlName=\"isRequired\"\r\n                                    (change)=\"onStatusChange($event)\">\r\n                                    {{(status ? 'FormControl.Required' : 'FormControl.NotRequired') | aswTranslate}}\r\n                            </mat-slide-toggle>\r\n                        </div>\r\n                        <div class=\"asw-col-md-3\">\r\n                            <mat-slide-toggle color=\"primary\"\r\n                                    #isDisable\r\n                                    formControlName=\"isDisabled\">\r\n                                    {{'FormControl.Readonly' | aswTranslate}}\r\n                            </mat-slide-toggle>\r\n                        </div>\r\n                    </ng-container>\r\n                    <ng-template #bootstrap1>\r\n                        <div class=\"asw-col-md-2\">\r\n                            <div class=\"asw-mb-3\">\r\n                                <div class=\"asw-form-check asw-form-switch\">\r\n                                    <input class=\"asw-form-check-input\" \r\n                                        type=\"checkbox\" \r\n                                        #isActive\r\n                                        id=\"isActive\" \r\n                                        formControlName=\"isRequired\"\r\n                                        (change)=\"onStatusChange($event)\">\r\n                                    <label class=\"asw-form-check-label\" for=\"isActive\">\r\n                                        {{(status ? 'FormControl.Required' : 'FormControl.NotRequired') | aswTranslate}}\r\n                                    </label>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"asw-col-md-2\">\r\n                            <div class=\"asw-mb-3\">\r\n                                <div class=\"asw-form-check asw-form-switch\">\r\n                                    <input class=\"asw-form-check-input\" \r\n                                        type=\"checkbox\"\r\n                                        id=\"isDisable\" \r\n                                        #isDisable\r\n                                        formControlName=\"isDisabled\"\r\n                                        (change)=\"onStatusChange($event)\">\r\n                                    <label class=\"asw-form-check-label\" for=\"isDisable\">\r\n                                        {{'FormControl.Readonly' | aswTranslate}}\r\n                                    </label>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </ng-template>                    \r\n                </div>\r\n            </mat-tab>\r\n            <mat-tab label=\"{{'FormControl.API' | aswTranslate}}\">\r\n                <asw-api-communicator (apiResponse)=\"getApiData($event)\" [CSSFramework]=\"data.CSSFramework\"></asw-api-communicator>\r\n            </mat-tab>\r\n        </mat-tab-group>\r\n    </div>\r\n    <mat-divider></mat-divider>\r\n    <div mat-dialog-actions align=\"end\">\r\n        <button type=\"button\"\r\n                class=\"asw-button asw-button-danger asw-mb-1 asw-me-2\"\r\n                (click)=\"onNoClick()\">\r\n            {{'FormControl.No' | aswTranslate}}\r\n        </button>\r\n        <button type=\"submit\"\r\n                class=\"asw-button asw-button-primary asw-mb-1\"\r\n                cdkFocusInitial>\r\n            {{'FormControl.Yes' | aswTranslate}}\r\n        </button>\r\n    </div>\r\n</form>", dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i6.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl],      input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i8.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i8.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i9.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i9.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "component", type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "panelWidth", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i11.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }, { kind: "component", type: i12.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i12.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "directive", type: i13.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i14.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i15.AswCommunicatorApi, selector: "asw-api-communicator", inputs: ["CSSFramework"], outputs: ["apiResponse"] }, { kind: "component", type: i16.AswEditor, selector: "asw-editor", inputs: ["id", "config", "placeholder", "tabIndex"], outputs: ["html", "viewMode", "blur", "focus"] }, { kind: "pipe", type: i17.AswTranslatePipe, name: "aswTranslate" }, { kind: "pipe", type: i15.AswSafeHtmlPipe, name: "aswSafeHtml" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AswSingleSelectDialog, decorators: [{
            type: Component,
            args: [{ selector: 'asw-single-select-dialog', template: "<div class=\"asw-dialog-header\">\r\n    <div class=\"asw-edit-row-dialog\">\r\n        <div class=\"asw-dialog-header clearfix\">\r\n            <div class=\"asw-dialog-about\">\r\n                <h1 mat-dialog-title class=\"asw-m-0\">{{'FormControl.Edit' | aswTranslate}} {{control.controlType != 'radio' ? control.label : 'Radio'}}</h1>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <button mat-icon-button (click)=\"onNoClick()\" aria-label=\"Close dialog\" class=\"asw-mt-2 asw-me-2\">\r\n        <div [innerHTML]=\"icons.close | aswSafeHtml\"></div>\r\n    </button>\r\n</div>\r\n<mat-divider></mat-divider>\r\n<form [formGroup]=\"aswEditSingleSelectForm\" (ngSubmit)=\"onSubmit()\">\r\n    <div mat-dialog-content class=\"mat-typography\">\r\n        <mat-tab-group dynamicHeight mat-stretch-tabs=\"false\">\r\n            <mat-tab label=\"{{'FormControl.Properties' | aswTranslate}}\">\r\n                <div class=\"asw-row asw-px-2 asw-py-3\">                    \r\n                    <ng-container *ngIf=\"data.CSSFramework === 'material'; else bootstrap\">\r\n                        <ng-container *ngIf=\"control.labelType !== undefined\">\r\n                            <div class=\"asw-col-md-12\">\r\n                                <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                    <mat-label>{{'FormControl.LabelType' | aswTranslate}}</mat-label>\r\n                                    <mat-select formControlName=\"labelType\" matTooltip=\"{{'FormControl.SelectLabelType' | aswTranslate}}\" \r\n                                        (selectionChange)=\"onLabelTypeChange($event)\">\r\n                                        <mat-option value=\"label\">Simple Label</mat-option>\r\n                                        <mat-option value=\"text-editor\">Text Editor</mat-option>\r\n                                    </mat-select>\r\n                                </mat-form-field>\r\n                            </div>\r\n                        </ng-container>\r\n                        <div class=\"asw-col-md-12 {{control.controlType == 'radio' ? 'asw-mb-2' : ''}}\">\r\n                            <ng-container *ngIf=\"labelType === 'label'; else aswEditor\">\r\n                                <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                    <mat-label>{{'FormControl.Label' | aswTranslate}}</mat-label>\r\n                                    <input matInput type=\"text\"\r\n                                        placeholder=\"{{'FormControl.Label' | aswTranslate}}\"\r\n                                        matTooltip=\"{{'FormControl.Label' | aswTranslate}}\"\r\n                                        formControlName=\"label\" required>\r\n                                    <mat-icon *ngIf=\"aswEditSingleSelectForm.get('label')?.invalid && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)\"\r\n                                        class=\"asw-error\" matSuffix>error</mat-icon>\r\n                                    <mat-error *ngFor=\"let validation of constants.accountValidationMessages.label\">\r\n                                        <ng-container *ngIf=\"aswEditSingleSelectForm.get('label')?.hasError(validation.type) && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)\">\r\n                                            {{validation.message | aswTranslate}}\r\n                                        </ng-container>\r\n                                    </mat-error>\r\n                                </mat-form-field>\r\n                            </ng-container>\r\n                            <ng-template #aswEditor>\r\n                                <asw-editor autofocus=\"true\" id=\"asw-editor\" formControlName=\"label\" [config]=\"constants.aswEditorConfig\"></asw-editor>\r\n                                <ng-container *ngFor=\"let validation of constants.accountValidationMessages.label\">\r\n                                    <mat-error *ngIf=\"aswEditSingleSelectForm.get('label')?.hasError(validation.type) && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)\">\r\n                                        {{validation.message | aswTranslate}}\r\n                                    </mat-error>\r\n                                </ng-container>\r\n                            </ng-template>\r\n                        </div>\r\n                        <ng-container *ngIf=\"!data.propertyPersonalization.includes('uniqueId')\">\r\n                            <div class=\"asw-col-md-6\">\r\n                                <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                    <mat-label>'{{'FormControl.UniqueId' | aswTranslate}}</mat-label>\r\n                                    <input matInput type=\"text\"\r\n                                        name=\"id\"\r\n                                        placeholder=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n                                        matTooltip=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n                                        formControlName=\"id\" required>\r\n                                    <mat-icon *ngIf=\"aswEditSingleSelectForm.get('id')?.invalid && (aswEditSingleSelectForm.get('id')?.dirty || aswEditSingleSelectForm.get('id')?.touched)\"\r\n                                        class=\"asw-error\" matSuffix>error</mat-icon>\r\n                                    <mat-error *ngFor=\"let validation of constants.accountValidationMessages.id\">\r\n                                        <ng-container *ngIf=\"aswEditSingleSelectForm.get('id')?.hasError(validation.type) && (aswEditSingleSelectForm.get('id')?.dirty || aswEditSingleSelectForm.get('id')?.touched)\">\r\n                                            {{validation.message | aswTranslate}}\r\n                                        </ng-container>\r\n                                    </mat-error>\r\n                                </mat-form-field>\r\n                            </div>\r\n                        </ng-container>\r\n                        <ng-container *ngIf=\"!data.propertyPersonalization.includes('customCSSClass')\">\r\n                            <div class=\"asw-col-md-6\">\r\n                                <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                    <mat-label>{{'FormControl.CustomCSSClass' | aswTranslate}}</mat-label>\r\n                                    <input matInput type=\"text\"\r\n                                        name=\"customClass\"\r\n                                        placeholder=\"{{'FormControl.CustomCSSClass' | aswTranslate}}\"\r\n                                        matTooltip=\"{{'FormControl.CustomCSSClass' | aswTranslate}}\"\r\n                                        formControlName=\"customClass\">\r\n                                </mat-form-field>\r\n                            </div>\r\n                        </ng-container>\r\n                        <div class=\"{{control.controlType != 'radio' ? 'asw-col-md-6' : 'asw-col-md-12'}}\">\r\n                            <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                <mat-label>{{'FormControl.Tooltip' | aswTranslate}}</mat-label>\r\n                                <input matInput type=\"text\"\r\n                                    placeholder=\"{{'FormControl.Tooltip' | aswTranslate}}\"\r\n                                    matTooltip=\"{{'FormControl.Tooltip' | aswTranslate}}\"\r\n                                    formControlName=\"tooltip\">\r\n                            </mat-form-field>\r\n                        </div>\r\n                        <div class=\"{{control.controlType != 'radio' ? 'asw-col-md-6' : 'asw-col-md-4'}}\" *ngIf=\"control.controlType != 'radio'\">\r\n                            <mat-form-field appearance=\"outline\" class=\"asw-width-100\">\r\n                                <mat-label>{{'FormControl.Style' | aswTranslate}}</mat-label>\r\n                                <mat-select formControlName=\"style\" matTooltip=\"{{'FormControl.SelectStyle' | aswTranslate}}\">\r\n                                    <mat-option value=\"fill\">Fill</mat-option>\r\n                                    <mat-option value=\"outline\">Outline</mat-option>\r\n                                </mat-select>\r\n                            </mat-form-field>\r\n                        </div>\r\n                    </ng-container>\r\n                    <ng-template #bootstrap>\r\n                        <ng-container *ngIf=\"control.labelType !== undefined\">\r\n                            <div class=\"asw-mb-3\">\r\n                                <label class=\"asw-input-label\">{{'FormControl.LabelType' | aswTranslate}}</label>\r\n                                <select formControlName=\"labelType\" class=\"asw-select\" matTooltip=\"{{'FormControl.SelectLabelType' | aswTranslate}}\"\r\n                                    (change)=\"onLabelTypeChange($event)\">\r\n                                    <option value=\"label\">Simple Label</option>\r\n                                    <option value=\"text-editor\">Text Editor</option>\r\n                                </select>\r\n                            </div>\r\n                        </ng-container>\r\n                        <div class=\"asw-col-md-12 {{control.controlType == 'radio' ? 'asw-mb-2' : ''}}\">\r\n                            <ng-container *ngIf=\"labelType === 'label'; else aswEditor\">\r\n                                <div class=\"asw-mb-3\">\r\n                                    <label class=\"asw-input-label asw-invalid-label {{(aswEditSingleSelectForm.get('label')?.invalid && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)) ? 'asw-red-color' : ''}}\">{{'FormControl.Label' | aswTranslate}}</label>\r\n                                    <input type=\"text\"\r\n                                        class=\"asw-input-control\"\r\n                                        [class.asw-is-invalid]=\"(aswEditSingleSelectForm.get('label')?.invalid && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched))\"\r\n                                        matTooltip=\"{{'FormControl.Label' | aswTranslate}}\"\r\n                                        formControlName=\"label\" required>\r\n                                    <div *ngFor=\"let validation of constants.accountValidationMessages.label\" class=\"invalid-feedback\">\r\n                                        <ng-container *ngIf=\"aswEditSingleSelectForm.get('label')?.hasError(validation.type) && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)\">\r\n                                            {{validation.message | aswTranslate}}\r\n                                        </ng-container>\r\n                                    </div>\r\n                                </div>\r\n                            </ng-container>\r\n                            <ng-template #aswEditor>\r\n                                <asw-editor autofocus=\"true\" id=\"asw-editor\" formControlName=\"label\" [config]=\"constants.aswEditorConfig\"></asw-editor>\r\n                                <ng-container *ngFor=\"let validation of constants.accountValidationMessages.label\" class=\"invalid-feedback\">\r\n                                    <div *ngIf=\"aswEditSingleSelectForm.get('label')?.hasError(validation.type) && (aswEditSingleSelectForm.get('label')?.dirty || aswEditSingleSelectForm.get('label')?.touched)\">\r\n                                        {{validation.message | aswTranslate}}\r\n                                    </div>\r\n                                </ng-container>\r\n                            </ng-template>\r\n                        </div>\r\n                        <ng-container *ngIf=\"!data.propertyPersonalization.includes('uniqueId')\">\r\n                            <div class=\"asw-col-md-6\">\r\n                                <div class=\"asw-mb-3\">\r\n                                    <label class=\"asw-input-label asw-invalid-label {{(aswEditSingleSelectForm.get('id')?.invalid && (aswEditSingleSelectForm.get('id')?.dirty || aswEditSingleSelectForm.get('id')?.touched)) ? 'asw-red-color' : ''}}\">{{'FormControl.UniqueId' | aswTranslate}}</label>\r\n                                    <input type=\"text\"\r\n                                        name=\"id\"\r\n                                        class=\"asw-input-control\"\r\n                                        [class.asw-is-invalid]=\"(aswEditSingleSelectForm.get('id')?.invalid && (aswEditSingleSelectForm.get('id')?.dirty || aswEditSingleSelectForm.get('id')?.touched))\"\r\n                                        matTooltip=\"{{'FormControl.UniqueId' | aswTranslate}}\"\r\n                                        formControlName=\"id\" required>\r\n                                    <div *ngFor=\"let validation of constants.accountValidationMessages.id\" class=\"invalid-feedback\">\r\n                                        <ng-container *ngIf=\"aswEditSingleSelectForm.get('id')?.hasError(validation.type) && (aswEditSingleSelectForm.get('id')?.dirty || aswEditSingleSelectForm.get('id')?.touched)\">\r\n                                            {{validation.message | aswTranslate}}\r\n                                        </ng-container>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </ng-container>\r\n                        <ng-container *ngIf=\"!data.propertyPersonalization.includes('customCSSClass')\">\r\n                            <div class=\"asw-col-md-6\">\r\n                                <div class=\"asw-mb-3\">\r\n                                    <label class=\"asw-input-label\">{{'FormControl.CustomCSSClass' | aswTranslate}}</label>\r\n                                    <input type=\"text\"\r\n                                        name=\"customClass\"\r\n                                        class=\"asw-input-control\"\r\n                                        matTooltip=\"{{'FormControl.CustomCSSClass' | aswTranslate}}\"\r\n                                        formControlName=\"customClass\">\r\n                                </div>\r\n                            </div>\r\n                        </ng-container>                        \r\n                        <div class=\"asw-col-md-12\">\r\n                            <div class=\"asw-mb-3\">\r\n                                <label class=\"asw-input-label\">{{'FormControl.Tooltip' | aswTranslate}}</label>\r\n                                <input type=\"text\"\r\n                                    class=\"asw-input-control\"\r\n                                    matTooltip=\"{{'FormControl.Tooltip' | aswTranslate}}\"\r\n                                    formControlName=\"tooltip\">\r\n                            </div>\r\n                        </div>\r\n                    </ng-template>\r\n                    <div class=\"asw-col-md-12\">\r\n                        <table class=\"asw-table asw-table-sm asw-table-bordered\">\r\n                            <thead>\r\n                                <tr>\r\n                                    <th></th>\r\n                                    <th>{{'FormControl.Key' | aswTranslate}}</th>\r\n                                    <th>{{'FormControl.Value' | aswTranslate}}</th>\r\n                                    <th></th>\r\n                                </tr>\r\n                            </thead>\r\n                            <tbody>\r\n                                <ng-container formArrayName=\"options\">\r\n                                    <tr *ngFor=\"let option of options.controls; let index = index; let last=last;\" \r\n                                    [formGroupName]=\"index\">\r\n                                        <td class=\"asw-text-center\">\r\n                                            <mat-radio-group formControlName=\"key\" color=\"primary\">\r\n                                                <mat-radio-button  \r\n                                                [value]=\"option.value.key\"\r\n                                                (change)=\"radioChange($event)\"\r\n                                                [checked]=\"option.value.isChecked\"></mat-radio-button>\r\n                                            </mat-radio-group>\r\n                                        </td>\r\n                                        <td>\r\n                                            <input type=\"text\"\r\n                                                placeholder=\"{{'FormControl.OptionKey' | aswTranslate}} {{index+1}}\"\r\n                                                class=\"asw-input-control\"\r\n                                                formControlName=\"key\"\r\n                                                matTooltip=\"{{'FormControl.OptionKey' | aswTranslate}} {{index+1}}\"\r\n                                                minlength=\"1\"\r\n                                                maxlength=\"50\"\r\n                                                (keyup)=\"onKey($event, index)\"\r\n                                                pattern=\"^[a-zA-Z0-9_\\-]{1,50}$\"\r\n                                                [class.asw-is-invalid]=\"options.controls[index].get('key')?.invalid && (options.controls[index].get('key')?.dirty || options.controls[index].get('key')?.touched)\"\r\n                                                required>\r\n                                            <ng-container *ngFor=\"let validation of constants.accountValidationMessages.key\">\r\n                                                <mat-error *ngIf=\"options.controls[index].get('key')?.hasError(validation.type) && (options.controls[index].get('key')?.dirty || options.controls[index].get('key')?.touched || options.controls[index].get('key')?.errors?.unique)\">\r\n                                                    {{validation.message | aswTranslate}}\r\n                                                </mat-error>\r\n                                            </ng-container>\r\n                                        </td>\r\n                                        <td>\r\n                                            <input type=\"text\"\r\n                                                placeholder=\"{{'FormControl.OptionValue' | aswTranslate}} {{index+1}}\"\r\n                                                formControlName=\"value\"\r\n                                                class=\"asw-input-control\"\r\n                                                matTooltip=\"{{'FormControl.OptionValue' | aswTranslate}} {{index+1}}\"\r\n                                                minlength=\"1\"\r\n                                                maxlength=\"999\"\r\n                                                [class.asw-is-invalid]=\"options.controls[index].get('value')?.invalid && (options.controls[index].get('value')?.dirty || options.controls[index].get('value')?.touched)\"\r\n                                                required>\r\n                                            <ng-container *ngFor=\"let validation of constants.accountValidationMessages.value\">\r\n                                                <mat-error *ngIf=\"options.controls[index].get('value')?.hasError(validation.type) && (options.controls[index].get('value')?.dirty || options.controls[index].get('value')?.touched)\">\r\n                                                    {{validation.message | aswTranslate}}\r\n                                                </mat-error>\r\n                                            </ng-container>\r\n                                        </td>\r\n                                        <td class=\"asw-text-center\">                                                \r\n                                            <button mat-icon-button *ngIf=\"index != 0\"\r\n                                                type=\"button\" \r\n                                                matTooltip=\"{{'FormControl.Delete' | aswTranslate}}\" \r\n                                                [matTooltipPosition]=\"'below'\" \r\n                                                (click)=\"removeOption(index)\">\r\n                                                <span [innerHTML]=\"icons.delete2 | aswSafeHtml\"></span>\r\n                                            </button>\r\n                                        </td>\r\n                                    </tr>\r\n                                </ng-container>\r\n                                <tr>\r\n                                    <td colspan=\"4\">\r\n                                        <button class=\"asw-button asw-button-primary asw-button-sm\"\r\n                                            type=\"button\" \r\n                                            matTooltip=\"{{'FormControl.Add' | aswTranslate}}\" \r\n                                            [matTooltipPosition]=\"'below'\"\r\n                                            (click)=\"addNewOption()\">\r\n                                            <span class=\"asw-icon asw-me-1\" [innerHTML]=\"icons.add | aswSafeHtml\"></span>\r\n                                            {{'FormControl.AddOption' | aswTranslate}}\r\n                                        </button>\r\n                                    </td>\r\n                                </tr>\r\n                            </tbody>\r\n                        </table>\r\n                    </div>\r\n                    <ng-container *ngIf=\"data.CSSFramework === 'material'; else bootstrap1\">\r\n                        <div class=\"asw-col-md-3\">\r\n                            <mat-slide-toggle color=\"primary\"\r\n                                    #isActive\r\n                                    formControlName=\"isRequired\"\r\n                                    (change)=\"onStatusChange($event)\">\r\n                                    {{(status ? 'FormControl.Required' : 'FormControl.NotRequired') | aswTranslate}}\r\n                            </mat-slide-toggle>\r\n                        </div>\r\n                        <div class=\"asw-col-md-3\">\r\n                            <mat-slide-toggle color=\"primary\"\r\n                                    #isDisable\r\n                                    formControlName=\"isDisabled\">\r\n                                    {{'FormControl.Readonly' | aswTranslate}}\r\n                            </mat-slide-toggle>\r\n                        </div>\r\n                    </ng-container>\r\n                    <ng-template #bootstrap1>\r\n                        <div class=\"asw-col-md-2\">\r\n                            <div class=\"asw-mb-3\">\r\n                                <div class=\"asw-form-check asw-form-switch\">\r\n                                    <input class=\"asw-form-check-input\" \r\n                                        type=\"checkbox\" \r\n                                        #isActive\r\n                                        id=\"isActive\" \r\n                                        formControlName=\"isRequired\"\r\n                                        (change)=\"onStatusChange($event)\">\r\n                                    <label class=\"asw-form-check-label\" for=\"isActive\">\r\n                                        {{(status ? 'FormControl.Required' : 'FormControl.NotRequired') | aswTranslate}}\r\n                                    </label>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"asw-col-md-2\">\r\n                            <div class=\"asw-mb-3\">\r\n                                <div class=\"asw-form-check asw-form-switch\">\r\n                                    <input class=\"asw-form-check-input\" \r\n                                        type=\"checkbox\"\r\n                                        id=\"isDisable\" \r\n                                        #isDisable\r\n                                        formControlName=\"isDisabled\"\r\n                                        (change)=\"onStatusChange($event)\">\r\n                                    <label class=\"asw-form-check-label\" for=\"isDisable\">\r\n                                        {{'FormControl.Readonly' | aswTranslate}}\r\n                                    </label>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </ng-template>                    \r\n                </div>\r\n            </mat-tab>\r\n            <mat-tab label=\"{{'FormControl.API' | aswTranslate}}\">\r\n                <asw-api-communicator (apiResponse)=\"getApiData($event)\" [CSSFramework]=\"data.CSSFramework\"></asw-api-communicator>\r\n            </mat-tab>\r\n        </mat-tab-group>\r\n    </div>\r\n    <mat-divider></mat-divider>\r\n    <div mat-dialog-actions align=\"end\">\r\n        <button type=\"button\"\r\n                class=\"asw-button asw-button-danger asw-mb-1 asw-me-2\"\r\n                (click)=\"onNoClick()\">\r\n            {{'FormControl.No' | aswTranslate}}\r\n        </button>\r\n        <button type=\"submit\"\r\n                class=\"asw-button asw-button-primary asw-mb-1\"\r\n                cdkFocusInitial>\r\n            {{'FormControl.Yes' | aswTranslate}}\r\n        </button>\r\n    </div>\r\n</form>" }]
        }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.MatDialogRef }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }]; } });
//# sourceMappingURL=data:application/json;base64, 