@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.
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +134 -151
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoot.js +10 -7
- package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.js +1 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.js +9 -10
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/AdminRoot.js +2 -3
- package/dist/subscriberbot/admin/AdminRoot.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +56 -57
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +107 -108
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/index.js +1 -1
- package/dist/subscriberbot/components/EmptyState.js +1 -2
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.js +1 -2
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/Modal.js +2 -3
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +1 -2
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.js +7 -8
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +1 -2
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +2 -3
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +7 -8
- package/dist/subscriberbot/components/decisions/DecisionBanners.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.js +65 -66
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/decisions/decisionModel.js +2 -3
- package/dist/subscriberbot/components/decisions/decisionModel.js.map +1 -1
- package/dist/subscriberbot/components/decisions/index.js +4 -3
- package/dist/subscriberbot/components/index.js +8 -7
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +23 -24
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +40 -49
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -2
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +1 -2
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -1
- package/dist/subscriberbot/components/mobile/index.js +4 -3
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +1 -2
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +4 -5
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +4 -5
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/index.js +5 -4
- package/dist/subscriberbot/components/negotiations/labels.js +1 -2
- package/dist/subscriberbot/components/negotiations/labels.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +1 -2
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/procurement/index.js +5 -4
- package/dist/subscriberbot/components/procurement/labels.js +1 -2
- package/dist/subscriberbot/components/procurement/labels.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.js +90 -91
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/savings/index.js +3 -2
- package/dist/subscriberbot/components/savings/savingsModel.js +2 -3
- package/dist/subscriberbot/components/savings/savingsModel.js.map +1 -1
- package/dist/subscriberbot/components/viz.js +2 -3
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/context/SubscriberBotContext.js +3 -3
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/context/index.js +1 -1
- package/dist/subscriberbot/hooks/index.js +2 -2
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +2 -3
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -1
- package/dist/subscriberbot/hooks/useBankingApi.js +2 -3
- package/dist/subscriberbot/hooks/useBankingApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useCompactViewport.js +1 -2
- package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormError.js +1 -2
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormatters.js +1 -2
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -1
- package/dist/subscriberbot/hooks/useNegotiationApi.js +2 -3
- package/dist/subscriberbot/hooks/useNegotiationApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useProcurementApi.js +2 -3
- package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useRouteSelection.js +3 -3
- package/dist/subscriberbot/hooks/useRouteSelection.js.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +1 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -2
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.js +9 -8
- package/dist/subscriberbot/pages/AssetVaultPage.js +34 -35
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +86 -87
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +194 -199
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +28 -29
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +179 -188
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.js +293 -298
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.js +25 -26
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +67 -68
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +126 -127
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +10 -11
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +23 -24
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +337 -359
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js +22 -27
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +25 -26
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +34 -35
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +125 -130
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +94 -95
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +15 -16
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +20 -21
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +86 -87
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +164 -165
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +20 -21
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +350 -351
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.js +95 -96
- package/dist/subscriberbot/pages/providers/ProviderInsights.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +11 -12
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +62 -63
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +166 -172
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +12 -13
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +21 -22
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +242 -255
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +2 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js +1 -2
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/subscriberbot/store/index.js +1 -1
- package/dist/subscriberbot/store/subscriberbotStore.js +1 -2
- package/dist/subscriberbot/store/subscriberbotStore.js.map +1 -1
- package/dist/subscriberbot/utils/bankRedirectLink.js +18 -19
- package/dist/subscriberbot/utils/bankRedirectLink.js.map +1 -1
- package/dist/subscriberbot/utils/chartScale.js +1 -2
- package/dist/subscriberbot/utils/chartScale.js.map +1 -1
- package/dist/subscriberbot/utils/cn.js +2 -3
- package/dist/subscriberbot/utils/cn.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.js +4 -5
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/navigation.js +1 -2
- package/dist/subscriberbot/utils/navigation.js.map +1 -1
- package/dist/subscriberbot/utils/pageContext.js +3 -4
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -22
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/dist/subscriberbot/utils/portfolio.d.ts +4 -3
- package/dist/subscriberbot/utils/portfolio.d.ts.map +1 -1
- package/dist/subscriberbot/utils/portfolio.js +10 -11
- package/dist/subscriberbot/utils/portfolio.js.map +1 -1
- package/dist/subscriberbot/utils/renewals.js +1 -2
- package/dist/subscriberbot/utils/renewals.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,130 +1,126 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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 {
|
|
12
|
-
import {
|
|
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
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { GlassCard as
|
|
19
|
-
|
|
20
|
-
var
|
|
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
|
-
],
|
|
24
|
+
], B = [
|
|
25
25
|
3,
|
|
26
26
|
7,
|
|
27
27
|
14,
|
|
28
28
|
30
|
|
29
|
-
],
|
|
30
|
-
function
|
|
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
|
|
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
|
|
39
|
-
let t = /* @__PURE__ */ new Date(new Date(e).getTime() -
|
|
40
|
-
return
|
|
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
|
|
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
|
|
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
|
|
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
|
|
59
|
-
let { formatDate: i } =
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
title: a("renewals.remind.title", "Remind me about {{label}}", { label:
|
|
62
|
-
description:
|
|
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__ */
|
|
65
|
-
onSubmit: (
|
|
66
|
-
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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) =>
|
|
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__ */
|
|
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__ */
|
|
86
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
91
87
|
htmlFor: "renewal-reminder-day",
|
|
92
|
-
className:
|
|
88
|
+
className: U,
|
|
93
89
|
children: a("renewals.remind.day", "Remind me on")
|
|
94
|
-
}), /* @__PURE__ */
|
|
90
|
+
}), /* @__PURE__ */ N("input", {
|
|
95
91
|
id: "renewal-reminder-day",
|
|
96
|
-
...
|
|
92
|
+
...g("renewal-reminder-day"),
|
|
97
93
|
type: "date",
|
|
98
94
|
value: c,
|
|
99
|
-
min:
|
|
95
|
+
min: J(/* @__PURE__ */ new Date()),
|
|
100
96
|
onChange: (e) => l(e.target.value),
|
|
101
|
-
className:
|
|
97
|
+
className: V
|
|
102
98
|
})] }),
|
|
103
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
104
100
|
htmlFor: "renewal-reminder-note",
|
|
105
|
-
className:
|
|
101
|
+
className: U,
|
|
106
102
|
children: a("renewals.remind.note", "Note (optional)")
|
|
107
|
-
}), /* @__PURE__ */
|
|
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:
|
|
110
|
+
className: V
|
|
115
111
|
})] }),
|
|
116
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ P("div", {
|
|
117
113
|
className: "flex justify-end gap-2",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
114
|
+
children: [/* @__PURE__ */ N("button", {
|
|
119
115
|
type: "button",
|
|
120
116
|
onClick: r,
|
|
121
|
-
className:
|
|
117
|
+
className: G,
|
|
122
118
|
children: a("common.cancel", "Cancel")
|
|
123
|
-
}), /* @__PURE__ */
|
|
119
|
+
}), /* @__PURE__ */ P("button", {
|
|
124
120
|
type: "submit",
|
|
125
|
-
disabled:
|
|
126
|
-
className:
|
|
127
|
-
children: [/* @__PURE__ */
|
|
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:
|
|
137
|
-
let
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
title:
|
|
140
|
-
description:
|
|
141
|
-
onClose:
|
|
142
|
-
children: [
|
|
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:
|
|
146
|
-
}), /* @__PURE__ */
|
|
141
|
+
children: i
|
|
142
|
+
}), /* @__PURE__ */ P("div", {
|
|
147
143
|
className: "flex justify-end gap-2",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ N("button", {
|
|
149
145
|
type: "button",
|
|
150
|
-
onClick:
|
|
151
|
-
className:
|
|
152
|
-
children:
|
|
153
|
-
}), /* @__PURE__ */
|
|
146
|
+
onClick: t,
|
|
147
|
+
className: G,
|
|
148
|
+
children: n("renewals.trials.keep", "Keep trial")
|
|
149
|
+
}), /* @__PURE__ */ N("button", {
|
|
154
150
|
type: "button",
|
|
155
|
-
disabled:
|
|
156
|
-
onClick: () =>
|
|
157
|
-
onSuccess:
|
|
158
|
-
onError: (e) =>
|
|
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:
|
|
157
|
+
children: n("renewals.trials.confirmCancel", "Cancel trial")
|
|
162
158
|
})]
|
|
163
159
|
})]
|
|
164
160
|
});
|
|
165
|
-
}, $ = ({ reminderId: e, reminderAt:
|
|
166
|
-
let { formatDate:
|
|
167
|
-
return e &&
|
|
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": `${
|
|
165
|
+
"data-testid": `${a}-reminder`,
|
|
170
166
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ N(S, {
|
|
172
168
|
className: "h-3 w-3",
|
|
173
169
|
"aria-hidden": !0
|
|
174
170
|
}),
|
|
175
|
-
|
|
176
|
-
/* @__PURE__ */
|
|
171
|
+
s("renewals.remind.setFor", "Reminder {{date}}", { date: o(n) }),
|
|
172
|
+
/* @__PURE__ */ N("button", {
|
|
177
173
|
type: "button",
|
|
178
|
-
disabled:
|
|
179
|
-
onClick: () =>
|
|
180
|
-
"aria-label":
|
|
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__ */
|
|
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__ */
|
|
184
|
+
}) : /* @__PURE__ */ P("button", {
|
|
189
185
|
type: "button",
|
|
190
|
-
onClick:
|
|
191
|
-
className:
|
|
192
|
-
"aria-label":
|
|
193
|
-
"data-testid": `${
|
|
194
|
-
children: [/* @__PURE__ */
|
|
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
|
-
}),
|
|
193
|
+
}), s("renewals.remind.button", "Remind me")]
|
|
198
194
|
});
|
|
199
195
|
}, ne = ({ forecast: e, fmt: t }) => {
|
|
200
|
-
let { locale: n } = x(),
|
|
201
|
-
return /* @__PURE__ */
|
|
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) => `${
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
214
|
-
className:
|
|
215
|
-
style: { height: `${Math.max(4, e.amount /
|
|
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__ */
|
|
213
|
+
/* @__PURE__ */ N("span", {
|
|
218
214
|
className: "mt-2 text-xs text-text-secondary",
|
|
219
|
-
children:
|
|
215
|
+
children: Z(e, n)
|
|
220
216
|
})
|
|
221
217
|
]
|
|
222
218
|
}, e.key))
|
|
223
219
|
});
|
|
224
|
-
}, re = ({ forecast:
|
|
225
|
-
let { formatCurrency:
|
|
226
|
-
return /* @__PURE__ */
|
|
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":
|
|
225
|
+
"aria-label": c("renewals.trials.region", "Trials ending soon"),
|
|
230
226
|
"data-testid": "renewals-trials-banner",
|
|
231
227
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ P("div", {
|
|
233
229
|
className: "mb-3 flex items-start gap-3",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
233
|
+
}), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("h2", {
|
|
238
234
|
className: "text-sm font-semibold text-text-primary",
|
|
239
|
-
children:
|
|
240
|
-
count:
|
|
241
|
-
days:
|
|
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__ */
|
|
239
|
+
}), /* @__PURE__ */ N("p", {
|
|
244
240
|
className: "text-xs text-text-secondary",
|
|
245
|
-
children:
|
|
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
|
-
|
|
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:
|
|
247
|
+
children: d
|
|
252
248
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ N("ul", {
|
|
254
250
|
className: "divide-y divide-border-subtle rounded-xl bg-bg-surface",
|
|
255
|
-
children:
|
|
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__ */
|
|
254
|
+
children: [/* @__PURE__ */ P("div", {
|
|
259
255
|
className: "min-w-0 flex-1",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ N("button", {
|
|
261
257
|
type: "button",
|
|
262
|
-
className:
|
|
263
|
-
onClick: () =>
|
|
258
|
+
className: W,
|
|
259
|
+
onClick: () => l(`/relationships/${e.relationshipId}`),
|
|
264
260
|
children: e.label
|
|
265
|
-
}), /* @__PURE__ */
|
|
261
|
+
}), /* @__PURE__ */ P("p", {
|
|
266
262
|
className: "text-xs text-text-secondary",
|
|
267
|
-
children: [
|
|
268
|
-
when:
|
|
269
|
-
date:
|
|
270
|
-
amount:
|
|
271
|
-
interval:
|
|
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__ */
|
|
270
|
+
}), /* @__PURE__ */ P("div", {
|
|
275
271
|
className: "flex flex-wrap items-center gap-2",
|
|
276
272
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
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: () =>
|
|
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__ */
|
|
285
|
+
/* @__PURE__ */ N("button", {
|
|
290
286
|
type: "button",
|
|
291
|
-
className:
|
|
292
|
-
disabled:
|
|
293
|
-
"aria-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
|
-
|
|
291
|
+
f(null), u.mutate({
|
|
296
292
|
id: e.relationshipId,
|
|
297
293
|
status: "ACTIVE"
|
|
298
|
-
}, { onError: (e) =>
|
|
294
|
+
}, { onError: (e) => f(e instanceof Error ? e.message : c("renewals.trials.convertError", "Could not convert the trial.")) });
|
|
299
295
|
},
|
|
300
|
-
children:
|
|
296
|
+
children: c("renewals.trials.convert", "Convert")
|
|
301
297
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ N("button", {
|
|
303
299
|
type: "button",
|
|
304
|
-
className:
|
|
305
|
-
"aria-label":
|
|
306
|
-
onClick: () =>
|
|
307
|
-
children:
|
|
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:
|
|
316
|
-
let { locale:
|
|
317
|
-
return /* @__PURE__ */
|
|
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":
|
|
320
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
320
|
+
children: [/* @__PURE__ */ N("span", {
|
|
325
321
|
className: "text-[10px] uppercase text-text-secondary",
|
|
326
|
-
children: new Date(
|
|
327
|
-
}), /* @__PURE__ */
|
|
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(
|
|
325
|
+
children: new Date(e.renewsAt).getDate()
|
|
330
326
|
})]
|
|
331
|
-
}), /* @__PURE__ */
|
|
327
|
+
}), /* @__PURE__ */ P("div", {
|
|
332
328
|
className: "min-w-0",
|
|
333
329
|
children: [
|
|
334
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ N("button", {
|
|
335
331
|
type: "button",
|
|
336
|
-
className:
|
|
337
|
-
onClick: () =>
|
|
338
|
-
children:
|
|
332
|
+
className: W,
|
|
333
|
+
onClick: () => l(`/relationships/${e.relationshipId}`),
|
|
334
|
+
children: e.label
|
|
339
335
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ N("p", {
|
|
341
337
|
className: "text-xs text-text-secondary",
|
|
342
338
|
children: [
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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__ */
|
|
346
|
+
/* @__PURE__ */ P("div", {
|
|
351
347
|
className: "mt-1 flex flex-wrap gap-1.5",
|
|
352
|
-
children: [
|
|
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:
|
|
355
|
-
}),
|
|
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__ */
|
|
353
|
+
children: [/* @__PURE__ */ N(A, {
|
|
358
354
|
className: "h-3 w-3",
|
|
359
355
|
"aria-hidden": !0
|
|
360
|
-
}),
|
|
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__ */
|
|
361
|
+
}), /* @__PURE__ */ P("div", {
|
|
366
362
|
className: "flex flex-wrap items-center gap-2 md:justify-end",
|
|
367
363
|
children: [
|
|
368
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ N("span", {
|
|
369
365
|
className: "me-2 text-sm font-semibold tabular-nums text-text-primary",
|
|
370
|
-
children:
|
|
366
|
+
children: o(e.amount, e.currency)
|
|
371
367
|
}),
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
reminderId:
|
|
374
|
-
reminderAt:
|
|
375
|
-
label:
|
|
376
|
-
testId:
|
|
377
|
-
onRemind: () =>
|
|
378
|
-
relationshipId:
|
|
379
|
-
label:
|
|
380
|
-
targetAt:
|
|
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__ */
|
|
380
|
+
/* @__PURE__ */ P("button", {
|
|
385
381
|
type: "button",
|
|
386
|
-
onClick: () =>
|
|
387
|
-
className:
|
|
388
|
-
"aria-label":
|
|
389
|
-
"data-testid": `${
|
|
390
|
-
children: [/* @__PURE__ */
|
|
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
|
-
}),
|
|
389
|
+
}), c("renewals.review.button", "Review")]
|
|
394
390
|
})
|
|
395
391
|
]
|
|
396
392
|
})]
|
|
397
393
|
});
|
|
398
394
|
}, ae = () => {
|
|
399
|
-
let { locale:
|
|
400
|
-
to:
|
|
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
|
-
}),
|
|
403
|
-
if (!
|
|
404
|
-
let e =
|
|
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
|
|
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
|
-
}, [
|
|
414
|
-
if (
|
|
415
|
-
if (
|
|
416
|
-
message:
|
|
417
|
-
onRetry: () => void
|
|
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
|
|
420
|
-
return /* @__PURE__ */
|
|
421
|
-
title:
|
|
422
|
-
description:
|
|
423
|
-
actions: /* @__PURE__ */
|
|
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__ */
|
|
421
|
+
children: [/* @__PURE__ */ P("label", {
|
|
426
422
|
className: "flex items-center gap-2 text-xs text-text-secondary",
|
|
427
|
-
children: [
|
|
428
|
-
value:
|
|
429
|
-
onChange: (e) =>
|
|
430
|
-
className:
|
|
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:
|
|
428
|
+
children: z.map((e) => /* @__PURE__ */ N("option", {
|
|
433
429
|
value: e,
|
|
434
|
-
children:
|
|
430
|
+
children: u("renewals.filters.months", "{{count}} months", { count: e })
|
|
435
431
|
}, e))
|
|
436
432
|
})]
|
|
437
|
-
}), /* @__PURE__ */
|
|
433
|
+
}), /* @__PURE__ */ P("label", {
|
|
438
434
|
className: "flex items-center gap-2 text-xs text-text-secondary",
|
|
439
|
-
children: [
|
|
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:
|
|
438
|
+
className: H,
|
|
443
439
|
"data-testid": "renewals-trial-window",
|
|
444
|
-
children:
|
|
440
|
+
children: B.map((e) => /* @__PURE__ */ N("option", {
|
|
445
441
|
value: e,
|
|
446
|
-
children:
|
|
442
|
+
children: u("renewals.filters.days", "{{count}} days", { count: e })
|
|
447
443
|
}, e))
|
|
448
444
|
})]
|
|
449
445
|
})]
|
|
450
446
|
}),
|
|
451
447
|
children: [
|
|
452
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ N(I, {
|
|
453
449
|
className: "mb-2",
|
|
454
|
-
children:
|
|
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
|
-
|
|
457
|
-
icon: /* @__PURE__ */
|
|
458
|
-
title:
|
|
459
|
-
description:
|
|
460
|
-
action: /* @__PURE__ */
|
|
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: () =>
|
|
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__ */
|
|
460
|
+
children: [/* @__PURE__ */ N(O, {
|
|
465
461
|
className: "h-4 w-4",
|
|
466
462
|
"aria-hidden": !0
|
|
467
|
-
}),
|
|
463
|
+
}), u("renewals.addSubscription", "Add a subscription")]
|
|
468
464
|
})
|
|
469
|
-
}) : /* @__PURE__ */
|
|
470
|
-
/* @__PURE__ */
|
|
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__ */
|
|
475
|
-
icon: /* @__PURE__ */
|
|
476
|
-
value: W
|
|
477
|
-
label:
|
|
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__ */
|
|
481
|
-
icon: /* @__PURE__ */
|
|
482
|
-
value:
|
|
483
|
-
label:
|
|
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__ */
|
|
486
|
-
icon: /* @__PURE__ */
|
|
487
|
-
value:
|
|
488
|
-
label:
|
|
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__ */
|
|
491
|
-
icon: /* @__PURE__ */
|
|
492
|
-
value:
|
|
493
|
-
label:
|
|
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
|
-
|
|
498
|
-
forecast:
|
|
493
|
+
W.trialsEndingSoon.length > 0 && /* @__PURE__ */ N(re, {
|
|
494
|
+
forecast: W,
|
|
499
495
|
onRemind: A,
|
|
500
|
-
onCancel:
|
|
496
|
+
onCancel: R
|
|
501
497
|
}),
|
|
502
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ P(F, {
|
|
503
499
|
treatment: "plain",
|
|
504
500
|
className: "p-6",
|
|
505
501
|
children: [
|
|
506
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ P("div", {
|
|
507
503
|
className: "mb-4 flex flex-wrap items-baseline justify-between gap-2",
|
|
508
|
-
children: [/* @__PURE__ */
|
|
504
|
+
children: [/* @__PURE__ */ N("h3", {
|
|
509
505
|
className: "text-sm font-semibold text-text-primary",
|
|
510
|
-
children:
|
|
511
|
-
}), /* @__PURE__ */
|
|
506
|
+
children: u("renewals.chart.title", "Renewal forecast")
|
|
507
|
+
}), /* @__PURE__ */ N("span", {
|
|
512
508
|
className: "text-xs text-text-secondary",
|
|
513
|
-
children:
|
|
514
|
-
count:
|
|
515
|
-
amount: W
|
|
516
|
-
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__ */
|
|
521
|
-
forecast:
|
|
522
|
-
fmt:
|
|
516
|
+
/* @__PURE__ */ N(ne, {
|
|
517
|
+
forecast: W,
|
|
518
|
+
fmt: K
|
|
523
519
|
}),
|
|
524
|
-
|
|
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:
|
|
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
|
-
|
|
525
|
+
W.truncated && /* @__PURE__ */ N("p", {
|
|
530
526
|
className: "mt-2 text-xs text-status-warning-text",
|
|
531
|
-
children:
|
|
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__ */
|
|
536
|
-
title:
|
|
537
|
-
description:
|
|
538
|
-
children:
|
|
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:
|
|
542
|
-
}) : /* @__PURE__ */
|
|
537
|
+
children: u("renewals.list.none", "No dated renewals in this period.")
|
|
538
|
+
}) : /* @__PURE__ */ N("div", {
|
|
543
539
|
className: "space-y-6",
|
|
544
|
-
children:
|
|
545
|
-
"data-testid": `renewals-month-${
|
|
546
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
544
|
+
children: [/* @__PURE__ */ N("h3", {
|
|
549
545
|
className: "text-sm font-semibold text-text-primary",
|
|
550
|
-
children:
|
|
551
|
-
}), /* @__PURE__ */
|
|
546
|
+
children: X(t, e)
|
|
547
|
+
}), /* @__PURE__ */ P("span", {
|
|
552
548
|
className: "text-xs tabular-nums text-text-secondary",
|
|
553
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ N(D, {
|
|
554
550
|
className: "me-1 inline h-3 w-3",
|
|
555
551
|
"aria-hidden": !0
|
|
556
|
-
}),
|
|
557
|
-
count: _(
|
|
558
|
-
amount: [
|
|
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__ */
|
|
557
|
+
}), /* @__PURE__ */ N(F, {
|
|
562
558
|
treatment: "plain",
|
|
563
|
-
children: /* @__PURE__ */
|
|
559
|
+
children: /* @__PURE__ */ N("ul", {
|
|
564
560
|
className: "divide-y divide-border-subtle",
|
|
565
|
-
children:
|
|
566
|
-
item:
|
|
567
|
-
monthKey:
|
|
561
|
+
children: t.items.map((e) => /* @__PURE__ */ N(ie, {
|
|
562
|
+
item: e,
|
|
563
|
+
monthKey: t.key,
|
|
568
564
|
onRemind: A
|
|
569
|
-
},
|
|
565
|
+
}, e.relationshipId))
|
|
570
566
|
})
|
|
571
567
|
})]
|
|
572
|
-
},
|
|
568
|
+
}, t.key))
|
|
573
569
|
})
|
|
574
570
|
})
|
|
575
571
|
] }),
|
|
576
|
-
k && /* @__PURE__ */
|
|
572
|
+
k && /* @__PURE__ */ N(ee, {
|
|
577
573
|
target: k,
|
|
578
574
|
onClose: () => A(null)
|
|
579
575
|
}),
|
|
580
|
-
|
|
581
|
-
trial:
|
|
582
|
-
onClose: () =>
|
|
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
|