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() {
        switch (this.size) {
            case 'l':
            case 'm':
                return 1.5;
        }
        return 2;
    }
}
AvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
AvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: AvatarComponent, selector: "ui-avatar", inputs: { size: "size", role: "role", icon: "icon", iconStatus: "iconStatus", 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[iconStatus]{margin-bottom:20px}:host[iconStatus=warning]{color:var(--color-warning);border:var(--border-thin) var(--color-warning);background:var(--color-contrast-0)}:host[iconStatus=failed]{color:var(--color-critical);border:var(--border-thin) var(--color-critical);background:var(--color-contrast-0)}:host[iconStatus=success]{color:var(--color-success);border:var(--border-thin) var(--color-success);background:var(--color-contrast-0)}:host[iconStatus=inverse]{color:var(--color-contrast-0);border:var(--border-thin) var(--color-contrast-0);background:var(--color-contrast-100)}"], 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: "12.2.4", ngImport: i0, type: AvatarComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'ui-avatar',
                    templateUrl: './avatar.component.html',
                    styleUrls: ['./avatar.component.scss']
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { size: [{
                type: HostBinding,
                args: ['attr.size']
            }, {
                type: Input
            }], role: [{
                type: HostBinding,
                args: ['attr.role']
            }, {
                type: Input
            }], icon: [{
                type: Input
            }], iconStatus: [{
                type: Input
            }], imageUrl: [{
                type: Input
            }], imageAlt: [{
                type: Input
            }], text: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXZhdGFyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3VpLWtpdC9zcmMvbGliL2F2YXRhci9hdmF0YXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vdWkta2l0L3NyYy9saWIvYXZhdGFyL2F2YXRhci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFFLFdBQVcsRUFBRSxLQUFLLEVBQVMsTUFBTSxlQUFlLENBQUM7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