import { Component } from '@angular/core';
import { CoreModule, gettext } from '@c8y/ngx-components';
import { BsModalRef } from 'ngx-bootstrap/modal';
import * as i0 from "@angular/core";
import * as i1 from "ngx-bootstrap/modal";
import * as i2 from "@c8y/ngx-components";
import * as i3 from "@angular/common";
export class RemoteAccessPickProtocolModalComponent {
    constructor(bsModalRef) {
        this.bsModalRef = bsModalRef;
        this.title = gettext('Select a protocol');
        this.result = new Promise((resolve, reject) => {
            this._resolve = resolve;
            this._reject = reject;
        });
        // set via initialState
        this.protocolProviders = [];
    }
    cancel() {
        this._reject();
    }
    selectProtocol(protocol) {
        this.bsModalRef.hide();
        this._resolve(protocol);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoteAccessPickProtocolModalComponent, deps: [{ token: i1.BsModalRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: RemoteAccessPickProtocolModalComponent, isStandalone: true, selector: "c8y-remote-access-pick-protocol-modal", ngImport: i0, template: "<c8y-modal\n  [title]=\"title\"\n  [headerClasses]=\"'dialog-header'\"\n  (onDismiss)=\"cancel()\"\n  [labels]=\"{ cancel: 'Cancel' }\"\n>\n  <ng-container c8y-modal-title>\n    <span [c8yIcon]=\"'laptop'\"></span>\n  </ng-container>\n  <div class=\"p-24\">\n    <c8y-li *ngFor=\"let provider of protocolProviders\">\n      <c8y-li-icon>\n        <i [c8yIcon]=\"provider.protocolIcon\"></i>\n      </c8y-li-icon>\n      <c8y-li-body>\n        <div class=\"d-flex j-c-between\">\n          <div>\n            <p>{{ provider.protocolLabel | translate }}</p>\n            <p>\n              <small>{{ provider.protocolDescription | translate }}</small>\n            </p>\n          </div>\n          <div>\n            <button\n              class=\"btn btn-primary\"\n              (click)=\"selectProtocol(provider)\"\n              [attr.data-cy]=\"'remoteAccessPickProtocolModal--select-' + provider.protocolName\"\n            >\n              <span translate>Select</span>\n            </button>\n          </div>\n        </div>\n      </c8y-li-body>\n    </c8y-li>\n  </div>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "component", type: i2.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i2.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: i2.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoteAccessPickProtocolModalComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-remote-access-pick-protocol-modal', standalone: true, imports: [CoreModule], template: "<c8y-modal\n  [title]=\"title\"\n  [headerClasses]=\"'dialog-header'\"\n  (onDismiss)=\"cancel()\"\n  [labels]=\"{ cancel: 'Cancel' }\"\n>\n  <ng-container c8y-modal-title>\n    <span [c8yIcon]=\"'laptop'\"></span>\n  </ng-container>\n  <div class=\"p-24\">\n    <c8y-li *ngFor=\"let provider of protocolProviders\">\n      <c8y-li-icon>\n        <i [c8yIcon]=\"provider.protocolIcon\"></i>\n      </c8y-li-icon>\n      <c8y-li-body>\n        <div class=\"d-flex j-c-between\">\n          <div>\n            <p>{{ provider.protocolLabel | translate }}</p>\n            <p>\n              <small>{{ provider.protocolDescription | translate }}</small>\n            </p>\n          </div>\n          <div>\n            <button\n              class=\"btn btn-primary\"\n              (click)=\"selectProtocol(provider)\"\n              [attr.data-cy]=\"'remoteAccessPickProtocolModal--select-' + provider.protocolName\"\n            >\n              <span translate>Select</span>\n            </button>\n          </div>\n        </div>\n      </c8y-li-body>\n    </c8y-li>\n  </div>\n</c8y-modal>\n" }]
        }], ctorParameters: () => [{ type: i1.BsModalRef }] });
//# sourceMappingURL=data:application/json;base64, 