import { __decorate, __metadata, __param } from "tslib";
import { Component, Inject } from '@angular/core';
import { SettingsService } from '@delon/theme';
import { IdentityService } from '../../../../../service/identity.service';
import { KENGIC_TOKEN_DISPLAY_CHANGE_PASSWORD_OPTION } from '../../../../../const/injection-token.const';
let KengicLayoutDefaultHeaderUserComponent = class KengicLayoutDefaultHeaderUserComponent {
    constructor(settingsService, identityService, displayChangePasswordOption) {
        this.settingsService = settingsService;
        this.identityService = identityService;
        this.displayChangePasswordOption = displayChangePasswordOption;
        this.headerUserChangePasswordComponentProp = {
            visible: false,
        };
    }
    logout() {
        this.identityService.logout();
    }
    openChangePasswordComponent() {
        this.headerUserChangePasswordComponentProp.visible = true;
    }
};
KengicLayoutDefaultHeaderUserComponent.ctorParameters = () => [
    { type: SettingsService },
    { type: IdentityService },
    { type: Boolean, decorators: [{ type: Inject, args: [KENGIC_TOKEN_DISPLAY_CHANGE_PASSWORD_OPTION,] }] }
];
KengicLayoutDefaultHeaderUserComponent = __decorate([
    Component({
        selector: 'kengic-layout-default-header-user',
        template: "<div [nzDropdownMenu]=\"menuTpl\" class=\"alain-default__nav-item d-flex align-items-center px-sm\" nz-dropdown nzPlacement=\"bottomRight\">\n  <nz-avatar [nzSrc]=\"settingsService.user.avatar\" class=\"mr-sm\" nzSize=\"small\"></nz-avatar>\n  {{ settingsService.user.name }}\n</div>\n\n<nz-dropdown-menu #menuTpl=\"nzDropdownMenu\">\n  <div\n    [ngStyle]=\"{\n      width: '200px'\n    }\"\n    nz-menu\n  >\n    <div (click)=\"openChangePasswordComponent()\" *ngIf=\"displayChangePasswordOption\" nz-menu-item>\n      <i class=\"mr-sm\" nz-icon nzTheme=\"outline\" nzType=\"lock\"></i>\n      {{ 'projects/fe-ng/src/lib/component/change-password/kengic-change-password.change-password' | i18n }}\n    </div>\n\n    <div (click)=\"logout()\" nz-menu-item>\n      <i class=\"mr-sm\" nz-icon nzTheme=\"outline\" nzType=\"logout\"></i>\n      {{ 'projects/fe-ng/src/lib/page/layout/default/header/user/kengic-layout-default-header-user.logout' | i18n }}\n    </div>\n  </div>\n</nz-dropdown-menu>\n\n<kengic-change-password [(visible)]=\"headerUserChangePasswordComponentProp.visible\"></kengic-change-password>\n"
    }),
    __param(2, Inject(KENGIC_TOKEN_DISPLAY_CHANGE_PASSWORD_OPTION)),
    __metadata("design:paramtypes", [SettingsService,
        IdentityService, Boolean])
], KengicLayoutDefaultHeaderUserComponent);
export { KengicLayoutDefaultHeaderUserComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2VuZ2ljLWxheW91dC1kZWZhdWx0LWhlYWRlci11c2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BrZW5naWMvZmUtbmcvIiwic291cmNlcyI6WyJsaWIvcGFnZS9sYXlvdXQvZGVmYXVsdC9oZWFkZXIvdXNlci9rZW5naWMtbGF5b3V0LWRlZmF1bHQtaGVhZGVyLXVzZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNsRCxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQy9DLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUMxRSxPQUFPLEVBQUUsMkNBQTJDLEVBQUUsTUFBTSw0Q0FBNEMsQ0FBQztBQU16RyxJQUFhLHNDQUFzQyxHQUFuRCxNQUFhLHNDQUFzQztJQUtqRCxZQUNTLGVBQWdDLEVBQy9CLGVBQWdDLEVBRWpDLDJCQUFvQztRQUhwQyxvQkFBZSxHQUFmLGVBQWUsQ0FBaUI7UUFDL0Isb0JBQWUsR0FBZixlQUFlLENBQWlCO1FBRWpDLGdDQUEyQixHQUEzQiwyQkFBMkIsQ0FBUztRQVJ0QywwQ0FBcUMsR0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