define("app/directives/tasklist",["lodash","angular","cjt/util/locale","cjt/core"],(function(e,t,a,i){"use strict";t.module("App").directive("tasklist",(function(){return{replace:!0,restrict:"E",scope:{tasks:"="},templateUrl:i.buildFullPath("templates/task_queue_monitor/directives/tasklist.phtml"),controller:["$scope",function(i){e.assign(i,{isArray:t.isArray.bind(t),taskAttributeLabel:{time:a.maketext("Scheduled Time[comment,the time at which a task is scheduled to happen]"),command:a.maketext("Command"),timestamp:a.maketext("Enqueue Time[comment,the time at which a task was placed in the queue]"),pid:a.maketext("Process ID"),retries_remaining:a.maketext("Remaining Retries"),child_timeout:a.maketext("Child Timeout"),id:a.maketext("Task ID")},alwaysShow:{command:!0,timestamp:!0,time:!0,pid:!0}})}]}}))})),define("app/index",["lodash","angular","cjt/util/locale","cjt/core","cjt/io/eventsource","cjt/util/parse","cjt/modules","uiBootstrap"],(function(e,t,a,i,r){"use strict";var n=["waiting","processing","deferred"];function o(e){e.timestamp=a.local_datetime(parseInt(e.timestamp,10),"datetime_format_medium"),e.retries_remaining=a.numf(parseInt(e.retries_remaining,10)),e.child_timeout&&e.child_timeout>0&&(e.child_timeout=a.maketext("[quant,_1,second,seconds]",parseInt(e.child_timeout,10)));var t={};for(var i in e)null!==e[i]&&void 0!==e[i]&&(t[i]=e[i]);return t}return i.config.html5Mode=!1,function(){return t.module("App",["cjt2.config.whm.configProvider","ui.bootstrap","cjt2.whm","angular-growl"]),require(["cjt/bootstrap","uiBootstrap","app/directives/tasklist"],(function(i){var c=t.module("App");c.config(["$animateProvider",function(e){e.classNameFilter(/INeverWantThisToAnimate/)}]),c.controller("BaseController",["$rootScope","$scope","growl",function(t,i,c){function s(){i.last_update_descr=a.maketext("Last update received at: [local_datetime,_1,time_format_medium]",new Date),t.$apply()}i.LOCALE=a;var u=PAGE.security_token+"/sse/Tasks";r.create(u).then((function(t){var r,u=t.target;u.addEventListener("queue-update",(function(e){var t=JSON.parse(e.data);i.queue_count=0,n.forEach((function(e){t[e]=t[e].map(o),i.queue_count+=t[e].length})),i.queue=t,s()})),u.addEventListener("sched-update",(function(t){var r=JSON.parse(t.data);r=r.map((function(t){return e.assign({time:a.local_datetime(t.time,"datetime_format_medium")},o(t.task))})),i.sched=r,s()})),window.addEventListener("beforeunload",(function(e){r=!0})),u.onerror=function(e){r||c.error(a.maketext("An unknown [asis,EventSource] error occurred at [local_datetime,_1,time_format_short].",new Date))}})).catch((function(t){var a="Failed to connect ("+e.escape(u)+"): "+e.escape(t);c.error(a)}))}]),i()}))}}));