import { Component, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, Input } from '@angular/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { UxAppShellService } from '@eui/core';
import * as i0 from "@angular/core";
import * as i1 from "@eui/core";
import * as i2 from "../../components/eui-dropdown/eui-dropdown.component";
import * as i3 from "@angular/common";
import * as i4 from "../../components/eui-dropdown/components/eui-dropdown-content.component";
function EuiUserProfileComponent_ng_template_4_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1("", ctx_r5.welcomeLabel, "\u00A0");
} }
function EuiUserProfileComponent_ng_template_4_div_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 12);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r6 = i0.ɵɵnextContext(2);
    var tmp_0_0 = null;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", (tmp_0_0 = i0.ɵɵpipeBind1(2, 1, ctx_r6.asServie.state$)) == null ? null : tmp_0_0.userSubInfos, " ");
} }
function EuiUserProfileComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵelementStart(1, "div", 8);
    i0.ɵɵtemplate(2, EuiUserProfileComponent_ng_template_4_span_2_Template, 2, 1, "span", 9);
    i0.ɵɵelementStart(3, "span", 10);
    i0.ɵɵtext(4);
    i0.ɵɵpipe(5, "async");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(6, EuiUserProfileComponent_ng_template_4_div_6_Template, 3, 3, "div", 11);
    i0.ɵɵpipe(7, "async");
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    var tmp_1_0 = null;
    var tmp_2_0 = null;
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.hasWelcomeLabel);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate((tmp_1_0 = i0.ɵɵpipeBind1(5, 3, ctx_r0.asServie.state$)) == null ? null : tmp_1_0.userInfos);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", (tmp_2_0 = i0.ɵɵpipeBind1(7, 5, ctx_r0.asServie.state$)) == null ? null : tmp_2_0.userSubInfos);
} }
function EuiUserProfileComponent_ng_template_6_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r7 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1("", ctx_r7.welcomeLabel, "\u00A0");
} }
function EuiUserProfileComponent_ng_template_6_div_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 12);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r8 = i0.ɵɵnextContext(2);
    var tmp_0_0 = null;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", (tmp_0_0 = i0.ɵɵpipeBind1(2, 1, ctx_r8.asServie.state$)) == null ? null : tmp_0_0.userSubInfos, " ");
} }
function EuiUserProfileComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵelementStart(1, "div", 8);
    i0.ɵɵtemplate(2, EuiUserProfileComponent_ng_template_6_span_2_Template, 2, 1, "span", 9);
    i0.ɵɵelementStart(3, "strong");
    i0.ɵɵtext(4);
    i0.ɵɵpipe(5, "async");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "span", 10);
    i0.ɵɵtext(8);
    i0.ɵɵpipe(9, "async");
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(10, EuiUserProfileComponent_ng_template_6_div_10_Template, 3, 3, "div", 11);
    i0.ɵɵpipe(11, "async");
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    var tmp_1_0 = null;
    var tmp_3_0 = null;
    var tmp_4_0 = null;
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r1.hasWelcomeLabel);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate((tmp_1_0 = i0.ɵɵpipeBind1(5, 5, ctx_r1.asServie.state$)) == null ? null : tmp_1_0.userInfos);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" \u00A0", ctx_r1.impersonateLabel, " ");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate((tmp_3_0 = i0.ɵɵpipeBind1(9, 7, ctx_r1.asServie.state$)) == null ? null : tmp_3_0.impersonatedUserInfos);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", (tmp_4_0 = i0.ɵɵpipeBind1(11, 9, ctx_r1.asServie.state$)) == null ? null : tmp_4_0.userSubInfos);
} }
function EuiUserProfileComponent_div_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 13);
    i0.ɵɵelement(1, "div", 14);
    i0.ɵɵelementEnd();
} }
function EuiUserProfileComponent_div_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "div", 15);
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngClass", ctx_r3.isOnline ? "eui-user-profile__avatar--online" : "eui-user-profile__avatar--offline");
} }
function EuiUserProfileComponent_div_11_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 16);
    i0.ɵɵelement(1, "img", 17);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("src", ctx_r4.avatarUrl, i0.ɵɵsanitizeUrl);
} }
const _c0 = ["*"];
export class EuiUserProfileComponent {
    constructor(asServie) {
        this.asServie = asServie;
        this.hasWelcomeLabel = false;
        this.welcomeLabel = 'Welcome';
        this.impersonateLabel = 'impersonating';
        this._euiUserProfileSizeS = false;
        this.isOnline = true;
    }
    get euiUserProfileSizeS() { return this._euiUserProfileSizeS; }
    set euiUserProfileSizeS(value) { this._euiUserProfileSizeS = coerceBooleanProperty(value); }
    get cssClasses() {
        return this.getCssClasses();
    }
    getCssClasses() {
        return [
            `eui-user-profile`,
            this._euiUserProfileSizeS ? 'eui-user-profile--size-s' : '',
        ].join(' ').trim();
    }
}
/** @nocollapse */ EuiUserProfileComponent.ɵfac = function EuiUserProfileComponent_Factory(t) { return new (t || EuiUserProfileComponent)(i0.ɵɵdirectiveInject(i1.UxAppShellService)); };
/** @nocollapse */ EuiUserProfileComponent.ɵcmp = i0.ɵɵdefineComponent({ type: EuiUserProfileComponent, selectors: [["eui-user-profile"]], hostVars: 2, hostBindings: function EuiUserProfileComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵclassMap(ctx.cssClasses);
    } }, inputs: { hasWelcomeLabel: "hasWelcomeLabel", welcomeLabel: "welcomeLabel", impersonateLabel: "impersonateLabel", avatarUrl: "avatarUrl", euiUserProfileSizeS: "euiUserProfileSizeS" }, ngContentSelectors: _c0, decls: 14, vars: 15, consts: [["width", "340px"], [1, "eui-user-profile-content"], [1, "eui-user-profile__infos"], [3, "ngIf"], ["class", "eui-user-profile__avatar-shadow", 4, "ngIf"], ["class", "eui-user-profile__avatar", 3, "ngClass", 4, "ngIf"], ["class", "eui-user-profile__avatar eui-u-svg", 4, "ngIf"], [1, "eui-user-profile__infos-container"], [1, "eui-user-profile__infos-welcome"], [4, "ngIf"], [1, "eui-user-profile__infos-name"], ["class", "eui-user-profile__infos-subinfos", 4, "ngIf"], [1, "eui-user-profile__infos-subinfos"], [1, "eui-user-profile__avatar-shadow"], [1, "eui-user-profile__avatar", "eui-u-svg", "eui-u-svg--default-avatar"], [1, "eui-user-profile__avatar", 3, "ngClass"], [1, "eui-user-profile__avatar", "eui-u-svg"], ["alt", "avatar", 3, "src"]], template: function EuiUserProfileComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵprojectionDef();
        i0.ɵɵelementStart(0, "eui-dropdown", 0);
        i0.ɵɵelementStart(1, "div", 1);
        i0.ɵɵelementStart(2, "div", 2);
        i0.ɵɵpipe(3, "async");
        i0.ɵɵtemplate(4, EuiUserProfileComponent_ng_template_4_Template, 8, 7, "ng-template", 3);
        i0.ɵɵpipe(5, "async");
        i0.ɵɵtemplate(6, EuiUserProfileComponent_ng_template_6_Template, 12, 11, "ng-template", 3);
        i0.ɵɵpipe(7, "async");
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(8, EuiUserProfileComponent_div_8_Template, 2, 0, "div", 4);
        i0.ɵɵpipe(9, "async");
        i0.ɵɵtemplate(10, EuiUserProfileComponent_div_10_Template, 1, 1, "div", 5);
        i0.ɵɵtemplate(11, EuiUserProfileComponent_div_11_Template, 2, 1, "div", 6);
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(12, "eui-dropdown-content");
        i0.ɵɵprojection(13);
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        var tmp_0_0 = null;
        var tmp_1_0 = null;
        var tmp_2_0 = null;
        var tmp_3_0 = null;
        i0.ɵɵadvance(2);
        i0.ɵɵclassProp("eui-user-profile__infos--no-subinfos", !((tmp_0_0 = i0.ɵɵpipeBind1(3, 7, ctx.asServie.state$)) == null ? null : tmp_0_0.userSubInfos) && !ctx.hasWelcomeLabel);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", !((tmp_1_0 = i0.ɵɵpipeBind1(5, 9, ctx.asServie.state$)) == null ? null : tmp_1_0.impersonatedUserInfos));
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", (tmp_2_0 = i0.ɵɵpipeBind1(7, 11, ctx.asServie.state$)) == null ? null : tmp_2_0.impersonatedUserInfos);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", (tmp_3_0 = i0.ɵɵpipeBind1(9, 13, ctx.asServie.state$)) == null ? null : tmp_3_0.impersonatedUserInfos);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", !ctx.avatarUrl);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.avatarUrl);
    } }, directives: [i2.EuiDropdownComponent, i3.NgIf, i4.EuiDropdownContentComponent, i3.NgClass], pipes: [i3.AsyncPipe], styles: [".eui-user-profile{display:flex;position:relative}.eui-user-profile-content{align-items:center;cursor:pointer;display:flex}.eui-user-profile__infos{align-items:flex-end;display:flex;flex-direction:column;margin-right:var(--eui-spacing-xs);margin-top:var(--eui-spacing-xs)}.eui-toolbar-item .eui-user-profile__infos{line-height:1.25;margin-top:var(--eui-spacing-3xs)}.eui-user-profile__infos-container{align-items:center;display:flex;justify-content:flex-end;width:100%}.eui-user-profile__infos-welcome{color:var(--eui-color-grey-dark);font-size:var(--eui-font-size-s)}.eui-toolbar-item .eui-user-profile__infos-welcome{color:var(--eui-color-grey-lighter);font-size:85%}.eui-user-profile__infos-name{color:var(--eui-color-primary);font-size:var(--eui-font-size);font-weight:700}.eui-toolbar-item .eui-user-profile__infos-name{color:var(--eui-color-white)}.eui-user-profile__infos-subinfos{color:var(--eui-color-grey-dark);font-size:var(--eui-font-size-s)}.eui-toolbar-item .eui-user-profile__infos-subinfos{color:var(--eui-color-grey-lighter);font-size:85%}.eui-user-profile__infos--no-subinfos{display:flex}.eui-user-profile__avatar{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/PjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0ia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background-size:cover;border:2px solid var(--eui-color-info-light);border-radius:50%;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)!important;height:50px;margin-right:1rem;min-height:50px;min-width:50px;position:relative;width:50px}.eui-user-profile__avatar-toggle{bottom:-23px;color:var(--eui-color-grey);cursor:pointer;position:absolute;right:14px}.eui-user-profile__avatar-toggle .eui-icon{font-size:var(--eui-font-size)}.eui-user-profile__avatar-toggle:hover{animation:none;color:var(--eui-color-primary)}.eui-user-profile__avatar--offline{border-color:var(--eui-color-danger-light)}.eui-user-profile__avatar--online{border-color:var(--eui-color-info-light)}.eui-user-profile__avatar-shadow{height:3rem;opacity:.5;position:relative;width:1.5rem}.eui-user-profile__avatar-shadow .eui-user-profile__avatar{border:2px solid var(--eui-color-grey-lighter)}@media screen and (max-width:767px){.eui-app-shell-header-toolbar-items .eui-user-profile{display:flex}.eui-app .eui-app-toolbar .eui-user-profile__infos{display:none}}@media screen and (min-width:768px){.eui-app-shell-header-toolbar-items .eui-user-profile{display:none}.is-header-shrink .eui-user-profile{display:flex}}@media screen and (min-width:768px) and (max-width:991px){.eui-app .eui-app-toolbar .eui-user-profile__infos{display:none}}.eui-user-profile--size-s .eui-user-profile__avatar{border-width:2px;box-shadow:none;height:2.5rem;margin:0;min-height:2.5rem;min-width:2.5rem;width:2.5rem}.eui-user-profile--size-s .eui-user-profile__avatar-toggle{display:none}.eui-user-profile--size-s .eui-user-profile__avatar--offline,.eui-user-profile--size-s .eui-user-profile__avatar--online{border-color:var(--eui-color-grey-light)}.eui-user-profile--size-s .eui-user-profile__avatar-shadow{border-width:2px;box-shadow:none;height:2.5rem;margin:0;min-height:2.5rem;min-width:1.125rem;width:1.125rem}.eui-user-profile-menu-item{align-items:center;border-bottom:1px solid var(--eui-color-grey-lighter);cursor:pointer;display:flex;padding:.25rem .75rem}.eui-user-profile-menu-item:last-child{border-bottom:0}.eui-user-profile-menu-item a{color:var(--eui-color-font);text-decoration:none}.eui-user-profile-menu-item .eui-icon{color:var(--eui-color-primary-light);font-size:1.3rem;margin-right:1rem;padding:.5rem}.eui-user-profile-menu-item:hover{background-color:var(--eui-color-grey-lightest);cursor:default}.eui-user-profile-menu-item.link{cursor:pointer}.eui-user-profile-menu-item-right-content{margin-left:auto}"], encapsulation: 2 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiUserProfileComponent, [{
        type: Component,
        args: [{
                selector: 'eui-user-profile',
                templateUrl: './user-profile.component.html',
                styleUrls: ['./_styles/_index.scss'],
                changeDetection: ChangeDetectionStrategy.Default,
                encapsulation: ViewEncapsulation.None,
            }]
    }], function () { return [{ type: i1.UxAppShellService }]; }, { hasWelcomeLabel: [{
            type: Input
        }], welcomeLabel: [{
            type: Input
        }], impersonateLabel: [{
            type: Input
        }], avatarUrl: [{
            type: Input
        }], euiUserProfileSizeS: [{
            type: Input
        }], cssClasses: [{
            type: HostBinding,
            args: ['class']
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 