@hpcc-js/comms 3.10.0 → 3.11.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/browser/index.js +2 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.cjs +1 -1
- package/dist/browser/index.umd.cjs.map +1 -1
- package/dist/node/index.cjs +3 -3
- package/dist/node/index.cjs.map +2 -2
- package/dist/node/index.js +5 -5
- package/dist/node/index.js.map +2 -2
- package/package.json +5 -5
- package/src/__package__.ts +3 -3
- package/types/__package__.d.ts +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/util"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/comms"]={},e["@hpcc-js/util"])}(this,function(e,t){var n,s,r,i=Object.create,o=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,a=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;r=null!=(n=t)?i(a(n)):{};var l=(0,(t=((e,t,n,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var r,i=u(t),a=0,l=i.length;a<l;a++)r=i[a],h.call(e,r)||r===n||o(e,r,{get:(e=>t[e]).bind(null,r),enumerable:!(s=c(t,r))||s.enumerable});return e})(!s&&n&&n.__esModule?r:o(r,"default",{value:n,enumerable:!0}),n)).scopedLogger)("comms/connection.ts");var d={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function p(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function g(e,t=!0,n=""){if(n&&(n+="."),"object"!=typeof e)return p(e,t);const s=[];for(const r in e)if(e.hasOwnProperty(r))if(e[r]instanceof Array){let i=!1;e[r].forEach((e,o)=>{"object"==typeof e?(i=!0,s.push(g(e,t,n+p(`${r}.${o}`,t)))):s.push(n+p(`${r}_i${o}`,t)+"="+g(e,t))}),i&&s.push(n+p(`${r}.itemcount`,t)+"="+e[r].length)}else"object"==typeof e[r]?e[r]&&e[r].Item instanceof Array?(s.push(g(e[r].Item,t,n+p(r,t))),s.push(n+p(`${r}.itemcount`,t)+"="+e[r].Item.length)):s.push(g(e[r],t,n+p(r,t))):void 0!==e[r]?s.push(n+p(r,t)+"="+p(e[r],t)):s.push(n+p(r,t));return s.join("&")}function m(e){return JSON.parse(e)}function f(e,n,s={},r="json",i){return i&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let c=1e3*e.timeoutSecs;const u="jsonp_callback_"+Math.round(999999*Math.random());window[u]=function(e){c=0,p(),i("json"===r&&"string"==typeof e?m(e):e)};const a=document.createElement("script");let h=(0,t.join)(e.baseUrl,n);h+=h.indexOf("?")>=0?"&":"?",a.src=h+"jsonp="+u+"&"+g(s,e.encodeRequest),document.body.appendChild(a);const d=setInterval(function(){c<=0?clearInterval(d):(c-=5e3,c<=0?(clearInterval(d),l.error("Request timeout: "+a.src),p(),o(Error("Request timeout: "+a.src))):l.debug("Request pending ("+c/1e3+" sec): "+a.src))},5e3);function p(){delete window[u],document.body.removeChild(a)}})}function S(e){return e.userID?{Authorization:`Basic ${btoa(`${e.userID}:${e.password}`)}`}:{}}var U={};function _(e,n,s,r,i){function o(e){if(e.ok)return"json"===i?e.json():e.text();throw new Error(e.statusText)}return r={...S(e),...r},s={credentials:U[e.baseUrl]?"omit":"include",...s,headers:r},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):s.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(s.agent=fetch.__trustwaveAgent)),(0,t.promiseTimeout)(1e3*e.timeoutSecs,fetch((0,t.join)(e.baseUrl,n),s).then(o).catch(r=>(s.credentials=U[e.baseUrl]?"include":"omit",fetch((0,t.join)(e.baseUrl,n),s).then(o).then(t=>(U[e.baseUrl]=!U[e.baseUrl],t)))))}function y(e,t,n,s="json",r){let i;return n.upload_&&(delete n.upload_,t+="?upload_"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),_(e,t,{method:"post",body:g(n,e.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function v(e,t,n,s="json",r){let i;return n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),_(e,`${t}?${g(n,e.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function R(e,t,n,s="json",r){let i;switch(e.type){case"jsonp":i=f(e,t,n,s,r);break;case"get":i=v(e,t,n,s,r);break;default:i=y(e,t,n,s,r)}return i}var C=R;var D=class Connection{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return 0===arguments.length?this._opts:(this._opts={...d,...e},this)}send(e,t,n="json",s){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,C,s):C(this._opts,e,t,n,s)}clone(){return new Connection(this.opts())}};let b=function(e){return new D(e)};function F(e){return"[object Array]"===Object.prototype.toString.call(e)}var W=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,n){super("ESPException: "+n.Source),this.action=e,this.request=t,this.Source=n.Source,this.Exception=n.Exception,n.Exception.length?this.message=`${n.Exception[0].Code}: ${n.Exception[0].Message}`:this.message=""}};var A=class ESPConnection{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,n){this._connection=function(e){return void 0!==e.send}(e)?e:b(e),this._service=t,this._version=n}service(e){return void 0===e?this._service:(this._service=e,this)}version(e){return void 0===e?this._version:(this._version=e,this)}toESPStringArray(e,t){if(F(e[t])){for(let n=0;n<e[t].length;++n)e[t+"_i"+n]=e[t][n];delete e[t]}return e}opts(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)}send(e,n={},s="json",r=!1,i,o){const c={...n,ver_:this._version};let u;r&&(c.upload_=!0),i&&(c.abortSignal_=i);let a="json";switch(s){case"text":u=(0,t.join)(this._service,e),a="text";break;case"xsd":u=(0,t.join)(this._service,e+".xsd"),a="text";break;case"json2":u=(0,t.join)(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:u=(0,t.join)(this._service,e+".json")}return this._connection.send(u,c,a).then(t=>{if("json"===s){let n;if(t&&t.Exceptions)throw new W(e,c,t.Exceptions);if(t&&(n=t[o||e+"Response"]),!n)throw new W(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return n}return t})}clone(){return new ESPConnection(this._connection.clone(),this._service,this._version)}},T=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,n){this._connection=new A(e,t,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};let w;(w||(w={})).DFUWUActions=function(e){return e.Delete="Delete",e.Protect="Protect",e.Unprotect="Unprotect",e.Restore="Restore",e.SetToFailed="SetToFailed",e.Archive="Archive",e}({});var P=class extends T{constructor(e){super(e,"FileSpray","1.27")}AbortDFUWorkunit(e){return this._connection.send("AbortDFUWorkunit",e,"json",!1,void 0,"AbortDFUWorkunitResponse")}Copy(e){return this._connection.send("Copy",e,"json",!1,void 0,"CopyResponse")}CreateDFUPublisherWorkunit(e){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e){return this._connection.send("CreateDFUWorkunit",e,"json",!1,void 0,"CreateDFUWorkunitResponse")}DFUWUFile(e){return this._connection.send("DFUWUFile",e,"json",!1,void 0,"DFUWUFileResponse")}DFUWUSearch(e){return this._connection.send("DFUWUSearch",e,"json",!1,void 0,"DFUWUSearchResponse")}DFUWorkunitsAction(e){return this._connection.send("DFUWorkunitsAction",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,void 0,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,void 0,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}Despray(e){return this._connection.send("Despray",e,"json",!1,void 0,"DesprayResponse")}DfuMonitor(e){return this._connection.send("DfuMonitor",e,"json",!1,void 0,"DfuMonitorResponse")}DropZoneFileSearch(e){return this._connection.send("DropZoneFileSearch",e,"json",!1,void 0,"DropZoneFileSearchResponse")}DropZoneFiles(e){return this._connection.send("DropZoneFiles",e,"json",!1,void 0,"DropZoneFilesResponse")}EchoDateTime(e){return this._connection.send("EchoDateTime",e,"json",!1,void 0,"EchoDateTimeResponse")}FileList(e){return this._connection.send("FileList",e,"json",!1,void 0,"FileListResponse")}GetDFUExceptions(e){return this._connection.send("GetDFUExceptions",e,"json",!1,void 0,"GetDFUExceptionsResponse")}GetDFUProgress(e){return this._connection.send("GetDFUProgress",e,"json",!1,void 0,"ProgressResponse")}GetDFUServerQueues(e){return this._connection.send("GetDFUServerQueues",e,"json",!1,void 0,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e){return this._connection.send("GetDFUWorkunit",e,"json",!1,void 0,"GetDFUWorkunitResponse")}GetDFUWorkunits(e){return this._connection.send("GetDFUWorkunits",e,"json",!1,void 0,"GetDFUWorkunitsResponse")}GetRemoteTargets(e){return this._connection.send("GetRemoteTargets",e,"json",!1,void 0,"GetRemoteTargetsResponse")}GetSprayTargets(e){return this._connection.send("GetSprayTargets",e,"json",!1,void 0,"GetSprayTargetsResponse")}OpenSave(e){return this._connection.send("OpenSave",e,"json",!1,void 0,"OpenSaveResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"FileSprayPingResponse")}Rename(e){return this._connection.send("Rename",e,"json",!1,void 0,"RenameResponse")}Replicate(e){return this._connection.send("Replicate",e,"json",!1,void 0,"ReplicateResponse")}ShowResult(e){return this._connection.send("ShowResult",e,"json",!1,void 0,"ShowResultResponse")}SprayFixed(e){return this._connection.send("SprayFixed",e,"json",!1,void 0,"SprayFixedResponse")}SprayVariable(e){return this._connection.send("SprayVariable",e,"json",!1,void 0,"SprayResponse")}SubmitDFUWorkunit(e){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,void 0,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};let x=function(e){return e[e.unknown=0]="unknown",e[e.scheduled=1]="scheduled",e[e.queued=2]="queued",e[e.started=3]="started",e[e.aborted=4]="aborted",e[e.failed=5]="failed",e[e.finished=6]="finished",e[e.monitoring=7]="monitoring",e[e.aborting=8]="aborting",e[e.notfound=999]="notfound",e}({});var E=class extends P{DFUWUFileEx(e){return this._connection.send("DFUWUFile",e,"text")}SprayFixedEx(e){return this._connection.send("SprayFixed",e)}SprayVariableEx(e){return this._connection.send("SprayVariable",e,"json",!1,null,"SprayResponse")}DesprayEx(e){return this._connection.send("Despray",e)}UpdateDFUWorkunitEx(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};let L;var N;(N=L||(L={})).ViewMemberType=function(e){return e.User="User",e.Group="Group",e}({}),N.UserSortBy=function(e){return e.username="username",e.fullname="fullname",e.passwordexpiration="passwordexpiration",e.employeeID="employeeID",e.employeeNumber="employeeNumber",e}({}),N.GroupSortBy=function(e){return e.Name="Name",e.ManagedBy="ManagedBy",e}({}),N.AccountTypeReq=function(e){return e.Any="Any",e.User="User",e.Group="Group",e}({}),N.ResourcePermissionSortBy=function(e){return e.Name="Name",e.Type="Type",e}({}),N.ResourceSortBy=function(e){return e.Name="Name",e}({});var j=class extends T{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e){return this._connection.send("AccountPermissions",e,"json",!1,void 0,"AccountPermissionsResponse")}AccountPermissionsV2(e){return this._connection.send("AccountPermissionsV2",e,"json",!1,void 0,"AccountPermissionsV2Response")}AddUser(e){return this._connection.send("AddUser",e,"json",!1,void 0,"AddUserResponse")}AddView(e){return this._connection.send("AddView",e,"json",!1,void 0,"AddViewResponse")}AddViewColumn(e){return this._connection.send("AddViewColumn",e,"json",!1,void 0,"AddViewColumnResponse")}AddViewMember(e){return this._connection.send("AddViewMember",e,"json",!1,void 0,"AddViewMemberResponse")}ClearPermissionsCache(e){return this._connection.send("ClearPermissionsCache",e,"json",!1,void 0,"ClearPermissionsCacheResponse")}DeleteView(e){return this._connection.send("DeleteView",e,"json",!1,void 0,"DeleteViewResponse")}DeleteViewColumn(e){return this._connection.send("DeleteViewColumn",e,"json",!1,void 0,"DeleteViewColumnResponse")}DeleteViewMember(e){return this._connection.send("DeleteViewMember",e,"json",!1,void 0,"DeleteViewMemberResponse")}DisableScopeScans(e){return this._connection.send("DisableScopeScans",e,"json",!1,void 0,"DisableScopeScansResponse")}EnableScopeScans(e){return this._connection.send("EnableScopeScans",e,"json",!1,void 0,"EnableScopeScansResponse")}FilePermission(e){return this._connection.send("FilePermission",e,"json",!1,void 0,"FilePermissionResponse")}GroupAction(e){return this._connection.send("GroupAction",e,"json",!1,void 0,"GroupActionResponse")}GroupAdd(e){return this._connection.send("GroupAdd",e,"json",!1,void 0,"GroupAddResponse")}GroupEdit(e){return this._connection.send("GroupEdit",e,"json",!1,void 0,"GroupEditResponse")}GroupMemberEdit(e){return this._connection.send("GroupMemberEdit",e,"json",!1,void 0,"GroupMemberEditResponse")}GroupMemberEditInput(e){return this._connection.send("GroupMemberEditInput",e,"json",!1,void 0,"GroupMemberEditInputResponse")}GroupMemberQuery(e){return this._connection.send("GroupMemberQuery",e,"json",!1,void 0,"GroupMemberQueryResponse")}GroupQuery(e){return this._connection.send("GroupQuery",e,"json",!1,void 0,"GroupQueryResponse")}Groups(e){return this._connection.send("Groups",e,"json",!1,void 0,"GroupResponse")}PermissionAction(e){return this._connection.send("PermissionAction",e,"json",!1,void 0,"PermissionActionResponse")}Permissions(e){return this._connection.send("Permissions",e,"json",!1,void 0,"BasednsResponse")}PermissionsReset(e){return this._connection.send("PermissionsReset",e,"json",!1,void 0,"PermissionsResetResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accessPingResponse")}QueryScopeScansEnabled(e){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,void 0,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e){return this._connection.send("QueryUserViewColumns",e,"json",!1,void 0,"QueryUserViewColumnsResponse")}QueryViewColumns(e){return this._connection.send("QueryViewColumns",e,"json",!1,void 0,"QueryViewColumnsResponse")}QueryViewMembers(e){return this._connection.send("QueryViewMembers",e,"json",!1,void 0,"QueryViewMembersResponse")}QueryViews(e){return this._connection.send("QueryViews",e,"json",!1,void 0,"QueryViewsResponse")}ResourceAdd(e){return this._connection.send("ResourceAdd",e,"json",!1,void 0,"ResourceAddResponse")}ResourceDelete(e){return this._connection.send("ResourceDelete",e,"json",!1,void 0,"ResourceDeleteResponse")}ResourcePermissionQuery(e){return this._connection.send("ResourcePermissionQuery",e,"json",!1,void 0,"ResourcePermissionQueryResponse")}ResourcePermissions(e){return this._connection.send("ResourcePermissions",e,"json",!1,void 0,"ResourcePermissionsResponse")}ResourceQuery(e){return this._connection.send("ResourceQuery",e,"json",!1,void 0,"ResourceQueryResponse")}Resources(e){return this._connection.send("Resources",e,"json",!1,void 0,"ResourcesResponse")}UserAccountExport(e){return this._connection.send("UserAccountExport",e,"json",!1,void 0,"UserAccountExportResponse")}UserAction(e){return this._connection.send("UserAction",e,"json",!1,void 0,"UserActionResponse")}UserEdit(e){return this._connection.send("UserEdit",e,"json",!1,void 0,"UserEditResponse")}UserGroupEdit(e){return this._connection.send("UserGroupEdit",e,"json",!1,void 0,"UserGroupEditResponse")}UserGroupEditInput(e){return this._connection.send("UserGroupEditInput",e,"json",!1,void 0,"UserGroupEditInputResponse")}UserInfoEdit(e){return this._connection.send("UserInfoEdit",e,"json",!1,void 0,"UserInfoEditResponse")}UserInfoEditInput(e){return this._connection.send("UserInfoEditInput",e,"json",!1,void 0,"UserInfoEditInputResponse")}UserPosix(e){return this._connection.send("UserPosix",e,"json",!1,void 0,"UserPosixResponse")}UserPosixInput(e){return this._connection.send("UserPosixInput",e,"json",!1,void 0,"UserPosixInputResponse")}UserQuery(e){return this._connection.send("UserQuery",e,"json",!1,void 0,"UserQueryResponse")}UserResetPass(e){return this._connection.send("UserResetPass",e,"json",!1,void 0,"UserResetPassResponse")}UserResetPassInput(e){return this._connection.send("UserResetPassInput",e,"json",!1,void 0,"UserResetPassInputResponse")}UserSudoers(e){return this._connection.send("UserSudoers",e,"json",!1,void 0,"UserSudoersResponse")}UserSudoersInput(e){return this._connection.send("UserSudoersInput",e,"json",!1,void 0,"UserSudoersInputResponse")}Users(e){return this._connection.send("Users",e,"json",!1,void 0,"UserResponse")}},I=class extends T{constructor(e){super(e,"ws_account","1.07")}MyAccount(e){return this._connection.send("MyAccount",e,"json",!1,void 0,"MyAccountResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accountPingResponse")}UpdateUser(e){return this._connection.send("UpdateUser",e,"json",!1,void 0,"UpdateUserResponse")}UpdateUserInput(e){return this._connection.send("UpdateUserInput",e,"json",!1,void 0,"UpdateUserInputResponse")}VerifyUser(e){return this._connection.send("VerifyUser",e,"json",!1,void 0,"VerifyUserResponse")}},M=class extends T{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e){return this._connection.send("GetPODs",e,"json",!1,void 0,"GetPODsResponse")}GetServices(e){return this._connection.send("GetServices",e,"json",!1,void 0,"GetServicesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsCloudPingResponse")}},k=(0,t.scopedLogger)("@hpcc-js/comms/services/wsCloud.ts");function G(e){return e.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(t=>{e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e),[])??[]}let V;(V||(V={})).SigningMethodType=function(e){return e.gpg="gpg",e}({});var Q=class extends T{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e){return this._connection.send("ListUserIDs",e,"json",!1,void 0,"ListUserIDsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_codesignPingResponse")}Sign(e){return this._connection.send("Sign",e,"json",!1,void 0,"SignResponse")}Verify(e){return this._connection.send("Verify",e,"json",!1,void 0,"VerifyResponse")}},O=class extends T{constructor(e){super(e,"WSDali","1.07")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"ResultResponse")}ClearTraceTransactions(e){return this._connection.send("ClearTraceTransactions",e,"json",!1,void 0,"ResultResponse")}Count(e){return this._connection.send("Count",e,"json",!1,void 0,"CountResponse")}DFSCheck(e){return this._connection.send("DFSCheck",e,"json",!1,void 0,"ResultResponse")}DFSExists(e){return this._connection.send("DFSExists",e,"json",!1,void 0,"BooleanResponse")}DFSLS(e){return this._connection.send("DFSLS",e,"json",!1,void 0,"ResultResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"ResultResponse")}DisconnectClientConnection(e){return this._connection.send("DisconnectClientConnection",e,"json",!1,void 0,"ResultResponse")}GetClients(e){return this._connection.send("GetClients",e,"json",!1,void 0,"ResultResponse")}GetConnections(e){return this._connection.send("GetConnections",e,"json",!1,void 0,"ResultResponse")}GetDFSCSV(e){return this._connection.send("GetDFSCSV",e,"json",!1,void 0,"ResultResponse")}GetDFSMap(e){return this._connection.send("GetDFSMap",e,"json",!1,void 0,"ResultResponse")}GetDFSParents(e){return this._connection.send("GetDFSParents",e,"json",!1,void 0,"ResultResponse")}GetLogicalFile(e){return this._connection.send("GetLogicalFile",e,"json",!1,void 0,"ResultResponse")}GetLogicalFilePart(e){return this._connection.send("GetLogicalFilePart",e,"json",!1,void 0,"ResultResponse")}GetProtectedList(e){return this._connection.send("GetProtectedList",e,"json",!1,void 0,"ResultResponse")}GetSDSStats(e){return this._connection.send("GetSDSStats",e,"json",!1,void 0,"ResultResponse")}GetSDSSubscribers(e){return this._connection.send("GetSDSSubscribers",e,"json",!1,void 0,"ResultResponse")}GetValue(e){return this._connection.send("GetValue",e,"json",!1,void 0,"ResultResponse")}Import(e){return this._connection.send("Import",e,"json",!1,void 0,"ResultResponse")}ListSDSLocks(e){return this._connection.send("ListSDSLocks",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSDaliPingResponse")}SaveSDSStore(e){return this._connection.send("SaveSDSStore",e,"json",!1,void 0,"ResultResponse")}SetLogicalFilePartAttr(e){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,void 0,"ResultResponse")}SetProtected(e){return this._connection.send("SetProtected",e,"json",!1,void 0,"ResultResponse")}SetTraceSlowTransactions(e){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,void 0,"ResultResponse")}SetTraceTransactions(e){return this._connection.send("SetTraceTransactions",e,"json",!1,void 0,"ResultResponse")}SetUnprotected(e){return this._connection.send("SetUnprotected",e,"json",!1,void 0,"ResultResponse")}SetValue(e){return this._connection.send("SetValue",e,"json",!1,void 0,"ResultResponse")}UnlockSDSLock(e){return this._connection.send("UnlockSDSLock",e,"json",!1,void 0,"ResultResponse")}};let B;var H;(H=B||(B={})).DFUArrayActions=function(e){return e.Delete="Delete",e.AddToSuperfile="Add To Superfile",e.ChangeProtection="Change Protection",e.ChangeRestriction="Change Restriction",e}({}),H.DFUChangeProtection=function(e){return e[e.NoChange=0]="NoChange",e[e.Protect=1]="Protect",e[e.Unprotect=2]="Unprotect",e[e.UnprotectAll=3]="UnprotectAll",e}({}),H.DFUChangeRestriction=function(e){return e[e.NoChange=0]="NoChange",e[e.Restrict=1]="Restrict",e[e.Unrestricted=2]="Unrestricted",e}({}),H.DFUDefFileFormat=function(e){return e.xml="xml",e.def="def",e}({}),H.FileAccessRole=function(e){return e.Token="Token",e.Engine="Engine",e.External="External",e}({}),H.SecAccessType=function(e){return e.None="None",e.Access="Access",e.Read="Read",e.Write="Write",e.Full="Full",e}({}),H.DFUFileType=function(e){return e.Flat="Flat",e.Index="Index",e.Xml="Xml",e.Csv="Csv",e.Json="Json",e.IndexLocal="IndexLocal",e.IndexPartitioned="IndexPartitioned",e.Unset="Unset",e}({});var X=class extends T{constructor(e){super(e,"WsDfu","1.67")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"AddResponse")}AddRemote(e){return this._connection.send("AddRemote",e,"json",!1,void 0,"AddRemoteResponse")}AddtoSuperfile(e){return this._connection.send("AddtoSuperfile",e,"json",!1,void 0,"AddtoSuperfileResponse")}DFUArrayAction(e){return this._connection.send("DFUArrayAction",e,"json",!1,void 0,"DFUArrayActionResponse")}DFUBrowseData(e){return this._connection.send("DFUBrowseData",e,"json",!1,void 0,"DFUBrowseDataResponse")}DFUDefFile(e){return this._connection.send("DFUDefFile",e,"json",!1,void 0,"DFUDefFileResponse")}DFUFileAccess(e){return this._connection.send("DFUFileAccess",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileAccessV2(e){return this._connection.send("DFUFileAccessV2",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileCreate(e){return this._connection.send("DFUFileCreate",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFileCreateV2(e){return this._connection.send("DFUFileCreateV2",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFilePublish(e){return this._connection.send("DFUFilePublish",e,"json",!1,void 0,"DFUFilePublishResponse")}DFUFileView(e){return this._connection.send("DFUFileView",e,"json",!1,void 0,"DFUFileViewResponse")}DFUGetDataColumns(e){return this._connection.send("DFUGetDataColumns",e,"json",!1,void 0,"DFUGetDataColumnsResponse")}DFUGetFileMetaData(e){return this._connection.send("DFUGetFileMetaData",e,"json",!1,void 0,"DFUGetFileMetaDataResponse")}DFUGetMetaInquiry(e){return this._connection.send("DFUGetMetaInquiry",e,"json",!1,void 0,"DFUMetaInquiryResponse")}DFUInfo(e){return this._connection.send("DFUInfo",e,"json",!1,void 0,"DFUInfoResponse")}DFUQuery(e){return this._connection.send("DFUQuery",e,"json",!1,void 0,"DFUQueryResponse")}DFURecordTypeInfo(e){return this._connection.send("DFURecordTypeInfo",e,"json",!1,void 0,"DFURecordTypeInfoResponse")}DFUSearch(e){return this._connection.send("DFUSearch",e,"json",!1,void 0,"DFUSearchResponse")}DFUSearchData(e){return this._connection.send("DFUSearchData",e,"json",!1,void 0,"DFUSearchDataResponse")}DFUSpace(e){return this._connection.send("DFUSpace",e,"json",!1,void 0,"DFUSpaceResponse")}EclRecordTypeInfo(e){return this._connection.send("EclRecordTypeInfo",e,"json",!1,void 0,"EclRecordTypeInfoResponse")}EraseHistory(e){return this._connection.send("EraseHistory",e,"json",!1,void 0,"EraseHistoryResponse")}ListHistory(e){return this._connection.send("ListHistory",e,"json",!1,void 0,"ListHistoryResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDfuPingResponse")}Savexml(e){return this._connection.send("Savexml",e,"json",!1,void 0,"SavexmlResponse")}SuperfileAction(e){return this._connection.send("SuperfileAction",e,"json",!1,void 0,"SuperfileActionResponse")}SuperfileList(e){return this._connection.send("SuperfileList",e,"json",!1,void 0,"SuperfileListResponse")}};const $=B.DFUArrayActions,J=B.DFUDefFileFormat,q=B.DFUChangeProtection,z=B.DFUChangeRestriction;var Y=class extends X{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){const t=[],n=[];return await Promise.all(e.map(e=>this.DFUInfo({Cluster:e.NodeGroup,Name:e.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(e=>{for(const n of e?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(n);for(const t of e?.FileDetail?.subfiles?.Item??[])n.push(t)}))),n.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}},K=class extends T{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e,"json",!1,void 0,"DFUXRefArrayActionResponse")}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e,"json",!1,void 0,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,void 0,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,void 0,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,"json",!1,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,"json",!1,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,void 0,"DFUXRefUnusedFilesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDFUXRefPingResponse")}};function Z(e,t){const 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:ee(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){const n=typeof t.Item[0];if("string"===n||"number"===n)return{id:e,type:"set",fieldType:n};throw new Error("Unknown field type")}return{id:e,type:"object",fields:te(t)}}default:throw new Error("Unknown field type")}}function ee(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);const t=[];for(const n in e)t.push(Z(n,e[n]));return t}function te(e){const t={};for(const n in e)t[n]=Z(n,e[n]);return t}var ne=class extends T{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,t){return this._connection.send(`example/request/query/${e}/${t}/json`,{},"text").then(e=>{const t=JSON.parse(e);for(const n in t)return t[n];return{}}).then(ee)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(e=>{const t=JSON.parse(e);for(const n in t)return t[n].Results;return{}}).then(e=>{const t={};for(const n in e)t[n]=ee(e[n]);return t})}submit(e,t,n){const s=`submit/query/${e}/${t}`;return this._connection.send(s,n,"json2").then(e=>{if(e.Results&&e.Results.Exception)throw new W(s,n,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})}},se=class extends T{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e,"json",!1,void 0,"GetConfigDetailsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_elkPingResponse")}};let re;var ie;(ie=re||(re={})).LogColumnType=function(e){return e.global="global",e.workunits="workunits",e.components="components",e.audience="audience",e.class="class",e.instance="instance",e.node="node",e.message="message",e.logid="logid",e.processid="processid",e.threadid="threadid",e.timestamp="timestamp",e.pod="pod",e.traceid="traceid",e.spanid="spanid",e}({}),ie.LogColumnValueType=function(e){return e.string="string",e.numeric="numeric",e.datetime="datetime",e.enum="enum",e.epoch="epoch",e}({}),ie.LogAccessType=function(e){return e[e.All=0]="All",e[e.ByJobID=1]="ByJobID",e[e.ByComponent=2]="ByComponent",e[e.ByLogType=3]="ByLogType",e[e.ByTargetAudience=4]="ByTargetAudience",e[e.BySourceInstance=5]="BySourceInstance",e[e.BySourceNode=6]="BySourceNode",e[e.ByFieldName=7]="ByFieldName",e[e.ByPod=8]="ByPod",e[e.ByTraceID=9]="ByTraceID",e[e.BySpanID=10]="BySpanID",e}({}),ie.LogAccessStatusCode=function(e){return e[e.Success=0]="Success",e[e.Warning=1]="Warning",e[e.Fail=2]="Fail",e}({}),ie.LogAccessFilterOperator=function(e){return e[e.NONE=0]="NONE",e[e.AND=1]="AND",e[e.OR=2]="OR",e}({}),ie.LogSelectColumnMode=function(e){return e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM",e}({}),ie.SortColumType=function(e){return e[e.ByDate=0]="ByDate",e[e.ByJobID=1]="ByJobID",e[e.ByComponent=2]="ByComponent",e[e.ByLogType=3]="ByLogType",e[e.ByTargetAudience=4]="ByTargetAudience",e[e.BySourceInstance=5]="BySourceInstance",e[e.BySourceNode=6]="BySourceNode",e[e.ByFieldName=7]="ByFieldName",e[e.ByPod=8]="ByPod",e[e.ByTraceID=9]="ByTraceID",e[e.BySpanID=10]="BySpanID",e}({}),ie.SortDirection=function(e){return e[e.ASC=0]="ASC",e[e.DSC=1]="DSC",e}({});var oe=class extends T{constructor(e){super(e,"ws_logaccess","1.08")}GetHealthReport(e){return this._connection.send("GetHealthReport",e,"json",!1,void 0,"GetHealthReportResponse")}GetLogAccessInfo(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")}GetLogs(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")}},ce=(0,t.scopedLogger)("@hpcc-js/comms/services/wsLogaccess.ts");let ue=function(e){return e.Disaster="DIS",e.Error="ERR",e.Warning="WRN",e.Information="INF",e.Progress="PRO",e.Metric="MET",e}({}),ae=function(e){return e.Operator="OPR",e.User="USR",e.Programmer="PRO",e.Audit="ADT",e}({});function he(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var le,de;1===(le=he).length&&(de=le,le=function(e,t){return he(de(e),t)});function pe(e){return null===e?NaN:+e}var ge=Array.prototype;ge.slice,ge.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);function me(e,t){var n,s,r=e.length,i=-1;if(null==t){for(;++i<r;)if(null!=(n=e[i])&&n>=n)for(s=n;++i<r;)null!=(n=e[i])&&n>s&&(s=n)}else for(;++i<r;)if(null!=(n=t(e[i],i,e))&&n>=n)for(s=n;++i<r;)null!=(n=t(e[i],i,e))&&n>s&&(s=n);return s}function fe(e,t){var n,s=e.length,r=s,i=-1,o=0;if(null==t)for(;++i<s;)isNaN(n=pe(e[i]))?--r:o+=n;else for(;++i<s;)isNaN(n=pe(t(e[i],i,e)))?--r:o+=n;if(r)return o/r}let Se;var Ue;(Ue=Se||(Se={})).ThresholdType=function(e){return e[e.THRESHOLD_PERCENTAGE=0]="THRESHOLD_PERCENTAGE",e[e.THRESHOLD_MB=1]="THRESHOLD_MB",e}({}),Ue.TpMachineType=function(e){return e.ALLNODES="ALLNODES",e.THORMACHINES="THORMACHINES",e.HOLEMACHINES="HOLEMACHINES",e.ROXIEMACHINES="ROXIEMACHINES",e.MACHINES="MACHINES",e.AVAILABLEMACHINES="AVAILABLEMACHINES",e.DROPZONE="DROPZONE",e.STANDBYNNODE="STANDBYNNODE",e.THORSPARENODES="THORSPARENODES",e.HOLESTANDBYNODES="HOLESTANDBYNODES",e}({});var _e=class extends T{constructor(e){super(e,"ws_machine","1.19")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e,"json",!1,void 0,"GetComponentStatusResponse")}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e,"json",!1,void 0,"GetComponentUsageResponse")}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e,"json",!1,void 0,"GetMachineInfoResponse")}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e,"json",!1,void 0,"GetMachineInfoResponseEx")}GetMetrics(e){return this._connection.send("GetMetrics",e,"json",!1,void 0,"MetricsResponse")}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e,"json",!1,void 0,"GetNodeGroupUsageResponse")}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e,"json",!1,void 0,"GetTargetClusterInfoResponse")}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e,"json",!1,void 0,"GetTargetClusterUsageResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_machinePingResponse")}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e,"json",!1,void 0,"UpdateComponentStatusResponse")}},ye=class extends _e{GetTargetClusterUsageEx(e,n=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:n}).then(e=>(0,t.exists)("TargetClusterUsages.TargetClusterUsage",e)?e.TargetClusterUsages.TargetClusterUsage:[]).then(e=>e.filter(e=>!!e.ComponentUsages).map(e=>{const t=e.ComponentUsages.ComponentUsage.map(e=>{const t=(e.MachineUsages&&e.MachineUsages.MachineUsage?e.MachineUsages.MachineUsage:[]).map(e=>{const t=e.DiskUsages&&e.DiskUsages.DiskUsage?e.DiskUsages.DiskUsage.map(e=>({...e,InUse:1024*e.InUse,Total:1024*(e.InUse+e.Available),PercentUsed:100-e.PercentAvailable})):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:fe(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed),max:me(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed)}});return{Type:e.Type,Name:e.Name,Description:e.Description,MachineUsages:t,MachineUsagesDescription:t.reduce((e,t)=>e+(t.Description||""),""),mean:fe(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:me(t.filter(e=>!isNaN(e.max)),e=>e.max)}});return{Name:e.Name,Description:e.Description,ComponentUsages:t,ComponentUsagesDescription:t.reduce((e,t)=>e+(t.MachineUsagesDescription||""),""),mean:fe(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:me(t.filter(e=>!isNaN(e.max)),e=>e.max)}}))}},ve=class extends T{constructor(e){super(e,"WsPackageProcess","1.07")}ActivatePackage(e){return this._connection.send("ActivatePackage",e,"json",!1,void 0,"ActivatePackageResponse")}AddPackage(e){return this._connection.send("AddPackage",e,"json",!1,void 0,"AddPackageResponse")}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e,"json",!1,void 0,"AddPartToPackageMapResponse")}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e,"json",!1,void 0,"CopyPackageMapResponse")}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e,"json",!1,void 0,"DeActivatePackageResponse")}DeletePackage(e){return this._connection.send("DeletePackage",e,"json",!1,void 0,"DeletePackageResponse")}Echo(e){return this._connection.send("Echo",e,"json",!1,void 0,"EchoResponse")}GetPackage(e){return this._connection.send("GetPackage",e,"json",!1,void 0,"GetPackageResponse")}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e,"json",!1,void 0,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,void 0,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e,"json",!1,void 0,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e,"json",!1,void 0,"GetQueryFileMappingResponse")}ListPackage(e){return this._connection.send("ListPackage",e,"json",!1,void 0,"ListPackageResponse")}ListPackages(e){return this._connection.send("ListPackages",e,"json",!1,void 0,"ListPackagesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,void 0,"RemovePartFromPackageMapResponse")}ValidatePackage(e){return this._connection.send("ValidatePackage",e,"json",!1,void 0,"ValidatePackageResponse")}},Re=class extends T{constructor(e){super(e,"WsResources","1.01")}Ping(e){return this._connection.send("Ping",e)}ServiceQuery(e){return this._connection.send("ServiceQuery",e)}WebLinksQuery(e){return this._connection.send("WebLinksQuery",e)}};let Ce;(Ce||(Ce={})).WUTypes=function(e){return e.ECL="ECL",e.DFU="DFU",e}({});var De=class extends T{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e){return this._connection.send("ArchiveWU",e,"json",!1,void 0,"ResultResponse")}GetVersion(e){return this._connection.send("GetVersion",e,"json",!1,void 0,"ResultResponse")}ListWU(e){return this._connection.send("ListWU",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSSashaPingResponse")}RestoreWU(e){return this._connection.send("RestoreWU",e,"json",!1,void 0,"ResultResponse")}};let be;var Fe;(Fe=be||(be={})).LockModes=function(e){return e.ALL="ALL",e.READ="READ",e.WRITE="WRITE",e.HOLD="HOLD",e.SUB="SUB",e}({}),Fe.RoxieControlCmdType=function(e){return e.Attach="Attach",e.Detach="Detach",e.State="State",e.Reload="Reload",e.ReloadRetry="ReloadRetry",e.MemLock="MemLock",e.MemUnlock="MemUnlock",e.GetMemLocked="GetMemLocked",e}({});var We=class extends T{constructor(e){super(e,"WsSMC","1.28")}Activity(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")}BrowseResources(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")}ClearQueue(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")}GetBuildInfo(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")}GetGlobalMetrics(e){return this._connection.send("GetGlobalMetrics",e,"json",!1,void 0,"GetGlobalMetricsResponse")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}},Ae=class extends We{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(e=>({Running:{ActiveWorkunit:[]},...e}))}},Te=class extends T{constructor(e){super(e,"wsstore","1.02")}CreateStore(e){return this._connection.send("CreateStore",e,"json",!1,void 0,"CreateStoreResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"DeleteResponse")}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e,"json",!1,void 0,"DeleteNamespaceResponse")}Fetch(e){return this._connection.send("Fetch",e,"json",!1,void 0,"FetchResponse")}FetchAll(e){return this._connection.send("FetchAll",e,"json",!1,void 0,"FetchAllResponse")}FetchKeyMetadata(e){return this._connection.send("FetchKeyMetadata",e,"json",!1,void 0,"FetchKeyMDResponse")}ListKeys(e){return this._connection.send("ListKeys",e,"json",!1,void 0,"ListKeysResponse")}ListNamespaces(e){return this._connection.send("ListNamespaces",e,"json",!1,void 0,"ListNamespacesResponse")}ListStores(e){return this._connection.send("ListStores",e,"json",!1,void 0,"ListStoresResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"wsstorePingResponse")}Set(e){return this._connection.send("Set",e,"json",!1,void 0,"SetResponse")}},we=class extends Te{Delete(e){return super.Delete(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>-1===e.Code))return{Exceptions:void 0,Success:!0};throw e})}Fetch(e){return super.Fetch(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>-1===e.Code))return{Exceptions:void 0,Value:void 0};throw e})}};let Pe;var xe;(xe=Pe||(Pe={})).TpConfigResponseFormat=function(e){return e.XML="XML",e.YAML="YAML",e}({}),xe.RoxieQueueFilter=function(e){return e.All="All",e.QueriesOnly="QueriesOnly",e.WorkunitsOnly="WorkunitsOnly",e}({}),xe.TpMachineType=function(e){return e.ALLNODES="ALLNODES",e.THORMACHINES="THORMACHINES",e.HOLEMACHINES="HOLEMACHINES",e.ROXIEMACHINES="ROXIEMACHINES",e.MACHINES="MACHINES",e.AVAILABLEMACHINES="AVAILABLEMACHINES",e.DROPZONE="DROPZONE",e.STANDBYNNODE="STANDBYNNODE",e.THORSPARENODES="THORSPARENODES",e.HOLESTANDBYNODES="HOLESTANDBYNODES",e}({});var Ee=class extends T{constructor(e){super(e,"WsTopology","1.33")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsTopologyPingResponse")}SystemLog(e){return this._connection.send("SystemLog",e,"json",!1,void 0,"SystemLogResponse")}TpClusterInfo(e){return this._connection.send("TpClusterInfo",e,"json",!1,void 0,"TpClusterInfoResponse")}TpClusterQuery(e){return this._connection.send("TpClusterQuery",e,"json",!1,void 0,"TpClusterQueryResponse")}TpComponentConfiguration(e){return this._connection.send("TpComponentConfiguration",e,"json",!1,void 0,"TpComponentConfigurationResponse")}TpConfiguredComponents(e){return this._connection.send("TpConfiguredComponents",e,"json",!1,void 0,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e){return this._connection.send("TpDropZoneQuery",e,"json",!1,void 0,"TpDropZoneQueryResponse")}TpGetComponentFile(e){return this._connection.send("TpGetComponentFile",e,"json",!1,void 0,"TpGetComponentFileResponse")}TpGetServicePlugins(e){return this._connection.send("TpGetServicePlugins",e,"json",!1,void 0,"TpGetServicePluginsResponse")}TpGroupQuery(e){return this._connection.send("TpGroupQuery",e,"json",!1,void 0,"TpGroupQueryResponse")}TpListLogFiles(e){return this._connection.send("TpListLogFiles",e,"json",!1,void 0,"TpListLogFilesResponse")}TpListTargetClusters(e){return this._connection.send("TpListTargetClusters",e,"json",!1,void 0,"TpListTargetClustersResponse")}TpLogFile(e){return this._connection.send("TpLogFile",e,"json",!1,void 0,"TpLogFileResponse")}TpLogFileDisplay(e){return this._connection.send("TpLogFileDisplay",e,"json",!1,void 0,"TpLogFileResponse")}TpLogicalClusterQuery(e){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,void 0,"TpLogicalClusterQueryResponse")}TpMachineInfo(e){return this._connection.send("TpMachineInfo",e,"json",!1,void 0,"TpMachineInfoResponse")}TpMachineQuery(e){return this._connection.send("TpMachineQuery",e,"json",!1,void 0,"TpMachineQueryResponse")}TpServiceQuery(e){return this._connection.send("TpServiceQuery",e,"json",!1,void 0,"TpServiceQueryResponse")}TpSetMachineStatus(e){return this._connection.send("TpSetMachineStatus",e,"json",!1,void 0,"TpSetMachineStatusResponse")}TpSwapNode(e){return this._connection.send("TpSwapNode",e,"json",!1,void 0,"TpSwapNodeResponse")}TpTargetClusterQuery(e){return this._connection.send("TpTargetClusterQuery",e,"json",!1,void 0,"TpTargetClusterQueryResponse")}TpThorStatus(e){return this._connection.send("TpThorStatus",e,"json",!1,void 0,"TpThorStatusResponse")}TpXMLFile(e){return this._connection.send("TpXMLFile",e,"json",!1,void 0,"TpXMLFileResponse")}},Le=class extends Ee{connectionOptions(){return this._connection.opts()}protocol(){return this._connection.opts().baseUrl.split("//")[0]}ip(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]}DefaultTpLogicalClusterQuery(e={}){return this.TpLogicalClusterQuery(e).then(e=>{if(e.default)return e.default;let t,n;return e.TpLogicalClusters.TpLogicalCluster.some((e,s)=>(0===s&&(n=e),"hthor"===e.Type&&(t=e,!0))),t||n})}};let Ne;var je;(je=Ne||(Ne={})).ECLWUActions=function(e){return e.Abort="Abort",e.Delete="Delete",e.Deschedule="Deschedule",e.Reschedule="Reschedule",e.Pause="Pause",e.PauseNow="PauseNow",e.Protect="Protect",e.Unprotect="Unprotect",e.Restore="Restore",e.Resume="Resume",e.SetToFailed="SetToFailed",e.Archive="Archive",e}({}),je.LogSelectColumnMode=function(e){return e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM",e}({}),je.SortDirection=function(e){return e[e.ASC=0]="ASC",e[e.DSC=1]="DSC",e}({}),je.LogEventClass=function(e){return e.ALL="ALL",e.DIS="DIS",e.ERR="ERR",e.WRN="WRN",e.INF="INF",e.PRO="PRO",e.MET="MET",e.EVT="EVT",e}({}),je.WUDetailsAttrValueType=function(e){return e.Single="Single",e.List="List",e.Multi="Multi",e}({}),je.EclDefinitionActions=function(e){return e.SyntaxCheck="SyntaxCheck",e.Deploy="Deploy",e.Publish="Publish",e}({}),je.ErrorMessageFormat=function(e){return e.xml="xml",e.json="json",e.text="text",e}({}),je.LogAccessLogFormat=function(e){return e[e.XML=0]="XML",e[e.JSON=1]="JSON",e[e.CSV=2]="CSV",e}({}),je.WUExceptionSeverity=function(e){return e.info="info",e.warning="warning",e.error="error",e.alert="alert",e}({}),je.WUQueryFilterSuspendedType=function(e){return e.Allqueries="All queries",e.Notsuspended="Not suspended",e.Suspended="Suspended",e.Suspendedbyuser="Suspended by user",e.Suspendedbyfirstnode="Suspended by first node",e.Suspendedbyanynode="Suspended by any node",e}({}),je.WUQuerySetFilterType=function(e){return e.All="All",e.Id="Id",e.Name="Name",e.Alias="Alias",e.Status="Status",e}({}),je.WUProtectFilter=function(e){return e.All="All",e.Protected="Protected",e.NotProtected="NotProtected",e}({}),je.QuerySetAliasActionTypes=function(e){return e.Deactivate="Deactivate",e}({}),je.QuerysetImportActivation=function(e){return e.None="None",e.ActivateImportedActive="ActivateImportedActive",e}({}),je.QuerySetQueryActionTypes=function(e){return e.Suspend="Suspend",e.Unsuspend="Unsuspend",e.ToggleSuspend="ToggleSuspend",e.Activate="Activate",e.Delete="Delete",e.DeleteQueriesAndWUs="DeleteQueriesAndWUs",e.RemoveAllAliases="RemoveAllAliases",e.ResetQueryStats="ResetQueryStats",e}({}),je.WUQueryActivationMode=function(e){return e[e.DoNotActivateQuery=0]="DoNotActivateQuery",e[e.ActivateQuery=1]="ActivateQuery",e[e.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",e[e.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious",e}({});var Ie=class extends T{constructor(e){super(e,"WsWorkunits","2.02")}GVCAjaxGraph(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")}WUAbort(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")}WUAction(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")}WUAddLocalFileToWorkunit(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")}WUCDebug(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")}WUCheckFeatures(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")}WUCompileECL(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")}WUCopyLogicalFiles(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")}WUCreate(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")}WUCreateAndUpdate(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUCreateZAPInfo(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")}WUDelete(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")}WUDeployWorkunit(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")}WUDetails(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")}WUDetailsMeta(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")}WUEclDefinitionAction(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")}WUExport(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")}WUFile(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")}WUFullResult(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")}WUGVCGraphInfo(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")}WUGetGraph(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")}WUGetPlugins(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")}WUGetStats(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")}WUGetThorJobList(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")}WUGetThorJobQueue(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")}WUGraphInfo(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")}WUGraphTiming(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")}WUInfo(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")}WUInfoDetails(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")}WUJobList(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")}WULightWeightQuery(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")}WUListArchiveFiles(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")}WUListQueries(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")}WUListQueriesUsingFile(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")}WUProtect(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")}WUPublishWorkunit(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")}WUPushEvent(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")}WUQuery(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")}WUQueryConfig(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")}WUQueryDetails(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryFiles(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")}WUQueryGetGraph(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")}WUQuerysetExport(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")}WUQuerysetImport(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")}WUQuerysets(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")}WURecreateQuery(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")}WUResubmit(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")}WUResult(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")}WUResultBin(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")}WUResultSummary(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")}WUResultView(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")}WURun(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")}WUSchedule(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")}WUShowScheduled(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")}WUSubmit(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")}WUSyntaxCheckECL(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUUpdateQueryEntry(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")}WUWaitComplete(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")}};let Me,ke=function(e){return 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}({});function Ge(e){return"string"==typeof e.Name}(Me||(Me={})).Action=function(e){return e[e.Unknown=0]="Unknown",e[e.Compile=1]="Compile",e[e.Check=2]="Check",e[e.Run=3]="Run",e[e.ExecuteExisting=4]="ExecuteExisting",e[e.Pause=5]="Pause",e[e.PauseNow=6]="PauseNow",e[e.Resume=7]="Resume",e[e.Debug=8]="Debug",e[e.__size=9]="__size",e}({});var Ve=class extends Ie{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},n){return this._connection.send("WUQuery",e,"json",!1,n).then(e=>(0,t.deepMixin)({Workunits:{ECLWorkunit:[]}},e))}WUInfo(e){const 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:!1,IncludeServiceNames:!1,SuppressResultSchemas:!0,...e};return super.WUInfo(t)}WUCreate(){return super.WUCreate({})}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!0)}WUResubmit(e){return this._connection.toESPStringArray(e,"Wuids"),super.WUResubmit(e)}WUAction(e){return e.ActionType=e.WUActionType,super.WUAction(e)}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t)}WUFileEx(e){return this._connection.send("WUFile",e,"text")}_WUDetailsMetaPromise;WUDetailsMeta(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=super.WUDetailsMeta(e)),this._WUDetailsMetaPromise}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(e=>{const n=(0,t.xml2json)(e.Result).children();return n.length?n[0]:null})}},Qe=class extends Ie{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};function Oe(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,s=e.slice(0,n);return[s.length>1?s[0]+s.slice(2):s,+e.slice(n+1)]}var Be,He=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xe(e){if(!(t=He.exec(e)))throw new Error("invalid format: "+e);var t;return new $e({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function $e(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Je(e,t){var n=Oe(e,t);if(!n)return e+"";var s=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+s:s.length>r+1?s.slice(0,r+1)+"."+s.slice(r+1):s+new Array(r-s.length+2).join("0")}Xe.prototype=$e.prototype,$e.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var qe={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return Je(100*e,t)},r:Je,s:function(e,t){var n=Oe(e,t);if(!n)return e+"";var s=n[0],r=n[1],i=r-(Be=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=s.length;return i===o?s:i>o?s+new Array(i-o+1).join("0"):i>0?s.slice(0,i)+"."+s.slice(i):"0."+new Array(1-i).join("0")+Oe(e,Math.max(0,t+i-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function ze(e){return e}var Ye,Ke,Ze=Array.prototype.map,et=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tt(e){var t,n,s=void 0===e.grouping||void 0===e.thousands?ze:(t=Ze.call(e.grouping,Number),n=e.thousands+"",function(e,s){for(var r=e.length,i=[],o=0,c=t[0],u=0;r>0&&c>0&&(u+c+1>s&&(c=Math.max(1,s-u)),i.push(e.substring(r-=c,r+c)),!((u+=c+1)>s));)c=t[o=(o+1)%t.length];return i.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",c=void 0===e.numerals?ze:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(Ze.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",a=void 0===e.minus?"-":e.minus+"",h=void 0===e.nan?"NaN":e.nan+"";function l(e){var t=(e=Xe(e)).fill,n=e.align,l=e.sign,d=e.symbol,p=e.zero,g=e.width,m=e.comma,f=e.precision,S=e.trim,U=e.type;"n"===U?(m=!0,U="g"):qe[U]||(void 0===f&&(f=12),S=!0,U="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var _="$"===d?r:"#"===d&&/[boxX]/.test(U)?"0"+U.toLowerCase():"",y="$"===d?i:/[%p]/.test(U)?u:"",v=qe[U],R=/[defgprs%]/.test(U);function C(e){var r,i,u,d=_,C=y;if("c"===U)C=v(e)+C,e="";else{var D=(e=+e)<0||1/e<0;if(e=isNaN(e)?h:v(Math.abs(e),f),S&&(e=function(e){e:for(var t,n=e.length,s=1,r=-1;s<n;++s)switch(e[s]){case".":r=t=s;break;case"0":0===r&&(r=s),t=s;break;default:if(!+e[s])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),D&&0===+e&&"+"!==l&&(D=!1),d=(D?"("===l?l:a:"-"===l||"("===l?"":l)+d,C=("s"===U?et[8+Be/3]:"")+C+(D&&"("===l?")":""),R)for(r=-1,i=e.length;++r<i;)if(48>(u=e.charCodeAt(r))||u>57){C=(46===u?o+e.slice(r+1):e.slice(r))+C,e=e.slice(0,r);break}}m&&!p&&(e=s(e,1/0));var b=d.length+e.length+C.length,F=b<g?new Array(g-b+1).join(t):"";switch(m&&p&&(e=s(F+e,F.length?g-C.length:1/0),F=""),n){case"<":e=d+e+C+F;break;case"=":e=d+F+e+C;break;case"^":e=F.slice(0,b=F.length>>1)+d+e+C+F.slice(b);break;default:e=F+d+e+C}return c(e)}return f=void 0===f?6:/[gprs]/.test(U)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),C.toString=function(){return e+""},C}return{format:l,formatPrefix:function(e,t){var n,s=l(((e=Xe(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor((n=t,((n=Oe(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-r),o=et[8+r/3];return function(e){return s(i*e)+o}}}}Ye=tt({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Ke=Ye.format,Ye.formatPrefix;var nt=new Date,st=new Date;function rt(e,t,n,s){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=function(t){return e(t=new Date(+t)),t},r.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},r.round=function(e){var t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},r.range=function(n,s,i){var o,c=[];if(n=r.ceil(n),i=null==i?1:Math.floor(i),!(n<s&&i>0))return c;do{c.push(o=new Date(+n)),t(n,i),e(n)}while(o<n&&n<s);return c},r.filter=function(n){return rt(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,s){if(e>=e)if(s<0)for(;++s<=0;)for(;t(e,-1),!n(e););else for(;--s>=0;)for(;t(e,1),!n(e););})},n&&(r.count=function(t,s){return nt.setTime(+t),st.setTime(+s),e(nt),e(st),Math.floor(n(nt,st))},r.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(s?function(t){return s(t)%e===0}:function(t){return r.count(0,t)%e===0}):r:null}),r}var it=864e5,ot=6048e5,ct=rt(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()))/it},function(e){return e.getDate()-1}),ut=ct;ct.range;function at(e){return rt(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()))/ot})}var ht=at(0),lt=at(1),dt=at(2),pt=at(3),gt=at(4),mt=at(5),ft=at(6),St=(ht.range,lt.range,dt.range,pt.range,gt.range,mt.range,ft.range,rt(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()}));St.every=function(e){return isFinite(e=Math.floor(e))&&e>0?rt(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 Ut=St,_t=(St.range,rt(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/it},function(e){return e.getUTCDate()-1})),yt=_t;_t.range;function vt(e){return rt(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)/ot})}var Rt=vt(0),Ct=vt(1),Dt=vt(2),bt=vt(3),Ft=vt(4),Wt=vt(5),At=vt(6),Tt=(Rt.range,Ct.range,Dt.range,bt.range,Ft.range,Wt.range,At.range,rt(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()}));Tt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?rt(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 wt=Tt;Tt.range;function Pt(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 xt(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 Et(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var Lt,Nt,jt,It={"-":"",_:" ",0:"0"},Mt=/^\s*\d+/,kt=/^%/,Gt=/[\\^$*+?|[\]().{}]/g;function Vt(e,t,n){var s=e<0?"-":"",r=(s?-e:e)+"",i=r.length;return s+(i<n?new Array(n-i+1).join(t)+r:r)}function Qt(e){return e.replace(Gt,"\\$&")}function Ot(e){return new RegExp("^(?:"+e.map(Qt).join("|")+")","i")}function Bt(e){for(var t={},n=-1,s=e.length;++n<s;)t[e[n].toLowerCase()]=n;return t}function Ht(e,t,n){var s=Mt.exec(t.slice(n,n+1));return s?(e.w=+s[0],n+s[0].length):-1}function Xt(e,t,n){var s=Mt.exec(t.slice(n,n+1));return s?(e.u=+s[0],n+s[0].length):-1}function $t(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.U=+s[0],n+s[0].length):-1}function Jt(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.V=+s[0],n+s[0].length):-1}function qt(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.W=+s[0],n+s[0].length):-1}function zt(e,t,n){var s=Mt.exec(t.slice(n,n+4));return s?(e.y=+s[0],n+s[0].length):-1}function Yt(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.y=+s[0]+(+s[0]>68?1900:2e3),n+s[0].length):-1}function Kt(e,t,n){var s=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return s?(e.Z=s[1]?0:-(s[2]+(s[3]||"00")),n+s[0].length):-1}function Zt(e,t,n){var s=Mt.exec(t.slice(n,n+1));return s?(e.q=3*s[0]-3,n+s[0].length):-1}function en(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.m=s[0]-1,n+s[0].length):-1}function tn(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.d=+s[0],n+s[0].length):-1}function nn(e,t,n){var s=Mt.exec(t.slice(n,n+3));return s?(e.m=0,e.d=+s[0],n+s[0].length):-1}function sn(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.H=+s[0],n+s[0].length):-1}function rn(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.M=+s[0],n+s[0].length):-1}function on(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.S=+s[0],n+s[0].length):-1}function cn(e,t,n){var s=Mt.exec(t.slice(n,n+3));return s?(e.L=+s[0],n+s[0].length):-1}function un(e,t,n){var s=Mt.exec(t.slice(n,n+6));return s?(e.L=Math.floor(s[0]/1e3),n+s[0].length):-1}function an(e,t,n){var s=kt.exec(t.slice(n,n+1));return s?n+s[0].length:-1}function hn(e,t,n){var s=Mt.exec(t.slice(n));return s?(e.Q=+s[0],n+s[0].length):-1}function ln(e,t,n){var s=Mt.exec(t.slice(n));return s?(e.s=+s[0],n+s[0].length):-1}function dn(e,t){return Vt(e.getDate(),t,2)}function pn(e,t){return Vt(e.getHours(),t,2)}function gn(e,t){return Vt(e.getHours()%12||12,t,2)}function mn(e,t){return Vt(1+ut.count(Ut(e),e),t,3)}function fn(e,t){return Vt(e.getMilliseconds(),t,3)}function Sn(e,t){return fn(e,t)+"000"}function Un(e,t){return Vt(e.getMonth()+1,t,2)}function _n(e,t){return Vt(e.getMinutes(),t,2)}function yn(e,t){return Vt(e.getSeconds(),t,2)}function vn(e){var t=e.getDay();return 0===t?7:t}function Rn(e,t){return Vt(ht.count(Ut(e)-1,e),t,2)}function Cn(e){var t=e.getDay();return t>=4||0===t?gt(e):gt.ceil(e)}function Dn(e,t){return e=Cn(e),Vt(gt.count(Ut(e),e)+(4===Ut(e).getDay()),t,2)}function bn(e){return e.getDay()}function Fn(e,t){return Vt(lt.count(Ut(e)-1,e),t,2)}function Wn(e,t){return Vt(e.getFullYear()%100,t,2)}function An(e,t){return Vt((e=Cn(e)).getFullYear()%100,t,2)}function Tn(e,t){return Vt(e.getFullYear()%1e4,t,4)}function wn(e,t){var n=e.getDay();return Vt((e=n>=4||0===n?gt(e):gt.ceil(e)).getFullYear()%1e4,t,4)}function Pn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Vt(t/60|0,"0",2)+Vt(t%60,"0",2)}function xn(e,t){return Vt(e.getUTCDate(),t,2)}function En(e,t){return Vt(e.getUTCHours(),t,2)}function Ln(e,t){return Vt(e.getUTCHours()%12||12,t,2)}function Nn(e,t){return Vt(1+yt.count(wt(e),e),t,3)}function jn(e,t){return Vt(e.getUTCMilliseconds(),t,3)}function In(e,t){return jn(e,t)+"000"}function Mn(e,t){return Vt(e.getUTCMonth()+1,t,2)}function kn(e,t){return Vt(e.getUTCMinutes(),t,2)}function Gn(e,t){return Vt(e.getUTCSeconds(),t,2)}function Vn(e){var t=e.getUTCDay();return 0===t?7:t}function Qn(e,t){return Vt(Rt.count(wt(e)-1,e),t,2)}function On(e){var t=e.getUTCDay();return t>=4||0===t?Ft(e):Ft.ceil(e)}function Bn(e,t){return e=On(e),Vt(Ft.count(wt(e),e)+(4===wt(e).getUTCDay()),t,2)}function Hn(e){return e.getUTCDay()}function Xn(e,t){return Vt(Ct.count(wt(e)-1,e),t,2)}function $n(e,t){return Vt(e.getUTCFullYear()%100,t,2)}function Jn(e,t){return Vt((e=On(e)).getUTCFullYear()%100,t,2)}function qn(e,t){return Vt(e.getUTCFullYear()%1e4,t,4)}function zn(e,t){var n=e.getUTCDay();return Vt((e=n>=4||0===n?Ft(e):Ft.ceil(e)).getUTCFullYear()%1e4,t,4)}function Yn(){return"+0000"}function Kn(){return"%"}function Zn(e){return+e}function es(e){return Math.floor(+e/1e3)}!function(e){Lt=function(e){var t=e.dateTime,n=e.date,s=e.time,r=e.periods,i=e.days,o=e.shortDays,c=e.months,u=e.shortMonths,a=Ot(r),h=Bt(r),l=Ot(i),d=Bt(i),p=Ot(o),g=Bt(o),m=Ot(c),f=Bt(c),S=Ot(u),U=Bt(u),_={a:function(e){return o[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return c[e.getMonth()]},c:null,d:dn,e:dn,f:Sn,g:An,G:wn,H:pn,I:gn,j:mn,L:fn,m:Un,M:_n,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Zn,s:es,S:yn,u:vn,U:Rn,V:Dn,w:bn,W:Fn,x:null,X:null,y:Wn,Y:Tn,Z:Pn,"%":Kn},y={a:function(e){return o[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return c[e.getUTCMonth()]},c:null,d:xn,e:xn,f:In,g:Jn,G:zn,H:En,I:Ln,j:Nn,L:jn,m:Mn,M:kn,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Zn,s:es,S:Gn,u:Vn,U:Qn,V:Bn,w:Hn,W:Xn,x:null,X:null,y:$n,Y:qn,Z:Yn,"%":Kn},v={a:function(e,t,n){var s=p.exec(t.slice(n));return s?(e.w=g[s[0].toLowerCase()],n+s[0].length):-1},A:function(e,t,n){var s=l.exec(t.slice(n));return s?(e.w=d[s[0].toLowerCase()],n+s[0].length):-1},b:function(e,t,n){var s=S.exec(t.slice(n));return s?(e.m=U[s[0].toLowerCase()],n+s[0].length):-1},B:function(e,t,n){var s=m.exec(t.slice(n));return s?(e.m=f[s[0].toLowerCase()],n+s[0].length):-1},c:function(e,n,s){return D(e,t,n,s)},d:tn,e:tn,f:un,g:Yt,G:zt,H:sn,I:sn,j:nn,L:cn,m:en,M:rn,p:function(e,t,n){var s=a.exec(t.slice(n));return s?(e.p=h[s[0].toLowerCase()],n+s[0].length):-1},q:Zt,Q:hn,s:ln,S:on,u:Xt,U:$t,V:Jt,w:Ht,W:qt,x:function(e,t,s){return D(e,n,t,s)},X:function(e,t,n){return D(e,s,t,n)},y:Yt,Y:zt,Z:Kt,"%":an};function R(e,t){return function(n){var s,r,i,o=[],c=-1,u=0,a=e.length;for(n instanceof Date||(n=new Date(+n));++c<a;)37===e.charCodeAt(c)&&(o.push(e.slice(u,c)),null!=(r=It[s=e.charAt(++c)])?s=e.charAt(++c):r="e"===s?" ":"0",(i=t[s])&&(s=i(n,r)),o.push(s),u=c+1);return o.push(e.slice(u,c)),o.join("")}}function C(e,t){return function(n){var s,r,i=Et(1900,void 0,1);if(D(i,e,n+="",0)!=n.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(r=(s=xt(Et(i.y,0,1))).getUTCDay(),s=r>4||0===r?Ct.ceil(s):Ct(s),s=yt.offset(s,7*(i.V-1)),i.y=s.getUTCFullYear(),i.m=s.getUTCMonth(),i.d=s.getUTCDate()+(i.w+6)%7):(r=(s=Pt(Et(i.y,0,1))).getDay(),s=r>4||0===r?lt.ceil(s):lt(s),s=ut.offset(s,7*(i.V-1)),i.y=s.getFullYear(),i.m=s.getMonth(),i.d=s.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),r="Z"in i?xt(Et(i.y,0,1)).getUTCDay():Pt(Et(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(r+5)%7:i.w+7*i.U-(r+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,xt(i)):Pt(i)}}function D(e,t,n,s){for(var r,i,o=0,c=t.length,u=n.length;o<c;){if(s>=u)return-1;if(37===(r=t.charCodeAt(o++))){if(r=t.charAt(o++),!(i=v[r in It?t.charAt(o++):r])||(s=i(e,n,s))<0)return-1}else if(r!=n.charCodeAt(s++))return-1}return s}return _.x=R(n,_),_.X=R(s,_),_.c=R(t,_),y.x=R(n,y),y.X=R(s,y),y.c=R(t,y),{format:function(e){var t=R(e+="",_);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=R(e+="",y);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}(e),Lt.format,Lt.parse,Nt=Lt.utcFormat,jt=Lt.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ts=class extends t.StateObject{wu;get properties(){return this.get()}get Name(){return this.get("Name")}get Label(){return this.get("Label")}get Type(){return this.get("Type")}get Complete(){return this.get("Complete")}get WhenStarted(){return this.get("WhenStarted")}get WhenFinished(){return this.get("WhenFinished")}get Time(){return this.get("Time")}get Running(){return this.get("Running")}get RunningId(){return this.get("RunningId")}get Failed(){return this.get("Failed")}constructor(e,t,n){super(),this.wu=e;let s=0;for(const r of n)if(r.GraphName===t.Name&&!r.HasSubGraphId){s=Math.round(1e3*r.Seconds)/1e3;break}this.set({Time:s,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(e=>gs(e)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(e=>gs(e))}},ns=class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Name]))}};function ss(e,t,n){(n=n||[]).push(e),t(e.name,e.$,e.children(),n),e.children().forEach(e=>{ss(e,t,n)}),n.pop()}function rs(e){const t={};return e.forEach(e=>{"att"===e.name&&(t[e.$.name]=e.$.value)}),t}var is=class extends t.Graph{},os=class extends t.Subgraph{},cs=class extends t.Vertex{},us=class extends t.Edge{};function as(e,t){const n={},s={},r={},i=new is(e=>e._.id),o=[i.root];return ss(t,(e,t,i,c)=>{const u=o[o.length-1];switch(e){case"graph":break;case"node":if(i.length&&i[0].children().length&&"graph"===i[0].children()[0].name){const e=u.createSubgraph(rs(i));o.push(e),n[t.id]=e}const e=u.createVertex(rs(i));s[t.id]=e;break;case"edge":const c=u.createEdge(s[t.source],s[t.target],rs(i));r[t.id]=c}}),i}var hs=class extends t.Graph{},ls=class extends t.Subgraph{},ds=class extends t.Vertex{},ps=class extends t.Edge{};function gs(e){const t={},n={},s={};let r;for(const o of e)switch(o.ScopeType){case"graph":r=new hs(e=>e._.Id,o),t[o.ScopeName]=r.root;break;case"subgraph":r||(r=new hs(e=>e._.Id,o),t[o.ScopeName]=r.root);const e=o.parentScope().split(":");let i=t[o.parentScope()];for(;e.length&&!i;)i=t[e.join(":")],e.pop();if(i){const e=i;t[o.ScopeName]=e.createSubgraph(o)}else console.warn(`Missing SG:Parent (${o.Id}): ${o.parentScope()}`);break;case"activity":const c=t[o.parentScope()];c?s[o.ScopeName]=c.createVertex(o):console.warn(`Missing A:Parent (${o.Id}): ${o.parentScope()}`);break;case"edge":n[o.ScopeName]=o;break;case"function":const u=s[o.parentScope()];u?u._.children().push(o):console.warn(`Missing F:Parent (${o.Id}): ${o.parentScope()}`)}for(const o in n){const e=n[o],s=t[e.parentScope()];if(s){const t=s;try{const n=r.vertex(e.attr("IdSource").RawValue),s=r.vertex(e.attr("IdTarget").RawValue);t.createEdge(n,s,e)}catch(i){console.warn(`Invalid Edge: ${o}`)}}else console.warn(`Missing E:Parent (${e.Id}): ${e.parentScope()}`)}return r}var ms=class extends t.StateObject{wu;get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}constructor(e,t){super(),this.wu=e;const n=t.split("\\").join("/"),s=n.split("/"),r="res/"+this.wu.Wuid+"/";let i="",o="";0===n.indexOf(r)&&(i=n.substr(r.length),o=s[s.length-1]),this.set({URL:t,DisplayName:o,DisplayPath:i})}},fs=class{e;constructor(e){this.e=e}fix(){delete this.e}},Ss=class extends fs{name;type;isSet=!1;attrs={};_children=[];constructor(e){super(e)}append(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let t=this._children.length-1;t>=0;--t){const e=this._children[t];"Row"===e.name&&void 0===e.type&&(this._children.push(...e._children),this._children.splice(t,1))}const e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return"All"===e.name&&void 0===e.type}setOfType(){const 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}}charWidth(){let 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:const t="0123456789",n=this.type.lastIndexOf("_"),s=n>0?n:this.type.length;let r=s-1;for(;r>=0&&-1!==t.indexOf(this.type.charAt(r));--r);r+1<s&&(e=parseInt(this.type.substring(r+1,s),10)),0===this.type.indexOf("data")&&(e*=2)}return e<this.name.length&&(e=this.name.length),e}},Us=class extends fs{name;type;maxLength;_restricition;_maxLength;constructor(e){super(e)}append(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e}}fix(){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,super.fix()}},_s=class{root;simpleTypes={};fields(){return this.root.children()}},ys=class extends t.SAXStackParser{schema=new _s;simpleType;simpleTypes={};xsdStack=new t.Stack;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":const t=new Ss(e);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(t):this.schema.root=t,this.xsdStack.push(t);break;case"xs:simpleType":this.simpleType=new Us(e)}}endXMLNode(e){switch(e.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":const t=this.xsdStack.top();for(const n in e.$)t.attrs[n]=e.$[n];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function vs(e){const t=new ys;return t.parse(e),t.schema}var Rs=class extends ys{_rootName;schema=new _s;simpleTypes={};xsdStack=new t.Stack;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":const t=new Ss(e);this.schema.root||this._rootName!==e.$.name||(this.schema.root=t),this.xsdStack.depth()&&this.xsdStack.top().append(t),this.xsdStack.push(t);break;case"xsd:simpleType":this.simpleType=new Us(e)}}endXMLNode(e){if("xsd:element"===e.name)this.xsdStack.pop().fix();super.endXMLNode(e)}};var Cs=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Ds=new Cs,bs=class Result extends t.StateObject{connection;_bypassCache=!1;get BaseUrl(){return this.connection.baseUrl}xsdSchema;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get ResultName(){return this.get("ResultName")}get ResultSequence(){return this.get("ResultSequence")}get LogicalFileName(){return this.get("LogicalFileName")}get Name(){return this.get("Name")}get Sequence(){return this.get("Sequence")}get Value(){return this.get("Value")}get Link(){return this.get("Link")}get FileName(){return this.get("FileName")}get IsSupplied(){return this.get("IsSupplied")}get ShowFileContent(){return this.get("ShowFileContent")}get Total(){return this.get("Total")}get ECLSchemas(){return this.get("ECLSchemas")}get NodeGroup(){return this.get("NodeGroup")}get ResultViews(){return this.get("ResultViews")}get XmlSchema(){return this.get("XmlSchema")}static attach(e,t,n,s){let r;return Array.isArray(s)?(r=Ds.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n.Name},()=>new Result(e,t,n,s)),r.set(n)):void 0===s&&("number"==typeof n?r=Ds.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+n},()=>new Result(e,t,n)):"string"==typeof n&&(r=Ds.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new Result(e,t,n)))),r}static attachLogicalFile(e,t,n){return Ds.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new Result(e,t,n,!0))}constructor(e,t,n,s){super(),this.connection=e instanceof Ve?e:new Ve(e),"boolean"==typeof s&&!0===s?this.set({NodeGroup:t,LogicalFileName:n}):Ge(n)&&Array.isArray(s)?this.set({...n,Wuid:t,ResultName:n.Name,ResultViews:s}):void 0===s?"number"==typeof n?this.set({Wuid:t,ResultSequence:n}):"string"==typeof n?this.set({Wuid:t,ResultName:n}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return-1!==this.Total}bypassCache(e){return void 0===e?this._bypassCache:(this._bypassCache=e,this)}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return this._fetchXMLSchemaPromise&&!e||(this._fetchXMLSchemaPromise=this.WUResult().then(e=>e.Result?.XmlSchema?.xml?(this.xsdSchema=vs(e.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,n=-1,s=!1,r={},i,o){const c=o??this._bypassCache;return this.WUResult(e,n,!s,r,i,c).then(e=>{const n=e.Result;return delete e.Result,this.set({...e}),(0,t.exists)("XmlSchema.xml",n)&&(this.xsdSchema=vs(n.XmlSchema.xml)),(0,t.exists)("Row",n)?n.Row:this.ResultName&&(0,t.exists)(this.ResultName,n)?n[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,n=!1,s={},r,i=!1){const o={NamedValue:{itemcount:0}};for(const u in s)o.NamedValue[o.NamedValue.itemcount++]={Name:u,Value:s[u]};const c={FilterBy:o};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,c.BypassCachedResult=i,this.connection.WUResult(c,r).then(e=>e)}},Fs=class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}},Ws=class extends t.StateObject{scope;get properties(){return this.get()}get Name(){return this.get("Name")}get RawValue(){return this.get("RawValue")}get Formatted(){return this.get("Formatted")}get FormattedEnd(){return this.get("FormattedEnd")}get Measure(){return this.get("Measure")}get Creator(){return this.get("Creator")}get CreatorType(){return this.get("CreatorType")}constructor(e,t){super(),this.scope=e,this.set(t)}},As=class extends t.StateObject{_attributeMap={};_children=[];get properties(){return this.get()}get ScopeName(){return this.get("ScopeName")}get Id(){return this.get("Id")}get ScopeType(){return this.get("ScopeType")}get Properties(){return this.get("Properties",{Property:[]})}get Notes(){return this.get("Notes",{Note:[]})}get SinkActivity(){return this.get("SinkActivity")}get CAttributes(){const e=[],t={start:null,end:null};return this.Properties.Property.forEach(n=>{"ts"===n.Measure&&n.Name.indexOf("Started")>=0?t.start=n:this.ScopeName&&"ts"===n.Measure&&n.Name.indexOf("Finished")>=0?t.end=n:e.push(new Ws(this,n))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Ws(this,t.start))):t.start?e.push(new Ws(this,t.start)):t.end&&e.push(new Ws(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(e=>{this._attributeMap[e.Name]=e}),this.Properties.Property=[];for(const t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){const e=this.ScopeName.split(":");return e.pop(),e.join(":")}children(e){return arguments.length?(this._children=e,this):this._children}walk(e){if(e.start(this))return!0;for(const t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){const e={};for(const t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){const e={};for(const t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return void 0!==this._attributeMap[e]}attr(e){return this._attributeMap[e]||new Ws(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="";const 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>`);const s=this.formattedAttrs();for(const r in s)"Label"===r?t=s[r]:n.push(`<tr><td class="key">${r}</td><td class="value">${s[r]}</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>`}},Ts=class extends As{wu;constructor(e,t){super(t),this.wu=e}},ws=class extends t.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get FileCluster(){return this.get("FileCluster")}get Name(){return this.get("Name")}get IsSuperFile(){return this.get("IsSuperFile")}get Subs(){return this.get("Subs")}get Count(){return this.get("Count")}get ECLSourceFiles(){return this.get("ECLSourceFiles")}constructor(e,t,n){super(),this.connection=e instanceof Ve?e:new Ve(e),this.set({Wuid:t,...n})}},Ps=class extends t.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Name(){return this.get("Name")}get Value(){return this.get("Value")}get Seconds(){return this.get("Seconds")}get GraphName(){return this.get("GraphName")}get SubGraphId(){return this.get("SubGraphId")}get HasSubGraphId(){return this.get("HasSubGraphId")}get count(){return this.get("count")}get Timestamp(){return this.get("Timestamp")}get When(){return this.get("When")}constructor(e,n,s){super(),this.connection=e instanceof Ve?e:new Ve(e);const r=(0,t.espTime2Seconds)(s.Value);this.set({Wuid:n,Seconds:Math.round(1e3*r)/1e3,HasSubGraphId:void 0!==s.SubGraphId,...s})}},xs=Nt("%Y-%m-%dT%H:%M:%S.%LZ"),Es=jt("%Y-%m-%dT%H:%M:%S.%LZ"),Ls=Ke(",");function Ns(e){return e&&!isNaN(+e)?Ls(+e):e}var js="DefinitionList",Is=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/;const Ms=["Avg","Min","Max","Delta","StdDev"],ks=["SkewMin","SkewMax","NodeMin","NodeMax"];var Gs=/[A-Z][a-z]*/g;var Vs={};function Qs(e){let t=Vs[e];return t||(t=function(e){for(const n of ks){const t=e.indexOf(n);if(0===t)return{measure:"",ext:n,label:e.slice(t+n.length)}}const t=e.match(Gs);if(t?.length){const e=t.shift();let n=t.join("");for(const t of Ms){const s=n.indexOf(t);if(0===s)return n=n.slice(s+t.length),{measure:e,ext:t,label:n}}return{measure:e,ext:"",label:n}}return{measure:"",ext:"",label:e}}(e),Vs[e]=t),t}function Os(e,t){return e.__formattedProps?.[t]??e[t]}function Bs(e){if(void 0===e)return;const t=parseFloat(e);return isNaN(t)?void 0:t}function Hs(e,t,n){const s=Qs(t);if(!n[s.measure]){n[s.label]=!0;const t=Bs(e[`${s.measure}Avg${s.label}`]),r=Bs(e[`${s.measure}Min${s.label}`]),i=Bs(e[`${s.measure}Max${s.label}`]),o=Bs(e[`${s.measure}StdDev${s.label}`]),c=Math.max((t-r)/o,(i-t)/o);return{Key:`${s.measure}${s.label}`,Value:Os(e,`${s.measure}${s.label}`),Avg:Os(e,`${s.measure}Avg${s.label}`),Min:Os(e,`${s.measure}Min${s.label}`),Max:Os(e,`${s.measure}Max${s.label}`),Delta:Os(e,`${s.measure}Delta${s.label}`),StdDev:Os(e,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:Os(e,`SkewMin${s.label}`),SkewMax:Os(e,`SkewMax${s.label}`),NodeMin:Os(e,`NodeMin${s.label}`),NodeMax:Os(e,`NodeMax${s.label}`)}}return null}var Xs,$s=(0,t.scopedLogger)("workunit.ts"),Js=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},qs=new Js,zs=class Workunit extends t.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}_debugMode=!1;_debugAllGraph;_submitAction;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner","")}get Cluster(){return this.get("Cluster","")}get Jobname(){return this.get("Jobname","")}get Description(){return this.get("Description","")}get ActionEx(){return this.get("ActionEx","")}get StateID(){return this.get("StateID",ke.Unknown)}get State(){return this.get("State")||ke[this.StateID]}get Protected(){return this.get("Protected",!1)}get Exceptions(){return this.get("Exceptions",{ECLException:[]})}get ResultViews(){return this.get("ResultViews",{View:[]})}_resultCache=new Fs;get ResultCount(){return this.get("ResultCount",0)}get Results(){return this.get("Results",{ECLResult:[]})}get CResults(){return this.Results.ECLResult.map(e=>this._resultCache.get(e,()=>bs.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){const e={};return this.CResults.forEach(t=>{e[t.Sequence]=t}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new Ps(this.connection,this.Wuid,e))}_graphCache=new ns;get GraphCount(){return this.get("GraphCount",0)}get Graphs(){return this.get("Graphs",{ECLGraph:[]})}get CGraphs(){return this.Graphs.ECLGraph.map(e=>this._graphCache.get(e,()=>new ts(this,e,this.CTimers)))}get ThorLogList(){return this.get("ThorLogList")}get ResourceURLCount(){return this.get("ResourceURLCount",0)}get ResourceURLs(){return this.get("ResourceURLs",{URL:[]})}get CResourceURLs(){return this.ResourceURLs.URL.map(e=>new ms(this,e))}get TotalClusterTime(){return this.get("TotalClusterTime","")}get DateTimeScheduled(){return this.get("DateTimeScheduled")}get IsPausing(){return this.get("IsPausing")}get ThorLCR(){return this.get("ThorLCR")}get ApplicationValues(){return this.get("ApplicationValues",{ApplicationValue:[]})}get HasArchiveQuery(){return this.get("HasArchiveQuery")}get StateEx(){return this.get("StateEx")}get PriorityClass(){return this.get("PriorityClass")}get PriorityLevel(){return this.get("PriorityLevel")}get Snapshot(){return this.get("Snapshot")}get ResultLimit(){return this.get("ResultLimit")}get EventSchedule(){return this.get("EventSchedule")}get Query(){return this.get("Query")}get HelpersCount(){return this.get("HelpersCount",0)}get Helpers(){return this.get("Helpers",{ECLHelpFile:[]})}get DebugValues(){return this.get("DebugValues")}get AllowedClusters(){return this.get("AllowedClusters")}get ErrorCount(){return this.get("ErrorCount",0)}get WarningCount(){return this.get("WarningCount",0)}get InfoCount(){return this.get("InfoCount",0)}get AlertCount(){return this.get("AlertCount",0)}get SourceFileCount(){return this.get("SourceFileCount",0)}get SourceFiles(){return this.get("SourceFiles",{ECLSourceFile:[]})}get CSourceFiles(){return this.SourceFiles.ECLSourceFile.map(e=>new ws(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}static create(e){const t=new Workunit(e);return t.connection.WUCreate().then(e=>(qs.set(t),t.set(e.Workunit),t))}static attach(e,t,n){const s=qs.get({BaseUrl:e.baseUrl,Wuid:t},()=>new Workunit(e,t));return n&&s.set(n),s}static existsLocal(e,t){return qs.has({BaseUrl:e,Wuid:t})}static submit(e,t,n,s=!1){return Workunit.create(e).then(e=>e.update({QueryText:n})).then(e=>s?e.submit(t,Me.Action.Compile):e.submit(t))}static compile(e,t,n){return Workunit.submit(e,t,n,!0)}static query(e,t){return new Ve(e).WUQuery(t).then(t=>t.Workunits.ECLWorkunit.map(function(t){return Workunit.attach(e,t.Wuid,t)}))}constructor(e,t){super(),this.connection=new Ve(e),this.topologyConnection=new Le(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:ke.Unknown})}update(e){return this.connection.WUUpdate({...e,Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster}).then(e=>(this.set(e.Workunit),this))}submit(e,t=Me.Action.Run,n){let s;return s=void 0!==e?Promise.resolve(e):this.topologyConnection.DefaultTpLogicalClusterQuery().then(e=>e.Name),this._debugMode=!1,t===Me.Action.Debug&&(t=Me.Action.Run,this._debugMode=!0),s.then(e=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:n,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(n=>(this.set(n.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:e})))).then(()=>this)}isComplete(){switch(this.StateID){case ke.Compiled:return"compile"===this.ActionEx||this._submitAction===Me.Action.Compile;case ke.Completed:case ke.Failed:case ke.Aborted:case ke.NotFound:return!0}return!1}isFailed(){switch(this.StateID){case ke.Aborted:case ke.Failed:return!0}return!1}isDeleted(){return this.StateID===ke.NotFound}isDebugging(){switch(this.StateID){case ke.DebugPaused:case ke.DebugRunning:return!0}return this._debugMode}isRunning(){switch(this.StateID){case ke.Compiled:case ke.Running:case ke.Aborting:case ke.Blocked:case ke.DebugPaused:case ke.DebugRunning:return!0}return!1}setToFailed(){return this.WUAction(Ne.ECLWUActions.SetToFailed)}pause(){return this.WUAction(Ne.ECLWUActions.Pause)}pauseNow(){return this.WUAction(Ne.ECLWUActions.PauseNow)}resume(){return this.WUAction(Ne.ECLWUActions.Resume)}abort(){return this.WUAction(Ne.ECLWUActions.Abort)}protect(){return this.WUAction(Ne.ECLWUActions.Protect)}unprotect(){return this.WUAction(Ne.ECLWUActions.Unprotect)}delete(){return this.WUAction(Ne.ECLWUActions.Delete)}restore(){return this.WUAction(Ne.ECLWUActions.Restore)}deschedule(){return this.WUAction(Ne.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(Ne.ECLWUActions.Reschedule)}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>Workunit.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID!==ke.Compiled||this.ActionEx||this._submitAction||await this.refreshInfo(),this}async refreshInfo(e){return await this.WUInfo(e),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(e=!1,t){return e?await Promise.all([this.refreshInfo(t),this.refreshDebug()]):await this.refreshState(),this}eclExceptions(){return this.Exceptions.ECLException}fetchArchive(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})}fetchECLExceptions(){return this.WUInfo({IncludeExceptions:!0}).then(()=>this.eclExceptions())}fetchResults(){return this.WUInfo({IncludeResults:!0}).then(()=>this.CResults)}fetchGraphs(){return this.WUInfo({IncludeGraphs:!0}).then(()=>this.CGraphs)}fetchQuery(){return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(()=>this.Query)}fetchHelpers(){return this.WUInfo({IncludeHelpers:!0}).then(()=>this.Helpers?.ECLHelpFile||[])}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>this.AllowedClusters?.AllowedCluster||[])}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>this.ServiceNames?.Item)}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={}){return this.WUDetails(e).then(e=>e.Scopes.Scope)}normalizeDetails(e,t){const n={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},s=new Map;for(const o of e.Activities?.Activity??[])s.set(o.Kind,o.Name);const r=new Array(t.length);for(let o=0;o<t.length;o++){const e=t[o],c={},u={};if(e.Id&&e.Properties?.Property)for(const t of e.Properties.Property){const e=t.Measure,r=t.Name,i=t.RawValue;if("ns"===e&&(t.Measure="s"),"Kind"===r){const e=parseInt(i,10);t.Formatted=s.get(e)??i}switch(n[r]={Name:t.Name,Measure:t.Measure,Creator:t.Creator,CreatorType:t.CreatorType},t.Measure){case"bool":c[r]=!!+i;break;case"sz":case"ns":case"cnt":case"node":case"skw":c[r]=+i;break;case"s":c[r]=+i/1e9;break;case"ts":c[r]=new Date(+i/1e3).toISOString();break;case"cost":c[r]=+i/1e6;break;default:c[r]=i}u[r]=Ns(t.Formatted??c[r])}const a={id:e.Id,name:e.ScopeName,type:e.ScopeType,Kind:e.Kind,Label:e.Label,__formattedProps:u,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...c},h=a[js];if(h)try{const e=JSON.parse(h.split("\\").join("\\\\")),t=[];for(let n=0;n<e.length;n++){const s=e[n].match(Is);s&&t.push({filePath:(s[1]??"")+s[2]+s[3],line:parseInt(s[5],10),col:parseInt(s[6],10)})}a[js]=t}catch(i){$s.error(`Unexpected "DefinitionList": ${h}`)}const l={};let d=0,p="";for(const t in a)if(!t.startsWith("__")){const e=Hs(a,t,l);e&&(a.__groupedProps[e.Key]=e,!isNaN(e.StdDevs)&&e.StdDevs>d&&(d=e.StdDevs,p=e.Key))}a.__StdDevs=d,a.__StdDevsSource=p,r[o]=a}return{meta:e,columns:n,data:r}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(e=>this.normalizeDetails(e[0],e[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(e=>e.Scopes.Scope.map(e=>new Ts(this,e)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(e=>{const t=[],n={};e.Scopes.Scope.forEach(e=>{if(n[e.ScopeName])return n[e.ScopeName].update(e),null;{const t=new Ts(this,e);return n[t.ScopeName]=t,t}});for(const s in n)if(n.hasOwnProperty(s)){const e=n[s],r=e.parentScope();r&&n[r]?n[r].children().push(e):t.push(e)}return t})}fetchGraphDetails(e=[],t){return 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}})}fetchScopeGraphs(e=[]){return this.fetchGraphDetails(e,["graph"]).then(e=>gs(e))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{const t={};e.forEach(e=>{t[e.ScopeName]=t[e.ScopeName]||{scope:e.ScopeName,start:null,elapsed:null,finish:null},e.CAttributes.forEach(n=>{"TimeElapsed"===n.Name?t[e.ScopeName].elapsed=+n.RawValue:"ts"===n.Measure&&n.Name.indexOf("Started")>=0&&(t[e.ScopeName].start=n.Formatted)})});const n=[];for(const s in t){const e=t[s];if(e.start&&e.elapsed){const t=Es(e.start);t.setMilliseconds(t.getMilliseconds()+e.elapsed/1e6),e.finish=xs(t),n.push(e)}}return n.sort((e,t)=>e.start<t.start?-1:e.start>t.start?1:0),n})}_monitor(){this.isComplete()?this._monitorTickCount=0:super._monitor()}_monitorTimeoutDuration(){const e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,n){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",e=>{this.isComplete()&&t([e])});break;case"changed":super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),this.isComplete()&&(s.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(s.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(e=>(0===e.Workunits.ECLWorkunit.length?(this.clearState(this.Wuid),this.set("StateID",ke.NotFound)):this.set(e.Workunits.ECLWorkunit[0]),e)).catch(e=>{if(!e.Exception.some(e=>20081===e.Code&&(this.clearState(this.Wuid),this.set("StateID",ke.NotFound),!0)))throw $s.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),qs.set(this),e))}WUInfo(e={}){const t=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:t,IncludeResultsViewNames:t,SuppressResultSchemas:!1}).then(e=>(this.set(e.Workunit),t&&this.set({ResultViews:e.ResultViews}),e)).catch(e=>{if(!e.Exception.some(e=>20080===e.Code&&(this.clearState(this.Wuid),this.set("StateID",ke.NotFound),!0)))throw $s.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUResubmit(e){return this.connection.WUResubmit((0,t.deepMixinT)({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails((0,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(e=>(0,t.deepMixinT)({Scopes:{Scope:[]}},e))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(e=>this.refresh().then(()=>(this._monitor(),e)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:Ne.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){const t=new Qe({baseUrl:""}),n={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(n)}WUCDebug(e,t={}){let n="";for(const s in t)t.hasOwnProperty(s)&&(n+=` ${s}='${t[s]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${n}/>`}).then(e=>e)}debug(e,n){return this.isDebugging()?this.WUCDebug(e,n).then(n=>{const s=n.children(e);return s.length?s[0]:new t.XMLNode(e)}).catch(n=>($s.error(n),Promise.resolve(new t.XMLNode(e)))):Promise.resolve(new t.XMLNode(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{const t={...this.DebugState,...e.$};return this.set({DebugState:t}),e}):Promise.resolve({DebugState:{state:"unknown"}})}debugContinue(e=""){return this.debug("continue",{mode:e})}debugStep(e){return this.debug("step",{mode:e})}debugPause(){return this.debug("interrupt")}debugQuit(){return this.debug("quit")}debugDeleteAllBreakpoints(){return this.debug("delete",{idx:0})}debugBreakpointResponseParser(e){return e.children().map(e=>{if("break"===e.name)return e.$})}debugBreakpointAdd(e,t,n){return this.debug("breakpoint",{id:e,mode:t,action:n}).then(e=>this.debugBreakpointResponseParser(e))}debugBreakpointList(){return this.debug("list").then(e=>this.debugBreakpointResponseParser(e))}debugGraph(){return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(e=>(this.DebugState._prevGraphSequenceNum=this.DebugState.graphSequenceNum,this._debugAllGraph=as(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>function(e,t){const n=[];for(const s of e.vertices)if(Ks(s)){const e=Zs(s);(e&&!t||t===e.file)&&n.push(e)}return n.sort((e,t)=>e.line-t.line)}(t,e))}debugPrint(e,t=0,n=10){return this.debug("print",{edgeID:e,startRow:t,numRows:n}).then(e=>e.children().map(e=>{const t={};return e.children().forEach(e=>{t[e.name]=e.content}),t}))}},Ys="definition";function Ks(e){return void 0!==e._[Ys]}function Zs(e){const t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[Ys]);if(t){const[,n,s,r]=t;return n.replace(/\/\.\//g,"/"),{id:e._.id,file:n,line:+s,column:+r}}throw new Error(`Bad definition: ${e._[Ys]}`)}var er=class Activity extends t.StateObject{connection;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get Build(){return this.get("Build")}get ThorClusterList(){return this.get("ThorClusterList")}get RoxieClusterList(){return this.get("RoxieClusterList")}get HThorClusterList(){return this.get("HThorClusterList")}get DFUJobs(){return this.get("DFUJobs")}get Running(){return this.get("Running",{ActiveWorkunit:[]})}get BannerContent(){return this.get("BannerContent")}get BannerColor(){return this.get("BannerColor")}get BannerSize(){return this.get("BannerSize")}get BannerScroll(){return this.get("BannerScroll")}get ChatURL(){return this.get("ChatURL")}get ShowBanner(){return this.get("ShowBanner")}get ShowChatURL(){return this.get("ShowChatURL")}get SortBy(){return this.get("SortBy")}get Descending(){return this.get("Descending")}get SuperUser(){return this.get("SuperUser")}get AccessRight(){return this.get("AccessRight")}get ServerJobQueues(){return this.get("ServerJobQueues")}get ActivityTime(){return this.get("ActivityTime")}get DaliDetached(){return this.get("DaliDetached")}static attach(e,t){return Xs||(Xs=new Activity(e)),t&&Xs.set(t),Xs}constructor(e){super(),this.connection=e instanceof Ae?e:new Ae(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>""===e||t.ClusterName===e).map(e=>zs.attach(this.connection.connectionOptions(),e.Wuid,e))}setBanner(e){return this.connection.SetBanner({...e}).then(e=>(this.set(e),this))}lazyRefresh=(0,t.debounce)(async()=>{const e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}},tr=(0,t.scopedLogger)("logicalFile.ts"),nr=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},sr=new nr,rr=class LogicalFile extends t.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get Cluster(){return this.get("Cluster")}get Name(){return this.get("Name")}get Filename(){return this.get("Filename")}get Prefix(){return this.get("Prefix")}get NodeGroup(){return this.get("NodeGroup")}get NumParts(){return this.get("NumParts")}get Description(){return this.get("Description")}get Dir(){return this.get("Dir")}get PathMask(){return this.get("PathMask")}get Filesize(){return this.get("Filesize")}get FileSizeInt64(){return this.get("FileSizeInt64")}get RecordSize(){return this.get("RecordSize")}get RecordCount(){return this.get("RecordCount")}get RecordSizeInt64(){return this.get("RecordSizeInt64")}get RecordCountInt64(){return this.get("RecordCountInt64")}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner")}get JobName(){return this.get("JobName")}get Persistent(){return this.get("Persistent")}get Format(){return this.get("Format")}get MaxRecordSize(){return this.get("MaxRecordSize")}get CsvSeparate(){return this.get("CsvSeparate")}get CsvQuote(){return this.get("CsvQuote")}get CsvTerminate(){return this.get("CsvTerminate")}get CsvEscape(){return this.get("CsvEscape")}get Modified(){return this.get("Modified")}get Ecl(){return this.get("Ecl")}get Stat(){return this.get("Stat")}get DFUFilePartsOnClusters(){return this.get("DFUFilePartsOnClusters")}get isSuperfile(){return this.get("isSuperfile")}get ShowFileContent(){return this.get("ShowFileContent")}get subfiles(){return this.get("subfiles")}get Superfiles(){return this.get("Superfiles")}get ProtectList(){return this.get("ProtectList")}get FromRoxieCluster(){return this.get("FromRoxieCluster")}get Graphs(){return this.get("Graphs")}get UserPermission(){return this.get("UserPermission")}get ContentType(){return this.get("ContentType")}get CompressedFileSize(){return this.get("CompressedFileSize")}get PercentCompressed(){return this.get("PercentCompressed")}get IsCompressed(){return this.get("IsCompressed")}get BrowseData(){return this.get("BrowseData")}get jsonInfo(){return this.get("jsonInfo")}get binInfo(){return this.get("binInfo")}get PackageID(){return this.get("PackageID")}get Partition(){return this.get("Partition")}get Blooms(){return this.get("Blooms")}get ExpireDays(){return this.get("ExpireDays")}get KeyType(){return this.get("KeyType")}get IsRestricted(){return this.get("IsRestricted")}get AtRestCost(){return this.get("AtRestCost")}get AccessCost(){return this.get("AccessCost")}get StateID(){return this.get("StateID")}get ExpirationDate(){return this.get("ExpirationDate")}get ExtendedIndexInfo(){return this.get("ExtendedIndexInfo")}get CompressionType(){return this.get("CompressionType")}get properties(){return this.get()}static attach(e,t,n,s){const r=sr.get({BaseUrl:e.baseUrl,Cluster:t,Name:n},()=>new LogicalFile(e,t,n));return s&&r.set(s),r}constructor(e,t,n){super(),this.connection=e instanceof Y?e:new Y(e),this.clear({Cluster:t,Name:n})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){const e=[];for(const t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(const n of t?.DFUFileParts?.DFUPart||[]){const s={...t,...n};delete s.DFUFileParts,e.push(s)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail}),e))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:e?.FileDetail?.ProtectList??{DFUFileProtect:[]}}),e.FileDetail)).catch(e=>{if(!e.Exception.some(e=>20038===e.Code&&(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0)))throw tr.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchAllLogicalFiles(){return this.connection.recursiveFetchLogicalFiles([this])}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}},ir=class extends t.Cache{constructor(){super(e=>e.Address)}},or=new ir,cr=class Machine extends t.StateObject{connection;get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,n){const s=or.get({Address:t},()=>new Machine(e));return n&&s.set(n),s}constructor(e){super(),this.connection=e instanceof ye?e:new ye(e)}},ur=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},ar=new ur,hr=class TargetCluster extends t.StateObject{connection;machineConnection;get BaseUrl(){return this.connection.baseUrl}get Name(){return this.get("Name")}get Prefix(){return this.get("Prefix")}get Type(){return this.get("Type")}get IsDefault(){return this.get("IsDefault")}get TpClusters(){return this.get("TpClusters")}get TpEclCCServers(){return this.get("TpEclCCServers")}get TpEclServers(){return this.get("TpEclServers")}get TpEclAgents(){return this.get("TpEclAgents")}get TpEclSchedulers(){return this.get("TpEclSchedulers")}get MachineInfoEx(){return this.get("MachineInfoEx",[])}get CMachineInfoEx(){return this.MachineInfoEx.map(e=>cr.attach(this.machineConnection,e.Address,e))}static attach(e,t,n){const s=ar.get({BaseUrl:e.baseUrl,Name:t},()=>new TargetCluster(e,t));return n&&s.set(n),s}constructor(e,t){super(),e instanceof Le?(this.connection=e,this.machineConnection=new ye(e.connectionOptions())):(this.connection=new Le(e),this.machineConnection=new ye(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(e=>{const t=[];for(const n of e.TargetClusterInfoList.TargetClusterInfo)for(const e of n.Processes.MachineInfoEx)t.push(e);return this.set("MachineInfoEx",t),this.CMachineInfoEx})}machineStats(){let e=0,t=0,n=0;for(const s of this.CMachineInfoEx)for(const r of s.Storage.StorageInfo){t+=r.Available,n+=r.Total;const s=1-r.Available/r.Total;s>e&&(e=s)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};var lr={};var dr=class extends t.Cache{constructor(){super(e=>e.BaseUrl)}},pr=new dr,gr=class Topology extends t.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get TargetClusters(){return this.get("TargetClusters")}get CTargetClusters(){return this.TargetClusters.map(e=>hr.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){const n=pr.get({BaseUrl:e.baseUrl},()=>new Topology(e));return t&&n.set(t),n}constructor(e){super(),this.connection=e instanceof Le?e:new Le(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(n=>{const s=this.connection.protocol(),r=this.connection.ip();let i="https:"===s?"18002":"8002";if((0,t.exists)("ServiceList.TpEspServers.TpEspServer",n))for(const o of n.ServiceList.TpEspServers.TpEspServer)if((0,t.exists)("TpBindings.TpBinding",o))for(const t of o.TpBindings.TpBinding)t.Service===e&&t.Protocol+":"===s&&(i=t.Port);return`${s}//${r}:${i}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(e=>(this.set({TargetClusters:e.TpTargetClusters?.TpTargetCluster??[]}),this.CTargetClusters))}fetchLogicalClusters(e={}){return this.connection.TpLogicalClusterQuery(e).then(e=>(this.set({LogicalClusters:e.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(e=>(this.set({Services:e.ServiceList}),this.Services))}_prevRefresh;refresh(e=!1){return this._prevRefresh&&!e||(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(e,t,n){if(this.isCallback(t)){if("changed"===e)super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}};function mr(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=n)}function fr(e){return(e=""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function Sr(e,t){const n=e.indexOf(t);return-1!==n?parseFloat(e.substring(0,n)):-1}var Ur=function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.GRAPH=1]="GRAPH",e[e.SUBGRAPH=2]="SUBGRAPH",e[e.VERTEX=3]="VERTEX",e[e.EDGE=4]="EDGE",e[e.LAST=5]="LAST",e}(Ur||{}),_r=function(e){return e.UNKNOWN="Unknown",e.GRAPH="Graph",e.SUBGRAPH="Cluster",e.VERTEX="Vertex",e.EDGE="Edge",e.LAST="Last",e}(_r||{}),yr=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,n,s){this.noSpills=s,e.forEach(e=>{this.graph.isVertex(e)?(this.calcInVertexVisibility(e,n),this.calcOutVertexVisibility(e,n)):this.graph.isEdge(e)?(this.calcInVertexVisibility(e.getSource(),n-1),this.calcOutVertexVisibility(e.getTarget(),n-1)):this.graph.isSubgraph(e)&&(this.m_visibleSubgraphs[e.__hpcc_id]=e,this.calcSubgraphVisibility(e,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(e=>{this.calcInVertexVisibility(e.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(e=>{this.calcOutVertexVisibility(e.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((e,n)=>{this.calcSubgraphVisibility(e,t-1)}),e.__hpcc_subgraphs.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e}),e.__hpcc_vertices.forEach((e,t)=>{this.m_visibleVertices[e.__hpcc_id]=e});const n={};this.graph.edges.forEach((t,s)=>{t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===this.getCommonAncestor(t)&&(n[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]||(n[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[t.__hpcc_id]=t))})}buildVertexString(e,t){let n="",s="";const r=e.getProperties();for(const i in r)t&&i.indexOf("_kind")>=0?s+='<att name="_kind" value="point"/>':"id"===i||"label"===i?n+=" "+i+'="'+fr(r[i])+'"':s+='<att name="'+i+'" value="'+fr(r[i])+'"/>';return"<node"+n+">"+s+"</node>"}buildEdgeString(e){let t="",n="";const s=e.getProperties();for(const r in s)"id"===r.toLowerCase()||"label"===r.toLowerCase()||"source"===r.toLowerCase()||"target"===r.toLowerCase()?t+=" "+r+'="'+fr(s[r])+'"':n+='<att name="'+r+'" value="'+fr(s[r])+'"/>';return"<edge"+t+">"+n+"</edge>"}getAncestors(e,t){let n=e.__hpcc_parent;for(;n;)t.push(n),n=n.__hpcc_parent}getCommonAncestorV(e,t){const n=[],s=[];this.getAncestors(e,n),this.getAncestors(t,s);let r=n.length-1,i=s.length-1,o=null;for(;r>=0&&i>=0&&n[r]===s[i];)o=n[r],--r,--i;return o}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){const t=[];this.getAncestors(e,t),t.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e})}calcVisibility2(){for(const e in this.m_visibleVertices){const t=this.m_visibleVertices[e];t.getInEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),t.getOutEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),this.calcAncestorVisibility(t)}this.calcSemiVisibleVertices()}addSemiVisibleEdge(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)}addSemiVisibleVertex(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))}calcSemiVisibleVertices(){for(const e in this.m_visibleEdges){const t=this.m_visibleEdges[e];let n=t.getSource();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){const e=n.getInEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),n=e[0].getSource(),this.addSemiVisibleVertex(n)}let s=t.getTarget();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){const e=s.getOutEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),s=e[0].getTarget(),this.addSemiVisibleVertex(s)}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,t)=>{this.edgeVisited(e)})}subgraphVisited(e,t=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let n="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';const s=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),s===this.m_xgmml.length){const t=e.__hpcc_vertices[0];t&&(this.m_xgmml+=this.buildVertexString(t,!0))}const r=e.getProperties();for(const e in r)n+='<att name="'+e+'" value="'+fr(r[e])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+n+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}},vr=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){const e={};for(const t in this)0!==t.indexOf("__")&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}},Rr=class extends vr{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,t){super(e,t),this._globalType="0"===t?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=t}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(t=>e===t)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(t=>e===t)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(t=>e!==t)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(t=>e===t)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(t=>e!==t)}remove(){this.__hpcc_subgraphs.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_vertices.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_edges.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)}walkSubgraphs(e){this.__hpcc_subgraphs.forEach((t,n)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,n)=>{e.vertexVisited(t)})}},Cr=class extends vr{_globalType="Vertex";_isSpill;constructor(e,t){super(e,t)}isSpill(){return this._isSpill}remove(){const e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(e=>{e.remove()}),this.getOutEdges().forEach(t=>{t.setSource(e[0])}),this.__hpcc_parent?.removeVertex(this),this.__hpcc_graph.removeItem(this)}getInVertices(){return this.getInEdges().map(e=>e.getSource())}getInEdges(){return this.__hpcc_graph.edges.filter(e=>e.getTarget()===this)}getOutVertices(){return this.getOutEdges().map(e=>e.getTarget())}getOutEdges(){return this.__hpcc_graph.edges.filter(e=>e.getSource()===this)}},Dr=class extends vr{_globalType="Edge";_sourceActivity;source;_targetActivity;target;constructor(e,t){super(e,t),this._globalType="Edge"}remove(){this.__hpcc_graph.subgraphs.forEach(e=>{e.removeEdge(this)}),this.__hpcc_graph.removeItem(this)}getSource(){return this.__hpcc_graph.idx[this._sourceActivity||this.source]}setSource(e){this._sourceActivity?this._sourceActivity=e.__hpcc_id:this.source&&(this.source=e.__hpcc_id),this.__widget&&this.__widget.setSource(this.getSource().__widget)}getTarget(){return this.__hpcc_graph.idx[this._targetActivity||this.target]}},br=class QueryGraph{idx={};subgraphs=[];vertices=[];edges=[];xgmml="";constructor(){this.clear()}clear(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]}load(e){this.clear(),this.merge(e)}merge(e){this.xgmml=e;const t=(new DOMParser).parseFromString(e,"text/xml");this.walkDocument(t.documentElement,"0")}isSubgraph(e){return e instanceof Rr}isVertex(e){return e instanceof Cr}isEdge(e){return e instanceof Dr}getGlobalType(e){return e instanceof Cr?Ur.VERTEX:e instanceof Dr?Ur.EDGE:e instanceof Rr?Ur.SUBGRAPH:e instanceof QueryGraph?Ur.GRAPH:Ur.UNKNOWN}getGlobalTypeString(e){return e instanceof Cr?_r.VERTEX:e instanceof Dr?_r.EDGE:e instanceof Rr?_r.SUBGRAPH:e instanceof QueryGraph?_r.GRAPH:_r.UNKNOWN}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":const e=new Rr(this,t);this.subgraphs.push(e),this.idx[t]=e;break;case"node":const n=new Cr(this,t);this.vertices.push(n),this.idx[t]=n;break;case"edge":const s=new Dr(this,t);this.edges.push(s),this.idx[t]=s;break;default:console.warn("Graph.getItem - Unknown Node Type!")}const n=this.idx[t];return Array.from(e.attributes).forEach(e=>{mr(n,e.name,e.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof Rr?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof Cr?this.vertices=this.vertices.filter(t=>e!==t):e instanceof Dr&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let n=null;return Array.from(e.childNodes).some(e=>{if(e.tagName===t)return n=e,!0}),n}walkDocument(e,t){const n=this.getItem(e,t);return e.childNodes.forEach(e=>{if(1===e.nodeType)switch(e.tagName){case"graph":default:break;case"node":let s=!1;const r=this.getChildByTagName(e,"att");if(r){const t=this.getChildByTagName(r,"graph");if(t){s=!0;const r=this.walkDocument(t,e.getAttribute("id"));n.addSubgraph(r)}}if(!s){const t=this.walkDocument(e,e.getAttribute("id"));n.addVertex(t)}break;case"att":const i=e.getAttribute("name"),o="_"+i,c=e.getAttribute("value");0===i.indexOf("Time")?(mr(n,o,c),mr(n,i,""+function(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);const t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(e);return t?24*(+t[1]||0)*60*60+60*(+t[2]||0)*60+60*(+t[3]||0)+(+t[4]||0)+(+t[5]||0)/1e3+(+t[6]||0)/1e6+(+t[7]||0)/1e9:0}(c))):0===i.indexOf("Size")?(mr(n,o,c),mr(n,i,""+function(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);let t=Sr(e,"Kb");return t>=0?1024*t:(t=Sr(e,"Mb"),t>=0?t*Math.pow(1024,2):(t=Sr(e,"Gb"),t>=0?t*Math.pow(1024,3):(t=Sr(e,"Tb"),t>=0?t*Math.pow(1024,4):(t=Sr(e,"Pb"),t>=0?t*Math.pow(1024,5):(t=Sr(e,"Eb"),t>=0?t*Math.pow(1024,6):(t=Sr(e,"Zb"),t>=0?t*Math.pow(1024,7):(t=Sr(e,"b"),t>=0?t:0)))))))}(c))):0===i.indexOf("Skew")?(mr(n,o,c),mr(n,i,""+((t=c)?parseFloat(t):0))):mr(n,i,c);break;case"edge":const u=this.walkDocument(e,e.getAttribute("id"));if(void 0!==u.NumRowsProcessed?u._eclwatchCount=u.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==u.Count?u._eclwatchCount=u.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==u.count&&(u._eclwatchCount=u.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),u.inputProgress&&(u._eclwatchInputProgress="["+u.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),u.SkewMaxRowsProcessed&&u.SkewMinRowsProcessed&&(u._eclwatchSkew="+"+u.SkewMaxRowsProcessed+", "+u.SkewMinRowsProcessed),u._dependsOn);else if(u._childGraph);else if(u._sourceActivity||u._targetActivity){u._isSpill=!0;const e=u.getSource();e&&(e._isSpill=!0);const t=u.getTarget();t&&(t._isSpill=!0)}n.addEdge(u)}var t}),n}removeSubgraphs(){[...this.subgraphs].forEach(e=>{e.__hpcc_parent instanceof Rr&&e.remove()})}removeSpillVertices(){[...this.vertices].forEach(e=>{e.isSpill()&&e.remove()})}getLocalisedXGMML(e,t,n,s){const r=new yr(this);return r.calcVisibility(e,t,n,s),r.writeXgmml(),"<graph>"+r.m_xgmml+"</graph>"}},Fr=(0,t.scopedLogger)("@hpcc-js/comms/ecl/query.ts"),Wr=Ke("~s");function Ar(e){return!isNaN(parseFloat(e))&&!isNaN(e-0)}var Tr=new class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.QueryId,e.QuerySet]))}},wr=class Query extends t.StateObject{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get QueryId(){return this.get("QueryId")}get QuerySet(){return this.get("QuerySet")}get QueryName(){return this.get("QueryName")}get Wuid(){return this.get("Wuid")}get Dll(){return this.get("Dll")}get Suspended(){return this.get("Suspended")}get Activated(){return this.get("Activated")}get SuspendedBy(){return this.get("SuspendedBy")}get Clusters(){return this.get("Clusters")}get PublishedBy(){return this.get("PublishedBy")}get Comment(){return this.get("Comment")}get LogicalFiles(){return this.get("LogicalFiles")}get SuperFiles(){return this.get("SuperFiles")}get IsLibrary(){return this.get("IsLibrary")}get Priority(){return this.get("Priority")}get WUSnapShot(){return this.get("WUSnapShot")}get CompileTime(){return this.get("CompileTime")}get LibrariesUsed(){return this.get("LibrariesUsed")}get CountGraphs(){return this.get("CountGraphs")}get ResourceURLCount(){return this.get("ResourceURLCount")}get WsEclAddresses(){return this.get("WsEclAddresses")}get WUGraphs(){return this.get("WUGraphs")}get WUTimers(){return this.get("WUTimers")}get PriorityID(){return this.get("PriorityID")}constructor(e,t,n,s){super(),this.wsWorkunitsService=e instanceof Ve?e:new Ve(e),this.topology=gr.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:n,...s})}static attach(e,t,n,s){const r=Tr.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:n},()=>new Query(e,t,n));return s&&r.set(s),r}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(const t of e?.TpEspServers?.TpEspServer??[])for(const e of t?.TpBindings?.TpBinding??[])if("ws_ecl"===e?.Service)return new ne({baseUrl:`${e.Protocol}://${globalThis.location.hostname}:${e.Port}`})})),this._eclService}async fetchDetails(){const e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){const e=await this.wsEclService();try{this._requestSchema=await(e?.requestJson(this.QuerySet,this.QueryId))??[]}catch(t){Fr.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){const e=await this.wsEclService();try{this._responseSchema=await(e?.responseJson(this.QuerySet,this.QueryId))??{}}catch(t){Fr.debug(t.message??t),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",t=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(e=>{const t=new br;let n=!0;for(const s of e?.Graphs?.ECLGraphEx||[])n?(t.load(s.Graph),n=!1):t.merge(s.Graph);return t})}fetchDetailsNormalized(e={}){const t=zs.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(e=>{const n=e[0],s=e[1],r=e[2].map(e=>{const t=e.Id[0];if("a"===t||"e"===t){const t=n.idx[e.Id.substring(1)];if(!t)return Fr.debug(`Missing graph data for metric ID: ${e.Id}`),e;const s=new Set(e.Properties.Property.map(e=>e.Name)),r=[];for(const e in t){const n=e.charAt(0);if("_"!==n&&n===n.toUpperCase()&&!s.has(e)){const n=t[e],s=typeof n;if("string"===s||"number"===s||"boolean"===s){let t=Ar(n)?parseFloat(n):n,s=n;e.indexOf("Time")>=0&&(t/=1e9,s=Wr(t)+"s"),r.push({Name:e,RawValue:t,Formatted:s})}}}r.length>0&&e.Properties.Property.push(...r)}return e});return t.normalizeDetails(s,r)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){const t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(e=>{for(const t in e)e[t]=e[t].Row;return e})??[]}catch(n){return Fr.debug(n.message??n),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){const e=[];for(const t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}},Pr=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},xr=new Pr,Er=class extends t.Message{constructor(e,t,n){super(),this.key=e,this.value=t,this.oldValue=n}get canConflate(){return!0}conflate(e){return this.key===e.key&&(this.value=e.value,!0)}void(){return this.value===this.oldValue}},Lr=(0,t.scopedLogger)("@hpcc-js/comms/dfuWorkunit.ts"),Nr=function(e){return e[e.Unknown=0]="Unknown",e[e.Scheduled=1]="Scheduled",e[e.Queued=2]="Queued",e[e.Started=3]="Started",e[e.Aborted=4]="Aborted",e[e.Failed=5]="Failed",e[e.Finished=6]="Finished",e[e.Monitoring=7]="Monitoring",e[e.Aborting=8]="Aborting",e[e.NotFound=999]="NotFound",e}(Nr||{}),jr=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},Ir=new jr,Mr=class DFUWorkunit extends t.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get ID(){return this.get("ID")}get DFUServerName(){return this.get("DFUServerName")}get ClusterName(){return this.get("ClusterName")}get JobName(){return this.get("JobName")}get Queue(){return this.get("Queue")}get User(){return this.get("User")}get isProtected(){return this.get("isProtected")}get Command(){return this.get("Command")}get CommandMessage(){return this.get("CommandMessage")}get PercentDone(){return this.get("PercentDone")}get SecsLeft(){return this.get("SecsLeft")}get ProgressMessage(){return this.get("ProgressMessage")}get SummaryMessage(){return this.get("SummaryMessage")}get State(){return this.get("State",Nr.Unknown)}get SourceLogicalName(){return this.get("SourceLogicalName")}get SourceIP(){return this.get("SourceIP")}get SourceFilePath(){return this.get("SourceFilePath")}get SourceDali(){return this.get("SourceDali")}get SourceRecordSize(){return this.get("SourceRecordSize")}get SourceFormat(){return this.get("SourceFormat")}get RowTag(){return this.get("RowTag")}get SourceNumParts(){return this.get("SourceNumParts")}get SourceDirectory(){return this.get("SourceDirectory")}get DestLogicalName(){return this.get("DestLogicalName")}get DestGroupName(){return this.get("DestGroupName")}get DestDirectory(){return this.get("DestDirectory")}get DestIP(){return this.get("DestIP")}get DestFilePath(){return this.get("DestFilePath")}get DestFormat(){return this.get("DestFormat")}get DestNumParts(){return this.get("DestNumParts")}get DestRecordSize(){return this.get("DestRecordSize")}get Replicate(){return this.get("Replicate")}get Overwrite(){return this.get("Overwrite")}get Compress(){return this.get("Compress")}get SourceCsvSeparate(){return this.get("SourceCsvSeparate")}get SourceCsvQuote(){return this.get("SourceCsvQuote")}get SourceCsvTerminate(){return this.get("SourceCsvTerminate")}get SourceCsvEscape(){return this.get("SourceCsvEscape")}get TimeStarted(){return this.get("TimeStarted")}get TimeStopped(){return this.get("TimeStopped")}get StateMessage(){return this.get("StateMessage")}get MonitorEventName(){return this.get("MonitorEventName")}get MonitorSub(){return this.get("MonitorSub")}get MonitorShotLimit(){return this.get("MonitorShotLimit")}get SourceDiffKeyName(){return this.get("SourceDiffKeyName")}get DestDiffKeyName(){return this.get("DestDiffKeyName")}get Archived(){return this.get("Archived")}get encrypt(){return this.get("encrypt")}get decrypt(){return this.get("decrypt")}get failIfNoSourceFile(){return this.get("failIfNoSourceFile")}get recordStructurePresent(){return this.get("recordStructurePresent")}get quotedTerminator(){return this.get("quotedTerminator")}get preserveCompression(){return this.get("preserveCompression")}get expireDays(){return this.get("expireDays")}get PreserveFileParts(){return this.get("PreserveFileParts")}get FileAccessCost(){return this.get("FileAccessCost")}get KbPerSecAve(){return this.get("KbPerSecAve")}get KbPerSec(){return this.get("KbPerSec")}static create(e,t){const n=new DFUWorkunit(e);return n.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(e=>(Ir.set(n),n.set(e.result),n))}static attach(e,t,n){const s=Ir.get({BaseUrl:e.baseUrl,ID:t},()=>new DFUWorkunit(e,t));return n&&s.set(n),s}static sprayFixed(e,t){const n=new E(e);return n.SprayFixedEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>DFUWorkunit.attach(e,s,t.result))})}static sprayVariable(e,t){const n=new E(e);return n.SprayVariableEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>DFUWorkunit.attach(e,s,t.result))})}static despray(e,t){const n=new E(e);return n.DesprayEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>DFUWorkunit.attach(e,s,t.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case Nr.Finished:case Nr.Failed:case Nr.Aborted:case Nr.NotFound:return!0}return!1}isFailed(){return!(!this.isComplete()||this.State===Nr.Finished)}isDeleted(){return this.State===Nr.NotFound}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(w.DFUWUActions.Delete).then(e=>this.refresh().then(()=>(this._monitor(),e)))}async refresh(e=!1){return await this.GetDFUWorkunit(),this}fetchXML(e){return this.DFUWUFile()}_monitor(){this.isComplete()?this._monitorTickCount=0:super._monitor()}_monitorTimeoutDuration(){const e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:e}DFUWUFile(e={}){return this.connection.DFUWUFileEx({...e,Wuid:this.ID}).then(e=>e).catch(e=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===w.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,n){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",e=>{this.isComplete()&&t([e])});break;case"changed":super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),this.isComplete()&&(s.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(s.release(),t(this))})})}constructor(e,t){super(),this.connection=new E(e),this.topologyConnection=new Le(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:Nr.Unknown})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(e=>(this.set(e.result),e)).catch(e=>{if(!e.Exception.some(e=>(20080===e.Code||20081===e.Code)&&(this.clearState(this.ID),this.set("State",Nr.NotFound),!0)))throw Lr.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}};e.AccessService=class extends j{},e.AccountService=class extends I{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>20043===e.Code))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:e.Exception}};throw e})}},e.Activity=er,e.Attribute=Ws,e.BUILD_VERSION="3.12.5",e.BaseScope=As,e.CloudService=class extends M{getPODs(){return super.GetPODs({}).then(e=>{if(function(e){return void 0!==e?.Pods}(e))return e.Pods?.Pod??[];try{return(("string"==typeof e.Result?JSON.parse(e.Result):e.Result)?.items??[]).filter(e=>{const t=e?.metadata?.labels??{};return t.hasOwnProperty("app.kubernetes.io/part-of")&&"HPCC-Platform"===t["app.kubernetes.io/part-of"]}).map(e=>{const t=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:t.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((e,t)=>(t.name&&e.push(t.name),e),[]).join(", ")??"",ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((e,t)=>e+(t.ready?1:0),0),ContainerRestartCount:e.status?.containerStatuses?.reduce((e,t)=>e+t.restartCount,0),Ports:{Port:G(e)}}})}catch(t){return k.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}},e.CodesignService=class extends Q{ListUserIDsEx(e){return super.ListUserIDs(e).then(e=>e.UserIDs.Item).catch(e=>[])}Sign(e){return super.Sign({SigningMethod:V.SigningMethodType.gpg,...e})}},e.Connection=D,e.DFUArrayActions=$,e.DFUChangeProtection=q,e.DFUChangeRestriction=z,e.DFUDefFileFormat=J,e.DFUService=Y,e.DFUWorkunit=Mr,e.DFUWorkunitCache=jr,e.DFUXRefService=class extends K{DFUXRefDirectoriesEx(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefListEx(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}},e.DaliService=class extends O{},e.ECLGraph=ts,e.ESPConnection=A,e.ESPExceptions=W,e.EclService=ne,e.ElkService=class extends se{},Object.defineProperty(e,"FileSpray",{enumerable:!0,get:function(){return w}}),e.FileSprayService=E,e.FileSprayStates=x,e.GlobalResultCache=Cs,e.GraphCache=ns,e.LogType=ue,e.LogaccessService=class extends oe{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){const t=await this.GetLogAccessInfo(),n={};t.Columns.Column.forEach(e=>n[e.LogType]=e.Name);const s=e=>{const t={};for(const s in n)t[s]=e?.fields?Object.assign({},...e.fields)[n[s]]??"":"";return t},r={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:re.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:re.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:re.SortColumType.ByDate,ColumnName:"",Direction:0}]}},i=[];for(const o in e){let t,s;if(o in n&&(t=Object.values(re.LogColumnType).includes(o)?o:n[o]),t){switch(t){case re.LogColumnType.workunits:case"hpcc.log.jobid":s=re.LogAccessType.ByJobID;break;case re.LogColumnType.audience:case"hpcc.log.audience":s=re.LogAccessType.ByTargetAudience;break;case re.LogColumnType.class:case"hpcc.log.class":s=re.LogAccessType.ByLogType;break;case re.LogColumnType.components:case"kubernetes.container.name":s=re.LogAccessType.ByComponent;break;default:s=re.LogAccessType.ByFieldName,t=n[o]}if(Array.isArray(e[o]))e[o].forEach(e=>{s===re.LogAccessType.ByComponent&&(e+="*"),i.push({LogCategory:s,SearchField:t,SearchByValue:e})});else{let n=e[o];s===re.LogAccessType.ByComponent&&(n+="*"),i.push({LogCategory:s,SearchField:t,SearchByValue:n})}}}if(i.length>2){let e=r.Filter.leftBinaryFilter.BinaryLogFilter[0];i.forEach((t,n)=>{let s=re.LogAccessFilterOperator.AND;n>0?(i[n-1].SearchField===t.SearchField&&(s=re.LogAccessFilterOperator.OR),n===i.length-1?(e.Operator=s,e.rightFilter=t):(e.Operator=s,e.rightBinaryFilter={BinaryLogFilter:[{leftFilter:t}]},e=e.rightBinaryFilter.BinaryLogFilter[0])):e.leftFilter=t})}else delete r.Filter.leftBinaryFilter,r.Filter.leftFilter={LogCategory:re.LogAccessType.All},i[0]?.SearchField&&(r.Filter.leftFilter={LogCategory:i[0]?.LogCategory,SearchField:i[0]?.SearchField,SearchByValue:i[0]?.SearchByValue}),i[1]?.SearchField&&(r.Filter.Operator=re.LogAccessFilterOperator.AND,i[0].SearchField===i[1].SearchField&&(r.Filter.Operator=re.LogAccessFilterOperator.OR),r.Filter.rightFilter={LogCategory:i[1]?.LogCategory,SearchField:i[1]?.SearchField,SearchByValue:i[1]?.SearchByValue});return e.StartDate&&(r.Range.StartDate=e.StartDate.toISOString()),e.EndDate&&(r.Range.EndDate=e.EndDate.toISOString()),this.GetLogs(r).then(e=>{try{const n=JSON.parse(e.LogLines);let r=[];switch(t.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":r=n.lines?.map(s)??[];break;default:ce.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),r=[]}return{lines:r,total:e.TotalLogLinesAvailable??1e4}}catch(n){ce.error(n.message??n)}return{lines:[],total:0}})}},e.LogicalFile=rr,e.LogicalFileCache=nr,e.Machine=cr,e.MachineCache=ir,e.MachineService=ye,e.PKG_NAME="@hpcc-js/comms",e.PKG_VERSION="3.9.4",e.PackageProcessService=class extends ve{},e.PropertyType=Ms,e.Query=wr,e.QueryGraph=br,e.RelatedProperty=ks,e.Resource=ms,e.ResourcesService=class extends Re{},e.Result=bs,e.ResultCache=Fs,e.SMCService=Ae,e.SashaService=class extends De{},e.Scope=Ts,e.ScopeEdge=ps,e.ScopeGraph=hs,e.ScopeSubgraph=ls,e.ScopeVertex=ds,e.Service=T,e.SourceFile=ws,e.Store=class Store{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new t.Dispatch;static attach(e,t="HPCCApps",n,s=!0){return xr.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:s,Namespace:n},()=>new Store(e,t,n,s))}constructor(e,t,n,s){this.connection=e instanceof we?e:new we(e),this.Name=t,this.UserSpecific=s,this.Namespace=n}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,n=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(s=>{const r=this._knownValues[e];this._knownValues[e]=t,n&&this._dispatch.post(new Er(e,t,r))}).catch(n=>{console.error(`Store.set("${e}", "${t}") failed:`,n)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(n=>{const s=this._knownValues[e];return this._knownValues[e]=n.Value,t&&this._dispatch.post(new Er(e,n.Value,s)),n.Value}).catch(t=>{console.error(`Store.get(${e}) failed:`,t)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{const n={},s=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(t=>{const r=this._knownValues[t.Key];this._knownValues[t.Key]=t.Value,delete s[t.Key],n[t.Key]=t.Value,e&&this._dispatch.post(new Er(t.Key,t.Value,r))}),e)for(const e in s)this._dispatch.post(new Er(e,void 0,s[e]));return n}).catch(e=>(console.error("Store.getAll failed:",e),{}))}delete(e,t=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(n=>{const s=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new Er(e,void 0,s))}).catch(t=>{console.error(`Store.delete(${e}) failed:`,t)})}monitor(e){return this._dispatch.attach(e)}},e.StoreCache=Pr,e.StoreService=we,e.TargetAudience=ae,e.TargetCluster=hr,e.TargetClusterCache=ur,e.Timer=Ps,e.Topology=gr,e.TopologyCache=dr,e.TopologyService=Le,e.ValueChangedMessage=Er,e.WUStateID=ke,Object.defineProperty(e,"WUUpdate",{enumerable:!0,get:function(){return Me}}),e.Workunit=zs,e.WorkunitCache=Js,e.WorkunitsService=Ve,e.WorkunitsServiceEx=Qe,Object.defineProperty(e,"WsAccess",{enumerable:!0,get:function(){return L}}),Object.defineProperty(e,"WsCodesign",{enumerable:!0,get:function(){return V}}),Object.defineProperty(e,"WsDfu",{enumerable:!0,get:function(){return B}}),Object.defineProperty(e,"WsLogaccess",{enumerable:!0,get:function(){return re}}),Object.defineProperty(e,"WsSMC",{enumerable:!0,get:function(){return be}}),Object.defineProperty(e,"WsSasha",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(e,"WsTopology",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(e,"WsWorkunits",{enumerable:!0,get:function(){return Ne}}),e.XGMMLEdge=us,e.XGMMLGraph=is,e.XGMMLSubgraph=os,e.XGMMLVertex=cs,e.XSDNode=fs,e.XSDSchema=_s,e.XSDSimpleType=Us,e.XSDXMLNode=Ss,Object.defineProperty(e,"createConnection",{enumerable:!0,get:function(){return b}}),e.createGraph=gs,e.createXGMMLGraph=as,e.defaultTargetCluster=function(e){if(!lr[e.baseUrl]){let t;t=e instanceof Le?e:new Le(e),lr[e.baseUrl]=t.TpListTargetClusters({}).then(t=>{let n,s,r;t.TargetClusters.TpClusterNameType.forEach(e=>{n||(n=e),s||!0!==e.IsDefault||(s=e),r||"hthor"!==e.Type||(r=e)});const i=s||r||n;return hr.attach(e,i.Name,i)})}return lr[e.baseUrl]},e.deserializeResponse=m,e.get=v,e.hookSend=function(e){const t=C;return e&&(C=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=F,e.isECLResult=Ge,e.isExceptions=function(e){return e instanceof W||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=vs,e.parseXSD2=function(e,t){const n=new Rs(t);return n.parse(e),n.schema},e.post=y,e.send=R,e.serializeRequest=g,e.setTransportFactory=function(e){const t=b;return b=e,t},e.splitMetric=Qs,e.targetClusters=function(e){let t;return t=e instanceof Le?e:new Le(e),t.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(t=>hr.attach(e,t.Name,t)))}});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/util"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/comms"]={},e["@hpcc-js/util"])}(this,function(e,t){var n,s,r,i=Object.create,o=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,a=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;r=null!=(n=t)?i(a(n)):{};var l=(0,(t=((e,t,n,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var r,i=u(t),a=0,l=i.length;a<l;a++)r=i[a],h.call(e,r)||r===n||o(e,r,{get:(e=>t[e]).bind(null,r),enumerable:!(s=c(t,r))||s.enumerable});return e})(!s&&n&&n.__esModule?r:o(r,"default",{value:n,enumerable:!0}),n)).scopedLogger)("comms/connection.ts");var d={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function p(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function g(e,t=!0,n=""){if(n&&(n+="."),"object"!=typeof e)return p(e,t);const s=[];for(const r in e)if(e.hasOwnProperty(r))if(e[r]instanceof Array){let i=!1;e[r].forEach((e,o)=>{"object"==typeof e?(i=!0,s.push(g(e,t,n+p(`${r}.${o}`,t)))):s.push(n+p(`${r}_i${o}`,t)+"="+g(e,t))}),i&&s.push(n+p(`${r}.itemcount`,t)+"="+e[r].length)}else"object"==typeof e[r]?e[r]&&e[r].Item instanceof Array?(s.push(g(e[r].Item,t,n+p(r,t))),s.push(n+p(`${r}.itemcount`,t)+"="+e[r].Item.length)):s.push(g(e[r],t,n+p(r,t))):void 0!==e[r]?s.push(n+p(r,t)+"="+p(e[r],t)):s.push(n+p(r,t));return s.join("&")}function m(e){return JSON.parse(e)}function f(e,n,s={},r="json",i){return i&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let c=1e3*e.timeoutSecs;const u="jsonp_callback_"+Math.round(999999*Math.random());window[u]=function(e){c=0,p(),i("json"===r&&"string"==typeof e?m(e):e)};const a=document.createElement("script");let h=(0,t.join)(e.baseUrl,n);h+=h.indexOf("?")>=0?"&":"?",a.src=h+"jsonp="+u+"&"+g(s,e.encodeRequest),document.body.appendChild(a);const d=setInterval(function(){c<=0?clearInterval(d):(c-=5e3,c<=0?(clearInterval(d),l.error("Request timeout: "+a.src),p(),o(Error("Request timeout: "+a.src))):l.debug("Request pending ("+c/1e3+" sec): "+a.src))},5e3);function p(){delete window[u],document.body.removeChild(a)}})}function S(e){return e.userID?{Authorization:`Basic ${btoa(`${e.userID}:${e.password}`)}`}:{}}var U={};function _(e,n,s,r,i){function o(e){if(e.ok)return"json"===i?e.json():e.text();throw new Error(e.statusText)}return r={...S(e),...r},s={credentials:U[e.baseUrl]?"omit":"include",...s,headers:r},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):s.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(s.agent=fetch.__trustwaveAgent)),(0,t.promiseTimeout)(1e3*e.timeoutSecs,fetch((0,t.join)(e.baseUrl,n),s).then(o).catch(r=>(s.credentials=U[e.baseUrl]?"include":"omit",fetch((0,t.join)(e.baseUrl,n),s).then(o).then(t=>(U[e.baseUrl]=!U[e.baseUrl],t)))))}function y(e,t,n,s="json",r){let i;return n.upload_&&(delete n.upload_,t+="?upload_"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),_(e,t,{method:"post",body:g(n,e.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function v(e,t,n,s="json",r){let i;return n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),_(e,`${t}?${g(n,e.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function R(e,t,n,s="json",r){let i;switch(e.type){case"jsonp":i=f(e,t,n,s,r);break;case"get":i=v(e,t,n,s,r);break;default:i=y(e,t,n,s,r)}return i}var C=R;var D=class Connection{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return 0===arguments.length?this._opts:(this._opts={...d,...e},this)}send(e,t,n="json",s){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,C,s):C(this._opts,e,t,n,s)}clone(){return new Connection(this.opts())}};let b=function(e){return new D(e)};function F(e){return"[object Array]"===Object.prototype.toString.call(e)}var W=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,n){super("ESPException: "+n.Source),this.action=e,this.request=t,this.Source=n.Source,this.Exception=n.Exception,n.Exception.length?this.message=`${n.Exception[0].Code}: ${n.Exception[0].Message}`:this.message=""}};var A=class ESPConnection{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,n){this._connection=function(e){return void 0!==e.send}(e)?e:b(e),this._service=t,this._version=n}service(e){return void 0===e?this._service:(this._service=e,this)}version(e){return void 0===e?this._version:(this._version=e,this)}toESPStringArray(e,t){if(F(e[t])){for(let n=0;n<e[t].length;++n)e[t+"_i"+n]=e[t][n];delete e[t]}return e}opts(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)}send(e,n={},s="json",r=!1,i,o){const c={...n,ver_:this._version};let u;r&&(c.upload_=!0),i&&(c.abortSignal_=i);let a="json";switch(s){case"text":u=(0,t.join)(this._service,e),a="text";break;case"xsd":u=(0,t.join)(this._service,e+".xsd"),a="text";break;case"json2":u=(0,t.join)(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:u=(0,t.join)(this._service,e+".json")}return this._connection.send(u,c,a).then(t=>{if("json"===s){let n;if(t&&t.Exceptions)throw new W(e,c,t.Exceptions);if(t&&(n=t[o||e+"Response"]),!n)throw new W(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return n}return t})}clone(){return new ESPConnection(this._connection.clone(),this._service,this._version)}},T=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,n){this._connection=new A(e,t,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};let w;(w||(w={})).DFUWUActions=function(e){return e.Delete="Delete",e.Protect="Protect",e.Unprotect="Unprotect",e.Restore="Restore",e.SetToFailed="SetToFailed",e.Archive="Archive",e}({});var P=class extends T{constructor(e){super(e,"FileSpray","1.27")}AbortDFUWorkunit(e){return this._connection.send("AbortDFUWorkunit",e,"json",!1,void 0,"AbortDFUWorkunitResponse")}Copy(e){return this._connection.send("Copy",e,"json",!1,void 0,"CopyResponse")}CreateDFUPublisherWorkunit(e){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e){return this._connection.send("CreateDFUWorkunit",e,"json",!1,void 0,"CreateDFUWorkunitResponse")}DFUWUFile(e){return this._connection.send("DFUWUFile",e,"json",!1,void 0,"DFUWUFileResponse")}DFUWUSearch(e){return this._connection.send("DFUWUSearch",e,"json",!1,void 0,"DFUWUSearchResponse")}DFUWorkunitsAction(e){return this._connection.send("DFUWorkunitsAction",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,void 0,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,void 0,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}Despray(e){return this._connection.send("Despray",e,"json",!1,void 0,"DesprayResponse")}DfuMonitor(e){return this._connection.send("DfuMonitor",e,"json",!1,void 0,"DfuMonitorResponse")}DropZoneFileSearch(e){return this._connection.send("DropZoneFileSearch",e,"json",!1,void 0,"DropZoneFileSearchResponse")}DropZoneFiles(e){return this._connection.send("DropZoneFiles",e,"json",!1,void 0,"DropZoneFilesResponse")}EchoDateTime(e){return this._connection.send("EchoDateTime",e,"json",!1,void 0,"EchoDateTimeResponse")}FileList(e){return this._connection.send("FileList",e,"json",!1,void 0,"FileListResponse")}GetDFUExceptions(e){return this._connection.send("GetDFUExceptions",e,"json",!1,void 0,"GetDFUExceptionsResponse")}GetDFUProgress(e){return this._connection.send("GetDFUProgress",e,"json",!1,void 0,"ProgressResponse")}GetDFUServerQueues(e){return this._connection.send("GetDFUServerQueues",e,"json",!1,void 0,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e){return this._connection.send("GetDFUWorkunit",e,"json",!1,void 0,"GetDFUWorkunitResponse")}GetDFUWorkunits(e){return this._connection.send("GetDFUWorkunits",e,"json",!1,void 0,"GetDFUWorkunitsResponse")}GetRemoteTargets(e){return this._connection.send("GetRemoteTargets",e,"json",!1,void 0,"GetRemoteTargetsResponse")}GetSprayTargets(e){return this._connection.send("GetSprayTargets",e,"json",!1,void 0,"GetSprayTargetsResponse")}OpenSave(e){return this._connection.send("OpenSave",e,"json",!1,void 0,"OpenSaveResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"FileSprayPingResponse")}Rename(e){return this._connection.send("Rename",e,"json",!1,void 0,"RenameResponse")}Replicate(e){return this._connection.send("Replicate",e,"json",!1,void 0,"ReplicateResponse")}ShowResult(e){return this._connection.send("ShowResult",e,"json",!1,void 0,"ShowResultResponse")}SprayFixed(e){return this._connection.send("SprayFixed",e,"json",!1,void 0,"SprayFixedResponse")}SprayVariable(e){return this._connection.send("SprayVariable",e,"json",!1,void 0,"SprayResponse")}SubmitDFUWorkunit(e){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,void 0,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};let x=function(e){return e[e.unknown=0]="unknown",e[e.scheduled=1]="scheduled",e[e.queued=2]="queued",e[e.started=3]="started",e[e.aborted=4]="aborted",e[e.failed=5]="failed",e[e.finished=6]="finished",e[e.monitoring=7]="monitoring",e[e.aborting=8]="aborting",e[e.notfound=999]="notfound",e}({});var E=class extends P{DFUWUFileEx(e){return this._connection.send("DFUWUFile",e,"text")}SprayFixedEx(e){return this._connection.send("SprayFixed",e)}SprayVariableEx(e){return this._connection.send("SprayVariable",e,"json",!1,null,"SprayResponse")}DesprayEx(e){return this._connection.send("Despray",e)}UpdateDFUWorkunitEx(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};let L;var N;(N=L||(L={})).ViewMemberType=function(e){return e.User="User",e.Group="Group",e}({}),N.UserSortBy=function(e){return e.username="username",e.fullname="fullname",e.passwordexpiration="passwordexpiration",e.employeeID="employeeID",e.employeeNumber="employeeNumber",e}({}),N.GroupSortBy=function(e){return e.Name="Name",e.ManagedBy="ManagedBy",e}({}),N.AccountTypeReq=function(e){return e.Any="Any",e.User="User",e.Group="Group",e}({}),N.ResourcePermissionSortBy=function(e){return e.Name="Name",e.Type="Type",e}({}),N.ResourceSortBy=function(e){return e.Name="Name",e}({});var j=class extends T{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e){return this._connection.send("AccountPermissions",e,"json",!1,void 0,"AccountPermissionsResponse")}AccountPermissionsV2(e){return this._connection.send("AccountPermissionsV2",e,"json",!1,void 0,"AccountPermissionsV2Response")}AddUser(e){return this._connection.send("AddUser",e,"json",!1,void 0,"AddUserResponse")}AddView(e){return this._connection.send("AddView",e,"json",!1,void 0,"AddViewResponse")}AddViewColumn(e){return this._connection.send("AddViewColumn",e,"json",!1,void 0,"AddViewColumnResponse")}AddViewMember(e){return this._connection.send("AddViewMember",e,"json",!1,void 0,"AddViewMemberResponse")}ClearPermissionsCache(e){return this._connection.send("ClearPermissionsCache",e,"json",!1,void 0,"ClearPermissionsCacheResponse")}DeleteView(e){return this._connection.send("DeleteView",e,"json",!1,void 0,"DeleteViewResponse")}DeleteViewColumn(e){return this._connection.send("DeleteViewColumn",e,"json",!1,void 0,"DeleteViewColumnResponse")}DeleteViewMember(e){return this._connection.send("DeleteViewMember",e,"json",!1,void 0,"DeleteViewMemberResponse")}DisableScopeScans(e){return this._connection.send("DisableScopeScans",e,"json",!1,void 0,"DisableScopeScansResponse")}EnableScopeScans(e){return this._connection.send("EnableScopeScans",e,"json",!1,void 0,"EnableScopeScansResponse")}FilePermission(e){return this._connection.send("FilePermission",e,"json",!1,void 0,"FilePermissionResponse")}GroupAction(e){return this._connection.send("GroupAction",e,"json",!1,void 0,"GroupActionResponse")}GroupAdd(e){return this._connection.send("GroupAdd",e,"json",!1,void 0,"GroupAddResponse")}GroupEdit(e){return this._connection.send("GroupEdit",e,"json",!1,void 0,"GroupEditResponse")}GroupMemberEdit(e){return this._connection.send("GroupMemberEdit",e,"json",!1,void 0,"GroupMemberEditResponse")}GroupMemberEditInput(e){return this._connection.send("GroupMemberEditInput",e,"json",!1,void 0,"GroupMemberEditInputResponse")}GroupMemberQuery(e){return this._connection.send("GroupMemberQuery",e,"json",!1,void 0,"GroupMemberQueryResponse")}GroupQuery(e){return this._connection.send("GroupQuery",e,"json",!1,void 0,"GroupQueryResponse")}Groups(e){return this._connection.send("Groups",e,"json",!1,void 0,"GroupResponse")}PermissionAction(e){return this._connection.send("PermissionAction",e,"json",!1,void 0,"PermissionActionResponse")}Permissions(e){return this._connection.send("Permissions",e,"json",!1,void 0,"BasednsResponse")}PermissionsReset(e){return this._connection.send("PermissionsReset",e,"json",!1,void 0,"PermissionsResetResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accessPingResponse")}QueryScopeScansEnabled(e){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,void 0,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e){return this._connection.send("QueryUserViewColumns",e,"json",!1,void 0,"QueryUserViewColumnsResponse")}QueryViewColumns(e){return this._connection.send("QueryViewColumns",e,"json",!1,void 0,"QueryViewColumnsResponse")}QueryViewMembers(e){return this._connection.send("QueryViewMembers",e,"json",!1,void 0,"QueryViewMembersResponse")}QueryViews(e){return this._connection.send("QueryViews",e,"json",!1,void 0,"QueryViewsResponse")}ResourceAdd(e){return this._connection.send("ResourceAdd",e,"json",!1,void 0,"ResourceAddResponse")}ResourceDelete(e){return this._connection.send("ResourceDelete",e,"json",!1,void 0,"ResourceDeleteResponse")}ResourcePermissionQuery(e){return this._connection.send("ResourcePermissionQuery",e,"json",!1,void 0,"ResourcePermissionQueryResponse")}ResourcePermissions(e){return this._connection.send("ResourcePermissions",e,"json",!1,void 0,"ResourcePermissionsResponse")}ResourceQuery(e){return this._connection.send("ResourceQuery",e,"json",!1,void 0,"ResourceQueryResponse")}Resources(e){return this._connection.send("Resources",e,"json",!1,void 0,"ResourcesResponse")}UserAccountExport(e){return this._connection.send("UserAccountExport",e,"json",!1,void 0,"UserAccountExportResponse")}UserAction(e){return this._connection.send("UserAction",e,"json",!1,void 0,"UserActionResponse")}UserEdit(e){return this._connection.send("UserEdit",e,"json",!1,void 0,"UserEditResponse")}UserGroupEdit(e){return this._connection.send("UserGroupEdit",e,"json",!1,void 0,"UserGroupEditResponse")}UserGroupEditInput(e){return this._connection.send("UserGroupEditInput",e,"json",!1,void 0,"UserGroupEditInputResponse")}UserInfoEdit(e){return this._connection.send("UserInfoEdit",e,"json",!1,void 0,"UserInfoEditResponse")}UserInfoEditInput(e){return this._connection.send("UserInfoEditInput",e,"json",!1,void 0,"UserInfoEditInputResponse")}UserPosix(e){return this._connection.send("UserPosix",e,"json",!1,void 0,"UserPosixResponse")}UserPosixInput(e){return this._connection.send("UserPosixInput",e,"json",!1,void 0,"UserPosixInputResponse")}UserQuery(e){return this._connection.send("UserQuery",e,"json",!1,void 0,"UserQueryResponse")}UserResetPass(e){return this._connection.send("UserResetPass",e,"json",!1,void 0,"UserResetPassResponse")}UserResetPassInput(e){return this._connection.send("UserResetPassInput",e,"json",!1,void 0,"UserResetPassInputResponse")}UserSudoers(e){return this._connection.send("UserSudoers",e,"json",!1,void 0,"UserSudoersResponse")}UserSudoersInput(e){return this._connection.send("UserSudoersInput",e,"json",!1,void 0,"UserSudoersInputResponse")}Users(e){return this._connection.send("Users",e,"json",!1,void 0,"UserResponse")}},I=class extends T{constructor(e){super(e,"ws_account","1.07")}MyAccount(e){return this._connection.send("MyAccount",e,"json",!1,void 0,"MyAccountResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accountPingResponse")}UpdateUser(e){return this._connection.send("UpdateUser",e,"json",!1,void 0,"UpdateUserResponse")}UpdateUserInput(e){return this._connection.send("UpdateUserInput",e,"json",!1,void 0,"UpdateUserInputResponse")}VerifyUser(e){return this._connection.send("VerifyUser",e,"json",!1,void 0,"VerifyUserResponse")}},M=class extends T{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e){return this._connection.send("GetPODs",e,"json",!1,void 0,"GetPODsResponse")}GetServices(e){return this._connection.send("GetServices",e,"json",!1,void 0,"GetServicesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsCloudPingResponse")}},k=(0,t.scopedLogger)("@hpcc-js/comms/services/wsCloud.ts");function G(e){return e.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(t=>{e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e),[])??[]}let V;(V||(V={})).SigningMethodType=function(e){return e.gpg="gpg",e}({});var Q=class extends T{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e){return this._connection.send("ListUserIDs",e,"json",!1,void 0,"ListUserIDsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_codesignPingResponse")}Sign(e){return this._connection.send("Sign",e,"json",!1,void 0,"SignResponse")}Verify(e){return this._connection.send("Verify",e,"json",!1,void 0,"VerifyResponse")}},O=class extends T{constructor(e){super(e,"WSDali","1.07")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"ResultResponse")}ClearTraceTransactions(e){return this._connection.send("ClearTraceTransactions",e,"json",!1,void 0,"ResultResponse")}Count(e){return this._connection.send("Count",e,"json",!1,void 0,"CountResponse")}DFSCheck(e){return this._connection.send("DFSCheck",e,"json",!1,void 0,"ResultResponse")}DFSExists(e){return this._connection.send("DFSExists",e,"json",!1,void 0,"BooleanResponse")}DFSLS(e){return this._connection.send("DFSLS",e,"json",!1,void 0,"ResultResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"ResultResponse")}DisconnectClientConnection(e){return this._connection.send("DisconnectClientConnection",e,"json",!1,void 0,"ResultResponse")}GetClients(e){return this._connection.send("GetClients",e,"json",!1,void 0,"ResultResponse")}GetConnections(e){return this._connection.send("GetConnections",e,"json",!1,void 0,"ResultResponse")}GetDFSCSV(e){return this._connection.send("GetDFSCSV",e,"json",!1,void 0,"ResultResponse")}GetDFSMap(e){return this._connection.send("GetDFSMap",e,"json",!1,void 0,"ResultResponse")}GetDFSParents(e){return this._connection.send("GetDFSParents",e,"json",!1,void 0,"ResultResponse")}GetLogicalFile(e){return this._connection.send("GetLogicalFile",e,"json",!1,void 0,"ResultResponse")}GetLogicalFilePart(e){return this._connection.send("GetLogicalFilePart",e,"json",!1,void 0,"ResultResponse")}GetProtectedList(e){return this._connection.send("GetProtectedList",e,"json",!1,void 0,"ResultResponse")}GetSDSStats(e){return this._connection.send("GetSDSStats",e,"json",!1,void 0,"ResultResponse")}GetSDSSubscribers(e){return this._connection.send("GetSDSSubscribers",e,"json",!1,void 0,"ResultResponse")}GetValue(e){return this._connection.send("GetValue",e,"json",!1,void 0,"ResultResponse")}Import(e){return this._connection.send("Import",e,"json",!1,void 0,"ResultResponse")}ListSDSLocks(e){return this._connection.send("ListSDSLocks",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSDaliPingResponse")}SaveSDSStore(e){return this._connection.send("SaveSDSStore",e,"json",!1,void 0,"ResultResponse")}SetLogicalFilePartAttr(e){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,void 0,"ResultResponse")}SetProtected(e){return this._connection.send("SetProtected",e,"json",!1,void 0,"ResultResponse")}SetTraceSlowTransactions(e){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,void 0,"ResultResponse")}SetTraceTransactions(e){return this._connection.send("SetTraceTransactions",e,"json",!1,void 0,"ResultResponse")}SetUnprotected(e){return this._connection.send("SetUnprotected",e,"json",!1,void 0,"ResultResponse")}SetValue(e){return this._connection.send("SetValue",e,"json",!1,void 0,"ResultResponse")}UnlockSDSLock(e){return this._connection.send("UnlockSDSLock",e,"json",!1,void 0,"ResultResponse")}};let B;var H;(H=B||(B={})).DFUArrayActions=function(e){return e.Delete="Delete",e.AddToSuperfile="Add To Superfile",e.ChangeProtection="Change Protection",e.ChangeRestriction="Change Restriction",e}({}),H.DFUChangeProtection=function(e){return e[e.NoChange=0]="NoChange",e[e.Protect=1]="Protect",e[e.Unprotect=2]="Unprotect",e[e.UnprotectAll=3]="UnprotectAll",e}({}),H.DFUChangeRestriction=function(e){return e[e.NoChange=0]="NoChange",e[e.Restrict=1]="Restrict",e[e.Unrestricted=2]="Unrestricted",e}({}),H.DFUDefFileFormat=function(e){return e.xml="xml",e.def="def",e}({}),H.FileAccessRole=function(e){return e.Token="Token",e.Engine="Engine",e.External="External",e}({}),H.SecAccessType=function(e){return e.None="None",e.Access="Access",e.Read="Read",e.Write="Write",e.Full="Full",e}({}),H.DFUFileType=function(e){return e.Flat="Flat",e.Index="Index",e.Xml="Xml",e.Csv="Csv",e.Json="Json",e.IndexLocal="IndexLocal",e.IndexPartitioned="IndexPartitioned",e.Unset="Unset",e}({});var X=class extends T{constructor(e){super(e,"WsDfu","1.67")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"AddResponse")}AddRemote(e){return this._connection.send("AddRemote",e,"json",!1,void 0,"AddRemoteResponse")}AddtoSuperfile(e){return this._connection.send("AddtoSuperfile",e,"json",!1,void 0,"AddtoSuperfileResponse")}DFUArrayAction(e){return this._connection.send("DFUArrayAction",e,"json",!1,void 0,"DFUArrayActionResponse")}DFUBrowseData(e){return this._connection.send("DFUBrowseData",e,"json",!1,void 0,"DFUBrowseDataResponse")}DFUDefFile(e){return this._connection.send("DFUDefFile",e,"json",!1,void 0,"DFUDefFileResponse")}DFUFileAccess(e){return this._connection.send("DFUFileAccess",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileAccessV2(e){return this._connection.send("DFUFileAccessV2",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileCreate(e){return this._connection.send("DFUFileCreate",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFileCreateV2(e){return this._connection.send("DFUFileCreateV2",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFilePublish(e){return this._connection.send("DFUFilePublish",e,"json",!1,void 0,"DFUFilePublishResponse")}DFUFileView(e){return this._connection.send("DFUFileView",e,"json",!1,void 0,"DFUFileViewResponse")}DFUGetDataColumns(e){return this._connection.send("DFUGetDataColumns",e,"json",!1,void 0,"DFUGetDataColumnsResponse")}DFUGetFileMetaData(e){return this._connection.send("DFUGetFileMetaData",e,"json",!1,void 0,"DFUGetFileMetaDataResponse")}DFUGetMetaInquiry(e){return this._connection.send("DFUGetMetaInquiry",e,"json",!1,void 0,"DFUMetaInquiryResponse")}DFUInfo(e){return this._connection.send("DFUInfo",e,"json",!1,void 0,"DFUInfoResponse")}DFUQuery(e){return this._connection.send("DFUQuery",e,"json",!1,void 0,"DFUQueryResponse")}DFURecordTypeInfo(e){return this._connection.send("DFURecordTypeInfo",e,"json",!1,void 0,"DFURecordTypeInfoResponse")}DFUSearch(e){return this._connection.send("DFUSearch",e,"json",!1,void 0,"DFUSearchResponse")}DFUSearchData(e){return this._connection.send("DFUSearchData",e,"json",!1,void 0,"DFUSearchDataResponse")}DFUSpace(e){return this._connection.send("DFUSpace",e,"json",!1,void 0,"DFUSpaceResponse")}EclRecordTypeInfo(e){return this._connection.send("EclRecordTypeInfo",e,"json",!1,void 0,"EclRecordTypeInfoResponse")}EraseHistory(e){return this._connection.send("EraseHistory",e,"json",!1,void 0,"EraseHistoryResponse")}ListHistory(e){return this._connection.send("ListHistory",e,"json",!1,void 0,"ListHistoryResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDfuPingResponse")}Savexml(e){return this._connection.send("Savexml",e,"json",!1,void 0,"SavexmlResponse")}SuperfileAction(e){return this._connection.send("SuperfileAction",e,"json",!1,void 0,"SuperfileActionResponse")}SuperfileList(e){return this._connection.send("SuperfileList",e,"json",!1,void 0,"SuperfileListResponse")}};const $=B.DFUArrayActions,J=B.DFUDefFileFormat,q=B.DFUChangeProtection,z=B.DFUChangeRestriction;var Y=class extends X{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){const t=[],n=[];return await Promise.all(e.map(e=>this.DFUInfo({Cluster:e.NodeGroup,Name:e.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(e=>{for(const n of e?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(n);for(const t of e?.FileDetail?.subfiles?.Item??[])n.push(t)}))),n.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}},K=class extends T{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e,"json",!1,void 0,"DFUXRefArrayActionResponse")}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e,"json",!1,void 0,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,void 0,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,void 0,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,"json",!1,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,"json",!1,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,void 0,"DFUXRefUnusedFilesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDFUXRefPingResponse")}};function Z(e,t){const 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:ee(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){const n=typeof t.Item[0];if("string"===n||"number"===n)return{id:e,type:"set",fieldType:n};throw new Error("Unknown field type")}return{id:e,type:"object",fields:te(t)}}default:throw new Error("Unknown field type")}}function ee(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);const t=[];for(const n in e)t.push(Z(n,e[n]));return t}function te(e){const t={};for(const n in e)t[n]=Z(n,e[n]);return t}var ne=class extends T{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,t){return this._connection.send(`example/request/query/${e}/${t}/json`,{},"text").then(e=>{const t=JSON.parse(e);for(const n in t)return t[n];return{}}).then(ee)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(e=>{const t=JSON.parse(e);for(const n in t)return t[n].Results;return{}}).then(e=>{const t={};for(const n in e)t[n]=ee(e[n]);return t})}submit(e,t,n){const s=`submit/query/${e}/${t}`;return this._connection.send(s,n,"json2").then(e=>{if(e.Results&&e.Results.Exception)throw new W(s,n,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})}},se=class extends T{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e,"json",!1,void 0,"GetConfigDetailsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_elkPingResponse")}};let re;var ie;(ie=re||(re={})).LogColumnType=function(e){return e.global="global",e.workunits="workunits",e.components="components",e.audience="audience",e.class="class",e.instance="instance",e.node="node",e.message="message",e.logid="logid",e.processid="processid",e.threadid="threadid",e.timestamp="timestamp",e.pod="pod",e.traceid="traceid",e.spanid="spanid",e}({}),ie.LogColumnValueType=function(e){return e.string="string",e.numeric="numeric",e.datetime="datetime",e.enum="enum",e.epoch="epoch",e}({}),ie.LogAccessType=function(e){return e[e.All=0]="All",e[e.ByJobID=1]="ByJobID",e[e.ByComponent=2]="ByComponent",e[e.ByLogType=3]="ByLogType",e[e.ByTargetAudience=4]="ByTargetAudience",e[e.BySourceInstance=5]="BySourceInstance",e[e.BySourceNode=6]="BySourceNode",e[e.ByFieldName=7]="ByFieldName",e[e.ByPod=8]="ByPod",e[e.ByTraceID=9]="ByTraceID",e[e.BySpanID=10]="BySpanID",e}({}),ie.LogAccessStatusCode=function(e){return e[e.Success=0]="Success",e[e.Warning=1]="Warning",e[e.Fail=2]="Fail",e}({}),ie.LogAccessFilterOperator=function(e){return e[e.NONE=0]="NONE",e[e.AND=1]="AND",e[e.OR=2]="OR",e}({}),ie.LogSelectColumnMode=function(e){return e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM",e}({}),ie.SortColumType=function(e){return e[e.ByDate=0]="ByDate",e[e.ByJobID=1]="ByJobID",e[e.ByComponent=2]="ByComponent",e[e.ByLogType=3]="ByLogType",e[e.ByTargetAudience=4]="ByTargetAudience",e[e.BySourceInstance=5]="BySourceInstance",e[e.BySourceNode=6]="BySourceNode",e[e.ByFieldName=7]="ByFieldName",e[e.ByPod=8]="ByPod",e[e.ByTraceID=9]="ByTraceID",e[e.BySpanID=10]="BySpanID",e}({}),ie.SortDirection=function(e){return e[e.ASC=0]="ASC",e[e.DSC=1]="DSC",e}({});var oe=class extends T{constructor(e){super(e,"ws_logaccess","1.08")}GetHealthReport(e){return this._connection.send("GetHealthReport",e,"json",!1,void 0,"GetHealthReportResponse")}GetLogAccessInfo(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")}GetLogs(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")}},ce=(0,t.scopedLogger)("@hpcc-js/comms/services/wsLogaccess.ts");let ue=function(e){return e.Disaster="DIS",e.Error="ERR",e.Warning="WRN",e.Information="INF",e.Progress="PRO",e.Metric="MET",e}({}),ae=function(e){return e.Operator="OPR",e.User="USR",e.Programmer="PRO",e.Audit="ADT",e}({});function he(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var le,de;1===(le=he).length&&(de=le,le=function(e,t){return he(de(e),t)});function pe(e){return null===e?NaN:+e}var ge=Array.prototype;ge.slice,ge.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);function me(e,t){var n,s,r=e.length,i=-1;if(null==t){for(;++i<r;)if(null!=(n=e[i])&&n>=n)for(s=n;++i<r;)null!=(n=e[i])&&n>s&&(s=n)}else for(;++i<r;)if(null!=(n=t(e[i],i,e))&&n>=n)for(s=n;++i<r;)null!=(n=t(e[i],i,e))&&n>s&&(s=n);return s}function fe(e,t){var n,s=e.length,r=s,i=-1,o=0;if(null==t)for(;++i<s;)isNaN(n=pe(e[i]))?--r:o+=n;else for(;++i<s;)isNaN(n=pe(t(e[i],i,e)))?--r:o+=n;if(r)return o/r}let Se;var Ue;(Ue=Se||(Se={})).ThresholdType=function(e){return e[e.THRESHOLD_PERCENTAGE=0]="THRESHOLD_PERCENTAGE",e[e.THRESHOLD_MB=1]="THRESHOLD_MB",e}({}),Ue.TpMachineType=function(e){return e.ALLNODES="ALLNODES",e.THORMACHINES="THORMACHINES",e.HOLEMACHINES="HOLEMACHINES",e.ROXIEMACHINES="ROXIEMACHINES",e.MACHINES="MACHINES",e.AVAILABLEMACHINES="AVAILABLEMACHINES",e.DROPZONE="DROPZONE",e.STANDBYNNODE="STANDBYNNODE",e.THORSPARENODES="THORSPARENODES",e.HOLESTANDBYNODES="HOLESTANDBYNODES",e}({});var _e=class extends T{constructor(e){super(e,"ws_machine","1.19")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e,"json",!1,void 0,"GetComponentStatusResponse")}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e,"json",!1,void 0,"GetComponentUsageResponse")}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e,"json",!1,void 0,"GetMachineInfoResponse")}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e,"json",!1,void 0,"GetMachineInfoResponseEx")}GetMetrics(e){return this._connection.send("GetMetrics",e,"json",!1,void 0,"MetricsResponse")}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e,"json",!1,void 0,"GetNodeGroupUsageResponse")}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e,"json",!1,void 0,"GetTargetClusterInfoResponse")}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e,"json",!1,void 0,"GetTargetClusterUsageResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_machinePingResponse")}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e,"json",!1,void 0,"UpdateComponentStatusResponse")}},ye=class extends _e{GetTargetClusterUsageEx(e,n=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:n}).then(e=>(0,t.exists)("TargetClusterUsages.TargetClusterUsage",e)?e.TargetClusterUsages.TargetClusterUsage:[]).then(e=>e.filter(e=>!!e.ComponentUsages).map(e=>{const t=e.ComponentUsages.ComponentUsage.map(e=>{const t=(e.MachineUsages&&e.MachineUsages.MachineUsage?e.MachineUsages.MachineUsage:[]).map(e=>{const t=e.DiskUsages&&e.DiskUsages.DiskUsage?e.DiskUsages.DiskUsage.map(e=>({...e,InUse:1024*e.InUse,Total:1024*(e.InUse+e.Available),PercentUsed:100-e.PercentAvailable})):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:fe(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed),max:me(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed)}});return{Type:e.Type,Name:e.Name,Description:e.Description,MachineUsages:t,MachineUsagesDescription:t.reduce((e,t)=>e+(t.Description||""),""),mean:fe(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:me(t.filter(e=>!isNaN(e.max)),e=>e.max)}});return{Name:e.Name,Description:e.Description,ComponentUsages:t,ComponentUsagesDescription:t.reduce((e,t)=>e+(t.MachineUsagesDescription||""),""),mean:fe(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:me(t.filter(e=>!isNaN(e.max)),e=>e.max)}}))}},ve=class extends T{constructor(e){super(e,"WsPackageProcess","1.07")}ActivatePackage(e){return this._connection.send("ActivatePackage",e,"json",!1,void 0,"ActivatePackageResponse")}AddPackage(e){return this._connection.send("AddPackage",e,"json",!1,void 0,"AddPackageResponse")}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e,"json",!1,void 0,"AddPartToPackageMapResponse")}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e,"json",!1,void 0,"CopyPackageMapResponse")}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e,"json",!1,void 0,"DeActivatePackageResponse")}DeletePackage(e){return this._connection.send("DeletePackage",e,"json",!1,void 0,"DeletePackageResponse")}Echo(e){return this._connection.send("Echo",e,"json",!1,void 0,"EchoResponse")}GetPackage(e){return this._connection.send("GetPackage",e,"json",!1,void 0,"GetPackageResponse")}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e,"json",!1,void 0,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,void 0,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e,"json",!1,void 0,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e,"json",!1,void 0,"GetQueryFileMappingResponse")}ListPackage(e){return this._connection.send("ListPackage",e,"json",!1,void 0,"ListPackageResponse")}ListPackages(e){return this._connection.send("ListPackages",e,"json",!1,void 0,"ListPackagesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,void 0,"RemovePartFromPackageMapResponse")}ValidatePackage(e){return this._connection.send("ValidatePackage",e,"json",!1,void 0,"ValidatePackageResponse")}},Re=class extends T{constructor(e){super(e,"WsResources","1.01")}Ping(e){return this._connection.send("Ping",e)}ServiceQuery(e){return this._connection.send("ServiceQuery",e)}WebLinksQuery(e){return this._connection.send("WebLinksQuery",e)}};let Ce;(Ce||(Ce={})).WUTypes=function(e){return e.ECL="ECL",e.DFU="DFU",e}({});var De=class extends T{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e){return this._connection.send("ArchiveWU",e,"json",!1,void 0,"ResultResponse")}GetVersion(e){return this._connection.send("GetVersion",e,"json",!1,void 0,"ResultResponse")}ListWU(e){return this._connection.send("ListWU",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSSashaPingResponse")}RestoreWU(e){return this._connection.send("RestoreWU",e,"json",!1,void 0,"ResultResponse")}};let be;var Fe;(Fe=be||(be={})).LockModes=function(e){return e.ALL="ALL",e.READ="READ",e.WRITE="WRITE",e.HOLD="HOLD",e.SUB="SUB",e}({}),Fe.RoxieControlCmdType=function(e){return e.Attach="Attach",e.Detach="Detach",e.State="State",e.Reload="Reload",e.ReloadRetry="ReloadRetry",e.MemLock="MemLock",e.MemUnlock="MemUnlock",e.GetMemLocked="GetMemLocked",e}({});var We=class extends T{constructor(e){super(e,"WsSMC","1.28")}Activity(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")}BrowseResources(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")}ClearQueue(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")}GetBuildInfo(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")}GetGlobalMetrics(e){return this._connection.send("GetGlobalMetrics",e,"json",!1,void 0,"GetGlobalMetricsResponse")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}},Ae=class extends We{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(e=>({Running:{ActiveWorkunit:[]},...e}))}},Te=class extends T{constructor(e){super(e,"wsstore","1.02")}CreateStore(e){return this._connection.send("CreateStore",e,"json",!1,void 0,"CreateStoreResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"DeleteResponse")}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e,"json",!1,void 0,"DeleteNamespaceResponse")}Fetch(e){return this._connection.send("Fetch",e,"json",!1,void 0,"FetchResponse")}FetchAll(e){return this._connection.send("FetchAll",e,"json",!1,void 0,"FetchAllResponse")}FetchKeyMetadata(e){return this._connection.send("FetchKeyMetadata",e,"json",!1,void 0,"FetchKeyMDResponse")}ListKeys(e){return this._connection.send("ListKeys",e,"json",!1,void 0,"ListKeysResponse")}ListNamespaces(e){return this._connection.send("ListNamespaces",e,"json",!1,void 0,"ListNamespacesResponse")}ListStores(e){return this._connection.send("ListStores",e,"json",!1,void 0,"ListStoresResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"wsstorePingResponse")}Set(e){return this._connection.send("Set",e,"json",!1,void 0,"SetResponse")}},we=class extends Te{Delete(e){return super.Delete(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>-1===e.Code))return{Exceptions:void 0,Success:!0};throw e})}Fetch(e){return super.Fetch(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>-1===e.Code))return{Exceptions:void 0,Value:void 0};throw e})}};let Pe;var xe;(xe=Pe||(Pe={})).TpConfigResponseFormat=function(e){return e.XML="XML",e.YAML="YAML",e}({}),xe.RoxieQueueFilter=function(e){return e.All="All",e.QueriesOnly="QueriesOnly",e.WorkunitsOnly="WorkunitsOnly",e}({}),xe.TpMachineType=function(e){return e.ALLNODES="ALLNODES",e.THORMACHINES="THORMACHINES",e.HOLEMACHINES="HOLEMACHINES",e.ROXIEMACHINES="ROXIEMACHINES",e.MACHINES="MACHINES",e.AVAILABLEMACHINES="AVAILABLEMACHINES",e.DROPZONE="DROPZONE",e.STANDBYNNODE="STANDBYNNODE",e.THORSPARENODES="THORSPARENODES",e.HOLESTANDBYNODES="HOLESTANDBYNODES",e}({});var Ee=class extends T{constructor(e){super(e,"WsTopology","1.33")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsTopologyPingResponse")}SystemLog(e){return this._connection.send("SystemLog",e,"json",!1,void 0,"SystemLogResponse")}TpClusterInfo(e){return this._connection.send("TpClusterInfo",e,"json",!1,void 0,"TpClusterInfoResponse")}TpClusterQuery(e){return this._connection.send("TpClusterQuery",e,"json",!1,void 0,"TpClusterQueryResponse")}TpComponentConfiguration(e){return this._connection.send("TpComponentConfiguration",e,"json",!1,void 0,"TpComponentConfigurationResponse")}TpConfiguredComponents(e){return this._connection.send("TpConfiguredComponents",e,"json",!1,void 0,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e){return this._connection.send("TpDropZoneQuery",e,"json",!1,void 0,"TpDropZoneQueryResponse")}TpGetComponentFile(e){return this._connection.send("TpGetComponentFile",e,"json",!1,void 0,"TpGetComponentFileResponse")}TpGetServicePlugins(e){return this._connection.send("TpGetServicePlugins",e,"json",!1,void 0,"TpGetServicePluginsResponse")}TpGroupQuery(e){return this._connection.send("TpGroupQuery",e,"json",!1,void 0,"TpGroupQueryResponse")}TpListLogFiles(e){return this._connection.send("TpListLogFiles",e,"json",!1,void 0,"TpListLogFilesResponse")}TpListTargetClusters(e){return this._connection.send("TpListTargetClusters",e,"json",!1,void 0,"TpListTargetClustersResponse")}TpLogFile(e){return this._connection.send("TpLogFile",e,"json",!1,void 0,"TpLogFileResponse")}TpLogFileDisplay(e){return this._connection.send("TpLogFileDisplay",e,"json",!1,void 0,"TpLogFileResponse")}TpLogicalClusterQuery(e){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,void 0,"TpLogicalClusterQueryResponse")}TpMachineInfo(e){return this._connection.send("TpMachineInfo",e,"json",!1,void 0,"TpMachineInfoResponse")}TpMachineQuery(e){return this._connection.send("TpMachineQuery",e,"json",!1,void 0,"TpMachineQueryResponse")}TpServiceQuery(e){return this._connection.send("TpServiceQuery",e,"json",!1,void 0,"TpServiceQueryResponse")}TpSetMachineStatus(e){return this._connection.send("TpSetMachineStatus",e,"json",!1,void 0,"TpSetMachineStatusResponse")}TpSwapNode(e){return this._connection.send("TpSwapNode",e,"json",!1,void 0,"TpSwapNodeResponse")}TpTargetClusterQuery(e){return this._connection.send("TpTargetClusterQuery",e,"json",!1,void 0,"TpTargetClusterQueryResponse")}TpThorStatus(e){return this._connection.send("TpThorStatus",e,"json",!1,void 0,"TpThorStatusResponse")}TpXMLFile(e){return this._connection.send("TpXMLFile",e,"json",!1,void 0,"TpXMLFileResponse")}},Le=class extends Ee{connectionOptions(){return this._connection.opts()}protocol(){return this._connection.opts().baseUrl.split("//")[0]}ip(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]}DefaultTpLogicalClusterQuery(e={}){return this.TpLogicalClusterQuery(e).then(e=>{if(e.default)return e.default;let t,n;return e.TpLogicalClusters.TpLogicalCluster.some((e,s)=>(0===s&&(n=e),"hthor"===e.Type&&(t=e,!0))),t||n})}};let Ne;var je;(je=Ne||(Ne={})).ECLWUActions=function(e){return e.Abort="Abort",e.Delete="Delete",e.Deschedule="Deschedule",e.Reschedule="Reschedule",e.Pause="Pause",e.PauseNow="PauseNow",e.Protect="Protect",e.Unprotect="Unprotect",e.Restore="Restore",e.Resume="Resume",e.SetToFailed="SetToFailed",e.Archive="Archive",e}({}),je.LogSelectColumnMode=function(e){return e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM",e}({}),je.SortDirection=function(e){return e[e.ASC=0]="ASC",e[e.DSC=1]="DSC",e}({}),je.LogEventClass=function(e){return e.ALL="ALL",e.DIS="DIS",e.ERR="ERR",e.WRN="WRN",e.INF="INF",e.PRO="PRO",e.MET="MET",e.EVT="EVT",e}({}),je.WUDetailsAttrValueType=function(e){return e.Single="Single",e.List="List",e.Multi="Multi",e}({}),je.EclDefinitionActions=function(e){return e.SyntaxCheck="SyntaxCheck",e.Deploy="Deploy",e.Publish="Publish",e}({}),je.ErrorMessageFormat=function(e){return e.xml="xml",e.json="json",e.text="text",e}({}),je.LogAccessLogFormat=function(e){return e[e.XML=0]="XML",e[e.JSON=1]="JSON",e[e.CSV=2]="CSV",e}({}),je.WUExceptionSeverity=function(e){return e.info="info",e.warning="warning",e.error="error",e.alert="alert",e}({}),je.WUQueryFilterSuspendedType=function(e){return e.Allqueries="All queries",e.Notsuspended="Not suspended",e.Suspended="Suspended",e.Suspendedbyuser="Suspended by user",e.Suspendedbyfirstnode="Suspended by first node",e.Suspendedbyanynode="Suspended by any node",e}({}),je.WUQuerySetFilterType=function(e){return e.All="All",e.Id="Id",e.Name="Name",e.Alias="Alias",e.Status="Status",e}({}),je.WUProtectFilter=function(e){return e.All="All",e.Protected="Protected",e.NotProtected="NotProtected",e}({}),je.QuerySetAliasActionTypes=function(e){return e.Deactivate="Deactivate",e}({}),je.QuerysetImportActivation=function(e){return e.None="None",e.ActivateImportedActive="ActivateImportedActive",e}({}),je.QuerySetQueryActionTypes=function(e){return e.Suspend="Suspend",e.Unsuspend="Unsuspend",e.ToggleSuspend="ToggleSuspend",e.Activate="Activate",e.Delete="Delete",e.DeleteQueriesAndWUs="DeleteQueriesAndWUs",e.RemoveAllAliases="RemoveAllAliases",e.ResetQueryStats="ResetQueryStats",e}({}),je.WUQueryActivationMode=function(e){return e[e.DoNotActivateQuery=0]="DoNotActivateQuery",e[e.ActivateQuery=1]="ActivateQuery",e[e.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",e[e.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious",e}({});var Ie=class extends T{constructor(e){super(e,"WsWorkunits","2.02")}GVCAjaxGraph(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")}WUAbort(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")}WUAction(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")}WUAddLocalFileToWorkunit(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")}WUCDebug(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")}WUCheckFeatures(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")}WUCompileECL(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")}WUCopyLogicalFiles(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")}WUCreate(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")}WUCreateAndUpdate(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUCreateZAPInfo(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")}WUDelete(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")}WUDeployWorkunit(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")}WUDetails(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")}WUDetailsMeta(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")}WUEclDefinitionAction(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")}WUExport(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")}WUFile(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")}WUFullResult(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")}WUGVCGraphInfo(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")}WUGetGraph(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")}WUGetPlugins(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")}WUGetStats(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")}WUGetThorJobList(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")}WUGetThorJobQueue(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")}WUGraphInfo(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")}WUGraphTiming(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")}WUInfo(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")}WUInfoDetails(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")}WUJobList(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")}WULightWeightQuery(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")}WUListArchiveFiles(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")}WUListQueries(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")}WUListQueriesUsingFile(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")}WUProtect(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")}WUPublishWorkunit(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")}WUPushEvent(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")}WUQuery(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")}WUQueryConfig(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")}WUQueryDetails(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryFiles(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")}WUQueryGetGraph(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")}WUQuerysetExport(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")}WUQuerysetImport(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")}WUQuerysets(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")}WURecreateQuery(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")}WUResubmit(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")}WUResult(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")}WUResultBin(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")}WUResultSummary(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")}WUResultView(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")}WURun(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")}WUSchedule(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")}WUShowScheduled(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")}WUSubmit(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")}WUSyntaxCheckECL(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUUpdateQueryEntry(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")}WUWaitComplete(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")}};let Me,ke=function(e){return 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}({});function Ge(e){return"string"==typeof e.Name}(Me||(Me={})).Action=function(e){return e[e.Unknown=0]="Unknown",e[e.Compile=1]="Compile",e[e.Check=2]="Check",e[e.Run=3]="Run",e[e.ExecuteExisting=4]="ExecuteExisting",e[e.Pause=5]="Pause",e[e.PauseNow=6]="PauseNow",e[e.Resume=7]="Resume",e[e.Debug=8]="Debug",e[e.__size=9]="__size",e}({});var Ve=class extends Ie{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},n){return this._connection.send("WUQuery",e,"json",!1,n).then(e=>(0,t.deepMixin)({Workunits:{ECLWorkunit:[]}},e))}WUInfo(e){const 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:!1,IncludeServiceNames:!1,SuppressResultSchemas:!0,...e};return super.WUInfo(t)}WUCreate(){return super.WUCreate({})}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!0)}WUResubmit(e){return this._connection.toESPStringArray(e,"Wuids"),super.WUResubmit(e)}WUAction(e){return e.ActionType=e.WUActionType,super.WUAction(e)}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t)}WUFileEx(e){return this._connection.send("WUFile",e,"text")}_WUDetailsMetaPromise;WUDetailsMeta(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=super.WUDetailsMeta(e)),this._WUDetailsMetaPromise}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(e=>{const n=(0,t.xml2json)(e.Result).children();return n.length?n[0]:null})}},Qe=class extends Ie{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};function Oe(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,s=e.slice(0,n);return[s.length>1?s[0]+s.slice(2):s,+e.slice(n+1)]}var Be,He=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xe(e){if(!(t=He.exec(e)))throw new Error("invalid format: "+e);var t;return new $e({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function $e(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Je(e,t){var n=Oe(e,t);if(!n)return e+"";var s=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+s:s.length>r+1?s.slice(0,r+1)+"."+s.slice(r+1):s+new Array(r-s.length+2).join("0")}Xe.prototype=$e.prototype,$e.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var qe={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return Je(100*e,t)},r:Je,s:function(e,t){var n=Oe(e,t);if(!n)return e+"";var s=n[0],r=n[1],i=r-(Be=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=s.length;return i===o?s:i>o?s+new Array(i-o+1).join("0"):i>0?s.slice(0,i)+"."+s.slice(i):"0."+new Array(1-i).join("0")+Oe(e,Math.max(0,t+i-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function ze(e){return e}var Ye,Ke,Ze=Array.prototype.map,et=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tt(e){var t,n,s=void 0===e.grouping||void 0===e.thousands?ze:(t=Ze.call(e.grouping,Number),n=e.thousands+"",function(e,s){for(var r=e.length,i=[],o=0,c=t[0],u=0;r>0&&c>0&&(u+c+1>s&&(c=Math.max(1,s-u)),i.push(e.substring(r-=c,r+c)),!((u+=c+1)>s));)c=t[o=(o+1)%t.length];return i.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",c=void 0===e.numerals?ze:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(Ze.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",a=void 0===e.minus?"-":e.minus+"",h=void 0===e.nan?"NaN":e.nan+"";function l(e){var t=(e=Xe(e)).fill,n=e.align,l=e.sign,d=e.symbol,p=e.zero,g=e.width,m=e.comma,f=e.precision,S=e.trim,U=e.type;"n"===U?(m=!0,U="g"):qe[U]||(void 0===f&&(f=12),S=!0,U="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var _="$"===d?r:"#"===d&&/[boxX]/.test(U)?"0"+U.toLowerCase():"",y="$"===d?i:/[%p]/.test(U)?u:"",v=qe[U],R=/[defgprs%]/.test(U);function C(e){var r,i,u,d=_,C=y;if("c"===U)C=v(e)+C,e="";else{var D=(e=+e)<0||1/e<0;if(e=isNaN(e)?h:v(Math.abs(e),f),S&&(e=function(e){e:for(var t,n=e.length,s=1,r=-1;s<n;++s)switch(e[s]){case".":r=t=s;break;case"0":0===r&&(r=s),t=s;break;default:if(!+e[s])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),D&&0===+e&&"+"!==l&&(D=!1),d=(D?"("===l?l:a:"-"===l||"("===l?"":l)+d,C=("s"===U?et[8+Be/3]:"")+C+(D&&"("===l?")":""),R)for(r=-1,i=e.length;++r<i;)if(48>(u=e.charCodeAt(r))||u>57){C=(46===u?o+e.slice(r+1):e.slice(r))+C,e=e.slice(0,r);break}}m&&!p&&(e=s(e,1/0));var b=d.length+e.length+C.length,F=b<g?new Array(g-b+1).join(t):"";switch(m&&p&&(e=s(F+e,F.length?g-C.length:1/0),F=""),n){case"<":e=d+e+C+F;break;case"=":e=d+F+e+C;break;case"^":e=F.slice(0,b=F.length>>1)+d+e+C+F.slice(b);break;default:e=F+d+e+C}return c(e)}return f=void 0===f?6:/[gprs]/.test(U)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),C.toString=function(){return e+""},C}return{format:l,formatPrefix:function(e,t){var n,s=l(((e=Xe(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor((n=t,((n=Oe(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-r),o=et[8+r/3];return function(e){return s(i*e)+o}}}}Ye=tt({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Ke=Ye.format,Ye.formatPrefix;var nt=new Date,st=new Date;function rt(e,t,n,s){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=function(t){return e(t=new Date(+t)),t},r.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},r.round=function(e){var t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},r.range=function(n,s,i){var o,c=[];if(n=r.ceil(n),i=null==i?1:Math.floor(i),!(n<s&&i>0))return c;do{c.push(o=new Date(+n)),t(n,i),e(n)}while(o<n&&n<s);return c},r.filter=function(n){return rt(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,s){if(e>=e)if(s<0)for(;++s<=0;)for(;t(e,-1),!n(e););else for(;--s>=0;)for(;t(e,1),!n(e););})},n&&(r.count=function(t,s){return nt.setTime(+t),st.setTime(+s),e(nt),e(st),Math.floor(n(nt,st))},r.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(s?function(t){return s(t)%e===0}:function(t){return r.count(0,t)%e===0}):r:null}),r}var it=864e5,ot=6048e5,ct=rt(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()))/it},function(e){return e.getDate()-1}),ut=ct;ct.range;function at(e){return rt(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()))/ot})}var ht=at(0),lt=at(1),dt=at(2),pt=at(3),gt=at(4),mt=at(5),ft=at(6),St=(ht.range,lt.range,dt.range,pt.range,gt.range,mt.range,ft.range,rt(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()}));St.every=function(e){return isFinite(e=Math.floor(e))&&e>0?rt(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 Ut=St,_t=(St.range,rt(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/it},function(e){return e.getUTCDate()-1})),yt=_t;_t.range;function vt(e){return rt(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)/ot})}var Rt=vt(0),Ct=vt(1),Dt=vt(2),bt=vt(3),Ft=vt(4),Wt=vt(5),At=vt(6),Tt=(Rt.range,Ct.range,Dt.range,bt.range,Ft.range,Wt.range,At.range,rt(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()}));Tt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?rt(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 wt=Tt;Tt.range;function Pt(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 xt(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 Et(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var Lt,Nt,jt,It={"-":"",_:" ",0:"0"},Mt=/^\s*\d+/,kt=/^%/,Gt=/[\\^$*+?|[\]().{}]/g;function Vt(e,t,n){var s=e<0?"-":"",r=(s?-e:e)+"",i=r.length;return s+(i<n?new Array(n-i+1).join(t)+r:r)}function Qt(e){return e.replace(Gt,"\\$&")}function Ot(e){return new RegExp("^(?:"+e.map(Qt).join("|")+")","i")}function Bt(e){for(var t={},n=-1,s=e.length;++n<s;)t[e[n].toLowerCase()]=n;return t}function Ht(e,t,n){var s=Mt.exec(t.slice(n,n+1));return s?(e.w=+s[0],n+s[0].length):-1}function Xt(e,t,n){var s=Mt.exec(t.slice(n,n+1));return s?(e.u=+s[0],n+s[0].length):-1}function $t(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.U=+s[0],n+s[0].length):-1}function Jt(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.V=+s[0],n+s[0].length):-1}function qt(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.W=+s[0],n+s[0].length):-1}function zt(e,t,n){var s=Mt.exec(t.slice(n,n+4));return s?(e.y=+s[0],n+s[0].length):-1}function Yt(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.y=+s[0]+(+s[0]>68?1900:2e3),n+s[0].length):-1}function Kt(e,t,n){var s=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return s?(e.Z=s[1]?0:-(s[2]+(s[3]||"00")),n+s[0].length):-1}function Zt(e,t,n){var s=Mt.exec(t.slice(n,n+1));return s?(e.q=3*s[0]-3,n+s[0].length):-1}function en(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.m=s[0]-1,n+s[0].length):-1}function tn(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.d=+s[0],n+s[0].length):-1}function nn(e,t,n){var s=Mt.exec(t.slice(n,n+3));return s?(e.m=0,e.d=+s[0],n+s[0].length):-1}function sn(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.H=+s[0],n+s[0].length):-1}function rn(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.M=+s[0],n+s[0].length):-1}function on(e,t,n){var s=Mt.exec(t.slice(n,n+2));return s?(e.S=+s[0],n+s[0].length):-1}function cn(e,t,n){var s=Mt.exec(t.slice(n,n+3));return s?(e.L=+s[0],n+s[0].length):-1}function un(e,t,n){var s=Mt.exec(t.slice(n,n+6));return s?(e.L=Math.floor(s[0]/1e3),n+s[0].length):-1}function an(e,t,n){var s=kt.exec(t.slice(n,n+1));return s?n+s[0].length:-1}function hn(e,t,n){var s=Mt.exec(t.slice(n));return s?(e.Q=+s[0],n+s[0].length):-1}function ln(e,t,n){var s=Mt.exec(t.slice(n));return s?(e.s=+s[0],n+s[0].length):-1}function dn(e,t){return Vt(e.getDate(),t,2)}function pn(e,t){return Vt(e.getHours(),t,2)}function gn(e,t){return Vt(e.getHours()%12||12,t,2)}function mn(e,t){return Vt(1+ut.count(Ut(e),e),t,3)}function fn(e,t){return Vt(e.getMilliseconds(),t,3)}function Sn(e,t){return fn(e,t)+"000"}function Un(e,t){return Vt(e.getMonth()+1,t,2)}function _n(e,t){return Vt(e.getMinutes(),t,2)}function yn(e,t){return Vt(e.getSeconds(),t,2)}function vn(e){var t=e.getDay();return 0===t?7:t}function Rn(e,t){return Vt(ht.count(Ut(e)-1,e),t,2)}function Cn(e){var t=e.getDay();return t>=4||0===t?gt(e):gt.ceil(e)}function Dn(e,t){return e=Cn(e),Vt(gt.count(Ut(e),e)+(4===Ut(e).getDay()),t,2)}function bn(e){return e.getDay()}function Fn(e,t){return Vt(lt.count(Ut(e)-1,e),t,2)}function Wn(e,t){return Vt(e.getFullYear()%100,t,2)}function An(e,t){return Vt((e=Cn(e)).getFullYear()%100,t,2)}function Tn(e,t){return Vt(e.getFullYear()%1e4,t,4)}function wn(e,t){var n=e.getDay();return Vt((e=n>=4||0===n?gt(e):gt.ceil(e)).getFullYear()%1e4,t,4)}function Pn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Vt(t/60|0,"0",2)+Vt(t%60,"0",2)}function xn(e,t){return Vt(e.getUTCDate(),t,2)}function En(e,t){return Vt(e.getUTCHours(),t,2)}function Ln(e,t){return Vt(e.getUTCHours()%12||12,t,2)}function Nn(e,t){return Vt(1+yt.count(wt(e),e),t,3)}function jn(e,t){return Vt(e.getUTCMilliseconds(),t,3)}function In(e,t){return jn(e,t)+"000"}function Mn(e,t){return Vt(e.getUTCMonth()+1,t,2)}function kn(e,t){return Vt(e.getUTCMinutes(),t,2)}function Gn(e,t){return Vt(e.getUTCSeconds(),t,2)}function Vn(e){var t=e.getUTCDay();return 0===t?7:t}function Qn(e,t){return Vt(Rt.count(wt(e)-1,e),t,2)}function On(e){var t=e.getUTCDay();return t>=4||0===t?Ft(e):Ft.ceil(e)}function Bn(e,t){return e=On(e),Vt(Ft.count(wt(e),e)+(4===wt(e).getUTCDay()),t,2)}function Hn(e){return e.getUTCDay()}function Xn(e,t){return Vt(Ct.count(wt(e)-1,e),t,2)}function $n(e,t){return Vt(e.getUTCFullYear()%100,t,2)}function Jn(e,t){return Vt((e=On(e)).getUTCFullYear()%100,t,2)}function qn(e,t){return Vt(e.getUTCFullYear()%1e4,t,4)}function zn(e,t){var n=e.getUTCDay();return Vt((e=n>=4||0===n?Ft(e):Ft.ceil(e)).getUTCFullYear()%1e4,t,4)}function Yn(){return"+0000"}function Kn(){return"%"}function Zn(e){return+e}function es(e){return Math.floor(+e/1e3)}!function(e){Lt=function(e){var t=e.dateTime,n=e.date,s=e.time,r=e.periods,i=e.days,o=e.shortDays,c=e.months,u=e.shortMonths,a=Ot(r),h=Bt(r),l=Ot(i),d=Bt(i),p=Ot(o),g=Bt(o),m=Ot(c),f=Bt(c),S=Ot(u),U=Bt(u),_={a:function(e){return o[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return c[e.getMonth()]},c:null,d:dn,e:dn,f:Sn,g:An,G:wn,H:pn,I:gn,j:mn,L:fn,m:Un,M:_n,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Zn,s:es,S:yn,u:vn,U:Rn,V:Dn,w:bn,W:Fn,x:null,X:null,y:Wn,Y:Tn,Z:Pn,"%":Kn},y={a:function(e){return o[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return c[e.getUTCMonth()]},c:null,d:xn,e:xn,f:In,g:Jn,G:zn,H:En,I:Ln,j:Nn,L:jn,m:Mn,M:kn,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Zn,s:es,S:Gn,u:Vn,U:Qn,V:Bn,w:Hn,W:Xn,x:null,X:null,y:$n,Y:qn,Z:Yn,"%":Kn},v={a:function(e,t,n){var s=p.exec(t.slice(n));return s?(e.w=g[s[0].toLowerCase()],n+s[0].length):-1},A:function(e,t,n){var s=l.exec(t.slice(n));return s?(e.w=d[s[0].toLowerCase()],n+s[0].length):-1},b:function(e,t,n){var s=S.exec(t.slice(n));return s?(e.m=U[s[0].toLowerCase()],n+s[0].length):-1},B:function(e,t,n){var s=m.exec(t.slice(n));return s?(e.m=f[s[0].toLowerCase()],n+s[0].length):-1},c:function(e,n,s){return D(e,t,n,s)},d:tn,e:tn,f:un,g:Yt,G:zt,H:sn,I:sn,j:nn,L:cn,m:en,M:rn,p:function(e,t,n){var s=a.exec(t.slice(n));return s?(e.p=h[s[0].toLowerCase()],n+s[0].length):-1},q:Zt,Q:hn,s:ln,S:on,u:Xt,U:$t,V:Jt,w:Ht,W:qt,x:function(e,t,s){return D(e,n,t,s)},X:function(e,t,n){return D(e,s,t,n)},y:Yt,Y:zt,Z:Kt,"%":an};function R(e,t){return function(n){var s,r,i,o=[],c=-1,u=0,a=e.length;for(n instanceof Date||(n=new Date(+n));++c<a;)37===e.charCodeAt(c)&&(o.push(e.slice(u,c)),null!=(r=It[s=e.charAt(++c)])?s=e.charAt(++c):r="e"===s?" ":"0",(i=t[s])&&(s=i(n,r)),o.push(s),u=c+1);return o.push(e.slice(u,c)),o.join("")}}function C(e,t){return function(n){var s,r,i=Et(1900,void 0,1);if(D(i,e,n+="",0)!=n.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(r=(s=xt(Et(i.y,0,1))).getUTCDay(),s=r>4||0===r?Ct.ceil(s):Ct(s),s=yt.offset(s,7*(i.V-1)),i.y=s.getUTCFullYear(),i.m=s.getUTCMonth(),i.d=s.getUTCDate()+(i.w+6)%7):(r=(s=Pt(Et(i.y,0,1))).getDay(),s=r>4||0===r?lt.ceil(s):lt(s),s=ut.offset(s,7*(i.V-1)),i.y=s.getFullYear(),i.m=s.getMonth(),i.d=s.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),r="Z"in i?xt(Et(i.y,0,1)).getUTCDay():Pt(Et(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(r+5)%7:i.w+7*i.U-(r+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,xt(i)):Pt(i)}}function D(e,t,n,s){for(var r,i,o=0,c=t.length,u=n.length;o<c;){if(s>=u)return-1;if(37===(r=t.charCodeAt(o++))){if(r=t.charAt(o++),!(i=v[r in It?t.charAt(o++):r])||(s=i(e,n,s))<0)return-1}else if(r!=n.charCodeAt(s++))return-1}return s}return _.x=R(n,_),_.X=R(s,_),_.c=R(t,_),y.x=R(n,y),y.X=R(s,y),y.c=R(t,y),{format:function(e){var t=R(e+="",_);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=R(e+="",y);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}(e),Lt.format,Lt.parse,Nt=Lt.utcFormat,jt=Lt.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ts=class extends t.StateObject{wu;get properties(){return this.get()}get Name(){return this.get("Name")}get Label(){return this.get("Label")}get Type(){return this.get("Type")}get Complete(){return this.get("Complete")}get WhenStarted(){return this.get("WhenStarted")}get WhenFinished(){return this.get("WhenFinished")}get Time(){return this.get("Time")}get Running(){return this.get("Running")}get RunningId(){return this.get("RunningId")}get Failed(){return this.get("Failed")}constructor(e,t,n){super(),this.wu=e;let s=0;for(const r of n)if(r.GraphName===t.Name&&!r.HasSubGraphId){s=Math.round(1e3*r.Seconds)/1e3;break}this.set({Time:s,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(e=>gs(e)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(e=>gs(e))}},ns=class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Name]))}};function ss(e,t,n){(n=n||[]).push(e),t(e.name,e.$,e.children(),n),e.children().forEach(e=>{ss(e,t,n)}),n.pop()}function rs(e){const t={};return e.forEach(e=>{"att"===e.name&&(t[e.$.name]=e.$.value)}),t}var is=class extends t.Graph{},os=class extends t.Subgraph{},cs=class extends t.Vertex{},us=class extends t.Edge{};function as(e,t){const n={},s={},r={},i=new is(e=>e._.id),o=[i.root];return ss(t,(e,t,i,c)=>{const u=o[o.length-1];switch(e){case"graph":break;case"node":if(i.length&&i[0].children().length&&"graph"===i[0].children()[0].name){const e=u.createSubgraph(rs(i));o.push(e),n[t.id]=e}const e=u.createVertex(rs(i));s[t.id]=e;break;case"edge":const c=u.createEdge(s[t.source],s[t.target],rs(i));r[t.id]=c}}),i}var hs=class extends t.Graph{},ls=class extends t.Subgraph{},ds=class extends t.Vertex{},ps=class extends t.Edge{};function gs(e){const t={},n={},s={};let r;for(const o of e)switch(o.ScopeType){case"graph":r=new hs(e=>e._.Id,o),t[o.ScopeName]=r.root;break;case"subgraph":r||(r=new hs(e=>e._.Id,o),t[o.ScopeName]=r.root);const e=o.parentScope().split(":");let i=t[o.parentScope()];for(;e.length&&!i;)i=t[e.join(":")],e.pop();if(i){const e=i;t[o.ScopeName]=e.createSubgraph(o)}else console.warn(`Missing SG:Parent (${o.Id}): ${o.parentScope()}`);break;case"activity":const c=t[o.parentScope()];c?s[o.ScopeName]=c.createVertex(o):console.warn(`Missing A:Parent (${o.Id}): ${o.parentScope()}`);break;case"edge":n[o.ScopeName]=o;break;case"function":const u=s[o.parentScope()];u?u._.children().push(o):console.warn(`Missing F:Parent (${o.Id}): ${o.parentScope()}`)}for(const o in n){const e=n[o],s=t[e.parentScope()];if(s){const t=s;try{const n=r.vertex(e.attr("IdSource").RawValue),s=r.vertex(e.attr("IdTarget").RawValue);t.createEdge(n,s,e)}catch(i){console.warn(`Invalid Edge: ${o}`)}}else console.warn(`Missing E:Parent (${e.Id}): ${e.parentScope()}`)}return r}var ms=class extends t.StateObject{wu;get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}constructor(e,t){super(),this.wu=e;const n=t.split("\\").join("/"),s=n.split("/"),r="res/"+this.wu.Wuid+"/";let i="",o="";0===n.indexOf(r)&&(i=n.substr(r.length),o=s[s.length-1]),this.set({URL:t,DisplayName:o,DisplayPath:i})}},fs=class{e;constructor(e){this.e=e}fix(){delete this.e}},Ss=class extends fs{name;type;isSet=!1;attrs={};_children=[];constructor(e){super(e)}append(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let t=this._children.length-1;t>=0;--t){const e=this._children[t];"Row"===e.name&&void 0===e.type&&(this._children.push(...e._children),this._children.splice(t,1))}const e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return"All"===e.name&&void 0===e.type}setOfType(){const 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}}charWidth(){let 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:const t="0123456789",n=this.type.lastIndexOf("_"),s=n>0?n:this.type.length;let r=s-1;for(;r>=0&&-1!==t.indexOf(this.type.charAt(r));--r);r+1<s&&(e=parseInt(this.type.substring(r+1,s),10)),0===this.type.indexOf("data")&&(e*=2)}return e<this.name.length&&(e=this.name.length),e}},Us=class extends fs{name;type;maxLength;_restricition;_maxLength;constructor(e){super(e)}append(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e}}fix(){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,super.fix()}},_s=class{root;simpleTypes={};fields(){return this.root.children()}},ys=class extends t.SAXStackParser{schema=new _s;simpleType;simpleTypes={};xsdStack=new t.Stack;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":const t=new Ss(e);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(t):this.schema.root=t,this.xsdStack.push(t);break;case"xs:simpleType":this.simpleType=new Us(e)}}endXMLNode(e){switch(e.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":const t=this.xsdStack.top();for(const n in e.$)t.attrs[n]=e.$[n];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function vs(e){const t=new ys;return t.parse(e),t.schema}var Rs=class extends ys{_rootName;schema=new _s;simpleTypes={};xsdStack=new t.Stack;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":const t=new Ss(e);this.schema.root||this._rootName!==e.$.name||(this.schema.root=t),this.xsdStack.depth()&&this.xsdStack.top().append(t),this.xsdStack.push(t);break;case"xsd:simpleType":this.simpleType=new Us(e)}}endXMLNode(e){if("xsd:element"===e.name)this.xsdStack.pop().fix();super.endXMLNode(e)}};var Cs=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Ds=new Cs,bs=class Result extends t.StateObject{connection;_bypassCache=!1;get BaseUrl(){return this.connection.baseUrl}xsdSchema;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get ResultName(){return this.get("ResultName")}get ResultSequence(){return this.get("ResultSequence")}get LogicalFileName(){return this.get("LogicalFileName")}get Name(){return this.get("Name")}get Sequence(){return this.get("Sequence")}get Value(){return this.get("Value")}get Link(){return this.get("Link")}get FileName(){return this.get("FileName")}get IsSupplied(){return this.get("IsSupplied")}get ShowFileContent(){return this.get("ShowFileContent")}get Total(){return this.get("Total")}get ECLSchemas(){return this.get("ECLSchemas")}get NodeGroup(){return this.get("NodeGroup")}get ResultViews(){return this.get("ResultViews")}get XmlSchema(){return this.get("XmlSchema")}static attach(e,t,n,s){let r;return Array.isArray(s)?(r=Ds.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n.Name},()=>new Result(e,t,n,s)),r.set(n)):void 0===s&&("number"==typeof n?r=Ds.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+n},()=>new Result(e,t,n)):"string"==typeof n&&(r=Ds.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new Result(e,t,n)))),r}static attachLogicalFile(e,t,n){return Ds.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new Result(e,t,n,!0))}constructor(e,t,n,s){super(),this.connection=e instanceof Ve?e:new Ve(e),"boolean"==typeof s&&!0===s?this.set({NodeGroup:t,LogicalFileName:n}):Ge(n)&&Array.isArray(s)?this.set({...n,Wuid:t,ResultName:n.Name,ResultViews:s}):void 0===s?"number"==typeof n?this.set({Wuid:t,ResultSequence:n}):"string"==typeof n?this.set({Wuid:t,ResultName:n}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return-1!==this.Total}bypassCache(e){return void 0===e?this._bypassCache:(this._bypassCache=e,this)}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return this._fetchXMLSchemaPromise&&!e||(this._fetchXMLSchemaPromise=this.WUResult().then(e=>e.Result?.XmlSchema?.xml?(this.xsdSchema=vs(e.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,n=-1,s=!1,r={},i,o){const c=o??this._bypassCache;return this.WUResult(e,n,!s,r,i,c).then(e=>{const n=e.Result;return delete e.Result,this.set({...e}),(0,t.exists)("XmlSchema.xml",n)&&(this.xsdSchema=vs(n.XmlSchema.xml)),(0,t.exists)("Row",n)?n.Row:this.ResultName&&(0,t.exists)(this.ResultName,n)?n[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,n=!1,s={},r,i=!1){const o={NamedValue:{itemcount:0}};for(const u in s)o.NamedValue[o.NamedValue.itemcount++]={Name:u,Value:s[u]};const c={FilterBy:o};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,c.BypassCachedResult=i,this.connection.WUResult(c,r).then(e=>e)}},Fs=class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}},Ws=class extends t.StateObject{scope;get properties(){return this.get()}get Name(){return this.get("Name")}get RawValue(){return this.get("RawValue")}get Formatted(){return this.get("Formatted")}get FormattedEnd(){return this.get("FormattedEnd")}get Measure(){return this.get("Measure")}get Creator(){return this.get("Creator")}get CreatorType(){return this.get("CreatorType")}constructor(e,t){super(),this.scope=e,this.set(t)}},As=class extends t.StateObject{_attributeMap={};_children=[];get properties(){return this.get()}get ScopeName(){return this.get("ScopeName")}get Id(){return this.get("Id")}get ScopeType(){return this.get("ScopeType")}get Properties(){return this.get("Properties",{Property:[]})}get Notes(){return this.get("Notes",{Note:[]})}get SinkActivity(){return this.get("SinkActivity")}get CAttributes(){const e=[],t={start:null,end:null};return this.Properties.Property.forEach(n=>{"ts"===n.Measure&&n.Name.indexOf("Started")>=0?t.start=n:this.ScopeName&&"ts"===n.Measure&&n.Name.indexOf("Finished")>=0?t.end=n:e.push(new Ws(this,n))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Ws(this,t.start))):t.start?e.push(new Ws(this,t.start)):t.end&&e.push(new Ws(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(e=>{this._attributeMap[e.Name]=e}),this.Properties.Property=[];for(const t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){const e=this.ScopeName.split(":");return e.pop(),e.join(":")}children(e){return arguments.length?(this._children=e,this):this._children}walk(e){if(e.start(this))return!0;for(const t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){const e={};for(const t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){const e={};for(const t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return void 0!==this._attributeMap[e]}attr(e){return this._attributeMap[e]||new Ws(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="";const 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>`);const s=this.formattedAttrs();for(const r in s)"Label"===r?t=s[r]:n.push(`<tr><td class="key">${r}</td><td class="value">${s[r]}</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>`}},Ts=class extends As{wu;constructor(e,t){super(t),this.wu=e}},ws=class extends t.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get FileCluster(){return this.get("FileCluster")}get Name(){return this.get("Name")}get IsSuperFile(){return this.get("IsSuperFile")}get Subs(){return this.get("Subs")}get Count(){return this.get("Count")}get ECLSourceFiles(){return this.get("ECLSourceFiles")}constructor(e,t,n){super(),this.connection=e instanceof Ve?e:new Ve(e),this.set({Wuid:t,...n})}},Ps=class extends t.StateObject{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Name(){return this.get("Name")}get Value(){return this.get("Value")}get Seconds(){return this.get("Seconds")}get GraphName(){return this.get("GraphName")}get SubGraphId(){return this.get("SubGraphId")}get HasSubGraphId(){return this.get("HasSubGraphId")}get count(){return this.get("count")}get Timestamp(){return this.get("Timestamp")}get When(){return this.get("When")}constructor(e,n,s){super(),this.connection=e instanceof Ve?e:new Ve(e);const r=(0,t.espTime2Seconds)(s.Value);this.set({Wuid:n,Seconds:Math.round(1e3*r)/1e3,HasSubGraphId:void 0!==s.SubGraphId,...s})}},xs=Nt("%Y-%m-%dT%H:%M:%S.%LZ"),Es=jt("%Y-%m-%dT%H:%M:%S.%LZ"),Ls=Ke(",");function Ns(e){return e&&!isNaN(+e)?Ls(+e):e}var js="DefinitionList",Is=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/;const Ms=["Avg","Min","Max","Delta","StdDev"],ks=["SkewMin","SkewMax","NodeMin","NodeMax"];var Gs=/[A-Z][a-z]*/g;var Vs={};function Qs(e){let t=Vs[e];return t||(t=function(e){for(const n of ks){const t=e.indexOf(n);if(0===t)return{measure:"",ext:n,label:e.slice(t+n.length)}}const t=e.match(Gs);if(t?.length){const e=t.shift();let n=t.join("");for(const t of Ms){const s=n.indexOf(t);if(0===s)return n=n.slice(s+t.length),{measure:e,ext:t,label:n}}return{measure:e,ext:"",label:n}}return{measure:"",ext:"",label:e}}(e),Vs[e]=t),t}function Os(e,t){return e.__formattedProps?.[t]??e[t]}function Bs(e){if(void 0===e)return;const t=parseFloat(e);return isNaN(t)?void 0:t}function Hs(e,t,n){const s=Qs(t);if(!n[s.measure]){n[s.label]=!0;const t=Bs(e[`${s.measure}Avg${s.label}`]),r=Bs(e[`${s.measure}Min${s.label}`]),i=Bs(e[`${s.measure}Max${s.label}`]),o=Bs(e[`${s.measure}StdDev${s.label}`]),c=Math.max((t-r)/o,(i-t)/o);return{Key:`${s.measure}${s.label}`,Value:Os(e,`${s.measure}${s.label}`),Avg:Os(e,`${s.measure}Avg${s.label}`),Min:Os(e,`${s.measure}Min${s.label}`),Max:Os(e,`${s.measure}Max${s.label}`),Delta:Os(e,`${s.measure}Delta${s.label}`),StdDev:Os(e,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:Os(e,`SkewMin${s.label}`),SkewMax:Os(e,`SkewMax${s.label}`),NodeMin:Os(e,`NodeMin${s.label}`),NodeMax:Os(e,`NodeMax${s.label}`)}}return null}var Xs,$s=(0,t.scopedLogger)("workunit.ts"),Js=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},qs=new Js,zs=class Workunit extends t.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}_debugMode=!1;_debugAllGraph;_submitAction;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner","")}get Cluster(){return this.get("Cluster","")}get Jobname(){return this.get("Jobname","")}get Description(){return this.get("Description","")}get ActionEx(){return this.get("ActionEx","")}get StateID(){return this.get("StateID",ke.Unknown)}get State(){return this.get("State")||ke[this.StateID]}get Protected(){return this.get("Protected",!1)}get Exceptions(){return this.get("Exceptions",{ECLException:[]})}get ResultViews(){return this.get("ResultViews",{View:[]})}_resultCache=new Fs;get ResultCount(){return this.get("ResultCount",0)}get Results(){return this.get("Results",{ECLResult:[]})}get CResults(){return this.Results.ECLResult.map(e=>this._resultCache.get(e,()=>bs.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){const e={};return this.CResults.forEach(t=>{e[t.Sequence]=t}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new Ps(this.connection,this.Wuid,e))}_graphCache=new ns;get GraphCount(){return this.get("GraphCount",0)}get Graphs(){return this.get("Graphs",{ECLGraph:[]})}get CGraphs(){return this.Graphs.ECLGraph.map(e=>this._graphCache.get(e,()=>new ts(this,e,this.CTimers)))}get ThorLogList(){return this.get("ThorLogList")}get ResourceURLCount(){return this.get("ResourceURLCount",0)}get ResourceURLs(){return this.get("ResourceURLs",{URL:[]})}get CResourceURLs(){return this.ResourceURLs.URL.map(e=>new ms(this,e))}get TotalClusterTime(){return this.get("TotalClusterTime","")}get DateTimeScheduled(){return this.get("DateTimeScheduled")}get IsPausing(){return this.get("IsPausing")}get ThorLCR(){return this.get("ThorLCR")}get ApplicationValues(){return this.get("ApplicationValues",{ApplicationValue:[]})}get HasArchiveQuery(){return this.get("HasArchiveQuery")}get StateEx(){return this.get("StateEx")}get PriorityClass(){return this.get("PriorityClass")}get PriorityLevel(){return this.get("PriorityLevel")}get Snapshot(){return this.get("Snapshot")}get ResultLimit(){return this.get("ResultLimit")}get EventSchedule(){return this.get("EventSchedule")}get Query(){return this.get("Query")}get HelpersCount(){return this.get("HelpersCount",0)}get Helpers(){return this.get("Helpers",{ECLHelpFile:[]})}get DebugValues(){return this.get("DebugValues")}get AllowedClusters(){return this.get("AllowedClusters")}get ErrorCount(){return this.get("ErrorCount",0)}get WarningCount(){return this.get("WarningCount",0)}get InfoCount(){return this.get("InfoCount",0)}get AlertCount(){return this.get("AlertCount",0)}get SourceFileCount(){return this.get("SourceFileCount",0)}get SourceFiles(){return this.get("SourceFiles",{ECLSourceFile:[]})}get CSourceFiles(){return this.SourceFiles.ECLSourceFile.map(e=>new ws(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}static create(e){const t=new Workunit(e);return t.connection.WUCreate().then(e=>(qs.set(t),t.set(e.Workunit),t))}static attach(e,t,n){const s=qs.get({BaseUrl:e.baseUrl,Wuid:t},()=>new Workunit(e,t));return n&&s.set(n),s}static existsLocal(e,t){return qs.has({BaseUrl:e,Wuid:t})}static submit(e,t,n,s=!1){return Workunit.create(e).then(e=>e.update({QueryText:n})).then(e=>s?e.submit(t,Me.Action.Compile):e.submit(t))}static compile(e,t,n){return Workunit.submit(e,t,n,!0)}static query(e,t){return new Ve(e).WUQuery(t).then(t=>t.Workunits.ECLWorkunit.map(function(t){return Workunit.attach(e,t.Wuid,t)}))}constructor(e,t){super(),this.connection=new Ve(e),this.topologyConnection=new Le(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:ke.Unknown})}update(e){return this.connection.WUUpdate({...e,Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster}).then(e=>(this.set(e.Workunit),this))}submit(e,t=Me.Action.Run,n){let s;return s=void 0!==e?Promise.resolve(e):this.topologyConnection.DefaultTpLogicalClusterQuery().then(e=>e.Name),this._debugMode=!1,t===Me.Action.Debug&&(t=Me.Action.Run,this._debugMode=!0),s.then(e=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:n,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(n=>(this.set(n.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:e})))).then(()=>this)}isComplete(){switch(this.StateID){case ke.Compiled:return"compile"===this.ActionEx||this._submitAction===Me.Action.Compile;case ke.Completed:case ke.Failed:case ke.Aborted:case ke.NotFound:return!0}return!1}isFailed(){switch(this.StateID){case ke.Aborted:case ke.Failed:return!0}return!1}isDeleted(){return this.StateID===ke.NotFound}isDebugging(){switch(this.StateID){case ke.DebugPaused:case ke.DebugRunning:return!0}return this._debugMode}isRunning(){switch(this.StateID){case ke.Compiled:case ke.Running:case ke.Aborting:case ke.Blocked:case ke.DebugPaused:case ke.DebugRunning:return!0}return!1}setToFailed(){return this.WUAction(Ne.ECLWUActions.SetToFailed)}pause(){return this.WUAction(Ne.ECLWUActions.Pause)}pauseNow(){return this.WUAction(Ne.ECLWUActions.PauseNow)}resume(){return this.WUAction(Ne.ECLWUActions.Resume)}abort(){return this.WUAction(Ne.ECLWUActions.Abort)}protect(){return this.WUAction(Ne.ECLWUActions.Protect)}unprotect(){return this.WUAction(Ne.ECLWUActions.Unprotect)}delete(){return this.WUAction(Ne.ECLWUActions.Delete)}restore(){return this.WUAction(Ne.ECLWUActions.Restore)}deschedule(){return this.WUAction(Ne.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(Ne.ECLWUActions.Reschedule)}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>Workunit.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID!==ke.Compiled||this.ActionEx||this._submitAction||await this.refreshInfo(),this}async refreshInfo(e){return await this.WUInfo(e),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(e=!1,t){return e?await Promise.all([this.refreshInfo(t),this.refreshDebug()]):await this.refreshState(),this}eclExceptions(){return this.Exceptions.ECLException}fetchArchive(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})}fetchECLExceptions(){return this.WUInfo({IncludeExceptions:!0}).then(()=>this.eclExceptions())}fetchResults(){return this.WUInfo({IncludeResults:!0}).then(()=>this.CResults)}fetchGraphs(){return this.WUInfo({IncludeGraphs:!0}).then(()=>this.CGraphs)}fetchQuery(){return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(()=>this.Query)}fetchHelpers(){return this.WUInfo({IncludeHelpers:!0}).then(()=>this.Helpers?.ECLHelpFile||[])}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>this.AllowedClusters?.AllowedCluster||[])}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>this.ServiceNames?.Item)}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={}){return this.WUDetails(e).then(e=>e.Scopes.Scope)}normalizeDetails(e,t){const n={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},s=new Map;for(const o of e.Activities?.Activity??[])s.set(o.Kind,o.Name);const r=new Array(t.length);for(let o=0;o<t.length;o++){const e=t[o],c={},u={};if(e.Id&&e.Properties?.Property)for(const t of e.Properties.Property){const e=t.Measure,r=t.Name,i=t.RawValue;if("ns"===e&&(t.Measure="s"),"Kind"===r){const e=parseInt(i,10);t.Formatted=s.get(e)??i}switch(n[r]={Name:t.Name,Measure:t.Measure,Creator:t.Creator,CreatorType:t.CreatorType},t.Measure){case"bool":c[r]=!!+i;break;case"sz":case"ns":case"cnt":case"node":case"skw":c[r]=+i;break;case"s":c[r]=+i/1e9;break;case"ts":c[r]=new Date(+i/1e3).toISOString();break;case"cost":c[r]=+i/1e6;break;default:c[r]=i}u[r]=Ns(t.Formatted??c[r])}const a={id:e.Id,name:e.ScopeName,type:e.ScopeType,Kind:e.Kind,Label:e.Label,__formattedProps:u,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...c},h=a[js];if(h)try{const e=JSON.parse(h.split("\\").join("\\\\")),t=[];for(let n=0;n<e.length;n++){const s=e[n].match(Is);s&&t.push({filePath:(s[1]??"")+s[2]+s[3],line:parseInt(s[5],10),col:parseInt(s[6],10)})}a[js]=t}catch(i){$s.error(`Unexpected "DefinitionList": ${h}`)}const l={};let d=0,p="";for(const t in a)if(!t.startsWith("__")){const e=Hs(a,t,l);e&&(a.__groupedProps[e.Key]=e,!isNaN(e.StdDevs)&&e.StdDevs>d&&(d=e.StdDevs,p=e.Key))}a.__StdDevs=d,a.__StdDevsSource=p,r[o]=a}return{meta:e,columns:n,data:r}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(e=>this.normalizeDetails(e[0],e[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(e=>e.Scopes.Scope.map(e=>new Ts(this,e)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(e=>{const t=[],n={};e.Scopes.Scope.forEach(e=>{if(n[e.ScopeName])return n[e.ScopeName].update(e),null;{const t=new Ts(this,e);return n[t.ScopeName]=t,t}});for(const s in n)if(n.hasOwnProperty(s)){const e=n[s],r=e.parentScope();r&&n[r]?n[r].children().push(e):t.push(e)}return t})}fetchGraphDetails(e=[],t){return 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}})}fetchScopeGraphs(e=[]){return this.fetchGraphDetails(e,["graph"]).then(e=>gs(e))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{const t={};e.forEach(e=>{t[e.ScopeName]=t[e.ScopeName]||{scope:e.ScopeName,start:null,elapsed:null,finish:null},e.CAttributes.forEach(n=>{"TimeElapsed"===n.Name?t[e.ScopeName].elapsed=+n.RawValue:"ts"===n.Measure&&n.Name.indexOf("Started")>=0&&(t[e.ScopeName].start=n.Formatted)})});const n=[];for(const s in t){const e=t[s];if(e.start&&e.elapsed){const t=Es(e.start);t.setMilliseconds(t.getMilliseconds()+e.elapsed/1e6),e.finish=xs(t),n.push(e)}}return n.sort((e,t)=>e.start<t.start?-1:e.start>t.start?1:0),n})}_monitor(){this.isComplete()?this._monitorTickCount=0:super._monitor()}_monitorTimeoutDuration(){const e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,n){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",e=>{this.isComplete()&&t([e])});break;case"changed":super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),this.isComplete()&&(s.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(s.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(e=>(0===e.Workunits.ECLWorkunit.length?(this.clearState(this.Wuid),this.set("StateID",ke.NotFound)):this.set(e.Workunits.ECLWorkunit[0]),e)).catch(e=>{if(!e.Exception.some(e=>20081===e.Code&&(this.clearState(this.Wuid),this.set("StateID",ke.NotFound),!0)))throw $s.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),qs.set(this),e))}WUInfo(e={}){const t=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:t,IncludeResultsViewNames:t,SuppressResultSchemas:!1}).then(e=>(this.set(e.Workunit),t&&this.set({ResultViews:e.ResultViews}),e)).catch(e=>{if(!e.Exception.some(e=>20080===e.Code&&(this.clearState(this.Wuid),this.set("StateID",ke.NotFound),!0)))throw $s.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUResubmit(e){return this.connection.WUResubmit((0,t.deepMixinT)({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails((0,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(e=>(0,t.deepMixinT)({Scopes:{Scope:[]}},e))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(e=>this.refresh().then(()=>(this._monitor(),e)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:Ne.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){const t=new Qe({baseUrl:""}),n={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(n)}WUCDebug(e,t={}){let n="";for(const s in t)t.hasOwnProperty(s)&&(n+=` ${s}='${t[s]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${n}/>`}).then(e=>e)}debug(e,n){return this.isDebugging()?this.WUCDebug(e,n).then(n=>{const s=n.children(e);return s.length?s[0]:new t.XMLNode(e)}).catch(n=>($s.error(n),Promise.resolve(new t.XMLNode(e)))):Promise.resolve(new t.XMLNode(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{const t={...this.DebugState,...e.$};return this.set({DebugState:t}),e}):Promise.resolve({DebugState:{state:"unknown"}})}debugContinue(e=""){return this.debug("continue",{mode:e})}debugStep(e){return this.debug("step",{mode:e})}debugPause(){return this.debug("interrupt")}debugQuit(){return this.debug("quit")}debugDeleteAllBreakpoints(){return this.debug("delete",{idx:0})}debugBreakpointResponseParser(e){return e.children().map(e=>{if("break"===e.name)return e.$})}debugBreakpointAdd(e,t,n){return this.debug("breakpoint",{id:e,mode:t,action:n}).then(e=>this.debugBreakpointResponseParser(e))}debugBreakpointList(){return this.debug("list").then(e=>this.debugBreakpointResponseParser(e))}debugGraph(){return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(e=>(this.DebugState._prevGraphSequenceNum=this.DebugState.graphSequenceNum,this._debugAllGraph=as(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>function(e,t){const n=[];for(const s of e.vertices)if(Ks(s)){const e=Zs(s);(e&&!t||t===e.file)&&n.push(e)}return n.sort((e,t)=>e.line-t.line)}(t,e))}debugPrint(e,t=0,n=10){return this.debug("print",{edgeID:e,startRow:t,numRows:n}).then(e=>e.children().map(e=>{const t={};return e.children().forEach(e=>{t[e.name]=e.content}),t}))}},Ys="definition";function Ks(e){return void 0!==e._[Ys]}function Zs(e){const t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[Ys]);if(t){const[,n,s,r]=t;return n.replace(/\/\.\//g,"/"),{id:e._.id,file:n,line:+s,column:+r}}throw new Error(`Bad definition: ${e._[Ys]}`)}var er=class Activity extends t.StateObject{connection;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get Build(){return this.get("Build")}get ThorClusterList(){return this.get("ThorClusterList")}get RoxieClusterList(){return this.get("RoxieClusterList")}get HThorClusterList(){return this.get("HThorClusterList")}get DFUJobs(){return this.get("DFUJobs")}get Running(){return this.get("Running",{ActiveWorkunit:[]})}get BannerContent(){return this.get("BannerContent")}get BannerColor(){return this.get("BannerColor")}get BannerSize(){return this.get("BannerSize")}get BannerScroll(){return this.get("BannerScroll")}get ChatURL(){return this.get("ChatURL")}get ShowBanner(){return this.get("ShowBanner")}get ShowChatURL(){return this.get("ShowChatURL")}get SortBy(){return this.get("SortBy")}get Descending(){return this.get("Descending")}get SuperUser(){return this.get("SuperUser")}get AccessRight(){return this.get("AccessRight")}get ServerJobQueues(){return this.get("ServerJobQueues")}get ActivityTime(){return this.get("ActivityTime")}get DaliDetached(){return this.get("DaliDetached")}static attach(e,t){return Xs||(Xs=new Activity(e)),t&&Xs.set(t),Xs}constructor(e){super(),this.connection=e instanceof Ae?e:new Ae(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>""===e||t.ClusterName===e).map(e=>zs.attach(this.connection.connectionOptions(),e.Wuid,e))}setBanner(e){return this.connection.SetBanner({...e}).then(e=>(this.set(e),this))}lazyRefresh=(0,t.debounce)(async()=>{const e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}},tr=(0,t.scopedLogger)("logicalFile.ts"),nr=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},sr=new nr,rr=class LogicalFile extends t.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get Cluster(){return this.get("Cluster")}get Name(){return this.get("Name")}get Filename(){return this.get("Filename")}get Prefix(){return this.get("Prefix")}get NodeGroup(){return this.get("NodeGroup")}get NumParts(){return this.get("NumParts")}get Description(){return this.get("Description")}get Dir(){return this.get("Dir")}get PathMask(){return this.get("PathMask")}get Filesize(){return this.get("Filesize")}get FileSizeInt64(){return this.get("FileSizeInt64")}get RecordSize(){return this.get("RecordSize")}get RecordCount(){return this.get("RecordCount")}get RecordSizeInt64(){return this.get("RecordSizeInt64")}get RecordCountInt64(){return this.get("RecordCountInt64")}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner")}get JobName(){return this.get("JobName")}get Persistent(){return this.get("Persistent")}get Format(){return this.get("Format")}get MaxRecordSize(){return this.get("MaxRecordSize")}get CsvSeparate(){return this.get("CsvSeparate")}get CsvQuote(){return this.get("CsvQuote")}get CsvTerminate(){return this.get("CsvTerminate")}get CsvEscape(){return this.get("CsvEscape")}get Modified(){return this.get("Modified")}get Ecl(){return this.get("Ecl")}get Stat(){return this.get("Stat")}get DFUFilePartsOnClusters(){return this.get("DFUFilePartsOnClusters")}get isSuperfile(){return this.get("isSuperfile")}get ShowFileContent(){return this.get("ShowFileContent")}get subfiles(){return this.get("subfiles")}get Superfiles(){return this.get("Superfiles")}get ProtectList(){return this.get("ProtectList")}get FromRoxieCluster(){return this.get("FromRoxieCluster")}get Graphs(){return this.get("Graphs")}get UserPermission(){return this.get("UserPermission")}get ContentType(){return this.get("ContentType")}get CompressedFileSize(){return this.get("CompressedFileSize")}get PercentCompressed(){return this.get("PercentCompressed")}get IsCompressed(){return this.get("IsCompressed")}get BrowseData(){return this.get("BrowseData")}get jsonInfo(){return this.get("jsonInfo")}get binInfo(){return this.get("binInfo")}get PackageID(){return this.get("PackageID")}get Partition(){return this.get("Partition")}get Blooms(){return this.get("Blooms")}get ExpireDays(){return this.get("ExpireDays")}get KeyType(){return this.get("KeyType")}get IsRestricted(){return this.get("IsRestricted")}get AtRestCost(){return this.get("AtRestCost")}get AccessCost(){return this.get("AccessCost")}get StateID(){return this.get("StateID")}get ExpirationDate(){return this.get("ExpirationDate")}get ExtendedIndexInfo(){return this.get("ExtendedIndexInfo")}get CompressionType(){return this.get("CompressionType")}get properties(){return this.get()}static attach(e,t,n,s){const r=sr.get({BaseUrl:e.baseUrl,Cluster:t,Name:n},()=>new LogicalFile(e,t,n));return s&&r.set(s),r}constructor(e,t,n){super(),this.connection=e instanceof Y?e:new Y(e),this.clear({Cluster:t,Name:n})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){const e=[];for(const t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(const n of t?.DFUFileParts?.DFUPart||[]){const s={...t,...n};delete s.DFUFileParts,e.push(s)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail}),e))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:e?.FileDetail?.ProtectList??{DFUFileProtect:[]}}),e.FileDetail)).catch(e=>{if(!e.Exception.some(e=>20038===e.Code&&(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0)))throw tr.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchAllLogicalFiles(){return this.connection.recursiveFetchLogicalFiles([this])}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}},ir=class extends t.Cache{constructor(){super(e=>e.Address)}},or=new ir,cr=class Machine extends t.StateObject{connection;get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,n){const s=or.get({Address:t},()=>new Machine(e));return n&&s.set(n),s}constructor(e){super(),this.connection=e instanceof ye?e:new ye(e)}},ur=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},ar=new ur,hr=class TargetCluster extends t.StateObject{connection;machineConnection;get BaseUrl(){return this.connection.baseUrl}get Name(){return this.get("Name")}get Prefix(){return this.get("Prefix")}get Type(){return this.get("Type")}get IsDefault(){return this.get("IsDefault")}get TpClusters(){return this.get("TpClusters")}get TpEclCCServers(){return this.get("TpEclCCServers")}get TpEclServers(){return this.get("TpEclServers")}get TpEclAgents(){return this.get("TpEclAgents")}get TpEclSchedulers(){return this.get("TpEclSchedulers")}get MachineInfoEx(){return this.get("MachineInfoEx",[])}get CMachineInfoEx(){return this.MachineInfoEx.map(e=>cr.attach(this.machineConnection,e.Address,e))}static attach(e,t,n){const s=ar.get({BaseUrl:e.baseUrl,Name:t},()=>new TargetCluster(e,t));return n&&s.set(n),s}constructor(e,t){super(),e instanceof Le?(this.connection=e,this.machineConnection=new ye(e.connectionOptions())):(this.connection=new Le(e),this.machineConnection=new ye(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(e=>{const t=[];for(const n of e.TargetClusterInfoList.TargetClusterInfo)for(const e of n.Processes.MachineInfoEx)t.push(e);return this.set("MachineInfoEx",t),this.CMachineInfoEx})}machineStats(){let e=0,t=0,n=0;for(const s of this.CMachineInfoEx)for(const r of s.Storage.StorageInfo){t+=r.Available,n+=r.Total;const s=1-r.Available/r.Total;s>e&&(e=s)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};var lr={};var dr=class extends t.Cache{constructor(){super(e=>e.BaseUrl)}},pr=new dr,gr=class Topology extends t.StateObject{connection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get TargetClusters(){return this.get("TargetClusters")}get CTargetClusters(){return this.TargetClusters.map(e=>hr.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){const n=pr.get({BaseUrl:e.baseUrl},()=>new Topology(e));return t&&n.set(t),n}constructor(e){super(),this.connection=e instanceof Le?e:new Le(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(n=>{const s=this.connection.protocol(),r=this.connection.ip();let i="https:"===s?"18002":"8002";if((0,t.exists)("ServiceList.TpEspServers.TpEspServer",n))for(const o of n.ServiceList.TpEspServers.TpEspServer)if((0,t.exists)("TpBindings.TpBinding",o))for(const t of o.TpBindings.TpBinding)t.Service===e&&t.Protocol+":"===s&&(i=t.Port);return`${s}//${r}:${i}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(e=>(this.set({TargetClusters:e.TpTargetClusters?.TpTargetCluster??[]}),this.CTargetClusters))}fetchLogicalClusters(e={}){return this.connection.TpLogicalClusterQuery(e).then(e=>(this.set({LogicalClusters:e.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(e=>(this.set({Services:e.ServiceList}),this.Services))}_prevRefresh;refresh(e=!1){return this._prevRefresh&&!e||(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(e,t,n){if(this.isCallback(t)){if("changed"===e)super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}};function mr(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=n)}function fr(e){return(e=""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function Sr(e,t){const n=e.indexOf(t);return-1!==n?parseFloat(e.substring(0,n)):-1}var Ur=function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.GRAPH=1]="GRAPH",e[e.SUBGRAPH=2]="SUBGRAPH",e[e.VERTEX=3]="VERTEX",e[e.EDGE=4]="EDGE",e[e.LAST=5]="LAST",e}(Ur||{}),_r=function(e){return e.UNKNOWN="Unknown",e.GRAPH="Graph",e.SUBGRAPH="Cluster",e.VERTEX="Vertex",e.EDGE="Edge",e.LAST="Last",e}(_r||{}),yr=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,n,s){this.noSpills=s,e.forEach(e=>{this.graph.isVertex(e)?(this.calcInVertexVisibility(e,n),this.calcOutVertexVisibility(e,n)):this.graph.isEdge(e)?(this.calcInVertexVisibility(e.getSource(),n-1),this.calcOutVertexVisibility(e.getTarget(),n-1)):this.graph.isSubgraph(e)&&(this.m_visibleSubgraphs[e.__hpcc_id]=e,this.calcSubgraphVisibility(e,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(e=>{this.calcInVertexVisibility(e.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(e=>{this.calcOutVertexVisibility(e.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((e,n)=>{this.calcSubgraphVisibility(e,t-1)}),e.__hpcc_subgraphs.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e}),e.__hpcc_vertices.forEach((e,t)=>{this.m_visibleVertices[e.__hpcc_id]=e});const n={};this.graph.edges.forEach((t,s)=>{t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===this.getCommonAncestor(t)&&(n[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]||(n[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[t.__hpcc_id]=t))})}buildVertexString(e,t){let n="",s="";const r=e.getProperties();for(const i in r)t&&i.indexOf("_kind")>=0?s+='<att name="_kind" value="point"/>':"id"===i||"label"===i?n+=" "+i+'="'+fr(r[i])+'"':s+='<att name="'+i+'" value="'+fr(r[i])+'"/>';return"<node"+n+">"+s+"</node>"}buildEdgeString(e){let t="",n="";const s=e.getProperties();for(const r in s)"id"===r.toLowerCase()||"label"===r.toLowerCase()||"source"===r.toLowerCase()||"target"===r.toLowerCase()?t+=" "+r+'="'+fr(s[r])+'"':n+='<att name="'+r+'" value="'+fr(s[r])+'"/>';return"<edge"+t+">"+n+"</edge>"}getAncestors(e,t){let n=e.__hpcc_parent;for(;n;)t.push(n),n=n.__hpcc_parent}getCommonAncestorV(e,t){const n=[],s=[];this.getAncestors(e,n),this.getAncestors(t,s);let r=n.length-1,i=s.length-1,o=null;for(;r>=0&&i>=0&&n[r]===s[i];)o=n[r],--r,--i;return o}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){const t=[];this.getAncestors(e,t),t.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e})}calcVisibility2(){for(const e in this.m_visibleVertices){const t=this.m_visibleVertices[e];t.getInEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),t.getOutEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),this.calcAncestorVisibility(t)}this.calcSemiVisibleVertices()}addSemiVisibleEdge(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)}addSemiVisibleVertex(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))}calcSemiVisibleVertices(){for(const e in this.m_visibleEdges){const t=this.m_visibleEdges[e];let n=t.getSource();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){const e=n.getInEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),n=e[0].getSource(),this.addSemiVisibleVertex(n)}let s=t.getTarget();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){const e=s.getOutEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),s=e[0].getTarget(),this.addSemiVisibleVertex(s)}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,t)=>{this.edgeVisited(e)})}subgraphVisited(e,t=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let n="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';const s=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),s===this.m_xgmml.length){const t=e.__hpcc_vertices[0];t&&(this.m_xgmml+=this.buildVertexString(t,!0))}const r=e.getProperties();for(const e in r)n+='<att name="'+e+'" value="'+fr(r[e])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+n+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}},vr=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){const e={};for(const t in this)0!==t.indexOf("__")&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}},Rr=class extends vr{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,t){super(e,t),this._globalType="0"===t?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=t}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(t=>e===t)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(t=>e===t)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(t=>e!==t)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(t=>e===t)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(t=>e!==t)}remove(){this.__hpcc_subgraphs.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_vertices.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_edges.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)}walkSubgraphs(e){this.__hpcc_subgraphs.forEach((t,n)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,n)=>{e.vertexVisited(t)})}},Cr=class extends vr{_globalType="Vertex";_isSpill;constructor(e,t){super(e,t)}isSpill(){return this._isSpill}remove(){const e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(e=>{e.remove()}),this.getOutEdges().forEach(t=>{t.setSource(e[0])}),this.__hpcc_parent?.removeVertex(this),this.__hpcc_graph.removeItem(this)}getInVertices(){return this.getInEdges().map(e=>e.getSource())}getInEdges(){return this.__hpcc_graph.edges.filter(e=>e.getTarget()===this)}getOutVertices(){return this.getOutEdges().map(e=>e.getTarget())}getOutEdges(){return this.__hpcc_graph.edges.filter(e=>e.getSource()===this)}},Dr=class extends vr{_globalType="Edge";_sourceActivity;source;_targetActivity;target;constructor(e,t){super(e,t),this._globalType="Edge"}remove(){this.__hpcc_graph.subgraphs.forEach(e=>{e.removeEdge(this)}),this.__hpcc_graph.removeItem(this)}getSource(){return this.__hpcc_graph.idx[this._sourceActivity||this.source]}setSource(e){this._sourceActivity?this._sourceActivity=e.__hpcc_id:this.source&&(this.source=e.__hpcc_id),this.__widget&&this.__widget.setSource(this.getSource().__widget)}getTarget(){return this.__hpcc_graph.idx[this._targetActivity||this.target]}},br=class QueryGraph{idx={};subgraphs=[];vertices=[];edges=[];xgmml="";constructor(){this.clear()}clear(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]}load(e){this.clear(),this.merge(e)}merge(e){this.xgmml=e;const t=(new DOMParser).parseFromString(e,"text/xml");this.walkDocument(t.documentElement,"0")}isSubgraph(e){return e instanceof Rr}isVertex(e){return e instanceof Cr}isEdge(e){return e instanceof Dr}getGlobalType(e){return e instanceof Cr?Ur.VERTEX:e instanceof Dr?Ur.EDGE:e instanceof Rr?Ur.SUBGRAPH:e instanceof QueryGraph?Ur.GRAPH:Ur.UNKNOWN}getGlobalTypeString(e){return e instanceof Cr?_r.VERTEX:e instanceof Dr?_r.EDGE:e instanceof Rr?_r.SUBGRAPH:e instanceof QueryGraph?_r.GRAPH:_r.UNKNOWN}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":const e=new Rr(this,t);this.subgraphs.push(e),this.idx[t]=e;break;case"node":const n=new Cr(this,t);this.vertices.push(n),this.idx[t]=n;break;case"edge":const s=new Dr(this,t);this.edges.push(s),this.idx[t]=s;break;default:console.warn("Graph.getItem - Unknown Node Type!")}const n=this.idx[t];return Array.from(e.attributes).forEach(e=>{mr(n,e.name,e.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof Rr?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof Cr?this.vertices=this.vertices.filter(t=>e!==t):e instanceof Dr&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let n=null;return Array.from(e.childNodes).some(e=>{if(e.tagName===t)return n=e,!0}),n}walkDocument(e,t){const n=this.getItem(e,t);return e.childNodes.forEach(e=>{if(1===e.nodeType)switch(e.tagName){case"graph":default:break;case"node":let s=!1;const r=this.getChildByTagName(e,"att");if(r){const t=this.getChildByTagName(r,"graph");if(t){s=!0;const r=this.walkDocument(t,e.getAttribute("id"));n.addSubgraph(r)}}if(!s){const t=this.walkDocument(e,e.getAttribute("id"));n.addVertex(t)}break;case"att":const i=e.getAttribute("name"),o="_"+i,c=e.getAttribute("value");0===i.indexOf("Time")?(mr(n,o,c),mr(n,i,""+function(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);const t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(e);return t?24*(+t[1]||0)*60*60+60*(+t[2]||0)*60+60*(+t[3]||0)+(+t[4]||0)+(+t[5]||0)/1e3+(+t[6]||0)/1e6+(+t[7]||0)/1e9:0}(c))):0===i.indexOf("Size")?(mr(n,o,c),mr(n,i,""+function(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);let t=Sr(e,"Kb");return t>=0?1024*t:(t=Sr(e,"Mb"),t>=0?t*Math.pow(1024,2):(t=Sr(e,"Gb"),t>=0?t*Math.pow(1024,3):(t=Sr(e,"Tb"),t>=0?t*Math.pow(1024,4):(t=Sr(e,"Pb"),t>=0?t*Math.pow(1024,5):(t=Sr(e,"Eb"),t>=0?t*Math.pow(1024,6):(t=Sr(e,"Zb"),t>=0?t*Math.pow(1024,7):(t=Sr(e,"b"),t>=0?t:0)))))))}(c))):0===i.indexOf("Skew")?(mr(n,o,c),mr(n,i,""+((t=c)?parseFloat(t):0))):mr(n,i,c);break;case"edge":const u=this.walkDocument(e,e.getAttribute("id"));if(void 0!==u.NumRowsProcessed?u._eclwatchCount=u.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==u.Count?u._eclwatchCount=u.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==u.count&&(u._eclwatchCount=u.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),u.inputProgress&&(u._eclwatchInputProgress="["+u.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),u.SkewMaxRowsProcessed&&u.SkewMinRowsProcessed&&(u._eclwatchSkew="+"+u.SkewMaxRowsProcessed+", "+u.SkewMinRowsProcessed),u._dependsOn);else if(u._childGraph);else if(u._sourceActivity||u._targetActivity){u._isSpill=!0;const e=u.getSource();e&&(e._isSpill=!0);const t=u.getTarget();t&&(t._isSpill=!0)}n.addEdge(u)}var t}),n}removeSubgraphs(){[...this.subgraphs].forEach(e=>{e.__hpcc_parent instanceof Rr&&e.remove()})}removeSpillVertices(){[...this.vertices].forEach(e=>{e.isSpill()&&e.remove()})}getLocalisedXGMML(e,t,n,s){const r=new yr(this);return r.calcVisibility(e,t,n,s),r.writeXgmml(),"<graph>"+r.m_xgmml+"</graph>"}},Fr=(0,t.scopedLogger)("@hpcc-js/comms/ecl/query.ts"),Wr=Ke("~s");function Ar(e){return!isNaN(parseFloat(e))&&!isNaN(e-0)}var Tr=new class extends t.Cache{constructor(){super(e=>t.Cache.hash([e.QueryId,e.QuerySet]))}},wr=class Query extends t.StateObject{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get QueryId(){return this.get("QueryId")}get QuerySet(){return this.get("QuerySet")}get QueryName(){return this.get("QueryName")}get Wuid(){return this.get("Wuid")}get Dll(){return this.get("Dll")}get Suspended(){return this.get("Suspended")}get Activated(){return this.get("Activated")}get SuspendedBy(){return this.get("SuspendedBy")}get Clusters(){return this.get("Clusters")}get PublishedBy(){return this.get("PublishedBy")}get Comment(){return this.get("Comment")}get LogicalFiles(){return this.get("LogicalFiles")}get SuperFiles(){return this.get("SuperFiles")}get IsLibrary(){return this.get("IsLibrary")}get Priority(){return this.get("Priority")}get WUSnapShot(){return this.get("WUSnapShot")}get CompileTime(){return this.get("CompileTime")}get LibrariesUsed(){return this.get("LibrariesUsed")}get CountGraphs(){return this.get("CountGraphs")}get ResourceURLCount(){return this.get("ResourceURLCount")}get WsEclAddresses(){return this.get("WsEclAddresses")}get WUGraphs(){return this.get("WUGraphs")}get WUTimers(){return this.get("WUTimers")}get PriorityID(){return this.get("PriorityID")}constructor(e,t,n,s){super(),this.wsWorkunitsService=e instanceof Ve?e:new Ve(e),this.topology=gr.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:n,...s})}static attach(e,t,n,s){const r=Tr.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:n},()=>new Query(e,t,n));return s&&r.set(s),r}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(const t of e?.TpEspServers?.TpEspServer??[])for(const e of t?.TpBindings?.TpBinding??[])if("ws_ecl"===e?.Service)return new ne({baseUrl:`${e.Protocol}://${globalThis.location.hostname}:${e.Port}`})})),this._eclService}async fetchDetails(){const e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){const e=await this.wsEclService();try{this._requestSchema=await(e?.requestJson(this.QuerySet,this.QueryId))??[]}catch(t){Fr.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){const e=await this.wsEclService();try{this._responseSchema=await(e?.responseJson(this.QuerySet,this.QueryId))??{}}catch(t){Fr.debug(t.message??t),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",t=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(e=>{const t=new br;let n=!0;for(const s of e?.Graphs?.ECLGraphEx||[])n?(t.load(s.Graph),n=!1):t.merge(s.Graph);return t})}fetchDetailsNormalized(e={}){const t=zs.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(e=>{const n=e[0],s=e[1],r=e[2].map(e=>{const t=e.Id[0];if("a"===t||"e"===t){const t=n.idx[e.Id.substring(1)];if(!t)return Fr.debug(`Missing graph data for metric ID: ${e.Id}`),e;const s=new Set(e.Properties.Property.map(e=>e.Name)),r=[];for(const e in t){const n=e.charAt(0);if("_"!==n&&n===n.toUpperCase()&&!s.has(e)){const n=t[e],s=typeof n;if("string"===s||"number"===s||"boolean"===s){let t=Ar(n)?parseFloat(n):n,s=n;e.indexOf("Time")>=0&&(t/=1e9,s=Wr(t)+"s"),r.push({Name:e,RawValue:t,Formatted:s})}}}r.length>0&&e.Properties.Property.push(...r)}return e});return t.normalizeDetails(s,r)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){const t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(e=>{for(const t in e)e[t]=e[t].Row;return e})??[]}catch(n){return Fr.debug(n.message??n),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){const e=[];for(const t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}},Pr=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},xr=new Pr,Er=class extends t.Message{constructor(e,t,n){super(),this.key=e,this.value=t,this.oldValue=n}get canConflate(){return!0}conflate(e){return this.key===e.key&&(this.value=e.value,!0)}void(){return this.value===this.oldValue}},Lr=(0,t.scopedLogger)("@hpcc-js/comms/dfuWorkunit.ts"),Nr=function(e){return e[e.Unknown=0]="Unknown",e[e.Scheduled=1]="Scheduled",e[e.Queued=2]="Queued",e[e.Started=3]="Started",e[e.Aborted=4]="Aborted",e[e.Failed=5]="Failed",e[e.Finished=6]="Finished",e[e.Monitoring=7]="Monitoring",e[e.Aborting=8]="Aborting",e[e.NotFound=999]="NotFound",e}(Nr||{}),jr=class extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},Ir=new jr,Mr=class DFUWorkunit extends t.StateObject{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get ID(){return this.get("ID")}get DFUServerName(){return this.get("DFUServerName")}get ClusterName(){return this.get("ClusterName")}get JobName(){return this.get("JobName")}get Queue(){return this.get("Queue")}get User(){return this.get("User")}get isProtected(){return this.get("isProtected")}get Command(){return this.get("Command")}get CommandMessage(){return this.get("CommandMessage")}get PercentDone(){return this.get("PercentDone")}get SecsLeft(){return this.get("SecsLeft")}get ProgressMessage(){return this.get("ProgressMessage")}get SummaryMessage(){return this.get("SummaryMessage")}get State(){return this.get("State",Nr.Unknown)}get SourceLogicalName(){return this.get("SourceLogicalName")}get SourceIP(){return this.get("SourceIP")}get SourceFilePath(){return this.get("SourceFilePath")}get SourceDali(){return this.get("SourceDali")}get SourceRecordSize(){return this.get("SourceRecordSize")}get SourceFormat(){return this.get("SourceFormat")}get RowTag(){return this.get("RowTag")}get SourceNumParts(){return this.get("SourceNumParts")}get SourceDirectory(){return this.get("SourceDirectory")}get DestLogicalName(){return this.get("DestLogicalName")}get DestGroupName(){return this.get("DestGroupName")}get DestDirectory(){return this.get("DestDirectory")}get DestIP(){return this.get("DestIP")}get DestFilePath(){return this.get("DestFilePath")}get DestFormat(){return this.get("DestFormat")}get DestNumParts(){return this.get("DestNumParts")}get DestRecordSize(){return this.get("DestRecordSize")}get Replicate(){return this.get("Replicate")}get Overwrite(){return this.get("Overwrite")}get Compress(){return this.get("Compress")}get SourceCsvSeparate(){return this.get("SourceCsvSeparate")}get SourceCsvQuote(){return this.get("SourceCsvQuote")}get SourceCsvTerminate(){return this.get("SourceCsvTerminate")}get SourceCsvEscape(){return this.get("SourceCsvEscape")}get TimeStarted(){return this.get("TimeStarted")}get TimeStopped(){return this.get("TimeStopped")}get StateMessage(){return this.get("StateMessage")}get MonitorEventName(){return this.get("MonitorEventName")}get MonitorSub(){return this.get("MonitorSub")}get MonitorShotLimit(){return this.get("MonitorShotLimit")}get SourceDiffKeyName(){return this.get("SourceDiffKeyName")}get DestDiffKeyName(){return this.get("DestDiffKeyName")}get Archived(){return this.get("Archived")}get encrypt(){return this.get("encrypt")}get decrypt(){return this.get("decrypt")}get failIfNoSourceFile(){return this.get("failIfNoSourceFile")}get recordStructurePresent(){return this.get("recordStructurePresent")}get quotedTerminator(){return this.get("quotedTerminator")}get preserveCompression(){return this.get("preserveCompression")}get expireDays(){return this.get("expireDays")}get PreserveFileParts(){return this.get("PreserveFileParts")}get FileAccessCost(){return this.get("FileAccessCost")}get KbPerSecAve(){return this.get("KbPerSecAve")}get KbPerSec(){return this.get("KbPerSec")}static create(e,t){const n=new DFUWorkunit(e);return n.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(e=>(Ir.set(n),n.set(e.result),n))}static attach(e,t,n){const s=Ir.get({BaseUrl:e.baseUrl,ID:t},()=>new DFUWorkunit(e,t));return n&&s.set(n),s}static sprayFixed(e,t){const n=new E(e);return n.SprayFixedEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>DFUWorkunit.attach(e,s,t.result))})}static sprayVariable(e,t){const n=new E(e);return n.SprayVariableEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>DFUWorkunit.attach(e,s,t.result))})}static despray(e,t){const n=new E(e);return n.DesprayEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>DFUWorkunit.attach(e,s,t.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case Nr.Finished:case Nr.Failed:case Nr.Aborted:case Nr.NotFound:return!0}return!1}isFailed(){return!(!this.isComplete()||this.State===Nr.Finished)}isDeleted(){return this.State===Nr.NotFound}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(w.DFUWUActions.Delete).then(e=>this.refresh().then(()=>(this._monitor(),e)))}async refresh(e=!1){return await this.GetDFUWorkunit(),this}fetchXML(e){return this.DFUWUFile()}_monitor(){this.isComplete()?this._monitorTickCount=0:super._monitor()}_monitorTimeoutDuration(){const e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:e}DFUWUFile(e={}){return this.connection.DFUWUFileEx({...e,Wuid:this.ID}).then(e=>e).catch(e=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===w.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,n){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",e=>{this.isComplete()&&t([e])});break;case"changed":super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),this.isComplete()&&(s.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(s.release(),t(this))})})}constructor(e,t){super(),this.connection=new E(e),this.topologyConnection=new Le(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:Nr.Unknown})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(e=>(this.set(e.result),e)).catch(e=>{if(!e.Exception.some(e=>(20080===e.Code||20081===e.Code)&&(this.clearState(this.ID),this.set("State",Nr.NotFound),!0)))throw Lr.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}};e.AccessService=class extends j{},e.AccountService=class extends I{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>20043===e.Code))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:e.Exception}};throw e})}},e.Activity=er,e.Attribute=Ws,e.BUILD_VERSION="3.15.0",e.BaseScope=As,e.CloudService=class extends M{getPODs(){return super.GetPODs({}).then(e=>{if(function(e){return void 0!==e?.Pods}(e))return e.Pods?.Pod??[];try{return(("string"==typeof e.Result?JSON.parse(e.Result):e.Result)?.items??[]).filter(e=>{const t=e?.metadata?.labels??{};return t.hasOwnProperty("app.kubernetes.io/part-of")&&"HPCC-Platform"===t["app.kubernetes.io/part-of"]}).map(e=>{const t=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:t.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((e,t)=>(t.name&&e.push(t.name),e),[]).join(", ")??"",ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((e,t)=>e+(t.ready?1:0),0),ContainerRestartCount:e.status?.containerStatuses?.reduce((e,t)=>e+t.restartCount,0),Ports:{Port:G(e)}}})}catch(t){return k.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}},e.CodesignService=class extends Q{ListUserIDsEx(e){return super.ListUserIDs(e).then(e=>e.UserIDs.Item).catch(e=>[])}Sign(e){return super.Sign({SigningMethod:V.SigningMethodType.gpg,...e})}},e.Connection=D,e.DFUArrayActions=$,e.DFUChangeProtection=q,e.DFUChangeRestriction=z,e.DFUDefFileFormat=J,e.DFUService=Y,e.DFUWorkunit=Mr,e.DFUWorkunitCache=jr,e.DFUXRefService=class extends K{DFUXRefDirectoriesEx(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefListEx(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}},e.DaliService=class extends O{},e.ECLGraph=ts,e.ESPConnection=A,e.ESPExceptions=W,e.EclService=ne,e.ElkService=class extends se{},Object.defineProperty(e,"FileSpray",{enumerable:!0,get:function(){return w}}),e.FileSprayService=E,e.FileSprayStates=x,e.GlobalResultCache=Cs,e.GraphCache=ns,e.LogType=ue,e.LogaccessService=class extends oe{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){const t=await this.GetLogAccessInfo(),n={};t.Columns.Column.forEach(e=>n[e.LogType]=e.Name);const s=e=>{const t={};for(const s in n)t[s]=e?.fields?Object.assign({},...e.fields)[n[s]]??"":"";return t},r={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:re.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:re.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:re.SortColumType.ByDate,ColumnName:"",Direction:0}]}},i=[];for(const o in e){let t,s;if(o in n&&(t=Object.values(re.LogColumnType).includes(o)?o:n[o]),t){switch(t){case re.LogColumnType.workunits:case"hpcc.log.jobid":s=re.LogAccessType.ByJobID;break;case re.LogColumnType.audience:case"hpcc.log.audience":s=re.LogAccessType.ByTargetAudience;break;case re.LogColumnType.class:case"hpcc.log.class":s=re.LogAccessType.ByLogType;break;case re.LogColumnType.components:case"kubernetes.container.name":s=re.LogAccessType.ByComponent;break;default:s=re.LogAccessType.ByFieldName,t=n[o]}if(Array.isArray(e[o]))e[o].forEach(e=>{s===re.LogAccessType.ByComponent&&(e+="*"),i.push({LogCategory:s,SearchField:t,SearchByValue:e})});else{let n=e[o];s===re.LogAccessType.ByComponent&&(n+="*"),i.push({LogCategory:s,SearchField:t,SearchByValue:n})}}}if(i.length>2){let e=r.Filter.leftBinaryFilter.BinaryLogFilter[0];i.forEach((t,n)=>{let s=re.LogAccessFilterOperator.AND;n>0?(i[n-1].SearchField===t.SearchField&&(s=re.LogAccessFilterOperator.OR),n===i.length-1?(e.Operator=s,e.rightFilter=t):(e.Operator=s,e.rightBinaryFilter={BinaryLogFilter:[{leftFilter:t}]},e=e.rightBinaryFilter.BinaryLogFilter[0])):e.leftFilter=t})}else delete r.Filter.leftBinaryFilter,r.Filter.leftFilter={LogCategory:re.LogAccessType.All},i[0]?.SearchField&&(r.Filter.leftFilter={LogCategory:i[0]?.LogCategory,SearchField:i[0]?.SearchField,SearchByValue:i[0]?.SearchByValue}),i[1]?.SearchField&&(r.Filter.Operator=re.LogAccessFilterOperator.AND,i[0].SearchField===i[1].SearchField&&(r.Filter.Operator=re.LogAccessFilterOperator.OR),r.Filter.rightFilter={LogCategory:i[1]?.LogCategory,SearchField:i[1]?.SearchField,SearchByValue:i[1]?.SearchByValue});return e.StartDate&&(r.Range.StartDate=e.StartDate.toISOString()),e.EndDate&&(r.Range.EndDate=e.EndDate.toISOString()),this.GetLogs(r).then(e=>{try{const n=JSON.parse(e.LogLines);let r=[];switch(t.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":r=n.lines?.map(s)??[];break;default:ce.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),r=[]}return{lines:r,total:e.TotalLogLinesAvailable??1e4}}catch(n){ce.error(n.message??n)}return{lines:[],total:0}})}},e.LogicalFile=rr,e.LogicalFileCache=nr,e.Machine=cr,e.MachineCache=ir,e.MachineService=ye,e.PKG_NAME="@hpcc-js/comms",e.PKG_VERSION="3.11.0",e.PackageProcessService=class extends ve{},e.PropertyType=Ms,e.Query=wr,e.QueryGraph=br,e.RelatedProperty=ks,e.Resource=ms,e.ResourcesService=class extends Re{},e.Result=bs,e.ResultCache=Fs,e.SMCService=Ae,e.SashaService=class extends De{},e.Scope=Ts,e.ScopeEdge=ps,e.ScopeGraph=hs,e.ScopeSubgraph=ls,e.ScopeVertex=ds,e.Service=T,e.SourceFile=ws,e.Store=class Store{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new t.Dispatch;static attach(e,t="HPCCApps",n,s=!0){return xr.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:s,Namespace:n},()=>new Store(e,t,n,s))}constructor(e,t,n,s){this.connection=e instanceof we?e:new we(e),this.Name=t,this.UserSpecific=s,this.Namespace=n}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,n=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(s=>{const r=this._knownValues[e];this._knownValues[e]=t,n&&this._dispatch.post(new Er(e,t,r))}).catch(n=>{console.error(`Store.set("${e}", "${t}") failed:`,n)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(n=>{const s=this._knownValues[e];return this._knownValues[e]=n.Value,t&&this._dispatch.post(new Er(e,n.Value,s)),n.Value}).catch(t=>{console.error(`Store.get(${e}) failed:`,t)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{const n={},s=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(t=>{const r=this._knownValues[t.Key];this._knownValues[t.Key]=t.Value,delete s[t.Key],n[t.Key]=t.Value,e&&this._dispatch.post(new Er(t.Key,t.Value,r))}),e)for(const e in s)this._dispatch.post(new Er(e,void 0,s[e]));return n}).catch(e=>(console.error("Store.getAll failed:",e),{}))}delete(e,t=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(n=>{const s=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new Er(e,void 0,s))}).catch(t=>{console.error(`Store.delete(${e}) failed:`,t)})}monitor(e){return this._dispatch.attach(e)}},e.StoreCache=Pr,e.StoreService=we,e.TargetAudience=ae,e.TargetCluster=hr,e.TargetClusterCache=ur,e.Timer=Ps,e.Topology=gr,e.TopologyCache=dr,e.TopologyService=Le,e.ValueChangedMessage=Er,e.WUStateID=ke,Object.defineProperty(e,"WUUpdate",{enumerable:!0,get:function(){return Me}}),e.Workunit=zs,e.WorkunitCache=Js,e.WorkunitsService=Ve,e.WorkunitsServiceEx=Qe,Object.defineProperty(e,"WsAccess",{enumerable:!0,get:function(){return L}}),Object.defineProperty(e,"WsCodesign",{enumerable:!0,get:function(){return V}}),Object.defineProperty(e,"WsDfu",{enumerable:!0,get:function(){return B}}),Object.defineProperty(e,"WsLogaccess",{enumerable:!0,get:function(){return re}}),Object.defineProperty(e,"WsSMC",{enumerable:!0,get:function(){return be}}),Object.defineProperty(e,"WsSasha",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(e,"WsTopology",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(e,"WsWorkunits",{enumerable:!0,get:function(){return Ne}}),e.XGMMLEdge=us,e.XGMMLGraph=is,e.XGMMLSubgraph=os,e.XGMMLVertex=cs,e.XSDNode=fs,e.XSDSchema=_s,e.XSDSimpleType=Us,e.XSDXMLNode=Ss,Object.defineProperty(e,"createConnection",{enumerable:!0,get:function(){return b}}),e.createGraph=gs,e.createXGMMLGraph=as,e.defaultTargetCluster=function(e){if(!lr[e.baseUrl]){let t;t=e instanceof Le?e:new Le(e),lr[e.baseUrl]=t.TpListTargetClusters({}).then(t=>{let n,s,r;t.TargetClusters.TpClusterNameType.forEach(e=>{n||(n=e),s||!0!==e.IsDefault||(s=e),r||"hthor"!==e.Type||(r=e)});const i=s||r||n;return hr.attach(e,i.Name,i)})}return lr[e.baseUrl]},e.deserializeResponse=m,e.get=v,e.hookSend=function(e){const t=C;return e&&(C=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=F,e.isECLResult=Ge,e.isExceptions=function(e){return e instanceof W||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=vs,e.parseXSD2=function(e,t){const n=new Rs(t);return n.parse(e),n.schema},e.post=y,e.send=R,e.serializeRequest=g,e.setTransportFactory=function(e){const t=b;return b=e,t},e.splitMetric=Qs,e.targetClusters=function(e){let t;return t=e instanceof Le?e:new Le(e),t.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(t=>hr.attach(e,t.Name,t)))}});
|
|
2
2
|
//# sourceMappingURL=index.umd.cjs.map
|