/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
 */
import { Component, Input, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
/**
 * Global messages component for displaying global messages. Takes in an array of messages.
 *
 * @export
 */
export class GlobalMessagesComponent {
    constructor() { }
    /**
     * Determines if there are any messages to show by checking the array has some messages in it.
     *
     * \@memberof GlobalMessagesComponent
     * @return {?} true if there are some messages, false otherwise
     */
    hasMessages() {
        return this.messages && this.messages.length > 0;
    }
    /**
     * Closes a message, essentially by removing it from the array of messages.
     *
     * \@memberof GlobalMessagesComponent
     * @param {?} index the index position of the message to close
     * @return {?}
     */
    closeMessage(index) {
        this.messages.splice(index, 1);
    }
}
GlobalMessagesComponent.decorators = [
    { type: Component, args: [{
                selector: 'es-global-messages',
                template: "<ng-container *ngIf=\"hasMessages()\">\n  <div *ngFor=\"let msg of messages; let i = index\" class=\"notification messages-container is-{{ msg.severity }} media\">\n    <div class=\"media-left\">\n      <span class=\"icon is-medium\">\n        <i *ngIf=\"msg.severity==='danger'\" class=\"fas fa-times-circle fa-2x\"></i>\n        <i *ngIf=\"msg.severity==='warning'\" class=\"fas fa-info-circle fa-2x\"></i>\n        <i *ngIf=\"msg.severity==='info'\" class=\"fas fa-info-circle fa-2x\"></i>\n        <i *ngIf=\"msg.severity==='success'\" class=\"fas fa-check-circle fa-2x\"></i>\n      </span>\n    </div>\n    <div class=\"media-content\">\n    <h4 *ngIf=\"msg.heading\" class=\"title is-4\" [innerHTML]=\"msg.heading\"></h4>\n    <p *ngIf=\"msg.summary\" class=\"notification-text subtitle is-6\" [innerHTML]=\"msg.summary\"></p>\n    <!-- Assumes that if the summary was empty, we have some ng-content to display -->\n    <p *ngIf=\"!msg.summary\" class=\"notification-text subtitle is-6\">\n      <ng-content></ng-content>\n    </p>\n    </div>\n    <div class=\"media-right\" *ngIf=\"msg.closable\">\n      <button class=\"delete\" (click)=\"closeMessage(i)\" type=\"button\"></button>\n    </div>\n  </div>\n</ng-container>\n"
            }] }
];
/** @nocollapse */
GlobalMessagesComponent.ctorParameters = () => [];
GlobalMessagesComponent.propDecorators = {
    messages: [{ type: Input }]
};
if (false) {
    /**
     * The array of messages to show.
     * \@memberof GlobalMessagesComponent
     * @type {?}
     */
    GlobalMessagesComponent.prototype.messages;
}
/**
 * Interface to describe the properties a notification message should have.
 * @record
 */
export function Message() { }
/**
 * Severity, these match the class names of Bulma notifications, without the is- at the beginning.
 * @type {?}
 */
Message.prototype.severity;
/**
 * Heading of the message, this is optional.
 * @type {?|undefined}
 */
Message.prototype.heading;
/**
 * The text of the message, this is optional. Can contain standard HTML code but not any Angular code.
 * @type {?|undefined}
 */
Message.prototype.summary;
/**
 * Whether the message is closable.
 * @type {?}
 */
Message.prototype.closable;
/**
 * Global messages module providing anything to do with global messages.
 *
 * @export
 */
export class GlobalMessagesModule {
}
GlobalMessagesModule.decorators = [
    { type: NgModule, args: [{
                imports: [CommonModule],
                exports: [GlobalMessagesComponent],
                declarations: [GlobalMessagesComponent],
            },] }
];

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2xvYmFsLW1lc3NhZ2VzLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHd5emVydXMvc3R5bGVzLyIsInNvdXJjZXMiOlsibGliL2NvbXBvbmVudHMvZ2xvYmFsLW1lc3NhZ2VzL2dsb2JhbC1tZXNzYWdlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNELE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQzs7Ozs7O0FBVy9DLE1BQU07SUFRSixpQkFBaUI7Ozs7Ozs7SUFRVixXQUFXO1FBQ2hCLE9BQU8sSUFBSSxDQUFDLFFBQVEsSUFBSSxJQUFJLENBQUMsUU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