@notmrabhi/flowforge 0.1.106 → 0.1.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WorkflowExecutionHistory-8xEbKYsc.js +2 -0
- package/dist/WorkflowExecutionHistory-8xEbKYsc.js.map +1 -0
- package/dist/{WorkflowExecutionHistory-DYp-l7mk.js → WorkflowExecutionHistory-BA5IpymY.js} +574 -553
- package/dist/WorkflowExecutionHistory-BA5IpymY.js.map +1 -0
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.d.ts +22 -0
- package/dist/canvas.js +1 -1
- package/dist/core.d.ts +10 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -1
- package/dist/nodeRegistry.d.ts +10 -0
- package/dist/templateRegistry.d.ts +2 -0
- package/package.json +1 -1
- package/dist/WorkflowExecutionHistory-CsBnVxC5.js +0 -2
- package/dist/WorkflowExecutionHistory-CsBnVxC5.js.map +0 -1
- package/dist/WorkflowExecutionHistory-DYp-l7mk.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as w, jsx as u, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as w, jsx as u, Fragment as Ee } from "react/jsx-runtime";
|
|
2
|
+
import W, { useRef as _t, useEffect as se, useState as z, useCallback as H, useMemo as U } from "react";
|
|
3
3
|
import Wn, { useStore as $n, useReactFlow as Gn, Background as Yn, Controls as Kn, MiniMap as Hn } from "reactflow";
|
|
4
4
|
import "reactflow/dist/style.css";
|
|
5
|
-
import { e as Un, G as Vn, E as
|
|
6
|
-
import { Dialog as er, Box as
|
|
5
|
+
import { e as Un, G as Vn, E as qn, P as Xn, L as Jn, d as Zn, h as Qn } from "./GatewayBranchEdge-BsPsPmnx.js";
|
|
6
|
+
import { Dialog as er, Box as te, Drawer as tr, IconButton as St, Button as Ie, CircularProgress as nr } from "@mui/material";
|
|
7
7
|
import rr from "react-select";
|
|
8
|
-
import { MdClose as or, MdCalendarToday as ir, MdBolt as sr, MdArrowBack as Ut, MdChevronRight as Vt, MdAddCircleOutline as lr, MdApps as ar, MdErrorOutline as dr, MdAccountTree as cr, MdAdd as fr, MdSearch as ur, MdCategory as hr, MdCancel as
|
|
8
|
+
import { MdClose as or, MdCalendarToday as ir, MdBolt as sr, MdArrowBack as Ut, MdChevronRight as Vt, MdAddCircleOutline as lr, MdApps as ar, MdErrorOutline as dr, MdAccountTree as cr, MdAdd as fr, MdSearch as ur, MdCategory as hr, MdCancel as qt, MdError as Xt, MdCheckCircle as Jt, MdPlayArrow as Zt, MdHourglassEmpty as gr, MdSchedule as Nt, MdPerson as pr, MdExpandLess as yr, MdExpandMore as br } from "react-icons/md";
|
|
9
9
|
import { GrTrigger as mr } from "react-icons/gr";
|
|
10
10
|
import { BiCollapse as vr, BiExpand as wr } from "react-icons/bi";
|
|
11
11
|
import { k as Er, c as xr, O as kr } from "./index-C6t1hp3u.js";
|
|
12
12
|
import { m as _r } from "./messages-CRZgWFU-.js";
|
|
13
13
|
import { createTheme as Sr, ThemeProvider as Nr } from "@mui/material/styles";
|
|
14
|
-
import { T as Cr, E as
|
|
14
|
+
import { T as Cr, E as ne } from "./canvasTokens-CAD6G24b.js";
|
|
15
15
|
var Qt = Object.defineProperty, Tr = (e, t, n) => t in e ? Qt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ir = (e, t) => {
|
|
16
16
|
for (var n in t) Qt(e, n, { get: t[n], enumerable: !0 });
|
|
17
17
|
}, Or = (e, t, n) => Tr(e, t + "", n), en = {};
|
|
18
18
|
Ir(en, { Graph: () => V, alg: () => Qe, json: () => nn, version: () => zr });
|
|
19
|
-
var
|
|
20
|
-
for (var n in t)
|
|
19
|
+
var jr = Object.defineProperty, tn = (e, t) => {
|
|
20
|
+
for (var n in t) jr(e, n, { get: t[n], enumerable: !0 });
|
|
21
21
|
}, V = class {
|
|
22
22
|
constructor(e) {
|
|
23
23
|
this._isDirected = !0, this._isMultigraph = !1, this._isCompound = !1, this._nodes = {}, this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {}, this._nodeCount = 0, this._edgeCount = 0, this._defaultNodeLabelFn = () => {
|
|
@@ -151,15 +151,15 @@ var Mr = Object.defineProperty, tn = (e, t) => {
|
|
|
151
151
|
setEdge(e, t, n, r) {
|
|
152
152
|
let o, i, s, l, d = !1;
|
|
153
153
|
typeof e == "object" && e !== null && "v" in e ? (o = e.v, i = e.w, s = e.name, arguments.length === 2 && (l = t, d = !0)) : (o = e, i = t, s = r, arguments.length > 2 && (l = n, d = !0)), o = "" + o, i = "" + i, s !== void 0 && (s = "" + s);
|
|
154
|
-
let a =
|
|
154
|
+
let a = we(this._isDirected, o, i, s);
|
|
155
155
|
if (a in this._edgeLabels) return d && (this._edgeLabels[a] = l), this;
|
|
156
156
|
if (s !== void 0 && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
157
157
|
this.setNode(o), this.setNode(i), this._edgeLabels[a] = d ? l : this._defaultEdgeLabelFn(o, i, s);
|
|
158
|
-
let c =
|
|
158
|
+
let c = Mr(this._isDirected, o, i, s);
|
|
159
159
|
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c, Ct(this._preds[i], o), Ct(this._sucs[o], i), this._in[i][a] = c, this._out[o][a] = c, this._edgeCount++, this;
|
|
160
160
|
}
|
|
161
161
|
edge(e, t, n) {
|
|
162
|
-
let r = arguments.length === 1 ? Be(this._isDirected, e) :
|
|
162
|
+
let r = arguments.length === 1 ? Be(this._isDirected, e) : we(this._isDirected, e, t, n);
|
|
163
163
|
return this._edgeLabels[r];
|
|
164
164
|
}
|
|
165
165
|
edgeAsObj(e, t, n) {
|
|
@@ -167,10 +167,10 @@ var Mr = Object.defineProperty, tn = (e, t) => {
|
|
|
167
167
|
return typeof r != "object" ? { label: r } : r;
|
|
168
168
|
}
|
|
169
169
|
hasEdge(e, t, n) {
|
|
170
|
-
return (arguments.length === 1 ? Be(this._isDirected, e) :
|
|
170
|
+
return (arguments.length === 1 ? Be(this._isDirected, e) : we(this._isDirected, e, t, n)) in this._edgeLabels;
|
|
171
171
|
}
|
|
172
172
|
removeEdge(e, t, n) {
|
|
173
|
-
let r = arguments.length === 1 ? Be(this._isDirected, e) :
|
|
173
|
+
let r = arguments.length === 1 ? Be(this._isDirected, e) : we(this._isDirected, e, t, n), o = this._edgeObjs[r];
|
|
174
174
|
if (o) {
|
|
175
175
|
let i = o.v, s = o.w;
|
|
176
176
|
delete this._edgeLabels[r], delete this._edgeObjs[r], Tt(this._preds[s], i), Tt(this._sucs[i], s), delete this._in[s][r], delete this._out[i][r], this._edgeCount--;
|
|
@@ -201,7 +201,7 @@ function Ct(e, t) {
|
|
|
201
201
|
function Tt(e, t) {
|
|
202
202
|
e[t] !== void 0 && !--e[t] && delete e[t];
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function we(e, t, n, r) {
|
|
205
205
|
let o = "" + t, i = "" + n;
|
|
206
206
|
if (!e && o > i) {
|
|
207
207
|
let s = o;
|
|
@@ -209,7 +209,7 @@ function pe(e, t, n, r) {
|
|
|
209
209
|
}
|
|
210
210
|
return o + "" + i + "" + (r === void 0 ? "\0" : r);
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function Mr(e, t, n, r) {
|
|
213
213
|
let o = "" + t, i = "" + n;
|
|
214
214
|
if (!e && o > i) {
|
|
215
215
|
let l = o;
|
|
@@ -219,7 +219,7 @@ function jr(e, t, n, r) {
|
|
|
219
219
|
return r && (s.name = r), s;
|
|
220
220
|
}
|
|
221
221
|
function Be(e, t) {
|
|
222
|
-
return
|
|
222
|
+
return we(e, t.v, t.w, t.name);
|
|
223
223
|
}
|
|
224
224
|
var zr = "4.0.1", nn = {};
|
|
225
225
|
tn(nn, { read: () => Rr, write: () => Lr });
|
|
@@ -248,7 +248,7 @@ function Rr(e) {
|
|
|
248
248
|
}), t;
|
|
249
249
|
}
|
|
250
250
|
var Qe = {};
|
|
251
|
-
tn(Qe, { CycleException: () =>
|
|
251
|
+
tn(Qe, { CycleException: () => je, bellmanFord: () => rn, components: () => Dr, dijkstra: () => Oe, dijkstraAll: () => Gr, findCycles: () => Yr, floydWarshall: () => Hr, isAcyclic: () => Vr, postorder: () => Xr, preorder: () => Jr, prim: () => Zr, shortestPaths: () => Qr, tarjan: () => sn, topsort: () => ln });
|
|
252
252
|
var Ar = () => 1;
|
|
253
253
|
function rn(e, t, n, r) {
|
|
254
254
|
return Br(e, String(t), n || Ar, r || function(o) {
|
|
@@ -262,8 +262,8 @@ function Br(e, t, n, r) {
|
|
|
262
262
|
}, a = function() {
|
|
263
263
|
l.forEach(function(f) {
|
|
264
264
|
r(f).forEach(function(h) {
|
|
265
|
-
let g = h.v === f ? h.v : h.w,
|
|
266
|
-
d({ v: g, w:
|
|
265
|
+
let g = h.v === f ? h.v : h.w, E = g === h.v ? h.w : h.v;
|
|
266
|
+
d({ v: g, w: E });
|
|
267
267
|
});
|
|
268
268
|
});
|
|
269
269
|
};
|
|
@@ -339,7 +339,7 @@ var on = class {
|
|
|
339
339
|
n[e] = i, n[t] = o, r[i.key] = e, r[o.key] = t;
|
|
340
340
|
}
|
|
341
341
|
}, Wr = () => 1;
|
|
342
|
-
function
|
|
342
|
+
function Oe(e, t, n, r) {
|
|
343
343
|
let o = function(i) {
|
|
344
344
|
return e.outEdges(i);
|
|
345
345
|
};
|
|
@@ -359,7 +359,7 @@ function $r(e, t, n, r) {
|
|
|
359
359
|
}
|
|
360
360
|
function Gr(e, t, n) {
|
|
361
361
|
return e.nodes().reduce(function(r, o) {
|
|
362
|
-
return r[o] =
|
|
362
|
+
return r[o] = Oe(e, o, t, n), r;
|
|
363
363
|
}, {});
|
|
364
364
|
}
|
|
365
365
|
function sn(e) {
|
|
@@ -411,7 +411,7 @@ function Ur(e, t, n) {
|
|
|
411
411
|
});
|
|
412
412
|
}), r;
|
|
413
413
|
}
|
|
414
|
-
var
|
|
414
|
+
var je = class extends Error {
|
|
415
415
|
constructor(...e) {
|
|
416
416
|
super(...e);
|
|
417
417
|
}
|
|
@@ -419,22 +419,22 @@ var Ie = class extends Error {
|
|
|
419
419
|
function ln(e) {
|
|
420
420
|
let t = {}, n = {}, r = [];
|
|
421
421
|
function o(i) {
|
|
422
|
-
if (i in n) throw new
|
|
422
|
+
if (i in n) throw new je();
|
|
423
423
|
i in t || (n[i] = !0, t[i] = !0, e.predecessors(i).forEach(o), delete n[i], r.push(i));
|
|
424
424
|
}
|
|
425
|
-
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new
|
|
425
|
+
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new je();
|
|
426
426
|
return r;
|
|
427
427
|
}
|
|
428
428
|
function Vr(e) {
|
|
429
429
|
try {
|
|
430
430
|
ln(e);
|
|
431
431
|
} catch (t) {
|
|
432
|
-
if (t instanceof
|
|
432
|
+
if (t instanceof je) return !1;
|
|
433
433
|
throw t;
|
|
434
434
|
}
|
|
435
435
|
return !0;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function qr(e, t, n, r, o) {
|
|
438
438
|
Array.isArray(t) || (t = [t]);
|
|
439
439
|
let i = (l) => {
|
|
440
440
|
var d;
|
|
@@ -451,11 +451,11 @@ function an(e, t, n, r, o, i, s) {
|
|
|
451
451
|
}), n && (s = i(s, t))), s;
|
|
452
452
|
}
|
|
453
453
|
function dn(e, t, n) {
|
|
454
|
-
return
|
|
454
|
+
return qr(e, t, n, function(r, o) {
|
|
455
455
|
return r.push(o), r;
|
|
456
456
|
}, []);
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function Xr(e, t) {
|
|
459
459
|
return dn(e, t, "post");
|
|
460
460
|
}
|
|
461
461
|
function Jr(e, t) {
|
|
@@ -492,7 +492,7 @@ function Qr(e, t, n, r) {
|
|
|
492
492
|
}));
|
|
493
493
|
}
|
|
494
494
|
function eo(e, t, n, r) {
|
|
495
|
-
if (n === void 0) return
|
|
495
|
+
if (n === void 0) return Oe(e, t, n, r);
|
|
496
496
|
let o = !1, i = e.nodes();
|
|
497
497
|
for (let s = 0; s < i.length; s++) {
|
|
498
498
|
let l = r(i[s]);
|
|
@@ -502,9 +502,9 @@ function eo(e, t, n, r) {
|
|
|
502
502
|
}
|
|
503
503
|
if (o) return rn(e, t, n, r);
|
|
504
504
|
}
|
|
505
|
-
return
|
|
505
|
+
return Oe(e, t, n, r);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function be(e, t, n, r) {
|
|
508
508
|
let o = r;
|
|
509
509
|
for (; e.hasNode(o); ) o = et(r);
|
|
510
510
|
return n.dummy = t, e.setNode(o, n), o;
|
|
@@ -530,8 +530,8 @@ function It(e, t) {
|
|
|
530
530
|
let d, a;
|
|
531
531
|
return Math.abs(i) * s > Math.abs(o) * l ? (i < 0 && (l = -l), d = l * o / i, a = l) : (o < 0 && (s = -s), d = s, a = s * i / o), { x: n + d, y: r + a };
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
let t =
|
|
533
|
+
function Se(e) {
|
|
534
|
+
let t = xe(un(e) + 1).map(() => []);
|
|
535
535
|
return e.nodes().forEach((n) => {
|
|
536
536
|
let r = e.node(n), o = r.rank;
|
|
537
537
|
o !== void 0 && (t[o] || (t[o] = []), t[o][r.order] = n);
|
|
@@ -541,14 +541,14 @@ function no(e) {
|
|
|
541
541
|
let t = e.nodes().map((r) => {
|
|
542
542
|
let o = e.node(r).rank;
|
|
543
543
|
return o === void 0 ? Number.MAX_VALUE : o;
|
|
544
|
-
}), n =
|
|
544
|
+
}), n = Q(Math.min, t);
|
|
545
545
|
e.nodes().forEach((r) => {
|
|
546
546
|
let o = e.node(r);
|
|
547
547
|
Object.hasOwn(o, "rank") && (o.rank -= n);
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
function ro(e) {
|
|
551
|
-
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), n =
|
|
551
|
+
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), n = Q(Math.min, t), r = [];
|
|
552
552
|
e.nodes().forEach((s) => {
|
|
553
553
|
let l = e.node(s).rank - n;
|
|
554
554
|
r[l] || (r[l] = []), r[l].push(s);
|
|
@@ -560,7 +560,7 @@ function ro(e) {
|
|
|
560
560
|
}
|
|
561
561
|
function Ot(e, t, n, r) {
|
|
562
562
|
let o = { width: 0, height: 0 };
|
|
563
|
-
return arguments.length >= 4 && (o.rank = n, o.order = r),
|
|
563
|
+
return arguments.length >= 4 && (o.rank = n, o.order = r), be(e, "border", o, t);
|
|
564
564
|
}
|
|
565
565
|
function oo(e, t = fn) {
|
|
566
566
|
let n = [];
|
|
@@ -571,7 +571,7 @@ function oo(e, t = fn) {
|
|
|
571
571
|
return n;
|
|
572
572
|
}
|
|
573
573
|
var fn = 65535;
|
|
574
|
-
function
|
|
574
|
+
function Q(e, t) {
|
|
575
575
|
if (t.length > fn) {
|
|
576
576
|
let n = oo(t);
|
|
577
577
|
return e(...n.map((r) => e(...r)));
|
|
@@ -582,7 +582,7 @@ function un(e) {
|
|
|
582
582
|
let r = e.node(n).rank;
|
|
583
583
|
return r === void 0 ? Number.MIN_VALUE : r;
|
|
584
584
|
});
|
|
585
|
-
return
|
|
585
|
+
return Q(Math.max, t);
|
|
586
586
|
}
|
|
587
587
|
function io(e, t) {
|
|
588
588
|
let n = { lhs: [], rhs: [] };
|
|
@@ -606,7 +606,7 @@ function et(e) {
|
|
|
606
606
|
let t = ++so;
|
|
607
607
|
return e + ("" + t);
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function xe(e, t, n = 1) {
|
|
610
610
|
t == null && (t = e, e = 0);
|
|
611
611
|
let r = (i) => i < t;
|
|
612
612
|
n < 0 && (r = (i) => t < i);
|
|
@@ -614,19 +614,19 @@ function be(e, t, n = 1) {
|
|
|
614
614
|
for (let i = e; r(i); i += n) o.push(i);
|
|
615
615
|
return o;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function Me(e, t) {
|
|
618
618
|
let n = {};
|
|
619
619
|
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
620
620
|
return n;
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function ze(e, t) {
|
|
623
623
|
let n;
|
|
624
624
|
return typeof t == "string" ? n = (r) => r[t] : n = t, Object.entries(e).reduce((r, [o, i]) => (r[o] = n(i, o), r), {});
|
|
625
625
|
}
|
|
626
626
|
function lo(e, t) {
|
|
627
627
|
return e.reduce((n, r, o) => (n[r] = t[o], n), {});
|
|
628
628
|
}
|
|
629
|
-
var
|
|
629
|
+
var Le = "\0", ao = "3.0.0", co = class {
|
|
630
630
|
constructor() {
|
|
631
631
|
Or(this, "_sentinel");
|
|
632
632
|
let e = {};
|
|
@@ -634,11 +634,11 @@ var je = "\0", ao = "3.0.0", co = class {
|
|
|
634
634
|
}
|
|
635
635
|
dequeue() {
|
|
636
636
|
let e = this._sentinel, t = e._prev;
|
|
637
|
-
if (t !== e) return
|
|
637
|
+
if (t !== e) return jt(t), t;
|
|
638
638
|
}
|
|
639
639
|
enqueue(e) {
|
|
640
640
|
let t = this._sentinel;
|
|
641
|
-
e._prev && e._next &&
|
|
641
|
+
e._prev && e._next && jt(e), e._next = t._next, t._next._prev = e, t._next = e, e._prev = t;
|
|
642
642
|
}
|
|
643
643
|
toString() {
|
|
644
644
|
let e = [], t = this._sentinel, n = t._prev;
|
|
@@ -646,7 +646,7 @@ var je = "\0", ao = "3.0.0", co = class {
|
|
|
646
646
|
return "[" + e.join(", ") + "]";
|
|
647
647
|
}
|
|
648
648
|
};
|
|
649
|
-
function
|
|
649
|
+
function jt(e) {
|
|
650
650
|
e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
|
|
651
651
|
}
|
|
652
652
|
function fo(e, t) {
|
|
@@ -743,7 +743,7 @@ function xo(e, t) {
|
|
|
743
743
|
if (i === r + 1) return;
|
|
744
744
|
e.removeEdge(t);
|
|
745
745
|
let a, c, f;
|
|
746
|
-
for (f = 0, ++r; r < i; ++f, ++r) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: r }, a =
|
|
746
|
+
for (f = 0, ++r; r < i; ++f, ++r) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: r }, a = be(e, "edge", c, "_d"), r === d && (c.width = l.width, c.height = l.height, c.dummy = "edge-label", c.labelpos = l.labelpos), e.setEdge(n, a, { weight: l.weight }, s), f === 0 && e.graph().dummyChains.push(a), n = a;
|
|
747
747
|
e.setEdge(n, o, { weight: l.weight }, s);
|
|
748
748
|
}
|
|
749
749
|
function ko(e) {
|
|
@@ -758,12 +758,12 @@ function tt(e) {
|
|
|
758
758
|
let o = e.node(r);
|
|
759
759
|
if (Object.hasOwn(t, r)) return o.rank;
|
|
760
760
|
t[r] = !0;
|
|
761
|
-
let i = e.outEdges(r), s = i ? i.map((d) => d == null ? Number.POSITIVE_INFINITY : n(d.w) - e.edge(d).minlen) : [], l =
|
|
761
|
+
let i = e.outEdges(r), s = i ? i.map((d) => d == null ? Number.POSITIVE_INFINITY : n(d.w) - e.edge(d).minlen) : [], l = Q(Math.min, s);
|
|
762
762
|
return l === Number.POSITIVE_INFINITY && (l = 0), o.rank = l;
|
|
763
763
|
}
|
|
764
764
|
e.sources().forEach(n);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function ye(e, t) {
|
|
767
767
|
return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
|
|
768
768
|
}
|
|
769
769
|
var pn = _o;
|
|
@@ -773,7 +773,7 @@ function _o(e) {
|
|
|
773
773
|
let r = n[0], o = e.nodeCount();
|
|
774
774
|
t.setNode(r, {});
|
|
775
775
|
let i, s;
|
|
776
|
-
for (; So(t, e) < o && (i = No(t, e), !!i); ) s = t.hasNode(i.v) ?
|
|
776
|
+
for (; So(t, e) < o && (i = No(t, e), !!i); ) s = t.hasNode(i.v) ? ye(e, i) : -ye(e, i), Co(t, e, s);
|
|
777
777
|
return t;
|
|
778
778
|
}
|
|
779
779
|
function So(e, t) {
|
|
@@ -781,7 +781,7 @@ function So(e, t) {
|
|
|
781
781
|
let o = t.nodeEdges(r);
|
|
782
782
|
o && o.forEach((i) => {
|
|
783
783
|
let s = i.v, l = r === s ? i.w : s;
|
|
784
|
-
!e.hasNode(l) && !
|
|
784
|
+
!e.hasNode(l) && !ye(t, i) && (e.setNode(l, {}), e.setEdge(r, l, {}), n(l));
|
|
785
785
|
});
|
|
786
786
|
}
|
|
787
787
|
return e.nodes().forEach(n), e.nodeCount();
|
|
@@ -789,20 +789,20 @@ function So(e, t) {
|
|
|
789
789
|
function No(e, t) {
|
|
790
790
|
return t.edges().reduce((n, r) => {
|
|
791
791
|
let o = Number.POSITIVE_INFINITY;
|
|
792
|
-
return e.hasNode(r.v) !== e.hasNode(r.w) && (o =
|
|
792
|
+
return e.hasNode(r.v) !== e.hasNode(r.w) && (o = ye(t, r)), o < n[0] ? [o, r] : n;
|
|
793
793
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
794
794
|
}
|
|
795
795
|
function Co(e, t, n) {
|
|
796
796
|
e.nodes().forEach((r) => t.node(r).rank += n);
|
|
797
797
|
}
|
|
798
|
-
var { preorder: To, postorder: Io } = Qe, Oo =
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
function
|
|
798
|
+
var { preorder: To, postorder: Io } = Qe, Oo = he;
|
|
799
|
+
he.initLowLimValues = rt;
|
|
800
|
+
he.initCutValues = nt;
|
|
801
|
+
he.calcCutValue = yn;
|
|
802
|
+
he.leaveEdge = mn;
|
|
803
|
+
he.enterEdge = vn;
|
|
804
|
+
he.exchangeEdges = wn;
|
|
805
|
+
function he(e) {
|
|
806
806
|
e = to(e), tt(e);
|
|
807
807
|
let t = pn(e);
|
|
808
808
|
rt(t), nt(t, e);
|
|
@@ -811,9 +811,9 @@ function ae(e) {
|
|
|
811
811
|
}
|
|
812
812
|
function nt(e, t) {
|
|
813
813
|
let n = Io(e, e.nodes());
|
|
814
|
-
n = n.slice(0, n.length - 1), n.forEach((r) =>
|
|
814
|
+
n = n.slice(0, n.length - 1), n.forEach((r) => jo(e, t, r));
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function jo(e, t, n) {
|
|
817
817
|
let r = e.node(n).parent, o = e.edge(n, r);
|
|
818
818
|
o.cutvalue = yn(e, t, n);
|
|
819
819
|
}
|
|
@@ -850,13 +850,13 @@ function vn(e, t, n) {
|
|
|
850
850
|
let r = n.v, o = n.w;
|
|
851
851
|
t.hasEdge(r, o) || (r = n.w, o = n.v);
|
|
852
852
|
let i = e.node(r), s = e.node(o), l = i, d = !1;
|
|
853
|
-
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d ===
|
|
853
|
+
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d === Mt(e, e.node(a.v), l) && d !== Mt(e, e.node(a.w), l)).reduce((a, c) => ye(t, c) < ye(t, a) ? c : a);
|
|
854
854
|
}
|
|
855
855
|
function wn(e, t, n, r) {
|
|
856
856
|
let o = n.v, i = n.w;
|
|
857
|
-
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}), rt(e), nt(e, t),
|
|
857
|
+
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}), rt(e), nt(e, t), Mo(e, t);
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function Mo(e, t) {
|
|
860
860
|
let n = e.nodes().find((o) => !e.node(o).parent);
|
|
861
861
|
if (!n) return;
|
|
862
862
|
let r = To(e, [n]);
|
|
@@ -868,7 +868,7 @@ function jo(e, t) {
|
|
|
868
868
|
function zo(e, t, n) {
|
|
869
869
|
return e.hasEdge(t, n);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function Mt(e, t, n) {
|
|
872
872
|
return n.low <= t.lim && t.lim <= n.lim;
|
|
873
873
|
}
|
|
874
874
|
var Lo = Po;
|
|
@@ -932,13 +932,13 @@ function Wo(e) {
|
|
|
932
932
|
let i = n;
|
|
933
933
|
e.children(o).forEach(r), t[o] = { low: i, lim: n++ };
|
|
934
934
|
}
|
|
935
|
-
return e.children(
|
|
935
|
+
return e.children(Le).forEach(r), t;
|
|
936
936
|
}
|
|
937
937
|
function $o(e) {
|
|
938
|
-
let t =
|
|
938
|
+
let t = be(e, "root", {}, "_root"), n = Go(e), r = Object.values(n), o = Q(Math.max, r) - 1, i = 2 * o + 1;
|
|
939
939
|
e.graph().nestingRoot = t, e.edges().forEach((l) => e.edge(l).minlen *= i);
|
|
940
940
|
let s = Yo(e) + 1;
|
|
941
|
-
e.children(
|
|
941
|
+
e.children(Le).forEach((l) => En(e, t, i, s, o, n, l)), e.graph().nodeRankFactor = i;
|
|
942
942
|
}
|
|
943
943
|
function En(e, t, n, r, o, i, s) {
|
|
944
944
|
var l;
|
|
@@ -951,8 +951,8 @@ function En(e, t, n, r, o, i, s) {
|
|
|
951
951
|
e.setParent(a, s), f.borderTop = a, e.setParent(c, s), f.borderBottom = c, d.forEach((h) => {
|
|
952
952
|
var g;
|
|
953
953
|
En(e, t, n, r, o, i, h);
|
|
954
|
-
let
|
|
955
|
-
e.setEdge(a,
|
|
954
|
+
let E = e.node(h), m = E.borderTop ? E.borderTop : h, p = E.borderBottom ? E.borderBottom : h, k = E.borderTop ? r : 2 * r, x = m !== p ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
|
|
955
|
+
e.setEdge(a, m, { weight: k, minlen: x, nestingEdge: !0 }), e.setEdge(p, c, { weight: k, minlen: x, nestingEdge: !0 });
|
|
956
956
|
}), e.parent(s) || e.setEdge(t, a, { weight: 0, minlen: o + ((l = i[s]) != null ? l : 0) });
|
|
957
957
|
}
|
|
958
958
|
function Go(e) {
|
|
@@ -961,7 +961,7 @@ function Go(e) {
|
|
|
961
961
|
let i = e.children(r);
|
|
962
962
|
i && i.length && i.forEach((s) => n(s, o + 1)), t[r] = o;
|
|
963
963
|
}
|
|
964
|
-
return e.children(
|
|
964
|
+
return e.children(Le).forEach((r) => n(r, 1)), t;
|
|
965
965
|
}
|
|
966
966
|
function Yo(e) {
|
|
967
967
|
return e.edges().reduce((t, n) => t + e.edge(n).weight, 0);
|
|
@@ -981,10 +981,10 @@ function Uo(e) {
|
|
|
981
981
|
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i) Lt(e, "borderLeft", "_bl", n, o, i), Lt(e, "borderRight", "_br", n, o, i);
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
|
-
e.children(
|
|
984
|
+
e.children(Le).forEach(t);
|
|
985
985
|
}
|
|
986
986
|
function Lt(e, t, n, r, o, i) {
|
|
987
|
-
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d =
|
|
987
|
+
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d = be(e, "border", s, n);
|
|
988
988
|
o[t][i] = d, e.setParent(d, r), l && e.setEdge(l, d, { weight: 1 });
|
|
989
989
|
}
|
|
990
990
|
function Vo(e) {
|
|
@@ -992,10 +992,10 @@ function Vo(e) {
|
|
|
992
992
|
let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
993
993
|
(n === "lr" || n === "rl") && xn(e);
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function qo(e) {
|
|
996
996
|
var t;
|
|
997
997
|
let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
998
|
-
(n === "bt" || n === "rl") &&
|
|
998
|
+
(n === "bt" || n === "rl") && Xo(e), (n === "lr" || n === "rl") && (Jo(e), xn(e));
|
|
999
999
|
}
|
|
1000
1000
|
function xn(e) {
|
|
1001
1001
|
e.nodes().forEach((t) => Pt(e.node(t))), e.edges().forEach((t) => Pt(e.edge(t)));
|
|
@@ -1004,7 +1004,7 @@ function Pt(e) {
|
|
|
1004
1004
|
let t = e.width;
|
|
1005
1005
|
e.width = e.height, e.height = t;
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1007
|
+
function Xo(e) {
|
|
1008
1008
|
e.nodes().forEach((t) => We(e.node(t))), e.edges().forEach((t) => {
|
|
1009
1009
|
var n;
|
|
1010
1010
|
let r = e.edge(t);
|
|
@@ -1026,7 +1026,7 @@ function $e(e) {
|
|
|
1026
1026
|
e.x = e.y, e.y = t;
|
|
1027
1027
|
}
|
|
1028
1028
|
function Zo(e) {
|
|
1029
|
-
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o =
|
|
1029
|
+
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o = Q(Math.max, r), i = xe(o + 1).map(() => []);
|
|
1030
1030
|
function s(l) {
|
|
1031
1031
|
if (t[l]) return;
|
|
1032
1032
|
t[l] = !0;
|
|
@@ -1100,7 +1100,7 @@ function ri(e) {
|
|
|
1100
1100
|
let o = e.pop();
|
|
1101
1101
|
t.push(o), o.in.reverse().forEach(n(o)), o.out.forEach(r(o));
|
|
1102
1102
|
}
|
|
1103
|
-
return t.filter((o) => !o.merged).map((o) =>
|
|
1103
|
+
return t.filter((o) => !o.merged).map((o) => Me(o, ["vs", "i", "barycenter", "weight"]));
|
|
1104
1104
|
}
|
|
1105
1105
|
function oi(e, t) {
|
|
1106
1106
|
let n = 0, r = 0;
|
|
@@ -1139,8 +1139,8 @@ function kn(e, t, n, r) {
|
|
|
1139
1139
|
f.vs = [s, f.vs, l].flat(1);
|
|
1140
1140
|
let h = e.predecessors(s);
|
|
1141
1141
|
if (h && h.length) {
|
|
1142
|
-
let g = e.node(h[0]),
|
|
1143
|
-
Object.hasOwn(f, "barycenter") || (f.barycenter = 0, f.weight = 0), f.barycenter = (f.barycenter * f.weight + g.order +
|
|
1142
|
+
let g = e.node(h[0]), E = e.predecessors(l), m = e.node(E[0]);
|
|
1143
|
+
Object.hasOwn(f, "barycenter") || (f.barycenter = 0, f.weight = 0), f.barycenter = (f.barycenter * f.weight + g.order + m.order) / (f.weight + 2), f.weight += 2;
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
1146
|
return f;
|
|
@@ -1191,11 +1191,11 @@ function _n(e, t = {}) {
|
|
|
1191
1191
|
t.customOrder(e, _n);
|
|
1192
1192
|
return;
|
|
1193
1193
|
}
|
|
1194
|
-
let n = un(e), r = Rt(e,
|
|
1194
|
+
let n = un(e), r = Rt(e, xe(1, n + 1), "inEdges"), o = Rt(e, xe(n - 1, -1, -1), "outEdges"), i = Zo(e);
|
|
1195
1195
|
if (At(e, i), t.disableOptimalOrderHeuristic) return;
|
|
1196
1196
|
let s = Number.POSITIVE_INFINITY, l, d = t.constraints || [];
|
|
1197
1197
|
for (let a = 0, c = 0; c < 4; ++a, ++c) {
|
|
1198
|
-
ui(a % 2 ? r : o, a % 4 >= 2, d), i =
|
|
1198
|
+
ui(a % 2 ? r : o, a % 4 >= 2, d), i = Se(e);
|
|
1199
1199
|
let f = Qo(e, i);
|
|
1200
1200
|
f < s ? (c = 0, l = Object.assign({}, i), s = f) : f === s && (l = structuredClone(i));
|
|
1201
1201
|
}
|
|
@@ -1230,11 +1230,11 @@ function hi(e, t) {
|
|
|
1230
1230
|
let s = 0, l = 0, d = o.length, a = i[i.length - 1];
|
|
1231
1231
|
return i.forEach((c, f) => {
|
|
1232
1232
|
let h = pi(e, c), g = h ? e.node(h).order : d;
|
|
1233
|
-
(h || c === a) && (i.slice(l, f + 1).forEach((
|
|
1234
|
-
let
|
|
1235
|
-
|
|
1236
|
-
let
|
|
1237
|
-
(
|
|
1233
|
+
(h || c === a) && (i.slice(l, f + 1).forEach((E) => {
|
|
1234
|
+
let m = e.predecessors(E);
|
|
1235
|
+
m && m.forEach((p) => {
|
|
1236
|
+
let k = e.node(p), x = k.order;
|
|
1237
|
+
(x < s || g < x) && !(k.dummy && e.node(E).dummy) && Sn(n, p, E);
|
|
1238
1238
|
});
|
|
1239
1239
|
}), l = f + 1, s = g);
|
|
1240
1240
|
}), i;
|
|
@@ -1244,14 +1244,14 @@ function hi(e, t) {
|
|
|
1244
1244
|
function gi(e, t) {
|
|
1245
1245
|
let n = {};
|
|
1246
1246
|
function r(i, s, l, d, a) {
|
|
1247
|
-
|
|
1247
|
+
xe(s, l).forEach((c) => {
|
|
1248
1248
|
let f = i[c];
|
|
1249
1249
|
if (f !== void 0 && e.node(f).dummy) {
|
|
1250
1250
|
let h = e.predecessors(f);
|
|
1251
1251
|
h && h.forEach((g) => {
|
|
1252
1252
|
if (g === void 0) return;
|
|
1253
|
-
let
|
|
1254
|
-
|
|
1253
|
+
let E = e.node(g);
|
|
1254
|
+
E.dummy && (E.order < d || E.order > a) && Sn(n, g, f);
|
|
1255
1255
|
});
|
|
1256
1256
|
}
|
|
1257
1257
|
});
|
|
@@ -1305,17 +1305,17 @@ function bi(e, t, n, r) {
|
|
|
1305
1305
|
l.forEach((a) => {
|
|
1306
1306
|
let c = r(a);
|
|
1307
1307
|
if (c && c.length) {
|
|
1308
|
-
let f = c.sort((g,
|
|
1309
|
-
let
|
|
1310
|
-
return (
|
|
1308
|
+
let f = c.sort((g, E) => {
|
|
1309
|
+
let m = s[g], p = s[E];
|
|
1310
|
+
return (m !== void 0 ? m : 0) - (p !== void 0 ? p : 0);
|
|
1311
1311
|
}), h = (f.length - 1) / 2;
|
|
1312
|
-
for (let g = Math.floor(h),
|
|
1313
|
-
let
|
|
1314
|
-
if (
|
|
1315
|
-
let
|
|
1316
|
-
if (
|
|
1317
|
-
let
|
|
1318
|
-
|
|
1312
|
+
for (let g = Math.floor(h), E = Math.ceil(h); g <= E; ++g) {
|
|
1313
|
+
let m = f[g];
|
|
1314
|
+
if (m === void 0) continue;
|
|
1315
|
+
let p = s[m];
|
|
1316
|
+
if (p !== void 0 && i[a] === a && d < p && !yi(n, a, m)) {
|
|
1317
|
+
let k = o[m];
|
|
1318
|
+
k !== void 0 && (i[m] = a, i[a] = o[a] = k, d = p);
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
@@ -1324,33 +1324,33 @@ function bi(e, t, n, r) {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
function mi(e, t, n, r, o = !1) {
|
|
1326
1326
|
let i = {}, s = vi(e, t, n, o), l = o ? "borderLeft" : "borderRight";
|
|
1327
|
-
function d(g,
|
|
1328
|
-
let
|
|
1329
|
-
for (;
|
|
1330
|
-
if (
|
|
1327
|
+
function d(g, E) {
|
|
1328
|
+
let m = s.nodes().slice(), p = {}, k = m.pop();
|
|
1329
|
+
for (; k; ) {
|
|
1330
|
+
if (p[k]) g(k);
|
|
1331
1331
|
else {
|
|
1332
|
-
|
|
1333
|
-
for (let
|
|
1332
|
+
p[k] = !0, m.push(k);
|
|
1333
|
+
for (let x of E(k)) m.push(x);
|
|
1334
1334
|
}
|
|
1335
|
-
|
|
1335
|
+
k = m.pop();
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
1338
|
function a(g) {
|
|
1339
|
-
let
|
|
1340
|
-
|
|
1341
|
-
var
|
|
1342
|
-
let
|
|
1343
|
-
return Math.max(
|
|
1339
|
+
let E = s.inEdges(g);
|
|
1340
|
+
E ? i[g] = E.reduce((m, p) => {
|
|
1341
|
+
var k;
|
|
1342
|
+
let x = (k = i[p.v]) != null ? k : 0, O = s.edge(p);
|
|
1343
|
+
return Math.max(m, x + (O !== void 0 ? O : 0));
|
|
1344
1344
|
}, 0) : i[g] = 0;
|
|
1345
1345
|
}
|
|
1346
1346
|
function c(g) {
|
|
1347
|
-
let
|
|
1348
|
-
|
|
1349
|
-
let
|
|
1350
|
-
return Math.min(
|
|
1347
|
+
let E = s.outEdges(g), m = Number.POSITIVE_INFINITY;
|
|
1348
|
+
E && (m = E.reduce((k, x) => {
|
|
1349
|
+
let O = i[x.w], L = s.edge(x);
|
|
1350
|
+
return Math.min(k, (O !== void 0 ? O : 0) - (L !== void 0 ? L : 0));
|
|
1351
1351
|
}, Number.POSITIVE_INFINITY));
|
|
1352
|
-
let
|
|
1353
|
-
|
|
1352
|
+
let p = e.node(g);
|
|
1353
|
+
m !== Number.POSITIVE_INFINITY && p.borderType !== l && (i[g] = Math.max(i[g] !== void 0 ? i[g] : 0, m));
|
|
1354
1354
|
}
|
|
1355
1355
|
function f(g) {
|
|
1356
1356
|
return s.predecessors(g) || [];
|
|
@@ -1359,9 +1359,9 @@ function mi(e, t, n, r, o = !1) {
|
|
|
1359
1359
|
return s.successors(g) || [];
|
|
1360
1360
|
}
|
|
1361
1361
|
return d(a, f), d(c, h), Object.keys(r).forEach((g) => {
|
|
1362
|
-
var
|
|
1363
|
-
let
|
|
1364
|
-
|
|
1362
|
+
var E;
|
|
1363
|
+
let m = n[g];
|
|
1364
|
+
m !== void 0 && (i[g] = (E = i[m]) != null ? E : 0);
|
|
1365
1365
|
}), i;
|
|
1366
1366
|
}
|
|
1367
1367
|
function vi(e, t, n, r) {
|
|
@@ -1395,19 +1395,19 @@ function wi(e, t) {
|
|
|
1395
1395
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
1396
1396
|
}
|
|
1397
1397
|
function Ei(e, t) {
|
|
1398
|
-
let n = Object.values(t), r =
|
|
1398
|
+
let n = Object.values(t), r = Q(Math.min, n), o = Q(Math.max, n);
|
|
1399
1399
|
["u", "d"].forEach((i) => {
|
|
1400
1400
|
["l", "r"].forEach((s) => {
|
|
1401
1401
|
let l = i + s, d = e[l];
|
|
1402
1402
|
if (!d || d === t) return;
|
|
1403
|
-
let a = Object.values(d), c = r -
|
|
1404
|
-
s !== "l" && (c = o -
|
|
1403
|
+
let a = Object.values(d), c = r - Q(Math.min, a);
|
|
1404
|
+
s !== "l" && (c = o - Q(Math.max, a)), c && (e[l] = ze(d, (f) => f + c));
|
|
1405
1405
|
});
|
|
1406
1406
|
});
|
|
1407
1407
|
}
|
|
1408
1408
|
function xi(e, t = void 0) {
|
|
1409
1409
|
let n = e.ul;
|
|
1410
|
-
return n ?
|
|
1410
|
+
return n ? ze(n, (r, o) => {
|
|
1411
1411
|
var i, s;
|
|
1412
1412
|
if (t) {
|
|
1413
1413
|
let d = t.toLowerCase(), a = e[d];
|
|
@@ -1421,12 +1421,12 @@ function xi(e, t = void 0) {
|
|
|
1421
1421
|
}) : {};
|
|
1422
1422
|
}
|
|
1423
1423
|
function ki(e) {
|
|
1424
|
-
let t =
|
|
1424
|
+
let t = Se(e), n = Object.assign(hi(e, t), gi(e, t)), r = {}, o;
|
|
1425
1425
|
["u", "d"].forEach((s) => {
|
|
1426
1426
|
o = s === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((l) => {
|
|
1427
1427
|
l === "r" && (o = o.map((c) => Object.values(c).reverse()));
|
|
1428
1428
|
let d = bi(e, o, n, (c) => (s === "u" ? e.predecessors(c) : e.successors(c)) || []), a = mi(e, o, d.root, d.align, l === "r");
|
|
1429
|
-
l === "r" && (a =
|
|
1429
|
+
l === "r" && (a = ze(a, (c) => -c)), r[s + l] = a;
|
|
1430
1430
|
});
|
|
1431
1431
|
});
|
|
1432
1432
|
let i = wi(e, r);
|
|
@@ -1461,7 +1461,7 @@ function Ni(e) {
|
|
|
1461
1461
|
e = cn(e), Ci(e), Object.entries(ki(e)).forEach(([t, n]) => e.node(t).x = n);
|
|
1462
1462
|
}
|
|
1463
1463
|
function Ci(e) {
|
|
1464
|
-
let t =
|
|
1464
|
+
let t = Se(e), n = e.graph(), r = n.ranksep, o = n.rankalign, i = 0;
|
|
1465
1465
|
t.forEach((s) => {
|
|
1466
1466
|
let l = s.reduce((d, a) => {
|
|
1467
1467
|
var c;
|
|
@@ -1482,7 +1482,7 @@ function Ti(e, t = {}) {
|
|
|
1482
1482
|
});
|
|
1483
1483
|
}
|
|
1484
1484
|
function Ii(e, t, n) {
|
|
1485
|
-
t(" makeSpaceForEdgeLabels", () => Bi(e)), t(" removeSelfEdges", () => Vi(e)), t(" acyclic", () => mo(e)), t(" nestingGraph.run", () => $o(e)), t(" rank", () => Lo(cn(e))), t(" injectEdgeLabelProxies", () => Di(e)), t(" removeEmptyRanks", () => ro(e)), t(" nestingGraph.cleanup", () => Ko(e)), t(" normalizeRanks", () => no(e)), t(" assignRankMinMax", () => Wi(e)), t(" removeEdgeLabelProxies", () => $i(e)), t(" normalize.run", () => Eo(e)), t(" parentDummyChains", () => Ao(e)), t(" addBorderSegments", () => Ho(e)), t(" order", () => _n(e, n)), t(" insertSelfEdges", () =>
|
|
1485
|
+
t(" makeSpaceForEdgeLabels", () => Bi(e)), t(" removeSelfEdges", () => Vi(e)), t(" acyclic", () => mo(e)), t(" nestingGraph.run", () => $o(e)), t(" rank", () => Lo(cn(e))), t(" injectEdgeLabelProxies", () => Di(e)), t(" removeEmptyRanks", () => ro(e)), t(" nestingGraph.cleanup", () => Ko(e)), t(" normalizeRanks", () => no(e)), t(" assignRankMinMax", () => Wi(e)), t(" removeEdgeLabelProxies", () => $i(e)), t(" normalize.run", () => Eo(e)), t(" parentDummyChains", () => Ao(e)), t(" addBorderSegments", () => Ho(e)), t(" order", () => _n(e, n)), t(" insertSelfEdges", () => qi(e)), t(" adjustCoordinateSystem", () => Vo(e)), t(" position", () => Ni(e)), t(" positionSelfEdges", () => Xi(e)), t(" removeBorderNodes", () => Ui(e)), t(" normalize.undo", () => ko(e)), t(" fixupEdgeLabelCoords", () => Ki(e)), t(" undoCoordinateSystem", () => qo(e)), t(" translateGraph", () => Gi(e)), t(" assignNodeIntersects", () => Yi(e)), t(" reversePoints", () => Hi(e)), t(" acyclic.undo", () => wo(e));
|
|
1486
1486
|
}
|
|
1487
1487
|
function Oi(e, t) {
|
|
1488
1488
|
e.nodes().forEach((n) => {
|
|
@@ -1493,10 +1493,10 @@ function Oi(e, t) {
|
|
|
1493
1493
|
r.points = o.points, Object.hasOwn(o, "x") && (r.x = o.x, r.y = o.y);
|
|
1494
1494
|
}), e.graph().width = t.graph().width, e.graph().height = t.graph().height;
|
|
1495
1495
|
}
|
|
1496
|
-
var
|
|
1496
|
+
var ji = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], Mi = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, zi = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], Li = ["width", "height", "rank"], Bt = { width: 0, height: 0 }, Pi = ["minlen", "weight", "width", "height", "labeloffset"], Fi = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, Ri = ["labelpos"];
|
|
1497
1497
|
function Ai(e) {
|
|
1498
1498
|
let t = new V({ multigraph: !0, compound: !0 }), n = Ye(e.graph());
|
|
1499
|
-
return t.setGraph(Object.assign({},
|
|
1499
|
+
return t.setGraph(Object.assign({}, Mi, Ge(n, ji), Me(n, zi))), e.nodes().forEach((r) => {
|
|
1500
1500
|
let o = Ye(e.node(r)), i = Ge(o, Li);
|
|
1501
1501
|
Object.keys(Bt).forEach((l) => {
|
|
1502
1502
|
i[l] === void 0 && (i[l] = Bt[l]);
|
|
@@ -1505,7 +1505,7 @@ function Ai(e) {
|
|
|
1505
1505
|
s !== void 0 && t.setParent(r, s);
|
|
1506
1506
|
}), e.edges().forEach((r) => {
|
|
1507
1507
|
let o = Ye(e.edge(r));
|
|
1508
|
-
t.setEdge(r, Object.assign({}, Fi, Ge(o, Pi),
|
|
1508
|
+
t.setEdge(r, Object.assign({}, Fi, Ge(o, Pi), Me(o, Ri)));
|
|
1509
1509
|
}), t;
|
|
1510
1510
|
}
|
|
1511
1511
|
function Bi(e) {
|
|
@@ -1520,7 +1520,7 @@ function Di(e) {
|
|
|
1520
1520
|
let n = e.edge(t);
|
|
1521
1521
|
if (n.width && n.height) {
|
|
1522
1522
|
let r = e.node(t.v), o = { rank: (e.node(t.w).rank - r.rank) / 2 + r.rank, e: t };
|
|
1523
|
-
|
|
1523
|
+
be(e, "edge-proxy", o, "_ep");
|
|
1524
1524
|
}
|
|
1525
1525
|
});
|
|
1526
1526
|
}
|
|
@@ -1602,18 +1602,18 @@ function Vi(e) {
|
|
|
1602
1602
|
}
|
|
1603
1603
|
});
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1606
|
-
|
|
1605
|
+
function qi(e) {
|
|
1606
|
+
Se(e).forEach((t) => {
|
|
1607
1607
|
let n = 0;
|
|
1608
1608
|
t.forEach((r, o) => {
|
|
1609
1609
|
let i = e.node(r);
|
|
1610
1610
|
i.order = o + n, (i.selfEdges || []).forEach((s) => {
|
|
1611
|
-
|
|
1611
|
+
be(e, "selfedge", { width: s.label.width, height: s.label.height, rank: i.rank, order: o + ++n, e: s.e, label: s.label }, "_se");
|
|
1612
1612
|
}), delete i.selfEdges;
|
|
1613
1613
|
});
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
|
-
function
|
|
1616
|
+
function Xi(e) {
|
|
1617
1617
|
e.nodes().forEach((t) => {
|
|
1618
1618
|
let n = e.node(t);
|
|
1619
1619
|
if (n.dummy === "selfedge") {
|
|
@@ -1623,7 +1623,7 @@ function qi(e) {
|
|
|
1623
1623
|
});
|
|
1624
1624
|
}
|
|
1625
1625
|
function Ge(e, t) {
|
|
1626
|
-
return Me(
|
|
1626
|
+
return ze(Me(e, t), Number);
|
|
1627
1627
|
}
|
|
1628
1628
|
function Ye(e) {
|
|
1629
1629
|
let t = {};
|
|
@@ -1632,7 +1632,7 @@ function Ye(e) {
|
|
|
1632
1632
|
}), t;
|
|
1633
1633
|
}
|
|
1634
1634
|
function Ji(e) {
|
|
1635
|
-
let t =
|
|
1635
|
+
let t = Se(e), n = new V({ compound: !0, multigraph: !0 }).setGraph({});
|
|
1636
1636
|
return e.nodes().forEach((r) => {
|
|
1637
1637
|
n.setNode(r, { label: r }), n.setParent(r, "layer" + e.node(r).rank);
|
|
1638
1638
|
}), e.edges().forEach((r) => n.setEdge(r.v, r.w, {}, r.name)), t.forEach((r, o) => {
|
|
@@ -1649,7 +1649,7 @@ const Qi = (e) => {
|
|
|
1649
1649
|
const n = $n(Qi), r = _t("");
|
|
1650
1650
|
_t(0);
|
|
1651
1651
|
const { fitView: o } = Gn();
|
|
1652
|
-
return
|
|
1652
|
+
return se(() => {
|
|
1653
1653
|
if (!n || n === r.current) return;
|
|
1654
1654
|
const i = {};
|
|
1655
1655
|
for (const s of n.split(",")) {
|
|
@@ -1674,11 +1674,11 @@ function ns({
|
|
|
1674
1674
|
saveLabel: s = "Save",
|
|
1675
1675
|
saveDisabled: l = !1
|
|
1676
1676
|
}) {
|
|
1677
|
-
const [d, a] =
|
|
1678
|
-
|
|
1677
|
+
const [d, a] = W.useState(!1), [c, f] = W.useState(!1), [h, g] = W.useState(e ?? "");
|
|
1678
|
+
W.useEffect(() => {
|
|
1679
1679
|
g(e ?? "");
|
|
1680
1680
|
}, [e]);
|
|
1681
|
-
const
|
|
1681
|
+
const E = async () => {
|
|
1682
1682
|
if (!(!o || d || l)) {
|
|
1683
1683
|
a(!0);
|
|
1684
1684
|
try {
|
|
@@ -1687,7 +1687,7 @@ function ns({
|
|
|
1687
1687
|
a(!1);
|
|
1688
1688
|
}
|
|
1689
1689
|
}
|
|
1690
|
-
},
|
|
1690
|
+
}, m = ts[r] ?? {
|
|
1691
1691
|
bg: r,
|
|
1692
1692
|
fg: "#fff"
|
|
1693
1693
|
};
|
|
@@ -1709,12 +1709,12 @@ function ns({
|
|
|
1709
1709
|
"input",
|
|
1710
1710
|
{
|
|
1711
1711
|
value: h,
|
|
1712
|
-
onChange: (
|
|
1712
|
+
onChange: (p) => g(p.target.value),
|
|
1713
1713
|
onBlur: () => {
|
|
1714
1714
|
f(!1), h !== e && t(h);
|
|
1715
1715
|
},
|
|
1716
|
-
onKeyDown: (
|
|
1717
|
-
|
|
1716
|
+
onKeyDown: (p) => {
|
|
1717
|
+
p.key === "Enter" && p.target.blur(), p.key === "Escape" && (g(e ?? ""), f(!1));
|
|
1718
1718
|
},
|
|
1719
1719
|
autoFocus: !0,
|
|
1720
1720
|
style: {
|
|
@@ -1753,8 +1753,8 @@ function ns({
|
|
|
1753
1753
|
fontWeight: 600,
|
|
1754
1754
|
padding: "3px 8px",
|
|
1755
1755
|
borderRadius: 999,
|
|
1756
|
-
background:
|
|
1757
|
-
color:
|
|
1756
|
+
background: m.bg,
|
|
1757
|
+
color: m.fg,
|
|
1758
1758
|
textTransform: "uppercase",
|
|
1759
1759
|
letterSpacing: 0.4,
|
|
1760
1760
|
flexShrink: 0
|
|
@@ -1788,7 +1788,7 @@ function ns({
|
|
|
1788
1788
|
"button",
|
|
1789
1789
|
{
|
|
1790
1790
|
type: "button",
|
|
1791
|
-
onClick:
|
|
1791
|
+
onClick: E,
|
|
1792
1792
|
disabled: d || l,
|
|
1793
1793
|
style: {
|
|
1794
1794
|
padding: "6px 16px",
|
|
@@ -1813,16 +1813,16 @@ function ns({
|
|
|
1813
1813
|
}
|
|
1814
1814
|
);
|
|
1815
1815
|
}
|
|
1816
|
-
const
|
|
1817
|
-
const [l, d] =
|
|
1818
|
-
r && /* @__PURE__ */ u(
|
|
1816
|
+
const ke = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i, width: s = 720 }) => {
|
|
1817
|
+
const [l, d] = z(!1), a = () => d((h) => !h), c = () => /* @__PURE__ */ w(te, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
|
|
1818
|
+
r && /* @__PURE__ */ u(te, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: r }),
|
|
1819
1819
|
/* @__PURE__ */ u("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 500, color: "#212121" }, children: n }),
|
|
1820
1820
|
/* @__PURE__ */ u(St, { onClick: a, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ u(vr, {}) : /* @__PURE__ */ u(wr, {}) }),
|
|
1821
1821
|
/* @__PURE__ */ u(St, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ u(or, {}) })
|
|
1822
|
-
] }), f = () => i ? /* @__PURE__ */ u(
|
|
1822
|
+
] }), f = () => i ? /* @__PURE__ */ u(te, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
|
|
1823
1823
|
return l ? /* @__PURE__ */ w(er, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
|
|
1824
1824
|
/* @__PURE__ */ u(c, {}),
|
|
1825
|
-
/* @__PURE__ */ u(
|
|
1825
|
+
/* @__PURE__ */ u(te, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1826
1826
|
/* @__PURE__ */ u(f, {})
|
|
1827
1827
|
] }) : /* @__PURE__ */ w(
|
|
1828
1828
|
tr,
|
|
@@ -1850,7 +1850,7 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1850
1850
|
},
|
|
1851
1851
|
children: [
|
|
1852
1852
|
/* @__PURE__ */ u(c, {}),
|
|
1853
|
-
/* @__PURE__ */ u(
|
|
1853
|
+
/* @__PURE__ */ u(te, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1854
1854
|
/* @__PURE__ */ u(f, {})
|
|
1855
1855
|
]
|
|
1856
1856
|
}
|
|
@@ -1863,75 +1863,75 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1863
1863
|
onClose: o,
|
|
1864
1864
|
loadTriggerSources: i
|
|
1865
1865
|
}) => {
|
|
1866
|
-
const [s, l] =
|
|
1867
|
-
|
|
1868
|
-
e || (l("trigger"), a(null), f([]), g([]),
|
|
1866
|
+
const [s, l] = z("trigger"), [d, a] = z(null), [c, f] = z([]), [h, g] = z([]), [E, m] = z(!1), [p, k] = z(null);
|
|
1867
|
+
se(() => {
|
|
1868
|
+
e || (l("trigger"), a(null), f([]), g([]), m(!1), k(null));
|
|
1869
1869
|
}, [e]);
|
|
1870
|
-
const
|
|
1870
|
+
const x = H(async (P) => {
|
|
1871
1871
|
if (!i) {
|
|
1872
1872
|
r(P);
|
|
1873
1873
|
return;
|
|
1874
1874
|
}
|
|
1875
|
-
a(P),
|
|
1875
|
+
a(P), m(!0), k(null);
|
|
1876
1876
|
try {
|
|
1877
|
-
const
|
|
1878
|
-
if (!
|
|
1877
|
+
const M = await i(P.triggerKey);
|
|
1878
|
+
if (!M || M.length === 0) {
|
|
1879
1879
|
r(P);
|
|
1880
1880
|
return;
|
|
1881
1881
|
}
|
|
1882
|
-
f(
|
|
1883
|
-
} catch (
|
|
1884
|
-
|
|
1882
|
+
f(M), l("sources");
|
|
1883
|
+
} catch (M) {
|
|
1884
|
+
k(M instanceof Error ? M.message : "Failed to load sources.");
|
|
1885
1885
|
} finally {
|
|
1886
|
-
|
|
1886
|
+
m(!1);
|
|
1887
1887
|
}
|
|
1888
|
-
}, [i, r]),
|
|
1889
|
-
l("trigger"), a(null), f([]), g([]),
|
|
1890
|
-
},
|
|
1888
|
+
}, [i, r]), O = () => {
|
|
1889
|
+
l("trigger"), a(null), f([]), g([]), k(null);
|
|
1890
|
+
}, L = () => {
|
|
1891
1891
|
d && r(d, h);
|
|
1892
|
-
},
|
|
1893
|
-
/* @__PURE__ */ u(
|
|
1892
|
+
}, D = s === "sources" && d, G = D ? /* @__PURE__ */ w(Ee, { children: [
|
|
1893
|
+
/* @__PURE__ */ u(Ie, { type: "button", variant: "outlined", size: "small", onClick: O, children: n.cancel ?? "Back" }),
|
|
1894
1894
|
/* @__PURE__ */ u(
|
|
1895
|
-
|
|
1895
|
+
Ie,
|
|
1896
1896
|
{
|
|
1897
1897
|
type: "button",
|
|
1898
1898
|
variant: "contained",
|
|
1899
1899
|
size: "small",
|
|
1900
|
-
onClick:
|
|
1900
|
+
onClick: L,
|
|
1901
1901
|
disabled: h.length === 0,
|
|
1902
1902
|
children: n.save ?? "Continue"
|
|
1903
1903
|
}
|
|
1904
1904
|
)
|
|
1905
1905
|
] }) : null;
|
|
1906
1906
|
return /* @__PURE__ */ u(
|
|
1907
|
-
|
|
1907
|
+
ke,
|
|
1908
1908
|
{
|
|
1909
1909
|
isOpen: e,
|
|
1910
1910
|
onClose: o,
|
|
1911
|
-
title:
|
|
1911
|
+
title: D ? d.label : n.addTriggerTitle,
|
|
1912
1912
|
icon: /* @__PURE__ */ u(mr, {}),
|
|
1913
1913
|
width: 500,
|
|
1914
|
-
footer:
|
|
1915
|
-
children: /* @__PURE__ */ w(
|
|
1916
|
-
!
|
|
1914
|
+
footer: G,
|
|
1915
|
+
children: /* @__PURE__ */ w(te, { sx: { p: 2 }, children: [
|
|
1916
|
+
!D && /* @__PURE__ */ w(Ee, { children: [
|
|
1917
1917
|
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: n.chooseTrigger }),
|
|
1918
1918
|
/* @__PURE__ */ w("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
|
|
1919
1919
|
t.map((P) => /* @__PURE__ */ w(
|
|
1920
1920
|
"div",
|
|
1921
1921
|
{
|
|
1922
1922
|
className: "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-start ff-gap-3",
|
|
1923
|
-
style: { cursor:
|
|
1924
|
-
onClick: () => !
|
|
1923
|
+
style: { cursor: E ? "wait" : "pointer", transition: "background 0.15s", opacity: E ? 0.6 : 1 },
|
|
1924
|
+
onClick: () => !E && x(P),
|
|
1925
1925
|
role: "button",
|
|
1926
1926
|
tabIndex: 0,
|
|
1927
|
-
onKeyDown: (
|
|
1928
|
-
|
|
1927
|
+
onKeyDown: (M) => {
|
|
1928
|
+
M.key === "Enter" && !E && x(P);
|
|
1929
1929
|
},
|
|
1930
|
-
onMouseEnter: (
|
|
1931
|
-
|
|
1930
|
+
onMouseEnter: (M) => {
|
|
1931
|
+
E || (M.currentTarget.style.background = "#f5f5f5");
|
|
1932
1932
|
},
|
|
1933
|
-
onMouseLeave: (
|
|
1934
|
-
|
|
1933
|
+
onMouseLeave: (M) => {
|
|
1934
|
+
M.currentTarget.style.background = "";
|
|
1935
1935
|
},
|
|
1936
1936
|
children: [
|
|
1937
1937
|
/* @__PURE__ */ u("div", { style: { color: P.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: P.triggerCategory === "scheduler" ? /* @__PURE__ */ u(ir, { size: 18 }) : /* @__PURE__ */ u(sr, { size: 18 }) }),
|
|
@@ -1945,21 +1945,21 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1945
1945
|
)),
|
|
1946
1946
|
t.length === 0 && /* @__PURE__ */ u("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noTriggers })
|
|
1947
1947
|
] }),
|
|
1948
|
-
|
|
1948
|
+
E && /* @__PURE__ */ w(te, { sx: { display: "flex", alignItems: "center", gap: 1, mt: 2, fontSize: 12, color: "#64748b" }, children: [
|
|
1949
1949
|
/* @__PURE__ */ u(nr, { size: 14 }),
|
|
1950
1950
|
/* @__PURE__ */ u("span", { children: "Loading sources for the selected trigger…" })
|
|
1951
1951
|
] }),
|
|
1952
|
-
|
|
1952
|
+
p && /* @__PURE__ */ u("p", { style: { fontSize: 12, color: "#d32f2f", marginTop: 12 }, children: p })
|
|
1953
1953
|
] }),
|
|
1954
|
-
|
|
1954
|
+
D && /* @__PURE__ */ w(Ee, { children: [
|
|
1955
1955
|
/* @__PURE__ */ w(
|
|
1956
1956
|
"div",
|
|
1957
1957
|
{
|
|
1958
1958
|
role: "button",
|
|
1959
1959
|
tabIndex: 0,
|
|
1960
|
-
onClick:
|
|
1960
|
+
onClick: O,
|
|
1961
1961
|
onKeyDown: (P) => {
|
|
1962
|
-
P.key === "Enter" &&
|
|
1962
|
+
P.key === "Enter" && O();
|
|
1963
1963
|
},
|
|
1964
1964
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1965
1965
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
@@ -1999,8 +1999,8 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1999
1999
|
const f = /* @__PURE__ */ new Map(), h = [];
|
|
2000
2000
|
for (const g of t)
|
|
2001
2001
|
if (g.app) {
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2002
|
+
const E = f.get(g.app.key);
|
|
2003
|
+
E ? E.descriptors.push(g) : f.set(g.app.key, {
|
|
2004
2004
|
key: g.app.key,
|
|
2005
2005
|
label: g.app.label,
|
|
2006
2006
|
icon: g.app.icon,
|
|
@@ -2010,22 +2010,22 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2010
2010
|
} else
|
|
2011
2011
|
h.push(g);
|
|
2012
2012
|
return { apps: [...f.values()], ungrouped: h };
|
|
2013
|
-
}, [t]), [l, d] =
|
|
2014
|
-
|
|
2013
|
+
}, [t]), [l, d] = z(null), a = l ? i.find((f) => f.key === l) ?? null : null;
|
|
2014
|
+
se(() => {
|
|
2015
2015
|
e || d(null);
|
|
2016
|
-
}, [e]),
|
|
2016
|
+
}, [e]), se(() => {
|
|
2017
2017
|
d(null);
|
|
2018
2018
|
}, [t]);
|
|
2019
2019
|
const c = !a;
|
|
2020
2020
|
return /* @__PURE__ */ u(
|
|
2021
|
-
|
|
2021
|
+
ke,
|
|
2022
2022
|
{
|
|
2023
2023
|
isOpen: e,
|
|
2024
2024
|
onClose: o,
|
|
2025
2025
|
title: c ? n.addStepTitle : a.label,
|
|
2026
2026
|
icon: c ? /* @__PURE__ */ u(lr, {}) : a.icon ?? /* @__PURE__ */ u(ar, {}),
|
|
2027
2027
|
width: 500,
|
|
2028
|
-
children: /* @__PURE__ */ w(
|
|
2028
|
+
children: /* @__PURE__ */ w(te, { sx: { p: 2 }, children: [
|
|
2029
2029
|
!c && /* @__PURE__ */ w(
|
|
2030
2030
|
"div",
|
|
2031
2031
|
{
|
|
@@ -2044,7 +2044,7 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2044
2044
|
}
|
|
2045
2045
|
),
|
|
2046
2046
|
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? n.chooseAction : `Pick an action from ${a.label}` }),
|
|
2047
|
-
/* @__PURE__ */ u("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(
|
|
2047
|
+
/* @__PURE__ */ u("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(Ee, { children: [
|
|
2048
2048
|
i.map((f) => /* @__PURE__ */ w(
|
|
2049
2049
|
"div",
|
|
2050
2050
|
{
|
|
@@ -2139,31 +2139,31 @@ function Gt(e) {
|
|
|
2139
2139
|
}) : Array.isArray(e.fields) && e.fields.length > 0;
|
|
2140
2140
|
}
|
|
2141
2141
|
const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o, onSave: i, onClose: s }) => {
|
|
2142
|
-
const [l, d] =
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
}, [r, t]),
|
|
2146
|
-
let
|
|
2142
|
+
const [l, d] = z({ layout: "flat", fields: [] }), [a, c] = z(!1), [f, h] = z(null), [g, E] = z({});
|
|
2143
|
+
se(() => {
|
|
2144
|
+
E((r == null ? void 0 : r[Wt]) ?? {});
|
|
2145
|
+
}, [r, t]), se(() => {
|
|
2146
|
+
let x = !1;
|
|
2147
2147
|
if (h(null), !n || !t || n.customPanel) {
|
|
2148
2148
|
d({ layout: "flat", fields: [] }), c(!1);
|
|
2149
2149
|
return;
|
|
2150
2150
|
}
|
|
2151
|
-
const
|
|
2152
|
-
return typeof
|
|
2153
|
-
|
|
2154
|
-
}).catch((
|
|
2155
|
-
|
|
2156
|
-
})) : (d($t(
|
|
2157
|
-
|
|
2151
|
+
const O = n.formSchema;
|
|
2152
|
+
return typeof O == "function" ? (c(!0), O(t).then((L) => {
|
|
2153
|
+
x || (d($t(L)), c(!1));
|
|
2154
|
+
}).catch((L) => {
|
|
2155
|
+
x || (d({ layout: "flat", fields: [] }), h(L instanceof Error ? L.message : "Unable to load configuration."), c(!1));
|
|
2156
|
+
})) : (d($t(O)), c(!1)), () => {
|
|
2157
|
+
x = !0;
|
|
2158
2158
|
};
|
|
2159
2159
|
}, [n, t]);
|
|
2160
|
-
const
|
|
2161
|
-
/* @__PURE__ */ u(
|
|
2160
|
+
const m = t ? `node-config-form-${t}` : "node-config-form", p = !a && !f && Gt(l), k = p ? /* @__PURE__ */ w(Ee, { children: [
|
|
2161
|
+
/* @__PURE__ */ u(Ie, { type: "button", variant: "text", size: "small", sx: { textTransform: "none", color: "#475569" }, onClick: s, children: o.cancel }),
|
|
2162
2162
|
/* @__PURE__ */ u(
|
|
2163
|
-
|
|
2163
|
+
Ie,
|
|
2164
2164
|
{
|
|
2165
2165
|
type: "submit",
|
|
2166
|
-
form:
|
|
2166
|
+
form: m,
|
|
2167
2167
|
variant: "contained",
|
|
2168
2168
|
size: "small",
|
|
2169
2169
|
disableElevation: !0,
|
|
@@ -2178,38 +2178,38 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2178
2178
|
}
|
|
2179
2179
|
)
|
|
2180
2180
|
] }) : null;
|
|
2181
|
-
return n != null && n.customPanel && t ? /* @__PURE__ */ u(
|
|
2181
|
+
return n != null && n.customPanel && t ? /* @__PURE__ */ u(ke, { isOpen: e, onClose: s, title: n.label ?? o.configureStep, icon: n.icon, width: 500, children: n.customPanel({
|
|
2182
2182
|
nodeId: t,
|
|
2183
2183
|
data: r ?? {},
|
|
2184
|
-
onSave: (
|
|
2185
|
-
i(t,
|
|
2184
|
+
onSave: (x) => {
|
|
2185
|
+
i(t, x), s();
|
|
2186
2186
|
},
|
|
2187
2187
|
onClose: s
|
|
2188
2188
|
}) }) : /* @__PURE__ */ u(
|
|
2189
|
-
|
|
2189
|
+
ke,
|
|
2190
2190
|
{
|
|
2191
2191
|
isOpen: e,
|
|
2192
2192
|
onClose: s,
|
|
2193
2193
|
title: (n == null ? void 0 : n.label) ?? o.configureStep,
|
|
2194
2194
|
icon: n == null ? void 0 : n.icon,
|
|
2195
2195
|
width: 500,
|
|
2196
|
-
footer:
|
|
2197
|
-
children: /* @__PURE__ */ w(
|
|
2196
|
+
footer: k,
|
|
2197
|
+
children: /* @__PURE__ */ w(te, { sx: { p: 2 }, children: [
|
|
2198
2198
|
a && /* @__PURE__ */ u("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
|
|
2199
2199
|
!a && f && /* @__PURE__ */ u("p", { style: { fontSize: 13, color: "#d32f2f" }, children: f }),
|
|
2200
2200
|
!a && !f && !Gt(l) && /* @__PURE__ */ u("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
|
|
2201
|
-
|
|
2201
|
+
p && /* @__PURE__ */ u(
|
|
2202
2202
|
xr,
|
|
2203
2203
|
{
|
|
2204
2204
|
schema: l,
|
|
2205
2205
|
initialValues: r ?? {},
|
|
2206
|
-
formId:
|
|
2206
|
+
formId: m,
|
|
2207
2207
|
conditionConfig: g,
|
|
2208
|
-
onConditionConfigChange:
|
|
2209
|
-
onSubmit: (
|
|
2208
|
+
onConditionConfigChange: E,
|
|
2209
|
+
onSubmit: (x) => {
|
|
2210
2210
|
if (!t) return;
|
|
2211
|
-
const
|
|
2212
|
-
i(t, { ...
|
|
2211
|
+
const O = Object.keys(g).length > 0;
|
|
2212
|
+
i(t, { ...x, [Wt]: O ? g : void 0 }), s();
|
|
2213
2213
|
}
|
|
2214
2214
|
}
|
|
2215
2215
|
)
|
|
@@ -2223,15 +2223,15 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2223
2223
|
workflowLabel: r,
|
|
2224
2224
|
onFetchWorkflow: o
|
|
2225
2225
|
}) => {
|
|
2226
|
-
const [i, s] =
|
|
2227
|
-
return
|
|
2226
|
+
const [i, s] = z({ status: "idle" });
|
|
2227
|
+
return se(() => {
|
|
2228
2228
|
if (!e || !n) {
|
|
2229
2229
|
s({ status: "idle" });
|
|
2230
2230
|
return;
|
|
2231
2231
|
}
|
|
2232
2232
|
s({ status: "loading" }), o(n).then((l) => s({ status: "loaded", state: l })).catch((l) => s({ status: "error", message: (l == null ? void 0 : l.message) ?? "Failed to load workflow" }));
|
|
2233
2233
|
}, [e, n, o]), /* @__PURE__ */ u(
|
|
2234
|
-
|
|
2234
|
+
ke,
|
|
2235
2235
|
{
|
|
2236
2236
|
isOpen: e,
|
|
2237
2237
|
onClose: t,
|
|
@@ -2254,8 +2254,8 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2254
2254
|
}
|
|
2255
2255
|
);
|
|
2256
2256
|
}, ls = ({ state: e }) => {
|
|
2257
|
-
const [t, n] =
|
|
2258
|
-
return
|
|
2257
|
+
const [t, n] = z(null), [r, o] = z(null);
|
|
2258
|
+
return se(() => {
|
|
2259
2259
|
Promise.all([
|
|
2260
2260
|
Promise.resolve().then(() => hs).then((i) => i.default),
|
|
2261
2261
|
import("./nodeRegistry.js").then((i) => i.nodeTypeRegistry),
|
|
@@ -2272,7 +2272,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2272
2272
|
readOnly: !0
|
|
2273
2273
|
}
|
|
2274
2274
|
) });
|
|
2275
|
-
},
|
|
2275
|
+
}, _e = 350, qe = 70, Xe = 60, Je = {
|
|
2276
2276
|
startNode: 40,
|
|
2277
2277
|
endNode: 40,
|
|
2278
2278
|
addTriggerNode: 56,
|
|
@@ -2285,8 +2285,8 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2285
2285
|
}, as = {
|
|
2286
2286
|
plusEdge: Zn,
|
|
2287
2287
|
labelPlusEdge: Jn,
|
|
2288
|
-
plainEdge:
|
|
2289
|
-
edgeWithPlusLabel:
|
|
2288
|
+
plainEdge: Xn,
|
|
2289
|
+
edgeWithPlusLabel: qn,
|
|
2290
2290
|
gatewayBranchEdge: Vn
|
|
2291
2291
|
};
|
|
2292
2292
|
function Yt() {
|
|
@@ -2299,50 +2299,60 @@ function Yt() {
|
|
|
2299
2299
|
function ds(e, t, n, r = "TB") {
|
|
2300
2300
|
const o = new Dt.graphlib.Graph();
|
|
2301
2301
|
return o.setGraph({ rankdir: r, ranksep: 70, nodesep: 50 }), o.setDefaultEdgeLabel(() => ({})), e.forEach((i) => {
|
|
2302
|
-
const s = n[i.id] ?? { width:
|
|
2302
|
+
const s = n[i.id] ?? { width: _e, height: Je[i.type ?? ""] ?? 80 };
|
|
2303
2303
|
o.setNode(i.id, { width: s.width, height: s.height });
|
|
2304
2304
|
}), t.forEach((i) => o.setEdge(i.source, i.target)), Dt.layout(o), e.map((i) => {
|
|
2305
2305
|
var a, c;
|
|
2306
|
-
const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ??
|
|
2306
|
+
const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ?? _e, d = ((c = n[i.id]) == null ? void 0 : c.height) ?? Je[i.type ?? ""] ?? 80;
|
|
2307
2307
|
return { ...i, position: { x: s.x - l / 2, y: s.y - d / 2 } };
|
|
2308
2308
|
});
|
|
2309
2309
|
}
|
|
2310
|
-
const
|
|
2310
|
+
const ue = (e) => e === "filter" || e === "approval";
|
|
2311
2311
|
function cs(e, t, n, r) {
|
|
2312
|
-
const s =
|
|
2313
|
-
for (const
|
|
2314
|
-
for (const
|
|
2315
|
-
for (const
|
|
2316
|
-
for (const
|
|
2317
|
-
const h = (
|
|
2318
|
-
const
|
|
2319
|
-
return a[
|
|
2320
|
-
}, g = (
|
|
2321
|
-
let
|
|
2322
|
-
for (const
|
|
2323
|
-
|
|
2324
|
-
return
|
|
2325
|
-
},
|
|
2326
|
-
const
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
y:
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
}
|
|
2336
|
-
|
|
2337
|
-
|
|
2312
|
+
const s = qe, l = 30, d = 30, a = {}, c = {}, f = /* @__PURE__ */ new Map();
|
|
2313
|
+
for (const p of e) f.set(p.id, p);
|
|
2314
|
+
for (const p of Object.values(t))
|
|
2315
|
+
for (const k of Object.values(p))
|
|
2316
|
+
for (const x of k) f.set(x.id, x);
|
|
2317
|
+
const h = (p, k, x) => {
|
|
2318
|
+
const O = r[p] ?? { width: _e, height: 80 };
|
|
2319
|
+
return a[p] = { x: k - O.width / 2, y: x }, x + O.height;
|
|
2320
|
+
}, g = (p, k, x) => {
|
|
2321
|
+
let O = x;
|
|
2322
|
+
for (const L of p)
|
|
2323
|
+
O = h(L.id, k, O) + s, ue(L.kind) && t[L.id] && (O = E(L.id, k, O));
|
|
2324
|
+
return O;
|
|
2325
|
+
}, E = (p, k, x) => {
|
|
2326
|
+
const O = k + 180, L = t[p], D = Object.keys(L), G = f.get(p), P = (G == null ? void 0 : G.branchLabels) ?? { pass: "Pass", fail: "Fail" }, M = a[p], q = r[p] ?? { height: 80 }, re = M.y + q.height;
|
|
2327
|
+
if ((G == null ? void 0 : G.branchStyle) === "inline-gate") {
|
|
2328
|
+
const oe = [];
|
|
2329
|
+
let J = x;
|
|
2330
|
+
D.slice(1).forEach((ae) => {
|
|
2331
|
+
oe.push({ y: J - re, label: P[ae] ?? ae, isPass: !1 }), J = g(L[ae], O, J + d) + l;
|
|
2332
|
+
});
|
|
2333
|
+
const me = g(L[D[0]], k, x);
|
|
2334
|
+
return c[p] = { branches: oe, height: J - re, indent: 180 }, Math.max(me, J);
|
|
2335
|
+
}
|
|
2336
|
+
const le = [];
|
|
2337
|
+
let F = x;
|
|
2338
|
+
return D.forEach((oe, J) => {
|
|
2339
|
+
const me = L[oe], ae = F;
|
|
2340
|
+
le.push({
|
|
2341
|
+
y: ae - re,
|
|
2342
|
+
label: P[oe] ?? oe,
|
|
2343
|
+
isPass: J === 0
|
|
2344
|
+
}), F = g(me, O, F + d), J < D.length - 1 && (F += l);
|
|
2345
|
+
}), c[p] = {
|
|
2346
|
+
branches: le,
|
|
2347
|
+
height: F - re,
|
|
2338
2348
|
indent: 180
|
|
2339
|
-
},
|
|
2349
|
+
}, F;
|
|
2340
2350
|
};
|
|
2341
|
-
let
|
|
2342
|
-
for (const
|
|
2343
|
-
|
|
2351
|
+
let m = Xe;
|
|
2352
|
+
for (const p of e)
|
|
2353
|
+
m = h(p.id, 400, m) + s, ue(p.kind) && t[p.id] && (m = E(p.id, 400, m));
|
|
2344
2354
|
return {
|
|
2345
|
-
nodes: n.map((
|
|
2355
|
+
nodes: n.map((p) => a[p.id] ? { ...p, position: a[p.id] } : p),
|
|
2346
2356
|
railSpecs: c
|
|
2347
2357
|
};
|
|
2348
2358
|
}
|
|
@@ -2371,73 +2381,83 @@ function fs(e, t, n, r, o) {
|
|
|
2371
2381
|
};
|
|
2372
2382
|
}
|
|
2373
2383
|
function us(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
|
|
2374
|
-
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (
|
|
2375
|
-
const
|
|
2376
|
-
if (!
|
|
2377
|
-
const
|
|
2378
|
-
if (
|
|
2379
|
-
|
|
2380
|
-
id: `e-${
|
|
2381
|
-
source:
|
|
2382
|
-
target:
|
|
2384
|
+
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (m, p, k) => {
|
|
2385
|
+
const x = t[m];
|
|
2386
|
+
if (!x) return;
|
|
2387
|
+
const L = p ?? { pass: "Pass", fail: "Fail" }, D = Object.keys(x), G = k === "inline-gate", P = (M, q, re, le) => {
|
|
2388
|
+
if (M.length !== 0) {
|
|
2389
|
+
M.forEach((F) => d.push(Kt(F))), G && le === 0 ? a.push({
|
|
2390
|
+
id: `e-${m}-${q}-start`,
|
|
2391
|
+
source: m,
|
|
2392
|
+
target: M[0].id,
|
|
2393
|
+
type: "plusEdge",
|
|
2394
|
+
style: { stroke: l },
|
|
2395
|
+
data: { onAddStepClick: n, referenceNodeType: "filterNode", filterId: m, branch: q }
|
|
2396
|
+
}) : a.push({
|
|
2397
|
+
id: `e-${m}-${q}-start`,
|
|
2398
|
+
source: m,
|
|
2399
|
+
target: M[0].id,
|
|
2383
2400
|
type: "gatewayBranchEdge",
|
|
2384
2401
|
style: { stroke: l },
|
|
2385
|
-
data: { branch:
|
|
2402
|
+
data: { branch: q, filterId: m, label: re, isFirst: le === 0, onAddStepClick: n, verticalRouting: s === "vertical" || G }
|
|
2386
2403
|
});
|
|
2387
|
-
for (let
|
|
2388
|
-
|
|
2389
|
-
for (const
|
|
2390
|
-
|
|
2404
|
+
for (let F = 1; F < M.length; F++)
|
|
2405
|
+
ue(M[F - 1].kind) || a.push(fs(M[F - 1], M[F], l, n, { filterId: m, branch: q }));
|
|
2406
|
+
for (const F of M)
|
|
2407
|
+
ue(F.kind) && t[F.id] && c(F.id, F.branchLabels, F.branchStyle);
|
|
2391
2408
|
}
|
|
2392
2409
|
};
|
|
2393
|
-
|
|
2394
|
-
|
|
2410
|
+
D.forEach((M, q) => {
|
|
2411
|
+
P(x[M], M, L[M] ?? M, q);
|
|
2395
2412
|
});
|
|
2396
2413
|
};
|
|
2397
|
-
for (let
|
|
2398
|
-
const
|
|
2399
|
-
if (d.push(Kt(
|
|
2400
|
-
const
|
|
2401
|
-
if (
|
|
2414
|
+
for (let m = 0; m < e.length; m++) {
|
|
2415
|
+
const p = e[m];
|
|
2416
|
+
if (d.push(Kt(p)), m > 0) {
|
|
2417
|
+
const k = e[m - 1], x = k.kind === "start" || k.kind === "addTrigger";
|
|
2418
|
+
if (k.kind === "filter" || k.kind === "approval") continue;
|
|
2402
2419
|
a.push({
|
|
2403
|
-
id: `e-${
|
|
2404
|
-
source:
|
|
2405
|
-
target:
|
|
2420
|
+
id: `e-${k.id}-${p.id}`,
|
|
2421
|
+
source: k.id,
|
|
2422
|
+
target: p.id,
|
|
2406
2423
|
type: x ? "plainEdge" : "plusEdge",
|
|
2407
2424
|
style: { stroke: l },
|
|
2408
2425
|
data: x ? {} : {
|
|
2409
2426
|
onAddStepClick: n,
|
|
2410
|
-
referenceNodeType:
|
|
2427
|
+
referenceNodeType: k.reactFlowType
|
|
2411
2428
|
}
|
|
2412
2429
|
});
|
|
2413
2430
|
}
|
|
2414
|
-
(
|
|
2431
|
+
(p.kind === "filter" || p.kind === "approval") && t[p.id] && c(p.id, p.branchLabels, p.branchStyle);
|
|
2415
2432
|
}
|
|
2416
2433
|
const f = {};
|
|
2417
|
-
if (d.forEach((
|
|
2418
|
-
f[
|
|
2419
|
-
width:
|
|
2420
|
-
height: r[
|
|
2434
|
+
if (d.forEach((m) => {
|
|
2435
|
+
f[m.id] = {
|
|
2436
|
+
width: _e,
|
|
2437
|
+
height: r[m.id] ?? Je[m.type ?? ""] ?? 80
|
|
2421
2438
|
};
|
|
2422
2439
|
}), !(Object.keys(t).length > 0)) {
|
|
2423
2440
|
if (i === "LR") {
|
|
2424
|
-
let
|
|
2425
|
-
return { nodes: d.map((
|
|
2426
|
-
const
|
|
2427
|
-
return
|
|
2441
|
+
let O = Xe;
|
|
2442
|
+
return { nodes: d.map((D) => {
|
|
2443
|
+
const G = f[D.id].width, P = f[D.id].height, M = { ...D, position: { x: O, y: 300 - P / 2 } };
|
|
2444
|
+
return O += G + qe, M;
|
|
2428
2445
|
}), edges: a };
|
|
2429
2446
|
}
|
|
2430
|
-
const
|
|
2431
|
-
let
|
|
2447
|
+
const m = 400;
|
|
2448
|
+
let p = Xe;
|
|
2432
2449
|
return { nodes: d.map((x) => {
|
|
2433
|
-
const
|
|
2434
|
-
return
|
|
2450
|
+
const O = f[x.id].height, L = { ...x, position: { x: m - _e / 2, y: p } };
|
|
2451
|
+
return p += O + qe, L;
|
|
2435
2452
|
}), edges: a };
|
|
2436
2453
|
}
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2454
|
+
const g = e.some((m) => m.branchStyle === "inline-gate") || Object.values(t).some(
|
|
2455
|
+
(m) => Object.values(m).flat().some((p) => p.branchStyle === "inline-gate")
|
|
2456
|
+
);
|
|
2457
|
+
if (s === "vertical" || g) {
|
|
2458
|
+
const { nodes: m, railSpecs: p } = cs(e, t, d, f);
|
|
2459
|
+
return { nodes: m.map(
|
|
2460
|
+
(x) => p[x.id] ? { ...x, data: { ...x.data, _branchRail: p[x.id] } } : x
|
|
2441
2461
|
), edges: a };
|
|
2442
2462
|
}
|
|
2443
2463
|
return { nodes: ds(d, a, f, i), edges: a };
|
|
@@ -2457,268 +2477,269 @@ const Ht = ({
|
|
|
2457
2477
|
loadTriggerSources: f,
|
|
2458
2478
|
renderNodePicker: h,
|
|
2459
2479
|
renderNodeConfig: g,
|
|
2460
|
-
onNodeClick:
|
|
2461
|
-
maxNodes:
|
|
2462
|
-
layoutDirection:
|
|
2463
|
-
executionRecord:
|
|
2464
|
-
onFetchWorkflow:
|
|
2465
|
-
hideHeader:
|
|
2466
|
-
workflowName:
|
|
2467
|
-
onWorkflowNameChange:
|
|
2468
|
-
onCancel:
|
|
2480
|
+
onNodeClick: E,
|
|
2481
|
+
maxNodes: m,
|
|
2482
|
+
layoutDirection: p = "TB",
|
|
2483
|
+
executionRecord: k,
|
|
2484
|
+
onFetchWorkflow: x,
|
|
2485
|
+
hideHeader: O = !1,
|
|
2486
|
+
workflowName: L,
|
|
2487
|
+
onWorkflowNameChange: D,
|
|
2488
|
+
onCancel: G,
|
|
2469
2489
|
workflowStatus: P,
|
|
2470
|
-
workflowStatusColor:
|
|
2471
|
-
saveLabel:
|
|
2472
|
-
optionsResolvers:
|
|
2490
|
+
workflowStatusColor: M,
|
|
2491
|
+
saveLabel: q,
|
|
2492
|
+
optionsResolvers: re
|
|
2473
2493
|
}) => {
|
|
2474
2494
|
const {
|
|
2475
|
-
fitView:
|
|
2476
|
-
fitViewPadding:
|
|
2477
|
-
showControls:
|
|
2478
|
-
showMiniMap:
|
|
2479
|
-
panOnScroll:
|
|
2480
|
-
zoomOnScroll:
|
|
2495
|
+
fitView: le = !0,
|
|
2496
|
+
fitViewPadding: F = 0.3,
|
|
2497
|
+
showControls: oe = !0,
|
|
2498
|
+
showMiniMap: J = !1,
|
|
2499
|
+
panOnScroll: me = !0,
|
|
2500
|
+
zoomOnScroll: ae = !1,
|
|
2481
2501
|
minZoom: Cn = 0.25,
|
|
2482
2502
|
maxZoom: Tn = 2,
|
|
2483
2503
|
snapToGrid: In = !1,
|
|
2484
2504
|
snapGrid: On = [15, 15],
|
|
2485
2505
|
branchLayout: ot = "horizontal",
|
|
2486
2506
|
nodeBody: it = "full"
|
|
2487
|
-
} = a,
|
|
2488
|
-
const
|
|
2507
|
+
} = a, ve = U(() => _r(d), [d]), [R, de] = z(() => (n == null ? void 0 : n.slots) ?? Yt()), [Y, ee] = z(() => (n == null ? void 0 : n.branches) ?? {}), [ge, X] = z(null), [Pe, st] = z(null), [Z, Ne] = z(null), [ce, lt] = z(null), [Ce, at] = z(null), [j, dt] = z(() => {
|
|
2508
|
+
const b = n == null ? void 0 : n.slots.find((S) => S.kind === "triggerFixed"), v = b != null && b.id.startsWith("trigger-") ? b.id.slice(8) : void 0;
|
|
2489
2509
|
return v ? t.lookup(v) ?? null : null;
|
|
2490
|
-
}), [ct,
|
|
2491
|
-
|
|
2510
|
+
}), [ct, jn] = z({}), Mn = H((b) => {
|
|
2511
|
+
jn(b);
|
|
2492
2512
|
}, []), zn = U(() => ({ ...Un, ...r }), [r]), Ln = U(() => ({ ...as, ...o }), [o]), Pn = U(() => {
|
|
2493
|
-
const
|
|
2494
|
-
return
|
|
2495
|
-
}, [
|
|
2496
|
-
const v =
|
|
2513
|
+
const b = R.filter((S) => S.kind === "userTask").length, v = Object.values(Y).flatMap((S) => Object.values(S).flat()).filter((S) => S.kind === "userTask").length;
|
|
2514
|
+
return b + v;
|
|
2515
|
+
}, [R, Y]), ft = m ?? (j == null ? void 0 : j.maxTasks), ut = ft !== void 0 && Pn >= ft, fe = H((b) => {
|
|
2516
|
+
const v = R.find((S) => S.id === b);
|
|
2497
2517
|
if (v) return v;
|
|
2498
|
-
for (const
|
|
2499
|
-
const
|
|
2500
|
-
if (
|
|
2518
|
+
for (const S of Object.values(Y)) {
|
|
2519
|
+
const C = Object.values(S).flat().find((T) => T.id === b);
|
|
2520
|
+
if (C) return C;
|
|
2501
2521
|
}
|
|
2502
2522
|
return null;
|
|
2503
|
-
}, [
|
|
2504
|
-
s || (st(
|
|
2505
|
-
}, [s]), ht = H((
|
|
2523
|
+
}, [R, Y]), Fe = H((b) => {
|
|
2524
|
+
s || (st(b), X("nodeConfig"));
|
|
2525
|
+
}, [s]), ht = H((b) => {
|
|
2506
2526
|
if (!s) {
|
|
2507
|
-
if (
|
|
2508
|
-
const v =
|
|
2527
|
+
if (R.some((v) => v.id === b)) {
|
|
2528
|
+
const v = R.find((S) => S.id === b);
|
|
2509
2529
|
if ((v == null ? void 0 : v.kind) === "triggerFixed") {
|
|
2510
|
-
|
|
2530
|
+
de(Yt()), ee({}), dt(null);
|
|
2511
2531
|
return;
|
|
2512
2532
|
}
|
|
2513
|
-
|
|
2514
|
-
const
|
|
2515
|
-
return
|
|
2516
|
-
}),
|
|
2517
|
-
const
|
|
2518
|
-
|
|
2533
|
+
de((S) => {
|
|
2534
|
+
const C = S.filter((T) => T.id !== b);
|
|
2535
|
+
return ue((v == null ? void 0 : v.kind) ?? "") && !C.some((T) => T.kind === "end") ? [...C, { id: "end", kind: "end", reactFlowType: "endNode" }] : C;
|
|
2536
|
+
}), ee((S) => {
|
|
2537
|
+
const C = { ...S }, T = (y) => {
|
|
2538
|
+
C[y] && (Object.values(C[y]).flat().filter((_) => ue(_.kind)).forEach((_) => T(_.id)), delete C[y]);
|
|
2519
2539
|
};
|
|
2520
|
-
return T(
|
|
2540
|
+
return T(b), C;
|
|
2521
2541
|
});
|
|
2522
2542
|
return;
|
|
2523
2543
|
}
|
|
2524
|
-
|
|
2525
|
-
const
|
|
2526
|
-
const
|
|
2527
|
-
for (const
|
|
2528
|
-
|
|
2529
|
-
return
|
|
2530
|
-
},
|
|
2531
|
-
for (const T of Object.keys(
|
|
2532
|
-
for (const
|
|
2533
|
-
const
|
|
2534
|
-
if (
|
|
2535
|
-
const I =
|
|
2536
|
-
let
|
|
2537
|
-
return I.kind === "filter" && ((I.id in
|
|
2544
|
+
ee((v) => {
|
|
2545
|
+
const S = (T, y) => {
|
|
2546
|
+
const _ = [];
|
|
2547
|
+
for (const N of T)
|
|
2548
|
+
ue(N.kind) && y[N.id] && (_.push(N.id), Object.values(y[N.id]).forEach((I) => _.push(...S(I, y))));
|
|
2549
|
+
return _;
|
|
2550
|
+
}, C = { ...v };
|
|
2551
|
+
for (const T of Object.keys(C))
|
|
2552
|
+
for (const y of Object.keys(C[T])) {
|
|
2553
|
+
const _ = C[T][y], N = _.findIndex((A) => A.id === b);
|
|
2554
|
+
if (N === -1 || _[N].kind === "end") continue;
|
|
2555
|
+
const I = _[N];
|
|
2556
|
+
let B = _.filter((A) => A.id !== b);
|
|
2557
|
+
return I.kind === "filter" && ((I.id in C ? S([I], C) : []).forEach(($) => delete C[$]), delete C[I.id], B.some(($) => $.kind === "end") || (B = [...B, { id: `end-${T}-${y}`, kind: "end", reactFlowType: "endNode" }])), C[T] = { ...C[T], [y]: B }, C;
|
|
2538
2558
|
}
|
|
2539
|
-
return
|
|
2559
|
+
return C;
|
|
2540
2560
|
});
|
|
2541
2561
|
}
|
|
2542
|
-
}, [s,
|
|
2562
|
+
}, [s, R]), Re = H(() => {
|
|
2543
2563
|
s || X("triggerSelect");
|
|
2544
|
-
}, [s]), gt = H((
|
|
2545
|
-
s || ut || (
|
|
2546
|
-
}, [s, ut]), pt = H((
|
|
2547
|
-
if (dt(
|
|
2548
|
-
const
|
|
2549
|
-
...
|
|
2564
|
+
}, [s]), gt = H((b, v) => {
|
|
2565
|
+
s || ut || (Ne(b), lt(v.filterId && v.branch ? { filterId: v.filterId, branch: v.branch } : null), X("nodePicker"));
|
|
2566
|
+
}, [s, ut]), pt = H((b, v) => {
|
|
2567
|
+
if (dt(b), X(null), b.skeletonState) {
|
|
2568
|
+
const C = Array.isArray(v) && v.length > 0, T = (b.skeletonState.slots ?? []).map((y) => y.kind !== "triggerFixed" ? y : {
|
|
2569
|
+
...y,
|
|
2550
2570
|
nodeData: {
|
|
2551
|
-
label:
|
|
2552
|
-
...
|
|
2553
|
-
...
|
|
2571
|
+
label: b.label,
|
|
2572
|
+
...y.nodeData ?? {},
|
|
2573
|
+
...C && { sources: v }
|
|
2554
2574
|
}
|
|
2555
2575
|
});
|
|
2556
|
-
|
|
2576
|
+
ee(b.skeletonState.branches ?? {}), de(T);
|
|
2557
2577
|
return;
|
|
2558
2578
|
}
|
|
2559
|
-
|
|
2560
|
-
const
|
|
2561
|
-
|
|
2579
|
+
ee({});
|
|
2580
|
+
const S = Array.isArray(v) && v.length > 0;
|
|
2581
|
+
de([
|
|
2562
2582
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2563
2583
|
{
|
|
2564
|
-
id: `trigger-${
|
|
2584
|
+
id: `trigger-${b.triggerKey}`,
|
|
2565
2585
|
kind: "triggerFixed",
|
|
2566
2586
|
reactFlowType: "triggerNode",
|
|
2567
2587
|
nodeData: {
|
|
2568
|
-
label:
|
|
2569
|
-
source:
|
|
2570
|
-
eventType:
|
|
2571
|
-
type:
|
|
2572
|
-
...
|
|
2588
|
+
label: b.label,
|
|
2589
|
+
source: b.source,
|
|
2590
|
+
eventType: b.triggerKey,
|
|
2591
|
+
type: b.triggerCategory === "scheduler" ? "scheduler" : "event",
|
|
2592
|
+
...S && { sources: v }
|
|
2573
2593
|
},
|
|
2574
2594
|
deletable: !1
|
|
2575
2595
|
},
|
|
2576
2596
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2577
2597
|
]);
|
|
2578
2598
|
}, []), yt = H(() => {
|
|
2579
|
-
var
|
|
2580
|
-
const
|
|
2599
|
+
var S;
|
|
2600
|
+
const b = {
|
|
2581
2601
|
insertAfterSlot: null,
|
|
2582
2602
|
upstreamSlots: [],
|
|
2583
2603
|
downstreamSlots: [],
|
|
2584
|
-
branch:
|
|
2585
|
-
template:
|
|
2604
|
+
branch: ce,
|
|
2605
|
+
template: j
|
|
2586
2606
|
};
|
|
2587
|
-
if (!
|
|
2588
|
-
if (
|
|
2589
|
-
const { filterId:
|
|
2590
|
-
return
|
|
2607
|
+
if (!Z) return b;
|
|
2608
|
+
if (ce) {
|
|
2609
|
+
const { filterId: C, branch: T } = ce, y = R.findIndex((A) => A.id === C), _ = y >= 0 ? R.slice(0, y + 1) : [], N = ((S = Y[C]) == null ? void 0 : S[T]) ?? [], I = N.findIndex((A) => A.id === Z), B = I >= 0 ? N.slice(0, I + 1) : [];
|
|
2610
|
+
return b.upstreamSlots = [..._, ...B], b.downstreamSlots = I >= 0 ? N.slice(I + 1) : N, b.insertAfterSlot = B[B.length - 1] ?? null, b;
|
|
2591
2611
|
}
|
|
2592
|
-
const v =
|
|
2593
|
-
return
|
|
2594
|
-
}, [
|
|
2595
|
-
const
|
|
2596
|
-
...
|
|
2597
|
-
...Object.values(Y).flatMap((
|
|
2598
|
-
], T = (
|
|
2599
|
-
return v.filter((
|
|
2600
|
-
(
|
|
2601
|
-
) ||
|
|
2602
|
-
(
|
|
2612
|
+
const v = R.findIndex((C) => C.id === Z);
|
|
2613
|
+
return b.upstreamSlots = v >= 0 ? R.slice(0, v + 1) : [], b.downstreamSlots = v >= 0 ? R.slice(v + 1) : [], b.insertAfterSlot = b.upstreamSlots[b.upstreamSlots.length - 1] ?? null, b;
|
|
2614
|
+
}, [R, Y, Z, ce, j]), Ae = (b, v) => b.descriptorType === v || b.id === v || b.kind === v, bt = H(() => {
|
|
2615
|
+
const b = e.list(), v = j != null && j.availableTasks ? b.filter((y) => j.availableTasks.includes(y.type)) : b, S = yt(), C = [
|
|
2616
|
+
...R,
|
|
2617
|
+
...Object.values(Y).flatMap((y) => Object.values(y).flat())
|
|
2618
|
+
], T = (y) => C.some((_) => y.some((N) => Ae(_, N)));
|
|
2619
|
+
return v.filter((y) => y.maxPerWorkflow !== void 0 && R.filter((N) => N.descriptorType === y.type).length + Object.values(Y).flatMap((N) => Object.values(N).flat()).filter((N) => N.descriptorType === y.type).length >= y.maxPerWorkflow ? !1 : y.canInsert ? y.canInsert(S) : !(y.insertAfter && y.insertAfter.length > 0 && T(y.insertAfter) && !S.upstreamSlots.some(
|
|
2620
|
+
(N) => y.insertAfter.some((I) => Ae(N, I))
|
|
2621
|
+
) || y.insertBefore && y.insertBefore.length > 0 && T(y.insertBefore) && !S.downstreamSlots.some(
|
|
2622
|
+
(N) => y.insertBefore.some((I) => Ae(N, I))
|
|
2603
2623
|
)));
|
|
2604
|
-
}, [e,
|
|
2605
|
-
if (!
|
|
2606
|
-
const v = `${
|
|
2624
|
+
}, [e, j, R, Y, yt]), mt = H((b) => {
|
|
2625
|
+
if (!Z) return;
|
|
2626
|
+
const v = `${b.type}-${Date.now()}`, S = b.reactFlowType === "filterNode" || b.reactFlowType === "approvalNode" || b.reactFlowType === "conditionBranchNode", C = b.branchLabels ?? { pass: "Pass", fail: "Fail" }, T = {
|
|
2607
2627
|
id: v,
|
|
2608
|
-
kind:
|
|
2609
|
-
reactFlowType:
|
|
2610
|
-
descriptorType:
|
|
2628
|
+
kind: S ? b.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
|
|
2629
|
+
reactFlowType: b.reactFlowType,
|
|
2630
|
+
descriptorType: b.type,
|
|
2611
2631
|
formData: {},
|
|
2612
|
-
nodeData: { title:
|
|
2632
|
+
nodeData: { title: b.label },
|
|
2613
2633
|
deletable: !0,
|
|
2614
|
-
branchLabels:
|
|
2634
|
+
branchLabels: C,
|
|
2635
|
+
...b.branchStyle ? { branchStyle: b.branchStyle } : {}
|
|
2615
2636
|
};
|
|
2616
|
-
if (
|
|
2617
|
-
const { filterId:
|
|
2618
|
-
|
|
2619
|
-
const I = [...
|
|
2620
|
-
if (
|
|
2621
|
-
const
|
|
2622
|
-
return
|
|
2623
|
-
...
|
|
2624
|
-
[
|
|
2637
|
+
if (ce) {
|
|
2638
|
+
const { filterId: y, branch: _ } = ce;
|
|
2639
|
+
ee((N) => {
|
|
2640
|
+
const I = [...N[y][_]];
|
|
2641
|
+
if (S) {
|
|
2642
|
+
const ie = I.filter((pe) => pe.kind !== "end"), kt = ie.findIndex((pe) => pe.id === Z), Dn = kt === -1 ? ie.length : kt + 1;
|
|
2643
|
+
return ie.splice(Dn, 0, T), {
|
|
2644
|
+
...N,
|
|
2645
|
+
[y]: { ...N[y], [_]: ie },
|
|
2625
2646
|
[v]: Object.fromEntries(
|
|
2626
|
-
Object.keys(
|
|
2647
|
+
Object.keys(C).map((pe) => [pe, [{ id: `end-${v}-${pe}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2627
2648
|
)
|
|
2628
2649
|
};
|
|
2629
2650
|
}
|
|
2630
|
-
const
|
|
2631
|
-
return I.splice(
|
|
2651
|
+
const B = I.findIndex((ie) => ie.id === Z), A = I.findIndex((ie) => ie.kind === "end"), $ = B === -1 ? A === -1 ? I.length : A : B + 1;
|
|
2652
|
+
return I.splice($, 0, T), { ...N, [y]: { ...N[y], [_]: I } };
|
|
2632
2653
|
});
|
|
2633
2654
|
} else
|
|
2634
|
-
|
|
2635
|
-
const
|
|
2636
|
-
return [...
|
|
2637
|
-
}),
|
|
2638
|
-
...
|
|
2655
|
+
S ? (de((y) => {
|
|
2656
|
+
const _ = y.findIndex((I) => I.id === Z);
|
|
2657
|
+
return [...y.filter((I) => I.kind !== "end").slice(0, _ + 1), T];
|
|
2658
|
+
}), ee((y) => ({
|
|
2659
|
+
...y,
|
|
2639
2660
|
[v]: Object.fromEntries(
|
|
2640
|
-
Object.keys(
|
|
2661
|
+
Object.keys(C).map((_) => [_, [{ id: `end-${v}-${_}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2641
2662
|
)
|
|
2642
|
-
}))) :
|
|
2643
|
-
const
|
|
2644
|
-
return
|
|
2663
|
+
}))) : de((y) => {
|
|
2664
|
+
const _ = y.findIndex((N) => N.id === Z);
|
|
2665
|
+
return _ === -1 ? y : [...y.slice(0, _ + 1), T, ...y.slice(_ + 1)];
|
|
2645
2666
|
});
|
|
2646
|
-
|
|
2647
|
-
}, [
|
|
2648
|
-
const
|
|
2649
|
-
const
|
|
2650
|
-
switch (
|
|
2667
|
+
Ne(null), lt(null), st(v), X("nodeConfig");
|
|
2668
|
+
}, [Z, ce]), vt = H((b, v) => {
|
|
2669
|
+
const S = (y) => {
|
|
2670
|
+
const _ = y.label || y.key;
|
|
2671
|
+
switch (y.kind) {
|
|
2651
2672
|
case "if":
|
|
2652
|
-
return `IF · ${
|
|
2673
|
+
return `IF · ${_}`;
|
|
2653
2674
|
case "elseif":
|
|
2654
|
-
return `ELSE IF · ${
|
|
2675
|
+
return `ELSE IF · ${_}`;
|
|
2655
2676
|
case "else":
|
|
2656
|
-
return
|
|
2677
|
+
return _.toUpperCase() === "ELSE" ? _ : `ELSE · ${_}`;
|
|
2657
2678
|
default:
|
|
2658
|
-
return
|
|
2679
|
+
return _;
|
|
2659
2680
|
}
|
|
2660
|
-
},
|
|
2661
|
-
const
|
|
2662
|
-
if ((
|
|
2663
|
-
const I = (v.branchConfigs ?? []).map((
|
|
2664
|
-
if (I.length === 0) return
|
|
2665
|
-
const
|
|
2666
|
-
return I.forEach((
|
|
2667
|
-
|
|
2668
|
-
}), { ...
|
|
2669
|
-
}, T = (
|
|
2670
|
-
if (
|
|
2671
|
-
const
|
|
2672
|
-
return
|
|
2673
|
-
|
|
2674
|
-
}), { ...
|
|
2681
|
+
}, C = (y) => {
|
|
2682
|
+
const _ = fe(b);
|
|
2683
|
+
if ((_ == null ? void 0 : _.descriptorType) !== "conditionBranch") return y;
|
|
2684
|
+
const I = (v.branchConfigs ?? []).map(($) => $.key).filter(Boolean);
|
|
2685
|
+
if (I.length === 0) return y;
|
|
2686
|
+
const B = y[b] ?? {}, A = {};
|
|
2687
|
+
return I.forEach(($) => {
|
|
2688
|
+
A[$] = B[$] ?? [{ id: `end-${b}-${$}`, kind: "end", reactFlowType: "endNode" }];
|
|
2689
|
+
}), { ...y, [b]: A };
|
|
2690
|
+
}, T = (y, _) => {
|
|
2691
|
+
if (y.descriptorType !== "conditionBranch") return { ...y, formData: _ };
|
|
2692
|
+
const N = _.branchConfigs ?? [], I = {};
|
|
2693
|
+
return N.forEach((B) => {
|
|
2694
|
+
B.key && (I[B.key] = S(B));
|
|
2695
|
+
}), { ...y, formData: _, branchLabels: I };
|
|
2675
2696
|
};
|
|
2676
|
-
if (
|
|
2677
|
-
|
|
2678
|
-
const
|
|
2679
|
-
return
|
|
2680
|
-
(
|
|
2681
|
-
(I) => I.id ===
|
|
2697
|
+
if (R.some((y) => y.id === b)) {
|
|
2698
|
+
ee((y) => {
|
|
2699
|
+
const _ = C(y);
|
|
2700
|
+
return de(
|
|
2701
|
+
(N) => N.map(
|
|
2702
|
+
(I) => I.id === b ? T(I, v) : I
|
|
2682
2703
|
)
|
|
2683
|
-
),
|
|
2704
|
+
), _;
|
|
2684
2705
|
});
|
|
2685
2706
|
return;
|
|
2686
2707
|
}
|
|
2687
|
-
|
|
2688
|
-
const
|
|
2689
|
-
for (const I of Object.keys(
|
|
2690
|
-
const
|
|
2691
|
-
for (const
|
|
2692
|
-
if (
|
|
2693
|
-
return
|
|
2708
|
+
ee((y) => {
|
|
2709
|
+
const N = { ...C(y) };
|
|
2710
|
+
for (const I of Object.keys(N)) {
|
|
2711
|
+
const B = (A) => A.map(($) => $.id === b ? T($, v) : $);
|
|
2712
|
+
for (const A of Object.keys(N[I]))
|
|
2713
|
+
if (N[I][A].some(($) => $.id === b))
|
|
2714
|
+
return N[I] = { ...N[I], [A]: B(N[I][A]) }, N;
|
|
2694
2715
|
}
|
|
2695
|
-
return
|
|
2716
|
+
return N;
|
|
2696
2717
|
});
|
|
2697
|
-
}, [
|
|
2718
|
+
}, [R, Y, fe]), K = U(() => fe(Pe ?? ""), [fe, Pe]), wt = U(() => {
|
|
2698
2719
|
if ((K == null ? void 0 : K.kind) === "triggerFixed") {
|
|
2699
|
-
const
|
|
2700
|
-
if (
|
|
2720
|
+
const b = (j == null ? void 0 : j.triggerCategory) === "scheduler", v = (j == null ? void 0 : j.triggerConfigTitle) ?? (b ? "Scheduler" : j == null ? void 0 : j.label) ?? "Trigger", S = j == null ? void 0 : j.triggerCustomPanel;
|
|
2721
|
+
if (S)
|
|
2701
2722
|
return {
|
|
2702
2723
|
type: K.id,
|
|
2703
2724
|
label: v,
|
|
2704
|
-
icon:
|
|
2725
|
+
icon: j == null ? void 0 : j.icon,
|
|
2705
2726
|
reactFlowType: "triggerNode",
|
|
2706
2727
|
formSchema: [],
|
|
2707
|
-
customPanel: ({ nodeId: T, data:
|
|
2728
|
+
customPanel: ({ nodeId: T, data: y, onSave: _, onClose: N }) => S({ data: y, onSave: _, onClose: N }),
|
|
2708
2729
|
matches: () => !1,
|
|
2709
2730
|
bpmnEntry: (T) => T,
|
|
2710
2731
|
bpmnExit: (T) => T,
|
|
2711
2732
|
emitBpmnElements: () => []
|
|
2712
2733
|
};
|
|
2713
|
-
const
|
|
2714
|
-
return Array.isArray(
|
|
2734
|
+
const C = j == null ? void 0 : j.triggerConfigSchema;
|
|
2735
|
+
return Array.isArray(C) && C.length > 0 ? {
|
|
2715
2736
|
type: K.id,
|
|
2716
2737
|
// Title the config by what it IS (a scheduler), not the workflow name
|
|
2717
2738
|
// (which would read as "Identify Dormant Account").
|
|
2718
2739
|
label: v,
|
|
2719
|
-
icon:
|
|
2740
|
+
icon: j == null ? void 0 : j.icon,
|
|
2720
2741
|
reactFlowType: "triggerNode",
|
|
2721
|
-
formSchema:
|
|
2742
|
+
formSchema: C,
|
|
2722
2743
|
matches: () => !1,
|
|
2723
2744
|
bpmnEntry: (T) => T,
|
|
2724
2745
|
bpmnExit: (T) => T,
|
|
@@ -2726,27 +2747,27 @@ const Ht = ({
|
|
|
2726
2747
|
} : null;
|
|
2727
2748
|
}
|
|
2728
2749
|
return K != null && K.descriptorType ? e.forType(K.descriptorType) ?? null : null;
|
|
2729
|
-
}, [K, e,
|
|
2730
|
-
() => us(
|
|
2731
|
-
[
|
|
2750
|
+
}, [K, e, j]), { nodes: Et, edges: Fn } = U(
|
|
2751
|
+
() => us(R, Y, s ? null : gt, ct, l, p, ot),
|
|
2752
|
+
[R, Y, s, gt, ct, l, p, ot]
|
|
2732
2753
|
), xt = U(() => {
|
|
2733
|
-
const
|
|
2754
|
+
const b = k ? new Map(k.steps.map((v) => [v.nodeId, v])) : null;
|
|
2734
2755
|
return Et.map((v) => {
|
|
2735
|
-
let
|
|
2736
|
-
if (
|
|
2737
|
-
const
|
|
2738
|
-
|
|
2756
|
+
let S = {};
|
|
2757
|
+
if (b) {
|
|
2758
|
+
const C = b.get(v.id);
|
|
2759
|
+
C && (S = { _executionStatus: C.status, _executionError: C.error });
|
|
2739
2760
|
}
|
|
2740
|
-
return v.type === "subWorkflowNode" &&
|
|
2741
|
-
var
|
|
2742
|
-
const T =
|
|
2743
|
-
at({ workflowId:
|
|
2744
|
-
}), Object.keys(
|
|
2761
|
+
return v.type === "subWorkflowNode" && x && (S.onPreview = (C) => {
|
|
2762
|
+
var y;
|
|
2763
|
+
const T = fe(v.id);
|
|
2764
|
+
at({ workflowId: C, workflowLabel: ((y = T == null ? void 0 : T.formData) == null ? void 0 : y.workflowLabel) ?? void 0 });
|
|
2765
|
+
}), Object.keys(S).length > 0 ? { ...v, data: { ...v.data, ...S } } : v;
|
|
2745
2766
|
});
|
|
2746
|
-
}, [Et,
|
|
2747
|
-
}, onClickAddTrigger: Re, messages:
|
|
2748
|
-
i && await i({ slots:
|
|
2749
|
-
}, [i,
|
|
2767
|
+
}, [Et, k, x, fe]), Rn = U(() => ({ onEditNode: Fe, onDeleteNode: ht, onAddStep: () => {
|
|
2768
|
+
}, onClickAddTrigger: Re, messages: ve, nodeRegistry: e, nodeBody: it, activeTemplate: j }), [Fe, ht, Re, ve, e, it, j]), An = H(async () => {
|
|
2769
|
+
i && await i({ slots: R, branches: Y });
|
|
2770
|
+
}, [i, R, Y]), Bn = U(() => Sr({
|
|
2750
2771
|
palette: {
|
|
2751
2772
|
primary: { main: l.primaryColor ?? "#1976d2" },
|
|
2752
2773
|
secondary: { main: l.secondaryColor ?? "#9c27b0" },
|
|
@@ -2758,7 +2779,7 @@ const Ht = ({
|
|
|
2758
2779
|
shape: { borderRadius: l.borderRadius ?? 6 },
|
|
2759
2780
|
typography: l.fontFamily ? { fontFamily: l.fontFamily } : {}
|
|
2760
2781
|
}), [l]);
|
|
2761
|
-
return /* @__PURE__ */ u(Nr, { theme: Bn, children: /* @__PURE__ */ u(kr, { resolvers:
|
|
2782
|
+
return /* @__PURE__ */ u(Nr, { theme: Bn, children: /* @__PURE__ */ u(kr, { resolvers: re, children: /* @__PURE__ */ u(Qn.Provider, { value: Rn, children: /* @__PURE__ */ w(
|
|
2762
2783
|
"div",
|
|
2763
2784
|
{
|
|
2764
2785
|
className: "flowforge-canvas",
|
|
@@ -2780,16 +2801,16 @@ const Ht = ({
|
|
|
2780
2801
|
"--ff-font-family": l.fontFamily
|
|
2781
2802
|
},
|
|
2782
2803
|
children: [
|
|
2783
|
-
!
|
|
2804
|
+
!O && (i || G || L) && /* @__PURE__ */ u(
|
|
2784
2805
|
ns,
|
|
2785
2806
|
{
|
|
2786
|
-
workflowName:
|
|
2787
|
-
onWorkflowNameChange:
|
|
2807
|
+
workflowName: L,
|
|
2808
|
+
onWorkflowNameChange: D,
|
|
2788
2809
|
status: P,
|
|
2789
|
-
statusColor:
|
|
2810
|
+
statusColor: M,
|
|
2790
2811
|
onSave: i ? An : void 0,
|
|
2791
|
-
onCancel:
|
|
2792
|
-
saveLabel:
|
|
2812
|
+
onCancel: G,
|
|
2813
|
+
saveLabel: q
|
|
2793
2814
|
}
|
|
2794
2815
|
),
|
|
2795
2816
|
/* @__PURE__ */ w("div", { style: { flex: 1, minHeight: 0, position: "relative" }, children: [
|
|
@@ -2800,20 +2821,20 @@ const Ht = ({
|
|
|
2800
2821
|
edges: Fn,
|
|
2801
2822
|
nodeTypes: zn,
|
|
2802
2823
|
edgeTypes: Ln,
|
|
2803
|
-
fitView:
|
|
2804
|
-
fitViewOptions: { padding:
|
|
2824
|
+
fitView: le,
|
|
2825
|
+
fitViewOptions: { padding: F },
|
|
2805
2826
|
nodesDraggable: !1,
|
|
2806
2827
|
nodesConnectable: !1,
|
|
2807
|
-
panOnScroll:
|
|
2808
|
-
zoomOnScroll:
|
|
2828
|
+
panOnScroll: me,
|
|
2829
|
+
zoomOnScroll: ae,
|
|
2809
2830
|
minZoom: Cn,
|
|
2810
2831
|
maxZoom: Tn,
|
|
2811
2832
|
snapToGrid: In,
|
|
2812
2833
|
snapGrid: On,
|
|
2813
2834
|
proOptions: { hideAttribution: !0 },
|
|
2814
|
-
onNodeClick: (
|
|
2815
|
-
const
|
|
2816
|
-
|
|
2835
|
+
onNodeClick: (b, v) => {
|
|
2836
|
+
const S = fe(v.id);
|
|
2837
|
+
S && (E != null && E(S) || (S.kind === "addTrigger" || S.kind === "triggerFixed" ? Re() : (S.kind === "userTask" || S.kind === "filter" || S.kind === "approval") && Fe(v.id)));
|
|
2817
2838
|
},
|
|
2818
2839
|
children: [
|
|
2819
2840
|
l.background !== "none" && /* @__PURE__ */ u(
|
|
@@ -2824,27 +2845,27 @@ const Ht = ({
|
|
|
2824
2845
|
gap: 20
|
|
2825
2846
|
}
|
|
2826
2847
|
),
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
/* @__PURE__ */ u(es, { onHeightsReady:
|
|
2848
|
+
oe && /* @__PURE__ */ u(Kn, { showInteractive: !1 }),
|
|
2849
|
+
J && /* @__PURE__ */ u(Hn, { zoomable: !0, pannable: !0 }),
|
|
2850
|
+
/* @__PURE__ */ u(es, { onHeightsReady: Mn, nodeCount: xt.length })
|
|
2830
2851
|
]
|
|
2831
2852
|
}
|
|
2832
2853
|
),
|
|
2833
|
-
c ?
|
|
2834
|
-
h ?
|
|
2835
|
-
X(null),
|
|
2836
|
-
}) : /* @__PURE__ */ u(os, { open:
|
|
2837
|
-
X(null),
|
|
2854
|
+
c ? ge === "triggerSelect" && c(t.list(), pt, () => X(null)) : /* @__PURE__ */ u(rs, { open: ge === "triggerSelect", templates: t.list(), messages: ve, onSelect: pt, onClose: () => X(null), loadTriggerSources: f }),
|
|
2855
|
+
h ? ge === "nodePicker" && h(bt(), mt, () => {
|
|
2856
|
+
X(null), Ne(null);
|
|
2857
|
+
}) : /* @__PURE__ */ u(os, { open: ge === "nodePicker", availableDescriptors: bt(), messages: ve, onSelect: mt, onClose: () => {
|
|
2858
|
+
X(null), Ne(null);
|
|
2838
2859
|
} }),
|
|
2839
|
-
g ?
|
|
2840
|
-
|
|
2860
|
+
g ? ge === "nodeConfig" && g(wt ?? void 0, K, vt, () => X(null)) : /* @__PURE__ */ u(is, { open: ge === "nodeConfig", nodeId: Pe, descriptor: wt, initialValues: K == null ? void 0 : K.formData, messages: ve, onSave: vt, onClose: () => X(null) }),
|
|
2861
|
+
x && Ce && /* @__PURE__ */ u(
|
|
2841
2862
|
ss,
|
|
2842
2863
|
{
|
|
2843
|
-
isOpen: !!
|
|
2864
|
+
isOpen: !!Ce,
|
|
2844
2865
|
onClose: () => at(null),
|
|
2845
|
-
workflowId:
|
|
2846
|
-
workflowLabel:
|
|
2847
|
-
onFetchWorkflow:
|
|
2866
|
+
workflowId: Ce.workflowId,
|
|
2867
|
+
workflowLabel: Ce.workflowLabel,
|
|
2868
|
+
onFetchWorkflow: x
|
|
2848
2869
|
}
|
|
2849
2870
|
)
|
|
2850
2871
|
] })
|
|
@@ -2911,12 +2932,12 @@ function gs({ template: e, onSelect: t }) {
|
|
|
2911
2932
|
}
|
|
2912
2933
|
);
|
|
2913
2934
|
}
|
|
2914
|
-
const
|
|
2935
|
+
const Ms = ({
|
|
2915
2936
|
templates: e,
|
|
2916
2937
|
onSelectTemplate: t,
|
|
2917
2938
|
onStartFromScratch: n
|
|
2918
2939
|
}) => {
|
|
2919
|
-
const [r, o] =
|
|
2940
|
+
const [r, o] = z(""), [i, s] = z(Ue), l = U(() => {
|
|
2920
2941
|
const a = /* @__PURE__ */ new Set();
|
|
2921
2942
|
return e.forEach((c) => {
|
|
2922
2943
|
c.category && a.add(c.category);
|
|
@@ -2928,7 +2949,7 @@ const js = ({
|
|
|
2928
2949
|
a = a.filter(
|
|
2929
2950
|
(f) => {
|
|
2930
2951
|
var h, g;
|
|
2931
|
-
return f.label.toLowerCase().includes(c) || ((h = f.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = f.tags) == null ? void 0 : g.some((
|
|
2952
|
+
return f.label.toLowerCase().includes(c) || ((h = f.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = f.tags) == null ? void 0 : g.some((E) => E.toLowerCase().includes(c)));
|
|
2932
2953
|
}
|
|
2933
2954
|
);
|
|
2934
2955
|
}
|
|
@@ -2990,17 +3011,17 @@ const js = ({
|
|
|
2990
3011
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
|
|
2991
3012
|
] }) : /* @__PURE__ */ u("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: d.map((a) => /* @__PURE__ */ u(gs, { template: a, onSelect: () => t(a) }, a.triggerKey)) }) })
|
|
2992
3013
|
] });
|
|
2993
|
-
},
|
|
2994
|
-
running: { label: "Running", color:
|
|
2995
|
-
success: { label: "Success", color:
|
|
2996
|
-
failed: { label: "Failed", color:
|
|
2997
|
-
cancelled: { label: "Cancelled", color:
|
|
3014
|
+
}, Te = {
|
|
3015
|
+
running: { label: "Running", color: ne.running, icon: W.createElement(Zt, { size: 14 }) },
|
|
3016
|
+
success: { label: "Success", color: ne.success, icon: W.createElement(Jt, { size: 14 }) },
|
|
3017
|
+
failed: { label: "Failed", color: ne.failed, icon: W.createElement(Xt, { size: 14 }) },
|
|
3018
|
+
cancelled: { label: "Cancelled", color: ne.cancelled, icon: W.createElement(qt, { size: 14 }) }
|
|
2998
3019
|
}, ps = {
|
|
2999
|
-
pending: { color:
|
|
3000
|
-
running: { color:
|
|
3001
|
-
success: { color:
|
|
3002
|
-
failed: { color:
|
|
3003
|
-
skipped: { color:
|
|
3020
|
+
pending: { color: ne.pending, icon: W.createElement(gr, { size: 14 }) },
|
|
3021
|
+
running: { color: ne.running, icon: W.createElement(Zt, { size: 14 }) },
|
|
3022
|
+
success: { color: ne.success, icon: W.createElement(Jt, { size: 14 }) },
|
|
3023
|
+
failed: { color: ne.failed, icon: W.createElement(Xt, { size: 14 }) },
|
|
3024
|
+
skipped: { color: ne.skipped, icon: W.createElement(qt, { size: 14 }) }
|
|
3004
3025
|
};
|
|
3005
3026
|
function Ze(e) {
|
|
3006
3027
|
try {
|
|
@@ -3018,7 +3039,7 @@ function Nn(e, t) {
|
|
|
3018
3039
|
}
|
|
3019
3040
|
}
|
|
3020
3041
|
function ys({ step: e }) {
|
|
3021
|
-
const [t, n] =
|
|
3042
|
+
const [t, n] = z(!1), r = ps[e.status], o = !!(e.inputs || e.outputs || e.error);
|
|
3022
3043
|
return /* @__PURE__ */ w("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
|
|
3023
3044
|
/* @__PURE__ */ w(
|
|
3024
3045
|
"div",
|
|
@@ -3033,11 +3054,11 @@ function ys({ step: e }) {
|
|
|
3033
3054
|
o && (i.key === "Enter" || i.key === " ") && n((s) => !s);
|
|
3034
3055
|
},
|
|
3035
3056
|
children: [
|
|
3036
|
-
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children:
|
|
3057
|
+
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children: W.cloneElement(r.icon, { color: r.color }) }),
|
|
3037
3058
|
/* @__PURE__ */ u("span", { style: { flex: 1, fontSize: 13, color: "#212121" }, children: e.label || e.nodeId }),
|
|
3038
3059
|
e.branchTaken && /* @__PURE__ */ u("span", { style: { fontSize: 10, padding: "1px 6px", borderRadius: 10, background: "#e3f2fd", color: "#1565c0", fontWeight: 600 }, children: e.branchTaken }),
|
|
3039
3060
|
/* @__PURE__ */ u("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ? Nn(e.startedAt, e.completedAt) : "—" }),
|
|
3040
|
-
o && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ?
|
|
3061
|
+
o && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ? W.createElement(yr, { size: 16 }) : W.createElement(br, { size: 16 }) })
|
|
3041
3062
|
]
|
|
3042
3063
|
}
|
|
3043
3064
|
),
|
|
@@ -3055,7 +3076,7 @@ function ys({ step: e }) {
|
|
|
3055
3076
|
] });
|
|
3056
3077
|
}
|
|
3057
3078
|
function bs({ record: e, selected: t, onSelect: n }) {
|
|
3058
|
-
const r =
|
|
3079
|
+
const r = Te[e.status];
|
|
3059
3080
|
return /* @__PURE__ */ w(
|
|
3060
3081
|
"div",
|
|
3061
3082
|
{
|
|
@@ -3076,7 +3097,7 @@ function bs({ record: e, selected: t, onSelect: n }) {
|
|
|
3076
3097
|
outline: "none"
|
|
3077
3098
|
},
|
|
3078
3099
|
children: [
|
|
3079
|
-
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children:
|
|
3100
|
+
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children: W.cloneElement(r.icon, { color: r.color, size: 16 }) }),
|
|
3080
3101
|
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3081
3102
|
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: Ze(e.triggeredAt) }),
|
|
3082
3103
|
/* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
|
|
@@ -3095,7 +3116,7 @@ function bs({ record: e, selected: t, onSelect: n }) {
|
|
|
3095
3116
|
}
|
|
3096
3117
|
const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
3097
3118
|
var s;
|
|
3098
|
-
const [n, r] =
|
|
3119
|
+
const [n, r] = z(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === n) ?? null, i = [...e].sort((l, d) => new Date(d.triggeredAt).getTime() - new Date(l.triggeredAt).getTime());
|
|
3099
3120
|
return e.length === 0 ? /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
|
|
3100
3121
|
/* @__PURE__ */ u(Nt, { size: 36 }),
|
|
3101
3122
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
|
|
@@ -3113,8 +3134,8 @@ const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
3113
3134
|
/* @__PURE__ */ w("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
|
|
3114
3135
|
/* @__PURE__ */ w("div", { children: [
|
|
3115
3136
|
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
3116
|
-
|
|
3117
|
-
/* @__PURE__ */ u("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children:
|
|
3137
|
+
W.cloneElement(Te[o.status].icon, { color: Te[o.status].color, size: 18 }),
|
|
3138
|
+
/* @__PURE__ */ u("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children: Te[o.status].label })
|
|
3118
3139
|
] }),
|
|
3119
3140
|
/* @__PURE__ */ w("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
3120
3141
|
/* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
@@ -3160,6 +3181,6 @@ export {
|
|
|
3160
3181
|
ss as S,
|
|
3161
3182
|
zs as W,
|
|
3162
3183
|
ns as a,
|
|
3163
|
-
|
|
3184
|
+
Ms as b
|
|
3164
3185
|
};
|
|
3165
|
-
//# sourceMappingURL=WorkflowExecutionHistory-
|
|
3186
|
+
//# sourceMappingURL=WorkflowExecutionHistory-BA5IpymY.js.map
|