import { ChangeDetectionStrategy, Component, HostBinding, Input, ViewEncapsulation, EventEmitter, Output, booleanAttribute } from '@angular/core';
import { IonicModule } from '@ionic/angular';
import { EuimLabelModule } from '../atoms/euim-label';
import { BaseStatesDirective } from '../base-states.directive';
import * as i0 from "@angular/core";
import * as i1 from "../base-states.directive";
import * as i2 from "@ionic/angular";
import * as i3 from "../atoms/euim-label/euim-label.component";
export class EuimAlertMessageComponent {
    constructor(baseStatesDirective) {
        this.baseStatesDirective = baseStatesDirective;
        this._variant = 'default';
        this.euimClose = new EventEmitter();
        this.euimLabelTruncate = false;
        this.hasIcon = false;
        this.isCloseable = false;
        this.isVisible = true;
    }
    ngOnInit() {
        if (this.baseStatesDirective) {
            this.setVariants();
        }
    }
    setVariants() {
        if (this.baseStatesDirective.color) {
            this._variant = this.baseStatesDirective.color;
        }
    }
    get icon() {
        switch (this._variant) {
            case 'warning':
                return 'alert-circle';
            case 'danger':
                return 'close-circle';
            case 'success':
                return 'checkmark-circle';
            case 'info':
                return 'information-circle';
            case 'primary':
                return 'search';
            case 'dark':
                return 'search';
            case 'branding':
                return 'search';
            case 'light':
                return 'search';
            case 'clear':
                return 'search';
            default:
                return '';
        }
    }
    get cssClasses() {
        return this.getCssClasses();
    }
    getCssClasses() {
        return [
            this.baseStatesDirective.getCssClasses('euim-alert-message'),
            this._variant ? `euim-alert-message--${this._variant}` : '',
            !this.isVisible ? 'euim-alert-message--hidden' : '',
        ].join(' ');
    }
    onClose(event) {
        if (event) {
            event.preventDefault();
        }
        this.isVisible = false;
        this.euimClose.emit();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EuimAlertMessageComponent, deps: [{ token: i1.BaseStatesDirective }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: EuimAlertMessageComponent, isStandalone: true, selector: "euim-alert-message", inputs: { euimLabelTruncate: ["euimLabelTruncate", "euimLabelTruncate", booleanAttribute], hasIcon: ["hasIcon", "hasIcon", booleanAttribute], isCloseable: ["isCloseable", "isCloseable", booleanAttribute] }, outputs: { euimClose: "euimClose" }, host: { properties: { "class": "this.cssClasses" } }, hostDirectives: [{ directive: i1.BaseStatesDirective, inputs: ["color", "color"] }], ngImport: i0, template: "@if (hasIcon && isVisible) {\n  <div class=\"euim-alert-message__wrappericon\">\n    @if (hasIcon) {\n      <ion-icon [name]=\"icon\" class=\"euim-alert-message__icon\"></ion-icon>\n    }\n  </div>\n}\n@if (isVisible) {\n  <div class=\"euim-alert-message__wrapper\">\n    <div class=\"slotStart\">\n      <ng-content select=\"[slotStart]\"></ng-content>\n    </div>\n    <div euimLabel [euimLabelTruncate]=\"euimLabelTruncate\">\n      <ng-content></ng-content>\n    </div>\n    <div class=\"slotEnd\">\n      <ng-content select=\"[slotEnd]\"></ng-content>\n    </div>\n  </div>\n}\n\n@if (isCloseable && isVisible) {\n  <a role=\"button\" aria-label=\"Close Icon Button\" class=\"euim-alert-message__close\"\n    (click)=\"onClose($event)\">\n    <ion-icon name=\"close\" class=\"euim-alert-message__closeIcon\"></ion-icon>\n  </a>\n}\n", styles: [".euim-alert-message{display:flex;align-items:center;font:var(--eui-f-s-compact);padding:var(--eui-s-xs) var(--eui-s-xs) var(--eui-s-xs) var(--eui-s-m)}.euim-alert-message__wrapper{padding:0;margin:0;min-width:1px;display:flex;align-items:center;position:relative;flex-grow:1}.euim-alert-message__wrapper .euim-label span,.euim-alert-message__wrapper .euim-label p{margin:0}.euim-alert-message__wrapper .euim-label{font:var(--eui-f-s-compact)}.euim-alert-message .slotEnd{display:flex;align-items:center;margin-inline-start:auto;padding-left:var(--eui-s-xs)}.euim-alert-message .slotEnd ion-icon{width:var(--eui-is-xs);height:var(--eui-is-xs);display:flex}.euim-alert-message [slotStart]{display:flex;align-items:center;width:var(--eui-is-m);height:var(--eui-is-m);margin-inline-end:var(--eui-s-m)}.euim-alert-message__icon{align-items:center;width:var(--eui-is-m);height:var(--eui-is-m);margin-inline-end:var(--eui-s-m)}.euim-alert-message__closeIcon{align-items:center;width:var(--eui-is-xs);height:var(--eui-is-xs)}.euim-alert-message__wrappericon{align-items:center;width:var(--eui-is-m);height:var(--eui-is-m);margin-inline-end:var(--eui-s-m)}.euim-alert-message__close{padding:0;margin:0;width:var(--eui-is-xs);height:var(--eui-is-xs)}.euim-alert-message__close ion-icon.euim-alert-message__closeIcon{color:var(--eui-c-neutral)}.euim-alert-message a{cursor:pointer}.euim-alert-message ion-badge[slotEnd]{display:flex;align-items:center}.euim-alert-message--danger{color:var(--eui-c-danger-dark);background:var(--eui-c-danger-bg)}.euim-alert-message--danger .euim-label{color:var(--eui-c-danger-dark)}.euim-alert-message--danger ion-icon{color:var(--eui-c-danger-dark)}.euim-alert-message--danger ion-badge[slotEnd],.euim-alert-message--danger ion-button[slotEnd]:not(.button-outline),.euim-alert-message--danger ion-chip[slotEnd]{--background: var(--eui-c-danger-dark);color:var(--eui-c-danger-contrast)}.euim-alert-message--danger ion-badge[slotEnd] ion-icon,.euim-alert-message--danger ion-button[slotEnd]:not(.button-outline) ion-icon,.euim-alert-message--danger ion-chip[slotEnd] ion-icon{color:var(--eui-c-white)}.euim-alert-message--danger [slotEnd] ion-icon{color:var(--eui-c-danger-contrast)}.euim-alert-message--info{color:var(--eui-c-info-dark);background:var(--eui-c-info-bg)}.euim-alert-message--info .euim-label{color:var(--eui-c-info-dark)}.euim-alert-message--info ion-icon{color:var(--eui-c-info-dark)}.euim-alert-message--info ion-badge[slotEnd],.euim-alert-message--info ion-button[slotEnd]:not(.button-outline),.euim-alert-message--info ion-chip[slotEnd]{--background: var(--eui-c-info);color:var(--eui-c-info-contrast)}.euim-alert-message--info ion-badge[slotEnd] ion-icon,.euim-alert-message--info ion-button[slotEnd]:not(.button-outline) ion-icon,.euim-alert-message--info ion-chip[slotEnd] ion-icon{color:var(--eui-c-info-contrast)}.euim-alert-message--info [slotEnd] ion-icon{color:var(--eui-c-info-contrast)}.euim-alert-message--success{color:var(--eui-c-success-darker);background:var(--eui-c-success-bg)}.euim-alert-message--success .euim-label{color:var(--eui-c-success-darker)}.euim-alert-message--success ion-icon{color:var(--eui-c-success-darker)}.euim-alert-message--success ion-badge[slotEnd],.euim-alert-message--success ion-button[slotEnd]:not(.button-outline),.euim-alert-message--success ion-chip[slotEnd]{--background: var(--eui-c-success-darker);color:var(--eui-c-white)}.euim-alert-message--success ion-badge[slotEnd] ion-icon,.euim-alert-message--success ion-button[slotEnd]:not(.button-outline) ion-icon,.euim-alert-message--success ion-chip[slotEnd] ion-icon{color:var(--eui-c-white)}.euim-alert-message--success [slotEnd] ion-icon{color:var(--eui-c-success)}.euim-alert-message--warning{color:var(--eui-c-warning-darker);background:var(--eui-c-warning-bg)}.euim-alert-message--warning .euim-label{color:var(--eui-c-warning-darker)}.euim-alert-message--warning ion-icon{color:var(--eui-c-warning-darker)}.euim-alert-message--warning ion-badge[slotEnd],.euim-alert-message--warning ion-button[slotEnd]:not(.button-outline),.euim-alert-message--warning ion-chip[slotEnd]{--background: var(--eui-c-warning);color:var(--eui-c-warning-contrast)}.euim-alert-message--warning ion-badge[slotEnd] ion-icon,.euim-alert-message--warning ion-button[slotEnd]:not(.button-outline) ion-icon,.euim-alert-message--warning ion-chip[slotEnd] ion-icon{color:var(--eui-c-warning-contrast)}.euim-alert-message--warning [slotEnd] ion-icon{color:var(--eui-c-warning-contrast)}.euim-alert-message--dark{color:var(--eui-c-neutral-contrast);background:var(--eui-c-neutral)}.euim-alert-message--dark ion-icon,.euim-alert-message--dark .euim-label{color:var(--eui-c-neutral-contrast)}.euim-alert-message--dark [slotEnd]{--background: var(--eui-c-neutral);color:var(--eui-c-neutral-contrast)}.euim-alert-message--primary{color:var(--eui-c-primary-dark);background:var(--eui-c-primary-bg)}.euim-alert-message--primary .euim-label{color:var(--eui-c-primary-dark)}.euim-alert-message--primary ion-icon{color:var(--eui-c-primary-dark)}.euim-alert-message--primary ion-badge[slotEnd],.euim-alert-message--primary ion-button[slotEnd]:not(.button-outline),.euim-alert-message--primary ion-chip[slotEnd]{--background: var(--eui-c-primary);color:var(--eui-c-primary-contrast)}.euim-alert-message--primary ion-badge[slotEnd] ion-icon,.euim-alert-message--primary ion-button[slotEnd]:not(.button-outline) ion-icon,.euim-alert-message--primary ion-chip[slotEnd] ion-icon{color:var(--eui-c-primary-contrast)}.euim-alert-message--primary [slotEnd] ion-icon{color:var(--eui-c-primary-contrast)}.euim-alert-message--branding{color:var(--eui-c-branding-contrast);background:var(--eui-c-branding)}.euim-alert-message--branding ion-icon,.euim-alert-message--branding .euim-label{color:var(--eui-c-branding-contrast)}.euim-alert-message--branding [slotEnd]{--background: none;--border-color: var(--eui-c-neutral-min);color:var(--eui-c-neutral-min)}.euim-alert-message--light{color:var(--eui-c-neutral);background:var(--eui-c-neutral-bg-light)}.euim-alert-message--light ion-icon,.euim-alert-message--light .euim-label{color:var(--eui-c-neutral)}.euim-alert-message--light [slotEnd]{--background: var(--eui-bc-neutral-bg-light);color:var(--eui-c-neutral)}.euim-alert-message--default{color:var(--eui-c-black);background:none}.euim-alert-message--default ion-icon,.euim-alert-message--default .euim-label{color:var(--eui-c-black)}.euim-alert-message--clear{color:var(--eui-c-neutral);background:none}.euim-alert-message--clear ion-icon,.euim-alert-message--clear .euim-label{color:var(--eui-c-neutral)}.euim-alert-message--hidden{display:none}.euim-alert-message [slotEnd]{font:var(--eui-f-s-compact)}.euim-alert-message ion-badge[slotEnd]{padding-right:var(--eui-s-xs);padding-left:var(--eui-s-xs)}.euim-alert-message ion-badge[slotEnd] ion-icon{padding-left:var(--eui-s-2xs)}\n"], dependencies: [{ kind: "ngmodule", type: IonicModule }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "ngmodule", type: EuimLabelModule }, { kind: "component", type: i3.EuimLabelComponent, selector: "div[euimLabel], p[euimLabel], span[euimLabel], euim-label", inputs: ["euimLabelTruncateWithLines", "euimLabelTitle", "euimLabelSubTitle", "euimLabelMeta", "euimLabelTruncate", "euimLabelTextWrap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EuimAlertMessageComponent, decorators: [{
            type: Component,
            args: [{ selector: 'euim-alert-message', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [IonicModule, EuimLabelModule], hostDirectives: [
                        {
                            directive: BaseStatesDirective,
                            inputs: [
                                'color',
                            ],
                        },
                    ], template: "@if (hasIcon && isVisible) {\n  <div class=\"euim-alert-message__wrappericon\">\n    @if (hasIcon) {\n      <ion-icon [name]=\"icon\" class=\"euim-alert-message__icon\"></ion-icon>\n    }\n  </div>\n}\n@if (isVisible) {\n  <div class=\"euim-alert-message__wrapper\">\n    <div class=\"slotStart\">\n      <ng-content select=\"[slotStart]\"></ng-content>\n    </div>\n    <div euimLabel [euimLabelTruncate]=\"euimLabelTruncate\">\n      <ng-content></ng-content>\n    </div>\n    <div class=\"slotEnd\">\n      <ng-content select=\"[slotEnd]\"></ng-content>\n    </div>\n  </div>\n}\n\n@if (isCloseable && isVisible) {\n  <a role=\"button\" aria-label=\"Close Icon Button\" class=\"euim-alert-message__close\"\n    (click)=\"onClose($event)\">\n    <ion-icon name=\"close\" class=\"euim-alert-message__closeIcon\"></ion-icon>\n  </a>\n}\n", styles: [".euim-alert-message{display:flex;align-items:center;font:var(--eui-f-s-compact);padding:var(--eui-s-xs) var(--eui-s-xs) var(--eui-s-xs) var(--eui-s-m)}.euim-alert-message__wrapper{padding:0;margin:0;min-width:1px;display:flex;align-items:center;position:relative;flex-grow:1}.euim-alert-message__wrapper .euim-label span,.euim-alert-message__wrapper .euim-label p{margin:0}.euim-alert-message__wrapper .euim-label{font:var(--eui-f-s-compact)}.euim-alert-message .slotEnd{display:flex;align-items:center;margin-inline-start:auto;padding-left:var(--eui-s-xs)}.euim-alert-message .slotEnd ion-icon{width:var(--eui-is-xs);height:var(--eui-is-xs);display:flex}.euim-alert-message [slotStart]{display:flex;align-items:center;width:var(--eui-is-m);height:var(--eui-is-m);margin-inline-end:var(--eui-s-m)}.euim-alert-message__icon{align-items:center;width:var(--eui-is-m);height:var(--eui-is-m);margin-inline-end:var(--eui-s-m)}.euim-alert-message__closeIcon{align-items:center;width:var(--eui-is-xs);height:var(--eui-is-xs)}.euim-alert-message__wrappericon{align-items:center;width:var(--eui-is-m);height:var(--eui-is-m);margin-inline-end:var(--eui-s-m)}.euim-alert-message__close{padding:0;margin:0;width:var(--eui-is-xs);height:var(--eui-is-xs)}.euim-alert-message__close ion-icon.euim-alert-message__closeIcon{color:var(--eui-c-neutral)}.euim-alert-message a{cursor:pointer}.euim-alert-message ion-badge[slotEnd]{display:flex;align-items:center}.euim-alert-message--danger{color:var(--eui-c-danger-dark);background:var(--eui-c-danger-bg)}.euim-alert-message--danger .euim-label{color:var(--eui-c-danger-dark)}.euim-alert-message--danger ion-icon{color:var(--eui-c-danger-dark)}.euim-alert-message--danger ion-badge[slotEnd],.euim-alert-message--danger ion-button[slotEnd]:not(.button-outline),.euim-alert-message--danger ion-chip[slotEnd]{--background: var(--eui-c-danger-dark);color:var(--eui-c-danger-contrast)}.euim-alert-message--danger ion-badge[slotEnd] ion-icon,.euim-alert-message--danger ion-button[slotEnd]:not(.button-outline) ion-icon,.euim-alert-message--danger ion-chip[slotEnd] ion-icon{color:var(--eui-c-white)}.euim-alert-message--danger [slotEnd] ion-icon{color:var(--eui-c-danger-contrast)}.euim-alert-message--info{color:var(--eui-c-info-dark);background:var(--eui-c-info-bg)}.euim-alert-message--info .euim-label{color:var(--eui-c-info-dark)}.euim-alert-message--info ion-icon{color:var(--eui-c-info-dark)}.euim-alert-message--info ion-badge[slotEnd],.euim-alert-message--info ion-button[slotEnd]:not(.button-outline),.euim-alert-message--info ion-chip[slotEnd]{--background: var(--eui-c-info);color:var(--eui-c-info-contrast)}.euim-alert-message--info ion-badge[slotEnd] ion-icon,.euim-alert-message--info ion-button[slotEnd]:not(.button-outline) ion-icon,.euim-alert-message--info ion-chip[slotEnd] ion-icon{color:var(--eui-c-info-contrast)}.euim-alert-message--info [slotEnd] ion-icon{color:var(--eui-c-info-contrast)}.euim-alert-message--success{color:var(--eui-c-success-darker);background:var(--eui-c-success-bg)}.euim-alert-message--success .euim-label{color:var(--eui-c-success-darker)}.euim-alert-message--success ion-icon{color:var(--eui-c-success-darker)}.euim-alert-message--success ion-badge[slotEnd],.euim-alert-message--success ion-button[slotEnd]:not(.button-outline),.euim-alert-message--success ion-chip[slotEnd]{--background: var(--eui-c-success-darker);color:var(--eui-c-white)}.euim-alert-message--success ion-badge[slotEnd] ion-icon,.euim-alert-message--success ion-button[slotEnd]:not(.button-outline) ion-icon,.euim-alert-message--success ion-chip[slotEnd] ion-icon{color:var(--eui-c-white)}.euim-alert-message--success [slotEnd] ion-icon{color:var(--eui-c-success)}.euim-alert-message--warning{color:var(--eui-c-warning-darker);background:var(--eui-c-warning-bg)}.euim-alert-message--warning .euim-label{color:var(--eui-c-warning-darker)}.euim-alert-message--warning ion-icon{color:var(--eui-c-warning-darker)}.euim-alert-message--warning ion-badge[slotEnd],.euim-alert-message--warning ion-button[slotEnd]:not(.button-outline),.euim-alert-message--warning ion-chip[slotEnd]{--background: var(--eui-c-warning);color:var(--eui-c-warning-contrast)}.euim-alert-message--warning ion-badge[slotEnd] ion-icon,.euim-alert-message--warning ion-button[slotEnd]:not(.button-outline) ion-icon,.euim-alert-message--warning ion-chip[slotEnd] ion-icon{color:var(--eui-c-warning-contrast)}.euim-alert-message--warning [slotEnd] ion-icon{color:var(--eui-c-warning-contrast)}.euim-alert-message--dark{color:var(--eui-c-neutral-contrast);background:var(--eui-c-neutral)}.euim-alert-message--dark ion-icon,.euim-alert-message--dark .euim-label{color:var(--eui-c-neutral-contrast)}.euim-alert-message--dark [slotEnd]{--background: var(--eui-c-neutral);color:var(--eui-c-neutral-contrast)}.euim-alert-message--primary{color:var(--eui-c-primary-dark);background:var(--eui-c-primary-bg)}.euim-alert-message--primary .euim-label{color:var(--eui-c-primary-dark)}.euim-alert-message--primary ion-icon{color:var(--eui-c-primary-dark)}.euim-alert-message--primary ion-badge[slotEnd],.euim-alert-message--primary ion-button[slotEnd]:not(.button-outline),.euim-alert-message--primary ion-chip[slotEnd]{--background: var(--eui-c-primary);color:var(--eui-c-primary-contrast)}.euim-alert-message--primary ion-badge[slotEnd] ion-icon,.euim-alert-message--primary ion-button[slotEnd]:not(.button-outline) ion-icon,.euim-alert-message--primary ion-chip[slotEnd] ion-icon{color:var(--eui-c-primary-contrast)}.euim-alert-message--primary [slotEnd] ion-icon{color:var(--eui-c-primary-contrast)}.euim-alert-message--branding{color:var(--eui-c-branding-contrast);background:var(--eui-c-branding)}.euim-alert-message--branding ion-icon,.euim-alert-message--branding .euim-label{color:var(--eui-c-branding-contrast)}.euim-alert-message--branding [slotEnd]{--background: none;--border-color: var(--eui-c-neutral-min);color:var(--eui-c-neutral-min)}.euim-alert-message--light{color:var(--eui-c-neutral);background:var(--eui-c-neutral-bg-light)}.euim-alert-message--light ion-icon,.euim-alert-message--light .euim-label{color:var(--eui-c-neutral)}.euim-alert-message--light [slotEnd]{--background: var(--eui-bc-neutral-bg-light);color:var(--eui-c-neutral)}.euim-alert-message--default{color:var(--eui-c-black);background:none}.euim-alert-message--default ion-icon,.euim-alert-message--default .euim-label{color:var(--eui-c-black)}.euim-alert-message--clear{color:var(--eui-c-neutral);background:none}.euim-alert-message--clear ion-icon,.euim-alert-message--clear .euim-label{color:var(--eui-c-neutral)}.euim-alert-message--hidden{display:none}.euim-alert-message [slotEnd]{font:var(--eui-f-s-compact)}.euim-alert-message ion-badge[slotEnd]{padding-right:var(--eui-s-xs);padding-left:var(--eui-s-xs)}.euim-alert-message ion-badge[slotEnd] ion-icon{padding-left:var(--eui-s-2xs)}\n"] }]
        }], ctorParameters: () => [{ type: i1.BaseStatesDirective }], propDecorators: { euimClose: [{
                type: Output
            }], euimLabelTruncate: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasIcon: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isCloseable: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], cssClasses: [{
                type: HostBinding,
                args: ['class']
            }] } });
//# sourceMappingURL=data:application/json;base64, 