import { Component } from '@angular/core';
import { AppStateService } from '../../common';
import { HeaderService } from '../../header/header.service';
import * as i0 from "@angular/core";
import * as i1 from "../../common";
import * as i2 from "../../header/header.service";
import * as i3 from "@angular/common";
import * as i4 from "../../i18n/c8y-translate.pipe";
import * as i5 from "../../common/shorten-user-name.pipe";
import * as i6 from "../../common/user-name-initials.pipe";
import * as i7 from "./user-roles-list.pipe";
export class UserDetailsDrawerComponent {
    constructor(appState, headerService) {
        this.appState = appState;
        this.headerService = headerService;
    }
    close() {
        this.headerService.closeRightDrawer();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: UserDetailsDrawerComponent, deps: [{ token: i1.AppStateService }, { token: i2.HeaderService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: UserDetailsDrawerComponent, selector: "c8y-user-details-drawer", host: { classAttribute: "d-contents" }, ngImport: i0, template: "<div class=\"c8y-right-drawer__header separator-bottom\">\n  <button type=\"button\" class=\"close\" [attr.tabindex]=\"(headerService.rightDrawerOpen$ | async) ? '0' : '-1'\" title=\"{{ 'Close' | translate }}\" (click)=\"close()\">\n    &times;\n  </button>\n  <div class=\"d-flex a-i-center\">\n    <div class=\"user-dot\">{{ appState.currentUser | async | userNameInitials }}</div>\n    <div class=\"min-width-0\">\n      <p\n        *ngIf=\"appState.currentUser | async as currentUser\"\n        class=\"text-truncate text-medium text-16\"\n        title=\"{{ currentUser | shortenUserName }}\"\n      >\n        {{ currentUser | shortenUserName }}\n      </p>\n      <small\n        *ngIf=\"appState.currentUser | async | userRolesList as userRoles\"\n        [title]=\"userRoles\"\n        class=\"text-truncate\"\n      >\n        {{ userRoles }}\n      </small>\n    </div>\n  </div>\n</div>\n", dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.ShortenUserNamePipe, name: "shortenUserName" }, { kind: "pipe", type: i6.UserNameInitialsPipe, name: "userNameInitials" }, { kind: "pipe", type: i7.UserRolesListPipe, name: "userRolesList" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: UserDetailsDrawerComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-user-details-drawer', host: { class: 'd-contents' }, template: "<div class=\"c8y-right-drawer__header separator-bottom\">\n  <button type=\"button\" class=\"close\" [attr.tabindex]=\"(headerService.rightDrawerOpen$ | async) ? '0' : '-1'\" title=\"{{ 'Close' | translate }}\" (click)=\"close()\">\n    &times;\n  </button>\n  <div class=\"d-flex a-i-center\">\n    <div class=\"user-dot\">{{ appState.currentUser | async | userNameInitials }}</div>\n    <div class=\"min-width-0\">\n      <p\n        *ngIf=\"appState.currentUser | async as currentUser\"\n        class=\"text-truncate text-medium text-16\"\n        title=\"{{ currentUser | shortenUserName }}\"\n      >\n        {{ currentUser | shortenUserName }}\n      </p>\n      <small\n        *ngIf=\"appState.currentUser | async | userRolesList as userRoles\"\n        [title]=\"userRoles\"\n        class=\"text-truncate\"\n      >\n        {{ userRoles }}\n      </small>\n    </div>\n  </div>\n</div>\n" }]
        }], ctorParameters: () => [{ type: i1.AppStateService }, { type: i2.HeaderService }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci1kZXRhaWxzLWRyYXdlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9jb3JlL3VzZXIvdXNlci1kZXRhaWxzLWRyYXdlci91c2VyLWRldGFpbHMtZHJhd2VyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL2NvcmUvdXNlci91c2VyLWRldGFpbHMtZHJhd2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