@boltic/swirl 1.0.2-uat.111 → 1.0.2-uat.112

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/swirl.es.js CHANGED
@@ -189825,7 +189825,7 @@ const jG = () => {
189825
189825
  renderCell: (E) => {
189826
189826
  const y = E.row.status === "Completed" ? "Successful" : E.row.status;
189827
189827
  if (!(a(E.row) || r)) return null;
189828
- const x = !!E.row?.meta?.failed_before_start && !!E.row?.meta?.request_body, S = E.row._isChild, b = x && /* @__PURE__ */ d.jsx(fr, { arrow: !0, placement: "left", title: "View trigger payload", children: /* @__PURE__ */ d.jsx(
189828
+ const x = !!E.row?.meta?.request_body, S = E.row._isChild, b = x && /* @__PURE__ */ d.jsx(fr, { arrow: !0, placement: "left", title: "View trigger payload", children: /* @__PURE__ */ d.jsx(
189829
189829
  tr,
189830
189830
  {
189831
189831
  size: "small",
@@ -194978,7 +194978,7 @@ const VG = /* @__PURE__ */ ci(SAt), xAt = (e) => {
194978
194978
  handleClose: () => se(null),
194979
194979
  variant: "xlarge",
194980
194980
  title: "Trigger payload",
194981
- subtitle: "This execution failed before it could start, so run logs aren't available.",
194981
+ subtitle: Te?.meta?.failed_before_start ? "This execution failed before it could start, so run logs aren't available." : "This execution is still pending, so run logs aren't available yet.",
194982
194982
  content: /* @__PURE__ */ d.jsx(ZAt, { data: Te?.meta?.request_body })
194983
194983
  }
194984
194984
  ),
package/dist/swirl.umd.js CHANGED
@@ -678,4 +678,4 @@ Check the top-level render call using <`+at+">.")}return nt}}function we(Ie,nt){
678
678
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(n=>r.set(n)),r}static accessor(e){const t=(this[Mie]=this[Mie]={accessors:{}}).accessors,r=this.prototype;function n(i){const o=BE(i);t[o]||(wct(r,i),t[o]=!0)}return Mt.isArray(e)?e.forEach(n):n(e),this}};ba.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Mt.reduceDescriptors(ba.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),Mt.freezeMethods(ba);function d8(e,t){const r=this||FE,n=t||r,i=ba.from(n.headers);let o=n.data;return Mt.forEach(e,function(s){o=s.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Fie(e){return!!(e&&e.__CANCEL__)}function t0(e,t,r){En.call(this,e??"canceled",En.ERR_CANCELED,t,r),this.name="CanceledError"}Mt.inherits(t0,En,{__CANCEL__:!0});function Bie(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new En("Request failed with status code "+r.status,[En.ERR_BAD_REQUEST,En.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ict(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Dct(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(a){const l=Date.now(),u=n[o];s||(s=l),r[i]=a,n[i]=l;let c=o,f=0;for(;c!==i;)f+=r[c++],c=c%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-s<t)return;const p=u&&l-u;return p?Math.round(f*1e3/p):void 0}}function Rct(e,t){let r=0,n=1e3/t,i,o;const s=(a,l=Date.now())=>{r=l,i=null,o&&(clearTimeout(o),o=null),e.apply(null,a)};return[(...a)=>{const l=Date.now(),u=l-r;u>=n?s(a,l):(i=a,o||(o=setTimeout(()=>{o=null,s(i)},n-u)))},()=>i&&s(i)]}const $x=(e,t,r=3)=>{let n=0;const i=Dct(50,250);return Rct(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-n,u=i(l),c=s<=a;n=s;const f={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-s)/u:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},r)},jie=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},$ie=e=>(...t)=>Mt.asap(()=>e(...t)),Pct=Rs.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Rs.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Rs.origin),Rs.navigator&&/(msie|trident)/i.test(Rs.navigator.userAgent)):()=>!0,Nct=Rs.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const s=[e+"="+encodeURIComponent(t)];Mt.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Mt.isString(n)&&s.push("path="+n),Mt.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Lct(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function kct(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Uie(e,t,r){let n=!Lct(t);return e&&(n||r==!1)?kct(e,t):t}const Hie=e=>e instanceof ba?{...e}:e;function Fp(e,t){t=t||{};const r={};function n(u,c,f,p){return Mt.isPlainObject(u)&&Mt.isPlainObject(c)?Mt.merge.call({caseless:p},u,c):Mt.isPlainObject(c)?Mt.merge({},c):Mt.isArray(c)?c.slice():c}function i(u,c,f,p){if(Mt.isUndefined(c)){if(!Mt.isUndefined(u))return n(void 0,u,f,p)}else return n(u,c,f,p)}function o(u,c){if(!Mt.isUndefined(c))return n(void 0,c)}function s(u,c){if(Mt.isUndefined(c)){if(!Mt.isUndefined(u))return n(void 0,u)}else return n(void 0,c)}function a(u,c,f){if(f in t)return n(u,c);if(f in e)return n(void 0,u)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,c,f)=>i(Hie(u),Hie(c),f,!0)};return Mt.forEach(Object.keys(Object.assign({},e,t)),function(u){const c=l[u]||i,f=c(e[u],t[u],u);Mt.isUndefined(f)&&c!==a||(r[u]=f)}),r}const Vie=e=>{const t=Fp({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=ba.from(s),t.url=Pie(Uie(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(Mt.isFormData(r)){if(Rs.hasStandardBrowserEnv||Rs.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[u,...c]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...c].join("; "))}}if(Rs.hasStandardBrowserEnv&&(n&&Mt.isFunction(n)&&(n=n(t)),n||n!==!1&&Pct(t.url))){const u=i&&o&&Nct.read(o);u&&s.set(i,u)}return t},Mct=typeof XMLHttpRequest<"u",Fct=Mct&&function(e){return new Promise(function(t,r){const n=Vie(e);let i=n.data;const o=ba.from(n.headers).normalize();let{responseType:s,onUploadProgress:a,onDownloadProgress:l}=n,u,c,f,p,h;function A(){p&&p(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;g.open(n.method.toUpperCase(),n.url,!0),g.timeout=n.timeout;function m(){if(!g)return;const O=ba.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),v={data:!s||s==="text"||s==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:O,config:e,request:g};Bie(function(T){t(T),A()},function(T){r(T),A()},v),g=null}"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(m)},g.onabort=function(){g&&(r(new En("Request aborted",En.ECONNABORTED,e,g)),g=null)},g.onerror=function(){r(new En("Network Error",En.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let O=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const v=n.transitional||Lie;n.timeoutErrorMessage&&(O=n.timeoutErrorMessage),r(new En(O,v.clarifyTimeoutError?En.ETIMEDOUT:En.ECONNABORTED,e,g)),g=null},i===void 0&&o.setContentType(null),"setRequestHeader"in g&&Mt.forEach(o.toJSON(),function(O,v){g.setRequestHeader(v,O)}),Mt.isUndefined(n.withCredentials)||(g.withCredentials=!!n.withCredentials),s&&s!=="json"&&(g.responseType=n.responseType),l&&([f,h]=$x(l,!0),g.addEventListener("progress",f)),a&&g.upload&&([c,p]=$x(a),g.upload.addEventListener("progress",c),g.upload.addEventListener("loadend",p)),(n.cancelToken||n.signal)&&(u=O=>{g&&(r(!O||O.type?new t0(null,e,g):O),g.abort(),g=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const y=Ict(n.url);if(y&&Rs.protocols.indexOf(y)===-1){r(new En("Unsupported protocol "+y+":",En.ERR_BAD_REQUEST,e));return}g.send(i||null)})},Bct=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const o=function(u){if(!i){i=!0,a();const c=u instanceof Error?u:this.reason;n.abort(c instanceof En?c:new t0(c instanceof Error?c.message:c))}};let s=t&&setTimeout(()=>{s=null,o(new En(`timeout ${t} of ms exceeded`,En.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:l}=n;return l.unsubscribe=()=>Mt.asap(a),l}},jct=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},$ct=async function*(e,t){for await(const r of Uct(e))yield*jct(r,t)},Uct=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Gie=(e,t,r,n)=>{const i=$ct(e,t);let o=0,s,a=l=>{s||(s=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await i.next();if(u){a(),l.close();return}let f=c.byteLength;if(r){let p=o+=f;r(p)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Ux=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Wie=Ux&&typeof ReadableStream=="function",Hct=Ux&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Qie=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Vct=Wie&&Qie(()=>{let e=!1;const t=new Request(Rs.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),zie=64*1024,f8=Wie&&Qie(()=>Mt.isReadableStream(new Response("").body)),Hx={stream:f8&&(e=>e.body)};Ux&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Hx[t]&&(Hx[t]=Mt.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new En(`Response type '${t}' is not supported`,En.ERR_NOT_SUPPORT,n)})})})(new Response);const Gct=async e=>{if(e==null)return 0;if(Mt.isBlob(e))return e.size;if(Mt.isSpecCompliantForm(e))return(await new Request(Rs.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Mt.isArrayBufferView(e)||Mt.isArrayBuffer(e))return e.byteLength;if(Mt.isURLSearchParams(e)&&(e=e+""),Mt.isString(e))return(await Hct(e)).byteLength},Wct=async(e,t)=>Mt.toFiniteNumber(e.getContentLength())??Gct(t),Qct=Ux&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:c,withCredentials:f="same-origin",fetchOptions:p}=Vie(e);u=u?(u+"").toLowerCase():"text";let h=Bct([i,o&&o.toAbortSignal()],s),A;const g=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(l&&Vct&&r!=="get"&&r!=="head"&&(m=await Wct(c,n))!==0){let C=new Request(t,{method:"POST",body:n,duplex:"half"}),x;if(Mt.isFormData(n)&&(x=C.headers.get("content-type"))&&c.setContentType(x),C.body){const[_,w]=jie(m,$x($ie(l)));n=Gie(C.body,zie,_,w)}}Mt.isString(f)||(f=f?"include":"omit");const y="credentials"in Request.prototype;A=new Request(t,{...p,signal:h,method:r.toUpperCase(),headers:c.normalize().toJSON(),body:n,duplex:"half",credentials:y?f:void 0});let O=await fetch(A);const v=f8&&(u==="stream"||u==="response");if(f8&&(a||v&&g)){const C={};["status","statusText","headers"].forEach(D=>{C[D]=O[D]});const x=Mt.toFiniteNumber(O.headers.get("content-length")),[_,w]=a&&jie(x,$x($ie(a),!0))||[];O=new Response(Gie(O.body,zie,_,()=>{w&&w(),g&&g()}),C)}u=u||"text";let T=await Hx[Mt.findKey(Hx,u)||"text"](O,e);return!v&&g&&g(),await new Promise((C,x)=>{Bie(C,x,{data:T,headers:ba.from(O.headers),status:O.status,statusText:O.statusText,config:e,request:A})})}catch(y){throw g&&g(),y&&y.name==="TypeError"&&/Load failed|fetch/i.test(y.message)?Object.assign(new En("Network Error",En.ERR_NETWORK,e,A),{cause:y.cause||y}):En.from(y,y&&y.code,e,A)}}),p8={http:act,xhr:Fct,fetch:Qct};Mt.forEach(p8,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xie=e=>`- ${e}`,zct=e=>Mt.isFunction(e)||e===null||e===!1,qie={getAdapter:e=>{e=Mt.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o<t;o++){r=e[o];let s;if(n=r,!zct(r)&&(n=p8[(s=String(r)).toLowerCase()],n===void 0))throw new En(`Unknown adapter '${s}'`);if(n)break;i[s||"#"+o]=n}if(!n){const o=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since :
679
679
  `+o.map(Xie).join(`
680
680
  `):" "+Xie(o[0]):"as no adapter specified";throw new En("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:p8};function h8(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new t0(null,e)}function Yie(e){return h8(e),e.headers=ba.from(e.headers),e.data=d8.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),qie.getAdapter(e.adapter||FE.adapter)(e).then(function(t){return h8(e),t.data=d8.call(e,e.transformResponse,t),t.headers=ba.from(t.headers),t},function(t){return Fie(t)||(h8(e),t&&t.response&&(t.response.data=d8.call(e,e.transformResponse,t.response),t.response.headers=ba.from(t.response.headers))),Promise.reject(t)})}const Kie="1.9.0",Vx={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vx[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Zie={};Vx.transitional=function(e,t,r){function n(i,o){return"[Axios v"+Kie+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,s)=>{if(e===!1)throw new En(n(o," has been removed"+(t?" in "+t:"")),En.ERR_DEPRECATED);return t&&!Zie[o]&&(Zie[o]=!0),e?e(i,o,s):!0}},Vx.spelling=function(e){return(t,r)=>!0};function Xct(e,t,r){if(typeof e!="object")throw new En("options must be an object",En.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],s=t[o];if(s){const a=e[o],l=a===void 0||s(a,o,e);if(l!==!0)throw new En("option "+o+" must be "+l,En.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new En("Unknown option "+o,En.ERR_BAD_OPTION)}}const Gx={assertOptions:Xct,validators:Vx},lc=Gx.validators;let Bp=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Nie,response:new Nie}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const i=n.stack?n.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
681
- `+i):r.stack=i}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Fp(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;r!==void 0&&Gx.assertOptions(r,{silentJSONParsing:lc.transitional(lc.boolean),forcedJSONParsing:lc.transitional(lc.boolean),clarifyTimeoutError:lc.transitional(lc.boolean)},!1),n!=null&&(Mt.isFunction(n)?t.paramsSerializer={serialize:n}:Gx.assertOptions(n,{encode:lc.function,serialize:lc.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Gx.assertOptions(t,{baseUrl:lc.spelling("baseURL"),withXsrfToken:lc.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&Mt.merge(i.common,i[t.method]);i&&Mt.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),t.headers=ba.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(t)===!1||(a=a&&h.synchronous,s.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let u,c=0,f;if(!a){const h=[Yie.bind(this),void 0];for(h.unshift.apply(h,s),h.push.apply(h,l),f=h.length,u=Promise.resolve(t);c<f;)u=u.then(h[c++],h[c++]);return u}f=s.length;let p=t;for(c=0;c<f;){const h=s[c++],A=s[c++];try{p=h(p)}catch(g){A.call(this,g);break}}try{u=Yie.call(this,p)}catch(h){return Promise.reject(h)}for(c=0,f=l.length;c<f;)u=u.then(l[c++],l[c++]);return u}getUri(e){e=Fp(this.defaults,e);const t=Uie(e.baseURL,e.url,e.allowAbsoluteUrls);return Pie(t,e.params,e.paramsSerializer)}};Mt.forEach(["delete","get","head","options"],function(e){Bp.prototype[e]=function(t,r){return this.request(Fp(r||{},{method:e,url:t,data:(r||{}).data}))}}),Mt.forEach(["post","put","patch"],function(e){function t(r){return function(n,i,o){return this.request(Fp(o||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Bp.prototype[e]=t(),Bp.prototype[e+"Form"]=t(!0)});let qct=class Soe{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{n.subscribe(a),o=a}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},t(function(i,o,s){n.reason||(n.reason=new t0(i,o,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Soe(function(r){t=r}),cancel:t}}};function Yct(e){return function(t){return e.apply(null,t)}}function Kct(e){return Mt.isObject(e)&&e.isAxiosError===!0}const A8={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(A8).forEach(([e,t])=>{A8[t]=e});function Jie(e){const t=new Bp(e),r=gie(Bp.prototype.request,t);return Mt.extend(r,Bp.prototype,t,{allOwnKeys:!0}),Mt.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return Jie(Fp(e,n))},r}const So=Jie(FE);So.Axios=Bp,So.CanceledError=t0,So.CancelToken=qct,So.isCancel=Fie,So.VERSION=Kie,So.toFormData=Bx,So.AxiosError=En,So.Cancel=So.CanceledError,So.all=function(e){return Promise.all(e)},So.spread=Yct,So.isAxiosError=Kct,So.mergeConfig=Fp,So.AxiosHeaders=ba,So.formToJSON=e=>kie(Mt.isHTMLForm(e)?new FormData(e):e),So.getAdapter=qie.getAdapter,So.HttpStatusCode=A8,So.default=So;const{Axios:Tpt,AxiosError:Spt,CanceledError:xpt,isCancel:bpt,CancelToken:Cpt,VERSION:_pt,all:wpt,Cancel:Ipt,isAxiosError:Dpt,spread:Rpt,toFormData:Ppt,AxiosHeaders:Npt,HttpStatusCode:Lpt,formToJSON:kpt,getAdapter:Mpt,mergeConfig:Fpt}=So,Zct="https://api.intelligence.fynd.com",Jct="https://api.intelligence.sit.fyndx1.de",edt="application/json",tdt=6e4,rdt="https://cdn.prod.website-files.com/67a9c8e5f2c74ac8c2c9b88b/67ebbd36b30e83228583be90_404.avif",ndt="/service/integration/analytics",idt=`${ndt}/guest-token`;async function odt({authToken:e,productLine:t,env:r="prod",companyId:n,orgId:i,applicationId:o,customerId:s,partnerId:a,storeId:l,dashboardId:u,productId:c,promotionId:f,discountId:p,collectionId:h,customerGroupId:A,couponId:g,accountId:m,copilotId:y,copilotAppId:O,productAccountId:v,serverlessId:T,workflowId:C,dashboardUser:x,granularity:_,isRefreshToken:w}){var D,I,P,k,N,L,F,B,Q;try{const V={"Content-Type":edt,"x-product-line":t,Authorization:`Basic ${e}`},q={dashboardId:u};n&&(V["x-company-id"]=n),i&&(V["x-org-id"]=i),x!=null&&x.id&&(V["x-user-id"]=x?.id),o&&(V["x-application-id"]=o),s&&(V["x-customer-id"]=s),a&&(V["x-partner-id"]=a),l&&(V["x-store-id"]=l),f&&(V["x-promotion-id"]=f),p&&(V["x-discount-id"]=p),h&&(V["x-collection-id"]=h),A&&(V["x-customer-group-id"]=A),g&&(V["x-coupon-id"]=g),c&&(V["x-product-id"]=c),m&&(V["x-account-id"]=m),y&&(V["x-copilot-id"]=y),O&&(V["x-copilot-app-id"]=O),v&&(V["x-product-account-id"]=v),T&&(V["x-serverless-id"]=T),C&&(V["x-workflow-id"]=C),_&&(q.granularity=_),w&&(q.isRefreshToken=w);const M=(r==="prod"?Zct:Jct)+idt,G=await So.get(M,{headers:V,withCredentials:!0,params:q}),U=(P=(I=(D=G?.data)==null?void 0:D.data)==null?void 0:I.result)==null?void 0:P.token,R=(L=(N=(k=G?.data)==null?void 0:k.data)==null?void 0:N.result)==null?void 0:L.url,j=(Q=(B=(F=G?.data)==null?void 0:F.data)==null?void 0:B.result)==null?void 0:Q.dashboard_id;if(!U||!R||!j)throw new Error("Missing required data in token response");return{token:U,url:R,dashboardId:j}}catch(V){throw V}}async function sdt(e,t=3){let r=null;for(let n=1;n<=t;n++)try{return await e()}catch(i){if(r=i,n===t)throw r;await new Promise(o=>setTimeout(o,1e3*n))}throw r}async function eoe({authToken:e,productLine:t,env:r="prod",companyId:n,orgId:i,applicationId:o,customerId:s,partnerId:a,storeId:l,dashboardId:u,productId:c,promotionId:f,discountId:p,collectionId:h,customerGroupId:A,couponId:g,accountId:m,copilotId:y,copilotAppId:O,productAccountId:v,serverlessId:T,workflowId:C,dashboardUser:x,granularity:_,isRefreshToken:w,maxAttempts:D=3}){return sdt(()=>odt({authToken:e,productLine:t,env:r,companyId:n,orgId:i,applicationId:o,customerId:s,partnerId:a,storeId:l,dashboardId:u,productId:c,promotionId:f,discountId:p,collectionId:h,customerGroupId:A,couponId:g,accountId:m,copilotId:y,copilotAppId:O,productAccountId:v,serverlessId:T,workflowId:C,dashboardUser:x,granularity:_,isRefreshToken:w}),D)}function toe(...e){return e.flat().filter(t=>typeof t=="string").join(" ").trim()}const adt=({image:e,title:t,description:r})=>dd.jsxs("div",{className:"fynd-intelligence-error",children:[dd.jsx("img",{className:"fynd-intelligence-error__image",src:e,alt:"Error"}),dd.jsx("h1",{className:"fynd-intelligence-error__title",children:t}),dd.jsx("div",{className:"fynd-intelligence-error__description",children:r})]}),jE={isError:!1,title:"",description:""},ldt={hideTitle:!0,filters:{expanded:!0}};function udt({config:e}){const t=b.useRef(null),[r,n]=b.useState(!0),[i,o]=b.useState(jE),s=()=>{e!=null&&e.onSuccessCallback&&e.onSuccessCallback(),n(!1),a(jE)},a=l=>{const u={title:l.title??"Something went wrong",description:l.description??"Don't worry, we're working on it. Please try again later."};e!=null&&e.onErrorCallback&&e.onErrorCallback(u),o({isError:l.isError??jE.isError,...u})};return b.useEffect(()=>{if(r){const l=setTimeout(()=>{a({isError:!0,title:"Something went wrong",description:"Don't worry we are working on it. Please try again later."}),n(!1)},tdt);return()=>clearTimeout(l)}},[r]),b.useEffect(()=>{var l;n(!0),o(jE);const u={authToken:e.authToken,productLine:e.productLine,env:e?.env,companyId:e?.companyId,orgId:e?.orgId,applicationId:e?.applicationId,customerId:e?.customerId,partnerId:e?.partnerId,storeId:e?.storeId,dashboardId:e?.dashboardId,productId:e?.productId,promotionId:e?.promotionId,discountId:e?.discountId,collectionId:e?.collectionId,customerGroupId:e?.customerGroupId,couponId:e?.couponId,accountId:e?.accountId,copilotId:e?.copilotId,copilotAppId:e?.copilotAppId,productAccountId:e?.productAccountId,serverlessId:e?.serverlessId,workflowId:e?.workflowId,dashboardUser:e?.dashboardUser,granularity:e?.granularity,maxAttempts:3},c=((l=e.dashboardUiConfig)==null?void 0:l.urlParams)||{},f=["authToken","dashboardId","maxAttempts","env"];for(const p in u)if(Object.prototype.hasOwnProperty.call(u,p)){const h=p;let A=u[h];if(f.includes(h)||Object.prototype.hasOwnProperty.call(c,h))continue;if(h==="dashboardUser")if(typeof A=="object"&&A!==null){const g=A,m=g.id||g.userId;if(m)A={userId:m};else continue}else continue;if(A!=null){let g=A;typeof A=="object"&&(g=JSON.stringify(A)),c[h]=g}}eoe(u).then(p=>{const{url:h,dashboardId:A}=p;vut.embedDashboard({id:A,supersetDomain:h,mountPoint:t.current,fetchGuestToken:async()=>(await eoe({...u,isRefreshToken:!0})).token,dashboardUiConfig:{...ldt,...e?.dashboardUiConfig&&e.dashboardUiConfig,...c&&{urlParams:c}}}).then(()=>{s()}).catch(g=>{a(jE)})}).catch(p=>{var h,A;a({isError:!0,title:"Something went wrong",description:((A=(h=p?.response)==null?void 0:h.data)==null?void 0:A.message)||p?.description}),n(!1)})},[e]),i.isError?dd.jsx("div",{className:toe("fynd-intelligence__dashboard"),children:dd.jsx(adt,{image:rdt,title:i.title,description:i.description})}):dd.jsx(dd.Fragment,{children:dd.jsx("div",{ref:t,className:toe("fynd-intelligence__dashboard",r&&"fynd-intelligence__dashboard--loading")})})}const roe=()=>{try{return ume()}catch{return null}},m8=()=>{const[e,t]=b.useState(()=>roe());return b.useEffect(()=>{if(typeof window>"u")return;const r=()=>{t(roe())};return window.addEventListener("popstate",r),window.addEventListener("hashchange",r),()=>{window.removeEventListener("popstate",r),window.removeEventListener("hashchange",r)}},[]),e},cdt=(e,t={})=>({FYND_CLOUD_DOMAIN:e,ANALYTICS_AUTH_TOKEN:t.ANALYTICS_AUTH_TOKEN??"",ANALYTICS_PRODUCT_LINE:t.ANALYTICS_PRODUCT_LINE??"BOLTIC",JETBRIDGE_DASHBOARD_ACCOUNT_ID:t.JETBRIDGE_DASHBOARD_ACCOUNT_ID??"",JETBRIDGE_DASHBOARD_USER_ID:t.JETBRIDGE_DASHBOARD_USER_ID??""}),ddt=({dashboardId:e,workflowId:t,startDate:r,endDate:n})=>{const i=E.useTheme(),{ENTITY_ID:o,userData:s,WORKFLOW_URLS:a}=_i(),{FYND_CLOUD_DOMAIN:l}=a,u=m8(),c=t??u??"",[f,p]=b.useState(!1),h=b.useMemo(()=>{const g=l||"",m={ANALYTICS_AUTH_TOKEN:a?.ANALYTICS_AUTH_TOKEN,JETBRIDGE_DASHBOARD_ACCOUNT_ID:a?.JETBRIDGE_DASHBOARD_ACCOUNT_ID,JETBRIDGE_DASHBOARD_USER_ID:a?.JETBRIDGE_DASHBOARD_USER_ID},y=cdt(g,m),O=o||"";let v="",T="";switch(y.FYND_CLOUD_DOMAIN){case"boltic.io":v=O||"",T=s?.hostId||s?._id||"";break;case"uat.fcz0.de":case"fcz0.de":v=y.JETBRIDGE_DASHBOARD_ACCOUNT_ID,T=y.JETBRIDGE_DASHBOARD_USER_ID;break;default:v=O||"",T=s?.hostId||s?._id||"";break}return{accountId:v,authToken:y.ANALYTICS_AUTH_TOKEN,productLine:y.ANALYTICS_PRODUCT_LINE,dashboardUser:{id:T},dashboardId:e,workflowId:c,dashboardUiConfig:{filters:{visible:!1,enabled:!1},urlParams:{startDate:r,endDate:n},hideFilterBar:!0,showSidebar:!1,showHeader:!1}}},[e,o,r,n,s?.hostId,c]),A=(g,m)=>{p(m)};return d.jsxs(E.Accordion,{expanded:f,sx:{border:`1px solid ${i.palette.grey.outlined.border}`,"&.MuiPaper-root":{borderRadius:3}},"data-testid":"executions-insights-accordion",onChange:A,children:[d.jsx(E.AccordionSummary,{expandIcon:d.jsx(jp.GridExpandMoreIcon,{}),"aria-controls":"executions-insights-content",id:"executions-insights-header",sx:{"& .MuiAccordionSummary-content":{m:0,py:1,height:48}},children:d.jsx(E.Stack,{direction:"row",children:d.jsxs(E.Stack,{direction:"row",gap:1,children:[d.jsx(Me,{src:"ic_analytics",width:20,height:20,sx:{path:{fill:i.palette.neutral.solid.bg}}}),d.jsx(E.Typography,{variant:"mdSemiBold",children:"Executions Insights"})]})})}),d.jsx(E.AccordionDetails,{children:d.jsx(E.Stack,{spacing:3,height:"20rem",px:2.5,py:1.5,sx:{"& iframe":{border:"none",borderRadius:1}},children:d.jsx(E.Stack,{flex:1,bgcolor:"neutral.0",borderRadius:2,sx:{"& iframe":{border:"none",borderRadius:1}},children:d.jsx(udt,{config:h})})})})]})},noe=(e,t)=>e==="Successful"||e==="Completed"?d.jsx(Me,{src:"ic_success",width:"16px",height:"16px",fill:t.palette.success[40]}):e==="Running"||e==="In progress"?d.jsx(Me,{src:"ic_default",width:"16px",height:"16px",fill:t.palette.warning[40]}):e==="Failed"||e==="Terminated"||e==="Canceled"||e==="Timed out"?d.jsx(Me,{src:"ic_close_filled",width:"16px",height:"16px",fill:t.palette.error[50]}):d.jsx(Me,{src:"ic_pending",width:"16px",height:"16px",fill:t.palette.neutral.solid.bg}),$E=({status:e,size:t="small"})=>{const r=E.useTheme(),n=e==="Completed"?"Successful":e;return d.jsx(E.Chip,{icon:noe(n,r),size:t,sx:{backgroundColor:k6(n,r),color:r.palette.text.primary,boxShadow:"none",borderRadius:"1.5rem",padding:"1px 4px",height:"fit-content",fontSize:"12px",fontWeight:500,"& span":{p:0,letterSpacing:"0.5px",ml:1},border:"1px solid",borderColor:M6(n,r)},label:n})},fdt=e=>{const{theme:t,workflowId:r,selectedExecutionIds:n,setSelectedExecutionIds:i,isRetrying:o,isRetryableStatus:s,getRowWorkflowId:a,hasRetriesAvailable:l,expandedRowIds:u,toggleExpandRow:c,retrySingle:f,cooldownIds:p=new Set,currentSubscription:h,openUpgradeModal:A,onViewPayload:g}=e,m=O=>{Ed(O)};return[{field:"select",headerName:"",width:40,sortable:!1,renderHeader:({rows:O})=>{const v=(O||[]).filter(w=>{if(w?._isChild)return!1;const D=w.status===Gb.COMPLETED?Gb.SUCCESSFUL:w.status,I=s(D),P=o||p.has(w.id);return I&&!P}).map(w=>w.id),T=v.length,C=v.filter(w=>n.includes(w)).length,x=T>0&&C===T,_=C>0&&C<T;return d.jsx(E.Checkbox,{size:"small",checked:x,indeterminate:_,disabled:o||T===0,onClick:w=>w.stopPropagation(),onChange:()=>{i(w=>{if(T===0)return w;if(v.every(P=>w.includes(P)))return w.filter(P=>!v.includes(P));const I=new Set([...w,...v]);return Array.from(I)})}})},renderCell:O=>{const v=O.row.status==="Completed"?"Successful":O.row.status,T=!O.row._isChild&&s(v),C=n.includes(O.row.id),x=o||p.has(O.row.id),_=h?.[0]?.status==="EXPIRED"||h?.[0]?.status==="CANCELLED";return O.row._isChild?null:d.jsx(E.Checkbox,{size:"small",checked:C,disabled:!T||x,onClick:D=>{if(D.stopPropagation(),_&&!(!T||x)){typeof A=="function"&&A();return}},onChange:()=>i(D=>D.includes(O.row.id)?D.filter(I=>I!==O.row.id):[...D,O.row.id])})}},{field:"status",headerName:"Status",flex:1,sortable:!1,renderCell:O=>{const v=O.value==="Completed"?"Successful":O.value,T=O.row,C=!T._isChild&&l(T),x=!!u[T.id],_=!!T?.meta?.failed_before_start;return d.jsx(E.Tooltip,{arrow:!0,placement:"right",title:_?"Execution logs are unavailable — this workflow failed before it could start. Use the retry button to try again.":"",children:d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[d.jsx(E.Box,{sx:{...bi,width:"20px"},children:C&&d.jsx(E.IconButton,{size:"small",onClick:w=>{C&&(w.stopPropagation(),c(T))},sx:{transform:x?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.2s"},children:d.jsx(Me,{src:"ic_arrow_up",width:18,height:18,sx:{path:{fill:t.palette.neutral.solid.bg}}})})}),d.jsx($E,{status:v})]})})}},{field:"created_at",headerName:"Executed on",sortable:!1,flex:1,renderCell:O=>d.jsx(E.Typography,{sx:{...du,display:"flex",alignItems:"center",padding:0},variant:"smNormal",children:NE(O?.value,"full")})},{field:"id",headerName:"Execution ID/Retry ID",flex:1,sortable:!1,renderCell:O=>d.jsxs(E.Box,{sx:{position:"relative",display:"flex",alignItems:"center",gap:1,"&:hover .copy-icon":{visibility:"visible"}},children:[d.jsxs(E.Typography,{sx:{cursor:"pointer",...du},onClick:()=>{const v=O?.row?._isChild?O?.row?.execution_mode==="scheduled"?O?.row?.id:O?.row?.run_id:O.value||"-";m(v||"-")},variant:"smNormal",width:330,children:[O?.row?._isChild?O?.row?.execution_mode==="scheduled"?O?.row?.id:O?.row?.run_id:O.value?O.value:"-",d.jsx(E.Tooltip,{title:"Copy execution id",children:d.jsx(E.IconButton,{className:"copy-icon",sx:{marginBottom:"2px",visibility:"hidden"},onClick:v=>{v.stopPropagation();const T=O?.row?._isChild?O?.row?.execution_mode==="scheduled"?O?.row?.id:O?.row?.run_id:O.value||"-";m(T||"-")},size:"small",children:d.jsx(Me,{src:"ic_copy",width:18,height:18,sx:{path:{fill:t.palette.neutral.solid.bg}}})})})]}),O?.row?._isChild&&O?.row?.meta?.retry_attempt&&d.jsx(E.Chip,{label:`Attempt ${O?.row?.meta?.retry_attempt||""}`,size:"small",sx:{borderRadius:"4px",border:`1px solid ${t.palette.neutral.outlined.border}`,backgroundColor:"transparent"}}),O?.row&&(O?.row?.meta?.system_retried||O?.row?.meta?.user_retried)&&d.jsx(E.Chip,{label:"Latest",size:"small",sx:{borderRadius:"4px",border:`1px solid ${t.palette.neutral.outlined.border}`,backgroundColor:"transparent"}})]})},{field:"execution_mode",headerName:"Trigger",flex:1,sortable:!1,renderCell:O=>d.jsx(E.Typography,{sx:{...du},variant:"smNormal",children:O.value?Ns(O.value==="test"?"manual":O.value):"-"})},{field:"time_taken",headerName:"Time taken",sortable:!1,flex:1,renderCell:O=>d.jsx(E.Box,{width:"100%",children:d.jsx(E.Typography,{sx:{...du},variant:"smNormal",children:O.value?qp(O.value):"-"})})},{field:"actions",headerName:"",width:80,sortable:!1,renderCell:O=>{const v=O.row.status==="Completed"?"Successful":O.row.status;if(!(a(O.row)||r))return null;const C=!!O.row?.meta?.failed_before_start&&!!O.row?.meta?.request_body,x=O.row._isChild,_=C&&d.jsx(E.Tooltip,{arrow:!0,placement:"left",title:"View trigger payload",children:d.jsx(E.IconButton,{size:"small",onClick:D=>{D.stopPropagation(),g(O.row)},children:d.jsx(Me,{src:"ic_visibility",width:18,height:18,sx:{path:{fill:t.palette.neutral.solid.bg}}})})});if(x)return C?d.jsx(E.Stack,{direction:"row",alignItems:"center",gap:.5,children:_}):null;if(!s(v))return null;const w=o||p.has(O.row.id);return d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:.5,children:[_,d.jsx(E.Tooltip,{arrow:!0,placement:"left",title:"Retry",children:d.jsx("span",{children:d.jsx(E.IconButton,{size:"small",disabled:w,sx:{opacity:w?.45:1},onClick:D=>{D.stopPropagation(),f(O.row.id,O.row)},children:d.jsx(Me,{src:"ic_try_again",width:18,height:18,sx:{path:{fill:t.palette.neutral.solid.bg}}})})})})]})}}]},pdt=e=>b.useMemo(()=>fdt(e),[e.theme,e.workflowId,e.selectedExecutionIds,e.setSelectedExecutionIds,e.isRetrying,e.getRowWorkflowId,e.hasRetriesAvailable,e.expandedRowIds,e.toggleExpandRow,e.retrySingle,e.cooldownIds,e.onViewPayload]),ioe=e=>{const t=At.useDispatch(),{WORKFLOW_URLS:r,ENTITY_ID:n,analytics:i}=_i(),{height:o,workflowId:s,state:a,fetchCounts:l,loadingStats:u}=e,{VORTEX_MAIN_URL:c}=r,f=()=>{e.onRefresh?e.onRefresh():(t(Yp(s,{...a,execution_source:"full"},c,n,i)),l&&l())};return d.jsxs(E.Stack,{width:"100%",height:o||"100%",alignItems:"center",justifyContent:"center",sx:{flex:1,paddingTop:"calc(50vh - 200px)",paddingBottom:"calc(50vh - 200px)"},children:[d.jsx(Me,{src:"ic_no_data",width:120,height:120}),d.jsx(E.Typography,{textAlign:"center",variant:"mdSemiBold",mt:3,children:"No execution data available"}),d.jsx(E.Typography,{variant:"smNormal",mt:1,maxWidth:480,textAlign:"center",children:"This may be because the workflow hasn't been executed yet. Run the workflow at least once to view its execution history."}),d.jsx(E.Button,{variant:"contained",sx:{mt:2},disabled:u||!1,onClick:f,children:u?d.jsx(E.CircularProgress,{size:20,sx:{color:"inherit"}}):"Refresh"})]})},ooe=({workflowId:e,VORTEX_MAIN_URL:t,ENTITY_ID:r})=>{const[n,i]=b.useState([]),[o,s]=b.useState(!1),a=b.useCallback(()=>{i([])},[]),l=b.useCallback(async(u,c)=>{const f=c||e;if(!f||!t||!r)return{ids:u,success:!1,error:{message:"Missing required parameters"}};const p=Yt(t,`/v1.0/${r}/`,`workflows/${f}/executions/retry`);try{return await qt.post(p,{data:Tat(u)}),{ids:u,success:!0}}catch(h){const A=h?.response?.data?.error||h?.response?.data||h?.message||"Unknown error";return{ids:u,success:!1,error:{...A,...h}}}},[e,t,r]);return{selectedExecutionIds:n,setSelectedExecutionIds:i,clearSelection:a,isRetrying:o,setIsRetrying:s,retryExecutions:l}},soe=({title:e,subtitle:t="",children:r=d.jsx(d.Fragment,{}),sx:n=null,icon:i=null})=>d.jsxs(E.Stack,{sx:{align:"center",justifyContent:"center",gap:2,margin:2,width:"600px",...n},children:[d.jsxs(E.Stack,{sx:{alignItems:"center",justifyContent:"center",gap:2},children:[i||d.jsx(Me,{src:"ic_no_data",width:75,height:75}),d.jsxs(E.Stack,{textAlign:"center",gap:4,children:[d.jsx(E.Typography,{variant:"lgSemiBold",color:"gray.100","data-id":"empty-title",children:e}),t&&d.jsx(E.Typography,{variant:"mdNormal",color:"gray.80","data-id":"empty-subtitle",children:t})]})]}),r]});var g8,aoe;function hdt(){if(aoe)return g8;aoe=1;var e="[object Symbol]",t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",o="\\u20d0-\\u20f0",s="\\u2700-\\u27bf",a="a-z\\xdf-\\xf6\\xf8-\\xff",l="\\xac\\xb1\\xd7\\xf7",u="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",c="\\u2000-\\u206f",f=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",p="A-Z\\xc0-\\xd6\\xd8-\\xde",h="\\ufe0e\\ufe0f",A=l+u+c+f,g="['’]",m="["+A+"]",y="["+i+o+"]",O="\\d+",v="["+s+"]",T="["+a+"]",C="[^"+n+A+O+s+a+p+"]",x="\\ud83c[\\udffb-\\udfff]",_="(?:"+y+"|"+x+")",w="[^"+n+"]",D="(?:\\ud83c[\\udde6-\\uddff]){2}",I="[\\ud800-\\udbff][\\udc00-\\udfff]",P="["+p+"]",k="\\u200d",N="(?:"+T+"|"+C+")",L="(?:"+P+"|"+C+")",F="(?:"+g+"(?:d|ll|m|re|s|t|ve))?",B="(?:"+g+"(?:D|LL|M|RE|S|T|VE))?",Q=_+"?",V="["+h+"]?",q="(?:"+k+"(?:"+[w,D,I].join("|")+")"+V+Q+")*",M=V+Q+q,G="(?:"+[v,D,I].join("|")+")"+M,U=RegExp(g,"g"),R=RegExp(y,"g"),j=RegExp([P+"?"+T+"+"+F+"(?="+[m,P,"$"].join("|")+")",L+"+"+B+"(?="+[m,P+N,"$"].join("|")+")",P+"?"+N+"+"+F,P+"+"+B,O,G].join("|"),"g"),$=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Y={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},X=typeof Ur=="object"&&Ur&&Ur.Object===Object&&Ur,H=typeof self=="object"&&self&&self.Object===Object&&self,W=X||H||Function("return this")();function z(ye,Fe,ze,je){for(var rt=-1,it=ye?ye.length:0;++rt<it;)ze=Fe(ze,ye[rt],rt,ye);return ze}function K(ye){return ye.match(t)||[]}function Z(ye){return function(Fe){return ye?.[Fe]}}var se=Z(Y);function ne(ye){return $.test(ye)}function le(ye){return ye.match(j)||[]}var Oe=Object.prototype,ve=Oe.toString,ae=W.Symbol,ie=ae?ae.prototype:void 0,te=ie?ie.toString:void 0;function J(ye){if(typeof ye=="string")return ye;if(pe(ye))return te?te.call(ye):"";var Fe=ye+"";return Fe=="0"&&1/ye==-1/0?"-0":Fe}function re(ye){return function(Fe){return z(Ee(fe(Fe).replace(U,"")),ye,"")}}function ue(ye){return!!ye&&typeof ye=="object"}function pe(ye){return typeof ye=="symbol"||ue(ye)&&ve.call(ye)==e}function Ae(ye){return ye==null?"":J(ye)}function fe(ye){return ye=Ae(ye),ye&&ye.replace(r,se).replace(R,"")}var xe=re(function(ye,Fe,ze){return ye+(ze?"_":"")+Fe.toLowerCase()});function Ee(ye,Fe,ze){return ye=Ae(ye),Fe=Fe,Fe===void 0?ne(ye)?le(ye):K(ye):ye.match(Fe)||[]}return g8=xe,g8}var Adt=hdt();const loe=Vn(Adt),mdt=e=>{const t=E.useTheme(),{title:r,count:n,logo:i,helperText:o,loading:s,failed:a}=e,l=()=>s?d.jsx(E.Skeleton,{variant:"rounded",sx:{mr:1},width:"80%",height:20}):a?"-":n;return d.jsxs(E.Stack,{direction:"row",p:2,borderRadius:2,border:`1px solid ${t.palette.grey.outlined.border}`,children:[d.jsxs(E.Stack,{alignItems:"space-between",width:"100%",children:[d.jsxs(E.Stack,{direction:"row",gap:"0.5",alignItems:"center",children:[d.jsx(E.Typography,{variant:"xsLight",children:r}),o&&d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:o,children:d.jsx(E.Box,{component:"span",ml:.5,children:d.jsx(Me,{src:"ic_info",width:t.icons.sm,height:t.icons.sm})})})]}),d.jsx(E.Box,{children:d.jsx(E.Typography,{variant:"smSemiBold",fontSize:24,children:l()})})]}),d.jsx(E.Box,{children:i})]})},gdt=({statistics:e,title:t="Analytics",failed:r=!1,loading:n=!1})=>{const i=E.useTheme(),[o,s]=b.useState(()=>{const l=localStorage.getItem(loe(`analytics_${t.toLowerCase()}_expanded`));return l===null||l==="true"}),a=(l,u)=>{s(u),localStorage.setItem(loe(`analytics_${t.toLowerCase()}_expanded`),u.toString())};return d.jsxs(E.Accordion,{expanded:o,sx:{border:`1px solid ${i.palette.grey.outlined.border}`,"&.MuiPaper-root":{borderRadius:3}},onChange:a,children:[d.jsx(E.AccordionSummary,{expandIcon:d.jsx(jp.GridExpandMoreIcon,{}),"aria-controls":"panel1-content",id:"panel1-header",sx:{"& .MuiAccordionSummary-content":{m:0,py:1,height:48}},children:d.jsx(E.Stack,{direction:"row",children:d.jsxs(E.Stack,{direction:"row",my:.5,gap:1,children:[d.jsx(Me,{src:"ic_analytics",width:20,height:20,sx:{path:{fill:i.palette.neutral.solid.bg}}}),d.jsx(E.Typography,{variant:"mdSemiBold",children:t})]})})}),d.jsx(E.AccordionDetails,{sx:{px:2,pb:2},children:d.jsx(E.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:2},children:e.map((l,u)=>d.jsx(E.Box,{children:d.jsx(mdt,{loading:n,failed:r,title:l.title,count:l.count_key??"-",helperText:l.helperText,logo:l.logo})},`analytics-status-${l.name||u}`))})})]})},Edt=e=>{const t=E.useTheme(),{isLoopChild:r,selectedActivity:n,getConnectingLineHeight:i,setSelectedActivity:o,setJsonViewType:s,setDataPresentType:a,ele:l,index:u,icon:c,isLoading:f=!1,totalBlocks:p}=e;return d.jsxs(E.Grid,{sx:{width:230,px:1.5,py:1,ml:r?6:0,border:h=>`1px solid ${n===l.eventId&&!f?h.palette.primary.main:h.palette.grey.outlined.border}`,borderRadius:2,cursor:"pointer",backgroundColor:h=>n===l.eventId&&!f?h.palette.primary[5]:h.palette.common.white,zIndex:p-u+1,position:"relative","&::after":{content:'""',position:"absolute",bottom:r?"calc(100% - 30px)":"100%",left:r?"-20px":"10px",width:"2px",height:i?.(u,l)||40,borderLeft:"1.5px dashed",pointerEvents:"none",borderColor:h=>h.palette.grey.outlined.border,zIndex:0},"&::before":r?{content:'""',position:"absolute",bottom:0,width:"16px",height:8,top:25.5,left:-20,borderBottom:"1.5px dashed",borderLeft:"1.5px dashed",pointerEvents:"none",borderRadius:"50% 0 0 26px",borderColor:h=>h.palette.grey.outlined.border,zIndex:0}:{}},onClick:()=>{f||(o?.(l.eventId),s?.("GUI"),k3(l)?a?.("Data in"):a?.("Data out"))},item:!0,children:[d.jsx(E.Box,{sx:{position:"absolute",top:r?24:-13.5,left:r?-13.5:.75,transform:r?"rotate(-180deg)":"rotate(-90deg)",display:u===0?"none":"block",zIndex:2,pointerEvents:"none"},children:d.jsx(Me,{src:"ic_arrow_left",height:"1.25rem",width:"1.25rem",sx:{path:{fill:t.palette.grey.outlined.border}}})}),d.jsxs(E.Stack,{gap:.75,justifyContent:"center",children:[d.jsxs(E.Stack,{direction:"row",sx:{...si},children:[f&&d.jsx(E.Skeleton,{variant:"rounded",sx:{mr:1},width:"100%",height:20}),!f&&d.jsxs(E.Stack,{direction:"row",maxWidth:"calc(100% - 20px)",gap:.75,alignItems:"center",children:[l.activityIcon&&d.jsx(E.Avatar,{variant:"rounded",src:Jp(l.activityIcon,"t.resize(h:15,w:15)"),alt:l.eventName,sx:{width:20,height:20,display:"flex"},children:L3(l.eventName||"")}),d.jsx(E.Tooltip,{placement:"top-start",arrow:!0,title:l.eventName,slotProps:{popper:{modifiers:[{name:"offset",options:{offset:[0,-6]}}]}},children:d.jsx(E.Typography,{variant:"smSemiBold",sx:{...du},children:l.eventName})}),!!l?.pro&&d.jsx(ef,{}),k3(l)&&d.jsx(Me,{src:"ic_spark",width:18,height:18,sx:{path:{fill:t.palette.primary.main}}}),!k3(l)&&l?.type!==Ke.LOOP&&d.jsx(E.Chip,{sx:{height:"fit-content",backgroundColor:h=>h.palette.white.smoke,border:`1px solid ${t.palette.grey.outlined.border}`},label:l.duration?.replace(/ /g,"")})]}),c]}),f?d.jsx(E.Skeleton,{variant:"rounded",sx:{mr:1},width:69,height:20}):l.isoEventTime&&d.jsx(E.Typography,{variant:"smNormal",sx:{color:t.palette.neutral.solid.bg},children:NE(l.isoEventTime,"full")})]})]},`block-item-${l.id||u}`)},Odt=e=>{const{logsToShow:t,loopChildActivities:r,selectedActivity:n,getConnectingLineHeight:i,setSelectedActivity:o,setJsonViewType:s,setDataPresentType:a,onLoadMore:l,hasMore:u,isLoadingMore:c}=e,f=E.useTheme();return d.jsx(E.Grid,{item:!0,px:3,py:4,sx:{borderRight:`1px solid ${f.palette.grey.outlined.border}`,height:"100%",overflow:"auto",width:"fit-content",flexShrink:0,minWidth:270},children:d.jsxs(E.Grid,{container:!0,direction:"column",gap:5,children:[t.map((p,h)=>{const{isSuccess:A}=N3(p.eventType),g=A?d.jsx(Me,{src:"ic_success",width:f.icons.md,height:f.icons.md,sx:{path:{fill:f.palette.success[40]}}}):d.jsx(Me,{src:"ic_warning_circle",width:16,height:16,sx:{path:{fill:f.palette.error.main}}});return d.jsx(Edt,{isLoopChild:r.includes(p.eventName),selectedActivity:n,getConnectingLineHeight:i,setSelectedActivity:o,setJsonViewType:s,setDataPresentType:a,ele:p,index:h,icon:g,totalBlocks:t.length},`block-item-${p.eventId||h}`)}),u&&d.jsx(E.Stack,{alignItems:"center",py:1,children:d.jsx(E.Button,{size:"small",variant:"outlined",onClick:l,disabled:c,startIcon:c?d.jsx(E.CircularProgress,{size:14}):void 0,sx:{textTransform:"none",borderRadius:"8px"},children:d.jsx(E.Typography,{variant:"xsSemiBold",children:c?"Loading...":"Load more"})})})]})})},ydt={"&.MuiChip-root":{borderRadius:1,height:"auto",backgroundColor:e=>e.palette.white.smoke,border:e=>`1px solid ${e.palette.grey.outlined.border}`},"& .MuiChip-label":{px:1}},uoe=b.memo(e=>{const{label:t}=e;return d.jsx(E.Chip,{sx:ydt,label:t})}),vdt=b.memo(()=>d.jsx(Me,{src:"ic_array"})),Tdt=b.memo(()=>d.jsx(Me,{src:"ic_object"})),Sdt=b.memo(()=>d.jsx(Me,{src:"ic_number"})),xdt=b.memo(()=>d.jsx(Me,{src:"ic_boolean"})),bdt=b.memo(()=>d.jsx(Me,{src:"ic_null"})),Cdt=b.memo(()=>d.jsx(Me,{src:"ic_string"})),_dt=e=>Array.isArray(e)?d.jsx(vdt,{}):typeof e=="object"&&e!==null?d.jsx(Tdt,{}):typeof e=="number"?d.jsx(Sdt,{}):typeof e=="boolean"?d.jsx(xdt,{}):e===null?d.jsx(bdt,{}):d.jsx(Cdt,{}),wdt={"& > *":{pt:2}},Idt={modifiers:[{name:"preventOverflow",options:{boundary:"body",padding:2}}]},Ddt={tooltip:{sx:{width:"fit-content",maxWidth:"50rem",height:"fit-content",whiteSpace:"normal",zIndex:999}}},UE=b.memo(({data:e,label:t,level:r=0,enableEllipsis:n=!0,showLabel:i=!0,highlightText:o=""})=>{const s=E.useTheme(),a=b.useRef(null),[l,u]=b.useState(0),[c,f]=b.useState(!1),[p,h]=b.useState(!1),A=b.useRef(null);b.useEffect(()=>{if(a.current&&r>0){const L=a.current.offsetHeight;u(L/2)}},[r]);const g=b.useCallback(()=>{h(!0),f(L=>!L),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{h(!1)},300)},[]);b.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]);const m=b.useCallback(L=>{switch(typeof L){case"object":return null;case"string":return L;default:return String(L)}},[]),y=b.useMemo(()=>e!==null&&(typeof e=="object"||Array.isArray(e)),[e]),O=b.useMemo(()=>_dt(e),[e]),v=b.useMemo(()=>Array.isArray(e)?"array":typeof e,[e]),T=b.useMemo(()=>{if(!y)return null;if(Array.isArray(e)){const F=e.length;return`(${F} ${F<=1?"item":"items"})`}const L=Object.keys(e).length;return`(${L} ${L<=1?"key":"keys"})`},[e,y]),C=b.useMemo(()=>({position:"absolute",left:-26,top:l,width:26,height:20,borderTop:`1px dashed ${s.palette.grey.outlined.border}`}),[l,s.palette.grey.outlined.border]),x=b.useMemo(()=>({zIndex:2,backgroundColor:s.palette.white.smoke,borderRadius:1}),[s.palette.white.smoke]),_=b.useMemo(()=>({color:s.palette.text.primary}),[s.palette.text.primary]),w=b.useMemo(()=>({color:s.palette.text.primary,maxWidth:400,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),[s.palette.text.primary]),D=b.useMemo(()=>({color:s.palette.text.primary,maxWidth:"99%",whiteSpace:"normal",overflowWrap:"anywhere",wordBreak:"break-word"}),[s.palette.text.primary]),I=b.useCallback(L=>{const F=(o||"").trim();if(!L||!F)return L??"";try{const B=new RegExp(`(${F.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"ig");return String(L).split(B).map((V,q)=>V.toLowerCase()===F.toLowerCase()?d.jsx(E.Box,{component:"mark",sx:{backgroundColor:"rgba(250, 223, 117, 0.6)",color:"inherit",p:"0 1px",borderRadius:.5},children:V},`hl-${q}`):d.jsx(b.Fragment,{children:V},`tx-${q}`))}catch{return L}},[o]),P=b.useMemo(()=>m(e),[e,m]),k=b.useMemo(()=>I(typeof P=="string"?P:String(P)),[P,I]),N=b.useMemo(()=>I(t),[t,I]);return d.jsxs(E.Box,{sx:{position:"relative"},children:[r>0&&d.jsx(E.Box,{sx:C}),d.jsxs(E.Stack,{direction:"row",sx:{alignItems:"center",gap:1},ref:a,children:[d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:v,children:d.jsx(E.Stack,{width:24,height:24,sx:x,alignItems:"center",justifyContent:"center",children:O})}),i&&d.jsx(E.Stack,{alignItems:"center",gap:1,children:y?d.jsxs(E.Stack,{gap:1,direction:"row",sx:{alignItems:"center"},children:[d.jsx(E.Box,{onClick:g,sx:{cursor:"pointer",display:"flex",alignItems:"center",transform:c?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.2s ease",mr:.25},children:p?d.jsx(E.CircularProgress,{size:16,thickness:6,sx:{color:s.palette.neutral.solid.bg}}):d.jsx(Me,{src:"ic_arrow_right",sx:{width:16,height:16,"& path":{fill:s.palette.neutral.solid.bg}}})}),d.jsx(E.Box,{onClick:g,sx:{cursor:"pointer"},children:d.jsx(uoe,{label:o?N:t})}),d.jsx(E.Typography,{variant:"smMedium",sx:_,children:T})]}):d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[d.jsx(uoe,{label:o?N:t}),!n&&d.jsx(E.Tooltip,{title:String(e),placement:"top",arrow:!0,id:"suggestions-tooltip",PopperProps:Idt,componentsProps:Ddt,children:d.jsx(E.Typography,{variant:"smMedium",sx:w,children:k})}),n&&d.jsx(E.Typography,{variant:"smMedium",sx:D,children:k})]})}),!i&&y&&d.jsx(E.Typography,{variant:"smMedium",sx:_,children:T})]}),y&&c&&d.jsx(E.Stack,{gap:0,pl:1.5,sx:wdt,children:Array.isArray(e)?e.map((L,F)=>{const B=F===e.length-1,Q={position:"relative",borderLeft:B?"none":`1px dashed ${s.palette.grey.outlined.border}`,paddingLeft:3.25},V={position:"absolute",height:28,width:2,top:0,left:0,borderLeft:`1px dashed ${s.palette.grey.outlined.border}`};return d.jsxs(E.Box,{sx:Q,children:[B&&d.jsx(E.Box,{sx:V}),d.jsx(UE,{data:L,label:`${F}`,level:r+1,enableEllipsis:n,highlightText:o})]},`${t}-${F}`)}):Object.entries(e).map(([L,F],B,Q)=>{const V=B===Q.length-1,q={position:"relative",borderLeft:V?"none":`1px dashed ${s.palette.grey.outlined.border}`,paddingLeft:3.25},M={position:"absolute",height:28,width:2,top:0,left:0,borderLeft:`1px dashed ${s.palette.grey.outlined.border}`};return d.jsxs(E.Box,{sx:q,children:[V&&d.jsx(E.Box,{sx:M}),d.jsx(UE,{data:F,label:L,level:r+1,enableEllipsis:n,highlightText:o})]},L)})})]})}),r0=b.memo(({data:e,topLabel:t="",sx:r={},enableEllipsis:n=!0,highlightText:i="",resetKey:o})=>{const s=E.useTheme(),[a,l]=b.useState(200),u=200,c=o??e,f=b.useMemo(()=>e!==null&&(typeof e=="object"||Array.isArray(e)),[e]);b.useEffect(()=>{l(u)},[u,c]);const p=b.useMemo(()=>({p:2,...r}),[r]),h=b.useMemo(()=>({"& > *":{pt:2,"&:first-of-type":{pt:0}}}),[]),A=b.useMemo(()=>({color:s.palette.text.primary}),[s.palette.text.primary]);return t?d.jsx(E.Box,{sx:p,children:d.jsx(UE,{data:e,label:t||"data",enableEllipsis:n,showLabel:!0,highlightText:i})}):f?d.jsx(E.Box,{sx:p,children:d.jsx(E.Stack,{gap:0,sx:h,children:Array.isArray(e)?d.jsxs(d.Fragment,{children:[e.slice(0,a).map((g,m)=>d.jsx(E.Box,{sx:{position:"relative"},children:d.jsx(UE,{data:g,label:`${m}`,level:0,enableEllipsis:n,highlightText:i})},`tree-item-${m}`)),e.length>a&&d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"center",sx:{py:1},children:[d.jsxs(E.Button,{size:"small",variant:"outlined",onClick:()=>l(g=>Math.min(g+u,e.length)),sx:{textTransform:"none"},children:["Load ",Math.min(u,e.length-a)," more"]}),d.jsxs(E.Typography,{variant:"xsNormal",color:"text.secondary",sx:{ml:1},children:["Showing ",a," of ",e.length]})]})]}):d.jsxs(d.Fragment,{children:[Object.entries(e).slice(0,a).map(([g,m])=>d.jsx(E.Box,{sx:{position:"relative"},children:d.jsx(UE,{data:m,label:g,level:0,enableEllipsis:n,highlightText:i})},g)),Object.keys(e).length>a&&d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"center",sx:{py:1},children:[d.jsx(E.Button,{size:"small",variant:"outlined",onClick:()=>l(g=>Math.min(g+u,Object.keys(e).length)),sx:{textTransform:"none"},children:"Load more"}),d.jsxs(E.Typography,{variant:"xsNormal",color:"text.secondary",sx:{ml:1},children:["Showing ",a," of ",Object.keys(e).length]})]})]})})}):d.jsx(E.Box,{sx:p,children:d.jsx(E.Box,{sx:A,children:typeof e=="object"?JSON.stringify(e):String(e)})})}),Rdt=Object.freeze(Object.defineProperty({__proto__:null,default:r0},Symbol.toStringTag,{value:"Module"})),Pdt=e=>{const t=E.useTheme(),{selectedLogData:r,dataPresentType:n,setDataPresentType:i,jsonViewType:o,setJsonViewType:s,getFormattedDateTime:a,searchQuery:l,setSearchQuery:u,dataIn:c,dataOut:f,executionLogs:p}=e,[h,A]=b.useState(!1),[g,m]=b.useState(!1),y=b.useRef(null);b.useLayoutEffect(()=>(A(!0),y.current&&clearTimeout(y.current),y.current=window.setTimeout(()=>A(!1),150),()=>{y.current&&(clearTimeout(y.current),y.current=null)}),[o]),b.useEffect(()=>{m(!1)},[r?.eventId]),b.useEffect(()=>{u("")},[g,o,u]);const O=b.useDeferredValue(c),v=b.useDeferredValue(f),T=b.useMemo(()=>{try{return JSON.stringify(O,null,2)}catch{return String(O)}},[O]),C=b.useMemo(()=>{try{return JSON.stringify(v,null,2)}catch{return String(v)}},[v]),x=r?.type===Ke.FUNCTION,_=x?r?.logsData||{}:{},w=x&&!Ot(_),[D,I]=b.useState(null),[P,k]=b.useState(!1);b.useEffect(()=>{if(g&&_&&typeof _=="object"&&Object.keys(_).length>0){k(!0);const K=setTimeout(()=>{try{const Z={};Object.entries(_).forEach(([ne,le])=>{const Oe=Array.isArray(le)?le:[le];Oe.length===1?Z[`[log ${ne}]`]=Oe[0]:Z[`[log ${ne}]`]=Oe}),I(Z)}catch{I({error:String(_)})}finally{k(!1)}},0);return()=>clearTimeout(K)}else I(null),k(!1)},[g,_,r?.eventId]);const N=r?.isTrigger?r?.inputData||{}:null,L=b.useMemo(()=>N?N?.payload:null,[N]),F=b.useMemo(()=>N?N?.global_variables:null,[N]),B=b.useMemo(()=>{if(!N)return null;const K={};return N?.http&&(K.http=N.http),N?.webhook&&(K.webhook=N.webhook),Object.keys(K).length?K:null},[N]),Q=b.useMemo(()=>{if(!N)return null;const K={...N||{}};return delete K.payload,delete K.global_variables,delete K.http,delete K.webhook,K&&Object.keys(K).length?K:null},[N]),V=b.useMemo(()=>ol(L,l),[L,l]),q=b.useMemo(()=>ol(F,l),[F,l]),M=b.useMemo(()=>ol(B,l),[B,l]),G=b.useMemo(()=>{const K=M;if(K&&typeof K=="object"&&!Array.isArray(K)){const Z=Object.keys(K);if(Z.length===1&&(Z[0]==="http"||Z[0]==="webhook"))return K[Z[0]]}return K},[M]),U=b.useMemo(()=>ol(Q,l),[Q,l]),R=r?.isTrigger&&r?.eventName?r.eventName:"Trigger",j=r?.eventId||r?.id||"execution-details",$=b.useMemo(()=>{if(!r?.isTrigger)return null;switch(n){case"Payload":return V;case"Global Variables":return q;case R:return G;case"Miscelaneous":return U;default:return V}},[r?.isTrigger,n,V,q,M,U]),Y=K=>K==="Payload"||K==="Global Variables"?"{}":K.toLowerCase(),X=b.useMemo(()=>{try{return $==null||typeof $=="object"&&!Array.isArray($)&&Object.keys($).length===0?"{}":JSON.stringify($,null,2)}catch{return String($)}},[$]),H=!!r?.isTrigger&&[Ke.HTTP,Ke.WEBHOOK,Ke.COPILOT_WEBHOOK,Ke.MCP].includes(r?.type),W=r?.isTrigger?["Payload","Global Variables",...H?[R]:[],"Miscelaneous"]:["Data in","Data out"],z=W.includes(n)?n:W[0];return z!==n&&i(W[0]),d.jsxs(E.Grid,{sx:{height:"100%",overflow:"auto"},item:!0,px:3,py:2,children:[d.jsxs(E.Stack,{direction:"row",gap:.75,mx:2,children:[d.jsx(E.ListItemAvatar,{sx:{minWidth:30,display:"flex",justifyContent:"center"},children:r?.activityIcon?d.jsx("img",{style:{width:"24px",height:"24px",objectFit:"contain",margin:0},alt:r?.eventName?.slice(0,2).toUpperCase(),src:Jp(r?.activityIcon||"","t.resize(h:24,w:24)")}):d.jsx(E.Avatar,{variant:"rounded",sx:{width:24,height:24},children:d.jsx(E.Typography,{variant:"smNormal",children:r?.eventName?.slice(0,2).toUpperCase()})})}),d.jsxs(E.Stack,{direction:"row",gap:1,alignItems:"center",children:[d.jsx(E.Typography,{variant:"lgSemiBold",children:r?.eventName}),!!r?.pro&&d.jsx(ef,{})]})]}),d.jsxs(E.Stack,{direction:"row",sx:{...si,borderBottom:1,borderColor:"divider",mx:2},children:[g?d.jsx(E.Box,{sx:{flex:1}}):d.jsx(Po,{variant:"normal",tabs:r?.isTrigger?[{title:"Payload"},{title:"Global Variables"},...H?[{title:R}]:[],{title:"Miscelaneous"}]:[{title:"Data in"},{title:"Data out"}],selectedTab:n,setSelectedTab:K=>{i(K)},textTransform:"none",sx:{fontSize:14,mt:"8px !important",minHeight:"30px",color:"black",fontWeight:600,border:"none","& .MuiTabs-indicator":{display:"block !important",position:"relative",top:-.5,backgroundColor:t.palette.common.black,borderRadius:4},"& .MuiButtonBase-root ":{mb:"3px"},"& .MuiButtonBase-root.MuiTab-root.Mui-selected":{color:t.palette.common.black+" !important"},"&.MuiTabs-root":{display:"flex",justifyContent:"space-between",alignItems:"flex-end",backgroundColor:"white !important",color:"black !important ","&.Mui-selected":{boxShadow:"none !important",color:"black !important"},m:0,pb:0,"& .MuiTabs-flexContainer":{gap:3}}}}),d.jsx(Po,{variant:"normal",tabs:w?[{title:"GUI"},{title:"Raw"},{title:"Logs"}]:[{title:"GUI"},{title:"Raw"}],selectedTab:g?"Logs":o,sx:{"&.MuiTabs-root":{mb:1.5,border:`1px solid ${t.palette.grey.outlined.border}`},"& .MuiButtonBase-root":{fontWeight:600}},setSelectedTab:K=>{if(K==="Logs"){w&&m(!0);return}m(!1),s(K)}})]}),d.jsxs(E.Box,{children:[r?.isoEventTime&&d.jsxs(E.Box,{sx:{ml:2,mt:2,px:.75,height:32,width:"fit-content",borderRadius:1,gap:.5,display:"flex",alignItems:"center",backgroundColor:K=>K.palette.white.smoke,border:K=>`1px solid ${K.palette.grey.outlined.border}`},children:[d.jsx(E.Typography,{variant:"smSemiBold",sx:{color:t.palette.text.primary},children:"Execution started"}),d.jsx(E.Typography,{variant:"xsMedium",sx:{color:t.palette.text.tertiary},children:a(r.isoEventTime)})]}),d.jsx(E.Box,{sx:{mx:2,mt:2},children:(()=>{if(!r)return!1;if(g)return w;if(r?.isTrigger)return!0;const K=n==="Data in",Z=n==="Data out",se=r?.eventType===ro.ACTIVITY_TASK_FAILED||r?.eventType===ro.ACTIVITY_TASK_TIMED_OUT;return K?!0:Z?!se:!1})()&&d.jsx(E.OutlinedInput,{fullWidth:!0,value:l,onChange:K=>u(K.target.value),placeholder:"Search",startAdornment:d.jsx(E.InputAdornment,{position:"start",sx:{m:0,pr:.5},children:d.jsx(Me,{src:"ic_search",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}})}),sx:{"&.MuiInputBase-root.MuiOutlinedInput-root":{pl:1}}})}),n!=="Data in"&&(r?.eventType===ro.ACTIVITY_TASK_FAILED||r?.eventType===ro.ACTIVITY_TASK_TIMED_OUT)&&o==="GUI"&&d.jsxs(E.Stack,{border:`1px solid ${t.palette.error[40]}`,borderRadius:2,gap:1,p:1.5,sx:{mx:2,mt:2,backgroundColor:t.palette.error[5]},children:[d.jsx(E.Typography,{variant:"smNormal",color:t.palette.text.tertiary,children:"Error:"}),(()=>{const K=r?.outputData?.error?.message??r?.outputData?.message??r?.activityTaskTimedOutEventAttributes?.failure?.message;return typeof K=="string"?d.jsx(E.Typography,{variant:"smNormal",color:t.palette.text.tertiary,children:K}):typeof K=="object"?d.jsx("pre",{style:{fontFamily:"monospace",fontSize:"0.875rem",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:JSON.stringify(K,null,2)}):d.jsx(E.Typography,{variant:"smNormal",color:t.palette.text.tertiary,children:"Unknown error"})})()]}),!g&&!p.loading&&r?.eventType!==ro.ACTIVITY_TASK_TIMED_OUT&&(n==="Data in"&&(Ot(c)||c===null||c===void 0)||n==="Data out"&&(Ot(f)||f===null||f===void 0))&&d.jsx(E.Stack,{mt:12,justifyContent:"center",children:d.jsx(Ec,{icon:d.jsx(Me,{src:"ic_no_data",width:120,height:120}),title:"No data Found",description:o==="GUI"?"No data found":"We couldn't find any matching results for your search. Try adjusting your keywords, filters, etc and check again."})}),!g&&r?.isTrigger&&!p.loading&&(Ot($)||$===null||$===void 0)&&(o==="GUI"?d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,sx:{mx:2,mt:2},children:[d.jsx(Me,{src:"ic_object",width:16,height:16}),d.jsxs(E.Typography,{variant:"smNormal",color:t.palette.text.primary,children:[Y(n)," "]})]}):null),!g&&r&&!Ot(c)&&n==="Data in"&&(o==="GUI"?h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}),children:d.jsx(r0,{data:O,enableEllipsis:!1,highlightText:l,resetKey:`${j}:data-in`})}):d.jsx(E.Box,{sx:{mx:2,mt:2},children:h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}),children:d.jsx(co,{height:"calc(100vh - 440px)",size:"lg",readOnly:!0,options:{readOnly:!0,cursorStyle:"line",autoIndent:"full"},language:"json",handleChange:()=>{},value:T,showCopyToClipboard:!0,showSuggestions:!1})})})),!g&&r?.isTrigger&&(o==="GUI"?!Ot($)&&(h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}),children:d.jsx(r0,{data:$,enableEllipsis:!1,highlightText:l,resetKey:`${j}:${z}`})})):d.jsx(E.Box,{sx:{mx:2,mt:2},children:h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}),children:d.jsx(co,{height:"calc(100vh - 440px)",size:"lg",readOnly:!0,options:{readOnly:!0},language:"json",handleChange:()=>{},value:X,showCopyToClipboard:!0,showSuggestions:!1})})})),!g&&r&&!Ot(f)&&n==="Data out"&&(o==="GUI"?r?.eventType!=="ACTIVITY_TASK_FAILED"&&(h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}),children:d.jsx(r0,{data:v,enableEllipsis:!1,highlightText:l,resetKey:`${j}:data-out`})})):d.jsx(E.Box,{sx:{mx:2,mt:2},children:h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}),children:d.jsx(co,{height:"calc(100vh - 440px)",size:"lg",readOnly:!0,options:{readOnly:!0,cursorStyle:"line",autoIndent:"full"},language:"json",handleChange:()=>{},value:C,showCopyToClipboard:!0,showSuggestions:!1})})})),!g&&r&&n==="Data out"&&o!=="GUI"&&r?.eventType===ro.ACTIVITY_TASK_TIMED_OUT&&d.jsx(E.Box,{sx:{mx:2,mt:2},children:d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}),children:d.jsx(co,{height:"calc(100vh - 440px)",size:"lg",readOnly:!0,options:{readOnly:!0,cursorStyle:"line",autoIndent:"full"},language:"json",handleChange:()=>{},value:JSON.stringify(r?.activityTaskTimedOutEventAttributes?.failure,null,2),showCopyToClipboard:!0,showSuggestions:!1})})}),g&&w&&d.jsx(E.Box,{sx:{mx:2,mt:2},children:h||P?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}):D&&typeof D=="object"&&Object.keys(D).length>0?d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}),children:d.jsx(r0,{data:D,highlightText:l,resetKey:`${j}:logs`})}):d.jsx(E.Stack,{mt:12,justifyContent:"center",children:d.jsx(Ec,{icon:d.jsx(Me,{src:"ic_no_data",width:120,height:120}),title:"No logs found",description:"No logs are available for this execution."})})})]})]})},Ndt=({workflowId:e,executionId:t,parentExecutionId:r,parentExecutionStatus:n,currentStatus:i})=>{const o=E.useTheme(),{WORKFLOW_URLS:s,ENTITY_ID:a}=_i(),{VORTEX_MAIN_URL:l}=s,[u,c]=b.useState(null),f=!!u,[p,h]=b.useState(!1),[A,g]=b.useState([]),[m,y]=b.useState(null),O=async()=>{if(y(null),!!r){h(!0);try{const x=Mne(l,a,e,r),_=await qt.get(x),w=Sat(_?.data?.data||[]);g(w)}catch{g([]),y("Failed to load retries")}finally{h(!1)}}};b.useEffect(()=>{O()},[r,n,t,e,l,a]),b.useEffect(()=>{f&&A.length===0&&O()},[f]),b.useEffect(()=>()=>{c(null)},[]);const v=b.useMemo(()=>xat(A),[A]),T="This execution failed before the workflow could start, so its logs aren't available.",C=b.useMemo(()=>{if(r===t)return"Latest Execution";const x=v.find(_=>_.id===t)?.meta?.retry_attempt;return x?`Retry ${x}`:"Retry"},[v,t,r,n]);return d.jsx(d.Fragment,{children:!p&&v.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(E.Button,{ref:x=>{},size:"small",variant:"outlined",onClick:x=>{const _=x.currentTarget;c(_)},endIcon:u?d.jsx(Me,{src:"ic_arrow_up",width:16,height:16,fill:o.palette.neutral.solid.bg}):d.jsx(Me,{src:"ic_arrow_down",width:16,height:16,fill:o.palette.neutral.solid.bg}),sx:{border:"1px solid",borderColor:o.palette.neutral.outlined.border,borderRadius:"8px",height:32,px:1,textTransform:"none","&:hover":{backgroundColor:o.palette.white.smoke}},children:d.jsxs(E.Stack,{sx:{...p0,gap:1},children:[d.jsx(E.Typography,{variant:"xsSemiBold",color:o.palette.text.secondary,children:C}),i&&d.jsx($E,{status:i})]})}),d.jsxs(E.Menu,{anchorEl:u&&document.contains(u)?u:null,open:!!(f&&u&&document.contains(u)),onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{minWidth:u?u.offsetWidth:"auto",mt:.5,maxHeight:300,overflowY:"auto"}}},MenuListProps:{sx:{width:"100%"}},disablePortal:!1,keepMounted:!1,variant:"menu",disableAutoFocusItem:!0,disableEnforceFocus:!0,disableRestoreFocus:!0,children:[m&&d.jsx(E.Typography,{variant:"xsNormal",sx:{px:2,py:1},color:"error",children:m}),d.jsx(E.MenuItem,{selected:r===t,sx:{px:2,py:1.5,"& .Mui-selected":{bgcolor:o.palette.grey[50]},"&:hover":{bgcolor:o.palette.white.smoke}},onClick:()=>{if(c(null),r!==t){const x=`/accounts/${a}/workflow-builder/workflow/${e}/executions/${r}?parentExecutionId=${r}&parentExecutionStatus=${n}`;window.open(x,"_blank")}},"data-testid":"latest-execution",children:d.jsxs(E.Stack,{direction:"row",alignItems:"center",width:"100%",justifyContent:"space-between",children:[d.jsxs(E.Stack,{alignItems:"flex-start",gap:.5,children:[d.jsx(E.Typography,{variant:"mdNormal",sx:{color:o.palette.text.primary},children:"Latest Execution"}),d.jsxs(E.Typography,{variant:"smNormal",sx:{color:o.palette.text.tertiary},children:["ID: ",r]})]}),n&&d.jsx($E,{status:n})]})}),v.map(x=>{const _=!!x.meta?.failed_before_start;return d.jsx(E.Tooltip,{arrow:!0,placement:"right",title:_?T:"",children:d.jsx(E.MenuItem,{selected:x.id===t,onClick:()=>{if(!_&&(c(null),x.id!==t)){const w=`/accounts/${a}/workflow-builder/workflow/${e}/executions/${x.id}?parentExecutionId=${r}&parentExecutionStatus=${n}`;window.open(w,"_blank")}},sx:{px:2,py:1.5,cursor:_?"not-allowed":"pointer",opacity:_?.6:1,"& .Mui-selected":{bgcolor:o.palette.grey[50]},"&:hover":{bgcolor:_?"transparent":o.palette.white.smoke}},"data-testid":"retry-execution",children:d.jsxs(E.Stack,{direction:"row",alignItems:"center",width:"100%",justifyContent:"space-between",children:[d.jsxs(E.Stack,{alignItems:"flex-start",gap:.5,children:[d.jsx(E.Typography,{variant:"mdNormal",sx:{color:o.palette.text.primary},children:x.label}),d.jsxs(E.Typography,{variant:"smNormal",sx:{color:o.palette.text.tertiary},children:["ID: ",x.id]})]}),d.jsx($E,{status:x.status})]})})},x.id)})]})]})})},Ldt=e=>{const t=E.useTheme(),r=At.useDispatch(),{WORKFLOW_URLS:n,ENTITY_ID:i,analytics:o}=_i(),{VORTEX_MAIN_URL:s}=n,{executionId:a,parentExecutionId:l,parentExecutionStatus:u}=e,c=m8(),{executionLogs:f}=At.useSelector(re=>re.workflows),{activities:p,triggers:h}=At.useSelector(re=>re.activities),[A,g]=b.useState("Data in"),[m,y]=b.useState("GUI"),[O,v]=b.useState(null),[T,C]=b.useState(""),[x,_]=b.useState([]),[w,D]=b.useState(!1),[I,P]=b.useState(!1),[k,N]=b.useState(!1),[L,F]=b.useState(!1),{retryExecutions:B}=ooe({workflowId:c??void 0,VORTEX_MAIN_URL:s,ENTITY_ID:i});b.useEffect(()=>{p?.data?.data.length===0&&r($J({page:1,per_page:999,integrations:!0},s,i)),h?.data?.data.length===0&&r(UJ({page:1,per_page:999,triggers:!0},s,i))},[r]);const Q=(()=>{const ue=new URLSearchParams(location.search).get("executionId");return a||ue||(typeof window<"u"?window.location.pathname.match(/\/executions\/([^/?#]+)/):null)?.[1]||""})();b.useEffect(()=>{N(Q===l)},[l]);const[V,q]=b.useState(!1),M=!f?.logs?.is_first_execution,G=!f?.logs?.is_last_execution,U=b.useCallback(async re=>{if(!c||!Q||V||re==="prev"&&!M||re==="next"&&!G)return;q(!0);const ue=await cce(c,Q,re,s,i);if(ue){v(null);const pe=window.location.pathname.replace(/\/executions\/[^/?#]+/,`/executions/${ue}`),Ae=`?parentExecutionId=${ue}&parentExecutionStatus=`;window.history.replaceState({},"",pe+Ae)}q(!1)},[c,Q,s,i,V,M,G,r]);b.useEffect(()=>{!c||!Q||r(Kp(c??"",Q,s,i,yd.EXECUTION_HISTORY,o,{execution_source:"full"}))},[Q,c,r]);const R=()=>{!c||!Q||r(Kp(c??"",Q,s,i,yd.EXECUTION_HISTORY,o,{execution_source:"full"}))},j=()=>{!c||!Q||!f.nextPageToken||(F(!0),r(Kp(c??"",Q,s,i,yd.EXECUTION_HISTORY,o,void 0,f.nextPageToken,!0)))};kne({workflowId:c,executionId:Q,VORTEX_MAIN_URL:s,ENTITY_ID:i,executedFrom:yd.EXECUTION_HISTORY,analytics:o,executionLogs:f,params:{execution_source:"full"},shouldPoll:()=>f?.error?!1:f?.logs!==null&&f?.logs!==void 0?!0:f?.loading||f?.logs===null||f?.logs===void 0});const $=x.find(re=>(re.eventType.includes(ro.ACTIVITY_TASK_COMPLETED)||re.eventType.includes(ro.ACTIVITY_TASK_FAILED)||re.eventType.includes(ro.ACTIVITY_TASK_TIMED_OUT))&&re.eventId===O),Y=p?.data?.data?.length>0,X=h?.data?.data?.length>0;b.useEffect(()=>{if(f?.logs?.events&&Y&&X){const re=f6(f.logs.events,p,h);_(re),D(!0)}},[f,p.data.data,Y,X]);const H=b.useMemo(()=>!f?.logs?.events||!Y||!X?[]:fre(f,p,h,"events"),[f,p,h,Y,X]),W=b.useRef(!1);b.useEffect(()=>{f?.loading&&(W.current=!0)},[f?.loading]),b.useEffect(()=>{if(!w){const re=Y&&X;f?.logs&&re&&D(!0)}},[w,f?.logs,Y,X]),b.useEffect(()=>{!f.loading&&L&&F(!1)},[f.loading,f.logs,f.error]),b.useEffect(()=>{D(!1),_([]),v(null),F(!1)},[a]),b.useEffect(()=>{H.length!==0&&!O&&v(H[0].eventId)},[H,O]);const z=b.useMemo(()=>T0e(x),[x]),K=re=>NE(re,"full"),Z=b.useMemo(()=>dre(H),[H]);if(!c)return d.jsx(E.Stack,{height:"80vh",alignItems:"center",justifyContent:"center",children:d.jsx(Ec,{title:"Workflow not found",description:"We couldn't determine which workflow this execution belongs to. Please reopen the execution from the history listing.",icon:d.jsx(Me,{src:"ic_warning_circle",width:80,height:80})})});const se=f.error?.status||f.error?.code;if(f.loading&&!se&&!w)return d.jsx(E.Stack,{alignItems:"center",justifyContent:"center",height:"80vh",children:d.jsx(pi,{size:60})});if(f.error?.status===404||f.error?.code===404)return d.jsx(Ec,{title:"Data has been archived",height:"calc(100vh - 128px)",description:"This execution history has been archived. Click the refresh button to get the execution.",icon:d.jsx(Me,{src:"ic_no_data",width:120,height:120}),buttonElement:d.jsx(E.Button,{sx:{mt:3},variant:"outlined",color:"primary",startIcon:d.jsx(Me,{src:"ic_refresh",width:t.icons.sm,height:t.icons.sm,fill:t.palette.primary.main}),children:"Refresh"})});if((f.error?.code||f.error?.status)&&!f.logs?.events?.length)return d.jsx(E.Stack,{width:"100%",height:"calc(100vh - 210px)",children:d.jsx(Ec,{icon:d.jsx(Me,{src:"ic_no_data",width:120,height:120}),title:"Something is broken",description:B4(f.error)||"Something went wrong while fetching the execution history.This could be due to a temporary issue or a technical error.",buttonElement:d.jsxs(E.Typography,{variant:"smNormal",sx:{mt:2},children:["Raise issue on ",d.jsx("a",{href:"mailto:support@boltic.io",children:"support@boltic.io"})]})})});const le=ol($?.inputData,T),Oe=ol($?.outputData,T),ve=(re,ue)=>{if(re===0)return"0px";if(Z.includes(ue.eventName))return Z.includes(H[re-1].eventName)?"110px":"72px";let pe=0,Ae=re-1;for(;Ae>=0&&Z.includes(H[Ae].eventName);)pe++,Ae--;return`${40+pe*110}px`},ae={total:x.filter(re=>[ro.ACTIVITY_TASK_FAILED,ro.ACTIVITY_TASK_TIMED_OUT,ro.ACTIVITY_TASK_COMPLETED].includes(re.eventType)).length,SUCCESS:x.filter(re=>re.eventType.includes(ro.ACTIVITY_TASK_COMPLETED)).length,failed:x.filter(re=>[ro.ACTIVITY_TASK_FAILED,ro.ACTIVITY_TASK_TIMED_OUT].includes(re.eventType)).length,not_executed:Math.max(z-x.filter(re=>!Z.includes(re.eventName)&&[ro.ACTIVITY_TASK_FAILED,ro.ACTIVITY_TASK_TIMED_OUT,ro.ACTIVITY_TASK_COMPLETED].includes(re.eventType)).length,0),actual_execution:x.filter(re=>!re?.isTrigger&&re.type!==Ke.LOOP&&[ro.ACTIVITY_TASK_FAILED,ro.ACTIVITY_TASK_TIMED_OUT,ro.ACTIVITY_TASK_COMPLETED].includes(re.eventType)).reduce((re,ue)=>re+ue.rawTimeDiff,0)},ie=[{title:"Total executed activities",logo:d.jsx(Me,{src:"ic_all",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}}),count_key:ae.total>0?ae.total-1:0,helperText:"The total number of activities that were triggered during this execution."},{title:"Successful",logo:d.jsx(Me,{src:"ic_success",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}}),count_key:ae.SUCCESS>0?ae.SUCCESS-1:0,helperText:"Activities that ran successfully without any errors in this execution."},{title:"Failed",logo:d.jsx(Me,{src:"ic_close_filled",width:24,height:24,sx:{path:{fill:t.palette.error.main}}}),count_key:ae.failed,helperText:"Activities that encountered errors and did not complete successfully in this execution."},{title:"Not executed",logo:d.jsx(Me,{src:"ic_pending",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}}),count_key:ae.not_executed,helperText:"Activities that were skipped or not triggered during this execution, possibly due to conditions or failures in previous activities."},{title:"Time taken",logo:d.jsx(Me,{src:"ic_avg_time",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}}),count_key:f.logs?.status==="Timed out"&&ae.actual_execution===0?qp(f?.logs?.time_taken??0):ae.actual_execution?qp(ae.actual_execution):qp(f?.logs?.time_taken??0),helperText:"The time it took to run the workflow from start to finish, not including any time it spent waiting in the queue."}],J=Array.isArray(f?.logs?.events)&&!bE(f?.logs?.events||[])?"Running":f?.logs?.status||"";return d.jsxs(d.Fragment,{children:[d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",mx:3,mt:2,mb:0,children:[d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[d.jsxs(E.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.jsx(E.Typography,{variant:"lgSemiBold",color:t.palette.text.primary,children:Q}),d.jsx(E.Tooltip,{title:"Copy to clipboard",children:d.jsx(E.IconButton,{"data-testid":"copy-execution-id",sx:{marginBottom:"2px"},onClick:()=>{const re=Q||a;re&&Ed(re)},size:"small",children:d.jsx(Me,{src:"ic_copy",width:15,height:15,sx:{path:{fill:t.palette.common.black}}})})})]}),l&&u&&c&&Q&&d.jsx(Ndt,{workflowId:c,executionId:Q,parentExecutionId:l,parentExecutionStatus:u,currentStatus:f?.logs?.status})]}),d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1.5,children:[d.jsx($E,{status:J,size:"small"}),c&&k&&z4.includes(J)&&d.jsx(E.Button,{"data-testid":"event-history-retry",variant:"outlined",size:"small",disabled:I,startIcon:d.jsx(Me,{src:"ic_try_again",width:14,height:14,sx:{path:{fill:t.palette.text.icon}}}),onClick:async()=>{P(!0);try{const re=await B([Q],c);r({type:Qr,payload:{open:!0,title:re.success?"Retry initiated for 1 execution(s)":re.error?.message||"Retry failed",type:re.success?"success":"error"}})}catch{r({type:Qr,payload:{open:!0,title:"Retry failed",type:"error"}})}finally{P(!1)}},sx:{borderColor:t.palette.neutral.outlined.border,borderRadius:"8px",height:32,textTransform:"none","&:hover":{backgroundColor:t.palette.white.smoke}},children:d.jsx(E.Typography,{variant:"xsSemiBold",color:t.palette.text.secondary,children:"Retry"})}),d.jsx(E.Tooltip,{title:"Force refresh",children:d.jsx(E.IconButton,{onClick:R,disabled:!!f.loading,size:"small",sx:{height:28,width:28,borderRadius:"0.5rem",border:`1px solid ${t.palette.grey[300]}`,p:.5,":hover":{backgroundColor:"transparent"},...Ri(t)},children:d.jsx(Me,{src:"ic_refresh",width:16,height:16})})}),k&&d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:.5,children:[d.jsx(E.Tooltip,{title:"Previous execution",children:d.jsx(E.IconButton,{"data-testid":"event-history-prev",onClick:()=>U("prev"),size:"small",sx:{height:32,width:32,borderRadius:"0.5rem",border:`1px solid ${t.palette.grey[300]}`,p:.5,opacity:M&&!V?1:.4,":hover":{backgroundColor:"transparent"},...Ri(t)},children:d.jsx(Me,{src:"ic_arrow_left",width:22,height:22,sx:{path:{fill:t.palette.text.icon}}})})}),d.jsx(E.Tooltip,{title:"Next execution",children:d.jsx(E.IconButton,{"data-testid":"event-history-next",onClick:()=>U("next"),size:"small",sx:{height:32,width:32,borderRadius:"0.5rem",border:`1px solid ${t.palette.grey[300]}`,p:.5,opacity:G&&!V?1:.4,":hover":{backgroundColor:"transparent"},...Ri(t)},children:d.jsx(Me,{src:"ic_arrow_right",width:22,height:22,sx:{path:{fill:t.palette.text.icon}}})})})]})]})]}),d.jsx(E.Box,{sx:{m:3,my:2},children:d.jsx(gdt,{title:"Execution Summary",statistics:ie})}),!w||x.length>0&&!O?d.jsx(E.Stack,{alignItems:"center",justifyContent:"center",height:"80vh",children:d.jsx(pi,{size:60})}):x.length>0&&O?d.jsxs(E.Grid,{container:!0,width:"auto",mx:3,spacing:2,borderRadius:"8px 8px 0 0",border:`1px solid ${t.palette.grey.outlined.border}`,flexWrap:"nowrap",height:"calc(100vh - 210px)",borderBottom:"none",children:[d.jsx(Odt,{logsToShow:H,loopChildActivities:Z,events:f?.logs?.events,selectedActivity:O,getConnectingLineHeight:ve,setSelectedActivity:v,setJsonViewType:y,setDataPresentType:g,onLoadMore:j,hasMore:!!f.nextPageToken,isLoadingMore:L}),d.jsx(Pdt,{selectedLogData:$,dataPresentType:A,setDataPresentType:g,jsonViewType:m,setJsonViewType:y,getFormattedDateTime:K,searchQuery:T,setSearchQuery:C,dataIn:le,dataOut:Oe,executionLogs:f})]}):d.jsx(E.Stack,{alignItems:"center",justifyContent:"center",width:"100%",children:d.jsx(soe,{title:"No events found","data-id":"events-empty-page"})})]})},kdt=({crumbs:e,separator:t=d.jsx(Me,{src:"ic_arrow_right",width:24,height:24}),maxItems:r=4,navigate:n,loading:i,...o})=>{const s=E.useTheme(),a=(u,c,f)=>{u.preventDefault(),f?f():c&&n(c)},l=u=>{const c=[];return u.forEach((f,p)=>{const{path:h,label:A,color:g,textStyle:m="mdNormal",onClick:y}=f;i?c.push(d.jsx(E.Skeleton,{variant:"rounded",width:120,height:24},`breadcrumb-skel-${p}`)):!h&&!y?c.push(d.jsx(E.Typography,{color:g,variant:m,"data-testid":`breadcrumb-${A}`,children:A},`breadcrumb-${typeof A=="string"?A:"object"}-${p}`)):c.push(d.jsx(E.Typography,{onClick:O=>{p!==u.length-1&&a(O,h,y)},variant:m,"data-testid":`breadcrumb-${A}`,sx:{color:g,cursor:"pointer",textDecoration:"none","&:hover":{color:p===u.length-1?g:s.palette.primary.main,cursor:p===u.length-1?"default":"pointer"}},children:A},`breadcrumb-${A}-${p}`))}),c};return d.jsx(E.Breadcrumbs,{separator:t,"aria-label":"breadcrumb",maxItems:r,...o,children:l(e)})},Mdt=({crumbs:e,onBack:t,navigate:r})=>{const n=E.useTheme();return d.jsxs(E.Stack,{sx:{position:"sticky",top:0,zIndex:10,bgcolor:n.palette.common.white},children:[d.jsxs(E.Stack,{justifyContent:"flex-start",spacing:2,direction:"row",width:"100%",pl:1.5,pr:3,py:0,alignItems:"center",sx:{minHeight:48,maxHeight:48,height:48},children:[d.jsx(E.IconButton,{onClick:t,sx:{cursor:"pointer",p:0,width:24,height:24,...Ri(n)},"data-testid":"executions-back-button",children:d.jsx(Me,{src:"ic_back",width:24,height:24,fill:n.palette.neutral.solid.bg})}),d.jsx(E.Typography,{variant:"xlSemiBold",color:"text.primary",children:"Execution History"})]}),d.jsx(E.Divider,{}),d.jsx(E.Stack,{direction:"row",alignItems:"center",justifyContent:"flex-start",sx:{px:2.5,py:0,backgroundColor:n.palette.white.smoke,minHeight:48,maxHeight:48,height:48},children:d.jsx(kdt,{"data-testid":"executions-breadcrumbs",crumbs:e,navigate:r})})]})},coe=({value:e,onChange:t,minDateTime:r,maxDateTime:n,acceptDates:i,clearDates:o})=>{const[s,a]=Te.useState(!1),l=e?Sr(e):null,u=r?Sr(r):void 0,c=n?Sr(n):void 0,f=h=>{const A=h?h.toDate():null;t(A)},p=h=>{const A=h?h.toDate():null;i?.(A)};return d.jsx(_A,{dateAdapter:Jl,children:d.jsx(fE,{open:s,onClose:()=>a(!1),value:l,onChange:f,minDateTime:u,maxDateTime:c,onAccept:p,views:["year","month","day","hours","minutes"],closeOnSelect:!1,slotProps:{field:{clearable:!0,onClear:()=>o?.(null)},textField:{onClick:()=>a(!0),inputProps:{readOnly:!0},InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-input":{flexDirection:"row",gap:.5},"& .MuiInputBase-root":{"& :nth-of-type(2)":{order:3},"& :nth-of-type(1)":{order:2},"& :nth-last-of-type(2)":{order:1},"& input":{ml:2},"& > *":{px:0}},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{border:"none",boxShadow:"none"},"& .MuiOutlinedInput-root.Mui-focused.Mui-error .MuiOutlinedInput-notchedOutline":{border:"none",boxShadow:"none"}}},actionBar:{actions:["accept"]},popper:{sx:{"&.MuiPopper-root.MuiPickersPopper-root .MuiPaper-root":{margin:"10px 0"}},disablePortal:!0}}})})},Fdt=({startDate:e,endDate:t,onStartDateChange:r,onEndDateChange:n,startMinDateTime:i,startMaxDateTime:o,endMinDateTime:s,endMaxDateTime:a,acceptDateStart:l,acceptDatesEnd:u,clearStart:c,clearEnd:f,toolTipStartDate:p})=>{const h=E.useTheme();return d.jsxs(E.Stack,{direction:"column",justifyContent:"space-between",sx:{"& .MuiInputBase-input.MuiOutlinedInput-input":{p:.43}},children:[d.jsxs(E.Box,{display:"inline",position:"relative",children:[d.jsx(E.Typography,{variant:"xsBold",children:"Date range"}),p&&d.jsx(E.Tooltip,{title:p,children:d.jsx(E.Box,{sx:{cursor:"pointer",ml:.5,display:"inline-block",position:"absolute",top:5},children:d.jsx(Me,{src:"ic_info"})})})]}),d.jsxs(E.Stack,{direction:"row",gap:.75,borderRadius:2,border:`1px solid ${h.palette.neutral.outlined.border}`,sx:{"&:focus-within":{border:`1px solid ${h.palette.primary.main}`}},children:[d.jsx(coe,{value:e,onChange:r,minDateTime:i,maxDateTime:t||o,acceptDates:l,clearDates:c}),d.jsx(E.Divider,{orientation:"vertical",flexItem:!0}),d.jsx(coe,{value:t,onChange:n,minDateTime:e||s,maxDateTime:a,acceptDates:u,clearDates:f})]})]})},Bdt=({onClear:e,selectedValues:t,onToggle:r,isOpen:n})=>{const i=E.useTheme();return d.jsxs(E.Stack,{direction:"row",gap:.5,alignItems:"center",height:36,children:[t.length!==0&&d.jsx(E.IconButton,{onClick:o=>{o.stopPropagation(),e()},sx:{"&:hover":{backgroundColor:"transparent"},p:0},disableRipple:!0,children:d.jsx(Me,{src:"ic_close",width:24,height:24})}),d.jsx(E.IconButton,{onClick:o=>{o.stopPropagation(),r()},sx:{"&:hover":{backgroundColor:"transparent"},transform:n?"rotate(90deg)":"rotate(-90deg)",transition:"transform 0.2s ease",p:0,mr:1},disableRipple:!0,children:d.jsx(Me,{src:"ic_arrow_left",width:24,height:24,sx:{path:{fill:i.palette.neutral.solid.bg}}})})]})},doe=e=>{const t=E.useTheme(),{selectedValues:r,handleChange:n,allValueSelectedText:i,options:o,optionUi:s,searchable:a,searchPlaceholder:l,width:u,getStatusIcon:c,getStatusBackground:f,getBorderColor:p}=e,[h,A]=b.useState(!1),[g,m]=b.useState(""),y=I=>{I.currentTarget.contains(I.relatedTarget)||A(!1)},O=b.useCallback(()=>A(I=>!I),[]),v=b.useMemo(()=>new Set(o.map(I=>String(I.value))),[o]),T=I=>{const P=(I||[]).filter(k=>v.has(String(k)));return P.length===0||P.length===o.length?d.jsx(E.Typography,{color:t.palette.text.tertiary,children:i}):d.jsxs(E.Typography,{color:t.palette.text.tertiary,children:[P.length," selected"]})},C=b.useCallback(()=>{n({target:{value:[]}})},[n]),x=I=>d.jsx(Bdt,{...I,onClear:C,selectedValues:r,onToggle:O,isOpen:h}),_=b.useCallback(I=>I.stopPropagation(),[]),w=b.useCallback(I=>{I.stopPropagation(),I.preventDefault()},[]),D=b.useMemo(()=>{if(!a||!g.trim())return o;const I=g.toLowerCase();return o.filter(P=>String(P.title||"").toLowerCase().includes(I))},[o,a,g]);return d.jsx(E.FormControl,{sx:{width:u??"11rem"},children:d.jsxs(E.Select,{multiple:!0,open:h,value:r,onChange:n,renderValue:T,sx:{height:36},displayEmpty:!0,IconComponent:x,onBlur:y,onClick:O,MenuProps:{PaperProps:{style:{maxHeight:300}}},children:[a&&d.jsx(E.MenuItem,{disableRipple:!0,disableTouchRipple:!0,"data-testid":"dropdown-with-select-all-search-input",sx:{pt:1,pb:1,"&.MuiMenuItem-root:hover":{backgroundColor:"transparent"},"&.MuiMenuItem-root.Mui-focusVisible":{backgroundColor:"transparent"},"&.Mui-selected":{backgroundColor:"transparent",borderColor:"transparent"},"&.Mui-selected:hover":{backgroundColor:"transparent",borderColor:"transparent"}},onClick:I=>I.stopPropagation(),children:d.jsx(E.OutlinedInput,{size:"small",placeholder:l||"Search...",value:g,"data-testid":"dropdown-with-select-all-search-input-value",onChange:I=>m(I.target.value),onKeyDown:_,onClick:_,onMouseDown:_,sx:{width:"100%",backgroundColor:"transparent","& .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"& .MuiInputBase-input":{backgroundColor:"transparent"}}})}),D.map(I=>d.jsx(E.MenuItem,{value:I.value,sx:{py:1,px:1.5},onClick:w,"data-testid":"dropdown-with-select-all-option",children:s?d.jsx(s,{...e,selectedValues:r,status:I,getStatusIcon:c,getStatusBackground:f,getBorderColor:p}):I.title},String(I.value)))]})})},jdt=e=>{const t=E.useTheme(),{status:r,selectedValues:n}=e;return d.jsxs(E.Stack,{direction:"row",justifyContent:"flex-start",alignItems:"center",gap:1,children:[d.jsx(E.Checkbox,{icon:d.jsx(Me,{src:"ic_unchecked",width:18,height:18,sx:{path:{fill:t.palette.common.white}}}),checkedIcon:d.jsx(Me,{src:"ic_checked",width:18,height:18,sx:{"path:first-of-type":{fill:t.palette.primary.main}}}),checked:n.includes(r.value)}),d.jsx(E.Stack,{children:d.jsx(E.ListItemText,{primary:r.title})})]})},$dt=e=>d.jsx(doe,{allValueSelectedText:"All triggers",options:sce,optionUi:jdt,...e}),Udt=e=>{const{status:t,selectedValues:r,getStatusIcon:n,getStatusBackground:i,getBorderColor:o}=e,s=E.useTheme();return d.jsxs(E.Stack,{direction:"row",gap:1,justifyContent:"flex-start",alignItems:"center",children:[d.jsx(E.Checkbox,{icon:d.jsx(Me,{src:"ic_unchecked",width:18,height:18,sx:{path:{fill:s.palette.common.white}}}),checkedIcon:d.jsx(Me,{src:"ic_checked",width:18,height:18,sx:{"path:first-of-type":{fill:s.palette.primary.main}}}),checked:r.includes(t.value)}),d.jsx(E.Chip,{icon:n(t.title,s),sx:{backgroundColor:i(t.title,s),color:s.palette.text.primary,boxShadow:"none",borderRadius:"1.5rem",padding:"1px 4px",height:"fit-content",fontSize:"12px",fontWeight:"500","& span":{p:0,letterSpacing:"0.5px",ml:1},border:"1px solid",borderColor:o(t.title,s)},label:t.title})]})},foe=e=>{const{options:t,optionUi:r,allValueSelectedText:n,getStatusIcon:i,getStatusBackground:o,getBorderColor:s,...a}=e,l=t||Uue,u=r||Udt,c=n||"All status";return d.jsx(doe,{allValueSelectedText:c,options:l,optionUi:u,getStatusIcon:i,getStatusBackground:o,getBorderColor:s,...a})},Hdt=e=>{const t=E.useTheme(),{options:r=[],selectedValue:n,onChange:i,width:o="11rem",searchable:s=!1,searchPlaceholder:a}=e,[l,u]=b.useState(!1),[c,f]=b.useState(""),p=b.useCallback(()=>u(m=>!m),[]),h=m=>{m.currentTarget.contains(m.relatedTarget)||u(!1)},A=b.useMemo(()=>{if(!s||!c.trim())return r;const m=c.toLowerCase();return r.filter(y=>String(y.title||"").toLowerCase().includes(m))},[r,s,c]),g=b.useCallback(m=>{const y=r.find(O=>String(O.value)===String(m));return d.jsx(E.Typography,{color:t.palette.text.tertiary,children:y?y.title:"Select version"})},[r,t.palette.text.tertiary]);return d.jsx(E.FormControl,{sx:{width:o},children:d.jsxs(E.Select,{open:l,multiple:!1,value:n??"",onChange:m=>i(m.target.value||null),renderValue:g,sx:{height:36},displayEmpty:!0,onBlur:h,onClick:p,MenuProps:{PaperProps:{style:{maxHeight:300}}},children:[s&&d.jsx(E.MenuItem,{disableRipple:!0,disableTouchRipple:!0,sx:{pt:1,pb:1,"&.MuiMenuItem-root:hover":{backgroundColor:"transparent"},"&.MuiMenuItem-root.Mui-focusVisible":{backgroundColor:"transparent"},"&.Mui-selected":{backgroundColor:"transparent",borderColor:"transparent"},"&.Mui-selected:hover":{backgroundColor:"transparent",borderColor:"transparent"}},onClick:m=>m.stopPropagation(),children:d.jsx(E.OutlinedInput,{size:"small",placeholder:a||"Search versions...",value:c,onChange:m=>f(m.target.value),sx:{width:"100%",backgroundColor:"transparent","& .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"& .MuiInputBase-input":{backgroundColor:"transparent"}}})}),A.map(m=>d.jsx(E.MenuItem,{value:m.value,sx:{py:1,px:1.5},children:m.title},String(m.value)))]})})},Vdt=e=>{const t=E.useTheme(),{isAccountLevel:r,workflowsOptions:n,selectedWorkflowIds:i,setSelectedWorkflowIds:o,onWorkflowsChange:s,executionIdSingle:a,setExecutionIdSingle:l,onExecutionSearch:u,selectedValues:c,onStatusChange:f,showAdvancedFilters:p,setShowAdvancedFilters:h,selectedStartDate:A,selectedEndDate:g,setSelectedStartDate:m,setSelectedEndDate:y,onDateChange:O,clearDates:v,selectedModes:T,onExecutionTypeChange:C,selectedExecutionIds:x,isRetrying:_,onRetrySelected:w,onRefresh:D,versionsOptions:I,selectedVersionId:P,onVersionChange:k}=e,N=!!(A||g||T&&T.length>0);return d.jsx(E.Stack,{children:d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",flexWrap:"wrap",sx:{width:"100%",mb:1.5},children:[d.jsxs(E.Stack,{direction:"row",justifyContent:"flex-start",alignItems:"center",flexWrap:"wrap",gap:1.5,sx:{flex:1},children:[r&&d.jsxs(E.Box,{sx:{width:"20rem"},children:[d.jsx(E.Typography,{variant:"xsBold",children:"Workflow"}),d.jsx(E.Box,{children:d.jsx(foe,{allValueSelectedText:"All workflows",options:n.map(L=>({value:L.id,title:L.name,status:L.status,version:L.version})),width:"20rem",searchable:!0,searchPlaceholder:"Search workflows...",selectedValues:i,handleChange:L=>{const F=L?.target?.value||[],B=Array.isArray(F)?F:String(F).split(",").filter(Boolean);o(B),s(B)},optionUi:({status:L,selectedValues:F})=>d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",width:"100%",children:[d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[d.jsx(E.Checkbox,{checked:F.includes(L.value)}),d.jsx(E.Typography,{variant:"body2",children:L.title})]}),d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[L.status?d.jsx(E.Chip,{label:Ns(L.status),size:"small",sx:{borderRadius:"0.5rem"}}):null,L.version?d.jsx(E.Chip,{label:L.version,size:"small",variant:"outlined",sx:{borderRadius:"0.5rem"}}):null]})]})})})]}),d.jsxs(E.Box,{children:[d.jsx(E.Typography,{variant:"xsBold",children:"Execution ID"}),d.jsx(E.Box,{children:d.jsx(E.OutlinedInput,{sx:{width:"230px","&.MuiInputBase-root.MuiOutlinedInput-root":{pl:1}},placeholder:"Search by Execution ID",value:a,onChange:L=>{const{value:F}=L.target;l(F),F===""&&u(F)},onKeyDown:L=>{L.keyCode===13&&u(a)},startAdornment:d.jsx(E.InputAdornment,{position:"start",sx:{m:0,pr:.5},children:d.jsx(Me,{src:"ic_search",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}})}),endAdornment:a&&d.jsx(E.IconButton,{sx:{height:"100%"},"aria-label":"clear field",onClick:()=>u(""),"data-testid":"clear-execution-id",children:d.jsx(Me,{src:"ic_close",width:24,height:24})})})})]}),!r&&d.jsxs(E.Box,{children:[d.jsx(E.Typography,{variant:"xsBold",children:"Version"}),d.jsx(E.Stack,{direction:"row",alignItems:"center",gap:1,children:d.jsx(Hdt,{options:(I||[]).map(L=>({value:L.id,title:L.status==="draft"?"Draft":`v${L.version}`})),selectedValue:P||null,onChange:L=>k?.(L),width:"11rem"})})]}),d.jsxs(E.Box,{children:[d.jsx(E.Typography,{variant:"xsBold",children:"Status"}),d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[d.jsx(foe,{selectedValues:c,handleChange:f,getStatusIcon:noe,getStatusBackground:k6,getBorderColor:M6}),d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:p?"Hide filters":"More filters",children:d.jsxs(E.Box,{sx:{position:"relative",display:"inline-flex",ml:1},children:[d.jsx(E.IconButton,{"aria-label":"toggle more filters",size:"small",sx:{height:32,width:34,border:"1px solid",borderColor:t.palette.neutral.outlined.border},onClick:()=>h(L=>!L),"data-testid":"toggle-more-filters",children:d.jsx(Me,{src:"ic_filter",width:24,height:24})}),N&&d.jsx(E.Box,{sx:{position:"absolute",top:6,right:6,width:8,height:8,borderRadius:"50%",bgcolor:t.palette.primary.main}})]})})]})]}),p&&d.jsxs(d.Fragment,{children:[d.jsx(E.Box,{sx:{"& input":{width:180},"& .MuiButtonBase-root.MuiPickersDay-root":{width:40,height:40,"&.Mui-selected":{backgroundColor:t.palette.primary.main,color:t.palette.common.white},"&.Mui-selected:hover":{backgroundColor:t.palette.primary.main,color:t.palette.common.white},"&.Mui-selected:focus-visible":{backgroundColor:t.palette.primary.main,color:t.palette.common.white}},"& .MuiList-root.MuiMultiSectionDigitalClockSection-root":{width:"fit-content",display:"flex",flexDirection:"column",gap:1.5},"& .MuiMultiSectionDigitalClock-root .MuiList-root.MuiList-padding":{my:1.5},"& .MuiButtonBase-root.MuiMenuItem-root.MuiMultiSectionDigitalClockSection-item":{mx:1.5,my:0,p:.25,"&.MuiMenuItem-root.MuiMultiSectionDigitalClockSection-item":{minWidth:0,width:28,height:28,borderRadius:1},"&.Mui-selected":{backgroundColor:t.palette.primary.main,color:t.palette.common.white},"&.Mui-selected:hover":{backgroundColor:t.palette.primary.main,color:t.palette.common.white},"&.Mui-selected:focus-visible":{backgroundColor:t.palette.primary.main,color:t.palette.common.white}},"& .MuiButtonBase-root.MuiButton-root":{color:t.palette.primary.main}},children:d.jsx(Fdt,{startDate:A,endDate:g,onStartDateChange:L=>{m(L)},onEndDateChange:L=>{y(L)},acceptDateStart:L=>{O("start_date",L)},acceptDatesEnd:L=>{O("end_date",L)},startMinDateTime:Sr().subtract(1,"month").toDate(),startMaxDateTime:Sr().toDate(),endMinDateTime:Sr().subtract(1,"month").toDate(),endMaxDateTime:Sr().toDate(),clearStart:()=>v("start_date"),clearEnd:()=>v("end_date"),toolTipStartDate:"Can select upto last 30 days"})}),d.jsxs(E.Box,{children:[d.jsx(E.Typography,{variant:"xsBold",children:"Triggers"}),d.jsx(E.Box,{children:d.jsx($dt,{handleChange:C,selectedValues:T})})]})]})]}),d.jsxs(E.Stack,{mt:3,direction:"row",alignItems:"center",gap:1,children:[d.jsxs(E.Box,{sx:{position:"relative",display:"inline-flex",alignContent:"center",color:t.palette.text.tertiary},children:["Refreshes in ",e.refreshCountdown||0,"s"]}),d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:"Force Refresh",children:d.jsx(E.Box,{sx:{position:"relative",display:"inline-flex"},children:d.jsx(E.IconButton,{sx:{border:"1px solid",borderColor:t.palette.neutral.outlined.border,...Ri(t)},onClick:D,"data-testid":"refresh-button",children:d.jsx(Me,{src:"ic_refresh",width:20,height:20})})})}),d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:"Retry failed selection",children:d.jsx("span",{children:d.jsxs(E.Button,{variant:"contained",size:"small",disabled:x.length===0||_,onClick:w,"data-testid":"retry-button",sx:{padding:"6px 12px",minHeight:"32px",height:"32px",minWidth:"64px",fontSize:"14px"},children:["Retry ",x.length>0?`(${x.length})`:""]})})})]})]})})},poe="420px",Gdt=({data:e})=>{const t=E.useTheme(),[r,n]=b.useState("Payload"),[i,o]=b.useState("GUI"),[s,a]=b.useState(""),l=b.useMemo(()=>rw(e||{}),[e]),u=l?.payload,c=l?.global_variables,f=b.useMemo(()=>{const w={};return l?.http&&(w.http=l.http),l?.webhook&&(w.webhook=l.webhook),Object.keys(w).length?w:null},[l]),p=b.useMemo(()=>{const w={...l};return delete w.payload,delete w.global_variables,delete w.http,delete w.webhook,Object.keys(w).length?w:null},[l]),h=b.useMemo(()=>ol(u,s),[u,s]),A=b.useMemo(()=>ol(c,s),[c,s]),g=b.useMemo(()=>ol(f,s),[f,s]),m=b.useMemo(()=>{const w=g;if(w&&typeof w=="object"&&!Array.isArray(w)){const D=Object.keys(w);if(D.length===1&&(D[0]==="http"||D[0]==="webhook"))return w[D[0]]}return w},[g]),y=b.useMemo(()=>ol(p,s),[p,s]),O=l?.webhook?"Webhook":l?.http?"HTTP":null,v=["Payload","Global Variables",...O?[O]:[],"Miscelaneous"],T=v.includes(r)?r:v[0],C=b.useMemo(()=>{switch(T){case"Payload":return h;case"Global Variables":return A;case O:return m;case"Miscelaneous":return y;default:return h}},[T,O,h,A,m,y]),x=b.useMemo(()=>{if(Ot(C))return"{}";try{return JSON.stringify(C,null,2)}catch{return String(C)}},[C]),_=T==="Payload"||T==="Global Variables"?"{}":T.toLowerCase();return d.jsxs(E.Box,{sx:{width:"100%"},children:[d.jsxs(E.Stack,{direction:"row",sx:{...si,borderBottom:1,borderColor:"divider"},children:[d.jsx(Po,{variant:"normal",tabs:v.map(w=>({title:w})),selectedTab:T,setSelectedTab:w=>n(w),textTransform:"none",sx:{fontSize:14,mt:"8px !important",minHeight:"30px",color:"black",fontWeight:600,border:"none","& .MuiTabs-indicator":{display:"block !important",position:"relative",top:-.5,backgroundColor:t.palette.common.black,borderRadius:4},"& .MuiButtonBase-root":{mb:"3px"},"& .MuiButtonBase-root.MuiTab-root.Mui-selected":{color:t.palette.common.black+" !important"},"&.MuiTabs-root":{backgroundColor:"white !important",color:"black !important",m:0,pb:0,"& .MuiTabs-flexContainer":{gap:3}}}}),d.jsx(Po,{variant:"normal",tabs:[{title:"GUI"},{title:"Raw"}],selectedTab:i,setSelectedTab:w=>o(w),sx:{"&.MuiTabs-root":{mb:1.5,border:`1px solid ${t.palette.grey.outlined.border}`},"& .MuiButtonBase-root":{fontWeight:600}}})]}),d.jsx(E.Box,{sx:{mt:2},children:d.jsx(E.OutlinedInput,{fullWidth:!0,value:s,onChange:w=>a(w.target.value),placeholder:"Search",startAdornment:d.jsx(E.InputAdornment,{position:"start",sx:{m:0,pr:.5},children:d.jsx(Me,{src:"ic_search",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}})}),sx:{"&.MuiInputBase-root.MuiOutlinedInput-root":{pl:1}}})}),d.jsx(E.Box,{sx:{mt:1.5,height:poe,overflow:"auto"},children:i==="GUI"?Ot(C)?d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,sx:{mt:.5},children:[d.jsx(Me,{src:"ic_object",width:16,height:16}),d.jsx(E.Typography,{variant:"smNormal",color:t.palette.text.primary,children:_})]}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}),children:d.jsx(r0,{data:C,enableEllipsis:!1,highlightText:s,resetKey:T})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}),children:d.jsx(co,{height:poe,size:"lg",readOnly:!0,options:{readOnly:!0},language:"json",handleChange:()=>{},value:x,showCopyToClipboard:!0,showSuggestions:!1})})})]})},hoe={...{fontWeight:500,backgroundColor:"white",textAlign:"left","&.Mui-disabled":{opacity:1,cursor:"not-allowed",borderColor:"neutral.200","&:hover":{bg:"transparent",color:"grey.brainstem"}},"&:focus ":{color:"text.primary",backgroundColor:"white"},"&:hover":{color:"text.primary",backgroundColor:"white"},"&:focus-visible":{outline:"none"},":active":{backgroundColor:"white.smoke"},border:"1px solid",borderColor:"grey[300]",color:"grey.brainstem"}},Wdt={maxHeight:"20rem",border:"1px solid",borderColor:"neutral.300",borderRadius:2,marginTop:1.5},Aoe={"ul:nth-of-type(1)":{padding:0}},Qdt={display:"block",borderColor:"neutral.40",width:"inherit",paddingX:1.5,paddingY:.5,margin:0},zdt={flexWrap:"wrap",padding:0,":hover":{backgroundColor:"transparent"}},Xdt={color:"neutral.800"},qdt={whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},Ydt=b.forwardRef(({onOptionSelect:e,isDisabled:t,required:r,fullWidth:n,supportText:i="",width:o="100%",name:s="",label:a="",leftItem:l="",placeholder:u="",options:c,value:f="",size:p="medium",multiSelect:h=!1,valueString:A="",headerRightElement:g=null,...m},y)=>{const O=E.useTheme(),[v,T]=b.useState(f),[C,x]=b.useState(-1),[_,w]=b.useState(c),D=b.useRef(null),[I,P]=b.useState(null),k=!!I,N=(c||[]).filter($=>$.isSelected===!0).length,L=()=>{setTimeout(()=>{P(null)},0)},F=$=>{P($.currentTarget)},B=$=>{const{key:Y}=$,X=_?.length||0;if(Y==="ArrowDown")x(H=>H<X-1?H+1:H);else if(Y==="ArrowUp")x(H=>H>0?H-1:H);else if(Y==="Enter"){const H=_?.[C];Q(H)}};b.useEffect(()=>{T(f)},[f]),b.useEffect(()=>{w(c)},[c]);const Q=$=>{const Y=$?.value,X=$?.label,H=c?.find(W=>W.value===Y);h?e?.($,s):H&&(e?.($,s),T(X),L())},V=d.jsx(Me,{src:"ic_arrow_up_down",width:18,height:18,sx:{path:{fill:O.palette.text.icon}}}),q={pagination:{styles:{...hoe,paddingX:12,paddingY:8,color:v||N?"black.chinese":"grey.brainstem",borderRadius:2,width:o,justifyContent:"flex-start",gap:1,height:32},props:{variant:"xsMedium"}},medium:{styles:{...hoe,borderRadius:2,paddingX:8,paddingY:6,color:v||N?"black.chinese":"grey.brainstem",width:o,justifyContent:"flex-start",gap:1,height:32,"&.Mui-focusVisible":{border:"1px solid",borderColor:"primary.main",boxShadow:"activeShadow"}},props:{variant:"smMedium"}},large:{}},M={pagination:{styles:{...Aoe},props:{optionValueVariant:"smMedium",supportTextVariant:"xsMedium",rightElementVariant:"xsMedium"}},medium:{styles:{...Aoe},props:{optionValueVariant:"smNormal",supportTextVariant:"xsNormal",rightElementVariant:"xsNormal"}},large:{}},{props:{supportTextVariant:G="xsMedium",optionValueVariant:U="smNormal",rightElementVariant:R="xsMedium"}={},styles:j}=M[p];return d.jsxs(E.FormControl,{"aria-label":"dropdown",fullWidth:n,children:[(g||a)&&d.jsxs(E.Stack,{alignItems:"flex-start",justifyContent:g?"space-between":"flex-start",width:o,direction:"row",ref:y,children:[a&&d.jsxs(E.Typography,{sx:{...Xdt,opacity:t?.4:1},variant:"xsMedium",color:"neutral.800",children:[a,r&&d.jsx(E.Typography,{variant:"smNormal",component:"span",color:"error.50",children:" *"})]}),g]}),d.jsx(E.Button,{disabled:t,sx:{...q[p].styles,...k&&{borderColor:"primary.main",boxShadow:"activeShadow"},width:"100%",minWidth:52,"&.MuiButton-root":{textTransform:"none",padding:"8px 6px"}},ref:D,"aria-label":"more",id:"long-button","aria-controls":k?"long-menu":void 0,"aria-expanded":k?"true":void 0,"aria-haspopup":"true",onClick:F,component:"button","data-testid":`dropdown-${s||"button"}`,...(function(){const{onChange:$,...Y}=m;return Y})(),fullWidth:!0,children:d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",width:"100%",alignItems:"center",gap:1,sx:{minWidth:0},children:[d.jsxs(E.Stack,{direction:"row",gap:1,alignItems:"center",children:[l,d.jsx(E.Typography,{title:A||v||u,sx:{color:"text.primary",width:"auto",...qdt},variant:q[p].props.variant,children:A||v||u})]}),V]})}),d.jsx(E.Menu,{id:"long-menu",MenuListProps:{"aria-labelledby":"long-button"},anchorEl:I,open:k,onClose:L,sx:j,"data-testid":`dropdown-menu-${s||"options"}`,slotProps:{paper:{sx:{...Wdt,width:"fit-content"}}},onKeyDown:$=>{B($)},children:d.jsx(E.Stack,{gap:0,width:"100%",sx:{outline:"none"},children:(_||[]).map(($,Y)=>{const{value:X,label:H,leftIcon:W,rightElement:z,optionSupportText:K,isSelected:Z}=$;return d.jsx(E.MenuItem,{tabIndex:Y,role:"<option>",selected:Z===!0,sx:{...Qdt,width:"100%",backgroundColor:C===Y?"neutral.20":""},onClick:()=>Q($),title:H,"data-testid":`dropdown-option-${X||Y}`,children:d.jsxs(E.Stack,{width:"100%",onChange:()=>Q($),direction:"row",alignItems:K?"flex-start":"center",gap:8,children:[h&&d.jsx(E.Checkbox,{sx:{...zdt},icon:d.jsx(Me,{src:"ic_unchecked",width:16,height:16,sx:{path:{fill:O.palette.common.white}}}),checkedIcon:d.jsx(Me,{src:"ic_checked",width:16,height:16}),onChange:()=>Q($),checked:Z,size:"medium","data-testid":`checkbox-${X||Y}`}),W&&!h?W:null,d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",width:"100%",gap:12,children:[d.jsxs(E.Stack,{alignItems:"flex-start",children:[d.jsx(E.Typography,{sx:{color:Z?"text.primary":"neutral.plain"},variant:U,title:H,children:H}),K&&d.jsx(E.Typography,{sx:{flexWrap:"wrap",color:Z?"primary.main":"text.primary"},variant:G,children:K})]}),z&&d.jsx(E.Typography,{variant:R,sx:{color:Z?"primary.main":"neutral.80"},children:z})]})]})},X)})})}),i&&d.jsx(E.Typography,{variant:"smNormal",sx:{color:"gray.80",mt:2,opacity:t?.4:1},children:i})]})}),Kdt=e=>{const t=E.useTheme(),{name:r="",pageSizeOptions:n=[10,20,50,100],defaultPageSize:i=10,value:o={limit:0,total:0,current:0,prevPage:!1,nextPage:!1,currentPage:"",currentTotal:0,prev_id:null,next_id:null,type:"page"},mode:s=o.type,onChange:a=()=>{},onPreviousClick:l=()=>{},onNextClick:u=()=>{},visiblePagesNodeCount:c=null,isLoading:f=!1}=e,[p,h]=b.useState(o),{prev_id:A,next_id:g}=o;let m=10;i?m=i:n&&n.length>0&&(m=n[0]);const[y,O]=b.useState(m),v=n?.map(M=>({label:M.toString(),value:M.toString(),isSelected:M===y})),[T,C]=b.useState(v),x=b.useRef(!0),_={...bi,border:"1px solid",borderColor:t.palette.grey[300],borderRadius:1.25,height:32,width:32};b.useEffect(()=>{if(w(),x?.current){x.current=!1;return}else k()},[p.limit,p.current]),b.useEffect(()=>{},[c]);const w=()=>{p.current||h({...p,current:1})},D=()=>{if(p.total){if(p.current===1)return;const M=p.current?p.current-1:0;h({...p,current:M})}else l&&l()},I=()=>{if(p.total){const M=N()||1;if(p.current&&p.current>=M){h({...p,current:M});return}if(M===0){h({...p,current:0});return}const G=p.current?p.current+1:1;h({...p,current:G})}else u&&u()},P=M=>{C(T.map(G=>G.value===M.value?(h(s==="cursor"?{...p,current:1,limit:M.value,nextPage:!0,prevPage:!1,currentPage:""}:{...p,current:1,limit:Number(M.value)}),O(Number(M.value)),{...G,isSelected:!G.isSelected}):{...G,isSelected:!1}))},k=()=>{a&&a(p)},N=()=>p.limit&&p.limit>0?p.total&&Math.ceil(p.total/p.limit):0,L=()=>p.limit&&p.limit*(p.current?p.current-1:0)+1,F=()=>p.limit&&p.current&&p.total&&(p.limit*p.current<p.total?p.limit*p.current:p.total),B=()=>{let M=" ";return Q()?(M=`${L()} - ${F()}`,M+=` of ${p.total}`):p.currentTotal?M=`${p.currentTotal} ${r}`:M="",M},Q=()=>!!p.total,V=p.total&&p.current>1||A,q=p.total&&p.current&&p.current<(N()||0)||g;return d.jsx(E.Stack,{children:f?d.jsx(E.Stack,{direction:"row",justifyContent:"flex-end",children:d.jsx(E.Skeleton,{height:"3rem",width:"20rem"})}):d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"flex-end",sx:{position:"sticky",bottom:0,background:M=>M.palette.common.white,color:"text.secondary"},"data-testid":"pagination-container",children:[d.jsxs(E.Stack,{direction:"row",flex:1,justifyContent:"flex-end",gap:1,alignItems:"center",children:[d.jsx(E.Typography,{variant:"smNormal",children:"Rows per page:"}),d.jsx(Ydt,{value:y.toString(),options:T,onOptionSelect:P,placeholder:"Page Size",width:"3.125rem",size:"pagination","data-testid":"pagination-dropdown"})]}),s==="page"&&d.jsx(E.Typography,{variant:"smNormal","data-testid":"pagination-count",mx:1.5,my:.75,children:B()}),d.jsxs(E.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[d.jsx(E.Box,{ml:1,onClick:V?D:void 0,sx:{cursor:V?"pointer":"not-allowed",opacity:V?1:.4,..._},"data-testid":"btnPrevious",children:d.jsx(Me,{src:"ic_arrow_left",height:"1.25rem",width:"1.25rem",sx:{cursor:V?"pointer":"not-allowed",opacity:V?1:.4,path:{fill:t.palette.neutral.plain}}})}),d.jsx(E.Box,{onClick:q?I:void 0,sx:{cursor:q?"pointer":"not-allowed",opacity:q?1:.4,..._},"data-testid":"btnNext",children:d.jsx(Me,{src:"ic_arrow_right",height:"1.25rem",width:"1.25rem",sx:{cursor:q?"pointer":"not-allowed",path:{fill:t.palette.neutral.plain}}})})]})]})})},Zdt=b.memo(Kdt),Jdt=({columns:e,rows:t,id:r,isLoading:n,isTableLoading:i=!1,pageProps:o,setPageProps:s,emptyPageProps:a={},dataTestid:l="",height:u,tableHeader:c,showHeader:f=!1,customEmptyPage:p=null,onRowClick:h=()=>{},onPaginationChange:A=null,getRowSx:g=null,getRowTooltip:m=null})=>{const{items:y=[],page:{current:O=1,has_next:v=!1,has_previous:T=!1,item_total:C=0,size:x=10,prev_id:_=null,next_id:w=null,type:D="page"}={}}=t||{},I={id:"1",name:"Pages",value:{limit:x,total:C,current:O,prevPage:T,nextPage:v,currentPage:"",currentTotal:C,prev_id:_,next_id:w,type:D},defaultPageSize:o.per_page,visiblePagesNodeCount:10,onChange:P=>{const{limit:k,current:N}=P;s(D==="cursor"?{...o,per_page:k,prev_id:null,next_id:null}:{...o,per_page:k,page:N})},onPreviousClick:()=>{A?A("previous",{prev_id:_,next_id:null}):T&&D==="page"?s({...o,page:o.page-1}):D==="cursor"&&s({...o,prev_id:_,next_id:null})},onNextClick:()=>{A?A("next",{prev_id:null,next_id:w}):v&&D==="page"?s({...o,page:o.page+1}):D==="cursor"&&s({...o,prev_id:null,next_id:w})},isLoading:i};return d.jsxs(E.Stack,{children:[c&&(f||y.length>0&&!n&&!i)&&d.jsx(E.Stack,{pb:2,children:c}),(y.length>0||n||i)&&d.jsx(E.TableContainer,{sx:{overflow:"auto",display:"flex",flexDirection:"column",justifyContent:"space-between",width:"100%",height:u||"100%",background:P=>P.palette.common.white,borderRadius:2,border:P=>`1px solid ${P.palette.grey.outlined.border}`},"data-testid":l,children:d.jsxs(E.Table,{stickyHeader:!0,sx:{width:"100%"},children:[d.jsx(E.TableHead,{"data-id":"table-header",children:d.jsx(E.TableRow,{children:e?.map((P,k)=>d.jsx(E.TableCell,{width:P.width||"auto",sx:{px:2,py:"0",height:44,textAlign:k===e.length-1?"right":"left",backgroundColor:N=>N.palette.white.smoke,borderBottom:N=>`1px solid ${N.palette.grey.outlined.border}`},children:typeof P.renderHeader=="function"?P.renderHeader({rows:y}):d.jsx(E.Typography,{sx:{letterSpacing:"normal",fontWeight:600},variant:"xsSemiBold",color:N=>N.palette.text.primary,children:P.headerName})},r+P.field))})}),d.jsx(E.TableBody,{sx:{overflow:"auto"},children:i?[...Array(10)].map((P,k)=>d.jsx(E.TableRow,{"data-testid":"table-skeleton-row",children:[...Array(e.length)].map((N,L)=>d.jsx(E.TableCell,{children:d.jsx(E.Skeleton,{height:"auto",width:"auto"})},"dataSkeleton"+L))},"rowSkeleton"+k)):y?.length>0&&y?.map((P,k)=>{const N=m?m(P):"",L=d.jsx(E.TableRow,{hover:!0,"data-id":`table-row-${P.id}`,onClick:()=>{h(P)},sx:{cursor:h?"pointer":"auto",...g?g(P):{}},children:e.map((F,B)=>d.jsx(E.TableCell,{sx:{px:2,py:1.25,color:"text.secondary","& .MuiTypography-root":{justifyContent:B===e.length-1?"right":"left"}},children:F.renderCell?F.renderCell({row:P,value:P[F.field]}):P[F.field]},F.field))},"tableRow"+(P.id||k));return N?d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:N,children:L},"tableRowTooltip"+(P.id||k)):L})})]})}),y.length===0&&!n&&!i&&(p||d.jsx(E.Stack,{sx:{margin:"0 auto",bg:"white",height:"100%",width:"100%",borderRadius:"0 0 1.5rem 1.5rem",justifyContent:"center",alignItems:"center"},children:d.jsx(soe,{title:a.title||"No data available",subtitle:a.description||"","data-id":"table-empty-page"})})),y.length>0&&o&&d.jsx(E.Stack,{p:1.5,children:d.jsx(Zdt,{...I,"data-id":"table-pagination"})})]})},eft=({VORTEX_MAIN_URL:e,ENTITY_ID:t})=>{const[r,n]=b.useState({data:[],pagination:{per_page:10,prev_id:null,next_id:null},loading:!1}),[i,o]=b.useState([]),[s,a]=b.useState([]),l=(f=[])=>f.map(p=>{const h=p?.status,A=p?.meta?.system_retried||p?.meta?.user_retried?"1":"0",g=p?.execution_mode||"";return`${p?.id}|${h}|${A}|${g}|${p?.created_at}`}).join("::"),u=b.useCallback(async(f,p)=>{const h=p?.silent===!0;h||n(A=>({...A,loading:!0}));try{if(!e){n({data:[],pagination:{per_page:f?.per_page||10,prev_id:null,next_id:null},loading:!1});return}const A=Yt(e,`/v1.0/${t}`,"/executions"),m={...f,...s.length?{workflow_ids:s}:{}},y=await qt.get(A,{params:m}),O=y?.data?.data||[],v=y?.data?.pagination||{per_page:f?.per_page||10,prev_id:null,next_id:null};if(h&&p?.compareWith){const T=l(p.compareWith),C=l(O);if(T===C){n(x=>({...x,loading:!1}));return}}n({data:O,pagination:v,loading:!1})}catch{n({data:[],pagination:{per_page:f?.per_page||10,prev_id:null,next_id:null},loading:!1})}},[e,t,s]),c=b.useCallback(async()=>{if(!(!e||!t))try{const f=Yt(e,`/v1.0/${t}`,"/workflows"),A=((await qt.get(f,{params:{page:1,per_page:999,all:!0}}))?.data?.data||[]).map(g=>({id:g?.id,name:g?.name,status:g?.status,version:g?.version}));o(A)}catch{o([])}},[e,t]);return{altExecutions:r,setAltExecutions:n,fetchAlternateExecutions:u,workflowsOptions:i,fetchWorkflowsOptions:c,selectedWorkflowIds:s,setSelectedWorkflowIds:a}},tft=(e,t=15)=>{const[r,n]=b.useState(t),i=b.useRef(null);b.useEffect(()=>(i.current&&window.clearInterval(i.current),n(t),i.current=window.setInterval(()=>{n(s=>s<=1?(e(),t):s-1)},1e3),()=>{i.current&&window.clearInterval(i.current),i.current=null}),[e,t]);const o=b.useCallback(()=>{n(t)},[t]);return{refreshCountdown:r,resetCountdown:o}},moe=e=>{const r=new URLSearchParams(window.location.search).get("source")?.toLowerCase(),i=N4(e).split("/");return i.pop(),`${i.join("/")}${r?`?source=${r}`:""}`},rft=e=>z4.includes(e),Wx=e=>e?.workflow_id||e?.workflowId||e?.workflow?.id||null,nft=e=>!!e?.meta?.system_retried||!!e?.meta?.user_retried,goe=(e=[])=>e.map(t=>{const r=t?.status,n=t?.meta?.system_retried||t?.meta?.user_retried?"1":"0",i=t?.execution_mode||"";return`${t?.id}|${r}|${n}|${i}|${t?.created_at}`}).join("::"),Eoe=e=>e?new Date(e*1e3).toISOString():"",ift=(e,t,r,n,i,o,s,a,l,u)=>{const c=E.useTheme(),p=new URLSearchParams(window.location.search).get("source")?.toLowerCase(),h=moe(window.location.pathname);return b.useMemo(()=>[{label:e?.name,path:e?.status!=="draft"?`/accounts/${s}/workflow-builder/${e?.status}/${e?.meta.draft_id}/version/${t}${p?`?source=${p}`:""}`:`/accounts/${s}/workflow-builder/draft/${t}${p?`?source=${p}`:""}`,color:c.palette.text.primary,textStyle:"mdNormal"},{label:r!=="Draft"?`Version ${r}`:"Draft",path:e?.status!=="draft"?`/accounts/${s}/workflow-builder/${e?.status}/${e?.meta.draft_id}/version/${t}${p?`?source=${p}`:""}`:`/accounts/${s}/workflow-builder/draft/${t}${p?`?source=${p}`:""}`,color:c.palette.text.primary,textStyle:"mdNormal"},{label:"Execution history",path:o?h:void 0,color:i?c.palette.text.primary:c.palette.neutral.solid.bg,textStyle:"mdNormal",onClick:()=>{l(!1),u(!0),a(h)}},...i?[{label:`${n} (${t===e?.meta?.draft_id?"Draft":r})`,color:c.palette.neutral.solid.bg,textStyle:"mdNormal",onClick:()=>u(!1)}]:[]],[e,t,r,n,i,o,s,p,c,h,a,l,u])},oft=(e,t,r,n,i,o,s,a,l)=>{const u=At.useDispatch(),[c,f]=b.useState(null),[p,h]=b.useState(!0),[A,g]=b.useState(!1),[m,y]=b.useState(!1),O=b.useRef(!1),v=b.useRef(!1),T=b.useCallback(async(x,_)=>{const w=!!_?.silent,D=!!_?.isPagination,I={...i.current,execution_source:"full",...x||{}};if(!n&&!e){f("Workflow id not found in the current URL."),h(!1),g(!1);return}w||(O.current=!0,v.current=D,D||h(!0));try{if(n){await o(I,{silent:w,compareWith:s.current}),w||(f(null),y(!0),D?g(!1):h(!1));return}const P=l??e;if(w){const k=Yt(t,`/v1.0/${r}/`,`workflows/executions/${P}`),N=await qt.get(k,{params:I}),L=N?.data?.data||[],F=N?.data?.pagination,B=goe(s.current),Q=goe(L);B!==Q&&u({type:Dr.FETCH_EXECUTIONS_BY_WORKFLOW_ID_SUCCESS,payload:{data:L,pagination:F}}),f(null),y(!0)}else u(Yp(P,I,t,r,a)),f(null)}catch(P){const k=B4(P)||"Unable to fetch executions. Please try again.";f(k),y(!0),w||(D?g(!1):h(!1))}},[n,r,e,t,u,a,o,i,s,l]),C=At.useSelector(x=>x.workflows.executions.loading);return b.useEffect(()=>{n||O.current&&(C===!1?(h(!1),g(!1),y(!0),v.current=!1):v.current||h(!0))},[C,n]),{runFetchListing:T,fetchError:c,setFetchError:f,isLoading:p,setIsLoading:h,isExecutionsLoading:A,setIsExecutionsLoading:g,initialLoadComplete:m,setInitialLoadComplete:y,hasRequestedRef:O}},sft=(e,t,r,n,i,o,s,a,l,u,c,f,p,h)=>{const A=At.useDispatch(),g=b.useCallback(T=>{const C=T.target.value,x=typeof C=="string"?C.split(","):C,_=x.length===0?[]:x;i(_),t(w=>({...w,status:_})),n({status:x.length>0?x.join(","):null}),r()},[i,t,n,r]),m=b.useCallback(T=>{const C=async()=>{if(c){const _={...e.current,execution_id:T,...p.length?{workflow_ids:p}:{}};await f(_)}else await A(Yp(a,{...e.current,execution_id:T,execution_source:"full"},l,u,h));r()},x=_=>{t(w=>({...w,execution_id:_})),s(_)};if(T===""){x(""),n({executionIdSingle:null}),C();return}cb(T)?(n({executionIdSingle:T}),x(T),C()):A({type:Qr,payload:{open:!0,title:"Invalid Execution Id",type:"error"}})},[A,a,l,u,c,f,p,h,e,t,s,n,r]),y=b.useCallback((T,C)=>{const x=T.target.value,_=typeof x=="string"?x.split(","):x,w=C?.props?.value,D=cue.map(I=>I.value);if(w==="all")_.includes("all")?o(D):o([]),t(I=>({...I,type:"all"}));else if(_.includes("test")&&_.includes("automatic")&&_.includes("scheduled"))o(D),t(I=>({...I,type:"all"}));else{const I=_.filter(P=>P!=="all");o(I),t(P=>({...P,type:I.length===0||I.includes("all")?"all":I}))}n({type:_.length>0?_.join(","):null}),r()},[o,t,n,r]),O=b.useCallback((T,C,x)=>{const _=x(T,C);n({[T==="start_date"?"startDate":"endDate"]:_?_.toString():null}),r()},[n,r]),v=b.useCallback((T,C,x)=>{T==="start_date"?C(null):x(null),t(_=>({..._,[T]:""})),n(T==="start_date"?{startDate:null}:{endDate:null}),r()},[t,n,r]);return{handleStatusChange:g,handleExecutionSearch:m,handleExecutionTypeChange:y,handleDateChange:O,clearDates:v}},aft=(e,t,r,n,i)=>{const o=At.useDispatch(),[s,a]=b.useState(!1),[l,u]=b.useState(new Set),c=b.useCallback(h=>{!h||h.length===0||(u(A=>new Set([...A,...h])),window.setTimeout(()=>{u(A=>{const g=new Set(A);return h.forEach(m=>g.delete(m)),g})},1e4))},[]),f=b.useCallback(async h=>{if(h.length!==0){a(!0);try{const A=new Map(r.map(x=>[x.id,x])),g={};h.forEach(x=>{const _=A.get(x),w=Wx(_)||t;w&&(g[w]||(g[w]=[]),g[w].push(x))});const m=await Promise.all(Object.entries(g).map(([x,_])=>e(_,x)));c(h);const y=m.filter(x=>x.success).reduce((x,_)=>x+(_.ids?.length||0),0),O=h.length-y,v=m.filter(x=>!x.success);let T="",C="success";if(O===0)T=`Retry Initiated for ${y} execution(s)`,C="success";else{const x=v.find(_=>_.error&&(_.error.message||_.error.code));if(x?.error){const _=x.error;_.code===402?T=`${_.message}`:_.message?T=_.message:T=`Retry failed: ${JSON.stringify(_)}`}else T=`Retry failed for ${O} execution(s)`;C="error"}o({type:Qr,payload:{open:!0,title:T,type:C}})}finally{a(!1),n(),i(void 0,{silent:!0})}}},[e,t,r,n,i,c,o]),p=b.useCallback(async(h,A)=>{const g=Wx(A),m=await e([h],g);let y="",O="success";if(m.success)y="Retry Initiated for 1 execution(s)",O="success";else{if(m.error&&(m.error.message||m.error.code)){const v=m.error;v.code===402?y=`${v.message}`:v.message?y=v.message:y=`Retry failed: ${JSON.stringify(v)}`}else y="Retry failed";O="error"}o({type:Qr,payload:{open:!0,title:y,type:O}}),c([h])},[e,c,o]);return{isRetrying:s,cooldownIds:l,retrySelected:f,retrySingle:p}},lft=()=>{const e={per_page:10,next_id:null,prev_id:null,type:"all"},[t,r]=b.useState(e),n=b.useRef(t);b.useEffect(()=>{n.current=t},[t]);const[i,o]=b.useState(null),[s,a]=b.useState(null),[l,u]=b.useState([]),[c,f]=b.useState([]),[p,h]=b.useState(!1),[A,g]=b.useState(""),[m,y]=b.useState(!1);return{state:t,setState:r,stateRef:n,selectedStartDate:i,setSelectedStartDate:o,selectedEndDate:s,setSelectedEndDate:a,selectedValues:l,setSelectedValues:u,selectedModes:c,setSelectedModes:f,showAdvancedFilters:p,setShowAdvancedFilters:h,executionIdSingle:A,setExecutionIdSingle:g,paramsProcessed:m,setParamsProcessed:y,resetIds:()=>{r(T=>({...T,prev_id:null,next_id:null}))},updateDate:(T,C)=>{const x=C?Sr(C).unix():null,_=T==="start_date"?"start_date":"end_date";return r(C?w=>({...w,[_]:x}):w=>{const{[_]:D,...I}=w;return I}),x}}},uft=(e,t,r,n,i,o)=>{const[s,a]=b.useState({}),l=b.useRef({});b.useEffect(()=>{l.current=s},[s]);const[u,c]=b.useState({}),f=b.useCallback(async A=>{const g=Wx(A)||e;if(!(!g||!t||!r)){c(m=>({...m,[A.id]:{loading:!0,items:m[A.id]?.items||[]}}));try{const m=Mne(t,r,g,A.id),O=((await qt.get(m))?.data?.data||[]).map((v,T)=>({...v,_isChild:!0,_parentId:A.id,_parentStatus:A.status,_retryIndex:T+1}));c(v=>({...v,[A.id]:{loading:!1,items:O}}))}catch{c(m=>({...m,[A.id]:{loading:!1,items:[]}}))}}},[e,t,r]),p=b.useCallback(A=>{const g=!s[A.id];a(m=>({...m,[A.id]:!m[A.id]})),g&&f(A)},[s,f]),h=b.useCallback(async()=>{const A=Object.keys(l.current).filter(g=>l.current[g]);if(A.length>0){const m=((n?i?.data:o?.data)||[]).filter(y=>A.includes(y.id));await Promise.all(m.map(y=>f(y)))}},[n,i?.data,o?.data,f]);return{expandedRowIds:s,rowRetriesMap:u,toggleExpandRow:p,refreshExpandedRetries:h}},cft=e=>{const t=b.useCallback(i=>{const o=new URLSearchParams(window.location.search);Object.entries(i).forEach(([l,u])=>{u===null||u===""?o.delete(l):o.set(l,u)});const a=`${N4(window.location.pathname)}?${o.toString()}`;e?e(a,{replace:!0}):window.history.replaceState(null,"",`${window.location.pathname}?${o.toString()}`)},[e]),r=b.useCallback(i=>new URLSearchParams(window.location.search).get(i),[]),n=b.useCallback(()=>new URLSearchParams(window.location.search),[]);return{updateURLParams:t,getUrlParam:r,getAllUrlParams:n}},dft=(e,t,r,n,i,o,s,a,l,u,c,f)=>{b.useEffect(()=>{try{const p={};[{key:"status",stateKey:"status",setter:t},{key:"type",stateKey:"type",setter:r},{key:"workflow_ids",stateKey:"workflow_ids",setter:n},{key:"executionIdSingle",stateKey:"execution_id",setter:y=>i(y[0]||"")}].forEach(({key:y,stateKey:O,setter:v})=>{const T=e.get(y);let C=[];if(T)try{const x=JSON.parse(T);Array.isArray(x)&&(C=x.filter(Boolean))}catch{C=T.split(",").filter(Boolean)}C.length&&(v(C),p[O]=C)}),["startDate","endDate"].forEach(y=>{const O=e.get(y);if(O){const v=Sr.unix(parseInt(O)).toDate();y==="startDate"?(o(v),p.start_date=parseInt(O)):(s(v),p.end_date=parseInt(O))}}),i(e.get("executionIdSingle")||"");const A=typeof window<"u"?window.location.pathname:"",g=/\/executions\/[^/?#]+/.test(A),m=!!e.get("executionId");a(!!f||g||m),l(e.get("fromListing")==="true"),u(y=>({...y,...p}))}catch{}finally{c(!0)}},[])},fft=e=>{const t=E.useTheme(),r=At.useDispatch(),{WORKFLOW_URLS:n,ENTITY_ID:i,analytics:o}=_i(),{VORTEX_MAIN_URL:s}=n,a="This execution failed before the workflow could start due to a temporary infrastructure issue. Execution logs are unavailable, use the view icon to see the payload it was triggered with.",{executionId:l="",token:u,api:c,navigate:f,isAccountLevel:p=!1,currentSubscription:h,openUpgradeModal:A}=e,{executions:g}=At.useSelector(xt=>xt.workflows),{workflow:m}=At.useSelector(xt=>xt.workflows),{versions:y}=At.useSelector(xt=>xt.workflows),O=m8(),{updateURLParams:v,getAllUrlParams:T}=cft(f),C=T(),x=new URLSearchParams(window.location.search),_=x.get("source")?.toLowerCase(),{state:w,setState:D,stateRef:I,selectedStartDate:P,setSelectedStartDate:k,selectedEndDate:N,setSelectedEndDate:L,selectedValues:F,setSelectedValues:B,selectedModes:Q,setSelectedModes:V,showAdvancedFilters:q,setShowAdvancedFilters:M,executionIdSingle:G,setExecutionIdSingle:U,paramsProcessed:R,setParamsProcessed:j,resetIds:$,updateDate:Y}=lft(),[X,H]=b.useState(!1),[W,z]=b.useState(!0),[K,Z]=b.useState(""),[se,ne]=b.useState(!1),[le,Oe]=b.useState(null),[ve,ae]=b.useState(null),{selectedExecutionIds:ie,setSelectedExecutionIds:te,clearSelection:J,retryExecutions:re}=ooe({workflowId:O??void 0,VORTEX_MAIN_URL:s,ENTITY_ID:i}),{altExecutions:ue,fetchAlternateExecutions:pe,workflowsOptions:Ae,fetchWorkflowsOptions:fe,selectedWorkflowIds:xe,setSelectedWorkflowIds:Ee}=eft({VORTEX_MAIN_URL:s,ENTITY_ID:i}),ye=p?ue:g,Fe=b.useRef([]);b.useEffect(()=>{Fe.current=(p?ue?.data:g?.data)||[]},[p,ue?.data,g?.data]);const{expandedRowIds:ze,rowRetriesMap:je,toggleExpandRow:rt,refreshExpandedRetries:it}=uft(O,s,i,p,ue,g);dft(C,B,V,Ee,U,k,L,H,ne,D,j,l);const{runFetchListing:et,fetchError:Pe,setFetchError:Ue,isExecutionsLoading:Ge,setIsExecutionsLoading:ge,isLoading:Se,initialLoadComplete:we}=oft(O,s,i,p,I,pe,Fe,o,le);b.useEffect(()=>{if(!R||!w||!i||!p&&!O)return;const xt=!!(w?.next_id||w?.prev_id||w?.start_date||w?.end_date);et(void 0,{isPagination:xt})},[w?.type,w?.status,w?.end_date,w?.start_date,w?.per_page,w?.next_id,w?.prev_id,O,s,i,R,p,et]),b.useEffect(()=>{p&&fe()},[p,fe]);const ee={page:1,per_page:999};b.useEffect(()=>{if(p)return;const xt=m?.meta?.workflow_id||O;xt&&s&&i&&r(Cf(ee,xt,s,i))},[m?.meta?.workflow_id,O,s,i,r,p]),b.useEffect(()=>{if(p||le)return;const xt=y?.data?.data||[];if(!xt||xt.length===0)return;const Jt=O,hr=xt.find(Jr=>String(Jr.id)===String(Jt));if(hr){Oe(hr.id);return}Oe(xt[0]?.id??null)},[y?.data,O,p,le]),b.useEffect(()=>{const xt=le||O;!p&&xt&&s&&i&&r(X4(xt,s,i))},[p,O,le,s,i,r]),b.useEffect(()=>{if(m){const xt=m?.status,Jt=m?.version;Z(xt==="draft"?"Draft":Jt)}},[m]),b.useEffect(()=>{if(p||!le)return;const Jt=(y?.data?.data||[]).find(hr=>String(hr.id)===String(le));if(Jt){const hr=Jt.status==="draft"?"Draft":Jt.version;Z(hr)}},[le,y?.data,p]),(!c||Ot(c))&&u&&JE(u),c&&eO(c),b.useEffect(()=>{J()},[g?.data,ue?.data,w?.next_id,w?.prev_id,w?.per_page,J]);const de=b.useCallback(()=>{if(h&&Array.isArray(h)&&(h?.[0]?.status==="EXPIRED"||h?.[0]?.status==="CANCELLED")){typeof A=="function"&&A();return}Ue(null),et(),it()},[et,it,Ue]),{refreshCountdown:Ce}=tft(b.useCallback(()=>{et(void 0,{silent:!0}),it()},[et,it]),15),{data:He=[]}=ye||{data:{}},{isRetrying:$e,cooldownIds:Ve,retrySelected:Ye,retrySingle:Tt}=aft(re,O,He,J,et),{handleStatusChange:Ie,handleExecutionSearch:nt,handleExecutionTypeChange:at,clearDates:vt}=sft(I,D,$,v,B,V,U,O,s,i,p,pe,xe,o),wt=b.useCallback(xt=>{ge(!0),vt(xt,k,L)},[vt,k,L,ge]),Wt=b.useCallback(xt=>{if(h&&Array.isArray(h)&&(h?.[0]?.status==="EXPIRED"||h?.[0]?.status==="CANCELLED")){typeof A=="function"&&A();return}if(!xt?.id||xt?.meta?.failed_before_start)return;const{id:Jt,workflow_id:hr}=xt,Jr=hr??le??O;if(!Jr)return;const dn=xt?._isChild&&xt._parentId||Jt,pn=xt?._isChild?xt._parentStatus:xt?.status,ar=`/accounts/${i}/workflow-builder/workflow/${Jr}/executions/${Jt}?parentExecutionId=${dn}&parentExecutionStatus=${pn}`;if(p){window.open(Od(ar),"_blank");return}U(""),D(_r=>{const{execution_id:bn,...Ft}=_r;return Ft}),v({executionIdSingle:null}),H(!0),z(!1),f?f(ar):window.open(Od(ar),"_blank")},[O,le,i,p,f,U,D,v,h,A]),It=pdt({theme:t,workflowId:O??void 0,selectedExecutionIds:ie,setSelectedExecutionIds:te,isRetrying:$e,isRetryableStatus:rft,getRowWorkflowId:Wx,hasRetriesAvailable:nft,expandedRowIds:ze,toggleExpandRow:rt,retrySingle:Tt,cooldownIds:Ve,currentSubscription:h,openUpgradeModal:A,onViewPayload:ae}),{pagination:{per_page:Le=10,prev_id:ot=null,next_id:lt=null}={}}=ye||{},Qe=b.useMemo(()=>{const xt=[];return(He||[]).forEach(Jt=>{if(xt.push({...Jt,isChild:!1,run_id:Jt?.run_id||Jt?.id}),ze[Jt.id]&&je[Jt.id]?.items?.length){const hr=je[Jt.id].items.map(Jr=>({...Jr,isChild:!0,run_id:Jr?.run_id||Jr?.id}));xt.push(...hr)}}),xt},[He,ze,je]),dt=b.useCallback((xt,Jt)=>{ge(!0),xt==="start_date"?k(Jt):L(Jt);const hr=Y(xt,Jt);v({[xt==="start_date"?"startDate":"endDate"]:hr?hr.toString():null}),$()},[Y,v,$,k,L,ge]);b.useEffect(()=>{!R||!i||p||!le&&!O||(ge(!0),et(void 0,{isPagination:!0}))},[le]);const Et=x.get("parentExecutionId")||null,Lt=x.get("parentExecutionStatus")||null,De=b.useCallback(()=>{H(!1),z(!0),f(l?moe(window.location.pathname):O?se?`/accounts/${i}/workflow/workflow-builder?size=20&page=1&${_?`source=${_}`:""}`:m?.status!=="draft"?`/accounts/${i}/workflow-builder/${m?.status}/${m?.meta.draft_id}/version/${O}${_?`?source=${_}`:""}`:`/accounts/${i}/workflow-builder/draft/${O}${_?`?source=${_}`:""}`:`/accounts/${i}/workflow/workflow-builder${_?`?source=${_}`:""}`)},[l,O,se,_,i,m,f,H,z]),Ze=ift(m,le||O,K,l,X,W,i,f,H,z),tt=w?.type==="all"&&Ot(w?.status)&&!w?.end_date&&!w?.start_date,Be=b.useCallback((xt,Jt)=>{ge(!0),D(hr=>({...hr,...Jt}))},[]),ct=!we&&!!Se,yt=b.useRef(!1);return b.useEffect(()=>{ct&&(yt.current=!0)},[ct]),b.useEffect(()=>{ct||ge(!1)},[ct,ge]),Pe&&!ct?d.jsx(E.Stack,{height:"100%",alignItems:"center",justifyContent:"center",children:d.jsx(Ec,{title:"Unable to load executions",description:Pe,icon:d.jsx(Me,{src:"ic_error",width:80,height:80}),buttonElement:d.jsx(E.Button,{variant:"contained",onClick:()=>{Ue(null),de()},children:"Retry"})})}):d.jsxs(E.Stack,{height:"100%",overflow:"hidden !important",children:[d.jsx(a5,{}),d.jsx(Ao,{open:!!ve,handleClose:()=>ae(null),variant:"xlarge",title:"Trigger payload",subtitle:"This execution failed before it could start, so run logs aren't available.",content:d.jsx(Gdt,{data:ve?.meta?.request_body})}),ct?d.jsx(E.Stack,{alignItems:"center",justifyContent:"center",sx:{flex:1,minHeight:"calc(100vh - 200px)",width:"100%"},children:d.jsx(pi,{size:60})}):d.jsxs(d.Fragment,{children:[!p&&d.jsx(Mdt,{crumbs:Ze,onBack:De,navigate:f}),X?d.jsx(Ldt,{executionId:l,parentExecutionId:Et,parentExecutionStatus:Lt}):d.jsx(E.Stack,{m:3,gap:2,children:d.jsx(Jdt,{rows:{items:Qe,page:{size:Le,prev_id:ot,next_id:lt,type:"cursor"}},showHeader:!0,onRowClick:xt=>{Wt(xt)},getRowSx:xt=>xt?.meta?.failed_before_start?{cursor:"not-allowed",opacity:.85}:{},getRowTooltip:xt=>xt?.meta?.failed_before_start?a:"",tableHeader:d.jsxs(E.Stack,{children:[d.jsx(Vdt,{isAccountLevel:p,workflowsOptions:Ae,selectedWorkflowIds:xe,setSelectedWorkflowIds:Ee,onWorkflowsChange:xt=>{D(Jt=>({...Jt,workflow_ids:xt.length?xt:void 0,next_id:null,prev_id:null})),v({workflow_ids:xt.length?JSON.stringify(xt):null}),et({workflow_ids:xt.length?xt:void 0,next_id:null,prev_id:null})},executionIdSingle:G,setExecutionIdSingle:U,onExecutionSearch:nt,selectedValues:F,onStatusChange:Ie,showAdvancedFilters:q,setShowAdvancedFilters:M,selectedStartDate:P,selectedEndDate:N,setSelectedStartDate:k,setSelectedEndDate:L,onDateChange:dt,clearDates:wt,selectedModes:Q,onExecutionTypeChange:at,selectedExecutionIds:ie,isRetrying:$e,onRetrySelected:()=>Ye(ie),onRefresh:de,refreshCountdown:Ce,versionsOptions:y?.data?.data||[],selectedVersionId:le,onVersionChange:xt=>{Oe(xt),ge(!0),D(Jt=>({...Jt,next_id:null,prev_id:null}))}}),!p&&d.jsx(ddt,{dashboardId:"boltic-workflow-overview",workflowId:O,startDate:Eoe(w?.start_date),endDate:Eoe(w?.end_date)})]}),height:p?"calc(60vh + 2.5rem)":"calc(55vh + 2.5rem)",columns:It,isLoading:p?!!ue?.loading:!!g.loading,isTableLoading:Ge,pageProps:w,setPageProps:D,onPaginationChange:Be,id:"executions-listing",customEmptyPage:!!we&&He.length===0&&G.length===0&&tt&&!p&&d.jsx(ioe,{workflowId:O??null,executionId:l,state:w,onRefresh:()=>et()})||p&&!!we&&d.jsx(ioe,{workflowId:O??null,executionId:l,state:w,height:"calc(100vh - 20rem)",onRefresh:()=>et()}),dataTestid:"execution-listing-table"})})]})]})},pft=e=>{const{WORKFLOW_URLS:t,ENTITY_ID:r,navigate:n,TOKEN:i,api:o,openIntegrationDrawer:s,INTEGRATION_DATA:a,SET_INTEGRATION_DATA:l,analytics:u,USER_DATA:c,ALERT_TOP_BAR:f,currentSubscription:p,pro_integration:h,allowedAccount:A,openUpgradeModal:g,openAddonModal:m}=e;return JE(i),eO(o),d.jsx(b.StrictMode,{children:d.jsx(At.Provider,{store:zp,children:d.jsx(out,{ALERT_TOP_BAR:f,currentSubscription:p,WORKFLOW_URLS:t,ENTITY_ID:r,openIntegrationDrawer:s,navigate:n,TOKEN:i,INTEGRATION_DATA:a,SET_INTEGRATION_DATA:l,analytics:u,USER_DATA:c,pro_integration:h,allowedAccount:A,openUpgradeModal:g,openAddonModal:m})})})},hft=e=>{const{ENTITY_ID:t,WORKFLOW_URLS:r,navigate:n,Api:i,TOKEN:o,analytics:s,isAccountLevel:a,currentSubscription:l,openUpgradeModal:u,USER_DATA:c}=e,f=At.useSelector(p=>p.customization);return d.jsx(E.ThemeProvider,{theme:e8(f),children:d.jsx(D_,{analytics:s,WORKFLOW_URLS:r,ENTITY_ID:t,userData:c,currentSubscription:l,children:d.jsx(Pt.ReactFlowProvider,{children:d.jsx(fft,{navigate:n,token:o,api:i,isAccountLevel:a??!1,currentSubscription:l,openUpgradeModal:u})})})})},Aft=e=>{const{TOKEN:t,api:r}=e;return JE(t),eO(r),d.jsx(b.StrictMode,{children:d.jsx(At.Provider,{store:zp,children:d.jsx(hft,{...e})})})},mft=e=>{const{ENTITY_ID:t,WORKFLOW_URLS:r,openIntegrationDrawer:n,INTEGRATION_DATA:i,SET_INTEGRATION_DATA:o,selectedNode:s,handleBlockDrawerClose:a,onSubmit:l,drawerWidth:u,setSelectedNode:c,initialState:f,MCP_INTEGRATION_FORM:p,actionRef:h}=e,A=At.useSelector(g=>g.customization);return d.jsx(E.ThemeProvider,{theme:e8(A),children:d.jsx(D_,{analytics:{},WORKFLOW_URLS:r,ENTITY_ID:t,children:d.jsx(Pt.ReactFlowProvider,{children:d.jsx(Zte,{selectedNode:s,onClose:a,onSubmit:l,drawerWidth:u,openIntegrationDrawer:n,initialState:f,setSelectedNode:c,INTEGRATION_DATA:i,SET_INTEGRATION_DATA:o,MCP_INTEGRATION_FORM:p,actionRef:h})})})})},gft=e=>{const{TOKEN:t,api:r}=e;return JE(t),eO(r),d.jsx(b.StrictMode,{children:d.jsx(At.Provider,{store:zp,children:d.jsx(mft,{...e})})})};as.ExecutionData=Aft,as.IntegrationForm=gft,as.WorkflowBuilder=pft,Object.defineProperty(as,Symbol.toStringTag,{value:"Module"})}));
681
+ `+i):r.stack=i}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Fp(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;r!==void 0&&Gx.assertOptions(r,{silentJSONParsing:lc.transitional(lc.boolean),forcedJSONParsing:lc.transitional(lc.boolean),clarifyTimeoutError:lc.transitional(lc.boolean)},!1),n!=null&&(Mt.isFunction(n)?t.paramsSerializer={serialize:n}:Gx.assertOptions(n,{encode:lc.function,serialize:lc.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Gx.assertOptions(t,{baseUrl:lc.spelling("baseURL"),withXsrfToken:lc.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&Mt.merge(i.common,i[t.method]);i&&Mt.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),t.headers=ba.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(t)===!1||(a=a&&h.synchronous,s.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let u,c=0,f;if(!a){const h=[Yie.bind(this),void 0];for(h.unshift.apply(h,s),h.push.apply(h,l),f=h.length,u=Promise.resolve(t);c<f;)u=u.then(h[c++],h[c++]);return u}f=s.length;let p=t;for(c=0;c<f;){const h=s[c++],A=s[c++];try{p=h(p)}catch(g){A.call(this,g);break}}try{u=Yie.call(this,p)}catch(h){return Promise.reject(h)}for(c=0,f=l.length;c<f;)u=u.then(l[c++],l[c++]);return u}getUri(e){e=Fp(this.defaults,e);const t=Uie(e.baseURL,e.url,e.allowAbsoluteUrls);return Pie(t,e.params,e.paramsSerializer)}};Mt.forEach(["delete","get","head","options"],function(e){Bp.prototype[e]=function(t,r){return this.request(Fp(r||{},{method:e,url:t,data:(r||{}).data}))}}),Mt.forEach(["post","put","patch"],function(e){function t(r){return function(n,i,o){return this.request(Fp(o||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Bp.prototype[e]=t(),Bp.prototype[e+"Form"]=t(!0)});let qct=class Soe{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{n.subscribe(a),o=a}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},t(function(i,o,s){n.reason||(n.reason=new t0(i,o,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Soe(function(r){t=r}),cancel:t}}};function Yct(e){return function(t){return e.apply(null,t)}}function Kct(e){return Mt.isObject(e)&&e.isAxiosError===!0}const A8={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(A8).forEach(([e,t])=>{A8[t]=e});function Jie(e){const t=new Bp(e),r=gie(Bp.prototype.request,t);return Mt.extend(r,Bp.prototype,t,{allOwnKeys:!0}),Mt.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return Jie(Fp(e,n))},r}const So=Jie(FE);So.Axios=Bp,So.CanceledError=t0,So.CancelToken=qct,So.isCancel=Fie,So.VERSION=Kie,So.toFormData=Bx,So.AxiosError=En,So.Cancel=So.CanceledError,So.all=function(e){return Promise.all(e)},So.spread=Yct,So.isAxiosError=Kct,So.mergeConfig=Fp,So.AxiosHeaders=ba,So.formToJSON=e=>kie(Mt.isHTMLForm(e)?new FormData(e):e),So.getAdapter=qie.getAdapter,So.HttpStatusCode=A8,So.default=So;const{Axios:Tpt,AxiosError:Spt,CanceledError:xpt,isCancel:bpt,CancelToken:Cpt,VERSION:_pt,all:wpt,Cancel:Ipt,isAxiosError:Dpt,spread:Rpt,toFormData:Ppt,AxiosHeaders:Npt,HttpStatusCode:Lpt,formToJSON:kpt,getAdapter:Mpt,mergeConfig:Fpt}=So,Zct="https://api.intelligence.fynd.com",Jct="https://api.intelligence.sit.fyndx1.de",edt="application/json",tdt=6e4,rdt="https://cdn.prod.website-files.com/67a9c8e5f2c74ac8c2c9b88b/67ebbd36b30e83228583be90_404.avif",ndt="/service/integration/analytics",idt=`${ndt}/guest-token`;async function odt({authToken:e,productLine:t,env:r="prod",companyId:n,orgId:i,applicationId:o,customerId:s,partnerId:a,storeId:l,dashboardId:u,productId:c,promotionId:f,discountId:p,collectionId:h,customerGroupId:A,couponId:g,accountId:m,copilotId:y,copilotAppId:O,productAccountId:v,serverlessId:T,workflowId:C,dashboardUser:x,granularity:_,isRefreshToken:w}){var D,I,P,k,N,L,F,B,Q;try{const V={"Content-Type":edt,"x-product-line":t,Authorization:`Basic ${e}`},q={dashboardId:u};n&&(V["x-company-id"]=n),i&&(V["x-org-id"]=i),x!=null&&x.id&&(V["x-user-id"]=x?.id),o&&(V["x-application-id"]=o),s&&(V["x-customer-id"]=s),a&&(V["x-partner-id"]=a),l&&(V["x-store-id"]=l),f&&(V["x-promotion-id"]=f),p&&(V["x-discount-id"]=p),h&&(V["x-collection-id"]=h),A&&(V["x-customer-group-id"]=A),g&&(V["x-coupon-id"]=g),c&&(V["x-product-id"]=c),m&&(V["x-account-id"]=m),y&&(V["x-copilot-id"]=y),O&&(V["x-copilot-app-id"]=O),v&&(V["x-product-account-id"]=v),T&&(V["x-serverless-id"]=T),C&&(V["x-workflow-id"]=C),_&&(q.granularity=_),w&&(q.isRefreshToken=w);const M=(r==="prod"?Zct:Jct)+idt,G=await So.get(M,{headers:V,withCredentials:!0,params:q}),U=(P=(I=(D=G?.data)==null?void 0:D.data)==null?void 0:I.result)==null?void 0:P.token,R=(L=(N=(k=G?.data)==null?void 0:k.data)==null?void 0:N.result)==null?void 0:L.url,j=(Q=(B=(F=G?.data)==null?void 0:F.data)==null?void 0:B.result)==null?void 0:Q.dashboard_id;if(!U||!R||!j)throw new Error("Missing required data in token response");return{token:U,url:R,dashboardId:j}}catch(V){throw V}}async function sdt(e,t=3){let r=null;for(let n=1;n<=t;n++)try{return await e()}catch(i){if(r=i,n===t)throw r;await new Promise(o=>setTimeout(o,1e3*n))}throw r}async function eoe({authToken:e,productLine:t,env:r="prod",companyId:n,orgId:i,applicationId:o,customerId:s,partnerId:a,storeId:l,dashboardId:u,productId:c,promotionId:f,discountId:p,collectionId:h,customerGroupId:A,couponId:g,accountId:m,copilotId:y,copilotAppId:O,productAccountId:v,serverlessId:T,workflowId:C,dashboardUser:x,granularity:_,isRefreshToken:w,maxAttempts:D=3}){return sdt(()=>odt({authToken:e,productLine:t,env:r,companyId:n,orgId:i,applicationId:o,customerId:s,partnerId:a,storeId:l,dashboardId:u,productId:c,promotionId:f,discountId:p,collectionId:h,customerGroupId:A,couponId:g,accountId:m,copilotId:y,copilotAppId:O,productAccountId:v,serverlessId:T,workflowId:C,dashboardUser:x,granularity:_,isRefreshToken:w}),D)}function toe(...e){return e.flat().filter(t=>typeof t=="string").join(" ").trim()}const adt=({image:e,title:t,description:r})=>dd.jsxs("div",{className:"fynd-intelligence-error",children:[dd.jsx("img",{className:"fynd-intelligence-error__image",src:e,alt:"Error"}),dd.jsx("h1",{className:"fynd-intelligence-error__title",children:t}),dd.jsx("div",{className:"fynd-intelligence-error__description",children:r})]}),jE={isError:!1,title:"",description:""},ldt={hideTitle:!0,filters:{expanded:!0}};function udt({config:e}){const t=b.useRef(null),[r,n]=b.useState(!0),[i,o]=b.useState(jE),s=()=>{e!=null&&e.onSuccessCallback&&e.onSuccessCallback(),n(!1),a(jE)},a=l=>{const u={title:l.title??"Something went wrong",description:l.description??"Don't worry, we're working on it. Please try again later."};e!=null&&e.onErrorCallback&&e.onErrorCallback(u),o({isError:l.isError??jE.isError,...u})};return b.useEffect(()=>{if(r){const l=setTimeout(()=>{a({isError:!0,title:"Something went wrong",description:"Don't worry we are working on it. Please try again later."}),n(!1)},tdt);return()=>clearTimeout(l)}},[r]),b.useEffect(()=>{var l;n(!0),o(jE);const u={authToken:e.authToken,productLine:e.productLine,env:e?.env,companyId:e?.companyId,orgId:e?.orgId,applicationId:e?.applicationId,customerId:e?.customerId,partnerId:e?.partnerId,storeId:e?.storeId,dashboardId:e?.dashboardId,productId:e?.productId,promotionId:e?.promotionId,discountId:e?.discountId,collectionId:e?.collectionId,customerGroupId:e?.customerGroupId,couponId:e?.couponId,accountId:e?.accountId,copilotId:e?.copilotId,copilotAppId:e?.copilotAppId,productAccountId:e?.productAccountId,serverlessId:e?.serverlessId,workflowId:e?.workflowId,dashboardUser:e?.dashboardUser,granularity:e?.granularity,maxAttempts:3},c=((l=e.dashboardUiConfig)==null?void 0:l.urlParams)||{},f=["authToken","dashboardId","maxAttempts","env"];for(const p in u)if(Object.prototype.hasOwnProperty.call(u,p)){const h=p;let A=u[h];if(f.includes(h)||Object.prototype.hasOwnProperty.call(c,h))continue;if(h==="dashboardUser")if(typeof A=="object"&&A!==null){const g=A,m=g.id||g.userId;if(m)A={userId:m};else continue}else continue;if(A!=null){let g=A;typeof A=="object"&&(g=JSON.stringify(A)),c[h]=g}}eoe(u).then(p=>{const{url:h,dashboardId:A}=p;vut.embedDashboard({id:A,supersetDomain:h,mountPoint:t.current,fetchGuestToken:async()=>(await eoe({...u,isRefreshToken:!0})).token,dashboardUiConfig:{...ldt,...e?.dashboardUiConfig&&e.dashboardUiConfig,...c&&{urlParams:c}}}).then(()=>{s()}).catch(g=>{a(jE)})}).catch(p=>{var h,A;a({isError:!0,title:"Something went wrong",description:((A=(h=p?.response)==null?void 0:h.data)==null?void 0:A.message)||p?.description}),n(!1)})},[e]),i.isError?dd.jsx("div",{className:toe("fynd-intelligence__dashboard"),children:dd.jsx(adt,{image:rdt,title:i.title,description:i.description})}):dd.jsx(dd.Fragment,{children:dd.jsx("div",{ref:t,className:toe("fynd-intelligence__dashboard",r&&"fynd-intelligence__dashboard--loading")})})}const roe=()=>{try{return ume()}catch{return null}},m8=()=>{const[e,t]=b.useState(()=>roe());return b.useEffect(()=>{if(typeof window>"u")return;const r=()=>{t(roe())};return window.addEventListener("popstate",r),window.addEventListener("hashchange",r),()=>{window.removeEventListener("popstate",r),window.removeEventListener("hashchange",r)}},[]),e},cdt=(e,t={})=>({FYND_CLOUD_DOMAIN:e,ANALYTICS_AUTH_TOKEN:t.ANALYTICS_AUTH_TOKEN??"",ANALYTICS_PRODUCT_LINE:t.ANALYTICS_PRODUCT_LINE??"BOLTIC",JETBRIDGE_DASHBOARD_ACCOUNT_ID:t.JETBRIDGE_DASHBOARD_ACCOUNT_ID??"",JETBRIDGE_DASHBOARD_USER_ID:t.JETBRIDGE_DASHBOARD_USER_ID??""}),ddt=({dashboardId:e,workflowId:t,startDate:r,endDate:n})=>{const i=E.useTheme(),{ENTITY_ID:o,userData:s,WORKFLOW_URLS:a}=_i(),{FYND_CLOUD_DOMAIN:l}=a,u=m8(),c=t??u??"",[f,p]=b.useState(!1),h=b.useMemo(()=>{const g=l||"",m={ANALYTICS_AUTH_TOKEN:a?.ANALYTICS_AUTH_TOKEN,JETBRIDGE_DASHBOARD_ACCOUNT_ID:a?.JETBRIDGE_DASHBOARD_ACCOUNT_ID,JETBRIDGE_DASHBOARD_USER_ID:a?.JETBRIDGE_DASHBOARD_USER_ID},y=cdt(g,m),O=o||"";let v="",T="";switch(y.FYND_CLOUD_DOMAIN){case"boltic.io":v=O||"",T=s?.hostId||s?._id||"";break;case"uat.fcz0.de":case"fcz0.de":v=y.JETBRIDGE_DASHBOARD_ACCOUNT_ID,T=y.JETBRIDGE_DASHBOARD_USER_ID;break;default:v=O||"",T=s?.hostId||s?._id||"";break}return{accountId:v,authToken:y.ANALYTICS_AUTH_TOKEN,productLine:y.ANALYTICS_PRODUCT_LINE,dashboardUser:{id:T},dashboardId:e,workflowId:c,dashboardUiConfig:{filters:{visible:!1,enabled:!1},urlParams:{startDate:r,endDate:n},hideFilterBar:!0,showSidebar:!1,showHeader:!1}}},[e,o,r,n,s?.hostId,c]),A=(g,m)=>{p(m)};return d.jsxs(E.Accordion,{expanded:f,sx:{border:`1px solid ${i.palette.grey.outlined.border}`,"&.MuiPaper-root":{borderRadius:3}},"data-testid":"executions-insights-accordion",onChange:A,children:[d.jsx(E.AccordionSummary,{expandIcon:d.jsx(jp.GridExpandMoreIcon,{}),"aria-controls":"executions-insights-content",id:"executions-insights-header",sx:{"& .MuiAccordionSummary-content":{m:0,py:1,height:48}},children:d.jsx(E.Stack,{direction:"row",children:d.jsxs(E.Stack,{direction:"row",gap:1,children:[d.jsx(Me,{src:"ic_analytics",width:20,height:20,sx:{path:{fill:i.palette.neutral.solid.bg}}}),d.jsx(E.Typography,{variant:"mdSemiBold",children:"Executions Insights"})]})})}),d.jsx(E.AccordionDetails,{children:d.jsx(E.Stack,{spacing:3,height:"20rem",px:2.5,py:1.5,sx:{"& iframe":{border:"none",borderRadius:1}},children:d.jsx(E.Stack,{flex:1,bgcolor:"neutral.0",borderRadius:2,sx:{"& iframe":{border:"none",borderRadius:1}},children:d.jsx(udt,{config:h})})})})]})},noe=(e,t)=>e==="Successful"||e==="Completed"?d.jsx(Me,{src:"ic_success",width:"16px",height:"16px",fill:t.palette.success[40]}):e==="Running"||e==="In progress"?d.jsx(Me,{src:"ic_default",width:"16px",height:"16px",fill:t.palette.warning[40]}):e==="Failed"||e==="Terminated"||e==="Canceled"||e==="Timed out"?d.jsx(Me,{src:"ic_close_filled",width:"16px",height:"16px",fill:t.palette.error[50]}):d.jsx(Me,{src:"ic_pending",width:"16px",height:"16px",fill:t.palette.neutral.solid.bg}),$E=({status:e,size:t="small"})=>{const r=E.useTheme(),n=e==="Completed"?"Successful":e;return d.jsx(E.Chip,{icon:noe(n,r),size:t,sx:{backgroundColor:k6(n,r),color:r.palette.text.primary,boxShadow:"none",borderRadius:"1.5rem",padding:"1px 4px",height:"fit-content",fontSize:"12px",fontWeight:500,"& span":{p:0,letterSpacing:"0.5px",ml:1},border:"1px solid",borderColor:M6(n,r)},label:n})},fdt=e=>{const{theme:t,workflowId:r,selectedExecutionIds:n,setSelectedExecutionIds:i,isRetrying:o,isRetryableStatus:s,getRowWorkflowId:a,hasRetriesAvailable:l,expandedRowIds:u,toggleExpandRow:c,retrySingle:f,cooldownIds:p=new Set,currentSubscription:h,openUpgradeModal:A,onViewPayload:g}=e,m=O=>{Ed(O)};return[{field:"select",headerName:"",width:40,sortable:!1,renderHeader:({rows:O})=>{const v=(O||[]).filter(w=>{if(w?._isChild)return!1;const D=w.status===Gb.COMPLETED?Gb.SUCCESSFUL:w.status,I=s(D),P=o||p.has(w.id);return I&&!P}).map(w=>w.id),T=v.length,C=v.filter(w=>n.includes(w)).length,x=T>0&&C===T,_=C>0&&C<T;return d.jsx(E.Checkbox,{size:"small",checked:x,indeterminate:_,disabled:o||T===0,onClick:w=>w.stopPropagation(),onChange:()=>{i(w=>{if(T===0)return w;if(v.every(P=>w.includes(P)))return w.filter(P=>!v.includes(P));const I=new Set([...w,...v]);return Array.from(I)})}})},renderCell:O=>{const v=O.row.status==="Completed"?"Successful":O.row.status,T=!O.row._isChild&&s(v),C=n.includes(O.row.id),x=o||p.has(O.row.id),_=h?.[0]?.status==="EXPIRED"||h?.[0]?.status==="CANCELLED";return O.row._isChild?null:d.jsx(E.Checkbox,{size:"small",checked:C,disabled:!T||x,onClick:D=>{if(D.stopPropagation(),_&&!(!T||x)){typeof A=="function"&&A();return}},onChange:()=>i(D=>D.includes(O.row.id)?D.filter(I=>I!==O.row.id):[...D,O.row.id])})}},{field:"status",headerName:"Status",flex:1,sortable:!1,renderCell:O=>{const v=O.value==="Completed"?"Successful":O.value,T=O.row,C=!T._isChild&&l(T),x=!!u[T.id],_=!!T?.meta?.failed_before_start;return d.jsx(E.Tooltip,{arrow:!0,placement:"right",title:_?"Execution logs are unavailable — this workflow failed before it could start. Use the retry button to try again.":"",children:d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[d.jsx(E.Box,{sx:{...bi,width:"20px"},children:C&&d.jsx(E.IconButton,{size:"small",onClick:w=>{C&&(w.stopPropagation(),c(T))},sx:{transform:x?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.2s"},children:d.jsx(Me,{src:"ic_arrow_up",width:18,height:18,sx:{path:{fill:t.palette.neutral.solid.bg}}})})}),d.jsx($E,{status:v})]})})}},{field:"created_at",headerName:"Executed on",sortable:!1,flex:1,renderCell:O=>d.jsx(E.Typography,{sx:{...du,display:"flex",alignItems:"center",padding:0},variant:"smNormal",children:NE(O?.value,"full")})},{field:"id",headerName:"Execution ID/Retry ID",flex:1,sortable:!1,renderCell:O=>d.jsxs(E.Box,{sx:{position:"relative",display:"flex",alignItems:"center",gap:1,"&:hover .copy-icon":{visibility:"visible"}},children:[d.jsxs(E.Typography,{sx:{cursor:"pointer",...du},onClick:()=>{const v=O?.row?._isChild?O?.row?.execution_mode==="scheduled"?O?.row?.id:O?.row?.run_id:O.value||"-";m(v||"-")},variant:"smNormal",width:330,children:[O?.row?._isChild?O?.row?.execution_mode==="scheduled"?O?.row?.id:O?.row?.run_id:O.value?O.value:"-",d.jsx(E.Tooltip,{title:"Copy execution id",children:d.jsx(E.IconButton,{className:"copy-icon",sx:{marginBottom:"2px",visibility:"hidden"},onClick:v=>{v.stopPropagation();const T=O?.row?._isChild?O?.row?.execution_mode==="scheduled"?O?.row?.id:O?.row?.run_id:O.value||"-";m(T||"-")},size:"small",children:d.jsx(Me,{src:"ic_copy",width:18,height:18,sx:{path:{fill:t.palette.neutral.solid.bg}}})})})]}),O?.row?._isChild&&O?.row?.meta?.retry_attempt&&d.jsx(E.Chip,{label:`Attempt ${O?.row?.meta?.retry_attempt||""}`,size:"small",sx:{borderRadius:"4px",border:`1px solid ${t.palette.neutral.outlined.border}`,backgroundColor:"transparent"}}),O?.row&&(O?.row?.meta?.system_retried||O?.row?.meta?.user_retried)&&d.jsx(E.Chip,{label:"Latest",size:"small",sx:{borderRadius:"4px",border:`1px solid ${t.palette.neutral.outlined.border}`,backgroundColor:"transparent"}})]})},{field:"execution_mode",headerName:"Trigger",flex:1,sortable:!1,renderCell:O=>d.jsx(E.Typography,{sx:{...du},variant:"smNormal",children:O.value?Ns(O.value==="test"?"manual":O.value):"-"})},{field:"time_taken",headerName:"Time taken",sortable:!1,flex:1,renderCell:O=>d.jsx(E.Box,{width:"100%",children:d.jsx(E.Typography,{sx:{...du},variant:"smNormal",children:O.value?qp(O.value):"-"})})},{field:"actions",headerName:"",width:80,sortable:!1,renderCell:O=>{const v=O.row.status==="Completed"?"Successful":O.row.status;if(!(a(O.row)||r))return null;const C=!!O.row?.meta?.request_body,x=O.row._isChild,_=C&&d.jsx(E.Tooltip,{arrow:!0,placement:"left",title:"View trigger payload",children:d.jsx(E.IconButton,{size:"small",onClick:D=>{D.stopPropagation(),g(O.row)},children:d.jsx(Me,{src:"ic_visibility",width:18,height:18,sx:{path:{fill:t.palette.neutral.solid.bg}}})})});if(x)return C?d.jsx(E.Stack,{direction:"row",alignItems:"center",gap:.5,children:_}):null;if(!s(v))return null;const w=o||p.has(O.row.id);return d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:.5,children:[_,d.jsx(E.Tooltip,{arrow:!0,placement:"left",title:"Retry",children:d.jsx("span",{children:d.jsx(E.IconButton,{size:"small",disabled:w,sx:{opacity:w?.45:1},onClick:D=>{D.stopPropagation(),f(O.row.id,O.row)},children:d.jsx(Me,{src:"ic_try_again",width:18,height:18,sx:{path:{fill:t.palette.neutral.solid.bg}}})})})})]})}}]},pdt=e=>b.useMemo(()=>fdt(e),[e.theme,e.workflowId,e.selectedExecutionIds,e.setSelectedExecutionIds,e.isRetrying,e.getRowWorkflowId,e.hasRetriesAvailable,e.expandedRowIds,e.toggleExpandRow,e.retrySingle,e.cooldownIds,e.onViewPayload]),ioe=e=>{const t=At.useDispatch(),{WORKFLOW_URLS:r,ENTITY_ID:n,analytics:i}=_i(),{height:o,workflowId:s,state:a,fetchCounts:l,loadingStats:u}=e,{VORTEX_MAIN_URL:c}=r,f=()=>{e.onRefresh?e.onRefresh():(t(Yp(s,{...a,execution_source:"full"},c,n,i)),l&&l())};return d.jsxs(E.Stack,{width:"100%",height:o||"100%",alignItems:"center",justifyContent:"center",sx:{flex:1,paddingTop:"calc(50vh - 200px)",paddingBottom:"calc(50vh - 200px)"},children:[d.jsx(Me,{src:"ic_no_data",width:120,height:120}),d.jsx(E.Typography,{textAlign:"center",variant:"mdSemiBold",mt:3,children:"No execution data available"}),d.jsx(E.Typography,{variant:"smNormal",mt:1,maxWidth:480,textAlign:"center",children:"This may be because the workflow hasn't been executed yet. Run the workflow at least once to view its execution history."}),d.jsx(E.Button,{variant:"contained",sx:{mt:2},disabled:u||!1,onClick:f,children:u?d.jsx(E.CircularProgress,{size:20,sx:{color:"inherit"}}):"Refresh"})]})},ooe=({workflowId:e,VORTEX_MAIN_URL:t,ENTITY_ID:r})=>{const[n,i]=b.useState([]),[o,s]=b.useState(!1),a=b.useCallback(()=>{i([])},[]),l=b.useCallback(async(u,c)=>{const f=c||e;if(!f||!t||!r)return{ids:u,success:!1,error:{message:"Missing required parameters"}};const p=Yt(t,`/v1.0/${r}/`,`workflows/${f}/executions/retry`);try{return await qt.post(p,{data:Tat(u)}),{ids:u,success:!0}}catch(h){const A=h?.response?.data?.error||h?.response?.data||h?.message||"Unknown error";return{ids:u,success:!1,error:{...A,...h}}}},[e,t,r]);return{selectedExecutionIds:n,setSelectedExecutionIds:i,clearSelection:a,isRetrying:o,setIsRetrying:s,retryExecutions:l}},soe=({title:e,subtitle:t="",children:r=d.jsx(d.Fragment,{}),sx:n=null,icon:i=null})=>d.jsxs(E.Stack,{sx:{align:"center",justifyContent:"center",gap:2,margin:2,width:"600px",...n},children:[d.jsxs(E.Stack,{sx:{alignItems:"center",justifyContent:"center",gap:2},children:[i||d.jsx(Me,{src:"ic_no_data",width:75,height:75}),d.jsxs(E.Stack,{textAlign:"center",gap:4,children:[d.jsx(E.Typography,{variant:"lgSemiBold",color:"gray.100","data-id":"empty-title",children:e}),t&&d.jsx(E.Typography,{variant:"mdNormal",color:"gray.80","data-id":"empty-subtitle",children:t})]})]}),r]});var g8,aoe;function hdt(){if(aoe)return g8;aoe=1;var e="[object Symbol]",t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",o="\\u20d0-\\u20f0",s="\\u2700-\\u27bf",a="a-z\\xdf-\\xf6\\xf8-\\xff",l="\\xac\\xb1\\xd7\\xf7",u="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",c="\\u2000-\\u206f",f=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",p="A-Z\\xc0-\\xd6\\xd8-\\xde",h="\\ufe0e\\ufe0f",A=l+u+c+f,g="['’]",m="["+A+"]",y="["+i+o+"]",O="\\d+",v="["+s+"]",T="["+a+"]",C="[^"+n+A+O+s+a+p+"]",x="\\ud83c[\\udffb-\\udfff]",_="(?:"+y+"|"+x+")",w="[^"+n+"]",D="(?:\\ud83c[\\udde6-\\uddff]){2}",I="[\\ud800-\\udbff][\\udc00-\\udfff]",P="["+p+"]",k="\\u200d",N="(?:"+T+"|"+C+")",L="(?:"+P+"|"+C+")",F="(?:"+g+"(?:d|ll|m|re|s|t|ve))?",B="(?:"+g+"(?:D|LL|M|RE|S|T|VE))?",Q=_+"?",V="["+h+"]?",q="(?:"+k+"(?:"+[w,D,I].join("|")+")"+V+Q+")*",M=V+Q+q,G="(?:"+[v,D,I].join("|")+")"+M,U=RegExp(g,"g"),R=RegExp(y,"g"),j=RegExp([P+"?"+T+"+"+F+"(?="+[m,P,"$"].join("|")+")",L+"+"+B+"(?="+[m,P+N,"$"].join("|")+")",P+"?"+N+"+"+F,P+"+"+B,O,G].join("|"),"g"),$=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Y={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},X=typeof Ur=="object"&&Ur&&Ur.Object===Object&&Ur,H=typeof self=="object"&&self&&self.Object===Object&&self,W=X||H||Function("return this")();function z(ye,Fe,ze,je){for(var rt=-1,it=ye?ye.length:0;++rt<it;)ze=Fe(ze,ye[rt],rt,ye);return ze}function K(ye){return ye.match(t)||[]}function Z(ye){return function(Fe){return ye?.[Fe]}}var se=Z(Y);function ne(ye){return $.test(ye)}function le(ye){return ye.match(j)||[]}var Oe=Object.prototype,ve=Oe.toString,ae=W.Symbol,ie=ae?ae.prototype:void 0,te=ie?ie.toString:void 0;function J(ye){if(typeof ye=="string")return ye;if(pe(ye))return te?te.call(ye):"";var Fe=ye+"";return Fe=="0"&&1/ye==-1/0?"-0":Fe}function re(ye){return function(Fe){return z(Ee(fe(Fe).replace(U,"")),ye,"")}}function ue(ye){return!!ye&&typeof ye=="object"}function pe(ye){return typeof ye=="symbol"||ue(ye)&&ve.call(ye)==e}function Ae(ye){return ye==null?"":J(ye)}function fe(ye){return ye=Ae(ye),ye&&ye.replace(r,se).replace(R,"")}var xe=re(function(ye,Fe,ze){return ye+(ze?"_":"")+Fe.toLowerCase()});function Ee(ye,Fe,ze){return ye=Ae(ye),Fe=Fe,Fe===void 0?ne(ye)?le(ye):K(ye):ye.match(Fe)||[]}return g8=xe,g8}var Adt=hdt();const loe=Vn(Adt),mdt=e=>{const t=E.useTheme(),{title:r,count:n,logo:i,helperText:o,loading:s,failed:a}=e,l=()=>s?d.jsx(E.Skeleton,{variant:"rounded",sx:{mr:1},width:"80%",height:20}):a?"-":n;return d.jsxs(E.Stack,{direction:"row",p:2,borderRadius:2,border:`1px solid ${t.palette.grey.outlined.border}`,children:[d.jsxs(E.Stack,{alignItems:"space-between",width:"100%",children:[d.jsxs(E.Stack,{direction:"row",gap:"0.5",alignItems:"center",children:[d.jsx(E.Typography,{variant:"xsLight",children:r}),o&&d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:o,children:d.jsx(E.Box,{component:"span",ml:.5,children:d.jsx(Me,{src:"ic_info",width:t.icons.sm,height:t.icons.sm})})})]}),d.jsx(E.Box,{children:d.jsx(E.Typography,{variant:"smSemiBold",fontSize:24,children:l()})})]}),d.jsx(E.Box,{children:i})]})},gdt=({statistics:e,title:t="Analytics",failed:r=!1,loading:n=!1})=>{const i=E.useTheme(),[o,s]=b.useState(()=>{const l=localStorage.getItem(loe(`analytics_${t.toLowerCase()}_expanded`));return l===null||l==="true"}),a=(l,u)=>{s(u),localStorage.setItem(loe(`analytics_${t.toLowerCase()}_expanded`),u.toString())};return d.jsxs(E.Accordion,{expanded:o,sx:{border:`1px solid ${i.palette.grey.outlined.border}`,"&.MuiPaper-root":{borderRadius:3}},onChange:a,children:[d.jsx(E.AccordionSummary,{expandIcon:d.jsx(jp.GridExpandMoreIcon,{}),"aria-controls":"panel1-content",id:"panel1-header",sx:{"& .MuiAccordionSummary-content":{m:0,py:1,height:48}},children:d.jsx(E.Stack,{direction:"row",children:d.jsxs(E.Stack,{direction:"row",my:.5,gap:1,children:[d.jsx(Me,{src:"ic_analytics",width:20,height:20,sx:{path:{fill:i.palette.neutral.solid.bg}}}),d.jsx(E.Typography,{variant:"mdSemiBold",children:t})]})})}),d.jsx(E.AccordionDetails,{sx:{px:2,pb:2},children:d.jsx(E.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:2},children:e.map((l,u)=>d.jsx(E.Box,{children:d.jsx(mdt,{loading:n,failed:r,title:l.title,count:l.count_key??"-",helperText:l.helperText,logo:l.logo})},`analytics-status-${l.name||u}`))})})]})},Edt=e=>{const t=E.useTheme(),{isLoopChild:r,selectedActivity:n,getConnectingLineHeight:i,setSelectedActivity:o,setJsonViewType:s,setDataPresentType:a,ele:l,index:u,icon:c,isLoading:f=!1,totalBlocks:p}=e;return d.jsxs(E.Grid,{sx:{width:230,px:1.5,py:1,ml:r?6:0,border:h=>`1px solid ${n===l.eventId&&!f?h.palette.primary.main:h.palette.grey.outlined.border}`,borderRadius:2,cursor:"pointer",backgroundColor:h=>n===l.eventId&&!f?h.palette.primary[5]:h.palette.common.white,zIndex:p-u+1,position:"relative","&::after":{content:'""',position:"absolute",bottom:r?"calc(100% - 30px)":"100%",left:r?"-20px":"10px",width:"2px",height:i?.(u,l)||40,borderLeft:"1.5px dashed",pointerEvents:"none",borderColor:h=>h.palette.grey.outlined.border,zIndex:0},"&::before":r?{content:'""',position:"absolute",bottom:0,width:"16px",height:8,top:25.5,left:-20,borderBottom:"1.5px dashed",borderLeft:"1.5px dashed",pointerEvents:"none",borderRadius:"50% 0 0 26px",borderColor:h=>h.palette.grey.outlined.border,zIndex:0}:{}},onClick:()=>{f||(o?.(l.eventId),s?.("GUI"),k3(l)?a?.("Data in"):a?.("Data out"))},item:!0,children:[d.jsx(E.Box,{sx:{position:"absolute",top:r?24:-13.5,left:r?-13.5:.75,transform:r?"rotate(-180deg)":"rotate(-90deg)",display:u===0?"none":"block",zIndex:2,pointerEvents:"none"},children:d.jsx(Me,{src:"ic_arrow_left",height:"1.25rem",width:"1.25rem",sx:{path:{fill:t.palette.grey.outlined.border}}})}),d.jsxs(E.Stack,{gap:.75,justifyContent:"center",children:[d.jsxs(E.Stack,{direction:"row",sx:{...si},children:[f&&d.jsx(E.Skeleton,{variant:"rounded",sx:{mr:1},width:"100%",height:20}),!f&&d.jsxs(E.Stack,{direction:"row",maxWidth:"calc(100% - 20px)",gap:.75,alignItems:"center",children:[l.activityIcon&&d.jsx(E.Avatar,{variant:"rounded",src:Jp(l.activityIcon,"t.resize(h:15,w:15)"),alt:l.eventName,sx:{width:20,height:20,display:"flex"},children:L3(l.eventName||"")}),d.jsx(E.Tooltip,{placement:"top-start",arrow:!0,title:l.eventName,slotProps:{popper:{modifiers:[{name:"offset",options:{offset:[0,-6]}}]}},children:d.jsx(E.Typography,{variant:"smSemiBold",sx:{...du},children:l.eventName})}),!!l?.pro&&d.jsx(ef,{}),k3(l)&&d.jsx(Me,{src:"ic_spark",width:18,height:18,sx:{path:{fill:t.palette.primary.main}}}),!k3(l)&&l?.type!==Ke.LOOP&&d.jsx(E.Chip,{sx:{height:"fit-content",backgroundColor:h=>h.palette.white.smoke,border:`1px solid ${t.palette.grey.outlined.border}`},label:l.duration?.replace(/ /g,"")})]}),c]}),f?d.jsx(E.Skeleton,{variant:"rounded",sx:{mr:1},width:69,height:20}):l.isoEventTime&&d.jsx(E.Typography,{variant:"smNormal",sx:{color:t.palette.neutral.solid.bg},children:NE(l.isoEventTime,"full")})]})]},`block-item-${l.id||u}`)},Odt=e=>{const{logsToShow:t,loopChildActivities:r,selectedActivity:n,getConnectingLineHeight:i,setSelectedActivity:o,setJsonViewType:s,setDataPresentType:a,onLoadMore:l,hasMore:u,isLoadingMore:c}=e,f=E.useTheme();return d.jsx(E.Grid,{item:!0,px:3,py:4,sx:{borderRight:`1px solid ${f.palette.grey.outlined.border}`,height:"100%",overflow:"auto",width:"fit-content",flexShrink:0,minWidth:270},children:d.jsxs(E.Grid,{container:!0,direction:"column",gap:5,children:[t.map((p,h)=>{const{isSuccess:A}=N3(p.eventType),g=A?d.jsx(Me,{src:"ic_success",width:f.icons.md,height:f.icons.md,sx:{path:{fill:f.palette.success[40]}}}):d.jsx(Me,{src:"ic_warning_circle",width:16,height:16,sx:{path:{fill:f.palette.error.main}}});return d.jsx(Edt,{isLoopChild:r.includes(p.eventName),selectedActivity:n,getConnectingLineHeight:i,setSelectedActivity:o,setJsonViewType:s,setDataPresentType:a,ele:p,index:h,icon:g,totalBlocks:t.length},`block-item-${p.eventId||h}`)}),u&&d.jsx(E.Stack,{alignItems:"center",py:1,children:d.jsx(E.Button,{size:"small",variant:"outlined",onClick:l,disabled:c,startIcon:c?d.jsx(E.CircularProgress,{size:14}):void 0,sx:{textTransform:"none",borderRadius:"8px"},children:d.jsx(E.Typography,{variant:"xsSemiBold",children:c?"Loading...":"Load more"})})})]})})},ydt={"&.MuiChip-root":{borderRadius:1,height:"auto",backgroundColor:e=>e.palette.white.smoke,border:e=>`1px solid ${e.palette.grey.outlined.border}`},"& .MuiChip-label":{px:1}},uoe=b.memo(e=>{const{label:t}=e;return d.jsx(E.Chip,{sx:ydt,label:t})}),vdt=b.memo(()=>d.jsx(Me,{src:"ic_array"})),Tdt=b.memo(()=>d.jsx(Me,{src:"ic_object"})),Sdt=b.memo(()=>d.jsx(Me,{src:"ic_number"})),xdt=b.memo(()=>d.jsx(Me,{src:"ic_boolean"})),bdt=b.memo(()=>d.jsx(Me,{src:"ic_null"})),Cdt=b.memo(()=>d.jsx(Me,{src:"ic_string"})),_dt=e=>Array.isArray(e)?d.jsx(vdt,{}):typeof e=="object"&&e!==null?d.jsx(Tdt,{}):typeof e=="number"?d.jsx(Sdt,{}):typeof e=="boolean"?d.jsx(xdt,{}):e===null?d.jsx(bdt,{}):d.jsx(Cdt,{}),wdt={"& > *":{pt:2}},Idt={modifiers:[{name:"preventOverflow",options:{boundary:"body",padding:2}}]},Ddt={tooltip:{sx:{width:"fit-content",maxWidth:"50rem",height:"fit-content",whiteSpace:"normal",zIndex:999}}},UE=b.memo(({data:e,label:t,level:r=0,enableEllipsis:n=!0,showLabel:i=!0,highlightText:o=""})=>{const s=E.useTheme(),a=b.useRef(null),[l,u]=b.useState(0),[c,f]=b.useState(!1),[p,h]=b.useState(!1),A=b.useRef(null);b.useEffect(()=>{if(a.current&&r>0){const L=a.current.offsetHeight;u(L/2)}},[r]);const g=b.useCallback(()=>{h(!0),f(L=>!L),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{h(!1)},300)},[]);b.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]);const m=b.useCallback(L=>{switch(typeof L){case"object":return null;case"string":return L;default:return String(L)}},[]),y=b.useMemo(()=>e!==null&&(typeof e=="object"||Array.isArray(e)),[e]),O=b.useMemo(()=>_dt(e),[e]),v=b.useMemo(()=>Array.isArray(e)?"array":typeof e,[e]),T=b.useMemo(()=>{if(!y)return null;if(Array.isArray(e)){const F=e.length;return`(${F} ${F<=1?"item":"items"})`}const L=Object.keys(e).length;return`(${L} ${L<=1?"key":"keys"})`},[e,y]),C=b.useMemo(()=>({position:"absolute",left:-26,top:l,width:26,height:20,borderTop:`1px dashed ${s.palette.grey.outlined.border}`}),[l,s.palette.grey.outlined.border]),x=b.useMemo(()=>({zIndex:2,backgroundColor:s.palette.white.smoke,borderRadius:1}),[s.palette.white.smoke]),_=b.useMemo(()=>({color:s.palette.text.primary}),[s.palette.text.primary]),w=b.useMemo(()=>({color:s.palette.text.primary,maxWidth:400,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),[s.palette.text.primary]),D=b.useMemo(()=>({color:s.palette.text.primary,maxWidth:"99%",whiteSpace:"normal",overflowWrap:"anywhere",wordBreak:"break-word"}),[s.palette.text.primary]),I=b.useCallback(L=>{const F=(o||"").trim();if(!L||!F)return L??"";try{const B=new RegExp(`(${F.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"ig");return String(L).split(B).map((V,q)=>V.toLowerCase()===F.toLowerCase()?d.jsx(E.Box,{component:"mark",sx:{backgroundColor:"rgba(250, 223, 117, 0.6)",color:"inherit",p:"0 1px",borderRadius:.5},children:V},`hl-${q}`):d.jsx(b.Fragment,{children:V},`tx-${q}`))}catch{return L}},[o]),P=b.useMemo(()=>m(e),[e,m]),k=b.useMemo(()=>I(typeof P=="string"?P:String(P)),[P,I]),N=b.useMemo(()=>I(t),[t,I]);return d.jsxs(E.Box,{sx:{position:"relative"},children:[r>0&&d.jsx(E.Box,{sx:C}),d.jsxs(E.Stack,{direction:"row",sx:{alignItems:"center",gap:1},ref:a,children:[d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:v,children:d.jsx(E.Stack,{width:24,height:24,sx:x,alignItems:"center",justifyContent:"center",children:O})}),i&&d.jsx(E.Stack,{alignItems:"center",gap:1,children:y?d.jsxs(E.Stack,{gap:1,direction:"row",sx:{alignItems:"center"},children:[d.jsx(E.Box,{onClick:g,sx:{cursor:"pointer",display:"flex",alignItems:"center",transform:c?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.2s ease",mr:.25},children:p?d.jsx(E.CircularProgress,{size:16,thickness:6,sx:{color:s.palette.neutral.solid.bg}}):d.jsx(Me,{src:"ic_arrow_right",sx:{width:16,height:16,"& path":{fill:s.palette.neutral.solid.bg}}})}),d.jsx(E.Box,{onClick:g,sx:{cursor:"pointer"},children:d.jsx(uoe,{label:o?N:t})}),d.jsx(E.Typography,{variant:"smMedium",sx:_,children:T})]}):d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[d.jsx(uoe,{label:o?N:t}),!n&&d.jsx(E.Tooltip,{title:String(e),placement:"top",arrow:!0,id:"suggestions-tooltip",PopperProps:Idt,componentsProps:Ddt,children:d.jsx(E.Typography,{variant:"smMedium",sx:w,children:k})}),n&&d.jsx(E.Typography,{variant:"smMedium",sx:D,children:k})]})}),!i&&y&&d.jsx(E.Typography,{variant:"smMedium",sx:_,children:T})]}),y&&c&&d.jsx(E.Stack,{gap:0,pl:1.5,sx:wdt,children:Array.isArray(e)?e.map((L,F)=>{const B=F===e.length-1,Q={position:"relative",borderLeft:B?"none":`1px dashed ${s.palette.grey.outlined.border}`,paddingLeft:3.25},V={position:"absolute",height:28,width:2,top:0,left:0,borderLeft:`1px dashed ${s.palette.grey.outlined.border}`};return d.jsxs(E.Box,{sx:Q,children:[B&&d.jsx(E.Box,{sx:V}),d.jsx(UE,{data:L,label:`${F}`,level:r+1,enableEllipsis:n,highlightText:o})]},`${t}-${F}`)}):Object.entries(e).map(([L,F],B,Q)=>{const V=B===Q.length-1,q={position:"relative",borderLeft:V?"none":`1px dashed ${s.palette.grey.outlined.border}`,paddingLeft:3.25},M={position:"absolute",height:28,width:2,top:0,left:0,borderLeft:`1px dashed ${s.palette.grey.outlined.border}`};return d.jsxs(E.Box,{sx:q,children:[V&&d.jsx(E.Box,{sx:M}),d.jsx(UE,{data:F,label:L,level:r+1,enableEllipsis:n,highlightText:o})]},L)})})]})}),r0=b.memo(({data:e,topLabel:t="",sx:r={},enableEllipsis:n=!0,highlightText:i="",resetKey:o})=>{const s=E.useTheme(),[a,l]=b.useState(200),u=200,c=o??e,f=b.useMemo(()=>e!==null&&(typeof e=="object"||Array.isArray(e)),[e]);b.useEffect(()=>{l(u)},[u,c]);const p=b.useMemo(()=>({p:2,...r}),[r]),h=b.useMemo(()=>({"& > *":{pt:2,"&:first-of-type":{pt:0}}}),[]),A=b.useMemo(()=>({color:s.palette.text.primary}),[s.palette.text.primary]);return t?d.jsx(E.Box,{sx:p,children:d.jsx(UE,{data:e,label:t||"data",enableEllipsis:n,showLabel:!0,highlightText:i})}):f?d.jsx(E.Box,{sx:p,children:d.jsx(E.Stack,{gap:0,sx:h,children:Array.isArray(e)?d.jsxs(d.Fragment,{children:[e.slice(0,a).map((g,m)=>d.jsx(E.Box,{sx:{position:"relative"},children:d.jsx(UE,{data:g,label:`${m}`,level:0,enableEllipsis:n,highlightText:i})},`tree-item-${m}`)),e.length>a&&d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"center",sx:{py:1},children:[d.jsxs(E.Button,{size:"small",variant:"outlined",onClick:()=>l(g=>Math.min(g+u,e.length)),sx:{textTransform:"none"},children:["Load ",Math.min(u,e.length-a)," more"]}),d.jsxs(E.Typography,{variant:"xsNormal",color:"text.secondary",sx:{ml:1},children:["Showing ",a," of ",e.length]})]})]}):d.jsxs(d.Fragment,{children:[Object.entries(e).slice(0,a).map(([g,m])=>d.jsx(E.Box,{sx:{position:"relative"},children:d.jsx(UE,{data:m,label:g,level:0,enableEllipsis:n,highlightText:i})},g)),Object.keys(e).length>a&&d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"center",sx:{py:1},children:[d.jsx(E.Button,{size:"small",variant:"outlined",onClick:()=>l(g=>Math.min(g+u,Object.keys(e).length)),sx:{textTransform:"none"},children:"Load more"}),d.jsxs(E.Typography,{variant:"xsNormal",color:"text.secondary",sx:{ml:1},children:["Showing ",a," of ",Object.keys(e).length]})]})]})})}):d.jsx(E.Box,{sx:p,children:d.jsx(E.Box,{sx:A,children:typeof e=="object"?JSON.stringify(e):String(e)})})}),Rdt=Object.freeze(Object.defineProperty({__proto__:null,default:r0},Symbol.toStringTag,{value:"Module"})),Pdt=e=>{const t=E.useTheme(),{selectedLogData:r,dataPresentType:n,setDataPresentType:i,jsonViewType:o,setJsonViewType:s,getFormattedDateTime:a,searchQuery:l,setSearchQuery:u,dataIn:c,dataOut:f,executionLogs:p}=e,[h,A]=b.useState(!1),[g,m]=b.useState(!1),y=b.useRef(null);b.useLayoutEffect(()=>(A(!0),y.current&&clearTimeout(y.current),y.current=window.setTimeout(()=>A(!1),150),()=>{y.current&&(clearTimeout(y.current),y.current=null)}),[o]),b.useEffect(()=>{m(!1)},[r?.eventId]),b.useEffect(()=>{u("")},[g,o,u]);const O=b.useDeferredValue(c),v=b.useDeferredValue(f),T=b.useMemo(()=>{try{return JSON.stringify(O,null,2)}catch{return String(O)}},[O]),C=b.useMemo(()=>{try{return JSON.stringify(v,null,2)}catch{return String(v)}},[v]),x=r?.type===Ke.FUNCTION,_=x?r?.logsData||{}:{},w=x&&!Ot(_),[D,I]=b.useState(null),[P,k]=b.useState(!1);b.useEffect(()=>{if(g&&_&&typeof _=="object"&&Object.keys(_).length>0){k(!0);const K=setTimeout(()=>{try{const Z={};Object.entries(_).forEach(([ne,le])=>{const Oe=Array.isArray(le)?le:[le];Oe.length===1?Z[`[log ${ne}]`]=Oe[0]:Z[`[log ${ne}]`]=Oe}),I(Z)}catch{I({error:String(_)})}finally{k(!1)}},0);return()=>clearTimeout(K)}else I(null),k(!1)},[g,_,r?.eventId]);const N=r?.isTrigger?r?.inputData||{}:null,L=b.useMemo(()=>N?N?.payload:null,[N]),F=b.useMemo(()=>N?N?.global_variables:null,[N]),B=b.useMemo(()=>{if(!N)return null;const K={};return N?.http&&(K.http=N.http),N?.webhook&&(K.webhook=N.webhook),Object.keys(K).length?K:null},[N]),Q=b.useMemo(()=>{if(!N)return null;const K={...N||{}};return delete K.payload,delete K.global_variables,delete K.http,delete K.webhook,K&&Object.keys(K).length?K:null},[N]),V=b.useMemo(()=>ol(L,l),[L,l]),q=b.useMemo(()=>ol(F,l),[F,l]),M=b.useMemo(()=>ol(B,l),[B,l]),G=b.useMemo(()=>{const K=M;if(K&&typeof K=="object"&&!Array.isArray(K)){const Z=Object.keys(K);if(Z.length===1&&(Z[0]==="http"||Z[0]==="webhook"))return K[Z[0]]}return K},[M]),U=b.useMemo(()=>ol(Q,l),[Q,l]),R=r?.isTrigger&&r?.eventName?r.eventName:"Trigger",j=r?.eventId||r?.id||"execution-details",$=b.useMemo(()=>{if(!r?.isTrigger)return null;switch(n){case"Payload":return V;case"Global Variables":return q;case R:return G;case"Miscelaneous":return U;default:return V}},[r?.isTrigger,n,V,q,M,U]),Y=K=>K==="Payload"||K==="Global Variables"?"{}":K.toLowerCase(),X=b.useMemo(()=>{try{return $==null||typeof $=="object"&&!Array.isArray($)&&Object.keys($).length===0?"{}":JSON.stringify($,null,2)}catch{return String($)}},[$]),H=!!r?.isTrigger&&[Ke.HTTP,Ke.WEBHOOK,Ke.COPILOT_WEBHOOK,Ke.MCP].includes(r?.type),W=r?.isTrigger?["Payload","Global Variables",...H?[R]:[],"Miscelaneous"]:["Data in","Data out"],z=W.includes(n)?n:W[0];return z!==n&&i(W[0]),d.jsxs(E.Grid,{sx:{height:"100%",overflow:"auto"},item:!0,px:3,py:2,children:[d.jsxs(E.Stack,{direction:"row",gap:.75,mx:2,children:[d.jsx(E.ListItemAvatar,{sx:{minWidth:30,display:"flex",justifyContent:"center"},children:r?.activityIcon?d.jsx("img",{style:{width:"24px",height:"24px",objectFit:"contain",margin:0},alt:r?.eventName?.slice(0,2).toUpperCase(),src:Jp(r?.activityIcon||"","t.resize(h:24,w:24)")}):d.jsx(E.Avatar,{variant:"rounded",sx:{width:24,height:24},children:d.jsx(E.Typography,{variant:"smNormal",children:r?.eventName?.slice(0,2).toUpperCase()})})}),d.jsxs(E.Stack,{direction:"row",gap:1,alignItems:"center",children:[d.jsx(E.Typography,{variant:"lgSemiBold",children:r?.eventName}),!!r?.pro&&d.jsx(ef,{})]})]}),d.jsxs(E.Stack,{direction:"row",sx:{...si,borderBottom:1,borderColor:"divider",mx:2},children:[g?d.jsx(E.Box,{sx:{flex:1}}):d.jsx(Po,{variant:"normal",tabs:r?.isTrigger?[{title:"Payload"},{title:"Global Variables"},...H?[{title:R}]:[],{title:"Miscelaneous"}]:[{title:"Data in"},{title:"Data out"}],selectedTab:n,setSelectedTab:K=>{i(K)},textTransform:"none",sx:{fontSize:14,mt:"8px !important",minHeight:"30px",color:"black",fontWeight:600,border:"none","& .MuiTabs-indicator":{display:"block !important",position:"relative",top:-.5,backgroundColor:t.palette.common.black,borderRadius:4},"& .MuiButtonBase-root ":{mb:"3px"},"& .MuiButtonBase-root.MuiTab-root.Mui-selected":{color:t.palette.common.black+" !important"},"&.MuiTabs-root":{display:"flex",justifyContent:"space-between",alignItems:"flex-end",backgroundColor:"white !important",color:"black !important ","&.Mui-selected":{boxShadow:"none !important",color:"black !important"},m:0,pb:0,"& .MuiTabs-flexContainer":{gap:3}}}}),d.jsx(Po,{variant:"normal",tabs:w?[{title:"GUI"},{title:"Raw"},{title:"Logs"}]:[{title:"GUI"},{title:"Raw"}],selectedTab:g?"Logs":o,sx:{"&.MuiTabs-root":{mb:1.5,border:`1px solid ${t.palette.grey.outlined.border}`},"& .MuiButtonBase-root":{fontWeight:600}},setSelectedTab:K=>{if(K==="Logs"){w&&m(!0);return}m(!1),s(K)}})]}),d.jsxs(E.Box,{children:[r?.isoEventTime&&d.jsxs(E.Box,{sx:{ml:2,mt:2,px:.75,height:32,width:"fit-content",borderRadius:1,gap:.5,display:"flex",alignItems:"center",backgroundColor:K=>K.palette.white.smoke,border:K=>`1px solid ${K.palette.grey.outlined.border}`},children:[d.jsx(E.Typography,{variant:"smSemiBold",sx:{color:t.palette.text.primary},children:"Execution started"}),d.jsx(E.Typography,{variant:"xsMedium",sx:{color:t.palette.text.tertiary},children:a(r.isoEventTime)})]}),d.jsx(E.Box,{sx:{mx:2,mt:2},children:(()=>{if(!r)return!1;if(g)return w;if(r?.isTrigger)return!0;const K=n==="Data in",Z=n==="Data out",se=r?.eventType===ro.ACTIVITY_TASK_FAILED||r?.eventType===ro.ACTIVITY_TASK_TIMED_OUT;return K?!0:Z?!se:!1})()&&d.jsx(E.OutlinedInput,{fullWidth:!0,value:l,onChange:K=>u(K.target.value),placeholder:"Search",startAdornment:d.jsx(E.InputAdornment,{position:"start",sx:{m:0,pr:.5},children:d.jsx(Me,{src:"ic_search",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}})}),sx:{"&.MuiInputBase-root.MuiOutlinedInput-root":{pl:1}}})}),n!=="Data in"&&(r?.eventType===ro.ACTIVITY_TASK_FAILED||r?.eventType===ro.ACTIVITY_TASK_TIMED_OUT)&&o==="GUI"&&d.jsxs(E.Stack,{border:`1px solid ${t.palette.error[40]}`,borderRadius:2,gap:1,p:1.5,sx:{mx:2,mt:2,backgroundColor:t.palette.error[5]},children:[d.jsx(E.Typography,{variant:"smNormal",color:t.palette.text.tertiary,children:"Error:"}),(()=>{const K=r?.outputData?.error?.message??r?.outputData?.message??r?.activityTaskTimedOutEventAttributes?.failure?.message;return typeof K=="string"?d.jsx(E.Typography,{variant:"smNormal",color:t.palette.text.tertiary,children:K}):typeof K=="object"?d.jsx("pre",{style:{fontFamily:"monospace",fontSize:"0.875rem",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:JSON.stringify(K,null,2)}):d.jsx(E.Typography,{variant:"smNormal",color:t.palette.text.tertiary,children:"Unknown error"})})()]}),!g&&!p.loading&&r?.eventType!==ro.ACTIVITY_TASK_TIMED_OUT&&(n==="Data in"&&(Ot(c)||c===null||c===void 0)||n==="Data out"&&(Ot(f)||f===null||f===void 0))&&d.jsx(E.Stack,{mt:12,justifyContent:"center",children:d.jsx(Ec,{icon:d.jsx(Me,{src:"ic_no_data",width:120,height:120}),title:"No data Found",description:o==="GUI"?"No data found":"We couldn't find any matching results for your search. Try adjusting your keywords, filters, etc and check again."})}),!g&&r?.isTrigger&&!p.loading&&(Ot($)||$===null||$===void 0)&&(o==="GUI"?d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,sx:{mx:2,mt:2},children:[d.jsx(Me,{src:"ic_object",width:16,height:16}),d.jsxs(E.Typography,{variant:"smNormal",color:t.palette.text.primary,children:[Y(n)," "]})]}):null),!g&&r&&!Ot(c)&&n==="Data in"&&(o==="GUI"?h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}),children:d.jsx(r0,{data:O,enableEllipsis:!1,highlightText:l,resetKey:`${j}:data-in`})}):d.jsx(E.Box,{sx:{mx:2,mt:2},children:h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}),children:d.jsx(co,{height:"calc(100vh - 440px)",size:"lg",readOnly:!0,options:{readOnly:!0,cursorStyle:"line",autoIndent:"full"},language:"json",handleChange:()=>{},value:T,showCopyToClipboard:!0,showSuggestions:!1})})})),!g&&r?.isTrigger&&(o==="GUI"?!Ot($)&&(h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}),children:d.jsx(r0,{data:$,enableEllipsis:!1,highlightText:l,resetKey:`${j}:${z}`})})):d.jsx(E.Box,{sx:{mx:2,mt:2},children:h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}),children:d.jsx(co,{height:"calc(100vh - 440px)",size:"lg",readOnly:!0,options:{readOnly:!0},language:"json",handleChange:()=>{},value:X,showCopyToClipboard:!0,showSuggestions:!1})})})),!g&&r&&!Ot(f)&&n==="Data out"&&(o==="GUI"?r?.eventType!=="ACTIVITY_TASK_FAILED"&&(h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}),children:d.jsx(r0,{data:v,enableEllipsis:!1,highlightText:l,resetKey:`${j}:data-out`})})):d.jsx(E.Box,{sx:{mx:2,mt:2},children:h?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}),children:d.jsx(co,{height:"calc(100vh - 440px)",size:"lg",readOnly:!0,options:{readOnly:!0,cursorStyle:"line",autoIndent:"full"},language:"json",handleChange:()=>{},value:C,showCopyToClipboard:!0,showSuggestions:!1})})})),!g&&r&&n==="Data out"&&o!=="GUI"&&r?.eventType===ro.ACTIVITY_TASK_TIMED_OUT&&d.jsx(E.Box,{sx:{mx:2,mt:2},children:d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}),children:d.jsx(co,{height:"calc(100vh - 440px)",size:"lg",readOnly:!0,options:{readOnly:!0,cursorStyle:"line",autoIndent:"full"},language:"json",handleChange:()=>{},value:JSON.stringify(r?.activityTaskTimedOutEventAttributes?.failure,null,2),showCopyToClipboard:!0,showSuggestions:!1})})}),g&&w&&d.jsx(E.Box,{sx:{mx:2,mt:2},children:h||P?d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}):D&&typeof D=="object"&&Object.keys(D).length>0?d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}),children:d.jsx(r0,{data:D,highlightText:l,resetKey:`${j}:logs`})}):d.jsx(E.Stack,{mt:12,justifyContent:"center",children:d.jsx(Ec,{icon:d.jsx(Me,{src:"ic_no_data",width:120,height:120}),title:"No logs found",description:"No logs are available for this execution."})})})]})]})},Ndt=({workflowId:e,executionId:t,parentExecutionId:r,parentExecutionStatus:n,currentStatus:i})=>{const o=E.useTheme(),{WORKFLOW_URLS:s,ENTITY_ID:a}=_i(),{VORTEX_MAIN_URL:l}=s,[u,c]=b.useState(null),f=!!u,[p,h]=b.useState(!1),[A,g]=b.useState([]),[m,y]=b.useState(null),O=async()=>{if(y(null),!!r){h(!0);try{const x=Mne(l,a,e,r),_=await qt.get(x),w=Sat(_?.data?.data||[]);g(w)}catch{g([]),y("Failed to load retries")}finally{h(!1)}}};b.useEffect(()=>{O()},[r,n,t,e,l,a]),b.useEffect(()=>{f&&A.length===0&&O()},[f]),b.useEffect(()=>()=>{c(null)},[]);const v=b.useMemo(()=>xat(A),[A]),T="This execution failed before the workflow could start, so its logs aren't available.",C=b.useMemo(()=>{if(r===t)return"Latest Execution";const x=v.find(_=>_.id===t)?.meta?.retry_attempt;return x?`Retry ${x}`:"Retry"},[v,t,r,n]);return d.jsx(d.Fragment,{children:!p&&v.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(E.Button,{ref:x=>{},size:"small",variant:"outlined",onClick:x=>{const _=x.currentTarget;c(_)},endIcon:u?d.jsx(Me,{src:"ic_arrow_up",width:16,height:16,fill:o.palette.neutral.solid.bg}):d.jsx(Me,{src:"ic_arrow_down",width:16,height:16,fill:o.palette.neutral.solid.bg}),sx:{border:"1px solid",borderColor:o.palette.neutral.outlined.border,borderRadius:"8px",height:32,px:1,textTransform:"none","&:hover":{backgroundColor:o.palette.white.smoke}},children:d.jsxs(E.Stack,{sx:{...p0,gap:1},children:[d.jsx(E.Typography,{variant:"xsSemiBold",color:o.palette.text.secondary,children:C}),i&&d.jsx($E,{status:i})]})}),d.jsxs(E.Menu,{anchorEl:u&&document.contains(u)?u:null,open:!!(f&&u&&document.contains(u)),onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{minWidth:u?u.offsetWidth:"auto",mt:.5,maxHeight:300,overflowY:"auto"}}},MenuListProps:{sx:{width:"100%"}},disablePortal:!1,keepMounted:!1,variant:"menu",disableAutoFocusItem:!0,disableEnforceFocus:!0,disableRestoreFocus:!0,children:[m&&d.jsx(E.Typography,{variant:"xsNormal",sx:{px:2,py:1},color:"error",children:m}),d.jsx(E.MenuItem,{selected:r===t,sx:{px:2,py:1.5,"& .Mui-selected":{bgcolor:o.palette.grey[50]},"&:hover":{bgcolor:o.palette.white.smoke}},onClick:()=>{if(c(null),r!==t){const x=`/accounts/${a}/workflow-builder/workflow/${e}/executions/${r}?parentExecutionId=${r}&parentExecutionStatus=${n}`;window.open(x,"_blank")}},"data-testid":"latest-execution",children:d.jsxs(E.Stack,{direction:"row",alignItems:"center",width:"100%",justifyContent:"space-between",children:[d.jsxs(E.Stack,{alignItems:"flex-start",gap:.5,children:[d.jsx(E.Typography,{variant:"mdNormal",sx:{color:o.palette.text.primary},children:"Latest Execution"}),d.jsxs(E.Typography,{variant:"smNormal",sx:{color:o.palette.text.tertiary},children:["ID: ",r]})]}),n&&d.jsx($E,{status:n})]})}),v.map(x=>{const _=!!x.meta?.failed_before_start;return d.jsx(E.Tooltip,{arrow:!0,placement:"right",title:_?T:"",children:d.jsx(E.MenuItem,{selected:x.id===t,onClick:()=>{if(!_&&(c(null),x.id!==t)){const w=`/accounts/${a}/workflow-builder/workflow/${e}/executions/${x.id}?parentExecutionId=${r}&parentExecutionStatus=${n}`;window.open(w,"_blank")}},sx:{px:2,py:1.5,cursor:_?"not-allowed":"pointer",opacity:_?.6:1,"& .Mui-selected":{bgcolor:o.palette.grey[50]},"&:hover":{bgcolor:_?"transparent":o.palette.white.smoke}},"data-testid":"retry-execution",children:d.jsxs(E.Stack,{direction:"row",alignItems:"center",width:"100%",justifyContent:"space-between",children:[d.jsxs(E.Stack,{alignItems:"flex-start",gap:.5,children:[d.jsx(E.Typography,{variant:"mdNormal",sx:{color:o.palette.text.primary},children:x.label}),d.jsxs(E.Typography,{variant:"smNormal",sx:{color:o.palette.text.tertiary},children:["ID: ",x.id]})]}),d.jsx($E,{status:x.status})]})})},x.id)})]})]})})},Ldt=e=>{const t=E.useTheme(),r=At.useDispatch(),{WORKFLOW_URLS:n,ENTITY_ID:i,analytics:o}=_i(),{VORTEX_MAIN_URL:s}=n,{executionId:a,parentExecutionId:l,parentExecutionStatus:u}=e,c=m8(),{executionLogs:f}=At.useSelector(re=>re.workflows),{activities:p,triggers:h}=At.useSelector(re=>re.activities),[A,g]=b.useState("Data in"),[m,y]=b.useState("GUI"),[O,v]=b.useState(null),[T,C]=b.useState(""),[x,_]=b.useState([]),[w,D]=b.useState(!1),[I,P]=b.useState(!1),[k,N]=b.useState(!1),[L,F]=b.useState(!1),{retryExecutions:B}=ooe({workflowId:c??void 0,VORTEX_MAIN_URL:s,ENTITY_ID:i});b.useEffect(()=>{p?.data?.data.length===0&&r($J({page:1,per_page:999,integrations:!0},s,i)),h?.data?.data.length===0&&r(UJ({page:1,per_page:999,triggers:!0},s,i))},[r]);const Q=(()=>{const ue=new URLSearchParams(location.search).get("executionId");return a||ue||(typeof window<"u"?window.location.pathname.match(/\/executions\/([^/?#]+)/):null)?.[1]||""})();b.useEffect(()=>{N(Q===l)},[l]);const[V,q]=b.useState(!1),M=!f?.logs?.is_first_execution,G=!f?.logs?.is_last_execution,U=b.useCallback(async re=>{if(!c||!Q||V||re==="prev"&&!M||re==="next"&&!G)return;q(!0);const ue=await cce(c,Q,re,s,i);if(ue){v(null);const pe=window.location.pathname.replace(/\/executions\/[^/?#]+/,`/executions/${ue}`),Ae=`?parentExecutionId=${ue}&parentExecutionStatus=`;window.history.replaceState({},"",pe+Ae)}q(!1)},[c,Q,s,i,V,M,G,r]);b.useEffect(()=>{!c||!Q||r(Kp(c??"",Q,s,i,yd.EXECUTION_HISTORY,o,{execution_source:"full"}))},[Q,c,r]);const R=()=>{!c||!Q||r(Kp(c??"",Q,s,i,yd.EXECUTION_HISTORY,o,{execution_source:"full"}))},j=()=>{!c||!Q||!f.nextPageToken||(F(!0),r(Kp(c??"",Q,s,i,yd.EXECUTION_HISTORY,o,void 0,f.nextPageToken,!0)))};kne({workflowId:c,executionId:Q,VORTEX_MAIN_URL:s,ENTITY_ID:i,executedFrom:yd.EXECUTION_HISTORY,analytics:o,executionLogs:f,params:{execution_source:"full"},shouldPoll:()=>f?.error?!1:f?.logs!==null&&f?.logs!==void 0?!0:f?.loading||f?.logs===null||f?.logs===void 0});const $=x.find(re=>(re.eventType.includes(ro.ACTIVITY_TASK_COMPLETED)||re.eventType.includes(ro.ACTIVITY_TASK_FAILED)||re.eventType.includes(ro.ACTIVITY_TASK_TIMED_OUT))&&re.eventId===O),Y=p?.data?.data?.length>0,X=h?.data?.data?.length>0;b.useEffect(()=>{if(f?.logs?.events&&Y&&X){const re=f6(f.logs.events,p,h);_(re),D(!0)}},[f,p.data.data,Y,X]);const H=b.useMemo(()=>!f?.logs?.events||!Y||!X?[]:fre(f,p,h,"events"),[f,p,h,Y,X]),W=b.useRef(!1);b.useEffect(()=>{f?.loading&&(W.current=!0)},[f?.loading]),b.useEffect(()=>{if(!w){const re=Y&&X;f?.logs&&re&&D(!0)}},[w,f?.logs,Y,X]),b.useEffect(()=>{!f.loading&&L&&F(!1)},[f.loading,f.logs,f.error]),b.useEffect(()=>{D(!1),_([]),v(null),F(!1)},[a]),b.useEffect(()=>{H.length!==0&&!O&&v(H[0].eventId)},[H,O]);const z=b.useMemo(()=>T0e(x),[x]),K=re=>NE(re,"full"),Z=b.useMemo(()=>dre(H),[H]);if(!c)return d.jsx(E.Stack,{height:"80vh",alignItems:"center",justifyContent:"center",children:d.jsx(Ec,{title:"Workflow not found",description:"We couldn't determine which workflow this execution belongs to. Please reopen the execution from the history listing.",icon:d.jsx(Me,{src:"ic_warning_circle",width:80,height:80})})});const se=f.error?.status||f.error?.code;if(f.loading&&!se&&!w)return d.jsx(E.Stack,{alignItems:"center",justifyContent:"center",height:"80vh",children:d.jsx(pi,{size:60})});if(f.error?.status===404||f.error?.code===404)return d.jsx(Ec,{title:"Data has been archived",height:"calc(100vh - 128px)",description:"This execution history has been archived. Click the refresh button to get the execution.",icon:d.jsx(Me,{src:"ic_no_data",width:120,height:120}),buttonElement:d.jsx(E.Button,{sx:{mt:3},variant:"outlined",color:"primary",startIcon:d.jsx(Me,{src:"ic_refresh",width:t.icons.sm,height:t.icons.sm,fill:t.palette.primary.main}),children:"Refresh"})});if((f.error?.code||f.error?.status)&&!f.logs?.events?.length)return d.jsx(E.Stack,{width:"100%",height:"calc(100vh - 210px)",children:d.jsx(Ec,{icon:d.jsx(Me,{src:"ic_no_data",width:120,height:120}),title:"Something is broken",description:B4(f.error)||"Something went wrong while fetching the execution history.This could be due to a temporary issue or a technical error.",buttonElement:d.jsxs(E.Typography,{variant:"smNormal",sx:{mt:2},children:["Raise issue on ",d.jsx("a",{href:"mailto:support@boltic.io",children:"support@boltic.io"})]})})});const le=ol($?.inputData,T),Oe=ol($?.outputData,T),ve=(re,ue)=>{if(re===0)return"0px";if(Z.includes(ue.eventName))return Z.includes(H[re-1].eventName)?"110px":"72px";let pe=0,Ae=re-1;for(;Ae>=0&&Z.includes(H[Ae].eventName);)pe++,Ae--;return`${40+pe*110}px`},ae={total:x.filter(re=>[ro.ACTIVITY_TASK_FAILED,ro.ACTIVITY_TASK_TIMED_OUT,ro.ACTIVITY_TASK_COMPLETED].includes(re.eventType)).length,SUCCESS:x.filter(re=>re.eventType.includes(ro.ACTIVITY_TASK_COMPLETED)).length,failed:x.filter(re=>[ro.ACTIVITY_TASK_FAILED,ro.ACTIVITY_TASK_TIMED_OUT].includes(re.eventType)).length,not_executed:Math.max(z-x.filter(re=>!Z.includes(re.eventName)&&[ro.ACTIVITY_TASK_FAILED,ro.ACTIVITY_TASK_TIMED_OUT,ro.ACTIVITY_TASK_COMPLETED].includes(re.eventType)).length,0),actual_execution:x.filter(re=>!re?.isTrigger&&re.type!==Ke.LOOP&&[ro.ACTIVITY_TASK_FAILED,ro.ACTIVITY_TASK_TIMED_OUT,ro.ACTIVITY_TASK_COMPLETED].includes(re.eventType)).reduce((re,ue)=>re+ue.rawTimeDiff,0)},ie=[{title:"Total executed activities",logo:d.jsx(Me,{src:"ic_all",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}}),count_key:ae.total>0?ae.total-1:0,helperText:"The total number of activities that were triggered during this execution."},{title:"Successful",logo:d.jsx(Me,{src:"ic_success",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}}),count_key:ae.SUCCESS>0?ae.SUCCESS-1:0,helperText:"Activities that ran successfully without any errors in this execution."},{title:"Failed",logo:d.jsx(Me,{src:"ic_close_filled",width:24,height:24,sx:{path:{fill:t.palette.error.main}}}),count_key:ae.failed,helperText:"Activities that encountered errors and did not complete successfully in this execution."},{title:"Not executed",logo:d.jsx(Me,{src:"ic_pending",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}}),count_key:ae.not_executed,helperText:"Activities that were skipped or not triggered during this execution, possibly due to conditions or failures in previous activities."},{title:"Time taken",logo:d.jsx(Me,{src:"ic_avg_time",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}}),count_key:f.logs?.status==="Timed out"&&ae.actual_execution===0?qp(f?.logs?.time_taken??0):ae.actual_execution?qp(ae.actual_execution):qp(f?.logs?.time_taken??0),helperText:"The time it took to run the workflow from start to finish, not including any time it spent waiting in the queue."}],J=Array.isArray(f?.logs?.events)&&!bE(f?.logs?.events||[])?"Running":f?.logs?.status||"";return d.jsxs(d.Fragment,{children:[d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",mx:3,mt:2,mb:0,children:[d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[d.jsxs(E.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.jsx(E.Typography,{variant:"lgSemiBold",color:t.palette.text.primary,children:Q}),d.jsx(E.Tooltip,{title:"Copy to clipboard",children:d.jsx(E.IconButton,{"data-testid":"copy-execution-id",sx:{marginBottom:"2px"},onClick:()=>{const re=Q||a;re&&Ed(re)},size:"small",children:d.jsx(Me,{src:"ic_copy",width:15,height:15,sx:{path:{fill:t.palette.common.black}}})})})]}),l&&u&&c&&Q&&d.jsx(Ndt,{workflowId:c,executionId:Q,parentExecutionId:l,parentExecutionStatus:u,currentStatus:f?.logs?.status})]}),d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1.5,children:[d.jsx($E,{status:J,size:"small"}),c&&k&&z4.includes(J)&&d.jsx(E.Button,{"data-testid":"event-history-retry",variant:"outlined",size:"small",disabled:I,startIcon:d.jsx(Me,{src:"ic_try_again",width:14,height:14,sx:{path:{fill:t.palette.text.icon}}}),onClick:async()=>{P(!0);try{const re=await B([Q],c);r({type:Qr,payload:{open:!0,title:re.success?"Retry initiated for 1 execution(s)":re.error?.message||"Retry failed",type:re.success?"success":"error"}})}catch{r({type:Qr,payload:{open:!0,title:"Retry failed",type:"error"}})}finally{P(!1)}},sx:{borderColor:t.palette.neutral.outlined.border,borderRadius:"8px",height:32,textTransform:"none","&:hover":{backgroundColor:t.palette.white.smoke}},children:d.jsx(E.Typography,{variant:"xsSemiBold",color:t.palette.text.secondary,children:"Retry"})}),d.jsx(E.Tooltip,{title:"Force refresh",children:d.jsx(E.IconButton,{onClick:R,disabled:!!f.loading,size:"small",sx:{height:28,width:28,borderRadius:"0.5rem",border:`1px solid ${t.palette.grey[300]}`,p:.5,":hover":{backgroundColor:"transparent"},...Ri(t)},children:d.jsx(Me,{src:"ic_refresh",width:16,height:16})})}),k&&d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:.5,children:[d.jsx(E.Tooltip,{title:"Previous execution",children:d.jsx(E.IconButton,{"data-testid":"event-history-prev",onClick:()=>U("prev"),size:"small",sx:{height:32,width:32,borderRadius:"0.5rem",border:`1px solid ${t.palette.grey[300]}`,p:.5,opacity:M&&!V?1:.4,":hover":{backgroundColor:"transparent"},...Ri(t)},children:d.jsx(Me,{src:"ic_arrow_left",width:22,height:22,sx:{path:{fill:t.palette.text.icon}}})})}),d.jsx(E.Tooltip,{title:"Next execution",children:d.jsx(E.IconButton,{"data-testid":"event-history-next",onClick:()=>U("next"),size:"small",sx:{height:32,width:32,borderRadius:"0.5rem",border:`1px solid ${t.palette.grey[300]}`,p:.5,opacity:G&&!V?1:.4,":hover":{backgroundColor:"transparent"},...Ri(t)},children:d.jsx(Me,{src:"ic_arrow_right",width:22,height:22,sx:{path:{fill:t.palette.text.icon}}})})})]})]})]}),d.jsx(E.Box,{sx:{m:3,my:2},children:d.jsx(gdt,{title:"Execution Summary",statistics:ie})}),!w||x.length>0&&!O?d.jsx(E.Stack,{alignItems:"center",justifyContent:"center",height:"80vh",children:d.jsx(pi,{size:60})}):x.length>0&&O?d.jsxs(E.Grid,{container:!0,width:"auto",mx:3,spacing:2,borderRadius:"8px 8px 0 0",border:`1px solid ${t.palette.grey.outlined.border}`,flexWrap:"nowrap",height:"calc(100vh - 210px)",borderBottom:"none",children:[d.jsx(Odt,{logsToShow:H,loopChildActivities:Z,events:f?.logs?.events,selectedActivity:O,getConnectingLineHeight:ve,setSelectedActivity:v,setJsonViewType:y,setDataPresentType:g,onLoadMore:j,hasMore:!!f.nextPageToken,isLoadingMore:L}),d.jsx(Pdt,{selectedLogData:$,dataPresentType:A,setDataPresentType:g,jsonViewType:m,setJsonViewType:y,getFormattedDateTime:K,searchQuery:T,setSearchQuery:C,dataIn:le,dataOut:Oe,executionLogs:f})]}):d.jsx(E.Stack,{alignItems:"center",justifyContent:"center",width:"100%",children:d.jsx(soe,{title:"No events found","data-id":"events-empty-page"})})]})},kdt=({crumbs:e,separator:t=d.jsx(Me,{src:"ic_arrow_right",width:24,height:24}),maxItems:r=4,navigate:n,loading:i,...o})=>{const s=E.useTheme(),a=(u,c,f)=>{u.preventDefault(),f?f():c&&n(c)},l=u=>{const c=[];return u.forEach((f,p)=>{const{path:h,label:A,color:g,textStyle:m="mdNormal",onClick:y}=f;i?c.push(d.jsx(E.Skeleton,{variant:"rounded",width:120,height:24},`breadcrumb-skel-${p}`)):!h&&!y?c.push(d.jsx(E.Typography,{color:g,variant:m,"data-testid":`breadcrumb-${A}`,children:A},`breadcrumb-${typeof A=="string"?A:"object"}-${p}`)):c.push(d.jsx(E.Typography,{onClick:O=>{p!==u.length-1&&a(O,h,y)},variant:m,"data-testid":`breadcrumb-${A}`,sx:{color:g,cursor:"pointer",textDecoration:"none","&:hover":{color:p===u.length-1?g:s.palette.primary.main,cursor:p===u.length-1?"default":"pointer"}},children:A},`breadcrumb-${A}-${p}`))}),c};return d.jsx(E.Breadcrumbs,{separator:t,"aria-label":"breadcrumb",maxItems:r,...o,children:l(e)})},Mdt=({crumbs:e,onBack:t,navigate:r})=>{const n=E.useTheme();return d.jsxs(E.Stack,{sx:{position:"sticky",top:0,zIndex:10,bgcolor:n.palette.common.white},children:[d.jsxs(E.Stack,{justifyContent:"flex-start",spacing:2,direction:"row",width:"100%",pl:1.5,pr:3,py:0,alignItems:"center",sx:{minHeight:48,maxHeight:48,height:48},children:[d.jsx(E.IconButton,{onClick:t,sx:{cursor:"pointer",p:0,width:24,height:24,...Ri(n)},"data-testid":"executions-back-button",children:d.jsx(Me,{src:"ic_back",width:24,height:24,fill:n.palette.neutral.solid.bg})}),d.jsx(E.Typography,{variant:"xlSemiBold",color:"text.primary",children:"Execution History"})]}),d.jsx(E.Divider,{}),d.jsx(E.Stack,{direction:"row",alignItems:"center",justifyContent:"flex-start",sx:{px:2.5,py:0,backgroundColor:n.palette.white.smoke,minHeight:48,maxHeight:48,height:48},children:d.jsx(kdt,{"data-testid":"executions-breadcrumbs",crumbs:e,navigate:r})})]})},coe=({value:e,onChange:t,minDateTime:r,maxDateTime:n,acceptDates:i,clearDates:o})=>{const[s,a]=Te.useState(!1),l=e?Sr(e):null,u=r?Sr(r):void 0,c=n?Sr(n):void 0,f=h=>{const A=h?h.toDate():null;t(A)},p=h=>{const A=h?h.toDate():null;i?.(A)};return d.jsx(_A,{dateAdapter:Jl,children:d.jsx(fE,{open:s,onClose:()=>a(!1),value:l,onChange:f,minDateTime:u,maxDateTime:c,onAccept:p,views:["year","month","day","hours","minutes"],closeOnSelect:!1,slotProps:{field:{clearable:!0,onClear:()=>o?.(null)},textField:{onClick:()=>a(!0),inputProps:{readOnly:!0},InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-input":{flexDirection:"row",gap:.5},"& .MuiInputBase-root":{"& :nth-of-type(2)":{order:3},"& :nth-of-type(1)":{order:2},"& :nth-last-of-type(2)":{order:1},"& input":{ml:2},"& > *":{px:0}},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{border:"none",boxShadow:"none"},"& .MuiOutlinedInput-root.Mui-focused.Mui-error .MuiOutlinedInput-notchedOutline":{border:"none",boxShadow:"none"}}},actionBar:{actions:["accept"]},popper:{sx:{"&.MuiPopper-root.MuiPickersPopper-root .MuiPaper-root":{margin:"10px 0"}},disablePortal:!0}}})})},Fdt=({startDate:e,endDate:t,onStartDateChange:r,onEndDateChange:n,startMinDateTime:i,startMaxDateTime:o,endMinDateTime:s,endMaxDateTime:a,acceptDateStart:l,acceptDatesEnd:u,clearStart:c,clearEnd:f,toolTipStartDate:p})=>{const h=E.useTheme();return d.jsxs(E.Stack,{direction:"column",justifyContent:"space-between",sx:{"& .MuiInputBase-input.MuiOutlinedInput-input":{p:.43}},children:[d.jsxs(E.Box,{display:"inline",position:"relative",children:[d.jsx(E.Typography,{variant:"xsBold",children:"Date range"}),p&&d.jsx(E.Tooltip,{title:p,children:d.jsx(E.Box,{sx:{cursor:"pointer",ml:.5,display:"inline-block",position:"absolute",top:5},children:d.jsx(Me,{src:"ic_info"})})})]}),d.jsxs(E.Stack,{direction:"row",gap:.75,borderRadius:2,border:`1px solid ${h.palette.neutral.outlined.border}`,sx:{"&:focus-within":{border:`1px solid ${h.palette.primary.main}`}},children:[d.jsx(coe,{value:e,onChange:r,minDateTime:i,maxDateTime:t||o,acceptDates:l,clearDates:c}),d.jsx(E.Divider,{orientation:"vertical",flexItem:!0}),d.jsx(coe,{value:t,onChange:n,minDateTime:e||s,maxDateTime:a,acceptDates:u,clearDates:f})]})]})},Bdt=({onClear:e,selectedValues:t,onToggle:r,isOpen:n})=>{const i=E.useTheme();return d.jsxs(E.Stack,{direction:"row",gap:.5,alignItems:"center",height:36,children:[t.length!==0&&d.jsx(E.IconButton,{onClick:o=>{o.stopPropagation(),e()},sx:{"&:hover":{backgroundColor:"transparent"},p:0},disableRipple:!0,children:d.jsx(Me,{src:"ic_close",width:24,height:24})}),d.jsx(E.IconButton,{onClick:o=>{o.stopPropagation(),r()},sx:{"&:hover":{backgroundColor:"transparent"},transform:n?"rotate(90deg)":"rotate(-90deg)",transition:"transform 0.2s ease",p:0,mr:1},disableRipple:!0,children:d.jsx(Me,{src:"ic_arrow_left",width:24,height:24,sx:{path:{fill:i.palette.neutral.solid.bg}}})})]})},doe=e=>{const t=E.useTheme(),{selectedValues:r,handleChange:n,allValueSelectedText:i,options:o,optionUi:s,searchable:a,searchPlaceholder:l,width:u,getStatusIcon:c,getStatusBackground:f,getBorderColor:p}=e,[h,A]=b.useState(!1),[g,m]=b.useState(""),y=I=>{I.currentTarget.contains(I.relatedTarget)||A(!1)},O=b.useCallback(()=>A(I=>!I),[]),v=b.useMemo(()=>new Set(o.map(I=>String(I.value))),[o]),T=I=>{const P=(I||[]).filter(k=>v.has(String(k)));return P.length===0||P.length===o.length?d.jsx(E.Typography,{color:t.palette.text.tertiary,children:i}):d.jsxs(E.Typography,{color:t.palette.text.tertiary,children:[P.length," selected"]})},C=b.useCallback(()=>{n({target:{value:[]}})},[n]),x=I=>d.jsx(Bdt,{...I,onClear:C,selectedValues:r,onToggle:O,isOpen:h}),_=b.useCallback(I=>I.stopPropagation(),[]),w=b.useCallback(I=>{I.stopPropagation(),I.preventDefault()},[]),D=b.useMemo(()=>{if(!a||!g.trim())return o;const I=g.toLowerCase();return o.filter(P=>String(P.title||"").toLowerCase().includes(I))},[o,a,g]);return d.jsx(E.FormControl,{sx:{width:u??"11rem"},children:d.jsxs(E.Select,{multiple:!0,open:h,value:r,onChange:n,renderValue:T,sx:{height:36},displayEmpty:!0,IconComponent:x,onBlur:y,onClick:O,MenuProps:{PaperProps:{style:{maxHeight:300}}},children:[a&&d.jsx(E.MenuItem,{disableRipple:!0,disableTouchRipple:!0,"data-testid":"dropdown-with-select-all-search-input",sx:{pt:1,pb:1,"&.MuiMenuItem-root:hover":{backgroundColor:"transparent"},"&.MuiMenuItem-root.Mui-focusVisible":{backgroundColor:"transparent"},"&.Mui-selected":{backgroundColor:"transparent",borderColor:"transparent"},"&.Mui-selected:hover":{backgroundColor:"transparent",borderColor:"transparent"}},onClick:I=>I.stopPropagation(),children:d.jsx(E.OutlinedInput,{size:"small",placeholder:l||"Search...",value:g,"data-testid":"dropdown-with-select-all-search-input-value",onChange:I=>m(I.target.value),onKeyDown:_,onClick:_,onMouseDown:_,sx:{width:"100%",backgroundColor:"transparent","& .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"& .MuiInputBase-input":{backgroundColor:"transparent"}}})}),D.map(I=>d.jsx(E.MenuItem,{value:I.value,sx:{py:1,px:1.5},onClick:w,"data-testid":"dropdown-with-select-all-option",children:s?d.jsx(s,{...e,selectedValues:r,status:I,getStatusIcon:c,getStatusBackground:f,getBorderColor:p}):I.title},String(I.value)))]})})},jdt=e=>{const t=E.useTheme(),{status:r,selectedValues:n}=e;return d.jsxs(E.Stack,{direction:"row",justifyContent:"flex-start",alignItems:"center",gap:1,children:[d.jsx(E.Checkbox,{icon:d.jsx(Me,{src:"ic_unchecked",width:18,height:18,sx:{path:{fill:t.palette.common.white}}}),checkedIcon:d.jsx(Me,{src:"ic_checked",width:18,height:18,sx:{"path:first-of-type":{fill:t.palette.primary.main}}}),checked:n.includes(r.value)}),d.jsx(E.Stack,{children:d.jsx(E.ListItemText,{primary:r.title})})]})},$dt=e=>d.jsx(doe,{allValueSelectedText:"All triggers",options:sce,optionUi:jdt,...e}),Udt=e=>{const{status:t,selectedValues:r,getStatusIcon:n,getStatusBackground:i,getBorderColor:o}=e,s=E.useTheme();return d.jsxs(E.Stack,{direction:"row",gap:1,justifyContent:"flex-start",alignItems:"center",children:[d.jsx(E.Checkbox,{icon:d.jsx(Me,{src:"ic_unchecked",width:18,height:18,sx:{path:{fill:s.palette.common.white}}}),checkedIcon:d.jsx(Me,{src:"ic_checked",width:18,height:18,sx:{"path:first-of-type":{fill:s.palette.primary.main}}}),checked:r.includes(t.value)}),d.jsx(E.Chip,{icon:n(t.title,s),sx:{backgroundColor:i(t.title,s),color:s.palette.text.primary,boxShadow:"none",borderRadius:"1.5rem",padding:"1px 4px",height:"fit-content",fontSize:"12px",fontWeight:"500","& span":{p:0,letterSpacing:"0.5px",ml:1},border:"1px solid",borderColor:o(t.title,s)},label:t.title})]})},foe=e=>{const{options:t,optionUi:r,allValueSelectedText:n,getStatusIcon:i,getStatusBackground:o,getBorderColor:s,...a}=e,l=t||Uue,u=r||Udt,c=n||"All status";return d.jsx(doe,{allValueSelectedText:c,options:l,optionUi:u,getStatusIcon:i,getStatusBackground:o,getBorderColor:s,...a})},Hdt=e=>{const t=E.useTheme(),{options:r=[],selectedValue:n,onChange:i,width:o="11rem",searchable:s=!1,searchPlaceholder:a}=e,[l,u]=b.useState(!1),[c,f]=b.useState(""),p=b.useCallback(()=>u(m=>!m),[]),h=m=>{m.currentTarget.contains(m.relatedTarget)||u(!1)},A=b.useMemo(()=>{if(!s||!c.trim())return r;const m=c.toLowerCase();return r.filter(y=>String(y.title||"").toLowerCase().includes(m))},[r,s,c]),g=b.useCallback(m=>{const y=r.find(O=>String(O.value)===String(m));return d.jsx(E.Typography,{color:t.palette.text.tertiary,children:y?y.title:"Select version"})},[r,t.palette.text.tertiary]);return d.jsx(E.FormControl,{sx:{width:o},children:d.jsxs(E.Select,{open:l,multiple:!1,value:n??"",onChange:m=>i(m.target.value||null),renderValue:g,sx:{height:36},displayEmpty:!0,onBlur:h,onClick:p,MenuProps:{PaperProps:{style:{maxHeight:300}}},children:[s&&d.jsx(E.MenuItem,{disableRipple:!0,disableTouchRipple:!0,sx:{pt:1,pb:1,"&.MuiMenuItem-root:hover":{backgroundColor:"transparent"},"&.MuiMenuItem-root.Mui-focusVisible":{backgroundColor:"transparent"},"&.Mui-selected":{backgroundColor:"transparent",borderColor:"transparent"},"&.Mui-selected:hover":{backgroundColor:"transparent",borderColor:"transparent"}},onClick:m=>m.stopPropagation(),children:d.jsx(E.OutlinedInput,{size:"small",placeholder:a||"Search versions...",value:c,onChange:m=>f(m.target.value),sx:{width:"100%",backgroundColor:"transparent","& .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:t.palette.neutral.outlined.border},"& .MuiInputBase-input":{backgroundColor:"transparent"}}})}),A.map(m=>d.jsx(E.MenuItem,{value:m.value,sx:{py:1,px:1.5},children:m.title},String(m.value)))]})})},Vdt=e=>{const t=E.useTheme(),{isAccountLevel:r,workflowsOptions:n,selectedWorkflowIds:i,setSelectedWorkflowIds:o,onWorkflowsChange:s,executionIdSingle:a,setExecutionIdSingle:l,onExecutionSearch:u,selectedValues:c,onStatusChange:f,showAdvancedFilters:p,setShowAdvancedFilters:h,selectedStartDate:A,selectedEndDate:g,setSelectedStartDate:m,setSelectedEndDate:y,onDateChange:O,clearDates:v,selectedModes:T,onExecutionTypeChange:C,selectedExecutionIds:x,isRetrying:_,onRetrySelected:w,onRefresh:D,versionsOptions:I,selectedVersionId:P,onVersionChange:k}=e,N=!!(A||g||T&&T.length>0);return d.jsx(E.Stack,{children:d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",flexWrap:"wrap",sx:{width:"100%",mb:1.5},children:[d.jsxs(E.Stack,{direction:"row",justifyContent:"flex-start",alignItems:"center",flexWrap:"wrap",gap:1.5,sx:{flex:1},children:[r&&d.jsxs(E.Box,{sx:{width:"20rem"},children:[d.jsx(E.Typography,{variant:"xsBold",children:"Workflow"}),d.jsx(E.Box,{children:d.jsx(foe,{allValueSelectedText:"All workflows",options:n.map(L=>({value:L.id,title:L.name,status:L.status,version:L.version})),width:"20rem",searchable:!0,searchPlaceholder:"Search workflows...",selectedValues:i,handleChange:L=>{const F=L?.target?.value||[],B=Array.isArray(F)?F:String(F).split(",").filter(Boolean);o(B),s(B)},optionUi:({status:L,selectedValues:F})=>d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",width:"100%",children:[d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[d.jsx(E.Checkbox,{checked:F.includes(L.value)}),d.jsx(E.Typography,{variant:"body2",children:L.title})]}),d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[L.status?d.jsx(E.Chip,{label:Ns(L.status),size:"small",sx:{borderRadius:"0.5rem"}}):null,L.version?d.jsx(E.Chip,{label:L.version,size:"small",variant:"outlined",sx:{borderRadius:"0.5rem"}}):null]})]})})})]}),d.jsxs(E.Box,{children:[d.jsx(E.Typography,{variant:"xsBold",children:"Execution ID"}),d.jsx(E.Box,{children:d.jsx(E.OutlinedInput,{sx:{width:"230px","&.MuiInputBase-root.MuiOutlinedInput-root":{pl:1}},placeholder:"Search by Execution ID",value:a,onChange:L=>{const{value:F}=L.target;l(F),F===""&&u(F)},onKeyDown:L=>{L.keyCode===13&&u(a)},startAdornment:d.jsx(E.InputAdornment,{position:"start",sx:{m:0,pr:.5},children:d.jsx(Me,{src:"ic_search",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}})}),endAdornment:a&&d.jsx(E.IconButton,{sx:{height:"100%"},"aria-label":"clear field",onClick:()=>u(""),"data-testid":"clear-execution-id",children:d.jsx(Me,{src:"ic_close",width:24,height:24})})})})]}),!r&&d.jsxs(E.Box,{children:[d.jsx(E.Typography,{variant:"xsBold",children:"Version"}),d.jsx(E.Stack,{direction:"row",alignItems:"center",gap:1,children:d.jsx(Hdt,{options:(I||[]).map(L=>({value:L.id,title:L.status==="draft"?"Draft":`v${L.version}`})),selectedValue:P||null,onChange:L=>k?.(L),width:"11rem"})})]}),d.jsxs(E.Box,{children:[d.jsx(E.Typography,{variant:"xsBold",children:"Status"}),d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,children:[d.jsx(foe,{selectedValues:c,handleChange:f,getStatusIcon:noe,getStatusBackground:k6,getBorderColor:M6}),d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:p?"Hide filters":"More filters",children:d.jsxs(E.Box,{sx:{position:"relative",display:"inline-flex",ml:1},children:[d.jsx(E.IconButton,{"aria-label":"toggle more filters",size:"small",sx:{height:32,width:34,border:"1px solid",borderColor:t.palette.neutral.outlined.border},onClick:()=>h(L=>!L),"data-testid":"toggle-more-filters",children:d.jsx(Me,{src:"ic_filter",width:24,height:24})}),N&&d.jsx(E.Box,{sx:{position:"absolute",top:6,right:6,width:8,height:8,borderRadius:"50%",bgcolor:t.palette.primary.main}})]})})]})]}),p&&d.jsxs(d.Fragment,{children:[d.jsx(E.Box,{sx:{"& input":{width:180},"& .MuiButtonBase-root.MuiPickersDay-root":{width:40,height:40,"&.Mui-selected":{backgroundColor:t.palette.primary.main,color:t.palette.common.white},"&.Mui-selected:hover":{backgroundColor:t.palette.primary.main,color:t.palette.common.white},"&.Mui-selected:focus-visible":{backgroundColor:t.palette.primary.main,color:t.palette.common.white}},"& .MuiList-root.MuiMultiSectionDigitalClockSection-root":{width:"fit-content",display:"flex",flexDirection:"column",gap:1.5},"& .MuiMultiSectionDigitalClock-root .MuiList-root.MuiList-padding":{my:1.5},"& .MuiButtonBase-root.MuiMenuItem-root.MuiMultiSectionDigitalClockSection-item":{mx:1.5,my:0,p:.25,"&.MuiMenuItem-root.MuiMultiSectionDigitalClockSection-item":{minWidth:0,width:28,height:28,borderRadius:1},"&.Mui-selected":{backgroundColor:t.palette.primary.main,color:t.palette.common.white},"&.Mui-selected:hover":{backgroundColor:t.palette.primary.main,color:t.palette.common.white},"&.Mui-selected:focus-visible":{backgroundColor:t.palette.primary.main,color:t.palette.common.white}},"& .MuiButtonBase-root.MuiButton-root":{color:t.palette.primary.main}},children:d.jsx(Fdt,{startDate:A,endDate:g,onStartDateChange:L=>{m(L)},onEndDateChange:L=>{y(L)},acceptDateStart:L=>{O("start_date",L)},acceptDatesEnd:L=>{O("end_date",L)},startMinDateTime:Sr().subtract(1,"month").toDate(),startMaxDateTime:Sr().toDate(),endMinDateTime:Sr().subtract(1,"month").toDate(),endMaxDateTime:Sr().toDate(),clearStart:()=>v("start_date"),clearEnd:()=>v("end_date"),toolTipStartDate:"Can select upto last 30 days"})}),d.jsxs(E.Box,{children:[d.jsx(E.Typography,{variant:"xsBold",children:"Triggers"}),d.jsx(E.Box,{children:d.jsx($dt,{handleChange:C,selectedValues:T})})]})]})]}),d.jsxs(E.Stack,{mt:3,direction:"row",alignItems:"center",gap:1,children:[d.jsxs(E.Box,{sx:{position:"relative",display:"inline-flex",alignContent:"center",color:t.palette.text.tertiary},children:["Refreshes in ",e.refreshCountdown||0,"s"]}),d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:"Force Refresh",children:d.jsx(E.Box,{sx:{position:"relative",display:"inline-flex"},children:d.jsx(E.IconButton,{sx:{border:"1px solid",borderColor:t.palette.neutral.outlined.border,...Ri(t)},onClick:D,"data-testid":"refresh-button",children:d.jsx(Me,{src:"ic_refresh",width:20,height:20})})})}),d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:"Retry failed selection",children:d.jsx("span",{children:d.jsxs(E.Button,{variant:"contained",size:"small",disabled:x.length===0||_,onClick:w,"data-testid":"retry-button",sx:{padding:"6px 12px",minHeight:"32px",height:"32px",minWidth:"64px",fontSize:"14px"},children:["Retry ",x.length>0?`(${x.length})`:""]})})})]})]})})},poe="420px",Gdt=({data:e})=>{const t=E.useTheme(),[r,n]=b.useState("Payload"),[i,o]=b.useState("GUI"),[s,a]=b.useState(""),l=b.useMemo(()=>rw(e||{}),[e]),u=l?.payload,c=l?.global_variables,f=b.useMemo(()=>{const w={};return l?.http&&(w.http=l.http),l?.webhook&&(w.webhook=l.webhook),Object.keys(w).length?w:null},[l]),p=b.useMemo(()=>{const w={...l};return delete w.payload,delete w.global_variables,delete w.http,delete w.webhook,Object.keys(w).length?w:null},[l]),h=b.useMemo(()=>ol(u,s),[u,s]),A=b.useMemo(()=>ol(c,s),[c,s]),g=b.useMemo(()=>ol(f,s),[f,s]),m=b.useMemo(()=>{const w=g;if(w&&typeof w=="object"&&!Array.isArray(w)){const D=Object.keys(w);if(D.length===1&&(D[0]==="http"||D[0]==="webhook"))return w[D[0]]}return w},[g]),y=b.useMemo(()=>ol(p,s),[p,s]),O=l?.webhook?"Webhook":l?.http?"HTTP":null,v=["Payload","Global Variables",...O?[O]:[],"Miscelaneous"],T=v.includes(r)?r:v[0],C=b.useMemo(()=>{switch(T){case"Payload":return h;case"Global Variables":return A;case O:return m;case"Miscelaneous":return y;default:return h}},[T,O,h,A,m,y]),x=b.useMemo(()=>{if(Ot(C))return"{}";try{return JSON.stringify(C,null,2)}catch{return String(C)}},[C]),_=T==="Payload"||T==="Global Variables"?"{}":T.toLowerCase();return d.jsxs(E.Box,{sx:{width:"100%"},children:[d.jsxs(E.Stack,{direction:"row",sx:{...si,borderBottom:1,borderColor:"divider"},children:[d.jsx(Po,{variant:"normal",tabs:v.map(w=>({title:w})),selectedTab:T,setSelectedTab:w=>n(w),textTransform:"none",sx:{fontSize:14,mt:"8px !important",minHeight:"30px",color:"black",fontWeight:600,border:"none","& .MuiTabs-indicator":{display:"block !important",position:"relative",top:-.5,backgroundColor:t.palette.common.black,borderRadius:4},"& .MuiButtonBase-root":{mb:"3px"},"& .MuiButtonBase-root.MuiTab-root.Mui-selected":{color:t.palette.common.black+" !important"},"&.MuiTabs-root":{backgroundColor:"white !important",color:"black !important",m:0,pb:0,"& .MuiTabs-flexContainer":{gap:3}}}}),d.jsx(Po,{variant:"normal",tabs:[{title:"GUI"},{title:"Raw"}],selectedTab:i,setSelectedTab:w=>o(w),sx:{"&.MuiTabs-root":{mb:1.5,border:`1px solid ${t.palette.grey.outlined.border}`},"& .MuiButtonBase-root":{fontWeight:600}}})]}),d.jsx(E.Box,{sx:{mt:2},children:d.jsx(E.OutlinedInput,{fullWidth:!0,value:s,onChange:w=>a(w.target.value),placeholder:"Search",startAdornment:d.jsx(E.InputAdornment,{position:"start",sx:{m:0,pr:.5},children:d.jsx(Me,{src:"ic_search",width:24,height:24,sx:{path:{fill:t.palette.neutral.solid.bg}}})}),sx:{"&.MuiInputBase-root.MuiOutlinedInput-root":{pl:1}}})}),d.jsx(E.Box,{sx:{mt:1.5,height:poe,overflow:"auto"},children:i==="GUI"?Ot(C)?d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,sx:{mt:.5},children:[d.jsx(Me,{src:"ic_object",width:16,height:16}),d.jsx(E.Typography,{variant:"smNormal",color:t.palette.text.primary,children:_})]}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(Me,{src:"ic_loading",width:30,height:30})}),children:d.jsx(r0,{data:C,enableEllipsis:!1,highlightText:s,resetKey:T})}):d.jsx(b.Suspense,{fallback:d.jsx(E.Stack,{sx:{...bi,p:2},children:d.jsx(pi,{size:30})}),children:d.jsx(co,{height:poe,size:"lg",readOnly:!0,options:{readOnly:!0},language:"json",handleChange:()=>{},value:x,showCopyToClipboard:!0,showSuggestions:!1})})})]})},hoe={...{fontWeight:500,backgroundColor:"white",textAlign:"left","&.Mui-disabled":{opacity:1,cursor:"not-allowed",borderColor:"neutral.200","&:hover":{bg:"transparent",color:"grey.brainstem"}},"&:focus ":{color:"text.primary",backgroundColor:"white"},"&:hover":{color:"text.primary",backgroundColor:"white"},"&:focus-visible":{outline:"none"},":active":{backgroundColor:"white.smoke"},border:"1px solid",borderColor:"grey[300]",color:"grey.brainstem"}},Wdt={maxHeight:"20rem",border:"1px solid",borderColor:"neutral.300",borderRadius:2,marginTop:1.5},Aoe={"ul:nth-of-type(1)":{padding:0}},Qdt={display:"block",borderColor:"neutral.40",width:"inherit",paddingX:1.5,paddingY:.5,margin:0},zdt={flexWrap:"wrap",padding:0,":hover":{backgroundColor:"transparent"}},Xdt={color:"neutral.800"},qdt={whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},Ydt=b.forwardRef(({onOptionSelect:e,isDisabled:t,required:r,fullWidth:n,supportText:i="",width:o="100%",name:s="",label:a="",leftItem:l="",placeholder:u="",options:c,value:f="",size:p="medium",multiSelect:h=!1,valueString:A="",headerRightElement:g=null,...m},y)=>{const O=E.useTheme(),[v,T]=b.useState(f),[C,x]=b.useState(-1),[_,w]=b.useState(c),D=b.useRef(null),[I,P]=b.useState(null),k=!!I,N=(c||[]).filter($=>$.isSelected===!0).length,L=()=>{setTimeout(()=>{P(null)},0)},F=$=>{P($.currentTarget)},B=$=>{const{key:Y}=$,X=_?.length||0;if(Y==="ArrowDown")x(H=>H<X-1?H+1:H);else if(Y==="ArrowUp")x(H=>H>0?H-1:H);else if(Y==="Enter"){const H=_?.[C];Q(H)}};b.useEffect(()=>{T(f)},[f]),b.useEffect(()=>{w(c)},[c]);const Q=$=>{const Y=$?.value,X=$?.label,H=c?.find(W=>W.value===Y);h?e?.($,s):H&&(e?.($,s),T(X),L())},V=d.jsx(Me,{src:"ic_arrow_up_down",width:18,height:18,sx:{path:{fill:O.palette.text.icon}}}),q={pagination:{styles:{...hoe,paddingX:12,paddingY:8,color:v||N?"black.chinese":"grey.brainstem",borderRadius:2,width:o,justifyContent:"flex-start",gap:1,height:32},props:{variant:"xsMedium"}},medium:{styles:{...hoe,borderRadius:2,paddingX:8,paddingY:6,color:v||N?"black.chinese":"grey.brainstem",width:o,justifyContent:"flex-start",gap:1,height:32,"&.Mui-focusVisible":{border:"1px solid",borderColor:"primary.main",boxShadow:"activeShadow"}},props:{variant:"smMedium"}},large:{}},M={pagination:{styles:{...Aoe},props:{optionValueVariant:"smMedium",supportTextVariant:"xsMedium",rightElementVariant:"xsMedium"}},medium:{styles:{...Aoe},props:{optionValueVariant:"smNormal",supportTextVariant:"xsNormal",rightElementVariant:"xsNormal"}},large:{}},{props:{supportTextVariant:G="xsMedium",optionValueVariant:U="smNormal",rightElementVariant:R="xsMedium"}={},styles:j}=M[p];return d.jsxs(E.FormControl,{"aria-label":"dropdown",fullWidth:n,children:[(g||a)&&d.jsxs(E.Stack,{alignItems:"flex-start",justifyContent:g?"space-between":"flex-start",width:o,direction:"row",ref:y,children:[a&&d.jsxs(E.Typography,{sx:{...Xdt,opacity:t?.4:1},variant:"xsMedium",color:"neutral.800",children:[a,r&&d.jsx(E.Typography,{variant:"smNormal",component:"span",color:"error.50",children:" *"})]}),g]}),d.jsx(E.Button,{disabled:t,sx:{...q[p].styles,...k&&{borderColor:"primary.main",boxShadow:"activeShadow"},width:"100%",minWidth:52,"&.MuiButton-root":{textTransform:"none",padding:"8px 6px"}},ref:D,"aria-label":"more",id:"long-button","aria-controls":k?"long-menu":void 0,"aria-expanded":k?"true":void 0,"aria-haspopup":"true",onClick:F,component:"button","data-testid":`dropdown-${s||"button"}`,...(function(){const{onChange:$,...Y}=m;return Y})(),fullWidth:!0,children:d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",width:"100%",alignItems:"center",gap:1,sx:{minWidth:0},children:[d.jsxs(E.Stack,{direction:"row",gap:1,alignItems:"center",children:[l,d.jsx(E.Typography,{title:A||v||u,sx:{color:"text.primary",width:"auto",...qdt},variant:q[p].props.variant,children:A||v||u})]}),V]})}),d.jsx(E.Menu,{id:"long-menu",MenuListProps:{"aria-labelledby":"long-button"},anchorEl:I,open:k,onClose:L,sx:j,"data-testid":`dropdown-menu-${s||"options"}`,slotProps:{paper:{sx:{...Wdt,width:"fit-content"}}},onKeyDown:$=>{B($)},children:d.jsx(E.Stack,{gap:0,width:"100%",sx:{outline:"none"},children:(_||[]).map(($,Y)=>{const{value:X,label:H,leftIcon:W,rightElement:z,optionSupportText:K,isSelected:Z}=$;return d.jsx(E.MenuItem,{tabIndex:Y,role:"<option>",selected:Z===!0,sx:{...Qdt,width:"100%",backgroundColor:C===Y?"neutral.20":""},onClick:()=>Q($),title:H,"data-testid":`dropdown-option-${X||Y}`,children:d.jsxs(E.Stack,{width:"100%",onChange:()=>Q($),direction:"row",alignItems:K?"flex-start":"center",gap:8,children:[h&&d.jsx(E.Checkbox,{sx:{...zdt},icon:d.jsx(Me,{src:"ic_unchecked",width:16,height:16,sx:{path:{fill:O.palette.common.white}}}),checkedIcon:d.jsx(Me,{src:"ic_checked",width:16,height:16}),onChange:()=>Q($),checked:Z,size:"medium","data-testid":`checkbox-${X||Y}`}),W&&!h?W:null,d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",width:"100%",gap:12,children:[d.jsxs(E.Stack,{alignItems:"flex-start",children:[d.jsx(E.Typography,{sx:{color:Z?"text.primary":"neutral.plain"},variant:U,title:H,children:H}),K&&d.jsx(E.Typography,{sx:{flexWrap:"wrap",color:Z?"primary.main":"text.primary"},variant:G,children:K})]}),z&&d.jsx(E.Typography,{variant:R,sx:{color:Z?"primary.main":"neutral.80"},children:z})]})]})},X)})})}),i&&d.jsx(E.Typography,{variant:"smNormal",sx:{color:"gray.80",mt:2,opacity:t?.4:1},children:i})]})}),Kdt=e=>{const t=E.useTheme(),{name:r="",pageSizeOptions:n=[10,20,50,100],defaultPageSize:i=10,value:o={limit:0,total:0,current:0,prevPage:!1,nextPage:!1,currentPage:"",currentTotal:0,prev_id:null,next_id:null,type:"page"},mode:s=o.type,onChange:a=()=>{},onPreviousClick:l=()=>{},onNextClick:u=()=>{},visiblePagesNodeCount:c=null,isLoading:f=!1}=e,[p,h]=b.useState(o),{prev_id:A,next_id:g}=o;let m=10;i?m=i:n&&n.length>0&&(m=n[0]);const[y,O]=b.useState(m),v=n?.map(M=>({label:M.toString(),value:M.toString(),isSelected:M===y})),[T,C]=b.useState(v),x=b.useRef(!0),_={...bi,border:"1px solid",borderColor:t.palette.grey[300],borderRadius:1.25,height:32,width:32};b.useEffect(()=>{if(w(),x?.current){x.current=!1;return}else k()},[p.limit,p.current]),b.useEffect(()=>{},[c]);const w=()=>{p.current||h({...p,current:1})},D=()=>{if(p.total){if(p.current===1)return;const M=p.current?p.current-1:0;h({...p,current:M})}else l&&l()},I=()=>{if(p.total){const M=N()||1;if(p.current&&p.current>=M){h({...p,current:M});return}if(M===0){h({...p,current:0});return}const G=p.current?p.current+1:1;h({...p,current:G})}else u&&u()},P=M=>{C(T.map(G=>G.value===M.value?(h(s==="cursor"?{...p,current:1,limit:M.value,nextPage:!0,prevPage:!1,currentPage:""}:{...p,current:1,limit:Number(M.value)}),O(Number(M.value)),{...G,isSelected:!G.isSelected}):{...G,isSelected:!1}))},k=()=>{a&&a(p)},N=()=>p.limit&&p.limit>0?p.total&&Math.ceil(p.total/p.limit):0,L=()=>p.limit&&p.limit*(p.current?p.current-1:0)+1,F=()=>p.limit&&p.current&&p.total&&(p.limit*p.current<p.total?p.limit*p.current:p.total),B=()=>{let M=" ";return Q()?(M=`${L()} - ${F()}`,M+=` of ${p.total}`):p.currentTotal?M=`${p.currentTotal} ${r}`:M="",M},Q=()=>!!p.total,V=p.total&&p.current>1||A,q=p.total&&p.current&&p.current<(N()||0)||g;return d.jsx(E.Stack,{children:f?d.jsx(E.Stack,{direction:"row",justifyContent:"flex-end",children:d.jsx(E.Skeleton,{height:"3rem",width:"20rem"})}):d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"flex-end",sx:{position:"sticky",bottom:0,background:M=>M.palette.common.white,color:"text.secondary"},"data-testid":"pagination-container",children:[d.jsxs(E.Stack,{direction:"row",flex:1,justifyContent:"flex-end",gap:1,alignItems:"center",children:[d.jsx(E.Typography,{variant:"smNormal",children:"Rows per page:"}),d.jsx(Ydt,{value:y.toString(),options:T,onOptionSelect:P,placeholder:"Page Size",width:"3.125rem",size:"pagination","data-testid":"pagination-dropdown"})]}),s==="page"&&d.jsx(E.Typography,{variant:"smNormal","data-testid":"pagination-count",mx:1.5,my:.75,children:B()}),d.jsxs(E.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[d.jsx(E.Box,{ml:1,onClick:V?D:void 0,sx:{cursor:V?"pointer":"not-allowed",opacity:V?1:.4,..._},"data-testid":"btnPrevious",children:d.jsx(Me,{src:"ic_arrow_left",height:"1.25rem",width:"1.25rem",sx:{cursor:V?"pointer":"not-allowed",opacity:V?1:.4,path:{fill:t.palette.neutral.plain}}})}),d.jsx(E.Box,{onClick:q?I:void 0,sx:{cursor:q?"pointer":"not-allowed",opacity:q?1:.4,..._},"data-testid":"btnNext",children:d.jsx(Me,{src:"ic_arrow_right",height:"1.25rem",width:"1.25rem",sx:{cursor:q?"pointer":"not-allowed",path:{fill:t.palette.neutral.plain}}})})]})]})})},Zdt=b.memo(Kdt),Jdt=({columns:e,rows:t,id:r,isLoading:n,isTableLoading:i=!1,pageProps:o,setPageProps:s,emptyPageProps:a={},dataTestid:l="",height:u,tableHeader:c,showHeader:f=!1,customEmptyPage:p=null,onRowClick:h=()=>{},onPaginationChange:A=null,getRowSx:g=null,getRowTooltip:m=null})=>{const{items:y=[],page:{current:O=1,has_next:v=!1,has_previous:T=!1,item_total:C=0,size:x=10,prev_id:_=null,next_id:w=null,type:D="page"}={}}=t||{},I={id:"1",name:"Pages",value:{limit:x,total:C,current:O,prevPage:T,nextPage:v,currentPage:"",currentTotal:C,prev_id:_,next_id:w,type:D},defaultPageSize:o.per_page,visiblePagesNodeCount:10,onChange:P=>{const{limit:k,current:N}=P;s(D==="cursor"?{...o,per_page:k,prev_id:null,next_id:null}:{...o,per_page:k,page:N})},onPreviousClick:()=>{A?A("previous",{prev_id:_,next_id:null}):T&&D==="page"?s({...o,page:o.page-1}):D==="cursor"&&s({...o,prev_id:_,next_id:null})},onNextClick:()=>{A?A("next",{prev_id:null,next_id:w}):v&&D==="page"?s({...o,page:o.page+1}):D==="cursor"&&s({...o,prev_id:null,next_id:w})},isLoading:i};return d.jsxs(E.Stack,{children:[c&&(f||y.length>0&&!n&&!i)&&d.jsx(E.Stack,{pb:2,children:c}),(y.length>0||n||i)&&d.jsx(E.TableContainer,{sx:{overflow:"auto",display:"flex",flexDirection:"column",justifyContent:"space-between",width:"100%",height:u||"100%",background:P=>P.palette.common.white,borderRadius:2,border:P=>`1px solid ${P.palette.grey.outlined.border}`},"data-testid":l,children:d.jsxs(E.Table,{stickyHeader:!0,sx:{width:"100%"},children:[d.jsx(E.TableHead,{"data-id":"table-header",children:d.jsx(E.TableRow,{children:e?.map((P,k)=>d.jsx(E.TableCell,{width:P.width||"auto",sx:{px:2,py:"0",height:44,textAlign:k===e.length-1?"right":"left",backgroundColor:N=>N.palette.white.smoke,borderBottom:N=>`1px solid ${N.palette.grey.outlined.border}`},children:typeof P.renderHeader=="function"?P.renderHeader({rows:y}):d.jsx(E.Typography,{sx:{letterSpacing:"normal",fontWeight:600},variant:"xsSemiBold",color:N=>N.palette.text.primary,children:P.headerName})},r+P.field))})}),d.jsx(E.TableBody,{sx:{overflow:"auto"},children:i?[...Array(10)].map((P,k)=>d.jsx(E.TableRow,{"data-testid":"table-skeleton-row",children:[...Array(e.length)].map((N,L)=>d.jsx(E.TableCell,{children:d.jsx(E.Skeleton,{height:"auto",width:"auto"})},"dataSkeleton"+L))},"rowSkeleton"+k)):y?.length>0&&y?.map((P,k)=>{const N=m?m(P):"",L=d.jsx(E.TableRow,{hover:!0,"data-id":`table-row-${P.id}`,onClick:()=>{h(P)},sx:{cursor:h?"pointer":"auto",...g?g(P):{}},children:e.map((F,B)=>d.jsx(E.TableCell,{sx:{px:2,py:1.25,color:"text.secondary","& .MuiTypography-root":{justifyContent:B===e.length-1?"right":"left"}},children:F.renderCell?F.renderCell({row:P,value:P[F.field]}):P[F.field]},F.field))},"tableRow"+(P.id||k));return N?d.jsx(E.Tooltip,{arrow:!0,placement:"top",title:N,children:L},"tableRowTooltip"+(P.id||k)):L})})]})}),y.length===0&&!n&&!i&&(p||d.jsx(E.Stack,{sx:{margin:"0 auto",bg:"white",height:"100%",width:"100%",borderRadius:"0 0 1.5rem 1.5rem",justifyContent:"center",alignItems:"center"},children:d.jsx(soe,{title:a.title||"No data available",subtitle:a.description||"","data-id":"table-empty-page"})})),y.length>0&&o&&d.jsx(E.Stack,{p:1.5,children:d.jsx(Zdt,{...I,"data-id":"table-pagination"})})]})},eft=({VORTEX_MAIN_URL:e,ENTITY_ID:t})=>{const[r,n]=b.useState({data:[],pagination:{per_page:10,prev_id:null,next_id:null},loading:!1}),[i,o]=b.useState([]),[s,a]=b.useState([]),l=(f=[])=>f.map(p=>{const h=p?.status,A=p?.meta?.system_retried||p?.meta?.user_retried?"1":"0",g=p?.execution_mode||"";return`${p?.id}|${h}|${A}|${g}|${p?.created_at}`}).join("::"),u=b.useCallback(async(f,p)=>{const h=p?.silent===!0;h||n(A=>({...A,loading:!0}));try{if(!e){n({data:[],pagination:{per_page:f?.per_page||10,prev_id:null,next_id:null},loading:!1});return}const A=Yt(e,`/v1.0/${t}`,"/executions"),m={...f,...s.length?{workflow_ids:s}:{}},y=await qt.get(A,{params:m}),O=y?.data?.data||[],v=y?.data?.pagination||{per_page:f?.per_page||10,prev_id:null,next_id:null};if(h&&p?.compareWith){const T=l(p.compareWith),C=l(O);if(T===C){n(x=>({...x,loading:!1}));return}}n({data:O,pagination:v,loading:!1})}catch{n({data:[],pagination:{per_page:f?.per_page||10,prev_id:null,next_id:null},loading:!1})}},[e,t,s]),c=b.useCallback(async()=>{if(!(!e||!t))try{const f=Yt(e,`/v1.0/${t}`,"/workflows"),A=((await qt.get(f,{params:{page:1,per_page:999,all:!0}}))?.data?.data||[]).map(g=>({id:g?.id,name:g?.name,status:g?.status,version:g?.version}));o(A)}catch{o([])}},[e,t]);return{altExecutions:r,setAltExecutions:n,fetchAlternateExecutions:u,workflowsOptions:i,fetchWorkflowsOptions:c,selectedWorkflowIds:s,setSelectedWorkflowIds:a}},tft=(e,t=15)=>{const[r,n]=b.useState(t),i=b.useRef(null);b.useEffect(()=>(i.current&&window.clearInterval(i.current),n(t),i.current=window.setInterval(()=>{n(s=>s<=1?(e(),t):s-1)},1e3),()=>{i.current&&window.clearInterval(i.current),i.current=null}),[e,t]);const o=b.useCallback(()=>{n(t)},[t]);return{refreshCountdown:r,resetCountdown:o}},moe=e=>{const r=new URLSearchParams(window.location.search).get("source")?.toLowerCase(),i=N4(e).split("/");return i.pop(),`${i.join("/")}${r?`?source=${r}`:""}`},rft=e=>z4.includes(e),Wx=e=>e?.workflow_id||e?.workflowId||e?.workflow?.id||null,nft=e=>!!e?.meta?.system_retried||!!e?.meta?.user_retried,goe=(e=[])=>e.map(t=>{const r=t?.status,n=t?.meta?.system_retried||t?.meta?.user_retried?"1":"0",i=t?.execution_mode||"";return`${t?.id}|${r}|${n}|${i}|${t?.created_at}`}).join("::"),Eoe=e=>e?new Date(e*1e3).toISOString():"",ift=(e,t,r,n,i,o,s,a,l,u)=>{const c=E.useTheme(),p=new URLSearchParams(window.location.search).get("source")?.toLowerCase(),h=moe(window.location.pathname);return b.useMemo(()=>[{label:e?.name,path:e?.status!=="draft"?`/accounts/${s}/workflow-builder/${e?.status}/${e?.meta.draft_id}/version/${t}${p?`?source=${p}`:""}`:`/accounts/${s}/workflow-builder/draft/${t}${p?`?source=${p}`:""}`,color:c.palette.text.primary,textStyle:"mdNormal"},{label:r!=="Draft"?`Version ${r}`:"Draft",path:e?.status!=="draft"?`/accounts/${s}/workflow-builder/${e?.status}/${e?.meta.draft_id}/version/${t}${p?`?source=${p}`:""}`:`/accounts/${s}/workflow-builder/draft/${t}${p?`?source=${p}`:""}`,color:c.palette.text.primary,textStyle:"mdNormal"},{label:"Execution history",path:o?h:void 0,color:i?c.palette.text.primary:c.palette.neutral.solid.bg,textStyle:"mdNormal",onClick:()=>{l(!1),u(!0),a(h)}},...i?[{label:`${n} (${t===e?.meta?.draft_id?"Draft":r})`,color:c.palette.neutral.solid.bg,textStyle:"mdNormal",onClick:()=>u(!1)}]:[]],[e,t,r,n,i,o,s,p,c,h,a,l,u])},oft=(e,t,r,n,i,o,s,a,l)=>{const u=At.useDispatch(),[c,f]=b.useState(null),[p,h]=b.useState(!0),[A,g]=b.useState(!1),[m,y]=b.useState(!1),O=b.useRef(!1),v=b.useRef(!1),T=b.useCallback(async(x,_)=>{const w=!!_?.silent,D=!!_?.isPagination,I={...i.current,execution_source:"full",...x||{}};if(!n&&!e){f("Workflow id not found in the current URL."),h(!1),g(!1);return}w||(O.current=!0,v.current=D,D||h(!0));try{if(n){await o(I,{silent:w,compareWith:s.current}),w||(f(null),y(!0),D?g(!1):h(!1));return}const P=l??e;if(w){const k=Yt(t,`/v1.0/${r}/`,`workflows/executions/${P}`),N=await qt.get(k,{params:I}),L=N?.data?.data||[],F=N?.data?.pagination,B=goe(s.current),Q=goe(L);B!==Q&&u({type:Dr.FETCH_EXECUTIONS_BY_WORKFLOW_ID_SUCCESS,payload:{data:L,pagination:F}}),f(null),y(!0)}else u(Yp(P,I,t,r,a)),f(null)}catch(P){const k=B4(P)||"Unable to fetch executions. Please try again.";f(k),y(!0),w||(D?g(!1):h(!1))}},[n,r,e,t,u,a,o,i,s,l]),C=At.useSelector(x=>x.workflows.executions.loading);return b.useEffect(()=>{n||O.current&&(C===!1?(h(!1),g(!1),y(!0),v.current=!1):v.current||h(!0))},[C,n]),{runFetchListing:T,fetchError:c,setFetchError:f,isLoading:p,setIsLoading:h,isExecutionsLoading:A,setIsExecutionsLoading:g,initialLoadComplete:m,setInitialLoadComplete:y,hasRequestedRef:O}},sft=(e,t,r,n,i,o,s,a,l,u,c,f,p,h)=>{const A=At.useDispatch(),g=b.useCallback(T=>{const C=T.target.value,x=typeof C=="string"?C.split(","):C,_=x.length===0?[]:x;i(_),t(w=>({...w,status:_})),n({status:x.length>0?x.join(","):null}),r()},[i,t,n,r]),m=b.useCallback(T=>{const C=async()=>{if(c){const _={...e.current,execution_id:T,...p.length?{workflow_ids:p}:{}};await f(_)}else await A(Yp(a,{...e.current,execution_id:T,execution_source:"full"},l,u,h));r()},x=_=>{t(w=>({...w,execution_id:_})),s(_)};if(T===""){x(""),n({executionIdSingle:null}),C();return}cb(T)?(n({executionIdSingle:T}),x(T),C()):A({type:Qr,payload:{open:!0,title:"Invalid Execution Id",type:"error"}})},[A,a,l,u,c,f,p,h,e,t,s,n,r]),y=b.useCallback((T,C)=>{const x=T.target.value,_=typeof x=="string"?x.split(","):x,w=C?.props?.value,D=cue.map(I=>I.value);if(w==="all")_.includes("all")?o(D):o([]),t(I=>({...I,type:"all"}));else if(_.includes("test")&&_.includes("automatic")&&_.includes("scheduled"))o(D),t(I=>({...I,type:"all"}));else{const I=_.filter(P=>P!=="all");o(I),t(P=>({...P,type:I.length===0||I.includes("all")?"all":I}))}n({type:_.length>0?_.join(","):null}),r()},[o,t,n,r]),O=b.useCallback((T,C,x)=>{const _=x(T,C);n({[T==="start_date"?"startDate":"endDate"]:_?_.toString():null}),r()},[n,r]),v=b.useCallback((T,C,x)=>{T==="start_date"?C(null):x(null),t(_=>({..._,[T]:""})),n(T==="start_date"?{startDate:null}:{endDate:null}),r()},[t,n,r]);return{handleStatusChange:g,handleExecutionSearch:m,handleExecutionTypeChange:y,handleDateChange:O,clearDates:v}},aft=(e,t,r,n,i)=>{const o=At.useDispatch(),[s,a]=b.useState(!1),[l,u]=b.useState(new Set),c=b.useCallback(h=>{!h||h.length===0||(u(A=>new Set([...A,...h])),window.setTimeout(()=>{u(A=>{const g=new Set(A);return h.forEach(m=>g.delete(m)),g})},1e4))},[]),f=b.useCallback(async h=>{if(h.length!==0){a(!0);try{const A=new Map(r.map(x=>[x.id,x])),g={};h.forEach(x=>{const _=A.get(x),w=Wx(_)||t;w&&(g[w]||(g[w]=[]),g[w].push(x))});const m=await Promise.all(Object.entries(g).map(([x,_])=>e(_,x)));c(h);const y=m.filter(x=>x.success).reduce((x,_)=>x+(_.ids?.length||0),0),O=h.length-y,v=m.filter(x=>!x.success);let T="",C="success";if(O===0)T=`Retry Initiated for ${y} execution(s)`,C="success";else{const x=v.find(_=>_.error&&(_.error.message||_.error.code));if(x?.error){const _=x.error;_.code===402?T=`${_.message}`:_.message?T=_.message:T=`Retry failed: ${JSON.stringify(_)}`}else T=`Retry failed for ${O} execution(s)`;C="error"}o({type:Qr,payload:{open:!0,title:T,type:C}})}finally{a(!1),n(),i(void 0,{silent:!0})}}},[e,t,r,n,i,c,o]),p=b.useCallback(async(h,A)=>{const g=Wx(A),m=await e([h],g);let y="",O="success";if(m.success)y="Retry Initiated for 1 execution(s)",O="success";else{if(m.error&&(m.error.message||m.error.code)){const v=m.error;v.code===402?y=`${v.message}`:v.message?y=v.message:y=`Retry failed: ${JSON.stringify(v)}`}else y="Retry failed";O="error"}o({type:Qr,payload:{open:!0,title:y,type:O}}),c([h])},[e,c,o]);return{isRetrying:s,cooldownIds:l,retrySelected:f,retrySingle:p}},lft=()=>{const e={per_page:10,next_id:null,prev_id:null,type:"all"},[t,r]=b.useState(e),n=b.useRef(t);b.useEffect(()=>{n.current=t},[t]);const[i,o]=b.useState(null),[s,a]=b.useState(null),[l,u]=b.useState([]),[c,f]=b.useState([]),[p,h]=b.useState(!1),[A,g]=b.useState(""),[m,y]=b.useState(!1);return{state:t,setState:r,stateRef:n,selectedStartDate:i,setSelectedStartDate:o,selectedEndDate:s,setSelectedEndDate:a,selectedValues:l,setSelectedValues:u,selectedModes:c,setSelectedModes:f,showAdvancedFilters:p,setShowAdvancedFilters:h,executionIdSingle:A,setExecutionIdSingle:g,paramsProcessed:m,setParamsProcessed:y,resetIds:()=>{r(T=>({...T,prev_id:null,next_id:null}))},updateDate:(T,C)=>{const x=C?Sr(C).unix():null,_=T==="start_date"?"start_date":"end_date";return r(C?w=>({...w,[_]:x}):w=>{const{[_]:D,...I}=w;return I}),x}}},uft=(e,t,r,n,i,o)=>{const[s,a]=b.useState({}),l=b.useRef({});b.useEffect(()=>{l.current=s},[s]);const[u,c]=b.useState({}),f=b.useCallback(async A=>{const g=Wx(A)||e;if(!(!g||!t||!r)){c(m=>({...m,[A.id]:{loading:!0,items:m[A.id]?.items||[]}}));try{const m=Mne(t,r,g,A.id),O=((await qt.get(m))?.data?.data||[]).map((v,T)=>({...v,_isChild:!0,_parentId:A.id,_parentStatus:A.status,_retryIndex:T+1}));c(v=>({...v,[A.id]:{loading:!1,items:O}}))}catch{c(m=>({...m,[A.id]:{loading:!1,items:[]}}))}}},[e,t,r]),p=b.useCallback(A=>{const g=!s[A.id];a(m=>({...m,[A.id]:!m[A.id]})),g&&f(A)},[s,f]),h=b.useCallback(async()=>{const A=Object.keys(l.current).filter(g=>l.current[g]);if(A.length>0){const m=((n?i?.data:o?.data)||[]).filter(y=>A.includes(y.id));await Promise.all(m.map(y=>f(y)))}},[n,i?.data,o?.data,f]);return{expandedRowIds:s,rowRetriesMap:u,toggleExpandRow:p,refreshExpandedRetries:h}},cft=e=>{const t=b.useCallback(i=>{const o=new URLSearchParams(window.location.search);Object.entries(i).forEach(([l,u])=>{u===null||u===""?o.delete(l):o.set(l,u)});const a=`${N4(window.location.pathname)}?${o.toString()}`;e?e(a,{replace:!0}):window.history.replaceState(null,"",`${window.location.pathname}?${o.toString()}`)},[e]),r=b.useCallback(i=>new URLSearchParams(window.location.search).get(i),[]),n=b.useCallback(()=>new URLSearchParams(window.location.search),[]);return{updateURLParams:t,getUrlParam:r,getAllUrlParams:n}},dft=(e,t,r,n,i,o,s,a,l,u,c,f)=>{b.useEffect(()=>{try{const p={};[{key:"status",stateKey:"status",setter:t},{key:"type",stateKey:"type",setter:r},{key:"workflow_ids",stateKey:"workflow_ids",setter:n},{key:"executionIdSingle",stateKey:"execution_id",setter:y=>i(y[0]||"")}].forEach(({key:y,stateKey:O,setter:v})=>{const T=e.get(y);let C=[];if(T)try{const x=JSON.parse(T);Array.isArray(x)&&(C=x.filter(Boolean))}catch{C=T.split(",").filter(Boolean)}C.length&&(v(C),p[O]=C)}),["startDate","endDate"].forEach(y=>{const O=e.get(y);if(O){const v=Sr.unix(parseInt(O)).toDate();y==="startDate"?(o(v),p.start_date=parseInt(O)):(s(v),p.end_date=parseInt(O))}}),i(e.get("executionIdSingle")||"");const A=typeof window<"u"?window.location.pathname:"",g=/\/executions\/[^/?#]+/.test(A),m=!!e.get("executionId");a(!!f||g||m),l(e.get("fromListing")==="true"),u(y=>({...y,...p}))}catch{}finally{c(!0)}},[])},fft=e=>{const t=E.useTheme(),r=At.useDispatch(),{WORKFLOW_URLS:n,ENTITY_ID:i,analytics:o}=_i(),{VORTEX_MAIN_URL:s}=n,a="This execution failed before the workflow could start due to a temporary infrastructure issue. Execution logs are unavailable, use the view icon to see the payload it was triggered with.",{executionId:l="",token:u,api:c,navigate:f,isAccountLevel:p=!1,currentSubscription:h,openUpgradeModal:A}=e,{executions:g}=At.useSelector(xt=>xt.workflows),{workflow:m}=At.useSelector(xt=>xt.workflows),{versions:y}=At.useSelector(xt=>xt.workflows),O=m8(),{updateURLParams:v,getAllUrlParams:T}=cft(f),C=T(),x=new URLSearchParams(window.location.search),_=x.get("source")?.toLowerCase(),{state:w,setState:D,stateRef:I,selectedStartDate:P,setSelectedStartDate:k,selectedEndDate:N,setSelectedEndDate:L,selectedValues:F,setSelectedValues:B,selectedModes:Q,setSelectedModes:V,showAdvancedFilters:q,setShowAdvancedFilters:M,executionIdSingle:G,setExecutionIdSingle:U,paramsProcessed:R,setParamsProcessed:j,resetIds:$,updateDate:Y}=lft(),[X,H]=b.useState(!1),[W,z]=b.useState(!0),[K,Z]=b.useState(""),[se,ne]=b.useState(!1),[le,Oe]=b.useState(null),[ve,ae]=b.useState(null),{selectedExecutionIds:ie,setSelectedExecutionIds:te,clearSelection:J,retryExecutions:re}=ooe({workflowId:O??void 0,VORTEX_MAIN_URL:s,ENTITY_ID:i}),{altExecutions:ue,fetchAlternateExecutions:pe,workflowsOptions:Ae,fetchWorkflowsOptions:fe,selectedWorkflowIds:xe,setSelectedWorkflowIds:Ee}=eft({VORTEX_MAIN_URL:s,ENTITY_ID:i}),ye=p?ue:g,Fe=b.useRef([]);b.useEffect(()=>{Fe.current=(p?ue?.data:g?.data)||[]},[p,ue?.data,g?.data]);const{expandedRowIds:ze,rowRetriesMap:je,toggleExpandRow:rt,refreshExpandedRetries:it}=uft(O,s,i,p,ue,g);dft(C,B,V,Ee,U,k,L,H,ne,D,j,l);const{runFetchListing:et,fetchError:Pe,setFetchError:Ue,isExecutionsLoading:Ge,setIsExecutionsLoading:ge,isLoading:Se,initialLoadComplete:we}=oft(O,s,i,p,I,pe,Fe,o,le);b.useEffect(()=>{if(!R||!w||!i||!p&&!O)return;const xt=!!(w?.next_id||w?.prev_id||w?.start_date||w?.end_date);et(void 0,{isPagination:xt})},[w?.type,w?.status,w?.end_date,w?.start_date,w?.per_page,w?.next_id,w?.prev_id,O,s,i,R,p,et]),b.useEffect(()=>{p&&fe()},[p,fe]);const ee={page:1,per_page:999};b.useEffect(()=>{if(p)return;const xt=m?.meta?.workflow_id||O;xt&&s&&i&&r(Cf(ee,xt,s,i))},[m?.meta?.workflow_id,O,s,i,r,p]),b.useEffect(()=>{if(p||le)return;const xt=y?.data?.data||[];if(!xt||xt.length===0)return;const Jt=O,hr=xt.find(Jr=>String(Jr.id)===String(Jt));if(hr){Oe(hr.id);return}Oe(xt[0]?.id??null)},[y?.data,O,p,le]),b.useEffect(()=>{const xt=le||O;!p&&xt&&s&&i&&r(X4(xt,s,i))},[p,O,le,s,i,r]),b.useEffect(()=>{if(m){const xt=m?.status,Jt=m?.version;Z(xt==="draft"?"Draft":Jt)}},[m]),b.useEffect(()=>{if(p||!le)return;const Jt=(y?.data?.data||[]).find(hr=>String(hr.id)===String(le));if(Jt){const hr=Jt.status==="draft"?"Draft":Jt.version;Z(hr)}},[le,y?.data,p]),(!c||Ot(c))&&u&&JE(u),c&&eO(c),b.useEffect(()=>{J()},[g?.data,ue?.data,w?.next_id,w?.prev_id,w?.per_page,J]);const de=b.useCallback(()=>{if(h&&Array.isArray(h)&&(h?.[0]?.status==="EXPIRED"||h?.[0]?.status==="CANCELLED")){typeof A=="function"&&A();return}Ue(null),et(),it()},[et,it,Ue]),{refreshCountdown:Ce}=tft(b.useCallback(()=>{et(void 0,{silent:!0}),it()},[et,it]),15),{data:He=[]}=ye||{data:{}},{isRetrying:$e,cooldownIds:Ve,retrySelected:Ye,retrySingle:Tt}=aft(re,O,He,J,et),{handleStatusChange:Ie,handleExecutionSearch:nt,handleExecutionTypeChange:at,clearDates:vt}=sft(I,D,$,v,B,V,U,O,s,i,p,pe,xe,o),wt=b.useCallback(xt=>{ge(!0),vt(xt,k,L)},[vt,k,L,ge]),Wt=b.useCallback(xt=>{if(h&&Array.isArray(h)&&(h?.[0]?.status==="EXPIRED"||h?.[0]?.status==="CANCELLED")){typeof A=="function"&&A();return}if(!xt?.id||xt?.meta?.failed_before_start)return;const{id:Jt,workflow_id:hr}=xt,Jr=hr??le??O;if(!Jr)return;const dn=xt?._isChild&&xt._parentId||Jt,pn=xt?._isChild?xt._parentStatus:xt?.status,ar=`/accounts/${i}/workflow-builder/workflow/${Jr}/executions/${Jt}?parentExecutionId=${dn}&parentExecutionStatus=${pn}`;if(p){window.open(Od(ar),"_blank");return}U(""),D(_r=>{const{execution_id:bn,...Ft}=_r;return Ft}),v({executionIdSingle:null}),H(!0),z(!1),f?f(ar):window.open(Od(ar),"_blank")},[O,le,i,p,f,U,D,v,h,A]),It=pdt({theme:t,workflowId:O??void 0,selectedExecutionIds:ie,setSelectedExecutionIds:te,isRetrying:$e,isRetryableStatus:rft,getRowWorkflowId:Wx,hasRetriesAvailable:nft,expandedRowIds:ze,toggleExpandRow:rt,retrySingle:Tt,cooldownIds:Ve,currentSubscription:h,openUpgradeModal:A,onViewPayload:ae}),{pagination:{per_page:Le=10,prev_id:ot=null,next_id:lt=null}={}}=ye||{},Qe=b.useMemo(()=>{const xt=[];return(He||[]).forEach(Jt=>{if(xt.push({...Jt,isChild:!1,run_id:Jt?.run_id||Jt?.id}),ze[Jt.id]&&je[Jt.id]?.items?.length){const hr=je[Jt.id].items.map(Jr=>({...Jr,isChild:!0,run_id:Jr?.run_id||Jr?.id}));xt.push(...hr)}}),xt},[He,ze,je]),dt=b.useCallback((xt,Jt)=>{ge(!0),xt==="start_date"?k(Jt):L(Jt);const hr=Y(xt,Jt);v({[xt==="start_date"?"startDate":"endDate"]:hr?hr.toString():null}),$()},[Y,v,$,k,L,ge]);b.useEffect(()=>{!R||!i||p||!le&&!O||(ge(!0),et(void 0,{isPagination:!0}))},[le]);const Et=x.get("parentExecutionId")||null,Lt=x.get("parentExecutionStatus")||null,De=b.useCallback(()=>{H(!1),z(!0),f(l?moe(window.location.pathname):O?se?`/accounts/${i}/workflow/workflow-builder?size=20&page=1&${_?`source=${_}`:""}`:m?.status!=="draft"?`/accounts/${i}/workflow-builder/${m?.status}/${m?.meta.draft_id}/version/${O}${_?`?source=${_}`:""}`:`/accounts/${i}/workflow-builder/draft/${O}${_?`?source=${_}`:""}`:`/accounts/${i}/workflow/workflow-builder${_?`?source=${_}`:""}`)},[l,O,se,_,i,m,f,H,z]),Ze=ift(m,le||O,K,l,X,W,i,f,H,z),tt=w?.type==="all"&&Ot(w?.status)&&!w?.end_date&&!w?.start_date,Be=b.useCallback((xt,Jt)=>{ge(!0),D(hr=>({...hr,...Jt}))},[]),ct=!we&&!!Se,yt=b.useRef(!1);return b.useEffect(()=>{ct&&(yt.current=!0)},[ct]),b.useEffect(()=>{ct||ge(!1)},[ct,ge]),Pe&&!ct?d.jsx(E.Stack,{height:"100%",alignItems:"center",justifyContent:"center",children:d.jsx(Ec,{title:"Unable to load executions",description:Pe,icon:d.jsx(Me,{src:"ic_error",width:80,height:80}),buttonElement:d.jsx(E.Button,{variant:"contained",onClick:()=>{Ue(null),de()},children:"Retry"})})}):d.jsxs(E.Stack,{height:"100%",overflow:"hidden !important",children:[d.jsx(a5,{}),d.jsx(Ao,{open:!!ve,handleClose:()=>ae(null),variant:"xlarge",title:"Trigger payload",subtitle:ve?.meta?.failed_before_start?"This execution failed before it could start, so run logs aren't available.":"This execution is still pending, so run logs aren't available yet.",content:d.jsx(Gdt,{data:ve?.meta?.request_body})}),ct?d.jsx(E.Stack,{alignItems:"center",justifyContent:"center",sx:{flex:1,minHeight:"calc(100vh - 200px)",width:"100%"},children:d.jsx(pi,{size:60})}):d.jsxs(d.Fragment,{children:[!p&&d.jsx(Mdt,{crumbs:Ze,onBack:De,navigate:f}),X?d.jsx(Ldt,{executionId:l,parentExecutionId:Et,parentExecutionStatus:Lt}):d.jsx(E.Stack,{m:3,gap:2,children:d.jsx(Jdt,{rows:{items:Qe,page:{size:Le,prev_id:ot,next_id:lt,type:"cursor"}},showHeader:!0,onRowClick:xt=>{Wt(xt)},getRowSx:xt=>xt?.meta?.failed_before_start?{cursor:"not-allowed",opacity:.85}:{},getRowTooltip:xt=>xt?.meta?.failed_before_start?a:"",tableHeader:d.jsxs(E.Stack,{children:[d.jsx(Vdt,{isAccountLevel:p,workflowsOptions:Ae,selectedWorkflowIds:xe,setSelectedWorkflowIds:Ee,onWorkflowsChange:xt=>{D(Jt=>({...Jt,workflow_ids:xt.length?xt:void 0,next_id:null,prev_id:null})),v({workflow_ids:xt.length?JSON.stringify(xt):null}),et({workflow_ids:xt.length?xt:void 0,next_id:null,prev_id:null})},executionIdSingle:G,setExecutionIdSingle:U,onExecutionSearch:nt,selectedValues:F,onStatusChange:Ie,showAdvancedFilters:q,setShowAdvancedFilters:M,selectedStartDate:P,selectedEndDate:N,setSelectedStartDate:k,setSelectedEndDate:L,onDateChange:dt,clearDates:wt,selectedModes:Q,onExecutionTypeChange:at,selectedExecutionIds:ie,isRetrying:$e,onRetrySelected:()=>Ye(ie),onRefresh:de,refreshCountdown:Ce,versionsOptions:y?.data?.data||[],selectedVersionId:le,onVersionChange:xt=>{Oe(xt),ge(!0),D(Jt=>({...Jt,next_id:null,prev_id:null}))}}),!p&&d.jsx(ddt,{dashboardId:"boltic-workflow-overview",workflowId:O,startDate:Eoe(w?.start_date),endDate:Eoe(w?.end_date)})]}),height:p?"calc(60vh + 2.5rem)":"calc(55vh + 2.5rem)",columns:It,isLoading:p?!!ue?.loading:!!g.loading,isTableLoading:Ge,pageProps:w,setPageProps:D,onPaginationChange:Be,id:"executions-listing",customEmptyPage:!!we&&He.length===0&&G.length===0&&tt&&!p&&d.jsx(ioe,{workflowId:O??null,executionId:l,state:w,onRefresh:()=>et()})||p&&!!we&&d.jsx(ioe,{workflowId:O??null,executionId:l,state:w,height:"calc(100vh - 20rem)",onRefresh:()=>et()}),dataTestid:"execution-listing-table"})})]})]})},pft=e=>{const{WORKFLOW_URLS:t,ENTITY_ID:r,navigate:n,TOKEN:i,api:o,openIntegrationDrawer:s,INTEGRATION_DATA:a,SET_INTEGRATION_DATA:l,analytics:u,USER_DATA:c,ALERT_TOP_BAR:f,currentSubscription:p,pro_integration:h,allowedAccount:A,openUpgradeModal:g,openAddonModal:m}=e;return JE(i),eO(o),d.jsx(b.StrictMode,{children:d.jsx(At.Provider,{store:zp,children:d.jsx(out,{ALERT_TOP_BAR:f,currentSubscription:p,WORKFLOW_URLS:t,ENTITY_ID:r,openIntegrationDrawer:s,navigate:n,TOKEN:i,INTEGRATION_DATA:a,SET_INTEGRATION_DATA:l,analytics:u,USER_DATA:c,pro_integration:h,allowedAccount:A,openUpgradeModal:g,openAddonModal:m})})})},hft=e=>{const{ENTITY_ID:t,WORKFLOW_URLS:r,navigate:n,Api:i,TOKEN:o,analytics:s,isAccountLevel:a,currentSubscription:l,openUpgradeModal:u,USER_DATA:c}=e,f=At.useSelector(p=>p.customization);return d.jsx(E.ThemeProvider,{theme:e8(f),children:d.jsx(D_,{analytics:s,WORKFLOW_URLS:r,ENTITY_ID:t,userData:c,currentSubscription:l,children:d.jsx(Pt.ReactFlowProvider,{children:d.jsx(fft,{navigate:n,token:o,api:i,isAccountLevel:a??!1,currentSubscription:l,openUpgradeModal:u})})})})},Aft=e=>{const{TOKEN:t,api:r}=e;return JE(t),eO(r),d.jsx(b.StrictMode,{children:d.jsx(At.Provider,{store:zp,children:d.jsx(hft,{...e})})})},mft=e=>{const{ENTITY_ID:t,WORKFLOW_URLS:r,openIntegrationDrawer:n,INTEGRATION_DATA:i,SET_INTEGRATION_DATA:o,selectedNode:s,handleBlockDrawerClose:a,onSubmit:l,drawerWidth:u,setSelectedNode:c,initialState:f,MCP_INTEGRATION_FORM:p,actionRef:h}=e,A=At.useSelector(g=>g.customization);return d.jsx(E.ThemeProvider,{theme:e8(A),children:d.jsx(D_,{analytics:{},WORKFLOW_URLS:r,ENTITY_ID:t,children:d.jsx(Pt.ReactFlowProvider,{children:d.jsx(Zte,{selectedNode:s,onClose:a,onSubmit:l,drawerWidth:u,openIntegrationDrawer:n,initialState:f,setSelectedNode:c,INTEGRATION_DATA:i,SET_INTEGRATION_DATA:o,MCP_INTEGRATION_FORM:p,actionRef:h})})})})},gft=e=>{const{TOKEN:t,api:r}=e;return JE(t),eO(r),d.jsx(b.StrictMode,{children:d.jsx(At.Provider,{store:zp,children:d.jsx(mft,{...e})})})};as.ExecutionData=Aft,as.IntegrationForm=gft,as.WorkflowBuilder=pft,Object.defineProperty(as,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boltic/swirl",
3
- "version": "1.0.2-uat.111",
3
+ "version": "1.0.2-uat.112",
4
4
  "description": "Visual workflow builder library for React — drag-and-drop automation with React Flow and Material-UI",
5
5
  "type": "commonjs",
6
6
  "main": "dist/swirl.umd.js",