@hpcc-js/comms 3.14.4 → 3.15.1

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.
Files changed (109) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +50 -50
  3. package/dist/browser/index.js +1 -1
  4. package/dist/browser/index.js.map +1 -1
  5. package/dist/browser/index.umd.cjs +1 -1
  6. package/dist/browser/index.umd.cjs.map +1 -1
  7. package/dist/node/index.cjs +8 -8
  8. package/dist/node/index.cjs.map +3 -3
  9. package/dist/node/index.js +7 -7
  10. package/dist/node/index.js.map +3 -3
  11. package/package.json +7 -7
  12. package/src/__package__.ts +3 -3
  13. package/src/clienttools/eclMeta.ts +506 -506
  14. package/src/clienttools/eclcc.ts +628 -628
  15. package/src/connection.ts +288 -288
  16. package/src/ecl/activity.ts +82 -82
  17. package/src/ecl/dfuWorkunit.ts +363 -363
  18. package/src/ecl/graph.ts +196 -196
  19. package/src/ecl/logicalFile.ts +196 -196
  20. package/src/ecl/machine.ts +63 -63
  21. package/src/ecl/query.ts +265 -265
  22. package/src/ecl/queryGraph.ts +813 -813
  23. package/src/ecl/resource.ts +39 -39
  24. package/src/ecl/result.ts +245 -245
  25. package/src/ecl/scope.ts +188 -188
  26. package/src/ecl/sourceFile.ts +34 -34
  27. package/src/ecl/store.ts +154 -154
  28. package/src/ecl/targetCluster.ts +149 -149
  29. package/src/ecl/timer.ts +42 -42
  30. package/src/ecl/topology.ts +131 -131
  31. package/src/ecl/workunit.ts +1340 -1340
  32. package/src/ecl/xsdParser.ts +267 -267
  33. package/src/espConnection.ts +164 -164
  34. package/src/index.browser.ts +1 -1
  35. package/src/index.common.ts +40 -40
  36. package/src/index.node.ts +48 -48
  37. package/src/pem/trustwave.ts +909 -909
  38. package/src/services/fileSpray.ts +73 -48
  39. package/src/services/wsAccess.ts +8 -8
  40. package/src/services/wsAccount.ts +27 -27
  41. package/src/services/wsCloud.ts +73 -73
  42. package/src/services/wsCodesign.ts +18 -18
  43. package/src/services/wsDFU.ts +34 -34
  44. package/src/services/wsDFUXRef.ts +121 -121
  45. package/src/services/wsDali.ts +8 -8
  46. package/src/services/wsEcl.ts +123 -123
  47. package/src/services/wsElk.ts +8 -8
  48. package/src/services/wsLogaccess.ts +267 -267
  49. package/src/services/wsMachine.ts +89 -89
  50. package/src/services/wsPackageProcess.ts +8 -8
  51. package/src/services/wsResources.ts +8 -8
  52. package/src/services/wsSMC.ts +80 -80
  53. package/src/services/wsSasha.ts +7 -7
  54. package/src/services/wsStore.ts +32 -32
  55. package/src/services/wsTopology.ts +45 -45
  56. package/src/services/wsWorkunits.ts +151 -151
  57. package/src/services/wsdl/FileSpray/v1.23/FileSpray.ts +1008 -1008
  58. package/src/services/wsdl/FileSpray/v1.25/FileSpray.ts +1040 -1040
  59. package/src/services/wsdl/FileSpray/v1.26/FileSpray.ts +929 -929
  60. package/src/services/wsdl/FileSpray/v1.27/FileSpray.ts +930 -930
  61. package/src/services/wsdl/WsCloud/v1/WsCloud.ts +38 -38
  62. package/src/services/wsdl/WsCloud/v1.02/WsCloud.ts +77 -77
  63. package/src/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.ts +224 -224
  64. package/src/services/wsdl/WsDFUXRef/v1.04/WsDFUXRef.ts +227 -227
  65. package/src/services/wsdl/WsDali/v1.04/WsDali.ts +216 -216
  66. package/src/services/wsdl/WsDfu/v1.62/WsDfu.ts +1455 -1455
  67. package/src/services/wsdl/WsDfu/v1.63/WsDfu.ts +1465 -1465
  68. package/src/services/wsdl/WsDfu/v1.65/WsDfu.ts +1244 -1244
  69. package/src/services/wsdl/WsDfu/v1.66/WsDfu.ts +1267 -1267
  70. package/src/services/wsdl/WsDfu/v1.67/WsDfu.ts +1268 -1268
  71. package/src/services/wsdl/WsFileIO/v1.01/WsFileIO.ts +104 -104
  72. package/src/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.ts +519 -519
  73. package/src/services/wsdl/WsPackageProcess/v1.07/WsPackageProcess.ts +500 -500
  74. package/src/services/wsdl/WsResources/v1.01/WsResources.ts +119 -119
  75. package/src/services/wsdl/WsSMC/v1.24/WsSMC.ts +665 -665
  76. package/src/services/wsdl/WsSMC/v1.27/WsSMC.ts +591 -591
  77. package/src/services/wsdl/WsSMC/v1.28/WsSMC.ts +645 -645
  78. package/src/services/wsdl/WsSMC/v1.29/WsSMC.ts +660 -660
  79. package/src/services/wsdl/WsTopology/v1.31/WsTopology.ts +856 -856
  80. package/src/services/wsdl/WsTopology/v1.32/WsTopology.ts +786 -786
  81. package/src/services/wsdl/WsTopology/v1.33/WsTopology.ts +835 -835
  82. package/src/services/wsdl/WsWorkunits/v1.88/WsWorkunits.ts +2944 -2944
  83. package/src/services/wsdl/WsWorkunits/v1.94/WsWorkunits.ts +3072 -3072
  84. package/src/services/wsdl/WsWorkunits/v1.95/WsWorkunits.ts +3073 -3073
  85. package/src/services/wsdl/WsWorkunits/v1.97/WsWorkunits.ts +3134 -3134
  86. package/src/services/wsdl/WsWorkunits/v1.98/WsWorkunits.ts +3182 -3182
  87. package/src/services/wsdl/WsWorkunits/v1.99/WsWorkunits.ts +3162 -3162
  88. package/src/services/wsdl/WsWorkunits/v2/WsWorkunits.ts +3153 -3153
  89. package/src/services/wsdl/WsWorkunits/v2.02/WsWorkunits.ts +3162 -3162
  90. package/src/services/wsdl/WsWorkunits/v2.03/WsWorkunits.ts +3164 -3164
  91. package/src/services/wsdl/WsWorkunits/v2.04/WsWorkunits.ts +3171 -3171
  92. package/src/services/wsdl/ws_access/v1.16/ws_access.ts +1086 -1086
  93. package/src/services/wsdl/ws_access/v1.17/ws_access.ts +1023 -1023
  94. package/src/services/wsdl/ws_account/v1.05/ws_account.ts +111 -111
  95. package/src/services/wsdl/ws_account/v1.06/ws_account.ts +109 -109
  96. package/src/services/wsdl/ws_account/v1.07/ws_account.ts +114 -114
  97. package/src/services/wsdl/ws_codesign/v1.1/ws_codesign.ts +95 -95
  98. package/src/services/wsdl/ws_elk/v1/ws_elk.ts +47 -47
  99. package/src/services/wsdl/ws_logaccess/v1/ws_logaccess.ts +83 -83
  100. package/src/services/wsdl/ws_logaccess/v1.02/ws_logaccess.ts +161 -161
  101. package/src/services/wsdl/ws_logaccess/v1.03/ws_logaccess.ts +190 -190
  102. package/src/services/wsdl/ws_logaccess/v1.04/ws_logaccess.ts +215 -215
  103. package/src/services/wsdl/ws_logaccess/v1.05/ws_logaccess.ts +219 -219
  104. package/src/services/wsdl/ws_logaccess/v1.08/ws_logaccess.ts +267 -267
  105. package/src/services/wsdl/ws_machine/v1.17/ws_machine.ts +567 -567
  106. package/src/services/wsdl/ws_machine/v1.18/ws_machine.ts +497 -497
  107. package/src/services/wsdl/ws_machine/v1.19/ws_machine.ts +497 -497
  108. package/src/services/wsdl/wsstore/v1.02/wsstore.ts +239 -239
  109. package/types/services/fileSpray.d.ts +13 -0
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/util"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/comms"]={},e["@hpcc-js/util"])}(this,function(e,t){"use strict";var s=Object.defineProperty,n=(e,t)=>s(e,"name",{value:t,configurable:!0});const r=t.scopedLogger("comms/connection.ts");function i(e){return"baseUrl"in e}n(i,"instanceOfIOptions");const o={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function c(e){return"function"==typeof e.opts&&"function"==typeof e.send&&"function"==typeof e.clone}function a(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function u(e,t=!0,s=""){if(s&&(s+="."),"object"!=typeof e)return a(e,t);const n=[];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,n.push(u(e,t,s+a(`${r}.${o}`,t)))):n.push(s+a(`${r}_i${o}`,t)+"="+u(e,t))}),i&&n.push(s+a(`${r}.itemcount`,t)+"="+e[r].length)}else"object"==typeof e[r]?e[r]&&e[r].Item instanceof Array?(n.push(u(e[r].Item,t,s+a(r,t))),n.push(s+a(`${r}.itemcount`,t)+"="+e[r].Item.length)):n.push(u(e[r],t,s+a(r,t))):void 0!==e[r]?n.push(s+a(r,t)+"="+a(e[r],t)):n.push(s+a(r,t));return n.join("&")}function h(e){return JSON.parse(e)}function l(e,s,i={},o="json",c){return c&&console.warn("Header attributes ignored for JSONP connections"),new Promise((c,a)=>{let l=1e3*e.timeoutSecs;const d="jsonp_callback_"+Math.round(999999*Math.random());window[d]=function(e){l=0,S(),c("json"===o&&"string"==typeof e?h(e):e)};const p=document.createElement("script");let g=t.join(e.baseUrl,s);g+=g.indexOf("?")>=0?"&":"?",p.src=g+"jsonp="+d+"&"+u(i,e.encodeRequest),document.body.appendChild(p);const m=setInterval(function(){l<=0?clearInterval(m):(l-=5e3,l<=0?(clearInterval(m),r.error("Request timeout: "+p.src),S(),a(Error("Request timeout: "+p.src))):r.debug("Request pending ("+l/1e3+" sec): "+p.src))},5e3);function S(){delete window[d],document.body.removeChild(p)}n(S,"doCallback")})}function d(e){return e.userID?{Authorization:`Basic ${t.utf8ToBase64(`${e.userID}:${e.password}`)}`}:{}}n(c,"instanceOfIConnection"),n(a,"encode"),n(u,"serializeRequest"),n(h,"deserializeResponse"),n(l,"jsonp"),n(d,"authHeader");const p={};function g(e,s,r,i,o){function c(e){if(e.ok)return"json"===o?e.json():e.text();throw new Error(e.statusText)}i={...d(e),...i},r={credentials:p[e.baseUrl]?"omit":"include",...r,headers:i},0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&t.root.__hpcc_rejectUnauthorizedAgent?r.dispatcher=t.root.__hpcc_rejectUnauthorizedAgent:t.root.__hpcc_trustwaveAgent&&(r.agent=t.root.__hpcc_trustwaveAgent)),n(c,"handleResponse");const a=t.root.__hpcc_undiciFetch??fetch;return t.promiseTimeout(1e3*e.timeoutSecs,a(t.join(e.baseUrl,s),r).then(c).catch(n=>(r.credentials=p[e.baseUrl]?"include":"omit",a(t.join(e.baseUrl,s),r).then(c).then(t=>(p[e.baseUrl]=!p[e.baseUrl],t)))))}function m(e,t,s,n="json",r){let i;return s.upload_&&(delete s.upload_,t+="?upload_"),s.abortSignal_&&(i=s.abortSignal_,delete s.abortSignal_),g(e,t,{method:"post",body:u(s,e.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},n)}function S(e,t,s,n="json",r){let i;return s.abortSignal_&&(i=s.abortSignal_,delete s.abortSignal_),g(e,`${t}?${u(s,e.encodeRequest)}`,{method:"get",signal:i},{...r},n)}function f(e,t,s,n="json",r){let i;switch(e.type){case"jsonp":i=l(e,t,s,n,r);break;case"get":i=S(e,t,s,n,r);break;default:i=m(e,t,s,n,r)}return i}n(g,"doFetch"),n(m,"post"),n(S,"get"),n(f,"send");let _=f;function U(e){const t=_;return e&&(_=e),t}n(U,"hookSend");const y=class _Connection{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return 0===arguments.length?this._opts:(this._opts={...o,...e},this)}send(e,t,s="json",n){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,_,n):_(this._opts,e,t,s,n)}clone(){return new _Connection(this.opts())}};n(y,"Connection");let v=y;function C(t){const s=e.createConnection;return e.createConnection=t,s}function D(e){return"[object Array]"===Object.prototype.toString.call(e)}e.createConnection=function(e){return new v(e)},n(C,"setTransportFactory"),n(D,"isArray");const R=class _ESPExceptions extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,s){super("ESPException: "+s.Source),this.action=e,this.request=t,this.Source=s.Source,this.Exception=s.Exception,s.Exception.length?this.message=`${s.Exception[0].Code}: ${s.Exception[0].Message}`:this.message=""}};n(R,"ESPExceptions");let W=R;function b(e){return e instanceof W||e.isESPExceptions&&Array.isArray(e.Exception)}function F(e){return void 0!==e.send}n(b,"isExceptions"),n(F,"isConnection");const T=class _ESPConnection{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(t,s,n){this._connection=F(t)?t:e.createConnection(t),this._service=s,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(D(e[t])){for(let s=0;s<e[t].length;++s)e[t+"_i"+s]=e[t][s];delete e[t]}return e}opts(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)}send(e,s={},n="json",r=!1,i,o){const c={...s,ver_:this._version};let a;r&&(c.upload_=!0),i&&(c.abortSignal_=i);let u="json";switch(n){case"text":a=t.join(this._service,e),u="text";break;case"xsd":a=t.join(this._service,e+".xsd"),u="text";break;case"json2":a=t.join(this._service,e+"/json"),n="json";const s=e.split("/");e=s.pop();break;default:a=t.join(this._service,e+".json")}return this._connection.send(a,c,u).then(t=>{if("json"===n){let s;if(t&&t.Exceptions)throw new W(e,c,t.Exceptions);if(t&&(s=t[o||e+"Response"]),!s)throw new W(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return s}return t})}clone(){return new _ESPConnection(this._connection.clone(),this._service,this._version)}};n(T,"ESPConnection");let A=T;const L=class _Service{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,s){this._connection=new A(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};n(L,"Service");let w=L;var x,P;e.FileSpray=void 0,x=e.FileSpray||(e.FileSpray={}),(P=x.DFUWUActions||(x.DFUWUActions={})).Delete="Delete",P.Protect="Protect",P.Unprotect="Unprotect",P.Restore="Restore",P.SetToFailed="SetToFailed",P.Archive="Archive";const M=class _FileSprayServiceBase extends w{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")}};n(M,"FileSprayServiceBase");let E=M;var N=(e=>(e[e.unknown=0]="unknown",e[e.scheduled=1]="scheduled",e[e.queued=2]="queued",e[e.started=3]="started",e[e.aborted=4]="aborted",e[e.failed=5]="failed",e[e.finished=6]="finished",e[e.monitoring=7]="monitoring",e[e.aborting=8]="aborting",e[e.notfound=999]="notfound",e))(N||{});const I=class _FileSprayService extends E{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")}};n(I,"FileSprayService");let j=I;var k,G,V,Q,B,O;e.WsAccess=void 0,k=e.WsAccess||(e.WsAccess={}),(G=k.ViewMemberType||(k.ViewMemberType={})).User="User",G.Group="Group",(V=k.UserSortBy||(k.UserSortBy={})).username="username",V.fullname="fullname",V.passwordexpiration="passwordexpiration",V.employeeID="employeeID",V.employeeNumber="employeeNumber",(Q=k.GroupSortBy||(k.GroupSortBy={})).Name="Name",Q.ManagedBy="ManagedBy",(B=k.AccountTypeReq||(k.AccountTypeReq={})).Any="Any",B.User="User",B.Group="Group",(O=k.ResourcePermissionSortBy||(k.ResourcePermissionSortBy={})).Name="Name",O.Type="Type",(k.ResourceSortBy||(k.ResourceSortBy={})).Name="Name";const X=class _AccessServiceBase extends w{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")}};n(X,"AccessServiceBase");let H=X;const $=class _AccessService extends H{};n($,"AccessService");let J=$;const q=class _AccountServiceBase extends w{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")}};n(q,"AccountServiceBase");let Y=q;const z=class _AccountService extends Y{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})}};n(z,"AccountService");let Z=z;const K=class _CloudServiceBase extends w{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")}};n(K,"CloudServiceBase");let ee=K;const te=t.scopedLogger("@hpcc-js/comms/services/wsCloud.ts");function se(e){return void 0!==e?.Pods}function ne(e){return e.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(t=>{e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e),[])??[]}function re(e){return e.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:ne(e)}}})}n(se,"isGetPODsResponse_v1_02"),n(ne,"mapPorts"),n(re,"mapPods");const ie=class _CloudService extends ee{getPODs(){return super.GetPODs({}).then(e=>{if(se(e))return e.Pods?.Pod??[];try{const t="string"==typeof e.Result?JSON.parse(e.Result):e.Result;return re(t?.items??[])}catch(t){return te.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};n(ie,"CloudService");let oe=ie;var ce;e.WsCodesign=void 0,((ce=e.WsCodesign||(e.WsCodesign={})).SigningMethodType||(ce.SigningMethodType={})).gpg="gpg";const ae=class _CodesignServiceBase extends w{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")}};n(ae,"CodesignServiceBase");let ue=ae;const he=class _CodesignService extends ue{ListUserIDsEx(e){return super.ListUserIDs(e).then(e=>e.UserIDs.Item).catch(e=>[])}Sign(t){return super.Sign({SigningMethod:e.WsCodesign.SigningMethodType.gpg,...t})}};n(he,"CodesignService");let le=he;const de=class _DaliServiceBase extends w{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")}};n(de,"DaliServiceBase");let pe=de;const ge=class _DaliService extends pe{};n(ge,"DaliService");let me=ge;var Se,fe,_e,Ue,ye,ve,Ce,De;e.WsDfu=void 0,Se=e.WsDfu||(e.WsDfu={}),(fe=Se.DFUArrayActions||(Se.DFUArrayActions={})).Delete="Delete",fe.AddToSuperfile="Add To Superfile",fe.ChangeProtection="Change Protection",fe.ChangeRestriction="Change Restriction",(_e=Se.DFUChangeProtection||(Se.DFUChangeProtection={}))[_e.NoChange=0]="NoChange",_e[_e.Protect=1]="Protect",_e[_e.Unprotect=2]="Unprotect",_e[_e.UnprotectAll=3]="UnprotectAll",(Ue=Se.DFUChangeRestriction||(Se.DFUChangeRestriction={}))[Ue.NoChange=0]="NoChange",Ue[Ue.Restrict=1]="Restrict",Ue[Ue.Unrestricted=2]="Unrestricted",(ye=Se.DFUDefFileFormat||(Se.DFUDefFileFormat={})).xml="xml",ye.def="def",(ve=Se.FileAccessRole||(Se.FileAccessRole={})).Token="Token",ve.Engine="Engine",ve.External="External",(Ce=Se.SecAccessType||(Se.SecAccessType={})).None="None",Ce.Access="Access",Ce.Read="Read",Ce.Write="Write",Ce.Full="Full",(De=Se.DFUFileType||(Se.DFUFileType={})).Flat="Flat",De.Index="Index",De.Xml="Xml",De.Csv="Csv",De.Json="Json",De.IndexLocal="IndexLocal",De.IndexPartitioned="IndexPartitioned",De.Unset="Unset";const Re=class _DfuServiceBase extends w{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")}};n(Re,"DfuServiceBase");let We=Re;const be=e.WsDfu.DFUArrayActions,Fe=e.WsDfu.DFUDefFileFormat,Te=e.WsDfu.DFUChangeProtection,Ae=e.WsDfu.DFUChangeRestriction,Le=class _DFUService extends We{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){const t=[],s=[];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 s of e?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(s);for(const t of e?.FileDetail?.subfiles?.Item??[])s.push(t)}))),s.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}};n(Le,"DFUService");let we=Le;const xe=class _DFUXRefServiceBase extends w{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")}};n(xe,"DFUXRefServiceBase");let Pe=xe;const Me=class _DFUXRefService extends Pe{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")}};n(Me,"DFUXRefService");let Ee=Me;function Ne(e,t){const s=typeof t;switch(s){case"boolean":case"number":case"string":return{id:e,type:s};case"object":if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:"dataset",children:Ie(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){const s=typeof t.Item[0];if("string"===s||"number"===s)return{id:e,type:"set",fieldType:s};throw new Error("Unknown field type")}return{id:e,type:"object",fields:je(t)}}default:throw new Error("Unknown field type")}}function Ie(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);const t=[];for(const s in e)t.push(Ne(s,e[s]));return t}function je(e){const t={};for(const s in e)t[s]=Ne(s,e[s]);return t}n(Ne,"jsonToIField"),n(Ie,"jsonToIFieldArr"),n(je,"jsonToIFieldObj");const ke=class _EclService extends w{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 s in t)return t[s];return{}}).then(Ie)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(e=>{const t=JSON.parse(e);for(const s in t)return t[s].Results;return{}}).then(e=>{const t={};for(const s in e)t[s]=Ie(e[s]);return t})}submit(e,t,s){const n=`submit/query/${e}/${t}`;return this._connection.send(n,s,"json2").then(e=>{if(e.Results&&e.Results.Exception)throw new W(n,s,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})}};n(ke,"EclService");let Ge=ke;const Ve=class _ElkServiceBase extends w{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")}};n(Ve,"ElkServiceBase");let Qe=Ve;const Be=class _ElkService extends Qe{};n(Be,"ElkService");let Oe=Be;var Xe,He,$e,Je,qe,Ye,ze,Ze,Ke;e.WsLogaccess=void 0,Xe=e.WsLogaccess||(e.WsLogaccess={}),(He=Xe.LogColumnType||(Xe.LogColumnType={})).global="global",He.workunits="workunits",He.components="components",He.audience="audience",He.class="class",He.instance="instance",He.node="node",He.message="message",He.logid="logid",He.processid="processid",He.threadid="threadid",He.timestamp="timestamp",He.pod="pod",He.traceid="traceid",He.spanid="spanid",($e=Xe.LogColumnValueType||(Xe.LogColumnValueType={})).string="string",$e.numeric="numeric",$e.datetime="datetime",$e.enum="enum",$e.epoch="epoch",(Je=Xe.LogAccessType||(Xe.LogAccessType={}))[Je.All=0]="All",Je[Je.ByJobID=1]="ByJobID",Je[Je.ByComponent=2]="ByComponent",Je[Je.ByLogType=3]="ByLogType",Je[Je.ByTargetAudience=4]="ByTargetAudience",Je[Je.BySourceInstance=5]="BySourceInstance",Je[Je.BySourceNode=6]="BySourceNode",Je[Je.ByFieldName=7]="ByFieldName",Je[Je.ByPod=8]="ByPod",Je[Je.ByTraceID=9]="ByTraceID",Je[Je.BySpanID=10]="BySpanID",(qe=Xe.LogAccessStatusCode||(Xe.LogAccessStatusCode={}))[qe.Success=0]="Success",qe[qe.Warning=1]="Warning",qe[qe.Fail=2]="Fail",(Ye=Xe.LogAccessFilterOperator||(Xe.LogAccessFilterOperator={}))[Ye.NONE=0]="NONE",Ye[Ye.AND=1]="AND",Ye[Ye.OR=2]="OR",(ze=Xe.LogSelectColumnMode||(Xe.LogSelectColumnMode={}))[ze.MIN=0]="MIN",ze[ze.DEFAULT=1]="DEFAULT",ze[ze.ALL=2]="ALL",ze[ze.CUSTOM=3]="CUSTOM",(Ze=Xe.SortColumType||(Xe.SortColumType={}))[Ze.ByDate=0]="ByDate",Ze[Ze.ByJobID=1]="ByJobID",Ze[Ze.ByComponent=2]="ByComponent",Ze[Ze.ByLogType=3]="ByLogType",Ze[Ze.ByTargetAudience=4]="ByTargetAudience",Ze[Ze.BySourceInstance=5]="BySourceInstance",Ze[Ze.BySourceNode=6]="BySourceNode",Ze[Ze.ByFieldName=7]="ByFieldName",Ze[Ze.ByPod=8]="ByPod",Ze[Ze.ByTraceID=9]="ByTraceID",Ze[Ze.BySpanID=10]="BySpanID",(Ke=Xe.SortDirection||(Xe.SortDirection={}))[Ke.ASC=0]="ASC",Ke[Ke.DSC=1]="DSC";const et=class _LogaccessServiceBase extends w{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")}};n(et,"LogaccessServiceBase");let tt=et;const st=t.scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts");var nt=(e=>(e.Disaster="DIS",e.Error="ERR",e.Warning="WRN",e.Information="INF",e.Progress="PRO",e.Metric="MET",e))(nt||{}),rt=(e=>(e.Operator="OPR",e.User="USR",e.Programmer="PRO",e.Audit="ADT",e))(rt||{});const it=class _LogaccessService extends tt{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(t){const s=await this.GetLogAccessInfo(),r={};s.Columns.Column.forEach(e=>r[e.LogType]=e.Name);const i=n(e=>{const t={};for(const s in r)t[s]=e?.fields?Object.assign({},...e.fields)[r[s]]??"":"";return t},"convertLogLine"),o={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:e.WsLogaccess.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:t.LogLineStartFrom??0,LogLineLimit:t.LogLineLimit??100,SelectColumnMode:e.WsLogaccess.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:e.WsLogaccess.SortColumType.ByDate,ColumnName:"",Direction:0}]}},c=[],a=Object.values(e.WsLogaccess.LogColumnType);for(const n in t){if(null==t[n]||""===t[n]||Array.isArray(t[n])&&0===t[n].length)continue;let s,i;if(n in r&&(s=a.includes(n)?n:r[n]),s){switch(s){case e.WsLogaccess.LogColumnType.workunits:case"hpcc.log.jobid":i=e.WsLogaccess.LogAccessType.ByJobID;break;case e.WsLogaccess.LogColumnType.audience:case"hpcc.log.audience":i=e.WsLogaccess.LogAccessType.ByTargetAudience;break;case e.WsLogaccess.LogColumnType.class:case"hpcc.log.class":i=e.WsLogaccess.LogAccessType.ByLogType;break;case e.WsLogaccess.LogColumnType.components:case"kubernetes.container.name":i=e.WsLogaccess.LogAccessType.ByComponent;break;default:i=e.WsLogaccess.LogAccessType.ByFieldName,s=r[n]}if(Array.isArray(t[n]))t[n].forEach(t=>{i===e.WsLogaccess.LogAccessType.ByComponent&&(t+="*"),c.push({LogCategory:i,SearchField:s,SearchByValue:t})});else{let r=t[n];i===e.WsLogaccess.LogAccessType.ByComponent&&(r+="*"),c.push({LogCategory:i,SearchField:s,SearchByValue:r})}}}if(c.length>2){let t=o.Filter.leftBinaryFilter.BinaryLogFilter[0];c.forEach((s,n)=>{let r=e.WsLogaccess.LogAccessFilterOperator.AND;n>0?(c[n-1].SearchField===s.SearchField&&(r=e.WsLogaccess.LogAccessFilterOperator.OR),n===c.length-1?(t.Operator=r,t.rightFilter=s):(t.Operator=r,t.rightBinaryFilter={BinaryLogFilter:[{leftFilter:s}]},t=t.rightBinaryFilter.BinaryLogFilter[0])):t.leftFilter=s})}else delete o.Filter.leftBinaryFilter,o.Filter.leftFilter={LogCategory:e.WsLogaccess.LogAccessType.All},c[0]?.SearchField&&(o.Filter.leftFilter={LogCategory:c[0]?.LogCategory,SearchField:c[0]?.SearchField,SearchByValue:c[0]?.SearchByValue}),c[1]?.SearchField&&(o.Filter.Operator=e.WsLogaccess.LogAccessFilterOperator.AND,c[0].SearchField===c[1].SearchField&&(o.Filter.Operator=e.WsLogaccess.LogAccessFilterOperator.OR),o.Filter.rightFilter={LogCategory:c[1]?.LogCategory,SearchField:c[1]?.SearchField,SearchByValue:c[1]?.SearchByValue});return t.StartDate&&(o.Range.StartDate=t.StartDate.toISOString()),t.EndDate&&(o.Range.EndDate=t.EndDate.toISOString()),this.GetLogs(o).then(e=>{try{const t=JSON.parse(e.LogLines);let n=[];switch(s.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":n=t.lines?.map(i)??[];break;default:st.warning(`Unknown RemoteLogManagerType: ${s.RemoteLogManagerType}`),n=[]}return{lines:n,total:e.TotalLogLinesAvailable??1e4}}catch(t){st.error(t.message??t)}return{lines:[],total:0}})}};n(it,"LogaccessService");let ot=it;function ct(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function at(e){return 1===e.length&&(e=ut(e)),{left:n(function(t,s,n,r){for(null==n&&(n=0),null==r&&(r=t.length);n<r;){var i=n+r>>>1;e(t[i],s)<0?n=i+1:r=i}return n},"left"),right:n(function(t,s,n,r){for(null==n&&(n=0),null==r&&(r=t.length);n<r;){var i=n+r>>>1;e(t[i],s)>0?r=i:n=i+1}return n},"right")}}function ut(e){return function(t,s){return ct(e(t),s)}}function ht(e){return null===e?NaN:+e}function lt(e,t){var s,n,r=e.length,i=-1;if(null==t){for(;++i<r;)if(null!=(s=e[i])&&s>=s)for(n=s;++i<r;)null!=(s=e[i])&&s>n&&(n=s)}else for(;++i<r;)if(null!=(s=t(e[i],i,e))&&s>=s)for(n=s;++i<r;)null!=(s=t(e[i],i,e))&&s>n&&(n=s);return n}function dt(e,t){var s,n=e.length,r=n,i=-1,o=0;if(null==t)for(;++i<n;)isNaN(s=ht(e[i]))?--r:o+=s;else for(;++i<n;)isNaN(s=ht(t(e[i],i,e)))?--r:o+=s;if(r)return o/r}var pt,gt,mt,St;n(ct,"ascending"),n(at,"bisector"),n(ut,"ascendingComparator"),at(ct),n(ht,"number"),n(lt,"d3Max"),n(dt,"d3Mean"),gt=pt||(pt={}),(mt=gt.ThresholdType||(gt.ThresholdType={}))[mt.THRESHOLD_PERCENTAGE=0]="THRESHOLD_PERCENTAGE",mt[mt.THRESHOLD_MB=1]="THRESHOLD_MB",(St=gt.TpMachineType||(gt.TpMachineType={})).ALLNODES="ALLNODES",St.THORMACHINES="THORMACHINES",St.HOLEMACHINES="HOLEMACHINES",St.ROXIEMACHINES="ROXIEMACHINES",St.MACHINES="MACHINES",St.AVAILABLEMACHINES="AVAILABLEMACHINES",St.DROPZONE="DROPZONE",St.STANDBYNNODE="STANDBYNNODE",St.THORSPARENODES="THORSPARENODES",St.HOLESTANDBYNODES="HOLESTANDBYNODES";const ft=class _MachineServiceBase extends w{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")}};n(ft,"MachineServiceBase");let _t=ft;const Ut=class _MachineService extends _t{GetTargetClusterUsageEx(e,s=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:s}).then(e=>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:dt(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed),max:lt(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:dt(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:lt(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:dt(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:lt(t.filter(e=>!isNaN(e.max)),e=>e.max)}}))}};n(Ut,"MachineService");let yt=Ut;const vt=class _PackageProcessServiceBase extends w{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")}};n(vt,"PackageProcessServiceBase");let Ct=vt;const Dt=class _PackageProcessService extends Ct{};n(Dt,"PackageProcessService");let Rt=Dt;const Wt=class _ResourcesServiceBase extends w{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)}};n(Wt,"ResourcesServiceBase");let bt=Wt;const Ft=class _ResourcesService extends bt{};n(Ft,"ResourcesService");let Tt=Ft;var At,Lt;e.WsSasha=void 0,At=e.WsSasha||(e.WsSasha={}),(Lt=At.WUTypes||(At.WUTypes={})).ECL="ECL",Lt.DFU="DFU";const wt=class _SashaServiceBase extends w{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")}};n(wt,"SashaServiceBase");let xt=wt;const Pt=class _SashaService extends xt{};n(Pt,"SashaService");let Mt=Pt;var Et=new Date,Nt=new Date;function It(e,t,s,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return n(i,"interval"),i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(s){return e(s=new Date(s-1)),t(s,1),e(s),s},i.round=function(e){var t=i(e),s=i.ceil(e);return e-t<s-e?t:s},i.offset=function(e,s){return t(e=new Date(+e),null==s?1:Math.floor(s)),e},i.range=function(s,n,r){var o,c=[];if(s=i.ceil(s),r=null==r?1:Math.floor(r),!(s<n&&r>0))return c;do{c.push(o=new Date(+s)),t(s,r),e(s)}while(o<s&&s<n);return c},i.filter=function(s){return It(function(t){if(t>=t)for(;e(t),!s(t);)t.setTime(t-1)},function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!s(e););else for(;--n>=0;)for(;t(e,1),!s(e););})},s&&(i.count=function(t,n){return Et.setTime(+t),Nt.setTime(+n),e(Et),e(Nt),Math.floor(s(Et,Nt))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}n(It,"newInterval");var jt=864e5,kt=6048e5,Gt=It(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()))/jt},function(e){return e.getDate()-1});function Vt(e){return It(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()))/kt})}Gt.range,n(Vt,"weekday");var Qt=Vt(0),Bt=Vt(1),Ot=Vt(2),Xt=Vt(3),Ht=Vt(4),$t=Vt(5),Jt=Vt(6);Qt.range,Bt.range,Ot.range,Xt.range,Ht.range,$t.range,Jt.range;var qt=It(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()});qt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?It(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,s){t.setFullYear(t.getFullYear()+s*e)}):null},qt.range;var Yt=It(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/jt},function(e){return e.getUTCDate()-1});function zt(e){return It(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)/kt})}Yt.range,n(zt,"utcWeekday");var Zt=zt(0),Kt=zt(1),es=zt(2),ts=zt(3),ss=zt(4),ns=zt(5),rs=zt(6);Zt.range,Kt.range,es.range,ts.range,ss.range,ns.range,rs.range;var is=It(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});function os(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 cs(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 as(e,t,s){return{y:e,m:t,d:s,H:0,M:0,S:0,L:0}}function us(e){var t=e.dateTime,s=e.date,r=e.time,i=e.periods,o=e.days,c=e.shortDays,a=e.months,u=e.shortMonths,h=Ds(i),l=Rs(i),d=Ds(o),p=Rs(o),g=Ds(c),m=Rs(c),S=Ds(a),f=Rs(a),_=Ds(u),U=Rs(u),y={a:M,A:E,b:N,B:I,c:null,d:Xs,e:Xs,f:Ys,g:an,G:hn,H:Hs,I:$s,j:Js,L:qs,m:zs,M:Zs,p:j,q:k,Q:Pn,s:Mn,S:Ks,u:en,U:tn,V:nn,w:rn,W:on,x:null,X:null,y:cn,Y:un,Z:ln,"%":xn},v={a:G,A:V,b:Q,B:B,c:null,d:dn,e:dn,f:fn,g:Tn,G:Ln,H:pn,I:gn,j:mn,L:Sn,m:_n,M:Un,p:O,q:X,Q:Pn,s:Mn,S:yn,u:vn,U:Cn,V:Rn,w:Wn,W:bn,x:null,X:null,y:Fn,Y:An,Z:wn,"%":xn},C={a:F,A:T,b:A,B:L,c:w,d:Es,e:Es,f:Vs,g:ws,G:Ls,H:Is,I:Is,j:Ns,L:Gs,m:Ms,M:js,p:b,q:Ps,Q:Bs,s:Os,S:ks,u:bs,U:Fs,V:Ts,w:Ws,W:As,x:x,X:P,y:ws,Y:Ls,Z:xs,"%":Qs};function D(e,t){return function(s){var n,r,i,o=[],c=-1,a=0,u=e.length;for(s instanceof Date||(s=new Date(+s));++c<u;)37===e.charCodeAt(c)&&(o.push(e.slice(a,c)),null!=(r=fs[n=e.charAt(++c)])?n=e.charAt(++c):r="e"===n?" ":"0",(i=t[n])&&(n=i(s,r)),o.push(n),a=c+1);return o.push(e.slice(a,c)),o.join("")}}function R(e,t){return function(s){var n,r,i=as(1900,void 0,1);if(W(i,e,s+="",0)!=s.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=(n=cs(as(i.y,0,1))).getUTCDay(),n=r>4||0===r?Kt.ceil(n):Kt(n),n=Yt.offset(n,7*(i.V-1)),i.y=n.getUTCFullYear(),i.m=n.getUTCMonth(),i.d=n.getUTCDate()+(i.w+6)%7):(r=(n=os(as(i.y,0,1))).getDay(),n=r>4||0===r?Bt.ceil(n):Bt(n),n=Gt.offset(n,7*(i.V-1)),i.y=n.getFullYear(),i.m=n.getMonth(),i.d=n.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?cs(as(i.y,0,1)).getUTCDay():os(as(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,cs(i)):os(i)}}function W(e,t,s,n){for(var r,i,o=0,c=t.length,a=s.length;o<c;){if(n>=a)return-1;if(37===(r=t.charCodeAt(o++))){if(r=t.charAt(o++),!(i=C[r in fs?t.charAt(o++):r])||(n=i(e,s,n))<0)return-1}else if(r!=s.charCodeAt(n++))return-1}return n}function b(e,t,s){var n=h.exec(t.slice(s));return n?(e.p=l[n[0].toLowerCase()],s+n[0].length):-1}function F(e,t,s){var n=g.exec(t.slice(s));return n?(e.w=m[n[0].toLowerCase()],s+n[0].length):-1}function T(e,t,s){var n=d.exec(t.slice(s));return n?(e.w=p[n[0].toLowerCase()],s+n[0].length):-1}function A(e,t,s){var n=_.exec(t.slice(s));return n?(e.m=U[n[0].toLowerCase()],s+n[0].length):-1}function L(e,t,s){var n=S.exec(t.slice(s));return n?(e.m=f[n[0].toLowerCase()],s+n[0].length):-1}function w(e,s,n){return W(e,t,s,n)}function x(e,t,n){return W(e,s,t,n)}function P(e,t,s){return W(e,r,t,s)}function M(e){return c[e.getDay()]}function E(e){return o[e.getDay()]}function N(e){return u[e.getMonth()]}function I(e){return a[e.getMonth()]}function j(e){return i[+(e.getHours()>=12)]}function k(e){return 1+~~(e.getMonth()/3)}function G(e){return c[e.getUTCDay()]}function V(e){return o[e.getUTCDay()]}function Q(e){return u[e.getUTCMonth()]}function B(e){return a[e.getUTCMonth()]}function O(e){return i[+(e.getUTCHours()>=12)]}function X(e){return 1+~~(e.getUTCMonth()/3)}return y.x=D(s,y),y.X=D(r,y),y.c=D(t,y),v.x=D(s,v),v.X=D(r,v),v.c=D(t,v),n(D,"newFormat"),n(R,"newParse"),n(W,"parseSpecifier"),n(b,"parsePeriod"),n(F,"parseShortWeekday"),n(T,"parseWeekday"),n(A,"parseShortMonth"),n(L,"parseMonth"),n(w,"parseLocaleDateTime"),n(x,"parseLocaleDate"),n(P,"parseLocaleTime"),n(M,"formatShortWeekday"),n(E,"formatWeekday"),n(N,"formatShortMonth"),n(I,"formatMonth"),n(j,"formatPeriod"),n(k,"formatQuarter"),n(G,"formatUTCShortWeekday"),n(V,"formatUTCWeekday"),n(Q,"formatUTCShortMonth"),n(B,"formatUTCMonth"),n(O,"formatUTCPeriod"),n(X,"formatUTCQuarter"),{format:n(function(e){var t=D(e+="",y);return t.toString=function(){return e},t},"format"),parse:n(function(e){var t=R(e+="",!1);return t.toString=function(){return e},t},"parse"),utcFormat:n(function(e){var t=D(e+="",v);return t.toString=function(){return e},t},"utcFormat"),utcParse:n(function(e){var t=R(e+="",!0);return t.toString=function(){return e},t},"utcParse")}}is.every=function(e){return isFinite(e=Math.floor(e))&&e>0?It(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,s){t.setUTCFullYear(t.getUTCFullYear()+s*e)}):null},is.range,n(os,"localDate"),n(cs,"utcDate"),n(as,"newDate"),n(us,"formatLocale$1");var hs,ls,ds,ps,gs,ms,Ss,fs={"-":"",_:" ",0:"0"},_s=/^\s*\d+/,Us=/^%/,ys=/[\\^$*+?|[\]().{}]/g;function vs(e,t,s){var n=e<0?"-":"",r=(n?-e:e)+"",i=r.length;return n+(i<s?new Array(s-i+1).join(t)+r:r)}function Cs(e){return e.replace(ys,"\\$&")}function Ds(e){return new RegExp("^(?:"+e.map(Cs).join("|")+")","i")}function Rs(e){for(var t={},s=-1,n=e.length;++s<n;)t[e[s].toLowerCase()]=s;return t}function Ws(e,t,s){var n=_s.exec(t.slice(s,s+1));return n?(e.w=+n[0],s+n[0].length):-1}function bs(e,t,s){var n=_s.exec(t.slice(s,s+1));return n?(e.u=+n[0],s+n[0].length):-1}function Fs(e,t,s){var n=_s.exec(t.slice(s,s+2));return n?(e.U=+n[0],s+n[0].length):-1}function Ts(e,t,s){var n=_s.exec(t.slice(s,s+2));return n?(e.V=+n[0],s+n[0].length):-1}function As(e,t,s){var n=_s.exec(t.slice(s,s+2));return n?(e.W=+n[0],s+n[0].length):-1}function Ls(e,t,s){var n=_s.exec(t.slice(s,s+4));return n?(e.y=+n[0],s+n[0].length):-1}function ws(e,t,s){var n=_s.exec(t.slice(s,s+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),s+n[0].length):-1}function xs(e,t,s){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(s,s+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),s+n[0].length):-1}function Ps(e,t,s){var n=_s.exec(t.slice(s,s+1));return n?(e.q=3*n[0]-3,s+n[0].length):-1}function Ms(e,t,s){var n=_s.exec(t.slice(s,s+2));return n?(e.m=n[0]-1,s+n[0].length):-1}function Es(e,t,s){var n=_s.exec(t.slice(s,s+2));return n?(e.d=+n[0],s+n[0].length):-1}function Ns(e,t,s){var n=_s.exec(t.slice(s,s+3));return n?(e.m=0,e.d=+n[0],s+n[0].length):-1}function Is(e,t,s){var n=_s.exec(t.slice(s,s+2));return n?(e.H=+n[0],s+n[0].length):-1}function js(e,t,s){var n=_s.exec(t.slice(s,s+2));return n?(e.M=+n[0],s+n[0].length):-1}function ks(e,t,s){var n=_s.exec(t.slice(s,s+2));return n?(e.S=+n[0],s+n[0].length):-1}function Gs(e,t,s){var n=_s.exec(t.slice(s,s+3));return n?(e.L=+n[0],s+n[0].length):-1}function Vs(e,t,s){var n=_s.exec(t.slice(s,s+6));return n?(e.L=Math.floor(n[0]/1e3),s+n[0].length):-1}function Qs(e,t,s){var n=Us.exec(t.slice(s,s+1));return n?s+n[0].length:-1}function Bs(e,t,s){var n=_s.exec(t.slice(s));return n?(e.Q=+n[0],s+n[0].length):-1}function Os(e,t,s){var n=_s.exec(t.slice(s));return n?(e.s=+n[0],s+n[0].length):-1}function Xs(e,t){return vs(e.getDate(),t,2)}function Hs(e,t){return vs(e.getHours(),t,2)}function $s(e,t){return vs(e.getHours()%12||12,t,2)}function Js(e,t){return vs(1+Gt.count(qt(e),e),t,3)}function qs(e,t){return vs(e.getMilliseconds(),t,3)}function Ys(e,t){return qs(e,t)+"000"}function zs(e,t){return vs(e.getMonth()+1,t,2)}function Zs(e,t){return vs(e.getMinutes(),t,2)}function Ks(e,t){return vs(e.getSeconds(),t,2)}function en(e){var t=e.getDay();return 0===t?7:t}function tn(e,t){return vs(Qt.count(qt(e)-1,e),t,2)}function sn(e){var t=e.getDay();return t>=4||0===t?Ht(e):Ht.ceil(e)}function nn(e,t){return e=sn(e),vs(Ht.count(qt(e),e)+(4===qt(e).getDay()),t,2)}function rn(e){return e.getDay()}function on(e,t){return vs(Bt.count(qt(e)-1,e),t,2)}function cn(e,t){return vs(e.getFullYear()%100,t,2)}function an(e,t){return vs((e=sn(e)).getFullYear()%100,t,2)}function un(e,t){return vs(e.getFullYear()%1e4,t,4)}function hn(e,t){var s=e.getDay();return vs((e=s>=4||0===s?Ht(e):Ht.ceil(e)).getFullYear()%1e4,t,4)}function ln(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vs(t/60|0,"0",2)+vs(t%60,"0",2)}function dn(e,t){return vs(e.getUTCDate(),t,2)}function pn(e,t){return vs(e.getUTCHours(),t,2)}function gn(e,t){return vs(e.getUTCHours()%12||12,t,2)}function mn(e,t){return vs(1+Yt.count(is(e),e),t,3)}function Sn(e,t){return vs(e.getUTCMilliseconds(),t,3)}function fn(e,t){return Sn(e,t)+"000"}function _n(e,t){return vs(e.getUTCMonth()+1,t,2)}function Un(e,t){return vs(e.getUTCMinutes(),t,2)}function yn(e,t){return vs(e.getUTCSeconds(),t,2)}function vn(e){var t=e.getUTCDay();return 0===t?7:t}function Cn(e,t){return vs(Zt.count(is(e)-1,e),t,2)}function Dn(e){var t=e.getUTCDay();return t>=4||0===t?ss(e):ss.ceil(e)}function Rn(e,t){return e=Dn(e),vs(ss.count(is(e),e)+(4===is(e).getUTCDay()),t,2)}function Wn(e){return e.getUTCDay()}function bn(e,t){return vs(Kt.count(is(e)-1,e),t,2)}function Fn(e,t){return vs(e.getUTCFullYear()%100,t,2)}function Tn(e,t){return vs((e=Dn(e)).getUTCFullYear()%100,t,2)}function An(e,t){return vs(e.getUTCFullYear()%1e4,t,4)}function Ln(e,t){var s=e.getUTCDay();return vs((e=s>=4||0===s?ss(e):ss.ceil(e)).getUTCFullYear()%1e4,t,4)}function wn(){return"+0000"}function xn(){return"%"}function Pn(e){return+e}function Mn(e){return Math.floor(+e/1e3)}function En(e){return(hs=us(e)).format,ls=hs.parse,ds=hs.utcFormat,ps=hs.utcParse,hs}n(vs,"pad"),n(Cs,"requote"),n(Ds,"formatRe"),n(Rs,"formatLookup"),n(Ws,"parseWeekdayNumberSunday"),n(bs,"parseWeekdayNumberMonday"),n(Fs,"parseWeekNumberSunday"),n(Ts,"parseWeekNumberISO"),n(As,"parseWeekNumberMonday"),n(Ls,"parseFullYear"),n(ws,"parseYear"),n(xs,"parseZone"),n(Ps,"parseQuarter"),n(Ms,"parseMonthNumber"),n(Es,"parseDayOfMonth"),n(Ns,"parseDayOfYear"),n(Is,"parseHour24"),n(js,"parseMinutes"),n(ks,"parseSeconds"),n(Gs,"parseMilliseconds"),n(Vs,"parseMicroseconds"),n(Qs,"parseLiteralPercent"),n(Bs,"parseUnixTimestamp"),n(Os,"parseUnixTimestampSeconds"),n(Xs,"formatDayOfMonth"),n(Hs,"formatHour24"),n($s,"formatHour12"),n(Js,"formatDayOfYear"),n(qs,"formatMilliseconds"),n(Ys,"formatMicroseconds"),n(zs,"formatMonthNumber"),n(Zs,"formatMinutes"),n(Ks,"formatSeconds"),n(en,"formatWeekdayNumberMonday"),n(tn,"formatWeekNumberSunday"),n(sn,"dISO"),n(nn,"formatWeekNumberISO"),n(rn,"formatWeekdayNumberSunday"),n(on,"formatWeekNumberMonday"),n(cn,"formatYear"),n(an,"formatYearISO"),n(un,"formatFullYear"),n(hn,"formatFullYearISO"),n(ln,"formatZone"),n(dn,"formatUTCDayOfMonth"),n(pn,"formatUTCHour24"),n(gn,"formatUTCHour12"),n(mn,"formatUTCDayOfYear"),n(Sn,"formatUTCMilliseconds"),n(fn,"formatUTCMicroseconds"),n(_n,"formatUTCMonthNumber"),n(Un,"formatUTCMinutes"),n(yn,"formatUTCSeconds"),n(vn,"formatUTCWeekdayNumberMonday"),n(Cn,"formatUTCWeekNumberSunday"),n(Dn,"UTCdISO"),n(Rn,"formatUTCWeekNumberISO"),n(Wn,"formatUTCWeekdayNumberSunday"),n(bn,"formatUTCWeekNumberMonday"),n(Fn,"formatUTCYear"),n(Tn,"formatUTCYearISO"),n(An,"formatUTCFullYear"),n(Ln,"formatUTCFullYearISO"),n(wn,"formatUTCZone"),n(xn,"formatLiteralPercent"),n(Pn,"formatUnixTimestamp"),n(Mn,"formatUnixTimestampSeconds"),En({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"]}),n(En,"defaultLocale$1"),e.WsSMC=void 0,gs=e.WsSMC||(e.WsSMC={}),(ms=gs.LockModes||(gs.LockModes={})).ALL="ALL",ms.READ="READ",ms.WRITE="WRITE",ms.HOLD="HOLD",ms.SUB="SUB",(Ss=gs.RoxieControlCmdType||(gs.RoxieControlCmdType={})).Attach="Attach",Ss.Detach="Detach",Ss.State="State",Ss.Reload="Reload",Ss.ReloadRetry="ReloadRetry",Ss.MemLock="MemLock",Ss.MemUnlock="MemUnlock",Ss.GetMemLocked="GetMemLocked";const Nn=class _SMCServiceBase extends w{constructor(e){super(e,"WsSMC","1.29")}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")}RecordGlobalMetrics(e){return this._connection.send("RecordGlobalMetrics",e,"json",!1,void 0,"RecordGlobalMetricsResponse")}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")}};n(Nn,"SMCServiceBase");let In=Nn;const jn=ls("%Y%m%d%H");function kn(e){return"number"==typeof e||"string"==typeof e&&""!==e.trim()&&!isNaN(+e)}n(kn,"isNumeric");const Gn=class _SMCService extends In{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(e=>({Running:{ActiveWorkunit:[]},...e}))}parseGlobalMetric(e,t){return e.startsWith("Cost")?+t/1e6:e.startsWith("Date")?jn(t):e.startsWith("Num")?+t:e.startsWith("Time")?+t/1e9:e.startsWith("When")?new Date(+t/1e3).toISOString():kn(t)?+t:t}GetNormalisedGlobalMetrics(e){return super.GetGlobalMetrics(e).then(e=>{const t=[];for(const s of e?.GlobalMetrics?.GlobalMetric||[]){const e={Category:s.Category,Start:this.parseGlobalMetric("Date",s.DateTimeRange?.Start),End:this.parseGlobalMetric("Date",s.DateTimeRange?.End),dimensions:{},stats:{}};for(const t of s.Dimensions?.Dimension||[])e.dimensions[t.Name]=t.Value;for(const t of s.Stats?.Stat||[])e.stats[t.Name]=this.parseGlobalMetric(t.Name,t.Value);t.push(e)}return t})}};n(Gn,"SMCService");let Vn=Gn;const Qn=class _storeServiceBase extends w{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")}};n(Qn,"storeServiceBase");let Bn=Qn;const On=class _StoreService extends Bn{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})}};n(On,"StoreService");let Xn=On;var Hn,$n,Jn;e.WsTopology=void 0,Hn=e.WsTopology||(e.WsTopology={}),($n=Hn.TpConfigResponseFormat||(Hn.TpConfigResponseFormat={})).XML="XML",$n.YAML="YAML",(Jn=Hn.RoxieQueueFilter||(Hn.RoxieQueueFilter={})).All="All",Jn.QueriesOnly="QueriesOnly",Jn.WorkunitsOnly="WorkunitsOnly",(e=>{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"})(Hn.TpMachineType||(Hn.TpMachineType={}));const qn=class _TopologyServiceBase extends w{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")}};n(qn,"TopologyServiceBase");let Yn=qn;const zn=class _TopologyService extends Yn{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,s;return e.TpLogicalClusters.TpLogicalCluster.some((e,n)=>(0===n&&(s=e),"hthor"===e.Type&&(t=e,!0))),t||s})}};n(zn,"TopologyService");let Zn=zn;var Kn,er,tr,sr,nr,rr,ir,or,cr,ar,ur,hr,lr,dr;e.WsWorkunits=void 0,Kn=e.WsWorkunits||(e.WsWorkunits={}),(er=Kn.ECLWUActions||(Kn.ECLWUActions={})).Abort="Abort",er.Delete="Delete",er.Deschedule="Deschedule",er.Reschedule="Reschedule",er.Pause="Pause",er.PauseNow="PauseNow",er.Protect="Protect",er.Unprotect="Unprotect",er.Restore="Restore",er.Resume="Resume",er.SetToFailed="SetToFailed",er.Archive="Archive",(e=>{e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM"})(Kn.LogSelectColumnMode||(Kn.LogSelectColumnMode={})),(e=>{e[e.ASC=0]="ASC",e[e.DSC=1]="DSC"})(Kn.SortDirection||(Kn.SortDirection={})),(tr=Kn.LogEventClass||(Kn.LogEventClass={})).ALL="ALL",tr.DIS="DIS",tr.ERR="ERR",tr.WRN="WRN",tr.INF="INF",tr.PRO="PRO",tr.MET="MET",tr.EVT="EVT",(sr=Kn.WUDetailsAttrValueType||(Kn.WUDetailsAttrValueType={})).Single="Single",sr.List="List",sr.Multi="Multi",(nr=Kn.EclDefinitionActions||(Kn.EclDefinitionActions={})).SyntaxCheck="SyntaxCheck",nr.Deploy="Deploy",nr.Publish="Publish",(rr=Kn.ErrorMessageFormat||(Kn.ErrorMessageFormat={})).xml="xml",rr.json="json",rr.text="text",(ir=Kn.LogAccessLogFormat||(Kn.LogAccessLogFormat={}))[ir.XML=0]="XML",ir[ir.JSON=1]="JSON",ir[ir.CSV=2]="CSV",(or=Kn.WUExceptionSeverity||(Kn.WUExceptionSeverity={})).info="info",or.warning="warning",or.error="error",or.alert="alert",(cr=Kn.WUQueryFilterSuspendedType||(Kn.WUQueryFilterSuspendedType={})).Allqueries="All queries",cr.Notsuspended="Not suspended",cr.Suspended="Suspended",cr.Suspendedbyuser="Suspended by user",cr.Suspendedbyfirstnode="Suspended by first node",cr.Suspendedbyanynode="Suspended by any node",(ar=Kn.WUQuerySetFilterType||(Kn.WUQuerySetFilterType={})).All="All",ar.Id="Id",ar.Name="Name",ar.Alias="Alias",ar.Status="Status",(ur=Kn.WUProtectFilter||(Kn.WUProtectFilter={})).All="All",ur.Protected="Protected",ur.NotProtected="NotProtected",(Kn.QuerySetAliasActionTypes||(Kn.QuerySetAliasActionTypes={})).Deactivate="Deactivate",(hr=Kn.QuerysetImportActivation||(Kn.QuerysetImportActivation={})).None="None",hr.ActivateImportedActive="ActivateImportedActive",(lr=Kn.QuerySetQueryActionTypes||(Kn.QuerySetQueryActionTypes={})).Suspend="Suspend",lr.Unsuspend="Unsuspend",lr.ToggleSuspend="ToggleSuspend",lr.Activate="Activate",lr.Delete="Delete",lr.DeleteQueriesAndWUs="DeleteQueriesAndWUs",lr.RemoveAllAliases="RemoveAllAliases",lr.ResetQueryStats="ResetQueryStats",(dr=Kn.WUQueryActivationMode||(Kn.WUQueryActivationMode={}))[dr.DoNotActivateQuery=0]="DoNotActivateQuery",dr[dr.ActivateQuery=1]="ActivateQuery",dr[dr.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",dr[dr.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious";const pr=class _WorkunitsServiceBase extends w{constructor(e){super(e,"WsWorkunits","2.04")}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")}};n(pr,"WorkunitsServiceBase");let gr=pr;var mr,Sr,fr=(e=>(e[e.Unknown=0]="Unknown",e[e.Compiled=1]="Compiled",e[e.Running=2]="Running",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed",e[e.Archived=5]="Archived",e[e.Aborting=6]="Aborting",e[e.Aborted=7]="Aborted",e[e.Blocked=8]="Blocked",e[e.Submitted=9]="Submitted",e[e.Scheduled=10]="Scheduled",e[e.Compiling=11]="Compiling",e[e.Wait=12]="Wait",e[e.UploadingFiled=13]="UploadingFiled",e[e.DebugPaused=14]="DebugPaused",e[e.DebugRunning=15]="DebugRunning",e[e.Paused=16]="Paused",e[e.LAST=17]="LAST",e[e.NotFound=999]="NotFound",e))(fr||{});function _r(e){return"string"==typeof e.Name}function Ur(e){return void 0!==e.TotalClusterTime}function yr(e){return void 0!==e.StateEx}e.WUUpdate=void 0,mr=e.WUUpdate||(e.WUUpdate={}),(Sr=mr.Action||(mr.Action={}))[Sr.Unknown=0]="Unknown",Sr[Sr.Compile=1]="Compile",Sr[Sr.Check=2]="Check",Sr[Sr.Run=3]="Run",Sr[Sr.ExecuteExisting=4]="ExecuteExisting",Sr[Sr.Pause=5]="Pause",Sr[Sr.PauseNow=6]="PauseNow",Sr[Sr.Resume=7]="Resume",Sr[Sr.Debug=8]="Debug",Sr[Sr.__size=9]="__size",n(_r,"isECLResult"),n(Ur,"isWUQueryECLWorkunit"),n(yr,"isWUInfoWorkunit");const vr=class _WorkunitsService extends gr{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},s){return this._connection.send("WUQuery",e,"json",!1,s).then(e=>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 s=t.xml2json(e.Result).children();return s.length?s[0]:null})}};n(vr,"WorkunitsService");let Cr=vr;const Dr=class _WorkunitsServiceEx extends gr{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};n(Dr,"WorkunitsServiceEx");let Rr=Dr;function Wr(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function br(e,t){if((s=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var s,n=e.slice(0,s);return[n.length>1?n[0]+n.slice(2):n,+e.slice(s+1)]}function Fr(e){return(e=br(Math.abs(e)))?e[1]:NaN}function Tr(e,t){return function(s,n){for(var r=s.length,i=[],o=0,c=e[0],a=0;r>0&&c>0&&(a+c+1>n&&(c=Math.max(1,n-a)),i.push(s.substring(r-=c,r+c)),!((a+=c+1)>n));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function Ar(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}n(Wr,"formatDecimal"),n(br,"formatDecimalParts"),n(Fr,"exponent"),n(Tr,"formatGroup"),n(Ar,"formatNumerals");var Lr,wr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xr(e){if(!(t=wr.exec(e)))throw new Error("invalid format: "+e);var t;return new Pr({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 Pr(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 Mr(e){e:for(var t,s=e.length,n=1,r=-1;n<s;++n)switch(e[n]){case".":r=t=n;break;case"0":0===r&&(r=n),t=n;break;default:if(!+e[n])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}function Er(e,t){var s=br(e,t);if(!s)return e+"";var n=s[0],r=s[1],i=r-(Lr=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+br(e,Math.max(0,t+i-1))[0]}function Nr(e,t){var s=br(e,t);if(!s)return e+"";var n=s[0],r=s[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}n(xr,"formatSpecifier"),xr.prototype=Pr.prototype,n(Pr,"FormatSpecifier"),Pr.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},n(Mr,"formatTrim"),n(Er,"formatPrefixAuto"),n(Nr,"formatRounded");const Ir={"%":n(function(e,t){return(100*e).toFixed(t)},"%"),b:n(function(e){return Math.round(e).toString(2)},"b"),c:n(function(e){return e+""},"c"),d:Wr,e:n(function(e,t){return e.toExponential(t)},"e"),f:n(function(e,t){return e.toFixed(t)},"f"),g:n(function(e,t){return e.toPrecision(t)},"g"),o:n(function(e){return Math.round(e).toString(8)},"o"),p:n(function(e,t){return Nr(100*e,t)},"p"),r:Nr,s:Er,X:n(function(e){return Math.round(e).toString(16).toUpperCase()},"X"),x:n(function(e){return Math.round(e).toString(16)},"x")};function jr(e){return e}n(jr,"identity");var kr,Gr,Vr=Array.prototype.map,Qr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Br(e){var t=void 0===e.grouping||void 0===e.thousands?jr:Tr(Vr.call(e.grouping,Number),e.thousands+""),s=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=e.decimal+"",o=void 0===e.numerals?jr:Ar(Vr.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",a=e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var h=(e=xr(e)).fill,l=e.align,d=e.sign,p=e.symbol,g=e.zero,m=e.width,S=e.comma,f=e.precision,_=e.trim,U=e.type;"n"===U?(S=!0,U="g"):Ir[U]||(void 0===f&&(f=12),_=!0,U="g"),(g||"0"===h&&"="===l)&&(g=!0,h="0",l="=");var y="$"===p?s:"#"===p&&/[boxX]/.test(U)?"0"+U.toLowerCase():"",v="$"===p?r:/[%p]/.test(U)?c:"",C=Ir[U],D=/[defgprs%]/.test(U);function R(e){var s,n,r,c=y,p=v;if("c"===U)p=C(e)+p,e="";else{var R=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:C(Math.abs(e),f),_&&(e=Mr(e)),R&&0===+e&&"+"!==d&&(R=!1),c=(R?"("===d?d:a:"-"===d||"("===d?"":d)+c,p=("s"===U?Qr[8+Lr/3]:"")+p+(R&&"("===d?")":""),D)for(s=-1,n=e.length;++s<n;)if(48>(r=e.charCodeAt(s))||r>57){p=(46===r?i+e.slice(s+1):e.slice(s))+p,e=e.slice(0,s);break}}S&&!g&&(e=t(e,1/0));var W=c.length+e.length+p.length,b=W<m?new Array(m-W+1).join(h):"";switch(S&&g&&(e=t(b+e,b.length?m-p.length:1/0),b=""),l){case"<":e=c+e+p+b;break;case"=":e=c+b+e+p;break;case"^":e=b.slice(0,W=b.length>>1)+c+e+p+b.slice(W);break;default:e=b+c+e+p}return o(e)}return f=void 0===f?6:/[gprs]/.test(U)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),n(R,"format"),R.toString=function(){return e+""},R}function l(e,t){var s=h(((e=xr(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(Fr(t)/3))),r=Math.pow(10,-n),i=Qr[8+n/3];return function(e){return s(r*e)+i}}return n(h,"newFormat"),n(l,"formatPrefix"),{format:h,formatPrefix:l}}function Or(e){return kr=Br(e),Gr=kr.format,kr.formatPrefix,kr}n(Br,"formatLocale"),Or({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),n(Or,"defaultLocale");const Xr=class _ECLGraph 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,s){super(),this.wu=e;let n=0;for(const r of s)if(r.GraphName===t.Name&&!r.HasSubGraphId){n=Math.round(1e3*r.Seconds)/1e3;break}this.set({Time:n,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(e=>gi(e)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(e=>gi(e))}};n(Xr,"ECLGraph");let Hr=Xr;const $r=class _GraphCache extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Name]))}};n($r,"GraphCache");let Jr=$r;function qr(e,t,s){(s=s||[]).push(e),t(e.name,e.$,e.children(),s),e.children().forEach(e=>{qr(e,t,s)}),s.pop()}function Yr(e){const t={};return e.forEach(e=>{"att"===e.name&&(t[e.$.name]=e.$.value)}),t}n(qr,"walkXmlJson"),n(Yr,"flattenAtt");const zr=class _XGMMLGraph extends t.Graph{};n(zr,"XGMMLGraph");let Zr=zr;const Kr=class _XGMMLSubgraph extends t.Subgraph{};n(Kr,"XGMMLSubgraph");let ei=Kr;const ti=class _XGMMLVertex extends t.Vertex{};n(ti,"XGMMLVertex");let si=ti;const ni=class _XGMMLEdge extends t.Edge{};n(ni,"XGMMLEdge");let ri=ni;function ii(e,t){const s={},n={},r={},i=new Zr(e=>e._.id),o=[i.root];return qr(t,(e,t,i,c)=>{const a=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=a.createSubgraph(Yr(i));o.push(e),s[t.id]=e}const e=a.createVertex(Yr(i));n[t.id]=e;break;case"edge":const c=a.createEdge(n[t.source],n[t.target],Yr(i));r[t.id]=c}}),i}n(ii,"createXGMMLGraph");const oi=class _ScopeGraph extends t.Graph{};n(oi,"ScopeGraph");let ci=oi;const ai=class _ScopeSubgraph extends t.Subgraph{};n(ai,"ScopeSubgraph");let ui=ai;const hi=class _ScopeVertex extends t.Vertex{};n(hi,"ScopeVertex");let li=hi;const di=class _ScopeEdge extends t.Edge{};n(di,"ScopeEdge");let pi=di;function gi(e){const t={},s={},n={};let r;for(const o of e)switch(o.ScopeType){case"graph":r=new ci(e=>e._.Id,o),t[o.ScopeName]=r.root;break;case"subgraph":r||(r=new ci(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?n[o.ScopeName]=c.createVertex(o):console.warn(`Missing A:Parent (${o.Id}): ${o.parentScope()}`);break;case"edge":s[o.ScopeName]=o;break;case"function":const a=n[o.parentScope()];a?a._.children().push(o):console.warn(`Missing F:Parent (${o.Id}): ${o.parentScope()}`)}for(const o in s){const e=s[o],n=t[e.parentScope()];if(n){const t=n;try{const s=r.vertex(e.attr("IdSource").RawValue),n=r.vertex(e.attr("IdTarget").RawValue);t.createEdge(s,n,e)}catch(i){console.warn(`Invalid Edge: ${o}`)}}else console.warn(`Missing E:Parent (${e.Id}): ${e.parentScope()}`)}return r}n(gi,"createGraph");const mi=class _Resource 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 s=t.split("\\").join("/"),n=s.split("/"),r="res/"+this.wu.Wuid+"/";let i="",o="";0===s.indexOf(r)&&(i=s.substr(r.length),o=n[n.length-1]),this.set({URL:t,DisplayName:o,DisplayPath:i})}};n(mi,"Resource");let Si=mi;const fi=class _XSDNode{e;constructor(e){this.e=e}fix(){delete this.e}};n(fi,"XSDNode");let _i=fi;const Ui=class _XSDXMLNode extends _i{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",s=this.type.lastIndexOf("_"),n=s>0?s:this.type.length;let r=n-1;for(;r>=0&&-1!==t.indexOf(this.type.charAt(r));--r);r+1<n&&(e=parseInt(this.type.substring(r+1,n),10)),0===this.type.indexOf("data")&&(e*=2)}return e<this.name.length&&(e=this.name.length),e}};n(Ui,"XSDXMLNode");let yi=Ui;const vi=class _XSDSimpleType extends _i{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()}};n(vi,"XSDSimpleType");let Ci=vi;const Di=class _XSDSchema{root;simpleTypes={};fields(){return this.root.children()}};n(Di,"XSDSchema");let Ri=Di;const Wi=class _XSDParser extends t.SAXStackParser{schema=new Ri;simpleType;simpleTypes={};xsdStack=new t.Stack;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":const t=new yi(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 Ci(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 s in e.$)t.attrs[s]=e.$[s];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};n(Wi,"XSDParser");let bi=Wi;function Fi(e){const t=new bi;return t.parse(e),t.schema}n(Fi,"parseXSD");const Ti=class _XSDParser2 extends bi{_rootName;schema=new Ri;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 yi(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 Ci(e)}}endXMLNode(e){if("xsd:element"===e.name){this.xsdStack.pop().fix()}super.endXMLNode(e)}};n(Ti,"XSDParser2");let Ai=Ti;function Li(e,t){const s=new Ai(t);return s.parse(e),s.schema}n(Li,"parseXSD2");const wi=class _GlobalResultCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}};n(wi,"GlobalResultCache");let xi=wi;const Pi=new xi,Mi=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,s,n){let r;return Array.isArray(n)?(r=Pi.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s.Name},()=>new _Result(e,t,s,n)),r.set(s)):void 0===n&&("number"==typeof s?r=Pi.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new _Result(e,t,s)):"string"==typeof s&&(r=Pi.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new _Result(e,t,s)))),r}static attachLogicalFile(e,t,s){return Pi.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new _Result(e,t,s,!0))}constructor(e,t,s,n){super(),this.connection=e instanceof Cr?e:new Cr(e),"boolean"==typeof n&&!0===n?this.set({NodeGroup:t,LogicalFileName:s}):_r(s)&&Array.isArray(n)?this.set({...s,Wuid:t,ResultName:s.Name,ResultViews:n}):void 0===n?"number"==typeof s?this.set({Wuid:t,ResultSequence:s}):"string"==typeof s?this.set({Wuid:t,ResultName:s}):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=Fi(e.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,s=-1,n=!1,r={},i,o){const c=o??this._bypassCache;return this.WUResult(e,s,!n,r,i,c).then(e=>{const s=e.Result;return delete e.Result,this.set({...e}),t.exists("XmlSchema.xml",s)&&(this.xsdSchema=Fi(s.XmlSchema.xml)),t.exists("Row",s)?s.Row:this.ResultName&&t.exists(this.ResultName,s)?s[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,s=!1,n={},r,i=!1){const o={NamedValue:{itemcount:0}};for(const a in n)o.NamedValue[o.NamedValue.itemcount++]={Name:a,Value:n[a]};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=s,c.BypassCachedResult=i,this.connection.WUResult(c,r).then(e=>e)}};n(Mi,"Result");let Ei=Mi;const Ni=class _ResultCache extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};n(Ni,"ResultCache");let Ii=Ni;const ji=class _Attribute 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)}};n(ji,"Attribute");let ki=ji;const Gi=class _BaseScope 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(s=>{"ts"===s.Measure&&s.Name.indexOf("Started")>=0?t.start=s:this.ScopeName&&"ts"===s.Measure&&s.Name.indexOf("Finished")>=0?t.end=s:e.push(new ki(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new ki(this,t.start))):t.start?e.push(new ki(this,t.start)):t.end&&e.push(new ki(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 ki(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="";const s=[];t=this.Id,s.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&s.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),s.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);const n=this.formattedAttrs();for(const r in n)"Label"===r?t=n[r]:s.push(`<tr><td class="key">${r}</td><td class="value">${n[r]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">\n <h4 align="center">${t}</h4>\n <table>\n ${s.join("")}\n </table>\n </div>`}};n(Gi,"BaseScope");let Vi=Gi;const Qi=class _Scope extends Vi{wu;constructor(e,t){super(t),this.wu=e}};n(Qi,"Scope");let Bi=Qi;const Oi=class _SourceFile 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,s){super(),this.connection=e instanceof Cr?e:new Cr(e),this.set({Wuid:t,...s})}};n(Oi,"SourceFile");let Xi=Oi;const Hi=class _Timer 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,s,n){super(),this.connection=e instanceof Cr?e:new Cr(e);const r=t.espTime2Seconds(n.Value);this.set({Wuid:s,Seconds:Math.round(1e3*r)/1e3,HasSubGraphId:void 0!==n.SubGraphId,...n})}};n(Hi,"Timer");let $i=Hi;const Ji=ds("%Y-%m-%dT%H:%M:%S.%LZ"),qi=ps("%Y-%m-%dT%H:%M:%S.%LZ"),Yi=Gr(",");function zi(e){return e&&!isNaN(+e)?Yi(+e):e}n(zi,"formatNum");const Zi="DefinitionList",Ki=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,eo=["Avg","Min","Max","Delta","StdDev"],to=["SkewMin","SkewMax","NodeMin","NodeMax"],so=/[A-Z][a-z]*/g;function no(e){for(const s of to){const t=e.indexOf(s);if(0===t){return{measure:"",ext:s,label:e.slice(t+s.length)}}}const t=e.match(so);if(t?.length){const e=t.shift();let s=t.join("");for(const t of eo){const n=s.indexOf(t);if(0===n)return s=s.slice(n+t.length),{measure:e,ext:t,label:s}}return{measure:e,ext:"",label:s}}return{measure:"",ext:"",label:e}}n(no,"_splitMetric");const ro={};function io(e){let t=ro[e];return t||(t=no(e),ro[e]=t),t}function oo(e,t){return e.__formattedProps?.[t]??e[t]}function co(e){if(void 0===e)return;const t=parseFloat(e);return isNaN(t)?void 0:t}function ao(e,t,s){const n=io(t);if(!s[n.measure]){s[n.label]=!0;const t=co(e[`${n.measure}Avg${n.label}`]),r=co(e[`${n.measure}Min${n.label}`]),i=co(e[`${n.measure}Max${n.label}`]),o=co(e[`${n.measure}StdDev${n.label}`]),c=Math.max((t-r)/o,(i-t)/o);return{Key:`${n.measure}${n.label}`,Value:oo(e,`${n.measure}${n.label}`),Avg:oo(e,`${n.measure}Avg${n.label}`),Min:oo(e,`${n.measure}Min${n.label}`),Max:oo(e,`${n.measure}Max${n.label}`),Delta:oo(e,`${n.measure}Delta${n.label}`),StdDev:oo(e,`${n.measure}StdDev${n.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:oo(e,`SkewMin${n.label}`),SkewMax:oo(e,`SkewMax${n.label}`),NodeMin:oo(e,`NodeMin${n.label}`),NodeMax:oo(e,`NodeMax${n.label}`)}}return null}n(io,"splitMetric"),n(oo,"formatValue"),n(co,"safeParseFloat"),n(ao,"formatValues");const uo=t.scopedLogger("workunit.ts"),ho=class _WorkunitCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}};n(ho,"WorkunitCache");let lo=ho;const po=new lo,go=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",fr.Unknown)}get State(){return this.get("State")||fr[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 Ii;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,()=>Ei.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 $i(this.connection,this.Wuid,e))}_graphCache=new Jr;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 Hr(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 Si(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 Xi(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")}get CostSavingPotential(){return this.get("CostSavingPotential")}static create(e){const t=new _Workunit(e);return t.connection.WUCreate().then(e=>(po.set(t),t.set(e.Workunit),t))}static attach(e,t,s){const n=po.get({BaseUrl:e.baseUrl,Wuid:t},()=>new _Workunit(e,t));return s&&n.set(s),n}static existsLocal(e,t){return po.has({BaseUrl:e,Wuid:t})}static submit(t,s,n,r=!1){return _Workunit.create(t).then(e=>e.update({QueryText:n})).then(t=>r?t.submit(s,e.WUUpdate.Action.Compile):t.submit(s))}static compile(e,t,s){return _Workunit.submit(e,t,s,!0)}static query(e,t){return new Cr(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 Cr(e),this.topologyConnection=new Zn(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:fr.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(t,s=e.WUUpdate.Action.Run,n){let r;return r=void 0!==t?Promise.resolve(t):this.topologyConnection.DefaultTpLogicalClusterQuery().then(e=>e.Name),this._debugMode=!1,s===e.WUUpdate.Action.Debug&&(s=e.WUUpdate.Action.Run,this._debugMode=!0),r.then(e=>this.connection.WUUpdate({Wuid:this.Wuid,Action:s,ResultLimit:n,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(t=>(this.set(t.Workunit),this._submitAction=s,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:e})))).then(()=>this)}isComplete(){switch(this.StateID){case fr.Compiled:return"compile"===this.ActionEx||this._submitAction===e.WUUpdate.Action.Compile;case fr.Completed:case fr.Failed:case fr.Aborted:case fr.NotFound:return!0}return!1}isFailed(){switch(this.StateID){case fr.Aborted:case fr.Failed:return!0}return!1}isDeleted(){return this.StateID===fr.NotFound}isDebugging(){switch(this.StateID){case fr.DebugPaused:case fr.DebugRunning:return!0}return this._debugMode}isRunning(){switch(this.StateID){case fr.Compiled:case fr.Running:case fr.Aborting:case fr.Blocked:case fr.DebugPaused:case fr.DebugRunning:return!0}return!1}setToFailed(){return this.WUAction(e.WsWorkunits.ECLWUActions.SetToFailed)}pause(){return this.WUAction(e.WsWorkunits.ECLWUActions.Pause)}pauseNow(){return this.WUAction(e.WsWorkunits.ECLWUActions.PauseNow)}resume(){return this.WUAction(e.WsWorkunits.ECLWUActions.Resume)}abort(){return this.WUAction(e.WsWorkunits.ECLWUActions.Abort)}protect(){return this.WUAction(e.WsWorkunits.ECLWUActions.Protect)}unprotect(){return this.WUAction(e.WsWorkunits.ECLWUActions.Unprotect)}delete(){return this.WUAction(e.WsWorkunits.ECLWUActions.Delete)}restore(){return this.WUAction(e.WsWorkunits.ECLWUActions.Restore)}deschedule(){return this.WUAction(e.WsWorkunits.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(e.WsWorkunits.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!==fr.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 s={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},n=new Map;for(const o of e.Activities?.Activity??[])n.set(o.Kind,o.Name);const r=new Array(t.length);for(let o=0;o<t.length;o++){const e=t[o],c={},a={};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=n.get(e)??i}switch(s[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}a[r]=zi(t.Formatted??c[r])}const u={id:e.Id,name:e.ScopeName,type:e.ScopeType,Kind:e.Kind,Label:e.Label,__formattedProps:a,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...c},h=u[Zi];if(h)try{const e=JSON.parse(h.split("\\").join("\\\\")),t=[];for(let s=0;s<e.length;s++){const n=e[s].match(Ki);n&&t.push({filePath:(n[1]??"")+n[2]+n[3],line:parseInt(n[5],10),col:parseInt(n[6],10)})}u[Zi]=t}catch(i){uo.error(`Unexpected "DefinitionList": ${h}`)}const l={};let d=0,p="";for(const t in u)if(!t.startsWith("__")){const e=ao(u,t,l);e&&(u.__groupedProps[e.Key]=e,!isNaN(e.StdDevs)&&e.StdDevs>d&&(d=e.StdDevs,p=e.Key))}u.__StdDevs=d,u.__StdDevsSource=p,r[o]=u}return{meta:e,columns:s,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 Bi(this,e)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(e=>{const t=[],s={};e.Scopes.Scope.forEach(e=>{if(s[e.ScopeName])return s[e.ScopeName].update(e),null;{const t=new Bi(this,e);return s[t.ScopeName]=t,t}});for(const n in s)if(s.hasOwnProperty(n)){const e=s[n],r=e.parentScope();r&&s[r]?s[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=>gi(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(s=>{"TimeElapsed"===s.Name?t[e.ScopeName].elapsed=+s.RawValue:"ts"===s.Measure&&s.Name.indexOf("Started")>=0&&(t[e.ScopeName].start=s.Formatted)})});const s=[];for(const n in t){const e=t[n];if(e.start&&e.elapsed){const t=qi(e.start);t.setMilliseconds(t.getMilliseconds()+e.elapsed/1e6),e.finish=Ji(t),s.push(e)}}return s.sort((e,t)=>e.start<t.start?-1:e.start>t.start?1:0),s})}_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,s){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,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),(this.isComplete()||this.isRunning())&&(n.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",fr.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",fr.NotFound),!0)))throw uo.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),po.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",fr.NotFound),!0)))throw uo.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUResubmit(e){return this.connection.WUResubmit(t.deepMixinT({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(t.deepMixinT({ScopeFilter:{MaxDepth:9999},ScopeOptions:{IncludeMatchedScopesInResults:!0,IncludeScope:!0,IncludeId:!1,IncludeScopeType:!1},PropertyOptions:{IncludeName:!0,IncludeRawValue:!1,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},e,{WUID:this.Wuid})).then(e=>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(t){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:t||this.Jobname,AllowForeignFiles:!0,Activate:e.WsWorkunits.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){const t=new Rr({baseUrl:""}),s={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(s)}WUCDebug(e,t={}){let s="";for(const n in t)t.hasOwnProperty(n)&&(s+=` ${n}='${t[n]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${s}/>`}).then(e=>e)}debug(e,s){return this.isDebugging()?this.WUCDebug(e,s).then(s=>{const n=s.children(e);return n.length?n[0]:new t.XMLNode(e)}).catch(s=>(uo.error(s),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,s){return this.debug("breakpoint",{id:e,mode:t,action:s}).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=ii(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>Uo(t,e))}debugPrint(e,t=0,s=10){return this.debug("print",{edgeID:e,startRow:t,numRows:s}).then(e=>e.children().map(e=>{const t={};return e.children().forEach(e=>{t[e.name]=e.content}),t}))}};n(go,"Workunit");let mo=go;const So="definition";function fo(e){return void 0!==e._[So]}function _o(e){const t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[So]);if(t){const[,s,n,r]=t;return s.replace(/\/\.\//g,"/"),{id:e._.id,file:s,line:+n,column:+r}}throw new Error(`Bad definition: ${e._[So]}`)}function Uo(e,t){const s=[];for(const n of e.vertices)if(fo(n)){const e=_o(n);(e&&!t||t===e.file)&&s.push(e)}return s.sort((e,t)=>e.line-t.line)}let yo;n(fo,"hasECLDefinition"),n(_o,"getECLDefinition"),n(Uo,"breakpointLocations");const vo=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 yo||(yo=new _Activity(e)),t&&yo.set(t),yo}constructor(e){super(),this.connection=e instanceof Vn?e:new Vn(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>""===e||t.ClusterName===e).map(e=>mo.attach(this.connection.connectionOptions(),e.Wuid,e))}setBanner(e){return this.connection.SetBanner({...e}).then(e=>(this.set(e),this))}lazyRefresh=t.debounce(async()=>{const e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};n(vo,"Activity");let Co=vo;const Do=t.scopedLogger("logicalFile.ts"),Ro=class _LogicalFileCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}};n(Ro,"LogicalFileCache");let Wo=Ro;const bo=new Wo,Fo=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,s,n){const r=bo.get({BaseUrl:e.baseUrl,Cluster:t,Name:s},()=>new _LogicalFile(e,t,s));return n&&r.set(n),r}constructor(e,t,s){super(),this.connection=e instanceof we?e:new we(e),this.clear({Cluster:t,Name:s})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){const e=[];for(const t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(const s of t?.DFUFileParts?.DFUPart||[]){const n={...t,...s};delete n.DFUFileParts,e.push(n)}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 Do.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||[])}};n(Fo,"LogicalFile");let To=Fo;const Ao=class _MachineCache extends t.Cache{constructor(){super(e=>e.Address)}};n(Ao,"MachineCache");let Lo=Ao;const wo=new Lo,xo=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,s){const n=wo.get({Address:t},()=>new _Machine(e));return s&&n.set(s),n}constructor(e){super(),this.connection=e instanceof yt?e:new yt(e)}};n(xo,"Machine");let Po=xo;const Mo=class _TargetClusterCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}};n(Mo,"TargetClusterCache");let Eo=Mo;const No=new Eo,Io=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=>Po.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){const n=No.get({BaseUrl:e.baseUrl,Name:t},()=>new _TargetCluster(e,t));return s&&n.set(s),n}constructor(e,t){super(),e instanceof Zn?(this.connection=e,this.machineConnection=new yt(e.connectionOptions())):(this.connection=new Zn(e),this.machineConnection=new yt(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(e=>{const t=[];for(const s of e.TargetClusterInfoList.TargetClusterInfo)for(const e of s.Processes.MachineInfoEx)t.push(e);return this.set("MachineInfoEx",t),this.CMachineInfoEx})}machineStats(){let e=0,t=0,s=0;for(const n of this.CMachineInfoEx)for(const r of n.Storage.StorageInfo){t+=r.Available,s+=r.Total;const n=1-r.Available/r.Total;n>e&&(e=n)}return{maxDisk:e,meanDisk:1-(s?t/s:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};n(Io,"TargetCluster");let jo=Io;function ko(e){let t;return t=e instanceof Zn?e:new Zn(e),t.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(t=>jo.attach(e,t.Name,t)))}n(ko,"targetClusters");const Go={};function Vo(e){if(!Go[e.baseUrl]){let t;t=e instanceof Zn?e:new Zn(e),Go[e.baseUrl]=t.TpListTargetClusters({}).then(t=>{let s,n,r;t.TargetClusters.TpClusterNameType.forEach(e=>{s||(s=e),n||!0!==e.IsDefault||(n=e),r||"hthor"!==e.Type||(r=e)});const i=n||r||s;return jo.attach(e,i.Name,i)})}return Go[e.baseUrl]}n(Vo,"defaultTargetCluster");const Qo=class _TopologyCache extends t.Cache{constructor(){super(e=>e.BaseUrl)}};n(Qo,"TopologyCache");let Bo=Qo;const Oo=new Bo,Xo=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=>jo.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){const s=Oo.get({BaseUrl:e.baseUrl},()=>new _Topology(e));return t&&s.set(t),s}constructor(e){super(),this.connection=e instanceof Zn?e:new Zn(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(s=>{const n=this.connection.protocol(),r=this.connection.ip();let i="https:"===n?"18002":"8002";if(t.exists("ServiceList.TpEspServers.TpEspServer",s))for(const o of s.ServiceList.TpEspServers.TpEspServer)if(t.exists("TpBindings.TpBinding",o))for(const t of o.TpBindings.TpBinding)t.Service===e&&t.Protocol+":"===n&&(i=t.Port);return`${n}//${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,s){if(this.isCallback(t)){if("changed"===e)super.on(e,t)}else if("changed"===e)super.on(e,t,s);return this._monitor(),this}};n(Xo,"Topology");let Ho=Xo;function $o(e,t,s){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=s)}function Jo(e){return(e=""+e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;")}function qo(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);if(!t)return 0;return 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}function Yo(e,t){const s=e.indexOf(t);return-1!==s?parseFloat(e.substring(0,s)):-1}function zo(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);let t=Yo(e,"Kb");return t>=0?1024*t:(t=Yo(e,"Mb"),t>=0?t*Math.pow(1024,2):(t=Yo(e,"Gb"),t>=0?t*Math.pow(1024,3):(t=Yo(e,"Tb"),t>=0?t*Math.pow(1024,4):(t=Yo(e,"Pb"),t>=0?t*Math.pow(1024,5):(t=Yo(e,"Eb"),t>=0?t*Math.pow(1024,6):(t=Yo(e,"Zb"),t>=0?t*Math.pow(1024,7):(t=Yo(e,"b"),t>=0?t:0)))))))}function Zo(e){return e?parseFloat(e):0}n($o,"safeAssign"),n(Jo,"xmlEncode"),n(qo,"espTime2Seconds"),n(Yo,"unitTest"),n(zo,"espSize2Bytes"),n(Zo,"espSkew2Number");const Ko=class _LocalisedXGMMLWriter{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,s,n){this.noSpills=n,e.forEach(e=>{this.graph.isVertex(e)?(this.calcInVertexVisibility(e,s),this.calcOutVertexVisibility(e,s)):this.graph.isEdge(e)?(this.calcInVertexVisibility(e.getSource(),s-1),this.calcOutVertexVisibility(e.getTarget(),s-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,s)=>{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 s={};this.graph.edges.forEach((t,n)=>{t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===this.getCommonAncestor(t)&&(s[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]||(s[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[t.__hpcc_id]=t))})}buildVertexString(e,t){let s="",n="";const r=e.getProperties();for(const i in r)t&&i.indexOf("_kind")>=0?n+='<att name="_kind" value="point"/>':"id"===i||"label"===i?s+=" "+i+'="'+Jo(r[i])+'"':n+='<att name="'+i+'" value="'+Jo(r[i])+'"/>';return"<node"+s+">"+n+"</node>"}buildEdgeString(e){let t="",s="";const n=e.getProperties();for(const r in n)"id"===r.toLowerCase()||"label"===r.toLowerCase()||"source"===r.toLowerCase()||"target"===r.toLowerCase()?t+=" "+r+'="'+Jo(n[r])+'"':s+='<att name="'+r+'" value="'+Jo(n[r])+'"/>';return"<edge"+t+">"+s+"</edge>"}getAncestors(e,t){let s=e.__hpcc_parent;for(;s;)t.push(s),s=s.__hpcc_parent}getCommonAncestorV(e,t){const s=[],n=[];this.getAncestors(e,s),this.getAncestors(t,n);let r=s.length-1,i=n.length-1,o=null;for(;r>=0&&i>=0&&s[r]===n[i];)o=s[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 s=t.getSource();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){const e=s.getInEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),s=e[0].getSource(),this.addSemiVisibleVertex(s)}let n=t.getTarget();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){const e=n.getOutEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),n=e[0].getTarget(),this.addSemiVisibleVertex(n)}}}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 s="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';const n=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),n===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)s+='<att name="'+e+'" value="'+Jo(r[e])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+s+"</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))}};n(Ko,"LocalisedXGMMLWriter");let ec=Ko;const tc=class _GraphItem{__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}};n(tc,"GraphItem");let sc=tc;const nc=class _Subgraph extends sc{_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,s)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,s)=>{e.vertexVisited(t)})}};n(nc,"Subgraph");let rc=nc;const ic=class _Vertex extends sc{_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)}};n(ic,"Vertex");let oc=ic;const cc=class _Edge extends sc{_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]}};n(cc,"Edge");let ac=cc;const uc=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 rc}isVertex(e){return e instanceof oc}isEdge(e){return e instanceof ac}getGlobalType(e){return e instanceof oc?3:e instanceof ac?4:e instanceof rc?2:e instanceof _QueryGraph?1:0}getGlobalTypeString(e){return e instanceof oc?"Vertex":e instanceof ac?"Edge":e instanceof rc?"Cluster":e instanceof _QueryGraph?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":const e=new rc(this,t);this.subgraphs.push(e),this.idx[t]=e;break;case"node":const s=new oc(this,t);this.vertices.push(s),this.idx[t]=s;break;case"edge":const n=new ac(this,t);this.edges.push(n),this.idx[t]=n;break;default:console.warn("Graph.getItem - Unknown Node Type!")}const s=this.idx[t];return Array.from(e.attributes).forEach(e=>{$o(s,e.name,e.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof rc?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof oc?this.vertices=this.vertices.filter(t=>e!==t):e instanceof ac&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let s=null;return Array.from(e.childNodes).some(e=>{if(e.tagName===t)return s=e,!0}),s}walkDocument(e,t){const s=this.getItem(e,t);return e.childNodes.forEach(e=>{if(1===e.nodeType)switch(e.tagName){case"graph":break;case"node":let t=!1;const n=this.getChildByTagName(e,"att");if(n){const r=this.getChildByTagName(n,"graph");if(r){t=!0;const n=this.walkDocument(r,e.getAttribute("id"));s.addSubgraph(n)}}if(!t){const t=this.walkDocument(e,e.getAttribute("id"));s.addVertex(t)}break;case"att":const r=e.getAttribute("name"),i="_"+r,o=e.getAttribute("value");0===r.indexOf("Time")?($o(s,i,o),$o(s,r,""+qo(o))):0===r.indexOf("Size")?($o(s,i,o),$o(s,r,""+zo(o))):0===r.indexOf("Skew")?($o(s,i,o),$o(s,r,""+Zo(o))):$o(s,r,o);break;case"edge":const c=this.walkDocument(e,e.getAttribute("id"));if(void 0!==c.NumRowsProcessed?c._eclwatchCount=c.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==c.Count?c._eclwatchCount=c.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==c.count&&(c._eclwatchCount=c.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),c.inputProgress&&(c._eclwatchInputProgress="["+c.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),c.SkewMaxRowsProcessed&&c.SkewMinRowsProcessed&&(c._eclwatchSkew="+"+c.SkewMaxRowsProcessed+", "+c.SkewMinRowsProcessed),c._dependsOn);else if(c._childGraph);else if(c._sourceActivity||c._targetActivity){c._isSpill=!0;const e=c.getSource();e&&(e._isSpill=!0);const t=c.getTarget();t&&(t._isSpill=!0)}s.addEdge(c)}}),s}removeSubgraphs(){[...this.subgraphs].forEach(e=>{e.__hpcc_parent instanceof rc&&e.remove()})}removeSpillVertices(){[...this.vertices].forEach(e=>{e.isSpill()&&e.remove()})}getLocalisedXGMML(e,t,s,n){const r=new ec(this);return r.calcVisibility(e,t,s,n),r.writeXgmml(),"<graph>"+r.m_xgmml+"</graph>"}};n(uc,"QueryGraph");let hc=uc;const lc=t.scopedLogger("@hpcc-js/comms/ecl/query.ts"),dc=Gr("~s");function pc(e){return!isNaN(parseFloat(e))&&!isNaN(e-0)}n(pc,"isNumber");const gc=class _QueryCache extends t.Cache{constructor(){super(e=>t.Cache.hash([e.QueryId,e.QuerySet]))}};n(gc,"QueryCache");const mc=new gc,Sc=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,s,n){super(),this.wsWorkunitsService=e instanceof Cr?e:new Cr(e),this.topology=Ho.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...n})}static attach(e,t,s,n){const r=mc.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:s},()=>new _Query(e,t,s));return n&&r.set(n),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){const t=`${e.Protocol}://${globalThis.location.hostname}:${e.Port}`;return new Ge({baseUrl:t})}})),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){lc.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){lc.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 hc;let s=!0;for(const n of e?.Graphs?.ECLGraphEx||[])s?(t.load(n.Graph),s=!1):t.merge(n.Graph);return t})}fetchDetailsNormalized(e={}){const t=mo.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(e=>{const s=e[0],n=e[1],r=e[2].map(e=>{const t=e.Id[0];if("a"===t||"e"===t){const t=s.idx[e.Id.substring(1)];if(!t)return lc.debug(`Missing graph data for metric ID: ${e.Id}`),e;const n=new Set(e.Properties.Property.map(e=>e.Name)),r=[];for(const e in t){const s=e.charAt(0);if("_"!==s&&s===s.toUpperCase()&&!n.has(e)){const s=t[e],n=typeof s;if("string"===n||"number"===n||"boolean"===n){let t=pc(s)?parseFloat(s):s,n=s;e.indexOf("Time")>=0&&(t/=1e9,n=dc(t)+"s"),r.push({Name:e,RawValue:t,Formatted:n})}}}r.length>0&&e.Properties.Property.push(...r)}return e});return t.normalizeDetails(n,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(s){return lc.debug(s.message??s),[]}}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]:[]}};n(Sc,"Query");let fc=Sc;const _c=class _StoreCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}};n(_c,"StoreCache");let Uc=_c;const yc=new Uc,vc=class _ValueChangedMessage extends t.Message{constructor(e,t,s){super(),this.key=e,this.value=t,this.oldValue=s}get canConflate(){return!0}conflate(e){return this.key===e.key&&(this.value=e.value,!0)}void(){return this.value===this.oldValue}};n(vc,"ValueChangedMessage");let Cc=vc;const Dc=class _Store{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new t.Dispatch;static attach(e,t="HPCCApps",s,n=!0){return yc.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:n,Namespace:s},()=>new _Store(e,t,s,n))}constructor(e,t,s,n){this.connection=e instanceof Xn?e:new Xn(e),this.Name=t,this.UserSpecific=n,this.Namespace=s}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,s=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(n=>{const r=this._knownValues[e];this._knownValues[e]=t,s&&this._dispatch.post(new Cc(e,t,r))}).catch(s=>{console.error(`Store.set("${e}", "${t}") failed:`,s)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{const n=this._knownValues[e];return this._knownValues[e]=s.Value,t&&this._dispatch.post(new Cc(e,s.Value,n)),s.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 s={},n=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(t=>{const r=this._knownValues[t.Key];this._knownValues[t.Key]=t.Value,delete n[t.Key],s[t.Key]=t.Value,e&&this._dispatch.post(new Cc(t.Key,t.Value,r))}),e)for(const e in n)this._dispatch.post(new Cc(e,void 0,n[e]));return s}).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(s=>{const n=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new Cc(e,void 0,n))}).catch(t=>{console.error(`Store.delete(${e}) failed:`,t)})}monitor(e){return this._dispatch.attach(e)}};n(Dc,"Store");let Rc=Dc;const Wc=t.scopedLogger("@hpcc-js/comms/dfuWorkunit.ts"),bc=class _DFUWorkunitCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}};n(bc,"DFUWorkunitCache");let Fc=bc;const Tc=new Fc,Ac=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",0)}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 s=new _DFUWorkunit(e);return s.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(e=>(Tc.set(s),s.set(e.result),s))}static attach(e,t,s){const n=Tc.get({BaseUrl:e.baseUrl,ID:t},()=>new _DFUWorkunit(e,t));return s&&n.set(s),n}static sprayFixed(e,t){const s=new j(e);return s.SprayFixedEx({...t}).then(t=>{const n=t.wuid;return s.GetDFUWorkunit({wuid:n}).then(t=>_DFUWorkunit.attach(e,n,t.result))})}static sprayVariable(e,t){const s=new j(e);return s.SprayVariableEx({...t}).then(t=>{const n=t.wuid;return s.GetDFUWorkunit({wuid:n}).then(t=>_DFUWorkunit.attach(e,n,t.result))})}static despray(e,t){const s=new j(e);return s.DesprayEx({...t}).then(t=>{const n=t.wuid;return s.GetDFUWorkunit({wuid:n}).then(t=>_DFUWorkunit.attach(e,n,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 6:case 5:case 4:case 999:return!0}return!1}isFailed(){return!(!this.isComplete()||6===this.State)}isDeleted(){return 999===this.State}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(e.FileSpray.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(t){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:t}).then(s=>t===e.FileSpray.DFUWUActions.Delete?s:this.refresh().then(()=>(this._monitor(),s)))}on(e,t,s){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,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),(this.isComplete()||this.isRunning())&&(n.release(),t(this))})})}constructor(e,t){super(),this.connection=new j(e),this.topologyConnection=new Zn(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:0})}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",999),!0)))throw Wc.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}};n(Ac,"DFUWorkunit");let Lc=Ac;e.AccessService=J,e.AccountService=Z,e.Activity=Co,e.Attribute=ki,e.BUILD_VERSION="3.19.3",e.BaseScope=Vi,e.CloudService=oe,e.CodesignService=le,e.Connection=v,e.DFUArrayActions=be,e.DFUChangeProtection=Te,e.DFUChangeRestriction=Ae,e.DFUDefFileFormat=Fe,e.DFUService=we,e.DFUWorkunit=Lc,e.DFUWorkunitCache=Fc,e.DFUXRefService=Ee,e.DaliService=me,e.ECLGraph=Hr,e.ESPConnection=A,e.ESPExceptions=W,e.EclService=Ge,e.ElkService=Oe,e.FileSprayService=j,e.FileSprayStates=N,e.GlobalResultCache=xi,e.GraphCache=Jr,e.LogType=nt,e.LogaccessService=ot,e.LogicalFile=To,e.LogicalFileCache=Wo,e.Machine=Po,e.MachineCache=Lo,e.MachineService=yt,e.PKG_NAME="@hpcc-js/comms",e.PKG_VERSION="3.14.4",e.PackageProcessService=Rt,e.PropertyType=eo,e.Query=fc,e.QueryGraph=hc,e.RelatedProperty=to,e.Resource=Si,e.ResourcesService=Tt,e.Result=Ei,e.ResultCache=Ii,e.SMCService=Vn,e.SashaService=Mt,e.Scope=Bi,e.ScopeEdge=pi,e.ScopeGraph=ci,e.ScopeSubgraph=ui,e.ScopeVertex=li,e.Service=w,e.SourceFile=Xi,e.Store=Rc,e.StoreCache=Uc,e.StoreService=Xn,e.TargetAudience=rt,e.TargetCluster=jo,e.TargetClusterCache=Eo,e.Timer=$i,e.Topology=Ho,e.TopologyCache=Bo,e.TopologyService=Zn,e.ValueChangedMessage=Cc,e.WUStateID=fr,e.Workunit=mo,e.WorkunitCache=lo,e.WorkunitsService=Cr,e.WorkunitsServiceEx=Rr,e.XGMMLEdge=ri,e.XGMMLGraph=Zr,e.XGMMLSubgraph=ei,e.XGMMLVertex=si,e.XSDNode=_i,e.XSDSchema=Ri,e.XSDSimpleType=Ci,e.XSDXMLNode=yi,e.createGraph=gi,e.createXGMMLGraph=ii,e.defaultTargetCluster=Vo,e.deserializeResponse=h,e.get=S,e.hookSend=U,e.instanceOfIConnection=c,e.instanceOfIOptions=i,e.isArray=D,e.isECLResult=_r,e.isExceptions=b,e.isWUInfoWorkunit=yr,e.isWUQueryECLWorkunit=Ur,e.jsonp=l,e.parseXSD=Fi,e.parseXSD2=Li,e.post=m,e.send=f,e.serializeRequest=u,e.setTransportFactory=C,e.splitMetric=io,e.targetClusters=ko,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/util"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/comms"]={},e["@hpcc-js/util"])}(this,function(e,t){"use strict";var s=Object.defineProperty,n=(e,t)=>s(e,"name",{value:t,configurable:!0});const r=t.scopedLogger("comms/connection.ts");function i(e){return"baseUrl"in e}n(i,"instanceOfIOptions");const o={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function c(e){return"function"==typeof e.opts&&"function"==typeof e.send&&"function"==typeof e.clone}function a(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function u(e,t=!0,s=""){if(s&&(s+="."),"object"!=typeof e)return a(e,t);const n=[];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,n.push(u(e,t,s+a(`${r}.${o}`,t)))):n.push(s+a(`${r}_i${o}`,t)+"="+u(e,t))}),i&&n.push(s+a(`${r}.itemcount`,t)+"="+e[r].length)}else"object"==typeof e[r]?e[r]&&e[r].Item instanceof Array?(n.push(u(e[r].Item,t,s+a(r,t))),n.push(s+a(`${r}.itemcount`,t)+"="+e[r].Item.length)):n.push(u(e[r],t,s+a(r,t))):void 0!==e[r]?n.push(s+a(r,t)+"="+a(e[r],t)):n.push(s+a(r,t));return n.join("&")}function h(e){return JSON.parse(e)}function l(e,s,i={},o="json",c){return c&&console.warn("Header attributes ignored for JSONP connections"),new Promise((c,a)=>{let l=1e3*e.timeoutSecs;const d="jsonp_callback_"+Math.round(999999*Math.random());window[d]=function(e){l=0,S(),c("json"===o&&"string"==typeof e?h(e):e)};const p=document.createElement("script");let g=t.join(e.baseUrl,s);g+=g.indexOf("?")>=0?"&":"?",p.src=g+"jsonp="+d+"&"+u(i,e.encodeRequest),document.body.appendChild(p);const m=setInterval(function(){l<=0?clearInterval(m):(l-=5e3,l<=0?(clearInterval(m),r.error("Request timeout: "+p.src),S(),a(Error("Request timeout: "+p.src))):r.debug("Request pending ("+l/1e3+" sec): "+p.src))},5e3);function S(){delete window[d],document.body.removeChild(p)}n(S,"doCallback")})}function d(e){return e.userID?{Authorization:`Basic ${t.utf8ToBase64(`${e.userID}:${e.password}`)}`}:{}}n(c,"instanceOfIConnection"),n(a,"encode"),n(u,"serializeRequest"),n(h,"deserializeResponse"),n(l,"jsonp"),n(d,"authHeader");const p={};function g(e,s,r,i,o){function c(e){if(e.ok)return"json"===o?e.json():e.text();throw new Error(e.statusText)}i={...d(e),...i},r={credentials:p[e.baseUrl]?"omit":"include",...r,headers:i},0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&t.root.__hpcc_rejectUnauthorizedAgent?r.dispatcher=t.root.__hpcc_rejectUnauthorizedAgent:t.root.__hpcc_trustwaveAgent&&(r.agent=t.root.__hpcc_trustwaveAgent)),n(c,"handleResponse");const a=t.root.__hpcc_undiciFetch??fetch;return t.promiseTimeout(1e3*e.timeoutSecs,a(t.join(e.baseUrl,s),r).then(c).catch(n=>(r.credentials=p[e.baseUrl]?"include":"omit",a(t.join(e.baseUrl,s),r).then(c).then(t=>(p[e.baseUrl]=!p[e.baseUrl],t)))))}function m(e,t,s,n="json",r){let i;return s.upload_&&(delete s.upload_,t+="?upload_"),s.abortSignal_&&(i=s.abortSignal_,delete s.abortSignal_),g(e,t,{method:"post",body:u(s,e.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},n)}function S(e,t,s,n="json",r){let i;return s.abortSignal_&&(i=s.abortSignal_,delete s.abortSignal_),g(e,`${t}?${u(s,e.encodeRequest)}`,{method:"get",signal:i},{...r},n)}function f(e,t,s,n="json",r){let i;switch(e.type){case"jsonp":i=l(e,t,s,n,r);break;case"get":i=S(e,t,s,n,r);break;default:i=m(e,t,s,n,r)}return i}n(g,"doFetch"),n(m,"post"),n(S,"get"),n(f,"send");let _=f;function U(e){const t=_;return e&&(_=e),t}n(U,"hookSend");const y=class _Connection{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return 0===arguments.length?this._opts:(this._opts={...o,...e},this)}send(e,t,s="json",n){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,_,n):_(this._opts,e,t,s,n)}clone(){return new _Connection(this.opts())}};n(y,"Connection");let v=y;function C(t){const s=e.createConnection;return e.createConnection=t,s}function D(e){return"[object Array]"===Object.prototype.toString.call(e)}e.createConnection=function(e){return new v(e)},n(C,"setTransportFactory"),n(D,"isArray");const R=class _ESPExceptions extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,s){super("ESPException: "+s.Source),this.action=e,this.request=t,this.Source=s.Source,this.Exception=s.Exception,s.Exception.length?this.message=`${s.Exception[0].Code}: ${s.Exception[0].Message}`:this.message=""}};n(R,"ESPExceptions");let W=R;function b(e){return e instanceof W||e.isESPExceptions&&Array.isArray(e.Exception)}function F(e){return void 0!==e.send}n(b,"isExceptions"),n(F,"isConnection");const T=class _ESPConnection{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(t,s,n){this._connection=F(t)?t:e.createConnection(t),this._service=s,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(D(e[t])){for(let s=0;s<e[t].length;++s)e[t+"_i"+s]=e[t][s];delete e[t]}return e}opts(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)}send(e,s={},n="json",r=!1,i,o){const c={...s,ver_:this._version};let a;r&&(c.upload_=!0),i&&(c.abortSignal_=i);let u="json";switch(n){case"text":a=t.join(this._service,e),u="text";break;case"xsd":a=t.join(this._service,e+".xsd"),u="text";break;case"json2":a=t.join(this._service,e+"/json"),n="json";const s=e.split("/");e=s.pop();break;default:a=t.join(this._service,e+".json")}return this._connection.send(a,c,u).then(t=>{if("json"===n){let s;if(t&&t.Exceptions)throw new W(e,c,t.Exceptions);if(t&&(s=t[o||e+"Response"]),!s)throw new W(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return s}return t})}clone(){return new _ESPConnection(this._connection.clone(),this._service,this._version)}};n(T,"ESPConnection");let A=T;const L=class _Service{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,s){this._connection=new A(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};n(L,"Service");let w=L;var x,P;e.FileSpray=void 0,x=e.FileSpray||(e.FileSpray={}),(P=x.DFUWUActions||(x.DFUWUActions={})).Delete="Delete",P.Protect="Protect",P.Unprotect="Unprotect",P.Restore="Restore",P.SetToFailed="SetToFailed",P.Archive="Archive";const M=class _FileSprayServiceBase extends w{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")}};n(M,"FileSprayServiceBase");let E=M;var N=(e=>(e[e.unknown=0]="unknown",e[e.scheduled=1]="scheduled",e[e.queued=2]="queued",e[e.started=3]="started",e[e.aborted=4]="aborted",e[e.failed=5]="failed",e[e.finished=6]="finished",e[e.monitoring=7]="monitoring",e[e.aborting=8]="aborting",e[e.notfound=999]="notfound",e))(N||{}),I=(e=>(e.Copy="copy",e.Remove="remove",e.Move="move",e.Rename="rename",e.Replicate="replicate",e.Import="import",e.Export="export",e.Monitor="monitor",e.Copymerge="copymerge",e.Supercopy="supercopy",e.Publish="publish",e))(I||{});const j=class _FileSprayService extends E{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")}};n(j,"FileSprayService");let k=j;var G,V,Q,B,O,X;e.WsAccess=void 0,G=e.WsAccess||(e.WsAccess={}),(V=G.ViewMemberType||(G.ViewMemberType={})).User="User",V.Group="Group",(Q=G.UserSortBy||(G.UserSortBy={})).username="username",Q.fullname="fullname",Q.passwordexpiration="passwordexpiration",Q.employeeID="employeeID",Q.employeeNumber="employeeNumber",(B=G.GroupSortBy||(G.GroupSortBy={})).Name="Name",B.ManagedBy="ManagedBy",(O=G.AccountTypeReq||(G.AccountTypeReq={})).Any="Any",O.User="User",O.Group="Group",(X=G.ResourcePermissionSortBy||(G.ResourcePermissionSortBy={})).Name="Name",X.Type="Type",(G.ResourceSortBy||(G.ResourceSortBy={})).Name="Name";const H=class _AccessServiceBase extends w{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")}};n(H,"AccessServiceBase");let $=H;const J=class _AccessService extends ${};n(J,"AccessService");let q=J;const Y=class _AccountServiceBase extends w{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")}};n(Y,"AccountServiceBase");let z=Y;const Z=class _AccountService extends z{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})}};n(Z,"AccountService");let K=Z;const ee=class _CloudServiceBase extends w{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")}};n(ee,"CloudServiceBase");let te=ee;const se=t.scopedLogger("@hpcc-js/comms/services/wsCloud.ts");function ne(e){return void 0!==e?.Pods}function re(e){return e.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(t=>{e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e),[])??[]}function ie(e){return e.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:re(e)}}})}n(ne,"isGetPODsResponse_v1_02"),n(re,"mapPorts"),n(ie,"mapPods");const oe=class _CloudService extends te{getPODs(){return super.GetPODs({}).then(e=>{if(ne(e))return e.Pods?.Pod??[];try{const t="string"==typeof e.Result?JSON.parse(e.Result):e.Result;return ie(t?.items??[])}catch(t){return se.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};n(oe,"CloudService");let ce=oe;var ae;e.WsCodesign=void 0,((ae=e.WsCodesign||(e.WsCodesign={})).SigningMethodType||(ae.SigningMethodType={})).gpg="gpg";const ue=class _CodesignServiceBase extends w{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")}};n(ue,"CodesignServiceBase");let he=ue;const le=class _CodesignService extends he{ListUserIDsEx(e){return super.ListUserIDs(e).then(e=>e.UserIDs.Item).catch(e=>[])}Sign(t){return super.Sign({SigningMethod:e.WsCodesign.SigningMethodType.gpg,...t})}};n(le,"CodesignService");let de=le;const pe=class _DaliServiceBase extends w{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")}};n(pe,"DaliServiceBase");let ge=pe;const me=class _DaliService extends ge{};n(me,"DaliService");let Se=me;var fe,_e,Ue,ye,ve,Ce,De,Re;e.WsDfu=void 0,fe=e.WsDfu||(e.WsDfu={}),(_e=fe.DFUArrayActions||(fe.DFUArrayActions={})).Delete="Delete",_e.AddToSuperfile="Add To Superfile",_e.ChangeProtection="Change Protection",_e.ChangeRestriction="Change Restriction",(Ue=fe.DFUChangeProtection||(fe.DFUChangeProtection={}))[Ue.NoChange=0]="NoChange",Ue[Ue.Protect=1]="Protect",Ue[Ue.Unprotect=2]="Unprotect",Ue[Ue.UnprotectAll=3]="UnprotectAll",(ye=fe.DFUChangeRestriction||(fe.DFUChangeRestriction={}))[ye.NoChange=0]="NoChange",ye[ye.Restrict=1]="Restrict",ye[ye.Unrestricted=2]="Unrestricted",(ve=fe.DFUDefFileFormat||(fe.DFUDefFileFormat={})).xml="xml",ve.def="def",(Ce=fe.FileAccessRole||(fe.FileAccessRole={})).Token="Token",Ce.Engine="Engine",Ce.External="External",(De=fe.SecAccessType||(fe.SecAccessType={})).None="None",De.Access="Access",De.Read="Read",De.Write="Write",De.Full="Full",(Re=fe.DFUFileType||(fe.DFUFileType={})).Flat="Flat",Re.Index="Index",Re.Xml="Xml",Re.Csv="Csv",Re.Json="Json",Re.IndexLocal="IndexLocal",Re.IndexPartitioned="IndexPartitioned",Re.Unset="Unset";const We=class _DfuServiceBase extends w{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")}};n(We,"DfuServiceBase");let be=We;const Fe=e.WsDfu.DFUArrayActions,Te=e.WsDfu.DFUDefFileFormat,Ae=e.WsDfu.DFUChangeProtection,Le=e.WsDfu.DFUChangeRestriction,we=class _DFUService extends be{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){const t=[],s=[];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 s of e?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(s);for(const t of e?.FileDetail?.subfiles?.Item??[])s.push(t)}))),s.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}};n(we,"DFUService");let xe=we;const Pe=class _DFUXRefServiceBase extends w{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")}};n(Pe,"DFUXRefServiceBase");let Me=Pe;const Ee=class _DFUXRefService extends Me{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")}};n(Ee,"DFUXRefService");let Ne=Ee;function Ie(e,t){const s=typeof t;switch(s){case"boolean":case"number":case"string":return{id:e,type:s};case"object":if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:"dataset",children:je(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){const s=typeof t.Item[0];if("string"===s||"number"===s)return{id:e,type:"set",fieldType:s};throw new Error("Unknown field type")}return{id:e,type:"object",fields:ke(t)}}default:throw new Error("Unknown field type")}}function je(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);const t=[];for(const s in e)t.push(Ie(s,e[s]));return t}function ke(e){const t={};for(const s in e)t[s]=Ie(s,e[s]);return t}n(Ie,"jsonToIField"),n(je,"jsonToIFieldArr"),n(ke,"jsonToIFieldObj");const Ge=class _EclService extends w{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 s in t)return t[s];return{}}).then(je)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(e=>{const t=JSON.parse(e);for(const s in t)return t[s].Results;return{}}).then(e=>{const t={};for(const s in e)t[s]=je(e[s]);return t})}submit(e,t,s){const n=`submit/query/${e}/${t}`;return this._connection.send(n,s,"json2").then(e=>{if(e.Results&&e.Results.Exception)throw new W(n,s,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})}};n(Ge,"EclService");let Ve=Ge;const Qe=class _ElkServiceBase extends w{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")}};n(Qe,"ElkServiceBase");let Be=Qe;const Oe=class _ElkService extends Be{};n(Oe,"ElkService");let Xe=Oe;var He,$e,Je,qe,Ye,ze,Ze,Ke,et;e.WsLogaccess=void 0,He=e.WsLogaccess||(e.WsLogaccess={}),($e=He.LogColumnType||(He.LogColumnType={})).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",(Je=He.LogColumnValueType||(He.LogColumnValueType={})).string="string",Je.numeric="numeric",Je.datetime="datetime",Je.enum="enum",Je.epoch="epoch",(qe=He.LogAccessType||(He.LogAccessType={}))[qe.All=0]="All",qe[qe.ByJobID=1]="ByJobID",qe[qe.ByComponent=2]="ByComponent",qe[qe.ByLogType=3]="ByLogType",qe[qe.ByTargetAudience=4]="ByTargetAudience",qe[qe.BySourceInstance=5]="BySourceInstance",qe[qe.BySourceNode=6]="BySourceNode",qe[qe.ByFieldName=7]="ByFieldName",qe[qe.ByPod=8]="ByPod",qe[qe.ByTraceID=9]="ByTraceID",qe[qe.BySpanID=10]="BySpanID",(Ye=He.LogAccessStatusCode||(He.LogAccessStatusCode={}))[Ye.Success=0]="Success",Ye[Ye.Warning=1]="Warning",Ye[Ye.Fail=2]="Fail",(ze=He.LogAccessFilterOperator||(He.LogAccessFilterOperator={}))[ze.NONE=0]="NONE",ze[ze.AND=1]="AND",ze[ze.OR=2]="OR",(Ze=He.LogSelectColumnMode||(He.LogSelectColumnMode={}))[Ze.MIN=0]="MIN",Ze[Ze.DEFAULT=1]="DEFAULT",Ze[Ze.ALL=2]="ALL",Ze[Ze.CUSTOM=3]="CUSTOM",(Ke=He.SortColumType||(He.SortColumType={}))[Ke.ByDate=0]="ByDate",Ke[Ke.ByJobID=1]="ByJobID",Ke[Ke.ByComponent=2]="ByComponent",Ke[Ke.ByLogType=3]="ByLogType",Ke[Ke.ByTargetAudience=4]="ByTargetAudience",Ke[Ke.BySourceInstance=5]="BySourceInstance",Ke[Ke.BySourceNode=6]="BySourceNode",Ke[Ke.ByFieldName=7]="ByFieldName",Ke[Ke.ByPod=8]="ByPod",Ke[Ke.ByTraceID=9]="ByTraceID",Ke[Ke.BySpanID=10]="BySpanID",(et=He.SortDirection||(He.SortDirection={}))[et.ASC=0]="ASC",et[et.DSC=1]="DSC";const tt=class _LogaccessServiceBase extends w{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")}};n(tt,"LogaccessServiceBase");let st=tt;const nt=t.scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts");var rt=(e=>(e.Disaster="DIS",e.Error="ERR",e.Warning="WRN",e.Information="INF",e.Progress="PRO",e.Metric="MET",e))(rt||{}),it=(e=>(e.Operator="OPR",e.User="USR",e.Programmer="PRO",e.Audit="ADT",e))(it||{});const ot=class _LogaccessService extends st{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(t){const s=await this.GetLogAccessInfo(),r={};s.Columns.Column.forEach(e=>r[e.LogType]=e.Name);const i=n(e=>{const t={};for(const s in r)t[s]=e?.fields?Object.assign({},...e.fields)[r[s]]??"":"";return t},"convertLogLine"),o={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:e.WsLogaccess.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:t.LogLineStartFrom??0,LogLineLimit:t.LogLineLimit??100,SelectColumnMode:e.WsLogaccess.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:e.WsLogaccess.SortColumType.ByDate,ColumnName:"",Direction:0}]}},c=[],a=Object.values(e.WsLogaccess.LogColumnType);for(const n in t){if(null==t[n]||""===t[n]||Array.isArray(t[n])&&0===t[n].length)continue;let s,i;if(n in r&&(s=a.includes(n)?n:r[n]),s){switch(s){case e.WsLogaccess.LogColumnType.workunits:case"hpcc.log.jobid":i=e.WsLogaccess.LogAccessType.ByJobID;break;case e.WsLogaccess.LogColumnType.audience:case"hpcc.log.audience":i=e.WsLogaccess.LogAccessType.ByTargetAudience;break;case e.WsLogaccess.LogColumnType.class:case"hpcc.log.class":i=e.WsLogaccess.LogAccessType.ByLogType;break;case e.WsLogaccess.LogColumnType.components:case"kubernetes.container.name":i=e.WsLogaccess.LogAccessType.ByComponent;break;default:i=e.WsLogaccess.LogAccessType.ByFieldName,s=r[n]}if(Array.isArray(t[n]))t[n].forEach(t=>{i===e.WsLogaccess.LogAccessType.ByComponent&&(t+="*"),c.push({LogCategory:i,SearchField:s,SearchByValue:t})});else{let r=t[n];i===e.WsLogaccess.LogAccessType.ByComponent&&(r+="*"),c.push({LogCategory:i,SearchField:s,SearchByValue:r})}}}if(c.length>2){let t=o.Filter.leftBinaryFilter.BinaryLogFilter[0];c.forEach((s,n)=>{let r=e.WsLogaccess.LogAccessFilterOperator.AND;n>0?(c[n-1].SearchField===s.SearchField&&(r=e.WsLogaccess.LogAccessFilterOperator.OR),n===c.length-1?(t.Operator=r,t.rightFilter=s):(t.Operator=r,t.rightBinaryFilter={BinaryLogFilter:[{leftFilter:s}]},t=t.rightBinaryFilter.BinaryLogFilter[0])):t.leftFilter=s})}else delete o.Filter.leftBinaryFilter,o.Filter.leftFilter={LogCategory:e.WsLogaccess.LogAccessType.All},c[0]?.SearchField&&(o.Filter.leftFilter={LogCategory:c[0]?.LogCategory,SearchField:c[0]?.SearchField,SearchByValue:c[0]?.SearchByValue}),c[1]?.SearchField&&(o.Filter.Operator=e.WsLogaccess.LogAccessFilterOperator.AND,c[0].SearchField===c[1].SearchField&&(o.Filter.Operator=e.WsLogaccess.LogAccessFilterOperator.OR),o.Filter.rightFilter={LogCategory:c[1]?.LogCategory,SearchField:c[1]?.SearchField,SearchByValue:c[1]?.SearchByValue});return t.StartDate&&(o.Range.StartDate=t.StartDate.toISOString()),t.EndDate&&(o.Range.EndDate=t.EndDate.toISOString()),this.GetLogs(o).then(e=>{try{const t=JSON.parse(e.LogLines);let n=[];switch(s.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":n=t.lines?.map(i)??[];break;default:nt.warning(`Unknown RemoteLogManagerType: ${s.RemoteLogManagerType}`),n=[]}return{lines:n,total:e.TotalLogLinesAvailable??1e4}}catch(t){nt.error(t.message??t)}return{lines:[],total:0}})}};n(ot,"LogaccessService");let ct=ot;function at(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ut(e){return 1===e.length&&(e=ht(e)),{left:n(function(t,s,n,r){for(null==n&&(n=0),null==r&&(r=t.length);n<r;){var i=n+r>>>1;e(t[i],s)<0?n=i+1:r=i}return n},"left"),right:n(function(t,s,n,r){for(null==n&&(n=0),null==r&&(r=t.length);n<r;){var i=n+r>>>1;e(t[i],s)>0?r=i:n=i+1}return n},"right")}}function ht(e){return function(t,s){return at(e(t),s)}}function lt(e){return null===e?NaN:+e}function dt(e,t){var s,n,r=e.length,i=-1;if(null==t){for(;++i<r;)if(null!=(s=e[i])&&s>=s)for(n=s;++i<r;)null!=(s=e[i])&&s>n&&(n=s)}else for(;++i<r;)if(null!=(s=t(e[i],i,e))&&s>=s)for(n=s;++i<r;)null!=(s=t(e[i],i,e))&&s>n&&(n=s);return n}function pt(e,t){var s,n=e.length,r=n,i=-1,o=0;if(null==t)for(;++i<n;)isNaN(s=lt(e[i]))?--r:o+=s;else for(;++i<n;)isNaN(s=lt(t(e[i],i,e)))?--r:o+=s;if(r)return o/r}var gt,mt,St,ft;n(at,"ascending"),n(ut,"bisector"),n(ht,"ascendingComparator"),ut(at),n(lt,"number"),n(dt,"d3Max"),n(pt,"d3Mean"),mt=gt||(gt={}),(St=mt.ThresholdType||(mt.ThresholdType={}))[St.THRESHOLD_PERCENTAGE=0]="THRESHOLD_PERCENTAGE",St[St.THRESHOLD_MB=1]="THRESHOLD_MB",(ft=mt.TpMachineType||(mt.TpMachineType={})).ALLNODES="ALLNODES",ft.THORMACHINES="THORMACHINES",ft.HOLEMACHINES="HOLEMACHINES",ft.ROXIEMACHINES="ROXIEMACHINES",ft.MACHINES="MACHINES",ft.AVAILABLEMACHINES="AVAILABLEMACHINES",ft.DROPZONE="DROPZONE",ft.STANDBYNNODE="STANDBYNNODE",ft.THORSPARENODES="THORSPARENODES",ft.HOLESTANDBYNODES="HOLESTANDBYNODES";const _t=class _MachineServiceBase extends w{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")}};n(_t,"MachineServiceBase");let Ut=_t;const yt=class _MachineService extends Ut{GetTargetClusterUsageEx(e,s=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:s}).then(e=>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:pt(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed),max:dt(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:pt(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:dt(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:pt(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:dt(t.filter(e=>!isNaN(e.max)),e=>e.max)}}))}};n(yt,"MachineService");let vt=yt;const Ct=class _PackageProcessServiceBase extends w{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")}};n(Ct,"PackageProcessServiceBase");let Dt=Ct;const Rt=class _PackageProcessService extends Dt{};n(Rt,"PackageProcessService");let Wt=Rt;const bt=class _ResourcesServiceBase extends w{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)}};n(bt,"ResourcesServiceBase");let Ft=bt;const Tt=class _ResourcesService extends Ft{};n(Tt,"ResourcesService");let At=Tt;var Lt,wt;e.WsSasha=void 0,Lt=e.WsSasha||(e.WsSasha={}),(wt=Lt.WUTypes||(Lt.WUTypes={})).ECL="ECL",wt.DFU="DFU";const xt=class _SashaServiceBase extends w{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")}};n(xt,"SashaServiceBase");let Pt=xt;const Mt=class _SashaService extends Pt{};n(Mt,"SashaService");let Et=Mt;var Nt=new Date,It=new Date;function jt(e,t,s,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return n(i,"interval"),i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(s){return e(s=new Date(s-1)),t(s,1),e(s),s},i.round=function(e){var t=i(e),s=i.ceil(e);return e-t<s-e?t:s},i.offset=function(e,s){return t(e=new Date(+e),null==s?1:Math.floor(s)),e},i.range=function(s,n,r){var o,c=[];if(s=i.ceil(s),r=null==r?1:Math.floor(r),!(s<n&&r>0))return c;do{c.push(o=new Date(+s)),t(s,r),e(s)}while(o<s&&s<n);return c},i.filter=function(s){return jt(function(t){if(t>=t)for(;e(t),!s(t);)t.setTime(t-1)},function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!s(e););else for(;--n>=0;)for(;t(e,1),!s(e););})},s&&(i.count=function(t,n){return Nt.setTime(+t),It.setTime(+n),e(Nt),e(It),Math.floor(s(Nt,It))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}n(jt,"newInterval");var kt=864e5,Gt=6048e5,Vt=jt(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()))/kt},function(e){return e.getDate()-1});function Qt(e){return jt(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()))/Gt})}Vt.range,n(Qt,"weekday");var Bt=Qt(0),Ot=Qt(1),Xt=Qt(2),Ht=Qt(3),$t=Qt(4),Jt=Qt(5),qt=Qt(6);Bt.range,Ot.range,Xt.range,Ht.range,$t.range,Jt.range,qt.range;var Yt=jt(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()});Yt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jt(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,s){t.setFullYear(t.getFullYear()+s*e)}):null},Yt.range;var zt=jt(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/kt},function(e){return e.getUTCDate()-1});function Zt(e){return jt(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)/Gt})}zt.range,n(Zt,"utcWeekday");var Kt=Zt(0),es=Zt(1),ts=Zt(2),ss=Zt(3),ns=Zt(4),rs=Zt(5),is=Zt(6);Kt.range,es.range,ts.range,ss.range,ns.range,rs.range,is.range;var os=jt(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});function cs(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 as(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 us(e,t,s){return{y:e,m:t,d:s,H:0,M:0,S:0,L:0}}function hs(e){var t=e.dateTime,s=e.date,r=e.time,i=e.periods,o=e.days,c=e.shortDays,a=e.months,u=e.shortMonths,h=Rs(i),l=Ws(i),d=Rs(o),p=Ws(o),g=Rs(c),m=Ws(c),S=Rs(a),f=Ws(a),_=Rs(u),U=Ws(u),y={a:M,A:E,b:N,B:I,c:null,d:Hs,e:Hs,f:zs,g:un,G:ln,H:$s,I:Js,j:qs,L:Ys,m:Zs,M:Ks,p:j,q:k,Q:Mn,s:En,S:en,u:tn,U:sn,V:rn,w:on,W:cn,x:null,X:null,y:an,Y:hn,Z:dn,"%":Pn},v={a:G,A:V,b:Q,B:B,c:null,d:pn,e:pn,f:_n,g:An,G:wn,H:gn,I:mn,j:Sn,L:fn,m:Un,M:yn,p:O,q:X,Q:Mn,s:En,S:vn,u:Cn,U:Dn,V:Wn,w:bn,W:Fn,x:null,X:null,y:Tn,Y:Ln,Z:xn,"%":Pn},C={a:F,A:T,b:A,B:L,c:w,d:Ns,e:Ns,f:Qs,g:xs,G:ws,H:js,I:js,j:Is,L:Vs,m:Es,M:ks,p:b,q:Ms,Q:Os,s:Xs,S:Gs,u:Fs,U:Ts,V:As,w:bs,W:Ls,x:x,X:P,y:xs,Y:ws,Z:Ps,"%":Bs};function D(e,t){return function(s){var n,r,i,o=[],c=-1,a=0,u=e.length;for(s instanceof Date||(s=new Date(+s));++c<u;)37===e.charCodeAt(c)&&(o.push(e.slice(a,c)),null!=(r=_s[n=e.charAt(++c)])?n=e.charAt(++c):r="e"===n?" ":"0",(i=t[n])&&(n=i(s,r)),o.push(n),a=c+1);return o.push(e.slice(a,c)),o.join("")}}function R(e,t){return function(s){var n,r,i=us(1900,void 0,1);if(W(i,e,s+="",0)!=s.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=(n=as(us(i.y,0,1))).getUTCDay(),n=r>4||0===r?es.ceil(n):es(n),n=zt.offset(n,7*(i.V-1)),i.y=n.getUTCFullYear(),i.m=n.getUTCMonth(),i.d=n.getUTCDate()+(i.w+6)%7):(r=(n=cs(us(i.y,0,1))).getDay(),n=r>4||0===r?Ot.ceil(n):Ot(n),n=Vt.offset(n,7*(i.V-1)),i.y=n.getFullYear(),i.m=n.getMonth(),i.d=n.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?as(us(i.y,0,1)).getUTCDay():cs(us(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,as(i)):cs(i)}}function W(e,t,s,n){for(var r,i,o=0,c=t.length,a=s.length;o<c;){if(n>=a)return-1;if(37===(r=t.charCodeAt(o++))){if(r=t.charAt(o++),!(i=C[r in _s?t.charAt(o++):r])||(n=i(e,s,n))<0)return-1}else if(r!=s.charCodeAt(n++))return-1}return n}function b(e,t,s){var n=h.exec(t.slice(s));return n?(e.p=l[n[0].toLowerCase()],s+n[0].length):-1}function F(e,t,s){var n=g.exec(t.slice(s));return n?(e.w=m[n[0].toLowerCase()],s+n[0].length):-1}function T(e,t,s){var n=d.exec(t.slice(s));return n?(e.w=p[n[0].toLowerCase()],s+n[0].length):-1}function A(e,t,s){var n=_.exec(t.slice(s));return n?(e.m=U[n[0].toLowerCase()],s+n[0].length):-1}function L(e,t,s){var n=S.exec(t.slice(s));return n?(e.m=f[n[0].toLowerCase()],s+n[0].length):-1}function w(e,s,n){return W(e,t,s,n)}function x(e,t,n){return W(e,s,t,n)}function P(e,t,s){return W(e,r,t,s)}function M(e){return c[e.getDay()]}function E(e){return o[e.getDay()]}function N(e){return u[e.getMonth()]}function I(e){return a[e.getMonth()]}function j(e){return i[+(e.getHours()>=12)]}function k(e){return 1+~~(e.getMonth()/3)}function G(e){return c[e.getUTCDay()]}function V(e){return o[e.getUTCDay()]}function Q(e){return u[e.getUTCMonth()]}function B(e){return a[e.getUTCMonth()]}function O(e){return i[+(e.getUTCHours()>=12)]}function X(e){return 1+~~(e.getUTCMonth()/3)}return y.x=D(s,y),y.X=D(r,y),y.c=D(t,y),v.x=D(s,v),v.X=D(r,v),v.c=D(t,v),n(D,"newFormat"),n(R,"newParse"),n(W,"parseSpecifier"),n(b,"parsePeriod"),n(F,"parseShortWeekday"),n(T,"parseWeekday"),n(A,"parseShortMonth"),n(L,"parseMonth"),n(w,"parseLocaleDateTime"),n(x,"parseLocaleDate"),n(P,"parseLocaleTime"),n(M,"formatShortWeekday"),n(E,"formatWeekday"),n(N,"formatShortMonth"),n(I,"formatMonth"),n(j,"formatPeriod"),n(k,"formatQuarter"),n(G,"formatUTCShortWeekday"),n(V,"formatUTCWeekday"),n(Q,"formatUTCShortMonth"),n(B,"formatUTCMonth"),n(O,"formatUTCPeriod"),n(X,"formatUTCQuarter"),{format:n(function(e){var t=D(e+="",y);return t.toString=function(){return e},t},"format"),parse:n(function(e){var t=R(e+="",!1);return t.toString=function(){return e},t},"parse"),utcFormat:n(function(e){var t=D(e+="",v);return t.toString=function(){return e},t},"utcFormat"),utcParse:n(function(e){var t=R(e+="",!0);return t.toString=function(){return e},t},"utcParse")}}os.every=function(e){return isFinite(e=Math.floor(e))&&e>0?jt(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,s){t.setUTCFullYear(t.getUTCFullYear()+s*e)}):null},os.range,n(cs,"localDate"),n(as,"utcDate"),n(us,"newDate"),n(hs,"formatLocale$1");var ls,ds,ps,gs,ms,Ss,fs,_s={"-":"",_:" ",0:"0"},Us=/^\s*\d+/,ys=/^%/,vs=/[\\^$*+?|[\]().{}]/g;function Cs(e,t,s){var n=e<0?"-":"",r=(n?-e:e)+"",i=r.length;return n+(i<s?new Array(s-i+1).join(t)+r:r)}function Ds(e){return e.replace(vs,"\\$&")}function Rs(e){return new RegExp("^(?:"+e.map(Ds).join("|")+")","i")}function Ws(e){for(var t={},s=-1,n=e.length;++s<n;)t[e[s].toLowerCase()]=s;return t}function bs(e,t,s){var n=Us.exec(t.slice(s,s+1));return n?(e.w=+n[0],s+n[0].length):-1}function Fs(e,t,s){var n=Us.exec(t.slice(s,s+1));return n?(e.u=+n[0],s+n[0].length):-1}function Ts(e,t,s){var n=Us.exec(t.slice(s,s+2));return n?(e.U=+n[0],s+n[0].length):-1}function As(e,t,s){var n=Us.exec(t.slice(s,s+2));return n?(e.V=+n[0],s+n[0].length):-1}function Ls(e,t,s){var n=Us.exec(t.slice(s,s+2));return n?(e.W=+n[0],s+n[0].length):-1}function ws(e,t,s){var n=Us.exec(t.slice(s,s+4));return n?(e.y=+n[0],s+n[0].length):-1}function xs(e,t,s){var n=Us.exec(t.slice(s,s+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),s+n[0].length):-1}function Ps(e,t,s){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(s,s+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),s+n[0].length):-1}function Ms(e,t,s){var n=Us.exec(t.slice(s,s+1));return n?(e.q=3*n[0]-3,s+n[0].length):-1}function Es(e,t,s){var n=Us.exec(t.slice(s,s+2));return n?(e.m=n[0]-1,s+n[0].length):-1}function Ns(e,t,s){var n=Us.exec(t.slice(s,s+2));return n?(e.d=+n[0],s+n[0].length):-1}function Is(e,t,s){var n=Us.exec(t.slice(s,s+3));return n?(e.m=0,e.d=+n[0],s+n[0].length):-1}function js(e,t,s){var n=Us.exec(t.slice(s,s+2));return n?(e.H=+n[0],s+n[0].length):-1}function ks(e,t,s){var n=Us.exec(t.slice(s,s+2));return n?(e.M=+n[0],s+n[0].length):-1}function Gs(e,t,s){var n=Us.exec(t.slice(s,s+2));return n?(e.S=+n[0],s+n[0].length):-1}function Vs(e,t,s){var n=Us.exec(t.slice(s,s+3));return n?(e.L=+n[0],s+n[0].length):-1}function Qs(e,t,s){var n=Us.exec(t.slice(s,s+6));return n?(e.L=Math.floor(n[0]/1e3),s+n[0].length):-1}function Bs(e,t,s){var n=ys.exec(t.slice(s,s+1));return n?s+n[0].length:-1}function Os(e,t,s){var n=Us.exec(t.slice(s));return n?(e.Q=+n[0],s+n[0].length):-1}function Xs(e,t,s){var n=Us.exec(t.slice(s));return n?(e.s=+n[0],s+n[0].length):-1}function Hs(e,t){return Cs(e.getDate(),t,2)}function $s(e,t){return Cs(e.getHours(),t,2)}function Js(e,t){return Cs(e.getHours()%12||12,t,2)}function qs(e,t){return Cs(1+Vt.count(Yt(e),e),t,3)}function Ys(e,t){return Cs(e.getMilliseconds(),t,3)}function zs(e,t){return Ys(e,t)+"000"}function Zs(e,t){return Cs(e.getMonth()+1,t,2)}function Ks(e,t){return Cs(e.getMinutes(),t,2)}function en(e,t){return Cs(e.getSeconds(),t,2)}function tn(e){var t=e.getDay();return 0===t?7:t}function sn(e,t){return Cs(Bt.count(Yt(e)-1,e),t,2)}function nn(e){var t=e.getDay();return t>=4||0===t?$t(e):$t.ceil(e)}function rn(e,t){return e=nn(e),Cs($t.count(Yt(e),e)+(4===Yt(e).getDay()),t,2)}function on(e){return e.getDay()}function cn(e,t){return Cs(Ot.count(Yt(e)-1,e),t,2)}function an(e,t){return Cs(e.getFullYear()%100,t,2)}function un(e,t){return Cs((e=nn(e)).getFullYear()%100,t,2)}function hn(e,t){return Cs(e.getFullYear()%1e4,t,4)}function ln(e,t){var s=e.getDay();return Cs((e=s>=4||0===s?$t(e):$t.ceil(e)).getFullYear()%1e4,t,4)}function dn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Cs(t/60|0,"0",2)+Cs(t%60,"0",2)}function pn(e,t){return Cs(e.getUTCDate(),t,2)}function gn(e,t){return Cs(e.getUTCHours(),t,2)}function mn(e,t){return Cs(e.getUTCHours()%12||12,t,2)}function Sn(e,t){return Cs(1+zt.count(os(e),e),t,3)}function fn(e,t){return Cs(e.getUTCMilliseconds(),t,3)}function _n(e,t){return fn(e,t)+"000"}function Un(e,t){return Cs(e.getUTCMonth()+1,t,2)}function yn(e,t){return Cs(e.getUTCMinutes(),t,2)}function vn(e,t){return Cs(e.getUTCSeconds(),t,2)}function Cn(e){var t=e.getUTCDay();return 0===t?7:t}function Dn(e,t){return Cs(Kt.count(os(e)-1,e),t,2)}function Rn(e){var t=e.getUTCDay();return t>=4||0===t?ns(e):ns.ceil(e)}function Wn(e,t){return e=Rn(e),Cs(ns.count(os(e),e)+(4===os(e).getUTCDay()),t,2)}function bn(e){return e.getUTCDay()}function Fn(e,t){return Cs(es.count(os(e)-1,e),t,2)}function Tn(e,t){return Cs(e.getUTCFullYear()%100,t,2)}function An(e,t){return Cs((e=Rn(e)).getUTCFullYear()%100,t,2)}function Ln(e,t){return Cs(e.getUTCFullYear()%1e4,t,4)}function wn(e,t){var s=e.getUTCDay();return Cs((e=s>=4||0===s?ns(e):ns.ceil(e)).getUTCFullYear()%1e4,t,4)}function xn(){return"+0000"}function Pn(){return"%"}function Mn(e){return+e}function En(e){return Math.floor(+e/1e3)}function Nn(e){return(ls=hs(e)).format,ds=ls.parse,ps=ls.utcFormat,gs=ls.utcParse,ls}n(Cs,"pad"),n(Ds,"requote"),n(Rs,"formatRe"),n(Ws,"formatLookup"),n(bs,"parseWeekdayNumberSunday"),n(Fs,"parseWeekdayNumberMonday"),n(Ts,"parseWeekNumberSunday"),n(As,"parseWeekNumberISO"),n(Ls,"parseWeekNumberMonday"),n(ws,"parseFullYear"),n(xs,"parseYear"),n(Ps,"parseZone"),n(Ms,"parseQuarter"),n(Es,"parseMonthNumber"),n(Ns,"parseDayOfMonth"),n(Is,"parseDayOfYear"),n(js,"parseHour24"),n(ks,"parseMinutes"),n(Gs,"parseSeconds"),n(Vs,"parseMilliseconds"),n(Qs,"parseMicroseconds"),n(Bs,"parseLiteralPercent"),n(Os,"parseUnixTimestamp"),n(Xs,"parseUnixTimestampSeconds"),n(Hs,"formatDayOfMonth"),n($s,"formatHour24"),n(Js,"formatHour12"),n(qs,"formatDayOfYear"),n(Ys,"formatMilliseconds"),n(zs,"formatMicroseconds"),n(Zs,"formatMonthNumber"),n(Ks,"formatMinutes"),n(en,"formatSeconds"),n(tn,"formatWeekdayNumberMonday"),n(sn,"formatWeekNumberSunday"),n(nn,"dISO"),n(rn,"formatWeekNumberISO"),n(on,"formatWeekdayNumberSunday"),n(cn,"formatWeekNumberMonday"),n(an,"formatYear"),n(un,"formatYearISO"),n(hn,"formatFullYear"),n(ln,"formatFullYearISO"),n(dn,"formatZone"),n(pn,"formatUTCDayOfMonth"),n(gn,"formatUTCHour24"),n(mn,"formatUTCHour12"),n(Sn,"formatUTCDayOfYear"),n(fn,"formatUTCMilliseconds"),n(_n,"formatUTCMicroseconds"),n(Un,"formatUTCMonthNumber"),n(yn,"formatUTCMinutes"),n(vn,"formatUTCSeconds"),n(Cn,"formatUTCWeekdayNumberMonday"),n(Dn,"formatUTCWeekNumberSunday"),n(Rn,"UTCdISO"),n(Wn,"formatUTCWeekNumberISO"),n(bn,"formatUTCWeekdayNumberSunday"),n(Fn,"formatUTCWeekNumberMonday"),n(Tn,"formatUTCYear"),n(An,"formatUTCYearISO"),n(Ln,"formatUTCFullYear"),n(wn,"formatUTCFullYearISO"),n(xn,"formatUTCZone"),n(Pn,"formatLiteralPercent"),n(Mn,"formatUnixTimestamp"),n(En,"formatUnixTimestampSeconds"),Nn({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"]}),n(Nn,"defaultLocale$1"),e.WsSMC=void 0,ms=e.WsSMC||(e.WsSMC={}),(Ss=ms.LockModes||(ms.LockModes={})).ALL="ALL",Ss.READ="READ",Ss.WRITE="WRITE",Ss.HOLD="HOLD",Ss.SUB="SUB",(fs=ms.RoxieControlCmdType||(ms.RoxieControlCmdType={})).Attach="Attach",fs.Detach="Detach",fs.State="State",fs.Reload="Reload",fs.ReloadRetry="ReloadRetry",fs.MemLock="MemLock",fs.MemUnlock="MemUnlock",fs.GetMemLocked="GetMemLocked";const In=class _SMCServiceBase extends w{constructor(e){super(e,"WsSMC","1.29")}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")}RecordGlobalMetrics(e){return this._connection.send("RecordGlobalMetrics",e,"json",!1,void 0,"RecordGlobalMetricsResponse")}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")}};n(In,"SMCServiceBase");let jn=In;const kn=ds("%Y%m%d%H");function Gn(e){return"number"==typeof e||"string"==typeof e&&""!==e.trim()&&!isNaN(+e)}n(Gn,"isNumeric");const Vn=class _SMCService extends jn{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(e=>({Running:{ActiveWorkunit:[]},...e}))}parseGlobalMetric(e,t){return e.startsWith("Cost")?+t/1e6:e.startsWith("Date")?kn(t):e.startsWith("Num")?+t:e.startsWith("Time")?+t/1e9:e.startsWith("When")?new Date(+t/1e3).toISOString():Gn(t)?+t:t}GetNormalisedGlobalMetrics(e){return super.GetGlobalMetrics(e).then(e=>{const t=[];for(const s of e?.GlobalMetrics?.GlobalMetric||[]){const e={Category:s.Category,Start:this.parseGlobalMetric("Date",s.DateTimeRange?.Start),End:this.parseGlobalMetric("Date",s.DateTimeRange?.End),dimensions:{},stats:{}};for(const t of s.Dimensions?.Dimension||[])e.dimensions[t.Name]=t.Value;for(const t of s.Stats?.Stat||[])e.stats[t.Name]=this.parseGlobalMetric(t.Name,t.Value);t.push(e)}return t})}};n(Vn,"SMCService");let Qn=Vn;const Bn=class _storeServiceBase extends w{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")}};n(Bn,"storeServiceBase");let On=Bn;const Xn=class _StoreService extends On{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})}};n(Xn,"StoreService");let Hn=Xn;var $n,Jn,qn;e.WsTopology=void 0,$n=e.WsTopology||(e.WsTopology={}),(Jn=$n.TpConfigResponseFormat||($n.TpConfigResponseFormat={})).XML="XML",Jn.YAML="YAML",(qn=$n.RoxieQueueFilter||($n.RoxieQueueFilter={})).All="All",qn.QueriesOnly="QueriesOnly",qn.WorkunitsOnly="WorkunitsOnly",(e=>{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"})($n.TpMachineType||($n.TpMachineType={}));const Yn=class _TopologyServiceBase extends w{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")}};n(Yn,"TopologyServiceBase");let zn=Yn;const Zn=class _TopologyService extends zn{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,s;return e.TpLogicalClusters.TpLogicalCluster.some((e,n)=>(0===n&&(s=e),"hthor"===e.Type&&(t=e,!0))),t||s})}};n(Zn,"TopologyService");let Kn=Zn;var er,tr,sr,nr,rr,ir,or,cr,ar,ur,hr,lr,dr,pr;e.WsWorkunits=void 0,er=e.WsWorkunits||(e.WsWorkunits={}),(tr=er.ECLWUActions||(er.ECLWUActions={})).Abort="Abort",tr.Delete="Delete",tr.Deschedule="Deschedule",tr.Reschedule="Reschedule",tr.Pause="Pause",tr.PauseNow="PauseNow",tr.Protect="Protect",tr.Unprotect="Unprotect",tr.Restore="Restore",tr.Resume="Resume",tr.SetToFailed="SetToFailed",tr.Archive="Archive",(e=>{e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM"})(er.LogSelectColumnMode||(er.LogSelectColumnMode={})),(e=>{e[e.ASC=0]="ASC",e[e.DSC=1]="DSC"})(er.SortDirection||(er.SortDirection={})),(sr=er.LogEventClass||(er.LogEventClass={})).ALL="ALL",sr.DIS="DIS",sr.ERR="ERR",sr.WRN="WRN",sr.INF="INF",sr.PRO="PRO",sr.MET="MET",sr.EVT="EVT",(nr=er.WUDetailsAttrValueType||(er.WUDetailsAttrValueType={})).Single="Single",nr.List="List",nr.Multi="Multi",(rr=er.EclDefinitionActions||(er.EclDefinitionActions={})).SyntaxCheck="SyntaxCheck",rr.Deploy="Deploy",rr.Publish="Publish",(ir=er.ErrorMessageFormat||(er.ErrorMessageFormat={})).xml="xml",ir.json="json",ir.text="text",(or=er.LogAccessLogFormat||(er.LogAccessLogFormat={}))[or.XML=0]="XML",or[or.JSON=1]="JSON",or[or.CSV=2]="CSV",(cr=er.WUExceptionSeverity||(er.WUExceptionSeverity={})).info="info",cr.warning="warning",cr.error="error",cr.alert="alert",(ar=er.WUQueryFilterSuspendedType||(er.WUQueryFilterSuspendedType={})).Allqueries="All queries",ar.Notsuspended="Not suspended",ar.Suspended="Suspended",ar.Suspendedbyuser="Suspended by user",ar.Suspendedbyfirstnode="Suspended by first node",ar.Suspendedbyanynode="Suspended by any node",(ur=er.WUQuerySetFilterType||(er.WUQuerySetFilterType={})).All="All",ur.Id="Id",ur.Name="Name",ur.Alias="Alias",ur.Status="Status",(hr=er.WUProtectFilter||(er.WUProtectFilter={})).All="All",hr.Protected="Protected",hr.NotProtected="NotProtected",(er.QuerySetAliasActionTypes||(er.QuerySetAliasActionTypes={})).Deactivate="Deactivate",(lr=er.QuerysetImportActivation||(er.QuerysetImportActivation={})).None="None",lr.ActivateImportedActive="ActivateImportedActive",(dr=er.QuerySetQueryActionTypes||(er.QuerySetQueryActionTypes={})).Suspend="Suspend",dr.Unsuspend="Unsuspend",dr.ToggleSuspend="ToggleSuspend",dr.Activate="Activate",dr.Delete="Delete",dr.DeleteQueriesAndWUs="DeleteQueriesAndWUs",dr.RemoveAllAliases="RemoveAllAliases",dr.ResetQueryStats="ResetQueryStats",(pr=er.WUQueryActivationMode||(er.WUQueryActivationMode={}))[pr.DoNotActivateQuery=0]="DoNotActivateQuery",pr[pr.ActivateQuery=1]="ActivateQuery",pr[pr.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",pr[pr.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious";const gr=class _WorkunitsServiceBase extends w{constructor(e){super(e,"WsWorkunits","2.04")}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")}};n(gr,"WorkunitsServiceBase");let mr=gr;var Sr,fr,_r=(e=>(e[e.Unknown=0]="Unknown",e[e.Compiled=1]="Compiled",e[e.Running=2]="Running",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed",e[e.Archived=5]="Archived",e[e.Aborting=6]="Aborting",e[e.Aborted=7]="Aborted",e[e.Blocked=8]="Blocked",e[e.Submitted=9]="Submitted",e[e.Scheduled=10]="Scheduled",e[e.Compiling=11]="Compiling",e[e.Wait=12]="Wait",e[e.UploadingFiled=13]="UploadingFiled",e[e.DebugPaused=14]="DebugPaused",e[e.DebugRunning=15]="DebugRunning",e[e.Paused=16]="Paused",e[e.LAST=17]="LAST",e[e.NotFound=999]="NotFound",e))(_r||{});function Ur(e){return"string"==typeof e.Name}function yr(e){return void 0!==e.TotalClusterTime}function vr(e){return void 0!==e.StateEx}e.WUUpdate=void 0,Sr=e.WUUpdate||(e.WUUpdate={}),(fr=Sr.Action||(Sr.Action={}))[fr.Unknown=0]="Unknown",fr[fr.Compile=1]="Compile",fr[fr.Check=2]="Check",fr[fr.Run=3]="Run",fr[fr.ExecuteExisting=4]="ExecuteExisting",fr[fr.Pause=5]="Pause",fr[fr.PauseNow=6]="PauseNow",fr[fr.Resume=7]="Resume",fr[fr.Debug=8]="Debug",fr[fr.__size=9]="__size",n(Ur,"isECLResult"),n(yr,"isWUQueryECLWorkunit"),n(vr,"isWUInfoWorkunit");const Cr=class _WorkunitsService extends mr{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},s){return this._connection.send("WUQuery",e,"json",!1,s).then(e=>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 s=t.xml2json(e.Result).children();return s.length?s[0]:null})}};n(Cr,"WorkunitsService");let Dr=Cr;const Rr=class _WorkunitsServiceEx extends mr{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};n(Rr,"WorkunitsServiceEx");let Wr=Rr;function br(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Fr(e,t){if((s=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var s,n=e.slice(0,s);return[n.length>1?n[0]+n.slice(2):n,+e.slice(s+1)]}function Tr(e){return(e=Fr(Math.abs(e)))?e[1]:NaN}function Ar(e,t){return function(s,n){for(var r=s.length,i=[],o=0,c=e[0],a=0;r>0&&c>0&&(a+c+1>n&&(c=Math.max(1,n-a)),i.push(s.substring(r-=c,r+c)),!((a+=c+1)>n));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function Lr(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}n(br,"formatDecimal"),n(Fr,"formatDecimalParts"),n(Tr,"exponent"),n(Ar,"formatGroup"),n(Lr,"formatNumerals");var wr,xr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Pr(e){if(!(t=xr.exec(e)))throw new Error("invalid format: "+e);var t;return new Mr({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 Mr(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 Er(e){e:for(var t,s=e.length,n=1,r=-1;n<s;++n)switch(e[n]){case".":r=t=n;break;case"0":0===r&&(r=n),t=n;break;default:if(!+e[n])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}function Nr(e,t){var s=Fr(e,t);if(!s)return e+"";var n=s[0],r=s[1],i=r-(wr=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Fr(e,Math.max(0,t+i-1))[0]}function Ir(e,t){var s=Fr(e,t);if(!s)return e+"";var n=s[0],r=s[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}n(Pr,"formatSpecifier"),Pr.prototype=Mr.prototype,n(Mr,"FormatSpecifier"),Mr.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},n(Er,"formatTrim"),n(Nr,"formatPrefixAuto"),n(Ir,"formatRounded");const jr={"%":n(function(e,t){return(100*e).toFixed(t)},"%"),b:n(function(e){return Math.round(e).toString(2)},"b"),c:n(function(e){return e+""},"c"),d:br,e:n(function(e,t){return e.toExponential(t)},"e"),f:n(function(e,t){return e.toFixed(t)},"f"),g:n(function(e,t){return e.toPrecision(t)},"g"),o:n(function(e){return Math.round(e).toString(8)},"o"),p:n(function(e,t){return Ir(100*e,t)},"p"),r:Ir,s:Nr,X:n(function(e){return Math.round(e).toString(16).toUpperCase()},"X"),x:n(function(e){return Math.round(e).toString(16)},"x")};function kr(e){return e}n(kr,"identity");var Gr,Vr,Qr=Array.prototype.map,Br=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Or(e){var t=void 0===e.grouping||void 0===e.thousands?kr:Ar(Qr.call(e.grouping,Number),e.thousands+""),s=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=e.decimal+"",o=void 0===e.numerals?kr:Lr(Qr.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",a=e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var h=(e=Pr(e)).fill,l=e.align,d=e.sign,p=e.symbol,g=e.zero,m=e.width,S=e.comma,f=e.precision,_=e.trim,U=e.type;"n"===U?(S=!0,U="g"):jr[U]||(void 0===f&&(f=12),_=!0,U="g"),(g||"0"===h&&"="===l)&&(g=!0,h="0",l="=");var y="$"===p?s:"#"===p&&/[boxX]/.test(U)?"0"+U.toLowerCase():"",v="$"===p?r:/[%p]/.test(U)?c:"",C=jr[U],D=/[defgprs%]/.test(U);function R(e){var s,n,r,c=y,p=v;if("c"===U)p=C(e)+p,e="";else{var R=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:C(Math.abs(e),f),_&&(e=Er(e)),R&&0===+e&&"+"!==d&&(R=!1),c=(R?"("===d?d:a:"-"===d||"("===d?"":d)+c,p=("s"===U?Br[8+wr/3]:"")+p+(R&&"("===d?")":""),D)for(s=-1,n=e.length;++s<n;)if(48>(r=e.charCodeAt(s))||r>57){p=(46===r?i+e.slice(s+1):e.slice(s))+p,e=e.slice(0,s);break}}S&&!g&&(e=t(e,1/0));var W=c.length+e.length+p.length,b=W<m?new Array(m-W+1).join(h):"";switch(S&&g&&(e=t(b+e,b.length?m-p.length:1/0),b=""),l){case"<":e=c+e+p+b;break;case"=":e=c+b+e+p;break;case"^":e=b.slice(0,W=b.length>>1)+c+e+p+b.slice(W);break;default:e=b+c+e+p}return o(e)}return f=void 0===f?6:/[gprs]/.test(U)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),n(R,"format"),R.toString=function(){return e+""},R}function l(e,t){var s=h(((e=Pr(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(Tr(t)/3))),r=Math.pow(10,-n),i=Br[8+n/3];return function(e){return s(r*e)+i}}return n(h,"newFormat"),n(l,"formatPrefix"),{format:h,formatPrefix:l}}function Xr(e){return Gr=Or(e),Vr=Gr.format,Gr.formatPrefix,Gr}n(Or,"formatLocale"),Xr({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),n(Xr,"defaultLocale");const Hr=class _ECLGraph 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,s){super(),this.wu=e;let n=0;for(const r of s)if(r.GraphName===t.Name&&!r.HasSubGraphId){n=Math.round(1e3*r.Seconds)/1e3;break}this.set({Time:n,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(e=>mi(e)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(e=>mi(e))}};n(Hr,"ECLGraph");let $r=Hr;const Jr=class _GraphCache extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Name]))}};n(Jr,"GraphCache");let qr=Jr;function Yr(e,t,s){(s=s||[]).push(e),t(e.name,e.$,e.children(),s),e.children().forEach(e=>{Yr(e,t,s)}),s.pop()}function zr(e){const t={};return e.forEach(e=>{"att"===e.name&&(t[e.$.name]=e.$.value)}),t}n(Yr,"walkXmlJson"),n(zr,"flattenAtt");const Zr=class _XGMMLGraph extends t.Graph{};n(Zr,"XGMMLGraph");let Kr=Zr;const ei=class _XGMMLSubgraph extends t.Subgraph{};n(ei,"XGMMLSubgraph");let ti=ei;const si=class _XGMMLVertex extends t.Vertex{};n(si,"XGMMLVertex");let ni=si;const ri=class _XGMMLEdge extends t.Edge{};n(ri,"XGMMLEdge");let ii=ri;function oi(e,t){const s={},n={},r={},i=new Kr(e=>e._.id),o=[i.root];return Yr(t,(e,t,i,c)=>{const a=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=a.createSubgraph(zr(i));o.push(e),s[t.id]=e}const e=a.createVertex(zr(i));n[t.id]=e;break;case"edge":const c=a.createEdge(n[t.source],n[t.target],zr(i));r[t.id]=c}}),i}n(oi,"createXGMMLGraph");const ci=class _ScopeGraph extends t.Graph{};n(ci,"ScopeGraph");let ai=ci;const ui=class _ScopeSubgraph extends t.Subgraph{};n(ui,"ScopeSubgraph");let hi=ui;const li=class _ScopeVertex extends t.Vertex{};n(li,"ScopeVertex");let di=li;const pi=class _ScopeEdge extends t.Edge{};n(pi,"ScopeEdge");let gi=pi;function mi(e){const t={},s={},n={};let r;for(const o of e)switch(o.ScopeType){case"graph":r=new ai(e=>e._.Id,o),t[o.ScopeName]=r.root;break;case"subgraph":r||(r=new ai(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?n[o.ScopeName]=c.createVertex(o):console.warn(`Missing A:Parent (${o.Id}): ${o.parentScope()}`);break;case"edge":s[o.ScopeName]=o;break;case"function":const a=n[o.parentScope()];a?a._.children().push(o):console.warn(`Missing F:Parent (${o.Id}): ${o.parentScope()}`)}for(const o in s){const e=s[o],n=t[e.parentScope()];if(n){const t=n;try{const s=r.vertex(e.attr("IdSource").RawValue),n=r.vertex(e.attr("IdTarget").RawValue);t.createEdge(s,n,e)}catch(i){console.warn(`Invalid Edge: ${o}`)}}else console.warn(`Missing E:Parent (${e.Id}): ${e.parentScope()}`)}return r}n(mi,"createGraph");const Si=class _Resource 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 s=t.split("\\").join("/"),n=s.split("/"),r="res/"+this.wu.Wuid+"/";let i="",o="";0===s.indexOf(r)&&(i=s.substr(r.length),o=n[n.length-1]),this.set({URL:t,DisplayName:o,DisplayPath:i})}};n(Si,"Resource");let fi=Si;const _i=class _XSDNode{e;constructor(e){this.e=e}fix(){delete this.e}};n(_i,"XSDNode");let Ui=_i;const yi=class _XSDXMLNode extends Ui{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",s=this.type.lastIndexOf("_"),n=s>0?s:this.type.length;let r=n-1;for(;r>=0&&-1!==t.indexOf(this.type.charAt(r));--r);r+1<n&&(e=parseInt(this.type.substring(r+1,n),10)),0===this.type.indexOf("data")&&(e*=2)}return e<this.name.length&&(e=this.name.length),e}};n(yi,"XSDXMLNode");let vi=yi;const Ci=class _XSDSimpleType extends Ui{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()}};n(Ci,"XSDSimpleType");let Di=Ci;const Ri=class _XSDSchema{root;simpleTypes={};fields(){return this.root.children()}};n(Ri,"XSDSchema");let Wi=Ri;const bi=class _XSDParser extends t.SAXStackParser{schema=new Wi;simpleType;simpleTypes={};xsdStack=new t.Stack;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":const t=new vi(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 Di(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 s in e.$)t.attrs[s]=e.$[s];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};n(bi,"XSDParser");let Fi=bi;function Ti(e){const t=new Fi;return t.parse(e),t.schema}n(Ti,"parseXSD");const Ai=class _XSDParser2 extends Fi{_rootName;schema=new Wi;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 vi(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 Di(e)}}endXMLNode(e){if("xsd:element"===e.name){this.xsdStack.pop().fix()}super.endXMLNode(e)}};n(Ai,"XSDParser2");let Li=Ai;function wi(e,t){const s=new Li(t);return s.parse(e),s.schema}n(wi,"parseXSD2");const xi=class _GlobalResultCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}};n(xi,"GlobalResultCache");let Pi=xi;const Mi=new Pi,Ei=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,s,n){let r;return Array.isArray(n)?(r=Mi.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s.Name},()=>new _Result(e,t,s,n)),r.set(s)):void 0===n&&("number"==typeof s?r=Mi.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new _Result(e,t,s)):"string"==typeof s&&(r=Mi.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new _Result(e,t,s)))),r}static attachLogicalFile(e,t,s){return Mi.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new _Result(e,t,s,!0))}constructor(e,t,s,n){super(),this.connection=e instanceof Dr?e:new Dr(e),"boolean"==typeof n&&!0===n?this.set({NodeGroup:t,LogicalFileName:s}):Ur(s)&&Array.isArray(n)?this.set({...s,Wuid:t,ResultName:s.Name,ResultViews:n}):void 0===n?"number"==typeof s?this.set({Wuid:t,ResultSequence:s}):"string"==typeof s?this.set({Wuid:t,ResultName:s}):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=Ti(e.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,s=-1,n=!1,r={},i,o){const c=o??this._bypassCache;return this.WUResult(e,s,!n,r,i,c).then(e=>{const s=e.Result;return delete e.Result,this.set({...e}),t.exists("XmlSchema.xml",s)&&(this.xsdSchema=Ti(s.XmlSchema.xml)),t.exists("Row",s)?s.Row:this.ResultName&&t.exists(this.ResultName,s)?s[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,s=!1,n={},r,i=!1){const o={NamedValue:{itemcount:0}};for(const a in n)o.NamedValue[o.NamedValue.itemcount++]={Name:a,Value:n[a]};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=s,c.BypassCachedResult=i,this.connection.WUResult(c,r).then(e=>e)}};n(Ei,"Result");let Ni=Ei;const Ii=class _ResultCache extends t.Cache{constructor(){super(e=>t.Cache.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};n(Ii,"ResultCache");let ji=Ii;const ki=class _Attribute 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)}};n(ki,"Attribute");let Gi=ki;const Vi=class _BaseScope 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(s=>{"ts"===s.Measure&&s.Name.indexOf("Started")>=0?t.start=s:this.ScopeName&&"ts"===s.Measure&&s.Name.indexOf("Finished")>=0?t.end=s:e.push(new Gi(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Gi(this,t.start))):t.start?e.push(new Gi(this,t.start)):t.end&&e.push(new Gi(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 Gi(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="";const s=[];t=this.Id,s.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&s.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),s.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);const n=this.formattedAttrs();for(const r in n)"Label"===r?t=n[r]:s.push(`<tr><td class="key">${r}</td><td class="value">${n[r]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">\n <h4 align="center">${t}</h4>\n <table>\n ${s.join("")}\n </table>\n </div>`}};n(Vi,"BaseScope");let Qi=Vi;const Bi=class _Scope extends Qi{wu;constructor(e,t){super(t),this.wu=e}};n(Bi,"Scope");let Oi=Bi;const Xi=class _SourceFile 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,s){super(),this.connection=e instanceof Dr?e:new Dr(e),this.set({Wuid:t,...s})}};n(Xi,"SourceFile");let Hi=Xi;const $i=class _Timer 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,s,n){super(),this.connection=e instanceof Dr?e:new Dr(e);const r=t.espTime2Seconds(n.Value);this.set({Wuid:s,Seconds:Math.round(1e3*r)/1e3,HasSubGraphId:void 0!==n.SubGraphId,...n})}};n($i,"Timer");let Ji=$i;const qi=ps("%Y-%m-%dT%H:%M:%S.%LZ"),Yi=gs("%Y-%m-%dT%H:%M:%S.%LZ"),zi=Vr(",");function Zi(e){return e&&!isNaN(+e)?zi(+e):e}n(Zi,"formatNum");const Ki="DefinitionList",eo=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,to=["Avg","Min","Max","Delta","StdDev"],so=["SkewMin","SkewMax","NodeMin","NodeMax"],no=/[A-Z][a-z]*/g;function ro(e){for(const s of so){const t=e.indexOf(s);if(0===t){return{measure:"",ext:s,label:e.slice(t+s.length)}}}const t=e.match(no);if(t?.length){const e=t.shift();let s=t.join("");for(const t of to){const n=s.indexOf(t);if(0===n)return s=s.slice(n+t.length),{measure:e,ext:t,label:s}}return{measure:e,ext:"",label:s}}return{measure:"",ext:"",label:e}}n(ro,"_splitMetric");const io={};function oo(e){let t=io[e];return t||(t=ro(e),io[e]=t),t}function co(e,t){return e.__formattedProps?.[t]??e[t]}function ao(e){if(void 0===e)return;const t=parseFloat(e);return isNaN(t)?void 0:t}function uo(e,t,s){const n=oo(t);if(!s[n.measure]){s[n.label]=!0;const t=ao(e[`${n.measure}Avg${n.label}`]),r=ao(e[`${n.measure}Min${n.label}`]),i=ao(e[`${n.measure}Max${n.label}`]),o=ao(e[`${n.measure}StdDev${n.label}`]),c=Math.max((t-r)/o,(i-t)/o);return{Key:`${n.measure}${n.label}`,Value:co(e,`${n.measure}${n.label}`),Avg:co(e,`${n.measure}Avg${n.label}`),Min:co(e,`${n.measure}Min${n.label}`),Max:co(e,`${n.measure}Max${n.label}`),Delta:co(e,`${n.measure}Delta${n.label}`),StdDev:co(e,`${n.measure}StdDev${n.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:co(e,`SkewMin${n.label}`),SkewMax:co(e,`SkewMax${n.label}`),NodeMin:co(e,`NodeMin${n.label}`),NodeMax:co(e,`NodeMax${n.label}`)}}return null}n(oo,"splitMetric"),n(co,"formatValue"),n(ao,"safeParseFloat"),n(uo,"formatValues");const ho=t.scopedLogger("workunit.ts"),lo=class _WorkunitCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}};n(lo,"WorkunitCache");let po=lo;const go=new po,mo=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",_r.Unknown)}get State(){return this.get("State")||_r[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 ji;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,()=>Ni.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 Ji(this.connection,this.Wuid,e))}_graphCache=new qr;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 $r(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 fi(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 Hi(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")}get CostSavingPotential(){return this.get("CostSavingPotential")}static create(e){const t=new _Workunit(e);return t.connection.WUCreate().then(e=>(go.set(t),t.set(e.Workunit),t))}static attach(e,t,s){const n=go.get({BaseUrl:e.baseUrl,Wuid:t},()=>new _Workunit(e,t));return s&&n.set(s),n}static existsLocal(e,t){return go.has({BaseUrl:e,Wuid:t})}static submit(t,s,n,r=!1){return _Workunit.create(t).then(e=>e.update({QueryText:n})).then(t=>r?t.submit(s,e.WUUpdate.Action.Compile):t.submit(s))}static compile(e,t,s){return _Workunit.submit(e,t,s,!0)}static query(e,t){return new Dr(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 Dr(e),this.topologyConnection=new Kn(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:_r.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(t,s=e.WUUpdate.Action.Run,n){let r;return r=void 0!==t?Promise.resolve(t):this.topologyConnection.DefaultTpLogicalClusterQuery().then(e=>e.Name),this._debugMode=!1,s===e.WUUpdate.Action.Debug&&(s=e.WUUpdate.Action.Run,this._debugMode=!0),r.then(e=>this.connection.WUUpdate({Wuid:this.Wuid,Action:s,ResultLimit:n,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(t=>(this.set(t.Workunit),this._submitAction=s,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:e})))).then(()=>this)}isComplete(){switch(this.StateID){case _r.Compiled:return"compile"===this.ActionEx||this._submitAction===e.WUUpdate.Action.Compile;case _r.Completed:case _r.Failed:case _r.Aborted:case _r.NotFound:return!0}return!1}isFailed(){switch(this.StateID){case _r.Aborted:case _r.Failed:return!0}return!1}isDeleted(){return this.StateID===_r.NotFound}isDebugging(){switch(this.StateID){case _r.DebugPaused:case _r.DebugRunning:return!0}return this._debugMode}isRunning(){switch(this.StateID){case _r.Compiled:case _r.Running:case _r.Aborting:case _r.Blocked:case _r.DebugPaused:case _r.DebugRunning:return!0}return!1}setToFailed(){return this.WUAction(e.WsWorkunits.ECLWUActions.SetToFailed)}pause(){return this.WUAction(e.WsWorkunits.ECLWUActions.Pause)}pauseNow(){return this.WUAction(e.WsWorkunits.ECLWUActions.PauseNow)}resume(){return this.WUAction(e.WsWorkunits.ECLWUActions.Resume)}abort(){return this.WUAction(e.WsWorkunits.ECLWUActions.Abort)}protect(){return this.WUAction(e.WsWorkunits.ECLWUActions.Protect)}unprotect(){return this.WUAction(e.WsWorkunits.ECLWUActions.Unprotect)}delete(){return this.WUAction(e.WsWorkunits.ECLWUActions.Delete)}restore(){return this.WUAction(e.WsWorkunits.ECLWUActions.Restore)}deschedule(){return this.WUAction(e.WsWorkunits.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(e.WsWorkunits.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!==_r.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 s={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},n=new Map;for(const o of e.Activities?.Activity??[])n.set(o.Kind,o.Name);const r=new Array(t.length);for(let o=0;o<t.length;o++){const e=t[o],c={},a={};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=n.get(e)??i}switch(s[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}a[r]=Zi(t.Formatted??c[r])}const u={id:e.Id,name:e.ScopeName,type:e.ScopeType,Kind:e.Kind,Label:e.Label,__formattedProps:a,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...c},h=u[Ki];if(h)try{const e=JSON.parse(h.split("\\").join("\\\\")),t=[];for(let s=0;s<e.length;s++){const n=e[s].match(eo);n&&t.push({filePath:(n[1]??"")+n[2]+n[3],line:parseInt(n[5],10),col:parseInt(n[6],10)})}u[Ki]=t}catch(i){ho.error(`Unexpected "DefinitionList": ${h}`)}const l={};let d=0,p="";for(const t in u)if(!t.startsWith("__")){const e=uo(u,t,l);e&&(u.__groupedProps[e.Key]=e,!isNaN(e.StdDevs)&&e.StdDevs>d&&(d=e.StdDevs,p=e.Key))}u.__StdDevs=d,u.__StdDevsSource=p,r[o]=u}return{meta:e,columns:s,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 Oi(this,e)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(e=>{const t=[],s={};e.Scopes.Scope.forEach(e=>{if(s[e.ScopeName])return s[e.ScopeName].update(e),null;{const t=new Oi(this,e);return s[t.ScopeName]=t,t}});for(const n in s)if(s.hasOwnProperty(n)){const e=s[n],r=e.parentScope();r&&s[r]?s[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=>mi(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(s=>{"TimeElapsed"===s.Name?t[e.ScopeName].elapsed=+s.RawValue:"ts"===s.Measure&&s.Name.indexOf("Started")>=0&&(t[e.ScopeName].start=s.Formatted)})});const s=[];for(const n in t){const e=t[n];if(e.start&&e.elapsed){const t=Yi(e.start);t.setMilliseconds(t.getMilliseconds()+e.elapsed/1e6),e.finish=qi(t),s.push(e)}}return s.sort((e,t)=>e.start<t.start?-1:e.start>t.start?1:0),s})}_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,s){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,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),(this.isComplete()||this.isRunning())&&(n.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",_r.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",_r.NotFound),!0)))throw ho.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),go.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",_r.NotFound),!0)))throw ho.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUResubmit(e){return this.connection.WUResubmit(t.deepMixinT({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(t.deepMixinT({ScopeFilter:{MaxDepth:9999},ScopeOptions:{IncludeMatchedScopesInResults:!0,IncludeScope:!0,IncludeId:!1,IncludeScopeType:!1},PropertyOptions:{IncludeName:!0,IncludeRawValue:!1,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},e,{WUID:this.Wuid})).then(e=>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(t){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:t||this.Jobname,AllowForeignFiles:!0,Activate:e.WsWorkunits.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){const t=new Wr({baseUrl:""}),s={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(s)}WUCDebug(e,t={}){let s="";for(const n in t)t.hasOwnProperty(n)&&(s+=` ${n}='${t[n]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${s}/>`}).then(e=>e)}debug(e,s){return this.isDebugging()?this.WUCDebug(e,s).then(s=>{const n=s.children(e);return n.length?n[0]:new t.XMLNode(e)}).catch(s=>(ho.error(s),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,s){return this.debug("breakpoint",{id:e,mode:t,action:s}).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=oi(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>yo(t,e))}debugPrint(e,t=0,s=10){return this.debug("print",{edgeID:e,startRow:t,numRows:s}).then(e=>e.children().map(e=>{const t={};return e.children().forEach(e=>{t[e.name]=e.content}),t}))}};n(mo,"Workunit");let So=mo;const fo="definition";function _o(e){return void 0!==e._[fo]}function Uo(e){const t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[fo]);if(t){const[,s,n,r]=t;return s.replace(/\/\.\//g,"/"),{id:e._.id,file:s,line:+n,column:+r}}throw new Error(`Bad definition: ${e._[fo]}`)}function yo(e,t){const s=[];for(const n of e.vertices)if(_o(n)){const e=Uo(n);(e&&!t||t===e.file)&&s.push(e)}return s.sort((e,t)=>e.line-t.line)}let vo;n(_o,"hasECLDefinition"),n(Uo,"getECLDefinition"),n(yo,"breakpointLocations");const Co=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 vo||(vo=new _Activity(e)),t&&vo.set(t),vo}constructor(e){super(),this.connection=e instanceof Qn?e:new Qn(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>""===e||t.ClusterName===e).map(e=>So.attach(this.connection.connectionOptions(),e.Wuid,e))}setBanner(e){return this.connection.SetBanner({...e}).then(e=>(this.set(e),this))}lazyRefresh=t.debounce(async()=>{const e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};n(Co,"Activity");let Do=Co;const Ro=t.scopedLogger("logicalFile.ts"),Wo=class _LogicalFileCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}};n(Wo,"LogicalFileCache");let bo=Wo;const Fo=new bo,To=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,s,n){const r=Fo.get({BaseUrl:e.baseUrl,Cluster:t,Name:s},()=>new _LogicalFile(e,t,s));return n&&r.set(n),r}constructor(e,t,s){super(),this.connection=e instanceof xe?e:new xe(e),this.clear({Cluster:t,Name:s})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){const e=[];for(const t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(const s of t?.DFUFileParts?.DFUPart||[]){const n={...t,...s};delete n.DFUFileParts,e.push(n)}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 Ro.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||[])}};n(To,"LogicalFile");let Ao=To;const Lo=class _MachineCache extends t.Cache{constructor(){super(e=>e.Address)}};n(Lo,"MachineCache");let wo=Lo;const xo=new wo,Po=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,s){const n=xo.get({Address:t},()=>new _Machine(e));return s&&n.set(s),n}constructor(e){super(),this.connection=e instanceof vt?e:new vt(e)}};n(Po,"Machine");let Mo=Po;const Eo=class _TargetClusterCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}};n(Eo,"TargetClusterCache");let No=Eo;const Io=new No,jo=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=>Mo.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){const n=Io.get({BaseUrl:e.baseUrl,Name:t},()=>new _TargetCluster(e,t));return s&&n.set(s),n}constructor(e,t){super(),e instanceof Kn?(this.connection=e,this.machineConnection=new vt(e.connectionOptions())):(this.connection=new Kn(e),this.machineConnection=new vt(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(e=>{const t=[];for(const s of e.TargetClusterInfoList.TargetClusterInfo)for(const e of s.Processes.MachineInfoEx)t.push(e);return this.set("MachineInfoEx",t),this.CMachineInfoEx})}machineStats(){let e=0,t=0,s=0;for(const n of this.CMachineInfoEx)for(const r of n.Storage.StorageInfo){t+=r.Available,s+=r.Total;const n=1-r.Available/r.Total;n>e&&(e=n)}return{maxDisk:e,meanDisk:1-(s?t/s:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};n(jo,"TargetCluster");let ko=jo;function Go(e){let t;return t=e instanceof Kn?e:new Kn(e),t.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(t=>ko.attach(e,t.Name,t)))}n(Go,"targetClusters");const Vo={};function Qo(e){if(!Vo[e.baseUrl]){let t;t=e instanceof Kn?e:new Kn(e),Vo[e.baseUrl]=t.TpListTargetClusters({}).then(t=>{let s,n,r;t.TargetClusters.TpClusterNameType.forEach(e=>{s||(s=e),n||!0!==e.IsDefault||(n=e),r||"hthor"!==e.Type||(r=e)});const i=n||r||s;return ko.attach(e,i.Name,i)})}return Vo[e.baseUrl]}n(Qo,"defaultTargetCluster");const Bo=class _TopologyCache extends t.Cache{constructor(){super(e=>e.BaseUrl)}};n(Bo,"TopologyCache");let Oo=Bo;const Xo=new Oo,Ho=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=>ko.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){const s=Xo.get({BaseUrl:e.baseUrl},()=>new _Topology(e));return t&&s.set(t),s}constructor(e){super(),this.connection=e instanceof Kn?e:new Kn(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(s=>{const n=this.connection.protocol(),r=this.connection.ip();let i="https:"===n?"18002":"8002";if(t.exists("ServiceList.TpEspServers.TpEspServer",s))for(const o of s.ServiceList.TpEspServers.TpEspServer)if(t.exists("TpBindings.TpBinding",o))for(const t of o.TpBindings.TpBinding)t.Service===e&&t.Protocol+":"===n&&(i=t.Port);return`${n}//${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,s){if(this.isCallback(t)){if("changed"===e)super.on(e,t)}else if("changed"===e)super.on(e,t,s);return this._monitor(),this}};n(Ho,"Topology");let $o=Ho;function Jo(e,t,s){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=s)}function qo(e){return(e=""+e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;")}function Yo(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);if(!t)return 0;return 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}function zo(e,t){const s=e.indexOf(t);return-1!==s?parseFloat(e.substring(0,s)):-1}function Zo(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);let t=zo(e,"Kb");return t>=0?1024*t:(t=zo(e,"Mb"),t>=0?t*Math.pow(1024,2):(t=zo(e,"Gb"),t>=0?t*Math.pow(1024,3):(t=zo(e,"Tb"),t>=0?t*Math.pow(1024,4):(t=zo(e,"Pb"),t>=0?t*Math.pow(1024,5):(t=zo(e,"Eb"),t>=0?t*Math.pow(1024,6):(t=zo(e,"Zb"),t>=0?t*Math.pow(1024,7):(t=zo(e,"b"),t>=0?t:0)))))))}function Ko(e){return e?parseFloat(e):0}n(Jo,"safeAssign"),n(qo,"xmlEncode"),n(Yo,"espTime2Seconds"),n(zo,"unitTest"),n(Zo,"espSize2Bytes"),n(Ko,"espSkew2Number");const ec=class _LocalisedXGMMLWriter{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,s,n){this.noSpills=n,e.forEach(e=>{this.graph.isVertex(e)?(this.calcInVertexVisibility(e,s),this.calcOutVertexVisibility(e,s)):this.graph.isEdge(e)?(this.calcInVertexVisibility(e.getSource(),s-1),this.calcOutVertexVisibility(e.getTarget(),s-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,s)=>{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 s={};this.graph.edges.forEach((t,n)=>{t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===this.getCommonAncestor(t)&&(s[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]||(s[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[t.__hpcc_id]=t))})}buildVertexString(e,t){let s="",n="";const r=e.getProperties();for(const i in r)t&&i.indexOf("_kind")>=0?n+='<att name="_kind" value="point"/>':"id"===i||"label"===i?s+=" "+i+'="'+qo(r[i])+'"':n+='<att name="'+i+'" value="'+qo(r[i])+'"/>';return"<node"+s+">"+n+"</node>"}buildEdgeString(e){let t="",s="";const n=e.getProperties();for(const r in n)"id"===r.toLowerCase()||"label"===r.toLowerCase()||"source"===r.toLowerCase()||"target"===r.toLowerCase()?t+=" "+r+'="'+qo(n[r])+'"':s+='<att name="'+r+'" value="'+qo(n[r])+'"/>';return"<edge"+t+">"+s+"</edge>"}getAncestors(e,t){let s=e.__hpcc_parent;for(;s;)t.push(s),s=s.__hpcc_parent}getCommonAncestorV(e,t){const s=[],n=[];this.getAncestors(e,s),this.getAncestors(t,n);let r=s.length-1,i=n.length-1,o=null;for(;r>=0&&i>=0&&s[r]===n[i];)o=s[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 s=t.getSource();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){const e=s.getInEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),s=e[0].getSource(),this.addSemiVisibleVertex(s)}let n=t.getTarget();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){const e=n.getOutEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),n=e[0].getTarget(),this.addSemiVisibleVertex(n)}}}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 s="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';const n=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),n===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)s+='<att name="'+e+'" value="'+qo(r[e])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+s+"</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))}};n(ec,"LocalisedXGMMLWriter");let tc=ec;const sc=class _GraphItem{__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}};n(sc,"GraphItem");let nc=sc;const rc=class _Subgraph extends nc{_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,s)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,s)=>{e.vertexVisited(t)})}};n(rc,"Subgraph");let ic=rc;const oc=class _Vertex extends nc{_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)}};n(oc,"Vertex");let cc=oc;const ac=class _Edge extends nc{_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]}};n(ac,"Edge");let uc=ac;const hc=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 ic}isVertex(e){return e instanceof cc}isEdge(e){return e instanceof uc}getGlobalType(e){return e instanceof cc?3:e instanceof uc?4:e instanceof ic?2:e instanceof _QueryGraph?1:0}getGlobalTypeString(e){return e instanceof cc?"Vertex":e instanceof uc?"Edge":e instanceof ic?"Cluster":e instanceof _QueryGraph?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":const e=new ic(this,t);this.subgraphs.push(e),this.idx[t]=e;break;case"node":const s=new cc(this,t);this.vertices.push(s),this.idx[t]=s;break;case"edge":const n=new uc(this,t);this.edges.push(n),this.idx[t]=n;break;default:console.warn("Graph.getItem - Unknown Node Type!")}const s=this.idx[t];return Array.from(e.attributes).forEach(e=>{Jo(s,e.name,e.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof ic?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof cc?this.vertices=this.vertices.filter(t=>e!==t):e instanceof uc&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let s=null;return Array.from(e.childNodes).some(e=>{if(e.tagName===t)return s=e,!0}),s}walkDocument(e,t){const s=this.getItem(e,t);return e.childNodes.forEach(e=>{if(1===e.nodeType)switch(e.tagName){case"graph":break;case"node":let t=!1;const n=this.getChildByTagName(e,"att");if(n){const r=this.getChildByTagName(n,"graph");if(r){t=!0;const n=this.walkDocument(r,e.getAttribute("id"));s.addSubgraph(n)}}if(!t){const t=this.walkDocument(e,e.getAttribute("id"));s.addVertex(t)}break;case"att":const r=e.getAttribute("name"),i="_"+r,o=e.getAttribute("value");0===r.indexOf("Time")?(Jo(s,i,o),Jo(s,r,""+Yo(o))):0===r.indexOf("Size")?(Jo(s,i,o),Jo(s,r,""+Zo(o))):0===r.indexOf("Skew")?(Jo(s,i,o),Jo(s,r,""+Ko(o))):Jo(s,r,o);break;case"edge":const c=this.walkDocument(e,e.getAttribute("id"));if(void 0!==c.NumRowsProcessed?c._eclwatchCount=c.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==c.Count?c._eclwatchCount=c.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==c.count&&(c._eclwatchCount=c.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),c.inputProgress&&(c._eclwatchInputProgress="["+c.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),c.SkewMaxRowsProcessed&&c.SkewMinRowsProcessed&&(c._eclwatchSkew="+"+c.SkewMaxRowsProcessed+", "+c.SkewMinRowsProcessed),c._dependsOn);else if(c._childGraph);else if(c._sourceActivity||c._targetActivity){c._isSpill=!0;const e=c.getSource();e&&(e._isSpill=!0);const t=c.getTarget();t&&(t._isSpill=!0)}s.addEdge(c)}}),s}removeSubgraphs(){[...this.subgraphs].forEach(e=>{e.__hpcc_parent instanceof ic&&e.remove()})}removeSpillVertices(){[...this.vertices].forEach(e=>{e.isSpill()&&e.remove()})}getLocalisedXGMML(e,t,s,n){const r=new tc(this);return r.calcVisibility(e,t,s,n),r.writeXgmml(),"<graph>"+r.m_xgmml+"</graph>"}};n(hc,"QueryGraph");let lc=hc;const dc=t.scopedLogger("@hpcc-js/comms/ecl/query.ts"),pc=Vr("~s");function gc(e){return!isNaN(parseFloat(e))&&!isNaN(e-0)}n(gc,"isNumber");const mc=class _QueryCache extends t.Cache{constructor(){super(e=>t.Cache.hash([e.QueryId,e.QuerySet]))}};n(mc,"QueryCache");const Sc=new mc,fc=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,s,n){super(),this.wsWorkunitsService=e instanceof Dr?e:new Dr(e),this.topology=$o.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...n})}static attach(e,t,s,n){const r=Sc.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:s},()=>new _Query(e,t,s));return n&&r.set(n),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){const t=`${e.Protocol}://${globalThis.location.hostname}:${e.Port}`;return new Ve({baseUrl:t})}})),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){dc.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){dc.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 lc;let s=!0;for(const n of e?.Graphs?.ECLGraphEx||[])s?(t.load(n.Graph),s=!1):t.merge(n.Graph);return t})}fetchDetailsNormalized(e={}){const t=So.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(e=>{const s=e[0],n=e[1],r=e[2].map(e=>{const t=e.Id[0];if("a"===t||"e"===t){const t=s.idx[e.Id.substring(1)];if(!t)return dc.debug(`Missing graph data for metric ID: ${e.Id}`),e;const n=new Set(e.Properties.Property.map(e=>e.Name)),r=[];for(const e in t){const s=e.charAt(0);if("_"!==s&&s===s.toUpperCase()&&!n.has(e)){const s=t[e],n=typeof s;if("string"===n||"number"===n||"boolean"===n){let t=gc(s)?parseFloat(s):s,n=s;e.indexOf("Time")>=0&&(t/=1e9,n=pc(t)+"s"),r.push({Name:e,RawValue:t,Formatted:n})}}}r.length>0&&e.Properties.Property.push(...r)}return e});return t.normalizeDetails(n,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(s){return dc.debug(s.message??s),[]}}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]:[]}};n(fc,"Query");let _c=fc;const Uc=class _StoreCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}};n(Uc,"StoreCache");let yc=Uc;const vc=new yc,Cc=class _ValueChangedMessage extends t.Message{constructor(e,t,s){super(),this.key=e,this.value=t,this.oldValue=s}get canConflate(){return!0}conflate(e){return this.key===e.key&&(this.value=e.value,!0)}void(){return this.value===this.oldValue}};n(Cc,"ValueChangedMessage");let Dc=Cc;const Rc=class _Store{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new t.Dispatch;static attach(e,t="HPCCApps",s,n=!0){return vc.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:n,Namespace:s},()=>new _Store(e,t,s,n))}constructor(e,t,s,n){this.connection=e instanceof Hn?e:new Hn(e),this.Name=t,this.UserSpecific=n,this.Namespace=s}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,s=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(n=>{const r=this._knownValues[e];this._knownValues[e]=t,s&&this._dispatch.post(new Dc(e,t,r))}).catch(s=>{console.error(`Store.set("${e}", "${t}") failed:`,s)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{const n=this._knownValues[e];return this._knownValues[e]=s.Value,t&&this._dispatch.post(new Dc(e,s.Value,n)),s.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 s={},n=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(t=>{const r=this._knownValues[t.Key];this._knownValues[t.Key]=t.Value,delete n[t.Key],s[t.Key]=t.Value,e&&this._dispatch.post(new Dc(t.Key,t.Value,r))}),e)for(const e in n)this._dispatch.post(new Dc(e,void 0,n[e]));return s}).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(s=>{const n=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new Dc(e,void 0,n))}).catch(t=>{console.error(`Store.delete(${e}) failed:`,t)})}monitor(e){return this._dispatch.attach(e)}};n(Rc,"Store");let Wc=Rc;const bc=t.scopedLogger("@hpcc-js/comms/dfuWorkunit.ts"),Fc=class _DFUWorkunitCache extends t.Cache{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}};n(Fc,"DFUWorkunitCache");let Tc=Fc;const Ac=new Tc,Lc=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",0)}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 s=new _DFUWorkunit(e);return s.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(e=>(Ac.set(s),s.set(e.result),s))}static attach(e,t,s){const n=Ac.get({BaseUrl:e.baseUrl,ID:t},()=>new _DFUWorkunit(e,t));return s&&n.set(s),n}static sprayFixed(e,t){const s=new k(e);return s.SprayFixedEx({...t}).then(t=>{const n=t.wuid;return s.GetDFUWorkunit({wuid:n}).then(t=>_DFUWorkunit.attach(e,n,t.result))})}static sprayVariable(e,t){const s=new k(e);return s.SprayVariableEx({...t}).then(t=>{const n=t.wuid;return s.GetDFUWorkunit({wuid:n}).then(t=>_DFUWorkunit.attach(e,n,t.result))})}static despray(e,t){const s=new k(e);return s.DesprayEx({...t}).then(t=>{const n=t.wuid;return s.GetDFUWorkunit({wuid:n}).then(t=>_DFUWorkunit.attach(e,n,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 6:case 5:case 4:case 999:return!0}return!1}isFailed(){return!(!this.isComplete()||6===this.State)}isDeleted(){return 999===this.State}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(e.FileSpray.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(t){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:t}).then(s=>t===e.FileSpray.DFUWUActions.Delete?s:this.refresh().then(()=>(this._monitor(),s)))}on(e,t,s){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,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{const n=this.watch(s=>{e&&e(s),(this.isComplete()||this.isRunning())&&(n.release(),t(this))})})}constructor(e,t){super(),this.connection=new k(e),this.topologyConnection=new Kn(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:0})}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",999),!0)))throw bc.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}};n(Lc,"DFUWorkunit");let wc=Lc;e.AccessService=q,e.AccountService=K,e.Activity=Do,e.Attribute=Gi,e.BUILD_VERSION="3.21.2",e.BaseScope=Qi,e.CloudService=ce,e.CodesignService=de,e.Connection=v,e.DFUArrayActions=Fe,e.DFUChangeProtection=Ae,e.DFUChangeRestriction=Le,e.DFUDefFileFormat=Te,e.DFUService=xe,e.DFUWUTypes=I,e.DFUWorkunit=wc,e.DFUWorkunitCache=Tc,e.DFUXRefService=Ne,e.DaliService=Se,e.ECLGraph=$r,e.ESPConnection=A,e.ESPExceptions=W,e.EclService=Ve,e.ElkService=Xe,e.FileSprayService=k,e.FileSprayStates=N,e.GlobalResultCache=Pi,e.GraphCache=qr,e.LogType=rt,e.LogaccessService=ct,e.LogicalFile=Ao,e.LogicalFileCache=bo,e.Machine=Mo,e.MachineCache=wo,e.MachineService=vt,e.PKG_NAME="@hpcc-js/comms",e.PKG_VERSION="3.15.1",e.PackageProcessService=Wt,e.PropertyType=to,e.Query=_c,e.QueryGraph=lc,e.RelatedProperty=so,e.Resource=fi,e.ResourcesService=At,e.Result=Ni,e.ResultCache=ji,e.SMCService=Qn,e.SashaService=Et,e.Scope=Oi,e.ScopeEdge=gi,e.ScopeGraph=ai,e.ScopeSubgraph=hi,e.ScopeVertex=di,e.Service=w,e.SourceFile=Hi,e.Store=Wc,e.StoreCache=yc,e.StoreService=Hn,e.TargetAudience=it,e.TargetCluster=ko,e.TargetClusterCache=No,e.Timer=Ji,e.Topology=$o,e.TopologyCache=Oo,e.TopologyService=Kn,e.ValueChangedMessage=Dc,e.WUStateID=_r,e.Workunit=So,e.WorkunitCache=po,e.WorkunitsService=Dr,e.WorkunitsServiceEx=Wr,e.XGMMLEdge=ii,e.XGMMLGraph=Kr,e.XGMMLSubgraph=ti,e.XGMMLVertex=ni,e.XSDNode=Ui,e.XSDSchema=Wi,e.XSDSimpleType=Di,e.XSDXMLNode=vi,e.createGraph=mi,e.createXGMMLGraph=oi,e.defaultTargetCluster=Qo,e.deserializeResponse=h,e.get=S,e.hookSend=U,e.instanceOfIConnection=c,e.instanceOfIOptions=i,e.isArray=D,e.isECLResult=Ur,e.isExceptions=b,e.isWUInfoWorkunit=vr,e.isWUQueryECLWorkunit=yr,e.jsonp=l,e.parseXSD=Ti,e.parseXSD2=wi,e.post=m,e.send=f,e.serializeRequest=u,e.setTransportFactory=C,e.splitMetric=oo,e.targetClusters=Go,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=index.umd.cjs.map