@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.cjs
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=ot(iU(),1);var Qq="@hpcc-js/comms",mq="3.7.4",Dq="3.8.4";var oU=kt("comms/connection.ts");function yq(t){return"baseUrl"in t}var wq={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function Sq(t){return typeof t.opts=="function"&&typeof t.send=="function"&&typeof t.clone=="function"}function qn(t,e){return e===void 0||e===!0?encodeURIComponent(t):""+t}function ni(t,e=!0,r=""){if(r&&(r+="."),typeof t!="object")return qn(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(ni(A,e,r+qn(`${s}.${u}`,e)))):n.push(r+qn(`${s}_i${u}`,e)+"="+ni(A,e))}),i&&n.push(r+qn(`${s}.itemcount`,e)+"="+t[s].length)}else typeof t[s]=="object"?t[s]&&t[s].Item instanceof Array?(n.push(ni(t[s].Item,e,r+qn(s,e))),n.push(r+qn(`${s}.itemcount`,e)+"="+t[s].Item.length)):n.push(ni(t[s],e,r+qn(s,e))):t[s]!==void 0?n.push(r+qn(s,e)+"="+qn(t[s],e)):n.push(r+qn(s,e));return n.join("&")}function AU(t){return JSON.parse(t)}function aU(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"?AU(E):E)};let l=document.createElement("script"),d=ss(t.baseUrl,e);d+=d.indexOf("?")>=0?"&":"?",l.src=d+"jsonp="+g+"&"+ni(r,t.encodeRequest),document.body.appendChild(l);let p=setInterval(function(){u<=0?clearInterval(p):(u-=c,u<=0?(clearInterval(p),oU.error("Request timeout: "+l.src),B(),A(Error("Request timeout: "+l.src))):oU.debug("Request pending ("+u/1e3+" sec): "+l.src))},c);function B(){delete window[g],document.body.removeChild(l)}})}function bq(t){return t.userID?{Authorization:`Basic ${btoa(`${t.userID}:${t.password}`)}`}:{}}var jh={};function uU(t,e,r,n,s){n={...bq(t),...n},r={credentials:jh[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 aQ(t.timeoutSecs*1e3,fetch(ss(t.baseUrl,e),r).then(i).catch(A=>(r.credentials=jh[t.baseUrl]?"include":"omit",fetch(ss(t.baseUrl,e),r).then(i).then(u=>(jh[t.baseUrl]=!jh[t.baseUrl],u)))))}function cU(t,e,r,n="json",s){r.upload_&&(delete r.upload_,e+="?upload_");let i;return r.abortSignal_&&(i=r.abortSignal_,delete r.abortSignal_),uU(t,e,{method:"post",body:ni(r,t.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...s},n)}function lU(t,e,r,n="json",s){let i;return r.abortSignal_&&(i=r.abortSignal_,delete r.abortSignal_),uU(t,`${e}?${ni(r,t.encodeRequest)}`,{method:"get",signal:i},{...s},n)}function gU(t,e,r,n="json",s){let i;switch(t.type){case"jsonp":i=aU(t,e,r,n,s);break;case"get":i=lU(t,e,r,n,s);break;case"post":default:i=cU(t,e,r,n,s);break}return i}var zh=gU;function Rq(t){let e=zh;return t&&(zh=t),e}var Xh=class t{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...wq,...e},this)}send(e,r,n="json",s){return this._opts.hookSend?this._opts.hookSend(this._opts,e,r,n,zh,s):zh(this._opts,e,r,n,s)}clone(){return new t(this.opts())}},ac=function(t){return new Xh(t)};function Fq(t){let e=ac;return ac=t,e}function hU(t){return Object.prototype.toString.call(t)==="[object Array]"}var si=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 Uq(t){return t instanceof si||t.isESPExceptions&&Array.isArray(t.Exception)}function Nq(t){return t.send!==void 0}var zA=class t{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,r,n){this._connection=Nq(e)?e:ac(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(hU(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=ss(this._service,e),g="text";break;case"xsd":c=ss(this._service,e+".xsd"),g="text";break;case"json2":c=ss(this._service,e+"/json"),n="json",e=e.split("/").pop();break;default:c=ss(this._service,e+".json")}return this._connection.send(c,u,g).then(l=>{if(n==="json"){let d;if(l&&l.Exceptions)throw new si(e,u,l.Exceptions);if(l&&(d=l[A||e+"Response"]),!d)throw new si(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)}},we=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,r,n){this._connection=new zA(e,r,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var XA;(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||={})})(XA||={});var Zh=class extends we{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 dU=(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))(dU||{}),ii=class extends Zh{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 DB;(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||={})})(DB||={});var Kh=class extends we{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 yB=class extends Kh{};var $h=class extends we{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 wB=class extends $h{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 ed=class extends we{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 Tq=kt("@hpcc-js/comms/services/wsCloud.ts");function Mq(t){return t?.Pods!==void 0}function xq(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 kq(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:xq(e)}}})}var SB=class extends ed{getPODs(){return super.GetPODs({}).then(e=>{if(Mq(e))return e.Pods?.Pod??[];try{let r=typeof e.Result=="string"?JSON.parse(e.Result):e.Result;return kq(r?.items??[])}catch(r){return Tq.error(`Error parsing V1Pods json '${r instanceof Error?r.message:String(r)}'`),[]}})}};var bB=class{_connection;constructor(e){this._connection=new zA(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 td=class extends we{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 RB=class extends td{};var io;(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||={})})(io||={});var rd=class extends we{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 Wq=io.DFUArrayActions,Lq=io.DFUDefFileFormat,vq=io.DFUChangeProtection,Pq=io.DFUChangeRestriction,ZA=class extends rd{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 FB=class extends we{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 pU(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:UB(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:Gq(e)}}default:throw new Error("Unknown field type")}}function UB(t){t.Row&&t.Row instanceof Array&&(t=t.Row[0]);let e=[];for(let r in t)e.push(pU(r,t[r]));return e}function Gq(t){let e={};for(let r in t)e[r]=pU(r,t[r]);return e}var uc=class extends we{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(UB)}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]=UB(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 si(s,n,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var nd=class extends we{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e)}Ping(e){return this._connection.send("Ping",e)}};var NB=class extends nd{};var dt;(c=>{let t;(q=>(q.global="global",q.workunits="workunits",q.components="components",q.audience="audience",q.class="class",q.instance="instance",q.node="node",q.message="message",q.logid="logid",q.processid="processid",q.threadid="threadid",q.timestamp="timestamp",q.pod="pod",q.traceid="traceid",q.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||={})})(dt||={});var sd=class extends we{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 fU=kt("@hpcc-js/comms/services/wsLogaccess.ts");var EU=(A=>(A.Disaster="DIS",A.Error="ERR",A.Warning="WRN",A.Information="INF",A.Progress="PRO",A.Metric="MET",A))(EU||{}),CU=(s=>(s.Operator="OPR",s.User="USR",s.Programmer="PRO",s.Audit="ADT",s))(CU||{}),TB=class extends sd{_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:dt.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:dt.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:dt.SortColumType.ByDate,ColumnName:"",Direction:0}]}},A=[];for(let u in e){let c;u in n&&(Object.values(dt.LogColumnType).includes(u)?c=u:c=n[u]);let g;if(c){switch(c){case dt.LogColumnType.workunits:case"hpcc.log.jobid":g=dt.LogAccessType.ByJobID;break;case dt.LogColumnType.audience:case"hpcc.log.audience":g=dt.LogAccessType.ByTargetAudience;break;case dt.LogColumnType.class:case"hpcc.log.class":g=dt.LogAccessType.ByLogType;break;case dt.LogColumnType.components:case"kubernetes.container.name":g=dt.LogAccessType.ByComponent;break;default:g=dt.LogAccessType.ByFieldName,c=n[u]}if(Array.isArray(e[u]))e[u].forEach(l=>{g===dt.LogAccessType.ByComponent&&(l+="*"),A.push({LogCategory:g,SearchField:c,SearchByValue:l})});else{let l=e[u];g===dt.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=dt.LogAccessFilterOperator.AND;g>0?(A[g-1].SearchField===c.SearchField&&(l=dt.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:dt.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=dt.LogAccessFilterOperator.AND,A[0].SearchField===A[1].SearchField&&(i.Filter.Operator=dt.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:fU.warning(`Unknown RemoteLogManagerType: ${r.RemoteLogManagerType}`),g=[]}return{lines:g,total:u.TotalLogLinesAvailable??1e4}}catch(c){fU.error(c.message??c)}return{lines:[],total:0}})}};var oi=ot(IU(),1);var od=class extends we{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 Ds=class extends od{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,oi.mean)(g.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed),max:(0,oi.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,oi.mean)(u.filter(c=>!isNaN(c.mean)),c=>c.mean),max:(0,oi.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,oi.mean)(i.filter(A=>!isNaN(A.mean)),A=>A.mean),max:(0,oi.max)(i.filter(A=>!isNaN(A.max)),A=>A.max)}}))}};var Ad=class extends we{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 MB=class extends Ad{};var ad=class extends we{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 xB=class extends ad{};var kB;(e=>{let t;(s=>(s.ECL="ECL",s.DFU="DFU"))(t=e.WUTypes||={})})(kB||={});var ud=class extends we{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 WB=class extends ud{};var LB;(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||={})})(LB||={});var cd=class extends we{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 KA=class extends cd{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(r=>({Running:{ActiveWorkunit:[]},...r}))}};var $A=class extends we{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 vB;(e=>{let t;(i=>(i.All="All",i.QueriesOnly="QueriesOnly",i.WorkunitsOnly="WorkunitsOnly"))(t=e.RoxieQueueFilter||={})})(vB||={});var ld=class extends we{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 Yt=class extends ld{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 Zt;(D=>{let t;(se=>(se.Abort="Abort",se.Delete="Delete",se.Deschedule="Deschedule",se.Reschedule="Reschedule",se.Pause="Pause",se.PauseNow="PauseNow",se.Protect="Protect",se.Unprotect="Unprotect",se.Restore="Restore",se.Resume="Resume",se.SetToFailed="SetToFailed",se.Archive="Archive"))(t=D.ECLWUActions||={});let e;(G=>(G[G.MIN=0]="MIN",G[G.DEFAULT=1]="DEFAULT",G[G.ALL=2]="ALL",G[G.CUSTOM=3]="CUSTOM"))(e=D.LogSelectColumnMode||={});let r;(F=>(F[F.ASC=0]="ASC",F[F.DSC=1]="DSC"))(r=D.SortDirection||={});let n;(z=>(z.ALL="ALL",z.DIS="DIS",z.ERR="ERR",z.WRN="WRN",z.INF="INF",z.PRO="PRO",z.MET="MET",z.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;(G=>(G.info="info",G.warning="warning",G.error="error",G.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;(Z=>(Z.All="All",Z.Id="Id",Z.Name="Name",Z.Alias="Alias",Z.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;(z=>(z.Suspend="Suspend",z.Unsuspend="Unsuspend",z.ToggleSuspend="ToggleSuspend",z.Activate="Activate",z.Delete="Delete",z.DeleteQueriesAndWUs="DeleteQueriesAndWUs",z.RemoveAllAliases="RemoveAllAliases",z.ResetQueryStats="ResetQueryStats"))(E=D.QuerySetQueryActionTypes||={});let b;(G=>(G[G.DoNotActivateQuery=0]="DoNotActivateQuery",G[G.ActivateQuery=1]="ActivateQuery",G[G.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",G[G.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(b=D.WUQueryActivationMode||={})})(Zt||={});var cc=class extends we{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 gd=(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))(gd||{}),Ai;(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||={})})(Ai||={});function PB(t){return typeof t.Name=="string"}function Vq(t){return t.TotalClusterTime!==void 0}function _q(t){return t.StateEx!==void 0}var Pt=class extends cc{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=>El({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=Bl(r.Result).children();return s.length?s[0]:null})}},lc=class extends cc{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};var UU=ot(GB(),1),Sd=ot(SU(),1);var gc=class extends Ge{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=>pc(r)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(r=>pc(r))}},hc=class extends Ze{constructor(){super(e=>Ze.hash([e.Name]))}};function bU(t,e,r){r=r||[],r.push(t),e(t.name,t.$,t.children(),r),t.children().forEach(n=>{bU(n,e,r)}),r.pop()}function VB(t){let e={};return t.forEach(r=>{r.name==="att"&&(e[r.$.name]=r.$.value)}),e}var fd=class extends Da{},_B=class extends xo{},YB=class extends Wo{},HB=class extends ma{};function jB(t,e){let r={},n={},s={},i=new fd(u=>u._.id),A=[i.root];return bU(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(VB(g));A.push(E),r[c.id]=E}let p=d.createVertex(VB(g));n[c.id]=p;break;case"edge":let B=d.createEdge(n[c.source],n[c.target],VB(g));s[c.id]=B;break;default:}}),i}var dc=class extends Da{},OB=class extends xo{},qB=class extends Wo{},JB=class extends ma{};function pc(t){let e={},r={},n={},s;for(let i of t)switch(i.ScopeType){case"graph":s=new dc(l=>l._.Id,i),e[i.ScopeName]=s.root;break;case"subgraph":s||(s=new dc(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 fc=class extends Ge{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 Ec=class{e;constructor(e){this.e=e}fix(){delete this.e}},Cc=class extends Ec{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}},Bc=class extends Ec{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()}},Ic=class{root;simpleTypes={};fields(){return this.root.children()}},Ed=class extends yi{schema=new Ic;simpleType;simpleTypes={};xsdStack=new Di;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let r=new Cc(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 Bc(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 Cd(t){let e=new Ed;return e.parse(t),e.schema}var zB=class extends Ed{_rootName;schema=new Ic;simpleTypes={};xsdStack=new Di;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let r=new Cc(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 Bc(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 Yq(t,e){let r=new zB(e);return r.parse(t),r.schema}var Id=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Bd=new Id,Qc=class t extends Ge{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=Bd.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=Bd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:"Sequence_"+n},()=>new t(e,r,n)):typeof n=="string"&&(i=Bd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:n},()=>new t(e,r,n)))),i}static attachLogicalFile(e,r,n){return Bd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:n},()=>new t(e,r,n,!0))}constructor(e,r,n,s){super(),e instanceof Pt?this.connection=e:this.connection=new Pt(e),typeof s=="boolean"&&s===!0?this.set({NodeGroup:r,LogicalFileName:n}):PB(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=Cd(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=Cd(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)}},mc=class extends Ze{constructor(){super(e=>Ze.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};var ai=class extends Ge{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)}},Qd=class extends Ge{_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 ai(this,n))}),r.start&&r.end?(r.start.FormattedEnd=r.end.Formatted,e.push(new ai(this,r.start))):r.start?e.push(new ai(this,r.start)):r.end&&e.push(new ai(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 ai(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=ot(iU(),1);var Qq="@hpcc-js/comms",mq="3.7.6",Dq="3.8.6";var oU=kt("comms/connection.ts");function yq(t){return"baseUrl"in t}var wq={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function Sq(t){return typeof t.opts=="function"&&typeof t.send=="function"&&typeof t.clone=="function"}function qn(t,e){return e===void 0||e===!0?encodeURIComponent(t):""+t}function ni(t,e=!0,r=""){if(r&&(r+="."),typeof t!="object")return qn(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(ni(A,e,r+qn(`${s}.${u}`,e)))):n.push(r+qn(`${s}_i${u}`,e)+"="+ni(A,e))}),i&&n.push(r+qn(`${s}.itemcount`,e)+"="+t[s].length)}else typeof t[s]=="object"?t[s]&&t[s].Item instanceof Array?(n.push(ni(t[s].Item,e,r+qn(s,e))),n.push(r+qn(`${s}.itemcount`,e)+"="+t[s].Item.length)):n.push(ni(t[s],e,r+qn(s,e))):t[s]!==void 0?n.push(r+qn(s,e)+"="+qn(t[s],e)):n.push(r+qn(s,e));return n.join("&")}function AU(t){return JSON.parse(t)}function aU(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"?AU(E):E)};let l=document.createElement("script"),d=ss(t.baseUrl,e);d+=d.indexOf("?")>=0?"&":"?",l.src=d+"jsonp="+g+"&"+ni(r,t.encodeRequest),document.body.appendChild(l);let p=setInterval(function(){u<=0?clearInterval(p):(u-=c,u<=0?(clearInterval(p),oU.error("Request timeout: "+l.src),B(),A(Error("Request timeout: "+l.src))):oU.debug("Request pending ("+u/1e3+" sec): "+l.src))},c);function B(){delete window[g],document.body.removeChild(l)}})}function bq(t){return t.userID?{Authorization:`Basic ${btoa(`${t.userID}:${t.password}`)}`}:{}}var jh={};function uU(t,e,r,n,s){n={...bq(t),...n},r={credentials:jh[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 aQ(t.timeoutSecs*1e3,fetch(ss(t.baseUrl,e),r).then(i).catch(A=>(r.credentials=jh[t.baseUrl]?"include":"omit",fetch(ss(t.baseUrl,e),r).then(i).then(u=>(jh[t.baseUrl]=!jh[t.baseUrl],u)))))}function cU(t,e,r,n="json",s){r.upload_&&(delete r.upload_,e+="?upload_");let i;return r.abortSignal_&&(i=r.abortSignal_,delete r.abortSignal_),uU(t,e,{method:"post",body:ni(r,t.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...s},n)}function lU(t,e,r,n="json",s){let i;return r.abortSignal_&&(i=r.abortSignal_,delete r.abortSignal_),uU(t,`${e}?${ni(r,t.encodeRequest)}`,{method:"get",signal:i},{...s},n)}function gU(t,e,r,n="json",s){let i;switch(t.type){case"jsonp":i=aU(t,e,r,n,s);break;case"get":i=lU(t,e,r,n,s);break;case"post":default:i=cU(t,e,r,n,s);break}return i}var zh=gU;function Rq(t){let e=zh;return t&&(zh=t),e}var Xh=class t{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...wq,...e},this)}send(e,r,n="json",s){return this._opts.hookSend?this._opts.hookSend(this._opts,e,r,n,zh,s):zh(this._opts,e,r,n,s)}clone(){return new t(this.opts())}},ac=function(t){return new Xh(t)};function Fq(t){let e=ac;return ac=t,e}function hU(t){return Object.prototype.toString.call(t)==="[object Array]"}var si=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 Uq(t){return t instanceof si||t.isESPExceptions&&Array.isArray(t.Exception)}function Nq(t){return t.send!==void 0}var zA=class t{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,r,n){this._connection=Nq(e)?e:ac(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(hU(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=ss(this._service,e),g="text";break;case"xsd":c=ss(this._service,e+".xsd"),g="text";break;case"json2":c=ss(this._service,e+"/json"),n="json",e=e.split("/").pop();break;default:c=ss(this._service,e+".json")}return this._connection.send(c,u,g).then(l=>{if(n==="json"){let d;if(l&&l.Exceptions)throw new si(e,u,l.Exceptions);if(l&&(d=l[A||e+"Response"]),!d)throw new si(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)}},we=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,r,n){this._connection=new zA(e,r,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var XA;(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||={})})(XA||={});var Zh=class extends we{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 dU=(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))(dU||{}),ii=class extends Zh{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 DB;(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||={})})(DB||={});var Kh=class extends we{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 yB=class extends Kh{};var $h=class extends we{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 wB=class extends $h{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 ed=class extends we{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 Tq=kt("@hpcc-js/comms/services/wsCloud.ts");function Mq(t){return t?.Pods!==void 0}function xq(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 kq(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:xq(e)}}})}var SB=class extends ed{getPODs(){return super.GetPODs({}).then(e=>{if(Mq(e))return e.Pods?.Pod??[];try{let r=typeof e.Result=="string"?JSON.parse(e.Result):e.Result;return kq(r?.items??[])}catch(r){return Tq.error(`Error parsing V1Pods json '${r instanceof Error?r.message:String(r)}'`),[]}})}};var bB=class{_connection;constructor(e){this._connection=new zA(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 td=class extends we{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 RB=class extends td{};var io;(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||={})})(io||={});var rd=class extends we{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 Wq=io.DFUArrayActions,Lq=io.DFUDefFileFormat,vq=io.DFUChangeProtection,Pq=io.DFUChangeRestriction,ZA=class extends rd{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 FB=class extends we{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 pU(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:UB(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:Gq(e)}}default:throw new Error("Unknown field type")}}function UB(t){t.Row&&t.Row instanceof Array&&(t=t.Row[0]);let e=[];for(let r in t)e.push(pU(r,t[r]));return e}function Gq(t){let e={};for(let r in t)e[r]=pU(r,t[r]);return e}var uc=class extends we{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(UB)}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]=UB(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 si(s,n,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var nd=class extends we{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e)}Ping(e){return this._connection.send("Ping",e)}};var NB=class extends nd{};var dt;(c=>{let t;(q=>(q.global="global",q.workunits="workunits",q.components="components",q.audience="audience",q.class="class",q.instance="instance",q.node="node",q.message="message",q.logid="logid",q.processid="processid",q.threadid="threadid",q.timestamp="timestamp",q.pod="pod",q.traceid="traceid",q.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||={})})(dt||={});var sd=class extends we{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 fU=kt("@hpcc-js/comms/services/wsLogaccess.ts");var EU=(A=>(A.Disaster="DIS",A.Error="ERR",A.Warning="WRN",A.Information="INF",A.Progress="PRO",A.Metric="MET",A))(EU||{}),CU=(s=>(s.Operator="OPR",s.User="USR",s.Programmer="PRO",s.Audit="ADT",s))(CU||{}),TB=class extends sd{_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:dt.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:dt.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:dt.SortColumType.ByDate,ColumnName:"",Direction:0}]}},A=[];for(let u in e){let c;u in n&&(Object.values(dt.LogColumnType).includes(u)?c=u:c=n[u]);let g;if(c){switch(c){case dt.LogColumnType.workunits:case"hpcc.log.jobid":g=dt.LogAccessType.ByJobID;break;case dt.LogColumnType.audience:case"hpcc.log.audience":g=dt.LogAccessType.ByTargetAudience;break;case dt.LogColumnType.class:case"hpcc.log.class":g=dt.LogAccessType.ByLogType;break;case dt.LogColumnType.components:case"kubernetes.container.name":g=dt.LogAccessType.ByComponent;break;default:g=dt.LogAccessType.ByFieldName,c=n[u]}if(Array.isArray(e[u]))e[u].forEach(l=>{g===dt.LogAccessType.ByComponent&&(l+="*"),A.push({LogCategory:g,SearchField:c,SearchByValue:l})});else{let l=e[u];g===dt.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=dt.LogAccessFilterOperator.AND;g>0?(A[g-1].SearchField===c.SearchField&&(l=dt.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:dt.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=dt.LogAccessFilterOperator.AND,A[0].SearchField===A[1].SearchField&&(i.Filter.Operator=dt.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:fU.warning(`Unknown RemoteLogManagerType: ${r.RemoteLogManagerType}`),g=[]}return{lines:g,total:u.TotalLogLinesAvailable??1e4}}catch(c){fU.error(c.message??c)}return{lines:[],total:0}})}};var oi=ot(IU(),1);var od=class extends we{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 Ds=class extends od{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,oi.mean)(g.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed),max:(0,oi.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,oi.mean)(u.filter(c=>!isNaN(c.mean)),c=>c.mean),max:(0,oi.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,oi.mean)(i.filter(A=>!isNaN(A.mean)),A=>A.mean),max:(0,oi.max)(i.filter(A=>!isNaN(A.max)),A=>A.max)}}))}};var Ad=class extends we{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 MB=class extends Ad{};var ad=class extends we{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 xB=class extends ad{};var kB;(e=>{let t;(s=>(s.ECL="ECL",s.DFU="DFU"))(t=e.WUTypes||={})})(kB||={});var ud=class extends we{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 WB=class extends ud{};var LB;(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||={})})(LB||={});var cd=class extends we{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 KA=class extends cd{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(r=>({Running:{ActiveWorkunit:[]},...r}))}};var $A=class extends we{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 vB;(e=>{let t;(i=>(i.All="All",i.QueriesOnly="QueriesOnly",i.WorkunitsOnly="WorkunitsOnly"))(t=e.RoxieQueueFilter||={})})(vB||={});var ld=class extends we{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 Yt=class extends ld{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 Zt;(D=>{let t;(se=>(se.Abort="Abort",se.Delete="Delete",se.Deschedule="Deschedule",se.Reschedule="Reschedule",se.Pause="Pause",se.PauseNow="PauseNow",se.Protect="Protect",se.Unprotect="Unprotect",se.Restore="Restore",se.Resume="Resume",se.SetToFailed="SetToFailed",se.Archive="Archive"))(t=D.ECLWUActions||={});let e;(G=>(G[G.MIN=0]="MIN",G[G.DEFAULT=1]="DEFAULT",G[G.ALL=2]="ALL",G[G.CUSTOM=3]="CUSTOM"))(e=D.LogSelectColumnMode||={});let r;(F=>(F[F.ASC=0]="ASC",F[F.DSC=1]="DSC"))(r=D.SortDirection||={});let n;(z=>(z.ALL="ALL",z.DIS="DIS",z.ERR="ERR",z.WRN="WRN",z.INF="INF",z.PRO="PRO",z.MET="MET",z.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;(G=>(G.info="info",G.warning="warning",G.error="error",G.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;(Z=>(Z.All="All",Z.Id="Id",Z.Name="Name",Z.Alias="Alias",Z.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;(z=>(z.Suspend="Suspend",z.Unsuspend="Unsuspend",z.ToggleSuspend="ToggleSuspend",z.Activate="Activate",z.Delete="Delete",z.DeleteQueriesAndWUs="DeleteQueriesAndWUs",z.RemoveAllAliases="RemoveAllAliases",z.ResetQueryStats="ResetQueryStats"))(E=D.QuerySetQueryActionTypes||={});let b;(G=>(G[G.DoNotActivateQuery=0]="DoNotActivateQuery",G[G.ActivateQuery=1]="ActivateQuery",G[G.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",G[G.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(b=D.WUQueryActivationMode||={})})(Zt||={});var cc=class extends we{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 gd=(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))(gd||{}),Ai;(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||={})})(Ai||={});function PB(t){return typeof t.Name=="string"}function Vq(t){return t.TotalClusterTime!==void 0}function _q(t){return t.StateEx!==void 0}var Pt=class extends cc{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=>El({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=Bl(r.Result).children();return s.length?s[0]:null})}},lc=class extends cc{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};var UU=ot(GB(),1),Sd=ot(SU(),1);var gc=class extends Ge{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=>pc(r)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(r=>pc(r))}},hc=class extends Ze{constructor(){super(e=>Ze.hash([e.Name]))}};function bU(t,e,r){r=r||[],r.push(t),e(t.name,t.$,t.children(),r),t.children().forEach(n=>{bU(n,e,r)}),r.pop()}function VB(t){let e={};return t.forEach(r=>{r.name==="att"&&(e[r.$.name]=r.$.value)}),e}var fd=class extends Da{},_B=class extends xo{},YB=class extends Wo{},HB=class extends ma{};function jB(t,e){let r={},n={},s={},i=new fd(u=>u._.id),A=[i.root];return bU(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(VB(g));A.push(E),r[c.id]=E}let p=d.createVertex(VB(g));n[c.id]=p;break;case"edge":let B=d.createEdge(n[c.source],n[c.target],VB(g));s[c.id]=B;break;default:}}),i}var dc=class extends Da{},OB=class extends xo{},qB=class extends Wo{},JB=class extends ma{};function pc(t){let e={},r={},n={},s;for(let i of t)switch(i.ScopeType){case"graph":s=new dc(l=>l._.Id,i),e[i.ScopeName]=s.root;break;case"subgraph":s||(s=new dc(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 fc=class extends Ge{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 Ec=class{e;constructor(e){this.e=e}fix(){delete this.e}},Cc=class extends Ec{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}},Bc=class extends Ec{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()}},Ic=class{root;simpleTypes={};fields(){return this.root.children()}},Ed=class extends yi{schema=new Ic;simpleType;simpleTypes={};xsdStack=new Di;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let r=new Cc(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 Bc(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 Cd(t){let e=new Ed;return e.parse(t),e.schema}var zB=class extends Ed{_rootName;schema=new Ic;simpleTypes={};xsdStack=new Di;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let r=new Cc(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 Bc(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 Yq(t,e){let r=new zB(e);return r.parse(t),r.schema}var Id=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Bd=new Id,Qc=class t extends Ge{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=Bd.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=Bd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:"Sequence_"+n},()=>new t(e,r,n)):typeof n=="string"&&(i=Bd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:n},()=>new t(e,r,n)))),i}static attachLogicalFile(e,r,n){return Bd.get({BaseUrl:e.baseUrl,Wuid:r,ResultName:n},()=>new t(e,r,n,!0))}constructor(e,r,n,s){super(),e instanceof Pt?this.connection=e:this.connection=new Pt(e),typeof s=="boolean"&&s===!0?this.set({NodeGroup:r,LogicalFileName:n}):PB(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=Cd(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=Cd(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)}},mc=class extends Ze{constructor(){super(e=>Ze.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};var ai=class extends Ge{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)}},Qd=class extends Ge{_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 ai(this,n))}),r.start&&r.end?(r.start.FormattedEnd=r.end.Formatted,e.push(new ai(this,r.start))):r.start?e.push(new ai(this,r.start)):r.end&&e.push(new ai(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 ai(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>`}},ea=class extends Qd{wu;constructor(e,r){super(r),this.wu=e}};var Dc=class extends Ge{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 Pt?this.connection=e:this.connection=new Pt(e),this.set({Wuid:r,...n})}};var yc=class extends Ge{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 Pt?this.connection=e:this.connection=new Pt(e);let s=uQ(n.Value);this.set({Wuid:r,Seconds:Math.round(s*1e3)/1e3,HasSubGraphId:n.SubGraphId!==void 0,...n})}};var Hq=(0,Sd.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),Oq=(0,Sd.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),qq=(0,UU.format)(",");function Jq(t){return t&&!isNaN(+t)?qq(+t):t}function RU(t,e,r){t[e]===void 0||t[e][r]===void 0||e==="__proto__"||e==="constructor"||e==="prototype"||delete t[e][r]}var wc="DefinitionList",jq=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,NU=["Avg","Min","Max","Delta","StdDev"],TU=["SkewMin","SkewMax","NodeMin","NodeMax"],zq=/[A-Z][a-z]*/g;function Xq(t){for(let r of TU){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(zq);if(e?.length){let r=e.shift(),n=e.join("");for(let s of NU){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 FU={};function MU(t){let e=FU[t];return e||(e=Xq(t),FU[t]=e),e}function Jn(t,e){return t.__formattedProps?.[e]??t[e]}function md(t){if(t===void 0)return;let e=parseFloat(t);return isNaN(e)?void 0:e}function Zq(t,e,r){let n=MU(e);if(!r[n.measure]){r[n.label]=!0;let s=md(t[`${n.measure}Avg${n.label}`]),i=md(t[`${n.measure}Min${n.label}`]),A=md(t[`${n.measure}Max${n.label}`]),u=md(t[`${n.measure}StdDev${n.label}`]),c=Math.max((s-i)/u,(A-s)/u);return{Key:`${n.measure}${n.label}`,Value:Jn(t,`${n.measure}${n.label}`),Avg:Jn(t,`${n.measure}Avg${n.label}`),Min:Jn(t,`${n.measure}Min${n.label}`),Max:Jn(t,`${n.measure}Max${n.label}`),Delta:Jn(t,`${n.measure}Delta${n.label}`),StdDev:Jn(t,`${n.measure}StdDev${n.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:Jn(t,`SkewMin${n.label}`),SkewMax:Jn(t,`SkewMax${n.label}`),NodeMin:Jn(t,`NodeMin${n.label}`),NodeMax:Jn(t,`NodeMax${n.label}`)}}return null}var Dd=kt("workunit.ts"),wd=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},yd=new wd,oo=class t extends Ge{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")||gd[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 mc;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,()=>Qc.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 yc(this.connection,this.Wuid,e))}_graphCache=new hc;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 gc(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 fc(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 Dc(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=>(yd.set(r),r.set(n.Workunit),r))}static attach(e,r,n){let s=yd.get({BaseUrl:e.baseUrl,Wuid:r},()=>new t(e,r));return n&&s.set(n),s}static existsLocal(e,r){return yd.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,Ai.Action.Compile):i.submit(r))}static compile(e,r,n){return t.submit(e,r,n,!0)}static query(e,r){return new Pt(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 Pt(e),this.topologyConnection=new Yt(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=Ai.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===Ai.Action.Debug&&(r=Ai.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===Ai.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(Zt.ECLWUActions.SetToFailed)}pause(){return this.WUAction(Zt.ECLWUActions.Pause)}pauseNow(){return this.WUAction(Zt.ECLWUActions.PauseNow)}resume(){return this.WUAction(Zt.ECLWUActions.Resume)}abort(){return this.WUAction(Zt.ECLWUActions.Abort)}protect(){return this.WUAction(Zt.ECLWUActions.Protect)}unprotect(){return this.WUAction(Zt.ECLWUActions.Unprotect)}delete(){return this.WUAction(Zt.ECLWUActions.Delete)}restore(){return this.WUAction(Zt.ECLWUActions.Restore)}deschedule(){return this.WUAction(Zt.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(Zt.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},RU(n,d.Name,"RawValue"),RU(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]=Jq(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[wc])try{let l=JSON.parse(c[wc].split("\\").join("\\\\"));c[wc]=[],l.forEach((d,p)=>{let B=d.match(jq);if(B){let E=(B[1]??"")+B[2]+B[3],b=parseInt(B[5]),D=parseInt(B[6]);c[wc].push({filePath:E,line:b,col:D})}})}catch{Dd.error(`Unexpected "DefinitionList": ${c[wc]}`)}let g={};for(let l in c)if(l.indexOf("__")!==0){let d=Zq(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 ea(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 ea(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=>pc(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=Oq(i.start);A.setMilliseconds(A.getMilliseconds()+i.elapsed/1e6),i.finish=Hq(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 Dd.warning(`Unexpected ESP exception: ${r.message}`),r;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),yd.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 Dd.warning(`Unexpected ESP exception: ${n.message}`),n;return{}})}WUResubmit(e){return this.connection.WUResubmit(Cl({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(Cl({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=>Cl({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:Zt.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let r=new lc({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 ns(e)}).catch(n=>(Dd.error(n),Promise.resolve(new ns(e)))):Promise.resolve(new ns(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=jB(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(r=>eJ(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}))}},XB="definition";function Kq(t){return t._[XB]!==void 0}function $q(t){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(t._[XB]);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._[XB]}`)}function eJ(t,e){let r=[];for(let n of t.vertices)if(Kq(n)){let s=$q(n);(s&&!e||e===s.file)&&r.push(s)}return r.sort((n,s)=>n.line-s.line)}var bd,ZB=class t extends Ge{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 bd||(bd=new t(e)),r&&bd.set(r),bd}constructor(e){super(),e instanceof KA?this.connection=e:this.connection=new KA(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(r=>e===""||r.ClusterName===e).map(r=>oo.attach(this.connection.connectionOptions(),r.Wuid,r))}setBanner(e){return this.connection.SetBanner({...e}).then(r=>(this.set(r),this))}lazyRefresh=AQ(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};var tJ=kt("logicalFile.ts"),Rd=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},rJ=new Rd,KB=class t extends Ge{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=rJ.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 ZA?this.connection=e:this.connection=new ZA(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 tJ.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 Fd=class extends Ze{constructor(){super(e=>e.Address)}},nJ=new Fd,Sc=class t extends Ge{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=nJ.get({Address:r},()=>new t(e));return n&&s.set(n),s}constructor(e){super(),e instanceof Ds?this.connection=e:this.connection=new Ds(e)}};var xU=ot(GB(),1);var Ud=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},sJ=new Ud,Ao=class t extends Ge{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=>Sc.attach(this.machineConnection,e.Address,e))}static attach(e,r,n){let s=sJ.get({BaseUrl:e.baseUrl,Name:r},()=>new t(e,r));return n&&s.set(n),s}constructor(e,r){super(),e instanceof Yt?(this.connection=e,this.machineConnection=new Ds(e.connectionOptions())):(this.connection=new Yt(e),this.machineConnection=new Ds(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 iJ(t){let e;return t instanceof Yt?e=t:e=new Yt(t),e.TpListTargetClusters({}).then(r=>r.TargetClusters.TpClusterNameType.map(n=>Ao.attach(t,n.Name,n)))}var $B={};function oJ(t){if(!$B[t.baseUrl]){let e;t instanceof Yt?e=t:e=new Yt(t),$B[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 Ao.attach(t,A.Name,A)})}return $B[t.baseUrl]}var Nd=class extends Ze{constructor(){super(e=>e.BaseUrl)}},AJ=new Nd,bc=class t extends Ge{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=>Ao.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,r){let n=AJ.get({BaseUrl:e.baseUrl},()=>new t(e));return r&&n.set(r),n}constructor(e){super(),e instanceof Yt?this.connection=e:this.connection=new Yt(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 ui(t,e,r){e==="__proto__"||e==="constructor"||e==="prototype"||(t[e]=r)}function Rc(t){return t=""+t,t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function aJ(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 ci(t,e){let r=t.indexOf(e);return r!==-1?parseFloat(t.substring(0,r)):-1}function uJ(t){if(t){if(!isNaN(+t))return parseFloat(t)}else return 0;let e=ci(t,"Kb");return e>=0?e*1024:(e=ci(t,"Mb"),e>=0?e*Math.pow(1024,2):(e=ci(t,"Gb"),e>=0?e*Math.pow(1024,3):(e=ci(t,"Tb"),e>=0?e*Math.pow(1024,4):(e=ci(t,"Pb"),e>=0?e*Math.pow(1024,5):(e=ci(t,"Eb"),e>=0?e*Math.pow(1024,6):(e=ci(t,"Zb"),e>=0?e*Math.pow(1024,7):(e=ci(t,"b"),e>=0?e:0)))))))}function cJ(t){return t?parseFloat(t):0}var eI=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+'="'+Rc(i[A])+'"':s+='<att name="'+A+'" value="'+Rc(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+'="'+Rc(s[i])+'"':n+='<att name="'+i+'" value="'+Rc(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="'+Rc(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))}},Fc=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}},li=class extends Fc{_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)})}},ao=class extends Fc{_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)}},uo=class extends Fc{_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]}},Uc=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 li}isVertex(e){return e instanceof ao}isEdge(e){return e instanceof uo}getGlobalType(e){return e instanceof ao?3:e instanceof uo?4:e instanceof li?2:e instanceof t?1:0}getGlobalTypeString(e){return e instanceof ao?"Vertex":e instanceof uo?"Edge":e instanceof li?"Cluster":e instanceof t?"Graph":"Unknown"}getItem(e,r){if(!this.idx[r])switch(e.tagName){case"graph":let s=new li(this,r);this.subgraphs.push(s),this.idx[r]=s;break;case"node":let i=new ao(this,r);this.vertices.push(i),this.idx[r]=i;break;case"edge":let A=new uo(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=>{ui(n,s.name,s.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof li?this.subgraphs=this.subgraphs.filter(r=>e!==r):e instanceof ao?this.vertices=this.vertices.filter(r=>e!==r):e instanceof uo&&(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?(ui(n,c,g),ui(n,u,""+aJ(g))):u.indexOf("Size")===0?(ui(n,c,g),ui(n,u,""+uJ(g))):u.indexOf("Skew")===0?(ui(n,c,g),ui(n,u,""+cJ(g))):ui(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 li&&r.remove()})}removeSpillVertices(){[...this.vertices].forEach(r=>{r.isSpill()&&r.remove()})}getLocalisedXGMML(e,r,n,s){let i=new eI(this);return i.calcVisibility(e,r,n,s),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var tI=kt("@hpcc-js/comms/ecl/query.ts"),lJ=(0,xU.format)("~s");function gJ(t){return!isNaN(parseFloat(t))&&!isNaN(t-0)}var rI=class extends Ze{constructor(){super(e=>Ze.hash([e.QueryId,e.QuerySet]))}},hJ=new rI,nI=class t extends Ge{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 Pt?this.wsWorkunitsService=e:this.wsWorkunitsService=new Pt(e),this.topology=bc.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:r,QueryId:n,...s})}static attach(e,r,n,s){let i=hJ.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 uc({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){tI.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){tI.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 Uc,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=oo.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=gJ(g[l])?parseFloat(g[l]):g[l],B=g[l];l.indexOf("Time")>=0&&(p=p/1e9,B=lJ(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 tI.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 Td=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},dJ=new Td,gi=class extends ya{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}},sI=class t{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new wa;static attach(e,r="HPCCApps",n,s=!0){return dJ.get({BaseUrl:e.baseUrl,Name:r,UserSpecific:s,Namespace:n},()=>new t(e,r,n,s))}constructor(e,r,n,s){e instanceof $A?this.connection=e:this.connection=new $A(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 gi(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 gi(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 gi(i.Key,i.Value,A))}),e)for(let i in s)this._dispatch.post(new gi(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 gi(e,void 0,s))}).catch(n=>{console.error(`Store.delete(${e}) failed:`,n)})}monitor(e){return this._dispatch.attach(e)}};var pJ=kt("@hpcc-js/comms/dfuWorkunit.ts");var Md=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},kU=new Md,iI=class t extends Ge{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=>(kU.set(n),n.set(s.result),n))}static attach(e,r,n){let s=kU.get({BaseUrl:e.baseUrl,ID:r},()=>new t(e,r));return n&&s.set(n),s}static sprayFixed(e,r){let n=new ii(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 ii(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 ii(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(XA.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===XA.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 ii(e),this.topologyConnection=new Yt(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 pJ.warning(`Unexpected ESP exception: ${r.message}`),r;return{}})}};var iN=ot(require("node:child_process"),1),Kt=ot(require("node:fs"),1),go=ot(require("node:os"),1),mr=ot(require("node:path"),1),oN=ot(ZU(),1);var co=ot(require("node:fs"),1),pt=ot(require("node:path"),1);var TJ=kt("clienttools/eclmeta"),MJ=!1;function na(t,e,r){if(MJ){for(let n in t){let s=`${e}.${n}`;n!=="$"&&r[n]===void 0&&r[n.toLowerCase()+"s"]===void 0&&TJ.debug(s)}t.$&&na(t.$,e+".$",r)}}var kd=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},Wd=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}},lo=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=pt.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 Ld(this.sourcePath,r);return na(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=sQ(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}))}},Ld=class extends lo{__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 kd(r);return na(r,"attr",n),n})}parseFields(e=[]){return e.map(r=>{let n=new Wd(this,r);return na(r,"field",n),n})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},Nc=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}},vd=class extends lo{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 ns("");n.appendAttribute("name","$"),n.appendAttribute("ref",r.join(".")),this.imports=[new Nc(n),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(r=>{let n=new Nc(r);return na(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}},xJ=t=>pt.basename(t).indexOf(".")===0,KU=t=>co.lstatSync(t).isDirectory()&&!xJ(t),kJ=t=>[".ecl",".ecllib"].indexOf(pt.extname(t).toLowerCase())>=0,$U=t=>co.readdirSync(t).map(e=>pt.join(t,e)).filter(e=>KU(e)||kJ(e)),Pd=class extends lo{constructor(e,r){super(e,"file",r,[])}suggestions(){return[]}},Gd=class extends lo{constructor(e,r){super(e,"folder",r,[])}suggestions(){return $U(this.sourcePath).map(e=>({name:pt.basename(e,".ecl"),type:"folder"}))}},Vd=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new Qa;_sourceByPath=new ko;_test=new Qa;constructor(e,r){this._workspacePath=e,this._eclccPath=r}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return pI(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]&&co.existsSync(e[r])&&this.walkChildFolders(e[r],e[r]);return this})}primeWorkspace(){co.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,r,n=!1){for(let s of $U(e))KU(s)?this.visitFolder(s,r,n):this.visitFile(s,r,n)}visitFile(e,r,n=!1){let s=pt.parse(e),i=pt.join(s.dir,s.name),A=pt.relative(r,i).split(pt.sep).join(".");(n||!this._test.has(A))&&this._test.set(A,new Pd("",e))}visitFolder(e,r,n=!1){let s=pt.relative(r,e).split(pt.sep).join(".");(n||!this._test.has(s))&&(this._test.set(s,new Gd(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 vd(r);if(na(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=pt.dirname(A),--i;this.visitFolder(A,pt.dirname(A))}}this.walkSource(n)}}parseMetaXML(e){let r=new dI;return r.parse(e),this.parseSources(r.sources),r.sources.map(n=>pt.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)}},hI=new ko;function hi(t,e){let r=pt.normalize(t);if(!hI.has(r)){let n=new Vd(r,e);hI.set(r,n),n.refresh()}return hI.get(r)}function WJ(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 LJ(t,e,r){for(;WJ(t,e,r);)e+=r?-1:1;return e+(r?1:-1)}var dI=class extends yi{sources=[];endXMLNode(e){switch(e.name){case"Source":this.sources.push(e);break;default:break}super.endXMLNode(e)}};var sa=kt("clienttools/eclcc"),fI=go.type()==="Windows_NT"?".exe":"";function eN(t){return t.split(`\r
|
|
976
|
+
</div>`}},ea=class extends Qd{wu;constructor(e,r){super(r),this.wu=e}};var Dc=class extends Ge{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 Pt?this.connection=e:this.connection=new Pt(e),this.set({Wuid:r,...n})}};var yc=class extends Ge{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 Pt?this.connection=e:this.connection=new Pt(e);let s=uQ(n.Value);this.set({Wuid:r,Seconds:Math.round(s*1e3)/1e3,HasSubGraphId:n.SubGraphId!==void 0,...n})}};var Hq=(0,Sd.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),Oq=(0,Sd.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),qq=(0,UU.format)(",");function Jq(t){return t&&!isNaN(+t)?qq(+t):t}function RU(t,e,r){t[e]===void 0||t[e][r]===void 0||e==="__proto__"||e==="constructor"||e==="prototype"||delete t[e][r]}var wc="DefinitionList",jq=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,NU=["Avg","Min","Max","Delta","StdDev"],TU=["SkewMin","SkewMax","NodeMin","NodeMax"],zq=/[A-Z][a-z]*/g;function Xq(t){for(let r of TU){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(zq);if(e?.length){let r=e.shift(),n=e.join("");for(let s of NU){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 FU={};function MU(t){let e=FU[t];return e||(e=Xq(t),FU[t]=e),e}function Jn(t,e){return t.__formattedProps?.[e]??t[e]}function md(t){if(t===void 0)return;let e=parseFloat(t);return isNaN(e)?void 0:e}function Zq(t,e,r){let n=MU(e);if(!r[n.measure]){r[n.label]=!0;let s=md(t[`${n.measure}Avg${n.label}`]),i=md(t[`${n.measure}Min${n.label}`]),A=md(t[`${n.measure}Max${n.label}`]),u=md(t[`${n.measure}StdDev${n.label}`]),c=Math.max((s-i)/u,(A-s)/u);return{Key:`${n.measure}${n.label}`,Value:Jn(t,`${n.measure}${n.label}`),Avg:Jn(t,`${n.measure}Avg${n.label}`),Min:Jn(t,`${n.measure}Min${n.label}`),Max:Jn(t,`${n.measure}Max${n.label}`),Delta:Jn(t,`${n.measure}Delta${n.label}`),StdDev:Jn(t,`${n.measure}StdDev${n.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:Jn(t,`SkewMin${n.label}`),SkewMax:Jn(t,`SkewMax${n.label}`),NodeMin:Jn(t,`NodeMin${n.label}`),NodeMax:Jn(t,`NodeMax${n.label}`)}}return null}var Dd=kt("workunit.ts"),wd=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},yd=new wd,oo=class t extends Ge{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")||gd[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 mc;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,()=>Qc.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 yc(this.connection,this.Wuid,e))}_graphCache=new hc;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 gc(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 fc(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 Dc(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=>(yd.set(r),r.set(n.Workunit),r))}static attach(e,r,n){let s=yd.get({BaseUrl:e.baseUrl,Wuid:r},()=>new t(e,r));return n&&s.set(n),s}static existsLocal(e,r){return yd.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,Ai.Action.Compile):i.submit(r))}static compile(e,r,n){return t.submit(e,r,n,!0)}static query(e,r){return new Pt(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 Pt(e),this.topologyConnection=new Yt(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=Ai.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===Ai.Action.Debug&&(r=Ai.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===Ai.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(Zt.ECLWUActions.SetToFailed)}pause(){return this.WUAction(Zt.ECLWUActions.Pause)}pauseNow(){return this.WUAction(Zt.ECLWUActions.PauseNow)}resume(){return this.WUAction(Zt.ECLWUActions.Resume)}abort(){return this.WUAction(Zt.ECLWUActions.Abort)}protect(){return this.WUAction(Zt.ECLWUActions.Protect)}unprotect(){return this.WUAction(Zt.ECLWUActions.Unprotect)}delete(){return this.WUAction(Zt.ECLWUActions.Delete)}restore(){return this.WUAction(Zt.ECLWUActions.Restore)}deschedule(){return this.WUAction(Zt.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(Zt.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},RU(n,d.Name,"RawValue"),RU(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]=Jq(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[wc])try{let l=JSON.parse(c[wc].split("\\").join("\\\\"));c[wc]=[],l.forEach((d,p)=>{let B=d.match(jq);if(B){let E=(B[1]??"")+B[2]+B[3],b=parseInt(B[5]),D=parseInt(B[6]);c[wc].push({filePath:E,line:b,col:D})}})}catch{Dd.error(`Unexpected "DefinitionList": ${c[wc]}`)}let g={};for(let l in c)if(l.indexOf("__")!==0){let d=Zq(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 ea(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 ea(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=>pc(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=Oq(i.start);A.setMilliseconds(A.getMilliseconds()+i.elapsed/1e6),i.finish=Hq(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 Dd.warning(`Unexpected ESP exception: ${r.message}`),r;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),yd.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 Dd.warning(`Unexpected ESP exception: ${n.message}`),n;return{}})}WUResubmit(e){return this.connection.WUResubmit(Cl({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(Cl({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=>Cl({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:Zt.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let r=new lc({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 ns(e)}).catch(n=>(Dd.error(n),Promise.resolve(new ns(e)))):Promise.resolve(new ns(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=jB(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(r=>eJ(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}))}},XB="definition";function Kq(t){return t._[XB]!==void 0}function $q(t){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(t._[XB]);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._[XB]}`)}function eJ(t,e){let r=[];for(let n of t.vertices)if(Kq(n)){let s=$q(n);(s&&!e||e===s.file)&&r.push(s)}return r.sort((n,s)=>n.line-s.line)}var bd,ZB=class t extends Ge{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 bd||(bd=new t(e)),r&&bd.set(r),bd}constructor(e){super(),e instanceof KA?this.connection=e:this.connection=new KA(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(r=>e===""||r.ClusterName===e).map(r=>oo.attach(this.connection.connectionOptions(),r.Wuid,r))}setBanner(e){return this.connection.SetBanner({...e}).then(r=>(this.set(r),this))}lazyRefresh=AQ(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};var tJ=kt("logicalFile.ts"),Rd=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},rJ=new Rd,KB=class t extends Ge{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=rJ.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 ZA?this.connection=e:this.connection=new ZA(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 tJ.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 Fd=class extends Ze{constructor(){super(e=>e.Address)}},nJ=new Fd,Sc=class t extends Ge{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=nJ.get({Address:r},()=>new t(e));return n&&s.set(n),s}constructor(e){super(),e instanceof Ds?this.connection=e:this.connection=new Ds(e)}};var xU=ot(GB(),1);var Ud=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},sJ=new Ud,Ao=class t extends Ge{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=>Sc.attach(this.machineConnection,e.Address,e))}static attach(e,r,n){let s=sJ.get({BaseUrl:e.baseUrl,Name:r},()=>new t(e,r));return n&&s.set(n),s}constructor(e,r){super(),e instanceof Yt?(this.connection=e,this.machineConnection=new Ds(e.connectionOptions())):(this.connection=new Yt(e),this.machineConnection=new Ds(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 iJ(t){let e;return t instanceof Yt?e=t:e=new Yt(t),e.TpListTargetClusters({}).then(r=>r.TargetClusters.TpClusterNameType.map(n=>Ao.attach(t,n.Name,n)))}var $B={};function oJ(t){if(!$B[t.baseUrl]){let e;t instanceof Yt?e=t:e=new Yt(t),$B[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 Ao.attach(t,A.Name,A)})}return $B[t.baseUrl]}var Nd=class extends Ze{constructor(){super(e=>e.BaseUrl)}},AJ=new Nd,bc=class t extends Ge{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=>Ao.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,r){let n=AJ.get({BaseUrl:e.baseUrl},()=>new t(e));return r&&n.set(r),n}constructor(e){super(),e instanceof Yt?this.connection=e:this.connection=new Yt(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 ui(t,e,r){e==="__proto__"||e==="constructor"||e==="prototype"||(t[e]=r)}function Rc(t){return t=""+t,t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function aJ(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 ci(t,e){let r=t.indexOf(e);return r!==-1?parseFloat(t.substring(0,r)):-1}function uJ(t){if(t){if(!isNaN(+t))return parseFloat(t)}else return 0;let e=ci(t,"Kb");return e>=0?e*1024:(e=ci(t,"Mb"),e>=0?e*Math.pow(1024,2):(e=ci(t,"Gb"),e>=0?e*Math.pow(1024,3):(e=ci(t,"Tb"),e>=0?e*Math.pow(1024,4):(e=ci(t,"Pb"),e>=0?e*Math.pow(1024,5):(e=ci(t,"Eb"),e>=0?e*Math.pow(1024,6):(e=ci(t,"Zb"),e>=0?e*Math.pow(1024,7):(e=ci(t,"b"),e>=0?e:0)))))))}function cJ(t){return t?parseFloat(t):0}var eI=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+'="'+Rc(i[A])+'"':s+='<att name="'+A+'" value="'+Rc(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+'="'+Rc(s[i])+'"':n+='<att name="'+i+'" value="'+Rc(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="'+Rc(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))}},Fc=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}},li=class extends Fc{_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)})}},ao=class extends Fc{_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)}},uo=class extends Fc{_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]}},Uc=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 li}isVertex(e){return e instanceof ao}isEdge(e){return e instanceof uo}getGlobalType(e){return e instanceof ao?3:e instanceof uo?4:e instanceof li?2:e instanceof t?1:0}getGlobalTypeString(e){return e instanceof ao?"Vertex":e instanceof uo?"Edge":e instanceof li?"Cluster":e instanceof t?"Graph":"Unknown"}getItem(e,r){if(!this.idx[r])switch(e.tagName){case"graph":let s=new li(this,r);this.subgraphs.push(s),this.idx[r]=s;break;case"node":let i=new ao(this,r);this.vertices.push(i),this.idx[r]=i;break;case"edge":let A=new uo(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=>{ui(n,s.name,s.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof li?this.subgraphs=this.subgraphs.filter(r=>e!==r):e instanceof ao?this.vertices=this.vertices.filter(r=>e!==r):e instanceof uo&&(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?(ui(n,c,g),ui(n,u,""+aJ(g))):u.indexOf("Size")===0?(ui(n,c,g),ui(n,u,""+uJ(g))):u.indexOf("Skew")===0?(ui(n,c,g),ui(n,u,""+cJ(g))):ui(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 li&&r.remove()})}removeSpillVertices(){[...this.vertices].forEach(r=>{r.isSpill()&&r.remove()})}getLocalisedXGMML(e,r,n,s){let i=new eI(this);return i.calcVisibility(e,r,n,s),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var tI=kt("@hpcc-js/comms/ecl/query.ts"),lJ=(0,xU.format)("~s");function gJ(t){return!isNaN(parseFloat(t))&&!isNaN(t-0)}var rI=class extends Ze{constructor(){super(e=>Ze.hash([e.QueryId,e.QuerySet]))}},hJ=new rI,nI=class t extends Ge{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 Pt?this.wsWorkunitsService=e:this.wsWorkunitsService=new Pt(e),this.topology=bc.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:r,QueryId:n,...s})}static attach(e,r,n,s){let i=hJ.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 uc({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){tI.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){tI.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 Uc,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=oo.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=gJ(g[l])?parseFloat(g[l]):g[l],B=g[l];l.indexOf("Time")>=0&&(p=p/1e9,B=lJ(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 tI.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 Td=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},dJ=new Td,gi=class extends ya{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}},sI=class t{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new wa;static attach(e,r="HPCCApps",n,s=!0){return dJ.get({BaseUrl:e.baseUrl,Name:r,UserSpecific:s,Namespace:n},()=>new t(e,r,n,s))}constructor(e,r,n,s){e instanceof $A?this.connection=e:this.connection=new $A(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 gi(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 gi(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 gi(i.Key,i.Value,A))}),e)for(let i in s)this._dispatch.post(new gi(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 gi(e,void 0,s))}).catch(n=>{console.error(`Store.delete(${e}) failed:`,n)})}monitor(e){return this._dispatch.attach(e)}};var pJ=kt("@hpcc-js/comms/dfuWorkunit.ts");var Md=class extends Ze{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},kU=new Md,iI=class t extends Ge{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=>(kU.set(n),n.set(s.result),n))}static attach(e,r,n){let s=kU.get({BaseUrl:e.baseUrl,ID:r},()=>new t(e,r));return n&&s.set(n),s}static sprayFixed(e,r){let n=new ii(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 ii(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 ii(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(XA.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===XA.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 ii(e),this.topologyConnection=new Yt(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 pJ.warning(`Unexpected ESP exception: ${r.message}`),r;return{}})}};var iN=ot(require("node:child_process"),1),Kt=ot(require("node:fs"),1),go=ot(require("node:os"),1),mr=ot(require("node:path"),1),oN=ot(ZU(),1);var co=ot(require("node:fs"),1),pt=ot(require("node:path"),1);var TJ=kt("clienttools/eclmeta"),MJ=!1;function na(t,e,r){if(MJ){for(let n in t){let s=`${e}.${n}`;n!=="$"&&r[n]===void 0&&r[n.toLowerCase()+"s"]===void 0&&TJ.debug(s)}t.$&&na(t.$,e+".$",r)}}var kd=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},Wd=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}},lo=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=pt.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 Ld(this.sourcePath,r);return na(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=sQ(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}))}},Ld=class extends lo{__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 kd(r);return na(r,"attr",n),n})}parseFields(e=[]){return e.map(r=>{let n=new Wd(this,r);return na(r,"field",n),n})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},Nc=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}},vd=class extends lo{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 ns("");n.appendAttribute("name","$"),n.appendAttribute("ref",r.join(".")),this.imports=[new Nc(n),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(r=>{let n=new Nc(r);return na(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}},xJ=t=>pt.basename(t).indexOf(".")===0,KU=t=>co.lstatSync(t).isDirectory()&&!xJ(t),kJ=t=>[".ecl",".ecllib"].indexOf(pt.extname(t).toLowerCase())>=0,$U=t=>co.readdirSync(t).map(e=>pt.join(t,e)).filter(e=>KU(e)||kJ(e)),Pd=class extends lo{constructor(e,r){super(e,"file",r,[])}suggestions(){return[]}},Gd=class extends lo{constructor(e,r){super(e,"folder",r,[])}suggestions(){return $U(this.sourcePath).map(e=>({name:pt.basename(e,".ecl"),type:"folder"}))}},Vd=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new Qa;_sourceByPath=new ko;_test=new Qa;constructor(e,r){this._workspacePath=e,this._eclccPath=r}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return pI(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]&&co.existsSync(e[r])&&this.walkChildFolders(e[r],e[r]);return this})}primeWorkspace(){co.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,r,n=!1){for(let s of $U(e))KU(s)?this.visitFolder(s,r,n):this.visitFile(s,r,n)}visitFile(e,r,n=!1){let s=pt.parse(e),i=pt.join(s.dir,s.name),A=pt.relative(r,i).split(pt.sep).join(".");(n||!this._test.has(A))&&this._test.set(A,new Pd("",e))}visitFolder(e,r,n=!1){let s=pt.relative(r,e).split(pt.sep).join(".");(n||!this._test.has(s))&&(this._test.set(s,new Gd(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 vd(r);if(na(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=pt.dirname(A),--i;this.visitFolder(A,pt.dirname(A))}}this.walkSource(n)}}parseMetaXML(e){let r=new dI;return r.parse(e),this.parseSources(r.sources),r.sources.map(n=>pt.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)}},hI=new ko;function hi(t,e){let r=pt.normalize(t);if(!hI.has(r)){let n=new Vd(r,e);hI.set(r,n),n.refresh()}return hI.get(r)}function WJ(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 LJ(t,e,r){for(;WJ(t,e,r);)e+=r?-1:1;return e+(r?1:-1)}var dI=class extends yi{sources=[];endXMLNode(e){switch(e.name){case"Source":this.sources.push(e);break;default:break}super.endXMLNode(e)}};var sa=kt("clienttools/eclcc"),fI=go.type()==="Windows_NT"?".exe":"";function eN(t){return t.split(`\r
|
|
977
977
|
`).join(`
|
|
978
978
|
`).split("\r").join(`
|
|
979
979
|
`)}var ia=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}`}},tN="error",rN="warning",Mc=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===tN)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===rN)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[tN,rN].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},xc=class extends Mc{constructor(e,r){if(super(r),e&&e.length)for(let n of e.split(go.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&&(sa.warning(`parseECLErrors: Unable to parse "${n}"`),this.errOther.push(n))}this._checked=r}},Yd=class extends Mc{_lines;constructor(e,r,n){super(n);let s=Kt.readFileSync(e,"utf8");if(s=s.replace(/\r\n/g,`
|