@w6w/ui 0.2.0 → 0.2.11

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/AppPicker.d.ts +47 -2
  3. package/dist/CanvasLayer.d.ts +38 -0
  4. package/dist/{CodeBlock-Dot3Pd7P.js → CodeBlock-BqXDA35P.js} +2 -2
  5. package/dist/{CodeBlock-Dot3Pd7P.js.map → CodeBlock-BqXDA35P.js.map} +1 -1
  6. package/dist/{CodeBlock-CZu4TFSi.cjs → CodeBlock-CulfbnZD.cjs} +2 -2
  7. package/dist/{CodeBlock-CZu4TFSi.cjs.map → CodeBlock-CulfbnZD.cjs.map} +1 -1
  8. package/dist/ConfirmModal-Ln99S9NT.js +7919 -0
  9. package/dist/ConfirmModal-Ln99S9NT.js.map +1 -0
  10. package/dist/ConfirmModal-fjHW5rN-.cjs +14 -0
  11. package/dist/ConfirmModal-fjHW5rN-.cjs.map +1 -0
  12. package/dist/Copyable-DA6eiU7w.cjs +2 -0
  13. package/dist/Copyable-DA6eiU7w.cjs.map +1 -0
  14. package/dist/{Copyable-1niV9gUa.js → Copyable-F4NTaG77.js} +91 -15
  15. package/dist/Copyable-F4NTaG77.js.map +1 -0
  16. package/dist/EditConnectionModal.d.ts +6 -1
  17. package/dist/JsonEditor.d.ts +8 -0
  18. package/dist/Markdown.d.ts +25 -0
  19. package/dist/ParamsForm.d.ts +7 -1
  20. package/dist/StepBuilderModal.d.ts +23 -5
  21. package/dist/WorkflowFlowEditor.d.ts +14 -3
  22. package/dist/app-pages.d.ts +2 -0
  23. package/dist/canvas-types.d.ts +36 -0
  24. package/dist/canvas-utils.d.ts +44 -0
  25. package/dist/code.cjs +1 -1
  26. package/dist/code.mjs +2 -2
  27. package/dist/components/AuthFieldsForm.d.ts +11 -0
  28. package/dist/components/BudgetMeter.d.ts +15 -0
  29. package/dist/components/CallableList.d.ts +3 -2
  30. package/dist/components/Combobox.d.ts +8 -1
  31. package/dist/components/ConnectionList.d.ts +2 -3
  32. package/dist/components/CredentialPicker.d.ts +35 -0
  33. package/dist/components/DataTable.d.ts +27 -0
  34. package/dist/components/EmptyState.d.ts +9 -0
  35. package/dist/components/icons.d.ts +1 -1
  36. package/dist/dynamic-fields.d.ts +60 -0
  37. package/dist/editor-theme.d.ts +24 -0
  38. package/dist/flow-fanout.d.ts +2 -2
  39. package/dist/flow-types.d.ts +18 -1
  40. package/dist/flow-utils.d.ts +10 -3
  41. package/dist/flow.cjs +2 -2
  42. package/dist/flow.cjs.map +1 -1
  43. package/dist/flow.d.ts +9 -0
  44. package/dist/flow.mjs +1519 -1138
  45. package/dist/flow.mjs.map +1 -1
  46. package/dist/index.cjs +1 -1
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.ts +14 -2
  49. package/dist/index.mjs +1362 -1123
  50. package/dist/index.mjs.map +1 -1
  51. package/dist/note-markdown.d.ts +22 -0
  52. package/dist/provider.d.ts +56 -7
  53. package/dist/resolve-params.d.ts +5 -0
  54. package/dist/run-visuals.d.ts +4 -1
  55. package/dist/step-problems.d.ts +34 -0
  56. package/dist/types.d.ts +109 -3
  57. package/dist/use-dynamic-fields.d.ts +23 -0
  58. package/package.json +4 -2
  59. package/src/styles/_budget-meter.scss +46 -0
  60. package/src/styles/_callable-list.scss +15 -6
  61. package/src/styles/_canvas.scss +318 -0
  62. package/src/styles/_connections.scss +2 -14
  63. package/src/styles/_data-table.scss +55 -0
  64. package/src/styles/_empty-state.scss +21 -0
  65. package/src/styles/_flow.scss +11 -0
  66. package/src/styles/_fx.scss +23 -0
  67. package/src/styles/_layout.scss +10 -0
  68. package/src/styles/_markdown.scss +20 -0
  69. package/src/styles/_tester.scss +1 -14
  70. package/src/styles.css +572 -39
  71. package/src/styles.scss +5 -0
  72. package/dist/ConfirmModal-ChoiGy2K.cjs +0 -11
  73. package/dist/ConfirmModal-ChoiGy2K.cjs.map +0 -1
  74. package/dist/ConfirmModal-Wx3i8F1n.js +0 -6359
  75. package/dist/ConfirmModal-Wx3i8F1n.js.map +0 -1
  76. package/dist/Copyable-1niV9gUa.js.map +0 -1
  77. package/dist/Copyable-CYZU1o4X.cjs +0 -2
  78. package/dist/Copyable-CYZU1o4X.cjs.map +0 -1
package/dist/flow.mjs CHANGED
@@ -1,38 +1,117 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as w, Fragment as B } from "react/jsx-runtime";
3
- import { addEdge as sn, ReactFlowProvider as on, useNodesState as rn, useEdgesState as an, useReactFlow as ln, ReactFlow as cn, ConnectionLineType as dn, Background as un, Controls as pn, ControlButton as fn, MiniMap as hn, Panel as vt, Position as we, NodeToolbar as wn, Handle as mn } from "@xyflow/react";
4
- import { useMemo as M, useState as S, useRef as me, useEffect as _, useCallback as J, useContext as ge, createContext as Je } from "react";
5
- import { createPortal as gn } from "react-dom";
6
- import { u as Vt, b as bn, f as vn, i as Nn, J as qe, d as yn, r as Ft, a as Cn, c as Sn, v as kn, n as le, e as Ge, g as Xe, s as Wt, h as Pe, j as Me, w as En, k as xn, l as Rn, m as Nt, o as We, p as yt, q as Tn, t as Ct, x as An, y as $t, z as Ce, A as Pn, B as In, C as Ae, D as St, E as Dn, F as Ln, G as Vn, W as Fn, H as Wn, I as $n, S as On, K as Jn, M as Ot, L as Mn, N as Jt, O as Mt, P as _t, Q as Ye, R as kt, T as Et, U as Ht, V as Bt, X as jt, Y as Ut, Z as xt, _ as Ke, $ as _n, a0 as Hn, a1 as Bn, a2 as jn, a3 as Un, a4 as zn, a5 as Rt, a6 as qn, a7 as Kn, a8 as Gn, a9 as Xn, aa as Yn, ab as Qn, ac as Zn } from "./ConfirmModal-Wx3i8F1n.js";
7
- import { ad as Hs, ae as Bs, af as js, ag as Us, ah as zs, ai as qs, aj as Ks, ak as Gs, al as Xs } from "./ConfirmModal-Wx3i8F1n.js";
8
- import { I as ye, C as es } from "./Copyable-1niV9gUa.js";
9
- const Tt = 220;
10
- function ts(e) {
11
- return e.length <= Tt ? { text: e, clipped: !1, length: e.length } : {
12
- text: e.slice(0, Tt).trimEnd(),
2
+ import { jsx as o, jsxs as m, Fragment as U } from "react/jsx-runtime";
3
+ import { addEdge as _n, ReactFlowProvider as Wn, useNodesState as Bn, useEdgesState as Jn, useReactFlow as zn, ReactFlow as Hn, ConnectionLineType as jn, Background as On, Controls as Un, ControlButton as qn, MiniMap as Kn, Panel as Vt, Position as Ne, NodeToolbar as Xn, useNodeId as Gn, Handle as Yn } from "@xyflow/react";
4
+ import { useMemo as O, useState as S, useRef as Ce, useEffect as z, useCallback as F, useContext as he, createContext as Ye } from "react";
5
+ import { createPortal as Qn } from "react-dom";
6
+ import { u as an, b as Zn, f as es, i as ts, J as it, d as ns, r as cn, a as ss, c as os, v as is, n as we, e as at, g as ct, s as ln, h as Je, j as Qe, w as rs, k as as, l as cs, m as $t, o as We, p as _t, q as ls, t as Wt, x as ds, y as dn, z as Ie, A as us, B as ps, C as Be, D as Bt, E as fs, F as hs, G as ws, W as ms, H as gs, I as Jt, K as bs, L as ys, M as zt, S as vs, N as Ns, O as un, P as pn, Q as fn, R as hn, T as lt, U as Ht, V as jt, X as wn, Y as mn, Z as gn, _ as bn, $ as Ot, a0 as rt, a1 as Cs, a2 as Ss, a3 as xs, a4 as ks, a5 as Es, a6 as Ps, a7 as Ut, a8 as Rs, a9 as Ts, aa as As, ab as Is, ac as Ds, ad as Ls, ae as Ms } from "./ConfirmModal-Ln99S9NT.js";
7
+ import { af as Vo, ag as $o, ah as _o, ai as Wo, aj as Bo, ak as Jo, al as zo, am as Ho, an as jo, ao as Oo } from "./ConfirmModal-Ln99S9NT.js";
8
+ import { I as ve, C as Fs } from "./Copyable-F4NTaG77.js";
9
+ const Vs = 200, $s = 200, _s = 10240;
10
+ function qt(e) {
11
+ const t = {};
12
+ for (const [s, r] of Object.entries(e)) t[s] = Math.round(r);
13
+ return t;
14
+ }
15
+ const Ws = (e) => !!e && Number.isFinite(e.x) && Number.isFinite(e.y), Bs = (e) => !!e && Number.isFinite(e.width) && Number.isFinite(e.height);
16
+ function Kt(e, t, s) {
17
+ return e && e.map((r) => {
18
+ const a = t == null ? void 0 : t[r.id], c = Ws(a == null ? void 0 : a.position) ? a.position : r.position, u = Bs(a == null ? void 0 : a.size) ? a.size : r.size;
19
+ return { ...r, position: qt(c), size: qt(u) };
20
+ });
21
+ }
22
+ function Js(e, t, s) {
23
+ if (!t) return e;
24
+ const r = { ...e };
25
+ return e.notes && (r.notes = Kt(e.notes, s)), e.sections && (r.sections = Kt(e.sections, s)), r;
26
+ }
27
+ function Xt(e, t) {
28
+ return e.sections ? {
29
+ ...e,
30
+ sections: e.sections.map((s) => ({
31
+ ...s,
32
+ nodes: s.nodes.filter((r) => r !== t)
33
+ }))
34
+ } : e;
35
+ }
36
+ function zs(e, t, s) {
37
+ return e.sections ? {
38
+ ...e,
39
+ sections: e.sections.map((r) => ({
40
+ ...r,
41
+ nodes: r.nodes.map((a) => a === t ? s : a)
42
+ }))
43
+ } : e;
44
+ }
45
+ function Gt(e, t, s) {
46
+ if (!e.sections) return e;
47
+ const r = new Set(s);
48
+ return {
49
+ ...e,
50
+ sections: e.sections.map((a) => {
51
+ const c = a.nodes.filter((u) => !r.has(u));
52
+ return a.id === t ? { ...a, nodes: [.../* @__PURE__ */ new Set([...c, ...s])] } : { ...a, nodes: c };
53
+ })
54
+ };
55
+ }
56
+ function Hs(e, t) {
57
+ return (e.sections ?? []).filter((s) => s.nodes.includes(t)).map((s) => s.id);
58
+ }
59
+ function js(e, t) {
60
+ const s = new TextEncoder();
61
+ if (s.encode(e).length <= t) return e;
62
+ let r = "", a = 0;
63
+ for (const c of e) {
64
+ const u = s.encode(c).length;
65
+ if (a + u > t) break;
66
+ r += c, a += u;
67
+ }
68
+ return r;
69
+ }
70
+ function Yt(e) {
71
+ const t = { ...e };
72
+ return e.notes && (t.notes = e.notes.slice(0, Vs).map((s) => ({ ...s, content: js(s.content, _s) }))), e.sections && (t.sections = e.sections.slice(0, $s)), t;
73
+ }
74
+ function Os(e, t, s) {
75
+ const r = {};
76
+ for (const u of [...e.notes ?? [], ...e.sections ?? []])
77
+ r[u.id] = { position: u.position, size: u.size };
78
+ const a = (u, b) => u == null ? void 0 : u.map((N) => {
79
+ const C = b == null ? void 0 : b.find((h) => h.id === N.id);
80
+ return C ? { ...N, position: C.position, size: C.size } : N;
81
+ }), c = s ? e : {
82
+ ...e,
83
+ ...e.notes ? { notes: a(e.notes, t == null ? void 0 : t.notes) } : {},
84
+ ...e.sections ? { sections: a(e.sections, t == null ? void 0 : t.sections) } : {}
85
+ };
86
+ return Js(c, s, r);
87
+ }
88
+ const Qt = 220;
89
+ function Us(e) {
90
+ return e.length <= Qt ? { text: e, clipped: !1, length: e.length } : {
91
+ text: e.slice(0, Qt).trimEnd(),
13
92
  clipped: !0,
14
93
  length: e.length
15
94
  };
16
95
  }
17
- function ns({
96
+ function qs({
18
97
  params: e,
19
- values: n,
20
- testStartState: o,
98
+ values: t,
99
+ testStartState: s,
21
100
  view: r = "props"
22
101
  }) {
23
- const { sampleValues: c } = Vt(), l = M(
24
- () => bn(c, o),
25
- [c, o]
26
- ), u = vn(e), y = (f) => {
27
- var a;
28
- return n[f] !== void 0 ? n[f] : (a = u.find((g) => g.key === f)) == null ? void 0 : a.default;
29
- }, C = u.filter((f) => f.type !== "section" && Nn(f, y));
102
+ const { sampleValues: a } = an(), c = O(
103
+ () => Zn(a, s),
104
+ [a, s]
105
+ ), u = es(e), b = (h) => {
106
+ var k;
107
+ return t[h] !== void 0 ? t[h] : (k = u.find((l) => l.key === h)) == null ? void 0 : k.default;
108
+ }, N = u.filter((h) => h.type !== "section" && ts(h, b));
30
109
  if (r === "code") {
31
- const f = ss(C, n, l);
32
- return /* @__PURE__ */ t("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ t(
33
- qe,
110
+ const h = Ks(N, t, c);
111
+ return /* @__PURE__ */ o("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ o(
112
+ it,
34
113
  {
35
- value: JSON.stringify(f, null, 2),
114
+ value: JSON.stringify(h, null, 2),
36
115
  onChange: () => {
37
116
  },
38
117
  readOnly: !0,
@@ -42,116 +121,116 @@ function ns({
42
121
  }
43
122
  ) });
44
123
  }
45
- const N = C.filter((f) => !yn(y(f.key), f.default));
46
- return C.length === 0 ? /* @__PURE__ */ t("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "This action takes no parameters." }) }) : N.length === 0 ? /* @__PURE__ */ t("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Every configured value matches its default — nothing to show here. Switch to JSON to see the full set." }) }) : (
124
+ const C = N.filter((h) => !ns(b(h.key), h.default));
125
+ return N.length === 0 ? /* @__PURE__ */ o("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "This action takes no parameters." }) }) : C.length === 0 ? /* @__PURE__ */ o("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Every configured value matches its default — nothing to show here. Switch to JSON to see the full set." }) }) : (
47
126
  // `.w6w-resolved-table` is the ONE grid this whole row list shares — each
48
127
  // `.w6w-resolved-row` below is `display: contents` and contributes its
49
128
  // two children straight into these column tracks, so every row's key
50
129
  // column lines up with every other row's.
51
- /* @__PURE__ */ t("div", { className: "w6w-resolved-params w6w-resolved-table", children: N.map(
52
- (f) => f.type === "vars" ? /* @__PURE__ */ t(rs, { param: f, value: n[f.key], scope: l }, f.key) : /* @__PURE__ */ t(
53
- os,
130
+ /* @__PURE__ */ o("div", { className: "w6w-resolved-params w6w-resolved-table", children: C.map(
131
+ (h) => h.type === "vars" ? /* @__PURE__ */ o(Gs, { param: h, value: t[h.key], scope: c }, h.key) : /* @__PURE__ */ o(
132
+ Xs,
54
133
  {
55
- label: f.label ?? f.key,
56
- segments: Ft(
57
- n[f.key] !== void 0 ? n[f.key] : f.default,
58
- l
134
+ label: h.label ?? h.key,
135
+ segments: cn(
136
+ t[h.key] !== void 0 ? t[h.key] : h.default,
137
+ c
59
138
  )
60
139
  },
61
- f.key
140
+ h.key
62
141
  )
63
142
  ) })
64
143
  );
65
144
  }
66
- function ss(e, n, o) {
145
+ function Ks(e, t, s) {
67
146
  const r = {};
68
- for (const c of e)
69
- if (c.type === "vars") {
70
- const l = Array.isArray(n[c.key]) ? n[c.key] : Array.isArray(c.default) ? c.default : [];
71
- r[c.key] = Cn(l, o);
147
+ for (const a of e)
148
+ if (a.type === "vars") {
149
+ const c = Array.isArray(t[a.key]) ? t[a.key] : Array.isArray(a.default) ? a.default : [];
150
+ r[a.key] = ss(c, s);
72
151
  } else
73
- r[c.key] = Sn(
74
- n[c.key] !== void 0 ? n[c.key] : c.default,
75
- o
152
+ r[a.key] = os(
153
+ t[a.key] !== void 0 ? t[a.key] : a.default,
154
+ s
76
155
  );
77
156
  return r;
78
157
  }
79
- function os({ label: e, segments: n }) {
80
- return /* @__PURE__ */ w("div", { className: "w6w-resolved-row", children: [
81
- /* @__PURE__ */ t("span", { className: "w6w-resolved-label", children: e }),
82
- /* @__PURE__ */ t("div", { className: "w6w-resolved-value", children: /* @__PURE__ */ t(zt, { segments: n }) })
158
+ function Xs({ label: e, segments: t }) {
159
+ return /* @__PURE__ */ m("div", { className: "w6w-resolved-row", children: [
160
+ /* @__PURE__ */ o("span", { className: "w6w-resolved-label", children: e }),
161
+ /* @__PURE__ */ o("div", { className: "w6w-resolved-value", children: /* @__PURE__ */ o(yn, { segments: t }) })
83
162
  ] });
84
163
  }
85
- function rs({
164
+ function Gs({
86
165
  param: e,
87
- value: n,
88
- scope: o
166
+ value: t,
167
+ scope: s
89
168
  }) {
90
- const r = Array.isArray(n) ? n : Array.isArray(e.default) ? e.default : [];
91
- return /* @__PURE__ */ w("div", { className: "w6w-resolved-row", children: [
92
- /* @__PURE__ */ t("span", { className: "w6w-resolved-label", children: e.label ?? e.key }),
93
- r.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "None configured." }) : /* @__PURE__ */ t("div", { className: "w6w-stack", children: r.map((c, l) => (
169
+ const r = Array.isArray(t) ? t : Array.isArray(e.default) ? e.default : [];
170
+ return /* @__PURE__ */ m("div", { className: "w6w-resolved-row", children: [
171
+ /* @__PURE__ */ o("span", { className: "w6w-resolved-label", children: e.label ?? e.key }),
172
+ r.length === 0 ? /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "None configured." }) : /* @__PURE__ */ o("div", { className: "w6w-stack", children: r.map((a, c) => (
94
173
  // biome-ignore lint/suspicious/noArrayIndexKey: rows have no stable id (mirrors ParamsForm's VarsField)
95
- /* @__PURE__ */ w("div", { className: "w6w-resolved-value", children: [
96
- /* @__PURE__ */ t("code", { children: c.key || "(no key)" }),
174
+ /* @__PURE__ */ m("div", { className: "w6w-resolved-value", children: [
175
+ /* @__PURE__ */ o("code", { children: a.key || "(no key)" }),
97
176
  " → ",
98
- /* @__PURE__ */ t(zt, { segments: Ft(c.value, o) })
99
- ] }, l)
177
+ /* @__PURE__ */ o(yn, { segments: cn(a.value, s) })
178
+ ] }, c)
100
179
  )) })
101
180
  ] });
102
181
  }
103
- function zt({ segments: e }) {
104
- return /* @__PURE__ */ t(B, { children: e.map((n, o) => (
182
+ function yn({ segments: e }) {
183
+ return /* @__PURE__ */ o(U, { children: e.map((t, s) => (
105
184
  // biome-ignore lint/suspicious/noArrayIndexKey: segments are a positional, immutable render of one value's parts
106
- /* @__PURE__ */ t(as, { segment: n }, o)
185
+ /* @__PURE__ */ o(Ys, { segment: t }, s)
107
186
  )) });
108
187
  }
109
- function as({ segment: e }) {
188
+ function Ys({ segment: e }) {
110
189
  switch (e.status) {
111
190
  case "resolved":
112
- return e.ref ? /* @__PURE__ */ w(B, { children: [
113
- /* @__PURE__ */ t($e, { kind: "var", refName: e.ref }),
114
- /* @__PURE__ */ t(At, { value: e.value })
115
- ] }) : /* @__PURE__ */ t(At, { value: e.value });
191
+ return e.ref ? /* @__PURE__ */ m(U, { children: [
192
+ /* @__PURE__ */ o(Xe, { kind: "var", refName: e.ref }),
193
+ /* @__PURE__ */ o(Zt, { value: e.value })
194
+ ] }) : /* @__PURE__ */ o(Zt, { value: e.value });
116
195
  case "unresolved":
117
- return /* @__PURE__ */ w(B, { children: [
118
- /* @__PURE__ */ t($e, { kind: "var", refName: e.ref }),
119
- /* @__PURE__ */ t("span", { className: "w6w-param-unresolved", children: "unresolved" })
196
+ return /* @__PURE__ */ m(U, { children: [
197
+ /* @__PURE__ */ o(Xe, { kind: "var", refName: e.ref }),
198
+ /* @__PURE__ */ o("span", { className: "w6w-param-unresolved", children: "unresolved" })
120
199
  ] });
121
200
  case "not-evaluated":
122
- return /* @__PURE__ */ w(B, { children: [
123
- /* @__PURE__ */ t($e, { kind: "expr" }),
124
- /* @__PURE__ */ t("span", { className: "w6w-param-unevaluated", children: "not evaluated" })
201
+ return /* @__PURE__ */ m(U, { children: [
202
+ /* @__PURE__ */ o(Xe, { kind: "expr" }),
203
+ /* @__PURE__ */ o("span", { className: "w6w-param-unevaluated", children: "not evaluated" })
125
204
  ] });
126
205
  case "masked":
127
- return /* @__PURE__ */ t($e, { kind: "secret", refName: e.ref });
206
+ return /* @__PURE__ */ o(Xe, { kind: "secret", refName: e.ref });
128
207
  }
129
208
  }
130
- function At({ value: e }) {
131
- const [n, o] = S(!1), r = ls(e), c = ts(r);
132
- return c.clipped ? /* @__PURE__ */ w(B, { children: [
133
- /* @__PURE__ */ t("span", { className: n ? "w6w-resolved-text-full" : void 0, children: n ? r : `${c.text}…` }),
134
- /* @__PURE__ */ t(
209
+ function Zt({ value: e }) {
210
+ const [t, s] = S(!1), r = Zs(e), a = Us(r);
211
+ return a.clipped ? /* @__PURE__ */ m(U, { children: [
212
+ /* @__PURE__ */ o("span", { className: t ? "w6w-resolved-text-full" : void 0, children: t ? r : `${a.text}…` }),
213
+ /* @__PURE__ */ o(
135
214
  "button",
136
215
  {
137
216
  type: "button",
138
217
  className: "w6w-resolved-more",
139
- "aria-expanded": n,
140
- onClick: () => o((l) => !l),
141
- children: n ? "Show less" : `Show all (${c.length.toLocaleString()} characters)`
218
+ "aria-expanded": t,
219
+ onClick: () => s((c) => !c),
220
+ children: t ? "Show less" : `Show all (${a.length.toLocaleString()} characters)`
142
221
  }
143
222
  )
144
- ] }) : /* @__PURE__ */ t("span", { children: r });
145
- }
146
- const is = { var: "◆", secret: "🔒", expr: "ƒ" };
147
- function $e({ kind: e, refName: n }) {
148
- const o = e === "expr" ? "expr" : kn(n ?? "");
149
- return /* @__PURE__ */ w("span", { className: `w6w-expr-chip w6w-expr-chip-${e}`, children: [
150
- /* @__PURE__ */ t("span", { className: "w6w-expr-chip-sigil", children: is[e] }),
151
- /* @__PURE__ */ t("span", { className: "w6w-expr-chip-label", children: o })
223
+ ] }) : /* @__PURE__ */ o("span", { children: r });
224
+ }
225
+ const Qs = { var: "◆", secret: "🔒", expr: "ƒ" };
226
+ function Xe({ kind: e, refName: t }) {
227
+ const s = e === "expr" ? "expr" : is(t ?? "");
228
+ return /* @__PURE__ */ m("span", { className: `w6w-expr-chip w6w-expr-chip-${e}`, children: [
229
+ /* @__PURE__ */ o("span", { className: "w6w-expr-chip-sigil", children: Qs[e] }),
230
+ /* @__PURE__ */ o("span", { className: "w6w-expr-chip-label", children: s })
152
231
  ] });
153
232
  }
154
- function ls(e) {
233
+ function Zs(e) {
155
234
  if (e === null) return "null";
156
235
  if (e === void 0) return "(not set)";
157
236
  if (e === "") return '""';
@@ -163,141 +242,145 @@ function ls(e) {
163
242
  return String(e);
164
243
  }
165
244
  }
166
- function ee(e) {
167
- var n;
168
- return ((n = e.data) == null ? void 0 : n.when) === "error" ? "error" : "success";
169
- }
170
- function qt(e, n) {
171
- var o;
172
- return ((o = e.find((r) => r.id === n)) == null ? void 0 : o.id) ?? null;
173
- }
174
- function Kt(e, n, o, r, c) {
175
- var N, f;
176
- if (!e || !n || e === n || r.some((a) => a.source === e && a.target === n)) return !1;
177
- const l = (N = o.find((a) => a.id === e)) == null ? void 0 : N.data.step, u = (f = o.find((a) => a.id === n)) == null ? void 0 : f.data.step;
178
- if (!l || !u) return !1;
179
- const y = le(l, c), C = le(u, c);
180
- return y.out >= 1 && C.in >= 1;
181
- }
182
- function Qe(e, n, o, r, c, l) {
183
- var P, R;
184
- if (!Kt(e, n, o, r, l) || !e || !n) return null;
185
- const u = (P = o.find((V) => V.id === e)) == null ? void 0 : P.data.step, y = (R = o.find((V) => V.id === n)) == null ? void 0 : R.data.step;
186
- if (!u || !y) return null;
187
- const C = le(u, l), N = le(y, l);
188
- let f = r;
189
- if (f.filter((V) => V.source === e && ee(V) === c).length >= C.out)
190
- return { next: r, conflict: null, refusal: { refused: "out_cap", cap: C.out } };
191
- const g = f.filter((V) => V.target === n);
192
- if (g.length >= N.in) {
193
- const V = new Set(g.slice(0, g.length - N.in + 1).map((d) => d.id));
194
- f = f.filter((d) => !V.has(d.id));
245
+ function oe(e) {
246
+ var t;
247
+ return ((t = e.data) == null ? void 0 : t.when) === "error" ? "error" : "success";
248
+ }
249
+ function vn(e, t) {
250
+ var s;
251
+ return ((s = e.find((r) => r.id === t)) == null ? void 0 : s.id) ?? null;
252
+ }
253
+ function Nn(e, t, s, r, a) {
254
+ var C, h;
255
+ if (!e || !t || e === t || r.some((k) => k.source === e && k.target === t)) return !1;
256
+ const c = (C = s.find((k) => k.id === e)) == null ? void 0 : C.data.step, u = (h = s.find((k) => k.id === t)) == null ? void 0 : h.data.step;
257
+ if (!c || !u) return !1;
258
+ const b = we(c, a), N = we(u, a);
259
+ return b.out >= 1 && N.in >= 1;
260
+ }
261
+ function dt(e, t, s, r, a, c) {
262
+ var D, T;
263
+ if (!Nn(e, t, s, r, c) || !e || !t) return null;
264
+ const u = (D = s.find((_) => _.id === e)) == null ? void 0 : D.data.step, b = (T = s.find((_) => _.id === t)) == null ? void 0 : T.data.step;
265
+ if (!u || !b) return null;
266
+ const N = we(u, c), C = we(b, c);
267
+ let h = r;
268
+ if (h.filter((_) => _.source === e && oe(_) === a).length >= N.out)
269
+ return { next: r, conflict: null, refusal: { refused: "out_cap", cap: N.out } };
270
+ const l = h.filter((_) => _.target === t);
271
+ if (l.length >= C.in) {
272
+ const _ = new Set(l.slice(0, l.length - C.in + 1).map((A) => A.id));
273
+ h = h.filter((A) => !_.has(A.id));
195
274
  }
196
- const E = Ge(e, n, c);
275
+ const x = at(e, t, a);
197
276
  return {
198
- next: sn(
277
+ next: _n(
199
278
  {
200
279
  source: e,
201
- target: n,
202
- id: E,
203
- sourceHandle: Wt(c),
204
- data: { when: c },
280
+ target: t,
281
+ id: x,
282
+ sourceHandle: ln(a),
283
+ data: { when: a },
205
284
  // No run state: this mints a freshly DRAWN edge, never a run-taken
206
285
  // one — the live run-aware repaint is a separate effect
207
286
  // (WorkflowFlowEditor.tsx, T1.1.1), not this creation path.
208
- ...Xe(c, void 0)
287
+ ...ct(a, void 0)
209
288
  },
210
- f
289
+ h
211
290
  ),
212
- conflict: qt(f, E),
291
+ conflict: vn(h, x),
213
292
  refusal: null
214
293
  };
215
294
  }
216
- function Oe(e, n, o, r, c = "success", l) {
217
- const u = Qe(e, n, o, r, c, l);
295
+ function Ge(e, t, s, r, a = "success", c) {
296
+ const u = dt(e, t, s, r, a, c);
218
297
  return !u || u.conflict || u.refusal ? null : u.next;
219
298
  }
220
- function cs(e, n, o, r, c = "success", l) {
299
+ function eo(e, t, s, r, a = "success", c) {
221
300
  var u;
222
- return ((u = Qe(e, n, o, r, c, l)) == null ? void 0 : u.conflict) ?? null;
301
+ return ((u = dt(e, t, s, r, a, c)) == null ? void 0 : u.conflict) ?? null;
223
302
  }
224
- function ds(e, n, o, r, c = "success", l) {
303
+ function to(e, t, s, r, a = "success", c) {
225
304
  var u;
226
- return ((u = Qe(e, n, o, r, c, l)) == null ? void 0 : u.refusal) ?? null;
227
- }
228
- function Ze(e, n, o, r, c) {
229
- var P;
230
- const l = e.filter((R) => R.id === n);
231
- if (l.length !== 1) return null;
232
- const u = l[0], y = (P = r.find((R) => R.id === u.source)) == null ? void 0 : P.data.step;
233
- if (!y) return null;
234
- const C = le(y, c).out, N = e.filter((R) => R.id !== n);
235
- if ((ee(u) === o ? [] : N.filter((R) => R.source === u.source && ee(R) === o)).length >= C)
236
- return { next: e, conflict: null, refusal: { refused: "out_cap", cap: C } };
237
- const a = Xe(o, void 0), g = {
305
+ return ((u = dt(e, t, s, r, a, c)) == null ? void 0 : u.refusal) ?? null;
306
+ }
307
+ function ut(e, t, s, r, a) {
308
+ var D;
309
+ const c = e.filter((T) => T.id === t);
310
+ if (c.length !== 1) return null;
311
+ const u = c[0], b = (D = r.find((T) => T.id === u.source)) == null ? void 0 : D.data.step;
312
+ if (!b) return null;
313
+ const N = we(b, a).out, C = e.filter((T) => T.id !== t);
314
+ if ((oe(u) === s ? [] : C.filter((T) => T.source === u.source && oe(T) === s)).length >= N)
315
+ return { next: e, conflict: null, refusal: { refused: "out_cap", cap: N } };
316
+ const k = ct(s, void 0), l = {
238
317
  ...u,
239
- id: Ge(u.source, u.target, o),
240
- data: { ...u.data, when: o },
241
- className: a.className,
242
- label: a.label,
243
- sourceHandle: Wt(o)
244
- }, E = qt(N, g.id);
318
+ id: at(u.source, u.target, s),
319
+ data: { ...u.data, when: s },
320
+ className: k.className,
321
+ label: k.label,
322
+ sourceHandle: ln(s)
323
+ }, x = vn(C, l.id);
245
324
  return {
246
325
  // `edgeId` is single-owner (guarded above), so this replaces exactly one edge.
247
- next: e.map((R) => R.id === n ? g : R),
248
- conflict: E,
326
+ next: e.map((T) => T.id === t ? l : T),
327
+ conflict: x,
249
328
  refusal: null
250
329
  };
251
330
  }
252
- function us(e, n, o, r, c) {
253
- const l = Ze(e, n, o, r, c);
254
- return !l || l.conflict || l.refusal ? null : l.next;
331
+ function no(e, t, s, r, a) {
332
+ const c = ut(e, t, s, r, a);
333
+ return !c || c.conflict || c.refusal ? null : c.next;
255
334
  }
256
- function ps(e, n, o, r, c) {
257
- var l;
258
- return ((l = Ze(e, n, o, r, c)) == null ? void 0 : l.conflict) ?? null;
335
+ function so(e, t, s, r, a) {
336
+ var c;
337
+ return ((c = ut(e, t, s, r, a)) == null ? void 0 : c.conflict) ?? null;
259
338
  }
260
- function fs(e, n, o, r, c) {
261
- var l;
262
- return ((l = Ze(e, n, o, r, c)) == null ? void 0 : l.refusal) ?? null;
339
+ function oo(e, t, s, r, a) {
340
+ var c;
341
+ return ((c = ut(e, t, s, r, a)) == null ? void 0 : c.refusal) ?? null;
263
342
  }
264
- function hs(e, n, o) {
343
+ function io(e, t, s) {
265
344
  return e.map((r) => {
266
- const c = r.source === n ? o : r.source, l = r.target === n ? o : r.target;
267
- return { ...r, source: c, target: l, id: Ge(c, l, ee(r)) };
345
+ const a = r.source === t ? s : r.source, c = r.target === t ? s : r.target;
346
+ return { ...r, source: a, target: c, id: at(a, c, oe(r)) };
268
347
  });
269
348
  }
270
- function ws(e, n) {
271
- const o = { success: 0, error: 0 };
272
- for (const c of n) c.source === e && o[ee(c)]++;
273
- const r = Math.max(o.success, o.error);
349
+ function ro(e, t) {
350
+ const s = { success: 0, error: 0 };
351
+ for (const a of t) a.source === e && s[oe(a)]++;
352
+ const r = Math.max(s.success, s.error);
274
353
  return { enabled: r >= 2, count: r };
275
354
  }
276
- function ms(e, n) {
277
- const { fanOut: o, ...r } = e;
278
- return n === "parallel" ? { ...r, fanOut: "parallel" } : r;
355
+ function ao(e, t) {
356
+ const { fanOut: s, ...r } = e;
357
+ return t === "parallel" ? { ...r, fanOut: "parallel" } : r;
279
358
  }
280
- function gs(e, n) {
281
- return `Runs these ${e} steps in ${n === "parallel" ? "parallel" : "sequence"}`;
359
+ function co(e, t) {
360
+ return `Runs these ${e} nodes in ${t === "parallel" ? "parallel" : "sequence"}`;
282
361
  }
283
- const bs = /* @__PURE__ */ new Set(["succeeded", "failed", "canceled"]);
284
- function vs(e, n) {
285
- var o;
286
- return e ? ((o = e.steps[n]) == null ? void 0 : o.status) ?? "pending" : "no-run";
362
+ function Cn(e, t) {
363
+ var s;
364
+ return (s = e.nodes ?? e.steps) == null ? void 0 : s[t];
287
365
  }
288
- const Pt = {
366
+ const lo = /* @__PURE__ */ new Set(["succeeded", "failed", "canceled"]);
367
+ function uo(e, t) {
368
+ var s;
369
+ return e ? ((s = Cn(e, t)) == null ? void 0 : s.status) ?? "pending" : "no-run";
370
+ }
371
+ const en = {
289
372
  borderColor: "var(--w6w-border)",
290
373
  borderStyle: "solid",
291
374
  borderWidth: 1,
292
375
  opacity: 1
293
376
  };
294
- function Gt(e, n) {
295
- const o = n !== void 0 && bs.has(n);
377
+ function Sn(e, t) {
378
+ const s = t !== void 0 && lo.has(t);
296
379
  switch (e) {
297
380
  case "no-run":
298
- return Pt;
381
+ return en;
299
382
  case "pending":
300
- return o ? { borderColor: "var(--w6w-muted)", borderStyle: "dashed", borderWidth: 1, opacity: 0.5 } : { borderColor: "var(--w6w-border)", borderStyle: "dashed", borderWidth: 1, opacity: 1 };
383
+ return s ? { borderColor: "var(--w6w-muted)", borderStyle: "dashed", borderWidth: 1, opacity: 0.5 } : { borderColor: "var(--w6w-border)", borderStyle: "dashed", borderWidth: 1, opacity: 1 };
301
384
  case "running":
302
385
  return { borderColor: "var(--w6w-accent)", borderStyle: "solid", borderWidth: 2, opacity: 1 };
303
386
  case "succeeded":
@@ -317,622 +400,854 @@ function Gt(e, n) {
317
400
  opacity: 0.7
318
401
  };
319
402
  default:
320
- return Pt;
403
+ return en;
321
404
  }
322
405
  }
323
- function Ns(e, n, o) {
406
+ function po(e, t, s) {
324
407
  if (!e) return;
325
- const r = e.steps[n];
408
+ const r = Cn(e, t);
326
409
  if (!r) return;
327
- const c = o ?? "success";
328
- if (r.status === "succeeded") return c === "success" ? "taken" : "skipped";
329
- if (r.status === "failed") return c === "error" ? "taken" : "skipped";
410
+ const a = s ?? "success";
411
+ if (r.status === "succeeded") return a === "success" ? "taken" : "skipped";
412
+ if (r.status === "failed") return a === "error" ? "taken" : "skipped";
330
413
  if (r.status === "skipped") return "skipped";
331
414
  }
332
- function ys(e, n) {
333
- const [o, r] = S({}), c = me(/* @__PURE__ */ new Set()), l = JSON.stringify(
334
- [...new Set(n.map((u) => u.data.step.uses.app))].filter((u) => u && !Pe(u)).sort()
415
+ function fo(e, t) {
416
+ return e.map((s) => {
417
+ const r = t == null ? void 0 : t[s.id], a = s.data.stepProblem;
418
+ if (r === void 0) {
419
+ if (a === void 0 && !("stepProblem" in s.data)) return s;
420
+ const { stepProblem: c, ...u } = s.data;
421
+ return { ...s, data: u };
422
+ }
423
+ return a && a.code === r.code && a.connection === r.connection ? s : { ...s, data: { ...s.data, stepProblem: { ...r } } };
424
+ });
425
+ }
426
+ function st(e) {
427
+ return `Connection ${e.connection} no longer exists — open the step and choose another on the Setup tab`;
428
+ }
429
+ function tn(e, t) {
430
+ return (t == null ? void 0 : t.code) === "unknown_connection" && e.uses.connection === t.connection;
431
+ }
432
+ function ho(e, t, s) {
433
+ if (!e) return "No connection";
434
+ if (s) return "Couldn't load connections";
435
+ if (t === null) return e;
436
+ const r = t.find((a) => a.id === e);
437
+ return r ? r.displayName ?? e : "Missing connection — choose another";
438
+ }
439
+ function wo(e, t) {
440
+ const [s, r] = S({}), a = Ce(/* @__PURE__ */ new Set()), c = JSON.stringify(
441
+ [...new Set(t.map((u) => u.data.step.uses.app))].filter((u) => u && !Je(u)).sort()
335
442
  );
336
- return _(() => {
337
- const u = JSON.parse(l).filter(
338
- (y) => !c.current.has(y)
443
+ return z(() => {
444
+ const u = JSON.parse(c).filter(
445
+ (b) => !a.current.has(b)
339
446
  );
340
447
  if (u.length !== 0) {
341
- for (const y of u) c.current.add(y);
448
+ for (const b of u) a.current.add(b);
342
449
  Promise.all(
343
- u.map(async (y) => {
450
+ u.map(async (b) => {
344
451
  try {
345
- return [y, await e.getAppActions(y)];
452
+ return [b, await e.getAppActions(b)];
346
453
  } catch {
347
- return c.current.delete(y), null;
454
+ return a.current.delete(b), null;
348
455
  }
349
456
  })
350
- ).then((y) => {
351
- const C = y.filter((N) => N !== null);
352
- C.length !== 0 && r((N) => ({ ...N, ...Object.fromEntries(C) }));
457
+ ).then((b) => {
458
+ const N = b.filter((C) => C !== null);
459
+ N.length !== 0 && r((C) => ({ ...C, ...Object.fromEntries(N) }));
353
460
  });
354
461
  }
355
- }, [e, l]), o;
462
+ }, [e, c]), s;
356
463
  }
357
- function Cs(e) {
358
- return (n, o) => {
359
- var r, c;
360
- return (c = (r = e[n]) == null ? void 0 : r.find((l) => l.key === o)) == null ? void 0 : c.ports;
464
+ function mo(e) {
465
+ return (t, s) => {
466
+ var r, a;
467
+ return (a = (r = e[t]) == null ? void 0 : r.find((c) => c.key === s)) == null ? void 0 : a.ports;
361
468
  };
362
469
  }
363
- const Ss = "Which outcome of the source step this edge carries. An error edge is drawn by dragging from the step's error exit port; use this control to re-lane an edge already drawn. An error edge overrides the step’s “On error” policy.";
364
- function It(e, n, o, r) {
365
- const c = e.find((l) => l.id === n);
366
- return [o, r, c == null ? void 0 : c.source, c == null ? void 0 : c.target];
470
+ const go = "Which outcome of the source node this edge carries. An error edge is drawn by dragging from the node's error exit port; use this control to re-lane an edge already drawn. An error edge overrides the node’s “On error” policy.";
471
+ function nn(e, t, s, r) {
472
+ const a = e.find((c) => c.id === t);
473
+ return [s, r, a == null ? void 0 : a.source, a == null ? void 0 : a.target];
367
474
  }
368
- const et = Je(void 0), tt = Je(/* @__PURE__ */ new Map());
369
- function Dt(e) {
475
+ const pt = Ye(void 0), ft = Ye(/* @__PURE__ */ new Map());
476
+ function sn(e) {
370
477
  return `Can’t draw that edge: this node allows at most ${e} outgoing edge${e === 1 ? "" : "s"} per lane.`;
371
478
  }
372
- const nt = Je(/* @__PURE__ */ new Map()), Xt = Je(null);
373
- function Js(e) {
374
- return /* @__PURE__ */ t(on, { children: /* @__PURE__ */ t(ks, { ...e }) });
479
+ const ht = Ye(/* @__PURE__ */ new Map()), wt = Ye(null);
480
+ function Lo(e) {
481
+ return /* @__PURE__ */ o(Wn, { children: /* @__PURE__ */ o(bo, { ...e }) });
482
+ }
483
+ function on(e, t) {
484
+ let s = t.length + 1;
485
+ for (; t.includes(`${e}-${s}`); ) s++;
486
+ return `${e}-${s}`;
375
487
  }
376
- function ks({
488
+ function ot(e) {
489
+ var t, s;
490
+ return {
491
+ x: e.position.x,
492
+ y: e.position.y,
493
+ w: ((t = e.measured) == null ? void 0 : t.width) ?? e.width ?? 200,
494
+ h: ((s = e.measured) == null ? void 0 : s.height) ?? e.height ?? 64
495
+ };
496
+ }
497
+ function bo({
377
498
  value: e,
378
- onChange: n,
379
- readOnly: o,
499
+ onChange: t,
500
+ readOnly: s,
380
501
  height: r = 480,
381
- apps: c,
382
- exprOptions: l,
502
+ apps: a,
503
+ exprOptions: c,
383
504
  project: u,
384
- runState: y,
505
+ runState: b,
506
+ stepProblems: N,
385
507
  onTestRun: C,
386
- fitViewKey: N
508
+ fitViewKey: h
387
509
  }) {
388
- var mt, gt, bt;
389
- const f = Me(), a = M(() => new Map((c ?? []).map((s) => [s.id, s])), [c]), [g, E] = S(null), P = M(() => En(e), [e.id]), R = M(() => xn(e), [e.id]), V = ((mt = e.settings) == null ? void 0 : mt.savePosition) !== !1, [d, I, ce] = rn(P.nodes), ne = ys(f, d), W = M(() => Cs(ne), [ne]), [b, A, de] = an(P.edges);
390
- _(() => {
391
- I(
392
- (s) => s.map((i) => {
393
- const p = vs(y, i.id);
394
- return i.data.stepStatus === p && i.data.runStatus === (y == null ? void 0 : y.status) ? i : { ...i, data: { ...i.data, stepStatus: p, runStatus: y == null ? void 0 : y.status } };
510
+ var Dt, Lt;
511
+ const k = Qe(), l = O(() => new Map((a ?? []).map((n) => [n.id, n])), [a]), [x, D] = S(null), T = O(() => rs(e), [e.id]), _ = O(() => as(e), [e.id]), A = ((Dt = e.settings) == null ? void 0 : Dt.savePosition) !== !1, [w, L, Se] = Bn(T.nodes), le = wo(k, w), B = O(() => mo(le), [le]), [y, V, xe] = Jn(T.edges);
512
+ z(() => {
513
+ L(
514
+ (n) => n.map((i) => {
515
+ const d = uo(b, i.id);
516
+ return i.data.stepStatus === d && i.data.runStatus === (b == null ? void 0 : b.status) ? i : { ...i, data: { ...i.data, stepStatus: d, runStatus: b == null ? void 0 : b.status } };
395
517
  })
396
- ), A(
397
- (s) => s.map((i) => {
398
- const p = ee(i), m = Ns(y, i.source, p), v = Xe(p, m);
399
- return i.className === v.className && i.label === v.label ? i : { ...i, className: v.className, label: v.label };
518
+ ), V(
519
+ (n) => n.map((i) => {
520
+ const d = oe(i), p = po(b, i.source, d), f = ct(d, p);
521
+ return i.className === f.className && i.label === f.label ? i : { ...i, className: f.className, label: f.label };
400
522
  })
401
523
  );
402
- }, [y, I, A]);
403
- const [K, G] = S(null), [x, z] = S(null), [$, te] = S(!1), [O, se] = S(null), [be, oe] = S("props"), [re, ke] = S(null), ue = me(!1), Ie = me(null), [H, X] = S(null), { screenToFlowPosition: De, fitView: j } = ln(), _e = Rn();
404
- _(() => {
405
- I(P.nodes), A(P.edges), G(null), se(null);
406
- }, [P, I, A]);
407
- const D = J(
408
- (s, i) => {
409
- n(Nt(e, s, i));
524
+ }, [b, L, V]), z(() => {
525
+ L((n) => fo(n, N));
526
+ }, [N, L]);
527
+ const [K, $] = S(null), ee = O(() => e.canvas ?? {}, [e.id]), [P, te] = S(ee), [ie, ke] = S(!1), [q, de] = S(null), [re, ae] = S(null), [W, me] = S(null), [Ee, Pe] = S(!1), [H, ue] = S(null), [Re, X] = S("props"), [Le, G] = S(null), Me = Ce(!1), ge = Ce(null), [j, ne] = S(null), { screenToFlowPosition: pe, fitView: be } = zn(), ze = cs();
528
+ z(() => {
529
+ L(T.nodes), V(T.edges), $(null), ue(null), te(ee);
530
+ }, [T, ee, L, V]);
531
+ const Fe = F(
532
+ (n, i) => {
533
+ var f, v;
534
+ const { canvas: d, ...p } = n;
535
+ return !((f = i.notes) != null && f.length) && !((v = i.sections) != null && v.length) ? p : { ...p, canvas: Os(i, e.canvas, A) };
536
+ },
537
+ [e.canvas, A]
538
+ ), M = F(
539
+ (n, i, d) => {
540
+ t(Fe($t(e, n, i), d ?? P));
410
541
  },
411
- [e, n]
412
- ), ie = J(
413
- (s) => Kt(s.source, s.target, d, b, W),
414
- [d, b, W]
415
- ), ae = J(
416
- (s) => {
417
- if (o) return;
418
- const i = Oe(
419
- s.source,
420
- s.target,
421
- d,
422
- b,
423
- We(s.sourceHandle),
424
- W
542
+ [e, t, P, Fe]
543
+ ), He = F(
544
+ (n) => Nn(n.source, n.target, w, y, B),
545
+ [w, y, B]
546
+ ), je = F(
547
+ (n) => {
548
+ if (s) return;
549
+ const i = Ge(
550
+ n.source,
551
+ n.target,
552
+ w,
553
+ y,
554
+ We(n.sourceHandle),
555
+ B
425
556
  );
426
557
  if (!i) {
427
- const p = We(s.sourceHandle), m = ds(
428
- s.source,
429
- s.target,
558
+ const d = We(n.sourceHandle), p = to(
559
+ n.source,
560
+ n.target,
561
+ w,
562
+ y,
430
563
  d,
431
- b,
432
- p,
433
- W
564
+ B
434
565
  );
435
- if (m) {
436
- const k = b.find((T) => T.source === s.source && ee(T) === p);
437
- k && (A(b.map((T) => ({ ...T, selected: T.id === k.id }))), z(k.id), F({ edgeId: k.id, message: Dt(m.cap) }));
566
+ if (p) {
567
+ const v = y.find((E) => E.source === n.source && oe(E) === d);
568
+ v && (V(y.map((E) => ({ ...E, selected: E.id === v.id }))), me(v.id), ce({ edgeId: v.id, message: sn(p.cap) }));
438
569
  return;
439
570
  }
440
- const v = cs(
441
- s.source,
442
- s.target,
443
- d,
444
- b,
445
- We(s.sourceHandle)
571
+ const f = eo(
572
+ n.source,
573
+ n.target,
574
+ w,
575
+ y,
576
+ We(n.sourceHandle)
446
577
  );
447
- if (!v) return;
448
- A(b.map((k) => ({ ...k, selected: k.id === v }))), z(v), F({
449
- edgeId: v,
450
- message: yt(
578
+ if (!f) return;
579
+ V(y.map((v) => ({ ...v, selected: v.id === f }))), me(f), ce({
580
+ edgeId: f,
581
+ message: _t(
451
582
  "Can’t draw that edge",
452
- v,
453
- It(b, v, s.source, s.target)
583
+ f,
584
+ nn(y, f, n.source, n.target)
454
585
  )
455
586
  });
456
587
  return;
457
588
  }
458
- F(null), A(i), D(d, i);
589
+ ce(null), V(i), M(w, i);
459
590
  },
460
- [b, d, A, D, o, W]
461
- ), He = J(
462
- (s, i) => {
463
- var U, L, Q;
464
- if (o || i.isValid) return;
465
- const p = i.fromNode;
466
- if (!p) return;
467
- const m = ((U = i.fromHandle) == null ? void 0 : U.type) === "target" ? "target" : "source", v = (L = d.find((Z) => Z.id === p.id)) == null ? void 0 : L.data.step;
468
- if (v) {
469
- const Z = le(v, W);
470
- if ((m === "source" ? Z.out : Z.in) < 1) return;
591
+ [y, w, V, M, s, B]
592
+ ), J = F(
593
+ (n, i) => {
594
+ var R, I, Q;
595
+ if (s || i.isValid) return;
596
+ const d = i.fromNode;
597
+ if (!d) return;
598
+ const p = ((R = i.fromHandle) == null ? void 0 : R.type) === "target" ? "target" : "source", f = (I = w.find((Z) => Z.id === d.id)) == null ? void 0 : I.data.step;
599
+ if (f) {
600
+ const Z = we(f, B);
601
+ if ((p === "source" ? Z.out : Z.in) < 1) return;
471
602
  }
472
- const k = "changedTouches" in s ? s.changedTouches[0] : s, T = De({ x: k.clientX, y: k.clientY });
473
- X({
474
- nodeId: p.id,
475
- handleType: m,
476
- position: T,
603
+ const v = "changedTouches" in n ? n.changedTouches[0] : n, E = pe({ x: v.clientX, y: v.clientY });
604
+ ne({
605
+ nodeId: d.id,
606
+ handleType: p,
607
+ position: E,
477
608
  lane: We((Q = i.fromHandle) == null ? void 0 : Q.id)
478
- }), te(!0);
609
+ }), Pe(!0);
479
610
  },
480
- [o, De, d, W]
481
- ), ve = J(
482
- (s) => {
483
- o || ke(s);
611
+ [s, pe, w, B]
612
+ ), Ve = F(
613
+ (n, i, d) => {
614
+ if (s) return;
615
+ const p = w.find((I) => I.id === n);
616
+ if (!p) return;
617
+ const f = ot(p), v = We(d), E = 120, R = i === "target" ? { x: f.x - f.w - E, y: f.y } : v === "error" ? { x: f.x, y: f.y + f.h + E } : { x: f.x + f.w + E, y: f.y };
618
+ ne({ nodeId: n, handleType: i, position: R, lane: v }), Pe(!0);
484
619
  },
485
- [o]
486
- ), Le = J(
487
- (s) => {
488
- if (o) return;
489
- const i = d.filter((m) => m.id !== s), p = b.filter((m) => m.source !== s && m.target !== s);
490
- I(i), A(p), K === s && G(null), O === s && se(null), D(i, p);
620
+ [s, w]
621
+ ), $e = F(
622
+ (n) => {
623
+ s || G(n);
491
624
  },
492
- [d, b, I, A, D, o, K, O]
493
- ), Ee = J(() => {
494
- if (o) return;
495
- const s = Tn(d, b);
496
- I(s), ue.current = !0, D(s, b);
497
- }, [d, b, I, D, o]), xe = J(() => {
498
- o || Ee();
499
- }, [o, Ee]);
500
- _(() => {
501
- ue.current && (ue.current = !1, j({ duration: 300 }));
502
- }, [d, j]);
503
- const Re = me(N);
504
- _(() => {
505
- Object.is(Re.current, N) || (Re.current = N, j({ duration: 300 }));
506
- }, [N, j]);
507
- const [pe, F] = S(null), fe = M(
508
- () => b.find((s) => s.id === x) ?? null,
509
- [b, x]
510
- ), Be = J(
511
- (s) => {
512
- if (o || !x) return;
513
- const i = b.find((T) => T.id === x);
514
- if (!i || ee(i) === s) return;
515
- const p = ps(b, x, s, d), m = fs(b, x, s, d, W), v = p || m ? null : us(b, x, s, d, W);
516
- if (!v) {
517
- if (m) {
518
- F({ edgeId: x, message: Dt(m.cap) });
625
+ [s]
626
+ ), Oe = F(
627
+ (n) => {
628
+ if (s) return;
629
+ const i = w.filter((f) => f.id !== n), d = y.filter((f) => f.source !== n && f.target !== n), p = Xt(P, n);
630
+ L(i), V(d), te(p), K === n && $(null), H === n && ue(null), M(i, d, p);
631
+ },
632
+ [w, y, P, L, V, M, s, K, H]
633
+ ), g = F(() => {
634
+ if (s) return;
635
+ const n = ls(w, y);
636
+ L(n), Me.current = !0, M(n, y);
637
+ }, [w, y, L, M, s]), Y = F(() => {
638
+ s || g();
639
+ }, [s, g]);
640
+ z(() => {
641
+ Me.current && (Me.current = !1, be({ duration: 300 }));
642
+ }, [w, be]);
643
+ const se = Ce(h);
644
+ z(() => {
645
+ Object.is(se.current, h) || (se.current = h, be({ duration: 300 }));
646
+ }, [h, be]);
647
+ const [fe, ce] = S(null), Ue = O(
648
+ () => y.find((n) => n.id === W) ?? null,
649
+ [y, W]
650
+ ), Pn = F(
651
+ (n) => {
652
+ if (s || !W) return;
653
+ const i = y.find((E) => E.id === W);
654
+ if (!i || oe(i) === n) return;
655
+ const d = so(y, W, n, w), p = oo(y, W, n, w, B), f = d || p ? null : no(y, W, n, w, B);
656
+ if (!f) {
657
+ if (p) {
658
+ ce({ edgeId: W, message: sn(p.cap) });
519
659
  return;
520
660
  }
521
- F({
522
- edgeId: x,
523
- message: p ? yt(
661
+ ce({
662
+ edgeId: W,
663
+ message: d ? _t(
524
664
  "Can’t switch this edge",
525
- p,
526
- It(b, p, i.source, i.target)
665
+ d,
666
+ nn(y, d, i.source, i.target)
527
667
  ) : "This edge can’t be switched right now."
528
668
  });
529
669
  return;
530
670
  }
531
- F(null), A(v);
532
- const k = v.find(
533
- (T) => T.source === i.source && T.target === i.target && ee(T) === s
671
+ ce(null), V(f);
672
+ const v = f.find(
673
+ (E) => E.source === i.source && E.target === i.target && oe(E) === n
534
674
  );
535
- z((k == null ? void 0 : k.id) ?? null), D(d, v);
675
+ me((v == null ? void 0 : v.id) ?? null), M(w, f);
536
676
  },
537
- [b, d, A, D, o, x, W]
538
- ), Ve = J(
539
- (s) => {
540
- if (o) return;
541
- const i = b.filter((p) => p.id !== s);
542
- i.length !== b.length && (A(i), x === s && z(null), D(d, i));
677
+ [y, w, V, M, s, W, B]
678
+ ), Rn = F(
679
+ (n) => {
680
+ if (s) return;
681
+ const i = y.filter((d) => d.id !== n);
682
+ i.length !== y.length && (V(i), W === n && me(null), M(w, i));
543
683
  },
544
- [d, b, A, D, o, x]
545
- ), h = J(
546
- (s) => {
547
- if (o) return;
548
- const i = d.find((T) => T.id === s);
684
+ [w, y, V, M, s, W]
685
+ ), gt = F(
686
+ (n) => {
687
+ if (s) return;
688
+ const i = w.find((E) => E.id === n);
549
689
  if (!i) return;
550
- const p = Ct(
551
- d.map((T) => T.id),
690
+ const d = Wt(
691
+ w.map((E) => E.id),
552
692
  `${i.data.step.id}_copy`
553
- ), m = { ...structuredClone(i.data.step), id: p }, v = {
554
- id: p,
693
+ ), p = { ...structuredClone(i.data.step), id: d }, f = {
694
+ id: d,
555
695
  type: i.type,
556
696
  position: { x: i.position.x + 40, y: i.position.y + 60 },
557
- data: { step: m, isInternal: i.data.isInternal }
558
- }, k = [...d, v];
559
- I(k), G(p), D(k, b);
697
+ data: { step: p, isInternal: i.data.isInternal }
698
+ }, v = [...w, f];
699
+ L(v), $(d), M(v, y);
560
700
  },
561
- [d, b, I, D, o]
562
- ), q = J(
563
- (s) => {
564
- if (o) return;
565
- const i = Pe(s.uses.app), p = Ct(
566
- d.map((U) => U.id),
567
- An($t(s.uses.app, s.uses.action))
568
- ), m = {
569
- id: p,
570
- uses: s.uses,
571
- ...s.with && Object.keys(s.with).length > 0 ? { with: s.with } : {}
572
- }, v = {
573
- id: p,
701
+ [w, y, L, M, s]
702
+ ), Tn = F(
703
+ (n) => {
704
+ if (s) return;
705
+ const i = Je(n.uses.app), d = Wt(
706
+ w.map((R) => R.id),
707
+ ds(dn(n.uses.app, n.uses.action))
708
+ ), p = {
709
+ id: d,
710
+ uses: n.uses,
711
+ ...n.with && Object.keys(n.with).length > 0 ? { with: n.with } : {}
712
+ }, f = {
713
+ id: d,
574
714
  type: i ? "control" : "step",
575
715
  // Drop point when spawned from a dragged connection; else a light cascade.
576
- position: (H == null ? void 0 : H.position) ?? { x: 80, y: 80 + d.length * 24 },
577
- data: { step: m, isInternal: i }
578
- }, k = [...d, v];
579
- let T = b;
580
- if (H) {
581
- const [U, L] = H.handleType === "target" ? [p, H.nodeId] : [H.nodeId, p];
582
- T = Oe(U, L, k, b, H.lane, W) ?? b;
716
+ position: (j == null ? void 0 : j.position) ?? { x: 80, y: 80 + w.length * 24 },
717
+ data: { step: p, isInternal: i }
718
+ }, v = [...w, f];
719
+ let E = y;
720
+ if (j) {
721
+ const [R, I] = j.handleType === "target" ? [d, j.nodeId] : [j.nodeId, d];
722
+ E = Ge(R, I, v, y, j.lane, B) ?? y;
583
723
  } else {
584
- const U = d.find((L) => Ce(L.data.step.uses.app));
585
- if (Ce(s.uses.app)) {
586
- if (!U) {
587
- const L = Pn(d, b);
588
- L && (T = Oe(p, L.id, k, b, "success", W) ?? b);
724
+ const R = w.find((I) => Ie(I.data.step.uses.app));
725
+ if (Ie(n.uses.app)) {
726
+ if (!R) {
727
+ const I = us(w, y);
728
+ I && (E = Ge(d, I.id, v, y, "success", B) ?? y);
589
729
  }
590
730
  } else {
591
- const Q = (U && !b.some((Z) => Z.source === U.id) ? U : void 0) ?? In(d, b);
592
- Q && (T = Oe(Q.id, p, k, b, "success", W) ?? b);
731
+ const Q = (R && !y.some((Z) => Z.source === R.id) ? R : void 0) ?? ps(w, y);
732
+ Q && (E = Ge(Q.id, d, v, y, "success", B) ?? y);
593
733
  }
594
734
  }
595
- return I(k), T !== b && A(T), G(p), D(k, T), p;
735
+ return L(v), E !== y && V(E), $(d), M(v, E), d;
596
736
  },
597
- [d, b, I, A, D, o, H, W]
598
- ), Y = J(
599
- (s, i) => {
600
- const p = i.id !== s;
601
- if (p && d.some((v) => v.id === i.id)) return;
602
- const m = d.map(
603
- (v) => v.id === s ? {
604
- ...v,
737
+ [w, y, L, V, M, s, j, B]
738
+ ), bt = F(
739
+ (n, i) => {
740
+ const d = i.id !== n;
741
+ if (d && w.some((f) => f.id === i.id)) return;
742
+ const p = w.map(
743
+ (f) => f.id === n ? {
744
+ ...f,
605
745
  id: i.id,
606
- data: { step: i, isInternal: Pe(i.uses.app) }
607
- } : v
746
+ data: { step: i, isInternal: Je(i.uses.app) }
747
+ } : f
608
748
  );
609
- if (p) {
610
- const v = hs(b, s, i.id);
611
- I(m), A(v), K === s && G(i.id), O === s && se(i.id), D(m, v);
749
+ if (d) {
750
+ const f = io(y, n, i.id), v = zs(P, n, i.id);
751
+ L(p), V(f), te(v), K === n && $(i.id), H === n && ue(i.id), M(p, f, v);
612
752
  return;
613
753
  }
614
- I(m), D(m, b);
754
+ L(p), M(p, y);
755
+ },
756
+ [w, y, P, L, V, K, H, M]
757
+ ), ye = F(
758
+ (n) => {
759
+ s || (te(n), M(w, y, n));
760
+ },
761
+ [s, w, y, M]
762
+ ), An = F(() => {
763
+ var f;
764
+ if (s) return;
765
+ const n = (f = ge.current) == null ? void 0 : f.getBoundingClientRect(), i = n ? pe({ x: n.left + n.width / 2, y: n.top + n.height / 2 }) : { x: 0, y: 0 }, d = P.notes ?? [], p = {
766
+ id: on(
767
+ "note",
768
+ d.map((v) => v.id)
769
+ ),
770
+ color: "#facc15",
771
+ position: { x: Math.round(i.x - 100), y: Math.round(i.y - 60) },
772
+ size: { width: 200, height: 120 },
773
+ content: ""
774
+ };
775
+ ye(Yt({ ...P, notes: [...d, p] }));
776
+ }, [s, P, pe, ye]), In = F(
777
+ (n, i) => {
778
+ if (s) return;
779
+ const d = i ? Math.min(n.x, i.x) : n.x, p = i ? Math.min(n.y, i.y) : n.y, f = i ? Math.abs(i.x - n.x) : 360, v = i ? Math.abs(i.y - n.y) : 240, E = w.filter((_e) => {
780
+ const Ke = ot(_e), Mt = Ke.x + Ke.w / 2, Ft = Ke.y + Ke.h / 2;
781
+ return Mt >= d && Mt <= d + f && Ft >= p && Ft <= p + v;
782
+ }).map((_e) => _e.id), R = P.sections ?? [], I = on(
783
+ "section",
784
+ R.map((_e) => _e.id)
785
+ ), Q = {
786
+ id: I,
787
+ title: "Section",
788
+ color: "#6366f1",
789
+ position: { x: Math.round(d), y: Math.round(p) },
790
+ size: { width: Math.round(f), height: Math.round(v) },
791
+ nodes: []
792
+ }, Z = { ...P, sections: [...R, Q] };
793
+ ye(Yt(Gt(Z, I, E)));
794
+ },
795
+ [s, w, P, ye]
796
+ );
797
+ z(() => {
798
+ if (!ie) return;
799
+ const n = (i) => {
800
+ i.key === "Escape" && (ke(!1), de(null));
801
+ };
802
+ return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
803
+ }, [ie]);
804
+ const Dn = F(
805
+ (n, i) => {
806
+ var E;
807
+ if (s) return;
808
+ const d = (E = P.sections) == null ? void 0 : E.find((R) => R.id === n);
809
+ if (!d) return;
810
+ const p = new Set(d.nodes), f = w.map(
811
+ (R) => p.has(R.id) ? { ...R, position: { x: R.position.x + i.dx, y: R.position.y + i.dy } } : R
812
+ ), v = {
813
+ ...P,
814
+ sections: (P.sections ?? []).map(
815
+ (R) => R.id === n ? { ...R, position: { x: R.position.x + i.dx, y: R.position.y + i.dy } } : R
816
+ )
817
+ };
818
+ L(f), te(v), M(f, y, v);
615
819
  },
616
- [d, b, I, A, K, O, D]
617
- ), he = J(
618
- (s, i, p) => {
820
+ [s, P, w, y, L, M]
821
+ ), Ln = F(
822
+ (n, i) => {
823
+ if (s) return;
824
+ const d = n === "note" ? { ...P, notes: (P.notes ?? []).filter((p) => p.id !== i) } : { ...P, sections: (P.sections ?? []).filter((p) => p.id !== i) };
825
+ ye(d);
826
+ },
827
+ [s, P, ye]
828
+ ), Mn = (n) => {
829
+ let i = P;
830
+ for (const d of n) {
831
+ const p = ot(d), f = p.x + p.w / 2, v = p.y + p.h / 2, E = (i.sections ?? []).find(
832
+ (I) => f >= I.position.x && f <= I.position.x + I.size.width && v >= I.position.y && v <= I.position.y + I.size.height
833
+ ), R = Hs(i, d.id);
834
+ E ? (R.length !== 1 || R[0] !== E.id) && (i = Gt(i, E.id, [d.id])) : R.length > 0 && (i = Xt(i, d.id));
835
+ }
836
+ return i;
837
+ }, Ze = F(
838
+ (n, i, d) => {
619
839
  (async () => {
620
- const m = await f.saveStepTest(e.id, s, i).catch((v) => (console.error("step run fixture save failed", v), null));
621
- await f.recordStepTestRun(e.id, s, {
622
- stepTestId: (m == null ? void 0 : m.id) ?? null,
623
- status: p.status,
840
+ const p = await k.saveStepTest(e.id, n, i).catch((f) => (console.error("step run fixture save failed", f), null));
841
+ await k.recordStepTestRun(e.id, n, {
842
+ stepTestId: (p == null ? void 0 : p.id) ?? null,
843
+ status: d.status,
624
844
  input: i.input,
625
- output: p.output,
626
- error: p.error,
627
- ...p.meta ? { meta: p.meta } : {}
845
+ output: d.output,
846
+ error: d.error,
847
+ ...d.meta ? { meta: d.meta } : {}
628
848
  });
629
- })().catch((m) => {
630
- console.error("step run persist failed", m);
849
+ })().catch((p) => {
850
+ console.error("step run persist failed", p);
631
851
  });
632
852
  },
633
- [f, e.id]
634
- ), Te = J(
635
- (s) => {
636
- const i = d.find((p) => p.id === s);
637
- !i || Ae(i.data.step.uses.app) || E({ stepId: s, status: "collect" });
853
+ [k, e.id]
854
+ ), yt = F(
855
+ (n) => {
856
+ const i = w.find((d) => d.id === n);
857
+ !i || Be(i.data.step.uses.app) || D({ stepId: n, status: "collect" });
638
858
  },
639
- [d]
640
- ), en = J(
641
- async (s, i, p) => {
859
+ [w]
860
+ ), Fn = F(
861
+ async (n, i, d) => {
642
862
  C == null || C();
643
- const m = d.find((L) => L.id === s);
644
- if (!m) return;
645
- const v = m.data.step, k = Ce(v.uses.app), T = k ? { input: i } : { ...v.with ?? {}, ...i }, U = k ? { input: i, with: i } : { input: i, with: T };
646
- E({ stepId: s, status: "running" });
863
+ const p = w.find((I) => I.id === n);
864
+ if (!p) return;
865
+ const f = p.data.step, v = Ie(f.uses.app), E = v ? { input: i } : { ...f.with ?? {}, ...i }, R = v ? { input: i, with: i } : { input: i, with: E };
866
+ D({ stepId: n, status: "running" });
647
867
  try {
648
- const L = await f.invokeAction(v.uses.app, v.uses.action, T, {
649
- ...v.uses.connection ? { connectionId: v.uses.connection } : {},
868
+ const I = await k.invokeAction(f.uses.app, f.uses.action, E, {
869
+ ...f.uses.connection ? { connectionId: f.uses.connection } : {},
650
870
  // Scope document expressions to the workflow's selected project (T2.1.2).
651
871
  project: u,
652
872
  // Omitted when nothing upstream has a saved output, so a run with no
653
873
  // seed sends exactly the request it sent before.
654
- ...p ? { state: p } : {}
655
- }), Q = L.logs, Z = L.meta;
656
- E({
657
- stepId: s,
874
+ ...d ? { state: d } : {}
875
+ }), Q = I.logs, Z = I.meta;
876
+ D({
877
+ stepId: n,
658
878
  status: "done",
659
- value: L.value,
879
+ value: I.value,
660
880
  logs: Q,
661
881
  ...Z ? { meta: Z } : {}
662
- }), he(s, U, {
882
+ }), Ze(n, R, {
663
883
  status: "succeeded",
664
- output: L.value,
884
+ output: I.value,
665
885
  ...Z ? { meta: Z } : {}
666
886
  });
667
- } catch (L) {
668
- const Q = L;
669
- E({
670
- stepId: s,
887
+ } catch (I) {
888
+ const Q = I;
889
+ D({
890
+ stepId: n,
671
891
  status: "error",
672
- error: Q.message ?? String(L),
892
+ error: Q.message ?? String(I),
673
893
  errorCode: Q.code
674
- }), he(s, U, { status: "failed", error: Q.message ?? String(L) });
894
+ }), Ze(n, R, { status: "failed", error: Q.message ?? String(I) });
675
895
  }
676
896
  },
677
- [d, f, he, u, C]
678
- ), je = M(
897
+ [w, k, Ze, u, C]
898
+ ), et = O(
679
899
  () => ({
680
- onEdit: (s) => {
681
- oe("props"), se(s);
900
+ onEdit: (n) => {
901
+ X("props"), ue(n);
682
902
  },
683
- onEditJson: (s) => {
684
- oe("json"), se(s);
903
+ onEditJson: (n) => {
904
+ X("json"), ue(n);
685
905
  },
686
- onRun: Te,
687
- onDuplicate: h,
688
- onDelete: ve,
689
- readOnly: o
906
+ onRun: yt,
907
+ onDuplicate: gt,
908
+ onDelete: $e,
909
+ onAddFromPort: Ve,
910
+ readOnly: s
690
911
  }),
691
- [Te, h, ve, o]
912
+ [yt, gt, $e, Ve, s]
692
913
  );
693
- _(() => {
694
- const s = Ie.current;
695
- if (!s) return;
696
- const i = (p) => {
697
- const m = p.target.closest(".react-flow__node");
698
- if (!m) return;
699
- const v = m.getAttribute("data-id");
700
- v && (p.stopPropagation(), je.onEdit(v));
914
+ z(() => {
915
+ const n = ge.current;
916
+ if (!n) return;
917
+ const i = (d) => {
918
+ const p = d.target.closest(".react-flow__node");
919
+ if (!p) return;
920
+ const f = p.getAttribute("data-id");
921
+ f && (d.stopPropagation(), et.onEdit(f));
701
922
  };
702
- return s.addEventListener("dblclick", i, !0), () => s.removeEventListener("dblclick", i, !0);
703
- }, [je]);
704
- const ot = ((gt = d.find((s) => s.id === O)) == null ? void 0 : gt.data.step) ?? null, Ue = g ? ((bt = d.find((s) => s.id === g.stepId)) == null ? void 0 : bt.data.step) ?? null : null, ze = (g == null ? void 0 : g.status) === "collect" && !!Ue, tn = M(
705
- () => g ? St(g.stepId, d, b).steps : [],
706
- [g, d, b]
707
- ), rt = M(() => {
708
- const s = /* @__PURE__ */ new Map();
709
- for (const i of d) s.set(i.id, ws(i.id, b).count);
710
- return s;
711
- }, [d, b]), nn = M(
923
+ return n.addEventListener("dblclick", i, !0), () => n.removeEventListener("dblclick", i, !0);
924
+ }, [et]);
925
+ const Te = w.find((n) => n.id === H), vt = (Te == null ? void 0 : Te.data.step) ?? null, tt = x ? ((Lt = w.find((n) => n.id === x.stepId)) == null ? void 0 : Lt.data.step) ?? null : null, nt = (x == null ? void 0 : x.status) === "collect" && !!tt, Vn = O(
926
+ () => x ? Bt(x.stepId, w, y).steps : [],
927
+ [x, w, y]
928
+ ), Nt = O(() => {
929
+ const n = /* @__PURE__ */ new Map();
930
+ for (const i of w) n.set(i.id, ro(i.id, y).count);
931
+ return n;
932
+ }, [w, y]), $n = O(
712
933
  () => ({
713
- step: xs,
714
- control: Rs
934
+ step: vo,
935
+ control: No
715
936
  }),
716
937
  []
717
- ), [Fe, at] = S({}), [it, lt] = S({}), ct = M(
938
+ ), [qe, Ct] = S({}), [St, xt] = S({}), kt = O(
718
939
  () => ({
719
- actionDef: (s, i) => {
720
- var p;
721
- return (p = ne[s]) == null ? void 0 : p.find((m) => m.key === i);
940
+ actionDef: (n, i) => {
941
+ var d;
942
+ return (d = le[n]) == null ? void 0 : d.find((p) => p.key === i);
722
943
  },
723
- testOutputs: Fe
944
+ testOutputs: qe
724
945
  }),
725
- [ne, Fe]
726
- ), [dt, ut] = S(null), Ne = M(() => {
727
- const s = St(O, d, b, ct);
728
- return { ...s, steps: Dn(s.steps, O ?? dt) };
729
- }, [O, dt, d, b, ct]), pt = JSON.stringify(Ne.steps.map((s) => s.id));
730
- _(() => {
731
- const s = JSON.parse(pt);
732
- if (!O || s.length === 0) {
733
- at({}), lt({});
946
+ [le, qe]
947
+ ), [Et, Pt] = S(null), Ae = O(() => {
948
+ const n = Bt(H, w, y, kt);
949
+ return { ...n, steps: fs(n.steps, H ?? Et) };
950
+ }, [H, Et, w, y, kt]), Rt = JSON.stringify(Ae.steps.map((n) => n.id));
951
+ z(() => {
952
+ const n = JSON.parse(Rt);
953
+ if (!H || n.length === 0) {
954
+ Ct({}), xt({});
734
955
  return;
735
956
  }
736
957
  let i = !1;
737
958
  return Promise.all(
738
- s.map(async (p) => {
959
+ n.map(async (d) => {
739
960
  try {
740
- const m = await f.listStepTests(e.id, p), v = m.length ? m[m.length - 1] : null;
741
- return v ? { id: p, output: v.lastRunOutput, meta: v.lastRunMeta } : null;
961
+ const p = await k.listStepTests(e.id, d), f = p.length ? p[p.length - 1] : null;
962
+ return f ? { id: d, output: f.lastRunOutput, meta: f.lastRunMeta } : null;
742
963
  } catch {
743
964
  return null;
744
965
  }
745
966
  })
746
- ).then((p) => {
967
+ ).then((d) => {
747
968
  if (i) return;
748
- const m = {}, v = {};
749
- for (const k of p)
750
- k != null && k.meta && (v[k.id] = k.meta), !(!k || k.output === void 0 || k.output === null) && (m[k.id] = k.output);
751
- at(m), lt(v);
969
+ const p = {}, f = {};
970
+ for (const v of d)
971
+ v != null && v.meta && (f[v.id] = v.meta), !(!v || v.output === void 0 || v.output === null) && (p[v.id] = v.output);
972
+ Ct(p), xt(f);
752
973
  }), () => {
753
974
  i = !0;
754
975
  };
755
- }, [f, e.id, O, pt]);
756
- const ft = M(() => {
757
- const s = {};
758
- for (const i of Ne.steps) {
759
- Object.assign(s, Ln(i.id, it[i.id]));
760
- const p = Fe[i.id];
761
- if (p !== void 0) {
762
- if (s[`steps.${i.id}.output`] = p, typeof p == "object" && p !== null && !Array.isArray(p))
763
- for (const [m, v] of Object.entries(p))
764
- s[`steps.${i.id}.output.${m}`] = v;
765
- for (const m of i.outputs ?? []) {
766
- if (!m.path || !m.key.includes(".")) continue;
767
- const v = Vn(p, m.key);
768
- v !== void 0 && (s[`steps.${i.id}.output.${m.key}`] = v);
976
+ }, [k, e.id, H, Rt]);
977
+ const Tt = O(() => {
978
+ const n = {};
979
+ for (const i of Ae.steps) {
980
+ Object.assign(n, hs(i.id, St[i.id]));
981
+ const d = qe[i.id];
982
+ if (d !== void 0) {
983
+ if (n[`steps.${i.id}.output`] = d, typeof d == "object" && d !== null && !Array.isArray(d))
984
+ for (const [p, f] of Object.entries(d))
985
+ n[`steps.${i.id}.output.${p}`] = f;
986
+ for (const p of i.outputs ?? []) {
987
+ if (!p.path || !p.key.includes(".")) continue;
988
+ const f = ws(d, p.key);
989
+ f !== void 0 && (n[`steps.${i.id}.output.${p.key}`] = f);
769
990
  }
770
991
  }
771
992
  }
772
- return s;
773
- }, [Ne.steps, Fe, it]), ht = Vt(), wt = M(
993
+ return n;
994
+ }, [Ae.steps, qe, St]), At = an(), It = O(
774
995
  () => ({
775
- ...l ?? {},
776
- steps: Ne.steps,
777
- hasTrigger: Ne.hasTrigger,
996
+ ...c ?? {},
997
+ steps: Ae.steps,
998
+ hasTrigger: Ae.hasTrigger,
778
999
  sampleValues: {
779
- ...ht.sampleValues ?? {},
780
- ...(l == null ? void 0 : l.sampleValues) ?? {},
781
- ...ft
1000
+ ...At.sampleValues ?? {},
1001
+ ...(c == null ? void 0 : c.sampleValues) ?? {},
1002
+ ...Tt
782
1003
  }
783
1004
  }),
784
- [l, ht.sampleValues, Ne, ft]
1005
+ [c, At.sampleValues, Ae, Tt]
785
1006
  );
786
- return /* @__PURE__ */ t(Xt.Provider, { value: je, children: /* @__PURE__ */ t(et.Provider, { value: W, children: /* @__PURE__ */ t(tt.Provider, { value: rt, children: /* @__PURE__ */ t(nt.Provider, { value: a, children: /* @__PURE__ */ t(Fn, { project: u, children: /* @__PURE__ */ t(Wn, { value: wt, children: /* @__PURE__ */ w(
1007
+ return /* @__PURE__ */ o(wt.Provider, { value: et, children: /* @__PURE__ */ o(pt.Provider, { value: B, children: /* @__PURE__ */ o(ft.Provider, { value: Nt, children: /* @__PURE__ */ o(ht.Provider, { value: l, children: /* @__PURE__ */ o(ms, { project: u, children: /* @__PURE__ */ o(gs, { value: It, children: /* @__PURE__ */ m(
787
1008
  "div",
788
1009
  {
789
- ref: Ie,
1010
+ ref: ge,
790
1011
  className: "w6w-flow",
791
1012
  style: { width: "100%", height: r, position: "relative" },
792
- onKeyDown: (s) => {
793
- if (s.key !== "Backspace" && s.key !== "Delete" || O || $ || !K && !x) return;
794
- const i = s.target;
795
- i.isContentEditable || i.tagName === "INPUT" || i.tagName === "TEXTAREA" || i.tagName === "SELECT" || i.closest("dialog, .w6w-modal") !== null || (s.preventDefault(), K ? ve(K) : x && Ve(x));
1013
+ onKeyDown: (n) => {
1014
+ if (n.key !== "Backspace" && n.key !== "Delete" || H || Ee || !K && !W) return;
1015
+ const i = n.target;
1016
+ i.isContentEditable || i.tagName === "INPUT" || i.tagName === "TEXTAREA" || i.tagName === "SELECT" || i.closest("dialog, .w6w-modal") !== null || (n.preventDefault(), K ? $e(K) : W && Rn(W));
796
1017
  },
797
1018
  children: [
798
- /* @__PURE__ */ w(
799
- cn,
1019
+ /* @__PURE__ */ m(
1020
+ Hn,
800
1021
  {
801
- nodes: d,
802
- edges: b,
1022
+ nodes: w,
1023
+ edges: y,
803
1024
  defaultEdgeOptions: { type: "smoothstep" },
804
- connectionLineType: dn.SmoothStep,
805
- onNodesChange: ce,
806
- onEdgesChange: de,
807
- onConnect: ae,
808
- onConnectEnd: He,
809
- isValidConnection: ie,
810
- onNodeDragStop: () => {
811
- V && D(d, b);
1025
+ connectionLineType: jn.SmoothStep,
1026
+ onNodesChange: Se,
1027
+ onEdgesChange: xe,
1028
+ onConnect: je,
1029
+ onConnectEnd: J,
1030
+ isValidConnection: He,
1031
+ onNodeDragStop: (n, i, d) => {
1032
+ const p = Mn(d), f = p !== P;
1033
+ f && te(p), !(!A && !f) && M(w, y, p);
812
1034
  },
813
- onMoveEnd: (s, i) => {
814
- if (!s || o) return;
815
- const p = Nt(e, d, b), m = $n(p, i);
816
- m !== p && n(m);
1035
+ onMoveEnd: (n, i) => {
1036
+ if (!n || s) return;
1037
+ const d = $t(e, w, y), p = ys(d, i);
1038
+ p !== d && t(p);
817
1039
  },
818
- onSelectionChange: ({ nodes: s, edges: i }) => {
819
- var p, m;
820
- G(((p = s[0]) == null ? void 0 : p.id) ?? null), z(((m = i[0]) == null ? void 0 : m.id) ?? null);
1040
+ onSelectionChange: ({ nodes: n, edges: i }) => {
1041
+ var d, p;
1042
+ $(((d = n[0]) == null ? void 0 : d.id) ?? null), me(((p = i[0]) == null ? void 0 : p.id) ?? null);
821
1043
  },
822
- nodeTypes: nn,
823
- nodesDraggable: !o,
824
- nodesConnectable: !o,
1044
+ nodeTypes: $n,
1045
+ nodesDraggable: !s,
1046
+ nodesConnectable: !s,
1047
+ connectOnClick: !1,
825
1048
  elementsSelectable: !0,
826
- ...R ? { defaultViewport: R } : { fitView: !0 },
1049
+ ..._ ? { defaultViewport: _ } : { fitView: !0 },
827
1050
  deleteKeyCode: null,
828
- colorMode: _e,
1051
+ colorMode: ze,
829
1052
  proOptions: { hideAttribution: !0 },
830
1053
  children: [
831
- /* @__PURE__ */ t(un, { gap: 16 }),
832
- /* @__PURE__ */ t(pn, { showInteractive: !1, children: !o && /* @__PURE__ */ t(
833
- fn,
1054
+ /* @__PURE__ */ o(On, { gap: 16 }),
1055
+ /* @__PURE__ */ o(Un, { showInteractive: !1, children: !s && /* @__PURE__ */ o(
1056
+ qn,
834
1057
  {
835
- onClick: xe,
1058
+ onClick: Y,
836
1059
  title: "Auto-layout — re-flow the graph into columns",
837
1060
  "aria-label": "Auto-layout the graph",
838
- children: /* @__PURE__ */ t(ye, { name: "layout" })
1061
+ children: /* @__PURE__ */ o(ve, { name: "layout" })
839
1062
  }
840
1063
  ) }),
841
- /* @__PURE__ */ t(hn, { pannable: !0, zoomable: !0, style: { background: "var(--w6w-panel-2)" } }),
842
- !o && /* @__PURE__ */ t(vt, { position: "top-left", children: /* @__PURE__ */ t(
843
- "button",
1064
+ /* @__PURE__ */ o(Kn, { pannable: !0, zoomable: !0, style: { background: "var(--w6w-panel-2)" } }),
1065
+ !s && /* @__PURE__ */ m(Vt, { position: "top-left", className: "w6w-flow-tools", children: [
1066
+ /* @__PURE__ */ o(
1067
+ "button",
1068
+ {
1069
+ type: "button",
1070
+ className: "w6w-btn",
1071
+ onClick: () => Pe(!0),
1072
+ children: "+ Node"
1073
+ }
1074
+ ),
1075
+ /* @__PURE__ */ o(
1076
+ Jt,
1077
+ {
1078
+ label: "Add note",
1079
+ icon: "sticky-note",
1080
+ className: "w6w-flow-tool",
1081
+ "data-testid": "add-note",
1082
+ onClick: An
1083
+ }
1084
+ ),
1085
+ /* @__PURE__ */ o(
1086
+ Jt,
1087
+ {
1088
+ label: "Draw section",
1089
+ title: "Draw section — drag a frame on the canvas (Esc cancels)",
1090
+ icon: "frame",
1091
+ className: `w6w-flow-tool${ie ? " active" : ""}`,
1092
+ "aria-pressed": ie,
1093
+ "data-testid": "draw-section",
1094
+ onClick: () => {
1095
+ ke(!ie), de(null);
1096
+ }
1097
+ }
1098
+ )
1099
+ ] }),
1100
+ !s && ie && /* @__PURE__ */ o(
1101
+ "div",
844
1102
  {
845
- type: "button",
846
- className: "w6w-btn",
847
- onClick: () => te(!0),
848
- children: "+ Step"
1103
+ className: "w6w-section-draw nopan nodrag nowheel",
1104
+ "data-testid": "section-draw-surface",
1105
+ onPointerDown: (n) => {
1106
+ if (n.button !== 0) return;
1107
+ n.currentTarget.setPointerCapture(n.pointerId);
1108
+ const { clientX: i, clientY: d } = n;
1109
+ de({ sx: i, sy: d, ex: i, ey: d });
1110
+ },
1111
+ onPointerMove: (n) => {
1112
+ const { clientX: i, clientY: d } = n;
1113
+ de((p) => p && { ...p, ex: i, ey: d });
1114
+ },
1115
+ onPointerUp: () => {
1116
+ const n = q;
1117
+ if (de(null), ke(!1), !n) return;
1118
+ const i = pe({ x: n.sx, y: n.sy }), d = Math.abs(n.ex - n.sx) > 6 || Math.abs(n.ey - n.sy) > 6;
1119
+ In(
1120
+ i,
1121
+ d ? pe({ x: n.ex, y: n.ey }) : null
1122
+ );
1123
+ },
1124
+ children: q && (() => {
1125
+ var p;
1126
+ const n = (p = ge.current) == null ? void 0 : p.getBoundingClientRect(), i = (n == null ? void 0 : n.left) ?? 0, d = (n == null ? void 0 : n.top) ?? 0;
1127
+ return /* @__PURE__ */ o(
1128
+ "div",
1129
+ {
1130
+ className: "w6w-section-draw-rect",
1131
+ style: {
1132
+ left: Math.min(q.sx, q.ex) - i,
1133
+ top: Math.min(q.sy, q.ey) - d,
1134
+ width: Math.abs(q.ex - q.sx),
1135
+ height: Math.abs(q.ey - q.sy)
1136
+ }
1137
+ }
1138
+ );
1139
+ })()
849
1140
  }
850
- ) }),
851
- !o && fe && /* @__PURE__ */ t(vt, { position: "top-right", children: /* @__PURE__ */ w("div", { className: "w6w-edge-lane", children: [
852
- /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "Run on" }),
853
- ["success", "error"].map((s) => /* @__PURE__ */ t(
1141
+ ),
1142
+ !s && Ue && /* @__PURE__ */ o(Vt, { position: "top-right", children: /* @__PURE__ */ m("div", { className: "w6w-edge-lane", children: [
1143
+ /* @__PURE__ */ o("span", { className: "w6w-muted w6w-small", children: "Run on" }),
1144
+ ["success", "error"].map((n) => /* @__PURE__ */ o(
854
1145
  "button",
855
1146
  {
856
1147
  type: "button",
857
- className: `w6w-btn w6w-btn-sm w6w-btn-ghost${ee(fe) === s ? " active" : ""}`,
858
- "aria-pressed": ee(fe) === s,
859
- title: Ss,
860
- onClick: () => Be(s),
861
- children: s === "success" ? "Success" : "Error"
1148
+ className: `w6w-btn w6w-btn-sm w6w-btn-ghost${oe(Ue) === n ? " active" : ""}`,
1149
+ "aria-pressed": oe(Ue) === n,
1150
+ title: go,
1151
+ onClick: () => Pn(n),
1152
+ children: n === "success" ? "Success" : "Error"
862
1153
  },
863
- s
1154
+ n
864
1155
  )),
865
- (pe == null ? void 0 : pe.edgeId) === fe.id && /* @__PURE__ */ t("span", { className: "w6w-edge-lane-err w6w-small", role: "alert", children: pe.message })
866
- ] }) })
1156
+ (fe == null ? void 0 : fe.edgeId) === Ue.id && /* @__PURE__ */ o("span", { className: "w6w-edge-lane-err w6w-small", role: "alert", children: fe.message })
1157
+ ] }) }),
1158
+ /* @__PURE__ */ o(
1159
+ bs,
1160
+ {
1161
+ canvas: P,
1162
+ readOnly: s,
1163
+ savePosition: A,
1164
+ onChange: ye,
1165
+ onSectionDrop: Dn,
1166
+ onRequestDelete: (n, i) => !s && ae({ kind: n, id: i })
1167
+ }
1168
+ )
867
1169
  ]
868
1170
  }
869
1171
  ),
870
- $ && /* @__PURE__ */ t(
871
- On,
1172
+ re && /* @__PURE__ */ o(
1173
+ zt,
1174
+ {
1175
+ title: re.kind === "note" ? "Delete note" : "Delete section",
1176
+ message: re.kind === "note" ? "Delete this note?" : "Delete this section? Its nodes are kept.",
1177
+ confirmLabel: "Delete",
1178
+ onConfirm: () => {
1179
+ Ln(re.kind, re.id), ae(null);
1180
+ },
1181
+ onClose: () => ae(null)
1182
+ }
1183
+ ),
1184
+ Ee && /* @__PURE__ */ o(
1185
+ vs,
872
1186
  {
873
1187
  onClose: () => {
874
- te(!1), X(null), ut(null);
1188
+ Pe(!1), ne(null), Pt(null);
875
1189
  },
876
- onAdd: (s) => {
877
- const i = q(s);
878
- return i && ut(i), i;
1190
+ onAdd: (n) => {
1191
+ const i = Tn(n);
1192
+ return i && Pt(i), i;
879
1193
  },
880
- onDraftChange: (s, i) => Y(s, { id: s, ...i }),
1194
+ onDraftChange: (n, i) => bt(n, { id: n, ...i }),
881
1195
  workflowId: e.id,
882
- upstreamSteps: Jn(H, d, b)
1196
+ upstreamSteps: Ns(j, w, y)
883
1197
  }
884
1198
  ),
885
- ot && O && // No `key` on purpose: renaming a step updates `editingId`, and a keyed
1199
+ vt && H && // No `key` on purpose: renaming a step updates `editingId`, and a keyed
886
1200
  // remount would drop focus mid-keystroke. The modal seeds its own state
887
1201
  // once and unmounts (editingId → null) between edits of different nodes.
888
- /* @__PURE__ */ t(
889
- Ts,
1202
+ /* @__PURE__ */ o(
1203
+ Co,
890
1204
  {
891
1205
  workflowId: e.id,
892
- step: ot,
893
- upstreamSteps: wt.steps ?? [],
894
- readOnly: o,
895
- fanOutCount: rt.get(O) ?? 0,
896
- initialView: be,
897
- onChange: (s) => Y(O, s),
898
- onClose: () => se(null),
1206
+ step: vt,
1207
+ upstreamSteps: It.steps ?? [],
1208
+ readOnly: s,
1209
+ fanOutCount: Nt.get(H) ?? 0,
1210
+ initialView: Re,
1211
+ stepProblem: Te == null ? void 0 : Te.data.stepProblem,
1212
+ onChange: (n) => bt(H, n),
1213
+ onClose: () => ue(null),
899
1214
  onTestRun: C
900
1215
  }
901
1216
  ),
902
- g && /* @__PURE__ */ w(
903
- Ot,
1217
+ x && /* @__PURE__ */ m(
1218
+ un,
904
1219
  {
905
- title: `${ze ? "Run step" : "Test run"}: ${g.stepId}`,
906
- onClose: () => E(null),
1220
+ title: `${nt ? "Run node" : "Test run"}: ${x.stepId}`,
1221
+ onClose: () => D(null),
907
1222
  children: [
908
- ze && Ue && /* @__PURE__ */ t(
909
- Es,
1223
+ nt && tt && /* @__PURE__ */ o(
1224
+ yo,
910
1225
  {
911
1226
  workflowId: e.id,
912
- step: Ue,
913
- upstreamSteps: tn,
914
- onCancel: () => E(null),
915
- onRun: (s, i) => en(g.stepId, s, i)
1227
+ step: tt,
1228
+ upstreamSteps: Vn,
1229
+ onCancel: () => D(null),
1230
+ onRun: (n, i) => Fn(x.stepId, n, i)
916
1231
  },
917
- g.stepId
1232
+ x.stepId
918
1233
  ),
919
- !ze && /* @__PURE__ */ w(B, { children: [
920
- /* @__PURE__ */ w("div", { className: "w6w-modal-body", children: [
921
- g.status === "running" && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Running…" }),
922
- g.status === "error" && /* @__PURE__ */ w("div", { className: "w6w-result w6w-error", children: [
923
- g.errorCode && /* @__PURE__ */ t(
1234
+ !nt && /* @__PURE__ */ m(U, { children: [
1235
+ /* @__PURE__ */ m("div", { className: "w6w-modal-body", children: [
1236
+ x.status === "running" && /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Running…" }),
1237
+ x.status === "error" && /* @__PURE__ */ m("div", { className: "w6w-result w6w-error", children: [
1238
+ x.errorCode && /* @__PURE__ */ o(
924
1239
  "div",
925
1240
  {
926
1241
  className: "w6w-small",
927
1242
  style: { opacity: 0.75, marginBottom: 4 },
928
- children: /* @__PURE__ */ t("code", { children: g.errorCode })
1243
+ children: /* @__PURE__ */ o("code", { children: x.errorCode })
929
1244
  }
930
1245
  ),
931
- g.error || "The step failed with no error message."
1246
+ x.error || "The node failed with no error message."
932
1247
  ] }),
933
- g.status === "done" && /* @__PURE__ */ w("div", { children: [
934
- /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", style: { marginBottom: 6 }, children: "Result" }),
935
- /* @__PURE__ */ t(
1248
+ x.status === "done" && /* @__PURE__ */ m("div", { children: [
1249
+ /* @__PURE__ */ o("div", { className: "w6w-muted w6w-small", style: { marginBottom: 6 }, children: "Result" }),
1250
+ /* @__PURE__ */ o(
936
1251
  "pre",
937
1252
  {
938
1253
  className: "w6w-result",
@@ -942,11 +1257,11 @@ function ks({
942
1257
  overflow: "auto",
943
1258
  margin: 0
944
1259
  },
945
- children: JSON.stringify(g.value, null, 2)
1260
+ children: JSON.stringify(x.value, null, 2)
946
1261
  }
947
1262
  ),
948
- g.meta && /* @__PURE__ */ w(B, { children: [
949
- /* @__PURE__ */ t(
1263
+ x.meta && /* @__PURE__ */ m(U, { children: [
1264
+ /* @__PURE__ */ o(
950
1265
  "div",
951
1266
  {
952
1267
  className: "w6w-muted w6w-small",
@@ -954,7 +1269,7 @@ function ks({
954
1269
  children: "Metadata"
955
1270
  }
956
1271
  ),
957
- /* @__PURE__ */ t(
1272
+ /* @__PURE__ */ o(
958
1273
  "pre",
959
1274
  {
960
1275
  className: "w6w-result",
@@ -964,13 +1279,13 @@ function ks({
964
1279
  overflow: "auto",
965
1280
  margin: 0
966
1281
  },
967
- children: JSON.stringify(g.meta, null, 2)
1282
+ children: JSON.stringify(x.meta, null, 2)
968
1283
  }
969
1284
  )
970
1285
  ] })
971
1286
  ] }),
972
- g.logs && g.logs.length > 0 && /* @__PURE__ */ w("div", { children: [
973
- /* @__PURE__ */ t(
1287
+ x.logs && x.logs.length > 0 && /* @__PURE__ */ m("div", { children: [
1288
+ /* @__PURE__ */ o(
974
1289
  "div",
975
1290
  {
976
1291
  className: "w6w-muted w6w-small",
@@ -978,7 +1293,7 @@ function ks({
978
1293
  children: "Console output"
979
1294
  }
980
1295
  ),
981
- /* @__PURE__ */ t(
1296
+ /* @__PURE__ */ o(
982
1297
  "pre",
983
1298
  {
984
1299
  className: "w6w-result",
@@ -988,18 +1303,18 @@ function ks({
988
1303
  overflow: "auto",
989
1304
  margin: 0
990
1305
  },
991
- children: g.logs.join(`
1306
+ children: x.logs.join(`
992
1307
  `)
993
1308
  }
994
1309
  )
995
1310
  ] })
996
1311
  ] }),
997
- /* @__PURE__ */ t("div", { className: "w6w-modal-actions", children: /* @__PURE__ */ t(
1312
+ /* @__PURE__ */ o("div", { className: "w6w-modal-actions", children: /* @__PURE__ */ o(
998
1313
  "button",
999
1314
  {
1000
1315
  type: "button",
1001
1316
  className: "w6w-btn",
1002
- onClick: () => E(null),
1317
+ onClick: () => D(null),
1003
1318
  children: "Close"
1004
1319
  }
1005
1320
  ) })
@@ -1007,75 +1322,75 @@ function ks({
1007
1322
  ]
1008
1323
  }
1009
1324
  ),
1010
- re !== null && /* @__PURE__ */ t(
1011
- Mn,
1325
+ Le !== null && /* @__PURE__ */ o(
1326
+ zt,
1012
1327
  {
1013
- title: "Delete step",
1014
- message: `Delete step "${re}"? Its connections are removed too.`,
1328
+ title: "Delete node",
1329
+ message: `Delete node "${Le}"? Its connections are removed too.`,
1015
1330
  confirmLabel: "Delete",
1016
1331
  onConfirm: () => {
1017
- Le(re), ke(null);
1332
+ Oe(Le), G(null);
1018
1333
  },
1019
- onClose: () => ke(null)
1334
+ onClose: () => G(null)
1020
1335
  }
1021
1336
  )
1022
1337
  ]
1023
1338
  }
1024
1339
  ) }) }) }) }) }) });
1025
1340
  }
1026
- function st(e) {
1341
+ function mt(e) {
1027
1342
  try {
1028
- const n = JSON.parse(e);
1029
- return n && typeof n == "object" && !Array.isArray(n) ? n : null;
1343
+ const t = JSON.parse(e);
1344
+ return t && typeof t == "object" && !Array.isArray(t) ? t : null;
1030
1345
  } catch {
1031
1346
  return null;
1032
1347
  }
1033
1348
  }
1034
- function Yt({
1349
+ function xn({
1035
1350
  text: e,
1036
- onChange: n,
1037
- seeds: o,
1351
+ onChange: t,
1352
+ seeds: s,
1038
1353
  readOnly: r
1039
1354
  }) {
1040
- const c = st(e), l = c ? Object.keys(c).length : 0, u = l > 0, [y, C] = S(u);
1041
- _(() => {
1042
- u && C(!0);
1355
+ const a = mt(e), c = a ? Object.keys(a).length : 0, u = c > 0, [b, N] = S(u);
1356
+ z(() => {
1357
+ u && N(!0);
1043
1358
  }, [u]);
1044
- const N = (f) => {
1045
- n(JSON.stringify(f.lastRunOutput ?? f.input ?? {}, null, 2)), C(!0);
1359
+ const C = (h) => {
1360
+ t(JSON.stringify(h.lastRunOutput ?? h.input ?? {}, null, 2)), N(!0);
1046
1361
  };
1047
- return /* @__PURE__ */ w("div", { className: "w6w-field w6w-incoming-state", children: [
1048
- /* @__PURE__ */ t("span", { children: "Incoming state" }),
1049
- o.length > 0 && /* @__PURE__ */ t("div", { className: "w6w-seed-picker", children: /* @__PURE__ */ t("div", { className: "w6w-seed-chips", children: o.map((f) => /* @__PURE__ */ w(
1362
+ return /* @__PURE__ */ m("div", { className: "w6w-field w6w-incoming-state", children: [
1363
+ /* @__PURE__ */ o("span", { children: "Incoming state" }),
1364
+ s.length > 0 && /* @__PURE__ */ o("div", { className: "w6w-seed-picker", children: /* @__PURE__ */ o("div", { className: "w6w-seed-chips", children: s.map((h) => /* @__PURE__ */ m(
1050
1365
  "button",
1051
1366
  {
1052
1367
  type: "button",
1053
1368
  className: "w6w-chip w6w-seed-chip",
1054
- title: `Use ${f.label}'s saved test as the incoming state`,
1369
+ title: `Use ${h.label}'s saved test as the incoming state`,
1055
1370
  disabled: r,
1056
- onClick: () => N(f.test),
1371
+ onClick: () => C(h.test),
1057
1372
  children: [
1058
- /* @__PURE__ */ t("code", { children: f.label }),
1059
- f.test.lastRunStatus ? /* @__PURE__ */ w("span", { className: "w6w-muted w6w-small", children: [
1373
+ /* @__PURE__ */ o("code", { children: h.label }),
1374
+ h.test.lastRunStatus ? /* @__PURE__ */ m("span", { className: "w6w-muted w6w-small", children: [
1060
1375
  " · ",
1061
- f.test.lastRunStatus
1376
+ h.test.lastRunStatus
1062
1377
  ] }) : null
1063
1378
  ]
1064
1379
  },
1065
- f.stepId
1380
+ h.stepId
1066
1381
  )) }) }),
1067
- /* @__PURE__ */ w(
1382
+ /* @__PURE__ */ m(
1068
1383
  "details",
1069
1384
  {
1070
1385
  className: "w6w-state-override",
1071
- open: y,
1072
- onToggle: (f) => C(f.currentTarget.open),
1386
+ open: b,
1387
+ onToggle: (h) => N(h.currentTarget.open),
1073
1388
  children: [
1074
- /* @__PURE__ */ w("summary", { children: [
1389
+ /* @__PURE__ */ m("summary", { children: [
1075
1390
  "Override the incoming state",
1076
- l > 0 ? ` · ${l} key${l === 1 ? "" : "s"} set` : ""
1391
+ c > 0 ? ` · ${c} key${c === 1 ? "" : "s"} set` : ""
1077
1392
  ] }),
1078
- /* @__PURE__ */ t(
1393
+ /* @__PURE__ */ o(
1079
1394
  "textarea",
1080
1395
  {
1081
1396
  rows: 3,
@@ -1083,12 +1398,12 @@ function Yt({
1083
1398
  readOnly: r,
1084
1399
  spellCheck: !1,
1085
1400
  "aria-label": "Incoming state override (JSON)",
1086
- onChange: (f) => n(f.target.value)
1401
+ onChange: (h) => t(h.target.value)
1087
1402
  }
1088
1403
  ),
1089
- /* @__PURE__ */ w("span", { className: "w6w-hint", children: [
1404
+ /* @__PURE__ */ m("span", { className: "w6w-hint", children: [
1090
1405
  "JSON merged into the call (e.g. a script's ",
1091
- /* @__PURE__ */ t("code", { children: "input" }),
1406
+ /* @__PURE__ */ o("code", { children: "input" }),
1092
1407
  "). Reach for this to test against a state the flow cannot currently produce — a field no upstream step returns yet, or a case you can't reproduce by running the flow."
1093
1408
  ] })
1094
1409
  ]
@@ -1096,91 +1411,91 @@ function Yt({
1096
1411
  )
1097
1412
  ] });
1098
1413
  }
1099
- function Es({
1414
+ function yo({
1100
1415
  workflowId: e,
1101
- step: n,
1102
- upstreamSteps: o,
1416
+ step: t,
1417
+ upstreamSteps: s,
1103
1418
  onRun: r,
1104
- onCancel: c
1419
+ onCancel: a
1105
1420
  }) {
1106
- const l = Me(), u = Ce(n.uses.app), y = Pe(n.uses.app), C = M(
1421
+ const c = Qe(), u = Ie(t.uses.app), b = Je(t.uses.app), N = O(
1107
1422
  () => {
1108
- var x;
1109
- return u ? Rt((x = n.with) == null ? void 0 : x.fields) : [];
1423
+ var $;
1424
+ return u ? Ut(($ = t.with) == null ? void 0 : $.fields) : [];
1110
1425
  },
1111
- [u, n.with]
1112
- ), N = M(() => u ? qn(C) : y ? Ht(n.uses.app, n.uses.action) : null, [u, y, C, n.uses.app, n.uses.action]), [f, a] = S(null), g = N ?? f;
1113
- _(() => {
1114
- if (N) return;
1115
- if (!n.uses.app || !n.uses.action) {
1116
- a([]);
1426
+ [u, t.with]
1427
+ ), C = O(() => u ? Rs(N) : b ? wn(t.uses.app, t.uses.action) : null, [u, b, N, t.uses.app, t.uses.action]), [h, k] = S(null), l = C ?? h;
1428
+ z(() => {
1429
+ if (C) return;
1430
+ if (!t.uses.app || !t.uses.action) {
1431
+ k([]);
1117
1432
  return;
1118
1433
  }
1119
- let x = !1;
1120
- return a(null), l.getAppActions(n.uses.app).then((z) => {
1121
- var $;
1122
- x || a((($ = z.find((te) => te.key === n.uses.action)) == null ? void 0 : $.params) ?? []);
1123
- }).catch(() => !x && a([])), () => {
1124
- x = !0;
1434
+ let $ = !1;
1435
+ return k(null), c.getAppActions(t.uses.app).then((ee) => {
1436
+ var P;
1437
+ $ || k(((P = ee.find((te) => te.key === t.uses.action)) == null ? void 0 : P.params) ?? []);
1438
+ }).catch(() => !$ && k([])), () => {
1439
+ $ = !0;
1125
1440
  };
1126
- }, [l, N, n.uses.app, n.uses.action]);
1127
- const [E, P] = S(
1441
+ }, [c, C, t.uses.app, t.uses.action]);
1442
+ const [x, D] = S(
1128
1443
  () => {
1129
- var x;
1130
- return u ? Kn(Rt((x = n.with) == null ? void 0 : x.fields)) : {};
1444
+ var $;
1445
+ return u ? Ts(Ut(($ = t.with) == null ? void 0 : $.fields)) : {};
1131
1446
  }
1132
- ), [R, V] = S("{}"), d = Bt(e, o, !u), I = jt(d), [ce, ne] = S(!1);
1133
- _(() => {
1134
- let x = !1;
1135
- return l.listStepTests(e, n.id).then((z) => {
1136
- if (x) return;
1137
- const $ = z.length ? z[z.length - 1] : null;
1138
- u ? $ != null && $.with && P((te) => ({ ...te, ...$.with })) : $ != null && $.input && Object.keys($.input).length > 0 && V(JSON.stringify($.input, null, 2)), ne(!0);
1447
+ ), [T, _] = S("{}"), A = mn(e, s, !u), w = gn(A), [L, Se] = S(!1);
1448
+ z(() => {
1449
+ let $ = !1;
1450
+ return c.listStepTests(e, t.id).then((ee) => {
1451
+ if ($) return;
1452
+ const P = ee.length ? ee[ee.length - 1] : null;
1453
+ u ? P != null && P.with && D((te) => ({ ...te, ...P.with })) : P != null && P.input && Object.keys(P.input).length > 0 && _(JSON.stringify(P.input, null, 2)), Se(!0);
1139
1454
  }).catch(() => {
1140
- x || ne(!0);
1455
+ $ || Se(!0);
1141
1456
  }), () => {
1142
- x = !0;
1457
+ $ = !0;
1143
1458
  };
1144
- }, [l, e, n.id, u]);
1145
- const [W, b] = S(!0), A = st(R), de = u ? W : A !== null, K = u ? E : { ...n.with ?? {}, ...A ?? {} }, G = !!g && ce && de && Ut(g, K);
1459
+ }, [c, e, t.id, u]);
1460
+ const [le, B] = S(!0), y = mt(T), V = u ? le : y !== null, xe = u ? x : { ...t.with ?? {}, ...y ?? {} }, K = !!l && L && V && bn(l, xe);
1146
1461
  return (
1147
1462
  // `.w6w-stepconfig` frame + body + pinned footer (D-3): this component is a
1148
1463
  // direct <Modal> child, so the frame's `height:100%` resolves against the
1149
1464
  // dialog and only the form scrolls. The `.w6w-stack` keeps its own spacing.
1150
- /* @__PURE__ */ w("div", { className: "w6w-stepconfig", children: [
1151
- /* @__PURE__ */ t("div", { className: "w6w-modal-body", children: /* @__PURE__ */ t("div", { className: "w6w-stack", children: g === null || !ce ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: g === null ? "Loading parameters…" : "Loading saved values…" }) : u ? /* @__PURE__ */ w(B, { children: [
1152
- /* @__PURE__ */ t(
1153
- Gn,
1465
+ /* @__PURE__ */ m("div", { className: "w6w-stepconfig", children: [
1466
+ /* @__PURE__ */ o("div", { className: "w6w-modal-body", children: /* @__PURE__ */ o("div", { className: "w6w-stack", children: l === null || !L ? /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: l === null ? "Loading parameters…" : "Loading saved values…" }) : u ? /* @__PURE__ */ m(U, { children: [
1467
+ /* @__PURE__ */ o(
1468
+ As,
1154
1469
  {
1155
- params: g,
1156
- values: E,
1157
- onChange: P,
1158
- onValidityChange: b
1470
+ params: l,
1471
+ values: x,
1472
+ onChange: D,
1473
+ onValidityChange: B
1159
1474
  }
1160
1475
  ),
1161
- g.length === 0 && /* @__PURE__ */ w("span", { className: "w6w-hint", children: [
1476
+ l.length === 0 && /* @__PURE__ */ m("span", { className: "w6w-hint", children: [
1162
1477
  "This trigger declares no fields — provide a sample payload to run with. It becomes the trigger's output state (",
1163
- /* @__PURE__ */ t("code", { children: "input" }),
1478
+ /* @__PURE__ */ o("code", { children: "input" }),
1164
1479
  ")."
1165
1480
  ] })
1166
- ] }) : /* @__PURE__ */ w(B, { children: [
1167
- /* @__PURE__ */ w("p", { className: "w6w-muted w6w-small", children: [
1481
+ ] }) : /* @__PURE__ */ m(U, { children: [
1482
+ /* @__PURE__ */ m("p", { className: "w6w-muted w6w-small", children: [
1168
1483
  "Runs ",
1169
- /* @__PURE__ */ t("code", { children: n.uses.action }),
1170
- " with the configuration saved on this step — only the incoming state changes per run. Edit the step to change how it is configured."
1484
+ /* @__PURE__ */ o("code", { children: t.uses.action }),
1485
+ " with the configuration saved on this node — only the incoming state changes per run. Edit the node to change how it is configured."
1171
1486
  ] }),
1172
- /* @__PURE__ */ t(Yt, { text: R, onChange: V, seeds: d })
1487
+ /* @__PURE__ */ o(xn, { text: T, onChange: _, seeds: A })
1173
1488
  ] }) }) }),
1174
- /* @__PURE__ */ w("div", { className: "w6w-modal-actions", children: [
1175
- /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: c, children: "Cancel" }),
1176
- !G && g !== null && ce && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: de ? u ? "Fill the required fields to test." : "This step is missing required configuration — set it on the Configure tab." : u ? "The payload must be a JSON object to run." : "The incoming state must be a JSON object to run." }),
1177
- /* @__PURE__ */ t(
1489
+ /* @__PURE__ */ m("div", { className: "w6w-modal-actions", children: [
1490
+ /* @__PURE__ */ o("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "Cancel" }),
1491
+ !K && l !== null && L && /* @__PURE__ */ o("span", { className: "w6w-muted w6w-small", children: V ? u ? "Fill the required fields to test." : "This step is missing required configuration — set it on the Configure tab." : u ? "The payload must be a JSON object to run." : "The incoming state must be a JSON object to run." }),
1492
+ /* @__PURE__ */ o(
1178
1493
  "button",
1179
1494
  {
1180
1495
  type: "button",
1181
1496
  className: "w6w-btn",
1182
- disabled: !G,
1183
- onClick: () => r(u ? E : A ?? {}, u ? void 0 : I),
1497
+ disabled: !K,
1498
+ onClick: () => r(u ? x : y ?? {}, u ? void 0 : w),
1184
1499
  children: "▶ Run"
1185
1500
  }
1186
1501
  )
@@ -1188,101 +1503,110 @@ function Es({
1188
1503
  ] })
1189
1504
  );
1190
1505
  }
1191
- function Se({
1506
+ function De({
1192
1507
  type: e,
1193
- position: n,
1194
- multiple: o,
1508
+ position: t,
1509
+ multiple: s,
1195
1510
  id: r,
1196
- variant: c
1511
+ variant: a
1197
1512
  }) {
1198
- return /* @__PURE__ */ t(
1199
- mn,
1513
+ const c = Gn(), u = he(wt), b = !!c && !!u && !u.readOnly;
1514
+ return /* @__PURE__ */ o(
1515
+ Yn,
1200
1516
  {
1201
1517
  type: e,
1202
- position: n,
1518
+ position: t,
1203
1519
  id: r,
1204
- className: c === "error" ? "w6w-handle-error" : o ? "w6w-handle-multi" : void 0,
1205
- style: o ? { height: 22, borderRadius: 3, width: 8 } : void 0,
1206
- title: c === "error" ? "On error — drag to route this step's failure separately" : o ? e === "target" ? "Accepts multiple incoming connections" : "Multiple outgoing connections" : void 0
1520
+ className: a === "error" ? "w6w-handle-error" : s ? "w6w-handle-multi" : void 0,
1521
+ style: s ? { height: 22, borderRadius: 3, width: 8 } : void 0,
1522
+ onClick: b ? () => {
1523
+ b && c && u.onAddFromPort(c, e, r);
1524
+ } : void 0,
1525
+ title: b ? `Drag to empty canvas (or click) to add ${a === "error" ? "a step that handles this step's failure" : e === "target" ? "a step before this one" : "the next step"} · drag to a port to connect` : a === "error" ? "On error — drag to route this step's failure separately" : s ? e === "target" ? "Accepts multiple incoming connections" : "Multiple outgoing connections" : void 0
1207
1526
  }
1208
1527
  );
1209
1528
  }
1210
- function Qt({ id: e, runnable: n }) {
1211
- const o = ge(Xt);
1212
- return !o || o.readOnly ? null : /* @__PURE__ */ w(wn, { position: we.Top, className: "w6w-node-toolbar", children: [
1213
- n && /* @__PURE__ */ t(
1529
+ function kn({ id: e, runnable: t }) {
1530
+ const s = he(wt);
1531
+ return !s || s.readOnly ? null : /* @__PURE__ */ m(Xn, { position: Ne.Top, className: "w6w-node-toolbar", children: [
1532
+ t && /* @__PURE__ */ o(
1214
1533
  "button",
1215
1534
  {
1216
1535
  type: "button",
1217
1536
  className: "w6w-node-toolbar-btn",
1218
- title: "Test-run this step",
1219
- "aria-label": "Test-run this step",
1220
- onClick: () => o.onRun(e),
1221
- children: /* @__PURE__ */ t(ye, { name: "run", size: 15 })
1537
+ title: "Test-run this node",
1538
+ "aria-label": "Test-run this node",
1539
+ onClick: () => s.onRun(e),
1540
+ children: /* @__PURE__ */ o(ve, { name: "run", size: 15 })
1222
1541
  }
1223
1542
  ),
1224
- /* @__PURE__ */ t(
1543
+ /* @__PURE__ */ o(
1225
1544
  "button",
1226
1545
  {
1227
1546
  type: "button",
1228
1547
  className: "w6w-node-toolbar-btn",
1229
1548
  title: "Edit",
1230
- "aria-label": "Edit step",
1231
- onClick: () => o.onEdit(e),
1232
- children: /* @__PURE__ */ t(ye, { name: "edit", size: 15 })
1549
+ "aria-label": "Edit node",
1550
+ onClick: () => s.onEdit(e),
1551
+ children: /* @__PURE__ */ o(ve, { name: "edit", size: 15 })
1233
1552
  }
1234
1553
  ),
1235
- /* @__PURE__ */ t(
1554
+ /* @__PURE__ */ o(
1236
1555
  "button",
1237
1556
  {
1238
1557
  type: "button",
1239
1558
  className: "w6w-node-toolbar-btn",
1240
1559
  title: "Duplicate",
1241
- "aria-label": "Duplicate step",
1242
- onClick: () => o.onDuplicate(e),
1243
- children: /* @__PURE__ */ t(ye, { name: "copy", size: 15 })
1560
+ "aria-label": "Duplicate node",
1561
+ onClick: () => s.onDuplicate(e),
1562
+ children: /* @__PURE__ */ o(ve, { name: "copy", size: 15 })
1244
1563
  }
1245
1564
  ),
1246
- /* @__PURE__ */ t(
1565
+ /* @__PURE__ */ o(
1247
1566
  "button",
1248
1567
  {
1249
1568
  type: "button",
1250
1569
  className: "w6w-node-toolbar-btn danger",
1251
1570
  title: "Delete",
1252
- "aria-label": "Delete step",
1253
- onClick: () => o.onDelete(e),
1254
- children: /* @__PURE__ */ t(ye, { name: "trash", size: 15 })
1571
+ "aria-label": "Delete node",
1572
+ onClick: () => s.onDelete(e),
1573
+ children: /* @__PURE__ */ o(ve, { name: "trash", size: 15 })
1255
1574
  }
1256
1575
  )
1257
1576
  ] });
1258
1577
  }
1259
- function Zt({ step: e, count: n }) {
1260
- if (n < 2) return null;
1261
- const o = e.fanOut === "parallel", r = gs(n, o ? "parallel" : "sequential");
1262
- return /* @__PURE__ */ w("div", { className: "w6w-fanout-badge", role: "img", "aria-label": r, title: r, children: [
1263
- /* @__PURE__ */ t("span", { "aria-hidden": "true", children: o ? "⇉" : "→" }),
1578
+ function En({ step: e, count: t }) {
1579
+ if (t < 2) return null;
1580
+ const s = e.fanOut === "parallel", r = co(t, s ? "parallel" : "sequential");
1581
+ return /* @__PURE__ */ m("div", { className: "w6w-fanout-badge", role: "img", "aria-label": r, title: r, children: [
1582
+ /* @__PURE__ */ o("span", { "aria-hidden": "true", children: s ? "⇉" : "→" }),
1264
1583
  " ",
1265
- n
1584
+ t
1266
1585
  ] });
1267
1586
  }
1268
- function xs({ id: e, data: n, selected: o }) {
1269
- const r = n.step, l = ge(nt).get(r.uses.app), u = (l == null ? void 0 : l.displayName) || r.uses.app || "—", y = le(r, ge(et)), C = Gt(n.stepStatus ?? "no-run", n.runStatus), N = /* @__PURE__ */ t(Zt, { step: r, count: ge(tt).get(e) ?? 0 });
1270
- return /* @__PURE__ */ w("div", { children: [
1271
- /* @__PURE__ */ t(Qt, { id: e, runnable: !0 }),
1272
- /* @__PURE__ */ w(
1587
+ function vo({ id: e, data: t, selected: s }) {
1588
+ var h;
1589
+ const r = t.step, c = he(ht).get(r.uses.app), u = (c == null ? void 0 : c.displayName) || r.uses.app || "—", b = we(r, he(pt)), N = Sn(t.stepStatus ?? "no-run", t.runStatus), C = /* @__PURE__ */ o(En, { step: r, count: he(ft).get(e) ?? 0 });
1590
+ return /* @__PURE__ */ m("div", { children: [
1591
+ /* @__PURE__ */ o(kn, { id: e, runnable: !0 }),
1592
+ /* @__PURE__ */ m(
1273
1593
  "div",
1274
1594
  {
1275
- "data-run-status": n.stepStatus ?? "no-run",
1595
+ "data-run-status": t.stepStatus ?? "no-run",
1596
+ "data-step-problem": (h = t.stepProblem) == null ? void 0 : h.code,
1597
+ title: t.stepProblem ? st(t.stepProblem) : void 0,
1276
1598
  style: {
1277
1599
  // `relative` so the Handles center on the CARD, not the whole node
1278
1600
  // (which also spans the meta line below) — keeps ports vertically centered.
1279
1601
  position: "relative",
1602
+ // Missing-connection ring; the border stays the run-status visual.
1603
+ ...t.stepProblem ? { boxShadow: "0 0 0 2px var(--w6w-danger)" } : {},
1280
1604
  // Selection always wins the BORDER COLOUR (unchanged from before
1281
1605
  // T1.1.1 — the ternary this extends); width/style/opacity keep
1282
1606
  // reflecting the run status underneath so a selected running/failed
1283
1607
  // step is still distinguishable from a selected idle one.
1284
- border: `${C.borderWidth}px ${C.borderStyle} ${o ? "var(--w6w-accent)" : C.borderColor}`,
1285
- opacity: o ? 1 : C.opacity,
1608
+ border: `${N.borderWidth}px ${N.borderStyle} ${s ? "var(--w6w-accent)" : N.borderColor}`,
1609
+ opacity: s ? 1 : N.opacity,
1286
1610
  background: "var(--w6w-panel)",
1287
1611
  color: "var(--w6w-text)",
1288
1612
  borderRadius: 4,
@@ -1294,30 +1618,53 @@ function xs({ id: e, data: n, selected: o }) {
1294
1618
  gap: 10
1295
1619
  },
1296
1620
  children: [
1297
- y.in > 0 && /* @__PURE__ */ t(Se, { type: "target", position: we.Left, multiple: y.in > 1 }),
1298
- /* @__PURE__ */ t(
1299
- Ye,
1621
+ t.stepProblem && /* @__PURE__ */ o(
1622
+ "span",
1623
+ {
1624
+ "data-step-problem-badge": "",
1625
+ role: "img",
1626
+ "aria-label": st(t.stepProblem),
1627
+ title: st(t.stepProblem),
1628
+ style: {
1629
+ position: "absolute",
1630
+ top: -9,
1631
+ right: -9,
1632
+ width: 18,
1633
+ height: 18,
1634
+ borderRadius: "50%",
1635
+ display: "flex",
1636
+ alignItems: "center",
1637
+ justifyContent: "center",
1638
+ background: "var(--w6w-danger)",
1639
+ color: "#fff"
1640
+ },
1641
+ children: /* @__PURE__ */ o(ve, { name: "warning", size: 12 })
1642
+ }
1643
+ ),
1644
+ b.in > 0 && /* @__PURE__ */ o(De, { type: "target", position: Ne.Left, multiple: b.in > 1 }),
1645
+ /* @__PURE__ */ o(
1646
+ lt,
1300
1647
  {
1301
- src: l == null ? void 0 : l.iconSvg,
1302
- srcDark: l == null ? void 0 : l.iconSvgDark,
1303
- brandColor: l == null ? void 0 : l.brandColor,
1648
+ src: c == null ? void 0 : c.iconSvg,
1649
+ srcDark: c == null ? void 0 : c.iconSvgDark,
1650
+ brandColor: c == null ? void 0 : c.brandColor,
1304
1651
  name: u,
1305
1652
  size: 28
1306
1653
  }
1307
1654
  ),
1308
- /* @__PURE__ */ w("div", { style: { minWidth: 0 }, children: [
1309
- /* @__PURE__ */ t("div", { style: { fontWeight: 600 }, children: u }),
1310
- /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", style: { marginTop: 2 }, children: /* @__PURE__ */ t("code", { children: r.uses.action || "—" }) })
1655
+ /* @__PURE__ */ m("div", { style: { minWidth: 0 }, children: [
1656
+ /* @__PURE__ */ o("div", { style: { fontWeight: 600 }, children: u }),
1657
+ /* @__PURE__ */ o("div", { className: "w6w-muted w6w-small", style: { marginTop: 2 }, children: /* @__PURE__ */ o("code", { children: r.uses.action || "—" }) })
1311
1658
  ] }),
1312
- y.out > 0 && /* @__PURE__ */ w(B, { children: [
1313
- /* @__PURE__ */ t(Se, { type: "source", position: we.Right, multiple: y.out > 1 }),
1314
- /* @__PURE__ */ t(
1315
- Se,
1659
+ b.out > 0 && /* @__PURE__ */ m(U, { children: [
1660
+ /* @__PURE__ */ o(De, { type: "source", position: Ne.Right, multiple: b.out > 1 }),
1661
+ /* @__PURE__ */ o(
1662
+ De,
1316
1663
  {
1317
1664
  type: "source",
1318
- position: we.Bottom,
1665
+ position: Ne.Bottom,
1319
1666
  multiple: !1,
1320
- id: _t,
1667
+ id: hn,
1321
1668
  variant: "error"
1322
1669
  }
1323
1670
  )
@@ -1325,39 +1672,42 @@ function xs({ id: e, data: n, selected: o }) {
1325
1672
  ]
1326
1673
  }
1327
1674
  ),
1328
- N,
1329
- /* @__PURE__ */ w(
1675
+ C,
1676
+ /* @__PURE__ */ m(
1330
1677
  "div",
1331
1678
  {
1332
1679
  className: "w6w-muted",
1333
1680
  style: { marginTop: 3, fontSize: 10, opacity: 0.75, paddingLeft: 2 },
1334
1681
  children: [
1335
1682
  r.id,
1336
- l != null && l.version ? ` - v${l.version}` : ""
1683
+ c != null && c.version ? ` - v${c.version}` : ""
1337
1684
  ]
1338
1685
  }
1339
1686
  ),
1340
- r.notes && /* @__PURE__ */ t("div", { className: "w6w-muted w6w-node-notes", title: r.notes, children: r.notes })
1687
+ r.notes && /* @__PURE__ */ o("div", { className: "w6w-muted w6w-node-notes", title: r.notes, children: r.notes })
1341
1688
  ] });
1342
1689
  }
1343
- function Rs({ id: e, data: n, selected: o }) {
1344
- const r = n.step, c = $t(r.uses.app, r.uses.action), l = Jt(r.uses.app, r.uses.action), u = le(r, ge(et)), y = Ce(r.uses.app), C = Gt(n.stepStatus ?? "no-run", n.runStatus), N = /* @__PURE__ */ t(Zt, { step: r, count: ge(tt).get(e) ?? 0 });
1345
- return /* @__PURE__ */ w("div", { children: [
1346
- /* @__PURE__ */ t(Qt, { id: e, runnable: !Ae(r.uses.app) }),
1347
- /* @__PURE__ */ w(
1690
+ function No({ id: e, data: t, selected: s }) {
1691
+ const r = t.step, a = dn(r.uses.app, r.uses.action), c = pn(r.uses.app, r.uses.action), u = we(r, he(pt)), b = Ie(r.uses.app), N = Sn(t.stepStatus ?? "no-run", t.runStatus), C = /* @__PURE__ */ o(En, { step: r, count: he(ft).get(e) ?? 0 });
1692
+ return /* @__PURE__ */ m("div", { children: [
1693
+ /* @__PURE__ */ o(kn, { id: e, runnable: !Be(r.uses.app) }),
1694
+ /* @__PURE__ */ m(
1348
1695
  "div",
1349
1696
  {
1350
- "data-run-status": n.stepStatus ?? "no-run",
1697
+ className: b ? "w6w-node-trigger" : void 0,
1698
+ "data-node-kind": b ? "trigger" : void 0,
1699
+ "data-run-status": t.stepStatus ?? "no-run",
1351
1700
  style: {
1352
1701
  // `relative` so the Handles center on the CARD, not the whole node
1353
1702
  // (which also spans the meta line below) — keeps ports vertically centered.
1354
1703
  position: "relative",
1355
- border: `${C.borderWidth}px ${C.borderStyle} ${o ? "var(--w6w-accent)" : C.borderColor}`,
1356
- opacity: o ? 1 : C.opacity,
1704
+ border: `${N.borderWidth}px ${N.borderStyle} ${s ? "var(--w6w-accent)" : N.borderColor}`,
1705
+ opacity: s ? 1 : N.opacity,
1357
1706
  background: "var(--w6w-panel-2)",
1358
1707
  color: "var(--w6w-text)",
1359
- borderRadius: 4,
1360
- padding: "6px 14px 6px 8px",
1708
+ // A trigger's half-pill radius + padding live in `.w6w-node-trigger`
1709
+ // (styles/_flow.scss): an inline value here would beat the class.
1710
+ ...b ? {} : { borderRadius: 4, padding: "6px 14px 6px 8px" },
1361
1711
  minWidth: 140,
1362
1712
  fontSize: 13,
1363
1713
  display: "flex",
@@ -1365,21 +1715,21 @@ function Rs({ id: e, data: n, selected: o }) {
1365
1715
  gap: 10
1366
1716
  },
1367
1717
  children: [
1368
- u.in > 0 && /* @__PURE__ */ t(Se, { type: "target", position: we.Left, multiple: u.in > 1 }),
1369
- l && /* @__PURE__ */ t(Mt, { icon: l }),
1370
- /* @__PURE__ */ w("div", { style: { minWidth: 0, textAlign: "left" }, children: [
1371
- /* @__PURE__ */ t("div", { style: { fontWeight: 600 }, children: c }),
1372
- /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", style: { marginTop: 2 }, children: /* @__PURE__ */ t("code", { children: r.uses.action || "—" }) })
1718
+ u.in > 0 && /* @__PURE__ */ o(De, { type: "target", position: Ne.Left, multiple: u.in > 1 }),
1719
+ c && /* @__PURE__ */ o(fn, { icon: c }),
1720
+ /* @__PURE__ */ m("div", { style: { minWidth: 0, textAlign: "left" }, children: [
1721
+ /* @__PURE__ */ o("div", { style: { fontWeight: 600 }, children: a }),
1722
+ /* @__PURE__ */ o("div", { className: "w6w-muted w6w-small", style: { marginTop: 2 }, children: /* @__PURE__ */ o("code", { children: r.uses.action || "—" }) })
1373
1723
  ] }),
1374
- u.out > 0 && /* @__PURE__ */ w(B, { children: [
1375
- /* @__PURE__ */ t(Se, { type: "source", position: we.Right, multiple: u.out > 1 }),
1376
- !y && /* @__PURE__ */ t(
1377
- Se,
1724
+ u.out > 0 && /* @__PURE__ */ m(U, { children: [
1725
+ /* @__PURE__ */ o(De, { type: "source", position: Ne.Right, multiple: u.out > 1 }),
1726
+ !b && /* @__PURE__ */ o(
1727
+ De,
1378
1728
  {
1379
1729
  type: "source",
1380
- position: we.Bottom,
1730
+ position: Ne.Bottom,
1381
1731
  multiple: !1,
1382
- id: _t,
1732
+ id: hn,
1383
1733
  variant: "error"
1384
1734
  }
1385
1735
  )
@@ -1387,8 +1737,8 @@ function Rs({ id: e, data: n, selected: o }) {
1387
1737
  ]
1388
1738
  }
1389
1739
  ),
1390
- N,
1391
- /* @__PURE__ */ t(
1740
+ C,
1741
+ /* @__PURE__ */ o(
1392
1742
  "div",
1393
1743
  {
1394
1744
  className: "w6w-muted",
@@ -1396,329 +1746,348 @@ function Rs({ id: e, data: n, selected: o }) {
1396
1746
  children: r.id
1397
1747
  }
1398
1748
  ),
1399
- r.notes && /* @__PURE__ */ t("div", { className: "w6w-muted w6w-node-notes", title: r.notes, children: r.notes })
1749
+ r.notes && /* @__PURE__ */ o("div", { className: "w6w-muted w6w-node-notes", title: r.notes, children: r.notes })
1400
1750
  ] });
1401
1751
  }
1402
- function Ts({
1752
+ function Co({
1403
1753
  workflowId: e,
1404
- step: n,
1405
- upstreamSteps: o,
1754
+ step: t,
1755
+ upstreamSteps: s,
1406
1756
  onChange: r,
1407
- onClose: c,
1408
- readOnly: l,
1757
+ onClose: a,
1758
+ readOnly: c,
1409
1759
  initialView: u = "props",
1410
- fanOutCount: y = 0,
1411
- onTestRun: C
1760
+ fanOutCount: b = 0,
1761
+ onTestRun: N,
1762
+ stepProblem: C
1412
1763
  }) {
1413
- var Ve;
1414
- const N = Me(), f = ge(nt), [a, g] = S(n), [E, P] = S(
1415
- "configure"
1416
- ), [R, V] = S(
1764
+ var Oe;
1765
+ const h = Qe(), k = he(ht), [l, x] = S(t), D = tn(l, C), [T, _] = S(
1766
+ tn(t, C) ? "setup" : "configure"
1767
+ ), [A, w] = S(
1417
1768
  u === "json" ? "code" : u === "settings" ? "config" : "props"
1418
- ), [d, I] = S("props"), [ce, ne] = S(() => kt(n)), [W, b] = S(() => Et(n)), [A, de] = S("{}"), K = me(null), [G, x] = S(!1), [z, $] = S(!1), [te, O] = S(a.id), [se, be] = S(null), [oe, re] = S(null), [ke, ue] = S(null), [Ie, H] = S(null), X = Pe(a.uses.app);
1419
- _(() => {
1769
+ ), [L, Se] = S("props"), [le, B] = S(() => Ht(t)), [y, V] = S(() => jt(t)), [xe, K] = S("{}"), $ = Ce(null), [ee, P] = S(!1), [te, ie] = S(!1), [ke, q] = S(l.id), [de, re] = S(null), [ae, W] = S(null), [me, Ee] = S(null), [Pe, H] = S(null), [ue, Re] = S(!1), X = Je(l.uses.app);
1770
+ z(() => {
1420
1771
  if (X) {
1421
- re(Ht(a.uses.app, a.uses.action)), ue(null);
1772
+ W(wn(l.uses.app, l.uses.action)), Ee(null);
1422
1773
  return;
1423
1774
  }
1424
- if (!a.uses.app) {
1425
- ue(null), re([]);
1775
+ if (!l.uses.app) {
1776
+ Ee(null), W([]);
1426
1777
  return;
1427
1778
  }
1428
- let h = !1;
1429
- return re(null), N.getAppActions(a.uses.app).then((q) => {
1430
- var Y;
1431
- h || (ue(q), re(
1432
- a.uses.action ? ((Y = q.find((he) => he.key === a.uses.action)) == null ? void 0 : Y.params) ?? [] : []
1779
+ let g = !1;
1780
+ return W(null), h.getAppActions(l.uses.app).then((Y) => {
1781
+ var se;
1782
+ g || (Ee(Y), W(
1783
+ l.uses.action ? ((se = Y.find((fe) => fe.key === l.uses.action)) == null ? void 0 : se.params) ?? [] : []
1433
1784
  ));
1434
- }).catch(() => !h && re([])), () => {
1435
- h = !0;
1785
+ }).catch(() => !g && W([])), () => {
1786
+ g = !0;
1436
1787
  };
1437
- }, [N, a.uses.app, a.uses.action, X]);
1438
- const De = J(() => {
1439
- X || !a.uses.app || N.listConnectionsForApp(a.uses.app).then((h) => H(h)).catch(() => H([]));
1440
- }, [N, a.uses.app, X]);
1441
- _(() => {
1442
- if (X || !a.uses.app) return;
1443
- let h = !1;
1444
- return N.listConnectionsForApp(a.uses.app).then((q) => !h && H(q)).catch(() => !h && H([])), () => {
1445
- h = !0;
1788
+ }, [h, l.uses.app, l.uses.action, X]);
1789
+ const Le = F(() => {
1790
+ X || !l.uses.app || h.listConnectionsForApp(l.uses.app).then((g) => {
1791
+ H(g), Re(!1);
1792
+ }).catch(() => Re(!0));
1793
+ }, [h, l.uses.app, X]);
1794
+ z(() => {
1795
+ if (X || !l.uses.app) return;
1796
+ let g = !1;
1797
+ return h.listConnectionsForApp(l.uses.app).then((Y) => {
1798
+ g || (H(Y), Re(!1));
1799
+ }).catch(() => !g && Re(!0)), () => {
1800
+ g = !0;
1446
1801
  };
1447
- }, [N, a.uses.app, X]);
1448
- const j = J(
1449
- (h) => {
1450
- g(h), r(h);
1802
+ }, [h, l.uses.app, X]);
1803
+ const G = F(
1804
+ (g) => {
1805
+ x(g), r(g);
1451
1806
  },
1452
1807
  [r]
1453
- ), _e = (h) => {
1454
- h === "code" ? ne(kt(a)) : h === "params-code" && b(Et(a)), V(h);
1455
- }, D = () => {
1456
- const h = te.trim(), q = h && h !== a.id ? Zn(h) : null;
1457
- if (q) {
1458
- be(q);
1808
+ ), Me = (g) => {
1809
+ g === "code" ? B(Ht(l)) : g === "params-code" && V(jt(l)), w(g);
1810
+ }, ge = () => {
1811
+ const g = ke.trim(), Y = g && g !== l.id ? Ms(g) : null;
1812
+ if (Y) {
1813
+ re(Y);
1459
1814
  return;
1460
1815
  }
1461
- h && h !== a.id && j({ ...a, id: h }), be(null), $(!1);
1462
- }, ie = !!a.uses.app && !!a.uses.action && !Ae(a.uses.app), ae = Ce(a.uses.app), He = E === "test" && ie && !ae, ve = Bt(e, o, ie && !ae), Le = jt(ve);
1463
- _(() => {
1464
- if (!ie || ae) return;
1465
- let h = !1;
1466
- return N.listStepTests(e, a.id).then((q) => {
1467
- if (h) return;
1468
- const Y = q.length ? q[q.length - 1] : null;
1469
- if (!(Y != null && Y.input) || Object.keys(Y.input).length === 0) return;
1470
- const he = JSON.stringify(Y.input, null, 2);
1471
- de((Te) => Te.trim() === "{}" ? he : Te);
1816
+ g && g !== l.id && G({ ...l, id: g }), re(null), ie(!1);
1817
+ }, j = !!l.uses.app && !!l.uses.action && !Be(l.uses.app), ne = Ie(l.uses.app), pe = T === "test" && j && !ne, be = mn(e, s, j && !ne), ze = gn(be);
1818
+ z(() => {
1819
+ if (!j || ne) return;
1820
+ let g = !1;
1821
+ return h.listStepTests(e, l.id).then((Y) => {
1822
+ if (g) return;
1823
+ const se = Y.length ? Y[Y.length - 1] : null;
1824
+ if (!(se != null && se.input) || Object.keys(se.input).length === 0) return;
1825
+ const fe = JSON.stringify(se.input, null, 2);
1826
+ K((ce) => ce.trim() === "{}" ? fe : ce);
1472
1827
  }).catch(() => {
1473
1828
  }), () => {
1474
- h = !0;
1829
+ g = !0;
1475
1830
  };
1476
- }, [N, e, a.id, ie, ae]);
1477
- const Ee = st(A), xe = { ...a.with ?? {}, ...Ee ?? {} }, Re = Ee ?? {}, pe = !!oe && Ut(oe, xe), F = f.get(a.uses.app), fe = X ? Jt(a.uses.app, a.uses.action) : null, Be = X ? fe ? /* @__PURE__ */ t(Mt, { icon: fe }) : null : /* @__PURE__ */ t(
1478
- Ye,
1831
+ }, [h, e, l.id, j, ne]);
1832
+ const Fe = mt(xe), M = { ...l.with ?? {}, ...Fe ?? {} }, He = Fe ?? {}, je = !!ae && bn(ae, M), J = k.get(l.uses.app), Ve = X ? pn(l.uses.app, l.uses.action) : null, $e = X ? Ve ? /* @__PURE__ */ o(fn, { icon: Ve }) : null : /* @__PURE__ */ o(
1833
+ lt,
1479
1834
  {
1480
- src: F == null ? void 0 : F.iconSvg,
1481
- srcDark: F == null ? void 0 : F.iconSvgDark,
1482
- brandColor: F == null ? void 0 : F.brandColor,
1483
- name: F == null ? void 0 : F.displayName
1835
+ src: J == null ? void 0 : J.iconSvg,
1836
+ srcDark: J == null ? void 0 : J.iconSvgDark,
1837
+ brandColor: J == null ? void 0 : J.brandColor,
1838
+ name: J == null ? void 0 : J.displayName
1484
1839
  }
1485
1840
  );
1486
- return /* @__PURE__ */ t(
1487
- Ot,
1841
+ return /* @__PURE__ */ o(
1842
+ un,
1488
1843
  {
1489
1844
  ariaLabel: "Edit step",
1490
- titleIcon: Be,
1491
- title: /* @__PURE__ */ w("span", { className: "w6w-step-rename", children: [
1492
- z && !l ? /* @__PURE__ */ t(
1845
+ titleIcon: $e,
1846
+ title: /* @__PURE__ */ m("span", { className: "w6w-step-rename", children: [
1847
+ te && !c ? /* @__PURE__ */ o(
1493
1848
  "input",
1494
1849
  {
1495
1850
  autoFocus: !0,
1496
- value: te,
1497
- onChange: (h) => {
1498
- O(h.target.value), be(null);
1851
+ value: ke,
1852
+ onChange: (g) => {
1853
+ q(g.target.value), re(null);
1499
1854
  },
1500
- onBlur: D,
1501
- onKeyDown: (h) => {
1502
- h.key === "Enter" && D(), h.key === "Escape" && (O(a.id), be(null), $(!1));
1855
+ onBlur: ge,
1856
+ onKeyDown: (g) => {
1857
+ g.key === "Enter" && ge(), g.key === "Escape" && (q(l.id), re(null), ie(!1));
1503
1858
  }
1504
1859
  }
1505
- ) : /* @__PURE__ */ w(B, { children: [
1506
- /* @__PURE__ */ t("code", { children: a.id }),
1507
- !l && /* @__PURE__ */ t(
1860
+ ) : /* @__PURE__ */ m(U, { children: [
1861
+ /* @__PURE__ */ o("code", { children: l.id }),
1862
+ !c && /* @__PURE__ */ o(
1508
1863
  "button",
1509
1864
  {
1510
1865
  type: "button",
1511
1866
  className: "w6w-icon-btn w6w-btn-sm",
1512
- title: "Rename step",
1513
- "aria-label": "Rename step",
1867
+ title: "Rename node",
1868
+ "aria-label": "Rename node",
1514
1869
  onClick: () => {
1515
- O(a.id), $(!0);
1870
+ q(l.id), ie(!0);
1516
1871
  },
1517
- children: /* @__PURE__ */ t(ye, { name: "edit", size: 15 })
1872
+ children: /* @__PURE__ */ o(ve, { name: "edit", size: 15 })
1518
1873
  }
1519
1874
  )
1520
1875
  ] }),
1521
- se && /* @__PURE__ */ t("span", { className: "w6w-hint", role: "alert", style: { color: "var(--w6w-danger)" }, children: se })
1876
+ de && /* @__PURE__ */ o("span", { className: "w6w-hint", role: "alert", style: { color: "var(--w6w-danger)" }, children: de })
1522
1877
  ] }),
1523
- onClose: c,
1878
+ onClose: a,
1524
1879
  size: "wide",
1525
- children: /* @__PURE__ */ w("div", { className: "w6w-stepconfig", children: [
1526
- /* @__PURE__ */ w("div", { className: "w6w-tabsbar", children: [
1527
- /* @__PURE__ */ t("div", { className: "w6w-subtabs", children: ["setup", "configure", "test"].map((h) => /* @__PURE__ */ t(
1880
+ children: /* @__PURE__ */ m("div", { className: "w6w-stepconfig", children: [
1881
+ /* @__PURE__ */ m("div", { className: "w6w-tabsbar", children: [
1882
+ /* @__PURE__ */ o("div", { className: "w6w-subtabs", children: ["setup", "configure", "test"].map((g) => /* @__PURE__ */ o(
1528
1883
  "button",
1529
1884
  {
1530
1885
  type: "button",
1531
- className: `w6w-subtab${E === h ? " active" : ""}`,
1532
- onClick: () => P(h),
1533
- children: h === "setup" ? "Setup" : h === "configure" ? "Configure" : "Test"
1886
+ className: `w6w-subtab${T === g ? " active" : ""}`,
1887
+ disabled: D && g !== "setup",
1888
+ onClick: () => _(g),
1889
+ children: g === "setup" ? "Setup" : g === "configure" ? "Configure" : "Test"
1534
1890
  },
1535
- h
1891
+ g
1536
1892
  )) }),
1537
- He ? /* @__PURE__ */ t(
1538
- xt,
1893
+ pe ? /* @__PURE__ */ o(
1894
+ Ot,
1539
1895
  {
1540
- view: d,
1896
+ view: L,
1541
1897
  views: ["props", "code"],
1542
- onChange: (h) => I(h)
1898
+ onChange: (g) => Se(g)
1543
1899
  }
1544
- ) : /* @__PURE__ */ t(
1545
- xt,
1900
+ ) : /* @__PURE__ */ o(
1901
+ Ot,
1546
1902
  {
1547
- view: R,
1548
- onChange: _e,
1549
- disabled: E !== "configure"
1903
+ view: A,
1904
+ onChange: Me,
1905
+ disabled: T !== "configure"
1550
1906
  }
1551
1907
  )
1552
1908
  ] }),
1553
- /* @__PURE__ */ w("div", { className: "w6w-stepconfig-body", children: [
1554
- E === "setup" && /* @__PURE__ */ t(
1555
- Ds,
1909
+ D && C && /* @__PURE__ */ m("div", { role: "alert", className: "w6w-field-error", children: [
1910
+ "Connection ",
1911
+ C.connection,
1912
+ " no longer exists — choose another to continue."
1913
+ ] }),
1914
+ /* @__PURE__ */ m("div", { className: "w6w-stepconfig-body", children: [
1915
+ T === "setup" && /* @__PURE__ */ o(
1916
+ Eo,
1556
1917
  {
1557
- step: a,
1558
- app: F,
1559
- actions: ke,
1560
- conns: Ie,
1918
+ step: l,
1919
+ app: J,
1920
+ actions: me,
1921
+ conns: Pe,
1922
+ connsFailed: ue,
1561
1923
  isInternal: X,
1562
- readOnly: l,
1563
- onChangeAction: (h) => j({ ...a, uses: { ...a.uses, action: h }, with: {} }),
1564
- onChangeConnection: (h) => j({ ...a, uses: { ...a.uses, connection: h } }),
1565
- onConnectionCreated: De,
1566
- onChangeApp: (h) => (
1924
+ readOnly: c,
1925
+ onChangeAction: (g) => G({ ...l, uses: { ...l.uses, action: g }, with: {} }),
1926
+ onChangeConnection: (g) => G({ ...l, uses: { ...l.uses, connection: g } }),
1927
+ onConnectionCreated: Le,
1928
+ onChangeApp: (g) => (
1567
1929
  // D-1: a genuinely different app clears `uses.action`/`with` and
1568
1930
  // drops the connection; reselecting the SAME app is a no-op —
1569
1931
  // still committed (so the field always collapses cleanly), but
1570
1932
  // with `step` itself, unchanged.
1571
- j(
1572
- h === a.uses.app ? a : {
1573
- ...a,
1574
- uses: { app: h, action: "", connection: void 0 },
1933
+ G(
1934
+ g === l.uses.app ? l : {
1935
+ ...l,
1936
+ uses: { app: g, action: "", connection: void 0 },
1575
1937
  with: {}
1576
1938
  }
1577
1939
  )
1578
1940
  )
1579
1941
  }
1580
1942
  ),
1581
- E === "configure" && /* @__PURE__ */ w(B, { children: [
1582
- a.uses.app === Ke && N.listSubscriptionsForWorkflow && N.createSubscription && /* @__PURE__ */ t(Is, { workflowId: e, step: a, readOnly: l }),
1583
- oe === null ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Loading parameters…" }) : R === "props" ? a.uses.action === "wait" && Ae(a.uses.app) ? /* @__PURE__ */ t(
1584
- _n,
1943
+ T === "configure" && /* @__PURE__ */ m(U, { children: [
1944
+ l.uses.app === rt && h.listSubscriptionsForWorkflow && h.createSubscription && /* @__PURE__ */ o(ko, { workflowId: e, step: l, readOnly: c }),
1945
+ ae === null ? /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Loading parameters…" }) : A === "props" ? l.uses.action === "wait" && Be(l.uses.app) ? /* @__PURE__ */ o(
1946
+ Cs,
1585
1947
  {
1586
- values: a.with ?? {},
1587
- readOnly: l,
1588
- onChange: (h) => j({ ...a, with: h })
1948
+ values: l.with ?? {},
1949
+ readOnly: c,
1950
+ onChange: (g) => G({ ...l, with: g })
1589
1951
  }
1590
- ) : /* @__PURE__ */ t(
1591
- Hn,
1952
+ ) : /* @__PURE__ */ o(
1953
+ Ss,
1592
1954
  {
1593
- params: oe,
1594
- values: a.with ?? {},
1595
- readOnly: l,
1596
- onChange: (h) => j({ ...a, with: h })
1955
+ params: ae,
1956
+ values: l.with ?? {},
1957
+ readOnly: c,
1958
+ onChange: (g) => G({ ...l, with: g }),
1959
+ dynamic: X || !l.uses.action ? void 0 : {
1960
+ appId: l.uses.app,
1961
+ actionKey: l.uses.action,
1962
+ connectionId: D ? void 0 : l.uses.connection ?? void 0,
1963
+ appName: J == null ? void 0 : J.displayName
1964
+ }
1597
1965
  }
1598
- ) : R === "code" ? (
1966
+ ) : A === "code" ? (
1599
1967
  // Full step, read-only (D-3) — `stepToJson` is the ONE serializer,
1600
1968
  // shared with the two other code-view hosts.
1601
- /* @__PURE__ */ t(
1602
- qe,
1969
+ /* @__PURE__ */ o(
1970
+ it,
1603
1971
  {
1604
- value: ce,
1972
+ value: le,
1605
1973
  onChange: () => {
1606
1974
  },
1607
1975
  readOnly: !0,
1608
1976
  minHeight: "260px",
1609
1977
  height: "100%",
1610
- "aria-label": `Step ${a.id} JSON`,
1978
+ "aria-label": `Node ${l.id} JSON`,
1611
1979
  copyable: !0
1612
1980
  }
1613
1981
  )
1614
- ) : R === "params-code" ? /* @__PURE__ */ t(
1615
- qe,
1982
+ ) : A === "params-code" ? /* @__PURE__ */ o(
1983
+ it,
1616
1984
  {
1617
- value: W,
1618
- onChange: b,
1619
- readOnly: l,
1985
+ value: y,
1986
+ onChange: V,
1987
+ readOnly: c,
1620
1988
  minHeight: "260px",
1621
1989
  height: "100%",
1622
- "aria-label": `Step ${a.id} params JSON`,
1990
+ "aria-label": `Node ${l.id} params JSON`,
1623
1991
  copyable: !0,
1624
- onValidChange: (h) => h && typeof h == "object" && !Array.isArray(h) && j({ ...a, with: h })
1992
+ onValidChange: (g) => g && typeof g == "object" && !Array.isArray(g) && G({ ...l, with: g })
1625
1993
  }
1626
- ) : /* @__PURE__ */ w("div", { className: "w6w-stack", children: [
1627
- /* @__PURE__ */ t(
1628
- Bn,
1994
+ ) : /* @__PURE__ */ m("div", { className: "w6w-stack", children: [
1995
+ /* @__PURE__ */ o(
1996
+ xs,
1629
1997
  {
1630
- config: { retry: a.retry, onError: a.onError, notes: a.notes },
1631
- onChange: (h) => j({ ...a, ...h }),
1632
- readOnly: l,
1633
- failureHandling: !ae,
1634
- retryControls: !Ae(a.uses.app) && a.uses.app !== jn
1998
+ config: { retry: l.retry, onError: l.onError, notes: l.notes },
1999
+ onChange: (g) => G({ ...l, ...g }),
2000
+ readOnly: c,
2001
+ failureHandling: !ne,
2002
+ retryControls: !Be(l.uses.app) && l.uses.app !== ks
1635
2003
  }
1636
2004
  ),
1637
- As,
1638
- /* @__PURE__ */ t(
1639
- Ps,
2005
+ So,
2006
+ /* @__PURE__ */ o(
2007
+ xo,
1640
2008
  {
1641
- step: a,
1642
- count: y,
1643
- readOnly: l,
1644
- onChange: j
2009
+ step: l,
2010
+ count: b,
2011
+ readOnly: c,
2012
+ onChange: G
1645
2013
  }
1646
2014
  )
1647
2015
  ] })
1648
2016
  ] }),
1649
- E === "test" && /* @__PURE__ */ t("div", { className: "w6w-stack", children: ie ? ae ? /* @__PURE__ */ t(
1650
- Un,
2017
+ T === "test" && /* @__PURE__ */ o("div", { className: "w6w-stack", children: j ? ne ? /* @__PURE__ */ o(
2018
+ Es,
1651
2019
  {
1652
- app: a.uses.app,
1653
- action: a.uses.action,
1654
- fields: (Ve = a.with) == null ? void 0 : Ve.fields,
1655
- persist: { workflowId: e, stepId: a.id, input: Re }
2020
+ app: l.uses.app,
2021
+ action: l.uses.action,
2022
+ fields: (Oe = l.with) == null ? void 0 : Oe.fields,
2023
+ persist: { workflowId: e, stepId: l.id, input: He }
1656
2024
  }
1657
- ) : /* @__PURE__ */ w(B, { children: [
1658
- /* @__PURE__ */ w("p", { className: "w6w-muted w6w-small", children: [
2025
+ ) : /* @__PURE__ */ m(U, { children: [
2026
+ /* @__PURE__ */ m("p", { className: "w6w-muted w6w-small", children: [
1659
2027
  "Tests ",
1660
- /* @__PURE__ */ t("code", { children: a.uses.action }),
2028
+ /* @__PURE__ */ o("code", { children: l.uses.action }),
1661
2029
  " with the configuration saved on this step — only the incoming state changes per run."
1662
2030
  ] }),
1663
- /* @__PURE__ */ t(
1664
- Yt,
2031
+ /* @__PURE__ */ o(
2032
+ xn,
1665
2033
  {
1666
- text: A,
1667
- onChange: de,
1668
- seeds: ve,
1669
- readOnly: l
2034
+ text: xe,
2035
+ onChange: K,
2036
+ seeds: be,
2037
+ readOnly: c
1670
2038
  }
1671
2039
  ),
1672
- oe === null ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Loading parameters…" }) : /* @__PURE__ */ t(
1673
- ns,
2040
+ ae === null ? /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Loading parameters…" }) : /* @__PURE__ */ o(
2041
+ qs,
1674
2042
  {
1675
- params: oe,
1676
- values: xe,
1677
- testStartState: Le,
1678
- view: d
2043
+ params: ae,
2044
+ values: M,
2045
+ testStartState: ze,
2046
+ view: L
1679
2047
  }
1680
2048
  ),
1681
- /* @__PURE__ */ t(
1682
- zn,
2049
+ /* @__PURE__ */ o(
2050
+ Ps,
1683
2051
  {
1684
- ref: K,
1685
- app: a.uses.app,
1686
- action: a.uses.action,
1687
- connectionId: a.uses.connection ?? void 0,
1688
- values: xe,
1689
- state: Le,
1690
- canRun: pe,
2052
+ ref: $,
2053
+ app: l.uses.app,
2054
+ action: l.uses.action,
2055
+ connectionId: l.uses.connection ?? void 0,
2056
+ values: M,
2057
+ state: ze,
2058
+ canRun: je,
1691
2059
  hideRunButton: !0,
1692
- persist: { workflowId: e, stepId: a.id, input: Re },
1693
- onBusyChange: x
2060
+ persist: { workflowId: e, stepId: l.id, input: He },
2061
+ onBusyChange: P
1694
2062
  }
1695
2063
  )
1696
- ] }) : /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Flow-control nodes can't be tested on their own." }) })
2064
+ ] }) : /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Flow-control nodes can't be tested on their own." }) })
1697
2065
  ] }),
1698
- /* @__PURE__ */ t("div", { className: "w6w-modal-actions w6w-stepconfig-footer", children: E !== "test" ? /* @__PURE__ */ t(
2066
+ /* @__PURE__ */ o("div", { className: "w6w-modal-actions w6w-stepconfig-footer", children: T !== "test" ? /* @__PURE__ */ o(
1699
2067
  "button",
1700
2068
  {
1701
2069
  type: "button",
1702
2070
  className: "w6w-btn",
1703
- onClick: () => P(E === "setup" ? "configure" : "test"),
2071
+ disabled: D,
2072
+ onClick: () => _(T === "setup" ? "configure" : "test"),
1704
2073
  children: "Next →"
1705
2074
  }
1706
- ) : /* @__PURE__ */ w(B, { children: [
1707
- /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: c, children: "Done" }),
1708
- ie && !ae && // Runs the step and persists the outcome (records a run + saves
2075
+ ) : /* @__PURE__ */ m(U, { children: [
2076
+ /* @__PURE__ */ o("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "Done" }),
2077
+ j && !ne && // Runs the step and persists the outcome (records a run + saves
1709
2078
  // the fixture) via the body's <StepTestRun>, so a step test is
1710
2079
  // saved and re-runnable. `readOnly` viewers can't write tests.
1711
- /* @__PURE__ */ t(
2080
+ /* @__PURE__ */ o(
1712
2081
  "button",
1713
2082
  {
1714
2083
  type: "button",
1715
2084
  className: "w6w-btn",
1716
- disabled: l || !pe || G,
2085
+ disabled: c || !je || ee,
1717
2086
  onClick: () => {
1718
- var h;
1719
- C == null || C(), (h = K.current) == null || h.run();
2087
+ var g;
2088
+ N == null || N(), (g = $.current) == null || g.run();
1720
2089
  },
1721
- children: G ? "Testing…" : "Test"
2090
+ children: ee ? "Testing…" : "Test"
1722
2091
  }
1723
2092
  )
1724
2093
  ] }) })
@@ -1726,223 +2095,223 @@ function Ts({
1726
2095
  }
1727
2096
  );
1728
2097
  }
1729
- const As = !1;
1730
- function Ps({
2098
+ const So = !1;
2099
+ function xo({
1731
2100
  step: e,
1732
- count: n,
1733
- readOnly: o,
2101
+ count: t,
2102
+ readOnly: s,
1734
2103
  onChange: r
1735
2104
  }) {
1736
- const c = n >= 2, l = e.fanOut === "parallel" ? "parallel" : "sequential";
1737
- return /* @__PURE__ */ w("label", { className: "w6w-field", children: [
1738
- /* @__PURE__ */ t("span", { children: "Run next steps" }),
1739
- /* @__PURE__ */ w(
2105
+ const a = t >= 2, c = e.fanOut === "parallel" ? "parallel" : "sequential";
2106
+ return /* @__PURE__ */ m("label", { className: "w6w-field", children: [
2107
+ /* @__PURE__ */ o("span", { children: "Run next nodes" }),
2108
+ /* @__PURE__ */ m(
1740
2109
  "select",
1741
2110
  {
1742
- "aria-label": "Run next steps",
1743
- value: l,
1744
- disabled: o || !c,
1745
- onChange: (u) => r(ms(e, u.target.value)),
2111
+ "aria-label": "Run next nodes",
2112
+ value: c,
2113
+ disabled: s || !a,
2114
+ onChange: (u) => r(ao(e, u.target.value)),
1746
2115
  children: [
1747
- /* @__PURE__ */ t("option", { value: "sequential", children: "In sequence" }),
1748
- /* @__PURE__ */ t("option", { value: "parallel", children: "In parallel" })
2116
+ /* @__PURE__ */ o("option", { value: "sequential", children: "In sequence" }),
2117
+ /* @__PURE__ */ o("option", { value: "parallel", children: "In parallel" })
1749
2118
  ]
1750
2119
  }
1751
2120
  ),
1752
- !c && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "Connect two or more steps after this one to choose how they run." })
2121
+ !a && /* @__PURE__ */ o("span", { className: "w6w-muted w6w-small", children: "Connect two or more steps after this one to choose how they run." })
1753
2122
  ] });
1754
2123
  }
1755
- function Is({
2124
+ function ko({
1756
2125
  workflowId: e,
1757
- step: n,
1758
- readOnly: o
2126
+ step: t,
2127
+ readOnly: s
1759
2128
  }) {
1760
- const r = Me(), [c, l] = S(void 0), [u, y] = S(null), [C, N] = S(!1);
1761
- _(() => {
1762
- const a = r.listSubscriptionsForWorkflow;
1763
- if (!a) return;
1764
- let g = !1;
1765
- return a(e).then((E) => {
1766
- g || l(E.find((P) => P.appId === Ke) ?? null);
1767
- }).catch((E) => !g && y(E.message)), () => {
1768
- g = !0;
2129
+ const r = Qe(), [a, c] = S(void 0), [u, b] = S(null), [N, C] = S(!1);
2130
+ z(() => {
2131
+ const k = r.listSubscriptionsForWorkflow;
2132
+ if (!k) return;
2133
+ let l = !1;
2134
+ return k(e).then((x) => {
2135
+ l || c(x.find((D) => D.appId === rt) ?? null);
2136
+ }).catch((x) => !l && b(x.message)), () => {
2137
+ l = !0;
1769
2138
  };
1770
2139
  }, [r, e]);
1771
- const f = () => {
1772
- const a = r.createSubscription;
1773
- a && (y(null), N(!0), a(Ke, n.uses.action, {
2140
+ const h = () => {
2141
+ const k = r.createSubscription;
2142
+ k && (b(null), C(!0), k(rt, t.uses.action, {
1774
2143
  workflowId: e,
1775
2144
  connectionId: null,
1776
- params: n.with ?? {}
1777
- }).then((g) => {
1778
- N(!1), l(g);
1779
- }).catch((g) => {
1780
- N(!1), y(g instanceof Error ? g.message : String(g));
2145
+ params: t.with ?? {}
2146
+ }).then((l) => {
2147
+ C(!1), c(l);
2148
+ }).catch((l) => {
2149
+ C(!1), b(l instanceof Error ? l.message : String(l));
1781
2150
  }));
1782
2151
  };
1783
- return /* @__PURE__ */ w("div", { className: "w6w-stack", children: [
1784
- /* @__PURE__ */ w("p", { className: "w6w-muted w6w-small", children: [
1785
- /* @__PURE__ */ t("strong", { children: "Webhook URL" }),
2152
+ return /* @__PURE__ */ m("div", { className: "w6w-stack", children: [
2153
+ /* @__PURE__ */ m("p", { className: "w6w-muted w6w-small", children: [
2154
+ /* @__PURE__ */ o("strong", { children: "Webhook URL" }),
1786
2155
  " — the address a third party posts to."
1787
2156
  ] }),
1788
- u && /* @__PURE__ */ t("div", { className: "w6w-result w6w-error", children: u }),
1789
- c != null && c.webhookUrl ? /* @__PURE__ */ t(es, { value: c.webhookUrl, readOnly: !0, children: /* @__PURE__ */ t("input", { type: "text", readOnly: !0, value: c.webhookUrl, "aria-label": "Webhook URL" }) }) : c === void 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Loading…" }) : !o && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", disabled: C, onClick: f, children: C ? "Creating…" : "Create webhook URL" })
2157
+ u && /* @__PURE__ */ o("div", { className: "w6w-result w6w-error", children: u }),
2158
+ a != null && a.webhookUrl ? /* @__PURE__ */ o(Fs, { value: a.webhookUrl, readOnly: !0, children: /* @__PURE__ */ o("input", { type: "text", readOnly: !0, value: a.webhookUrl, "aria-label": "Webhook URL" }) }) : a === void 0 ? /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Loading…" }) : !s && /* @__PURE__ */ o("button", { type: "button", className: "w6w-btn", disabled: N, onClick: h, children: N ? "Creating…" : "Create webhook URL" })
1790
2159
  ] });
1791
2160
  }
1792
- function Lt({
2161
+ function rn({
1793
2162
  anchorRef: e,
1794
- onClose: n,
1795
- children: o
2163
+ onClose: t,
2164
+ children: s
1796
2165
  }) {
1797
- const r = me(null), [c, l] = S(null), [u, y] = S(null);
1798
- return _(() => {
1799
- const C = e.current;
1800
- if (!C) return;
1801
- const N = C.getBoundingClientRect();
1802
- l({ top: N.bottom + 6, left: N.left, width: N.width }), y(C.closest("dialog") ?? document.body);
1803
- }, [e]), _(() => {
1804
- function C(f) {
1805
- var g, E;
1806
- const a = f.target;
1807
- (g = r.current) != null && g.contains(a) || (E = e.current) != null && E.contains(a) || n();
2166
+ const r = Ce(null), [a, c] = S(null), [u, b] = S(null);
2167
+ return z(() => {
2168
+ const N = e.current;
2169
+ if (!N) return;
2170
+ const C = N.getBoundingClientRect();
2171
+ c({ top: C.bottom + 6, left: C.left, width: C.width }), b(N.closest("dialog") ?? document.body);
2172
+ }, [e]), z(() => {
2173
+ function N(h) {
2174
+ var l, x;
2175
+ const k = h.target;
2176
+ (l = r.current) != null && l.contains(k) || (x = e.current) != null && x.contains(k) || t();
1808
2177
  }
1809
- function N(f) {
1810
- f.key === "Escape" && n();
2178
+ function C(h) {
2179
+ h.key === "Escape" && t();
1811
2180
  }
1812
- return document.addEventListener("mousedown", C), document.addEventListener("keydown", N), () => {
1813
- document.removeEventListener("mousedown", C), document.removeEventListener("keydown", N);
2181
+ return document.addEventListener("mousedown", N), document.addEventListener("keydown", C), () => {
2182
+ document.removeEventListener("mousedown", N), document.removeEventListener("keydown", C);
1814
2183
  };
1815
- }, [n, e]), !c || !u ? null : gn(
1816
- /* @__PURE__ */ t(
2184
+ }, [t, e]), !a || !u ? null : Qn(
2185
+ /* @__PURE__ */ o(
1817
2186
  "div",
1818
2187
  {
1819
2188
  ref: r,
1820
2189
  className: "w6w-flyout",
1821
- style: { top: c.top, left: c.left, width: c.width },
1822
- children: o
2190
+ style: { top: a.top, left: a.left, width: a.width },
2191
+ children: s
1823
2192
  }
1824
2193
  ),
1825
2194
  u
1826
2195
  );
1827
2196
  }
1828
- function Ds({
2197
+ function Eo({
1829
2198
  step: e,
1830
- app: n,
1831
- actions: o,
2199
+ app: t,
2200
+ actions: s,
1832
2201
  conns: r,
2202
+ connsFailed: a,
1833
2203
  isInternal: c,
1834
- readOnly: l,
1835
- onChangeAction: u,
1836
- onChangeConnection: y,
2204
+ readOnly: u,
2205
+ onChangeAction: b,
2206
+ onChangeConnection: N,
1837
2207
  onChangeApp: C,
1838
- onConnectionCreated: N
2208
+ onConnectionCreated: h
1839
2209
  }) {
1840
- var V;
1841
- const [f, a] = S(null), [g, E] = S(!1), P = me(null), R = e.uses.connection ? ((V = (r ?? []).find((d) => d.id === e.uses.connection)) == null ? void 0 : V.displayName) ?? e.uses.connection : "No connection";
1842
- return /* @__PURE__ */ w("div", { className: "w6w-stack", children: [
1843
- /* @__PURE__ */ w("div", { className: "w6w-field", children: [
1844
- /* @__PURE__ */ t("span", { children: "App" }),
1845
- /* @__PURE__ */ w("div", { className: "w6w-app-conn-row", ref: P, children: [
1846
- /* @__PURE__ */ w(
2210
+ const [k, l] = S(null), [x, D] = S(!1), T = Ce(null), _ = ho(e.uses.connection, r, a);
2211
+ return /* @__PURE__ */ m("div", { className: "w6w-stack", children: [
2212
+ /* @__PURE__ */ m("div", { className: "w6w-field", children: [
2213
+ /* @__PURE__ */ o("span", { children: "App" }),
2214
+ /* @__PURE__ */ m("div", { className: "w6w-app-conn-row", ref: T, children: [
2215
+ /* @__PURE__ */ m(
1847
2216
  "button",
1848
2217
  {
1849
2218
  type: "button",
1850
2219
  className: "w6w-app-conn-btn",
1851
2220
  "aria-label": "App",
1852
- "aria-expanded": f === "app",
1853
- disabled: l,
1854
- onClick: () => a((d) => d === "app" ? null : "app"),
2221
+ "aria-expanded": k === "app",
2222
+ disabled: u,
2223
+ onClick: () => l((A) => A === "app" ? null : "app"),
1855
2224
  children: [
1856
- !c && n && /* @__PURE__ */ t(
1857
- Ye,
2225
+ !c && t && /* @__PURE__ */ o(
2226
+ lt,
1858
2227
  {
1859
- src: n.iconSvg,
1860
- srcDark: n.iconSvgDark,
1861
- brandColor: n.brandColor,
1862
- name: n.displayName,
2228
+ src: t.iconSvg,
2229
+ srcDark: t.iconSvgDark,
2230
+ brandColor: t.brandColor,
2231
+ name: t.displayName,
1863
2232
  size: 20
1864
2233
  }
1865
2234
  ),
1866
- /* @__PURE__ */ t("span", { className: "w6w-conn-label-name", children: c ? e.uses.app : (n == null ? void 0 : n.displayName) ?? e.uses.app })
2235
+ /* @__PURE__ */ o("span", { className: "w6w-conn-label-name", children: c ? e.uses.app : (t == null ? void 0 : t.displayName) ?? e.uses.app })
1867
2236
  ]
1868
2237
  }
1869
2238
  ),
1870
- !c && /* @__PURE__ */ t(
2239
+ !c && /* @__PURE__ */ o(
1871
2240
  "button",
1872
2241
  {
1873
2242
  type: "button",
1874
2243
  className: "w6w-app-conn-btn",
1875
2244
  "aria-label": "Connection",
1876
- "aria-expanded": f === "conn",
1877
- disabled: l,
1878
- onClick: () => a((d) => d === "conn" ? null : "conn"),
1879
- children: /* @__PURE__ */ t("span", { className: "w6w-conn-label-name", children: R })
2245
+ "aria-expanded": k === "conn",
2246
+ disabled: u,
2247
+ onClick: () => l((A) => A === "conn" ? null : "conn"),
2248
+ children: /* @__PURE__ */ o("span", { className: "w6w-conn-label-name", children: _ })
1880
2249
  }
1881
2250
  )
1882
2251
  ] }),
1883
- f === "app" && /* @__PURE__ */ t(Lt, { anchorRef: P, onClose: () => a(null), children: /* @__PURE__ */ t(
1884
- Xn,
2252
+ k === "app" && /* @__PURE__ */ o(rn, { anchorRef: T, onClose: () => l(null), children: /* @__PURE__ */ o(
2253
+ Is,
1885
2254
  {
1886
- onSelectApp: (d) => {
1887
- const I = d.id === e.uses.app;
1888
- C(d.id), a(I ? "conn" : null);
2255
+ onSelectApp: (A) => {
2256
+ const w = A.id === e.uses.app;
2257
+ C(A.id), l(w ? "conn" : null);
1889
2258
  }
1890
2259
  }
1891
2260
  ) }),
1892
- f === "conn" && /* @__PURE__ */ t(Lt, { anchorRef: P, onClose: () => a(null), children: /* @__PURE__ */ w("div", { className: "w6w-stack", children: [
1893
- /* @__PURE__ */ t("div", { className: "w6w-stepbuilder-list", children: (r ?? []).map((d) => /* @__PURE__ */ t(
2261
+ k === "conn" && /* @__PURE__ */ o(rn, { anchorRef: T, onClose: () => l(null), children: /* @__PURE__ */ m("div", { className: "w6w-stack", children: [
2262
+ /* @__PURE__ */ o("div", { className: "w6w-stepbuilder-list", children: (r ?? []).map((A) => /* @__PURE__ */ o(
1894
2263
  "button",
1895
2264
  {
1896
2265
  type: "button",
1897
2266
  className: "w6w-stepbuilder-item",
1898
2267
  onClick: () => {
1899
- y(d.id), a(null);
2268
+ N(A.id), l(null);
1900
2269
  },
1901
- children: /* @__PURE__ */ w("span", { className: "w6w-stepbuilder-item-main", children: [
1902
- /* @__PURE__ */ t("strong", { children: d.displayName || d.id }),
1903
- d.state && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: d.state })
2270
+ children: /* @__PURE__ */ m("span", { className: "w6w-stepbuilder-item-main", children: [
2271
+ /* @__PURE__ */ o("strong", { children: A.displayName || A.id }),
2272
+ A.state && /* @__PURE__ */ o("span", { className: "w6w-muted w6w-small", children: A.state })
1904
2273
  ] })
1905
2274
  },
1906
- d.id
2275
+ A.id
1907
2276
  )) }),
1908
- /* @__PURE__ */ t(
2277
+ /* @__PURE__ */ o(
1909
2278
  "button",
1910
2279
  {
1911
2280
  type: "button",
1912
2281
  className: "w6w-btn",
1913
- disabled: l,
2282
+ disabled: u,
1914
2283
  onClick: () => {
1915
- E(!0), a(null);
2284
+ D(!0), l(null);
1916
2285
  },
1917
2286
  children: "+ New connection"
1918
2287
  }
1919
2288
  )
1920
2289
  ] }) })
1921
2290
  ] }),
1922
- !c && g && /* @__PURE__ */ t(
1923
- Yn,
2291
+ !c && x && /* @__PURE__ */ o(
2292
+ Ds,
1924
2293
  {
1925
2294
  initialAppId: e.uses.app,
1926
- onClose: () => E(!1),
1927
- onCreated: ({ connectionId: d }) => {
1928
- E(!1), y(d), N(), a(null);
2295
+ onClose: () => D(!1),
2296
+ onCreated: ({ connectionId: A }) => {
2297
+ D(!1), N(A), h(), l(null);
1929
2298
  }
1930
2299
  }
1931
2300
  ),
1932
- c ? /* @__PURE__ */ w("div", { className: "w6w-field", children: [
1933
- /* @__PURE__ */ t("span", { children: "Action" }),
1934
- /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: /* @__PURE__ */ t("code", { children: e.uses.action }) })
2301
+ c ? /* @__PURE__ */ m("div", { className: "w6w-field", children: [
2302
+ /* @__PURE__ */ o("span", { children: "Action" }),
2303
+ /* @__PURE__ */ o("div", { className: "w6w-muted w6w-small", children: /* @__PURE__ */ o("code", { children: e.uses.action }) })
1935
2304
  ] }) : (
1936
2305
  // biome-ignore lint/a11y/noLabelWithoutControl: Combobox renders its own <select>/<input> INSIDE this label, so the field text labels the control at runtime; the rule cannot see through the component boundary.
1937
- /* @__PURE__ */ w("label", { className: "w6w-field", children: [
1938
- /* @__PURE__ */ t("span", { children: "Action" }),
1939
- /* @__PURE__ */ t(
1940
- Qn,
2306
+ /* @__PURE__ */ m("label", { className: "w6w-field", children: [
2307
+ /* @__PURE__ */ o("span", { children: "Action" }),
2308
+ /* @__PURE__ */ o(
2309
+ Ls,
1941
2310
  {
1942
2311
  value: e.uses.action,
1943
- disabled: l || o === null,
1944
- onChange: u,
1945
- options: o === null ? [{ value: e.uses.action, label: e.uses.action }] : o.map((d) => ({ value: d.key, label: d.title ?? d.key }))
2312
+ disabled: u || s === null,
2313
+ onChange: b,
2314
+ options: s === null ? [{ value: e.uses.action, label: e.uses.action }] : s.map((A) => ({ value: A.key, label: A.title ?? A.key }))
1946
2315
  }
1947
2316
  )
1948
2317
  ] })
@@ -1950,29 +2319,41 @@ function Ds({
1950
2319
  ] });
1951
2320
  }
1952
2321
  export {
1953
- jn as CALL_APP,
1954
- Hs as CONTROL_APP,
1955
- Bs as DATA_APP,
1956
- Wn as ExpressionOptionsProvider,
1957
- js as INTERNAL_NODES,
1958
- Us as SCHEDULER_APP,
1959
- zs as SCRIPT_APP,
1960
- qs as TRIGGER_APP,
1961
- Ke as WEBHOOK_APP,
1962
- Js as WorkflowFlowEditor,
1963
- Rt as asFieldDefs,
1964
- Ks as coerceDefault,
1965
- Gs as fieldWidget,
1966
- qn as fieldsToParams,
1967
- Nt as flowToWorkflow,
1968
- Xs as internalNodeDefaults,
1969
- Jt as internalNodeIcon,
1970
- $t as internalNodeLabel,
1971
- Ht as internalNodeParams,
1972
- Ae as isControlApp,
1973
- Pe as isInternalApp,
1974
- Ce as isTriggerApp,
1975
- Kn as seedValues,
1976
- En as workflowToFlow
2322
+ ks as CALL_APP,
2323
+ Vo as CONTROL_APP,
2324
+ bs as CanvasLayer,
2325
+ $o as DATA_APP,
2326
+ gs as ExpressionOptionsProvider,
2327
+ _o as INTERNAL_NODES,
2328
+ Vs as MAX_NOTES,
2329
+ _s as MAX_NOTE_BYTES,
2330
+ $s as MAX_SECTIONS,
2331
+ Wo as Markdown,
2332
+ Bo as SCHEDULER_APP,
2333
+ Jo as SCRIPT_APP,
2334
+ zo as TRIGGER_APP,
2335
+ rt as WEBHOOK_APP,
2336
+ Lo as WorkflowFlowEditor,
2337
+ Ut as asFieldDefs,
2338
+ Gt as assignMembership,
2339
+ Yt as clampCanvas,
2340
+ Ho as coerceDefault,
2341
+ jo as fieldWidget,
2342
+ Rs as fieldsToParams,
2343
+ $t as flowToWorkflow,
2344
+ Oo as internalNodeDefaults,
2345
+ pn as internalNodeIcon,
2346
+ dn as internalNodeLabel,
2347
+ wn as internalNodeParams,
2348
+ Be as isControlApp,
2349
+ Je as isInternalApp,
2350
+ Ie as isTriggerApp,
2351
+ Xt as pruneSectionMembers,
2352
+ zs as renameSectionMember,
2353
+ qt as roundGeometry,
2354
+ Hs as sectionsContaining,
2355
+ Ts as seedValues,
2356
+ Js as withCanvasGeometry,
2357
+ rs as workflowToFlow
1977
2358
  };
1978
2359
  //# sourceMappingURL=flow.mjs.map