@emporix/process-diagram 2.0.0-alpha.1 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ProcessDiagram.d.ts +1 -1
- package/dist/components/ProcessDiagram.d.ts.map +1 -1
- package/dist/components/condition/Condition.d.ts.map +1 -1
- package/dist/components/plus-button/PlusButton.d.ts +1 -1
- package/dist/components/plus-button/PlusButton.d.ts.map +1 -1
- package/dist/components/row/Row.d.ts +1 -1
- package/dist/components/row/Row.d.ts.map +1 -1
- package/dist/components/steps/Steps.d.ts +2 -2
- package/dist/components/steps/Steps.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +10 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +540 -494
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -2
|
@@ -4,7 +4,7 @@ export interface ProcessDiagramProps {
|
|
|
4
4
|
process: Process;
|
|
5
5
|
onAddTrigger: (id?: string, pathId?: string, operation?: AddStepType) => unknown;
|
|
6
6
|
onAddStep: (id?: string, pathId?: string, operation?: AddStepOperation) => unknown;
|
|
7
|
-
onAddCondition
|
|
7
|
+
onAddCondition: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
8
8
|
onDeleteTrigger: (id: string) => unknown;
|
|
9
9
|
onDeleteStep: (id: string) => unknown;
|
|
10
10
|
onUpdateFilter: (id: string) => unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessDiagram.d.ts","sourceRoot":"","sources":["../../src/components/ProcessDiagram.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGvC,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,gCAAgC,CAAA;AAEvC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,CACZ,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,WAAW,KACpB,OAAO,CAAA;IACZ,SAAS,EAAE,CACT,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,OAAO,CAAA;IACZ,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"ProcessDiagram.d.ts","sourceRoot":"","sources":["../../src/components/ProcessDiagram.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGvC,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,gCAAgC,CAAA;AAEvC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,CACZ,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,WAAW,KACpB,OAAO,CAAA;IACZ,SAAS,EAAE,CACT,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,OAAO,CAAA;IACZ,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACxF,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACrC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACvC,mBAAmB,EAAE,MAAM,OAAO,CAAA;IAClC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;CACtC;AAED,QAAA,MAAM,cAAc,GAAI,yIAUrB,QAAQ,CAAC,mBAAmB,CAAC,4CAwC/B,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Condition.d.ts","sourceRoot":"","sources":["../../../src/components/condition/Condition.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Condition.d.ts","sourceRoot":"","sources":["../../../src/components/condition/Condition.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,SAAS,GAAI,wBAGhB,QAAQ,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,CAAC,4CAwB/D,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -3,7 +3,7 @@ export interface PlusButtonProps {
|
|
|
3
3
|
style?: React.CSSProperties;
|
|
4
4
|
onAddStep?: (id?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
5
5
|
onAddTrigger?: (id?: string, pathId?: string, operation?: AddStepType) => void;
|
|
6
|
-
onAddCondition?: (stepId
|
|
6
|
+
onAddCondition?: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
7
7
|
stepId?: string;
|
|
8
8
|
index?: number;
|
|
9
9
|
pathId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlusButton.d.ts","sourceRoot":"","sources":["../../../src/components/plus-button/PlusButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAE1C,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"PlusButton.d.ts","sourceRoot":"","sources":["../../../src/components/plus-button/PlusButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAE1C,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACzF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,QAAA,MAAM,UAAU,GAAI,4EAQjB,eAAe,4CAyDjB,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -5,7 +5,7 @@ declare const Row: ({ items, pathId, onAddStep, onAddTrigger, onAddCondition, on
|
|
|
5
5
|
pathId?: string;
|
|
6
6
|
onAddStep?: (id?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
7
7
|
onAddTrigger?: (id?: string, pathId?: string, operation?: AddStepType) => void;
|
|
8
|
-
onAddCondition
|
|
8
|
+
onAddCondition: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
9
9
|
onDeleteStep?: (id: string) => void;
|
|
10
10
|
onUpdateFilter: (id: string) => void;
|
|
11
11
|
onSelectStep: (id: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/components/row/Row.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAI7C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/components/row/Row.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAI7C,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAI1C,QAAA,MAAM,GAAG,GAAI,yGASV,QAAQ,CAAC;IACV,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,EAAE,CACd,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC,CAAC,4CAwKD,CAAA;AAED,eAAe,GAAG,CAAA"}
|
|
@@ -6,9 +6,9 @@ interface Props extends PropsWithClassName {
|
|
|
6
6
|
centerY?: number;
|
|
7
7
|
onDeleteStep?: (id: string) => void;
|
|
8
8
|
onUpdateFilter: (id: string) => void;
|
|
9
|
-
onAddStep
|
|
9
|
+
onAddStep: (id?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
10
10
|
onAddTrigger?: (id?: string, pathId?: string, operation?: AddStepType) => void;
|
|
11
|
-
onAddCondition
|
|
11
|
+
onAddCondition: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
12
12
|
onSelectStep: (id: string) => void;
|
|
13
13
|
isDescendent?: boolean;
|
|
14
14
|
pathId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/steps/Steps.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAEtF,UAAU,KAAM,SAAQ,kBAAkB;IACxC,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,SAAS,
|
|
1
|
+
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/steps/Steps.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAEtF,UAAU,KAAM,SAAQ,kBAAkB;IACxC,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,SAAS,EAAE,CACT,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACxF,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,eAAe,KAAK,CAAA;AACjC,QAAA,MAAM,KAAK,GAAI,2IAYZ,QAAQ,CAAC,KAAK,CAAC,4CAgJjB,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type TooltipProps = Readonly<{
|
|
3
|
+
content: ReactNode;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
maxWidth?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
}>;
|
|
8
|
+
declare const Tooltip: ({ content, children, maxWidth, className, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default Tooltip;
|
|
10
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,KAAK,YAAY,GAAG,QAAQ,CAAC;IAC3B,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,QAAA,MAAM,OAAO,GAAI,6CAKd,YAAY,4CAcd,CAAA;AAED,eAAe,OAAO,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"),l=require("react"),ge=require("react-dom"),Ce="_container_8wfnz_1",ve="_step_8wfnz_7",_e="_selected_8wfnz_23",je="_selectedInvalid_8wfnz_29",we="_isSet_8wfnz_35",ye="_invalid_8wfnz_39",Ie="_filterFlag_8wfnz_45",be="_title_8wfnz_73",ke="_icon_8wfnz_90",Me="_content_8wfnz_108",Pe="_dotsButton_8wfnz_114",C={container:Ce,step:ve,selected:_e,selectedInvalid:je,isSet:we,invalid:ye,filterFlag:Ie,title:be,icon:ke,content:Me,dotsButton:Pe};var ie={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},te=l.createContext&&l.createContext(ie),Ne=["attr","size","title"];function Se(e,n){if(e==null)return{};var s=Be(e,n),o,i;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(i=0;i<u.length;i++)o=u[i],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function Be(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 W(){return W=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},W.apply(this,arguments)}function ne(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 D(e){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?ne(Object(s),!0).forEach(function(o){Le(e,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ne(Object(s)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(s,o))})}return e}function Le(e,n,s){return n=Ee(n),n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}function Ee(e){var n=Te(e,"string");return typeof n=="symbol"?n:n+""}function Te(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 re(e){return e&&e.map((n,s)=>l.createElement(n.tag,D({key:s},n.attr),re(n.child)))}function O(e){return n=>l.createElement(Oe,W({attr:D({},e.attr)},n),re(e.child))}function Oe(e){var n=s=>{var{attr:o,size:i,title:u}=e,p=Se(e,Ne),c=i||s.size||"1em",r;return s.className&&(r=s.className),e.className&&(r=(r?r+" ":"")+e.className),l.createElement("svg",W({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,p,{className:r,style:D(D({color:e.color||s.color},s.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),u&&l.createElement("title",null,u),e.children)};return te!==void 0?l.createElement(te.Consumer,null,s=>n(s)):n(ie)}function $e(e){return O({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 ze(e){return O({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 G(e){return O({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 K(e){return O({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 Re="_panel_19663_1",He="_panelExiting_19663_13",Ae="_menuItem_19663_37",We="_disabled_19663_52",De="_menuItemIcon_19663_57",Fe="_menuItemText_19663_63",Ve="_overlay_19663_69",N={panel:Re,panelExiting:He,menuItem:Ae,disabled:We,menuItemIcon:De,menuItemText:Fe,overlay:Ve},Ze=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}},F=l.forwardRef(function({model:n,popup:s=!0,onHide:o,onClick:i},u){const[p,c]=l.useState(!1),[r,a]=l.useState(!1),[g,w]=l.useState({top:0,left:0}),m=l.useRef(null),d=l.useCallback(()=>{r||a(!0)},[r]),v=l.useCallback(f=>{r&&f.animationName.includes("menuOut")&&(c(!1),a(!1),o?.())},[r,o]),_=l.useCallback(f=>{w(Ze(f)),a(!1),c(!0)},[]),y=l.useCallback(f=>{p?d():_(f)},[p,d,_]);l.useImperativeHandle(u,()=>({show:_,hide:d,toggle:y}),[_,d,y]),l.useEffect(()=>{if(!p)return;const f=P=>{P.key==="Escape"&&d()},j=P=>{const h=m.current;h&&!h.contains(P.target)&&d()};return document.addEventListener("keydown",f),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",f),document.removeEventListener("mousedown",j)}},[p,d]);const M=(f,j)=>{j.stopPropagation(),f.command?.({originalEvent:j,item:f}),d()},I=(f,j)=>{const P=h=>M(f,h);return f.template?t.jsx(l.Fragment,{children:f.template(f,{onClick:P})},j):t.jsxs("button",{type:"button",className:`${N.menuItem} ${f.disabled&&N.disabled}`,onClick:h=>{f.disabled||P(h)},children:[f.icon&&t.jsx("span",{className:N.menuItemIcon,children:f.icon}),t.jsx("span",{className:N.menuItemText,children:f.label})]},j)};return!p||!s?null:ge.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:N.overlay,"aria-hidden":!0,onClick:()=>d(),onMouseDown:f=>f.stopPropagation()}),t.jsx("div",{ref:m,className:`${N.panel} ${r?N.panelExiting:""}`,role:"menu",style:{top:g.top,left:g.left},onAnimationEnd:v,onClick:f=>{f.stopPropagation(),i?.(f)},children:n.map(I)})]}),document.body)}),le=()=>(e,n)=>t.jsxs("button",{className:N.menuItem,onClick:s=>n.onClick(s),children:[t.jsx("span",{className:N.menuItemIcon,children:e.icon}),t.jsx("span",{className:N.menuItemText,children:e.label})]}),Ye=({width:e=16,height:n=16,color:s="#3B64A0"})=>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"})]}),se=({width:e=16,height:n=16,color:s="#3B64A0"})=>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})]}),ce=l.createContext(void 0),Xe=({children:e})=>{const[n,s]=l.useState([]),o=l.useCallback((p,c)=>{s(r=>(r.forEach(a=>{a.current&&a!==p&&a.current.hide(c)}),[])),p.current?.toggle(c),s([p])},[]),i=l.useCallback(p=>{s(c=>c.filter(r=>r!==p))},[]),u=l.useMemo(()=>({openMenus:n,openMenu:o,closeMenu:i}),[n,o,i]);return t.jsx(ce.Provider,{value:u,children:e})},J=()=>{const e=l.useContext(ce);if(e===void 0)throw new Error("useMenuProvider must be used within a MenuProvider");return e},Ge=({color:e="#E32012"})=>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"})})})]}),V=e=>{const{isSet:n,isSelected:s,isFilter:o,className:i,title:u,icon:p,contextMenuItems:c=void 0,onDeleteStep:r,onUpdateFilter:a,onSelectStep:g,subtitle:w,isInvalid:m,localId:d}=e,v=l.useRef(null),{openMenu:_,closeMenu:y}=J(),M=le(),I=l.useMemo(()=>[{label:"Add Step Filter",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(se,{})}),command:x=>{x?.originalEvent?.stopPropagation(),a&&a(d)},template:M},{label:"Remove",icon:t.jsx(K,{color:"#3B64A0",size:18}),command:x=>{x?.originalEvent?.stopPropagation(),r&&r(d)},template:M}],[a,r,d,M]),f=l.useMemo(()=>c!==void 0?c:I,[c,I]),j=x=>{x.stopPropagation(),_(v,x)},P=l.useMemo(()=>s&&m?C.step+" "+C.selectedInvalid:s?C.step+" "+C.selected:n?C.step+" "+C.isSet:m?C.step+" "+C.invalid:C.step,[n,s,m]),h=l.useMemo(()=>m?t.jsx(Ge,{color:"#E32012"}):p,[p,m]);return t.jsx("div",{className:C.container+" "+i,children:t.jsxs("div",{children:[t.jsxs("div",{className:P,onClick:()=>g(d),children:[t.jsxs("div",{className:C.content,children:[t.jsx("div",{className:`${C.icon} ${m&&C.invalid}`,children:h}),t.jsx("div",{className:C.title,children:u})]}),t.jsx("button",{className:C.dotsButton,onClick:j,"aria-haspopup":!0,"aria-label":"Step options",children:t.jsx(G,{className:C.dots,color:m?"#E32012":"#3B64A0"})}),t.jsx(F,{model:f,popup:!0,ref:v,onClick:x=>x.stopPropagation(),onHide:()=>y(v)})]}),o&&t.jsxs("div",{className:C.filterFlag,role:"button",tabIndex:0,onClick:()=>{a&&a(d)},onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&a&&(x.preventDefault(),a(d))},children:[t.jsx(se,{color:"#3B64A0"}),t.jsx("span",{children:"Filter"}),t.jsx(G,{className:C.dots,color:m?"#E32012":"#3B64A0",style:{height:"10px"}})]}),w&&t.jsx("div",{className:C.subtitle,children:w})]})})},qe=()=>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:"#0C971F"}),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:"#14BC2B",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"})})})]}),Ke="_multipleTriggersIcon_oxhdi_1",Je={multipleTriggersIcon:Ke},Qe=()=>t.jsx("div",{className:Je.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"})})}),Ue="_trigger_kfg1y_1",et="_title_kfg1y_7",tt="_empty_kfg1y_15",nt="_triggerContainer_kfg1y_21",st="_stepsContainer_kfg1y_25",ot="_stepItem_kfg1y_51",it="_curvesSvg_kfg1y_70",rt="_centralNode_kfg1y_78",lt="_iconWrapper_kfg1y_104",ct="_fadeIn_kfg1y_127",at="_fadeOut_kfg1y_130",dt="_operationContainer_kfg1y_134",b={trigger:Ue,title:et,empty:tt,triggerContainer:nt,stepsContainer:st,stepItem:ot,curvesSvg:it,centralNode:rt,iconWrapper:lt,fadeIn:ct,fadeOut:at,operationContainer:dt},ut=()=>t.jsx("div",{style:{height:"1px",marginLeft:"4px",marginRight:"4px",borderTop:"1px solid #a1bbdc"}}),pt=80,R=34,ae=({steps:e,title:n,className:s,onDeleteTrigger:o,onAddTrigger:i,onSelectStep:u,onUpdateFilter:p,onCenterYUpdate:c})=>{const r=l.useRef(null),a=l.useRef([]),[g,w]=l.useState([]),[m,d]=l.useState({width:0,height:0}),[v,_]=l.useState(!1),[y,M]=l.useState(!1),I=l.useRef(null);l.useEffect(()=>{const h=()=>{if(!r.current)return;const x=[];if(a.current.forEach((k,S)=>{if(k&&r.current){const B=r.current.getBoundingClientRect(),L=k.getBoundingClientRect();x.push({localId:e[S]?.localId??`step-${S}`,top:L.top-B.top,right:L.right-B.left,centerY:L.top-B.top+L.height/2})}}),w(x),r.current&&x.length>0){const k=r.current.getBoundingClientRect(),S=Math.min(...x.map(E=>E.top)),B=a.current.filter(Boolean).map(E=>E?.offsetHeight||68),L=Math.max(...x.map((E,xe)=>E.top+(B[xe]||68))),Z=Math.max(...x.map(E=>E.right))+0,Y=Math.max(k.height,L-S+100);d({width:Z,height:Y})}};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[e]),l.useEffect(()=>{let h=!0;if(v){I.current&&(clearTimeout(I.current),I.current=null);const x=setTimeout(()=>{h&&M(!0)},0);return()=>{h=!1,clearTimeout(x)}}return I.current=setTimeout(()=>{h&&M(!1)},140),()=>{h=!1,I.current&&(clearTimeout(I.current),I.current=null)}},[v]);const f=g.length>0?pt:0,j=l.useMemo(()=>g.length>1?g.reduce((h,x)=>h+x.top+R,0)/g.length:g.length===1?g[0].top+R:0,[g]);if(l.useEffect(()=>{c?.(j)},[j,c]),e.length===0)return t.jsxs("div",{className:`${b.trigger} ${s||""}`,children:[n&&t.jsx("h3",{className:b.title,children:n}),t.jsx("div",{className:b.empty,children:"No steps"})]});const P=(h,x,k,S)=>{const B=k-h,L=Math.min(B*.6,60),ee=h+L,Z=x,Y=k-L;return`M ${h} ${x} C ${ee} ${Z}, ${Y} ${S}, ${k} ${S}`};return t.jsxs("div",{className:`${b.trigger} ${s||""}`,ref:r,children:[n&&t.jsx("h3",{className:b.title,children:n}),t.jsxs("div",{className:b.triggerContainer,children:[t.jsx("div",{className:b.stepsContainer,children:e.map((h,x)=>t.jsx("div",{ref:k=>{a.current[x]=k},children:t.jsx(V,{title:h.title,className:b.stepItem,localId:h.localId,idx:x,isSet:h.isSet,isSelected:h.isSelected,isInvalid:h.isInvalid,isFilter:h.isFilter,icon:h.icon,onSelectStep:u,onUpdateFilter:p,contextMenuItems:[{label:"Delete",icon:t.jsx(K,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{o?.(h.localId)},disabled:e.length===1},{label:"",template:()=>t.jsx(ut,{})},{label:"Add More Triggers",icon:t.jsx($e,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{i?.()}}]})},h.localId))}),t.jsx("div",{style:{position:"relative"},children:g.length>1&&t.jsx("svg",{className:b.curvesSvg,width:m.width,height:m.height,children:g.map(h=>{const k=g.length===1?g[0].top+R:h.top+R,S=f,B=j;return t.jsx("path",{d:P(0,k,S,B),stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"},h.localId)})})}),g.length>1?t.jsxs("div",{style:{position:"relative",marginRight:"140px"},children:[t.jsx("div",{className:b.centralNode,style:{"--node-x":`${f}px`,"--node-y":`${j}px`},onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:y?t.jsx("div",{className:`${b.iconWrapper} ${v?b.fadeIn:b.fadeOut}`,onClick:i,children:t.jsx(qe,{})}):null}),t.jsx("div",{className:b.operationContainer,style:{"--op-x":`${f+16}px`,"--op-y":`${j}px`},children:t.jsx(Qe,{})})]}):null]})]})};function ht(e){return O({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 mt(e){return O({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 ft=()=>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:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"}),t.jsx("path",{d:"M12 6V18",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"})]}),xt="_stepLinkIcon_18iyj_1",gt="_stepLinkLine_18iyj_15",Ct="_stepLinkContainer_18iyj_39",H={stepLinkIcon:xt,stepLinkLine:gt,stepLinkContainer:Ct},A=({onAddStep:e,onAddTrigger:n,onAddCondition:s,stepId:o,index:i=0,style:u,pathId:p})=>{const c=le(),r=l.useRef(null),a=[...i>0?[{label:"Trigger",icon:t.jsx(mt,{color:"#3B64A0",size:18}),command:()=>{n?.(o,p,"trigger")},template:c}]:[],{label:"Step",icon:t.jsx(ht,{color:"#3B64A0",size:18}),command:()=>e?.(o,p,"append"),template:c},...o!=null?[{label:"Condition",icon:t.jsx(Ye,{width:18,height:18}),command:()=>s?.(o),template:c}]:[]],g=w=>{r.current?.show(w)};return t.jsxs("div",{className:H.stepLinkContainer,style:{...u},"data-plus-index":i,children:[t.jsx("div",{className:H.stepLinkLine}),t.jsx("div",{className:H.stepLinkIcon,onClick:g,"aria-haspopup":!0,children:t.jsx(ft,{})}),t.jsx(F,{model:a,popup:!0,ref:r}),t.jsx("div",{className:H.stepLinkLine})]})},vt="_steps_yug55_1",_t="_stepContainer_yug55_8",jt="_stepContainerWithPaths_yug55_14",X={steps:vt,stepContainer:_t,stepContainerWithPaths:jt},wt=(e,n,s,o)=>{const i=s-e,u=Math.min(i*.66,66),p=e+u,c=n,r=s-u;return`M ${e} ${n} C ${p} ${c}, ${r} ${o}, ${s} ${o}`},yt=({width:e,height:n})=>{const p=wt(0,1,e,n);return t.jsx("div",{style:{position:"absolute"},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:p,stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"})})})},It="_column_5kuaz_1",bt="_row_5kuaz_19",kt="_stepsContainer_5kuaz_24",$={column:It,row:bt,stepsContainer:kt},Mt="_conditionContainer_1jxi6_1",Pt="_connectorLine_1jxi6_6",Nt="_condition_1jxi6_1",St="_connectorDot_1jxi6_31",z={conditionContainer:Mt,connectorLine:Pt,condition:Nt,connectorDot:St},Bt=({expression:e,style:n})=>t.jsxs("div",{className:z.conditionContainer,style:n,children:[t.jsx("div",{className:z.connectorLine}),t.jsx("div",{className:z.condition,children:e})," ",t.jsx("div",{className:z.connectorLine}),t.jsx("div",{className:z.connectorDot})]}),Lt="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",Et="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",Tt="_ifStatement_13p1p_1",Ot="_conditionIcon_13p1p_7",$t="_ifStatementContainer_13p1p_21",zt="_menuButton_13p1p_27",Rt="_menuIcon_13p1p_52",Ht="_ifdotIcon_13p1p_59",T={ifStatement:Tt,conditionIcon:Ot,ifStatementContainer:$t,menuButton:zt,menuIcon:Rt,ifdotIcon:Ht},At=({style:e})=>t.jsx("div",{style:{width:"100%",height:"2px",borderTop:"2px solid #3B64A0",...e}}),Wt=({onEdit:e,onDelete:n,onSelect:s})=>{const o=l.useRef(null),{openMenu:i,closeMenu:u}=J(),p=l.useMemo(()=>[{label:"Edit",icon:t.jsx(ze,{color:"#3B64A0",size:18}),command:()=>e?.()},{label:"Delete",icon:t.jsx(K,{color:"#3B64A0",size:18}),command:()=>n?.()}],[e,n]),c=a=>{a.stopPropagation(),i(o,a)},r=a=>{a.target.closest(`.${T.menuButton}`)||s?.()};return t.jsxs("div",{className:T.ifStatementContainer,children:[t.jsx(At,{style:{position:"absolute",top:"22.5px",left:0,zIndex:1}}),t.jsx("div",{className:T.ifStatement,children:t.jsx("img",{src:Lt,alt:"condition",onClick:a=>r(a),className:T.conditionIcon})}),t.jsx("button",{type:"button",className:T.menuButton,onClick:c,"aria-label":"Open menu","aria-haspopup":"menu",children:t.jsx(G,{className:T.menuIcon})}),t.jsx(F,{ref:o,model:p,popup:!0,onHide:()=>u(o)}),t.jsx("img",{src:Et,alt:"ifdot",className:T.ifdotIcon})]})},Dt=34.5,de=({items:e,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:u,onUpdateFilter:p,onSelectStep:c})=>{const r=l.useRef(null),a=l.useRef([]),[g,w]=l.useState([]);l.useEffect(()=>{const d=()=>{if(!r.current||e.length===0){w([]);return}const v=r.current.getBoundingClientRect(),_=[];for(let y=0;y<e.length;y++){const M=a.current[y];if(M){const I=M.getBoundingClientRect();_.push(I.top-v.top+Dt)}}_.length===e.length&&w(_)};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[e]);const m=l.useMemo(()=>g.length!==e.length||e.length<=1?null:e.map((d,v)=>v).filter(d=>d>0).map(d=>{const v=g[d];return v===void 0?null:t.jsx(yt,{width:100,height:v},d)}),[e,g]);return t.jsxs("div",{className:$.row,children:[t.jsx(Wt,{onDelete:()=>n!=null&&u?.(n),onSelect:n!=null&&c?()=>c(n):void 0}),t.jsxs("div",{ref:r,className:$.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100px",height:"2px",borderTop:"2px solid #3B64A0"}}),m]}),t.jsx("div",{className:$.column,children:e.map((d,v)=>{let _;if(d.paths)_=t.jsx(de,{items:d.paths,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:u,onUpdateFilter:p,onSelectStep:c},d.localId);else if(d.steps){const y=d;_=t.jsxs("div",{className:$.stepsContainer,children:[t.jsx(Bt,{expression:y.condition,style:{marginTop:"25px"}}),t.jsx(ue,{steps:d.steps,pathId:d.localId,onSelectStep:c??(()=>{}),onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:u,onUpdateFilter:p},d.localId)]})}else _=t.jsx(V,{localId:d.localId,title:"title"in d?d.title:"",idx:1,icon:"icon"in d?d.icon:void 0,onSelectStep:c,onDeleteStep:u,onUpdateFilter:p},d.localId);return t.jsx("div",{ref:y=>{a.current[v]=y},style:{width:"100%"},children:_},d.localId)})}),t.jsxs("div",{className:$.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:.5,left:0,flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0"}}),m]}),t.jsx("div",{style:{flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0",marginTop:"34px"}})]})},q=68,ue=({pathId:e,steps:n,centerY:s,className:o,onAddStep:i,onDeleteStep:u,onUpdateFilter:p,onAddTrigger:c,onAddCondition:r,onSelectStep:a,isDescendent:g=!0})=>{const w=s===void 0?void 0:{marginTop:Math.max(0,s-q/2)};return n.length===0?t.jsxs("div",{style:{width:"100%",marginTop:"20px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...w},children:[t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}}),t.jsx(A,{onAddStep:()=>{i?.(void 0,e)},onAddTrigger:c,index:0,style:{height:"auto"}}),t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}})]}):t.jsx("div",{className:X.steps+(o?" "+o:""),style:w,children:t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",alignItems:"flex-start"},children:[t.jsx(A,{onAddStep:()=>{i?.(n[0].localId,e,"prepend")},onAddTrigger:c,onAddCondition:r,stepId:n[0].localId,pathId:e,index:0,style:{marginTop:"20px"}}),n.map((m,d)=>t.jsx("div",{className:X.stepContainer+(m.paths?" "+X.stepContainerWithPaths:""),children:m.paths?t.jsx(de,{items:m.paths,pathId:m.localId,onAddStep:i,onAddCondition:r,onDeleteStep:u,onAddTrigger:c,onSelectStep:a,onUpdateFilter:p},m.title):t.jsxs(t.Fragment,{children:[t.jsx(V,{localId:m.localId,title:m.title,idx:1,icon:m.icon,isSet:m.isSet,isInvalid:m.isInvalid,isFilter:m.isFilter,onSelectStep:a,onDeleteStep:u,onUpdateFilter:p},m.title),t.jsx(A,{onAddStep:i,onAddTrigger:c,onAddCondition:r,stepId:m.localId,pathId:e,index:d+1})]})},m.localId)),g&&t.jsx("div",{style:{flexGrow:1,minWidth:0,borderTop:"2px solid #3B64A0",marginTop:"33.5px"}})]})})},Ft="_container_12c1g_1",Vt={container:Ft},Zt=({process:e,addMultipleTriggers:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteTrigger:u,onDeleteStep:p,onUpdateFilter:c,onSelectStep:r})=>{const[a,g]=l.useState(0);return t.jsxs("div",{className:Vt.container,children:[t.jsx(ae,{steps:e.triggers,onAddTrigger:n,onUpdateFilter:c,onDeleteTrigger:u,onSelectStep:r,onCenterYUpdate:g}),e.steps.length>0?t.jsx(ue,{steps:e.steps,centerY:a,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:p,onUpdateFilter:c,onSelectStep:r,isDescendent:!1,pathId:void 0}):t.jsx(A,{onAddStep:()=>s(),onAddTrigger:o,index:0,style:{height:q,marginTop:Math.max(0,a-q/2)}})]})};class pe extends Error{constructor(n){super(n),this.name="AddStepError"}}const oe=e=>"condition"in e&&typeof e.condition=="string",he=(e,n,s,o)=>{const i=o==="prepend"?n:n+1;return[...e.slice(0,i),s,...e.slice(i)]},Q=(e,n,s,o)=>{for(let i=0;i<e.length;i++){if(e[i].localId===n)return he(e,i,o,s);const u=e[i],p=u.steps?.length&&Q(u.steps,n,s,o);if(p)return e.map((r,a)=>a===i?{...r,steps:p}:r);const c=u.paths?.length&&me(u.paths,n,s,o);if(c)return e.map((r,a)=>a===i?{...r,paths:c}:r)}return null},Yt=(e,n,s)=>{const o=e.steps??[],i=n==="prepend"?[s,...o]:[...o,s];return{...e,steps:i}},me=(e,n,s,o)=>{for(let i=0;i<e.length;i++){const u=e[i];if(u.localId===n)return oe(u)?e.map((p,c)=>c===i?Yt(u,s,o):p):he(e,i,o,s);if(oe(u)){const p=u.steps?.length&&Q(u.steps,n,s,o);if(p)return e.map((r,a)=>a===i?{...r,steps:p}:r);const c=u.paths?.length&&me(u.paths,n,s,o);if(c)return e.map((r,a)=>a===i?{...r,paths:c}:r)}}return null},Xt=(e,n,s,o)=>{const i=Q(e.steps,n,s,o);if(i)return{...e,steps:i};throw new pe(`Step or path with id "${n}" not found`)},fe=(e,n)=>({...e,...e.steps!=null&&{steps:U(e.steps,n)},...e.paths!=null&&{paths:e.paths.map(s=>fe(s,n))}}),U=(e,n)=>e.filter(s=>s.localId!==n).map(s=>({...s,...s.steps!=null&&{steps:U(s.steps,n)},...s.paths!=null&&{paths:s.paths.map(o=>fe(o,n))}})),Gt=(e,n)=>{const s=U(e.steps,n);return{...e,steps:s}};exports.AddStepError=pe;exports.Menu=F;exports.MenuProvider=Xe;exports.ProcessDiagram=Zt;exports.ProcessStep=V;exports.Trigger=ae;exports.addStep=Xt;exports.deleteStep=Gt;exports.useMenuProvider=J;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),Ce=require("react-dom"),ve="_container_8wfnz_1",_e="_step_8wfnz_7",je="_selected_8wfnz_23",we="_selectedInvalid_8wfnz_29",ye="_isSet_8wfnz_35",Ie="_invalid_8wfnz_39",be="_filterFlag_8wfnz_45",ke="_title_8wfnz_73",Ne="_icon_8wfnz_90",Me="_content_8wfnz_108",Pe="_dotsButton_8wfnz_114",C={container:ve,step:_e,selected:je,selectedInvalid:we,isSet:ye,invalid:Ie,filterFlag:be,title:ke,icon:Ne,content:Me,dotsButton:Pe};var re={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},te=l.createContext&&l.createContext(re),Se=["attr","size","title"];function Be(e,n){if(e==null)return{};var s=Le(e,n),o,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)o=a[i],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function Le(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 A(){return A=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},A.apply(this,arguments)}function ne(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 D(e){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?ne(Object(s),!0).forEach(function(o){Ee(e,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ne(Object(s)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(s,o))})}return e}function Ee(e,n,s){return n=Te(n),n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}function Te(e){var n=$e(e,"string");return typeof n=="symbol"?n:n+""}function $e(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 le(e){return e&&e.map((n,s)=>l.createElement(n.tag,D({key:s},n.attr),le(n.child)))}function O(e){return n=>l.createElement(Oe,A({attr:D({},e.attr)},n),le(e.child))}function Oe(e){var n=s=>{var{attr:o,size:i,title:a}=e,c=Be(e,Se),d=i||s.size||"1em",r;return s.className&&(r=s.className),e.className&&(r=(r?r+" ":"")+e.className),l.createElement("svg",A({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,c,{className:r,style:D(D({color:e.color||s.color},s.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),a&&l.createElement("title",null,a),e.children)};return te!==void 0?l.createElement(te.Consumer,null,s=>n(s)):n(re)}function ze(e){return O({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 Re(e){return O({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 G(e){return O({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 K(e){return O({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 He="_panel_19663_1",We="_panelExiting_19663_13",Ae="_menuItem_19663_37",De="_disabled_19663_52",Fe="_menuItemIcon_19663_57",Ve="_menuItemText_19663_63",Ze="_overlay_19663_69",P={panel:He,panelExiting:We,menuItem:Ae,disabled:De,menuItemIcon:Fe,menuItemText:Ve,overlay:Ze},Ye=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}},F=l.forwardRef(function({model:n,popup:s=!0,onHide:o,onClick:i},a){const[c,d]=l.useState(!1),[r,u]=l.useState(!1),[g,w]=l.useState({top:0,left:0}),m=l.useRef(null),p=l.useCallback(()=>{r||u(!0)},[r]),v=l.useCallback(f=>{r&&f.animationName.includes("menuOut")&&(d(!1),u(!1),o?.())},[r,o]),_=l.useCallback(f=>{w(Ye(f)),u(!1),d(!0)},[]),y=l.useCallback(f=>{c?p():_(f)},[c,p,_]);l.useImperativeHandle(a,()=>({show:_,hide:p,toggle:y}),[_,p,y]),l.useEffect(()=>{if(!c)return;const f=M=>{M.key==="Escape"&&p()},j=M=>{const h=m.current;h&&!h.contains(M.target)&&p()};return document.addEventListener("keydown",f),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",f),document.removeEventListener("mousedown",j)}},[c,p]);const N=(f,j)=>{j.stopPropagation(),f.command?.({originalEvent:j,item:f}),p()},I=(f,j)=>{const M=h=>N(f,h);return f.template?t.jsx(l.Fragment,{children:f.template(f,{onClick:M})},j):t.jsxs("button",{type:"button",className:`${P.menuItem} ${f.disabled&&P.disabled}`,onClick:h=>{f.disabled||M(h)},children:[f.icon&&t.jsx("span",{className:P.menuItemIcon,children:f.icon}),t.jsx("span",{className:P.menuItemText,children:f.label})]},j)};return!c||!s?null:Ce.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:P.overlay,"aria-hidden":!0,onClick:()=>p(),onMouseDown:f=>f.stopPropagation()}),t.jsx("div",{ref:m,className:`${P.panel} ${r?P.panelExiting:""}`,role:"menu",style:{top:g.top,left:g.left},onAnimationEnd:v,onClick:f=>{f.stopPropagation(),i?.(f)},children:n.map(I)})]}),document.body)}),ce=()=>(e,n)=>t.jsxs("button",{className:P.menuItem,onClick:s=>n.onClick(s),children:[t.jsx("span",{className:P.menuItemIcon,children:e.icon}),t.jsx("span",{className:P.menuItemText,children:e.label})]}),Xe=({width:e=16,height:n=16,color:s="#3B64A0"})=>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"})]}),se=({width:e=16,height:n=16,color:s="#3B64A0"})=>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=l.createContext(void 0),Ge=({children:e})=>{const[n,s]=l.useState([]),o=l.useCallback((c,d)=>{s(r=>(r.forEach(u=>{u.current&&u!==c&&u.current.hide(d)}),[])),c.current?.toggle(d),s([c])},[]),i=l.useCallback(c=>{s(d=>d.filter(r=>r!==c))},[]),a=l.useMemo(()=>({openMenus:n,openMenu:o,closeMenu:i}),[n,o,i]);return t.jsx(ae.Provider,{value:a,children:e})},J=()=>{const e=l.useContext(ae);if(e===void 0)throw new Error("useMenuProvider must be used within a MenuProvider");return e},qe=({color:e="#E32012"})=>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"})})})]}),V=e=>{const{isSet:n,isSelected:s,isFilter:o,className:i,title:a,icon:c,contextMenuItems:d=void 0,onDeleteStep:r,onUpdateFilter:u,onSelectStep:g,subtitle:w,isInvalid:m,localId:p}=e,v=l.useRef(null),{openMenu:_,closeMenu:y}=J(),N=ce(),I=l.useMemo(()=>[{label:"Add Step Filter",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(se,{})}),command:x=>{x?.originalEvent?.stopPropagation(),u&&u(p)},template:N},{label:"Remove",icon:t.jsx(K,{color:"#3B64A0",size:18}),command:x=>{x?.originalEvent?.stopPropagation(),r&&r(p)},template:N}],[u,r,p,N]),f=l.useMemo(()=>d!==void 0?d:I,[d,I]),j=x=>{x.stopPropagation(),_(v,x)},M=l.useMemo(()=>s&&m?C.step+" "+C.selectedInvalid:s?C.step+" "+C.selected:n?C.step+" "+C.isSet:m?C.step+" "+C.invalid:C.step,[n,s,m]),h=l.useMemo(()=>m?t.jsx(qe,{color:"#E32012"}):c,[c,m]);return t.jsx("div",{className:C.container+" "+i,children:t.jsxs("div",{children:[t.jsxs("div",{className:M,onClick:()=>g(p),children:[t.jsxs("div",{className:C.content,children:[t.jsx("div",{className:`${C.icon} ${m&&C.invalid}`,children:h}),t.jsx("div",{className:C.title,children:a})]}),t.jsx("button",{className:C.dotsButton,onClick:j,"aria-haspopup":!0,"aria-label":"Step options",children:t.jsx(G,{className:C.dots,color:m?"#E32012":"#3B64A0"})}),t.jsx(F,{model:f,popup:!0,ref:v,onClick:x=>x.stopPropagation(),onHide:()=>y(v)})]}),o&&t.jsxs("div",{className:C.filterFlag,role:"button",tabIndex:0,onClick:()=>{u&&u(p)},onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&u&&(x.preventDefault(),u(p))},children:[t.jsx(se,{color:"#3B64A0"}),t.jsx("span",{children:"Filter"}),t.jsx(G,{className:C.dots,color:m?"#E32012":"#3B64A0",style:{height:"10px"}})]}),w&&t.jsx("div",{className:C.subtitle,children:w})]})})},Ke=()=>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:"#0C971F"}),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:"#14BC2B",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"})})})]}),Je="_multipleTriggersIcon_oxhdi_1",Qe={multipleTriggersIcon:Je},Ue=()=>t.jsx("div",{className:Qe.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"})})}),et="_trigger_kfg1y_1",tt="_title_kfg1y_7",nt="_empty_kfg1y_15",st="_triggerContainer_kfg1y_21",ot="_stepsContainer_kfg1y_25",it="_stepItem_kfg1y_51",rt="_curvesSvg_kfg1y_70",lt="_centralNode_kfg1y_78",ct="_iconWrapper_kfg1y_104",at="_fadeIn_kfg1y_127",dt="_fadeOut_kfg1y_130",ut="_operationContainer_kfg1y_134",b={trigger:et,title:tt,empty:nt,triggerContainer:st,stepsContainer:ot,stepItem:it,curvesSvg:rt,centralNode:lt,iconWrapper:ct,fadeIn:at,fadeOut:dt,operationContainer:ut},pt=()=>t.jsx("div",{style:{height:"1px",marginLeft:"4px",marginRight:"4px",borderTop:"1px solid #a1bbdc"}}),ht=80,H=34,de=({steps:e,title:n,className:s,onDeleteTrigger:o,onAddTrigger:i,onSelectStep:a,onUpdateFilter:c,onCenterYUpdate:d})=>{const r=l.useRef(null),u=l.useRef([]),[g,w]=l.useState([]),[m,p]=l.useState({width:0,height:0}),[v,_]=l.useState(!1),[y,N]=l.useState(!1),I=l.useRef(null);l.useEffect(()=>{const h=()=>{if(!r.current)return;const x=[];if(u.current.forEach((k,S)=>{if(k&&r.current){const B=r.current.getBoundingClientRect(),L=k.getBoundingClientRect();x.push({localId:e[S]?.localId??`step-${S}`,top:L.top-B.top,right:L.right-B.left,centerY:L.top-B.top+L.height/2})}}),w(x),r.current&&x.length>0){const k=r.current.getBoundingClientRect(),S=Math.min(...x.map(E=>E.top)),B=u.current.filter(Boolean).map(E=>E?.offsetHeight||68),L=Math.max(...x.map((E,ge)=>E.top+(B[ge]||68))),Z=Math.max(...x.map(E=>E.right))+0,Y=Math.max(k.height,L-S+100);p({width:Z,height:Y})}};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[e]),l.useEffect(()=>{let h=!0;if(v){I.current&&(clearTimeout(I.current),I.current=null);const x=setTimeout(()=>{h&&N(!0)},0);return()=>{h=!1,clearTimeout(x)}}return I.current=setTimeout(()=>{h&&N(!1)},140),()=>{h=!1,I.current&&(clearTimeout(I.current),I.current=null)}},[v]);const f=g.length>0?ht:0,j=l.useMemo(()=>g.length>1?g.reduce((h,x)=>h+x.top+H,0)/g.length:g.length===1?g[0].top+H:0,[g]);if(l.useEffect(()=>{d?.(j)},[j,d]),e.length===0)return t.jsxs("div",{className:`${b.trigger} ${s||""}`,children:[n&&t.jsx("h3",{className:b.title,children:n}),t.jsx("div",{className:b.empty,children:"No steps"})]});const M=(h,x,k,S)=>{const B=k-h,L=Math.min(B*.6,60),ee=h+L,Z=x,Y=k-L;return`M ${h} ${x} C ${ee} ${Z}, ${Y} ${S}, ${k} ${S}`};return t.jsxs("div",{className:`${b.trigger} ${s||""}`,ref:r,children:[n&&t.jsx("h3",{className:b.title,children:n}),t.jsxs("div",{className:b.triggerContainer,children:[t.jsx("div",{className:b.stepsContainer,children:e.map((h,x)=>t.jsx("div",{ref:k=>{u.current[x]=k},children:t.jsx(V,{title:h.title,className:b.stepItem,localId:h.localId,idx:x,isSet:h.isSet,isSelected:h.isSelected,isInvalid:h.isInvalid,isFilter:h.isFilter,icon:h.icon,onSelectStep:a,onUpdateFilter:c,contextMenuItems:[{label:"Delete",icon:t.jsx(K,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{o?.(h.localId)},disabled:e.length===1},{label:"",template:()=>t.jsx(pt,{})},{label:"Add More Triggers",icon:t.jsx(ze,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{i?.()}}]})},h.localId))}),t.jsx("div",{style:{position:"relative"},children:g.length>1&&t.jsx("svg",{className:b.curvesSvg,width:m.width,height:m.height,children:g.map(h=>{const k=g.length===1?g[0].top+H:h.top+H,S=f,B=j;return t.jsx("path",{d:M(0,k,S,B),stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"},h.localId)})})}),g.length>1?t.jsxs("div",{style:{position:"relative",marginRight:"140px"},children:[t.jsx("div",{className:b.centralNode,style:{"--node-x":`${f}px`,"--node-y":`${j}px`},onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:y?t.jsx("div",{className:`${b.iconWrapper} ${v?b.fadeIn:b.fadeOut}`,onClick:i,children:t.jsx(Ke,{})}):null}),t.jsx("div",{className:b.operationContainer,style:{"--op-x":`${f+16}px`,"--op-y":`${j}px`},children:t.jsx(Ue,{})})]}):null]})]})};function mt(e){return O({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 O({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 xt=()=>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:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"}),t.jsx("path",{d:"M12 6V18",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"})]}),gt="_stepLinkIcon_18iyj_1",Ct="_stepLinkLine_18iyj_15",vt="_stepLinkContainer_18iyj_39",W={stepLinkIcon:gt,stepLinkLine:Ct,stepLinkContainer:vt},R=({onAddStep:e,onAddTrigger:n,onAddCondition:s,stepId:o,index:i=0,style:a,pathId:c})=>{const d=ce(),r=l.useRef(null),u=[...i>0?[{label:"Trigger",icon:t.jsx(ft,{color:"#3B64A0",size:18}),command:()=>{n?.(o,c,"trigger")},template:d}]:[],{label:"Step",icon:t.jsx(mt,{color:"#3B64A0",size:18}),command:()=>e?.(o,c,"append"),template:d},...o?[{label:"Condition",icon:t.jsx(Xe,{width:18,height:18}),command:()=>s?.(o,c,"append"),template:d}]:[]],g=w=>{r.current?.show(w)};return t.jsxs("div",{className:W.stepLinkContainer,style:{...a},"data-plus-index":i,children:[t.jsx("div",{className:W.stepLinkLine}),t.jsx("div",{className:W.stepLinkIcon,onClick:g,"aria-haspopup":!0,children:t.jsx(xt,{})}),t.jsx(F,{model:u,popup:!0,ref:r}),t.jsx("div",{className:W.stepLinkLine})]})},_t="_steps_yug55_1",jt="_stepContainer_yug55_8",wt="_stepContainerWithPaths_yug55_14",X={steps:_t,stepContainer:jt,stepContainerWithPaths:wt},yt=(e,n,s,o)=>{const i=s-e,a=Math.min(i*.66,66),c=e+a,d=n,r=s-a;return`M ${e} ${n} C ${c} ${d}, ${r} ${o}, ${s} ${o}`},It=({width:e,height:n})=>{const c=yt(0,1,e,n);return t.jsx("div",{style:{position:"absolute"},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:c,stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"})})})},bt="_column_1uiy3_1",kt="_row_1uiy3_19",Nt="_stepsContainer_1uiy3_24",z={column:bt,row:kt,stepsContainer:Nt},Mt="_wrapper_1nl2d_1",Pt="_tooltip_1nl2d_5",oe={wrapper:Mt,tooltip:Pt},St=({content:e,children:n,maxWidth:s=500,className:o})=>t.jsxs("div",{className:`${oe.wrapper} ${o??""}`.trim(),style:{"--tooltip-max-width":`${s}px`},children:[n,e?t.jsx("div",{className:oe.tooltip,role:"tooltip",children:e}):null]}),Bt="_conditionContainer_lm9zg_1",Lt="_connectorLine_lm9zg_6",Et="_conditionWrapper_lm9zg_12",Tt="_condition_lm9zg_1",$t="_connectorDot_lm9zg_43",$={conditionContainer:Bt,connectorLine:Lt,conditionWrapper:Et,condition:Tt,connectorDot:$t},Ot=({expression:e,style:n})=>{const s=l.useRef(null),[o,i]=l.useState(!1);l.useLayoutEffect(()=>{const c=s.current;c&&i(c.scrollHeight>c.clientHeight)},[e]);const a=e&&o?e:"";return t.jsxs("div",{className:$.conditionContainer,style:n,children:[t.jsx("div",{className:$.connectorLine}),t.jsx(St,{content:a,className:$.conditionWrapper,children:t.jsx("div",{ref:s,className:$.condition,children:e})}),t.jsx("div",{className:$.connectorLine}),t.jsx("div",{className:$.connectorDot})]})},zt="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",Rt="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",Ht="_ifStatement_1xsn9_1",Wt="_conditionIcon_1xsn9_7",At="_ifStatementContainer_1xsn9_21",Dt="_menuButton_1xsn9_27",Ft="_menuIcon_1xsn9_52",Vt="_ifdotIcon_1xsn9_59",T={ifStatement:Ht,conditionIcon:Wt,ifStatementContainer:At,menuButton:Dt,menuIcon:Ft,ifdotIcon:Vt},Zt=({style:e})=>t.jsx("div",{style:{width:"100%",height:"2px",borderTop:"2px solid #3B64A0",...e}}),Yt=({onEdit:e,onDelete:n,onSelect:s})=>{const o=l.useRef(null),{openMenu:i,closeMenu:a}=J(),c=l.useMemo(()=>[{label:"Edit",icon:t.jsx(Re,{color:"#3B64A0",size:18}),command:()=>e?.()},{label:"Delete",icon:t.jsx(K,{color:"#3B64A0",size:18}),command:()=>n?.()}],[e,n]),d=u=>{u.stopPropagation(),i(o,u)},r=u=>{u.target.closest(`.${T.menuButton}`)||s?.()};return t.jsxs("div",{className:T.ifStatementContainer,children:[t.jsx(Zt,{style:{position:"absolute",top:"22.5px",left:0,zIndex:1}}),t.jsx("div",{className:T.ifStatement,children:t.jsx("img",{src:zt,alt:"condition",onClick:u=>r(u),className:T.conditionIcon})}),t.jsx("button",{type:"button",className:T.menuButton,onClick:d,"aria-label":"Open menu","aria-haspopup":"menu",children:t.jsx(G,{className:T.menuIcon})}),t.jsx(F,{ref:o,model:c,popup:!0,onHide:()=>a(o)}),t.jsx("img",{src:Rt,alt:"ifdot",className:T.ifdotIcon})]})},Xt=34.5,ue=({items:e,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:a,onUpdateFilter:c,onSelectStep:d})=>{const r=l.useRef(null),u=l.useRef([]),[g,w]=l.useState([]);l.useEffect(()=>{const p=()=>{if(!r.current||e.length===0){w([]);return}const v=r.current.getBoundingClientRect(),_=[];for(let y=0;y<e.length;y++){const N=u.current[y];if(N){const I=N.getBoundingClientRect();_.push(I.top-v.top+Xt)}}_.length===e.length&&w(_)};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[e]);const m=l.useMemo(()=>g.length!==e.length||e.length<=1?null:e.map((p,v)=>v).filter(p=>p>0).map(p=>{const v=g[p];return v===void 0?null:t.jsx(It,{width:100,height:v},p)}),[e,g]);return t.jsxs("div",{className:z.row,children:[t.jsx(Yt,{onDelete:()=>n!=null&&a?.(n),onSelect:n!=null&&d?()=>d(n):void 0}),t.jsxs("div",{ref:r,className:z.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100px",height:"2px",borderTop:"2px solid #3B64A0"}}),m]}),t.jsx("div",{className:z.column,children:e.map((p,v)=>{let _;if(p.paths)_=t.jsx(ue,{items:p.paths,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:a,onUpdateFilter:c,onSelectStep:d},p.localId);else if(p.steps){const y=p;_=t.jsxs("div",{className:z.stepsContainer,children:[t.jsx(Ot,{expression:y.condition,style:{marginTop:"25px"}}),t.jsx(pe,{steps:p.steps,pathId:p.localId,onSelectStep:d??(()=>{}),onAddStep:s??(()=>{}),onAddTrigger:o,onAddCondition:i??(()=>{}),onDeleteStep:a,onUpdateFilter:c},p.localId)]})}else _=t.jsx(V,{localId:p.localId,title:"title"in p?p.title:"",idx:1,icon:"icon"in p?p.icon:void 0,onSelectStep:d,onDeleteStep:a,onUpdateFilter:c},p.localId);return t.jsx("div",{ref:y=>{u.current[v]=y},style:{width:"100%"},children:_},p.localId)})}),t.jsxs("div",{className:z.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:.5,left:0,flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0"}}),m]}),t.jsx(R,{onAddStep:s,onAddTrigger:o,onAddCondition:i,stepId:n,pathId:n,index:1,style:{marginTop:"34px",height:0}}),t.jsx("div",{style:{flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0",marginTop:"34px"}})]})},q=68,pe=({pathId:e,steps:n,centerY:s,className:o,onAddStep:i,onDeleteStep:a,onUpdateFilter:c,onAddTrigger:d,onAddCondition:r,onSelectStep:u,isDescendent:g=!0})=>{const w=s===void 0?void 0:{marginTop:Math.max(0,s-q/2)};return n.length===0?t.jsxs("div",{style:{width:"100%",marginTop:"20px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...w},children:[t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}}),t.jsx(R,{onAddStep:()=>{i?.(void 0,e)},onAddTrigger:d,onAddCondition:r,stepId:e,index:0,style:{height:"auto"}}),t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}})]}):t.jsx("div",{className:X.steps+(o?" "+o:""),style:w,children:t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",alignItems:"flex-start"},children:[t.jsx(R,{onAddStep:()=>{i?.(n[0].localId,e,"prepend")},onAddTrigger:d,onAddCondition:r,stepId:n[0].localId,pathId:e,index:0,style:{marginTop:"20px"}}),n.map((m,p)=>t.jsx("div",{className:X.stepContainer+(m.paths?" "+X.stepContainerWithPaths:""),children:m.paths?t.jsx(ue,{items:m.paths,pathId:m.localId,onAddStep:i,onAddCondition:r,onDeleteStep:a,onAddTrigger:d,onSelectStep:u,onUpdateFilter:c},m.title):t.jsxs(t.Fragment,{children:[t.jsx(V,{localId:m.localId,title:m.title,idx:1,icon:m.icon,isSet:m.isSet,isInvalid:m.isInvalid,isFilter:m.isFilter,onSelectStep:u,onDeleteStep:a,onUpdateFilter:c},m.title),t.jsx(R,{onAddStep:i,onAddTrigger:d,onAddCondition:r,stepId:m.localId,pathId:e,index:p+1})]})},m.localId)),g&&t.jsx("div",{style:{flexGrow:1,minWidth:0,borderTop:"2px solid #3B64A0",marginTop:"33.5px"}})]})})},Gt="_container_kielx_1",qt={container:Gt},Kt=({process:e,addMultipleTriggers:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteTrigger:a,onDeleteStep:c,onUpdateFilter:d,onSelectStep:r})=>{const[u,g]=l.useState(0);return t.jsxs("div",{className:qt.container,children:[t.jsx(de,{steps:e.triggers,onAddTrigger:n,onUpdateFilter:d,onDeleteTrigger:a,onSelectStep:r,onCenterYUpdate:g}),e.steps.length>0?t.jsx(pe,{steps:e.steps,centerY:u,onAddStep:s,onAddTrigger:o,onAddCondition:i,onDeleteStep:c,onUpdateFilter:d,onSelectStep:r,isDescendent:!1,pathId:void 0}):t.jsx(R,{onAddStep:()=>s(),onAddTrigger:o,onAddCondition:i,index:0,style:{height:q,marginTop:Math.max(0,u-q/2)}})]})};class he extends Error{constructor(n){super(n),this.name="AddStepError"}}const ie=e=>"condition"in e&&typeof e.condition=="string",me=(e,n,s,o)=>{const i=o==="prepend"?n:n+1;return[...e.slice(0,i),s,...e.slice(i)]},Q=(e,n,s,o)=>{for(let i=0;i<e.length;i++){if(e[i].localId===n)return me(e,i,o,s);const a=e[i],c=a.steps?.length&&Q(a.steps,n,s,o);if(c)return e.map((r,u)=>u===i?{...r,steps:c}:r);const d=a.paths?.length&&fe(a.paths,n,s,o);if(d)return e.map((r,u)=>u===i?{...r,paths:d}:r)}return null},Jt=(e,n,s)=>{const o=e.steps??[],i=n==="prepend"?[s,...o]:[...o,s];return{...e,steps:i}},fe=(e,n,s,o)=>{for(let i=0;i<e.length;i++){const a=e[i];if(a.localId===n)return ie(a)?e.map((c,d)=>d===i?Jt(a,s,o):c):me(e,i,o,s);if(ie(a)){const c=a.steps?.length&&Q(a.steps,n,s,o);if(c)return e.map((r,u)=>u===i?{...r,steps:c}:r);const d=a.paths?.length&&fe(a.paths,n,s,o);if(d)return e.map((r,u)=>u===i?{...r,paths:d}:r)}}return null},Qt=(e,n,s,o)=>{const i=Q(e.steps,n,s,o);if(i)return{...e,steps:i};throw new he(`Step or path with id "${n}" not found`)},xe=(e,n)=>({...e,...e.steps!=null&&{steps:U(e.steps,n)},...e.paths!=null&&{paths:e.paths.map(s=>xe(s,n))}}),U=(e,n)=>e.filter(s=>s.localId!==n).map(s=>({...s,...s.steps!=null&&{steps:U(s.steps,n)},...s.paths!=null&&{paths:s.paths.map(o=>xe(o,n))}})),Ut=(e,n)=>{const s=U(e.steps,n);return{...e,steps:s}};exports.AddStepError=he;exports.Menu=F;exports.MenuProvider=Ge;exports.ProcessDiagram=Kt;exports.ProcessStep=V;exports.Trigger=de;exports.addStep=Qt;exports.deleteStep=Ut;exports.useMenuProvider=J;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|