@burdenoff/microfe-subscriberbot 2026.1103.2 → 2026.1105.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 (198) hide show
  1. package/dist/index.js +3 -3
  2. package/dist/stories/Accessibility.stories.d.ts +13 -0
  3. package/dist/stories/Accessibility.stories.d.ts.map +1 -0
  4. package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
  5. package/dist/stories/pages/BankConnectionsPage.stories.d.ts +1 -0
  6. package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +1 -1
  7. package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +1 -1
  8. package/dist/stories/pages/InboxPage.stories.d.ts.map +1 -1
  9. package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
  10. package/dist/subscriberbot/admin/AdminDashboardPage.js +168 -168
  11. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  12. package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -1
  13. package/dist/subscriberbot/admin/NegotiationDeskPanel.js +116 -116
  14. package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
  15. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -1
  16. package/dist/subscriberbot/admin/ProcurementDeskPanel.js +211 -211
  17. package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
  18. package/dist/subscriberbot/components/Modal.d.ts.map +1 -1
  19. package/dist/subscriberbot/components/Modal.js +43 -33
  20. package/dist/subscriberbot/components/Modal.js.map +1 -1
  21. package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -1
  22. package/dist/subscriberbot/components/PostureOptions.js +10 -10
  23. package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
  24. package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
  25. package/dist/subscriberbot/components/StateViews.js +45 -37
  26. package/dist/subscriberbot/components/StateViews.js.map +1 -1
  27. package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
  28. package/dist/subscriberbot/components/StatusBadge.js +6 -6
  29. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  30. package/dist/subscriberbot/components/decisions/DecisionBanners.js +6 -6
  31. package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -1
  32. package/dist/subscriberbot/components/decisions/DecisionCard.js +149 -147
  33. package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
  34. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
  35. package/dist/subscriberbot/components/mobile/MobileDashboard.js +127 -127
  36. package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
  37. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -1
  38. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +114 -114
  39. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
  40. package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -1
  41. package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
  42. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +4 -4
  43. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -1
  44. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +11 -11
  45. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
  46. package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -1
  47. package/dist/subscriberbot/components/negotiations/OutcomeForm.js +29 -29
  48. package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
  49. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -1
  50. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +43 -43
  51. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
  52. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +4 -4
  53. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -1
  54. package/dist/subscriberbot/components/procurement/ProcurementThread.js +14 -14
  55. package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
  56. package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +1 -1
  57. package/dist/subscriberbot/components/savings/SavingsCards.js +242 -237
  58. package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
  59. package/dist/subscriberbot/components/viz.d.ts +1 -0
  60. package/dist/subscriberbot/components/viz.d.ts.map +1 -1
  61. package/dist/subscriberbot/components/viz.js +100 -101
  62. package/dist/subscriberbot/components/viz.js.map +1 -1
  63. package/dist/subscriberbot/hooks/index.js +1 -1
  64. package/dist/subscriberbot/hooks/useFormError.d.ts +7 -0
  65. package/dist/subscriberbot/hooks/useFormError.d.ts.map +1 -0
  66. package/dist/subscriberbot/hooks/useFormError.js +28 -0
  67. package/dist/subscriberbot/hooks/useFormError.js.map +1 -0
  68. package/dist/subscriberbot/hooks/useFormatters.d.ts +11 -0
  69. package/dist/subscriberbot/hooks/useFormatters.d.ts.map +1 -0
  70. package/dist/subscriberbot/hooks/useFormatters.js +13 -0
  71. package/dist/subscriberbot/hooks/useFormatters.js.map +1 -0
  72. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
  73. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +371 -370
  74. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  75. package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -1
  76. package/dist/subscriberbot/hooks/useTr.js +1 -1
  77. package/dist/subscriberbot/hooks/useTr.js.map +1 -1
  78. package/dist/subscriberbot/index.js +1 -1
  79. package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
  80. package/dist/subscriberbot/pages/AssetVaultPage.js +124 -124
  81. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
  82. package/dist/subscriberbot/pages/DashboardPage.d.ts +0 -10
  83. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
  84. package/dist/subscriberbot/pages/DashboardPage.js +107 -98
  85. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  86. package/dist/subscriberbot/pages/InboxPage.d.ts +0 -10
  87. package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
  88. package/dist/subscriberbot/pages/InboxPage.js +421 -402
  89. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  90. package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
  91. package/dist/subscriberbot/pages/InsightsPage.js +130 -121
  92. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
  93. package/dist/subscriberbot/pages/InvoicesPage.d.ts +0 -12
  94. package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
  95. package/dist/subscriberbot/pages/InvoicesPage.js +237 -215
  96. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  97. package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -1
  98. package/dist/subscriberbot/pages/RenewalsPage.js +303 -295
  99. package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
  100. package/dist/subscriberbot/pages/SavingsPage.d.ts.map +1 -1
  101. package/dist/subscriberbot/pages/SavingsPage.js +57 -57
  102. package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
  103. package/dist/subscriberbot/pages/WorkflowsPage.d.ts +0 -13
  104. package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
  105. package/dist/subscriberbot/pages/WorkflowsPage.js +202 -196
  106. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  107. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +0 -18
  108. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
  109. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +283 -275
  110. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  111. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +0 -6
  112. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
  113. package/dist/subscriberbot/pages/agents/AgentNewPage.js +85 -77
  114. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
  115. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +0 -9
  116. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
  117. package/dist/subscriberbot/pages/agents/AgentsListPage.js +136 -136
  118. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  119. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +0 -9
  120. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
  121. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +267 -260
  122. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
  123. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +0 -10
  124. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -1
  125. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +96 -96
  126. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
  127. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +0 -11
  128. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -1
  129. package/dist/subscriberbot/pages/decisions/DecisionsPage.js +46 -46
  130. package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
  131. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +0 -11
  132. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +1 -1
  133. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +181 -171
  134. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
  135. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +0 -9
  136. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -1
  137. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +164 -164
  138. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
  139. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +0 -9
  140. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -1
  141. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +197 -181
  142. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
  143. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +0 -8
  144. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -1
  145. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +79 -79
  146. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
  147. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +0 -9
  148. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -1
  149. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +147 -147
  150. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
  151. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +0 -10
  152. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -1
  153. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +204 -188
  154. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
  155. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +0 -9
  156. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -1
  157. package/dist/subscriberbot/pages/procurement/ProcurementPage.js +80 -80
  158. package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
  159. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +0 -10
  160. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
  161. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +484 -458
  162. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  163. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +0 -8
  164. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
  165. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +146 -136
  166. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  167. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +0 -10
  168. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
  169. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +88 -87
  170. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  171. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +0 -11
  172. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
  173. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +520 -490
  174. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  175. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +0 -8
  176. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
  177. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +104 -90
  178. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  179. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +0 -8
  180. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
  181. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +97 -96
  182. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  183. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -1
  184. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +76 -74
  185. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
  186. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +5 -3
  187. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -1
  188. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +26 -25
  189. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
  190. package/dist/subscriberbot/utils/formatters.d.ts +16 -5
  191. package/dist/subscriberbot/utils/formatters.d.ts.map +1 -1
  192. package/dist/subscriberbot/utils/formatters.js +57 -25
  193. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  194. package/dist/subscriberbot/utils/plaidLink.d.ts +2 -1
  195. package/dist/subscriberbot/utils/plaidLink.d.ts.map +1 -1
  196. package/dist/subscriberbot/utils/plaidLink.js +21 -21
  197. package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
  198. package/package.json +1 -1
@@ -1,21 +1,23 @@
1
1
  import { useSubscriberBot as e } from "../context/SubscriberBotContext.js";
2
- import { cn as t } from "../utils/cn.js";
3
- import { PageLayout as n } from "../components/PageLayout.js";
4
- import { MetricsCard as r } from "../components/MetricsCard.js";
5
- import { formatCurrency as i, formatDate as a, formatEnumLabel as o } from "../utils/formatters.js";
6
- import { EmptyState as s } from "../components/EmptyState.js";
7
- import { Modal as c } from "../components/Modal.js";
8
- import { useTr as l } from "../hooks/useTr.js";
9
- import { ErrorView as u, LoadingView as d, Section as f } from "../components/StateViews.js";
2
+ import { useTr as t } from "../hooks/useTr.js";
3
+ import { useFormatters as n } from "../hooks/useFormatters.js";
4
+ import { cn as r } from "../utils/cn.js";
5
+ import { PageLayout as i } from "../components/PageLayout.js";
6
+ import { MetricsCard as a } from "../components/MetricsCard.js";
7
+ import { EmptyState as o } from "../components/EmptyState.js";
8
+ import { Modal as s } from "../components/Modal.js";
9
+ import { ErrorView as c, LoadingView as l, Section as u } from "../components/StateViews.js";
10
10
  import "../components/index.js";
11
- import { useCancelRelationship as p, useCancelRenewalReminder as m, useRenewalForecast as h, useSetRenewalReminder as g, useTransitionRelationship as _ } from "../hooks/useSubscriberBotApi.js";
12
- import { countRenewalCharges as v, countRenewalsInWindow as y } from "../utils/renewals.js";
13
- import { useMemo as b, useState as x } from "react";
14
- import { Bell as S, BellOff as C, CalendarClock as w, CalendarRange as T, Hourglass as E, Layers as D, Plus as O, Search as k, Sparkles as A, Wallet as j } from "lucide-react";
15
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
16
- import { GlassCard as F, PagePurpose as I } from "@burdenoff/fe-libs/ui";
11
+ import { useCancelRelationship as d, useCancelRenewalReminder as f, useRenewalForecast as p, useSetRenewalReminder as m, useTransitionRelationship as h } from "../hooks/useSubscriberBotApi.js";
12
+ import { useFormError as g } from "../hooks/useFormError.js";
13
+ import { countRenewalCharges as _, countRenewalsInWindow as v } from "../utils/renewals.js";
14
+ import { useMemo as y, useState as b } from "react";
15
+ import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
16
+ import { Bell as S, BellOff as C, CalendarClock as w, CalendarRange as T, Hourglass as E, Layers as D, Plus as O, Search as k, Sparkles as A, Wallet as ee } from "lucide-react";
17
+ import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
18
+ import { GlassCard as P, PagePurpose as F } from "@burdenoff/fe-libs/ui";
17
19
  //#region src/subscriberbot/pages/RenewalsPage.tsx
18
- var L = 864e5, R = 3, ee = [
20
+ var I = 864e5, L = 3, R = [
19
21
  3,
20
22
  6,
21
23
  12
@@ -24,7 +26,7 @@ var L = 864e5, R = 3, ee = [
24
26
  7,
25
27
  14,
26
28
  30
27
- ], B = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", V = "rounded-lg border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", H = "mb-1.5 block text-xs font-medium text-text-secondary", U = "truncate rounded text-left text-sm font-medium text-text-primary hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", W = "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-60", G = "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-2.5 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90 disabled:opacity-60";
29
+ ], B = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", V = "rounded-lg border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", H = "mb-1.5 block text-xs font-medium text-text-secondary", U = "truncate rounded text-start text-sm font-medium text-text-primary hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", W = "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-60", G = "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-2.5 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90 disabled:opacity-60";
28
30
  function K(e) {
29
31
  let t = /* @__PURE__ */ new Date();
30
32
  return new Date(Date.UTC(t.getUTCFullYear(), t.getUTCMonth() + e, 1)).toISOString();
@@ -34,18 +36,18 @@ function q(e) {
34
36
  return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
35
37
  }
36
38
  function J(e) {
37
- let t = /* @__PURE__ */ new Date(new Date(e).getTime() - R * L), n = /* @__PURE__ */ new Date();
39
+ let t = /* @__PURE__ */ new Date(new Date(e).getTime() - L * I), n = /* @__PURE__ */ new Date();
38
40
  return q(t.getTime() < n.getTime() ? n : t);
39
41
  }
40
- function Y(e) {
41
- return new Date(Date.UTC(e.year, e.month - 1, 1)).toLocaleDateString(void 0, {
42
+ function Y(e, t) {
43
+ return new Date(Date.UTC(e.year, e.month - 1, 1)).toLocaleDateString(t, {
42
44
  month: "long",
43
45
  year: "numeric",
44
46
  timeZone: "UTC"
45
47
  });
46
48
  }
47
- function X(e) {
48
- return new Date(Date.UTC(e.year, e.month - 1, 1)).toLocaleDateString(void 0, {
49
+ function X(e, t) {
50
+ return new Date(Date.UTC(e.year, e.month - 1, 1)).toLocaleDateString(t, {
49
51
  month: "short",
50
52
  timeZone: "UTC"
51
53
  });
@@ -53,250 +55,256 @@ function X(e) {
53
55
  function Z(e, t) {
54
56
  return t <= 0 ? e("renewals.days.today", "today") : t === 1 ? e("renewals.days.tomorrow", "tomorrow") : e("renewals.days.inDays", "in {{days}} days", { days: t });
55
57
  }
56
- var Q = ({ target: e, onClose: t }) => {
57
- let n = l(), r = g(), [i, o] = x(() => J(e.targetAt)), [s, u] = x(""), [d, f] = x(null);
58
- return /* @__PURE__ */ N(c, {
59
- title: n("renewals.remind.title", "Remind me about {{label}}", { label: e.label }),
60
- description: e.kind === "trial" ? n("renewals.remind.trialDescription", "The trial ends on {{date}}. You will get an in-app notification on the day you choose.", { date: a(e.targetAt) }) : n("renewals.remind.renewalDescription", "It renews on {{date}}. You will get an in-app notification on the day you choose.", { date: a(e.targetAt) }),
61
- onClose: t,
62
- children: /* @__PURE__ */ P("form", {
63
- onSubmit: (a) => {
64
- a.preventDefault(), f(null);
65
- let o = /* @__PURE__ */ new Date(`${i}T09:00:00`);
66
- if (!i || Number.isNaN(o.getTime())) {
67
- f(n("renewals.remind.dateRequired", "Choose the day to be reminded on."));
58
+ var Q = ({ target: e, onClose: r }) => {
59
+ let { formatDate: i } = n(), a = t(), o = m(), [c, l] = b(() => J(e.targetAt)), [u, d] = b(""), [f, p, h, _] = g();
60
+ return /* @__PURE__ */ M(s, {
61
+ title: a("renewals.remind.title", "Remind me about {{label}}", { label: e.label }),
62
+ description: e.kind === "trial" ? a("renewals.remind.trialDescription", "The trial ends on {{date}}. You will get an in-app notification on the day you choose.", { date: i(e.targetAt) }) : a("renewals.remind.renewalDescription", "It renews on {{date}}. You will get an in-app notification on the day you choose.", { date: i(e.targetAt) }),
63
+ onClose: r,
64
+ children: /* @__PURE__ */ N("form", {
65
+ onSubmit: (t) => {
66
+ t.preventDefault(), p(null);
67
+ let n = /* @__PURE__ */ new Date(`${c}T09:00:00`);
68
+ if (!c || Number.isNaN(n.getTime())) {
69
+ p(a("renewals.remind.dateRequired", "Choose the day to be reminded on."), "renewal-reminder-day");
68
70
  return;
69
71
  }
70
- r.mutate({
72
+ o.mutate({
71
73
  relationshipId: e.relationshipId,
72
- remindAt: o.toISOString(),
73
- note: s.trim()
74
+ remindAt: n.toISOString(),
75
+ note: u.trim()
74
76
  }, {
75
- onSuccess: t,
76
- onError: (e) => f(e instanceof Error ? e.message : n("renewals.remind.error", "Could not set the reminder."))
77
+ onSuccess: r,
78
+ onError: (e) => p(e instanceof Error ? e.message : a("renewals.remind.error", "Could not set the reminder."))
77
79
  });
78
80
  },
79
81
  className: "space-y-4",
80
82
  children: [
81
- d && /* @__PURE__ */ N("div", {
83
+ f && /* @__PURE__ */ M("div", {
84
+ role: "alert",
85
+ id: _,
86
+ tabIndex: -1,
82
87
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
83
- children: d
88
+ children: f
84
89
  }),
85
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
90
+ /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("label", {
86
91
  htmlFor: "renewal-reminder-day",
87
92
  className: H,
88
- children: n("renewals.remind.day", "Remind me on")
89
- }), /* @__PURE__ */ N("input", {
93
+ children: a("renewals.remind.day", "Remind me on")
94
+ }), /* @__PURE__ */ M("input", {
90
95
  id: "renewal-reminder-day",
96
+ ...h("renewal-reminder-day"),
91
97
  type: "date",
92
- value: i,
98
+ value: c,
93
99
  min: q(/* @__PURE__ */ new Date()),
94
- onChange: (e) => o(e.target.value),
100
+ onChange: (e) => l(e.target.value),
95
101
  className: B
96
102
  })] }),
97
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
103
+ /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("label", {
98
104
  htmlFor: "renewal-reminder-note",
99
105
  className: H,
100
- children: n("renewals.remind.note", "Note (optional)")
101
- }), /* @__PURE__ */ N("textarea", {
106
+ children: a("renewals.remind.note", "Note (optional)")
107
+ }), /* @__PURE__ */ M("textarea", {
102
108
  id: "renewal-reminder-note",
103
- value: s,
109
+ value: u,
104
110
  maxLength: 500,
105
111
  rows: 3,
106
- onChange: (e) => u(e.target.value),
107
- placeholder: n("renewals.remind.notePlaceholder", "e.g. ask for the annual discount"),
112
+ onChange: (e) => d(e.target.value),
113
+ placeholder: a("renewals.remind.notePlaceholder", "e.g. ask for the annual discount"),
108
114
  className: B
109
115
  })] }),
110
- /* @__PURE__ */ P("div", {
116
+ /* @__PURE__ */ N("div", {
111
117
  className: "flex justify-end gap-2",
112
- children: [/* @__PURE__ */ N("button", {
118
+ children: [/* @__PURE__ */ M("button", {
113
119
  type: "button",
114
- onClick: t,
120
+ onClick: r,
115
121
  className: W,
116
- children: n("common.cancel", "Cancel")
117
- }), /* @__PURE__ */ P("button", {
122
+ children: a("common.cancel", "Cancel")
123
+ }), /* @__PURE__ */ N("button", {
118
124
  type: "submit",
119
- disabled: r.isPending,
125
+ disabled: o.isPending,
120
126
  className: G,
121
- children: [/* @__PURE__ */ N(S, {
127
+ children: [/* @__PURE__ */ M(S, {
122
128
  className: "h-3.5 w-3.5",
123
129
  "aria-hidden": !0
124
- }), n("renewals.remind.save", "Set reminder")]
130
+ }), a("renewals.remind.save", "Set reminder")]
125
131
  })]
126
132
  })
127
133
  ]
128
134
  })
129
135
  });
130
- }, te = ({ trial: e, onClose: t }) => {
131
- let n = l(), r = p(), [i, a] = x(null);
132
- return /* @__PURE__ */ P(c, {
133
- title: n("renewals.trials.cancelTitle", "Cancel the {{label}} trial?", { label: e.label }),
134
- description: n("renewals.trials.cancelDescription", "This marks the trial as cancelled in Subscriber Bot. Cancel it with the provider too, so you are not charged."),
135
- onClose: t,
136
- children: [i && /* @__PURE__ */ N("div", {
136
+ }, te = ({ trial: e, onClose: n }) => {
137
+ let r = t(), i = d(), [a, o] = b(null);
138
+ return /* @__PURE__ */ N(s, {
139
+ title: r("renewals.trials.cancelTitle", "Cancel the {{label}} trial?", { label: e.label }),
140
+ description: r("renewals.trials.cancelDescription", "This marks the trial as cancelled in Subscriber Bot. Cancel it with the provider too, so you are not charged."),
141
+ onClose: n,
142
+ children: [a && /* @__PURE__ */ M("div", {
143
+ role: "alert",
137
144
  className: "mb-4 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
138
- children: i
139
- }), /* @__PURE__ */ P("div", {
145
+ children: a
146
+ }), /* @__PURE__ */ N("div", {
140
147
  className: "flex justify-end gap-2",
141
- children: [/* @__PURE__ */ N("button", {
148
+ children: [/* @__PURE__ */ M("button", {
142
149
  type: "button",
143
- onClick: t,
150
+ onClick: n,
144
151
  className: W,
145
- children: n("renewals.trials.keep", "Keep trial")
146
- }), /* @__PURE__ */ N("button", {
152
+ children: r("renewals.trials.keep", "Keep trial")
153
+ }), /* @__PURE__ */ M("button", {
147
154
  type: "button",
148
- disabled: r.isPending,
149
- onClick: () => r.mutate(e.relationshipId, {
150
- onSuccess: t,
151
- onError: (e) => a(e instanceof Error ? e.message : n("renewals.trials.cancelError", "Could not cancel the trial."))
155
+ disabled: i.isPending,
156
+ onClick: () => i.mutate(e.relationshipId, {
157
+ onSuccess: n,
158
+ onError: (e) => o(e instanceof Error ? e.message : r("renewals.trials.cancelError", "Could not cancel the trial."))
152
159
  }),
153
160
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-danger-bg px-2.5 py-1.5 text-xs font-medium text-action-danger-text hover:bg-action-danger-bg-hover disabled:opacity-60",
154
- children: n("renewals.trials.confirmCancel", "Cancel trial")
161
+ children: r("renewals.trials.confirmCancel", "Cancel trial")
155
162
  })]
156
163
  })]
157
164
  });
158
- }, $ = ({ reminderId: e, reminderAt: t, label: n, onRemind: r, testId: i }) => {
159
- let o = l(), s = m();
160
- return e && t ? /* @__PURE__ */ P("span", {
165
+ }, $ = ({ reminderId: e, reminderAt: r, label: i, onRemind: a, testId: o }) => {
166
+ let { formatDate: s } = n(), c = t(), l = f();
167
+ return e && r ? /* @__PURE__ */ N("span", {
161
168
  className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2 py-1 text-xs font-medium text-status-success-text",
162
- "data-testid": `${i}-reminder`,
169
+ "data-testid": `${o}-reminder`,
163
170
  children: [
164
- /* @__PURE__ */ N(S, {
171
+ /* @__PURE__ */ M(S, {
165
172
  className: "h-3 w-3",
166
173
  "aria-hidden": !0
167
174
  }),
168
- o("renewals.remind.setFor", "Reminder {{date}}", { date: a(t) }),
169
- /* @__PURE__ */ N("button", {
175
+ c("renewals.remind.setFor", "Reminder {{date}}", { date: s(r) }),
176
+ /* @__PURE__ */ M("button", {
170
177
  type: "button",
171
- disabled: s.isPending,
172
- onClick: () => s.mutate(e),
173
- "aria-label": o("renewals.remind.cancelAria", "Cancel the reminder for {{label}}", { label: n }),
174
- className: "ml-0.5 rounded-full p-0.5 hover:bg-bg-sunken disabled:opacity-60",
175
- children: /* @__PURE__ */ N(C, {
178
+ disabled: l.isPending,
179
+ onClick: () => l.mutate(e),
180
+ "aria-label": c("renewals.remind.cancelAria", "Cancel the reminder for {{label}}", { label: i }),
181
+ className: "ms-0.5 rounded-full p-0.5 hover:bg-bg-sunken disabled:opacity-60",
182
+ children: /* @__PURE__ */ M(C, {
176
183
  className: "h-3 w-3",
177
184
  "aria-hidden": !0
178
185
  })
179
186
  })
180
187
  ]
181
- }) : /* @__PURE__ */ P("button", {
188
+ }) : /* @__PURE__ */ N("button", {
182
189
  type: "button",
183
- onClick: r,
190
+ onClick: a,
184
191
  className: W,
185
- "aria-label": o("renewals.remind.aria", "Remind me about {{label}}", { label: n }),
186
- "data-testid": `${i}-remind`,
187
- children: [/* @__PURE__ */ N(S, {
192
+ "aria-label": c("renewals.remind.aria", "Remind me about {{label}}", { label: i }),
193
+ "data-testid": `${o}-remind`,
194
+ children: [/* @__PURE__ */ M(S, {
188
195
  className: "h-3.5 w-3.5",
189
196
  "aria-hidden": !0
190
- }), o("renewals.remind.button", "Remind me")]
197
+ }), c("renewals.remind.button", "Remind me")]
191
198
  });
192
- }, ne = ({ forecast: e, fmt: n }) => {
193
- let r = Math.max(1, ...e.months.map((e) => e.amount));
194
- return /* @__PURE__ */ N("div", {
199
+ }, ne = ({ forecast: e, fmt: t }) => {
200
+ let { locale: n } = x(), i = Math.max(1, ...e.months.map((e) => e.amount));
201
+ return /* @__PURE__ */ M("div", {
195
202
  className: "flex h-48 items-end gap-2 sm:gap-3",
196
203
  role: "img",
197
- "aria-label": e.months.map((e) => `${Y(e)}: ${n(e.amount)}`).join(", "),
204
+ "aria-label": e.months.map((e) => `${Y(e, n)}: ${t(e.amount)}`).join(", "),
198
205
  "data-testid": "renewals-forecast-chart",
199
- children: e.months.map((e) => /* @__PURE__ */ P("div", {
206
+ children: e.months.map((e) => /* @__PURE__ */ N("div", {
200
207
  className: "flex h-full min-w-0 flex-1 flex-col items-center justify-end",
201
208
  children: [
202
- /* @__PURE__ */ N("span", {
209
+ /* @__PURE__ */ M("span", {
203
210
  className: "mb-1 truncate text-[11px] font-medium tabular-nums text-text-primary",
204
- children: e.amount > 0 ? n(e.amount) : ""
211
+ children: e.amount > 0 ? t(e.amount) : ""
205
212
  }),
206
- /* @__PURE__ */ N("div", {
207
- className: t("w-full max-w-12 rounded-t-md", e.amount > 0 ? "bg-action-primary-bg" : "bg-bg-sunken"),
208
- style: { height: `${Math.max(4, e.amount / r * 100)}%` }
213
+ /* @__PURE__ */ M("div", {
214
+ className: r("w-full max-w-12 rounded-t-md", e.amount > 0 ? "bg-action-primary-bg" : "bg-bg-sunken"),
215
+ style: { height: `${Math.max(4, e.amount / i * 100)}%` }
209
216
  }),
210
- /* @__PURE__ */ N("span", {
217
+ /* @__PURE__ */ M("span", {
211
218
  className: "mt-2 text-xs text-text-secondary",
212
- children: X(e)
219
+ children: X(e, n)
213
220
  })
214
221
  ]
215
222
  }, e.key))
216
223
  });
217
- }, re = ({ forecast: t, onRemind: n, onCancel: r }) => {
218
- let s = l(), { navigateTo: c } = e(), u = _(), [d, f] = x(null), p = t.trialsEndingSoon;
219
- return /* @__PURE__ */ P("div", {
224
+ }, re = ({ forecast: r, onRemind: i, onCancel: a }) => {
225
+ let { formatCurrency: o, formatDate: s, formatEnumLabel: c } = n(), l = t(), { navigateTo: u } = e(), d = h(), [f, p] = b(null), m = r.trialsEndingSoon;
226
+ return /* @__PURE__ */ N("div", {
220
227
  className: "rounded-2xl border border-status-warning-text/30 bg-status-warning-bg-subtle p-5",
221
228
  role: "region",
222
- "aria-label": s("renewals.trials.region", "Trials ending soon"),
229
+ "aria-label": l("renewals.trials.region", "Trials ending soon"),
223
230
  "data-testid": "renewals-trials-banner",
224
231
  children: [
225
- /* @__PURE__ */ P("div", {
232
+ /* @__PURE__ */ N("div", {
226
233
  className: "mb-3 flex items-start gap-3",
227
- children: [/* @__PURE__ */ N(E, {
234
+ children: [/* @__PURE__ */ M(E, {
228
235
  className: "mt-0.5 h-5 w-5 shrink-0 text-status-warning-text",
229
236
  "aria-hidden": !0
230
- }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("h2", {
237
+ }), /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("h2", {
231
238
  className: "text-sm font-semibold text-text-primary",
232
- children: p.length === 1 ? s("renewals.trials.titleOne", "1 trial ends in the next {{days}} days", { days: t.trialWindowDays }) : s("renewals.trials.titleMany", "{{count}} trials end in the next {{days}} days", {
233
- count: p.length,
234
- days: t.trialWindowDays
239
+ children: m.length === 1 ? l("renewals.trials.titleOne", "1 trial ends in the next {{days}} days", { days: r.trialWindowDays }) : l("renewals.trials.titleMany", "{{count}} trials end in the next {{days}} days", {
240
+ count: m.length,
241
+ days: r.trialWindowDays
235
242
  })
236
- }), /* @__PURE__ */ N("p", {
243
+ }), /* @__PURE__ */ M("p", {
237
244
  className: "text-xs text-text-secondary",
238
- children: s("renewals.trials.subtitle", "Decide before the card is charged: convert the ones you use, cancel the rest.")
245
+ children: l("renewals.trials.subtitle", "Decide before the card is charged: convert the ones you use, cancel the rest.")
239
246
  })] })]
240
247
  }),
241
- d && /* @__PURE__ */ N("div", {
248
+ f && /* @__PURE__ */ M("div", {
249
+ role: "alert",
242
250
  className: "mb-3 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
243
- children: d
251
+ children: f
244
252
  }),
245
- /* @__PURE__ */ N("ul", {
253
+ /* @__PURE__ */ M("ul", {
246
254
  className: "divide-y divide-border-subtle rounded-xl bg-bg-surface",
247
- children: p.map((e) => /* @__PURE__ */ P("li", {
255
+ children: m.map((e) => /* @__PURE__ */ N("li", {
248
256
  className: "flex flex-col gap-3 p-4 sm:flex-row sm:items-center",
249
257
  "data-testid": `renewals-trial-${e.relationshipId}`,
250
- children: [/* @__PURE__ */ P("div", {
258
+ children: [/* @__PURE__ */ N("div", {
251
259
  className: "min-w-0 flex-1",
252
- children: [/* @__PURE__ */ N("button", {
260
+ children: [/* @__PURE__ */ M("button", {
253
261
  type: "button",
254
262
  className: U,
255
- onClick: () => c(`/relationships/${e.relationshipId}`),
263
+ onClick: () => u(`/relationships/${e.relationshipId}`),
256
264
  children: e.label
257
- }), /* @__PURE__ */ P("p", {
265
+ }), /* @__PURE__ */ N("p", {
258
266
  className: "text-xs text-text-secondary",
259
- children: [s("renewals.trials.endsOn", "Ends {{when}} ({{date}}), then {{amount}} {{interval}}", {
260
- when: Z(s, e.daysRemaining),
261
- date: a(e.trialEndsAt),
262
- amount: i(e.amount, e.currency),
263
- interval: o(e.interval).toLowerCase()
267
+ children: [l("renewals.trials.endsOn", "Ends {{when}} ({{date}}), then {{amount}} {{interval}}", {
268
+ when: Z(l, e.daysRemaining),
269
+ date: s(e.trialEndsAt),
270
+ amount: o(e.amount, e.currency),
271
+ interval: c(e.interval).toLowerCase()
264
272
  }), e.providerName ? ` · ${e.providerName}` : ""]
265
273
  })]
266
- }), /* @__PURE__ */ P("div", {
274
+ }), /* @__PURE__ */ N("div", {
267
275
  className: "flex flex-wrap items-center gap-2",
268
276
  children: [
269
- /* @__PURE__ */ N($, {
277
+ /* @__PURE__ */ M($, {
270
278
  reminderId: e.reminderId,
271
279
  reminderAt: e.reminderAt,
272
280
  label: e.label,
273
281
  testId: `renewals-trial-${e.relationshipId}`,
274
- onRemind: () => n({
282
+ onRemind: () => i({
275
283
  relationshipId: e.relationshipId,
276
284
  label: e.label,
277
285
  targetAt: e.trialEndsAt,
278
286
  kind: "trial"
279
287
  })
280
288
  }),
281
- /* @__PURE__ */ N("button", {
289
+ /* @__PURE__ */ M("button", {
282
290
  type: "button",
283
291
  className: G,
284
- disabled: u.isPending,
285
- "aria-label": s("renewals.trials.convertAria", "Convert the {{label}} trial", { label: e.label }),
292
+ disabled: d.isPending,
293
+ "aria-label": l("renewals.trials.convertAria", "Convert the {{label}} trial", { label: e.label }),
286
294
  onClick: () => {
287
- f(null), u.mutate({
295
+ p(null), d.mutate({
288
296
  id: e.relationshipId,
289
297
  status: "ACTIVE"
290
- }, { onError: (e) => f(e instanceof Error ? e.message : s("renewals.trials.convertError", "Could not convert the trial.")) });
298
+ }, { onError: (e) => p(e instanceof Error ? e.message : l("renewals.trials.convertError", "Could not convert the trial.")) });
291
299
  },
292
- children: s("renewals.trials.convert", "Convert")
300
+ children: l("renewals.trials.convert", "Convert")
293
301
  }),
294
- /* @__PURE__ */ N("button", {
302
+ /* @__PURE__ */ M("button", {
295
303
  type: "button",
296
304
  className: W,
297
- "aria-label": s("renewals.trials.cancelAria", "Cancel the {{label}} trial", { label: e.label }),
298
- onClick: () => r(e),
299
- children: s("renewals.trials.cancel", "Cancel")
305
+ "aria-label": l("renewals.trials.cancelAria", "Cancel the {{label}} trial", { label: e.label }),
306
+ onClick: () => a(e),
307
+ children: l("renewals.trials.cancel", "Cancel")
300
308
  })
301
309
  ]
302
310
  })]
@@ -304,260 +312,260 @@ var Q = ({ target: e, onClose: t }) => {
304
312
  })
305
313
  ]
306
314
  });
307
- }, ie = ({ item: t, monthKey: n, onRemind: r }) => {
308
- let a = l(), { navigateTo: s } = e(), c = `renewals-row-${n}-${t.relationshipId}`;
309
- return /* @__PURE__ */ P("li", {
315
+ }, ie = ({ item: r, monthKey: i, onRemind: a }) => {
316
+ let { locale: o } = x(), { formatCurrency: s, formatEnumLabel: c } = n(), l = t(), { navigateTo: u } = e(), d = `renewals-row-${i}-${r.relationshipId}`;
317
+ return /* @__PURE__ */ N("li", {
310
318
  className: "flex flex-col gap-3 p-4 md:flex-row md:items-center",
311
- "data-testid": c,
312
- children: [/* @__PURE__ */ P("div", {
319
+ "data-testid": d,
320
+ children: [/* @__PURE__ */ N("div", {
313
321
  className: "flex min-w-0 flex-1 items-start gap-3",
314
- children: [/* @__PURE__ */ P("div", {
322
+ children: [/* @__PURE__ */ N("div", {
315
323
  className: "flex w-12 shrink-0 flex-col items-center rounded-lg bg-bg-sunken py-1",
316
- children: [/* @__PURE__ */ N("span", {
324
+ children: [/* @__PURE__ */ M("span", {
317
325
  className: "text-[10px] uppercase text-text-secondary",
318
- children: new Date(t.renewsAt).toLocaleDateString(void 0, { month: "short" })
319
- }), /* @__PURE__ */ N("span", {
326
+ children: new Date(r.renewsAt).toLocaleDateString(o, { month: "short" })
327
+ }), /* @__PURE__ */ M("span", {
320
328
  className: "text-base font-semibold tabular-nums text-text-primary",
321
- children: new Date(t.renewsAt).getDate()
329
+ children: new Date(r.renewsAt).getDate()
322
330
  })]
323
- }), /* @__PURE__ */ P("div", {
331
+ }), /* @__PURE__ */ N("div", {
324
332
  className: "min-w-0",
325
333
  children: [
326
- /* @__PURE__ */ N("button", {
334
+ /* @__PURE__ */ M("button", {
327
335
  type: "button",
328
336
  className: U,
329
- onClick: () => s(`/relationships/${t.relationshipId}`),
330
- children: t.label
337
+ onClick: () => u(`/relationships/${r.relationshipId}`),
338
+ children: r.label
331
339
  }),
332
- /* @__PURE__ */ N("p", {
340
+ /* @__PURE__ */ M("p", {
333
341
  className: "text-xs text-text-secondary",
334
342
  children: [
335
- t.providerName,
336
- o(t.interval),
337
- Z(a, t.daysRemaining),
338
- t.autoRenew ? null : a("renewals.row.noAutoRenew", "does not auto-renew"),
339
- t.occurrenceCount > 1 ? a("renewals.row.occurrences", "{{count}} charges this month", { count: t.occurrenceCount }) : null
343
+ r.providerName,
344
+ c(r.interval),
345
+ Z(l, r.daysRemaining),
346
+ r.autoRenew ? null : l("renewals.row.noAutoRenew", "does not auto-renew"),
347
+ r.occurrenceCount > 1 ? l("renewals.row.occurrences", "{{count}} charges this month", { count: r.occurrenceCount }) : null
340
348
  ].filter(Boolean).join(" · ")
341
349
  }),
342
- /* @__PURE__ */ P("div", {
350
+ /* @__PURE__ */ N("div", {
343
351
  className: "mt-1 flex flex-wrap gap-1.5",
344
- children: [t.status !== "ACTIVE" && /* @__PURE__ */ N("span", {
352
+ children: [r.status !== "ACTIVE" && /* @__PURE__ */ M("span", {
345
353
  className: "rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] font-medium text-text-secondary",
346
- children: o(t.status)
347
- }), t.needsReview && /* @__PURE__ */ P("span", {
354
+ children: c(r.status)
355
+ }), r.needsReview && /* @__PURE__ */ N("span", {
348
356
  className: "inline-flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-[11px] font-medium text-status-warning-text",
349
- children: [/* @__PURE__ */ N(A, {
357
+ children: [/* @__PURE__ */ M(A, {
350
358
  className: "h-3 w-3",
351
359
  "aria-hidden": !0
352
- }), t.openDecisionKind ? a("renewals.row.decision", "AI: {{kind}}", { kind: o(t.openDecisionKind) }) : a("renewals.row.lowHealth", "Low health score")]
360
+ }), r.openDecisionKind ? l("renewals.row.decision", "AI: {{kind}}", { kind: c(r.openDecisionKind) }) : l("renewals.row.lowHealth", "Low health score")]
353
361
  })]
354
362
  })
355
363
  ]
356
364
  })]
357
- }), /* @__PURE__ */ P("div", {
365
+ }), /* @__PURE__ */ N("div", {
358
366
  className: "flex flex-wrap items-center gap-2 md:justify-end",
359
367
  children: [
360
- /* @__PURE__ */ N("span", {
361
- className: "mr-2 text-sm font-semibold tabular-nums text-text-primary",
362
- children: i(t.amount, t.currency)
368
+ /* @__PURE__ */ M("span", {
369
+ className: "me-2 text-sm font-semibold tabular-nums text-text-primary",
370
+ children: s(r.amount, r.currency)
363
371
  }),
364
- /* @__PURE__ */ N($, {
365
- reminderId: t.reminderId,
366
- reminderAt: t.reminderAt,
367
- label: t.label,
368
- testId: c,
369
- onRemind: () => r({
370
- relationshipId: t.relationshipId,
371
- label: t.label,
372
- targetAt: t.renewsAt,
372
+ /* @__PURE__ */ M($, {
373
+ reminderId: r.reminderId,
374
+ reminderAt: r.reminderAt,
375
+ label: r.label,
376
+ testId: d,
377
+ onRemind: () => a({
378
+ relationshipId: r.relationshipId,
379
+ label: r.label,
380
+ targetAt: r.renewsAt,
373
381
  kind: "renewal"
374
382
  })
375
383
  }),
376
- /* @__PURE__ */ P("button", {
384
+ /* @__PURE__ */ N("button", {
377
385
  type: "button",
378
- onClick: () => s(t.openDecisionId ? `/decisions/${t.openDecisionId}` : `/relationships/${t.relationshipId}`),
379
- className: t.needsReview ? G : W,
380
- "aria-label": a("renewals.review.aria", "Review {{label}}", { label: t.label }),
381
- "data-testid": `${c}-review`,
382
- children: [/* @__PURE__ */ N(k, {
386
+ onClick: () => u(r.openDecisionId ? `/decisions/${r.openDecisionId}` : `/relationships/${r.relationshipId}`),
387
+ className: r.needsReview ? G : W,
388
+ "aria-label": l("renewals.review.aria", "Review {{label}}", { label: r.label }),
389
+ "data-testid": `${d}-review`,
390
+ children: [/* @__PURE__ */ M(k, {
383
391
  className: "h-3.5 w-3.5",
384
392
  "aria-hidden": !0
385
- }), a("renewals.review.button", "Review")]
393
+ }), l("renewals.review.button", "Review")]
386
394
  })
387
395
  ]
388
396
  })]
389
397
  });
390
398
  }, ae = () => {
391
- let t = l(), { navigateTo: a } = e(), [o, c] = x(6), [p, m] = x(7), [g, _] = x(null), [C, k] = x(null), A = h({
392
- to: b(() => K(o), [o]),
393
- trialWindowDays: p
394
- }), L = A.data, R = b(() => {
395
- if (!L) return null;
396
- let e = L.months.flatMap((e) => e.items), t = /* @__PURE__ */ new Set();
399
+ let { locale: r } = x(), { formatCurrency: s } = n(), d = t(), { navigateTo: f } = e(), [m, h] = b(6), [g, C] = b(7), [k, A] = b(null), [I, L] = b(null), B = p({
400
+ to: y(() => K(m), [m]),
401
+ trialWindowDays: g
402
+ }), H = B.data, U = y(() => {
403
+ if (!H) return null;
404
+ let e = H.months.flatMap((e) => e.items), t = /* @__PURE__ */ new Set();
397
405
  for (let n of e) n.reminderId && t.add(n.reminderId);
398
- for (let e of L.trialsEndingSoon) e.reminderId && t.add(e.reminderId);
399
- let n = y(e, Date.now(), 30);
406
+ for (let e of H.trialsEndingSoon) e.reminderId && t.add(e.reminderId);
407
+ let n = v(e, Date.now(), 30);
400
408
  return {
401
409
  reminders: t.size,
402
410
  next30: n,
403
411
  review: e.filter((e) => e.needsReview).length
404
412
  };
405
- }, [L]);
406
- if (A.isLoading) return /* @__PURE__ */ N(d, { label: t("renewals.loading", "Forecasting your renewals…") });
407
- if (A.isError || !L || !R) return /* @__PURE__ */ N(u, {
408
- message: t("renewals.error", "Could not load the renewals forecast."),
409
- onRetry: () => void A.refetch()
413
+ }, [H]);
414
+ if (B.isLoading) return /* @__PURE__ */ M(l, { label: d("renewals.loading", "Forecasting your renewals…") });
415
+ if (B.isError || !H || !U) return /* @__PURE__ */ M(c, {
416
+ message: d("renewals.error", "Could not load the renewals forecast."),
417
+ onRetry: () => void B.refetch()
410
418
  });
411
- let B = (e) => i(e, L.currency), H = L.months.filter((e) => e.items.length > 0), U = H.length === 0 && L.trialsEndingSoon.length === 0;
412
- return /* @__PURE__ */ P(n, {
413
- title: t("renewals.title", "Renewals & trials"),
414
- description: t("renewals.description", "Everything that renews or ends in the coming months, with a reminder or a review one click away."),
415
- actions: /* @__PURE__ */ P("div", {
419
+ let W = (e) => s(e, H.currency), G = H.months.filter((e) => e.items.length > 0), q = G.length === 0 && H.trialsEndingSoon.length === 0;
420
+ return /* @__PURE__ */ N(i, {
421
+ title: d("renewals.title", "Renewals & trials"),
422
+ description: d("renewals.description", "Everything that renews or ends in the coming months, with a reminder or a review one click away."),
423
+ actions: /* @__PURE__ */ N("div", {
416
424
  className: "flex flex-wrap items-center gap-2",
417
- children: [/* @__PURE__ */ P("label", {
425
+ children: [/* @__PURE__ */ N("label", {
418
426
  className: "flex items-center gap-2 text-xs text-text-secondary",
419
- children: [t("renewals.filters.horizon", "Forecast"), /* @__PURE__ */ N("select", {
420
- value: o,
421
- onChange: (e) => c(Number(e.target.value)),
427
+ children: [d("renewals.filters.horizon", "Forecast"), /* @__PURE__ */ M("select", {
428
+ value: m,
429
+ onChange: (e) => h(Number(e.target.value)),
422
430
  className: V,
423
431
  "data-testid": "renewals-horizon",
424
- children: ee.map((e) => /* @__PURE__ */ N("option", {
432
+ children: R.map((e) => /* @__PURE__ */ M("option", {
425
433
  value: e,
426
- children: t("renewals.filters.months", "{{count}} months", { count: e })
434
+ children: d("renewals.filters.months", "{{count}} months", { count: e })
427
435
  }, e))
428
436
  })]
429
- }), /* @__PURE__ */ P("label", {
437
+ }), /* @__PURE__ */ N("label", {
430
438
  className: "flex items-center gap-2 text-xs text-text-secondary",
431
- children: [t("renewals.filters.trialWindow", "Trials ending within"), /* @__PURE__ */ N("select", {
432
- value: p,
433
- onChange: (e) => m(Number(e.target.value)),
439
+ children: [d("renewals.filters.trialWindow", "Trials ending within"), /* @__PURE__ */ M("select", {
440
+ value: g,
441
+ onChange: (e) => C(Number(e.target.value)),
434
442
  className: V,
435
443
  "data-testid": "renewals-trial-window",
436
- children: z.map((e) => /* @__PURE__ */ N("option", {
444
+ children: z.map((e) => /* @__PURE__ */ M("option", {
437
445
  value: e,
438
- children: t("renewals.filters.days", "{{count}} days", { count: e })
446
+ children: d("renewals.filters.days", "{{count}} days", { count: e })
439
447
  }, e))
440
448
  })]
441
449
  })]
442
450
  }),
443
451
  children: [
444
- /* @__PURE__ */ N(I, {
452
+ /* @__PURE__ */ M(F, {
445
453
  className: "mb-2",
446
- children: t("renewals.purpose", "Renewal and trial dates are where subscription money leaks. Set a reminder before anything renews, review the ones the AI has flagged, and convert or cancel trials before you are charged.")
454
+ children: d("renewals.purpose", "Renewal and trial dates are where subscription money leaks. Set a reminder before anything renews, review the ones the AI has flagged, and convert or cancel trials before you are charged.")
447
455
  }),
448
- U ? /* @__PURE__ */ N(s, {
449
- icon: /* @__PURE__ */ N(T, { className: "h-8 w-8" }),
450
- title: t("renewals.emptyTitle", "Nothing renews in this period"),
451
- description: t("renewals.emptyDescription", "Add renewal dates to your subscriptions and their renewals and trial deadlines will be forecast here."),
452
- action: /* @__PURE__ */ P("button", {
456
+ q ? /* @__PURE__ */ M(o, {
457
+ icon: /* @__PURE__ */ M(T, { className: "h-8 w-8" }),
458
+ title: d("renewals.emptyTitle", "Nothing renews in this period"),
459
+ description: d("renewals.emptyDescription", "Add renewal dates to your subscriptions and their renewals and trial deadlines will be forecast here."),
460
+ action: /* @__PURE__ */ N("button", {
453
461
  type: "button",
454
- onClick: () => a("/relationships/new"),
462
+ onClick: () => f("/relationships/new"),
455
463
  className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
456
- children: [/* @__PURE__ */ N(O, {
464
+ children: [/* @__PURE__ */ M(O, {
457
465
  className: "h-4 w-4",
458
466
  "aria-hidden": !0
459
- }), t("renewals.addSubscription", "Add a subscription")]
467
+ }), d("renewals.addSubscription", "Add a subscription")]
460
468
  })
461
- }) : /* @__PURE__ */ P(M, { children: [
462
- /* @__PURE__ */ P("div", {
469
+ }) : /* @__PURE__ */ N(j, { children: [
470
+ /* @__PURE__ */ N("div", {
463
471
  className: "grid grid-cols-2 gap-4 lg:grid-cols-4",
464
472
  "data-testid": "renewals-kpis",
465
473
  children: [
466
- /* @__PURE__ */ N(r, {
467
- icon: /* @__PURE__ */ N(j, { className: "h-5 w-5" }),
468
- value: B(L.totalAmount),
469
- label: t("renewals.metrics.total", "Renewing in the next {{count}} months", { count: o }),
474
+ /* @__PURE__ */ M(a, {
475
+ icon: /* @__PURE__ */ M(ee, { className: "h-5 w-5" }),
476
+ value: W(H.totalAmount),
477
+ label: d("renewals.metrics.total", "Renewing in the next {{count}} months", { count: m }),
470
478
  featured: !0
471
479
  }),
472
- /* @__PURE__ */ N(r, {
473
- icon: /* @__PURE__ */ N(w, { className: "h-5 w-5" }),
474
- value: R.next30,
475
- label: t("renewals.metrics.next30", "Renewals in 30 days")
480
+ /* @__PURE__ */ M(a, {
481
+ icon: /* @__PURE__ */ M(w, { className: "h-5 w-5" }),
482
+ value: U.next30,
483
+ label: d("renewals.metrics.next30", "Renewals in 30 days")
476
484
  }),
477
- /* @__PURE__ */ N(r, {
478
- icon: /* @__PURE__ */ N(E, { className: "h-5 w-5" }),
479
- value: L.trialsEndingSoon.length,
480
- label: t("renewals.metrics.trials", "Trials ending soon")
485
+ /* @__PURE__ */ M(a, {
486
+ icon: /* @__PURE__ */ M(E, { className: "h-5 w-5" }),
487
+ value: H.trialsEndingSoon.length,
488
+ label: d("renewals.metrics.trials", "Trials ending soon")
481
489
  }),
482
- /* @__PURE__ */ N(r, {
483
- icon: /* @__PURE__ */ N(S, { className: "h-5 w-5" }),
484
- value: R.reminders,
485
- label: t("renewals.metrics.reminders", "Reminders set")
490
+ /* @__PURE__ */ M(a, {
491
+ icon: /* @__PURE__ */ M(S, { className: "h-5 w-5" }),
492
+ value: U.reminders,
493
+ label: d("renewals.metrics.reminders", "Reminders set")
486
494
  })
487
495
  ]
488
496
  }),
489
- L.trialsEndingSoon.length > 0 && /* @__PURE__ */ N(re, {
490
- forecast: L,
491
- onRemind: _,
492
- onCancel: k
497
+ H.trialsEndingSoon.length > 0 && /* @__PURE__ */ M(re, {
498
+ forecast: H,
499
+ onRemind: A,
500
+ onCancel: L
493
501
  }),
494
- /* @__PURE__ */ P(F, {
502
+ /* @__PURE__ */ N(P, {
495
503
  treatment: "plain",
496
504
  className: "p-6",
497
505
  children: [
498
- /* @__PURE__ */ P("div", {
506
+ /* @__PURE__ */ N("div", {
499
507
  className: "mb-4 flex flex-wrap items-baseline justify-between gap-2",
500
- children: [/* @__PURE__ */ N("h3", {
508
+ children: [/* @__PURE__ */ M("h3", {
501
509
  className: "text-sm font-semibold text-text-primary",
502
- children: t("renewals.chart.title", "Renewal forecast")
503
- }), /* @__PURE__ */ N("span", {
510
+ children: d("renewals.chart.title", "Renewal forecast")
511
+ }), /* @__PURE__ */ M("span", {
504
512
  className: "text-xs text-text-secondary",
505
- children: t("renewals.chart.summary", "{{count}} renewals · {{amount}} in {{currency}}", {
506
- count: L.renewalCount,
507
- amount: B(L.totalAmount),
508
- currency: L.currency
513
+ children: d("renewals.chart.summary", "{{count}} renewals · {{amount}} in {{currency}}", {
514
+ count: H.renewalCount,
515
+ amount: W(H.totalAmount),
516
+ currency: H.currency
509
517
  })
510
518
  })]
511
519
  }),
512
- /* @__PURE__ */ N(ne, {
513
- forecast: L,
514
- fmt: B
520
+ /* @__PURE__ */ M(ne, {
521
+ forecast: H,
522
+ fmt: W
515
523
  }),
516
- L.otherCurrencyTotals.length > 0 && /* @__PURE__ */ N("p", {
524
+ H.otherCurrencyTotals.length > 0 && /* @__PURE__ */ M("p", {
517
525
  className: "mt-4 text-xs text-text-secondary",
518
526
  "data-testid": "renewals-other-currencies",
519
- children: t("renewals.chart.otherCurrencies", "Also renewing in other currencies: {{list}}", { list: L.otherCurrencyTotals.map((e) => i(e.amount, e.currency)).join(", ") })
527
+ children: d("renewals.chart.otherCurrencies", "Also renewing in other currencies: {{list}}", { list: H.otherCurrencyTotals.map((e) => s(e.amount, e.currency)).join(", ") })
520
528
  }),
521
- L.truncated && /* @__PURE__ */ N("p", {
529
+ H.truncated && /* @__PURE__ */ M("p", {
522
530
  className: "mt-2 text-xs text-status-warning-text",
523
- children: t("renewals.truncated", "Your portfolio is larger than one forecast covers, so these figures are partial.")
531
+ children: d("renewals.truncated", "Your portfolio is larger than one forecast covers, so these figures are partial.")
524
532
  })
525
533
  ]
526
534
  }),
527
- /* @__PURE__ */ N(f, {
528
- title: t("renewals.list.title", "Upcoming renewals"),
529
- description: R.review > 0 ? t("renewals.list.reviewCount", "{{count}} need a review", { count: R.review }) : void 0,
530
- children: H.length === 0 ? /* @__PURE__ */ N(F, {
535
+ /* @__PURE__ */ M(u, {
536
+ title: d("renewals.list.title", "Upcoming renewals"),
537
+ description: U.review > 0 ? d("renewals.list.reviewCount", "{{count}} need a review", { count: U.review }) : void 0,
538
+ children: G.length === 0 ? /* @__PURE__ */ M(P, {
531
539
  treatment: "plain",
532
540
  className: "p-6 text-sm text-text-secondary",
533
- children: t("renewals.list.none", "No dated renewals in this period.")
534
- }) : /* @__PURE__ */ N("div", {
541
+ children: d("renewals.list.none", "No dated renewals in this period.")
542
+ }) : /* @__PURE__ */ M("div", {
535
543
  className: "space-y-6",
536
- children: H.map((e) => /* @__PURE__ */ P("div", {
544
+ children: G.map((e) => /* @__PURE__ */ N("div", {
537
545
  "data-testid": `renewals-month-${e.key}`,
538
- children: [/* @__PURE__ */ P("div", {
546
+ children: [/* @__PURE__ */ N("div", {
539
547
  className: "mb-2 flex flex-wrap items-baseline justify-between gap-2 px-1",
540
- children: [/* @__PURE__ */ N("h3", {
548
+ children: [/* @__PURE__ */ M("h3", {
541
549
  className: "text-sm font-semibold text-text-primary",
542
- children: Y(e)
543
- }), /* @__PURE__ */ P("span", {
550
+ children: Y(e, r)
551
+ }), /* @__PURE__ */ N("span", {
544
552
  className: "text-xs tabular-nums text-text-secondary",
545
- children: [/* @__PURE__ */ N(D, {
546
- className: "mr-1 inline h-3 w-3",
553
+ children: [/* @__PURE__ */ M(D, {
554
+ className: "me-1 inline h-3 w-3",
547
555
  "aria-hidden": !0
548
- }), t("renewals.list.monthSummary", "{{count}} renewals · {{amount}}", {
549
- count: v(e.items),
550
- amount: [B(e.amount)].concat(e.otherCurrencyTotals.map((e) => i(e.amount, e.currency))).join(" + ")
556
+ }), d("renewals.list.monthSummary", "{{count}} renewals · {{amount}}", {
557
+ count: _(e.items),
558
+ amount: [W(e.amount)].concat(e.otherCurrencyTotals.map((e) => s(e.amount, e.currency))).join(" + ")
551
559
  })]
552
560
  })]
553
- }), /* @__PURE__ */ N(F, {
561
+ }), /* @__PURE__ */ M(P, {
554
562
  treatment: "plain",
555
- children: /* @__PURE__ */ N("ul", {
563
+ children: /* @__PURE__ */ M("ul", {
556
564
  className: "divide-y divide-border-subtle",
557
- children: e.items.map((t) => /* @__PURE__ */ N(ie, {
565
+ children: e.items.map((t) => /* @__PURE__ */ M(ie, {
558
566
  item: t,
559
567
  monthKey: e.key,
560
- onRemind: _
568
+ onRemind: A
561
569
  }, t.relationshipId))
562
570
  })
563
571
  })]
@@ -565,13 +573,13 @@ var Q = ({ target: e, onClose: t }) => {
565
573
  })
566
574
  })
567
575
  ] }),
568
- g && /* @__PURE__ */ N(Q, {
569
- target: g,
570
- onClose: () => _(null)
576
+ k && /* @__PURE__ */ M(Q, {
577
+ target: k,
578
+ onClose: () => A(null)
571
579
  }),
572
- C && /* @__PURE__ */ N(te, {
573
- trial: C,
574
- onClose: () => k(null)
580
+ I && /* @__PURE__ */ M(te, {
581
+ trial: I,
582
+ onClose: () => L(null)
575
583
  })
576
584
  ]
577
585
  });