import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
import * as i0 from "@angular/core";
import * as i1 from "@aztrix/components/button";
import * as i2 from "@angular/forms";
import * as i3 from "@angular/material/input";
import * as i4 from "@angular/material/form-field";
import * as i5 from "@aztrix/helpers";
export class CreateApiKeyModalComponent {
    constructor() {
        this.name = new FormControl('');
    }
    addKey() {
        if (this.name.value !== '') {
            this.addName(this.name.value || undefined);
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CreateApiKeyModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CreateApiKeyModalComponent, selector: "ax-create-api-key-modal", ngImport: i0, template: "<mat-form-field class=\"c-input\" width=\"100%\" appearance=\"outline\">\n  <mat-label>{{ 'developer.apiKey.modal.add.label' | translate }}</mat-label>\n  <input matInput axAutofocus [autofocus]=\"true\" [formControl]=\"name\" type=\"text\" />\n  <mat-hint align=\"end\">{{ 'developer.apiKey.modal.add.hint' | translate }}</mat-hint>\n</mat-form-field>\n\n<div class=\"h-button-wrapper\">\n  <button axButton color=\"primary\" filled (click)=\"addKey()\">\n    {{ 'label.create' | translate }}\n  </button>\n</div>\n", styles: [":host{display:block;padding:1rem}\n"], dependencies: [{ kind: "directive", type: i1.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.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: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CreateApiKeyModalComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-create-api-key-modal', template: "<mat-form-field class=\"c-input\" width=\"100%\" appearance=\"outline\">\n  <mat-label>{{ 'developer.apiKey.modal.add.label' | translate }}</mat-label>\n  <input matInput axAutofocus [autofocus]=\"true\" [formControl]=\"name\" type=\"text\" />\n  <mat-hint align=\"end\">{{ 'developer.apiKey.modal.add.hint' | translate }}</mat-hint>\n</mat-form-field>\n\n<div class=\"h-button-wrapper\">\n  <button axButton color=\"primary\" filled (click)=\"addKey()\">\n    {{ 'label.create' | translate }}\n  </button>\n</div>\n", styles: [":host{display:block;padding:1rem}\n"] }]
        }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlLWFwaS1rZXktbW9kYWwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL2FwaS1rZXlzL2NyZWF0ZS1hcGkta2V5LW1vZGFsL2NyZWF0ZS1hcGkta2V5LW1vZGFsLmNvbXBvbmVudC50cyIsIi4uLy4u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