(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("@angular/common"), require("@angular/core"), require("rxjs/Subject"));
	else if(typeof define === 'function' && define.amd)
		define(["@angular/common", "@angular/core", "rxjs/Subject"], factory);
	else if(typeof exports === 'object')
		exports["angular-notifier"] = factory(require("@angular/common"), require("@angular/core"), require("rxjs/Subject"));
	else
		root["angular-notifier"] = factory(root["@angular/common"], root["@angular/core"], root["rxjs/Subject"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_13__, __WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_14__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;
/******/
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// identity function for calling harmory imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };
/******/
/******/ 	// define getter function for harmory exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		Object.defineProperty(exports, name, {
/******/ 			configurable: false,
/******/ 			enumerable: true,
/******/ 			get: getter
/******/ 		});
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 15);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE_0__;

/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__models_notifier_config_model__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__notifier_queue_service__ = __webpack_require__(2);
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NotifierService; });




/**
 * Notifier service
 *
 * This service provides access to the public notifier API. Once injected into a component, directive, pipe, service, or any other building
 * block of an applications, it can be used to show new notifications, and hide existing ones. Internally, it transforms API calls into
 * actions, which then get thrown into the action queue - eventually being processed at the right moment.
 */
var NotifierService = (function () {
    /**
     * Constructor
     *
     * @param {NotifierQueueService} notifierQueueService Notifier queue service
     * @param {NotifierConfig}       config               Notifier configuration, optionally injected as a dependency
     */
    function NotifierService(notifierQueueService, config) {
        this.queueService = notifierQueueService;
        this.config = config === null ? new __WEBPACK_IMPORTED_MODULE_2__models_notifier_config_model__["a" /* NotifierConfig */]() : config; // Use custom config (if set), else create a default config
    }
    /**
     * Get the notifier configuration
     *
     * @returns {NotifierConfig} Notifier configuration
     */
    NotifierService.prototype.getConfig = function () {
        return this.config;
    };
    /**
     * API: Show a new notification
     *
     * @param {NotifierNotificationOptions} notificationOptions Notification options
     */
    NotifierService.prototype.show = function (notificationOptions) {
        this.queueService.push({
            payload: notificationOptions,
            type: __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].SHOW
        });
    };
    /**
     * API: Hide a specific notification, given its ID
     *
     * @param {string} notificationId ID of the notification to hide
     */
    NotifierService.prototype.hide = function (notificationId) {
        this.queueService.push({
            payload: notificationId,
            type: __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].HIDE
        });
    };
    /**
     * API: Hide the newest notification
     */
    NotifierService.prototype.hideNewest = function () {
        this.queueService.push({
            type: __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].HIDE_NEWEST
        });
    };
    /**
     * API: Hide the oldest notification
     */
    NotifierService.prototype.hideOldest = function () {
        this.queueService.push({
            type: __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].HIDE_OLDEST
        });
    };
    /**
     * API: Hide all notifications at once
     */
    NotifierService.prototype.hideAll = function () {
        this.queueService.push({
            type: __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].HIDE_ALL
        });
    };
    /**
     * API: Shortcut for showing a new notification
     *
     * @param {string} type             Type of the notification
     * @param {string} message          Message of the notification
     * @param {string} [notificationId] Unique ID for the notification (optional)
     */
    NotifierService.prototype.notify = function (type, message, notificationId) {
        var notificationOptions = {
            message: message,
            type: type
        };
        if (notificationId !== undefined) {
            notificationOptions.id = notificationId;
        }
        this.show(notificationOptions);
    };
    NotifierService.decorators = [
        { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
    ];
    /** @nocollapse */
    NotifierService.ctorParameters = function () { return [
        { type: __WEBPACK_IMPORTED_MODULE_3__notifier_queue_service__["a" /* NotifierQueueService */], },
        { type: __WEBPACK_IMPORTED_MODULE_2__models_notifier_config_model__["a" /* NotifierConfig */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
    ]; };
    return NotifierService;
}());


/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__);
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NotifierQueueService; });


/**
 * Notifier queue service
 *
 * In general, API calls don't get processed right away. Instead, we have to queue them up in order to prevent simultanious API calls
 * interfering with each other. This, at least in theory, is possible at any time. In particular, animations - which potentially overlap -
 * can cause changes in JS classes as well as affect the DOM. Therefore, the queue service takes all actions, puts them in a queue, and
 * processes them at the right time (which is when the previous action has been processed successfully).
 *
 * Technical sidenote:
 * An action looks pretty similar to the ones within the Flux / Redux pattern.
 */
var NotifierQueueService = (function () {
    /**
     * Constructor
     */
    function NotifierQueueService() {
        this.actionStream = new __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__["Subject"]();
        this.actionQueue = [];
        this.isActionInProgress = false;
    }
    /**
     * Push a new action to the queue, and try to run it
     *
     * @param {NotifierAction} action Action object
     */
    NotifierQueueService.prototype.push = function (action) {
        this.actionQueue.push(action);
        this.tryToRunNextAction();
    };
    /**
     * Continue with the next action (called when the current action is finished)
     */
    NotifierQueueService.prototype.continue = function () {
        this.isActionInProgress = false;
        this.tryToRunNextAction();
    };
    /**
     * Try to run the next action in the queue; we skip if there already is some action in progress, or if there is no action left
     */
    NotifierQueueService.prototype.tryToRunNextAction = function () {
        if (this.isActionInProgress || this.actionQueue.length === 0) {
            return; // Skip (the queue can now go drink a coffee as it has nothing to do anymore)
        }
        this.isActionInProgress = true;
        this.actionStream.next(this.actionQueue.shift()); // Push next action to the stream, and remove the current action from the queue
    };
    NotifierQueueService.decorators = [
        { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
    ];
    /** @nocollapse */
    NotifierQueueService.ctorParameters = function () { return []; };
    return NotifierQueueService;
}());


/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NotifierActionType; });
/**
 * Notifier action type
 */
var NotifierActionType;
(function (NotifierActionType) {
    NotifierActionType[NotifierActionType['SHOW'] = 0] = 'SHOW';
    NotifierActionType[NotifierActionType['HIDE'] = 1] = 'HIDE';
    NotifierActionType[NotifierActionType['HIDE_ALL'] = 2] = 'HIDE_ALL';
    NotifierActionType[NotifierActionType['HIDE_NEWEST'] = 3] = 'HIDE_NEWEST';
    NotifierActionType[NotifierActionType['HIDE_OLDEST'] = 4] = 'HIDE_OLDEST';
})(NotifierActionType || (NotifierActionType = {}));


/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__);
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NotifierConfig; });

/**
 * Notifier configuration
 *
 * The notifier configuration defines what notifications look like, how they behave, and how they get animated. It is a global
 * configuration, which means that it only can be set once (at the beginning), and cannot be changed afterwards. Aligning to the world of
 * Angular, this configuration can be provided in the root app module - alternatively, a meaningful default configuration will be used.
 */
var NotifierConfig = (function () {
    /**
     * Constructor
     *
     * @param {NotifierOptions} [customOptions={}] Custom notifier options, optional
     */
    function NotifierConfig(customOptions) {
        if (customOptions === void 0) { customOptions = {}; }
        // Set default values
        this.animations = {
            enabled: true,
            hide: {
                easing: 'ease',
                offset: 50,
                preset: 'fade',
                speed: 300
            },
            overlap: 150,
            shift: {
                easing: 'ease',
                speed: 300
            },
            show: {
                easing: 'ease',
                preset: 'slide',
                speed: 300
            }
        };
        this.behaviour = {
            autoHide: 7000,
            onClick: false,
            onMouseover: 'pauseAutoHide',
            showDismissButton: true,
            stacking: 4
        };
        this.position = {
            horizontal: {
                distance: 12,
                position: 'left'
            },
            vertical: {
                distance: 12,
                gap: 10,
                position: 'bottom'
            }
        };
        this.theme = 'material';
        // The following merges the custom options into the notifier config, respecting the already set default values
        // This linear, more explicit and code-sizy workflow is preferred here over a recursive one (because we know the object structure)
        // Technical sidenote: Objects are merged, other types of values simply overwritten / copied
        if (customOptions.theme !== undefined) {
            this.theme = customOptions.theme;
        }
        if (customOptions.animations !== undefined) {
            if (customOptions.animations.enabled !== undefined) {
                this.animations.enabled = customOptions.animations.enabled;
            }
            if (customOptions.animations.overlap !== undefined) {
                this.animations.overlap = customOptions.animations.overlap;
            }
            if (customOptions.animations.hide !== undefined) {
                Object.assign(this.animations.hide, customOptions.animations.hide);
            }
            if (customOptions.animations.shift !== undefined) {
                Object.assign(this.animations.shift, customOptions.animations.shift);
            }
            if (customOptions.animations.show !== undefined) {
                Object.assign(this.animations.show, customOptions.animations.show);
            }
        }
        if (customOptions.behaviour !== undefined) {
            Object.assign(this.behaviour, customOptions.behaviour);
        }
        if (customOptions.position !== undefined) {
            if (customOptions.position.horizontal !== undefined) {
                Object.assign(this.position.horizontal, customOptions.position.horizontal);
            }
            if (customOptions.position.vertical !== undefined) {
                Object.assign(this.position.vertical, customOptions.position.vertical);
            }
        }
    }
    NotifierConfig.decorators = [
        { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
    ];
    /** @nocollapse */
    NotifierConfig.ctorParameters = function () { return [
        null,
    ]; };
    return NotifierConfig;
}());


/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__animation_presets_fade_animation_preset__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__animation_presets_slide_animation_preset__ = __webpack_require__(8);
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NotifierAnimationService; });



/**
 * Notifier animation service
 */
var NotifierAnimationService = (function () {
    /**
     * Constructor
     */
    function NotifierAnimationService() {
        this.animationPresets = {
            fade: __WEBPACK_IMPORTED_MODULE_1__animation_presets_fade_animation_preset__["a" /* fade */],
            slide: __WEBPACK_IMPORTED_MODULE_2__animation_presets_slide_animation_preset__["a" /* slide */]
        };
    }
    /**
     * Get animation data
     *
     * This method generates all data the Web Animations API needs to animate our notification. The result depends on both the animation
     * direction (either in or out) as well as the notifications (and its attributes) itself.
     *
     * @param   {'show' | 'hide'}       direction    Animation direction, either in or out
     * @param   {NotifierNotification}  notification Notification the animation data should be generated for
     * @returns {NotifierAnimationData}              Animation information
     */
    NotifierAnimationService.prototype.getAnimationData = function (direction, notification) {
        // Get all necessary animation data
        var keyframes;
        var duration;
        var easing;
        if (direction === 'show') {
            keyframes = this.animationPresets[notification.component.getConfig().animations.show.preset].show(notification);
            duration = notification.component.getConfig().animations.show.speed;
            easing = notification.component.getConfig().animations.show.easing;
        }
        else {
            keyframes = this.animationPresets[notification.component.getConfig().animations.hide.preset].hide(notification);
            duration = notification.component.getConfig().animations.hide.speed;
            easing = notification.component.getConfig().animations.hide.easing;
        }
        // Build and return animation data
        return {
            keyframes: [
                keyframes.from,
                keyframes.to
            ],
            options: {
                duration: duration,
                easing: easing,
                fill: 'forwards' // Keep the newly painted state after the animation finished
            }
        };
    };
    NotifierAnimationService.decorators = [
        { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
    ];
    /** @nocollapse */
    NotifierAnimationService.ctorParameters = function () { return []; };
    return NotifierAnimationService;
}());


/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_common___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_common__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__angular_core__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_notifier_container_component__ = __webpack_require__(9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_notifier_notification_component__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__models_notifier_config_model__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__services_notifier_animation_service__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__services_notifier_queue_service__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__services_notifier_service__ = __webpack_require__(1);
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NotifierModule; });








/**
 * Notifier module
 */
var NotifierModule = (function () {
    function NotifierModule() {
    }
    /**
     * Setup custom module (service) configuration
     */
    NotifierModule.forRoot = function (options) {
        return {
            ngModule: NotifierModule,
            providers: [
                {
                    provide: __WEBPACK_IMPORTED_MODULE_4__models_notifier_config_model__["a" /* NotifierConfig */],
                    useValue: new __WEBPACK_IMPORTED_MODULE_4__models_notifier_config_model__["a" /* NotifierConfig */](options)
                }
            ]
        };
    };
    NotifierModule.decorators = [
        { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["NgModule"], args: [{
                    declarations: [
                        __WEBPACK_IMPORTED_MODULE_2__components_notifier_container_component__["a" /* NotifierContainerComponent */],
                        __WEBPACK_IMPORTED_MODULE_3__components_notifier_notification_component__["a" /* NotifierNotificationComponent */]
                    ],
                    exports: [
                        __WEBPACK_IMPORTED_MODULE_2__components_notifier_container_component__["a" /* NotifierContainerComponent */]
                    ],
                    imports: [
                        __WEBPACK_IMPORTED_MODULE_0__angular_common__["CommonModule"]
                    ],
                    providers: [
                        __WEBPACK_IMPORTED_MODULE_5__services_notifier_animation_service__["a" /* NotifierAnimationService */],
                        __WEBPACK_IMPORTED_MODULE_7__services_notifier_service__["a" /* NotifierService */],
                        __WEBPACK_IMPORTED_MODULE_6__services_notifier_queue_service__["a" /* NotifierQueueService */]
                    ]
                },] },
    ];
    /** @nocollapse */
    NotifierModule.ctorParameters = function () { return []; };
    return NotifierModule;
}());


/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return fade; });
/**
 * Fade animation preset
 */
var fade = {
    hide: function (notification) {
        return {
            from: {
                opacity: '1'
            },
            to: {
                opacity: '0'
            }
        };
    },
    show: function (notification) {
        return {
            from: {
                opacity: '0'
            },
            to: {
                opacity: '1'
            }
        };
    }
};


/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return slide; });
/**
 * Slide animation preset
 */
var slide = {
    hide: function (notification) {
        // Prepare variables
        var config = notification.component.getConfig();
        var shift = notification.component.getShift();
        var from;
        var to;
        // Configure variables, depending on configuration and component
        if (config.position.horizontal.position === 'left') {
            from = {
                transform: "translate3d( 0, " + shift + "px, 0 )"
            };
            to = {
                transform: "translate3d( calc( -100% - " + config.position.horizontal.distance + "px - 10px ), " + shift + "px, 0 )"
            };
        }
        else if (config.position.horizontal.position === 'right') {
            from = {
                transform: "translate3d( 0, " + shift + "px, 0 )"
            };
            to = {
                transform: "translate3d( calc( 100% + " + config.position.horizontal.distance + "px + 10px ), " + shift + "px, 0 )"
            };
        }
        else {
            var horizontalPosition = void 0;
            if (config.position.vertical.position === 'top') {
                horizontalPosition = "calc( -100% - " + config.position.horizontal.distance + "px - 10px )";
            }
            else {
                horizontalPosition = "calc( 100% + " + config.position.horizontal.distance + "px + 10px )";
            }
            from = {
                transform: "translate3d( -50%, " + shift + "px, 0 )"
            };
            to = {
                transform: "translate3d( -50%, " + horizontalPosition + ", 0 )"
            };
        }
        // Done
        return {
            from: from,
            to: to
        };
    },
    show: function (notification) {
        // Prepare variables
        var config = notification.component.getConfig();
        var from;
        var to;
        // Configure variables, depending on configuration and component
        if (config.position.horizontal.position === 'left') {
            from = {
                transform: "translate3d( calc( -100% - " + config.position.horizontal.distance + "px - 10px ), 0, 0 )"
            };
            to = {
                transform: 'translate3d( 0, 0, 0 )'
            };
        }
        else if (config.position.horizontal.position === 'right') {
            from = {
                transform: "translate3d( calc( 100% + " + config.position.horizontal.distance + "px + 10px ), 0, 0 )"
            };
            to = {
                transform: 'translate3d( 0, 0, 0 )'
            };
        }
        else {
            var horizontalPosition = void 0;
            if (config.position.vertical.position === 'top') {
                horizontalPosition = "calc( -100% - " + config.position.horizontal.distance + "px - 10px )";
            }
            else {
                horizontalPosition = "calc( 100% + " + config.position.horizontal.distance + "px + 10px )";
            }
            from = {
                transform: "translate3d( -50%, " + horizontalPosition + ", 0 )"
            };
            to = {
                transform: 'translate3d( -50%, 0, 0 )'
            };
        }
        // Done
        return {
            from: from,
            to: to
        };
    }
};


/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__models_notifier_notification_model__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_notifier_queue_service__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_notifier_service__ = __webpack_require__(1);
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NotifierContainerComponent; });





/**
 * Notifier container component
 * ----------------------------
 * This component acts as a wrapper for all notification components; consequently, it is responsible for creating a new notification
 * component and removing an existing notification component. Being more precicely, it also handles side effects of those actions, such as
 * shifting or even completely removing other notifications as well. Overall, this components handles actions coming from the queue service
 * by subscribing to its action stream.
 *
 * Technical sidenote:
 * This component has to be used somewhere in an application to work; it will not inject and create itself automatically, primarily in order
 * to not break the Angular AoT compilation. Moreover, this component (and also the notification components) set their change detection
 * strategy onPush, which means that we handle change detection manually in order to get the best performance. (#perfmatters)
 */
var NotifierContainerComponent = (function () {
    /**
     * Constructor
     *
     * @param {ChangeDetectorRef}    changeDetector       Change detector, used for manually triggering change detection runs
     * @param {NotifierQueueService} notifierQueueService Notifier queue service
     * @param {NotifierService}      notifierService      Notifier service
     */
    function NotifierContainerComponent(changeDetector, notifierQueueService, notifierService) {
        this.changeDetector = changeDetector;
        this.queueService = notifierQueueService;
        this.config = notifierService.getConfig();
        this.notifications = [];
    }
    /**
     * Component initialization lifecycle hook, connects this component to the action queue, and then handles incoming actions
     */
    NotifierContainerComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.queueServiceSubscription = this.queueService.actionStream.subscribe(function (action) {
            _this.handleAction(action).then(function () {
                _this.queueService.continue();
            });
        });
    };
    /**
     * Component destroyment lifecycle hook, cleans up the observable subsciption
     */
    NotifierContainerComponent.prototype.ngOnDestroy = function () {
        if (this.queueServiceSubscription) {
            this.queueServiceSubscription.unsubscribe();
        }
    };
    /**
     * Event handler, handles clicks on notification dismiss buttons
     *
     * @param {string} notificationId ID of the notification to dismiss
     */
    NotifierContainerComponent.prototype.onNotificationDismiss = function (notificationId) {
        this.queueService.push({
            payload: notificationId,
            type: __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].HIDE
        });
    };
    /**
     * Event handler, handles notification ready events
     *
     * @param {NotifierNotificationComponent} notificationComponent Notification component reference
     */
    NotifierContainerComponent.prototype.onNotificationReady = function (notificationComponent) {
        var currentNotification = this.notifications[this.notifications.length - 1]; // Get the latest notification
        currentNotification.component = notificationComponent; // Save the new omponent reference
        this.continueHandleShowAction(currentNotification); // Continue with handling the show action
    };
    /**
     * Handle incoming actions by mapping action types to methods, and then running them
     *
     * @param   {NotifierAction}     action Action object
     * @returns {Promise<undefined>}        Promise, resolved when done
     */
    NotifierContainerComponent.prototype.handleAction = function (action) {
        switch (action.type) {
            case __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].SHOW:
                return this.handleShowAction(action);
            case __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].HIDE:
                return this.handleHideAction(action);
            case __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].HIDE_OLDEST:
                return this.handleHideOldestAction(action);
            case __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].HIDE_NEWEST:
                return this.handleHideNewestAction(action);
            case __WEBPACK_IMPORTED_MODULE_1__models_notifier_action_model__["a" /* NotifierActionType */].HIDE_ALL:
                return this.handleHideAllAction(action);
            default:
                return new Promise(function (resolve, reject) {
                    resolve(); // Ignore unknown action types
                });
        }
    };
    /**
     * Show a new notification
     *
     * We simply add the notification to the list, and then wait until its properly initialized / created / rendered.
     *
     * @param   {NotifierAction}     action Action object
     * @returns {Promise<undefined>}        Promise, resolved when done
     */
    NotifierContainerComponent.prototype.handleShowAction = function (action) {
        var _this = this;
        return new Promise(function (resolve, reject) {
            _this.tempPromiseResolver = resolve; // Save the promise resolve function so that it can be called later on by another method
            _this.addNotificationToList(new __WEBPACK_IMPORTED_MODULE_2__models_notifier_notification_model__["a" /* NotifierNotification */](action.payload));
        });
    };
    /**
     * Continue to show a new notification (after the notification components is initialized / created / rendered).
     *
     * If this is the first (and thus only) notification, we can simply show it. Otherwhise, if stacking is disabled (or a low value), we
     * switch out notifications, in particular we hide the existing one, and then show our new one. Yet, if stacking is enabled, we first
     * shift all older notifications, and then show our new notification. In addition, if there are too many notification on the screen,
     * we hide the oldest one first. Furthermore, if configured, animation overlapping is applied.
     *
     * @param {NotifierNotification} notification New notification to show
     */
    NotifierContainerComponent.prototype.continueHandleShowAction = function (notification) {
        var _this = this;
        // First (which means only one) notification in the list?
        var numberOfNotifications = this.notifications.length;
        if (numberOfNotifications === 1) {
            notification.component.show().then(this.tempPromiseResolver); // Done
        }
        else {
            // Stacking enabled? (stacking value below 2 means stacking is disabled)
            if (this.config.behaviour.stacking === false || this.config.behaviour.stacking < 2) {
                this.notifications[0].component.hide().then(function () {
                    _this.removeNotificationFromList(_this.notifications[0]);
                    notification.component.show().then(_this.tempPromiseResolver); // Done
                });
            }
            else {
                var stepPromises_1 = [];
                // Are there now too many notifications?
                if (numberOfNotifications > this.config.behaviour.stacking) {
                    var oldNotifications_1 = this.notifications.slice(1, numberOfNotifications - 1);
                    // Are animations enabled?
                    if (this.config.animations.enabled) {
                        // Is animation overlap enabled?
                        if (this.config.animations.overlap !== false && this.config.animations.overlap > 0) {
                            stepPromises_1.push(this.notifications[0].component.hide());
                            setTimeout(function () {
                                stepPromises_1.push(_this.shiftNotifications(oldNotifications_1, notification.component.getHeight(), true));
                            }, this.config.animations.hide.speed - this.config.animations.overlap);
                            setTimeout(function () {
                                stepPromises_1.push(notification.component.show());
                            }, this.config.animations.hide.speed + this.config.animations.shift.speed - this.config.animations.overlap);
                        }
                        else {
                            stepPromises_1.push(new Promise(function (resolve, reject) {
                                _this.notifications[0].component.hide().then(function () {
                                    _this.shiftNotifications(oldNotifications_1, notification.component.getHeight(), true).then(function () {
                                        notification.component.show().then(resolve);
                                    });
                                });
                            }));
                        }
                    }
                    else {
                        stepPromises_1.push(this.notifications[0].component.hide());
                        stepPromises_1.push(this.shiftNotifications(oldNotifications_1, notification.component.getHeight(), true));
                        stepPromises_1.push(notification.component.show());
                    }
                }
                else {
                    var oldNotifications_2 = this.notifications.slice(0, numberOfNotifications - 1);
                    // Are animations enabled?
                    if (this.config.animations.enabled) {
                        // Is animation overlap enabled?
                        if (this.config.animations.overlap !== false && this.config.animations.overlap > 0) {
                            stepPromises_1.push(this.shiftNotifications(oldNotifications_2, notification.component.getHeight(), true));
                            setTimeout(function () {
                                stepPromises_1.push(notification.component.show());
                            }, this.config.animations.shift.speed - this.config.animations.overlap);
                        }
                        else {
                            stepPromises_1.push(new Promise(function (resolve, reject) {
                                _this.shiftNotifications(oldNotifications_2, notification.component.getHeight(), true).then(function () {
                                    notification.component.show().then(resolve);
                                });
                            }));
                        }
                    }
                    else {
                        stepPromises_1.push(this.shiftNotifications(oldNotifications_2, notification.component.getHeight(), true));
                        stepPromises_1.push(notification.component.show());
                    }
                }
                Promise.all(stepPromises_1).then(function () {
                    if (numberOfNotifications > _this.config.behaviour.stacking) {
                        _this.removeNotificationFromList(_this.notifications[0]);
                    }
                    _this.tempPromiseResolver();
                }); // Done
            }
        }
    };
    /**
     * Hide an existing notification
     *
     * Fist, we skip everything if there are no notifications at all, or the given notification does not exist. Then, we hide the given
     * notification. If there exist older notifications, we then shift them around to fill the gap. Once both hiding the given notification
     * and shifting the older notificaitons is done, the given notification gets finally removed (from the DOM).
     *
     * @param   {NotifierAction}     action Action object, payload contains the notification ID
     * @returns {Promise<undefined>}        Promise, resolved when done
     */
    NotifierContainerComponent.prototype.handleHideAction = function (action) {
        var _this = this;
        return new Promise(function (resolve, reject) {
            var stepPromises = [];
            // Does the notification exist / are there even any notifications? (let's prevent accidential errors)
            var notification = _this.findNotificationById(action.payload);
            if (notification === undefined) {
                resolve();
                return;
            }
            // Get older notifications
            var notificationIndex = _this.findNotificationIndexById(action.payload);
            if (notificationIndex === undefined) {
                resolve();
                return;
            }
            var oldNotifications = _this.notifications.slice(0, notificationIndex);
            // Do older notifications exist, and thus do we need to shift other notifications as a consequence?
            if (oldNotifications.length > 0) {
                // Are animations enabled?
                if (_this.config.animations.enabled && _this.config.animations.hide.speed > 0) {
                    // Is animation overlap enabled?
                    if (_this.config.animations.overlap !== false && _this.config.animations.overlap > 0) {
                        stepPromises.push(notification.component.hide());
                        setTimeout(function () {
                            stepPromises.push(_this.shiftNotifications(oldNotifications, notification.component.getHeight(), false));
                        }, _this.config.animations.hide.speed - _this.config.animations.overlap);
                    }
                    else {
                        notification.component.hide().then(function () {
                            stepPromises.push(_this.shiftNotifications(oldNotifications, notification.component.getHeight(), false));
                        });
                    }
                }
                else {
                    stepPromises.push(notification.component.hide());
                    stepPromises.push(_this.shiftNotifications(oldNotifications, notification.component.getHeight(), false));
                }
            }
            else {
                stepPromises.push(notification.component.hide());
            }
            // Wait until both hiding and shifting is done, then remove the notification from the list
            Promise.all(stepPromises).then(function () {
                _this.removeNotificationFromList(notification);
                resolve(); // Done
            });
        });
    };
    /**
     * Hide the oldest notification (bridge to handleHideAction)
     *
     * @param   {NotifierAction}     action Action object
     * @returns {Promise<undefined>}        Promise, resolved when done
     */
    NotifierContainerComponent.prototype.handleHideOldestAction = function (action) {
        // Are there any notifications? (prevent accidential errors)
        if (this.notifications.length === 0) {
            return new Promise(function (resolve, reject) {
                resolve();
            }); // Done
        }
        else {
            action.payload = this.notifications[0].id;
            return this.handleHideAction(action);
        }
    };
    /**
     * Hide the newest notification (bridge to handleHideAction)
     *
     * @param   {NotifierAction}     action Action object
     * @returns {Promise<undefined>}        Promise, resolved when done
     */
    NotifierContainerComponent.prototype.handleHideNewestAction = function (action) {
        // Are there any notifications? (prevent accidential errors)
        if (this.notifications.length === 0) {
            return new Promise(function (resolve, reject) {
                resolve();
            }); // Done
        }
        else {
            action.payload = this.notifications[this.notifications.length - 1].id;
            return this.handleHideAction(action);
        }
    };
    /**
     * Hide all notifications at once
     *
     * @param   {NotifierAction}     action Action object
     * @returns {Promise<undefined>}        Promise, resolved when done
     */
    NotifierContainerComponent.prototype.handleHideAllAction = function (action) {
        var _this = this;
        return new Promise(function (resolve, reject) {
            // Are there any notifications? (prevent accidential errors)
            var numberOfNotifications = _this.notifications.length;
            if (numberOfNotifications === 0) {
                resolve(); // Done
                return;
            }
            // Are animations enabled?
            if (_this.config.animations.enabled && _this.config.animations.hide.speed > 0 && _this.config.animations.hide.offset !== false &&
                _this.config.animations.hide.offset > 0) {
                var _loop_1 = function(i) {
                    var animationOffset = _this.config.position.vertical.position === 'top' ? numberOfNotifications - 1 : i;
                    setTimeout(function () {
                        _this.notifications[i].component.hide().then(function () {
                            // Are we done here, was this the last notification to be hidden?
                            if ((_this.config.position.vertical.position === 'top' && i === 0) ||
                                (_this.config.position.vertical.position === 'bottom' && i === numberOfNotifications - 1)) {
                                _this.removeAllNotificationsFromList();
                                resolve(); // Done
                            }
                        });
                    }, _this.config.animations.hide.offset * animationOffset);
                };
                for (var i = numberOfNotifications - 1; i >= 0; i--) {
                    _loop_1(i);
                }
            }
            else {
                var stepPromises = [];
                for (var i = numberOfNotifications - 1; i >= 0; i--) {
                    stepPromises.push(_this.notifications[i].component.hide());
                }
                Promise.all(stepPromises).then(function () {
                    _this.removeAllNotificationsFromList();
                    resolve(); // Done
                });
            }
        });
    };
    /**
     * Shift multiple notifications at once
     *
     * @param   {Array<NotifierNotification>} notifications List containing the notifications to be shifted
     * @param   {number}                      distance      Distance to shift (in px)
     * @param   {boolean}                     toMakePlace   Flag, defining in which direciton to shift
     * @returns {Promise<undefined>}                        Promise, resolved when done
     */
    NotifierContainerComponent.prototype.shiftNotifications = function (notifications, distance, toMakePlace) {
        return new Promise(function (resolve, reject) {
            // Are there any notifications to shift?
            if (notifications.length === 0) {
                resolve();
                return;
            }
            var notificationPromises = [];
            for (var i = notifications.length - 1; i >= 0; i--) {
                notificationPromises.push(notifications[i].component.shift(distance, toMakePlace));
            }
            Promise.all(notificationPromises).then(resolve); // Done
        });
    };
    /**
     * Add a new notification to the list of notifications (triggers change detection)
     *
     * @param {NotifierNotification} notification Notification to add to the list of notifications
     */
    NotifierContainerComponent.prototype.addNotificationToList = function (notification) {
        this.notifications.push(notification);
        this.changeDetector.markForCheck(); // Run change detection because the notification list changed
    };
    /**
     * Remove an existing notification from the list of notifications (triggers change detection)
     *
     * @param {NotifierNotification} notification Notification to be removed from the list of notifications
     */
    NotifierContainerComponent.prototype.removeNotificationFromList = function (notification) {
        this.notifications =
            this.notifications.filter(function (item) { return item.component !== notification.component; });
        this.changeDetector.markForCheck(); // Run change detection because the notification list changed
    };
    /**
     * Remove all notifications from the list (triggers change detection)
     */
    NotifierContainerComponent.prototype.removeAllNotificationsFromList = function () {
        this.notifications = [];
        this.changeDetector.markForCheck(); // Run change detection because the notification list changed
    };
    /**
     * Helper: Find a notification in the notification list by a given notification ID
     *
     * @param   {string}                           notificationId Notification ID, used for finding notification
     * @returns {NotifierNotification | undefined}                Notification, undefined if not found
     */
    NotifierContainerComponent.prototype.findNotificationById = function (notificationId) {
        return this.notifications.find(function (currentNotification) { return currentNotification.id === notificationId; });
    };
    /**
     * Helper: Find a notification's index by a given notification ID
     *
     * @param   {string}             notificationId Notification ID, used for finding a notification's index
     * @returns {number | undefined}                Notification index, undefined if not found
     */
    NotifierContainerComponent.prototype.findNotificationIndexById = function (notificationId) {
        var notificationIndex = this.notifications.findIndex(function (currentNotification) { return currentNotification.id === notificationId; });
        return (notificationIndex !== -1 ? notificationIndex : undefined);
    };
    NotifierContainerComponent.decorators = [
        { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                    changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                    host: {
                        class: 'x-notifier__container'
                    },
                    selector: 'x-notifier-container',
                    template: "<ul><li *ngFor=\"let notification of notifications; trackBy: notification?.id\" class=\"x-notifier__container-list\"><x-notifier-notification  (dismiss)=\"onNotificationDismiss( $event )\" (ready)=\"onNotificationReady( $event )\" [notification]=\"notification\"> </x-notifier-notification></ul>"
                },] },
    ];
    /** @nocollapse */
    NotifierContainerComponent.ctorParameters = function () { return [
        { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
        { type: __WEBPACK_IMPORTED_MODULE_3__services_notifier_queue_service__["a" /* NotifierQueueService */], },
        { type: __WEBPACK_IMPORTED_MODULE_4__services_notifier_service__["a" /* NotifierService */], },
    ]; };
    return NotifierContainerComponent;
}());


/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services_notifier_animation_service__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_notifier_service__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_notifier_timer_service__ = __webpack_require__(12);
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NotifierNotificationComponent; });




/**
 * Notifier notification component
 * -------------------------------
 * This component is responsible for actually displaying the notification on screen. In addition, it's able to show and hide this
 * notification, in particular to animate this notification in and out, as well as shift (move) this notification vertically around.
 * Furthermore, the notification component handles all interactions the user has with this notification / component, such as clicks and
 * mouse movements.
 */
var NotifierNotificationComponent = (function () {
    /**
     * Constructor
     *
     * @param {ElementRef}               elementRef               Reference to the component's element
     * @param {Renderer}                 renderer                 Angular renderer
     * @param {NotifierService}          notifierService          Notifier service
     * @param {NotifierTimerService}     notifierTimerService     Notifier timer service
     * @param {NotifierAnimationService} notifierAnimationService Notifier animation service
     */
    function NotifierNotificationComponent(elementRef, renderer, notifierService, notifierTimerService, notifierAnimationService) {
        this.config = notifierService.getConfig();
        this.ready = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.dismiss = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.timerService = notifierTimerService;
        this.animationService = notifierAnimationService;
        this.renderer = renderer;
        this.element = elementRef.nativeElement;
        this.elementShift = 0;
    }
    /**
     * Component after view init lifecycle hook, setts up the component and then emits the ready event
     */
    NotifierNotificationComponent.prototype.ngAfterViewInit = function () {
        this.setup();
        this.elementHeight = this.element.offsetHeight;
        this.elementWidth = this.element.offsetWidth;
        this.ready.emit(this);
    };
    /**
     * Get the notifier config
     *
     * @returns {NotifierConfig} Notifier configuration
     */
    NotifierNotificationComponent.prototype.getConfig = function () {
        return this.config;
    };
    /**
     * Get notification element height (in px)
     *
     * @returns {number} Notification element height (in px)
     */
    NotifierNotificationComponent.prototype.getHeight = function () {
        return this.elementHeight;
    };
    /**
     * Get notification element width (in px)
     *
     * @returns {number} Notification element height (in px)
     */
    NotifierNotificationComponent.prototype.getWidth = function () {
        return this.elementWidth;
    };
    /**
     * Get notification shift offset (in px)
     *
     * @returns {number} Notification element shift offset (in px)
     */
    NotifierNotificationComponent.prototype.getShift = function () {
        return this.elementShift;
    };
    /**
     * Show (animate in) this notification
     *
     * @returns {Promise<undefined>} Promise, resolved when done
     */
    NotifierNotificationComponent.prototype.show = function () {
        var _this = this;
        return new Promise(function (resolve, reject) {
            // Are animations enabled?
            if (_this.config.animations.enabled && _this.config.animations.show.speed > 0) {
                // Get animation data
                var animationData = _this.animationService.getAnimationData('show', _this.notification);
                // Set initial styles (styles before animation), prevents quick flicker when animation starts
                var animatedProperties = Object.keys(animationData.keyframes[0]);
                for (var i = animatedProperties.length - 1; i >= 0; i--) {
                    _this.setStyle(animatedProperties[i], animationData.keyframes[0][animatedProperties[i]]);
                }
                // Animate notification in
                _this.setStyle('visibility', 'visible');
                _this.element.animate(animationData.keyframes, animationData.options).finished.then(function () {
                    _this.startAutoHideTimer();
                    resolve(); // Done
                });
            }
            else {
                // Show notification
                _this.setStyle('visibility', 'visible');
                _this.startAutoHideTimer();
                resolve(); // Done
            }
        });
    };
    /**
     * Hide (animate out) this notification
     *
     * @returns {Promise<undefined>} Promise, resolved when done
     */
    NotifierNotificationComponent.prototype.hide = function () {
        var _this = this;
        return new Promise(function (resolve, reject) {
            _this.stopAutoHideTimer();
            // Are animations enabled?
            if (_this.config.animations.enabled && _this.config.animations.hide.speed > 0) {
                var animationData = _this.animationService.getAnimationData('hide', _this.notification);
                _this.element.animate(animationData.keyframes, animationData.options).finished.then(resolve); // Done
            }
            else {
                resolve(); // Done
            }
        });
    };
    /**
     * Shift (move) this notification
     *
     * @param   {number}             distance         Distance to shift (in px)
     * @param   {boolean}            shiftToMakePlace Flag, defining in which direction to shift
     * @returns {Promise<undefined>}                  Promise, resolved when done
     */
    NotifierNotificationComponent.prototype.shift = function (distance, shiftToMakePlace) {
        var _this = this;
        return new Promise(function (resolve, reject) {
            // Calculate new position (position after the shift)
            var newElementShift;
            if ((_this.config.position.vertical.position === 'top' && shiftToMakePlace)
                || (_this.config.position.vertical.position === 'bottom' && !shiftToMakePlace)) {
                newElementShift = _this.elementShift + distance + _this.config.position.vertical.gap;
            }
            else {
                newElementShift = _this.elementShift - distance - _this.config.position.vertical.gap;
            }
            var horizontalPosition = _this.config.position.horizontal.position === 'middle' ? '-50%' : '0';
            // Are animations enabled?
            if (_this.config.animations.enabled && _this.config.animations.shift.speed > 0) {
                var animationData = {
                    keyframes: [
                        {
                            transform: "translate3d( " + horizontalPosition + ", " + _this.elementShift + "px, 0 )"
                        },
                        {
                            transform: "translate3d( " + horizontalPosition + ", " + newElementShift + "px, 0 )"
                        }
                    ],
                    options: {
                        duration: _this.config.animations.shift.speed,
                        easing: _this.config.animations.shift.easing,
                        fill: 'forwards'
                    }
                };
                _this.elementShift = newElementShift;
                _this.element.animate(animationData.keyframes, animationData.options).finished.then(resolve); // Done
            }
            else {
                _this.setStyle('transform', "translate3d( " + horizontalPosition + ", " + newElementShift + "px, 0 )");
                _this.elementShift = newElementShift;
                resolve(); // Done
            }
        });
    };
    /**
     * Handle click on dismiss button
     */
    NotifierNotificationComponent.prototype.onClickDismiss = function () {
        this.dismiss.emit(this.notification.id);
    };
    /**
     * Handle mouseover over notification area
     */
    NotifierNotificationComponent.prototype.onNotificationMouseover = function () {
        if (this.config.behaviour.onMouseover === 'pauseAutoHide') {
            this.pauseAutoHideTimer();
        }
        else if (this.config.behaviour.onMouseover === 'resetAutoHide') {
            this.stopAutoHideTimer();
        }
    };
    /**
     * Handle mouseout from notification area
     */
    NotifierNotificationComponent.prototype.onNotificationMouseout = function () {
        if (this.config.behaviour.onMouseover === 'pauseAutoHide') {
            this.continueAutoHideTimer();
        }
        else if (this.config.behaviour.onMouseover === 'resetAutoHide') {
            this.startAutoHideTimer();
        }
    };
    /**
     * Handle click on notification area
     */
    NotifierNotificationComponent.prototype.onNotificationClick = function () {
        if (this.config.behaviour.onClick === 'hide') {
            this.onClickDismiss();
        }
    };
    /**
     * Start the auto hide timer (if enabled)
     */
    NotifierNotificationComponent.prototype.startAutoHideTimer = function () {
        var _this = this;
        if (this.config.behaviour.autoHide !== false && this.config.behaviour.autoHide > 0) {
            this.timerService.start(this.config.behaviour.autoHide).then(function () {
                _this.onClickDismiss();
            });
        }
    };
    /**
     * Pause the auto hide timer (if enabled)
     */
    NotifierNotificationComponent.prototype.pauseAutoHideTimer = function () {
        if (this.config.behaviour.autoHide !== false && this.config.behaviour.autoHide > 0) {
            this.timerService.pause();
        }
    };
    /**
     * Continue the auto hide timer (if enabled)
     */
    NotifierNotificationComponent.prototype.continueAutoHideTimer = function () {
        if (this.config.behaviour.autoHide !== false && this.config.behaviour.autoHide > 0) {
            this.timerService.continue();
        }
    };
    /**
     * Stop the auto hide timer (if enabled)
     */
    NotifierNotificationComponent.prototype.stopAutoHideTimer = function () {
        if (this.config.behaviour.autoHide !== false && this.config.behaviour.autoHide > 0) {
            this.timerService.stop();
        }
    };
    /**
     * Initial notification setup
     */
    NotifierNotificationComponent.prototype.setup = function () {
        // Set start position (initially the exact same for every new notification)
        if (this.config.position.horizontal.position === 'left') {
            this.setStyle('left', this.config.position.horizontal.distance + "px");
        }
        else if (this.config.position.horizontal.position === 'right') {
            this.setStyle('right', this.config.position.horizontal.distance + "px");
        }
        else {
            this.setStyle('left', '50%');
            this.setStyle('transform', 'translate3d( -50%, 0, 0 )'); // Let's get the GPU handle some work as well (#perfmatters)
        }
        if (this.config.position.vertical.position === 'top') {
            this.setStyle('top', this.config.position.vertical.distance + "px");
        }
        else {
            this.setStyle('bottom', this.config.position.vertical.distance + "px");
        }
        // Add classes (responsible for visual design)
        this.addClass("x-notifier__notification--" + this.notification.type);
        this.addClass("x-notifier__notification--" + this.config.theme);
    };
    /**
     * Helper: Set a notification element style
     *
     * @param {string} styleName  Name of the style
     * @param {string} styleValue Value of the style
     */
    NotifierNotificationComponent.prototype.setStyle = function (styleName, styleValue) {
        this.renderer.setElementStyle(this.element, styleName, styleValue);
    };
    /**
     * Helper: Add a class to the notification element
     *
     * @param {string} className Name of the class to add
     */
    NotifierNotificationComponent.prototype.addClass = function (className) {
        this.renderer.setElementClass(this.element, className, true);
    };
    NotifierNotificationComponent.decorators = [
        { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                    changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                    host: {
                        '(click)': 'onNotificationClick()',
                        '(mouseout)': 'onNotificationMouseout()',
                        '(mouseover)': 'onNotificationMouseover()',
                        class: 'x-notifier__notification'
                    },
                    providers: [
                        // We provide the timer to the component's local injector, so that every notification components gets its own
                        // instance of the timer service, thus running their timers independently from each other
                        __WEBPACK_IMPORTED_MODULE_3__services_notifier_timer_service__["a" /* NotifierTimerService */]
                    ],
                    selector: 'x-notifier-notification',
                    template: "<p class=\"x-notifier__notification-message\">{{ notification.message }}</p><button class=\"x-notifier__notification-button\" type=\"button\"  title=\"dismiss\" *ngIf=\"config.behaviour.showDismissButton\" (click)=\"onClickDismiss()\"><svg class=\"x-notifier__notification-button-icon\"  viewBox=\"0 0 24 24\" width=\"20\" height=\"20\"><path  d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg></button>"
                },] },
    ];
    /** @nocollapse */
    NotifierNotificationComponent.ctorParameters = function () { return [
        { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
        { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"], },
        { type: __WEBPACK_IMPORTED_MODULE_2__services_notifier_service__["a" /* NotifierService */], },
        { type: __WEBPACK_IMPORTED_MODULE_3__services_notifier_timer_service__["a" /* NotifierTimerService */], },
        { type: __WEBPACK_IMPORTED_MODULE_1__services_notifier_animation_service__["a" /* NotifierAnimationService */], },
    ]; };
    NotifierNotificationComponent.propDecorators = {
        'notification': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
        'ready': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
        'dismiss': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    };
    return NotifierNotificationComponent;
}());


/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NotifierNotification; });
/**
 * Notification
 *
 * This class describes the structure of a notifiction, including all information it needs to live, and everyone else needs to work with it.
 */
var NotifierNotification = (function () {
    /**
     * Constructor
     *
     * @param {NotifierNotificationOptions} options Notifier options
     */
    function NotifierNotification(options) {
        Object.assign(this, options);
        // If not set manually, we have to create a unique notification ID by ourselves. The ID generation relies on the current browser
        // datetime in ms, in praticular the moment this notification gets constructed. Concurrency, and thus two IDs being the exact same,
        // is not possible due to the action queue concept.
        if (options.id === undefined) {
            this.id = "ID_" + new Date().getTime();
        }
    }
    return NotifierNotification;
}());


/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__);
/* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return NotifierTimerService; });

/**
 * Notifier timer service
 *
 * This service acts as a timer, needed due to the still rather limited setTimeout JavaScript API. The timer service can start and stop a
 * timer. Furthermore, it can also pause the timer at any time, and resume later on. The timer API workd promise-based.
 */
var NotifierTimerService = (function () {
    /**
     * Constructor
     */
    function NotifierTimerService() {
        this.now = 0;
        this.remaining = 0;
    }
    /**
     * Start (or resume) the timer
     *
     * @param   {number}             duration Timer duration, in ms
     * @returns {Promise<undefined>}          Promise, resolved once the timer finishes
     */
    NotifierTimerService.prototype.start = function (duration) {
        var _this = this;
        return new Promise(function (resolve, reject) {
            // For the first run ...
            _this.remaining = duration;
            // Setup, then start the timer
            _this.finishPromiseResolver = resolve;
            _this.continue();
        });
    };
    /**
     * Pause the timer
     */
    NotifierTimerService.prototype.pause = function () {
        clearTimeout(this.timerId);
        this.remaining -= new Date().getTime() - this.now;
    };
    /**
     * Continue the timer
     */
    NotifierTimerService.prototype.continue = function () {
        var _this = this;
        this.now = new Date().getTime();
        this.timerId = setTimeout(function () {
            _this.finish();
        }, this.remaining);
    };
    /**
     * Stop the timer
     */
    NotifierTimerService.prototype.stop = function () {
        clearTimeout(this.timerId);
        this.remaining = 0;
    };
    /**
     * Finish up the timeout by resolving the timer promise
     */
    NotifierTimerService.prototype.finish = function () {
        this.finishPromiseResolver();
    };
    NotifierTimerService.decorators = [
        { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
    ];
    /** @nocollapse */
    NotifierTimerService.ctorParameters = function () { return []; };
    return NotifierTimerService;
}());


/***/ },
/* 13 */
/***/ function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE_13__;

/***/ },
/* 14 */
/***/ function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE_14__;

/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_notifier_module__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_services_notifier_service__ = __webpack_require__(1);
/* harmony reexport (binding) */ __webpack_require__.d(exports, "NotifierModule", function() { return __WEBPACK_IMPORTED_MODULE_0__src_notifier_module__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(exports, "NotifierService", function() { return __WEBPACK_IMPORTED_MODULE_1__src_services_notifier_service__["a"]; });




/***/ }
/******/ ]);
});
//# sourceMappingURL=angular-notifier.umd.map.js