@notmrabhi/flowforge 0.1.12 → 0.1.13

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,15 +1,15 @@
1
- import { jsxs as m, jsx as f, Fragment as Lt } from "react/jsx-runtime";
1
+ import { jsxs as w, jsx as f, Fragment as Lt } from "react/jsx-runtime";
2
2
  import P, { useRef as pt, useEffect as ie, useState as j, useMemo as W, useCallback as Y } from "react";
3
3
  import _r, { useStore as Tr, useReactFlow as Nr, Background as Cr, Controls as Sr, MiniMap as Ir } from "reactflow";
4
4
  import "reactflow/dist/style.css";
5
- import { e as Or, G as Mr, E as jr, P as Fr, L as zr, d as Rr, f as Dr } from "./GatewayBranchEdge-BudlH-Ea.js";
5
+ import { e as Or, G as Mr, E as jr, P as Fr, L as zr, d as Rr, f as Dr } from "./GatewayBranchEdge-DH-aHDPm.js";
6
6
  import { Dialog as Lr, Box as te, Drawer as Ar, IconButton as bt, Button as yt } from "@mui/material";
7
7
  import { MdClose as Pr, MdCalendarToday as Br, MdBolt as Wr, MdArrowBack as Gr, MdChevronRight as At, MdAddCircleOutline as $r, MdApps as Yr, MdErrorOutline as Kr, MdAccountTree as Ur, MdAdd as Vr, MdSearch as Hr, MdCategory as qr, MdCancel as Pt, MdError as Bt, MdCheckCircle as Wt, MdPlayArrow as Gt, MdHourglassEmpty as Xr, MdSchedule as mt, MdPerson as Jr, MdExpandLess as Zr, MdExpandMore as Qr } from "react-icons/md";
8
8
  import { GrTrigger as en } from "react-icons/gr";
9
9
  import { BiCollapse as tn, BiExpand as rn } from "react-icons/bi";
10
10
  import { b as nn } from "./index-CxVqPygT.js";
11
11
  import { m as on } from "./messages-CO299wPN.js";
12
- import { T as sn, E as q } from "./canvasTokens-CAD6G24b.js";
12
+ import { T as sn, E as J } from "./canvasTokens-CAD6G24b.js";
13
13
  var $t = Object.defineProperty, ln = (e, t, r) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, dn = (e, t) => {
14
14
  for (var r in t) $t(e, r, { get: t[r], enumerable: !0 });
15
15
  }, an = (e, t, r) => ln(e, t + "", r), Yt = {};
@@ -1657,17 +1657,17 @@ const ji = (e) => {
1657
1657
  Object.keys(i).length !== 0 && (n.current = r, e(i));
1658
1658
  }, [r]), null;
1659
1659
  }, Se = ({ isOpen: e, onClose: t, title: r, icon: n, children: o, footer: i, width: s = 600 }) => {
1660
- const [l, a] = j(!1), d = () => a((h) => !h), c = () => /* @__PURE__ */ m(te, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
1660
+ const [l, a] = j(!1), d = () => a((h) => !h), c = () => /* @__PURE__ */ w(te, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
1661
1661
  n && /* @__PURE__ */ f(te, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: n }),
1662
1662
  /* @__PURE__ */ f("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 500, color: "#212121" }, children: r }),
1663
1663
  /* @__PURE__ */ f(bt, { onClick: d, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ f(tn, {}) : /* @__PURE__ */ f(rn, {}) }),
1664
1664
  /* @__PURE__ */ f(bt, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ f(Pr, {}) })
1665
1665
  ] }), u = () => i ? /* @__PURE__ */ f(te, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
1666
- return l ? /* @__PURE__ */ m(Lr, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
1666
+ return l ? /* @__PURE__ */ w(Lr, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
1667
1667
  /* @__PURE__ */ f(c, {}),
1668
1668
  /* @__PURE__ */ f(te, { sx: { flexGrow: 1, overflowY: "auto", p: 0 }, children: o }),
1669
1669
  /* @__PURE__ */ f(u, {})
1670
- ] }) : /* @__PURE__ */ m(
1670
+ ] }) : /* @__PURE__ */ w(
1671
1671
  Ar,
1672
1672
  {
1673
1673
  anchor: "right",
@@ -1698,10 +1698,10 @@ const ji = (e) => {
1698
1698
  ]
1699
1699
  }
1700
1700
  );
1701
- }, zi = ({ open: e, templates: t, messages: r, onSelect: n, onClose: o }) => /* @__PURE__ */ f(Se, { isOpen: e, onClose: o, title: r.addTriggerTitle, icon: /* @__PURE__ */ f(en, {}), width: 500, children: /* @__PURE__ */ m(te, { sx: { p: 2 }, children: [
1701
+ }, zi = ({ open: e, templates: t, messages: r, onSelect: n, onClose: o }) => /* @__PURE__ */ f(Se, { isOpen: e, onClose: o, title: r.addTriggerTitle, icon: /* @__PURE__ */ f(en, {}), width: 500, children: /* @__PURE__ */ w(te, { sx: { p: 2 }, children: [
1702
1702
  /* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: r.chooseTrigger }),
1703
- /* @__PURE__ */ m("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
1704
- t.map((i) => /* @__PURE__ */ m(
1703
+ /* @__PURE__ */ w("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
1704
+ t.map((i) => /* @__PURE__ */ w(
1705
1705
  "div",
1706
1706
  {
1707
1707
  className: "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-start ff-gap-3",
@@ -1720,7 +1720,7 @@ const ji = (e) => {
1720
1720
  },
1721
1721
  children: [
1722
1722
  /* @__PURE__ */ f("div", { style: { color: i.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: i.triggerCategory === "scheduler" ? /* @__PURE__ */ f(Br, { size: 18 }) : /* @__PURE__ */ f(Wr, { size: 18 }) }),
1723
- /* @__PURE__ */ m("div", { children: [
1723
+ /* @__PURE__ */ w("div", { children: [
1724
1724
  /* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: i.label }),
1725
1725
  i.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: i.description })
1726
1726
  ] })
@@ -1764,8 +1764,8 @@ const ji = (e) => {
1764
1764
  title: c ? r.addStepTitle : d.label,
1765
1765
  icon: c ? /* @__PURE__ */ f($r, {}) : d.icon ?? /* @__PURE__ */ f(Yr, {}),
1766
1766
  width: 500,
1767
- children: /* @__PURE__ */ m(te, { sx: { p: 2 }, children: [
1768
- !c && /* @__PURE__ */ m(
1767
+ children: /* @__PURE__ */ w(te, { sx: { p: 2 }, children: [
1768
+ !c && /* @__PURE__ */ w(
1769
1769
  "div",
1770
1770
  {
1771
1771
  role: "button",
@@ -1783,8 +1783,8 @@ const ji = (e) => {
1783
1783
  }
1784
1784
  ),
1785
1785
  /* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? r.chooseAction : `Pick an action from ${d.label}` }),
1786
- /* @__PURE__ */ f("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ m(Lt, { children: [
1787
- i.map((u) => /* @__PURE__ */ m(
1786
+ /* @__PURE__ */ f("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ w(Lt, { children: [
1787
+ i.map((u) => /* @__PURE__ */ w(
1788
1788
  "div",
1789
1789
  {
1790
1790
  className: Be,
@@ -1803,7 +1803,7 @@ const ji = (e) => {
1803
1803
  },
1804
1804
  children: [
1805
1805
  u.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0 }, children: u.icon }),
1806
- /* @__PURE__ */ m("div", { style: { flex: 1, minWidth: 0 }, children: [
1806
+ /* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
1807
1807
  /* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: u.label }),
1808
1808
  /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: u.description ?? `${u.descriptors.length} action${u.descriptors.length === 1 ? "" : "s"}` })
1809
1809
  ] }),
@@ -1812,7 +1812,7 @@ const ji = (e) => {
1812
1812
  },
1813
1813
  `app-${u.key}`
1814
1814
  )),
1815
- s.map((u) => /* @__PURE__ */ m(
1815
+ s.map((u) => /* @__PURE__ */ w(
1816
1816
  "div",
1817
1817
  {
1818
1818
  className: Be,
@@ -1839,7 +1839,7 @@ const ji = (e) => {
1839
1839
  i.length === 0 && s.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: r.noActions })
1840
1840
  ] }) : (
1841
1841
  /* Stage 2 — actions for the selected app */
1842
- d.descriptors.map((u) => /* @__PURE__ */ m(
1842
+ d.descriptors.map((u) => /* @__PURE__ */ w(
1843
1843
  "div",
1844
1844
  {
1845
1845
  className: Be,
@@ -1886,7 +1886,7 @@ const ji = (e) => {
1886
1886
  N = !0;
1887
1887
  };
1888
1888
  }, [r, t]);
1889
- const y = t ? `node-config-form-${t}` : "node-config-form", p = !d && !u && l.length > 0, v = p ? /* @__PURE__ */ m(Lt, { children: [
1889
+ const y = t ? `node-config-form-${t}` : "node-config-form", p = !d && !u && l.length > 0, v = p ? /* @__PURE__ */ w(Lt, { children: [
1890
1890
  /* @__PURE__ */ f(yt, { type: "button", variant: "outlined", size: "small", onClick: s, children: o.cancel }),
1891
1891
  /* @__PURE__ */ f(yt, { type: "submit", form: y, variant: "contained", size: "small", children: o.save })
1892
1892
  ] }) : null;
@@ -1899,7 +1899,7 @@ const ji = (e) => {
1899
1899
  icon: r == null ? void 0 : r.icon,
1900
1900
  width: 500,
1901
1901
  footer: v,
1902
- children: /* @__PURE__ */ m(te, { sx: { p: 2 }, children: [
1902
+ children: /* @__PURE__ */ w(te, { sx: { p: 2 }, children: [
1903
1903
  d && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
1904
1904
  !d && u && /* @__PURE__ */ f("p", { style: { fontSize: 13, color: "#d32f2f" }, children: u }),
1905
1905
  !d && !u && l.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
@@ -1943,14 +1943,14 @@ const ji = (e) => {
1943
1943
  title: n ? `Preview: ${n}` : "Sub-Workflow Preview",
1944
1944
  icon: /* @__PURE__ */ f(Ur, { size: 18, color: "#00695c" }),
1945
1945
  width: 700,
1946
- children: /* @__PURE__ */ m("div", { style: { height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: 24 }, children: [
1946
+ children: /* @__PURE__ */ w("div", { style: { height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: 24 }, children: [
1947
1947
  i.status === "idle" && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", fontSize: 14 }, children: "Select a workflow to preview" }),
1948
- i.status === "loading" && /* @__PURE__ */ m("div", { style: { textAlign: "center", color: "#9e9e9e" }, children: [
1948
+ i.status === "loading" && /* @__PURE__ */ w("div", { style: { textAlign: "center", color: "#9e9e9e" }, children: [
1949
1949
  /* @__PURE__ */ f("div", { style: { width: 32, height: 32, borderRadius: "50%", border: "3px solid #e0e0e0", borderTopColor: "#00897b", animation: "spin 0.8s linear infinite", margin: "0 auto 12px" } }),
1950
1950
  /* @__PURE__ */ f("span", { style: { fontSize: 14 }, children: "Loading workflow…" }),
1951
1951
  /* @__PURE__ */ f("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
1952
1952
  ] }),
1953
- i.status === "error" && /* @__PURE__ */ m("div", { style: { textAlign: "center", color: "#c62828" }, children: [
1953
+ i.status === "error" && /* @__PURE__ */ w("div", { style: { textAlign: "center", color: "#c62828" }, children: [
1954
1954
  /* @__PURE__ */ f(Kr, { size: 32, style: { marginBottom: 8 } }),
1955
1955
  /* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: i.message })
1956
1956
  ] }),
@@ -2030,13 +2030,13 @@ function Wi(e, t, r, n) {
2030
2030
  }, b = (p, v, N) => {
2031
2031
  const O = v + 180, M = t[p], F = Object.keys(M), B = u.get(p), re = (B == null ? void 0 : B.branchLabels) ?? { pass: "Pass", fail: "Fail" }, he = d[p], z = n[p] ?? { height: 80 }, me = he.y + z.height, we = [];
2032
2032
  let U = N;
2033
- return F.forEach((le, X) => {
2034
- const R = M[le], J = U;
2033
+ return F.forEach((le, Z) => {
2034
+ const R = M[le], V = U;
2035
2035
  we.push({
2036
- y: J - me,
2036
+ y: V - me,
2037
2037
  label: re[le] ?? le,
2038
- isPass: X === 0
2039
- }), U = g(R, O, U + a), X < F.length - 1 && (U += l);
2038
+ isPass: Z === 0
2039
+ }), U = g(R, O, U + a), Z < F.length - 1 && (U += l);
2040
2040
  }), c[p] = {
2041
2041
  branches: we,
2042
2042
  height: U - me,
@@ -2180,44 +2180,44 @@ const Dt = ({
2180
2180
  snapGrid: we = [15, 15],
2181
2181
  branchLayout: U = "horizontal",
2182
2182
  nodeBody: le = "full"
2183
- } = d, X = W(() => on(a), [a]), [R, J] = j(() => (r == null ? void 0 : r.slots) ?? zt()), [V, Z] = j(() => (r == null ? void 0 : r.branches) ?? {}), [de, $] = j(null), [Ie, Ze] = j(null), [ae, ve] = j(null), [Oe, Qe] = j(null), [Ee, et] = j(null), [Q, tt] = j(() => {
2184
- const w = r == null ? void 0 : r.slots.find((k) => k.kind === "triggerFixed"), E = w != null && w.id.startsWith("trigger-") ? w.id.slice(8) : void 0;
2183
+ } = d, Z = W(() => on(a), [a]), [R, V] = j(() => (r == null ? void 0 : r.slots) ?? zt()), [H, q] = j(() => (r == null ? void 0 : r.branches) ?? {}), [de, $] = j(null), [Ie, Ze] = j(null), [ae, ve] = j(null), [Oe, Qe] = j(null), [Ee, et] = j(null), [Q, tt] = j(() => {
2184
+ const m = r == null ? void 0 : r.slots.find((k) => k.kind === "triggerFixed"), E = m != null && m.id.startsWith("trigger-") ? m.id.slice(8) : void 0;
2185
2185
  return E ? t.lookup(E) ?? null : null;
2186
- }), [rt, br] = j({}), yr = Y((w) => {
2187
- br(w);
2186
+ }), [rt, br] = j({}), yr = Y((m) => {
2187
+ br(m);
2188
2188
  }, []), mr = W(() => ({ ...Or, ...n }), [n]), wr = W(() => ({ ...Pi, ...o }), [o]), vr = W(() => {
2189
- const w = R.filter((k) => k.kind === "userTask").length, E = Object.values(V).flatMap((k) => Object.values(k).flat()).filter((k) => k.kind === "userTask").length;
2190
- return w + E;
2191
- }, [R, V]), nt = b ?? (Q == null ? void 0 : Q.maxTasks), ot = nt !== void 0 && vr >= nt, ne = Y((w) => {
2192
- const E = R.find((k) => k.id === w);
2189
+ const m = R.filter((k) => k.kind === "userTask").length, E = Object.values(H).flatMap((k) => Object.values(k).flat()).filter((k) => k.kind === "userTask").length;
2190
+ return m + E;
2191
+ }, [R, H]), nt = b ?? (Q == null ? void 0 : Q.maxTasks), ot = nt !== void 0 && vr >= nt, ne = Y((m) => {
2192
+ const E = R.find((k) => k.id === m);
2193
2193
  if (E) return E;
2194
- for (const k of Object.values(V)) {
2195
- const C = Object.values(k).flat().find((x) => x.id === w);
2194
+ for (const k of Object.values(H)) {
2195
+ const C = Object.values(k).flat().find((x) => x.id === m);
2196
2196
  if (C) return C;
2197
2197
  }
2198
2198
  return null;
2199
- }, [R, V]), Me = Y((w) => {
2200
- s || (Ze(w), $("nodeConfig"));
2201
- }, [s]), it = Y((w) => {
2199
+ }, [R, H]), Me = Y((m) => {
2200
+ s || (Ze(m), $("nodeConfig"));
2201
+ }, [s]), it = Y((m) => {
2202
2202
  if (!s) {
2203
- if (R.some((E) => E.id === w)) {
2204
- const E = R.find((k) => k.id === w);
2203
+ if (R.some((E) => E.id === m)) {
2204
+ const E = R.find((k) => k.id === m);
2205
2205
  if ((E == null ? void 0 : E.kind) === "triggerFixed") {
2206
- J(zt()), Z({}), tt(null);
2206
+ V(zt()), q({}), tt(null);
2207
2207
  return;
2208
2208
  }
2209
- J((k) => {
2210
- const C = k.filter((x) => x.id !== w);
2209
+ V((k) => {
2210
+ const C = k.filter((x) => x.id !== m);
2211
2211
  return oe((E == null ? void 0 : E.kind) ?? "") && !C.some((x) => x.kind === "end") ? [...C, { id: "end", kind: "end", reactFlowType: "endNode" }] : C;
2212
- }), Z((k) => {
2212
+ }), q((k) => {
2213
2213
  const C = { ...k }, x = (_) => {
2214
2214
  C[_] && (Object.values(C[_]).flat().filter((T) => oe(T.kind)).forEach((T) => x(T.id)), delete C[_]);
2215
2215
  };
2216
- return x(w), C;
2216
+ return x(m), C;
2217
2217
  });
2218
2218
  return;
2219
2219
  }
2220
- Z((E) => {
2220
+ q((E) => {
2221
2221
  const k = (x, _) => {
2222
2222
  const T = [];
2223
2223
  for (const S of x)
@@ -2226,10 +2226,10 @@ const Dt = ({
2226
2226
  }, C = { ...E };
2227
2227
  for (const x of Object.keys(C))
2228
2228
  for (const _ of Object.keys(C[x])) {
2229
- const T = C[x][_], S = T.findIndex((A) => A.id === w);
2229
+ const T = C[x][_], S = T.findIndex((A) => A.id === m);
2230
2230
  if (S === -1 || T[S].kind === "end") continue;
2231
2231
  const I = T[S];
2232
- let D = T.filter((A) => A.id !== w);
2232
+ let D = T.filter((A) => A.id !== m);
2233
2233
  return I.kind === "filter" && ((I.id in C ? k([I], C) : []).forEach((L) => delete C[L]), delete C[I.id], D.some((L) => L.kind === "end") || (D = [...D, { id: `end-${x}-${_}`, kind: "end", reactFlowType: "endNode" }])), C[x] = { ...C[x], [_]: D }, C;
2234
2234
  }
2235
2235
  return C;
@@ -2237,38 +2237,42 @@ const Dt = ({
2237
2237
  }
2238
2238
  }, [s, R]), je = Y(() => {
2239
2239
  s || $("triggerSelect");
2240
- }, [s]), st = Y((w, E) => {
2241
- s || ot || (ve(w), Qe(E.filterId && E.branch ? { filterId: E.filterId, branch: E.branch } : null), $("nodePicker"));
2242
- }, [s, ot]), lt = Y((w) => {
2243
- tt(w), $(null), Z({}), J([
2240
+ }, [s]), st = Y((m, E) => {
2241
+ s || ot || (ve(m), Qe(E.filterId && E.branch ? { filterId: E.filterId, branch: E.branch } : null), $("nodePicker"));
2242
+ }, [s, ot]), lt = Y((m) => {
2243
+ if (tt(m), $(null), m.skeletonState) {
2244
+ q(m.skeletonState.branches ?? {}), V(m.skeletonState.slots ?? []);
2245
+ return;
2246
+ }
2247
+ q({}), V([
2244
2248
  { id: "start", kind: "start", reactFlowType: "startNode" },
2245
2249
  {
2246
- id: `trigger-${w.triggerKey}`,
2250
+ id: `trigger-${m.triggerKey}`,
2247
2251
  kind: "triggerFixed",
2248
2252
  reactFlowType: "triggerNode",
2249
- nodeData: { label: w.label, source: w.source },
2253
+ nodeData: { label: m.label, source: m.source },
2250
2254
  deletable: !1
2251
2255
  },
2252
2256
  { id: "end", kind: "end", reactFlowType: "endNode" }
2253
2257
  ]);
2254
2258
  }, []), dt = Y(() => {
2255
- const w = e.list();
2256
- return (Q != null && Q.availableTasks ? w.filter((k) => Q.availableTasks.includes(k.type)) : w).filter((k) => k.maxPerWorkflow === void 0 ? !0 : R.filter((x) => x.descriptorType === k.type).length + Object.values(V).flatMap((x) => Object.values(x).flat()).filter((x) => x.descriptorType === k.type).length < k.maxPerWorkflow);
2257
- }, [e, Q, R, V]), at = Y((w) => {
2259
+ const m = e.list();
2260
+ return (Q != null && Q.availableTasks ? m.filter((k) => Q.availableTasks.includes(k.type)) : m).filter((k) => k.maxPerWorkflow === void 0 ? !0 : R.filter((x) => x.descriptorType === k.type).length + Object.values(H).flatMap((x) => Object.values(x).flat()).filter((x) => x.descriptorType === k.type).length < k.maxPerWorkflow);
2261
+ }, [e, Q, R, H]), at = Y((m) => {
2258
2262
  if (!ae) return;
2259
- const E = `${w.type}-${Date.now()}`, k = w.reactFlowType === "filterNode" || w.reactFlowType === "approvalNode" || w.reactFlowType === "conditionBranchNode", C = w.branchLabels ?? { pass: "Pass", fail: "Fail" }, x = {
2263
+ const E = `${m.type}-${Date.now()}`, k = m.reactFlowType === "filterNode" || m.reactFlowType === "approvalNode" || m.reactFlowType === "conditionBranchNode", C = m.branchLabels ?? { pass: "Pass", fail: "Fail" }, x = {
2260
2264
  id: E,
2261
- kind: k ? w.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
2262
- reactFlowType: w.reactFlowType,
2263
- descriptorType: w.type,
2265
+ kind: k ? m.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
2266
+ reactFlowType: m.reactFlowType,
2267
+ descriptorType: m.type,
2264
2268
  formData: {},
2265
- nodeData: { title: w.label },
2269
+ nodeData: { title: m.label },
2266
2270
  deletable: !0,
2267
2271
  branchLabels: C
2268
2272
  };
2269
2273
  if (Oe) {
2270
2274
  const { filterId: _, branch: T } = Oe;
2271
- Z((S) => {
2275
+ q((S) => {
2272
2276
  const I = [...S[_][T]];
2273
2277
  if (k) {
2274
2278
  const ee = I.filter((ce) => ce.kind !== "end"), gt = ee.findIndex((ce) => ce.id === ae), xr = gt === -1 ? ee.length : gt + 1;
@@ -2284,33 +2288,33 @@ const Dt = ({
2284
2288
  return I.splice(L, 0, x), { ...S, [_]: { ...S[_], [T]: I } };
2285
2289
  });
2286
2290
  } else
2287
- k ? (J((_) => {
2291
+ k ? (V((_) => {
2288
2292
  const T = _.findIndex((I) => I.id === ae);
2289
2293
  return [..._.filter((I) => I.kind !== "end").slice(0, T + 1), x];
2290
- }), Z((_) => ({
2294
+ }), q((_) => ({
2291
2295
  ..._,
2292
2296
  [E]: Object.fromEntries(
2293
2297
  Object.keys(C).map((T) => [T, [{ id: `end-${E}-${T}`, kind: "end", reactFlowType: "endNode" }]])
2294
2298
  )
2295
- }))) : J((_) => {
2299
+ }))) : V((_) => {
2296
2300
  const T = _.findIndex((S) => S.id === ae);
2297
2301
  return T === -1 ? _ : [..._.slice(0, T + 1), x, ..._.slice(T + 1)];
2298
2302
  });
2299
2303
  ve(null), Qe(null), Ze(E), $("nodeConfig");
2300
- }, [ae, Oe]), ct = Y((w, E) => {
2304
+ }, [ae, Oe]), ct = Y((m, E) => {
2301
2305
  const k = (x) => {
2302
- const _ = ne(w);
2306
+ const _ = ne(m);
2303
2307
  if ((_ == null ? void 0 : _.descriptorType) !== "conditionBranch") return x;
2304
2308
  const T = E.branchConfigs ?? [], S = T.map((L) => L.key).filter(Boolean);
2305
2309
  if (S.length === 0) return x;
2306
- const I = x[w] ?? {}, D = {};
2310
+ const I = x[m] ?? {}, D = {};
2307
2311
  S.forEach((L) => {
2308
- D[L] = I[L] ?? [{ id: `end-${w}-${L}`, kind: "end", reactFlowType: "endNode" }];
2312
+ D[L] = I[L] ?? [{ id: `end-${m}-${L}`, kind: "end", reactFlowType: "endNode" }];
2309
2313
  });
2310
2314
  const A = {};
2311
2315
  return T.forEach((L) => {
2312
2316
  L.key && (A[L.key] = L.label || L.key);
2313
- }), { ...x, [w]: D };
2317
+ }), { ...x, [m]: D };
2314
2318
  }, C = (x, _) => {
2315
2319
  if (x.descriptorType !== "conditionBranch") return { ...x, formData: _ };
2316
2320
  const T = _.branchConfigs ?? [], S = {};
@@ -2318,35 +2322,35 @@ const Dt = ({
2318
2322
  I.key && (S[I.key] = I.label || I.key);
2319
2323
  }), { ...x, formData: _, branchLabels: S };
2320
2324
  };
2321
- if (R.some((x) => x.id === w)) {
2322
- Z((x) => {
2325
+ if (R.some((x) => x.id === m)) {
2326
+ q((x) => {
2323
2327
  const _ = k(x);
2324
- return J((T) => {
2325
- const S = T.map((I) => I.id === w ? C(I, E) : I);
2328
+ return V((T) => {
2329
+ const S = T.map((I) => I.id === m ? C(I, E) : I);
2326
2330
  return i == null || i({ slots: S, branches: _ }), S;
2327
2331
  }), _;
2328
2332
  });
2329
2333
  return;
2330
2334
  }
2331
- Z((x) => {
2335
+ q((x) => {
2332
2336
  const T = { ...k(x) };
2333
2337
  for (const S of Object.keys(T)) {
2334
- const I = (D) => D.map((A) => A.id === w ? C(A, E) : A);
2338
+ const I = (D) => D.map((A) => A.id === m ? C(A, E) : A);
2335
2339
  for (const D of Object.keys(T[S]))
2336
- if (T[S][D].some((A) => A.id === w))
2340
+ if (T[S][D].some((A) => A.id === m))
2337
2341
  return T[S] = { ...T[S], [D]: I(T[S][D]) }, i == null || i({ slots: R, branches: T }), T;
2338
2342
  }
2339
2343
  return T;
2340
2344
  });
2341
- }, [R, V, ne, i]), H = W(() => ne(Ie ?? ""), [ne, Ie]), ut = W(() => H != null && H.descriptorType ? e.forType(H.descriptorType) ?? null : null, [H, e]), { nodes: ft, edges: Er } = W(
2342
- () => $i(R, V, s ? null : st, rt, l, y, U),
2343
- [R, V, s, st, rt, l, y, U]
2345
+ }, [R, H, ne, i]), X = W(() => ne(Ie ?? ""), [ne, Ie]), ut = W(() => X != null && X.descriptorType ? e.forType(X.descriptorType) ?? null : null, [X, e]), { nodes: ft, edges: Er } = W(
2346
+ () => $i(R, H, s ? null : st, rt, l, y, U),
2347
+ [R, H, s, st, rt, l, y, U]
2344
2348
  ), ht = W(() => {
2345
- const w = p ? new Map(p.steps.map((E) => [E.nodeId, E])) : null;
2349
+ const m = p ? new Map(p.steps.map((E) => [E.nodeId, E])) : null;
2346
2350
  return ft.map((E) => {
2347
2351
  let k = {};
2348
- if (w) {
2349
- const C = w.get(E.id);
2352
+ if (m) {
2353
+ const C = m.get(E.id);
2350
2354
  C && (k = { _executionStatus: C.status, _executionError: C.error });
2351
2355
  }
2352
2356
  return E.type === "subWorkflowNode" && v && (k.onPreview = (C) => {
@@ -2356,8 +2360,8 @@ const Dt = ({
2356
2360
  }), Object.keys(k).length > 0 ? { ...E, data: { ...E.data, ...k } } : E;
2357
2361
  });
2358
2362
  }, [ft, p, v, ne]), kr = W(() => ({ onEditNode: Me, onDeleteNode: it, onAddStep: () => {
2359
- }, onClickAddTrigger: je, messages: X, nodeRegistry: e, nodeBody: le }), [Me, it, je, X, e, le]);
2360
- return /* @__PURE__ */ f(Dr.Provider, { value: kr, children: /* @__PURE__ */ m(
2363
+ }, onClickAddTrigger: je, messages: Z, nodeRegistry: e, nodeBody: le }), [Me, it, je, Z, e, le]);
2364
+ return /* @__PURE__ */ f(Dr.Provider, { value: kr, children: /* @__PURE__ */ w(
2361
2365
  "div",
2362
2366
  {
2363
2367
  style: {
@@ -2376,7 +2380,7 @@ const Dt = ({
2376
2380
  "--ff-font-family": l.fontFamily
2377
2381
  },
2378
2382
  children: [
2379
- /* @__PURE__ */ m(
2383
+ /* @__PURE__ */ w(
2380
2384
  _r,
2381
2385
  {
2382
2386
  nodes: ht,
@@ -2394,7 +2398,7 @@ const Dt = ({
2394
2398
  snapToGrid: me,
2395
2399
  snapGrid: we,
2396
2400
  proOptions: { hideAttribution: !0 },
2397
- onNodeClick: (w, E) => {
2401
+ onNodeClick: (m, E) => {
2398
2402
  const k = ne(E.id);
2399
2403
  k && (g != null && g(k) || (k.kind === "addTrigger" || k.kind === "triggerFixed" ? je() : (k.kind === "userTask" || k.kind === "filter" || k.kind === "approval") && Me(E.id)));
2400
2404
  },
@@ -2413,13 +2417,13 @@ const Dt = ({
2413
2417
  ]
2414
2418
  }
2415
2419
  ),
2416
- c ? de === "triggerSelect" && c(t.list(), lt, () => $(null)) : /* @__PURE__ */ f(zi, { open: de === "triggerSelect", templates: t.list(), messages: X, onSelect: lt, onClose: () => $(null) }),
2420
+ c ? de === "triggerSelect" && c(t.list(), lt, () => $(null)) : /* @__PURE__ */ f(zi, { open: de === "triggerSelect", templates: t.list(), messages: Z, onSelect: lt, onClose: () => $(null) }),
2417
2421
  u ? de === "nodePicker" && u(dt(), at, () => {
2418
2422
  $(null), ve(null);
2419
- }) : /* @__PURE__ */ f(Ri, { open: de === "nodePicker", availableDescriptors: dt(), messages: X, onSelect: at, onClose: () => {
2423
+ }) : /* @__PURE__ */ f(Ri, { open: de === "nodePicker", availableDescriptors: dt(), messages: Z, onSelect: at, onClose: () => {
2420
2424
  $(null), ve(null);
2421
2425
  } }),
2422
- h ? de === "nodeConfig" && h(ut ?? void 0, H, ct, () => $(null)) : /* @__PURE__ */ f(Di, { open: de === "nodeConfig", nodeId: Ie, descriptor: ut, initialValues: H == null ? void 0 : H.formData, messages: X, onSave: ct, onClose: () => $(null) }),
2426
+ h ? de === "nodeConfig" && h(ut ?? void 0, X, ct, () => $(null)) : /* @__PURE__ */ f(Di, { open: de === "nodeConfig", nodeId: Ie, descriptor: ut, initialValues: X == null ? void 0 : X.formData, messages: Z, onSave: ct, onClose: () => $(null) }),
2423
2427
  v && Ee && /* @__PURE__ */ f(
2424
2428
  Li,
2425
2429
  {
@@ -2441,7 +2445,7 @@ const Dt = ({
2441
2445
  function Ki({ template: e, onSelect: t }) {
2442
2446
  var o, i;
2443
2447
  const r = e.triggerCategory ? sn[e.triggerCategory] : null, n = ((o = e.skeletonState) == null ? void 0 : o.slots.filter((s) => s.kind === "userTask").length) ?? 0;
2444
- return /* @__PURE__ */ m(
2448
+ return /* @__PURE__ */ w(
2445
2449
  "div",
2446
2450
  {
2447
2451
  role: "button",
@@ -2469,23 +2473,23 @@ function Ki({ template: e, onSelect: t }) {
2469
2473
  s.currentTarget.style.borderColor = "#e0e0e0", s.currentTarget.style.boxShadow = "none";
2470
2474
  },
2471
2475
  children: [
2472
- /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "flex-start", gap: 10 }, children: [
2476
+ /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "flex-start", gap: 10 }, children: [
2473
2477
  e.icon && /* @__PURE__ */ f("div", { style: { flexShrink: 0, width: 36, height: 36, borderRadius: 8, background: "#f5f5f5", display: "flex", alignItems: "center", justifyContent: "center" }, children: e.icon }),
2474
- /* @__PURE__ */ m("div", { style: { flex: 1, minWidth: 0 }, children: [
2478
+ /* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
2475
2479
  /* @__PURE__ */ f("div", { style: { fontWeight: 600, fontSize: 14, color: "#212121", marginBottom: 2 }, children: e.label }),
2476
2480
  e.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", lineHeight: 1.4, display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden" }, children: e.description })
2477
2481
  ] })
2478
2482
  ] }),
2479
- /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 4 }, children: [
2483
+ /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 4 }, children: [
2480
2484
  r && /* @__PURE__ */ f("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: r.bg, color: r.color }, children: r.label }),
2481
2485
  (i = e.tags) == null ? void 0 : i.map((s) => /* @__PURE__ */ f("span", { style: { fontSize: 10, padding: "2px 7px", borderRadius: 10, background: "#f5f5f5", color: "#616161" }, children: s }, s)),
2482
- n > 0 && /* @__PURE__ */ m("span", { style: { fontSize: 10, color: "#9e9e9e", marginLeft: "auto" }, children: [
2486
+ n > 0 && /* @__PURE__ */ w("span", { style: { fontSize: 10, color: "#9e9e9e", marginLeft: "auto" }, children: [
2483
2487
  n,
2484
2488
  " step",
2485
2489
  n !== 1 ? "s" : ""
2486
2490
  ] })
2487
2491
  ] }),
2488
- e.author && /* @__PURE__ */ m("div", { style: { fontSize: 11, color: "#bdbdbd" }, children: [
2492
+ e.author && /* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#bdbdbd" }, children: [
2489
2493
  "by ",
2490
2494
  e.author
2491
2495
  ] })
@@ -2516,14 +2520,14 @@ const ls = ({
2516
2520
  }
2517
2521
  return [...d].sort((c, u) => (u.popularity ?? 0) - (c.popularity ?? 0));
2518
2522
  }, [e, i, n]);
2519
- return /* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", height: "100%", fontFamily: "inherit" }, children: [
2520
- /* @__PURE__ */ m("div", { style: { padding: "24px 24px 0", borderBottom: "1px solid #f0f0f0", paddingBottom: 16 }, children: [
2521
- /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 16 }, children: [
2522
- /* @__PURE__ */ m("div", { children: [
2523
+ return /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", height: "100%", fontFamily: "inherit" }, children: [
2524
+ /* @__PURE__ */ w("div", { style: { padding: "24px 24px 0", borderBottom: "1px solid #f0f0f0", paddingBottom: 16 }, children: [
2525
+ /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 16 }, children: [
2526
+ /* @__PURE__ */ w("div", { children: [
2523
2527
  /* @__PURE__ */ f("h2", { style: { margin: 0, fontSize: 20, fontWeight: 700, color: "#212121" }, children: "Workflow Templates" }),
2524
2528
  /* @__PURE__ */ f("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#757575" }, children: "Choose a pre-built template or start from scratch" })
2525
2529
  ] }),
2526
- r && /* @__PURE__ */ m(
2530
+ r && /* @__PURE__ */ w(
2527
2531
  "button",
2528
2532
  {
2529
2533
  onClick: r,
@@ -2535,7 +2539,7 @@ const ls = ({
2535
2539
  }
2536
2540
  )
2537
2541
  ] }),
2538
- /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center", gap: 8, background: "#f5f5f5", borderRadius: 8, padding: "8px 12px", marginBottom: 12 }, children: [
2542
+ /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, background: "#f5f5f5", borderRadius: 8, padding: "8px 12px", marginBottom: 12 }, children: [
2539
2543
  /* @__PURE__ */ f(Hr, { size: 18, color: "#9e9e9e" }),
2540
2544
  /* @__PURE__ */ f(
2541
2545
  "input",
@@ -2567,22 +2571,22 @@ const ls = ({
2567
2571
  d
2568
2572
  )) })
2569
2573
  ] }),
2570
- /* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: a.length === 0 ? /* @__PURE__ */ m("div", { style: { textAlign: "center", padding: "40px 0", color: "#9e9e9e" }, children: [
2574
+ /* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: a.length === 0 ? /* @__PURE__ */ w("div", { style: { textAlign: "center", padding: "40px 0", color: "#9e9e9e" }, children: [
2571
2575
  /* @__PURE__ */ f(qr, { size: 36, style: { marginBottom: 8 } }),
2572
2576
  /* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
2573
2577
  ] }) : /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: a.map((d) => /* @__PURE__ */ f(Ki, { template: d, onSelect: () => t(d) }, d.triggerKey)) }) })
2574
2578
  ] });
2575
2579
  }, ke = {
2576
- running: { label: "Running", color: q.running, icon: P.createElement(Gt, { size: 14 }) },
2577
- success: { label: "Success", color: q.success, icon: P.createElement(Wt, { size: 14 }) },
2578
- failed: { label: "Failed", color: q.failed, icon: P.createElement(Bt, { size: 14 }) },
2579
- cancelled: { label: "Cancelled", color: q.cancelled, icon: P.createElement(Pt, { size: 14 }) }
2580
+ running: { label: "Running", color: J.running, icon: P.createElement(Gt, { size: 14 }) },
2581
+ success: { label: "Success", color: J.success, icon: P.createElement(Wt, { size: 14 }) },
2582
+ failed: { label: "Failed", color: J.failed, icon: P.createElement(Bt, { size: 14 }) },
2583
+ cancelled: { label: "Cancelled", color: J.cancelled, icon: P.createElement(Pt, { size: 14 }) }
2580
2584
  }, Ui = {
2581
- pending: { color: q.pending, icon: P.createElement(Xr, { size: 14 }) },
2582
- running: { color: q.running, icon: P.createElement(Gt, { size: 14 }) },
2583
- success: { color: q.success, icon: P.createElement(Wt, { size: 14 }) },
2584
- failed: { color: q.failed, icon: P.createElement(Bt, { size: 14 }) },
2585
- skipped: { color: q.skipped, icon: P.createElement(Pt, { size: 14 }) }
2585
+ pending: { color: J.pending, icon: P.createElement(Xr, { size: 14 }) },
2586
+ running: { color: J.running, icon: P.createElement(Gt, { size: 14 }) },
2587
+ success: { color: J.success, icon: P.createElement(Wt, { size: 14 }) },
2588
+ failed: { color: J.failed, icon: P.createElement(Bt, { size: 14 }) },
2589
+ skipped: { color: J.skipped, icon: P.createElement(Pt, { size: 14 }) }
2586
2590
  };
2587
2591
  function Ue(e) {
2588
2592
  try {
@@ -2601,8 +2605,8 @@ function pr(e, t) {
2601
2605
  }
2602
2606
  function Vi({ step: e }) {
2603
2607
  const [t, r] = j(!1), n = Ui[e.status], o = !!(e.inputs || e.outputs || e.error);
2604
- return /* @__PURE__ */ m("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
2605
- /* @__PURE__ */ m(
2608
+ return /* @__PURE__ */ w("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
2609
+ /* @__PURE__ */ w(
2606
2610
  "div",
2607
2611
  {
2608
2612
  style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 12px", cursor: o ? "pointer" : "default" },
@@ -2623,13 +2627,13 @@ function Vi({ step: e }) {
2623
2627
  ]
2624
2628
  }
2625
2629
  ),
2626
- t && o && /* @__PURE__ */ m("div", { style: { padding: "0 12px 10px 32px", fontSize: 12 }, children: [
2630
+ t && o && /* @__PURE__ */ w("div", { style: { padding: "0 12px 10px 32px", fontSize: 12 }, children: [
2627
2631
  e.error && /* @__PURE__ */ f("div", { style: { padding: "6px 10px", borderRadius: 6, background: "#ffebee", color: "#c62828", marginBottom: 6 }, children: e.error }),
2628
- e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */ m("details", { style: { marginBottom: 4 }, children: [
2632
+ e.inputs && Object.keys(e.inputs).length > 0 && /* @__PURE__ */ w("details", { style: { marginBottom: 4 }, children: [
2629
2633
  /* @__PURE__ */ f("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Inputs" }),
2630
2634
  /* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.inputs, null, 2) })
2631
2635
  ] }),
2632
- e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */ m("details", { children: [
2636
+ e.outputs && Object.keys(e.outputs).length > 0 && /* @__PURE__ */ w("details", { children: [
2633
2637
  /* @__PURE__ */ f("summary", { style: { cursor: "pointer", color: "#616161", marginBottom: 4 }, children: "Outputs" }),
2634
2638
  /* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(e.outputs, null, 2) })
2635
2639
  ] })
@@ -2638,7 +2642,7 @@ function Vi({ step: e }) {
2638
2642
  }
2639
2643
  function Hi({ record: e, selected: t, onSelect: r }) {
2640
2644
  const n = ke[e.status];
2641
- return /* @__PURE__ */ m(
2645
+ return /* @__PURE__ */ w(
2642
2646
  "div",
2643
2647
  {
2644
2648
  role: "button",
@@ -2659,9 +2663,9 @@ function Hi({ record: e, selected: t, onSelect: r }) {
2659
2663
  },
2660
2664
  children: [
2661
2665
  /* @__PURE__ */ f("span", { style: { color: n.color, flexShrink: 0 }, children: P.cloneElement(n.icon, { color: n.color, size: 16 }) }),
2662
- /* @__PURE__ */ m("div", { style: { flex: 1, minWidth: 0 }, children: [
2666
+ /* @__PURE__ */ w("div", { style: { flex: 1, minWidth: 0 }, children: [
2663
2667
  /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#212121", fontWeight: t ? 600 : 400, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: Ue(e.triggeredAt) }),
2664
- /* @__PURE__ */ m("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
2668
+ /* @__PURE__ */ w("div", { style: { fontSize: 11, color: "#9e9e9e" }, children: [
2665
2669
  e.triggeredBy ? `by ${e.triggeredBy}` : "System",
2666
2670
  " · ",
2667
2671
  e.steps.length,
@@ -2678,34 +2682,34 @@ function Hi({ record: e, selected: t, onSelect: r }) {
2678
2682
  const ds = ({ records: e, onViewOnCanvas: t }) => {
2679
2683
  var s;
2680
2684
  const [r, n] = j(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === r) ?? null, i = [...e].sort((l, a) => new Date(a.triggeredAt).getTime() - new Date(l.triggeredAt).getTime());
2681
- return e.length === 0 ? /* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
2685
+ return e.length === 0 ? /* @__PURE__ */ w("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
2682
2686
  /* @__PURE__ */ f(mt, { size: 36 }),
2683
2687
  /* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
2684
2688
  /* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 12 }, children: "Run history will appear here" })
2685
- ] }) : /* @__PURE__ */ m("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
2686
- /* @__PURE__ */ m("div", { style: { width: 260, flexShrink: 0, borderRight: "1px solid #e0e0e0", overflowY: "auto", background: "#fafafa" }, children: [
2687
- /* @__PURE__ */ m("div", { style: { padding: "12px 14px", borderBottom: "1px solid #e0e0e0", fontWeight: 600, fontSize: 13, color: "#212121" }, children: [
2689
+ ] }) : /* @__PURE__ */ w("div", { style: { display: "flex", height: "100%", fontFamily: "inherit", border: "1px solid #e0e0e0", borderRadius: 8, overflow: "hidden" }, children: [
2690
+ /* @__PURE__ */ w("div", { style: { width: 260, flexShrink: 0, borderRight: "1px solid #e0e0e0", overflowY: "auto", background: "#fafafa" }, children: [
2691
+ /* @__PURE__ */ w("div", { style: { padding: "12px 14px", borderBottom: "1px solid #e0e0e0", fontWeight: 600, fontSize: 13, color: "#212121" }, children: [
2688
2692
  "Run History (",
2689
2693
  e.length,
2690
2694
  ")"
2691
2695
  ] }),
2692
2696
  i.map((l) => /* @__PURE__ */ f(Hi, { record: l, selected: l.id === r, onSelect: () => n(l.id) }, l.id))
2693
2697
  ] }),
2694
- /* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */ m("div", { children: [
2695
- /* @__PURE__ */ m("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
2696
- /* @__PURE__ */ m("div", { children: [
2697
- /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
2698
+ /* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */ w("div", { children: [
2699
+ /* @__PURE__ */ w("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
2700
+ /* @__PURE__ */ w("div", { children: [
2701
+ /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
2698
2702
  P.cloneElement(ke[o.status].icon, { color: ke[o.status].color, size: 18 }),
2699
2703
  /* @__PURE__ */ f("span", { style: { fontWeight: 700, fontSize: 15, color: "#212121" }, children: ke[o.status].label })
2700
2704
  ] }),
2701
- /* @__PURE__ */ m("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
2702
- /* @__PURE__ */ m("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
2705
+ /* @__PURE__ */ w("div", { style: { fontSize: 12, color: "#757575", display: "flex", flexDirection: "column", gap: 2 }, children: [
2706
+ /* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
2703
2707
  /* @__PURE__ */ f(mt, { size: 13 }),
2704
2708
  " ",
2705
2709
  Ue(o.triggeredAt),
2706
2710
  o.completedAt && ` → ${Ue(o.completedAt)} (${pr(o.triggeredAt, o.completedAt)})`
2707
2711
  ] }),
2708
- o.triggeredBy && /* @__PURE__ */ m("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
2712
+ o.triggeredBy && /* @__PURE__ */ w("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
2709
2713
  /* @__PURE__ */ f(Jr, { size: 13 }),
2710
2714
  " ",
2711
2715
  o.triggeredBy
@@ -2722,15 +2726,15 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
2722
2726
  )
2723
2727
  ] }),
2724
2728
  o.error && /* @__PURE__ */ f("div", { style: { margin: "12px 16px", padding: "10px 14px", borderRadius: 6, background: "#ffebee", color: "#c62828", fontSize: 13 }, children: o.error }),
2725
- /* @__PURE__ */ m("div", { children: [
2726
- /* @__PURE__ */ m("div", { style: { padding: "10px 12px", fontSize: 12, fontWeight: 600, color: "#757575", borderBottom: "1px solid #f0f0f0" }, children: [
2729
+ /* @__PURE__ */ w("div", { children: [
2730
+ /* @__PURE__ */ w("div", { style: { padding: "10px 12px", fontSize: 12, fontWeight: 600, color: "#757575", borderBottom: "1px solid #f0f0f0" }, children: [
2727
2731
  "STEPS (",
2728
2732
  o.steps.length,
2729
2733
  ")"
2730
2734
  ] }),
2731
2735
  o.steps.map((l, a) => /* @__PURE__ */ f(Vi, { step: l }, `${l.nodeId}-${a}`))
2732
2736
  ] }),
2733
- o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ f("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */ m("details", { children: [
2737
+ o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ f("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */ w("details", { children: [
2734
2738
  /* @__PURE__ */ f("summary", { style: { cursor: "pointer", fontSize: 12, fontWeight: 600, color: "#757575", marginBottom: 6 }, children: "TRIGGER INPUTS" }),
2735
2739
  /* @__PURE__ */ f("pre", { style: { margin: 0, fontSize: 11, background: "#f5f5f5", padding: 10, borderRadius: 4, overflowX: "auto" }, children: JSON.stringify(o.inputs, null, 2) })
2736
2740
  ] }) })