@burdenoff/microfe-subscriberbot 2026.1102.4 → 2026.1102.5

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 (49) 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/support/phoneViewport.d.ts +4 -0
  6. package/dist/stories/support/phoneViewport.d.ts.map +1 -0
  7. package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
  8. package/dist/subscriberbot/components/PageLayout.js +3 -3
  9. package/dist/subscriberbot/components/PageLayout.js.map +1 -1
  10. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts +18 -0
  11. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -0
  12. package/dist/subscriberbot/components/mobile/MobileDashboard.js +247 -0
  13. package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -0
  14. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts +10 -0
  15. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -0
  16. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +217 -0
  17. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -0
  18. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +26 -0
  19. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -0
  20. package/dist/subscriberbot/components/mobile/MobileScreen.js +46 -0
  21. package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -0
  22. package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts +10 -0
  23. package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts.map +1 -0
  24. package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +25 -0
  25. package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -0
  26. package/dist/subscriberbot/components/mobile/index.d.ts +9 -0
  27. package/dist/subscriberbot/components/mobile/index.d.ts.map +1 -0
  28. package/dist/subscriberbot/components/mobile/index.js +4 -0
  29. package/dist/subscriberbot/hooks/index.d.ts +1 -0
  30. package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
  31. package/dist/subscriberbot/hooks/index.js +1 -0
  32. package/dist/subscriberbot/hooks/useCompactViewport.d.ts +13 -0
  33. package/dist/subscriberbot/hooks/useCompactViewport.d.ts.map +1 -0
  34. package/dist/subscriberbot/hooks/useCompactViewport.js +21 -0
  35. package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -0
  36. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
  37. package/dist/subscriberbot/pages/DashboardPage.js +166 -189
  38. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  39. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
  40. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +120 -119
  41. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  42. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
  43. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +226 -212
  44. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  45. package/dist/subscriberbot/utils/portfolio.d.ts +106 -0
  46. package/dist/subscriberbot/utils/portfolio.d.ts.map +1 -0
  47. package/dist/subscriberbot/utils/portfolio.js +151 -0
  48. package/dist/subscriberbot/utils/portfolio.js.map +1 -0
  49. package/package.json +1 -1
@@ -1,20 +1,24 @@
1
1
  import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
2
2
  import { cn as t } from "../../utils/cn.js";
3
3
  import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { formatCurrency as r, formatDate as i, formatEnumLabel as a, formatIntervalSuffix as o } from "../../utils/formatters.js";
5
- import { StatusBadge as s } from "../../components/StatusBadge.js";
6
- import { EmptyState as c } from "../../components/EmptyState.js";
7
- import { useTr as l } from "../../hooks/useTr.js";
8
- import { ErrorView as u, LoadingView as d } from "../../components/StateViews.js";
9
- import { MiniProgress as f } from "../../components/viz.js";
4
+ import { formatCurrency as ee, formatDate as r, formatEnumLabel as i, formatIntervalSuffix as te } from "../../utils/formatters.js";
5
+ import { StatusBadge as a } from "../../components/StatusBadge.js";
6
+ import { EmptyState as o } from "../../components/EmptyState.js";
7
+ import { useTr as s } from "../../hooks/useTr.js";
8
+ import { ErrorView as c, LoadingView as l } from "../../components/StateViews.js";
9
+ import { MiniProgress as u } from "../../components/viz.js";
10
10
  import "../../components/index.js";
11
- import { useRelationships as p } from "../../hooks/useSubscriberBotApi.js";
12
- import { useMemo as m, useState as h } from "react";
13
- import { ChevronRight as g, Plus as _, Repeat2 as v, Search as y } from "lucide-react";
14
- import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
15
- import { GlassCard as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
11
+ import { useRelationships as d } from "../../hooks/useSubscriberBotApi.js";
12
+ import { useCompactViewport as f } from "../../hooks/useCompactViewport.js";
13
+ import { MobileScreen as p } from "../../components/mobile/MobileScreen.js";
14
+ import { MobileRelationshipList as m } from "../../components/mobile/MobileRelationshipList.js";
15
+ import "../../components/mobile/index.js";
16
+ import { useMemo as h, useState as g } from "react";
17
+ import { ChevronRight as _, Plus as v, Repeat2 as y, Search as b } from "lucide-react";
18
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
19
+ import { GlassCard as w, PagePurpose as T } from "@burdenoff/fe-libs/ui";
16
20
  //#region src/subscriberbot/pages/relationships/RelationshipsListPage.tsx
17
- var T = 20, E = [
21
+ var E = 20, D = [
18
22
  "ACTIVE",
19
23
  "TRIAL",
20
24
  "PAUSED",
@@ -22,7 +26,7 @@ var T = 20, E = [
22
26
  "LAPSED",
23
27
  "EXPIRED",
24
28
  "CANCELLED"
25
- ], D = [
29
+ ], O = [
26
30
  "SUBSCRIPTION",
27
31
  "MEMBERSHIP",
28
32
  "LICENSE",
@@ -31,7 +35,7 @@ var T = 20, E = [
31
35
  "RECURRING_PAYMENT",
32
36
  "ENROLLMENT",
33
37
  "TRIAL"
34
- ], O = {
38
+ ], k = {
35
39
  ACTIVE: "relationships.statuses.active",
36
40
  TRIAL: "relationships.statuses.trial",
37
41
  PAUSED: "relationships.statuses.paused",
@@ -39,7 +43,7 @@ var T = 20, E = [
39
43
  LAPSED: "relationships.statuses.lapsed",
40
44
  EXPIRED: "relationships.statuses.expired",
41
45
  CANCELLED: "relationships.statuses.cancelled"
42
- }, k = {
46
+ }, A = {
43
47
  SUBSCRIPTION: "relationships.kinds.subscription",
44
48
  MEMBERSHIP: "relationships.kinds.membership",
45
49
  LICENSE: "relationships.kinds.license",
@@ -48,215 +52,225 @@ var T = 20, E = [
48
52
  RECURRING_PAYMENT: "relationships.kinds.recurringPayment",
49
53
  ENROLLMENT: "relationships.kinds.enrollment",
50
54
  TRIAL: "relationships.kinds.trial"
51
- }, A = "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]";
52
- function j(e) {
55
+ }, j = "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]";
56
+ function M(e) {
53
57
  return e == null ? "accent" : e >= 66 ? "positive" : e >= 33 ? "warning" : "negative";
54
58
  }
55
- function M() {
56
- let M = l(), { navigateTo: N } = e(), [P, F] = h(0), [I, L] = h(""), [R, z] = h(""), [B, V] = h(""), [H, U] = h(""), { data: W, isLoading: G, isError: K, refetch: q, isFetching: J } = p({
57
- status: I || void 0,
58
- kind: R || void 0,
59
- search: B || void 0,
59
+ function N() {
60
+ let N = s(), { navigateTo: P } = e(), F = f(), [I, L] = g(0), [R, z] = g(""), [B, V] = g(""), [H, U] = g(""), [W, G] = g(""), { data: K, isLoading: q, isError: J, refetch: Y, isFetching: X } = d({
61
+ status: R || void 0,
62
+ kind: B || void 0,
63
+ search: H || void 0,
60
64
  pagination: {
61
- limit: T,
62
- offset: P * T
65
+ limit: E,
66
+ offset: I * E
63
67
  }
64
- }), Y = m(() => W?.items ?? [], [W]), X = W?.pageInfo.hasMore ?? !1;
65
- return /* @__PURE__ */ S(n, {
66
- title: M("relationships.title", "Relationships"),
67
- description: M("relationships.description", "Every subscription, membership, license and contract you track"),
68
- actions: /* @__PURE__ */ S("button", {
69
- type: "button",
70
- onClick: () => N("/relationships/new"),
71
- 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",
72
- children: [
73
- /* @__PURE__ */ x(_, { className: "h-4 w-4" }),
74
- " ",
75
- M("relationships.addRelationship", "Add relationship")
76
- ]
77
- }),
78
- children: [
79
- /* @__PURE__ */ x(w, {
80
- className: "mb-4",
81
- children: M("relationships.purpose", "This is the fundamental object of Subscriber Bot. Filter by lifecycle and kind, open any row to manage its plan, payment, entitlements, assets and renewals, or advance its lifecycle.")
82
- }),
83
- /* @__PURE__ */ x(C, {
84
- treatment: "plain",
85
- className: "p-3 sm:p-4",
86
- children: /* @__PURE__ */ S("div", {
87
- className: "flex flex-col gap-3 md:flex-row md:items-center",
88
- children: [/* @__PURE__ */ S("form", {
89
- onSubmit: (e) => {
90
- e.preventDefault(), V(H.trim()), F(0);
91
- },
92
- className: "relative flex-1 min-w-0",
93
- children: [/* @__PURE__ */ x(y, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ x("input", {
94
- type: "text",
95
- "aria-label": M("relationships.searchPlaceholder", "Search relationships by label…"),
96
- placeholder: M("relationships.searchPlaceholder", "Search relationships by label…"),
97
- value: H,
98
- onChange: (e) => U(e.target.value),
99
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-10 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
100
- })]
101
- }), /* @__PURE__ */ S("div", {
102
- className: "flex flex-wrap gap-2 sm:flex-nowrap",
103
- children: [/* @__PURE__ */ S("select", {
104
- "aria-label": M("relationships.filters.kindLabel", "Filter by kind"),
105
- value: R,
106
- onChange: (e) => {
107
- z(e.target.value), F(0);
108
- },
109
- className: t(A, "flex-1 sm:flex-none"),
110
- children: [/* @__PURE__ */ x("option", {
111
- value: "",
112
- children: M("relationships.filters.allKinds", "All kinds")
113
- }), D.map((e) => /* @__PURE__ */ x("option", {
114
- value: e,
115
- children: M(k[e], a(e))
116
- }, e))]
117
- }), /* @__PURE__ */ S("select", {
118
- "aria-label": M("relationships.filters.statusLabel", "Filter by status"),
119
- value: I,
120
- onChange: (e) => {
121
- L(e.target.value), F(0);
122
- },
123
- className: t(A, "flex-1 sm:flex-none"),
124
- children: [/* @__PURE__ */ x("option", {
125
- value: "",
126
- children: M("relationships.filters.allStatuses", "All statuses")
127
- }), E.map((e) => /* @__PURE__ */ x("option", {
128
- value: e,
129
- children: M(O[e], a(e))
130
- }, e))]
131
- })]
132
- })]
133
- })
134
- }),
135
- G ? /* @__PURE__ */ x(d, { label: M("relationships.loading", "Loading relationships…") }) : K ? /* @__PURE__ */ x(u, {
136
- message: M("relationships.error", "Could not load relationships."),
137
- onRetry: () => void q()
138
- }) : Y.length === 0 ? /* @__PURE__ */ x("div", {
139
- className: "mt-6",
140
- children: /* @__PURE__ */ x(c, {
141
- illustration: "empty-data",
142
- icon: /* @__PURE__ */ x(v, { className: "h-12 w-12" }),
143
- title: M("relationships.emptyTitle", "No relationships found"),
144
- description: B ? M("relationships.emptyDescriptionSearch", "No relationships match \"{{search}}\".", { search: B }) : M("relationships.emptyDescription", "Add your first recurring relationship to start tracking it."),
145
- action: /* @__PURE__ */ x("button", {
146
- type: "button",
147
- onClick: () => N("/relationships/new"),
148
- className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
149
- children: M("relationships.addRelationship", "Add relationship")
150
- })
151
- })
152
- }) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(C, {
153
- treatment: "plain",
154
- className: "mt-4 overflow-hidden p-0",
155
- children: /* @__PURE__ */ x("div", {
156
- className: "overflow-x-auto",
157
- children: /* @__PURE__ */ S("div", {
158
- className: "min-w-[720px]",
159
- children: [/* @__PURE__ */ S("div", {
160
- className: "grid grid-cols-[minmax(0,2.4fr)_1fr_1fr_1fr_1fr_1.3fr] gap-4 border-b border-border-seam bg-bg-sunken/60 px-4 py-2.5 text-xs font-medium uppercase tracking-wide text-text-secondary",
68
+ }), Z = h(() => K?.items ?? [], [K]), Q = K?.pageInfo.hasMore ?? !1, $ = /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(w, {
69
+ treatment: "plain",
70
+ className: "p-3 sm:p-4",
71
+ children: /* @__PURE__ */ C("div", {
72
+ className: "flex flex-col gap-3 md:flex-row md:items-center",
73
+ children: [/* @__PURE__ */ C("form", {
74
+ onSubmit: (e) => {
75
+ e.preventDefault(), U(W.trim()), L(0);
76
+ },
77
+ className: "relative flex-1 min-w-0",
78
+ children: [/* @__PURE__ */ S(b, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ S("input", {
79
+ type: "text",
80
+ "aria-label": N("relationships.searchPlaceholder", "Search relationships by label…"),
81
+ placeholder: N("relationships.searchPlaceholder", "Search relationships by label…"),
82
+ value: W,
83
+ onChange: (e) => G(e.target.value),
84
+ className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-10 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
85
+ })]
86
+ }), /* @__PURE__ */ C("div", {
87
+ className: "flex flex-wrap gap-2 sm:flex-nowrap",
88
+ children: [/* @__PURE__ */ C("select", {
89
+ "aria-label": N("relationships.filters.kindLabel", "Filter by kind"),
90
+ value: B,
91
+ onChange: (e) => {
92
+ V(e.target.value), L(0);
93
+ },
94
+ className: t(j, "flex-1 sm:flex-none"),
95
+ children: [/* @__PURE__ */ S("option", {
96
+ value: "",
97
+ children: N("relationships.filters.allKinds", "All kinds")
98
+ }), O.map((e) => /* @__PURE__ */ S("option", {
99
+ value: e,
100
+ children: N(A[e], i(e))
101
+ }, e))]
102
+ }), /* @__PURE__ */ C("select", {
103
+ "aria-label": N("relationships.filters.statusLabel", "Filter by status"),
104
+ value: R,
105
+ onChange: (e) => {
106
+ z(e.target.value), L(0);
107
+ },
108
+ className: t(j, "flex-1 sm:flex-none"),
109
+ children: [/* @__PURE__ */ S("option", {
110
+ value: "",
111
+ children: N("relationships.filters.allStatuses", "All statuses")
112
+ }), D.map((e) => /* @__PURE__ */ S("option", {
113
+ value: e,
114
+ children: N(k[e], i(e))
115
+ }, e))]
116
+ })]
117
+ })]
118
+ })
119
+ }), q ? /* @__PURE__ */ S(l, { label: N("relationships.loading", "Loading relationships…") }) : J ? /* @__PURE__ */ S(c, {
120
+ message: N("relationships.error", "Could not load relationships."),
121
+ onRetry: () => void Y()
122
+ }) : Z.length === 0 ? /* @__PURE__ */ S("div", {
123
+ className: "mt-6",
124
+ children: /* @__PURE__ */ S(o, {
125
+ illustration: "empty-data",
126
+ icon: /* @__PURE__ */ S(y, { className: "h-12 w-12" }),
127
+ title: N("relationships.emptyTitle", "No relationships found"),
128
+ description: H ? N("relationships.emptyDescriptionSearch", "No relationships match \"{{search}}\".", { search: H }) : N("relationships.emptyDescription", "Add your first recurring relationship to start tracking it."),
129
+ action: /* @__PURE__ */ S("button", {
130
+ type: "button",
131
+ onClick: () => P("/relationships/new"),
132
+ className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
133
+ children: N("relationships.addRelationship", "Add relationship")
134
+ })
135
+ })
136
+ }) : /* @__PURE__ */ C(x, { children: [F ? /* @__PURE__ */ S(m, {
137
+ items: Z,
138
+ navigateTo: P
139
+ }) : /* @__PURE__ */ S(w, {
140
+ treatment: "plain",
141
+ className: "mt-4 overflow-hidden p-0",
142
+ children: /* @__PURE__ */ S("div", {
143
+ className: "overflow-x-auto",
144
+ children: /* @__PURE__ */ C("div", {
145
+ className: "min-w-[720px]",
146
+ children: [/* @__PURE__ */ C("div", {
147
+ className: "grid grid-cols-[minmax(0,2.4fr)_1fr_1fr_1fr_1fr_1.3fr] gap-4 border-b border-border-seam bg-bg-sunken/60 px-4 py-2.5 text-xs font-medium uppercase tracking-wide text-text-secondary",
148
+ children: [
149
+ /* @__PURE__ */ S("span", { children: N("relationships.table.subscription", "Subscription") }),
150
+ /* @__PURE__ */ S("span", { children: N("relationships.table.kind", "Kind") }),
151
+ /* @__PURE__ */ S("span", { children: N("relationships.table.status", "Status") }),
152
+ /* @__PURE__ */ S("span", {
153
+ className: "text-right",
154
+ children: N("relationships.table.amount", "Amount")
155
+ }),
156
+ /* @__PURE__ */ S("span", {
157
+ className: "text-right",
158
+ children: N("relationships.table.renewsOn", "Renews on")
159
+ }),
160
+ /* @__PURE__ */ S("span", { children: N("relationships.table.health", "Health") })
161
+ ]
162
+ }), /* @__PURE__ */ S("div", {
163
+ className: "divide-y divide-border-subtle",
164
+ children: Z.map((e) => {
165
+ let t = e.healthScore;
166
+ return /* @__PURE__ */ C("button", {
167
+ type: "button",
168
+ onClick: () => P(`/relationships/${e.id}`),
169
+ className: "group grid w-full grid-cols-[minmax(0,2.4fr)_1fr_1fr_1fr_1fr_1.3fr] items-center gap-4 px-4 py-3.5 text-left transition-colors hover:bg-bg-sunken",
161
170
  children: [
162
- /* @__PURE__ */ x("span", { children: M("relationships.table.subscription", "Subscription") }),
163
- /* @__PURE__ */ x("span", { children: M("relationships.table.kind", "Kind") }),
164
- /* @__PURE__ */ x("span", { children: M("relationships.table.status", "Status") }),
165
- /* @__PURE__ */ x("span", {
166
- className: "text-right",
167
- children: M("relationships.table.amount", "Amount")
171
+ /* @__PURE__ */ S("div", {
172
+ className: "flex min-w-0 items-center gap-2",
173
+ children: /* @__PURE__ */ C("div", {
174
+ className: "min-w-0",
175
+ children: [/* @__PURE__ */ S("p", {
176
+ className: "truncate text-sm font-semibold text-text-primary",
177
+ children: e.label
178
+ }), e.provider?.name && /* @__PURE__ */ S("p", {
179
+ className: "truncate text-xs text-text-secondary",
180
+ children: e.provider.name
181
+ })]
182
+ })
168
183
  }),
169
- /* @__PURE__ */ x("span", {
170
- className: "text-right",
171
- children: M("relationships.table.renewsOn", "Renews on")
184
+ /* @__PURE__ */ S("span", { children: /* @__PURE__ */ S("span", {
185
+ className: "inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
186
+ children: N(A[e.kind], i(e.kind))
187
+ }) }),
188
+ /* @__PURE__ */ S("span", { children: /* @__PURE__ */ S(a, { status: e.status }) }),
189
+ /* @__PURE__ */ C("span", {
190
+ className: "text-right text-sm font-semibold tabular-nums text-text-primary",
191
+ children: [ee(e.amount, e.currency), /* @__PURE__ */ S("span", {
192
+ className: "text-xs font-normal text-text-secondary",
193
+ children: te(e.interval)
194
+ })]
172
195
  }),
173
- /* @__PURE__ */ x("span", { children: M("relationships.table.health", "Health") })
196
+ /* @__PURE__ */ S("span", {
197
+ className: "text-right text-xs text-text-secondary",
198
+ children: e.renewsAt ? r(e.renewsAt) : "—"
199
+ }),
200
+ /* @__PURE__ */ C("span", {
201
+ className: "flex items-center gap-2",
202
+ children: [t == null ? /* @__PURE__ */ S("span", {
203
+ className: "text-xs text-text-secondary",
204
+ children: "—"
205
+ }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(u, {
206
+ value: t,
207
+ max: 100,
208
+ tone: M(t),
209
+ className: "w-16 shrink-0 sm:w-20"
210
+ }), /* @__PURE__ */ S("span", {
211
+ className: "text-xs tabular-nums text-text-secondary",
212
+ children: t
213
+ })] }), /* @__PURE__ */ S(_, { className: "ml-auto h-4 w-4 shrink-0 text-text-secondary opacity-0 transition-opacity group-hover:opacity-100" })]
214
+ })
174
215
  ]
175
- }), /* @__PURE__ */ x("div", {
176
- className: "divide-y divide-border-subtle",
177
- children: Y.map((e) => {
178
- let t = e.healthScore;
179
- return /* @__PURE__ */ S("button", {
180
- type: "button",
181
- onClick: () => N(`/relationships/${e.id}`),
182
- className: "group grid w-full grid-cols-[minmax(0,2.4fr)_1fr_1fr_1fr_1fr_1.3fr] items-center gap-4 px-4 py-3.5 text-left transition-colors hover:bg-bg-sunken",
183
- children: [
184
- /* @__PURE__ */ x("div", {
185
- className: "flex min-w-0 items-center gap-2",
186
- children: /* @__PURE__ */ S("div", {
187
- className: "min-w-0",
188
- children: [/* @__PURE__ */ x("p", {
189
- className: "truncate text-sm font-semibold text-text-primary",
190
- children: e.label
191
- }), e.provider?.name && /* @__PURE__ */ x("p", {
192
- className: "truncate text-xs text-text-secondary",
193
- children: e.provider.name
194
- })]
195
- })
196
- }),
197
- /* @__PURE__ */ x("span", { children: /* @__PURE__ */ x("span", {
198
- className: "inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
199
- children: M(k[e.kind], a(e.kind))
200
- }) }),
201
- /* @__PURE__ */ x("span", { children: /* @__PURE__ */ x(s, { status: e.status }) }),
202
- /* @__PURE__ */ S("span", {
203
- className: "text-right text-sm font-semibold tabular-nums text-text-primary",
204
- children: [r(e.amount, e.currency), /* @__PURE__ */ x("span", {
205
- className: "text-xs font-normal text-text-secondary",
206
- children: o(e.interval)
207
- })]
208
- }),
209
- /* @__PURE__ */ x("span", {
210
- className: "text-right text-xs text-text-secondary",
211
- children: e.renewsAt ? i(e.renewsAt) : "—"
212
- }),
213
- /* @__PURE__ */ S("span", {
214
- className: "flex items-center gap-2",
215
- children: [t == null ? /* @__PURE__ */ x("span", {
216
- className: "text-xs text-text-secondary",
217
- children: "—"
218
- }) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(f, {
219
- value: t,
220
- max: 100,
221
- tone: j(t),
222
- className: "w-16 shrink-0 sm:w-20"
223
- }), /* @__PURE__ */ x("span", {
224
- className: "text-xs tabular-nums text-text-secondary",
225
- children: t
226
- })] }), /* @__PURE__ */ x(g, { className: "ml-auto h-4 w-4 shrink-0 text-text-secondary opacity-0 transition-opacity group-hover:opacity-100" })]
227
- })
228
- ]
229
- }, e.id);
230
- })
231
- })]
216
+ }, e.id);
232
217
  })
233
- })
234
- }), /* @__PURE__ */ S("div", {
235
- className: "mt-4 flex items-center justify-between",
236
- children: [/* @__PURE__ */ S("p", {
237
- className: "text-xs text-text-secondary",
238
- children: [M("relationships.pagination.page", "Page {{page}}", { page: P + 1 }), J ? ` · ${M("relationships.pagination.refreshing", "refreshing…")}` : ""]
239
- }), /* @__PURE__ */ S("div", {
240
- className: "flex gap-2",
241
- children: [/* @__PURE__ */ x("button", {
242
- type: "button",
243
- disabled: P === 0,
244
- onClick: () => F((e) => Math.max(0, e - 1)),
245
- className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", P === 0 ? "cursor-not-allowed text-text-secondary opacity-50" : "text-text-primary hover:bg-bg-sunken"),
246
- children: M("relationships.pagination.previous", "Previous")
247
- }), /* @__PURE__ */ x("button", {
248
- type: "button",
249
- disabled: !X,
250
- onClick: () => F((e) => e + 1),
251
- className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", X ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
252
- children: M("relationships.pagination.next", "Next")
253
- })]
254
218
  })]
255
- })] })
256
- ]
219
+ })
220
+ })
221
+ }), /* @__PURE__ */ C("div", {
222
+ className: "mt-4 flex items-center justify-between",
223
+ children: [/* @__PURE__ */ C("p", {
224
+ className: "text-xs text-text-secondary",
225
+ children: [N("relationships.pagination.page", "Page {{page}}", { page: I + 1 }), X ? ` · ${N("relationships.pagination.refreshing", "refreshing…")}` : ""]
226
+ }), /* @__PURE__ */ C("div", {
227
+ className: "flex gap-2",
228
+ children: [/* @__PURE__ */ S("button", {
229
+ type: "button",
230
+ disabled: I === 0,
231
+ onClick: () => L((e) => Math.max(0, e - 1)),
232
+ className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", I === 0 ? "cursor-not-allowed text-text-secondary opacity-50" : "text-text-primary hover:bg-bg-sunken"),
233
+ children: N("relationships.pagination.previous", "Previous")
234
+ }), /* @__PURE__ */ S("button", {
235
+ type: "button",
236
+ disabled: !Q,
237
+ onClick: () => L((e) => e + 1),
238
+ className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", Q ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
239
+ children: N("relationships.pagination.next", "Next")
240
+ })]
241
+ })]
242
+ })] })] });
243
+ return F ? /* @__PURE__ */ S(p, {
244
+ testId: "sb-mobile-relationships",
245
+ title: N("relationships.title", "Relationships"),
246
+ action: /* @__PURE__ */ S("button", {
247
+ type: "button",
248
+ onClick: () => P("/relationships/new"),
249
+ "aria-label": N("relationships.addRelationship", "Add relationship"),
250
+ className: "flex size-11 items-center justify-center rounded-full bg-bg-surface text-text-primary shadow-sm",
251
+ children: /* @__PURE__ */ S(v, { className: "h-5 w-5" })
252
+ }),
253
+ children: $
254
+ }) : /* @__PURE__ */ C(n, {
255
+ title: N("relationships.title", "Relationships"),
256
+ description: N("relationships.description", "Every subscription, membership, license and contract you track"),
257
+ actions: /* @__PURE__ */ C("button", {
258
+ type: "button",
259
+ onClick: () => P("/relationships/new"),
260
+ 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",
261
+ children: [
262
+ /* @__PURE__ */ S(v, { className: "h-4 w-4" }),
263
+ " ",
264
+ N("relationships.addRelationship", "Add relationship")
265
+ ]
266
+ }),
267
+ children: [/* @__PURE__ */ S(T, {
268
+ className: "mb-4",
269
+ children: N("relationships.purpose", "This is the fundamental object of Subscriber Bot. Filter by lifecycle and kind, open any row to manage its plan, payment, entitlements, assets and renewals, or advance its lifecycle.")
270
+ }), $]
257
271
  });
258
272
  }
259
273
  //#endregion
260
- export { M as RelationshipsListPage };
274
+ export { N as RelationshipsListPage };
261
275
 
262
276
  //# sourceMappingURL=RelationshipsListPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipsListPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/relationships/RelationshipsListPage.tsx"],"sourcesContent":["/**\n * Relationships list\n * @module subscriberbot/pages/relationships\n *\n * The core CRUDL list — every recurring relationship (subscription /\n * membership / license / contract) in one paginated, filterable view.\n * Data comes from `subListRelationships` (a SubRelationshipConnection).\n */\n\nimport { useMemo, useState } from 'react';\nimport { Plus, Search, Repeat2, ChevronRight } from 'lucide-react';\nimport { GlassCard, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { MiniProgress } from '../../components';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useRelationships } from '../../hooks/useSubscriberBotApi';\nimport { cn } from '../../utils/cn';\nimport {\n formatCurrency,\n formatDate,\n formatEnumLabel,\n formatIntervalSuffix,\n} from '../../utils/formatters';\nimport { useTr } from '../../hooks/useTr';\nimport type { SubRelationshipKind, SubRelationshipStatus } from '../../types';\n\nconst PAGE_SIZE = 20;\n\nconst STATUSES: SubRelationshipStatus[] = [\n 'ACTIVE',\n 'TRIAL',\n 'PAUSED',\n 'PAST_DUE',\n 'LAPSED',\n 'EXPIRED',\n 'CANCELLED',\n];\n\nconst KINDS: SubRelationshipKind[] = [\n 'SUBSCRIPTION',\n 'MEMBERSHIP',\n 'LICENSE',\n 'CONTRACT',\n 'NEWSLETTER',\n 'RECURRING_PAYMENT',\n 'ENROLLMENT',\n 'TRIAL',\n];\n\nconst STATUS_KEY: Record<SubRelationshipStatus, string> = {\n ACTIVE: 'relationships.statuses.active',\n TRIAL: 'relationships.statuses.trial',\n PAUSED: 'relationships.statuses.paused',\n PAST_DUE: 'relationships.statuses.pastDue',\n LAPSED: 'relationships.statuses.lapsed',\n EXPIRED: 'relationships.statuses.expired',\n CANCELLED: 'relationships.statuses.cancelled',\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 selectCls =\n 'rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]';\n\n/** Map a 0–100 health score onto a MiniProgress tone. */\nfunction healthTone(\n score: number | null | undefined\n): 'positive' | 'accent' | 'warning' | 'negative' {\n if (score == null) return 'accent';\n if (score >= 66) return 'positive';\n if (score >= 33) return 'warning';\n return 'negative';\n}\n\nexport function RelationshipsListPage() {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const [page, setPage] = useState(0);\n const [statusFilter, setStatusFilter] = useState<'' | SubRelationshipStatus>('');\n const [kindFilter, setKindFilter] = useState<'' | SubRelationshipKind>('');\n const [search, setSearch] = useState('');\n const [searchInput, setSearchInput] = useState('');\n\n const { data, isLoading, isError, refetch, isFetching } = useRelationships({\n status: statusFilter || undefined,\n kind: kindFilter || undefined,\n search: search || undefined,\n pagination: { limit: PAGE_SIZE, offset: page * PAGE_SIZE },\n });\n\n const items = useMemo(() => data?.items ?? [], [data]);\n const hasMore = data?.pageInfo.hasMore ?? false;\n\n const submitSearch = (e: React.FormEvent) => {\n e.preventDefault();\n setSearch(searchInput.trim());\n setPage(0);\n };\n\n return (\n <PageLayout\n title={tr('relationships.title', 'Relationships')}\n description={tr(\n 'relationships.description',\n 'Every subscription, membership, license and contract you track'\n )}\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships/new')}\n 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\"\n >\n <Plus className=\"h-4 w-4\" /> {tr('relationships.addRelationship', 'Add relationship')}\n </button>\n }\n >\n <PagePurpose className=\"mb-4\">\n {tr(\n 'relationships.purpose',\n 'This is the fundamental object of Subscriber Bot. Filter by lifecycle and kind, open any row to manage its plan, payment, entitlements, assets and renewals, or advance its lifecycle.'\n )}\n </PagePurpose>\n\n {/* Toolbar — search + filters, responsive */}\n <GlassCard treatment=\"plain\" className=\"p-3 sm:p-4\">\n <div className=\"flex flex-col gap-3 md:flex-row md:items-center\">\n <form onSubmit={submitSearch} className=\"relative flex-1 min-w-0\">\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <input\n type=\"text\"\n aria-label={tr('relationships.searchPlaceholder', 'Search relationships by label…')}\n placeholder={tr('relationships.searchPlaceholder', 'Search relationships by label…')}\n value={searchInput}\n onChange={(e) => setSearchInput(e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-10 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </form>\n <div className=\"flex flex-wrap gap-2 sm:flex-nowrap\">\n <select\n aria-label={tr('relationships.filters.kindLabel', 'Filter by kind')}\n value={kindFilter}\n onChange={(e) => {\n setKindFilter(e.target.value as '' | SubRelationshipKind);\n setPage(0);\n }}\n className={cn(selectCls, 'flex-1 sm:flex-none')}\n >\n <option value=\"\">{tr('relationships.filters.allKinds', 'All kinds')}</option>\n {KINDS.map((k) => (\n <option key={k} value={k}>\n {tr(KIND_KEY[k], formatEnumLabel(k))}\n </option>\n ))}\n </select>\n <select\n aria-label={tr('relationships.filters.statusLabel', 'Filter by status')}\n value={statusFilter}\n onChange={(e) => {\n setStatusFilter(e.target.value as '' | SubRelationshipStatus);\n setPage(0);\n }}\n className={cn(selectCls, 'flex-1 sm:flex-none')}\n >\n <option value=\"\">{tr('relationships.filters.allStatuses', 'All statuses')}</option>\n {STATUSES.map((s) => (\n <option key={s} value={s}>\n {tr(STATUS_KEY[s], formatEnumLabel(s))}\n </option>\n ))}\n </select>\n </div>\n </div>\n </GlassCard>\n\n {isLoading ? (\n <LoadingView label={tr('relationships.loading', 'Loading relationships…')} />\n ) : isError ? (\n <ErrorView\n message={tr('relationships.error', 'Could not load relationships.')}\n onRetry={() => void refetch()}\n />\n ) : items.length === 0 ? (\n <div className=\"mt-6\">\n <EmptyState\n illustration=\"empty-data\"\n icon={<Repeat2 className=\"h-12 w-12\" />}\n title={tr('relationships.emptyTitle', 'No relationships found')}\n description={\n search\n ? tr(\n 'relationships.emptyDescriptionSearch',\n 'No relationships match \"{{search}}\".',\n { search }\n )\n : tr(\n 'relationships.emptyDescription',\n 'Add your first recurring relationship to start tracking it.'\n )\n }\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships/new')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n {tr('relationships.addRelationship', 'Add relationship')}\n </button>\n }\n />\n </div>\n ) : (\n <>\n {/* Portfolio table — scrolls horizontally on small screens, never the page */}\n <GlassCard treatment=\"plain\" className=\"mt-4 overflow-hidden p-0\">\n <div className=\"overflow-x-auto\">\n <div className=\"min-w-[720px]\">\n <div className=\"grid grid-cols-[minmax(0,2.4fr)_1fr_1fr_1fr_1fr_1.3fr] gap-4 border-b border-border-seam bg-bg-sunken/60 px-4 py-2.5 text-xs font-medium uppercase tracking-wide text-text-secondary\">\n <span>{tr('relationships.table.subscription', 'Subscription')}</span>\n <span>{tr('relationships.table.kind', 'Kind')}</span>\n <span>{tr('relationships.table.status', 'Status')}</span>\n <span className=\"text-right\">{tr('relationships.table.amount', 'Amount')}</span>\n <span className=\"text-right\">\n {tr('relationships.table.renewsOn', 'Renews on')}\n </span>\n <span>{tr('relationships.table.health', 'Health')}</span>\n </div>\n <div className=\"divide-y divide-border-subtle\">\n {items.map((r) => {\n const score = r.healthScore;\n return (\n <button\n key={r.id}\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${r.id}`)}\n className=\"group grid w-full grid-cols-[minmax(0,2.4fr)_1fr_1fr_1fr_1fr_1.3fr] items-center gap-4 px-4 py-3.5 text-left transition-colors hover:bg-bg-sunken\"\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-semibold text-text-primary\">\n {r.label}\n </p>\n {r.provider?.name && (\n <p className=\"truncate text-xs text-text-secondary\">\n {r.provider.name}\n </p>\n )}\n </div>\n </div>\n <span>\n <span className=\"inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary\">\n {tr(KIND_KEY[r.kind], formatEnumLabel(r.kind))}\n </span>\n </span>\n <span>\n <StatusBadge status={r.status} />\n </span>\n <span className=\"text-right text-sm font-semibold tabular-nums text-text-primary\">\n {formatCurrency(r.amount, r.currency)}\n <span className=\"text-xs font-normal text-text-secondary\">\n {formatIntervalSuffix(r.interval)}\n </span>\n </span>\n <span className=\"text-right text-xs text-text-secondary\">\n {r.renewsAt ? formatDate(r.renewsAt) : '—'}\n </span>\n <span className=\"flex items-center gap-2\">\n {score != null ? (\n <>\n <MiniProgress\n value={score}\n max={100}\n tone={healthTone(score)}\n className=\"w-16 shrink-0 sm:w-20\"\n />\n <span className=\"text-xs tabular-nums text-text-secondary\">\n {score}\n </span>\n </>\n ) : (\n <span className=\"text-xs text-text-secondary\">—</span>\n )}\n <ChevronRight className=\"ml-auto h-4 w-4 shrink-0 text-text-secondary opacity-0 transition-opacity group-hover:opacity-100\" />\n </span>\n </button>\n );\n })}\n </div>\n </div>\n </div>\n </GlassCard>\n\n <div className=\"mt-4 flex items-center justify-between\">\n <p className=\"text-xs text-text-secondary\">\n {tr('relationships.pagination.page', 'Page {{page}}', { page: page + 1 })}\n {isFetching ? ` · ${tr('relationships.pagination.refreshing', 'refreshing…')}` : ''}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n disabled={page === 0}\n onClick={() => setPage((p) => Math.max(0, p - 1))}\n className={cn(\n 'rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium',\n page === 0\n ? 'cursor-not-allowed text-text-secondary opacity-50'\n : 'text-text-primary hover:bg-bg-sunken'\n )}\n >\n {tr('relationships.pagination.previous', 'Previous')}\n </button>\n <button\n type=\"button\"\n disabled={!hasMore}\n onClick={() => setPage((p) => p + 1)}\n className={cn(\n 'rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium',\n !hasMore\n ? 'cursor-not-allowed text-text-secondary opacity-50'\n : 'text-text-primary hover:bg-bg-sunken'\n )}\n >\n {tr('relationships.pagination.next', 'Next')}\n </button>\n </div>\n </div>\n </>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6BA,IAAM,IAAY,IAEZ,IAAoC;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEM,IAA+B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEM,IAAoD;CACxD,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,SAAS;CACT,WAAW;AACb,GAEM,IAAgD;CACpD,cAAc;CACd,YAAY;CACZ,SAAS;CACT,UAAU;CACV,YAAY;CACZ,mBAAmB;CACnB,YAAY;CACZ,OAAO;AACT,GAEM,IACJ;AAGF,SAAS,EACP,GACgD;CAIhD,OAHI,KAAS,OAAa,WACtB,KAAS,KAAW,aACpB,KAAS,KAAW,YACjB;AACT;AAEA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ACR,kBAAC,UAAD;MACE,MAAK;MACL,UAAU,CAAC;MACX,eAAe,GAAS,MAAM,IAAI,CAAC;MACnC,WAAW,EACT,0EACC,IAEG,yCADA,mDAEN;gBAEC,EAAG,iCAAiC,MAAM;KACrC,CAAA,CACL;MACF;KACL,EAAA,CAAA;EAEM;;AAEhB"}
1
+ {"version":3,"file":"RelationshipsListPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/relationships/RelationshipsListPage.tsx"],"sourcesContent":["/**\n * Relationships list\n * @module subscriberbot/pages/relationships\n *\n * The core CRUDL list — every recurring relationship (subscription /\n * membership / license / contract) in one paginated, filterable view.\n * Data comes from `subListRelationships` (a SubRelationshipConnection).\n */\n\nimport { useMemo, useState } from 'react';\nimport { Plus, Search, Repeat2, ChevronRight } from 'lucide-react';\nimport { GlassCard, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { MiniProgress } from '../../components';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useRelationships } from '../../hooks/useSubscriberBotApi';\nimport { cn } from '../../utils/cn';\nimport {\n formatCurrency,\n formatDate,\n formatEnumLabel,\n formatIntervalSuffix,\n} from '../../utils/formatters';\nimport { useTr } from '../../hooks/useTr';\nimport { useCompactViewport } from '../../hooks/useCompactViewport';\nimport { MobileRelationshipList, MobileScreen } from '../../components/mobile';\nimport type { SubRelationshipKind, SubRelationshipStatus } from '../../types';\n\nconst PAGE_SIZE = 20;\n\nconst STATUSES: SubRelationshipStatus[] = [\n 'ACTIVE',\n 'TRIAL',\n 'PAUSED',\n 'PAST_DUE',\n 'LAPSED',\n 'EXPIRED',\n 'CANCELLED',\n];\n\nconst KINDS: SubRelationshipKind[] = [\n 'SUBSCRIPTION',\n 'MEMBERSHIP',\n 'LICENSE',\n 'CONTRACT',\n 'NEWSLETTER',\n 'RECURRING_PAYMENT',\n 'ENROLLMENT',\n 'TRIAL',\n];\n\nconst STATUS_KEY: Record<SubRelationshipStatus, string> = {\n ACTIVE: 'relationships.statuses.active',\n TRIAL: 'relationships.statuses.trial',\n PAUSED: 'relationships.statuses.paused',\n PAST_DUE: 'relationships.statuses.pastDue',\n LAPSED: 'relationships.statuses.lapsed',\n EXPIRED: 'relationships.statuses.expired',\n CANCELLED: 'relationships.statuses.cancelled',\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 selectCls =\n 'rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]';\n\n/** Map a 0–100 health score onto a MiniProgress tone. */\nfunction healthTone(\n score: number | null | undefined\n): 'positive' | 'accent' | 'warning' | 'negative' {\n if (score == null) return 'accent';\n if (score >= 66) return 'positive';\n if (score >= 33) return 'warning';\n return 'negative';\n}\n\nexport function RelationshipsListPage() {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const compact = useCompactViewport();\n const [page, setPage] = useState(0);\n const [statusFilter, setStatusFilter] = useState<'' | SubRelationshipStatus>('');\n const [kindFilter, setKindFilter] = useState<'' | SubRelationshipKind>('');\n const [search, setSearch] = useState('');\n const [searchInput, setSearchInput] = useState('');\n\n const { data, isLoading, isError, refetch, isFetching } = useRelationships({\n status: statusFilter || undefined,\n kind: kindFilter || undefined,\n search: search || undefined,\n pagination: { limit: PAGE_SIZE, offset: page * PAGE_SIZE },\n });\n\n const items = useMemo(() => data?.items ?? [], [data]);\n const hasMore = data?.pageInfo.hasMore ?? false;\n\n const submitSearch = (e: React.FormEvent) => {\n e.preventDefault();\n setSearch(searchInput.trim());\n setPage(0);\n };\n\n const content = (\n <>\n {/* Toolbar — search + filters, responsive */}\n <GlassCard treatment=\"plain\" className=\"p-3 sm:p-4\">\n <div className=\"flex flex-col gap-3 md:flex-row md:items-center\">\n <form onSubmit={submitSearch} className=\"relative flex-1 min-w-0\">\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <input\n type=\"text\"\n aria-label={tr('relationships.searchPlaceholder', 'Search relationships by label…')}\n placeholder={tr('relationships.searchPlaceholder', 'Search relationships by label…')}\n value={searchInput}\n onChange={(e) => setSearchInput(e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-10 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </form>\n <div className=\"flex flex-wrap gap-2 sm:flex-nowrap\">\n <select\n aria-label={tr('relationships.filters.kindLabel', 'Filter by kind')}\n value={kindFilter}\n onChange={(e) => {\n setKindFilter(e.target.value as '' | SubRelationshipKind);\n setPage(0);\n }}\n className={cn(selectCls, 'flex-1 sm:flex-none')}\n >\n <option value=\"\">{tr('relationships.filters.allKinds', 'All kinds')}</option>\n {KINDS.map((k) => (\n <option key={k} value={k}>\n {tr(KIND_KEY[k], formatEnumLabel(k))}\n </option>\n ))}\n </select>\n <select\n aria-label={tr('relationships.filters.statusLabel', 'Filter by status')}\n value={statusFilter}\n onChange={(e) => {\n setStatusFilter(e.target.value as '' | SubRelationshipStatus);\n setPage(0);\n }}\n className={cn(selectCls, 'flex-1 sm:flex-none')}\n >\n <option value=\"\">{tr('relationships.filters.allStatuses', 'All statuses')}</option>\n {STATUSES.map((s) => (\n <option key={s} value={s}>\n {tr(STATUS_KEY[s], formatEnumLabel(s))}\n </option>\n ))}\n </select>\n </div>\n </div>\n </GlassCard>\n\n {isLoading ? (\n <LoadingView label={tr('relationships.loading', 'Loading relationships…')} />\n ) : isError ? (\n <ErrorView\n message={tr('relationships.error', 'Could not load relationships.')}\n onRetry={() => void refetch()}\n />\n ) : items.length === 0 ? (\n <div className=\"mt-6\">\n <EmptyState\n illustration=\"empty-data\"\n icon={<Repeat2 className=\"h-12 w-12\" />}\n title={tr('relationships.emptyTitle', 'No relationships found')}\n description={\n search\n ? tr(\n 'relationships.emptyDescriptionSearch',\n 'No relationships match \"{{search}}\".',\n { search }\n )\n : tr(\n 'relationships.emptyDescription',\n 'Add your first recurring relationship to start tracking it.'\n )\n }\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships/new')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n {tr('relationships.addRelationship', 'Add relationship')}\n </button>\n }\n />\n </div>\n ) : (\n <>\n {/* Phones get swipeable cards; wider screens the portfolio table. */}\n {compact ? (\n <MobileRelationshipList items={items} navigateTo={navigateTo} />\n ) : (\n <GlassCard treatment=\"plain\" className=\"mt-4 overflow-hidden p-0\">\n <div className=\"overflow-x-auto\">\n <div className=\"min-w-[720px]\">\n <div className=\"grid grid-cols-[minmax(0,2.4fr)_1fr_1fr_1fr_1fr_1.3fr] gap-4 border-b border-border-seam bg-bg-sunken/60 px-4 py-2.5 text-xs font-medium uppercase tracking-wide text-text-secondary\">\n <span>{tr('relationships.table.subscription', 'Subscription')}</span>\n <span>{tr('relationships.table.kind', 'Kind')}</span>\n <span>{tr('relationships.table.status', 'Status')}</span>\n <span className=\"text-right\">{tr('relationships.table.amount', 'Amount')}</span>\n <span className=\"text-right\">\n {tr('relationships.table.renewsOn', 'Renews on')}\n </span>\n <span>{tr('relationships.table.health', 'Health')}</span>\n </div>\n <div className=\"divide-y divide-border-subtle\">\n {items.map((r) => {\n const score = r.healthScore;\n return (\n <button\n key={r.id}\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${r.id}`)}\n className=\"group grid w-full grid-cols-[minmax(0,2.4fr)_1fr_1fr_1fr_1fr_1.3fr] items-center gap-4 px-4 py-3.5 text-left transition-colors hover:bg-bg-sunken\"\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-semibold text-text-primary\">\n {r.label}\n </p>\n {r.provider?.name && (\n <p className=\"truncate text-xs text-text-secondary\">\n {r.provider.name}\n </p>\n )}\n </div>\n </div>\n <span>\n <span className=\"inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary\">\n {tr(KIND_KEY[r.kind], formatEnumLabel(r.kind))}\n </span>\n </span>\n <span>\n <StatusBadge status={r.status} />\n </span>\n <span className=\"text-right text-sm font-semibold tabular-nums text-text-primary\">\n {formatCurrency(r.amount, r.currency)}\n <span className=\"text-xs font-normal text-text-secondary\">\n {formatIntervalSuffix(r.interval)}\n </span>\n </span>\n <span className=\"text-right text-xs text-text-secondary\">\n {r.renewsAt ? formatDate(r.renewsAt) : '—'}\n </span>\n <span className=\"flex items-center gap-2\">\n {score != null ? (\n <>\n <MiniProgress\n value={score}\n max={100}\n tone={healthTone(score)}\n className=\"w-16 shrink-0 sm:w-20\"\n />\n <span className=\"text-xs tabular-nums text-text-secondary\">\n {score}\n </span>\n </>\n ) : (\n <span className=\"text-xs text-text-secondary\">—</span>\n )}\n <ChevronRight className=\"ml-auto h-4 w-4 shrink-0 text-text-secondary opacity-0 transition-opacity group-hover:opacity-100\" />\n </span>\n </button>\n );\n })}\n </div>\n </div>\n </div>\n </GlassCard>\n )}\n\n <div className=\"mt-4 flex items-center justify-between\">\n <p className=\"text-xs text-text-secondary\">\n {tr('relationships.pagination.page', 'Page {{page}}', { page: page + 1 })}\n {isFetching ? ` · ${tr('relationships.pagination.refreshing', 'refreshing…')}` : ''}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n disabled={page === 0}\n onClick={() => setPage((p) => Math.max(0, p - 1))}\n className={cn(\n 'rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium',\n page === 0\n ? 'cursor-not-allowed text-text-secondary opacity-50'\n : 'text-text-primary hover:bg-bg-sunken'\n )}\n >\n {tr('relationships.pagination.previous', 'Previous')}\n </button>\n <button\n type=\"button\"\n disabled={!hasMore}\n onClick={() => setPage((p) => p + 1)}\n className={cn(\n 'rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium',\n !hasMore\n ? 'cursor-not-allowed text-text-secondary opacity-50'\n : 'text-text-primary hover:bg-bg-sunken'\n )}\n >\n {tr('relationships.pagination.next', 'Next')}\n </button>\n </div>\n </div>\n </>\n )}\n </>\n );\n\n if (compact) {\n return (\n <MobileScreen\n testId=\"sb-mobile-relationships\"\n title={tr('relationships.title', 'Relationships')}\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships/new')}\n aria-label={tr('relationships.addRelationship', 'Add relationship')}\n className=\"flex size-11 items-center justify-center rounded-full bg-bg-surface text-text-primary shadow-sm\"\n >\n <Plus className=\"h-5 w-5\" />\n </button>\n }\n >\n {content}\n </MobileScreen>\n );\n }\n\n return (\n <PageLayout\n title={tr('relationships.title', 'Relationships')}\n description={tr(\n 'relationships.description',\n 'Every subscription, membership, license and contract you track'\n )}\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships/new')}\n 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\"\n >\n <Plus className=\"h-4 w-4\" /> {tr('relationships.addRelationship', 'Add relationship')}\n </button>\n }\n >\n <PagePurpose className=\"mb-4\">\n {tr(\n 'relationships.purpose',\n 'This is the fundamental object of Subscriber Bot. Filter by lifecycle and kind, open any row to manage its plan, payment, entitlements, assets and renewals, or advance its lifecycle.'\n )}\n </PagePurpose>\n\n {content}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,IAAY,IAEZ,IAA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