@notmrabhi/flowforge 0.1.19 → 0.1.21

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