@notmrabhi/flowforge 0.1.53 → 0.1.54
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/{GatewayBranchEdge-CrgczPYJ.js → GatewayBranchEdge-BWz43Sat.js} +99 -102
- package/dist/GatewayBranchEdge-BWz43Sat.js.map +1 -0
- package/dist/GatewayBranchEdge-Ukfp7i1Q.js +2 -0
- package/dist/GatewayBranchEdge-Ukfp7i1Q.js.map +1 -0
- package/dist/{templateSkeletons-f-XQQvyE.js → WorkflowExecutionHistory-B0OiFCyi.js} +804 -858
- package/dist/WorkflowExecutionHistory-B0OiFCyi.js.map +1 -0
- package/dist/{templateSkeletons-gOva2Xus.js → WorkflowExecutionHistory-BHb6-2lt.js} +2 -2
- package/dist/WorkflowExecutionHistory-BHb6-2lt.js.map +1 -0
- package/dist/buildBackendPayload-4SwOp7St.js.map +1 -1
- package/dist/buildBackendPayload-BvrjW1uM.js.map +1 -1
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.d.ts +0 -61
- package/dist/canvas.js +21 -25
- package/dist/core.d.ts +0 -24
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.js +1 -1
- package/dist/form.d.ts +0 -35
- package/dist/index-B-D9UuLO.js.map +1 -1
- package/dist/index-DUbQPmIx.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -43
- package/dist/index.js +65 -69
- package/dist/nodeRegistry.d.ts +0 -24
- package/package.json +1 -1
- package/dist/GatewayBranchEdge-CMY30xhz.js +0 -2
- package/dist/GatewayBranchEdge-CMY30xhz.js.map +0 -1
- package/dist/GatewayBranchEdge-CrgczPYJ.js.map +0 -1
- package/dist/templateSkeletons-f-XQQvyE.js.map +0 -1
- package/dist/templateSkeletons-gOva2Xus.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DUbQPmIx.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DUbQPmIx.js"),F=require("./SchemaBuilderDrawer-CIxQGffa.js");require("react/jsx-runtime");require("react");require("@mui/material");require("react-icons/md");const i=require("./nodeRegistry.cjs"),f=require("./templateRegistry.cjs"),p=require("./WorkflowExecutionHistory-BHb6-2lt.js"),S=require("./messages-O9Tw_XXR.js"),y=require("./bpmn-CcuE2X_Q.js"),s=require("./GatewayBranchEdge-Ukfp7i1Q.js"),D=require("./buildBackendPayload-BvrjW1uM.js");class N{constructor(){this.channels=new Map}register(o,t){this.channels.set(o,t)}get(o){return this.channels.get(o)}list(){return Array.from(this.channels.entries()).map(([o,t])=>({key:o,...t}))}has(o){return this.channels.has(o)}}const P=new N;function R(r){const{currentNodeId:o,nodes:t,getParents:l,getOutputSchema:a,nodePath:d,nodeLabel:c,getNodeId:u=n=>n.id}=r,g=t.find(n=>u(n)===o);if(!g)return[];const w=v(g,t,l,u),h=[];for(const n of w){const m=a(n);if(!m||m.length===0)continue;const b=d(n);h.push({label:c?c(n):b,items:m.map(k=>T(k,b))})}return h}function v(r,o,t,l){const a=new Set,d=[],c=[...t(r,o)];for(;c.length>0;){const u=c.shift(),g=l(u);a.has(g)||(a.add(g),d.push(u),c.push(...t(u,o)))}return d}function T(r,o){const t=`${o}.${r.key}`,l=r.description??(r.sample!==void 0&&r.sample!==null?String(r.sample):void 0),a={label:r.label,path:t};return l!==void 0&&(a.description=l),r.children&&r.children.length>0&&(a.children=r.children.map(d=>T(d,t))),a}exports.DynamicFormRenderer=e.DynamicFormRenderer;exports.FF=e.FF;exports.FlowForgeRegistry=e.FlowForgeRegistry;exports.FlowForm=e.FlowForm;exports.FormulaInput=e.FormulaInput;exports.InfiniteSelectField=e.InfiniteSelectField;exports.OptionsResolversProvider=e.OptionsResolversProvider;exports.TablePickerField=e.TablePickerField;exports.VariablePicker=e.VariablePicker;exports.VariablePickerProvider=e.VariablePickerProvider;exports.astHasRefs=e.astHasRefs;exports.astToTokens=e.astToTokens;exports.buildEvaluationPayload=e.buildEvaluationPayload;exports.buildFieldConfig=e.buildFieldConfig;exports.buildFormulaPath=e.buildFormulaPath;exports.buildSelectStyles=e.buildSelectStyles;exports.buildValidationSchema=e.buildValidationSchema;exports.dataSourceRegistry=e.dataSourceRegistry;exports.errorTextStyle=e.errorTextStyle;exports.extractLabel=e.extractLabel;exports.fieldRegistry=e.fieldRegistry;exports.hasFormulaTokens=e.hasFormulaTokens;exports.helperTextStyle=e.helperTextStyle;exports.inputStyle=e.inputStyle;exports.isFormula=e.isFormula;exports.parseToAST=e.parseToAST;exports.serializeAST=e.serializeAST;exports.serializeASTAsConfig=e.serializeASTAsConfig;exports.serializeConditionExpressions=e.serializeConditionExpressions;exports.stripFormulaTokens=e.stripFormulaTokens;exports.tokenize=e.tokenize;exports.unwrapFormula=e.unwrapFormula;exports.useDynamicOptions=e.useDynamicOptions;exports.useOptionsResolvers=e.useOptionsResolvers;exports.useVariablePickerContext=e.useVariablePickerContext;exports.wrapFormula=e.wrapFormula;exports.FIELD_TYPE_OPTIONS=F.FIELD_TYPE_OPTIONS;exports.SchemaBuilder=F.SchemaBuilder;exports.SchemaBuilderDrawer=F.SchemaBuilderDrawer;exports.useFlowForm=F.useFlowForm;exports.NodeTypeRegistry=i.NodeTypeRegistry;exports.baseNodeDefaults=i.baseNodeDefaults;exports.conditionBranchDescriptor=i.conditionBranchDescriptor;exports.defineNode=i.defineNode;exports.endEventDescriptor=i.endEventDescriptor;exports.makeSubWorkflowDescriptor=i.makeSubWorkflowDescriptor;exports.nodeTypeRegistry=i.nodeTypeRegistry;exports.notificationDescriptor=i.notificationDescriptor;exports.restApiDescriptor=i.restApiDescriptor;exports.startEventDescriptor=i.startEventDescriptor;exports.subWorkflowDescriptor=i.subWorkflowDescriptor;exports.webhookTriggerDescriptor=i.webhookTriggerDescriptor;exports.webhookTriggerTemplate=i.webhookTriggerTemplate;exports.TemplateRegistry=f.TemplateRegistry;exports.templateRegistry=f.templateRegistry;exports.FlowForgeCanvas=p.FlowForgeCanvas;exports.FlowForgeHeader=p.FlowForgeHeader;exports.SubWorkflowPreviewDrawer=p.SubWorkflowPreviewDrawer;exports.WorkflowCanvas=p.FlowForgeCanvas;exports.WorkflowExecutionHistory=p.WorkflowExecutionHistory;exports.WorkflowTemplateLibrary=p.WorkflowTemplateLibrary;exports.defaultFlowForgeMessages=S.defaultFlowForgeMessages;exports.loadWorkflowFromBpmn=y.loadWorkflowFromBpmn;exports.saveWorkflowToBpmn=y.saveWorkflowToBpmn;exports.ActionNode=s.ActionNode;exports.ApprovalNode=s.ApprovalNode;exports.EdgeWithPlusLabel=s.EdgeWithPlusLabel;exports.EndNode=s.EndNode;exports.FilterNode=s.FilterNode;exports.RestApiNode=s.RestApiNode;exports.StartNode=s.StartNode;exports.TriggerNode=s.TriggerNode;exports.WebhookTriggerNode=s.WebhookTriggerNode;exports.builtInNodeTypes=s.builtInNodeTypes;exports.buildBackendPayload=D.buildBackendPayload;exports.buildVariableGroups=R;exports.notificationChannelRegistry=P;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/notificationChannelRegistry/index.ts","../src/datapills/buildVariableGroups.ts"],"sourcesContent":["export interface NotificationChannelOption {\n value: string;\n label: string;\n}\n\nexport interface NotificationChannelConfig {\n label: string;\n /** Fetch recipients/channels for this notification channel at runtime */\n fetchRecipients?: () => Promise<NotificationChannelOption[]>;\n}\n\nclass NotificationChannelRegistry {\n private channels = new Map<string, NotificationChannelConfig>();\n\n register(key: string, config: NotificationChannelConfig): void {\n this.channels.set(key, config);\n }\n\n get(key: string): NotificationChannelConfig | undefined {\n return this.channels.get(key);\n }\n\n list(): Array<{ key: string } & NotificationChannelConfig> {\n return Array.from(this.channels.entries()).map(([key, cfg]) => ({ key, ...cfg }));\n }\n\n has(key: string): boolean {\n return this.channels.has(key);\n }\n}\n\nexport const notificationChannelRegistry = new NotificationChannelRegistry();\nexport default NotificationChannelRegistry;\n","/**\n * buildVariableGroups — graph walker that turns upstream nodes' outputSchemas\n * into Smart Values picker groups.\n *\n * Pattern matches Workato's datapill model: every node declares what it\n * outputs; downstream nodes see the union of upstream outputs. The package\n * doesn't know your node-id scheme, your API, or your edge model — pass\n * those in via the four predicates and we do the rest.\n *\n * Usage (IAM-side):\n *\n * const variableGroups = buildVariableGroups({\n * currentNodeId,\n * nodes, // canvas state slots\n * getParents: (node) => upstreamSlotsOf(node, edges),\n * getOutputSchema: (node) => tasksByKey[node.descriptorType]?.outputSchema ?? [],\n * nodePath: (node) => node.id === 'trigger' ? 'endUser' : `data.${index(node)}`,\n * nodeLabel: (node) => node.label,\n * });\n *\n * <FlowForm variableGroups={variableGroups} ... />\n */\n\nimport type { VariableGroup, VariableItem } from '../FlowForm/VariablePicker/VariablePickerContext';\n\nexport interface OutputSchemaItem {\n key: string;\n label: string;\n /** Optional — display only. Lets the picker show a type chip (\"ABC\" / 123). */\n type?: string;\n /** Optional — shown under/beside the label in the picker (Workato-style). */\n sample?: string | number | boolean;\n /** Optional tooltip text (independent of `sample`). */\n description?: string;\n /** Nested fields — renders as an expandable subgroup. */\n children?: OutputSchemaItem[];\n}\n\nexport interface BuildVariableGroupsOptions<TNode> {\n /** Id of the node currently being configured (its outputs are NOT included). */\n currentNodeId: string;\n /** All nodes in the canvas / workflow. */\n nodes: TNode[];\n /** Return the immediate parent node(s) — consumer walks its own edge model. */\n getParents: (node: TNode, nodes: TNode[]) => TNode[];\n /** Return the node's output schema array (empty array if none). */\n getOutputSchema: (node: TNode) => OutputSchemaItem[];\n /** Return the runtime path prefix for this node (e.g. 'endUser', 'data.1'). */\n nodePath: (node: TNode) => string;\n /** Optional — group label shown in the picker. Defaults to `nodePath(node)`. */\n nodeLabel?: (node: TNode) => string;\n /**\n * Optional — function reading a node's id. Defaults to `(n) => (n as any).id`.\n * Override if your node model nests the id (e.g. `n.data.id`).\n */\n getNodeId?: (node: TNode) => string;\n}\n\n/**\n * Walks upstream from `currentNodeId` (excluding it), collects each ancestor's\n * outputSchema, and returns a `VariableGroup[]` ready for `<FlowForm variableGroups>`.\n *\n * - Excludes the current node (a node never references its own outputs).\n * - Deduplicates ancestors via id — diamond graphs don't produce duplicate groups.\n * - Skips ancestors with empty outputSchema (no group rendered for nodes that emit nothing).\n * - Preserves traversal order — the closest parent appears first in the picker.\n */\nexport function buildVariableGroups<TNode>(\n opts: BuildVariableGroupsOptions<TNode>\n): VariableGroup[] {\n const {\n currentNodeId,\n nodes,\n getParents,\n getOutputSchema,\n nodePath,\n nodeLabel,\n getNodeId = (n: TNode) => (n as unknown as { id: string }).id,\n } = opts;\n\n const current = nodes.find((n) => getNodeId(n) === currentNodeId);\n if (!current) return [];\n\n const upstream = collectUpstream(current, nodes, getParents, getNodeId);\n\n const groups: VariableGroup[] = [];\n for (const node of upstream) {\n const schema = getOutputSchema(node);\n if (!schema || schema.length === 0) continue;\n const prefix = nodePath(node);\n groups.push({\n label: nodeLabel ? nodeLabel(node) : prefix,\n items: schema.map((item) => mapToVariableItem(item, prefix)),\n });\n }\n return groups;\n}\n\n// ─── Internals ──────────────────────────────────────────────────────────────\n\nfunction collectUpstream<TNode>(\n start: TNode,\n nodes: TNode[],\n getParents: (node: TNode, nodes: TNode[]) => TNode[],\n getNodeId: (node: TNode) => string\n): TNode[] {\n const seen = new Set<string>();\n const ordered: TNode[] = [];\n // BFS upstream — the closest parent ends up first, mirroring how Workato\n // groups the most recent step at the top of the datapill panel.\n const queue: TNode[] = [...getParents(start, nodes)];\n while (queue.length > 0) {\n const node = queue.shift() as TNode;\n const id = getNodeId(node);\n if (seen.has(id)) continue;\n seen.add(id);\n ordered.push(node);\n queue.push(...getParents(node, nodes));\n }\n return ordered;\n}\n\nfunction mapToVariableItem(\n item: OutputSchemaItem,\n prefix: string\n): VariableItem {\n const path = `${prefix}.${item.key}`;\n // Workato-style: show the sample value under the label when present.\n const description =\n item.description ??\n (item.sample !== undefined && item.sample !== null\n ? String(item.sample)\n : undefined);\n const result: VariableItem = { label: item.label, path };\n if (description !== undefined) result.description = description;\n if (item.children && item.children.length > 0) {\n result.children = item.children.map((c) => mapToVariableItem(c, path));\n }\n return result;\n}\n"],"names":["NotificationChannelRegistry","key","config","cfg","notificationChannelRegistry","buildVariableGroups","opts","currentNodeId","nodes","getParents","getOutputSchema","nodePath","nodeLabel","getNodeId","
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/notificationChannelRegistry/index.ts","../src/datapills/buildVariableGroups.ts"],"sourcesContent":["export interface NotificationChannelOption {\n value: string;\n label: string;\n}\n\nexport interface NotificationChannelConfig {\n label: string;\n /** Fetch recipients/channels for this notification channel at runtime */\n fetchRecipients?: () => Promise<NotificationChannelOption[]>;\n}\n\nclass NotificationChannelRegistry {\n private channels = new Map<string, NotificationChannelConfig>();\n\n register(key: string, config: NotificationChannelConfig): void {\n this.channels.set(key, config);\n }\n\n get(key: string): NotificationChannelConfig | undefined {\n return this.channels.get(key);\n }\n\n list(): Array<{ key: string } & NotificationChannelConfig> {\n return Array.from(this.channels.entries()).map(([key, cfg]) => ({ key, ...cfg }));\n }\n\n has(key: string): boolean {\n return this.channels.has(key);\n }\n}\n\nexport const notificationChannelRegistry = new NotificationChannelRegistry();\nexport default NotificationChannelRegistry;\n","/**\n * buildVariableGroups — graph walker that turns upstream nodes' outputSchemas\n * into Smart Values picker groups.\n *\n * Pattern matches Workato's datapill model: every node declares what it\n * outputs; downstream nodes see the union of upstream outputs. The package\n * doesn't know your node-id scheme, your API, or your edge model — pass\n * those in via the four predicates and we do the rest.\n *\n * Usage (IAM-side):\n *\n * const variableGroups = buildVariableGroups({\n * currentNodeId,\n * nodes, // canvas state slots\n * getParents: (node) => upstreamSlotsOf(node, edges),\n * getOutputSchema: (node) => tasksByKey[node.descriptorType]?.outputSchema ?? [],\n * nodePath: (node) => node.id === 'trigger' ? 'endUser' : `data.${index(node)}`,\n * nodeLabel: (node) => node.label,\n * });\n *\n * <FlowForm variableGroups={variableGroups} ... />\n */\n\nimport type { VariableGroup, VariableItem } from '../FlowForm/VariablePicker/VariablePickerContext';\n\nexport interface OutputSchemaItem {\n key: string;\n label: string;\n /** Optional — display only. Lets the picker show a type chip (\"ABC\" / 123). */\n type?: string;\n /** Optional — shown under/beside the label in the picker (Workato-style). */\n sample?: string | number | boolean;\n /** Optional tooltip text (independent of `sample`). */\n description?: string;\n /** Nested fields — renders as an expandable subgroup. */\n children?: OutputSchemaItem[];\n}\n\nexport interface BuildVariableGroupsOptions<TNode> {\n /** Id of the node currently being configured (its outputs are NOT included). */\n currentNodeId: string;\n /** All nodes in the canvas / workflow. */\n nodes: TNode[];\n /** Return the immediate parent node(s) — consumer walks its own edge model. */\n getParents: (node: TNode, nodes: TNode[]) => TNode[];\n /** Return the node's output schema array (empty array if none). */\n getOutputSchema: (node: TNode) => OutputSchemaItem[];\n /** Return the runtime path prefix for this node (e.g. 'endUser', 'data.1'). */\n nodePath: (node: TNode) => string;\n /** Optional — group label shown in the picker. Defaults to `nodePath(node)`. */\n nodeLabel?: (node: TNode) => string;\n /**\n * Optional — function reading a node's id. Defaults to `(n) => (n as any).id`.\n * Override if your node model nests the id (e.g. `n.data.id`).\n */\n getNodeId?: (node: TNode) => string;\n}\n\n/**\n * Walks upstream from `currentNodeId` (excluding it), collects each ancestor's\n * outputSchema, and returns a `VariableGroup[]` ready for `<FlowForm variableGroups>`.\n *\n * - Excludes the current node (a node never references its own outputs).\n * - Deduplicates ancestors via id — diamond graphs don't produce duplicate groups.\n * - Skips ancestors with empty outputSchema (no group rendered for nodes that emit nothing).\n * - Preserves traversal order — the closest parent appears first in the picker.\n */\nexport function buildVariableGroups<TNode>(\n opts: BuildVariableGroupsOptions<TNode>\n): VariableGroup[] {\n const {\n currentNodeId,\n nodes,\n getParents,\n getOutputSchema,\n nodePath,\n nodeLabel,\n getNodeId = (n: TNode) => (n as unknown as { id: string }).id,\n } = opts;\n\n const current = nodes.find((n) => getNodeId(n) === currentNodeId);\n if (!current) return [];\n\n const upstream = collectUpstream(current, nodes, getParents, getNodeId);\n\n const groups: VariableGroup[] = [];\n for (const node of upstream) {\n const schema = getOutputSchema(node);\n if (!schema || schema.length === 0) continue;\n const prefix = nodePath(node);\n groups.push({\n label: nodeLabel ? nodeLabel(node) : prefix,\n items: schema.map((item) => mapToVariableItem(item, prefix)),\n });\n }\n return groups;\n}\n\n// ─── Internals ──────────────────────────────────────────────────────────────\n\nfunction collectUpstream<TNode>(\n start: TNode,\n nodes: TNode[],\n getParents: (node: TNode, nodes: TNode[]) => TNode[],\n getNodeId: (node: TNode) => string\n): TNode[] {\n const seen = new Set<string>();\n const ordered: TNode[] = [];\n // BFS upstream — the closest parent ends up first, mirroring how Workato\n // groups the most recent step at the top of the datapill panel.\n const queue: TNode[] = [...getParents(start, nodes)];\n while (queue.length > 0) {\n const node = queue.shift() as TNode;\n const id = getNodeId(node);\n if (seen.has(id)) continue;\n seen.add(id);\n ordered.push(node);\n queue.push(...getParents(node, nodes));\n }\n return ordered;\n}\n\nfunction mapToVariableItem(\n item: OutputSchemaItem,\n prefix: string\n): VariableItem {\n const path = `${prefix}.${item.key}`;\n // Workato-style: show the sample value under the label when present.\n const description =\n item.description ??\n (item.sample !== undefined && item.sample !== null\n ? String(item.sample)\n : undefined);\n const result: VariableItem = { label: item.label, path };\n if (description !== undefined) result.description = description;\n if (item.children && item.children.length > 0) {\n result.children = item.children.map((c) => mapToVariableItem(c, path));\n }\n return result;\n}\n"],"names":["NotificationChannelRegistry","key","config","cfg","notificationChannelRegistry","buildVariableGroups","opts","currentNodeId","nodes","getParents","getOutputSchema","nodePath","nodeLabel","getNodeId","current","upstream","collectUpstream","groups","node","schema","prefix","item","mapToVariableItem","start","seen","ordered","queue","id","path","description","result","c"],"mappings":"qiBAWA,MAAMA,CAA4B,CAAlC,aAAA,CACE,KAAQ,aAAe,GAAuC,CAE9D,SAASC,EAAaC,EAAyC,CAC7D,KAAK,SAAS,IAAID,EAAKC,CAAM,CAC/B,CAEA,IAAID,EAAoD,CACtD,OAAO,KAAK,SAAS,IAAIA,CAAG,CAC9B,CAEA,MAA2D,CACzD,OAAO,MAAM,KAAK,KAAK,SAAS,QAAA,CAAS,EAAE,IAAI,CAAC,CAACA,EAAKE,CAAG,KAAO,CAAE,IAAAF,EAAK,GAAGE,GAAM,CAClF,CAEA,IAAIF,EAAsB,CACxB,OAAO,KAAK,SAAS,IAAIA,CAAG,CAC9B,CACF,CAEO,MAAMG,EAA8B,IAAIJ,ECoCxC,SAASK,EACdC,EACiB,CACjB,KAAM,CACJ,cAAAC,EACA,MAAAC,EACA,WAAAC,EACA,gBAAAC,EACA,SAAAC,EACA,UAAAC,EACA,UAAAC,EAAa,GAAc,EAAgC,EAAA,EACzDP,EAEEQ,EAAUN,EAAM,KAAM,GAAMK,EAAU,CAAC,IAAMN,CAAa,EAChE,GAAI,CAACO,EAAS,MAAO,CAAA,EAErB,MAAMC,EAAWC,EAAgBF,EAASN,EAAOC,EAAYI,CAAS,EAEhEI,EAA0B,CAAA,EAChC,UAAWC,KAAQH,EAAU,CAC3B,MAAMI,EAAST,EAAgBQ,CAAI,EACnC,GAAI,CAACC,GAAUA,EAAO,SAAW,EAAG,SACpC,MAAMC,EAAST,EAASO,CAAI,EAC5BD,EAAO,KAAK,CACV,MAAOL,EAAYA,EAAUM,CAAI,EAAIE,EACrC,MAAOD,EAAO,IAAKE,GAASC,EAAkBD,EAAMD,CAAM,CAAC,CAAA,CAC5D,CACH,CACA,OAAOH,CACT,CAIA,SAASD,EACPO,EACAf,EACAC,EACAI,EACS,CACT,MAAMW,MAAW,IACXC,EAAmB,CAAA,EAGnBC,EAAiB,CAAC,GAAGjB,EAAWc,EAAOf,CAAK,CAAC,EACnD,KAAOkB,EAAM,OAAS,GAAG,CACvB,MAAMR,EAAOQ,EAAM,MAAA,EACbC,EAAKd,EAAUK,CAAI,EACrBM,EAAK,IAAIG,CAAE,IACfH,EAAK,IAAIG,CAAE,EACXF,EAAQ,KAAKP,CAAI,EACjBQ,EAAM,KAAK,GAAGjB,EAAWS,EAAMV,CAAK,CAAC,EACvC,CACA,OAAOiB,CACT,CAEA,SAASH,EACPD,EACAD,EACc,CACd,MAAMQ,EAAO,GAAGR,CAAM,IAAIC,EAAK,GAAG,GAE5BQ,EACJR,EAAK,cACJA,EAAK,SAAW,QAAaA,EAAK,SAAW,KAC1C,OAAOA,EAAK,MAAM,EAClB,QACAS,EAAuB,CAAE,MAAOT,EAAK,MAAO,KAAAO,CAAA,EAClD,OAAIC,IAAgB,SAAWC,EAAO,YAAcD,GAChDR,EAAK,UAAYA,EAAK,SAAS,OAAS,IAC1CS,EAAO,SAAWT,EAAK,SAAS,IAAKU,GAAMT,EAAkBS,EAAGH,CAAI,CAAC,GAEhEE,CACT"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,8 +14,6 @@ import { StylesConfig } from 'react-select';
|
|
|
14
14
|
import { useFormik } from 'formik';
|
|
15
15
|
import * as Yup from 'yup';
|
|
16
16
|
|
|
17
|
-
export declare const accessRequestSkeleton: WorkflowState;
|
|
18
|
-
|
|
19
17
|
export declare const ActionNode: ({ id, data }: NodeProps) => JSX_2.Element;
|
|
20
18
|
|
|
21
19
|
declare interface ActiveField {
|
|
@@ -356,12 +354,6 @@ export declare interface ConditionFieldDef {
|
|
|
356
354
|
value: string;
|
|
357
355
|
label: string;
|
|
358
356
|
}>;
|
|
359
|
-
/**
|
|
360
|
-
* Declarative dynamic options — same shape as `FieldDescriptor.optionsSource`.
|
|
361
|
-
* `dependsOn` resolves against the OUTER form values (not the condition entry),
|
|
362
|
-
* so a condition column can depend on another top-level field (e.g. attributes
|
|
363
|
-
* scoped by `applicationUuid`).
|
|
364
|
-
*/
|
|
365
357
|
optionsSource?: OptionsSource;
|
|
366
358
|
/** When true, renders a FormulaInput chip editor instead of a plain <input> */
|
|
367
359
|
formula?: boolean;
|
|
@@ -1304,12 +1296,9 @@ export declare interface ObjectFieldRendererProps {
|
|
|
1304
1296
|
item?: Record<string, unknown>;
|
|
1305
1297
|
}
|
|
1306
1298
|
|
|
1307
|
-
export declare const offboardingSkeleton: WorkflowState;
|
|
1308
|
-
|
|
1309
1299
|
/** A resolver function — transport-agnostic. */
|
|
1310
1300
|
export declare type OptionsResolver = (deps: Record<string, unknown>, ctx: OptionsResolverContext) => Promise<OptionsResolverResult>;
|
|
1311
1301
|
|
|
1312
|
-
/** Args passed to a resolver per call — cursor for pagination, input for typeahead. */
|
|
1313
1302
|
export declare interface OptionsResolverContext {
|
|
1314
1303
|
cursor?: unknown;
|
|
1315
1304
|
input?: string;
|
|
@@ -1331,10 +1320,6 @@ export declare interface OptionsResolverResult {
|
|
|
1331
1320
|
nextCursor?: unknown;
|
|
1332
1321
|
}
|
|
1333
1322
|
|
|
1334
|
-
/**
|
|
1335
|
-
* Map of named resolvers — the host registers these once on the canvas / form.
|
|
1336
|
-
* Keys are the `optionsSource.id` strings referenced by field descriptors.
|
|
1337
|
-
*/
|
|
1338
1323
|
export declare type OptionsResolvers = Record<string, OptionsResolver>;
|
|
1339
1324
|
|
|
1340
1325
|
declare interface OptionsResolversContextValue {
|
|
@@ -1351,26 +1336,8 @@ export declare function OptionsResolversProvider({ resolvers, children }: Provid
|
|
|
1351
1336
|
export declare interface OptionsSource {
|
|
1352
1337
|
/** Resolver id — must match a key in the host's `optionsResolvers` map. */
|
|
1353
1338
|
id: string;
|
|
1354
|
-
/**
|
|
1355
|
-
* Other field values this resolver depends on. Two shapes accepted:
|
|
1356
|
-
* - `string[]` — pass through verbatim ({ fieldA: values.fieldA, ... })
|
|
1357
|
-
* - `Record<arg, fieldName>` — rename parent values for the resolver
|
|
1358
|
-
*
|
|
1359
|
-
* When any dep value changes, the cache key for this field invalidates
|
|
1360
|
-
* and the resolver re-fires.
|
|
1361
|
-
*/
|
|
1362
1339
|
dependsOn?: string[] | Record<string, string>;
|
|
1363
|
-
/**
|
|
1364
|
-
* Static params merged into the deps object for every call. Use for
|
|
1365
|
-
* "URL template via the generic resolver" style:
|
|
1366
|
-
* { id: 'default', params: { url: '/groups', valueKey: 'uuid' } }
|
|
1367
|
-
*/
|
|
1368
1340
|
params?: Record<string, unknown>;
|
|
1369
|
-
/**
|
|
1370
|
-
* Lookup individual options by value (edit-mode hydration). When set,
|
|
1371
|
-
* the field calls this resolver with `{ ids: [...] }` to render labels
|
|
1372
|
-
* for already-selected values that aren't in the current page.
|
|
1373
|
-
*/
|
|
1374
1341
|
resolveValueId?: string;
|
|
1375
1342
|
}
|
|
1376
1343
|
|
|
@@ -1815,8 +1782,6 @@ export declare interface UseFlowFormOptions {
|
|
|
1815
1782
|
|
|
1816
1783
|
export declare function useOptionsResolvers(): OptionsResolversContextValue;
|
|
1817
1784
|
|
|
1818
|
-
export declare const userOnboardingSkeleton: WorkflowState;
|
|
1819
|
-
|
|
1820
1785
|
export declare function useVariablePickerContext(): VariablePickerContextValue | null;
|
|
1821
1786
|
|
|
1822
1787
|
export declare interface VariableGroup {
|
|
@@ -1873,12 +1838,6 @@ export declare interface VariablePickerProps {
|
|
|
1873
1838
|
* 'popover' — absolutely positioned, shown/hidden via isOpen.
|
|
1874
1839
|
*/
|
|
1875
1840
|
mode?: 'drawer' | 'popover';
|
|
1876
|
-
/**
|
|
1877
|
-
* Render the panel via a body-level Portal and fix-position it next to
|
|
1878
|
-
* the nearest MUI Drawer (`.MuiDrawer-paper`) so it escapes clipping
|
|
1879
|
-
* parents. Only meaningful for `mode='drawer'`; popover mode already
|
|
1880
|
-
* portals itself. Default: false.
|
|
1881
|
-
*/
|
|
1882
1841
|
floating?: boolean;
|
|
1883
1842
|
}
|
|
1884
1843
|
|
|
@@ -1889,8 +1848,6 @@ declare interface VariablePickerProviderProps {
|
|
|
1889
1848
|
children: default_2.ReactNode;
|
|
1890
1849
|
}
|
|
1891
1850
|
|
|
1892
|
-
export declare const webhookIntegrationSkeleton: WorkflowState;
|
|
1893
|
-
|
|
1894
1851
|
export declare const webhookTriggerDescriptor: NodeDescriptor;
|
|
1895
1852
|
|
|
1896
1853
|
export declare const WebhookTriggerNode: ({ data }: NodeProps) => JSX_2.Element;
|
package/dist/index.js
CHANGED
|
@@ -1,117 +1,116 @@
|
|
|
1
|
-
import { D as N, F as
|
|
1
|
+
import { D as N, F as D, a as R, b as P, c as W, I as A, O as E, T as C, V as I, d as B, e as O, f as V, g as z, h as L, i as H, j as q, k as M, E as _, l as $, m as j, n as G, o as U, p as Y, q as J, r as K, s as Q, t as X, u as Z, v as ee, w as se, x as re, y as oe, z as ae, A as te, B as ie, C as ne } from "./index-B-D9UuLO.js";
|
|
2
2
|
import { F as ce, S as de, a as pe, u as ue } from "./SchemaBuilderDrawer-BP7aZgFe.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material";
|
|
6
6
|
import "react-icons/md";
|
|
7
|
-
import { NodeTypeRegistry as he, baseNodeDefaults as me, conditionBranchDescriptor as ge, defineNode as
|
|
8
|
-
import { TemplateRegistry as
|
|
9
|
-
import { F as Ae, a as Ee, S as
|
|
10
|
-
import { d as
|
|
11
|
-
import { l as
|
|
12
|
-
import { A as
|
|
13
|
-
import { b as
|
|
7
|
+
import { NodeTypeRegistry as he, baseNodeDefaults as me, conditionBranchDescriptor as ge, defineNode as Fe, endEventDescriptor as be, makeSubWorkflowDescriptor as Te, nodeTypeRegistry as we, notificationDescriptor as ye, restApiDescriptor as ke, startEventDescriptor as Se, subWorkflowDescriptor as xe, webhookTriggerDescriptor as ve, webhookTriggerTemplate as Ne } from "./nodeRegistry.js";
|
|
8
|
+
import { TemplateRegistry as Re, templateRegistry as Pe } from "./templateRegistry.js";
|
|
9
|
+
import { F as Ae, a as Ee, S as Ce, F as Ie, W as Be, b as Oe } from "./WorkflowExecutionHistory-B0OiFCyi.js";
|
|
10
|
+
import { d as ze } from "./messages-CO299wPN.js";
|
|
11
|
+
import { l as He, s as qe } from "./bpmn-CtfWDaOY.js";
|
|
12
|
+
import { A as _e, b as $e, E as je, c as Ge, F as Ue, R as Ye, S as Je, T as Ke, W as Qe, e as Xe } from "./GatewayBranchEdge-BWz43Sat.js";
|
|
13
|
+
import { b as es } from "./buildBackendPayload-4SwOp7St.js";
|
|
14
14
|
class g {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.channels = /* @__PURE__ */ new Map();
|
|
17
17
|
}
|
|
18
|
-
register(s,
|
|
19
|
-
this.channels.set(s,
|
|
18
|
+
register(s, r) {
|
|
19
|
+
this.channels.set(s, r);
|
|
20
20
|
}
|
|
21
21
|
get(s) {
|
|
22
22
|
return this.channels.get(s);
|
|
23
23
|
}
|
|
24
24
|
list() {
|
|
25
|
-
return Array.from(this.channels.entries()).map(([s,
|
|
25
|
+
return Array.from(this.channels.entries()).map(([s, r]) => ({ key: s, ...r }));
|
|
26
26
|
}
|
|
27
27
|
has(s) {
|
|
28
28
|
return this.channels.has(s);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
function
|
|
31
|
+
const k = new g();
|
|
32
|
+
function S(e) {
|
|
33
33
|
const {
|
|
34
34
|
currentNodeId: s,
|
|
35
|
-
nodes:
|
|
35
|
+
nodes: r,
|
|
36
36
|
getParents: t,
|
|
37
|
-
getOutputSchema:
|
|
37
|
+
getOutputSchema: o,
|
|
38
38
|
nodePath: i,
|
|
39
39
|
nodeLabel: n,
|
|
40
|
-
getNodeId: l = (
|
|
41
|
-
} = e, c =
|
|
40
|
+
getNodeId: l = (a) => a.id
|
|
41
|
+
} = e, c = r.find((a) => l(a) === s);
|
|
42
42
|
if (!c) return [];
|
|
43
|
-
const h =
|
|
44
|
-
for (const
|
|
45
|
-
const d = a
|
|
43
|
+
const h = F(c, r, t, l), p = [];
|
|
44
|
+
for (const a of h) {
|
|
45
|
+
const d = o(a);
|
|
46
46
|
if (!d || d.length === 0) continue;
|
|
47
|
-
const u = i(
|
|
47
|
+
const u = i(a);
|
|
48
48
|
p.push({
|
|
49
|
-
label: n ? n(
|
|
49
|
+
label: n ? n(a) : u,
|
|
50
50
|
items: d.map((m) => f(m, u))
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
return p;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
55
|
+
function F(e, s, r, t) {
|
|
56
|
+
const o = /* @__PURE__ */ new Set(), i = [], n = [...r(e, s)];
|
|
57
57
|
for (; n.length > 0; ) {
|
|
58
58
|
const l = n.shift(), c = t(l);
|
|
59
|
-
|
|
59
|
+
o.has(c) || (o.add(c), i.push(l), n.push(...r(l, s)));
|
|
60
60
|
}
|
|
61
61
|
return i;
|
|
62
62
|
}
|
|
63
63
|
function f(e, s) {
|
|
64
|
-
const
|
|
65
|
-
return t !== void 0 && (
|
|
64
|
+
const r = `${s}.${e.key}`, t = e.description ?? (e.sample !== void 0 && e.sample !== null ? String(e.sample) : void 0), o = { label: e.label, path: r };
|
|
65
|
+
return t !== void 0 && (o.description = t), e.children && e.children.length > 0 && (o.children = e.children.map((i) => f(i, r))), o;
|
|
66
66
|
}
|
|
67
67
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
_e as ActionNode,
|
|
69
|
+
$e as ApprovalNode,
|
|
70
70
|
N as DynamicFormRenderer,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
je as EdgeWithPlusLabel,
|
|
72
|
+
Ge as EndNode,
|
|
73
|
+
D as FF,
|
|
74
74
|
ce as FIELD_TYPE_OPTIONS,
|
|
75
|
-
|
|
75
|
+
Ue as FilterNode,
|
|
76
76
|
Ae as FlowForgeCanvas,
|
|
77
77
|
Ee as FlowForgeHeader,
|
|
78
|
-
|
|
78
|
+
R as FlowForgeRegistry,
|
|
79
79
|
P as FlowForm,
|
|
80
80
|
W as FormulaInput,
|
|
81
81
|
A as InfiniteSelectField,
|
|
82
82
|
he as NodeTypeRegistry,
|
|
83
83
|
E as OptionsResolversProvider,
|
|
84
|
-
|
|
84
|
+
Ye as RestApiNode,
|
|
85
85
|
de as SchemaBuilder,
|
|
86
86
|
pe as SchemaBuilderDrawer,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
B as astHasRefs,
|
|
87
|
+
Je as StartNode,
|
|
88
|
+
Ce as SubWorkflowPreviewDrawer,
|
|
89
|
+
C as TablePickerField,
|
|
90
|
+
Re as TemplateRegistry,
|
|
91
|
+
Ke as TriggerNode,
|
|
92
|
+
I as VariablePicker,
|
|
93
|
+
B as VariablePickerProvider,
|
|
94
|
+
Qe as WebhookTriggerNode,
|
|
95
|
+
Ie as WorkflowCanvas,
|
|
96
|
+
Be as WorkflowExecutionHistory,
|
|
97
|
+
Oe as WorkflowTemplateLibrary,
|
|
98
|
+
O as astHasRefs,
|
|
100
99
|
V as astToTokens,
|
|
101
100
|
me as baseNodeDefaults,
|
|
102
|
-
|
|
101
|
+
es as buildBackendPayload,
|
|
103
102
|
z as buildEvaluationPayload,
|
|
104
103
|
L as buildFieldConfig,
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
H as buildFormulaPath,
|
|
105
|
+
q as buildSelectStyles,
|
|
107
106
|
M as buildValidationSchema,
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
S as buildVariableGroups,
|
|
108
|
+
Xe as builtInNodeTypes,
|
|
110
109
|
ge as conditionBranchDescriptor,
|
|
111
110
|
_ as dataSourceRegistry,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
ze as defaultFlowForgeMessages,
|
|
112
|
+
Fe as defineNode,
|
|
113
|
+
be as endEventDescriptor,
|
|
115
114
|
$ as errorTextStyle,
|
|
116
115
|
j as extractLabel,
|
|
117
116
|
G as fieldRegistry,
|
|
@@ -119,30 +118,27 @@ export {
|
|
|
119
118
|
Y as helperTextStyle,
|
|
120
119
|
J as inputStyle,
|
|
121
120
|
K as isFormula,
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
He as loadWorkflowFromBpmn,
|
|
122
|
+
Te as makeSubWorkflowDescriptor,
|
|
124
123
|
we as nodeTypeRegistry,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
ze as offboardingSkeleton,
|
|
124
|
+
k as notificationChannelRegistry,
|
|
125
|
+
ye as notificationDescriptor,
|
|
128
126
|
Q as parseToAST,
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
ke as restApiDescriptor,
|
|
128
|
+
qe as saveWorkflowToBpmn,
|
|
131
129
|
X as serializeAST,
|
|
132
130
|
Z as serializeASTAsConfig,
|
|
133
131
|
ee as serializeConditionExpressions,
|
|
134
|
-
|
|
132
|
+
Se as startEventDescriptor,
|
|
135
133
|
se as stripFormulaTokens,
|
|
136
134
|
xe as subWorkflowDescriptor,
|
|
137
135
|
Pe as templateRegistry,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
re as tokenize,
|
|
137
|
+
oe as unwrapFormula,
|
|
138
|
+
ae as useDynamicOptions,
|
|
141
139
|
ue as useFlowForm,
|
|
142
140
|
te as useOptionsResolvers,
|
|
143
141
|
ie as useVariablePickerContext,
|
|
144
|
-
Le as userOnboardingSkeleton,
|
|
145
|
-
qe as webhookIntegrationSkeleton,
|
|
146
142
|
ve as webhookTriggerDescriptor,
|
|
147
143
|
Ne as webhookTriggerTemplate,
|
|
148
144
|
ne as wrapFormula
|
package/dist/nodeRegistry.d.ts
CHANGED
|
@@ -59,12 +59,6 @@ declare interface ConditionFieldDef {
|
|
|
59
59
|
value: string;
|
|
60
60
|
label: string;
|
|
61
61
|
}>;
|
|
62
|
-
/**
|
|
63
|
-
* Declarative dynamic options — same shape as `FieldDescriptor.optionsSource`.
|
|
64
|
-
* `dependsOn` resolves against the OUTER form values (not the condition entry),
|
|
65
|
-
* so a condition column can depend on another top-level field (e.g. attributes
|
|
66
|
-
* scoped by `applicationUuid`).
|
|
67
|
-
*/
|
|
68
62
|
optionsSource?: OptionsSource;
|
|
69
63
|
/** When true, renders a FormulaInput chip editor instead of a plain <input> */
|
|
70
64
|
formula?: boolean;
|
|
@@ -298,26 +292,8 @@ export declare const notificationDescriptor: NodeDescriptor;
|
|
|
298
292
|
declare interface OptionsSource {
|
|
299
293
|
/** Resolver id — must match a key in the host's `optionsResolvers` map. */
|
|
300
294
|
id: string;
|
|
301
|
-
/**
|
|
302
|
-
* Other field values this resolver depends on. Two shapes accepted:
|
|
303
|
-
* - `string[]` — pass through verbatim ({ fieldA: values.fieldA, ... })
|
|
304
|
-
* - `Record<arg, fieldName>` — rename parent values for the resolver
|
|
305
|
-
*
|
|
306
|
-
* When any dep value changes, the cache key for this field invalidates
|
|
307
|
-
* and the resolver re-fires.
|
|
308
|
-
*/
|
|
309
295
|
dependsOn?: string[] | Record<string, string>;
|
|
310
|
-
/**
|
|
311
|
-
* Static params merged into the deps object for every call. Use for
|
|
312
|
-
* "URL template via the generic resolver" style:
|
|
313
|
-
* { id: 'default', params: { url: '/groups', valueKey: 'uuid' } }
|
|
314
|
-
*/
|
|
315
296
|
params?: Record<string, unknown>;
|
|
316
|
-
/**
|
|
317
|
-
* Lookup individual options by value (edit-mode hydration). When set,
|
|
318
|
-
* the field calls this resolver with `{ ids: [...] }` to render labels
|
|
319
|
-
* for already-selected values that aren't in the current page.
|
|
320
|
-
*/
|
|
321
297
|
resolveValueId?: string;
|
|
322
298
|
}
|
|
323
299
|
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),r=require("reactflow"),z=require("@mui/material"),be=require("react-icons/gr"),ee=require("react"),Ne=require("./messages-O9Tw_XXR.js"),y=require("react-icons/md"),$=require("react-icons/fa"),ke=require("react-icons/fi"),W=require("./canvasTokens-gKNYrPl4.js"),te=ee.createContext({onEditNode:()=>{},onDeleteNode:()=>{},onAddStep:()=>{},onClickAddTrigger:()=>{},messages:Ne.defaultFlowForgeMessages,nodeRegistry:null,nodeBody:"full"}),P=()=>ee.useContext(te),ne=()=>e.jsxs("div",{style:{width:350,display:"flex",justifyContent:"center"},children:[e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0,left:"50%"}}),e.jsx("div",{style:{padding:"8px 28px",borderRadius:999,background:"#f5f5f5",border:"1.5px solid #bdbdbd",fontSize:13,fontWeight:500,color:"#424242",userSelect:"none"},children:"Start"})]}),se=()=>e.jsxs("div",{style:{width:350,display:"flex",justifyContent:"center"},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0,left:"50%"}}),e.jsx("div",{style:{padding:"8px 28px",borderRadius:999,background:"#f5f5f5",border:"1.5px solid #bdbdbd",fontSize:13,fontWeight:500,color:"#424242",userSelect:"none"},children:"End"})]}),ie=()=>{const{onClickAddTrigger:t,messages:s}=P();return e.jsxs("div",{style:{width:350,display:"flex",justifyContent:"center"},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0,left:"50%"}}),e.jsx(z.Tooltip,{title:s.addTriggerTooltip,placement:"top",arrow:!0,children:e.jsxs("div",{onClick:t,role:"button",tabIndex:0,onKeyDown:c=>{c.key==="Enter"&&t()},style:{padding:"10px 24px",borderRadius:8,border:"1.5px dashed #d0d0d0",background:"#fff",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:[e.jsx(be.GrTrigger,{size:16}),e.jsx("span",{className:"ff-text-black",style:{fontSize:13},"data-testid":"add-trigger-btn-text",children:s.addTriggerButton})]})}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0,left:"50%"}})]})},ve=({id:t})=>{const{onAddStep:s}=P();return e.jsxs("div",{onClick:()=>s(t),role:"button",tabIndex:0,onKeyDown:c=>{c.key==="Enter"&&s(t)},style:{width:28,height:28,borderRadius:"50%",border:"1.5px solid #9e9e9e",background:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:18,color:"#757575",lineHeight:1,userSelect:"none"},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),"+",e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0}})]})};function oe(t){return t?t.replace(/[_-]+/g," ").toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()):""}function we(t){if(typeof t!="string"&&t.label)return t.label;const s=typeof t=="string"?t:t.value??"";return oe(s)}const le=({data:t})=>{const{onClickAddTrigger:s}=P(),{type:c,eventType:p,sources:d,label:o,source:g,previewWorkflow:n,executionStatus:i,infoText:f="This node decides the flow trigger type and configuration."}=t??{},u=m=>{m==null||m.stopPropagation(),s()},h=Array.isArray(d)&&d.length>0,b=!!(o||g),x=c==="scheduler"?"Scheduler Trigger":c==="event"||h||b?"Event Trigger Source":"Select Trigger",l=(()=>{if(c==="scheduler")return e.jsx("span",{children:"Scheduler to be configured"});if(c==="event"||h){const m=o||oe(p);return e.jsxs("div",{children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center",children:[e.jsx("span",{style:{fontWeight:600},children:m}),e.jsx("span",{className:"ff-ms-2 ff-text-muted",style:{fontSize:12},children:"via"})]}),e.jsx("div",{className:"ff-d-flex ff-flex-wrap ff-mt-2",style:{gap:4},children:h?d.map((w,N)=>e.jsx(z.Chip,{label:we(w),variant:"outlined",size:"small",className:"ff-text-dark"},N)):e.jsx("span",{className:"ff-text-muted",style:{fontSize:12},children:"No source selected"})})]})}return b?e.jsxs("div",{className:"ff-d-flex ff-flex-wrap ff-align-items-center",style:{gap:6},children:[o&&e.jsx("span",{style:{fontWeight:600},children:o}),g&&e.jsx(z.Chip,{label:g,variant:"outlined",size:"small"})]}):e.jsx("span",{role:"button",tabIndex:0,onClick:u,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&u(m)},style:{cursor:"pointer",color:"#1e88e5"},children:"Click to select a trigger to start your workflow"})})(),v=i?e.jsxs(e.Fragment,{children:[i.status==="success"&&e.jsx($.FaCheckCircle,{size:16,color:"#1DBF60",style:{marginRight:8}}),i.status==="failed"&&e.jsx($.FaTimesCircle,{size:16,color:"#f44336",style:{marginRight:8}})]}):e.jsxs("div",{className:"ff-d-flex ff-align-items-center",children:[!n&&e.jsx("div",{role:"button",tabIndex:0,onClick:u,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&u(m)},className:"ff-me-2",style:{cursor:"pointer",color:"#212121"},"aria-label":"Edit trigger",children:e.jsx(y.MdOutlineModeEdit,{size:16})}),e.jsx(z.Tooltip,{title:e.jsx("div",{children:f}),placement:"right",arrow:!0,children:e.jsx("span",{children:e.jsx(y.MdInfoOutline,{color:"gray",size:16})})})]});return e.jsxs("div",{style:{width:350},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #a5d6a7",borderRadius:8,background:"#fff",overflow:"hidden"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"12px 14px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:28,height:28,borderRadius:6,background:"rgba(76,175,80,0.1)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(y.MdInput,{size:16,color:"#388e3c"})}),e.jsx("span",{style:{fontSize:14,fontWeight:500,color:"#212121"},children:x})]}),e.jsx("div",{className:"ff-d-flex ff-align-items-center",children:v})]}),e.jsx("div",{style:{background:"#f5f5f5",fontSize:12,color:"#212121",padding:"14px 16px",margin:"0 10px 12px",borderRadius:6,textAlign:"left"},children:l})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0},id:"1"})]})};function Se(t){return t?t==="END_USER_CREATION"?"New User Registration":t==="END_USER_UPDATION"?"On User Update":t.replace(/[_-]+/g," ").replace(/\b\w/g,s=>s.toUpperCase()):""}function Ee(t){const s=typeof t=="string"?t:t.value??"";return s==="SIGNUP_FLOW"?"User Self-Registration":s==="ADMIN_CREATION_FLOW"?"Create User via Admin Portal":s==="SHEDULAR"||s==="SCHEDULER"?"Scheduler":typeof t!="string"&&t.label?t.label:s.replace(/[_-]+/g," ").replace(/\b\w/g,c=>c.toUpperCase())}const Te=({data:t})=>{const{header:s="Event",title:c,eventType:p,sources:d,executionStatus:o,infoText:g="This event is raised by the system. It cannot be configured."}=t??{},n=c??Se(p)??"—";return e.jsxs("div",{style:{width:350},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #a5d6a7",borderRadius:8,background:"#fff",overflow:"hidden"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"12px 14px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:28,height:28,borderRadius:6,background:"rgba(76,175,80,0.1)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(y.MdInput,{size:16,color:"#388e3c"})}),e.jsx("span",{style:{fontSize:14,fontWeight:500,color:"#212121"},children:s})]}),e.jsxs("div",{className:"ff-d-flex ff-align-items-center",children:[(o==null?void 0:o.status)==="success"&&e.jsx($.FaCheckCircle,{size:16,color:"#1DBF60",style:{marginRight:8}}),(o==null?void 0:o.status)==="failed"&&e.jsx($.FaTimesCircle,{size:16,color:"#f44336",style:{marginRight:8}}),!o&&e.jsx(z.Tooltip,{title:e.jsx("div",{children:g}),placement:"right",arrow:!0,children:e.jsx("span",{children:e.jsx(y.MdInfoOutline,{color:"gray",size:16})})})]})]}),e.jsxs("div",{style:{background:"#f5f5f5",fontSize:13,color:"#212121",padding:"14px 16px",margin:"0 10px 12px",borderRadius:6,textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:600},children:n}),Array.isArray(d)&&d.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ff-text-muted",style:{fontSize:12,marginTop:4},children:"via"}),e.jsx("div",{className:"ff-d-flex ff-flex-wrap ff-mt-1",style:{gap:4},children:d.map((i,f)=>e.jsx(z.Chip,{label:Ee(i),variant:"outlined",size:"small",className:"ff-text-dark"},f))})]})]})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0},id:"1"})]})},re=({rail:t,cardWidth:s})=>{const c=s/2;s/2+t.indent;const p="var(--ff-edge-color, #b0bec5)";return e.jsxs("svg",{width:s+t.indent+200,height:t.height,style:{position:"absolute",left:0,top:"100%",pointerEvents:"none",overflow:"visible"},children:[e.jsx("line",{x1:c,y1:0,x2:c,y2:t.height,stroke:p,strokeWidth:1.5}),t.branches.map((d,o)=>{const g=d.y;return e.jsxs("g",{transform:`translate(0, ${g})`,children:[e.jsx("rect",{x:c-5,y:-5,width:10,height:10,fill:"#fff",stroke:p,strokeWidth:1.5,transform:`rotate(45, ${c}, 0)`}),e.jsx("text",{x:c+14,y:4,fontSize:12,fontWeight:500,fill:"var(--ff-text, #212121)",style:{fontFamily:"sans-serif"},children:d.label})]},o)})]})},de=({id:t,data:s})=>{const{onEditNode:c,onDeleteNode:p}=P(),{conditions:d=[],infoText:o="Filter conditions applied to workflow data",_branchRail:g}=s;return e.jsxs("div",{style:{width:350,position:"relative"},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #ffe082",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center",children:[e.jsx("div",{className:"ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded",style:{width:25,height:25,background:"rgba(255,160,0,0.1)"},children:e.jsx(ke.FiFilter,{className:"ff-text-warning",size:16})}),e.jsx("span",{className:"ff-ms-2 ff-fw-medium ff-text-dark",style:{fontSize:14},children:"Filter"})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:n=>{n.stopPropagation(),c(t)},onKeyDown:n=>{n.key==="Enter"&&(n.stopPropagation(),c(t))},children:e.jsx(y.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:n=>{n.stopPropagation(),p(t)},onKeyDown:n=>{n.key==="Enter"&&(n.stopPropagation(),p(t))},children:e.jsx(y.MdDeleteOutline,{color:"red",size:16})}),e.jsx(z.Tooltip,{title:o,placement:"right",arrow:!0,children:e.jsx("div",{className:"ff-ms-2",children:e.jsx(y.MdInfoOutline,{color:"gray",size:16})})})]})]}),e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#fafafa",fontSize:12},children:d.length===0?e.jsx("span",{className:"ff-text-muted",children:"No conditions configured"}):d.map((n,i)=>e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-mb-1",children:[e.jsx("p",{className:"ff-m-0 ff-fw-bold ff-me-1 ff-text-truncate",style:{maxWidth:100},title:n.field,children:n.field}),e.jsx("span",{className:"ff-text-muted",children:n.operator}),e.jsx("p",{className:"ff-text-dark ff-text-truncate ff-mx-1 ff-m-0",title:n.value,children:n.value}),i<d.length-1&&e.jsx("p",{className:"ff-bg-primary ff-text-white ff-fw-bold ff-ms-1 ff-px-1 ff-rounded-1 ff-m-0",children:n.logicalOperator})]},i))})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0}}),g&&e.jsx(re,{rail:g,cardWidth:350})]})},ce=({id:t,data:s})=>{const{onEditNode:c,onDeleteNode:p,nodeRegistry:d,nodeBody:o="full"}=P(),{title:g="Task",descriptorType:n,groupBlocks:i,groups:f,roles:u,groupId:h,roleId:b,infoText:x=""}=s,l=n?d==null?void 0:d.forType(n):void 0,v=l==null?void 0:l.icon,m=a=>a==null?"":typeof a=="string"?a:typeof a=="object"&&"label"in a?String(a.label):String(a),w=a=>Array.isArray(a)?a.map(m).filter(Boolean):a!=null&&a!==""?[m(a)]:[],N=new Set(["descriptorType","title","header","icon","infoText","label","conditionConfig","_conditionConfig"]),D=l==null?void 0:l.formSchema,E=a=>{if(Array.isArray(D)){const j=D.find(k=>(k==null?void 0:k.id)===a||(k==null?void 0:k.name)===a);if(j!=null&&j.label)return j.label}return a.replace(/[_-]+/g," ").replace(/\b\w/g,j=>j.toUpperCase())},I=a=>{if(Array.isArray(a)){const j=a.map(R=>typeof R=="object"&&R?R.label??R.name??R.value??"":String(R)).filter(Boolean),k=j.slice(0,3).join(", ");return j.length>3?`${k} +${j.length-3}`:k}if(a&&typeof a=="object"){const j=a;return j.label??j.name??j.value??JSON.stringify(a)}return String(a)},C=Object.entries(s||{}).filter(([a,j])=>!N.has(a)&&j!==""&&j!==null&&j!==void 0&&!(Array.isArray(j)&&j.length===0)),T=(s==null?void 0:s.conditionConfig)??(s==null?void 0:s._conditionConfig),S=T&&typeof T=="object"?Object.entries(T).filter(([,a])=>Array.isArray(a)&&a.length>0).map(([a,j])=>({path:a,entries:j})):[],A=(i==null?void 0:i.flatMap(a=>a.groups??[]))??[...w(f),...w(u),...w(h),...w(b)],H=A.length>0;return e.jsxs("div",{style:{width:350},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #b0bec5",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[v&&e.jsx("div",{style:{display:"flex",alignItems:"center"},children:v}),e.jsx("span",{className:"ff-text-dark",style:{fontSize:14,fontWeight:500},children:g})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:a=>{a.stopPropagation(),c(t)},onKeyDown:a=>{a.key==="Enter"&&(a.stopPropagation(),c(t))},children:e.jsx(y.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:a=>{a.stopPropagation(),p(t)},onKeyDown:a=>{a.key==="Enter"&&(a.stopPropagation(),p(t))},children:e.jsx(y.MdDeleteOutline,{color:"red",size:16})}),x&&e.jsx(z.Tooltip,{title:x,placement:"right",arrow:!0,children:e.jsx("div",{className:"ff-ms-2",children:e.jsx(y.MdInfoOutline,{color:"gray",size:16})})})]})]}),o!=="title-only"&&e.jsx("div",{style:{margin:"0 8px 8px",padding:8,borderRadius:4,background:"#f8f9fa",fontSize:12,textAlign:"left",color:"#212529",lineHeight:1.4},children:l!=null&&l.renderNode?l.renderNode(s):C.length>0||S.length>0?e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[S.map((a,j)=>e.jsxs("div",{children:[e.jsx("div",{style:{color:"#6c757d"},children:"When"}),a.entries.slice(0,3).map((k,R,he)=>{const ye=k.field||"",ue=k.fieldLabel||E(ye),me=k.operator||"",B=k.value==null?"":typeof k.value=="object"?I(k.value):String(k.value),je=k.connector||"and";return e.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",marginTop:4},children:[e.jsx("span",{style:{fontWeight:700,marginRight:4,color:"#212529"},children:ue}),e.jsx("span",{style:{color:"#6c757d",marginRight:4},children:me}),e.jsx("span",{style:{color:"#212529",marginRight:4},title:B,children:B}),R<he.length-1&&e.jsx("span",{style:{background:"#0d6efd",color:"#fff",fontWeight:700,marginLeft:4,padding:"0 4px",borderRadius:2,textTransform:"uppercase",fontSize:10},children:je})]},R)}),a.entries.length>3&&e.jsxs("div",{style:{color:"#6c757d",fontSize:11,marginTop:2},children:["+",a.entries.length-3," more"]})]},`cond-${j}`)),C.length>0&&e.jsx("div",{style:{marginTop:4,color:"#212529",display:"flex",justifyContent:"flex-start"},children:(l==null?void 0:l.label)||g}),C.length>0&&e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:[C.slice(0,6).map(([a,j])=>e.jsx("span",{title:`${E(a)}: ${I(j)}`,style:{background:"#212529",color:"#fff",padding:"4px 8px",borderRadius:4,fontSize:11},children:I(j)},a)),C.length>6&&e.jsxs("span",{style:{color:"#6c757d",fontSize:11,alignSelf:"center"},children:["+",C.length-6]})]})]}):H?e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:A.map((a,j)=>e.jsx("span",{title:a,style:{background:"#212529",color:"#fff",padding:"4px 8px",borderRadius:4,fontSize:11},children:a},j))}):e.jsx("span",{style:{color:"#6c757d"},children:"Click edit to configure"})})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0}})]})},O=5,fe=({id:t,data:s})=>{const{onEditNode:c,onDeleteNode:p}=P(),{approvalData:d,isPreview:o=!1,_branchRail:g}=s,n=(d==null?void 0:d.policy)??{},i=n.stages??[],f=i.length,u=i.slice(0,O),h=f-O,b=n.name??n.policyName??"Untitled Policy";return e.jsxs("div",{style:{width:350,position:"relative"},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #ffe082",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{className:"ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded",style:{width:25,height:25,background:"rgba(251,192,45,0.2)"},children:e.jsx(y.MdCheckCircle,{style:{color:"#FBC02D"},size:16})}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:"Approval Policy"})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[!o&&e.jsx("div",{role:"button",tabIndex:0,style:{cursor:"pointer"},onClick:x=>{x.stopPropagation(),c(t)},onKeyDown:x=>{x.key==="Enter"&&(x.stopPropagation(),c(t))},children:e.jsx(y.MdOutlineModeEdit,{size:16,className:"ff-text-secondary"})}),!o&&e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,style:{cursor:"pointer"},onClick:x=>{x.stopPropagation(),p(t)},onKeyDown:x=>{x.key==="Enter"&&(x.stopPropagation(),p(t))},children:e.jsx(y.MdDeleteOutline,{color:"red",size:16})}),e.jsx(z.Tooltip,{title:"This approval policy determines who must approve a request before the workflow continues.",arrow:!0,placement:"right",children:e.jsx("span",{className:"ff-ms-2 ff-d-inline-flex",children:e.jsx(y.MdInfoOutline,{color:"gray",size:16})})})]})]}),e.jsxs("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#FCFCFC"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-start ff-align-items-center ff-mb-2",children:[e.jsx("h6",{className:"ff-text-dark ff-mb-0 ff-text-truncate ff-flex-grow-1 ff-me-2",style:{fontSize:13,fontWeight:700},title:b,children:b}),e.jsxs("span",{className:"ff-badge ff-rounded-pill ff-px-2 ff-py-1 ff-flex-shrink-0",style:{background:"#FFF9C4",color:"#616161",fontSize:11,fontWeight:600},children:[f," Stage",f!==1?"s":""]})]}),i.length>0?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[u.map((x,l)=>{var I,C,T;const v=((I=x.stageName)==null?void 0:I.trim())||`Stage ${l+1}`,m=Array.isArray(x.userIds)?x.userIds.length:0,w=((C=x.groupName)==null?void 0:C.trim())??"",N=((T=x.roleName)==null?void 0:T.trim())??"",D=m>0||w||N;let E="Not configured";return w?E=`Group: ${w}`:N?E=`Role: ${N}`:m>0&&(E=`${m} approver${m!==1?"s":""}`),e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{className:"ff-rounded-circle ff-d-flex ff-align-items-center ff-justify-content-center ff-flex-shrink-0",style:{width:28,height:28,background:"#FFF9C4",color:"#5D4037",fontSize:12,fontWeight:700},children:l+1}),e.jsxs("div",{className:"ff-flex-grow-1 ff-rounded ff-p-2 ff-d-flex ff-justify-content-between ff-align-items-center ff-border",style:{background:"#FFFDE7",borderColor:"#FEE79A"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:700,color:"#212121"},children:v}),e.jsxs("span",{className:`ff-d-flex ff-align-items-center ff-gap-1 ${D?"ff-text-dark":"ff-text-muted"}`,style:{fontSize:12},children:[e.jsx(y.MdPeople,{size:16,className:"ff-flex-shrink-0",style:{color:D?"#5D4037":"#9E9E9E"}}),E]})]})]},l)}),h>0&&e.jsxs("div",{className:"ff-text-center ff-fw-bold ff-py-2 ff-border ff-rounded",style:{fontSize:11,color:"#1976d2",borderColor:"#FEE79A",background:"#FFFDE7",borderStyle:"dashed",cursor:o?"default":"pointer"},role:o?void 0:"button",tabIndex:o?void 0:0,onClick:x=>{o||(x.stopPropagation(),c(t))},onKeyDown:x=>{o||x.key!=="Enter"||(x.stopPropagation(),c(t))},children:["+ ",h," More Stage",h>1?"s":""]})]}):e.jsx("div",{className:"ff-text-center ff-py-3 ff-rounded ff-border",style:{fontSize:12,color:"#9e9e9e",background:"#FFFDE7",borderColor:"#FEE79A",borderStyle:"dashed"},children:"No stages configured"})]})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0}}),g&&e.jsx(re,{rail:g,cardWidth:350})]})},ae=({id:t,data:s})=>{const{onEditNode:c,onDeleteNode:p}=P(),{duration:d,unit:o}=s,g=d!=null&&o,n=g?`Wait ${d} ${o}`:"Not configured";return e.jsxs("div",{style:{width:350},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #b0bec5",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1",children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{className:"ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded",style:{width:25,height:25,background:"rgba(33,150,243,0.1)"},children:e.jsx(y.MdSchedule,{size:16,color:"#1976d2"})}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:"Delay"})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:i=>{i.stopPropagation(),c(t)},onKeyDown:i=>{i.key==="Enter"&&(i.stopPropagation(),c(t))},children:e.jsx(y.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:i=>{i.stopPropagation(),p(t)},onKeyDown:i=>{i.key==="Enter"&&(i.stopPropagation(),p(t))},children:e.jsx(y.MdDeleteOutline,{color:"red",size:16})})]})]}),e.jsx("div",{className:"ff-mx-2 ff-mb-2 ff-p-2 ff-rounded",style:{background:"#fafafa",fontSize:12},children:e.jsx("span",{className:g?"ff-text-dark ff-fw-medium":"ff-text-muted",children:n})})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0}})]})},_={email:{label:"Email",bg:"#e3f2fd",color:"#1565c0",iconType:y.MdEmail},slack:{label:"Slack",bg:"#e8f5e9",color:"#2e7d32",iconType:y.MdNotifications},teams:{label:"MS Teams",bg:"#ede7f6",color:"#4527a0",iconType:y.MdNotifications},sms:{label:"SMS",bg:"#fce4ec",color:"#880e4f",iconType:y.MdSms},"in-app":{label:"In-App",bg:"#fff3e0",color:"#e65100",iconType:y.MdNotifications},webhook:{label:"Webhook",bg:"#f3e5f5",color:"#6a1b9a",iconType:y.MdWebhook}},Ce={label:"Notification",bg:"rgba(156,39,176,0.1)",color:"#7b1fa2",iconType:y.MdNotifications};function Pe(t){var s;switch(t.channel){case"email":return((s=t.emailTo)==null?void 0:s.join(", "))??t.recipient??null;case"slack":return t.slackChannel??null;case"teams":return t.teamsMessage?"Message configured":null;case"sms":return t.smsTo??null;case"in-app":return t.inAppRecipient??null;case"webhook":return t.webhookUrl??null;default:return t.recipient??null}}function Ie(t){switch(t.channel){case"email":return t.emailSubject??t.subject??null;case"slack":{const s=t.slackMessage;return s?s.length>60?`${s.slice(0,60)}…`:s:null}case"in-app":return t.inAppTitle??null;default:return t.subject??null}}const pe=({id:t,data:s})=>{const{onEditNode:c,onDeleteNode:p}=P(),d=s,o=d.channel&&_[d.channel]?_[d.channel]:Ce,g=Pe(d),n=Ie(d),i=!!(d.channel&&g),f=o.iconType;return e.jsxs("div",{style:{width:W.NODE_WIDTH},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #b0bec5",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{className:"ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded",style:{width:25,height:25,background:o.bg},children:e.jsx(f,{size:16,color:o.color})}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:d.channel?`${o.label} Notification`:"Notification"})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:u=>{u.stopPropagation(),c(t)},onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.stopPropagation(),c(t))},children:e.jsx(y.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:u=>{u.stopPropagation(),p(t)},onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.stopPropagation(),p(t))},children:e.jsx(y.MdDeleteOutline,{color:"red",size:16})})]})]}),e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#fafafa",fontSize:12},children:i?e.jsxs("div",{className:"ff-d-flex ff-flex-column ff-gap-1",children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("span",{className:"ff-px-2 ff-py-1 ff-rounded",style:{fontSize:10,background:o.bg,color:o.color,fontWeight:600,flexShrink:0},children:o.label}),e.jsx("span",{className:"ff-text-dark ff-text-truncate",style:{maxWidth:220},children:g})]}),n&&e.jsx("span",{className:"ff-text-muted ff-text-truncate",style:{maxWidth:280},children:n})]}):e.jsx("span",{className:"ff-text-muted",children:"Not configured"})})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0}})]})},K={"api-key":"API Key",hmac:"HMAC"},xe=({data:t})=>{const{onClickAddTrigger:s}=P(),{label:c="Webhook Trigger",endpointUrl:p,authMethod:d,source:o}=t,g=i=>{i.stopPropagation(),s()},n=i=>{i.stopPropagation(),p&&navigator.clipboard.writeText(p).catch(()=>{})};return e.jsxs("div",{style:{width:W.NODE_WIDTH},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #90caf9",borderRadius:8,background:"#fff",overflow:"hidden"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:28,height:28,borderRadius:6,background:"rgba(33,150,243,0.1)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(y.MdWebhook,{size:16,color:"#1565c0"})}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#212121"},children:"Webhook Trigger"})]}),e.jsx("div",{role:"button",tabIndex:0,onClick:g,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&g(i)},className:"ff-d-flex ff-align-items-center",style:{paddingRight:4,cursor:"pointer"},children:e.jsx(y.MdOutlineModeEdit,{size:16,color:"#555"})})]}),e.jsxs("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#e3f2fd",border:"1px solid #90caf9"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-flex-wrap ff-gap-2 ff-mb-1",children:[e.jsx("span",{style:{fontSize:12,color:"#1565c0",fontWeight:600},children:c}),o&&e.jsx("span",{className:"ff-px-2 ff-py-1 ff-rounded",style:{fontSize:11,background:"#fff",border:"1px solid #90caf9",color:"#1565c0"},children:o}),d&&d!=="none"&&K[d]&&e.jsx("span",{className:"ff-px-2 ff-py-1 ff-rounded",style:{fontSize:10,background:"#1565c0",color:"#fff",fontWeight:600},children:K[d]})]}),p&&e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-1",style:{marginTop:4},children:[e.jsx("span",{style:{fontSize:10,color:"#1565c0",fontFamily:"monospace",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p}),e.jsx(z.Tooltip,{title:"Copy URL",placement:"top",arrow:!0,children:e.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&n(i)},style:{cursor:"pointer",flexShrink:0},children:e.jsx(y.MdContentCopy,{size:12,color:"#1565c0"})})})]})]})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0}})]})},ge=({id:t,data:s})=>{var b;const{onEditNode:c,onDeleteNode:p,nodeRegistry:d}=P(),{method:o,url:g,descriptorType:n}=s,i=n?(b=d==null?void 0:d.forType(n))==null?void 0:b.icon:e.jsx(y.MdHttp,{size:16,color:"#546e7a"}),f=!!(o&&g),u=(o==null?void 0:o.toUpperCase())??"",h=W.HTTP_METHOD_STYLE[u]??null;return e.jsxs("div",{style:{width:W.NODE_WIDTH},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #b0bec5",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:25,height:25,display:"flex",alignItems:"center",justifyContent:"center"},children:i}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:"REST API Call"})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:x=>{x.stopPropagation(),c(t)},onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.stopPropagation(),c(t))},children:e.jsx(y.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:x=>{x.stopPropagation(),p(t)},onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.stopPropagation(),p(t))},children:e.jsx(y.MdDeleteOutline,{color:"red",size:16})})]})]}),e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#fafafa",fontSize:12},children:f?e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[h&&e.jsx("span",{style:{fontSize:10,fontWeight:700,padding:"2px 6px",borderRadius:4,background:h.bg,color:h.color,flexShrink:0},children:u}),e.jsx("span",{className:"ff-text-dark ff-text-truncate",style:{fontFamily:"monospace",fontSize:11},title:g,children:g})]}):e.jsx("span",{className:"ff-text-muted",children:"Not configured"})})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0}})]})},ze={eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",contains:"contains",startsWith:"starts with",endsWith:"ends with",isEmpty:"is empty",isNotEmpty:"is not empty"},De=({id:t,data:s})=>{const{onEditNode:c,onDeleteNode:p}=P(),{title:d="Condition Branch",branchConfigs:o=[],defaultBranch:g}=s,n=o.length>0;return e.jsxs("div",{style:{width:W.NODE_WIDTH},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #b39ddb",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:25,height:25,borderRadius:6,background:"rgba(103,58,183,0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(y.MdCallSplit,{size:16,color:"#512da8"})}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:d})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:i=>{i.stopPropagation(),c(t)},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),c(t))},children:e.jsx(y.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:i=>{i.stopPropagation(),p(t)},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),p(t))},children:e.jsx(y.MdDeleteOutline,{color:"red",size:16})})]})]}),e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:"#fafafa",fontSize:12},children:n?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.map((i,f)=>{var x,l;const u=W.BRANCH_PALETTE[f%W.BRANCH_PALETTE.length],h=(x=i.conditions)==null?void 0:x[0],b=(((l=i.conditions)==null?void 0:l.length)??0)-1;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:10,background:u.bg,color:u.color,flexShrink:0},children:i.label||i.key}),h?e.jsxs("span",{style:{fontSize:11,color:"#616161",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[h.field," ",ze[h.operator]??h.operator,h.value?` ${h.value}`:"",b>0?` +${b} more`:""]}):e.jsx("span",{style:{fontSize:11,color:"#9e9e9e"},children:"No conditions yet"})]},i.key)}),g&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginTop:2},children:[e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:10,background:"#f5f5f5",color:"#757575",flexShrink:0},children:"Default"}),e.jsx("span",{style:{fontSize:11,color:"#9e9e9e"},children:"fallback path"})]})]}):e.jsx("span",{className:"ff-text-muted",children:"Not configured — click edit to add branches"})})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0}})]})},Ae=({id:t,data:s})=>{var x;const{onEditNode:c,onDeleteNode:p,nodeRegistry:d}=P(),{title:o="Sub-Workflow",workflowId:g,workflowLabel:n,descriptorType:i,onPreview:f}=s,u=i?(x=d==null?void 0:d.forType(i))==null?void 0:x.icon:e.jsx(y.MdAccountTree,{size:16,color:"#00695c"}),h=!!g,b=l=>{l.stopPropagation(),g&&f&&f(g)};return e.jsxs("div",{style:{width:W.NODE_WIDTH},children:[e.jsx(r.Handle,{type:"target",position:r.Position.Top,style:{opacity:0}}),e.jsxs("div",{style:{border:"1.5px solid #80cbc4",borderRadius:8,background:"#fff"},children:[e.jsxs("div",{className:"ff-d-flex ff-justify-content-between ff-align-items-center",style:{padding:"10px 6px"},children:[e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-gap-2",children:[e.jsx("div",{style:{width:25,height:25,borderRadius:6,background:"rgba(0,137,123,0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:u}),e.jsx("span",{className:"ff-fw-medium ff-text-dark",style:{fontSize:14},children:o})]}),e.jsxs("div",{className:"node-actions ff-d-flex ff-align-items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:l=>{l.stopPropagation(),c(t)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.stopPropagation(),c(t))},children:e.jsx(y.MdOutlineModeEdit,{size:16})}),e.jsx("div",{className:"ff-ms-2",role:"button",tabIndex:0,onClick:l=>{l.stopPropagation(),p(t)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.stopPropagation(),p(t))},children:e.jsx(y.MdDeleteOutline,{color:"red",size:16})})]})]}),e.jsx("div",{style:{margin:"0 6px 10px",padding:"10px 12px",borderRadius:6,background:h?"#e0f2f1":"#fafafa",fontSize:12,border:h?"1px solid #b2dfdb":"none"},children:h?e.jsxs("div",{className:"ff-d-flex ff-align-items-center ff-justify-content-between",children:[e.jsxs("div",{className:"ff-d-flex ff-flex-column ff-gap-1",children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"#00695c"},children:n||g}),e.jsxs("span",{style:{fontSize:10,color:"#80cbc4",fontFamily:"monospace"},children:["ID: ",g]})]}),f&&e.jsxs("div",{role:"button",tabIndex:0,onClick:b,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&b(l)},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:3,fontSize:11,color:"#00897b"},children:[e.jsx(y.MdOpenInNew,{size:13}),"Preview"]})]}):e.jsx("span",{className:"ff-text-muted",children:"Not configured — select a workflow"})})]}),e.jsx(r.Handle,{type:"source",position:r.Position.Bottom,style:{opacity:0}})]})},Re={startNode:ne,endNode:se,addTriggerNode:ie,addStepNode:ve,triggerNode:le,eventNode:Te,filterNode:de,actionNode:ce,approvalNode:fe,delayNode:ae,notificationNode:pe,webhookTriggerNode:xe,restApiNode:ge,conditionBranchNode:De,subWorkflowNode:Ae},We=11.5,U=2,L=6,q=40,G=20,V=4,Le=({id:t,sourceX:s,sourceY:c,targetX:p,targetY:d,sourcePosition:o,targetPosition:g,source:n,target:i,data:f})=>{const[u,h,b]=r.getStraightPath({sourceX:s,sourceY:c,targetX:p,targetY:d}),x=f==null?void 0:f.label,l=x==="Pass",v=l||x==="Fail",m=s+(p-s)/3,w=c+(d-c)/3,N=s+2*(p-s)/3,D=c+2*(d-c)/3,E=f==null?void 0:f.onAddStepClick,I=A=>{if(A.stopPropagation(),typeof E!="function")return;const H={edgeId:t,nodeId:n,sourceNodeId:n,targetNodeId:i,position:"between",referenceNodeId:n,referenceNodeType:f==null?void 0:f.referenceNodeType,stepVisibility:f==null?void 0:f.stepVisibility};E(n,H)},C=A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),I(A))},T=()=>e.jsxs(e.Fragment,{children:[e.jsxs("g",{className:"plus-icon-container",children:[e.jsx("circle",{r:We,className:"edge-plus-circle"}),e.jsx("line",{x1:0,y1:-L,x2:0,y2:L,strokeWidth:U,strokeLinecap:"round",className:"plus-line"}),e.jsx("line",{x1:-L,y1:0,x2:L,y2:0,strokeWidth:U,strokeLinecap:"round",className:"plus-line"})]}),e.jsxs("g",{className:"edge-plus-tooltip",transform:"translate(18, 0)",children:[e.jsx("rect",{x:0,y:-10,width:65,height:20,rx:4,className:"tooltip-bg"}),e.jsx("path",{d:"M0 -4 L-4 0 L0 4 Z",className:"tooltip-bg"}),e.jsx("text",{x:32,y:0,textAnchor:"middle",dominantBaseline:"central",fill:"white",style:{fontSize:10,fontWeight:600,pointerEvents:"none"},children:"Add Step"})]})]}),S=E?{onClick:I,onKeyDown:C,role:"button",tabIndex:0,style:{cursor:"pointer",pointerEvents:"all"}}:{style:{cursor:"default",pointerEvents:"all"}};return e.jsxs("g",{className:"edge-with-plus-wrapper",children:[e.jsx(r.BaseEdge,{id:t,path:u}),v?e.jsxs(e.Fragment,{children:[e.jsxs("g",{transform:`translate(${m}, ${w})`,children:[e.jsx("rect",{x:-q/2,y:-G/2,width:q,height:G,rx:V,ry:V,fill:l?"#ADE6C5":"#FDBFBF"}),e.jsx("text",{textAnchor:"middle",dominantBaseline:"central",fill:l?"#1DBF60":"#C50000",style:{fontSize:12,fontWeight:500},children:x})]}),e.jsx("g",{className:"nodrag nopan edge-plus-svg",transform:`translate(${N}, ${D})`,"data-testid":"plus-node-icon",...S,children:e.jsx(T,{})})]}):e.jsx("g",{className:"nodrag nopan edge-plus-svg",transform:`translate(${h}, ${b})`,"data-testid":"plus-node-icon",...S,children:e.jsx(T,{})})]})},Me=11.5,Z=2,M=6,Fe=({id:t,sourceX:s,sourceY:c,targetX:p,targetY:d,source:o,target:g,data:n})=>{const[i,f,u]=r.getStraightPath({sourceX:s,sourceY:c,targetX:p,targetY:d}),h=n==null?void 0:n.onAddStepClick,b=l=>{l.stopPropagation(),typeof h=="function"&&h(o,{edgeId:t,nodeId:o,sourceNodeId:o,targetNodeId:g,position:"between",referenceNodeId:o,referenceNodeType:n==null?void 0:n.referenceNodeType,stepVisibility:n==null?void 0:n.stepVisibility,filterId:n==null?void 0:n.filterId,branch:n==null?void 0:n.branch})},x=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),b(l))};return e.jsxs("g",{className:"edge-with-plus-wrapper",children:[e.jsx(r.BaseEdge,{id:t,path:i,style:{stroke:"#b0bec5"}}),e.jsxs("g",{className:"nodrag nopan edge-plus-svg",transform:`translate(${f}, ${u})`,style:{cursor:h?"pointer":"default",pointerEvents:"all",outline:"none"},onClick:h?b:void 0,onKeyDown:h?x:void 0,role:h?"button":void 0,tabIndex:h?0:void 0,"data-testid":"plus-node-icon",children:[e.jsx("circle",{r:Me,className:"edge-plus-circle"}),e.jsx("line",{x1:0,y1:-M,x2:0,y2:M,strokeWidth:Z,strokeLinecap:"round",className:"plus-line"}),e.jsx("line",{x1:-M,y1:0,x2:M,y2:0,strokeWidth:Z,strokeLinecap:"round",className:"plus-line"}),e.jsxs("g",{className:"edge-plus-tooltip",transform:"translate(18, 0)",children:[e.jsx("rect",{x:0,y:-10,width:65,height:20,rx:4,className:"tooltip-bg"}),e.jsx("path",{d:"M0 -4 L-4 0 L0 4 Z",className:"tooltip-bg"}),e.jsx("text",{x:32,y:0,textAnchor:"middle",dominantBaseline:"central",fill:"white",style:{fontSize:10,fontWeight:600,pointerEvents:"none"},children:"Add Step"})]})]})]})},$e=({id:t,sourceX:s,sourceY:c,targetX:p,targetY:d})=>{const[o]=r.getStraightPath({sourceX:s,sourceY:c,targetX:p,targetY:d});return e.jsx(r.BaseEdge,{id:t,path:o,style:{stroke:"#b0bec5"}})},He=11.5,Y=2,F=6,Be=-24,J=40,Q=20,X=4,Oe=({id:t,sourceX:s,sourceY:c,targetX:p,targetY:d,source:o,target:g,data:n})=>{const[i,f,u]=r.getStraightPath({sourceX:s,sourceY:c,targetX:p,targetY:d}),h=n==null?void 0:n.label,b=h==="Pass",x=b||h==="Fail",l=n==null?void 0:n.onAddStepClick,v=(n==null?void 0:n.showPlus)!==!1&&!!l,m=N=>{N.stopPropagation(),typeof l=="function"&&l(o,{edgeId:t,nodeId:o,sourceNodeId:o,targetNodeId:g,position:"between",referenceNodeId:o,referenceNodeType:n==null?void 0:n.referenceNodeType,stepVisibility:n==null?void 0:n.stepVisibility})},w=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),m(N))};return e.jsxs("g",{className:"edge-with-plus-wrapper",children:[e.jsx(r.BaseEdge,{id:t,path:i,style:{stroke:"#b0bec5"}}),e.jsxs("g",{className:"nodrag nopan edge-plus-svg",transform:`translate(${f}, ${u})`,style:{cursor:l?"pointer":"default",pointerEvents:"all",outline:"none"},onClick:l?m:void 0,onKeyDown:l?w:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,children:[x&&e.jsxs("g",{transform:`translate(0, ${v?Be:0})`,children:[e.jsx("rect",{x:-J/2,y:-Q/2,width:J,height:Q,rx:X,ry:X,fill:b?"#ADE6C5":"#FDBFBF"}),e.jsx("text",{textAnchor:"middle",dominantBaseline:"central",fill:b?"#1DBF60":"#C50000",style:{fontSize:12,fontWeight:500},children:h})]}),v&&e.jsxs("g",{className:"plus-icon-container",children:[e.jsx("circle",{r:He,className:"edge-plus-circle"}),e.jsx("line",{x1:0,y1:-F,x2:0,y2:F,strokeWidth:Y,strokeLinecap:"round",className:"plus-line"}),e.jsx("line",{x1:-F,y1:0,x2:F,y2:0,strokeWidth:Y,strokeLinecap:"round",className:"plus-line"})]}),v&&e.jsxs("g",{className:"edge-plus-tooltip",transform:"translate(22, 0)",children:[e.jsx("rect",{x:0,y:-10,width:65,height:20,rx:4,className:"tooltip-bg"}),e.jsx("path",{d:"M0 -4 L-4 0 L0 4 Z",className:"tooltip-bg"}),e.jsx("text",{x:32,y:0,textAnchor:"middle",dominantBaseline:"central",fill:"white",style:{fontSize:10,fontWeight:600,pointerEvents:"none"},children:"Add Step"})]})]})]})},_e=({id:t,source:s,target:c,sourceX:p,sourceY:d,targetX:o,targetY:g,style:n={},markerEnd:i,data:f})=>{const u=(f==null?void 0:f.verticalRouting)??!1,h=30,b=u?(()=>{const S=g-h;return`M ${p},${S} L ${o},${S} L ${o},${g}`})():(()=>{const S=d+30;return`M ${p},${d} L ${p},${S} L ${o},${S} L ${o},${g}`})(),x=n.stroke||"#d1d5db",l=f==null?void 0:f.label,v=(f==null?void 0:f.isFirst)??!1,m=f==null?void 0:f.onAddStepClick,w=u?g-h:d+30,N=p+(o-p)*(u?.25:.35),D=p+(o-p)*(u?.65:.7),E=w,I=S=>{S.stopPropagation(),m&&m(s,{edgeId:t,nodeId:s,sourceNodeId:s,targetNodeId:c,position:"between",referenceNodeId:s,filterId:f==null?void 0:f.filterId,branch:f==null?void 0:f.branch})},C=11.5,T=6;return e.jsxs("g",{children:[e.jsx("path",{id:t,d:b,fill:"none",stroke:x,strokeWidth:1.5,markerEnd:i}),l&&!u&&e.jsx("g",{transform:`translate(${N}, ${E})`,children:(()=>{const S=Math.max(44,l.length*7+20);return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:-S/2,y:-11,width:S,height:22,rx:11,fill:v?"#e8f5e9":"#ffebee",stroke:v?"#81c784":"#e57373",strokeWidth:1}),e.jsx("text",{x:0,y:4,textAnchor:"middle",fontSize:10,fontWeight:600,fill:v?"#2e7d32":"#c62828",style:{fontFamily:"sans-serif",pointerEvents:"none"},children:l})]})})()}),m&&e.jsxs("g",{transform:`translate(${D}, ${E})`,onClick:I,style:{cursor:"pointer",pointerEvents:"all"},className:"nodrag nopan edge-plus-svg",children:[e.jsx("circle",{r:C,className:"edge-plus-circle"}),e.jsx("line",{x1:0,y1:-T,x2:0,y2:T,strokeWidth:2,strokeLinecap:"round",className:"plus-line"}),e.jsx("line",{x1:-T,y1:0,x2:T,y2:0,strokeWidth:2,strokeLinecap:"round",className:"plus-line"})]})]})};exports.ActionNode=ce;exports.AddTriggerNode=ie;exports.ApprovalNode=fe;exports.DelayNode=ae;exports.EdgeWithPlusLabel=Le;exports.EndNode=se;exports.FilterNode=de;exports.GatewayBranchEdge=_e;exports.LabelPlusEdge=Oe;exports.NotificationNode=pe;exports.PlainEdge=$e;exports.PlusEdge=Fe;exports.RestApiNode=ge;exports.StartNode=ne;exports.TriggerNode=le;exports.WebhookTriggerNode=xe;exports.WorkflowCanvasContext=te;exports.builtInNodeTypes=Re;
|
|
2
|
-
//# sourceMappingURL=GatewayBranchEdge-CMY30xhz.js.map
|