@emporix/process-diagram 2.0.0-beta.22 → 2.0.0-beta.24
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/App.d.ts.map +1 -1
- package/dist/Condition.d.ts +6 -0
- package/dist/Condition.d.ts.map +1 -0
- package/dist/Curve.d.ts +6 -0
- package/dist/Curve.d.ts.map +1 -0
- package/dist/Item.d.ts +7 -0
- package/dist/Item.d.ts.map +1 -0
- package/dist/Items.d.ts +6 -0
- package/dist/Items.d.ts.map +1 -0
- package/dist/Row.d.ts +6 -0
- package/dist/Row.d.ts.map +1 -0
- package/dist/Steps.d.ts +13 -0
- package/dist/Steps.d.ts.map +1 -0
- package/dist/components/process-debugger-diagram/DebuggerRow.d.ts.map +1 -1
- package/dist/components/triggers/IfStatement.d.ts +5 -0
- package/dist/components/triggers/IfStatement.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +164 -161
- package/dist/index.mjs.map +1 -1
- package/dist/utils.d.ts +16 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +1 -1
- /package/dist/components/{menu → Menu}/Menu.d.ts +0 -0
- /package/dist/components/{menu → Menu}/Menu.d.ts.map +0 -0
- /package/dist/components/{menu → Menu}/Separator.d.ts +0 -0
- /package/dist/components/{menu → Menu}/Separator.d.ts.map +0 -0
- /package/dist/components/{menu → Menu}/index.d.ts +0 -0
- /package/dist/components/{menu → Menu}/index.d.ts.map +0 -0
package/dist/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAWA,OAAO,mBAAmB,CAAA;AAG1B,QAAA,MAAM,GAAG,+
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAWA,OAAO,mBAAmB,CAAA;AAG1B,QAAA,MAAM,GAAG,+CA0aR,CAAA;AAED,eAAe,GAAG,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Condition.d.ts","sourceRoot":"","sources":["../src/Condition.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS,GAAI,wBAGhB,QAAQ,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,CAAC,4CA0B/D,CAAA;AAED,eAAe,SAAS,CAAA"}
|
package/dist/Curve.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Curve.d.ts","sourceRoot":"","sources":["../src/Curve.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,KAAK,GAAI,oBAGZ,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,4CAyB7C,CAAA;AAED,eAAe,KAAK,CAAA"}
|
package/dist/Item.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../src/Item.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,IAAI,GAAI,8BAIX,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,CAAC,4CAE9E,CAAA;AAED,eAAe,IAAI,CAAA"}
|
package/dist/Items.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Items.d.ts","sourceRoot":"","sources":["../src/Items.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAGnC,QAAA,MAAM,KAAK,GAAI,WAAW,QAAQ,CAAC;IAAE,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAAC,4CAuBpD,CAAA;AAED,eAAe,KAAK,CAAA"}
|
package/dist/Row.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../src/Row.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAMzC,QAAA,MAAM,GAAG,GAAI,WAAW,QAAQ,CAAC;IAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAA;CAAE,CAAC,4CAoI3D,CAAA;AAED,eAAe,GAAG,CAAA"}
|
package/dist/Steps.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PropsWithClassName } from './helpers/props';
|
|
2
|
+
import type { Step } from './types';
|
|
3
|
+
interface Props extends PropsWithClassName {
|
|
4
|
+
steps: Step[];
|
|
5
|
+
onDeleteStep?: (id: string) => void;
|
|
6
|
+
onUpdateFilter?: (id: string) => void;
|
|
7
|
+
onAddStep?: (index: number) => void;
|
|
8
|
+
onAddTrigger?: (index: number) => void;
|
|
9
|
+
onSelectStep: (id: string) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const Steps: ({ steps, className, onDeleteStep, onUpdateFilter, onAddStep, onAddTrigger, onSelectStep, }: Readonly<Props>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default Steps;
|
|
13
|
+
//# sourceMappingURL=Steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../src/Steps.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC,UAAU,KAAM,SAAQ,kBAAkB;IACxC,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC;AAED,QAAA,MAAM,KAAK,GAAI,4FAQZ,QAAQ,CAAC,KAAK,CAAC,4CA4DjB,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebuggerRow.d.ts","sourceRoot":"","sources":["../../../src/components/process-debugger-diagram/DebuggerRow.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAY,IAAI,EAAE,IAAI,EAAc,MAAM,aAAa,CAAA;AAsBnE,UAAU,KAAK;IACb,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACtC;AAED,QAAA,MAAM,WAAW,GAAI,OAAO,QAAQ,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"DebuggerRow.d.ts","sourceRoot":"","sources":["../../../src/components/process-debugger-diagram/DebuggerRow.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAY,IAAI,EAAE,IAAI,EAAc,MAAM,aAAa,CAAA;AAsBnE,UAAU,KAAK;IACb,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACtC;AAED,QAAA,MAAM,WAAW,GAAI,OAAO,QAAQ,CAAC,KAAK,CAAC,4CAsS1C,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IfStatement.d.ts","sourceRoot":"","sources":["../../../src/components/triggers/IfStatement.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,WAAW,GAAI,gBAAgB,QAAQ,CAAC;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,4CAgBpE,CAAA;AAED,eAAe,WAAW,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),p=require("react"),st=require("react-dom"),ot="_container_1f7x1_1",it="_step_1f7x1_7",rt="_dotsButton_1f7x1_23",lt="_selected_1f7x1_27",ct="_selectedInvalid_1f7x1_36",at="_isSet_1f7x1_45",dt="_invalid_1f7x1_52",ut="_debuggerStatus_1f7x1_60",pt="_title_1f7x1_64",ht="_icon_1f7x1_67",ft="_filterFlag_1f7x1_78",gt="_content_1f7x1_141",E={container:ot,step:it,dotsButton:rt,selected:lt,selectedInvalid:ct,isSet:at,invalid:dt,debuggerStatus:ut,title:pt,icon:ht,filterFlag:ft,content:gt};var De={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ke=p.createContext&&p.createContext(De),xt=["attr","size","title"];function mt(e,n){if(e==null)return{};var s=Ct(e,n),o,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)o=l[i],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function Ct(e,n){if(e==null)return{};var s={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(n.indexOf(o)>=0)continue;s[o]=e[o]}return s}function se(){return se=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o])}return e},se.apply(this,arguments)}function Ee(e,n){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),s.push.apply(s,o)}return s}function oe(e){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?Ee(Object(s),!0).forEach(function(o){vt(e,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ee(Object(s)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(s,o))})}return e}function vt(e,n,s){return n=jt(n),n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}function jt(e){var n=_t(e,"string");return typeof n=="symbol"?n:n+""}function _t(e,n){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var o=s.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Be(e){return e&&e.map((n,s)=>p.createElement(n.tag,oe({key:s},n.attr),Be(n.child)))}function Z(e){return n=>p.createElement(It,se({attr:oe({},e.attr)},n),Be(e.child))}function It(e){var n=s=>{var{attr:o,size:i,title:l}=e,d=mt(e,xt),h=i||s.size||"1em",c;return s.className&&(c=s.className),e.className&&(c=(c?c+" ":"")+e.className),p.createElement("svg",se({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,d,{className:c,style:oe(oe({color:e.color||s.color},s.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),l&&p.createElement("title",null,l),e.children)};return ke!==void 0?p.createElement(ke.Consumer,null,s=>n(s)):n(De)}function wt(e){return Z({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641zM6.374 1 4.168 8.5H7.5a.5.5 0 0 1 .478.647L6.78 13.04 11.478 7H8a.5.5 0 0 1-.474-.658L9.306 1z"},child:[]}]})(e)}function Fe(e){return Z({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325"},child:[]}]})(e)}function ie(e){return Z({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}function le(e){return Z({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"},child:[]},{tag:"path",attr:{d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"},child:[]}]})(e)}const yt="_panel_19663_1",bt="_panelExiting_19663_13",Nt="_menuItem_19663_37",St="_disabled_19663_52",Lt="_menuItemIcon_19663_57",Tt="_menuItemText_19663_63",Pt="_overlay_19663_69",B={panel:yt,panelExiting:bt,menuItem:Nt,disabled:St,menuItemIcon:Lt,menuItemText:Tt,overlay:Pt},kt=e=>{const s=e.currentTarget??e.target;if(s?.getBoundingClientRect){const i=s.getBoundingClientRect();return{top:i.bottom+2,left:i.left}}const o=e;return{top:(o.clientY??0)+2,left:o.clientX??0}},ee=p.forwardRef(function({model:n,popup:s=!0,onHide:o,onClick:i},l){const[d,h]=p.useState(!1),[c,r]=p.useState(!1),[f,m]=p.useState({top:0,left:0}),j=p.useRef(null),C=p.useCallback(()=>{c||r(!0)},[c]),y=p.useCallback(u=>{c&&u.animationName.includes("menuOut")&&(h(!1),r(!1),o?.())},[c,o]),b=p.useCallback(u=>{m(kt(u)),r(!1),h(!0)},[]),x=p.useCallback(u=>{d?C():b(u)},[d,C,b]);p.useImperativeHandle(l,()=>({show:b,hide:C,toggle:x}),[b,C,x]),p.useEffect(()=>{if(!d)return;const u=v=>{v.key==="Escape"&&C()},a=v=>{const _=j.current;_&&!_.contains(v.target)&&(v.stopPropagation(),C())};return document.addEventListener("keydown",u),document.addEventListener("mousedown",a),()=>{document.removeEventListener("keydown",u),document.removeEventListener("mousedown",a)}},[d,C]);const g=(u,a)=>{a.stopPropagation(),u.command?.({originalEvent:a,item:u}),C()},k=(u,a)=>{const v=_=>g(u,_);return u.template?t.jsx(p.Fragment,{children:u.template(u,{onClick:v})},a):t.jsxs("button",{type:"button",className:`${B.menuItem} ${u.disabled&&B.disabled}`,onClick:_=>{u.disabled||v(_)},children:[u.icon&&t.jsx("span",{className:B.menuItemIcon,children:u.icon}),t.jsx("span",{className:B.menuItemText,children:u.label})]},a)};return!d||!s?null:st.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:B.overlay,"aria-hidden":!0,onClick:()=>C(),onMouseDown:u=>u.stopPropagation()}),t.jsx("div",{ref:j,className:`${B.panel} ${c?B.panelExiting:""}`,role:"menu",style:{top:f.top,left:f.left},onAnimationEnd:y,onClick:u=>{u.stopPropagation(),i?.(u)},children:n.map(k)})]}),document.body)}),ce=()=>(e,n)=>t.jsxs("button",{className:B.menuItem,onClick:s=>n.onClick(s),children:[t.jsx("span",{className:B.menuItemIcon,children:e.icon}),t.jsx("span",{className:B.menuItemText,children:e.label})]}),I={NAVY:"#3B64A0",LIGHT_BG:"#fafafa",FINISHED_GREEN:"#17a34a",ERROR_RED:"#E32012",TEAL:"#127ee3",ADD_TRIGGER_FILL:"#0C971F",ADD_TRIGGER_STROKE:"#14BC2B",SEPARATOR:"#a1bbdc",SLATE_400:"#94a3b8",ORANGE:"#ff9800"},ae=e=>e?.toLowerCase()===I.FINISHED_GREEN.toLowerCase(),Y=e=>ae(e)?`3px dotted ${e}`:`2px solid ${e}`,de={pending:I.NAVY,running:I.TEAL,validating:I.ORANGE,finished:I.FINISHED_GREEN,failed:I.ERROR_RED,cancelled:I.ORANGE,skipped:I.SLATE_400,invalid:I.ERROR_RED},Et={pending:I.LIGHT_BG,running:"#e6f7f6",validating:"#eff6ff",finished:"#DFFFE3",failed:"#fde8e6",cancelled:"#f1f5f9",skipped:"#f1f5f9",invalid:"#fffbeb"},Rt=({width:e=16,height:n=16,color:s=I.NAVY})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{x:"7.99219",y:"0.222732",width:"11",height:"11",rx:"1.5",transform:"rotate(45 7.99219 0.222732)",stroke:s}),t.jsx("path",{d:"M10.4693 5.52599L5.52513 10.4813M5.52513 5.53151L10.4749 10.4813",stroke:s,strokeLinecap:"round"})]}),Mt=({width:e=16,height:n=16,color:s=I.NAVY})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M11.5341 7.00002H15.4661C15.5136 7.00004 15.5601 7.01359 15.6002 7.03909C15.6403 7.06459 15.6722 7.10098 15.6924 7.144C15.7125 7.18702 15.72 7.23489 15.7139 7.282C15.7079 7.32912 15.6885 7.37352 15.6581 7.41002L13.6921 9.77002C13.6686 9.79816 13.6393 9.82079 13.6061 9.83633C13.5729 9.85186 13.5367 9.85991 13.5001 9.85991C13.4635 9.85991 13.4273 9.85186 13.3941 9.83633C13.3609 9.82079 13.3315 9.79816 13.3081 9.77002L11.3421 7.41002C11.3117 7.37352 11.2923 7.32912 11.2862 7.282C11.2802 7.23489 11.2876 7.18702 11.3078 7.144C11.3279 7.10098 11.3599 7.06459 11.4 7.03909C11.4401 7.01359 11.4866 7.00004 11.5341 7.00002ZM0.534086 9.00002H4.46609C4.51359 9.00001 4.56011 8.98645 4.60019 8.96096C4.64027 8.93546 4.67225 8.89907 4.6924 8.85605C4.71254 8.81303 4.72002 8.76516 4.71394 8.71804C4.70786 8.67093 4.68849 8.62652 4.65809 8.59002L2.69209 6.23002C2.66862 6.20189 2.63926 6.17925 2.60609 6.16372C2.57291 6.14819 2.53672 6.14014 2.50009 6.14014C2.46345 6.14014 2.42726 6.14819 2.39409 6.16372C2.36091 6.17925 2.33155 6.20189 2.30809 6.23002L0.342086 8.59002C0.311684 8.62652 0.29231 8.67093 0.286234 8.71804C0.280157 8.76516 0.287629 8.81303 0.307775 8.85605C0.327921 8.89907 0.359907 8.93546 0.399987 8.96096C0.440067 8.98645 0.486583 9.00001 0.534086 9.00002Z",fill:s}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00001 3.00023C6.44801 3.00023 5.06001 3.70723 4.14301 4.81823C4.10206 4.87131 4.05086 4.9156 3.99245 4.94849C3.93404 4.98138 3.86961 5.00219 3.803 5.00968C3.73638 5.01717 3.66895 5.01119 3.60469 4.99209C3.54043 4.97299 3.48068 4.94117 3.42897 4.89851C3.37726 4.85586 3.33465 4.80324 3.30368 4.74379C3.27272 4.68434 3.25402 4.61926 3.24871 4.55244C3.24339 4.48562 3.25157 4.41841 3.27275 4.35481C3.29394 4.29121 3.32769 4.23252 3.37201 4.18223C4.1042 3.29576 5.0756 2.63824 6.17067 2.28789C7.26575 1.93753 8.43841 1.90908 9.54918 2.20592C10.66 2.50276 11.6621 3.1124 12.4364 3.96232C13.2107 4.81224 13.7246 5.86668 13.917 7.00023H12.9C12.6691 5.87104 12.0554 4.85623 11.1625 4.12738C10.2697 3.39853 9.15256 3.00037 8.00001 3.00023ZM3.10001 9.00023C3.28932 9.92486 3.73636 10.7771 4.38949 11.4584C5.04261 12.1397 5.87517 12.6223 6.79097 12.8505C7.70677 13.0787 8.66845 13.0431 9.5649 12.7479C10.4613 12.4527 11.256 11.9099 11.857 11.1822C11.898 11.1292 11.9492 11.0849 12.0076 11.052C12.066 11.0191 12.1304 10.9983 12.197 10.9908C12.2636 10.9833 12.3311 10.9893 12.3953 11.0084C12.4596 11.0275 12.5193 11.0593 12.5711 11.102C12.6228 11.1446 12.6654 11.1972 12.6963 11.2567C12.7273 11.3161 12.746 11.3812 12.7513 11.448C12.7566 11.5148 12.7484 11.5821 12.7273 11.6457C12.7061 11.7093 12.6723 11.7679 12.628 11.8182C11.8958 12.7047 10.9244 13.3622 9.82934 13.7126C8.73427 14.0629 7.56161 14.0914 6.45083 13.7945C5.34006 13.4977 4.33791 12.8881 3.5636 12.0381C2.78928 11.1882 2.27538 10.1338 2.08301 9.00023H3.10001Z",fill:s})]}),ge=({width:e=16,height:n=16,color:s=I.NAVY})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M8 15C6.14348 15 4.36301 14.2625 3.05025 12.9497C1.7375 11.637 1 9.85652 1 8C1 6.14348 1.7375 4.36301 3.05025 3.05025C4.36301 1.7375 6.14348 1 8 1C9.85652 1 11.637 1.7375 12.9497 3.05025C14.2625 4.36301 15 6.14348 15 8C15 9.85652 14.2625 11.637 12.9497 12.9497C11.637 14.2625 9.85652 15 8 15ZM8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16Z",fill:s}),t.jsx("path",{d:"M7 11.5C7 11.3674 7.05268 11.2402 7.14645 11.1464C7.24021 11.0527 7.36739 11 7.5 11H8.5C8.63261 11 8.75979 11.0527 8.85355 11.1464C8.94732 11.2402 9 11.3674 9 11.5C9 11.6326 8.94732 11.7598 8.85355 11.8536C8.75979 11.9473 8.63261 12 8.5 12H7.5C7.36739 12 7.24021 11.9473 7.14645 11.8536C7.05268 11.7598 7 11.6326 7 11.5ZM5 8.5C5 8.36739 5.05268 8.24021 5.14645 8.14645C5.24021 8.05268 5.36739 8 5.5 8H10.5C10.6326 8 10.7598 8.05268 10.8536 8.14645C10.9473 8.24021 11 8.36739 11 8.5C11 8.63261 10.9473 8.75979 10.8536 8.85355C10.7598 8.94732 10.6326 9 10.5 9H5.5C5.36739 9 5.24021 8.94732 5.14645 8.85355C5.05268 8.75979 5 8.63261 5 8.5ZM3 5.5C3 5.36739 3.05268 5.24021 3.14645 5.14645C3.24021 5.05268 3.36739 5 3.5 5H12.5C12.6326 5 12.7598 5.05268 12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5C13 5.63261 12.9473 5.75979 12.8536 5.85355C12.7598 5.94732 12.6326 6 12.5 6H3.5C3.36739 6 3.24021 5.94732 3.14645 5.85355C3.05268 5.75979 3 5.63261 3 5.5Z",fill:s})]}),Ae=p.createContext(void 0),Ot=({children:e})=>{const[n,s]=p.useState([]),o=p.useCallback((d,h)=>{s(c=>(c.forEach(r=>{r.current&&r!==d&&r.current.hide(h)}),[])),d.current?.toggle(h),s([d])},[]),i=p.useCallback(d=>{s(h=>h.filter(c=>c!==d))},[]),l=p.useMemo(()=>({openMenus:n,openMenu:o,closeMenu:i}),[n,o,i]);return t.jsx(Ae.Provider,{value:l,children:e})},ue=()=>{const e=p.useContext(Ae);if(e===void 0)throw new Error("useMenuProvider must be used within a MenuProvider");return e},$t=({color:e=I.ERROR_RED})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[t.jsx("g",{clipPath:"url(#clip0_3105_5367)",children:t.jsx("path",{d:"M16 8C16 10.1217 15.1571 12.1566 13.6569 13.6569C12.1566 15.1571 10.1217 16 8 16C5.87827 16 3.84344 15.1571 2.34315 13.6569C0.842855 12.1566 0 10.1217 0 8C0 5.87827 0.842855 3.84344 2.34315 2.34315C3.84344 0.842855 5.87827 0 8 0C10.1217 0 12.1566 0.842855 13.6569 2.34315C15.1571 3.84344 16 5.87827 16 8ZM8 4C7.87361 4.00007 7.74863 4.02662 7.63312 4.07793C7.51761 4.12924 7.41413 4.20418 7.32934 4.29791C7.24456 4.39165 7.18035 4.5021 7.14084 4.62217C7.10134 4.74223 7.08743 4.86923 7.1 4.995L7.45 8.502C7.46176 8.63977 7.5248 8.76811 7.62664 8.86164C7.72849 8.95516 7.86173 9.00705 8 9.00705C8.13827 9.00705 8.27151 8.95516 8.37336 8.86164C8.4752 8.76811 8.53824 8.63977 8.55 8.502L8.9 4.995C8.91257 4.86923 8.89866 4.74223 8.85915 4.62217C8.81965 4.5021 8.75544 4.39165 8.67066 4.29791C8.58587 4.20418 8.48239 4.12924 8.36688 4.07793C8.25137 4.02662 8.12639 4.00007 8 4ZM8.002 10C7.73678 10 7.48243 10.1054 7.29489 10.2929C7.10736 10.4804 7.002 10.7348 7.002 11C7.002 11.2652 7.10736 11.5196 7.29489 11.7071C7.48243 11.8946 7.73678 12 8.002 12C8.26722 12 8.52157 11.8946 8.70911 11.7071C8.89664 11.5196 9.002 11.2652 9.002 11C9.002 10.7348 8.89664 10.4804 8.70911 10.2929C8.52157 10.1054 8.26722 10 8.002 10Z",fill:e})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_3105_5367",children:t.jsx("rect",{width:"16",height:"16",fill:"white"})})})]});function Dt(e){return Z({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},child:[]},{tag:"polyline",attr:{points:"15 3 21 3 21 9"},child:[]},{tag:"line",attr:{x1:"10",y1:"14",x2:"21",y2:"3"},child:[]}]})(e)}function Bt(e){return Z({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"4"},child:[]},{tag:"line",attr:{x1:"1.05",y1:"12",x2:"7",y2:"12"},child:[]},{tag:"line",attr:{x1:"17.01",y1:"12",x2:"22.96",y2:"12"},child:[]}]})(e)}function Ft(e){return Z({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"},child:[]}]})(e)}const K=e=>{const{isSet:n,isSelected:s,isFilter:o,debuggerMode:i=!1,status:l,className:d,title:h,icon:c,contextMenuItems:r=void 0,onDeleteStep:f,onUpdateFilter:m,onSelectStep:j,onCheckScenario:C,subtitle:y,isInvalid:b,localId:x}=e,g=p.useRef(null),{openMenu:k,closeMenu:u}=ue(),a=ce(),[v]=p.useState(!0),_=p.useMemo(()=>{const S=[];return i||S.push({label:"Add Step Filter",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(ge,{})}),command:P=>{P?.originalEvent?.stopPropagation(),m&&m(x)},template:a}),f&&!i&&S.push({label:"Remove",icon:t.jsx(le,{color:I.NAVY,size:18}),command:P=>{P?.originalEvent?.stopPropagation(),f(x)},template:a}),v&&S.push({label:"Check Scenario",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(Dt,{color:I.NAVY,size:18})}),command:P=>{P?.originalEvent?.stopPropagation(),C(x)},template:a}),S},[m,f,x,a,v,C,i]),N=p.useMemo(()=>r??_,[r,_]),R=S=>{S.stopPropagation(),k(g,S)},O=p.useMemo(()=>{if(!(!i||l==null||l==="pending"))return{"--step-debugger-accent":de[l]}},[i,l]),w=p.useMemo(()=>s&&b?E.step+" "+E.selectedInvalid:i&&l!=null&&l!=="pending"?E.step+" "+E.debuggerStatus:s?E.step+" "+E.selected:n?E.step+" "+E.isSet:b?E.step+" "+E.invalid:E.step,[n,s,b,l,i]),T=p.useMemo(()=>b?t.jsx($t,{color:I.ERROR_RED}):c,[c,b]);return t.jsx("div",{className:E.container+" "+d,"data-local-id":void 0,children:t.jsxs("div",{children:[t.jsxs("div",{className:w,style:O,onClick:()=>j(x),children:[t.jsxs("div",{className:E.content,children:[t.jsx("div",{className:`${E.icon} ${b&&E.invalid}`,children:T}),t.jsx("div",{className:E.title,children:h})]}),N.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("button",{className:E.dotsButton,onClick:R,"aria-haspopup":!0,"aria-label":"Step options",children:t.jsx(ie,{className:E.dots,size:16})}),t.jsx(ee,{model:N,popup:!0,ref:g,onClick:S=>S.stopPropagation(),onHide:()=>u(g)})]})]}),o&&t.jsxs("div",{className:E.filterFlag,role:"button",tabIndex:0,onClick:()=>{m&&m(x)},onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&m&&(S.preventDefault(),m(x))},children:[t.jsx(ge,{color:I.NAVY}),t.jsx("span",{children:"Filter"}),!i&&t.jsx(ie,{className:E.dots,color:b?I.ERROR_RED:I.NAVY,style:{height:"10px"}})]}),y&&t.jsx("div",{className:E.subtitle,children:y})]})})},At=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[t.jsxs("g",{clipPath:"url(#clip0_6551_9169)",children:[t.jsx("rect",{width:"24",height:"24",rx:"12",fill:I.ADD_TRIGGER_FILL}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V11H18C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H13V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H11V6Z",fill:"white"})]}),t.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"11.25",stroke:I.ADD_TRIGGER_STROKE,strokeWidth:"1.5"}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_6551_9169",children:t.jsx("rect",{width:"24",height:"24",rx:"12",fill:"white"})})})]}),Wt="_multipleTriggersIcon_oxhdi_1",Ht={multipleTriggersIcon:Wt},Vt=()=>t.jsx("div",{className:Ht.multipleTriggersIcon,children:t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 3.75C1.5 3.15326 1.73705 2.58097 2.15901 2.15901C2.58097 1.73705 3.15326 1.5 3.75 1.5H5.25C5.84674 1.5 6.41903 1.73705 6.84099 2.15901C7.26295 2.58097 7.5 3.15326 7.5 3.75L13.701 3.75C13.8661 3.46404 14.1209 3.24054 14.426 3.11418C14.7311 2.98782 15.0693 2.96565 15.3883 3.05111C15.7072 3.13657 15.9891 3.32489 16.1901 3.58686C16.3911 3.84882 16.5 4.1698 16.5 4.5C16.5 4.8302 16.3911 5.15118 16.1901 5.41314C15.9891 5.67511 15.7072 5.86343 15.3883 5.94889C15.0693 6.03435 14.7311 6.01218 14.426 5.88582C14.1209 5.75946 13.8661 5.53596 13.701 5.25H10.686C10.956 5.52 11.196 5.8215 11.412 6.1575C12.369 7.6455 12.75 9.6885 12.75 12C12.75 14.9895 13.1355 16.638 13.8195 17.55C14.3535 18.264 15.162 18.6315 16.5 18.726C16.5063 18.1334 16.7462 17.5673 17.1674 17.1505C17.5887 16.7337 18.1574 16.5 18.75 16.5H20.25C20.8467 16.5 21.419 16.7371 21.841 17.159C22.2629 17.581 22.5 18.1533 22.5 18.75V20.25C22.5 20.8467 22.2629 21.419 21.841 21.841C21.419 22.2629 20.8467 22.5 20.25 22.5H18.75C18.1533 22.5 17.581 22.2629 17.159 21.841C16.7371 21.419 16.5 20.8467 16.5 20.25H10.299C10.1339 20.536 9.87905 20.7595 9.57399 20.8858C9.26892 21.0122 8.93068 21.0344 8.61173 20.9489C8.29278 20.8634 8.01095 20.6751 7.80993 20.4131C7.60892 20.1512 7.49996 19.8302 7.49996 19.5C7.49996 19.1698 7.60892 18.8488 7.80993 18.5869C8.01095 18.3249 8.29278 18.1366 8.61173 18.0511C8.93068 17.9656 9.26892 17.9878 9.57399 18.1142C9.87905 18.2405 10.1339 18.464 10.299 18.75H12.8655C12.7785 18.6538 12.6959 18.5537 12.618 18.45C11.6145 17.1105 11.25 15.0105 11.25 12C11.25 9.81 10.881 8.1045 10.1505 6.9675C9.5655 6.06 8.7225 5.4675 7.5 5.2995C7.48706 5.88762 7.2443 6.44728 6.82374 6.85859C6.40318 7.2699 5.83826 7.50014 5.25 7.5H3.75C3.15326 7.5 2.58097 7.26295 2.15901 6.84099C1.73705 6.41903 1.5 5.84674 1.5 5.25V3.75ZM3.75 3C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V5.25C3 5.44891 3.07902 5.63968 3.21967 5.78033C3.36032 5.92098 3.55109 6 3.75 6H5.25C5.44891 6 5.63968 5.92098 5.78033 5.78033C5.92098 5.63968 6 5.44891 6 5.25V3.75C6 3.55109 5.92098 3.36032 5.78033 3.21967C5.63968 3.07902 5.44891 3 5.25 3H3.75ZM18.75 18C18.5511 18 18.3603 18.079 18.2197 18.2197C18.079 18.3603 18 18.5511 18 18.75V20.25C18 20.4489 18.079 20.6397 18.2197 20.7803C18.3603 20.921 18.5511 21 18.75 21H20.25C20.4489 21 20.6397 20.921 20.7803 20.7803C20.921 20.6397 21 20.4489 21 20.25V18.75C21 18.5511 20.921 18.3603 20.7803 18.2197C20.6397 18.079 20.4489 18 20.25 18H18.75Z",fill:"white"})})}),zt="_trigger_kfg1y_1",Yt="_title_kfg1y_7",Gt="_empty_kfg1y_15",Zt="_triggerContainer_kfg1y_21",Ut="_stepsContainer_kfg1y_25",Xt="_stepItem_kfg1y_51",qt="_curvesSvg_kfg1y_70",Kt="_centralNode_kfg1y_78",Jt="_iconWrapper_kfg1y_104",Qt="_fadeIn_kfg1y_127",e1="_fadeOut_kfg1y_130",t1="_operationContainer_kfg1y_134",M={trigger:zt,title:Yt,empty:Gt,triggerContainer:Zt,stepsContainer:Ut,stepItem:Xt,curvesSvg:qt,centralNode:Kt,iconWrapper:Jt,fadeIn:Qt,fadeOut:e1,operationContainer:t1},n1=()=>t.jsx("div",{style:{height:"1px",marginLeft:"4px",marginRight:"4px",borderTop:`1px solid ${I.SEPARATOR}`}}),s1=["failed","invalid","cancelled","validating","running","finished","skipped","pending"],We=e=>{const n=[...new Set(e.filter(s=>s!=null))];if(n.length!==0){for(const s of s1)if(n.includes(s))return s;return n[0]}},He=(e,n)=>!n||e==null?I.NAVY:de[e],o1=(e,n,s=I.NAVY)=>e==null?s:n?.[e]??de[e],i1=(e,n=I.NAVY)=>({statusLine:s=>o1(s,e,n)}),re=e=>{if("status"in e&&e.status!=null)return e.status;const n=e.steps;if(n?.[0]?.status!=null)return n[0].status},r1=80,ne=34,je=({steps:e,title:n,className:s,onDeleteTrigger:o,onAddTrigger:i,onSelectStep:l,onUpdateFilter:d,onCenterYUpdate:h,debuggerMode:c=!1,resolveCurveStrokeColor:r,isAdmin:f=!1})=>{const m=p.useRef(null),j=p.useRef([]),[C,y]=p.useState([]),[b,x]=p.useState({width:0,height:0}),[g,k]=p.useState(!1),[u,a]=p.useState(!1),v=p.useRef(null);p.useEffect(()=>{const w=()=>{if(!m.current)return;const T=[];if(j.current.forEach((S,P)=>{if(S&&m.current){const A=m.current.getBoundingClientRect(),$=S.getBoundingClientRect();T.push({localId:e[P]?.localId??`step-${P}`,top:$.top-A.top,right:$.right-A.left,centerY:$.top-A.top+$.height/2})}}),y(T),m.current&&T.length>0){const S=m.current.getBoundingClientRect(),P=Math.min(...T.map(W=>W.top)),A=j.current.filter(Boolean).map(W=>W?.offsetHeight||68),$=Math.max(...T.map((W,nt)=>W.top+(A[nt]||68))),he=Math.max(...T.map(W=>W.right))+0,fe=Math.max(S.height,$-P+100);x({width:he,height:fe})}};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[e]),p.useEffect(()=>{let w=!0;if(g){v.current&&(clearTimeout(v.current),v.current=null);const T=setTimeout(()=>{w&&a(!0)},0);return()=>{w=!1,clearTimeout(T)}}return v.current=setTimeout(()=>{w&&a(!1)},140),()=>{w=!1,v.current&&(clearTimeout(v.current),v.current=null)}},[g]);const _=C.length>0?r1:0,N=p.useMemo(()=>C.length>1?C.reduce((w,T)=>w+T.top+ne,0)/C.length:C.length===1?C[0].top+ne:0,[C]);p.useEffect(()=>{h?.(N)},[N,h]);const R=ce();if(e.length===0)return t.jsxs("div",{className:`${M.trigger} ${s||""}`,children:[n&&t.jsx("h3",{className:M.title,children:n}),t.jsx("div",{className:M.empty,children:"No steps"})]});const O=(w,T,S,P)=>{const A=S-w,$=Math.min(A*.6,60),te=w+$,he=T,fe=S-$;return`M ${w} ${T} C ${te} ${he}, ${fe} ${P}, ${S} ${P}`};return t.jsxs("div",{className:`${M.trigger} ${s||""}`,ref:m,children:[n&&t.jsx("h3",{className:M.title,children:n}),t.jsxs("div",{className:M.triggerContainer,children:[t.jsx("div",{className:M.stepsContainer,children:e.map((w,T)=>t.jsx("div",{ref:S=>{j.current[T]=S},children:t.jsx(K,{title:w.title,className:M.stepItem,localId:w.localId,idx:T,isSet:w.isSet,isSelected:w.isSelected,isInvalid:w.isInvalid,isFilter:w.isFilter,status:w.status,debuggerMode:c,icon:w.icon,onSelectStep:l,onUpdateFilter:d,onCheckScenario:()=>{throw new Error("Check scenario not handled in Trigger")},contextMenuItems:f?[{label:"Add Step Filter",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(ge,{})}),command:S=>{S?.originalEvent?.stopPropagation(),d&&d(w.localId)},template:R},{label:"Delete",icon:t.jsx(le,{className:"mr-2",color:I.NAVY,size:18}),command:()=>{o?.(w.localId)},disabled:e.length===1},{label:"",template:()=>t.jsx(n1,{})},{label:"Add More Triggers",icon:t.jsx(wt,{className:"mr-2",color:I.NAVY,size:18}),command:()=>{i?.()}}]:[]})},w.localId))}),t.jsx("div",{style:{position:"relative"},children:C.length>1&&t.jsx("svg",{className:M.curvesSvg,width:b.width,height:b.height,children:C.map(w=>{const S=C.length===1?C[0].top+ne:w.top+ne,P=_,A=N,$=e.find(te=>te.localId===w.localId)?.status;return t.jsx("path",{d:O(0,S,P,A),stroke:r!=null?r($):He($,c),strokeWidth:"2",fill:"none",strokeLinecap:"round"},w.localId)})})}),C.length>1?t.jsxs("div",{style:{position:"relative",marginRight:"140px"},children:[t.jsx("div",{className:M.centralNode,style:{"--node-x":`${_}px`,"--node-y":`${N}px`},onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:u?t.jsx("div",{className:`${M.iconWrapper} ${g?M.fadeIn:M.fadeOut}`,onClick:i,children:t.jsx(At,{})}):null}),t.jsx("div",{className:M.operationContainer,style:{"--op-x":`${_+16}px`,"--op-y":`${N}px`},children:t.jsx(Vt,{})})]}):null]})]})},l1=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M6 12L18 12",stroke:I.NAVY,strokeWidth:"2",strokeLinecap:"round"}),t.jsx("path",{d:"M12 6V18",stroke:I.NAVY,strokeWidth:"2",strokeLinecap:"round"})]}),c1="_stepLinkIcon_b0452_1",a1="_stepLinkLine_b0452_15",d1="_stepLinkContainer_b0452_39",u1="_readOnly_b0452_61",p1="_debuggerIconCollapsed_b0452_66",h1="_dashedLine_b0452_75",D={stepLinkIcon:c1,stepLinkLine:a1,stepLinkContainer:d1,readOnly:u1,debuggerIconCollapsed:p1,dashedLine:h1},U=({onAddStep:e,onAddTrigger:n,onAddCondition:s,onAddLoop:o,iteratorEnabled:i=!0,conditionsEnabled:l=!0,lineColor:d=I.NAVY,stepId:h,index:c=0,style:r,pathId:f})=>{const m=ce(),j=p.useRef(null),C=[...c>0?[{label:"Trigger",icon:t.jsx(Ft,{color:I.NAVY,size:18}),command:()=>{n?.(h,f,"trigger")},template:m}]:[],{label:"Step",icon:t.jsx(Bt,{color:I.NAVY,size:18}),command:()=>e?.(h,f,c>0?"append":"prepend"),template:m},...l&&h!=null?[{label:"Condition",icon:t.jsx(Rt,{width:18,height:18}),command:()=>s?.(h,f,c>0?"append":"prepend"),template:m}]:[],...i?[{label:"Loop",icon:t.jsx(Mt,{width:18,height:18}),command:()=>o?.(h,f,c>0?"append":"prepend"),template:m}]:[]],y=b=>{j.current?.show(b)};return t.jsxs("div",{className:D.stepLinkContainer,style:{...r,"--step-link-color":d},"data-plus-index":c,children:[t.jsx("div",{className:D.stepLinkLine}),t.jsx("div",{className:D.stepLinkIcon,onClick:y,"aria-haspopup":!0,children:t.jsx(l1,{})}),t.jsx(ee,{model:C,popup:!0,ref:j}),t.jsx("div",{className:D.stepLinkLine})]})},f1="_steps_yug55_1",g1="_stepContainer_yug55_8",x1="_stepContainerWithPaths_yug55_14",q={steps:f1,stepContainer:g1,stepContainerWithPaths:x1},m1=(e,n,s,o)=>{const i=s-e,l=Math.min(i*.66,66),d=e+l,h=n,c=s-l;return`M ${e} ${n} C ${d} ${h}, ${c} ${o}, ${s} ${o}`},xe=({width:e,height:n,strokeColor:s=I.NAVY,fromLocalId:o,toLocalId:i})=>{const l=ae(s),f=m1(0,1,e,n);return t.jsx("div",{style:{position:"absolute"},"data-connector-from":void 0,"data-connector-to":void 0,children:t.jsx("svg",{width:e,height:n+1,viewBox:`0 0 ${e} ${n+1}`,xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:f,stroke:s,strokeWidth:l?3:2,fill:"none",strokeLinecap:"round",strokeDasharray:l?"0 6":void 0,"data-connector-from":void 0,"data-connector-to":void 0})})})},C1="_column_1uiy3_1",v1="_row_1uiy3_19",j1="_stepsContainer_1uiy3_24",F={column:C1,row:v1,stepsContainer:j1},_1="_wrapper_1nl2d_1",I1="_tooltip_1nl2d_5",Re={wrapper:_1,tooltip:I1},w1=({content:e,children:n,maxWidth:s=500,className:o})=>t.jsxs("div",{className:`${Re.wrapper} ${o??""}`.trim(),style:{"--tooltip-max-width":`${s}px`},children:[n,e?t.jsx("div",{className:Re.tooltip,role:"tooltip",children:e}):null]}),y1="_conditionContainer_19jfz_1",b1="_debuggerTint_19jfz_5",N1="_connectorLine_19jfz_5",S1="_connectorDot_19jfz_8",L1="_condition_19jfz_1",T1="_conditionWrapper_19jfz_15",P1="_conditionFits_19jfz_67",H={conditionContainer:y1,debuggerTint:b1,connectorLine:N1,connectorDot:S1,condition:L1,conditionWrapper:T1,conditionFits:P1},pe=({expression:e,style:n,status:s,debuggerMode:o=!1})=>{const i=p.useRef(null),l=p.useRef(null),[d,h]=p.useState(!1);p.useLayoutEffect(()=>{const C=i.current,y=l.current;if(!C||!y)return;const{paddingLeft:b,paddingRight:x}=getComputedStyle(C),g=Number.parseFloat(b)+Number.parseFloat(x);h(y.offsetWidth>=C.clientWidth-g)},[e]);const c=e&&d?e:"",r=o&&s!=null,f=p.useMemo(()=>{if(!r||s==null)return;const C=s==="finished";return{"--condition-accent":de[s],"--condition-bg":Et[s],...C&&{"--condition-line-width":"3px","--condition-line-style":"dotted"}}},[r,s]),m=`${H.condition} ${d?"":H.conditionFits}`.trim(),j=`${H.conditionContainer} ${r?H.debuggerTint:""}`.trim();return t.jsxs("div",{className:j,style:{...n,...f},children:[t.jsx("div",{className:H.connectorLine}),t.jsx(w1,{content:c,className:H.conditionWrapper,children:t.jsx("div",{ref:i,className:m,children:t.jsx("span",{ref:l,children:e})})}),t.jsx("div",{className:H.connectorLine}),t.jsx("div",{className:H.connectorDot})]})},k1="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='21.8125'%20y='-2.52539'%20width='34.4207'%20height='34.4207'%20rx='6.09524'%20transform='rotate(45%2021.8125%20-2.52539)'%20fill='%236B90C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M31.3947%2013.0355C31.4679%2013.1085%2031.526%2013.1952%2031.5656%2013.2907C31.6052%2013.3861%2031.6256%2013.4885%2031.6256%2013.5918C31.6256%2013.6952%2031.6052%2013.7975%2031.5656%2013.8929C31.526%2013.9884%2031.4679%2014.0751%2031.3947%2014.1481L14.109%2031.4338C13.9615%2031.5813%2013.7614%2031.6642%2013.5527%2031.6642C13.3441%2031.6642%2013.144%2031.5813%2012.9965%2031.4338C12.8489%2031.2863%2012.766%2031.0862%2012.766%2030.8775C12.766%2030.6689%2012.8489%2030.4688%2012.9965%2030.3212L30.2822%2013.0355C30.3552%2012.9623%2030.4419%2012.9043%2030.5373%2012.8647C30.6328%2012.8251%2030.7351%2012.8047%2030.8385%2012.8047C30.9418%2012.8047%2031.0441%2012.8251%2031.1396%2012.8647C31.2351%2012.9043%2031.3218%2012.9623%2031.3947%2013.0355Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.9965%2013.0355C12.9233%2013.1085%2012.8652%2013.1952%2012.8256%2013.2907C12.786%2013.3861%2012.7656%2013.4885%2012.7656%2013.5918C12.7656%2013.6952%2012.786%2013.7975%2012.8256%2013.8929C12.8652%2013.9884%2012.9233%2014.0751%2012.9965%2014.1481L30.2822%2031.4338C30.4297%2031.5813%2030.6298%2031.6642%2030.8385%2031.6642C31.0471%2031.6642%2031.2472%2031.5813%2031.3947%2031.4338C31.5423%2031.2863%2031.6252%2031.0862%2031.6252%2030.8775C31.6252%2030.6689%2031.5423%2030.4688%2031.3947%2030.3212L14.109%2013.0355C14.036%2012.9623%2013.9493%2012.9043%2013.8539%2012.8647C13.7584%2012.8251%2013.6561%2012.8047%2013.5527%2012.8047C13.4494%2012.8047%2013.3471%2012.8251%2013.2516%2012.8647C13.1561%2012.9043%2013.0694%2012.9623%2012.9965%2013.0355Z'%20fill='white'/%3e%3c/svg%3e",E1="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20fill='white'/%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20stroke='%236B90C0'%20stroke-width='2'/%3e%3ccircle%20cx='14'%20cy='14'%20r='6'%20fill='%236B90C0'/%3e%3c/svg%3e",R1="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='21.8125'%20y='-2.52539'%20width='34.4207'%20height='34.4207'%20rx='6.09524'%20transform='rotate(45%2021.8125%20-2.52539)'%20fill='%2317A34A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M31.3947%2013.0355C31.4679%2013.1085%2031.526%2013.1952%2031.5656%2013.2907C31.6052%2013.3861%2031.6256%2013.4885%2031.6256%2013.5918C31.6256%2013.6952%2031.6052%2013.7975%2031.5656%2013.8929C31.526%2013.9884%2031.4679%2014.0751%2031.3947%2014.1481L14.109%2031.4338C13.9615%2031.5813%2013.7614%2031.6642%2013.5527%2031.6642C13.3441%2031.6642%2013.144%2031.5813%2012.9965%2031.4338C12.8489%2031.2863%2012.766%2031.0862%2012.766%2030.8775C12.766%2030.6689%2012.8489%2030.4688%2012.9965%2030.3212L30.2822%2013.0355C30.3552%2012.9623%2030.4419%2012.9043%2030.5373%2012.8647C30.6328%2012.8251%2030.7351%2012.8047%2030.8385%2012.8047C30.9418%2012.8047%2031.0441%2012.8251%2031.1396%2012.8647C31.2351%2012.9043%2031.3218%2012.9623%2031.3947%2013.0355Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.9965%2013.0355C12.9233%2013.1085%2012.8652%2013.1952%2012.8256%2013.2907C12.786%2013.3861%2012.7656%2013.4885%2012.7656%2013.5918C12.7656%2013.6952%2012.786%2013.7975%2012.8256%2013.8929C12.8652%2013.9884%2012.9233%2014.0751%2012.9965%2014.1481L30.2822%2031.4338C30.4297%2031.5813%2030.6298%2031.6642%2030.8385%2031.6642C31.0471%2031.6642%2031.2472%2031.5813%2031.3947%2031.4338C31.5423%2031.2863%2031.6252%2031.0862%2031.6252%2030.8775C31.6252%2030.6689%2031.5423%2030.4688%2031.3947%2030.3212L14.109%2013.0355C14.036%2012.9623%2013.9493%2012.9043%2013.8539%2012.8647C13.7584%2012.8251%2013.6561%2012.8047%2013.5527%2012.8047C13.4494%2012.8047%2013.3471%2012.8251%2013.2516%2012.8647C13.1561%2012.9043%2013.0694%2012.9623%2012.9965%2013.0355Z'%20fill='white'/%3e%3c/svg%3e",M1="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20fill='white'/%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20stroke='%2317A34A'%20stroke-width='2'/%3e%3ccircle%20cx='14'%20cy='14'%20r='6'%20fill='%2317A34A'/%3e%3c/svg%3e",O1="_ifStatement_xtij3_1",$1="_conditionIcon_xtij3_7",D1="_ifStatementContainer_xtij3_21",B1="_menuButton_xtij3_27",F1="_menuIcon_xtij3_52",A1="_ifdotIcon_xtij3_59",V={ifStatement:O1,conditionIcon:$1,ifStatementContainer:D1,menuButton:B1,menuIcon:F1,ifdotIcon:A1},W1=({style:e,color:n=I.NAVY})=>t.jsx("div",{style:{width:"100%",height:"2px",borderTop:Y(n),...e}}),Ve=e=>{const{enabled:n=!0,onDelete:s,onSelect:o,debuggerMode:i=!1,status:l}=e,d=p.useRef(null),{openMenu:h,closeMenu:c}=ue(),r=n&&!i,f=i&&l==="finished",m=He(l,i),j=f?R1:k1,C=f?M1:E1,y=p.useMemo(()=>[{label:"Edit",icon:t.jsx(Fe,{color:I.NAVY,size:18}),command:()=>o?.()},{label:"Delete",icon:t.jsx(le,{color:I.NAVY,size:18}),command:()=>s?.()}],[o,s]),b=g=>{g.stopPropagation(),h(d,g)},x=g=>{g.target.closest(`.${V.menuButton}`)||o?.()};return t.jsxs("div",{className:V.ifStatementContainer,children:[t.jsx(W1,{color:m,style:{position:"absolute",top:"22.5px",left:0,zIndex:1}}),t.jsx("div",{className:V.ifStatement,children:t.jsx("img",{src:j,alt:"condition",onClick:g=>x(g),className:V.conditionIcon})}),r&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:V.menuButton,onClick:b,"aria-label":"Open menu","aria-haspopup":"menu",children:t.jsx(ie,{className:V.menuIcon,size:16})}),t.jsx(ee,{ref:d,model:y,popup:!0,onHide:()=>c(d)})]}),t.jsx("img",{src:C,alt:"ifdot",className:V.ifdotIcon})]})},Me=34.5,H1=33,J=I.NAVY,ze=e=>{const{items:n,pathId:s,onAddStep:o,onAddTrigger:i,onAddCondition:l,onAddLoop:d,onDeleteStep:h,onUpdateFilter:c,onSelectStep:r,onResize:f,onCheckScenario:m,iteratorEnabled:j,conditionsEnabled:C}=e,y=p.useRef(null),b=p.useRef([]),[x,g]=p.useState([]);p.useEffect(()=>{const u=()=>{const _=y.current;if(!_||n.length===0){g([]);return}const N=[],R=Number.parseFloat(getComputedStyle(_).zoom||"1");for(let O=0;O<n.length;O++){const w=b.current[O];if(w)if(w.offsetParent==null){const T=_.getBoundingClientRect(),S=w.getBoundingClientRect();N.push((S.top-T.top)/R+Me)}else N.push(w.offsetTop-H1+Me)}N.length===n.length&&g(N)};u();const a=new ResizeObserver(u),v=y.current;return v&&a.observe(v),window.addEventListener("resize",u),()=>{a.disconnect(),window.removeEventListener("resize",u)}},[n]);const k=p.useMemo(()=>x.length!==n.length||n.length<=1?null:n.map((u,a)=>a).filter(u=>u>0).map(u=>{const a=x[u];return a===void 0?null:t.jsx(xe,{width:100,height:a,strokeColor:J},u)}),[n,x]);return t.jsxs("div",{className:F.row,children:[t.jsx(Ve,{onDelete:()=>s!=null&&h?.(s),enabled:C,onSelect:s!=null&&r?()=>r(s):void 0}),t.jsxs("div",{ref:y,className:F.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100px",height:"2px",borderTop:`2px solid ${J}`}}),k]}),t.jsx("div",{className:F.column,children:n.map((u,a)=>{let v;if(u.paths)v=t.jsx(ze,{items:u.paths,pathId:s,onAddStep:o,onAddTrigger:i,onAddCondition:l,onAddLoop:d,onDeleteStep:h,onUpdateFilter:c,onSelectStep:r,onResize:f,onCheckScenario:m,iteratorEnabled:j,conditionsEnabled:C},u.localId);else if(u.steps){const _=u;v=t.jsxs("div",{className:F.stepsContainer,children:[t.jsx(pe,{expression:_.condition,status:_.status,style:{marginTop:"25px"}}),t.jsx(_e,{steps:u.steps,pathId:u.localId,iteratorEnabled:j,conditionsEnabled:C,onSelectStep:r??(()=>{}),onAddStep:o??(()=>{}),onAddTrigger:i,onAddCondition:l??(()=>{}),onAddLoop:d,onDeleteStep:h,onUpdateFilter:c,onResize:f,onCheckScenario:m},u.localId)]})}else v=t.jsx(K,{localId:u.localId,title:"title"in u?u.title:"",idx:1,icon:"icon"in u?u.icon:void 0,status:"status"in u?u.status:void 0,onSelectStep:r,onDeleteStep:h,onUpdateFilter:c,onCheckScenario:m},u.localId);return t.jsx("div",{ref:_=>{b.current[a]=_},style:{width:"100%"},children:v},u.localId)})}),t.jsxs("div",{className:F.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:.5,left:0,flex:1,width:"100%",height:"2px",borderTop:`2px solid ${J}`}}),k]}),t.jsx(U,{onAddStep:o,onAddTrigger:i,onAddCondition:l,onAddLoop:d,iteratorEnabled:j,conditionsEnabled:C,lineColor:J,stepId:s,pathId:s,index:1,style:{marginTop:"34px",height:0}}),t.jsx("div",{style:{flex:1,width:"100%",height:"2px",borderTop:`2px solid ${J}`,marginTop:"34px"}})]})},me=68,z=I.NAVY,_e=({pathId:e,steps:n,centerY:s,className:o,iteratorEnabled:i,conditionsEnabled:l,onAddStep:d,onDeleteStep:h,onUpdateFilter:c,onAddTrigger:r,onAddCondition:f,onAddLoop:m,onSelectStep:j,onResize:C,onCheckScenario:y,isDescendent:b=!0})=>{const x=s===void 0?void 0:{marginTop:Math.max(0,s-me/2)};return n.length===0?t.jsxs("div",{style:{width:"100%",marginTop:"20px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...x},children:[t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:`2px solid ${z}`}}),t.jsx(U,{onAddStep:()=>{d?.(void 0,e)},onAddTrigger:r,onAddCondition:f,onAddLoop:m,iteratorEnabled:i,conditionsEnabled:l,lineColor:z,stepId:e,index:0,style:{height:"auto",marginTop:"0"}}),t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:`2px solid ${z}`}})]}):t.jsx("div",{className:q.steps+(o?" "+o:""),style:x,children:t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",alignItems:"flex-start"},children:[t.jsx(U,{onAddStep:()=>{d?.(n[0].localId,e,"prepend")},onAddTrigger:r,onAddCondition:f,onAddLoop:m,iteratorEnabled:i,conditionsEnabled:l,lineColor:z,stepId:n[0].localId,pathId:e,index:0,style:{marginTop:"20px"}}),n.map((g,k)=>{const u=!!g.paths,a="condition"in g&&typeof g.condition=="string";let v;return u&&g.paths?v=t.jsx(ze,{items:g.paths,pathId:g.localId,iteratorEnabled:i,conditionsEnabled:l,onAddStep:d,onAddCondition:f,onAddLoop:m,onDeleteStep:h,onAddTrigger:r,onSelectStep:j,onUpdateFilter:c,onResize:C,onCheckScenario:y},g.title):a?v=t.jsxs(t.Fragment,{children:[t.jsx(Ge,{value:g,iteratorEnabled:i,conditionsEnabled:l,onAddStep:d,onAddTrigger:r,onAddCondition:f,onAddLoop:m,onDeleteStep:h,onUpdateFilter:c,onSelectStep:j,onResize:C,onCheckScenario:y},g.localId),t.jsx(U,{onAddStep:d,onAddTrigger:r,onAddCondition:f,onAddLoop:m,iteratorEnabled:i,conditionsEnabled:l,lineColor:z,stepId:g.localId,pathId:e,index:k+1,style:{marginTop:"34px",height:0}})]}):v=t.jsxs(t.Fragment,{children:[t.jsx(K,{localId:g.localId,title:g.title,idx:1,icon:g.icon,isSet:g.isSet,isInvalid:g.isInvalid,isFilter:g.isFilter,status:g.status,onSelectStep:j,onDeleteStep:h,onUpdateFilter:c,onCheckScenario:y},g.title),t.jsx(U,{onAddStep:d,onAddTrigger:r,onAddCondition:f,onAddLoop:m,iteratorEnabled:i,conditionsEnabled:l,lineColor:z,stepId:g.localId,pathId:e,index:k+1})]}),t.jsx("div",{className:q.stepContainer+(u||a?" "+q.stepContainerWithPaths:""),children:v},g.localId)}),b&&t.jsx("div",{style:{flexGrow:1,minWidth:0,borderTop:`2px solid ${z}`,marginTop:"33.5px"}})]})})},Ye=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M17.3006 10.5H23.1986C23.2699 10.5001 23.3397 10.5204 23.3998 10.5586C23.4599 10.5969 23.5079 10.6515 23.5381 10.716C23.5683 10.7805 23.5795 10.8523 23.5704 10.923C23.5613 10.9937 23.5322 11.0603 23.4866 11.115L20.5376 14.655C20.5024 14.6972 20.4584 14.7312 20.4086 14.7545C20.3589 14.7778 20.3046 14.7899 20.2496 14.7899C20.1947 14.7899 20.1404 14.7778 20.0906 14.7545C20.0409 14.7312 19.9968 14.6972 19.9616 14.655L17.0126 11.115C16.967 11.0603 16.938 10.9937 16.9289 10.923C16.9197 10.8523 16.931 10.7805 16.9612 10.716C16.9914 10.6515 17.0394 10.5969 17.0995 10.5586C17.1596 10.5204 17.2294 10.5001 17.3006 10.5ZM0.800641 13.5H6.69864C6.7699 13.5 6.83967 13.4797 6.89979 13.4414C6.95991 13.4032 7.00789 13.3486 7.03811 13.2841C7.06833 13.2195 7.07953 13.1477 7.07042 13.0771C7.06131 13.0064 7.03224 12.9398 6.98664 12.885L4.03764 9.34504C4.00245 9.30283 3.95841 9.26888 3.90864 9.24558C3.85887 9.22228 3.80459 9.21021 3.74964 9.21021C3.69469 9.21021 3.64041 9.22228 3.59064 9.24558C3.54087 9.26888 3.49683 9.30283 3.46164 9.34504L0.512641 12.885C0.467037 12.9398 0.437977 13.0064 0.428862 13.0771C0.419747 13.1477 0.430956 13.2195 0.461175 13.2841C0.491394 13.3486 0.539372 13.4032 0.599493 13.4414C0.659613 13.4797 0.729386 13.5 0.800641 13.5Z",fill:I.TEAL}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9995 4.50011C9.67152 4.50011 7.58952 5.5606 6.21402 7.2271C6.1526 7.30671 6.0758 7.37316 5.98819 7.42249C5.90057 7.47183 5.80393 7.50304 5.70401 7.51427C5.60409 7.52551 5.50293 7.51653 5.40655 7.48789C5.31016 7.45924 5.22052 7.41151 5.14296 7.34753C5.06539 7.28354 5.00149 7.20462 4.95504 7.11544C4.90859 7.02626 4.88054 6.92865 4.87257 6.82842C4.8646 6.72819 4.87687 6.62737 4.90864 6.53198C4.94041 6.43658 4.99104 6.34854 5.05752 6.27311C6.15581 4.9434 7.61291 3.95712 9.25552 3.43159C10.8981 2.90606 12.6571 2.86338 14.3233 3.30864C15.9895 3.7539 17.4927 4.66835 18.6541 5.94324C19.8156 7.21812 20.5865 8.79978 20.875 10.5001L19.3495 10.5001C19.0032 8.80632 18.0826 7.28409 16.7433 6.19082C15.4041 5.09755 13.7284 4.50032 11.9995 4.50011ZM4.64952 13.5001C4.93349 14.887 5.60405 16.1653 6.58374 17.1873C7.56343 18.2093 8.81226 18.9332 10.186 19.2755C11.5597 19.6178 13.0022 19.5645 14.3469 19.1217C15.6915 18.6789 16.8835 17.8646 17.785 16.7731C17.8464 16.6935 17.9232 16.627 18.0109 16.5777C18.0985 16.5284 18.1951 16.4972 18.295 16.4859C18.395 16.4747 18.4961 16.4837 18.5925 16.5123C18.6889 16.541 18.7785 16.5887 18.8561 16.6527C18.9337 16.7167 18.9976 16.7956 19.044 16.8848C19.0905 16.974 19.1185 17.0716 19.1265 17.1718C19.1344 17.272 19.1222 17.3728 19.0904 17.4682C19.0586 17.5636 19.008 17.6517 18.9415 17.7271C17.8432 19.0568 16.3861 20.0431 14.7435 20.5686C13.1009 21.0942 11.3419 21.1368 9.67576 20.6916C8.0096 20.2463 6.50638 19.3319 5.34491 18.057C4.18343 16.7821 3.41258 15.2004 3.12402 13.5001H4.64952Z",fill:I.TEAL})]}),V1="_container_18jhr_1",z1="_collapsed_18jhr_16",Y1="_loopNodeWrapper_18jhr_21",G1="_loopIconWrapper_18jhr_31",Z1="_loopBox_18jhr_40",U1="_dotsButton_18jhr_57",X1="_label_18jhr_77",q1="_limit_18jhr_84",K1="_expandable_18jhr_90",J1="_expandableCollapsed_18jhr_98",Q1="_connector_18jhr_105",en="_line_18jhr_113",tn="_circleDot_18jhr_121",nn="_innerDot_18jhr_136",sn="_stepsWrapper_18jhr_143",L={container:V1,collapsed:z1,loopNodeWrapper:Y1,loopIconWrapper:G1,loopBox:Z1,dotsButton:U1,label:X1,limit:q1,expandable:K1,expandableCollapsed:J1,connector:Q1,line:en,circleDot:tn,innerDot:nn,stepsWrapper:sn},Ge=({value:e,iteratorEnabled:n=!0,conditionsEnabled:s=!0,onAddStep:o,onAddTrigger:i,onAddCondition:l,onAddLoop:d,onDeleteStep:h,onUpdateFilter:c,onSelectStep:r,onResize:f,onCheckScenario:m})=>{const{localId:j,limit:C,steps:y,condition:b}=e,x=y??[],g=()=>{},[k,u]=p.useState(!1),a=p.useRef(null),{openMenu:v,closeMenu:_}=ue(),N=ce(),R=p.useMemo(()=>[{label:"Edit",icon:t.jsx(Fe,{color:I.NAVY,size:18}),command:P=>{P?.originalEvent?.stopPropagation(),r?.(j)},template:N},{label:"Remove",icon:t.jsx(le,{color:I.NAVY,size:18}),command:P=>{P?.originalEvent?.stopPropagation(),h&&h(j)},template:N}],[r,h,j,N]),O=P=>{P.stopPropagation(),v(a,P)},w=()=>{u(P=>!P),f?.()},T=L.container+(k?"":" "+L.collapsed),S=L.expandable+(k?"":" "+L.expandableCollapsed);return t.jsxs("div",{className:T,children:[t.jsxs("div",{className:L.loopNodeWrapper,children:[t.jsxs("div",{className:L.loopBox,children:[t.jsx("div",{onClick:w,className:L.loopIconWrapper,children:t.jsx(Ye,{})}),n&&t.jsx("button",{className:L.dotsButton,onClick:O,children:t.jsx(ie,{size:16})}),t.jsx(ee,{model:R,popup:!0,ref:a,onHide:()=>_(a)})]}),t.jsx("div",{className:L.label,children:"Loop"}),C!=null&&t.jsxs("div",{className:L.limit,children:[C,"x"]})]}),t.jsxs("div",{className:S,children:[t.jsxs("div",{className:L.connector,children:[t.jsx("div",{className:L.line}),t.jsx("div",{className:L.circleDot,children:t.jsx("div",{className:L.innerDot})}),t.jsx("div",{className:L.line})]}),t.jsx(pe,{expression:b??"",status:e.status,style:{marginTop:"25.5px"}}),t.jsx("div",{className:L.stepsWrapper,children:t.jsx(_e,{steps:x,pathId:j,iteratorEnabled:n,conditionsEnabled:s,onAddStep:o??g,onAddTrigger:i,onAddCondition:l??g,onAddLoop:d,onDeleteStep:h,onUpdateFilter:c??g,onSelectStep:r??g,onCheckScenario:m??g,isDescendent:!0})})]})]})},on="_container_kielx_1",Ze={container:on},rn=({process:e,iteratorEnabled:n=!0,conditionsEnabled:s=!0,addMultipleTriggers:o,onAddStep:i,onAddTrigger:l,onAddCondition:d,onAddLoop:h,onResize:c,onDeleteTrigger:r,onDeleteStep:f,onUpdateFilter:m,onSelectStep:j,onCheckScenario:C})=>{const[y,b]=p.useState(0);return t.jsxs("div",{className:Ze.container,children:[t.jsx(je,{steps:e.triggers,onAddTrigger:o,onUpdateFilter:m,onDeleteTrigger:r,onSelectStep:j,onCenterYUpdate:b}),e.steps.length>0?t.jsx(_e,{steps:e.steps,centerY:y,onAddStep:i,onAddTrigger:l,onAddCondition:d,onAddLoop:h,onResize:c,onDeleteStep:f,onUpdateFilter:m,onSelectStep:j,iteratorEnabled:n,conditionsEnabled:s,isDescendent:!1,pathId:void 0,onCheckScenario:C}):t.jsx(U,{onAddStep:()=>i(),onAddTrigger:l,onAddCondition:d,onAddLoop:h,iteratorEnabled:n,conditionsEnabled:s,index:0,style:{height:me,marginTop:Math.max(0,y-me/2)}})]})},Ie=(e,n,s)=>{if(n===s)return!1;const o=r=>{if("paths"in r&&r.paths&&r.paths.length>0){const f=r.paths[r.paths.length-1];if(f.steps&&f.steps.length>0){const m=f.steps[f.steps.length-1];return o(m)}return f.localId}return"steps"in r&&r.steps&&r.steps.length>0?o(r.steps[r.steps.length-1]):r.localId},i=r=>r.steps&&r.steps.length>0?o(r.steps[r.steps.length-1]):r.paths&&r.paths.length>0?i(r.paths[r.paths.length-1]):r.localId,l=(r,f)=>"paths"in r&&r.paths&&r.paths.length>0?r.paths.some(j=>i(j)===f):o(r)===f,d=r=>{for(let f=0;f<r.length-1;f++){const m=r[f],j=r[f+1];if(m.localId===n&&j.localId===s||l(m,n)&&j.localId===s)return!0}for(const f of r){if(f.localId===n&&f.steps?.[0]?.localId===s)return!0;if("paths"in f&&f.paths){for(const m of f.paths)if(h(m))return!0}if("steps"in f&&f.steps&&d(f.steps))return!0}return!1},h=r=>{if(r.localId===n&&r.steps?.[0]?.localId===s||r.steps&&r.steps.length>0&&d(r.steps))return!0;if(r.paths){for(const f of r.paths)if(h(f))return!0}return!1},c=e.steps;return c?.[0]&&c[0].localId===n&&c[0].steps?.[0]?.localId===s?!0:d(c)},Ue=(e,n)=>{if(e.localId===n)return e.status;if(e.steps)for(const s of e.steps){const o=we(s,n);if(o!==void 0)return o}if(e.paths)for(const s of e.paths){const o=Ue(s,n);if(o!==void 0)return o}},we=(e,n)=>{if(e.localId===n)return e.status;if(e.paths)for(const s of e.paths){const o=Ue(s,n);if(o!==void 0)return o}if(e.steps)for(const s of e.steps){const o=we(s,n);if(o!==void 0)return o}},G=(e,n)=>{for(const s of e.triggers)if(s.localId===n)return s.status;for(const s of e.steps){const o=we(s,n);if(o!==void 0)return o}},ln=(e,n)=>{const s=i=>{if(i.localId===n)return!0;if(i.steps){for(const l of i.steps)if(o(l))return!0}if(i.paths){for(const l of i.paths)if(s(l))return!0}return!1},o=i=>{if(i.paths){for(const l of i.paths)if(s(l))return!0}if(i.steps){for(const l of i.steps)if(o(l))return!0}return!1};for(const i of e.triggers)if(o(i))return!0;for(const i of e.steps)if(o(i))return!0;return!1},ye=(e,n,s)=>{if(n===s)return!1;const o=G(e,n),i=G(e,s);return o!=="finished"||i!=="finished"?!1:Ie(e,n,s)},be=(e,n,s)=>n===s||!ln(e,n)||G(e,s)!=="finished"?!1:Ie(e,n,s),X=({lineColor:e,style:n,fromLocalId:s,toLocalId:o})=>{const l=ae(e)?`${D.stepLinkLine} ${D.dashedLine}`:D.stepLinkLine;return t.jsxs("div",{className:`${D.stepLinkContainer} ${D.readOnly}`,style:{...n,"--step-link-color":e},"aria-hidden":!0,"data-connector-from":void 0,"data-connector-to":void 0,children:[t.jsx("div",{className:l}),t.jsx("div",{className:`${D.stepLinkIcon} ${D.debuggerIconCollapsed}`,"aria-hidden":!0}),t.jsx("div",{className:l})]})},Ne=e=>e.steps&&e.steps.length>0?Q(e.steps[e.steps.length-1]):e.paths&&e.paths.length>0?Ne(e.paths[e.paths.length-1]):e.localId,Q=e=>"paths"in e&&e.paths&&e.paths.length>0?Ne(e.paths[e.paths.length-1]):"steps"in e&&e.steps&&e.steps.length>0?Q(e.steps[e.steps.length-1]):e.localId,Ce=e=>"steps"in e&&e.steps&&e.steps.length>0?Ce(e.steps[e.steps.length-1]):"paths"in e&&e.paths&&e.paths.length>0?Ce(e.paths[e.paths.length-1]):e.localId,Xe=(e,n,s,o)=>{const i=n.statusLine(void 0);if(o==null)return i;const l=G(e,o);return l==null?i:l!=="finished"?n.statusLine(l):s==null?i:be(e,s,o)||ye(e,s,o)?n.statusLine("finished"):i},qe=p.createContext(null),cn=qe.Provider,Se=()=>{const e=p.useContext(qe);if(!e)throw new Error("useProcessDebuggerContext must be used within ProcessDebuggerProvider");return e},Oe=34.5,an=33,Ke=e=>{const{items:n,pathId:s,previousLocalId:o,nextLocalId:i,onSelectStep:l,onResize:d,onCheckScenario:h}=e,{process:c,lineColors:r}=Se(),f=()=>{},m=Xe(c,r,o,i),j=p.useRef(null),C=p.useRef([]),[y,b]=p.useState([]);p.useEffect(()=>{const a=()=>{const N=j.current;if(!N||n.length===0){b([]);return}const R=[],O=Number.parseFloat(getComputedStyle(N).zoom||"1");for(let w=0;w<n.length;w++){const T=C.current[w];if(T)if(T.offsetParent==null){const S=N.getBoundingClientRect(),P=T.getBoundingClientRect();R.push((P.top-S.top)/O+Oe)}else R.push(T.offsetTop-an+Oe)}R.length===n.length&&b(R)};a();const v=new ResizeObserver(a),_=j.current;return _&&v.observe(_),window.addEventListener("resize",a),()=>{v.disconnect(),window.removeEventListener("resize",a)}},[n]);const x=p.useMemo(()=>{if(n.length)return We(n.map(a=>re(a)))},[n]),g=m,k=p.useMemo(()=>y.length!==n.length||n.length<=1?null:n.map((a,v)=>v).filter(a=>a>0).map(a=>{const v=y[a];if(v===void 0)return null;const _=re(n[a]),N=r.statusLine(_);return t.jsx(xe,{width:100,height:v,strokeColor:N,fromLocalId:n[a-1]?.localId,toLocalId:n[a]?.localId},a)}),[n,y,r]),u=p.useMemo(()=>{if(y.length!==n.length||n.length<=1)return null;const a=r.statusLine(void 0);return n.map((v,_)=>_).filter(v=>v>0).map(v=>{const _=y[v];if(_===void 0)return null;let N=a;if(i!=null&&G(c,i)==="finished"){const O=Ce(n[v]);ye(c,O,i)&&(N=r.statusLine("finished"))}return t.jsx(xe,{width:100,height:_,strokeColor:N,fromLocalId:o,toLocalId:i},v)})},[n,y,r,c,i,o]);return t.jsxs("div",{className:F.row,children:[t.jsx(Ve,{onDelete:()=>{},enabled:!1,debuggerMode:!0,status:x,onSelect:s!=null&&l?()=>l(s):void 0}),t.jsxs("div",{ref:j,className:F.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100px",height:"2px",borderTop:Y(g)}}),k]}),t.jsx("div",{className:F.column,children:n.map((a,v)=>{let _;if(a.paths)_=t.jsx(Ke,{items:a.paths,pathId:s,previousLocalId:a.localId,nextLocalId:i,onSelectStep:l,onResize:d,onCheckScenario:h},a.localId);else if(a.steps){const N=a,R=N.status==="finished"||i!=null&&be(c,N.localId,i)?"finished":void 0;_=t.jsxs("div",{className:F.stepsContainer,"data-local-id":void 0,children:[t.jsx(pe,{expression:N.condition,status:R,debuggerMode:!0,style:{marginTop:"25px"}}),t.jsx(Le,{steps:a.steps,pathId:a.localId,previousLocalId:N.localId,nextLocalId:i,onSelectStep:l??f,onResize:d,onCheckScenario:h},a.localId)]})}else _=t.jsx(K,{localId:a.localId,title:"title"in a?a.title:"",idx:1,icon:"icon"in a?a.icon:void 0,status:"status"in a?a.status:void 0,debuggerMode:!0,onSelectStep:l,onUpdateFilter:f,onCheckScenario:h},a.localId);return t.jsx("div",{ref:N=>{C.current[v]=N},style:{width:"100%"},"data-local-id":void 0,children:_},a.localId)})}),t.jsxs("div",{className:F.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:.5,left:0,flex:1,width:"100%",height:"2px",borderTop:Y(m)}}),u]}),t.jsx(X,{lineColor:m,fromLocalId:o,toLocalId:i,style:{marginTop:"34px",height:0}}),t.jsx("div",{style:{flex:1,width:"100%",height:"2px",borderTop:Y(m),marginTop:"34px"}})]})},dn=({value:e,previousLocalId:n,nextLocalId:s,onSelectStep:o,onResize:i,onCheckScenario:l})=>{const{process:d,lineColors:h}=Se(),{localId:c,limit:r,steps:f,condition:m}=e,j=f??[],C=()=>{},[y,b]=p.useState(!1),x=()=>{b(N=>!N),i?.()},g=L.container+(y?"":" "+L.collapsed),k=L.expandable+(y?"":" "+L.expandableCollapsed),u=j[0]?.localId,a=u!=null?G(d,u):void 0,_=n!=null&&(be(d,n,c)||G(d,n)==="finished"&&Ie(d,n,c)||ye(d,n,c))&&a==="finished"?h.statusLine("finished"):h.statusLine(void 0);return t.jsxs("div",{className:g,"data-local-id":void 0,children:[t.jsxs("div",{className:L.loopNodeWrapper,children:[t.jsx("div",{className:L.loopBox,children:t.jsx("div",{onClick:x,className:L.loopIconWrapper,children:t.jsx(Ye,{})})}),t.jsx("div",{className:L.label,children:"Loop"}),r!=null&&t.jsxs("div",{className:L.limit,children:[r,"x"]})]}),t.jsxs("div",{className:k,children:[t.jsxs("div",{className:L.connector,style:{"--iterator-connector-color":_,...ae(_)&&{"--iterator-connector-width":"3px","--iterator-connector-style":"dotted"}},children:[t.jsx("div",{className:L.line}),t.jsx("div",{className:L.circleDot,children:t.jsx("div",{className:L.innerDot})}),t.jsx("div",{className:L.line})]}),t.jsx(pe,{expression:m??"",status:e.status,debuggerMode:!0,style:{marginTop:"25.5px"}}),t.jsx("div",{className:L.stepsWrapper,children:t.jsx(Le,{steps:j,pathId:c,previousLocalId:c,nextLocalId:s,onSelectStep:o??(()=>{}),onCheckScenario:l??C,isDescendent:!0})})]})]})},ve=68,un=e=>{if(!e||e.length===0)return;const n=We(e.map(o=>re(o))),s=e.find(o=>re(o)===n)??e[e.length-1];return Ne(s)},Le=({pathId:e,steps:n,centerY:s,className:o,previousLocalId:i,nextLocalId:l,onSelectStep:d,onResize:h,onCheckScenario:c,isDescendent:r=!0})=>{const{process:f,lineColors:m}=Se(),j=()=>{},C=s===void 0?void 0:{marginTop:Math.max(0,s-ve/2)},y=(x,g)=>Xe(f,m,x,g),b=x=>x===n.length-1?l:n[x+1]?.localId;if(n.length===0){const x=y(i,l);return t.jsxs("div",{"data-path-id":e??"",style:{width:"100%",marginTop:"20px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...C},children:[t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:Y(x)}}),t.jsx(X,{lineColor:x,fromLocalId:i,toLocalId:l,style:{height:"auto",marginTop:"2px"}}),t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:Y(x)}})]})}return t.jsx("div",{"data-path-id":e??"",className:q.steps+(o?" "+o:""),style:C,children:t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",alignItems:"flex-start"},children:[t.jsx(X,{lineColor:y(i,n[0]?.localId),fromLocalId:i,toLocalId:n[0]?.localId,style:{marginTop:"21.5px"}}),n.map((x,g)=>{const k=!!x.paths,u="condition"in x&&typeof x.condition=="string";let a;if(k&&x.paths){const v=un(x.paths);a=t.jsx(Ke,{items:x.paths,pathId:x.localId,previousLocalId:v??x.localId,nextLocalId:b(g),onSelectStep:d,onResize:h,onCheckScenario:c},x.title)}else if(u){const v=g===0?i:Q(n[g-1]),_=Q(x);a=t.jsxs(t.Fragment,{children:[t.jsx(dn,{value:x,previousLocalId:v,nextLocalId:b(g),onSelectStep:d,onResize:h,onCheckScenario:c}),t.jsx(X,{lineColor:y(_,b(g)),fromLocalId:x.localId,toLocalId:b(g),style:{marginTop:"34px",height:0}})]})}else a=t.jsxs(t.Fragment,{children:[t.jsx(K,{localId:x.localId,title:x.title,idx:1,icon:x.icon,isSet:x.isSet,isInvalid:x.isInvalid,isFilter:x.isFilter,status:x.status,debuggerMode:!0,onSelectStep:d,onUpdateFilter:j,onCheckScenario:c},x.title),t.jsx(X,{lineColor:y(x.localId,b(g)),fromLocalId:x.localId,toLocalId:b(g)})]});return t.jsx("div",{className:q.stepContainer+(k||u?" "+q.stepContainerWithPaths:""),children:a},x.localId)}),r&&t.jsx("div",{style:{flexGrow:1,minWidth:0,borderTop:Y(y(n.length>0?Q(n[n.length-1]):void 0,l)),marginTop:"33.5px"}})]})})},pn=({centerY:e,neutralLineColor:n})=>t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",marginTop:Math.max(0,e-ve/2),height:ve,alignItems:"center"},children:[t.jsx("div",{style:{flexGrow:1,minWidth:0,height:"2px",borderTop:`2px solid ${n}`}}),t.jsx(X,{lineColor:n,style:{height:"auto"}}),t.jsx("div",{style:{flexGrow:1,minWidth:0,height:"2px",borderTop:`2px solid ${n}`}})]}),hn=({process:e,statusLineColors:n,neutralLineColor:s=I.NAVY,onResize:o,onSelectStep:i,onCheckScenario:l=()=>{}})=>{const[d,h]=p.useState(0),c=p.useMemo(()=>i1(n,s),[n,s]);return t.jsx("div",{className:Ze.container,children:t.jsxs(cn,{value:{process:e,lineColors:c},children:[t.jsx(je,{steps:e.triggers,onSelectStep:i,debuggerMode:!0,resolveCurveStrokeColor:c.statusLine,onCenterYUpdate:h}),e.steps.length>0?t.jsx(Le,{steps:e.steps,centerY:d,onResize:o,onSelectStep:i,onCheckScenario:l,isDescendent:!1,pathId:void 0}):t.jsx(pn,{centerY:d,neutralLineColor:c.statusLine(void 0)})]})})};class Je extends Error{constructor(n){super(n),this.name="AddStepError"}}const $e=e=>"condition"in e&&typeof e.condition=="string",Qe=(e,n,s,o)=>{const i=o==="prepend"?n:n+1;return[...e.slice(0,i),s,...e.slice(i)]},Te=(e,n,s,o)=>{for(let i=0;i<e.length;i++){if(e[i].localId===n)return Qe(e,i,o,s);const l=e[i],d=l.steps?.length&&Te(l.steps,n,s,o);if(d)return e.map((c,r)=>r===i?{...c,steps:d}:c);const h=l.paths?.length&&et(l.paths,n,s,o);if(h)return e.map((c,r)=>r===i?{...c,paths:h}:c)}return null},fn=(e,n,s)=>{const o=e.steps??[],i=n==="prepend"?[s,...o]:[...o,s];return{...e,steps:i}},et=(e,n,s,o)=>{for(let i=0;i<e.length;i++){const l=e[i];if(l.localId===n)return $e(l)?e.map((d,h)=>h===i?fn(l,s,o):d):Qe(e,i,o,s);if($e(l)){const d=l.steps?.length&&Te(l.steps,n,s,o);if(d)return e.map((c,r)=>r===i?{...c,steps:d}:c);const h=l.paths?.length&&et(l.paths,n,s,o);if(h)return e.map((c,r)=>r===i?{...c,paths:h}:c)}}return null},gn=(e,n,s,o)=>{const i=Te(e.steps,n,s,o);if(i)return{...e,steps:i};throw new Je(`Step or path with id "${n}" not found`)},tt=(e,n)=>({...e,...e.steps!=null&&{steps:Pe(e.steps,n)},...e.paths!=null&&{paths:e.paths.map(s=>tt(s,n))}}),Pe=(e,n)=>e.filter(s=>s.localId!==n).map(s=>({...s,...s.steps!=null&&{steps:Pe(s.steps,n)},...s.paths!=null&&{paths:s.paths.map(o=>tt(o,n))}})),xn=(e,n)=>{const s=Pe(e.steps,n);return{...e,steps:s}};exports.AddStepError=Je;exports.Iterator=Ge;exports.Menu=ee;exports.MenuProvider=Ot;exports.ProcessDebuggerDiagram=hn;exports.ProcessDiagram=rn;exports.ProcessStep=K;exports.Trigger=je;exports.addStep=gn;exports.deleteStep=xn;exports.useMenuProvider=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("react"),st=require("react-dom"),ot="_container_1f7x1_1",it="_step_1f7x1_7",rt="_dotsButton_1f7x1_23",lt="_selected_1f7x1_27",ct="_selectedInvalid_1f7x1_36",at="_isSet_1f7x1_45",dt="_invalid_1f7x1_52",ut="_debuggerStatus_1f7x1_60",pt="_title_1f7x1_64",ht="_icon_1f7x1_67",ft="_filterFlag_1f7x1_78",gt="_content_1f7x1_141",E={container:ot,step:it,dotsButton:rt,selected:lt,selectedInvalid:ct,isSet:at,invalid:dt,debuggerStatus:ut,title:pt,icon:ht,filterFlag:ft,content:gt};var De={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ke=u.createContext&&u.createContext(De),xt=["attr","size","title"];function mt(e,n){if(e==null)return{};var s=Ct(e,n),o,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)o=l[i],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function Ct(e,n){if(e==null)return{};var s={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(n.indexOf(o)>=0)continue;s[o]=e[o]}return s}function oe(){return oe=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o])}return e},oe.apply(this,arguments)}function Ee(e,n){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),s.push.apply(s,o)}return s}function ie(e){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?Ee(Object(s),!0).forEach(function(o){vt(e,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ee(Object(s)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(s,o))})}return e}function vt(e,n,s){return n=jt(n),n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}function jt(e){var n=_t(e,"string");return typeof n=="symbol"?n:n+""}function _t(e,n){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var o=s.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Be(e){return e&&e.map((n,s)=>u.createElement(n.tag,ie({key:s},n.attr),Be(n.child)))}function Z(e){return n=>u.createElement(It,oe({attr:ie({},e.attr)},n),Be(e.child))}function It(e){var n=s=>{var{attr:o,size:i,title:l}=e,d=mt(e,xt),h=i||s.size||"1em",c;return s.className&&(c=s.className),e.className&&(c=(c?c+" ":"")+e.className),u.createElement("svg",oe({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,d,{className:c,style:ie(ie({color:e.color||s.color},s.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),l&&u.createElement("title",null,l),e.children)};return ke!==void 0?u.createElement(ke.Consumer,null,s=>n(s)):n(De)}function wt(e){return Z({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641zM6.374 1 4.168 8.5H7.5a.5.5 0 0 1 .478.647L6.78 13.04 11.478 7H8a.5.5 0 0 1-.474-.658L9.306 1z"},child:[]}]})(e)}function Fe(e){return Z({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325"},child:[]}]})(e)}function re(e){return Z({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}function le(e){return Z({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"},child:[]},{tag:"path",attr:{d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"},child:[]}]})(e)}const yt="_panel_19663_1",bt="_panelExiting_19663_13",Nt="_menuItem_19663_37",St="_disabled_19663_52",Lt="_menuItemIcon_19663_57",Tt="_menuItemText_19663_63",Pt="_overlay_19663_69",B={panel:yt,panelExiting:bt,menuItem:Nt,disabled:St,menuItemIcon:Lt,menuItemText:Tt,overlay:Pt},kt=e=>{const s=e.currentTarget??e.target;if(s?.getBoundingClientRect){const i=s.getBoundingClientRect();return{top:i.bottom+2,left:i.left}}const o=e;return{top:(o.clientY??0)+2,left:o.clientX??0}},te=u.forwardRef(function({model:n,popup:s=!0,onHide:o,onClick:i},l){const[d,h]=u.useState(!1),[c,r]=u.useState(!1),[f,m]=u.useState({top:0,left:0}),j=u.useRef(null),C=u.useCallback(()=>{c||r(!0)},[c]),y=u.useCallback(p=>{c&&p.animationName.includes("menuOut")&&(h(!1),r(!1),o?.())},[c,o]),b=u.useCallback(p=>{m(kt(p)),r(!1),h(!0)},[]),x=u.useCallback(p=>{d?C():b(p)},[d,C,b]);u.useImperativeHandle(l,()=>({show:b,hide:C,toggle:x}),[b,C,x]),u.useEffect(()=>{if(!d)return;const p=v=>{v.key==="Escape"&&C()},a=v=>{const _=j.current;_&&!_.contains(v.target)&&(v.stopPropagation(),C())};return document.addEventListener("keydown",p),document.addEventListener("mousedown",a),()=>{document.removeEventListener("keydown",p),document.removeEventListener("mousedown",a)}},[d,C]);const g=(p,a)=>{a.stopPropagation(),p.command?.({originalEvent:a,item:p}),C()},k=(p,a)=>{const v=_=>g(p,_);return p.template?t.jsx(u.Fragment,{children:p.template(p,{onClick:v})},a):t.jsxs("button",{type:"button",className:`${B.menuItem} ${p.disabled&&B.disabled}`,onClick:_=>{p.disabled||v(_)},children:[p.icon&&t.jsx("span",{className:B.menuItemIcon,children:p.icon}),t.jsx("span",{className:B.menuItemText,children:p.label})]},a)};return!d||!s?null:st.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:B.overlay,"aria-hidden":!0,onClick:()=>C(),onMouseDown:p=>p.stopPropagation()}),t.jsx("div",{ref:j,className:`${B.panel} ${c?B.panelExiting:""}`,role:"menu",style:{top:f.top,left:f.left},onAnimationEnd:y,onClick:p=>{p.stopPropagation(),i?.(p)},children:n.map(k)})]}),document.body)}),ce=()=>(e,n)=>t.jsxs("button",{className:B.menuItem,onClick:s=>n.onClick(s),children:[t.jsx("span",{className:B.menuItemIcon,children:e.icon}),t.jsx("span",{className:B.menuItemText,children:e.label})]}),I={NAVY:"#3B64A0",LIGHT_BG:"#fafafa",FINISHED_GREEN:"#17a34a",ERROR_RED:"#E32012",TEAL:"#127ee3",ADD_TRIGGER_FILL:"#0C971F",ADD_TRIGGER_STROKE:"#14BC2B",SEPARATOR:"#a1bbdc",SLATE_400:"#94a3b8",ORANGE:"#ff9800"},ae=e=>e?.toLowerCase()===I.FINISHED_GREEN.toLowerCase(),Y=e=>ae(e)?`3px dotted ${e}`:`2px solid ${e}`,de={pending:I.NAVY,running:I.TEAL,validating:I.ORANGE,finished:I.FINISHED_GREEN,failed:I.ERROR_RED,cancelled:I.ORANGE,skipped:I.SLATE_400,invalid:I.ERROR_RED},Et={pending:I.LIGHT_BG,running:"#e6f7f6",validating:"#eff6ff",finished:"#DFFFE3",failed:"#fde8e6",cancelled:"#f1f5f9",skipped:"#f1f5f9",invalid:"#fffbeb"},Rt=({width:e=16,height:n=16,color:s=I.NAVY})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{x:"7.99219",y:"0.222732",width:"11",height:"11",rx:"1.5",transform:"rotate(45 7.99219 0.222732)",stroke:s}),t.jsx("path",{d:"M10.4693 5.52599L5.52513 10.4813M5.52513 5.53151L10.4749 10.4813",stroke:s,strokeLinecap:"round"})]}),Mt=({width:e=16,height:n=16,color:s=I.NAVY})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M11.5341 7.00002H15.4661C15.5136 7.00004 15.5601 7.01359 15.6002 7.03909C15.6403 7.06459 15.6722 7.10098 15.6924 7.144C15.7125 7.18702 15.72 7.23489 15.7139 7.282C15.7079 7.32912 15.6885 7.37352 15.6581 7.41002L13.6921 9.77002C13.6686 9.79816 13.6393 9.82079 13.6061 9.83633C13.5729 9.85186 13.5367 9.85991 13.5001 9.85991C13.4635 9.85991 13.4273 9.85186 13.3941 9.83633C13.3609 9.82079 13.3315 9.79816 13.3081 9.77002L11.3421 7.41002C11.3117 7.37352 11.2923 7.32912 11.2862 7.282C11.2802 7.23489 11.2876 7.18702 11.3078 7.144C11.3279 7.10098 11.3599 7.06459 11.4 7.03909C11.4401 7.01359 11.4866 7.00004 11.5341 7.00002ZM0.534086 9.00002H4.46609C4.51359 9.00001 4.56011 8.98645 4.60019 8.96096C4.64027 8.93546 4.67225 8.89907 4.6924 8.85605C4.71254 8.81303 4.72002 8.76516 4.71394 8.71804C4.70786 8.67093 4.68849 8.62652 4.65809 8.59002L2.69209 6.23002C2.66862 6.20189 2.63926 6.17925 2.60609 6.16372C2.57291 6.14819 2.53672 6.14014 2.50009 6.14014C2.46345 6.14014 2.42726 6.14819 2.39409 6.16372C2.36091 6.17925 2.33155 6.20189 2.30809 6.23002L0.342086 8.59002C0.311684 8.62652 0.29231 8.67093 0.286234 8.71804C0.280157 8.76516 0.287629 8.81303 0.307775 8.85605C0.327921 8.89907 0.359907 8.93546 0.399987 8.96096C0.440067 8.98645 0.486583 9.00001 0.534086 9.00002Z",fill:s}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00001 3.00023C6.44801 3.00023 5.06001 3.70723 4.14301 4.81823C4.10206 4.87131 4.05086 4.9156 3.99245 4.94849C3.93404 4.98138 3.86961 5.00219 3.803 5.00968C3.73638 5.01717 3.66895 5.01119 3.60469 4.99209C3.54043 4.97299 3.48068 4.94117 3.42897 4.89851C3.37726 4.85586 3.33465 4.80324 3.30368 4.74379C3.27272 4.68434 3.25402 4.61926 3.24871 4.55244C3.24339 4.48562 3.25157 4.41841 3.27275 4.35481C3.29394 4.29121 3.32769 4.23252 3.37201 4.18223C4.1042 3.29576 5.0756 2.63824 6.17067 2.28789C7.26575 1.93753 8.43841 1.90908 9.54918 2.20592C10.66 2.50276 11.6621 3.1124 12.4364 3.96232C13.2107 4.81224 13.7246 5.86668 13.917 7.00023H12.9C12.6691 5.87104 12.0554 4.85623 11.1625 4.12738C10.2697 3.39853 9.15256 3.00037 8.00001 3.00023ZM3.10001 9.00023C3.28932 9.92486 3.73636 10.7771 4.38949 11.4584C5.04261 12.1397 5.87517 12.6223 6.79097 12.8505C7.70677 13.0787 8.66845 13.0431 9.5649 12.7479C10.4613 12.4527 11.256 11.9099 11.857 11.1822C11.898 11.1292 11.9492 11.0849 12.0076 11.052C12.066 11.0191 12.1304 10.9983 12.197 10.9908C12.2636 10.9833 12.3311 10.9893 12.3953 11.0084C12.4596 11.0275 12.5193 11.0593 12.5711 11.102C12.6228 11.1446 12.6654 11.1972 12.6963 11.2567C12.7273 11.3161 12.746 11.3812 12.7513 11.448C12.7566 11.5148 12.7484 11.5821 12.7273 11.6457C12.7061 11.7093 12.6723 11.7679 12.628 11.8182C11.8958 12.7047 10.9244 13.3622 9.82934 13.7126C8.73427 14.0629 7.56161 14.0914 6.45083 13.7945C5.34006 13.4977 4.33791 12.8881 3.5636 12.0381C2.78928 11.1882 2.27538 10.1338 2.08301 9.00023H3.10001Z",fill:s})]}),ge=({width:e=16,height:n=16,color:s=I.NAVY})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M8 15C6.14348 15 4.36301 14.2625 3.05025 12.9497C1.7375 11.637 1 9.85652 1 8C1 6.14348 1.7375 4.36301 3.05025 3.05025C4.36301 1.7375 6.14348 1 8 1C9.85652 1 11.637 1.7375 12.9497 3.05025C14.2625 4.36301 15 6.14348 15 8C15 9.85652 14.2625 11.637 12.9497 12.9497C11.637 14.2625 9.85652 15 8 15ZM8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16Z",fill:s}),t.jsx("path",{d:"M7 11.5C7 11.3674 7.05268 11.2402 7.14645 11.1464C7.24021 11.0527 7.36739 11 7.5 11H8.5C8.63261 11 8.75979 11.0527 8.85355 11.1464C8.94732 11.2402 9 11.3674 9 11.5C9 11.6326 8.94732 11.7598 8.85355 11.8536C8.75979 11.9473 8.63261 12 8.5 12H7.5C7.36739 12 7.24021 11.9473 7.14645 11.8536C7.05268 11.7598 7 11.6326 7 11.5ZM5 8.5C5 8.36739 5.05268 8.24021 5.14645 8.14645C5.24021 8.05268 5.36739 8 5.5 8H10.5C10.6326 8 10.7598 8.05268 10.8536 8.14645C10.9473 8.24021 11 8.36739 11 8.5C11 8.63261 10.9473 8.75979 10.8536 8.85355C10.7598 8.94732 10.6326 9 10.5 9H5.5C5.36739 9 5.24021 8.94732 5.14645 8.85355C5.05268 8.75979 5 8.63261 5 8.5ZM3 5.5C3 5.36739 3.05268 5.24021 3.14645 5.14645C3.24021 5.05268 3.36739 5 3.5 5H12.5C12.6326 5 12.7598 5.05268 12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5C13 5.63261 12.9473 5.75979 12.8536 5.85355C12.7598 5.94732 12.6326 6 12.5 6H3.5C3.36739 6 3.24021 5.94732 3.14645 5.85355C3.05268 5.75979 3 5.63261 3 5.5Z",fill:s})]}),Ae=u.createContext(void 0),Ot=({children:e})=>{const[n,s]=u.useState([]),o=u.useCallback((d,h)=>{s(c=>(c.forEach(r=>{r.current&&r!==d&&r.current.hide(h)}),[])),d.current?.toggle(h),s([d])},[]),i=u.useCallback(d=>{s(h=>h.filter(c=>c!==d))},[]),l=u.useMemo(()=>({openMenus:n,openMenu:o,closeMenu:i}),[n,o,i]);return t.jsx(Ae.Provider,{value:l,children:e})},ue=()=>{const e=u.useContext(Ae);if(e===void 0)throw new Error("useMenuProvider must be used within a MenuProvider");return e},$t=({color:e=I.ERROR_RED})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[t.jsx("g",{clipPath:"url(#clip0_3105_5367)",children:t.jsx("path",{d:"M16 8C16 10.1217 15.1571 12.1566 13.6569 13.6569C12.1566 15.1571 10.1217 16 8 16C5.87827 16 3.84344 15.1571 2.34315 13.6569C0.842855 12.1566 0 10.1217 0 8C0 5.87827 0.842855 3.84344 2.34315 2.34315C3.84344 0.842855 5.87827 0 8 0C10.1217 0 12.1566 0.842855 13.6569 2.34315C15.1571 3.84344 16 5.87827 16 8ZM8 4C7.87361 4.00007 7.74863 4.02662 7.63312 4.07793C7.51761 4.12924 7.41413 4.20418 7.32934 4.29791C7.24456 4.39165 7.18035 4.5021 7.14084 4.62217C7.10134 4.74223 7.08743 4.86923 7.1 4.995L7.45 8.502C7.46176 8.63977 7.5248 8.76811 7.62664 8.86164C7.72849 8.95516 7.86173 9.00705 8 9.00705C8.13827 9.00705 8.27151 8.95516 8.37336 8.86164C8.4752 8.76811 8.53824 8.63977 8.55 8.502L8.9 4.995C8.91257 4.86923 8.89866 4.74223 8.85915 4.62217C8.81965 4.5021 8.75544 4.39165 8.67066 4.29791C8.58587 4.20418 8.48239 4.12924 8.36688 4.07793C8.25137 4.02662 8.12639 4.00007 8 4ZM8.002 10C7.73678 10 7.48243 10.1054 7.29489 10.2929C7.10736 10.4804 7.002 10.7348 7.002 11C7.002 11.2652 7.10736 11.5196 7.29489 11.7071C7.48243 11.8946 7.73678 12 8.002 12C8.26722 12 8.52157 11.8946 8.70911 11.7071C8.89664 11.5196 9.002 11.2652 9.002 11C9.002 10.7348 8.89664 10.4804 8.70911 10.2929C8.52157 10.1054 8.26722 10 8.002 10Z",fill:e})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_3105_5367",children:t.jsx("rect",{width:"16",height:"16",fill:"white"})})})]});function Dt(e){return Z({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},child:[]},{tag:"polyline",attr:{points:"15 3 21 3 21 9"},child:[]},{tag:"line",attr:{x1:"10",y1:"14",x2:"21",y2:"3"},child:[]}]})(e)}function Bt(e){return Z({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"4"},child:[]},{tag:"line",attr:{x1:"1.05",y1:"12",x2:"7",y2:"12"},child:[]},{tag:"line",attr:{x1:"17.01",y1:"12",x2:"22.96",y2:"12"},child:[]}]})(e)}function Ft(e){return Z({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"},child:[]}]})(e)}const K=e=>{const{isSet:n,isSelected:s,isFilter:o,debuggerMode:i=!1,status:l,className:d,title:h,icon:c,contextMenuItems:r=void 0,onDeleteStep:f,onUpdateFilter:m,onSelectStep:j,onCheckScenario:C,subtitle:y,isInvalid:b,localId:x}=e,g=u.useRef(null),{openMenu:k,closeMenu:p}=ue(),a=ce(),[v]=u.useState(!0),_=u.useMemo(()=>{const S=[];return i||S.push({label:"Add Step Filter",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(ge,{})}),command:P=>{P?.originalEvent?.stopPropagation(),m&&m(x)},template:a}),f&&!i&&S.push({label:"Remove",icon:t.jsx(le,{color:I.NAVY,size:18}),command:P=>{P?.originalEvent?.stopPropagation(),f(x)},template:a}),v&&S.push({label:"Check Scenario",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(Dt,{color:I.NAVY,size:18})}),command:P=>{P?.originalEvent?.stopPropagation(),C(x)},template:a}),S},[m,f,x,a,v,C,i]),N=u.useMemo(()=>r??_,[r,_]),R=S=>{S.stopPropagation(),k(g,S)},O=u.useMemo(()=>{if(!(!i||l==null||l==="pending"))return{"--step-debugger-accent":de[l]}},[i,l]),w=u.useMemo(()=>s&&b?E.step+" "+E.selectedInvalid:i&&l!=null&&l!=="pending"?E.step+" "+E.debuggerStatus:s?E.step+" "+E.selected:n?E.step+" "+E.isSet:b?E.step+" "+E.invalid:E.step,[n,s,b,l,i]),T=u.useMemo(()=>b?t.jsx($t,{color:I.ERROR_RED}):c,[c,b]);return t.jsx("div",{className:E.container+" "+d,"data-local-id":void 0,children:t.jsxs("div",{children:[t.jsxs("div",{className:w,style:O,onClick:()=>j(x),children:[t.jsxs("div",{className:E.content,children:[t.jsx("div",{className:`${E.icon} ${b&&E.invalid}`,children:T}),t.jsx("div",{className:E.title,children:h})]}),N.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("button",{className:E.dotsButton,onClick:R,"aria-haspopup":!0,"aria-label":"Step options",children:t.jsx(re,{className:E.dots,size:16})}),t.jsx(te,{model:N,popup:!0,ref:g,onClick:S=>S.stopPropagation(),onHide:()=>p(g)})]})]}),o&&t.jsxs("div",{className:E.filterFlag,role:"button",tabIndex:0,onClick:()=>{m&&m(x)},onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&m&&(S.preventDefault(),m(x))},children:[t.jsx(ge,{color:I.NAVY}),t.jsx("span",{children:"Filter"}),!i&&t.jsx(re,{className:E.dots,color:b?I.ERROR_RED:I.NAVY,style:{height:"10px"}})]}),y&&t.jsx("div",{className:E.subtitle,children:y})]})})},At=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[t.jsxs("g",{clipPath:"url(#clip0_6551_9169)",children:[t.jsx("rect",{width:"24",height:"24",rx:"12",fill:I.ADD_TRIGGER_FILL}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V11H18C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H13V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H11V6Z",fill:"white"})]}),t.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"11.25",stroke:I.ADD_TRIGGER_STROKE,strokeWidth:"1.5"}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_6551_9169",children:t.jsx("rect",{width:"24",height:"24",rx:"12",fill:"white"})})})]}),Wt="_multipleTriggersIcon_oxhdi_1",Ht={multipleTriggersIcon:Wt},Vt=()=>t.jsx("div",{className:Ht.multipleTriggersIcon,children:t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 3.75C1.5 3.15326 1.73705 2.58097 2.15901 2.15901C2.58097 1.73705 3.15326 1.5 3.75 1.5H5.25C5.84674 1.5 6.41903 1.73705 6.84099 2.15901C7.26295 2.58097 7.5 3.15326 7.5 3.75L13.701 3.75C13.8661 3.46404 14.1209 3.24054 14.426 3.11418C14.7311 2.98782 15.0693 2.96565 15.3883 3.05111C15.7072 3.13657 15.9891 3.32489 16.1901 3.58686C16.3911 3.84882 16.5 4.1698 16.5 4.5C16.5 4.8302 16.3911 5.15118 16.1901 5.41314C15.9891 5.67511 15.7072 5.86343 15.3883 5.94889C15.0693 6.03435 14.7311 6.01218 14.426 5.88582C14.1209 5.75946 13.8661 5.53596 13.701 5.25H10.686C10.956 5.52 11.196 5.8215 11.412 6.1575C12.369 7.6455 12.75 9.6885 12.75 12C12.75 14.9895 13.1355 16.638 13.8195 17.55C14.3535 18.264 15.162 18.6315 16.5 18.726C16.5063 18.1334 16.7462 17.5673 17.1674 17.1505C17.5887 16.7337 18.1574 16.5 18.75 16.5H20.25C20.8467 16.5 21.419 16.7371 21.841 17.159C22.2629 17.581 22.5 18.1533 22.5 18.75V20.25C22.5 20.8467 22.2629 21.419 21.841 21.841C21.419 22.2629 20.8467 22.5 20.25 22.5H18.75C18.1533 22.5 17.581 22.2629 17.159 21.841C16.7371 21.419 16.5 20.8467 16.5 20.25H10.299C10.1339 20.536 9.87905 20.7595 9.57399 20.8858C9.26892 21.0122 8.93068 21.0344 8.61173 20.9489C8.29278 20.8634 8.01095 20.6751 7.80993 20.4131C7.60892 20.1512 7.49996 19.8302 7.49996 19.5C7.49996 19.1698 7.60892 18.8488 7.80993 18.5869C8.01095 18.3249 8.29278 18.1366 8.61173 18.0511C8.93068 17.9656 9.26892 17.9878 9.57399 18.1142C9.87905 18.2405 10.1339 18.464 10.299 18.75H12.8655C12.7785 18.6538 12.6959 18.5537 12.618 18.45C11.6145 17.1105 11.25 15.0105 11.25 12C11.25 9.81 10.881 8.1045 10.1505 6.9675C9.5655 6.06 8.7225 5.4675 7.5 5.2995C7.48706 5.88762 7.2443 6.44728 6.82374 6.85859C6.40318 7.2699 5.83826 7.50014 5.25 7.5H3.75C3.15326 7.5 2.58097 7.26295 2.15901 6.84099C1.73705 6.41903 1.5 5.84674 1.5 5.25V3.75ZM3.75 3C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V5.25C3 5.44891 3.07902 5.63968 3.21967 5.78033C3.36032 5.92098 3.55109 6 3.75 6H5.25C5.44891 6 5.63968 5.92098 5.78033 5.78033C5.92098 5.63968 6 5.44891 6 5.25V3.75C6 3.55109 5.92098 3.36032 5.78033 3.21967C5.63968 3.07902 5.44891 3 5.25 3H3.75ZM18.75 18C18.5511 18 18.3603 18.079 18.2197 18.2197C18.079 18.3603 18 18.5511 18 18.75V20.25C18 20.4489 18.079 20.6397 18.2197 20.7803C18.3603 20.921 18.5511 21 18.75 21H20.25C20.4489 21 20.6397 20.921 20.7803 20.7803C20.921 20.6397 21 20.4489 21 20.25V18.75C21 18.5511 20.921 18.3603 20.7803 18.2197C20.6397 18.079 20.4489 18 20.25 18H18.75Z",fill:"white"})})}),zt="_trigger_kfg1y_1",Yt="_title_kfg1y_7",Gt="_empty_kfg1y_15",Zt="_triggerContainer_kfg1y_21",Ut="_stepsContainer_kfg1y_25",Xt="_stepItem_kfg1y_51",qt="_curvesSvg_kfg1y_70",Kt="_centralNode_kfg1y_78",Jt="_iconWrapper_kfg1y_104",Qt="_fadeIn_kfg1y_127",e1="_fadeOut_kfg1y_130",t1="_operationContainer_kfg1y_134",M={trigger:zt,title:Yt,empty:Gt,triggerContainer:Zt,stepsContainer:Ut,stepItem:Xt,curvesSvg:qt,centralNode:Kt,iconWrapper:Jt,fadeIn:Qt,fadeOut:e1,operationContainer:t1},n1=()=>t.jsx("div",{style:{height:"1px",marginLeft:"4px",marginRight:"4px",borderTop:`1px solid ${I.SEPARATOR}`}}),s1=["failed","invalid","cancelled","validating","running","finished","skipped","pending"],We=e=>{const n=[...new Set(e.filter(s=>s!=null))];if(n.length!==0){for(const s of s1)if(n.includes(s))return s;return n[0]}},He=(e,n)=>!n||e==null?I.NAVY:de[e],o1=(e,n,s=I.NAVY)=>e==null?s:n?.[e]??de[e],i1=(e,n=I.NAVY)=>({statusLine:s=>o1(s,e,n)}),Q=e=>{if("status"in e&&e.status!=null)return e.status;const n=e.steps;if(n?.[0]?.status!=null)return n[0].status},r1=80,se=34,je=({steps:e,title:n,className:s,onDeleteTrigger:o,onAddTrigger:i,onSelectStep:l,onUpdateFilter:d,onCenterYUpdate:h,debuggerMode:c=!1,resolveCurveStrokeColor:r,isAdmin:f=!1})=>{const m=u.useRef(null),j=u.useRef([]),[C,y]=u.useState([]),[b,x]=u.useState({width:0,height:0}),[g,k]=u.useState(!1),[p,a]=u.useState(!1),v=u.useRef(null);u.useEffect(()=>{const w=()=>{if(!m.current)return;const T=[];if(j.current.forEach((S,P)=>{if(S&&m.current){const A=m.current.getBoundingClientRect(),$=S.getBoundingClientRect();T.push({localId:e[P]?.localId??`step-${P}`,top:$.top-A.top,right:$.right-A.left,centerY:$.top-A.top+$.height/2})}}),y(T),m.current&&T.length>0){const S=m.current.getBoundingClientRect(),P=Math.min(...T.map(W=>W.top)),A=j.current.filter(Boolean).map(W=>W?.offsetHeight||68),$=Math.max(...T.map((W,nt)=>W.top+(A[nt]||68))),he=Math.max(...T.map(W=>W.right))+0,fe=Math.max(S.height,$-P+100);x({width:he,height:fe})}};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[e]),u.useEffect(()=>{let w=!0;if(g){v.current&&(clearTimeout(v.current),v.current=null);const T=setTimeout(()=>{w&&a(!0)},0);return()=>{w=!1,clearTimeout(T)}}return v.current=setTimeout(()=>{w&&a(!1)},140),()=>{w=!1,v.current&&(clearTimeout(v.current),v.current=null)}},[g]);const _=C.length>0?r1:0,N=u.useMemo(()=>C.length>1?C.reduce((w,T)=>w+T.top+se,0)/C.length:C.length===1?C[0].top+se:0,[C]);u.useEffect(()=>{h?.(N)},[N,h]);const R=ce();if(e.length===0)return t.jsxs("div",{className:`${M.trigger} ${s||""}`,children:[n&&t.jsx("h3",{className:M.title,children:n}),t.jsx("div",{className:M.empty,children:"No steps"})]});const O=(w,T,S,P)=>{const A=S-w,$=Math.min(A*.6,60),ne=w+$,he=T,fe=S-$;return`M ${w} ${T} C ${ne} ${he}, ${fe} ${P}, ${S} ${P}`};return t.jsxs("div",{className:`${M.trigger} ${s||""}`,ref:m,children:[n&&t.jsx("h3",{className:M.title,children:n}),t.jsxs("div",{className:M.triggerContainer,children:[t.jsx("div",{className:M.stepsContainer,children:e.map((w,T)=>t.jsx("div",{ref:S=>{j.current[T]=S},children:t.jsx(K,{title:w.title,className:M.stepItem,localId:w.localId,idx:T,isSet:w.isSet,isSelected:w.isSelected,isInvalid:w.isInvalid,isFilter:w.isFilter,status:w.status,debuggerMode:c,icon:w.icon,onSelectStep:l,onUpdateFilter:d,onCheckScenario:()=>{throw new Error("Check scenario not handled in Trigger")},contextMenuItems:f?[{label:"Add Step Filter",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(ge,{})}),command:S=>{S?.originalEvent?.stopPropagation(),d&&d(w.localId)},template:R},{label:"Delete",icon:t.jsx(le,{className:"mr-2",color:I.NAVY,size:18}),command:()=>{o?.(w.localId)},disabled:e.length===1},{label:"",template:()=>t.jsx(n1,{})},{label:"Add More Triggers",icon:t.jsx(wt,{className:"mr-2",color:I.NAVY,size:18}),command:()=>{i?.()}}]:[]})},w.localId))}),t.jsx("div",{style:{position:"relative"},children:C.length>1&&t.jsx("svg",{className:M.curvesSvg,width:b.width,height:b.height,children:C.map(w=>{const S=C.length===1?C[0].top+se:w.top+se,P=_,A=N,$=e.find(ne=>ne.localId===w.localId)?.status;return t.jsx("path",{d:O(0,S,P,A),stroke:r!=null?r($):He($,c),strokeWidth:"2",fill:"none",strokeLinecap:"round"},w.localId)})})}),C.length>1?t.jsxs("div",{style:{position:"relative",marginRight:"140px"},children:[t.jsx("div",{className:M.centralNode,style:{"--node-x":`${_}px`,"--node-y":`${N}px`},onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:p?t.jsx("div",{className:`${M.iconWrapper} ${g?M.fadeIn:M.fadeOut}`,onClick:i,children:t.jsx(At,{})}):null}),t.jsx("div",{className:M.operationContainer,style:{"--op-x":`${_+16}px`,"--op-y":`${N}px`},children:t.jsx(Vt,{})})]}):null]})]})},l1=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M6 12L18 12",stroke:I.NAVY,strokeWidth:"2",strokeLinecap:"round"}),t.jsx("path",{d:"M12 6V18",stroke:I.NAVY,strokeWidth:"2",strokeLinecap:"round"})]}),c1="_stepLinkIcon_b0452_1",a1="_stepLinkLine_b0452_15",d1="_stepLinkContainer_b0452_39",u1="_readOnly_b0452_61",p1="_debuggerIconCollapsed_b0452_66",h1="_dashedLine_b0452_75",D={stepLinkIcon:c1,stepLinkLine:a1,stepLinkContainer:d1,readOnly:u1,debuggerIconCollapsed:p1,dashedLine:h1},U=({onAddStep:e,onAddTrigger:n,onAddCondition:s,onAddLoop:o,iteratorEnabled:i=!0,conditionsEnabled:l=!0,lineColor:d=I.NAVY,stepId:h,index:c=0,style:r,pathId:f})=>{const m=ce(),j=u.useRef(null),C=[...c>0?[{label:"Trigger",icon:t.jsx(Ft,{color:I.NAVY,size:18}),command:()=>{n?.(h,f,"trigger")},template:m}]:[],{label:"Step",icon:t.jsx(Bt,{color:I.NAVY,size:18}),command:()=>e?.(h,f,c>0?"append":"prepend"),template:m},...l&&h!=null?[{label:"Condition",icon:t.jsx(Rt,{width:18,height:18}),command:()=>s?.(h,f,c>0?"append":"prepend"),template:m}]:[],...i?[{label:"Loop",icon:t.jsx(Mt,{width:18,height:18}),command:()=>o?.(h,f,c>0?"append":"prepend"),template:m}]:[]],y=b=>{j.current?.show(b)};return t.jsxs("div",{className:D.stepLinkContainer,style:{...r,"--step-link-color":d},"data-plus-index":c,children:[t.jsx("div",{className:D.stepLinkLine}),t.jsx("div",{className:D.stepLinkIcon,onClick:y,"aria-haspopup":!0,children:t.jsx(l1,{})}),t.jsx(te,{model:C,popup:!0,ref:j}),t.jsx("div",{className:D.stepLinkLine})]})},f1="_steps_yug55_1",g1="_stepContainer_yug55_8",x1="_stepContainerWithPaths_yug55_14",q={steps:f1,stepContainer:g1,stepContainerWithPaths:x1},m1=(e,n,s,o)=>{const i=s-e,l=Math.min(i*.66,66),d=e+l,h=n,c=s-l;return`M ${e} ${n} C ${d} ${h}, ${c} ${o}, ${s} ${o}`},xe=({width:e,height:n,strokeColor:s=I.NAVY,fromLocalId:o,toLocalId:i})=>{const l=ae(s),f=m1(0,1,e,n);return t.jsx("div",{style:{position:"absolute"},"data-connector-from":void 0,"data-connector-to":void 0,children:t.jsx("svg",{width:e,height:n+1,viewBox:`0 0 ${e} ${n+1}`,xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:f,stroke:s,strokeWidth:l?3:2,fill:"none",strokeLinecap:"round",strokeDasharray:l?"0 6":void 0,"data-connector-from":void 0,"data-connector-to":void 0})})})},C1="_column_1uiy3_1",v1="_row_1uiy3_19",j1="_stepsContainer_1uiy3_24",F={column:C1,row:v1,stepsContainer:j1},_1="_wrapper_1nl2d_1",I1="_tooltip_1nl2d_5",Re={wrapper:_1,tooltip:I1},w1=({content:e,children:n,maxWidth:s=500,className:o})=>t.jsxs("div",{className:`${Re.wrapper} ${o??""}`.trim(),style:{"--tooltip-max-width":`${s}px`},children:[n,e?t.jsx("div",{className:Re.tooltip,role:"tooltip",children:e}):null]}),y1="_conditionContainer_19jfz_1",b1="_debuggerTint_19jfz_5",N1="_connectorLine_19jfz_5",S1="_connectorDot_19jfz_8",L1="_condition_19jfz_1",T1="_conditionWrapper_19jfz_15",P1="_conditionFits_19jfz_67",H={conditionContainer:y1,debuggerTint:b1,connectorLine:N1,connectorDot:S1,condition:L1,conditionWrapper:T1,conditionFits:P1},pe=({expression:e,style:n,status:s,debuggerMode:o=!1})=>{const i=u.useRef(null),l=u.useRef(null),[d,h]=u.useState(!1);u.useLayoutEffect(()=>{const C=i.current,y=l.current;if(!C||!y)return;const{paddingLeft:b,paddingRight:x}=getComputedStyle(C),g=Number.parseFloat(b)+Number.parseFloat(x);h(y.offsetWidth>=C.clientWidth-g)},[e]);const c=e&&d?e:"",r=o&&s!=null,f=u.useMemo(()=>{if(!r||s==null)return;const C=s==="finished";return{"--condition-accent":de[s],"--condition-bg":Et[s],...C&&{"--condition-line-width":"3px","--condition-line-style":"dotted"}}},[r,s]),m=`${H.condition} ${d?"":H.conditionFits}`.trim(),j=`${H.conditionContainer} ${r?H.debuggerTint:""}`.trim();return t.jsxs("div",{className:j,style:{...n,...f},children:[t.jsx("div",{className:H.connectorLine}),t.jsx(w1,{content:c,className:H.conditionWrapper,children:t.jsx("div",{ref:i,className:m,children:t.jsx("span",{ref:l,children:e})})}),t.jsx("div",{className:H.connectorLine}),t.jsx("div",{className:H.connectorDot})]})},k1="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='21.8125'%20y='-2.52539'%20width='34.4207'%20height='34.4207'%20rx='6.09524'%20transform='rotate(45%2021.8125%20-2.52539)'%20fill='%236B90C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M31.3947%2013.0355C31.4679%2013.1085%2031.526%2013.1952%2031.5656%2013.2907C31.6052%2013.3861%2031.6256%2013.4885%2031.6256%2013.5918C31.6256%2013.6952%2031.6052%2013.7975%2031.5656%2013.8929C31.526%2013.9884%2031.4679%2014.0751%2031.3947%2014.1481L14.109%2031.4338C13.9615%2031.5813%2013.7614%2031.6642%2013.5527%2031.6642C13.3441%2031.6642%2013.144%2031.5813%2012.9965%2031.4338C12.8489%2031.2863%2012.766%2031.0862%2012.766%2030.8775C12.766%2030.6689%2012.8489%2030.4688%2012.9965%2030.3212L30.2822%2013.0355C30.3552%2012.9623%2030.4419%2012.9043%2030.5373%2012.8647C30.6328%2012.8251%2030.7351%2012.8047%2030.8385%2012.8047C30.9418%2012.8047%2031.0441%2012.8251%2031.1396%2012.8647C31.2351%2012.9043%2031.3218%2012.9623%2031.3947%2013.0355Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.9965%2013.0355C12.9233%2013.1085%2012.8652%2013.1952%2012.8256%2013.2907C12.786%2013.3861%2012.7656%2013.4885%2012.7656%2013.5918C12.7656%2013.6952%2012.786%2013.7975%2012.8256%2013.8929C12.8652%2013.9884%2012.9233%2014.0751%2012.9965%2014.1481L30.2822%2031.4338C30.4297%2031.5813%2030.6298%2031.6642%2030.8385%2031.6642C31.0471%2031.6642%2031.2472%2031.5813%2031.3947%2031.4338C31.5423%2031.2863%2031.6252%2031.0862%2031.6252%2030.8775C31.6252%2030.6689%2031.5423%2030.4688%2031.3947%2030.3212L14.109%2013.0355C14.036%2012.9623%2013.9493%2012.9043%2013.8539%2012.8647C13.7584%2012.8251%2013.6561%2012.8047%2013.5527%2012.8047C13.4494%2012.8047%2013.3471%2012.8251%2013.2516%2012.8647C13.1561%2012.9043%2013.0694%2012.9623%2012.9965%2013.0355Z'%20fill='white'/%3e%3c/svg%3e",E1="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20fill='white'/%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20stroke='%236B90C0'%20stroke-width='2'/%3e%3ccircle%20cx='14'%20cy='14'%20r='6'%20fill='%236B90C0'/%3e%3c/svg%3e",R1="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='21.8125'%20y='-2.52539'%20width='34.4207'%20height='34.4207'%20rx='6.09524'%20transform='rotate(45%2021.8125%20-2.52539)'%20fill='%2317A34A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M31.3947%2013.0355C31.4679%2013.1085%2031.526%2013.1952%2031.5656%2013.2907C31.6052%2013.3861%2031.6256%2013.4885%2031.6256%2013.5918C31.6256%2013.6952%2031.6052%2013.7975%2031.5656%2013.8929C31.526%2013.9884%2031.4679%2014.0751%2031.3947%2014.1481L14.109%2031.4338C13.9615%2031.5813%2013.7614%2031.6642%2013.5527%2031.6642C13.3441%2031.6642%2013.144%2031.5813%2012.9965%2031.4338C12.8489%2031.2863%2012.766%2031.0862%2012.766%2030.8775C12.766%2030.6689%2012.8489%2030.4688%2012.9965%2030.3212L30.2822%2013.0355C30.3552%2012.9623%2030.4419%2012.9043%2030.5373%2012.8647C30.6328%2012.8251%2030.7351%2012.8047%2030.8385%2012.8047C30.9418%2012.8047%2031.0441%2012.8251%2031.1396%2012.8647C31.2351%2012.9043%2031.3218%2012.9623%2031.3947%2013.0355Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.9965%2013.0355C12.9233%2013.1085%2012.8652%2013.1952%2012.8256%2013.2907C12.786%2013.3861%2012.7656%2013.4885%2012.7656%2013.5918C12.7656%2013.6952%2012.786%2013.7975%2012.8256%2013.8929C12.8652%2013.9884%2012.9233%2014.0751%2012.9965%2014.1481L30.2822%2031.4338C30.4297%2031.5813%2030.6298%2031.6642%2030.8385%2031.6642C31.0471%2031.6642%2031.2472%2031.5813%2031.3947%2031.4338C31.5423%2031.2863%2031.6252%2031.0862%2031.6252%2030.8775C31.6252%2030.6689%2031.5423%2030.4688%2031.3947%2030.3212L14.109%2013.0355C14.036%2012.9623%2013.9493%2012.9043%2013.8539%2012.8647C13.7584%2012.8251%2013.6561%2012.8047%2013.5527%2012.8047C13.4494%2012.8047%2013.3471%2012.8251%2013.2516%2012.8647C13.1561%2012.9043%2013.0694%2012.9623%2012.9965%2013.0355Z'%20fill='white'/%3e%3c/svg%3e",M1="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20fill='white'/%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20stroke='%2317A34A'%20stroke-width='2'/%3e%3ccircle%20cx='14'%20cy='14'%20r='6'%20fill='%2317A34A'/%3e%3c/svg%3e",O1="_ifStatement_xtij3_1",$1="_conditionIcon_xtij3_7",D1="_ifStatementContainer_xtij3_21",B1="_menuButton_xtij3_27",F1="_menuIcon_xtij3_52",A1="_ifdotIcon_xtij3_59",V={ifStatement:O1,conditionIcon:$1,ifStatementContainer:D1,menuButton:B1,menuIcon:F1,ifdotIcon:A1},W1=({style:e,color:n=I.NAVY})=>t.jsx("div",{style:{width:"100%",height:"2px",borderTop:Y(n),...e}}),Ve=e=>{const{enabled:n=!0,onDelete:s,onSelect:o,debuggerMode:i=!1,status:l}=e,d=u.useRef(null),{openMenu:h,closeMenu:c}=ue(),r=n&&!i,f=i&&l==="finished",m=He(l,i),j=f?R1:k1,C=f?M1:E1,y=u.useMemo(()=>[{label:"Edit",icon:t.jsx(Fe,{color:I.NAVY,size:18}),command:()=>o?.()},{label:"Delete",icon:t.jsx(le,{color:I.NAVY,size:18}),command:()=>s?.()}],[o,s]),b=g=>{g.stopPropagation(),h(d,g)},x=g=>{g.target.closest(`.${V.menuButton}`)||o?.()};return t.jsxs("div",{className:V.ifStatementContainer,children:[t.jsx(W1,{color:m,style:{position:"absolute",top:"22.5px",left:0,zIndex:1}}),t.jsx("div",{className:V.ifStatement,children:t.jsx("img",{src:j,alt:"condition",onClick:g=>x(g),className:V.conditionIcon})}),r&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:V.menuButton,onClick:b,"aria-label":"Open menu","aria-haspopup":"menu",children:t.jsx(re,{className:V.menuIcon,size:16})}),t.jsx(te,{ref:d,model:y,popup:!0,onHide:()=>c(d)})]}),t.jsx("img",{src:C,alt:"ifdot",className:V.ifdotIcon})]})},Me=34.5,H1=33,J=I.NAVY,ze=e=>{const{items:n,pathId:s,onAddStep:o,onAddTrigger:i,onAddCondition:l,onAddLoop:d,onDeleteStep:h,onUpdateFilter:c,onSelectStep:r,onResize:f,onCheckScenario:m,iteratorEnabled:j,conditionsEnabled:C}=e,y=u.useRef(null),b=u.useRef([]),[x,g]=u.useState([]);u.useEffect(()=>{const p=()=>{const _=y.current;if(!_||n.length===0){g([]);return}const N=[],R=Number.parseFloat(getComputedStyle(_).zoom||"1");for(let O=0;O<n.length;O++){const w=b.current[O];if(w)if(w.offsetParent==null){const T=_.getBoundingClientRect(),S=w.getBoundingClientRect();N.push((S.top-T.top)/R+Me)}else N.push(w.offsetTop-H1+Me)}N.length===n.length&&g(N)};p();const a=new ResizeObserver(p),v=y.current;return v&&a.observe(v),window.addEventListener("resize",p),()=>{a.disconnect(),window.removeEventListener("resize",p)}},[n]);const k=u.useMemo(()=>x.length!==n.length||n.length<=1?null:n.map((p,a)=>a).filter(p=>p>0).map(p=>{const a=x[p];return a===void 0?null:t.jsx(xe,{width:100,height:a,strokeColor:J},p)}),[n,x]);return t.jsxs("div",{className:F.row,children:[t.jsx(Ve,{onDelete:()=>s!=null&&h?.(s),enabled:C,onSelect:s!=null&&r?()=>r(s):void 0}),t.jsxs("div",{ref:y,className:F.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100px",height:"2px",borderTop:`2px solid ${J}`}}),k]}),t.jsx("div",{className:F.column,children:n.map((p,a)=>{let v;if(p.paths)v=t.jsx(ze,{items:p.paths,pathId:s,onAddStep:o,onAddTrigger:i,onAddCondition:l,onAddLoop:d,onDeleteStep:h,onUpdateFilter:c,onSelectStep:r,onResize:f,onCheckScenario:m,iteratorEnabled:j,conditionsEnabled:C},p.localId);else if(p.steps){const _=p;v=t.jsxs("div",{className:F.stepsContainer,children:[t.jsx(pe,{expression:_.condition,status:_.status,style:{marginTop:"25px"}}),t.jsx(_e,{steps:p.steps,pathId:p.localId,iteratorEnabled:j,conditionsEnabled:C,onSelectStep:r??(()=>{}),onAddStep:o??(()=>{}),onAddTrigger:i,onAddCondition:l??(()=>{}),onAddLoop:d,onDeleteStep:h,onUpdateFilter:c,onResize:f,onCheckScenario:m},p.localId)]})}else v=t.jsx(K,{localId:p.localId,title:"title"in p?p.title:"",idx:1,icon:"icon"in p?p.icon:void 0,status:"status"in p?p.status:void 0,onSelectStep:r,onDeleteStep:h,onUpdateFilter:c,onCheckScenario:m},p.localId);return t.jsx("div",{ref:_=>{b.current[a]=_},style:{width:"100%"},children:v},p.localId)})}),t.jsxs("div",{className:F.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:.5,left:0,flex:1,width:"100%",height:"2px",borderTop:`2px solid ${J}`}}),k]}),t.jsx(U,{onAddStep:o,onAddTrigger:i,onAddCondition:l,onAddLoop:d,iteratorEnabled:j,conditionsEnabled:C,lineColor:J,stepId:s,pathId:s,index:1,style:{marginTop:"34px",height:0}}),t.jsx("div",{style:{flex:1,width:"100%",height:"2px",borderTop:`2px solid ${J}`,marginTop:"34px"}})]})},me=68,z=I.NAVY,_e=({pathId:e,steps:n,centerY:s,className:o,iteratorEnabled:i,conditionsEnabled:l,onAddStep:d,onDeleteStep:h,onUpdateFilter:c,onAddTrigger:r,onAddCondition:f,onAddLoop:m,onSelectStep:j,onResize:C,onCheckScenario:y,isDescendent:b=!0})=>{const x=s===void 0?void 0:{marginTop:Math.max(0,s-me/2)};return n.length===0?t.jsxs("div",{style:{width:"100%",marginTop:"20px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...x},children:[t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:`2px solid ${z}`}}),t.jsx(U,{onAddStep:()=>{d?.(void 0,e)},onAddTrigger:r,onAddCondition:f,onAddLoop:m,iteratorEnabled:i,conditionsEnabled:l,lineColor:z,stepId:e,index:0,style:{height:"auto",marginTop:"0"}}),t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:`2px solid ${z}`}})]}):t.jsx("div",{className:q.steps+(o?" "+o:""),style:x,children:t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",alignItems:"flex-start"},children:[t.jsx(U,{onAddStep:()=>{d?.(n[0].localId,e,"prepend")},onAddTrigger:r,onAddCondition:f,onAddLoop:m,iteratorEnabled:i,conditionsEnabled:l,lineColor:z,stepId:n[0].localId,pathId:e,index:0,style:{marginTop:"20px"}}),n.map((g,k)=>{const p=!!g.paths,a="condition"in g&&typeof g.condition=="string";let v;return p&&g.paths?v=t.jsx(ze,{items:g.paths,pathId:g.localId,iteratorEnabled:i,conditionsEnabled:l,onAddStep:d,onAddCondition:f,onAddLoop:m,onDeleteStep:h,onAddTrigger:r,onSelectStep:j,onUpdateFilter:c,onResize:C,onCheckScenario:y},g.title):a?v=t.jsxs(t.Fragment,{children:[t.jsx(Ge,{value:g,iteratorEnabled:i,conditionsEnabled:l,onAddStep:d,onAddTrigger:r,onAddCondition:f,onAddLoop:m,onDeleteStep:h,onUpdateFilter:c,onSelectStep:j,onResize:C,onCheckScenario:y},g.localId),t.jsx(U,{onAddStep:d,onAddTrigger:r,onAddCondition:f,onAddLoop:m,iteratorEnabled:i,conditionsEnabled:l,lineColor:z,stepId:g.localId,pathId:e,index:k+1,style:{marginTop:"34px",height:0}})]}):v=t.jsxs(t.Fragment,{children:[t.jsx(K,{localId:g.localId,title:g.title,idx:1,icon:g.icon,isSet:g.isSet,isInvalid:g.isInvalid,isFilter:g.isFilter,status:g.status,onSelectStep:j,onDeleteStep:h,onUpdateFilter:c,onCheckScenario:y},g.title),t.jsx(U,{onAddStep:d,onAddTrigger:r,onAddCondition:f,onAddLoop:m,iteratorEnabled:i,conditionsEnabled:l,lineColor:z,stepId:g.localId,pathId:e,index:k+1})]}),t.jsx("div",{className:q.stepContainer+(p||a?" "+q.stepContainerWithPaths:""),children:v},g.localId)}),b&&t.jsx("div",{style:{flexGrow:1,minWidth:0,borderTop:`2px solid ${z}`,marginTop:"33.5px"}})]})})},Ye=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M17.3006 10.5H23.1986C23.2699 10.5001 23.3397 10.5204 23.3998 10.5586C23.4599 10.5969 23.5079 10.6515 23.5381 10.716C23.5683 10.7805 23.5795 10.8523 23.5704 10.923C23.5613 10.9937 23.5322 11.0603 23.4866 11.115L20.5376 14.655C20.5024 14.6972 20.4584 14.7312 20.4086 14.7545C20.3589 14.7778 20.3046 14.7899 20.2496 14.7899C20.1947 14.7899 20.1404 14.7778 20.0906 14.7545C20.0409 14.7312 19.9968 14.6972 19.9616 14.655L17.0126 11.115C16.967 11.0603 16.938 10.9937 16.9289 10.923C16.9197 10.8523 16.931 10.7805 16.9612 10.716C16.9914 10.6515 17.0394 10.5969 17.0995 10.5586C17.1596 10.5204 17.2294 10.5001 17.3006 10.5ZM0.800641 13.5H6.69864C6.7699 13.5 6.83967 13.4797 6.89979 13.4414C6.95991 13.4032 7.00789 13.3486 7.03811 13.2841C7.06833 13.2195 7.07953 13.1477 7.07042 13.0771C7.06131 13.0064 7.03224 12.9398 6.98664 12.885L4.03764 9.34504C4.00245 9.30283 3.95841 9.26888 3.90864 9.24558C3.85887 9.22228 3.80459 9.21021 3.74964 9.21021C3.69469 9.21021 3.64041 9.22228 3.59064 9.24558C3.54087 9.26888 3.49683 9.30283 3.46164 9.34504L0.512641 12.885C0.467037 12.9398 0.437977 13.0064 0.428862 13.0771C0.419747 13.1477 0.430956 13.2195 0.461175 13.2841C0.491394 13.3486 0.539372 13.4032 0.599493 13.4414C0.659613 13.4797 0.729386 13.5 0.800641 13.5Z",fill:I.TEAL}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9995 4.50011C9.67152 4.50011 7.58952 5.5606 6.21402 7.2271C6.1526 7.30671 6.0758 7.37316 5.98819 7.42249C5.90057 7.47183 5.80393 7.50304 5.70401 7.51427C5.60409 7.52551 5.50293 7.51653 5.40655 7.48789C5.31016 7.45924 5.22052 7.41151 5.14296 7.34753C5.06539 7.28354 5.00149 7.20462 4.95504 7.11544C4.90859 7.02626 4.88054 6.92865 4.87257 6.82842C4.8646 6.72819 4.87687 6.62737 4.90864 6.53198C4.94041 6.43658 4.99104 6.34854 5.05752 6.27311C6.15581 4.9434 7.61291 3.95712 9.25552 3.43159C10.8981 2.90606 12.6571 2.86338 14.3233 3.30864C15.9895 3.7539 17.4927 4.66835 18.6541 5.94324C19.8156 7.21812 20.5865 8.79978 20.875 10.5001L19.3495 10.5001C19.0032 8.80632 18.0826 7.28409 16.7433 6.19082C15.4041 5.09755 13.7284 4.50032 11.9995 4.50011ZM4.64952 13.5001C4.93349 14.887 5.60405 16.1653 6.58374 17.1873C7.56343 18.2093 8.81226 18.9332 10.186 19.2755C11.5597 19.6178 13.0022 19.5645 14.3469 19.1217C15.6915 18.6789 16.8835 17.8646 17.785 16.7731C17.8464 16.6935 17.9232 16.627 18.0109 16.5777C18.0985 16.5284 18.1951 16.4972 18.295 16.4859C18.395 16.4747 18.4961 16.4837 18.5925 16.5123C18.6889 16.541 18.7785 16.5887 18.8561 16.6527C18.9337 16.7167 18.9976 16.7956 19.044 16.8848C19.0905 16.974 19.1185 17.0716 19.1265 17.1718C19.1344 17.272 19.1222 17.3728 19.0904 17.4682C19.0586 17.5636 19.008 17.6517 18.9415 17.7271C17.8432 19.0568 16.3861 20.0431 14.7435 20.5686C13.1009 21.0942 11.3419 21.1368 9.67576 20.6916C8.0096 20.2463 6.50638 19.3319 5.34491 18.057C4.18343 16.7821 3.41258 15.2004 3.12402 13.5001H4.64952Z",fill:I.TEAL})]}),V1="_container_18jhr_1",z1="_collapsed_18jhr_16",Y1="_loopNodeWrapper_18jhr_21",G1="_loopIconWrapper_18jhr_31",Z1="_loopBox_18jhr_40",U1="_dotsButton_18jhr_57",X1="_label_18jhr_77",q1="_limit_18jhr_84",K1="_expandable_18jhr_90",J1="_expandableCollapsed_18jhr_98",Q1="_connector_18jhr_105",en="_line_18jhr_113",tn="_circleDot_18jhr_121",nn="_innerDot_18jhr_136",sn="_stepsWrapper_18jhr_143",L={container:V1,collapsed:z1,loopNodeWrapper:Y1,loopIconWrapper:G1,loopBox:Z1,dotsButton:U1,label:X1,limit:q1,expandable:K1,expandableCollapsed:J1,connector:Q1,line:en,circleDot:tn,innerDot:nn,stepsWrapper:sn},Ge=({value:e,iteratorEnabled:n=!0,conditionsEnabled:s=!0,onAddStep:o,onAddTrigger:i,onAddCondition:l,onAddLoop:d,onDeleteStep:h,onUpdateFilter:c,onSelectStep:r,onResize:f,onCheckScenario:m})=>{const{localId:j,limit:C,steps:y,condition:b}=e,x=y??[],g=()=>{},[k,p]=u.useState(!1),a=u.useRef(null),{openMenu:v,closeMenu:_}=ue(),N=ce(),R=u.useMemo(()=>[{label:"Edit",icon:t.jsx(Fe,{color:I.NAVY,size:18}),command:P=>{P?.originalEvent?.stopPropagation(),r?.(j)},template:N},{label:"Remove",icon:t.jsx(le,{color:I.NAVY,size:18}),command:P=>{P?.originalEvent?.stopPropagation(),h&&h(j)},template:N}],[r,h,j,N]),O=P=>{P.stopPropagation(),v(a,P)},w=()=>{p(P=>!P),f?.()},T=L.container+(k?"":" "+L.collapsed),S=L.expandable+(k?"":" "+L.expandableCollapsed);return t.jsxs("div",{className:T,children:[t.jsxs("div",{className:L.loopNodeWrapper,children:[t.jsxs("div",{className:L.loopBox,children:[t.jsx("div",{onClick:w,className:L.loopIconWrapper,children:t.jsx(Ye,{})}),n&&t.jsx("button",{className:L.dotsButton,onClick:O,children:t.jsx(re,{size:16})}),t.jsx(te,{model:R,popup:!0,ref:a,onHide:()=>_(a)})]}),t.jsx("div",{className:L.label,children:"Loop"}),C!=null&&t.jsxs("div",{className:L.limit,children:[C,"x"]})]}),t.jsxs("div",{className:S,children:[t.jsxs("div",{className:L.connector,children:[t.jsx("div",{className:L.line}),t.jsx("div",{className:L.circleDot,children:t.jsx("div",{className:L.innerDot})}),t.jsx("div",{className:L.line})]}),t.jsx(pe,{expression:b??"",status:e.status,style:{marginTop:"25.5px"}}),t.jsx("div",{className:L.stepsWrapper,children:t.jsx(_e,{steps:x,pathId:j,iteratorEnabled:n,conditionsEnabled:s,onAddStep:o??g,onAddTrigger:i,onAddCondition:l??g,onAddLoop:d,onDeleteStep:h,onUpdateFilter:c??g,onSelectStep:r??g,onCheckScenario:m??g,isDescendent:!0})})]})]})},on="_container_kielx_1",Ze={container:on},rn=({process:e,iteratorEnabled:n=!0,conditionsEnabled:s=!0,addMultipleTriggers:o,onAddStep:i,onAddTrigger:l,onAddCondition:d,onAddLoop:h,onResize:c,onDeleteTrigger:r,onDeleteStep:f,onUpdateFilter:m,onSelectStep:j,onCheckScenario:C})=>{const[y,b]=u.useState(0);return t.jsxs("div",{className:Ze.container,children:[t.jsx(je,{steps:e.triggers,onAddTrigger:o,onUpdateFilter:m,onDeleteTrigger:r,onSelectStep:j,onCenterYUpdate:b}),e.steps.length>0?t.jsx(_e,{steps:e.steps,centerY:y,onAddStep:i,onAddTrigger:l,onAddCondition:d,onAddLoop:h,onResize:c,onDeleteStep:f,onUpdateFilter:m,onSelectStep:j,iteratorEnabled:n,conditionsEnabled:s,isDescendent:!1,pathId:void 0,onCheckScenario:C}):t.jsx(U,{onAddStep:()=>i(),onAddTrigger:l,onAddCondition:d,onAddLoop:h,iteratorEnabled:n,conditionsEnabled:s,index:0,style:{height:me,marginTop:Math.max(0,y-me/2)}})]})},Ie=(e,n,s)=>{if(n===s)return!1;const o=r=>{if("paths"in r&&r.paths&&r.paths.length>0){const f=r.paths[r.paths.length-1];if(f.steps&&f.steps.length>0){const m=f.steps[f.steps.length-1];return o(m)}return f.localId}return"steps"in r&&r.steps&&r.steps.length>0?o(r.steps[r.steps.length-1]):r.localId},i=r=>r.steps&&r.steps.length>0?o(r.steps[r.steps.length-1]):r.paths&&r.paths.length>0?i(r.paths[r.paths.length-1]):r.localId,l=(r,f)=>"paths"in r&&r.paths&&r.paths.length>0?r.paths.some(j=>i(j)===f):o(r)===f,d=r=>{for(let f=0;f<r.length-1;f++){const m=r[f],j=r[f+1];if(m.localId===n&&j.localId===s||l(m,n)&&j.localId===s)return!0}for(const f of r){if(f.localId===n&&f.steps?.[0]?.localId===s)return!0;if("paths"in f&&f.paths){for(const m of f.paths)if(h(m))return!0}if("steps"in f&&f.steps&&d(f.steps))return!0}return!1},h=r=>{if(r.localId===n&&r.steps?.[0]?.localId===s||r.steps&&r.steps.length>0&&d(r.steps))return!0;if(r.paths){for(const f of r.paths)if(h(f))return!0}return!1},c=e.steps;return c?.[0]&&c[0].localId===n&&c[0].steps?.[0]?.localId===s?!0:d(c)},Ue=(e,n)=>{if(e.localId===n)return e.status;if(e.steps)for(const s of e.steps){const o=we(s,n);if(o!==void 0)return o}if(e.paths)for(const s of e.paths){const o=Ue(s,n);if(o!==void 0)return o}},we=(e,n)=>{if(e.localId===n)return e.status;if(e.paths)for(const s of e.paths){const o=Ue(s,n);if(o!==void 0)return o}if(e.steps)for(const s of e.steps){const o=we(s,n);if(o!==void 0)return o}},G=(e,n)=>{for(const s of e.triggers)if(s.localId===n)return s.status;for(const s of e.steps){const o=we(s,n);if(o!==void 0)return o}},ln=(e,n)=>{const s=i=>{if(i.localId===n)return!0;if(i.steps){for(const l of i.steps)if(o(l))return!0}if(i.paths){for(const l of i.paths)if(s(l))return!0}return!1},o=i=>{if(i.paths){for(const l of i.paths)if(s(l))return!0}if(i.steps){for(const l of i.steps)if(o(l))return!0}return!1};for(const i of e.triggers)if(o(i))return!0;for(const i of e.steps)if(o(i))return!0;return!1},ye=(e,n,s)=>{if(n===s)return!1;const o=G(e,n),i=G(e,s);return o!=="finished"||i!=="finished"?!1:Ie(e,n,s)},be=(e,n,s)=>n===s||!ln(e,n)||G(e,s)!=="finished"?!1:Ie(e,n,s),X=({lineColor:e,style:n,fromLocalId:s,toLocalId:o})=>{const l=ae(e)?`${D.stepLinkLine} ${D.dashedLine}`:D.stepLinkLine;return t.jsxs("div",{className:`${D.stepLinkContainer} ${D.readOnly}`,style:{...n,"--step-link-color":e},"aria-hidden":!0,"data-connector-from":void 0,"data-connector-to":void 0,children:[t.jsx("div",{className:l}),t.jsx("div",{className:`${D.stepLinkIcon} ${D.debuggerIconCollapsed}`,"aria-hidden":!0}),t.jsx("div",{className:l})]})},Ne=e=>e.steps&&e.steps.length>0?ee(e.steps[e.steps.length-1]):e.paths&&e.paths.length>0?Ne(e.paths[e.paths.length-1]):e.localId,ee=e=>"paths"in e&&e.paths&&e.paths.length>0?Ne(e.paths[e.paths.length-1]):"steps"in e&&e.steps&&e.steps.length>0?ee(e.steps[e.steps.length-1]):e.localId,Ce=e=>"steps"in e&&e.steps&&e.steps.length>0?Ce(e.steps[e.steps.length-1]):"paths"in e&&e.paths&&e.paths.length>0?Ce(e.paths[e.paths.length-1]):e.localId,Xe=(e,n,s,o)=>{const i=n.statusLine(void 0);if(o==null)return i;const l=G(e,o);return l==null?i:l!=="finished"?n.statusLine(l):s==null?i:be(e,s,o)||ye(e,s,o)?n.statusLine("finished"):i},qe=u.createContext(null),cn=qe.Provider,Se=()=>{const e=u.useContext(qe);if(!e)throw new Error("useProcessDebuggerContext must be used within ProcessDebuggerProvider");return e},Oe=34.5,an=33,Ke=e=>{const{items:n,pathId:s,previousLocalId:o,nextLocalId:i,onSelectStep:l,onResize:d,onCheckScenario:h}=e,{process:c,lineColors:r}=Se(),f=()=>{},m=Xe(c,r,o,i),j=u.useRef(null),C=u.useRef([]),[y,b]=u.useState([]);u.useEffect(()=>{const a=()=>{const N=j.current;if(!N||n.length===0){b([]);return}const R=[],O=Number.parseFloat(getComputedStyle(N).zoom||"1");for(let w=0;w<n.length;w++){const T=C.current[w];if(T)if(T.offsetParent==null){const S=N.getBoundingClientRect(),P=T.getBoundingClientRect();R.push((P.top-S.top)/O+Oe)}else R.push(T.offsetTop-an+Oe)}R.length===n.length&&b(R)};a();const v=new ResizeObserver(a),_=j.current;return _&&v.observe(_),window.addEventListener("resize",a),()=>{v.disconnect(),window.removeEventListener("resize",a)}},[n]);const x=u.useMemo(()=>{if(n.length)return We(n.map(a=>Q(a)))},[n]),g=u.useMemo(()=>{const a=r.statusLine(void 0);return n.length===0?a:Q(n[0])==="finished"?r.statusLine("finished"):a},[n,r]),k=u.useMemo(()=>y.length!==n.length||n.length<=1?null:n.map((a,v)=>v).filter(a=>a>0).map(a=>{const v=y[a];if(v===void 0)return null;const _=Q(n[a]),N=r.statusLine(_);return t.jsx(xe,{width:100,height:v,strokeColor:N,fromLocalId:n[a-1]?.localId,toLocalId:n[a]?.localId},a)}),[n,y,r]),p=u.useMemo(()=>{if(y.length!==n.length||n.length<=1)return null;const a=r.statusLine(void 0);return n.map((v,_)=>_).filter(v=>v>0).map(v=>{const _=y[v];if(_===void 0)return null;let N=a;if(i!=null&&G(c,i)==="finished"){const O=Ce(n[v]);ye(c,O,i)&&(N=r.statusLine("finished"))}return t.jsx(xe,{width:100,height:_,strokeColor:N,fromLocalId:o,toLocalId:i},v)})},[n,y,r,c,i,o]);return t.jsxs("div",{className:F.row,children:[t.jsx(Ve,{onDelete:()=>{},enabled:!1,debuggerMode:!0,status:x,onSelect:s!=null&&l?()=>l(s):void 0}),t.jsxs("div",{ref:j,className:F.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100px",height:"2px",borderTop:Y(g)}}),k]}),t.jsx("div",{className:F.column,children:n.map((a,v)=>{let _;if(a.paths)_=t.jsx(Ke,{items:a.paths,pathId:s,previousLocalId:a.localId,nextLocalId:i,onSelectStep:l,onResize:d,onCheckScenario:h},a.localId);else if(a.steps){const N=a,R=N.status==="finished"||i!=null&&be(c,N.localId,i)?"finished":void 0;_=t.jsxs("div",{className:F.stepsContainer,"data-local-id":void 0,children:[t.jsx(pe,{expression:N.condition,status:R,debuggerMode:!0,style:{marginTop:"25px"}}),t.jsx(Le,{steps:a.steps,pathId:a.localId,previousLocalId:N.localId,nextLocalId:i,onSelectStep:l??f,onResize:d,onCheckScenario:h},a.localId)]})}else _=t.jsx(K,{localId:a.localId,title:"title"in a?a.title:"",idx:1,icon:"icon"in a?a.icon:void 0,status:"status"in a?a.status:void 0,debuggerMode:!0,onSelectStep:l,onUpdateFilter:f,onCheckScenario:h},a.localId);return t.jsx("div",{ref:N=>{C.current[v]=N},style:{width:"100%"},"data-local-id":void 0,children:_},a.localId)})}),t.jsxs("div",{className:F.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:.5,left:0,flex:1,width:"100%",height:"2px",borderTop:Y(m)}}),p]}),t.jsx(X,{lineColor:m,fromLocalId:o,toLocalId:i,style:{marginTop:"34px",height:0}}),t.jsx("div",{style:{flex:1,width:"100%",height:"2px",borderTop:Y(m),marginTop:"34px"}})]})},dn=({value:e,previousLocalId:n,nextLocalId:s,onSelectStep:o,onResize:i,onCheckScenario:l})=>{const{process:d,lineColors:h}=Se(),{localId:c,limit:r,steps:f,condition:m}=e,j=f??[],C=()=>{},[y,b]=u.useState(!1),x=()=>{b(N=>!N),i?.()},g=L.container+(y?"":" "+L.collapsed),k=L.expandable+(y?"":" "+L.expandableCollapsed),p=j[0]?.localId,a=p!=null?G(d,p):void 0,_=n!=null&&(be(d,n,c)||G(d,n)==="finished"&&Ie(d,n,c)||ye(d,n,c))&&a==="finished"?h.statusLine("finished"):h.statusLine(void 0);return t.jsxs("div",{className:g,"data-local-id":void 0,children:[t.jsxs("div",{className:L.loopNodeWrapper,children:[t.jsx("div",{className:L.loopBox,children:t.jsx("div",{onClick:x,className:L.loopIconWrapper,children:t.jsx(Ye,{})})}),t.jsx("div",{className:L.label,children:"Loop"}),r!=null&&t.jsxs("div",{className:L.limit,children:[r,"x"]})]}),t.jsxs("div",{className:k,children:[t.jsxs("div",{className:L.connector,style:{"--iterator-connector-color":_,...ae(_)&&{"--iterator-connector-width":"3px","--iterator-connector-style":"dotted"}},children:[t.jsx("div",{className:L.line}),t.jsx("div",{className:L.circleDot,children:t.jsx("div",{className:L.innerDot})}),t.jsx("div",{className:L.line})]}),t.jsx(pe,{expression:m??"",status:e.status,debuggerMode:!0,style:{marginTop:"25.5px"}}),t.jsx("div",{className:L.stepsWrapper,children:t.jsx(Le,{steps:j,pathId:c,previousLocalId:c,nextLocalId:s,onSelectStep:o??(()=>{}),onCheckScenario:l??C,isDescendent:!0})})]})]})},ve=68,un=e=>{if(!e||e.length===0)return;const n=We(e.map(o=>Q(o))),s=e.find(o=>Q(o)===n)??e[e.length-1];return Ne(s)},Le=({pathId:e,steps:n,centerY:s,className:o,previousLocalId:i,nextLocalId:l,onSelectStep:d,onResize:h,onCheckScenario:c,isDescendent:r=!0})=>{const{process:f,lineColors:m}=Se(),j=()=>{},C=s===void 0?void 0:{marginTop:Math.max(0,s-ve/2)},y=(x,g)=>Xe(f,m,x,g),b=x=>x===n.length-1?l:n[x+1]?.localId;if(n.length===0){const x=y(i,l);return t.jsxs("div",{"data-path-id":e??"",style:{width:"100%",marginTop:"20px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...C},children:[t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:Y(x)}}),t.jsx(X,{lineColor:x,fromLocalId:i,toLocalId:l,style:{height:"auto",marginTop:"2px"}}),t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:Y(x)}})]})}return t.jsx("div",{"data-path-id":e??"",className:q.steps+(o?" "+o:""),style:C,children:t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",alignItems:"flex-start"},children:[t.jsx(X,{lineColor:y(i,n[0]?.localId),fromLocalId:i,toLocalId:n[0]?.localId,style:{marginTop:"21.5px"}}),n.map((x,g)=>{const k=!!x.paths,p="condition"in x&&typeof x.condition=="string";let a;if(k&&x.paths){const v=un(x.paths);a=t.jsx(Ke,{items:x.paths,pathId:x.localId,previousLocalId:v??x.localId,nextLocalId:b(g),onSelectStep:d,onResize:h,onCheckScenario:c},x.title)}else if(p){const v=g===0?i:ee(n[g-1]),_=ee(x);a=t.jsxs(t.Fragment,{children:[t.jsx(dn,{value:x,previousLocalId:v,nextLocalId:b(g),onSelectStep:d,onResize:h,onCheckScenario:c}),t.jsx(X,{lineColor:y(_,b(g)),fromLocalId:x.localId,toLocalId:b(g),style:{marginTop:"34px",height:0}})]})}else a=t.jsxs(t.Fragment,{children:[t.jsx(K,{localId:x.localId,title:x.title,idx:1,icon:x.icon,isSet:x.isSet,isInvalid:x.isInvalid,isFilter:x.isFilter,status:x.status,debuggerMode:!0,onSelectStep:d,onUpdateFilter:j,onCheckScenario:c},x.title),t.jsx(X,{lineColor:y(x.localId,b(g)),fromLocalId:x.localId,toLocalId:b(g)})]});return t.jsx("div",{className:q.stepContainer+(k||p?" "+q.stepContainerWithPaths:""),children:a},x.localId)}),r&&t.jsx("div",{style:{flexGrow:1,minWidth:0,borderTop:Y(y(n.length>0?ee(n[n.length-1]):void 0,l)),marginTop:"33.5px"}})]})})},pn=({centerY:e,neutralLineColor:n})=>t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",marginTop:Math.max(0,e-ve/2),height:ve,alignItems:"center"},children:[t.jsx("div",{style:{flexGrow:1,minWidth:0,height:"2px",borderTop:`2px solid ${n}`}}),t.jsx(X,{lineColor:n,style:{height:"auto"}}),t.jsx("div",{style:{flexGrow:1,minWidth:0,height:"2px",borderTop:`2px solid ${n}`}})]}),hn=({process:e,statusLineColors:n,neutralLineColor:s=I.NAVY,onResize:o,onSelectStep:i,onCheckScenario:l=()=>{}})=>{const[d,h]=u.useState(0),c=u.useMemo(()=>i1(n,s),[n,s]);return t.jsx("div",{className:Ze.container,children:t.jsxs(cn,{value:{process:e,lineColors:c},children:[t.jsx(je,{steps:e.triggers,onSelectStep:i,debuggerMode:!0,resolveCurveStrokeColor:c.statusLine,onCenterYUpdate:h}),e.steps.length>0?t.jsx(Le,{steps:e.steps,centerY:d,onResize:o,onSelectStep:i,onCheckScenario:l,isDescendent:!1,pathId:void 0}):t.jsx(pn,{centerY:d,neutralLineColor:c.statusLine(void 0)})]})})};class Je extends Error{constructor(n){super(n),this.name="AddStepError"}}const $e=e=>"condition"in e&&typeof e.condition=="string",Qe=(e,n,s,o)=>{const i=o==="prepend"?n:n+1;return[...e.slice(0,i),s,...e.slice(i)]},Te=(e,n,s,o)=>{for(let i=0;i<e.length;i++){if(e[i].localId===n)return Qe(e,i,o,s);const l=e[i],d=l.steps?.length&&Te(l.steps,n,s,o);if(d)return e.map((c,r)=>r===i?{...c,steps:d}:c);const h=l.paths?.length&&et(l.paths,n,s,o);if(h)return e.map((c,r)=>r===i?{...c,paths:h}:c)}return null},fn=(e,n,s)=>{const o=e.steps??[],i=n==="prepend"?[s,...o]:[...o,s];return{...e,steps:i}},et=(e,n,s,o)=>{for(let i=0;i<e.length;i++){const l=e[i];if(l.localId===n)return $e(l)?e.map((d,h)=>h===i?fn(l,s,o):d):Qe(e,i,o,s);if($e(l)){const d=l.steps?.length&&Te(l.steps,n,s,o);if(d)return e.map((c,r)=>r===i?{...c,steps:d}:c);const h=l.paths?.length&&et(l.paths,n,s,o);if(h)return e.map((c,r)=>r===i?{...c,paths:h}:c)}}return null},gn=(e,n,s,o)=>{const i=Te(e.steps,n,s,o);if(i)return{...e,steps:i};throw new Je(`Step or path with id "${n}" not found`)},tt=(e,n)=>({...e,...e.steps!=null&&{steps:Pe(e.steps,n)},...e.paths!=null&&{paths:e.paths.map(s=>tt(s,n))}}),Pe=(e,n)=>e.filter(s=>s.localId!==n).map(s=>({...s,...s.steps!=null&&{steps:Pe(s.steps,n)},...s.paths!=null&&{paths:s.paths.map(o=>tt(o,n))}})),xn=(e,n)=>{const s=Pe(e.steps,n);return{...e,steps:s}};exports.AddStepError=Je;exports.Iterator=Ge;exports.Menu=te;exports.MenuProvider=Ot;exports.ProcessDebuggerDiagram=hn;exports.ProcessDiagram=rn;exports.ProcessStep=K;exports.Trigger=je;exports.addStep=gn;exports.deleteStep=xn;exports.useMenuProvider=ue;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|