import { __decorate, __metadata } from "tslib";
import { Component, Input } from '@angular/core';
import { gettext, memoize } from '@c8y/ngx-components';
import { ControlContainer, NgForm } from '@angular/forms';
import { algorithmTypeConfig, CertificateType, certificateTypeConfig } from './signature-configuration.model';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@c8y/ngx-components";
import * as i3 from "@angular/common";
import * as i4 from "ngx-bootstrap/tooltip";
import * as i5 from "ngx-bootstrap/popover";
import * as i6 from "ngx-bootstrap/datepicker";
export class SignatureConfigurationComponent {
    constructor(controlContainer) {
        this.controlContainer = controlContainer;
        this.certificateType = CertificateType;
        this.certificateTypes = certificateTypeConfig;
        this.algorithmTypes = algorithmTypeConfig;
        this.CERTIFICATE_ID_FIELD_POPOVER = gettext('This is the name of the field in the token whose value will be used to select one of the certificates below which has matching "Certificate ID value".');
    }
    shouldShow(field) {
        return field in this.templateModel;
    }
    removeCustomCertificate(customCertificate) {
        this.templateModel.signatureVerificationConfig.manual.removeCustomCertificate(customCertificate);
        this.controlContainer.control.markAsDirty();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: SignatureConfigurationComponent, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: SignatureConfigurationComponent, selector: "c8y-sso-signature-configuration", inputs: { templateModel: "templateModel" }, ngImport: i0, template: "<div class=\"p-24\">\n  <div class=\"row\">\n    <div class=\"col-xs-12 col-sm-3 col-md-2\">\n      <div\n        class=\"h4 text-normal text-right text-left-xs\"\n        translate\n      >\n        Signature verification\n      </div>\n    </div>\n    <div class=\"col-xs-12 col-sm-9 col-md-10 col-lg-9\">\n      <div\n        *ngIf=\"shouldShow('certificateType')\"\n        class=\"form-group p-relative\"\n      >\n        <div class=\"row\">\n          <div class=\"col-sm-6\">\n            <label\n              for=\"certificateType\"\n              class=\"control-label\"\n              translate\n            >\n              Verifier\n            </label>\n            <div class=\"c8y-select-wrapper\">\n              <select\n                class=\"form-control\"\n                id=\"certificateType\"\n                name=\"certificateType\"\n                [(ngModel)]=\"templateModel.signatureVerificationConfig.certificateTypeChosen\"\n              >\n                <option\n                  *ngFor=\"let certificateType of certificateTypes | keyvalue\"\n                  [ngValue]=\"certificateType.key\"\n                >\n                  {{ certificateType.value.label | translate }}\n                </option>\n              </select>\n              <span></span>\n            </div>\n          </div>\n        </div>\n      </div>\n      <div\n        id=\"adfs\"\n        *ngIf=\"\n          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.ADFS\n        \"\n        class=\"row\"\n      >\n        <div class=\"col-sm-6\">\n          <c8y-form-group>\n            <label\n              for=\"adfsManifestUrl\"\n              class=\"control-label\"\n              translate\n            >\n              ADFS manifest URL\n            </label>\n            <input\n              type=\"url\"\n              class=\"form-control\"\n              required\n              [placeholder]=\"\n                'e.g. {{ example }}'\n                  | translate\n                    : {\n                        example: 'https://adfs.tenant.com/federationmetadata/federationmetadata.xml'\n                      }\n              \"\n              [(ngModel)]=\"templateModel.signatureVerificationConfig.adfsManifest.manifestUrl\"\n              name=\"adfsManifestUrl\"\n              id=\"adfsManifestUrl\"\n            />\n          </c8y-form-group>\n        </div>\n      </div>\n\n      <div\n        id=\"add\"\n        *ngIf=\"\n          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.AZURE\n        \"\n      >\n        <div class=\"row\">\n          <div class=\"col-sm-6\">\n            <c8y-form-group>\n              <label\n                for=\"publicKeyDiscoveryUrl\"\n                class=\"control-label\"\n                translate\n              >\n                Public key discovery URL\n              </label>\n              <input\n                type=\"url\"\n                id=\"publicKeyDiscoveryUrl\"\n                class=\"form-control\"\n                required\n                [placeholder]=\"\n                  'e.g. {{ example }}'\n                    | translate\n                      : { example: 'https://login.microsoftonline.de/tenant/discovery/keys' }\n                \"\n                name=\"publicKeyDiscoveryUrl\"\n                [(ngModel)]=\"templateModel.signatureVerificationConfig.aad.publicKeyDiscoveryUrl\"\n              />\n            </c8y-form-group>\n          </div>\n        </div>\n      </div>\n\n      <div\n        id=\"jwks\"\n        *ngIf=\"\n          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.JWKS\n        \"\n      >\n        <div class=\"row\">\n          <div class=\"col-sm-6\">\n            <c8y-form-group>\n              <label\n                for=\"jwksPublicKeyDiscoveryUrl\"\n                class=\"control-label\"\n                translate\n              >\n                JWKS URL\n              </label>\n              <input\n                type=\"url\"\n                class=\"form-control\"\n                id=\"jwksPublicKeyDiscoveryUrl\"\n                required\n                [placeholder]=\"\n                  'e.g. {{ example }}' | translate: { example: 'http://www.example.com/' }\n                \"\n                name=\"jwksUri\"\n                [(ngModel)]=\"templateModel.signatureVerificationConfig.jwks.jwksUri\"\n              />\n            </c8y-form-group>\n          </div>\n        </div>\n      </div>\n\n      <div\n        id=\"manual\"\n        *ngIf=\"\n          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.CUSTOM\n        \"\n      >\n        <fieldset\n          class=\"c8y-fieldset p-24\"\n          *ngIf=\"templateModel.signatureVerificationConfig.manual.customCertificates.length > 1\"\n        >\n          <legend>\n            {{ 'Manual' | translate }}\n          </legend>\n          <div class=\"row\">\n            <div class=\"col-md-6\">\n              <label\n                for=\"certIdField\"\n                class=\"control-label\"\n              >\n                {{ 'Certificate ID field' | translate }}\n                <button\n                  class=\"btn-help btn-help--sm\"\n                  type=\"button\"\n                  [attr.aria-label]=\"'Help' | translate\"\n                  popover=\"{{ CERTIFICATE_ID_FIELD_POPOVER | translate }}\"\n                  placement=\"right\"\n                  triggers=\"focus\"\n                ></button>\n              </label>\n              <input\n                type=\"text\"\n                class=\"form-control\"\n                name=\"certIdField\"\n                id=\"certIdField\"\n                [(ngModel)]=\"templateModel.signatureVerificationConfig.manual.certIdField\"\n                required\n              />\n            </div>\n          </div>\n        </fieldset>\n\n        <fieldset class=\"c8y-fieldset p-24\">\n          <legend>\n            {{ 'Certificates' | translate }}\n          </legend>\n          <fieldset\n            class=\"c8y-fieldset p-16\"\n            *ngFor=\"\n              let customCertificate of templateModel.signatureVerificationConfig.manual\n                .customCertificates;\n              index as crtIndex\n            \"\n          >\n            <div class=\"row\">\n              <div\n                class=\"col-sm-6\"\n                *ngIf=\"\n                  templateModel.signatureVerificationConfig.manual.customCertificates.length > 1\n                \"\n              >\n                <c8y-form-group>\n                  <label\n                    [for]=\"'customCertificateValue' + crtIndex\"\n                    class=\"control-label\"\n                    translate\n                  >\n                    Certificate ID value\n                  </label>\n                  <input\n                    [name]=\"'customCertificateValue' + crtIndex\"\n                    [id]=\"'customCertificateValue' + crtIndex\"\n                    type=\"text\"\n                    class=\"form-control\"\n                    [(ngModel)]=\"customCertificate.key\"\n                    required\n                  />\n                </c8y-form-group>\n              </div>\n              <div class=\"col-sm-6\">\n                <c8y-form-group>\n                  <label class=\"control-label\">\n                    {{ 'Type' | translate }}\n                  </label>\n                  <label\n                    title=\"{{ algorithmType.value.label | translate }}\"\n                    class=\"c8y-radio input-sm\"\n                    *ngFor=\"let algorithmType of algorithmTypes | keyvalue; index as algIndex\"\n                  >\n                    <input\n                      type=\"radio\"\n                      [name]=\"'alg' + crtIndex + algIndex\"\n                      [value]=\"algorithmType.key\"\n                      [(ngModel)]=\"customCertificate.alg\"\n                    />\n                    <span></span>\n                    <span>{{ algorithmType.value.label | translate }}</span>\n                  </label>\n                </c8y-form-group>\n              </div>\n            </div>\n\n            <div class=\"row\">\n              <div class=\"col-md-5\">\n                <c8y-form-group>\n                  <label\n                    class=\"control-label\"\n                    [for]=\"'publicKey' + crtIndex\"\n                    *ngIf=\"customCertificate.alg === algorithmTypes.PCKS.value\"\n                    translate\n                  >\n                    Certificate in PEM format\n                  </label>\n                  <label\n                    class=\"control-label\"\n                    [for]=\"'publicKey' + crtIndex\"\n                    *ngIf=\"customCertificate.alg === algorithmTypes.RSA.value\"\n                    translate\n                  >\n                    Public key in PEM format\n                  </label>\n                  <input\n                    [name]=\"'publicKey' + crtIndex\"\n                    [id]=\"'publicKey' + crtIndex\"\n                    type=\"text\"\n                    class=\"form-control\"\n                    [(ngModel)]=\"customCertificate.publicKey\"\n                    required\n                  />\n                </c8y-form-group>\n              </div>\n              <div class=\"col-md-3\">\n                <div class=\"form-group datepicker\">\n                  <c8y-form-group>\n                    <label\n                      [for]=\"'validFromPicker' + crtIndex\"\n                      class=\"control-label\"\n                    >\n                      {{ 'Valid from' | translate }}\n                    </label>\n                    <input\n                      [name]=\"'validFromPicker' + crtIndex\"\n                      [id]=\"'validFromPicker' + crtIndex\"\n                      [(ngModel)]=\"customCertificate.validFrom\"\n                      class=\"form-control\"\n                      [attr.aria-label]=\"'Date from' | translate\"\n                      placeholder=\"{{ 'Date from' | translate }}\"\n                      [bsConfig]=\"{ customTodayClass: 'today', adaptivePosition: true }\"\n                      [maxDate]=\"customCertificate.validTill\"\n                      bsDatepicker\n                      required\n                    />\n                  </c8y-form-group>\n                </div>\n              </div>\n              <div class=\"col-md-3\">\n                <div class=\"form-group datepicker\">\n                  <c8y-form-group>\n                    <label\n                      [for]=\"'validTillPicker' + crtIndex\"\n                      class=\"control-label\"\n                    >\n                      {{ 'Valid till' | translate }}\n                    </label>\n                    <input\n                      [name]=\"'validTillPicker' + crtIndex\"\n                      [id]=\"'validTillPicker' + crtIndex\"\n                      [(ngModel)]=\"customCertificate.validTill\"\n                      class=\"form-control\"\n                      placeholder=\"{{ 'Date to' | translate }}\"\n                      [attr.aria-label]=\"'Date to' | translate\"\n                      [bsConfig]=\"{ customTodayClass: 'today', adaptivePosition: true }\"\n                      bsDatepicker\n                      [minDate]=\"customCertificate.validFrom\"\n                      required\n                    />\n                  </c8y-form-group>\n                </div>\n              </div>\n              <div\n                class=\"col-md-1\"\n                *ngIf=\"\n                  templateModel.signatureVerificationConfig.manual.customCertificates.length > 1\n                \"\n              >\n                <label>&nbsp;</label>\n                <button\n                  class=\"btn btn-danger btn-sm visible-xs visible-sm\"\n                  type=\"button\"\n                  title=\"{{ 'Delete certificate' | translate }}\"\n                  (click)=\"removeCustomCertificate(customCertificate)\"\n                >\n                  <i\n                    c8yIcon=\"minus-circle\"\n                    class=\"m-r-4\"\n                  ></i>\n                  <span>{{ 'Delete certificate' | translate }}</span>\n                </button>\n\n                <button\n                  class=\"btn btn-dot btn-dot--danger visible-md visible-lg\"\n                  type=\"button\"\n                  tooltip=\"{{ 'Delete certificate' | translate }}\"\n                  placement=\"top\"\n                  [adaptivePosition]=\"false\"\n                  [attr.aria-label]=\"'Delete certificate' | translate\"\n                  [delay]=\"300\"\n                  (click)=\"removeCustomCertificate(customCertificate)\"\n                >\n                  <i c8yIcon=\"minus-circle\"></i>\n                </button>\n              </div>\n            </div>\n          </fieldset>\n          <button\n            class=\"btn btn-default m-t-8\"\n            type=\"button\"\n            title=\"{{ 'Add certificate' | translate }}\"\n            (click)=\"templateModel.signatureVerificationConfig.manual.addCustomCertificate()\"\n            name=\"addCertificate\"\n          >\n            <i\n              c8yIcon=\"plus-circle\"\n              class=\"m-r-4\"\n            ></i>\n            <span>{{ 'Add certificate' | translate }}</span>\n          </button>\n        </fieldset>\n      </div>\n    </div>\n  </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { 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.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.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { 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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: i2.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i4.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "directive", type: i5.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "directive", type: i6.BsDatepickerDirective, selector: "[bsDatepicker]", inputs: ["placement", "triggers", "outsideClick", "container", "outsideEsc", "isDisabled", "minDate", "maxDate", "minMode", "daysDisabled", "datesDisabled", "datesEnabled", "dateCustomClasses", "dateTooltipTexts", "isOpen", "bsValue", "bsConfig"], outputs: ["onShown", "onHidden", "bsValueChange"], exportAs: ["bsDatepicker"] }, { kind: "directive", type: i6.BsDatepickerInputDirective, selector: "input[bsDatepicker]" }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.KeyValuePipe, name: "keyvalue" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] }); }
}
__decorate([
    memoize(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", void 0)
], SignatureConfigurationComponent.prototype, "shouldShow", null);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: SignatureConfigurationComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-sso-signature-configuration', viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], template: "<div class=\"p-24\">\n  <div class=\"row\">\n    <div class=\"col-xs-12 col-sm-3 col-md-2\">\n      <div\n        class=\"h4 text-normal text-right text-left-xs\"\n        translate\n      >\n        Signature verification\n      </div>\n    </div>\n    <div class=\"col-xs-12 col-sm-9 col-md-10 col-lg-9\">\n      <div\n        *ngIf=\"shouldShow('certificateType')\"\n        class=\"form-group p-relative\"\n      >\n        <div class=\"row\">\n          <div class=\"col-sm-6\">\n            <label\n              for=\"certificateType\"\n              class=\"control-label\"\n              translate\n            >\n              Verifier\n            </label>\n            <div class=\"c8y-select-wrapper\">\n              <select\n                class=\"form-control\"\n                id=\"certificateType\"\n                name=\"certificateType\"\n                [(ngModel)]=\"templateModel.signatureVerificationConfig.certificateTypeChosen\"\n              >\n                <option\n                  *ngFor=\"let certificateType of certificateTypes | keyvalue\"\n                  [ngValue]=\"certificateType.key\"\n                >\n                  {{ certificateType.value.label | translate }}\n                </option>\n              </select>\n              <span></span>\n            </div>\n          </div>\n        </div>\n      </div>\n      <div\n        id=\"adfs\"\n        *ngIf=\"\n          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.ADFS\n        \"\n        class=\"row\"\n      >\n        <div class=\"col-sm-6\">\n          <c8y-form-group>\n            <label\n              for=\"adfsManifestUrl\"\n              class=\"control-label\"\n              translate\n            >\n              ADFS manifest URL\n            </label>\n            <input\n              type=\"url\"\n              class=\"form-control\"\n              required\n              [placeholder]=\"\n                'e.g. {{ example }}'\n                  | translate\n                    : {\n                        example: 'https://adfs.tenant.com/federationmetadata/federationmetadata.xml'\n                      }\n              \"\n              [(ngModel)]=\"templateModel.signatureVerificationConfig.adfsManifest.manifestUrl\"\n              name=\"adfsManifestUrl\"\n              id=\"adfsManifestUrl\"\n            />\n          </c8y-form-group>\n        </div>\n      </div>\n\n      <div\n        id=\"add\"\n        *ngIf=\"\n          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.AZURE\n        \"\n      >\n        <div class=\"row\">\n          <div class=\"col-sm-6\">\n            <c8y-form-group>\n              <label\n                for=\"publicKeyDiscoveryUrl\"\n                class=\"control-label\"\n                translate\n              >\n                Public key discovery URL\n              </label>\n              <input\n                type=\"url\"\n                id=\"publicKeyDiscoveryUrl\"\n                class=\"form-control\"\n                required\n                [placeholder]=\"\n                  'e.g. {{ example }}'\n                    | translate\n                      : { example: 'https://login.microsoftonline.de/tenant/discovery/keys' }\n                \"\n                name=\"publicKeyDiscoveryUrl\"\n                [(ngModel)]=\"templateModel.signatureVerificationConfig.aad.publicKeyDiscoveryUrl\"\n              />\n            </c8y-form-group>\n          </div>\n        </div>\n      </div>\n\n      <div\n        id=\"jwks\"\n        *ngIf=\"\n          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.JWKS\n        \"\n      >\n        <div class=\"row\">\n          <div class=\"col-sm-6\">\n            <c8y-form-group>\n              <label\n                for=\"jwksPublicKeyDiscoveryUrl\"\n                class=\"control-label\"\n                translate\n              >\n                JWKS URL\n              </label>\n              <input\n                type=\"url\"\n                class=\"form-control\"\n                id=\"jwksPublicKeyDiscoveryUrl\"\n                required\n                [placeholder]=\"\n                  'e.g. {{ example }}' | translate: { example: 'http://www.example.com/' }\n                \"\n                name=\"jwksUri\"\n                [(ngModel)]=\"templateModel.signatureVerificationConfig.jwks.jwksUri\"\n              />\n            </c8y-form-group>\n          </div>\n        </div>\n      </div>\n\n      <div\n        id=\"manual\"\n        *ngIf=\"\n          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.CUSTOM\n        \"\n      >\n        <fieldset\n          class=\"c8y-fieldset p-24\"\n          *ngIf=\"templateModel.signatureVerificationConfig.manual.customCertificates.length > 1\"\n        >\n          <legend>\n            {{ 'Manual' | translate }}\n          </legend>\n          <div class=\"row\">\n            <div class=\"col-md-6\">\n              <label\n                for=\"certIdField\"\n                class=\"control-label\"\n              >\n                {{ 'Certificate ID field' | translate }}\n                <button\n                  class=\"btn-help btn-help--sm\"\n                  type=\"button\"\n                  [attr.aria-label]=\"'Help' | translate\"\n                  popover=\"{{ CERTIFICATE_ID_FIELD_POPOVER | translate }}\"\n                  placement=\"right\"\n                  triggers=\"focus\"\n                ></button>\n              </label>\n              <input\n                type=\"text\"\n                class=\"form-control\"\n                name=\"certIdField\"\n                id=\"certIdField\"\n                [(ngModel)]=\"templateModel.signatureVerificationConfig.manual.certIdField\"\n                required\n              />\n            </div>\n          </div>\n        </fieldset>\n\n        <fieldset class=\"c8y-fieldset p-24\">\n          <legend>\n            {{ 'Certificates' | translate }}\n          </legend>\n          <fieldset\n            class=\"c8y-fieldset p-16\"\n            *ngFor=\"\n              let customCertificate of templateModel.signatureVerificationConfig.manual\n                .customCertificates;\n              index as crtIndex\n            \"\n          >\n            <div class=\"row\">\n              <div\n                class=\"col-sm-6\"\n                *ngIf=\"\n                  templateModel.signatureVerificationConfig.manual.customCertificates.length > 1\n                \"\n              >\n                <c8y-form-group>\n                  <label\n                    [for]=\"'customCertificateValue' + crtIndex\"\n                    class=\"control-label\"\n                    translate\n                  >\n                    Certificate ID value\n                  </label>\n                  <input\n                    [name]=\"'customCertificateValue' + crtIndex\"\n                    [id]=\"'customCertificateValue' + crtIndex\"\n                    type=\"text\"\n                    class=\"form-control\"\n                    [(ngModel)]=\"customCertificate.key\"\n                    required\n                  />\n                </c8y-form-group>\n              </div>\n              <div class=\"col-sm-6\">\n                <c8y-form-group>\n                  <label class=\"control-label\">\n                    {{ 'Type' | translate }}\n                  </label>\n                  <label\n                    title=\"{{ algorithmType.value.label | translate }}\"\n                    class=\"c8y-radio input-sm\"\n                    *ngFor=\"let algorithmType of algorithmTypes | keyvalue; index as algIndex\"\n                  >\n                    <input\n                      type=\"radio\"\n                      [name]=\"'alg' + crtIndex + algIndex\"\n                      [value]=\"algorithmType.key\"\n                      [(ngModel)]=\"customCertificate.alg\"\n                    />\n                    <span></span>\n                    <span>{{ algorithmType.value.label | translate }}</span>\n                  </label>\n                </c8y-form-group>\n              </div>\n            </div>\n\n            <div class=\"row\">\n              <div class=\"col-md-5\">\n                <c8y-form-group>\n                  <label\n                    class=\"control-label\"\n                    [for]=\"'publicKey' + crtIndex\"\n                    *ngIf=\"customCertificate.alg === algorithmTypes.PCKS.value\"\n                    translate\n                  >\n                    Certificate in PEM format\n                  </label>\n                  <label\n                    class=\"control-label\"\n                    [for]=\"'publicKey' + crtIndex\"\n                    *ngIf=\"customCertificate.alg === algorithmTypes.RSA.value\"\n                    translate\n                  >\n                    Public key in PEM format\n                  </label>\n                  <input\n                    [name]=\"'publicKey' + crtIndex\"\n                    [id]=\"'publicKey' + crtIndex\"\n                    type=\"text\"\n                    class=\"form-control\"\n                    [(ngModel)]=\"customCertificate.publicKey\"\n                    required\n                  />\n                </c8y-form-group>\n              </div>\n              <div class=\"col-md-3\">\n                <div class=\"form-group datepicker\">\n                  <c8y-form-group>\n                    <label\n                      [for]=\"'validFromPicker' + crtIndex\"\n                      class=\"control-label\"\n                    >\n                      {{ 'Valid from' | translate }}\n                    </label>\n                    <input\n                      [name]=\"'validFromPicker' + crtIndex\"\n                      [id]=\"'validFromPicker' + crtIndex\"\n                      [(ngModel)]=\"customCertificate.validFrom\"\n                      class=\"form-control\"\n                      [attr.aria-label]=\"'Date from' | translate\"\n                      placeholder=\"{{ 'Date from' | translate }}\"\n                      [bsConfig]=\"{ customTodayClass: 'today', adaptivePosition: true }\"\n                      [maxDate]=\"customCertificate.validTill\"\n                      bsDatepicker\n                      required\n                    />\n                  </c8y-form-group>\n                </div>\n              </div>\n              <div class=\"col-md-3\">\n                <div class=\"form-group datepicker\">\n                  <c8y-form-group>\n                    <label\n                      [for]=\"'validTillPicker' + crtIndex\"\n                      class=\"control-label\"\n                    >\n                      {{ 'Valid till' | translate }}\n                    </label>\n                    <input\n                      [name]=\"'validTillPicker' + crtIndex\"\n                      [id]=\"'validTillPicker' + crtIndex\"\n                      [(ngModel)]=\"customCertificate.validTill\"\n                      class=\"form-control\"\n                      placeholder=\"{{ 'Date to' | translate }}\"\n                      [attr.aria-label]=\"'Date to' | translate\"\n                      [bsConfig]=\"{ customTodayClass: 'today', adaptivePosition: true }\"\n                      bsDatepicker\n                      [minDate]=\"customCertificate.validFrom\"\n                      required\n                    />\n                  </c8y-form-group>\n                </div>\n              </div>\n              <div\n                class=\"col-md-1\"\n                *ngIf=\"\n                  templateModel.signatureVerificationConfig.manual.customCertificates.length > 1\n                \"\n              >\n                <label>&nbsp;</label>\n                <button\n                  class=\"btn btn-danger btn-sm visible-xs visible-sm\"\n                  type=\"button\"\n                  title=\"{{ 'Delete certificate' | translate }}\"\n                  (click)=\"removeCustomCertificate(customCertificate)\"\n                >\n                  <i\n                    c8yIcon=\"minus-circle\"\n                    class=\"m-r-4\"\n                  ></i>\n                  <span>{{ 'Delete certificate' | translate }}</span>\n                </button>\n\n                <button\n                  class=\"btn btn-dot btn-dot--danger visible-md visible-lg\"\n                  type=\"button\"\n                  tooltip=\"{{ 'Delete certificate' | translate }}\"\n                  placement=\"top\"\n                  [adaptivePosition]=\"false\"\n                  [attr.aria-label]=\"'Delete certificate' | translate\"\n                  [delay]=\"300\"\n                  (click)=\"removeCustomCertificate(customCertificate)\"\n                >\n                  <i c8yIcon=\"minus-circle\"></i>\n                </button>\n              </div>\n            </div>\n          </fieldset>\n          <button\n            class=\"btn btn-default m-t-8\"\n            type=\"button\"\n            title=\"{{ 'Add certificate' | translate }}\"\n            (click)=\"templateModel.signatureVerificationConfig.manual.addCustomCertificate()\"\n            name=\"addCertificate\"\n          >\n            <i\n              c8yIcon=\"plus-circle\"\n              class=\"m-r-4\"\n            ></i>\n            <span>{{ 'Add certificate' | translate }}</span>\n          </button>\n        </fieldset>\n      </div>\n    </div>\n  </div>\n</div>\n" }]
        }], ctorParameters: () => [{ type: i1.ControlContainer }], propDecorators: { templateModel: [{
                type: Input
            }], shouldShow: [] } });
//# sourceMappingURL=data:application/json;base64, 