@burdenoff/microfe-subscriberbot 2026.1105.1 → 2026.1107.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 (50) hide show
  1. package/dist/stories/pages/DashboardPage.stories.d.ts.map +1 -1
  2. package/dist/stories/pages/ProviderDetailPage.stories.d.ts +1 -0
  3. package/dist/stories/pages/ProviderDetailPage.stories.d.ts.map +1 -1
  4. package/dist/stories/support/fixtures.d.ts +3 -1
  5. package/dist/stories/support/fixtures.d.ts.map +1 -1
  6. package/dist/stories/support/handlers.d.ts.map +1 -1
  7. package/dist/subscriberbot/components/PageLayout.d.ts +6 -0
  8. package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
  9. package/dist/subscriberbot/components/PageLayout.js +2 -1
  10. package/dist/subscriberbot/components/PageLayout.js.map +1 -1
  11. package/dist/subscriberbot/components/StateViews.d.ts +2 -0
  12. package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
  13. package/dist/subscriberbot/components/StateViews.js +2 -1
  14. package/dist/subscriberbot/components/StateViews.js.map +1 -1
  15. package/dist/subscriberbot/components/index.d.ts +2 -2
  16. package/dist/subscriberbot/components/index.d.ts.map +1 -1
  17. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
  18. package/dist/subscriberbot/components/mobile/MobileDashboard.js +29 -21
  19. package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
  20. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +3 -0
  21. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -1
  22. package/dist/subscriberbot/components/mobile/MobileScreen.js +4 -2
  23. package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
  24. package/dist/subscriberbot/components/viz.d.ts +26 -0
  25. package/dist/subscriberbot/components/viz.d.ts.map +1 -1
  26. package/dist/subscriberbot/components/viz.js +99 -1
  27. package/dist/subscriberbot/components/viz.js.map +1 -1
  28. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +3 -1
  29. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
  30. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +114 -70
  31. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  32. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
  33. package/dist/subscriberbot/pages/DashboardPage.js +8 -0
  34. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  35. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
  36. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +5 -0
  37. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
  38. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
  39. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +306 -301
  40. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  41. package/dist/subscriberbot/pages/providers/ProviderInsights.d.ts +23 -0
  42. package/dist/subscriberbot/pages/providers/ProviderInsights.d.ts.map +1 -0
  43. package/dist/subscriberbot/pages/providers/ProviderInsights.js +293 -0
  44. package/dist/subscriberbot/pages/providers/ProviderInsights.js.map +1 -0
  45. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
  46. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +8 -1
  47. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  48. package/dist/subscriberbot/types/index.d.ts +75 -0
  49. package/dist/subscriberbot/types/index.d.ts.map +1 -1
  50. package/package.json +1 -1
@@ -0,0 +1,293 @@
1
+ import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
2
+ import { formatCurrency as t, formatDate as n, formatEnumLabel as r, formatIntervalSuffix as i } from "../../utils/formatters.js";
3
+ import { useTr as a } from "../../hooks/useTr.js";
4
+ import { cn as o } from "../../utils/cn.js";
5
+ import { StatusBadge as s } from "../../components/StatusBadge.js";
6
+ import { EmptyState as c } from "../../components/EmptyState.js";
7
+ import { ErrorView as l, LoadingView as u, Section as d } from "../../components/StateViews.js";
8
+ import { PriceHistoryChart as f } from "../../components/viz.js";
9
+ import "../../components/index.js";
10
+ import { useProviderAlternatives as p, useProviderPriceHistory as m } from "../../hooks/useSubscriberBotApi.js";
11
+ import { useMemo as h } from "react";
12
+ import { ArrowRight as g, Shuffle as _ } from "lucide-react";
13
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
14
+ import { GlassCard as x } from "@burdenoff/fe-libs/ui";
15
+ //#region src/subscriberbot/pages/providers/ProviderInsights.tsx
16
+ var S = 6;
17
+ function C(e) {
18
+ return e === null || e === 0 ? "bg-bg-sunken text-text-secondary" : e > 0 ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-success-bg-subtle text-status-success-text";
19
+ }
20
+ function w(e) {
21
+ return `${e > 0 ? "+" : ""}${e}%`;
22
+ }
23
+ function T(e, r) {
24
+ let a = e.summary?.currency;
25
+ if (!a) return [];
26
+ let o = /* @__PURE__ */ new Map();
27
+ for (let t of e.series) {
28
+ if (t.source !== "RELATIONSHIP" || t.currency === a || !t.relationshipId) continue;
29
+ let e = o.get(t.relationshipId) ?? [];
30
+ e.push(...t.points.map((e) => e.observedAt)), o.set(t.relationshipId, e);
31
+ }
32
+ return e.series.filter((e) => e.currency === a).map((e) => {
33
+ let a = e.points.filter((t) => e.source !== "INVOICE" || t.monthlyAmount !== null).map((e) => ({
34
+ at: e.observedAt,
35
+ value: e.monthlyAmount,
36
+ title: `${n(e.observedAt)} · ${t(e.amount, e.currency)}${i(e.interval)}`
37
+ }));
38
+ if (e.source === "RELATIONSHIP" && e.relationshipId) for (let t of o.get(e.relationshipId) ?? []) a.push({
39
+ at: t,
40
+ value: null
41
+ });
42
+ return {
43
+ key: e.key,
44
+ label: e.source === "INVOICE" ? r("providers.insights.invoiceSeries", "{{label}} (invoices)", { label: e.label.replace(/ \(invoices\)$/, "") }) : e.label,
45
+ mode: e.source === "INVOICE" ? "dots" : "step",
46
+ points: a
47
+ };
48
+ }).filter((e) => e.points.some((e) => e.value !== null));
49
+ }
50
+ function E({ providerId: r }) {
51
+ let s = a(), { navigateTo: p } = e(), { data: g, isLoading: _, isError: E, refetch: D } = m(r), O = h(() => g ? T(g, s) : [], [g, s]), k = h(() => g ? [...g.points].reverse().slice(0, S) : [], [g]), A = g?.summary ?? null, j = A?.currency ?? "USD", M = h(() => {
52
+ let e = /* @__PURE__ */ new Map();
53
+ for (let t of g?.series ?? []) {
54
+ let n = t.points[t.points.length - 1];
55
+ if (t.source !== "RELATIONSHIP" || !n) continue;
56
+ let r = t.relationshipId ?? t.key, i = e.get(r);
57
+ (!i || Date.parse(n.observedAt) > Date.parse(i.at)) && e.set(r, {
58
+ at: n.observedAt,
59
+ series: t
60
+ });
61
+ }
62
+ let t = [...e.values()].map((e) => e.series).filter((e) => e.currency === j && e.latestMonthlyAmount != null);
63
+ if (t.length === 0) return null;
64
+ let n = t.reduce((e, t) => e + (t.latestMonthlyAmount ?? 0), 0);
65
+ return {
66
+ amount: Math.round(n * 100) / 100,
67
+ count: t.length
68
+ };
69
+ }, [g, j]);
70
+ return /* @__PURE__ */ y(d, {
71
+ title: s("providers.insights.priceHistoryTitle", "Your price history"),
72
+ description: s("providers.insights.priceHistoryDescription", "What this workspace has paid this provider over time, per month"),
73
+ children: /* @__PURE__ */ y(x, {
74
+ treatment: "metric",
75
+ className: "p-5",
76
+ "data-testid": "provider-price-history",
77
+ children: _ ? /* @__PURE__ */ y(u, {
78
+ className: "min-h-[10rem]",
79
+ label: s("providers.insights.priceHistoryLoading", "Loading price history…")
80
+ }) : E ? /* @__PURE__ */ y(l, {
81
+ className: "min-h-[10rem]",
82
+ title: s("providers.insights.priceHistoryErrorTitle", "Price history unavailable"),
83
+ message: s("providers.insights.priceHistoryError", "Could not load what this workspace has paid this provider."),
84
+ onRetry: () => void D()
85
+ }) : !g || !A ? /* @__PURE__ */ y(c, {
86
+ illustration: "empty-data",
87
+ title: s("providers.insights.priceHistoryEmptyTitle", "No prices recorded yet"),
88
+ description: s("providers.insights.priceHistoryEmpty", "Link a relationship to this provider and its price, and every later change, will be charted here.")
89
+ }) : /* @__PURE__ */ b(v, { children: [
90
+ /* @__PURE__ */ b("div", {
91
+ className: "flex flex-wrap items-start gap-x-8 gap-y-3",
92
+ children: [
93
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
94
+ className: "text-xs text-text-secondary",
95
+ children: M && M.count > 1 ? s("providers.insights.latestMonthlyTotal", "Latest monthly price across {{count}} relationships", { count: M.count }) : s("providers.insights.latestMonthly", "Latest monthly price")
96
+ }), /* @__PURE__ */ b("p", {
97
+ className: "text-2xl font-bold tabular-nums text-text-primary",
98
+ children: [M ? t(M.amount, j) : "—", /* @__PURE__ */ y("span", {
99
+ className: "text-sm font-normal text-text-secondary",
100
+ children: "/mo"
101
+ })]
102
+ })] }),
103
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
104
+ className: "text-xs text-text-secondary",
105
+ children: s("providers.insights.range", "Range paid")
106
+ }), /* @__PURE__ */ y("p", {
107
+ className: "text-sm font-medium tabular-nums text-text-primary",
108
+ children: A.minMonthlyAmount != null && A.maxMonthlyAmount != null ? `${t(A.minMonthlyAmount, j)} – ${t(A.maxMonthlyAmount, j)}` : "—"
109
+ })] }),
110
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
111
+ className: "text-xs text-text-secondary",
112
+ children: s("providers.insights.priceChanges", "Price changes")
113
+ }), /* @__PURE__ */ y("p", {
114
+ className: "text-sm font-medium tabular-nums text-text-primary",
115
+ children: A.priceChangeCount
116
+ })] }),
117
+ A.latestChangePercent != null && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
118
+ className: "text-xs text-text-secondary",
119
+ children: s("providers.insights.latestChange", "Latest change")
120
+ }), /* @__PURE__ */ b("span", {
121
+ className: o("mt-0.5 inline-block rounded-full px-2 py-0.5 text-xs font-medium tabular-nums", C(A.latestChangePercent)),
122
+ children: [w(A.latestChangePercent), A.latestChangeAt && ` · ${n(A.latestChangeAt)}`]
123
+ })] })
124
+ ]
125
+ }),
126
+ O.length > 0 ? /* @__PURE__ */ y(f, {
127
+ className: "mt-4",
128
+ series: O,
129
+ now: /* @__PURE__ */ new Date(),
130
+ ariaLabel: s("providers.insights.chartLabel", "Monthly price paid over time, in {{currency}}", { currency: j }),
131
+ valueFormat: (e) => t(e, j, { maximumFractionDigits: 0 }),
132
+ dateFormat: (e) => n(e, {
133
+ day: void 0,
134
+ month: "short",
135
+ year: "numeric"
136
+ })
137
+ }) : /* @__PURE__ */ y("p", {
138
+ className: "mt-4 text-sm text-text-secondary",
139
+ children: s("providers.insights.noRecurring", "These prices are not recurring, so there is no monthly trend to chart.")
140
+ }),
141
+ /* @__PURE__ */ y("ul", {
142
+ className: "mt-4 divide-y divide-border-subtle border-t border-border-subtle",
143
+ children: k.map((e) => /* @__PURE__ */ b("li", {
144
+ className: "flex flex-wrap items-center justify-between gap-2 py-2 text-sm",
145
+ children: [/* @__PURE__ */ b("span", {
146
+ className: "flex min-w-0 items-center gap-2",
147
+ children: [
148
+ /* @__PURE__ */ y("span", {
149
+ className: "w-24 shrink-0 tabular-nums text-text-secondary",
150
+ children: n(e.observedAt)
151
+ }),
152
+ e.relationshipId ? /* @__PURE__ */ y("button", {
153
+ type: "button",
154
+ onClick: () => p(`/relationships/${e.relationshipId}`),
155
+ className: "truncate text-text-link hover:underline",
156
+ children: e.label ?? s("providers.insights.untitled", "Untitled")
157
+ }) : /* @__PURE__ */ y("span", {
158
+ className: "truncate text-text-primary",
159
+ children: e.label ?? s("providers.insights.removedRelationship", "Removed relationship")
160
+ }),
161
+ /* @__PURE__ */ y("span", {
162
+ className: "rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary",
163
+ children: e.source === "INVOICE" ? s("providers.insights.sourceInvoice", "Invoice") : s("providers.insights.sourceRecorded", "Recorded price")
164
+ })
165
+ ]
166
+ }), /* @__PURE__ */ b("span", {
167
+ className: "font-medium tabular-nums text-text-primary",
168
+ children: [t(e.amount, e.currency), /* @__PURE__ */ y("span", {
169
+ className: "text-xs font-normal text-text-secondary",
170
+ children: i(e.interval)
171
+ })]
172
+ })]
173
+ }, e.id))
174
+ })
175
+ ] })
176
+ })
177
+ });
178
+ }
179
+ function D({ range: e }) {
180
+ let n = a();
181
+ return /* @__PURE__ */ b("span", {
182
+ className: "tabular-nums",
183
+ children: [
184
+ e.minMonthlyAmount === e.maxMonthlyAmount ? t(e.minMonthlyAmount, e.currency) : `${t(e.minMonthlyAmount, e.currency)} – ${t(e.maxMonthlyAmount, e.currency)}`,
185
+ /* @__PURE__ */ y("span", {
186
+ className: "text-xs text-text-secondary",
187
+ children: "/mo"
188
+ }),
189
+ " ",
190
+ /* @__PURE__ */ y("span", {
191
+ className: "text-xs text-text-secondary",
192
+ children: e.basis === "PLANS" ? n("providers.insights.basisPlans", "({{count}} plans)", { count: e.count }) : n("providers.insights.basisRelationships", "(what you pay)")
193
+ })
194
+ ]
195
+ });
196
+ }
197
+ function O({ alt: n }) {
198
+ let c = a(), { navigateTo: l } = e(), u = n.priceRanges[0];
199
+ return /* @__PURE__ */ b("li", {
200
+ className: "py-4 first:pt-0 last:pb-0",
201
+ "data-testid": "provider-alternative",
202
+ children: [/* @__PURE__ */ b("div", {
203
+ className: "flex flex-wrap items-start justify-between gap-3",
204
+ children: [/* @__PURE__ */ b("div", {
205
+ className: "min-w-0",
206
+ children: [/* @__PURE__ */ b("button", {
207
+ type: "button",
208
+ onClick: () => l(`/providers/${n.providerId}`),
209
+ className: "inline-flex items-center gap-1 text-sm font-semibold text-text-link hover:underline",
210
+ children: [
211
+ n.name,
212
+ " ",
213
+ /* @__PURE__ */ y(g, { className: "h-3.5 w-3.5" })
214
+ ]
215
+ }), /* @__PURE__ */ b("div", {
216
+ className: "mt-1 flex flex-wrap items-center gap-1.5",
217
+ children: [
218
+ n.provider && /* @__PURE__ */ y(s, { status: n.provider.status }),
219
+ /* @__PURE__ */ y("span", {
220
+ className: "rounded-full border border-border-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary",
221
+ children: n.matchReason === "CAPABILITY" ? c("providers.insights.matchCapability", "Same capability") : c("providers.insights.matchCategory", "Same category")
222
+ }),
223
+ n.capabilities.map((e) => /* @__PURE__ */ y("span", {
224
+ className: o("rounded-full px-2 py-0.5 text-[11px]", n.sharedCapabilities.includes(e) ? "bg-[var(--color-accent-soft)] font-medium text-text-primary" : "bg-bg-sunken text-text-secondary"),
225
+ children: r(e.replace(/-/g, "_"))
226
+ }, e))
227
+ ]
228
+ })]
229
+ }), /* @__PURE__ */ b("div", {
230
+ className: "text-right text-sm text-text-primary",
231
+ children: [u ? /* @__PURE__ */ y(D, { range: u }) : /* @__PURE__ */ y("span", {
232
+ className: "text-text-secondary",
233
+ children: c("providers.insights.noPrice", "No price on record")
234
+ }), /* @__PURE__ */ y("p", {
235
+ className: "mt-0.5 text-xs text-text-secondary",
236
+ children: n.activeRelationshipCount > 0 ? c("providers.insights.inUse", "In use · {{active}} of {{tracked}} active", {
237
+ active: n.activeRelationshipCount,
238
+ tracked: n.trackedRelationshipCount
239
+ }) : n.trackedRelationshipCount > 0 ? c("providers.insights.trackedOnly", "{{tracked}} tracked, none active", { tracked: n.trackedRelationshipCount }) : c("providers.insights.notUsed", "Not used in this workspace")
240
+ })]
241
+ })]
242
+ }), n.relationships.length > 0 && /* @__PURE__ */ y("ul", {
243
+ className: "mt-2 flex flex-wrap gap-2",
244
+ children: n.relationships.map((e) => /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
245
+ type: "button",
246
+ onClick: () => l(`/relationships/${e.id}`),
247
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2 py-1 text-xs text-text-primary hover:bg-bg-sunken",
248
+ children: [
249
+ /* @__PURE__ */ y("span", {
250
+ className: "truncate",
251
+ children: e.label
252
+ }),
253
+ /* @__PURE__ */ b("span", {
254
+ className: "tabular-nums text-text-secondary",
255
+ children: [t(e.amount, e.currency), i(e.interval)]
256
+ }),
257
+ /* @__PURE__ */ y(s, { status: e.status })
258
+ ]
259
+ }) }, e.id))
260
+ })]
261
+ });
262
+ }
263
+ function k({ providerId: e }) {
264
+ let t = a(), { data: n, isLoading: r, isError: i, refetch: o } = p(e);
265
+ return /* @__PURE__ */ y(d, {
266
+ title: t("providers.insights.alternativesTitle", "Alternatives"),
267
+ description: t("providers.insights.alternativesDescription", "Providers in your registry that cover the same need, the ones you already use first"),
268
+ children: /* @__PURE__ */ y(x, {
269
+ treatment: "metric",
270
+ className: "p-5",
271
+ "data-testid": "provider-alternatives",
272
+ children: r ? /* @__PURE__ */ y(u, {
273
+ className: "min-h-[8rem]",
274
+ label: t("providers.insights.alternativesLoading", "Finding alternatives…")
275
+ }) : i ? /* @__PURE__ */ y(l, {
276
+ className: "min-h-[8rem]",
277
+ title: t("providers.insights.alternativesErrorTitle", "Alternatives unavailable"),
278
+ message: t("providers.insights.alternativesError", "Could not look up alternative providers."),
279
+ onRetry: () => void o()
280
+ }) : !n || n.length === 0 ? /* @__PURE__ */ b("div", {
281
+ className: "flex items-start gap-3 text-sm text-text-secondary",
282
+ children: [/* @__PURE__ */ y(_, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ y("p", { children: t("providers.insights.alternativesEmpty", "No comparable providers yet. Tag providers with capabilities (for example capability:design) or give them a specific category to see alternatives here.") })]
283
+ }) : /* @__PURE__ */ y("ul", {
284
+ className: "divide-y divide-border-subtle",
285
+ children: n.map((e) => /* @__PURE__ */ y(O, { alt: e }, e.providerId))
286
+ })
287
+ })
288
+ });
289
+ }
290
+ //#endregion
291
+ export { k as ProviderAlternatives, E as ProviderPaidPriceHistory };
292
+
293
+ //# sourceMappingURL=ProviderInsights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProviderInsights.js","names":[],"sources":["../../../../src/subscriberbot/pages/providers/ProviderInsights.tsx"],"sourcesContent":["/**\n * Provider insights for the provider detail page (BOFF-4003)\n * @module subscriberbot/pages/providers\n *\n * Two sections that turn the provider page into a renewal decision surface:\n *\n * - `ProviderPaidPriceHistory` charts what this workspace has paid the\n * provider over time (`subProviderPriceHistory`): every recorded price of a\n * relationship with it, plus the invoices charged against them.\n * - `ProviderAlternatives` lists registry providers that could replace it\n * (`subProviderAlternatives`), ranked by shared capability tags, then\n * category, with providers the workspace already uses first.\n *\n * Amounts in different currencies are never drawn on one chart: the chart\n * shows the currency the backend summary picked (the most observed one).\n */\n\nimport { useMemo } from 'react';\nimport { ArrowRight, Shuffle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView, Section } from '../../components/StateViews';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { PriceHistoryChart, type PriceChartSeries } from '../../components';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useProviderAlternatives, useProviderPriceHistory } from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\nimport {\n formatCurrency,\n formatDate,\n formatEnumLabel,\n formatIntervalSuffix,\n} from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type {\n SubPriceRange,\n SubProviderAlternative,\n SubProviderPriceHistory,\n SubProviderPriceSeries,\n} from '../../types';\n\n/** Points listed under the chart, newest first. */\nconst RECENT_POINTS = 6;\n\nfunction changeTone(percent: number | null): string {\n if (percent === null || percent === 0) return 'bg-bg-sunken text-text-secondary';\n return percent > 0\n ? 'bg-status-error-bg-subtle text-status-error-text'\n : 'bg-status-success-bg-subtle text-status-success-text';\n}\n\nfunction formatPercent(percent: number): string {\n return `${percent > 0 ? '+' : ''}${percent}%`;\n}\n\nfunction chartSeries(\n history: SubProviderPriceHistory,\n tr: ReturnType<typeof useTr>\n): PriceChartSeries[] {\n const currency = history.summary?.currency;\n if (!currency) return [];\n // A relationship's recorded prices are split per currency. When it moved to\n // another currency, that later price ends the displayed segment, exactly\n // like a non-recurring price does: the old currency's line must not run on.\n const otherCurrencyTimes = new Map<string, string[]>();\n for (const s of history.series) {\n if (s.source !== 'RELATIONSHIP' || s.currency === currency || !s.relationshipId) continue;\n const list = otherCurrencyTimes.get(s.relationshipId) ?? [];\n list.push(...s.points.map((p) => p.observedAt));\n otherCurrencyTimes.set(s.relationshipId, list);\n }\n return history.series\n .filter((s) => s.currency === currency)\n .map((s) => {\n // Recorded prices keep their non-recurring points (null value) so the\n // step line ends where a lifetime or usage-based price took over;\n // invoice dots without a monthly equivalent are simply not drawn.\n const points: PriceChartSeries['points'] = s.points\n .filter((p) => s.source !== 'INVOICE' || p.monthlyAmount !== null)\n .map((p) => ({\n at: p.observedAt,\n value: p.monthlyAmount,\n title: `${formatDate(p.observedAt)} · ${formatCurrency(p.amount, p.currency)}${formatIntervalSuffix(p.interval)}`,\n }));\n if (s.source === 'RELATIONSHIP' && s.relationshipId) {\n for (const at of otherCurrencyTimes.get(s.relationshipId) ?? []) {\n points.push({ at, value: null });\n }\n }\n return {\n key: s.key,\n label:\n s.source === 'INVOICE'\n ? tr('providers.insights.invoiceSeries', '{{label}} (invoices)', {\n label: s.label.replace(/ \\(invoices\\)$/, ''),\n })\n : s.label,\n mode: s.source === 'INVOICE' ? ('dots' as const) : ('step' as const),\n points,\n };\n })\n .filter((s) => s.points.some((p) => p.value !== null));\n}\n\n// ---------------------------------------------------------------------------\n// Price history — what this workspace has paid the provider\n// ---------------------------------------------------------------------------\nexport function ProviderPaidPriceHistory({ providerId }: { providerId: string }) {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const { data, isLoading, isError, refetch } = useProviderPriceHistory(providerId);\n\n const series = useMemo(() => (data ? chartSeries(data, tr) : []), [data, tr]);\n const recent = useMemo(\n () => (data ? [...data.points].reverse().slice(0, RECENT_POINTS) : []),\n [data]\n );\n const summary = data?.summary ?? null;\n const currency = summary?.currency ?? 'USD';\n // Every relationship tracked under this provider contributes its latest\n // recorded price, so the headline is the workspace's total per month rather\n // than whichever relationship happens to come first.\n const latestTotal = useMemo(() => {\n // Each relationship's current price is its latest recorded point across\n // every currency; only those now priced in the display currency count.\n const latestByRelationship = new Map<string, { at: string; series: SubProviderPriceSeries }>();\n for (const s of data?.series ?? []) {\n const last = s.points[s.points.length - 1];\n if (s.source !== 'RELATIONSHIP' || !last) continue;\n const key = s.relationshipId ?? s.key;\n const seen = latestByRelationship.get(key);\n if (!seen || Date.parse(last.observedAt) > Date.parse(seen.at))\n latestByRelationship.set(key, { at: last.observedAt, series: s });\n }\n const recorded = [...latestByRelationship.values()]\n .map((v) => v.series)\n .filter((s) => s.currency === currency && s.latestMonthlyAmount != null);\n if (recorded.length === 0) return null;\n const amount = recorded.reduce((sum, s) => sum + (s.latestMonthlyAmount ?? 0), 0);\n return { amount: Math.round(amount * 100) / 100, count: recorded.length };\n }, [data, currency]);\n\n return (\n <Section\n title={tr('providers.insights.priceHistoryTitle', 'Your price history')}\n description={tr(\n 'providers.insights.priceHistoryDescription',\n 'What this workspace has paid this provider over time, per month'\n )}\n >\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"provider-price-history\">\n {isLoading ? (\n <LoadingView\n className=\"min-h-[10rem]\"\n label={tr('providers.insights.priceHistoryLoading', 'Loading price history…')}\n />\n ) : isError ? (\n <ErrorView\n className=\"min-h-[10rem]\"\n title={tr('providers.insights.priceHistoryErrorTitle', 'Price history unavailable')}\n message={tr(\n 'providers.insights.priceHistoryError',\n 'Could not load what this workspace has paid this provider.'\n )}\n onRetry={() => void refetch()}\n />\n ) : !data || !summary ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('providers.insights.priceHistoryEmptyTitle', 'No prices recorded yet')}\n description={tr(\n 'providers.insights.priceHistoryEmpty',\n 'Link a relationship to this provider and its price, and every later change, will be charted here.'\n )}\n />\n ) : (\n <>\n <div className=\"flex flex-wrap items-start gap-x-8 gap-y-3\">\n <div>\n <p className=\"text-xs text-text-secondary\">\n {latestTotal && latestTotal.count > 1\n ? tr(\n 'providers.insights.latestMonthlyTotal',\n 'Latest monthly price across {{count}} relationships',\n { count: latestTotal.count }\n )\n : tr('providers.insights.latestMonthly', 'Latest monthly price')}\n </p>\n <p className=\"text-2xl font-bold tabular-nums text-text-primary\">\n {latestTotal ? formatCurrency(latestTotal.amount, currency) : '—'}\n <span className=\"text-sm font-normal text-text-secondary\">/mo</span>\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.range', 'Range paid')}\n </p>\n <p className=\"text-sm font-medium tabular-nums text-text-primary\">\n {summary.minMonthlyAmount != null && summary.maxMonthlyAmount != null\n ? `${formatCurrency(summary.minMonthlyAmount, currency)} – ${formatCurrency(summary.maxMonthlyAmount, currency)}`\n : '—'}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.priceChanges', 'Price changes')}\n </p>\n <p className=\"text-sm font-medium tabular-nums text-text-primary\">\n {summary.priceChangeCount}\n </p>\n </div>\n {summary.latestChangePercent != null && (\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.latestChange', 'Latest change')}\n </p>\n <span\n className={cn(\n 'mt-0.5 inline-block rounded-full px-2 py-0.5 text-xs font-medium tabular-nums',\n changeTone(summary.latestChangePercent)\n )}\n >\n {formatPercent(summary.latestChangePercent)}\n {summary.latestChangeAt && ` · ${formatDate(summary.latestChangeAt)}`}\n </span>\n </div>\n )}\n </div>\n\n {series.length > 0 ? (\n <PriceHistoryChart\n className=\"mt-4\"\n series={series}\n now={new Date()}\n ariaLabel={tr(\n 'providers.insights.chartLabel',\n 'Monthly price paid over time, in {{currency}}',\n { currency }\n )}\n valueFormat={(n) => formatCurrency(n, currency, { maximumFractionDigits: 0 })}\n dateFormat={(d) =>\n formatDate(d, { day: undefined, month: 'short', year: 'numeric' })\n }\n />\n ) : (\n <p className=\"mt-4 text-sm text-text-secondary\">\n {tr(\n 'providers.insights.noRecurring',\n 'These prices are not recurring, so there is no monthly trend to chart.'\n )}\n </p>\n )}\n\n <ul className=\"mt-4 divide-y divide-border-subtle border-t border-border-subtle\">\n {recent.map((point) => (\n <li\n key={point.id}\n className=\"flex flex-wrap items-center justify-between gap-2 py-2 text-sm\"\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className=\"w-24 shrink-0 tabular-nums text-text-secondary\">\n {formatDate(point.observedAt)}\n </span>\n {point.relationshipId ? (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${point.relationshipId}`)}\n className=\"truncate text-text-link hover:underline\"\n >\n {point.label ?? tr('providers.insights.untitled', 'Untitled')}\n </button>\n ) : (\n <span className=\"truncate text-text-primary\">\n {point.label ??\n tr('providers.insights.removedRelationship', 'Removed relationship')}\n </span>\n )}\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary\">\n {point.source === 'INVOICE'\n ? tr('providers.insights.sourceInvoice', 'Invoice')\n : tr('providers.insights.sourceRecorded', 'Recorded price')}\n </span>\n </span>\n <span className=\"font-medium tabular-nums text-text-primary\">\n {formatCurrency(point.amount, point.currency)}\n <span className=\"text-xs font-normal text-text-secondary\">\n {formatIntervalSuffix(point.interval)}\n </span>\n </span>\n </li>\n ))}\n </ul>\n </>\n )}\n </GlassCard>\n </Section>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Alternatives — registry providers that could replace this one\n// ---------------------------------------------------------------------------\nfunction PriceRangeText({ range }: { range: SubPriceRange }) {\n const tr = useTr();\n const value =\n range.minMonthlyAmount === range.maxMonthlyAmount\n ? formatCurrency(range.minMonthlyAmount, range.currency)\n : `${formatCurrency(range.minMonthlyAmount, range.currency)} – ${formatCurrency(range.maxMonthlyAmount, range.currency)}`;\n return (\n <span className=\"tabular-nums\">\n {value}\n <span className=\"text-xs text-text-secondary\">/mo</span>{' '}\n <span className=\"text-xs text-text-secondary\">\n {range.basis === 'PLANS'\n ? tr('providers.insights.basisPlans', '({{count}} plans)', { count: range.count })\n : tr('providers.insights.basisRelationships', '(what you pay)')}\n </span>\n </span>\n );\n}\n\nfunction AlternativeRow({ alt }: { alt: SubProviderAlternative }) {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const range = alt.priceRanges[0];\n return (\n <li className=\"py-4 first:pt-0 last:pb-0\" data-testid=\"provider-alternative\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/providers/${alt.providerId}`)}\n className=\"inline-flex items-center gap-1 text-sm font-semibold text-text-link hover:underline\"\n >\n {alt.name} <ArrowRight className=\"h-3.5 w-3.5\" />\n </button>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5\">\n {alt.provider && <StatusBadge status={alt.provider.status} />}\n <span className=\"rounded-full border border-border-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary\">\n {alt.matchReason === 'CAPABILITY'\n ? tr('providers.insights.matchCapability', 'Same capability')\n : tr('providers.insights.matchCategory', 'Same category')}\n </span>\n {alt.capabilities.map((cap) => (\n <span\n key={cap}\n className={cn(\n 'rounded-full px-2 py-0.5 text-[11px]',\n alt.sharedCapabilities.includes(cap)\n ? 'bg-[var(--color-accent-soft)] font-medium text-text-primary'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {formatEnumLabel(cap.replace(/-/g, '_'))}\n </span>\n ))}\n </div>\n </div>\n <div className=\"text-right text-sm text-text-primary\">\n {range ? (\n <PriceRangeText range={range} />\n ) : (\n <span className=\"text-text-secondary\">\n {tr('providers.insights.noPrice', 'No price on record')}\n </span>\n )}\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {alt.activeRelationshipCount > 0\n ? tr('providers.insights.inUse', 'In use · {{active}} of {{tracked}} active', {\n active: alt.activeRelationshipCount,\n tracked: alt.trackedRelationshipCount,\n })\n : alt.trackedRelationshipCount > 0\n ? tr('providers.insights.trackedOnly', '{{tracked}} tracked, none active', {\n tracked: alt.trackedRelationshipCount,\n })\n : tr('providers.insights.notUsed', 'Not used in this workspace')}\n </p>\n </div>\n </div>\n {alt.relationships.length > 0 && (\n <ul className=\"mt-2 flex flex-wrap gap-2\">\n {alt.relationships.map((rel) => (\n <li key={rel.id}>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${rel.id}`)}\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2 py-1 text-xs text-text-primary hover:bg-bg-sunken\"\n >\n <span className=\"truncate\">{rel.label}</span>\n <span className=\"tabular-nums text-text-secondary\">\n {formatCurrency(rel.amount, rel.currency)}\n {formatIntervalSuffix(rel.interval)}\n </span>\n <StatusBadge status={rel.status} />\n </button>\n </li>\n ))}\n </ul>\n )}\n </li>\n );\n}\n\nexport function ProviderAlternatives({ providerId }: { providerId: string }) {\n const tr = useTr();\n const { data, isLoading, isError, refetch } = useProviderAlternatives(providerId);\n\n return (\n <Section\n title={tr('providers.insights.alternativesTitle', 'Alternatives')}\n description={tr(\n 'providers.insights.alternativesDescription',\n 'Providers in your registry that cover the same need, the ones you already use first'\n )}\n >\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"provider-alternatives\">\n {isLoading ? (\n <LoadingView\n className=\"min-h-[8rem]\"\n label={tr('providers.insights.alternativesLoading', 'Finding alternatives…')}\n />\n ) : isError ? (\n <ErrorView\n className=\"min-h-[8rem]\"\n title={tr('providers.insights.alternativesErrorTitle', 'Alternatives unavailable')}\n message={tr(\n 'providers.insights.alternativesError',\n 'Could not look up alternative providers.'\n )}\n onRetry={() => void refetch()}\n />\n ) : !data || data.length === 0 ? (\n <div className=\"flex items-start gap-3 text-sm text-text-secondary\">\n <Shuffle className=\"mt-0.5 h-4 w-4 shrink-0\" />\n <p>\n {tr(\n 'providers.insights.alternativesEmpty',\n 'No comparable providers yet. Tag providers with capabilities (for example capability:design) or give them a specific category to see alternatives here.'\n )}\n </p>\n </div>\n ) : (\n <ul className=\"divide-y divide-border-subtle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,QAAD;MAAM,WAAU;gBAAhB,CACG,EAAe,EAAI,QAAQ,EAAI,QAAQ,GACvC,EAAqB,EAAI,QAAQ,CAC9B;;KACN,kBAAC,GAAD,EAAa,QAAQ,EAAI,OAAS,CAAA;IAC5B;MACN,GAbK,EAAI,EAaT,CACL;EACC,CAAA,CAEJ;;AAER;AAEA,SAAgB,EAAqB,EAAE,iBAAsC;CAC3E,IAAM,IAAK,EAAM,GACX,EAAE,SAAM,cAAW,YAAS,eAAY,EAAwB,CAAU;CAEhF,OACE,kBAAC,GAAD;EACE,OAAO,EAAG,wCAAwC,cAAc;EAChE,aAAa,EACX,8CACA,qFACF;YAEA,kBAAC,GAAD;GAAW,WAAU;GAAS,WAAU;GAAM,eAAY;aACvD,IACC,kBAAC,GAAD;IACE,WAAU;IACV,OAAO,EAAG,0CAA0C,uBAAuB;GAC5E,CAAA,IACC,IACF,kBAAC,GAAD;IACE,WAAU;IACV,OAAO,EAAG,6CAA6C,0BAA0B;IACjF,SAAS,EACP,wCACA,0CACF;IACA,eAAe,KAAK,EAAQ;GAC7B,CAAA,IACC,CAAC,KAAQ,EAAK,WAAW,IAC3B,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD,EAAS,WAAU,0BAA2B,CAAA,GAC9C,kBAAC,KAAD,EAAA,UACG,EACC,wCACA,yJACF,EACC,CAAA,CACA;QAEL,kBAAC,MAAD;IAAI,WAAU;cACX,EAAK,KAAK,MACT,kBAAC,GAAD,EAA0C,OAAM,GAA3B,EAAI,UAAuB,CACjD;GACC,CAAA;EAEG,CAAA;CACJ,CAAA;AAEb"}
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipNewPage.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/pages/relationships/RelationshipNewPage.tsx"],"names":[],"mappings":"AA2FA,wBAAgB,mBAAmB,gCAuXlC"}
1
+ {"version":3,"file":"RelationshipNewPage.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/pages/relationships/RelationshipNewPage.tsx"],"names":[],"mappings":"AA8FA,wBAAgB,mBAAmB,gCAiYlC"}
@@ -38,10 +38,11 @@ var v = [
38
38
  ENROLLMENT: "relationships.kinds.enrollment",
39
39
  TRIAL: "relationships.kinds.trial"
40
40
  }, x = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", S = "mb-1.5 block text-xs font-medium text-text-secondary";
41
- function C({ icon: e, title: t, description: n, children: r }) {
41
+ function C({ icon: e, title: t, description: n, children: r, dataTour: i }) {
42
42
  return /* @__PURE__ */ h(g, {
43
43
  treatment: "metric",
44
44
  className: "p-5 sm:p-6",
45
+ "data-tour": i,
45
46
  children: [/* @__PURE__ */ h("div", {
46
47
  className: "flex items-start gap-3",
47
48
  children: [/* @__PURE__ */ m("span", {
@@ -69,12 +70,14 @@ function w() {
69
70
  offset: 0
70
71
  } }), [O, k] = c(""), [A, j] = c("SUBSCRIPTION"), [M, N] = c(""), [P, F] = c(""), [I, L] = c(""), [R, z] = c("USD"), [B, V] = c("MONTHLY"), [H, U] = c(""), [W, G] = c(!0), [K, q] = c(""), [J, Y] = c(""), [X, Z, Q, te] = ee(), ne = o(M || void 0), re = D.data?.items ?? [], $ = ne.data ?? [];
71
72
  return D.isError ? /* @__PURE__ */ m(r, {
73
+ dataTour: "subscriberbot-relationship-new",
72
74
  title: w("relationships.new.title", "Add relationship"),
73
75
  children: /* @__PURE__ */ m(i, {
74
76
  message: w("relationships.new.providerError", "Could not load the provider registry."),
75
77
  onRetry: () => void D.refetch()
76
78
  })
77
79
  }) : /* @__PURE__ */ h(r, {
80
+ dataTour: "subscriberbot-relationship-new",
78
81
  title: w("relationships.new.title", "Add relationship"),
79
82
  description: w("relationships.new.description", "Track a new recurring digital relationship"),
80
83
  actions: /* @__PURE__ */ h("button", {
@@ -125,6 +128,7 @@ function w() {
125
128
  }),
126
129
  /* @__PURE__ */ m(C, {
127
130
  icon: /* @__PURE__ */ m(f, { className: "h-4 w-4" }),
131
+ dataTour: "subscriberbot-relationship-new-basics",
128
132
  title: w("relationships.new.basics.title", "Basics"),
129
133
  description: w("relationships.new.basics.description", "Name this relationship and choose what kind it is."),
130
134
  children: /* @__PURE__ */ h("div", {
@@ -191,6 +195,7 @@ function w() {
191
195
  }),
192
196
  /* @__PURE__ */ m(C, {
193
197
  icon: /* @__PURE__ */ m(u, { className: "h-4 w-4" }),
198
+ dataTour: "subscriberbot-relationship-new-provider-plan",
194
199
  title: w("relationships.new.providerPlan.title", "Provider & plan"),
195
200
  description: w("relationships.new.providerPlan.description", "Link this relationship to a provider and plan from the registry (optional)."),
196
201
  children: /* @__PURE__ */ h("div", {
@@ -237,6 +242,7 @@ function w() {
237
242
  }),
238
243
  /* @__PURE__ */ m(C, {
239
244
  icon: /* @__PURE__ */ m(p, { className: "h-4 w-4" }),
245
+ dataTour: "subscriberbot-relationship-new-pricing",
240
246
  title: w("relationships.new.pricing.title", "Pricing & billing"),
241
247
  description: w("relationships.new.pricing.description", "Set the price, cadence and next renewal so Subscriber Bot can track it."),
242
248
  children: /* @__PURE__ */ h("div", {
@@ -334,6 +340,7 @@ function w() {
334
340
  }),
335
341
  /* @__PURE__ */ h("div", {
336
342
  className: "flex flex-col gap-3 sm:flex-row",
343
+ "data-tour": "subscriberbot-relationship-new-actions",
337
344
  children: [/* @__PURE__ */ m("button", {
338
345
  type: "submit",
339
346
  disabled: E.isPending,
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipNewPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/relationships/RelationshipNewPage.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\nimport { useFormError } from '../../hooks/useFormError';\n/**\n * Create relationship\n * @module subscriberbot/pages/relationships\n *\n * Manual-add form for a recurring relationship AI can't auto-detect.\n * Writes `subCreateRelationship`. Provider + plan are optional pickers\n * sourced from the real registry (`subListProviders` / `subListPlans`).\n */\n\nimport { useState, type ReactNode } from 'react';\nimport { ArrowLeft, Tag, Building2, Wallet, StickyNote } from 'lucide-react';\nimport { GlassCard, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { ErrorView } from '../../components/StateViews';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useCreateRelationship, useProviders, usePlans } from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\n\nimport type {\n SubBillingInterval,\n SubCreateRelationshipInput,\n SubRelationshipKind,\n} from '../../types';\n\nconst KINDS: SubRelationshipKind[] = [\n 'SUBSCRIPTION',\n 'MEMBERSHIP',\n 'LICENSE',\n 'CONTRACT',\n 'NEWSLETTER',\n 'RECURRING_PAYMENT',\n 'ENROLLMENT',\n 'TRIAL',\n];\n\nconst INTERVALS: SubBillingInterval[] = [\n 'MONTHLY',\n 'YEARLY',\n 'QUARTERLY',\n 'WEEKLY',\n 'DAILY',\n 'USAGE_BASED',\n 'LIFETIME',\n 'FREE',\n];\n\nconst KIND_KEY: Record<SubRelationshipKind, string> = {\n SUBSCRIPTION: 'relationships.kinds.subscription',\n MEMBERSHIP: 'relationships.kinds.membership',\n LICENSE: 'relationships.kinds.license',\n CONTRACT: 'relationships.kinds.contract',\n NEWSLETTER: 'relationships.kinds.newsletter',\n RECURRING_PAYMENT: 'relationships.kinds.recurringPayment',\n ENROLLMENT: 'relationships.kinds.enrollment',\n TRIAL: 'relationships.kinds.trial',\n};\n\nconst inputCls =\n 'w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]';\nconst labelCls = 'mb-1.5 block text-xs font-medium text-text-secondary';\n\n/** Grouped form section on a glass surface. */\nfunction FormSection({\n icon,\n title,\n description,\n children,\n}: {\n icon: ReactNode;\n title: string;\n description: string;\n children: ReactNode;\n}) {\n return (\n <GlassCard treatment=\"metric\" className=\"p-5 sm:p-6\">\n <div className=\"flex items-start gap-3\">\n <span className=\"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary\">\n {icon}\n </span>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-text-primary\">{title}</h2>\n <p className=\"mt-0.5 text-xs text-text-secondary\">{description}</p>\n </div>\n </div>\n <div className=\"mt-4\">{children}</div>\n </GlassCard>\n );\n}\n\nexport function RelationshipNewPage() {\n const { formatEnumLabel } = useFormatters();\n\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const create = useCreateRelationship();\n const providersQ = useProviders({ pagination: { limit: 100, offset: 0 } });\n\n const [label, setLabel] = useState('');\n const [kind, setKind] = useState<SubRelationshipKind>('SUBSCRIPTION');\n const [providerId, setProviderId] = useState('');\n const [planId, setPlanId] = useState('');\n const [amount, setAmount] = useState('');\n const [currency, setCurrency] = useState('USD');\n const [interval, setInterval] = useState<SubBillingInterval>('MONTHLY');\n const [renewsAt, setRenewsAt] = useState('');\n const [autoRenew, setAutoRenew] = useState(true);\n const [notes, setNotes] = useState('');\n const [department, setDepartment] = useState('');\n const [formError, setFormError, fieldErrorProps, formErrorId] = useFormError();\n\n const plansQ = usePlans(providerId || undefined);\n const providers = providersQ.data?.items ?? [];\n const plans = plansQ.data ?? [];\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setFormError(null);\n if (!label.trim()) {\n setFormError(\n tr('relationships.new.basics.labelRequired', 'A label is required.'),\n 'rel-label'\n );\n return;\n }\n const input: SubCreateRelationshipInput = {\n label: label.trim(),\n kind,\n interval,\n autoRenew,\n currency: currency.trim() || 'USD',\n ...(providerId ? { providerId } : {}),\n ...(planId ? { planId } : {}),\n ...(amount ? { amount: Number(amount) } : {}),\n ...(renewsAt ? { renewsAt: new Date(renewsAt).toISOString() } : {}),\n ...(notes.trim() ? { notes: notes.trim() } : {}),\n ...(department.trim() ? { department: department.trim() } : {}),\n };\n create.mutate(input, {\n onSuccess: (rel) => navigateTo(`/relationships/${rel.id}`),\n onError: (err) =>\n setFormError(\n err instanceof Error\n ? err.message\n : tr('relationships.new.error', 'Could not create relationship.')\n ),\n });\n };\n\n if (providersQ.isError) {\n return (\n <PageLayout title={tr('relationships.new.title', 'Add relationship')}>\n <ErrorView\n message={tr('relationships.new.providerError', 'Could not load the provider registry.')}\n onRetry={() => void providersQ.refetch()}\n />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={tr('relationships.new.title', 'Add relationship')}\n description={tr(\n 'relationships.new.description',\n 'Track a new recurring digital relationship'\n )}\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <ArrowLeft className=\"rtl:rotate-180 h-4 w-4\" /> {tr('relationships.new.back', 'Back')}\n </button>\n }\n >\n <PagePurpose className=\"mb-6\">\n {tr(\n 'relationships.new.purpose',\n 'Manually add a subscription, membership, license or contract. Link it to a provider and plan from the registry, set the price and renewal date, and Subscriber Bot will track its lifecycle from here.'\n )}\n </PagePurpose>\n\n <form onSubmit={handleSubmit} className=\"max-w-3xl space-y-5\">\n {formError && (\n <div\n id={formErrorId}\n tabIndex={-1}\n role=\"alert\"\n className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {formError}\n </div>\n )}\n\n {/* Basics */}\n <FormSection\n icon={<Tag className=\"h-4 w-4\" />}\n title={tr('relationships.new.basics.title', 'Basics')}\n description={tr(\n 'relationships.new.basics.description',\n 'Name this relationship and choose what kind it is.'\n )}\n >\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"rel-label\" className={labelCls}>\n {tr('relationships.new.basics.labelLabel', 'Label')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n {...fieldErrorProps('rel-label')}\n id=\"rel-label\"\n type=\"text\"\n value={label}\n onChange={(e) => setLabel(e.target.value)}\n placeholder={tr(\n 'relationships.new.basics.labelPlaceholder',\n 'e.g. Netflix Premium, AWS Production'\n )}\n className={inputCls}\n required\n />\n </div>\n <div className=\"max-w-xs\">\n <label htmlFor=\"rel-kind\" className={labelCls}>\n {tr('relationships.new.basics.kindLabel', 'Kind')}\n </label>\n <select\n {...fieldErrorProps('rel-kind')}\n id=\"rel-kind\"\n value={kind}\n onChange={(e) => setKind(e.target.value as SubRelationshipKind)}\n className={inputCls}\n >\n {KINDS.map((k) => (\n <option key={k} value={k}>\n {tr(KIND_KEY[k], formatEnumLabel(k))}\n </option>\n ))}\n </select>\n </div>\n <div className=\"max-w-xs\">\n <label htmlFor=\"rel-department\" className={labelCls}>\n {tr('relationships.new.basics.departmentLabel', 'Department or team')}\n </label>\n <input\n {...fieldErrorProps('rel-department')}\n id=\"rel-department\"\n type=\"text\"\n maxLength={120}\n value={department}\n onChange={(e) => setDepartment(e.target.value)}\n placeholder={tr(\n 'relationships.new.basics.departmentPlaceholder',\n 'e.g. Engineering, Marketing'\n )}\n className={inputCls}\n />\n </div>\n </div>\n </FormSection>\n\n {/* Provider & plan */}\n <FormSection\n icon={<Building2 className=\"h-4 w-4\" />}\n title={tr('relationships.new.providerPlan.title', 'Provider & plan')}\n description={tr(\n 'relationships.new.providerPlan.description',\n 'Link this relationship to a provider and plan from the registry (optional).'\n )}\n >\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"rel-provider\" className={labelCls}>\n {tr('relationships.new.providerPlan.providerLabel', 'Provider')}\n </label>\n <select\n {...fieldErrorProps('rel-provider')}\n id=\"rel-provider\"\n value={providerId}\n onChange={(e) => {\n setProviderId(e.target.value);\n setPlanId('');\n }}\n className={inputCls}\n >\n <option value=\"\">\n {tr('relationships.new.providerPlan.providerNone', '— None —')}\n </option>\n {providers.map((p) => (\n <option key={p.id} value={p.id}>\n {p.name}\n </option>\n ))}\n </select>\n </div>\n <div>\n <label htmlFor=\"rel-plan\" className={labelCls}>\n {tr('relationships.new.providerPlan.planLabel', 'Plan')}\n </label>\n <select\n {...fieldErrorProps('rel-plan')}\n id=\"rel-plan\"\n value={planId}\n onChange={(e) => setPlanId(e.target.value)}\n className={inputCls}\n disabled={!providerId || plans.length === 0}\n >\n <option value=\"\">\n {providerId\n ? plans.length === 0\n ? tr('relationships.new.providerPlan.noPlans', 'No plans available')\n : tr('relationships.new.providerPlan.planNone', '— None —')\n : tr(\n 'relationships.new.providerPlan.selectProviderFirst',\n 'Select a provider first'\n )}\n </option>\n {plans.map((pl) => (\n <option key={pl.id} value={pl.id}>\n {pl.name}\n </option>\n ))}\n </select>\n </div>\n </div>\n </FormSection>\n\n {/* Pricing & billing */}\n <FormSection\n icon={<Wallet className=\"h-4 w-4\" />}\n title={tr('relationships.new.pricing.title', 'Pricing & billing')}\n description={tr(\n 'relationships.new.pricing.description',\n 'Set the price, cadence and next renewal so Subscriber Bot can track it.'\n )}\n >\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <div>\n <label htmlFor=\"rel-amount\" className={labelCls}>\n {tr('relationships.new.pricing.amountLabel', 'Amount')}\n </label>\n <input\n {...fieldErrorProps('rel-amount')}\n id=\"rel-amount\"\n type=\"number\"\n min=\"0\"\n step=\"0.01\"\n value={amount}\n onChange={(e) => setAmount(e.target.value)}\n placeholder={tr('relationships.new.pricing.amountPlaceholder', '0.00')}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor=\"rel-currency\" className={labelCls}>\n {tr('relationships.new.pricing.currencyLabel', 'Currency')}\n </label>\n <input\n {...fieldErrorProps('rel-currency')}\n id=\"rel-currency\"\n type=\"text\"\n value={currency}\n onChange={(e) => setCurrency(e.target.value.toUpperCase())}\n placeholder={tr('relationships.new.pricing.currencyPlaceholder', 'USD')}\n maxLength={3}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor=\"rel-interval\" className={labelCls}>\n {tr('relationships.new.pricing.intervalLabel', 'Billing interval')}\n </label>\n <select\n {...fieldErrorProps('rel-interval')}\n id=\"rel-interval\"\n value={interval}\n onChange={(e) => setInterval(e.target.value as SubBillingInterval)}\n className={inputCls}\n >\n {INTERVALS.map((i) => (\n <option key={i} value={i}>\n {formatEnumLabel(i)}\n </option>\n ))}\n </select>\n </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"rel-renews\" className={labelCls}>\n {tr('relationships.new.pricing.renewsOnLabel', 'Renews on')}\n </label>\n <input\n {...fieldErrorProps('rel-renews')}\n id=\"rel-renews\"\n type=\"date\"\n value={renewsAt}\n onChange={(e) => setRenewsAt(e.target.value)}\n className={inputCls}\n />\n </div>\n <label className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 sm:mt-6\">\n <input\n type=\"checkbox\"\n checked={autoRenew}\n onChange={(e) => setAutoRenew(e.target.checked)}\n className=\"size-4 rounded border-border-subtle\"\n />\n <span className=\"text-sm text-text-primary\">\n {tr('relationships.new.pricing.autoRenews', 'Auto-renews')}\n </span>\n </label>\n </div>\n </div>\n </FormSection>\n\n {/* Notes */}\n <FormSection\n icon={<StickyNote className=\"h-4 w-4\" />}\n title={tr('relationships.new.notes.title', 'Notes')}\n description={tr(\n 'relationships.new.notes.description',\n 'Anything worth remembering about this relationship.'\n )}\n >\n <textarea\n {...fieldErrorProps('rel-notes')}\n id=\"rel-notes\"\n aria-label={tr('relationships.new.notes.title', 'Notes')}\n value={notes}\n onChange={(e) => setNotes(e.target.value)}\n rows={3}\n placeholder={tr(\n 'relationships.new.notes.placeholder',\n 'Anything worth remembering about this relationship…'\n )}\n className={inputCls}\n />\n </FormSection>\n\n <div className=\"flex flex-col gap-3 sm:flex-row\">\n <button\n type=\"submit\"\n disabled={create.isPending}\n className=\"rounded-lg bg-action-primary-bg px-5 py-2.5 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50\"\n >\n {create.isPending\n ? tr('relationships.new.creating', 'Creating…')\n : tr('relationships.new.submit', 'Create relationship')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"rounded-lg border border-border-subtle px-5 py-2.5 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('relationships.new.cancel', 'Cancel')}\n </button>\n </div>\n </form>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA0BA,IAAM,IAA+B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEM,IAAkC;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEM,IAAgD;CACpD,cAAc;CACd,YAAY;CACZ,SAAS;CACT,UAAU;CACV,YAAY;CACZ,mBAAmB;CACnB,YAAY;CACZ,OAAO;AACT,GAEM,IACJ,0MACI,IAAW;AAGjB,SAAS,EAAY,EACnB,SACA,UACA,gBACA,eAMC;CACD,OACE,kBAAC,GAAD;EAAW,WAAU;EAAS,WAAU;YAAxC,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD;IAAM,WAAU;cACb;GACG,CAAA,GACN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,MAAD;KAAI,WAAU;eAA2C;IAAU,CAAA,GACnE,kBAAC,KAAD;KAAG,WAAU;eAAsC;IAAe,CAAA,CAC/D;KACF;MACL,kBAAC,OAAD;GAAK,WAAU;GAAQ;EAAc,CAAA,CAC5B;;AAEf;AAEA,SAAgB,IAAsB;CACpC,IAAM,EAAE,uBAAoB,EAAc,GAEpC,IAAK,EAAM,GACX,EAAE,kBAAe,EAAiB,GAClC,IAAS,EAAsB,GAC/B,IAAa,EAAa,EAAE,YAAY;EAAE,OAAO;EAAK,QAAQ;CAAE,EAAE,CAAC,GAEnE,CAAC,GAAO,KAAY,EAAS,EAAE,GAC/B,CAAC,GAAM,KAAW,EAA8B,cAAc,GAC9D,CAAC,GAAY,KAAiB,EAAS,EAAE,GAC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uCACA,qDACF;eAEA,kBAAC,YAAD;MACE,GAAI,EAAgB,WAAW;MAC/B,IAAG;MACH,cAAY,EAAG,iCAAiC,OAAO;MACvD,OAAO;MACP,WAAW,MAAM,EAAS,EAAE,OAAO,KAAK;MACxC,MAAM;MACN,aAAa,EACX,uCACA,qDACF;MACA,WAAW;KACZ,CAAA;IACU,CAAA;IAEb,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,UAAD;MACE,MAAK;MACL,UAAU,EAAO;MACjB,WAAU;gBAET,EAAO,YACJ,EAAG,8BAA8B,WAAW,IAC5C,EAAG,4BAA4B,qBAAqB;KAClD,CAAA,GACR,kBAAC,UAAD;MACE,MAAK;MACL,eAAe,EAAW,gBAAgB;MAC1C,WAAU;gBAET,EAAG,4BAA4B,QAAQ;KAClC,CAAA,CACL;;GACD;IACI;;AAEhB"}
1
+ {"version":3,"file":"RelationshipNewPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/relationships/RelationshipNewPage.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\nimport { useFormError } from '../../hooks/useFormError';\n/**\n * Create relationship\n * @module subscriberbot/pages/relationships\n *\n * Manual-add form for a recurring relationship AI can't auto-detect.\n * Writes `subCreateRelationship`. Provider + plan are optional pickers\n * sourced from the real registry (`subListProviders` / `subListPlans`).\n */\n\nimport { useState, type ReactNode } from 'react';\nimport { ArrowLeft, Tag, Building2, Wallet, StickyNote } from 'lucide-react';\nimport { GlassCard, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { ErrorView } from '../../components/StateViews';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useCreateRelationship, useProviders, usePlans } from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\n\nimport type {\n SubBillingInterval,\n SubCreateRelationshipInput,\n SubRelationshipKind,\n} from '../../types';\n\nconst KINDS: SubRelationshipKind[] = [\n 'SUBSCRIPTION',\n 'MEMBERSHIP',\n 'LICENSE',\n 'CONTRACT',\n 'NEWSLETTER',\n 'RECURRING_PAYMENT',\n 'ENROLLMENT',\n 'TRIAL',\n];\n\nconst INTERVALS: SubBillingInterval[] = [\n 'MONTHLY',\n 'YEARLY',\n 'QUARTERLY',\n 'WEEKLY',\n 'DAILY',\n 'USAGE_BASED',\n 'LIFETIME',\n 'FREE',\n];\n\nconst KIND_KEY: Record<SubRelationshipKind, string> = {\n SUBSCRIPTION: 'relationships.kinds.subscription',\n MEMBERSHIP: 'relationships.kinds.membership',\n LICENSE: 'relationships.kinds.license',\n CONTRACT: 'relationships.kinds.contract',\n NEWSLETTER: 'relationships.kinds.newsletter',\n RECURRING_PAYMENT: 'relationships.kinds.recurringPayment',\n ENROLLMENT: 'relationships.kinds.enrollment',\n TRIAL: 'relationships.kinds.trial',\n};\n\nconst inputCls =\n 'w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]';\nconst labelCls = 'mb-1.5 block text-xs font-medium text-text-secondary';\n\n/** Grouped form section on a glass surface. */\nfunction FormSection({\n icon,\n title,\n description,\n children,\n dataTour,\n}: {\n icon: ReactNode;\n title: string;\n description: string;\n children: ReactNode;\n /** Stable product-tour anchor rendered as `data-tour` (BOFF-3358). */\n dataTour?: string;\n}) {\n return (\n <GlassCard treatment=\"metric\" className=\"p-5 sm:p-6\" data-tour={dataTour}>\n <div className=\"flex items-start gap-3\">\n <span className=\"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary\">\n {icon}\n </span>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-text-primary\">{title}</h2>\n <p className=\"mt-0.5 text-xs text-text-secondary\">{description}</p>\n </div>\n </div>\n <div className=\"mt-4\">{children}</div>\n </GlassCard>\n );\n}\n\nexport function RelationshipNewPage() {\n const { formatEnumLabel } = useFormatters();\n\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const create = useCreateRelationship();\n const providersQ = useProviders({ pagination: { limit: 100, offset: 0 } });\n\n const [label, setLabel] = useState('');\n const [kind, setKind] = useState<SubRelationshipKind>('SUBSCRIPTION');\n const [providerId, setProviderId] = useState('');\n const [planId, setPlanId] = useState('');\n const [amount, setAmount] = useState('');\n const [currency, setCurrency] = useState('USD');\n const [interval, setInterval] = useState<SubBillingInterval>('MONTHLY');\n const [renewsAt, setRenewsAt] = useState('');\n const [autoRenew, setAutoRenew] = useState(true);\n const [notes, setNotes] = useState('');\n const [department, setDepartment] = useState('');\n const [formError, setFormError, fieldErrorProps, formErrorId] = useFormError();\n\n const plansQ = usePlans(providerId || undefined);\n const providers = providersQ.data?.items ?? [];\n const plans = plansQ.data ?? [];\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setFormError(null);\n if (!label.trim()) {\n setFormError(\n tr('relationships.new.basics.labelRequired', 'A label is required.'),\n 'rel-label'\n );\n return;\n }\n const input: SubCreateRelationshipInput = {\n label: label.trim(),\n kind,\n interval,\n autoRenew,\n currency: currency.trim() || 'USD',\n ...(providerId ? { providerId } : {}),\n ...(planId ? { planId } : {}),\n ...(amount ? { amount: Number(amount) } : {}),\n ...(renewsAt ? { renewsAt: new Date(renewsAt).toISOString() } : {}),\n ...(notes.trim() ? { notes: notes.trim() } : {}),\n ...(department.trim() ? { department: department.trim() } : {}),\n };\n create.mutate(input, {\n onSuccess: (rel) => navigateTo(`/relationships/${rel.id}`),\n onError: (err) =>\n setFormError(\n err instanceof Error\n ? err.message\n : tr('relationships.new.error', 'Could not create relationship.')\n ),\n });\n };\n\n if (providersQ.isError) {\n return (\n <PageLayout\n dataTour=\"subscriberbot-relationship-new\"\n title={tr('relationships.new.title', 'Add relationship')}\n >\n <ErrorView\n message={tr('relationships.new.providerError', 'Could not load the provider registry.')}\n onRetry={() => void providersQ.refetch()}\n />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n dataTour=\"subscriberbot-relationship-new\"\n title={tr('relationships.new.title', 'Add relationship')}\n description={tr(\n 'relationships.new.description',\n 'Track a new recurring digital relationship'\n )}\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <ArrowLeft className=\"rtl:rotate-180 h-4 w-4\" /> {tr('relationships.new.back', 'Back')}\n </button>\n }\n >\n <PagePurpose className=\"mb-6\">\n {tr(\n 'relationships.new.purpose',\n 'Manually add a subscription, membership, license or contract. Link it to a provider and plan from the registry, set the price and renewal date, and Subscriber Bot will track its lifecycle from here.'\n )}\n </PagePurpose>\n\n <form onSubmit={handleSubmit} className=\"max-w-3xl space-y-5\">\n {formError && (\n <div\n id={formErrorId}\n tabIndex={-1}\n role=\"alert\"\n className=\"rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text\"\n >\n {formError}\n </div>\n )}\n\n {/* Basics */}\n <FormSection\n icon={<Tag className=\"h-4 w-4\" />}\n dataTour=\"subscriberbot-relationship-new-basics\"\n title={tr('relationships.new.basics.title', 'Basics')}\n description={tr(\n 'relationships.new.basics.description',\n 'Name this relationship and choose what kind it is.'\n )}\n >\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"rel-label\" className={labelCls}>\n {tr('relationships.new.basics.labelLabel', 'Label')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n {...fieldErrorProps('rel-label')}\n id=\"rel-label\"\n type=\"text\"\n value={label}\n onChange={(e) => setLabel(e.target.value)}\n placeholder={tr(\n 'relationships.new.basics.labelPlaceholder',\n 'e.g. Netflix Premium, AWS Production'\n )}\n className={inputCls}\n required\n />\n </div>\n <div className=\"max-w-xs\">\n <label htmlFor=\"rel-kind\" className={labelCls}>\n {tr('relationships.new.basics.kindLabel', 'Kind')}\n </label>\n <select\n {...fieldErrorProps('rel-kind')}\n id=\"rel-kind\"\n value={kind}\n onChange={(e) => setKind(e.target.value as SubRelationshipKind)}\n className={inputCls}\n >\n {KINDS.map((k) => (\n <option key={k} value={k}>\n {tr(KIND_KEY[k], formatEnumLabel(k))}\n </option>\n ))}\n </select>\n </div>\n <div className=\"max-w-xs\">\n <label htmlFor=\"rel-department\" className={labelCls}>\n {tr('relationships.new.basics.departmentLabel', 'Department or team')}\n </label>\n <input\n {...fieldErrorProps('rel-department')}\n id=\"rel-department\"\n type=\"text\"\n maxLength={120}\n value={department}\n onChange={(e) => setDepartment(e.target.value)}\n placeholder={tr(\n 'relationships.new.basics.departmentPlaceholder',\n 'e.g. Engineering, Marketing'\n )}\n className={inputCls}\n />\n </div>\n </div>\n </FormSection>\n\n {/* Provider & plan */}\n <FormSection\n icon={<Building2 className=\"h-4 w-4\" />}\n dataTour=\"subscriberbot-relationship-new-provider-plan\"\n title={tr('relationships.new.providerPlan.title', 'Provider & plan')}\n description={tr(\n 'relationships.new.providerPlan.description',\n 'Link this relationship to a provider and plan from the registry (optional).'\n )}\n >\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"rel-provider\" className={labelCls}>\n {tr('relationships.new.providerPlan.providerLabel', 'Provider')}\n </label>\n <select\n {...fieldErrorProps('rel-provider')}\n id=\"rel-provider\"\n value={providerId}\n onChange={(e) => {\n setProviderId(e.target.value);\n setPlanId('');\n }}\n className={inputCls}\n >\n <option value=\"\">\n {tr('relationships.new.providerPlan.providerNone', '— None —')}\n </option>\n {providers.map((p) => (\n <option key={p.id} value={p.id}>\n {p.name}\n </option>\n ))}\n </select>\n </div>\n <div>\n <label htmlFor=\"rel-plan\" className={labelCls}>\n {tr('relationships.new.providerPlan.planLabel', 'Plan')}\n </label>\n <select\n {...fieldErrorProps('rel-plan')}\n id=\"rel-plan\"\n value={planId}\n onChange={(e) => setPlanId(e.target.value)}\n className={inputCls}\n disabled={!providerId || plans.length === 0}\n >\n <option value=\"\">\n {providerId\n ? plans.length === 0\n ? tr('relationships.new.providerPlan.noPlans', 'No plans available')\n : tr('relationships.new.providerPlan.planNone', '— None —')\n : tr(\n 'relationships.new.providerPlan.selectProviderFirst',\n 'Select a provider first'\n )}\n </option>\n {plans.map((pl) => (\n <option key={pl.id} value={pl.id}>\n {pl.name}\n </option>\n ))}\n </select>\n </div>\n </div>\n </FormSection>\n\n {/* Pricing & billing */}\n <FormSection\n icon={<Wallet className=\"h-4 w-4\" />}\n dataTour=\"subscriberbot-relationship-new-pricing\"\n title={tr('relationships.new.pricing.title', 'Pricing & billing')}\n description={tr(\n 'relationships.new.pricing.description',\n 'Set the price, cadence and next renewal so Subscriber Bot can track it.'\n )}\n >\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <div>\n <label htmlFor=\"rel-amount\" className={labelCls}>\n {tr('relationships.new.pricing.amountLabel', 'Amount')}\n </label>\n <input\n {...fieldErrorProps('rel-amount')}\n id=\"rel-amount\"\n type=\"number\"\n min=\"0\"\n step=\"0.01\"\n value={amount}\n onChange={(e) => setAmount(e.target.value)}\n placeholder={tr('relationships.new.pricing.amountPlaceholder', '0.00')}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor=\"rel-currency\" className={labelCls}>\n {tr('relationships.new.pricing.currencyLabel', 'Currency')}\n </label>\n <input\n {...fieldErrorProps('rel-currency')}\n id=\"rel-currency\"\n type=\"text\"\n value={currency}\n onChange={(e) => setCurrency(e.target.value.toUpperCase())}\n placeholder={tr('relationships.new.pricing.currencyPlaceholder', 'USD')}\n maxLength={3}\n className={inputCls}\n />\n </div>\n <div>\n <label htmlFor=\"rel-interval\" className={labelCls}>\n {tr('relationships.new.pricing.intervalLabel', 'Billing interval')}\n </label>\n <select\n {...fieldErrorProps('rel-interval')}\n id=\"rel-interval\"\n value={interval}\n onChange={(e) => setInterval(e.target.value as SubBillingInterval)}\n className={inputCls}\n >\n {INTERVALS.map((i) => (\n <option key={i} value={i}>\n {formatEnumLabel(i)}\n </option>\n ))}\n </select>\n </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"rel-renews\" className={labelCls}>\n {tr('relationships.new.pricing.renewsOnLabel', 'Renews on')}\n </label>\n <input\n {...fieldErrorProps('rel-renews')}\n id=\"rel-renews\"\n type=\"date\"\n value={renewsAt}\n onChange={(e) => setRenewsAt(e.target.value)}\n className={inputCls}\n />\n </div>\n <label className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 sm:mt-6\">\n <input\n type=\"checkbox\"\n checked={autoRenew}\n onChange={(e) => setAutoRenew(e.target.checked)}\n className=\"size-4 rounded border-border-subtle\"\n />\n <span className=\"text-sm text-text-primary\">\n {tr('relationships.new.pricing.autoRenews', 'Auto-renews')}\n </span>\n </label>\n </div>\n </div>\n </FormSection>\n\n {/* Notes */}\n <FormSection\n icon={<StickyNote className=\"h-4 w-4\" />}\n title={tr('relationships.new.notes.title', 'Notes')}\n description={tr(\n 'relationships.new.notes.description',\n 'Anything worth remembering about this relationship.'\n )}\n >\n <textarea\n {...fieldErrorProps('rel-notes')}\n id=\"rel-notes\"\n aria-label={tr('relationships.new.notes.title', 'Notes')}\n value={notes}\n onChange={(e) => setNotes(e.target.value)}\n rows={3}\n placeholder={tr(\n 'relationships.new.notes.placeholder',\n 'Anything worth remembering about this relationship…'\n )}\n className={inputCls}\n />\n </FormSection>\n\n <div\n className=\"flex flex-col gap-3 sm:flex-row\"\n data-tour=\"subscriberbot-relationship-new-actions\"\n >\n <button\n type=\"submit\"\n disabled={create.isPending}\n className=\"rounded-lg bg-action-primary-bg px-5 py-2.5 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50\"\n >\n {create.isPending\n ? tr('relationships.new.creating', 'Creating…')\n : tr('relationships.new.submit', 'Create relationship')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"rounded-lg border border-border-subtle px-5 py-2.5 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n {tr('relationships.new.cancel', 'Cancel')}\n </button>\n </div>\n </form>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA0BA,IAAM,IAA+B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEM,IAAkC;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEM,IAAgD;CACpD,cAAc;CACd,YAAY;CACZ,SAAS;CACT,UAAU;CACV,YAAY;CACZ,mBAAmB;CACnB,YAAY;CACZ,OAAO;AACT,GAEM,IACJ,0MACI,IAAW;AAGjB,SAAS,EAAY,EACnB,SACA,UACA,gBACA,aACA,eAQC;CACD,OACE,kBAAC,GAAD;EAAW,WAAU;EAAS,WAAU;EAAa,aAAW;YAAhE,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD;IAAM,WAAU;cACb;GACG,CAAA,GACN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,MAAD;KAAI,WAAU;eAA2C;IAAU,CAAA,GACnE,kBAAC,KAAD;KAAG,WAAU;eAAsC;IAAe,CAAA,CAC/D;KACF;MACL,kBAAC,OAAD;GAAK,WAAU;GAAQ;EAAc,CAAA,CAC5B;;AAEf;AAEA,SAAgB,IAAsB;CACpC,IAAM,EAAE,uBAAoB,EAAc,GAEpC,IAAK,EAAM,GACX,EAAE,kBAAe,EAAiB,GAClC,IAAS,EAAsB,GAC/B,IAAa,EAAa,EAAE,YAAY;EAAE,OAAO;EAAK,QAAQ;CAAE,EAAE,CAAC,GAEnE,CAAC,GAAO,KAAY,EAAS,EAAE,GAC/B,CAAC,GAAM,KAAW,EAA8B,cAAc,GAC9D,CAAC,GAAY,KAAiB,EAAS,EAAE,GACzC,CAAC,GAAQ,KAAa,EAAS,EAAE,GACjC,CAAC,GAAQ,KAAa,EAAS,EAAE,GACjC,CAAC,GAAU,KAAe,EAAS,KAAK,G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