import { Component, EventEmitter } from '@angular/core';
import { BsModalRef } from 'ngx-bootstrap/modal';
import { gettext } from '@c8y/ngx-components';
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/forms";
import * as i4 from "@c8y/ngx-components/assets-navigator";
export class InventoryRolesModalComponent {
    constructor(modal) {
        this.modal = modal;
        this.resultEmitter = new EventEmitter();
        this.label = gettext('Groups');
    }
    dismiss() {
        this.modal.hide();
    }
    select() {
        this.resultEmitter.emit(this.selectedGroups);
        this.modal.hide();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InventoryRolesModalComponent, deps: [{ token: i1.BsModalRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: InventoryRolesModalComponent, selector: "c8y-sso-inventory-roles-modal", ngImport: i0, template: "<div class=\"viewport-modal\">\n  <div class=\"modal-header dialog-header\">\n    <i c8yIcon=\"c8y-group-open\"></i>\n    <h4 id=\"modal-title\">{{ 'Select from inventory' | translate }}</h4>\n  </div>\n  <div class=\"modal-inner-scroll\">\n    <div\n      id=\"modal-body\"\n      class=\"bg-component\"\n    >\n      <c8y-asset-selector\n        class=\"d-contents\"\n        [(ngModel)]=\"selectedGroups\"\n        [config]=\"{\n          label: label,\n          showFilter: true,\n          multi: true,\n          groupsSelectable: true,\n          columnHeaders: false,\n          singleColumn: true,\n          groupsOnly: true\n        }\"\n      ></c8y-asset-selector>\n    </div>\n  </div>\n\n  <div class=\"modal-footer\">\n    <button\n      class=\"btn btn-default\"\n      type=\"button\"\n      title=\"{{ 'Cancel' | translate }}\"\n      (click)=\"dismiss()\"\n    >\n      {{ 'Cancel' | translate }}\n    </button>\n    <button\n      class=\"btn btn-primary\"\n      type=\"button\"\n      title=\"{{ 'Select' | translate }}\"\n      (click)=\"select()\"\n    >\n      {{ 'Select' | translate }}\n    </button>\n  </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.AssetSelectorComponent, selector: "c8y-asset-selector", inputs: ["config", "active", "index", "asset", "selectedDevice", "selected", "rootNode", "selectedItems", "container", "isNodeSelectable", "disabled"], outputs: ["onSelected", "onClearSelected", "onRowSelected", "onLoad"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InventoryRolesModalComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-sso-inventory-roles-modal', template: "<div class=\"viewport-modal\">\n  <div class=\"modal-header dialog-header\">\n    <i c8yIcon=\"c8y-group-open\"></i>\n    <h4 id=\"modal-title\">{{ 'Select from inventory' | translate }}</h4>\n  </div>\n  <div class=\"modal-inner-scroll\">\n    <div\n      id=\"modal-body\"\n      class=\"bg-component\"\n    >\n      <c8y-asset-selector\n        class=\"d-contents\"\n        [(ngModel)]=\"selectedGroups\"\n        [config]=\"{\n          label: label,\n          showFilter: true,\n          multi: true,\n          groupsSelectable: true,\n          columnHeaders: false,\n          singleColumn: true,\n          groupsOnly: true\n        }\"\n      ></c8y-asset-selector>\n    </div>\n  </div>\n\n  <div class=\"modal-footer\">\n    <button\n      class=\"btn btn-default\"\n      type=\"button\"\n      title=\"{{ 'Cancel' | translate }}\"\n      (click)=\"dismiss()\"\n    >\n      {{ 'Cancel' | translate }}\n    </button>\n    <button\n      class=\"btn btn-primary\"\n      type=\"button\"\n      title=\"{{ 'Select' | translate }}\"\n      (click)=\"select()\"\n    >\n      {{ 'Select' | translate }}\n    </button>\n  </div>\n</div>\n" }]
        }], ctorParameters: () => [{ type: i1.BsModalRef }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW52ZW50b3J5LXJvbGVzLW1vZGFsLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2F1dGgtY29uZmlndXJhdGlvbi9zc28tY29uZmlndXJhdGlvbi90ZW1wbGF0ZS1wYXJ0cy9hY2Nlc3MtbWFwcGluZy9pbnZlbnRvcnktcm9sZXMtbW9kYWwuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vYXV0aC1jb25maWd1cmF0aW9uL3Nzby1jb25maWd1cmF0aW9uL3RlbXBsYXRlLXBhcnRzL2FjY2Vzcy1tYXBwaW5nL2ludmVudG9yeS1yb2xlcy1tb2RhbC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN4RCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFFakQsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLHFCQUFxQixDQUFDOzs7Ozs7QUFNOUMsTUFBTSxPQUFPLDRCQUE0QjtJQU92QyxZQUFtQixLQUFpQjtRQUFqQixVQUFLLEdBQUwsS0FBSyxDQUFZO1FBSnBDLGtCQUFhLEdBQWdDLElBQUksWUFBWSxFQUFpQixDQUFDO1FBRS9FLFVBQUssR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7SUFFYSxDQUFDO0lBRXhDLE9BQU87UUFDTCxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksRUFBRSxDQUFDO0lBQ3BCLENBQUM7SUFFRCxNQUF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