(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/animations'), require('@angular/cdk/coercion'), require('@ng-tangram/components/core')) :
    typeof define === 'function' && define.amd ? define('@ng-tangram/components/callout', ['exports', '@angular/common', '@angular/core', '@angular/animations', '@angular/cdk/coercion', '@ng-tangram/components/core'], factory) :
    (global = global || self, factory((global.nt = global.nt || {}, global.nt.components = global.nt.components || {}, global.nt.components.callout = {}), global.ng.common, global.ng.core, global.ng.animations, global.ng.cdk.coercion, global.nt.components.core));
}(this, (function (exports, common, core, animations, coercion, core$1) { 'use strict';

    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var NtCalloutComponent = (function () {
        function NtCalloutComponent() {
            this.title = '';
            this.color = 'primary';
            this.size = 'medium';
            this.class = '';
            this._closed = false;
            this.close = new core.EventEmitter();
            this.fadeOut = false;
        }
        Object.defineProperty(NtCalloutComponent.prototype, "closed", {
            get: function () { return this._closed; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(NtCalloutComponent.prototype, "closable", {
            get: function () { return this._closable; },
            set: function (value) { this._closable = coercion.coerceBooleanProperty(value); },
            enumerable: true,
            configurable: true
        });
        NtCalloutComponent.prototype.onAnimationDone = function (event) {
            if (event.toState) {
                this._closed = true;
            }
        };
        NtCalloutComponent.prototype._close = function () {
            if (!this.fadeOut) {
                this.fadeOut = true;
                this.close.emit();
            }
        };
        __decorate([
            core.Input()
        ], NtCalloutComponent.prototype, "title", void 0);
        __decorate([
            core.Input()
        ], NtCalloutComponent.prototype, "color", void 0);
        __decorate([
            core.Input()
        ], NtCalloutComponent.prototype, "size", void 0);
        __decorate([
            core.Input()
        ], NtCalloutComponent.prototype, "class", void 0);
        __decorate([
            core.Input()
        ], NtCalloutComponent.prototype, "closable", null);
        __decorate([
            core.Output()
        ], NtCalloutComponent.prototype, "close", void 0);
        __decorate([
            core.HostBinding('@fadeOut')
        ], NtCalloutComponent.prototype, "fadeOut", void 0);
        __decorate([
            core.HostListener('@fadeOut.done', ['$event'])
        ], NtCalloutComponent.prototype, "onAnimationDone", null);
        NtCalloutComponent = __decorate([
            core.Component({
                selector: 'nt-callout',
                template: "\n    <h3 *ngIf=\"title\">{{title}}</h3>\n    <ng-content></ng-content>\n    <button *ngIf=\"this.closable\" (click)=\"_close()\" class=\"close-button\" type=\"button\">\n      <span aria-hidden=\"true\">&times;</span>\n    </button>\n  ",
                encapsulation: core.ViewEncapsulation.None,
                animations: [
                    animations.trigger('fadeOut', [
                        animations.transition('* => true', core$1.fadeOut(.3))
                    ])
                ],
                host: {
                    '[class]': '["callout nt-callout", color || "primary", size, class].join(" ")',
                    '[class.closed]': 'closed'
                }
            })
        ], NtCalloutComponent);
        return NtCalloutComponent;
    }());

    var __decorate$1 = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var NtCalloutModule = (function () {
        function NtCalloutModule() {
        }
        NtCalloutModule = __decorate$1([
            core.NgModule({
                imports: [common.CommonModule],
                exports: [NtCalloutComponent],
                declarations: [NtCalloutComponent],
            })
        ], NtCalloutModule);
        return NtCalloutModule;
    }());

    exports.NtCalloutComponent = NtCalloutComponent;
    exports.NtCalloutModule = NtCalloutModule;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=callout.umd.js.map
