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