import * as i4 from '@angular/common';
import { NgForOf, NgClass } from '@angular/common';
import * as i0 from '@angular/core';
import { Component } from '@angular/core';
import * as i1 from '@angular/forms';
import { Validators } from '@angular/forms';
import * as i3 from '@c8y/ngx-components';
import { CoreModule } from '@c8y/ngx-components';
import { gettext } from '@c8y/ngx-components/gettext';
import * as i2 from '@c8y/ngx-components/remote-access/data';
import { CREDENTIALS_TYPES } from '@c8y/ngx-components/remote-access/data';
import { SshKeyInputComponent } from '@c8y/ngx-components/remote-access/shared';
import * as i5 from 'ngx-bootstrap/popover';
import { PopoverModule } from 'ngx-bootstrap/popover';
import { saveAs } from 'file-saver';

class RemoteAccessSshEndpointModalComponent {
    constructor(formBuilder, remoteAccess) {
        this.formBuilder = formBuilder;
        this.remoteAccess = remoteAccess;
        this.credentialTypes = [
            CREDENTIALS_TYPES.USER_PASS,
            CREDENTIALS_TYPES.CERTIFICATE,
            CREDENTIALS_TYPES.KEY_PAIR
        ];
        this.title = gettext('Remote access endpoint');
        this.generating = false;
        this.result = new Promise((resolve, reject) => {
            this._resolve = resolve;
            this._reject = reject;
        });
        this.form = this.initForm();
    }
    ngOnInit() {
        if (this.currentValue) {
            const { credentials, ...rest } = this.currentValue;
            const credentialsType = credentials?.type || CREDENTIALS_TYPES.USER_PASS.value;
            const attributesToAdd = { credentialsType };
            if (credentials) {
                const { username, password, publicKey, privateKey, certificate, hostKey } = credentials;
                Object.assign(attributesToAdd, {
                    username,
                    password,
                    publicKey,
                    privateKey,
                    certificate,
                    hostKey
                });
            }
            const patchedValue = { ...rest, ...attributesToAdd };
            this.form.patchValue(patchedValue);
        }
    }
    initForm() {
        return this.formBuilder.group({
            id: ['', []],
            name: ['', [Validators.required, Validators.minLength(1)]],
            hostname: ['127.0.0.1', [Validators.required, Validators.minLength(1)]],
            port: [22, [Validators.required, Validators.min(1), Validators.max(65535)]],
            protocol: ['SSH', [Validators.required, Validators.minLength(1)]],
            username: [undefined, [Validators.required, Validators.minLength(1)]],
            password: [undefined, []],
            credentialsType: [
                CREDENTIALS_TYPES.USER_PASS.value,
                [Validators.required]
            ],
            hostKey: [undefined, []],
            publicKey: [undefined, []],
            privateKey: [undefined, []],
            certificate: [undefined, []]
        });
    }
    downloadPublicKey() {
        const publicKey = this.form.value.publicKey;
        const blob = new Blob([publicKey], { type: 'text/plain' });
        saveAs(blob, `key.pub`);
    }
    async generateKeys() {
        this.generating = true;
        try {
            const pair = await this.remoteAccess.generateKeyPair(this.form.value.hostname || undefined);
            this.form.patchValue({
                publicKey: pair.publicKey,
                privateKey: pair.privateKey
            });
        }
        catch (e) {
            console.log(e);
        }
        this.generating = false;
    }
    cancel() {
        this._reject();
    }
    save() {
        this._resolve(this.form.value);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RemoteAccessSshEndpointModalComponent, deps: [{ token: i1.FormBuilder }, { token: i2.RemoteAccessService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: RemoteAccessSshEndpointModalComponent, isStandalone: true, selector: "c8y-remote-access-ssh-endpoint-modal", ngImport: i0, template: "<ng-template #keyPairPopoverContent>\n  <small translate>Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA, ECDSA, ED25519.</small>\n</ng-template>\n\n<ng-template #certificatePopoverContent>\n  <small translate>Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA.</small>\n</ng-template>\n\n<c8y-modal\n  [title]=\"title\"\n  [headerClasses]=\"'dialog-header'\"\n  (onDismiss)=\"cancel()\"\n  (onClose)=\"save()\"\n  [disabled]=\"form.invalid\"\n  [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n  <ng-container c8y-modal-title>\n    <span [c8yIcon]=\"'laptop'\"></span>\n  </ng-container>\n  <div\n    class=\"p-24\"\n    [formGroup]=\"form\"\n  >\n    <c8y-form-group>\n      <label\n        for=\"name\"\n        translate\n      >\n        Name\n      </label>\n      <input\n        class=\"form-control\"\n        id=\"name\"\n        name=\"name\"\n        type=\"text\"\n        [placeholder]=\"'e.g. {{ example }}' | translate: { example: 'My remote access endpoint' }\"\n        formControlName=\"name\"\n        [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n      />\n      <c8y-messages></c8y-messages>\n    </c8y-form-group>\n\n    <c8y-form-group>\n      <label\n        for=\"protocol\"\n        translate\n      >\n        Protocol\n      </label>\n      <input\n        class=\"form-control\"\n        id=\"protocol\"\n        name=\"protocol\"\n        type=\"text\"\n        readonly\n        formControlName=\"protocol\"\n      />\n      <c8y-messages></c8y-messages>\n    </c8y-form-group>\n\n    <c8y-form-group>\n      <label\n        for=\"hostname\"\n        translate\n      >\n        Host\n      </label>\n      <input\n        class=\"form-control\"\n        id=\"hostname\"\n        placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n        name=\"hostname\"\n        type=\"text\"\n        formControlName=\"hostname\"\n        [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n      />\n      <c8y-messages></c8y-messages>\n    </c8y-form-group>\n\n    <c8y-form-group>\n      <label\n        for=\"port\"\n        translate\n      >\n        Port\n      </label>\n      <input\n        class=\"form-control\"\n        id=\"port\"\n        placeholder=\"{{'e.g. {{ example }}' | translate : { example: '22' } }}\"\n        name=\"port\"\n        type=\"number\"\n        formControlName=\"port\"\n        [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n      />\n      <c8y-messages></c8y-messages>\n    </c8y-form-group>\n\n    <div>\n      <c8y-form-group>\n        <label\n          for=\"credentialsType\"\n          translate\n        >\n          Sign-in method\n        </label>\n        <div class=\"c8y-select-wrapper\">\n          <select\n            class=\"form-control\"\n            id=\"credentialsType\"\n            formControlName=\"credentialsType\"\n            [attr.data-cy]=\"'remoteAccessEndpointModal--credentials-type'\"\n          >\n            <option\n              *ngFor=\"let type of credentialTypes\"\n              [value]=\"type.value\"\n            >\n              {{ type.label | translate }}\n            </option>\n          </select>\n        </div>\n      </c8y-form-group>\n\n      <div\n        class=\"tight-grid\"\n      >\n        <div class=\"col-md-6\">\n          <c8y-form-group>\n            <label\n              for=\"username\"\n              translate\n            >\n              Username\n            </label>\n            <input\n              class=\"form-control\"\n              id=\"username\"\n              placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_username' } }}\"\n              name=\"username\"\n              type=\"username\"\n              autocomplete=\"off\"\n              formControlName=\"username\"\n            />\n            <c8y-messages></c8y-messages>\n          </c8y-form-group>\n        </div>\n        <div class=\"col-md-6\" *ngIf=\"form.value.credentialsType === 'USER_PASS'\">\n          <c8y-form-group>\n            <label\n              for=\"password\"\n              translate\n            >\n              Password\n            </label>\n            <input\n              class=\"form-control\"\n              id=\"password\"\n              placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_password' } }}\"\n              name=\"password\"\n              type=\"password\"\n              autocomplete=\"off\"\n              formControlName=\"password\"\n            />\n            <c8y-messages></c8y-messages>\n          </c8y-form-group>\n        </div>\n      </div>\n\n      <div *ngIf=\"form.value.credentialsType === 'KEY_PAIR'\">\n        <div class=\"form-group\" ng-if=\"!vm.keyPairAvailable() || vm.changingKeyPair\">\n          <button\n            class=\"btn btn-default p-l-16\"\n            type=\"button\"\n            [title]=\"'Generate public and private keys' | translate\"\n            [ngClass]=\"{ 'btn-pending': generating }\"\n            ng-disabled=\"vm.generating\"\n            (click)=\"generateKeys()\"\n            [attr.data-cy]=\"'remoteAccessEndpointModal--generate-keys'\"\n          >\n            <i [c8yIcon]=\"'key'\"></i>\n            {{ 'Generate public and private keys' | translate }}\n          </button>\n        </div>\n\n        <c8y-form-group>\n          <label for=\"privateKey\">\n            {{ 'Private key' | translate }}\n            <button\n              class=\"btn-help btn-help--sm\"\n              type=\"button\"\n              [attr.aria-label]=\"'Help' | translate\"\n              [popover]=\"keyPairPopoverContent\"\n              [container]=\"'body'\"\n              [placement]=\"'right'\"\n              [triggers]=\"'focus'\"\n            ></button>\n          </label>\n          <div>\n            <c8y-ssh-key-input\n              id=\"privateKey\"\n              formControlName=\"privateKey\"\n              [keyType]=\"'private'\"\n            ></c8y-ssh-key-input>\n          </div>\n        </c8y-form-group>\n\n        <c8y-form-group>\n          <label for=\"publicKey\">\n            {{ 'Public key' | translate }}\n            <button\n              class=\"btn-help btn-help--sm\"\n              type=\"button\"\n              [attr.aria-label]=\"'Help' | translate\"\n              [popover]=\"keyPairPopoverContent\"\n              [container]=\"'body'\"\n              [placement]=\"'right'\"\n              [triggers]=\"'focus'\"\n            ></button>\n            <button\n              class=\"m-l-16 btn-link interact\"\n              type=\"button\"\n              [title]=\"'Download key' | translate\"\n              (click)=\"downloadPublicKey()\"\n              *ngIf=\"form.value.publicKey\"\n            >\n              <i [c8yIcon]=\"'download'\"></i>\n              {{ 'Download key' | translate }}\n            </button>\n          </label>\n          <div>\n            <c8y-ssh-key-input\n              id=\"publicKey\"\n              formControlName=\"publicKey\"\n              [keyType]=\"'public'\"\n            ></c8y-ssh-key-input>\n          </div>\n        </c8y-form-group>\n\n      </div>\n\n      <div *ngIf=\"form.value.credentialsType === 'CERTIFICATE'\">\n        <c8y-form-group>\n          <label for=\"privateKey\">\n            {{ 'Private key' | translate }}\n            <button\n              class=\"btn-help btn-help--sm\"\n              type=\"button\"\n              [attr.aria-label]=\"'Help' | translate\"\n              [popover]=\"certificatePopoverContent\"\n              [container]=\"'body'\"\n              [placement]=\"'right'\"\n              [triggers]=\"'focus'\"\n            ></button>\n          </label>\n          <div>\n            <c8y-ssh-key-input\n              id=\"privateKey\"\n              formControlName=\"privateKey\"\n              [keyType]=\"'private'\"\n            ></c8y-ssh-key-input>\n          </div>\n        </c8y-form-group>\n\n        <c8y-form-group>\n          <label for=\"certificate\">\n            {{ 'Certificate' | translate }}\n            <button\n              class=\"btn-help btn-help--sm\"\n              type=\"button\"\n              [attr.aria-label]=\"'Help' | translate\"\n              [popover]=\"certificatePopoverContent\"\n              [container]=\"'body'\"\n              [placement]=\"'right'\"\n              [triggers]=\"'focus'\"\n            ></button>\n          </label>\n          <div>\n            <c8y-ssh-key-input\n              id=\"certificate\"\n              formControlName=\"certificate\"\n              [keyType]=\"'certificate'\"\n            ></c8y-ssh-key-input>\n          </div>\n        </c8y-form-group>\n\n      </div>\n\n      <div>\n        <c8y-form-group>\n          <label\n            for=\"hostKey\"\n          >\n            {{ 'Host key' | translate }}\n            <button\n              class=\"btn-help btn-help--sm\"\n              type=\"button\"\n              [attr.aria-label]=\"'Help' | translate\"\n              [popover]=\"keyPairPopoverContent\"\n              [container]=\"'body'\"\n              [placement]=\"'right'\"\n              [triggers]=\"'focus'\"\n            ></button>\n          </label>\n          <div>\n            <c8y-ssh-key-input\n              id=\"hostKey\"\n              formControlName=\"hostKey\"\n              [keyType]=\"'public'\"\n            ></c8y-ssh-key-input>\n          </div>\n          <c8y-messages></c8y-messages>\n        </c8y-form-group>\n      </div>\n    </div>\n  </div>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i3.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i3.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { 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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][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: "component", type: i3.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i3.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: i3.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { 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: "component", type: SshKeyInputComponent, selector: "c8y-ssh-key-input", inputs: ["keyType"] }, { kind: "ngmodule", type: PopoverModule }, { 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: "pipe", type: i3.C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RemoteAccessSshEndpointModalComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-remote-access-ssh-endpoint-modal', standalone: true, imports: [CoreModule, NgForOf, NgClass, SshKeyInputComponent, PopoverModule], template: "<ng-template #keyPairPopoverContent>\n  <small translate>Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA, ECDSA, ED25519.</small>\n</ng-template>\n\n<ng-template #certificatePopoverContent>\n  <small translate>Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA.</small>\n</ng-template>\n\n<c8y-modal\n  [title]=\"title\"\n  [headerClasses]=\"'dialog-header'\"\n  (onDismiss)=\"cancel()\"\n  (onClose)=\"save()\"\n  [disabled]=\"form.invalid\"\n  [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n  <ng-container c8y-modal-title>\n    <span [c8yIcon]=\"'laptop'\"></span>\n  </ng-container>\n  <div\n    class=\"p-24\"\n    [formGroup]=\"form\"\n  >\n    <c8y-form-group>\n      <label\n        for=\"name\"\n        translate\n      >\n        Name\n      </label>\n      <input\n        class=\"form-control\"\n        id=\"name\"\n        name=\"name\"\n        type=\"text\"\n        [placeholder]=\"'e.g. {{ example }}' | translate: { example: 'My remote access endpoint' }\"\n        formControlName=\"name\"\n        [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n      />\n      <c8y-messages></c8y-messages>\n    </c8y-form-group>\n\n    <c8y-form-group>\n      <label\n        for=\"protocol\"\n        translate\n      >\n        Protocol\n      </label>\n      <input\n        class=\"form-control\"\n        id=\"protocol\"\n        name=\"protocol\"\n        type=\"text\"\n        readonly\n        formControlName=\"protocol\"\n      />\n      <c8y-messages></c8y-messages>\n    </c8y-form-group>\n\n    <c8y-form-group>\n      <label\n        for=\"hostname\"\n        translate\n      >\n        Host\n      </label>\n      <input\n        class=\"form-control\"\n        id=\"hostname\"\n        placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n        name=\"hostname\"\n        type=\"text\"\n        formControlName=\"hostname\"\n        [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n      />\n      <c8y-messages></c8y-messages>\n    </c8y-form-group>\n\n    <c8y-form-group>\n      <label\n        for=\"port\"\n        translate\n      >\n        Port\n      </label>\n      <input\n        class=\"form-control\"\n        id=\"port\"\n        placeholder=\"{{'e.g. {{ example }}' | translate : { example: '22' } }}\"\n        name=\"port\"\n        type=\"number\"\n        formControlName=\"port\"\n        [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n      />\n      <c8y-messages></c8y-messages>\n    </c8y-form-group>\n\n    <div>\n      <c8y-form-group>\n        <label\n          for=\"credentialsType\"\n          translate\n        >\n          Sign-in method\n        </label>\n        <div class=\"c8y-select-wrapper\">\n          <select\n            class=\"form-control\"\n            id=\"credentialsType\"\n            formControlName=\"credentialsType\"\n            [attr.data-cy]=\"'remoteAccessEndpointModal--credentials-type'\"\n          >\n            <option\n              *ngFor=\"let type of credentialTypes\"\n              [value]=\"type.value\"\n            >\n              {{ type.label | translate }}\n            </option>\n          </select>\n        </div>\n      </c8y-form-group>\n\n      <div\n        class=\"tight-grid\"\n      >\n        <div class=\"col-md-6\">\n          <c8y-form-group>\n            <label\n              for=\"username\"\n              translate\n            >\n              Username\n            </label>\n            <input\n              class=\"form-control\"\n              id=\"username\"\n              placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_username' } }}\"\n              name=\"username\"\n              type=\"username\"\n              autocomplete=\"off\"\n              formControlName=\"username\"\n            />\n            <c8y-messages></c8y-messages>\n          </c8y-form-group>\n        </div>\n        <div class=\"col-md-6\" *ngIf=\"form.value.credentialsType === 'USER_PASS'\">\n          <c8y-form-group>\n            <label\n              for=\"password\"\n              translate\n            >\n              Password\n            </label>\n            <input\n              class=\"form-control\"\n              id=\"password\"\n              placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_password' } }}\"\n              name=\"password\"\n              type=\"password\"\n              autocomplete=\"off\"\n              formControlName=\"password\"\n            />\n            <c8y-messages></c8y-messages>\n          </c8y-form-group>\n        </div>\n      </div>\n\n      <div *ngIf=\"form.value.credentialsType === 'KEY_PAIR'\">\n        <div class=\"form-group\" ng-if=\"!vm.keyPairAvailable() || vm.changingKeyPair\">\n          <button\n            class=\"btn btn-default p-l-16\"\n            type=\"button\"\n            [title]=\"'Generate public and private keys' | translate\"\n            [ngClass]=\"{ 'btn-pending': generating }\"\n            ng-disabled=\"vm.generating\"\n            (click)=\"generateKeys()\"\n            [attr.data-cy]=\"'remoteAccessEndpointModal--generate-keys'\"\n          >\n            <i [c8yIcon]=\"'key'\"></i>\n            {{ 'Generate public and private keys' | translate }}\n          </button>\n        </div>\n\n        <c8y-form-group>\n          <label for=\"privateKey\">\n            {{ 'Private key' | translate }}\n            <button\n              class=\"btn-help btn-help--sm\"\n              type=\"button\"\n              [attr.aria-label]=\"'Help' | translate\"\n              [popover]=\"keyPairPopoverContent\"\n              [container]=\"'body'\"\n              [placement]=\"'right'\"\n              [triggers]=\"'focus'\"\n            ></button>\n          </label>\n          <div>\n            <c8y-ssh-key-input\n              id=\"privateKey\"\n              formControlName=\"privateKey\"\n              [keyType]=\"'private'\"\n            ></c8y-ssh-key-input>\n          </div>\n        </c8y-form-group>\n\n        <c8y-form-group>\n          <label for=\"publicKey\">\n            {{ 'Public key' | translate }}\n            <button\n              class=\"btn-help btn-help--sm\"\n              type=\"button\"\n              [attr.aria-label]=\"'Help' | translate\"\n              [popover]=\"keyPairPopoverContent\"\n              [container]=\"'body'\"\n              [placement]=\"'right'\"\n              [triggers]=\"'focus'\"\n            ></button>\n            <button\n              class=\"m-l-16 btn-link interact\"\n              type=\"button\"\n              [title]=\"'Download key' | translate\"\n              (click)=\"downloadPublicKey()\"\n              *ngIf=\"form.value.publicKey\"\n            >\n              <i [c8yIcon]=\"'download'\"></i>\n              {{ 'Download key' | translate }}\n            </button>\n          </label>\n          <div>\n            <c8y-ssh-key-input\n              id=\"publicKey\"\n              formControlName=\"publicKey\"\n              [keyType]=\"'public'\"\n            ></c8y-ssh-key-input>\n          </div>\n        </c8y-form-group>\n\n      </div>\n\n      <div *ngIf=\"form.value.credentialsType === 'CERTIFICATE'\">\n        <c8y-form-group>\n          <label for=\"privateKey\">\n            {{ 'Private key' | translate }}\n            <button\n              class=\"btn-help btn-help--sm\"\n              type=\"button\"\n              [attr.aria-label]=\"'Help' | translate\"\n              [popover]=\"certificatePopoverContent\"\n              [container]=\"'body'\"\n              [placement]=\"'right'\"\n              [triggers]=\"'focus'\"\n            ></button>\n          </label>\n          <div>\n            <c8y-ssh-key-input\n              id=\"privateKey\"\n              formControlName=\"privateKey\"\n              [keyType]=\"'private'\"\n            ></c8y-ssh-key-input>\n          </div>\n        </c8y-form-group>\n\n        <c8y-form-group>\n          <label for=\"certificate\">\n            {{ 'Certificate' | translate }}\n            <button\n              class=\"btn-help btn-help--sm\"\n              type=\"button\"\n              [attr.aria-label]=\"'Help' | translate\"\n              [popover]=\"certificatePopoverContent\"\n              [container]=\"'body'\"\n              [placement]=\"'right'\"\n              [triggers]=\"'focus'\"\n            ></button>\n          </label>\n          <div>\n            <c8y-ssh-key-input\n              id=\"certificate\"\n              formControlName=\"certificate\"\n              [keyType]=\"'certificate'\"\n            ></c8y-ssh-key-input>\n          </div>\n        </c8y-form-group>\n\n      </div>\n\n      <div>\n        <c8y-form-group>\n          <label\n            for=\"hostKey\"\n          >\n            {{ 'Host key' | translate }}\n            <button\n              class=\"btn-help btn-help--sm\"\n              type=\"button\"\n              [attr.aria-label]=\"'Help' | translate\"\n              [popover]=\"keyPairPopoverContent\"\n              [container]=\"'body'\"\n              [placement]=\"'right'\"\n              [triggers]=\"'focus'\"\n            ></button>\n          </label>\n          <div>\n            <c8y-ssh-key-input\n              id=\"hostKey\"\n              formControlName=\"hostKey\"\n              [keyType]=\"'public'\"\n            ></c8y-ssh-key-input>\n          </div>\n          <c8y-messages></c8y-messages>\n        </c8y-form-group>\n      </div>\n    </div>\n  </div>\n</c8y-modal>\n" }]
        }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: i2.RemoteAccessService }] });

/**
 * Generated bundle index. Do not edit.
 */

export { RemoteAccessSshEndpointModalComponent };
//# sourceMappingURL=c8y-ngx-components-remote-access-ssh-remote-access-ssh-endpoint-modal.mjs.map
