@notmrabhi/flowforge 0.1.38 → 0.1.40

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.
Files changed (40) hide show
  1. package/dist/GatewayBranchEdge-Bnql8DmQ.js +1406 -0
  2. package/dist/GatewayBranchEdge-Bnql8DmQ.js.map +1 -0
  3. package/dist/GatewayBranchEdge-oAXh7nSf.js +2 -0
  4. package/dist/GatewayBranchEdge-oAXh7nSf.js.map +1 -0
  5. package/dist/canvas.cjs +1 -1
  6. package/dist/canvas.js +2 -2
  7. package/dist/core.cjs +1 -1
  8. package/dist/core.js +23 -22
  9. package/dist/core.js.map +1 -1
  10. package/dist/defaultUi.cjs +1 -1
  11. package/dist/defaultUi.js +1 -1
  12. package/dist/index-B6xrei80.js +87 -0
  13. package/dist/index-B6xrei80.js.map +1 -0
  14. package/dist/index-BrJBVztu.js +2 -0
  15. package/dist/index-BrJBVztu.js.map +1 -0
  16. package/dist/index-CXmgrKoe.js +2 -0
  17. package/dist/index-CXmgrKoe.js.map +1 -0
  18. package/dist/index-Dcur-XJ9.js +36 -0
  19. package/dist/index-Dcur-XJ9.js.map +1 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.js +54 -53
  23. package/dist/index.js.map +1 -1
  24. package/dist/nodeRegistry.cjs +1 -1
  25. package/dist/nodeRegistry.cjs.map +1 -1
  26. package/dist/nodeRegistry.js +23 -543
  27. package/dist/nodeRegistry.js.map +1 -1
  28. package/dist/subWorkflowDescriptor-DYOYgBzX.js +535 -0
  29. package/dist/subWorkflowDescriptor-DYOYgBzX.js.map +1 -0
  30. package/dist/subWorkflowDescriptor-JDKi2INh.js +2 -0
  31. package/dist/subWorkflowDescriptor-JDKi2INh.js.map +1 -0
  32. package/dist/{templateSkeletons-DyOZ6gBc.js → templateSkeletons-Dw-KGxIV.js} +2 -2
  33. package/dist/{templateSkeletons-DyOZ6gBc.js.map → templateSkeletons-Dw-KGxIV.js.map} +1 -1
  34. package/dist/{templateSkeletons-DVeGC-Wx.js → templateSkeletons-nP4G40Gx.js} +4 -4
  35. package/dist/{templateSkeletons-DVeGC-Wx.js.map → templateSkeletons-nP4G40Gx.js.map} +1 -1
  36. package/package.json +1 -1
  37. package/dist/GatewayBranchEdge-DNSPjIZw.js +0 -2
  38. package/dist/GatewayBranchEdge-DNSPjIZw.js.map +0 -1
  39. package/dist/GatewayBranchEdge-Diid9GtB.js +0 -1267
  40. package/dist/GatewayBranchEdge-Diid9GtB.js.map +0 -1
@@ -0,0 +1,1406 @@
1
+ import { jsxs as t, jsx as e, Fragment as B } from "react/jsx-runtime";
2
+ import { Handle as x, Position as N, getStraightPath as H, BaseEdge as G } from "reactflow";
3
+ import { Tooltip as $, Chip as q } from "@mui/material";
4
+ import { GrTrigger as xe } from "react-icons/gr";
5
+ import { createContext as Ne, useContext as ke } from "react";
6
+ import { d as ve } from "./messages-CO299wPN.js";
7
+ import { MdOutlineModeEdit as D, MdInfoOutline as j, MdInput as fe, MdDeleteOutline as F, MdCheckCircle as we, MdPeople as Se, MdSchedule as Ce, MdWebhook as de, MdNotifications as U, MdSms as Ee, MdEmail as Te, MdContentCopy as ze, MdHttp as Ie, MdCallSplit as Pe, MdAccountTree as Ae, MdOpenInNew as De } from "react-icons/md";
8
+ import { FaCheckCircle as ae, FaTimesCircle as pe } from "react-icons/fa";
9
+ import { FiFilter as Re } from "react-icons/fi";
10
+ import { a as M, H as Le, B as Y } from "./canvasTokens-CAD6G24b.js";
11
+ const We = Ne({
12
+ onEditNode: () => {
13
+ },
14
+ onDeleteNode: () => {
15
+ },
16
+ onAddStep: () => {
17
+ },
18
+ onClickAddTrigger: () => {
19
+ },
20
+ messages: ve,
21
+ nodeRegistry: null,
22
+ nodeBody: "full"
23
+ }), I = () => ke(We), Fe = () => /* @__PURE__ */ t("div", { style: { width: 350, display: "flex", justifyContent: "center" }, children: [
24
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0, left: "50%" } }),
25
+ /* @__PURE__ */ e("div", { style: { padding: "8px 28px", borderRadius: 999, background: "#f5f5f5", border: "1.5px solid #bdbdbd", fontSize: 13, fontWeight: 500, color: "#424242", userSelect: "none" }, children: "Start" })
26
+ ] }), $e = () => /* @__PURE__ */ t("div", { style: { width: 350, display: "flex", justifyContent: "center" }, children: [
27
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0, left: "50%" } }),
28
+ /* @__PURE__ */ e("div", { style: { padding: "8px 28px", borderRadius: 999, background: "#f5f5f5", border: "1.5px solid #bdbdbd", fontSize: 13, fontWeight: 500, color: "#424242", userSelect: "none" }, children: "End" })
29
+ ] }), Be = () => {
30
+ const { onClickAddTrigger: n, messages: i } = I();
31
+ return /* @__PURE__ */ t("div", { style: { width: 350, display: "flex", justifyContent: "center" }, children: [
32
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0, left: "50%" } }),
33
+ /* @__PURE__ */ e($, { title: i.addTriggerTooltip, placement: "top", arrow: !0, children: /* @__PURE__ */ t(
34
+ "div",
35
+ {
36
+ onClick: n,
37
+ role: "button",
38
+ tabIndex: 0,
39
+ onKeyDown: (f) => {
40
+ f.key === "Enter" && n();
41
+ },
42
+ style: { padding: "10px 24px", borderRadius: 8, border: "1.5px dashed #d0d0d0", background: "#fff", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", gap: 8 },
43
+ children: [
44
+ /* @__PURE__ */ e(xe, { size: 16 }),
45
+ /* @__PURE__ */ e("span", { className: "ff-text-black", style: { fontSize: 13 }, "data-testid": "add-trigger-btn-text", children: i.addTriggerButton })
46
+ ]
47
+ }
48
+ ) }),
49
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0, left: "50%" } })
50
+ ] });
51
+ }, je = ({ id: n }) => {
52
+ const { onAddStep: i } = I();
53
+ return /* @__PURE__ */ t(
54
+ "div",
55
+ {
56
+ onClick: () => i(n),
57
+ role: "button",
58
+ tabIndex: 0,
59
+ onKeyDown: (f) => {
60
+ f.key === "Enter" && i(n);
61
+ },
62
+ 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" },
63
+ children: [
64
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
65
+ "+",
66
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
67
+ ]
68
+ }
69
+ );
70
+ };
71
+ function ge(n) {
72
+ return n ? n.replace(/[_-]+/g, " ").toLowerCase().replace(/\b\w/g, (i) => i.toUpperCase()) : "";
73
+ }
74
+ function Me(n) {
75
+ if (typeof n != "string" && n.label) return n.label;
76
+ const i = typeof n == "string" ? n : n.value ?? "";
77
+ return ge(i);
78
+ }
79
+ const _e = ({ data: n }) => {
80
+ const { onClickAddTrigger: i } = I(), {
81
+ type: f,
82
+ eventType: p,
83
+ sources: s,
84
+ label: r,
85
+ source: h,
86
+ previewWorkflow: o,
87
+ executionStatus: l,
88
+ infoText: d = "This node decides the flow trigger type and configuration."
89
+ } = n ?? {}, u = (m) => {
90
+ m == null || m.stopPropagation(), i();
91
+ }, y = Array.isArray(s) && s.length > 0, k = !!(r || h), g = f === "scheduler" ? "Scheduler Trigger" : f === "event" || y || k ? "Event Trigger Source" : "Select Trigger", c = (() => {
92
+ if (f === "scheduler")
93
+ return /* @__PURE__ */ e("span", { children: "Scheduler to be configured" });
94
+ if (f === "event" || y) {
95
+ const m = r || ge(p);
96
+ return /* @__PURE__ */ t("div", { children: [
97
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center", children: [
98
+ /* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: m }),
99
+ /* @__PURE__ */ e("span", { className: "ff-ms-2 ff-text-muted", style: { fontSize: 12 }, children: "via" })
100
+ ] }),
101
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-flex-wrap ff-mt-2", style: { gap: 4 }, children: y ? s.map((C, v) => /* @__PURE__ */ e(
102
+ q,
103
+ {
104
+ label: Me(C),
105
+ variant: "outlined",
106
+ size: "small",
107
+ className: "ff-text-dark"
108
+ },
109
+ v
110
+ )) : /* @__PURE__ */ e("span", { className: "ff-text-muted", style: { fontSize: 12 }, children: "No source selected" }) })
111
+ ] });
112
+ }
113
+ return k ? /* @__PURE__ */ t("div", { className: "ff-d-flex ff-flex-wrap ff-align-items-center", style: { gap: 6 }, children: [
114
+ r && /* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: r }),
115
+ h && /* @__PURE__ */ e(q, { label: h, variant: "outlined", size: "small" })
116
+ ] }) : /* @__PURE__ */ e(
117
+ "span",
118
+ {
119
+ role: "button",
120
+ tabIndex: 0,
121
+ onClick: u,
122
+ onKeyDown: (m) => {
123
+ (m.key === "Enter" || m.key === " ") && u(m);
124
+ },
125
+ style: { cursor: "pointer", color: "#1e88e5" },
126
+ children: "Click to select a trigger to start your workflow"
127
+ }
128
+ );
129
+ })(), S = l ? /* @__PURE__ */ t(B, { children: [
130
+ l.status === "success" && /* @__PURE__ */ e(ae, { size: 16, color: "#1DBF60", style: { marginRight: 8 } }),
131
+ l.status === "failed" && /* @__PURE__ */ e(pe, { size: 16, color: "#f44336", style: { marginRight: 8 } })
132
+ ] }) : /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center", children: [
133
+ !o && /* @__PURE__ */ e(
134
+ "div",
135
+ {
136
+ role: "button",
137
+ tabIndex: 0,
138
+ onClick: u,
139
+ onKeyDown: (m) => {
140
+ (m.key === "Enter" || m.key === " ") && u(m);
141
+ },
142
+ className: "ff-me-2",
143
+ style: { cursor: "pointer", color: "#212121" },
144
+ "aria-label": "Edit trigger",
145
+ children: /* @__PURE__ */ e(D, { size: 16 })
146
+ }
147
+ ),
148
+ /* @__PURE__ */ e($, { title: /* @__PURE__ */ e("div", { children: d }), placement: "right", arrow: !0, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(j, { color: "gray", size: 16 }) }) })
149
+ ] });
150
+ return /* @__PURE__ */ t("div", { style: { width: 350 }, children: [
151
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
152
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #a5d6a7", borderRadius: 8, background: "#fff", overflow: "hidden" }, children: [
153
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "12px 14px" }, children: [
154
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
155
+ /* @__PURE__ */ e(
156
+ "div",
157
+ {
158
+ style: {
159
+ width: 28,
160
+ height: 28,
161
+ borderRadius: 6,
162
+ background: "rgba(76,175,80,0.1)",
163
+ display: "flex",
164
+ alignItems: "center",
165
+ justifyContent: "center",
166
+ flexShrink: 0
167
+ },
168
+ children: /* @__PURE__ */ e(fe, { size: 16, color: "#388e3c" })
169
+ }
170
+ ),
171
+ /* @__PURE__ */ e("span", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: g })
172
+ ] }),
173
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center", children: S })
174
+ ] }),
175
+ /* @__PURE__ */ e(
176
+ "div",
177
+ {
178
+ style: {
179
+ background: "#f5f5f5",
180
+ fontSize: 12,
181
+ color: "#212121",
182
+ padding: "14px 16px",
183
+ margin: "0 10px 12px",
184
+ borderRadius: 6,
185
+ textAlign: "left"
186
+ },
187
+ children: c
188
+ }
189
+ )
190
+ ] }),
191
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 }, id: "1" })
192
+ ] });
193
+ };
194
+ function Ke(n) {
195
+ return n ? n === "END_USER_CREATION" ? "New User Registration" : n === "END_USER_UPDATION" ? "On User Update" : n.replace(/[_-]+/g, " ").replace(/\b\w/g, (i) => i.toUpperCase()) : "";
196
+ }
197
+ function Oe(n) {
198
+ const i = typeof n == "string" ? n : n.value ?? "";
199
+ return i === "SIGNUP_FLOW" ? "User Self-Registration" : i === "ADMIN_CREATION_FLOW" ? "Create User via Admin Portal" : i === "SHEDULAR" || i === "SCHEDULER" ? "Scheduler" : typeof n != "string" && n.label ? n.label : i.replace(/[_-]+/g, " ").replace(/\b\w/g, (f) => f.toUpperCase());
200
+ }
201
+ const Ue = ({ data: n }) => {
202
+ const {
203
+ header: i = "Event",
204
+ title: f,
205
+ eventType: p,
206
+ sources: s,
207
+ executionStatus: r,
208
+ infoText: h = "This event is raised by the system. It cannot be configured."
209
+ } = n ?? {}, o = f ?? Ke(p) ?? "—";
210
+ return /* @__PURE__ */ t("div", { style: { width: 350 }, children: [
211
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
212
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #a5d6a7", borderRadius: 8, background: "#fff", overflow: "hidden" }, children: [
213
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "12px 14px" }, children: [
214
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
215
+ /* @__PURE__ */ e(
216
+ "div",
217
+ {
218
+ style: {
219
+ width: 28,
220
+ height: 28,
221
+ borderRadius: 6,
222
+ background: "rgba(76,175,80,0.1)",
223
+ display: "flex",
224
+ alignItems: "center",
225
+ justifyContent: "center",
226
+ flexShrink: 0
227
+ },
228
+ children: /* @__PURE__ */ e(fe, { size: 16, color: "#388e3c" })
229
+ }
230
+ ),
231
+ /* @__PURE__ */ e("span", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: i })
232
+ ] }),
233
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center", children: [
234
+ (r == null ? void 0 : r.status) === "success" && /* @__PURE__ */ e(ae, { size: 16, color: "#1DBF60", style: { marginRight: 8 } }),
235
+ (r == null ? void 0 : r.status) === "failed" && /* @__PURE__ */ e(pe, { size: 16, color: "#f44336", style: { marginRight: 8 } }),
236
+ !r && /* @__PURE__ */ e($, { title: /* @__PURE__ */ e("div", { children: h }), placement: "right", arrow: !0, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(j, { color: "gray", size: 16 }) }) })
237
+ ] })
238
+ ] }),
239
+ /* @__PURE__ */ t(
240
+ "div",
241
+ {
242
+ style: {
243
+ background: "#f5f5f5",
244
+ fontSize: 13,
245
+ color: "#212121",
246
+ padding: "14px 16px",
247
+ margin: "0 10px 12px",
248
+ borderRadius: 6,
249
+ textAlign: "left"
250
+ },
251
+ children: [
252
+ /* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: o }),
253
+ Array.isArray(s) && s.length > 0 && /* @__PURE__ */ t(B, { children: [
254
+ /* @__PURE__ */ e("div", { className: "ff-text-muted", style: { fontSize: 12, marginTop: 4 }, children: "via" }),
255
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-flex-wrap ff-mt-1", style: { gap: 4 }, children: s.map((l, d) => /* @__PURE__ */ e(
256
+ q,
257
+ {
258
+ label: Oe(l),
259
+ variant: "outlined",
260
+ size: "small",
261
+ className: "ff-text-dark"
262
+ },
263
+ d
264
+ )) })
265
+ ] })
266
+ ]
267
+ }
268
+ )
269
+ ] }),
270
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 }, id: "1" })
271
+ ] });
272
+ }, he = ({ rail: n, cardWidth: i }) => {
273
+ const f = i / 2;
274
+ i / 2 + n.indent;
275
+ const p = "var(--ff-edge-color, #b0bec5)";
276
+ return /* @__PURE__ */ t(
277
+ "svg",
278
+ {
279
+ width: i + n.indent + 200,
280
+ height: n.height,
281
+ style: { position: "absolute", left: 0, top: "100%", pointerEvents: "none", overflow: "visible" },
282
+ children: [
283
+ /* @__PURE__ */ e("line", { x1: f, y1: 0, x2: f, y2: n.height, stroke: p, strokeWidth: 1.5 }),
284
+ n.branches.map((s, r) => {
285
+ const h = s.y;
286
+ return /* @__PURE__ */ t("g", { transform: `translate(0, ${h})`, children: [
287
+ /* @__PURE__ */ e(
288
+ "rect",
289
+ {
290
+ x: f - 5,
291
+ y: -5,
292
+ width: 10,
293
+ height: 10,
294
+ fill: "#fff",
295
+ stroke: p,
296
+ strokeWidth: 1.5,
297
+ transform: `rotate(45, ${f}, 0)`
298
+ }
299
+ ),
300
+ /* @__PURE__ */ e(
301
+ "text",
302
+ {
303
+ x: f + 14,
304
+ y: 4,
305
+ fontSize: 12,
306
+ fontWeight: 500,
307
+ fill: "var(--ff-text, #212121)",
308
+ style: { fontFamily: "sans-serif" },
309
+ children: s.label
310
+ }
311
+ )
312
+ ] }, r);
313
+ })
314
+ ]
315
+ }
316
+ );
317
+ }, He = ({ id: n, data: i }) => {
318
+ const { onEditNode: f, onDeleteNode: p } = I(), { conditions: s = [], infoText: r = "Filter conditions applied to workflow data", _branchRail: h } = i;
319
+ return /* @__PURE__ */ t("div", { style: { width: 350, position: "relative" }, children: [
320
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
321
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #ffe082", borderRadius: 8, background: "#fff" }, children: [
322
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
323
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center", children: [
324
+ /* @__PURE__ */ e("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: /* @__PURE__ */ e(Re, { className: "ff-text-warning", size: 16 }) }),
325
+ /* @__PURE__ */ e("span", { className: "ff-ms-2 ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "Filter" })
326
+ ] }),
327
+ /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
328
+ /* @__PURE__ */ e(
329
+ "div",
330
+ {
331
+ role: "button",
332
+ tabIndex: 0,
333
+ onClick: (o) => {
334
+ o.stopPropagation(), f(n);
335
+ },
336
+ onKeyDown: (o) => {
337
+ o.key === "Enter" && (o.stopPropagation(), f(n));
338
+ },
339
+ children: /* @__PURE__ */ e(D, { size: 16 })
340
+ }
341
+ ),
342
+ /* @__PURE__ */ e(
343
+ "div",
344
+ {
345
+ className: "ff-ms-2",
346
+ role: "button",
347
+ tabIndex: 0,
348
+ onClick: (o) => {
349
+ o.stopPropagation(), p(n);
350
+ },
351
+ onKeyDown: (o) => {
352
+ o.key === "Enter" && (o.stopPropagation(), p(n));
353
+ },
354
+ children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
355
+ }
356
+ ),
357
+ /* @__PURE__ */ e($, { title: r, placement: "right", arrow: !0, children: /* @__PURE__ */ e("div", { className: "ff-ms-2", children: /* @__PURE__ */ e(j, { color: "gray", size: 16 }) }) })
358
+ ] })
359
+ ] }),
360
+ /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: s.length === 0 ? /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "No conditions configured" }) : s.map((o, l) => /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-mb-1", children: [
361
+ /* @__PURE__ */ e("p", { className: "ff-m-0 ff-fw-bold ff-me-1 ff-text-truncate", style: { maxWidth: 100 }, title: o.field, children: o.field }),
362
+ /* @__PURE__ */ e("span", { className: "ff-text-muted", children: o.operator }),
363
+ /* @__PURE__ */ e("p", { className: "ff-text-dark ff-text-truncate ff-mx-1 ff-m-0", title: o.value, children: o.value }),
364
+ l < s.length - 1 && /* @__PURE__ */ e("p", { className: "ff-bg-primary ff-text-white ff-fw-bold ff-ms-1 ff-px-1 ff-rounded-1 ff-m-0", children: o.logicalOperator })
365
+ ] }, l)) })
366
+ ] }),
367
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } }),
368
+ h && /* @__PURE__ */ e(he, { rail: h, cardWidth: 350 })
369
+ ] });
370
+ }, Ge = ({ id: n, data: i }) => {
371
+ const { onEditNode: f, onDeleteNode: p, nodeRegistry: s, nodeBody: r = "full" } = I(), { title: h = "Task", descriptorType: o, groupBlocks: l, groups: d, roles: u, groupId: y, roleId: k, infoText: g = "" } = i, c = o ? s == null ? void 0 : s.forType(o) : void 0, S = c == null ? void 0 : c.icon, m = (a) => a == null ? "" : typeof a == "string" ? a : typeof a == "object" && "label" in a ? String(a.label) : String(a), C = (a) => Array.isArray(a) ? a.map(m).filter(Boolean) : a != null && a !== "" ? [m(a)] : [], v = /* @__PURE__ */ new Set([
372
+ "descriptorType",
373
+ "title",
374
+ "header",
375
+ "icon",
376
+ "infoText",
377
+ "label",
378
+ // FlowForm's condition-builder sidecar — rendered separately below as
379
+ // proper "When ..." rows, not as a JSON dump in the generic body.
380
+ "conditionConfig",
381
+ "_conditionConfig"
382
+ ]), R = c == null ? void 0 : c.formSchema, z = (a) => {
383
+ if (Array.isArray(R)) {
384
+ const b = R.find((w) => (w == null ? void 0 : w.id) === a || (w == null ? void 0 : w.name) === a);
385
+ if (b != null && b.label) return b.label;
386
+ }
387
+ return a.replace(/[_-]+/g, " ").replace(/\b\w/g, (b) => b.toUpperCase());
388
+ }, P = (a) => {
389
+ if (Array.isArray(a)) {
390
+ const b = a.map(
391
+ (W) => typeof W == "object" && W ? W.label ?? W.name ?? W.value ?? "" : String(W)
392
+ ).filter(Boolean), w = b.slice(0, 3).join(", ");
393
+ return b.length > 3 ? `${w} +${b.length - 3}` : w;
394
+ }
395
+ if (a && typeof a == "object") {
396
+ const b = a;
397
+ return b.label ?? b.name ?? b.value ?? JSON.stringify(a);
398
+ }
399
+ return String(a);
400
+ }, A = Object.entries(i || {}).filter(
401
+ ([a, b]) => !v.has(a) && b !== "" && b !== null && b !== void 0 && !(Array.isArray(b) && b.length === 0)
402
+ ), T = (i == null ? void 0 : i.conditionConfig) ?? (i == null ? void 0 : i._conditionConfig), E = T && typeof T == "object" ? Object.entries(T).filter(([, a]) => Array.isArray(a) && a.length > 0).map(([a, b]) => ({
403
+ path: a,
404
+ entries: b
405
+ })) : [], L = (l == null ? void 0 : l.flatMap((a) => a.groups ?? [])) ?? [...C(d), ...C(u), ...C(y), ...C(k)], V = L.length > 0;
406
+ return /* @__PURE__ */ t("div", { style: { width: 350 }, children: [
407
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
408
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
409
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
410
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
411
+ S && /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center" }, children: S }),
412
+ /* @__PURE__ */ e("span", { className: "ff-text-dark", style: { fontSize: 14, fontWeight: 500 }, children: h })
413
+ ] }),
414
+ /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
415
+ /* @__PURE__ */ e(
416
+ "div",
417
+ {
418
+ role: "button",
419
+ tabIndex: 0,
420
+ onClick: (a) => {
421
+ a.stopPropagation(), f(n);
422
+ },
423
+ onKeyDown: (a) => {
424
+ a.key === "Enter" && (a.stopPropagation(), f(n));
425
+ },
426
+ children: /* @__PURE__ */ e(D, { size: 16 })
427
+ }
428
+ ),
429
+ /* @__PURE__ */ e(
430
+ "div",
431
+ {
432
+ className: "ff-ms-2",
433
+ role: "button",
434
+ tabIndex: 0,
435
+ onClick: (a) => {
436
+ a.stopPropagation(), p(n);
437
+ },
438
+ onKeyDown: (a) => {
439
+ a.key === "Enter" && (a.stopPropagation(), p(n));
440
+ },
441
+ children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
442
+ }
443
+ ),
444
+ g && /* @__PURE__ */ e($, { title: g, placement: "right", arrow: !0, children: /* @__PURE__ */ e("div", { className: "ff-ms-2", children: /* @__PURE__ */ e(j, { color: "gray", size: 16 }) }) })
445
+ ] })
446
+ ] }),
447
+ r !== "title-only" && // Body container matches IAM ActionNodeLabel: 12px text, left-aligned.
448
+ // We use a single bg-light rounded pill that wraps everything, the
449
+ // same way IAM's groupBlocks each render as bg-light rounded my-2 p-2.
450
+ /* @__PURE__ */ e(
451
+ "div",
452
+ {
453
+ style: {
454
+ margin: "0 10px 12px",
455
+ padding: 8,
456
+ borderRadius: 4,
457
+ background: "#f8f9fa",
458
+ fontSize: 12,
459
+ textAlign: "left",
460
+ color: "#212529"
461
+ },
462
+ children: c != null && c.renderNode ? c.renderNode(i) : A.length > 0 || E.length > 0 ? /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
463
+ A.slice(0, 4).map(([a, b]) => /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "baseline", gap: 4 }, children: [
464
+ /* @__PURE__ */ t("span", { style: { fontWeight: 700, color: "#212529", flexShrink: 0 }, children: [
465
+ z(a),
466
+ ":"
467
+ ] }),
468
+ /* @__PURE__ */ e(
469
+ "span",
470
+ {
471
+ title: P(b),
472
+ style: {
473
+ color: "#212529",
474
+ overflow: "hidden",
475
+ textOverflow: "ellipsis",
476
+ whiteSpace: "nowrap",
477
+ minWidth: 0,
478
+ flex: 1
479
+ },
480
+ children: P(b)
481
+ }
482
+ )
483
+ ] }, a)),
484
+ A.length > 4 && /* @__PURE__ */ t("div", { style: { color: "#6c757d", fontSize: 11 }, children: [
485
+ "+",
486
+ A.length - 4,
487
+ " more"
488
+ ] }),
489
+ E.map((a, b) => /* @__PURE__ */ t("div", { style: { marginTop: 4 }, children: [
490
+ /* @__PURE__ */ e("div", { style: { color: "#6c757d", marginBottom: 2 }, children: "When" }),
491
+ a.entries.slice(0, 3).map((w, W, ye) => {
492
+ const ue = w.fieldLabel || w.field || "", me = w.operator || "", Z = w.value == null ? "" : typeof w.value == "object" ? P(w.value) : String(w.value), be = w.connector || "and";
493
+ return /* @__PURE__ */ t(
494
+ "div",
495
+ {
496
+ style: {
497
+ display: "flex",
498
+ alignItems: "center",
499
+ flexWrap: "wrap",
500
+ marginTop: 2
501
+ },
502
+ children: [
503
+ /* @__PURE__ */ e("span", { style: { fontWeight: 700, marginRight: 4, color: "#212529" }, children: ue }),
504
+ /* @__PURE__ */ e("span", { style: { color: "#6c757d", marginRight: 4 }, children: me }),
505
+ /* @__PURE__ */ e("span", { style: { color: "#212529", marginRight: 4 }, title: Z, children: Z }),
506
+ W < ye.length - 1 && /* @__PURE__ */ e(
507
+ "span",
508
+ {
509
+ style: {
510
+ background: "#0d6efd",
511
+ color: "#fff",
512
+ fontWeight: 700,
513
+ marginLeft: 4,
514
+ padding: "0 4px",
515
+ borderRadius: 2,
516
+ textTransform: "uppercase",
517
+ fontSize: 10
518
+ },
519
+ children: be
520
+ }
521
+ )
522
+ ]
523
+ },
524
+ W
525
+ );
526
+ }),
527
+ a.entries.length > 3 && /* @__PURE__ */ t("div", { style: { color: "#6c757d", fontSize: 11 }, children: [
528
+ "+",
529
+ a.entries.length - 3,
530
+ " more"
531
+ ] })
532
+ ] }, `cond-${b}`))
533
+ ] }) : V ? (
534
+ // Dark badges matching IAM's bg-dark text-white py-1 px-2 rounded
535
+ /* @__PURE__ */ e("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: L.map((a, b) => /* @__PURE__ */ e(
536
+ "span",
537
+ {
538
+ title: a,
539
+ style: {
540
+ background: "#212529",
541
+ color: "#fff",
542
+ padding: "4px 8px",
543
+ borderRadius: 4,
544
+ fontSize: 11
545
+ },
546
+ children: a
547
+ },
548
+ b
549
+ )) })
550
+ ) : /* @__PURE__ */ e("span", { style: { color: "#6c757d" }, children: "Click edit to configure" })
551
+ }
552
+ )
553
+ ] }),
554
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
555
+ ] });
556
+ }, J = 5, Ve = ({ id: n, data: i }) => {
557
+ const { onEditNode: f, onDeleteNode: p } = I(), { approvalData: s, isPreview: r = !1, _branchRail: h } = i, o = (s == null ? void 0 : s.policy) ?? {}, l = o.stages ?? [], d = l.length, u = l.slice(0, J), y = d - J, k = o.name ?? o.policyName ?? "Untitled Policy";
558
+ return /* @__PURE__ */ t("div", { style: { width: 350, position: "relative" }, children: [
559
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
560
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #ffe082", borderRadius: 8, background: "#fff" }, children: [
561
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
562
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
563
+ /* @__PURE__ */ e("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: /* @__PURE__ */ e(we, { style: { color: "#FBC02D" }, size: 16 }) }),
564
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "Approval Policy" })
565
+ ] }),
566
+ /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
567
+ !r && /* @__PURE__ */ e(
568
+ "div",
569
+ {
570
+ role: "button",
571
+ tabIndex: 0,
572
+ style: { cursor: "pointer" },
573
+ onClick: (g) => {
574
+ g.stopPropagation(), f(n);
575
+ },
576
+ onKeyDown: (g) => {
577
+ g.key === "Enter" && (g.stopPropagation(), f(n));
578
+ },
579
+ children: /* @__PURE__ */ e(D, { size: 16, className: "ff-text-secondary" })
580
+ }
581
+ ),
582
+ !r && /* @__PURE__ */ e(
583
+ "div",
584
+ {
585
+ className: "ff-ms-2",
586
+ role: "button",
587
+ tabIndex: 0,
588
+ style: { cursor: "pointer" },
589
+ onClick: (g) => {
590
+ g.stopPropagation(), p(n);
591
+ },
592
+ onKeyDown: (g) => {
593
+ g.key === "Enter" && (g.stopPropagation(), p(n));
594
+ },
595
+ children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
596
+ }
597
+ ),
598
+ /* @__PURE__ */ e($, { title: "This approval policy determines who must approve a request before the workflow continues.", arrow: !0, placement: "right", children: /* @__PURE__ */ e("span", { className: "ff-ms-2 ff-d-inline-flex", children: /* @__PURE__ */ e(j, { color: "gray", size: 16 }) }) })
599
+ ] })
600
+ ] }),
601
+ /* @__PURE__ */ t("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#FCFCFC" }, children: [
602
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-start ff-align-items-center ff-mb-2", children: [
603
+ /* @__PURE__ */ e("h6", { className: "ff-text-dark ff-mb-0 ff-text-truncate ff-flex-grow-1 ff-me-2", style: { fontSize: 13, fontWeight: 700 }, title: k, children: k }),
604
+ /* @__PURE__ */ t("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: [
605
+ d,
606
+ " Stage",
607
+ d !== 1 ? "s" : ""
608
+ ] })
609
+ ] }),
610
+ l.length > 0 ? /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
611
+ u.map((g, c) => {
612
+ var P, A, T;
613
+ const S = ((P = g.stageName) == null ? void 0 : P.trim()) || `Stage ${c + 1}`, m = Array.isArray(g.userIds) ? g.userIds.length : 0, C = ((A = g.groupName) == null ? void 0 : A.trim()) ?? "", v = ((T = g.roleName) == null ? void 0 : T.trim()) ?? "", R = m > 0 || C || v;
614
+ let z = "Not configured";
615
+ return C ? z = `Group: ${C}` : v ? z = `Role: ${v}` : m > 0 && (z = `${m} approver${m !== 1 ? "s" : ""}`), /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
616
+ /* @__PURE__ */ e("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: c + 1 }),
617
+ /* @__PURE__ */ t("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: [
618
+ /* @__PURE__ */ e("span", { style: { fontSize: 12, fontWeight: 700, color: "#212121" }, children: S }),
619
+ /* @__PURE__ */ t("span", { className: `ff-d-flex ff-align-items-center ff-gap-1 ${R ? "ff-text-dark" : "ff-text-muted"}`, style: { fontSize: 12 }, children: [
620
+ /* @__PURE__ */ e(Se, { size: 16, className: "ff-flex-shrink-0", style: { color: R ? "#5D4037" : "#9E9E9E" } }),
621
+ z
622
+ ] })
623
+ ] })
624
+ ] }, c);
625
+ }),
626
+ y > 0 && /* @__PURE__ */ t(
627
+ "div",
628
+ {
629
+ className: "ff-text-center ff-fw-bold ff-py-2 ff-border ff-rounded",
630
+ style: { fontSize: 11, color: "#1976d2", borderColor: "#FEE79A", background: "#FFFDE7", borderStyle: "dashed", cursor: r ? "default" : "pointer" },
631
+ role: r ? void 0 : "button",
632
+ tabIndex: r ? void 0 : 0,
633
+ onClick: (g) => {
634
+ r || (g.stopPropagation(), f(n));
635
+ },
636
+ onKeyDown: (g) => {
637
+ r || g.key !== "Enter" || (g.stopPropagation(), f(n));
638
+ },
639
+ children: [
640
+ "+ ",
641
+ y,
642
+ " More Stage",
643
+ y > 1 ? "s" : ""
644
+ ]
645
+ }
646
+ )
647
+ ] }) : /* @__PURE__ */ e("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" })
648
+ ] })
649
+ ] }),
650
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } }),
651
+ h && /* @__PURE__ */ e(he, { rail: h, cardWidth: 350 })
652
+ ] });
653
+ }, qe = ({ id: n, data: i }) => {
654
+ const { onEditNode: f, onDeleteNode: p } = I(), { duration: s, unit: r } = i, h = s != null && r, o = h ? `Wait ${s} ${r}` : "Not configured";
655
+ return /* @__PURE__ */ t("div", { style: { width: 350 }, children: [
656
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
657
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
658
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1", children: [
659
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
660
+ /* @__PURE__ */ e("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: /* @__PURE__ */ e(Ce, { size: 16, color: "#1976d2" }) }),
661
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "Delay" })
662
+ ] }),
663
+ /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
664
+ /* @__PURE__ */ e(
665
+ "div",
666
+ {
667
+ role: "button",
668
+ tabIndex: 0,
669
+ onClick: (l) => {
670
+ l.stopPropagation(), f(n);
671
+ },
672
+ onKeyDown: (l) => {
673
+ l.key === "Enter" && (l.stopPropagation(), f(n));
674
+ },
675
+ children: /* @__PURE__ */ e(D, { size: 16 })
676
+ }
677
+ ),
678
+ /* @__PURE__ */ e(
679
+ "div",
680
+ {
681
+ className: "ff-ms-2",
682
+ role: "button",
683
+ tabIndex: 0,
684
+ onClick: (l) => {
685
+ l.stopPropagation(), p(n);
686
+ },
687
+ onKeyDown: (l) => {
688
+ l.key === "Enter" && (l.stopPropagation(), p(n));
689
+ },
690
+ children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
691
+ }
692
+ )
693
+ ] })
694
+ ] }),
695
+ /* @__PURE__ */ e("div", { className: "ff-mx-2 ff-mb-2 ff-p-2 ff-rounded", style: { background: "#fafafa", fontSize: 12 }, children: /* @__PURE__ */ e("span", { className: h ? "ff-text-dark ff-fw-medium" : "ff-text-muted", children: o }) })
696
+ ] }),
697
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
698
+ ] });
699
+ }, Q = {
700
+ email: { label: "Email", bg: "#e3f2fd", color: "#1565c0", iconType: Te },
701
+ slack: { label: "Slack", bg: "#e8f5e9", color: "#2e7d32", iconType: U },
702
+ teams: { label: "MS Teams", bg: "#ede7f6", color: "#4527a0", iconType: U },
703
+ sms: { label: "SMS", bg: "#fce4ec", color: "#880e4f", iconType: Ee },
704
+ "in-app": { label: "In-App", bg: "#fff3e0", color: "#e65100", iconType: U },
705
+ webhook: { label: "Webhook", bg: "#f3e5f5", color: "#6a1b9a", iconType: de }
706
+ }, Ze = {
707
+ label: "Notification",
708
+ bg: "rgba(156,39,176,0.1)",
709
+ color: "#7b1fa2",
710
+ iconType: U
711
+ };
712
+ function Ye(n) {
713
+ var i;
714
+ switch (n.channel) {
715
+ case "email":
716
+ return ((i = n.emailTo) == null ? void 0 : i.join(", ")) ?? n.recipient ?? null;
717
+ case "slack":
718
+ return n.slackChannel ?? null;
719
+ case "teams":
720
+ return n.teamsMessage ? "Message configured" : null;
721
+ case "sms":
722
+ return n.smsTo ?? null;
723
+ case "in-app":
724
+ return n.inAppRecipient ?? null;
725
+ case "webhook":
726
+ return n.webhookUrl ?? null;
727
+ default:
728
+ return n.recipient ?? null;
729
+ }
730
+ }
731
+ function Je(n) {
732
+ switch (n.channel) {
733
+ case "email":
734
+ return n.emailSubject ?? n.subject ?? null;
735
+ case "slack": {
736
+ const i = n.slackMessage;
737
+ return i ? i.length > 60 ? `${i.slice(0, 60)}…` : i : null;
738
+ }
739
+ case "in-app":
740
+ return n.inAppTitle ?? null;
741
+ default:
742
+ return n.subject ?? null;
743
+ }
744
+ }
745
+ const Qe = ({ id: n, data: i }) => {
746
+ const { onEditNode: f, onDeleteNode: p } = I(), s = i, r = s.channel && Q[s.channel] ? Q[s.channel] : Ze, h = Ye(s), o = Je(s), l = !!(s.channel && h), d = r.iconType;
747
+ return /* @__PURE__ */ t("div", { style: { width: M }, children: [
748
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
749
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
750
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
751
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
752
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: r.bg }, children: /* @__PURE__ */ e(d, { size: 16, color: r.color }) }),
753
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: s.channel ? `${r.label} Notification` : "Notification" })
754
+ ] }),
755
+ /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
756
+ /* @__PURE__ */ e(
757
+ "div",
758
+ {
759
+ role: "button",
760
+ tabIndex: 0,
761
+ onClick: (u) => {
762
+ u.stopPropagation(), f(n);
763
+ },
764
+ onKeyDown: (u) => {
765
+ (u.key === "Enter" || u.key === " ") && (u.stopPropagation(), f(n));
766
+ },
767
+ children: /* @__PURE__ */ e(D, { size: 16 })
768
+ }
769
+ ),
770
+ /* @__PURE__ */ e(
771
+ "div",
772
+ {
773
+ className: "ff-ms-2",
774
+ role: "button",
775
+ tabIndex: 0,
776
+ onClick: (u) => {
777
+ u.stopPropagation(), p(n);
778
+ },
779
+ onKeyDown: (u) => {
780
+ (u.key === "Enter" || u.key === " ") && (u.stopPropagation(), p(n));
781
+ },
782
+ children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
783
+ }
784
+ )
785
+ ] })
786
+ ] }),
787
+ /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: l ? /* @__PURE__ */ t("div", { className: "ff-d-flex ff-flex-column ff-gap-1", children: [
788
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
789
+ /* @__PURE__ */ e("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 10, background: r.bg, color: r.color, fontWeight: 600, flexShrink: 0 }, children: r.label }),
790
+ /* @__PURE__ */ e("span", { className: "ff-text-dark ff-text-truncate", style: { maxWidth: 220 }, children: h })
791
+ ] }),
792
+ o && /* @__PURE__ */ e("span", { className: "ff-text-muted ff-text-truncate", style: { maxWidth: 280 }, children: o })
793
+ ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured" }) })
794
+ ] }),
795
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
796
+ ] });
797
+ }, X = {
798
+ "api-key": "API Key",
799
+ hmac: "HMAC"
800
+ }, Xe = ({ data: n }) => {
801
+ const { onClickAddTrigger: i } = I(), { label: f = "Webhook Trigger", endpointUrl: p, authMethod: s, source: r } = n, h = (l) => {
802
+ l.stopPropagation(), i();
803
+ }, o = (l) => {
804
+ l.stopPropagation(), p && navigator.clipboard.writeText(p).catch(() => {
805
+ });
806
+ };
807
+ return /* @__PURE__ */ t("div", { style: { width: M }, children: [
808
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
809
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #90caf9", borderRadius: 8, background: "#fff", overflow: "hidden" }, children: [
810
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
811
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
812
+ /* @__PURE__ */ e("div", { style: { width: 28, height: 28, borderRadius: 6, background: "rgba(33,150,243,0.1)", display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 }, children: /* @__PURE__ */ e(de, { size: 16, color: "#1565c0" }) }),
813
+ /* @__PURE__ */ e("span", { style: { fontSize: 13, fontWeight: 600, color: "#212121" }, children: "Webhook Trigger" })
814
+ ] }),
815
+ /* @__PURE__ */ e(
816
+ "div",
817
+ {
818
+ role: "button",
819
+ tabIndex: 0,
820
+ onClick: h,
821
+ onKeyDown: (l) => {
822
+ (l.key === "Enter" || l.key === " ") && h(l);
823
+ },
824
+ className: "ff-d-flex ff-align-items-center",
825
+ style: { paddingRight: 4, cursor: "pointer" },
826
+ children: /* @__PURE__ */ e(D, { size: 16, color: "#555" })
827
+ }
828
+ )
829
+ ] }),
830
+ /* @__PURE__ */ t("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#e3f2fd", border: "1px solid #90caf9" }, children: [
831
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-flex-wrap ff-gap-2 ff-mb-1", children: [
832
+ /* @__PURE__ */ e("span", { style: { fontSize: 12, color: "#1565c0", fontWeight: 600 }, children: f }),
833
+ r && /* @__PURE__ */ e("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 11, background: "#fff", border: "1px solid #90caf9", color: "#1565c0" }, children: r }),
834
+ s && s !== "none" && X[s] && /* @__PURE__ */ e("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 10, background: "#1565c0", color: "#fff", fontWeight: 600 }, children: X[s] })
835
+ ] }),
836
+ p && /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-1", style: { marginTop: 4 }, children: [
837
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "#1565c0", fontFamily: "monospace", flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: p }),
838
+ /* @__PURE__ */ e($, { title: "Copy URL", placement: "top", arrow: !0, children: /* @__PURE__ */ e(
839
+ "div",
840
+ {
841
+ role: "button",
842
+ tabIndex: 0,
843
+ onClick: o,
844
+ onKeyDown: (l) => {
845
+ (l.key === "Enter" || l.key === " ") && o(l);
846
+ },
847
+ style: { cursor: "pointer", flexShrink: 0 },
848
+ children: /* @__PURE__ */ e(ze, { size: 12, color: "#1565c0" })
849
+ }
850
+ ) })
851
+ ] })
852
+ ] })
853
+ ] }),
854
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
855
+ ] });
856
+ }, et = ({ id: n, data: i }) => {
857
+ var k;
858
+ const { onEditNode: f, onDeleteNode: p, nodeRegistry: s } = I(), { method: r, url: h, descriptorType: o } = i, l = o ? (k = s == null ? void 0 : s.forType(o)) == null ? void 0 : k.icon : /* @__PURE__ */ e(Ie, { size: 16, color: "#546e7a" }), d = !!(r && h), u = (r == null ? void 0 : r.toUpperCase()) ?? "", y = Le[u] ?? null;
859
+ return /* @__PURE__ */ t("div", { style: { width: M }, children: [
860
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
861
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
862
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
863
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
864
+ /* @__PURE__ */ e("div", { style: { width: 25, height: 25, display: "flex", alignItems: "center", justifyContent: "center" }, children: l }),
865
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "REST API Call" })
866
+ ] }),
867
+ /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
868
+ /* @__PURE__ */ e(
869
+ "div",
870
+ {
871
+ role: "button",
872
+ tabIndex: 0,
873
+ onClick: (g) => {
874
+ g.stopPropagation(), f(n);
875
+ },
876
+ onKeyDown: (g) => {
877
+ (g.key === "Enter" || g.key === " ") && (g.stopPropagation(), f(n));
878
+ },
879
+ children: /* @__PURE__ */ e(D, { size: 16 })
880
+ }
881
+ ),
882
+ /* @__PURE__ */ e(
883
+ "div",
884
+ {
885
+ className: "ff-ms-2",
886
+ role: "button",
887
+ tabIndex: 0,
888
+ onClick: (g) => {
889
+ g.stopPropagation(), p(n);
890
+ },
891
+ onKeyDown: (g) => {
892
+ (g.key === "Enter" || g.key === " ") && (g.stopPropagation(), p(n));
893
+ },
894
+ children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
895
+ }
896
+ )
897
+ ] })
898
+ ] }),
899
+ /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: d ? /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
900
+ y && /* @__PURE__ */ e("span", { style: { fontSize: 10, fontWeight: 700, padding: "2px 6px", borderRadius: 4, background: y.bg, color: y.color, flexShrink: 0 }, children: u }),
901
+ /* @__PURE__ */ e("span", { className: "ff-text-dark ff-text-truncate", style: { fontFamily: "monospace", fontSize: 11 }, title: h, children: h })
902
+ ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured" }) })
903
+ ] }),
904
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
905
+ ] });
906
+ }, tt = {
907
+ eq: "=",
908
+ neq: "≠",
909
+ gt: ">",
910
+ gte: "≥",
911
+ lt: "<",
912
+ lte: "≤",
913
+ contains: "contains",
914
+ startsWith: "starts with",
915
+ endsWith: "ends with",
916
+ isEmpty: "is empty",
917
+ isNotEmpty: "is not empty"
918
+ }, nt = ({ id: n, data: i }) => {
919
+ const { onEditNode: f, onDeleteNode: p } = I(), { title: s = "Condition Branch", branchConfigs: r = [], defaultBranch: h } = i, o = r.length > 0;
920
+ return /* @__PURE__ */ t("div", { style: { width: M }, children: [
921
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
922
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #b39ddb", borderRadius: 8, background: "#fff" }, children: [
923
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
924
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
925
+ /* @__PURE__ */ e("div", { style: { width: 25, height: 25, borderRadius: 6, background: "rgba(103,58,183,0.1)", display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e(Pe, { size: 16, color: "#512da8" }) }),
926
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: s })
927
+ ] }),
928
+ /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
929
+ /* @__PURE__ */ e(
930
+ "div",
931
+ {
932
+ role: "button",
933
+ tabIndex: 0,
934
+ onClick: (l) => {
935
+ l.stopPropagation(), f(n);
936
+ },
937
+ onKeyDown: (l) => {
938
+ (l.key === "Enter" || l.key === " ") && (l.stopPropagation(), f(n));
939
+ },
940
+ children: /* @__PURE__ */ e(D, { size: 16 })
941
+ }
942
+ ),
943
+ /* @__PURE__ */ e(
944
+ "div",
945
+ {
946
+ className: "ff-ms-2",
947
+ role: "button",
948
+ tabIndex: 0,
949
+ onClick: (l) => {
950
+ l.stopPropagation(), p(n);
951
+ },
952
+ onKeyDown: (l) => {
953
+ (l.key === "Enter" || l.key === " ") && (l.stopPropagation(), p(n));
954
+ },
955
+ children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
956
+ }
957
+ )
958
+ ] })
959
+ ] }),
960
+ /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: o ? /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
961
+ r.map((l, d) => {
962
+ var g, c;
963
+ const u = Y[d % Y.length], y = (g = l.conditions) == null ? void 0 : g[0], k = (((c = l.conditions) == null ? void 0 : c.length) ?? 0) - 1;
964
+ return /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
965
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: u.bg, color: u.color, flexShrink: 0 }, children: l.label || l.key }),
966
+ y ? /* @__PURE__ */ t("span", { style: { fontSize: 11, color: "#616161", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
967
+ y.field,
968
+ " ",
969
+ tt[y.operator] ?? y.operator,
970
+ y.value ? ` ${y.value}` : "",
971
+ k > 0 ? ` +${k} more` : ""
972
+ ] }) : /* @__PURE__ */ e("span", { style: { fontSize: 11, color: "#9e9e9e" }, children: "No conditions yet" })
973
+ ] }, l.key);
974
+ }),
975
+ h && /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", gap: 6, marginTop: 2 }, children: [
976
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: "#f5f5f5", color: "#757575", flexShrink: 0 }, children: "Default" }),
977
+ /* @__PURE__ */ e("span", { style: { fontSize: 11, color: "#9e9e9e" }, children: "fallback path" })
978
+ ] })
979
+ ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured — click edit to add branches" }) })
980
+ ] }),
981
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
982
+ ] });
983
+ }, ot = ({ id: n, data: i }) => {
984
+ var g;
985
+ const { onEditNode: f, onDeleteNode: p, nodeRegistry: s } = I(), { title: r = "Sub-Workflow", workflowId: h, workflowLabel: o, descriptorType: l, onPreview: d } = i, u = l ? (g = s == null ? void 0 : s.forType(l)) == null ? void 0 : g.icon : /* @__PURE__ */ e(Ae, { size: 16, color: "#00695c" }), y = !!h, k = (c) => {
986
+ c.stopPropagation(), h && d && d(h);
987
+ };
988
+ return /* @__PURE__ */ t("div", { style: { width: M }, children: [
989
+ /* @__PURE__ */ e(x, { type: "target", position: N.Top, style: { opacity: 0 } }),
990
+ /* @__PURE__ */ t("div", { style: { border: "1.5px solid #80cbc4", borderRadius: 8, background: "#fff" }, children: [
991
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
992
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
993
+ /* @__PURE__ */ e("div", { style: { width: 25, height: 25, borderRadius: 6, background: "rgba(0,137,123,0.1)", display: "flex", alignItems: "center", justifyContent: "center" }, children: u }),
994
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: r })
995
+ ] }),
996
+ /* @__PURE__ */ t("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
997
+ /* @__PURE__ */ e(
998
+ "div",
999
+ {
1000
+ role: "button",
1001
+ tabIndex: 0,
1002
+ onClick: (c) => {
1003
+ c.stopPropagation(), f(n);
1004
+ },
1005
+ onKeyDown: (c) => {
1006
+ (c.key === "Enter" || c.key === " ") && (c.stopPropagation(), f(n));
1007
+ },
1008
+ children: /* @__PURE__ */ e(D, { size: 16 })
1009
+ }
1010
+ ),
1011
+ /* @__PURE__ */ e(
1012
+ "div",
1013
+ {
1014
+ className: "ff-ms-2",
1015
+ role: "button",
1016
+ tabIndex: 0,
1017
+ onClick: (c) => {
1018
+ c.stopPropagation(), p(n);
1019
+ },
1020
+ onKeyDown: (c) => {
1021
+ (c.key === "Enter" || c.key === " ") && (c.stopPropagation(), p(n));
1022
+ },
1023
+ children: /* @__PURE__ */ e(F, { color: "red", size: 16 })
1024
+ }
1025
+ )
1026
+ ] })
1027
+ ] }),
1028
+ /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: y ? "#e0f2f1" : "#fafafa", fontSize: 12, border: y ? "1px solid #b2dfdb" : "none" }, children: y ? /* @__PURE__ */ t("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-between", children: [
1029
+ /* @__PURE__ */ t("div", { className: "ff-d-flex ff-flex-column ff-gap-1", children: [
1030
+ /* @__PURE__ */ e("span", { style: { fontSize: 12, fontWeight: 600, color: "#00695c" }, children: o || h }),
1031
+ /* @__PURE__ */ t("span", { style: { fontSize: 10, color: "#80cbc4", fontFamily: "monospace" }, children: [
1032
+ "ID: ",
1033
+ h
1034
+ ] })
1035
+ ] }),
1036
+ d && /* @__PURE__ */ t(
1037
+ "div",
1038
+ {
1039
+ role: "button",
1040
+ tabIndex: 0,
1041
+ onClick: k,
1042
+ onKeyDown: (c) => {
1043
+ (c.key === "Enter" || c.key === " ") && k(c);
1044
+ },
1045
+ style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 3, fontSize: 11, color: "#00897b" },
1046
+ children: [
1047
+ /* @__PURE__ */ e(De, { size: 13 }),
1048
+ "Preview"
1049
+ ]
1050
+ }
1051
+ )
1052
+ ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured — select a workflow" }) })
1053
+ ] }),
1054
+ /* @__PURE__ */ e(x, { type: "source", position: N.Bottom, style: { opacity: 0 } })
1055
+ ] });
1056
+ }, bt = {
1057
+ startNode: Fe,
1058
+ endNode: $e,
1059
+ addTriggerNode: Be,
1060
+ addStepNode: je,
1061
+ triggerNode: _e,
1062
+ eventNode: Ue,
1063
+ filterNode: He,
1064
+ actionNode: Ge,
1065
+ approvalNode: Ve,
1066
+ delayNode: qe,
1067
+ notificationNode: Qe,
1068
+ webhookTriggerNode: Xe,
1069
+ restApiNode: et,
1070
+ conditionBranchNode: nt,
1071
+ subWorkflowNode: ot
1072
+ }, it = 11.5, ee = 2, _ = 6, te = 40, ne = 20, oe = 4, xt = ({
1073
+ id: n,
1074
+ sourceX: i,
1075
+ sourceY: f,
1076
+ targetX: p,
1077
+ targetY: s,
1078
+ sourcePosition: r,
1079
+ targetPosition: h,
1080
+ source: o,
1081
+ target: l,
1082
+ data: d
1083
+ }) => {
1084
+ const [u, y, k] = H({
1085
+ sourceX: i,
1086
+ sourceY: f,
1087
+ targetX: p,
1088
+ targetY: s
1089
+ }), g = d == null ? void 0 : d.label, c = g === "Pass", S = c || g === "Fail", m = i + (p - i) / 3, C = f + (s - f) / 3, v = i + 2 * (p - i) / 3, R = f + 2 * (s - f) / 3, z = d == null ? void 0 : d.onAddStepClick, P = (L) => {
1090
+ if (L.stopPropagation(), typeof z != "function") return;
1091
+ const V = {
1092
+ edgeId: n,
1093
+ nodeId: o,
1094
+ sourceNodeId: o,
1095
+ targetNodeId: l,
1096
+ position: "between",
1097
+ referenceNodeId: o,
1098
+ referenceNodeType: d == null ? void 0 : d.referenceNodeType,
1099
+ stepVisibility: d == null ? void 0 : d.stepVisibility
1100
+ };
1101
+ z(o, V);
1102
+ }, A = (L) => {
1103
+ (L.key === "Enter" || L.key === " ") && (L.preventDefault(), P(L));
1104
+ }, T = () => /* @__PURE__ */ t(B, { children: [
1105
+ /* @__PURE__ */ t("g", { className: "plus-icon-container", children: [
1106
+ /* @__PURE__ */ e("circle", { r: it, className: "edge-plus-circle" }),
1107
+ /* @__PURE__ */ e("line", { x1: 0, y1: -_, x2: 0, y2: _, strokeWidth: ee, strokeLinecap: "round", className: "plus-line" }),
1108
+ /* @__PURE__ */ e("line", { x1: -_, y1: 0, x2: _, y2: 0, strokeWidth: ee, strokeLinecap: "round", className: "plus-line" })
1109
+ ] }),
1110
+ /* @__PURE__ */ t("g", { className: "edge-plus-tooltip", transform: "translate(18, 0)", children: [
1111
+ /* @__PURE__ */ e("rect", { x: 0, y: -10, width: 65, height: 20, rx: 4, className: "tooltip-bg" }),
1112
+ /* @__PURE__ */ e("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }),
1113
+ /* @__PURE__ */ e("text", { x: 32, y: 0, textAnchor: "middle", dominantBaseline: "central", fill: "white", style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" }, children: "Add Step" })
1114
+ ] })
1115
+ ] }), E = z ? {
1116
+ onClick: P,
1117
+ onKeyDown: A,
1118
+ role: "button",
1119
+ tabIndex: 0,
1120
+ style: { cursor: "pointer", pointerEvents: "all" }
1121
+ } : {
1122
+ style: { cursor: "default", pointerEvents: "all" }
1123
+ };
1124
+ return /* @__PURE__ */ t("g", { className: "edge-with-plus-wrapper", children: [
1125
+ /* @__PURE__ */ e(G, { id: n, path: u }),
1126
+ S ? /* @__PURE__ */ t(B, { children: [
1127
+ /* @__PURE__ */ t("g", { transform: `translate(${m}, ${C})`, children: [
1128
+ /* @__PURE__ */ e("rect", { x: -te / 2, y: -ne / 2, width: te, height: ne, rx: oe, ry: oe, fill: c ? "#ADE6C5" : "#FDBFBF" }),
1129
+ /* @__PURE__ */ e("text", { textAnchor: "middle", dominantBaseline: "central", fill: c ? "#1DBF60" : "#C50000", style: { fontSize: 12, fontWeight: 500 }, children: g })
1130
+ ] }),
1131
+ /* @__PURE__ */ e("g", { className: "nodrag nopan edge-plus-svg", transform: `translate(${v}, ${R})`, "data-testid": "plus-node-icon", ...E, children: /* @__PURE__ */ e(T, {}) })
1132
+ ] }) : /* @__PURE__ */ e("g", { className: "nodrag nopan edge-plus-svg", transform: `translate(${y}, ${k})`, "data-testid": "plus-node-icon", ...E, children: /* @__PURE__ */ e(T, {}) })
1133
+ ] });
1134
+ }, lt = 11.5, ie = 2, K = 6, Nt = ({
1135
+ id: n,
1136
+ sourceX: i,
1137
+ sourceY: f,
1138
+ targetX: p,
1139
+ targetY: s,
1140
+ source: r,
1141
+ target: h,
1142
+ data: o
1143
+ }) => {
1144
+ const [l, d, u] = H({
1145
+ sourceX: i,
1146
+ sourceY: f,
1147
+ targetX: p,
1148
+ targetY: s
1149
+ }), y = o == null ? void 0 : o.onAddStepClick, k = (c) => {
1150
+ c.stopPropagation(), typeof y == "function" && y(r, {
1151
+ edgeId: n,
1152
+ nodeId: r,
1153
+ sourceNodeId: r,
1154
+ targetNodeId: h,
1155
+ position: "between",
1156
+ referenceNodeId: r,
1157
+ referenceNodeType: o == null ? void 0 : o.referenceNodeType,
1158
+ stepVisibility: o == null ? void 0 : o.stepVisibility,
1159
+ filterId: o == null ? void 0 : o.filterId,
1160
+ branch: o == null ? void 0 : o.branch
1161
+ });
1162
+ }, g = (c) => {
1163
+ (c.key === "Enter" || c.key === " ") && (c.preventDefault(), k(c));
1164
+ };
1165
+ return /* @__PURE__ */ t("g", { className: "edge-with-plus-wrapper", children: [
1166
+ /* @__PURE__ */ e(G, { id: n, path: l, style: { stroke: "#b0bec5" } }),
1167
+ /* @__PURE__ */ t(
1168
+ "g",
1169
+ {
1170
+ className: "nodrag nopan edge-plus-svg",
1171
+ transform: `translate(${d}, ${u})`,
1172
+ style: {
1173
+ cursor: y ? "pointer" : "default",
1174
+ pointerEvents: "all",
1175
+ outline: "none"
1176
+ },
1177
+ onClick: y ? k : void 0,
1178
+ onKeyDown: y ? g : void 0,
1179
+ role: y ? "button" : void 0,
1180
+ tabIndex: y ? 0 : void 0,
1181
+ "data-testid": "plus-node-icon",
1182
+ children: [
1183
+ /* @__PURE__ */ e("circle", { r: lt, className: "edge-plus-circle" }),
1184
+ /* @__PURE__ */ e(
1185
+ "line",
1186
+ {
1187
+ x1: 0,
1188
+ y1: -K,
1189
+ x2: 0,
1190
+ y2: K,
1191
+ strokeWidth: ie,
1192
+ strokeLinecap: "round",
1193
+ className: "plus-line"
1194
+ }
1195
+ ),
1196
+ /* @__PURE__ */ e(
1197
+ "line",
1198
+ {
1199
+ x1: -K,
1200
+ y1: 0,
1201
+ x2: K,
1202
+ y2: 0,
1203
+ strokeWidth: ie,
1204
+ strokeLinecap: "round",
1205
+ className: "plus-line"
1206
+ }
1207
+ ),
1208
+ /* @__PURE__ */ t("g", { className: "edge-plus-tooltip", transform: "translate(18, 0)", children: [
1209
+ /* @__PURE__ */ e(
1210
+ "rect",
1211
+ {
1212
+ x: 0,
1213
+ y: -10,
1214
+ width: 65,
1215
+ height: 20,
1216
+ rx: 4,
1217
+ className: "tooltip-bg"
1218
+ }
1219
+ ),
1220
+ /* @__PURE__ */ e("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }),
1221
+ /* @__PURE__ */ e(
1222
+ "text",
1223
+ {
1224
+ x: 32,
1225
+ y: 0,
1226
+ textAnchor: "middle",
1227
+ dominantBaseline: "central",
1228
+ fill: "white",
1229
+ style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" },
1230
+ children: "Add Step"
1231
+ }
1232
+ )
1233
+ ] })
1234
+ ]
1235
+ }
1236
+ )
1237
+ ] });
1238
+ }, kt = ({ id: n, sourceX: i, sourceY: f, targetX: p, targetY: s }) => {
1239
+ const [r] = H({ sourceX: i, sourceY: f, targetX: p, targetY: s });
1240
+ return /* @__PURE__ */ e(G, { id: n, path: r, style: { stroke: "#b0bec5" } });
1241
+ }, rt = 11.5, le = 2, O = 6, st = -24, re = 40, se = 20, ce = 4, vt = ({
1242
+ id: n,
1243
+ sourceX: i,
1244
+ sourceY: f,
1245
+ targetX: p,
1246
+ targetY: s,
1247
+ source: r,
1248
+ target: h,
1249
+ data: o
1250
+ }) => {
1251
+ const [l, d, u] = H({ sourceX: i, sourceY: f, targetX: p, targetY: s }), y = o == null ? void 0 : o.label, k = y === "Pass", g = k || y === "Fail", c = o == null ? void 0 : o.onAddStepClick, S = (o == null ? void 0 : o.showPlus) !== !1 && !!c, m = (v) => {
1252
+ v.stopPropagation(), typeof c == "function" && c(r, {
1253
+ edgeId: n,
1254
+ nodeId: r,
1255
+ sourceNodeId: r,
1256
+ targetNodeId: h,
1257
+ position: "between",
1258
+ referenceNodeId: r,
1259
+ referenceNodeType: o == null ? void 0 : o.referenceNodeType,
1260
+ stepVisibility: o == null ? void 0 : o.stepVisibility
1261
+ });
1262
+ }, C = (v) => {
1263
+ (v.key === "Enter" || v.key === " ") && (v.preventDefault(), m(v));
1264
+ };
1265
+ return /* @__PURE__ */ t("g", { className: "edge-with-plus-wrapper", children: [
1266
+ /* @__PURE__ */ e(G, { id: n, path: l, style: { stroke: "#b0bec5" } }),
1267
+ /* @__PURE__ */ t(
1268
+ "g",
1269
+ {
1270
+ className: "nodrag nopan edge-plus-svg",
1271
+ transform: `translate(${d}, ${u})`,
1272
+ style: { cursor: c ? "pointer" : "default", pointerEvents: "all", outline: "none" },
1273
+ onClick: c ? m : void 0,
1274
+ onKeyDown: c ? C : void 0,
1275
+ role: c ? "button" : void 0,
1276
+ tabIndex: c ? 0 : void 0,
1277
+ children: [
1278
+ g && /* @__PURE__ */ t("g", { transform: `translate(0, ${S ? st : 0})`, children: [
1279
+ /* @__PURE__ */ e(
1280
+ "rect",
1281
+ {
1282
+ x: -re / 2,
1283
+ y: -se / 2,
1284
+ width: re,
1285
+ height: se,
1286
+ rx: ce,
1287
+ ry: ce,
1288
+ fill: k ? "#ADE6C5" : "#FDBFBF"
1289
+ }
1290
+ ),
1291
+ /* @__PURE__ */ e("text", { textAnchor: "middle", dominantBaseline: "central", fill: k ? "#1DBF60" : "#C50000", style: { fontSize: 12, fontWeight: 500 }, children: y })
1292
+ ] }),
1293
+ S && /* @__PURE__ */ t("g", { className: "plus-icon-container", children: [
1294
+ /* @__PURE__ */ e("circle", { r: rt, className: "edge-plus-circle" }),
1295
+ /* @__PURE__ */ e("line", { x1: 0, y1: -O, x2: 0, y2: O, strokeWidth: le, strokeLinecap: "round", className: "plus-line" }),
1296
+ /* @__PURE__ */ e("line", { x1: -O, y1: 0, x2: O, y2: 0, strokeWidth: le, strokeLinecap: "round", className: "plus-line" })
1297
+ ] }),
1298
+ S && /* @__PURE__ */ t("g", { className: "edge-plus-tooltip", transform: "translate(22, 0)", children: [
1299
+ /* @__PURE__ */ e("rect", { x: 0, y: -10, width: 65, height: 20, rx: 4, className: "tooltip-bg" }),
1300
+ /* @__PURE__ */ e("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }),
1301
+ /* @__PURE__ */ e("text", { x: 32, y: 0, textAnchor: "middle", dominantBaseline: "central", fill: "white", style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" }, children: "Add Step" })
1302
+ ] })
1303
+ ]
1304
+ }
1305
+ )
1306
+ ] });
1307
+ }, wt = ({
1308
+ id: n,
1309
+ source: i,
1310
+ target: f,
1311
+ sourceX: p,
1312
+ sourceY: s,
1313
+ targetX: r,
1314
+ targetY: h,
1315
+ style: o = {},
1316
+ markerEnd: l,
1317
+ data: d
1318
+ }) => {
1319
+ const u = (d == null ? void 0 : d.verticalRouting) ?? !1, y = 30, k = u ? (() => {
1320
+ const E = h - y;
1321
+ return `M ${p},${E} L ${r},${E} L ${r},${h}`;
1322
+ })() : (() => {
1323
+ const E = s + 30;
1324
+ return `M ${p},${s} L ${p},${E} L ${r},${E} L ${r},${h}`;
1325
+ })(), g = o.stroke || "#d1d5db", c = d == null ? void 0 : d.label, S = (d == null ? void 0 : d.isFirst) ?? !1, m = d == null ? void 0 : d.onAddStepClick, C = u ? h - y : s + 30, v = p + (r - p) * (u ? 0.25 : 0.35), R = p + (r - p) * (u ? 0.65 : 0.7), z = C, P = (E) => {
1326
+ E.stopPropagation(), m && m(i, {
1327
+ edgeId: n,
1328
+ nodeId: i,
1329
+ sourceNodeId: i,
1330
+ targetNodeId: f,
1331
+ position: "between",
1332
+ referenceNodeId: i,
1333
+ filterId: d == null ? void 0 : d.filterId,
1334
+ branch: d == null ? void 0 : d.branch
1335
+ });
1336
+ }, A = 11.5, T = 6;
1337
+ return /* @__PURE__ */ t("g", { children: [
1338
+ /* @__PURE__ */ e("path", { id: n, d: k, fill: "none", stroke: g, strokeWidth: 1.5, markerEnd: l }),
1339
+ c && !u && /* @__PURE__ */ e("g", { transform: `translate(${v}, ${z})`, children: (() => {
1340
+ const E = Math.max(44, c.length * 7 + 20);
1341
+ return /* @__PURE__ */ t(B, { children: [
1342
+ /* @__PURE__ */ e(
1343
+ "rect",
1344
+ {
1345
+ x: -E / 2,
1346
+ y: -11,
1347
+ width: E,
1348
+ height: 22,
1349
+ rx: 11,
1350
+ fill: S ? "#e8f5e9" : "#ffebee",
1351
+ stroke: S ? "#81c784" : "#e57373",
1352
+ strokeWidth: 1
1353
+ }
1354
+ ),
1355
+ /* @__PURE__ */ e(
1356
+ "text",
1357
+ {
1358
+ x: 0,
1359
+ y: 4,
1360
+ textAnchor: "middle",
1361
+ fontSize: 10,
1362
+ fontWeight: 600,
1363
+ fill: S ? "#2e7d32" : "#c62828",
1364
+ style: { fontFamily: "sans-serif", pointerEvents: "none" },
1365
+ children: c
1366
+ }
1367
+ )
1368
+ ] });
1369
+ })() }),
1370
+ m && /* @__PURE__ */ t(
1371
+ "g",
1372
+ {
1373
+ transform: `translate(${R}, ${z})`,
1374
+ onClick: P,
1375
+ style: { cursor: "pointer", pointerEvents: "all" },
1376
+ className: "nodrag nopan edge-plus-svg",
1377
+ children: [
1378
+ /* @__PURE__ */ e("circle", { r: A, className: "edge-plus-circle" }),
1379
+ /* @__PURE__ */ e("line", { x1: 0, y1: -T, x2: 0, y2: T, strokeWidth: 2, strokeLinecap: "round", className: "plus-line" }),
1380
+ /* @__PURE__ */ e("line", { x1: -T, y1: 0, x2: T, y2: 0, strokeWidth: 2, strokeLinecap: "round", className: "plus-line" })
1381
+ ]
1382
+ }
1383
+ )
1384
+ ] });
1385
+ };
1386
+ export {
1387
+ Ge as A,
1388
+ qe as D,
1389
+ xt as E,
1390
+ He as F,
1391
+ wt as G,
1392
+ vt as L,
1393
+ Qe as N,
1394
+ kt as P,
1395
+ et as R,
1396
+ Fe as S,
1397
+ _e as T,
1398
+ Xe as W,
1399
+ Be as a,
1400
+ Ve as b,
1401
+ $e as c,
1402
+ Nt as d,
1403
+ bt as e,
1404
+ We as f
1405
+ };
1406
+ //# sourceMappingURL=GatewayBranchEdge-Bnql8DmQ.js.map