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';
            case 'm':
                return 'm';
        }
        return this.size;
    }
    get iconStroke() {
        switch (this.size) {
            case 'l':
                return 1.5;
            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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXZhdGFyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3VpLWtpdC9zcmMvbGliL2F2YXRhci9hdmF0YXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vdWkta2l0L3NyYy9saWIvYXZhdGFyL2F2YXRhci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFFLFdBQVcsRUFBRSxLQUFLLEVBQVM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