import { Component, HostBinding, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../icon/icon.component";
import * as i2 from "@angular/common";
import * as i3 from "./initials.pipe";
export const avatarSizes = ['s', 'm', 'l'];
export class AvatarComponent {
    constructor() {
        this.size = 'm';
        this.role = 'img';
    }
    ngOnInit() {
    }
    get iconSize() {
        switch (this.size) {
            case 'l':
                return 'xl';
        }
        return this.size;
    }
    get iconStroke() {
        if (this.iconState) {
            switch (this.size) {
                case 'l':
                    return 3;
            }
        }
        return 1.5;
    }
}
AvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
AvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: AvatarComponent, selector: "ui-avatar", inputs: { size: "size", role: "role", icon: "icon", iconState: "iconState", imageUrl: "imageUrl", imageAlt: "imageAlt", text: "text" }, host: { properties: { "attr.size": "this.size", "attr.role": "this.role" } }, ngImport: i0, template: "<ng-container *ngIf=\"icon\">\n  <ui-icon [name]=\"icon\" [size]=\"iconSize\" [stroke]=\"iconStroke\"></ui-icon>\n</ng-container>\n\n<ng-container *ngIf=\"imageUrl\">\n  <img [src]=\"imageUrl\" alt=\"\">\n</ng-container>\n\n<ng-container *ngIf=\"text\">\n  {{text | initials}}\n</ng-container>\n\n<ng-content></ng-content>\n", styles: [":host{border-radius:50%;overflow:hidden;background:var(--color-contrast-5);color:var(--color-contrast-100);display:flex;justify-content:center;align-items:center;font-size:var(--font-size-s);font-weight:var(--font-weight-medium);text-transform:uppercase}:host[size=s]{width:20px;height:20px;font-size:var(--font-size-xxxs)}:host[size=m]{width:40px;height:40px}:host[size=l]{width:80px;height:80px;font-size:var(--font-size-l)}:host img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}:host[iconState]{margin-bottom:20px}:host[iconState][size=l]{border-width:3px}:host[iconState][size=m]{border-width:2px}:host[iconState=warning]{color:var(--color-warning);border:var(--border-thin) var(--color-warning);background:var(--color-contrast-0)}:host[iconState=critical]{color:var(--color-critical);border:var(--border-thin) var(--color-critical);background:var(--color-contrast-0)}:host[iconState=success]{color:var(--color-success);border:var(--border-thin) var(--color-success);background:var(--color-contrast-0)}:host[iconState=accent]{color:var(--color-accent);border:var(--border-thin) var(--color-accent);background:var(--color-contrast-0)}:host[iconState=inverse]{color:var(--color-contrast-0);border:var(--border-thin) var(--color-contrast-0);background:var(--color-contrast-100)}\n"], components: [{ type: i1.IconComponent, selector: "ui-icon", inputs: ["name", "color", "size", "stroke", "styles"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "initials": i3.InitialsPipe } });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: AvatarComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ui-avatar', template: "<ng-container *ngIf=\"icon\">\n  <ui-icon [name]=\"icon\" [size]=\"iconSize\" [stroke]=\"iconStroke\"></ui-icon>\n</ng-container>\n\n<ng-container *ngIf=\"imageUrl\">\n  <img [src]=\"imageUrl\" alt=\"\">\n</ng-container>\n\n<ng-container *ngIf=\"text\">\n  {{text | initials}}\n</ng-container>\n\n<ng-content></ng-content>\n", styles: [":host{border-radius:50%;overflow:hidden;background:var(--color-contrast-5);color:var(--color-contrast-100);display:flex;justify-content:center;align-items:center;font-size:var(--font-size-s);font-weight:var(--font-weight-medium);text-transform:uppercase}:host[size=s]{width:20px;height:20px;font-size:var(--font-size-xxxs)}:host[size=m]{width:40px;height:40px}:host[size=l]{width:80px;height:80px;font-size:var(--font-size-l)}:host img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}:host[iconState]{margin-bottom:20px}:host[iconState][size=l]{border-width:3px}:host[iconState][size=m]{border-width:2px}:host[iconState=warning]{color:var(--color-warning);border:var(--border-thin) var(--color-warning);background:var(--color-contrast-0)}:host[iconState=critical]{color:var(--color-critical);border:var(--border-thin) var(--color-critical);background:var(--color-contrast-0)}:host[iconState=success]{color:var(--color-success);border:var(--border-thin) var(--color-success);background:var(--color-contrast-0)}:host[iconState=accent]{color:var(--color-accent);border:var(--border-thin) var(--color-accent);background:var(--color-contrast-0)}:host[iconState=inverse]{color:var(--color-contrast-0);border:var(--border-thin) var(--color-contrast-0);background:var(--color-contrast-100)}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { size: [{
                type: HostBinding,
                args: ['attr.size']
            }, {
                type: Input
            }], role: [{
                type: HostBinding,
                args: ['attr.role']
            }, {
                type: Input
            }], icon: [{
                type: Input
            }], iconState: [{
                type: Input
            }], imageUrl: [{
                type: Input
            }], imageAlt: [{
                type: Input
            }], text: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXZhdGFyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3VpLWtpdC9zcmMvbGliL2F2YXRhci9hdmF0YXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vdWkta2l0L3NyYy9saWIvYXZhdGFyL2F2YXRhci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFFLFdBQVcsRUFBRSxLQUFLLEVBQVMsTUFBTSxlQUFlLENBQUM7Ozs7O0FBR3BFLE1BQU0sQ0FBQyxNQUFNLFdBQVcsR0FBRyxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFVLENBQUM7QUFRcEQsTUFBTSxPQUFPLGVBQWU7SUFpQjFCO1FBZFMsU0FBSSxHQUFlLEdBQUcsQ0FBQztRQUd2QixTQUFJLEdBQUcsS0FBSyxDQUFDO0lBWXRCLENBQUM7SUFFRCxRQUFRO0lBQ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TaXplID0gdHlwZW9mIGF2YXRhclNpemVzW251bWJlcl07XG5cbkBDb21wb25lbnQoe1xuICBzZWxlY3RvcjogJ3VpLWF2YXRhcicsXG4gIHRlbXBsYXRlVXJsOiAnLi9hdmF0YXIuY29tcG9uZW50Lmh0bWwnLFxuICBzdHlsZVVybHM6IFsnLi9hdmF0YXIuY29tcG9uZW50LnNjc3MnXVxufSlcbmV4cG9ydCBjbGFzcyBBdmF0YXJDb21wb25lbnQgaW1wbGVtZW50cyBPbkluaXQge1xuXG4gIEBIb3N0QmluZGluZygnYXR0ci5zaXplJylcbiAgQElucHV0KCkgc2l6ZTogQXZhdGFyU2l6ZSA9ICdtJztcblxuICBASG9zdEJpbmRpbmcoJ2F0dHIucm9sZScpXG4gIEBJbnB1dCgpIHJvbGUgPSAnaW1nJztcblxuICBASW5wdXQoKSBpY29uOiBJY29uO1xuICBASW5wdXQoKSBpY29uU3RhdGU6IEljb25Db2xvcjtcblxuICBASW5wdXQoKSBpbWFnZVVybDogc3RyaW5nO1xuXG4gIEBJbnB1dCgpIGltYWdlQWx0OiBzdHJpbmc7XG5cbiAgQElucHV0KCkgdGV4dDogc3RyaW5nO1xuXG4gIGNvbnN0cnVjdG9yKCkge1xuICB9XG5cbiAgbmdPbkluaXQoKTogdm9pZCB7XG4gIH1cblxuICBnZXQgaWNvblNpemUoKTogSWNvblNpemUge1xuICAgIHN3aXRjaCAodGhpcy5zaXplKSB7XG4gICAgICBjYXNlICdsJzpcbiAgICAgICAgcmV0dXJuICd4bCc7XG4gICAgfVxuICAgIHJldHVybiB0aGlzLnNpemU7XG4gIH1cblxuICBnZXQgaWNvblN0cm9rZSgpOiBudW1iZXIge1xuICAgIGlmICh0aGlzLmljb25TdGF0ZSkge1xuICAgICAgc3dpdGNoICh0aGlzLnNpemUpIHtcbiAgICAgICAgY2FzZSAnbCc6XG4gICAgICAgICAgcmV0dXJuIDM7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiAxLjU7XG4gIH1cblxufVxuIiwiPG5nLWNvbnRhaW5lciAqbmdJZj1cImljb25cIj5cbiAgPHVpLWljb24gW25hbWVdPVwiaWNvblwiIFtzaXplXT1cImljb25TaXplXCIgW3N0cm9rZV09XCJpY29uU3Ryb2tlXCI+PC91aS1pY29uPlxuPC9uZy1jb250YWluZXI+XG5cbjxuZy1jb250YWluZXIgKm5nSWY9XCJpbWFnZVVybFwiPlxuICA8aW1nIFtzcmNdPVwiaW1hZ2VVcmxcIiBhbHQ9XCJcIj5cbjwvbmctY29udGFpbmVyPlxuXG48bmctY29udGFpbmVyICpuZ0lmPVwidGV4dFwiPlxuICB7e3RleHQgfCBpbml0aWFsc319XG48L25nLWNvbnRhaW5lcj5cblxuPG5nLWNvbnRlbnQ+PC9uZy1jb250ZW50PlxuIl19