@hpcc-js/comms 2.72.0 → 2.74.0
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/dist/index.es6.js +316 -311
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +240 -212
- 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 +337 -291
- 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/lib-es6/__package__.js.map +1 -1
- package/lib-es6/__tests__/https.js +2 -2
- package/lib-es6/__tests__/https.js.map +1 -1
- package/lib-es6/__tests__/workunit.js +1 -1
- package/lib-es6/__tests__/workunit.js.map +1 -1
- package/lib-es6/clienttools/eclMeta.js +4 -4
- package/lib-es6/clienttools/eclMeta.js.map +1 -1
- package/lib-es6/clienttools/eclcc.js +18 -19
- package/lib-es6/clienttools/eclcc.js.map +1 -1
- package/lib-es6/connection.js +6 -6
- package/lib-es6/connection.js.map +1 -1
- package/lib-es6/ecl/graph.js +5 -5
- package/lib-es6/ecl/graph.js.map +1 -1
- package/lib-es6/ecl/logicalFile.js +2 -2
- package/lib-es6/ecl/logicalFile.js.map +1 -1
- package/lib-es6/ecl/machine.js +3 -3
- package/lib-es6/ecl/machine.js.map +1 -1
- package/lib-es6/ecl/result.js +1 -1
- package/lib-es6/ecl/result.js.map +1 -1
- package/lib-es6/ecl/scope.js +5 -5
- package/lib-es6/ecl/scope.js.map +1 -1
- package/lib-es6/ecl/store.js +4 -4
- package/lib-es6/ecl/store.js.map +1 -1
- package/lib-es6/ecl/targetCluster.js +6 -6
- package/lib-es6/ecl/targetCluster.js.map +1 -1
- package/lib-es6/ecl/topology.js +1 -1
- package/lib-es6/ecl/topology.js.map +1 -1
- package/lib-es6/ecl/workunit.js +4 -4
- package/lib-es6/ecl/workunit.js.map +1 -1
- package/lib-es6/espConnection.js +1 -1
- package/lib-es6/espConnection.js.map +1 -1
- package/lib-es6/services/wsAccess.js +7 -7
- package/lib-es6/services/wsAccess.js.map +1 -1
- package/lib-es6/services/wsDali.js +11 -0
- package/lib-es6/services/wsDali.js.map +1 -0
- package/lib-es6/services/wsEcl.js +3 -3
- package/lib-es6/services/wsEcl.js.map +1 -1
- package/lib-es6/services/wsLogaccess.js +7 -7
- package/lib-es6/services/wsLogaccess.js.map +1 -1
- package/lib-es6/services/wsMachine.js +13 -9
- package/lib-es6/services/wsMachine.js.map +1 -1
- package/lib-es6/services/wsResources.js +7 -7
- package/lib-es6/services/wsResources.js.map +1 -1
- package/lib-es6/services/wsdl/WsDali/v1.04/WsDali.js +68 -0
- package/lib-es6/services/wsdl/WsDali/v1.04/WsDali.js.map +1 -0
- package/lib-es6/services/wsdl/WsResources/v1.01/WsResources.js +8 -8
- package/lib-es6/services/wsdl/WsResources/v1.01/WsResources.js.map +1 -1
- package/lib-es6/services/wsdl/ws_access/v1.16/ws_access.js +58 -58
- package/lib-es6/services/wsdl/ws_access/v1.16/ws_access.js.map +1 -1
- package/lib-es6/services/wsdl/{WsLogaccess/v1/WsLogaccess.js → ws_logaccess/v1/ws_logaccess.js} +10 -10
- package/lib-es6/services/wsdl/ws_logaccess/v1/ws_logaccess.js.map +1 -0
- package/lib-es6/services/wsdl/ws_machine/v1.17/ws_machine.js +15 -15
- package/lib-es6/services/wsdl/ws_machine/v1.17/ws_machine.js.map +1 -1
- package/package.json +17 -35
- package/src/__package__.ts +2 -2
- package/src/__tests__/https.ts +2 -2
- package/src/__tests__/workunit.ts +1 -1
- package/src/clienttools/eclcc.ts +0 -1
- package/src/ecl/graph.ts +5 -5
- package/src/ecl/machine.ts +6 -6
- package/src/ecl/targetCluster.ts +5 -5
- package/src/ecl/topology.ts +1 -1
- package/src/services/wsAccess.ts +2 -2
- package/src/services/wsDali.ts +8 -0
- package/src/services/wsLogaccess.ts +2 -2
- package/src/services/wsMachine.ts +7 -4
- package/src/services/wsResources.ts +2 -2
- package/src/services/wsdl/WsDali/v1.04/WsDali.ts +213 -0
- package/src/services/wsdl/WsResources/v1.01/WsResources.ts +1 -1
- package/src/services/wsdl/ws_access/v1.16/ws_access.ts +1 -1
- package/src/services/wsdl/{WsLogaccess/v1/WsLogaccess.ts → ws_logaccess/v1/ws_logaccess.ts} +3 -3
- package/src/services/wsdl/ws_machine/v1.17/ws_machine.ts +1 -1
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types/clienttools/eclcc.d.ts.map +1 -1
- package/types/ecl/activity.d.ts +1 -1
- package/types/ecl/activity.d.ts.map +1 -1
- package/types/ecl/machine.d.ts +3 -3
- package/types/ecl/machine.d.ts.map +1 -1
- package/types/ecl/targetCluster.d.ts +2 -2
- package/types/ecl/targetCluster.d.ts.map +1 -1
- package/types/ecl/topology.d.ts.map +1 -1
- package/types/services/wsAccess.d.ts +2 -2
- package/types/services/wsAccess.d.ts.map +1 -1
- package/types/services/wsDali.d.ts +5 -0
- package/types/services/wsDali.d.ts.map +1 -0
- package/types/services/wsLogaccess.d.ts +2 -2
- package/types/services/wsLogaccess.d.ts.map +1 -1
- package/types/services/wsMachine.d.ts +3 -3
- package/types/services/wsMachine.d.ts.map +1 -1
- package/types/services/wsResources.d.ts +2 -2
- package/types/services/wsResources.d.ts.map +1 -1
- package/types/services/wsdl/WsDali/v1.04/WsDali.d.ts +122 -0
- package/types/services/wsdl/WsDali/v1.04/WsDali.d.ts.map +1 -0
- package/types/services/wsdl/WsResources/v1.01/WsResources.d.ts +1 -1
- package/types/services/wsdl/WsResources/v1.01/WsResources.d.ts.map +1 -1
- package/types/services/wsdl/ws_access/v1.16/ws_access.d.ts +1 -1
- package/types/services/wsdl/ws_access/v1.16/ws_access.d.ts.map +1 -1
- package/types/services/wsdl/{WsLogaccess/v1/WsLogaccess.d.ts → ws_logaccess/v1/ws_logaccess.d.ts} +3 -3
- package/types/services/wsdl/ws_logaccess/v1/ws_logaccess.d.ts.map +1 -0
- package/types/services/wsdl/ws_machine/v1.17/ws_machine.d.ts +1 -1
- package/types/services/wsdl/ws_machine/v1.17/ws_machine.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/ecl/activity.d.ts +1 -1
- package/types-3.4/ecl/machine.d.ts +3 -3
- package/types-3.4/ecl/targetCluster.d.ts +2 -2
- package/types-3.4/services/wsAccess.d.ts +2 -2
- package/types-3.4/services/wsDali.d.ts +5 -0
- package/types-3.4/services/wsLogaccess.d.ts +2 -2
- package/types-3.4/services/wsMachine.d.ts +3 -3
- package/types-3.4/services/wsResources.d.ts +2 -2
- package/types-3.4/services/wsdl/WsDali/v1.04/WsDali.d.ts +122 -0
- package/types-3.4/services/wsdl/WsResources/v1.01/WsResources.d.ts +1 -1
- package/types-3.4/services/wsdl/ws_access/v1.16/ws_access.d.ts +1 -1
- package/types-3.4/services/wsdl/{WsLogaccess/v1/WsLogaccess.d.ts → ws_logaccess/v1/ws_logaccess.d.ts} +3 -3
- package/types-3.4/services/wsdl/ws_machine/v1.17/ws_machine.d.ts +1 -1
- package/lib-es6/services/wsdl/WsLogaccess/v1/WsLogaccess.js.map +0 -1
- package/types/services/wsdl/WsLogaccess/v1/WsLogaccess.d.ts.map +0 -1
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=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||void 0!==n&&n,r={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(r.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function a(e){this.map={},e instanceof a?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function l(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):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.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=p(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=p(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))}return this.blob().then(l)}),this.text=function(){var e,t,n,r=p(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=f(t),t.readAsText(e),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)},r.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}a.prototype.append=function(e,t){e=u(e),t=c(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},a.prototype.delete=function(e){delete this.map[u(e)]},a.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},a.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},a.prototype.set=function(e,t){this.map[u(e)]=c(t)},a.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},a.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),s(e)},a.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),s(e)},a.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),s(e)},r.iterable&&(a.prototype[Symbol.iterator]=a.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){if(!(this instanceof g))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,o=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new a(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=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 a(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),y.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function b(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 m(e,t){if(!(this instanceof m))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"",this.headers=new a(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},d.call(g.prototype),d.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new a(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];m.redirect=function(e,t){if(-1===v.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})};var S=n.DOMException;try{new S}catch(e){(S=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),S.prototype.constructor=S}function P(e,t){return new Promise(function(o,i){var u=new g(e,t);if(u.signal&&u.signal.aborted)return i(new S("Aborted","AbortError"));var s=new XMLHttpRequest;function p(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new a,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var r="response"in s?s.response:s.responseText;setTimeout(function(){o(new m(r,n))},0)},s.onerror=function(){setTimeout(function(){i(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){i(new TypeError("Network request failed"))},0)},s.onabort=function(){setTimeout(function(){i(new S("Aborted","AbortError"))},0)},s.open(u.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(u.url),!0),"include"===u.credentials?s.withCredentials=!0:"omit"===u.credentials&&(s.withCredentials=!1),"responseType"in s&&(r.blob?s.responseType="blob":r.arrayBuffer&&u.headers.get("Content-Type")&&-1!==u.headers.get("Content-Type").indexOf("application/octet-stream")&&(s.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof a?u.headers.forEach(function(e,t){s.setRequestHeader(t,e)}):Object.getOwnPropertyNames(t.headers).forEach(function(e){s.setRequestHeader(e,c(t.headers[e]))}),u.signal&&(u.signal.addEventListener("abort",p),s.onreadystatechange=function(){4===s.readyState&&u.signal.removeEventListener("abort",p)}),s.send(void 0===u._bodyInit?null:u._bodyInit)})}P.polyfill=!0,n.fetch||(n.fetch=P,n.Headers=a,n.Request=g,n.Response=m);var U=function(e,t){return(U=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])})(e,t)};function C(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}U(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}).apply(this,arguments)};function O(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,c)}s((r=r.apply(e,t||[])).next())})}function j(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var _=t.scopedLogger("comms/connection.ts");var T={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function D(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function R(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=""),n&&(n+="."),"object"!=typeof e)return D(e,t);var r=[],o=function(o){if(e.hasOwnProperty(o))if(e[o]instanceof Array){var i=!1;e[o].forEach(function(e,u){"object"==typeof e?(i=!0,r.push(R(e,t,n+D(o+"."+u,t)))):r.push(n+D(o+"_i"+u,t)+"="+R(e,t))}),i&&r.push(n+D(o+".itemcount",t)+"="+e[o].length)}else"object"==typeof e[o]?e[o]&&e[o].Item instanceof Array?(r.push(R(e[o].Item,t,n+D(o,t))),r.push(n+D(o+".itemcount",t)+"="+e[o].Item.length)):r.push(R(e[o],t,n+D(o,t))):void 0!==e[o]?r.push(n+D(o,t)+"="+D(e[o],t)):r.push(n+D(o,t))};for(var i in e)o(i);return r.join("&")}function x(e){return JSON.parse(e)}function A(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,u){var c=1e3*e.timeoutSecs,s="jsonp_callback_"+Math.round(999999*Math.random());window[s]=function(e){c=0,l(),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="+s+"&"+R(r,e.encodeRequest),document.body.appendChild(a);var f=setInterval(function(){c<=0?clearInterval(f):(c-=5e3)<=0?(clearInterval(f),_.error("Request timeout: "+a.src),l(),u(Error("Request timeout: "+a.src))):_.debug("Request pending ("+c/1e3+" sec): "+a.src)},5e3);function l(){delete window[s],document.body.removeChild(a)}})}var W={};function N(e,n,r,o,i){function u(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 "+btoa(e.userID+":"+e.password)}:{}}(e)),o),r=w(w({credentials:W[e.baseUrl]?"omit":"include"},r),{headers:o}),0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&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(u).catch(function(o){return r.credentials=W[e.baseUrl]?"include":"omit",fetch(t.join(e.baseUrl,n),r).then(u).then(function(t){return W[e.baseUrl]=!W[e.baseUrl],t})}))}function I(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_),N(e,t,{method:"post",body:R(n,e.encodeRequest),signal:i},w({"Content-Type":"application/x-www-form-urlencoded"},o),r)}function F(e,t,n,r,o){var i;return void 0===r&&(r="json"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),N(e,t+"?"+R(n,e.encodeRequest),{method:"get",signal:i},w({},o),r)}function E(e,t,n,r,o){var i;switch(void 0===r&&(r="json"),e.type){case"jsonp":i=A(e,t,n,r,o);break;case"get":i=F(e,t,n,r,o);break;case"post":default:i=I(e,t,n,r,o)}return i}var M=E;var L=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({},T),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,M,r):M(this._opts,e,t,n,r)},e.prototype.clone=function(){return new e(this.opts())},e}();function k(e){return"[object Array]"===Object.prototype.toString.call(e)}e.createConnection=function(e){return new L(e)};var G=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=r.Exception[0].Code+": "+r.Exception[0].Message:o.message="",o}return C(t,e),t}(Error);var V,B,Q,H,X,q,Y=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(k(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,u){void 0===n&&(n={}),void 0===r&&(r="json"),void 0===o&&(o=!1);var c,s=w(w({},n),{ver_:this._version});o&&(s.upload_=!0),i&&(s.abortSignal_=i);var a="json";switch(r){case"text":c=t.join(this._service,e),a="text";break;case"xsd":c=t.join(this._service,e+".xsd"),a="text";break;case"json2":c=t.join(this._service,e+"/json"),r="json";var p=e.split("/");e=p.pop();break;default:c=t.join(this._service,e+".json")}return this._connection.send(c,s,a).then(function(t){if("json"===r){var n=void 0;if(t&&t.Exceptions)throw new G(e,s,t.Exceptions);if(t&&(n=t[u||e+"Response"]),!n)throw new G(e,s,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return n}return t}).catch(function(t){if(t.isESPExceptions)throw t;throw new G(e,s,{Source:"ESPConnection.send",Exception:[{Code:0,Message:t.message}]})})},n.prototype.clone=function(){return new n(this._connection.clone(),this._service,this._version)},n}(),z=function(){function e(e,t,n){this._connection=new Y(e,t,n)}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._connection.opts().baseUrl},enumerable:!1,configurable:!0}),e}();!function(e){e.User="User",e.Group="Group"}(V||(V={})),function(e){e.Username="Username",e.Fullname="Fullname",e.Passwordexpiration="Passwordexpiration",e.EmployeeID="EmployeeID",e.EmployeeNumber="EmployeeNumber"}(B||(B={})),function(e){e.Name="Name",e.ManagedBy="ManagedBy"}(Q||(Q={})),function(e){e.Any="Any",e.User="User",e.Group="Group"}(H||(H={})),function(e){e.Name="Name",e.Type="Type"}(X||(X={})),function(e){e.Name="Name"}(q||(q={}));var J=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(function(e){function t(t){return e.call(this,t,"ws_access","1.16")||this}return C(t,e),t.prototype.AccountPermissions=function(e){return this._connection.send("AccountPermissions",e)},t.prototype.AddUser=function(e){return this._connection.send("AddUser",e)},t.prototype.AddView=function(e){return this._connection.send("AddView",e)},t.prototype.AddViewColumn=function(e){return this._connection.send("AddViewColumn",e)},t.prototype.AddViewMember=function(e){return this._connection.send("AddViewMember",e)},t.prototype.ClearPermissionsCache=function(e){return this._connection.send("ClearPermissionsCache",e)},t.prototype.DeleteView=function(e){return this._connection.send("DeleteView",e)},t.prototype.DeleteViewColumn=function(e){return this._connection.send("DeleteViewColumn",e)},t.prototype.DeleteViewMember=function(e){return this._connection.send("DeleteViewMember",e)},t.prototype.DisableScopeScans=function(e){return this._connection.send("DisableScopeScans",e)},t.prototype.EnableScopeScans=function(e){return this._connection.send("EnableScopeScans",e)},t.prototype.FilePermission=function(e){return this._connection.send("FilePermission",e)},t.prototype.GroupAction=function(e){return this._connection.send("GroupAction",e)},t.prototype.GroupAdd=function(e){return this._connection.send("GroupAdd",e)},t.prototype.GroupEdit=function(e){return this._connection.send("GroupEdit",e)},t.prototype.GroupMemberEdit=function(e){return this._connection.send("GroupMemberEdit",e)},t.prototype.GroupMemberEditInput=function(e){return this._connection.send("GroupMemberEditInput",e)},t.prototype.GroupMemberQuery=function(e){return this._connection.send("GroupMemberQuery",e)},t.prototype.GroupQuery=function(e){return this._connection.send("GroupQuery",e)},t.prototype.Groups=function(e){return this._connection.send("Groups",e)},t.prototype.PermissionAction=function(e){return this._connection.send("PermissionAction",e)},t.prototype.PermissionAddInput=function(e){return this._connection.send("PermissionAddInput",e)},t.prototype.Permissions=function(e){return this._connection.send("Permissions",e)},t.prototype.PermissionsReset=function(e){return this._connection.send("PermissionsReset",e)},t.prototype.PermissionsResetInput=function(e){return this._connection.send("PermissionsResetInput",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t.prototype.QueryScopeScansEnabled=function(e){return this._connection.send("QueryScopeScansEnabled",e)},t.prototype.QueryUserViewColumns=function(e){return this._connection.send("QueryUserViewColumns",e)},t.prototype.QueryViewColumns=function(e){return this._connection.send("QueryViewColumns",e)},t.prototype.QueryViewMembers=function(e){return this._connection.send("QueryViewMembers",e)},t.prototype.QueryViews=function(e){return this._connection.send("QueryViews",e)},t.prototype.ResourceAdd=function(e){return this._connection.send("ResourceAdd",e)},t.prototype.ResourceAddInput=function(e){return this._connection.send("ResourceAddInput",e)},t.prototype.ResourceDelete=function(e){return this._connection.send("ResourceDelete",e)},t.prototype.ResourcePermissionQuery=function(e){return this._connection.send("ResourcePermissionQuery",e)},t.prototype.ResourcePermissions=function(e){return this._connection.send("ResourcePermissions",e)},t.prototype.ResourceQuery=function(e){return this._connection.send("ResourceQuery",e)},t.prototype.Resources=function(e){return this._connection.send("Resources",e)},t.prototype.UserAccountExport=function(e){return this._connection.send("UserAccountExport",e)},t.prototype.UserAction=function(e){return this._connection.send("UserAction",e)},t.prototype.UserEdit=function(e){return this._connection.send("UserEdit",e)},t.prototype.UserGroupEdit=function(e){return this._connection.send("UserGroupEdit",e)},t.prototype.UserGroupEditInput=function(e){return this._connection.send("UserGroupEditInput",e)},t.prototype.UserInfoEdit=function(e){return this._connection.send("UserInfoEdit",e)},t.prototype.UserInfoEditInput=function(e){return this._connection.send("UserInfoEditInput",e)},t.prototype.UserPosix=function(e){return this._connection.send("UserPosix",e)},t.prototype.UserPosixInput=function(e){return this._connection.send("UserPosixInput",e)},t.prototype.UserQuery=function(e){return this._connection.send("UserQuery",e)},t.prototype.UserResetPass=function(e){return this._connection.send("UserResetPass",e)},t.prototype.UserResetPassInput=function(e){return this._connection.send("UserResetPassInput",e)},t.prototype.UserSudoers=function(e){return this._connection.send("UserSudoers",e)},t.prototype.UserSudoersInput=function(e){return this._connection.send("UserSudoersInput",e)},t.prototype.Users=function(e){return this._connection.send("Users",e)},t}(z)),$=function(){function e(e){this._connection=new Y(e,"Ws_Account","1.05")}return e.prototype.connectionOptions=function(){return this._connection.opts()},e.prototype.MyAccount=function(e){return this._connection.send("MyAccount",e)},e.prototype.UpdateUser=function(e){return this._connection.send("UpdateUser",e)},e.prototype.UpdateUserInput=function(e){return this._connection.send("UpdateUserInput",e)},e.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})},e}(),K=function(){function e(e){this._connection=new Y(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}(),Z=function(e){function t(t){return e.call(this,t,"WsDfu","1.62")||this}return C(t,e),t.prototype.DFUQuery=function(e){return this._connection.send("DFUQuery",e)},t.prototype.DFUInfo=function(e){return this._connection.send("DFUInfo",e)},t.prototype.DFUFile=function(e){return this._connection.send("DFUDefFile",e,"text")},t.prototype.ListHistory=function(e){return this._connection.send("ListHistory",e)},t.prototype.EraseHistory=function(e){return this._connection.send("EraseHistory",e)},t}(z),ee=function(e){function t(t){return e.call(this,t,"WsDFUXRef","1.01")||this}return C(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}(z);function te(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:ne(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:re(t)}}default:throw new Error("Unknown field type")}}function ne(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);var t=[];for(var n in e)t.push(te(n,e[n]));return t}function re(e){var t={};for(var n in e)t[n]=te(n,e[n]);return t}var oe,ie=function(e){function t(t){return e.call(this,t,"WsEcl","0")||this}return C(t,e),t.prototype.opts=function(){return this._connection.opts()},t.prototype.requestJson=function(e,t){return this._connection.send("example/request/query/"+e+"/"+t+"/json",{},"text").then(function(e){var t=JSON.parse(e);for(var n in t)return t[n];return{}}).then(ne)},t.prototype.responseJson=function(e,t){return this._connection.send("example/response/query/"+e+"/"+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]=ne(e[n]);return t})},t.prototype.submit=function(e,t,n){var r="submit/query/"+e+"/"+t;return this._connection.send(r,n,"json2").then(function(e){if(e.Results&&e.Results.Exception)throw new G(r,n,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})},t}(z);!function(e){e[e.All=0]="All",e[e.ByJobIdID=1]="ByJobIdID",e[e.ByComponent=2]="ByComponent",e[e.ByLogType=3]="ByLogType",e[e.ByTargetAudience=4]="ByTargetAudience"}(oe||(oe={}));var ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(function(e){function t(t){return e.call(this,t,"WsLogaccess","1")||this}return C(t,e),t.prototype.GetLogAccessInfo=function(e){return this._connection.send("GetLogAccessInfo",e)},t.prototype.GetLogs=function(e){return this._connection.send("GetLogs",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t}(z));function ce(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var se,ae;1===(se=ce).length&&(ae=se,se=function(e,t){return ce(ae(e),t)});function pe(e){return null===e?NaN:+e}function fe(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 le(e,t){var n,r=e.length,o=r,i=-1,u=0;if(null==t)for(;++i<r;)isNaN(n=pe(e[i]))?--o:u+=n;else for(;++i<r;)isNaN(n=pe(t(e[i],i,e)))?--o:u+=n;if(o)return u/o}var he,de,ye=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return C(n,e),n.prototype.GetTargetClusterUsageEx=function(e){return this._connection.send("GetTargetClusterUsage",e).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),{Total:e.InUse+e.Available,PercentUsed:100-e.PercentAvailable})}):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:le(t.filter(function(e){return!isNaN(e.PercentUsed)}),function(e){return e.PercentUsed}),max:fe(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:le(t.filter(function(e){return!isNaN(e.mean)}),function(e){return e.mean}),max:fe(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:le(t.filter(function(e){return!isNaN(e.mean)}),function(e){return e.mean}),max:fe(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 C(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}(z)),ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(function(e){function t(t){return e.call(this,t,"WsResources","1.01")||this}return C(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}(z)),be=function(){function e(e){this._connection=new Y(e,"WsSMC","1.24")}return e.prototype.connectionOptions=function(){return this._connection.opts()},e.prototype.Activity=function(e){return this._connection.send("Activity",e).then(function(e){return w({Running:{ActiveWorkunit:[]}},e)})},e.prototype.BrowseResources=function(e){return this._connection.send("BrowseResources",e)},e.prototype.GetBuildInfo=function(e){return this._connection.send("GetBuildInfo",e)},e.prototype.GetStatusServerInfo=function(e){return this._connection.send("GetStatusServerInfo",e)},e.prototype.GetThorQueueAvailability=function(e){return this._connection.send("GetThorQueueAvailability",e)},e.prototype.LockQuery=function(e){return this._connection.send("LockQuery",e)},e.prototype.NotInCommunityEdition=function(e){return this._connection.send("NotInCommunityEdition",e)},e.prototype.RoxieControlCmd=function(e){return this._connection.send("RoxieControlCmd",e)},e.prototype.SetBanner=function(e){return this._connection.send("SetBanner",e)},e.prototype.SMCJob=function(e){return this._connection.send("SMCJob",e)},e}(),me=function(e){function t(t){return e.call(this,t,"WsStore","1")||this}return C(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}(z);de=e.TpLogicalClusterQuery||(e.TpLogicalClusterQuery={}),(he=de.RoxieQueueFilter||(de.RoxieQueueFilter={})).All="All",he.QueriesOnly="QueriesOnly",he.WorkunitsOnly="WorkunitsOnly";var ve,Se,Pe=function(e){function t(t){return e.call(this,t,"WsTopology","1.25")||this}return C(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.TpLogicalClusterQuery=function(e){return void 0===e&&(e={}),this._connection.send("TpLogicalClusterQuery",e)},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.prototype.TpServiceQuery=function(e){return this._connection.send("TpServiceQuery",e)},t.prototype.TpTargetClusterQuery=function(e){return this._connection.send("TpTargetClusterQuery",e)},t.prototype.TpListTargetClusters=function(e){return this._connection.send("TpListTargetClusters",e)},t}(z);function Ue(e){return"string"==typeof e.Name}!function(e){e[e.Unknown=0]="Unknown",e[e.Compiled=1]="Compiled",e[e.Running=2]="Running",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed",e[e.Archived=5]="Archived",e[e.Aborting=6]="Aborting",e[e.Aborted=7]="Aborted",e[e.Blocked=8]="Blocked",e[e.Submitted=9]="Submitted",e[e.Scheduled=10]="Scheduled",e[e.Compiling=11]="Compiling",e[e.Wait=12]="Wait",e[e.UploadingFiled=13]="UploadingFiled",e[e.DebugPaused=14]="DebugPaused",e[e.DebugRunning=15]="DebugRunning",e[e.Paused=16]="Paused",e[e.LAST=17]="LAST",e[e.NotFound=999]="NotFound"}(e.WUStateID||(e.WUStateID={})),Se=e.WUUpdate||(e.WUUpdate={}),(ve=Se.Action||(Se.Action={}))[ve.Unknown=0]="Unknown",ve[ve.Compile=1]="Compile",ve[ve.Check=2]="Check",ve[ve.Run=3]="Run",ve[ve.ExecuteExisting=4]="ExecuteExisting",ve[ve.Pause=5]="Pause",ve[ve.PauseNow=6]="PauseNow",ve[ve.Resume=7]="Resume",ve[ve.Debug=8]="Debug",ve[ve.__size=9]="__size";var Ce=function(e){function n(t){return e.call(this,t,"WsWorkunits","1.85")||this}return C(n,e),n.prototype.opts=function(){return this._connection.opts()},n.prototype.connection=function(){return this._connection.clone()},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){return void 0===e&&(e={}),this._connection.send("WUQuery",e).then(function(e){return t.deepMixin({Workunits:{ECLWorkunit:[]}},e)})},n.prototype.WUInfo=function(e){var t=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:!0,IncludeServiceNames:!0,SuppressResultSchemas:!0},e);return this._connection.send("WUInfo",t)},n.prototype.WUCreate=function(){return this._connection.send("WUCreate")},n.prototype.WUUpdate=function(e){return this._connection.send("WUUpdate",e,"json",!0)},n.prototype.WUSubmit=function(e){return this._connection.send("WUSubmit",e)},n.prototype.WUResubmit=function(e){return this._connection.toESPStringArray(e,"Wuids"),this._connection.send("WUResubmit",e)},n.prototype.WUQueryDetails=function(e){return this._connection.send("WUQueryDetails",e)},n.prototype.WUListQueries=function(e){return this._connection.send("WUListQueries",e)},n.prototype.WUPushEvent=function(e){return this._connection.send("WUPushEvent",e)},n.prototype.WUAction=function(e){return e.ActionType=e.WUActionType,this._connection.send("WUAction",e)},n.prototype.WUGetZAPInfo=function(e){return this._connection.send("WUGetZAPInfo",e)},n.prototype.WUShowScheduled=function(e){return this._connection.send("WUShowScheduled",e)},n.prototype.WUQuerySetAliasAction=function(e){return this._connection.send("WUQuerySetAliasAction",e)},n.prototype.WUQuerySetQueryAction=function(e){return this._connection.send("WUQuerySetQueryAction",e)},n.prototype.WUPublishWorkunit=function(e){return this._connection.send("WUPublishWorkunit",e)},n.prototype.WUGetGraph=function(e){return this._connection.send("WUGetGraph",e)},n.prototype.WUResult=function(e,t){return this._connection.send("WUResult",e,"json",!1,t)},n.prototype.WUQueryGetGraph=function(e){return this._connection.send("WUQueryGetGraph",e)},n.prototype.WUFile=function(e){return this._connection.send("WUFile",e,"text")},n.prototype.WUGetStats=function(e){return this._connection.send("WUGetStats",e)},n.prototype.WUQueryGetSummaryStats=function(e){return this._connection.send("WUQueryGetSummaryStats",e)},n.prototype.WUDetailsMeta=function(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=this._connection.send("WUDetailsMeta",e)),this._WUDetailsMetaPromise},n.prototype.WUDetails=function(e){return this._connection.send("WUDetails",e)},n.prototype.WUCDebug=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}(z),we=new Date,Oe=new Date;function je(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 u,c=[];if(n=o.ceil(n),i=null==i?1:Math.floor(i),!(n<r&&i>0))return c;do{c.push(u=new Date(+n)),t(n,i),e(n)}while(u<n&&n<r);return c},o.filter=function(n){return je(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 we.setTime(+t),Oe.setTime(+r),e(we),e(Oe),Math.floor(n(we,Oe))},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 _e=6e4,Te=6048e5,De=je(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*_e)/864e5},function(e){return e.getDate()-1});function Re(e){return je(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-(t.getTimezoneOffset()-e.getTimezoneOffset())*_e)/Te})}var xe=Re(0),Ae=Re(1),We=(Re(2),Re(3),Re(4)),Ne=(Re(5),Re(6),je(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()}));Ne.every=function(e){return isFinite(e=Math.floor(e))&&e>0?je(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};var Ie=je(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/864e5},function(e){return e.getUTCDate()-1});function Fe(e){return je(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)/Te})}var Ee=Fe(0),Me=Fe(1),Le=(Fe(2),Fe(3),Fe(4)),ke=(Fe(5),Fe(6),je(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 Ge(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 Ve(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 Be(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}ke.every=function(e){return isFinite(e=Math.floor(e))&&e>0?je(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};var Qe,He,Xe,qe={"-":"",_:" ",0:"0"},Ye=/^\s*\d+/,ze=/^%/,Je=/[\\^$*+?|[\]().{}]/g;function $e(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 Ke(e){return e.replace(Je,"\\$&")}function Ze(e){return new RegExp("^(?:"+e.map(Ke).join("|")+")","i")}function et(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function tt(e,t,n){var r=Ye.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function nt(e,t,n){var r=Ye.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function rt(e,t,n){var r=Ye.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ot(e,t,n){var r=Ye.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function it(e,t,n){var r=Ye.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ut(e,t,n){var r=Ye.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ct(e,t,n){var r=Ye.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function st(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 at(e,t,n){var r=Ye.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function pt(e,t,n){var r=Ye.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ft(e,t,n){var r=Ye.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function lt(e,t,n){var r=Ye.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ht(e,t,n){var r=Ye.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function dt(e,t,n){var r=Ye.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function yt(e,t,n){var r=Ye.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function gt(e,t,n){var r=Ye.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function bt(e,t,n){var r=Ye.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function mt(e,t,n){var r=ze.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function vt(e,t,n){var r=Ye.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function St(e,t,n){var r=Ye.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Pt(e,t){return $e(e.getDate(),t,2)}function Ut(e,t){return $e(e.getHours(),t,2)}function Ct(e,t){return $e(e.getHours()%12||12,t,2)}function wt(e,t){return $e(1+De.count(Ne(e),e),t,3)}function Ot(e,t){return $e(e.getMilliseconds(),t,3)}function jt(e,t){return Ot(e,t)+"000"}function _t(e,t){return $e(e.getMonth()+1,t,2)}function Tt(e,t){return $e(e.getMinutes(),t,2)}function Dt(e,t){return $e(e.getSeconds(),t,2)}function Rt(e){var t=e.getDay();return 0===t?7:t}function xt(e,t){return $e(xe.count(Ne(e)-1,e),t,2)}function At(e){var t=e.getDay();return t>=4||0===t?We(e):We.ceil(e)}function Wt(e,t){return e=At(e),$e(We.count(Ne(e),e)+(4===Ne(e).getDay()),t,2)}function Nt(e){return e.getDay()}function It(e,t){return $e(Ae.count(Ne(e)-1,e),t,2)}function Ft(e,t){return $e(e.getFullYear()%100,t,2)}function Et(e,t){return $e((e=At(e)).getFullYear()%100,t,2)}function Mt(e,t){return $e(e.getFullYear()%1e4,t,4)}function Lt(e,t){var n=e.getDay();return $e((e=n>=4||0===n?We(e):We.ceil(e)).getFullYear()%1e4,t,4)}function kt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$e(t/60|0,"0",2)+$e(t%60,"0",2)}function Gt(e,t){return $e(e.getUTCDate(),t,2)}function Vt(e,t){return $e(e.getUTCHours(),t,2)}function Bt(e,t){return $e(e.getUTCHours()%12||12,t,2)}function Qt(e,t){return $e(1+Ie.count(ke(e),e),t,3)}function Ht(e,t){return $e(e.getUTCMilliseconds(),t,3)}function Xt(e,t){return Ht(e,t)+"000"}function qt(e,t){return $e(e.getUTCMonth()+1,t,2)}function Yt(e,t){return $e(e.getUTCMinutes(),t,2)}function zt(e,t){return $e(e.getUTCSeconds(),t,2)}function Jt(e){var t=e.getUTCDay();return 0===t?7:t}function $t(e,t){return $e(Ee.count(ke(e)-1,e),t,2)}function Kt(e){var t=e.getUTCDay();return t>=4||0===t?Le(e):Le.ceil(e)}function Zt(e,t){return e=Kt(e),$e(Le.count(ke(e),e)+(4===ke(e).getUTCDay()),t,2)}function en(e){return e.getUTCDay()}function tn(e,t){return $e(Me.count(ke(e)-1,e),t,2)}function nn(e,t){return $e(e.getUTCFullYear()%100,t,2)}function rn(e,t){return $e((e=Kt(e)).getUTCFullYear()%100,t,2)}function on(e,t){return $e(e.getUTCFullYear()%1e4,t,4)}function un(e,t){var n=e.getUTCDay();return $e((e=n>=4||0===n?Le(e):Le.ceil(e)).getUTCFullYear()%1e4,t,4)}function cn(){return"+0000"}function sn(){return"%"}function an(e){return+e}function pn(e){return Math.floor(+e/1e3)}Qe=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,i=e.days,u=e.shortDays,c=e.months,s=e.shortMonths,a=Ze(o),p=et(o),f=Ze(i),l=et(i),h=Ze(u),d=et(u),y=Ze(c),g=et(c),b=Ze(s),m=et(s),v={a:function(e){return u[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return c[e.getMonth()]},c:null,d:Pt,e:Pt,f:jt,g:Et,G:Lt,H:Ut,I:Ct,j:wt,L:Ot,m:_t,M:Tt,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:an,s:pn,S:Dt,u:Rt,U:xt,V:Wt,w:Nt,W:It,x:null,X:null,y:Ft,Y:Mt,Z:kt,"%":sn},S={a:function(e){return u[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return c[e.getUTCMonth()]},c:null,d:Gt,e:Gt,f:Xt,g:rn,G:un,H:Vt,I:Bt,j:Qt,L:Ht,m:qt,M:Yt,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:an,s:pn,S:zt,u:Jt,U:$t,V:Zt,w:en,W:tn,x:null,X:null,y:nn,Y:on,Z:cn,"%":sn},P={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=f.exec(t.slice(n));return r?(e.w=l[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 w(e,t,n,r)},d:ft,e:ft,f:bt,g:ct,G:ut,H:ht,I:ht,j:lt,L:gt,m:pt,M:dt,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:at,Q:vt,s:St,S:yt,u:nt,U:rt,V:ot,w:tt,W:it,x:function(e,t,r){return w(e,n,t,r)},X:function(e,t,n){return w(e,r,t,n)},y:ct,Y:ut,Z:st,"%":mt};function U(e,t){return function(n){var r,o,i,u=[],c=-1,s=0,a=e.length;for(n instanceof Date||(n=new Date(+n));++c<a;)37===e.charCodeAt(c)&&(u.push(e.slice(s,c)),null!=(o=qe[r=e.charAt(++c)])?r=e.charAt(++c):o="e"===r?" ":"0",(i=t[r])&&(r=i(n,o)),u.push(r),s=c+1);return u.push(e.slice(s,c)),u.join("")}}function C(e,t){return function(n){var r,o,i=Be(1900,void 0,1);if(w(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=Ve(Be(i.y,0,1))).getUTCDay(),r=o>4||0===o?Me.ceil(r):Me(r),r=Ie.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(o=(r=Ge(Be(i.y,0,1))).getDay(),r=o>4||0===o?Ae.ceil(r):Ae(r),r=De.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?Ve(Be(i.y,0,1)).getUTCDay():Ge(Be(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,Ve(i)):Ge(i)}}function w(e,t,n,r){for(var o,i,u=0,c=t.length,s=n.length;u<c;){if(r>=s)return-1;if(37===(o=t.charCodeAt(u++))){if(o=t.charAt(u++),!(i=P[o in qe?t.charAt(u++):o])||(r=i(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return v.x=U(n,v),v.X=U(r,v),v.c=U(t,v),S.x=U(n,S),S.X=U(r,S),S.c=U(t,S),{format:function(e){var t=U(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=U(e+="",S);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}({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"]}),Qe.format,Qe.parse,He=Qe.utcFormat,Xe=Qe.utcParse;var fn=function(e){function t(t,n,r){var o=e.call(this)||this;o.wu=t;for(var i=0,u=0,c=r;u<c.length;u++){var s=c[u];if(s.GraphName===n.Name&&!s.HasSubGraphId){i=Math.round(1e3*s.Seconds)/1e3;break}}return o.set(w({Time:i},n)),o}return C(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 Cn(e)}):this.wu.fetchGraphDetails([this.Name],["graph"]).then(function(e){return Cn(e)})},t}(t.StateObject),ln=function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.Name])})||this}return C(n,e),n}(t.Cache);function hn(e){var t={};return e.forEach(function(e){"att"===e.name&&(t[e.$.name]=e.$.value)}),t}var dn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(t.Graph),yn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(t.Subgraph),gn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(t.Vertex),bn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(t.Edge);function mn(e,t){var n={},r={},o={},i=new dn(function(e){return e._.id}),u=[i.root];return function e(t,n,r){(r=r||[]).push(t),n(t.name,t.$,t.children(),r),t.children().forEach(function(t){e(t,n,r)}),r.pop()}(t,function(e,t,i,c){var s=u[u.length-1];switch(e){case"graph":break;case"node":if(i.length&&i[0].children().length&&"graph"===i[0].children()[0].name){var a=s.createSubgraph(hn(i));u.push(a),n[t.id]=a}var p=s.createVertex(hn(i));r[t.id]=p;break;case"edge":var f=s.createEdge(r[t.source],r[t.target],hn(i));o[t.id]=f}}),i}var vn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(t.Graph),Sn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(t.Subgraph),Pn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(t.Vertex),Un=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(t.Edge);function Cn(e){for(var t,n={},r={},o={},i=0,u=e;i<u.length;i++){switch((l=u[i]).ScopeType){case"graph":t=new vn(function(e){return e._.Id},l),n[l.ScopeName]=t.root;break;case"subgraph":t||(t=new vn(function(e){return e._.Id},l),n[l.ScopeName]=t.root);for(var c=l.parentScope().split(":"),s=n[l.parentScope()];c.length&&!s;)s=n[c.join(":")],c.pop();if(s){var a=s;n[l.ScopeName]=a.createSubgraph(l)}else console.log("Missing SG:Parent ("+l.Id+"): "+l.parentScope());break;case"activity":var p=n[l.parentScope()];p?o[l.ScopeName]=p.createVertex(l):console.log("Missing A:Parent ("+l.Id+"): "+l.parentScope());break;case"edge":r[l.ScopeName]=l;break;case"function":(h=o[l.parentScope()])?h._.children().push(l):console.log("Missing F:Parent ("+l.Id+"): "+l.parentScope())}}for(var f in r){var l,h;if(h=n[(l=r[f]).parentScope()]){var d=h;try{var y=t.vertex(l.attr("IdSource").RawValue),g=t.vertex(l.attr("IdTarget").RawValue);d.createEdge(y,g,l)}catch(e){console.log("Invalid Edge: "+f)}}else console.log("Missing E:Parent ("+l.Id+"): "+l.parentScope())}return t}var wn=function(e){function t(t,n){var r=e.call(this)||this;r.wu=t;var o=n.split("\\").join("/"),i=o.split("/"),u="res/"+r.wu.Wuid+"/",c="",s="";return 0===o.indexOf(u)&&(c=o.substr(u.length),s=i[i.length-1]),r.set({URL:n,DisplayName:s,DisplayPath:c}),r}return C(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),On=function(){function e(e){this.e=e}return e.prototype.fix=function(){delete this.e},e}(),jn=function(e){function t(t){var n=e.call(this,t)||this;return n.isSet=!1,n.attrs={},n._children=[],n}return C(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}(On),_n=function(e){function t(t){return e.call(this,t)||this}return C(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}(On),Tn=function(){function e(){this.simpleTypes={}}return e.prototype.fields=function(){return this.root.children()},e}(),Dn=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.schema=new Tn,n.simpleTypes={},n.xsdStack=new t.Stack,n}return C(n,e),n.prototype.startXMLNode=function(t){switch(e.prototype.startXMLNode.call(this,t),t.name){case"xs:element":var n=new jn(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 _n(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 Rn(e){var t=new Dn;return t.parse(e),t.schema}var xn=function(e){function n(n){var r=e.call(this)||this;return r.schema=new Tn,r.simpleTypes={},r.xsdStack=new t.Stack,r._rootName=n,r}return C(n,e),n.prototype.startXMLNode=function(t){switch(e.prototype.startXMLNode.call(this,t),t.name){case"xsd:element":var n=new jn(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 _n(t)}},n.prototype.endXMLNode=function(t){switch(t.name){case"xsd:element":this.xsdStack.pop().fix()}e.prototype.endXMLNode.call(this,t)},n}(Dn);var An,Wn=function(e){function t(){return e.call(this,function(e){return e.BaseUrl+"-"+e.Wuid+"-"+e.ResultName})||this}return C(t,e),t}(t.Cache),Nn=new Wn,In=function(e){function n(t,n,r,o){var i=e.call(this)||this;return i.connection=t instanceof Ce?t:new Ce(t),"boolean"==typeof o&&!0===o?i.set({NodeGroup:n,LogicalFileName:r}):Ue(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 C(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=Nn.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=Nn.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+r},function(){return new n(e,t,r)}):"string"==typeof r&&(i=Nn.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r},function(){return new n(e,t,r)}))),i},n.attachLogicalFile=function(e,t,r){return Nn.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(){var e=this;return this.xsdSchema?Promise.resolve(this.xsdSchema):this.WUResult().then(function(n){return t.exists("Result.XmlSchema.xml",n)?(e.xsdSchema=Rn(n.Result.XmlSchema.xml),e.xsdSchema):null})},n.prototype.refresh=function(){return O(this,void 0,void 0,function(){return j(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 u=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,u.set(w({},e)),t.exists("XmlSchema.xml",n)&&(u.xsdSchema=Rn(n.XmlSchema.xml)),t.exists("Row",n)?n.Row:u.ResultName&&t.exists(u.ResultName,n)?n[u.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 u in r)i.NamedValue[i.NamedValue.itemcount++]={Name:u,Value:r[u]};var c={FilterBy:i};return this.Wuid&&void 0!==this.ResultName?(c.Wuid=this.Wuid,c.ResultName=this.ResultName):this.Wuid&&void 0!==this.ResultSequence?(c.Wuid=this.Wuid,c.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(c.LogicalName=this.LogicalFileName,c.Cluster=this.NodeGroup):this.LogicalFileName&&(c.LogicalName=this.LogicalFileName),c.Start=e,c.Count=t,c.SuppressXmlSchema=n,this.connection.WUResult(c,o).then(function(e){return e})},n}(t.StateObject),Fn=function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName])})||this}return C(n,e),n}(t.Cache),En=function(e){function t(t,n){var r=e.call(this)||this;return r.scope=t,r.set(n),r}return C(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),Mn=function(e){function t(t){var n=e.call(this)||this;return n._attributeMap={},n._children=[],n.update(t),n}return C(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,"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 En(e,r))}),n.start&&n.end?(n.start.FormattedEnd=n.end.Formatted,t.push(new En(this,n.start))):n.start?t.push(new En(this,n.start)):n.end&&t.push(new En(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 En(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">'+this.Id+"</td></tr>"),e&&n.push('<tr><td class="key">Parent ID:</td><td class="value">'+e.Id+"</td></tr>"),n.push('<tr><td class="key">Scope:</td><td class="value">'+this.ScopeName+"</td></tr>");var r=this.formattedAttrs();for(var o in r)"Label"===o?t=r[o]:n.push('<tr><td class="key">'+o+'</td><td class="value">'+r[o]+"</td></tr>");return'<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">\n <h4 align="center">'+t+"</h4>\n <table>\n "+n.join("")+"\n </table>\n </div>"},t}(t.StateObject),Ln=function(e){function t(t,n){var r=e.call(this,n)||this;return r.wu=t,r}return C(t,e),t}(Mn),kn=function(e){function t(t,n,r){var o=e.call(this)||this;return o.connection=t instanceof Ce?t:new Ce(t),o.set(w({Wuid:n},r)),o}return C(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),Gn=function(e){function n(n,r,o){var i=e.call(this)||this;i.connection=n instanceof Ce?n:new Ce(n);var u=t.espTime2Seconds(o.Value);return i.set(w({Wuid:r,Seconds:Math.round(1e3*u)/1e3,HasSubGraphId:void 0!==o.SubGraphId},o)),i}return C(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}),n}(t.StateObject),Vn=He("%Y-%m-%dT%H:%M:%S.%LZ"),Bn=Xe("%Y-%m-%dT%H:%M:%S.%LZ"),Qn=t.scopedLogger("workunit.ts"),Hn=e.WUStateID,Xn=function(e){function t(){return e.call(this,function(e){return e.BaseUrl+"-"+e.Wuid})||this}return C(t,e),t}(t.Cache),qn=new Xn,Yn=function(n){function r(e,t){var r=n.call(this)||this;return r._debugMode=!1,r._resultCache=new Fn,r._graphCache=new ln,r.connection=new Ce(e),r.topologyConnection=new Pe(e),r.clearState(t),r}return C(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 In.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 Gn(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 fn(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 wn(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,"HaveSubGraphTimings",{get:function(){return this.get("HaveSubGraphTimings")},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 kn(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,"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}),r.create=function(e){var t=new r(e);return t.connection.WUCreate().then(function(e){return qn.set(t),t.set(e.Workunit),t})},r.attach=function(e,t,n){var o=qn.get({BaseUrl:e.baseUrl,Wuid:t},function(){return new r(e,t)});return n&&o.set(n),o},r.existsLocal=function(e,t){return qn.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 Ce(e).WUQuery(t).then(function(t){return t.Workunits.ECLWorkunit.map(function(t){return r.attach(e,t.Wuid,t)})})},r.prototype.clearState=function(e){this.clear({Wuid:e,StateID:Hn.Unknown})},r.prototype.update=function(e){var t=this;return this.connection.WUUpdate(w(w({},e),{Wuid:this.Wuid,StateOrig:this.State,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 Hn.Compiled:return"compile"===this.ActionEx||this._submitAction===e.WUUpdate.Action.Compile;case Hn.Completed:case Hn.Failed:case Hn.Aborted:case Hn.NotFound:return!0}return!1},r.prototype.isFailed=function(){switch(this.StateID){case Hn.Aborted:case Hn.Failed:return!0}return!1},r.prototype.isDeleted=function(){switch(this.StateID){case Hn.NotFound:return!0}return!1},r.prototype.isDebugging=function(){switch(this.StateID){case Hn.DebugPaused:case Hn.DebugRunning:return!0}return this._debugMode},r.prototype.isRunning=function(){switch(this.StateID){case Hn.Compiled:case Hn.Running:case Hn.Aborting:case Hn.Blocked:case Hn.DebugPaused:case Hn.DebugRunning:return!0}return!1},r.prototype.setToFailed=function(){return this.WUAction("SetToFailed")},r.prototype.pause=function(){return this.WUAction("Pause")},r.prototype.pauseNow=function(){return this.WUAction("PauseNow")},r.prototype.resume=function(){return this.WUAction("Resume")},r.prototype.abort=function(){return this.WUAction("Abort")},r.prototype.delete=function(){return this.WUAction("Delete")},r.prototype.restore=function(){return this.WUAction("Restore")},r.prototype.deschedule=function(){return this.WUAction("Deschedule")},r.prototype.reschedule=function(){return this.WUAction("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 O(this,void 0,void 0,function(){return j(this,function(e){switch(e.label){case 0:return[4,this.WUQuery()];case 1:return e.sent(),[2,this]}})})},r.prototype.refreshInfo=function(){return O(this,void 0,void 0,function(){return j(this,function(e){switch(e.label){case 0:return[4,this.WUInfo()];case 1:return e.sent(),[2,this]}})})},r.prototype.refreshDebug=function(){return O(this,void 0,void 0,function(){return j(this,function(e){switch(e.label){case 0:return[4,this.debugStatus()];case 1:return e.sent(),[2,this]}})})},r.prototype.refresh=function(e){return void 0===e&&(e=!1),O(this,void 0,void 0,function(){return j(this,function(t){switch(t.label){case 0:return e?[4,Promise.all([this.refreshInfo(),this.refreshDebug()])]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.refreshState()];case 3:t.sent(),t.label=4;case 4:return[2,this]}})})},r.prototype.eclExceptions=function(){return this.Exceptions.ECLException},r.prototype.fetchArchive=function(){return this.connection.WUFile({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.fetchDetailsNormalized=function(e){return void 0===e&&(e={}),Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(function(e){for(var t,n=e[0],r={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},o=[],i=0,u=e[1];i<u.length;i++){var c=u[i],s={},a={};if(c&&c.Id&&c.Properties&&c.Properties.Property){for(var p in c.Properties.Property){var f=c.Properties.Property[p];switch("ns"===f.Measure&&(f.Measure="s"),r[f.Name]=w({},f),delete r[f.Name].RawValue,delete r[f.Name].Formatted,f.Measure){case"bool":s[f.Name]=!!+f.RawValue;break;case"sz":s[f.Name]=+f.RawValue;break;case"s":s[f.Name]=+f.RawValue/1e9;break;case"ns":s[f.Name]=+f.RawValue;break;case"ts":s[f.Name]=new Date(+f.RawValue/1e3).toISOString();break;case"cnt":s[f.Name]=+f.RawValue;break;case"cost":s[f.Name]=+f.RawValue/1e6;break;case"cpu":case"skw":case"node":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:s[f.Name]=f.RawValue}a[f.Name]=null!==(t=f.Formatted)&&void 0!==t?t:s[f.Name]}o.push(w({id:c.Id,name:c.ScopeName,type:c.ScopeType,__formattedProps:a},s))}}return{meta:n,columns:r,data:o}})},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 Ln(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 Ln(t,e);return r[n.ScopeName]=n,n}),r)if(r.hasOwnProperty(o)){var i=r[o],u=i.parentScope();u&&r[u]?r[u].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 Cn(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=Bn(o.start);i.setMilliseconds(i.getMilliseconds()+o.elapsed/1e6),o.finish=Vn(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._monitorTimeoutDuraction=function(){var e=n.prototype._monitorTimeoutDuraction.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 switch(e){case"changed":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(e){var t=this;return void 0===e&&(e={}),this.connection.WUQuery(w(w({},e),{Wuid:this.Wuid})).then(function(e){return t.set(e.Workunits.ECLWorkunit[0]),e}).catch(function(e){if(!e.Exception.some(function(e){return 20081===e.Code&&(t.clearState(t.Wuid),t.set("StateID",Hn.NotFound),!0)}))throw Qn.warning("Unexpected exception: "),e;return{}})},r.prototype.WUCreate=function(){var e=this;return this.connection.WUCreate().then(function(t){return e.set(t.Workunit),qn.set(e),t})},r.prototype.WUInfo=function(e){var t=this;void 0===e&&(e={});var n=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo(w(w({},e),{Wuid:this.Wuid,IncludeResults:n,IncludeResultsViewNames:n,SuppressResultSchemas:!1})).then(function(e){return t.set(e.Workunit),n&&t.set({ResultViews:e.ResultViews}),e}).catch(function(e){if(!e.Exception.some(function(e){return 20080===e.Code&&(t.clearState(t.Wuid),t.set("StateID",Hn.NotFound),!0)}))throw Qn.warning("Unexpected exception: "),e;return{}})},r.prototype.WUResubmit=function(e){return this.connection.WUResubmit(t.deepMixinT({},e,{Wuids:[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:[this.Wuid],WUActionType:e}).then(function(e){return t.refresh().then(function(){return t._monitor(),e})})},r.prototype.publish=function(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:!0,Wait:5e3})},r.prototype.WUCDebug=function(e,t){void 0===t&&(t={});var n="";for(var r in t)t.hasOwnProperty(r)&&(n+=" "+r+"='"+t[r]+"'");return this.connection.WUCDebug({Wuid:this.Wuid,Command:"<debug:"+e+" uid='"+this.Wuid+"'"+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 Qn.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=mn(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(Jn(i)){var u=$n(i);(u&&!t||t===u.file)&&n.push(u)}}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),zn="definition";function Jn(e){return void 0!==e._[zn]}function $n(e){var t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[zn]);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: "+e._[zn])}var Kn=function(e){function n(n){var r=e.call(this)||this;return r.lazyRefresh=t.debounce(function(){return O(r,void 0,void 0,function(){var e;return j(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 be?n:new be(n),r.clear({}),r}return C(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 An||(An=new n(e)),t&&An.set(w({},t)),An},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 Yn.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 O(this,void 0,void 0,function(){return j(this,function(e){return[2,this.lazyRefresh()]})})},n}(t.StateObject),Zn=function(e){function t(){return e.call(this,function(e){return e.BaseUrl+"-"+e.Cluster+"-"+e.Name})||this}return C(t,e),t}(t.Cache),er=new Zn,tr=function(e){function t(t,n,r){var o=e.call(this)||this;return o.connection=t instanceof Z?t:new Z(t),o.clear({Cluster:n,Name:r}),o}return C(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,"Cost",{get:function(){return this.get("Cost")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){return er.get({BaseUrl:e.baseUrl,Cluster:n,Name:r},function(){return new t(e,n,r)})},t.prototype.filePartsOnCluster=function(){var e;return function(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||t)}([],(null===(e=this.DFUFilePartsOnClusters)||void 0===e?void 0:e.DFUFilePartsOnCluster)||[])},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],u=0,c=(null===(t=null==i?void 0:i.DFUFileParts)||void 0===t?void 0:t.DFUPart)||[];u<c.length;u++){var s=c[u],a=w(w({},i),s);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){return e.set(w({Cluster:e.Cluster},t.FileDetail)),t.FileDetail})},t.prototype.fetchDefFile=function(e){return this.connection.DFUFile({Name:this.Name,Format:e})},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),nr=function(e){function t(){return e.call(this,function(e){return e.Address})||this}return C(t,e),t}(t.Cache),rr=new nr,or=function(e){function t(t){var n=e.call(this)||this;return n.connection=t instanceof ye?t:new ye(t),n}return C(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=rr.get({Address:n},function(){return new t(e)});return r&&o.set(r),o},t}(t.StateObject),ir=new(function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.QueryId,e.QuerySet])})||this}return C(n,e),n}(t.Cache)),ur=function(e){function t(t,n,r,o){var i=e.call(this)||this;return i.connection=t instanceof ie?t:new ie(t),i._wsWorkunits=new Ce(t),i.set(w({QuerySet:n,QueryId:r},o)),i}return C(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.connection.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}),t.attach=function(e,n,r){return ir.get({BaseUrl:e.baseUrl,QuerySet:n,QueryId:r},function(){return new t(e,n,r)})},t.prototype.fetchRequestSchema=function(){return O(this,void 0,void 0,function(){var e;return j(this,function(t){switch(t.label){case 0:return e=this,[4,this.connection.requestJson(this.QuerySet,this.QueryId)];case 1:return e._requestSchema=t.sent(),[2]}})})},t.prototype.fetchResponseSchema=function(){return O(this,void 0,void 0,function(){var e;return j(this,function(t){switch(t.label){case 0:return e=this,[4,this.connection.responseJson(this.QuerySet,this.QueryId)];case 1:return e._responseSchema=t.sent(),[2]}})})},t.prototype.fetchSchema=function(){return O(this,void 0,void 0,function(){return j(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._wsWorkunits.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})},t.prototype.submit=function(e){return this.connection.submit(this.QuerySet,this.QueryId,e).then(function(e){for(var t in e)e[t]=e[t].Row;return e})},t.prototype.refresh=function(){return O(this,void 0,void 0,function(){var e=this;return j(this,function(t){return[2,this.fetchSchema().then(function(t){return e})]})})},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),cr=function(e){function t(){return e.call(this,function(e){return e.BaseUrl+"-"+e.Name+":"+e.UserSpecific+"-"+e.Namespace})||this}return C(t,e),t}(t.Cache),sr=new cr,ar=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 C(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),pr=function(){function e(e,n,r,o){this._dispatch=new t.Dispatch,this._knownValues={},this.connection=e instanceof me?e:new me(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),sr.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 ar(e,t,i))}).catch(function(n){console.error('Store.set("'+e+'", "'+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 ar(e,r.Value,o)),r.Value}).catch(function(t){console.error("Store.get("+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 ar(n.Key,n.Value,i))}),e)for(var i in o)t._dispatch.post(new ar(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 ar(e,void 0,o))}).catch(function(t){console.error("Store.delete("+e+") failed:",t)})},e.prototype.monitor=function(e){return this._dispatch.attach(e)},e}(),fr=function(e){function t(){return e.call(this,function(e){return e.BaseUrl+"-"+e.Name})||this}return C(t,e),t}(t.Cache),lr=new fr,hr=function(e){function t(t,n){var r=e.call(this)||this;return t instanceof Pe?(r.connection=t,r.machineConnection=new ye(t.connectionOptions())):(r.connection=new Pe(t),r.machineConnection=new ye(t)),r.clear({Name:n}),r}return C(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 or.attach(e.machineConnection,t.Address,t)})},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){var o=lr.get({BaseUrl:e.baseUrl,Name:n},function(){return new t(e,n)});return r&&o.set(w({},r)),o},t.prototype.fetchMachines=function(e){var t=this;return void 0===e&&(e={}),this.machineConnection.GetTargetClusterInfo(w({TargetClusters:{Item:[this.Type+":"+this.Name]}},e)).then(function(e){for(var n=[],r=0,o=e.TargetClusterInfoList.TargetClusterInfo;r<o.length;r++)for(var i=0,u=o[r].Processes.MachineInfoEx;i<u.length;i++){var c=u[i];n.push(c)}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,u=o[r].Storage.StorageInfo;i<u.length;i++){var c=u[i];t+=c.Available,n+=c.Total;var s=1-c.Available/c.Total;s>e&&(e=s)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}},t.prototype.fetchUsage=function(){return this.machineConnection.GetTargetClusterUsageEx({TargetClusters:{Item:[this.Name]}})},t}(t.StateObject);var dr={};var yr=function(e){function t(){return e.call(this,function(e){return e.BaseUrl})||this}return C(t,e),t}(t.Cache),gr=new yr,br=function(e){function n(t){var n=e.call(this)||this;return n.connection=t instanceof Pe?t:new Pe(t),n}return C(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 hr.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){return gr.get({BaseUrl:e.baseUrl},function(){return new n(e)})},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(),u="https:"===o?"18002":"8002";if(t.exists("ServiceList.TpEspServers.TpEspServer",r))for(var c=0,s=r.ServiceList.TpEspServers.TpEspServer;c<s.length;c++){var a=s[c];if(t.exists("TpBindings.TpBinding",a))for(var p=0,f=a.TpBindings.TpBinding;p<f.length;p++){var l=f[p];l.Service===e&&l.Protocol+":"===o&&(u=l.Port)}}return o+"//"+i+":"+u+"/"})},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))switch(t){case"changed":e.prototype.on.call(this,t,n)}else switch(t){case"changed":e.prototype.on.call(this,t,n,r)}return this._monitor(),this},n}(t.StateObject);e.AccessServiceEx=J,e.AccountService=$,e.Activity=Kn,e.Attribute=En,e.BUILD_VERSION="2.101.2",e.BaseScope=Mn,e.CodesignService=K,e.Connection=L,e.DFUService=Z,e.DFUXRefService=ee,e.ECLGraph=fn,e.ESPConnection=Y,e.ESPExceptions=G,e.EclService=ie,e.GlobalResultCache=Wn,e.GraphCache=ln,e.LogaccessServiceEx=ue,e.LogicalFile=tr,e.LogicalFileCache=Zn,e.Machine=or,e.MachineCache=nr,e.MachineServiceEx=ye,e.PKG_NAME="@hpcc-js/comms",e.PKG_VERSION="2.72.0",e.Query=ur,e.Resource=wn,e.ResourcesServiceEx=ge,e.Result=In,e.ResultCache=Fn,e.SMCService=be,e.Scope=Ln,e.ScopeEdge=Un,e.ScopeGraph=vn,e.ScopeSubgraph=Sn,e.ScopeVertex=Pn,e.Service=z,e.SourceFile=kn,e.Store=pr,e.StoreCache=cr,e.StoreService=me,e.TargetCluster=hr,e.TargetClusterCache=fr,e.Timer=Gn,e.Topology=br,e.TopologyCache=yr,e.TopologyService=Pe,e.ValueChangedMessage=ar,e.Workunit=Yn,e.WorkunitCache=Xn,e.WorkunitsService=Ce,e.XGMMLEdge=bn,e.XGMMLGraph=dn,e.XGMMLSubgraph=yn,e.XGMMLVertex=gn,e.XSDNode=On,e.XSDSchema=Tn,e.XSDSimpleType=_n,e.XSDXMLNode=jn,e.createGraph=Cn,e.createXGMMLGraph=mn,e.defaultTargetCluster=function(e){if(!dr[e.baseUrl]){var t=void 0;t=e instanceof Pe?e:new Pe(e),dr[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 hr.attach(e,i.Name,i)})}return dr[e.baseUrl]},e.deserializeResponse=x,e.get=F,e.hookSend=function(e){var t=M;return e&&(M=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=k,e.isECLResult=Ue,e.isExceptions=function(e){return e instanceof G||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=A,e.parseXSD=Rn,e.parseXSD2=function(e,t){var n=new xn(t);return n.parse(e),n.schema},e.post=I,e.send=E,e.serializeRequest=R,e.setTransportFactory=function(t){var n=e.createConnection;return e.createConnection=t,n},e.targetClusters=function(e){return(e instanceof Pe?e:new Pe(e)).TpListTargetClusters({}).then(function(t){return t.TargetClusters.TpClusterNameType.map(function(t){return hr.attach(e,t.Name,t)})})},Object.defineProperty(e,"__esModule",{value:!0})});
|
|
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||void 0!==n&&n,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}}(),u="FormData"in n,c="ArrayBuffer"in n;if(c)var s=["[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&&s.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 f(e){return"string"!=typeof e&&(e=String(e)),e}function l(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){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.bodyUsed)return Promise.reject(new TypeError("Already read"));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:u&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():c&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):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))}return this.blob().then(g)}),this.text=function(){var e,t,n,r=d(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=y(t),t.readAsText(e),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)},u&&(this.formData=function(){return this.text().then(P)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=p(e),t=f(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)]=f(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)})),l(e)},h.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),l(e)},h.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),l(e)},o&&(h.prototype[Symbol.iterator]=h.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];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 n,r,o=(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,o||null==e._bodyInit||(o=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=(n=t.method||this.method||"GET",r=n.toUpperCase(),v.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function P(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 U(e,t){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,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(U.prototype),U.prototype.clone=function(){return new U(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},U.error=function(){var e=new U(null,{status:0,statusText:""});return e.type="error",e};var C=[301,302,303,307,308];U.redirect=function(e,t){if(-1===C.indexOf(t))throw new RangeError("Invalid status code");return new U(null,{status:t,headers:{location:e}})};var w=n.DOMException;try{new w}catch(e){(w=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),w.prototype.constructor=w}function O(e,t){return new Promise((function(r,o){var u=new S(e,t);if(u.signal&&u.signal.aborted)return o(new w("Aborted","AbortError"));var s=new XMLHttpRequest;function a(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.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();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;setTimeout((function(){r(new U(o,n))}),0)},s.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},s.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},s.onabort=function(){setTimeout((function(){o(new w("Aborted","AbortError"))}),0)},s.open(u.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(u.url),!0),"include"===u.credentials?s.withCredentials=!0:"omit"===u.credentials&&(s.withCredentials=!1),"responseType"in s&&(i?s.responseType="blob":c&&u.headers.get("Content-Type")&&-1!==u.headers.get("Content-Type").indexOf("application/octet-stream")&&(s.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof h?u.headers.forEach((function(e,t){s.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){s.setRequestHeader(e,f(t.headers[e]))})),u.signal&&(u.signal.addEventListener("abort",a),s.onreadystatechange=function(){4===s.readyState&&u.signal.removeEventListener("abort",a)}),s.send(void 0===u._bodyInit?null:u._bodyInit)}))}O.polyfill=!0,n.fetch||(n.fetch=O,n.Headers=h,n.Request=S,n.Response=U);var j=function(e,t){return j=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])},j(e,t)};function _(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}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var T=function(){return T=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},T.apply(this,arguments)};function D(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,c)}s((r=r.apply(e,t||[])).next())}))}function R(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var x=t.scopedLogger("comms/connection.ts");var A={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function W(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function I(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=""),n&&(n+="."),"object"!=typeof e)return W(e,t);var r=[],o=function(o){if(e.hasOwnProperty(o))if(e[o]instanceof Array){var i=!1;e[o].forEach((function(e,u){"object"==typeof e?(i=!0,r.push(I(e,t,n+W("".concat(o,".").concat(u),t)))):r.push(n+W("".concat(o,"_i").concat(u),t)+"="+I(e,t))})),i&&r.push(n+W("".concat(o,".itemcount"),t)+"="+e[o].length)}else"object"==typeof e[o]?e[o]&&e[o].Item instanceof Array?(r.push(I(e[o].Item,t,n+W(o,t))),r.push(n+W("".concat(o,".itemcount"),t)+"="+e[o].Item.length)):r.push(I(e[o],t,n+W(o,t))):void 0!==e[o]?r.push(n+W(o,t)+"="+W(e[o],t)):r.push(n+W(o,t))};for(var i in e)o(i);return r.join("&")}function N(e){return JSON.parse(e)}function F(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,u){var c=1e3*e.timeoutSecs,s="jsonp_callback_"+Math.round(999999*Math.random());window[s]=function(e){c=0,l(),i("json"===o&&"string"==typeof e?N(e):e)};var a=document.createElement("script"),p=t.join(e.baseUrl,n);p+=p.indexOf("?")>=0?"&":"?",a.src=p+"jsonp="+s+"&"+I(r,e.encodeRequest),document.body.appendChild(a);var f=setInterval((function(){c<=0?clearInterval(f):(c-=5e3)<=0?(clearInterval(f),x.error("Request timeout: "+a.src),l(),u(Error("Request timeout: "+a.src))):x.debug("Request pending ("+c/1e3+" sec): "+a.src)}),5e3);function l(){delete window[s],document.body.removeChild(a)}}))}var E={};function M(e,n,r,o,i){function u(e){if(e.ok)return"json"===i?e.json():e.text();throw new Error(e.statusText)}return o=T(T({},function(e){return e.userID?{Authorization:"Basic ".concat(btoa("".concat(e.userID,":").concat(e.password)))}:{}}(e)),o),r=T(T({credentials:E[e.baseUrl]?"omit":"include"},r),{headers:o}),0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&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(u).catch((function(o){return r.credentials=E[e.baseUrl]?"include":"omit",fetch(t.join(e.baseUrl,n),r).then(u).then((function(t){return E[e.baseUrl]=!E[e.baseUrl],t}))})))}function L(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:I(n,e.encodeRequest),signal:i},T({"Content-Type":"application/x-www-form-urlencoded"},o),r)}function k(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(I(n,e.encodeRequest)),{method:"get",signal:i},T({},o),r)}function G(e,t,n,r,o){var i;switch(void 0===r&&(r="json"),e.type){case"jsonp":i=F(e,t,n,r,o);break;case"get":i=k(e,t,n,r,o);break;default:i=L(e,t,n,r,o)}return i}var V=G;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=T(T({},A),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,V,r):V(this._opts,e,t,n,r)},e.prototype.clone=function(){return new e(this.opts())},e}();function Q(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 _(t,e),t}(Error);var X,q,Y,z,J,$,K=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(Q(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,u){void 0===n&&(n={}),void 0===r&&(r="json"),void 0===o&&(o=!1);var c,s=T(T({},n),{ver_:this._version});o&&(s.upload_=!0),i&&(s.abortSignal_=i);var a="json";switch(r){case"text":c=t.join(this._service,e),a="text";break;case"xsd":c=t.join(this._service,e+".xsd"),a="text";break;case"json2":c=t.join(this._service,e+"/json"),r="json";var p=e.split("/");e=p.pop();break;default:c=t.join(this._service,e+".json")}return this._connection.send(c,s,a).then((function(t){if("json"===r){var n=void 0;if(t&&t.Exceptions)throw new H(e,s,t.Exceptions);if(t&&(n=t[u||e+"Response"]),!n)throw new H(e,s,{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,s,{Source:"ESPConnection.send",Exception:[{Code:0,Message:t.message}]})}))},n.prototype.clone=function(){return new n(this._connection.clone(),this._service,this._version)},n}(),Z=function(){function e(e,t,n){this._connection=new K(e,t,n)}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._connection.opts().baseUrl},enumerable:!1,configurable:!0}),e}();!function(e){e.User="User",e.Group="Group"}(X||(X={})),function(e){e.Username="Username",e.Fullname="Fullname",e.Passwordexpiration="Passwordexpiration",e.EmployeeID="EmployeeID",e.EmployeeNumber="EmployeeNumber"}(q||(q={})),function(e){e.Name="Name",e.ManagedBy="ManagedBy"}(Y||(Y={})),function(e){e.Any="Any",e.User="User",e.Group="Group"}(z||(z={})),function(e){e.Name="Name",e.Type="Type"}(J||(J={})),function(e){e.Name="Name"}($||($={}));var ee=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(function(e){function t(t){return e.call(this,t,"ws_access","1.16")||this}return _(t,e),t.prototype.AccountPermissions=function(e){return this._connection.send("AccountPermissions",e)},t.prototype.AddUser=function(e){return this._connection.send("AddUser",e)},t.prototype.AddView=function(e){return this._connection.send("AddView",e)},t.prototype.AddViewColumn=function(e){return this._connection.send("AddViewColumn",e)},t.prototype.AddViewMember=function(e){return this._connection.send("AddViewMember",e)},t.prototype.ClearPermissionsCache=function(e){return this._connection.send("ClearPermissionsCache",e)},t.prototype.DeleteView=function(e){return this._connection.send("DeleteView",e)},t.prototype.DeleteViewColumn=function(e){return this._connection.send("DeleteViewColumn",e)},t.prototype.DeleteViewMember=function(e){return this._connection.send("DeleteViewMember",e)},t.prototype.DisableScopeScans=function(e){return this._connection.send("DisableScopeScans",e)},t.prototype.EnableScopeScans=function(e){return this._connection.send("EnableScopeScans",e)},t.prototype.FilePermission=function(e){return this._connection.send("FilePermission",e)},t.prototype.GroupAction=function(e){return this._connection.send("GroupAction",e)},t.prototype.GroupAdd=function(e){return this._connection.send("GroupAdd",e)},t.prototype.GroupEdit=function(e){return this._connection.send("GroupEdit",e)},t.prototype.GroupMemberEdit=function(e){return this._connection.send("GroupMemberEdit",e)},t.prototype.GroupMemberEditInput=function(e){return this._connection.send("GroupMemberEditInput",e)},t.prototype.GroupMemberQuery=function(e){return this._connection.send("GroupMemberQuery",e)},t.prototype.GroupQuery=function(e){return this._connection.send("GroupQuery",e)},t.prototype.Groups=function(e){return this._connection.send("Groups",e)},t.prototype.PermissionAction=function(e){return this._connection.send("PermissionAction",e)},t.prototype.PermissionAddInput=function(e){return this._connection.send("PermissionAddInput",e)},t.prototype.Permissions=function(e){return this._connection.send("Permissions",e)},t.prototype.PermissionsReset=function(e){return this._connection.send("PermissionsReset",e)},t.prototype.PermissionsResetInput=function(e){return this._connection.send("PermissionsResetInput",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t.prototype.QueryScopeScansEnabled=function(e){return this._connection.send("QueryScopeScansEnabled",e)},t.prototype.QueryUserViewColumns=function(e){return this._connection.send("QueryUserViewColumns",e)},t.prototype.QueryViewColumns=function(e){return this._connection.send("QueryViewColumns",e)},t.prototype.QueryViewMembers=function(e){return this._connection.send("QueryViewMembers",e)},t.prototype.QueryViews=function(e){return this._connection.send("QueryViews",e)},t.prototype.ResourceAdd=function(e){return this._connection.send("ResourceAdd",e)},t.prototype.ResourceAddInput=function(e){return this._connection.send("ResourceAddInput",e)},t.prototype.ResourceDelete=function(e){return this._connection.send("ResourceDelete",e)},t.prototype.ResourcePermissionQuery=function(e){return this._connection.send("ResourcePermissionQuery",e)},t.prototype.ResourcePermissions=function(e){return this._connection.send("ResourcePermissions",e)},t.prototype.ResourceQuery=function(e){return this._connection.send("ResourceQuery",e)},t.prototype.Resources=function(e){return this._connection.send("Resources",e)},t.prototype.UserAccountExport=function(e){return this._connection.send("UserAccountExport",e)},t.prototype.UserAction=function(e){return this._connection.send("UserAction",e)},t.prototype.UserEdit=function(e){return this._connection.send("UserEdit",e)},t.prototype.UserGroupEdit=function(e){return this._connection.send("UserGroupEdit",e)},t.prototype.UserGroupEditInput=function(e){return this._connection.send("UserGroupEditInput",e)},t.prototype.UserInfoEdit=function(e){return this._connection.send("UserInfoEdit",e)},t.prototype.UserInfoEditInput=function(e){return this._connection.send("UserInfoEditInput",e)},t.prototype.UserPosix=function(e){return this._connection.send("UserPosix",e)},t.prototype.UserPosixInput=function(e){return this._connection.send("UserPosixInput",e)},t.prototype.UserQuery=function(e){return this._connection.send("UserQuery",e)},t.prototype.UserResetPass=function(e){return this._connection.send("UserResetPass",e)},t.prototype.UserResetPassInput=function(e){return this._connection.send("UserResetPassInput",e)},t.prototype.UserSudoers=function(e){return this._connection.send("UserSudoers",e)},t.prototype.UserSudoersInput=function(e){return this._connection.send("UserSudoersInput",e)},t.prototype.Users=function(e){return this._connection.send("Users",e)},t}(Z)),te=function(){function e(e){this._connection=new K(e,"Ws_Account","1.05")}return e.prototype.connectionOptions=function(){return this._connection.opts()},e.prototype.MyAccount=function(e){return this._connection.send("MyAccount",e)},e.prototype.UpdateUser=function(e){return this._connection.send("UpdateUser",e)},e.prototype.UpdateUserInput=function(e){return this._connection.send("UpdateUserInput",e)},e.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}))},e}(),ne=function(){function e(e){this._connection=new K(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",T({SigningMethod:"gpg"},e))},e.prototype.Verify=function(e){return this._connection.send("Verify",e)},e}(),re=function(e){function t(t){return e.call(this,t,"WsDfu","1.62")||this}return _(t,e),t.prototype.DFUQuery=function(e){return this._connection.send("DFUQuery",e)},t.prototype.DFUInfo=function(e){return this._connection.send("DFUInfo",e)},t.prototype.DFUFile=function(e){return this._connection.send("DFUDefFile",e,"text")},t.prototype.ListHistory=function(e){return this._connection.send("ListHistory",e)},t.prototype.EraseHistory=function(e){return this._connection.send("EraseHistory",e)},t}(Z),oe=function(e){function t(t){return e.call(this,t,"WsDFUXRef","1.01")||this}return _(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}(Z);function ie(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:ue(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:ce(t)}}default:throw new Error("Unknown field type")}}function ue(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);var t=[];for(var n in e)t.push(ie(n,e[n]));return t}function ce(e){var t={};for(var n in e)t[n]=ie(n,e[n]);return t}var se,ae=function(e){function t(t){return e.call(this,t,"WsEcl","0")||this}return _(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(ue)},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]=ue(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}(Z);!function(e){e[e.All=0]="All",e[e.ByJobIdID=1]="ByJobIdID",e[e.ByComponent=2]="ByComponent",e[e.ByLogType=3]="ByLogType",e[e.ByTargetAudience=4]="ByTargetAudience"}(se||(se={}));var pe,fe,le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(function(e){function t(t){return e.call(this,t,"ws_logaccess","1")||this}return _(t,e),t.prototype.GetLogAccessInfo=function(e){return this._connection.send("GetLogAccessInfo",e)},t.prototype.GetLogs=function(e){return this._connection.send("GetLogs",e)},t.prototype.Ping=function(e){return this._connection.send("Ping",e)},t}(Z));function he(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function de(e){return null===e?NaN:+e}function ye(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 ge(e,t){var n,r=e.length,o=r,i=-1,u=0;if(null==t)for(;++i<r;)isNaN(n=de(e[i]))?--o:u+=n;else for(;++i<r;)isNaN(n=de(t(e[i],i,e)))?--o:u+=n;if(o)return u/o}1===(pe=he).length&&(fe=pe,pe=function(e,t){return he(fe(e),t)});var be,me,ve=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return _(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 T(T({},e),{Total:e.InUse+e.Available,PercentUsed:100-e.PercentAvailable})})):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:ge(t.filter((function(e){return!isNaN(e.PercentUsed)})),(function(e){return e.PercentUsed})),max:ye(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:ge(t.filter((function(e){return!isNaN(e.mean)})),(function(e){return e.mean})),max:ye(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:ge(t.filter((function(e){return!isNaN(e.mean)})),(function(e){return e.mean})),max:ye(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 _(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}(Z)),Se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(function(e){function t(t){return e.call(this,t,"WsResources","1.01")||this}return _(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}(Z)),Pe=function(){function e(e){this._connection=new K(e,"WsSMC","1.24")}return e.prototype.connectionOptions=function(){return this._connection.opts()},e.prototype.Activity=function(e){return this._connection.send("Activity",e).then((function(e){return T({Running:{ActiveWorkunit:[]}},e)}))},e.prototype.BrowseResources=function(e){return this._connection.send("BrowseResources",e)},e.prototype.GetBuildInfo=function(e){return this._connection.send("GetBuildInfo",e)},e.prototype.GetStatusServerInfo=function(e){return this._connection.send("GetStatusServerInfo",e)},e.prototype.GetThorQueueAvailability=function(e){return this._connection.send("GetThorQueueAvailability",e)},e.prototype.LockQuery=function(e){return this._connection.send("LockQuery",e)},e.prototype.NotInCommunityEdition=function(e){return this._connection.send("NotInCommunityEdition",e)},e.prototype.RoxieControlCmd=function(e){return this._connection.send("RoxieControlCmd",e)},e.prototype.SetBanner=function(e){return this._connection.send("SetBanner",e)},e.prototype.SMCJob=function(e){return this._connection.send("SMCJob",e)},e}(),Ue=function(e){function t(t){return e.call(this,t,"WsStore","1")||this}return _(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}(Z);e.TpLogicalClusterQuery=void 0,be=e.TpLogicalClusterQuery||(e.TpLogicalClusterQuery={}),(me=be.RoxieQueueFilter||(be.RoxieQueueFilter={})).All="All",me.QueriesOnly="QueriesOnly",me.WorkunitsOnly="WorkunitsOnly";var Ce,we,Oe=function(e){function t(t){return e.call(this,t,"WsTopology","1.25")||this}return _(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.TpLogicalClusterQuery=function(e){return void 0===e&&(e={}),this._connection.send("TpLogicalClusterQuery",e)},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.prototype.TpServiceQuery=function(e){return this._connection.send("TpServiceQuery",e)},t.prototype.TpTargetClusterQuery=function(e){return this._connection.send("TpTargetClusterQuery",e)},t.prototype.TpListTargetClusters=function(e){return this._connection.send("TpListTargetClusters",e)},t}(Z);function je(e){return"string"==typeof e.Name}e.WUStateID=void 0,function(e){e[e.Unknown=0]="Unknown",e[e.Compiled=1]="Compiled",e[e.Running=2]="Running",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed",e[e.Archived=5]="Archived",e[e.Aborting=6]="Aborting",e[e.Aborted=7]="Aborted",e[e.Blocked=8]="Blocked",e[e.Submitted=9]="Submitted",e[e.Scheduled=10]="Scheduled",e[e.Compiling=11]="Compiling",e[e.Wait=12]="Wait",e[e.UploadingFiled=13]="UploadingFiled",e[e.DebugPaused=14]="DebugPaused",e[e.DebugRunning=15]="DebugRunning",e[e.Paused=16]="Paused",e[e.LAST=17]="LAST",e[e.NotFound=999]="NotFound"}(e.WUStateID||(e.WUStateID={})),e.WUUpdate=void 0,Ce=e.WUUpdate||(e.WUUpdate={}),(we=Ce.Action||(Ce.Action={}))[we.Unknown=0]="Unknown",we[we.Compile=1]="Compile",we[we.Check=2]="Check",we[we.Run=3]="Run",we[we.ExecuteExisting=4]="ExecuteExisting",we[we.Pause=5]="Pause",we[we.PauseNow=6]="PauseNow",we[we.Resume=7]="Resume",we[we.Debug=8]="Debug",we[we.__size=9]="__size";var _e=function(e){function n(t){return e.call(this,t,"WsWorkunits","1.85")||this}return _(n,e),n.prototype.opts=function(){return this._connection.opts()},n.prototype.connection=function(){return this._connection.clone()},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){return void 0===e&&(e={}),this._connection.send("WUQuery",e).then((function(e){return t.deepMixin({Workunits:{ECLWorkunit:[]}},e)}))},n.prototype.WUInfo=function(e){var t=T({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:!0,IncludeServiceNames:!0,SuppressResultSchemas:!0},e);return this._connection.send("WUInfo",t)},n.prototype.WUCreate=function(){return this._connection.send("WUCreate")},n.prototype.WUUpdate=function(e){return this._connection.send("WUUpdate",e,"json",!0)},n.prototype.WUSubmit=function(e){return this._connection.send("WUSubmit",e)},n.prototype.WUResubmit=function(e){return this._connection.toESPStringArray(e,"Wuids"),this._connection.send("WUResubmit",e)},n.prototype.WUQueryDetails=function(e){return this._connection.send("WUQueryDetails",e)},n.prototype.WUListQueries=function(e){return this._connection.send("WUListQueries",e)},n.prototype.WUPushEvent=function(e){return this._connection.send("WUPushEvent",e)},n.prototype.WUAction=function(e){return e.ActionType=e.WUActionType,this._connection.send("WUAction",e)},n.prototype.WUGetZAPInfo=function(e){return this._connection.send("WUGetZAPInfo",e)},n.prototype.WUShowScheduled=function(e){return this._connection.send("WUShowScheduled",e)},n.prototype.WUQuerySetAliasAction=function(e){return this._connection.send("WUQuerySetAliasAction",e)},n.prototype.WUQuerySetQueryAction=function(e){return this._connection.send("WUQuerySetQueryAction",e)},n.prototype.WUPublishWorkunit=function(e){return this._connection.send("WUPublishWorkunit",e)},n.prototype.WUGetGraph=function(e){return this._connection.send("WUGetGraph",e)},n.prototype.WUResult=function(e,t){return this._connection.send("WUResult",e,"json",!1,t)},n.prototype.WUQueryGetGraph=function(e){return this._connection.send("WUQueryGetGraph",e)},n.prototype.WUFile=function(e){return this._connection.send("WUFile",e,"text")},n.prototype.WUGetStats=function(e){return this._connection.send("WUGetStats",e)},n.prototype.WUQueryGetSummaryStats=function(e){return this._connection.send("WUQueryGetSummaryStats",e)},n.prototype.WUDetailsMeta=function(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=this._connection.send("WUDetailsMeta",e)),this._WUDetailsMetaPromise},n.prototype.WUDetails=function(e){return this._connection.send("WUDetails",e)},n.prototype.WUCDebug=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}(Z),Te=new Date,De=new Date;function Re(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 u,c=[];if(n=o.ceil(n),i=null==i?1:Math.floor(i),!(n<r&&i>0))return c;do{c.push(u=new Date(+n)),t(n,i),e(n)}while(u<n&&n<r);return c},o.filter=function(n){return Re((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 Te.setTime(+t),De.setTime(+r),e(Te),e(De),Math.floor(n(Te,De))},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 xe=864e5,Ae=6048e5,We=Re((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()))/xe}),(function(e){return e.getDate()-1}));function Ie(e){return Re((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()))/Ae}))}var Ne=Ie(0),Fe=Ie(1);Ie(2),Ie(3);var Ee=Ie(4);Ie(5),Ie(6);var Me=Re((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()}));Me.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Re((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};var Le=Me,ke=Re((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/xe}),(function(e){return e.getUTCDate()-1}));function Ge(e){return Re((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)/Ae}))}var Ve=Ge(0),Be=Ge(1);Ge(2),Ge(3);var Qe=Ge(4);Ge(5),Ge(6);var He=Re((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()}));He.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Re((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};var Xe=He;function qe(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 Ye(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 ze(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var Je,$e,Ke,Ze={"-":"",_:" ",0:"0"},et=/^\s*\d+/,tt=/^%/,nt=/[\\^$*+?|[\]().{}]/g;function rt(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 ot(e){return e.replace(nt,"\\$&")}function it(e){return new RegExp("^(?:"+e.map(ot).join("|")+")","i")}function ut(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function ct(e,t,n){var r=et.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function st(e,t,n){var r=et.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function at(e,t,n){var r=et.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function pt(e,t,n){var r=et.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function ft(e,t,n){var r=et.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function lt(e,t,n){var r=et.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ht(e,t,n){var r=et.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function dt(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 yt(e,t,n){var r=et.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function gt(e,t,n){var r=et.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function bt(e,t,n){var r=et.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function mt(e,t,n){var r=et.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function vt(e,t,n){var r=et.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function St(e,t,n){var r=et.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Pt(e,t,n){var r=et.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Ut(e,t,n){var r=et.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ct(e,t,n){var r=et.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function wt(e,t,n){var r=tt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ot(e,t,n){var r=et.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function jt(e,t,n){var r=et.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function _t(e,t){return rt(e.getDate(),t,2)}function Tt(e,t){return rt(e.getHours(),t,2)}function Dt(e,t){return rt(e.getHours()%12||12,t,2)}function Rt(e,t){return rt(1+We.count(Le(e),e),t,3)}function xt(e,t){return rt(e.getMilliseconds(),t,3)}function At(e,t){return xt(e,t)+"000"}function Wt(e,t){return rt(e.getMonth()+1,t,2)}function It(e,t){return rt(e.getMinutes(),t,2)}function Nt(e,t){return rt(e.getSeconds(),t,2)}function Ft(e){var t=e.getDay();return 0===t?7:t}function Et(e,t){return rt(Ne.count(Le(e)-1,e),t,2)}function Mt(e){var t=e.getDay();return t>=4||0===t?Ee(e):Ee.ceil(e)}function Lt(e,t){return e=Mt(e),rt(Ee.count(Le(e),e)+(4===Le(e).getDay()),t,2)}function kt(e){return e.getDay()}function Gt(e,t){return rt(Fe.count(Le(e)-1,e),t,2)}function Vt(e,t){return rt(e.getFullYear()%100,t,2)}function Bt(e,t){return rt((e=Mt(e)).getFullYear()%100,t,2)}function Qt(e,t){return rt(e.getFullYear()%1e4,t,4)}function Ht(e,t){var n=e.getDay();return rt((e=n>=4||0===n?Ee(e):Ee.ceil(e)).getFullYear()%1e4,t,4)}function Xt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+rt(t/60|0,"0",2)+rt(t%60,"0",2)}function qt(e,t){return rt(e.getUTCDate(),t,2)}function Yt(e,t){return rt(e.getUTCHours(),t,2)}function zt(e,t){return rt(e.getUTCHours()%12||12,t,2)}function Jt(e,t){return rt(1+ke.count(Xe(e),e),t,3)}function $t(e,t){return rt(e.getUTCMilliseconds(),t,3)}function Kt(e,t){return $t(e,t)+"000"}function Zt(e,t){return rt(e.getUTCMonth()+1,t,2)}function en(e,t){return rt(e.getUTCMinutes(),t,2)}function tn(e,t){return rt(e.getUTCSeconds(),t,2)}function nn(e){var t=e.getUTCDay();return 0===t?7:t}function rn(e,t){return rt(Ve.count(Xe(e)-1,e),t,2)}function on(e){var t=e.getUTCDay();return t>=4||0===t?Qe(e):Qe.ceil(e)}function un(e,t){return e=on(e),rt(Qe.count(Xe(e),e)+(4===Xe(e).getUTCDay()),t,2)}function cn(e){return e.getUTCDay()}function sn(e,t){return rt(Be.count(Xe(e)-1,e),t,2)}function an(e,t){return rt(e.getUTCFullYear()%100,t,2)}function pn(e,t){return rt((e=on(e)).getUTCFullYear()%100,t,2)}function fn(e,t){return rt(e.getUTCFullYear()%1e4,t,4)}function ln(e,t){var n=e.getUTCDay();return rt((e=n>=4||0===n?Qe(e):Qe.ceil(e)).getUTCFullYear()%1e4,t,4)}function hn(){return"+0000"}function dn(){return"%"}function yn(e){return+e}function gn(e){return Math.floor(+e/1e3)}Je=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,i=e.days,u=e.shortDays,c=e.months,s=e.shortMonths,a=it(o),p=ut(o),f=it(i),l=ut(i),h=it(u),d=ut(u),y=it(c),g=ut(c),b=it(s),m=ut(s),v={a:function(e){return u[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return c[e.getMonth()]},c:null,d:_t,e:_t,f:At,g:Bt,G:Ht,H:Tt,I:Dt,j:Rt,L:xt,m:Wt,M:It,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:yn,s:gn,S:Nt,u:Ft,U:Et,V:Lt,w:kt,W:Gt,x:null,X:null,y:Vt,Y:Qt,Z:Xt,"%":dn},S={a:function(e){return u[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return c[e.getUTCMonth()]},c:null,d:qt,e:qt,f:Kt,g:pn,G:ln,H:Yt,I:zt,j:Jt,L:$t,m:Zt,M:en,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:yn,s:gn,S:tn,u:nn,U:rn,V:un,w:cn,W:sn,x:null,X:null,y:an,Y:fn,Z:hn,"%":dn},P={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=f.exec(t.slice(n));return r?(e.w=l[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 w(e,t,n,r)},d:bt,e:bt,f:Ct,g:ht,G:lt,H:vt,I:vt,j:mt,L:Ut,m:gt,M:St,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:yt,Q:Ot,s:jt,S:Pt,u:st,U:at,V:pt,w:ct,W:ft,x:function(e,t,r){return w(e,n,t,r)},X:function(e,t,n){return w(e,r,t,n)},y:ht,Y:lt,Z:dt,"%":wt};function U(e,t){return function(n){var r,o,i,u=[],c=-1,s=0,a=e.length;for(n instanceof Date||(n=new Date(+n));++c<a;)37===e.charCodeAt(c)&&(u.push(e.slice(s,c)),null!=(o=Ze[r=e.charAt(++c)])?r=e.charAt(++c):o="e"===r?" ":"0",(i=t[r])&&(r=i(n,o)),u.push(r),s=c+1);return u.push(e.slice(s,c)),u.join("")}}function C(e,t){return function(n){var r,o,i=ze(1900,void 0,1);if(w(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=Ye(ze(i.y,0,1))).getUTCDay(),r=o>4||0===o?Be.ceil(r):Be(r),r=ke.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(o=(r=qe(ze(i.y,0,1))).getDay(),r=o>4||0===o?Fe.ceil(r):Fe(r),r=We.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?Ye(ze(i.y,0,1)).getUTCDay():qe(ze(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,Ye(i)):qe(i)}}function w(e,t,n,r){for(var o,i,u=0,c=t.length,s=n.length;u<c;){if(r>=s)return-1;if(37===(o=t.charCodeAt(u++))){if(o=t.charAt(u++),!(i=P[o in Ze?t.charAt(u++):o])||(r=i(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return v.x=U(n,v),v.X=U(r,v),v.c=U(t,v),S.x=U(n,S),S.X=U(r,S),S.c=U(t,S),{format:function(e){var t=U(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=U(e+="",S);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}({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"]}),$e=Je.utcFormat,Ke=Je.utcParse;var bn=function(e){function t(t,n,r){var o=e.call(this)||this;o.wu=t;for(var i=0,u=0,c=r;u<c.length;u++){var s=c[u];if(s.GraphName===n.Name&&!s.HasSubGraphId){i=Math.round(1e3*s.Seconds)/1e3;break}}return o.set(T({Time:i},n)),o}return _(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 Rn(e)})):this.wu.fetchGraphDetails([this.Name],["graph"]).then((function(e){return Rn(e)}))},t}(t.StateObject),mn=function(e){function n(){return e.call(this,(function(e){return t.Cache.hash([e.Name])}))||this}return _(n,e),n}(t.Cache);function vn(e,t,n){(n=n||[]).push(e),t(e.name,e.$,e.children(),n),e.children().forEach((function(e){vn(e,t,n)})),n.pop()}function Sn(e){var t={};return e.forEach((function(e){"att"===e.name&&(t[e.$.name]=e.$.value)})),t}var Pn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(t.Graph),Un=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(t.Subgraph),Cn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(t.Vertex),wn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(t.Edge);function On(e,t){var n={},r={},o={},i=new Pn((function(e){return e._.id})),u=[i.root];return vn(t,(function(e,t,i,c){var s=u[u.length-1];switch(e){case"graph":break;case"node":if(i.length&&i[0].children().length&&"graph"===i[0].children()[0].name){var a=s.createSubgraph(Sn(i));u.push(a),n[t.id]=a}var p=s.createVertex(Sn(i));r[t.id]=p;break;case"edge":var f=s.createEdge(r[t.source],r[t.target],Sn(i));o[t.id]=f}})),i}var jn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(t.Graph),_n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(t.Subgraph),Tn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(t.Vertex),Dn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t}(t.Edge);function Rn(e){for(var t,n={},r={},o={},i=0,u=e;i<u.length;i++){switch((l=u[i]).ScopeType){case"graph":t=new jn((function(e){return e._.Id}),l),n[l.ScopeName]=t.root;break;case"subgraph":t||(t=new jn((function(e){return e._.Id}),l),n[l.ScopeName]=t.root);for(var c=l.parentScope().split(":"),s=n[l.parentScope()];c.length&&!s;)s=n[c.join(":")],c.pop();if(s){var a=s;n[l.ScopeName]=a.createSubgraph(l)}else console.warn("Missing SG:Parent (".concat(l.Id,"): ").concat(l.parentScope()));break;case"activity":var p=n[l.parentScope()];p?o[l.ScopeName]=p.createVertex(l):console.warn("Missing A:Parent (".concat(l.Id,"): ").concat(l.parentScope()));break;case"edge":r[l.ScopeName]=l;break;case"function":(h=o[l.parentScope()])?h._.children().push(l):console.warn("Missing F:Parent (".concat(l.Id,"): ").concat(l.parentScope()))}}for(var f in r){var l,h;if(h=n[(l=r[f]).parentScope()]){var d=h;try{var y=t.vertex(l.attr("IdSource").RawValue),g=t.vertex(l.attr("IdTarget").RawValue);d.createEdge(y,g,l)}catch(e){console.warn("Invalid Edge: ".concat(f))}}else console.warn("Missing E:Parent (".concat(l.Id,"): ").concat(l.parentScope()))}return t}var xn=function(e){function t(t,n){var r=e.call(this)||this;r.wu=t;var o=n.split("\\").join("/"),i=o.split("/"),u="res/"+r.wu.Wuid+"/",c="",s="";return 0===o.indexOf(u)&&(c=o.substr(u.length),s=i[i.length-1]),r.set({URL:n,DisplayName:s,DisplayPath:c}),r}return _(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),An=function(){function e(e){this.e=e}return e.prototype.fix=function(){delete this.e},e}(),Wn=function(e){function t(t){var n=e.call(this,t)||this;return n.isSet=!1,n.attrs={},n._children=[],n}return _(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}(An),In=function(e){function t(t){return e.call(this,t)||this}return _(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}(An),Nn=function(){function e(){this.simpleTypes={}}return e.prototype.fields=function(){return this.root.children()},e}(),Fn=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.schema=new Nn,n.simpleTypes={},n.xsdStack=new t.Stack,n}return _(n,e),n.prototype.startXMLNode=function(t){switch(e.prototype.startXMLNode.call(this,t),t.name){case"xs:element":var n=new Wn(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 In(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 En(e){var t=new Fn;return t.parse(e),t.schema}var Mn=function(e){function n(n){var r=e.call(this)||this;return r.schema=new Nn,r.simpleTypes={},r.xsdStack=new t.Stack,r._rootName=n,r}return _(n,e),n.prototype.startXMLNode=function(t){switch(e.prototype.startXMLNode.call(this,t),t.name){case"xsd:element":var n=new Wn(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 In(t)}},n.prototype.endXMLNode=function(t){"xsd:element"===t.name&&this.xsdStack.pop().fix();e.prototype.endXMLNode.call(this,t)},n}(Fn);var Ln,kn=function(e){function t(){return e.call(this,(function(e){return"".concat(e.BaseUrl,"-").concat(e.Wuid,"-").concat(e.ResultName)}))||this}return _(t,e),t}(t.Cache),Gn=new kn,Vn=function(e){function n(t,n,r,o){var i=e.call(this)||this;return i.connection=t instanceof _e?t:new _e(t),"boolean"==typeof o&&!0===o?i.set({NodeGroup:n,LogicalFileName:r}):je(r)&&Array.isArray(o)?i.set(T(T({},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 _(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=Gn.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=Gn.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+r},(function(){return new n(e,t,r)})):"string"==typeof r&&(i=Gn.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r},(function(){return new n(e,t,r)})))),i},n.attachLogicalFile=function(e,t,r){return Gn.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(){var e=this;return this.xsdSchema?Promise.resolve(this.xsdSchema):this.WUResult().then((function(n){return t.exists("Result.XmlSchema.xml",n)?(e.xsdSchema=En(n.Result.XmlSchema.xml),e.xsdSchema):null}))},n.prototype.refresh=function(){return D(this,void 0,void 0,(function(){return R(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 u=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,u.set(T({},e)),t.exists("XmlSchema.xml",n)&&(u.xsdSchema=En(n.XmlSchema.xml)),t.exists("Row",n)?n.Row:u.ResultName&&t.exists(u.ResultName,n)?n[u.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 u in r)i.NamedValue[i.NamedValue.itemcount++]={Name:u,Value:r[u]};var c={FilterBy:i};return this.Wuid&&void 0!==this.ResultName?(c.Wuid=this.Wuid,c.ResultName=this.ResultName):this.Wuid&&void 0!==this.ResultSequence?(c.Wuid=this.Wuid,c.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(c.LogicalName=this.LogicalFileName,c.Cluster=this.NodeGroup):this.LogicalFileName&&(c.LogicalName=this.LogicalFileName),c.Start=e,c.Count=t,c.SuppressXmlSchema=n,this.connection.WUResult(c,o).then((function(e){return e}))},n}(t.StateObject),Bn=function(e){function n(){return e.call(this,(function(e){return t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName])}))||this}return _(n,e),n}(t.Cache),Qn=function(e){function t(t,n){var r=e.call(this)||this;return r.scope=t,r.set(n),r}return _(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),Hn=function(e){function t(t){var n=e.call(this)||this;return n._attributeMap={},n._children=[],n.update(t),n}return _(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,"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 Qn(e,r))})),n.start&&n.end?(n.start.FormattedEnd=n.end.Formatted,t.push(new Qn(this,n.start))):n.start?t.push(new Qn(this,n.start)):n.end&&t.push(new Qn(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 Qn(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),Xn=function(e){function t(t,n){var r=e.call(this,n)||this;return r.wu=t,r}return _(t,e),t}(Hn),qn=function(e){function t(t,n,r){var o=e.call(this)||this;return o.connection=t instanceof _e?t:new _e(t),o.set(T({Wuid:n},r)),o}return _(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),Yn=function(e){function n(n,r,o){var i=e.call(this)||this;i.connection=n instanceof _e?n:new _e(n);var u=t.espTime2Seconds(o.Value);return i.set(T({Wuid:r,Seconds:Math.round(1e3*u)/1e3,HasSubGraphId:void 0!==o.SubGraphId},o)),i}return _(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}),n}(t.StateObject),zn=$e("%Y-%m-%dT%H:%M:%S.%LZ"),Jn=Ke("%Y-%m-%dT%H:%M:%S.%LZ"),$n=t.scopedLogger("workunit.ts"),Kn=e.WUStateID,Zn=function(e){function t(){return e.call(this,(function(e){return"".concat(e.BaseUrl,"-").concat(e.Wuid)}))||this}return _(t,e),t}(t.Cache),er=new Zn,tr=function(n){function r(e,t){var r=n.call(this)||this;return r._debugMode=!1,r._resultCache=new Bn,r._graphCache=new mn,r.connection=new _e(e),r.topologyConnection=new Oe(e),r.clearState(t),r}return _(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 Vn.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 Yn(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 bn(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 xn(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,"HaveSubGraphTimings",{get:function(){return this.get("HaveSubGraphTimings")},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 qn(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,"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}),r.create=function(e){var t=new r(e);return t.connection.WUCreate().then((function(e){return er.set(t),t.set(e.Workunit),t}))},r.attach=function(e,t,n){var o=er.get({BaseUrl:e.baseUrl,Wuid:t},(function(){return new r(e,t)}));return n&&o.set(n),o},r.existsLocal=function(e,t){return er.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 _e(e).WUQuery(t).then((function(t){return t.Workunits.ECLWorkunit.map((function(t){return r.attach(e,t.Wuid,t)}))}))},r.prototype.clearState=function(e){this.clear({Wuid:e,StateID:Kn.Unknown})},r.prototype.update=function(e){var t=this;return this.connection.WUUpdate(T(T({},e),{Wuid:this.Wuid,StateOrig:this.State,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 Kn.Compiled:return"compile"===this.ActionEx||this._submitAction===e.WUUpdate.Action.Compile;case Kn.Completed:case Kn.Failed:case Kn.Aborted:case Kn.NotFound:return!0}return!1},r.prototype.isFailed=function(){switch(this.StateID){case Kn.Aborted:case Kn.Failed:return!0}return!1},r.prototype.isDeleted=function(){return this.StateID===Kn.NotFound},r.prototype.isDebugging=function(){switch(this.StateID){case Kn.DebugPaused:case Kn.DebugRunning:return!0}return this._debugMode},r.prototype.isRunning=function(){switch(this.StateID){case Kn.Compiled:case Kn.Running:case Kn.Aborting:case Kn.Blocked:case Kn.DebugPaused:case Kn.DebugRunning:return!0}return!1},r.prototype.setToFailed=function(){return this.WUAction("SetToFailed")},r.prototype.pause=function(){return this.WUAction("Pause")},r.prototype.pauseNow=function(){return this.WUAction("PauseNow")},r.prototype.resume=function(){return this.WUAction("Resume")},r.prototype.abort=function(){return this.WUAction("Abort")},r.prototype.delete=function(){return this.WUAction("Delete")},r.prototype.restore=function(){return this.WUAction("Restore")},r.prototype.deschedule=function(){return this.WUAction("Deschedule")},r.prototype.reschedule=function(){return this.WUAction("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 D(this,void 0,void 0,(function(){return R(this,(function(e){switch(e.label){case 0:return[4,this.WUQuery()];case 1:return e.sent(),[2,this]}}))}))},r.prototype.refreshInfo=function(){return D(this,void 0,void 0,(function(){return R(this,(function(e){switch(e.label){case 0:return[4,this.WUInfo()];case 1:return e.sent(),[2,this]}}))}))},r.prototype.refreshDebug=function(){return D(this,void 0,void 0,(function(){return R(this,(function(e){switch(e.label){case 0:return[4,this.debugStatus()];case 1:return e.sent(),[2,this]}}))}))},r.prototype.refresh=function(e){return void 0===e&&(e=!1),D(this,void 0,void 0,(function(){return R(this,(function(t){switch(t.label){case 0:return e?[4,Promise.all([this.refreshInfo(),this.refreshDebug()])]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.refreshState()];case 3:t.sent(),t.label=4;case 4:return[2,this]}}))}))},r.prototype.eclExceptions=function(){return this.Exceptions.ECLException},r.prototype.fetchArchive=function(){return this.connection.WUFile({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.fetchDetailsNormalized=function(e){return void 0===e&&(e={}),Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then((function(e){for(var t,n=e[0],r={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},o=[],i=0,u=e[1];i<u.length;i++){var c=u[i],s={},a={};if(c&&c.Id&&c.Properties&&c.Properties.Property){for(var p in c.Properties.Property){var f=c.Properties.Property[p];switch("ns"===f.Measure&&(f.Measure="s"),r[f.Name]=T({},f),delete r[f.Name].RawValue,delete r[f.Name].Formatted,f.Measure){case"bool":s[f.Name]=!!+f.RawValue;break;case"sz":case"ns":case"cnt":s[f.Name]=+f.RawValue;break;case"s":s[f.Name]=+f.RawValue/1e9;break;case"ts":s[f.Name]=new Date(+f.RawValue/1e3).toISOString();break;case"cost":s[f.Name]=+f.RawValue/1e6;break;default:s[f.Name]=f.RawValue}a[f.Name]=null!==(t=f.Formatted)&&void 0!==t?t:s[f.Name]}o.push(T({id:c.Id,name:c.ScopeName,type:c.ScopeType,__formattedProps:a},s))}}return{meta:n,columns:r,data:o}}))},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 Xn(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 Xn(t,e);return r[n.ScopeName]=n,n})),r)if(r.hasOwnProperty(o)){var i=r[o],u=i.parentScope();u&&r[u]?r[u].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 Rn(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=Jn(o.start);i.setMilliseconds(i.getMilliseconds()+o.elapsed/1e6),o.finish=zn(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._monitorTimeoutDuraction=function(){var e=n.prototype._monitorTimeoutDuraction.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(e){var t=this;return void 0===e&&(e={}),this.connection.WUQuery(T(T({},e),{Wuid:this.Wuid})).then((function(e){return t.set(e.Workunits.ECLWorkunit[0]),e})).catch((function(e){if(!e.Exception.some((function(e){return 20081===e.Code&&(t.clearState(t.Wuid),t.set("StateID",Kn.NotFound),!0)})))throw $n.warning("Unexpected exception: "),e;return{}}))},r.prototype.WUCreate=function(){var e=this;return this.connection.WUCreate().then((function(t){return e.set(t.Workunit),er.set(e),t}))},r.prototype.WUInfo=function(e){var t=this;void 0===e&&(e={});var n=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo(T(T({},e),{Wuid:this.Wuid,IncludeResults:n,IncludeResultsViewNames:n,SuppressResultSchemas:!1})).then((function(e){return t.set(e.Workunit),n&&t.set({ResultViews:e.ResultViews}),e})).catch((function(e){if(!e.Exception.some((function(e){return 20080===e.Code&&(t.clearState(t.Wuid),t.set("StateID",Kn.NotFound),!0)})))throw $n.warning("Unexpected exception: "),e;return{}}))},r.prototype.WUResubmit=function(e){return this.connection.WUResubmit(t.deepMixinT({},e,{Wuids:[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:[this.Wuid],WUActionType:e}).then((function(e){return t.refresh().then((function(){return t._monitor(),e}))}))},r.prototype.publish=function(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:!0,Wait:5e3})},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.WUCDebug({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 $n.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=T(T({},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=On(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(nr(i)){var u=rr(i);(u&&!t||t===u.file)&&n.push(u)}}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);function nr(e){return void 0!==e._.definition}function rr(e){var t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._.definition);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._.definition))}var or=function(e){function n(n){var r=e.call(this)||this;return r.lazyRefresh=t.debounce((function(){return D(r,void 0,void 0,(function(){var e;return R(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 Pe?n:new Pe(n),r.clear({}),r}return _(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 Ln||(Ln=new n(e)),t&&Ln.set(T({},t)),Ln},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 tr.attach(t.connection.connectionOptions(),e.Wuid,e)}))},n.prototype.setBanner=function(e){var t=this;return this.connection.SetBanner(T({},e)).then((function(e){return t.set(e),t}))},n.prototype.refresh=function(){return D(this,void 0,void 0,(function(){return R(this,(function(e){return[2,this.lazyRefresh()]}))}))},n}(t.StateObject),ir=function(e){function t(){return e.call(this,(function(e){return"".concat(e.BaseUrl,"-").concat(e.Cluster,"-").concat(e.Name)}))||this}return _(t,e),t}(t.Cache),ur=new ir,cr=function(e){function t(t,n,r){var o=e.call(this)||this;return o.connection=t instanceof re?t:new re(t),o.clear({Cluster:n,Name:r}),o}return _(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,"Cost",{get:function(){return this.get("Cost")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){return ur.get({BaseUrl:e.baseUrl,Cluster:n,Name:r},(function(){return new t(e,n,r)}))},t.prototype.filePartsOnCluster=function(){var e;return function(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))}([],(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],u=0,c=(null===(t=null==i?void 0:i.DFUFileParts)||void 0===t?void 0:t.DFUPart)||[];u<c.length;u++){var s=c[u],a=T(T({},i),s);delete a.DFUFileParts,n.push(a)}return n},t.prototype.update=function(e){var t=this;return this.connection.DFUInfo(T(T({},e),{Cluster:this.Cluster,Name:this.Name})).then((function(e){return t.set(T({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){return e.set(T({Cluster:e.Cluster},t.FileDetail)),t.FileDetail}))},t.prototype.fetchDefFile=function(e){return this.connection.DFUFile({Name:this.Name,Format:e})},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),sr=function(e){function t(){return e.call(this,(function(e){return e.Address}))||this}return _(t,e),t}(t.Cache),ar=new sr,pr=function(e){function t(t){var n=e.call(this)||this;return n.connection=t instanceof ve?t:new ve(t),n}return _(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=ar.get({Address:n},(function(){return new t(e)}));return r&&o.set(r),o},t}(t.StateObject),fr=new(function(e){function n(){return e.call(this,(function(e){return t.Cache.hash([e.QueryId,e.QuerySet])}))||this}return _(n,e),n}(t.Cache)),lr=function(e){function t(t,n,r,o){var i=e.call(this)||this;return i.connection=t instanceof ae?t:new ae(t),i._wsWorkunits=new _e(t),i.set(T({QuerySet:n,QueryId:r},o)),i}return _(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.connection.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}),t.attach=function(e,n,r){return fr.get({BaseUrl:e.baseUrl,QuerySet:n,QueryId:r},(function(){return new t(e,n,r)}))},t.prototype.fetchRequestSchema=function(){return D(this,void 0,void 0,(function(){var e;return R(this,(function(t){switch(t.label){case 0:return e=this,[4,this.connection.requestJson(this.QuerySet,this.QueryId)];case 1:return e._requestSchema=t.sent(),[2]}}))}))},t.prototype.fetchResponseSchema=function(){return D(this,void 0,void 0,(function(){var e;return R(this,(function(t){switch(t.label){case 0:return e=this,[4,this.connection.responseJson(this.QuerySet,this.QueryId)];case 1:return e._responseSchema=t.sent(),[2]}}))}))},t.prototype.fetchSchema=function(){return D(this,void 0,void 0,(function(){return R(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._wsWorkunits.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})},t.prototype.submit=function(e){return this.connection.submit(this.QuerySet,this.QueryId,e).then((function(e){for(var t in e)e[t]=e[t].Row;return e}))},t.prototype.refresh=function(){return D(this,void 0,void 0,(function(){var e=this;return R(this,(function(t){return[2,this.fetchSchema().then((function(t){return e}))]}))}))},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),hr=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 _(t,e),t}(t.Cache),dr=new hr,yr=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 _(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),gr=function(){function e(e,n,r,o){this._dispatch=new t.Dispatch,this._knownValues={},this.connection=e instanceof Ue?e:new Ue(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),dr.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 yr(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 yr(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 yr(n.Key,n.Value,i))})),e)for(var i in o)t._dispatch.post(new yr(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 yr(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}(),br=function(e){function t(){return e.call(this,(function(e){return"".concat(e.BaseUrl,"-").concat(e.Name)}))||this}return _(t,e),t}(t.Cache),mr=new br,vr=function(e){function t(t,n){var r=e.call(this)||this;return t instanceof Oe?(r.connection=t,r.machineConnection=new ve(t.connectionOptions())):(r.connection=new Oe(t),r.machineConnection=new ve(t)),r.clear({Name:n}),r}return _(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 pr.attach(e.machineConnection,t.Address,t)}))},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){var o=mr.get({BaseUrl:e.baseUrl,Name:n},(function(){return new t(e,n)}));return r&&o.set(T({},r)),o},t.prototype.fetchMachines=function(e){var t=this;return void 0===e&&(e={}),this.machineConnection.GetTargetClusterInfo(T({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,u=o[r].Processes.MachineInfoEx;i<u.length;i++){var c=u[i];n.push(c)}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,u=o[r].Storage.StorageInfo;i<u.length;i++){var c=u[i];t+=c.Available,n+=c.Total;var s=1-c.Available/c.Total;s>e&&(e=s)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}},t.prototype.fetchUsage=function(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])},t}(t.StateObject);var Sr={};var Pr=function(e){function t(){return e.call(this,(function(e){return e.BaseUrl}))||this}return _(t,e),t}(t.Cache),Ur=new Pr,Cr=function(e){function n(t){var n=e.call(this)||this;return n.connection=t instanceof Oe?t:new Oe(t),n}return _(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 vr.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){return Ur.get({BaseUrl:e.baseUrl},(function(){return new n(e)}))},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(),u="https:"===o?"18002":"8002";if(t.exists("ServiceList.TpEspServers.TpEspServer",r))for(var c=0,s=r.ServiceList.TpEspServers.TpEspServer;c<s.length;c++){var a=s[c];if(t.exists("TpBindings.TpBinding",a))for(var p=0,f=a.TpBindings.TpBinding;p<f.length;p++){var l=f[p];l.Service===e&&l.Protocol+":"===o&&(u=l.Port)}}return"".concat(o,"//").concat(i,":").concat(u,"/")}))},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);e.AccessService=ee,e.AccountService=te,e.Activity=or,e.Attribute=Qn,e.BUILD_VERSION="2.102.11",e.BaseScope=Hn,e.CodesignService=ne,e.Connection=B,e.DFUService=re,e.DFUXRefService=oe,e.ECLGraph=bn,e.ESPConnection=K,e.ESPExceptions=H,e.EclService=ae,e.GlobalResultCache=kn,e.GraphCache=mn,e.LogaccessService=le,e.LogicalFile=cr,e.LogicalFileCache=ir,e.Machine=pr,e.MachineCache=sr,e.MachineService=ve,e.PKG_NAME="@hpcc-js/comms",e.PKG_VERSION="2.74.0",e.Query=lr,e.Resource=xn,e.ResourcesService=Se,e.Result=Vn,e.ResultCache=Bn,e.SMCService=Pe,e.Scope=Xn,e.ScopeEdge=Dn,e.ScopeGraph=jn,e.ScopeSubgraph=_n,e.ScopeVertex=Tn,e.Service=Z,e.SourceFile=qn,e.Store=gr,e.StoreCache=hr,e.StoreService=Ue,e.TargetCluster=vr,e.TargetClusterCache=br,e.Timer=Yn,e.Topology=Cr,e.TopologyCache=Pr,e.TopologyService=Oe,e.ValueChangedMessage=yr,e.Workunit=tr,e.WorkunitCache=Zn,e.WorkunitsService=_e,e.XGMMLEdge=wn,e.XGMMLGraph=Pn,e.XGMMLSubgraph=Un,e.XGMMLVertex=Cn,e.XSDNode=An,e.XSDSchema=Nn,e.XSDSimpleType=In,e.XSDXMLNode=Wn,e.createGraph=Rn,e.createXGMMLGraph=On,e.defaultTargetCluster=function(e){if(!Sr[e.baseUrl]){var t=void 0;t=e instanceof Oe?e:new Oe(e),Sr[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 vr.attach(e,i.Name,i)}))}return Sr[e.baseUrl]},e.deserializeResponse=N,e.get=k,e.hookSend=function(e){var t=V;return e&&(V=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=Q,e.isECLResult=je,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=F,e.parseXSD=En,e.parseXSD2=function(e,t){var n=new Mn(t);return n.parse(e),n.schema},e.post=L,e.send=G,e.serializeRequest=I,e.setTransportFactory=function(t){var n=e.createConnection;return e.createConnection=t,n},e.targetClusters=function(e){return(e instanceof Oe?e:new Oe(e)).TpListTargetClusters({}).then((function(t){return t.TargetClusters.TpClusterNameType.map((function(t){return vr.attach(e,t.Name,t)}))}))},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|