@burdenoff/microfe-subscriberbot 2026.1102.4 → 2026.1102.6

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