@hpcc-js/comms 3.7.4 → 3.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +9 -5
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.cjs +2 -2
- package/dist/browser/index.umd.cjs.map +1 -1
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.cjs.map +2 -2
- package/dist/node/index.js +2 -2
- package/dist/node/index.js.map +2 -2
- package/package.json +4 -4
- package/src/__package__.ts +2 -2
- package/src/ecl/logicalFile.ts +2 -1
- package/types/__package__.d.ts +2 -2
package/dist/node/index.js
CHANGED
|
@@ -968,12 +968,12 @@ AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsC
|
|
|
968
968
|
MGclCrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVu
|
|
969
969
|
Sw==
|
|
970
970
|
-----END CERTIFICATE-----
|
|
971
|
-
`;var Qd=sn(b0(),1);var sj="@hpcc-js/comms",ij="3.7.4",oj="3.8.4";var R0=kt("comms/connection.ts");function uj(t){return"baseUrl"in t}var hq={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function cj(t){return typeof t.opts=="function"&&typeof t.send=="function"&&typeof t.clone=="function"}function On(t,e){return e===void 0||e===!0?encodeURIComponent(t):""+t}function Xi(t,e=!0,r=""){if(r&&(r+="."),typeof t!="object")return On(t,e);let n=[];for(let s in t)if(t.hasOwnProperty(s))if(t[s]instanceof Array){let i=!1;t[s].forEach((A,u)=>{typeof A=="object"?(i=!0,n.push(Xi(A,e,r+On(`${s}.${u}`,e)))):n.push(r+On(`${s}_i${u}`,e)+"="+Xi(A,e))}),i&&n.push(r+On(`${s}.itemcount`,e)+"="+t[s].length)}else typeof t[s]=="object"?t[s]&&t[s].Item instanceof Array?(n.push(Xi(t[s].Item,e,r+On(s,e))),n.push(r+On(`${s}.itemcount`,e)+"="+t[s].Item.length)):n.push(Xi(t[s],e,r+On(s,e))):t[s]!==void 0?n.push(r+On(s,e)+"="+On(t[s],e)):n.push(r+On(s,e));return n.join("&")}function dq(t){return JSON.parse(t)}function pq(t,e,r={},n="json",s){return s&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,A)=>{let u=t.timeoutSecs*1e3,c=5e3,g="jsonp_callback_"+Math.round(Math.random()*999999);window[g]=function(E){u=0,B(),i(n==="json"&&typeof E=="string"?dq(E):E)};let l=document.createElement("script"),d=ns(t.baseUrl,e);d+=d.indexOf("?")>=0?"&":"?",l.src=d+"jsonp="+g+"&"+Xi(r,t.encodeRequest),document.body.appendChild(l);let p=setInterval(function(){u<=0?clearInterval(p):(u-=c,u<=0?(clearInterval(p),R0.error("Request timeout: "+l.src),B(),A(Error("Request timeout: "+l.src))):R0.debug("Request pending ("+u/1e3+" sec): "+l.src))},c);function B(){delete window[g],document.body.removeChild(l)}})}function fq(t){return t.userID?{Authorization:`Basic ${btoa(`${t.userID}:${t.password}`)}`}:{}}var yh={};function F0(t,e,r,n,s){n={...fq(t),...n},r={credentials:yh[t.baseUrl]?"omit":"include",...r,headers:n},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),t.baseUrl.indexOf("https:")===0&&(t.rejectUnauthorized===!1&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):r.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(r.agent=fetch.__trustwaveAgent));function i(A){if(A.ok)return s==="json"?A.json():A.text();throw new Error(A.statusText)}return UI(t.timeoutSecs*1e3,fetch(ns(t.baseUrl,e),r).then(i).catch(A=>(r.credentials=yh[t.baseUrl]?"include":"omit",fetch(ns(t.baseUrl,e),r).then(i).then(u=>(yh[t.baseUrl]=!yh[t.baseUrl],u)))))}function Eq(t,e,r,n="json",s){r.upload_&&(delete r.upload_,e+="?upload_");let i;return r.abortSignal_&&(i=r.abortSignal_,delete r.abortSignal_),F0(t,e,{method:"post",body:Xi(r,t.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...s},n)}function Cq(t,e,r,n="json",s){let i;return r.abortSignal_&&(i=r.abortSignal_,delete r.abortSignal_),F0(t,`${e}?${Xi(r,t.encodeRequest)}`,{method:"get",signal:i},{...s},n)}function Bq(t,e,r,n="json",s){let i;switch(t.type){case"jsonp":i=pq(t,e,r,n,s);break;case"get":i=Cq(t,e,r,n,s);break;case"post":default:i=Eq(t,e,r,n,s);break}return i}var wh=Bq;function lj(t){let e=wh;return t&&(wh=t),e}var $C=class t{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...hq,...e},this)}send(e,r,n="json",s){return this._opts.hookSend?this._opts.hookSend(this._opts,e,r,n,wh,s):wh(this._opts,e,r,n,s)}clone(){return new t(this.opts())}},Sh=function(t){return new $C(t)};function gj(t){let e=Sh;return Sh=t,e}function Iq(t){return Object.prototype.toString.call(t)==="[object Array]"}var Zi=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,r,n){super("ESPException: "+n.Source),this.action=e,this.request=r,this.Source=n.Source,this.Exception=n.Exception,n.Exception.length?this.message=`${n.Exception[0].Code}: ${n.Exception[0].Message}`:this.message=""}};function Bj(t){return t instanceof Zi||t.isESPExceptions&&Array.isArray(t.Exception)}function Qq(t){return t.send!==void 0}var Ku=class t{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,r,n){this._connection=Qq(e)?e:Sh(e),this._service=r,this._version=n}service(e){return e===void 0?this._service:(this._service=e,this)}version(e){return e===void 0?this._version:(this._version=e,this)}toESPStringArray(e,r){if(Iq(e[r])){for(let n=0;n<e[r].length;++n)e[r+"_i"+n]=e[r][n];delete e[r]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,r={},n="json",s=!1,i,A){let u={...r,ver_:this._version};s&&(u.upload_=!0),i&&(u.abortSignal_=i);let c,g="json";switch(n){case"text":c=ns(this._service,e),g="text";break;case"xsd":c=ns(this._service,e+".xsd"),g="text";break;case"json2":c=ns(this._service,e+"/json"),n="json",e=e.split("/").pop();break;default:c=ns(this._service,e+".json")}return this._connection.send(c,u,g).then(l=>{if(n==="json"){let d;if(l&&l.Exceptions)throw new Zi(e,u,l.Exceptions);if(l&&(d=l[A||e+"Response"]),!d)throw new Zi(e,u,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return d}return l})}clone(){return new t(this._connection.clone(),this._service,this._version)}},Re=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,r,n){this._connection=new Ku(e,r,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var $u;(e=>{let t;(c=>(c.Delete="Delete",c.Protect="Protect",c.Unprotect="Unprotect",c.Restore="Restore",c.SetToFailed="SetToFailed",c.Archive="Archive"))(t=e.DFUWUActions||={})})($u||={});var bh=class extends Re{constructor(e){super(e,"FileSpray","1.26")}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")}};var mq=(l=>(l[l.unknown=0]="unknown",l[l.scheduled=1]="scheduled",l[l.queued=2]="queued",l[l.started=3]="started",l[l.aborted=4]="aborted",l[l.failed=5]="failed",l[l.finished=6]="finished",l[l.monitoring=7]="monitoring",l[l.aborting=8]="aborting",l[l.notfound=999]="notfound",l))(mq||{}),Ki=class extends bh{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")}};var U0;(A=>{let t;(g=>(g.User="User",g.Group="Group"))(t=A.ViewMemberType||={});let e;(p=>(p.username="username",p.fullname="fullname",p.passwordexpiration="passwordexpiration",p.employeeID="employeeID",p.employeeNumber="employeeNumber"))(e=A.UserSortBy||={});let r;(g=>(g.Name="Name",g.ManagedBy="ManagedBy"))(r=A.GroupSortBy||={});let n;(l=>(l.Any="Any",l.User="User",l.Group="Group"))(n=A.AccountTypeReq||={});let s;(g=>(g.Name="Name",g.Type="Type"))(s=A.ResourcePermissionSortBy||={});let i;(c=>c.Name="Name")(i=A.ResourceSortBy||={})})(U0||={});var Rh=class extends Re{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")}};var N0=class extends Rh{};var Fh=class extends Re{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")}};var T0=class extends Fh{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(r=>{if(r.isESPExceptions&&r.Exception.some(n=>n.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:r.Exception}};throw r})}};var Uh=class extends Re{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")}};var Dq=kt("@hpcc-js/comms/services/wsCloud.ts");function yq(t){return t?.Pods!==void 0}function wq(t){return t.spec?.containers?.reduce((e,r)=>(r.ports?.forEach(n=>{e.push({ContainerPort:n.containerPort,Name:n.name,Protocol:n.protocol})}),e),[])??[]}function Sq(t){return t.filter(e=>{let r=e?.metadata?.labels??{};return r.hasOwnProperty("app.kubernetes.io/part-of")&&r["app.kubernetes.io/part-of"]==="HPCC-Platform"}).map(e=>{let r=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:r.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((n,s)=>(s.name&&n.push(s.name),n),[]).join(", ")??"",ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((n,s)=>n+(s.ready?1:0),0),ContainerRestartCount:e.status?.containerStatuses?.reduce((n,s)=>n+s.restartCount,0),Ports:{Port:wq(e)}}})}var M0=class extends Uh{getPODs(){return super.GetPODs({}).then(e=>{if(yq(e))return e.Pods?.Pod??[];try{let r=typeof e.Result=="string"?JSON.parse(e.Result):e.Result;return Sq(r?.items??[])}catch(r){return Dq.error(`Error parsing V1Pods json '${r instanceof Error?r.message:String(r)}'`),[]}})}};var x0=class{_connection;constructor(e){this._connection=new Ku(e,"ws_codesign","1.1")}connectionOptions(){return this._connection.opts()}ListUserIDs(e){return this._connection.send("ListUserIDs",e).then(r=>r.UserIDs.Item).catch(r=>[])}Sign(e){return this._connection.send("Sign",{SigningMethod:"gpg",...e})}Verify(e){return this._connection.send("Verify",e)}};var Nh=class extends Re{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")}};var k0=class extends Nh{};var OA;(u=>{let t;(p=>(p.Delete="Delete",p.AddToSuperfile="Add To Superfile",p.ChangeProtection="Change Protection",p.ChangeRestriction="Change Restriction"))(t=u.DFUArrayActions||={});let e;(p=>(p[p.NoChange=0]="NoChange",p[p.Protect=1]="Protect",p[p.Unprotect=2]="Unprotect",p[p.UnprotectAll=3]="UnprotectAll"))(e=u.DFUChangeProtection||={});let r;(d=>(d[d.NoChange=0]="NoChange",d[d.Restrict=1]="Restrict",d[d.Unrestricted=2]="Unrestricted"))(r=u.DFUChangeRestriction||={});let n;(l=>(l.xml="xml",l.def="def"))(n=u.DFUDefFileFormat||={});let s;(d=>(d.Token="Token",d.Engine="Engine",d.External="External"))(s=u.FileAccessRole||={});let i;(B=>(B.None="None",B.Access="Access",B.Read="Read",B.Write="Write",B.Full="Full"))(i=u.SecAccessType||={});let A;(D=>(D.Flat="Flat",D.Index="Index",D.Xml="Xml",D.Csv="Csv",D.Json="Json",D.IndexLocal="IndexLocal",D.IndexPartitioned="IndexPartitioned",D.Unset="Unset"))(A=u.DFUFileType||={})})(OA||={});var Th=class extends Re{constructor(e){super(e,"WsDfu","1.65")}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")}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")}};var Xj=OA.DFUArrayActions,Zj=OA.DFUDefFileFormat,Kj=OA.DFUChangeProtection,$j=OA.DFUChangeRestriction,ec=class extends Th{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){let r=[],n=[];return await Promise.all(e.map(s=>this.DFUInfo({Cluster:s.NodeGroup,Name:s.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(i=>{for(let A of i?.FileDetail?.Superfiles?.DFULogicalFile??[])r.push(A);for(let A of i?.FileDetail?.subfiles?.Item??[])n.push(A)}))),n.concat(r.length?await this.recursiveFetchLogicalFiles(r):[])}};var W0=class extends Re{constructor(e){super(e,"WsDFUXRef","1.01")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e)}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e)}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e)}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e)}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e={}){return this._connection.send("DFUXRefList",e)}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e)}};function L0(t,e){let r=typeof e;switch(r){case"boolean":case"number":case"string":return{id:t,type:r};case"object":if(e.Row instanceof Array&&(e=e.Row),e instanceof Array)return{id:t,type:"dataset",children:eB(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let n=typeof e.Item[0];if(n==="string"||n==="number")return{id:t,type:"set",fieldType:n};throw new Error("Unknown field type")}return{id:t,type:"object",fields:bq(e)}}default:throw new Error("Unknown field type")}}function eB(t){t.Row&&t.Row instanceof Array&&(t=t.Row[0]);let e=[];for(let r in t)e.push(L0(r,t[r]));return e}function bq(t){let e={};for(let r in t)e[r]=L0(r,t[r]);return e}var Mh=class extends Re{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,r){return this._connection.send(`example/request/query/${e}/${r}/json`,{},"text").then(n=>{let s=JSON.parse(n);for(let i in s)return s[i];return{}}).then(eB)}responseJson(e,r){return this._connection.send(`example/response/query/${e}/${r}/json`,{},"text").then(n=>{let s=JSON.parse(n);for(let i in s)return s[i].Results;return{}}).then(n=>{let s={};for(let i in n)s[i]=eB(n[i]);return s})}submit(e,r,n){let s=`submit/query/${e}/${r}`;return this._connection.send(s,n,"json2").then(i=>{if(i.Results&&i.Results.Exception)throw new Zi(s,n,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var xh=class extends Re{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e)}Ping(e){return this._connection.send("Ping",e)}};var v0=class extends xh{};var Ct;(c=>{let t;(J=>(J.global="global",J.workunits="workunits",J.components="components",J.audience="audience",J.class="class",J.instance="instance",J.node="node",J.message="message",J.logid="logid",J.processid="processid",J.threadid="threadid",J.timestamp="timestamp",J.pod="pod",J.traceid="traceid",J.spanid="spanid"))(t=c.LogColumnType||={});let e;(E=>(E.string="string",E.numeric="numeric",E.datetime="datetime",E.enum="enum",E.epoch="epoch"))(e=c.LogColumnValueType||={});let r;(y=>(y[y.All=0]="All",y[y.ByJobID=1]="ByJobID",y[y.ByComponent=2]="ByComponent",y[y.ByLogType=3]="ByLogType",y[y.ByTargetAudience=4]="ByTargetAudience",y[y.BySourceInstance=5]="BySourceInstance",y[y.BySourceNode=6]="BySourceNode",y[y.ByFieldName=7]="ByFieldName",y[y.ByPod=8]="ByPod",y[y.ByTraceID=9]="ByTraceID",y[y.BySpanID=10]="BySpanID"))(r=c.LogAccessType||={});let n;(p=>(p[p.Success=0]="Success",p[p.Warning=1]="Warning",p[p.Fail=2]="Fail"))(n=c.LogAccessStatusCode||={});let s;(p=>(p[p.NONE=0]="NONE",p[p.AND=1]="AND",p[p.OR=2]="OR"))(s=c.LogAccessFilterOperator||={});let i;(B=>(B[B.MIN=0]="MIN",B[B.DEFAULT=1]="DEFAULT",B[B.ALL=2]="ALL",B[B.CUSTOM=3]="CUSTOM"))(i=c.LogSelectColumnMode||={});let A;(y=>(y[y.ByDate=0]="ByDate",y[y.ByJobID=1]="ByJobID",y[y.ByComponent=2]="ByComponent",y[y.ByLogType=3]="ByLogType",y[y.ByTargetAudience=4]="ByTargetAudience",y[y.BySourceInstance=5]="BySourceInstance",y[y.BySourceNode=6]="BySourceNode",y[y.ByFieldName=7]="ByFieldName",y[y.ByPod=8]="ByPod",y[y.ByTraceID=9]="ByTraceID",y[y.BySpanID=10]="BySpanID"))(A=c.SortColumType||={});let u;(d=>(d[d.ASC=0]="ASC",d[d.DSC=1]="DSC"))(u=c.SortDirection||={})})(Ct||={});var kh=class extends Re{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")}};var P0=kt("@hpcc-js/comms/services/wsLogaccess.ts");var Rq=(A=>(A.Disaster="DIS",A.Error="ERR",A.Warning="WRN",A.Information="INF",A.Progress="PRO",A.Metric="MET",A))(Rq||{}),Fq=(s=>(s.Operator="OPR",s.User="USR",s.Programmer="PRO",s.Audit="ADT",s))(Fq||{}),G0=class extends kh{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){let r=await this.GetLogAccessInfo(),n={};r.Columns.Column.forEach(u=>n[u.LogType]=u.Name);let s=u=>{let c={};for(let g in n)u?.fields?c[g]=Object.assign({},...u.fields)[n[g]]??"":c[g]="";return c},i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:Ct.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:Ct.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:Ct.SortColumType.ByDate,ColumnName:"",Direction:0}]}},A=[];for(let u in e){let c;u in n&&(Object.values(Ct.LogColumnType).includes(u)?c=u:c=n[u]);let g;if(c){switch(c){case Ct.LogColumnType.workunits:case"hpcc.log.jobid":g=Ct.LogAccessType.ByJobID;break;case Ct.LogColumnType.audience:case"hpcc.log.audience":g=Ct.LogAccessType.ByTargetAudience;break;case Ct.LogColumnType.class:case"hpcc.log.class":g=Ct.LogAccessType.ByLogType;break;case Ct.LogColumnType.components:case"kubernetes.container.name":g=Ct.LogAccessType.ByComponent;break;default:g=Ct.LogAccessType.ByFieldName,c=n[u]}if(Array.isArray(e[u]))e[u].forEach(l=>{g===Ct.LogAccessType.ByComponent&&(l+="*"),A.push({LogCategory:g,SearchField:c,SearchByValue:l})});else{let l=e[u];g===Ct.LogAccessType.ByComponent&&(l+="*"),A.push({LogCategory:g,SearchField:c,SearchByValue:l})}}}if(A.length>2){let u=i.Filter.leftBinaryFilter.BinaryLogFilter[0];A.forEach((c,g)=>{let l=Ct.LogAccessFilterOperator.AND;g>0?(A[g-1].SearchField===c.SearchField&&(l=Ct.LogAccessFilterOperator.OR),g===A.length-1?(u.Operator=l,u.rightFilter=c):(u.Operator=l,u.rightBinaryFilter={BinaryLogFilter:[{leftFilter:c}]},u=u.rightBinaryFilter.BinaryLogFilter[0])):u.leftFilter=c})}else delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:Ct.LogAccessType.All},A[0]?.SearchField&&(i.Filter.leftFilter={LogCategory:A[0]?.LogCategory,SearchField:A[0]?.SearchField,SearchByValue:A[0]?.SearchByValue}),A[1]?.SearchField&&(i.Filter.Operator=Ct.LogAccessFilterOperator.AND,A[0].SearchField===A[1].SearchField&&(i.Filter.Operator=Ct.LogAccessFilterOperator.OR),i.Filter.rightFilter={LogCategory:A[1]?.LogCategory,SearchField:A[1]?.SearchField,SearchByValue:A[1]?.SearchByValue});return e.StartDate&&(i.Range.StartDate=e.StartDate.toISOString()),e.EndDate&&(i.Range.EndDate=e.EndDate.toISOString()),this.GetLogs(i).then(u=>{try{let c=JSON.parse(u.LogLines),g=[];switch(r.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":g=c.lines?.map(s)??[];break;default:P0.warning(`Unknown RemoteLogManagerType: ${r.RemoteLogManagerType}`),g=[]}return{lines:g,total:u.TotalLogLinesAvailable??1e4}}catch(c){P0.error(c.message??c)}return{lines:[],total:0}})}};var ti=sn(_0(),1);var Lh=class extends Re{constructor(e){super(e,"ws_machine","1.17")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e)}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e)}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e)}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e)}GetMetrics(e){return this._connection.send("GetMetrics",e)}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e)}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e)}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e)}Ping(e){return this._connection.send("Ping",e)}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e)}};var ri=class extends Lh{GetTargetClusterUsageEx(e,r=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:r}).then(n=>An("TargetClusterUsages.TargetClusterUsage",n)?n.TargetClusterUsages.TargetClusterUsage:[]).then(n=>n.filter(s=>!!s.ComponentUsages).map(s=>{let i=s.ComponentUsages.ComponentUsage.map(A=>{let u=(A.MachineUsages&&A.MachineUsages.MachineUsage?A.MachineUsages.MachineUsage:[]).map(c=>{let g=c.DiskUsages&&c.DiskUsages.DiskUsage?c.DiskUsages.DiskUsage.map(l=>({...l,InUse:l.InUse*1024,Total:(l.InUse+l.Available)*1024,PercentUsed:100-l.PercentAvailable})):[];return{Name:c.Name,NetAddress:c.NetAddress,Description:c.Description,DiskUsages:g,mean:(0,ti.mean)(g.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed),max:(0,ti.max)(g.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed)}});return{Type:A.Type,Name:A.Name,Description:A.Description,MachineUsages:u,MachineUsagesDescription:u.reduce((c,g)=>c+(g.Description||""),""),mean:(0,ti.mean)(u.filter(c=>!isNaN(c.mean)),c=>c.mean),max:(0,ti.max)(u.filter(c=>!isNaN(c.max)),c=>c.max)}});return{Name:s.Name,Description:s.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((A,u)=>A+(u.MachineUsagesDescription||""),""),mean:(0,ti.mean)(i.filter(A=>!isNaN(A.mean)),A=>A.mean),max:(0,ti.max)(i.filter(A=>!isNaN(A.max)),A=>A.max)}}))}};var vh=class extends Re{constructor(e){super(e,"WsPackageProcess","1.04")}ActivatePackage(e){return this._connection.send("ActivatePackage",e)}AddPackage(e){return this._connection.send("AddPackage",e)}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e)}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e)}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e)}DeletePackage(e){return this._connection.send("DeletePackage",e)}Echo(e){return this._connection.send("Echo",e)}GetPackage(e){return this._connection.send("GetPackage",e)}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e)}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e)}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e)}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e)}ListPackage(e){return this._connection.send("ListPackage",e)}ListPackages(e){return this._connection.send("ListPackages",e)}Ping(e){return this._connection.send("Ping",e)}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e)}ValidatePackage(e){return this._connection.send("ValidatePackage",e)}};var Y0=class extends vh{};var Ph=class extends Re{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)}};var H0=class extends Ph{};var O0;(e=>{let t;(s=>(s.ECL="ECL",s.DFU="DFU"))(t=e.WUTypes||={})})(O0||={});var Gh=class extends Re{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")}};var q0=class extends Gh{};var J0;(r=>{let t;(c=>(c.ALL="ALL",c.READ="READ",c.WRITE="WRITE",c.HOLD="HOLD",c.SUB="SUB"))(t=r.LockModes||={});let e;(d=>(d.Attach="Attach",d.Detach="Detach",d.State="State",d.Reload="Reload",d.ReloadRetry="ReloadRetry",d.MemLock="MemLock",d.MemUnlock="MemUnlock",d.GetMemLocked="GetMemLocked"))(e=r.RoxieControlCmdType||={})})(J0||={});var Vh=class extends Re{constructor(e){super(e,"WsSMC","1.27")}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")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};var tc=class extends Vh{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(r=>({Running:{ActiveWorkunit:[]},...r}))}};var rc=class extends Re{constructor(e){super(e,"WsStore","1")}CreateStore(e){return this._connection.send("Fetch",e)}Delete(e){return this._connection.send("Delete",e).catch(r=>{if(r.isESPExceptions&&r.Exception.some(n=>n.Code===-1))return{Exceptions:void 0,Success:!0};throw r})}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e)}Fetch(e){return this._connection.send("Fetch",e).catch(r=>{if(r.isESPExceptions&&r.Exception.some(n=>n.Code===-1))return{Exceptions:void 0,Value:void 0};throw r})}FetchAll(e){return this._connection.send("FetchAll",e)}FetchKeyMD(e){return this._connection.send("FetchKeyMD",e)}ListKeys(e){return this._connection.send("ListKeys",e)}ListNamespaces(e){return this._connection.send("ListNamespaces",e)}Set(e){return this._connection.send("Set",e)}};var j0;(e=>{let t;(i=>(i.All="All",i.QueriesOnly="QueriesOnly",i.WorkunitsOnly="WorkunitsOnly"))(t=e.RoxieQueueFilter||={})})(j0||={});var _h=class extends Re{constructor(e){super(e,"WsTopology","1.32")}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")}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")}};var Xt=class extends _h{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(r=>{if(r.default)return r.default;let n,s;return r.TpLogicalClusters.TpLogicalCluster.some((i,A)=>(A===0&&(s=i),i.Type==="hthor"?(n=i,!0):!1)),n||s})}};var sr;(D=>{let t;(ie=>(ie.Abort="Abort",ie.Delete="Delete",ie.Deschedule="Deschedule",ie.Reschedule="Reschedule",ie.Pause="Pause",ie.PauseNow="PauseNow",ie.Protect="Protect",ie.Unprotect="Unprotect",ie.Restore="Restore",ie.Resume="Resume",ie.SetToFailed="SetToFailed",ie.Archive="Archive"))(t=D.ECLWUActions||={});let e;(V=>(V[V.MIN=0]="MIN",V[V.DEFAULT=1]="DEFAULT",V[V.ALL=2]="ALL",V[V.CUSTOM=3]="CUSTOM"))(e=D.LogSelectColumnMode||={});let r;(F=>(F[F.ASC=0]="ASC",F[F.DSC=1]="DSC"))(r=D.SortDirection||={});let n;(X=>(X.ALL="ALL",X.DIS="DIS",X.ERR="ERR",X.WRN="WRN",X.INF="INF",X.PRO="PRO",X.MET="MET",X.EVT="EVT"))(n=D.LogEventClass||={});let s;(y=>(y.Single="Single",y.List="List",y.Multi="Multi"))(s=D.WUDetailsAttrValueType||={});let i;(y=>(y.SyntaxCheck="SyntaxCheck",y.Deploy="Deploy",y.Publish="Publish"))(i=D.EclDefinitionActions||={});let A;(y=>(y.xml="xml",y.json="json",y.text="text"))(A=D.ErrorMessageFormat||={});let u;(y=>(y[y.XML=0]="XML",y[y.JSON=1]="JSON",y[y.CSV=2]="CSV"))(u=D.LogAccessLogFormat||={});let c;(V=>(V.info="info",V.warning="warning",V.error="error",V.alert="alert"))(c=D.WUExceptionSeverity||={});let g;(w=>(w.Allqueries="All queries",w.Notsuspended="Not suspended",w.Suspended="Suspended",w.Suspendedbyuser="Suspended by user",w.Suspendedbyfirstnode="Suspended by first node",w.Suspendedbyanynode="Suspended by any node"))(g=D.WUQueryFilterSuspendedType||={});let l;(K=>(K.All="All",K.Id="Id",K.Name="Name",K.Alias="Alias",K.Status="Status"))(l=D.WUQuerySetFilterType||={});let d;(y=>(y.All="All",y.Protected="Protected",y.NotProtected="NotProtected"))(d=D.WUProtectFilter||={});let p;(x=>x.Deactivate="Deactivate")(p=D.QuerySetAliasActionTypes||={});let B;(F=>(F.None="None",F.ActivateImportedActive="ActivateImportedActive"))(B=D.QuerysetImportActivation||={});let E;(X=>(X.Suspend="Suspend",X.Unsuspend="Unsuspend",X.ToggleSuspend="ToggleSuspend",X.Activate="Activate",X.Delete="Delete",X.DeleteQueriesAndWUs="DeleteQueriesAndWUs",X.RemoveAllAliases="RemoveAllAliases",X.ResetQueryStats="ResetQueryStats"))(E=D.QuerySetQueryActionTypes||={});let b;(V=>(V[V.DoNotActivateQuery=0]="DoNotActivateQuery",V[V.ActivateQuery=1]="ActivateQuery",V[V.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",V[V.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(b=D.WUQueryActivationMode||={})})(sr||={});var nc=class extends Re{constructor(e){super(e,"WsWorkunits","2.02")}GVCAjaxGraph(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")}WUAbort(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")}WUAction(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")}WUAddLocalFileToWorkunit(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")}WUCDebug(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")}WUCheckFeatures(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")}WUCompileECL(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")}WUCopyLogicalFiles(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")}WUCreate(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")}WUCreateAndUpdate(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUCreateZAPInfo(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")}WUDelete(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")}WUDeployWorkunit(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")}WUDetails(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")}WUDetailsMeta(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")}WUEclDefinitionAction(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")}WUExport(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")}WUFile(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")}WUFullResult(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")}WUGVCGraphInfo(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")}WUGetGraph(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")}WUGetPlugins(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")}WUGetStats(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")}WUGetThorJobList(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")}WUGetThorJobQueue(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")}WUGraphInfo(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")}WUGraphTiming(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")}WUInfo(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")}WUInfoDetails(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")}WUJobList(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")}WULightWeightQuery(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")}WUListArchiveFiles(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")}WUListQueries(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")}WUListQueriesUsingFile(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")}WUProtect(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")}WUPublishWorkunit(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")}WUPushEvent(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")}WUQuery(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")}WUQueryConfig(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")}WUQueryDetails(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryFiles(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")}WUQueryGetGraph(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")}WUQuerysetExport(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")}WUQuerysetImport(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")}WUQuerysets(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")}WURecreateQuery(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")}WUResubmit(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")}WUResult(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")}WUResultBin(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")}WUResultSummary(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")}WUResultView(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")}WURun(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")}WUSchedule(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")}WUShowScheduled(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")}WUSubmit(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")}WUSyntaxCheckECL(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUUpdateQueryEntry(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")}WUWaitComplete(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")}};var tB=(F=>(F[F.Unknown=0]="Unknown",F[F.Compiled=1]="Compiled",F[F.Running=2]="Running",F[F.Completed=3]="Completed",F[F.Failed=4]="Failed",F[F.Archived=5]="Archived",F[F.Aborting=6]="Aborting",F[F.Aborted=7]="Aborted",F[F.Blocked=8]="Blocked",F[F.Submitted=9]="Submitted",F[F.Scheduled=10]="Scheduled",F[F.Compiling=11]="Compiling",F[F.Wait=12]="Wait",F[F.UploadingFiled=13]="UploadingFiled",F[F.DebugPaused=14]="DebugPaused",F[F.DebugRunning=15]="DebugRunning",F[F.Paused=16]="Paused",F[F.LAST=17]="LAST",F[F.NotFound=999]="NotFound",F))(tB||{}),$i;(e=>{let t;(p=>(p[p.Unknown=0]="Unknown",p[p.Compile=1]="Compile",p[p.Check=2]="Check",p[p.Run=3]="Run",p[p.ExecuteExisting=4]="ExecuteExisting",p[p.Pause=5]="Pause",p[p.PauseNow=6]="PauseNow",p[p.Resume=7]="Resume",p[p.Debug=8]="Debug",p[p.__size=9]="__size"))(t=e.Action||={})})($i||={});function X0(t){return typeof t.Name=="string"}function zz(t){return t.TotalClusterTime!==void 0}function Xz(t){return t.StateEx!==void 0}var _t=class extends nc{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},r){return this._connection.send("WUQuery",e,"json",!1,r).then(n=>qc({Workunits:{ECLWorkunit:[]}},n))}WUInfo(e){let r={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(r)}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,r){return this._connection.send("WUResult",e,"json",!1,r)}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(r=>{let s=jc(r.Result).children();return s.length?s[0]:null})}},Yh=class extends nc{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};var gU=sn(rB(),1),ld=sn(tU(),1);var Jh=class extends Ve{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,r,n){super(),this.wu=e;let s=0;for(let i of n)if(i.GraphName===r.Name&&!i.HasSubGraphId){s=Math.round(i.Seconds*1e3)/1e3;break}this.set({Time:s,...r})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(r=>Xh(r)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(r=>Xh(r))}},jh=class extends Ke{constructor(){super(e=>Ke.hash([e.Name]))}};function aU(t,e,r){r=r||[],r.push(t),e(t.name,t.$,t.children(),r),t.children().forEach(n=>{aU(n,e,r)}),r.pop()}function nB(t){let e={};return t.forEach(r=>{r.name==="att"&&(e[r.$.name]=r.$.value)}),e}var sB=class extends pa{},rU=class extends Ro{},nU=class extends Uo{},sU=class extends da{};function uU(t,e){let r={},n={},s={},i=new sB(u=>u._.id),A=[i.root];return aU(e,(u,c,g,l)=>{let d=A[A.length-1];switch(u){case"graph":break;case"node":if(g.length&&g[0].children().length&&g[0].children()[0].name==="graph"){let E=d.createSubgraph(nB(g));A.push(E),r[c.id]=E}let p=d.createVertex(nB(g));n[c.id]=p;break;case"edge":let B=d.createEdge(n[c.source],n[c.target],nB(g));s[c.id]=B;break;default:}}),i}var zh=class extends pa{},iU=class extends Ro{},oU=class extends Uo{},AU=class extends da{};function Xh(t){let e={},r={},n={},s;for(let i of t)switch(i.ScopeType){case"graph":s=new zh(l=>l._.Id,i),e[i.ScopeName]=s.root;break;case"subgraph":s||(s=new zh(l=>l._.Id,i),e[i.ScopeName]=s.root);let A=i.parentScope().split(":"),u=e[i.parentScope()];for(;A.length&&!u;)u=e[A.join(":")],A.pop();if(!u)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let l=u;e[i.ScopeName]=l.createSubgraph(i)}break;case"activity":let c=e[i.parentScope()];c?n[i.ScopeName]=c.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":r[i.ScopeName]=i;break;case"function":let g=n[i.parentScope()];g?g._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in r){let A=r[i],u=e[A.parentScope()];if(!u)console.warn(`Missing E:Parent (${A.Id}): ${A.parentScope()}`);else{let c=u;try{let g=s.vertex(A.attr("IdSource").RawValue),l=s.vertex(A.attr("IdTarget").RawValue);c.createEdge(g,l,A)}catch{console.warn(`Invalid Edge: ${i}`)}}}return s}var Zh=class extends Ve{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,r){super(),this.wu=e;let n=r.split("\\").join("/"),s=n.split("/"),i="res/"+this.wu.Wuid+"/",A="",u="";n.indexOf(i)===0&&(A=n.substr(i.length),u=s[s.length-1]),this.set({URL:r,DisplayName:u,DisplayPath:A})}};var Kh=class{e;constructor(e){this.e=e}fix(){delete this.e}},$h=class extends Kh{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 r=this._children.length-1;r>=0;--r){let n=this._children[r];n.name==="Row"&&n.type===void 0&&(this._children.push(...n._children),this._children.splice(r,1))}let e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return e.name==="All"&&e.type===void 0}setOfType(){let e=this.children();if(this.type===void 0&&e.length===2){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":e=8;break;case"xs:nonNegativeInteger":e=8;break;case"xs:double":e=8;break;case"xs:string":e=32;break;default:let r="0123456789",n=this.type.lastIndexOf("_"),s=n>0?n:this.type.length,i=s-1;for(;i>=0&&r.indexOf(this.type.charAt(i))!==-1;--i);i+1<s&&(e=parseInt(this.type.substring(i+1,s),10)),this.type.indexOf("data")===0&&(e*=2);break}return e<this.name.length&&(e=this.name.length),e}},ed=class extends Kh{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;break;default:}}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()}},td=class{root;simpleTypes={};fields(){return this.root.children()}},rd=class extends fi{schema=new td;simpleType;simpleTypes={};xsdStack=new pi;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let r=new $h(e);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(r):this.schema.root=r,this.xsdStack.push(r);break;case"xs:simpleType":this.simpleType=new ed(e);break;default:break}}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":let n=this.xsdStack.top();for(let s in e.$)n.attrs[s]=e.$[s];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function oB(t){let e=new rd;return e.parse(t),e.schema}var iB=class extends rd{_rootName;schema=new td;simpleTypes={};xsdStack=new pi;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let r=new $h(e);!this.schema.root&&this._rootName===e.$.name&&(this.schema.root=r),this.xsdStack.depth()&&this.xsdStack.top().append(r),this.xsdStack.push(r);break;case"xsd:simpleType":this.simpleType=new ed(e);break;default:break}}endXMLNode(e){switch(e.name){case"xsd:element":this.xsdStack.pop().fix();break;case"xsd:simpleType":break;default:break}super.endXMLNode(e)}};function o5(t,e){let r=new iB(e);return r.parse(t),r.schema}var AB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},nd=new AB,sd=class t extends Ve{connection;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,r,n,s){let i;return Array.isArray(s)?(i=nd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:n.Name},()=>new t(e,r,n,s)),i.set(n)):typeof s>"u"&&(typeof n=="number"?i=nd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:"Sequence_"+n},()=>new t(e,r,n)):typeof n=="string"&&(i=nd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:n},()=>new t(e,r,n)))),i}static attachLogicalFile(e,r,n){return nd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:n},()=>new t(e,r,n,!0))}constructor(e,r,n,s){super(),e instanceof _t?this.connection=e:this.connection=new _t(e),typeof s=="boolean"&&s===!0?this.set({NodeGroup:r,LogicalFileName:n}):X0(n)&&Array.isArray(s)?this.set({...n,Wuid:r,ResultName:n.Name,ResultViews:s}):typeof s>"u"?typeof n=="number"?this.set({Wuid:r,ResultSequence:n}):typeof n=="string"?this.set({Wuid:r,ResultName:n}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return this.Total!==-1}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(r=>r.Result?.XmlSchema?.xml?(this.xsdSchema=oB(r.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,r=-1,n=!1,s={},i){return this.WUResult(e,r,!n,s,i).then(A=>{let u=A.Result;return delete A.Result,this.set({...A}),An("XmlSchema.xml",u)&&(this.xsdSchema=oB(u.XmlSchema.xml)),An("Row",u)?u.Row:this.ResultName&&An(this.ResultName,u)?u[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,r=1,n=!1,s={},i){let A={NamedValue:{itemcount:0}};for(let c in s)A.NamedValue[A.NamedValue.itemcount++]={Name:c,Value:s[c]};let u={FilterBy:A};return this.Wuid&&this.ResultName!==void 0?(u.Wuid=this.Wuid,u.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(u.Wuid=this.Wuid,u.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(u.LogicalName=this.LogicalFileName,u.Cluster=this.NodeGroup):this.LogicalFileName&&(u.LogicalName=this.LogicalFileName),u.Start=e,u.Count=r,u.SuppressXmlSchema=n,this.connection.WUResult(u,i).then(c=>c)}},id=class extends Ke{constructor(){super(e=>Ke.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};var eo=class extends Ve{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,r){super(),this.scope=e,this.set(r)}},aB=class extends Ve{_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(){let e=[],r={start:null,end:null};return this.Properties.Property.forEach(n=>{n.Measure==="ts"&&n.Name.indexOf("Started")>=0?r.start=n:this.ScopeName&&n.Measure==="ts"&&n.Name.indexOf("Finished")>=0?r.end=n:e.push(new eo(this,n))}),r.start&&r.end?(r.start.FormattedEnd=r.end.Formatted,e.push(new eo(this,r.start))):r.start?e.push(new eo(this,r.start)):r.end&&e.push(new eo(this,r.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(r=>{this._attributeMap[r.Name]=r}),this.Properties.Property=[];for(let r in this._attributeMap)this._attributeMap.hasOwnProperty(r)&&this.Properties.Property.push(this._attributeMap[r].properties)}parentScope(){let 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(let r of this.children())if(r.walk(e))return!0;return e.end(this)}formattedAttrs(){let e={};for(let r in this._attributeMap)e[r]=this._attributeMap[r].Formatted||this._attributeMap[r].RawValue;return e}rawAttrs(){let e={};for(let r in this._attributeMap)e[r]=this._attributeMap[r].RawValue;return e}hasAttr(e){return this._attributeMap[e]!==void 0}attr(e){return this._attributeMap[e]||new eo(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let r="",n=[];r=this.Id,n.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&n.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),n.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);let s=this.formattedAttrs();for(let i in s)i==="Label"?r=s[i]:n.push(`<tr><td class="key">${i}</td><td class="value">${s[i]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
971
|
+
`;var Qd=sn(b0(),1);var sj="@hpcc-js/comms",ij="3.7.6",oj="3.8.6";var R0=kt("comms/connection.ts");function uj(t){return"baseUrl"in t}var hq={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function cj(t){return typeof t.opts=="function"&&typeof t.send=="function"&&typeof t.clone=="function"}function On(t,e){return e===void 0||e===!0?encodeURIComponent(t):""+t}function Xi(t,e=!0,r=""){if(r&&(r+="."),typeof t!="object")return On(t,e);let n=[];for(let s in t)if(t.hasOwnProperty(s))if(t[s]instanceof Array){let i=!1;t[s].forEach((A,u)=>{typeof A=="object"?(i=!0,n.push(Xi(A,e,r+On(`${s}.${u}`,e)))):n.push(r+On(`${s}_i${u}`,e)+"="+Xi(A,e))}),i&&n.push(r+On(`${s}.itemcount`,e)+"="+t[s].length)}else typeof t[s]=="object"?t[s]&&t[s].Item instanceof Array?(n.push(Xi(t[s].Item,e,r+On(s,e))),n.push(r+On(`${s}.itemcount`,e)+"="+t[s].Item.length)):n.push(Xi(t[s],e,r+On(s,e))):t[s]!==void 0?n.push(r+On(s,e)+"="+On(t[s],e)):n.push(r+On(s,e));return n.join("&")}function dq(t){return JSON.parse(t)}function pq(t,e,r={},n="json",s){return s&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,A)=>{let u=t.timeoutSecs*1e3,c=5e3,g="jsonp_callback_"+Math.round(Math.random()*999999);window[g]=function(E){u=0,B(),i(n==="json"&&typeof E=="string"?dq(E):E)};let l=document.createElement("script"),d=ns(t.baseUrl,e);d+=d.indexOf("?")>=0?"&":"?",l.src=d+"jsonp="+g+"&"+Xi(r,t.encodeRequest),document.body.appendChild(l);let p=setInterval(function(){u<=0?clearInterval(p):(u-=c,u<=0?(clearInterval(p),R0.error("Request timeout: "+l.src),B(),A(Error("Request timeout: "+l.src))):R0.debug("Request pending ("+u/1e3+" sec): "+l.src))},c);function B(){delete window[g],document.body.removeChild(l)}})}function fq(t){return t.userID?{Authorization:`Basic ${btoa(`${t.userID}:${t.password}`)}`}:{}}var yh={};function F0(t,e,r,n,s){n={...fq(t),...n},r={credentials:yh[t.baseUrl]?"omit":"include",...r,headers:n},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),t.baseUrl.indexOf("https:")===0&&(t.rejectUnauthorized===!1&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):r.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(r.agent=fetch.__trustwaveAgent));function i(A){if(A.ok)return s==="json"?A.json():A.text();throw new Error(A.statusText)}return UI(t.timeoutSecs*1e3,fetch(ns(t.baseUrl,e),r).then(i).catch(A=>(r.credentials=yh[t.baseUrl]?"include":"omit",fetch(ns(t.baseUrl,e),r).then(i).then(u=>(yh[t.baseUrl]=!yh[t.baseUrl],u)))))}function Eq(t,e,r,n="json",s){r.upload_&&(delete r.upload_,e+="?upload_");let i;return r.abortSignal_&&(i=r.abortSignal_,delete r.abortSignal_),F0(t,e,{method:"post",body:Xi(r,t.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...s},n)}function Cq(t,e,r,n="json",s){let i;return r.abortSignal_&&(i=r.abortSignal_,delete r.abortSignal_),F0(t,`${e}?${Xi(r,t.encodeRequest)}`,{method:"get",signal:i},{...s},n)}function Bq(t,e,r,n="json",s){let i;switch(t.type){case"jsonp":i=pq(t,e,r,n,s);break;case"get":i=Cq(t,e,r,n,s);break;case"post":default:i=Eq(t,e,r,n,s);break}return i}var wh=Bq;function lj(t){let e=wh;return t&&(wh=t),e}var $C=class t{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...hq,...e},this)}send(e,r,n="json",s){return this._opts.hookSend?this._opts.hookSend(this._opts,e,r,n,wh,s):wh(this._opts,e,r,n,s)}clone(){return new t(this.opts())}},Sh=function(t){return new $C(t)};function gj(t){let e=Sh;return Sh=t,e}function Iq(t){return Object.prototype.toString.call(t)==="[object Array]"}var Zi=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,r,n){super("ESPException: "+n.Source),this.action=e,this.request=r,this.Source=n.Source,this.Exception=n.Exception,n.Exception.length?this.message=`${n.Exception[0].Code}: ${n.Exception[0].Message}`:this.message=""}};function Bj(t){return t instanceof Zi||t.isESPExceptions&&Array.isArray(t.Exception)}function Qq(t){return t.send!==void 0}var Ku=class t{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,r,n){this._connection=Qq(e)?e:Sh(e),this._service=r,this._version=n}service(e){return e===void 0?this._service:(this._service=e,this)}version(e){return e===void 0?this._version:(this._version=e,this)}toESPStringArray(e,r){if(Iq(e[r])){for(let n=0;n<e[r].length;++n)e[r+"_i"+n]=e[r][n];delete e[r]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,r={},n="json",s=!1,i,A){let u={...r,ver_:this._version};s&&(u.upload_=!0),i&&(u.abortSignal_=i);let c,g="json";switch(n){case"text":c=ns(this._service,e),g="text";break;case"xsd":c=ns(this._service,e+".xsd"),g="text";break;case"json2":c=ns(this._service,e+"/json"),n="json",e=e.split("/").pop();break;default:c=ns(this._service,e+".json")}return this._connection.send(c,u,g).then(l=>{if(n==="json"){let d;if(l&&l.Exceptions)throw new Zi(e,u,l.Exceptions);if(l&&(d=l[A||e+"Response"]),!d)throw new Zi(e,u,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return d}return l})}clone(){return new t(this._connection.clone(),this._service,this._version)}},Re=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,r,n){this._connection=new Ku(e,r,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var $u;(e=>{let t;(c=>(c.Delete="Delete",c.Protect="Protect",c.Unprotect="Unprotect",c.Restore="Restore",c.SetToFailed="SetToFailed",c.Archive="Archive"))(t=e.DFUWUActions||={})})($u||={});var bh=class extends Re{constructor(e){super(e,"FileSpray","1.26")}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")}};var mq=(l=>(l[l.unknown=0]="unknown",l[l.scheduled=1]="scheduled",l[l.queued=2]="queued",l[l.started=3]="started",l[l.aborted=4]="aborted",l[l.failed=5]="failed",l[l.finished=6]="finished",l[l.monitoring=7]="monitoring",l[l.aborting=8]="aborting",l[l.notfound=999]="notfound",l))(mq||{}),Ki=class extends bh{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")}};var U0;(A=>{let t;(g=>(g.User="User",g.Group="Group"))(t=A.ViewMemberType||={});let e;(p=>(p.username="username",p.fullname="fullname",p.passwordexpiration="passwordexpiration",p.employeeID="employeeID",p.employeeNumber="employeeNumber"))(e=A.UserSortBy||={});let r;(g=>(g.Name="Name",g.ManagedBy="ManagedBy"))(r=A.GroupSortBy||={});let n;(l=>(l.Any="Any",l.User="User",l.Group="Group"))(n=A.AccountTypeReq||={});let s;(g=>(g.Name="Name",g.Type="Type"))(s=A.ResourcePermissionSortBy||={});let i;(c=>c.Name="Name")(i=A.ResourceSortBy||={})})(U0||={});var Rh=class extends Re{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")}};var N0=class extends Rh{};var Fh=class extends Re{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")}};var T0=class extends Fh{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(r=>{if(r.isESPExceptions&&r.Exception.some(n=>n.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:r.Exception}};throw r})}};var Uh=class extends Re{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")}};var Dq=kt("@hpcc-js/comms/services/wsCloud.ts");function yq(t){return t?.Pods!==void 0}function wq(t){return t.spec?.containers?.reduce((e,r)=>(r.ports?.forEach(n=>{e.push({ContainerPort:n.containerPort,Name:n.name,Protocol:n.protocol})}),e),[])??[]}function Sq(t){return t.filter(e=>{let r=e?.metadata?.labels??{};return r.hasOwnProperty("app.kubernetes.io/part-of")&&r["app.kubernetes.io/part-of"]==="HPCC-Platform"}).map(e=>{let r=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:r.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((n,s)=>(s.name&&n.push(s.name),n),[]).join(", ")??"",ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((n,s)=>n+(s.ready?1:0),0),ContainerRestartCount:e.status?.containerStatuses?.reduce((n,s)=>n+s.restartCount,0),Ports:{Port:wq(e)}}})}var M0=class extends Uh{getPODs(){return super.GetPODs({}).then(e=>{if(yq(e))return e.Pods?.Pod??[];try{let r=typeof e.Result=="string"?JSON.parse(e.Result):e.Result;return Sq(r?.items??[])}catch(r){return Dq.error(`Error parsing V1Pods json '${r instanceof Error?r.message:String(r)}'`),[]}})}};var x0=class{_connection;constructor(e){this._connection=new Ku(e,"ws_codesign","1.1")}connectionOptions(){return this._connection.opts()}ListUserIDs(e){return this._connection.send("ListUserIDs",e).then(r=>r.UserIDs.Item).catch(r=>[])}Sign(e){return this._connection.send("Sign",{SigningMethod:"gpg",...e})}Verify(e){return this._connection.send("Verify",e)}};var Nh=class extends Re{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")}};var k0=class extends Nh{};var OA;(u=>{let t;(p=>(p.Delete="Delete",p.AddToSuperfile="Add To Superfile",p.ChangeProtection="Change Protection",p.ChangeRestriction="Change Restriction"))(t=u.DFUArrayActions||={});let e;(p=>(p[p.NoChange=0]="NoChange",p[p.Protect=1]="Protect",p[p.Unprotect=2]="Unprotect",p[p.UnprotectAll=3]="UnprotectAll"))(e=u.DFUChangeProtection||={});let r;(d=>(d[d.NoChange=0]="NoChange",d[d.Restrict=1]="Restrict",d[d.Unrestricted=2]="Unrestricted"))(r=u.DFUChangeRestriction||={});let n;(l=>(l.xml="xml",l.def="def"))(n=u.DFUDefFileFormat||={});let s;(d=>(d.Token="Token",d.Engine="Engine",d.External="External"))(s=u.FileAccessRole||={});let i;(B=>(B.None="None",B.Access="Access",B.Read="Read",B.Write="Write",B.Full="Full"))(i=u.SecAccessType||={});let A;(D=>(D.Flat="Flat",D.Index="Index",D.Xml="Xml",D.Csv="Csv",D.Json="Json",D.IndexLocal="IndexLocal",D.IndexPartitioned="IndexPartitioned",D.Unset="Unset"))(A=u.DFUFileType||={})})(OA||={});var Th=class extends Re{constructor(e){super(e,"WsDfu","1.65")}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")}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")}};var Xj=OA.DFUArrayActions,Zj=OA.DFUDefFileFormat,Kj=OA.DFUChangeProtection,$j=OA.DFUChangeRestriction,ec=class extends Th{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){let r=[],n=[];return await Promise.all(e.map(s=>this.DFUInfo({Cluster:s.NodeGroup,Name:s.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(i=>{for(let A of i?.FileDetail?.Superfiles?.DFULogicalFile??[])r.push(A);for(let A of i?.FileDetail?.subfiles?.Item??[])n.push(A)}))),n.concat(r.length?await this.recursiveFetchLogicalFiles(r):[])}};var W0=class extends Re{constructor(e){super(e,"WsDFUXRef","1.01")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e)}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e)}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e)}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e)}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e={}){return this._connection.send("DFUXRefList",e)}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e)}};function L0(t,e){let r=typeof e;switch(r){case"boolean":case"number":case"string":return{id:t,type:r};case"object":if(e.Row instanceof Array&&(e=e.Row),e instanceof Array)return{id:t,type:"dataset",children:eB(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let n=typeof e.Item[0];if(n==="string"||n==="number")return{id:t,type:"set",fieldType:n};throw new Error("Unknown field type")}return{id:t,type:"object",fields:bq(e)}}default:throw new Error("Unknown field type")}}function eB(t){t.Row&&t.Row instanceof Array&&(t=t.Row[0]);let e=[];for(let r in t)e.push(L0(r,t[r]));return e}function bq(t){let e={};for(let r in t)e[r]=L0(r,t[r]);return e}var Mh=class extends Re{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,r){return this._connection.send(`example/request/query/${e}/${r}/json`,{},"text").then(n=>{let s=JSON.parse(n);for(let i in s)return s[i];return{}}).then(eB)}responseJson(e,r){return this._connection.send(`example/response/query/${e}/${r}/json`,{},"text").then(n=>{let s=JSON.parse(n);for(let i in s)return s[i].Results;return{}}).then(n=>{let s={};for(let i in n)s[i]=eB(n[i]);return s})}submit(e,r,n){let s=`submit/query/${e}/${r}`;return this._connection.send(s,n,"json2").then(i=>{if(i.Results&&i.Results.Exception)throw new Zi(s,n,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var xh=class extends Re{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e)}Ping(e){return this._connection.send("Ping",e)}};var v0=class extends xh{};var Ct;(c=>{let t;(J=>(J.global="global",J.workunits="workunits",J.components="components",J.audience="audience",J.class="class",J.instance="instance",J.node="node",J.message="message",J.logid="logid",J.processid="processid",J.threadid="threadid",J.timestamp="timestamp",J.pod="pod",J.traceid="traceid",J.spanid="spanid"))(t=c.LogColumnType||={});let e;(E=>(E.string="string",E.numeric="numeric",E.datetime="datetime",E.enum="enum",E.epoch="epoch"))(e=c.LogColumnValueType||={});let r;(y=>(y[y.All=0]="All",y[y.ByJobID=1]="ByJobID",y[y.ByComponent=2]="ByComponent",y[y.ByLogType=3]="ByLogType",y[y.ByTargetAudience=4]="ByTargetAudience",y[y.BySourceInstance=5]="BySourceInstance",y[y.BySourceNode=6]="BySourceNode",y[y.ByFieldName=7]="ByFieldName",y[y.ByPod=8]="ByPod",y[y.ByTraceID=9]="ByTraceID",y[y.BySpanID=10]="BySpanID"))(r=c.LogAccessType||={});let n;(p=>(p[p.Success=0]="Success",p[p.Warning=1]="Warning",p[p.Fail=2]="Fail"))(n=c.LogAccessStatusCode||={});let s;(p=>(p[p.NONE=0]="NONE",p[p.AND=1]="AND",p[p.OR=2]="OR"))(s=c.LogAccessFilterOperator||={});let i;(B=>(B[B.MIN=0]="MIN",B[B.DEFAULT=1]="DEFAULT",B[B.ALL=2]="ALL",B[B.CUSTOM=3]="CUSTOM"))(i=c.LogSelectColumnMode||={});let A;(y=>(y[y.ByDate=0]="ByDate",y[y.ByJobID=1]="ByJobID",y[y.ByComponent=2]="ByComponent",y[y.ByLogType=3]="ByLogType",y[y.ByTargetAudience=4]="ByTargetAudience",y[y.BySourceInstance=5]="BySourceInstance",y[y.BySourceNode=6]="BySourceNode",y[y.ByFieldName=7]="ByFieldName",y[y.ByPod=8]="ByPod",y[y.ByTraceID=9]="ByTraceID",y[y.BySpanID=10]="BySpanID"))(A=c.SortColumType||={});let u;(d=>(d[d.ASC=0]="ASC",d[d.DSC=1]="DSC"))(u=c.SortDirection||={})})(Ct||={});var kh=class extends Re{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")}};var P0=kt("@hpcc-js/comms/services/wsLogaccess.ts");var Rq=(A=>(A.Disaster="DIS",A.Error="ERR",A.Warning="WRN",A.Information="INF",A.Progress="PRO",A.Metric="MET",A))(Rq||{}),Fq=(s=>(s.Operator="OPR",s.User="USR",s.Programmer="PRO",s.Audit="ADT",s))(Fq||{}),G0=class extends kh{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){let r=await this.GetLogAccessInfo(),n={};r.Columns.Column.forEach(u=>n[u.LogType]=u.Name);let s=u=>{let c={};for(let g in n)u?.fields?c[g]=Object.assign({},...u.fields)[n[g]]??"":c[g]="";return c},i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:Ct.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:Ct.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:Ct.SortColumType.ByDate,ColumnName:"",Direction:0}]}},A=[];for(let u in e){let c;u in n&&(Object.values(Ct.LogColumnType).includes(u)?c=u:c=n[u]);let g;if(c){switch(c){case Ct.LogColumnType.workunits:case"hpcc.log.jobid":g=Ct.LogAccessType.ByJobID;break;case Ct.LogColumnType.audience:case"hpcc.log.audience":g=Ct.LogAccessType.ByTargetAudience;break;case Ct.LogColumnType.class:case"hpcc.log.class":g=Ct.LogAccessType.ByLogType;break;case Ct.LogColumnType.components:case"kubernetes.container.name":g=Ct.LogAccessType.ByComponent;break;default:g=Ct.LogAccessType.ByFieldName,c=n[u]}if(Array.isArray(e[u]))e[u].forEach(l=>{g===Ct.LogAccessType.ByComponent&&(l+="*"),A.push({LogCategory:g,SearchField:c,SearchByValue:l})});else{let l=e[u];g===Ct.LogAccessType.ByComponent&&(l+="*"),A.push({LogCategory:g,SearchField:c,SearchByValue:l})}}}if(A.length>2){let u=i.Filter.leftBinaryFilter.BinaryLogFilter[0];A.forEach((c,g)=>{let l=Ct.LogAccessFilterOperator.AND;g>0?(A[g-1].SearchField===c.SearchField&&(l=Ct.LogAccessFilterOperator.OR),g===A.length-1?(u.Operator=l,u.rightFilter=c):(u.Operator=l,u.rightBinaryFilter={BinaryLogFilter:[{leftFilter:c}]},u=u.rightBinaryFilter.BinaryLogFilter[0])):u.leftFilter=c})}else delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:Ct.LogAccessType.All},A[0]?.SearchField&&(i.Filter.leftFilter={LogCategory:A[0]?.LogCategory,SearchField:A[0]?.SearchField,SearchByValue:A[0]?.SearchByValue}),A[1]?.SearchField&&(i.Filter.Operator=Ct.LogAccessFilterOperator.AND,A[0].SearchField===A[1].SearchField&&(i.Filter.Operator=Ct.LogAccessFilterOperator.OR),i.Filter.rightFilter={LogCategory:A[1]?.LogCategory,SearchField:A[1]?.SearchField,SearchByValue:A[1]?.SearchByValue});return e.StartDate&&(i.Range.StartDate=e.StartDate.toISOString()),e.EndDate&&(i.Range.EndDate=e.EndDate.toISOString()),this.GetLogs(i).then(u=>{try{let c=JSON.parse(u.LogLines),g=[];switch(r.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":g=c.lines?.map(s)??[];break;default:P0.warning(`Unknown RemoteLogManagerType: ${r.RemoteLogManagerType}`),g=[]}return{lines:g,total:u.TotalLogLinesAvailable??1e4}}catch(c){P0.error(c.message??c)}return{lines:[],total:0}})}};var ti=sn(_0(),1);var Lh=class extends Re{constructor(e){super(e,"ws_machine","1.17")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e)}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e)}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e)}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e)}GetMetrics(e){return this._connection.send("GetMetrics",e)}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e)}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e)}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e)}Ping(e){return this._connection.send("Ping",e)}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e)}};var ri=class extends Lh{GetTargetClusterUsageEx(e,r=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:r}).then(n=>An("TargetClusterUsages.TargetClusterUsage",n)?n.TargetClusterUsages.TargetClusterUsage:[]).then(n=>n.filter(s=>!!s.ComponentUsages).map(s=>{let i=s.ComponentUsages.ComponentUsage.map(A=>{let u=(A.MachineUsages&&A.MachineUsages.MachineUsage?A.MachineUsages.MachineUsage:[]).map(c=>{let g=c.DiskUsages&&c.DiskUsages.DiskUsage?c.DiskUsages.DiskUsage.map(l=>({...l,InUse:l.InUse*1024,Total:(l.InUse+l.Available)*1024,PercentUsed:100-l.PercentAvailable})):[];return{Name:c.Name,NetAddress:c.NetAddress,Description:c.Description,DiskUsages:g,mean:(0,ti.mean)(g.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed),max:(0,ti.max)(g.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed)}});return{Type:A.Type,Name:A.Name,Description:A.Description,MachineUsages:u,MachineUsagesDescription:u.reduce((c,g)=>c+(g.Description||""),""),mean:(0,ti.mean)(u.filter(c=>!isNaN(c.mean)),c=>c.mean),max:(0,ti.max)(u.filter(c=>!isNaN(c.max)),c=>c.max)}});return{Name:s.Name,Description:s.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((A,u)=>A+(u.MachineUsagesDescription||""),""),mean:(0,ti.mean)(i.filter(A=>!isNaN(A.mean)),A=>A.mean),max:(0,ti.max)(i.filter(A=>!isNaN(A.max)),A=>A.max)}}))}};var vh=class extends Re{constructor(e){super(e,"WsPackageProcess","1.04")}ActivatePackage(e){return this._connection.send("ActivatePackage",e)}AddPackage(e){return this._connection.send("AddPackage",e)}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e)}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e)}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e)}DeletePackage(e){return this._connection.send("DeletePackage",e)}Echo(e){return this._connection.send("Echo",e)}GetPackage(e){return this._connection.send("GetPackage",e)}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e)}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e)}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e)}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e)}ListPackage(e){return this._connection.send("ListPackage",e)}ListPackages(e){return this._connection.send("ListPackages",e)}Ping(e){return this._connection.send("Ping",e)}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e)}ValidatePackage(e){return this._connection.send("ValidatePackage",e)}};var Y0=class extends vh{};var Ph=class extends Re{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)}};var H0=class extends Ph{};var O0;(e=>{let t;(s=>(s.ECL="ECL",s.DFU="DFU"))(t=e.WUTypes||={})})(O0||={});var Gh=class extends Re{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")}};var q0=class extends Gh{};var J0;(r=>{let t;(c=>(c.ALL="ALL",c.READ="READ",c.WRITE="WRITE",c.HOLD="HOLD",c.SUB="SUB"))(t=r.LockModes||={});let e;(d=>(d.Attach="Attach",d.Detach="Detach",d.State="State",d.Reload="Reload",d.ReloadRetry="ReloadRetry",d.MemLock="MemLock",d.MemUnlock="MemUnlock",d.GetMemLocked="GetMemLocked"))(e=r.RoxieControlCmdType||={})})(J0||={});var Vh=class extends Re{constructor(e){super(e,"WsSMC","1.27")}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")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};var tc=class extends Vh{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(r=>({Running:{ActiveWorkunit:[]},...r}))}};var rc=class extends Re{constructor(e){super(e,"WsStore","1")}CreateStore(e){return this._connection.send("Fetch",e)}Delete(e){return this._connection.send("Delete",e).catch(r=>{if(r.isESPExceptions&&r.Exception.some(n=>n.Code===-1))return{Exceptions:void 0,Success:!0};throw r})}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e)}Fetch(e){return this._connection.send("Fetch",e).catch(r=>{if(r.isESPExceptions&&r.Exception.some(n=>n.Code===-1))return{Exceptions:void 0,Value:void 0};throw r})}FetchAll(e){return this._connection.send("FetchAll",e)}FetchKeyMD(e){return this._connection.send("FetchKeyMD",e)}ListKeys(e){return this._connection.send("ListKeys",e)}ListNamespaces(e){return this._connection.send("ListNamespaces",e)}Set(e){return this._connection.send("Set",e)}};var j0;(e=>{let t;(i=>(i.All="All",i.QueriesOnly="QueriesOnly",i.WorkunitsOnly="WorkunitsOnly"))(t=e.RoxieQueueFilter||={})})(j0||={});var _h=class extends Re{constructor(e){super(e,"WsTopology","1.32")}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")}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")}};var Xt=class extends _h{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(r=>{if(r.default)return r.default;let n,s;return r.TpLogicalClusters.TpLogicalCluster.some((i,A)=>(A===0&&(s=i),i.Type==="hthor"?(n=i,!0):!1)),n||s})}};var sr;(D=>{let t;(ie=>(ie.Abort="Abort",ie.Delete="Delete",ie.Deschedule="Deschedule",ie.Reschedule="Reschedule",ie.Pause="Pause",ie.PauseNow="PauseNow",ie.Protect="Protect",ie.Unprotect="Unprotect",ie.Restore="Restore",ie.Resume="Resume",ie.SetToFailed="SetToFailed",ie.Archive="Archive"))(t=D.ECLWUActions||={});let e;(V=>(V[V.MIN=0]="MIN",V[V.DEFAULT=1]="DEFAULT",V[V.ALL=2]="ALL",V[V.CUSTOM=3]="CUSTOM"))(e=D.LogSelectColumnMode||={});let r;(F=>(F[F.ASC=0]="ASC",F[F.DSC=1]="DSC"))(r=D.SortDirection||={});let n;(X=>(X.ALL="ALL",X.DIS="DIS",X.ERR="ERR",X.WRN="WRN",X.INF="INF",X.PRO="PRO",X.MET="MET",X.EVT="EVT"))(n=D.LogEventClass||={});let s;(y=>(y.Single="Single",y.List="List",y.Multi="Multi"))(s=D.WUDetailsAttrValueType||={});let i;(y=>(y.SyntaxCheck="SyntaxCheck",y.Deploy="Deploy",y.Publish="Publish"))(i=D.EclDefinitionActions||={});let A;(y=>(y.xml="xml",y.json="json",y.text="text"))(A=D.ErrorMessageFormat||={});let u;(y=>(y[y.XML=0]="XML",y[y.JSON=1]="JSON",y[y.CSV=2]="CSV"))(u=D.LogAccessLogFormat||={});let c;(V=>(V.info="info",V.warning="warning",V.error="error",V.alert="alert"))(c=D.WUExceptionSeverity||={});let g;(w=>(w.Allqueries="All queries",w.Notsuspended="Not suspended",w.Suspended="Suspended",w.Suspendedbyuser="Suspended by user",w.Suspendedbyfirstnode="Suspended by first node",w.Suspendedbyanynode="Suspended by any node"))(g=D.WUQueryFilterSuspendedType||={});let l;(K=>(K.All="All",K.Id="Id",K.Name="Name",K.Alias="Alias",K.Status="Status"))(l=D.WUQuerySetFilterType||={});let d;(y=>(y.All="All",y.Protected="Protected",y.NotProtected="NotProtected"))(d=D.WUProtectFilter||={});let p;(x=>x.Deactivate="Deactivate")(p=D.QuerySetAliasActionTypes||={});let B;(F=>(F.None="None",F.ActivateImportedActive="ActivateImportedActive"))(B=D.QuerysetImportActivation||={});let E;(X=>(X.Suspend="Suspend",X.Unsuspend="Unsuspend",X.ToggleSuspend="ToggleSuspend",X.Activate="Activate",X.Delete="Delete",X.DeleteQueriesAndWUs="DeleteQueriesAndWUs",X.RemoveAllAliases="RemoveAllAliases",X.ResetQueryStats="ResetQueryStats"))(E=D.QuerySetQueryActionTypes||={});let b;(V=>(V[V.DoNotActivateQuery=0]="DoNotActivateQuery",V[V.ActivateQuery=1]="ActivateQuery",V[V.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",V[V.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(b=D.WUQueryActivationMode||={})})(sr||={});var nc=class extends Re{constructor(e){super(e,"WsWorkunits","2.02")}GVCAjaxGraph(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")}WUAbort(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")}WUAction(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")}WUAddLocalFileToWorkunit(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")}WUCDebug(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")}WUCheckFeatures(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")}WUCompileECL(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")}WUCopyLogicalFiles(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")}WUCreate(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")}WUCreateAndUpdate(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUCreateZAPInfo(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")}WUDelete(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")}WUDeployWorkunit(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")}WUDetails(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")}WUDetailsMeta(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")}WUEclDefinitionAction(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")}WUExport(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")}WUFile(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")}WUFullResult(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")}WUGVCGraphInfo(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")}WUGetGraph(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")}WUGetPlugins(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")}WUGetStats(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")}WUGetThorJobList(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")}WUGetThorJobQueue(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")}WUGraphInfo(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")}WUGraphTiming(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")}WUInfo(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")}WUInfoDetails(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")}WUJobList(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")}WULightWeightQuery(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")}WUListArchiveFiles(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")}WUListQueries(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")}WUListQueriesUsingFile(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")}WUProtect(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")}WUPublishWorkunit(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")}WUPushEvent(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")}WUQuery(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")}WUQueryConfig(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")}WUQueryDetails(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryFiles(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")}WUQueryGetGraph(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")}WUQuerysetExport(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")}WUQuerysetImport(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")}WUQuerysets(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")}WURecreateQuery(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")}WUResubmit(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")}WUResult(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")}WUResultBin(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")}WUResultSummary(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")}WUResultView(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")}WURun(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")}WUSchedule(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")}WUShowScheduled(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")}WUSubmit(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")}WUSyntaxCheckECL(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUUpdateQueryEntry(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")}WUWaitComplete(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")}};var tB=(F=>(F[F.Unknown=0]="Unknown",F[F.Compiled=1]="Compiled",F[F.Running=2]="Running",F[F.Completed=3]="Completed",F[F.Failed=4]="Failed",F[F.Archived=5]="Archived",F[F.Aborting=6]="Aborting",F[F.Aborted=7]="Aborted",F[F.Blocked=8]="Blocked",F[F.Submitted=9]="Submitted",F[F.Scheduled=10]="Scheduled",F[F.Compiling=11]="Compiling",F[F.Wait=12]="Wait",F[F.UploadingFiled=13]="UploadingFiled",F[F.DebugPaused=14]="DebugPaused",F[F.DebugRunning=15]="DebugRunning",F[F.Paused=16]="Paused",F[F.LAST=17]="LAST",F[F.NotFound=999]="NotFound",F))(tB||{}),$i;(e=>{let t;(p=>(p[p.Unknown=0]="Unknown",p[p.Compile=1]="Compile",p[p.Check=2]="Check",p[p.Run=3]="Run",p[p.ExecuteExisting=4]="ExecuteExisting",p[p.Pause=5]="Pause",p[p.PauseNow=6]="PauseNow",p[p.Resume=7]="Resume",p[p.Debug=8]="Debug",p[p.__size=9]="__size"))(t=e.Action||={})})($i||={});function X0(t){return typeof t.Name=="string"}function zz(t){return t.TotalClusterTime!==void 0}function Xz(t){return t.StateEx!==void 0}var _t=class extends nc{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},r){return this._connection.send("WUQuery",e,"json",!1,r).then(n=>qc({Workunits:{ECLWorkunit:[]}},n))}WUInfo(e){let r={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(r)}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,r){return this._connection.send("WUResult",e,"json",!1,r)}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(r=>{let s=jc(r.Result).children();return s.length?s[0]:null})}},Yh=class extends nc{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};var gU=sn(rB(),1),ld=sn(tU(),1);var Jh=class extends Ve{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,r,n){super(),this.wu=e;let s=0;for(let i of n)if(i.GraphName===r.Name&&!i.HasSubGraphId){s=Math.round(i.Seconds*1e3)/1e3;break}this.set({Time:s,...r})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(r=>Xh(r)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(r=>Xh(r))}},jh=class extends Ke{constructor(){super(e=>Ke.hash([e.Name]))}};function aU(t,e,r){r=r||[],r.push(t),e(t.name,t.$,t.children(),r),t.children().forEach(n=>{aU(n,e,r)}),r.pop()}function nB(t){let e={};return t.forEach(r=>{r.name==="att"&&(e[r.$.name]=r.$.value)}),e}var sB=class extends pa{},rU=class extends Ro{},nU=class extends Uo{},sU=class extends da{};function uU(t,e){let r={},n={},s={},i=new sB(u=>u._.id),A=[i.root];return aU(e,(u,c,g,l)=>{let d=A[A.length-1];switch(u){case"graph":break;case"node":if(g.length&&g[0].children().length&&g[0].children()[0].name==="graph"){let E=d.createSubgraph(nB(g));A.push(E),r[c.id]=E}let p=d.createVertex(nB(g));n[c.id]=p;break;case"edge":let B=d.createEdge(n[c.source],n[c.target],nB(g));s[c.id]=B;break;default:}}),i}var zh=class extends pa{},iU=class extends Ro{},oU=class extends Uo{},AU=class extends da{};function Xh(t){let e={},r={},n={},s;for(let i of t)switch(i.ScopeType){case"graph":s=new zh(l=>l._.Id,i),e[i.ScopeName]=s.root;break;case"subgraph":s||(s=new zh(l=>l._.Id,i),e[i.ScopeName]=s.root);let A=i.parentScope().split(":"),u=e[i.parentScope()];for(;A.length&&!u;)u=e[A.join(":")],A.pop();if(!u)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let l=u;e[i.ScopeName]=l.createSubgraph(i)}break;case"activity":let c=e[i.parentScope()];c?n[i.ScopeName]=c.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":r[i.ScopeName]=i;break;case"function":let g=n[i.parentScope()];g?g._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in r){let A=r[i],u=e[A.parentScope()];if(!u)console.warn(`Missing E:Parent (${A.Id}): ${A.parentScope()}`);else{let c=u;try{let g=s.vertex(A.attr("IdSource").RawValue),l=s.vertex(A.attr("IdTarget").RawValue);c.createEdge(g,l,A)}catch{console.warn(`Invalid Edge: ${i}`)}}}return s}var Zh=class extends Ve{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,r){super(),this.wu=e;let n=r.split("\\").join("/"),s=n.split("/"),i="res/"+this.wu.Wuid+"/",A="",u="";n.indexOf(i)===0&&(A=n.substr(i.length),u=s[s.length-1]),this.set({URL:r,DisplayName:u,DisplayPath:A})}};var Kh=class{e;constructor(e){this.e=e}fix(){delete this.e}},$h=class extends Kh{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 r=this._children.length-1;r>=0;--r){let n=this._children[r];n.name==="Row"&&n.type===void 0&&(this._children.push(...n._children),this._children.splice(r,1))}let e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return e.name==="All"&&e.type===void 0}setOfType(){let e=this.children();if(this.type===void 0&&e.length===2){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":e=8;break;case"xs:nonNegativeInteger":e=8;break;case"xs:double":e=8;break;case"xs:string":e=32;break;default:let r="0123456789",n=this.type.lastIndexOf("_"),s=n>0?n:this.type.length,i=s-1;for(;i>=0&&r.indexOf(this.type.charAt(i))!==-1;--i);i+1<s&&(e=parseInt(this.type.substring(i+1,s),10)),this.type.indexOf("data")===0&&(e*=2);break}return e<this.name.length&&(e=this.name.length),e}},ed=class extends Kh{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;break;default:}}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()}},td=class{root;simpleTypes={};fields(){return this.root.children()}},rd=class extends fi{schema=new td;simpleType;simpleTypes={};xsdStack=new pi;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let r=new $h(e);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(r):this.schema.root=r,this.xsdStack.push(r);break;case"xs:simpleType":this.simpleType=new ed(e);break;default:break}}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":let n=this.xsdStack.top();for(let s in e.$)n.attrs[s]=e.$[s];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function oB(t){let e=new rd;return e.parse(t),e.schema}var iB=class extends rd{_rootName;schema=new td;simpleTypes={};xsdStack=new pi;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let r=new $h(e);!this.schema.root&&this._rootName===e.$.name&&(this.schema.root=r),this.xsdStack.depth()&&this.xsdStack.top().append(r),this.xsdStack.push(r);break;case"xsd:simpleType":this.simpleType=new ed(e);break;default:break}}endXMLNode(e){switch(e.name){case"xsd:element":this.xsdStack.pop().fix();break;case"xsd:simpleType":break;default:break}super.endXMLNode(e)}};function o5(t,e){let r=new iB(e);return r.parse(t),r.schema}var AB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},nd=new AB,sd=class t extends Ve{connection;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,r,n,s){let i;return Array.isArray(s)?(i=nd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:n.Name},()=>new t(e,r,n,s)),i.set(n)):typeof s>"u"&&(typeof n=="number"?i=nd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:"Sequence_"+n},()=>new t(e,r,n)):typeof n=="string"&&(i=nd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:n},()=>new t(e,r,n)))),i}static attachLogicalFile(e,r,n){return nd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:n},()=>new t(e,r,n,!0))}constructor(e,r,n,s){super(),e instanceof _t?this.connection=e:this.connection=new _t(e),typeof s=="boolean"&&s===!0?this.set({NodeGroup:r,LogicalFileName:n}):X0(n)&&Array.isArray(s)?this.set({...n,Wuid:r,ResultName:n.Name,ResultViews:s}):typeof s>"u"?typeof n=="number"?this.set({Wuid:r,ResultSequence:n}):typeof n=="string"?this.set({Wuid:r,ResultName:n}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return this.Total!==-1}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(r=>r.Result?.XmlSchema?.xml?(this.xsdSchema=oB(r.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,r=-1,n=!1,s={},i){return this.WUResult(e,r,!n,s,i).then(A=>{let u=A.Result;return delete A.Result,this.set({...A}),An("XmlSchema.xml",u)&&(this.xsdSchema=oB(u.XmlSchema.xml)),An("Row",u)?u.Row:this.ResultName&&An(this.ResultName,u)?u[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,r=1,n=!1,s={},i){let A={NamedValue:{itemcount:0}};for(let c in s)A.NamedValue[A.NamedValue.itemcount++]={Name:c,Value:s[c]};let u={FilterBy:A};return this.Wuid&&this.ResultName!==void 0?(u.Wuid=this.Wuid,u.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(u.Wuid=this.Wuid,u.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(u.LogicalName=this.LogicalFileName,u.Cluster=this.NodeGroup):this.LogicalFileName&&(u.LogicalName=this.LogicalFileName),u.Start=e,u.Count=r,u.SuppressXmlSchema=n,this.connection.WUResult(u,i).then(c=>c)}},id=class extends Ke{constructor(){super(e=>Ke.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};var eo=class extends Ve{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,r){super(),this.scope=e,this.set(r)}},aB=class extends Ve{_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(){let e=[],r={start:null,end:null};return this.Properties.Property.forEach(n=>{n.Measure==="ts"&&n.Name.indexOf("Started")>=0?r.start=n:this.ScopeName&&n.Measure==="ts"&&n.Name.indexOf("Finished")>=0?r.end=n:e.push(new eo(this,n))}),r.start&&r.end?(r.start.FormattedEnd=r.end.Formatted,e.push(new eo(this,r.start))):r.start?e.push(new eo(this,r.start)):r.end&&e.push(new eo(this,r.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(r=>{this._attributeMap[r.Name]=r}),this.Properties.Property=[];for(let r in this._attributeMap)this._attributeMap.hasOwnProperty(r)&&this.Properties.Property.push(this._attributeMap[r].properties)}parentScope(){let 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(let r of this.children())if(r.walk(e))return!0;return e.end(this)}formattedAttrs(){let e={};for(let r in this._attributeMap)e[r]=this._attributeMap[r].Formatted||this._attributeMap[r].RawValue;return e}rawAttrs(){let e={};for(let r in this._attributeMap)e[r]=this._attributeMap[r].RawValue;return e}hasAttr(e){return this._attributeMap[e]!==void 0}attr(e){return this._attributeMap[e]||new eo(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let r="",n=[];r=this.Id,n.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&n.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),n.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);let s=this.formattedAttrs();for(let i in s)i==="Label"?r=s[i]:n.push(`<tr><td class="key">${i}</td><td class="value">${s[i]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
972
972
|
<h4 align="center">${r}</h4>
|
|
973
973
|
<table>
|
|
974
974
|
${n.join("")}
|
|
975
975
|
</table>
|
|
976
|
-
</div>`}},sc=class extends aB{wu;constructor(e,r){super(r),this.wu=e}};var od=class extends Ve{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,r,n){super(),e instanceof _t?this.connection=e:this.connection=new _t(e),this.set({Wuid:r,...n})}};var Ad=class extends Ve{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,r,n){super(),e instanceof _t?this.connection=e:this.connection=new _t(e);let s=NI(n.Value);this.set({Wuid:r,Seconds:Math.round(s*1e3)/1e3,HasSubGraphId:n.SubGraphId!==void 0,...n})}};var Uq=(0,ld.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),Nq=(0,ld.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),Tq=(0,gU.format)(",");function Mq(t){return t&&!isNaN(+t)?Tq(+t):t}function cU(t,e,r){t[e]===void 0||t[e][r]===void 0||e==="__proto__"||e==="constructor"||e==="prototype"||delete t[e][r]}var ic="DefinitionList",xq=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,kq=["Avg","Min","Max","Delta","StdDev"],Wq=["SkewMin","SkewMax","NodeMin","NodeMax"],Lq=/[A-Z][a-z]*/g;function vq(t){for(let r of Wq){let n=t.indexOf(r);if(n===0){let s="",i=t.slice(n+r.length);return{measure:s,ext:r,label:i}}}let e=t.match(Lq);if(e?.length){let r=e.shift(),n=e.join("");for(let s of kq){let i=n.indexOf(s);if(i===0)return n=n.slice(i+s.length),{measure:r,ext:s,label:n}}return{measure:r,ext:"",label:n}}return{measure:"",ext:"",label:t}}var lU={};function Pq(t){let e=lU[t];return e||(e=vq(t),lU[t]=e),e}function qn(t,e){return t.__formattedProps?.[e]??t[e]}function ad(t){if(t===void 0)return;let e=parseFloat(t);return isNaN(e)?void 0:e}function Gq(t,e,r){let n=Pq(e);if(!r[n.measure]){r[n.label]=!0;let s=ad(t[`${n.measure}Avg${n.label}`]),i=ad(t[`${n.measure}Min${n.label}`]),A=ad(t[`${n.measure}Max${n.label}`]),u=ad(t[`${n.measure}StdDev${n.label}`]),c=Math.max((s-i)/u,(A-s)/u);return{Key:`${n.measure}${n.label}`,Value:qn(t,`${n.measure}${n.label}`),Avg:qn(t,`${n.measure}Avg${n.label}`),Min:qn(t,`${n.measure}Min${n.label}`),Max:qn(t,`${n.measure}Max${n.label}`),Delta:qn(t,`${n.measure}Delta${n.label}`),StdDev:qn(t,`${n.measure}StdDev${n.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:qn(t,`SkewMin${n.label}`),SkewMax:qn(t,`SkewMax${n.label}`),NodeMin:qn(t,`NodeMin${n.label}`),NodeMax:qn(t,`NodeMax${n.label}`)}}return null}var ud=kt("workunit.ts"),uB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},cd=new uB,qA=class t extends Ve{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",0)}get State(){return this.get("State")||tB[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 id;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,()=>sd.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){let e={};return this.CResults.forEach(r=>{e[r.Sequence]=r}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new Ad(this.connection,this.Wuid,e))}_graphCache=new jh;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 Jh(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 Zh(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 od(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}static create(e){let r=new t(e);return r.connection.WUCreate().then(n=>(cd.set(r),r.set(n.Workunit),r))}static attach(e,r,n){let s=cd.get({BaseUrl:e.baseUrl,Wuid:r},()=>new t(e,r));return n&&s.set(n),s}static existsLocal(e,r){return cd.has({BaseUrl:e,Wuid:r})}static submit(e,r,n,s=!1){return t.create(e).then(i=>i.update({QueryText:n})).then(i=>s?i.submit(r,$i.Action.Compile):i.submit(r))}static compile(e,r,n){return t.submit(e,r,n,!0)}static query(e,r){return new _t(e).WUQuery(r).then(s=>s.Workunits.ECLWorkunit.map(function(i){return t.attach(e,i.Wuid,i)}))}constructor(e,r){super(),this.connection=new _t(e),this.topologyConnection=new Xt(e),this.clearState(r)}clearState(e){this.clear({Wuid:e,StateID:0})}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(r=>(this.set(r.Workunit),this))}submit(e,r=$i.Action.Run,n){let s;return e!==void 0?s=Promise.resolve(e):s=this.topologyConnection.DefaultTpLogicalClusterQuery().then(i=>i.Name),this._debugMode=!1,r===$i.Action.Debug&&(r=$i.Action.Run,this._debugMode=!0),s.then(i=>this.connection.WUUpdate({Wuid:this.Wuid,Action:r,ResultLimit:n,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(A=>(this.set(A.Workunit),this._submitAction=r,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:i})))).then(()=>this)}isComplete(){switch(this.StateID){case 1:return this.ActionEx==="compile"||this._submitAction===$i.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){switch(this.StateID){case 999:return!0;default:}return!1}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(sr.ECLWUActions.SetToFailed)}pause(){return this.WUAction(sr.ECLWUActions.Pause)}pauseNow(){return this.WUAction(sr.ECLWUActions.PauseNow)}resume(){return this.WUAction(sr.ECLWUActions.Resume)}abort(){return this.WUAction(sr.ECLWUActions.Abort)}protect(){return this.WUAction(sr.ECLWUActions.Protect)}unprotect(){return this.WUAction(sr.ECLWUActions.Unprotect)}delete(){return this.WUAction(sr.ECLWUActions.Delete)}restore(){return this.WUAction(sr.ECLWUActions.Restore)}deschedule(){return this.WUAction(sr.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(sr.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=>t.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===1&&!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,r){return e?await Promise.all([this.refreshInfo(r),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(r=>r.Scopes.Scope)}normalizeDetails(e,r){let n={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},s=[];for(let i of r){let A={},u={};if(i&&i.Id&&i.Properties&&i.Properties.Property)for(let l in i.Properties.Property){let d=i.Properties.Property[l];if(d.Measure==="ns"&&(d.Measure="s"),d.Name==="Kind"){let p=parseInt(d.RawValue,10);d.Formatted=e.Activities.Activity.filter(B=>B.Kind===p)[0].Name??d.RawValue}switch(n[d.Name]={...d},cU(n,d.Name,"RawValue"),cU(n,d.Name,"Formatted"),d.Measure){case"bool":A[d.Name]=!!+d.RawValue;break;case"sz":A[d.Name]=+d.RawValue;break;case"s":A[d.Name]=+d.RawValue/1e9;break;case"ns":A[d.Name]=+d.RawValue;break;case"ts":A[d.Name]=new Date(+d.RawValue/1e3).toISOString();break;case"cnt":A[d.Name]=+d.RawValue;break;case"cost":A[d.Name]=+d.RawValue/1e6;break;case"node":A[d.Name]=+d.RawValue;break;case"skw":A[d.Name]=+d.RawValue;break;case"cpu":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:A[d.Name]=d.RawValue}u[d.Name]=Mq(d.Formatted??A[d.Name])}let c={id:i.Id,name:i.ScopeName,type:i.ScopeType,Kind:i.Kind,Label:i.Label,__formattedProps:u,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...A};if(c[ic])try{let l=JSON.parse(c[ic].split("\\").join("\\\\"));c[ic]=[],l.forEach((d,p)=>{let B=d.match(xq);if(B){let E=(B[1]??"")+B[2]+B[3],b=parseInt(B[5]),D=parseInt(B[6]);c[ic].push({filePath:E,line:b,col:D})}})}catch{ud.error(`Unexpected "DefinitionList": ${c[ic]}`)}let g={};for(let l in c)if(l.indexOf("__")!==0){let d=Gq(c,l,g);d&&(c.__groupedProps[d.Key]=d,!isNaN(d.StdDevs)&&c.__StdDevs<d.StdDevs&&(c.__StdDevs=d.StdDevs,c.__StdDevsSource=d.Key))}s.push(c)}return{meta:e,columns:n,data:s}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(r=>this.normalizeDetails(r[0],r[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(r=>r.Scopes.Scope.map(n=>new sc(this,n)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(r=>{let n=[],s={};r.Scopes.Scope.forEach(i=>{if(s[i.ScopeName])return s[i.ScopeName].update(i),null;{let A=new sc(this,i);return s[A.ScopeName]=A,A}});for(let i in s)if(s.hasOwnProperty(i)){let A=s[i],u=A.parentScope();u&&s[u]?s[u].children().push(A):n.push(A)}return n})}fetchGraphDetails(e=[],r){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:r},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(r=>Xh(r))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{let r={};e.forEach(s=>{r[s.ScopeName]=r[s.ScopeName]||{scope:s.ScopeName,start:null,elapsed:null,finish:null},s.CAttributes.forEach(i=>{i.Name==="TimeElapsed"?r[s.ScopeName].elapsed=+i.RawValue:i.Measure==="ts"&&i.Name.indexOf("Started")>=0&&(r[s.ScopeName].start=i.Formatted)})});let n=[];for(let s in r){let i=r[s];if(i.start&&i.elapsed){let A=Nq(i.start);A.setMilliseconds(A.getMilliseconds()+i.elapsed/1e6),i.finish=Uq(A),n.push(i)}}return n.sort((s,i)=>s.start<i.start?-1:s.start>i.start?1:0),n})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,r,n){if(this.isCallback(r))switch(e){case"completed":super.on("propChanged","StateID",s=>{this.isComplete()&&r([s])});break;case"changed":super.on(e,r);break;default:}else switch(e){case"changed":super.on(e,r,n);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((r,n)=>{let s=this.watch(i=>{e&&e(i),this.isComplete()&&(s.release(),r(this))})})}watchUntilRunning(e){return new Promise((r,n)=>{let s=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(s.release(),r(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(r=>(r.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set("StateID",999)):this.set(r.Workunits.ECLWorkunit[0]),r)).catch(r=>{if(!r.Exception.some(s=>s.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw ud.warning(`Unexpected ESP exception: ${r.message}`),r;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),cd.set(this),e))}WUInfo(e={}){let r=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:r,IncludeResultsViewNames:r,SuppressResultSchemas:!1}).then(n=>(this.set(n.Workunit),r&&this.set({ResultViews:n.ResultViews}),n)).catch(n=>{if(!n.Exception.some(i=>i.Code===20080?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw ud.warning(`Unexpected ESP exception: ${n.message}`),n;return{}})}WUResubmit(e){return this.connection.WUResubmit(Jc({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(Jc({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(r=>Jc({Scopes:{Scope:[]}},r))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(r=>this.refresh().then(()=>(this._monitor(),r)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:sr.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let r=new Yh({baseUrl:""}),n={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return r.WUPublishWorkunitEx(n)}WUCDebug(e,r={}){let n="";for(let s in r)r.hasOwnProperty(s)&&(n+=` ${s}='${r[s]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${n}/>`}).then(s=>s)}debug(e,r){return this.isDebugging()?this.WUCDebug(e,r).then(n=>{let s=n.children(e);return s.length?s[0]:new rs(e)}).catch(n=>(ud.error(n),Promise.resolve(new rs(e)))):Promise.resolve(new rs(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{let r={...this.DebugState,...e.$};return this.set({DebugState:r}),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(r=>{if(r.name==="break")return r.$})}debugBreakpointAdd(e,r,n){return this.debug("breakpoint",{id:e,mode:r,action:n}).then(s=>this.debugBreakpointResponseParser(s))}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=uU(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(r=>Yq(r,e))}debugPrint(e,r=0,n=10){return this.debug("print",{edgeID:e,startRow:r,numRows:n}).then(s=>s.children().map(i=>{let A={};return i.children().forEach(u=>{A[u.name]=u.content}),A}))}},cB="definition";function Vq(t){return t._[cB]!==void 0}function _q(t){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(t._[cB]);if(e){let[,r,n,s]=e;return r.replace(/\/\.\//g,"/"),{id:t._.id,file:r,line:+n,column:+s}}throw new Error(`Bad definition: ${t._[cB]}`)}function Yq(t,e){let r=[];for(let n of t.vertices)if(Vq(n)){let s=_q(n);(s&&!e||e===s.file)&&r.push(s)}return r.sort((n,s)=>n.line-s.line)}var gd,hU=class t extends Ve{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,r){return gd||(gd=new t(e)),r&&gd.set(r),gd}constructor(e){super(),e instanceof tc?this.connection=e:this.connection=new tc(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(r=>e===""||r.ClusterName===e).map(r=>qA.attach(this.connection.connectionOptions(),r.Wuid,r))}setBanner(e){return this.connection.SetBanner({...e}).then(r=>(this.set(r),this))}lazyRefresh=FI(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};var Hq=kt("logicalFile.ts"),lB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},Oq=new lB,dU=class t extends Ve{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 properties(){return this.get()}static attach(e,r,n,s){let i=Oq.get({BaseUrl:e.baseUrl,Cluster:r,Name:n},()=>new t(e,r,n));return s&&i.set(s),i}constructor(e,r,n){super(),e instanceof ec?this.connection=e:this.connection=new ec(e),this.clear({Cluster:r,Name:n})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let r of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let n of r?.DFUFileParts?.DFUPart||[]){let s={...r,...n};delete s.DFUFileParts,e.push(s)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(r=>(this.set({Cluster:this.Cluster,...r.FileDetail}),r))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail}),e.FileDetail)).catch(e=>{if(!e.Exception.some(n=>n.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw Hq.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||[])}};var gB=class extends Ke{constructor(){super(e=>e.Address)}},qq=new gB,hd=class t extends Ve{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,r,n){let s=qq.get({Address:r},()=>new t(e));return n&&s.set(n),s}constructor(e){super(),e instanceof ri?this.connection=e:this.connection=new ri(e)}};var fU=sn(rB(),1);var dB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},Jq=new dB,JA=class t extends Ve{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=>hd.attach(this.machineConnection,e.Address,e))}static attach(e,r,n){let s=Jq.get({BaseUrl:e.baseUrl,Name:r},()=>new t(e,r));return n&&s.set(n),s}constructor(e,r){super(),e instanceof Xt?(this.connection=e,this.machineConnection=new ri(e.connectionOptions())):(this.connection=new Xt(e),this.machineConnection=new ri(e)),this.clear({Name:r})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(r=>{let n=[];for(let s of r.TargetClusterInfoList.TargetClusterInfo)for(let i of s.Processes.MachineInfoEx)n.push(i);return this.set("MachineInfoEx",n),this.CMachineInfoEx})}machineStats(){let e=0,r=0,n=0;for(let s of this.CMachineInfoEx)for(let i of s.Storage.StorageInfo){r+=i.Available,n+=i.Total;let A=1-i.Available/i.Total;A>e&&(e=A)}return{maxDisk:e,meanDisk:1-(n?r/n:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function lX(t){let e;return t instanceof Xt?e=t:e=new Xt(t),e.TpListTargetClusters({}).then(r=>r.TargetClusters.TpClusterNameType.map(n=>JA.attach(t,n.Name,n)))}var hB={};function gX(t){if(!hB[t.baseUrl]){let e;t instanceof Xt?e=t:e=new Xt(t),hB[t.baseUrl]=e.TpListTargetClusters({}).then(r=>{let n,s,i;r.TargetClusters.TpClusterNameType.forEach(u=>{n||(n=u),!s&&u.IsDefault===!0&&(s=u),!i&&u.Type==="hthor"&&(i=u)});let A=s||i||n;return JA.attach(t,A.Name,A)})}return hB[t.baseUrl]}var pB=class extends Ke{constructor(){super(e=>e.BaseUrl)}},jq=new pB,dd=class t extends Ve{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=>JA.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,r){let n=jq.get({BaseUrl:e.baseUrl},()=>new t(e));return r&&n.set(r),n}constructor(e){super(),e instanceof Xt?this.connection=e:this.connection=new Xt(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(r=>{let n=this.connection.protocol(),s=this.connection.ip(),i=n==="https:"?"18002":"8002";if(An("ServiceList.TpEspServers.TpEspServer",r)){for(let A of r.ServiceList.TpEspServers.TpEspServer)if(An("TpBindings.TpBinding",A))for(let u of A.TpBindings.TpBinding)u.Service===e&&u.Protocol+":"===n&&(i=u.Port)}return`${n}//${s}:${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(r=>(this.set({LogicalClusters:r.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(r=>(this.set({Services:r.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,r,n){if(this.isCallback(r))switch(e){case"changed":super.on(e,r);break;default:}else switch(e){case"changed":super.on(e,r,n);break;default:}return this._monitor(),this}};function ni(t,e,r){e==="__proto__"||e==="constructor"||e==="prototype"||(t[e]=r)}function oc(t){return t=""+t,t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function zq(t){if(t){if(!isNaN(+t))return parseFloat(t)}else return 0;let r=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(t);if(!r)return 0;let n=+r[1]||0,s=+r[2]||0,i=+r[3]||0,A=+r[4]||0,u=+r[5]||0,c=+r[6]||0,g=+r[7]||0;return n*24*60*60+s*60*60+i*60+A+u/1e3+c/1e6+g/1e9}function si(t,e){let r=t.indexOf(e);return r!==-1?parseFloat(t.substring(0,r)):-1}function Xq(t){if(t){if(!isNaN(+t))return parseFloat(t)}else return 0;let e=si(t,"Kb");return e>=0?e*1024:(e=si(t,"Mb"),e>=0?e*Math.pow(1024,2):(e=si(t,"Gb"),e>=0?e*Math.pow(1024,3):(e=si(t,"Tb"),e>=0?e*Math.pow(1024,4):(e=si(t,"Pb"),e>=0?e*Math.pow(1024,5):(e=si(t,"Eb"),e>=0?e*Math.pow(1024,6):(e=si(t,"Zb"),e>=0?e*Math.pow(1024,7):(e=si(t,"b"),e>=0?e:0)))))))}function Zq(t){return t?parseFloat(t):0}var fB=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,r,n,s){this.noSpills=s,e.forEach(i=>{this.graph.isVertex(i)?(this.calcInVertexVisibility(i,n),this.calcOutVertexVisibility(i,n)):this.graph.isEdge(i)?(this.calcInVertexVisibility(i.getSource(),n-1),this.calcOutVertexVisibility(i.getTarget(),n-1)):this.graph.isSubgraph(i)&&(this.m_visibleSubgraphs[i.__hpcc_id]=i,this.calcSubgraphVisibility(i,r-1))}),this.calcVisibility2()}calcInVertexVisibility(e,r){this.noSpills&&e.isSpill()&&r++,this.m_visibleVertices[e.__hpcc_id]=e,r>0&&e.getInEdges().forEach(n=>{this.calcInVertexVisibility(n.getSource(),r-1)})}calcOutVertexVisibility(e,r){this.noSpills&&e.isSpill()&&r++,this.m_visibleVertices[e.__hpcc_id]=e,r>0&&e.getOutEdges().forEach(n=>{this.calcOutVertexVisibility(n.getTarget(),r-1)})}calcSubgraphVisibility(e,r){if(r<0)return;r>0&&e.__hpcc_subgraphs.forEach((s,i)=>{this.calcSubgraphVisibility(s,r-1)}),e.__hpcc_subgraphs.forEach((s,i)=>{this.m_visibleSubgraphs[s.__hpcc_id]=s}),e.__hpcc_vertices.forEach((s,i)=>{this.m_visibleVertices[s.__hpcc_id]=s});let n={};this.graph.edges.forEach((s,i)=>{s.getSource().__hpcc_parent!==s.getTarget().__hpcc_parent&&e===this.getCommonAncestor(s)&&(n[s.getSource().__hpcc_parent.__hpcc_id+"::"+s.getTarget().__hpcc_parent.__hpcc_id]||(n[s.getSource().__hpcc_parent.__hpcc_id+"::"+s.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[s.__hpcc_id]=s))})}buildVertexString(e,r){let n="",s="",i=e.getProperties();for(let A in i)r&&A.indexOf("_kind")>=0?s+='<att name="_kind" value="point"/>':A==="id"||A==="label"?n+=" "+A+'="'+oc(i[A])+'"':s+='<att name="'+A+'" value="'+oc(i[A])+'"/>';return"<node"+n+">"+s+"</node>"}buildEdgeString(e){let r="",n="",s=e.getProperties();for(let i in s)i.toLowerCase()==="id"||i.toLowerCase()==="label"||i.toLowerCase()==="source"||i.toLowerCase()==="target"?r+=" "+i+'="'+oc(s[i])+'"':n+='<att name="'+i+'" value="'+oc(s[i])+'"/>';return"<edge"+r+">"+n+"</edge>"}getAncestors(e,r){let n=e.__hpcc_parent;for(;n;)r.push(n),n=n.__hpcc_parent}getCommonAncestorV(e,r){let n=[],s=[];this.getAncestors(e,n),this.getAncestors(r,s);let i=n.length-1,A=s.length-1,u=null;for(;i>=0&&A>=0&&n[i]===s[A];)u=n[i],--i,--A;return u}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let r=[];this.getAncestors(e,r),r.forEach((n,s)=>{this.m_visibleSubgraphs[n.__hpcc_id]=n})}calcVisibility2(){for(let e in this.m_visibleVertices){let r=this.m_visibleVertices[e];r.getInEdges().forEach((n,s)=>{this.m_visibleEdges[n.__hpcc_id]=n}),r.getOutEdges().forEach((n,s)=>{this.m_visibleEdges[n.__hpcc_id]=n}),this.calcAncestorVisibility(r)}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(let e in this.m_visibleEdges){let r=this.m_visibleEdges[e],n=r.getSource();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){let i=n.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),n=i[0].getSource(),this.addSemiVisibleVertex(n);else break}let s=r.getTarget();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){let i=s.getOutEdges();if(i.length)this.addSemiVisibleEdge(i[0]),s=i[0].getTarget(),this.addSemiVisibleVertex(s);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,r)=>{this.edgeVisited(e)})}subgraphVisited(e,r=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let n="";this.m_xgmml+=r?"":'<node id="'+e.__hpcc_id+'"><att><graph>';let s=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),s===this.m_xgmml.length){let A=e.__hpcc_vertices[0];A&&(this.m_xgmml+=this.buildVertexString(A,!0))}let i=e.getProperties();for(let A in i)n+='<att name="'+A+'" value="'+oc(i[A])+'"/>';this.m_xgmml+=r?"":"</graph></att>"+n+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}},Ac=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,r){this.__hpcc_graph=e,this.__hpcc_id=r,this._globalID=r}getProperties(){let e={};for(let r in this)r.indexOf("__")!==0&&this.hasOwnProperty(r)&&(e[r]=this[r]);return e}},ii=class extends Ac{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,r){super(e,r),this._globalType=r==="0"?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=r}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(r=>e===r)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(r=>e===r)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(r=>e!==r)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(r=>e===r)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(r=>e!==r)}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((r,n)=>{e.subgraphVisited(r)&&r.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((r,n)=>{e.vertexVisited(r)})}},to=class extends Ac{_globalType="Vertex";_isSpill;constructor(e,r){super(e,r)}isSpill(){return this._isSpill}remove(){let e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(r=>{r.remove()}),this.getOutEdges().forEach(r=>{r.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)}},ro=class extends Ac{_globalType="Edge";_sourceActivity;source;_targetActivity;target;constructor(e,r){super(e,r),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]}},pd=class t{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;let n=new DOMParser().parseFromString(e,"text/xml");this.walkDocument(n.documentElement,"0")}isSubgraph(e){return e instanceof ii}isVertex(e){return e instanceof to}isEdge(e){return e instanceof ro}getGlobalType(e){return e instanceof to?3:e instanceof ro?4:e instanceof ii?2:e instanceof t?1:0}getGlobalTypeString(e){return e instanceof to?"Vertex":e instanceof ro?"Edge":e instanceof ii?"Cluster":e instanceof t?"Graph":"Unknown"}getItem(e,r){if(!this.idx[r])switch(e.tagName){case"graph":let s=new ii(this,r);this.subgraphs.push(s),this.idx[r]=s;break;case"node":let i=new to(this,r);this.vertices.push(i),this.idx[r]=i;break;case"edge":let A=new ro(this,r);this.edges.push(A),this.idx[r]=A;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}let n=this.idx[r];return Array.from(e.attributes).forEach(s=>{ni(n,s.name,s.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof ii?this.subgraphs=this.subgraphs.filter(r=>e!==r):e instanceof to?this.vertices=this.vertices.filter(r=>e!==r):e instanceof ro&&(this.edges=this.edges.filter(r=>e!==r))}getChildByTagName(e,r){let n=null;return Array.from(e.childNodes).some(s=>{if(s.tagName===r)return n=s,!0}),n}walkDocument(e,r){let n=this.getItem(e,r);return e.childNodes.forEach(s=>{switch(s.nodeType){case 1:switch(s.tagName){case"graph":break;case"node":let i=!1,A=this.getChildByTagName(s,"att");if(A){let d=this.getChildByTagName(A,"graph");if(d){i=!0;let p=this.walkDocument(d,s.getAttribute("id"));n.addSubgraph(p)}}if(!i){let d=this.walkDocument(s,s.getAttribute("id"));n.addVertex(d)}break;case"att":let u=s.getAttribute("name"),c="_"+u,g=s.getAttribute("value");u.indexOf("Time")===0?(ni(n,c,g),ni(n,u,""+zq(g))):u.indexOf("Size")===0?(ni(n,c,g),ni(n,u,""+Xq(g))):u.indexOf("Skew")===0?(ni(n,c,g),ni(n,u,""+Zq(g))):ni(n,u,g);break;case"edge":let l=this.walkDocument(s,s.getAttribute("id"));if(l.NumRowsProcessed!==void 0?l._eclwatchCount=l.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.Count!==void 0?l._eclwatchCount=l.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.count!==void 0&&(l._eclwatchCount=l.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),l.inputProgress&&(l._eclwatchInputProgress="["+l.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),l.SkewMaxRowsProcessed&&l.SkewMinRowsProcessed&&(l._eclwatchSkew="+"+l.SkewMaxRowsProcessed+", "+l.SkewMinRowsProcessed),!l._dependsOn){if(!l._childGraph){if(l._sourceActivity||l._targetActivity){l._isSpill=!0;let d=l.getSource();d&&(d._isSpill=!0);let p=l.getTarget();p&&(p._isSpill=!0)}}}n.addEdge(l);break;default:break}break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break;default:break}}),n}removeSubgraphs(){[...this.subgraphs].forEach(r=>{r.__hpcc_parent instanceof ii&&r.remove()})}removeSpillVertices(){[...this.vertices].forEach(r=>{r.isSpill()&&r.remove()})}getLocalisedXGMML(e,r,n,s){let i=new fB(this);return i.calcVisibility(e,r,n,s),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var EB=kt("@hpcc-js/comms/ecl/query.ts"),Kq=(0,fU.format)("~s");function $q(t){return!isNaN(parseFloat(t))&&!isNaN(t-0)}var CB=class extends Ke{constructor(){super(e=>Ke.hash([e.QueryId,e.QuerySet]))}},eJ=new CB,pU=class t extends Ve{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,r,n,s){super(),e instanceof _t?this.wsWorkunitsService=e:this.wsWorkunitsService=new _t(e),this.topology=dd.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:r,QueryId:n,...s})}static attach(e,r,n,s){let i=eJ.get({BaseUrl:e.baseUrl,QuerySet:r,QueryId:n},()=>new t(e,r,n));return s&&i.set(s),i}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(let r of e?.TpEspServers?.TpEspServer??[])for(let n of r?.TpBindings?.TpBinding??[])if(n?.Service==="ws_ecl"){let s=`${n.Protocol}://${globalThis.location.hostname}:${n.Port}`;return new Mh({baseUrl:s})}})),this._eclService}async fetchDetails(){let e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){let e=await this.wsEclService();try{this._requestSchema=await e?.requestJson(this.QuerySet,this.QueryId)??[]}catch(r){EB.debug(r.message??r),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(r){EB.debug(r.message??r),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",r=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:r}).then(n=>{let s=new pd,i=!0;for(let A of n?.Graphs?.ECLGraphEx||[])i?(s.load(A.Graph),i=!1):s.merge(A.Graph);return s})}fetchDetailsNormalized(e={}){let r=qA.attach(this.wsWorkunitsService,this.Wuid);return r?Promise.all([this.fetchGraph(),r.fetchDetailsMeta(),r.fetchDetailsRaw(e)]).then(n=>{let s=n[0],i=n[1],u=n[2].map(c=>{if(c.Id[0]==="a"||c.Id[0]==="e"){let g=s.idx[c.Id.substring(1)];for(let l in g)if(l.charAt(0)!=="_"&&l.charAt(0)===l.charAt(0).toUpperCase()&&(typeof g[l]=="string"||typeof g[l]=="number"||typeof g[l]=="boolean")&&!c.Properties.Property.some(d=>d.Name===l)){let p=$q(g[l])?parseFloat(g[l]):g[l],B=g[l];l.indexOf("Time")>=0&&(p=p/1e9,B=Kq(p)+"s"),c.Properties.Property.push({Name:l,RawValue:p,Formatted:B})}}return c});return r.normalizeDetails(i,u)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let r=await this.wsEclService();try{return r?.submit(this.QuerySet,this.QueryId,e).then(n=>{for(let s in n)n[s]=n[s].Row;return n})??[]}catch(n){return EB.debug(n.message??n),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){let e=[];for(let r in this.responseFields())e.push(r);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};var BB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},tJ=new BB,no=class extends fa{constructor(r,n,s){super();this.key=r;this.value=n;this.oldValue=s}get canConflate(){return!0}conflate(r){return this.key===r.key?(this.value=r.value,!0):!1}void(){return this.value===this.oldValue}},EU=class t{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new Ea;static attach(e,r="HPCCApps",n,s=!0){return tJ.get({BaseUrl:e.baseUrl,Name:r,UserSpecific:s,Namespace:n},()=>new t(e,r,n,s))}constructor(e,r,n,s){e instanceof rc?this.connection=e:this.connection=new rc(e),this.Name=r,this.UserSpecific=s,this.Namespace=n}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})}set(e,r,n=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:r}).then(s=>{let i=this._knownValues[e];this._knownValues[e]=r,n&&this._dispatch.post(new no(e,r,i))}).catch(s=>{console.error(`Store.set("${e}", "${r}") failed:`,s)})}get(e,r=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(n=>{let s=this._knownValues[e];return this._knownValues[e]=n.Value,r&&this._dispatch.post(new no(e,n.Value,s)),n.Value}).catch(n=>{console.error(`Store.get(${e}) failed:`,n)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(r=>{let n={},s=this._knownValues;if(this._knownValues={},r.Pairs.Pair.forEach(i=>{let A=this._knownValues[i.Key];this._knownValues[i.Key]=i.Value,delete s[i.Key],n[i.Key]=i.Value,e&&this._dispatch.post(new no(i.Key,i.Value,A))}),e)for(let i in s)this._dispatch.post(new no(i,void 0,s[i]));return n}).catch(r=>(console.error("Store.getAll failed:",r),{}))}delete(e,r=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(n=>{let s=this._knownValues[e];delete this._knownValues[e],r&&this._dispatch.post(new no(e,void 0,s))}).catch(n=>{console.error(`Store.delete(${e}) failed:`,n)})}monitor(e){return this._dispatch.attach(e)}};var rJ=kt("@hpcc-js/comms/dfuWorkunit.ts");var IB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},CU=new IB,BU=class t extends Ve{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,r){let n=new t(e);return n.connection.CreateDFUWorkunit({DFUServerQueue:r}).then(s=>(CU.set(n),n.set(s.result),n))}static attach(e,r,n){let s=CU.get({BaseUrl:e.baseUrl,ID:r},()=>new t(e,r));return n&&s.set(n),s}static sprayFixed(e,r){let n=new Ki(e);return n.SprayFixedEx({...r}).then(s=>{let i=s.wuid;return n.GetDFUWorkunit({wuid:i}).then(A=>t.attach(e,i,A.result))})}static sprayVariable(e,r){let n=new Ki(e);return n.SprayVariableEx({...r}).then(s=>{let i=s.wuid;return n.GetDFUWorkunit({wuid:i}).then(A=>t.attach(e,i,A.result))})}static despray(e,r){let n=new Ki(e);return n.DesprayEx({...r}).then(s=>{let i=s.wuid;return n.GetDFUWorkunit({wuid:i}).then(A=>t.attach(e,i,A.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;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){switch(this.State){case 999:return!0;default:}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction($u.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(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let 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(r=>r).catch(r=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(r=>e===$u.DFUWUActions.Delete?r:this.refresh().then(()=>(this._monitor(),r)))}on(e,r,n){if(this.isCallback(r))switch(e){case"finished":super.on("propChanged","State",s=>{this.isComplete()&&r([s])});break;case"changed":super.on(e,r);break;default:}else switch(e){case"changed":super.on(e,r,n);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((r,n)=>{let s=this.watch(i=>{e&&e(i),this.isComplete()&&(s.release(),r(this))})})}watchUntilRunning(e){return new Promise((r,n)=>{let s=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(s.release(),r(this))})})}constructor(e,r){super(),this.connection=new Ki(e),this.topologyConnection=new Xt(e),this.clearState(r)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(r=>(this.set(r.result),r)).catch(r=>{if(!r.Exception.some(s=>s.Code===20080||s.Code===20081?(this.clearState(this.ID),this.set("State",999),!0):!1))throw rJ.warning(`Unexpected ESP exception: ${r.message}`),r;return{}})}};var OU=sn(kU(),1);import*as HU from"node:child_process";import*as Zt from"node:fs";import*as oo from"node:os";import*as mr from"node:path";import*as so from"node:fs";import*as dt from"node:path";var BJ=kt("clienttools/eclmeta"),IJ=!1;function XA(t,e,r){if(IJ){for(let n in t){let s=`${e}.${n}`;n!=="$"&&r[n]===void 0&&r[n.toLowerCase()+"s"]===void 0&&BJ.debug(s)}t.$&&XA(t.$,e+".$",r)}}var FB=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},UB=class{__attrs;definition;get scope(){return this.definition}name;type;constructor(e,r){this.__attrs=r.$,this.definition=e,this.name=r.$.name,this.type=r.$.type}},ZA=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,r,n,s,i=1,A=0,u=0,c=Number.MAX_VALUE){this.name=e,this.type=r,this.sourcePath=dt.normalize(n),this.line=+i-1,this.start=+A,this.body=+u,this.end=+c,this.definitions=this.parseDefinitions(s)}parseDefinitions(e=[]){return e.map(r=>{let n=new NB(this.sourcePath,r);return XA(r,"definition",n),n})}contains(e){return e>=this.start&&e<=this.end}scopeStackAt(e){let r=[];return this.contains(e)&&(r.push(this),this.definitions.forEach(n=>{r=n.scopeStackAt(e).concat(r)})),r}_resolve(e=[],r){let n=r.split("."),s=n.shift(),i=SI(e,A=>typeof A.name=="string"&&typeof s=="string"&&A.name.toLowerCase()===s.toLowerCase());return i&&i.definitions.length&&n.length?this._resolve(i.definitions,n.join(".")):i}resolve(e){return this._resolve(this.definitions,e)}suggestions(){return this.definitions.map(e=>({name:e.name,type:this.type}))}},NB=class extends ZA{__attrs;exported;shared;fullname;inherittype;attrs;fields;constructor(e,r){super(r.$.name,r.$.type,e,r.children("Definition"),r.$.line,r.$.start,r.$.body,r.$.end),this.__attrs=r.$,this.exported=!!r.$.exported,this.shared=!!r.$.shared,this.fullname=r.$.fullname,this.inherittype=r.$.inherittype,this.attrs=this.parseAttrs(r.children("Attr")),this.fields=this.parseFields(r.children("Field"))}parseAttrs(e=[]){return e.map(r=>{let n=new FB(r);return XA(r,"attr",n),n})}parseFields(e=[]){return e.map(r=>{let n=new UB(this,r);return XA(r,"field",n),n})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},Ed=class{__attrs;name;ref;start;end;line;constructor(e){this.__attrs=e.$,this.name=e.$.name,this.ref=e.$.ref,this.start=e.$.start,this.end=e.$.end,this.line=e.$.line}},TB=class extends ZA{imports;__attrs;constructor(e){super(e.$.name,"source",e.$.sourcePath,e.children("Definition")),this.__attrs=e.$;let r=e.$.name.split(".");r.pop();let n=new rs("");n.appendAttribute("name","$"),n.appendAttribute("ref",r.join(".")),this.imports=[new Ed(n),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(r=>{let n=new Ed(r);return XA(r,"import",n),n})}resolve(e,r){let n;return!n&&r!==void 0&&this.scopeStackAt(r).some(i=>(n=i.resolve(e),!!n)),n||(n=super.resolve(e)),n}},QJ=t=>dt.basename(t).indexOf(".")===0,WU=t=>so.lstatSync(t).isDirectory()&&!QJ(t),mJ=t=>[".ecl",".ecllib"].indexOf(dt.extname(t).toLowerCase())>=0,LU=t=>so.readdirSync(t).map(e=>dt.join(t,e)).filter(e=>WU(e)||mJ(e)),MB=class extends ZA{constructor(e,r){super(e,"file",r,[])}suggestions(){return[]}},xB=class extends ZA{constructor(e,r){super(e,"folder",r,[])}suggestions(){return LU(this.sourcePath).map(e=>({name:dt.basename(e,".ecl"),type:"folder"}))}},kB=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new ha;_sourceByPath=new Fo;_test=new ha;constructor(e,r){this._workspacePath=e,this._eclccPath=r}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return vU(this._eclccPath,"",this._workspacePath).then(e=>(this._clientTools=e,e.paths())).then(e=>{for(let r of["ECLCC_ECLLIBRARY_PATH","ECLCC_PLUGIN_PATH"])e[r]&&so.existsSync(e[r])&&this.walkChildFolders(e[r],e[r]);return this})}primeWorkspace(){so.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,r,n=!1){for(let s of LU(e))WU(s)?this.visitFolder(s,r,n):this.visitFile(s,r,n)}visitFile(e,r,n=!1){let s=dt.parse(e),i=dt.join(s.dir,s.name),A=dt.relative(r,i).split(dt.sep).join(".");(n||!this._test.has(A))&&this._test.set(A,new MB("",e))}visitFolder(e,r,n=!1){let s=dt.relative(r,e).split(dt.sep).join(".");(n||!this._test.has(s))&&(this._test.set(s,new xB(s,e)),this.walkChildFolders(e,r,n))}buildStack(e,r,n){let s=r.split(".");n&&e[e.length-1]===s[0]&&s.shift();let i=[...e,...s],A=i.join(".");return{stack:i,qid:A}}walkECLScope(e,r){let n=this.buildStack(e,r.name,!0);this._test.set(n.qid,r);for(let s of r.definitions)this.walkDefinition(n.stack,s)}walkField(e,r){let n=this.buildStack(e,r.name,!1);this._test.set(n.qid,r)}walkDefinition(e,r){let n=this.buildStack(e,r.name,!0);this.walkECLScope(e,r);for(let s of r.fields)this.walkField(n.stack,s)}walkSource(e){this.walkECLScope([],e)}parseSources(e=[]){for(let r of e)if(r.$.name){let n=new TB(r);if(XA(r,"source",n),this._sourceByID.set(n.name,n),this._sourceByPath.set(n.sourcePath,n),n.name){let i=n.name.split(".").length;if(i>1){let A=n.sourcePath;for(;i>1;)A=dt.dirname(A),--i;this.visitFolder(A,dt.dirname(A))}}this.walkSource(n)}}parseMetaXML(e){let r=new WB;return r.parse(e),this.parseSources(r.sources),r.sources.map(n=>dt.normalize(n.$.sourcePath))}resolveQualifiedID(e,r,n){let s;if(!s&&this._test.has(r)&&(s=this._test.get(r).scope),!s&&this._sourceByPath.has(e)){let i=this._sourceByPath.get(e),A=r.split(".");for(let c of i.imports)if(c.name.toLowerCase()===A[0].toLowerCase()){c.ref?A[0]=c.ref:A.shift();break}let u=A.join(".");!s&&this._test.has(u)&&(s=this._test.get(u).scope),s||(u=[...i.name.split("."),...A].join("."),this._test.has(u)&&(s=this._test.get(u).scope))}return s}resolvePartialID(e,r,n){r=r.toLowerCase();let s=r.split(".");s.pop();let i=s.length===1?s[0]:s.join(".");return this.resolveQualifiedID(e,i,n)}},RB=new Fo;function io(t,e){let r=dt.normalize(t);if(!RB.has(r)){let n=new kB(r,e);RB.set(r,n),n.refresh()}return RB.get(r)}function DJ(t,e,r){if(e<0)return!1;let n=t.charAt(e);return(r?/[a-zA-Z\d_\.$]/:/[a-zA-Z\d_]/).test(n)}function L4(t,e,r){for(;DJ(t,e,r);)e+=r?-1:1;return e+(r?1:-1)}var WB=class extends fi{sources=[];endXMLNode(e){switch(e.name){case"Source":this.sources.push(e);break;default:break}super.endXMLNode(e)}};var KA=kt("clienttools/eclcc"),LB=oo.type()==="Windows_NT"?".exe":"";function PU(t){return t.split(`\r
|
|
976
|
+
</div>`}},sc=class extends aB{wu;constructor(e,r){super(r),this.wu=e}};var od=class extends Ve{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,r,n){super(),e instanceof _t?this.connection=e:this.connection=new _t(e),this.set({Wuid:r,...n})}};var Ad=class extends Ve{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,r,n){super(),e instanceof _t?this.connection=e:this.connection=new _t(e);let s=NI(n.Value);this.set({Wuid:r,Seconds:Math.round(s*1e3)/1e3,HasSubGraphId:n.SubGraphId!==void 0,...n})}};var Uq=(0,ld.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),Nq=(0,ld.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),Tq=(0,gU.format)(",");function Mq(t){return t&&!isNaN(+t)?Tq(+t):t}function cU(t,e,r){t[e]===void 0||t[e][r]===void 0||e==="__proto__"||e==="constructor"||e==="prototype"||delete t[e][r]}var ic="DefinitionList",xq=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,kq=["Avg","Min","Max","Delta","StdDev"],Wq=["SkewMin","SkewMax","NodeMin","NodeMax"],Lq=/[A-Z][a-z]*/g;function vq(t){for(let r of Wq){let n=t.indexOf(r);if(n===0){let s="",i=t.slice(n+r.length);return{measure:s,ext:r,label:i}}}let e=t.match(Lq);if(e?.length){let r=e.shift(),n=e.join("");for(let s of kq){let i=n.indexOf(s);if(i===0)return n=n.slice(i+s.length),{measure:r,ext:s,label:n}}return{measure:r,ext:"",label:n}}return{measure:"",ext:"",label:t}}var lU={};function Pq(t){let e=lU[t];return e||(e=vq(t),lU[t]=e),e}function qn(t,e){return t.__formattedProps?.[e]??t[e]}function ad(t){if(t===void 0)return;let e=parseFloat(t);return isNaN(e)?void 0:e}function Gq(t,e,r){let n=Pq(e);if(!r[n.measure]){r[n.label]=!0;let s=ad(t[`${n.measure}Avg${n.label}`]),i=ad(t[`${n.measure}Min${n.label}`]),A=ad(t[`${n.measure}Max${n.label}`]),u=ad(t[`${n.measure}StdDev${n.label}`]),c=Math.max((s-i)/u,(A-s)/u);return{Key:`${n.measure}${n.label}`,Value:qn(t,`${n.measure}${n.label}`),Avg:qn(t,`${n.measure}Avg${n.label}`),Min:qn(t,`${n.measure}Min${n.label}`),Max:qn(t,`${n.measure}Max${n.label}`),Delta:qn(t,`${n.measure}Delta${n.label}`),StdDev:qn(t,`${n.measure}StdDev${n.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:qn(t,`SkewMin${n.label}`),SkewMax:qn(t,`SkewMax${n.label}`),NodeMin:qn(t,`NodeMin${n.label}`),NodeMax:qn(t,`NodeMax${n.label}`)}}return null}var ud=kt("workunit.ts"),uB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},cd=new uB,qA=class t extends Ve{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",0)}get State(){return this.get("State")||tB[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 id;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,()=>sd.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){let e={};return this.CResults.forEach(r=>{e[r.Sequence]=r}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new Ad(this.connection,this.Wuid,e))}_graphCache=new jh;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 Jh(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 Zh(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 od(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}static create(e){let r=new t(e);return r.connection.WUCreate().then(n=>(cd.set(r),r.set(n.Workunit),r))}static attach(e,r,n){let s=cd.get({BaseUrl:e.baseUrl,Wuid:r},()=>new t(e,r));return n&&s.set(n),s}static existsLocal(e,r){return cd.has({BaseUrl:e,Wuid:r})}static submit(e,r,n,s=!1){return t.create(e).then(i=>i.update({QueryText:n})).then(i=>s?i.submit(r,$i.Action.Compile):i.submit(r))}static compile(e,r,n){return t.submit(e,r,n,!0)}static query(e,r){return new _t(e).WUQuery(r).then(s=>s.Workunits.ECLWorkunit.map(function(i){return t.attach(e,i.Wuid,i)}))}constructor(e,r){super(),this.connection=new _t(e),this.topologyConnection=new Xt(e),this.clearState(r)}clearState(e){this.clear({Wuid:e,StateID:0})}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(r=>(this.set(r.Workunit),this))}submit(e,r=$i.Action.Run,n){let s;return e!==void 0?s=Promise.resolve(e):s=this.topologyConnection.DefaultTpLogicalClusterQuery().then(i=>i.Name),this._debugMode=!1,r===$i.Action.Debug&&(r=$i.Action.Run,this._debugMode=!0),s.then(i=>this.connection.WUUpdate({Wuid:this.Wuid,Action:r,ResultLimit:n,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(A=>(this.set(A.Workunit),this._submitAction=r,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:i})))).then(()=>this)}isComplete(){switch(this.StateID){case 1:return this.ActionEx==="compile"||this._submitAction===$i.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){switch(this.StateID){case 999:return!0;default:}return!1}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(sr.ECLWUActions.SetToFailed)}pause(){return this.WUAction(sr.ECLWUActions.Pause)}pauseNow(){return this.WUAction(sr.ECLWUActions.PauseNow)}resume(){return this.WUAction(sr.ECLWUActions.Resume)}abort(){return this.WUAction(sr.ECLWUActions.Abort)}protect(){return this.WUAction(sr.ECLWUActions.Protect)}unprotect(){return this.WUAction(sr.ECLWUActions.Unprotect)}delete(){return this.WUAction(sr.ECLWUActions.Delete)}restore(){return this.WUAction(sr.ECLWUActions.Restore)}deschedule(){return this.WUAction(sr.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(sr.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=>t.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===1&&!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,r){return e?await Promise.all([this.refreshInfo(r),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(r=>r.Scopes.Scope)}normalizeDetails(e,r){let n={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},s=[];for(let i of r){let A={},u={};if(i&&i.Id&&i.Properties&&i.Properties.Property)for(let l in i.Properties.Property){let d=i.Properties.Property[l];if(d.Measure==="ns"&&(d.Measure="s"),d.Name==="Kind"){let p=parseInt(d.RawValue,10);d.Formatted=e.Activities.Activity.filter(B=>B.Kind===p)[0].Name??d.RawValue}switch(n[d.Name]={...d},cU(n,d.Name,"RawValue"),cU(n,d.Name,"Formatted"),d.Measure){case"bool":A[d.Name]=!!+d.RawValue;break;case"sz":A[d.Name]=+d.RawValue;break;case"s":A[d.Name]=+d.RawValue/1e9;break;case"ns":A[d.Name]=+d.RawValue;break;case"ts":A[d.Name]=new Date(+d.RawValue/1e3).toISOString();break;case"cnt":A[d.Name]=+d.RawValue;break;case"cost":A[d.Name]=+d.RawValue/1e6;break;case"node":A[d.Name]=+d.RawValue;break;case"skw":A[d.Name]=+d.RawValue;break;case"cpu":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:A[d.Name]=d.RawValue}u[d.Name]=Mq(d.Formatted??A[d.Name])}let c={id:i.Id,name:i.ScopeName,type:i.ScopeType,Kind:i.Kind,Label:i.Label,__formattedProps:u,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...A};if(c[ic])try{let l=JSON.parse(c[ic].split("\\").join("\\\\"));c[ic]=[],l.forEach((d,p)=>{let B=d.match(xq);if(B){let E=(B[1]??"")+B[2]+B[3],b=parseInt(B[5]),D=parseInt(B[6]);c[ic].push({filePath:E,line:b,col:D})}})}catch{ud.error(`Unexpected "DefinitionList": ${c[ic]}`)}let g={};for(let l in c)if(l.indexOf("__")!==0){let d=Gq(c,l,g);d&&(c.__groupedProps[d.Key]=d,!isNaN(d.StdDevs)&&c.__StdDevs<d.StdDevs&&(c.__StdDevs=d.StdDevs,c.__StdDevsSource=d.Key))}s.push(c)}return{meta:e,columns:n,data:s}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(r=>this.normalizeDetails(r[0],r[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(r=>r.Scopes.Scope.map(n=>new sc(this,n)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(r=>{let n=[],s={};r.Scopes.Scope.forEach(i=>{if(s[i.ScopeName])return s[i.ScopeName].update(i),null;{let A=new sc(this,i);return s[A.ScopeName]=A,A}});for(let i in s)if(s.hasOwnProperty(i)){let A=s[i],u=A.parentScope();u&&s[u]?s[u].children().push(A):n.push(A)}return n})}fetchGraphDetails(e=[],r){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:r},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(r=>Xh(r))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{let r={};e.forEach(s=>{r[s.ScopeName]=r[s.ScopeName]||{scope:s.ScopeName,start:null,elapsed:null,finish:null},s.CAttributes.forEach(i=>{i.Name==="TimeElapsed"?r[s.ScopeName].elapsed=+i.RawValue:i.Measure==="ts"&&i.Name.indexOf("Started")>=0&&(r[s.ScopeName].start=i.Formatted)})});let n=[];for(let s in r){let i=r[s];if(i.start&&i.elapsed){let A=Nq(i.start);A.setMilliseconds(A.getMilliseconds()+i.elapsed/1e6),i.finish=Uq(A),n.push(i)}}return n.sort((s,i)=>s.start<i.start?-1:s.start>i.start?1:0),n})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,r,n){if(this.isCallback(r))switch(e){case"completed":super.on("propChanged","StateID",s=>{this.isComplete()&&r([s])});break;case"changed":super.on(e,r);break;default:}else switch(e){case"changed":super.on(e,r,n);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((r,n)=>{let s=this.watch(i=>{e&&e(i),this.isComplete()&&(s.release(),r(this))})})}watchUntilRunning(e){return new Promise((r,n)=>{let s=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(s.release(),r(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(r=>(r.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set("StateID",999)):this.set(r.Workunits.ECLWorkunit[0]),r)).catch(r=>{if(!r.Exception.some(s=>s.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw ud.warning(`Unexpected ESP exception: ${r.message}`),r;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),cd.set(this),e))}WUInfo(e={}){let r=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:r,IncludeResultsViewNames:r,SuppressResultSchemas:!1}).then(n=>(this.set(n.Workunit),r&&this.set({ResultViews:n.ResultViews}),n)).catch(n=>{if(!n.Exception.some(i=>i.Code===20080?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw ud.warning(`Unexpected ESP exception: ${n.message}`),n;return{}})}WUResubmit(e){return this.connection.WUResubmit(Jc({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(Jc({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(r=>Jc({Scopes:{Scope:[]}},r))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(r=>this.refresh().then(()=>(this._monitor(),r)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:sr.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let r=new Yh({baseUrl:""}),n={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return r.WUPublishWorkunitEx(n)}WUCDebug(e,r={}){let n="";for(let s in r)r.hasOwnProperty(s)&&(n+=` ${s}='${r[s]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${n}/>`}).then(s=>s)}debug(e,r){return this.isDebugging()?this.WUCDebug(e,r).then(n=>{let s=n.children(e);return s.length?s[0]:new rs(e)}).catch(n=>(ud.error(n),Promise.resolve(new rs(e)))):Promise.resolve(new rs(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{let r={...this.DebugState,...e.$};return this.set({DebugState:r}),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(r=>{if(r.name==="break")return r.$})}debugBreakpointAdd(e,r,n){return this.debug("breakpoint",{id:e,mode:r,action:n}).then(s=>this.debugBreakpointResponseParser(s))}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=uU(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(r=>Yq(r,e))}debugPrint(e,r=0,n=10){return this.debug("print",{edgeID:e,startRow:r,numRows:n}).then(s=>s.children().map(i=>{let A={};return i.children().forEach(u=>{A[u.name]=u.content}),A}))}},cB="definition";function Vq(t){return t._[cB]!==void 0}function _q(t){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(t._[cB]);if(e){let[,r,n,s]=e;return r.replace(/\/\.\//g,"/"),{id:t._.id,file:r,line:+n,column:+s}}throw new Error(`Bad definition: ${t._[cB]}`)}function Yq(t,e){let r=[];for(let n of t.vertices)if(Vq(n)){let s=_q(n);(s&&!e||e===s.file)&&r.push(s)}return r.sort((n,s)=>n.line-s.line)}var gd,hU=class t extends Ve{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,r){return gd||(gd=new t(e)),r&&gd.set(r),gd}constructor(e){super(),e instanceof tc?this.connection=e:this.connection=new tc(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(r=>e===""||r.ClusterName===e).map(r=>qA.attach(this.connection.connectionOptions(),r.Wuid,r))}setBanner(e){return this.connection.SetBanner({...e}).then(r=>(this.set(r),this))}lazyRefresh=FI(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};var Hq=kt("logicalFile.ts"),lB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},Oq=new lB,dU=class t extends Ve{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 properties(){return this.get()}static attach(e,r,n,s){let i=Oq.get({BaseUrl:e.baseUrl,Cluster:r,Name:n},()=>new t(e,r,n));return s&&i.set(s),i}constructor(e,r,n){super(),e instanceof ec?this.connection=e:this.connection=new ec(e),this.clear({Cluster:r,Name:n})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let r of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let n of r?.DFUFileParts?.DFUPart||[]){let s={...r,...n};delete s.DFUFileParts,e.push(s)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(r=>(this.set({Cluster:this.Cluster,...r.FileDetail}),r))}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(n=>n.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw Hq.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||[])}};var gB=class extends Ke{constructor(){super(e=>e.Address)}},qq=new gB,hd=class t extends Ve{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,r,n){let s=qq.get({Address:r},()=>new t(e));return n&&s.set(n),s}constructor(e){super(),e instanceof ri?this.connection=e:this.connection=new ri(e)}};var fU=sn(rB(),1);var dB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},Jq=new dB,JA=class t extends Ve{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=>hd.attach(this.machineConnection,e.Address,e))}static attach(e,r,n){let s=Jq.get({BaseUrl:e.baseUrl,Name:r},()=>new t(e,r));return n&&s.set(n),s}constructor(e,r){super(),e instanceof Xt?(this.connection=e,this.machineConnection=new ri(e.connectionOptions())):(this.connection=new Xt(e),this.machineConnection=new ri(e)),this.clear({Name:r})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(r=>{let n=[];for(let s of r.TargetClusterInfoList.TargetClusterInfo)for(let i of s.Processes.MachineInfoEx)n.push(i);return this.set("MachineInfoEx",n),this.CMachineInfoEx})}machineStats(){let e=0,r=0,n=0;for(let s of this.CMachineInfoEx)for(let i of s.Storage.StorageInfo){r+=i.Available,n+=i.Total;let A=1-i.Available/i.Total;A>e&&(e=A)}return{maxDisk:e,meanDisk:1-(n?r/n:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function lX(t){let e;return t instanceof Xt?e=t:e=new Xt(t),e.TpListTargetClusters({}).then(r=>r.TargetClusters.TpClusterNameType.map(n=>JA.attach(t,n.Name,n)))}var hB={};function gX(t){if(!hB[t.baseUrl]){let e;t instanceof Xt?e=t:e=new Xt(t),hB[t.baseUrl]=e.TpListTargetClusters({}).then(r=>{let n,s,i;r.TargetClusters.TpClusterNameType.forEach(u=>{n||(n=u),!s&&u.IsDefault===!0&&(s=u),!i&&u.Type==="hthor"&&(i=u)});let A=s||i||n;return JA.attach(t,A.Name,A)})}return hB[t.baseUrl]}var pB=class extends Ke{constructor(){super(e=>e.BaseUrl)}},jq=new pB,dd=class t extends Ve{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=>JA.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,r){let n=jq.get({BaseUrl:e.baseUrl},()=>new t(e));return r&&n.set(r),n}constructor(e){super(),e instanceof Xt?this.connection=e:this.connection=new Xt(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(r=>{let n=this.connection.protocol(),s=this.connection.ip(),i=n==="https:"?"18002":"8002";if(An("ServiceList.TpEspServers.TpEspServer",r)){for(let A of r.ServiceList.TpEspServers.TpEspServer)if(An("TpBindings.TpBinding",A))for(let u of A.TpBindings.TpBinding)u.Service===e&&u.Protocol+":"===n&&(i=u.Port)}return`${n}//${s}:${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(r=>(this.set({LogicalClusters:r.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(r=>(this.set({Services:r.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,r,n){if(this.isCallback(r))switch(e){case"changed":super.on(e,r);break;default:}else switch(e){case"changed":super.on(e,r,n);break;default:}return this._monitor(),this}};function ni(t,e,r){e==="__proto__"||e==="constructor"||e==="prototype"||(t[e]=r)}function oc(t){return t=""+t,t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function zq(t){if(t){if(!isNaN(+t))return parseFloat(t)}else return 0;let r=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(t);if(!r)return 0;let n=+r[1]||0,s=+r[2]||0,i=+r[3]||0,A=+r[4]||0,u=+r[5]||0,c=+r[6]||0,g=+r[7]||0;return n*24*60*60+s*60*60+i*60+A+u/1e3+c/1e6+g/1e9}function si(t,e){let r=t.indexOf(e);return r!==-1?parseFloat(t.substring(0,r)):-1}function Xq(t){if(t){if(!isNaN(+t))return parseFloat(t)}else return 0;let e=si(t,"Kb");return e>=0?e*1024:(e=si(t,"Mb"),e>=0?e*Math.pow(1024,2):(e=si(t,"Gb"),e>=0?e*Math.pow(1024,3):(e=si(t,"Tb"),e>=0?e*Math.pow(1024,4):(e=si(t,"Pb"),e>=0?e*Math.pow(1024,5):(e=si(t,"Eb"),e>=0?e*Math.pow(1024,6):(e=si(t,"Zb"),e>=0?e*Math.pow(1024,7):(e=si(t,"b"),e>=0?e:0)))))))}function Zq(t){return t?parseFloat(t):0}var fB=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,r,n,s){this.noSpills=s,e.forEach(i=>{this.graph.isVertex(i)?(this.calcInVertexVisibility(i,n),this.calcOutVertexVisibility(i,n)):this.graph.isEdge(i)?(this.calcInVertexVisibility(i.getSource(),n-1),this.calcOutVertexVisibility(i.getTarget(),n-1)):this.graph.isSubgraph(i)&&(this.m_visibleSubgraphs[i.__hpcc_id]=i,this.calcSubgraphVisibility(i,r-1))}),this.calcVisibility2()}calcInVertexVisibility(e,r){this.noSpills&&e.isSpill()&&r++,this.m_visibleVertices[e.__hpcc_id]=e,r>0&&e.getInEdges().forEach(n=>{this.calcInVertexVisibility(n.getSource(),r-1)})}calcOutVertexVisibility(e,r){this.noSpills&&e.isSpill()&&r++,this.m_visibleVertices[e.__hpcc_id]=e,r>0&&e.getOutEdges().forEach(n=>{this.calcOutVertexVisibility(n.getTarget(),r-1)})}calcSubgraphVisibility(e,r){if(r<0)return;r>0&&e.__hpcc_subgraphs.forEach((s,i)=>{this.calcSubgraphVisibility(s,r-1)}),e.__hpcc_subgraphs.forEach((s,i)=>{this.m_visibleSubgraphs[s.__hpcc_id]=s}),e.__hpcc_vertices.forEach((s,i)=>{this.m_visibleVertices[s.__hpcc_id]=s});let n={};this.graph.edges.forEach((s,i)=>{s.getSource().__hpcc_parent!==s.getTarget().__hpcc_parent&&e===this.getCommonAncestor(s)&&(n[s.getSource().__hpcc_parent.__hpcc_id+"::"+s.getTarget().__hpcc_parent.__hpcc_id]||(n[s.getSource().__hpcc_parent.__hpcc_id+"::"+s.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[s.__hpcc_id]=s))})}buildVertexString(e,r){let n="",s="",i=e.getProperties();for(let A in i)r&&A.indexOf("_kind")>=0?s+='<att name="_kind" value="point"/>':A==="id"||A==="label"?n+=" "+A+'="'+oc(i[A])+'"':s+='<att name="'+A+'" value="'+oc(i[A])+'"/>';return"<node"+n+">"+s+"</node>"}buildEdgeString(e){let r="",n="",s=e.getProperties();for(let i in s)i.toLowerCase()==="id"||i.toLowerCase()==="label"||i.toLowerCase()==="source"||i.toLowerCase()==="target"?r+=" "+i+'="'+oc(s[i])+'"':n+='<att name="'+i+'" value="'+oc(s[i])+'"/>';return"<edge"+r+">"+n+"</edge>"}getAncestors(e,r){let n=e.__hpcc_parent;for(;n;)r.push(n),n=n.__hpcc_parent}getCommonAncestorV(e,r){let n=[],s=[];this.getAncestors(e,n),this.getAncestors(r,s);let i=n.length-1,A=s.length-1,u=null;for(;i>=0&&A>=0&&n[i]===s[A];)u=n[i],--i,--A;return u}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let r=[];this.getAncestors(e,r),r.forEach((n,s)=>{this.m_visibleSubgraphs[n.__hpcc_id]=n})}calcVisibility2(){for(let e in this.m_visibleVertices){let r=this.m_visibleVertices[e];r.getInEdges().forEach((n,s)=>{this.m_visibleEdges[n.__hpcc_id]=n}),r.getOutEdges().forEach((n,s)=>{this.m_visibleEdges[n.__hpcc_id]=n}),this.calcAncestorVisibility(r)}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(let e in this.m_visibleEdges){let r=this.m_visibleEdges[e],n=r.getSource();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){let i=n.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),n=i[0].getSource(),this.addSemiVisibleVertex(n);else break}let s=r.getTarget();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){let i=s.getOutEdges();if(i.length)this.addSemiVisibleEdge(i[0]),s=i[0].getTarget(),this.addSemiVisibleVertex(s);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,r)=>{this.edgeVisited(e)})}subgraphVisited(e,r=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let n="";this.m_xgmml+=r?"":'<node id="'+e.__hpcc_id+'"><att><graph>';let s=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),s===this.m_xgmml.length){let A=e.__hpcc_vertices[0];A&&(this.m_xgmml+=this.buildVertexString(A,!0))}let i=e.getProperties();for(let A in i)n+='<att name="'+A+'" value="'+oc(i[A])+'"/>';this.m_xgmml+=r?"":"</graph></att>"+n+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}},Ac=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,r){this.__hpcc_graph=e,this.__hpcc_id=r,this._globalID=r}getProperties(){let e={};for(let r in this)r.indexOf("__")!==0&&this.hasOwnProperty(r)&&(e[r]=this[r]);return e}},ii=class extends Ac{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,r){super(e,r),this._globalType=r==="0"?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=r}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(r=>e===r)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(r=>e===r)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(r=>e!==r)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(r=>e===r)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(r=>e!==r)}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((r,n)=>{e.subgraphVisited(r)&&r.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((r,n)=>{e.vertexVisited(r)})}},to=class extends Ac{_globalType="Vertex";_isSpill;constructor(e,r){super(e,r)}isSpill(){return this._isSpill}remove(){let e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(r=>{r.remove()}),this.getOutEdges().forEach(r=>{r.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)}},ro=class extends Ac{_globalType="Edge";_sourceActivity;source;_targetActivity;target;constructor(e,r){super(e,r),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]}},pd=class t{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;let n=new DOMParser().parseFromString(e,"text/xml");this.walkDocument(n.documentElement,"0")}isSubgraph(e){return e instanceof ii}isVertex(e){return e instanceof to}isEdge(e){return e instanceof ro}getGlobalType(e){return e instanceof to?3:e instanceof ro?4:e instanceof ii?2:e instanceof t?1:0}getGlobalTypeString(e){return e instanceof to?"Vertex":e instanceof ro?"Edge":e instanceof ii?"Cluster":e instanceof t?"Graph":"Unknown"}getItem(e,r){if(!this.idx[r])switch(e.tagName){case"graph":let s=new ii(this,r);this.subgraphs.push(s),this.idx[r]=s;break;case"node":let i=new to(this,r);this.vertices.push(i),this.idx[r]=i;break;case"edge":let A=new ro(this,r);this.edges.push(A),this.idx[r]=A;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}let n=this.idx[r];return Array.from(e.attributes).forEach(s=>{ni(n,s.name,s.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof ii?this.subgraphs=this.subgraphs.filter(r=>e!==r):e instanceof to?this.vertices=this.vertices.filter(r=>e!==r):e instanceof ro&&(this.edges=this.edges.filter(r=>e!==r))}getChildByTagName(e,r){let n=null;return Array.from(e.childNodes).some(s=>{if(s.tagName===r)return n=s,!0}),n}walkDocument(e,r){let n=this.getItem(e,r);return e.childNodes.forEach(s=>{switch(s.nodeType){case 1:switch(s.tagName){case"graph":break;case"node":let i=!1,A=this.getChildByTagName(s,"att");if(A){let d=this.getChildByTagName(A,"graph");if(d){i=!0;let p=this.walkDocument(d,s.getAttribute("id"));n.addSubgraph(p)}}if(!i){let d=this.walkDocument(s,s.getAttribute("id"));n.addVertex(d)}break;case"att":let u=s.getAttribute("name"),c="_"+u,g=s.getAttribute("value");u.indexOf("Time")===0?(ni(n,c,g),ni(n,u,""+zq(g))):u.indexOf("Size")===0?(ni(n,c,g),ni(n,u,""+Xq(g))):u.indexOf("Skew")===0?(ni(n,c,g),ni(n,u,""+Zq(g))):ni(n,u,g);break;case"edge":let l=this.walkDocument(s,s.getAttribute("id"));if(l.NumRowsProcessed!==void 0?l._eclwatchCount=l.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.Count!==void 0?l._eclwatchCount=l.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.count!==void 0&&(l._eclwatchCount=l.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),l.inputProgress&&(l._eclwatchInputProgress="["+l.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),l.SkewMaxRowsProcessed&&l.SkewMinRowsProcessed&&(l._eclwatchSkew="+"+l.SkewMaxRowsProcessed+", "+l.SkewMinRowsProcessed),!l._dependsOn){if(!l._childGraph){if(l._sourceActivity||l._targetActivity){l._isSpill=!0;let d=l.getSource();d&&(d._isSpill=!0);let p=l.getTarget();p&&(p._isSpill=!0)}}}n.addEdge(l);break;default:break}break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break;default:break}}),n}removeSubgraphs(){[...this.subgraphs].forEach(r=>{r.__hpcc_parent instanceof ii&&r.remove()})}removeSpillVertices(){[...this.vertices].forEach(r=>{r.isSpill()&&r.remove()})}getLocalisedXGMML(e,r,n,s){let i=new fB(this);return i.calcVisibility(e,r,n,s),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var EB=kt("@hpcc-js/comms/ecl/query.ts"),Kq=(0,fU.format)("~s");function $q(t){return!isNaN(parseFloat(t))&&!isNaN(t-0)}var CB=class extends Ke{constructor(){super(e=>Ke.hash([e.QueryId,e.QuerySet]))}},eJ=new CB,pU=class t extends Ve{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,r,n,s){super(),e instanceof _t?this.wsWorkunitsService=e:this.wsWorkunitsService=new _t(e),this.topology=dd.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:r,QueryId:n,...s})}static attach(e,r,n,s){let i=eJ.get({BaseUrl:e.baseUrl,QuerySet:r,QueryId:n},()=>new t(e,r,n));return s&&i.set(s),i}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(let r of e?.TpEspServers?.TpEspServer??[])for(let n of r?.TpBindings?.TpBinding??[])if(n?.Service==="ws_ecl"){let s=`${n.Protocol}://${globalThis.location.hostname}:${n.Port}`;return new Mh({baseUrl:s})}})),this._eclService}async fetchDetails(){let e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){let e=await this.wsEclService();try{this._requestSchema=await e?.requestJson(this.QuerySet,this.QueryId)??[]}catch(r){EB.debug(r.message??r),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(r){EB.debug(r.message??r),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",r=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:r}).then(n=>{let s=new pd,i=!0;for(let A of n?.Graphs?.ECLGraphEx||[])i?(s.load(A.Graph),i=!1):s.merge(A.Graph);return s})}fetchDetailsNormalized(e={}){let r=qA.attach(this.wsWorkunitsService,this.Wuid);return r?Promise.all([this.fetchGraph(),r.fetchDetailsMeta(),r.fetchDetailsRaw(e)]).then(n=>{let s=n[0],i=n[1],u=n[2].map(c=>{if(c.Id[0]==="a"||c.Id[0]==="e"){let g=s.idx[c.Id.substring(1)];for(let l in g)if(l.charAt(0)!=="_"&&l.charAt(0)===l.charAt(0).toUpperCase()&&(typeof g[l]=="string"||typeof g[l]=="number"||typeof g[l]=="boolean")&&!c.Properties.Property.some(d=>d.Name===l)){let p=$q(g[l])?parseFloat(g[l]):g[l],B=g[l];l.indexOf("Time")>=0&&(p=p/1e9,B=Kq(p)+"s"),c.Properties.Property.push({Name:l,RawValue:p,Formatted:B})}}return c});return r.normalizeDetails(i,u)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let r=await this.wsEclService();try{return r?.submit(this.QuerySet,this.QueryId,e).then(n=>{for(let s in n)n[s]=n[s].Row;return n})??[]}catch(n){return EB.debug(n.message??n),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){let e=[];for(let r in this.responseFields())e.push(r);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};var BB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},tJ=new BB,no=class extends fa{constructor(r,n,s){super();this.key=r;this.value=n;this.oldValue=s}get canConflate(){return!0}conflate(r){return this.key===r.key?(this.value=r.value,!0):!1}void(){return this.value===this.oldValue}},EU=class t{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new Ea;static attach(e,r="HPCCApps",n,s=!0){return tJ.get({BaseUrl:e.baseUrl,Name:r,UserSpecific:s,Namespace:n},()=>new t(e,r,n,s))}constructor(e,r,n,s){e instanceof rc?this.connection=e:this.connection=new rc(e),this.Name=r,this.UserSpecific=s,this.Namespace=n}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})}set(e,r,n=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:r}).then(s=>{let i=this._knownValues[e];this._knownValues[e]=r,n&&this._dispatch.post(new no(e,r,i))}).catch(s=>{console.error(`Store.set("${e}", "${r}") failed:`,s)})}get(e,r=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(n=>{let s=this._knownValues[e];return this._knownValues[e]=n.Value,r&&this._dispatch.post(new no(e,n.Value,s)),n.Value}).catch(n=>{console.error(`Store.get(${e}) failed:`,n)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(r=>{let n={},s=this._knownValues;if(this._knownValues={},r.Pairs.Pair.forEach(i=>{let A=this._knownValues[i.Key];this._knownValues[i.Key]=i.Value,delete s[i.Key],n[i.Key]=i.Value,e&&this._dispatch.post(new no(i.Key,i.Value,A))}),e)for(let i in s)this._dispatch.post(new no(i,void 0,s[i]));return n}).catch(r=>(console.error("Store.getAll failed:",r),{}))}delete(e,r=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(n=>{let s=this._knownValues[e];delete this._knownValues[e],r&&this._dispatch.post(new no(e,void 0,s))}).catch(n=>{console.error(`Store.delete(${e}) failed:`,n)})}monitor(e){return this._dispatch.attach(e)}};var rJ=kt("@hpcc-js/comms/dfuWorkunit.ts");var IB=class extends Ke{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},CU=new IB,BU=class t extends Ve{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,r){let n=new t(e);return n.connection.CreateDFUWorkunit({DFUServerQueue:r}).then(s=>(CU.set(n),n.set(s.result),n))}static attach(e,r,n){let s=CU.get({BaseUrl:e.baseUrl,ID:r},()=>new t(e,r));return n&&s.set(n),s}static sprayFixed(e,r){let n=new Ki(e);return n.SprayFixedEx({...r}).then(s=>{let i=s.wuid;return n.GetDFUWorkunit({wuid:i}).then(A=>t.attach(e,i,A.result))})}static sprayVariable(e,r){let n=new Ki(e);return n.SprayVariableEx({...r}).then(s=>{let i=s.wuid;return n.GetDFUWorkunit({wuid:i}).then(A=>t.attach(e,i,A.result))})}static despray(e,r){let n=new Ki(e);return n.DesprayEx({...r}).then(s=>{let i=s.wuid;return n.GetDFUWorkunit({wuid:i}).then(A=>t.attach(e,i,A.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;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){switch(this.State){case 999:return!0;default:}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction($u.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(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let 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(r=>r).catch(r=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(r=>e===$u.DFUWUActions.Delete?r:this.refresh().then(()=>(this._monitor(),r)))}on(e,r,n){if(this.isCallback(r))switch(e){case"finished":super.on("propChanged","State",s=>{this.isComplete()&&r([s])});break;case"changed":super.on(e,r);break;default:}else switch(e){case"changed":super.on(e,r,n);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((r,n)=>{let s=this.watch(i=>{e&&e(i),this.isComplete()&&(s.release(),r(this))})})}watchUntilRunning(e){return new Promise((r,n)=>{let s=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(s.release(),r(this))})})}constructor(e,r){super(),this.connection=new Ki(e),this.topologyConnection=new Xt(e),this.clearState(r)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(r=>(this.set(r.result),r)).catch(r=>{if(!r.Exception.some(s=>s.Code===20080||s.Code===20081?(this.clearState(this.ID),this.set("State",999),!0):!1))throw rJ.warning(`Unexpected ESP exception: ${r.message}`),r;return{}})}};var OU=sn(kU(),1);import*as HU from"node:child_process";import*as Zt from"node:fs";import*as oo from"node:os";import*as mr from"node:path";import*as so from"node:fs";import*as dt from"node:path";var BJ=kt("clienttools/eclmeta"),IJ=!1;function XA(t,e,r){if(IJ){for(let n in t){let s=`${e}.${n}`;n!=="$"&&r[n]===void 0&&r[n.toLowerCase()+"s"]===void 0&&BJ.debug(s)}t.$&&XA(t.$,e+".$",r)}}var FB=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},UB=class{__attrs;definition;get scope(){return this.definition}name;type;constructor(e,r){this.__attrs=r.$,this.definition=e,this.name=r.$.name,this.type=r.$.type}},ZA=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,r,n,s,i=1,A=0,u=0,c=Number.MAX_VALUE){this.name=e,this.type=r,this.sourcePath=dt.normalize(n),this.line=+i-1,this.start=+A,this.body=+u,this.end=+c,this.definitions=this.parseDefinitions(s)}parseDefinitions(e=[]){return e.map(r=>{let n=new NB(this.sourcePath,r);return XA(r,"definition",n),n})}contains(e){return e>=this.start&&e<=this.end}scopeStackAt(e){let r=[];return this.contains(e)&&(r.push(this),this.definitions.forEach(n=>{r=n.scopeStackAt(e).concat(r)})),r}_resolve(e=[],r){let n=r.split("."),s=n.shift(),i=SI(e,A=>typeof A.name=="string"&&typeof s=="string"&&A.name.toLowerCase()===s.toLowerCase());return i&&i.definitions.length&&n.length?this._resolve(i.definitions,n.join(".")):i}resolve(e){return this._resolve(this.definitions,e)}suggestions(){return this.definitions.map(e=>({name:e.name,type:this.type}))}},NB=class extends ZA{__attrs;exported;shared;fullname;inherittype;attrs;fields;constructor(e,r){super(r.$.name,r.$.type,e,r.children("Definition"),r.$.line,r.$.start,r.$.body,r.$.end),this.__attrs=r.$,this.exported=!!r.$.exported,this.shared=!!r.$.shared,this.fullname=r.$.fullname,this.inherittype=r.$.inherittype,this.attrs=this.parseAttrs(r.children("Attr")),this.fields=this.parseFields(r.children("Field"))}parseAttrs(e=[]){return e.map(r=>{let n=new FB(r);return XA(r,"attr",n),n})}parseFields(e=[]){return e.map(r=>{let n=new UB(this,r);return XA(r,"field",n),n})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},Ed=class{__attrs;name;ref;start;end;line;constructor(e){this.__attrs=e.$,this.name=e.$.name,this.ref=e.$.ref,this.start=e.$.start,this.end=e.$.end,this.line=e.$.line}},TB=class extends ZA{imports;__attrs;constructor(e){super(e.$.name,"source",e.$.sourcePath,e.children("Definition")),this.__attrs=e.$;let r=e.$.name.split(".");r.pop();let n=new rs("");n.appendAttribute("name","$"),n.appendAttribute("ref",r.join(".")),this.imports=[new Ed(n),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(r=>{let n=new Ed(r);return XA(r,"import",n),n})}resolve(e,r){let n;return!n&&r!==void 0&&this.scopeStackAt(r).some(i=>(n=i.resolve(e),!!n)),n||(n=super.resolve(e)),n}},QJ=t=>dt.basename(t).indexOf(".")===0,WU=t=>so.lstatSync(t).isDirectory()&&!QJ(t),mJ=t=>[".ecl",".ecllib"].indexOf(dt.extname(t).toLowerCase())>=0,LU=t=>so.readdirSync(t).map(e=>dt.join(t,e)).filter(e=>WU(e)||mJ(e)),MB=class extends ZA{constructor(e,r){super(e,"file",r,[])}suggestions(){return[]}},xB=class extends ZA{constructor(e,r){super(e,"folder",r,[])}suggestions(){return LU(this.sourcePath).map(e=>({name:dt.basename(e,".ecl"),type:"folder"}))}},kB=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new ha;_sourceByPath=new Fo;_test=new ha;constructor(e,r){this._workspacePath=e,this._eclccPath=r}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return vU(this._eclccPath,"",this._workspacePath).then(e=>(this._clientTools=e,e.paths())).then(e=>{for(let r of["ECLCC_ECLLIBRARY_PATH","ECLCC_PLUGIN_PATH"])e[r]&&so.existsSync(e[r])&&this.walkChildFolders(e[r],e[r]);return this})}primeWorkspace(){so.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,r,n=!1){for(let s of LU(e))WU(s)?this.visitFolder(s,r,n):this.visitFile(s,r,n)}visitFile(e,r,n=!1){let s=dt.parse(e),i=dt.join(s.dir,s.name),A=dt.relative(r,i).split(dt.sep).join(".");(n||!this._test.has(A))&&this._test.set(A,new MB("",e))}visitFolder(e,r,n=!1){let s=dt.relative(r,e).split(dt.sep).join(".");(n||!this._test.has(s))&&(this._test.set(s,new xB(s,e)),this.walkChildFolders(e,r,n))}buildStack(e,r,n){let s=r.split(".");n&&e[e.length-1]===s[0]&&s.shift();let i=[...e,...s],A=i.join(".");return{stack:i,qid:A}}walkECLScope(e,r){let n=this.buildStack(e,r.name,!0);this._test.set(n.qid,r);for(let s of r.definitions)this.walkDefinition(n.stack,s)}walkField(e,r){let n=this.buildStack(e,r.name,!1);this._test.set(n.qid,r)}walkDefinition(e,r){let n=this.buildStack(e,r.name,!0);this.walkECLScope(e,r);for(let s of r.fields)this.walkField(n.stack,s)}walkSource(e){this.walkECLScope([],e)}parseSources(e=[]){for(let r of e)if(r.$.name){let n=new TB(r);if(XA(r,"source",n),this._sourceByID.set(n.name,n),this._sourceByPath.set(n.sourcePath,n),n.name){let i=n.name.split(".").length;if(i>1){let A=n.sourcePath;for(;i>1;)A=dt.dirname(A),--i;this.visitFolder(A,dt.dirname(A))}}this.walkSource(n)}}parseMetaXML(e){let r=new WB;return r.parse(e),this.parseSources(r.sources),r.sources.map(n=>dt.normalize(n.$.sourcePath))}resolveQualifiedID(e,r,n){let s;if(!s&&this._test.has(r)&&(s=this._test.get(r).scope),!s&&this._sourceByPath.has(e)){let i=this._sourceByPath.get(e),A=r.split(".");for(let c of i.imports)if(c.name.toLowerCase()===A[0].toLowerCase()){c.ref?A[0]=c.ref:A.shift();break}let u=A.join(".");!s&&this._test.has(u)&&(s=this._test.get(u).scope),s||(u=[...i.name.split("."),...A].join("."),this._test.has(u)&&(s=this._test.get(u).scope))}return s}resolvePartialID(e,r,n){r=r.toLowerCase();let s=r.split(".");s.pop();let i=s.length===1?s[0]:s.join(".");return this.resolveQualifiedID(e,i,n)}},RB=new Fo;function io(t,e){let r=dt.normalize(t);if(!RB.has(r)){let n=new kB(r,e);RB.set(r,n),n.refresh()}return RB.get(r)}function DJ(t,e,r){if(e<0)return!1;let n=t.charAt(e);return(r?/[a-zA-Z\d_\.$]/:/[a-zA-Z\d_]/).test(n)}function L4(t,e,r){for(;DJ(t,e,r);)e+=r?-1:1;return e+(r?1:-1)}var WB=class extends fi{sources=[];endXMLNode(e){switch(e.name){case"Source":this.sources.push(e);break;default:break}super.endXMLNode(e)}};var KA=kt("clienttools/eclcc"),LB=oo.type()==="Windows_NT"?".exe":"";function PU(t){return t.split(`\r
|
|
977
977
|
`).join(`
|
|
978
978
|
`).split("\r").join(`
|
|
979
979
|
`)}var uc=class{prefix="";major=0;minor=0;patch=0;postfix="";constructor(e){let r=e.split(" ");if(r.length){let n=/(?:(\w+)_)?(\d+)\.(\d+)\.(\d+)(?:-(.*))?/.exec(r[r.length-1]);n&&(this.prefix=n[1]||"",this.major=+n[2]||0,this.minor=+n[3]||0,this.patch=+n[4]||0,this.postfix=n[5]||"")}}parse(e){}exists(){return this.major!==0||this.minor!==0||this.patch!==0||this.postfix!==""}compare(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch?-1:this.postfix===""&&e.postfix!==""?1:this.postfix.localeCompare(e.postfix)}toString(){return`${this.prefix}_${this.major}.${this.minor}.${this.patch}-${this.postfix}`}},GU="error",VU="warning",Bd=class{_checked;errWarn=[];errOther=[];constructor(e){this._checked=e}checked(){return this._checked}all(){return this.errWarn}errors(){return this.errWarn.filter(e=>e.severity===GU)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===VU)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[GU,VU].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},Id=class extends Bd{constructor(e,r){if(super(r),e&&e.length)for(let n of e.split(oo.EOL)){let s=/([a-zA-Z]:\\(?:[- \w\.\d]+\\)*(?:[- \w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\) ?: ?(error|warning|info) C(\d*) ?: ?(.*)/.exec(n);if(s){let[,i,A,u,c,g,l]=s,d=+A,p=+u,B=g+": "+l;this.errWarn.push({filePath:i,line:d,col:p,msg:B,severity:c});continue}if(s=/(error|warning|info): (.*)/i.exec(n),s){let[,i,A]=s;this.errWarn.push({filePath:"",line:0,col:0,msg:A,severity:i});continue}s=/\d error(s?), \d warning(s?)/.exec(n),!s&&(KA.warning(`parseECLErrors: Unable to parse "${n}"`),this.errOther.push(n))}this._checked=r}},vB=class extends Bd{_lines;constructor(e,r,n){super(n);let s=Zt.readFileSync(e,"utf8");if(s=s.replace(/\r\n/g,`
|