@burdenoff/microfe-subscriberbot 2026.1029.1 → 2026.1030.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.
@@ -8,12 +8,13 @@ import { useTr as o } from "../hooks/useTr.js";
8
8
  import { ErrorView as s, LoadingView as c } from "../components/StateViews.js";
9
9
  import "../components/index.js";
10
10
  import { useActivateWorkflow as l, useCreateWorkflow as u, useWorkflows as d } from "../hooks/useSubscriberBotApi.js";
11
- import { useState as f } from "react";
12
- import { ArrowRight as p, CheckCircle2 as m, Clock as h, Play as g, Plus as _, Sparkles as v, Workflow as y, X as b, Zap as x } from "lucide-react";
13
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
14
- import { GlassCard as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
11
+ import { useRouteSelection as f } from "../hooks/useRouteSelection.js";
12
+ import { useState as p } from "react";
13
+ import { ArrowRight as m, CheckCircle2 as h, Clock as g, Play as _, Plus as v, Sparkles as y, Workflow as b, X as x, Zap as S } from "lucide-react";
14
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
15
+ import { GlassCard as E, PagePurpose as D } from "@burdenoff/fe-libs/ui";
15
16
  //#region src/subscriberbot/pages/WorkflowsPage.tsx
16
- var D = [
17
+ var O = [
17
18
  {
18
19
  value: "",
19
20
  labelKey: "workflows.filters.allStatuses",
@@ -39,30 +40,30 @@ var D = [
39
40
  labelKey: "workflows.filters.archived",
40
41
  fallback: "Archived"
41
42
  }
42
- ], O = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", k = "mb-1 block text-xs font-medium text-text-secondary";
43
- function A({ icon: e, kicker: t, title: n, sub: r, accent: i }) {
44
- return /* @__PURE__ */ w("div", {
43
+ ], k = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", A = "mb-1 block text-xs font-medium text-text-secondary";
44
+ function j({ icon: e, kicker: t, title: n, sub: r, accent: i }) {
45
+ return /* @__PURE__ */ T("div", {
45
46
  className: "w-48 shrink-0 overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-sm",
46
- children: [/* @__PURE__ */ C("div", {
47
+ children: [/* @__PURE__ */ w("div", {
47
48
  className: `h-1 w-full ${i === "done" ? "bg-status-success-text" : i === "run" ? "bg-status-warning-text" : "bg-[var(--color-accent-indigo)]"}`,
48
49
  "aria-hidden": !0
49
- }), /* @__PURE__ */ w("div", {
50
+ }), /* @__PURE__ */ T("div", {
50
51
  className: "p-3",
51
52
  children: [
52
- /* @__PURE__ */ C("span", {
53
+ /* @__PURE__ */ w("span", {
53
54
  className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
54
55
  children: e
55
56
  }),
56
- /* @__PURE__ */ C("p", {
57
+ /* @__PURE__ */ w("p", {
57
58
  className: "mt-2 text-[10px] font-medium uppercase tracking-wide text-text-secondary",
58
59
  children: t
59
60
  }),
60
- /* @__PURE__ */ C("p", {
61
+ /* @__PURE__ */ w("p", {
61
62
  className: "truncate text-sm font-semibold text-text-primary",
62
63
  title: n,
63
64
  children: n
64
65
  }),
65
- r && /* @__PURE__ */ C("p", {
66
+ r && /* @__PURE__ */ w("p", {
66
67
  className: "mt-0.5 truncate text-xs text-text-secondary",
67
68
  children: r
68
69
  })
@@ -70,36 +71,36 @@ function A({ icon: e, kicker: t, title: n, sub: r, accent: i }) {
70
71
  })]
71
72
  });
72
73
  }
73
- function j({ workflow: e, onClose: t, onActivate: i, activating: a }) {
74
- let s = o(), c = /* @__PURE__ */ w("div", {
74
+ function M({ workflow: e, onClose: t, onActivate: i, activating: a }) {
75
+ let s = o(), c = /* @__PURE__ */ T("div", {
75
76
  className: "flex shrink-0 items-center px-1 text-text-secondary",
76
77
  "aria-hidden": !0,
77
- children: [/* @__PURE__ */ C("span", { className: "h-px w-4 bg-border-seam sm:w-6" }), /* @__PURE__ */ C(p, { className: "h-4 w-4" })]
78
+ children: [/* @__PURE__ */ w("span", { className: "h-px w-4 bg-border-seam sm:w-6" }), /* @__PURE__ */ w(m, { className: "h-4 w-4" })]
78
79
  }), l = e.status.charAt(0) + e.status.slice(1).toLowerCase();
79
- return /* @__PURE__ */ w(T, {
80
+ return /* @__PURE__ */ T(E, {
80
81
  treatment: "glass",
81
82
  glow: !0,
82
83
  className: "mt-6 p-5",
83
84
  children: [
84
- /* @__PURE__ */ w("div", {
85
+ /* @__PURE__ */ T("div", {
85
86
  className: "flex flex-wrap items-start justify-between gap-3",
86
- children: [/* @__PURE__ */ w("div", {
87
+ children: [/* @__PURE__ */ T("div", {
87
88
  className: "min-w-0",
88
- children: [/* @__PURE__ */ w("div", {
89
+ children: [/* @__PURE__ */ T("div", {
89
90
  className: "flex flex-wrap items-center gap-2",
90
- children: [/* @__PURE__ */ C("p", {
91
+ children: [/* @__PURE__ */ w("p", {
91
92
  className: "text-base font-semibold text-text-primary",
92
93
  children: e.name
93
- }), /* @__PURE__ */ C(r, { status: e.status })]
94
- }), /* @__PURE__ */ w("p", {
94
+ }), /* @__PURE__ */ w(r, { status: e.status })]
95
+ }), /* @__PURE__ */ T("p", {
95
96
  className: "mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-secondary",
96
- children: [/* @__PURE__ */ C("span", {
97
+ children: [/* @__PURE__ */ w("span", {
97
98
  className: "tabular-nums",
98
99
  children: s("workflows.flow.ran", "Ran {{count}}×", { count: e.runCount })
99
- }), e.lastRunAt && /* @__PURE__ */ w("span", {
100
+ }), e.lastRunAt && /* @__PURE__ */ T("span", {
100
101
  className: "inline-flex items-center gap-1",
101
102
  children: [
102
- /* @__PURE__ */ C(h, {
103
+ /* @__PURE__ */ w(g, {
103
104
  className: "h-3 w-3",
104
105
  "aria-hidden": !0
105
106
  }),
@@ -108,58 +109,58 @@ function j({ workflow: e, onClose: t, onActivate: i, activating: a }) {
108
109
  ]
109
110
  })]
110
111
  })]
111
- }), /* @__PURE__ */ C("button", {
112
+ }), /* @__PURE__ */ w("button", {
112
113
  type: "button",
113
114
  onClick: t,
114
115
  "aria-label": s("workflows.flow.closeAriaLabel", "Close flow"),
115
116
  className: "rounded-lg border border-border-subtle p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
116
- children: /* @__PURE__ */ C(b, { className: "h-4 w-4" })
117
+ children: /* @__PURE__ */ w(x, { className: "h-4 w-4" })
117
118
  })]
118
119
  }),
119
- e.description && /* @__PURE__ */ C("p", {
120
+ e.description && /* @__PURE__ */ w("p", {
120
121
  className: "mt-2 max-w-3xl text-sm text-text-secondary",
121
122
  children: e.description
122
123
  }),
123
- /* @__PURE__ */ C("div", {
124
+ /* @__PURE__ */ w("div", {
124
125
  className: "mt-4 overflow-x-auto pb-2",
125
- children: /* @__PURE__ */ w("div", {
126
+ children: /* @__PURE__ */ T("div", {
126
127
  className: "flex min-w-max items-stretch",
127
128
  children: [
128
- /* @__PURE__ */ C(A, {
129
+ /* @__PURE__ */ w(j, {
129
130
  accent: "trigger",
130
131
  kicker: s("workflows.flow.trigger", "When"),
131
- icon: /* @__PURE__ */ C(x, { className: "h-4 w-4" }),
132
+ icon: /* @__PURE__ */ w(S, { className: "h-4 w-4" }),
132
133
  title: e.triggerEvent,
133
134
  sub: s("workflows.flow.triggerEvent", "Trigger event")
134
135
  }),
135
136
  c,
136
- /* @__PURE__ */ C(A, {
137
+ /* @__PURE__ */ w(j, {
137
138
  accent: "run",
138
139
  kicker: s("workflows.flow.run", "Run"),
139
- icon: /* @__PURE__ */ C(v, { className: "h-4 w-4" }),
140
+ icon: /* @__PURE__ */ w(y, { className: "h-4 w-4" }),
140
141
  title: e.name,
141
142
  sub: s("workflows.flow.automation", "Automation")
142
143
  }),
143
144
  c,
144
- /* @__PURE__ */ C(A, {
145
+ /* @__PURE__ */ w(j, {
145
146
  accent: "done",
146
147
  kicker: s("workflows.flow.then", "Then"),
147
- icon: /* @__PURE__ */ C(m, { className: "h-4 w-4" }),
148
+ icon: /* @__PURE__ */ w(h, { className: "h-4 w-4" }),
148
149
  title: e.status === "ACTIVE" ? s("workflows.flow.live", "Live") : s("workflows.flow.awaitingActivation", "Awaiting activation"),
149
150
  sub: s("workflows.flow.status", "Status: {{status}}", { status: l })
150
151
  })
151
152
  ]
152
153
  })
153
154
  }),
154
- e.status !== "ACTIVE" && /* @__PURE__ */ C("div", {
155
+ e.status !== "ACTIVE" && /* @__PURE__ */ w("div", {
155
156
  className: "mt-3 flex justify-end",
156
- children: /* @__PURE__ */ w("button", {
157
+ children: /* @__PURE__ */ T("button", {
157
158
  type: "button",
158
159
  disabled: a,
159
160
  onClick: i,
160
161
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
161
162
  children: [
162
- /* @__PURE__ */ C(g, { className: "h-4 w-4" }),
163
+ /* @__PURE__ */ w(_, { className: "h-4 w-4" }),
163
164
  " ",
164
165
  a ? s("common.activating", "Activating…") : s("workflows.flow.activate", "Activate workflow")
165
166
  ]
@@ -168,153 +169,153 @@ function j({ workflow: e, onClose: t, onActivate: i, activating: a }) {
168
169
  ]
169
170
  });
170
171
  }
171
- function M() {
172
- let [p, m] = f(""), [h, v] = f(!1), [b, A] = f(null), M = o(), { data: N, isLoading: P, isError: F, refetch: I } = d(p || void 0), L = u(), R = l(), [z, B] = f(""), [V, H] = f(""), [U, W] = f(""), [G, K] = f(null), q = N ?? [], J = q.find((e) => e.id === b) ?? null, Y = q.filter((e) => e.status === "ACTIVE").length, X = q.reduce((e, t) => e + (t.runCount || 0), 0), Z = () => {
173
- B(""), H(""), W(""), K(null);
174
- }, Q = () => {
175
- v(!1), Z();
172
+ function N() {
173
+ let [m, h] = p(""), [g, y] = p(!1), [x, j] = f("workflows"), N = o(), { data: P, isLoading: F, isError: I, refetch: L } = d(m || void 0), R = u(), z = l(), [B, V] = p(""), [H, U] = p(""), [W, G] = p(""), [K, q] = p(null), J = P ?? [], Y = J.find((e) => e.id === x) ?? null, X = J.filter((e) => e.status === "ACTIVE").length, Z = J.reduce((e, t) => e + (t.runCount || 0), 0), Q = () => {
174
+ V(""), U(""), G(""), q(null);
175
+ }, $ = () => {
176
+ y(!1), Q();
176
177
  };
177
- return /* @__PURE__ */ w(e, {
178
- title: M("workflows.title", "Workflows"),
179
- description: M("workflows.description", "Event-driven automation across your portfolio"),
180
- actions: /* @__PURE__ */ w("button", {
178
+ return /* @__PURE__ */ T(e, {
179
+ title: N("workflows.title", "Workflows"),
180
+ description: N("workflows.description", "Event-driven automation across your portfolio"),
181
+ actions: /* @__PURE__ */ T("button", {
181
182
  type: "button",
182
- onClick: () => v(!0),
183
+ onClick: () => y(!0),
183
184
  className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
184
185
  children: [
185
- /* @__PURE__ */ C(_, { className: "h-4 w-4" }),
186
+ /* @__PURE__ */ w(v, { className: "h-4 w-4" }),
186
187
  " ",
187
- M("workflows.newWorkflow", "New workflow")
188
+ N("workflows.newWorkflow", "New workflow")
188
189
  ]
189
190
  }),
190
191
  children: [
191
- /* @__PURE__ */ C(E, {
192
+ /* @__PURE__ */ w(D, {
192
193
  className: "mb-4",
193
- children: M("workflows.purpose", "Workflows react to domain events — a new invoice, a detected renewal, a cancelled relationship — and run multi-step automations. Draft a workflow, then activate it when you're ready.")
194
+ children: N("workflows.purpose", "Workflows react to domain events — a new invoice, a detected renewal, a cancelled relationship — and run multi-step automations. Draft a workflow, then activate it when you're ready.")
194
195
  }),
195
- /* @__PURE__ */ C("div", {
196
+ /* @__PURE__ */ w("div", {
196
197
  className: "flex flex-wrap items-center gap-3",
197
- children: /* @__PURE__ */ C("select", {
198
- "aria-label": M("common.filter", "Filter"),
199
- value: p,
200
- onChange: (e) => m(e.target.value),
198
+ children: /* @__PURE__ */ w("select", {
199
+ "aria-label": N("common.filter", "Filter"),
200
+ value: m,
201
+ onChange: (e) => h(e.target.value),
201
202
  className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-xs text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
202
- children: D.map((e) => /* @__PURE__ */ C("option", {
203
+ children: O.map((e) => /* @__PURE__ */ w("option", {
203
204
  value: e.value,
204
- children: M(e.labelKey, e.fallback)
205
+ children: N(e.labelKey, e.fallback)
205
206
  }, e.value))
206
207
  })
207
208
  }),
208
- P ? /* @__PURE__ */ C(c, { label: M("workflows.loading", "Loading workflows…") }) : F ? /* @__PURE__ */ C(s, {
209
- message: M("workflows.error", "Could not load workflows."),
210
- onRetry: () => void I()
211
- }) : q.length === 0 ? /* @__PURE__ */ C("div", {
209
+ F ? /* @__PURE__ */ w(c, { label: N("workflows.loading", "Loading workflows…") }) : I ? /* @__PURE__ */ w(s, {
210
+ message: N("workflows.error", "Could not load workflows."),
211
+ onRetry: () => void L()
212
+ }) : J.length === 0 ? /* @__PURE__ */ w("div", {
212
213
  className: "mt-6",
213
- children: /* @__PURE__ */ C(i, {
214
+ children: /* @__PURE__ */ w(i, {
214
215
  illustration: "empty-data",
215
- icon: /* @__PURE__ */ C(y, { className: "h-12 w-12" }),
216
- title: M("workflows.empty.title", "No workflows yet"),
217
- description: M("workflows.empty.description", "Create your first event-driven workflow to automate your recurring portfolio."),
218
- action: /* @__PURE__ */ C("button", {
216
+ icon: /* @__PURE__ */ w(b, { className: "h-12 w-12" }),
217
+ title: N("workflows.empty.title", "No workflows yet"),
218
+ description: N("workflows.empty.description", "Create your first event-driven workflow to automate your recurring portfolio."),
219
+ action: /* @__PURE__ */ w("button", {
219
220
  type: "button",
220
- onClick: () => v(!0),
221
+ onClick: () => y(!0),
221
222
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
222
- children: M("workflows.newWorkflow", "New workflow")
223
+ children: N("workflows.newWorkflow", "New workflow")
223
224
  })
224
225
  })
225
- }) : /* @__PURE__ */ w(S, { children: [
226
- /* @__PURE__ */ w("div", {
226
+ }) : /* @__PURE__ */ T(C, { children: [
227
+ /* @__PURE__ */ T("div", {
227
228
  className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3",
228
229
  children: [
229
- /* @__PURE__ */ C(t, {
230
- icon: /* @__PURE__ */ C(y, { className: "h-5 w-5" }),
231
- value: q.length,
232
- label: M("workflows.metrics.workflows", "Workflows")
230
+ /* @__PURE__ */ w(t, {
231
+ icon: /* @__PURE__ */ w(b, { className: "h-5 w-5" }),
232
+ value: J.length,
233
+ label: N("workflows.metrics.workflows", "Workflows")
233
234
  }),
234
- /* @__PURE__ */ C(t, {
235
- icon: /* @__PURE__ */ C(x, { className: "h-5 w-5" }),
236
- value: Y,
237
- label: M("workflows.metrics.active", "Active")
238
- }),
239
- /* @__PURE__ */ C(t, {
240
- icon: /* @__PURE__ */ C(g, { className: "h-5 w-5" }),
235
+ /* @__PURE__ */ w(t, {
236
+ icon: /* @__PURE__ */ w(S, { className: "h-5 w-5" }),
241
237
  value: X,
242
- label: M("workflows.metrics.totalRuns", "Total runs")
238
+ label: N("workflows.metrics.active", "Active")
239
+ }),
240
+ /* @__PURE__ */ w(t, {
241
+ icon: /* @__PURE__ */ w(_, { className: "h-5 w-5" }),
242
+ value: Z,
243
+ label: N("workflows.metrics.totalRuns", "Total runs")
243
244
  })
244
245
  ]
245
246
  }),
246
- J && /* @__PURE__ */ C(j, {
247
- workflow: J,
248
- onClose: () => A(null),
249
- onActivate: () => R.mutate(J.id),
250
- activating: R.isPending
247
+ Y && /* @__PURE__ */ w(M, {
248
+ workflow: Y,
249
+ onClose: () => j(null),
250
+ onActivate: () => z.mutate(Y.id),
251
+ activating: z.isPending
251
252
  }),
252
- /* @__PURE__ */ C("div", {
253
+ /* @__PURE__ */ w("div", {
253
254
  className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
254
- children: q.map((e) => {
255
- let t = e.id === b;
256
- return /* @__PURE__ */ w(T, {
255
+ children: J.map((e) => {
256
+ let t = e.id === x;
257
+ return /* @__PURE__ */ T(E, {
257
258
  treatment: "metric",
258
259
  glow: t || e.status === "ACTIVE",
259
260
  role: "button",
260
261
  tabIndex: 0,
261
262
  "aria-pressed": t,
262
- "aria-label": M("workflows.card.viewAriaLabel", "View flow for {{name}}", { name: e.name }),
263
- onClick: () => A(t ? null : e.id),
263
+ "aria-label": N("workflows.card.viewAriaLabel", "View flow for {{name}}", { name: e.name }),
264
+ onClick: () => j(t ? null : e.id),
264
265
  onKeyDown: (n) => {
265
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), A(t ? null : e.id));
266
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), j(t ? null : e.id));
266
267
  },
267
268
  className: "flex cursor-pointer flex-col p-5 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
268
269
  children: [
269
- /* @__PURE__ */ w("div", {
270
+ /* @__PURE__ */ T("div", {
270
271
  className: "flex items-start justify-between gap-2",
271
- children: [/* @__PURE__ */ C("span", {
272
+ children: [/* @__PURE__ */ w("span", {
272
273
  className: "flex size-10 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
273
- children: /* @__PURE__ */ C(y, { className: "h-5 w-5" })
274
- }), /* @__PURE__ */ C(r, { status: e.status })]
274
+ children: /* @__PURE__ */ w(b, { className: "h-5 w-5" })
275
+ }), /* @__PURE__ */ w(r, { status: e.status })]
275
276
  }),
276
- /* @__PURE__ */ C("p", {
277
+ /* @__PURE__ */ w("p", {
277
278
  className: "mt-3 truncate text-sm font-semibold text-text-primary",
278
279
  children: e.name
279
280
  }),
280
- /* @__PURE__ */ w("p", {
281
+ /* @__PURE__ */ T("p", {
281
282
  className: "flex items-center gap-1 truncate text-xs text-text-secondary",
282
283
  children: [
283
- /* @__PURE__ */ C(x, {
284
+ /* @__PURE__ */ w(S, {
284
285
  className: "h-3 w-3 shrink-0",
285
286
  "aria-hidden": !0
286
287
  }),
287
288
  " ",
288
- M("workflows.card.onTrigger", "on {{trigger}}", { trigger: e.triggerEvent })
289
+ N("workflows.card.onTrigger", "on {{trigger}}", { trigger: e.triggerEvent })
289
290
  ]
290
291
  }),
291
- e.description && /* @__PURE__ */ C("p", {
292
+ e.description && /* @__PURE__ */ w("p", {
292
293
  className: "mt-2 line-clamp-2 min-h-[2rem] text-xs text-text-secondary",
293
294
  children: e.description
294
295
  }),
295
- /* @__PURE__ */ w("p", {
296
+ /* @__PURE__ */ T("p", {
296
297
  className: "mt-3 flex items-center gap-1.5 text-xs text-text-secondary tabular-nums",
297
298
  children: [
298
- /* @__PURE__ */ C(g, {
299
+ /* @__PURE__ */ w(_, {
299
300
  className: "h-3.5 w-3.5",
300
301
  "aria-hidden": !0
301
302
  }),
302
303
  " ",
303
- M("workflows.flow.ran", "Ran {{count}}×", { count: e.runCount }),
304
- e.lastRunAt ? ` · ${M("workflows.flow.lastRun", "last {{when}}", { when: n(e.lastRunAt) })}` : ""
304
+ N("workflows.flow.ran", "Ran {{count}}×", { count: e.runCount }),
305
+ e.lastRunAt ? ` · ${N("workflows.flow.lastRun", "last {{when}}", { when: n(e.lastRunAt) })}` : ""
305
306
  ]
306
307
  }),
307
- e.status !== "ACTIVE" && /* @__PURE__ */ w("button", {
308
+ e.status !== "ACTIVE" && /* @__PURE__ */ T("button", {
308
309
  type: "button",
309
- disabled: R.isPending,
310
+ disabled: z.isPending,
310
311
  onClick: (t) => {
311
- t.stopPropagation(), R.mutate(e.id);
312
+ t.stopPropagation(), z.mutate(e.id);
312
313
  },
313
314
  className: "mt-4 inline-flex items-center justify-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
314
315
  children: [
315
- /* @__PURE__ */ C(g, { className: "h-3.5 w-3.5" }),
316
+ /* @__PURE__ */ w(_, { className: "h-3.5 w-3.5" }),
316
317
  " ",
317
- M("common.activate", "Activate")
318
+ N("common.activate", "Activate")
318
319
  ]
319
320
  })
320
321
  ]
@@ -322,97 +323,97 @@ function M() {
322
323
  })
323
324
  })
324
325
  ] }),
325
- h && /* @__PURE__ */ C(a, {
326
- title: M("workflows.newWorkflow", "New workflow"),
327
- onClose: Q,
328
- children: /* @__PURE__ */ w("form", {
326
+ g && /* @__PURE__ */ w(a, {
327
+ title: N("workflows.newWorkflow", "New workflow"),
328
+ onClose: $,
329
+ children: /* @__PURE__ */ T("form", {
329
330
  onSubmit: (e) => {
330
- if (e.preventDefault(), K(null), !z.trim() || !V.trim()) {
331
- K(M("workflows.form.nameRequired", "Name and trigger event are required."));
331
+ if (e.preventDefault(), q(null), !B.trim() || !H.trim()) {
332
+ q(N("workflows.form.nameRequired", "Name and trigger event are required."));
332
333
  return;
333
334
  }
334
335
  let t = {
335
- name: z.trim(),
336
- triggerEvent: V.trim(),
337
- ...U.trim() ? { description: U.trim() } : {}
336
+ name: B.trim(),
337
+ triggerEvent: H.trim(),
338
+ ...W.trim() ? { description: W.trim() } : {}
338
339
  };
339
- L.mutate(t, {
340
+ R.mutate(t, {
340
341
  onSuccess: () => {
341
- Z(), v(!1);
342
+ Q(), y(!1);
342
343
  },
343
- onError: (e) => K(e instanceof Error ? e.message : M("common.error", "An error occurred"))
344
+ onError: (e) => q(e instanceof Error ? e.message : N("common.error", "An error occurred"))
344
345
  });
345
346
  },
346
347
  className: "space-y-4",
347
348
  children: [
348
- G && /* @__PURE__ */ C("div", {
349
+ K && /* @__PURE__ */ w("div", {
349
350
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
350
- children: G
351
+ children: K
351
352
  }),
352
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
353
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("label", {
353
354
  htmlFor: "wf-name",
354
- className: k,
355
+ className: A,
355
356
  children: [
356
- M("workflows.form.nameLabel", "Name"),
357
+ N("workflows.form.nameLabel", "Name"),
357
358
  " ",
358
- /* @__PURE__ */ C("span", {
359
+ /* @__PURE__ */ w("span", {
359
360
  className: "text-status-error-text",
360
361
  children: "*"
361
362
  })
362
363
  ]
363
- }), /* @__PURE__ */ C("input", {
364
+ }), /* @__PURE__ */ w("input", {
364
365
  id: "wf-name",
365
366
  type: "text",
366
- value: z,
367
- onChange: (e) => B(e.target.value),
368
- placeholder: M("workflows.form.namePlaceholder", "e.g. Invoice → notify finance"),
369
- className: O,
367
+ value: B,
368
+ onChange: (e) => V(e.target.value),
369
+ placeholder: N("workflows.form.namePlaceholder", "e.g. Invoice → notify finance"),
370
+ className: k,
370
371
  required: !0
371
372
  })] }),
372
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
373
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("label", {
373
374
  htmlFor: "wf-trigger",
374
- className: k,
375
+ className: A,
375
376
  children: [
376
- M("workflows.form.triggerLabel", "Trigger event"),
377
+ N("workflows.form.triggerLabel", "Trigger event"),
377
378
  " ",
378
- /* @__PURE__ */ C("span", {
379
+ /* @__PURE__ */ w("span", {
379
380
  className: "text-status-error-text",
380
381
  children: "*"
381
382
  })
382
383
  ]
383
- }), /* @__PURE__ */ C("input", {
384
+ }), /* @__PURE__ */ w("input", {
384
385
  id: "wf-trigger",
385
386
  type: "text",
386
- value: V,
387
- onChange: (e) => H(e.target.value),
388
- placeholder: M("workflows.form.triggerPlaceholder", "e.g. InvoiceReceived, RenewalDetected"),
389
- className: O,
387
+ value: H,
388
+ onChange: (e) => U(e.target.value),
389
+ placeholder: N("workflows.form.triggerPlaceholder", "e.g. InvoiceReceived, RenewalDetected"),
390
+ className: k,
390
391
  required: !0
391
392
  })] }),
392
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
393
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
393
394
  htmlFor: "wf-desc",
394
- className: k,
395
- children: M("workflows.form.descriptionLabel", "Description")
396
- }), /* @__PURE__ */ C("textarea", {
395
+ className: A,
396
+ children: N("workflows.form.descriptionLabel", "Description")
397
+ }), /* @__PURE__ */ w("textarea", {
397
398
  id: "wf-desc",
398
- value: U,
399
- onChange: (e) => W(e.target.value),
399
+ value: W,
400
+ onChange: (e) => G(e.target.value),
400
401
  rows: 3,
401
- placeholder: M("workflows.form.descriptionPlaceholder", "What should this workflow do when the event fires?"),
402
- className: O
402
+ placeholder: N("workflows.form.descriptionPlaceholder", "What should this workflow do when the event fires?"),
403
+ className: k
403
404
  })] }),
404
- /* @__PURE__ */ w("div", {
405
+ /* @__PURE__ */ T("div", {
405
406
  className: "flex justify-end gap-3",
406
- children: [/* @__PURE__ */ C("button", {
407
+ children: [/* @__PURE__ */ w("button", {
407
408
  type: "button",
408
- onClick: Q,
409
+ onClick: $,
409
410
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
410
- children: M("common.cancel", "Cancel")
411
- }), /* @__PURE__ */ C("button", {
411
+ children: N("common.cancel", "Cancel")
412
+ }), /* @__PURE__ */ w("button", {
412
413
  type: "submit",
413
- disabled: L.isPending,
414
+ disabled: R.isPending,
414
415
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
415
- children: L.isPending ? M("workflows.creating", "Creating…") : M("workflows.createWorkflow", "Create workflow")
416
+ children: R.isPending ? N("workflows.creating", "Creating…") : N("workflows.createWorkflow", "Create workflow")
416
417
  })]
417
418
  })
418
419
  ]
@@ -422,6 +423,6 @@ function M() {
422
423
  });
423
424
  }
424
425
  //#endregion
425
- export { M as WorkflowsPage };
426
+ export { N as WorkflowsPage };
426
427
 
427
428
  //# sourceMappingURL=WorkflowsPage.js.map