@notmrabhi/flowforge 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GatewayBranchEdge-CrDMz9RP.js +1 -0
- package/dist/{GatewayBranchEdge-BudlH-Ea.js → GatewayBranchEdge-DH-aHDPm.js} +361 -282
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.js +2 -2
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/{templateSkeletons-BEaJiDBN.js → templateSkeletons-CCXJ0W5L.js} +413 -408
- package/dist/{templateSkeletons-Dks6kUHW.js → templateSkeletons-DT30F9Rm.js} +1 -1
- package/package.json +1 -1
- package/dist/GatewayBranchEdge-D7QXHlOQ.js +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as w, jsx as f, Fragment as Lt } from "react/jsx-runtime";
|
|
2
2
|
import P, { useRef as pt, useEffect as ie, useState as j, useMemo as W, useCallback as Y } from "react";
|
|
3
3
|
import _r, { useStore as Tr, useReactFlow as Nr, Background as Cr, Controls as Sr, MiniMap as Ir } from "reactflow";
|
|
4
4
|
import "reactflow/dist/style.css";
|
|
5
|
-
import { e as Or, G as Mr, E as jr, P as Fr, L as zr, d as Rr, f as Dr } from "./GatewayBranchEdge-
|
|
5
|
+
import { e as Or, G as Mr, E as jr, P as Fr, L as zr, d as Rr, f as Dr } from "./GatewayBranchEdge-DH-aHDPm.js";
|
|
6
6
|
import { Dialog as Lr, Box as te, Drawer as Ar, IconButton as bt, Button as yt } from "@mui/material";
|
|
7
7
|
import { MdClose as Pr, MdCalendarToday as Br, MdBolt as Wr, MdArrowBack as Gr, MdChevronRight as At, MdAddCircleOutline as $r, MdApps as Yr, MdErrorOutline as Kr, MdAccountTree as Ur, MdAdd as Vr, MdSearch as Hr, MdCategory as qr, MdCancel as Pt, MdError as Bt, MdCheckCircle as Wt, MdPlayArrow as Gt, MdHourglassEmpty as Xr, MdSchedule as mt, MdPerson as Jr, MdExpandLess as Zr, MdExpandMore as Qr } from "react-icons/md";
|
|
8
8
|
import { GrTrigger as en } from "react-icons/gr";
|
|
9
9
|
import { BiCollapse as tn, BiExpand as rn } from "react-icons/bi";
|
|
10
10
|
import { b as nn } from "./index-CxVqPygT.js";
|
|
11
11
|
import { m as on } from "./messages-CO299wPN.js";
|
|
12
|
-
import { T as sn, E as
|
|
13
|
-
var $t = Object.defineProperty, ln = (e, t, r) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r,
|
|
12
|
+
import { T as sn, E as J } from "./canvasTokens-CAD6G24b.js";
|
|
13
|
+
var $t = Object.defineProperty, ln = (e, t, r) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, an = (e, t) => {
|
|
14
14
|
for (var r in t) $t(e, r, { get: t[r], enumerable: !0 });
|
|
15
|
-
},
|
|
16
|
-
|
|
15
|
+
}, dn = (e, t, r) => ln(e, t + "", r), Yt = {};
|
|
16
|
+
an(Yt, { Graph: () => G, alg: () => Ve, json: () => Ut, version: () => fn });
|
|
17
17
|
var cn = Object.defineProperty, Kt = (e, t) => {
|
|
18
18
|
for (var r in t) cn(e, r, { get: t[r], enumerable: !0 });
|
|
19
19
|
}, G = class {
|
|
@@ -147,14 +147,14 @@ var cn = Object.defineProperty, Kt = (e, t) => {
|
|
|
147
147
|
return e.reduce((r, n) => (t !== void 0 ? this.setEdge(r, n, t) : this.setEdge(r, n), n)), this;
|
|
148
148
|
}
|
|
149
149
|
setEdge(e, t, r, n) {
|
|
150
|
-
let o, i, s, l,
|
|
151
|
-
typeof e == "object" && e !== null && "v" in e ? (o = e.v, i = e.w, s = e.name, arguments.length === 2 && (l = t,
|
|
152
|
-
let
|
|
153
|
-
if (
|
|
150
|
+
let o, i, s, l, d = !1;
|
|
151
|
+
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 = n, arguments.length > 2 && (l = r, d = !0)), o = "" + o, i = "" + i, s !== void 0 && (s = "" + s);
|
|
152
|
+
let a = ge(this._isDirected, o, i, s);
|
|
153
|
+
if (a in this._edgeLabels) return d && (this._edgeLabels[a] = l), this;
|
|
154
154
|
if (s !== void 0 && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
155
|
-
this.setNode(o), this.setNode(i), this._edgeLabels[
|
|
155
|
+
this.setNode(o), this.setNode(i), this._edgeLabels[a] = d ? l : this._defaultEdgeLabelFn(o, i, s);
|
|
156
156
|
let c = un(this._isDirected, o, i, s);
|
|
157
|
-
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[
|
|
157
|
+
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c, wt(this._preds[i], o), wt(this._sucs[o], i), this._in[i][a] = c, this._out[o][a] = c, this._edgeCount++, this;
|
|
158
158
|
}
|
|
159
159
|
edge(e, t, r) {
|
|
160
160
|
let n = arguments.length === 1 ? Fe(this._isDirected, e) : ge(this._isDirected, e, t, r);
|
|
@@ -254,14 +254,14 @@ function Vt(e, t, r, n) {
|
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
256
|
function mn(e, t, r, n) {
|
|
257
|
-
let o = {}, i, s = 0, l = e.nodes(),
|
|
257
|
+
let o = {}, i, s = 0, l = e.nodes(), d = function(u) {
|
|
258
258
|
let h = r(u);
|
|
259
259
|
o[u.v].distance + h < o[u.w].distance && (o[u.w] = { distance: o[u.v].distance + h, predecessor: u.v }, i = !0);
|
|
260
|
-
},
|
|
260
|
+
}, a = function() {
|
|
261
261
|
l.forEach(function(u) {
|
|
262
262
|
n(u).forEach(function(h) {
|
|
263
263
|
let g = h.v === u ? h.v : h.w, b = g === h.v ? h.w : h.v;
|
|
264
|
-
|
|
264
|
+
d({ v: g, w: b });
|
|
265
265
|
});
|
|
266
266
|
});
|
|
267
267
|
};
|
|
@@ -270,8 +270,8 @@ function mn(e, t, r, n) {
|
|
|
270
270
|
o[u] = { distance: h, predecessor: "" };
|
|
271
271
|
});
|
|
272
272
|
let c = l.length;
|
|
273
|
-
for (let u = 1; u < c && (i = !1, s++,
|
|
274
|
-
if (s === c - 1 && (i = !1,
|
|
273
|
+
for (let u = 1; u < c && (i = !1, s++, a(), !!i); u++) ;
|
|
274
|
+
if (s === c - 1 && (i = !1, a(), i)) throw new Error("The graph contains a negative weight cycle");
|
|
275
275
|
return o;
|
|
276
276
|
}
|
|
277
277
|
function wn(e) {
|
|
@@ -344,15 +344,15 @@ function xe(e, t, r, n) {
|
|
|
344
344
|
return En(e, String(t), r || vn, n || o);
|
|
345
345
|
}
|
|
346
346
|
function En(e, t, r, n) {
|
|
347
|
-
let o = {}, i = new Ht(), s, l,
|
|
348
|
-
let c =
|
|
349
|
-
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " +
|
|
347
|
+
let o = {}, i = new Ht(), s, l, d = function(a) {
|
|
348
|
+
let c = a.v !== s ? a.v : a.w, u = o[c], h = r(a), g = l.distance + h;
|
|
349
|
+
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + a + " Weight: " + h);
|
|
350
350
|
g < u.distance && (u.distance = g, u.predecessor = s, i.decrease(c, g));
|
|
351
351
|
};
|
|
352
|
-
for (e.nodes().forEach(function(
|
|
353
|
-
let c =
|
|
354
|
-
o[
|
|
355
|
-
}); i.size() > 0 && (s = i.removeMin(), l = o[s], l.distance !== Number.POSITIVE_INFINITY); ) n(s).forEach(
|
|
352
|
+
for (e.nodes().forEach(function(a) {
|
|
353
|
+
let c = a === t ? 0 : Number.POSITIVE_INFINITY;
|
|
354
|
+
o[a] = { distance: c, predecessor: "" }, i.add(a, c);
|
|
355
|
+
}); i.size() > 0 && (s = i.removeMin(), l = o[s], l.distance !== Number.POSITIVE_INFINITY); ) n(s).forEach(d);
|
|
356
356
|
return o;
|
|
357
357
|
}
|
|
358
358
|
function kn(e, t, r) {
|
|
@@ -364,14 +364,14 @@ function qt(e) {
|
|
|
364
364
|
let t = 0, r = [], n = {}, o = [];
|
|
365
365
|
function i(s) {
|
|
366
366
|
let l = n[s] = { onStack: !0, lowlink: t, index: t++ };
|
|
367
|
-
if (r.push(s), e.successors(s).forEach(function(
|
|
368
|
-
|
|
367
|
+
if (r.push(s), e.successors(s).forEach(function(d) {
|
|
368
|
+
d in n ? n[d].onStack && (l.lowlink = Math.min(l.lowlink, n[d].index)) : (i(d), l.lowlink = Math.min(l.lowlink, n[d].lowlink));
|
|
369
369
|
}), l.lowlink === l.index) {
|
|
370
|
-
let
|
|
370
|
+
let d = [], a;
|
|
371
371
|
do
|
|
372
|
-
|
|
373
|
-
while (s !==
|
|
374
|
-
o.push(
|
|
372
|
+
a = r.pop(), n[a].onStack = !1, d.push(a);
|
|
373
|
+
while (s !== a);
|
|
374
|
+
o.push(d);
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
return e.nodes().forEach(function(s) {
|
|
@@ -395,15 +395,15 @@ function Nn(e, t, r) {
|
|
|
395
395
|
n[i] = {}, n[i][i] = { distance: 0, predecessor: "" }, o.forEach(function(s) {
|
|
396
396
|
i !== s && (n[i][s] = { distance: Number.POSITIVE_INFINITY, predecessor: "" });
|
|
397
397
|
}), r(i).forEach(function(s) {
|
|
398
|
-
let l = s.v === i ? s.w : s.v,
|
|
399
|
-
n[i][l] = { distance:
|
|
398
|
+
let l = s.v === i ? s.w : s.v, d = t(s);
|
|
399
|
+
n[i][l] = { distance: d, predecessor: i };
|
|
400
400
|
});
|
|
401
401
|
}), o.forEach(function(i) {
|
|
402
402
|
let s = n[i];
|
|
403
403
|
o.forEach(function(l) {
|
|
404
|
-
let
|
|
405
|
-
o.forEach(function(
|
|
406
|
-
let c =
|
|
404
|
+
let d = n[l];
|
|
405
|
+
o.forEach(function(a) {
|
|
406
|
+
let c = d[i], u = s[a], h = d[a], g = c.distance + u.distance;
|
|
407
407
|
g < h.distance && (h.distance = g, h.predecessor = u.predecessor);
|
|
408
408
|
});
|
|
409
409
|
});
|
|
@@ -435,8 +435,8 @@ function Cn(e) {
|
|
|
435
435
|
function Sn(e, t, r, n, o) {
|
|
436
436
|
Array.isArray(t) || (t = [t]);
|
|
437
437
|
let i = (l) => {
|
|
438
|
-
var
|
|
439
|
-
return (
|
|
438
|
+
var d;
|
|
439
|
+
return (d = e.isDirected() ? e.successors(l) : e.neighbors(l)) != null ? d : [];
|
|
440
440
|
}, s = {};
|
|
441
441
|
return t.forEach(function(l) {
|
|
442
442
|
if (!e.hasNode(l)) throw new Error("Graph does not have node: " + l);
|
|
@@ -461,16 +461,16 @@ function On(e, t) {
|
|
|
461
461
|
}
|
|
462
462
|
function Mn(e, t) {
|
|
463
463
|
let r = new G(), n = {}, o = new Ht(), i;
|
|
464
|
-
function s(
|
|
465
|
-
let
|
|
464
|
+
function s(d) {
|
|
465
|
+
let a = d.v === i ? d.w : d.v, c = o.priority(a);
|
|
466
466
|
if (c !== void 0) {
|
|
467
|
-
let u = t(
|
|
468
|
-
u < c && (n[
|
|
467
|
+
let u = t(d);
|
|
468
|
+
u < c && (n[a] = i, o.decrease(a, u));
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
if (e.nodeCount() === 0) return r;
|
|
472
|
-
e.nodes().forEach(function(
|
|
473
|
-
o.add(
|
|
472
|
+
e.nodes().forEach(function(d) {
|
|
473
|
+
o.add(d, Number.POSITIVE_INFINITY), r.setNode(d);
|
|
474
474
|
}), o.decrease(e.nodes()[0], 0);
|
|
475
475
|
let l = !1;
|
|
476
476
|
for (; o.size() > 0; ) {
|
|
@@ -494,8 +494,8 @@ function Fn(e, t, r, n) {
|
|
|
494
494
|
let o = !1, i = e.nodes();
|
|
495
495
|
for (let s = 0; s < i.length; s++) {
|
|
496
496
|
let l = n(i[s]);
|
|
497
|
-
for (let
|
|
498
|
-
let
|
|
497
|
+
for (let d = 0; d < l.length; d++) {
|
|
498
|
+
let a = l[d], c = a.v === i[s] ? a.v : a.w, u = c === a.v ? a.w : a.v;
|
|
499
499
|
r({ v: c, w: u }) < 0 && (o = !0);
|
|
500
500
|
}
|
|
501
501
|
if (o) return Vt(e, t, r, n);
|
|
@@ -525,8 +525,8 @@ function Qt(e) {
|
|
|
525
525
|
function Et(e, t) {
|
|
526
526
|
let r = e.x, n = e.y, o = t.x - r, i = t.y - n, s = e.width / 2, l = e.height / 2;
|
|
527
527
|
if (!o && !i) throw new Error("Not possible to find intersection inside of the rectangle");
|
|
528
|
-
let
|
|
529
|
-
return Math.abs(i) * s > Math.abs(o) * l ? (i < 0 && (l = -l),
|
|
528
|
+
let d, a;
|
|
529
|
+
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: r + d, y: n + a };
|
|
530
530
|
}
|
|
531
531
|
function ye(e) {
|
|
532
532
|
let t = pe(tr(e) + 1).map(() => []);
|
|
@@ -553,7 +553,7 @@ function Dn(e) {
|
|
|
553
553
|
});
|
|
554
554
|
let o = 0, i = e.graph().nodeRankFactor;
|
|
555
555
|
Array.from(n).forEach((s, l) => {
|
|
556
|
-
s === void 0 && l % i !== 0 ? --o : s !== void 0 && o && s.forEach((
|
|
556
|
+
s === void 0 && l % i !== 0 ? --o : s !== void 0 && o && s.forEach((d) => e.node(d).rank += o);
|
|
557
557
|
});
|
|
558
558
|
}
|
|
559
559
|
function kt(e, t, r, n) {
|
|
@@ -626,7 +626,7 @@ function Bn(e, t) {
|
|
|
626
626
|
}
|
|
627
627
|
var Ce = "\0", Wn = "3.0.0", Gn = class {
|
|
628
628
|
constructor() {
|
|
629
|
-
|
|
629
|
+
dn(this, "_sentinel");
|
|
630
630
|
let e = {};
|
|
631
631
|
e._next = e._prev = e, this._sentinel = e;
|
|
632
632
|
}
|
|
@@ -663,7 +663,7 @@ function Vn(e, t, r) {
|
|
|
663
663
|
for (; l = s.dequeue(); ) ze(e, t, r, l);
|
|
664
664
|
for (; l = i.dequeue(); ) ze(e, t, r, l);
|
|
665
665
|
if (e.nodeCount()) {
|
|
666
|
-
for (let
|
|
666
|
+
for (let d = t.length - 2; d > 0; --d) if (l = (n = t[d]) == null ? void 0 : n.dequeue(), l) {
|
|
667
667
|
o = o.concat(ze(e, t, r, l, !0) || []);
|
|
668
668
|
break;
|
|
669
669
|
}
|
|
@@ -674,11 +674,11 @@ function Vn(e, t, r) {
|
|
|
674
674
|
function ze(e, t, r, n, o) {
|
|
675
675
|
let i = [], s = o ? i : void 0;
|
|
676
676
|
return (e.inEdges(n.v) || []).forEach((l) => {
|
|
677
|
-
let
|
|
678
|
-
o && i.push({ v: l.v, w: l.w }),
|
|
677
|
+
let d = e.edge(l), a = e.node(l.v);
|
|
678
|
+
o && i.push({ v: l.v, w: l.w }), a.out -= d, Ge(t, r, a);
|
|
679
679
|
}), (e.outEdges(n.v) || []).forEach((l) => {
|
|
680
|
-
let
|
|
681
|
-
c.in -=
|
|
680
|
+
let d = e.edge(l), a = l.w, c = e.node(a);
|
|
681
|
+
c.in -= d, Ge(t, r, c);
|
|
682
682
|
}), e.removeNode(n.v), s;
|
|
683
683
|
}
|
|
684
684
|
function Hn(e, t) {
|
|
@@ -686,10 +686,10 @@ function Hn(e, t) {
|
|
|
686
686
|
e.nodes().forEach((l) => {
|
|
687
687
|
r.setNode(l, { v: l, in: 0, out: 0 });
|
|
688
688
|
}), e.edges().forEach((l) => {
|
|
689
|
-
let
|
|
689
|
+
let d = r.edge(l.v, l.w) || 0, a = t(l), c = d + a;
|
|
690
690
|
r.setEdge(l.v, l.w, c);
|
|
691
691
|
let u = r.node(l.v), h = r.node(l.w);
|
|
692
|
-
o = Math.max(o, u.out +=
|
|
692
|
+
o = Math.max(o, u.out += a), n = Math.max(n, h.in += a);
|
|
693
693
|
});
|
|
694
694
|
let i = qn(o + n + 3).map(() => new Yn()), s = n + 1;
|
|
695
695
|
return r.nodes().forEach((l) => {
|
|
@@ -737,11 +737,11 @@ function Qn(e) {
|
|
|
737
737
|
e.graph().dummyChains = [], e.edges().forEach((t) => eo(e, t));
|
|
738
738
|
}
|
|
739
739
|
function eo(e, t) {
|
|
740
|
-
let r = t.v, n = e.node(r).rank, o = t.w, i = e.node(o).rank, s = t.name, l = e.edge(t),
|
|
740
|
+
let r = t.v, n = e.node(r).rank, o = t.w, i = e.node(o).rank, s = t.name, l = e.edge(t), d = l.labelRank;
|
|
741
741
|
if (i === n + 1) return;
|
|
742
742
|
e.removeEdge(t);
|
|
743
|
-
let
|
|
744
|
-
for (u = 0, ++n; n < i; ++u, ++n) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: n },
|
|
743
|
+
let a, c, u;
|
|
744
|
+
for (u = 0, ++n; n < i; ++u, ++n) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: n }, a = fe(e, "edge", c, "_d"), n === d && (c.width = l.width, c.height = l.height, c.dummy = "edge-label", c.labelpos = l.labelpos), e.setEdge(r, a, { weight: l.weight }, s), u === 0 && e.graph().dummyChains.push(a), r = a;
|
|
745
745
|
e.setEdge(r, o, { weight: l.weight }, s);
|
|
746
746
|
}
|
|
747
747
|
function to(e) {
|
|
@@ -756,7 +756,7 @@ function qe(e) {
|
|
|
756
756
|
let o = e.node(n);
|
|
757
757
|
if (Object.hasOwn(t, n)) return o.rank;
|
|
758
758
|
t[n] = !0;
|
|
759
|
-
let i = e.outEdges(n), s = i ? i.map((
|
|
759
|
+
let i = e.outEdges(n), s = i ? i.map((d) => d == null ? Number.POSITIVE_INFINITY : r(d.w) - e.edge(d).minlen) : [], l = K(Math.min, s);
|
|
760
760
|
return l === Number.POSITIVE_INFINITY && (l = 0), o.rank = l;
|
|
761
761
|
}
|
|
762
762
|
e.sources().forEach(r);
|
|
@@ -798,14 +798,14 @@ se.initLowLimValues = Je;
|
|
|
798
798
|
se.initCutValues = Xe;
|
|
799
799
|
se.calcCutValue = ir;
|
|
800
800
|
se.leaveEdge = lr;
|
|
801
|
-
se.enterEdge =
|
|
802
|
-
se.exchangeEdges =
|
|
801
|
+
se.enterEdge = ar;
|
|
802
|
+
se.exchangeEdges = dr;
|
|
803
803
|
function se(e) {
|
|
804
804
|
e = zn(e), qe(e);
|
|
805
805
|
let t = or(e);
|
|
806
806
|
Je(t), Xe(t, e);
|
|
807
807
|
let r, n;
|
|
808
|
-
for (; r = lr(t); ) n =
|
|
808
|
+
for (; r = lr(t); ) n = ar(t, e, r), dr(t, e, r, n);
|
|
809
809
|
}
|
|
810
810
|
function Xe(e, t) {
|
|
811
811
|
let r = lo(e, e.nodes());
|
|
@@ -819,10 +819,10 @@ function ir(e, t, r) {
|
|
|
819
819
|
let n = e.node(r).parent, o = !0, i = t.edge(r, n), s = 0;
|
|
820
820
|
i || (o = !1, i = t.edge(n, r)), s = i.weight;
|
|
821
821
|
let l = t.nodeEdges(r);
|
|
822
|
-
return l && l.forEach((
|
|
823
|
-
let
|
|
822
|
+
return l && l.forEach((d) => {
|
|
823
|
+
let a = d.v === r, c = a ? d.w : d.v;
|
|
824
824
|
if (c !== n) {
|
|
825
|
-
let u =
|
|
825
|
+
let u = a === o, h = t.edge(d).weight;
|
|
826
826
|
if (s += u ? h : -h, fo(e, r, c)) {
|
|
827
827
|
let g = e.edge(r, c).cutvalue;
|
|
828
828
|
s += u ? -g : g;
|
|
@@ -837,20 +837,20 @@ function sr(e, t, r, n, o) {
|
|
|
837
837
|
let i = r, s = e.node(n);
|
|
838
838
|
t[n] = !0;
|
|
839
839
|
let l = e.neighbors(n);
|
|
840
|
-
return l && l.forEach((
|
|
841
|
-
Object.hasOwn(t,
|
|
840
|
+
return l && l.forEach((d) => {
|
|
841
|
+
Object.hasOwn(t, d) || (r = sr(e, t, r, d, n));
|
|
842
842
|
}), s.low = i, s.lim = r++, o ? s.parent = o : delete s.parent, r;
|
|
843
843
|
}
|
|
844
844
|
function lr(e) {
|
|
845
845
|
return e.edges().find((t) => e.edge(t).cutvalue < 0);
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function ar(e, t, r) {
|
|
848
848
|
let n = r.v, o = r.w;
|
|
849
849
|
t.hasEdge(n, o) || (n = r.w, o = r.v);
|
|
850
|
-
let i = e.node(n), s = e.node(o), l = i,
|
|
851
|
-
return i.lim > s.lim && (l = s,
|
|
850
|
+
let i = e.node(n), s = e.node(o), l = i, d = !1;
|
|
851
|
+
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d === _t(e, e.node(a.v), l) && d !== _t(e, e.node(a.w), l)).reduce((a, c) => ue(t, c) < ue(t, a) ? c : a);
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function dr(e, t, r, n) {
|
|
854
854
|
let o = r.v, i = r.w;
|
|
855
855
|
e.removeEdge(o, i), e.setEdge(n.v, n.w, {}), Je(e), Xe(e, t), uo(e, t);
|
|
856
856
|
}
|
|
@@ -900,29 +900,29 @@ var yo = mo;
|
|
|
900
900
|
function mo(e) {
|
|
901
901
|
let t = vo(e);
|
|
902
902
|
e.graph().dummyChains.forEach((r) => {
|
|
903
|
-
let n = e.node(r), o = n.edgeObj, i = wo(e, t, o.v, o.w), s = i.path, l = i.lca,
|
|
903
|
+
let n = e.node(r), o = n.edgeObj, i = wo(e, t, o.v, o.w), s = i.path, l = i.lca, d = 0, a = s[d], c = !0;
|
|
904
904
|
for (; r !== o.w; ) {
|
|
905
905
|
if (n = e.node(r), c) {
|
|
906
|
-
for (; (
|
|
907
|
-
|
|
906
|
+
for (; (a = s[d]) !== l && e.node(a).maxRank < n.rank; ) d++;
|
|
907
|
+
a === l && (c = !1);
|
|
908
908
|
}
|
|
909
909
|
if (!c) {
|
|
910
|
-
for (;
|
|
911
|
-
|
|
910
|
+
for (; d < s.length - 1 && e.node(s[d + 1]).minRank <= n.rank; ) d++;
|
|
911
|
+
a = s[d];
|
|
912
912
|
}
|
|
913
|
-
|
|
913
|
+
a !== void 0 && e.setParent(r, a), r = e.successors(r)[0];
|
|
914
914
|
}
|
|
915
915
|
});
|
|
916
916
|
}
|
|
917
917
|
function wo(e, t, r, n) {
|
|
918
|
-
let o = [], i = [], s = Math.min(t[r].low, t[n].low), l = Math.max(t[r].lim, t[n].lim),
|
|
919
|
-
|
|
918
|
+
let o = [], i = [], s = Math.min(t[r].low, t[n].low), l = Math.max(t[r].lim, t[n].lim), d;
|
|
919
|
+
d = r;
|
|
920
920
|
do
|
|
921
|
-
|
|
922
|
-
while (
|
|
923
|
-
let
|
|
924
|
-
for (; (c = e.parent(c)) !==
|
|
925
|
-
return { path: o.concat(i.reverse()), lca:
|
|
921
|
+
d = e.parent(d), o.push(d);
|
|
922
|
+
while (d && (t[d].low > s || l > t[d].lim));
|
|
923
|
+
let a = d, c = n;
|
|
924
|
+
for (; (c = e.parent(c)) !== a; ) i.push(c);
|
|
925
|
+
return { path: o.concat(i.reverse()), lca: a };
|
|
926
926
|
}
|
|
927
927
|
function vo(e) {
|
|
928
928
|
let t = {}, r = 0;
|
|
@@ -940,18 +940,18 @@ function Eo(e) {
|
|
|
940
940
|
}
|
|
941
941
|
function cr(e, t, r, n, o, i, s) {
|
|
942
942
|
var l;
|
|
943
|
-
let
|
|
944
|
-
if (!
|
|
943
|
+
let d = e.children(s);
|
|
944
|
+
if (!d.length) {
|
|
945
945
|
s !== t && e.setEdge(t, s, { weight: 0, minlen: r });
|
|
946
946
|
return;
|
|
947
947
|
}
|
|
948
|
-
let
|
|
949
|
-
e.setParent(
|
|
948
|
+
let a = kt(e, "_bt"), c = kt(e, "_bb"), u = e.node(s);
|
|
949
|
+
e.setParent(a, s), u.borderTop = a, e.setParent(c, s), u.borderBottom = c, d.forEach((h) => {
|
|
950
950
|
var g;
|
|
951
951
|
cr(e, t, r, n, o, i, h);
|
|
952
952
|
let b = e.node(h), y = b.borderTop ? b.borderTop : h, p = b.borderBottom ? b.borderBottom : h, v = b.borderTop ? n : 2 * n, N = y !== p ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
|
|
953
|
-
e.setEdge(
|
|
954
|
-
}), e.parent(s) || e.setEdge(t,
|
|
953
|
+
e.setEdge(a, y, { weight: v, minlen: N, nestingEdge: !0 }), e.setEdge(p, c, { weight: v, minlen: N, nestingEdge: !0 });
|
|
954
|
+
}), e.parent(s) || e.setEdge(t, a, { weight: 0, minlen: o + ((l = i[s]) != null ? l : 0) });
|
|
955
955
|
}
|
|
956
956
|
function ko(e) {
|
|
957
957
|
let t = {};
|
|
@@ -982,8 +982,8 @@ function No(e) {
|
|
|
982
982
|
e.children(Ce).forEach(t);
|
|
983
983
|
}
|
|
984
984
|
function Nt(e, t, r, n, o, i) {
|
|
985
|
-
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1],
|
|
986
|
-
o[t][i] =
|
|
985
|
+
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d = fe(e, "border", s, r);
|
|
986
|
+
o[t][i] = d, e.setParent(d, n), l && e.setEdge(l, d, { weight: 1 });
|
|
987
987
|
}
|
|
988
988
|
function Co(e) {
|
|
989
989
|
var t;
|
|
@@ -1028,12 +1028,12 @@ function Mo(e) {
|
|
|
1028
1028
|
function s(l) {
|
|
1029
1029
|
if (t[l]) return;
|
|
1030
1030
|
t[l] = !0;
|
|
1031
|
-
let
|
|
1032
|
-
i[
|
|
1033
|
-
let
|
|
1034
|
-
|
|
1031
|
+
let d = e.node(l);
|
|
1032
|
+
i[d.rank].push(l);
|
|
1033
|
+
let a = e.successors(l);
|
|
1034
|
+
a && a.forEach(s);
|
|
1035
1035
|
}
|
|
1036
|
-
return r.sort((l,
|
|
1036
|
+
return r.sort((l, d) => e.node(l).rank - e.node(d).rank).forEach(s), i;
|
|
1037
1037
|
}
|
|
1038
1038
|
function jo(e, t) {
|
|
1039
1039
|
let r = 0;
|
|
@@ -1041,21 +1041,21 @@ function jo(e, t) {
|
|
|
1041
1041
|
return r;
|
|
1042
1042
|
}
|
|
1043
1043
|
function Fo(e, t, r) {
|
|
1044
|
-
let n = Bn(r, r.map((
|
|
1045
|
-
let c = e.outEdges(
|
|
1044
|
+
let n = Bn(r, r.map((a, c) => c)), o = t.flatMap((a) => {
|
|
1045
|
+
let c = e.outEdges(a);
|
|
1046
1046
|
return c ? c.map((u) => ({ pos: n[u.w], weight: e.edge(u).weight })).sort((u, h) => u.pos - h.pos) : [];
|
|
1047
1047
|
}), i = 1;
|
|
1048
1048
|
for (; i < r.length; ) i <<= 1;
|
|
1049
1049
|
let s = 2 * i - 1;
|
|
1050
1050
|
i -= 1;
|
|
1051
|
-
let l = new Array(s).fill(0),
|
|
1052
|
-
return o.forEach((
|
|
1053
|
-
let c =
|
|
1054
|
-
l[c] +=
|
|
1051
|
+
let l = new Array(s).fill(0), d = 0;
|
|
1052
|
+
return o.forEach((a) => {
|
|
1053
|
+
let c = a.pos + i;
|
|
1054
|
+
l[c] += a.weight;
|
|
1055
1055
|
let u = 0;
|
|
1056
|
-
for (; c > 0; ) c % 2 && (u += l[c + 1]), c = c - 1 >> 1, l[c] +=
|
|
1057
|
-
|
|
1058
|
-
}),
|
|
1056
|
+
for (; c > 0; ) c % 2 && (u += l[c + 1]), c = c - 1 >> 1, l[c] += a.weight;
|
|
1057
|
+
d += a.weight * u;
|
|
1058
|
+
}), d;
|
|
1059
1059
|
}
|
|
1060
1060
|
function zo(e, t = []) {
|
|
1061
1061
|
return t.map((r) => {
|
|
@@ -1063,8 +1063,8 @@ function zo(e, t = []) {
|
|
|
1063
1063
|
if (!n || !n.length) return { v: r };
|
|
1064
1064
|
{
|
|
1065
1065
|
let o = n.reduce((i, s) => {
|
|
1066
|
-
let l = e.edge(s),
|
|
1067
|
-
return { sum: i.sum + l.weight *
|
|
1066
|
+
let l = e.edge(s), d = e.node(s.v);
|
|
1067
|
+
return { sum: i.sum + l.weight * d.order, weight: i.weight + l.weight };
|
|
1068
1068
|
}, { sum: 0, weight: 0 });
|
|
1069
1069
|
return { v: r, barycenter: o.sum / o.weight, weight: o.weight };
|
|
1070
1070
|
}
|
|
@@ -1105,12 +1105,12 @@ function Lo(e, t) {
|
|
|
1105
1105
|
e.weight && (r += e.barycenter * e.weight, n += e.weight), t.weight && (r += t.barycenter * t.weight, n += t.weight), e.vs = t.vs.concat(e.vs), e.barycenter = r / n, e.weight = n, e.i = Math.min(t.i, e.i), t.merged = !0;
|
|
1106
1106
|
}
|
|
1107
1107
|
function Ao(e, t) {
|
|
1108
|
-
let r = An(e, (c) => Object.hasOwn(c, "barycenter")), n = r.lhs, o = r.rhs.sort((c, u) => u.i - c.i), i = [], s = 0, l = 0,
|
|
1109
|
-
n.sort(Po(!!t)),
|
|
1110
|
-
|
|
1108
|
+
let r = An(e, (c) => Object.hasOwn(c, "barycenter")), n = r.lhs, o = r.rhs.sort((c, u) => u.i - c.i), i = [], s = 0, l = 0, d = 0;
|
|
1109
|
+
n.sort(Po(!!t)), d = St(i, o, d), n.forEach((c) => {
|
|
1110
|
+
d += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, d = St(i, o, d);
|
|
1111
1111
|
});
|
|
1112
|
-
let
|
|
1113
|
-
return l && (
|
|
1112
|
+
let a = { vs: i.flat(1) };
|
|
1113
|
+
return l && (a.barycenter = s / l, a.weight = l), a;
|
|
1114
1114
|
}
|
|
1115
1115
|
function St(e, t, r) {
|
|
1116
1116
|
let n;
|
|
@@ -1121,17 +1121,17 @@ function Po(e) {
|
|
|
1121
1121
|
return (t, r) => t.barycenter < r.barycenter ? -1 : t.barycenter > r.barycenter ? 1 : e ? r.i - t.i : t.i - r.i;
|
|
1122
1122
|
}
|
|
1123
1123
|
function fr(e, t, r, n) {
|
|
1124
|
-
let o = e.children(t), i = e.node(t), s = i ? i.borderLeft : void 0, l = i ? i.borderRight : void 0,
|
|
1124
|
+
let o = e.children(t), i = e.node(t), s = i ? i.borderLeft : void 0, l = i ? i.borderRight : void 0, d = {};
|
|
1125
1125
|
s && (o = o.filter((h) => h !== s && h !== l));
|
|
1126
|
-
let
|
|
1127
|
-
|
|
1126
|
+
let a = zo(e, o);
|
|
1127
|
+
a.forEach((h) => {
|
|
1128
1128
|
if (e.children(h.v).length) {
|
|
1129
1129
|
let g = fr(e, h.v, r, n);
|
|
1130
|
-
|
|
1130
|
+
d[h.v] = g, Object.hasOwn(g, "barycenter") && Wo(h, g);
|
|
1131
1131
|
}
|
|
1132
1132
|
});
|
|
1133
|
-
let c = Ro(
|
|
1134
|
-
Bo(c,
|
|
1133
|
+
let c = Ro(a, r);
|
|
1134
|
+
Bo(c, d);
|
|
1135
1135
|
let u = Ao(c, n);
|
|
1136
1136
|
if (s && l) {
|
|
1137
1137
|
u.vs = [s, u.vs, l].flat(1);
|
|
@@ -1155,11 +1155,11 @@ function Go(e, t, r, n) {
|
|
|
1155
1155
|
n || (n = e.nodes());
|
|
1156
1156
|
let o = $o(e), i = new G({ compound: !0 }).setGraph({ root: o }).setDefaultNodeLabel((s) => e.node(s));
|
|
1157
1157
|
return n.forEach((s) => {
|
|
1158
|
-
let l = e.node(s),
|
|
1158
|
+
let l = e.node(s), d = e.parent(s);
|
|
1159
1159
|
if (l.rank === t || l.minRank <= t && t <= l.maxRank) {
|
|
1160
|
-
i.setNode(s), i.setParent(s,
|
|
1161
|
-
let
|
|
1162
|
-
|
|
1160
|
+
i.setNode(s), i.setParent(s, d || o);
|
|
1161
|
+
let a = e[r](s);
|
|
1162
|
+
a && a.forEach((c) => {
|
|
1163
1163
|
let u = c.v === s ? c.w : c.v, h = i.edge(u, s), g = h !== void 0 ? h.weight : 0;
|
|
1164
1164
|
i.setEdge(u, s, { weight: e.edge(c).weight + g });
|
|
1165
1165
|
}), Object.hasOwn(l, "minRank") && i.setNode(s, { borderLeft: l.borderLeft[t], borderRight: l.borderRight[t] });
|
|
@@ -1174,10 +1174,10 @@ function $o(e) {
|
|
|
1174
1174
|
function Yo(e, t, r) {
|
|
1175
1175
|
let n = {}, o;
|
|
1176
1176
|
r.forEach((i) => {
|
|
1177
|
-
let s = e.parent(i), l,
|
|
1177
|
+
let s = e.parent(i), l, d;
|
|
1178
1178
|
for (; s; ) {
|
|
1179
|
-
if (l = e.parent(s), l ? (
|
|
1180
|
-
t.setEdge(
|
|
1179
|
+
if (l = e.parent(s), l ? (d = n[l], n[l] = s) : (d = o, o = s), d && d !== s) {
|
|
1180
|
+
t.setEdge(d, s);
|
|
1181
1181
|
return;
|
|
1182
1182
|
}
|
|
1183
1183
|
s = l;
|
|
@@ -1191,9 +1191,9 @@ function hr(e, t = {}) {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
let r = tr(e), n = It(e, pe(1, r + 1), "inEdges"), o = It(e, pe(r - 1, -1, -1), "outEdges"), i = Mo(e);
|
|
1193
1193
|
if (Ot(e, i), t.disableOptimalOrderHeuristic) return;
|
|
1194
|
-
let s = Number.POSITIVE_INFINITY, l,
|
|
1195
|
-
for (let
|
|
1196
|
-
Ko(
|
|
1194
|
+
let s = Number.POSITIVE_INFINITY, l, d = t.constraints || [];
|
|
1195
|
+
for (let a = 0, c = 0; c < 4; ++a, ++c) {
|
|
1196
|
+
Ko(a % 2 ? n : o, a % 4 >= 2, d), i = ye(e);
|
|
1197
1197
|
let u = jo(e, i);
|
|
1198
1198
|
u < s ? (c = 0, l = Object.assign({}, i), s = u) : u === s && (l = structuredClone(i));
|
|
1199
1199
|
}
|
|
@@ -1216,7 +1216,7 @@ function Ko(e, t, r) {
|
|
|
1216
1216
|
e.forEach(function(o) {
|
|
1217
1217
|
r.forEach((l) => n.setEdge(l.left, l.right));
|
|
1218
1218
|
let i = o.graph().root, s = fr(o, i, n, t);
|
|
1219
|
-
s.vs.forEach((l,
|
|
1219
|
+
s.vs.forEach((l, d) => o.node(l).order = d), Yo(o, n, s.vs);
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
1222
|
function Ot(e, t) {
|
|
@@ -1225,10 +1225,10 @@ function Ot(e, t) {
|
|
|
1225
1225
|
function Uo(e, t) {
|
|
1226
1226
|
let r = {};
|
|
1227
1227
|
function n(o, i) {
|
|
1228
|
-
let s = 0, l = 0,
|
|
1228
|
+
let s = 0, l = 0, d = o.length, a = i[i.length - 1];
|
|
1229
1229
|
return i.forEach((c, u) => {
|
|
1230
|
-
let h = Ho(e, c), g = h ? e.node(h).order :
|
|
1231
|
-
(h || c ===
|
|
1230
|
+
let h = Ho(e, c), g = h ? e.node(h).order : d;
|
|
1231
|
+
(h || c === a) && (i.slice(l, u + 1).forEach((b) => {
|
|
1232
1232
|
let y = e.predecessors(b);
|
|
1233
1233
|
y && y.forEach((p) => {
|
|
1234
1234
|
let v = e.node(p), N = v.order;
|
|
@@ -1241,7 +1241,7 @@ function Uo(e, t) {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
function Vo(e, t) {
|
|
1243
1243
|
let r = {};
|
|
1244
|
-
function n(i, s, l,
|
|
1244
|
+
function n(i, s, l, d, a) {
|
|
1245
1245
|
pe(s, l).forEach((c) => {
|
|
1246
1246
|
let u = i[c];
|
|
1247
1247
|
if (u !== void 0 && e.node(u).dummy) {
|
|
@@ -1249,23 +1249,23 @@ function Vo(e, t) {
|
|
|
1249
1249
|
h && h.forEach((g) => {
|
|
1250
1250
|
if (g === void 0) return;
|
|
1251
1251
|
let b = e.node(g);
|
|
1252
|
-
b.dummy && (b.order <
|
|
1252
|
+
b.dummy && (b.order < d || b.order > a) && gr(r, g, u);
|
|
1253
1253
|
});
|
|
1254
1254
|
}
|
|
1255
1255
|
});
|
|
1256
1256
|
}
|
|
1257
1257
|
function o(i, s) {
|
|
1258
|
-
let l = -1,
|
|
1258
|
+
let l = -1, d = -1, a = 0;
|
|
1259
1259
|
return s.forEach((c, u) => {
|
|
1260
1260
|
if (e.node(c).dummy === "border") {
|
|
1261
1261
|
let h = e.predecessors(c);
|
|
1262
1262
|
if (h && h.length) {
|
|
1263
1263
|
let g = h[0];
|
|
1264
1264
|
if (g === void 0) return;
|
|
1265
|
-
|
|
1265
|
+
d = e.node(g).order, n(s, a, u, l, d), a = u, l = d;
|
|
1266
1266
|
}
|
|
1267
1267
|
}
|
|
1268
|
-
n(s,
|
|
1268
|
+
n(s, a, s.length, d, i.length);
|
|
1269
1269
|
}), s;
|
|
1270
1270
|
}
|
|
1271
1271
|
return t.length && t.reduce(o), r;
|
|
@@ -1295,13 +1295,13 @@ function qo(e, t, r) {
|
|
|
1295
1295
|
function Xo(e, t, r, n) {
|
|
1296
1296
|
let o = {}, i = {}, s = {};
|
|
1297
1297
|
return t.forEach((l) => {
|
|
1298
|
-
l.forEach((
|
|
1299
|
-
o[
|
|
1298
|
+
l.forEach((d, a) => {
|
|
1299
|
+
o[d] = d, i[d] = d, s[d] = a;
|
|
1300
1300
|
});
|
|
1301
1301
|
}), t.forEach((l) => {
|
|
1302
|
-
let
|
|
1303
|
-
l.forEach((
|
|
1304
|
-
let c = n(
|
|
1302
|
+
let d = -1;
|
|
1303
|
+
l.forEach((a) => {
|
|
1304
|
+
let c = n(a);
|
|
1305
1305
|
if (c && c.length) {
|
|
1306
1306
|
let u = c.sort((g, b) => {
|
|
1307
1307
|
let y = s[g], p = s[b];
|
|
@@ -1311,9 +1311,9 @@ function Xo(e, t, r, n) {
|
|
|
1311
1311
|
let y = u[g];
|
|
1312
1312
|
if (y === void 0) continue;
|
|
1313
1313
|
let p = s[y];
|
|
1314
|
-
if (p !== void 0 && i[
|
|
1314
|
+
if (p !== void 0 && i[a] === a && d < p && !qo(r, a, y)) {
|
|
1315
1315
|
let v = o[y];
|
|
1316
|
-
v !== void 0 && (i[y] =
|
|
1316
|
+
v !== void 0 && (i[y] = a, i[a] = o[a] = v, d = p);
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
@@ -1322,7 +1322,7 @@ function Xo(e, t, r, n) {
|
|
|
1322
1322
|
}
|
|
1323
1323
|
function Jo(e, t, r, n, o = !1) {
|
|
1324
1324
|
let i = {}, s = Zo(e, t, r, o), l = o ? "borderLeft" : "borderRight";
|
|
1325
|
-
function
|
|
1325
|
+
function d(g, b) {
|
|
1326
1326
|
let y = s.nodes().slice(), p = {}, v = y.pop();
|
|
1327
1327
|
for (; v; ) {
|
|
1328
1328
|
if (p[v]) g(v);
|
|
@@ -1333,7 +1333,7 @@ function Jo(e, t, r, n, o = !1) {
|
|
|
1333
1333
|
v = y.pop();
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function a(g) {
|
|
1337
1337
|
let b = s.inEdges(g);
|
|
1338
1338
|
b ? i[g] = b.reduce((y, p) => {
|
|
1339
1339
|
var v;
|
|
@@ -1356,7 +1356,7 @@ function Jo(e, t, r, n, o = !1) {
|
|
|
1356
1356
|
function h(g) {
|
|
1357
1357
|
return s.successors(g) || [];
|
|
1358
1358
|
}
|
|
1359
|
-
return a
|
|
1359
|
+
return d(a, u), d(c, h), Object.keys(n).forEach((g) => {
|
|
1360
1360
|
var b;
|
|
1361
1361
|
let y = r[g];
|
|
1362
1362
|
y !== void 0 && (i[g] = (b = i[y]) != null ? b : 0);
|
|
@@ -1365,18 +1365,18 @@ function Jo(e, t, r, n, o = !1) {
|
|
|
1365
1365
|
function Zo(e, t, r, n) {
|
|
1366
1366
|
let o = new G(), i = e.graph(), s = ni(i.nodesep, i.edgesep, n);
|
|
1367
1367
|
return t.forEach((l) => {
|
|
1368
|
-
let
|
|
1369
|
-
l.forEach((
|
|
1370
|
-
let c = r[
|
|
1368
|
+
let d;
|
|
1369
|
+
l.forEach((a) => {
|
|
1370
|
+
let c = r[a];
|
|
1371
1371
|
if (c !== void 0) {
|
|
1372
|
-
if (o.setNode(c),
|
|
1373
|
-
let u = r[
|
|
1372
|
+
if (o.setNode(c), d !== void 0) {
|
|
1373
|
+
let u = r[d];
|
|
1374
1374
|
if (u !== void 0) {
|
|
1375
1375
|
let h = o.edge(u, c);
|
|
1376
|
-
o.setEdge(u, c, Math.max(s(e,
|
|
1376
|
+
o.setEdge(u, c, Math.max(s(e, a, d), h || 0));
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
|
-
|
|
1379
|
+
d = a;
|
|
1380
1380
|
}
|
|
1381
1381
|
});
|
|
1382
1382
|
}), o;
|
|
@@ -1384,9 +1384,9 @@ function Zo(e, t, r, n) {
|
|
|
1384
1384
|
function Qo(e, t) {
|
|
1385
1385
|
return Object.values(t).reduce((r, n) => {
|
|
1386
1386
|
let o = Number.NEGATIVE_INFINITY, i = Number.POSITIVE_INFINITY;
|
|
1387
|
-
Object.entries(n).forEach(([l,
|
|
1388
|
-
let
|
|
1389
|
-
o = Math.max(
|
|
1387
|
+
Object.entries(n).forEach(([l, d]) => {
|
|
1388
|
+
let a = oi(e, l) / 2;
|
|
1389
|
+
o = Math.max(d + a, o), i = Math.min(d - a, i);
|
|
1390
1390
|
});
|
|
1391
1391
|
let s = o - i;
|
|
1392
1392
|
return s < r[0] && (r = [s, n]), r;
|
|
@@ -1396,10 +1396,10 @@ function ei(e, t) {
|
|
|
1396
1396
|
let r = Object.values(t), n = K(Math.min, r), o = K(Math.max, r);
|
|
1397
1397
|
["u", "d"].forEach((i) => {
|
|
1398
1398
|
["l", "r"].forEach((s) => {
|
|
1399
|
-
let l = i + s,
|
|
1400
|
-
if (!
|
|
1401
|
-
let
|
|
1402
|
-
s !== "l" && (c = o - K(Math.max,
|
|
1399
|
+
let l = i + s, d = e[l];
|
|
1400
|
+
if (!d || d === t) return;
|
|
1401
|
+
let a = Object.values(d), c = n - K(Math.min, a);
|
|
1402
|
+
s !== "l" && (c = o - K(Math.max, a)), c && (e[l] = Ne(d, (u) => u + c));
|
|
1403
1403
|
});
|
|
1404
1404
|
});
|
|
1405
1405
|
}
|
|
@@ -1408,13 +1408,13 @@ function ti(e, t = void 0) {
|
|
|
1408
1408
|
return r ? Ne(r, (n, o) => {
|
|
1409
1409
|
var i, s;
|
|
1410
1410
|
if (t) {
|
|
1411
|
-
let
|
|
1412
|
-
if (
|
|
1411
|
+
let d = t.toLowerCase(), a = e[d];
|
|
1412
|
+
if (a && a[o] !== void 0) return a[o];
|
|
1413
1413
|
}
|
|
1414
|
-
let l = Object.values(e).map((
|
|
1415
|
-
let
|
|
1416
|
-
return
|
|
1417
|
-
}).sort((
|
|
1414
|
+
let l = Object.values(e).map((d) => {
|
|
1415
|
+
let a = d[o];
|
|
1416
|
+
return a !== void 0 ? a : 0;
|
|
1417
|
+
}).sort((d, a) => d - a);
|
|
1418
1418
|
return (((i = l[1]) != null ? i : 0) + ((s = l[2]) != null ? s : 0)) / 2;
|
|
1419
1419
|
}) : {};
|
|
1420
1420
|
}
|
|
@@ -1423,8 +1423,8 @@ function ri(e) {
|
|
|
1423
1423
|
["u", "d"].forEach((s) => {
|
|
1424
1424
|
o = s === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((l) => {
|
|
1425
1425
|
l === "r" && (o = o.map((c) => Object.values(c).reverse()));
|
|
1426
|
-
let
|
|
1427
|
-
l === "r" && (
|
|
1426
|
+
let d = Xo(e, o, r, (c) => (s === "u" ? e.predecessors(c) : e.successors(c)) || []), a = Jo(e, o, d.root, d.align, l === "r");
|
|
1427
|
+
l === "r" && (a = Ne(a, (c) => -c)), n[s + l] = a;
|
|
1428
1428
|
});
|
|
1429
1429
|
});
|
|
1430
1430
|
let i = Qo(e, n);
|
|
@@ -1432,24 +1432,24 @@ function ri(e) {
|
|
|
1432
1432
|
}
|
|
1433
1433
|
function ni(e, t, r) {
|
|
1434
1434
|
return (n, o, i) => {
|
|
1435
|
-
let s = n.node(o), l = n.node(i),
|
|
1436
|
-
if (
|
|
1435
|
+
let s = n.node(o), l = n.node(i), d = 0, a;
|
|
1436
|
+
if (d += s.width / 2, Object.hasOwn(s, "labelpos")) switch (s.labelpos.toLowerCase()) {
|
|
1437
1437
|
case "l":
|
|
1438
|
-
|
|
1438
|
+
a = -s.width / 2;
|
|
1439
1439
|
break;
|
|
1440
1440
|
case "r":
|
|
1441
|
-
|
|
1441
|
+
a = s.width / 2;
|
|
1442
1442
|
break;
|
|
1443
1443
|
}
|
|
1444
|
-
if (
|
|
1444
|
+
if (a && (d += r ? a : -a), a = void 0, d += (s.dummy ? t : e) / 2, d += (l.dummy ? t : e) / 2, d += l.width / 2, Object.hasOwn(l, "labelpos")) switch (l.labelpos.toLowerCase()) {
|
|
1445
1445
|
case "l":
|
|
1446
|
-
|
|
1446
|
+
a = l.width / 2;
|
|
1447
1447
|
break;
|
|
1448
1448
|
case "r":
|
|
1449
|
-
|
|
1449
|
+
a = -l.width / 2;
|
|
1450
1450
|
break;
|
|
1451
1451
|
}
|
|
1452
|
-
return
|
|
1452
|
+
return a && (d += r ? a : -a), d;
|
|
1453
1453
|
};
|
|
1454
1454
|
}
|
|
1455
1455
|
function oi(e, t) {
|
|
@@ -1461,14 +1461,14 @@ function ii(e) {
|
|
|
1461
1461
|
function si(e) {
|
|
1462
1462
|
let t = ye(e), r = e.graph(), n = r.ranksep, o = r.rankalign, i = 0;
|
|
1463
1463
|
t.forEach((s) => {
|
|
1464
|
-
let l = s.reduce((
|
|
1464
|
+
let l = s.reduce((d, a) => {
|
|
1465
1465
|
var c;
|
|
1466
|
-
let u = (c = e.node(
|
|
1467
|
-
return
|
|
1466
|
+
let u = (c = e.node(a).height) != null ? c : 0;
|
|
1467
|
+
return d > u ? d : u;
|
|
1468
1468
|
}, 0);
|
|
1469
|
-
s.forEach((
|
|
1470
|
-
let
|
|
1471
|
-
o === "top" ?
|
|
1469
|
+
s.forEach((d) => {
|
|
1470
|
+
let a = e.node(d);
|
|
1471
|
+
o === "top" ? a.y = i + a.height / 2 : o === "bottom" ? a.y = i + l - a.height / 2 : a.y = i + l / 2;
|
|
1472
1472
|
}), i += l + n;
|
|
1473
1473
|
});
|
|
1474
1474
|
}
|
|
@@ -1476,13 +1476,13 @@ function li(e, t = {}) {
|
|
|
1476
1476
|
let r = t.debugTiming ? rr : nr;
|
|
1477
1477
|
return r("layout", () => {
|
|
1478
1478
|
let n = r(" buildLayoutGraph", () => yi(e));
|
|
1479
|
-
return r(" runLayout", () =>
|
|
1479
|
+
return r(" runLayout", () => ai(n, r, t)), r(" updateInputGraph", () => di(e, n)), n;
|
|
1480
1480
|
});
|
|
1481
1481
|
}
|
|
1482
|
-
function
|
|
1482
|
+
function ai(e, t, r) {
|
|
1483
1483
|
t(" makeSpaceForEdgeLabels", () => mi(e)), t(" removeSelfEdges", () => Ci(e)), t(" acyclic", () => Xn(e)), t(" nestingGraph.run", () => Eo(e)), t(" rank", () => ho(Qt(e))), t(" injectEdgeLabelProxies", () => wi(e)), t(" removeEmptyRanks", () => Dn(e)), t(" nestingGraph.cleanup", () => _o(e)), t(" normalizeRanks", () => Rn(e)), t(" assignRankMinMax", () => vi(e)), t(" removeEdgeLabelProxies", () => Ei(e)), t(" normalize.run", () => Qn(e)), t(" parentDummyChains", () => yo(e)), t(" addBorderSegments", () => To(e)), t(" order", () => hr(e, r)), t(" insertSelfEdges", () => Si(e)), t(" adjustCoordinateSystem", () => Co(e)), t(" position", () => ii(e)), t(" positionSelfEdges", () => Ii(e)), t(" removeBorderNodes", () => Ni(e)), t(" normalize.undo", () => to(e)), t(" fixupEdgeLabelCoords", () => _i(e)), t(" undoCoordinateSystem", () => So(e)), t(" translateGraph", () => ki(e)), t(" assignNodeIntersects", () => xi(e)), t(" reversePoints", () => Ti(e)), t(" acyclic.undo", () => Zn(e));
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1485
|
+
function di(e, t) {
|
|
1486
1486
|
e.nodes().forEach((r) => {
|
|
1487
1487
|
let n = e.node(r), o = t.node(r);
|
|
1488
1488
|
n && (n.x = o.x, n.y = o.y, n.order = o.order, n.rank = o.rank, t.children(r).length && (n.width = o.width, n.height = o.height));
|
|
@@ -1540,18 +1540,18 @@ function Ei(e) {
|
|
|
1540
1540
|
}
|
|
1541
1541
|
function ki(e) {
|
|
1542
1542
|
let t = Number.POSITIVE_INFINITY, r = 0, n = Number.POSITIVE_INFINITY, o = 0, i = e.graph(), s = i.marginx || 0, l = i.marginy || 0;
|
|
1543
|
-
function a
|
|
1544
|
-
let c =
|
|
1543
|
+
function d(a) {
|
|
1544
|
+
let c = a.x, u = a.y, h = a.width, g = a.height;
|
|
1545
1545
|
t = Math.min(t, c - h / 2), r = Math.max(r, c + h / 2), n = Math.min(n, u - g / 2), o = Math.max(o, u + g / 2);
|
|
1546
1546
|
}
|
|
1547
|
-
e.nodes().forEach((
|
|
1548
|
-
let c = e.edge(
|
|
1549
|
-
Object.hasOwn(c, "x") &&
|
|
1550
|
-
}), t -= s, n -= l, e.nodes().forEach((
|
|
1551
|
-
let c = e.node(
|
|
1547
|
+
e.nodes().forEach((a) => d(e.node(a))), e.edges().forEach((a) => {
|
|
1548
|
+
let c = e.edge(a);
|
|
1549
|
+
Object.hasOwn(c, "x") && d(c);
|
|
1550
|
+
}), t -= s, n -= l, e.nodes().forEach((a) => {
|
|
1551
|
+
let c = e.node(a);
|
|
1552
1552
|
c.x -= t, c.y -= n;
|
|
1553
|
-
}), e.edges().forEach((
|
|
1554
|
-
let c = e.edge(
|
|
1553
|
+
}), e.edges().forEach((a) => {
|
|
1554
|
+
let c = e.edge(a);
|
|
1555
1555
|
c.points.forEach((u) => {
|
|
1556
1556
|
u.x -= t, u.y -= n;
|
|
1557
1557
|
}), Object.hasOwn(c, "x") && (c.x -= t), Object.hasOwn(c, "y") && (c.y -= n);
|
|
@@ -1615,8 +1615,8 @@ function Ii(e) {
|
|
|
1615
1615
|
e.nodes().forEach((t) => {
|
|
1616
1616
|
let r = e.node(t);
|
|
1617
1617
|
if (r.dummy === "selfedge") {
|
|
1618
|
-
let n = r, o = e.node(n.e.v), i = o.x + o.width / 2, s = o.y, l = r.x - i,
|
|
1619
|
-
e.setEdge(n.e, n.label), e.removeNode(t), n.label.points = [{ x: i + 2 * l / 3, y: s -
|
|
1618
|
+
let n = r, o = e.node(n.e.v), i = o.x + o.width / 2, s = o.y, l = r.x - i, d = o.height / 2;
|
|
1619
|
+
e.setEdge(n.e, n.label), e.removeNode(t), n.label.points = [{ x: i + 2 * l / 3, y: s - d }, { x: i + 5 * l / 6, y: s - d }, { x: i + l, y: s }, { x: i + 5 * l / 6, y: s + d }, { x: i + 2 * l / 3, y: s + d }], n.label.x = r.x, n.label.y = r.y;
|
|
1620
1620
|
}
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
@@ -1651,23 +1651,23 @@ const ji = (e) => {
|
|
|
1651
1651
|
if (!r || r === n.current) return;
|
|
1652
1652
|
const i = {};
|
|
1653
1653
|
for (const s of r.split(",")) {
|
|
1654
|
-
const [l,
|
|
1655
|
-
l &&
|
|
1654
|
+
const [l, d] = s.split(":"), a = Number(d);
|
|
1655
|
+
l && a > 0 && (i[l] = a);
|
|
1656
1656
|
}
|
|
1657
1657
|
Object.keys(i).length !== 0 && (n.current = r, e(i));
|
|
1658
1658
|
}, [r]), null;
|
|
1659
1659
|
}, Se = ({ isOpen: e, onClose: t, title: r, icon: n, children: o, footer: i, width: s = 600 }) => {
|
|
1660
|
-
const [l,
|
|
1660
|
+
const [l, d] = j(!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: [
|
|
1661
1661
|
n && /* @__PURE__ */ f(te, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: n }),
|
|
1662
1662
|
/* @__PURE__ */ f("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 500, color: "#212121" }, children: r }),
|
|
1663
|
-
/* @__PURE__ */ f(bt, { onClick:
|
|
1663
|
+
/* @__PURE__ */ f(bt, { onClick: a, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ f(tn, {}) : /* @__PURE__ */ f(rn, {}) }),
|
|
1664
1664
|
/* @__PURE__ */ f(bt, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ f(Pr, {}) })
|
|
1665
1665
|
] }), u = () => i ? /* @__PURE__ */ f(te, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
|
|
1666
|
-
return l ? /* @__PURE__ */
|
|
1666
|
+
return l ? /* @__PURE__ */ w(Lr, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
|
|
1667
1667
|
/* @__PURE__ */ f(c, {}),
|
|
1668
1668
|
/* @__PURE__ */ f(te, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1669
1669
|
/* @__PURE__ */ f(u, {})
|
|
1670
|
-
] }) : /* @__PURE__ */
|
|
1670
|
+
] }) : /* @__PURE__ */ w(
|
|
1671
1671
|
Ar,
|
|
1672
1672
|
{
|
|
1673
1673
|
anchor: "right",
|
|
@@ -1698,10 +1698,10 @@ const ji = (e) => {
|
|
|
1698
1698
|
]
|
|
1699
1699
|
}
|
|
1700
1700
|
);
|
|
1701
|
-
}, zi = ({ open: e, templates: t, messages: r, onSelect: n, onClose: o }) => /* @__PURE__ */ f(Se, { isOpen: e, onClose: o, title: r.addTriggerTitle, icon: /* @__PURE__ */ f(en, {}), width: 500, children: /* @__PURE__ */
|
|
1701
|
+
}, zi = ({ open: e, templates: t, messages: r, onSelect: n, onClose: o }) => /* @__PURE__ */ f(Se, { isOpen: e, onClose: o, title: r.addTriggerTitle, icon: /* @__PURE__ */ f(en, {}), width: 500, children: /* @__PURE__ */ w(te, { sx: { p: 2 }, children: [
|
|
1702
1702
|
/* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: r.chooseTrigger }),
|
|
1703
|
-
/* @__PURE__ */
|
|
1704
|
-
t.map((i) => /* @__PURE__ */
|
|
1703
|
+
/* @__PURE__ */ w("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
|
|
1704
|
+
t.map((i) => /* @__PURE__ */ w(
|
|
1705
1705
|
"div",
|
|
1706
1706
|
{
|
|
1707
1707
|
className: "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-start ff-gap-3",
|
|
@@ -1720,7 +1720,7 @@ const ji = (e) => {
|
|
|
1720
1720
|
},
|
|
1721
1721
|
children: [
|
|
1722
1722
|
/* @__PURE__ */ f("div", { style: { color: i.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: i.triggerCategory === "scheduler" ? /* @__PURE__ */ f(Br, { size: 18 }) : /* @__PURE__ */ f(Wr, { size: 18 }) }),
|
|
1723
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ w("div", { children: [
|
|
1724
1724
|
/* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: i.label }),
|
|
1725
1725
|
i.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: i.description })
|
|
1726
1726
|
] })
|
|
@@ -1749,30 +1749,30 @@ const ji = (e) => {
|
|
|
1749
1749
|
} else
|
|
1750
1750
|
h.push(g);
|
|
1751
1751
|
return { apps: [...u.values()], ungrouped: h };
|
|
1752
|
-
}, [t]), [l,
|
|
1752
|
+
}, [t]), [l, d] = j(null), a = l ? i.find((u) => u.key === l) ?? null : null;
|
|
1753
1753
|
ie(() => {
|
|
1754
|
-
e ||
|
|
1754
|
+
e || d(null);
|
|
1755
1755
|
}, [e]), ie(() => {
|
|
1756
|
-
|
|
1756
|
+
d(null);
|
|
1757
1757
|
}, [t]);
|
|
1758
|
-
const c = !
|
|
1758
|
+
const c = !a;
|
|
1759
1759
|
return /* @__PURE__ */ f(
|
|
1760
1760
|
Se,
|
|
1761
1761
|
{
|
|
1762
1762
|
isOpen: e,
|
|
1763
1763
|
onClose: o,
|
|
1764
|
-
title: c ? r.addStepTitle :
|
|
1765
|
-
icon: c ? /* @__PURE__ */ f($r, {}) :
|
|
1764
|
+
title: c ? r.addStepTitle : a.label,
|
|
1765
|
+
icon: c ? /* @__PURE__ */ f($r, {}) : a.icon ?? /* @__PURE__ */ f(Yr, {}),
|
|
1766
1766
|
width: 500,
|
|
1767
|
-
children: /* @__PURE__ */
|
|
1768
|
-
!c && /* @__PURE__ */
|
|
1767
|
+
children: /* @__PURE__ */ w(te, { sx: { p: 2 }, children: [
|
|
1768
|
+
!c && /* @__PURE__ */ w(
|
|
1769
1769
|
"div",
|
|
1770
1770
|
{
|
|
1771
1771
|
role: "button",
|
|
1772
1772
|
tabIndex: 0,
|
|
1773
|
-
onClick: () =>
|
|
1773
|
+
onClick: () => d(null),
|
|
1774
1774
|
onKeyDown: (u) => {
|
|
1775
|
-
u.key === "Enter" &&
|
|
1775
|
+
u.key === "Enter" && d(null);
|
|
1776
1776
|
},
|
|
1777
1777
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1778
1778
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
@@ -1782,18 +1782,18 @@ const ji = (e) => {
|
|
|
1782
1782
|
]
|
|
1783
1783
|
}
|
|
1784
1784
|
),
|
|
1785
|
-
/* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? r.chooseAction : `Pick an action from ${
|
|
1786
|
-
/* @__PURE__ */ f("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */
|
|
1787
|
-
i.map((u) => /* @__PURE__ */
|
|
1785
|
+
/* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? r.chooseAction : `Pick an action from ${a.label}` }),
|
|
1786
|
+
/* @__PURE__ */ f("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(Lt, { children: [
|
|
1787
|
+
i.map((u) => /* @__PURE__ */ w(
|
|
1788
1788
|
"div",
|
|
1789
1789
|
{
|
|
1790
1790
|
className: Be,
|
|
1791
1791
|
style: Pe,
|
|
1792
|
-
onClick: () =>
|
|
1792
|
+
onClick: () => d(u.key),
|
|
1793
1793
|
role: "button",
|
|
1794
1794
|
tabIndex: 0,
|
|
1795
1795
|
onKeyDown: (h) => {
|
|
1796
|
-
h.key === "Enter" &&
|
|
1796
|
+
h.key === "Enter" && d(u.key);
|
|
1797
1797
|
},
|
|
1798
1798
|
onMouseEnter: (h) => {
|
|
1799
1799
|
h.currentTarget.style.background = "#f5f5f5";
|
|
@@ -1803,7 +1803,7 @@ const ji = (e) => {
|
|
|
1803
1803
|
},
|
|
1804
1804
|
children: [
|
|
1805
1805
|
u.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0 }, children: u.icon }),
|
|
1806
|
-
/* @__PURE__ */
|
|
1806
|
+
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1807
1807
|
/* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: u.label }),
|
|
1808
1808
|
/* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: u.description ?? `${u.descriptors.length} action${u.descriptors.length === 1 ? "" : "s"}` })
|
|
1809
1809
|
] }),
|
|
@@ -1812,7 +1812,7 @@ const ji = (e) => {
|
|
|
1812
1812
|
},
|
|
1813
1813
|
`app-${u.key}`
|
|
1814
1814
|
)),
|
|
1815
|
-
s.map((u) => /* @__PURE__ */
|
|
1815
|
+
s.map((u) => /* @__PURE__ */ w(
|
|
1816
1816
|
"div",
|
|
1817
1817
|
{
|
|
1818
1818
|
className: Be,
|
|
@@ -1839,7 +1839,7 @@ const ji = (e) => {
|
|
|
1839
1839
|
i.length === 0 && s.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: r.noActions })
|
|
1840
1840
|
] }) : (
|
|
1841
1841
|
/* Stage 2 — actions for the selected app */
|
|
1842
|
-
|
|
1842
|
+
a.descriptors.map((u) => /* @__PURE__ */ w(
|
|
1843
1843
|
"div",
|
|
1844
1844
|
{
|
|
1845
1845
|
className: Be,
|
|
@@ -1868,25 +1868,25 @@ const ji = (e) => {
|
|
|
1868
1868
|
}
|
|
1869
1869
|
);
|
|
1870
1870
|
}, Ft = "_conditionConfig", Di = ({ open: e, nodeId: t, descriptor: r, initialValues: n, messages: o, onSave: i, onClose: s }) => {
|
|
1871
|
-
const [l,
|
|
1871
|
+
const [l, d] = j([]), [a, c] = j(!1), [u, h] = j(null), [g, b] = j({});
|
|
1872
1872
|
ie(() => {
|
|
1873
1873
|
b((n == null ? void 0 : n[Ft]) ?? {});
|
|
1874
1874
|
}, [n, t]), ie(() => {
|
|
1875
1875
|
let N = !1;
|
|
1876
1876
|
if (h(null), !r || !t) {
|
|
1877
|
-
|
|
1877
|
+
d([]), c(!1);
|
|
1878
1878
|
return;
|
|
1879
1879
|
}
|
|
1880
1880
|
const O = r.formSchema;
|
|
1881
1881
|
return typeof O == "function" ? (c(!0), O(t).then((M) => {
|
|
1882
|
-
N || (
|
|
1882
|
+
N || (d(M), c(!1));
|
|
1883
1883
|
}).catch((M) => {
|
|
1884
|
-
N || (
|
|
1885
|
-
})) : (
|
|
1884
|
+
N || (d([]), h(M instanceof Error ? M.message : "Unable to load configuration."), c(!1));
|
|
1885
|
+
})) : (d(O), c(!1)), () => {
|
|
1886
1886
|
N = !0;
|
|
1887
1887
|
};
|
|
1888
1888
|
}, [r, t]);
|
|
1889
|
-
const y = t ? `node-config-form-${t}` : "node-config-form", p = !
|
|
1889
|
+
const y = t ? `node-config-form-${t}` : "node-config-form", p = !a && !u && l.length > 0, v = p ? /* @__PURE__ */ w(Lt, { children: [
|
|
1890
1890
|
/* @__PURE__ */ f(yt, { type: "button", variant: "outlined", size: "small", onClick: s, children: o.cancel }),
|
|
1891
1891
|
/* @__PURE__ */ f(yt, { type: "submit", form: y, variant: "contained", size: "small", children: o.save })
|
|
1892
1892
|
] }) : null;
|
|
@@ -1899,10 +1899,10 @@ const ji = (e) => {
|
|
|
1899
1899
|
icon: r == null ? void 0 : r.icon,
|
|
1900
1900
|
width: 500,
|
|
1901
1901
|
footer: v,
|
|
1902
|
-
children: /* @__PURE__ */
|
|
1903
|
-
|
|
1904
|
-
!
|
|
1905
|
-
!
|
|
1902
|
+
children: /* @__PURE__ */ w(te, { sx: { p: 2 }, children: [
|
|
1903
|
+
a && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
|
|
1904
|
+
!a && u && /* @__PURE__ */ f("p", { style: { fontSize: 13, color: "#d32f2f" }, children: u }),
|
|
1905
|
+
!a && !u && l.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
|
|
1906
1906
|
p && /* @__PURE__ */ f(
|
|
1907
1907
|
nn,
|
|
1908
1908
|
{
|
|
@@ -1943,14 +1943,14 @@ const ji = (e) => {
|
|
|
1943
1943
|
title: n ? `Preview: ${n}` : "Sub-Workflow Preview",
|
|
1944
1944
|
icon: /* @__PURE__ */ f(Ur, { size: 18, color: "#00695c" }),
|
|
1945
1945
|
width: 700,
|
|
1946
|
-
children: /* @__PURE__ */
|
|
1946
|
+
children: /* @__PURE__ */ w("div", { style: { height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: 24 }, children: [
|
|
1947
1947
|
i.status === "idle" && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", fontSize: 14 }, children: "Select a workflow to preview" }),
|
|
1948
|
-
i.status === "loading" && /* @__PURE__ */
|
|
1948
|
+
i.status === "loading" && /* @__PURE__ */ w("div", { style: { textAlign: "center", color: "#9e9e9e" }, children: [
|
|
1949
1949
|
/* @__PURE__ */ f("div", { style: { width: 32, height: 32, borderRadius: "50%", border: "3px solid #e0e0e0", borderTopColor: "#00897b", animation: "spin 0.8s linear infinite", margin: "0 auto 12px" } }),
|
|
1950
1950
|
/* @__PURE__ */ f("span", { style: { fontSize: 14 }, children: "Loading workflow…" }),
|
|
1951
1951
|
/* @__PURE__ */ f("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
|
|
1952
1952
|
] }),
|
|
1953
|
-
i.status === "error" && /* @__PURE__ */
|
|
1953
|
+
i.status === "error" && /* @__PURE__ */ w("div", { style: { textAlign: "center", color: "#c62828" }, children: [
|
|
1954
1954
|
/* @__PURE__ */ f(Kr, { size: 32, style: { marginBottom: 8 } }),
|
|
1955
1955
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: i.message })
|
|
1956
1956
|
] }),
|
|
@@ -2007,36 +2007,36 @@ function Bi(e, t, r, n = "TB") {
|
|
|
2007
2007
|
const s = r[i.id] ?? { width: be, height: Ke[i.type ?? ""] ?? 80 };
|
|
2008
2008
|
o.setNode(i.id, { width: s.width, height: s.height });
|
|
2009
2009
|
}), t.forEach((i) => o.setEdge(i.source, i.target)), jt.layout(o), e.map((i) => {
|
|
2010
|
-
var
|
|
2011
|
-
const s = o.node(i.id), l = ((
|
|
2012
|
-
return { ...i, position: { x: s.x - l / 2, y: s.y -
|
|
2010
|
+
var a, c;
|
|
2011
|
+
const s = o.node(i.id), l = ((a = r[i.id]) == null ? void 0 : a.width) ?? be, d = ((c = r[i.id]) == null ? void 0 : c.height) ?? Ke[i.type ?? ""] ?? 80;
|
|
2012
|
+
return { ...i, position: { x: s.x - l / 2, y: s.y - d / 2 } };
|
|
2013
2013
|
});
|
|
2014
2014
|
}
|
|
2015
2015
|
const oe = (e) => e === "filter" || e === "approval";
|
|
2016
2016
|
function Wi(e, t, r, n) {
|
|
2017
|
-
const s = $e, l = 30,
|
|
2017
|
+
const s = $e, l = 30, d = 30, a = {}, c = {}, u = /* @__PURE__ */ new Map();
|
|
2018
2018
|
for (const p of e) u.set(p.id, p);
|
|
2019
2019
|
for (const p of Object.values(t))
|
|
2020
2020
|
for (const v of Object.values(p))
|
|
2021
2021
|
for (const N of v) u.set(N.id, N);
|
|
2022
2022
|
const h = (p, v, N) => {
|
|
2023
2023
|
const O = n[p] ?? { width: be, height: 80 };
|
|
2024
|
-
return
|
|
2024
|
+
return a[p] = { x: v - O.width / 2, y: N }, N + O.height;
|
|
2025
2025
|
}, g = (p, v, N) => {
|
|
2026
2026
|
let O = N;
|
|
2027
2027
|
for (const M of p)
|
|
2028
2028
|
O = h(M.id, v, O) + s, oe(M.kind) && t[M.id] && (O = b(M.id, v, O));
|
|
2029
2029
|
return O;
|
|
2030
2030
|
}, b = (p, v, N) => {
|
|
2031
|
-
const O = v + 180, M = t[p], F = Object.keys(M), B = u.get(p), re = (B == null ? void 0 : B.branchLabels) ?? { pass: "Pass", fail: "Fail" }, he =
|
|
2031
|
+
const O = v + 180, M = t[p], F = Object.keys(M), B = u.get(p), re = (B == null ? void 0 : B.branchLabels) ?? { pass: "Pass", fail: "Fail" }, he = a[p], z = n[p] ?? { height: 80 }, me = he.y + z.height, we = [];
|
|
2032
2032
|
let U = N;
|
|
2033
|
-
return F.forEach((le,
|
|
2034
|
-
const R = M[le],
|
|
2033
|
+
return F.forEach((le, Z) => {
|
|
2034
|
+
const R = M[le], V = U;
|
|
2035
2035
|
we.push({
|
|
2036
|
-
y:
|
|
2036
|
+
y: V - me,
|
|
2037
2037
|
label: re[le] ?? le,
|
|
2038
|
-
isPass:
|
|
2039
|
-
}), U = g(R, O, U +
|
|
2038
|
+
isPass: Z === 0
|
|
2039
|
+
}), U = g(R, O, U + d), Z < F.length - 1 && (U += l);
|
|
2040
2040
|
}), c[p] = {
|
|
2041
2041
|
branches: we,
|
|
2042
2042
|
height: U - me,
|
|
@@ -2047,7 +2047,7 @@ function Wi(e, t, r, n) {
|
|
|
2047
2047
|
for (const p of e)
|
|
2048
2048
|
y = h(p.id, 400, y) + s, oe(p.kind) && t[p.id] && (y = b(p.id, 400, y));
|
|
2049
2049
|
return {
|
|
2050
|
-
nodes: r.map((p) =>
|
|
2050
|
+
nodes: r.map((p) => a[p.id] ? { ...p, position: a[p.id] } : p),
|
|
2051
2051
|
railSpecs: c
|
|
2052
2052
|
};
|
|
2053
2053
|
}
|
|
@@ -2076,12 +2076,12 @@ function Gi(e, t, r, n, o) {
|
|
|
2076
2076
|
};
|
|
2077
2077
|
}
|
|
2078
2078
|
function $i(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
2079
|
-
const l = o.edgeColor ?? "#b0bec5",
|
|
2079
|
+
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (b, y) => {
|
|
2080
2080
|
const p = t[b];
|
|
2081
2081
|
if (!p) return;
|
|
2082
2082
|
const N = y ?? { pass: "Pass", fail: "Fail" }, O = Object.keys(p), M = (F, B, re, he) => {
|
|
2083
2083
|
if (F.length !== 0) {
|
|
2084
|
-
F.forEach((z) =>
|
|
2084
|
+
F.forEach((z) => d.push(Rt(z))), a.push({
|
|
2085
2085
|
id: `e-${b}-${B}-start`,
|
|
2086
2086
|
source: b,
|
|
2087
2087
|
target: F[0].id,
|
|
@@ -2090,7 +2090,7 @@ function $i(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
|
2090
2090
|
data: { branch: B, filterId: b, label: re, isFirst: he === 0, onAddStepClick: r, verticalRouting: s === "vertical" }
|
|
2091
2091
|
});
|
|
2092
2092
|
for (let z = 1; z < F.length; z++)
|
|
2093
|
-
oe(F[z - 1].kind) ||
|
|
2093
|
+
oe(F[z - 1].kind) || a.push(Gi(F[z - 1], F[z], l, r, { filterId: b, branch: B }));
|
|
2094
2094
|
for (const z of F)
|
|
2095
2095
|
oe(z.kind) && t[z.id] && c(z.id, z.branchLabels);
|
|
2096
2096
|
}
|
|
@@ -2101,10 +2101,10 @@ function $i(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
|
2101
2101
|
};
|
|
2102
2102
|
for (let b = 0; b < e.length; b++) {
|
|
2103
2103
|
const y = e[b];
|
|
2104
|
-
if (
|
|
2104
|
+
if (d.push(Rt(y)), b > 0) {
|
|
2105
2105
|
const p = e[b - 1], v = p.kind === "start" || p.kind === "addTrigger";
|
|
2106
2106
|
if (p.kind === "filter" || p.kind === "approval") continue;
|
|
2107
|
-
|
|
2107
|
+
a.push({
|
|
2108
2108
|
id: `e-${p.id}-${y.id}`,
|
|
2109
2109
|
source: p.id,
|
|
2110
2110
|
target: y.id,
|
|
@@ -2119,7 +2119,7 @@ function $i(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
|
2119
2119
|
(y.kind === "filter" || y.kind === "approval") && t[y.id] && c(y.id, y.branchLabels);
|
|
2120
2120
|
}
|
|
2121
2121
|
const u = {};
|
|
2122
|
-
if (
|
|
2122
|
+
if (d.forEach((b) => {
|
|
2123
2123
|
u[b.id] = {
|
|
2124
2124
|
width: be,
|
|
2125
2125
|
height: n[b.id] ?? Ke[b.type ?? ""] ?? 80
|
|
@@ -2127,25 +2127,25 @@ function $i(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
|
2127
2127
|
}), !(Object.keys(t).length > 0)) {
|
|
2128
2128
|
if (i === "LR") {
|
|
2129
2129
|
let N = Ye;
|
|
2130
|
-
return { nodes:
|
|
2130
|
+
return { nodes: d.map((M) => {
|
|
2131
2131
|
const F = u[M.id].width, B = u[M.id].height, re = { ...M, position: { x: N, y: 300 - B / 2 } };
|
|
2132
2132
|
return N += F + $e, re;
|
|
2133
|
-
}), edges:
|
|
2133
|
+
}), edges: a };
|
|
2134
2134
|
}
|
|
2135
2135
|
const b = 400;
|
|
2136
2136
|
let y = Ye;
|
|
2137
|
-
return { nodes:
|
|
2137
|
+
return { nodes: d.map((v) => {
|
|
2138
2138
|
const N = u[v.id].height, O = { ...v, position: { x: b - be / 2, y } };
|
|
2139
2139
|
return y += N + $e, O;
|
|
2140
|
-
}), edges:
|
|
2140
|
+
}), edges: a };
|
|
2141
2141
|
}
|
|
2142
2142
|
if (s === "vertical") {
|
|
2143
|
-
const { nodes: b, railSpecs: y } = Wi(e, t,
|
|
2143
|
+
const { nodes: b, railSpecs: y } = Wi(e, t, d, u);
|
|
2144
2144
|
return { nodes: b.map(
|
|
2145
2145
|
(v) => y[v.id] ? { ...v, data: { ...v.data, _branchRail: y[v.id] } } : v
|
|
2146
|
-
), edges:
|
|
2146
|
+
), edges: a };
|
|
2147
2147
|
}
|
|
2148
|
-
return { nodes: Bi(
|
|
2148
|
+
return { nodes: Bi(d, a, u, i), edges: a };
|
|
2149
2149
|
}
|
|
2150
2150
|
const Dt = ({
|
|
2151
2151
|
nodeRegistry: e,
|
|
@@ -2156,8 +2156,8 @@ const Dt = ({
|
|
|
2156
2156
|
onSave: i,
|
|
2157
2157
|
readOnly: s = !1,
|
|
2158
2158
|
theme: l = {},
|
|
2159
|
-
messages:
|
|
2160
|
-
canvasOptions:
|
|
2159
|
+
messages: d,
|
|
2160
|
+
canvasOptions: a = {},
|
|
2161
2161
|
renderTriggerSelector: c,
|
|
2162
2162
|
renderNodePicker: u,
|
|
2163
2163
|
renderNodeConfig: h,
|
|
@@ -2180,44 +2180,44 @@ const Dt = ({
|
|
|
2180
2180
|
snapGrid: we = [15, 15],
|
|
2181
2181
|
branchLayout: U = "horizontal",
|
|
2182
2182
|
nodeBody: le = "full"
|
|
2183
|
-
} =
|
|
2184
|
-
const
|
|
2183
|
+
} = a, Z = W(() => on(d), [d]), [R, V] = j(() => (r == null ? void 0 : r.slots) ?? zt()), [H, q] = j(() => (r == null ? void 0 : r.branches) ?? {}), [ae, $] = j(null), [Ie, Ze] = j(null), [de, ve] = j(null), [Oe, Qe] = j(null), [Ee, et] = j(null), [Q, tt] = j(() => {
|
|
2184
|
+
const m = r == null ? void 0 : r.slots.find((k) => k.kind === "triggerFixed"), E = m != null && m.id.startsWith("trigger-") ? m.id.slice(8) : void 0;
|
|
2185
2185
|
return E ? t.lookup(E) ?? null : null;
|
|
2186
|
-
}), [rt, br] = j({}), yr = Y((
|
|
2187
|
-
br(
|
|
2186
|
+
}), [rt, br] = j({}), yr = Y((m) => {
|
|
2187
|
+
br(m);
|
|
2188
2188
|
}, []), mr = W(() => ({ ...Or, ...n }), [n]), wr = W(() => ({ ...Pi, ...o }), [o]), vr = W(() => {
|
|
2189
|
-
const
|
|
2190
|
-
return
|
|
2191
|
-
}, [R,
|
|
2192
|
-
const E = R.find((k) => k.id ===
|
|
2189
|
+
const m = R.filter((k) => k.kind === "userTask").length, E = Object.values(H).flatMap((k) => Object.values(k).flat()).filter((k) => k.kind === "userTask").length;
|
|
2190
|
+
return m + E;
|
|
2191
|
+
}, [R, H]), nt = b ?? (Q == null ? void 0 : Q.maxTasks), ot = nt !== void 0 && vr >= nt, ne = Y((m) => {
|
|
2192
|
+
const E = R.find((k) => k.id === m);
|
|
2193
2193
|
if (E) return E;
|
|
2194
|
-
for (const k of Object.values(
|
|
2195
|
-
const C = Object.values(k).flat().find((x) => x.id ===
|
|
2194
|
+
for (const k of Object.values(H)) {
|
|
2195
|
+
const C = Object.values(k).flat().find((x) => x.id === m);
|
|
2196
2196
|
if (C) return C;
|
|
2197
2197
|
}
|
|
2198
2198
|
return null;
|
|
2199
|
-
}, [R,
|
|
2200
|
-
s || (Ze(
|
|
2201
|
-
}, [s]), it = Y((
|
|
2199
|
+
}, [R, H]), Me = Y((m) => {
|
|
2200
|
+
s || (Ze(m), $("nodeConfig"));
|
|
2201
|
+
}, [s]), it = Y((m) => {
|
|
2202
2202
|
if (!s) {
|
|
2203
|
-
if (R.some((E) => E.id ===
|
|
2204
|
-
const E = R.find((k) => k.id ===
|
|
2203
|
+
if (R.some((E) => E.id === m)) {
|
|
2204
|
+
const E = R.find((k) => k.id === m);
|
|
2205
2205
|
if ((E == null ? void 0 : E.kind) === "triggerFixed") {
|
|
2206
|
-
|
|
2206
|
+
V(zt()), q({}), tt(null);
|
|
2207
2207
|
return;
|
|
2208
2208
|
}
|
|
2209
|
-
|
|
2210
|
-
const C = k.filter((x) => x.id !==
|
|
2209
|
+
V((k) => {
|
|
2210
|
+
const C = k.filter((x) => x.id !== m);
|
|
2211
2211
|
return oe((E == null ? void 0 : E.kind) ?? "") && !C.some((x) => x.kind === "end") ? [...C, { id: "end", kind: "end", reactFlowType: "endNode" }] : C;
|
|
2212
|
-
}),
|
|
2212
|
+
}), q((k) => {
|
|
2213
2213
|
const C = { ...k }, x = (_) => {
|
|
2214
2214
|
C[_] && (Object.values(C[_]).flat().filter((T) => oe(T.kind)).forEach((T) => x(T.id)), delete C[_]);
|
|
2215
2215
|
};
|
|
2216
|
-
return x(
|
|
2216
|
+
return x(m), C;
|
|
2217
2217
|
});
|
|
2218
2218
|
return;
|
|
2219
2219
|
}
|
|
2220
|
-
|
|
2220
|
+
q((E) => {
|
|
2221
2221
|
const k = (x, _) => {
|
|
2222
2222
|
const T = [];
|
|
2223
2223
|
for (const S of x)
|
|
@@ -2226,10 +2226,10 @@ const Dt = ({
|
|
|
2226
2226
|
}, C = { ...E };
|
|
2227
2227
|
for (const x of Object.keys(C))
|
|
2228
2228
|
for (const _ of Object.keys(C[x])) {
|
|
2229
|
-
const T = C[x][_], S = T.findIndex((A) => A.id ===
|
|
2229
|
+
const T = C[x][_], S = T.findIndex((A) => A.id === m);
|
|
2230
2230
|
if (S === -1 || T[S].kind === "end") continue;
|
|
2231
2231
|
const I = T[S];
|
|
2232
|
-
let D = T.filter((A) => A.id !==
|
|
2232
|
+
let D = T.filter((A) => A.id !== m);
|
|
2233
2233
|
return I.kind === "filter" && ((I.id in C ? k([I], C) : []).forEach((L) => delete C[L]), delete C[I.id], D.some((L) => L.kind === "end") || (D = [...D, { id: `end-${x}-${_}`, kind: "end", reactFlowType: "endNode" }])), C[x] = { ...C[x], [_]: D }, C;
|
|
2234
2234
|
}
|
|
2235
2235
|
return C;
|
|
@@ -2237,41 +2237,45 @@ const Dt = ({
|
|
|
2237
2237
|
}
|
|
2238
2238
|
}, [s, R]), je = Y(() => {
|
|
2239
2239
|
s || $("triggerSelect");
|
|
2240
|
-
}, [s]), st = Y((
|
|
2241
|
-
s || ot || (ve(
|
|
2242
|
-
}, [s, ot]), lt = Y((
|
|
2243
|
-
tt(
|
|
2240
|
+
}, [s]), st = Y((m, E) => {
|
|
2241
|
+
s || ot || (ve(m), Qe(E.filterId && E.branch ? { filterId: E.filterId, branch: E.branch } : null), $("nodePicker"));
|
|
2242
|
+
}, [s, ot]), lt = Y((m) => {
|
|
2243
|
+
if (tt(m), $(null), m.skeletonState) {
|
|
2244
|
+
q(m.skeletonState.branches ?? {}), V(m.skeletonState.slots ?? []);
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
q({}), V([
|
|
2244
2248
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2245
2249
|
{
|
|
2246
|
-
id: `trigger-${
|
|
2250
|
+
id: `trigger-${m.triggerKey}`,
|
|
2247
2251
|
kind: "triggerFixed",
|
|
2248
2252
|
reactFlowType: "triggerNode",
|
|
2249
|
-
nodeData: { label:
|
|
2253
|
+
nodeData: { label: m.label, source: m.source },
|
|
2250
2254
|
deletable: !1
|
|
2251
2255
|
},
|
|
2252
2256
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2253
2257
|
]);
|
|
2254
|
-
}, []),
|
|
2255
|
-
const
|
|
2256
|
-
return (Q != null && Q.availableTasks ?
|
|
2257
|
-
}, [e, Q, R,
|
|
2258
|
-
if (!
|
|
2259
|
-
const E = `${
|
|
2258
|
+
}, []), at = Y(() => {
|
|
2259
|
+
const m = e.list();
|
|
2260
|
+
return (Q != null && Q.availableTasks ? m.filter((k) => Q.availableTasks.includes(k.type)) : m).filter((k) => k.maxPerWorkflow === void 0 ? !0 : R.filter((x) => x.descriptorType === k.type).length + Object.values(H).flatMap((x) => Object.values(x).flat()).filter((x) => x.descriptorType === k.type).length < k.maxPerWorkflow);
|
|
2261
|
+
}, [e, Q, R, H]), dt = Y((m) => {
|
|
2262
|
+
if (!de) return;
|
|
2263
|
+
const E = `${m.type}-${Date.now()}`, k = m.reactFlowType === "filterNode" || m.reactFlowType === "approvalNode" || m.reactFlowType === "conditionBranchNode", C = m.branchLabels ?? { pass: "Pass", fail: "Fail" }, x = {
|
|
2260
2264
|
id: E,
|
|
2261
|
-
kind: k ?
|
|
2262
|
-
reactFlowType:
|
|
2263
|
-
descriptorType:
|
|
2265
|
+
kind: k ? m.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
|
|
2266
|
+
reactFlowType: m.reactFlowType,
|
|
2267
|
+
descriptorType: m.type,
|
|
2264
2268
|
formData: {},
|
|
2265
|
-
nodeData: { title:
|
|
2269
|
+
nodeData: { title: m.label },
|
|
2266
2270
|
deletable: !0,
|
|
2267
2271
|
branchLabels: C
|
|
2268
2272
|
};
|
|
2269
2273
|
if (Oe) {
|
|
2270
2274
|
const { filterId: _, branch: T } = Oe;
|
|
2271
|
-
|
|
2275
|
+
q((S) => {
|
|
2272
2276
|
const I = [...S[_][T]];
|
|
2273
2277
|
if (k) {
|
|
2274
|
-
const ee = I.filter((ce) => ce.kind !== "end"), gt = ee.findIndex((ce) => ce.id ===
|
|
2278
|
+
const ee = I.filter((ce) => ce.kind !== "end"), gt = ee.findIndex((ce) => ce.id === de), xr = gt === -1 ? ee.length : gt + 1;
|
|
2275
2279
|
return ee.splice(xr, 0, x), {
|
|
2276
2280
|
...S,
|
|
2277
2281
|
[_]: { ...S[_], [T]: ee },
|
|
@@ -2280,37 +2284,37 @@ const Dt = ({
|
|
|
2280
2284
|
)
|
|
2281
2285
|
};
|
|
2282
2286
|
}
|
|
2283
|
-
const D = I.findIndex((ee) => ee.id ===
|
|
2287
|
+
const D = I.findIndex((ee) => ee.id === de), A = I.findIndex((ee) => ee.kind === "end"), L = D === -1 ? A === -1 ? I.length : A : D + 1;
|
|
2284
2288
|
return I.splice(L, 0, x), { ...S, [_]: { ...S[_], [T]: I } };
|
|
2285
2289
|
});
|
|
2286
2290
|
} else
|
|
2287
|
-
k ? (
|
|
2288
|
-
const T = _.findIndex((I) => I.id ===
|
|
2291
|
+
k ? (V((_) => {
|
|
2292
|
+
const T = _.findIndex((I) => I.id === de);
|
|
2289
2293
|
return [..._.filter((I) => I.kind !== "end").slice(0, T + 1), x];
|
|
2290
|
-
}),
|
|
2294
|
+
}), q((_) => ({
|
|
2291
2295
|
..._,
|
|
2292
2296
|
[E]: Object.fromEntries(
|
|
2293
2297
|
Object.keys(C).map((T) => [T, [{ id: `end-${E}-${T}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2294
2298
|
)
|
|
2295
|
-
}))) :
|
|
2296
|
-
const T = _.findIndex((S) => S.id ===
|
|
2299
|
+
}))) : V((_) => {
|
|
2300
|
+
const T = _.findIndex((S) => S.id === de);
|
|
2297
2301
|
return T === -1 ? _ : [..._.slice(0, T + 1), x, ..._.slice(T + 1)];
|
|
2298
2302
|
});
|
|
2299
2303
|
ve(null), Qe(null), Ze(E), $("nodeConfig");
|
|
2300
|
-
}, [
|
|
2304
|
+
}, [de, Oe]), ct = Y((m, E) => {
|
|
2301
2305
|
const k = (x) => {
|
|
2302
|
-
const _ = ne(
|
|
2306
|
+
const _ = ne(m);
|
|
2303
2307
|
if ((_ == null ? void 0 : _.descriptorType) !== "conditionBranch") return x;
|
|
2304
2308
|
const T = E.branchConfigs ?? [], S = T.map((L) => L.key).filter(Boolean);
|
|
2305
2309
|
if (S.length === 0) return x;
|
|
2306
|
-
const I = x[
|
|
2310
|
+
const I = x[m] ?? {}, D = {};
|
|
2307
2311
|
S.forEach((L) => {
|
|
2308
|
-
D[L] = I[L] ?? [{ id: `end-${
|
|
2312
|
+
D[L] = I[L] ?? [{ id: `end-${m}-${L}`, kind: "end", reactFlowType: "endNode" }];
|
|
2309
2313
|
});
|
|
2310
2314
|
const A = {};
|
|
2311
2315
|
return T.forEach((L) => {
|
|
2312
2316
|
L.key && (A[L.key] = L.label || L.key);
|
|
2313
|
-
}), { ...x, [
|
|
2317
|
+
}), { ...x, [m]: D };
|
|
2314
2318
|
}, C = (x, _) => {
|
|
2315
2319
|
if (x.descriptorType !== "conditionBranch") return { ...x, formData: _ };
|
|
2316
2320
|
const T = _.branchConfigs ?? [], S = {};
|
|
@@ -2318,35 +2322,35 @@ const Dt = ({
|
|
|
2318
2322
|
I.key && (S[I.key] = I.label || I.key);
|
|
2319
2323
|
}), { ...x, formData: _, branchLabels: S };
|
|
2320
2324
|
};
|
|
2321
|
-
if (R.some((x) => x.id ===
|
|
2322
|
-
|
|
2325
|
+
if (R.some((x) => x.id === m)) {
|
|
2326
|
+
q((x) => {
|
|
2323
2327
|
const _ = k(x);
|
|
2324
|
-
return
|
|
2325
|
-
const S = T.map((I) => I.id ===
|
|
2328
|
+
return V((T) => {
|
|
2329
|
+
const S = T.map((I) => I.id === m ? C(I, E) : I);
|
|
2326
2330
|
return i == null || i({ slots: S, branches: _ }), S;
|
|
2327
2331
|
}), _;
|
|
2328
2332
|
});
|
|
2329
2333
|
return;
|
|
2330
2334
|
}
|
|
2331
|
-
|
|
2335
|
+
q((x) => {
|
|
2332
2336
|
const T = { ...k(x) };
|
|
2333
2337
|
for (const S of Object.keys(T)) {
|
|
2334
|
-
const I = (D) => D.map((A) => A.id ===
|
|
2338
|
+
const I = (D) => D.map((A) => A.id === m ? C(A, E) : A);
|
|
2335
2339
|
for (const D of Object.keys(T[S]))
|
|
2336
|
-
if (T[S][D].some((A) => A.id ===
|
|
2340
|
+
if (T[S][D].some((A) => A.id === m))
|
|
2337
2341
|
return T[S] = { ...T[S], [D]: I(T[S][D]) }, i == null || i({ slots: R, branches: T }), T;
|
|
2338
2342
|
}
|
|
2339
2343
|
return T;
|
|
2340
2344
|
});
|
|
2341
|
-
}, [R,
|
|
2342
|
-
() => $i(R,
|
|
2343
|
-
[R,
|
|
2345
|
+
}, [R, H, ne, i]), X = W(() => ne(Ie ?? ""), [ne, Ie]), ut = W(() => X != null && X.descriptorType ? e.forType(X.descriptorType) ?? null : null, [X, e]), { nodes: ft, edges: Er } = W(
|
|
2346
|
+
() => $i(R, H, s ? null : st, rt, l, y, U),
|
|
2347
|
+
[R, H, s, st, rt, l, y, U]
|
|
2344
2348
|
), ht = W(() => {
|
|
2345
|
-
const
|
|
2349
|
+
const m = p ? new Map(p.steps.map((E) => [E.nodeId, E])) : null;
|
|
2346
2350
|
return ft.map((E) => {
|
|
2347
2351
|
let k = {};
|
|
2348
|
-
if (
|
|
2349
|
-
const C =
|
|
2352
|
+
if (m) {
|
|
2353
|
+
const C = m.get(E.id);
|
|
2350
2354
|
C && (k = { _executionStatus: C.status, _executionError: C.error });
|
|
2351
2355
|
}
|
|
2352
2356
|
return E.type === "subWorkflowNode" && v && (k.onPreview = (C) => {
|
|
@@ -2356,10 +2360,11 @@ const Dt = ({
|
|
|
2356
2360
|
}), Object.keys(k).length > 0 ? { ...E, data: { ...E.data, ...k } } : E;
|
|
2357
2361
|
});
|
|
2358
2362
|
}, [ft, p, v, ne]), kr = W(() => ({ onEditNode: Me, onDeleteNode: it, onAddStep: () => {
|
|
2359
|
-
}, onClickAddTrigger: je, messages:
|
|
2360
|
-
return /* @__PURE__ */ f(Dr.Provider, { value: kr, children: /* @__PURE__ */
|
|
2363
|
+
}, onClickAddTrigger: je, messages: Z, nodeRegistry: e, nodeBody: le }), [Me, it, je, Z, e, le]);
|
|
2364
|
+
return /* @__PURE__ */ f(Dr.Provider, { value: kr, children: /* @__PURE__ */ w(
|
|
2361
2365
|
"div",
|
|
2362
2366
|
{
|
|
2367
|
+
className: "flowforge-canvas",
|
|
2363
2368
|
style: {
|
|
2364
2369
|
width: "100%",
|
|
2365
2370
|
height: "100%",
|
|
@@ -2376,7 +2381,7 @@ const Dt = ({
|
|
|
2376
2381
|
"--ff-font-family": l.fontFamily
|
|
2377
2382
|
},
|
|
2378
2383
|
children: [
|
|
2379
|
-
/* @__PURE__ */
|
|
2384
|
+
/* @__PURE__ */ w(
|
|
2380
2385
|
_r,
|
|
2381
2386
|
{
|
|
2382
2387
|
nodes: ht,
|
|
@@ -2394,7 +2399,7 @@ const Dt = ({
|
|
|
2394
2399
|
snapToGrid: me,
|
|
2395
2400
|
snapGrid: we,
|
|
2396
2401
|
proOptions: { hideAttribution: !0 },
|
|
2397
|
-
onNodeClick: (
|
|
2402
|
+
onNodeClick: (m, E) => {
|
|
2398
2403
|
const k = ne(E.id);
|
|
2399
2404
|
k && (g != null && g(k) || (k.kind === "addTrigger" || k.kind === "triggerFixed" ? je() : (k.kind === "userTask" || k.kind === "filter" || k.kind === "approval") && Me(E.id)));
|
|
2400
2405
|
},
|
|
@@ -2413,13 +2418,13 @@ const Dt = ({
|
|
|
2413
2418
|
]
|
|
2414
2419
|
}
|
|
2415
2420
|
),
|
|
2416
|
-
c ?
|
|
2417
|
-
u ?
|
|
2421
|
+
c ? ae === "triggerSelect" && c(t.list(), lt, () => $(null)) : /* @__PURE__ */ f(zi, { open: ae === "triggerSelect", templates: t.list(), messages: Z, onSelect: lt, onClose: () => $(null) }),
|
|
2422
|
+
u ? ae === "nodePicker" && u(at(), dt, () => {
|
|
2418
2423
|
$(null), ve(null);
|
|
2419
|
-
}) : /* @__PURE__ */ f(Ri, { open:
|
|
2424
|
+
}) : /* @__PURE__ */ f(Ri, { open: ae === "nodePicker", availableDescriptors: at(), messages: Z, onSelect: dt, onClose: () => {
|
|
2420
2425
|
$(null), ve(null);
|
|
2421
2426
|
} }),
|
|
2422
|
-
h ?
|
|
2427
|
+
h ? ae === "nodeConfig" && h(ut ?? void 0, X, ct, () => $(null)) : /* @__PURE__ */ f(Di, { open: ae === "nodeConfig", nodeId: Ie, descriptor: ut, initialValues: X == null ? void 0 : X.formData, messages: Z, onSave: ct, onClose: () => $(null) }),
|
|
2423
2428
|
v && Ee && /* @__PURE__ */ f(
|
|
2424
2429
|
Li,
|
|
2425
2430
|
{
|
|
@@ -2441,7 +2446,7 @@ const Dt = ({
|
|
|
2441
2446
|
function Ki({ template: e, onSelect: t }) {
|
|
2442
2447
|
var o, i;
|
|
2443
2448
|
const r = e.triggerCategory ? sn[e.triggerCategory] : null, n = ((o = e.skeletonState) == null ? void 0 : o.slots.filter((s) => s.kind === "userTask").length) ?? 0;
|
|
2444
|
-
return /* @__PURE__ */
|
|
2449
|
+
return /* @__PURE__ */ w(
|
|
2445
2450
|
"div",
|
|
2446
2451
|
{
|
|
2447
2452
|
role: "button",
|
|
@@ -2469,23 +2474,23 @@ function Ki({ template: e, onSelect: t }) {
|
|
|
2469
2474
|
s.currentTarget.style.borderColor = "#e0e0e0", s.currentTarget.style.boxShadow = "none";
|
|
2470
2475
|
},
|
|
2471
2476
|
children: [
|
|
2472
|
-
/* @__PURE__ */
|
|
2477
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "flex-start", gap: 10 }, children: [
|
|
2473
2478
|
e.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0, width: 36, height: 36, borderRadius: 8, background: "#f5f5f5", display: "flex", alignItems: "center", justifyContent: "center" }, children: e.icon }),
|
|
2474
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2475
2480
|
/* @__PURE__ */ f("div", { style: { fontWeight: 600, fontSize: 14, color: "#212121", marginBottom: 2 }, children: e.label }),
|
|
2476
2481
|
e.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", lineHeight: 1.4, display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden" }, children: e.description })
|
|
2477
2482
|
] })
|
|
2478
2483
|
] }),
|
|
2479
|
-
/* @__PURE__ */
|
|
2484
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 4 }, children: [
|
|
2480
2485
|
r && /* @__PURE__ */ f("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: r.bg, color: r.color }, children: r.label }),
|
|
2481
2486
|
(i = e.tags) == null ? void 0 : i.map((s) => /* @__PURE__ */ f("span", { style: { fontSize: 10, padding: "2px 7px", borderRadius: 10, background: "#f5f5f5", color: "#616161" }, children: s }, s)),
|
|
2482
|
-
n > 0 && /* @__PURE__ */
|
|
2487
|
+
n > 0 && /* @__PURE__ */ w("span", { style: { fontSize: 10, color: "#9e9e9e", marginLeft: "auto" }, children: [
|
|
2483
2488
|
n,
|
|
2484
2489
|
" step",
|
|
2485
2490
|
n !== 1 ? "s" : ""
|
|
2486
2491
|
] })
|
|
2487
2492
|
] }),
|
|
2488
|
-
e.author && /* @__PURE__ */
|
|
2493
|
+
e.author && /* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#bdbdbd" }, children: [
|
|
2489
2494
|
"by ",
|
|
2490
2495
|
e.author
|
|
2491
2496
|
] })
|
|
@@ -2499,31 +2504,31 @@ const ls = ({
|
|
|
2499
2504
|
onStartFromScratch: r
|
|
2500
2505
|
}) => {
|
|
2501
2506
|
const [n, o] = j(""), [i, s] = j(We), l = W(() => {
|
|
2502
|
-
const
|
|
2507
|
+
const a = /* @__PURE__ */ new Set();
|
|
2503
2508
|
return e.forEach((c) => {
|
|
2504
|
-
c.category &&
|
|
2505
|
-
}), [We, ...Array.from(
|
|
2506
|
-
}, [e]),
|
|
2507
|
-
let
|
|
2508
|
-
if (i !== We && (
|
|
2509
|
+
c.category && a.add(c.category);
|
|
2510
|
+
}), [We, ...Array.from(a)];
|
|
2511
|
+
}, [e]), d = W(() => {
|
|
2512
|
+
let a = e;
|
|
2513
|
+
if (i !== We && (a = a.filter((c) => c.category === i)), n.trim()) {
|
|
2509
2514
|
const c = n.toLowerCase();
|
|
2510
|
-
|
|
2515
|
+
a = a.filter(
|
|
2511
2516
|
(u) => {
|
|
2512
2517
|
var h, g;
|
|
2513
2518
|
return u.label.toLowerCase().includes(c) || ((h = u.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = u.tags) == null ? void 0 : g.some((b) => b.toLowerCase().includes(c)));
|
|
2514
2519
|
}
|
|
2515
2520
|
);
|
|
2516
2521
|
}
|
|
2517
|
-
return [...
|
|
2522
|
+
return [...a].sort((c, u) => (u.popularity ?? 0) - (c.popularity ?? 0));
|
|
2518
2523
|
}, [e, i, n]);
|
|
2519
|
-
return /* @__PURE__ */
|
|
2520
|
-
/* @__PURE__ */
|
|
2521
|
-
/* @__PURE__ */
|
|
2522
|
-
/* @__PURE__ */
|
|
2524
|
+
return /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", height: "100%", fontFamily: "inherit" }, children: [
|
|
2525
|
+
/* @__PURE__ */ w("div", { style: { padding: "24px 24px 0", borderBottom: "1px solid #f0f0f0", paddingBottom: 16 }, children: [
|
|
2526
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 16 }, children: [
|
|
2527
|
+
/* @__PURE__ */ w("div", { children: [
|
|
2523
2528
|
/* @__PURE__ */ f("h2", { style: { margin: 0, fontSize: 20, fontWeight: 700, color: "#212121" }, children: "Workflow Templates" }),
|
|
2524
2529
|
/* @__PURE__ */ f("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#757575" }, children: "Choose a pre-built template or start from scratch" })
|
|
2525
2530
|
] }),
|
|
2526
|
-
r && /* @__PURE__ */
|
|
2531
|
+
r && /* @__PURE__ */ w(
|
|
2527
2532
|
"button",
|
|
2528
2533
|
{
|
|
2529
2534
|
onClick: r,
|
|
@@ -2535,54 +2540,54 @@ const ls = ({
|
|
|
2535
2540
|
}
|
|
2536
2541
|
)
|
|
2537
2542
|
] }),
|
|
2538
|
-
/* @__PURE__ */
|
|
2543
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, background: "#f5f5f5", borderRadius: 8, padding: "8px 12px", marginBottom: 12 }, children: [
|
|
2539
2544
|
/* @__PURE__ */ f(Hr, { size: 18, color: "#9e9e9e" }),
|
|
2540
2545
|
/* @__PURE__ */ f(
|
|
2541
2546
|
"input",
|
|
2542
2547
|
{
|
|
2543
2548
|
value: n,
|
|
2544
|
-
onChange: (
|
|
2549
|
+
onChange: (a) => o(a.target.value),
|
|
2545
2550
|
placeholder: "Search templates...",
|
|
2546
2551
|
style: { border: "none", background: "transparent", outline: "none", fontSize: 14, color: "#212121", flex: 1 }
|
|
2547
2552
|
}
|
|
2548
2553
|
)
|
|
2549
2554
|
] }),
|
|
2550
|
-
l.length > 1 && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: l.map((
|
|
2555
|
+
l.length > 1 && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: l.map((a) => /* @__PURE__ */ f(
|
|
2551
2556
|
"button",
|
|
2552
2557
|
{
|
|
2553
|
-
onClick: () => s(
|
|
2558
|
+
onClick: () => s(a),
|
|
2554
2559
|
style: {
|
|
2555
2560
|
padding: "4px 12px",
|
|
2556
2561
|
borderRadius: 20,
|
|
2557
2562
|
border: "1.5px solid",
|
|
2558
|
-
borderColor: i ===
|
|
2559
|
-
background: i ===
|
|
2560
|
-
color: i ===
|
|
2563
|
+
borderColor: i === a ? "#1976d2" : "#e0e0e0",
|
|
2564
|
+
background: i === a ? "#e3f2fd" : "#fff",
|
|
2565
|
+
color: i === a ? "#1565c0" : "#616161",
|
|
2561
2566
|
fontSize: 12,
|
|
2562
|
-
fontWeight: i ===
|
|
2567
|
+
fontWeight: i === a ? 600 : 400,
|
|
2563
2568
|
cursor: "pointer"
|
|
2564
2569
|
},
|
|
2565
|
-
children:
|
|
2570
|
+
children: a
|
|
2566
2571
|
},
|
|
2567
|
-
|
|
2572
|
+
a
|
|
2568
2573
|
)) })
|
|
2569
2574
|
] }),
|
|
2570
|
-
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children:
|
|
2575
|
+
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: d.length === 0 ? /* @__PURE__ */ w("div", { style: { textAlign: "center", padding: "40px 0", color: "#9e9e9e" }, children: [
|
|
2571
2576
|
/* @__PURE__ */ f(qr, { size: 36, style: { marginBottom: 8 } }),
|
|
2572
2577
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
|
|
2573
|
-
] }) : /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children:
|
|
2578
|
+
] }) : /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: d.map((a) => /* @__PURE__ */ f(Ki, { template: a, onSelect: () => t(a) }, a.triggerKey)) }) })
|
|
2574
2579
|
] });
|
|
2575
2580
|
}, ke = {
|
|
2576
|
-
running: { label: "Running", color:
|
|
2577
|
-
success: { label: "Success", color:
|
|
2578
|
-
failed: { label: "Failed", color:
|
|
2579
|
-
cancelled: { label: "Cancelled", color:
|
|
2581
|
+
running: { label: "Running", color: J.running, icon: P.createElement(Gt, { size: 14 }) },
|
|
2582
|
+
success: { label: "Success", color: J.success, icon: P.createElement(Wt, { size: 14 }) },
|
|
2583
|
+
failed: { label: "Failed", color: J.failed, icon: P.createElement(Bt, { size: 14 }) },
|
|
2584
|
+
cancelled: { label: "Cancelled", color: J.cancelled, icon: P.createElement(Pt, { size: 14 }) }
|
|
2580
2585
|
}, Ui = {
|
|
2581
|
-
pending: { color:
|
|
2582
|
-
running: { color:
|
|
2583
|
-
success: { color:
|
|
2584
|
-
failed: { color:
|
|
2585
|
-
skipped: { color:
|
|
2586
|
+
pending: { color: J.pending, icon: P.createElement(Xr, { size: 14 }) },
|
|
2587
|
+
running: { color: J.running, icon: P.createElement(Gt, { size: 14 }) },
|
|
2588
|
+
success: { color: J.success, icon: P.createElement(Wt, { size: 14 }) },
|
|
2589
|
+
failed: { color: J.failed, icon: P.createElement(Bt, { size: 14 }) },
|
|
2590
|
+
skipped: { color: J.skipped, icon: P.createElement(Pt, { size: 14 }) }
|
|
2586
2591
|
};
|
|
2587
2592
|
function Ue(e) {
|
|
2588
2593
|
try {
|
|
@@ -2601,8 +2606,8 @@ function pr(e, t) {
|
|
|
2601
2606
|
}
|
|
2602
2607
|
function Vi({ step: e }) {
|
|
2603
2608
|
const [t, r] = j(!1), n = Ui[e.status], o = !!(e.inputs || e.outputs || e.error);
|
|
2604
|
-
return /* @__PURE__ */
|
|
2605
|
-
/* @__PURE__ */
|
|
2609
|
+
return /* @__PURE__ */ w("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
|
|
2610
|
+
/* @__PURE__ */ w(
|
|
2606
2611
|
"div",
|
|
2607
2612
|
{
|
|
2608
2613
|
style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 12px", cursor: o ? "pointer" : "default" },
|
|
@@ -2623,13 +2628,13 @@ function Vi({ step: e }) {
|
|
|
2623
2628
|
]
|
|
2624
2629
|
}
|
|
2625
2630
|
),
|
|
2626
|
-
t && o && /* @__PURE__ */
|
|
2631
|
+
t && o && /* @__PURE__ */ w("div", { style: { padding: "0 12px 10px 32px", fontSize: 12 }, children: [
|
|
2627
2632
|
e.error && /* @__PURE__ */ f("div", { style: { padding: "6px 10px", borderRadius: 6, background: "#ffebee", color: "#c62828", marginBottom: 6 }, children: e.error }),
|
|
2628
|
-
e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */
|
|
2633
|
+
e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */ w("details", { style: { marginBottom: 4 }, children: [
|
|
2629
2634
|
/* @__PURE__ */ f("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Inputs" }),
|
|
2630
2635
|
/* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.inputs, null, 2) })
|
|
2631
2636
|
] }),
|
|
2632
|
-
e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */
|
|
2637
|
+
e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */ w("details", { children: [
|
|
2633
2638
|
/* @__PURE__ */ f("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Outputs" }),
|
|
2634
2639
|
/* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.outputs, null, 2) })
|
|
2635
2640
|
] })
|
|
@@ -2638,7 +2643,7 @@ function Vi({ step: e }) {
|
|
|
2638
2643
|
}
|
|
2639
2644
|
function Hi({ record: e, selected: t, onSelect: r }) {
|
|
2640
2645
|
const n = ke[e.status];
|
|
2641
|
-
return /* @__PURE__ */
|
|
2646
|
+
return /* @__PURE__ */ w(
|
|
2642
2647
|
"div",
|
|
2643
2648
|
{
|
|
2644
2649
|
role: "button",
|
|
@@ -2659,9 +2664,9 @@ function Hi({ record: e, selected: t, onSelect: r }) {
|
|
|
2659
2664
|
},
|
|
2660
2665
|
children: [
|
|
2661
2666
|
/* @__PURE__ */ f("span", { style: { color: n.color, flexShrink: 0 }, children: P.cloneElement(n.icon, { color: n.color, size: 16 }) }),
|
|
2662
|
-
/* @__PURE__ */
|
|
2667
|
+
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2663
2668
|
/* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: Ue(e.triggeredAt) }),
|
|
2664
|
-
/* @__PURE__ */
|
|
2669
|
+
/* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
|
|
2665
2670
|
e.triggeredBy ? `by ${e.triggeredBy}` : "System",
|
|
2666
2671
|
" · ",
|
|
2667
2672
|
e.steps.length,
|
|
@@ -2675,37 +2680,37 @@ function Hi({ record: e, selected: t, onSelect: r }) {
|
|
|
2675
2680
|
}
|
|
2676
2681
|
);
|
|
2677
2682
|
}
|
|
2678
|
-
const
|
|
2683
|
+
const as = ({ records: e, onViewOnCanvas: t }) => {
|
|
2679
2684
|
var s;
|
|
2680
|
-
const [r, n] = j(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === r) ?? null, i = [...e].sort((l,
|
|
2681
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
2685
|
+
const [r, n] = j(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === r) ?? null, i = [...e].sort((l, d) => new Date(d.triggeredAt).getTime() - new Date(l.triggeredAt).getTime());
|
|
2686
|
+
return e.length === 0 ? /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
|
|
2682
2687
|
/* @__PURE__ */ f(mt, { size: 36 }),
|
|
2683
2688
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
|
|
2684
2689
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 12 }, children: "Run history will appear here" })
|
|
2685
|
-
] }) : /* @__PURE__ */
|
|
2686
|
-
/* @__PURE__ */
|
|
2687
|
-
/* @__PURE__ */
|
|
2690
|
+
] }) : /* @__PURE__ */ w("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
|
|
2691
|
+
/* @__PURE__ */ w("div", { style: { width: 260, flexShrink: 0, borderRight: "1px solid #e0e0e0", overflowY: "auto", background: "#fafafa" }, children: [
|
|
2692
|
+
/* @__PURE__ */ w("div", { style: { padding: "12px 14px", borderBottom: "1px solid #e0e0e0", fontWeight: 600, fontSize: 13, color: "#212121" }, children: [
|
|
2688
2693
|
"Run History (",
|
|
2689
2694
|
e.length,
|
|
2690
2695
|
")"
|
|
2691
2696
|
] }),
|
|
2692
2697
|
i.map((l) => /* @__PURE__ */ f(Hi, { record: l, selected: l.id === r, onSelect: () => n(l.id) }, l.id))
|
|
2693
2698
|
] }),
|
|
2694
|
-
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */
|
|
2695
|
-
/* @__PURE__ */
|
|
2696
|
-
/* @__PURE__ */
|
|
2697
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */ w("div", { children: [
|
|
2700
|
+
/* @__PURE__ */ w("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
|
|
2701
|
+
/* @__PURE__ */ w("div", { children: [
|
|
2702
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
2698
2703
|
P.cloneElement(ke[o.status].icon, { color: ke[o.status].color, size: 18 }),
|
|
2699
2704
|
/* @__PURE__ */ f("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children: ke[o.status].label })
|
|
2700
2705
|
] }),
|
|
2701
|
-
/* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
2706
|
+
/* @__PURE__ */ w("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
2707
|
+
/* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
2703
2708
|
/* @__PURE__ */ f(mt, { size: 13 }),
|
|
2704
2709
|
" ",
|
|
2705
2710
|
Ue(o.triggeredAt),
|
|
2706
2711
|
o.completedAt && ` → ${Ue(o.completedAt)} (${pr(o.triggeredAt, o.completedAt)})`
|
|
2707
2712
|
] }),
|
|
2708
|
-
o.triggeredBy && /* @__PURE__ */
|
|
2713
|
+
o.triggeredBy && /* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
2709
2714
|
/* @__PURE__ */ f(Jr, { size: 13 }),
|
|
2710
2715
|
" ",
|
|
2711
2716
|
o.triggeredBy
|
|
@@ -2722,21 +2727,21 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2722
2727
|
)
|
|
2723
2728
|
] }),
|
|
2724
2729
|
o.error && /* @__PURE__ */ f("div", { style: { margin: "12px 16px", padding: "10px 14px", borderRadius: 6, background: "#ffebee", color: "#c62828", fontSize: 13 }, children: o.error }),
|
|
2725
|
-
/* @__PURE__ */
|
|
2726
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ w("div", { children: [
|
|
2731
|
+
/* @__PURE__ */ w("div", { style: { padding: "10px 12px", fontSize: 12, fontWeight: 600, color: "#757575", borderBottom: "1px solid #f0f0f0" }, children: [
|
|
2727
2732
|
"STEPS (",
|
|
2728
2733
|
o.steps.length,
|
|
2729
2734
|
")"
|
|
2730
2735
|
] }),
|
|
2731
|
-
o.steps.map((l,
|
|
2736
|
+
o.steps.map((l, d) => /* @__PURE__ */ f(Vi, { step: l }, `${l.nodeId}-${d}`))
|
|
2732
2737
|
] }),
|
|
2733
|
-
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ f("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */
|
|
2738
|
+
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ f("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */ w("details", { children: [
|
|
2734
2739
|
/* @__PURE__ */ f("summary", { style: { cursor: "pointer", fontSize: 12, fontWeight: 600, color: "#757575", marginBottom: 6 }, children: "TRIGGER INPUTS" }),
|
|
2735
2740
|
/* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 10, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(o.inputs, null, 2) })
|
|
2736
2741
|
] }) })
|
|
2737
2742
|
] }) : /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%", color: "#9e9e9e", fontSize: 14 }, children: "Select a run to see details" }) })
|
|
2738
2743
|
] });
|
|
2739
|
-
},
|
|
2744
|
+
}, ds = {
|
|
2740
2745
|
slots: [
|
|
2741
2746
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2742
2747
|
{ id: "trigger-END_USER_CREATION", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "New User Registration", nodeData: { label: "New User Registration" } },
|
|
@@ -2790,10 +2795,10 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2790
2795
|
export {
|
|
2791
2796
|
Dt as F,
|
|
2792
2797
|
Li as S,
|
|
2793
|
-
|
|
2798
|
+
as as W,
|
|
2794
2799
|
ls as a,
|
|
2795
2800
|
cs as b,
|
|
2796
2801
|
us as o,
|
|
2797
|
-
|
|
2802
|
+
ds as u,
|
|
2798
2803
|
fs as w
|
|
2799
2804
|
};
|