(function(_){typeof define=="function"&&define.amd?define(_):_()})(function(){"use strict";function _(t,u,F,e){if(!(t instanceof Error))throw t;if(!(typeof window>"u"&&u||e))throw t.message+=" on line "+F,t;var r,c,g,a;try{e=e||require("fs").readFileSync(u,{encoding:"utf8"}),r=3,c=e.split(`
`),g=Math.max(F-r,0),a=Math.min(c.length,F+r)}catch(n){return t.message+=" - could not read from "+u+" ("+n.message+")",void _(t,null,F)}r=c.slice(g,a).map(function(n,k){var s=k+g+1;return(s==F?"  > ":"    ")+s+"| "+n}).join(`
`),t.path=u;try{t.message=(u||"Pug")+":"+F+`
`+r+`

`+t.message}catch{}throw t}function E(t){var u="",F,e;try{e=1,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<div class="g-config-breadcrumb-container"></div>',e=3,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+"<p>",e=4,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+"Configure how Girder should connect to the celery worker.",e=5,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+`
`,e=5,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+"</p>",e=6,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<form id="g-worker-settings-form" role="form">',e=7,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<div class="form-group">',e=8,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<label class="control-label" for="g-worker-api-url">',e=8,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+"Alternative Girder API URL</label>",e=9,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<input class="input-sm form-control" id="g-worker-api-url" type="text" placeholder="API URL (default: auto-detected)"/></div>',e=11,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<div class="checkbox">',e=12,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<label class="control-label" for="g-worker-direct-path">',e=13,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<input id="g-worker-direct-path" type="checkbox"/>',e=14,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+"<span>",e=14,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+"When possible, send local file paths to the worker to avoid downloading files</span></label></div>",e=16,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<p class="g-validation-failed-message" id="g-worker-settings-error-message"></p>',e=17,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<input class="btn btn-sm btn-primary" type="submit" value="Save"/></form>',e=19,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+'<button class="q-worker-task-info btn btn-default" title="Task information" style="margin-top:10px;">',e=20,F="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/configView.pug",u=u+"Task information</button>"}catch(r){_(r,F,e)}return u}const V=girder.views.widgets.PluginConfigBreadcrumbWidget,S=girder.views.View,j=girder.events,{restRequest:m}=girder.rest,f=girder.router;var v=S.extend({events:{"submit #g-worker-settings-form":function(t){t.preventDefault(),this.$("#g-worker-settings-error-message").empty(),this._saveSettings([{key:"worker.api_url",value:this.$("#g-worker-api-url").val().trim()},{key:"worker.direct_path",value:this.$("#g-worker-direct-path").is(":checked")}])},"click .q-worker-task-info":function(t){f.navigate("#plugins/worker/task/status",{trigger:!0})}},initialize:function(){m({method:"GET",url:"system/setting",data:{list:JSON.stringify(["worker.api_url","worker.direct_path"])}}).done(t=>{this.render(),this.$("#g-worker-api-url").val(t["worker.api_url"]),this.$("#g-worker-direct-path").prop("checked",t["worker.direct_path"])})},render:function(){return this.$el.html(E()),this.breadcrumb||(this.breadcrumb=new V({pluginName:"Worker",el:this.$(".g-config-breadcrumb-container"),parentView:this})),this.breadcrumb.render(),this},_saveSettings:function(t){m({method:"PUT",url:"system/setting",data:{list:JSON.stringify(t)},error:null}).done(u=>{j.trigger("g:alert",{icon:"ok",text:"Settings saved.",type:"success",timeout:4e3})}).fail(u=>{this.$("#g-worker-settings-error-message").text(u.responseJSON.message)})}});function i(t){var u=""+t,F=y.exec(u);if(!F)return t;var e,r,c,g="";for(e=F.index,r=0;e<u.length;e++){switch(u.charCodeAt(e)){case 34:c="&quot;";break;case 38:c="&amp;";break;case 60:c="&lt;";break;case 62:c="&gt;";break;default:continue}r!==e&&(g+=u.substring(r,e)),r=e+1,g+=c}return r!==e?g+u.substring(r,e):g}var y=/["&<>]/;function h(t,u,F,e){if(!(t instanceof Error))throw t;if(!(typeof window>"u"&&u||e))throw t.message+=" on line "+F,t;var r,c,g,a;try{e=e||require("fs").readFileSync(u,{encoding:"utf8"}),r=3,c=e.split(`
`),g=Math.max(F-r,0),a=Math.min(c.length,F+r)}catch(n){return t.message+=" - could not read from "+u+" ("+n.message+")",void h(t,null,F)}r=c.slice(g,a).map(function(n,k){var s=k+g+1;return(s==F?"  > ":"    ")+s+"| "+n}).join(`
`),t.path=u;try{t.message=(u||"Pug")+":"+F+`
`+r+`

`+t.message}catch{}throw t}function T(t){var u="",F,e,r;try{var c=t||{};(function(g,a,n,k,s,O){r=1,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<h1 class="g-worker-status-header">',r=2,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"Global information about workers",r=3,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",n?(r=4,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<i class="icon-spin4 icon-spin"></i>'):(r=6,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<button class="g-worker-status-btn-reload">',r=7,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<i class="icon-arrows-cw"></i></button>'),u=u+"</h1>",r=9,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",n||(r=10,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<div class="g-worker-status-content">',r=11,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",a!==null?(r=12,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<p class="g-worker-status-no-worker-message">',r=13,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=a)==null?"":F)+"</p>"):(r=15,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<table class="g-worker-status-table">',r=16,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<tr>",r=17,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=17,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Name")==null?"":F)+"</th>",r=18,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=18,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Status")==null?"":F)+"</th>",r=19,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=19,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Max Concurrency")==null?"":F)+"</th>",r=20,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=20,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Accepted tasks")==null?"":F)+"</th>",r=21,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=21,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Running tasks")==null?"":F)+"</th>",r=22,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=22,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Completed tasks")==null?"":F)+"</th>",r=23,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=23,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Report")==null?"":F)+"</th></tr>",r=24,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",(function(){var o=s;if(typeof o.length=="number")for(var p=0,w=o.length;p<w;p++){var l=o[p];r=25,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<tr class="g-worker-task-status-link">',r=26,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=27,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.name)==null?"":F)+"</td>",r=28,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",l.ping==="pong"?(r=29,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=29,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Online")==null?"":F)+"</td>"):(r=31,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=31,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Offline")==null?"":F)+"</td>"),r=32,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=33,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.concurrency)==null?"":F)+"</td>",r=34,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=35,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.stats)==null?"":F)+"</td>",r=36,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=37,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.active.length)==null?"":F)+"</td>",r=38,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=39,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.stats-l.active.length)==null?"":F)+"</td>",r=40,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=41,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.report)==null?"":F)+"</td></tr>"}else{var w=0;for(var p in o){w++;var l=o[p];r=25,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<tr class="g-worker-task-status-link">',r=26,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=27,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.name)==null?"":F)+"</td>",r=28,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",l.ping==="pong"?(r=29,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=29,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Online")==null?"":F)+"</td>"):(r=31,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=31,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Offline")==null?"":F)+"</td>"),r=32,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=33,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.concurrency)==null?"":F)+"</td>",r=34,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=35,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.stats)==null?"":F)+"</td>",r=36,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=37,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.active.length)==null?"":F)+"</td>",r=38,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=39,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.stats-l.active.length)==null?"":F)+"</td>",r=40,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=41,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.report)==null?"":F)+"</td></tr>"}}}).call(this),u=u+"</table>",r=43,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",(g.length||k.length)&&(r=44,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<div class="g-worker-task-status">',r=45,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<h2 class="g-worker-status-header">',r=46,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=O)==null?"":F)+"</h2>",r=47,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",g.length&&(r=48,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<h3 class="g-worker-status-header">',r=49,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"Running Tasks</h3>",r=50,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<table class="g-worker-task-status-table">',r=51,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<tr>",r=52,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=52,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Name")==null?"":F)+"</th>",r=53,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=53,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="ID")==null?"":F)+"</th>",r=54,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=54,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Type")==null?"":F)+"</th>",r=55,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=55,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Time Start")==null?"":F)+"</th>",r=56,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=56,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Arguments")==null?"":F)+"</th>",r=57,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=57,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="KeyWord Arguments")==null?"":F)+"</th>",r=58,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=58,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Worker PID")==null?"":F)+"</th></tr>",r=59,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",(function(){var o=g;if(typeof o.length=="number")for(var p=0,w=o.length;p<w;p++){var l=o[p];r=60,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<tr>",r=61,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=62,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.name)==null?"":F)+"</td>",r=63,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=64,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.id)==null?"":F)+"</td>",r=65,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=66,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.type)==null?"":F)+"</td>",r=67,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=68,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.time_start)==null?"":F)+"</td>",r=69,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=70,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.args)==null?"":F)+"</td>",r=71,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=72,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.kwargs)==null?"":F)+"</td>",r=73,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=74,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.worker_pid)==null?"":F)+"</td></tr>"}else{var w=0;for(var p in o){w++;var l=o[p];r=60,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<tr>",r=61,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=62,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.name)==null?"":F)+"</td>",r=63,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=64,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.id)==null?"":F)+"</td>",r=65,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=66,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.type)==null?"":F)+"</td>",r=67,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=68,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.time_start)==null?"":F)+"</td>",r=69,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=70,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.args)==null?"":F)+"</td>",r=71,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=72,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.kwargs)==null?"":F)+"</td>",r=73,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=74,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.worker_pid)==null?"":F)+"</td></tr>"}}}).call(this),u=u+"</table>"),r=75,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",k.length&&(r=76,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<h3 class="g-worker-status-header">',r=77,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"Queued Tasks</h3>",r=78,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+'<table class="g-worker-task-status-table">',r=79,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<tr>",r=80,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=80,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Name")==null?"":F)+"</th>",r=81,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=81,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="ID")==null?"":F)+"</th>",r=82,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=82,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Type")==null?"":F)+"</th>",r=83,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=83,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Arguments")==null?"":F)+"</th>",r=84,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=84,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="KeyWord Arguments")==null?"":F)+"</th>",r=85,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=85,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Priority")==null?"":F)+"</th>",r=86,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<th>",r=86,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F="Redelivered")==null?"":F)+"</th></tr>",r=87,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",(function(){var o=k;if(typeof o.length=="number")for(var p=0,w=o.length;p<w;p++){var l=o[p];r=88,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<tr>",r=89,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=90,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.name)==null?"":F)+"</td>",r=91,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=92,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.id)==null?"":F)+"</td>",r=93,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=94,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.type)==null?"":F)+"</td>",r=95,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=96,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.args)==null?"":F)+"</td>",r=97,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=98,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.kwargs)==null?"":F)+"</td>",r=99,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=100,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.delivery_info.priority)==null?"":F)+"</td>",r=101,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=102,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.delivery_info.redelivered)==null?"":F)+"</td></tr>"}else{var w=0;for(var p in o){w++;var l=o[p];r=88,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<tr>",r=89,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=90,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.name)==null?"":F)+"</td>",r=91,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=92,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.id)==null?"":F)+"</td>",r=93,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=94,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.type)==null?"":F)+"</td>",r=95,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=96,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.args)==null?"":F)+"</td>",r=97,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=98,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.kwargs)==null?"":F)+"</td>",r=99,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=100,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.delivery_info.priority)==null?"":F)+"</td>",r=101,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+"<td>",r=102,e="/home/circleci/project/girder/plugins/worker/girder_plugin_worker/web_client/templates/taskStatusView.pug",u=u+i((F=l.delivery_info.redelivered)==null?"":F)+"</td></tr>"}}}).call(this),u=u+"</table>"),u=u+"</div>")),u=u+"</div>")}).call(this,"activeTasks"in c?c.activeTasks:typeof activeTasks<"u"?activeTasks:void 0,"errorMsg"in c?c.errorMsg:typeof errorMsg<"u"?errorMsg:void 0,"load"in c?c.load:typeof load<"u"?load:void 0,"reservedTasks"in c?c.reservedTasks:typeof reservedTasks<"u"?reservedTasks:void 0,"workerList"in c?c.workerList:typeof workerList<"u"?workerList:void 0,"workerName"in c?c.workerName:typeof workerName<"u"?workerName:void 0)}catch(g){h(g,e,r)}return u}const d=girder._,N=girder.views.View,{restRequest:$}=girder.rest;var R=N.extend({events:{"click .g-worker-status-btn-reload":function(){this._fetchWorkerStatus()},"click .g-worker-task-status-link":function(t){var u=t.target.parentElement,F=u.childNodes[0].innerText;d.each(this.workers,e=>{e.name===F&&(this.workerName=F,this.activeTaskList=e.active,this.reservedTaskList=e.reserved,this.render())})}},initialize:function(){this.errorMsg=null,this._fetchWorkerStatus()},render:function(){return this.$el.html(T({workerList:this.workers,load:this.load,workerName:this.workerName,activeTasks:this.activeTaskList,reservedTasks:this.reservedTaskList,errorMsg:this.errorMsg})),this},_fetchWorkerStatus:function(){this.workers=[],this.activeTaskList=[],this.reservedTaskList=[],this.load=!0,$({method:"GET",url:"worker/status"}).done(t=>{t===-1?this.errorMsg="The Broker is inaccessible.":(this.errorMsg=null,this.parseWorkerStatus(t.report,t.stats,t.ping,t.active,t.reserved)),this.load=!1,this.render()}),this.render()},parseWorkerStatus:function(t,u,F,e,r){var c=d.keys(t),g=null,a=null,n=null,k=null;d.each(c,s=>{d.has(t[s],"ok")&&(g=t[s].ok),u[s].total!==null&&(a=d.values(u[s].total)[0]),u[s].pool!==null&&(n=u[s].pool["max-concurrency"]),d.has(F[s],"ok")&&(k=F[s].ok),this.workers.push({name:s,report:g,stats:a|0,concurrency:n|0,ping:k,active:e[s]||[],reserved:r[s]})}),this.workers.length||(this.errorMsg="No task information.")}});const b=girder.router,C=girder.events,{exposePluginConfig:x}=girder.utilities.PluginUtils;x("worker","plugins/worker/config"),b.route("plugins/worker/config","workerConfig",function(){C.trigger("g:navigateTo",v)}),b.route("plugins/worker/task/status","workerTaskStatus",function(){C.trigger("g:navigateTo",R)}),girder.events.on("g:appload.before",()=>{const t=girder.plugins.jobs.JobStatus;t.registerStatus({WORKER_FETCHING_INPUT:{value:820,text:"Fetching input",icon:"icon-download",color:"#89d2e2"},WORKER_CONVERTING_INPUT:{value:821,text:"Converting input",icon:"icon-shuffle",color:"#92f5b5"},WORKER_CONVERTING_OUTPUT:{value:822,text:"Converting output",icon:"icon-shuffle",color:"#92f5b5"},WORKER_PUSHING_OUTPUT:{value:823,text:"Pushing output",icon:"icon-upload",color:"#89d2e2"},WORKER_CANCELING:{value:824,text:"Canceling",icon:"icon-spin3 animate-spin",color:"#f89406"}});const u=t.isCancelable;t.isCancelable=function(F){const e=F.get("handler");return e==="worker_handler"||e==="celery_handler"?[t.CANCELED,t.WORKER_CANCELING,t.SUCCESS,t.ERROR].indexOf(F.get("status"))===-1:u(F)}})});
