@hpcc-js/comms 2.102.2 → 2.102.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +43 -43
- package/README.md +50 -50
- package/dist/index.es6.js +2 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.node.js +2 -2
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.min.js +1 -1
- package/dist/index.node.min.js.map +1 -1
- package/lib-es6/__package__.js +2 -2
- package/package.json +4 -4
- package/src/__package__.ts +3 -3
- package/src/__tests__/dfuXRef.ts +22 -22
- package/src/__tests__/https.ts +69 -69
- package/src/__tests__/workunit.ts +35 -35
- package/src/clienttools/eclMeta.ts +506 -506
- package/src/clienttools/eclcc.ts +628 -628
- package/src/connection.ts +295 -295
- package/src/ecl/activity.ts +82 -82
- package/src/ecl/dfuWorkunit.ts +363 -363
- package/src/ecl/graph.ts +196 -196
- package/src/ecl/logicalFile.ts +195 -195
- package/src/ecl/machine.ts +63 -63
- package/src/ecl/query.ts +252 -252
- package/src/ecl/queryGraph.ts +813 -813
- package/src/ecl/resource.ts +39 -39
- package/src/ecl/result.ts +236 -236
- package/src/ecl/scope.ts +192 -192
- package/src/ecl/sourceFile.ts +34 -34
- package/src/ecl/store.ts +154 -154
- package/src/ecl/targetCluster.ts +149 -149
- package/src/ecl/timer.ts +42 -42
- package/src/ecl/topology.ts +131 -131
- package/src/ecl/workunit.ts +1314 -1314
- package/src/ecl/xsdParser.ts +268 -268
- package/src/espConnection.ts +172 -172
- package/src/index-common.ts +41 -41
- package/src/index.node.ts +68 -68
- package/src/index.ts +3 -3
- package/src/pem/trustwave.ts +909 -909
- package/src/services/fileSpray.ts +48 -48
- package/src/services/wsAccess.ts +8 -8
- package/src/services/wsAccount.ts +27 -27
- package/src/services/wsCloud.ts +73 -73
- package/src/services/wsCodesign.ts +94 -94
- package/src/services/wsDFU.ts +34 -34
- package/src/services/wsDFUXRef.ts +308 -308
- package/src/services/wsDali.ts +40 -40
- package/src/services/wsEcl.ts +123 -123
- package/src/services/wsElk.ts +8 -8
- package/src/services/wsLogaccess.ts +263 -263
- package/src/services/wsMachine.ts +89 -89
- package/src/services/wsPackageProcess.ts +8 -8
- package/src/services/wsResources.ts +8 -8
- package/src/services/wsSMC.ts +24 -24
- package/src/services/wsSasha.ts +7 -7
- package/src/services/wsStore.ts +230 -230
- package/src/services/wsTopology.ts +45 -45
- package/src/services/wsWorkunits.ts +160 -160
- package/src/services/wsdl/FileSpray/v1.23/FileSpray.ts +1008 -1008
- package/src/services/wsdl/FileSpray/v1.25/FileSpray.ts +1040 -1040
- package/src/services/wsdl/FileSpray/v1.26/FileSpray.ts +929 -929
- package/src/services/wsdl/WsCloud/v1/WsCloud.ts +38 -38
- package/src/services/wsdl/WsCloud/v1.02/WsCloud.ts +77 -77
- package/src/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.ts +224 -224
- package/src/services/wsdl/WsDali/v1.04/WsDali.ts +216 -216
- package/src/services/wsdl/WsDfu/v1.62/WsDfu.ts +1455 -1455
- package/src/services/wsdl/WsDfu/v1.63/WsDfu.ts +1465 -1465
- package/src/services/wsdl/WsDfu/v1.65/WsDfu.ts +1244 -1244
- package/src/services/wsdl/WsFileIO/v1.01/WsFileIO.ts +107 -107
- package/src/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.ts +519 -519
- package/src/services/wsdl/WsResources/v1.01/WsResources.ts +119 -119
- package/src/services/wsdl/WsSMC/v1.24/WsSMC.ts +665 -665
- package/src/services/wsdl/WsSMC/v1.27/WsSMC.ts +670 -670
- package/src/services/wsdl/WsTopology/v1.31/WsTopology.ts +856 -856
- package/src/services/wsdl/WsTopology/v1.32/WsTopology.ts +885 -885
- package/src/services/wsdl/WsWorkunits/v1.88/WsWorkunits.ts +2944 -2944
- package/src/services/wsdl/WsWorkunits/v1.94/WsWorkunits.ts +3072 -3072
- package/src/services/wsdl/WsWorkunits/v1.95/WsWorkunits.ts +3073 -3073
- package/src/services/wsdl/WsWorkunits/v1.97/WsWorkunits.ts +3134 -3134
- package/src/services/wsdl/WsWorkunits/v1.98/WsWorkunits.ts +3182 -3182
- package/src/services/wsdl/WsWorkunits/v1.99/WsWorkunits.ts +3162 -3162
- package/src/services/wsdl/WsWorkunits/v2/WsWorkunits.ts +3153 -3153
- package/src/services/wsdl/WsWorkunits/v2.02/WsWorkunits.ts +3157 -3157
- package/src/services/wsdl/ws_access/v1.16/ws_access.ts +1086 -1086
- package/src/services/wsdl/ws_access/v1.17/ws_access.ts +1023 -1023
- package/src/services/wsdl/ws_account/v1.05/ws_account.ts +111 -111
- package/src/services/wsdl/ws_account/v1.06/ws_account.ts +109 -109
- package/src/services/wsdl/ws_codesign/v1.1/ws_codesign.ts +100 -100
- package/src/services/wsdl/ws_elk/v1/ws_elk.ts +47 -47
- package/src/services/wsdl/ws_logaccess/v1/ws_logaccess.ts +83 -83
- package/src/services/wsdl/ws_logaccess/v1.02/ws_logaccess.ts +161 -161
- package/src/services/wsdl/ws_logaccess/v1.03/ws_logaccess.ts +190 -190
- package/src/services/wsdl/ws_logaccess/v1.04/ws_logaccess.ts +215 -215
- package/src/services/wsdl/ws_logaccess/v1.05/ws_logaccess.ts +219 -219
- package/src/services/wsdl/ws_logaccess/v1.08/ws_logaccess.ts +267 -267
- package/src/services/wsdl/ws_machine/v1.17/ws_machine.ts +567 -567
- package/src/services/wsdl/wsstore/v1.02/wsstore.ts +250 -250
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/util"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/comms"]={},e["@hpcc-js/util"])}(this,function(e,t){"use strict";var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},r="URLSearchParams"in n,o="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in n,u="ArrayBuffer"in n;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function p(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function d(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function y(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function g(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i)return this.blob().then(g);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,n,r,o,i=d(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=y(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=r?r[1]:"utf-8",t.readAsText(e,o),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(U)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=p(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},h.prototype.delete=function(e){delete this.map[p(e)]},h.prototype.get=function(e){return e=p(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(p(e))},h.prototype.set=function(e,t){this.map[p(e)]=l(t)},h.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},h.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),f(e)},h.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),f(e)},h.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),f(e)},o&&(h.prototype[Symbol.iterator]=h.prototype.entries);var v=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,o,i=(t=t||{}).body;if(e instanceof S){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new h(t.headers)),this.method=(r=t.method||this.method||"GET",o=r.toUpperCase(),v.indexOf(o)>-1?o:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var s=/([?&])_=[^&]*/;if(s.test(this.url))this.url=this.url.replace(s,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function U(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function _(e,t){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}S.prototype.clone=function(){return new S(this,{body:this._bodyInit})},m.call(S.prototype),m.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var P=[301,302,303,307,308];_.redirect=function(e,t){if(-1===P.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})};var D=n.DOMException;try{new D}catch(e){(D=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),D.prototype.constructor=D}function C(e,t){return new Promise(function(r,o){var s=new S(e,t);if(s.signal&&s.signal.aborted)return o(new D("Aborted","AbortError"));var c=new XMLHttpRequest;function a(){c.abort()}if(c.onload=function(){var e,t,n={statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();try{t.append(r,o)}catch(e){console.warn("Response "+e.message)}}}),t)};0===s.url.indexOf("file://")&&(c.status<200||c.status>599)?n.status=200:n.status=c.status,n.url="responseURL"in c?c.responseURL:n.headers.get("X-Request-URL");var o="response"in c?c.response:c.responseText;setTimeout(function(){r(new _(o,n))},0)},c.onerror=function(){setTimeout(function(){o(new TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(new TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){o(new D("Aborted","AbortError"))},0)},c.open(s.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?c.withCredentials=!0:"omit"===s.credentials&&(c.withCredentials=!1),"responseType"in c&&(i?c.responseType="blob":u&&(c.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof h||n.Headers&&t.headers instanceof n.Headers)){var f=[];Object.getOwnPropertyNames(t.headers).forEach(function(e){f.push(p(e)),c.setRequestHeader(e,l(t.headers[e]))}),s.headers.forEach(function(e,t){-1===f.indexOf(t)&&c.setRequestHeader(t,e)})}else s.headers.forEach(function(e,t){c.setRequestHeader(t,e)});s.signal&&(s.signal.addEventListener("abort",a),c.onreadystatechange=function(){4===c.readyState&&s.signal.removeEventListener("abort",a)}),c.send(void 0===s._bodyInit?null:s._bodyInit)})}C.polyfill=!0,n.fetch||(n.fetch=C,n.Headers=h,n.Request=S,n.Response=_);var R=function(e,t){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},R(e,t)};function j(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var W=function(){return W=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},W.apply(this,arguments)};function F(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,u)}c((r=r.apply(e,t||[])).next())})}function w(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function A(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var T=t.scopedLogger("comms/connection.ts");var O={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function L(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function E(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=""),n&&(n+="."),"object"!=typeof e)return L(e,t);var r=[],o=function(o){if(e.hasOwnProperty(o))if(e[o]instanceof Array){var i=!1;e[o].forEach(function(e,s){"object"==typeof e?(i=!0,r.push(E(e,t,n+L("".concat(o,".").concat(s),t)))):r.push(n+L("".concat(o,"_i").concat(s),t)+"="+E(e,t))}),i&&r.push(n+L("".concat(o,".itemcount"),t)+"="+e[o].length)}else"object"==typeof e[o]?e[o]&&e[o].Item instanceof Array?(r.push(E(e[o].Item,t,n+L(o,t))),r.push(n+L("".concat(o,".itemcount"),t)+"="+e[o].Item.length)):r.push(E(e[o],t,n+L(o,t))):void 0!==e[o]?r.push(n+L(o,t)+"="+L(e[o],t)):r.push(n+L(o,t))};for(var i in e)o(i);return r.join("&")}function x(e){return JSON.parse(e)}function I(e,n,r,o,i){return void 0===r&&(r={}),void 0===o&&(o="json"),i&&console.warn("Header attributes ignored for JSONP connections"),new Promise(function(i,s){var u=1e3*e.timeoutSecs,c="jsonp_callback_"+Math.round(999999*Math.random());window[c]=function(e){u=0,f(),i("json"===o&&"string"==typeof e?x(e):e)};var a=document.createElement("script"),p=t.join(e.baseUrl,n);p+=p.indexOf("?")>=0?"&":"?",a.src=p+"jsonp="+c+"&"+E(r,e.encodeRequest),document.body.appendChild(a);var l=setInterval(function(){u<=0?clearInterval(l):(u-=5e3)<=0?(clearInterval(l),T.error("Request timeout: "+a.src),f(),s(Error("Request timeout: "+a.src))):T.debug("Request pending ("+u/1e3+" sec): "+a.src)},5e3);function f(){delete window[c],document.body.removeChild(a)}})}var N={};function M(e,n,r,o,i){function s(e){if(e.ok)return"json"===i?e.json():e.text();throw new Error(e.statusText)}return o=W(W({},function(e){return e.userID?{Authorization:"Basic ".concat(btoa("".concat(e.userID,":").concat(e.password)))}:{}}(e)),o),r=W(W({credentials:N[e.baseUrl]?"omit":"include"},r),{headers:o}),fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):r.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(r.agent=fetch.__trustwaveAgent)),t.promiseTimeout(1e3*e.timeoutSecs,fetch(t.join(e.baseUrl,n),r).then(s).catch(function(o){return r.credentials=N[e.baseUrl]?"include":"omit",fetch(t.join(e.baseUrl,n),r).then(s).then(function(t){return N[e.baseUrl]=!N[e.baseUrl],t})}))}function k(e,t,n,r,o){var i;return void 0===r&&(r="json"),n.upload_&&(delete n.upload_,t+="?upload_"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),M(e,t,{method:"post",body:E(n,e.encodeRequest),signal:i},W({"Content-Type":"application/x-www-form-urlencoded"},o),r)}function G(e,t,n,r,o){var i;return void 0===r&&(r="json"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),M(e,"".concat(t,"?").concat(E(n,e.encodeRequest)),{method:"get",signal:i},W({},o),r)}function V(e,t,n,r,o){var i;switch(void 0===r&&(r="json"),e.type){case"jsonp":i=I(e,t,n,r,o);break;case"get":i=G(e,t,n,r,o);break;default:i=k(e,t,n,r,o)}return i}var Q=V;var B=function(){function e(e){this.opts(e)}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._opts.baseUrl},enumerable:!1,configurable:!0}),e.prototype.opts=function(e){return 0===arguments.length?this._opts:(this._opts=W(W({},O),e),this)},e.prototype.send=function(e,t,n,r){return void 0===n&&(n="json"),this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,Q,r):Q(this._opts,e,t,n,r)},e.prototype.clone=function(){return new e(this.opts())},e}();function X(e){return"[object Array]"===Object.prototype.toString.call(e)}e.createConnection=function(e){return new B(e)};var H=function(e){function t(t,n,r){var o=e.call(this,"ESPException: "+r.Source)||this;return o.isESPExceptions=!0,o.action=t,o.request=n,o.Source=r.Source,o.Exception=r.Exception,r.Exception.length?o.message="".concat(r.Exception[0].Code,": ").concat(r.Exception[0].Message):o.message="",o}return j(t,e),t}(Error);var J,q,z=function(){function n(t,n,r){this._connection=function(e){return void 0!==e.send}(t)?t:e.createConnection(t),this._service=n,this._version=r}return Object.defineProperty(n.prototype,"baseUrl",{get:function(){return this._connection.opts().baseUrl},enumerable:!1,configurable:!0}),n.prototype.service=function(e){return void 0===e?this._service:(this._service=e,this)},n.prototype.version=function(e){return void 0===e?this._version:(this._version=e,this)},n.prototype.toESPStringArray=function(e,t){if(X(e[t])){for(var n=0;n<e[t].length;++n)e[t+"_i"+n]=e[t][n];delete e[t]}return e},n.prototype.opts=function(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)},n.prototype.send=function(e,n,r,o,i,s){void 0===n&&(n={}),void 0===r&&(r="json"),void 0===o&&(o=!1);var u,c=W(W({},n),{ver_:this._version});o&&(c.upload_=!0),i&&(c.abortSignal_=i);var a="json";switch(r){case"text":u=t.join(this._service,e),a="text";break;case"xsd":u=t.join(this._service,e+".xsd"),a="text";break;case"json2":u=t.join(this._service,e+"/json"),r="json";var p=e.split("/");e=p.pop();break;default:u=t.join(this._service,e+".json")}return this._connection.send(u,c,a).then(function(t){if("json"===r){var n=void 0;if(t&&t.Exceptions)throw new H(e,c,t.Exceptions);if(t&&(n=t[s||e+"Response"]),!n)throw new H(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return n}return t}).catch(function(t){if(t.isESPExceptions)throw t;throw new H(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:t.message}]})})},n.prototype.clone=function(){return new n(this._connection.clone(),this._service,this._version)},n}(),K=function(){function e(e,t,n){this._connection=new z(e,t,n)}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._connection.opts().baseUrl},enumerable:!1,configurable:!0}),e.prototype.opts=function(){return this._connection.opts()},e.prototype.connection=function(){return this._connection.clone()},e}();e.FileSpray=void 0,J=e.FileSpray||(e.FileSpray={}),(q=J.DFUWUActions||(J.DFUWUActions={})).Delete="Delete",q.Protect="Protect",q.Unprotect="Unprotect",q.Restore="Restore",q.SetToFailed="SetToFailed",q.Archive="Archive";var Y,Z=function(e){function t(t){return e.call(this,t,"FileSpray","1.26")||this}return j(t,e),t.prototype.AbortDFUWorkunit=function(e){return this._connection.send("AbortDFUWorkunit",e,"json",!1,void 0,"AbortDFUWorkunitResponse")},t.prototype.Copy=function(e){return this._connection.send("Copy",e,"json",!1,void 0,"CopyResponse")},t.prototype.CreateDFUPublisherWorkunit=function(e){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")},t.prototype.CreateDFUWorkunit=function(e){return this._connection.send("CreateDFUWorkunit",e,"json",!1,void 0,"CreateDFUWorkunitResponse")},t.prototype.DFUWUFile=function(e){return this._connection.send("DFUWUFile",e,"json",!1,void 0,"DFUWUFileResponse")},t.prototype.DFUWUSearch=function(e){return this._connection.send("DFUWUSearch",e,"json",!1,void 0,"DFUWUSearchResponse")},t.prototype.DFUWorkunitsAction=function(e){return this._connection.send("DFUWorkunitsAction",e,"json",!1,void 0,"DFUWorkunitsActionResponse")},t.prototype.DeleteDFUWorkunit=function(e){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,void 0,"DeleteDFUWorkunitResponse")},t.prototype.DeleteDFUWorkunits=function(e){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,void 0,"DeleteDFUWorkunitsResponse")},t.prototype.DeleteDropZoneFiles=function(e){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,void 0,"DFUWorkunitsActionResponse")},t.prototype.Despray=function(e){return this._connection.send("Despray",e,"json",!1,void 0,"DesprayResponse")},t.prototype.DfuMonitor=function(e){return this._connection.send("DfuMonitor",e,"json",!1,void 0,"DfuMonitorResponse")},t.prototype.DropZoneFileSearch=function(e){return this._connection.send("DropZoneFileSearch",e,"json",!1,void 0,"DropZoneFileSearchResponse")},t.prototype.DropZoneFiles=function(e){return this._connection.send("DropZoneFiles",e,"json",!1,void 0,"DropZoneFilesResponse")},t.prototype.EchoDateTime=function(e){return this._connection.send("EchoDateTime",e,"json",!1,void 0,"EchoDateTimeResponse")},t.prototype.FileList=function(e){return this._connection.send("FileList",e,"json",!1,void 0,"FileListResponse")},t.prototype.GetDFUExceptions=function(e){return this._connection.send("GetDFUExceptions",e,"json",!1,void 0,"GetDFUExceptionsResponse")},t.prototype.GetDFUProgress=function(e){return this._connection.send("GetDFUProgress",e,"json",!1,void 0,"ProgressResponse")},t.prototype.GetDFUServerQueues=function(e){return this._connection.send("GetDFUServerQueues",e,"json",!1,void 0,"GetDFUServerQueuesResponse")},t.prototype.GetDFUWorkunit=function(e){return this._connection.send("GetDFUWorkunit",e,"json",!1,void 0,"GetDFUWorkunitResponse")},t.prototype.GetDFUWorkunits=function(e){return this._connection.send("GetDFUWorkunits",e,"json",!1,void 0,"GetDFUWorkunitsResponse")},t.prototype.GetRemoteTargets=function(e){return this._connection.send("GetRemoteTargets",e,"json",!1,void 0,"GetRemoteTargetsResponse")},t.prototype.GetSprayTargets=function(e){return this._connection.send("GetSprayTargets",e,"json",!1,void 0,"GetSprayTargetsResponse")},t.prototype.OpenSave=function(e){return this._connection.send("OpenSave",e,"json",!1,void 0,"OpenSaveResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"FileSprayPingResponse")},t.prototype.Rename=function(e){return this._connection.send("Rename",e,"json",!1,void 0,"RenameResponse")},t.prototype.Replicate=function(e){return this._connection.send("Replicate",e,"json",!1,void 0,"ReplicateResponse")},t.prototype.ShowResult=function(e){return this._connection.send("ShowResult",e,"json",!1,void 0,"ShowResultResponse")},t.prototype.SprayFixed=function(e){return this._connection.send("SprayFixed",e,"json",!1,void 0,"SprayFixedResponse")},t.prototype.SprayVariable=function(e){return this._connection.send("SprayVariable",e,"json",!1,void 0,"SprayResponse")},t.prototype.SubmitDFUWorkunit=function(e){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,void 0,"SubmitDFUWorkunitResponse")},t.prototype.UpdateDFUWorkunit=function(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")},t}(K);e.FileSprayStates=void 0,(Y=e.FileSprayStates||(e.FileSprayStates={}))[Y.unknown=0]="unknown",Y[Y.scheduled=1]="scheduled",Y[Y.queued=2]="queued",Y[Y.started=3]="started",Y[Y.aborted=4]="aborted",Y[Y.failed=5]="failed",Y[Y.finished=6]="finished",Y[Y.monitoring=7]="monitoring",Y[Y.aborting=8]="aborting",Y[Y.notfound=999]="notfound";var $,ee,te,ne,re,oe,ie=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.DFUWUFileEx=function(e){return this._connection.send("DFUWUFile",e,"text")},t.prototype.SprayFixedEx=function(e){return this._connection.send("SprayFixed",e)},t.prototype.SprayVariableEx=function(e){return this._connection.send("SprayVariable",e,"json",!1,null,"SprayResponse")},t.prototype.DesprayEx=function(e){return this._connection.send("Despray",e)},t.prototype.UpdateDFUWorkunitEx=function(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")},t}(Z);e.WsAccess=void 0,$=e.WsAccess||(e.WsAccess={}),(ee=$.ViewMemberType||($.ViewMemberType={})).User="User",ee.Group="Group",(te=$.UserSortBy||($.UserSortBy={})).username="username",te.fullname="fullname",te.passwordexpiration="passwordexpiration",te.employeeID="employeeID",te.employeeNumber="employeeNumber",(ne=$.GroupSortBy||($.GroupSortBy={})).Name="Name",ne.ManagedBy="ManagedBy",(re=$.AccountTypeReq||($.AccountTypeReq={})).Any="Any",re.User="User",re.Group="Group",(oe=$.ResourcePermissionSortBy||($.ResourcePermissionSortBy={})).Name="Name",oe.Type="Type",($.ResourceSortBy||($.ResourceSortBy={})).Name="Name";var se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"ws_access","1.17")||this}return j(t,e),t.prototype.AccountPermissions=function(e){return this._connection.send("AccountPermissions",e,"json",!1,void 0,"AccountPermissionsResponse")},t.prototype.AccountPermissionsV2=function(e){return this._connection.send("AccountPermissionsV2",e,"json",!1,void 0,"AccountPermissionsV2Response")},t.prototype.AddUser=function(e){return this._connection.send("AddUser",e,"json",!1,void 0,"AddUserResponse")},t.prototype.AddView=function(e){return this._connection.send("AddView",e,"json",!1,void 0,"AddViewResponse")},t.prototype.AddViewColumn=function(e){return this._connection.send("AddViewColumn",e,"json",!1,void 0,"AddViewColumnResponse")},t.prototype.AddViewMember=function(e){return this._connection.send("AddViewMember",e,"json",!1,void 0,"AddViewMemberResponse")},t.prototype.ClearPermissionsCache=function(e){return this._connection.send("ClearPermissionsCache",e,"json",!1,void 0,"ClearPermissionsCacheResponse")},t.prototype.DeleteView=function(e){return this._connection.send("DeleteView",e,"json",!1,void 0,"DeleteViewResponse")},t.prototype.DeleteViewColumn=function(e){return this._connection.send("DeleteViewColumn",e,"json",!1,void 0,"DeleteViewColumnResponse")},t.prototype.DeleteViewMember=function(e){return this._connection.send("DeleteViewMember",e,"json",!1,void 0,"DeleteViewMemberResponse")},t.prototype.DisableScopeScans=function(e){return this._connection.send("DisableScopeScans",e,"json",!1,void 0,"DisableScopeScansResponse")},t.prototype.EnableScopeScans=function(e){return this._connection.send("EnableScopeScans",e,"json",!1,void 0,"EnableScopeScansResponse")},t.prototype.FilePermission=function(e){return this._connection.send("FilePermission",e,"json",!1,void 0,"FilePermissionResponse")},t.prototype.GroupAction=function(e){return this._connection.send("GroupAction",e,"json",!1,void 0,"GroupActionResponse")},t.prototype.GroupAdd=function(e){return this._connection.send("GroupAdd",e,"json",!1,void 0,"GroupAddResponse")},t.prototype.GroupEdit=function(e){return this._connection.send("GroupEdit",e,"json",!1,void 0,"GroupEditResponse")},t.prototype.GroupMemberEdit=function(e){return this._connection.send("GroupMemberEdit",e,"json",!1,void 0,"GroupMemberEditResponse")},t.prototype.GroupMemberEditInput=function(e){return this._connection.send("GroupMemberEditInput",e,"json",!1,void 0,"GroupMemberEditInputResponse")},t.prototype.GroupMemberQuery=function(e){return this._connection.send("GroupMemberQuery",e,"json",!1,void 0,"GroupMemberQueryResponse")},t.prototype.GroupQuery=function(e){return this._connection.send("GroupQuery",e,"json",!1,void 0,"GroupQueryResponse")},t.prototype.Groups=function(e){return this._connection.send("Groups",e,"json",!1,void 0,"GroupResponse")},t.prototype.PermissionAction=function(e){return this._connection.send("PermissionAction",e,"json",!1,void 0,"PermissionActionResponse")},t.prototype.Permissions=function(e){return this._connection.send("Permissions",e,"json",!1,void 0,"BasednsResponse")},t.prototype.PermissionsReset=function(e){return this._connection.send("PermissionsReset",e,"json",!1,void 0,"PermissionsResetResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accessPingResponse")},t.prototype.QueryScopeScansEnabled=function(e){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,void 0,"QueryScopeScansEnabledResponse")},t.prototype.QueryUserViewColumns=function(e){return this._connection.send("QueryUserViewColumns",e,"json",!1,void 0,"QueryUserViewColumnsResponse")},t.prototype.QueryViewColumns=function(e){return this._connection.send("QueryViewColumns",e,"json",!1,void 0,"QueryViewColumnsResponse")},t.prototype.QueryViewMembers=function(e){return this._connection.send("QueryViewMembers",e,"json",!1,void 0,"QueryViewMembersResponse")},t.prototype.QueryViews=function(e){return this._connection.send("QueryViews",e,"json",!1,void 0,"QueryViewsResponse")},t.prototype.ResourceAdd=function(e){return this._connection.send("ResourceAdd",e,"json",!1,void 0,"ResourceAddResponse")},t.prototype.ResourceDelete=function(e){return this._connection.send("ResourceDelete",e,"json",!1,void 0,"ResourceDeleteResponse")},t.prototype.ResourcePermissionQuery=function(e){return this._connection.send("ResourcePermissionQuery",e,"json",!1,void 0,"ResourcePermissionQueryResponse")},t.prototype.ResourcePermissions=function(e){return this._connection.send("ResourcePermissions",e,"json",!1,void 0,"ResourcePermissionsResponse")},t.prototype.ResourceQuery=function(e){return this._connection.send("ResourceQuery",e,"json",!1,void 0,"ResourceQueryResponse")},t.prototype.Resources=function(e){return this._connection.send("Resources",e,"json",!1,void 0,"ResourcesResponse")},t.prototype.UserAccountExport=function(e){return this._connection.send("UserAccountExport",e,"json",!1,void 0,"UserAccountExportResponse")},t.prototype.UserAction=function(e){return this._connection.send("UserAction",e,"json",!1,void 0,"UserActionResponse")},t.prototype.UserEdit=function(e){return this._connection.send("UserEdit",e,"json",!1,void 0,"UserEditResponse")},t.prototype.UserGroupEdit=function(e){return this._connection.send("UserGroupEdit",e,"json",!1,void 0,"UserGroupEditResponse")},t.prototype.UserGroupEditInput=function(e){return this._connection.send("UserGroupEditInput",e,"json",!1,void 0,"UserGroupEditInputResponse")},t.prototype.UserInfoEdit=function(e){return this._connection.send("UserInfoEdit",e,"json",!1,void 0,"UserInfoEditResponse")},t.prototype.UserInfoEditInput=function(e){return this._connection.send("UserInfoEditInput",e,"json",!1,void 0,"UserInfoEditInputResponse")},t.prototype.UserPosix=function(e){return this._connection.send("UserPosix",e,"json",!1,void 0,"UserPosixResponse")},t.prototype.UserPosixInput=function(e){return this._connection.send("UserPosixInput",e,"json",!1,void 0,"UserPosixInputResponse")},t.prototype.UserQuery=function(e){return this._connection.send("UserQuery",e,"json",!1,void 0,"UserQueryResponse")},t.prototype.UserResetPass=function(e){return this._connection.send("UserResetPass",e,"json",!1,void 0,"UserResetPassResponse")},t.prototype.UserResetPassInput=function(e){return this._connection.send("UserResetPassInput",e,"json",!1,void 0,"UserResetPassInputResponse")},t.prototype.UserSudoers=function(e){return this._connection.send("UserSudoers",e,"json",!1,void 0,"UserSudoersResponse")},t.prototype.UserSudoersInput=function(e){return this._connection.send("UserSudoersInput",e,"json",!1,void 0,"UserSudoersInputResponse")},t.prototype.Users=function(e){return this._connection.send("Users",e,"json",!1,void 0,"UserResponse")},t}(K)),ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.VerifyUser=function(e){return this._connection.send("VerifyUser",e).catch(function(e){if(e.isESPExceptions&&e.Exception.some(function(e){return 20043===e.Code}))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:e.Exception}};throw e})},t}(function(e){function t(t){return e.call(this,t,"ws_account","1.06")||this}return j(t,e),t.prototype.MyAccount=function(e){return this._connection.send("MyAccount",e,"json",!1,void 0,"MyAccountResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accountPingResponse")},t.prototype.UpdateUser=function(e){return this._connection.send("UpdateUser",e,"json",!1,void 0,"UpdateUserResponse")},t.prototype.UpdateUserInput=function(e){return this._connection.send("UpdateUserInput",e,"json",!1,void 0,"UpdateUserInputResponse")},t.prototype.VerifyUser=function(e){return this._connection.send("VerifyUser",e,"json",!1,void 0,"VerifyUserResponse")},t}(K)),ce=function(e){function t(t){return e.call(this,t,"WsCloud","1.02")||this}return j(t,e),t.prototype.GetPODs=function(e){return this._connection.send("GetPODs",e,"json",!1,void 0,"GetPODsResponse")},t.prototype.GetServices=function(e){return this._connection.send("GetServices",e,"json",!1,void 0,"GetServicesResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsCloudPingResponse")},t}(K),ae=t.scopedLogger("@hpcc-js/comms/services/wsCloud.ts");function pe(e){var t,n,r;return null!==(r=null===(n=null===(t=e.spec)||void 0===t?void 0:t.containers)||void 0===n?void 0:n.reduce(function(e,t){var n;return null===(n=t.ports)||void 0===n||n.forEach(function(t){e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e},[]))&&void 0!==r?r:[]}var le,fe,he,de,ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.getPODs=function(){return e.prototype.GetPODs.call(this,{}).then(function(e){var t,n,r;if(function(e){return void 0!==(null==e?void 0:e.Pods)}(e))return null!==(n=null===(t=e.Pods)||void 0===t?void 0:t.Pod)&&void 0!==n?n:[];try{var o="string"==typeof e.Result?JSON.parse(e.Result):e.Result;return(null!==(r=null==o?void 0:o.items)&&void 0!==r?r:[]).filter(function(e){var t,n,r=null!==(n=null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.labels)&&void 0!==n?n:{};return r.hasOwnProperty("app.kubernetes.io/part-of")&&"HPCC-Platform"===r["app.kubernetes.io/part-of"]}).map(function(e){var t,n,r,o,i,s,u,c,a,p,l,f,h=new Date(null===(t=e.metadata)||void 0===t?void 0:t.creationTimestamp);return{Name:e.metadata.name,Status:null===(n=e.status)||void 0===n?void 0:n.phase,CreationTimestamp:h.toISOString(),ContainerName:null!==(i=null===(o=null===(r=e.status)||void 0===r?void 0:r.containerStatuses)||void 0===o?void 0:o.reduce(function(e,t){return t.name&&e.push(t.name),e},[]).join(", "))&&void 0!==i?i:"",ContainerCount:null!==(c=null===(u=null===(s=e.spec)||void 0===s?void 0:s.containers)||void 0===u?void 0:u.length)&&void 0!==c?c:0,ContainerReadyCount:null===(p=null===(a=e.status)||void 0===a?void 0:a.containerStatuses)||void 0===p?void 0:p.reduce(function(e,t){return e+(t.ready?1:0)},0),ContainerRestartCount:null===(f=null===(l=e.status)||void 0===l?void 0:l.containerStatuses)||void 0===f?void 0:f.reduce(function(e,t){return e+t.restartCount},0),Ports:{Port:pe(e)}}})}catch(e){return ae.error("Error parsing V1Pods json '".concat(e.message,"'")),[]}})},t}(ce),ge=function(){function e(e){this._connection=new z(e,"ws_codesign","1.1")}return e.prototype.connectionOptions=function(){return this._connection.opts()},e.prototype.ListUserIDs=function(e){return this._connection.send("ListUserIDs",e).then(function(e){return e.UserIDs.Item}).catch(function(e){return[]})},e.prototype.Sign=function(e){return this._connection.send("Sign",W({SigningMethod:"gpg"},e))},e.prototype.Verify=function(e){return this._connection.send("Verify",e)},e}(),be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.Export=function(e){return F(this,void 0,void 0,function(){var t,n,r,o;return w(this,function(i){switch(i.label){case 0:return t=new URLSearchParams,e.Path&&t.append("Path",e.Path),void 0!==e.Safe&&t.append("Safe",String(e.Safe)),[4,fetch("".concat("/WsDali/Export","?").concat(t.toString()))];case 1:return n=i.sent(),r=n.headers.get("Content-Disposition"),[4,n.blob()];case 2:return o=i.sent(),[2,{filename:r?r.split("filename=")[1]:"WsDali_Export",content:o}]}})})},t}(function(e){function t(t){return e.call(this,t,"WSDali","1.07")||this}return j(t,e),t.prototype.Add=function(e){return this._connection.send("Add",e,"json",!1,void 0,"ResultResponse")},t.prototype.ClearTraceTransactions=function(e){return this._connection.send("ClearTraceTransactions",e,"json",!1,void 0,"ResultResponse")},t.prototype.Count=function(e){return this._connection.send("Count",e,"json",!1,void 0,"CountResponse")},t.prototype.DFSCheck=function(e){return this._connection.send("DFSCheck",e,"json",!1,void 0,"ResultResponse")},t.prototype.DFSExists=function(e){return this._connection.send("DFSExists",e,"json",!1,void 0,"BooleanResponse")},t.prototype.DFSLS=function(e){return this._connection.send("DFSLS",e,"json",!1,void 0,"ResultResponse")},t.prototype.Delete=function(e){return this._connection.send("Delete",e,"json",!1,void 0,"ResultResponse")},t.prototype.DisconnectClientConnection=function(e){return this._connection.send("DisconnectClientConnection",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetClients=function(e){return this._connection.send("GetClients",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetConnections=function(e){return this._connection.send("GetConnections",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetDFSCSV=function(e){return this._connection.send("GetDFSCSV",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetDFSMap=function(e){return this._connection.send("GetDFSMap",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetDFSParents=function(e){return this._connection.send("GetDFSParents",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetLogicalFile=function(e){return this._connection.send("GetLogicalFile",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetLogicalFilePart=function(e){return this._connection.send("GetLogicalFilePart",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetProtectedList=function(e){return this._connection.send("GetProtectedList",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetSDSStats=function(e){return this._connection.send("GetSDSStats",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetSDSSubscribers=function(e){return this._connection.send("GetSDSSubscribers",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetValue=function(e){return this._connection.send("GetValue",e,"json",!1,void 0,"ResultResponse")},t.prototype.Import=function(e){return this._connection.send("Import",e,"json",!1,void 0,"ResultResponse")},t.prototype.ListSDSLocks=function(e){return this._connection.send("ListSDSLocks",e,"json",!1,void 0,"ResultResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSDaliPingResponse")},t.prototype.SaveSDSStore=function(e){return this._connection.send("SaveSDSStore",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetLogicalFilePartAttr=function(e){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetProtected=function(e){return this._connection.send("SetProtected",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetTraceSlowTransactions=function(e){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetTraceTransactions=function(e){return this._connection.send("SetTraceTransactions",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetUnprotected=function(e){return this._connection.send("SetUnprotected",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetValue=function(e){return this._connection.send("SetValue",e,"json",!1,void 0,"ResultResponse")},t.prototype.UnlockSDSLock=function(e){return this._connection.send("UnlockSDSLock",e,"json",!1,void 0,"ResultResponse")},t}(K));e.WsDfu=void 0,function(e){e.Delete="Delete",e.AddToSuperfile="Add To Superfile",e.ChangeProtection="Change Protection",e.ChangeRestriction="Change Restriction"}((le=e.WsDfu||(e.WsDfu={})).DFUArrayActions||(le.DFUArrayActions={})),function(e){e[e.NoChange=0]="NoChange",e[e.Protect=1]="Protect",e[e.Unprotect=2]="Unprotect",e[e.UnprotectAll=3]="UnprotectAll"}(le.DFUChangeProtection||(le.DFUChangeProtection={})),function(e){e[e.NoChange=0]="NoChange",e[e.Restrict=1]="Restrict",e[e.Unrestricted=2]="Unrestricted"}(le.DFUChangeRestriction||(le.DFUChangeRestriction={})),function(e){e.xml="xml",e.def="def"}(le.DFUDefFileFormat||(le.DFUDefFileFormat={})),(fe=le.FileAccessRole||(le.FileAccessRole={})).Token="Token",fe.Engine="Engine",fe.External="External",(he=le.SecAccessType||(le.SecAccessType={})).None="None",he.Access="Access",he.Read="Read",he.Write="Write",he.Full="Full",(de=le.DFUFileType||(le.DFUFileType={})).Flat="Flat",de.Index="Index",de.Xml="Xml",de.Csv="Csv",de.Json="Json",de.IndexLocal="IndexLocal",de.IndexPartitioned="IndexPartitioned",de.Unset="Unset";var me=function(e){function t(t){return e.call(this,t,"WsDfu","1.65")||this}return j(t,e),t.prototype.Add=function(e){return this._connection.send("Add",e,"json",!1,void 0,"AddResponse")},t.prototype.AddRemote=function(e){return this._connection.send("AddRemote",e,"json",!1,void 0,"AddRemoteResponse")},t.prototype.AddtoSuperfile=function(e){return this._connection.send("AddtoSuperfile",e,"json",!1,void 0,"AddtoSuperfileResponse")},t.prototype.DFUArrayAction=function(e){return this._connection.send("DFUArrayAction",e,"json",!1,void 0,"DFUArrayActionResponse")},t.prototype.DFUBrowseData=function(e){return this._connection.send("DFUBrowseData",e,"json",!1,void 0,"DFUBrowseDataResponse")},t.prototype.DFUDefFile=function(e){return this._connection.send("DFUDefFile",e,"json",!1,void 0,"DFUDefFileResponse")},t.prototype.DFUFileAccess=function(e){return this._connection.send("DFUFileAccess",e,"json",!1,void 0,"DFUFileAccessResponse")},t.prototype.DFUFileAccessV2=function(e){return this._connection.send("DFUFileAccessV2",e,"json",!1,void 0,"DFUFileAccessResponse")},t.prototype.DFUFileCreate=function(e){return this._connection.send("DFUFileCreate",e,"json",!1,void 0,"DFUFileCreateResponse")},t.prototype.DFUFileCreateV2=function(e){return this._connection.send("DFUFileCreateV2",e,"json",!1,void 0,"DFUFileCreateResponse")},t.prototype.DFUFilePublish=function(e){return this._connection.send("DFUFilePublish",e,"json",!1,void 0,"DFUFilePublishResponse")},t.prototype.DFUFileView=function(e){return this._connection.send("DFUFileView",e,"json",!1,void 0,"DFUFileViewResponse")},t.prototype.DFUGetDataColumns=function(e){return this._connection.send("DFUGetDataColumns",e,"json",!1,void 0,"DFUGetDataColumnsResponse")},t.prototype.DFUGetFileMetaData=function(e){return this._connection.send("DFUGetFileMetaData",e,"json",!1,void 0,"DFUGetFileMetaDataResponse")},t.prototype.DFUInfo=function(e){return this._connection.send("DFUInfo",e,"json",!1,void 0,"DFUInfoResponse")},t.prototype.DFUQuery=function(e){return this._connection.send("DFUQuery",e,"json",!1,void 0,"DFUQueryResponse")},t.prototype.DFURecordTypeInfo=function(e){return this._connection.send("DFURecordTypeInfo",e,"json",!1,void 0,"DFURecordTypeInfoResponse")},t.prototype.DFUSearch=function(e){return this._connection.send("DFUSearch",e,"json",!1,void 0,"DFUSearchResponse")},t.prototype.DFUSearchData=function(e){return this._connection.send("DFUSearchData",e,"json",!1,void 0,"DFUSearchDataResponse")},t.prototype.DFUSpace=function(e){return this._connection.send("DFUSpace",e,"json",!1,void 0,"DFUSpaceResponse")},t.prototype.EclRecordTypeInfo=function(e){return this._connection.send("EclRecordTypeInfo",e,"json",!1,void 0,"EclRecordTypeInfoResponse")},t.prototype.EraseHistory=function(e){return this._connection.send("EraseHistory",e,"json",!1,void 0,"EraseHistoryResponse")},t.prototype.ListHistory=function(e){return this._connection.send("ListHistory",e,"json",!1,void 0,"ListHistoryResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDfuPingResponse")},t.prototype.Savexml=function(e){return this._connection.send("Savexml",e,"json",!1,void 0,"SavexmlResponse")},t.prototype.SuperfileAction=function(e){return this._connection.send("SuperfileAction",e,"json",!1,void 0,"SuperfileActionResponse")},t.prototype.SuperfileList=function(e){return this._connection.send("SuperfileList",e,"json",!1,void 0,"SuperfileListResponse")},t}(K),ve=e.WsDfu.DFUArrayActions,Se=e.WsDfu.DFUDefFileFormat,Ue=e.WsDfu.DFUChangeProtection,_e=e.WsDfu.DFUChangeRestriction,Pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.DFUFile=function(e){return this._connection.send("DFUDefFile",e,"text")},t.prototype.recursiveFetchLogicalFiles=function(e){return F(this,void 0,void 0,function(){var t,n,r,o,i,s=this;return w(this,function(u){switch(u.label){case 0:return t=[],n=[],[4,Promise.all(e.map(function(e){return s.DFUInfo({Cluster:e.NodeGroup,Name:e.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(function(e){for(var r,o,i,s,u,c,a=0,p=null!==(i=null===(o=null===(r=null==e?void 0:e.FileDetail)||void 0===r?void 0:r.Superfiles)||void 0===o?void 0:o.DFULogicalFile)&&void 0!==i?i:[];a<p.length;a++){var l=p[a];t.push(l)}for(var f=0,h=null!==(c=null===(u=null===(s=null==e?void 0:e.FileDetail)||void 0===s?void 0:s.subfiles)||void 0===u?void 0:u.Item)&&void 0!==c?c:[];f<h.length;f++){l=h[f];n.push(l)}})}))];case 1:return u.sent(),o=(r=n).concat,t.length?[4,this.recursiveFetchLogicalFiles(t)]:[3,3];case 2:return i=u.sent(),[3,4];case 3:i=[],u.label=4;case 4:return[2,o.apply(r,[i])]}})})},t}(me),De=function(e){function t(t){return e.call(this,t,"WsDFUXRef","1.01")||this}return j(t,e),t.prototype.DFUXRefArrayAction=function(e){return this._connection.send("DFUXRefArrayAction",e)},t.prototype.DFUXRefBuild=function(e){return this._connection.send("DFUXRefBuild",e)},t.prototype.DFUXRefBuildCancel=function(e){return this._connection.send("DFUXRefBuildCancel",e)},t.prototype.DFUXRefCleanDirectories=function(e){return this._connection.send("DFUXRefCleanDirectories",e)},t.prototype.DFUXRefDirectories=function(e){return this._connection.send("DFUXRefDirectories",e,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")},t.prototype.DFUXRefFoundFiles=function(e){return this._connection.send("DFUXRefFoundFiles",e,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")},t.prototype.DFUXRefList=function(e){return void 0===e&&(e={}),this._connection.send("DFUXRefList",e)},t.prototype.DFUXRefLostFiles=function(e){return this._connection.send("DFUXRefLostFiles",e,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")},t.prototype.DFUXRefMessages=function(e){return this._connection.send("DFUXRefMessages",e,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")},t.prototype.DFUXRefOrphanFiles=function(e){return this._connection.send("DFUXRefOrphanFiles",e,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")},t.prototype.DFUXRefUnusedFiles=function(e){return this._connection.send("DFUXRefUnusedFiles",e)},t}(K);function Ce(e,t){var n=typeof t;switch(n){case"boolean":case"number":case"string":return{id:e,type:n};case"object":if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:"dataset",children:Re(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){var r=typeof t.Item[0];if("string"===r||"number"===r)return{id:e,type:"set",fieldType:r};throw new Error("Unknown field type")}return{id:e,type:"object",fields:je(t)}}default:throw new Error("Unknown field type")}}function Re(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);var t=[];for(var n in e)t.push(Ce(n,e[n]));return t}function je(e){var t={};for(var n in e)t[n]=Ce(n,e[n]);return t}var We,Fe,we,Ae,Te,Oe,Le,Ee,xe,Ie=function(e){function t(t){return e.call(this,t,"WsEcl","0")||this}return j(t,e),t.prototype.opts=function(){return this._connection.opts()},t.prototype.requestJson=function(e,t){return this._connection.send("example/request/query/".concat(e,"/").concat(t,"/json"),{},"text").then(function(e){var t=JSON.parse(e);for(var n in t)return t[n];return{}}).then(Re)},t.prototype.responseJson=function(e,t){return this._connection.send("example/response/query/".concat(e,"/").concat(t,"/json"),{},"text").then(function(e){var t=JSON.parse(e);for(var n in t)return t[n].Results;return{}}).then(function(e){var t={};for(var n in e)t[n]=Re(e[n]);return t})},t.prototype.submit=function(e,t,n){var r="submit/query/".concat(e,"/").concat(t);return this._connection.send(r,n,"json2").then(function(e){if(e.Results&&e.Results.Exception)throw new H(r,n,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})},t}(K),Ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"ws_elk","1")||this}return j(t,e),t.prototype.GetConfigDetails=function(e){return this._connection.send("GetConfigDetails",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t}(K));e.WsLogaccess=void 0,We=e.WsLogaccess||(e.WsLogaccess={}),(Fe=We.LogColumnType||(We.LogColumnType={})).global="global",Fe.workunits="workunits",Fe.components="components",Fe.audience="audience",Fe.class="class",Fe.instance="instance",Fe.node="node",Fe.message="message",Fe.logid="logid",Fe.processid="processid",Fe.threadid="threadid",Fe.timestamp="timestamp",Fe.pod="pod",Fe.traceid="traceid",Fe.spanid="spanid",(we=We.LogColumnValueType||(We.LogColumnValueType={})).string="string",we.numeric="numeric",we.datetime="datetime",we.enum="enum",we.epoch="epoch",(Ae=We.LogAccessType||(We.LogAccessType={}))[Ae.All=0]="All",Ae[Ae.ByJobID=1]="ByJobID",Ae[Ae.ByComponent=2]="ByComponent",Ae[Ae.ByLogType=3]="ByLogType",Ae[Ae.ByTargetAudience=4]="ByTargetAudience",Ae[Ae.BySourceInstance=5]="BySourceInstance",Ae[Ae.BySourceNode=6]="BySourceNode",Ae[Ae.ByFieldName=7]="ByFieldName",Ae[Ae.ByPod=8]="ByPod",Ae[Ae.ByTraceID=9]="ByTraceID",Ae[Ae.BySpanID=10]="BySpanID",(Te=We.LogAccessStatusCode||(We.LogAccessStatusCode={}))[Te.Success=0]="Success",Te[Te.Warning=1]="Warning",Te[Te.Fail=2]="Fail",(Oe=We.LogAccessFilterOperator||(We.LogAccessFilterOperator={}))[Oe.NONE=0]="NONE",Oe[Oe.AND=1]="AND",Oe[Oe.OR=2]="OR",(Le=We.LogSelectColumnMode||(We.LogSelectColumnMode={}))[Le.MIN=0]="MIN",Le[Le.DEFAULT=1]="DEFAULT",Le[Le.ALL=2]="ALL",Le[Le.CUSTOM=3]="CUSTOM",(Ee=We.SortColumType||(We.SortColumType={}))[Ee.ByDate=0]="ByDate",Ee[Ee.ByJobID=1]="ByJobID",Ee[Ee.ByComponent=2]="ByComponent",Ee[Ee.ByLogType=3]="ByLogType",Ee[Ee.ByTargetAudience=4]="ByTargetAudience",Ee[Ee.BySourceInstance=5]="BySourceInstance",Ee[Ee.BySourceNode=6]="BySourceNode",Ee[Ee.ByFieldName=7]="ByFieldName",Ee[Ee.ByPod=8]="ByPod",Ee[Ee.ByTraceID=9]="ByTraceID",Ee[Ee.BySpanID=10]="BySpanID",(xe=We.SortDirection||(We.SortDirection={}))[xe.ASC=0]="ASC",xe[xe.DSC=1]="DSC";var Me,ke,Ge=function(e){function t(t){return e.call(this,t,"ws_logaccess","1.08")||this}return j(t,e),t.prototype.GetHealthReport=function(e){return this._connection.send("GetHealthReport",e,"json",!1,void 0,"GetHealthReportResponse")},t.prototype.GetLogAccessInfo=function(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")},t.prototype.GetLogs=function(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")},t}(K),Ve=t.scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts"),Qe=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return j(n,t),n.prototype.GetLogAccessInfo=function(e){return void 0===e&&(e={}),this._logAccessInfo||(this._logAccessInfo=t.prototype.GetLogAccessInfo.call(this,e)),this._logAccessInfo},n.prototype.GetLogs=function(e){return t.prototype.GetLogs.call(this,e)},n.prototype.GetLogsEx=function(t){return F(this,void 0,void 0,function(){var n,r,o,i,s,u,c,a,p,l,f,h,d,y,g,b,m,v;return w(this,function(S){switch(S.label){case 0:return[4,this.GetLogAccessInfo()];case 1:for(c in n=S.sent(),r={},n.Columns.Column.forEach(function(e){return r[e.LogType]=e.Name}),o=function(e){var t,n={};for(var o in r)(null==e?void 0:e.fields)?n[o]=null!==(t=Object.assign.apply(Object,A([{}],e.fields,!1))[r[o]])&&void 0!==t?t:"":n[o]="";return n},i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:e.WsLogaccess.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:null!==(p=t.LogLineStartFrom)&&void 0!==p?p:0,LogLineLimit:null!==(l=t.LogLineLimit)&&void 0!==l?l:100,SelectColumnMode:e.WsLogaccess.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:e.WsLogaccess.SortColumType.ByDate,ColumnName:"",Direction:0}]}},s=[],u=function(n){var o,i;if(n in r&&(o=Object.values(e.WsLogaccess.LogColumnType).includes(n)?n:r[n]),o){switch(o){case e.WsLogaccess.LogColumnType.workunits:case"hpcc.log.jobid":i=e.WsLogaccess.LogAccessType.ByJobID;break;case e.WsLogaccess.LogColumnType.audience:case"hpcc.log.audience":i=e.WsLogaccess.LogAccessType.ByTargetAudience;break;case e.WsLogaccess.LogColumnType.class:case"hpcc.log.class":i=e.WsLogaccess.LogAccessType.ByLogType;break;case e.WsLogaccess.LogColumnType.components:case"kubernetes.container.name":i=e.WsLogaccess.LogAccessType.ByComponent;break;default:i=e.WsLogaccess.LogAccessType.ByFieldName,o=r[n]}if(Array.isArray(t[n]))t[n].forEach(function(t){i===e.WsLogaccess.LogAccessType.ByComponent&&(t+="*"),s.push({LogCategory:i,SearchField:o,SearchByValue:t})});else{var u=t[n];i===e.WsLogaccess.LogAccessType.ByComponent&&(u+="*"),s.push({LogCategory:i,SearchField:o,SearchByValue:u})}}},t)u(c);return s.length>2?(a=i.Filter.leftBinaryFilter.BinaryLogFilter[0],s.forEach(function(t,n){var r=e.WsLogaccess.LogAccessFilterOperator.AND;n>0?(s[n-1].SearchField===t.SearchField&&(r=e.WsLogaccess.LogAccessFilterOperator.OR),n===s.length-1?(a.Operator=r,a.rightFilter=t):(a.Operator=r,a.rightBinaryFilter={BinaryLogFilter:[{leftFilter:t}]},a=a.rightBinaryFilter.BinaryLogFilter[0])):a.leftFilter=t})):(delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:e.WsLogaccess.LogAccessType.All},(null===(f=s[0])||void 0===f?void 0:f.SearchField)&&(i.Filter.leftFilter={LogCategory:null===(h=s[0])||void 0===h?void 0:h.LogCategory,SearchField:null===(d=s[0])||void 0===d?void 0:d.SearchField,SearchByValue:null===(y=s[0])||void 0===y?void 0:y.SearchByValue}),(null===(g=s[1])||void 0===g?void 0:g.SearchField)&&(i.Filter.Operator=e.WsLogaccess.LogAccessFilterOperator.AND,s[0].SearchField===s[1].SearchField&&(i.Filter.Operator=e.WsLogaccess.LogAccessFilterOperator.OR),i.Filter.rightFilter={LogCategory:null===(b=s[1])||void 0===b?void 0:b.LogCategory,SearchField:null===(m=s[1])||void 0===m?void 0:m.SearchField,SearchByValue:null===(v=s[1])||void 0===v?void 0:v.SearchByValue})),t.StartDate&&(i.Range.StartDate=t.StartDate.toISOString()),t.EndDate&&(i.Range.EndDate=t.EndDate.toISOString()),[2,this.GetLogs(i).then(function(e){var t,r,i;try{var s=JSON.parse(e.LogLines),u=[];switch(n.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":u=null!==(r=null===(t=s.lines)||void 0===t?void 0:t.map(o))&&void 0!==r?r:[];break;default:Ve.warning("Unknown RemoteLogManagerType: ".concat(n.RemoteLogManagerType)),u=[]}return{lines:u,total:null!==(i=e.TotalLogLinesAvailable)&&void 0!==i?i:1e4}}catch(e){Ve.error(e)}return{lines:[],total:0}})]}})})},n}(Ge);function Be(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Xe(e){return null===e?NaN:+e}function He(e,t){var n,r,o=e.length,i=-1;if(null==t){for(;++i<o;)if(null!=(n=e[i])&&n>=n)for(r=n;++i<o;)null!=(n=e[i])&&n>r&&(r=n)}else for(;++i<o;)if(null!=(n=t(e[i],i,e))&&n>=n)for(r=n;++i<o;)null!=(n=t(e[i],i,e))&&n>r&&(r=n);return r}function Je(e,t){var n,r=e.length,o=r,i=-1,s=0;if(null==t)for(;++i<r;)isNaN(n=Xe(e[i]))?--o:s+=n;else for(;++i<r;)isNaN(n=Xe(t(e[i],i,e)))?--o:s+=n;if(o)return s/o}1===(Me=Be).length&&(ke=Me,Me=function(e,t){return Be(ke(e),t)});var qe,ze,Ke=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return j(n,e),n.prototype.GetTargetClusterUsageEx=function(e,n){return void 0===n&&(n=!1),this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:n}).then(function(e){return t.exists("TargetClusterUsages.TargetClusterUsage",e)?e.TargetClusterUsages.TargetClusterUsage:[]}).then(function(e){return e.filter(function(e){return!!e.ComponentUsages}).map(function(e){var t=e.ComponentUsages.ComponentUsage.map(function(e){var t=(e.MachineUsages&&e.MachineUsages.MachineUsage?e.MachineUsages.MachineUsage:[]).map(function(e){var t=e.DiskUsages&&e.DiskUsages.DiskUsage?e.DiskUsages.DiskUsage.map(function(e){return W(W({},e),{InUse:1024*e.InUse,Total:1024*(e.InUse+e.Available),PercentUsed:100-e.PercentAvailable})}):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:Je(t.filter(function(e){return!isNaN(e.PercentUsed)}),function(e){return e.PercentUsed}),max:He(t.filter(function(e){return!isNaN(e.PercentUsed)}),function(e){return e.PercentUsed})}});return{Type:e.Type,Name:e.Name,Description:e.Description,MachineUsages:t,MachineUsagesDescription:t.reduce(function(e,t){return e+(t.Description||"")},""),mean:Je(t.filter(function(e){return!isNaN(e.mean)}),function(e){return e.mean}),max:He(t.filter(function(e){return!isNaN(e.max)}),function(e){return e.max})}});return{Name:e.Name,Description:e.Description,ComponentUsages:t,ComponentUsagesDescription:t.reduce(function(e,t){return e+(t.MachineUsagesDescription||"")},""),mean:Je(t.filter(function(e){return!isNaN(e.mean)}),function(e){return e.mean}),max:He(t.filter(function(e){return!isNaN(e.max)}),function(e){return e.max})}})})},n}(function(e){function t(t){return e.call(this,t,"ws_machine","1.17")||this}return j(t,e),t.prototype.GetComponentStatus=function(e){return this._connection.send("GetComponentStatus",e)},t.prototype.GetComponentUsage=function(e){return this._connection.send("GetComponentUsage",e)},t.prototype.GetMachineInfo=function(e){return this._connection.send("GetMachineInfo",e)},t.prototype.GetMachineInfoEx=function(e){return this._connection.send("GetMachineInfoEx",e)},t.prototype.GetMetrics=function(e){return this._connection.send("GetMetrics",e)},t.prototype.GetNodeGroupUsage=function(e){return this._connection.send("GetNodeGroupUsage",e)},t.prototype.GetTargetClusterInfo=function(e){return this._connection.send("GetTargetClusterInfo",e)},t.prototype.GetTargetClusterUsage=function(e){return this._connection.send("GetTargetClusterUsage",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t.prototype.UpdateComponentStatus=function(e){return this._connection.send("UpdateComponentStatus",e)},t}(K)),Ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"WsPackageProcess","1.04")||this}return j(t,e),t.prototype.ActivatePackage=function(e){return this._connection.send("ActivatePackage",e)},t.prototype.AddPackage=function(e){return this._connection.send("AddPackage",e)},t.prototype.AddPartToPackageMap=function(e){return this._connection.send("AddPartToPackageMap",e)},t.prototype.CopyPackageMap=function(e){return this._connection.send("CopyPackageMap",e)},t.prototype.DeActivatePackage=function(e){return this._connection.send("DeActivatePackage",e)},t.prototype.DeletePackage=function(e){return this._connection.send("DeletePackage",e)},t.prototype.Echo=function(e){return this._connection.send("Echo",e)},t.prototype.GetPackage=function(e){return this._connection.send("GetPackage",e)},t.prototype.GetPackageMapById=function(e){return this._connection.send("GetPackageMapById",e)},t.prototype.GetPackageMapSelectOptions=function(e){return this._connection.send("GetPackageMapSelectOptions",e)},t.prototype.GetPartFromPackageMap=function(e){return this._connection.send("GetPartFromPackageMap",e)},t.prototype.GetQueryFileMapping=function(e){return this._connection.send("GetQueryFileMapping",e)},t.prototype.ListPackage=function(e){return this._connection.send("ListPackage",e)},t.prototype.ListPackages=function(e){return this._connection.send("ListPackages",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t.prototype.RemovePartFromPackageMap=function(e){return this._connection.send("RemovePartFromPackageMap",e)},t.prototype.ValidatePackage=function(e){return this._connection.send("ValidatePackage",e)},t}(K)),Ze=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"WsResources","1.01")||this}return j(t,e),t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t.prototype.ServiceQuery=function(e){return this._connection.send("ServiceQuery",e)},t.prototype.WebLinksQuery=function(e){return this._connection.send("WebLinksQuery",e)},t}(K));e.WsSasha=void 0,qe=e.WsSasha||(e.WsSasha={}),(ze=qe.WUTypes||(qe.WUTypes={})).ECL="ECL",ze.DFU="DFU";var $e,et,tt,nt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"WSSasha","1.01")||this}return j(t,e),t.prototype.ArchiveWU=function(e){return this._connection.send("ArchiveWU",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetVersion=function(e){return this._connection.send("GetVersion",e,"json",!1,void 0,"ResultResponse")},t.prototype.ListWU=function(e){return this._connection.send("ListWU",e,"json",!1,void 0,"ResultResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSSashaPingResponse")},t.prototype.RestoreWU=function(e){return this._connection.send("RestoreWU",e,"json",!1,void 0,"ResultResponse")},t}(K));e.WsSMC=void 0,$e=e.WsSMC||(e.WsSMC={}),(et=$e.LockModes||($e.LockModes={})).ALL="ALL",et.READ="READ",et.WRITE="WRITE",et.HOLD="HOLD",et.SUB="SUB",(tt=$e.RoxieControlCmdType||($e.RoxieControlCmdType={})).Attach="Attach",tt.Detach="Detach",tt.State="State",tt.Reload="Reload",tt.ReloadRetry="ReloadRetry",tt.MemLock="MemLock",tt.MemUnlock="MemUnlock",tt.GetMemLocked="GetMemLocked";var rt,ot,it=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.connectionOptions=function(){return this._connection.opts()},t.prototype.Activity=function(t){return e.prototype.Activity.call(this,t).then(function(e){return W({Running:{ActiveWorkunit:[]}},e)})},t}(function(e){function t(t){return e.call(this,t,"WsSMC","1.27")||this}return j(t,e),t.prototype.Activity=function(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")},t.prototype.BrowseResources=function(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")},t.prototype.ClearQueue=function(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")},t.prototype.GetBuildInfo=function(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")},t.prototype.GetStatusServerInfo=function(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")},t.prototype.GetThorQueueAvailability=function(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")},t.prototype.Index=function(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")},t.prototype.LockQuery=function(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")},t.prototype.MoveJobBack=function(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")},t.prototype.MoveJobDown=function(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")},t.prototype.MoveJobFront=function(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")},t.prototype.MoveJobUp=function(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")},t.prototype.NotInCommunityEdition=function(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")},t.prototype.PauseQueue=function(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")},t.prototype.RemoveJob=function(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")},t.prototype.ResumeQueue=function(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")},t.prototype.RoxieControlCmd=function(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")},t.prototype.RoxieXrefCmd=function(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")},t.prototype.SetBanner=function(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")},t.prototype.SetJobPriority=function(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")},t.prototype.StopQueue=function(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")},t}(K)),st=function(e){function t(t){return e.call(this,t,"WsStore","1")||this}return j(t,e),t.prototype.CreateStore=function(e){return this._connection.send("Fetch",e)},t.prototype.Delete=function(e){return this._connection.send("Delete",e).catch(function(e){if(e.isESPExceptions&&e.Exception.some(function(e){return-1===e.Code}))return{Exceptions:void 0,Success:!0};throw e})},t.prototype.DeleteNamespace=function(e){return this._connection.send("DeleteNamespace",e)},t.prototype.Fetch=function(e){return this._connection.send("Fetch",e).catch(function(e){if(e.isESPExceptions&&e.Exception.some(function(e){return-1===e.Code}))return{Exceptions:void 0,Value:void 0};throw e})},t.prototype.FetchAll=function(e){return this._connection.send("FetchAll",e)},t.prototype.FetchKeyMD=function(e){return this._connection.send("FetchKeyMD",e)},t.prototype.ListKeys=function(e){return this._connection.send("ListKeys",e)},t.prototype.ListNamespaces=function(e){return this._connection.send("ListNamespaces",e)},t.prototype.Set=function(e){return this._connection.send("Set",e)},t}(K);e.WsTopology=void 0,rt=e.WsTopology||(e.WsTopology={}),(ot=rt.RoxieQueueFilter||(rt.RoxieQueueFilter={})).All="All",ot.QueriesOnly="QueriesOnly",ot.WorkunitsOnly="WorkunitsOnly";var ut,ct,at,pt,lt,ft,ht,dt,yt,gt,bt,mt,vt,St,Ut=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.connectionOptions=function(){return this._connection.opts()},t.prototype.protocol=function(){return this._connection.opts().baseUrl.split("//")[0]},t.prototype.ip=function(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]},t.prototype.DefaultTpLogicalClusterQuery=function(e){return void 0===e&&(e={}),this.TpLogicalClusterQuery(e).then(function(e){return e.default?e.default:(e.TpLogicalClusters.TpLogicalCluster.some(function(e,r){return 0===r&&(n=e),"hthor"===e.Type&&(t=e,!0)}),t||n);var t,n})},t}(function(e){function t(t){return e.call(this,t,"WsTopology","1.32")||this}return j(t,e),t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsTopologyPingResponse")},t.prototype.SystemLog=function(e){return this._connection.send("SystemLog",e,"json",!1,void 0,"SystemLogResponse")},t.prototype.TpClusterInfo=function(e){return this._connection.send("TpClusterInfo",e,"json",!1,void 0,"TpClusterInfoResponse")},t.prototype.TpClusterQuery=function(e){return this._connection.send("TpClusterQuery",e,"json",!1,void 0,"TpClusterQueryResponse")},t.prototype.TpDropZoneQuery=function(e){return this._connection.send("TpDropZoneQuery",e,"json",!1,void 0,"TpDropZoneQueryResponse")},t.prototype.TpGetComponentFile=function(e){return this._connection.send("TpGetComponentFile",e,"json",!1,void 0,"TpGetComponentFileResponse")},t.prototype.TpGetServicePlugins=function(e){return this._connection.send("TpGetServicePlugins",e,"json",!1,void 0,"TpGetServicePluginsResponse")},t.prototype.TpGroupQuery=function(e){return this._connection.send("TpGroupQuery",e,"json",!1,void 0,"TpGroupQueryResponse")},t.prototype.TpListLogFiles=function(e){return this._connection.send("TpListLogFiles",e,"json",!1,void 0,"TpListLogFilesResponse")},t.prototype.TpListTargetClusters=function(e){return this._connection.send("TpListTargetClusters",e,"json",!1,void 0,"TpListTargetClustersResponse")},t.prototype.TpLogFile=function(e){return this._connection.send("TpLogFile",e,"json",!1,void 0,"TpLogFileResponse")},t.prototype.TpLogFileDisplay=function(e){return this._connection.send("TpLogFileDisplay",e,"json",!1,void 0,"TpLogFileResponse")},t.prototype.TpLogicalClusterQuery=function(e){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,void 0,"TpLogicalClusterQueryResponse")},t.prototype.TpMachineInfo=function(e){return this._connection.send("TpMachineInfo",e,"json",!1,void 0,"TpMachineInfoResponse")},t.prototype.TpMachineQuery=function(e){return this._connection.send("TpMachineQuery",e,"json",!1,void 0,"TpMachineQueryResponse")},t.prototype.TpServiceQuery=function(e){return this._connection.send("TpServiceQuery",e,"json",!1,void 0,"TpServiceQueryResponse")},t.prototype.TpSetMachineStatus=function(e){return this._connection.send("TpSetMachineStatus",e,"json",!1,void 0,"TpSetMachineStatusResponse")},t.prototype.TpSwapNode=function(e){return this._connection.send("TpSwapNode",e,"json",!1,void 0,"TpSwapNodeResponse")},t.prototype.TpTargetClusterQuery=function(e){return this._connection.send("TpTargetClusterQuery",e,"json",!1,void 0,"TpTargetClusterQueryResponse")},t.prototype.TpThorStatus=function(e){return this._connection.send("TpThorStatus",e,"json",!1,void 0,"TpThorStatusResponse")},t.prototype.TpXMLFile=function(e){return this._connection.send("TpXMLFile",e,"json",!1,void 0,"TpXMLFileResponse")},t}(K));e.WsWorkunits=void 0,ut=e.WsWorkunits||(e.WsWorkunits={}),(ct=ut.ECLWUActions||(ut.ECLWUActions={})).Abort="Abort",ct.Delete="Delete",ct.Deschedule="Deschedule",ct.Reschedule="Reschedule",ct.Pause="Pause",ct.PauseNow="PauseNow",ct.Protect="Protect",ct.Unprotect="Unprotect",ct.Restore="Restore",ct.Resume="Resume",ct.SetToFailed="SetToFailed",ct.Archive="Archive",function(e){e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM"}(ut.LogSelectColumnMode||(ut.LogSelectColumnMode={})),function(e){e[e.ASC=0]="ASC",e[e.DSC=1]="DSC"}(ut.SortDirection||(ut.SortDirection={})),(at=ut.LogEventClass||(ut.LogEventClass={})).ALL="ALL",at.DIS="DIS",at.ERR="ERR",at.WRN="WRN",at.INF="INF",at.PRO="PRO",at.MET="MET",at.EVT="EVT",(pt=ut.WUDetailsAttrValueType||(ut.WUDetailsAttrValueType={})).Single="Single",pt.List="List",pt.Multi="Multi",(lt=ut.EclDefinitionActions||(ut.EclDefinitionActions={})).SyntaxCheck="SyntaxCheck",lt.Deploy="Deploy",lt.Publish="Publish",(ft=ut.ErrorMessageFormat||(ut.ErrorMessageFormat={})).xml="xml",ft.json="json",ft.text="text",(ht=ut.LogAccessLogFormat||(ut.LogAccessLogFormat={}))[ht.XML=0]="XML",ht[ht.JSON=1]="JSON",ht[ht.CSV=2]="CSV",(dt=ut.WUExceptionSeverity||(ut.WUExceptionSeverity={})).info="info",dt.warning="warning",dt.error="error",dt.alert="alert",(yt=ut.WUQueryFilterSuspendedType||(ut.WUQueryFilterSuspendedType={})).Allqueries="All queries",yt.Notsuspended="Not suspended",yt.Suspended="Suspended",yt.Suspendedbyuser="Suspended by user",yt.Suspendedbyfirstnode="Suspended by first node",yt.Suspendedbyanynode="Suspended by any node",(gt=ut.WUQuerySetFilterType||(ut.WUQuerySetFilterType={})).All="All",gt.Id="Id",gt.Name="Name",gt.Alias="Alias",gt.Status="Status",(bt=ut.WUProtectFilter||(ut.WUProtectFilter={})).All="All",bt.Protected="Protected",bt.NotProtected="NotProtected",(ut.QuerySetAliasActionTypes||(ut.QuerySetAliasActionTypes={})).Deactivate="Deactivate",(mt=ut.QuerysetImportActivation||(ut.QuerysetImportActivation={})).None="None",mt.ActivateImportedActive="ActivateImportedActive",(vt=ut.QuerySetQueryActionTypes||(ut.QuerySetQueryActionTypes={})).Suspend="Suspend",vt.Unsuspend="Unsuspend",vt.ToggleSuspend="ToggleSuspend",vt.Activate="Activate",vt.Delete="Delete",vt.DeleteQueriesAndWUs="DeleteQueriesAndWUs",vt.RemoveAllAliases="RemoveAllAliases",vt.ResetQueryStats="ResetQueryStats",(St=ut.WUQueryActivationMode||(ut.WUQueryActivationMode={}))[St.DoNotActivateQuery=0]="DoNotActivateQuery",St[St.ActivateQuery=1]="ActivateQuery",St[St.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",St[St.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious";var _t,Pt,Dt,Ct=function(e){function t(t){return e.call(this,t,"WsWorkunits","2.02")||this}return j(t,e),t.prototype.GVCAjaxGraph=function(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")},t.prototype.WUAbort=function(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")},t.prototype.WUAction=function(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")},t.prototype.WUAddLocalFileToWorkunit=function(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")},t.prototype.WUAnalyseHotspot=function(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")},t.prototype.WUCDebug=function(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")},t.prototype.WUCheckFeatures=function(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")},t.prototype.WUClusterJobQueueLOG=function(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")},t.prototype.WUClusterJobQueueXLS=function(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")},t.prototype.WUClusterJobSummaryXLS=function(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")},t.prototype.WUClusterJobXLS=function(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")},t.prototype.WUCompileECL=function(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")},t.prototype.WUCopyLogicalFiles=function(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")},t.prototype.WUCopyQuerySet=function(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")},t.prototype.WUCreate=function(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")},t.prototype.WUCreateAndUpdate=function(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")},t.prototype.WUCreateZAPInfo=function(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")},t.prototype.WUDelete=function(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")},t.prototype.WUDeployWorkunit=function(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")},t.prototype.WUDetails=function(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")},t.prototype.WUDetailsMeta=function(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")},t.prototype.WUEclDefinitionAction=function(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")},t.prototype.WUExport=function(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")},t.prototype.WUFile=function(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")},t.prototype.WUFullResult=function(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")},t.prototype.WUGVCGraphInfo=function(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")},t.prototype.WUGetArchiveFile=function(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")},t.prototype.WUGetDependancyTrees=function(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")},t.prototype.WUGetGraph=function(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")},t.prototype.WUGetGraphNameAndTypes=function(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")},t.prototype.WUGetNumFileToCopy=function(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")},t.prototype.WUGetPlugins=function(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")},t.prototype.WUGetStats=function(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")},t.prototype.WUGetThorJobList=function(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")},t.prototype.WUGetThorJobQueue=function(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")},t.prototype.WUGetZAPInfo=function(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")},t.prototype.WUGraphInfo=function(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")},t.prototype.WUGraphTiming=function(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")},t.prototype.WUInfo=function(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")},t.prototype.WUInfoDetails=function(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")},t.prototype.WUJobList=function(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")},t.prototype.WULightWeightQuery=function(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")},t.prototype.WUListArchiveFiles=function(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")},t.prototype.WUListLocalFileRequired=function(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")},t.prototype.WUListQueries=function(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")},t.prototype.WUListQueriesUsingFile=function(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")},t.prototype.WUMultiQuerysetDetails=function(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")},t.prototype.WUProcessGraph=function(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")},t.prototype.WUProtect=function(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")},t.prototype.WUPublishWorkunit=function(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")},t.prototype.WUPushEvent=function(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")},t.prototype.WUQuery=function(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")},t.prototype.WUQueryConfig=function(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")},t.prototype.WUQueryDetails=function(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")},t.prototype.WUQueryDetailsLightWeight=function(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")},t.prototype.WUQueryFiles=function(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")},t.prototype.WUQueryGetGraph=function(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")},t.prototype.WUQueryGetSummaryStats=function(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")},t.prototype.WUQuerysetAliasAction=function(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")},t.prototype.WUQuerysetCopyQuery=function(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")},t.prototype.WUQuerysetDetails=function(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")},t.prototype.WUQuerysetExport=function(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")},t.prototype.WUQuerysetImport=function(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")},t.prototype.WUQuerysetQueryAction=function(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")},t.prototype.WUQuerysets=function(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")},t.prototype.WURecreateQuery=function(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")},t.prototype.WUResubmit=function(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")},t.prototype.WUResult=function(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")},t.prototype.WUResultBin=function(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")},t.prototype.WUResultSummary=function(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")},t.prototype.WUResultView=function(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")},t.prototype.WURun=function(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")},t.prototype.WUSchedule=function(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")},t.prototype.WUShowScheduled=function(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")},t.prototype.WUSubmit=function(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")},t.prototype.WUSyntaxCheckECL=function(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")},t.prototype.WUUpdate=function(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")},t.prototype.WUUpdateQueryEntry=function(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")},t.prototype.WUWaitCompiled=function(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")},t.prototype.WUWaitComplete=function(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")},t}(K);function Rt(e){return"string"==typeof e.Name}e.WUStateID=void 0,(_t=e.WUStateID||(e.WUStateID={}))[_t.Unknown=0]="Unknown",_t[_t.Compiled=1]="Compiled",_t[_t.Running=2]="Running",_t[_t.Completed=3]="Completed",_t[_t.Failed=4]="Failed",_t[_t.Archived=5]="Archived",_t[_t.Aborting=6]="Aborting",_t[_t.Aborted=7]="Aborted",_t[_t.Blocked=8]="Blocked",_t[_t.Submitted=9]="Submitted",_t[_t.Scheduled=10]="Scheduled",_t[_t.Compiling=11]="Compiling",_t[_t.Wait=12]="Wait",_t[_t.UploadingFiled=13]="UploadingFiled",_t[_t.DebugPaused=14]="DebugPaused",_t[_t.DebugRunning=15]="DebugRunning",_t[_t.Paused=16]="Paused",_t[_t.LAST=17]="LAST",_t[_t.NotFound=999]="NotFound",e.WUUpdate=void 0,Pt=e.WUUpdate||(e.WUUpdate={}),(Dt=Pt.Action||(Pt.Action={}))[Dt.Unknown=0]="Unknown",Dt[Dt.Compile=1]="Compile",Dt[Dt.Check=2]="Check",Dt[Dt.Run=3]="Run",Dt[Dt.ExecuteExisting=4]="ExecuteExisting",Dt[Dt.Pause=5]="Pause",Dt[Dt.PauseNow=6]="PauseNow",Dt[Dt.Resume=7]="Resume",Dt[Dt.Debug=8]="Debug",Dt[Dt.__size=9]="__size";var jt=function(e){function n(t){return e.call(this,t)||this}return j(n,e),n.prototype.Ping=function(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(function(e){return{result:!0}}).catch(function(e){return{result:!1,error:e}})},n.prototype.WUQuery=function(e,n){return void 0===e&&(e={}),this._connection.send("WUQuery",e,"json",!1,n).then(function(e){return t.deepMixin({Workunits:{ECLWorkunit:[]}},e)})},n.prototype.WUInfo=function(t){var n=W({Wuid:"",TruncateEclTo64k:!0,IncludeExceptions:!1,IncludeGraphs:!1,IncludeSourceFiles:!1,IncludeResults:!1,IncludeResultsViewNames:!1,IncludeVariables:!1,IncludeTimers:!1,IncludeDebugValues:!1,IncludeApplicationValues:!1,IncludeWorkflows:!1,IncludeXmlSchemas:!1,IncludeResourceURLs:!1,IncludeECL:!1,IncludeHelpers:!1,IncludeAllowedClusters:!1,IncludeTotalClusterTime:!1,IncludeServiceNames:!1,SuppressResultSchemas:!0},t);return e.prototype.WUInfo.call(this,n)},n.prototype.WUCreate=function(){return e.prototype.WUCreate.call(this,{})},n.prototype.WUUpdate=function(e){return this._connection.send("WUUpdate",e,"json",!0)},n.prototype.WUResubmit=function(t){return this._connection.toESPStringArray(t,"Wuids"),e.prototype.WUResubmit.call(this,t)},n.prototype.WUAction=function(t){return t.ActionType=t.WUActionType,e.prototype.WUAction.call(this,t)},n.prototype.WUResult=function(e,t){return this._connection.send("WUResult",e,"json",!1,t)},n.prototype.WUFileEx=function(e){return this._connection.send("WUFile",e,"text")},n.prototype.WUDetailsMeta=function(t){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=e.prototype.WUDetailsMeta.call(this,t)),this._WUDetailsMetaPromise},n.prototype.WUCDebugEx=function(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(function(e){var n=t.xml2json(e.Result).children();return n.length?n[0]:null})},n}(Ct),Wt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.WUPublishWorkunitEx=function(e){return this._connection.send("WUPublishWorkunit",e)},t}(Ct);function Ft(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}var wt,At=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Tt(e){if(!(t=At.exec(e)))throw new Error("invalid format: "+e);var t;return new Ot({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Ot(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Lt(e,t){var n=Ft(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}Tt.prototype=Ot.prototype,Ot.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Et={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return Lt(100*e,t)},r:Lt,s:function(e,t){var n=Ft(e,t);if(!n)return e+"";var r=n[0],o=n[1],i=o-(wt=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Ft(e,Math.max(0,t+i-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function xt(e){return e}var It,Nt,Mt=Array.prototype.map,kt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Gt(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?xt:(t=Mt.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,i=[],s=0,u=t[0],c=0;o>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),i.push(e.substring(o-=u,o+u)),!((c+=u+1)>r));)u=t[s=(s+1)%t.length];return i.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",s=e.decimal+"",u=void 0===e.numerals?xt:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(Mt.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",a=e.minus+"",p=void 0===e.nan?"NaN":e.nan+"";function l(e){var t=(e=Tt(e)).fill,n=e.align,l=e.sign,f=e.symbol,h=e.zero,d=e.width,y=e.comma,g=e.precision,b=e.trim,m=e.type;"n"===m?(y=!0,m="g"):Et[m]||(void 0===g&&(g=12),b=!0,m="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var v="$"===f?o:"#"===f&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",S="$"===f?i:/[%p]/.test(m)?c:"",U=Et[m],_=/[defgprs%]/.test(m);function P(e){var o,i,c,f=v,P=S;if("c"===m)P=U(e)+P,e="";else{var D=(e=+e)<0||1/e<0;if(e=isNaN(e)?p:U(Math.abs(e),g),b&&(e=function(e){e:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),D&&0===+e&&"+"!==l&&(D=!1),f=(D?"("===l?l:a:"-"===l||"("===l?"":l)+f,P=("s"===m?kt[8+wt/3]:"")+P+(D&&"("===l?")":""),_)for(o=-1,i=e.length;++o<i;)if(48>(c=e.charCodeAt(o))||c>57){P=(46===c?s+e.slice(o+1):e.slice(o))+P,e=e.slice(0,o);break}}y&&!h&&(e=r(e,1/0));var C=f.length+e.length+P.length,R=C<d?new Array(d-C+1).join(t):"";switch(y&&h&&(e=r(R+e,R.length?d-P.length:1/0),R=""),n){case"<":e=f+e+P+R;break;case"=":e=f+R+e+P;break;case"^":e=R.slice(0,C=R.length>>1)+f+e+P+R.slice(C);break;default:e=R+f+e+P}return u(e)}return g=void 0===g?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),P.toString=function(){return e+""},P}return{format:l,formatPrefix:function(e,t){var n,r=l(((e=Tt(e)).type="f",e)),o=3*Math.max(-8,Math.min(8,Math.floor((n=t,((n=Ft(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-o),s=kt[8+o/3];return function(e){return r(i*e)+s}}}}It=Gt({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Nt=It.format,It.formatPrefix;var Vt=new Date,Qt=new Date;function Bt(e,t,n,r){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=function(t){return e(t=new Date(+t)),t},o.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},o.round=function(e){var t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},o.range=function(n,r,i){var s,u=[];if(n=o.ceil(n),i=null==i?1:Math.floor(i),!(n<r&&i>0))return u;do{u.push(s=new Date(+n)),t(n,i),e(n)}while(s<n&&n<r);return u},o.filter=function(n){return Bt(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})},n&&(o.count=function(t,r){return Vt.setTime(+t),Qt.setTime(+r),e(Vt),e(Qt),Math.floor(n(Vt,Qt))},o.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?function(t){return r(t)%e===0}:function(t){return o.count(0,t)%e===0}):o:null}),o}var Xt=864e5,Ht=6048e5,Jt=Bt(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Xt},function(e){return e.getDate()-1});function qt(e){return Bt(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Ht})}Jt.range;var zt=qt(0),Kt=qt(1),Yt=qt(2),Zt=qt(3),$t=qt(4),en=qt(5),tn=qt(6);zt.range,Kt.range,Yt.range,Zt.range,$t.range,en.range,tn.range;var nn=Bt(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});nn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Bt(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null},nn.range;var rn=Bt(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Xt},function(e){return e.getUTCDate()-1});function on(e){return Bt(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/Ht})}rn.range;var sn=on(0),un=on(1),cn=on(2),an=on(3),pn=on(4),ln=on(5),fn=on(6);sn.range,un.range,cn.range,an.range,pn.range,ln.range,fn.range;var hn=Bt(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});function dn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function yn(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function gn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}hn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Bt(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null},hn.range;var bn,mn,vn,Sn={"-":"",_:" ",0:"0"},Un=/^\s*\d+/,_n=/^%/,Pn=/[\\^$*+?|[\]().{}]/g;function Dn(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(t)+o:o)}function Cn(e){return e.replace(Pn,"\\$&")}function Rn(e){return new RegExp("^(?:"+e.map(Cn).join("|")+")","i")}function jn(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function Wn(e,t,n){var r=Un.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Fn(e,t,n){var r=Un.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function wn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function An(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Tn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function On(e,t,n){var r=Un.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Ln(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function En(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function xn(e,t,n){var r=Un.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function In(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Nn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Mn(e,t,n){var r=Un.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function kn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Gn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Vn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Qn(e,t,n){var r=Un.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Bn(e,t,n){var r=Un.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xn(e,t,n){var r=_n.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Hn(e,t,n){var r=Un.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Jn(e,t,n){var r=Un.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function qn(e,t){return Dn(e.getDate(),t,2)}function zn(e,t){return Dn(e.getHours(),t,2)}function Kn(e,t){return Dn(e.getHours()%12||12,t,2)}function Yn(e,t){return Dn(1+Jt.count(nn(e),e),t,3)}function Zn(e,t){return Dn(e.getMilliseconds(),t,3)}function $n(e,t){return Zn(e,t)+"000"}function er(e,t){return Dn(e.getMonth()+1,t,2)}function tr(e,t){return Dn(e.getMinutes(),t,2)}function nr(e,t){return Dn(e.getSeconds(),t,2)}function rr(e){var t=e.getDay();return 0===t?7:t}function or(e,t){return Dn(zt.count(nn(e)-1,e),t,2)}function ir(e){var t=e.getDay();return t>=4||0===t?$t(e):$t.ceil(e)}function sr(e,t){return e=ir(e),Dn($t.count(nn(e),e)+(4===nn(e).getDay()),t,2)}function ur(e){return e.getDay()}function cr(e,t){return Dn(Kt.count(nn(e)-1,e),t,2)}function ar(e,t){return Dn(e.getFullYear()%100,t,2)}function pr(e,t){return Dn((e=ir(e)).getFullYear()%100,t,2)}function lr(e,t){return Dn(e.getFullYear()%1e4,t,4)}function fr(e,t){var n=e.getDay();return Dn((e=n>=4||0===n?$t(e):$t.ceil(e)).getFullYear()%1e4,t,4)}function hr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Dn(t/60|0,"0",2)+Dn(t%60,"0",2)}function dr(e,t){return Dn(e.getUTCDate(),t,2)}function yr(e,t){return Dn(e.getUTCHours(),t,2)}function gr(e,t){return Dn(e.getUTCHours()%12||12,t,2)}function br(e,t){return Dn(1+rn.count(hn(e),e),t,3)}function mr(e,t){return Dn(e.getUTCMilliseconds(),t,3)}function vr(e,t){return mr(e,t)+"000"}function Sr(e,t){return Dn(e.getUTCMonth()+1,t,2)}function Ur(e,t){return Dn(e.getUTCMinutes(),t,2)}function _r(e,t){return Dn(e.getUTCSeconds(),t,2)}function Pr(e){var t=e.getUTCDay();return 0===t?7:t}function Dr(e,t){return Dn(sn.count(hn(e)-1,e),t,2)}function Cr(e){var t=e.getUTCDay();return t>=4||0===t?pn(e):pn.ceil(e)}function Rr(e,t){return e=Cr(e),Dn(pn.count(hn(e),e)+(4===hn(e).getUTCDay()),t,2)}function jr(e){return e.getUTCDay()}function Wr(e,t){return Dn(un.count(hn(e)-1,e),t,2)}function Fr(e,t){return Dn(e.getUTCFullYear()%100,t,2)}function wr(e,t){return Dn((e=Cr(e)).getUTCFullYear()%100,t,2)}function Ar(e,t){return Dn(e.getUTCFullYear()%1e4,t,4)}function Tr(e,t){var n=e.getUTCDay();return Dn((e=n>=4||0===n?pn(e):pn.ceil(e)).getUTCFullYear()%1e4,t,4)}function Or(){return"+0000"}function Lr(){return"%"}function Er(e){return+e}function xr(e){return Math.floor(+e/1e3)}!function(e){bn=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,i=e.days,s=e.shortDays,u=e.months,c=e.shortMonths,a=Rn(o),p=jn(o),l=Rn(i),f=jn(i),h=Rn(s),d=jn(s),y=Rn(u),g=jn(u),b=Rn(c),m=jn(c),v={a:function(e){return s[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return c[e.getMonth()]},B:function(e){return u[e.getMonth()]},c:null,d:qn,e:qn,f:$n,g:pr,G:fr,H:zn,I:Kn,j:Yn,L:Zn,m:er,M:tr,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Er,s:xr,S:nr,u:rr,U:or,V:sr,w:ur,W:cr,x:null,X:null,y:ar,Y:lr,Z:hr,"%":Lr},S={a:function(e){return s[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return c[e.getUTCMonth()]},B:function(e){return u[e.getUTCMonth()]},c:null,d:dr,e:dr,f:vr,g:wr,G:Tr,H:yr,I:gr,j:br,L:mr,m:Sr,M:Ur,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Er,s:xr,S:_r,u:Pr,U:Dr,V:Rr,w:jr,W:Wr,x:null,X:null,y:Fr,Y:Ar,Z:Or,"%":Lr},U={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=d[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=b.exec(t.slice(n));return r?(e.m=m[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return D(e,t,n,r)},d:Nn,e:Nn,f:Bn,g:Ln,G:On,H:kn,I:kn,j:Mn,L:Qn,m:In,M:Gn,p:function(e,t,n){var r=a.exec(t.slice(n));return r?(e.p=p[r[0].toLowerCase()],n+r[0].length):-1},q:xn,Q:Hn,s:Jn,S:Vn,u:Fn,U:wn,V:An,w:Wn,W:Tn,x:function(e,t,r){return D(e,n,t,r)},X:function(e,t,n){return D(e,r,t,n)},y:Ln,Y:On,Z:En,"%":Xn};function _(e,t){return function(n){var r,o,i,s=[],u=-1,c=0,a=e.length;for(n instanceof Date||(n=new Date(+n));++u<a;)37===e.charCodeAt(u)&&(s.push(e.slice(c,u)),null!=(o=Sn[r=e.charAt(++u)])?r=e.charAt(++u):o="e"===r?" ":"0",(i=t[r])&&(r=i(n,o)),s.push(r),c=u+1);return s.push(e.slice(c,u)),s.join("")}}function P(e,t){return function(n){var r,o,i=gn(1900,void 0,1);if(D(i,e,n+="",0)!=n.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(o=(r=yn(gn(i.y,0,1))).getUTCDay(),r=o>4||0===o?un.ceil(r):un(r),r=rn.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(o=(r=dn(gn(i.y,0,1))).getDay(),r=o>4||0===o?Kt.ceil(r):Kt(r),r=Jt.offset(r,7*(i.V-1)),i.y=r.getFullYear(),i.m=r.getMonth(),i.d=r.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?yn(gn(i.y,0,1)).getUTCDay():dn(gn(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,yn(i)):dn(i)}}function D(e,t,n,r){for(var o,i,s=0,u=t.length,c=n.length;s<u;){if(r>=c)return-1;if(37===(o=t.charCodeAt(s++))){if(o=t.charAt(s++),!(i=U[o in Sn?t.charAt(s++):o])||(r=i(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return v.x=_(n,v),v.X=_(r,v),v.c=_(t,v),S.x=_(n,S),S.X=_(r,S),S.c=_(t,S),{format:function(e){var t=_(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=P(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=_(e+="",S);return t.toString=function(){return e},t},utcParse:function(e){var t=P(e+="",!0);return t.toString=function(){return e},t}}}(e),bn.format,bn.parse,mn=bn.utcFormat,vn=bn.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Ir=function(e){function t(t,n,r){var o=e.call(this)||this;o.wu=t;for(var i=0,s=0,u=r;s<u.length;s++){var c=u[s];if(c.GraphName===n.Name&&!c.HasSubGraphId){i=Math.round(1e3*c.Seconds)/1e3;break}}return o.set(W({Time:i},n)),o}return j(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Label",{get:function(){return this.get("Label")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.get("Type")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Complete",{get:function(){return this.get("Complete")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WhenStarted",{get:function(){return this.get("WhenStarted")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WhenFinished",{get:function(){return this.get("WhenFinished")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Time",{get:function(){return this.get("Time")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Running",{get:function(){return this.get("Running")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RunningId",{get:function(){return this.get("RunningId")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Failed",{get:function(){return this.get("Failed")},enumerable:!1,configurable:!0}),t.prototype.fetchScopeGraph=function(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(function(e){return Kr(e)}):this.wu.fetchGraphDetails([this.Name],["graph"]).then(function(e){return Kr(e)})},t}(t.StateObject),Nr=function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.Name])})||this}return j(n,e),n}(t.Cache);function Mr(e,t,n){(n=n||[]).push(e),t(e.name,e.$,e.children(),n),e.children().forEach(function(e){Mr(e,t,n)}),n.pop()}function kr(e){var t={};return e.forEach(function(e){"att"===e.name&&(t[e.$.name]=e.$.value)}),t}var Gr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Graph),Vr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Subgraph),Qr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Vertex),Br=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Edge);function Xr(e,t){var n={},r={},o={},i=new Gr(function(e){return e._.id}),s=[i.root];return Mr(t,function(e,t,i,u){var c=s[s.length-1];switch(e){case"graph":break;case"node":if(i.length&&i[0].children().length&&"graph"===i[0].children()[0].name){var a=c.createSubgraph(kr(i));s.push(a),n[t.id]=a}var p=c.createVertex(kr(i));r[t.id]=p;break;case"edge":var l=c.createEdge(r[t.source],r[t.target],kr(i));o[t.id]=l}}),i}var Hr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Graph),Jr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Subgraph),qr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Vertex),zr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Edge);function Kr(e){for(var t,n={},r={},o={},i=0,s=e;i<s.length;i++){switch((f=s[i]).ScopeType){case"graph":t=new Hr(function(e){return e._.Id},f),n[f.ScopeName]=t.root;break;case"subgraph":t||(t=new Hr(function(e){return e._.Id},f),n[f.ScopeName]=t.root);for(var u=f.parentScope().split(":"),c=n[f.parentScope()];u.length&&!c;)c=n[u.join(":")],u.pop();if(c){var a=c;n[f.ScopeName]=a.createSubgraph(f)}else console.warn("Missing SG:Parent (".concat(f.Id,"): ").concat(f.parentScope()));break;case"activity":var p=n[f.parentScope()];p?o[f.ScopeName]=p.createVertex(f):console.warn("Missing A:Parent (".concat(f.Id,"): ").concat(f.parentScope()));break;case"edge":r[f.ScopeName]=f;break;case"function":(h=o[f.parentScope()])?h._.children().push(f):console.warn("Missing F:Parent (".concat(f.Id,"): ").concat(f.parentScope()))}}for(var l in r){var f,h;if(h=n[(f=r[l]).parentScope()]){var d=h;try{var y=t.vertex(f.attr("IdSource").RawValue),g=t.vertex(f.attr("IdTarget").RawValue);d.createEdge(y,g,f)}catch(e){console.warn("Invalid Edge: ".concat(l))}}else console.warn("Missing E:Parent (".concat(f.Id,"): ").concat(f.parentScope()))}return t}var Yr=function(e){function t(t,n){var r=e.call(this)||this;r.wu=t;var o=n.split("\\").join("/"),i=o.split("/"),s="res/"+r.wu.Wuid+"/",u="",c="";return 0===o.indexOf(s)&&(u=o.substr(s.length),c=i[i.length-1]),r.set({URL:n,DisplayName:c,DisplayPath:u}),r}return j(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"URL",{get:function(){return this.get("URL")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DisplayName",{get:function(){return this.get("DisplayName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DisplayPath",{get:function(){return this.get("DisplayPath")},enumerable:!1,configurable:!0}),t}(t.StateObject),Zr=function(){function e(e){this.e=e}return e.prototype.fix=function(){delete this.e},e}(),$r=function(e){function t(t){var n=e.call(this,t)||this;return n.isSet=!1,n.attrs={},n._children=[],n}return j(t,e),t.prototype.append=function(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")},t.prototype.fix=function(){var e;this.name=this.e.$.name,this.type=this.e.$.type;for(var t=this._children.length-1;t>=0;--t){var n=this._children[t];"Row"===n.name&&void 0===n.type&&((e=this._children).push.apply(e,n._children),this._children.splice(t,1))}var r=this.setOfType();r&&(this.type=r,this.isSet=!0,this._children=[])},t.prototype.children=function(){return this._children},t.prototype.isAll=function(e){return"All"===e.name&&void 0===e.type},t.prototype.setOfType=function(){var e=this.children();if(void 0===this.type&&2===e.length){if(this.isAll(e[0]))return e[1].type;if(this.isAll(e[1]))return e[0].type}},t.prototype.charWidth=function(){var e=-1;switch(this.type){case"xs:boolean":e=5;break;case"xs:integer":case"xs:nonNegativeInteger":case"xs:double":e=8;break;case"xs:string":e=32;break;default:for(var t=this.type.lastIndexOf("_"),n=t>0?t:this.type.length,r=n-1;r>=0&&-1!=="0123456789".indexOf(this.type.charAt(r));--r);r+1<n&&(e=parseInt(this.type.substring(r+1,n),10)),0===this.type.indexOf("data")&&(e*=2)}return e<this.name.length&&(e=this.name.length),e},t}(Zr),eo=function(e){function t(t){return e.call(this,t)||this}return j(t,e),t.prototype.append=function(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e}},t.prototype.fix=function(){this.name=this.e.$.name,this.type=this._restricition.$.base,this.maxLength=this._maxLength?+this._maxLength.$.value:void 0,delete this._restricition,delete this._maxLength,e.prototype.fix.call(this)},t}(Zr),to=function(){function e(){this.simpleTypes={}}return e.prototype.fields=function(){return this.root.children()},e}(),no=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.schema=new to,n.simpleTypes={},n.xsdStack=new t.Stack,n}return j(n,e),n.prototype.startXMLNode=function(t){switch(e.prototype.startXMLNode.call(this,t),t.name){case"xs:element":var n=new $r(t);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(n):this.schema.root=n,this.xsdStack.push(n);break;case"xs:simpleType":this.simpleType=new eo(t)}},n.prototype.endXMLNode=function(t){switch(t.name){case"xs:element":this.xsdStack.pop().fix();break;case"xs:simpleType":this.simpleType.fix(),this.simpleTypes[this.simpleType.name]=this.simpleType,delete this.simpleType;break;case"xs:appinfo":var n=this.xsdStack.top();for(var r in t.$)n.attrs[r]=t.$[r];break;default:this.simpleType&&this.simpleType.append(t)}e.prototype.endXMLNode.call(this,t)},n}(t.SAXStackParser);function ro(e){var t=new no;return t.parse(e),t.schema}var oo=function(e){function n(n){var r=e.call(this)||this;return r.schema=new to,r.simpleTypes={},r.xsdStack=new t.Stack,r._rootName=n,r}return j(n,e),n.prototype.startXMLNode=function(t){switch(e.prototype.startXMLNode.call(this,t),t.name){case"xsd:element":var n=new $r(t);this.schema.root||this._rootName!==t.$.name||(this.schema.root=n),this.xsdStack.depth()&&this.xsdStack.top().append(n),this.xsdStack.push(n);break;case"xsd:simpleType":this.simpleType=new eo(t)}},n.prototype.endXMLNode=function(t){"xsd:element"===t.name&&this.xsdStack.pop().fix();e.prototype.endXMLNode.call(this,t)},n}(no);var io=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.Wuid,"-").concat(e.ResultName)})||this}return j(t,e),t}(t.Cache),so=new io,uo=function(e){function n(t,n,r,o){var i=e.call(this)||this;return i.connection=t instanceof jt?t:new jt(t),"boolean"==typeof o&&!0===o?i.set({NodeGroup:n,LogicalFileName:r}):Rt(r)&&Array.isArray(o)?i.set(W(W({},r),{Wuid:n,ResultName:r.Name,ResultViews:o})):void 0===o?"number"==typeof r?i.set({Wuid:n,ResultSequence:r}):"string"==typeof r?i.set({Wuid:n,ResultName:r}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)"),i}return j(n,e),Object.defineProperty(n.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ResultName",{get:function(){return this.get("ResultName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ResultSequence",{get:function(){return this.get("ResultSequence")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"LogicalFileName",{get:function(){return this.get("LogicalFileName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Sequence",{get:function(){return this.get("Sequence")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Value",{get:function(){return this.get("Value")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Link",{get:function(){return this.get("Link")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"FileName",{get:function(){return this.get("FileName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"IsSupplied",{get:function(){return this.get("IsSupplied")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShowFileContent",{get:function(){return this.get("ShowFileContent")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Total",{get:function(){return this.get("Total")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ECLSchemas",{get:function(){return this.get("ECLSchemas")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"NodeGroup",{get:function(){return this.get("NodeGroup")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ResultViews",{get:function(){return this.get("ResultViews")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"XmlSchema",{get:function(){return this.get("XmlSchema")},enumerable:!1,configurable:!0}),n.attach=function(e,t,r,o){var i;return Array.isArray(o)?(i=so.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r.Name},function(){return new n(e,t,r,o)})).set(r):void 0===o&&("number"==typeof r?i=so.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+r},function(){return new n(e,t,r)}):"string"==typeof r&&(i=so.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r},function(){return new n(e,t,r)}))),i},n.attachLogicalFile=function(e,t,r){return so.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r},function(){return new n(e,t,r,!0)})},n.prototype.isComplete=function(){return-1!==this.Total},n.prototype.fetchXMLSchema=function(e){var t=this;return void 0===e&&(e=!1),this._fetchXMLSchemaPromise&&!e||(this._fetchXMLSchemaPromise=this.WUResult().then(function(e){var n,r;return(null===(r=null===(n=e.Result)||void 0===n?void 0:n.XmlSchema)||void 0===r?void 0:r.xml)?(t.xsdSchema=ro(e.Result.XmlSchema.xml),t.xsdSchema):null})),this._fetchXMLSchemaPromise},n.prototype.refresh=function(){return F(this,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:return[4,this.fetchRows(0,1,!0)];case 1:return e.sent(),[2,this]}})})},n.prototype.fetchRows=function(e,n,r,o,i){var s=this;return void 0===e&&(e=0),void 0===n&&(n=-1),void 0===r&&(r=!1),void 0===o&&(o={}),this.WUResult(e,n,!r,o,i).then(function(e){var n=e.Result;return delete e.Result,s.set(W({},e)),t.exists("XmlSchema.xml",n)&&(s.xsdSchema=ro(n.XmlSchema.xml)),t.exists("Row",n)?n.Row:s.ResultName&&t.exists(s.ResultName,n)?n[s.ResultName].Row:[]})},n.prototype.rootField=function(){return this.xsdSchema?this.xsdSchema.root:null},n.prototype.fields=function(){return this.xsdSchema?this.xsdSchema.root.children():[]},n.prototype.WUResult=function(e,t,n,r,o){void 0===e&&(e=0),void 0===t&&(t=1),void 0===n&&(n=!1),void 0===r&&(r={});var i={NamedValue:{itemcount:0}};for(var s in r)i.NamedValue[i.NamedValue.itemcount++]={Name:s,Value:r[s]};var u={FilterBy:i};return this.Wuid&&void 0!==this.ResultName?(u.Wuid=this.Wuid,u.ResultName=this.ResultName):this.Wuid&&void 0!==this.ResultSequence?(u.Wuid=this.Wuid,u.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(u.LogicalName=this.LogicalFileName,u.Cluster=this.NodeGroup):this.LogicalFileName&&(u.LogicalName=this.LogicalFileName),u.Start=e,u.Count=t,u.SuppressXmlSchema=n,this.connection.WUResult(u,o).then(function(e){return e})},n}(t.StateObject),co=function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName])})||this}return j(n,e),n}(t.Cache),ao=function(e){function t(t,n){var r=e.call(this)||this;return r.scope=t,r.set(n),r}return j(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RawValue",{get:function(){return this.get("RawValue")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Formatted",{get:function(){return this.get("Formatted")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FormattedEnd",{get:function(){return this.get("FormattedEnd")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Measure",{get:function(){return this.get("Measure")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Creator",{get:function(){return this.get("Creator")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CreatorType",{get:function(){return this.get("CreatorType")},enumerable:!1,configurable:!0}),t}(t.StateObject),po=function(e){function t(t){var n=e.call(this)||this;return n._attributeMap={},n._children=[],n.update(t),n}return j(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ScopeName",{get:function(){return this.get("ScopeName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this.get("Id")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ScopeType",{get:function(){return this.get("ScopeType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Properties",{get:function(){return this.get("Properties",{Property:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Notes",{get:function(){return this.get("Notes",{Note:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SinkActivity",{get:function(){return this.get("SinkActivity")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CAttributes",{get:function(){var e=this,t=[],n={start:null,end:null};return this.Properties.Property.forEach(function(r){"ts"===r.Measure&&r.Name.indexOf("Started")>=0?n.start=r:e.ScopeName&&"ts"===r.Measure&&r.Name.indexOf("Finished")>=0?n.end=r:t.push(new ao(e,r))}),n.start&&n.end?(n.start.FormattedEnd=n.end.Formatted,t.push(new ao(this,n.start))):n.start?t.push(new ao(this,n.start)):n.end&&t.push(new ao(this,n.end)),t},enumerable:!1,configurable:!0}),t.prototype.update=function(e){var t=this;for(var n in this.set(e),this.CAttributes.forEach(function(e){t._attributeMap[e.Name]=e}),this.Properties.Property=[],this._attributeMap)this._attributeMap.hasOwnProperty(n)&&this.Properties.Property.push(this._attributeMap[n].properties)},t.prototype.parentScope=function(){var e=this.ScopeName.split(":");return e.pop(),e.join(":")},t.prototype.children=function(e){return arguments.length?(this._children=e,this):this._children},t.prototype.walk=function(e){if(e.start(this))return!0;for(var t=0,n=this.children();t<n.length;t++){if(n[t].walk(e))return!0}return e.end(this)},t.prototype.formattedAttrs=function(){var e={};for(var t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e},t.prototype.rawAttrs=function(){var e={};for(var t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e},t.prototype.hasAttr=function(e){return void 0!==this._attributeMap[e]},t.prototype.attr=function(e){return this._attributeMap[e]||new ao(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})},t.prototype.attrMeasure=function(e){return this._attributeMap[e].Measure},t.prototype.calcTooltip=function(e){var t="",n=[];t=this.Id,n.push('<tr><td class="key">ID:</td><td class="value">'.concat(this.Id,"</td></tr>")),e&&n.push('<tr><td class="key">Parent ID:</td><td class="value">'.concat(e.Id,"</td></tr>")),n.push('<tr><td class="key">Scope:</td><td class="value">'.concat(this.ScopeName,"</td></tr>"));var r=this.formattedAttrs();for(var o in r)"Label"===o?t=r[o]:n.push('<tr><td class="key">'.concat(o,'</td><td class="value">').concat(r[o],"</td></tr>"));return'<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">\n <h4 align="center">'.concat(t,"</h4>\n <table>\n ").concat(n.join(""),"\n </table>\n </div>")},t}(t.StateObject),lo=function(e){function t(t,n){var r=e.call(this,n)||this;return r.wu=t,r}return j(t,e),t}(po),fo=function(e){function t(t,n,r){var o=e.call(this)||this;return o.connection=t instanceof jt?t:new jt(t),o.set(W({Wuid:n},r)),o}return j(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FileCluster",{get:function(){return this.get("FileCluster")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsSuperFile",{get:function(){return this.get("IsSuperFile")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Subs",{get:function(){return this.get("Subs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Count",{get:function(){return this.get("Count")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ECLSourceFiles",{get:function(){return this.get("ECLSourceFiles")},enumerable:!1,configurable:!0}),t}(t.StateObject),ho=function(e){function n(n,r,o){var i=e.call(this)||this;i.connection=n instanceof jt?n:new jt(n);var s=t.espTime2Seconds(o.Value);return i.set(W({Wuid:r,Seconds:Math.round(1e3*s)/1e3,HasSubGraphId:void 0!==o.SubGraphId},o)),i}return j(n,e),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Value",{get:function(){return this.get("Value")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Seconds",{get:function(){return this.get("Seconds")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"GraphName",{get:function(){return this.get("GraphName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SubGraphId",{get:function(){return this.get("SubGraphId")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HasSubGraphId",{get:function(){return this.get("HasSubGraphId")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this.get("count")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Timestamp",{get:function(){return this.get("Timestamp")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"When",{get:function(){return this.get("When")},enumerable:!1,configurable:!0}),n}(t.StateObject),yo=mn("%Y-%m-%dT%H:%M:%S.%LZ"),go=vn("%Y-%m-%dT%H:%M:%S.%LZ"),bo=Nt(",");function mo(e,t,n){void 0!==e[t]&&void 0!==e[t][n]&&"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&delete e[t][n]}var vo="DefinitionList",So=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Uo=["Avg","Min","Max","Delta","StdDev"],_o=["SkewMin","SkewMax","NodeMin","NodeMax"],Po=/[A-Z][a-z]*/g;var Do={};function Co(e){var t=Do[e];return t||(t=function(e){for(var t=0,n=_o;t<n.length;t++){var r=n[t];if(0===(a=e.indexOf(r)))return{measure:i="",ext:r,label:s=e.slice(a+r.length)}}var o=e.match(Po);if(null==o?void 0:o.length){for(var i=o.shift(),s=o.join(""),u=0,c=Uo;u<c.length;u++){var a,p=c[u];if(0===(a=s.indexOf(p)))return{measure:i,ext:p,label:s=s.slice(a+p.length)}}return{measure:i,ext:"",label:s}}return{measure:"",ext:"",label:e}}(e),Do[e]=t),t}function Ro(e,t){var n,r;return null!==(r=null===(n=e.__formattedProps)||void 0===n?void 0:n[t])&&void 0!==r?r:e[t]}function jo(e){if(void 0!==e){var t=parseFloat(e);return isNaN(t)?void 0:t}}function Wo(e,t,n){var r=Co(t);if(!n[r.measure]){n[r.label]=!0;var o=jo(e["".concat(r.measure,"Avg").concat(r.label)]),i=jo(e["".concat(r.measure,"Min").concat(r.label)]),s=jo(e["".concat(r.measure,"Max").concat(r.label)]),u=jo(e["".concat(r.measure,"StdDev").concat(r.label)]),c=Math.max((o-i)/u,(s-o)/u);return{Key:"".concat(r.measure).concat(r.label),Value:Ro(e,"".concat(r.measure).concat(r.label)),Avg:Ro(e,"".concat(r.measure,"Avg").concat(r.label)),Min:Ro(e,"".concat(r.measure,"Min").concat(r.label)),Max:Ro(e,"".concat(r.measure,"Max").concat(r.label)),Delta:Ro(e,"".concat(r.measure,"Delta").concat(r.label)),StdDev:Ro(e,"".concat(r.measure,"StdDev").concat(r.label)),StdDevs:isNaN(c)?void 0:c,SkewMin:Ro(e,"SkewMin".concat(r.label)),SkewMax:Ro(e,"SkewMax".concat(r.label)),NodeMin:Ro(e,"NodeMin".concat(r.label)),NodeMax:Ro(e,"NodeMax".concat(r.label))}}return null}var Fo,wo=t.scopedLogger("workunit.ts"),Ao=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.Wuid)})||this}return j(t,e),t}(t.Cache),To=new Ao,Oo=function(n){function r(e,t){var r=n.call(this)||this;return r._debugMode=!1,r._resultCache=new co,r._graphCache=new Nr,r.connection=new jt(e),r.topologyConnection=new Ut(e),r.clearState(t),r}return j(r,n),Object.defineProperty(r.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Owner",{get:function(){return this.get("Owner","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Cluster",{get:function(){return this.get("Cluster","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Jobname",{get:function(){return this.get("Jobname","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Description",{get:function(){return this.get("Description","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ActionEx",{get:function(){return this.get("ActionEx","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"StateID",{get:function(){return this.get("StateID",e.WUStateID.Unknown)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"State",{get:function(){return this.get("State")||e.WUStateID[this.StateID]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Protected",{get:function(){return this.get("Protected",!1)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Exceptions",{get:function(){return this.get("Exceptions",{ECLException:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResultViews",{get:function(){return this.get("ResultViews",{View:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResultCount",{get:function(){return this.get("ResultCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Results",{get:function(){return this.get("Results",{ECLResult:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CResults",{get:function(){var e=this;return this.Results.ECLResult.map(function(t){return e._resultCache.get(t,function(){return uo.attach(e.connection,e.Wuid,t,e.ResultViews.View)})})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"SequenceResults",{get:function(){var e={};return this.CResults.forEach(function(t){e[t.Sequence]=t}),e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Timers",{get:function(){return this.get("Timers",{ECLTimer:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CTimers",{get:function(){var e=this;return this.Timers.ECLTimer.map(function(t){return new ho(e.connection,e.Wuid,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"GraphCount",{get:function(){return this.get("GraphCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Graphs",{get:function(){return this.get("Graphs",{ECLGraph:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CGraphs",{get:function(){var e=this;return this.Graphs.ECLGraph.map(function(t){return e._graphCache.get(t,function(){return new Ir(e,t,e.CTimers)})})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ThorLogList",{get:function(){return this.get("ThorLogList")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResourceURLCount",{get:function(){return this.get("ResourceURLCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResourceURLs",{get:function(){return this.get("ResourceURLs",{URL:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CResourceURLs",{get:function(){var e=this;return this.ResourceURLs.URL.map(function(t){return new Yr(e,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"TotalClusterTime",{get:function(){return this.get("TotalClusterTime","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"DateTimeScheduled",{get:function(){return this.get("DateTimeScheduled")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"IsPausing",{get:function(){return this.get("IsPausing")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ThorLCR",{get:function(){return this.get("ThorLCR")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ApplicationValues",{get:function(){return this.get("ApplicationValues",{ApplicationValue:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HasArchiveQuery",{get:function(){return this.get("HasArchiveQuery")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"StateEx",{get:function(){return this.get("StateEx")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"PriorityClass",{get:function(){return this.get("PriorityClass")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"PriorityLevel",{get:function(){return this.get("PriorityLevel")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Snapshot",{get:function(){return this.get("Snapshot")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResultLimit",{get:function(){return this.get("ResultLimit")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"EventSchedule",{get:function(){return this.get("EventSchedule")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Query",{get:function(){return this.get("Query")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HelpersCount",{get:function(){return this.get("HelpersCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Helpers",{get:function(){return this.get("Helpers",{ECLHelpFile:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"DebugValues",{get:function(){return this.get("DebugValues")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"AllowedClusters",{get:function(){return this.get("AllowedClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ErrorCount",{get:function(){return this.get("ErrorCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"WarningCount",{get:function(){return this.get("WarningCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"InfoCount",{get:function(){return this.get("InfoCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"AlertCount",{get:function(){return this.get("AlertCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"SourceFileCount",{get:function(){return this.get("SourceFileCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"SourceFiles",{get:function(){return this.get("SourceFiles",{ECLSourceFile:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CSourceFiles",{get:function(){var e=this;return this.SourceFiles.ECLSourceFile.map(function(t){return new fo(e.connection,e.Wuid,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"VariableCount",{get:function(){return this.get("VariableCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Variables",{get:function(){return this.get("Variables",{ECLResult:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"TimerCount",{get:function(){return this.get("TimerCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HasDebugValue",{get:function(){return this.get("HasDebugValue")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ApplicationValueCount",{get:function(){return this.get("ApplicationValueCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"XmlParams",{get:function(){return this.get("XmlParams")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"AccessFlag",{get:function(){return this.get("AccessFlag")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ClusterFlag",{get:function(){return this.get("ClusterFlag")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResultViewCount",{get:function(){return this.get("ResultViewCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"DebugValueCount",{get:function(){return this.get("DebugValueCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"WorkflowCount",{get:function(){return this.get("WorkflowCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Archived",{get:function(){return this.get("Archived")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RoxieCluster",{get:function(){return this.get("RoxieCluster")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"DebugState",{get:function(){return this.get("DebugState",{})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Queue",{get:function(){return this.get("Queue")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Active",{get:function(){return this.get("Active")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Action",{get:function(){return this.get("Action")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Scope",{get:function(){return this.get("Scope")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"AbortBy",{get:function(){return this.get("AbortBy")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"AbortTime",{get:function(){return this.get("AbortTime")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Workflows",{get:function(){return this.get("Workflows")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"TimingData",{get:function(){return this.get("TimingData")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HelpersDesc",{get:function(){return this.get("HelpersDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"GraphsDesc",{get:function(){return this.get("GraphsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"SourceFilesDesc",{get:function(){return this.get("SourceFilesDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResultsDesc",{get:function(){return this.get("ResultsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"VariablesDesc",{get:function(){return this.get("VariablesDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"TimersDesc",{get:function(){return this.get("TimersDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"DebugValuesDesc",{get:function(){return this.get("DebugValuesDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ApplicationValuesDesc",{get:function(){return this.get("ApplicationValuesDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"WorkflowsDesc",{get:function(){return this.get("WorkflowsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ServiceNames",{get:function(){return this.get("ServiceNames")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CompileCost",{get:function(){return this.get("CompileCost")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ExecuteCost",{get:function(){return this.get("ExecuteCost")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"FileAccessCost",{get:function(){return this.get("FileAccessCost")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"NoAccess",{get:function(){return this.get("NoAccess")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ECLWUProcessList",{get:function(){return this.get("ECLWUProcessList")},enumerable:!1,configurable:!0}),r.create=function(e){var t=new r(e);return t.connection.WUCreate().then(function(e){return To.set(t),t.set(e.Workunit),t})},r.attach=function(e,t,n){var o=To.get({BaseUrl:e.baseUrl,Wuid:t},function(){return new r(e,t)});return n&&o.set(n),o},r.existsLocal=function(e,t){return To.has({BaseUrl:e,Wuid:t})},r.submit=function(t,n,o,i){return void 0===i&&(i=!1),r.create(t).then(function(e){return e.update({QueryText:o})}).then(function(t){return i?t.submit(n,e.WUUpdate.Action.Compile):t.submit(n)})},r.compile=function(e,t,n){return r.submit(e,t,n,!0)},r.query=function(e,t){return new jt(e).WUQuery(t).then(function(t){return t.Workunits.ECLWorkunit.map(function(t){return r.attach(e,t.Wuid,t)})})},r.prototype.clearState=function(t){this.clear({Wuid:t,StateID:e.WUStateID.Unknown})},r.prototype.update=function(e){var t=this;return this.connection.WUUpdate(W(W({},e),{Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster})).then(function(e){return t.set(e.Workunit),t})},r.prototype.submit=function(t,n,r){var o,i=this;return void 0===n&&(n=e.WUUpdate.Action.Run),o=void 0!==t?Promise.resolve(t):this.topologyConnection.DefaultTpLogicalClusterQuery().then(function(e){return e.Name}),this._debugMode=!1,n===e.WUUpdate.Action.Debug&&(n=e.WUUpdate.Action.Run,this._debugMode=!0),o.then(function(e){return i.connection.WUUpdate({Wuid:i.Wuid,Action:n,ResultLimit:r,DebugValues:{DebugValue:[{Name:"Debug",Value:i._debugMode?"1":""}]}}).then(function(t){return i.set(t.Workunit),i._submitAction=n,i.connection.WUSubmit({Wuid:i.Wuid,Cluster:e})})}).then(function(){return i})},r.prototype.isComplete=function(){switch(this.StateID){case e.WUStateID.Compiled:return"compile"===this.ActionEx||this._submitAction===e.WUUpdate.Action.Compile;case e.WUStateID.Completed:case e.WUStateID.Failed:case e.WUStateID.Aborted:case e.WUStateID.NotFound:return!0}return!1},r.prototype.isFailed=function(){switch(this.StateID){case e.WUStateID.Aborted:case e.WUStateID.Failed:return!0}return!1},r.prototype.isDeleted=function(){return this.StateID===e.WUStateID.NotFound},r.prototype.isDebugging=function(){switch(this.StateID){case e.WUStateID.DebugPaused:case e.WUStateID.DebugRunning:return!0}return this._debugMode},r.prototype.isRunning=function(){switch(this.StateID){case e.WUStateID.Compiled:case e.WUStateID.Running:case e.WUStateID.Aborting:case e.WUStateID.Blocked:case e.WUStateID.DebugPaused:case e.WUStateID.DebugRunning:return!0}return!1},r.prototype.setToFailed=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.SetToFailed)},r.prototype.pause=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Pause)},r.prototype.pauseNow=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.PauseNow)},r.prototype.resume=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Resume)},r.prototype.abort=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Abort)},r.prototype.protect=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Protect)},r.prototype.unprotect=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Unprotect)},r.prototype.delete=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Delete)},r.prototype.restore=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Restore)},r.prototype.deschedule=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Deschedule)},r.prototype.reschedule=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Reschedule)},r.prototype.resubmit=function(){var e=this;return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(function(){return e.clearState(e.Wuid),e.refresh().then(function(){return e._monitor(),e})})},r.prototype.clone=function(){var e=this;return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(function(t){return r.attach(e.connection.opts(),t.WUs.WU[0].WUID).refresh()})},r.prototype.refreshState=function(){return F(this,void 0,void 0,function(){return w(this,function(t){switch(t.label){case 0:return[4,this.WUQuery()];case 1:return t.sent(),this.StateID!==e.WUStateID.Compiled||this.ActionEx||this._submitAction?[3,3]:[4,this.refreshInfo()];case 2:t.sent(),t.label=3;case 3:return[2,this]}})})},r.prototype.refreshInfo=function(e){return F(this,void 0,void 0,function(){return w(this,function(t){switch(t.label){case 0:return[4,this.WUInfo(e)];case 1:return t.sent(),[2,this]}})})},r.prototype.refreshDebug=function(){return F(this,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:return[4,this.debugStatus()];case 1:return e.sent(),[2,this]}})})},r.prototype.refresh=function(){return F(this,arguments,void 0,function(e,t){return void 0===e&&(e=!1),w(this,function(n){switch(n.label){case 0:return e?[4,Promise.all([this.refreshInfo(t),this.refreshDebug()])]:[3,2];case 1:return n.sent(),[3,4];case 2:return[4,this.refreshState()];case 3:n.sent(),n.label=4;case 4:return[2,this]}})})},r.prototype.eclExceptions=function(){return this.Exceptions.ECLException},r.prototype.fetchArchive=function(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})},r.prototype.fetchECLExceptions=function(){var e=this;return this.WUInfo({IncludeExceptions:!0}).then(function(){return e.eclExceptions()})},r.prototype.fetchResults=function(){var e=this;return this.WUInfo({IncludeResults:!0}).then(function(){return e.CResults})},r.prototype.fetchGraphs=function(){var e=this;return this.WUInfo({IncludeGraphs:!0}).then(function(){return e.CGraphs})},r.prototype.fetchQuery=function(){var e=this;return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(function(){return e.Query})},r.prototype.fetchHelpers=function(){var e=this;return this.WUInfo({IncludeHelpers:!0}).then(function(){var t;return(null===(t=e.Helpers)||void 0===t?void 0:t.ECLHelpFile)||[]})},r.prototype.fetchAllowedClusters=function(){var e=this;return this.WUInfo({IncludeAllowedClusters:!0}).then(function(){var t;return(null===(t=e.AllowedClusters)||void 0===t?void 0:t.AllowedCluster)||[]})},r.prototype.fetchTotalClusterTime=function(){var e=this;return this.WUInfo({IncludeTotalClusterTime:!0}).then(function(){return e.TotalClusterTime})},r.prototype.fetchServiceNames=function(){var e=this;return this.WUInfo({IncludeServiceNames:!0}).then(function(){var t;return null===(t=e.ServiceNames)||void 0===t?void 0:t.Item})},r.prototype.fetchDetailsMeta=function(e){return void 0===e&&(e={}),this.WUDetailsMeta(e)},r.prototype.fetchDetailsRaw=function(e){return void 0===e&&(e={}),this.WUDetails(e).then(function(e){return e.Scopes.Scope})},r.prototype.normalizeDetails=function(e,t){for(var n,r,o={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},i=[],s=function(t){var s={},u={};if(t&&t.Id&&t.Properties&&t.Properties.Property){var c=function(i){var c,a=t.Properties.Property[i];if("ns"===a.Measure&&(a.Measure="s"),"Kind"===a.Name){var p=parseInt(a.RawValue,10);a.Formatted=null!==(n=e.Activities.Activity.filter(function(e){return e.Kind===p})[0].Name)&&void 0!==n?n:a.RawValue}switch(o[a.Name]=W({},a),mo(o,a.Name,"RawValue"),mo(o,a.Name,"Formatted"),a.Measure){case"bool":s[a.Name]=!!+a.RawValue;break;case"sz":case"ns":case"cnt":case"node":case"skw":s[a.Name]=+a.RawValue;break;case"s":s[a.Name]=+a.RawValue/1e9;break;case"ts":s[a.Name]=new Date(+a.RawValue/1e3).toISOString();break;case"cost":s[a.Name]=+a.RawValue/1e6;break;default:s[a.Name]=a.RawValue}u[a.Name]=(c=null!==(r=a.Formatted)&&void 0!==r?r:s[a.Name])&&!isNaN(+c)?bo(+c):c};for(var a in t.Properties.Property)c(a)}var p=W({id:t.Id,name:t.ScopeName,type:t.ScopeType,Kind:t.Kind,Label:t.Label,__formattedProps:u,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:""},s);if(p[vo])try{var l=JSON.parse(p[vo].split("\\").join("\\\\"));p[vo]=[],l.forEach(function(e,t){var n,r=e.match(So);if(r){var o=(null!==(n=r[1])&&void 0!==n?n:"")+r[2]+r[3],i=parseInt(r[5]),s=parseInt(r[6]);p[vo].push({filePath:o,line:i,col:s})}})}catch(e){wo.error('Unexpected "DefinitionList": '.concat(p[vo]))}var f={};for(var a in p)if(0!==a.indexOf("__")){var h=Wo(p,a,f);h&&(p.__groupedProps[h.Key]=h,!isNaN(h.StdDevs)&&p.__StdDevs<h.StdDevs&&(p.__StdDevs=h.StdDevs,p.__StdDevsSource=h.Key))}i.push(p)},u=0,c=t;u<c.length;u++){s(c[u])}return{meta:e,columns:o,data:i}},r.prototype.fetchDetailsNormalized=function(e){var t=this;return void 0===e&&(e={}),Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(function(e){return t.normalizeDetails(e[0],e[1])})},r.prototype.fetchInfo=function(e){return void 0===e&&(e={}),this.WUInfo(e)},r.prototype.fetchDetails=function(e){var t=this;return void 0===e&&(e={}),this.WUDetails(e).then(function(e){return e.Scopes.Scope.map(function(e){return new lo(t,e)})})},r.prototype.fetchDetailsHierarchy=function(e){var t=this;return void 0===e&&(e={}),this.WUDetails(e).then(function(e){var n=[],r={};for(var o in e.Scopes.Scope.forEach(function(e){if(r[e.ScopeName])return r[e.ScopeName].update(e),null;var n=new lo(t,e);return r[n.ScopeName]=n,n}),r)if(r.hasOwnProperty(o)){var i=r[o],s=i.parentScope();s&&r[s]?r[s].children().push(i):n.push(i)}return n})},r.prototype.fetchGraphDetails=function(e,t){return void 0===e&&(e=[]),this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:t},NestedFilter:{Depth:999999,ScopeTypes:["graph","subgraph","activity","edge","function"]},PropertiesToReturn:{AllStatistics:!0,AllAttributes:!0,AllHints:!0,AllProperties:!0,AllScopes:!0},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}})},r.prototype.fetchScopeGraphs=function(e){return void 0===e&&(e=[]),this.fetchGraphDetails(e,["graph"]).then(function(e){return Kr(e)})},r.prototype.fetchTimeElapsed=function(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(function(e){var t={};e.forEach(function(e){t[e.ScopeName]=t[e.ScopeName]||{scope:e.ScopeName,start:null,elapsed:null,finish:null},e.CAttributes.forEach(function(n){"TimeElapsed"===n.Name?t[e.ScopeName].elapsed=+n.RawValue:"ts"===n.Measure&&n.Name.indexOf("Started")>=0&&(t[e.ScopeName].start=n.Formatted)})});var n=[];for(var r in t){var o=t[r];if(o.start&&o.elapsed){var i=go(o.start);i.setMilliseconds(i.getMilliseconds()+o.elapsed/1e6),o.finish=yo(i),n.push(o)}}return n.sort(function(e,t){return e.start<t.start?-1:e.start>t.start?1:0}),n})},r.prototype._monitor=function(){this.isComplete()?this._monitorTickCount=0:n.prototype._monitor.call(this)},r.prototype._monitorTimeoutDuration=function(){var e=n.prototype._monitorTimeoutDuration.call(this);return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e},r.prototype.on=function(e,t,r){var o=this;if(this.isCallback(t))switch(e){case"completed":n.prototype.on.call(this,"propChanged","StateID",function(e){o.isComplete()&&t([e])});break;case"changed":n.prototype.on.call(this,e,t)}else if("changed"===e)n.prototype.on.call(this,e,t,r);return this._monitor(),this},r.prototype.watchUntilComplete=function(e){var t=this;return new Promise(function(n,r){var o=t.watch(function(r){e&&e(r),t.isComplete()&&(o.release(),n(t))})})},r.prototype.watchUntilRunning=function(e){var t=this;return new Promise(function(n,r){var o=t.watch(function(r){e&&e(r),(t.isComplete()||t.isRunning())&&(o.release(),n(t))})})},r.prototype.WUQuery=function(t){var n=this;return void 0===t&&(t={}),this.connection.WUQuery(W(W({},t),{Wuid:this.Wuid})).then(function(e){return n.set(e.Workunits.ECLWorkunit[0]),e}).catch(function(t){if(!t.Exception.some(function(t){return 20081===t.Code&&(n.clearState(n.Wuid),n.set("StateID",e.WUStateID.NotFound),!0)}))throw wo.warning("Unexpected ESP exception: ".concat(t.message)),t;return{}})},r.prototype.WUCreate=function(){var e=this;return this.connection.WUCreate().then(function(t){return e.set(t.Workunit),To.set(e),t})},r.prototype.WUInfo=function(t){var n=this;void 0===t&&(t={});var r=t.IncludeResults||t.IncludeResultsViewNames;return this.connection.WUInfo(W(W({},t),{Wuid:this.Wuid,IncludeResults:r,IncludeResultsViewNames:r,SuppressResultSchemas:!1})).then(function(e){return n.set(e.Workunit),r&&n.set({ResultViews:e.ResultViews}),e}).catch(function(t){if(!t.Exception.some(function(t){return 20080===t.Code&&(n.clearState(n.Wuid),n.set("StateID",e.WUStateID.NotFound),!0)}))throw wo.warning("Unexpected ESP exception: ".concat(t.message)),t;return{}})},r.prototype.WUResubmit=function(e){return this.connection.WUResubmit(t.deepMixinT({},e,{Wuids:{Item:[this.Wuid]}}))},r.prototype.WUDetailsMeta=function(e){return this.connection.WUDetailsMeta(e)},r.prototype.WUDetails=function(e){return this.connection.WUDetails(t.deepMixinT({ScopeFilter:{MaxDepth:9999},ScopeOptions:{IncludeMatchedScopesInResults:!0,IncludeScope:!0,IncludeId:!1,IncludeScopeType:!1},PropertyOptions:{IncludeName:!0,IncludeRawValue:!1,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},e,{WUID:this.Wuid})).then(function(e){return t.deepMixinT({Scopes:{Scope:[]}},e)})},r.prototype.WUAction=function(e){var t=this;return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(function(e){return t.refresh().then(function(){return t._monitor(),e})})},r.prototype.publish=function(t){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:t||this.Jobname,AllowForeignFiles:!0,Activate:e.WsWorkunits.WUQueryActivationMode.ActivateQuery,Wait:5e3})},r.prototype.publishEx=function(e){var t=new Wt({baseUrl:""}),n=W({Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3},e);return t.WUPublishWorkunitEx(n)},r.prototype.WUCDebug=function(e,t){void 0===t&&(t={});var n="";for(var r in t)t.hasOwnProperty(r)&&(n+=" ".concat(r,"='").concat(t[r],"'"));return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:"<debug:".concat(e," uid='").concat(this.Wuid,"'").concat(n,"/>")}).then(function(e){return e})},r.prototype.debug=function(e,n){return this.isDebugging()?this.WUCDebug(e,n).then(function(n){var r=n.children(e);return r.length?r[0]:new t.XMLNode(e)}).catch(function(n){return wo.error(n),Promise.resolve(new t.XMLNode(e))}):Promise.resolve(new t.XMLNode(e))},r.prototype.debugStatus=function(){var e=this;return this.isDebugging()?this.debug("status").then(function(t){var n=W(W({},e.DebugState),t.$);return e.set({DebugState:n}),t}):Promise.resolve({DebugState:{state:"unknown"}})},r.prototype.debugContinue=function(e){return void 0===e&&(e=""),this.debug("continue",{mode:e})},r.prototype.debugStep=function(e){return this.debug("step",{mode:e})},r.prototype.debugPause=function(){return this.debug("interrupt")},r.prototype.debugQuit=function(){return this.debug("quit")},r.prototype.debugDeleteAllBreakpoints=function(){return this.debug("delete",{idx:0})},r.prototype.debugBreakpointResponseParser=function(e){return e.children().map(function(e){if("break"===e.name)return e.$})},r.prototype.debugBreakpointAdd=function(e,t,n){var r=this;return this.debug("breakpoint",{id:e,mode:t,action:n}).then(function(e){return r.debugBreakpointResponseParser(e)})},r.prototype.debugBreakpointList=function(){var e=this;return this.debug("list").then(function(t){return e.debugBreakpointResponseParser(t)})},r.prototype.debugGraph=function(){var e=this;return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(function(t){return e.DebugState._prevGraphSequenceNum=e.DebugState.graphSequenceNum,e._debugAllGraph=Xr(e.Wuid,t),e._debugAllGraph})},r.prototype.debugBreakpointValid=function(e){return this.debugGraph().then(function(t){return function(e,t){for(var n=[],r=0,o=e.vertices;r<o.length;r++){var i=o[r];if(Eo(i)){var s=xo(i);(s&&!t||t===s.file)&&n.push(s)}}return n.sort(function(e,t){return e.line-t.line})}(t,e)})},r.prototype.debugPrint=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=10),this.debug("print",{edgeID:e,startRow:t,numRows:n}).then(function(e){return e.children().map(function(e){var t={};return e.children().forEach(function(e){t[e.name]=e.content}),t})})},r}(t.StateObject),Lo="definition";function Eo(e){return void 0!==e._[Lo]}function xo(e){var t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[Lo]);if(t){var n=t[1],r=t[2],o=t[3];return n.replace(/\/\.\//g,"/"),{id:e._.id,file:n,line:+r,column:+o}}throw new Error("Bad definition: ".concat(e._[Lo]))}var Io=function(e){function n(n){var r=e.call(this)||this;return r.lazyRefresh=t.debounce(function(){return F(r,void 0,void 0,function(){var e;return w(this,function(t){switch(t.label){case 0:return[4,this.connection.Activity({})];case 1:return e=t.sent(),this.set(e),[2,this]}})})}),r.connection=n instanceof it?n:new it(n),r.clear({}),r}return j(n,e),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Exceptions",{get:function(){return this.get("Exceptions")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Build",{get:function(){return this.get("Build")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ThorClusterList",{get:function(){return this.get("ThorClusterList")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RoxieClusterList",{get:function(){return this.get("RoxieClusterList")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HThorClusterList",{get:function(){return this.get("HThorClusterList")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DFUJobs",{get:function(){return this.get("DFUJobs")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Running",{get:function(){return this.get("Running",{ActiveWorkunit:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerContent",{get:function(){return this.get("BannerContent")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerColor",{get:function(){return this.get("BannerColor")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerSize",{get:function(){return this.get("BannerSize")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerScroll",{get:function(){return this.get("BannerScroll")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ChatURL",{get:function(){return this.get("ChatURL")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShowBanner",{get:function(){return this.get("ShowBanner")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShowChatURL",{get:function(){return this.get("ShowChatURL")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SortBy",{get:function(){return this.get("SortBy")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Descending",{get:function(){return this.get("Descending")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SuperUser",{get:function(){return this.get("SuperUser")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"AccessRight",{get:function(){return this.get("AccessRight")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ServerJobQueues",{get:function(){return this.get("ServerJobQueues")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ActivityTime",{get:function(){return this.get("ActivityTime")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DaliDetached",{get:function(){return this.get("DaliDetached")},enumerable:!1,configurable:!0}),n.attach=function(e,t){return Fo||(Fo=new n(e)),t&&Fo.set(t),Fo},n.prototype.runningWorkunits=function(e){var t=this;return void 0===e&&(e=""),this.Running.ActiveWorkunit.filter(function(t){return""===e||t.ClusterName===e}).map(function(e){return Oo.attach(t.connection.connectionOptions(),e.Wuid,e)})},n.prototype.setBanner=function(e){var t=this;return this.connection.SetBanner(W({},e)).then(function(e){return t.set(e),t})},n.prototype.refresh=function(){return F(this,void 0,void 0,function(){return w(this,function(e){return[2,this.lazyRefresh()]})})},n}(t.StateObject),No=t.scopedLogger("logicalFile.ts"),Mo=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.Cluster,"-").concat(e.Name)})||this}return j(t,e),t}(t.Cache),ko=new Mo,Go=function(e){function t(t,n,r){var o=e.call(this)||this;return o.connection=t instanceof Pe?t:new Pe(t),o.clear({Cluster:n,Name:r}),o}return j(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Cluster",{get:function(){return this.get("Cluster")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Filename",{get:function(){return this.get("Filename")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Prefix",{get:function(){return this.get("Prefix")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"NodeGroup",{get:function(){return this.get("NodeGroup")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"NumParts",{get:function(){return this.get("NumParts")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Description",{get:function(){return this.get("Description")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dir",{get:function(){return this.get("Dir")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PathMask",{get:function(){return this.get("PathMask")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Filesize",{get:function(){return this.get("Filesize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FileSizeInt64",{get:function(){return this.get("FileSizeInt64")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordSize",{get:function(){return this.get("RecordSize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordCount",{get:function(){return this.get("RecordCount")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordSizeInt64",{get:function(){return this.get("RecordSizeInt64")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordCountInt64",{get:function(){return this.get("RecordCountInt64")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Owner",{get:function(){return this.get("Owner")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"JobName",{get:function(){return this.get("JobName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Persistent",{get:function(){return this.get("Persistent")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Format",{get:function(){return this.get("Format")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"MaxRecordSize",{get:function(){return this.get("MaxRecordSize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvSeparate",{get:function(){return this.get("CsvSeparate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvQuote",{get:function(){return this.get("CsvQuote")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvTerminate",{get:function(){return this.get("CsvTerminate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvEscape",{get:function(){return this.get("CsvEscape")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Modified",{get:function(){return this.get("Modified")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ecl",{get:function(){return this.get("Ecl")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Stat",{get:function(){return this.get("Stat")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DFUFilePartsOnClusters",{get:function(){return this.get("DFUFilePartsOnClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSuperfile",{get:function(){return this.get("isSuperfile")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ShowFileContent",{get:function(){return this.get("ShowFileContent")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subfiles",{get:function(){return this.get("subfiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Superfiles",{get:function(){return this.get("Superfiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ProtectList",{get:function(){return this.get("ProtectList")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FromRoxieCluster",{get:function(){return this.get("FromRoxieCluster")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Graphs",{get:function(){return this.get("Graphs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"UserPermission",{get:function(){return this.get("UserPermission")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ContentType",{get:function(){return this.get("ContentType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CompressedFileSize",{get:function(){return this.get("CompressedFileSize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PercentCompressed",{get:function(){return this.get("PercentCompressed")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsCompressed",{get:function(){return this.get("IsCompressed")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BrowseData",{get:function(){return this.get("BrowseData")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jsonInfo",{get:function(){return this.get("jsonInfo")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"binInfo",{get:function(){return this.get("binInfo")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PackageID",{get:function(){return this.get("PackageID")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Partition",{get:function(){return this.get("Partition")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Blooms",{get:function(){return this.get("Blooms")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ExpireDays",{get:function(){return this.get("ExpireDays")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"KeyType",{get:function(){return this.get("KeyType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsRestricted",{get:function(){return this.get("IsRestricted")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"AtRestCost",{get:function(){return this.get("AtRestCost")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"AccessCost",{get:function(){return this.get("AccessCost")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"StateID",{get:function(){return this.get("StateID")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ExpirationDate",{get:function(){return this.get("ExpirationDate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ExtendedIndexInfo",{get:function(){return this.get("ExtendedIndexInfo")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),t.attach=function(e,n,r,o){var i=ko.get({BaseUrl:e.baseUrl,Cluster:n,Name:r},function(){return new t(e,n,r)});return o&&i.set(o),i},t.prototype.filePartsOnCluster=function(){var e;return A([],(null===(e=this.DFUFilePartsOnClusters)||void 0===e?void 0:e.DFUFilePartsOnCluster)||[],!0)},t.prototype.fileParts=function(){for(var e,t,n=[],r=0,o=(null===(e=this.DFUFilePartsOnClusters)||void 0===e?void 0:e.DFUFilePartsOnCluster)||[];r<o.length;r++)for(var i=o[r],s=0,u=(null===(t=null==i?void 0:i.DFUFileParts)||void 0===t?void 0:t.DFUPart)||[];s<u.length;s++){var c=u[s],a=W(W({},i),c);delete a.DFUFileParts,n.push(a)}return n},t.prototype.update=function(e){var t=this;return this.connection.DFUInfo(W(W({},e),{Cluster:this.Cluster,Name:this.Name})).then(function(e){return t.set(W({Cluster:t.Cluster},e.FileDetail)),e})},t.prototype.fetchInfo=function(){var e=this;return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(function(t){var n,r;return e.set(W(W({Cluster:e.Cluster},t.FileDetail),{ProtectList:null!==(r=null===(n=null==t?void 0:t.FileDetail)||void 0===n?void 0:n.ProtectList)&&void 0!==r?r:{DFUFileProtect:[]}})),t.FileDetail}).catch(function(t){if(!t.Exception.some(function(t){return 20038===t.Code&&(e.set("Name",e.Name+" (Deleted)"),e.set("StateID",999),!0)}))throw No.warning("Unexpected ESP exception: ".concat(t.message)),t;return{}})},t.prototype.fetchDefFile=function(e){return this.connection.DFUFile({Name:this.Name,Format:e})},t.prototype.fetchAllLogicalFiles=function(){return this.connection.recursiveFetchLogicalFiles([this])},t.prototype.fetchListHistory=function(){return this.connection.ListHistory({Name:this.Name}).then(function(e){var t;return(null===(t=null==e?void 0:e.History)||void 0===t?void 0:t.Origin)||[]})},t.prototype.eraseHistory=function(){return this.connection.EraseHistory({Name:this.Name}).then(function(e){var t;return(null===(t=null==e?void 0:e.History)||void 0===t?void 0:t.Origin)||[]})},t}(t.StateObject),Vo=function(e){function t(){return e.call(this,function(e){return e.Address})||this}return j(t,e),t}(t.Cache),Qo=new Vo,Bo=function(e){function t(t){var n=e.call(this)||this;return n.connection=t instanceof Ke?t:new Ke(t),n}return j(t,e),Object.defineProperty(t.prototype,"Address",{get:function(){return this.get("Address")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ConfigAddress",{get:function(){return this.get("ConfigAddress")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ProcessType",{get:function(){return this.get("ProcessType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DisplayType",{get:function(){return this.get("DisplayType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Description",{get:function(){return this.get("Description")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"AgentVersion",{get:function(){return this.get("AgentVersion")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Contact",{get:function(){return this.get("Contact")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Location",{get:function(){return this.get("Location")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"UpTime",{get:function(){return this.get("UpTime")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ComponentName",{get:function(){return this.get("ComponentName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ComponentPath",{get:function(){return this.get("ComponentPath")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RoxieState",{get:function(){return this.get("RoxieState")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RoxieStateDetails",{get:function(){return this.get("RoxieStateDetails")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OS",{get:function(){return this.get("OS")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ProcessNumber",{get:function(){return this.get("ProcessNumber")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Channels",{get:function(){return this.get("Channels")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Processors",{get:function(){return this.get("Processors")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Storage",{get:function(){return this.get("Storage")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Running",{get:function(){return this.get("Running")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PhysicalMemory",{get:function(){return this.get("PhysicalMemory")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"VirtualMemory",{get:function(){return this.get("VirtualMemory")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ComponentInfo",{get:function(){return this.get("ComponentInfo")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Exception",{get:function(){return this.get("Exception")},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){var o=Qo.get({Address:n},function(){return new t(e)});return r&&o.set(r),o},t}(t.StateObject),Xo=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.Name)})||this}return j(t,e),t}(t.Cache),Ho=new Xo,Jo=function(e){function t(t,n){var r=e.call(this)||this;return t instanceof Ut?(r.connection=t,r.machineConnection=new Ke(t.connectionOptions())):(r.connection=new Ut(t),r.machineConnection=new Ke(t)),r.clear({Name:n}),r}return j(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Prefix",{get:function(){return this.get("Prefix")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.get("Type")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsDefault",{get:function(){return this.get("IsDefault")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpClusters",{get:function(){return this.get("TpClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclCCServers",{get:function(){return this.get("TpEclCCServers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclServers",{get:function(){return this.get("TpEclServers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclAgents",{get:function(){return this.get("TpEclAgents")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclSchedulers",{get:function(){return this.get("TpEclSchedulers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"MachineInfoEx",{get:function(){return this.get("MachineInfoEx",[])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMachineInfoEx",{get:function(){var e=this;return this.MachineInfoEx.map(function(t){return Bo.attach(e.machineConnection,t.Address,t)})},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){var o=Ho.get({BaseUrl:e.baseUrl,Name:n},function(){return new t(e,n)});return r&&o.set(r),o},t.prototype.fetchMachines=function(e){var t=this;return void 0===e&&(e={}),this.machineConnection.GetTargetClusterInfo(W({TargetClusters:{Item:["".concat(this.Type,":").concat(this.Name)]}},e)).then(function(e){for(var n=[],r=0,o=e.TargetClusterInfoList.TargetClusterInfo;r<o.length;r++)for(var i=0,s=o[r].Processes.MachineInfoEx;i<s.length;i++){var u=s[i];n.push(u)}return t.set("MachineInfoEx",n),t.CMachineInfoEx})},t.prototype.machineStats=function(){for(var e=0,t=0,n=0,r=0,o=this.CMachineInfoEx;r<o.length;r++)for(var i=0,s=o[r].Storage.StorageInfo;i<s.length;i++){var u=s[i];t+=u.Available,n+=u.Total;var c=1-u.Available/u.Total;c>e&&(e=c)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}},t.prototype.fetchUsage=function(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])},t}(t.StateObject);var qo={};var zo,Ko,Yo=function(e){function t(){return e.call(this,function(e){return e.BaseUrl})||this}return j(t,e),t}(t.Cache),Zo=new Yo,$o=function(e){function n(t){var n=e.call(this)||this;return n.connection=t instanceof Ut?t:new Ut(t),n}return j(n,e),Object.defineProperty(n.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"TargetClusters",{get:function(){return this.get("TargetClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CTargetClusters",{get:function(){var e=this;return this.TargetClusters.map(function(t){return Jo.attach(e.connection,t.Name,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"LogicalClusters",{get:function(){return this.get("LogicalClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Services",{get:function(){return this.get("Services")},enumerable:!1,configurable:!0}),n.attach=function(e,t){var r=Zo.get({BaseUrl:e.baseUrl},function(){return new n(e)});return t&&r.set(t),r},n.prototype.GetESPServiceBaseURL=function(e){var n=this;return void 0===e&&(e=""),this.connection.TpServiceQuery({}).then(function(r){var o=n.connection.protocol(),i=n.connection.ip(),s="https:"===o?"18002":"8002";if(t.exists("ServiceList.TpEspServers.TpEspServer",r))for(var u=0,c=r.ServiceList.TpEspServers.TpEspServer;u<c.length;u++){var a=c[u];if(t.exists("TpBindings.TpBinding",a))for(var p=0,l=a.TpBindings.TpBinding;p<l.length;p++){var f=l[p];f.Service===e&&f.Protocol+":"===o&&(s=f.Port)}}return"".concat(o,"//").concat(i,":").concat(s,"/")})},n.prototype.fetchTargetClusters=function(){var e=this;return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(function(t){var n,r;return e.set({TargetClusters:null!==(r=null===(n=t.TpTargetClusters)||void 0===n?void 0:n.TpTargetCluster)&&void 0!==r?r:[]}),e.CTargetClusters})},n.prototype.fetchLogicalClusters=function(e){var t=this;return void 0===e&&(e={}),this.connection.TpLogicalClusterQuery(e).then(function(e){return t.set({LogicalClusters:e.TpLogicalClusters.TpLogicalCluster}),t.LogicalClusters})},n.prototype.fetchServices=function(e){var t=this;return void 0===e&&(e={}),this.connection.TpServiceQuery(e).then(function(e){return t.set({Services:e.ServiceList}),t.Services})},n.prototype.refresh=function(e){var t=this;return void 0===e&&(e=!1),this._prevRefresh&&!e||(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(function(){return t})),this._prevRefresh},n.prototype.on=function(t,n,r){if(this.isCallback(n)){if("changed"===t)e.prototype.on.call(this,t,n)}else if("changed"===t)e.prototype.on.call(this,t,n,r);return this._monitor(),this},n}(t.StateObject);function ei(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=n)}function ti(e){return(e=""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function ni(e,t){var n=e.indexOf(t);return-1!==n?parseFloat(e.substring(0,n)):-1}!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.GRAPH=1]="GRAPH",e[e.SUBGRAPH=2]="SUBGRAPH",e[e.VERTEX=3]="VERTEX",e[e.EDGE=4]="EDGE",e[e.LAST=5]="LAST"}(zo||(zo={})),function(e){e.UNKNOWN="Unknown",e.GRAPH="Graph",e.SUBGRAPH="Cluster",e.VERTEX="Vertex",e.EDGE="Edge",e.LAST="Last"}(Ko||(Ko={}));var ri=function(){function e(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}return e.prototype.calcVisibility=function(e,t,n,r){var o=this;this.noSpills=r,e.forEach(function(e){o.graph.isVertex(e)?(o.calcInVertexVisibility(e,n),o.calcOutVertexVisibility(e,n)):o.graph.isEdge(e)?(o.calcInVertexVisibility(e.getSource(),n-1),o.calcOutVertexVisibility(e.getTarget(),n-1)):o.graph.isSubgraph(e)&&(o.m_visibleSubgraphs[e.__hpcc_id]=e,o.calcSubgraphVisibility(e,t-1))}),this.calcVisibility2()},e.prototype.calcInVertexVisibility=function(e,t){var n=this;this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(function(e){n.calcInVertexVisibility(e.getSource(),t-1)})},e.prototype.calcOutVertexVisibility=function(e,t){var n=this;this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(function(e){n.calcOutVertexVisibility(e.getTarget(),t-1)})},e.prototype.calcSubgraphVisibility=function(e,t){var n=this;if(!(t<0)){t>0&&e.__hpcc_subgraphs.forEach(function(e,r){n.calcSubgraphVisibility(e,t-1)}),e.__hpcc_subgraphs.forEach(function(e,t){n.m_visibleSubgraphs[e.__hpcc_id]=e}),e.__hpcc_vertices.forEach(function(e,t){n.m_visibleVertices[e.__hpcc_id]=e});var r={};this.graph.edges.forEach(function(t,o){t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===n.getCommonAncestor(t)&&(r[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]||(r[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]=!0,n.m_visibleEdges[t.__hpcc_id]=t))})}},e.prototype.buildVertexString=function(e,t){var n="",r="",o=e.getProperties();for(var i in o)t&&i.indexOf("_kind")>=0?r+='<att name="_kind" value="point"/>':"id"===i||"label"===i?n+=" "+i+'="'+ti(o[i])+'"':r+='<att name="'+i+'" value="'+ti(o[i])+'"/>';return"<node"+n+">"+r+"</node>"},e.prototype.buildEdgeString=function(e){var t="",n="",r=e.getProperties();for(var o in r)"id"===o.toLowerCase()||"label"===o.toLowerCase()||"source"===o.toLowerCase()||"target"===o.toLowerCase()?t+=" "+o+'="'+ti(r[o])+'"':n+='<att name="'+o+'" value="'+ti(r[o])+'"/>';return"<edge"+t+">"+n+"</edge>"},e.prototype.getAncestors=function(e,t){for(var n=e.__hpcc_parent;n;)t.push(n),n=n.__hpcc_parent},e.prototype.getCommonAncestorV=function(e,t){var n=[],r=[];this.getAncestors(e,n),this.getAncestors(t,r);for(var o=n.length-1,i=r.length-1,s=null;o>=0&&i>=0&&n[o]===r[i];)s=n[o],--o,--i;return s},e.prototype.getCommonAncestor=function(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())},e.prototype.calcAncestorVisibility=function(e){var t=this,n=[];this.getAncestors(e,n),n.forEach(function(e,n){t.m_visibleSubgraphs[e.__hpcc_id]=e})},e.prototype.calcVisibility2=function(){var e=this;for(var t in this.m_visibleVertices){var n=this.m_visibleVertices[t];n.getInEdges().forEach(function(t,n){e.m_visibleEdges[t.__hpcc_id]=t}),n.getOutEdges().forEach(function(t,n){e.m_visibleEdges[t.__hpcc_id]=t}),this.calcAncestorVisibility(n)}this.calcSemiVisibleVertices()},e.prototype.addSemiVisibleEdge=function(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)},e.prototype.addSemiVisibleVertex=function(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))},e.prototype.calcSemiVisibleVertices=function(){for(var e in this.m_visibleEdges){var t=this.m_visibleEdges[e],n=t.getSource();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){var r=n.getInEdges();if(!r.length)break;this.addSemiVisibleEdge(r[0]),n=r[0].getSource(),this.addSemiVisibleVertex(n)}var o=t.getTarget();for(this.addSemiVisibleVertex(o);this.noSpills&&o.isSpill();){var i=o.getOutEdges();if(!i.length)break;this.addSemiVisibleEdge(i[0]),o=i[0].getTarget(),this.addSemiVisibleVertex(o)}}},e.prototype.writeXgmml=function(){var e=this;this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach(function(t,n){e.edgeVisited(t)})},e.prototype.subgraphVisited=function(e,t){if(void 0===t&&(t=!1),this.m_visibleSubgraphs[e.__hpcc_id]){var n="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';var r=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),r===this.m_xgmml.length){var o=e.__hpcc_vertices[0];o&&(this.m_xgmml+=this.buildVertexString(o,!0))}var i=e.getProperties();for(var s in i)n+='<att name="'+s+'" value="'+ti(i[s])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+n+"</node>"}return!1},e.prototype.vertexVisited=function(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))},e.prototype.edgeVisited=function(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))},e}(),oi=function(){function e(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}return e.prototype.getProperties=function(){var e={};for(var t in this)0!==t.indexOf("__")&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e},e}(),ii=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._globalType="0"===n?"Graph":"Cluster",r.__hpcc_subgraphs=[],r.__hpcc_vertices=[],r.__hpcc_edges=[],r.id=n,r}return j(t,e),t.prototype.addSubgraph=function(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(function(t){return e===t})||this.__hpcc_subgraphs.push(e)},t.prototype.addVertex=function(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(function(t){return e===t})||this.__hpcc_vertices.push(e)},t.prototype.removeVertex=function(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(function(t){return e!==t})},t.prototype.addEdge=function(e){e.__hpcc_parent=this,this.__hpcc_edges.some(function(t){return e===t})||this.__hpcc_edges.push(e)},t.prototype.removeEdge=function(e){this.__hpcc_edges=this.__hpcc_edges.filter(function(t){return e!==t})},t.prototype.remove=function(){var e=this;this.__hpcc_subgraphs.forEach(function(t){return t.__hpcc_parent=e.__hpcc_parent}),this.__hpcc_vertices.forEach(function(t){return t.__hpcc_parent=e.__hpcc_parent}),this.__hpcc_edges.forEach(function(t){return t.__hpcc_parent=e.__hpcc_parent}),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)},t.prototype.walkSubgraphs=function(e){this.__hpcc_subgraphs.forEach(function(t,n){e.subgraphVisited(t)&&t.walkSubgraphs(e)})},t.prototype.walkVertices=function(e){this.__hpcc_vertices.forEach(function(t,n){e.vertexVisited(t)})},t}(oi),si=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._globalType="Vertex",r}return j(t,e),t.prototype.isSpill=function(){return this._isSpill},t.prototype.remove=function(){var e,t=this.getInVertices();t.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(function(e){e.remove()}),this.getOutEdges().forEach(function(e){e.setSource(t[0])}),null===(e=this.__hpcc_parent)||void 0===e||e.removeVertex(this),this.__hpcc_graph.removeItem(this)},t.prototype.getInVertices=function(){return this.getInEdges().map(function(e){return e.getSource()})},t.prototype.getInEdges=function(){var e=this;return this.__hpcc_graph.edges.filter(function(t){return t.getTarget()===e})},t.prototype.getOutVertices=function(){return this.getOutEdges().map(function(e){return e.getTarget()})},t.prototype.getOutEdges=function(){var e=this;return this.__hpcc_graph.edges.filter(function(t){return t.getSource()===e})},t}(oi),ui=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._globalType="Edge",r._globalType="Edge",r}return j(t,e),t.prototype.remove=function(){var e=this;this.__hpcc_graph.subgraphs.forEach(function(t){t.removeEdge(e)}),this.__hpcc_graph.removeItem(this)},t.prototype.getSource=function(){return this.__hpcc_graph.idx[this._sourceActivity||this.source]},t.prototype.setSource=function(e){this._sourceActivity?this._sourceActivity=e.__hpcc_id:this.source&&(this.source=e.__hpcc_id),this.__widget&&this.__widget.setSource(this.getSource().__widget)},t.prototype.getTarget=function(){return this.__hpcc_graph.idx[this._targetActivity||this.target]},t}(oi),ci=function(){function e(){this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[],this.xgmml="",this.clear()}return e.prototype.clear=function(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]},e.prototype.load=function(e){this.clear(),this.merge(e)},e.prototype.merge=function(e){this.xgmml=e;var t=(new DOMParser).parseFromString(e,"text/xml");this.walkDocument(t.documentElement,"0")},e.prototype.isSubgraph=function(e){return e instanceof ii},e.prototype.isVertex=function(e){return e instanceof si},e.prototype.isEdge=function(e){return e instanceof ui},e.prototype.getGlobalType=function(t){return t instanceof si?zo.VERTEX:t instanceof ui?zo.EDGE:t instanceof ii?zo.SUBGRAPH:t instanceof e?zo.GRAPH:zo.UNKNOWN},e.prototype.getGlobalTypeString=function(t){return t instanceof si?Ko.VERTEX:t instanceof ui?Ko.EDGE:t instanceof ii?Ko.SUBGRAPH:t instanceof e?Ko.GRAPH:Ko.UNKNOWN},e.prototype.getItem=function(e,t){if(!this.idx[t])switch(e.tagName){case"graph":var n=new ii(this,t);this.subgraphs.push(n),this.idx[t]=n;break;case"node":var r=new si(this,t);this.vertices.push(r),this.idx[t]=r;break;case"edge":var o=new ui(this,t);this.edges.push(o),this.idx[t]=o;break;default:console.warn("Graph.getItem - Unknown Node Type!")}var i=this.idx[t];return Array.from(e.attributes).forEach(function(e){ei(i,e.name,e.value)}),i},e.prototype.removeItem=function(e){delete this.idx[e.__hpcc_id],e instanceof ii?this.subgraphs=this.subgraphs.filter(function(t){return e!==t}):e instanceof si?this.vertices=this.vertices.filter(function(t){return e!==t}):e instanceof ui&&(this.edges=this.edges.filter(function(t){return e!==t}))},e.prototype.getChildByTagName=function(e,t){var n=null;return Array.from(e.childNodes).some(function(e,r){if(e.tagName===t)return n=e,!0}),n},e.prototype.walkDocument=function(e,t){var n=this,r=this.getItem(e,t);return e.childNodes.forEach(function(e,t){if(1===e.nodeType)switch(e.tagName){case"graph":break;case"node":var o=!1,i=n.getChildByTagName(e,"att");if(i){var s=n.getChildByTagName(i,"graph");if(s){o=!0;var u=n.walkDocument(s,e.getAttribute("id"));r.addSubgraph(u)}}if(!o){var c=n.walkDocument(e,e.getAttribute("id"));r.addVertex(c)}break;case"att":var a=e.getAttribute("name"),p="_"+a,l=e.getAttribute("value");0===a.indexOf("Time")?(ei(r,p,l),ei(r,a,""+function(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);var t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(e);return t?24*(+t[1]||0)*60*60+60*(+t[2]||0)*60+60*(+t[3]||0)+(+t[4]||0)+(+t[5]||0)/1e3+(+t[6]||0)/1e6+(+t[7]||0)/1e9:0}(l))):0===a.indexOf("Size")?(ei(r,p,l),ei(r,a,""+function(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);var t=ni(e,"Kb");return t>=0?1024*t:(t=ni(e,"Mb"))>=0?t*Math.pow(1024,2):(t=ni(e,"Gb"))>=0?t*Math.pow(1024,3):(t=ni(e,"Tb"))>=0?t*Math.pow(1024,4):(t=ni(e,"Pb"))>=0?t*Math.pow(1024,5):(t=ni(e,"Eb"))>=0?t*Math.pow(1024,6):(t=ni(e,"Zb"))>=0?t*Math.pow(1024,7):(t=ni(e,"b"))>=0?t:0}(l))):0===a.indexOf("Skew")?(ei(r,p,l),ei(r,a,""+((y=l)?parseFloat(y):0))):ei(r,a,l);break;case"edge":var f=n.walkDocument(e,e.getAttribute("id"));if(void 0!==f.NumRowsProcessed?f._eclwatchCount=f.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==f.Count?f._eclwatchCount=f.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==f.count&&(f._eclwatchCount=f.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),f.inputProgress&&(f._eclwatchInputProgress="["+f.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),f.SkewMaxRowsProcessed&&f.SkewMinRowsProcessed&&(f._eclwatchSkew="+"+f.SkewMaxRowsProcessed+", "+f.SkewMinRowsProcessed),f._dependsOn);else if(f._childGraph);else if(f._sourceActivity||f._targetActivity){f._isSpill=!0;var h=f.getSource();h&&(h._isSpill=!0);var d=f.getTarget();d&&(d._isSpill=!0)}r.addEdge(f)}var y}),r},e.prototype.removeSubgraphs=function(){A([],this.subgraphs,!0).forEach(function(e){e.__hpcc_parent instanceof ii&&e.remove()})},e.prototype.removeSpillVertices=function(){A([],this.vertices,!0).forEach(function(e){e.isSpill()&&e.remove()})},e.prototype.getLocalisedXGMML=function(e,t,n,r){var o=new ri(this);return o.calcVisibility(e,t,n,r),o.writeXgmml(),"<graph>"+o.m_xgmml+"</graph>"},e}(),ai=t.scopedLogger("@hpcc-js/comms/ecl/query.ts"),pi=Nt("~s");var li,fi=new(function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.QueryId,e.QuerySet])})||this}return j(n,e),n}(t.Cache)),hi=function(e){function t(t,n,r,o){var i=e.call(this)||this;return i.wsWorkunitsService=t instanceof jt?t:new jt(t),i.topology=$o.attach(i.wsWorkunitsService.opts()),i.set(W({QuerySet:n,QueryId:r},o)),i}return j(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.wsWorkunitsService.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Exceptions",{get:function(){return this.get("Exceptions")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"QueryId",{get:function(){return this.get("QueryId")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"QuerySet",{get:function(){return this.get("QuerySet")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"QueryName",{get:function(){return this.get("QueryName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dll",{get:function(){return this.get("Dll")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Suspended",{get:function(){return this.get("Suspended")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Activated",{get:function(){return this.get("Activated")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SuspendedBy",{get:function(){return this.get("SuspendedBy")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Clusters",{get:function(){return this.get("Clusters")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PublishedBy",{get:function(){return this.get("PublishedBy")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Comment",{get:function(){return this.get("Comment")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LogicalFiles",{get:function(){return this.get("LogicalFiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SuperFiles",{get:function(){return this.get("SuperFiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsLibrary",{get:function(){return this.get("IsLibrary")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Priority",{get:function(){return this.get("Priority")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WUSnapShot",{get:function(){return this.get("WUSnapShot")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CompileTime",{get:function(){return this.get("CompileTime")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LibrariesUsed",{get:function(){return this.get("LibrariesUsed")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CountGraphs",{get:function(){return this.get("CountGraphs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ResourceURLCount",{get:function(){return this.get("ResourceURLCount")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WsEclAddresses",{get:function(){return this.get("WsEclAddresses")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WUGraphs",{get:function(){return this.get("WUGraphs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WUTimers",{get:function(){return this.get("WUTimers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PriorityID",{get:function(){return this.get("PriorityID")},enumerable:!1,configurable:!0}),t.attach=function(e,n,r,o){var i=fi.get({BaseUrl:e.baseUrl,QuerySet:n,QueryId:r},function(){return new t(e,n,r)});return o&&i.set(o),i},t.prototype.wsEclService=function(){return F(this,void 0,void 0,function(){return w(this,function(e){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(function(e){for(var t,n,r,o,i=0,s=null!==(n=null===(t=null==e?void 0:e.TpEspServers)||void 0===t?void 0:t.TpEspServer)&&void 0!==n?n:[];i<s.length;i++)for(var u=s[i],c=0,a=null!==(o=null===(r=null==u?void 0:u.TpBindings)||void 0===r?void 0:r.TpBinding)&&void 0!==o?o:[];c<a.length;c++){var p=a[c];if("ws_ecl"===(null==p?void 0:p.Service)){var l="".concat(p.Protocol,"://").concat(globalThis.location.hostname,":").concat(p.Port);return new Ie({baseUrl:l})}}})),[2,this._eclService]})})},t.prototype.fetchDetails=function(){return F(this,void 0,void 0,function(){var e;return w(this,function(t){switch(t.label){case 0:return[4,this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1})];case 1:return e=t.sent(),this.set(W({},e)),[2]}})})},t.prototype.fetchRequestSchema=function(){return F(this,void 0,void 0,function(){var e,t,n,r;return w(this,function(o){switch(o.label){case 0:return[4,this.wsEclService()];case 1:e=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),t=this,[4,null==e?void 0:e.requestJson(this.QuerySet,this.QueryId)];case 3:return t._requestSchema=null!==(r=o.sent())&&void 0!==r?r:[],[3,5];case 4:return n=o.sent(),ai.debug(n),this._requestSchema=[],[3,5];case 5:return[2]}})})},t.prototype.fetchResponseSchema=function(){return F(this,void 0,void 0,function(){var e,t,n,r;return w(this,function(o){switch(o.label){case 0:return[4,this.wsEclService()];case 1:e=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),t=this,[4,null==e?void 0:e.responseJson(this.QuerySet,this.QueryId)];case 3:return t._responseSchema=null!==(r=o.sent())&&void 0!==r?r:{},[3,5];case 4:return n=o.sent(),ai.debug(n),this._responseSchema={},[3,5];case 5:return[2]}})})},t.prototype.fetchSchema=function(){return F(this,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:return[4,Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])];case 1:return e.sent(),[2]}})})},t.prototype.fetchSummaryStats=function(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})},t.prototype.fetchGraph=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=""),this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(function(e){for(var t,n=new ci,r=!0,o=0,i=(null===(t=null==e?void 0:e.Graphs)||void 0===t?void 0:t.ECLGraphEx)||[];o<i.length;o++){var s=i[o];r?(n.load(s.Graph),r=!1):n.merge(s.Graph)}return n})},t.prototype.fetchDetailsNormalized=function(e){void 0===e&&(e={});var t=Oo.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(function(e){var n=e[0],r=e[1],o=e[2].map(function(e){if("a"===e.Id[0]||"e"===e.Id[0]){var t=n.idx[e.Id.substring(1)],r=function(n){if("_"!==n.charAt(0)&&n.charAt(0)===n.charAt(0).toUpperCase()&&("string"==typeof t[n]||"number"==typeof t[n]||"boolean"==typeof t[n])&&!e.Properties.Property.some(function(e){return e.Name===n})){var r=(i=t[n],!isNaN(parseFloat(i))&&!isNaN(i-0))?parseFloat(t[n]):t[n],o=t[n];n.indexOf("Time")>=0&&(o=pi(r/=1e9)+"s"),e.Properties.Property.push({Name:n,RawValue:r,Formatted:o})}var i};for(var o in t)r(o)}return e});return t.normalizeDetails(r,o)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})},t.prototype.submit=function(e){return F(this,void 0,void 0,function(){var t,n;return w(this,function(r){switch(r.label){case 0:return[4,this.wsEclService()];case 1:t=r.sent();try{return[2,null!==(n=null==t?void 0:t.submit(this.QuerySet,this.QueryId,e).then(function(e){for(var t in e)e[t]=e[t].Row;return e}))&&void 0!==n?n:[]]}catch(e){return ai.debug(e),[2,[]]}return[2]}})})},t.prototype.refresh=function(){return F(this,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:return[4,Promise.all([this.fetchDetails(),this.fetchSchema()])];case 1:return e.sent(),[2,this]}})})},t.prototype.requestFields=function(){return this._requestSchema?this._requestSchema:[]},t.prototype.responseFields=function(){return this._responseSchema?this._responseSchema:{}},t.prototype.resultNames=function(){var e=[];for(var t in this.responseFields())e.push(t);return e},t.prototype.resultFields=function(e){return this._responseSchema[e]?this._responseSchema[e]:[]},t}(t.StateObject),di=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.Name,":").concat(e.UserSpecific,"-").concat(e.Namespace)})||this}return j(t,e),t}(t.Cache),yi=new di,gi=function(e){function t(t,n,r){var o=e.call(this)||this;return o.key=t,o.value=n,o.oldValue=r,o}return j(t,e),Object.defineProperty(t.prototype,"canConflate",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.conflate=function(e){return this.key===e.key&&(this.value=e.value,!0)},t.prototype.void=function(){return this.value===this.oldValue},t}(t.Message),bi=function(){function e(e,n,r,o){this._dispatch=new t.Dispatch,this._knownValues={},this.connection=e instanceof st?e:new st(e),this.Name=n,this.UserSpecific=o,this.Namespace=r}return Object.defineProperty(e.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),e.attach=function(t,n,r,o){return void 0===n&&(n="HPCCApps"),void 0===o&&(o=!0),yi.get({BaseUrl:t.baseUrl,Name:n,UserSpecific:o,Namespace:r},function(){return new e(t,n,r,o)})},e.prototype.create=function(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})},e.prototype.set=function(e,t,n){var r=this;return void 0===n&&(n=!0),this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(function(o){var i=r._knownValues[e];r._knownValues[e]=t,n&&r._dispatch.post(new gi(e,t,i))}).catch(function(n){console.error('Store.set("'.concat(e,'", "').concat(t,'") failed:'),n)})},e.prototype.get=function(e,t){var n=this;return void 0===t&&(t=!0),this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(function(r){var o=n._knownValues[e];return n._knownValues[e]=r.Value,t&&n._dispatch.post(new gi(e,r.Value,o)),r.Value}).catch(function(t){console.error("Store.get(".concat(e,") failed:"),t)})},e.prototype.getAll=function(e){var t=this;return void 0===e&&(e=!0),this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(function(n){var r={},o=t._knownValues;if(t._knownValues={},n.Pairs.Pair.forEach(function(n){var i=t._knownValues[n.Key];t._knownValues[n.Key]=n.Value,delete o[n.Key],r[n.Key]=n.Value,e&&t._dispatch.post(new gi(n.Key,n.Value,i))}),e)for(var i in o)t._dispatch.post(new gi(i,void 0,o[i]));return r}).catch(function(e){return console.error("Store.getAll failed:",e),{}})},e.prototype.delete=function(e,t){var n=this;return void 0===t&&(t=!0),this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(function(r){var o=n._knownValues[e];delete n._knownValues[e],t&&n._dispatch.post(new gi(e,void 0,o))}).catch(function(t){console.error("Store.delete(".concat(e,") failed:"),t)})},e.prototype.monitor=function(e){return this._dispatch.attach(e)},e}(),mi=t.scopedLogger("@hpcc-js/comms/dfuWorkunit.ts");!function(e){e[e.Unknown=0]="Unknown",e[e.Scheduled=1]="Scheduled",e[e.Queued=2]="Queued",e[e.Started=3]="Started",e[e.Aborted=4]="Aborted",e[e.Failed=5]="Failed",e[e.Finished=6]="Finished",e[e.Monitoring=7]="Monitoring",e[e.Aborting=8]="Aborting",e[e.NotFound=999]="NotFound"}(li||(li={}));var vi=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.ID)})||this}return j(t,e),t}(t.Cache),Si=new vi,Ui=function(t){function n(e,n){var r=t.call(this)||this;return r.connection=new ie(e),r.topologyConnection=new Ut(e),r.clearState(n),r}return j(n,t),Object.defineProperty(n.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ID",{get:function(){return this.get("ID")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DFUServerName",{get:function(){return this.get("DFUServerName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ClusterName",{get:function(){return this.get("ClusterName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"JobName",{get:function(){return this.get("JobName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Queue",{get:function(){return this.get("Queue")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"User",{get:function(){return this.get("User")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isProtected",{get:function(){return this.get("isProtected")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Command",{get:function(){return this.get("Command")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CommandMessage",{get:function(){return this.get("CommandMessage")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"PercentDone",{get:function(){return this.get("PercentDone")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SecsLeft",{get:function(){return this.get("SecsLeft")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ProgressMessage",{get:function(){return this.get("ProgressMessage")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SummaryMessage",{get:function(){return this.get("SummaryMessage")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"State",{get:function(){return this.get("State",li.Unknown)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceLogicalName",{get:function(){return this.get("SourceLogicalName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceIP",{get:function(){return this.get("SourceIP")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceFilePath",{get:function(){return this.get("SourceFilePath")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceDali",{get:function(){return this.get("SourceDali")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceRecordSize",{get:function(){return this.get("SourceRecordSize")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceFormat",{get:function(){return this.get("SourceFormat")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RowTag",{get:function(){return this.get("RowTag")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceNumParts",{get:function(){return this.get("SourceNumParts")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceDirectory",{get:function(){return this.get("SourceDirectory")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestLogicalName",{get:function(){return this.get("DestLogicalName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestGroupName",{get:function(){return this.get("DestGroupName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestDirectory",{get:function(){return this.get("DestDirectory")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestIP",{get:function(){return this.get("DestIP")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestFilePath",{get:function(){return this.get("DestFilePath")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestFormat",{get:function(){return this.get("DestFormat")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestNumParts",{get:function(){return this.get("DestNumParts")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestRecordSize",{get:function(){return this.get("DestRecordSize")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Replicate",{get:function(){return this.get("Replicate")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Overwrite",{get:function(){return this.get("Overwrite")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Compress",{get:function(){return this.get("Compress")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceCsvSeparate",{get:function(){return this.get("SourceCsvSeparate")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceCsvQuote",{get:function(){return this.get("SourceCsvQuote")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceCsvTerminate",{get:function(){return this.get("SourceCsvTerminate")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceCsvEscape",{get:function(){return this.get("SourceCsvEscape")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"TimeStarted",{get:function(){return this.get("TimeStarted")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"TimeStopped",{get:function(){return this.get("TimeStopped")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"StateMessage",{get:function(){return this.get("StateMessage")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"MonitorEventName",{get:function(){return this.get("MonitorEventName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"MonitorSub",{get:function(){return this.get("MonitorSub")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"MonitorShotLimit",{get:function(){return this.get("MonitorShotLimit")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceDiffKeyName",{get:function(){return this.get("SourceDiffKeyName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestDiffKeyName",{get:function(){return this.get("DestDiffKeyName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Archived",{get:function(){return this.get("Archived")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"encrypt",{get:function(){return this.get("encrypt")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"decrypt",{get:function(){return this.get("decrypt")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"failIfNoSourceFile",{get:function(){return this.get("failIfNoSourceFile")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recordStructurePresent",{get:function(){return this.get("recordStructurePresent")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"quotedTerminator",{get:function(){return this.get("quotedTerminator")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"preserveCompression",{get:function(){return this.get("preserveCompression")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"expireDays",{get:function(){return this.get("expireDays")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"PreserveFileParts",{get:function(){return this.get("PreserveFileParts")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"FileAccessCost",{get:function(){return this.get("FileAccessCost")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"KbPerSecAve",{get:function(){return this.get("KbPerSecAve")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"KbPerSec",{get:function(){return this.get("KbPerSec")},enumerable:!1,configurable:!0}),n.create=function(e,t){var r=new n(e);return r.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(function(e){return Si.set(r),r.set(e.result),r})},n.attach=function(e,t,r){var o=Si.get({BaseUrl:e.baseUrl,ID:t},function(){return new n(e,t)});return r&&o.set(r),o},n.sprayFixed=function(e,t){var r=new ie(e);return r.SprayFixedEx(W({},t)).then(function(t){var o=t.wuid;return r.GetDFUWorkunit({wuid:o}).then(function(t){return n.attach(e,o,t.result)})})},n.sprayVariable=function(e,t){var r=new ie(e);return r.SprayVariableEx(W({},t)).then(function(t){var o=t.wuid;return r.GetDFUWorkunit({wuid:o}).then(function(t){return n.attach(e,o,t.result)})})},n.despray=function(e,t){var r=new ie(e);return r.DesprayEx(W({},t)).then(function(t){var o=t.wuid;return r.GetDFUWorkunit({wuid:o}).then(function(t){return n.attach(e,o,t.result)})})},n.prototype.update=function(e){var t,n,r,o;return this.connection.UpdateDFUWorkunitEx({wu:{JobName:null!==(n=null===(t=null==e?void 0:e.wu)||void 0===t?void 0:t.JobName)&&void 0!==n?n:this.JobName,isProtected:null!==(o=null===(r=null==e?void 0:e.wu)||void 0===r?void 0:r.isProtected)&&void 0!==o?o:this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})},n.prototype.isComplete=function(){switch(this.State){case li.Finished:case li.Failed:case li.Aborted:case li.NotFound:return!0}return!1},n.prototype.isFailed=function(){return!(!this.isComplete()||this.State===li.Finished)},n.prototype.isDeleted=function(){return this.State===li.NotFound},n.prototype.isRunning=function(){return!this.isComplete()},n.prototype.abort=function(){return this.connection.AbortDFUWorkunit({wuid:this.ID})},n.prototype.delete=function(){var t=this;return this.DFUWUAction(e.FileSpray.DFUWUActions.Delete).then(function(e){return t.refresh().then(function(){return t._monitor(),e})})},n.prototype.refresh=function(){return F(this,arguments,void 0,function(e){return w(this,function(e){switch(e.label){case 0:return[4,this.GetDFUWorkunit()];case 1:return e.sent(),[2,this]}})})},n.prototype.fetchXML=function(e){return this.DFUWUFile()},n.prototype._monitor=function(){this.isComplete()?this._monitorTickCount=0:t.prototype._monitor.call(this)},n.prototype._monitorTimeoutDuration=function(){var e=t.prototype._monitorTimeoutDuration.call(this);return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:e},n.prototype.DFUWUFile=function(e){return void 0===e&&(e={}),this.connection.DFUWUFileEx(W(W({},e),{Wuid:this.ID})).then(function(e){return e}).catch(function(e){return""})},n.prototype.DFUWUAction=function(t){var n=this;return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:t}).then(function(r){return t===e.FileSpray.DFUWUActions.Delete?r:n.refresh().then(function(){return n._monitor(),r})})},n.prototype.on=function(e,n,r){var o=this;if(this.isCallback(n))switch(e){case"finished":t.prototype.on.call(this,"propChanged","State",function(e){o.isComplete()&&n([e])});break;case"changed":t.prototype.on.call(this,e,n)}else if("changed"===e)t.prototype.on.call(this,e,n,r);return this._monitor(),this},n.prototype.watchUntilComplete=function(e){var t=this;return new Promise(function(n,r){var o=t.watch(function(r){e&&e(r),t.isComplete()&&(o.release(),n(t))})})},n.prototype.watchUntilRunning=function(e){var t=this;return new Promise(function(n,r){var o=t.watch(function(r){e&&e(r),(t.isComplete()||t.isRunning())&&(o.release(),n(t))})})},n.prototype.clearState=function(e){this.clear({ID:e,State:li.Unknown})},n.prototype.GetDFUWorkunit=function(e){var t=this;return void 0===e&&(e={}),this.connection.GetDFUWorkunit(W(W({},e),{wuid:this.ID})).then(function(e){return t.set(e.result),e}).catch(function(e){if(!e.Exception.some(function(e){return(20080===e.Code||20081===e.Code)&&(t.clearState(t.ID),t.set("State",li.NotFound),!0)}))throw mi.warning("Unexpected ESP exception: ".concat(e.message)),e;return{}})},n}(t.StateObject);e.AccessService=se,e.AccountService=ue,e.Activity=Io,e.Attribute=ao,e.BUILD_VERSION="2.108.6",e.BaseScope=po,e.CloudService=ye,e.CodesignService=ge,e.Connection=B,e.DFUArrayActions=ve,e.DFUChangeProtection=Ue,e.DFUChangeRestriction=_e,e.DFUDefFileFormat=Se,e.DFUService=Pe,e.DFUWorkunit=Ui,e.DFUWorkunitCache=vi,e.DFUXRefService=De,e.DaliService=be,e.ECLGraph=Ir,e.ESPConnection=z,e.ESPExceptions=H,e.EclService=Ie,e.ElkService=Ne,e.FileSprayService=ie,e.GlobalResultCache=io,e.GraphCache=Nr,e.LogaccessService=Qe,e.LogicalFile=Go,e.LogicalFileCache=Mo,e.Machine=Bo,e.MachineCache=Vo,e.MachineService=Ke,e.PKG_NAME="@hpcc-js/comms",e.PKG_VERSION="2.102.1",e.PackageProcessService=Ye,e.PropertyType=Uo,e.Query=hi,e.QueryGraph=ci,e.RelatedProperty=_o,e.Resource=Yr,e.ResourcesService=Ze,e.Result=uo,e.ResultCache=co,e.SMCService=it,e.SashaService=nt,e.Scope=lo,e.ScopeEdge=zr,e.ScopeGraph=Hr,e.ScopeSubgraph=Jr,e.ScopeVertex=qr,e.Service=K,e.SourceFile=fo,e.Store=bi,e.StoreCache=di,e.StoreService=st,e.TargetCluster=Jo,e.TargetClusterCache=Xo,e.Timer=ho,e.Topology=$o,e.TopologyCache=Yo,e.TopologyService=Ut,e.ValueChangedMessage=gi,e.Workunit=Oo,e.WorkunitCache=Ao,e.WorkunitsService=jt,e.WorkunitsServiceEx=Wt,e.XGMMLEdge=Br,e.XGMMLGraph=Gr,e.XGMMLSubgraph=Vr,e.XGMMLVertex=Qr,e.XSDNode=Zr,e.XSDSchema=to,e.XSDSimpleType=eo,e.XSDXMLNode=$r,e.createGraph=Kr,e.createXGMMLGraph=Xr,e.defaultTargetCluster=function(e){if(!qo[e.baseUrl]){var t=void 0;t=e instanceof Ut?e:new Ut(e),qo[e.baseUrl]=t.TpListTargetClusters({}).then(function(t){var n,r,o;t.TargetClusters.TpClusterNameType.forEach(function(e){n||(n=e),r||!0!==e.IsDefault||(r=e),o||"hthor"!==e.Type||(o=e)});var i=r||o||n;return Jo.attach(e,i.Name,i)})}return qo[e.baseUrl]},e.deserializeResponse=x,e.get=G,e.hookSend=function(e){var t=Q;return e&&(Q=e),t},e.instanceOfIConnection=function(e){return"function"==typeof e.opts&&"function"==typeof e.send&&"function"==typeof e.clone},e.instanceOfIOptions=function(e){return"baseUrl"in e},e.isArray=X,e.isECLResult=Rt,e.isExceptions=function(e){return e instanceof H||e.isESPExceptions&&Array.isArray(e.Exception)},e.isWUInfoWorkunit=function(e){return void 0!==e.StateEx},e.isWUQueryECLWorkunit=function(e){return void 0!==e.TotalClusterTime},e.jsonp=I,e.parseXSD=ro,e.parseXSD2=function(e,t){var n=new oo(t);return n.parse(e),n.schema},e.post=k,e.send=V,e.serializeRequest=E,e.setTransportFactory=function(t){var n=e.createConnection;return e.createConnection=t,n},e.splitMetric=Co,e.targetClusters=function(e){return(e instanceof Ut?e:new Ut(e)).TpListTargetClusters({}).then(function(t){return t.TargetClusters.TpClusterNameType.map(function(t){return Jo.attach(e,t.Name,t)})})}});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/util"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/comms"]={},e["@hpcc-js/util"])}(this,function(e,t){"use strict";var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},r="URLSearchParams"in n,o="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in n,u="ArrayBuffer"in n;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function p(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function d(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function y(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function g(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i)return this.blob().then(g);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,n,r,o,i=d(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=y(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=r?r[1]:"utf-8",t.readAsText(e,o),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(U)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=p(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},h.prototype.delete=function(e){delete this.map[p(e)]},h.prototype.get=function(e){return e=p(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(p(e))},h.prototype.set=function(e,t){this.map[p(e)]=l(t)},h.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},h.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),f(e)},h.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),f(e)},h.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),f(e)},o&&(h.prototype[Symbol.iterator]=h.prototype.entries);var v=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,o,i=(t=t||{}).body;if(e instanceof S){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new h(t.headers)),this.method=(r=t.method||this.method||"GET",o=r.toUpperCase(),v.indexOf(o)>-1?o:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var s=/([?&])_=[^&]*/;if(s.test(this.url))this.url=this.url.replace(s,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function U(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function _(e,t){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}S.prototype.clone=function(){return new S(this,{body:this._bodyInit})},m.call(S.prototype),m.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var P=[301,302,303,307,308];_.redirect=function(e,t){if(-1===P.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})};var D=n.DOMException;try{new D}catch(e){(D=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),D.prototype.constructor=D}function C(e,t){return new Promise(function(r,o){var s=new S(e,t);if(s.signal&&s.signal.aborted)return o(new D("Aborted","AbortError"));var c=new XMLHttpRequest;function a(){c.abort()}if(c.onload=function(){var e,t,n={statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();try{t.append(r,o)}catch(e){console.warn("Response "+e.message)}}}),t)};0===s.url.indexOf("file://")&&(c.status<200||c.status>599)?n.status=200:n.status=c.status,n.url="responseURL"in c?c.responseURL:n.headers.get("X-Request-URL");var o="response"in c?c.response:c.responseText;setTimeout(function(){r(new _(o,n))},0)},c.onerror=function(){setTimeout(function(){o(new TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(new TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){o(new D("Aborted","AbortError"))},0)},c.open(s.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?c.withCredentials=!0:"omit"===s.credentials&&(c.withCredentials=!1),"responseType"in c&&(i?c.responseType="blob":u&&(c.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof h||n.Headers&&t.headers instanceof n.Headers)){var f=[];Object.getOwnPropertyNames(t.headers).forEach(function(e){f.push(p(e)),c.setRequestHeader(e,l(t.headers[e]))}),s.headers.forEach(function(e,t){-1===f.indexOf(t)&&c.setRequestHeader(t,e)})}else s.headers.forEach(function(e,t){c.setRequestHeader(t,e)});s.signal&&(s.signal.addEventListener("abort",a),c.onreadystatechange=function(){4===c.readyState&&s.signal.removeEventListener("abort",a)}),c.send(void 0===s._bodyInit?null:s._bodyInit)})}C.polyfill=!0,n.fetch||(n.fetch=C,n.Headers=h,n.Request=S,n.Response=_);var R=function(e,t){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},R(e,t)};function j(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var W=function(){return W=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},W.apply(this,arguments)};function F(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,u)}c((r=r.apply(e,t||[])).next())})}function w(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function A(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var T=t.scopedLogger("comms/connection.ts");var O={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function L(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function E(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=""),n&&(n+="."),"object"!=typeof e)return L(e,t);var r=[],o=function(o){if(e.hasOwnProperty(o))if(e[o]instanceof Array){var i=!1;e[o].forEach(function(e,s){"object"==typeof e?(i=!0,r.push(E(e,t,n+L("".concat(o,".").concat(s),t)))):r.push(n+L("".concat(o,"_i").concat(s),t)+"="+E(e,t))}),i&&r.push(n+L("".concat(o,".itemcount"),t)+"="+e[o].length)}else"object"==typeof e[o]?e[o]&&e[o].Item instanceof Array?(r.push(E(e[o].Item,t,n+L(o,t))),r.push(n+L("".concat(o,".itemcount"),t)+"="+e[o].Item.length)):r.push(E(e[o],t,n+L(o,t))):void 0!==e[o]?r.push(n+L(o,t)+"="+L(e[o],t)):r.push(n+L(o,t))};for(var i in e)o(i);return r.join("&")}function x(e){return JSON.parse(e)}function I(e,n,r,o,i){return void 0===r&&(r={}),void 0===o&&(o="json"),i&&console.warn("Header attributes ignored for JSONP connections"),new Promise(function(i,s){var u=1e3*e.timeoutSecs,c="jsonp_callback_"+Math.round(999999*Math.random());window[c]=function(e){u=0,f(),i("json"===o&&"string"==typeof e?x(e):e)};var a=document.createElement("script"),p=t.join(e.baseUrl,n);p+=p.indexOf("?")>=0?"&":"?",a.src=p+"jsonp="+c+"&"+E(r,e.encodeRequest),document.body.appendChild(a);var l=setInterval(function(){u<=0?clearInterval(l):(u-=5e3)<=0?(clearInterval(l),T.error("Request timeout: "+a.src),f(),s(Error("Request timeout: "+a.src))):T.debug("Request pending ("+u/1e3+" sec): "+a.src)},5e3);function f(){delete window[c],document.body.removeChild(a)}})}var N={};function M(e,n,r,o,i){function s(e){if(e.ok)return"json"===i?e.json():e.text();throw new Error(e.statusText)}return o=W(W({},function(e){return e.userID?{Authorization:"Basic ".concat(btoa("".concat(e.userID,":").concat(e.password)))}:{}}(e)),o),r=W(W({credentials:N[e.baseUrl]?"omit":"include"},r),{headers:o}),fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):r.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(r.agent=fetch.__trustwaveAgent)),t.promiseTimeout(1e3*e.timeoutSecs,fetch(t.join(e.baseUrl,n),r).then(s).catch(function(o){return r.credentials=N[e.baseUrl]?"include":"omit",fetch(t.join(e.baseUrl,n),r).then(s).then(function(t){return N[e.baseUrl]=!N[e.baseUrl],t})}))}function k(e,t,n,r,o){var i;return void 0===r&&(r="json"),n.upload_&&(delete n.upload_,t+="?upload_"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),M(e,t,{method:"post",body:E(n,e.encodeRequest),signal:i},W({"Content-Type":"application/x-www-form-urlencoded"},o),r)}function G(e,t,n,r,o){var i;return void 0===r&&(r="json"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),M(e,"".concat(t,"?").concat(E(n,e.encodeRequest)),{method:"get",signal:i},W({},o),r)}function V(e,t,n,r,o){var i;switch(void 0===r&&(r="json"),e.type){case"jsonp":i=I(e,t,n,r,o);break;case"get":i=G(e,t,n,r,o);break;default:i=k(e,t,n,r,o)}return i}var Q=V;var B=function(){function e(e){this.opts(e)}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._opts.baseUrl},enumerable:!1,configurable:!0}),e.prototype.opts=function(e){return 0===arguments.length?this._opts:(this._opts=W(W({},O),e),this)},e.prototype.send=function(e,t,n,r){return void 0===n&&(n="json"),this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,Q,r):Q(this._opts,e,t,n,r)},e.prototype.clone=function(){return new e(this.opts())},e}();function X(e){return"[object Array]"===Object.prototype.toString.call(e)}e.createConnection=function(e){return new B(e)};var H=function(e){function t(t,n,r){var o=e.call(this,"ESPException: "+r.Source)||this;return o.isESPExceptions=!0,o.action=t,o.request=n,o.Source=r.Source,o.Exception=r.Exception,r.Exception.length?o.message="".concat(r.Exception[0].Code,": ").concat(r.Exception[0].Message):o.message="",o}return j(t,e),t}(Error);var J,q,z=function(){function n(t,n,r){this._connection=function(e){return void 0!==e.send}(t)?t:e.createConnection(t),this._service=n,this._version=r}return Object.defineProperty(n.prototype,"baseUrl",{get:function(){return this._connection.opts().baseUrl},enumerable:!1,configurable:!0}),n.prototype.service=function(e){return void 0===e?this._service:(this._service=e,this)},n.prototype.version=function(e){return void 0===e?this._version:(this._version=e,this)},n.prototype.toESPStringArray=function(e,t){if(X(e[t])){for(var n=0;n<e[t].length;++n)e[t+"_i"+n]=e[t][n];delete e[t]}return e},n.prototype.opts=function(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)},n.prototype.send=function(e,n,r,o,i,s){void 0===n&&(n={}),void 0===r&&(r="json"),void 0===o&&(o=!1);var u,c=W(W({},n),{ver_:this._version});o&&(c.upload_=!0),i&&(c.abortSignal_=i);var a="json";switch(r){case"text":u=t.join(this._service,e),a="text";break;case"xsd":u=t.join(this._service,e+".xsd"),a="text";break;case"json2":u=t.join(this._service,e+"/json"),r="json";var p=e.split("/");e=p.pop();break;default:u=t.join(this._service,e+".json")}return this._connection.send(u,c,a).then(function(t){if("json"===r){var n=void 0;if(t&&t.Exceptions)throw new H(e,c,t.Exceptions);if(t&&(n=t[s||e+"Response"]),!n)throw new H(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return n}return t}).catch(function(t){if(t.isESPExceptions)throw t;throw new H(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:t.message}]})})},n.prototype.clone=function(){return new n(this._connection.clone(),this._service,this._version)},n}(),K=function(){function e(e,t,n){this._connection=new z(e,t,n)}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._connection.opts().baseUrl},enumerable:!1,configurable:!0}),e.prototype.opts=function(){return this._connection.opts()},e.prototype.connection=function(){return this._connection.clone()},e}();e.FileSpray=void 0,J=e.FileSpray||(e.FileSpray={}),(q=J.DFUWUActions||(J.DFUWUActions={})).Delete="Delete",q.Protect="Protect",q.Unprotect="Unprotect",q.Restore="Restore",q.SetToFailed="SetToFailed",q.Archive="Archive";var Y,Z=function(e){function t(t){return e.call(this,t,"FileSpray","1.26")||this}return j(t,e),t.prototype.AbortDFUWorkunit=function(e){return this._connection.send("AbortDFUWorkunit",e,"json",!1,void 0,"AbortDFUWorkunitResponse")},t.prototype.Copy=function(e){return this._connection.send("Copy",e,"json",!1,void 0,"CopyResponse")},t.prototype.CreateDFUPublisherWorkunit=function(e){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")},t.prototype.CreateDFUWorkunit=function(e){return this._connection.send("CreateDFUWorkunit",e,"json",!1,void 0,"CreateDFUWorkunitResponse")},t.prototype.DFUWUFile=function(e){return this._connection.send("DFUWUFile",e,"json",!1,void 0,"DFUWUFileResponse")},t.prototype.DFUWUSearch=function(e){return this._connection.send("DFUWUSearch",e,"json",!1,void 0,"DFUWUSearchResponse")},t.prototype.DFUWorkunitsAction=function(e){return this._connection.send("DFUWorkunitsAction",e,"json",!1,void 0,"DFUWorkunitsActionResponse")},t.prototype.DeleteDFUWorkunit=function(e){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,void 0,"DeleteDFUWorkunitResponse")},t.prototype.DeleteDFUWorkunits=function(e){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,void 0,"DeleteDFUWorkunitsResponse")},t.prototype.DeleteDropZoneFiles=function(e){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,void 0,"DFUWorkunitsActionResponse")},t.prototype.Despray=function(e){return this._connection.send("Despray",e,"json",!1,void 0,"DesprayResponse")},t.prototype.DfuMonitor=function(e){return this._connection.send("DfuMonitor",e,"json",!1,void 0,"DfuMonitorResponse")},t.prototype.DropZoneFileSearch=function(e){return this._connection.send("DropZoneFileSearch",e,"json",!1,void 0,"DropZoneFileSearchResponse")},t.prototype.DropZoneFiles=function(e){return this._connection.send("DropZoneFiles",e,"json",!1,void 0,"DropZoneFilesResponse")},t.prototype.EchoDateTime=function(e){return this._connection.send("EchoDateTime",e,"json",!1,void 0,"EchoDateTimeResponse")},t.prototype.FileList=function(e){return this._connection.send("FileList",e,"json",!1,void 0,"FileListResponse")},t.prototype.GetDFUExceptions=function(e){return this._connection.send("GetDFUExceptions",e,"json",!1,void 0,"GetDFUExceptionsResponse")},t.prototype.GetDFUProgress=function(e){return this._connection.send("GetDFUProgress",e,"json",!1,void 0,"ProgressResponse")},t.prototype.GetDFUServerQueues=function(e){return this._connection.send("GetDFUServerQueues",e,"json",!1,void 0,"GetDFUServerQueuesResponse")},t.prototype.GetDFUWorkunit=function(e){return this._connection.send("GetDFUWorkunit",e,"json",!1,void 0,"GetDFUWorkunitResponse")},t.prototype.GetDFUWorkunits=function(e){return this._connection.send("GetDFUWorkunits",e,"json",!1,void 0,"GetDFUWorkunitsResponse")},t.prototype.GetRemoteTargets=function(e){return this._connection.send("GetRemoteTargets",e,"json",!1,void 0,"GetRemoteTargetsResponse")},t.prototype.GetSprayTargets=function(e){return this._connection.send("GetSprayTargets",e,"json",!1,void 0,"GetSprayTargetsResponse")},t.prototype.OpenSave=function(e){return this._connection.send("OpenSave",e,"json",!1,void 0,"OpenSaveResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"FileSprayPingResponse")},t.prototype.Rename=function(e){return this._connection.send("Rename",e,"json",!1,void 0,"RenameResponse")},t.prototype.Replicate=function(e){return this._connection.send("Replicate",e,"json",!1,void 0,"ReplicateResponse")},t.prototype.ShowResult=function(e){return this._connection.send("ShowResult",e,"json",!1,void 0,"ShowResultResponse")},t.prototype.SprayFixed=function(e){return this._connection.send("SprayFixed",e,"json",!1,void 0,"SprayFixedResponse")},t.prototype.SprayVariable=function(e){return this._connection.send("SprayVariable",e,"json",!1,void 0,"SprayResponse")},t.prototype.SubmitDFUWorkunit=function(e){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,void 0,"SubmitDFUWorkunitResponse")},t.prototype.UpdateDFUWorkunit=function(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")},t}(K);e.FileSprayStates=void 0,(Y=e.FileSprayStates||(e.FileSprayStates={}))[Y.unknown=0]="unknown",Y[Y.scheduled=1]="scheduled",Y[Y.queued=2]="queued",Y[Y.started=3]="started",Y[Y.aborted=4]="aborted",Y[Y.failed=5]="failed",Y[Y.finished=6]="finished",Y[Y.monitoring=7]="monitoring",Y[Y.aborting=8]="aborting",Y[Y.notfound=999]="notfound";var $,ee,te,ne,re,oe,ie=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.DFUWUFileEx=function(e){return this._connection.send("DFUWUFile",e,"text")},t.prototype.SprayFixedEx=function(e){return this._connection.send("SprayFixed",e)},t.prototype.SprayVariableEx=function(e){return this._connection.send("SprayVariable",e,"json",!1,null,"SprayResponse")},t.prototype.DesprayEx=function(e){return this._connection.send("Despray",e)},t.prototype.UpdateDFUWorkunitEx=function(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")},t}(Z);e.WsAccess=void 0,$=e.WsAccess||(e.WsAccess={}),(ee=$.ViewMemberType||($.ViewMemberType={})).User="User",ee.Group="Group",(te=$.UserSortBy||($.UserSortBy={})).username="username",te.fullname="fullname",te.passwordexpiration="passwordexpiration",te.employeeID="employeeID",te.employeeNumber="employeeNumber",(ne=$.GroupSortBy||($.GroupSortBy={})).Name="Name",ne.ManagedBy="ManagedBy",(re=$.AccountTypeReq||($.AccountTypeReq={})).Any="Any",re.User="User",re.Group="Group",(oe=$.ResourcePermissionSortBy||($.ResourcePermissionSortBy={})).Name="Name",oe.Type="Type",($.ResourceSortBy||($.ResourceSortBy={})).Name="Name";var se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"ws_access","1.17")||this}return j(t,e),t.prototype.AccountPermissions=function(e){return this._connection.send("AccountPermissions",e,"json",!1,void 0,"AccountPermissionsResponse")},t.prototype.AccountPermissionsV2=function(e){return this._connection.send("AccountPermissionsV2",e,"json",!1,void 0,"AccountPermissionsV2Response")},t.prototype.AddUser=function(e){return this._connection.send("AddUser",e,"json",!1,void 0,"AddUserResponse")},t.prototype.AddView=function(e){return this._connection.send("AddView",e,"json",!1,void 0,"AddViewResponse")},t.prototype.AddViewColumn=function(e){return this._connection.send("AddViewColumn",e,"json",!1,void 0,"AddViewColumnResponse")},t.prototype.AddViewMember=function(e){return this._connection.send("AddViewMember",e,"json",!1,void 0,"AddViewMemberResponse")},t.prototype.ClearPermissionsCache=function(e){return this._connection.send("ClearPermissionsCache",e,"json",!1,void 0,"ClearPermissionsCacheResponse")},t.prototype.DeleteView=function(e){return this._connection.send("DeleteView",e,"json",!1,void 0,"DeleteViewResponse")},t.prototype.DeleteViewColumn=function(e){return this._connection.send("DeleteViewColumn",e,"json",!1,void 0,"DeleteViewColumnResponse")},t.prototype.DeleteViewMember=function(e){return this._connection.send("DeleteViewMember",e,"json",!1,void 0,"DeleteViewMemberResponse")},t.prototype.DisableScopeScans=function(e){return this._connection.send("DisableScopeScans",e,"json",!1,void 0,"DisableScopeScansResponse")},t.prototype.EnableScopeScans=function(e){return this._connection.send("EnableScopeScans",e,"json",!1,void 0,"EnableScopeScansResponse")},t.prototype.FilePermission=function(e){return this._connection.send("FilePermission",e,"json",!1,void 0,"FilePermissionResponse")},t.prototype.GroupAction=function(e){return this._connection.send("GroupAction",e,"json",!1,void 0,"GroupActionResponse")},t.prototype.GroupAdd=function(e){return this._connection.send("GroupAdd",e,"json",!1,void 0,"GroupAddResponse")},t.prototype.GroupEdit=function(e){return this._connection.send("GroupEdit",e,"json",!1,void 0,"GroupEditResponse")},t.prototype.GroupMemberEdit=function(e){return this._connection.send("GroupMemberEdit",e,"json",!1,void 0,"GroupMemberEditResponse")},t.prototype.GroupMemberEditInput=function(e){return this._connection.send("GroupMemberEditInput",e,"json",!1,void 0,"GroupMemberEditInputResponse")},t.prototype.GroupMemberQuery=function(e){return this._connection.send("GroupMemberQuery",e,"json",!1,void 0,"GroupMemberQueryResponse")},t.prototype.GroupQuery=function(e){return this._connection.send("GroupQuery",e,"json",!1,void 0,"GroupQueryResponse")},t.prototype.Groups=function(e){return this._connection.send("Groups",e,"json",!1,void 0,"GroupResponse")},t.prototype.PermissionAction=function(e){return this._connection.send("PermissionAction",e,"json",!1,void 0,"PermissionActionResponse")},t.prototype.Permissions=function(e){return this._connection.send("Permissions",e,"json",!1,void 0,"BasednsResponse")},t.prototype.PermissionsReset=function(e){return this._connection.send("PermissionsReset",e,"json",!1,void 0,"PermissionsResetResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accessPingResponse")},t.prototype.QueryScopeScansEnabled=function(e){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,void 0,"QueryScopeScansEnabledResponse")},t.prototype.QueryUserViewColumns=function(e){return this._connection.send("QueryUserViewColumns",e,"json",!1,void 0,"QueryUserViewColumnsResponse")},t.prototype.QueryViewColumns=function(e){return this._connection.send("QueryViewColumns",e,"json",!1,void 0,"QueryViewColumnsResponse")},t.prototype.QueryViewMembers=function(e){return this._connection.send("QueryViewMembers",e,"json",!1,void 0,"QueryViewMembersResponse")},t.prototype.QueryViews=function(e){return this._connection.send("QueryViews",e,"json",!1,void 0,"QueryViewsResponse")},t.prototype.ResourceAdd=function(e){return this._connection.send("ResourceAdd",e,"json",!1,void 0,"ResourceAddResponse")},t.prototype.ResourceDelete=function(e){return this._connection.send("ResourceDelete",e,"json",!1,void 0,"ResourceDeleteResponse")},t.prototype.ResourcePermissionQuery=function(e){return this._connection.send("ResourcePermissionQuery",e,"json",!1,void 0,"ResourcePermissionQueryResponse")},t.prototype.ResourcePermissions=function(e){return this._connection.send("ResourcePermissions",e,"json",!1,void 0,"ResourcePermissionsResponse")},t.prototype.ResourceQuery=function(e){return this._connection.send("ResourceQuery",e,"json",!1,void 0,"ResourceQueryResponse")},t.prototype.Resources=function(e){return this._connection.send("Resources",e,"json",!1,void 0,"ResourcesResponse")},t.prototype.UserAccountExport=function(e){return this._connection.send("UserAccountExport",e,"json",!1,void 0,"UserAccountExportResponse")},t.prototype.UserAction=function(e){return this._connection.send("UserAction",e,"json",!1,void 0,"UserActionResponse")},t.prototype.UserEdit=function(e){return this._connection.send("UserEdit",e,"json",!1,void 0,"UserEditResponse")},t.prototype.UserGroupEdit=function(e){return this._connection.send("UserGroupEdit",e,"json",!1,void 0,"UserGroupEditResponse")},t.prototype.UserGroupEditInput=function(e){return this._connection.send("UserGroupEditInput",e,"json",!1,void 0,"UserGroupEditInputResponse")},t.prototype.UserInfoEdit=function(e){return this._connection.send("UserInfoEdit",e,"json",!1,void 0,"UserInfoEditResponse")},t.prototype.UserInfoEditInput=function(e){return this._connection.send("UserInfoEditInput",e,"json",!1,void 0,"UserInfoEditInputResponse")},t.prototype.UserPosix=function(e){return this._connection.send("UserPosix",e,"json",!1,void 0,"UserPosixResponse")},t.prototype.UserPosixInput=function(e){return this._connection.send("UserPosixInput",e,"json",!1,void 0,"UserPosixInputResponse")},t.prototype.UserQuery=function(e){return this._connection.send("UserQuery",e,"json",!1,void 0,"UserQueryResponse")},t.prototype.UserResetPass=function(e){return this._connection.send("UserResetPass",e,"json",!1,void 0,"UserResetPassResponse")},t.prototype.UserResetPassInput=function(e){return this._connection.send("UserResetPassInput",e,"json",!1,void 0,"UserResetPassInputResponse")},t.prototype.UserSudoers=function(e){return this._connection.send("UserSudoers",e,"json",!1,void 0,"UserSudoersResponse")},t.prototype.UserSudoersInput=function(e){return this._connection.send("UserSudoersInput",e,"json",!1,void 0,"UserSudoersInputResponse")},t.prototype.Users=function(e){return this._connection.send("Users",e,"json",!1,void 0,"UserResponse")},t}(K)),ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.VerifyUser=function(e){return this._connection.send("VerifyUser",e).catch(function(e){if(e.isESPExceptions&&e.Exception.some(function(e){return 20043===e.Code}))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:e.Exception}};throw e})},t}(function(e){function t(t){return e.call(this,t,"ws_account","1.06")||this}return j(t,e),t.prototype.MyAccount=function(e){return this._connection.send("MyAccount",e,"json",!1,void 0,"MyAccountResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accountPingResponse")},t.prototype.UpdateUser=function(e){return this._connection.send("UpdateUser",e,"json",!1,void 0,"UpdateUserResponse")},t.prototype.UpdateUserInput=function(e){return this._connection.send("UpdateUserInput",e,"json",!1,void 0,"UpdateUserInputResponse")},t.prototype.VerifyUser=function(e){return this._connection.send("VerifyUser",e,"json",!1,void 0,"VerifyUserResponse")},t}(K)),ce=function(e){function t(t){return e.call(this,t,"WsCloud","1.02")||this}return j(t,e),t.prototype.GetPODs=function(e){return this._connection.send("GetPODs",e,"json",!1,void 0,"GetPODsResponse")},t.prototype.GetServices=function(e){return this._connection.send("GetServices",e,"json",!1,void 0,"GetServicesResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsCloudPingResponse")},t}(K),ae=t.scopedLogger("@hpcc-js/comms/services/wsCloud.ts");function pe(e){var t,n,r;return null!==(r=null===(n=null===(t=e.spec)||void 0===t?void 0:t.containers)||void 0===n?void 0:n.reduce(function(e,t){var n;return null===(n=t.ports)||void 0===n||n.forEach(function(t){e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e},[]))&&void 0!==r?r:[]}var le,fe,he,de,ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.getPODs=function(){return e.prototype.GetPODs.call(this,{}).then(function(e){var t,n,r;if(function(e){return void 0!==(null==e?void 0:e.Pods)}(e))return null!==(n=null===(t=e.Pods)||void 0===t?void 0:t.Pod)&&void 0!==n?n:[];try{var o="string"==typeof e.Result?JSON.parse(e.Result):e.Result;return(null!==(r=null==o?void 0:o.items)&&void 0!==r?r:[]).filter(function(e){var t,n,r=null!==(n=null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.labels)&&void 0!==n?n:{};return r.hasOwnProperty("app.kubernetes.io/part-of")&&"HPCC-Platform"===r["app.kubernetes.io/part-of"]}).map(function(e){var t,n,r,o,i,s,u,c,a,p,l,f,h=new Date(null===(t=e.metadata)||void 0===t?void 0:t.creationTimestamp);return{Name:e.metadata.name,Status:null===(n=e.status)||void 0===n?void 0:n.phase,CreationTimestamp:h.toISOString(),ContainerName:null!==(i=null===(o=null===(r=e.status)||void 0===r?void 0:r.containerStatuses)||void 0===o?void 0:o.reduce(function(e,t){return t.name&&e.push(t.name),e},[]).join(", "))&&void 0!==i?i:"",ContainerCount:null!==(c=null===(u=null===(s=e.spec)||void 0===s?void 0:s.containers)||void 0===u?void 0:u.length)&&void 0!==c?c:0,ContainerReadyCount:null===(p=null===(a=e.status)||void 0===a?void 0:a.containerStatuses)||void 0===p?void 0:p.reduce(function(e,t){return e+(t.ready?1:0)},0),ContainerRestartCount:null===(f=null===(l=e.status)||void 0===l?void 0:l.containerStatuses)||void 0===f?void 0:f.reduce(function(e,t){return e+t.restartCount},0),Ports:{Port:pe(e)}}})}catch(e){return ae.error("Error parsing V1Pods json '".concat(e.message,"'")),[]}})},t}(ce),ge=function(){function e(e){this._connection=new z(e,"ws_codesign","1.1")}return e.prototype.connectionOptions=function(){return this._connection.opts()},e.prototype.ListUserIDs=function(e){return this._connection.send("ListUserIDs",e).then(function(e){return e.UserIDs.Item}).catch(function(e){return[]})},e.prototype.Sign=function(e){return this._connection.send("Sign",W({SigningMethod:"gpg"},e))},e.prototype.Verify=function(e){return this._connection.send("Verify",e)},e}(),be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.Export=function(e){return F(this,void 0,void 0,function(){var t,n,r,o;return w(this,function(i){switch(i.label){case 0:return t=new URLSearchParams,e.Path&&t.append("Path",e.Path),void 0!==e.Safe&&t.append("Safe",String(e.Safe)),[4,fetch("".concat("/WsDali/Export","?").concat(t.toString()))];case 1:return n=i.sent(),r=n.headers.get("Content-Disposition"),[4,n.blob()];case 2:return o=i.sent(),[2,{filename:r?r.split("filename=")[1]:"WsDali_Export",content:o}]}})})},t}(function(e){function t(t){return e.call(this,t,"WSDali","1.07")||this}return j(t,e),t.prototype.Add=function(e){return this._connection.send("Add",e,"json",!1,void 0,"ResultResponse")},t.prototype.ClearTraceTransactions=function(e){return this._connection.send("ClearTraceTransactions",e,"json",!1,void 0,"ResultResponse")},t.prototype.Count=function(e){return this._connection.send("Count",e,"json",!1,void 0,"CountResponse")},t.prototype.DFSCheck=function(e){return this._connection.send("DFSCheck",e,"json",!1,void 0,"ResultResponse")},t.prototype.DFSExists=function(e){return this._connection.send("DFSExists",e,"json",!1,void 0,"BooleanResponse")},t.prototype.DFSLS=function(e){return this._connection.send("DFSLS",e,"json",!1,void 0,"ResultResponse")},t.prototype.Delete=function(e){return this._connection.send("Delete",e,"json",!1,void 0,"ResultResponse")},t.prototype.DisconnectClientConnection=function(e){return this._connection.send("DisconnectClientConnection",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetClients=function(e){return this._connection.send("GetClients",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetConnections=function(e){return this._connection.send("GetConnections",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetDFSCSV=function(e){return this._connection.send("GetDFSCSV",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetDFSMap=function(e){return this._connection.send("GetDFSMap",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetDFSParents=function(e){return this._connection.send("GetDFSParents",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetLogicalFile=function(e){return this._connection.send("GetLogicalFile",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetLogicalFilePart=function(e){return this._connection.send("GetLogicalFilePart",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetProtectedList=function(e){return this._connection.send("GetProtectedList",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetSDSStats=function(e){return this._connection.send("GetSDSStats",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetSDSSubscribers=function(e){return this._connection.send("GetSDSSubscribers",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetValue=function(e){return this._connection.send("GetValue",e,"json",!1,void 0,"ResultResponse")},t.prototype.Import=function(e){return this._connection.send("Import",e,"json",!1,void 0,"ResultResponse")},t.prototype.ListSDSLocks=function(e){return this._connection.send("ListSDSLocks",e,"json",!1,void 0,"ResultResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSDaliPingResponse")},t.prototype.SaveSDSStore=function(e){return this._connection.send("SaveSDSStore",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetLogicalFilePartAttr=function(e){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetProtected=function(e){return this._connection.send("SetProtected",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetTraceSlowTransactions=function(e){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetTraceTransactions=function(e){return this._connection.send("SetTraceTransactions",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetUnprotected=function(e){return this._connection.send("SetUnprotected",e,"json",!1,void 0,"ResultResponse")},t.prototype.SetValue=function(e){return this._connection.send("SetValue",e,"json",!1,void 0,"ResultResponse")},t.prototype.UnlockSDSLock=function(e){return this._connection.send("UnlockSDSLock",e,"json",!1,void 0,"ResultResponse")},t}(K));e.WsDfu=void 0,function(e){e.Delete="Delete",e.AddToSuperfile="Add To Superfile",e.ChangeProtection="Change Protection",e.ChangeRestriction="Change Restriction"}((le=e.WsDfu||(e.WsDfu={})).DFUArrayActions||(le.DFUArrayActions={})),function(e){e[e.NoChange=0]="NoChange",e[e.Protect=1]="Protect",e[e.Unprotect=2]="Unprotect",e[e.UnprotectAll=3]="UnprotectAll"}(le.DFUChangeProtection||(le.DFUChangeProtection={})),function(e){e[e.NoChange=0]="NoChange",e[e.Restrict=1]="Restrict",e[e.Unrestricted=2]="Unrestricted"}(le.DFUChangeRestriction||(le.DFUChangeRestriction={})),function(e){e.xml="xml",e.def="def"}(le.DFUDefFileFormat||(le.DFUDefFileFormat={})),(fe=le.FileAccessRole||(le.FileAccessRole={})).Token="Token",fe.Engine="Engine",fe.External="External",(he=le.SecAccessType||(le.SecAccessType={})).None="None",he.Access="Access",he.Read="Read",he.Write="Write",he.Full="Full",(de=le.DFUFileType||(le.DFUFileType={})).Flat="Flat",de.Index="Index",de.Xml="Xml",de.Csv="Csv",de.Json="Json",de.IndexLocal="IndexLocal",de.IndexPartitioned="IndexPartitioned",de.Unset="Unset";var me=function(e){function t(t){return e.call(this,t,"WsDfu","1.65")||this}return j(t,e),t.prototype.Add=function(e){return this._connection.send("Add",e,"json",!1,void 0,"AddResponse")},t.prototype.AddRemote=function(e){return this._connection.send("AddRemote",e,"json",!1,void 0,"AddRemoteResponse")},t.prototype.AddtoSuperfile=function(e){return this._connection.send("AddtoSuperfile",e,"json",!1,void 0,"AddtoSuperfileResponse")},t.prototype.DFUArrayAction=function(e){return this._connection.send("DFUArrayAction",e,"json",!1,void 0,"DFUArrayActionResponse")},t.prototype.DFUBrowseData=function(e){return this._connection.send("DFUBrowseData",e,"json",!1,void 0,"DFUBrowseDataResponse")},t.prototype.DFUDefFile=function(e){return this._connection.send("DFUDefFile",e,"json",!1,void 0,"DFUDefFileResponse")},t.prototype.DFUFileAccess=function(e){return this._connection.send("DFUFileAccess",e,"json",!1,void 0,"DFUFileAccessResponse")},t.prototype.DFUFileAccessV2=function(e){return this._connection.send("DFUFileAccessV2",e,"json",!1,void 0,"DFUFileAccessResponse")},t.prototype.DFUFileCreate=function(e){return this._connection.send("DFUFileCreate",e,"json",!1,void 0,"DFUFileCreateResponse")},t.prototype.DFUFileCreateV2=function(e){return this._connection.send("DFUFileCreateV2",e,"json",!1,void 0,"DFUFileCreateResponse")},t.prototype.DFUFilePublish=function(e){return this._connection.send("DFUFilePublish",e,"json",!1,void 0,"DFUFilePublishResponse")},t.prototype.DFUFileView=function(e){return this._connection.send("DFUFileView",e,"json",!1,void 0,"DFUFileViewResponse")},t.prototype.DFUGetDataColumns=function(e){return this._connection.send("DFUGetDataColumns",e,"json",!1,void 0,"DFUGetDataColumnsResponse")},t.prototype.DFUGetFileMetaData=function(e){return this._connection.send("DFUGetFileMetaData",e,"json",!1,void 0,"DFUGetFileMetaDataResponse")},t.prototype.DFUInfo=function(e){return this._connection.send("DFUInfo",e,"json",!1,void 0,"DFUInfoResponse")},t.prototype.DFUQuery=function(e){return this._connection.send("DFUQuery",e,"json",!1,void 0,"DFUQueryResponse")},t.prototype.DFURecordTypeInfo=function(e){return this._connection.send("DFURecordTypeInfo",e,"json",!1,void 0,"DFURecordTypeInfoResponse")},t.prototype.DFUSearch=function(e){return this._connection.send("DFUSearch",e,"json",!1,void 0,"DFUSearchResponse")},t.prototype.DFUSearchData=function(e){return this._connection.send("DFUSearchData",e,"json",!1,void 0,"DFUSearchDataResponse")},t.prototype.DFUSpace=function(e){return this._connection.send("DFUSpace",e,"json",!1,void 0,"DFUSpaceResponse")},t.prototype.EclRecordTypeInfo=function(e){return this._connection.send("EclRecordTypeInfo",e,"json",!1,void 0,"EclRecordTypeInfoResponse")},t.prototype.EraseHistory=function(e){return this._connection.send("EraseHistory",e,"json",!1,void 0,"EraseHistoryResponse")},t.prototype.ListHistory=function(e){return this._connection.send("ListHistory",e,"json",!1,void 0,"ListHistoryResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDfuPingResponse")},t.prototype.Savexml=function(e){return this._connection.send("Savexml",e,"json",!1,void 0,"SavexmlResponse")},t.prototype.SuperfileAction=function(e){return this._connection.send("SuperfileAction",e,"json",!1,void 0,"SuperfileActionResponse")},t.prototype.SuperfileList=function(e){return this._connection.send("SuperfileList",e,"json",!1,void 0,"SuperfileListResponse")},t}(K),ve=e.WsDfu.DFUArrayActions,Se=e.WsDfu.DFUDefFileFormat,Ue=e.WsDfu.DFUChangeProtection,_e=e.WsDfu.DFUChangeRestriction,Pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.DFUFile=function(e){return this._connection.send("DFUDefFile",e,"text")},t.prototype.recursiveFetchLogicalFiles=function(e){return F(this,void 0,void 0,function(){var t,n,r,o,i,s=this;return w(this,function(u){switch(u.label){case 0:return t=[],n=[],[4,Promise.all(e.map(function(e){return s.DFUInfo({Cluster:e.NodeGroup,Name:e.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(function(e){for(var r,o,i,s,u,c,a=0,p=null!==(i=null===(o=null===(r=null==e?void 0:e.FileDetail)||void 0===r?void 0:r.Superfiles)||void 0===o?void 0:o.DFULogicalFile)&&void 0!==i?i:[];a<p.length;a++){var l=p[a];t.push(l)}for(var f=0,h=null!==(c=null===(u=null===(s=null==e?void 0:e.FileDetail)||void 0===s?void 0:s.subfiles)||void 0===u?void 0:u.Item)&&void 0!==c?c:[];f<h.length;f++){l=h[f];n.push(l)}})}))];case 1:return u.sent(),o=(r=n).concat,t.length?[4,this.recursiveFetchLogicalFiles(t)]:[3,3];case 2:return i=u.sent(),[3,4];case 3:i=[],u.label=4;case 4:return[2,o.apply(r,[i])]}})})},t}(me),De=function(e){function t(t){return e.call(this,t,"WsDFUXRef","1.01")||this}return j(t,e),t.prototype.DFUXRefArrayAction=function(e){return this._connection.send("DFUXRefArrayAction",e)},t.prototype.DFUXRefBuild=function(e){return this._connection.send("DFUXRefBuild",e)},t.prototype.DFUXRefBuildCancel=function(e){return this._connection.send("DFUXRefBuildCancel",e)},t.prototype.DFUXRefCleanDirectories=function(e){return this._connection.send("DFUXRefCleanDirectories",e)},t.prototype.DFUXRefDirectories=function(e){return this._connection.send("DFUXRefDirectories",e,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")},t.prototype.DFUXRefFoundFiles=function(e){return this._connection.send("DFUXRefFoundFiles",e,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")},t.prototype.DFUXRefList=function(e){return void 0===e&&(e={}),this._connection.send("DFUXRefList",e)},t.prototype.DFUXRefLostFiles=function(e){return this._connection.send("DFUXRefLostFiles",e,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")},t.prototype.DFUXRefMessages=function(e){return this._connection.send("DFUXRefMessages",e,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")},t.prototype.DFUXRefOrphanFiles=function(e){return this._connection.send("DFUXRefOrphanFiles",e,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")},t.prototype.DFUXRefUnusedFiles=function(e){return this._connection.send("DFUXRefUnusedFiles",e)},t}(K);function Ce(e,t){var n=typeof t;switch(n){case"boolean":case"number":case"string":return{id:e,type:n};case"object":if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:"dataset",children:Re(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){var r=typeof t.Item[0];if("string"===r||"number"===r)return{id:e,type:"set",fieldType:r};throw new Error("Unknown field type")}return{id:e,type:"object",fields:je(t)}}default:throw new Error("Unknown field type")}}function Re(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);var t=[];for(var n in e)t.push(Ce(n,e[n]));return t}function je(e){var t={};for(var n in e)t[n]=Ce(n,e[n]);return t}var We,Fe,we,Ae,Te,Oe,Le,Ee,xe,Ie=function(e){function t(t){return e.call(this,t,"WsEcl","0")||this}return j(t,e),t.prototype.opts=function(){return this._connection.opts()},t.prototype.requestJson=function(e,t){return this._connection.send("example/request/query/".concat(e,"/").concat(t,"/json"),{},"text").then(function(e){var t=JSON.parse(e);for(var n in t)return t[n];return{}}).then(Re)},t.prototype.responseJson=function(e,t){return this._connection.send("example/response/query/".concat(e,"/").concat(t,"/json"),{},"text").then(function(e){var t=JSON.parse(e);for(var n in t)return t[n].Results;return{}}).then(function(e){var t={};for(var n in e)t[n]=Re(e[n]);return t})},t.prototype.submit=function(e,t,n){var r="submit/query/".concat(e,"/").concat(t);return this._connection.send(r,n,"json2").then(function(e){if(e.Results&&e.Results.Exception)throw new H(r,n,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})},t}(K),Ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"ws_elk","1")||this}return j(t,e),t.prototype.GetConfigDetails=function(e){return this._connection.send("GetConfigDetails",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t}(K));e.WsLogaccess=void 0,We=e.WsLogaccess||(e.WsLogaccess={}),(Fe=We.LogColumnType||(We.LogColumnType={})).global="global",Fe.workunits="workunits",Fe.components="components",Fe.audience="audience",Fe.class="class",Fe.instance="instance",Fe.node="node",Fe.message="message",Fe.logid="logid",Fe.processid="processid",Fe.threadid="threadid",Fe.timestamp="timestamp",Fe.pod="pod",Fe.traceid="traceid",Fe.spanid="spanid",(we=We.LogColumnValueType||(We.LogColumnValueType={})).string="string",we.numeric="numeric",we.datetime="datetime",we.enum="enum",we.epoch="epoch",(Ae=We.LogAccessType||(We.LogAccessType={}))[Ae.All=0]="All",Ae[Ae.ByJobID=1]="ByJobID",Ae[Ae.ByComponent=2]="ByComponent",Ae[Ae.ByLogType=3]="ByLogType",Ae[Ae.ByTargetAudience=4]="ByTargetAudience",Ae[Ae.BySourceInstance=5]="BySourceInstance",Ae[Ae.BySourceNode=6]="BySourceNode",Ae[Ae.ByFieldName=7]="ByFieldName",Ae[Ae.ByPod=8]="ByPod",Ae[Ae.ByTraceID=9]="ByTraceID",Ae[Ae.BySpanID=10]="BySpanID",(Te=We.LogAccessStatusCode||(We.LogAccessStatusCode={}))[Te.Success=0]="Success",Te[Te.Warning=1]="Warning",Te[Te.Fail=2]="Fail",(Oe=We.LogAccessFilterOperator||(We.LogAccessFilterOperator={}))[Oe.NONE=0]="NONE",Oe[Oe.AND=1]="AND",Oe[Oe.OR=2]="OR",(Le=We.LogSelectColumnMode||(We.LogSelectColumnMode={}))[Le.MIN=0]="MIN",Le[Le.DEFAULT=1]="DEFAULT",Le[Le.ALL=2]="ALL",Le[Le.CUSTOM=3]="CUSTOM",(Ee=We.SortColumType||(We.SortColumType={}))[Ee.ByDate=0]="ByDate",Ee[Ee.ByJobID=1]="ByJobID",Ee[Ee.ByComponent=2]="ByComponent",Ee[Ee.ByLogType=3]="ByLogType",Ee[Ee.ByTargetAudience=4]="ByTargetAudience",Ee[Ee.BySourceInstance=5]="BySourceInstance",Ee[Ee.BySourceNode=6]="BySourceNode",Ee[Ee.ByFieldName=7]="ByFieldName",Ee[Ee.ByPod=8]="ByPod",Ee[Ee.ByTraceID=9]="ByTraceID",Ee[Ee.BySpanID=10]="BySpanID",(xe=We.SortDirection||(We.SortDirection={}))[xe.ASC=0]="ASC",xe[xe.DSC=1]="DSC";var Me,ke,Ge=function(e){function t(t){return e.call(this,t,"ws_logaccess","1.08")||this}return j(t,e),t.prototype.GetHealthReport=function(e){return this._connection.send("GetHealthReport",e,"json",!1,void 0,"GetHealthReportResponse")},t.prototype.GetLogAccessInfo=function(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")},t.prototype.GetLogs=function(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")},t}(K),Ve=t.scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts"),Qe=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return j(n,t),n.prototype.GetLogAccessInfo=function(e){return void 0===e&&(e={}),this._logAccessInfo||(this._logAccessInfo=t.prototype.GetLogAccessInfo.call(this,e)),this._logAccessInfo},n.prototype.GetLogs=function(e){return t.prototype.GetLogs.call(this,e)},n.prototype.GetLogsEx=function(t){return F(this,void 0,void 0,function(){var n,r,o,i,s,u,c,a,p,l,f,h,d,y,g,b,m,v;return w(this,function(S){switch(S.label){case 0:return[4,this.GetLogAccessInfo()];case 1:for(c in n=S.sent(),r={},n.Columns.Column.forEach(function(e){return r[e.LogType]=e.Name}),o=function(e){var t,n={};for(var o in r)(null==e?void 0:e.fields)?n[o]=null!==(t=Object.assign.apply(Object,A([{}],e.fields,!1))[r[o]])&&void 0!==t?t:"":n[o]="";return n},i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:e.WsLogaccess.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:null!==(p=t.LogLineStartFrom)&&void 0!==p?p:0,LogLineLimit:null!==(l=t.LogLineLimit)&&void 0!==l?l:100,SelectColumnMode:e.WsLogaccess.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:e.WsLogaccess.SortColumType.ByDate,ColumnName:"",Direction:0}]}},s=[],u=function(n){var o,i;if(n in r&&(o=Object.values(e.WsLogaccess.LogColumnType).includes(n)?n:r[n]),o){switch(o){case e.WsLogaccess.LogColumnType.workunits:case"hpcc.log.jobid":i=e.WsLogaccess.LogAccessType.ByJobID;break;case e.WsLogaccess.LogColumnType.audience:case"hpcc.log.audience":i=e.WsLogaccess.LogAccessType.ByTargetAudience;break;case e.WsLogaccess.LogColumnType.class:case"hpcc.log.class":i=e.WsLogaccess.LogAccessType.ByLogType;break;case e.WsLogaccess.LogColumnType.components:case"kubernetes.container.name":i=e.WsLogaccess.LogAccessType.ByComponent;break;default:i=e.WsLogaccess.LogAccessType.ByFieldName,o=r[n]}if(Array.isArray(t[n]))t[n].forEach(function(t){i===e.WsLogaccess.LogAccessType.ByComponent&&(t+="*"),s.push({LogCategory:i,SearchField:o,SearchByValue:t})});else{var u=t[n];i===e.WsLogaccess.LogAccessType.ByComponent&&(u+="*"),s.push({LogCategory:i,SearchField:o,SearchByValue:u})}}},t)u(c);return s.length>2?(a=i.Filter.leftBinaryFilter.BinaryLogFilter[0],s.forEach(function(t,n){var r=e.WsLogaccess.LogAccessFilterOperator.AND;n>0?(s[n-1].SearchField===t.SearchField&&(r=e.WsLogaccess.LogAccessFilterOperator.OR),n===s.length-1?(a.Operator=r,a.rightFilter=t):(a.Operator=r,a.rightBinaryFilter={BinaryLogFilter:[{leftFilter:t}]},a=a.rightBinaryFilter.BinaryLogFilter[0])):a.leftFilter=t})):(delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:e.WsLogaccess.LogAccessType.All},(null===(f=s[0])||void 0===f?void 0:f.SearchField)&&(i.Filter.leftFilter={LogCategory:null===(h=s[0])||void 0===h?void 0:h.LogCategory,SearchField:null===(d=s[0])||void 0===d?void 0:d.SearchField,SearchByValue:null===(y=s[0])||void 0===y?void 0:y.SearchByValue}),(null===(g=s[1])||void 0===g?void 0:g.SearchField)&&(i.Filter.Operator=e.WsLogaccess.LogAccessFilterOperator.AND,s[0].SearchField===s[1].SearchField&&(i.Filter.Operator=e.WsLogaccess.LogAccessFilterOperator.OR),i.Filter.rightFilter={LogCategory:null===(b=s[1])||void 0===b?void 0:b.LogCategory,SearchField:null===(m=s[1])||void 0===m?void 0:m.SearchField,SearchByValue:null===(v=s[1])||void 0===v?void 0:v.SearchByValue})),t.StartDate&&(i.Range.StartDate=t.StartDate.toISOString()),t.EndDate&&(i.Range.EndDate=t.EndDate.toISOString()),[2,this.GetLogs(i).then(function(e){var t,r,i;try{var s=JSON.parse(e.LogLines),u=[];switch(n.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":u=null!==(r=null===(t=s.lines)||void 0===t?void 0:t.map(o))&&void 0!==r?r:[];break;default:Ve.warning("Unknown RemoteLogManagerType: ".concat(n.RemoteLogManagerType)),u=[]}return{lines:u,total:null!==(i=e.TotalLogLinesAvailable)&&void 0!==i?i:1e4}}catch(e){Ve.error(e)}return{lines:[],total:0}})]}})})},n}(Ge);function Be(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Xe(e){return null===e?NaN:+e}function He(e,t){var n,r,o=e.length,i=-1;if(null==t){for(;++i<o;)if(null!=(n=e[i])&&n>=n)for(r=n;++i<o;)null!=(n=e[i])&&n>r&&(r=n)}else for(;++i<o;)if(null!=(n=t(e[i],i,e))&&n>=n)for(r=n;++i<o;)null!=(n=t(e[i],i,e))&&n>r&&(r=n);return r}function Je(e,t){var n,r=e.length,o=r,i=-1,s=0;if(null==t)for(;++i<r;)isNaN(n=Xe(e[i]))?--o:s+=n;else for(;++i<r;)isNaN(n=Xe(t(e[i],i,e)))?--o:s+=n;if(o)return s/o}1===(Me=Be).length&&(ke=Me,Me=function(e,t){return Be(ke(e),t)});var qe,ze,Ke=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return j(n,e),n.prototype.GetTargetClusterUsageEx=function(e,n){return void 0===n&&(n=!1),this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:n}).then(function(e){return t.exists("TargetClusterUsages.TargetClusterUsage",e)?e.TargetClusterUsages.TargetClusterUsage:[]}).then(function(e){return e.filter(function(e){return!!e.ComponentUsages}).map(function(e){var t=e.ComponentUsages.ComponentUsage.map(function(e){var t=(e.MachineUsages&&e.MachineUsages.MachineUsage?e.MachineUsages.MachineUsage:[]).map(function(e){var t=e.DiskUsages&&e.DiskUsages.DiskUsage?e.DiskUsages.DiskUsage.map(function(e){return W(W({},e),{InUse:1024*e.InUse,Total:1024*(e.InUse+e.Available),PercentUsed:100-e.PercentAvailable})}):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:Je(t.filter(function(e){return!isNaN(e.PercentUsed)}),function(e){return e.PercentUsed}),max:He(t.filter(function(e){return!isNaN(e.PercentUsed)}),function(e){return e.PercentUsed})}});return{Type:e.Type,Name:e.Name,Description:e.Description,MachineUsages:t,MachineUsagesDescription:t.reduce(function(e,t){return e+(t.Description||"")},""),mean:Je(t.filter(function(e){return!isNaN(e.mean)}),function(e){return e.mean}),max:He(t.filter(function(e){return!isNaN(e.max)}),function(e){return e.max})}});return{Name:e.Name,Description:e.Description,ComponentUsages:t,ComponentUsagesDescription:t.reduce(function(e,t){return e+(t.MachineUsagesDescription||"")},""),mean:Je(t.filter(function(e){return!isNaN(e.mean)}),function(e){return e.mean}),max:He(t.filter(function(e){return!isNaN(e.max)}),function(e){return e.max})}})})},n}(function(e){function t(t){return e.call(this,t,"ws_machine","1.17")||this}return j(t,e),t.prototype.GetComponentStatus=function(e){return this._connection.send("GetComponentStatus",e)},t.prototype.GetComponentUsage=function(e){return this._connection.send("GetComponentUsage",e)},t.prototype.GetMachineInfo=function(e){return this._connection.send("GetMachineInfo",e)},t.prototype.GetMachineInfoEx=function(e){return this._connection.send("GetMachineInfoEx",e)},t.prototype.GetMetrics=function(e){return this._connection.send("GetMetrics",e)},t.prototype.GetNodeGroupUsage=function(e){return this._connection.send("GetNodeGroupUsage",e)},t.prototype.GetTargetClusterInfo=function(e){return this._connection.send("GetTargetClusterInfo",e)},t.prototype.GetTargetClusterUsage=function(e){return this._connection.send("GetTargetClusterUsage",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t.prototype.UpdateComponentStatus=function(e){return this._connection.send("UpdateComponentStatus",e)},t}(K)),Ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"WsPackageProcess","1.04")||this}return j(t,e),t.prototype.ActivatePackage=function(e){return this._connection.send("ActivatePackage",e)},t.prototype.AddPackage=function(e){return this._connection.send("AddPackage",e)},t.prototype.AddPartToPackageMap=function(e){return this._connection.send("AddPartToPackageMap",e)},t.prototype.CopyPackageMap=function(e){return this._connection.send("CopyPackageMap",e)},t.prototype.DeActivatePackage=function(e){return this._connection.send("DeActivatePackage",e)},t.prototype.DeletePackage=function(e){return this._connection.send("DeletePackage",e)},t.prototype.Echo=function(e){return this._connection.send("Echo",e)},t.prototype.GetPackage=function(e){return this._connection.send("GetPackage",e)},t.prototype.GetPackageMapById=function(e){return this._connection.send("GetPackageMapById",e)},t.prototype.GetPackageMapSelectOptions=function(e){return this._connection.send("GetPackageMapSelectOptions",e)},t.prototype.GetPartFromPackageMap=function(e){return this._connection.send("GetPartFromPackageMap",e)},t.prototype.GetQueryFileMapping=function(e){return this._connection.send("GetQueryFileMapping",e)},t.prototype.ListPackage=function(e){return this._connection.send("ListPackage",e)},t.prototype.ListPackages=function(e){return this._connection.send("ListPackages",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t.prototype.RemovePartFromPackageMap=function(e){return this._connection.send("RemovePartFromPackageMap",e)},t.prototype.ValidatePackage=function(e){return this._connection.send("ValidatePackage",e)},t}(K)),Ze=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"WsResources","1.01")||this}return j(t,e),t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t.prototype.ServiceQuery=function(e){return this._connection.send("ServiceQuery",e)},t.prototype.WebLinksQuery=function(e){return this._connection.send("WebLinksQuery",e)},t}(K));e.WsSasha=void 0,qe=e.WsSasha||(e.WsSasha={}),(ze=qe.WUTypes||(qe.WUTypes={})).ECL="ECL",ze.DFU="DFU";var $e,et,tt,nt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(function(e){function t(t){return e.call(this,t,"WSSasha","1.01")||this}return j(t,e),t.prototype.ArchiveWU=function(e){return this._connection.send("ArchiveWU",e,"json",!1,void 0,"ResultResponse")},t.prototype.GetVersion=function(e){return this._connection.send("GetVersion",e,"json",!1,void 0,"ResultResponse")},t.prototype.ListWU=function(e){return this._connection.send("ListWU",e,"json",!1,void 0,"ResultResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSSashaPingResponse")},t.prototype.RestoreWU=function(e){return this._connection.send("RestoreWU",e,"json",!1,void 0,"ResultResponse")},t}(K));e.WsSMC=void 0,$e=e.WsSMC||(e.WsSMC={}),(et=$e.LockModes||($e.LockModes={})).ALL="ALL",et.READ="READ",et.WRITE="WRITE",et.HOLD="HOLD",et.SUB="SUB",(tt=$e.RoxieControlCmdType||($e.RoxieControlCmdType={})).Attach="Attach",tt.Detach="Detach",tt.State="State",tt.Reload="Reload",tt.ReloadRetry="ReloadRetry",tt.MemLock="MemLock",tt.MemUnlock="MemUnlock",tt.GetMemLocked="GetMemLocked";var rt,ot,it=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.connectionOptions=function(){return this._connection.opts()},t.prototype.Activity=function(t){return e.prototype.Activity.call(this,t).then(function(e){return W({Running:{ActiveWorkunit:[]}},e)})},t}(function(e){function t(t){return e.call(this,t,"WsSMC","1.27")||this}return j(t,e),t.prototype.Activity=function(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")},t.prototype.BrowseResources=function(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")},t.prototype.ClearQueue=function(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")},t.prototype.GetBuildInfo=function(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")},t.prototype.GetStatusServerInfo=function(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")},t.prototype.GetThorQueueAvailability=function(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")},t.prototype.Index=function(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")},t.prototype.LockQuery=function(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")},t.prototype.MoveJobBack=function(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")},t.prototype.MoveJobDown=function(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")},t.prototype.MoveJobFront=function(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")},t.prototype.MoveJobUp=function(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")},t.prototype.NotInCommunityEdition=function(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")},t.prototype.PauseQueue=function(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")},t.prototype.RemoveJob=function(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")},t.prototype.ResumeQueue=function(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")},t.prototype.RoxieControlCmd=function(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")},t.prototype.RoxieXrefCmd=function(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")},t.prototype.SetBanner=function(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")},t.prototype.SetJobPriority=function(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")},t.prototype.StopQueue=function(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")},t}(K)),st=function(e){function t(t){return e.call(this,t,"WsStore","1")||this}return j(t,e),t.prototype.CreateStore=function(e){return this._connection.send("Fetch",e)},t.prototype.Delete=function(e){return this._connection.send("Delete",e).catch(function(e){if(e.isESPExceptions&&e.Exception.some(function(e){return-1===e.Code}))return{Exceptions:void 0,Success:!0};throw e})},t.prototype.DeleteNamespace=function(e){return this._connection.send("DeleteNamespace",e)},t.prototype.Fetch=function(e){return this._connection.send("Fetch",e).catch(function(e){if(e.isESPExceptions&&e.Exception.some(function(e){return-1===e.Code}))return{Exceptions:void 0,Value:void 0};throw e})},t.prototype.FetchAll=function(e){return this._connection.send("FetchAll",e)},t.prototype.FetchKeyMD=function(e){return this._connection.send("FetchKeyMD",e)},t.prototype.ListKeys=function(e){return this._connection.send("ListKeys",e)},t.prototype.ListNamespaces=function(e){return this._connection.send("ListNamespaces",e)},t.prototype.Set=function(e){return this._connection.send("Set",e)},t}(K);e.WsTopology=void 0,rt=e.WsTopology||(e.WsTopology={}),(ot=rt.RoxieQueueFilter||(rt.RoxieQueueFilter={})).All="All",ot.QueriesOnly="QueriesOnly",ot.WorkunitsOnly="WorkunitsOnly";var ut,ct,at,pt,lt,ft,ht,dt,yt,gt,bt,mt,vt,St,Ut=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.connectionOptions=function(){return this._connection.opts()},t.prototype.protocol=function(){return this._connection.opts().baseUrl.split("//")[0]},t.prototype.ip=function(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]},t.prototype.DefaultTpLogicalClusterQuery=function(e){return void 0===e&&(e={}),this.TpLogicalClusterQuery(e).then(function(e){return e.default?e.default:(e.TpLogicalClusters.TpLogicalCluster.some(function(e,r){return 0===r&&(n=e),"hthor"===e.Type&&(t=e,!0)}),t||n);var t,n})},t}(function(e){function t(t){return e.call(this,t,"WsTopology","1.32")||this}return j(t,e),t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsTopologyPingResponse")},t.prototype.SystemLog=function(e){return this._connection.send("SystemLog",e,"json",!1,void 0,"SystemLogResponse")},t.prototype.TpClusterInfo=function(e){return this._connection.send("TpClusterInfo",e,"json",!1,void 0,"TpClusterInfoResponse")},t.prototype.TpClusterQuery=function(e){return this._connection.send("TpClusterQuery",e,"json",!1,void 0,"TpClusterQueryResponse")},t.prototype.TpDropZoneQuery=function(e){return this._connection.send("TpDropZoneQuery",e,"json",!1,void 0,"TpDropZoneQueryResponse")},t.prototype.TpGetComponentFile=function(e){return this._connection.send("TpGetComponentFile",e,"json",!1,void 0,"TpGetComponentFileResponse")},t.prototype.TpGetServicePlugins=function(e){return this._connection.send("TpGetServicePlugins",e,"json",!1,void 0,"TpGetServicePluginsResponse")},t.prototype.TpGroupQuery=function(e){return this._connection.send("TpGroupQuery",e,"json",!1,void 0,"TpGroupQueryResponse")},t.prototype.TpListLogFiles=function(e){return this._connection.send("TpListLogFiles",e,"json",!1,void 0,"TpListLogFilesResponse")},t.prototype.TpListTargetClusters=function(e){return this._connection.send("TpListTargetClusters",e,"json",!1,void 0,"TpListTargetClustersResponse")},t.prototype.TpLogFile=function(e){return this._connection.send("TpLogFile",e,"json",!1,void 0,"TpLogFileResponse")},t.prototype.TpLogFileDisplay=function(e){return this._connection.send("TpLogFileDisplay",e,"json",!1,void 0,"TpLogFileResponse")},t.prototype.TpLogicalClusterQuery=function(e){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,void 0,"TpLogicalClusterQueryResponse")},t.prototype.TpMachineInfo=function(e){return this._connection.send("TpMachineInfo",e,"json",!1,void 0,"TpMachineInfoResponse")},t.prototype.TpMachineQuery=function(e){return this._connection.send("TpMachineQuery",e,"json",!1,void 0,"TpMachineQueryResponse")},t.prototype.TpServiceQuery=function(e){return this._connection.send("TpServiceQuery",e,"json",!1,void 0,"TpServiceQueryResponse")},t.prototype.TpSetMachineStatus=function(e){return this._connection.send("TpSetMachineStatus",e,"json",!1,void 0,"TpSetMachineStatusResponse")},t.prototype.TpSwapNode=function(e){return this._connection.send("TpSwapNode",e,"json",!1,void 0,"TpSwapNodeResponse")},t.prototype.TpTargetClusterQuery=function(e){return this._connection.send("TpTargetClusterQuery",e,"json",!1,void 0,"TpTargetClusterQueryResponse")},t.prototype.TpThorStatus=function(e){return this._connection.send("TpThorStatus",e,"json",!1,void 0,"TpThorStatusResponse")},t.prototype.TpXMLFile=function(e){return this._connection.send("TpXMLFile",e,"json",!1,void 0,"TpXMLFileResponse")},t}(K));e.WsWorkunits=void 0,ut=e.WsWorkunits||(e.WsWorkunits={}),(ct=ut.ECLWUActions||(ut.ECLWUActions={})).Abort="Abort",ct.Delete="Delete",ct.Deschedule="Deschedule",ct.Reschedule="Reschedule",ct.Pause="Pause",ct.PauseNow="PauseNow",ct.Protect="Protect",ct.Unprotect="Unprotect",ct.Restore="Restore",ct.Resume="Resume",ct.SetToFailed="SetToFailed",ct.Archive="Archive",function(e){e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM"}(ut.LogSelectColumnMode||(ut.LogSelectColumnMode={})),function(e){e[e.ASC=0]="ASC",e[e.DSC=1]="DSC"}(ut.SortDirection||(ut.SortDirection={})),(at=ut.LogEventClass||(ut.LogEventClass={})).ALL="ALL",at.DIS="DIS",at.ERR="ERR",at.WRN="WRN",at.INF="INF",at.PRO="PRO",at.MET="MET",at.EVT="EVT",(pt=ut.WUDetailsAttrValueType||(ut.WUDetailsAttrValueType={})).Single="Single",pt.List="List",pt.Multi="Multi",(lt=ut.EclDefinitionActions||(ut.EclDefinitionActions={})).SyntaxCheck="SyntaxCheck",lt.Deploy="Deploy",lt.Publish="Publish",(ft=ut.ErrorMessageFormat||(ut.ErrorMessageFormat={})).xml="xml",ft.json="json",ft.text="text",(ht=ut.LogAccessLogFormat||(ut.LogAccessLogFormat={}))[ht.XML=0]="XML",ht[ht.JSON=1]="JSON",ht[ht.CSV=2]="CSV",(dt=ut.WUExceptionSeverity||(ut.WUExceptionSeverity={})).info="info",dt.warning="warning",dt.error="error",dt.alert="alert",(yt=ut.WUQueryFilterSuspendedType||(ut.WUQueryFilterSuspendedType={})).Allqueries="All queries",yt.Notsuspended="Not suspended",yt.Suspended="Suspended",yt.Suspendedbyuser="Suspended by user",yt.Suspendedbyfirstnode="Suspended by first node",yt.Suspendedbyanynode="Suspended by any node",(gt=ut.WUQuerySetFilterType||(ut.WUQuerySetFilterType={})).All="All",gt.Id="Id",gt.Name="Name",gt.Alias="Alias",gt.Status="Status",(bt=ut.WUProtectFilter||(ut.WUProtectFilter={})).All="All",bt.Protected="Protected",bt.NotProtected="NotProtected",(ut.QuerySetAliasActionTypes||(ut.QuerySetAliasActionTypes={})).Deactivate="Deactivate",(mt=ut.QuerysetImportActivation||(ut.QuerysetImportActivation={})).None="None",mt.ActivateImportedActive="ActivateImportedActive",(vt=ut.QuerySetQueryActionTypes||(ut.QuerySetQueryActionTypes={})).Suspend="Suspend",vt.Unsuspend="Unsuspend",vt.ToggleSuspend="ToggleSuspend",vt.Activate="Activate",vt.Delete="Delete",vt.DeleteQueriesAndWUs="DeleteQueriesAndWUs",vt.RemoveAllAliases="RemoveAllAliases",vt.ResetQueryStats="ResetQueryStats",(St=ut.WUQueryActivationMode||(ut.WUQueryActivationMode={}))[St.DoNotActivateQuery=0]="DoNotActivateQuery",St[St.ActivateQuery=1]="ActivateQuery",St[St.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",St[St.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious";var _t,Pt,Dt,Ct=function(e){function t(t){return e.call(this,t,"WsWorkunits","2.02")||this}return j(t,e),t.prototype.GVCAjaxGraph=function(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")},t.prototype.Ping=function(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")},t.prototype.WUAbort=function(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")},t.prototype.WUAction=function(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")},t.prototype.WUAddLocalFileToWorkunit=function(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")},t.prototype.WUAnalyseHotspot=function(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")},t.prototype.WUCDebug=function(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")},t.prototype.WUCheckFeatures=function(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")},t.prototype.WUClusterJobQueueLOG=function(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")},t.prototype.WUClusterJobQueueXLS=function(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")},t.prototype.WUClusterJobSummaryXLS=function(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")},t.prototype.WUClusterJobXLS=function(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")},t.prototype.WUCompileECL=function(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")},t.prototype.WUCopyLogicalFiles=function(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")},t.prototype.WUCopyQuerySet=function(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")},t.prototype.WUCreate=function(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")},t.prototype.WUCreateAndUpdate=function(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")},t.prototype.WUCreateZAPInfo=function(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")},t.prototype.WUDelete=function(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")},t.prototype.WUDeployWorkunit=function(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")},t.prototype.WUDetails=function(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")},t.prototype.WUDetailsMeta=function(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")},t.prototype.WUEclDefinitionAction=function(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")},t.prototype.WUExport=function(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")},t.prototype.WUFile=function(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")},t.prototype.WUFullResult=function(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")},t.prototype.WUGVCGraphInfo=function(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")},t.prototype.WUGetArchiveFile=function(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")},t.prototype.WUGetDependancyTrees=function(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")},t.prototype.WUGetGraph=function(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")},t.prototype.WUGetGraphNameAndTypes=function(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")},t.prototype.WUGetNumFileToCopy=function(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")},t.prototype.WUGetPlugins=function(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")},t.prototype.WUGetStats=function(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")},t.prototype.WUGetThorJobList=function(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")},t.prototype.WUGetThorJobQueue=function(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")},t.prototype.WUGetZAPInfo=function(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")},t.prototype.WUGraphInfo=function(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")},t.prototype.WUGraphTiming=function(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")},t.prototype.WUInfo=function(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")},t.prototype.WUInfoDetails=function(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")},t.prototype.WUJobList=function(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")},t.prototype.WULightWeightQuery=function(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")},t.prototype.WUListArchiveFiles=function(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")},t.prototype.WUListLocalFileRequired=function(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")},t.prototype.WUListQueries=function(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")},t.prototype.WUListQueriesUsingFile=function(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")},t.prototype.WUMultiQuerysetDetails=function(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")},t.prototype.WUProcessGraph=function(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")},t.prototype.WUProtect=function(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")},t.prototype.WUPublishWorkunit=function(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")},t.prototype.WUPushEvent=function(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")},t.prototype.WUQuery=function(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")},t.prototype.WUQueryConfig=function(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")},t.prototype.WUQueryDetails=function(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")},t.prototype.WUQueryDetailsLightWeight=function(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")},t.prototype.WUQueryFiles=function(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")},t.prototype.WUQueryGetGraph=function(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")},t.prototype.WUQueryGetSummaryStats=function(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")},t.prototype.WUQuerysetAliasAction=function(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")},t.prototype.WUQuerysetCopyQuery=function(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")},t.prototype.WUQuerysetDetails=function(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")},t.prototype.WUQuerysetExport=function(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")},t.prototype.WUQuerysetImport=function(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")},t.prototype.WUQuerysetQueryAction=function(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")},t.prototype.WUQuerysets=function(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")},t.prototype.WURecreateQuery=function(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")},t.prototype.WUResubmit=function(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")},t.prototype.WUResult=function(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")},t.prototype.WUResultBin=function(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")},t.prototype.WUResultSummary=function(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")},t.prototype.WUResultView=function(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")},t.prototype.WURun=function(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")},t.prototype.WUSchedule=function(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")},t.prototype.WUShowScheduled=function(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")},t.prototype.WUSubmit=function(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")},t.prototype.WUSyntaxCheckECL=function(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")},t.prototype.WUUpdate=function(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")},t.prototype.WUUpdateQueryEntry=function(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")},t.prototype.WUWaitCompiled=function(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")},t.prototype.WUWaitComplete=function(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")},t}(K);function Rt(e){return"string"==typeof e.Name}e.WUStateID=void 0,(_t=e.WUStateID||(e.WUStateID={}))[_t.Unknown=0]="Unknown",_t[_t.Compiled=1]="Compiled",_t[_t.Running=2]="Running",_t[_t.Completed=3]="Completed",_t[_t.Failed=4]="Failed",_t[_t.Archived=5]="Archived",_t[_t.Aborting=6]="Aborting",_t[_t.Aborted=7]="Aborted",_t[_t.Blocked=8]="Blocked",_t[_t.Submitted=9]="Submitted",_t[_t.Scheduled=10]="Scheduled",_t[_t.Compiling=11]="Compiling",_t[_t.Wait=12]="Wait",_t[_t.UploadingFiled=13]="UploadingFiled",_t[_t.DebugPaused=14]="DebugPaused",_t[_t.DebugRunning=15]="DebugRunning",_t[_t.Paused=16]="Paused",_t[_t.LAST=17]="LAST",_t[_t.NotFound=999]="NotFound",e.WUUpdate=void 0,Pt=e.WUUpdate||(e.WUUpdate={}),(Dt=Pt.Action||(Pt.Action={}))[Dt.Unknown=0]="Unknown",Dt[Dt.Compile=1]="Compile",Dt[Dt.Check=2]="Check",Dt[Dt.Run=3]="Run",Dt[Dt.ExecuteExisting=4]="ExecuteExisting",Dt[Dt.Pause=5]="Pause",Dt[Dt.PauseNow=6]="PauseNow",Dt[Dt.Resume=7]="Resume",Dt[Dt.Debug=8]="Debug",Dt[Dt.__size=9]="__size";var jt=function(e){function n(t){return e.call(this,t)||this}return j(n,e),n.prototype.Ping=function(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(function(e){return{result:!0}}).catch(function(e){return{result:!1,error:e}})},n.prototype.WUQuery=function(e,n){return void 0===e&&(e={}),this._connection.send("WUQuery",e,"json",!1,n).then(function(e){return t.deepMixin({Workunits:{ECLWorkunit:[]}},e)})},n.prototype.WUInfo=function(t){var n=W({Wuid:"",TruncateEclTo64k:!0,IncludeExceptions:!1,IncludeGraphs:!1,IncludeSourceFiles:!1,IncludeResults:!1,IncludeResultsViewNames:!1,IncludeVariables:!1,IncludeTimers:!1,IncludeDebugValues:!1,IncludeApplicationValues:!1,IncludeWorkflows:!1,IncludeXmlSchemas:!1,IncludeResourceURLs:!1,IncludeECL:!1,IncludeHelpers:!1,IncludeAllowedClusters:!1,IncludeTotalClusterTime:!1,IncludeServiceNames:!1,SuppressResultSchemas:!0},t);return e.prototype.WUInfo.call(this,n)},n.prototype.WUCreate=function(){return e.prototype.WUCreate.call(this,{})},n.prototype.WUUpdate=function(e){return this._connection.send("WUUpdate",e,"json",!0)},n.prototype.WUResubmit=function(t){return this._connection.toESPStringArray(t,"Wuids"),e.prototype.WUResubmit.call(this,t)},n.prototype.WUAction=function(t){return t.ActionType=t.WUActionType,e.prototype.WUAction.call(this,t)},n.prototype.WUResult=function(e,t){return this._connection.send("WUResult",e,"json",!1,t)},n.prototype.WUFileEx=function(e){return this._connection.send("WUFile",e,"text")},n.prototype.WUDetailsMeta=function(t){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=e.prototype.WUDetailsMeta.call(this,t)),this._WUDetailsMetaPromise},n.prototype.WUCDebugEx=function(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(function(e){var n=t.xml2json(e.Result).children();return n.length?n[0]:null})},n}(Ct),Wt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.WUPublishWorkunitEx=function(e){return this._connection.send("WUPublishWorkunit",e)},t}(Ct);function Ft(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}var wt,At=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Tt(e){if(!(t=At.exec(e)))throw new Error("invalid format: "+e);var t;return new Ot({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Ot(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Lt(e,t){var n=Ft(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}Tt.prototype=Ot.prototype,Ot.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Et={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return Lt(100*e,t)},r:Lt,s:function(e,t){var n=Ft(e,t);if(!n)return e+"";var r=n[0],o=n[1],i=o-(wt=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Ft(e,Math.max(0,t+i-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function xt(e){return e}var It,Nt,Mt=Array.prototype.map,kt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Gt(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?xt:(t=Mt.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,i=[],s=0,u=t[0],c=0;o>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),i.push(e.substring(o-=u,o+u)),!((c+=u+1)>r));)u=t[s=(s+1)%t.length];return i.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",s=e.decimal+"",u=void 0===e.numerals?xt:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(Mt.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",a=e.minus+"",p=void 0===e.nan?"NaN":e.nan+"";function l(e){var t=(e=Tt(e)).fill,n=e.align,l=e.sign,f=e.symbol,h=e.zero,d=e.width,y=e.comma,g=e.precision,b=e.trim,m=e.type;"n"===m?(y=!0,m="g"):Et[m]||(void 0===g&&(g=12),b=!0,m="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var v="$"===f?o:"#"===f&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",S="$"===f?i:/[%p]/.test(m)?c:"",U=Et[m],_=/[defgprs%]/.test(m);function P(e){var o,i,c,f=v,P=S;if("c"===m)P=U(e)+P,e="";else{var D=(e=+e)<0||1/e<0;if(e=isNaN(e)?p:U(Math.abs(e),g),b&&(e=function(e){e:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),D&&0===+e&&"+"!==l&&(D=!1),f=(D?"("===l?l:a:"-"===l||"("===l?"":l)+f,P=("s"===m?kt[8+wt/3]:"")+P+(D&&"("===l?")":""),_)for(o=-1,i=e.length;++o<i;)if(48>(c=e.charCodeAt(o))||c>57){P=(46===c?s+e.slice(o+1):e.slice(o))+P,e=e.slice(0,o);break}}y&&!h&&(e=r(e,1/0));var C=f.length+e.length+P.length,R=C<d?new Array(d-C+1).join(t):"";switch(y&&h&&(e=r(R+e,R.length?d-P.length:1/0),R=""),n){case"<":e=f+e+P+R;break;case"=":e=f+R+e+P;break;case"^":e=R.slice(0,C=R.length>>1)+f+e+P+R.slice(C);break;default:e=R+f+e+P}return u(e)}return g=void 0===g?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),P.toString=function(){return e+""},P}return{format:l,formatPrefix:function(e,t){var n,r=l(((e=Tt(e)).type="f",e)),o=3*Math.max(-8,Math.min(8,Math.floor((n=t,((n=Ft(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-o),s=kt[8+o/3];return function(e){return r(i*e)+s}}}}It=Gt({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Nt=It.format,It.formatPrefix;var Vt=new Date,Qt=new Date;function Bt(e,t,n,r){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=function(t){return e(t=new Date(+t)),t},o.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},o.round=function(e){var t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},o.range=function(n,r,i){var s,u=[];if(n=o.ceil(n),i=null==i?1:Math.floor(i),!(n<r&&i>0))return u;do{u.push(s=new Date(+n)),t(n,i),e(n)}while(s<n&&n<r);return u},o.filter=function(n){return Bt(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})},n&&(o.count=function(t,r){return Vt.setTime(+t),Qt.setTime(+r),e(Vt),e(Qt),Math.floor(n(Vt,Qt))},o.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?function(t){return r(t)%e===0}:function(t){return o.count(0,t)%e===0}):o:null}),o}var Xt=864e5,Ht=6048e5,Jt=Bt(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Xt},function(e){return e.getDate()-1});function qt(e){return Bt(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Ht})}Jt.range;var zt=qt(0),Kt=qt(1),Yt=qt(2),Zt=qt(3),$t=qt(4),en=qt(5),tn=qt(6);zt.range,Kt.range,Yt.range,Zt.range,$t.range,en.range,tn.range;var nn=Bt(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});nn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Bt(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null},nn.range;var rn=Bt(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Xt},function(e){return e.getUTCDate()-1});function on(e){return Bt(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/Ht})}rn.range;var sn=on(0),un=on(1),cn=on(2),an=on(3),pn=on(4),ln=on(5),fn=on(6);sn.range,un.range,cn.range,an.range,pn.range,ln.range,fn.range;var hn=Bt(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});function dn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function yn(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function gn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}hn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Bt(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null},hn.range;var bn,mn,vn,Sn={"-":"",_:" ",0:"0"},Un=/^\s*\d+/,_n=/^%/,Pn=/[\\^$*+?|[\]().{}]/g;function Dn(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(t)+o:o)}function Cn(e){return e.replace(Pn,"\\$&")}function Rn(e){return new RegExp("^(?:"+e.map(Cn).join("|")+")","i")}function jn(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function Wn(e,t,n){var r=Un.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Fn(e,t,n){var r=Un.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function wn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function An(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Tn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function On(e,t,n){var r=Un.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Ln(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function En(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function xn(e,t,n){var r=Un.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function In(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Nn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Mn(e,t,n){var r=Un.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function kn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Gn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Vn(e,t,n){var r=Un.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Qn(e,t,n){var r=Un.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Bn(e,t,n){var r=Un.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xn(e,t,n){var r=_n.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Hn(e,t,n){var r=Un.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Jn(e,t,n){var r=Un.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function qn(e,t){return Dn(e.getDate(),t,2)}function zn(e,t){return Dn(e.getHours(),t,2)}function Kn(e,t){return Dn(e.getHours()%12||12,t,2)}function Yn(e,t){return Dn(1+Jt.count(nn(e),e),t,3)}function Zn(e,t){return Dn(e.getMilliseconds(),t,3)}function $n(e,t){return Zn(e,t)+"000"}function er(e,t){return Dn(e.getMonth()+1,t,2)}function tr(e,t){return Dn(e.getMinutes(),t,2)}function nr(e,t){return Dn(e.getSeconds(),t,2)}function rr(e){var t=e.getDay();return 0===t?7:t}function or(e,t){return Dn(zt.count(nn(e)-1,e),t,2)}function ir(e){var t=e.getDay();return t>=4||0===t?$t(e):$t.ceil(e)}function sr(e,t){return e=ir(e),Dn($t.count(nn(e),e)+(4===nn(e).getDay()),t,2)}function ur(e){return e.getDay()}function cr(e,t){return Dn(Kt.count(nn(e)-1,e),t,2)}function ar(e,t){return Dn(e.getFullYear()%100,t,2)}function pr(e,t){return Dn((e=ir(e)).getFullYear()%100,t,2)}function lr(e,t){return Dn(e.getFullYear()%1e4,t,4)}function fr(e,t){var n=e.getDay();return Dn((e=n>=4||0===n?$t(e):$t.ceil(e)).getFullYear()%1e4,t,4)}function hr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Dn(t/60|0,"0",2)+Dn(t%60,"0",2)}function dr(e,t){return Dn(e.getUTCDate(),t,2)}function yr(e,t){return Dn(e.getUTCHours(),t,2)}function gr(e,t){return Dn(e.getUTCHours()%12||12,t,2)}function br(e,t){return Dn(1+rn.count(hn(e),e),t,3)}function mr(e,t){return Dn(e.getUTCMilliseconds(),t,3)}function vr(e,t){return mr(e,t)+"000"}function Sr(e,t){return Dn(e.getUTCMonth()+1,t,2)}function Ur(e,t){return Dn(e.getUTCMinutes(),t,2)}function _r(e,t){return Dn(e.getUTCSeconds(),t,2)}function Pr(e){var t=e.getUTCDay();return 0===t?7:t}function Dr(e,t){return Dn(sn.count(hn(e)-1,e),t,2)}function Cr(e){var t=e.getUTCDay();return t>=4||0===t?pn(e):pn.ceil(e)}function Rr(e,t){return e=Cr(e),Dn(pn.count(hn(e),e)+(4===hn(e).getUTCDay()),t,2)}function jr(e){return e.getUTCDay()}function Wr(e,t){return Dn(un.count(hn(e)-1,e),t,2)}function Fr(e,t){return Dn(e.getUTCFullYear()%100,t,2)}function wr(e,t){return Dn((e=Cr(e)).getUTCFullYear()%100,t,2)}function Ar(e,t){return Dn(e.getUTCFullYear()%1e4,t,4)}function Tr(e,t){var n=e.getUTCDay();return Dn((e=n>=4||0===n?pn(e):pn.ceil(e)).getUTCFullYear()%1e4,t,4)}function Or(){return"+0000"}function Lr(){return"%"}function Er(e){return+e}function xr(e){return Math.floor(+e/1e3)}!function(e){bn=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,i=e.days,s=e.shortDays,u=e.months,c=e.shortMonths,a=Rn(o),p=jn(o),l=Rn(i),f=jn(i),h=Rn(s),d=jn(s),y=Rn(u),g=jn(u),b=Rn(c),m=jn(c),v={a:function(e){return s[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return c[e.getMonth()]},B:function(e){return u[e.getMonth()]},c:null,d:qn,e:qn,f:$n,g:pr,G:fr,H:zn,I:Kn,j:Yn,L:Zn,m:er,M:tr,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Er,s:xr,S:nr,u:rr,U:or,V:sr,w:ur,W:cr,x:null,X:null,y:ar,Y:lr,Z:hr,"%":Lr},S={a:function(e){return s[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return c[e.getUTCMonth()]},B:function(e){return u[e.getUTCMonth()]},c:null,d:dr,e:dr,f:vr,g:wr,G:Tr,H:yr,I:gr,j:br,L:mr,m:Sr,M:Ur,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Er,s:xr,S:_r,u:Pr,U:Dr,V:Rr,w:jr,W:Wr,x:null,X:null,y:Fr,Y:Ar,Z:Or,"%":Lr},U={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=d[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=b.exec(t.slice(n));return r?(e.m=m[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return D(e,t,n,r)},d:Nn,e:Nn,f:Bn,g:Ln,G:On,H:kn,I:kn,j:Mn,L:Qn,m:In,M:Gn,p:function(e,t,n){var r=a.exec(t.slice(n));return r?(e.p=p[r[0].toLowerCase()],n+r[0].length):-1},q:xn,Q:Hn,s:Jn,S:Vn,u:Fn,U:wn,V:An,w:Wn,W:Tn,x:function(e,t,r){return D(e,n,t,r)},X:function(e,t,n){return D(e,r,t,n)},y:Ln,Y:On,Z:En,"%":Xn};function _(e,t){return function(n){var r,o,i,s=[],u=-1,c=0,a=e.length;for(n instanceof Date||(n=new Date(+n));++u<a;)37===e.charCodeAt(u)&&(s.push(e.slice(c,u)),null!=(o=Sn[r=e.charAt(++u)])?r=e.charAt(++u):o="e"===r?" ":"0",(i=t[r])&&(r=i(n,o)),s.push(r),c=u+1);return s.push(e.slice(c,u)),s.join("")}}function P(e,t){return function(n){var r,o,i=gn(1900,void 0,1);if(D(i,e,n+="",0)!=n.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(o=(r=yn(gn(i.y,0,1))).getUTCDay(),r=o>4||0===o?un.ceil(r):un(r),r=rn.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(o=(r=dn(gn(i.y,0,1))).getDay(),r=o>4||0===o?Kt.ceil(r):Kt(r),r=Jt.offset(r,7*(i.V-1)),i.y=r.getFullYear(),i.m=r.getMonth(),i.d=r.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?yn(gn(i.y,0,1)).getUTCDay():dn(gn(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,yn(i)):dn(i)}}function D(e,t,n,r){for(var o,i,s=0,u=t.length,c=n.length;s<u;){if(r>=c)return-1;if(37===(o=t.charCodeAt(s++))){if(o=t.charAt(s++),!(i=U[o in Sn?t.charAt(s++):o])||(r=i(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return v.x=_(n,v),v.X=_(r,v),v.c=_(t,v),S.x=_(n,S),S.X=_(r,S),S.c=_(t,S),{format:function(e){var t=_(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=P(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=_(e+="",S);return t.toString=function(){return e},t},utcParse:function(e){var t=P(e+="",!0);return t.toString=function(){return e},t}}}(e),bn.format,bn.parse,mn=bn.utcFormat,vn=bn.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Ir=function(e){function t(t,n,r){var o=e.call(this)||this;o.wu=t;for(var i=0,s=0,u=r;s<u.length;s++){var c=u[s];if(c.GraphName===n.Name&&!c.HasSubGraphId){i=Math.round(1e3*c.Seconds)/1e3;break}}return o.set(W({Time:i},n)),o}return j(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Label",{get:function(){return this.get("Label")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.get("Type")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Complete",{get:function(){return this.get("Complete")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WhenStarted",{get:function(){return this.get("WhenStarted")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WhenFinished",{get:function(){return this.get("WhenFinished")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Time",{get:function(){return this.get("Time")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Running",{get:function(){return this.get("Running")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RunningId",{get:function(){return this.get("RunningId")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Failed",{get:function(){return this.get("Failed")},enumerable:!1,configurable:!0}),t.prototype.fetchScopeGraph=function(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(function(e){return Kr(e)}):this.wu.fetchGraphDetails([this.Name],["graph"]).then(function(e){return Kr(e)})},t}(t.StateObject),Nr=function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.Name])})||this}return j(n,e),n}(t.Cache);function Mr(e,t,n){(n=n||[]).push(e),t(e.name,e.$,e.children(),n),e.children().forEach(function(e){Mr(e,t,n)}),n.pop()}function kr(e){var t={};return e.forEach(function(e){"att"===e.name&&(t[e.$.name]=e.$.value)}),t}var Gr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Graph),Vr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Subgraph),Qr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Vertex),Br=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Edge);function Xr(e,t){var n={},r={},o={},i=new Gr(function(e){return e._.id}),s=[i.root];return Mr(t,function(e,t,i,u){var c=s[s.length-1];switch(e){case"graph":break;case"node":if(i.length&&i[0].children().length&&"graph"===i[0].children()[0].name){var a=c.createSubgraph(kr(i));s.push(a),n[t.id]=a}var p=c.createVertex(kr(i));r[t.id]=p;break;case"edge":var l=c.createEdge(r[t.source],r[t.target],kr(i));o[t.id]=l}}),i}var Hr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Graph),Jr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Subgraph),qr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Vertex),zr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t}(t.Edge);function Kr(e){for(var t,n={},r={},o={},i=0,s=e;i<s.length;i++){switch((f=s[i]).ScopeType){case"graph":t=new Hr(function(e){return e._.Id},f),n[f.ScopeName]=t.root;break;case"subgraph":t||(t=new Hr(function(e){return e._.Id},f),n[f.ScopeName]=t.root);for(var u=f.parentScope().split(":"),c=n[f.parentScope()];u.length&&!c;)c=n[u.join(":")],u.pop();if(c){var a=c;n[f.ScopeName]=a.createSubgraph(f)}else console.warn("Missing SG:Parent (".concat(f.Id,"): ").concat(f.parentScope()));break;case"activity":var p=n[f.parentScope()];p?o[f.ScopeName]=p.createVertex(f):console.warn("Missing A:Parent (".concat(f.Id,"): ").concat(f.parentScope()));break;case"edge":r[f.ScopeName]=f;break;case"function":(h=o[f.parentScope()])?h._.children().push(f):console.warn("Missing F:Parent (".concat(f.Id,"): ").concat(f.parentScope()))}}for(var l in r){var f,h;if(h=n[(f=r[l]).parentScope()]){var d=h;try{var y=t.vertex(f.attr("IdSource").RawValue),g=t.vertex(f.attr("IdTarget").RawValue);d.createEdge(y,g,f)}catch(e){console.warn("Invalid Edge: ".concat(l))}}else console.warn("Missing E:Parent (".concat(f.Id,"): ").concat(f.parentScope()))}return t}var Yr=function(e){function t(t,n){var r=e.call(this)||this;r.wu=t;var o=n.split("\\").join("/"),i=o.split("/"),s="res/"+r.wu.Wuid+"/",u="",c="";return 0===o.indexOf(s)&&(u=o.substr(s.length),c=i[i.length-1]),r.set({URL:n,DisplayName:c,DisplayPath:u}),r}return j(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"URL",{get:function(){return this.get("URL")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DisplayName",{get:function(){return this.get("DisplayName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DisplayPath",{get:function(){return this.get("DisplayPath")},enumerable:!1,configurable:!0}),t}(t.StateObject),Zr=function(){function e(e){this.e=e}return e.prototype.fix=function(){delete this.e},e}(),$r=function(e){function t(t){var n=e.call(this,t)||this;return n.isSet=!1,n.attrs={},n._children=[],n}return j(t,e),t.prototype.append=function(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")},t.prototype.fix=function(){var e;this.name=this.e.$.name,this.type=this.e.$.type;for(var t=this._children.length-1;t>=0;--t){var n=this._children[t];"Row"===n.name&&void 0===n.type&&((e=this._children).push.apply(e,n._children),this._children.splice(t,1))}var r=this.setOfType();r&&(this.type=r,this.isSet=!0,this._children=[])},t.prototype.children=function(){return this._children},t.prototype.isAll=function(e){return"All"===e.name&&void 0===e.type},t.prototype.setOfType=function(){var e=this.children();if(void 0===this.type&&2===e.length){if(this.isAll(e[0]))return e[1].type;if(this.isAll(e[1]))return e[0].type}},t.prototype.charWidth=function(){var e=-1;switch(this.type){case"xs:boolean":e=5;break;case"xs:integer":case"xs:nonNegativeInteger":case"xs:double":e=8;break;case"xs:string":e=32;break;default:for(var t=this.type.lastIndexOf("_"),n=t>0?t:this.type.length,r=n-1;r>=0&&-1!=="0123456789".indexOf(this.type.charAt(r));--r);r+1<n&&(e=parseInt(this.type.substring(r+1,n),10)),0===this.type.indexOf("data")&&(e*=2)}return e<this.name.length&&(e=this.name.length),e},t}(Zr),eo=function(e){function t(t){return e.call(this,t)||this}return j(t,e),t.prototype.append=function(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e}},t.prototype.fix=function(){this.name=this.e.$.name,this.type=this._restricition.$.base,this.maxLength=this._maxLength?+this._maxLength.$.value:void 0,delete this._restricition,delete this._maxLength,e.prototype.fix.call(this)},t}(Zr),to=function(){function e(){this.simpleTypes={}}return e.prototype.fields=function(){return this.root.children()},e}(),no=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.schema=new to,n.simpleTypes={},n.xsdStack=new t.Stack,n}return j(n,e),n.prototype.startXMLNode=function(t){switch(e.prototype.startXMLNode.call(this,t),t.name){case"xs:element":var n=new $r(t);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(n):this.schema.root=n,this.xsdStack.push(n);break;case"xs:simpleType":this.simpleType=new eo(t)}},n.prototype.endXMLNode=function(t){switch(t.name){case"xs:element":this.xsdStack.pop().fix();break;case"xs:simpleType":this.simpleType.fix(),this.simpleTypes[this.simpleType.name]=this.simpleType,delete this.simpleType;break;case"xs:appinfo":var n=this.xsdStack.top();for(var r in t.$)n.attrs[r]=t.$[r];break;default:this.simpleType&&this.simpleType.append(t)}e.prototype.endXMLNode.call(this,t)},n}(t.SAXStackParser);function ro(e){var t=new no;return t.parse(e),t.schema}var oo=function(e){function n(n){var r=e.call(this)||this;return r.schema=new to,r.simpleTypes={},r.xsdStack=new t.Stack,r._rootName=n,r}return j(n,e),n.prototype.startXMLNode=function(t){switch(e.prototype.startXMLNode.call(this,t),t.name){case"xsd:element":var n=new $r(t);this.schema.root||this._rootName!==t.$.name||(this.schema.root=n),this.xsdStack.depth()&&this.xsdStack.top().append(n),this.xsdStack.push(n);break;case"xsd:simpleType":this.simpleType=new eo(t)}},n.prototype.endXMLNode=function(t){"xsd:element"===t.name&&this.xsdStack.pop().fix();e.prototype.endXMLNode.call(this,t)},n}(no);var io=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.Wuid,"-").concat(e.ResultName)})||this}return j(t,e),t}(t.Cache),so=new io,uo=function(e){function n(t,n,r,o){var i=e.call(this)||this;return i.connection=t instanceof jt?t:new jt(t),"boolean"==typeof o&&!0===o?i.set({NodeGroup:n,LogicalFileName:r}):Rt(r)&&Array.isArray(o)?i.set(W(W({},r),{Wuid:n,ResultName:r.Name,ResultViews:o})):void 0===o?"number"==typeof r?i.set({Wuid:n,ResultSequence:r}):"string"==typeof r?i.set({Wuid:n,ResultName:r}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)"),i}return j(n,e),Object.defineProperty(n.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ResultName",{get:function(){return this.get("ResultName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ResultSequence",{get:function(){return this.get("ResultSequence")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"LogicalFileName",{get:function(){return this.get("LogicalFileName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Sequence",{get:function(){return this.get("Sequence")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Value",{get:function(){return this.get("Value")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Link",{get:function(){return this.get("Link")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"FileName",{get:function(){return this.get("FileName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"IsSupplied",{get:function(){return this.get("IsSupplied")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShowFileContent",{get:function(){return this.get("ShowFileContent")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Total",{get:function(){return this.get("Total")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ECLSchemas",{get:function(){return this.get("ECLSchemas")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"NodeGroup",{get:function(){return this.get("NodeGroup")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ResultViews",{get:function(){return this.get("ResultViews")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"XmlSchema",{get:function(){return this.get("XmlSchema")},enumerable:!1,configurable:!0}),n.attach=function(e,t,r,o){var i;return Array.isArray(o)?(i=so.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r.Name},function(){return new n(e,t,r,o)})).set(r):void 0===o&&("number"==typeof r?i=so.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+r},function(){return new n(e,t,r)}):"string"==typeof r&&(i=so.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r},function(){return new n(e,t,r)}))),i},n.attachLogicalFile=function(e,t,r){return so.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r},function(){return new n(e,t,r,!0)})},n.prototype.isComplete=function(){return-1!==this.Total},n.prototype.fetchXMLSchema=function(e){var t=this;return void 0===e&&(e=!1),this._fetchXMLSchemaPromise&&!e||(this._fetchXMLSchemaPromise=this.WUResult().then(function(e){var n,r;return(null===(r=null===(n=e.Result)||void 0===n?void 0:n.XmlSchema)||void 0===r?void 0:r.xml)?(t.xsdSchema=ro(e.Result.XmlSchema.xml),t.xsdSchema):null})),this._fetchXMLSchemaPromise},n.prototype.refresh=function(){return F(this,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:return[4,this.fetchRows(0,1,!0)];case 1:return e.sent(),[2,this]}})})},n.prototype.fetchRows=function(e,n,r,o,i){var s=this;return void 0===e&&(e=0),void 0===n&&(n=-1),void 0===r&&(r=!1),void 0===o&&(o={}),this.WUResult(e,n,!r,o,i).then(function(e){var n=e.Result;return delete e.Result,s.set(W({},e)),t.exists("XmlSchema.xml",n)&&(s.xsdSchema=ro(n.XmlSchema.xml)),t.exists("Row",n)?n.Row:s.ResultName&&t.exists(s.ResultName,n)?n[s.ResultName].Row:[]})},n.prototype.rootField=function(){return this.xsdSchema?this.xsdSchema.root:null},n.prototype.fields=function(){return this.xsdSchema?this.xsdSchema.root.children():[]},n.prototype.WUResult=function(e,t,n,r,o){void 0===e&&(e=0),void 0===t&&(t=1),void 0===n&&(n=!1),void 0===r&&(r={});var i={NamedValue:{itemcount:0}};for(var s in r)i.NamedValue[i.NamedValue.itemcount++]={Name:s,Value:r[s]};var u={FilterBy:i};return this.Wuid&&void 0!==this.ResultName?(u.Wuid=this.Wuid,u.ResultName=this.ResultName):this.Wuid&&void 0!==this.ResultSequence?(u.Wuid=this.Wuid,u.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(u.LogicalName=this.LogicalFileName,u.Cluster=this.NodeGroup):this.LogicalFileName&&(u.LogicalName=this.LogicalFileName),u.Start=e,u.Count=t,u.SuppressXmlSchema=n,this.connection.WUResult(u,o).then(function(e){return e})},n}(t.StateObject),co=function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName])})||this}return j(n,e),n}(t.Cache),ao=function(e){function t(t,n){var r=e.call(this)||this;return r.scope=t,r.set(n),r}return j(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RawValue",{get:function(){return this.get("RawValue")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Formatted",{get:function(){return this.get("Formatted")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FormattedEnd",{get:function(){return this.get("FormattedEnd")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Measure",{get:function(){return this.get("Measure")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Creator",{get:function(){return this.get("Creator")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CreatorType",{get:function(){return this.get("CreatorType")},enumerable:!1,configurable:!0}),t}(t.StateObject),po=function(e){function t(t){var n=e.call(this)||this;return n._attributeMap={},n._children=[],n.update(t),n}return j(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ScopeName",{get:function(){return this.get("ScopeName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this.get("Id")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ScopeType",{get:function(){return this.get("ScopeType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Properties",{get:function(){return this.get("Properties",{Property:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Notes",{get:function(){return this.get("Notes",{Note:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SinkActivity",{get:function(){return this.get("SinkActivity")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CAttributes",{get:function(){var e=this,t=[],n={start:null,end:null};return this.Properties.Property.forEach(function(r){"ts"===r.Measure&&r.Name.indexOf("Started")>=0?n.start=r:e.ScopeName&&"ts"===r.Measure&&r.Name.indexOf("Finished")>=0?n.end=r:t.push(new ao(e,r))}),n.start&&n.end?(n.start.FormattedEnd=n.end.Formatted,t.push(new ao(this,n.start))):n.start?t.push(new ao(this,n.start)):n.end&&t.push(new ao(this,n.end)),t},enumerable:!1,configurable:!0}),t.prototype.update=function(e){var t=this;for(var n in this.set(e),this.CAttributes.forEach(function(e){t._attributeMap[e.Name]=e}),this.Properties.Property=[],this._attributeMap)this._attributeMap.hasOwnProperty(n)&&this.Properties.Property.push(this._attributeMap[n].properties)},t.prototype.parentScope=function(){var e=this.ScopeName.split(":");return e.pop(),e.join(":")},t.prototype.children=function(e){return arguments.length?(this._children=e,this):this._children},t.prototype.walk=function(e){if(e.start(this))return!0;for(var t=0,n=this.children();t<n.length;t++){if(n[t].walk(e))return!0}return e.end(this)},t.prototype.formattedAttrs=function(){var e={};for(var t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e},t.prototype.rawAttrs=function(){var e={};for(var t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e},t.prototype.hasAttr=function(e){return void 0!==this._attributeMap[e]},t.prototype.attr=function(e){return this._attributeMap[e]||new ao(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})},t.prototype.attrMeasure=function(e){return this._attributeMap[e].Measure},t.prototype.calcTooltip=function(e){var t="",n=[];t=this.Id,n.push('<tr><td class="key">ID:</td><td class="value">'.concat(this.Id,"</td></tr>")),e&&n.push('<tr><td class="key">Parent ID:</td><td class="value">'.concat(e.Id,"</td></tr>")),n.push('<tr><td class="key">Scope:</td><td class="value">'.concat(this.ScopeName,"</td></tr>"));var r=this.formattedAttrs();for(var o in r)"Label"===o?t=r[o]:n.push('<tr><td class="key">'.concat(o,'</td><td class="value">').concat(r[o],"</td></tr>"));return'<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">\n <h4 align="center">'.concat(t,"</h4>\n <table>\n ").concat(n.join(""),"\n </table>\n </div>")},t}(t.StateObject),lo=function(e){function t(t,n){var r=e.call(this,n)||this;return r.wu=t,r}return j(t,e),t}(po),fo=function(e){function t(t,n,r){var o=e.call(this)||this;return o.connection=t instanceof jt?t:new jt(t),o.set(W({Wuid:n},r)),o}return j(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FileCluster",{get:function(){return this.get("FileCluster")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsSuperFile",{get:function(){return this.get("IsSuperFile")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Subs",{get:function(){return this.get("Subs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Count",{get:function(){return this.get("Count")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ECLSourceFiles",{get:function(){return this.get("ECLSourceFiles")},enumerable:!1,configurable:!0}),t}(t.StateObject),ho=function(e){function n(n,r,o){var i=e.call(this)||this;i.connection=n instanceof jt?n:new jt(n);var s=t.espTime2Seconds(o.Value);return i.set(W({Wuid:r,Seconds:Math.round(1e3*s)/1e3,HasSubGraphId:void 0!==o.SubGraphId},o)),i}return j(n,e),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Value",{get:function(){return this.get("Value")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Seconds",{get:function(){return this.get("Seconds")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"GraphName",{get:function(){return this.get("GraphName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SubGraphId",{get:function(){return this.get("SubGraphId")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HasSubGraphId",{get:function(){return this.get("HasSubGraphId")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this.get("count")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Timestamp",{get:function(){return this.get("Timestamp")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"When",{get:function(){return this.get("When")},enumerable:!1,configurable:!0}),n}(t.StateObject),yo=mn("%Y-%m-%dT%H:%M:%S.%LZ"),go=vn("%Y-%m-%dT%H:%M:%S.%LZ"),bo=Nt(",");function mo(e,t,n){void 0!==e[t]&&void 0!==e[t][n]&&"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&delete e[t][n]}var vo="DefinitionList",So=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Uo=["Avg","Min","Max","Delta","StdDev"],_o=["SkewMin","SkewMax","NodeMin","NodeMax"],Po=/[A-Z][a-z]*/g;var Do={};function Co(e){var t=Do[e];return t||(t=function(e){for(var t=0,n=_o;t<n.length;t++){var r=n[t];if(0===(a=e.indexOf(r)))return{measure:i="",ext:r,label:s=e.slice(a+r.length)}}var o=e.match(Po);if(null==o?void 0:o.length){for(var i=o.shift(),s=o.join(""),u=0,c=Uo;u<c.length;u++){var a,p=c[u];if(0===(a=s.indexOf(p)))return{measure:i,ext:p,label:s=s.slice(a+p.length)}}return{measure:i,ext:"",label:s}}return{measure:"",ext:"",label:e}}(e),Do[e]=t),t}function Ro(e,t){var n,r;return null!==(r=null===(n=e.__formattedProps)||void 0===n?void 0:n[t])&&void 0!==r?r:e[t]}function jo(e){if(void 0!==e){var t=parseFloat(e);return isNaN(t)?void 0:t}}function Wo(e,t,n){var r=Co(t);if(!n[r.measure]){n[r.label]=!0;var o=jo(e["".concat(r.measure,"Avg").concat(r.label)]),i=jo(e["".concat(r.measure,"Min").concat(r.label)]),s=jo(e["".concat(r.measure,"Max").concat(r.label)]),u=jo(e["".concat(r.measure,"StdDev").concat(r.label)]),c=Math.max((o-i)/u,(s-o)/u);return{Key:"".concat(r.measure).concat(r.label),Value:Ro(e,"".concat(r.measure).concat(r.label)),Avg:Ro(e,"".concat(r.measure,"Avg").concat(r.label)),Min:Ro(e,"".concat(r.measure,"Min").concat(r.label)),Max:Ro(e,"".concat(r.measure,"Max").concat(r.label)),Delta:Ro(e,"".concat(r.measure,"Delta").concat(r.label)),StdDev:Ro(e,"".concat(r.measure,"StdDev").concat(r.label)),StdDevs:isNaN(c)?void 0:c,SkewMin:Ro(e,"SkewMin".concat(r.label)),SkewMax:Ro(e,"SkewMax".concat(r.label)),NodeMin:Ro(e,"NodeMin".concat(r.label)),NodeMax:Ro(e,"NodeMax".concat(r.label))}}return null}var Fo,wo=t.scopedLogger("workunit.ts"),Ao=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.Wuid)})||this}return j(t,e),t}(t.Cache),To=new Ao,Oo=function(n){function r(e,t){var r=n.call(this)||this;return r._debugMode=!1,r._resultCache=new co,r._graphCache=new Nr,r.connection=new jt(e),r.topologyConnection=new Ut(e),r.clearState(t),r}return j(r,n),Object.defineProperty(r.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Owner",{get:function(){return this.get("Owner","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Cluster",{get:function(){return this.get("Cluster","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Jobname",{get:function(){return this.get("Jobname","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Description",{get:function(){return this.get("Description","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ActionEx",{get:function(){return this.get("ActionEx","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"StateID",{get:function(){return this.get("StateID",e.WUStateID.Unknown)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"State",{get:function(){return this.get("State")||e.WUStateID[this.StateID]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Protected",{get:function(){return this.get("Protected",!1)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Exceptions",{get:function(){return this.get("Exceptions",{ECLException:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResultViews",{get:function(){return this.get("ResultViews",{View:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResultCount",{get:function(){return this.get("ResultCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Results",{get:function(){return this.get("Results",{ECLResult:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CResults",{get:function(){var e=this;return this.Results.ECLResult.map(function(t){return e._resultCache.get(t,function(){return uo.attach(e.connection,e.Wuid,t,e.ResultViews.View)})})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"SequenceResults",{get:function(){var e={};return this.CResults.forEach(function(t){e[t.Sequence]=t}),e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Timers",{get:function(){return this.get("Timers",{ECLTimer:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CTimers",{get:function(){var e=this;return this.Timers.ECLTimer.map(function(t){return new ho(e.connection,e.Wuid,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"GraphCount",{get:function(){return this.get("GraphCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Graphs",{get:function(){return this.get("Graphs",{ECLGraph:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CGraphs",{get:function(){var e=this;return this.Graphs.ECLGraph.map(function(t){return e._graphCache.get(t,function(){return new Ir(e,t,e.CTimers)})})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ThorLogList",{get:function(){return this.get("ThorLogList")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResourceURLCount",{get:function(){return this.get("ResourceURLCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResourceURLs",{get:function(){return this.get("ResourceURLs",{URL:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CResourceURLs",{get:function(){var e=this;return this.ResourceURLs.URL.map(function(t){return new Yr(e,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"TotalClusterTime",{get:function(){return this.get("TotalClusterTime","")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"DateTimeScheduled",{get:function(){return this.get("DateTimeScheduled")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"IsPausing",{get:function(){return this.get("IsPausing")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ThorLCR",{get:function(){return this.get("ThorLCR")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ApplicationValues",{get:function(){return this.get("ApplicationValues",{ApplicationValue:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HasArchiveQuery",{get:function(){return this.get("HasArchiveQuery")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"StateEx",{get:function(){return this.get("StateEx")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"PriorityClass",{get:function(){return this.get("PriorityClass")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"PriorityLevel",{get:function(){return this.get("PriorityLevel")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Snapshot",{get:function(){return this.get("Snapshot")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResultLimit",{get:function(){return this.get("ResultLimit")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"EventSchedule",{get:function(){return this.get("EventSchedule")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Query",{get:function(){return this.get("Query")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HelpersCount",{get:function(){return this.get("HelpersCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Helpers",{get:function(){return this.get("Helpers",{ECLHelpFile:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"DebugValues",{get:function(){return this.get("DebugValues")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"AllowedClusters",{get:function(){return this.get("AllowedClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ErrorCount",{get:function(){return this.get("ErrorCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"WarningCount",{get:function(){return this.get("WarningCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"InfoCount",{get:function(){return this.get("InfoCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"AlertCount",{get:function(){return this.get("AlertCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"SourceFileCount",{get:function(){return this.get("SourceFileCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"SourceFiles",{get:function(){return this.get("SourceFiles",{ECLSourceFile:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CSourceFiles",{get:function(){var e=this;return this.SourceFiles.ECLSourceFile.map(function(t){return new fo(e.connection,e.Wuid,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"VariableCount",{get:function(){return this.get("VariableCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Variables",{get:function(){return this.get("Variables",{ECLResult:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"TimerCount",{get:function(){return this.get("TimerCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HasDebugValue",{get:function(){return this.get("HasDebugValue")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ApplicationValueCount",{get:function(){return this.get("ApplicationValueCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"XmlParams",{get:function(){return this.get("XmlParams")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"AccessFlag",{get:function(){return this.get("AccessFlag")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ClusterFlag",{get:function(){return this.get("ClusterFlag")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResultViewCount",{get:function(){return this.get("ResultViewCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"DebugValueCount",{get:function(){return this.get("DebugValueCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"WorkflowCount",{get:function(){return this.get("WorkflowCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Archived",{get:function(){return this.get("Archived")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RoxieCluster",{get:function(){return this.get("RoxieCluster")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"DebugState",{get:function(){return this.get("DebugState",{})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Queue",{get:function(){return this.get("Queue")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Active",{get:function(){return this.get("Active")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Action",{get:function(){return this.get("Action")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Scope",{get:function(){return this.get("Scope")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"AbortBy",{get:function(){return this.get("AbortBy")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"AbortTime",{get:function(){return this.get("AbortTime")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Workflows",{get:function(){return this.get("Workflows")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"TimingData",{get:function(){return this.get("TimingData")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HelpersDesc",{get:function(){return this.get("HelpersDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"GraphsDesc",{get:function(){return this.get("GraphsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"SourceFilesDesc",{get:function(){return this.get("SourceFilesDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ResultsDesc",{get:function(){return this.get("ResultsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"VariablesDesc",{get:function(){return this.get("VariablesDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"TimersDesc",{get:function(){return this.get("TimersDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"DebugValuesDesc",{get:function(){return this.get("DebugValuesDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ApplicationValuesDesc",{get:function(){return this.get("ApplicationValuesDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"WorkflowsDesc",{get:function(){return this.get("WorkflowsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ServiceNames",{get:function(){return this.get("ServiceNames")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CompileCost",{get:function(){return this.get("CompileCost")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ExecuteCost",{get:function(){return this.get("ExecuteCost")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"FileAccessCost",{get:function(){return this.get("FileAccessCost")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"NoAccess",{get:function(){return this.get("NoAccess")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ECLWUProcessList",{get:function(){return this.get("ECLWUProcessList")},enumerable:!1,configurable:!0}),r.create=function(e){var t=new r(e);return t.connection.WUCreate().then(function(e){return To.set(t),t.set(e.Workunit),t})},r.attach=function(e,t,n){var o=To.get({BaseUrl:e.baseUrl,Wuid:t},function(){return new r(e,t)});return n&&o.set(n),o},r.existsLocal=function(e,t){return To.has({BaseUrl:e,Wuid:t})},r.submit=function(t,n,o,i){return void 0===i&&(i=!1),r.create(t).then(function(e){return e.update({QueryText:o})}).then(function(t){return i?t.submit(n,e.WUUpdate.Action.Compile):t.submit(n)})},r.compile=function(e,t,n){return r.submit(e,t,n,!0)},r.query=function(e,t){return new jt(e).WUQuery(t).then(function(t){return t.Workunits.ECLWorkunit.map(function(t){return r.attach(e,t.Wuid,t)})})},r.prototype.clearState=function(t){this.clear({Wuid:t,StateID:e.WUStateID.Unknown})},r.prototype.update=function(e){var t=this;return this.connection.WUUpdate(W(W({},e),{Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster})).then(function(e){return t.set(e.Workunit),t})},r.prototype.submit=function(t,n,r){var o,i=this;return void 0===n&&(n=e.WUUpdate.Action.Run),o=void 0!==t?Promise.resolve(t):this.topologyConnection.DefaultTpLogicalClusterQuery().then(function(e){return e.Name}),this._debugMode=!1,n===e.WUUpdate.Action.Debug&&(n=e.WUUpdate.Action.Run,this._debugMode=!0),o.then(function(e){return i.connection.WUUpdate({Wuid:i.Wuid,Action:n,ResultLimit:r,DebugValues:{DebugValue:[{Name:"Debug",Value:i._debugMode?"1":""}]}}).then(function(t){return i.set(t.Workunit),i._submitAction=n,i.connection.WUSubmit({Wuid:i.Wuid,Cluster:e})})}).then(function(){return i})},r.prototype.isComplete=function(){switch(this.StateID){case e.WUStateID.Compiled:return"compile"===this.ActionEx||this._submitAction===e.WUUpdate.Action.Compile;case e.WUStateID.Completed:case e.WUStateID.Failed:case e.WUStateID.Aborted:case e.WUStateID.NotFound:return!0}return!1},r.prototype.isFailed=function(){switch(this.StateID){case e.WUStateID.Aborted:case e.WUStateID.Failed:return!0}return!1},r.prototype.isDeleted=function(){return this.StateID===e.WUStateID.NotFound},r.prototype.isDebugging=function(){switch(this.StateID){case e.WUStateID.DebugPaused:case e.WUStateID.DebugRunning:return!0}return this._debugMode},r.prototype.isRunning=function(){switch(this.StateID){case e.WUStateID.Compiled:case e.WUStateID.Running:case e.WUStateID.Aborting:case e.WUStateID.Blocked:case e.WUStateID.DebugPaused:case e.WUStateID.DebugRunning:return!0}return!1},r.prototype.setToFailed=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.SetToFailed)},r.prototype.pause=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Pause)},r.prototype.pauseNow=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.PauseNow)},r.prototype.resume=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Resume)},r.prototype.abort=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Abort)},r.prototype.protect=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Protect)},r.prototype.unprotect=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Unprotect)},r.prototype.delete=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Delete)},r.prototype.restore=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Restore)},r.prototype.deschedule=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Deschedule)},r.prototype.reschedule=function(){return this.WUAction(e.WsWorkunits.ECLWUActions.Reschedule)},r.prototype.resubmit=function(){var e=this;return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(function(){return e.clearState(e.Wuid),e.refresh().then(function(){return e._monitor(),e})})},r.prototype.clone=function(){var e=this;return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(function(t){return r.attach(e.connection.opts(),t.WUs.WU[0].WUID).refresh()})},r.prototype.refreshState=function(){return F(this,void 0,void 0,function(){return w(this,function(t){switch(t.label){case 0:return[4,this.WUQuery()];case 1:return t.sent(),this.StateID!==e.WUStateID.Compiled||this.ActionEx||this._submitAction?[3,3]:[4,this.refreshInfo()];case 2:t.sent(),t.label=3;case 3:return[2,this]}})})},r.prototype.refreshInfo=function(e){return F(this,void 0,void 0,function(){return w(this,function(t){switch(t.label){case 0:return[4,this.WUInfo(e)];case 1:return t.sent(),[2,this]}})})},r.prototype.refreshDebug=function(){return F(this,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:return[4,this.debugStatus()];case 1:return e.sent(),[2,this]}})})},r.prototype.refresh=function(){return F(this,arguments,void 0,function(e,t){return void 0===e&&(e=!1),w(this,function(n){switch(n.label){case 0:return e?[4,Promise.all([this.refreshInfo(t),this.refreshDebug()])]:[3,2];case 1:return n.sent(),[3,4];case 2:return[4,this.refreshState()];case 3:n.sent(),n.label=4;case 4:return[2,this]}})})},r.prototype.eclExceptions=function(){return this.Exceptions.ECLException},r.prototype.fetchArchive=function(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})},r.prototype.fetchECLExceptions=function(){var e=this;return this.WUInfo({IncludeExceptions:!0}).then(function(){return e.eclExceptions()})},r.prototype.fetchResults=function(){var e=this;return this.WUInfo({IncludeResults:!0}).then(function(){return e.CResults})},r.prototype.fetchGraphs=function(){var e=this;return this.WUInfo({IncludeGraphs:!0}).then(function(){return e.CGraphs})},r.prototype.fetchQuery=function(){var e=this;return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(function(){return e.Query})},r.prototype.fetchHelpers=function(){var e=this;return this.WUInfo({IncludeHelpers:!0}).then(function(){var t;return(null===(t=e.Helpers)||void 0===t?void 0:t.ECLHelpFile)||[]})},r.prototype.fetchAllowedClusters=function(){var e=this;return this.WUInfo({IncludeAllowedClusters:!0}).then(function(){var t;return(null===(t=e.AllowedClusters)||void 0===t?void 0:t.AllowedCluster)||[]})},r.prototype.fetchTotalClusterTime=function(){var e=this;return this.WUInfo({IncludeTotalClusterTime:!0}).then(function(){return e.TotalClusterTime})},r.prototype.fetchServiceNames=function(){var e=this;return this.WUInfo({IncludeServiceNames:!0}).then(function(){var t;return null===(t=e.ServiceNames)||void 0===t?void 0:t.Item})},r.prototype.fetchDetailsMeta=function(e){return void 0===e&&(e={}),this.WUDetailsMeta(e)},r.prototype.fetchDetailsRaw=function(e){return void 0===e&&(e={}),this.WUDetails(e).then(function(e){return e.Scopes.Scope})},r.prototype.normalizeDetails=function(e,t){for(var n,r,o={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},i=[],s=function(t){var s={},u={};if(t&&t.Id&&t.Properties&&t.Properties.Property){var c=function(i){var c,a=t.Properties.Property[i];if("ns"===a.Measure&&(a.Measure="s"),"Kind"===a.Name){var p=parseInt(a.RawValue,10);a.Formatted=null!==(n=e.Activities.Activity.filter(function(e){return e.Kind===p})[0].Name)&&void 0!==n?n:a.RawValue}switch(o[a.Name]=W({},a),mo(o,a.Name,"RawValue"),mo(o,a.Name,"Formatted"),a.Measure){case"bool":s[a.Name]=!!+a.RawValue;break;case"sz":case"ns":case"cnt":case"node":case"skw":s[a.Name]=+a.RawValue;break;case"s":s[a.Name]=+a.RawValue/1e9;break;case"ts":s[a.Name]=new Date(+a.RawValue/1e3).toISOString();break;case"cost":s[a.Name]=+a.RawValue/1e6;break;default:s[a.Name]=a.RawValue}u[a.Name]=(c=null!==(r=a.Formatted)&&void 0!==r?r:s[a.Name])&&!isNaN(+c)?bo(+c):c};for(var a in t.Properties.Property)c(a)}var p=W({id:t.Id,name:t.ScopeName,type:t.ScopeType,Kind:t.Kind,Label:t.Label,__formattedProps:u,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:""},s);if(p[vo])try{var l=JSON.parse(p[vo].split("\\").join("\\\\"));p[vo]=[],l.forEach(function(e,t){var n,r=e.match(So);if(r){var o=(null!==(n=r[1])&&void 0!==n?n:"")+r[2]+r[3],i=parseInt(r[5]),s=parseInt(r[6]);p[vo].push({filePath:o,line:i,col:s})}})}catch(e){wo.error('Unexpected "DefinitionList": '.concat(p[vo]))}var f={};for(var a in p)if(0!==a.indexOf("__")){var h=Wo(p,a,f);h&&(p.__groupedProps[h.Key]=h,!isNaN(h.StdDevs)&&p.__StdDevs<h.StdDevs&&(p.__StdDevs=h.StdDevs,p.__StdDevsSource=h.Key))}i.push(p)},u=0,c=t;u<c.length;u++){s(c[u])}return{meta:e,columns:o,data:i}},r.prototype.fetchDetailsNormalized=function(e){var t=this;return void 0===e&&(e={}),Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(function(e){return t.normalizeDetails(e[0],e[1])})},r.prototype.fetchInfo=function(e){return void 0===e&&(e={}),this.WUInfo(e)},r.prototype.fetchDetails=function(e){var t=this;return void 0===e&&(e={}),this.WUDetails(e).then(function(e){return e.Scopes.Scope.map(function(e){return new lo(t,e)})})},r.prototype.fetchDetailsHierarchy=function(e){var t=this;return void 0===e&&(e={}),this.WUDetails(e).then(function(e){var n=[],r={};for(var o in e.Scopes.Scope.forEach(function(e){if(r[e.ScopeName])return r[e.ScopeName].update(e),null;var n=new lo(t,e);return r[n.ScopeName]=n,n}),r)if(r.hasOwnProperty(o)){var i=r[o],s=i.parentScope();s&&r[s]?r[s].children().push(i):n.push(i)}return n})},r.prototype.fetchGraphDetails=function(e,t){return void 0===e&&(e=[]),this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:t},NestedFilter:{Depth:999999,ScopeTypes:["graph","subgraph","activity","edge","function"]},PropertiesToReturn:{AllStatistics:!0,AllAttributes:!0,AllHints:!0,AllProperties:!0,AllScopes:!0},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}})},r.prototype.fetchScopeGraphs=function(e){return void 0===e&&(e=[]),this.fetchGraphDetails(e,["graph"]).then(function(e){return Kr(e)})},r.prototype.fetchTimeElapsed=function(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(function(e){var t={};e.forEach(function(e){t[e.ScopeName]=t[e.ScopeName]||{scope:e.ScopeName,start:null,elapsed:null,finish:null},e.CAttributes.forEach(function(n){"TimeElapsed"===n.Name?t[e.ScopeName].elapsed=+n.RawValue:"ts"===n.Measure&&n.Name.indexOf("Started")>=0&&(t[e.ScopeName].start=n.Formatted)})});var n=[];for(var r in t){var o=t[r];if(o.start&&o.elapsed){var i=go(o.start);i.setMilliseconds(i.getMilliseconds()+o.elapsed/1e6),o.finish=yo(i),n.push(o)}}return n.sort(function(e,t){return e.start<t.start?-1:e.start>t.start?1:0}),n})},r.prototype._monitor=function(){this.isComplete()?this._monitorTickCount=0:n.prototype._monitor.call(this)},r.prototype._monitorTimeoutDuration=function(){var e=n.prototype._monitorTimeoutDuration.call(this);return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e},r.prototype.on=function(e,t,r){var o=this;if(this.isCallback(t))switch(e){case"completed":n.prototype.on.call(this,"propChanged","StateID",function(e){o.isComplete()&&t([e])});break;case"changed":n.prototype.on.call(this,e,t)}else if("changed"===e)n.prototype.on.call(this,e,t,r);return this._monitor(),this},r.prototype.watchUntilComplete=function(e){var t=this;return new Promise(function(n,r){var o=t.watch(function(r){e&&e(r),t.isComplete()&&(o.release(),n(t))})})},r.prototype.watchUntilRunning=function(e){var t=this;return new Promise(function(n,r){var o=t.watch(function(r){e&&e(r),(t.isComplete()||t.isRunning())&&(o.release(),n(t))})})},r.prototype.WUQuery=function(t){var n=this;return void 0===t&&(t={}),this.connection.WUQuery(W(W({},t),{Wuid:this.Wuid})).then(function(e){return n.set(e.Workunits.ECLWorkunit[0]),e}).catch(function(t){if(!t.Exception.some(function(t){return 20081===t.Code&&(n.clearState(n.Wuid),n.set("StateID",e.WUStateID.NotFound),!0)}))throw wo.warning("Unexpected ESP exception: ".concat(t.message)),t;return{}})},r.prototype.WUCreate=function(){var e=this;return this.connection.WUCreate().then(function(t){return e.set(t.Workunit),To.set(e),t})},r.prototype.WUInfo=function(t){var n=this;void 0===t&&(t={});var r=t.IncludeResults||t.IncludeResultsViewNames;return this.connection.WUInfo(W(W({},t),{Wuid:this.Wuid,IncludeResults:r,IncludeResultsViewNames:r,SuppressResultSchemas:!1})).then(function(e){return n.set(e.Workunit),r&&n.set({ResultViews:e.ResultViews}),e}).catch(function(t){if(!t.Exception.some(function(t){return 20080===t.Code&&(n.clearState(n.Wuid),n.set("StateID",e.WUStateID.NotFound),!0)}))throw wo.warning("Unexpected ESP exception: ".concat(t.message)),t;return{}})},r.prototype.WUResubmit=function(e){return this.connection.WUResubmit(t.deepMixinT({},e,{Wuids:{Item:[this.Wuid]}}))},r.prototype.WUDetailsMeta=function(e){return this.connection.WUDetailsMeta(e)},r.prototype.WUDetails=function(e){return this.connection.WUDetails(t.deepMixinT({ScopeFilter:{MaxDepth:9999},ScopeOptions:{IncludeMatchedScopesInResults:!0,IncludeScope:!0,IncludeId:!1,IncludeScopeType:!1},PropertyOptions:{IncludeName:!0,IncludeRawValue:!1,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},e,{WUID:this.Wuid})).then(function(e){return t.deepMixinT({Scopes:{Scope:[]}},e)})},r.prototype.WUAction=function(e){var t=this;return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(function(e){return t.refresh().then(function(){return t._monitor(),e})})},r.prototype.publish=function(t){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:t||this.Jobname,AllowForeignFiles:!0,Activate:e.WsWorkunits.WUQueryActivationMode.ActivateQuery,Wait:5e3})},r.prototype.publishEx=function(e){var t=new Wt({baseUrl:""}),n=W({Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3},e);return t.WUPublishWorkunitEx(n)},r.prototype.WUCDebug=function(e,t){void 0===t&&(t={});var n="";for(var r in t)t.hasOwnProperty(r)&&(n+=" ".concat(r,"='").concat(t[r],"'"));return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:"<debug:".concat(e," uid='").concat(this.Wuid,"'").concat(n,"/>")}).then(function(e){return e})},r.prototype.debug=function(e,n){return this.isDebugging()?this.WUCDebug(e,n).then(function(n){var r=n.children(e);return r.length?r[0]:new t.XMLNode(e)}).catch(function(n){return wo.error(n),Promise.resolve(new t.XMLNode(e))}):Promise.resolve(new t.XMLNode(e))},r.prototype.debugStatus=function(){var e=this;return this.isDebugging()?this.debug("status").then(function(t){var n=W(W({},e.DebugState),t.$);return e.set({DebugState:n}),t}):Promise.resolve({DebugState:{state:"unknown"}})},r.prototype.debugContinue=function(e){return void 0===e&&(e=""),this.debug("continue",{mode:e})},r.prototype.debugStep=function(e){return this.debug("step",{mode:e})},r.prototype.debugPause=function(){return this.debug("interrupt")},r.prototype.debugQuit=function(){return this.debug("quit")},r.prototype.debugDeleteAllBreakpoints=function(){return this.debug("delete",{idx:0})},r.prototype.debugBreakpointResponseParser=function(e){return e.children().map(function(e){if("break"===e.name)return e.$})},r.prototype.debugBreakpointAdd=function(e,t,n){var r=this;return this.debug("breakpoint",{id:e,mode:t,action:n}).then(function(e){return r.debugBreakpointResponseParser(e)})},r.prototype.debugBreakpointList=function(){var e=this;return this.debug("list").then(function(t){return e.debugBreakpointResponseParser(t)})},r.prototype.debugGraph=function(){var e=this;return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(function(t){return e.DebugState._prevGraphSequenceNum=e.DebugState.graphSequenceNum,e._debugAllGraph=Xr(e.Wuid,t),e._debugAllGraph})},r.prototype.debugBreakpointValid=function(e){return this.debugGraph().then(function(t){return function(e,t){for(var n=[],r=0,o=e.vertices;r<o.length;r++){var i=o[r];if(Eo(i)){var s=xo(i);(s&&!t||t===s.file)&&n.push(s)}}return n.sort(function(e,t){return e.line-t.line})}(t,e)})},r.prototype.debugPrint=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=10),this.debug("print",{edgeID:e,startRow:t,numRows:n}).then(function(e){return e.children().map(function(e){var t={};return e.children().forEach(function(e){t[e.name]=e.content}),t})})},r}(t.StateObject),Lo="definition";function Eo(e){return void 0!==e._[Lo]}function xo(e){var t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[Lo]);if(t){var n=t[1],r=t[2],o=t[3];return n.replace(/\/\.\//g,"/"),{id:e._.id,file:n,line:+r,column:+o}}throw new Error("Bad definition: ".concat(e._[Lo]))}var Io=function(e){function n(n){var r=e.call(this)||this;return r.lazyRefresh=t.debounce(function(){return F(r,void 0,void 0,function(){var e;return w(this,function(t){switch(t.label){case 0:return[4,this.connection.Activity({})];case 1:return e=t.sent(),this.set(e),[2,this]}})})}),r.connection=n instanceof it?n:new it(n),r.clear({}),r}return j(n,e),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Exceptions",{get:function(){return this.get("Exceptions")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Build",{get:function(){return this.get("Build")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ThorClusterList",{get:function(){return this.get("ThorClusterList")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RoxieClusterList",{get:function(){return this.get("RoxieClusterList")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HThorClusterList",{get:function(){return this.get("HThorClusterList")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DFUJobs",{get:function(){return this.get("DFUJobs")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Running",{get:function(){return this.get("Running",{ActiveWorkunit:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerContent",{get:function(){return this.get("BannerContent")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerColor",{get:function(){return this.get("BannerColor")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerSize",{get:function(){return this.get("BannerSize")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerScroll",{get:function(){return this.get("BannerScroll")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ChatURL",{get:function(){return this.get("ChatURL")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShowBanner",{get:function(){return this.get("ShowBanner")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShowChatURL",{get:function(){return this.get("ShowChatURL")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SortBy",{get:function(){return this.get("SortBy")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Descending",{get:function(){return this.get("Descending")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SuperUser",{get:function(){return this.get("SuperUser")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"AccessRight",{get:function(){return this.get("AccessRight")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ServerJobQueues",{get:function(){return this.get("ServerJobQueues")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ActivityTime",{get:function(){return this.get("ActivityTime")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DaliDetached",{get:function(){return this.get("DaliDetached")},enumerable:!1,configurable:!0}),n.attach=function(e,t){return Fo||(Fo=new n(e)),t&&Fo.set(t),Fo},n.prototype.runningWorkunits=function(e){var t=this;return void 0===e&&(e=""),this.Running.ActiveWorkunit.filter(function(t){return""===e||t.ClusterName===e}).map(function(e){return Oo.attach(t.connection.connectionOptions(),e.Wuid,e)})},n.prototype.setBanner=function(e){var t=this;return this.connection.SetBanner(W({},e)).then(function(e){return t.set(e),t})},n.prototype.refresh=function(){return F(this,void 0,void 0,function(){return w(this,function(e){return[2,this.lazyRefresh()]})})},n}(t.StateObject),No=t.scopedLogger("logicalFile.ts"),Mo=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.Cluster,"-").concat(e.Name)})||this}return j(t,e),t}(t.Cache),ko=new Mo,Go=function(e){function t(t,n,r){var o=e.call(this)||this;return o.connection=t instanceof Pe?t:new Pe(t),o.clear({Cluster:n,Name:r}),o}return j(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Cluster",{get:function(){return this.get("Cluster")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Filename",{get:function(){return this.get("Filename")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Prefix",{get:function(){return this.get("Prefix")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"NodeGroup",{get:function(){return this.get("NodeGroup")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"NumParts",{get:function(){return this.get("NumParts")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Description",{get:function(){return this.get("Description")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dir",{get:function(){return this.get("Dir")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PathMask",{get:function(){return this.get("PathMask")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Filesize",{get:function(){return this.get("Filesize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FileSizeInt64",{get:function(){return this.get("FileSizeInt64")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordSize",{get:function(){return this.get("RecordSize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordCount",{get:function(){return this.get("RecordCount")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordSizeInt64",{get:function(){return this.get("RecordSizeInt64")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordCountInt64",{get:function(){return this.get("RecordCountInt64")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Owner",{get:function(){return this.get("Owner")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"JobName",{get:function(){return this.get("JobName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Persistent",{get:function(){return this.get("Persistent")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Format",{get:function(){return this.get("Format")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"MaxRecordSize",{get:function(){return this.get("MaxRecordSize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvSeparate",{get:function(){return this.get("CsvSeparate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvQuote",{get:function(){return this.get("CsvQuote")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvTerminate",{get:function(){return this.get("CsvTerminate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvEscape",{get:function(){return this.get("CsvEscape")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Modified",{get:function(){return this.get("Modified")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ecl",{get:function(){return this.get("Ecl")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Stat",{get:function(){return this.get("Stat")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DFUFilePartsOnClusters",{get:function(){return this.get("DFUFilePartsOnClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSuperfile",{get:function(){return this.get("isSuperfile")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ShowFileContent",{get:function(){return this.get("ShowFileContent")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subfiles",{get:function(){return this.get("subfiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Superfiles",{get:function(){return this.get("Superfiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ProtectList",{get:function(){return this.get("ProtectList")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FromRoxieCluster",{get:function(){return this.get("FromRoxieCluster")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Graphs",{get:function(){return this.get("Graphs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"UserPermission",{get:function(){return this.get("UserPermission")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ContentType",{get:function(){return this.get("ContentType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CompressedFileSize",{get:function(){return this.get("CompressedFileSize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PercentCompressed",{get:function(){return this.get("PercentCompressed")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsCompressed",{get:function(){return this.get("IsCompressed")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BrowseData",{get:function(){return this.get("BrowseData")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jsonInfo",{get:function(){return this.get("jsonInfo")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"binInfo",{get:function(){return this.get("binInfo")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PackageID",{get:function(){return this.get("PackageID")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Partition",{get:function(){return this.get("Partition")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Blooms",{get:function(){return this.get("Blooms")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ExpireDays",{get:function(){return this.get("ExpireDays")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"KeyType",{get:function(){return this.get("KeyType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsRestricted",{get:function(){return this.get("IsRestricted")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"AtRestCost",{get:function(){return this.get("AtRestCost")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"AccessCost",{get:function(){return this.get("AccessCost")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"StateID",{get:function(){return this.get("StateID")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ExpirationDate",{get:function(){return this.get("ExpirationDate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ExtendedIndexInfo",{get:function(){return this.get("ExtendedIndexInfo")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),t.attach=function(e,n,r,o){var i=ko.get({BaseUrl:e.baseUrl,Cluster:n,Name:r},function(){return new t(e,n,r)});return o&&i.set(o),i},t.prototype.filePartsOnCluster=function(){var e;return A([],(null===(e=this.DFUFilePartsOnClusters)||void 0===e?void 0:e.DFUFilePartsOnCluster)||[],!0)},t.prototype.fileParts=function(){for(var e,t,n=[],r=0,o=(null===(e=this.DFUFilePartsOnClusters)||void 0===e?void 0:e.DFUFilePartsOnCluster)||[];r<o.length;r++)for(var i=o[r],s=0,u=(null===(t=null==i?void 0:i.DFUFileParts)||void 0===t?void 0:t.DFUPart)||[];s<u.length;s++){var c=u[s],a=W(W({},i),c);delete a.DFUFileParts,n.push(a)}return n},t.prototype.update=function(e){var t=this;return this.connection.DFUInfo(W(W({},e),{Cluster:this.Cluster,Name:this.Name})).then(function(e){return t.set(W({Cluster:t.Cluster},e.FileDetail)),e})},t.prototype.fetchInfo=function(){var e=this;return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(function(t){var n,r;return e.set(W(W({Cluster:e.Cluster},t.FileDetail),{ProtectList:null!==(r=null===(n=null==t?void 0:t.FileDetail)||void 0===n?void 0:n.ProtectList)&&void 0!==r?r:{DFUFileProtect:[]}})),t.FileDetail}).catch(function(t){if(!t.Exception.some(function(t){return 20038===t.Code&&(e.set("Name",e.Name+" (Deleted)"),e.set("StateID",999),!0)}))throw No.warning("Unexpected ESP exception: ".concat(t.message)),t;return{}})},t.prototype.fetchDefFile=function(e){return this.connection.DFUFile({Name:this.Name,Format:e})},t.prototype.fetchAllLogicalFiles=function(){return this.connection.recursiveFetchLogicalFiles([this])},t.prototype.fetchListHistory=function(){return this.connection.ListHistory({Name:this.Name}).then(function(e){var t;return(null===(t=null==e?void 0:e.History)||void 0===t?void 0:t.Origin)||[]})},t.prototype.eraseHistory=function(){return this.connection.EraseHistory({Name:this.Name}).then(function(e){var t;return(null===(t=null==e?void 0:e.History)||void 0===t?void 0:t.Origin)||[]})},t}(t.StateObject),Vo=function(e){function t(){return e.call(this,function(e){return e.Address})||this}return j(t,e),t}(t.Cache),Qo=new Vo,Bo=function(e){function t(t){var n=e.call(this)||this;return n.connection=t instanceof Ke?t:new Ke(t),n}return j(t,e),Object.defineProperty(t.prototype,"Address",{get:function(){return this.get("Address")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ConfigAddress",{get:function(){return this.get("ConfigAddress")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ProcessType",{get:function(){return this.get("ProcessType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DisplayType",{get:function(){return this.get("DisplayType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Description",{get:function(){return this.get("Description")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"AgentVersion",{get:function(){return this.get("AgentVersion")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Contact",{get:function(){return this.get("Contact")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Location",{get:function(){return this.get("Location")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"UpTime",{get:function(){return this.get("UpTime")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ComponentName",{get:function(){return this.get("ComponentName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ComponentPath",{get:function(){return this.get("ComponentPath")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RoxieState",{get:function(){return this.get("RoxieState")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RoxieStateDetails",{get:function(){return this.get("RoxieStateDetails")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OS",{get:function(){return this.get("OS")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ProcessNumber",{get:function(){return this.get("ProcessNumber")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Channels",{get:function(){return this.get("Channels")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Processors",{get:function(){return this.get("Processors")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Storage",{get:function(){return this.get("Storage")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Running",{get:function(){return this.get("Running")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PhysicalMemory",{get:function(){return this.get("PhysicalMemory")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"VirtualMemory",{get:function(){return this.get("VirtualMemory")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ComponentInfo",{get:function(){return this.get("ComponentInfo")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Exception",{get:function(){return this.get("Exception")},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){var o=Qo.get({Address:n},function(){return new t(e)});return r&&o.set(r),o},t}(t.StateObject),Xo=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.Name)})||this}return j(t,e),t}(t.Cache),Ho=new Xo,Jo=function(e){function t(t,n){var r=e.call(this)||this;return t instanceof Ut?(r.connection=t,r.machineConnection=new Ke(t.connectionOptions())):(r.connection=new Ut(t),r.machineConnection=new Ke(t)),r.clear({Name:n}),r}return j(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Prefix",{get:function(){return this.get("Prefix")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.get("Type")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsDefault",{get:function(){return this.get("IsDefault")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpClusters",{get:function(){return this.get("TpClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclCCServers",{get:function(){return this.get("TpEclCCServers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclServers",{get:function(){return this.get("TpEclServers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclAgents",{get:function(){return this.get("TpEclAgents")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclSchedulers",{get:function(){return this.get("TpEclSchedulers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"MachineInfoEx",{get:function(){return this.get("MachineInfoEx",[])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMachineInfoEx",{get:function(){var e=this;return this.MachineInfoEx.map(function(t){return Bo.attach(e.machineConnection,t.Address,t)})},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){var o=Ho.get({BaseUrl:e.baseUrl,Name:n},function(){return new t(e,n)});return r&&o.set(r),o},t.prototype.fetchMachines=function(e){var t=this;return void 0===e&&(e={}),this.machineConnection.GetTargetClusterInfo(W({TargetClusters:{Item:["".concat(this.Type,":").concat(this.Name)]}},e)).then(function(e){for(var n=[],r=0,o=e.TargetClusterInfoList.TargetClusterInfo;r<o.length;r++)for(var i=0,s=o[r].Processes.MachineInfoEx;i<s.length;i++){var u=s[i];n.push(u)}return t.set("MachineInfoEx",n),t.CMachineInfoEx})},t.prototype.machineStats=function(){for(var e=0,t=0,n=0,r=0,o=this.CMachineInfoEx;r<o.length;r++)for(var i=0,s=o[r].Storage.StorageInfo;i<s.length;i++){var u=s[i];t+=u.Available,n+=u.Total;var c=1-u.Available/u.Total;c>e&&(e=c)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}},t.prototype.fetchUsage=function(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])},t}(t.StateObject);var qo={};var zo,Ko,Yo=function(e){function t(){return e.call(this,function(e){return e.BaseUrl})||this}return j(t,e),t}(t.Cache),Zo=new Yo,$o=function(e){function n(t){var n=e.call(this)||this;return n.connection=t instanceof Ut?t:new Ut(t),n}return j(n,e),Object.defineProperty(n.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"TargetClusters",{get:function(){return this.get("TargetClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CTargetClusters",{get:function(){var e=this;return this.TargetClusters.map(function(t){return Jo.attach(e.connection,t.Name,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"LogicalClusters",{get:function(){return this.get("LogicalClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Services",{get:function(){return this.get("Services")},enumerable:!1,configurable:!0}),n.attach=function(e,t){var r=Zo.get({BaseUrl:e.baseUrl},function(){return new n(e)});return t&&r.set(t),r},n.prototype.GetESPServiceBaseURL=function(e){var n=this;return void 0===e&&(e=""),this.connection.TpServiceQuery({}).then(function(r){var o=n.connection.protocol(),i=n.connection.ip(),s="https:"===o?"18002":"8002";if(t.exists("ServiceList.TpEspServers.TpEspServer",r))for(var u=0,c=r.ServiceList.TpEspServers.TpEspServer;u<c.length;u++){var a=c[u];if(t.exists("TpBindings.TpBinding",a))for(var p=0,l=a.TpBindings.TpBinding;p<l.length;p++){var f=l[p];f.Service===e&&f.Protocol+":"===o&&(s=f.Port)}}return"".concat(o,"//").concat(i,":").concat(s,"/")})},n.prototype.fetchTargetClusters=function(){var e=this;return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(function(t){var n,r;return e.set({TargetClusters:null!==(r=null===(n=t.TpTargetClusters)||void 0===n?void 0:n.TpTargetCluster)&&void 0!==r?r:[]}),e.CTargetClusters})},n.prototype.fetchLogicalClusters=function(e){var t=this;return void 0===e&&(e={}),this.connection.TpLogicalClusterQuery(e).then(function(e){return t.set({LogicalClusters:e.TpLogicalClusters.TpLogicalCluster}),t.LogicalClusters})},n.prototype.fetchServices=function(e){var t=this;return void 0===e&&(e={}),this.connection.TpServiceQuery(e).then(function(e){return t.set({Services:e.ServiceList}),t.Services})},n.prototype.refresh=function(e){var t=this;return void 0===e&&(e=!1),this._prevRefresh&&!e||(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(function(){return t})),this._prevRefresh},n.prototype.on=function(t,n,r){if(this.isCallback(n)){if("changed"===t)e.prototype.on.call(this,t,n)}else if("changed"===t)e.prototype.on.call(this,t,n,r);return this._monitor(),this},n}(t.StateObject);function ei(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=n)}function ti(e){return(e=""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function ni(e,t){var n=e.indexOf(t);return-1!==n?parseFloat(e.substring(0,n)):-1}!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.GRAPH=1]="GRAPH",e[e.SUBGRAPH=2]="SUBGRAPH",e[e.VERTEX=3]="VERTEX",e[e.EDGE=4]="EDGE",e[e.LAST=5]="LAST"}(zo||(zo={})),function(e){e.UNKNOWN="Unknown",e.GRAPH="Graph",e.SUBGRAPH="Cluster",e.VERTEX="Vertex",e.EDGE="Edge",e.LAST="Last"}(Ko||(Ko={}));var ri=function(){function e(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}return e.prototype.calcVisibility=function(e,t,n,r){var o=this;this.noSpills=r,e.forEach(function(e){o.graph.isVertex(e)?(o.calcInVertexVisibility(e,n),o.calcOutVertexVisibility(e,n)):o.graph.isEdge(e)?(o.calcInVertexVisibility(e.getSource(),n-1),o.calcOutVertexVisibility(e.getTarget(),n-1)):o.graph.isSubgraph(e)&&(o.m_visibleSubgraphs[e.__hpcc_id]=e,o.calcSubgraphVisibility(e,t-1))}),this.calcVisibility2()},e.prototype.calcInVertexVisibility=function(e,t){var n=this;this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(function(e){n.calcInVertexVisibility(e.getSource(),t-1)})},e.prototype.calcOutVertexVisibility=function(e,t){var n=this;this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(function(e){n.calcOutVertexVisibility(e.getTarget(),t-1)})},e.prototype.calcSubgraphVisibility=function(e,t){var n=this;if(!(t<0)){t>0&&e.__hpcc_subgraphs.forEach(function(e,r){n.calcSubgraphVisibility(e,t-1)}),e.__hpcc_subgraphs.forEach(function(e,t){n.m_visibleSubgraphs[e.__hpcc_id]=e}),e.__hpcc_vertices.forEach(function(e,t){n.m_visibleVertices[e.__hpcc_id]=e});var r={};this.graph.edges.forEach(function(t,o){t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===n.getCommonAncestor(t)&&(r[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]||(r[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]=!0,n.m_visibleEdges[t.__hpcc_id]=t))})}},e.prototype.buildVertexString=function(e,t){var n="",r="",o=e.getProperties();for(var i in o)t&&i.indexOf("_kind")>=0?r+='<att name="_kind" value="point"/>':"id"===i||"label"===i?n+=" "+i+'="'+ti(o[i])+'"':r+='<att name="'+i+'" value="'+ti(o[i])+'"/>';return"<node"+n+">"+r+"</node>"},e.prototype.buildEdgeString=function(e){var t="",n="",r=e.getProperties();for(var o in r)"id"===o.toLowerCase()||"label"===o.toLowerCase()||"source"===o.toLowerCase()||"target"===o.toLowerCase()?t+=" "+o+'="'+ti(r[o])+'"':n+='<att name="'+o+'" value="'+ti(r[o])+'"/>';return"<edge"+t+">"+n+"</edge>"},e.prototype.getAncestors=function(e,t){for(var n=e.__hpcc_parent;n;)t.push(n),n=n.__hpcc_parent},e.prototype.getCommonAncestorV=function(e,t){var n=[],r=[];this.getAncestors(e,n),this.getAncestors(t,r);for(var o=n.length-1,i=r.length-1,s=null;o>=0&&i>=0&&n[o]===r[i];)s=n[o],--o,--i;return s},e.prototype.getCommonAncestor=function(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())},e.prototype.calcAncestorVisibility=function(e){var t=this,n=[];this.getAncestors(e,n),n.forEach(function(e,n){t.m_visibleSubgraphs[e.__hpcc_id]=e})},e.prototype.calcVisibility2=function(){var e=this;for(var t in this.m_visibleVertices){var n=this.m_visibleVertices[t];n.getInEdges().forEach(function(t,n){e.m_visibleEdges[t.__hpcc_id]=t}),n.getOutEdges().forEach(function(t,n){e.m_visibleEdges[t.__hpcc_id]=t}),this.calcAncestorVisibility(n)}this.calcSemiVisibleVertices()},e.prototype.addSemiVisibleEdge=function(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)},e.prototype.addSemiVisibleVertex=function(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))},e.prototype.calcSemiVisibleVertices=function(){for(var e in this.m_visibleEdges){var t=this.m_visibleEdges[e],n=t.getSource();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){var r=n.getInEdges();if(!r.length)break;this.addSemiVisibleEdge(r[0]),n=r[0].getSource(),this.addSemiVisibleVertex(n)}var o=t.getTarget();for(this.addSemiVisibleVertex(o);this.noSpills&&o.isSpill();){var i=o.getOutEdges();if(!i.length)break;this.addSemiVisibleEdge(i[0]),o=i[0].getTarget(),this.addSemiVisibleVertex(o)}}},e.prototype.writeXgmml=function(){var e=this;this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach(function(t,n){e.edgeVisited(t)})},e.prototype.subgraphVisited=function(e,t){if(void 0===t&&(t=!1),this.m_visibleSubgraphs[e.__hpcc_id]){var n="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';var r=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),r===this.m_xgmml.length){var o=e.__hpcc_vertices[0];o&&(this.m_xgmml+=this.buildVertexString(o,!0))}var i=e.getProperties();for(var s in i)n+='<att name="'+s+'" value="'+ti(i[s])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+n+"</node>"}return!1},e.prototype.vertexVisited=function(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))},e.prototype.edgeVisited=function(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))},e}(),oi=function(){function e(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}return e.prototype.getProperties=function(){var e={};for(var t in this)0!==t.indexOf("__")&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e},e}(),ii=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._globalType="0"===n?"Graph":"Cluster",r.__hpcc_subgraphs=[],r.__hpcc_vertices=[],r.__hpcc_edges=[],r.id=n,r}return j(t,e),t.prototype.addSubgraph=function(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(function(t){return e===t})||this.__hpcc_subgraphs.push(e)},t.prototype.addVertex=function(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(function(t){return e===t})||this.__hpcc_vertices.push(e)},t.prototype.removeVertex=function(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(function(t){return e!==t})},t.prototype.addEdge=function(e){e.__hpcc_parent=this,this.__hpcc_edges.some(function(t){return e===t})||this.__hpcc_edges.push(e)},t.prototype.removeEdge=function(e){this.__hpcc_edges=this.__hpcc_edges.filter(function(t){return e!==t})},t.prototype.remove=function(){var e=this;this.__hpcc_subgraphs.forEach(function(t){return t.__hpcc_parent=e.__hpcc_parent}),this.__hpcc_vertices.forEach(function(t){return t.__hpcc_parent=e.__hpcc_parent}),this.__hpcc_edges.forEach(function(t){return t.__hpcc_parent=e.__hpcc_parent}),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)},t.prototype.walkSubgraphs=function(e){this.__hpcc_subgraphs.forEach(function(t,n){e.subgraphVisited(t)&&t.walkSubgraphs(e)})},t.prototype.walkVertices=function(e){this.__hpcc_vertices.forEach(function(t,n){e.vertexVisited(t)})},t}(oi),si=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._globalType="Vertex",r}return j(t,e),t.prototype.isSpill=function(){return this._isSpill},t.prototype.remove=function(){var e,t=this.getInVertices();t.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(function(e){e.remove()}),this.getOutEdges().forEach(function(e){e.setSource(t[0])}),null===(e=this.__hpcc_parent)||void 0===e||e.removeVertex(this),this.__hpcc_graph.removeItem(this)},t.prototype.getInVertices=function(){return this.getInEdges().map(function(e){return e.getSource()})},t.prototype.getInEdges=function(){var e=this;return this.__hpcc_graph.edges.filter(function(t){return t.getTarget()===e})},t.prototype.getOutVertices=function(){return this.getOutEdges().map(function(e){return e.getTarget()})},t.prototype.getOutEdges=function(){var e=this;return this.__hpcc_graph.edges.filter(function(t){return t.getSource()===e})},t}(oi),ui=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._globalType="Edge",r._globalType="Edge",r}return j(t,e),t.prototype.remove=function(){var e=this;this.__hpcc_graph.subgraphs.forEach(function(t){t.removeEdge(e)}),this.__hpcc_graph.removeItem(this)},t.prototype.getSource=function(){return this.__hpcc_graph.idx[this._sourceActivity||this.source]},t.prototype.setSource=function(e){this._sourceActivity?this._sourceActivity=e.__hpcc_id:this.source&&(this.source=e.__hpcc_id),this.__widget&&this.__widget.setSource(this.getSource().__widget)},t.prototype.getTarget=function(){return this.__hpcc_graph.idx[this._targetActivity||this.target]},t}(oi),ci=function(){function e(){this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[],this.xgmml="",this.clear()}return e.prototype.clear=function(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]},e.prototype.load=function(e){this.clear(),this.merge(e)},e.prototype.merge=function(e){this.xgmml=e;var t=(new DOMParser).parseFromString(e,"text/xml");this.walkDocument(t.documentElement,"0")},e.prototype.isSubgraph=function(e){return e instanceof ii},e.prototype.isVertex=function(e){return e instanceof si},e.prototype.isEdge=function(e){return e instanceof ui},e.prototype.getGlobalType=function(t){return t instanceof si?zo.VERTEX:t instanceof ui?zo.EDGE:t instanceof ii?zo.SUBGRAPH:t instanceof e?zo.GRAPH:zo.UNKNOWN},e.prototype.getGlobalTypeString=function(t){return t instanceof si?Ko.VERTEX:t instanceof ui?Ko.EDGE:t instanceof ii?Ko.SUBGRAPH:t instanceof e?Ko.GRAPH:Ko.UNKNOWN},e.prototype.getItem=function(e,t){if(!this.idx[t])switch(e.tagName){case"graph":var n=new ii(this,t);this.subgraphs.push(n),this.idx[t]=n;break;case"node":var r=new si(this,t);this.vertices.push(r),this.idx[t]=r;break;case"edge":var o=new ui(this,t);this.edges.push(o),this.idx[t]=o;break;default:console.warn("Graph.getItem - Unknown Node Type!")}var i=this.idx[t];return Array.from(e.attributes).forEach(function(e){ei(i,e.name,e.value)}),i},e.prototype.removeItem=function(e){delete this.idx[e.__hpcc_id],e instanceof ii?this.subgraphs=this.subgraphs.filter(function(t){return e!==t}):e instanceof si?this.vertices=this.vertices.filter(function(t){return e!==t}):e instanceof ui&&(this.edges=this.edges.filter(function(t){return e!==t}))},e.prototype.getChildByTagName=function(e,t){var n=null;return Array.from(e.childNodes).some(function(e,r){if(e.tagName===t)return n=e,!0}),n},e.prototype.walkDocument=function(e,t){var n=this,r=this.getItem(e,t);return e.childNodes.forEach(function(e,t){if(1===e.nodeType)switch(e.tagName){case"graph":break;case"node":var o=!1,i=n.getChildByTagName(e,"att");if(i){var s=n.getChildByTagName(i,"graph");if(s){o=!0;var u=n.walkDocument(s,e.getAttribute("id"));r.addSubgraph(u)}}if(!o){var c=n.walkDocument(e,e.getAttribute("id"));r.addVertex(c)}break;case"att":var a=e.getAttribute("name"),p="_"+a,l=e.getAttribute("value");0===a.indexOf("Time")?(ei(r,p,l),ei(r,a,""+function(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);var t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(e);return t?24*(+t[1]||0)*60*60+60*(+t[2]||0)*60+60*(+t[3]||0)+(+t[4]||0)+(+t[5]||0)/1e3+(+t[6]||0)/1e6+(+t[7]||0)/1e9:0}(l))):0===a.indexOf("Size")?(ei(r,p,l),ei(r,a,""+function(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);var t=ni(e,"Kb");return t>=0?1024*t:(t=ni(e,"Mb"))>=0?t*Math.pow(1024,2):(t=ni(e,"Gb"))>=0?t*Math.pow(1024,3):(t=ni(e,"Tb"))>=0?t*Math.pow(1024,4):(t=ni(e,"Pb"))>=0?t*Math.pow(1024,5):(t=ni(e,"Eb"))>=0?t*Math.pow(1024,6):(t=ni(e,"Zb"))>=0?t*Math.pow(1024,7):(t=ni(e,"b"))>=0?t:0}(l))):0===a.indexOf("Skew")?(ei(r,p,l),ei(r,a,""+((y=l)?parseFloat(y):0))):ei(r,a,l);break;case"edge":var f=n.walkDocument(e,e.getAttribute("id"));if(void 0!==f.NumRowsProcessed?f._eclwatchCount=f.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==f.Count?f._eclwatchCount=f.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==f.count&&(f._eclwatchCount=f.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),f.inputProgress&&(f._eclwatchInputProgress="["+f.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),f.SkewMaxRowsProcessed&&f.SkewMinRowsProcessed&&(f._eclwatchSkew="+"+f.SkewMaxRowsProcessed+", "+f.SkewMinRowsProcessed),f._dependsOn);else if(f._childGraph);else if(f._sourceActivity||f._targetActivity){f._isSpill=!0;var h=f.getSource();h&&(h._isSpill=!0);var d=f.getTarget();d&&(d._isSpill=!0)}r.addEdge(f)}var y}),r},e.prototype.removeSubgraphs=function(){A([],this.subgraphs,!0).forEach(function(e){e.__hpcc_parent instanceof ii&&e.remove()})},e.prototype.removeSpillVertices=function(){A([],this.vertices,!0).forEach(function(e){e.isSpill()&&e.remove()})},e.prototype.getLocalisedXGMML=function(e,t,n,r){var o=new ri(this);return o.calcVisibility(e,t,n,r),o.writeXgmml(),"<graph>"+o.m_xgmml+"</graph>"},e}(),ai=t.scopedLogger("@hpcc-js/comms/ecl/query.ts"),pi=Nt("~s");var li,fi=new(function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.QueryId,e.QuerySet])})||this}return j(n,e),n}(t.Cache)),hi=function(e){function t(t,n,r,o){var i=e.call(this)||this;return i.wsWorkunitsService=t instanceof jt?t:new jt(t),i.topology=$o.attach(i.wsWorkunitsService.opts()),i.set(W({QuerySet:n,QueryId:r},o)),i}return j(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.wsWorkunitsService.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Exceptions",{get:function(){return this.get("Exceptions")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"QueryId",{get:function(){return this.get("QueryId")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"QuerySet",{get:function(){return this.get("QuerySet")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"QueryName",{get:function(){return this.get("QueryName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dll",{get:function(){return this.get("Dll")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Suspended",{get:function(){return this.get("Suspended")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Activated",{get:function(){return this.get("Activated")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SuspendedBy",{get:function(){return this.get("SuspendedBy")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Clusters",{get:function(){return this.get("Clusters")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PublishedBy",{get:function(){return this.get("PublishedBy")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Comment",{get:function(){return this.get("Comment")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LogicalFiles",{get:function(){return this.get("LogicalFiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SuperFiles",{get:function(){return this.get("SuperFiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsLibrary",{get:function(){return this.get("IsLibrary")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Priority",{get:function(){return this.get("Priority")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WUSnapShot",{get:function(){return this.get("WUSnapShot")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CompileTime",{get:function(){return this.get("CompileTime")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LibrariesUsed",{get:function(){return this.get("LibrariesUsed")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CountGraphs",{get:function(){return this.get("CountGraphs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ResourceURLCount",{get:function(){return this.get("ResourceURLCount")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WsEclAddresses",{get:function(){return this.get("WsEclAddresses")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WUGraphs",{get:function(){return this.get("WUGraphs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WUTimers",{get:function(){return this.get("WUTimers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PriorityID",{get:function(){return this.get("PriorityID")},enumerable:!1,configurable:!0}),t.attach=function(e,n,r,o){var i=fi.get({BaseUrl:e.baseUrl,QuerySet:n,QueryId:r},function(){return new t(e,n,r)});return o&&i.set(o),i},t.prototype.wsEclService=function(){return F(this,void 0,void 0,function(){return w(this,function(e){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(function(e){for(var t,n,r,o,i=0,s=null!==(n=null===(t=null==e?void 0:e.TpEspServers)||void 0===t?void 0:t.TpEspServer)&&void 0!==n?n:[];i<s.length;i++)for(var u=s[i],c=0,a=null!==(o=null===(r=null==u?void 0:u.TpBindings)||void 0===r?void 0:r.TpBinding)&&void 0!==o?o:[];c<a.length;c++){var p=a[c];if("ws_ecl"===(null==p?void 0:p.Service)){var l="".concat(p.Protocol,"://").concat(globalThis.location.hostname,":").concat(p.Port);return new Ie({baseUrl:l})}}})),[2,this._eclService]})})},t.prototype.fetchDetails=function(){return F(this,void 0,void 0,function(){var e;return w(this,function(t){switch(t.label){case 0:return[4,this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1})];case 1:return e=t.sent(),this.set(W({},e)),[2]}})})},t.prototype.fetchRequestSchema=function(){return F(this,void 0,void 0,function(){var e,t,n,r;return w(this,function(o){switch(o.label){case 0:return[4,this.wsEclService()];case 1:e=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),t=this,[4,null==e?void 0:e.requestJson(this.QuerySet,this.QueryId)];case 3:return t._requestSchema=null!==(r=o.sent())&&void 0!==r?r:[],[3,5];case 4:return n=o.sent(),ai.debug(n),this._requestSchema=[],[3,5];case 5:return[2]}})})},t.prototype.fetchResponseSchema=function(){return F(this,void 0,void 0,function(){var e,t,n,r;return w(this,function(o){switch(o.label){case 0:return[4,this.wsEclService()];case 1:e=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),t=this,[4,null==e?void 0:e.responseJson(this.QuerySet,this.QueryId)];case 3:return t._responseSchema=null!==(r=o.sent())&&void 0!==r?r:{},[3,5];case 4:return n=o.sent(),ai.debug(n),this._responseSchema={},[3,5];case 5:return[2]}})})},t.prototype.fetchSchema=function(){return F(this,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:return[4,Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])];case 1:return e.sent(),[2]}})})},t.prototype.fetchSummaryStats=function(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})},t.prototype.fetchGraph=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=""),this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(function(e){for(var t,n=new ci,r=!0,o=0,i=(null===(t=null==e?void 0:e.Graphs)||void 0===t?void 0:t.ECLGraphEx)||[];o<i.length;o++){var s=i[o];r?(n.load(s.Graph),r=!1):n.merge(s.Graph)}return n})},t.prototype.fetchDetailsNormalized=function(e){void 0===e&&(e={});var t=Oo.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(function(e){var n=e[0],r=e[1],o=e[2].map(function(e){if("a"===e.Id[0]||"e"===e.Id[0]){var t=n.idx[e.Id.substring(1)],r=function(n){if("_"!==n.charAt(0)&&n.charAt(0)===n.charAt(0).toUpperCase()&&("string"==typeof t[n]||"number"==typeof t[n]||"boolean"==typeof t[n])&&!e.Properties.Property.some(function(e){return e.Name===n})){var r=(i=t[n],!isNaN(parseFloat(i))&&!isNaN(i-0))?parseFloat(t[n]):t[n],o=t[n];n.indexOf("Time")>=0&&(o=pi(r/=1e9)+"s"),e.Properties.Property.push({Name:n,RawValue:r,Formatted:o})}var i};for(var o in t)r(o)}return e});return t.normalizeDetails(r,o)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})},t.prototype.submit=function(e){return F(this,void 0,void 0,function(){var t,n;return w(this,function(r){switch(r.label){case 0:return[4,this.wsEclService()];case 1:t=r.sent();try{return[2,null!==(n=null==t?void 0:t.submit(this.QuerySet,this.QueryId,e).then(function(e){for(var t in e)e[t]=e[t].Row;return e}))&&void 0!==n?n:[]]}catch(e){return ai.debug(e),[2,[]]}return[2]}})})},t.prototype.refresh=function(){return F(this,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:return[4,Promise.all([this.fetchDetails(),this.fetchSchema()])];case 1:return e.sent(),[2,this]}})})},t.prototype.requestFields=function(){return this._requestSchema?this._requestSchema:[]},t.prototype.responseFields=function(){return this._responseSchema?this._responseSchema:{}},t.prototype.resultNames=function(){var e=[];for(var t in this.responseFields())e.push(t);return e},t.prototype.resultFields=function(e){return this._responseSchema[e]?this._responseSchema[e]:[]},t}(t.StateObject),di=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.Name,":").concat(e.UserSpecific,"-").concat(e.Namespace)})||this}return j(t,e),t}(t.Cache),yi=new di,gi=function(e){function t(t,n,r){var o=e.call(this)||this;return o.key=t,o.value=n,o.oldValue=r,o}return j(t,e),Object.defineProperty(t.prototype,"canConflate",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.conflate=function(e){return this.key===e.key&&(this.value=e.value,!0)},t.prototype.void=function(){return this.value===this.oldValue},t}(t.Message),bi=function(){function e(e,n,r,o){this._dispatch=new t.Dispatch,this._knownValues={},this.connection=e instanceof st?e:new st(e),this.Name=n,this.UserSpecific=o,this.Namespace=r}return Object.defineProperty(e.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),e.attach=function(t,n,r,o){return void 0===n&&(n="HPCCApps"),void 0===o&&(o=!0),yi.get({BaseUrl:t.baseUrl,Name:n,UserSpecific:o,Namespace:r},function(){return new e(t,n,r,o)})},e.prototype.create=function(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})},e.prototype.set=function(e,t,n){var r=this;return void 0===n&&(n=!0),this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(function(o){var i=r._knownValues[e];r._knownValues[e]=t,n&&r._dispatch.post(new gi(e,t,i))}).catch(function(n){console.error('Store.set("'.concat(e,'", "').concat(t,'") failed:'),n)})},e.prototype.get=function(e,t){var n=this;return void 0===t&&(t=!0),this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(function(r){var o=n._knownValues[e];return n._knownValues[e]=r.Value,t&&n._dispatch.post(new gi(e,r.Value,o)),r.Value}).catch(function(t){console.error("Store.get(".concat(e,") failed:"),t)})},e.prototype.getAll=function(e){var t=this;return void 0===e&&(e=!0),this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(function(n){var r={},o=t._knownValues;if(t._knownValues={},n.Pairs.Pair.forEach(function(n){var i=t._knownValues[n.Key];t._knownValues[n.Key]=n.Value,delete o[n.Key],r[n.Key]=n.Value,e&&t._dispatch.post(new gi(n.Key,n.Value,i))}),e)for(var i in o)t._dispatch.post(new gi(i,void 0,o[i]));return r}).catch(function(e){return console.error("Store.getAll failed:",e),{}})},e.prototype.delete=function(e,t){var n=this;return void 0===t&&(t=!0),this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(function(r){var o=n._knownValues[e];delete n._knownValues[e],t&&n._dispatch.post(new gi(e,void 0,o))}).catch(function(t){console.error("Store.delete(".concat(e,") failed:"),t)})},e.prototype.monitor=function(e){return this._dispatch.attach(e)},e}(),mi=t.scopedLogger("@hpcc-js/comms/dfuWorkunit.ts");!function(e){e[e.Unknown=0]="Unknown",e[e.Scheduled=1]="Scheduled",e[e.Queued=2]="Queued",e[e.Started=3]="Started",e[e.Aborted=4]="Aborted",e[e.Failed=5]="Failed",e[e.Finished=6]="Finished",e[e.Monitoring=7]="Monitoring",e[e.Aborting=8]="Aborting",e[e.NotFound=999]="NotFound"}(li||(li={}));var vi=function(e){function t(){return e.call(this,function(e){return"".concat(e.BaseUrl,"-").concat(e.ID)})||this}return j(t,e),t}(t.Cache),Si=new vi,Ui=function(t){function n(e,n){var r=t.call(this)||this;return r.connection=new ie(e),r.topologyConnection=new Ut(e),r.clearState(n),r}return j(n,t),Object.defineProperty(n.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ID",{get:function(){return this.get("ID")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DFUServerName",{get:function(){return this.get("DFUServerName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ClusterName",{get:function(){return this.get("ClusterName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"JobName",{get:function(){return this.get("JobName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Queue",{get:function(){return this.get("Queue")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"User",{get:function(){return this.get("User")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isProtected",{get:function(){return this.get("isProtected")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Command",{get:function(){return this.get("Command")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CommandMessage",{get:function(){return this.get("CommandMessage")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"PercentDone",{get:function(){return this.get("PercentDone")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SecsLeft",{get:function(){return this.get("SecsLeft")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ProgressMessage",{get:function(){return this.get("ProgressMessage")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SummaryMessage",{get:function(){return this.get("SummaryMessage")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"State",{get:function(){return this.get("State",li.Unknown)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceLogicalName",{get:function(){return this.get("SourceLogicalName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceIP",{get:function(){return this.get("SourceIP")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceFilePath",{get:function(){return this.get("SourceFilePath")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceDali",{get:function(){return this.get("SourceDali")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceRecordSize",{get:function(){return this.get("SourceRecordSize")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceFormat",{get:function(){return this.get("SourceFormat")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RowTag",{get:function(){return this.get("RowTag")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceNumParts",{get:function(){return this.get("SourceNumParts")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceDirectory",{get:function(){return this.get("SourceDirectory")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestLogicalName",{get:function(){return this.get("DestLogicalName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestGroupName",{get:function(){return this.get("DestGroupName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestDirectory",{get:function(){return this.get("DestDirectory")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestIP",{get:function(){return this.get("DestIP")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestFilePath",{get:function(){return this.get("DestFilePath")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestFormat",{get:function(){return this.get("DestFormat")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestNumParts",{get:function(){return this.get("DestNumParts")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestRecordSize",{get:function(){return this.get("DestRecordSize")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Replicate",{get:function(){return this.get("Replicate")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Overwrite",{get:function(){return this.get("Overwrite")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Compress",{get:function(){return this.get("Compress")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceCsvSeparate",{get:function(){return this.get("SourceCsvSeparate")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceCsvQuote",{get:function(){return this.get("SourceCsvQuote")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceCsvTerminate",{get:function(){return this.get("SourceCsvTerminate")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceCsvEscape",{get:function(){return this.get("SourceCsvEscape")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"TimeStarted",{get:function(){return this.get("TimeStarted")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"TimeStopped",{get:function(){return this.get("TimeStopped")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"StateMessage",{get:function(){return this.get("StateMessage")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"MonitorEventName",{get:function(){return this.get("MonitorEventName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"MonitorSub",{get:function(){return this.get("MonitorSub")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"MonitorShotLimit",{get:function(){return this.get("MonitorShotLimit")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SourceDiffKeyName",{get:function(){return this.get("SourceDiffKeyName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DestDiffKeyName",{get:function(){return this.get("DestDiffKeyName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Archived",{get:function(){return this.get("Archived")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"encrypt",{get:function(){return this.get("encrypt")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"decrypt",{get:function(){return this.get("decrypt")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"failIfNoSourceFile",{get:function(){return this.get("failIfNoSourceFile")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recordStructurePresent",{get:function(){return this.get("recordStructurePresent")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"quotedTerminator",{get:function(){return this.get("quotedTerminator")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"preserveCompression",{get:function(){return this.get("preserveCompression")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"expireDays",{get:function(){return this.get("expireDays")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"PreserveFileParts",{get:function(){return this.get("PreserveFileParts")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"FileAccessCost",{get:function(){return this.get("FileAccessCost")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"KbPerSecAve",{get:function(){return this.get("KbPerSecAve")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"KbPerSec",{get:function(){return this.get("KbPerSec")},enumerable:!1,configurable:!0}),n.create=function(e,t){var r=new n(e);return r.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(function(e){return Si.set(r),r.set(e.result),r})},n.attach=function(e,t,r){var o=Si.get({BaseUrl:e.baseUrl,ID:t},function(){return new n(e,t)});return r&&o.set(r),o},n.sprayFixed=function(e,t){var r=new ie(e);return r.SprayFixedEx(W({},t)).then(function(t){var o=t.wuid;return r.GetDFUWorkunit({wuid:o}).then(function(t){return n.attach(e,o,t.result)})})},n.sprayVariable=function(e,t){var r=new ie(e);return r.SprayVariableEx(W({},t)).then(function(t){var o=t.wuid;return r.GetDFUWorkunit({wuid:o}).then(function(t){return n.attach(e,o,t.result)})})},n.despray=function(e,t){var r=new ie(e);return r.DesprayEx(W({},t)).then(function(t){var o=t.wuid;return r.GetDFUWorkunit({wuid:o}).then(function(t){return n.attach(e,o,t.result)})})},n.prototype.update=function(e){var t,n,r,o;return this.connection.UpdateDFUWorkunitEx({wu:{JobName:null!==(n=null===(t=null==e?void 0:e.wu)||void 0===t?void 0:t.JobName)&&void 0!==n?n:this.JobName,isProtected:null!==(o=null===(r=null==e?void 0:e.wu)||void 0===r?void 0:r.isProtected)&&void 0!==o?o:this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})},n.prototype.isComplete=function(){switch(this.State){case li.Finished:case li.Failed:case li.Aborted:case li.NotFound:return!0}return!1},n.prototype.isFailed=function(){return!(!this.isComplete()||this.State===li.Finished)},n.prototype.isDeleted=function(){return this.State===li.NotFound},n.prototype.isRunning=function(){return!this.isComplete()},n.prototype.abort=function(){return this.connection.AbortDFUWorkunit({wuid:this.ID})},n.prototype.delete=function(){var t=this;return this.DFUWUAction(e.FileSpray.DFUWUActions.Delete).then(function(e){return t.refresh().then(function(){return t._monitor(),e})})},n.prototype.refresh=function(){return F(this,arguments,void 0,function(e){return w(this,function(e){switch(e.label){case 0:return[4,this.GetDFUWorkunit()];case 1:return e.sent(),[2,this]}})})},n.prototype.fetchXML=function(e){return this.DFUWUFile()},n.prototype._monitor=function(){this.isComplete()?this._monitorTickCount=0:t.prototype._monitor.call(this)},n.prototype._monitorTimeoutDuration=function(){var e=t.prototype._monitorTimeoutDuration.call(this);return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:e},n.prototype.DFUWUFile=function(e){return void 0===e&&(e={}),this.connection.DFUWUFileEx(W(W({},e),{Wuid:this.ID})).then(function(e){return e}).catch(function(e){return""})},n.prototype.DFUWUAction=function(t){var n=this;return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:t}).then(function(r){return t===e.FileSpray.DFUWUActions.Delete?r:n.refresh().then(function(){return n._monitor(),r})})},n.prototype.on=function(e,n,r){var o=this;if(this.isCallback(n))switch(e){case"finished":t.prototype.on.call(this,"propChanged","State",function(e){o.isComplete()&&n([e])});break;case"changed":t.prototype.on.call(this,e,n)}else if("changed"===e)t.prototype.on.call(this,e,n,r);return this._monitor(),this},n.prototype.watchUntilComplete=function(e){var t=this;return new Promise(function(n,r){var o=t.watch(function(r){e&&e(r),t.isComplete()&&(o.release(),n(t))})})},n.prototype.watchUntilRunning=function(e){var t=this;return new Promise(function(n,r){var o=t.watch(function(r){e&&e(r),(t.isComplete()||t.isRunning())&&(o.release(),n(t))})})},n.prototype.clearState=function(e){this.clear({ID:e,State:li.Unknown})},n.prototype.GetDFUWorkunit=function(e){var t=this;return void 0===e&&(e={}),this.connection.GetDFUWorkunit(W(W({},e),{wuid:this.ID})).then(function(e){return t.set(e.result),e}).catch(function(e){if(!e.Exception.some(function(e){return(20080===e.Code||20081===e.Code)&&(t.clearState(t.ID),t.set("State",li.NotFound),!0)}))throw mi.warning("Unexpected ESP exception: ".concat(e.message)),e;return{}})},n}(t.StateObject);e.AccessService=se,e.AccountService=ue,e.Activity=Io,e.Attribute=ao,e.BUILD_VERSION="2.108.9",e.BaseScope=po,e.CloudService=ye,e.CodesignService=ge,e.Connection=B,e.DFUArrayActions=ve,e.DFUChangeProtection=Ue,e.DFUChangeRestriction=_e,e.DFUDefFileFormat=Se,e.DFUService=Pe,e.DFUWorkunit=Ui,e.DFUWorkunitCache=vi,e.DFUXRefService=De,e.DaliService=be,e.ECLGraph=Ir,e.ESPConnection=z,e.ESPExceptions=H,e.EclService=Ie,e.ElkService=Ne,e.FileSprayService=ie,e.GlobalResultCache=io,e.GraphCache=Nr,e.LogaccessService=Qe,e.LogicalFile=Go,e.LogicalFileCache=Mo,e.Machine=Bo,e.MachineCache=Vo,e.MachineService=Ke,e.PKG_NAME="@hpcc-js/comms",e.PKG_VERSION="2.102.3",e.PackageProcessService=Ye,e.PropertyType=Uo,e.Query=hi,e.QueryGraph=ci,e.RelatedProperty=_o,e.Resource=Yr,e.ResourcesService=Ze,e.Result=uo,e.ResultCache=co,e.SMCService=it,e.SashaService=nt,e.Scope=lo,e.ScopeEdge=zr,e.ScopeGraph=Hr,e.ScopeSubgraph=Jr,e.ScopeVertex=qr,e.Service=K,e.SourceFile=fo,e.Store=bi,e.StoreCache=di,e.StoreService=st,e.TargetCluster=Jo,e.TargetClusterCache=Xo,e.Timer=ho,e.Topology=$o,e.TopologyCache=Yo,e.TopologyService=Ut,e.ValueChangedMessage=gi,e.Workunit=Oo,e.WorkunitCache=Ao,e.WorkunitsService=jt,e.WorkunitsServiceEx=Wt,e.XGMMLEdge=Br,e.XGMMLGraph=Gr,e.XGMMLSubgraph=Vr,e.XGMMLVertex=Qr,e.XSDNode=Zr,e.XSDSchema=to,e.XSDSimpleType=eo,e.XSDXMLNode=$r,e.createGraph=Kr,e.createXGMMLGraph=Xr,e.defaultTargetCluster=function(e){if(!qo[e.baseUrl]){var t=void 0;t=e instanceof Ut?e:new Ut(e),qo[e.baseUrl]=t.TpListTargetClusters({}).then(function(t){var n,r,o;t.TargetClusters.TpClusterNameType.forEach(function(e){n||(n=e),r||!0!==e.IsDefault||(r=e),o||"hthor"!==e.Type||(o=e)});var i=r||o||n;return Jo.attach(e,i.Name,i)})}return qo[e.baseUrl]},e.deserializeResponse=x,e.get=G,e.hookSend=function(e){var t=Q;return e&&(Q=e),t},e.instanceOfIConnection=function(e){return"function"==typeof e.opts&&"function"==typeof e.send&&"function"==typeof e.clone},e.instanceOfIOptions=function(e){return"baseUrl"in e},e.isArray=X,e.isECLResult=Rt,e.isExceptions=function(e){return e instanceof H||e.isESPExceptions&&Array.isArray(e.Exception)},e.isWUInfoWorkunit=function(e){return void 0!==e.StateEx},e.isWUQueryECLWorkunit=function(e){return void 0!==e.TotalClusterTime},e.jsonp=I,e.parseXSD=ro,e.parseXSD2=function(e,t){var n=new oo(t);return n.parse(e),n.schema},e.post=k,e.send=V,e.serializeRequest=E,e.setTransportFactory=function(t){var n=e.createConnection;return e.createConnection=t,n},e.splitMetric=Co,e.targetClusters=function(e){return(e instanceof Ut?e:new Ut(e)).TpListTargetClusters({}).then(function(t){return t.TargetClusters.TpClusterNameType.map(function(t){return Jo.attach(e,t.Name,t)})})}});
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|