@notmrabhi/flowforge 0.1.17 → 0.1.19

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.
@@ -1,14 +1,14 @@
1
- import { jsxs as w, jsx as f, Fragment as ye } from "react/jsx-runtime";
1
+ import { jsxs as v, jsx as f, Fragment as ye } from "react/jsx-runtime";
2
2
  import G, { useRef as vt, useEffect as re, useState as M, useCallback as $, useMemo as Y } from "react";
3
- import In, { useStore as On, useReactFlow as Mn, Background as jn, Controls as zn, MiniMap as Fn } from "reactflow";
3
+ import In, { useStore as On, useReactFlow as Mn, Background as jn, Controls as Fn, MiniMap as zn } from "reactflow";
4
4
  import "reactflow/dist/style.css";
5
- import { e as An, G as Dn, E as Ln, P as Rn, L as Pn, d as Bn, f as Wn } from "./GatewayBranchEdge-4XMPBHne.js";
5
+ import { e as Ln, G as An, E as Dn, P as Rn, L as Pn, d as Bn, f as Wn } from "./GatewayBranchEdge-4XMPBHne.js";
6
6
  import { Dialog as Gn, Box as Q, Drawer as $n, IconButton as Et, Button as Ne, CircularProgress as Yn } from "@mui/material";
7
7
  import Kn from "react-select";
8
8
  import { MdClose as Un, MdCalendarToday as Vn, MdBolt as Hn, MdArrowBack as Wt, MdChevronRight as Gt, MdAddCircleOutline as qn, MdApps as Xn, MdErrorOutline as Jn, MdAccountTree as Zn, MdAdd as Qn, MdSearch as er, MdCategory as tr, MdCancel as $t, MdError as Yt, MdCheckCircle as Kt, MdPlayArrow as Ut, MdHourglassEmpty as nr, MdSchedule as kt, MdPerson as rr, MdExpandLess as or, MdExpandMore as ir } from "react-icons/md";
9
9
  import { GrTrigger as sr } from "react-icons/gr";
10
10
  import { BiCollapse as lr, BiExpand as ar } from "react-icons/bi";
11
- import { j as dr, b as cr } from "./index-CxVqPygT.js";
11
+ import { j as dr, b as cr } from "./index-BU09HbVh.js";
12
12
  import { m as ur } from "./messages-CO299wPN.js";
13
13
  import { T as fr, E as ee } from "./canvasTokens-CAD6G24b.js";
14
14
  var Vt = Object.defineProperty, hr = (e, t, n) => t in e ? Vt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, gr = (e, t) => {
@@ -158,7 +158,7 @@ var br = Object.defineProperty, qt = (e, t) => {
158
158
  return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[a] = c, xt(this._preds[i], o), xt(this._sucs[o], i), this._in[i][a] = c, this._out[o][a] = c, this._edgeCount++, this;
159
159
  }
160
160
  edge(e, t, n) {
161
- let r = arguments.length === 1 ? De(this._isDirected, e) : be(this._isDirected, e, t, n);
161
+ let r = arguments.length === 1 ? Ae(this._isDirected, e) : be(this._isDirected, e, t, n);
162
162
  return this._edgeLabels[r];
163
163
  }
164
164
  edgeAsObj(e, t, n) {
@@ -166,10 +166,10 @@ var br = Object.defineProperty, qt = (e, t) => {
166
166
  return typeof r != "object" ? { label: r } : r;
167
167
  }
168
168
  hasEdge(e, t, n) {
169
- return (arguments.length === 1 ? De(this._isDirected, e) : be(this._isDirected, e, t, n)) in this._edgeLabels;
169
+ return (arguments.length === 1 ? Ae(this._isDirected, e) : be(this._isDirected, e, t, n)) in this._edgeLabels;
170
170
  }
171
171
  removeEdge(e, t, n) {
172
- let r = arguments.length === 1 ? De(this._isDirected, e) : be(this._isDirected, e, t, n), o = this._edgeObjs[r];
172
+ let r = arguments.length === 1 ? Ae(this._isDirected, e) : be(this._isDirected, e, t, n), o = this._edgeObjs[r];
173
173
  if (o) {
174
174
  let i = o.v, s = o.w;
175
175
  delete this._edgeLabels[r], delete this._edgeObjs[r], Tt(this._preds[s], i), Tt(this._sucs[i], s), delete this._in[s][r], delete this._out[i][r], this._edgeCount--;
@@ -217,7 +217,7 @@ function yr(e, t, n, r) {
217
217
  let s = { v: o, w: i };
218
218
  return r && (s.name = r), s;
219
219
  }
220
- function De(e, t) {
220
+ function Ae(e, t) {
221
221
  return be(e, t.v, t.w, t.name);
222
222
  }
223
223
  var mr = "4.0.1", Xt = {};
@@ -247,7 +247,7 @@ function kr(e) {
247
247
  }), t;
248
248
  }
249
249
  var Xe = {};
250
- qt(Xe, { CycleException: () => Ce, bellmanFord: () => Jt, components: () => _r, dijkstra: () => Se, dijkstraAll: () => Cr, findCycles: () => Ir, floydWarshall: () => Mr, isAcyclic: () => zr, postorder: () => Ar, preorder: () => Dr, prim: () => Lr, shortestPaths: () => Rr, tarjan: () => Qt, topsort: () => en });
250
+ qt(Xe, { CycleException: () => Ce, bellmanFord: () => Jt, components: () => _r, dijkstra: () => Se, dijkstraAll: () => Cr, findCycles: () => Ir, floydWarshall: () => Mr, isAcyclic: () => Fr, postorder: () => Lr, preorder: () => Ar, prim: () => Dr, shortestPaths: () => Rr, tarjan: () => Qt, topsort: () => en });
251
251
  var xr = () => 1;
252
252
  function Jt(e, t, n, r) {
253
253
  return Tr(e, String(t), n || xr, r || function(o) {
@@ -424,7 +424,7 @@ function en(e) {
424
424
  if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new Ce();
425
425
  return r;
426
426
  }
427
- function zr(e) {
427
+ function Fr(e) {
428
428
  try {
429
429
  en(e);
430
430
  } catch (t) {
@@ -433,7 +433,7 @@ function zr(e) {
433
433
  }
434
434
  return !0;
435
435
  }
436
- function Fr(e, t, n, r, o) {
436
+ function zr(e, t, n, r, o) {
437
437
  Array.isArray(t) || (t = [t]);
438
438
  let i = (l) => {
439
439
  var d;
@@ -450,17 +450,17 @@ function tn(e, t, n, r, o, i, s) {
450
450
  }), n && (s = i(s, t))), s;
451
451
  }
452
452
  function nn(e, t, n) {
453
- return Fr(e, t, n, function(r, o) {
453
+ return zr(e, t, n, function(r, o) {
454
454
  return r.push(o), r;
455
455
  }, []);
456
456
  }
457
- function Ar(e, t) {
457
+ function Lr(e, t) {
458
458
  return nn(e, t, "post");
459
459
  }
460
- function Dr(e, t) {
460
+ function Ar(e, t) {
461
461
  return nn(e, t, "pre");
462
462
  }
463
- function Lr(e, t) {
463
+ function Dr(e, t) {
464
464
  let n = new K(), r = {}, o = new Zt(), i;
465
465
  function s(d) {
466
466
  let a = d.v === i ? d.w : d.v, c = o.priority(a);
@@ -661,18 +661,18 @@ function Qr(e, t, n) {
661
661
  var r;
662
662
  let o = [], i = t[t.length - 1], s = t[0], l;
663
663
  for (; e.nodeCount(); ) {
664
- for (; l = s.dequeue(); ) Le(e, t, n, l);
665
- for (; l = i.dequeue(); ) Le(e, t, n, l);
664
+ for (; l = s.dequeue(); ) De(e, t, n, l);
665
+ for (; l = i.dequeue(); ) De(e, t, n, l);
666
666
  if (e.nodeCount()) {
667
667
  for (let d = t.length - 2; d > 0; --d) if (l = (r = t[d]) == null ? void 0 : r.dequeue(), l) {
668
- o = o.concat(Le(e, t, n, l, !0) || []);
668
+ o = o.concat(De(e, t, n, l, !0) || []);
669
669
  break;
670
670
  }
671
671
  }
672
672
  }
673
673
  return o;
674
674
  }
675
- function Le(e, t, n, r, o) {
675
+ function De(e, t, n, r, o) {
676
676
  let i = [], s = o ? i : void 0;
677
677
  return (e.inEdges(r.v) || []).forEach((l) => {
678
678
  let d = e.edge(l), a = e.node(l.v);
@@ -950,8 +950,8 @@ function pn(e, t, n, r, o, i, s) {
950
950
  e.setParent(a, s), u.borderTop = a, e.setParent(c, s), u.borderBottom = c, d.forEach((h) => {
951
951
  var g;
952
952
  pn(e, t, n, r, o, i, h);
953
- let p = e.node(h), v = p.borderTop ? p.borderTop : h, y = p.borderBottom ? p.borderBottom : h, k = p.borderTop ? r : 2 * r, S = v !== y ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
954
- e.setEdge(a, v, { weight: k, minlen: S, nestingEdge: !0 }), e.setEdge(y, c, { weight: k, minlen: S, nestingEdge: !0 });
953
+ let p = e.node(h), E = p.borderTop ? p.borderTop : h, y = p.borderBottom ? p.borderBottom : h, x = p.borderTop ? r : 2 * r, N = E !== y ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
954
+ e.setEdge(a, E, { weight: x, minlen: N, nestingEdge: !0 }), e.setEdge(y, c, { weight: x, minlen: N, nestingEdge: !0 });
955
955
  }), e.parent(s) || e.setEdge(t, a, { weight: 0, minlen: o + ((l = i[s]) != null ? l : 0) });
956
956
  }
957
957
  function Co(e) {
@@ -986,15 +986,15 @@ function Ot(e, t, n, r, o, i) {
986
986
  let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], d = ge(e, "border", s, n);
987
987
  o[t][i] = d, e.setParent(d, r), l && e.setEdge(l, d, { weight: 1 });
988
988
  }
989
- function zo(e) {
989
+ function Fo(e) {
990
990
  var t;
991
991
  let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
992
992
  (n === "lr" || n === "rl") && bn(e);
993
993
  }
994
- function Fo(e) {
994
+ function zo(e) {
995
995
  var t;
996
996
  let n = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
997
- (n === "bt" || n === "rl") && Ao(e), (n === "lr" || n === "rl") && (Do(e), bn(e));
997
+ (n === "bt" || n === "rl") && Lo(e), (n === "lr" || n === "rl") && (Ao(e), bn(e));
998
998
  }
999
999
  function bn(e) {
1000
1000
  e.nodes().forEach((t) => Mt(e.node(t))), e.edges().forEach((t) => Mt(e.edge(t)));
@@ -1003,7 +1003,7 @@ function Mt(e) {
1003
1003
  let t = e.width;
1004
1004
  e.width = e.height, e.height = t;
1005
1005
  }
1006
- function Ao(e) {
1006
+ function Lo(e) {
1007
1007
  e.nodes().forEach((t) => Re(e.node(t))), e.edges().forEach((t) => {
1008
1008
  var n;
1009
1009
  let r = e.edge(t);
@@ -1013,7 +1013,7 @@ function Ao(e) {
1013
1013
  function Re(e) {
1014
1014
  e.y = -e.y;
1015
1015
  }
1016
- function Do(e) {
1016
+ function Ao(e) {
1017
1017
  e.nodes().forEach((t) => Pe(e.node(t))), e.edges().forEach((t) => {
1018
1018
  var n;
1019
1019
  let r = e.edge(t);
@@ -1024,7 +1024,7 @@ function Pe(e) {
1024
1024
  let t = e.x;
1025
1025
  e.x = e.y, e.y = t;
1026
1026
  }
1027
- function Lo(e) {
1027
+ function Do(e) {
1028
1028
  let t = {}, n = e.nodes().filter((l) => !e.children(l).length), r = n.map((l) => e.node(l).rank), o = X(Math.max, r), i = me(o + 1).map(() => []);
1029
1029
  function s(l) {
1030
1030
  if (t[l]) return;
@@ -1138,8 +1138,8 @@ function yn(e, t, n, r) {
1138
1138
  u.vs = [s, u.vs, l].flat(1);
1139
1139
  let h = e.predecessors(s);
1140
1140
  if (h && h.length) {
1141
- let g = e.node(h[0]), p = e.predecessors(l), v = e.node(p[0]);
1142
- Object.hasOwn(u, "barycenter") || (u.barycenter = 0, u.weight = 0), u.barycenter = (u.barycenter * u.weight + g.order + v.order) / (u.weight + 2), u.weight += 2;
1141
+ let g = e.node(h[0]), p = e.predecessors(l), E = e.node(p[0]);
1142
+ Object.hasOwn(u, "barycenter") || (u.barycenter = 0, u.weight = 0), u.barycenter = (u.barycenter * u.weight + g.order + E.order) / (u.weight + 2), u.weight += 2;
1143
1143
  }
1144
1144
  }
1145
1145
  return u;
@@ -1190,17 +1190,17 @@ function mn(e, t = {}) {
1190
1190
  t.customOrder(e, mn);
1191
1191
  return;
1192
1192
  }
1193
- let n = sn(e), r = zt(e, me(1, n + 1), "inEdges"), o = zt(e, me(n - 1, -1, -1), "outEdges"), i = Lo(e);
1194
- if (Ft(e, i), t.disableOptimalOrderHeuristic) return;
1193
+ let n = sn(e), r = Ft(e, me(1, n + 1), "inEdges"), o = Ft(e, me(n - 1, -1, -1), "outEdges"), i = Do(e);
1194
+ if (zt(e, i), t.disableOptimalOrderHeuristic) return;
1195
1195
  let s = Number.POSITIVE_INFINITY, l, d = t.constraints || [];
1196
1196
  for (let a = 0, c = 0; c < 4; ++a, ++c) {
1197
1197
  Jo(a % 2 ? r : o, a % 4 >= 2, d), i = ve(e);
1198
1198
  let u = Ro(e, i);
1199
1199
  u < s ? (c = 0, l = Object.assign({}, i), s = u) : u === s && (l = structuredClone(i));
1200
1200
  }
1201
- Ft(e, l);
1201
+ zt(e, l);
1202
1202
  }
1203
- function zt(e, t, n) {
1203
+ function Ft(e, t, n) {
1204
1204
  let r = /* @__PURE__ */ new Map(), o = (i, s) => {
1205
1205
  r.has(i) || r.set(i, []), r.get(i).push(s);
1206
1206
  };
@@ -1220,7 +1220,7 @@ function Jo(e, t, n) {
1220
1220
  s.vs.forEach((l, d) => o.node(l).order = d), Xo(o, r, s.vs);
1221
1221
  });
1222
1222
  }
1223
- function Ft(e, t) {
1223
+ function zt(e, t) {
1224
1224
  Object.values(t).forEach((n) => n.forEach((r, o) => e.node(r).order = o));
1225
1225
  }
1226
1226
  function Zo(e, t) {
@@ -1230,10 +1230,10 @@ function Zo(e, t) {
1230
1230
  return i.forEach((c, u) => {
1231
1231
  let h = ei(e, c), g = h ? e.node(h).order : d;
1232
1232
  (h || c === a) && (i.slice(l, u + 1).forEach((p) => {
1233
- let v = e.predecessors(p);
1234
- v && v.forEach((y) => {
1235
- let k = e.node(y), S = k.order;
1236
- (S < s || g < S) && !(k.dummy && e.node(p).dummy) && wn(n, y, p);
1233
+ let E = e.predecessors(p);
1234
+ E && E.forEach((y) => {
1235
+ let x = e.node(y), N = x.order;
1236
+ (N < s || g < N) && !(x.dummy && e.node(p).dummy) && wn(n, y, p);
1237
1237
  });
1238
1238
  }), l = u + 1, s = g);
1239
1239
  }), i;
@@ -1305,16 +1305,16 @@ function ni(e, t, n, r) {
1305
1305
  let c = r(a);
1306
1306
  if (c && c.length) {
1307
1307
  let u = c.sort((g, p) => {
1308
- let v = s[g], y = s[p];
1309
- return (v !== void 0 ? v : 0) - (y !== void 0 ? y : 0);
1308
+ let E = s[g], y = s[p];
1309
+ return (E !== void 0 ? E : 0) - (y !== void 0 ? y : 0);
1310
1310
  }), h = (u.length - 1) / 2;
1311
1311
  for (let g = Math.floor(h), p = Math.ceil(h); g <= p; ++g) {
1312
- let v = u[g];
1313
- if (v === void 0) continue;
1314
- let y = s[v];
1315
- if (y !== void 0 && i[a] === a && d < y && !ti(n, a, v)) {
1316
- let k = o[v];
1317
- k !== void 0 && (i[v] = a, i[a] = o[a] = k, d = y);
1312
+ let E = u[g];
1313
+ if (E === void 0) continue;
1314
+ let y = s[E];
1315
+ if (y !== void 0 && i[a] === a && d < y && !ti(n, a, E)) {
1316
+ let x = o[E];
1317
+ x !== void 0 && (i[E] = a, i[a] = o[a] = x, d = y);
1318
1318
  }
1319
1319
  }
1320
1320
  }
@@ -1324,32 +1324,32 @@ function ni(e, t, n, r) {
1324
1324
  function ri(e, t, n, r, o = !1) {
1325
1325
  let i = {}, s = oi(e, t, n, o), l = o ? "borderLeft" : "borderRight";
1326
1326
  function d(g, p) {
1327
- let v = s.nodes().slice(), y = {}, k = v.pop();
1328
- for (; k; ) {
1329
- if (y[k]) g(k);
1327
+ let E = s.nodes().slice(), y = {}, x = E.pop();
1328
+ for (; x; ) {
1329
+ if (y[x]) g(x);
1330
1330
  else {
1331
- y[k] = !0, v.push(k);
1332
- for (let S of p(k)) v.push(S);
1331
+ y[x] = !0, E.push(x);
1332
+ for (let N of p(x)) E.push(N);
1333
1333
  }
1334
- k = v.pop();
1334
+ x = E.pop();
1335
1335
  }
1336
1336
  }
1337
1337
  function a(g) {
1338
1338
  let p = s.inEdges(g);
1339
- p ? i[g] = p.reduce((v, y) => {
1340
- var k;
1341
- let S = (k = i[y.v]) != null ? k : 0, O = s.edge(y);
1342
- return Math.max(v, S + (O !== void 0 ? O : 0));
1339
+ p ? i[g] = p.reduce((E, y) => {
1340
+ var x;
1341
+ let N = (x = i[y.v]) != null ? x : 0, O = s.edge(y);
1342
+ return Math.max(E, N + (O !== void 0 ? O : 0));
1343
1343
  }, 0) : i[g] = 0;
1344
1344
  }
1345
1345
  function c(g) {
1346
- let p = s.outEdges(g), v = Number.POSITIVE_INFINITY;
1347
- p && (v = p.reduce((k, S) => {
1348
- let O = i[S.w], z = s.edge(S);
1349
- return Math.min(k, (O !== void 0 ? O : 0) - (z !== void 0 ? z : 0));
1346
+ let p = s.outEdges(g), E = Number.POSITIVE_INFINITY;
1347
+ p && (E = p.reduce((x, N) => {
1348
+ let O = i[N.w], F = s.edge(N);
1349
+ return Math.min(x, (O !== void 0 ? O : 0) - (F !== void 0 ? F : 0));
1350
1350
  }, Number.POSITIVE_INFINITY));
1351
1351
  let y = e.node(g);
1352
- v !== Number.POSITIVE_INFINITY && y.borderType !== l && (i[g] = Math.max(i[g] !== void 0 ? i[g] : 0, v));
1352
+ E !== Number.POSITIVE_INFINITY && y.borderType !== l && (i[g] = Math.max(i[g] !== void 0 ? i[g] : 0, E));
1353
1353
  }
1354
1354
  function u(g) {
1355
1355
  return s.predecessors(g) || [];
@@ -1359,8 +1359,8 @@ function ri(e, t, n, r, o = !1) {
1359
1359
  }
1360
1360
  return d(a, u), d(c, h), Object.keys(r).forEach((g) => {
1361
1361
  var p;
1362
- let v = n[g];
1363
- v !== void 0 && (i[g] = (p = i[v]) != null ? p : 0);
1362
+ let E = n[g];
1363
+ E !== void 0 && (i[g] = (p = i[E]) != null ? p : 0);
1364
1364
  }), i;
1365
1365
  }
1366
1366
  function oi(e, t, n, r) {
@@ -1481,7 +1481,7 @@ function hi(e, t = {}) {
1481
1481
  });
1482
1482
  }
1483
1483
  function gi(e, t, n) {
1484
- t(" makeSpaceForEdgeLabels", () => Ti(e)), t(" removeSelfEdges", () => zi(e)), t(" acyclic", () => no(e)), t(" nestingGraph.run", () => So(e)), t(" rank", () => wo(rn(e))), t(" injectEdgeLabelProxies", () => _i(e)), t(" removeEmptyRanks", () => Gr(e)), t(" nestingGraph.cleanup", () => Oo(e)), t(" normalizeRanks", () => Wr(e)), t(" assignRankMinMax", () => Ni(e)), t(" removeEdgeLabelProxies", () => Si(e)), t(" normalize.run", () => io(e)), t(" parentDummyChains", () => xo(e)), t(" addBorderSegments", () => Mo(e)), t(" order", () => mn(e, n)), t(" insertSelfEdges", () => Fi(e)), t(" adjustCoordinateSystem", () => zo(e)), t(" position", () => ui(e)), t(" positionSelfEdges", () => Ai(e)), t(" removeBorderNodes", () => ji(e)), t(" normalize.undo", () => lo(e)), t(" fixupEdgeLabelCoords", () => Oi(e)), t(" undoCoordinateSystem", () => Fo(e)), t(" translateGraph", () => Ci(e)), t(" assignNodeIntersects", () => Ii(e)), t(" reversePoints", () => Mi(e)), t(" acyclic.undo", () => oo(e));
1484
+ t(" makeSpaceForEdgeLabels", () => Ti(e)), t(" removeSelfEdges", () => Fi(e)), t(" acyclic", () => no(e)), t(" nestingGraph.run", () => So(e)), t(" rank", () => wo(rn(e))), t(" injectEdgeLabelProxies", () => _i(e)), t(" removeEmptyRanks", () => Gr(e)), t(" nestingGraph.cleanup", () => Oo(e)), t(" normalizeRanks", () => Wr(e)), t(" assignRankMinMax", () => Ni(e)), t(" removeEdgeLabelProxies", () => Si(e)), t(" normalize.run", () => io(e)), t(" parentDummyChains", () => xo(e)), t(" addBorderSegments", () => Mo(e)), t(" order", () => mn(e, n)), t(" insertSelfEdges", () => zi(e)), t(" adjustCoordinateSystem", () => Fo(e)), t(" position", () => ui(e)), t(" positionSelfEdges", () => Li(e)), t(" removeBorderNodes", () => ji(e)), t(" normalize.undo", () => lo(e)), t(" fixupEdgeLabelCoords", () => Oi(e)), t(" undoCoordinateSystem", () => zo(e)), t(" translateGraph", () => Ci(e)), t(" assignNodeIntersects", () => Ii(e)), t(" reversePoints", () => Mi(e)), t(" acyclic.undo", () => oo(e));
1485
1485
  }
1486
1486
  function pi(e, t) {
1487
1487
  e.nodes().forEach((n) => {
@@ -1492,13 +1492,13 @@ function pi(e, t) {
1492
1492
  r.points = o.points, Object.hasOwn(o, "x") && (r.x = o.x, r.y = o.y);
1493
1493
  }), e.graph().width = t.graph().width, e.graph().height = t.graph().height;
1494
1494
  }
1495
- var bi = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], yi = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, mi = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], wi = ["width", "height", "rank"], At = { width: 0, height: 0 }, vi = ["minlen", "weight", "width", "height", "labeloffset"], Ei = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, ki = ["labelpos"];
1495
+ var bi = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], yi = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, mi = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], wi = ["width", "height", "rank"], Lt = { width: 0, height: 0 }, vi = ["minlen", "weight", "width", "height", "labeloffset"], Ei = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, ki = ["labelpos"];
1496
1496
  function xi(e) {
1497
1497
  let t = new K({ multigraph: !0, compound: !0 }), n = We(e.graph());
1498
1498
  return t.setGraph(Object.assign({}, yi, Be(n, bi), Ie(n, mi))), e.nodes().forEach((r) => {
1499
1499
  let o = We(e.node(r)), i = Be(o, wi);
1500
- Object.keys(At).forEach((l) => {
1501
- i[l] === void 0 && (i[l] = At[l]);
1500
+ Object.keys(Lt).forEach((l) => {
1501
+ i[l] === void 0 && (i[l] = Lt[l]);
1502
1502
  }), t.setNode(r, i);
1503
1503
  let s = e.parent(r);
1504
1504
  s !== void 0 && t.setParent(r, s);
@@ -1593,7 +1593,7 @@ function ji(e) {
1593
1593
  e.node(t).dummy === "border" && e.removeNode(t);
1594
1594
  });
1595
1595
  }
1596
- function zi(e) {
1596
+ function Fi(e) {
1597
1597
  e.edges().forEach((t) => {
1598
1598
  if (t.v === t.w) {
1599
1599
  let n = e.node(t.v);
@@ -1601,7 +1601,7 @@ function zi(e) {
1601
1601
  }
1602
1602
  });
1603
1603
  }
1604
- function Fi(e) {
1604
+ function zi(e) {
1605
1605
  ve(e).forEach((t) => {
1606
1606
  let n = 0;
1607
1607
  t.forEach((r, o) => {
@@ -1612,7 +1612,7 @@ function Fi(e) {
1612
1612
  });
1613
1613
  });
1614
1614
  }
1615
- function Ai(e) {
1615
+ function Li(e) {
1616
1616
  e.nodes().forEach((t) => {
1617
1617
  let n = e.node(t);
1618
1618
  if (n.dummy === "selfedge") {
@@ -1630,7 +1630,7 @@ function We(e) {
1630
1630
  typeof n == "string" && (n = n.toLowerCase()), t[n] = r;
1631
1631
  }), t;
1632
1632
  }
1633
- function Di(e) {
1633
+ function Ai(e) {
1634
1634
  let t = ve(e), n = new K({ compound: !0, multigraph: !0 }).setGraph({});
1635
1635
  return e.nodes().forEach((r) => {
1636
1636
  n.setNode(r, { label: r }), n.setParent(r, "layer" + e.node(r).rank);
@@ -1639,7 +1639,7 @@ function Di(e) {
1639
1639
  n.setNode(i, { rank: "same" }), r.reduce((s, l) => (n.setEdge(s, l, { style: "invis" }), l));
1640
1640
  }), n;
1641
1641
  }
1642
- var Li = { graphlib: Ht, version: Vr, layout: hi, debug: Di, util: { time: ln, notime: an } }, Dt = Li;
1642
+ var Di = { graphlib: Ht, version: Vr, layout: hi, debug: Ai, util: { time: ln, notime: an } }, At = Di;
1643
1643
  /*! For license information please see dagre.esm.js.LEGAL.txt */
1644
1644
  const Ri = (e) => {
1645
1645
  const t = [];
@@ -1658,17 +1658,17 @@ const Ri = (e) => {
1658
1658
  Object.keys(i).length !== 0 && (r.current = n, e(i));
1659
1659
  }, [n]), null;
1660
1660
  }, je = ({ isOpen: e, onClose: t, title: n, icon: r, children: o, footer: i, width: s = 600 }) => {
1661
- const [l, d] = M(!1), a = () => d((h) => !h), c = () => /* @__PURE__ */ w(Q, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
1661
+ const [l, d] = M(!1), a = () => d((h) => !h), c = () => /* @__PURE__ */ v(Q, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
1662
1662
  r && /* @__PURE__ */ f(Q, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: r }),
1663
1663
  /* @__PURE__ */ f("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 500, color: "#212121" }, children: n }),
1664
1664
  /* @__PURE__ */ f(Et, { onClick: a, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ f(lr, {}) : /* @__PURE__ */ f(ar, {}) }),
1665
1665
  /* @__PURE__ */ f(Et, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ f(Un, {}) })
1666
1666
  ] }), u = () => i ? /* @__PURE__ */ f(Q, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
1667
- return l ? /* @__PURE__ */ w(Gn, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
1667
+ return l ? /* @__PURE__ */ v(Gn, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
1668
1668
  /* @__PURE__ */ f(c, {}),
1669
1669
  /* @__PURE__ */ f(Q, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
1670
1670
  /* @__PURE__ */ f(u, {})
1671
- ] }) : /* @__PURE__ */ w(
1671
+ ] }) : /* @__PURE__ */ v(
1672
1672
  $n,
1673
1673
  {
1674
1674
  anchor: "right",
@@ -1707,33 +1707,33 @@ const Ri = (e) => {
1707
1707
  onClose: o,
1708
1708
  loadTriggerSources: i
1709
1709
  }) => {
1710
- const [s, l] = M("trigger"), [d, a] = M(null), [c, u] = M([]), [h, g] = M([]), [p, v] = M(!1), [y, k] = M(null);
1710
+ const [s, l] = M("trigger"), [d, a] = M(null), [c, u] = M([]), [h, g] = M([]), [p, E] = M(!1), [y, x] = M(null);
1711
1711
  re(() => {
1712
- e || (l("trigger"), a(null), u([]), g([]), v(!1), k(null));
1712
+ e || (l("trigger"), a(null), u([]), g([]), E(!1), x(null));
1713
1713
  }, [e]);
1714
- const S = $(async (F) => {
1714
+ const N = $(async (z) => {
1715
1715
  if (!i) {
1716
- r(F);
1716
+ r(z);
1717
1717
  return;
1718
1718
  }
1719
- a(F), v(!0), k(null);
1719
+ a(z), E(!0), x(null);
1720
1720
  try {
1721
- const R = await i(F.triggerKey);
1721
+ const R = await i(z.triggerKey);
1722
1722
  if (!R || R.length === 0) {
1723
- r(F);
1723
+ r(z);
1724
1724
  return;
1725
1725
  }
1726
1726
  u(R), l("sources");
1727
1727
  } catch (R) {
1728
- k(R instanceof Error ? R.message : "Failed to load sources.");
1728
+ x(R instanceof Error ? R.message : "Failed to load sources.");
1729
1729
  } finally {
1730
- v(!1);
1730
+ E(!1);
1731
1731
  }
1732
1732
  }, [i, r]), O = () => {
1733
- l("trigger"), a(null), u([]), g([]), k(null);
1734
- }, z = () => {
1733
+ l("trigger"), a(null), u([]), g([]), x(null);
1734
+ }, F = () => {
1735
1735
  d && r(d, h);
1736
- }, j = s === "sources" && d, W = j ? /* @__PURE__ */ w(ye, { children: [
1736
+ }, j = s === "sources" && d, W = j ? /* @__PURE__ */ v(ye, { children: [
1737
1737
  /* @__PURE__ */ f(Ne, { type: "button", variant: "outlined", size: "small", onClick: O, children: n.cancel ?? "Back" }),
1738
1738
  /* @__PURE__ */ f(
1739
1739
  Ne,
@@ -1741,7 +1741,7 @@ const Ri = (e) => {
1741
1741
  type: "button",
1742
1742
  variant: "contained",
1743
1743
  size: "small",
1744
- onClick: z,
1744
+ onClick: F,
1745
1745
  disabled: h.length === 0,
1746
1746
  children: n.save ?? "Continue"
1747
1747
  }
@@ -1756,20 +1756,20 @@ const Ri = (e) => {
1756
1756
  icon: /* @__PURE__ */ f(sr, {}),
1757
1757
  width: 500,
1758
1758
  footer: W,
1759
- children: /* @__PURE__ */ w(Q, { sx: { p: 2 }, children: [
1760
- !j && /* @__PURE__ */ w(ye, { children: [
1759
+ children: /* @__PURE__ */ v(Q, { sx: { p: 2 }, children: [
1760
+ !j && /* @__PURE__ */ v(ye, { children: [
1761
1761
  /* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: n.chooseTrigger }),
1762
- /* @__PURE__ */ w("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
1763
- t.map((F) => /* @__PURE__ */ w(
1762
+ /* @__PURE__ */ v("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
1763
+ t.map((z) => /* @__PURE__ */ v(
1764
1764
  "div",
1765
1765
  {
1766
1766
  className: "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-start ff-gap-3",
1767
1767
  style: { cursor: p ? "wait" : "pointer", transition: "background 0.15s", opacity: p ? 0.6 : 1 },
1768
- onClick: () => !p && S(F),
1768
+ onClick: () => !p && N(z),
1769
1769
  role: "button",
1770
1770
  tabIndex: 0,
1771
1771
  onKeyDown: (R) => {
1772
- R.key === "Enter" && !p && S(F);
1772
+ R.key === "Enter" && !p && N(z);
1773
1773
  },
1774
1774
  onMouseEnter: (R) => {
1775
1775
  p || (R.currentTarget.style.background = "#f5f5f5");
@@ -1778,32 +1778,32 @@ const Ri = (e) => {
1778
1778
  R.currentTarget.style.background = "";
1779
1779
  },
1780
1780
  children: [
1781
- /* @__PURE__ */ f("div", { style: { color: F.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: F.triggerCategory === "scheduler" ? /* @__PURE__ */ f(Vn, { size: 18 }) : /* @__PURE__ */ f(Hn, { size: 18 }) }),
1782
- /* @__PURE__ */ w("div", { children: [
1783
- /* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: F.label }),
1784
- F.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: F.description })
1781
+ /* @__PURE__ */ f("div", { style: { color: z.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: z.triggerCategory === "scheduler" ? /* @__PURE__ */ f(Vn, { size: 18 }) : /* @__PURE__ */ f(Hn, { size: 18 }) }),
1782
+ /* @__PURE__ */ v("div", { children: [
1783
+ /* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: z.label }),
1784
+ z.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: z.description })
1785
1785
  ] })
1786
1786
  ]
1787
1787
  },
1788
- F.triggerKey
1788
+ z.triggerKey
1789
1789
  )),
1790
1790
  t.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noTriggers })
1791
1791
  ] }),
1792
- p && /* @__PURE__ */ w(Q, { sx: { display: "flex", alignItems: "center", gap: 1, mt: 2, fontSize: 12, color: "#64748b" }, children: [
1792
+ p && /* @__PURE__ */ v(Q, { sx: { display: "flex", alignItems: "center", gap: 1, mt: 2, fontSize: 12, color: "#64748b" }, children: [
1793
1793
  /* @__PURE__ */ f(Yn, { size: 14 }),
1794
1794
  /* @__PURE__ */ f("span", { children: "Loading sources for the selected trigger…" })
1795
1795
  ] }),
1796
1796
  y && /* @__PURE__ */ f("p", { style: { fontSize: 12, color: "#d32f2f", marginTop: 12 }, children: y })
1797
1797
  ] }),
1798
- j && /* @__PURE__ */ w(ye, { children: [
1799
- /* @__PURE__ */ w(
1798
+ j && /* @__PURE__ */ v(ye, { children: [
1799
+ /* @__PURE__ */ v(
1800
1800
  "div",
1801
1801
  {
1802
1802
  role: "button",
1803
1803
  tabIndex: 0,
1804
1804
  onClick: O,
1805
- onKeyDown: (F) => {
1806
- F.key === "Enter" && O();
1805
+ onKeyDown: (z) => {
1806
+ z.key === "Enter" && O();
1807
1807
  },
1808
1808
  className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
1809
1809
  style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
@@ -1813,7 +1813,7 @@ const Ri = (e) => {
1813
1813
  ]
1814
1814
  }
1815
1815
  ),
1816
- /* @__PURE__ */ w("p", { className: "ff-text-muted ff-mb-2", style: { fontSize: 13 }, children: [
1816
+ /* @__PURE__ */ v("p", { className: "ff-text-muted ff-mb-2", style: { fontSize: 13 }, children: [
1817
1817
  "Pick one or more sources for ",
1818
1818
  /* @__PURE__ */ f("strong", { children: d.label }),
1819
1819
  ":"
@@ -1824,7 +1824,7 @@ const Ri = (e) => {
1824
1824
  isMulti: !0,
1825
1825
  options: c,
1826
1826
  value: h,
1827
- onChange: (F) => g(F ?? []),
1827
+ onChange: (z) => g(z ?? []),
1828
1828
  placeholder: "Select sources…",
1829
1829
  menuPosition: "fixed",
1830
1830
  menuPortalTarget: typeof document < "u" ? document.body : void 0,
@@ -1869,8 +1869,8 @@ const Ri = (e) => {
1869
1869
  title: c ? n.addStepTitle : a.label,
1870
1870
  icon: c ? /* @__PURE__ */ f(qn, {}) : a.icon ?? /* @__PURE__ */ f(Xn, {}),
1871
1871
  width: 500,
1872
- children: /* @__PURE__ */ w(Q, { sx: { p: 2 }, children: [
1873
- !c && /* @__PURE__ */ w(
1872
+ children: /* @__PURE__ */ v(Q, { sx: { p: 2 }, children: [
1873
+ !c && /* @__PURE__ */ v(
1874
1874
  "div",
1875
1875
  {
1876
1876
  role: "button",
@@ -1888,8 +1888,8 @@ const Ri = (e) => {
1888
1888
  }
1889
1889
  ),
1890
1890
  /* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? n.chooseAction : `Pick an action from ${a.label}` }),
1891
- /* @__PURE__ */ f("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(ye, { children: [
1892
- i.map((u) => /* @__PURE__ */ w(
1891
+ /* @__PURE__ */ f("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ v(ye, { children: [
1892
+ i.map((u) => /* @__PURE__ */ v(
1893
1893
  "div",
1894
1894
  {
1895
1895
  className: $e,
@@ -1908,7 +1908,7 @@ const Ri = (e) => {
1908
1908
  },
1909
1909
  children: [
1910
1910
  u.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0 }, children: u.icon }),
1911
- /* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
1911
+ /* @__PURE__ */ v("div", { style: { flex: 1, minWidth: 0 }, children: [
1912
1912
  /* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: u.label }),
1913
1913
  /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: u.description ?? `${u.descriptors.length} action${u.descriptors.length === 1 ? "" : "s"}` })
1914
1914
  ] }),
@@ -1917,7 +1917,7 @@ const Ri = (e) => {
1917
1917
  },
1918
1918
  `app-${u.key}`
1919
1919
  )),
1920
- s.map((u) => /* @__PURE__ */ w(
1920
+ s.map((u) => /* @__PURE__ */ v(
1921
1921
  "div",
1922
1922
  {
1923
1923
  className: $e,
@@ -1944,7 +1944,7 @@ const Ri = (e) => {
1944
1944
  i.length === 0 && s.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: n.noActions })
1945
1945
  ] }) : (
1946
1946
  /* Stage 2 — actions for the selected app */
1947
- a.descriptors.map((u) => /* @__PURE__ */ w(
1947
+ a.descriptors.map((u) => /* @__PURE__ */ v(
1948
1948
  "div",
1949
1949
  {
1950
1950
  className: $e,
@@ -1972,28 +1972,28 @@ const Ri = (e) => {
1972
1972
  ] })
1973
1973
  }
1974
1974
  );
1975
- }, Lt = "_conditionConfig", Gi = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o, onSave: i, onClose: s }) => {
1975
+ }, Dt = "_conditionConfig", Gi = ({ open: e, nodeId: t, descriptor: n, initialValues: r, messages: o, onSave: i, onClose: s }) => {
1976
1976
  const [l, d] = M([]), [a, c] = M(!1), [u, h] = M(null), [g, p] = M({});
1977
1977
  re(() => {
1978
- p((r == null ? void 0 : r[Lt]) ?? {});
1978
+ p((r == null ? void 0 : r[Dt]) ?? {});
1979
1979
  }, [r, t]), re(() => {
1980
- let S = !1;
1980
+ let N = !1;
1981
1981
  if (h(null), !n || !t) {
1982
1982
  d([]), c(!1);
1983
1983
  return;
1984
1984
  }
1985
1985
  const O = n.formSchema;
1986
- return typeof O == "function" ? (c(!0), O(t).then((z) => {
1987
- S || (d(z), c(!1));
1988
- }).catch((z) => {
1989
- S || (d([]), h(z instanceof Error ? z.message : "Unable to load configuration."), c(!1));
1986
+ return typeof O == "function" ? (c(!0), O(t).then((F) => {
1987
+ N || (d(F), c(!1));
1988
+ }).catch((F) => {
1989
+ N || (d([]), h(F instanceof Error ? F.message : "Unable to load configuration."), c(!1));
1990
1990
  })) : (d(O), c(!1)), () => {
1991
- S = !0;
1991
+ N = !0;
1992
1992
  };
1993
1993
  }, [n, t]);
1994
- const v = t ? `node-config-form-${t}` : "node-config-form", y = !a && !u && l.length > 0, k = y ? /* @__PURE__ */ w(ye, { children: [
1994
+ const E = t ? `node-config-form-${t}` : "node-config-form", y = !a && !u && l.length > 0, x = y ? /* @__PURE__ */ v(ye, { children: [
1995
1995
  /* @__PURE__ */ f(Ne, { type: "button", variant: "outlined", size: "small", onClick: s, children: o.cancel }),
1996
- /* @__PURE__ */ f(Ne, { type: "submit", form: v, variant: "contained", size: "small", children: o.save })
1996
+ /* @__PURE__ */ f(Ne, { type: "submit", form: E, variant: "contained", size: "small", children: o.save })
1997
1997
  ] }) : null;
1998
1998
  return /* @__PURE__ */ f(
1999
1999
  je,
@@ -2003,8 +2003,8 @@ const Ri = (e) => {
2003
2003
  title: (n == null ? void 0 : n.label) ?? o.configureStep,
2004
2004
  icon: n == null ? void 0 : n.icon,
2005
2005
  width: 500,
2006
- footer: k,
2007
- children: /* @__PURE__ */ w(Q, { sx: { p: 2 }, children: [
2006
+ footer: x,
2007
+ children: /* @__PURE__ */ v(Q, { sx: { p: 2 }, children: [
2008
2008
  a && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
2009
2009
  !a && u && /* @__PURE__ */ f("p", { style: { fontSize: 13, color: "#d32f2f" }, children: u }),
2010
2010
  !a && !u && l.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
@@ -2013,13 +2013,13 @@ const Ri = (e) => {
2013
2013
  {
2014
2014
  schema: { layout: "flat", fields: l },
2015
2015
  initialValues: r ?? {},
2016
- formId: v,
2016
+ formId: E,
2017
2017
  conditionConfig: g,
2018
2018
  onConditionConfigChange: p,
2019
- onSubmit: (S) => {
2019
+ onSubmit: (N) => {
2020
2020
  if (!t) return;
2021
2021
  const O = Object.keys(g).length > 0;
2022
- i(t, { ...S, [Lt]: O ? g : void 0 }), s();
2022
+ i(t, { ...N, [Dt]: O ? g : void 0 }), s();
2023
2023
  }
2024
2024
  }
2025
2025
  )
@@ -2048,14 +2048,14 @@ const Ri = (e) => {
2048
2048
  title: r ? `Preview: ${r}` : "Sub-Workflow Preview",
2049
2049
  icon: /* @__PURE__ */ f(Zn, { size: 18, color: "#00695c" }),
2050
2050
  width: 700,
2051
- children: /* @__PURE__ */ w("div", { style: { height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: 24 }, children: [
2051
+ children: /* @__PURE__ */ v("div", { style: { height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: 24 }, children: [
2052
2052
  i.status === "idle" && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", fontSize: 14 }, children: "Select a workflow to preview" }),
2053
- i.status === "loading" && /* @__PURE__ */ w("div", { style: { textAlign: "center", color: "#9e9e9e" }, children: [
2053
+ i.status === "loading" && /* @__PURE__ */ v("div", { style: { textAlign: "center", color: "#9e9e9e" }, children: [
2054
2054
  /* @__PURE__ */ f("div", { style: { width: 32, height: 32, borderRadius: "50%", border: "3px solid #e0e0e0", borderTopColor: "#00897b", animation: "spin 0.8s linear infinite", margin: "0 auto 12px" } }),
2055
2055
  /* @__PURE__ */ f("span", { style: { fontSize: 14 }, children: "Loading workflow…" }),
2056
2056
  /* @__PURE__ */ f("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
2057
2057
  ] }),
2058
- i.status === "error" && /* @__PURE__ */ w("div", { style: { textAlign: "center", color: "#c62828" }, children: [
2058
+ i.status === "error" && /* @__PURE__ */ v("div", { style: { textAlign: "center", color: "#c62828" }, children: [
2059
2059
  /* @__PURE__ */ f(Jn, { size: 32, style: { marginBottom: 8 } }),
2060
2060
  /* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: i.message })
2061
2061
  ] }),
@@ -2096,8 +2096,8 @@ const Ri = (e) => {
2096
2096
  plusEdge: Bn,
2097
2097
  labelPlusEdge: Pn,
2098
2098
  plainEdge: Rn,
2099
- edgeWithPlusLabel: Ln,
2100
- gatewayBranchEdge: Dn
2099
+ edgeWithPlusLabel: Dn,
2100
+ gatewayBranchEdge: An
2101
2101
  };
2102
2102
  function Rt() {
2103
2103
  return [
@@ -2107,11 +2107,11 @@ function Rt() {
2107
2107
  ];
2108
2108
  }
2109
2109
  function Ui(e, t, n, r = "TB") {
2110
- const o = new Dt.graphlib.Graph();
2110
+ const o = new At.graphlib.Graph();
2111
2111
  return o.setGraph({ rankdir: r, ranksep: 70, nodesep: 50 }), o.setDefaultEdgeLabel(() => ({})), e.forEach((i) => {
2112
2112
  const s = n[i.id] ?? { width: we, height: He[i.type ?? ""] ?? 80 };
2113
2113
  o.setNode(i.id, { width: s.width, height: s.height });
2114
- }), t.forEach((i) => o.setEdge(i.source, i.target)), Dt.layout(o), e.map((i) => {
2114
+ }), t.forEach((i) => o.setEdge(i.source, i.target)), At.layout(o), e.map((i) => {
2115
2115
  var a, c;
2116
2116
  const s = o.node(i.id), l = ((a = n[i.id]) == null ? void 0 : a.width) ?? we, d = ((c = n[i.id]) == null ? void 0 : c.height) ?? He[i.type ?? ""] ?? 80;
2117
2117
  return { ...i, position: { x: s.x - l / 2, y: s.y - d / 2 } };
@@ -2122,24 +2122,24 @@ function Vi(e, t, n, r) {
2122
2122
  const s = Ue, l = 30, d = 30, a = {}, c = {}, u = /* @__PURE__ */ new Map();
2123
2123
  for (const y of e) u.set(y.id, y);
2124
2124
  for (const y of Object.values(t))
2125
- for (const k of Object.values(y))
2126
- for (const S of k) u.set(S.id, S);
2127
- const h = (y, k, S) => {
2125
+ for (const x of Object.values(y))
2126
+ for (const N of x) u.set(N.id, N);
2127
+ const h = (y, x, N) => {
2128
2128
  const O = r[y] ?? { width: we, height: 80 };
2129
- return a[y] = { x: k - O.width / 2, y: S }, S + O.height;
2130
- }, g = (y, k, S) => {
2131
- let O = S;
2132
- for (const z of y)
2133
- O = h(z.id, k, O) + s, ae(z.kind) && t[z.id] && (O = p(z.id, k, O));
2129
+ return a[y] = { x: x - O.width / 2, y: N }, N + O.height;
2130
+ }, g = (y, x, N) => {
2131
+ let O = N;
2132
+ for (const F of y)
2133
+ O = h(F.id, x, O) + s, ae(F.kind) && t[F.id] && (O = p(F.id, x, O));
2134
2134
  return O;
2135
- }, p = (y, k, S) => {
2136
- const O = k + 180, z = t[y], j = Object.keys(z), W = u.get(y), F = (W == null ? void 0 : W.branchLabels) ?? { pass: "Pass", fail: "Fail" }, R = a[y], P = r[y] ?? { height: 80 }, Ee = R.y + P.height, ke = [];
2137
- let te = S;
2135
+ }, p = (y, x, N) => {
2136
+ const O = x + 180, F = t[y], j = Object.keys(F), W = u.get(y), z = (W == null ? void 0 : W.branchLabels) ?? { pass: "Pass", fail: "Fail" }, R = a[y], B = r[y] ?? { height: 80 }, Ee = R.y + B.height, ke = [];
2137
+ let te = N;
2138
2138
  return j.forEach((ce, pe) => {
2139
- const oe = z[ce], A = te;
2139
+ const oe = F[ce], A = te;
2140
2140
  ke.push({
2141
2141
  y: A - Ee,
2142
- label: F[ce] ?? ce,
2142
+ label: z[ce] ?? ce,
2143
2143
  isPass: pe === 0
2144
2144
  }), te = g(oe, O, te + d), pe < j.length - 1 && (te += l);
2145
2145
  }), c[y] = {
@@ -2148,9 +2148,9 @@ function Vi(e, t, n, r) {
2148
2148
  indent: 180
2149
2149
  }, te;
2150
2150
  };
2151
- let v = Ve;
2151
+ let E = Ve;
2152
2152
  for (const y of e)
2153
- v = h(y.id, 400, v) + s, ae(y.kind) && t[y.id] && (v = p(y.id, 400, v));
2153
+ E = h(y.id, 400, E) + s, ae(y.kind) && t[y.id] && (E = p(y.id, 400, E));
2154
2154
  return {
2155
2155
  nodes: n.map((y) => a[y.id] ? { ...y, position: a[y.id] } : y),
2156
2156
  railSpecs: c
@@ -2181,47 +2181,47 @@ function Hi(e, t, n, r, o) {
2181
2181
  };
2182
2182
  }
2183
2183
  function qi(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
2184
- const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (p, v) => {
2184
+ const l = o.edgeColor ?? "#b0bec5", d = [], a = [], c = (p, E) => {
2185
2185
  const y = t[p];
2186
2186
  if (!y) return;
2187
- const S = v ?? { pass: "Pass", fail: "Fail" }, O = Object.keys(y), z = (j, W, F, R) => {
2187
+ const N = E ?? { pass: "Pass", fail: "Fail" }, O = Object.keys(y), F = (j, W, z, R) => {
2188
2188
  if (j.length !== 0) {
2189
- j.forEach((P) => d.push(Pt(P))), a.push({
2189
+ j.forEach((B) => d.push(Pt(B))), a.push({
2190
2190
  id: `e-${p}-${W}-start`,
2191
2191
  source: p,
2192
2192
  target: j[0].id,
2193
2193
  type: "gatewayBranchEdge",
2194
2194
  style: { stroke: l },
2195
- data: { branch: W, filterId: p, label: F, isFirst: R === 0, onAddStepClick: n, verticalRouting: s === "vertical" }
2195
+ data: { branch: W, filterId: p, label: z, isFirst: R === 0, onAddStepClick: n, verticalRouting: s === "vertical" }
2196
2196
  });
2197
- for (let P = 1; P < j.length; P++)
2198
- ae(j[P - 1].kind) || a.push(Hi(j[P - 1], j[P], l, n, { filterId: p, branch: W }));
2199
- for (const P of j)
2200
- ae(P.kind) && t[P.id] && c(P.id, P.branchLabels);
2197
+ for (let B = 1; B < j.length; B++)
2198
+ ae(j[B - 1].kind) || a.push(Hi(j[B - 1], j[B], l, n, { filterId: p, branch: W }));
2199
+ for (const B of j)
2200
+ ae(B.kind) && t[B.id] && c(B.id, B.branchLabels);
2201
2201
  }
2202
2202
  };
2203
2203
  O.forEach((j, W) => {
2204
- z(y[j], j, S[j] ?? j, W);
2204
+ F(y[j], j, N[j] ?? j, W);
2205
2205
  });
2206
2206
  };
2207
2207
  for (let p = 0; p < e.length; p++) {
2208
- const v = e[p];
2209
- if (d.push(Pt(v)), p > 0) {
2210
- const y = e[p - 1], k = y.kind === "start" || y.kind === "addTrigger";
2208
+ const E = e[p];
2209
+ if (d.push(Pt(E)), p > 0) {
2210
+ const y = e[p - 1], x = y.kind === "start" || y.kind === "addTrigger";
2211
2211
  if (y.kind === "filter" || y.kind === "approval") continue;
2212
2212
  a.push({
2213
- id: `e-${y.id}-${v.id}`,
2213
+ id: `e-${y.id}-${E.id}`,
2214
2214
  source: y.id,
2215
- target: v.id,
2216
- type: k ? "plainEdge" : "plusEdge",
2215
+ target: E.id,
2216
+ type: x ? "plainEdge" : "plusEdge",
2217
2217
  style: { stroke: l },
2218
- data: k ? {} : {
2218
+ data: x ? {} : {
2219
2219
  onAddStepClick: n,
2220
2220
  referenceNodeType: y.reactFlowType
2221
2221
  }
2222
2222
  });
2223
2223
  }
2224
- (v.kind === "filter" || v.kind === "approval") && t[v.id] && c(v.id, v.branchLabels);
2224
+ (E.kind === "filter" || E.kind === "approval") && t[E.id] && c(E.id, E.branchLabels);
2225
2225
  }
2226
2226
  const u = {};
2227
2227
  if (d.forEach((p) => {
@@ -2231,23 +2231,23 @@ function qi(e, t, n, r, o = {}, i = "TB", s = "horizontal") {
2231
2231
  };
2232
2232
  }), !(Object.keys(t).length > 0)) {
2233
2233
  if (i === "LR") {
2234
- let S = Ve;
2235
- return { nodes: d.map((z) => {
2236
- const j = u[z.id].width, W = u[z.id].height, F = { ...z, position: { x: S, y: 300 - W / 2 } };
2237
- return S += j + Ue, F;
2234
+ let N = Ve;
2235
+ return { nodes: d.map((F) => {
2236
+ const j = u[F.id].width, W = u[F.id].height, z = { ...F, position: { x: N, y: 300 - W / 2 } };
2237
+ return N += j + Ue, z;
2238
2238
  }), edges: a };
2239
2239
  }
2240
2240
  const p = 400;
2241
- let v = Ve;
2242
- return { nodes: d.map((k) => {
2243
- const S = u[k.id].height, O = { ...k, position: { x: p - we / 2, y: v } };
2244
- return v += S + Ue, O;
2241
+ let E = Ve;
2242
+ return { nodes: d.map((x) => {
2243
+ const N = u[x.id].height, O = { ...x, position: { x: p - we / 2, y: E } };
2244
+ return E += N + Ue, O;
2245
2245
  }), edges: a };
2246
2246
  }
2247
2247
  if (s === "vertical") {
2248
- const { nodes: p, railSpecs: v } = Vi(e, t, d, u);
2248
+ const { nodes: p, railSpecs: E } = Vi(e, t, d, u);
2249
2249
  return { nodes: p.map(
2250
- (k) => v[k.id] ? { ...k, data: { ...k.data, _branchRail: v[k.id] } } : k
2250
+ (x) => E[x.id] ? { ...x, data: { ...x.data, _branchRail: E[x.id] } } : x
2251
2251
  ), edges: a };
2252
2252
  }
2253
2253
  return { nodes: Ui(d, a, u, i), edges: a };
@@ -2268,41 +2268,41 @@ const Bt = ({
2268
2268
  renderNodePicker: h,
2269
2269
  renderNodeConfig: g,
2270
2270
  onNodeClick: p,
2271
- maxNodes: v,
2271
+ maxNodes: E,
2272
2272
  layoutDirection: y = "TB",
2273
- executionRecord: k,
2274
- onFetchWorkflow: S
2273
+ executionRecord: x,
2274
+ onFetchWorkflow: N
2275
2275
  }) => {
2276
2276
  const {
2277
2277
  fitView: O = !0,
2278
- fitViewPadding: z = 0.3,
2278
+ fitViewPadding: F = 0.3,
2279
2279
  showControls: j = !0,
2280
2280
  showMiniMap: W = !1,
2281
- panOnScroll: F = !0,
2281
+ panOnScroll: z = !0,
2282
2282
  zoomOnScroll: R = !1,
2283
- minZoom: P = 0.25,
2283
+ minZoom: B = 0.25,
2284
2284
  maxZoom: Ee = 2,
2285
2285
  snapToGrid: ke = !1,
2286
2286
  snapGrid: te = [15, 15],
2287
2287
  branchLayout: ce = "horizontal",
2288
2288
  nodeBody: pe = "full"
2289
- } = a, oe = Y(() => ur(d), [d]), [A, ie] = M(() => (n == null ? void 0 : n.slots) ?? Rt()), [U, J] = M(() => (n == null ? void 0 : n.branches) ?? {}), [ue, V] = M(null), [ze, tt] = M(null), [H, xe] = M(null), [se, nt] = M(null), [Te, rt] = M(null), [q, ot] = M(() => {
2289
+ } = a, oe = Y(() => ur(d), [d]), [A, ie] = M(() => (n == null ? void 0 : n.slots) ?? Rt()), [U, J] = M(() => (n == null ? void 0 : n.branches) ?? {}), [ue, V] = M(null), [Fe, tt] = M(null), [H, xe] = M(null), [se, nt] = M(null), [Te, rt] = M(null), [q, ot] = M(() => {
2290
2290
  const b = n == null ? void 0 : n.slots.find((_) => _.kind === "triggerFixed"), m = b != null && b.id.startsWith("trigger-") ? b.id.slice(8) : void 0;
2291
2291
  return m ? t.lookup(m) ?? null : null;
2292
2292
  }), [it, En] = M({}), kn = $((b) => {
2293
2293
  En(b);
2294
- }, []), xn = Y(() => ({ ...An, ...r }), [r]), Tn = Y(() => ({ ...Ki, ...o }), [o]), _n = Y(() => {
2294
+ }, []), xn = Y(() => ({ ...Ln, ...r }), [r]), Tn = Y(() => ({ ...Ki, ...o }), [o]), _n = Y(() => {
2295
2295
  const b = A.filter((_) => _.kind === "userTask").length, m = Object.values(U).flatMap((_) => Object.values(_).flat()).filter((_) => _.kind === "userTask").length;
2296
2296
  return b + m;
2297
- }, [A, U]), st = v ?? (q == null ? void 0 : q.maxTasks), lt = st !== void 0 && _n >= st, le = $((b) => {
2297
+ }, [A, U]), st = E ?? (q == null ? void 0 : q.maxTasks), lt = st !== void 0 && _n >= st, le = $((b) => {
2298
2298
  const m = A.find((_) => _.id === b);
2299
2299
  if (m) return m;
2300
2300
  for (const _ of Object.values(U)) {
2301
- const E = Object.values(_).flat().find((T) => T.id === b);
2302
- if (E) return E;
2301
+ const k = Object.values(_).flat().find((S) => S.id === b);
2302
+ if (k) return k;
2303
2303
  }
2304
2304
  return null;
2305
- }, [A, U]), Fe = $((b) => {
2305
+ }, [A, U]), ze = $((b) => {
2306
2306
  s || (tt(b), V("nodeConfig"));
2307
2307
  }, [s]), at = $((b) => {
2308
2308
  if (!s) {
@@ -2313,48 +2313,48 @@ const Bt = ({
2313
2313
  return;
2314
2314
  }
2315
2315
  ie((_) => {
2316
- const E = _.filter((T) => T.id !== b);
2317
- return ae((m == null ? void 0 : m.kind) ?? "") && !E.some((T) => T.kind === "end") ? [...E, { id: "end", kind: "end", reactFlowType: "endNode" }] : E;
2316
+ const k = _.filter((S) => S.id !== b);
2317
+ return ae((m == null ? void 0 : m.kind) ?? "") && !k.some((S) => S.kind === "end") ? [...k, { id: "end", kind: "end", reactFlowType: "endNode" }] : k;
2318
2318
  }), J((_) => {
2319
- const E = { ..._ }, T = (x) => {
2320
- E[x] && (Object.values(E[x]).flat().filter((N) => ae(N.kind)).forEach((N) => T(N.id)), delete E[x]);
2319
+ const k = { ..._ }, S = (w) => {
2320
+ k[w] && (Object.values(k[w]).flat().filter((T) => ae(T.kind)).forEach((T) => S(T.id)), delete k[w]);
2321
2321
  };
2322
- return T(b), E;
2322
+ return S(b), k;
2323
2323
  });
2324
2324
  return;
2325
2325
  }
2326
2326
  J((m) => {
2327
- const _ = (T, x) => {
2328
- const N = [];
2329
- for (const C of T)
2330
- ae(C.kind) && x[C.id] && (N.push(C.id), Object.values(x[C.id]).forEach((I) => N.push(..._(I, x))));
2331
- return N;
2332
- }, E = { ...m };
2333
- for (const T of Object.keys(E))
2334
- for (const x of Object.keys(E[T])) {
2335
- const N = E[T][x], C = N.findIndex((L) => L.id === b);
2336
- if (C === -1 || N[C].kind === "end") continue;
2337
- const I = N[C];
2338
- let D = N.filter((L) => L.id !== b);
2339
- return I.kind === "filter" && ((I.id in E ? _([I], E) : []).forEach((B) => delete E[B]), delete E[I.id], D.some((B) => B.kind === "end") || (D = [...D, { id: `end-${T}-${x}`, kind: "end", reactFlowType: "endNode" }])), E[T] = { ...E[T], [x]: D }, E;
2327
+ const _ = (S, w) => {
2328
+ const T = [];
2329
+ for (const C of S)
2330
+ ae(C.kind) && w[C.id] && (T.push(C.id), Object.values(w[C.id]).forEach((I) => T.push(..._(I, w))));
2331
+ return T;
2332
+ }, k = { ...m };
2333
+ for (const S of Object.keys(k))
2334
+ for (const w of Object.keys(k[S])) {
2335
+ const T = k[S][w], C = T.findIndex((D) => D.id === b);
2336
+ if (C === -1 || T[C].kind === "end") continue;
2337
+ const I = T[C];
2338
+ let L = T.filter((D) => D.id !== b);
2339
+ return I.kind === "filter" && ((I.id in k ? _([I], k) : []).forEach((P) => delete k[P]), delete k[I.id], L.some((P) => P.kind === "end") || (L = [...L, { id: `end-${S}-${w}`, kind: "end", reactFlowType: "endNode" }])), k[S] = { ...k[S], [w]: L }, k;
2340
2340
  }
2341
- return E;
2341
+ return k;
2342
2342
  });
2343
2343
  }
2344
- }, [s, A]), Ae = $(() => {
2344
+ }, [s, A]), Le = $(() => {
2345
2345
  s || V("triggerSelect");
2346
2346
  }, [s]), dt = $((b, m) => {
2347
2347
  s || lt || (xe(b), nt(m.filterId && m.branch ? { filterId: m.filterId, branch: m.branch } : null), V("nodePicker"));
2348
2348
  }, [s, lt]), ct = $((b, m) => {
2349
2349
  if (ot(b), V(null), b.skeletonState) {
2350
- const E = (b.skeletonState.slots ?? []).map((T) => T.kind === "triggerFixed" && Array.isArray(m) && m.length > 0 ? {
2351
- ...T,
2350
+ const k = (b.skeletonState.slots ?? []).map((S) => S.kind === "triggerFixed" && Array.isArray(m) && m.length > 0 ? {
2351
+ ...S,
2352
2352
  nodeData: {
2353
- ...T.nodeData ?? {},
2353
+ ...S.nodeData ?? {},
2354
2354
  sources: m
2355
2355
  }
2356
- } : T);
2357
- J(b.skeletonState.branches ?? {}), ie(E);
2356
+ } : S);
2357
+ J(b.skeletonState.branches ?? {}), ie(k);
2358
2358
  return;
2359
2359
  }
2360
2360
  J({});
@@ -2387,21 +2387,21 @@ const Bt = ({
2387
2387
  };
2388
2388
  if (!H) return b;
2389
2389
  if (se) {
2390
- const { filterId: E, branch: T } = se, x = A.findIndex((L) => L.id === E), N = x >= 0 ? A.slice(0, x + 1) : [], C = ((_ = U[E]) == null ? void 0 : _[T]) ?? [], I = C.findIndex((L) => L.id === H), D = I >= 0 ? C.slice(0, I + 1) : [];
2391
- return b.upstreamSlots = [...N, ...D], b.downstreamSlots = I >= 0 ? C.slice(I + 1) : C, b.insertAfterSlot = D[D.length - 1] ?? null, b;
2390
+ const { filterId: k, branch: S } = se, w = A.findIndex((D) => D.id === k), T = w >= 0 ? A.slice(0, w + 1) : [], C = ((_ = U[k]) == null ? void 0 : _[S]) ?? [], I = C.findIndex((D) => D.id === H), L = I >= 0 ? C.slice(0, I + 1) : [];
2391
+ return b.upstreamSlots = [...T, ...L], b.downstreamSlots = I >= 0 ? C.slice(I + 1) : C, b.insertAfterSlot = L[L.length - 1] ?? null, b;
2392
2392
  }
2393
- const m = A.findIndex((E) => E.id === H);
2393
+ const m = A.findIndex((k) => k.id === H);
2394
2394
  return b.upstreamSlots = m >= 0 ? A.slice(0, m + 1) : [], b.downstreamSlots = m >= 0 ? A.slice(m + 1) : [], b.insertAfterSlot = b.upstreamSlots[b.upstreamSlots.length - 1] ?? null, b;
2395
2395
  }, [A, U, H, se, q]), ft = (b, m) => b.descriptorType === m || b.id === m || b.kind === m, ht = $(() => {
2396
- const b = e.list(), m = q != null && q.availableTasks ? b.filter((E) => q.availableTasks.includes(E.type)) : b, _ = ut();
2397
- return m.filter((E) => E.maxPerWorkflow !== void 0 && A.filter((x) => x.descriptorType === E.type).length + Object.values(U).flatMap((x) => Object.values(x).flat()).filter((x) => x.descriptorType === E.type).length >= E.maxPerWorkflow ? !1 : E.canInsert ? E.canInsert(_) : !(E.insertAfter && E.insertAfter.length > 0 && !_.upstreamSlots.some(
2398
- (x) => E.insertAfter.some((N) => ft(x, N))
2399
- ) || E.insertBefore && E.insertBefore.length > 0 && !_.downstreamSlots.some(
2400
- (x) => E.insertBefore.some((N) => ft(x, N))
2396
+ const b = e.list(), m = q != null && q.availableTasks ? b.filter((k) => q.availableTasks.includes(k.type)) : b, _ = ut();
2397
+ return m.filter((k) => k.maxPerWorkflow !== void 0 && A.filter((w) => w.descriptorType === k.type).length + Object.values(U).flatMap((w) => Object.values(w).flat()).filter((w) => w.descriptorType === k.type).length >= k.maxPerWorkflow ? !1 : k.canInsert ? k.canInsert(_) : !(k.insertAfter && k.insertAfter.length > 0 && !_.upstreamSlots.some(
2398
+ (w) => k.insertAfter.some((T) => ft(w, T))
2399
+ ) || k.insertBefore && k.insertBefore.length > 0 && !_.downstreamSlots.some(
2400
+ (w) => k.insertBefore.some((T) => ft(w, T))
2401
2401
  )));
2402
2402
  }, [e, q, A, U, ut]), gt = $((b) => {
2403
2403
  if (!H) return;
2404
- const m = `${b.type}-${Date.now()}`, _ = b.reactFlowType === "filterNode" || b.reactFlowType === "approvalNode" || b.reactFlowType === "conditionBranchNode", E = b.branchLabels ?? { pass: "Pass", fail: "Fail" }, T = {
2404
+ const m = `${b.type}-${Date.now()}`, _ = b.reactFlowType === "filterNode" || b.reactFlowType === "approvalNode" || b.reactFlowType === "conditionBranchNode", k = b.branchLabels ?? { pass: "Pass", fail: "Fail" }, S = {
2405
2405
  id: m,
2406
2406
  kind: _ ? b.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
2407
2407
  reactFlowType: b.reactFlowType,
@@ -2409,100 +2409,108 @@ const Bt = ({
2409
2409
  formData: {},
2410
2410
  nodeData: { title: b.label },
2411
2411
  deletable: !0,
2412
- branchLabels: E
2412
+ branchLabels: k
2413
2413
  };
2414
2414
  if (se) {
2415
- const { filterId: x, branch: N } = se;
2415
+ const { filterId: w, branch: T } = se;
2416
2416
  J((C) => {
2417
- const I = [...C[x][N]];
2417
+ const I = [...C[w][T]];
2418
2418
  if (_) {
2419
2419
  const ne = I.filter((fe) => fe.kind !== "end"), wt = ne.findIndex((fe) => fe.id === H), Cn = wt === -1 ? ne.length : wt + 1;
2420
- return ne.splice(Cn, 0, T), {
2420
+ return ne.splice(Cn, 0, S), {
2421
2421
  ...C,
2422
- [x]: { ...C[x], [N]: ne },
2422
+ [w]: { ...C[w], [T]: ne },
2423
2423
  [m]: Object.fromEntries(
2424
- Object.keys(E).map((fe) => [fe, [{ id: `end-${m}-${fe}`, kind: "end", reactFlowType: "endNode" }]])
2424
+ Object.keys(k).map((fe) => [fe, [{ id: `end-${m}-${fe}`, kind: "end", reactFlowType: "endNode" }]])
2425
2425
  )
2426
2426
  };
2427
2427
  }
2428
- const D = I.findIndex((ne) => ne.id === H), L = I.findIndex((ne) => ne.kind === "end"), B = D === -1 ? L === -1 ? I.length : L : D + 1;
2429
- return I.splice(B, 0, T), { ...C, [x]: { ...C[x], [N]: I } };
2428
+ const L = I.findIndex((ne) => ne.id === H), D = I.findIndex((ne) => ne.kind === "end"), P = L === -1 ? D === -1 ? I.length : D : L + 1;
2429
+ return I.splice(P, 0, S), { ...C, [w]: { ...C[w], [T]: I } };
2430
2430
  });
2431
2431
  } else
2432
- _ ? (ie((x) => {
2433
- const N = x.findIndex((I) => I.id === H);
2434
- return [...x.filter((I) => I.kind !== "end").slice(0, N + 1), T];
2435
- }), J((x) => ({
2436
- ...x,
2432
+ _ ? (ie((w) => {
2433
+ const T = w.findIndex((I) => I.id === H);
2434
+ return [...w.filter((I) => I.kind !== "end").slice(0, T + 1), S];
2435
+ }), J((w) => ({
2436
+ ...w,
2437
2437
  [m]: Object.fromEntries(
2438
- Object.keys(E).map((N) => [N, [{ id: `end-${m}-${N}`, kind: "end", reactFlowType: "endNode" }]])
2438
+ Object.keys(k).map((T) => [T, [{ id: `end-${m}-${T}`, kind: "end", reactFlowType: "endNode" }]])
2439
2439
  )
2440
- }))) : ie((x) => {
2441
- const N = x.findIndex((C) => C.id === H);
2442
- return N === -1 ? x : [...x.slice(0, N + 1), T, ...x.slice(N + 1)];
2440
+ }))) : ie((w) => {
2441
+ const T = w.findIndex((C) => C.id === H);
2442
+ return T === -1 ? w : [...w.slice(0, T + 1), S, ...w.slice(T + 1)];
2443
2443
  });
2444
2444
  xe(null), nt(null), tt(m), V("nodeConfig");
2445
2445
  }, [H, se]), pt = $((b, m) => {
2446
- const _ = (T) => {
2447
- const x = le(b);
2448
- if ((x == null ? void 0 : x.descriptorType) !== "conditionBranch") return T;
2449
- const N = m.branchConfigs ?? [], C = N.map((B) => B.key).filter(Boolean);
2450
- if (C.length === 0) return T;
2451
- const I = T[b] ?? {}, D = {};
2452
- C.forEach((B) => {
2453
- D[B] = I[B] ?? [{ id: `end-${b}-${B}`, kind: "end", reactFlowType: "endNode" }];
2454
- });
2455
- const L = {};
2456
- return N.forEach((B) => {
2457
- B.key && (L[B.key] = B.label || B.key);
2458
- }), { ...T, [b]: D };
2459
- }, E = (T, x) => {
2460
- if (T.descriptorType !== "conditionBranch") return { ...T, formData: x };
2461
- const N = x.branchConfigs ?? [], C = {};
2462
- return N.forEach((I) => {
2463
- I.key && (C[I.key] = I.label || I.key);
2464
- }), { ...T, formData: x, branchLabels: C };
2446
+ const _ = (w) => {
2447
+ const T = w.label || w.key;
2448
+ switch (w.kind) {
2449
+ case "if":
2450
+ return `IF · ${T}`;
2451
+ case "elseif":
2452
+ return `ELSE IF · ${T}`;
2453
+ case "else":
2454
+ return T.toUpperCase() === "ELSE" ? T : `ELSE · ${T}`;
2455
+ default:
2456
+ return T;
2457
+ }
2458
+ }, k = (w) => {
2459
+ const T = le(b);
2460
+ if ((T == null ? void 0 : T.descriptorType) !== "conditionBranch") return w;
2461
+ const I = (m.branchConfigs ?? []).map((P) => P.key).filter(Boolean);
2462
+ if (I.length === 0) return w;
2463
+ const L = w[b] ?? {}, D = {};
2464
+ return I.forEach((P) => {
2465
+ D[P] = L[P] ?? [{ id: `end-${b}-${P}`, kind: "end", reactFlowType: "endNode" }];
2466
+ }), { ...w, [b]: D };
2467
+ }, S = (w, T) => {
2468
+ if (w.descriptorType !== "conditionBranch") return { ...w, formData: T };
2469
+ const C = T.branchConfigs ?? [], I = {};
2470
+ return C.forEach((L) => {
2471
+ L.key && (I[L.key] = _(L));
2472
+ }), { ...w, formData: T, branchLabels: I };
2465
2473
  };
2466
- if (A.some((T) => T.id === b)) {
2467
- J((T) => {
2468
- const x = _(T);
2469
- return ie((N) => {
2470
- const C = N.map((I) => I.id === b ? E(I, m) : I);
2471
- return i == null || i({ slots: C, branches: x }), C;
2472
- }), x;
2474
+ if (A.some((w) => w.id === b)) {
2475
+ J((w) => {
2476
+ const T = k(w);
2477
+ return ie((C) => {
2478
+ const I = C.map((L) => L.id === b ? S(L, m) : L);
2479
+ return i == null || i({ slots: I, branches: T }), I;
2480
+ }), T;
2473
2481
  });
2474
2482
  return;
2475
2483
  }
2476
- J((T) => {
2477
- const N = { ..._(T) };
2478
- for (const C of Object.keys(N)) {
2479
- const I = (D) => D.map((L) => L.id === b ? E(L, m) : L);
2480
- for (const D of Object.keys(N[C]))
2481
- if (N[C][D].some((L) => L.id === b))
2482
- return N[C] = { ...N[C], [D]: I(N[C][D]) }, i == null || i({ slots: A, branches: N }), N;
2484
+ J((w) => {
2485
+ const C = { ...k(w) };
2486
+ for (const I of Object.keys(C)) {
2487
+ const L = (D) => D.map((P) => P.id === b ? S(P, m) : P);
2488
+ for (const D of Object.keys(C[I]))
2489
+ if (C[I][D].some((P) => P.id === b))
2490
+ return C[I] = { ...C[I], [D]: L(C[I][D]) }, i == null || i({ slots: A, branches: C }), C;
2483
2491
  }
2484
- return N;
2492
+ return C;
2485
2493
  });
2486
- }, [A, U, le, i]), Z = Y(() => le(ze ?? ""), [le, ze]), bt = Y(() => Z != null && Z.descriptorType ? e.forType(Z.descriptorType) ?? null : null, [Z, e]), { nodes: yt, edges: Nn } = Y(
2494
+ }, [A, U, le, i]), Z = Y(() => le(Fe ?? ""), [le, Fe]), bt = Y(() => Z != null && Z.descriptorType ? e.forType(Z.descriptorType) ?? null : null, [Z, e]), { nodes: yt, edges: Nn } = Y(
2487
2495
  () => qi(A, U, s ? null : dt, it, l, y, ce),
2488
2496
  [A, U, s, dt, it, l, y, ce]
2489
2497
  ), mt = Y(() => {
2490
- const b = k ? new Map(k.steps.map((m) => [m.nodeId, m])) : null;
2498
+ const b = x ? new Map(x.steps.map((m) => [m.nodeId, m])) : null;
2491
2499
  return yt.map((m) => {
2492
2500
  let _ = {};
2493
2501
  if (b) {
2494
- const E = b.get(m.id);
2495
- E && (_ = { _executionStatus: E.status, _executionError: E.error });
2502
+ const k = b.get(m.id);
2503
+ k && (_ = { _executionStatus: k.status, _executionError: k.error });
2496
2504
  }
2497
- return m.type === "subWorkflowNode" && S && (_.onPreview = (E) => {
2498
- var x;
2499
- const T = le(m.id);
2500
- rt({ workflowId: E, workflowLabel: ((x = T == null ? void 0 : T.formData) == null ? void 0 : x.workflowLabel) ?? void 0 });
2505
+ return m.type === "subWorkflowNode" && N && (_.onPreview = (k) => {
2506
+ var w;
2507
+ const S = le(m.id);
2508
+ rt({ workflowId: k, workflowLabel: ((w = S == null ? void 0 : S.formData) == null ? void 0 : w.workflowLabel) ?? void 0 });
2501
2509
  }), Object.keys(_).length > 0 ? { ...m, data: { ...m.data, ..._ } } : m;
2502
2510
  });
2503
- }, [yt, k, S, le]), Sn = Y(() => ({ onEditNode: Fe, onDeleteNode: at, onAddStep: () => {
2504
- }, onClickAddTrigger: Ae, messages: oe, nodeRegistry: e, nodeBody: pe }), [Fe, at, Ae, oe, e, pe]);
2505
- return /* @__PURE__ */ f(Wn.Provider, { value: Sn, children: /* @__PURE__ */ w(
2511
+ }, [yt, x, N, le]), Sn = Y(() => ({ onEditNode: ze, onDeleteNode: at, onAddStep: () => {
2512
+ }, onClickAddTrigger: Le, messages: oe, nodeRegistry: e, nodeBody: pe }), [ze, at, Le, oe, e, pe]);
2513
+ return /* @__PURE__ */ f(Wn.Provider, { value: Sn, children: /* @__PURE__ */ v(
2506
2514
  "div",
2507
2515
  {
2508
2516
  className: "flowforge-canvas",
@@ -2522,7 +2530,7 @@ const Bt = ({
2522
2530
  "--ff-font-family": l.fontFamily
2523
2531
  },
2524
2532
  children: [
2525
- /* @__PURE__ */ w(
2533
+ /* @__PURE__ */ v(
2526
2534
  In,
2527
2535
  {
2528
2536
  nodes: mt,
@@ -2530,19 +2538,19 @@ const Bt = ({
2530
2538
  nodeTypes: xn,
2531
2539
  edgeTypes: Tn,
2532
2540
  fitView: O,
2533
- fitViewOptions: { padding: z },
2541
+ fitViewOptions: { padding: F },
2534
2542
  nodesDraggable: !1,
2535
2543
  nodesConnectable: !1,
2536
- panOnScroll: F,
2544
+ panOnScroll: z,
2537
2545
  zoomOnScroll: R,
2538
- minZoom: P,
2546
+ minZoom: B,
2539
2547
  maxZoom: Ee,
2540
2548
  snapToGrid: ke,
2541
2549
  snapGrid: te,
2542
2550
  proOptions: { hideAttribution: !0 },
2543
2551
  onNodeClick: (b, m) => {
2544
2552
  const _ = le(m.id);
2545
- _ && (p != null && p(_) || (_.kind === "addTrigger" || _.kind === "triggerFixed" ? Ae() : (_.kind === "userTask" || _.kind === "filter" || _.kind === "approval") && Fe(m.id)));
2553
+ _ && (p != null && p(_) || (_.kind === "addTrigger" || _.kind === "triggerFixed" ? Le() : (_.kind === "userTask" || _.kind === "filter" || _.kind === "approval") && ze(m.id)));
2546
2554
  },
2547
2555
  children: [
2548
2556
  l.background !== "none" && /* @__PURE__ */ f(
@@ -2553,8 +2561,8 @@ const Bt = ({
2553
2561
  gap: 20
2554
2562
  }
2555
2563
  ),
2556
- j && /* @__PURE__ */ f(zn, { showInteractive: !1 }),
2557
- W && /* @__PURE__ */ f(Fn, { zoomable: !0, pannable: !0 }),
2564
+ j && /* @__PURE__ */ f(Fn, { showInteractive: !1 }),
2565
+ W && /* @__PURE__ */ f(zn, { zoomable: !0, pannable: !0 }),
2558
2566
  /* @__PURE__ */ f(Pi, { onHeightsReady: kn, nodeCount: mt.length })
2559
2567
  ]
2560
2568
  }
@@ -2565,15 +2573,15 @@ const Bt = ({
2565
2573
  }) : /* @__PURE__ */ f(Wi, { open: ue === "nodePicker", availableDescriptors: ht(), messages: oe, onSelect: gt, onClose: () => {
2566
2574
  V(null), xe(null);
2567
2575
  } }),
2568
- g ? ue === "nodeConfig" && g(bt ?? void 0, Z, pt, () => V(null)) : /* @__PURE__ */ f(Gi, { open: ue === "nodeConfig", nodeId: ze, descriptor: bt, initialValues: Z == null ? void 0 : Z.formData, messages: oe, onSave: pt, onClose: () => V(null) }),
2569
- S && Te && /* @__PURE__ */ f(
2576
+ g ? ue === "nodeConfig" && g(bt ?? void 0, Z, pt, () => V(null)) : /* @__PURE__ */ f(Gi, { open: ue === "nodeConfig", nodeId: Fe, descriptor: bt, initialValues: Z == null ? void 0 : Z.formData, messages: oe, onSave: pt, onClose: () => V(null) }),
2577
+ N && Te && /* @__PURE__ */ f(
2570
2578
  $i,
2571
2579
  {
2572
2580
  isOpen: !!Te,
2573
2581
  onClose: () => rt(null),
2574
2582
  workflowId: Te.workflowId,
2575
2583
  workflowLabel: Te.workflowLabel,
2576
- onFetchWorkflow: S
2584
+ onFetchWorkflow: N
2577
2585
  }
2578
2586
  )
2579
2587
  ]
@@ -2587,7 +2595,7 @@ const Bt = ({
2587
2595
  function Ji({ template: e, onSelect: t }) {
2588
2596
  var o, i;
2589
2597
  const n = e.triggerCategory ? fr[e.triggerCategory] : null, r = ((o = e.skeletonState) == null ? void 0 : o.slots.filter((s) => s.kind === "userTask").length) ?? 0;
2590
- return /* @__PURE__ */ w(
2598
+ return /* @__PURE__ */ v(
2591
2599
  "div",
2592
2600
  {
2593
2601
  role: "button",
@@ -2615,23 +2623,23 @@ function Ji({ template: e, onSelect: t }) {
2615
2623
  s.currentTarget.style.borderColor = "#e0e0e0", s.currentTarget.style.boxShadow = "none";
2616
2624
  },
2617
2625
  children: [
2618
- /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "flex-start", gap: 10 }, children: [
2626
+ /* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "flex-start", gap: 10 }, children: [
2619
2627
  e.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0, width: 36, height: 36, borderRadius: 8, background: "#f5f5f5", display: "flex", alignItems: "center", justifyContent: "center" }, children: e.icon }),
2620
- /* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
2628
+ /* @__PURE__ */ v("div", { style: { flex: 1, minWidth: 0 }, children: [
2621
2629
  /* @__PURE__ */ f("div", { style: { fontWeight: 600, fontSize: 14, color: "#212121", marginBottom: 2 }, children: e.label }),
2622
2630
  e.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", lineHeight: 1.4, display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden" }, children: e.description })
2623
2631
  ] })
2624
2632
  ] }),
2625
- /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 4 }, children: [
2633
+ /* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 4 }, children: [
2626
2634
  n && /* @__PURE__ */ f("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: n.bg, color: n.color }, children: n.label }),
2627
2635
  (i = e.tags) == null ? void 0 : i.map((s) => /* @__PURE__ */ f("span", { style: { fontSize: 10, padding: "2px 7px", borderRadius: 10, background: "#f5f5f5", color: "#616161" }, children: s }, s)),
2628
- r > 0 && /* @__PURE__ */ w("span", { style: { fontSize: 10, color: "#9e9e9e", marginLeft: "auto" }, children: [
2636
+ r > 0 && /* @__PURE__ */ v("span", { style: { fontSize: 10, color: "#9e9e9e", marginLeft: "auto" }, children: [
2629
2637
  r,
2630
2638
  " step",
2631
2639
  r !== 1 ? "s" : ""
2632
2640
  ] })
2633
2641
  ] }),
2634
- e.author && /* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#bdbdbd" }, children: [
2642
+ e.author && /* @__PURE__ */ v("div", { style: { fontSize: 11, color: "#bdbdbd" }, children: [
2635
2643
  "by ",
2636
2644
  e.author
2637
2645
  ] })
@@ -2662,14 +2670,14 @@ const gs = ({
2662
2670
  }
2663
2671
  return [...a].sort((c, u) => (u.popularity ?? 0) - (c.popularity ?? 0));
2664
2672
  }, [e, i, r]);
2665
- return /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", height: "100%", fontFamily: "inherit" }, children: [
2666
- /* @__PURE__ */ w("div", { style: { padding: "24px 24px 0", borderBottom: "1px solid #f0f0f0", paddingBottom: 16 }, children: [
2667
- /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 16 }, children: [
2668
- /* @__PURE__ */ w("div", { children: [
2673
+ return /* @__PURE__ */ v("div", { style: { display: "flex", flexDirection: "column", height: "100%", fontFamily: "inherit" }, children: [
2674
+ /* @__PURE__ */ v("div", { style: { padding: "24px 24px 0", borderBottom: "1px solid #f0f0f0", paddingBottom: 16 }, children: [
2675
+ /* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 16 }, children: [
2676
+ /* @__PURE__ */ v("div", { children: [
2669
2677
  /* @__PURE__ */ f("h2", { style: { margin: 0, fontSize: 20, fontWeight: 700, color: "#212121" }, children: "Workflow Templates" }),
2670
2678
  /* @__PURE__ */ f("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#757575" }, children: "Choose a pre-built template or start from scratch" })
2671
2679
  ] }),
2672
- n && /* @__PURE__ */ w(
2680
+ n && /* @__PURE__ */ v(
2673
2681
  "button",
2674
2682
  {
2675
2683
  onClick: n,
@@ -2681,7 +2689,7 @@ const gs = ({
2681
2689
  }
2682
2690
  )
2683
2691
  ] }),
2684
- /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, background: "#f5f5f5", borderRadius: 8, padding: "8px 12px", marginBottom: 12 }, children: [
2692
+ /* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", gap: 8, background: "#f5f5f5", borderRadius: 8, padding: "8px 12px", marginBottom: 12 }, children: [
2685
2693
  /* @__PURE__ */ f(er, { size: 18, color: "#9e9e9e" }),
2686
2694
  /* @__PURE__ */ f(
2687
2695
  "input",
@@ -2713,7 +2721,7 @@ const gs = ({
2713
2721
  a
2714
2722
  )) })
2715
2723
  ] }),
2716
- /* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: d.length === 0 ? /* @__PURE__ */ w("div", { style: { textAlign: "center", padding: "40px 0", color: "#9e9e9e" }, children: [
2724
+ /* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: d.length === 0 ? /* @__PURE__ */ v("div", { style: { textAlign: "center", padding: "40px 0", color: "#9e9e9e" }, children: [
2717
2725
  /* @__PURE__ */ f(tr, { size: 36, style: { marginBottom: 8 } }),
2718
2726
  /* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
2719
2727
  ] }) : /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: d.map((a) => /* @__PURE__ */ f(Ji, { template: a, onSelect: () => t(a) }, a.triggerKey)) }) })
@@ -2747,8 +2755,8 @@ function vn(e, t) {
2747
2755
  }
2748
2756
  function Qi({ step: e }) {
2749
2757
  const [t, n] = M(!1), r = Zi[e.status], o = !!(e.inputs || e.outputs || e.error);
2750
- return /* @__PURE__ */ w("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
2751
- /* @__PURE__ */ w(
2758
+ return /* @__PURE__ */ v("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
2759
+ /* @__PURE__ */ v(
2752
2760
  "div",
2753
2761
  {
2754
2762
  style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 12px", cursor: o ? "pointer" : "default" },
@@ -2769,13 +2777,13 @@ function Qi({ step: e }) {
2769
2777
  ]
2770
2778
  }
2771
2779
  ),
2772
- t && o && /* @__PURE__ */ w("div", { style: { padding: "0 12px 10px 32px", fontSize: 12 }, children: [
2780
+ t && o && /* @__PURE__ */ v("div", { style: { padding: "0 12px 10px 32px", fontSize: 12 }, children: [
2773
2781
  e.error && /* @__PURE__ */ f("div", { style: { padding: "6px 10px", borderRadius: 6, background: "#ffebee", color: "#c62828", marginBottom: 6 }, children: e.error }),
2774
- e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */ w("details", { style: { marginBottom: 4 }, children: [
2782
+ e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */ v("details", { style: { marginBottom: 4 }, children: [
2775
2783
  /* @__PURE__ */ f("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Inputs" }),
2776
2784
  /* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.inputs, null, 2) })
2777
2785
  ] }),
2778
- e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */ w("details", { children: [
2786
+ e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */ v("details", { children: [
2779
2787
  /* @__PURE__ */ f("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Outputs" }),
2780
2788
  /* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.outputs, null, 2) })
2781
2789
  ] })
@@ -2784,7 +2792,7 @@ function Qi({ step: e }) {
2784
2792
  }
2785
2793
  function es({ record: e, selected: t, onSelect: n }) {
2786
2794
  const r = _e[e.status];
2787
- return /* @__PURE__ */ w(
2795
+ return /* @__PURE__ */ v(
2788
2796
  "div",
2789
2797
  {
2790
2798
  role: "button",
@@ -2805,9 +2813,9 @@ function es({ record: e, selected: t, onSelect: n }) {
2805
2813
  },
2806
2814
  children: [
2807
2815
  /* @__PURE__ */ f("span", { style: { color: r.color, flexShrink: 0 }, children: G.cloneElement(r.icon, { color: r.color, size: 16 }) }),
2808
- /* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
2816
+ /* @__PURE__ */ v("div", { style: { flex: 1, minWidth: 0 }, children: [
2809
2817
  /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: qe(e.triggeredAt) }),
2810
- /* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
2818
+ /* @__PURE__ */ v("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
2811
2819
  e.triggeredBy ? `by ${e.triggeredBy}` : "System",
2812
2820
  " · ",
2813
2821
  e.steps.length,
@@ -2824,34 +2832,34 @@ function es({ record: e, selected: t, onSelect: n }) {
2824
2832
  const ps = ({ records: e, onViewOnCanvas: t }) => {
2825
2833
  var s;
2826
2834
  const [n, r] = M(((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());
2827
- return e.length === 0 ? /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
2835
+ return e.length === 0 ? /* @__PURE__ */ v("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
2828
2836
  /* @__PURE__ */ f(kt, { size: 36 }),
2829
2837
  /* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
2830
2838
  /* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 12 }, children: "Run history will appear here" })
2831
- ] }) : /* @__PURE__ */ w("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
2832
- /* @__PURE__ */ w("div", { style: { width: 260, flexShrink: 0, borderRight: "1px solid #e0e0e0", overflowY: "auto", background: "#fafafa" }, children: [
2833
- /* @__PURE__ */ w("div", { style: { padding: "12px 14px", borderBottom: "1px solid #e0e0e0", fontWeight: 600, fontSize: 13, color: "#212121" }, children: [
2839
+ ] }) : /* @__PURE__ */ v("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
2840
+ /* @__PURE__ */ v("div", { style: { width: 260, flexShrink: 0, borderRight: "1px solid #e0e0e0", overflowY: "auto", background: "#fafafa" }, children: [
2841
+ /* @__PURE__ */ v("div", { style: { padding: "12px 14px", borderBottom: "1px solid #e0e0e0", fontWeight: 600, fontSize: 13, color: "#212121" }, children: [
2834
2842
  "Run History (",
2835
2843
  e.length,
2836
2844
  ")"
2837
2845
  ] }),
2838
2846
  i.map((l) => /* @__PURE__ */ f(es, { record: l, selected: l.id === n, onSelect: () => r(l.id) }, l.id))
2839
2847
  ] }),
2840
- /* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */ w("div", { children: [
2841
- /* @__PURE__ */ w("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
2842
- /* @__PURE__ */ w("div", { children: [
2843
- /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
2848
+ /* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */ v("div", { children: [
2849
+ /* @__PURE__ */ v("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
2850
+ /* @__PURE__ */ v("div", { children: [
2851
+ /* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
2844
2852
  G.cloneElement(_e[o.status].icon, { color: _e[o.status].color, size: 18 }),
2845
2853
  /* @__PURE__ */ f("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children: _e[o.status].label })
2846
2854
  ] }),
2847
- /* @__PURE__ */ w("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
2848
- /* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
2855
+ /* @__PURE__ */ v("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
2856
+ /* @__PURE__ */ v("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
2849
2857
  /* @__PURE__ */ f(kt, { size: 13 }),
2850
2858
  " ",
2851
2859
  qe(o.triggeredAt),
2852
2860
  o.completedAt && ` → ${qe(o.completedAt)} (${vn(o.triggeredAt, o.completedAt)})`
2853
2861
  ] }),
2854
- o.triggeredBy && /* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
2862
+ o.triggeredBy && /* @__PURE__ */ v("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
2855
2863
  /* @__PURE__ */ f(rr, { size: 13 }),
2856
2864
  " ",
2857
2865
  o.triggeredBy
@@ -2868,15 +2876,15 @@ const ps = ({ records: e, onViewOnCanvas: t }) => {
2868
2876
  )
2869
2877
  ] }),
2870
2878
  o.error && /* @__PURE__ */ f("div", { style: { margin: "12px 16px", padding: "10px 14px", borderRadius: 6, background: "#ffebee", color: "#c62828", fontSize: 13 }, children: o.error }),
2871
- /* @__PURE__ */ w("div", { children: [
2872
- /* @__PURE__ */ w("div", { style: { padding: "10px 12px", fontSize: 12, fontWeight: 600, color: "#757575", borderBottom: "1px solid #f0f0f0" }, children: [
2879
+ /* @__PURE__ */ v("div", { children: [
2880
+ /* @__PURE__ */ v("div", { style: { padding: "10px 12px", fontSize: 12, fontWeight: 600, color: "#757575", borderBottom: "1px solid #f0f0f0" }, children: [
2873
2881
  "STEPS (",
2874
2882
  o.steps.length,
2875
2883
  ")"
2876
2884
  ] }),
2877
2885
  o.steps.map((l, d) => /* @__PURE__ */ f(Qi, { step: l }, `${l.nodeId}-${d}`))
2878
2886
  ] }),
2879
- o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ f("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */ w("details", { children: [
2887
+ o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ f("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */ v("details", { children: [
2880
2888
  /* @__PURE__ */ f("summary", { style: { cursor: "pointer", fontSize: 12, fontWeight: 600, color: "#757575", marginBottom: 6 }, children: "TRIGGER INPUTS" }),
2881
2889
  /* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 10, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(o.inputs, null, 2) })
2882
2890
  ] }) })