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EX,CArfD,CAqfG9I,OAAQC,S","sources":["webpack://apps/./node_modules/angularjs-toaster/toaster.js"],"sourcesContent":["/* global angular */\n/*\n * @license\n * AngularJS Toaster\n * Version: 3.0.0\n *\n * Copyright 2013-2019 Jiri Kavulak, Stabzs.\n * All Rights Reserved.\n * Use, reproduction, distribution, and modification of this code is subject to the terms and\n * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php\n *\n * Authors: Jiri Kavulak, Stabzs\n * Related to project of John Papa, Hans Fjällemark and Nguyễn Thiện Hùng (thienhung1989)\n*/\n(function(window, document) {\n 'use strict';\n\n angular.module('toaster', []).constant(\n 'toasterConfig', {\n 'limit': 0, // limits max number of toasts\n 'tap-to-dismiss': true,\n 'close-button': false,\n 'close-html': '',\n 'newest-on-top': true,\n 'time-out': 5000,\n 'icon-classes': {\n error: 'toast-error',\n info: 'toast-info',\n wait: 'toast-wait',\n success: 'toast-success',\n warning: 'toast-warning'\n },\n 'body-output-type': '', // Options: '', 'html', 'trustedHtml', 'template', 'templateWithData', 'directive'\n 'body-template': 'toasterBodyTmpl.html',\n 'icon-class': 'toast-info',\n 'position-class': 'toast-top-right', // Options (see CSS):\n // 'toast-top-full-width', 'toast-bottom-full-width', 'toast-center',\n // 'toast-top-left', 'toast-top-center', 'toast-top-right',\n // 'toast-bottom-left', 'toast-bottom-center', 'toast-bottom-right',\n 'title-class': 'toast-title',\n 'message-class': 'toast-message',\n 'prevent-duplicates': false,\n 'mouseover-timer-stop': true // stop timeout on mouseover and restart timer on mouseout\n }\n ).run(['$templateCache', function($templateCache) {\n $templateCache.put('angularjs-toaster/toast.html',\n '
' +\n '
' +\n '
' +\n '
{{toaster.title}}
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
{{toaster.body}}
' +\n '
' +\n '
' +\n '
');\n }\n ]).service(\n 'toaster', [\n '$rootScope', 'toasterConfig', function($rootScope, toasterConfig) {\n // http://stackoverflow.com/questions/26501688/a-typescript-guid-class\n var Guid = (function() {\n var Guid = {};\n Guid.newGuid = function() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n };\n return Guid;\n }());\n\n this.pop = function(type, title, body, timeout, bodyOutputType, clickHandler, toasterId, showCloseButton, toastId, onHideCallback) {\n if (angular.isObject(type)) {\n var params = type; // Enable named parameters as pop argument\n this.toast = {\n type: params.type,\n title: params.title,\n body: params.body,\n timeout: params.timeout,\n bodyOutputType: params.bodyOutputType,\n clickHandler: params.clickHandler,\n showCloseButton: params.showCloseButton,\n closeHtml: params.closeHtml,\n toastId: params.toastId,\n onShowCallback: params.onShowCallback,\n onHideCallback: params.onHideCallback,\n directiveData: params.directiveData,\n tapToDismiss: params.tapToDismiss\n };\n toasterId = params.toasterId;\n } else {\n this.toast = {\n type: type,\n title: title,\n body: body,\n timeout: timeout,\n bodyOutputType: bodyOutputType,\n clickHandler: clickHandler,\n showCloseButton: showCloseButton,\n toastId: toastId,\n onHideCallback: onHideCallback\n };\n }\n\n if (!this.toast.toastId || !this.toast.toastId.length) {\n this.toast.toastId = Guid.newGuid();\n }\n\n $rootScope.$emit('toaster-newToast', toasterId, this.toast.toastId);\n \n return {\n toasterId: toasterId,\n toastId: this.toast.toastId\n };\n };\n\n this.clear = function(toasterId, toastId) {\n if (angular.isObject(toasterId)) {\n $rootScope.$emit('toaster-clearToasts', toasterId.toasterId, toasterId.toastId);\n } else {\n $rootScope.$emit('toaster-clearToasts', toasterId, toastId);\n }\n };\n\n // Create one method per icon class, to allow to call toaster.info() and similar\n for (var type in toasterConfig['icon-classes']) {\n this[type] = createTypeMethod(type);\n }\n\n function createTypeMethod(toasterType) {\n return function(title, body, timeout, bodyOutputType, clickHandler, toasterId, showCloseButton, toastId, onHideCallback) {\n if (angular.isString(title)) {\n return this.pop(\n toasterType,\n title,\n body,\n timeout,\n bodyOutputType,\n clickHandler,\n toasterId,\n showCloseButton,\n toastId,\n onHideCallback);\n } else { // 'title' is actually an object with options\n return this.pop(angular.extend(title, { type: toasterType }));\n }\n };\n }\n }]\n ).factory(\n 'toasterEventRegistry', [\n '$rootScope', function($rootScope) {\n var deregisterNewToast = null, deregisterClearToasts = null, newToastEventSubscribers = [], clearToastsEventSubscribers = [], toasterFactory;\n\n toasterFactory = {\n setup: function() {\n if (!deregisterNewToast) {\n deregisterNewToast = $rootScope.$on(\n 'toaster-newToast', function(event, toasterId, toastId) {\n for (var i = 0, len = newToastEventSubscribers.length; i < len; i++) {\n newToastEventSubscribers[i](event, toasterId, toastId);\n }\n });\n }\n\n if (!deregisterClearToasts) {\n deregisterClearToasts = $rootScope.$on(\n 'toaster-clearToasts', function(event, toasterId, toastId) {\n for (var i = 0, len = clearToastsEventSubscribers.length; i < len; i++) {\n clearToastsEventSubscribers[i](event, toasterId, toastId);\n }\n });\n }\n },\n\n subscribeToNewToastEvent: function(onNewToast) {\n newToastEventSubscribers.push(onNewToast);\n },\n subscribeToClearToastsEvent: function(onClearToasts) {\n clearToastsEventSubscribers.push(onClearToasts);\n },\n unsubscribeToNewToastEvent: function(onNewToast) {\n var index = newToastEventSubscribers.indexOf(onNewToast);\n if (index >= 0) {\n newToastEventSubscribers.splice(index, 1);\n }\n\n if (newToastEventSubscribers.length === 0) {\n deregisterNewToast();\n deregisterNewToast = null;\n }\n },\n unsubscribeToClearToastsEvent: function(onClearToasts) {\n var index = clearToastsEventSubscribers.indexOf(onClearToasts);\n if (index >= 0) {\n clearToastsEventSubscribers.splice(index, 1);\n }\n\n if (clearToastsEventSubscribers.length === 0) {\n deregisterClearToasts();\n deregisterClearToasts = null;\n }\n }\n };\n return {\n setup: toasterFactory.setup,\n subscribeToNewToastEvent: toasterFactory.subscribeToNewToastEvent,\n subscribeToClearToastsEvent: toasterFactory.subscribeToClearToastsEvent,\n unsubscribeToNewToastEvent: toasterFactory.unsubscribeToNewToastEvent,\n unsubscribeToClearToastsEvent: toasterFactory.unsubscribeToClearToastsEvent\n };\n }]\n )\n .directive('directiveTemplate', ['$compile', '$injector', function($compile, $injector) {\n return {\n restrict: 'A',\n scope: {\n directiveName: '@directiveName',\n directiveData: '=directiveData'\n },\n replace: true,\n link: function(scope, elm, attrs) {\n scope.$watch('directiveName', function(directiveName) {\n if (angular.isUndefined(directiveName) || directiveName.length <= 0)\n throw new Error('A valid directive name must be provided via the toast body argument when using bodyOutputType: directive');\n\n var directive;\n\n try {\n directive = $injector.get(attrs.$normalize(directiveName) + 'Directive');\n } catch (e) {\n throw new Error(directiveName + ' could not be found. ' +\n 'The name should appear as it exists in the markup, not camelCased as it would appear in the directive declaration,' +\n ' e.g. directive-name not directiveName.');\n }\n\n\n var directiveDetails = directive[0];\n\n if (directiveDetails.scope !== true && directiveDetails.scope) {\n throw new Error('Cannot use a directive with an isolated scope. ' +\n 'The scope must be either true or falsy (e.g. false/null/undefined). ' +\n 'Occurred for directive ' + directiveName + '.');\n }\n\n if (directiveDetails.restrict.indexOf('A') < 0) {\n throw new Error('Directives must be usable as attributes. ' +\n 'Add \"A\" to the restrict option (or remove the option entirely). Occurred for directive ' +\n directiveName + '.');\n }\n\n if (scope.directiveData)\n scope.directiveData = angular.fromJson(scope.directiveData);\n\n var template = $compile('
')(scope);\n\n elm.append(template);\n });\n }\n };\n }])\n .directive(\n 'toasterContainer', [\n '$parse', '$rootScope', '$interval', '$sce', 'toasterConfig', 'toaster', 'toasterEventRegistry',\n function($parse, $rootScope, $interval, $sce, toasterConfig, toaster, toasterEventRegistry) {\n return {\n replace: true,\n restrict: 'EA',\n scope: true, // creates an internal scope for this directive (one per directive instance)\n link: function(scope, elm, attrs) {\n var mergedConfig;\n\n // Merges configuration set in directive with default one\n mergedConfig = angular.extend({}, toasterConfig, scope.$eval(attrs.toasterOptions));\n\n scope.config = {\n toasterId: mergedConfig['toaster-id'],\n position: mergedConfig['position-class'],\n title: mergedConfig['title-class'],\n message: mergedConfig['message-class'],\n tap: mergedConfig['tap-to-dismiss'],\n closeButton: mergedConfig['close-button'],\n closeHtml: mergedConfig['close-html'],\n animation: mergedConfig['animation-class'],\n mouseoverTimer: mergedConfig['mouseover-timer-stop']\n };\n\n scope.$on(\n \"$destroy\", function() {\n toasterEventRegistry.unsubscribeToNewToastEvent(scope._onNewToast);\n toasterEventRegistry.unsubscribeToClearToastsEvent(scope._onClearToasts);\n }\n );\n\n function setTimeout(toast, time) {\n toast.timeoutPromise = $interval(\n function() {\n scope.removeToast(toast.toastId);\n }, time, 1\n );\n }\n\n scope.configureTimer = function(toast) {\n var timeout = angular.isNumber(toast.timeout) ? toast.timeout : mergedConfig['time-out'];\n if (typeof timeout === \"object\") timeout = timeout[toast.type];\n if (timeout > 0) {\n setTimeout(toast, timeout);\n }\n };\n\n function addToast(toast, toastId) {\n toast.type = mergedConfig['icon-classes'][toast.type];\n if (!toast.type) {\n toast.type = mergedConfig['icon-class'];\n }\n\n if (mergedConfig['prevent-duplicates'] === true && scope.toasters.length) {\n if (scope.toasters[scope.toasters.length - 1].body === toast.body) {\n return;\n } else {\n var i, len, dupFound = false;\n for (i = 0, len = scope.toasters.length; i < len; i++) {\n if (scope.toasters[i].toastId === toastId) {\n dupFound = true;\n break;\n }\n }\n \n if (dupFound) return;\n }\n }\n\n\n // set the showCloseButton property on the toast so that\n // each template can bind directly to the property to show/hide\n // the close button\n var closeButton = mergedConfig['close-button'];\n\n // if toast.showCloseButton is a boolean value,\n // it was specifically overriden in the pop arguments\n if (typeof toast.showCloseButton === \"boolean\") {\n\n } else if (typeof closeButton === \"boolean\") {\n toast.showCloseButton = closeButton;\n } else if (typeof closeButton === \"object\") {\n var closeButtonForType = closeButton[toast.type];\n\n if (typeof closeButtonForType !== \"undefined\" && closeButtonForType !== null) {\n toast.showCloseButton = closeButtonForType;\n }\n } else {\n // if an option was not set, default to false.\n toast.showCloseButton = false;\n }\n\n if (toast.showCloseButton) {\n toast.closeHtml = $sce.trustAsHtml(toast.closeHtml || scope.config.closeHtml);\n }\n\n // Set the toast.bodyOutputType to the default if it isn't set\n toast.bodyOutputType = toast.bodyOutputType || mergedConfig['body-output-type'];\n switch (toast.bodyOutputType) {\n case 'trustedHtml':\n toast.html = $sce.trustAsHtml(toast.body);\n break;\n case 'template':\n toast.bodyTemplate = toast.body || mergedConfig['body-template'];\n break;\n case 'templateWithData':\n var fcGet = $parse(toast.body || mergedConfig['body-template']);\n var templateWithData = fcGet(scope);\n toast.bodyTemplate = templateWithData.template;\n toast.data = templateWithData.data;\n break;\n case 'directive':\n toast.html = toast.body;\n break;\n }\n\n scope.configureTimer(toast);\n\n if (mergedConfig['newest-on-top'] === true) {\n scope.toasters.unshift(toast);\n if (mergedConfig['limit'] > 0 && scope.toasters.length > mergedConfig['limit']) {\n removeToast(scope.toasters.length - 1);\n }\n } else {\n scope.toasters.push(toast);\n if (mergedConfig['limit'] > 0 && scope.toasters.length > mergedConfig['limit']) {\n removeToast(0);\n }\n }\n\n if (angular.isFunction(toast.onShowCallback)) {\n toast.onShowCallback(toast);\n }\n }\n\n scope.removeToast = function(toastId) {\n var i, len;\n for (i = 0, len = scope.toasters.length; i < len; i++) {\n if (scope.toasters[i].toastId === toastId) {\n removeToast(i);\n break;\n }\n }\n };\n\n function removeToast(toastIndex) {\n var toast = scope.toasters[toastIndex];\n\n // toast is always defined since the index always has a match\n if (toast.timeoutPromise) {\n $interval.cancel(toast.timeoutPromise);\n }\n scope.toasters.splice(toastIndex, 1);\n\n if (angular.isFunction(toast.onHideCallback)) {\n toast.onHideCallback(toast);\n }\n }\n\n function removeAllToasts(toastId) {\n for (var i = scope.toasters.length - 1; i >= 0; i--) {\n if (isUndefinedOrNull(toastId)) {\n removeToast(i);\n } else {\n if (scope.toasters[i].toastId == toastId) {\n removeToast(i);\n }\n }\n }\n }\n\n scope.toasters = [];\n\n function isUndefinedOrNull(val) {\n return angular.isUndefined(val) || val === null;\n }\n\n scope._onNewToast = function(event, toasterId, toastId) {\n // Compatibility: if toaster has no toasterId defined, and if call to display\n // hasn't either, then the request is for us\n if ((isUndefinedOrNull(scope.config.toasterId) && isUndefinedOrNull(toasterId)) || (!isUndefinedOrNull(scope.config.toasterId) && !isUndefinedOrNull(toasterId) && scope.config.toasterId == toasterId)) {\n addToast(toaster.toast, toastId);\n }\n };\n scope._onClearToasts = function(event, toasterId, toastId) {\n // Compatibility: if toaster has no toasterId defined, and if call to display\n // hasn't either, then the request is for us\n if (toasterId == '*' || (isUndefinedOrNull(scope.config.toasterId) && isUndefinedOrNull(toasterId)) || (!isUndefinedOrNull(scope.config.toasterId) && !isUndefinedOrNull(toasterId) && scope.config.toasterId == toasterId)) {\n removeAllToasts(toastId);\n }\n };\n\n toasterEventRegistry.setup();\n\n toasterEventRegistry.subscribeToNewToastEvent(scope._onNewToast);\n toasterEventRegistry.subscribeToClearToastsEvent(scope._onClearToasts);\n },\n controller: [\n '$scope', '$element', '$attrs', function($scope, $element, $attrs) {\n // Called on mouseover\n $scope.stopTimer = function(toast) {\n if ($scope.config.mouseoverTimer === true) {\n if (toast.timeoutPromise) {\n $interval.cancel(toast.timeoutPromise);\n toast.timeoutPromise = null;\n }\n }\n };\n\n // Called on mouseout\n $scope.restartTimer = function(toast) {\n if ($scope.config.mouseoverTimer === true) {\n if (!toast.timeoutPromise) {\n $scope.configureTimer(toast);\n }\n } else if (toast.timeoutPromise === null) {\n $scope.removeToast(toast.toastId);\n }\n };\n\n $scope.click = function(event, toast, isCloseButton) {\n event.stopPropagation();\n\n var tapToDismiss = typeof toast.tapToDismiss === \"boolean\" \n ? toast.tapToDismiss \n : $scope.config.tap;\n if (tapToDismiss === true || (toast.showCloseButton === true && isCloseButton === true)) {\n var removeToast = true;\n if (toast.clickHandler) {\n if (angular.isFunction(toast.clickHandler)) {\n removeToast = toast.clickHandler(toast, isCloseButton);\n } else if (angular.isFunction($scope.$parent.$eval(toast.clickHandler))) {\n removeToast = $scope.$parent.$eval(toast.clickHandler)(toast, isCloseButton);\n } else {\n console.log(\"TOAST-NOTE: Your click handler is not inside a parent scope of toaster-container.\");\n }\n }\n if (removeToast) {\n $scope.removeToast(toast.toastId);\n }\n }\n };\n }],\n templateUrl: 'angularjs-toaster/toast.html'\n };\n }]\n );\n})(window, document);\n"],"names":["window","document","angular","module","constant","error","info","wait","success","warning","run","$templateCache","put","service","$rootScope","toasterConfig","Guid","replace","c","r","Math","random","toString","type","this","pop","title","body","timeout","bodyOutputType","clickHandler","toasterId","showCloseButton","toastId","onHideCallback","isObject","params","toast","closeHtml","onShowCallback","directiveData","tapToDismiss","length","newGuid","$emit","clear","createTypeMethod","toasterType","isString","extend","factory","toasterFactory","deregisterNewToast","deregisterClearToasts","newToastEventSubscribers","clearToastsEventSubscribers","setup","$on","event","i","len","subscribeToNewToastEvent","onNewToast","push","subscribeToClearToastsEvent","onClearToasts","unsubscribeToNewToastEvent","index","indexOf","splice","unsubscribeToClearToastsEvent","directive","$compile","$injector","restrict","scope","directiveName","link","elm","attrs","$watch","isUndefined","Error","get","$normalize","e","directiveDetails","fromJson","template","append","$parse","$interval","$sce","toaster","toasterEventRegistry","mergedConfig","removeToast","toastIndex","toasters","timeoutPromise","cancel","isFunction","isUndefinedOrNull","val","$eval","toasterOptions","config","position","message","tap","closeButton","animation","mouseoverTimer","_onNewToast","_onClearToasts","configureTimer","isNumber","time","setTimeout","dupFound","closeButtonForType","trustAsHtml","html","bodyTemplate","templateWithData","fcGet","data","unshift","addToast","removeAllToasts","controller","$scope","$element","$attrs","stopTimer","restartTimer","click","isCloseButton","stopPropagation","$parent","console","log","templateUrl"],"sourceRoot":""}