@notmrabhi/flowforge 0.1.106 → 0.1.108
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-BsPsPmnx.js → GatewayBranchEdge-C023FhhW.js} +653 -637
- package/dist/GatewayBranchEdge-C023FhhW.js.map +1 -0
- package/dist/GatewayBranchEdge-CdoZtIhn.js +2 -0
- package/dist/GatewayBranchEdge-CdoZtIhn.js.map +1 -0
- package/dist/{WorkflowExecutionHistory-DYp-l7mk.js → WorkflowExecutionHistory-BBeVPYVc.js} +728 -695
- package/dist/WorkflowExecutionHistory-BBeVPYVc.js.map +1 -0
- package/dist/WorkflowExecutionHistory-BrkL37Wb.js +2 -0
- package/dist/WorkflowExecutionHistory-BrkL37Wb.js.map +1 -0
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.d.ts +22 -0
- package/dist/canvas.js +2 -2
- package/dist/core.d.ts +10 -0
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.d.ts +2 -0
- package/dist/defaultUi.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +2 -2
- package/dist/nodeRegistry.d.ts +10 -0
- package/dist/templateRegistry.d.ts +2 -0
- package/package.json +1 -1
- package/dist/GatewayBranchEdge-BsPsPmnx.js.map +0 -1
- package/dist/GatewayBranchEdge-hUano0YJ.js +0 -2
- package/dist/GatewayBranchEdge-hUano0YJ.js.map +0 -1
- package/dist/WorkflowExecutionHistory-CsBnVxC5.js +0 -2
- package/dist/WorkflowExecutionHistory-CsBnVxC5.js.map +0 -1
- package/dist/WorkflowExecutionHistory-DYp-l7mk.js.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsxs as w, jsx as u, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as w, jsx as u, Fragment as _e } from "react/jsx-runtime";
|
|
2
|
+
import G, { useRef as Tt, useEffect as se, useState as L, useCallback as H, useMemo as U } from "react";
|
|
3
3
|
import Wn, { useStore as $n, useReactFlow as Gn, Background as Yn, Controls as Kn, MiniMap as Hn } from "reactflow";
|
|
4
4
|
import "reactflow/dist/style.css";
|
|
5
|
-
import { e as Un, G as Vn, E as
|
|
6
|
-
import { Dialog as er, Box as
|
|
5
|
+
import { e as Un, G as Vn, E as qn, P as Xn, L as Jn, d as Zn, h as Qn } from "./GatewayBranchEdge-C023FhhW.js";
|
|
6
|
+
import { Dialog as er, Box as ne, Drawer as tr, IconButton as It, Button as ze, CircularProgress as nr } from "@mui/material";
|
|
7
7
|
import rr from "react-select";
|
|
8
|
-
import { MdClose as or, MdCalendarToday as ir, MdBolt as sr, MdArrowBack as
|
|
8
|
+
import { MdClose as or, MdCalendarToday as ir, MdBolt as sr, MdArrowBack as Jt, MdChevronRight as Zt, MdAddCircleOutline as lr, MdApps as ar, MdErrorOutline as dr, MdAccountTree as cr, MdAdd as fr, MdSearch as ur, MdCategory as hr, MdCancel as Qt, MdError as en, MdCheckCircle as tn, MdPlayArrow as nn, MdHourglassEmpty as gr, MdSchedule as Ot, MdPerson as pr, MdExpandLess as yr, MdExpandMore as br } from "react-icons/md";
|
|
9
9
|
import { GrTrigger as mr } from "react-icons/gr";
|
|
10
10
|
import { BiCollapse as vr, BiExpand as wr } from "react-icons/bi";
|
|
11
11
|
import { k as Er, c as xr, O as kr } from "./index-C6t1hp3u.js";
|
|
12
12
|
import { m as _r } from "./messages-CRZgWFU-.js";
|
|
13
13
|
import { createTheme as Sr, ThemeProvider as Nr } from "@mui/material/styles";
|
|
14
|
-
import { T as Cr, E as
|
|
15
|
-
var
|
|
16
|
-
for (var n in t)
|
|
17
|
-
}, Or = (e, t, n) => Tr(e, t + "", n),
|
|
18
|
-
Ir(
|
|
19
|
-
var Mr = Object.defineProperty,
|
|
14
|
+
import { T as Cr, E as re } from "./canvasTokens-CAD6G24b.js";
|
|
15
|
+
var rn = Object.defineProperty, Tr = (e, t, n) => t in e ? rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ir = (e, t) => {
|
|
16
|
+
for (var n in t) rn(e, n, { get: t[n], enumerable: !0 });
|
|
17
|
+
}, Or = (e, t, n) => Tr(e, t + "", n), on = {};
|
|
18
|
+
Ir(on, { Graph: () => q, alg: () => ot, json: () => ln, version: () => zr });
|
|
19
|
+
var Mr = Object.defineProperty, sn = (e, t) => {
|
|
20
20
|
for (var n in t) Mr(e, n, { get: t[n], enumerable: !0 });
|
|
21
|
-
},
|
|
21
|
+
}, q = class {
|
|
22
22
|
constructor(e) {
|
|
23
23
|
this._isDirected = !0, this._isMultigraph = !1, this._isCompound = !1, this._nodes = {}, this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {}, this._nodeCount = 0, this._edgeCount = 0, this._defaultNodeLabelFn = () => {
|
|
24
24
|
}, this._defaultEdgeLabelFn = () => {
|
|
@@ -151,15 +151,15 @@ var Mr = Object.defineProperty, tn = (e, t) => {
|
|
|
151
151
|
setEdge(e, t, n, r) {
|
|
152
152
|
let o, i, s, l, d = !1;
|
|
153
153
|
typeof e == "object" && e !== null && "v" in e ? (o = e.v, i = e.w, s = e.name, arguments.length === 2 && (l = t, d = !0)) : (o = e, i = t, s = r, arguments.length > 2 && (l = n, d = !0)), o = "" + o, i = "" + i, s !== void 0 && (s = "" + s);
|
|
154
|
-
let a =
|
|
154
|
+
let a = ke(this._isDirected, o, i, s);
|
|
155
155
|
if (a in this._edgeLabels) return d && (this._edgeLabels[a] = l), this;
|
|
156
156
|
if (s !== void 0 && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
157
157
|
this.setNode(o), this.setNode(i), this._edgeLabels[a] = d ? l : this._defaultEdgeLabelFn(o, i, s);
|
|
158
158
|
let c = jr(this._isDirected, o, i, s);
|
|
159
|
-
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c,
|
|
159
|
+
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c, Mt(this._preds[i], o), Mt(this._sucs[o], i), this._in[i][a] = c, this._out[o][a] = c, this._edgeCount++, this;
|
|
160
160
|
}
|
|
161
161
|
edge(e, t, n) {
|
|
162
|
-
let r = arguments.length === 1 ?
|
|
162
|
+
let r = arguments.length === 1 ? Ye(this._isDirected, e) : ke(this._isDirected, e, t, n);
|
|
163
163
|
return this._edgeLabels[r];
|
|
164
164
|
}
|
|
165
165
|
edgeAsObj(e, t, n) {
|
|
@@ -167,13 +167,13 @@ var Mr = Object.defineProperty, tn = (e, t) => {
|
|
|
167
167
|
return typeof r != "object" ? { label: r } : r;
|
|
168
168
|
}
|
|
169
169
|
hasEdge(e, t, n) {
|
|
170
|
-
return (arguments.length === 1 ?
|
|
170
|
+
return (arguments.length === 1 ? Ye(this._isDirected, e) : ke(this._isDirected, e, t, n)) in this._edgeLabels;
|
|
171
171
|
}
|
|
172
172
|
removeEdge(e, t, n) {
|
|
173
|
-
let r = arguments.length === 1 ?
|
|
173
|
+
let r = arguments.length === 1 ? Ye(this._isDirected, e) : ke(this._isDirected, e, t, n), o = this._edgeObjs[r];
|
|
174
174
|
if (o) {
|
|
175
175
|
let i = o.v, s = o.w;
|
|
176
|
-
delete this._edgeLabels[r], delete this._edgeObjs[r],
|
|
176
|
+
delete this._edgeLabels[r], delete this._edgeObjs[r], jt(this._preds[s], i), jt(this._sucs[i], s), delete this._in[s][r], delete this._out[i][r], this._edgeCount--;
|
|
177
177
|
}
|
|
178
178
|
return this;
|
|
179
179
|
}
|
|
@@ -195,13 +195,13 @@ var Mr = Object.defineProperty, tn = (e, t) => {
|
|
|
195
195
|
return n ? r.filter((o) => o.v === t && o.w === n || o.v === n && o.w === t) : r;
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
|
-
function
|
|
198
|
+
function Mt(e, t) {
|
|
199
199
|
e[t] ? e[t]++ : e[t] = 1;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function jt(e, t) {
|
|
202
202
|
e[t] !== void 0 && !--e[t] && delete e[t];
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function ke(e, t, n, r) {
|
|
205
205
|
let o = "" + t, i = "" + n;
|
|
206
206
|
if (!e && o > i) {
|
|
207
207
|
let s = o;
|
|
@@ -218,11 +218,11 @@ function jr(e, t, n, r) {
|
|
|
218
218
|
let s = { v: o, w: i };
|
|
219
219
|
return r && (s.name = r), s;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
return
|
|
221
|
+
function Ye(e, t) {
|
|
222
|
+
return ke(e, t.v, t.w, t.name);
|
|
223
223
|
}
|
|
224
|
-
var zr = "4.0.1",
|
|
225
|
-
|
|
224
|
+
var zr = "4.0.1", ln = {};
|
|
225
|
+
sn(ln, { read: () => Rr, write: () => Lr });
|
|
226
226
|
function Lr(e) {
|
|
227
227
|
let t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes: Pr(e), edges: Fr(e) }, n = e.graph();
|
|
228
228
|
return n !== void 0 && (t.value = structuredClone(n)), t;
|
|
@@ -240,17 +240,17 @@ function Fr(e) {
|
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
function Rr(e) {
|
|
243
|
-
let t = new
|
|
243
|
+
let t = new q(e.options);
|
|
244
244
|
return e.value !== void 0 && t.setGraph(e.value), e.nodes.forEach((n) => {
|
|
245
245
|
t.setNode(n.v, n.value), n.parent && t.setParent(n.v, n.parent);
|
|
246
246
|
}), e.edges.forEach((n) => {
|
|
247
247
|
t.setEdge({ v: n.v, w: n.w, name: n.name }, n.value);
|
|
248
248
|
}), t;
|
|
249
249
|
}
|
|
250
|
-
var
|
|
251
|
-
|
|
250
|
+
var ot = {};
|
|
251
|
+
sn(ot, { CycleException: () => Pe, bellmanFord: () => an, components: () => Dr, dijkstra: () => Le, dijkstraAll: () => Gr, findCycles: () => Yr, floydWarshall: () => Hr, isAcyclic: () => Vr, postorder: () => Xr, preorder: () => Jr, prim: () => Zr, shortestPaths: () => Qr, tarjan: () => cn, topsort: () => fn });
|
|
252
252
|
var Ar = () => 1;
|
|
253
|
-
function
|
|
253
|
+
function an(e, t, n, r) {
|
|
254
254
|
return Br(e, String(t), n || Ar, r || function(o) {
|
|
255
255
|
return e.outEdges(o);
|
|
256
256
|
});
|
|
@@ -262,8 +262,8 @@ function Br(e, t, n, r) {
|
|
|
262
262
|
}, a = function() {
|
|
263
263
|
l.forEach(function(f) {
|
|
264
264
|
r(f).forEach(function(h) {
|
|
265
|
-
let g = h.v === f ? h.v : h.w,
|
|
266
|
-
d({ v: g, w:
|
|
265
|
+
let g = h.v === f ? h.v : h.w, E = g === h.v ? h.w : h.v;
|
|
266
|
+
d({ v: g, w: E });
|
|
267
267
|
});
|
|
268
268
|
});
|
|
269
269
|
};
|
|
@@ -285,7 +285,7 @@ function Dr(e) {
|
|
|
285
285
|
r = [], o(i), r.length && n.push(r);
|
|
286
286
|
}), n;
|
|
287
287
|
}
|
|
288
|
-
var
|
|
288
|
+
var dn = class {
|
|
289
289
|
constructor() {
|
|
290
290
|
this._arr = [], this._keyIndices = {};
|
|
291
291
|
}
|
|
@@ -339,14 +339,14 @@ var on = class {
|
|
|
339
339
|
n[e] = i, n[t] = o, r[i.key] = e, r[o.key] = t;
|
|
340
340
|
}
|
|
341
341
|
}, Wr = () => 1;
|
|
342
|
-
function
|
|
342
|
+
function Le(e, t, n, r) {
|
|
343
343
|
let o = function(i) {
|
|
344
344
|
return e.outEdges(i);
|
|
345
345
|
};
|
|
346
346
|
return $r(e, String(t), n || Wr, r || o);
|
|
347
347
|
}
|
|
348
348
|
function $r(e, t, n, r) {
|
|
349
|
-
let o = {}, i = new
|
|
349
|
+
let o = {}, i = new dn(), s, l, d = function(a) {
|
|
350
350
|
let c = a.v !== s ? a.v : a.w, f = o[c], h = n(a), g = l.distance + h;
|
|
351
351
|
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + a + " Weight: " + h);
|
|
352
352
|
g < f.distance && (f.distance = g, f.predecessor = s, i.decrease(c, g));
|
|
@@ -359,10 +359,10 @@ function $r(e, t, n, r) {
|
|
|
359
359
|
}
|
|
360
360
|
function Gr(e, t, n) {
|
|
361
361
|
return e.nodes().reduce(function(r, o) {
|
|
362
|
-
return r[o] =
|
|
362
|
+
return r[o] = Le(e, o, t, n), r;
|
|
363
363
|
}, {});
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function cn(e) {
|
|
366
366
|
let t = 0, n = [], r = {}, o = [];
|
|
367
367
|
function i(s) {
|
|
368
368
|
let l = r[s] = { onStack: !0, lowlink: t, index: t++ };
|
|
@@ -381,7 +381,7 @@ function sn(e) {
|
|
|
381
381
|
}), o;
|
|
382
382
|
}
|
|
383
383
|
function Yr(e) {
|
|
384
|
-
return
|
|
384
|
+
return cn(e).filter(function(t) {
|
|
385
385
|
return t.length > 1 || t.length === 1 && e.hasEdge(t[0], t[0]);
|
|
386
386
|
});
|
|
387
387
|
}
|
|
@@ -411,30 +411,30 @@ function Ur(e, t, n) {
|
|
|
411
411
|
});
|
|
412
412
|
}), r;
|
|
413
413
|
}
|
|
414
|
-
var
|
|
414
|
+
var Pe = class extends Error {
|
|
415
415
|
constructor(...e) {
|
|
416
416
|
super(...e);
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
|
-
function
|
|
419
|
+
function fn(e) {
|
|
420
420
|
let t = {}, n = {}, r = [];
|
|
421
421
|
function o(i) {
|
|
422
|
-
if (i in n) throw new
|
|
422
|
+
if (i in n) throw new Pe();
|
|
423
423
|
i in t || (n[i] = !0, t[i] = !0, e.predecessors(i).forEach(o), delete n[i], r.push(i));
|
|
424
424
|
}
|
|
425
|
-
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new
|
|
425
|
+
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new Pe();
|
|
426
426
|
return r;
|
|
427
427
|
}
|
|
428
428
|
function Vr(e) {
|
|
429
429
|
try {
|
|
430
|
-
|
|
430
|
+
fn(e);
|
|
431
431
|
} catch (t) {
|
|
432
|
-
if (t instanceof
|
|
432
|
+
if (t instanceof Pe) return !1;
|
|
433
433
|
throw t;
|
|
434
434
|
}
|
|
435
435
|
return !0;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function qr(e, t, n, r, o) {
|
|
438
438
|
Array.isArray(t) || (t = [t]);
|
|
439
439
|
let i = (l) => {
|
|
440
440
|
var d;
|
|
@@ -442,27 +442,27 @@ function Xr(e, t, n, r, o) {
|
|
|
442
442
|
}, s = {};
|
|
443
443
|
return t.forEach(function(l) {
|
|
444
444
|
if (!e.hasNode(l)) throw new Error("Graph does not have node: " + l);
|
|
445
|
-
o =
|
|
445
|
+
o = un(e, l, n === "post", s, i, r, o);
|
|
446
446
|
}), o;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function un(e, t, n, r, o, i, s) {
|
|
449
449
|
return t in r || (r[t] = !0, n || (s = i(s, t)), o(t).forEach(function(l) {
|
|
450
|
-
s =
|
|
450
|
+
s = un(e, l, n, r, o, i, s);
|
|
451
451
|
}), n && (s = i(s, t))), s;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
454
|
-
return
|
|
453
|
+
function hn(e, t, n) {
|
|
454
|
+
return qr(e, t, n, function(r, o) {
|
|
455
455
|
return r.push(o), r;
|
|
456
456
|
}, []);
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
return
|
|
458
|
+
function Xr(e, t) {
|
|
459
|
+
return hn(e, t, "post");
|
|
460
460
|
}
|
|
461
461
|
function Jr(e, t) {
|
|
462
|
-
return
|
|
462
|
+
return hn(e, t, "pre");
|
|
463
463
|
}
|
|
464
464
|
function Zr(e, t) {
|
|
465
|
-
let n = new
|
|
465
|
+
let n = new q(), r = {}, o = new dn(), i;
|
|
466
466
|
function s(d) {
|
|
467
467
|
let a = d.v === i ? d.w : d.v, c = o.priority(a);
|
|
468
468
|
if (c !== void 0) {
|
|
@@ -492,7 +492,7 @@ function Qr(e, t, n, r) {
|
|
|
492
492
|
}));
|
|
493
493
|
}
|
|
494
494
|
function eo(e, t, n, r) {
|
|
495
|
-
if (n === void 0) return
|
|
495
|
+
if (n === void 0) return Le(e, t, n, r);
|
|
496
496
|
let o = !1, i = e.nodes();
|
|
497
497
|
for (let s = 0; s < i.length; s++) {
|
|
498
498
|
let l = r(i[s]);
|
|
@@ -500,38 +500,38 @@ function eo(e, t, n, r) {
|
|
|
500
500
|
let a = l[d], c = a.v === i[s] ? a.v : a.w, f = c === a.v ? a.w : a.v;
|
|
501
501
|
n({ v: c, w: f }) < 0 && (o = !0);
|
|
502
502
|
}
|
|
503
|
-
if (o) return
|
|
503
|
+
if (o) return an(e, t, n, r);
|
|
504
504
|
}
|
|
505
|
-
return
|
|
505
|
+
return Le(e, t, n, r);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function me(e, t, n, r) {
|
|
508
508
|
let o = r;
|
|
509
|
-
for (; e.hasNode(o); ) o =
|
|
509
|
+
for (; e.hasNode(o); ) o = it(r);
|
|
510
510
|
return n.dummy = t, e.setNode(o, n), o;
|
|
511
511
|
}
|
|
512
512
|
function to(e) {
|
|
513
|
-
let t = new
|
|
513
|
+
let t = new q().setGraph(e.graph());
|
|
514
514
|
return e.nodes().forEach((n) => t.setNode(n, e.node(n))), e.edges().forEach((n) => {
|
|
515
515
|
let r = t.edge(n.v, n.w) || { weight: 0, minlen: 1 }, o = e.edge(n);
|
|
516
516
|
t.setEdge(n.v, n.w, { weight: r.weight + o.weight, minlen: Math.max(r.minlen, o.minlen) });
|
|
517
517
|
}), t;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
let t = new
|
|
519
|
+
function gn(e) {
|
|
520
|
+
let t = new q({ multigraph: e.isMultigraph() }).setGraph(e.graph());
|
|
521
521
|
return e.nodes().forEach((n) => {
|
|
522
522
|
e.children(n).length || t.setNode(n, e.node(n));
|
|
523
523
|
}), e.edges().forEach((n) => {
|
|
524
524
|
t.setEdge(n, e.edge(n));
|
|
525
525
|
}), t;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function zt(e, t) {
|
|
528
528
|
let n = e.x, r = e.y, o = t.x - n, i = t.y - r, s = e.width / 2, l = e.height / 2;
|
|
529
529
|
if (!o && !i) throw new Error("Not possible to find intersection inside of the rectangle");
|
|
530
530
|
let d, a;
|
|
531
531
|
return Math.abs(i) * s > Math.abs(o) * l ? (i < 0 && (l = -l), d = l * o / i, a = l) : (o < 0 && (s = -s), d = s, a = s * i / o), { x: n + d, y: r + a };
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
let t =
|
|
533
|
+
function Te(e) {
|
|
534
|
+
let t = Se(yn(e) + 1).map(() => []);
|
|
535
535
|
return e.nodes().forEach((n) => {
|
|
536
536
|
let r = e.node(n), o = r.rank;
|
|
537
537
|
o !== void 0 && (t[o] || (t[o] = []), t[o][r.order] = n);
|
|
@@ -541,14 +541,14 @@ function no(e) {
|
|
|
541
541
|
let t = e.nodes().map((r) => {
|
|
542
542
|
let o = e.node(r).rank;
|
|
543
543
|
return o === void 0 ? Number.MAX_VALUE : o;
|
|
544
|
-
}), n =
|
|
544
|
+
}), n = Q(Math.min, t);
|
|
545
545
|
e.nodes().forEach((r) => {
|
|
546
546
|
let o = e.node(r);
|
|
547
547
|
Object.hasOwn(o, "rank") && (o.rank -= n);
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
function ro(e) {
|
|
551
|
-
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), n =
|
|
551
|
+
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), n = Q(Math.min, t), r = [];
|
|
552
552
|
e.nodes().forEach((s) => {
|
|
553
553
|
let l = e.node(s).rank - n;
|
|
554
554
|
r[l] || (r[l] = []), r[l].push(s);
|
|
@@ -558,11 +558,11 @@ function ro(e) {
|
|
|
558
558
|
s === void 0 && l % i !== 0 ? --o : s !== void 0 && o && s.forEach((d) => e.node(d).rank += o);
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Lt(e, t, n, r) {
|
|
562
562
|
let o = { width: 0, height: 0 };
|
|
563
|
-
return arguments.length >= 4 && (o.rank = n, o.order = r),
|
|
563
|
+
return arguments.length >= 4 && (o.rank = n, o.order = r), me(e, "border", o, t);
|
|
564
564
|
}
|
|
565
|
-
function oo(e, t =
|
|
565
|
+
function oo(e, t = pn) {
|
|
566
566
|
let n = [];
|
|
567
567
|
for (let r = 0; r < e.length; r += t) {
|
|
568
568
|
let o = e.slice(r, r + t);
|
|
@@ -570,19 +570,19 @@ function oo(e, t = fn) {
|
|
|
570
570
|
}
|
|
571
571
|
return n;
|
|
572
572
|
}
|
|
573
|
-
var
|
|
574
|
-
function
|
|
575
|
-
if (t.length >
|
|
573
|
+
var pn = 65535;
|
|
574
|
+
function Q(e, t) {
|
|
575
|
+
if (t.length > pn) {
|
|
576
576
|
let n = oo(t);
|
|
577
577
|
return e(...n.map((r) => e(...r)));
|
|
578
578
|
} else return e(...t);
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function yn(e) {
|
|
581
581
|
let t = e.nodes().map((n) => {
|
|
582
582
|
let r = e.node(n).rank;
|
|
583
583
|
return r === void 0 ? Number.MIN_VALUE : r;
|
|
584
584
|
});
|
|
585
|
-
return
|
|
585
|
+
return Q(Math.max, t);
|
|
586
586
|
}
|
|
587
587
|
function io(e, t) {
|
|
588
588
|
let n = { lhs: [], rhs: [] };
|
|
@@ -590,7 +590,7 @@ function io(e, t) {
|
|
|
590
590
|
t(r) ? n.lhs.push(r) : n.rhs.push(r);
|
|
591
591
|
}), n;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function bn(e, t) {
|
|
594
594
|
let n = Date.now();
|
|
595
595
|
try {
|
|
596
596
|
return t();
|
|
@@ -598,15 +598,15 @@ function hn(e, t) {
|
|
|
598
598
|
console.log(e + " time: " + (Date.now() - n) + "ms");
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function mn(e, t) {
|
|
602
602
|
return t();
|
|
603
603
|
}
|
|
604
604
|
var so = 0;
|
|
605
|
-
function
|
|
605
|
+
function it(e) {
|
|
606
606
|
let t = ++so;
|
|
607
607
|
return e + ("" + t);
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function Se(e, t, n = 1) {
|
|
610
610
|
t == null && (t = e, e = 0);
|
|
611
611
|
let r = (i) => i < t;
|
|
612
612
|
n < 0 && (r = (i) => t < i);
|
|
@@ -614,19 +614,19 @@ function be(e, t, n = 1) {
|
|
|
614
614
|
for (let i = e; r(i); i += n) o.push(i);
|
|
615
615
|
return o;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function Fe(e, t) {
|
|
618
618
|
let n = {};
|
|
619
619
|
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
620
620
|
return n;
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function Re(e, t) {
|
|
623
623
|
let n;
|
|
624
624
|
return typeof t == "string" ? n = (r) => r[t] : n = t, Object.entries(e).reduce((r, [o, i]) => (r[o] = n(i, o), r), {});
|
|
625
625
|
}
|
|
626
626
|
function lo(e, t) {
|
|
627
627
|
return e.reduce((n, r, o) => (n[r] = t[o], n), {});
|
|
628
628
|
}
|
|
629
|
-
var
|
|
629
|
+
var Ae = "\0", ao = "3.0.0", co = class {
|
|
630
630
|
constructor() {
|
|
631
631
|
Or(this, "_sentinel");
|
|
632
632
|
let e = {};
|
|
@@ -634,11 +634,11 @@ var je = "\0", ao = "3.0.0", co = class {
|
|
|
634
634
|
}
|
|
635
635
|
dequeue() {
|
|
636
636
|
let e = this._sentinel, t = e._prev;
|
|
637
|
-
if (t !== e) return
|
|
637
|
+
if (t !== e) return Pt(t), t;
|
|
638
638
|
}
|
|
639
639
|
enqueue(e) {
|
|
640
640
|
let t = this._sentinel;
|
|
641
|
-
e._prev && e._next &&
|
|
641
|
+
e._prev && e._next && Pt(e), e._next = t._next, t._next._prev = e, t._next = e, e._prev = t;
|
|
642
642
|
}
|
|
643
643
|
toString() {
|
|
644
644
|
let e = [], t = this._sentinel, n = t._prev;
|
|
@@ -646,7 +646,7 @@ var je = "\0", ao = "3.0.0", co = class {
|
|
|
646
646
|
return "[" + e.join(", ") + "]";
|
|
647
647
|
}
|
|
648
648
|
};
|
|
649
|
-
function
|
|
649
|
+
function Pt(e) {
|
|
650
650
|
e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
|
|
651
651
|
}
|
|
652
652
|
function fo(e, t) {
|
|
@@ -662,29 +662,29 @@ function po(e, t, n) {
|
|
|
662
662
|
var r;
|
|
663
663
|
let o = [], i = t[t.length - 1], s = t[0], l;
|
|
664
664
|
for (; e.nodeCount(); ) {
|
|
665
|
-
for (; l = s.dequeue(); )
|
|
666
|
-
for (; l = i.dequeue(); )
|
|
665
|
+
for (; l = s.dequeue(); ) Ke(e, t, n, l);
|
|
666
|
+
for (; l = i.dequeue(); ) Ke(e, t, n, l);
|
|
667
667
|
if (e.nodeCount()) {
|
|
668
668
|
for (let d = t.length - 2; d > 0; --d) if (l = (r = t[d]) == null ? void 0 : r.dequeue(), l) {
|
|
669
|
-
o = o.concat(
|
|
669
|
+
o = o.concat(Ke(e, t, n, l, !0) || []);
|
|
670
670
|
break;
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
return o;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Ke(e, t, n, r, o) {
|
|
677
677
|
let i = [], s = o ? i : void 0;
|
|
678
678
|
return (e.inEdges(r.v) || []).forEach((l) => {
|
|
679
679
|
let d = e.edge(l), a = e.node(l.v);
|
|
680
|
-
o && i.push({ v: l.v, w: l.w }), a.out -= d,
|
|
680
|
+
o && i.push({ v: l.v, w: l.w }), a.out -= d, Qe(t, n, a);
|
|
681
681
|
}), (e.outEdges(r.v) || []).forEach((l) => {
|
|
682
682
|
let d = e.edge(l), a = l.w, c = e.node(a);
|
|
683
|
-
c.in -= d,
|
|
683
|
+
c.in -= d, Qe(t, n, c);
|
|
684
684
|
}), e.removeNode(r.v), s;
|
|
685
685
|
}
|
|
686
686
|
function yo(e, t) {
|
|
687
|
-
let n = new
|
|
687
|
+
let n = new q(), r = 0, o = 0;
|
|
688
688
|
e.nodes().forEach((l) => {
|
|
689
689
|
n.setNode(l, { v: l, in: 0, out: 0 });
|
|
690
690
|
}), e.edges().forEach((l) => {
|
|
@@ -695,10 +695,10 @@ function yo(e, t) {
|
|
|
695
695
|
});
|
|
696
696
|
let i = bo(o + r + 3).map(() => new uo()), s = r + 1;
|
|
697
697
|
return n.nodes().forEach((l) => {
|
|
698
|
-
|
|
698
|
+
Qe(i, s, n.node(l));
|
|
699
699
|
}), { graph: n, buckets: i, zeroIdx: s };
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function Qe(e, t, n) {
|
|
702
702
|
var r, o, i;
|
|
703
703
|
n.out ? n.in ? (i = e[n.out - n.in + t]) == null || i.enqueue(n) : (o = e[e.length - 1]) == null || o.enqueue(n) : (r = e[0]) == null || r.enqueue(n);
|
|
704
704
|
}
|
|
@@ -710,7 +710,7 @@ function bo(e) {
|
|
|
710
710
|
function mo(e) {
|
|
711
711
|
(e.graph().acyclicer === "greedy" ? go(e, t(e)) : vo(e)).forEach((n) => {
|
|
712
712
|
let r = e.edge(n);
|
|
713
|
-
e.removeEdge(n), r.forwardName = n.name, r.reversed = !0, e.setEdge(n.w, n.v, r,
|
|
713
|
+
e.removeEdge(n), r.forwardName = n.name, r.reversed = !0, e.setEdge(n.w, n.v, r, it("rev"));
|
|
714
714
|
});
|
|
715
715
|
function t(n) {
|
|
716
716
|
return (r) => n.edge(r).weight;
|
|
@@ -743,7 +743,7 @@ function xo(e, t) {
|
|
|
743
743
|
if (i === r + 1) return;
|
|
744
744
|
e.removeEdge(t);
|
|
745
745
|
let a, c, f;
|
|
746
|
-
for (f = 0, ++r; r < i; ++f, ++r) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: r }, a =
|
|
746
|
+
for (f = 0, ++r; r < i; ++f, ++r) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: r }, a = me(e, "edge", c, "_d"), r === d && (c.width = l.width, c.height = l.height, c.dummy = "edge-label", c.labelpos = l.labelpos), e.setEdge(n, a, { weight: l.weight }, s), f === 0 && e.graph().dummyChains.push(a), n = a;
|
|
747
747
|
e.setEdge(n, o, { weight: l.weight }, s);
|
|
748
748
|
}
|
|
749
749
|
function ko(e) {
|
|
@@ -752,28 +752,28 @@ function ko(e) {
|
|
|
752
752
|
for (e.setEdge(n.edgeObj, r); n.dummy; ) o = e.successors(t)[0], e.removeNode(t), r.points.push({ x: n.x, y: n.y }), n.dummy === "edge-label" && (r.x = n.x, r.y = n.y, r.width = n.width, r.height = n.height), t = o, n = e.node(t);
|
|
753
753
|
});
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function st(e) {
|
|
756
756
|
let t = {};
|
|
757
757
|
function n(r) {
|
|
758
758
|
let o = e.node(r);
|
|
759
759
|
if (Object.hasOwn(t, r)) return o.rank;
|
|
760
760
|
t[r] = !0;
|
|
761
|
-
let i = e.outEdges(r), s = i ? i.map((d) => d == null ? Number.POSITIVE_INFINITY : n(d.w) - e.edge(d).minlen) : [], l =
|
|
761
|
+
let i = e.outEdges(r), s = i ? i.map((d) => d == null ? Number.POSITIVE_INFINITY : n(d.w) - e.edge(d).minlen) : [], l = Q(Math.min, s);
|
|
762
762
|
return l === Number.POSITIVE_INFINITY && (l = 0), o.rank = l;
|
|
763
763
|
}
|
|
764
764
|
e.sources().forEach(n);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function be(e, t) {
|
|
767
767
|
return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
|
|
768
768
|
}
|
|
769
|
-
var
|
|
769
|
+
var vn = _o;
|
|
770
770
|
function _o(e) {
|
|
771
|
-
let t = new
|
|
771
|
+
let t = new q({ directed: !1 }), n = e.nodes();
|
|
772
772
|
if (n.length === 0) throw new Error("Graph must have at least one node");
|
|
773
773
|
let r = n[0], o = e.nodeCount();
|
|
774
774
|
t.setNode(r, {});
|
|
775
775
|
let i, s;
|
|
776
|
-
for (; So(t, e) < o && (i = No(t, e), !!i); ) s = t.hasNode(i.v) ?
|
|
776
|
+
for (; So(t, e) < o && (i = No(t, e), !!i); ) s = t.hasNode(i.v) ? be(e, i) : -be(e, i), Co(t, e, s);
|
|
777
777
|
return t;
|
|
778
778
|
}
|
|
779
779
|
function So(e, t) {
|
|
@@ -781,7 +781,7 @@ function So(e, t) {
|
|
|
781
781
|
let o = t.nodeEdges(r);
|
|
782
782
|
o && o.forEach((i) => {
|
|
783
783
|
let s = i.v, l = r === s ? i.w : s;
|
|
784
|
-
!e.hasNode(l) && !
|
|
784
|
+
!e.hasNode(l) && !be(t, i) && (e.setNode(l, {}), e.setEdge(r, l, {}), n(l));
|
|
785
785
|
});
|
|
786
786
|
}
|
|
787
787
|
return e.nodes().forEach(n), e.nodeCount();
|
|
@@ -789,35 +789,35 @@ function So(e, t) {
|
|
|
789
789
|
function No(e, t) {
|
|
790
790
|
return t.edges().reduce((n, r) => {
|
|
791
791
|
let o = Number.POSITIVE_INFINITY;
|
|
792
|
-
return e.hasNode(r.v) !== e.hasNode(r.w) && (o =
|
|
792
|
+
return e.hasNode(r.v) !== e.hasNode(r.w) && (o = be(t, r)), o < n[0] ? [o, r] : n;
|
|
793
793
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
794
794
|
}
|
|
795
795
|
function Co(e, t, n) {
|
|
796
796
|
e.nodes().forEach((r) => t.node(r).rank += n);
|
|
797
797
|
}
|
|
798
|
-
var { preorder: To, postorder: Io } =
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
function
|
|
806
|
-
e = to(e),
|
|
807
|
-
let t =
|
|
808
|
-
|
|
798
|
+
var { preorder: To, postorder: Io } = ot, Oo = ue;
|
|
799
|
+
ue.initLowLimValues = at;
|
|
800
|
+
ue.initCutValues = lt;
|
|
801
|
+
ue.calcCutValue = wn;
|
|
802
|
+
ue.leaveEdge = xn;
|
|
803
|
+
ue.enterEdge = kn;
|
|
804
|
+
ue.exchangeEdges = _n;
|
|
805
|
+
function ue(e) {
|
|
806
|
+
e = to(e), st(e);
|
|
807
|
+
let t = vn(e);
|
|
808
|
+
at(t), lt(t, e);
|
|
809
809
|
let n, r;
|
|
810
|
-
for (; n =
|
|
810
|
+
for (; n = xn(t); ) r = kn(t, e, n), _n(t, e, n, r);
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function lt(e, t) {
|
|
813
813
|
let n = Io(e, e.nodes());
|
|
814
814
|
n = n.slice(0, n.length - 1), n.forEach((r) => Mo(e, t, r));
|
|
815
815
|
}
|
|
816
816
|
function Mo(e, t, n) {
|
|
817
817
|
let r = e.node(n).parent, o = e.edge(n, r);
|
|
818
|
-
o.cutvalue =
|
|
818
|
+
o.cutvalue = wn(e, t, n);
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function wn(e, t, n) {
|
|
821
821
|
let r = e.node(n).parent, o = !0, i = t.edge(n, r), s = 0;
|
|
822
822
|
i || (o = !1, i = t.edge(r, n)), s = i.weight;
|
|
823
823
|
let l = t.nodeEdges(n);
|
|
@@ -832,29 +832,29 @@ function yn(e, t, n) {
|
|
|
832
832
|
}
|
|
833
833
|
}), s;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
arguments.length < 2 && (t = e.nodes()[0]),
|
|
835
|
+
function at(e, t) {
|
|
836
|
+
arguments.length < 2 && (t = e.nodes()[0]), En(e, {}, 1, t);
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function En(e, t, n, r, o) {
|
|
839
839
|
let i = n, s = e.node(r);
|
|
840
840
|
t[r] = !0;
|
|
841
841
|
let l = e.neighbors(r);
|
|
842
842
|
return l && l.forEach((d) => {
|
|
843
|
-
Object.hasOwn(t, d) || (n =
|
|
843
|
+
Object.hasOwn(t, d) || (n = En(e, t, n, d, r));
|
|
844
844
|
}), s.low = i, s.lim = n++, o ? s.parent = o : delete s.parent, n;
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function xn(e) {
|
|
847
847
|
return e.edges().find((t) => e.edge(t).cutvalue < 0);
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function kn(e, t, n) {
|
|
850
850
|
let r = n.v, o = n.w;
|
|
851
851
|
t.hasEdge(r, o) || (r = n.w, o = n.v);
|
|
852
852
|
let i = e.node(r), s = e.node(o), l = i, d = !1;
|
|
853
|
-
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d ===
|
|
853
|
+
return i.lim > s.lim && (l = s, d = !0), t.edges().filter((a) => d === Ft(e, e.node(a.v), l) && d !== Ft(e, e.node(a.w), l)).reduce((a, c) => be(t, c) < be(t, a) ? c : a);
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function _n(e, t, n, r) {
|
|
856
856
|
let o = n.v, i = n.w;
|
|
857
|
-
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}),
|
|
857
|
+
e.removeEdge(o, i), e.setEdge(r.v, r.w, {}), at(e), lt(e, t), jo(e, t);
|
|
858
858
|
}
|
|
859
859
|
function jo(e, t) {
|
|
860
860
|
let n = e.nodes().find((o) => !e.node(o).parent);
|
|
@@ -868,7 +868,7 @@ function jo(e, t) {
|
|
|
868
868
|
function zo(e, t, n) {
|
|
869
869
|
return e.hasEdge(t, n);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function Ft(e, t, n) {
|
|
872
872
|
return n.low <= t.lim && t.lim <= n.lim;
|
|
873
873
|
}
|
|
874
874
|
var Lo = Po;
|
|
@@ -877,7 +877,7 @@ function Po(e) {
|
|
|
877
877
|
if (typeof t == "function") return t(e);
|
|
878
878
|
switch (t) {
|
|
879
879
|
case "network-simplex":
|
|
880
|
-
|
|
880
|
+
Rt(e);
|
|
881
881
|
break;
|
|
882
882
|
case "tight-tree":
|
|
883
883
|
Ro(e);
|
|
@@ -888,14 +888,14 @@ function Po(e) {
|
|
|
888
888
|
case "none":
|
|
889
889
|
break;
|
|
890
890
|
default:
|
|
891
|
-
|
|
891
|
+
Rt(e);
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
-
var Fo =
|
|
894
|
+
var Fo = st;
|
|
895
895
|
function Ro(e) {
|
|
896
|
-
|
|
896
|
+
st(e), vn(e);
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function Rt(e) {
|
|
899
899
|
Oo(e);
|
|
900
900
|
}
|
|
901
901
|
var Ao = Bo;
|
|
@@ -932,27 +932,27 @@ function Wo(e) {
|
|
|
932
932
|
let i = n;
|
|
933
933
|
e.children(o).forEach(r), t[o] = { low: i, lim: n++ };
|
|
934
934
|
}
|
|
935
|
-
return e.children(
|
|
935
|
+
return e.children(Ae).forEach(r), t;
|
|
936
936
|
}
|
|
937
937
|
function $o(e) {
|
|
938
|
-
let t =
|
|
938
|
+
let t = me(e, "root", {}, "_root"), n = Go(e), r = Object.values(n), o = Q(Math.max, r) - 1, i = 2 * o + 1;
|
|
939
939
|
e.graph().nestingRoot = t, e.edges().forEach((l) => e.edge(l).minlen *= i);
|
|
940
940
|
let s = Yo(e) + 1;
|
|
941
|
-
e.children(
|
|
941
|
+
e.children(Ae).forEach((l) => Sn(e, t, i, s, o, n, l)), e.graph().nodeRankFactor = i;
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function Sn(e, t, n, r, o, i, s) {
|
|
944
944
|
var l;
|
|
945
945
|
let d = e.children(s);
|
|
946
946
|
if (!d.length) {
|
|
947
947
|
s !== t && e.setEdge(t, s, { weight: 0, minlen: n });
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
|
-
let a =
|
|
950
|
+
let a = Lt(e, "_bt"), c = Lt(e, "_bb"), f = e.node(s);
|
|
951
951
|
e.setParent(a, s), f.borderTop = a, e.setParent(c, s), f.borderBottom = c, d.forEach((h) => {
|
|
952
952
|
var g;
|
|
953
|
-
|
|
954
|
-
let
|
|
955
|
-
e.setEdge(a,
|
|
953
|
+
Sn(e, t, n, r, o, i, h);
|
|
954
|
+
let E = e.node(h), m = E.borderTop ? E.borderTop : h, p = E.borderBottom ? E.borderBottom : h, k = E.borderTop ? r : 2 * r, x = m !== p ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
|
|
955
|
+
e.setEdge(a, m, { weight: k, minlen: x, nestingEdge: !0 }), e.setEdge(p, c, { weight: k, minlen: x, nestingEdge: !0 });
|
|
956
956
|
}), e.parent(s) || e.setEdge(t, a, { weight: 0, minlen: o + ((l = i[s]) != null ? l : 0) });
|
|
957
957
|
}
|
|
958
958
|
function Go(e) {
|
|
@@ -961,7 +961,7 @@ function Go(e) {
|
|
|
961
961
|
let i = e.children(r);
|
|
962
962
|
i && i.length && i.forEach((s) => n(s, o + 1)), t[r] = o;
|
|
963
963
|
}
|
|
964
|
-
return e.children(
|
|
964
|
+
return e.children(Ae).forEach((r) => n(r, 1)), t;
|
|
965
965
|
}
|
|
966
966
|
function Yo(e) {
|
|
967
967
|
return e.edges().reduce((t, n) => t + e.edge(n).weight, 0);
|
|
@@ -978,55 +978,55 @@ function Uo(e) {
|
|
|
978
978
|
let r = e.children(n), o = e.node(n);
|
|
979
979
|
if (r.length && r.forEach(t), Object.hasOwn(o, "minRank")) {
|
|
980
980
|
o.borderLeft = [], o.borderRight = [];
|
|
981
|
-
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i)
|
|
981
|
+
for (let i = o.minRank, s = o.maxRank + 1; i < s; ++i) At(e, "borderLeft", "_bl", n, o, i), At(e, "borderRight", "_br", n, o, i);
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
|
-
e.children(
|
|
984
|
+
e.children(Ae).forEach(t);
|
|
985
985
|
}
|
|
986
|
-
function
|
|
987
|
-
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d =
|
|
986
|
+
function At(e, t, n, r, o, i) {
|
|
987
|
+
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d = me(e, "border", s, n);
|
|
988
988
|
o[t][i] = d, e.setParent(d, r), l && e.setEdge(l, d, { weight: 1 });
|
|
989
989
|
}
|
|
990
990
|
function Vo(e) {
|
|
991
991
|
var t;
|
|
992
992
|
let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
993
|
-
(n === "lr" || n === "rl") &&
|
|
993
|
+
(n === "lr" || n === "rl") && Nn(e);
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function qo(e) {
|
|
996
996
|
var t;
|
|
997
997
|
let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
998
|
-
(n === "bt" || n === "rl") &&
|
|
998
|
+
(n === "bt" || n === "rl") && Xo(e), (n === "lr" || n === "rl") && (Jo(e), Nn(e));
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1001
|
-
e.nodes().forEach((t) =>
|
|
1000
|
+
function Nn(e) {
|
|
1001
|
+
e.nodes().forEach((t) => Bt(e.node(t))), e.edges().forEach((t) => Bt(e.edge(t)));
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function Bt(e) {
|
|
1004
1004
|
let t = e.width;
|
|
1005
1005
|
e.width = e.height, e.height = t;
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1008
|
-
e.nodes().forEach((t) =>
|
|
1007
|
+
function Xo(e) {
|
|
1008
|
+
e.nodes().forEach((t) => He(e.node(t))), e.edges().forEach((t) => {
|
|
1009
1009
|
var n;
|
|
1010
1010
|
let r = e.edge(t);
|
|
1011
|
-
(n = r.points) == null || n.forEach(
|
|
1011
|
+
(n = r.points) == null || n.forEach(He), Object.hasOwn(r, "y") && He(r);
|
|
1012
1012
|
});
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1014
|
+
function He(e) {
|
|
1015
1015
|
e.y = -e.y;
|
|
1016
1016
|
}
|
|
1017
1017
|
function Jo(e) {
|
|
1018
|
-
e.nodes().forEach((t) =>
|
|
1018
|
+
e.nodes().forEach((t) => Ue(e.node(t))), e.edges().forEach((t) => {
|
|
1019
1019
|
var n;
|
|
1020
1020
|
let r = e.edge(t);
|
|
1021
|
-
(n = r.points) == null || n.forEach(
|
|
1021
|
+
(n = r.points) == null || n.forEach(Ue), Object.hasOwn(r, "x") && Ue(r);
|
|
1022
1022
|
});
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function Ue(e) {
|
|
1025
1025
|
let t = e.x;
|
|
1026
1026
|
e.x = e.y, e.y = t;
|
|
1027
1027
|
}
|
|
1028
1028
|
function Zo(e) {
|
|
1029
|
-
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o =
|
|
1029
|
+
let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o = Q(Math.max, r), i = Se(o + 1).map(() => []);
|
|
1030
1030
|
function s(l) {
|
|
1031
1031
|
if (t[l]) return;
|
|
1032
1032
|
t[l] = !0;
|
|
@@ -1100,7 +1100,7 @@ function ri(e) {
|
|
|
1100
1100
|
let o = e.pop();
|
|
1101
1101
|
t.push(o), o.in.reverse().forEach(n(o)), o.out.forEach(r(o));
|
|
1102
1102
|
}
|
|
1103
|
-
return t.filter((o) => !o.merged).map((o) =>
|
|
1103
|
+
return t.filter((o) => !o.merged).map((o) => Fe(o, ["vs", "i", "barycenter", "weight"]));
|
|
1104
1104
|
}
|
|
1105
1105
|
function oi(e, t) {
|
|
1106
1106
|
let n = 0, r = 0;
|
|
@@ -1108,13 +1108,13 @@ function oi(e, t) {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
function ii(e, t) {
|
|
1110
1110
|
let n = io(e, (c) => Object.hasOwn(c, "barycenter")), r = n.lhs, o = n.rhs.sort((c, f) => f.i - c.i), i = [], s = 0, l = 0, d = 0;
|
|
1111
|
-
r.sort(si(!!t)), d =
|
|
1112
|
-
d += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, d =
|
|
1111
|
+
r.sort(si(!!t)), d = Dt(i, o, d), r.forEach((c) => {
|
|
1112
|
+
d += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, d = Dt(i, o, d);
|
|
1113
1113
|
});
|
|
1114
1114
|
let a = { vs: i.flat(1) };
|
|
1115
1115
|
return l && (a.barycenter = s / l, a.weight = l), a;
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function Dt(e, t, n) {
|
|
1118
1118
|
let r;
|
|
1119
1119
|
for (; t.length && (r = t[t.length - 1]).i <= n; ) t.pop(), e.push(r.vs), n++;
|
|
1120
1120
|
return n;
|
|
@@ -1122,13 +1122,13 @@ function Ft(e, t, n) {
|
|
|
1122
1122
|
function si(e) {
|
|
1123
1123
|
return (t, n) => t.barycenter < n.barycenter ? -1 : t.barycenter > n.barycenter ? 1 : e ? n.i - t.i : t.i - n.i;
|
|
1124
1124
|
}
|
|
1125
|
-
function
|
|
1125
|
+
function Cn(e, t, n, r) {
|
|
1126
1126
|
let o = e.children(t), i = e.node(t), s = i ? i.borderLeft : void 0, l = i ? i.borderRight : void 0, d = {};
|
|
1127
1127
|
s && (o = o.filter((h) => h !== s && h !== l));
|
|
1128
1128
|
let a = ti(e, o);
|
|
1129
1129
|
a.forEach((h) => {
|
|
1130
1130
|
if (e.children(h.v).length) {
|
|
1131
|
-
let g =
|
|
1131
|
+
let g = Cn(e, h.v, n, r);
|
|
1132
1132
|
d[h.v] = g, Object.hasOwn(g, "barycenter") && ai(h, g);
|
|
1133
1133
|
}
|
|
1134
1134
|
});
|
|
@@ -1139,8 +1139,8 @@ function kn(e, t, n, r) {
|
|
|
1139
1139
|
f.vs = [s, f.vs, l].flat(1);
|
|
1140
1140
|
let h = e.predecessors(s);
|
|
1141
1141
|
if (h && h.length) {
|
|
1142
|
-
let g = e.node(h[0]),
|
|
1143
|
-
Object.hasOwn(f, "barycenter") || (f.barycenter = 0, f.weight = 0), f.barycenter = (f.barycenter * f.weight + g.order +
|
|
1142
|
+
let g = e.node(h[0]), E = e.predecessors(l), m = e.node(E[0]);
|
|
1143
|
+
Object.hasOwn(f, "barycenter") || (f.barycenter = 0, f.weight = 0), f.barycenter = (f.barycenter * f.weight + g.order + m.order) / (f.weight + 2), f.weight += 2;
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
1146
|
return f;
|
|
@@ -1155,7 +1155,7 @@ function ai(e, t) {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
function di(e, t, n, r) {
|
|
1157
1157
|
r || (r = e.nodes());
|
|
1158
|
-
let o = ci(e), i = new
|
|
1158
|
+
let o = ci(e), i = new q({ compound: !0 }).setGraph({ root: o }).setDefaultNodeLabel((s) => e.node(s));
|
|
1159
1159
|
return r.forEach((s) => {
|
|
1160
1160
|
let l = e.node(s), d = e.parent(s);
|
|
1161
1161
|
if (l.rank === t || l.minRank <= t && t <= l.maxRank) {
|
|
@@ -1170,7 +1170,7 @@ function di(e, t, n, r) {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
function ci(e) {
|
|
1172
1172
|
let t;
|
|
1173
|
-
for (; e.hasNode(t =
|
|
1173
|
+
for (; e.hasNode(t = it("_root")); ) ;
|
|
1174
1174
|
return t;
|
|
1175
1175
|
}
|
|
1176
1176
|
function fi(e, t, n) {
|
|
@@ -1186,22 +1186,22 @@ function fi(e, t, n) {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
});
|
|
1188
1188
|
}
|
|
1189
|
-
function
|
|
1189
|
+
function Tn(e, t = {}) {
|
|
1190
1190
|
if (typeof t.customOrder == "function") {
|
|
1191
|
-
t.customOrder(e,
|
|
1191
|
+
t.customOrder(e, Tn);
|
|
1192
1192
|
return;
|
|
1193
1193
|
}
|
|
1194
|
-
let n =
|
|
1195
|
-
if (
|
|
1194
|
+
let n = yn(e), r = Wt(e, Se(1, n + 1), "inEdges"), o = Wt(e, Se(n - 1, -1, -1), "outEdges"), i = Zo(e);
|
|
1195
|
+
if ($t(e, i), t.disableOptimalOrderHeuristic) return;
|
|
1196
1196
|
let s = Number.POSITIVE_INFINITY, l, d = t.constraints || [];
|
|
1197
1197
|
for (let a = 0, c = 0; c < 4; ++a, ++c) {
|
|
1198
|
-
ui(a % 2 ? r : o, a % 4 >= 2, d), i =
|
|
1198
|
+
ui(a % 2 ? r : o, a % 4 >= 2, d), i = Te(e);
|
|
1199
1199
|
let f = Qo(e, i);
|
|
1200
1200
|
f < s ? (c = 0, l = Object.assign({}, i), s = f) : f === s && (l = structuredClone(i));
|
|
1201
1201
|
}
|
|
1202
|
-
|
|
1202
|
+
$t(e, l);
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function Wt(e, t, n) {
|
|
1205
1205
|
let r = /* @__PURE__ */ new Map(), o = (i, s) => {
|
|
1206
1206
|
r.has(i) || r.set(i, []), r.get(i).push(s);
|
|
1207
1207
|
};
|
|
@@ -1214,14 +1214,14 @@ function Rt(e, t, n) {
|
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
1216
|
function ui(e, t, n) {
|
|
1217
|
-
let r = new
|
|
1217
|
+
let r = new q();
|
|
1218
1218
|
e.forEach(function(o) {
|
|
1219
1219
|
n.forEach((l) => r.setEdge(l.left, l.right));
|
|
1220
|
-
let i = o.graph().root, s =
|
|
1220
|
+
let i = o.graph().root, s = Cn(o, i, r, t);
|
|
1221
1221
|
s.vs.forEach((l, d) => o.node(l).order = d), fi(o, r, s.vs);
|
|
1222
1222
|
});
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1224
|
+
function $t(e, t) {
|
|
1225
1225
|
Object.values(t).forEach((n) => n.forEach((r, o) => e.node(r).order = o));
|
|
1226
1226
|
}
|
|
1227
1227
|
function hi(e, t) {
|
|
@@ -1230,11 +1230,11 @@ function hi(e, t) {
|
|
|
1230
1230
|
let s = 0, l = 0, d = o.length, a = i[i.length - 1];
|
|
1231
1231
|
return i.forEach((c, f) => {
|
|
1232
1232
|
let h = pi(e, c), g = h ? e.node(h).order : d;
|
|
1233
|
-
(h || c === a) && (i.slice(l, f + 1).forEach((
|
|
1234
|
-
let
|
|
1235
|
-
|
|
1236
|
-
let
|
|
1237
|
-
(
|
|
1233
|
+
(h || c === a) && (i.slice(l, f + 1).forEach((E) => {
|
|
1234
|
+
let m = e.predecessors(E);
|
|
1235
|
+
m && m.forEach((p) => {
|
|
1236
|
+
let k = e.node(p), x = k.order;
|
|
1237
|
+
(x < s || g < x) && !(k.dummy && e.node(E).dummy) && In(n, p, E);
|
|
1238
1238
|
});
|
|
1239
1239
|
}), l = f + 1, s = g);
|
|
1240
1240
|
}), i;
|
|
@@ -1244,14 +1244,14 @@ function hi(e, t) {
|
|
|
1244
1244
|
function gi(e, t) {
|
|
1245
1245
|
let n = {};
|
|
1246
1246
|
function r(i, s, l, d, a) {
|
|
1247
|
-
|
|
1247
|
+
Se(s, l).forEach((c) => {
|
|
1248
1248
|
let f = i[c];
|
|
1249
1249
|
if (f !== void 0 && e.node(f).dummy) {
|
|
1250
1250
|
let h = e.predecessors(f);
|
|
1251
1251
|
h && h.forEach((g) => {
|
|
1252
1252
|
if (g === void 0) return;
|
|
1253
|
-
let
|
|
1254
|
-
|
|
1253
|
+
let E = e.node(g);
|
|
1254
|
+
E.dummy && (E.order < d || E.order > a) && In(n, g, f);
|
|
1255
1255
|
});
|
|
1256
1256
|
}
|
|
1257
1257
|
});
|
|
@@ -1278,7 +1278,7 @@ function pi(e, t) {
|
|
|
1278
1278
|
if (n) return n.find((r) => e.node(r).dummy);
|
|
1279
1279
|
}
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function In(e, t, n) {
|
|
1282
1282
|
if (t > n) {
|
|
1283
1283
|
let o = t;
|
|
1284
1284
|
t = n, n = o;
|
|
@@ -1305,17 +1305,17 @@ function bi(e, t, n, r) {
|
|
|
1305
1305
|
l.forEach((a) => {
|
|
1306
1306
|
let c = r(a);
|
|
1307
1307
|
if (c && c.length) {
|
|
1308
|
-
let f = c.sort((g,
|
|
1309
|
-
let
|
|
1310
|
-
return (
|
|
1308
|
+
let f = c.sort((g, E) => {
|
|
1309
|
+
let m = s[g], p = s[E];
|
|
1310
|
+
return (m !== void 0 ? m : 0) - (p !== void 0 ? p : 0);
|
|
1311
1311
|
}), h = (f.length - 1) / 2;
|
|
1312
|
-
for (let g = Math.floor(h),
|
|
1313
|
-
let
|
|
1314
|
-
if (
|
|
1315
|
-
let
|
|
1316
|
-
if (
|
|
1317
|
-
let
|
|
1318
|
-
|
|
1312
|
+
for (let g = Math.floor(h), E = Math.ceil(h); g <= E; ++g) {
|
|
1313
|
+
let m = f[g];
|
|
1314
|
+
if (m === void 0) continue;
|
|
1315
|
+
let p = s[m];
|
|
1316
|
+
if (p !== void 0 && i[a] === a && d < p && !yi(n, a, m)) {
|
|
1317
|
+
let k = o[m];
|
|
1318
|
+
k !== void 0 && (i[m] = a, i[a] = o[a] = k, d = p);
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
@@ -1324,33 +1324,33 @@ function bi(e, t, n, r) {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
function mi(e, t, n, r, o = !1) {
|
|
1326
1326
|
let i = {}, s = vi(e, t, n, o), l = o ? "borderLeft" : "borderRight";
|
|
1327
|
-
function d(g,
|
|
1328
|
-
let
|
|
1329
|
-
for (;
|
|
1330
|
-
if (
|
|
1327
|
+
function d(g, E) {
|
|
1328
|
+
let m = s.nodes().slice(), p = {}, k = m.pop();
|
|
1329
|
+
for (; k; ) {
|
|
1330
|
+
if (p[k]) g(k);
|
|
1331
1331
|
else {
|
|
1332
|
-
|
|
1333
|
-
for (let
|
|
1332
|
+
p[k] = !0, m.push(k);
|
|
1333
|
+
for (let x of E(k)) m.push(x);
|
|
1334
1334
|
}
|
|
1335
|
-
|
|
1335
|
+
k = m.pop();
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
1338
|
function a(g) {
|
|
1339
|
-
let
|
|
1340
|
-
|
|
1341
|
-
var
|
|
1342
|
-
let
|
|
1343
|
-
return Math.max(
|
|
1339
|
+
let E = s.inEdges(g);
|
|
1340
|
+
E ? i[g] = E.reduce((m, p) => {
|
|
1341
|
+
var k;
|
|
1342
|
+
let x = (k = i[p.v]) != null ? k : 0, O = s.edge(p);
|
|
1343
|
+
return Math.max(m, x + (O !== void 0 ? O : 0));
|
|
1344
1344
|
}, 0) : i[g] = 0;
|
|
1345
1345
|
}
|
|
1346
1346
|
function c(g) {
|
|
1347
|
-
let
|
|
1348
|
-
|
|
1349
|
-
let
|
|
1350
|
-
return Math.min(
|
|
1347
|
+
let E = s.outEdges(g), m = Number.POSITIVE_INFINITY;
|
|
1348
|
+
E && (m = E.reduce((k, x) => {
|
|
1349
|
+
let O = i[x.w], z = s.edge(x);
|
|
1350
|
+
return Math.min(k, (O !== void 0 ? O : 0) - (z !== void 0 ? z : 0));
|
|
1351
1351
|
}, Number.POSITIVE_INFINITY));
|
|
1352
|
-
let
|
|
1353
|
-
|
|
1352
|
+
let p = e.node(g);
|
|
1353
|
+
m !== Number.POSITIVE_INFINITY && p.borderType !== l && (i[g] = Math.max(i[g] !== void 0 ? i[g] : 0, m));
|
|
1354
1354
|
}
|
|
1355
1355
|
function f(g) {
|
|
1356
1356
|
return s.predecessors(g) || [];
|
|
@@ -1359,13 +1359,13 @@ function mi(e, t, n, r, o = !1) {
|
|
|
1359
1359
|
return s.successors(g) || [];
|
|
1360
1360
|
}
|
|
1361
1361
|
return d(a, f), d(c, h), Object.keys(r).forEach((g) => {
|
|
1362
|
-
var
|
|
1363
|
-
let
|
|
1364
|
-
|
|
1362
|
+
var E;
|
|
1363
|
+
let m = n[g];
|
|
1364
|
+
m !== void 0 && (i[g] = (E = i[m]) != null ? E : 0);
|
|
1365
1365
|
}), i;
|
|
1366
1366
|
}
|
|
1367
1367
|
function vi(e, t, n, r) {
|
|
1368
|
-
let o = new
|
|
1368
|
+
let o = new q(), i = e.graph(), s = _i(i.nodesep, i.edgesep, r);
|
|
1369
1369
|
return t.forEach((l) => {
|
|
1370
1370
|
let d;
|
|
1371
1371
|
l.forEach((a) => {
|
|
@@ -1395,19 +1395,19 @@ function wi(e, t) {
|
|
|
1395
1395
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
1396
1396
|
}
|
|
1397
1397
|
function Ei(e, t) {
|
|
1398
|
-
let n = Object.values(t), r =
|
|
1398
|
+
let n = Object.values(t), r = Q(Math.min, n), o = Q(Math.max, n);
|
|
1399
1399
|
["u", "d"].forEach((i) => {
|
|
1400
1400
|
["l", "r"].forEach((s) => {
|
|
1401
1401
|
let l = i + s, d = e[l];
|
|
1402
1402
|
if (!d || d === t) return;
|
|
1403
|
-
let a = Object.values(d), c = r -
|
|
1404
|
-
s !== "l" && (c = o -
|
|
1403
|
+
let a = Object.values(d), c = r - Q(Math.min, a);
|
|
1404
|
+
s !== "l" && (c = o - Q(Math.max, a)), c && (e[l] = Re(d, (f) => f + c));
|
|
1405
1405
|
});
|
|
1406
1406
|
});
|
|
1407
1407
|
}
|
|
1408
1408
|
function xi(e, t = void 0) {
|
|
1409
1409
|
let n = e.ul;
|
|
1410
|
-
return n ?
|
|
1410
|
+
return n ? Re(n, (r, o) => {
|
|
1411
1411
|
var i, s;
|
|
1412
1412
|
if (t) {
|
|
1413
1413
|
let d = t.toLowerCase(), a = e[d];
|
|
@@ -1421,12 +1421,12 @@ function xi(e, t = void 0) {
|
|
|
1421
1421
|
}) : {};
|
|
1422
1422
|
}
|
|
1423
1423
|
function ki(e) {
|
|
1424
|
-
let t =
|
|
1424
|
+
let t = Te(e), n = Object.assign(hi(e, t), gi(e, t)), r = {}, o;
|
|
1425
1425
|
["u", "d"].forEach((s) => {
|
|
1426
1426
|
o = s === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((l) => {
|
|
1427
1427
|
l === "r" && (o = o.map((c) => Object.values(c).reverse()));
|
|
1428
1428
|
let d = bi(e, o, n, (c) => (s === "u" ? e.predecessors(c) : e.successors(c)) || []), a = mi(e, o, d.root, d.align, l === "r");
|
|
1429
|
-
l === "r" && (a =
|
|
1429
|
+
l === "r" && (a = Re(a, (c) => -c)), r[s + l] = a;
|
|
1430
1430
|
});
|
|
1431
1431
|
});
|
|
1432
1432
|
let i = wi(e, r);
|
|
@@ -1458,10 +1458,10 @@ function Si(e, t) {
|
|
|
1458
1458
|
return e.node(t).width;
|
|
1459
1459
|
}
|
|
1460
1460
|
function Ni(e) {
|
|
1461
|
-
e =
|
|
1461
|
+
e = gn(e), Ci(e), Object.entries(ki(e)).forEach(([t, n]) => e.node(t).x = n);
|
|
1462
1462
|
}
|
|
1463
1463
|
function Ci(e) {
|
|
1464
|
-
let t =
|
|
1464
|
+
let t = Te(e), n = e.graph(), r = n.ranksep, o = n.rankalign, i = 0;
|
|
1465
1465
|
t.forEach((s) => {
|
|
1466
1466
|
let l = s.reduce((d, a) => {
|
|
1467
1467
|
var c;
|
|
@@ -1475,14 +1475,14 @@ function Ci(e) {
|
|
|
1475
1475
|
});
|
|
1476
1476
|
}
|
|
1477
1477
|
function Ti(e, t = {}) {
|
|
1478
|
-
let n = t.debugTiming ?
|
|
1478
|
+
let n = t.debugTiming ? bn : mn;
|
|
1479
1479
|
return n("layout", () => {
|
|
1480
1480
|
let r = n(" buildLayoutGraph", () => Ai(e));
|
|
1481
1481
|
return n(" runLayout", () => Ii(r, n, t)), n(" updateInputGraph", () => Oi(e, r)), r;
|
|
1482
1482
|
});
|
|
1483
1483
|
}
|
|
1484
1484
|
function Ii(e, t, n) {
|
|
1485
|
-
t(" makeSpaceForEdgeLabels", () => Bi(e)), t(" removeSelfEdges", () => Vi(e)), t(" acyclic", () => mo(e)), t(" nestingGraph.run", () => $o(e)), t(" rank", () => Lo(
|
|
1485
|
+
t(" makeSpaceForEdgeLabels", () => Bi(e)), t(" removeSelfEdges", () => Vi(e)), t(" acyclic", () => mo(e)), t(" nestingGraph.run", () => $o(e)), t(" rank", () => Lo(gn(e))), t(" injectEdgeLabelProxies", () => Di(e)), t(" removeEmptyRanks", () => ro(e)), t(" nestingGraph.cleanup", () => Ko(e)), t(" normalizeRanks", () => no(e)), t(" assignRankMinMax", () => Wi(e)), t(" removeEdgeLabelProxies", () => $i(e)), t(" normalize.run", () => Eo(e)), t(" parentDummyChains", () => Ao(e)), t(" addBorderSegments", () => Ho(e)), t(" order", () => Tn(e, n)), t(" insertSelfEdges", () => qi(e)), t(" adjustCoordinateSystem", () => Vo(e)), t(" position", () => Ni(e)), t(" positionSelfEdges", () => Xi(e)), t(" removeBorderNodes", () => Ui(e)), t(" normalize.undo", () => ko(e)), t(" fixupEdgeLabelCoords", () => Ki(e)), t(" undoCoordinateSystem", () => qo(e)), t(" translateGraph", () => Gi(e)), t(" assignNodeIntersects", () => Yi(e)), t(" reversePoints", () => Hi(e)), t(" acyclic.undo", () => wo(e));
|
|
1486
1486
|
}
|
|
1487
1487
|
function Oi(e, t) {
|
|
1488
1488
|
e.nodes().forEach((n) => {
|
|
@@ -1493,19 +1493,19 @@ function Oi(e, t) {
|
|
|
1493
1493
|
r.points = o.points, Object.hasOwn(o, "x") && (r.x = o.x, r.y = o.y);
|
|
1494
1494
|
}), e.graph().width = t.graph().width, e.graph().height = t.graph().height;
|
|
1495
1495
|
}
|
|
1496
|
-
var Mi = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], ji = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, zi = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], Li = ["width", "height", "rank"],
|
|
1496
|
+
var Mi = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], ji = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, zi = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], Li = ["width", "height", "rank"], Gt = { width: 0, height: 0 }, Pi = ["minlen", "weight", "width", "height", "labeloffset"], Fi = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, Ri = ["labelpos"];
|
|
1497
1497
|
function Ai(e) {
|
|
1498
|
-
let t = new
|
|
1499
|
-
return t.setGraph(Object.assign({}, ji,
|
|
1500
|
-
let o =
|
|
1501
|
-
Object.keys(
|
|
1502
|
-
i[l] === void 0 && (i[l] =
|
|
1498
|
+
let t = new q({ multigraph: !0, compound: !0 }), n = qe(e.graph());
|
|
1499
|
+
return t.setGraph(Object.assign({}, ji, Ve(n, Mi), Fe(n, zi))), e.nodes().forEach((r) => {
|
|
1500
|
+
let o = qe(e.node(r)), i = Ve(o, Li);
|
|
1501
|
+
Object.keys(Gt).forEach((l) => {
|
|
1502
|
+
i[l] === void 0 && (i[l] = Gt[l]);
|
|
1503
1503
|
}), t.setNode(r, i);
|
|
1504
1504
|
let s = e.parent(r);
|
|
1505
1505
|
s !== void 0 && t.setParent(r, s);
|
|
1506
1506
|
}), e.edges().forEach((r) => {
|
|
1507
|
-
let o =
|
|
1508
|
-
t.setEdge(r, Object.assign({}, Fi,
|
|
1507
|
+
let o = qe(e.edge(r));
|
|
1508
|
+
t.setEdge(r, Object.assign({}, Fi, Ve(o, Pi), Fe(o, Ri)));
|
|
1509
1509
|
}), t;
|
|
1510
1510
|
}
|
|
1511
1511
|
function Bi(e) {
|
|
@@ -1520,7 +1520,7 @@ function Di(e) {
|
|
|
1520
1520
|
let n = e.edge(t);
|
|
1521
1521
|
if (n.width && n.height) {
|
|
1522
1522
|
let r = e.node(t.v), o = { rank: (e.node(t.w).rank - r.rank) / 2 + r.rank, e: t };
|
|
1523
|
-
|
|
1523
|
+
me(e, "edge-proxy", o, "_ep");
|
|
1524
1524
|
}
|
|
1525
1525
|
});
|
|
1526
1526
|
}
|
|
@@ -1562,7 +1562,7 @@ function Gi(e) {
|
|
|
1562
1562
|
function Yi(e) {
|
|
1563
1563
|
e.edges().forEach((t) => {
|
|
1564
1564
|
let n = e.edge(t), r = e.node(t.v), o = e.node(t.w), i, s;
|
|
1565
|
-
n.points ? (i = n.points[0], s = n.points[n.points.length - 1]) : (n.points = [], i = o, s = r), n.points.unshift(
|
|
1565
|
+
n.points ? (i = n.points[0], s = n.points[n.points.length - 1]) : (n.points = [], i = o, s = r), n.points.unshift(zt(r, i)), n.points.push(zt(o, s));
|
|
1566
1566
|
});
|
|
1567
1567
|
}
|
|
1568
1568
|
function Ki(e) {
|
|
@@ -1602,18 +1602,18 @@ function Vi(e) {
|
|
|
1602
1602
|
}
|
|
1603
1603
|
});
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1606
|
-
|
|
1605
|
+
function qi(e) {
|
|
1606
|
+
Te(e).forEach((t) => {
|
|
1607
1607
|
let n = 0;
|
|
1608
1608
|
t.forEach((r, o) => {
|
|
1609
1609
|
let i = e.node(r);
|
|
1610
1610
|
i.order = o + n, (i.selfEdges || []).forEach((s) => {
|
|
1611
|
-
|
|
1611
|
+
me(e, "selfedge", { width: s.label.width, height: s.label.height, rank: i.rank, order: o + ++n, e: s.e, label: s.label }, "_se");
|
|
1612
1612
|
}), delete i.selfEdges;
|
|
1613
1613
|
});
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
|
-
function
|
|
1616
|
+
function Xi(e) {
|
|
1617
1617
|
e.nodes().forEach((t) => {
|
|
1618
1618
|
let n = e.node(t);
|
|
1619
1619
|
if (n.dummy === "selfedge") {
|
|
@@ -1622,17 +1622,17 @@ function qi(e) {
|
|
|
1622
1622
|
}
|
|
1623
1623
|
});
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1626
|
-
return
|
|
1625
|
+
function Ve(e, t) {
|
|
1626
|
+
return Re(Fe(e, t), Number);
|
|
1627
1627
|
}
|
|
1628
|
-
function
|
|
1628
|
+
function qe(e) {
|
|
1629
1629
|
let t = {};
|
|
1630
1630
|
return e && Object.entries(e).forEach(([n, r]) => {
|
|
1631
1631
|
typeof n == "string" && (n = n.toLowerCase()), t[n] = r;
|
|
1632
1632
|
}), t;
|
|
1633
1633
|
}
|
|
1634
1634
|
function Ji(e) {
|
|
1635
|
-
let t =
|
|
1635
|
+
let t = Te(e), n = new q({ compound: !0, multigraph: !0 }).setGraph({});
|
|
1636
1636
|
return e.nodes().forEach((r) => {
|
|
1637
1637
|
n.setNode(r, { label: r }), n.setParent(r, "layer" + e.node(r).rank);
|
|
1638
1638
|
}), e.edges().forEach((r) => n.setEdge(r.v, r.w, {}, r.name)), t.forEach((r, o) => {
|
|
@@ -1640,16 +1640,16 @@ function Ji(e) {
|
|
|
1640
1640
|
n.setNode(i, { rank: "same" }), r.reduce((s, l) => (n.setEdge(s, l, { style: "invis" }), l));
|
|
1641
1641
|
}), n;
|
|
1642
1642
|
}
|
|
1643
|
-
var Zi = { graphlib:
|
|
1643
|
+
var Zi = { graphlib: on, version: ao, layout: Ti, debug: Ji, util: { time: bn, notime: mn } }, Yt = Zi;
|
|
1644
1644
|
/*! For license information please see dagre.esm.js.LEGAL.txt */
|
|
1645
1645
|
const Qi = (e) => {
|
|
1646
1646
|
const t = [];
|
|
1647
1647
|
return e.nodeInternals.forEach((n, r) => t.push(`${r}:${n.height ?? 0}`)), t.join(",");
|
|
1648
1648
|
}, es = ({ onHeightsReady: e, nodeCount: t }) => {
|
|
1649
|
-
const n = $n(Qi), r =
|
|
1650
|
-
|
|
1649
|
+
const n = $n(Qi), r = Tt("");
|
|
1650
|
+
Tt(0);
|
|
1651
1651
|
const { fitView: o } = Gn();
|
|
1652
|
-
return
|
|
1652
|
+
return se(() => {
|
|
1653
1653
|
if (!n || n === r.current) return;
|
|
1654
1654
|
const i = {};
|
|
1655
1655
|
for (const s of n.split(",")) {
|
|
@@ -1674,11 +1674,11 @@ function ns({
|
|
|
1674
1674
|
saveLabel: s = "Save",
|
|
1675
1675
|
saveDisabled: l = !1
|
|
1676
1676
|
}) {
|
|
1677
|
-
const [d, a] =
|
|
1678
|
-
|
|
1677
|
+
const [d, a] = G.useState(!1), [c, f] = G.useState(!1), [h, g] = G.useState(e ?? "");
|
|
1678
|
+
G.useEffect(() => {
|
|
1679
1679
|
g(e ?? "");
|
|
1680
1680
|
}, [e]);
|
|
1681
|
-
const
|
|
1681
|
+
const E = async () => {
|
|
1682
1682
|
if (!(!o || d || l)) {
|
|
1683
1683
|
a(!0);
|
|
1684
1684
|
try {
|
|
@@ -1687,7 +1687,7 @@ function ns({
|
|
|
1687
1687
|
a(!1);
|
|
1688
1688
|
}
|
|
1689
1689
|
}
|
|
1690
|
-
},
|
|
1690
|
+
}, m = ts[r] ?? {
|
|
1691
1691
|
bg: r,
|
|
1692
1692
|
fg: "#fff"
|
|
1693
1693
|
};
|
|
@@ -1709,12 +1709,12 @@ function ns({
|
|
|
1709
1709
|
"input",
|
|
1710
1710
|
{
|
|
1711
1711
|
value: h,
|
|
1712
|
-
onChange: (
|
|
1712
|
+
onChange: (p) => g(p.target.value),
|
|
1713
1713
|
onBlur: () => {
|
|
1714
1714
|
f(!1), h !== e && t(h);
|
|
1715
1715
|
},
|
|
1716
|
-
onKeyDown: (
|
|
1717
|
-
|
|
1716
|
+
onKeyDown: (p) => {
|
|
1717
|
+
p.key === "Enter" && p.target.blur(), p.key === "Escape" && (g(e ?? ""), f(!1));
|
|
1718
1718
|
},
|
|
1719
1719
|
autoFocus: !0,
|
|
1720
1720
|
style: {
|
|
@@ -1753,8 +1753,8 @@ function ns({
|
|
|
1753
1753
|
fontWeight: 600,
|
|
1754
1754
|
padding: "3px 8px",
|
|
1755
1755
|
borderRadius: 999,
|
|
1756
|
-
background:
|
|
1757
|
-
color:
|
|
1756
|
+
background: m.bg,
|
|
1757
|
+
color: m.fg,
|
|
1758
1758
|
textTransform: "uppercase",
|
|
1759
1759
|
letterSpacing: 0.4,
|
|
1760
1760
|
flexShrink: 0
|
|
@@ -1788,7 +1788,7 @@ function ns({
|
|
|
1788
1788
|
"button",
|
|
1789
1789
|
{
|
|
1790
1790
|
type: "button",
|
|
1791
|
-
onClick:
|
|
1791
|
+
onClick: E,
|
|
1792
1792
|
disabled: d || l,
|
|
1793
1793
|
style: {
|
|
1794
1794
|
padding: "6px 16px",
|
|
@@ -1813,16 +1813,16 @@ function ns({
|
|
|
1813
1813
|
}
|
|
1814
1814
|
);
|
|
1815
1815
|
}
|
|
1816
|
-
const
|
|
1817
|
-
const [l, d] =
|
|
1818
|
-
r && /* @__PURE__ */ u(
|
|
1816
|
+
const Ne = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i, width: s = 720 }) => {
|
|
1817
|
+
const [l, d] = L(!1), a = () => d((h) => !h), c = () => /* @__PURE__ */ w(ne, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
|
|
1818
|
+
r && /* @__PURE__ */ u(ne, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: r }),
|
|
1819
1819
|
/* @__PURE__ */ u("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 500, color: "#212121" }, children: n }),
|
|
1820
|
-
/* @__PURE__ */ u(
|
|
1821
|
-
/* @__PURE__ */ u(
|
|
1822
|
-
] }), f = () => i ? /* @__PURE__ */ u(
|
|
1820
|
+
/* @__PURE__ */ u(It, { onClick: a, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ u(vr, {}) : /* @__PURE__ */ u(wr, {}) }),
|
|
1821
|
+
/* @__PURE__ */ u(It, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ u(or, {}) })
|
|
1822
|
+
] }), f = () => i ? /* @__PURE__ */ u(ne, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
|
|
1823
1823
|
return l ? /* @__PURE__ */ w(er, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
|
|
1824
1824
|
/* @__PURE__ */ u(c, {}),
|
|
1825
|
-
/* @__PURE__ */ u(
|
|
1825
|
+
/* @__PURE__ */ u(ne, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1826
1826
|
/* @__PURE__ */ u(f, {})
|
|
1827
1827
|
] }) : /* @__PURE__ */ w(
|
|
1828
1828
|
tr,
|
|
@@ -1850,7 +1850,7 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1850
1850
|
},
|
|
1851
1851
|
children: [
|
|
1852
1852
|
/* @__PURE__ */ u(c, {}),
|
|
1853
|
-
/* @__PURE__ */ u(
|
|
1853
|
+
/* @__PURE__ */ u(ne, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
|
|
1854
1854
|
/* @__PURE__ */ u(f, {})
|
|
1855
1855
|
]
|
|
1856
1856
|
}
|
|
@@ -1863,36 +1863,36 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1863
1863
|
onClose: o,
|
|
1864
1864
|
loadTriggerSources: i
|
|
1865
1865
|
}) => {
|
|
1866
|
-
const [s, l] =
|
|
1867
|
-
|
|
1868
|
-
e || (l("trigger"), a(null), f([]), g([]),
|
|
1866
|
+
const [s, l] = L("trigger"), [d, a] = L(null), [c, f] = L([]), [h, g] = L([]), [E, m] = L(!1), [p, k] = L(null);
|
|
1867
|
+
se(() => {
|
|
1868
|
+
e || (l("trigger"), a(null), f([]), g([]), m(!1), k(null));
|
|
1869
1869
|
}, [e]);
|
|
1870
|
-
const
|
|
1870
|
+
const x = H(async (P) => {
|
|
1871
1871
|
if (!i) {
|
|
1872
1872
|
r(P);
|
|
1873
1873
|
return;
|
|
1874
1874
|
}
|
|
1875
|
-
a(P),
|
|
1875
|
+
a(P), m(!0), k(null);
|
|
1876
1876
|
try {
|
|
1877
|
-
const
|
|
1878
|
-
if (!
|
|
1877
|
+
const M = await i(P.triggerKey);
|
|
1878
|
+
if (!M || M.length === 0) {
|
|
1879
1879
|
r(P);
|
|
1880
1880
|
return;
|
|
1881
1881
|
}
|
|
1882
|
-
f(
|
|
1883
|
-
} catch (
|
|
1884
|
-
|
|
1882
|
+
f(M), l("sources");
|
|
1883
|
+
} catch (M) {
|
|
1884
|
+
k(M instanceof Error ? M.message : "Failed to load sources.");
|
|
1885
1885
|
} finally {
|
|
1886
|
-
|
|
1886
|
+
m(!1);
|
|
1887
1887
|
}
|
|
1888
|
-
}, [i, r]),
|
|
1889
|
-
l("trigger"), a(null), f([]), g([]),
|
|
1888
|
+
}, [i, r]), O = () => {
|
|
1889
|
+
l("trigger"), a(null), f([]), g([]), k(null);
|
|
1890
1890
|
}, z = () => {
|
|
1891
1891
|
d && r(d, h);
|
|
1892
|
-
},
|
|
1893
|
-
/* @__PURE__ */ u(
|
|
1892
|
+
}, W = s === "sources" && d, $ = W ? /* @__PURE__ */ w(_e, { children: [
|
|
1893
|
+
/* @__PURE__ */ u(ze, { type: "button", variant: "outlined", size: "small", onClick: O, children: n.cancel ?? "Back" }),
|
|
1894
1894
|
/* @__PURE__ */ u(
|
|
1895
|
-
|
|
1895
|
+
ze,
|
|
1896
1896
|
{
|
|
1897
1897
|
type: "button",
|
|
1898
1898
|
variant: "contained",
|
|
@@ -1904,34 +1904,34 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1904
1904
|
)
|
|
1905
1905
|
] }) : null;
|
|
1906
1906
|
return /* @__PURE__ */ u(
|
|
1907
|
-
|
|
1907
|
+
Ne,
|
|
1908
1908
|
{
|
|
1909
1909
|
isOpen: e,
|
|
1910
1910
|
onClose: o,
|
|
1911
|
-
title:
|
|
1911
|
+
title: W ? d.label : n.addTriggerTitle,
|
|
1912
1912
|
icon: /* @__PURE__ */ u(mr, {}),
|
|
1913
1913
|
width: 500,
|
|
1914
1914
|
footer: $,
|
|
1915
|
-
children: /* @__PURE__ */ w(
|
|
1916
|
-
!
|
|
1915
|
+
children: /* @__PURE__ */ w(ne, { sx: { p: 2 }, children: [
|
|
1916
|
+
!W && /* @__PURE__ */ w(_e, { children: [
|
|
1917
1917
|
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: n.chooseTrigger }),
|
|
1918
1918
|
/* @__PURE__ */ w("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
|
|
1919
1919
|
t.map((P) => /* @__PURE__ */ w(
|
|
1920
1920
|
"div",
|
|
1921
1921
|
{
|
|
1922
1922
|
className: "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-start ff-gap-3",
|
|
1923
|
-
style: { cursor:
|
|
1924
|
-
onClick: () => !
|
|
1923
|
+
style: { cursor: E ? "wait" : "pointer", transition: "background 0.15s", opacity: E ? 0.6 : 1 },
|
|
1924
|
+
onClick: () => !E && x(P),
|
|
1925
1925
|
role: "button",
|
|
1926
1926
|
tabIndex: 0,
|
|
1927
|
-
onKeyDown: (
|
|
1928
|
-
|
|
1927
|
+
onKeyDown: (M) => {
|
|
1928
|
+
M.key === "Enter" && !E && x(P);
|
|
1929
1929
|
},
|
|
1930
|
-
onMouseEnter: (
|
|
1931
|
-
|
|
1930
|
+
onMouseEnter: (M) => {
|
|
1931
|
+
E || (M.currentTarget.style.background = "#f5f5f5");
|
|
1932
1932
|
},
|
|
1933
|
-
onMouseLeave: (
|
|
1934
|
-
|
|
1933
|
+
onMouseLeave: (M) => {
|
|
1934
|
+
M.currentTarget.style.background = "";
|
|
1935
1935
|
},
|
|
1936
1936
|
children: [
|
|
1937
1937
|
/* @__PURE__ */ u("div", { style: { color: P.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: P.triggerCategory === "scheduler" ? /* @__PURE__ */ u(ir, { size: 18 }) : /* @__PURE__ */ u(sr, { size: 18 }) }),
|
|
@@ -1945,26 +1945,26 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1945
1945
|
)),
|
|
1946
1946
|
t.length === 0 && /* @__PURE__ */ u("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noTriggers })
|
|
1947
1947
|
] }),
|
|
1948
|
-
|
|
1948
|
+
E && /* @__PURE__ */ w(ne, { sx: { display: "flex", alignItems: "center", gap: 1, mt: 2, fontSize: 12, color: "#64748b" }, children: [
|
|
1949
1949
|
/* @__PURE__ */ u(nr, { size: 14 }),
|
|
1950
1950
|
/* @__PURE__ */ u("span", { children: "Loading sources for the selected trigger…" })
|
|
1951
1951
|
] }),
|
|
1952
|
-
|
|
1952
|
+
p && /* @__PURE__ */ u("p", { style: { fontSize: 12, color: "#d32f2f", marginTop: 12 }, children: p })
|
|
1953
1953
|
] }),
|
|
1954
|
-
|
|
1954
|
+
W && /* @__PURE__ */ w(_e, { children: [
|
|
1955
1955
|
/* @__PURE__ */ w(
|
|
1956
1956
|
"div",
|
|
1957
1957
|
{
|
|
1958
1958
|
role: "button",
|
|
1959
1959
|
tabIndex: 0,
|
|
1960
|
-
onClick:
|
|
1960
|
+
onClick: O,
|
|
1961
1961
|
onKeyDown: (P) => {
|
|
1962
|
-
P.key === "Enter" &&
|
|
1962
|
+
P.key === "Enter" && O();
|
|
1963
1963
|
},
|
|
1964
1964
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1965
1965
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
1966
1966
|
children: [
|
|
1967
|
-
/* @__PURE__ */ u(
|
|
1967
|
+
/* @__PURE__ */ u(Jt, { size: 16 }),
|
|
1968
1968
|
/* @__PURE__ */ u("span", { children: n.addTriggerTitle })
|
|
1969
1969
|
]
|
|
1970
1970
|
}
|
|
@@ -1991,16 +1991,16 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
1991
1991
|
] })
|
|
1992
1992
|
}
|
|
1993
1993
|
);
|
|
1994
|
-
},
|
|
1994
|
+
}, Xe = {
|
|
1995
1995
|
cursor: "pointer",
|
|
1996
1996
|
transition: "background 0.15s"
|
|
1997
|
-
},
|
|
1997
|
+
}, Je = "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-center ff-gap-3", os = ({ open: e, availableDescriptors: t, messages: n, onSelect: r, onClose: o }) => {
|
|
1998
1998
|
const { apps: i, ungrouped: s } = U(() => {
|
|
1999
1999
|
const f = /* @__PURE__ */ new Map(), h = [];
|
|
2000
2000
|
for (const g of t)
|
|
2001
2001
|
if (g.app) {
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2002
|
+
const E = f.get(g.app.key);
|
|
2003
|
+
E ? E.descriptors.push(g) : f.set(g.app.key, {
|
|
2004
2004
|
key: g.app.key,
|
|
2005
2005
|
label: g.app.label,
|
|
2006
2006
|
icon: g.app.icon,
|
|
@@ -2010,22 +2010,22 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2010
2010
|
} else
|
|
2011
2011
|
h.push(g);
|
|
2012
2012
|
return { apps: [...f.values()], ungrouped: h };
|
|
2013
|
-
}, [t]), [l, d] =
|
|
2014
|
-
|
|
2013
|
+
}, [t]), [l, d] = L(null), a = l ? i.find((f) => f.key === l) ?? null : null;
|
|
2014
|
+
se(() => {
|
|
2015
2015
|
e || d(null);
|
|
2016
|
-
}, [e]),
|
|
2016
|
+
}, [e]), se(() => {
|
|
2017
2017
|
d(null);
|
|
2018
2018
|
}, [t]);
|
|
2019
2019
|
const c = !a;
|
|
2020
2020
|
return /* @__PURE__ */ u(
|
|
2021
|
-
|
|
2021
|
+
Ne,
|
|
2022
2022
|
{
|
|
2023
2023
|
isOpen: e,
|
|
2024
2024
|
onClose: o,
|
|
2025
2025
|
title: c ? n.addStepTitle : a.label,
|
|
2026
2026
|
icon: c ? /* @__PURE__ */ u(lr, {}) : a.icon ?? /* @__PURE__ */ u(ar, {}),
|
|
2027
2027
|
width: 500,
|
|
2028
|
-
children: /* @__PURE__ */ w(
|
|
2028
|
+
children: /* @__PURE__ */ w(ne, { sx: { p: 2 }, children: [
|
|
2029
2029
|
!c && /* @__PURE__ */ w(
|
|
2030
2030
|
"div",
|
|
2031
2031
|
{
|
|
@@ -2038,18 +2038,18 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2038
2038
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
2039
2039
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
2040
2040
|
children: [
|
|
2041
|
-
/* @__PURE__ */ u(
|
|
2041
|
+
/* @__PURE__ */ u(Jt, { size: 16 }),
|
|
2042
2042
|
/* @__PURE__ */ u("span", { children: n.addStepTitle })
|
|
2043
2043
|
]
|
|
2044
2044
|
}
|
|
2045
2045
|
),
|
|
2046
2046
|
/* @__PURE__ */ u("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? n.chooseAction : `Pick an action from ${a.label}` }),
|
|
2047
|
-
/* @__PURE__ */ u("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(
|
|
2047
|
+
/* @__PURE__ */ u("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(_e, { children: [
|
|
2048
2048
|
i.map((f) => /* @__PURE__ */ w(
|
|
2049
2049
|
"div",
|
|
2050
2050
|
{
|
|
2051
|
-
className:
|
|
2052
|
-
style:
|
|
2051
|
+
className: Je,
|
|
2052
|
+
style: Xe,
|
|
2053
2053
|
onClick: () => d(f.key),
|
|
2054
2054
|
role: "button",
|
|
2055
2055
|
tabIndex: 0,
|
|
@@ -2068,7 +2068,7 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2068
2068
|
/* @__PURE__ */ u("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: f.label }),
|
|
2069
2069
|
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: f.description ?? `${f.descriptors.length} action${f.descriptors.length === 1 ? "" : "s"}` })
|
|
2070
2070
|
] }),
|
|
2071
|
-
/* @__PURE__ */ u(
|
|
2071
|
+
/* @__PURE__ */ u(Zt, { size: 18, color: "#9e9e9e" })
|
|
2072
2072
|
]
|
|
2073
2073
|
},
|
|
2074
2074
|
`app-${f.key}`
|
|
@@ -2076,8 +2076,8 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2076
2076
|
s.map((f) => /* @__PURE__ */ w(
|
|
2077
2077
|
"div",
|
|
2078
2078
|
{
|
|
2079
|
-
className:
|
|
2080
|
-
style:
|
|
2079
|
+
className: Je,
|
|
2080
|
+
style: Xe,
|
|
2081
2081
|
onClick: () => r(f),
|
|
2082
2082
|
role: "button",
|
|
2083
2083
|
tabIndex: 0,
|
|
@@ -2103,8 +2103,8 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2103
2103
|
a.descriptors.map((f) => /* @__PURE__ */ w(
|
|
2104
2104
|
"div",
|
|
2105
2105
|
{
|
|
2106
|
-
className:
|
|
2107
|
-
style:
|
|
2106
|
+
className: Je,
|
|
2107
|
+
style: Xe,
|
|
2108
2108
|
onClick: () => r(f),
|
|
2109
2109
|
role: "button",
|
|
2110
2110
|
tabIndex: 0,
|
|
@@ -2128,42 +2128,42 @@ const me = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i,
|
|
|
2128
2128
|
] })
|
|
2129
2129
|
}
|
|
2130
2130
|
);
|
|
2131
|
-
},
|
|
2132
|
-
function
|
|
2131
|
+
}, Kt = "_conditionConfig";
|
|
2132
|
+
function Ht(e) {
|
|
2133
2133
|
return Array.isArray(e) ? { layout: "flat", fields: e } : e && typeof e == "object" ? e : { layout: "flat", fields: [] };
|
|
2134
2134
|
}
|
|
2135
|
-
function
|
|
2135
|
+
function Ut(e) {
|
|
2136
2136
|
return e.layout === "stepper" ? Array.isArray(e.steps) && e.steps.some((t) => {
|
|
2137
2137
|
var n;
|
|
2138
2138
|
return ((n = t.fields) == null ? void 0 : n.length) > 0;
|
|
2139
2139
|
}) : Array.isArray(e.fields) && e.fields.length > 0;
|
|
2140
2140
|
}
|
|
2141
2141
|
const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o, onSave: i, onClose: s }) => {
|
|
2142
|
-
const [l, d] =
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
}, [r, t]),
|
|
2146
|
-
let
|
|
2142
|
+
const [l, d] = L({ layout: "flat", fields: [] }), [a, c] = L(!1), [f, h] = L(null), [g, E] = L({});
|
|
2143
|
+
se(() => {
|
|
2144
|
+
E((r == null ? void 0 : r[Kt]) ?? {});
|
|
2145
|
+
}, [r, t]), se(() => {
|
|
2146
|
+
let x = !1;
|
|
2147
2147
|
if (h(null), !n || !t || n.customPanel) {
|
|
2148
2148
|
d({ layout: "flat", fields: [] }), c(!1);
|
|
2149
2149
|
return;
|
|
2150
2150
|
}
|
|
2151
|
-
const
|
|
2152
|
-
return typeof
|
|
2153
|
-
|
|
2151
|
+
const O = n.formSchema;
|
|
2152
|
+
return typeof O == "function" ? (c(!0), O(t).then((z) => {
|
|
2153
|
+
x || (d(Ht(z)), c(!1));
|
|
2154
2154
|
}).catch((z) => {
|
|
2155
|
-
|
|
2156
|
-
})) : (d(
|
|
2157
|
-
|
|
2155
|
+
x || (d({ layout: "flat", fields: [] }), h(z instanceof Error ? z.message : "Unable to load configuration."), c(!1));
|
|
2156
|
+
})) : (d(Ht(O)), c(!1)), () => {
|
|
2157
|
+
x = !0;
|
|
2158
2158
|
};
|
|
2159
2159
|
}, [n, t]);
|
|
2160
|
-
const
|
|
2161
|
-
/* @__PURE__ */ u(
|
|
2160
|
+
const m = t ? `node-config-form-${t}` : "node-config-form", p = !a && !f && Ut(l), k = p ? /* @__PURE__ */ w(_e, { children: [
|
|
2161
|
+
/* @__PURE__ */ u(ze, { type: "button", variant: "text", size: "small", sx: { textTransform: "none", color: "#475569" }, onClick: s, children: o.cancel }),
|
|
2162
2162
|
/* @__PURE__ */ u(
|
|
2163
|
-
|
|
2163
|
+
ze,
|
|
2164
2164
|
{
|
|
2165
2165
|
type: "submit",
|
|
2166
|
-
form:
|
|
2166
|
+
form: m,
|
|
2167
2167
|
variant: "contained",
|
|
2168
2168
|
size: "small",
|
|
2169
2169
|
disableElevation: !0,
|
|
@@ -2178,38 +2178,38 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2178
2178
|
}
|
|
2179
2179
|
)
|
|
2180
2180
|
] }) : null;
|
|
2181
|
-
return n != null && n.customPanel && t ? /* @__PURE__ */ u(
|
|
2181
|
+
return n != null && n.customPanel && t ? /* @__PURE__ */ u(Ne, { isOpen: e, onClose: s, title: n.label ?? o.configureStep, icon: n.icon, width: 500, children: n.customPanel({
|
|
2182
2182
|
nodeId: t,
|
|
2183
2183
|
data: r ?? {},
|
|
2184
|
-
onSave: (
|
|
2185
|
-
i(t,
|
|
2184
|
+
onSave: (x) => {
|
|
2185
|
+
i(t, x), s();
|
|
2186
2186
|
},
|
|
2187
2187
|
onClose: s
|
|
2188
2188
|
}) }) : /* @__PURE__ */ u(
|
|
2189
|
-
|
|
2189
|
+
Ne,
|
|
2190
2190
|
{
|
|
2191
2191
|
isOpen: e,
|
|
2192
2192
|
onClose: s,
|
|
2193
2193
|
title: (n == null ? void 0 : n.label) ?? o.configureStep,
|
|
2194
2194
|
icon: n == null ? void 0 : n.icon,
|
|
2195
2195
|
width: 500,
|
|
2196
|
-
footer:
|
|
2197
|
-
children: /* @__PURE__ */ w(
|
|
2196
|
+
footer: k,
|
|
2197
|
+
children: /* @__PURE__ */ w(ne, { sx: { p: 2 }, children: [
|
|
2198
2198
|
a && /* @__PURE__ */ u("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
|
|
2199
2199
|
!a && f && /* @__PURE__ */ u("p", { style: { fontSize: 13, color: "#d32f2f" }, children: f }),
|
|
2200
|
-
!a && !f && !
|
|
2201
|
-
|
|
2200
|
+
!a && !f && !Ut(l) && /* @__PURE__ */ u("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
|
|
2201
|
+
p && /* @__PURE__ */ u(
|
|
2202
2202
|
xr,
|
|
2203
2203
|
{
|
|
2204
2204
|
schema: l,
|
|
2205
2205
|
initialValues: r ?? {},
|
|
2206
|
-
formId:
|
|
2206
|
+
formId: m,
|
|
2207
2207
|
conditionConfig: g,
|
|
2208
|
-
onConditionConfigChange:
|
|
2209
|
-
onSubmit: (
|
|
2208
|
+
onConditionConfigChange: E,
|
|
2209
|
+
onSubmit: (x) => {
|
|
2210
2210
|
if (!t) return;
|
|
2211
|
-
const
|
|
2212
|
-
i(t, { ...
|
|
2211
|
+
const O = Object.keys(g).length > 0;
|
|
2212
|
+
i(t, { ...x, [Kt]: O ? g : void 0 }), s();
|
|
2213
2213
|
}
|
|
2214
2214
|
}
|
|
2215
2215
|
)
|
|
@@ -2223,15 +2223,15 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2223
2223
|
workflowLabel: r,
|
|
2224
2224
|
onFetchWorkflow: o
|
|
2225
2225
|
}) => {
|
|
2226
|
-
const [i, s] =
|
|
2227
|
-
return
|
|
2226
|
+
const [i, s] = L({ status: "idle" });
|
|
2227
|
+
return se(() => {
|
|
2228
2228
|
if (!e || !n) {
|
|
2229
2229
|
s({ status: "idle" });
|
|
2230
2230
|
return;
|
|
2231
2231
|
}
|
|
2232
2232
|
s({ status: "loading" }), o(n).then((l) => s({ status: "loaded", state: l })).catch((l) => s({ status: "error", message: (l == null ? void 0 : l.message) ?? "Failed to load workflow" }));
|
|
2233
2233
|
}, [e, n, o]), /* @__PURE__ */ u(
|
|
2234
|
-
|
|
2234
|
+
Ne,
|
|
2235
2235
|
{
|
|
2236
2236
|
isOpen: e,
|
|
2237
2237
|
onClose: t,
|
|
@@ -2254,8 +2254,8 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2254
2254
|
}
|
|
2255
2255
|
);
|
|
2256
2256
|
}, ls = ({ state: e }) => {
|
|
2257
|
-
const [t, n] =
|
|
2258
|
-
return
|
|
2257
|
+
const [t, n] = L(null), [r, o] = L(null);
|
|
2258
|
+
return se(() => {
|
|
2259
2259
|
Promise.all([
|
|
2260
2260
|
Promise.resolve().then(() => hs).then((i) => i.default),
|
|
2261
2261
|
import("./nodeRegistry.js").then((i) => i.nodeTypeRegistry),
|
|
@@ -2272,7 +2272,7 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2272
2272
|
readOnly: !0
|
|
2273
2273
|
}
|
|
2274
2274
|
) });
|
|
2275
|
-
},
|
|
2275
|
+
}, Ce = 350, et = 70, tt = 60, nt = {
|
|
2276
2276
|
startNode: 40,
|
|
2277
2277
|
endNode: 40,
|
|
2278
2278
|
addTriggerNode: 56,
|
|
@@ -2285,11 +2285,11 @@ const is = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o,
|
|
|
2285
2285
|
}, as = {
|
|
2286
2286
|
plusEdge: Zn,
|
|
2287
2287
|
labelPlusEdge: Jn,
|
|
2288
|
-
plainEdge:
|
|
2289
|
-
edgeWithPlusLabel:
|
|
2288
|
+
plainEdge: Xn,
|
|
2289
|
+
edgeWithPlusLabel: qn,
|
|
2290
2290
|
gatewayBranchEdge: Vn
|
|
2291
2291
|
};
|
|
2292
|
-
function
|
|
2292
|
+
function Vt() {
|
|
2293
2293
|
return [
|
|
2294
2294
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2295
2295
|
{ id: "addTrigger", kind: "addTrigger", reactFlowType: "addTriggerNode" },
|
|
@@ -2297,61 +2297,74 @@ function Yt() {
|
|
|
2297
2297
|
];
|
|
2298
2298
|
}
|
|
2299
2299
|
function ds(e, t, n, r = "TB") {
|
|
2300
|
-
const o = new
|
|
2300
|
+
const o = new Yt.graphlib.Graph();
|
|
2301
2301
|
return o.setGraph({ rankdir: r, ranksep: 70, nodesep: 50 }), o.setDefaultEdgeLabel(() => ({})), e.forEach((i) => {
|
|
2302
|
-
const s = n[i.id] ?? { width:
|
|
2302
|
+
const s = n[i.id] ?? { width: Ce, height: nt[i.type ?? ""] ?? 80 };
|
|
2303
2303
|
o.setNode(i.id, { width: s.width, height: s.height });
|
|
2304
|
-
}), t.forEach((i) => o.setEdge(i.source, i.target)),
|
|
2304
|
+
}), t.forEach((i) => o.setEdge(i.source, i.target)), Yt.layout(o), e.map((i) => {
|
|
2305
2305
|
var a, c;
|
|
2306
|
-
const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ??
|
|
2306
|
+
const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ?? Ce, d = ((c = n[i.id]) == null ? void 0 : c.height) ?? nt[i.type ?? ""] ?? 80;
|
|
2307
2307
|
return { ...i, position: { x: s.x - l / 2, y: s.y - d / 2 } };
|
|
2308
2308
|
});
|
|
2309
2309
|
}
|
|
2310
|
-
const
|
|
2310
|
+
const fe = (e) => e === "filter" || e === "approval";
|
|
2311
2311
|
function cs(e, t, n, r) {
|
|
2312
|
-
const s =
|
|
2313
|
-
for (const
|
|
2314
|
-
for (const
|
|
2315
|
-
for (const
|
|
2316
|
-
for (const
|
|
2317
|
-
const h = (
|
|
2318
|
-
const
|
|
2319
|
-
return a[
|
|
2320
|
-
}, g = (
|
|
2321
|
-
let
|
|
2322
|
-
for (const z of
|
|
2323
|
-
|
|
2324
|
-
return
|
|
2325
|
-
},
|
|
2326
|
-
const
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
label: P[
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
height:
|
|
2312
|
+
const s = et, l = 30, d = 30, a = {}, c = {}, f = /* @__PURE__ */ new Map();
|
|
2313
|
+
for (const p of e) f.set(p.id, p);
|
|
2314
|
+
for (const p of Object.values(t))
|
|
2315
|
+
for (const k of Object.values(p))
|
|
2316
|
+
for (const x of k) f.set(x.id, x);
|
|
2317
|
+
const h = (p, k, x) => {
|
|
2318
|
+
const O = r[p] ?? { width: Ce, height: 80 };
|
|
2319
|
+
return a[p] = { x: k - O.width / 2, y: x }, x + O.height;
|
|
2320
|
+
}, g = (p, k, x) => {
|
|
2321
|
+
let O = x;
|
|
2322
|
+
for (const z of p)
|
|
2323
|
+
O = h(z.id, k, O) + s, fe(z.kind) && t[z.id] && (O = E(z.id, k, O));
|
|
2324
|
+
return O;
|
|
2325
|
+
}, E = (p, k, x) => {
|
|
2326
|
+
const O = k + 180, z = t[p], W = Object.keys(z), $ = f.get(p), P = ($ == null ? void 0 : $.branchLabels) ?? { pass: "Pass", fail: "Fail" }, M = a[p], V = r[p] ?? { height: 80 }, oe = M.y + V.height;
|
|
2327
|
+
if (($ == null ? void 0 : $.branchStyle) === "inline-gate") {
|
|
2328
|
+
const ie = [];
|
|
2329
|
+
let ee = M.y + V.height / 2;
|
|
2330
|
+
W.slice(1).forEach((ge) => {
|
|
2331
|
+
var Ie, we;
|
|
2332
|
+
ie.push({ y: ee - oe, label: P[ge] ?? ge, isPass: !1 });
|
|
2333
|
+
const Be = ee - (((we = r[(Ie = z[ge][0]) == null ? void 0 : Ie.id]) == null ? void 0 : we.height) ?? 50) / 2;
|
|
2334
|
+
ee = g(z[ge], O, Be) + l;
|
|
2335
|
+
});
|
|
2336
|
+
const he = g(z[W[0]], k, x);
|
|
2337
|
+
return c[p] = { branches: ie, height: Math.max(ee, he) - oe, indent: 180 }, Math.max(he, ee);
|
|
2338
|
+
}
|
|
2339
|
+
const le = [];
|
|
2340
|
+
let A = x;
|
|
2341
|
+
return W.forEach((ie, ve) => {
|
|
2342
|
+
const ee = z[ie], he = A;
|
|
2343
|
+
le.push({
|
|
2344
|
+
y: he - oe,
|
|
2345
|
+
label: P[ie] ?? ie,
|
|
2346
|
+
isPass: ve === 0
|
|
2347
|
+
}), A = g(ee, O, A + d), ve < W.length - 1 && (A += l);
|
|
2348
|
+
}), c[p] = {
|
|
2349
|
+
branches: le,
|
|
2350
|
+
height: A - oe,
|
|
2338
2351
|
indent: 180
|
|
2339
|
-
},
|
|
2352
|
+
}, A;
|
|
2340
2353
|
};
|
|
2341
|
-
let
|
|
2342
|
-
for (const
|
|
2343
|
-
|
|
2354
|
+
let m = tt;
|
|
2355
|
+
for (const p of e)
|
|
2356
|
+
m = h(p.id, 400, m) + s, fe(p.kind) && t[p.id] && (m = E(p.id, 400, m));
|
|
2344
2357
|
return {
|
|
2345
|
-
nodes: n.map((
|
|
2358
|
+
nodes: n.map((p) => a[p.id] ? { ...p, position: a[p.id] } : p),
|
|
2346
2359
|
railSpecs: c
|
|
2347
2360
|
};
|
|
2348
2361
|
}
|
|
2349
|
-
function
|
|
2362
|
+
function qt(e) {
|
|
2350
2363
|
return {
|
|
2351
2364
|
id: e.id,
|
|
2352
2365
|
type: e.reactFlowType,
|
|
2353
2366
|
position: { x: 0, y: 0 },
|
|
2354
|
-
data: { ...e.nodeData, ...e.formData, descriptorType: e.descriptorType },
|
|
2367
|
+
data: { ...e.nodeData, ...e.formData, descriptorType: e.descriptorType, branchStyle: e.branchStyle },
|
|
2355
2368
|
draggable: !1,
|
|
2356
2369
|
selectable: !1
|
|
2357
2370
|
};
|
|
@@ -2371,78 +2384,92 @@ function fs(e, t, n, r, o) {
|
|
|
2371
2384
|
};
|
|
2372
2385
|
}
|
|
2373
2386
|
function us(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
|
|
2374
|
-
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (
|
|
2375
|
-
const
|
|
2376
|
-
if (!
|
|
2377
|
-
const
|
|
2378
|
-
if (
|
|
2379
|
-
|
|
2380
|
-
id: `e-${
|
|
2381
|
-
source:
|
|
2382
|
-
|
|
2387
|
+
const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (m, p, k) => {
|
|
2388
|
+
const x = t[m];
|
|
2389
|
+
if (!x) return;
|
|
2390
|
+
const z = p ?? { pass: "Pass", fail: "Fail" }, W = Object.keys(x), $ = k === "inline-gate", P = (M, V, oe, le) => {
|
|
2391
|
+
if (M.length !== 0) {
|
|
2392
|
+
M.forEach((A) => d.push(qt(A))), $ && le === 0 ? a.push({
|
|
2393
|
+
id: `e-${m}-${V}-start`,
|
|
2394
|
+
source: m,
|
|
2395
|
+
sourceHandle: "pass",
|
|
2396
|
+
target: M[0].id,
|
|
2397
|
+
type: "plusEdge",
|
|
2398
|
+
style: { stroke: l },
|
|
2399
|
+
data: { onAddStepClick: n, referenceNodeType: "filterNode", filterId: m, branch: V }
|
|
2400
|
+
}) : a.push({
|
|
2401
|
+
id: `e-${m}-${V}-start`,
|
|
2402
|
+
source: m,
|
|
2403
|
+
// inline-gate Fail leaves the dedicated RIGHT handle so it routes out
|
|
2404
|
+
// to the side instead of tangling with the Pass edge at the bottom.
|
|
2405
|
+
...$ ? { sourceHandle: "fail" } : {},
|
|
2406
|
+
target: M[0].id,
|
|
2383
2407
|
type: "gatewayBranchEdge",
|
|
2384
2408
|
style: { stroke: l },
|
|
2385
|
-
data: { branch:
|
|
2409
|
+
data: { branch: V, filterId: m, label: oe, isFirst: le === 0, onAddStepClick: n, verticalRouting: s === "vertical" && !$, sideRouting: $ }
|
|
2386
2410
|
});
|
|
2387
|
-
for (let
|
|
2388
|
-
|
|
2389
|
-
for (const
|
|
2390
|
-
|
|
2411
|
+
for (let A = 1; A < M.length; A++)
|
|
2412
|
+
fe(M[A - 1].kind) || a.push(fs(M[A - 1], M[A], l, n, { filterId: m, branch: V }));
|
|
2413
|
+
for (const A of M)
|
|
2414
|
+
fe(A.kind) && t[A.id] && c(A.id, A.branchLabels, A.branchStyle);
|
|
2391
2415
|
}
|
|
2392
2416
|
};
|
|
2393
|
-
|
|
2394
|
-
|
|
2417
|
+
W.forEach((M, V) => {
|
|
2418
|
+
P(x[M], M, z[M] ?? M, V);
|
|
2395
2419
|
});
|
|
2396
2420
|
};
|
|
2397
|
-
for (let
|
|
2398
|
-
const
|
|
2399
|
-
if (d.push(
|
|
2400
|
-
const
|
|
2401
|
-
if (
|
|
2421
|
+
for (let m = 0; m < e.length; m++) {
|
|
2422
|
+
const p = e[m];
|
|
2423
|
+
if (d.push(qt(p)), m > 0) {
|
|
2424
|
+
const k = e[m - 1], x = k.kind === "start" || k.kind === "addTrigger";
|
|
2425
|
+
if (k.kind === "filter" || k.kind === "approval") continue;
|
|
2402
2426
|
a.push({
|
|
2403
|
-
id: `e-${
|
|
2404
|
-
source:
|
|
2405
|
-
target:
|
|
2427
|
+
id: `e-${k.id}-${p.id}`,
|
|
2428
|
+
source: k.id,
|
|
2429
|
+
target: p.id,
|
|
2406
2430
|
type: x ? "plainEdge" : "plusEdge",
|
|
2407
2431
|
style: { stroke: l },
|
|
2408
2432
|
data: x ? {} : {
|
|
2409
2433
|
onAddStepClick: n,
|
|
2410
|
-
referenceNodeType:
|
|
2434
|
+
referenceNodeType: k.reactFlowType
|
|
2411
2435
|
}
|
|
2412
2436
|
});
|
|
2413
2437
|
}
|
|
2414
|
-
(
|
|
2438
|
+
(p.kind === "filter" || p.kind === "approval") && t[p.id] && c(p.id, p.branchLabels, p.branchStyle);
|
|
2415
2439
|
}
|
|
2416
2440
|
const f = {};
|
|
2417
|
-
if (d.forEach((
|
|
2418
|
-
f[
|
|
2419
|
-
width:
|
|
2420
|
-
height: r[
|
|
2441
|
+
if (d.forEach((m) => {
|
|
2442
|
+
f[m.id] = {
|
|
2443
|
+
width: Ce,
|
|
2444
|
+
height: r[m.id] ?? nt[m.type ?? ""] ?? 80
|
|
2421
2445
|
};
|
|
2422
2446
|
}), !(Object.keys(t).length > 0)) {
|
|
2423
2447
|
if (i === "LR") {
|
|
2424
|
-
let
|
|
2425
|
-
return { nodes: d.map((
|
|
2426
|
-
const
|
|
2427
|
-
return
|
|
2448
|
+
let O = tt;
|
|
2449
|
+
return { nodes: d.map((W) => {
|
|
2450
|
+
const $ = f[W.id].width, P = f[W.id].height, M = { ...W, position: { x: O, y: 300 - P / 2 } };
|
|
2451
|
+
return O += $ + et, M;
|
|
2428
2452
|
}), edges: a };
|
|
2429
2453
|
}
|
|
2430
|
-
const
|
|
2431
|
-
let
|
|
2454
|
+
const m = 400;
|
|
2455
|
+
let p = tt;
|
|
2432
2456
|
return { nodes: d.map((x) => {
|
|
2433
|
-
const
|
|
2434
|
-
return
|
|
2457
|
+
const O = f[x.id].height, z = { ...x, position: { x: m - Ce / 2, y: p } };
|
|
2458
|
+
return p += O + et, z;
|
|
2435
2459
|
}), edges: a };
|
|
2436
2460
|
}
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2461
|
+
const g = e.some((m) => m.branchStyle === "inline-gate") || Object.values(t).some(
|
|
2462
|
+
(m) => Object.values(m).flat().some((p) => p.branchStyle === "inline-gate")
|
|
2463
|
+
);
|
|
2464
|
+
if (s === "vertical" || g) {
|
|
2465
|
+
const { nodes: m, railSpecs: p } = cs(e, t, d, f);
|
|
2466
|
+
return { nodes: m.map(
|
|
2467
|
+
(x) => p[x.id] ? { ...x, data: { ...x.data, _branchRail: p[x.id] } } : x
|
|
2441
2468
|
), edges: a };
|
|
2442
2469
|
}
|
|
2443
2470
|
return { nodes: ds(d, a, f, i), edges: a };
|
|
2444
2471
|
}
|
|
2445
|
-
const
|
|
2472
|
+
const Xt = ({
|
|
2446
2473
|
nodeRegistry: e,
|
|
2447
2474
|
templateRegistry: t,
|
|
2448
2475
|
initialValue: n,
|
|
@@ -2457,108 +2484,108 @@ const Ht = ({
|
|
|
2457
2484
|
loadTriggerSources: f,
|
|
2458
2485
|
renderNodePicker: h,
|
|
2459
2486
|
renderNodeConfig: g,
|
|
2460
|
-
onNodeClick:
|
|
2461
|
-
maxNodes:
|
|
2462
|
-
layoutDirection:
|
|
2463
|
-
executionRecord:
|
|
2464
|
-
onFetchWorkflow:
|
|
2465
|
-
hideHeader:
|
|
2487
|
+
onNodeClick: E,
|
|
2488
|
+
maxNodes: m,
|
|
2489
|
+
layoutDirection: p = "TB",
|
|
2490
|
+
executionRecord: k,
|
|
2491
|
+
onFetchWorkflow: x,
|
|
2492
|
+
hideHeader: O = !1,
|
|
2466
2493
|
workflowName: z,
|
|
2467
|
-
onWorkflowNameChange:
|
|
2494
|
+
onWorkflowNameChange: W,
|
|
2468
2495
|
onCancel: $,
|
|
2469
2496
|
workflowStatus: P,
|
|
2470
|
-
workflowStatusColor:
|
|
2471
|
-
saveLabel:
|
|
2472
|
-
optionsResolvers:
|
|
2497
|
+
workflowStatusColor: M,
|
|
2498
|
+
saveLabel: V,
|
|
2499
|
+
optionsResolvers: oe
|
|
2473
2500
|
}) => {
|
|
2474
2501
|
const {
|
|
2475
|
-
fitView:
|
|
2476
|
-
fitViewPadding:
|
|
2477
|
-
showControls:
|
|
2478
|
-
showMiniMap:
|
|
2479
|
-
panOnScroll:
|
|
2480
|
-
zoomOnScroll:
|
|
2481
|
-
minZoom:
|
|
2482
|
-
maxZoom:
|
|
2483
|
-
snapToGrid:
|
|
2484
|
-
snapGrid:
|
|
2485
|
-
branchLayout:
|
|
2486
|
-
nodeBody:
|
|
2487
|
-
} = a,
|
|
2488
|
-
const y = n == null ? void 0 : n.slots.find((
|
|
2502
|
+
fitView: le = !0,
|
|
2503
|
+
fitViewPadding: A = 0.3,
|
|
2504
|
+
showControls: ie = !0,
|
|
2505
|
+
showMiniMap: ve = !1,
|
|
2506
|
+
panOnScroll: ee = !0,
|
|
2507
|
+
zoomOnScroll: he = !1,
|
|
2508
|
+
minZoom: ge = 0.25,
|
|
2509
|
+
maxZoom: Be = 2,
|
|
2510
|
+
snapToGrid: dt = !1,
|
|
2511
|
+
snapGrid: Ie = [15, 15],
|
|
2512
|
+
branchLayout: we = "horizontal",
|
|
2513
|
+
nodeBody: ct = "full"
|
|
2514
|
+
} = a, Ee = U(() => _r(d), [d]), [R, ae] = L(() => (n == null ? void 0 : n.slots) ?? Vt()), [Y, te] = L(() => (n == null ? void 0 : n.branches) ?? {}), [pe, X] = L(null), [De, ft] = L(null), [J, Oe] = L(null), [de, ut] = L(null), [Me, ht] = L(null), [j, gt] = L(() => {
|
|
2515
|
+
const y = n == null ? void 0 : n.slots.find((S) => S.kind === "triggerFixed"), v = y != null && y.id.startsWith("trigger-") ? y.id.slice(8) : void 0;
|
|
2489
2516
|
return v ? t.lookup(v) ?? null : null;
|
|
2490
|
-
}), [
|
|
2517
|
+
}), [pt, Mn] = L({}), jn = H((y) => {
|
|
2491
2518
|
Mn(y);
|
|
2492
2519
|
}, []), zn = U(() => ({ ...Un, ...r }), [r]), Ln = U(() => ({ ...as, ...o }), [o]), Pn = U(() => {
|
|
2493
|
-
const y =
|
|
2520
|
+
const y = R.filter((S) => S.kind === "userTask").length, v = Object.values(Y).flatMap((S) => Object.values(S).flat()).filter((S) => S.kind === "userTask").length;
|
|
2494
2521
|
return y + v;
|
|
2495
|
-
}, [
|
|
2496
|
-
const v =
|
|
2522
|
+
}, [R, Y]), yt = m ?? (j == null ? void 0 : j.maxTasks), bt = yt !== void 0 && Pn >= yt, ce = H((y) => {
|
|
2523
|
+
const v = R.find((S) => S.id === y);
|
|
2497
2524
|
if (v) return v;
|
|
2498
|
-
for (const
|
|
2499
|
-
const
|
|
2500
|
-
if (
|
|
2525
|
+
for (const S of Object.values(Y)) {
|
|
2526
|
+
const C = Object.values(S).flat().find((T) => T.id === y);
|
|
2527
|
+
if (C) return C;
|
|
2501
2528
|
}
|
|
2502
2529
|
return null;
|
|
2503
|
-
}, [
|
|
2504
|
-
s || (
|
|
2505
|
-
}, [s]),
|
|
2530
|
+
}, [R, Y]), We = H((y) => {
|
|
2531
|
+
s || (ft(y), X("nodeConfig"));
|
|
2532
|
+
}, [s]), mt = H((y) => {
|
|
2506
2533
|
if (!s) {
|
|
2507
|
-
if (
|
|
2508
|
-
const v =
|
|
2534
|
+
if (R.some((v) => v.id === y)) {
|
|
2535
|
+
const v = R.find((S) => S.id === y);
|
|
2509
2536
|
if ((v == null ? void 0 : v.kind) === "triggerFixed") {
|
|
2510
|
-
|
|
2537
|
+
ae(Vt()), te({}), gt(null);
|
|
2511
2538
|
return;
|
|
2512
2539
|
}
|
|
2513
|
-
|
|
2514
|
-
const
|
|
2515
|
-
return
|
|
2516
|
-
}),
|
|
2517
|
-
const
|
|
2518
|
-
|
|
2540
|
+
ae((S) => {
|
|
2541
|
+
const C = S.filter((T) => T.id !== y);
|
|
2542
|
+
return fe((v == null ? void 0 : v.kind) ?? "") && !C.some((T) => T.kind === "end") ? [...C, { id: "end", kind: "end", reactFlowType: "endNode" }] : C;
|
|
2543
|
+
}), te((S) => {
|
|
2544
|
+
const C = { ...S }, T = (b) => {
|
|
2545
|
+
C[b] && (Object.values(C[b]).flat().filter((N) => fe(N.kind)).forEach((N) => T(N.id)), delete C[b]);
|
|
2519
2546
|
};
|
|
2520
|
-
return T(y),
|
|
2547
|
+
return T(y), C;
|
|
2521
2548
|
});
|
|
2522
2549
|
return;
|
|
2523
2550
|
}
|
|
2524
|
-
|
|
2525
|
-
const
|
|
2526
|
-
const
|
|
2527
|
-
for (const
|
|
2528
|
-
|
|
2529
|
-
return
|
|
2530
|
-
},
|
|
2531
|
-
for (const T of Object.keys(
|
|
2532
|
-
for (const
|
|
2533
|
-
const
|
|
2534
|
-
if (
|
|
2535
|
-
const I =
|
|
2536
|
-
let
|
|
2537
|
-
return I.kind === "filter" && ((I.id in
|
|
2551
|
+
te((v) => {
|
|
2552
|
+
const S = (T, b) => {
|
|
2553
|
+
const N = [];
|
|
2554
|
+
for (const _ of T)
|
|
2555
|
+
fe(_.kind) && b[_.id] && (N.push(_.id), Object.values(b[_.id]).forEach((I) => N.push(...S(I, b))));
|
|
2556
|
+
return N;
|
|
2557
|
+
}, C = { ...v };
|
|
2558
|
+
for (const T of Object.keys(C))
|
|
2559
|
+
for (const b of Object.keys(C[T])) {
|
|
2560
|
+
const N = C[T][b], _ = N.findIndex((F) => F.id === y);
|
|
2561
|
+
if (_ === -1 || N[_].kind === "end") continue;
|
|
2562
|
+
const I = N[_];
|
|
2563
|
+
let B = N.filter((F) => F.id !== y);
|
|
2564
|
+
return I.kind === "filter" && ((I.id in C ? S([I], C) : []).forEach((D) => delete C[D]), delete C[I.id], B.some((D) => D.kind === "end") || (B = [...B, { id: `end-${T}-${b}`, kind: "end", reactFlowType: "endNode" }])), C[T] = { ...C[T], [b]: B }, C;
|
|
2538
2565
|
}
|
|
2539
|
-
return
|
|
2566
|
+
return C;
|
|
2540
2567
|
});
|
|
2541
2568
|
}
|
|
2542
|
-
}, [s,
|
|
2569
|
+
}, [s, R]), $e = H(() => {
|
|
2543
2570
|
s || X("triggerSelect");
|
|
2544
|
-
}, [s]),
|
|
2545
|
-
s ||
|
|
2546
|
-
}, [s,
|
|
2547
|
-
if (
|
|
2548
|
-
const
|
|
2549
|
-
...
|
|
2571
|
+
}, [s]), vt = H((y, v) => {
|
|
2572
|
+
s || bt || (Oe(y), ut(v.filterId && v.branch ? { filterId: v.filterId, branch: v.branch } : null), X("nodePicker"));
|
|
2573
|
+
}, [s, bt]), wt = H((y, v) => {
|
|
2574
|
+
if (gt(y), X(null), y.skeletonState) {
|
|
2575
|
+
const C = Array.isArray(v) && v.length > 0, T = (y.skeletonState.slots ?? []).map((b) => b.kind !== "triggerFixed" ? b : {
|
|
2576
|
+
...b,
|
|
2550
2577
|
nodeData: {
|
|
2551
2578
|
label: y.label,
|
|
2552
|
-
...
|
|
2553
|
-
...
|
|
2579
|
+
...b.nodeData ?? {},
|
|
2580
|
+
...C && { sources: v }
|
|
2554
2581
|
}
|
|
2555
2582
|
});
|
|
2556
|
-
|
|
2583
|
+
te(y.skeletonState.branches ?? {}), ae(T);
|
|
2557
2584
|
return;
|
|
2558
2585
|
}
|
|
2559
|
-
|
|
2560
|
-
const
|
|
2561
|
-
|
|
2586
|
+
te({});
|
|
2587
|
+
const S = Array.isArray(v) && v.length > 0;
|
|
2588
|
+
ae([
|
|
2562
2589
|
{ id: "start", kind: "start", reactFlowType: "startNode" },
|
|
2563
2590
|
{
|
|
2564
2591
|
id: `trigger-${y.triggerKey}`,
|
|
@@ -2569,156 +2596,162 @@ const Ht = ({
|
|
|
2569
2596
|
source: y.source,
|
|
2570
2597
|
eventType: y.triggerKey,
|
|
2571
2598
|
type: y.triggerCategory === "scheduler" ? "scheduler" : "event",
|
|
2572
|
-
...
|
|
2599
|
+
...S && { sources: v }
|
|
2573
2600
|
},
|
|
2574
2601
|
deletable: !1
|
|
2575
2602
|
},
|
|
2576
2603
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2577
2604
|
]);
|
|
2578
|
-
}, []),
|
|
2579
|
-
var
|
|
2605
|
+
}, []), Et = H(() => {
|
|
2606
|
+
var S;
|
|
2580
2607
|
const y = {
|
|
2581
2608
|
insertAfterSlot: null,
|
|
2582
2609
|
upstreamSlots: [],
|
|
2583
2610
|
downstreamSlots: [],
|
|
2584
|
-
branch:
|
|
2585
|
-
template:
|
|
2611
|
+
branch: de,
|
|
2612
|
+
template: j
|
|
2586
2613
|
};
|
|
2587
|
-
if (!
|
|
2588
|
-
if (
|
|
2589
|
-
const { filterId:
|
|
2590
|
-
return y.upstreamSlots = [...
|
|
2614
|
+
if (!J) return y;
|
|
2615
|
+
if (de) {
|
|
2616
|
+
const { filterId: C, branch: T } = de, b = R.findIndex((F) => F.id === C), N = b >= 0 ? R.slice(0, b + 1) : [], _ = ((S = Y[C]) == null ? void 0 : S[T]) ?? [], I = _.findIndex((F) => F.id === J), B = I >= 0 ? _.slice(0, I + 1) : [];
|
|
2617
|
+
return y.upstreamSlots = [...N, ...B], y.downstreamSlots = I >= 0 ? _.slice(I + 1) : _, y.insertAfterSlot = B[B.length - 1] ?? null, y;
|
|
2591
2618
|
}
|
|
2592
|
-
const v =
|
|
2593
|
-
return y.upstreamSlots = v >= 0 ?
|
|
2594
|
-
}, [
|
|
2595
|
-
const y = e.list(), v =
|
|
2596
|
-
...
|
|
2597
|
-
...Object.values(Y).flatMap((
|
|
2598
|
-
], T = (
|
|
2599
|
-
return v.filter((
|
|
2600
|
-
(
|
|
2601
|
-
) ||
|
|
2602
|
-
(
|
|
2619
|
+
const v = R.findIndex((C) => C.id === J);
|
|
2620
|
+
return y.upstreamSlots = v >= 0 ? R.slice(0, v + 1) : [], y.downstreamSlots = v >= 0 ? R.slice(v + 1) : [], y.insertAfterSlot = y.upstreamSlots[y.upstreamSlots.length - 1] ?? null, y;
|
|
2621
|
+
}, [R, Y, J, de, j]), Ge = (y, v) => y.descriptorType === v || y.id === v || y.kind === v, xt = H(() => {
|
|
2622
|
+
const y = e.list(), v = j != null && j.availableTasks ? y.filter((b) => j.availableTasks.includes(b.type)) : y, S = Et(), C = [
|
|
2623
|
+
...R,
|
|
2624
|
+
...Object.values(Y).flatMap((b) => Object.values(b).flat())
|
|
2625
|
+
], T = (b) => C.some((N) => b.some((_) => Ge(N, _)));
|
|
2626
|
+
return v.filter((b) => b.maxPerWorkflow !== void 0 && R.filter((_) => _.descriptorType === b.type).length + Object.values(Y).flatMap((_) => Object.values(_).flat()).filter((_) => _.descriptorType === b.type).length >= b.maxPerWorkflow ? !1 : b.canInsert ? b.canInsert(S) : !(b.insertAfter && b.insertAfter.length > 0 && T(b.insertAfter) && !S.upstreamSlots.some(
|
|
2627
|
+
(_) => b.insertAfter.some((I) => Ge(_, I))
|
|
2628
|
+
) || b.insertBefore && b.insertBefore.length > 0 && T(b.insertBefore) && !S.downstreamSlots.some(
|
|
2629
|
+
(_) => b.insertBefore.some((I) => Ge(_, I))
|
|
2603
2630
|
)));
|
|
2604
|
-
}, [e,
|
|
2605
|
-
if (!
|
|
2606
|
-
const v = `${y.type}-${Date.now()}`,
|
|
2631
|
+
}, [e, j, R, Y, Et]), kt = H((y) => {
|
|
2632
|
+
if (!J) return;
|
|
2633
|
+
const v = `${y.type}-${Date.now()}`, S = y.reactFlowType === "filterNode" || y.reactFlowType === "approvalNode" || y.reactFlowType === "conditionBranchNode", C = y.branchLabels ?? { pass: "Pass", fail: "Fail" }, T = {
|
|
2607
2634
|
id: v,
|
|
2608
|
-
kind:
|
|
2635
|
+
kind: S ? y.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
|
|
2609
2636
|
reactFlowType: y.reactFlowType,
|
|
2610
2637
|
descriptorType: y.type,
|
|
2611
2638
|
formData: {},
|
|
2612
2639
|
nodeData: { title: y.label },
|
|
2613
2640
|
deletable: !0,
|
|
2614
|
-
branchLabels:
|
|
2641
|
+
branchLabels: C,
|
|
2642
|
+
...y.branchStyle ? { branchStyle: y.branchStyle } : {}
|
|
2615
2643
|
};
|
|
2616
|
-
if (
|
|
2617
|
-
const { filterId:
|
|
2618
|
-
|
|
2619
|
-
const I = [...
|
|
2620
|
-
if (
|
|
2621
|
-
const
|
|
2622
|
-
return
|
|
2623
|
-
...
|
|
2624
|
-
[
|
|
2644
|
+
if (de) {
|
|
2645
|
+
const { filterId: b, branch: N } = de;
|
|
2646
|
+
te((_) => {
|
|
2647
|
+
const I = [..._[b][N]];
|
|
2648
|
+
if (S) {
|
|
2649
|
+
const Z = I.filter((ye) => ye.kind !== "end"), xe = Z.findIndex((ye) => ye.id === J), Dn = xe === -1 ? Z.length : xe + 1;
|
|
2650
|
+
return Z.splice(Dn, 0, T), {
|
|
2651
|
+
..._,
|
|
2652
|
+
[b]: { ..._[b], [N]: Z },
|
|
2625
2653
|
[v]: Object.fromEntries(
|
|
2626
|
-
Object.keys(
|
|
2654
|
+
Object.keys(C).map((ye) => [ye, [{ id: `end-${v}-${ye}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2627
2655
|
)
|
|
2628
2656
|
};
|
|
2629
2657
|
}
|
|
2630
|
-
const
|
|
2631
|
-
return I.splice(
|
|
2658
|
+
const B = I.findIndex((Z) => Z.id === J), F = I.findIndex((Z) => Z.kind === "end"), D = B === -1 ? F === -1 ? I.length : F : B + 1;
|
|
2659
|
+
return I.splice(D, 0, T), { ..._, [b]: { ..._[b], [N]: I } };
|
|
2632
2660
|
});
|
|
2633
|
-
} else
|
|
2634
|
-
_
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
...
|
|
2661
|
+
} else if (S) {
|
|
2662
|
+
const b = y.branchStyle === "inline-gate", N = R.filter((F) => F.kind !== "end"), _ = N.findIndex((F) => F.id === J), I = _ >= 0 ? N.slice(_ + 1) : [];
|
|
2663
|
+
ae(() => [...N.slice(0, _ + 1), T]);
|
|
2664
|
+
const B = Object.keys(C);
|
|
2665
|
+
te((F) => ({
|
|
2666
|
+
...F,
|
|
2639
2667
|
[v]: Object.fromEntries(
|
|
2640
|
-
|
|
2668
|
+
B.map((D, Z) => {
|
|
2669
|
+
const xe = { id: `end-${v}-${D}`, kind: "end", reactFlowType: "endNode" };
|
|
2670
|
+
return b && Z === 0 && I.length > 0 ? [D, [...I, xe]] : [D, [xe]];
|
|
2671
|
+
})
|
|
2641
2672
|
)
|
|
2642
|
-
}))
|
|
2643
|
-
|
|
2644
|
-
|
|
2673
|
+
}));
|
|
2674
|
+
} else
|
|
2675
|
+
ae((b) => {
|
|
2676
|
+
const N = b.findIndex((_) => _.id === J);
|
|
2677
|
+
return N === -1 ? b : [...b.slice(0, N + 1), T, ...b.slice(N + 1)];
|
|
2645
2678
|
});
|
|
2646
|
-
|
|
2647
|
-
}, [
|
|
2648
|
-
const
|
|
2649
|
-
const
|
|
2650
|
-
switch (
|
|
2679
|
+
Oe(null), ut(null), ft(v), X("nodeConfig");
|
|
2680
|
+
}, [J, de]), _t = H((y, v) => {
|
|
2681
|
+
const S = (b) => {
|
|
2682
|
+
const N = b.label || b.key;
|
|
2683
|
+
switch (b.kind) {
|
|
2651
2684
|
case "if":
|
|
2652
|
-
return `IF · ${
|
|
2685
|
+
return `IF · ${N}`;
|
|
2653
2686
|
case "elseif":
|
|
2654
|
-
return `ELSE IF · ${
|
|
2687
|
+
return `ELSE IF · ${N}`;
|
|
2655
2688
|
case "else":
|
|
2656
|
-
return
|
|
2689
|
+
return N.toUpperCase() === "ELSE" ? N : `ELSE · ${N}`;
|
|
2657
2690
|
default:
|
|
2658
|
-
return
|
|
2691
|
+
return N;
|
|
2659
2692
|
}
|
|
2660
|
-
},
|
|
2661
|
-
const
|
|
2662
|
-
if ((
|
|
2663
|
-
const I = (v.branchConfigs ?? []).map((
|
|
2664
|
-
if (I.length === 0) return
|
|
2665
|
-
const
|
|
2666
|
-
return I.forEach((
|
|
2667
|
-
|
|
2668
|
-
}), { ...
|
|
2669
|
-
}, T = (
|
|
2670
|
-
if (
|
|
2671
|
-
const
|
|
2672
|
-
return
|
|
2673
|
-
|
|
2674
|
-
}), { ...
|
|
2693
|
+
}, C = (b) => {
|
|
2694
|
+
const N = ce(y);
|
|
2695
|
+
if ((N == null ? void 0 : N.descriptorType) !== "conditionBranch") return b;
|
|
2696
|
+
const I = (v.branchConfigs ?? []).map((D) => D.key).filter(Boolean);
|
|
2697
|
+
if (I.length === 0) return b;
|
|
2698
|
+
const B = b[y] ?? {}, F = {};
|
|
2699
|
+
return I.forEach((D) => {
|
|
2700
|
+
F[D] = B[D] ?? [{ id: `end-${y}-${D}`, kind: "end", reactFlowType: "endNode" }];
|
|
2701
|
+
}), { ...b, [y]: F };
|
|
2702
|
+
}, T = (b, N) => {
|
|
2703
|
+
if (b.descriptorType !== "conditionBranch") return { ...b, formData: N };
|
|
2704
|
+
const _ = N.branchConfigs ?? [], I = {};
|
|
2705
|
+
return _.forEach((B) => {
|
|
2706
|
+
B.key && (I[B.key] = S(B));
|
|
2707
|
+
}), { ...b, formData: N, branchLabels: I };
|
|
2675
2708
|
};
|
|
2676
|
-
if (
|
|
2677
|
-
|
|
2678
|
-
const
|
|
2679
|
-
return
|
|
2680
|
-
(
|
|
2709
|
+
if (R.some((b) => b.id === y)) {
|
|
2710
|
+
te((b) => {
|
|
2711
|
+
const N = C(b);
|
|
2712
|
+
return ae(
|
|
2713
|
+
(_) => _.map(
|
|
2681
2714
|
(I) => I.id === y ? T(I, v) : I
|
|
2682
2715
|
)
|
|
2683
|
-
),
|
|
2716
|
+
), N;
|
|
2684
2717
|
});
|
|
2685
2718
|
return;
|
|
2686
2719
|
}
|
|
2687
|
-
|
|
2688
|
-
const
|
|
2689
|
-
for (const I of Object.keys(
|
|
2690
|
-
const
|
|
2691
|
-
for (const
|
|
2692
|
-
if (
|
|
2693
|
-
return
|
|
2720
|
+
te((b) => {
|
|
2721
|
+
const _ = { ...C(b) };
|
|
2722
|
+
for (const I of Object.keys(_)) {
|
|
2723
|
+
const B = (F) => F.map((D) => D.id === y ? T(D, v) : D);
|
|
2724
|
+
for (const F of Object.keys(_[I]))
|
|
2725
|
+
if (_[I][F].some((D) => D.id === y))
|
|
2726
|
+
return _[I] = { ..._[I], [F]: B(_[I][F]) }, _;
|
|
2694
2727
|
}
|
|
2695
|
-
return
|
|
2728
|
+
return _;
|
|
2696
2729
|
});
|
|
2697
|
-
}, [
|
|
2730
|
+
}, [R, Y, ce]), K = U(() => ce(De ?? ""), [ce, De]), St = U(() => {
|
|
2698
2731
|
if ((K == null ? void 0 : K.kind) === "triggerFixed") {
|
|
2699
|
-
const y = (
|
|
2700
|
-
if (
|
|
2732
|
+
const y = (j == null ? void 0 : j.triggerCategory) === "scheduler", v = (j == null ? void 0 : j.triggerConfigTitle) ?? (y ? "Scheduler" : j == null ? void 0 : j.label) ?? "Trigger", S = j == null ? void 0 : j.triggerCustomPanel;
|
|
2733
|
+
if (S)
|
|
2701
2734
|
return {
|
|
2702
2735
|
type: K.id,
|
|
2703
2736
|
label: v,
|
|
2704
|
-
icon:
|
|
2737
|
+
icon: j == null ? void 0 : j.icon,
|
|
2705
2738
|
reactFlowType: "triggerNode",
|
|
2706
2739
|
formSchema: [],
|
|
2707
|
-
customPanel: ({ nodeId: T, data:
|
|
2740
|
+
customPanel: ({ nodeId: T, data: b, onSave: N, onClose: _ }) => S({ data: b, onSave: N, onClose: _ }),
|
|
2708
2741
|
matches: () => !1,
|
|
2709
2742
|
bpmnEntry: (T) => T,
|
|
2710
2743
|
bpmnExit: (T) => T,
|
|
2711
2744
|
emitBpmnElements: () => []
|
|
2712
2745
|
};
|
|
2713
|
-
const
|
|
2714
|
-
return Array.isArray(
|
|
2746
|
+
const C = j == null ? void 0 : j.triggerConfigSchema;
|
|
2747
|
+
return Array.isArray(C) && C.length > 0 ? {
|
|
2715
2748
|
type: K.id,
|
|
2716
2749
|
// Title the config by what it IS (a scheduler), not the workflow name
|
|
2717
2750
|
// (which would read as "Identify Dormant Account").
|
|
2718
2751
|
label: v,
|
|
2719
|
-
icon:
|
|
2752
|
+
icon: j == null ? void 0 : j.icon,
|
|
2720
2753
|
reactFlowType: "triggerNode",
|
|
2721
|
-
formSchema:
|
|
2754
|
+
formSchema: C,
|
|
2722
2755
|
matches: () => !1,
|
|
2723
2756
|
bpmnEntry: (T) => T,
|
|
2724
2757
|
bpmnExit: (T) => T,
|
|
@@ -2726,27 +2759,27 @@ const Ht = ({
|
|
|
2726
2759
|
} : null;
|
|
2727
2760
|
}
|
|
2728
2761
|
return K != null && K.descriptorType ? e.forType(K.descriptorType) ?? null : null;
|
|
2729
|
-
}, [K, e,
|
|
2730
|
-
() => us(
|
|
2731
|
-
[
|
|
2732
|
-
),
|
|
2733
|
-
const y =
|
|
2734
|
-
return
|
|
2735
|
-
let
|
|
2762
|
+
}, [K, e, j]), { nodes: Nt, edges: Fn } = U(
|
|
2763
|
+
() => us(R, Y, s ? null : vt, pt, l, p, we),
|
|
2764
|
+
[R, Y, s, vt, pt, l, p, we]
|
|
2765
|
+
), Ct = U(() => {
|
|
2766
|
+
const y = k ? new Map(k.steps.map((v) => [v.nodeId, v])) : null;
|
|
2767
|
+
return Nt.map((v) => {
|
|
2768
|
+
let S = {};
|
|
2736
2769
|
if (y) {
|
|
2737
|
-
const
|
|
2738
|
-
|
|
2770
|
+
const C = y.get(v.id);
|
|
2771
|
+
C && (S = { _executionStatus: C.status, _executionError: C.error });
|
|
2739
2772
|
}
|
|
2740
|
-
return v.type === "subWorkflowNode" &&
|
|
2741
|
-
var
|
|
2742
|
-
const T =
|
|
2743
|
-
|
|
2744
|
-
}), Object.keys(
|
|
2773
|
+
return v.type === "subWorkflowNode" && x && (S.onPreview = (C) => {
|
|
2774
|
+
var b;
|
|
2775
|
+
const T = ce(v.id);
|
|
2776
|
+
ht({ workflowId: C, workflowLabel: ((b = T == null ? void 0 : T.formData) == null ? void 0 : b.workflowLabel) ?? void 0 });
|
|
2777
|
+
}), Object.keys(S).length > 0 ? { ...v, data: { ...v.data, ...S } } : v;
|
|
2745
2778
|
});
|
|
2746
|
-
}, [
|
|
2747
|
-
}, onClickAddTrigger:
|
|
2748
|
-
i && await i({ slots:
|
|
2749
|
-
}, [i,
|
|
2779
|
+
}, [Nt, k, x, ce]), Rn = U(() => ({ onEditNode: We, onDeleteNode: mt, onAddStep: () => {
|
|
2780
|
+
}, onClickAddTrigger: $e, messages: Ee, nodeRegistry: e, nodeBody: ct, activeTemplate: j }), [We, mt, $e, Ee, e, ct, j]), An = H(async () => {
|
|
2781
|
+
i && await i({ slots: R, branches: Y });
|
|
2782
|
+
}, [i, R, Y]), Bn = U(() => Sr({
|
|
2750
2783
|
palette: {
|
|
2751
2784
|
primary: { main: l.primaryColor ?? "#1976d2" },
|
|
2752
2785
|
secondary: { main: l.secondaryColor ?? "#9c27b0" },
|
|
@@ -2758,7 +2791,7 @@ const Ht = ({
|
|
|
2758
2791
|
shape: { borderRadius: l.borderRadius ?? 6 },
|
|
2759
2792
|
typography: l.fontFamily ? { fontFamily: l.fontFamily } : {}
|
|
2760
2793
|
}), [l]);
|
|
2761
|
-
return /* @__PURE__ */ u(Nr, { theme: Bn, children: /* @__PURE__ */ u(kr, { resolvers:
|
|
2794
|
+
return /* @__PURE__ */ u(Nr, { theme: Bn, children: /* @__PURE__ */ u(kr, { resolvers: oe, children: /* @__PURE__ */ u(Qn.Provider, { value: Rn, children: /* @__PURE__ */ w(
|
|
2762
2795
|
"div",
|
|
2763
2796
|
{
|
|
2764
2797
|
className: "flowforge-canvas",
|
|
@@ -2780,40 +2813,40 @@ const Ht = ({
|
|
|
2780
2813
|
"--ff-font-family": l.fontFamily
|
|
2781
2814
|
},
|
|
2782
2815
|
children: [
|
|
2783
|
-
!
|
|
2816
|
+
!O && (i || $ || z) && /* @__PURE__ */ u(
|
|
2784
2817
|
ns,
|
|
2785
2818
|
{
|
|
2786
2819
|
workflowName: z,
|
|
2787
|
-
onWorkflowNameChange:
|
|
2820
|
+
onWorkflowNameChange: W,
|
|
2788
2821
|
status: P,
|
|
2789
|
-
statusColor:
|
|
2822
|
+
statusColor: M,
|
|
2790
2823
|
onSave: i ? An : void 0,
|
|
2791
2824
|
onCancel: $,
|
|
2792
|
-
saveLabel:
|
|
2825
|
+
saveLabel: V
|
|
2793
2826
|
}
|
|
2794
2827
|
),
|
|
2795
2828
|
/* @__PURE__ */ w("div", { style: { flex: 1, minHeight: 0, position: "relative" }, children: [
|
|
2796
2829
|
/* @__PURE__ */ w(
|
|
2797
2830
|
Wn,
|
|
2798
2831
|
{
|
|
2799
|
-
nodes:
|
|
2832
|
+
nodes: Ct,
|
|
2800
2833
|
edges: Fn,
|
|
2801
2834
|
nodeTypes: zn,
|
|
2802
2835
|
edgeTypes: Ln,
|
|
2803
|
-
fitView:
|
|
2804
|
-
fitViewOptions: { padding:
|
|
2836
|
+
fitView: le,
|
|
2837
|
+
fitViewOptions: { padding: A },
|
|
2805
2838
|
nodesDraggable: !1,
|
|
2806
2839
|
nodesConnectable: !1,
|
|
2807
|
-
panOnScroll:
|
|
2808
|
-
zoomOnScroll:
|
|
2809
|
-
minZoom:
|
|
2810
|
-
maxZoom:
|
|
2811
|
-
snapToGrid:
|
|
2812
|
-
snapGrid:
|
|
2840
|
+
panOnScroll: ee,
|
|
2841
|
+
zoomOnScroll: he,
|
|
2842
|
+
minZoom: ge,
|
|
2843
|
+
maxZoom: Be,
|
|
2844
|
+
snapToGrid: dt,
|
|
2845
|
+
snapGrid: Ie,
|
|
2813
2846
|
proOptions: { hideAttribution: !0 },
|
|
2814
2847
|
onNodeClick: (y, v) => {
|
|
2815
|
-
const
|
|
2816
|
-
|
|
2848
|
+
const S = ce(v.id);
|
|
2849
|
+
S && (E != null && E(S) || (S.kind === "addTrigger" || S.kind === "triggerFixed" ? $e() : (S.kind === "userTask" || S.kind === "filter" || S.kind === "approval") && We(v.id)));
|
|
2817
2850
|
},
|
|
2818
2851
|
children: [
|
|
2819
2852
|
l.background !== "none" && /* @__PURE__ */ u(
|
|
@@ -2824,27 +2857,27 @@ const Ht = ({
|
|
|
2824
2857
|
gap: 20
|
|
2825
2858
|
}
|
|
2826
2859
|
),
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
/* @__PURE__ */ u(es, { onHeightsReady: jn, nodeCount:
|
|
2860
|
+
ie && /* @__PURE__ */ u(Kn, { showInteractive: !1 }),
|
|
2861
|
+
ve && /* @__PURE__ */ u(Hn, { zoomable: !0, pannable: !0 }),
|
|
2862
|
+
/* @__PURE__ */ u(es, { onHeightsReady: jn, nodeCount: Ct.length })
|
|
2830
2863
|
]
|
|
2831
2864
|
}
|
|
2832
2865
|
),
|
|
2833
|
-
c ?
|
|
2834
|
-
h ?
|
|
2835
|
-
X(null),
|
|
2836
|
-
}) : /* @__PURE__ */ u(os, { open:
|
|
2837
|
-
X(null),
|
|
2866
|
+
c ? pe === "triggerSelect" && c(t.list(), wt, () => X(null)) : /* @__PURE__ */ u(rs, { open: pe === "triggerSelect", templates: t.list(), messages: Ee, onSelect: wt, onClose: () => X(null), loadTriggerSources: f }),
|
|
2867
|
+
h ? pe === "nodePicker" && h(xt(), kt, () => {
|
|
2868
|
+
X(null), Oe(null);
|
|
2869
|
+
}) : /* @__PURE__ */ u(os, { open: pe === "nodePicker", availableDescriptors: xt(), messages: Ee, onSelect: kt, onClose: () => {
|
|
2870
|
+
X(null), Oe(null);
|
|
2838
2871
|
} }),
|
|
2839
|
-
g ?
|
|
2840
|
-
|
|
2872
|
+
g ? pe === "nodeConfig" && g(St ?? void 0, K, _t, () => X(null)) : /* @__PURE__ */ u(is, { open: pe === "nodeConfig", nodeId: De, descriptor: St, initialValues: K == null ? void 0 : K.formData, messages: Ee, onSave: _t, onClose: () => X(null) }),
|
|
2873
|
+
x && Me && /* @__PURE__ */ u(
|
|
2841
2874
|
ss,
|
|
2842
2875
|
{
|
|
2843
|
-
isOpen: !!
|
|
2844
|
-
onClose: () =>
|
|
2845
|
-
workflowId:
|
|
2846
|
-
workflowLabel:
|
|
2847
|
-
onFetchWorkflow:
|
|
2876
|
+
isOpen: !!Me,
|
|
2877
|
+
onClose: () => ht(null),
|
|
2878
|
+
workflowId: Me.workflowId,
|
|
2879
|
+
workflowLabel: Me.workflowLabel,
|
|
2880
|
+
onFetchWorkflow: x
|
|
2848
2881
|
}
|
|
2849
2882
|
)
|
|
2850
2883
|
] })
|
|
@@ -2853,9 +2886,9 @@ const Ht = ({
|
|
|
2853
2886
|
) }) }) });
|
|
2854
2887
|
}, hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2855
2888
|
__proto__: null,
|
|
2856
|
-
WorkflowCanvas:
|
|
2857
|
-
default:
|
|
2858
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2889
|
+
WorkflowCanvas: Xt,
|
|
2890
|
+
default: Xt
|
|
2891
|
+
}, Symbol.toStringTag, { value: "Module" })), Ze = "All";
|
|
2859
2892
|
function gs({ template: e, onSelect: t }) {
|
|
2860
2893
|
var o, i;
|
|
2861
2894
|
const n = e.triggerCategory ? Cr[e.triggerCategory] : null, r = ((o = e.skeletonState) == null ? void 0 : o.slots.filter((s) => s.kind === "userTask").length) ?? 0;
|
|
@@ -2916,19 +2949,19 @@ const js = ({
|
|
|
2916
2949
|
onSelectTemplate: t,
|
|
2917
2950
|
onStartFromScratch: n
|
|
2918
2951
|
}) => {
|
|
2919
|
-
const [r, o] =
|
|
2952
|
+
const [r, o] = L(""), [i, s] = L(Ze), l = U(() => {
|
|
2920
2953
|
const a = /* @__PURE__ */ new Set();
|
|
2921
2954
|
return e.forEach((c) => {
|
|
2922
2955
|
c.category && a.add(c.category);
|
|
2923
|
-
}), [
|
|
2956
|
+
}), [Ze, ...Array.from(a)];
|
|
2924
2957
|
}, [e]), d = U(() => {
|
|
2925
2958
|
let a = e;
|
|
2926
|
-
if (i !==
|
|
2959
|
+
if (i !== Ze && (a = a.filter((c) => c.category === i)), r.trim()) {
|
|
2927
2960
|
const c = r.toLowerCase();
|
|
2928
2961
|
a = a.filter(
|
|
2929
2962
|
(f) => {
|
|
2930
2963
|
var h, g;
|
|
2931
|
-
return f.label.toLowerCase().includes(c) || ((h = f.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = f.tags) == null ? void 0 : g.some((
|
|
2964
|
+
return f.label.toLowerCase().includes(c) || ((h = f.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = f.tags) == null ? void 0 : g.some((E) => E.toLowerCase().includes(c)));
|
|
2932
2965
|
}
|
|
2933
2966
|
);
|
|
2934
2967
|
}
|
|
@@ -2990,26 +3023,26 @@ const js = ({
|
|
|
2990
3023
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
|
|
2991
3024
|
] }) : /* @__PURE__ */ u("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: d.map((a) => /* @__PURE__ */ u(gs, { template: a, onSelect: () => t(a) }, a.triggerKey)) }) })
|
|
2992
3025
|
] });
|
|
2993
|
-
},
|
|
2994
|
-
running: { label: "Running", color:
|
|
2995
|
-
success: { label: "Success", color:
|
|
2996
|
-
failed: { label: "Failed", color:
|
|
2997
|
-
cancelled: { label: "Cancelled", color:
|
|
3026
|
+
}, je = {
|
|
3027
|
+
running: { label: "Running", color: re.running, icon: G.createElement(nn, { size: 14 }) },
|
|
3028
|
+
success: { label: "Success", color: re.success, icon: G.createElement(tn, { size: 14 }) },
|
|
3029
|
+
failed: { label: "Failed", color: re.failed, icon: G.createElement(en, { size: 14 }) },
|
|
3030
|
+
cancelled: { label: "Cancelled", color: re.cancelled, icon: G.createElement(Qt, { size: 14 }) }
|
|
2998
3031
|
}, ps = {
|
|
2999
|
-
pending: { color:
|
|
3000
|
-
running: { color:
|
|
3001
|
-
success: { color:
|
|
3002
|
-
failed: { color:
|
|
3003
|
-
skipped: { color:
|
|
3032
|
+
pending: { color: re.pending, icon: G.createElement(gr, { size: 14 }) },
|
|
3033
|
+
running: { color: re.running, icon: G.createElement(nn, { size: 14 }) },
|
|
3034
|
+
success: { color: re.success, icon: G.createElement(tn, { size: 14 }) },
|
|
3035
|
+
failed: { color: re.failed, icon: G.createElement(en, { size: 14 }) },
|
|
3036
|
+
skipped: { color: re.skipped, icon: G.createElement(Qt, { size: 14 }) }
|
|
3004
3037
|
};
|
|
3005
|
-
function
|
|
3038
|
+
function rt(e) {
|
|
3006
3039
|
try {
|
|
3007
3040
|
return new Date(e).toLocaleString();
|
|
3008
3041
|
} catch {
|
|
3009
3042
|
return e;
|
|
3010
3043
|
}
|
|
3011
3044
|
}
|
|
3012
|
-
function
|
|
3045
|
+
function On(e, t) {
|
|
3013
3046
|
try {
|
|
3014
3047
|
const n = new Date(t ?? (/* @__PURE__ */ new Date()).toISOString()).getTime() - new Date(e).getTime();
|
|
3015
3048
|
return n < 1e3 ? `${n}ms` : n < 6e4 ? `${(n / 1e3).toFixed(1)}s` : `${Math.floor(n / 6e4)}m ${Math.floor(n % 6e4 / 1e3)}s`;
|
|
@@ -3018,7 +3051,7 @@ function Nn(e, t) {
|
|
|
3018
3051
|
}
|
|
3019
3052
|
}
|
|
3020
3053
|
function ys({ step: e }) {
|
|
3021
|
-
const [t, n] =
|
|
3054
|
+
const [t, n] = L(!1), r = ps[e.status], o = !!(e.inputs || e.outputs || e.error);
|
|
3022
3055
|
return /* @__PURE__ */ w("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
|
|
3023
3056
|
/* @__PURE__ */ w(
|
|
3024
3057
|
"div",
|
|
@@ -3033,11 +3066,11 @@ function ys({ step: e }) {
|
|
|
3033
3066
|
o && (i.key === "Enter" || i.key === " ") && n((s) => !s);
|
|
3034
3067
|
},
|
|
3035
3068
|
children: [
|
|
3036
|
-
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children:
|
|
3069
|
+
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children: G.cloneElement(r.icon, { color: r.color }) }),
|
|
3037
3070
|
/* @__PURE__ */ u("span", { style: { flex: 1, fontSize: 13, color: "#212121" }, children: e.label || e.nodeId }),
|
|
3038
3071
|
e.branchTaken && /* @__PURE__ */ u("span", { style: { fontSize: 10, padding: "1px 6px", borderRadius: 10, background: "#e3f2fd", color: "#1565c0", fontWeight: 600 }, children: e.branchTaken }),
|
|
3039
|
-
/* @__PURE__ */ u("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ?
|
|
3040
|
-
o && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ?
|
|
3072
|
+
/* @__PURE__ */ u("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ? On(e.startedAt, e.completedAt) : "—" }),
|
|
3073
|
+
o && /* @__PURE__ */ u("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ? G.createElement(yr, { size: 16 }) : G.createElement(br, { size: 16 }) })
|
|
3041
3074
|
]
|
|
3042
3075
|
}
|
|
3043
3076
|
),
|
|
@@ -3055,7 +3088,7 @@ function ys({ step: e }) {
|
|
|
3055
3088
|
] });
|
|
3056
3089
|
}
|
|
3057
3090
|
function bs({ record: e, selected: t, onSelect: n }) {
|
|
3058
|
-
const r =
|
|
3091
|
+
const r = je[e.status];
|
|
3059
3092
|
return /* @__PURE__ */ w(
|
|
3060
3093
|
"div",
|
|
3061
3094
|
{
|
|
@@ -3076,9 +3109,9 @@ function bs({ record: e, selected: t, onSelect: n }) {
|
|
|
3076
3109
|
outline: "none"
|
|
3077
3110
|
},
|
|
3078
3111
|
children: [
|
|
3079
|
-
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children:
|
|
3112
|
+
/* @__PURE__ */ u("span", { style: { color: r.color, flexShrink: 0 }, children: G.cloneElement(r.icon, { color: r.color, size: 16 }) }),
|
|
3080
3113
|
/* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3081
|
-
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children:
|
|
3114
|
+
/* @__PURE__ */ u("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: rt(e.triggeredAt) }),
|
|
3082
3115
|
/* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
|
|
3083
3116
|
e.triggeredBy ? `by ${e.triggeredBy}` : "System",
|
|
3084
3117
|
" · ",
|
|
@@ -3088,16 +3121,16 @@ function bs({ record: e, selected: t, onSelect: n }) {
|
|
|
3088
3121
|
] })
|
|
3089
3122
|
] }),
|
|
3090
3123
|
/* @__PURE__ */ u("span", { style: { fontSize: 11, fontWeight: 600, color: r.color, flexShrink: 0 }, children: r.label }),
|
|
3091
|
-
/* @__PURE__ */ u(
|
|
3124
|
+
/* @__PURE__ */ u(Zt, { size: 14, color: "#bdbdbd" })
|
|
3092
3125
|
]
|
|
3093
3126
|
}
|
|
3094
3127
|
);
|
|
3095
3128
|
}
|
|
3096
3129
|
const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
3097
3130
|
var s;
|
|
3098
|
-
const [n, r] =
|
|
3131
|
+
const [n, r] = L(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === n) ?? null, i = [...e].sort((l, d) => new Date(d.triggeredAt).getTime() - new Date(l.triggeredAt).getTime());
|
|
3099
3132
|
return e.length === 0 ? /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
|
|
3100
|
-
/* @__PURE__ */ u(
|
|
3133
|
+
/* @__PURE__ */ u(Ot, { size: 36 }),
|
|
3101
3134
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
|
|
3102
3135
|
/* @__PURE__ */ u("p", { style: { margin: 0, fontSize: 12 }, children: "Run history will appear here" })
|
|
3103
3136
|
] }) : /* @__PURE__ */ w("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
|
|
@@ -3113,15 +3146,15 @@ const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
3113
3146
|
/* @__PURE__ */ w("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
|
|
3114
3147
|
/* @__PURE__ */ w("div", { children: [
|
|
3115
3148
|
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
3116
|
-
|
|
3117
|
-
/* @__PURE__ */ u("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children:
|
|
3149
|
+
G.cloneElement(je[o.status].icon, { color: je[o.status].color, size: 18 }),
|
|
3150
|
+
/* @__PURE__ */ u("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children: je[o.status].label })
|
|
3118
3151
|
] }),
|
|
3119
3152
|
/* @__PURE__ */ w("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
3120
3153
|
/* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3121
|
-
/* @__PURE__ */ u(
|
|
3154
|
+
/* @__PURE__ */ u(Ot, { size: 13 }),
|
|
3122
3155
|
" ",
|
|
3123
|
-
|
|
3124
|
-
o.completedAt && ` → ${
|
|
3156
|
+
rt(o.triggeredAt),
|
|
3157
|
+
o.completedAt && ` → ${rt(o.completedAt)} (${On(o.triggeredAt, o.completedAt)})`
|
|
3125
3158
|
] }),
|
|
3126
3159
|
o.triggeredBy && /* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3127
3160
|
/* @__PURE__ */ u(pr, { size: 13 }),
|
|
@@ -3156,10 +3189,10 @@ const zs = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
3156
3189
|
] });
|
|
3157
3190
|
};
|
|
3158
3191
|
export {
|
|
3159
|
-
|
|
3192
|
+
Xt as F,
|
|
3160
3193
|
ss as S,
|
|
3161
3194
|
zs as W,
|
|
3162
3195
|
ns as a,
|
|
3163
3196
|
js as b
|
|
3164
3197
|
};
|
|
3165
|
-
//# sourceMappingURL=WorkflowExecutionHistory-
|
|
3198
|
+
//# sourceMappingURL=WorkflowExecutionHistory-BBeVPYVc.js.map
|