angular.module("app").service("message",["$rootScope",function(e){if(window.dropperMessageService)return window.dropperMessageService;var s={messages:[],_message:function(s,n,r,o,i){var t={type:s,title:n,body:"string"==typeof r?r:JSON.stringify(r),time:o,created:new Date,allowHTML:!!i};if(this.messages.push(t),0!==o){var a=this;setTimeout((function(){e.$apply((function(){a.removeMessage(t)}))}),o)}e.$$phase||e.$apply()},error:function(e,s,n){this._message("error",e,s,"number"==typeof n?n:0,!1),console.log("Error: ",e,s)},warning:function(e,s,n){this._message("warning",e,s,"number"==typeof n?n:2e4,!1),console.log("Warning: ",e,s)},info:function(e,s,n){this._message("info",e,s,"number"==typeof n?n:6e3,!1)},success:function(e,s,n){this._message("success",e,s,"number"==typeof n?n:6e3,!1)},errorHTML:function(e,s,n){this._message("error",e,s,"number"==typeof n?n:0,!0),console.log("Error: ",e,s)},warningHTML:function(e,s,n){this._message("warning",e,s,"number"==typeof n?n:2e4,!0),console.log("Warning: ",e,s)},infoHTML:function(e,s,n){this._message("info",e,s,"number"==typeof n?n:6e3,!0)},successHTML:function(e,s,n){this._message("success",e,s,"number"==typeof n?n:6e3,!0)},removeMessage:function(e){var s=this.messages.indexOf(e);s>=0&&this.messages.splice(s,1)},init:function(){if(window.kk_backend_errors&&window.kk_backend_errors.length){for(var e=0;e<window.kk_backend_errors.length;e++){var s=window.kk_backend_errors[e];this.errorHTML(s.title,s.desc||"",0)}window.kk_backend_errors=[]}},notifyUpgrades:function(e){if(e&&e.messages)for(let s of e.messages)this._message(s.type,s.title,s.message,s.timeout,!0)}};return s.init(),window.dropperMessageService=s,s}]);