@burdenoff/microfe-headshotmarketing 2026.704.6 → 2026.707.1

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 (25) hide show
  1. package/dist/generated/wspace-operations.js +286 -262
  2. package/dist/generated/wspace-operations.js.map +1 -1
  3. package/dist/generated/wspace-types.js +2 -4
  4. package/dist/generated/wspace-types.js.map +1 -1
  5. package/dist/headshotmarketing/components/AssetUploadButton.js.map +1 -1
  6. package/dist/headshotmarketing/hooks/useAssetUpload.js +11 -19
  7. package/dist/headshotmarketing/hooks/useAssetUpload.js.map +1 -1
  8. package/dist/headshotmarketing/pages/HomeFunnel.js.map +1 -1
  9. package/dist/headshotmarketing/pages/HomePage.js +293 -278
  10. package/dist/headshotmarketing/pages/HomePage.js.map +1 -1
  11. package/dist/headshotmarketing/pages/automation/AutomationPage.js +27 -30
  12. package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
  13. package/dist/headshotmarketing/pages/automation/WorkflowActions.js +149 -159
  14. package/dist/headshotmarketing/pages/automation/WorkflowActions.js.map +1 -1
  15. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +252 -231
  16. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
  17. package/dist/headshotmarketing/pages/content/AssetLibraryPage.js +3 -2
  18. package/dist/headshotmarketing/pages/content/AssetLibraryPage.js.map +1 -1
  19. package/dist/headshotmarketing/pages/events/EventImageUpload.js.map +1 -1
  20. package/dist/headshotmarketing/pages/social-media/MediaDropZone.js.map +1 -1
  21. package/dist/headshotmarketing/utils/automationMapper.js +33 -7
  22. package/dist/headshotmarketing/utils/automationMapper.js.map +1 -1
  23. package/dist/headshotmarketing/utils/contentMapper.js +1 -1
  24. package/dist/headshotmarketing/utils/contentMapper.js.map +1 -1
  25. package/package.json +1 -1
@@ -2,23 +2,22 @@ import { HeadshotmarketingBootstrapDataDocument as e, useCreateHeadshotmarketing
2
2
  import "../../context/HeadshotmarketingBootstrapContext.js";
3
3
  import { useHeadshotMarketing as r } from "../../context/HeadshotMarketingContext.js";
4
4
  import { cn as i, formatDate as a } from "../../utils/helpers.js";
5
- import { HeadshotmarketingWorkflowStatus as o, HeadshotmarketingWorkflowTriggerType as s } from "../../../generated/wspace-types.js";
6
- import { PageLayout as ee } from "../../components/PageLayout.js";
7
- import { ToastContainer as te } from "../../components/Toast.js";
5
+ import { PageLayout as o } from "../../components/PageLayout.js";
6
+ import { ToastContainer as s } from "../../components/Toast.js";
8
7
  import "../../components/index.js";
9
- import { ACTION_TYPES as ne, CHIP_TONE as c, TRIGGER_TYPES as re, actionMeta as l, inPort as u, isConditionNode as ie, outPort as d, serializeGraph as ae, triggerLabel as f } from "./workflowBuilderModel.js";
10
- import { WorkflowCanvasNode as oe } from "./WorkflowCanvasNode.js";
11
- import { WorkflowConfigEmpty as se, WorkflowNodeConfigPanel as ce } from "./WorkflowNodeConfigPanel.js";
12
- import { useCallback as p, useEffect as le, useMemo as m, useRef as h, useState as g } from "react";
13
- import { ArrowLeft as ue, FlaskConical as de, Maximize2 as fe, Minus as pe, Move as me, Play as he, Plus as _, Save as ge, Zap as _e } from "lucide-react";
14
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
- import { PagePurpose as ve } from "@burdenoff/fe-libs/ui";
8
+ import { ACTION_TYPES as c, CHIP_TONE as l, TRIGGER_TYPES as ee, actionMeta as u, inPort as d, isConditionNode as te, outPort as f, serializeGraph as ne, triggerLabel as p } from "./workflowBuilderModel.js";
9
+ import { WorkflowCanvasNode as re } from "./WorkflowCanvasNode.js";
10
+ import { WorkflowConfigEmpty as ie, WorkflowNodeConfigPanel as ae } from "./WorkflowNodeConfigPanel.js";
11
+ import { useCallback as m, useEffect as oe, useMemo as h, useRef as g, useState as _ } from "react";
12
+ import { ArrowLeft as se, FlaskConical as ce, Maximize2 as le, Minus as ue, Move as de, Play as fe, Plus as v, Save as pe, Zap as me } from "lucide-react";
13
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
14
+ import { PagePurpose as he } from "@burdenoff/fe-libs/ui";
16
15
  //#region src/headshotmarketing/pages/automation/WorkflowBuilderPage.tsx
17
- var ye = 1600, be = 1200, b = .5, x = 1.4, S = .82, C = {
16
+ var ge = 1600, _e = 1200, x = .5, S = 1.4, C = .82, w = {
18
17
  x: 12,
19
18
  y: 12
20
19
  };
21
- function w() {
20
+ function T() {
22
21
  return {
23
22
  nodes: [
24
23
  {
@@ -116,7 +115,7 @@ function w() {
116
115
  ]
117
116
  };
118
117
  }
119
- function xe(e) {
118
+ function ve(e) {
120
119
  switch (e) {
121
120
  case "send_email": return { emailTemplate: "Welcome Email" };
122
121
  case "wait": return {
@@ -127,9 +126,9 @@ function xe(e) {
127
126
  default: return {};
128
127
  }
129
128
  }
130
- function Se(e) {
129
+ function ye(e) {
131
130
  let t = e.config;
132
- if (e.kind === "trigger") return f(e.actionType);
131
+ if (e.kind === "trigger") return p(e.actionType);
133
132
  if (t.description) return t.description;
134
133
  switch (e.actionType) {
135
134
  case "send_email": return t.emailTemplate ? `Template: ${t.emailTemplate}` : "Send an email";
@@ -140,53 +139,53 @@ function Se(e) {
140
139
  case "webhook": return t.webhookUrl ? t.webhookUrl : "Call a webhook";
141
140
  case "add_tag": return t.tag ? `Tag: ${t.tag}` : "Add a tag";
142
141
  case "update_score": return t.points == null ? "Update lead score" : `${t.points} points`;
143
- default: return l(e.actionType)?.label ?? "";
142
+ default: return u(e.actionType)?.label ?? "";
144
143
  }
145
144
  }
146
- function T(e) {
145
+ function E(e) {
147
146
  return e === "yes" ? "var(--color-status-success-text)" : e === "no" ? "var(--color-status-error-text)" : "var(--color-action-primary-bg)";
148
147
  }
149
- function Ce(e) {
148
+ function be(e) {
150
149
  return e === "yes" ? "wf-arrow-yes" : e === "no" ? "wf-arrow-no" : "wf-arrow-accent";
151
150
  }
152
- function E(e) {
151
+ function D(e) {
153
152
  let t = e.toUpperCase();
154
153
  return t === "COMPLETED" ? "success" : t === "FAILED" || t === "TIMED_OUT" || t === "CANCELLED" ? "error" : t === "RUNNING" ? "info" : "warning";
155
154
  }
156
- var D = () => {
157
- let { navigate: f, basePath: D } = r(), [O, { loading: k }] = t(), [we] = n(), [A, Te] = g("New Workflow"), [j, M] = g(() => w().nodes), [N, P] = g(() => w().edges), [F, I] = g("node-email-1"), [L, R] = g(null), [Ee, De] = g(null), [z, Oe] = g(null), [B, V] = g(!1), [ke, H] = g([]), [U, W] = g(S), [G, Ae] = g(C), K = h(null), je = h(null), q = m(() => {
155
+ var O = () => {
156
+ let { navigate: p, basePath: O } = r(), [k, { loading: A }] = t(), [xe] = n(), [j, Se] = _("New Workflow"), [M, N] = _(() => T().nodes), [P, F] = _(() => T().edges), [I, L] = _("node-email-1"), [R, z] = _(null), [Ce, we] = _(null), [B, Te] = _(null), [V, H] = _(!1), [Ee, U] = _([]), [W, G] = _(C), [K, De] = _(w), q = g(null), Oe = g(null), J = h(() => {
158
157
  let e = /* @__PURE__ */ new Map();
159
- for (let t of j) e.set(t.id, t);
158
+ for (let t of M) e.set(t.id, t);
160
159
  return e;
161
- }, [j]), J = F ? q.get(F) ?? null : null, Me = m(() => j.find((e) => e.kind === "trigger") ?? null, [j]), Y = Me?.actionType ?? "form_submit", X = p((e) => {
162
- H((t) => t.filter((t) => t.id !== e));
163
- }, []), Z = p((e) => {
160
+ }, [M]), Y = I ? J.get(I) ?? null : null, ke = h(() => M.find((e) => e.kind === "trigger") ?? null, [M]), X = ke?.actionType ?? "form_submit", Z = m((e) => {
161
+ U((t) => t.filter((t) => t.id !== e));
162
+ }, []), Q = m((e) => {
164
163
  let t = `toast-${Date.now()}-${Math.round(performance.now())}`;
165
- H((n) => [...n, {
164
+ U((n) => [...n, {
166
165
  ...e,
167
166
  id: t
168
- }]), window.setTimeout(() => X(t), 5e3);
169
- }, [X]), Ne = p((e, t, n) => {
170
- M((r) => r.map((r) => r.id === e ? {
167
+ }]), window.setTimeout(() => Z(t), 5e3);
168
+ }, [Z]), Ae = m((e, t, n) => {
169
+ N((r) => r.map((r) => r.id === e ? {
171
170
  ...r,
172
171
  x: t,
173
172
  y: n
174
173
  } : r));
175
- }, []), Pe = p((e, t) => {
176
- M((n) => n.map((n) => n.id === e ? {
174
+ }, []), je = m((e, t) => {
175
+ N((n) => n.map((n) => n.id === e ? {
177
176
  ...n,
178
177
  label: t
179
178
  } : n));
180
- }, []), Fe = p((e, t) => {
181
- M((n) => n.map((n) => n.id === e ? {
179
+ }, []), Me = m((e, t) => {
180
+ N((n) => n.map((n) => n.id === e ? {
182
181
  ...n,
183
182
  config: {
184
183
  ...n.config,
185
184
  ...t
186
185
  }
187
186
  } : n));
188
- }, []), Ie = p((e) => {
189
- M((t) => t.map((t) => t.kind === "trigger" ? {
187
+ }, []), Ne = m((e) => {
188
+ N((t) => t.map((t) => t.kind === "trigger" ? {
190
189
  ...t,
191
190
  actionType: e,
192
191
  config: {
@@ -194,266 +193,288 @@ var D = () => {
194
193
  source: e
195
194
  }
196
195
  } : t));
197
- }, []), Le = p((e) => {
198
- let t = q.get(e);
199
- !t || t.kind === "trigger" || (M((t) => t.filter((t) => t.id !== e)), P((t) => t.filter((t) => t.source !== e && t.target !== e)), I((t) => t === e ? null : t));
200
- }, [q]), Re = p((e) => {
201
- let t = l(e);
196
+ }, []), Pe = m((e) => {
197
+ let t = J.get(e);
198
+ !t || t.kind === "trigger" || (N((t) => t.filter((t) => t.id !== e)), F((t) => t.filter((t) => t.source !== e && t.target !== e)), L((t) => t === e ? null : t));
199
+ }, [J]), Fe = m((e) => {
200
+ let t = u(e);
202
201
  if (!t) return;
203
- let n = J ?? j[j.length - 1] ?? null, r = null, i = 0;
204
- if (n && ie(n)) {
205
- let e = N.filter((e) => e.source === n.id), t = e.some((e) => e.branch === "yes"), a = e.some((e) => e.branch === "no");
202
+ let n = Y ?? M[M.length - 1] ?? null, r = null, i = 0;
203
+ if (n && te(n)) {
204
+ let e = P.filter((e) => e.source === n.id), t = e.some((e) => e.branch === "yes"), a = e.some((e) => e.branch === "no");
206
205
  t ? a || (r = "no", i = 164) : (r = "yes", i = -164);
207
206
  }
208
- let a = `node-${Date.now()}`, o = n ? n.x : 200, s = n ? n.y + 78 + 72 : 24, ee = {
207
+ let a = `node-${Date.now()}`, o = n ? n.x : 200, s = n ? n.y + 78 + 72 : 24, c = {
209
208
  id: a,
210
209
  kind: "action",
211
210
  actionType: e,
212
211
  label: t.label,
213
212
  x: o + i,
214
213
  y: s,
215
- config: xe(e)
214
+ config: ve(e)
216
215
  };
217
- M((e) => [...e, ee]), n && P((e) => [...e, {
216
+ N((e) => [...e, c]), n && F((e) => [...e, {
218
217
  id: `edge-${Date.now()}`,
219
218
  source: n.id,
220
219
  target: a,
221
220
  branch: r
222
- }]), I(a);
221
+ }]), L(a);
223
222
  }, [
224
- J,
225
- j,
226
- N
223
+ Y,
224
+ M,
225
+ P
227
226
  ]);
228
- le(() => {
229
- F && typeof window < "u" && window.innerWidth < 1280 && je.current?.scrollIntoView({
227
+ oe(() => {
228
+ I && typeof window < "u" && window.innerWidth < 1280 && Oe.current?.scrollIntoView({
230
229
  behavior: "smooth",
231
230
  block: "nearest"
232
231
  });
233
- }, [F]);
234
- let Q = (e) => W((t) => Math.min(x, Math.max(b, Math.round((t + e) * 100) / 100))), ze = () => {
235
- W(S), Ae(C);
236
- }, Be = (e) => {
237
- K.current = {
232
+ }, [I]);
233
+ let Ie = (e) => G((t) => Math.min(S, Math.max(x, Math.round((t + e) * 100) / 100))), Le = () => {
234
+ G(C), De(w);
235
+ }, Re = (e) => {
236
+ q.current = {
238
237
  startX: e.clientX,
239
238
  startY: e.clientY,
240
- originX: G.x,
241
- originY: G.y,
239
+ originX: K.x,
240
+ originY: K.y,
242
241
  moved: !1
243
242
  }, e.currentTarget.setPointerCapture(e.pointerId);
244
- }, Ve = (e) => {
245
- let t = K.current;
243
+ }, ze = (e) => {
244
+ let t = q.current;
246
245
  if (!t) return;
247
246
  let n = e.clientX - t.startX, r = e.clientY - t.startY;
248
- !t.moved && Math.hypot(n, r) < 3 || (t.moved = !0, Ae({
247
+ !t.moved && Math.hypot(n, r) < 3 || (t.moved = !0, De({
249
248
  x: t.originX + n,
250
249
  y: t.originY + r
251
250
  }));
252
- }, He = (e) => {
253
- let t = K.current;
254
- K.current = null, e.currentTarget.releasePointerCapture?.(e.pointerId), t && !t.moved && I(null);
255
- }, Ue = () => A.trim() ? j.length === 0 ? (R("Add at least one workflow step."), !1) : (R(null), !0) : (R("Workflow name is required."), !1), We = (e) => {
251
+ }, Be = (e) => {
252
+ let t = q.current;
253
+ q.current = null, e.currentTarget.releasePointerCapture?.(e.pointerId), t && !t.moved && L(null);
254
+ }, Ve = () => j.trim() ? M.length === 0 ? (z("Add at least one workflow step."), !1) : (z(null), !0) : (z("Workflow name is required."), !1), He = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48) || "workflow", Ue = (e) => {
256
255
  switch (e) {
257
- case "schedule": return s.Schedule;
258
- case "webhook": return s.Webhook;
256
+ case "schedule": return "SCHEDULE";
257
+ case "webhook": return "WEBHOOK";
259
258
  case "event":
260
259
  case "score_change":
261
260
  case "tag_added":
262
- case "form_submit": return s.Event;
263
- default: return s.Manual;
264
- }
265
- }, Ge = (e) => ({
266
- name: A.trim(),
267
- description: Me?.config.description ?? null,
268
- triggerType: We(Y),
269
- triggerConfig: { source: Y },
270
- steps: ae(j, N),
271
- status: e === "active" ? o.Active : o.Draft,
272
- isEnabled: e === "active",
273
- metadata: {
274
- builder: !0,
275
- version: 2
261
+ case "form_submit": return "EVENT";
262
+ default: return "MANUAL";
276
263
  }
277
- }), Ke = async (t) => {
278
- if (Ue()) try {
279
- await O({
280
- variables: { input: Ge(t) },
264
+ }, We = (e) => {
265
+ let t = ne(M, P), n = Ue(X);
266
+ return {
267
+ workflowKey: `headshotmarketing-${He(j.trim())}-${Date.now()}`,
268
+ version: "1.0.0",
269
+ name: j.trim(),
270
+ description: ke?.config.description ?? null,
271
+ category: "headshotmarketing",
272
+ tags: [],
273
+ context: {
274
+ product: "headshotmarketing",
275
+ triggerType: n,
276
+ triggerConfig: { source: X },
277
+ builder: !0
278
+ },
279
+ definitionJson: {
280
+ triggerType: n,
281
+ triggerConfig: { source: X },
282
+ steps: t,
283
+ builder: !0,
284
+ version: 2
285
+ }
286
+ };
287
+ }, Ge = async (t) => {
288
+ if (Ve()) try {
289
+ await k({
290
+ variables: { input: We(t) },
281
291
  refetchQueries: [{
282
292
  query: e,
283
293
  variables: { limit: 50 }
284
294
  }],
285
295
  awaitRefetchQueries: !0
286
- }), f(D + "/automation/workflows");
296
+ }), p(O + "/automation/workflows");
287
297
  } catch (e) {
288
298
  let t = e instanceof Error ? e.message : "Failed to save workflow.";
289
- R(t), Z({
299
+ z(t), Q({
290
300
  title: "Save failed",
291
301
  description: t,
292
302
  variant: "error"
293
303
  });
294
304
  }
295
- }, qe = async () => {
296
- if (Ue()) {
297
- V(!0);
305
+ }, Ke = async () => {
306
+ if (Ve()) {
307
+ H(!0);
298
308
  try {
299
- let e = Ee;
300
- if (e || (e = (await O({ variables: { input: Ge("draft") } })).data?.createHeadshotmarketingWorkflow.id ?? null, De(e)), !e) throw Error("Could not create a workflow to test.");
301
- let t = (await we({ variables: { input: {
302
- workflowId: e,
303
- inputData: {
304
- source: Y,
309
+ let e = Ce;
310
+ if (!e) {
311
+ let t = (await k({ variables: { input: We("draft") } })).data?.createHeadshotmarketingWorkflow;
312
+ e = t ? {
313
+ id: t.id,
314
+ workflowKey: t.workflowKey,
315
+ version: t.version
316
+ } : null, we(e);
317
+ }
318
+ if (!e) throw Error("Could not create a workflow to test.");
319
+ let t = (await xe({ variables: { input: {
320
+ workflowKey: e.workflowKey,
321
+ version: e.version,
322
+ triggerNodeId: "manual",
323
+ triggerData: {
324
+ source: X,
305
325
  test: !0
306
- }
326
+ },
327
+ context: { product: "headshotmarketing" }
307
328
  } } })).data?.triggerHeadshotmarketingWorkflow;
308
- t && (Oe({
329
+ t && (Te({
309
330
  id: t.id,
310
331
  status: t.status,
311
- startedAt: t.startedAt ?? t.createdAt
312
- }), Z({
332
+ startedAt: (/* @__PURE__ */ new Date()).toISOString()
333
+ }), Q({
313
334
  title: "Test run started",
314
335
  description: `Execution ${t.id.slice(0, 8)} — ${t.status.toLowerCase()}`,
315
336
  variant: "success"
316
337
  }));
317
338
  } catch (e) {
318
339
  let t = e instanceof Error ? e.message : "Failed to run test.";
319
- R(t), Z({
340
+ z(t), Q({
320
341
  title: "Test failed",
321
342
  description: t,
322
343
  variant: "error"
323
344
  });
324
345
  } finally {
325
- V(!1);
346
+ H(!1);
326
347
  }
327
348
  }
328
- }, Je = Math.round(U * 100), $ = k || B;
329
- return /* @__PURE__ */ y(ee, {
349
+ }, qe = Math.round(W * 100), $ = A || V;
350
+ return /* @__PURE__ */ b(o, {
330
351
  title: "Workflow Builder",
331
- actions: /* @__PURE__ */ y("div", {
352
+ actions: /* @__PURE__ */ b("div", {
332
353
  className: "flex flex-wrap items-center gap-2",
333
354
  children: [
334
- /* @__PURE__ */ y("button", {
335
- onClick: () => f(D + "/automation/workflows"),
355
+ /* @__PURE__ */ b("button", {
356
+ onClick: () => p(O + "/automation/workflows"),
336
357
  className: "inline-flex min-h-10 items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
337
- children: [/* @__PURE__ */ v(ue, { className: "h-4 w-4" }), "Back"]
358
+ children: [/* @__PURE__ */ y(se, { className: "h-4 w-4" }), "Back"]
338
359
  }),
339
- /* @__PURE__ */ y("button", {
340
- onClick: () => void qe(),
360
+ /* @__PURE__ */ b("button", {
361
+ onClick: () => void Ke(),
341
362
  disabled: $,
342
363
  className: "inline-flex min-h-10 items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
343
- children: [/* @__PURE__ */ v(he, { className: "h-4 w-4" }), B ? "Testing…" : "Test"]
364
+ children: [/* @__PURE__ */ y(fe, { className: "h-4 w-4" }), V ? "Testing…" : "Test"]
344
365
  }),
345
- /* @__PURE__ */ y("button", {
346
- onClick: () => void Ke("draft"),
366
+ /* @__PURE__ */ b("button", {
367
+ onClick: () => void Ge("draft"),
347
368
  disabled: $,
348
369
  className: "inline-flex min-h-10 items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
349
- children: [/* @__PURE__ */ v(ge, { className: "h-4 w-4" }), k && !B ? "Saving…" : "Save"]
370
+ children: [/* @__PURE__ */ y(pe, { className: "h-4 w-4" }), A && !V ? "Saving…" : "Save"]
350
371
  }),
351
- /* @__PURE__ */ y("button", {
352
- onClick: () => void Ke("active"),
372
+ /* @__PURE__ */ b("button", {
373
+ onClick: () => void Ge("active"),
353
374
  disabled: $,
354
375
  className: "inline-flex min-h-10 items-center gap-2 rounded-md bg-action-primary-bg px-3.5 py-2 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bgHover disabled:opacity-60",
355
- children: [/* @__PURE__ */ v(_e, { className: "h-4 w-4" }), "Activate"]
376
+ children: [/* @__PURE__ */ y(me, { className: "h-4 w-4" }), "Activate"]
356
377
  })
357
378
  ]
358
379
  }),
359
380
  children: [
360
- /* @__PURE__ */ v(ve, { children: "Design an automation visually. Pick the trigger that starts it, drag in the steps it should run — send an email or SMS, wait, branch on a condition — and connect them on the canvas. Test a dry run, save a draft while you iterate, or activate it to put it to work." }),
361
- L && /* @__PURE__ */ v("div", {
381
+ /* @__PURE__ */ y(he, { children: "Design an automation visually. Pick the trigger that starts it, drag in the steps it should run — send an email or SMS, wait, branch on a condition — and connect them on the canvas. Test a dry run, save a draft while you iterate, or activate it to put it to work." }),
382
+ R && /* @__PURE__ */ y("div", {
362
383
  className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
363
- children: L
384
+ children: R
364
385
  }),
365
- z && /* @__PURE__ */ y("div", {
386
+ B && /* @__PURE__ */ b("div", {
366
387
  className: "flex flex-wrap items-center gap-3 rounded-card border border-border-seam bg-gloss-card shadow-pop px-4 py-3",
367
388
  children: [
368
- /* @__PURE__ */ v("span", {
369
- className: i("flex h-9 w-9 items-center justify-center rounded-lg ring-1 ring-inset", c[E(z.status)]),
370
- children: /* @__PURE__ */ v(de, { className: "h-4 w-4" })
389
+ /* @__PURE__ */ y("span", {
390
+ className: i("flex h-9 w-9 items-center justify-center rounded-lg ring-1 ring-inset", l[D(B.status)]),
391
+ children: /* @__PURE__ */ y(ce, { className: "h-4 w-4" })
371
392
  }),
372
- /* @__PURE__ */ y("div", {
393
+ /* @__PURE__ */ b("div", {
373
394
  className: "min-w-0 flex-1",
374
- children: [/* @__PURE__ */ v("p", {
395
+ children: [/* @__PURE__ */ y("p", {
375
396
  className: "text-sm font-semibold text-text-primary",
376
397
  children: "Last test run"
377
- }), /* @__PURE__ */ y("p", {
398
+ }), /* @__PURE__ */ b("p", {
378
399
  className: "truncate text-xs text-text-secondary",
379
400
  children: [
380
401
  "Execution ",
381
- z.id.slice(0, 8),
382
- z.startedAt ? ` · started ${a(z.startedAt, "relative")}` : ""
402
+ B.id.slice(0, 8),
403
+ B.startedAt ? ` · started ${a(B.startedAt, "relative")}` : ""
383
404
  ]
384
405
  })]
385
406
  }),
386
- /* @__PURE__ */ v("span", {
387
- className: i("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ring-1 ring-inset", c[E(z.status)]),
388
- children: z.status.toLowerCase().replace(/_/g, " ")
407
+ /* @__PURE__ */ y("span", {
408
+ className: i("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ring-1 ring-inset", l[D(B.status)]),
409
+ children: B.status.toLowerCase().replace(/_/g, " ")
389
410
  })
390
411
  ]
391
412
  }),
392
- /* @__PURE__ */ y("div", {
413
+ /* @__PURE__ */ b("div", {
393
414
  className: "rounded-card border border-border-seam bg-gloss-card shadow-pop p-4",
394
- children: [/* @__PURE__ */ v("label", {
415
+ children: [/* @__PURE__ */ y("label", {
395
416
  className: "mb-1 block text-xs font-medium text-text-secondary",
396
417
  children: "Workflow name"
397
- }), /* @__PURE__ */ v("input", {
418
+ }), /* @__PURE__ */ y("input", {
398
419
  type: "text",
399
- value: A,
400
- onChange: (e) => Te(e.target.value),
420
+ value: j,
421
+ onChange: (e) => Se(e.target.value),
401
422
  className: "w-full border-none bg-transparent text-lg font-semibold text-text-primary outline-none placeholder:text-text-secondary",
402
423
  placeholder: "Workflow name"
403
424
  })]
404
425
  }),
405
- /* @__PURE__ */ y("div", {
426
+ /* @__PURE__ */ b("div", {
406
427
  className: "grid grid-cols-1 gap-6 xl:grid-cols-[200px_minmax(0,1fr)_272px]",
407
428
  children: [
408
- /* @__PURE__ */ y("div", {
429
+ /* @__PURE__ */ b("div", {
409
430
  className: "space-y-4",
410
- children: [/* @__PURE__ */ y("div", {
431
+ children: [/* @__PURE__ */ b("div", {
411
432
  className: "rounded-card border border-border-seam bg-gloss-card shadow-pop p-4",
412
- children: [/* @__PURE__ */ v("h4", {
433
+ children: [/* @__PURE__ */ y("h4", {
413
434
  className: "mb-3 text-sm font-semibold text-text-primary",
414
435
  children: "Trigger"
415
- }), /* @__PURE__ */ v("div", {
436
+ }), /* @__PURE__ */ y("div", {
416
437
  className: "space-y-1.5",
417
- children: re.map((e) => /* @__PURE__ */ y("button", {
418
- onClick: () => Ie(e.type),
419
- className: i("flex min-h-10 w-full items-center gap-2 rounded-md border px-3 py-2 text-left text-sm transition-colors", Y === e.type ? "border-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)] bg-[var(--color-accent-soft)] text-text-primary" : "border-border-subtle text-text-primary hover:bg-bg-sunken"),
420
- children: [/* @__PURE__ */ v("span", {
438
+ children: ee.map((e) => /* @__PURE__ */ b("button", {
439
+ onClick: () => Ne(e.type),
440
+ className: i("flex min-h-10 w-full items-center gap-2 rounded-md border px-3 py-2 text-left text-sm transition-colors", X === e.type ? "border-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)] bg-[var(--color-accent-soft)] text-text-primary" : "border-border-subtle text-text-primary hover:bg-bg-sunken"),
441
+ children: [/* @__PURE__ */ y("span", {
421
442
  "aria-hidden": !0,
422
443
  children: e.icon
423
- }), /* @__PURE__ */ v("span", {
444
+ }), /* @__PURE__ */ y("span", {
424
445
  className: "truncate",
425
446
  children: e.label
426
447
  })]
427
448
  }, e.type))
428
449
  })]
429
- }), /* @__PURE__ */ y("div", {
450
+ }), /* @__PURE__ */ b("div", {
430
451
  className: "rounded-card border border-border-seam bg-gloss-card shadow-pop p-4",
431
452
  children: [
432
- /* @__PURE__ */ v("h4", {
453
+ /* @__PURE__ */ y("h4", {
433
454
  className: "mb-3 text-sm font-semibold text-text-primary",
434
455
  children: "Actions"
435
456
  }),
436
- /* @__PURE__ */ v("p", {
457
+ /* @__PURE__ */ y("p", {
437
458
  className: "mb-3 text-[11px] text-text-secondary",
438
459
  children: "Adds after the selected node."
439
460
  }),
440
- /* @__PURE__ */ v("div", {
461
+ /* @__PURE__ */ y("div", {
441
462
  className: "space-y-1.5",
442
- children: ne.map((e) => {
463
+ children: c.map((e) => {
443
464
  let t = e.icon;
444
- return /* @__PURE__ */ y("button", {
445
- onClick: () => Re(e.type),
465
+ return /* @__PURE__ */ b("button", {
466
+ onClick: () => Fe(e.type),
446
467
  className: "flex min-h-10 w-full items-center gap-2.5 rounded-md border border-border-subtle px-2.5 py-2 text-left text-sm text-text-primary transition-colors hover:border-border-strong hover:bg-bg-sunken",
447
468
  children: [
448
- /* @__PURE__ */ v("span", {
449
- className: i("flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md ring-1 ring-inset", c[e.tone]),
450
- children: /* @__PURE__ */ v(t, { className: "h-3.5 w-3.5" })
469
+ /* @__PURE__ */ y("span", {
470
+ className: i("flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-md ring-1 ring-inset", l[e.tone]),
471
+ children: /* @__PURE__ */ y(t, { className: "h-3.5 w-3.5" })
451
472
  }),
452
- /* @__PURE__ */ v("span", {
473
+ /* @__PURE__ */ y("span", {
453
474
  className: "truncate",
454
475
  children: e.label
455
476
  }),
456
- /* @__PURE__ */ v(_, { className: "ml-auto h-3.5 w-3.5 flex-shrink-0 text-text-secondary" })
477
+ /* @__PURE__ */ y(v, { className: "ml-auto h-3.5 w-3.5 flex-shrink-0 text-text-secondary" })
457
478
  ]
458
479
  }, e.type);
459
480
  })
@@ -461,90 +482,90 @@ var D = () => {
461
482
  ]
462
483
  })]
463
484
  }),
464
- /* @__PURE__ */ y("div", {
485
+ /* @__PURE__ */ b("div", {
465
486
  className: "overflow-hidden rounded-card border border-border-seam bg-gloss-card shadow-pop",
466
- children: [/* @__PURE__ */ y("div", {
487
+ children: [/* @__PURE__ */ b("div", {
467
488
  className: "flex items-center justify-between gap-3 border-b border-border-subtle px-4 py-3",
468
- children: [/* @__PURE__ */ y("div", {
489
+ children: [/* @__PURE__ */ b("div", {
469
490
  className: "min-w-0",
470
- children: [/* @__PURE__ */ v("h3", {
491
+ children: [/* @__PURE__ */ y("h3", {
471
492
  className: "text-sm font-semibold uppercase tracking-wide text-text-primary",
472
493
  children: "Workflow Canvas"
473
- }), /* @__PURE__ */ y("p", {
494
+ }), /* @__PURE__ */ b("p", {
474
495
  className: "text-xs text-text-secondary",
475
496
  children: [
476
- j.length,
497
+ M.length,
477
498
  " nodes · ",
478
- N.length,
499
+ P.length,
479
500
  " connections"
480
501
  ]
481
502
  })]
482
- }), /* @__PURE__ */ y("div", {
503
+ }), /* @__PURE__ */ b("div", {
483
504
  className: "hidden items-center gap-1.5 text-xs text-text-secondary sm:flex",
484
- children: [/* @__PURE__ */ v(me, { className: "h-3.5 w-3.5" }), "Drag nodes · drag canvas to pan"]
505
+ children: [/* @__PURE__ */ y(de, { className: "h-3.5 w-3.5" }), "Drag nodes · drag canvas to pan"]
485
506
  })]
486
- }), /* @__PURE__ */ y("div", {
487
- onPointerDown: Be,
488
- onPointerMove: Ve,
489
- onPointerUp: He,
490
- onPointerCancel: He,
507
+ }), /* @__PURE__ */ b("div", {
508
+ onPointerDown: Re,
509
+ onPointerMove: ze,
510
+ onPointerUp: Be,
511
+ onPointerCancel: Be,
491
512
  className: "relative h-[520px] w-full cursor-grab overflow-hidden bg-bg-sunken active:cursor-grabbing sm:h-[580px]",
492
513
  style: {
493
514
  touchAction: "none",
494
515
  backgroundImage: "radial-gradient(var(--color-border-subtle) 1px, transparent 1px)",
495
- backgroundSize: `${20 * U}px ${20 * U}px`,
496
- backgroundPosition: `${G.x}px ${G.y}px`
516
+ backgroundSize: `${20 * W}px ${20 * W}px`,
517
+ backgroundPosition: `${K.x}px ${K.y}px`
497
518
  },
498
- children: [/* @__PURE__ */ y("div", {
519
+ children: [/* @__PURE__ */ b("div", {
499
520
  className: "absolute right-3 top-3 z-20 flex items-center gap-0.5 rounded-lg border border-border-seam bg-gloss-card p-1 shadow-pop",
500
521
  children: [
501
- /* @__PURE__ */ v("button", {
522
+ /* @__PURE__ */ y("button", {
502
523
  type: "button",
503
- onClick: () => Q(-.1),
504
- disabled: U <= b,
524
+ onClick: () => Ie(-.1),
525
+ disabled: W <= x,
505
526
  "aria-label": "Zoom out",
506
527
  className: "flex h-8 w-8 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary disabled:opacity-40",
507
- children: /* @__PURE__ */ v(pe, { className: "h-4 w-4" })
528
+ children: /* @__PURE__ */ y(ue, { className: "h-4 w-4" })
508
529
  }),
509
- /* @__PURE__ */ y("span", {
530
+ /* @__PURE__ */ b("span", {
510
531
  className: "min-w-11 text-center text-xs font-medium tabular-nums text-text-secondary",
511
- children: [Je, "%"]
532
+ children: [qe, "%"]
512
533
  }),
513
- /* @__PURE__ */ v("button", {
534
+ /* @__PURE__ */ y("button", {
514
535
  type: "button",
515
- onClick: () => Q(.1),
516
- disabled: U >= x,
536
+ onClick: () => Ie(.1),
537
+ disabled: W >= S,
517
538
  "aria-label": "Zoom in",
518
539
  className: "flex h-8 w-8 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary disabled:opacity-40",
519
- children: /* @__PURE__ */ v(_, { className: "h-4 w-4" })
540
+ children: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
520
541
  }),
521
- /* @__PURE__ */ v("span", {
542
+ /* @__PURE__ */ y("span", {
522
543
  className: "mx-0.5 h-5 w-px bg-border-subtle",
523
544
  "aria-hidden": !0
524
545
  }),
525
- /* @__PURE__ */ v("button", {
546
+ /* @__PURE__ */ y("button", {
526
547
  type: "button",
527
- onClick: ze,
548
+ onClick: Le,
528
549
  "aria-label": "Reset view",
529
550
  className: "flex h-8 w-8 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
530
- children: /* @__PURE__ */ v(fe, { className: "h-4 w-4" })
551
+ children: /* @__PURE__ */ y(le, { className: "h-4 w-4" })
531
552
  })
532
553
  ]
533
- }), /* @__PURE__ */ y("div", {
554
+ }), /* @__PURE__ */ b("div", {
534
555
  className: "absolute left-0 top-0 origin-top-left",
535
- style: { transform: `translate(${G.x}px, ${G.y}px) scale(${U})` },
556
+ style: { transform: `translate(${K.x}px, ${K.y}px) scale(${W})` },
536
557
  children: [
537
- /* @__PURE__ */ y("svg", {
538
- width: ye,
539
- height: be,
558
+ /* @__PURE__ */ b("svg", {
559
+ width: ge,
560
+ height: _e,
540
561
  className: "pointer-events-none absolute left-0 top-0 overflow-visible",
541
- children: [/* @__PURE__ */ v("defs", { children: [
562
+ children: [/* @__PURE__ */ y("defs", { children: [
542
563
  "accent",
543
564
  "yes",
544
565
  "no"
545
566
  ].map((e) => {
546
567
  let t = e === "yes" ? "yes" : e === "no" ? "no" : null;
547
- return /* @__PURE__ */ v("marker", {
568
+ return /* @__PURE__ */ y("marker", {
548
569
  id: `wf-arrow-${e}`,
549
570
  viewBox: "0 0 10 10",
550
571
  refX: "8",
@@ -552,73 +573,73 @@ var D = () => {
552
573
  markerWidth: "7",
553
574
  markerHeight: "7",
554
575
  orient: "auto-start-reverse",
555
- children: /* @__PURE__ */ v("path", {
576
+ children: /* @__PURE__ */ y("path", {
556
577
  d: "M0,0 L10,5 L0,10 z",
557
- style: { fill: T(t) }
578
+ style: { fill: E(t) }
558
579
  })
559
580
  }, e);
560
- }) }), N.map((e) => {
561
- let t = q.get(e.source), n = q.get(e.target);
581
+ }) }), P.map((e) => {
582
+ let t = J.get(e.source), n = J.get(e.target);
562
583
  if (!t || !n) return null;
563
- let r = d(t, e.branch), i = u(n), a = (r.y + i.y) / 2;
564
- return /* @__PURE__ */ v("path", {
584
+ let r = f(t, e.branch), i = d(n), a = (r.y + i.y) / 2;
585
+ return /* @__PURE__ */ y("path", {
565
586
  d: `M ${r.x} ${r.y} C ${r.x} ${a} ${i.x} ${a} ${i.x} ${i.y}`,
566
587
  fill: "none",
567
588
  strokeWidth: 2,
568
589
  strokeLinecap: "round",
569
- style: { stroke: T(e.branch) },
570
- markerEnd: `url(#${Ce(e.branch)})`
590
+ style: { stroke: E(e.branch) },
591
+ markerEnd: `url(#${be(e.branch)})`
571
592
  }, e.id);
572
593
  })]
573
594
  }),
574
- N.filter((e) => e.branch).map((e) => {
575
- let t = q.get(e.source), n = q.get(e.target);
595
+ P.filter((e) => e.branch).map((e) => {
596
+ let t = J.get(e.source), n = J.get(e.target);
576
597
  if (!t || !n) return null;
577
- let r = d(t, e.branch), a = u(n);
578
- return /* @__PURE__ */ v("span", {
598
+ let r = f(t, e.branch), a = d(n);
599
+ return /* @__PURE__ */ y("span", {
579
600
  style: {
580
601
  left: (r.x + a.x) / 2,
581
602
  top: (r.y + a.y) / 2
582
603
  },
583
- className: i("pointer-events-none absolute -translate-x-1/2 -translate-y-1/2 rounded-md px-1.5 py-0.5 text-[10px] font-semibold uppercase ring-1 ring-inset", e.branch === "yes" ? c.success : c.error),
604
+ className: i("pointer-events-none absolute -translate-x-1/2 -translate-y-1/2 rounded-md px-1.5 py-0.5 text-[10px] font-semibold uppercase ring-1 ring-inset", e.branch === "yes" ? l.success : l.error),
584
605
  children: e.branch
585
606
  }, `label-${e.id}`);
586
607
  }),
587
- j.map((e) => /* @__PURE__ */ v(oe, {
608
+ M.map((e) => /* @__PURE__ */ y(re, {
588
609
  node: e,
589
- selected: F === e.id,
590
- scale: U,
591
- subtitle: Se(e),
592
- onSelect: I,
593
- onConfigure: I,
594
- onDelete: Le,
595
- onPositionChange: Ne
610
+ selected: I === e.id,
611
+ scale: W,
612
+ subtitle: ye(e),
613
+ onSelect: L,
614
+ onConfigure: L,
615
+ onDelete: Pe,
616
+ onPositionChange: Ae
596
617
  }, e.id))
597
618
  ]
598
619
  })]
599
620
  })]
600
621
  }),
601
- /* @__PURE__ */ v("div", {
602
- ref: je,
622
+ /* @__PURE__ */ y("div", {
623
+ ref: Oe,
603
624
  className: "xl:sticky xl:top-4 xl:self-start",
604
- children: J ? /* @__PURE__ */ v(ce, {
605
- node: J,
606
- onLabelChange: (e) => Pe(J.id, e),
607
- onConfigChange: (e) => Fe(J.id, e),
608
- onTriggerChange: Ie,
609
- onClose: () => I(null)
610
- }) : /* @__PURE__ */ v(se, {})
625
+ children: Y ? /* @__PURE__ */ y(ae, {
626
+ node: Y,
627
+ onLabelChange: (e) => je(Y.id, e),
628
+ onConfigChange: (e) => Me(Y.id, e),
629
+ onTriggerChange: Ne,
630
+ onClose: () => L(null)
631
+ }) : /* @__PURE__ */ y(ie, {})
611
632
  })
612
633
  ]
613
634
  }),
614
- /* @__PURE__ */ v(te, { toasts: ke.map((e) => ({
635
+ /* @__PURE__ */ y(s, { toasts: Ee.map((e) => ({
615
636
  ...e,
616
- onDismiss: X
637
+ onDismiss: Z
617
638
  })) })
618
639
  ]
619
640
  });
620
641
  };
621
642
  //#endregion
622
- export { D as WorkflowBuilderPage };
643
+ export { O as WorkflowBuilderPage };
623
644
 
624
645
  //# sourceMappingURL=WorkflowBuilderPage.js.map