@burdenoff/microfe-subscriberbot 2026.1103.1 → 2026.1105.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/stories/Accessibility.stories.d.ts +13 -0
- package/dist/stories/Accessibility.stories.d.ts.map +1 -0
- package/dist/stories/pages/AgentDetailPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/AgentsListPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts +1 -0
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/InboxPage.stories.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.js +168 -168
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +116 -116
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +211 -211
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/components/Modal.d.ts.map +1 -1
- package/dist/subscriberbot/components/Modal.js +43 -33
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.js +10 -10
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +45 -37
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +6 -6
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +6 -6
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.js +149 -147
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +127 -127
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +114 -114
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +4 -4
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +11 -11
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +29 -29
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +43 -43
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +4 -4
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +14 -14
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.js +242 -237
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/viz.d.ts +1 -0
- package/dist/subscriberbot/components/viz.d.ts.map +1 -1
- package/dist/subscriberbot/components/viz.js +100 -101
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/hooks/index.js +1 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts +7 -0
- package/dist/subscriberbot/hooks/useFormError.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useFormError.js +28 -0
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -0
- package/dist/subscriberbot/hooks/useFormatters.d.ts +11 -0
- package/dist/subscriberbot/hooks/useFormatters.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useFormatters.js +13 -0
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +371 -370
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -1
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.js +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +124 -124
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts +0 -10
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +107 -98
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts +0 -10
- package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +421 -402
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +130 -121
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts +0 -12
- package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +237 -215
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.js +303 -295
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.js +57 -57
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts +0 -13
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +202 -196
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +0 -18
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +283 -275
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +0 -6
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +85 -77
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +0 -9
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +136 -136
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +0 -9
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +267 -260
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +0 -10
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +96 -96
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +0 -11
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +46 -46
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +0 -11
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +181 -171
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +0 -9
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +164 -164
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +0 -9
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +197 -181
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +0 -8
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +79 -79
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +0 -9
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +147 -147
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +0 -10
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +204 -188
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +0 -9
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +80 -80
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +0 -10
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +484 -458
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +0 -8
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +146 -136
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +0 -10
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +88 -87
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +0 -11
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +520 -490
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +0 -8
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +104 -90
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +0 -8
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +97 -96
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +76 -74
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +5 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +26 -25
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.d.ts +16 -5
- package/dist/subscriberbot/utils/formatters.d.ts.map +1 -1
- package/dist/subscriberbot/utils/formatters.js +57 -25
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts +2 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -21
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { ErrorView as
|
|
9
|
-
import { Gauge as
|
|
2
|
+
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
+
import { useFormatters as n } from "../../hooks/useFormatters.js";
|
|
4
|
+
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
5
|
+
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
6
|
+
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
7
|
+
import { Modal as o } from "../../components/Modal.js";
|
|
8
|
+
import { ErrorView as s, LoadingView as c, Section as l } from "../../components/StateViews.js";
|
|
9
|
+
import { Gauge as u, MiniProgress as d, Timeline as f } from "../../components/viz.js";
|
|
10
10
|
import "../../components/index.js";
|
|
11
|
-
import { useCancelRelationship as
|
|
12
|
-
import { canTransition as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { useCancelRelationship as p, useCreateAsset as m, useCreateEntitlement as h, useDecisions as g, useFileDownloadUrl as _, useInvoices as v, usePlans as y, useProviders as b, useRelationship as x, useTransitionRelationship as S, useUpdateRelationship as C, useUploadFile as w } from "../../hooks/useSubscriberBotApi.js";
|
|
12
|
+
import { canTransition as T } from "../../utils/portfolio.js";
|
|
13
|
+
import { useFormError as E } from "../../hooks/useFormError.js";
|
|
14
|
+
import { DecisionCard as D } from "../../components/decisions/DecisionCard.js";
|
|
15
|
+
import { AiDisclaimer as O } from "../../components/decisions/DecisionBanners.js";
|
|
15
16
|
import "../../components/decisions/index.js";
|
|
16
|
-
import { useState as
|
|
17
|
-
import { Activity as
|
|
18
|
-
import { useParams as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { GlassCard as
|
|
17
|
+
import { useState as k } from "react";
|
|
18
|
+
import { Activity as A, ArrowLeft as j, Ban as M, Briefcase as N, CalendarClock as P, CreditCard as F, Download as I, Handshake as L, Paperclip as R, Pause as z, Pencil as ee, Play as B, Plus as V, ShieldCheck as te, Tag as ne, Wallet as re } from "lucide-react";
|
|
19
|
+
import { useParams as ie } from "react-router";
|
|
20
|
+
import { Fragment as ae, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
21
|
+
import { GlassCard as W } from "@burdenoff/fe-libs/ui";
|
|
21
22
|
//#region src/subscriberbot/pages/relationships/RelationshipDetailPage.tsx
|
|
22
|
-
var
|
|
23
|
+
var G = "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)]", K = "mb-1 block text-xs font-medium text-text-secondary", q = [
|
|
23
24
|
"MONTHLY",
|
|
24
25
|
"YEARLY",
|
|
25
26
|
"QUARTERLY",
|
|
@@ -28,14 +29,14 @@ var W = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
|
|
|
28
29
|
"USAGE_BASED",
|
|
29
30
|
"LIFETIME",
|
|
30
31
|
"FREE"
|
|
31
|
-
],
|
|
32
|
+
], J = [
|
|
32
33
|
"FEATURE_ACCESS",
|
|
33
34
|
"SEAT",
|
|
34
35
|
"USAGE_QUOTA",
|
|
35
36
|
"CONTENT",
|
|
36
37
|
"DISCOUNT",
|
|
37
38
|
"SUPPORT_TIER"
|
|
38
|
-
],
|
|
39
|
+
], Y = [
|
|
39
40
|
"RECEIPT",
|
|
40
41
|
"INVOICE",
|
|
41
42
|
"CONTRACT",
|
|
@@ -44,7 +45,7 @@ var W = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
|
|
|
44
45
|
"CERTIFICATE",
|
|
45
46
|
"WARRANTY",
|
|
46
47
|
"DOMAIN"
|
|
47
|
-
],
|
|
48
|
+
], oe = {
|
|
48
49
|
SUBSCRIPTION: "relationships.kinds.subscription",
|
|
49
50
|
MEMBERSHIP: "relationships.kinds.membership",
|
|
50
51
|
LICENSE: "relationships.kinds.license",
|
|
@@ -53,7 +54,7 @@ var W = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
|
|
|
53
54
|
RECURRING_PAYMENT: "relationships.kinds.recurringPayment",
|
|
54
55
|
ENROLLMENT: "relationships.kinds.enrollment",
|
|
55
56
|
TRIAL: "relationships.kinds.trial"
|
|
56
|
-
},
|
|
57
|
+
}, se = [
|
|
57
58
|
{
|
|
58
59
|
status: "ACTIVE",
|
|
59
60
|
labelKey: "relationships.detail.actions.activate",
|
|
@@ -70,892 +71,920 @@ var W = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
|
|
|
70
71
|
status: "EXPIRED",
|
|
71
72
|
labelKey: "relationships.detail.actions.markExpired",
|
|
72
73
|
defaultLabel: "Mark expired",
|
|
73
|
-
icon:
|
|
74
|
+
icon: M
|
|
74
75
|
}
|
|
75
76
|
];
|
|
76
77
|
function X({ label: e, value: t }) {
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ U("div", {
|
|
78
79
|
className: "flex items-center justify-between gap-3 border-b border-border-subtle/60 py-2.5 last:border-0 last:pb-0",
|
|
79
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ H("span", {
|
|
80
81
|
className: "shrink-0 text-sm text-text-secondary",
|
|
81
82
|
children: e
|
|
82
|
-
}), /* @__PURE__ */
|
|
83
|
-
className: "min-w-0 truncate text-
|
|
83
|
+
}), /* @__PURE__ */ H("span", {
|
|
84
|
+
className: "min-w-0 truncate text-end text-sm font-medium text-text-primary",
|
|
84
85
|
children: t
|
|
85
86
|
})]
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
+
function ce(e) {
|
|
89
90
|
return e == null ? "accent" : e >= 66 ? "positive" : e >= 33 ? "warning" : "negative";
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function Z(e) {
|
|
92
93
|
if (!e) return "";
|
|
93
94
|
let t = new Date(e);
|
|
94
95
|
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
-
let
|
|
97
|
+
function le({ relationship: e, onClose: n }) {
|
|
98
|
+
let r = t(), i = C(), a = b({ pagination: {
|
|
98
99
|
limit: 100,
|
|
99
100
|
offset: 0
|
|
100
|
-
} }), [
|
|
101
|
-
let t =
|
|
101
|
+
} }), [s, c] = k(e.label), [l, u] = k(e.providerId ?? ""), [d, f] = k(e.planId ?? ""), [p, m] = k(String(e.amount ?? "")), [h, g] = k(e.currency), [_, v] = k(e.interval), [x, S] = k(Z(e.renewsAt)), [w, T] = k(e.autoRenew), [D, O] = k(e.notes ?? ""), [A, j] = k(e.department ?? ""), [M, N, P, F] = E(), I = y(l || void 0), L = (() => {
|
|
102
|
+
let t = a.data?.items ?? [];
|
|
102
103
|
return e.provider && !t.some((t) => t.id === e.provider?.id) ? [e.provider, ...t] : t;
|
|
103
|
-
})(),
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
title:
|
|
106
|
-
onClose:
|
|
104
|
+
})(), R = I.data ?? [];
|
|
105
|
+
return /* @__PURE__ */ H(o, {
|
|
106
|
+
title: r("relationships.detail.editModal.title", "Edit relationship"),
|
|
107
|
+
onClose: n,
|
|
107
108
|
maxWidthClassName: "max-w-2xl",
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
-
onSubmit: (
|
|
110
|
-
if (
|
|
111
|
-
|
|
109
|
+
children: /* @__PURE__ */ U("form", {
|
|
110
|
+
onSubmit: (t) => {
|
|
111
|
+
if (t.preventDefault(), N(null), !s.trim()) {
|
|
112
|
+
N(r("relationships.detail.editModal.labelRequired", "A label is required."), "edit-label");
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
114
|
-
let
|
|
115
|
-
label:
|
|
115
|
+
let a = {
|
|
116
|
+
label: s.trim(),
|
|
116
117
|
interval: _,
|
|
117
|
-
autoRenew:
|
|
118
|
+
autoRenew: w,
|
|
118
119
|
currency: h.trim() || "USD",
|
|
119
|
-
notes:
|
|
120
|
-
department:
|
|
121
|
-
...
|
|
120
|
+
notes: D.trim(),
|
|
121
|
+
department: A.trim(),
|
|
122
|
+
...l ? { providerId: l } : {},
|
|
122
123
|
...d ? { planId: d } : {},
|
|
123
124
|
...p.trim() ? { amount: Number(p) } : {},
|
|
124
|
-
...
|
|
125
|
+
...x ? { renewsAt: new Date(x).toISOString() } : {}
|
|
125
126
|
};
|
|
126
|
-
|
|
127
|
+
i.mutate({
|
|
127
128
|
id: e.id,
|
|
128
|
-
input:
|
|
129
|
+
input: a
|
|
129
130
|
}, {
|
|
130
|
-
onSuccess: () =>
|
|
131
|
-
onError: (e) =>
|
|
131
|
+
onSuccess: () => n(),
|
|
132
|
+
onError: (e) => N(e instanceof Error ? e.message : r("relationships.detail.editModal.error", "Could not update relationship."))
|
|
132
133
|
});
|
|
133
134
|
},
|
|
134
135
|
className: "space-y-4",
|
|
135
136
|
children: [
|
|
136
|
-
|
|
137
|
+
M && /* @__PURE__ */ H("div", {
|
|
138
|
+
id: F,
|
|
139
|
+
tabIndex: -1,
|
|
140
|
+
role: "alert",
|
|
137
141
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
138
|
-
children:
|
|
142
|
+
children: M
|
|
139
143
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ U("label", {
|
|
141
145
|
htmlFor: "edit-label",
|
|
142
|
-
className:
|
|
146
|
+
className: K,
|
|
143
147
|
children: [
|
|
144
|
-
|
|
148
|
+
r("relationships.detail.editModal.labelLabel", "Label"),
|
|
145
149
|
" ",
|
|
146
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ H("span", {
|
|
147
151
|
className: "text-status-error-text",
|
|
148
152
|
children: "*"
|
|
149
153
|
})
|
|
150
154
|
]
|
|
151
|
-
}), /* @__PURE__ */
|
|
155
|
+
}), /* @__PURE__ */ H("input", {
|
|
156
|
+
...P("edit-label"),
|
|
152
157
|
id: "edit-label",
|
|
153
158
|
type: "text",
|
|
154
|
-
value:
|
|
155
|
-
onChange: (e) =>
|
|
156
|
-
className:
|
|
159
|
+
value: s,
|
|
160
|
+
onChange: (e) => c(e.target.value),
|
|
161
|
+
className: G,
|
|
157
162
|
required: !0
|
|
158
163
|
})] }),
|
|
159
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
160
165
|
htmlFor: "edit-department",
|
|
161
|
-
className:
|
|
162
|
-
children:
|
|
163
|
-
}), /* @__PURE__ */
|
|
166
|
+
className: K,
|
|
167
|
+
children: r("relationships.detail.editModal.departmentLabel", "Department or team")
|
|
168
|
+
}), /* @__PURE__ */ H("input", {
|
|
169
|
+
...P("edit-department"),
|
|
164
170
|
id: "edit-department",
|
|
165
171
|
type: "text",
|
|
166
172
|
maxLength: 120,
|
|
167
|
-
value:
|
|
168
|
-
onChange: (e) =>
|
|
169
|
-
placeholder:
|
|
170
|
-
className:
|
|
173
|
+
value: A,
|
|
174
|
+
onChange: (e) => j(e.target.value),
|
|
175
|
+
placeholder: r("relationships.detail.editModal.departmentPlaceholder", "e.g. Engineering, Marketing"),
|
|
176
|
+
className: G
|
|
171
177
|
})] }),
|
|
172
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ U("div", {
|
|
173
179
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
180
|
+
children: [/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
175
181
|
htmlFor: "edit-provider",
|
|
176
|
-
className:
|
|
177
|
-
children:
|
|
178
|
-
}), /* @__PURE__ */
|
|
182
|
+
className: K,
|
|
183
|
+
children: r("relationships.detail.editModal.providerLabel", "Provider")
|
|
184
|
+
}), /* @__PURE__ */ U("select", {
|
|
185
|
+
...P("edit-provider"),
|
|
179
186
|
id: "edit-provider",
|
|
180
|
-
value:
|
|
187
|
+
value: l,
|
|
181
188
|
onChange: (e) => {
|
|
182
189
|
u(e.target.value), f("");
|
|
183
190
|
},
|
|
184
|
-
className:
|
|
185
|
-
children: [/* @__PURE__ */
|
|
191
|
+
className: G,
|
|
192
|
+
children: [/* @__PURE__ */ H("option", {
|
|
186
193
|
value: "",
|
|
187
|
-
children:
|
|
188
|
-
}),
|
|
194
|
+
children: r("relationships.detail.editModal.providerNone", "— None —")
|
|
195
|
+
}), L.map((e) => /* @__PURE__ */ H("option", {
|
|
189
196
|
value: e.id,
|
|
190
197
|
children: e.name
|
|
191
198
|
}, e.id))]
|
|
192
|
-
})] }), /* @__PURE__ */
|
|
199
|
+
})] }), /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
193
200
|
htmlFor: "edit-plan",
|
|
194
|
-
className:
|
|
195
|
-
children:
|
|
196
|
-
}), /* @__PURE__ */
|
|
201
|
+
className: K,
|
|
202
|
+
children: r("relationships.detail.editModal.planLabel", "Plan")
|
|
203
|
+
}), /* @__PURE__ */ U("select", {
|
|
204
|
+
...P("edit-plan"),
|
|
197
205
|
id: "edit-plan",
|
|
198
206
|
value: d,
|
|
199
207
|
onChange: (e) => f(e.target.value),
|
|
200
|
-
className:
|
|
201
|
-
disabled: !
|
|
202
|
-
children: [/* @__PURE__ */
|
|
208
|
+
className: G,
|
|
209
|
+
disabled: !l || R.length === 0,
|
|
210
|
+
children: [/* @__PURE__ */ H("option", {
|
|
203
211
|
value: "",
|
|
204
|
-
children:
|
|
205
|
-
}),
|
|
212
|
+
children: r("relationships.detail.editModal.planNone", "— None —")
|
|
213
|
+
}), R.map((e) => /* @__PURE__ */ H("option", {
|
|
206
214
|
value: e.id,
|
|
207
215
|
children: e.name
|
|
208
216
|
}, e.id))]
|
|
209
217
|
})] })]
|
|
210
218
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ U("div", {
|
|
212
220
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
213
221
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
215
223
|
htmlFor: "edit-amount",
|
|
216
|
-
className:
|
|
217
|
-
children:
|
|
218
|
-
}), /* @__PURE__ */
|
|
224
|
+
className: K,
|
|
225
|
+
children: r("relationships.detail.editModal.amountLabel", "Amount")
|
|
226
|
+
}), /* @__PURE__ */ H("input", {
|
|
227
|
+
...P("edit-amount"),
|
|
219
228
|
id: "edit-amount",
|
|
220
229
|
type: "number",
|
|
221
230
|
min: "0",
|
|
222
231
|
step: "0.01",
|
|
223
232
|
value: p,
|
|
224
233
|
onChange: (e) => m(e.target.value),
|
|
225
|
-
className:
|
|
234
|
+
className: G
|
|
226
235
|
})] }),
|
|
227
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
228
237
|
htmlFor: "edit-currency",
|
|
229
|
-
className:
|
|
230
|
-
children:
|
|
231
|
-
}), /* @__PURE__ */
|
|
238
|
+
className: K,
|
|
239
|
+
children: r("relationships.detail.editModal.currencyLabel", "Currency")
|
|
240
|
+
}), /* @__PURE__ */ H("input", {
|
|
241
|
+
...P("edit-currency"),
|
|
232
242
|
id: "edit-currency",
|
|
233
243
|
type: "text",
|
|
234
244
|
value: h,
|
|
235
245
|
onChange: (e) => g(e.target.value.toUpperCase()),
|
|
236
246
|
maxLength: 3,
|
|
237
|
-
className:
|
|
247
|
+
className: G
|
|
238
248
|
})] }),
|
|
239
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
240
250
|
htmlFor: "edit-interval",
|
|
241
|
-
className:
|
|
242
|
-
children:
|
|
243
|
-
}), /* @__PURE__ */
|
|
251
|
+
className: K,
|
|
252
|
+
children: r("relationships.detail.editModal.intervalLabel", "Billing interval")
|
|
253
|
+
}), /* @__PURE__ */ H("select", {
|
|
254
|
+
...P("edit-interval"),
|
|
244
255
|
id: "edit-interval",
|
|
245
256
|
value: _,
|
|
246
257
|
onChange: (e) => v(e.target.value),
|
|
247
|
-
className:
|
|
248
|
-
children:
|
|
258
|
+
className: G,
|
|
259
|
+
children: q.map((e) => /* @__PURE__ */ H("option", {
|
|
249
260
|
value: e,
|
|
250
261
|
children: e.replace(/_/g, " ")
|
|
251
262
|
}, e))
|
|
252
263
|
})] })
|
|
253
264
|
]
|
|
254
265
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ U("div", {
|
|
256
267
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
258
269
|
htmlFor: "edit-renews",
|
|
259
|
-
className:
|
|
260
|
-
children:
|
|
261
|
-
}), /* @__PURE__ */
|
|
270
|
+
className: K,
|
|
271
|
+
children: r("relationships.detail.editModal.renewsOnLabel", "Renews on")
|
|
272
|
+
}), /* @__PURE__ */ H("input", {
|
|
273
|
+
...P("edit-renews"),
|
|
262
274
|
id: "edit-renews",
|
|
263
275
|
type: "date",
|
|
264
|
-
value:
|
|
265
|
-
onChange: (e) =>
|
|
266
|
-
className:
|
|
267
|
-
})] }), /* @__PURE__ */
|
|
276
|
+
value: x,
|
|
277
|
+
onChange: (e) => S(e.target.value),
|
|
278
|
+
className: G
|
|
279
|
+
})] }), /* @__PURE__ */ H("div", {
|
|
268
280
|
className: "flex items-end",
|
|
269
|
-
children: /* @__PURE__ */
|
|
281
|
+
children: /* @__PURE__ */ U("label", {
|
|
270
282
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ H("input", {
|
|
272
284
|
type: "checkbox",
|
|
273
|
-
checked:
|
|
274
|
-
onChange: (e) =>
|
|
285
|
+
checked: w,
|
|
286
|
+
onChange: (e) => T(e.target.checked),
|
|
275
287
|
className: "size-4 rounded border-border-subtle"
|
|
276
|
-
}),
|
|
288
|
+
}), r("relationships.detail.editModal.autoRenews", "Auto-renews")]
|
|
277
289
|
})
|
|
278
290
|
})]
|
|
279
291
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
281
293
|
htmlFor: "edit-notes",
|
|
282
|
-
className:
|
|
283
|
-
children:
|
|
284
|
-
}), /* @__PURE__ */
|
|
294
|
+
className: K,
|
|
295
|
+
children: r("relationships.detail.editModal.notesLabel", "Notes")
|
|
296
|
+
}), /* @__PURE__ */ H("textarea", {
|
|
297
|
+
...P("edit-notes"),
|
|
285
298
|
id: "edit-notes",
|
|
286
|
-
value:
|
|
287
|
-
onChange: (e) =>
|
|
299
|
+
value: D,
|
|
300
|
+
onChange: (e) => O(e.target.value),
|
|
288
301
|
rows: 3,
|
|
289
|
-
className:
|
|
302
|
+
className: G
|
|
290
303
|
})] }),
|
|
291
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ U("div", {
|
|
292
305
|
className: "flex justify-end gap-3",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
306
|
+
children: [/* @__PURE__ */ H("button", {
|
|
294
307
|
type: "button",
|
|
295
|
-
onClick:
|
|
308
|
+
onClick: n,
|
|
296
309
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
297
|
-
children:
|
|
298
|
-
}), /* @__PURE__ */
|
|
310
|
+
children: r("relationships.detail.editModal.cancel", "Cancel")
|
|
311
|
+
}), /* @__PURE__ */ H("button", {
|
|
299
312
|
type: "submit",
|
|
300
|
-
disabled:
|
|
313
|
+
disabled: i.isPending,
|
|
301
314
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
302
|
-
children:
|
|
315
|
+
children: i.isPending ? r("relationships.detail.editModal.saving", "Saving…") : r("relationships.detail.editModal.submit", "Save changes")
|
|
303
316
|
})]
|
|
304
317
|
})
|
|
305
318
|
]
|
|
306
319
|
})
|
|
307
320
|
});
|
|
308
321
|
}
|
|
309
|
-
function
|
|
310
|
-
let
|
|
311
|
-
return /* @__PURE__ */
|
|
312
|
-
title:
|
|
313
|
-
onClose:
|
|
314
|
-
children: /* @__PURE__ */
|
|
315
|
-
onSubmit: (
|
|
316
|
-
if (
|
|
317
|
-
|
|
322
|
+
function ue({ relationshipId: e, onClose: n }) {
|
|
323
|
+
let r = t(), i = h(), [a, s] = k(""), [c, l] = k("FEATURE_ACCESS"), [u, d] = k(""), [f, p] = k(""), [m, g] = k(""), [_, v, y, b] = E();
|
|
324
|
+
return /* @__PURE__ */ H(o, {
|
|
325
|
+
title: r("relationships.detail.addEntitlementModal.title", "Add entitlement"),
|
|
326
|
+
onClose: n,
|
|
327
|
+
children: /* @__PURE__ */ U("form", {
|
|
328
|
+
onSubmit: (t) => {
|
|
329
|
+
if (t.preventDefault(), v(null), !a.trim()) {
|
|
330
|
+
v(r("relationships.detail.addEntitlementModal.nameRequired", "An entitlement name is required."), "ent-name");
|
|
318
331
|
return;
|
|
319
332
|
}
|
|
320
|
-
|
|
333
|
+
i.mutate({
|
|
321
334
|
relationshipId: e,
|
|
322
|
-
name:
|
|
323
|
-
type:
|
|
335
|
+
name: a.trim(),
|
|
336
|
+
type: c,
|
|
324
337
|
...u.trim() ? { quota: Number(u) } : {},
|
|
325
338
|
...f.trim() ? { unit: f.trim() } : {},
|
|
326
339
|
...m.trim() ? { description: m.trim() } : {}
|
|
327
340
|
}, {
|
|
328
|
-
onSuccess: () =>
|
|
329
|
-
onError: (e) =>
|
|
341
|
+
onSuccess: () => n(),
|
|
342
|
+
onError: (e) => v(e instanceof Error ? e.message : r("relationships.detail.addEntitlementModal.error", "Could not add entitlement."))
|
|
330
343
|
});
|
|
331
344
|
},
|
|
332
345
|
className: "space-y-4",
|
|
333
346
|
children: [
|
|
334
|
-
|
|
347
|
+
_ && /* @__PURE__ */ H("div", {
|
|
348
|
+
id: b,
|
|
349
|
+
tabIndex: -1,
|
|
350
|
+
role: "alert",
|
|
335
351
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
336
|
-
children:
|
|
352
|
+
children: _
|
|
337
353
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ U("label", {
|
|
339
355
|
htmlFor: "ent-name",
|
|
340
|
-
className:
|
|
356
|
+
className: K,
|
|
341
357
|
children: [
|
|
342
|
-
|
|
358
|
+
r("relationships.detail.addEntitlementModal.nameLabel", "Name"),
|
|
343
359
|
" ",
|
|
344
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ H("span", {
|
|
345
361
|
className: "text-status-error-text",
|
|
346
362
|
children: "*"
|
|
347
363
|
})
|
|
348
364
|
]
|
|
349
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ H("input", {
|
|
366
|
+
...y("ent-name"),
|
|
350
367
|
id: "ent-name",
|
|
351
368
|
type: "text",
|
|
352
|
-
value:
|
|
353
|
-
onChange: (e) =>
|
|
354
|
-
placeholder:
|
|
355
|
-
className:
|
|
369
|
+
value: a,
|
|
370
|
+
onChange: (e) => s(e.target.value),
|
|
371
|
+
placeholder: r("relationships.detail.addEntitlementModal.namePlaceholder", "e.g. Seats, API calls, Priority support"),
|
|
372
|
+
className: G,
|
|
356
373
|
required: !0
|
|
357
374
|
})] }),
|
|
358
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ U("div", {
|
|
359
376
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
360
377
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
362
379
|
htmlFor: "ent-type",
|
|
363
|
-
className:
|
|
364
|
-
children:
|
|
365
|
-
}), /* @__PURE__ */
|
|
380
|
+
className: K,
|
|
381
|
+
children: r("relationships.detail.addEntitlementModal.typeLabel", "Type")
|
|
382
|
+
}), /* @__PURE__ */ H("select", {
|
|
383
|
+
...y("ent-type"),
|
|
366
384
|
id: "ent-type",
|
|
367
|
-
value:
|
|
368
|
-
onChange: (e) =>
|
|
369
|
-
className:
|
|
370
|
-
children:
|
|
385
|
+
value: c,
|
|
386
|
+
onChange: (e) => l(e.target.value),
|
|
387
|
+
className: G,
|
|
388
|
+
children: J.map((e) => /* @__PURE__ */ H("option", {
|
|
371
389
|
value: e,
|
|
372
390
|
children: e.replace(/_/g, " ")
|
|
373
391
|
}, e))
|
|
374
392
|
})] }),
|
|
375
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
376
394
|
htmlFor: "ent-quota",
|
|
377
|
-
className:
|
|
378
|
-
children:
|
|
379
|
-
}), /* @__PURE__ */
|
|
395
|
+
className: K,
|
|
396
|
+
children: r("relationships.detail.addEntitlementModal.quotaLabel", "Quota")
|
|
397
|
+
}), /* @__PURE__ */ H("input", {
|
|
398
|
+
...y("ent-quota"),
|
|
380
399
|
id: "ent-quota",
|
|
381
400
|
type: "number",
|
|
382
401
|
min: "0",
|
|
383
402
|
value: u,
|
|
384
403
|
onChange: (e) => d(e.target.value),
|
|
385
|
-
placeholder:
|
|
386
|
-
className:
|
|
404
|
+
placeholder: r("relationships.detail.addEntitlementModal.quotaPlaceholder", "e.g. 5"),
|
|
405
|
+
className: G
|
|
387
406
|
})] }),
|
|
388
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
389
408
|
htmlFor: "ent-unit",
|
|
390
|
-
className:
|
|
391
|
-
children:
|
|
392
|
-
}), /* @__PURE__ */
|
|
409
|
+
className: K,
|
|
410
|
+
children: r("relationships.detail.addEntitlementModal.unitLabel", "Unit")
|
|
411
|
+
}), /* @__PURE__ */ H("input", {
|
|
412
|
+
...y("ent-unit"),
|
|
393
413
|
id: "ent-unit",
|
|
394
414
|
type: "text",
|
|
395
415
|
value: f,
|
|
396
416
|
onChange: (e) => p(e.target.value),
|
|
397
|
-
placeholder:
|
|
398
|
-
className:
|
|
417
|
+
placeholder: r("relationships.detail.addEntitlementModal.unitPlaceholder", "e.g. seats, GB"),
|
|
418
|
+
className: G
|
|
399
419
|
})] })
|
|
400
420
|
]
|
|
401
421
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
403
423
|
htmlFor: "ent-desc",
|
|
404
|
-
className:
|
|
405
|
-
children:
|
|
406
|
-
}), /* @__PURE__ */
|
|
424
|
+
className: K,
|
|
425
|
+
children: r("relationships.detail.addEntitlementModal.descriptionLabel", "Description")
|
|
426
|
+
}), /* @__PURE__ */ H("textarea", {
|
|
427
|
+
...y("ent-desc"),
|
|
407
428
|
id: "ent-desc",
|
|
408
429
|
value: m,
|
|
409
|
-
onChange: (e) =>
|
|
430
|
+
onChange: (e) => g(e.target.value),
|
|
410
431
|
rows: 2,
|
|
411
|
-
className:
|
|
432
|
+
className: G
|
|
412
433
|
})] }),
|
|
413
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ U("div", {
|
|
414
435
|
className: "flex justify-end gap-3",
|
|
415
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ H("button", {
|
|
416
437
|
type: "button",
|
|
417
|
-
onClick:
|
|
438
|
+
onClick: n,
|
|
418
439
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
419
|
-
children:
|
|
420
|
-
}), /* @__PURE__ */
|
|
440
|
+
children: r("relationships.detail.addEntitlementModal.cancel", "Cancel")
|
|
441
|
+
}), /* @__PURE__ */ H("button", {
|
|
421
442
|
type: "submit",
|
|
422
|
-
disabled:
|
|
443
|
+
disabled: i.isPending,
|
|
423
444
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
424
|
-
children:
|
|
445
|
+
children: i.isPending ? r("relationships.detail.addEntitlementModal.adding", "Adding…") : r("relationships.detail.addEntitlementModal.submit", "Add entitlement")
|
|
425
446
|
})]
|
|
426
447
|
})
|
|
427
448
|
]
|
|
428
449
|
})
|
|
429
450
|
});
|
|
430
451
|
}
|
|
431
|
-
function
|
|
432
|
-
let
|
|
433
|
-
return /* @__PURE__ */
|
|
434
|
-
title:
|
|
435
|
-
onClose:
|
|
436
|
-
children: /* @__PURE__ */
|
|
437
|
-
onSubmit: async (
|
|
438
|
-
if (
|
|
439
|
-
y(
|
|
452
|
+
function de({ relationshipId: e, onClose: n }) {
|
|
453
|
+
let r = t(), i = m(), { uploadFile: a, progress: s, isUploading: c } = w(), [l, u] = k(""), [d, f] = k("RECEIPT"), [p, h] = k(null), [g, _] = k(""), [v, y, b, x] = E(), S = c || i.isPending;
|
|
454
|
+
return /* @__PURE__ */ H(o, {
|
|
455
|
+
title: r("relationships.detail.attachAssetModal.title", "Attach asset"),
|
|
456
|
+
onClose: n,
|
|
457
|
+
children: /* @__PURE__ */ U("form", {
|
|
458
|
+
onSubmit: async (t) => {
|
|
459
|
+
if (t.preventDefault(), y(null), !p) {
|
|
460
|
+
y(r("relationships.detail.attachAssetModal.chooseFile", "Choose a file to attach."), "asset-file");
|
|
440
461
|
return;
|
|
441
462
|
}
|
|
442
463
|
try {
|
|
443
|
-
let { fileId:
|
|
444
|
-
await
|
|
464
|
+
let { fileId: t, fileName: r } = await a(p);
|
|
465
|
+
await i.mutateAsync({
|
|
445
466
|
relationshipId: e,
|
|
446
|
-
name:
|
|
467
|
+
name: l.trim() || r,
|
|
447
468
|
type: d,
|
|
448
|
-
fileId:
|
|
449
|
-
...
|
|
450
|
-
}),
|
|
469
|
+
fileId: t,
|
|
470
|
+
...g ? { expiresAt: new Date(g).toISOString() } : {}
|
|
471
|
+
}), n();
|
|
451
472
|
} catch (e) {
|
|
452
|
-
y(e instanceof Error ? e.message :
|
|
473
|
+
y(e instanceof Error ? e.message : r("relationships.detail.attachAssetModal.error", "Could not attach the asset."));
|
|
453
474
|
}
|
|
454
475
|
},
|
|
455
476
|
className: "space-y-4",
|
|
456
477
|
children: [
|
|
457
|
-
v && /* @__PURE__ */
|
|
478
|
+
v && /* @__PURE__ */ H("div", {
|
|
479
|
+
id: x,
|
|
480
|
+
tabIndex: -1,
|
|
481
|
+
role: "alert",
|
|
458
482
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
459
483
|
children: v
|
|
460
484
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ U("div", { children: [
|
|
486
|
+
/* @__PURE__ */ U("label", {
|
|
463
487
|
htmlFor: "asset-file",
|
|
464
|
-
className:
|
|
488
|
+
className: K,
|
|
465
489
|
children: [
|
|
466
|
-
|
|
490
|
+
r("relationships.detail.attachAssetModal.fileLabel", "File"),
|
|
467
491
|
" ",
|
|
468
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ H("span", {
|
|
469
493
|
className: "text-status-error-text",
|
|
470
494
|
children: "*"
|
|
471
495
|
})
|
|
472
496
|
]
|
|
473
497
|
}),
|
|
474
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ H("input", {
|
|
499
|
+
...b("asset-file"),
|
|
475
500
|
id: "asset-file",
|
|
476
501
|
type: "file",
|
|
477
502
|
onChange: (e) => {
|
|
478
503
|
let t = e.target.files?.[0] ?? null;
|
|
479
|
-
|
|
504
|
+
h(t), t && !l.trim() && u(t.name);
|
|
480
505
|
},
|
|
481
|
-
className: "w-full text-sm text-text-secondary file:
|
|
506
|
+
className: "w-full text-sm text-text-secondary file:me-3 file:rounded-lg file:border file:border-border-subtle file:bg-bg-surface file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-text-primary hover:file:bg-bg-sunken"
|
|
482
507
|
}),
|
|
483
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ H("p", {
|
|
484
509
|
className: "mt-1 text-xs text-text-secondary",
|
|
485
|
-
children:
|
|
510
|
+
children: r("relationships.detail.attachAssetModal.fileHint", "Stored securely in files — only a reference is kept here.")
|
|
486
511
|
})
|
|
487
512
|
] }),
|
|
488
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ U("div", {
|
|
489
514
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
515
|
+
children: [/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
491
516
|
htmlFor: "asset-name",
|
|
492
|
-
className:
|
|
493
|
-
children:
|
|
494
|
-
}), /* @__PURE__ */
|
|
517
|
+
className: K,
|
|
518
|
+
children: r("relationships.detail.attachAssetModal.nameLabel", "Name")
|
|
519
|
+
}), /* @__PURE__ */ H("input", {
|
|
520
|
+
...b("asset-name"),
|
|
495
521
|
id: "asset-name",
|
|
496
522
|
type: "text",
|
|
497
|
-
value:
|
|
523
|
+
value: l,
|
|
498
524
|
onChange: (e) => u(e.target.value),
|
|
499
|
-
placeholder:
|
|
500
|
-
className:
|
|
501
|
-
})] }), /* @__PURE__ */
|
|
525
|
+
placeholder: r("relationships.detail.attachAssetModal.namePlaceholder", "Defaults to the file name"),
|
|
526
|
+
className: G
|
|
527
|
+
})] }), /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
502
528
|
htmlFor: "asset-type",
|
|
503
|
-
className:
|
|
504
|
-
children:
|
|
505
|
-
}), /* @__PURE__ */
|
|
529
|
+
className: K,
|
|
530
|
+
children: r("relationships.detail.attachAssetModal.typeLabel", "Type")
|
|
531
|
+
}), /* @__PURE__ */ H("select", {
|
|
532
|
+
...b("asset-type"),
|
|
506
533
|
id: "asset-type",
|
|
507
534
|
value: d,
|
|
508
535
|
onChange: (e) => f(e.target.value),
|
|
509
|
-
className:
|
|
510
|
-
children:
|
|
536
|
+
className: G,
|
|
537
|
+
children: Y.map((e) => /* @__PURE__ */ H("option", {
|
|
511
538
|
value: e,
|
|
512
539
|
children: e.replace(/_/g, " ")
|
|
513
540
|
}, e))
|
|
514
541
|
})] })]
|
|
515
542
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("label", {
|
|
517
544
|
htmlFor: "asset-expires",
|
|
518
|
-
className:
|
|
519
|
-
children:
|
|
520
|
-
}), /* @__PURE__ */
|
|
545
|
+
className: K,
|
|
546
|
+
children: r("relationships.detail.attachAssetModal.expiresOnLabel", "Expires on")
|
|
547
|
+
}), /* @__PURE__ */ H("input", {
|
|
548
|
+
...b("asset-expires"),
|
|
521
549
|
id: "asset-expires",
|
|
522
550
|
type: "date",
|
|
523
|
-
value:
|
|
524
|
-
onChange: (e) =>
|
|
525
|
-
className:
|
|
551
|
+
value: g,
|
|
552
|
+
onChange: (e) => _(e.target.value),
|
|
553
|
+
className: G
|
|
526
554
|
})] }),
|
|
527
|
-
|
|
555
|
+
c && /* @__PURE__ */ H("p", {
|
|
528
556
|
className: "text-xs text-text-secondary",
|
|
529
|
-
children:
|
|
557
|
+
children: r("relationships.detail.attachAssetModal.uploading", "Uploading… {{progress}}%", { progress: s })
|
|
530
558
|
}),
|
|
531
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ U("div", {
|
|
532
560
|
className: "flex justify-end gap-3",
|
|
533
|
-
children: [/* @__PURE__ */
|
|
561
|
+
children: [/* @__PURE__ */ H("button", {
|
|
534
562
|
type: "button",
|
|
535
|
-
onClick:
|
|
563
|
+
onClick: n,
|
|
536
564
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
537
|
-
children:
|
|
538
|
-
}), /* @__PURE__ */
|
|
565
|
+
children: r("relationships.detail.attachAssetModal.cancel", "Cancel")
|
|
566
|
+
}), /* @__PURE__ */ H("button", {
|
|
539
567
|
type: "submit",
|
|
540
|
-
disabled:
|
|
568
|
+
disabled: S,
|
|
541
569
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
542
|
-
children:
|
|
570
|
+
children: S ? r("relationships.detail.attachAssetModal.attaching", "Attaching…") : r("relationships.detail.attachAssetModal.submit", "Attach asset")
|
|
543
571
|
})]
|
|
544
572
|
})
|
|
545
573
|
]
|
|
546
574
|
})
|
|
547
575
|
});
|
|
548
576
|
}
|
|
549
|
-
function
|
|
550
|
-
let
|
|
551
|
-
return /* @__PURE__ */
|
|
577
|
+
function fe({ asset: e }) {
|
|
578
|
+
let { formatDate: r, formatEnumLabel: i } = n(), a = t(), o = _(), [s, c] = k(!1);
|
|
579
|
+
return /* @__PURE__ */ U("div", {
|
|
552
580
|
className: "flex items-center justify-between gap-3 p-3",
|
|
553
|
-
children: [/* @__PURE__ */
|
|
581
|
+
children: [/* @__PURE__ */ U("div", {
|
|
554
582
|
className: "flex min-w-0 items-center gap-2",
|
|
555
|
-
children: [/* @__PURE__ */
|
|
583
|
+
children: [/* @__PURE__ */ H(R, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ U("div", {
|
|
556
584
|
className: "min-w-0",
|
|
557
|
-
children: [/* @__PURE__ */
|
|
585
|
+
children: [/* @__PURE__ */ H("p", {
|
|
558
586
|
className: "truncate text-sm font-medium text-text-primary",
|
|
559
587
|
children: e.name
|
|
560
|
-
}), /* @__PURE__ */
|
|
588
|
+
}), /* @__PURE__ */ H("p", {
|
|
561
589
|
className: "text-xs text-text-secondary",
|
|
562
590
|
children: i(e.type)
|
|
563
591
|
})]
|
|
564
592
|
})]
|
|
565
|
-
}), /* @__PURE__ */
|
|
593
|
+
}), /* @__PURE__ */ U("div", {
|
|
566
594
|
className: "flex shrink-0 items-center gap-3",
|
|
567
|
-
children: [e.expiresAt && /* @__PURE__ */
|
|
595
|
+
children: [e.expiresAt && /* @__PURE__ */ H("span", {
|
|
568
596
|
className: "text-xs text-text-secondary",
|
|
569
|
-
children:
|
|
570
|
-
}), e.file?.id && /* @__PURE__ */
|
|
597
|
+
children: a("relationships.detail.assetRow.expires", "Expires {{date}}", { date: r(e.expiresAt) })
|
|
598
|
+
}), e.file?.id && /* @__PURE__ */ U("button", {
|
|
571
599
|
type: "button",
|
|
572
600
|
onClick: async () => {
|
|
573
601
|
if (e.file?.id) {
|
|
574
|
-
|
|
602
|
+
c(!0);
|
|
575
603
|
try {
|
|
576
|
-
let t = await
|
|
604
|
+
let t = await o(e.file.id);
|
|
577
605
|
window.open(t, "_blank", "noopener,noreferrer");
|
|
578
606
|
} catch {} finally {
|
|
579
|
-
|
|
607
|
+
c(!1);
|
|
580
608
|
}
|
|
581
609
|
}
|
|
582
610
|
},
|
|
583
|
-
disabled:
|
|
611
|
+
disabled: s,
|
|
584
612
|
className: "inline-flex items-center gap-1 rounded-lg border border-border-subtle px-2.5 py-1 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
|
|
585
613
|
children: [
|
|
586
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ H(I, { className: "h-3.5 w-3.5" }),
|
|
587
615
|
" ",
|
|
588
|
-
|
|
616
|
+
s ? a("relationships.detail.assetRow.opening", "Opening…") : a("relationships.detail.assetRow.download", "Download")
|
|
589
617
|
]
|
|
590
618
|
})]
|
|
591
619
|
})]
|
|
592
620
|
});
|
|
593
621
|
}
|
|
594
|
-
function
|
|
595
|
-
let
|
|
596
|
-
return /* @__PURE__ */
|
|
622
|
+
function pe({ invoice: e }) {
|
|
623
|
+
let { formatCurrency: r, formatDate: i, formatEnumLabel: a } = n(), o = t(), s = e.number ?? o("relationships.detail.invoiceRow.unnumbered", "Unnumbered invoice");
|
|
624
|
+
return /* @__PURE__ */ U("div", {
|
|
597
625
|
className: "flex items-center justify-between gap-3 p-3",
|
|
598
|
-
children: [/* @__PURE__ */
|
|
626
|
+
children: [/* @__PURE__ */ U("div", {
|
|
599
627
|
className: "flex min-w-0 items-center gap-2",
|
|
600
|
-
children: [/* @__PURE__ */
|
|
628
|
+
children: [/* @__PURE__ */ H(F, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ U("div", {
|
|
601
629
|
className: "min-w-0",
|
|
602
|
-
children: [/* @__PURE__ */
|
|
630
|
+
children: [/* @__PURE__ */ H("p", {
|
|
603
631
|
className: "truncate text-sm font-medium text-text-primary",
|
|
604
|
-
children:
|
|
605
|
-
}), /* @__PURE__ */
|
|
632
|
+
children: s
|
|
633
|
+
}), /* @__PURE__ */ U("p", {
|
|
606
634
|
className: "text-xs text-text-secondary",
|
|
607
|
-
children: [
|
|
635
|
+
children: [a(e.status), e.dueDate ? ` · ${o("relationships.detail.invoiceRow.due", "due {{date}}", { date: i(e.dueDate) })}` : e.issueDate ? ` · ${i(e.issueDate)}` : ""]
|
|
608
636
|
})]
|
|
609
637
|
})]
|
|
610
|
-
}), /* @__PURE__ */
|
|
638
|
+
}), /* @__PURE__ */ H("span", {
|
|
611
639
|
className: "shrink-0 text-sm font-medium tabular-nums text-text-primary",
|
|
612
|
-
children:
|
|
640
|
+
children: r(e.total, e.currency)
|
|
613
641
|
})]
|
|
614
642
|
});
|
|
615
643
|
}
|
|
616
|
-
function
|
|
617
|
-
let
|
|
618
|
-
relationshipId:
|
|
644
|
+
function me() {
|
|
645
|
+
let { formatCurrency: o, formatDate: m, formatEnumLabel: h, formatIntervalSuffix: _ } = n(), y = t(), { id: b } = ie(), { navigateTo: C } = e(), { data: w, isLoading: E, isError: I, refetch: R } = x(b), z = S(), B = p(), [G, K] = k(null), [q, J] = k(!1), [Y, Z] = k(!1), [me, Q] = k(!1), he = v({
|
|
646
|
+
relationshipId: b,
|
|
619
647
|
pagination: {
|
|
620
648
|
limit: 50,
|
|
621
649
|
offset: 0
|
|
622
650
|
}
|
|
623
|
-
}, { enabled: !!
|
|
624
|
-
relationshipId:
|
|
651
|
+
}, { enabled: !!b }), ge = g({
|
|
652
|
+
relationshipId: b,
|
|
625
653
|
status: "PROPOSED"
|
|
626
|
-
}, { enabled: !!
|
|
627
|
-
if (
|
|
628
|
-
title:
|
|
629
|
-
children: /* @__PURE__ */
|
|
654
|
+
}, { enabled: !!b });
|
|
655
|
+
if (E) return /* @__PURE__ */ H(r, {
|
|
656
|
+
title: y("relationships.title", "Relationship"),
|
|
657
|
+
children: /* @__PURE__ */ H(c, { label: y("relationships.detail.loading", "Loading relationship…") })
|
|
630
658
|
});
|
|
631
|
-
if (
|
|
632
|
-
title:
|
|
633
|
-
children: /* @__PURE__ */
|
|
634
|
-
message:
|
|
635
|
-
onRetry: () => void
|
|
659
|
+
if (I) return /* @__PURE__ */ H(r, {
|
|
660
|
+
title: y("relationships.title", "Relationship"),
|
|
661
|
+
children: /* @__PURE__ */ H(s, {
|
|
662
|
+
message: y("relationships.detail.error", "Could not load this relationship."),
|
|
663
|
+
onRetry: () => void R()
|
|
636
664
|
})
|
|
637
665
|
});
|
|
638
|
-
if (!
|
|
639
|
-
title:
|
|
640
|
-
children: /* @__PURE__ */
|
|
666
|
+
if (!w) return /* @__PURE__ */ H(r, {
|
|
667
|
+
title: y("relationships.title", "Relationship"),
|
|
668
|
+
children: /* @__PURE__ */ H(a, {
|
|
641
669
|
illustration: "empty-data",
|
|
642
|
-
title:
|
|
643
|
-
description:
|
|
644
|
-
action: /* @__PURE__ */
|
|
670
|
+
title: y("relationships.detail.notFoundTitle", "Relationship not found"),
|
|
671
|
+
description: y("relationships.detail.notFoundDescription", "It may have been removed, or you may not have access to it."),
|
|
672
|
+
action: /* @__PURE__ */ H("button", {
|
|
645
673
|
type: "button",
|
|
646
|
-
onClick: () =>
|
|
674
|
+
onClick: () => C("/relationships"),
|
|
647
675
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
648
|
-
children:
|
|
676
|
+
children: y("relationships.detail.backToRelationships", "Back to relationships")
|
|
649
677
|
})
|
|
650
678
|
})
|
|
651
679
|
});
|
|
652
|
-
let
|
|
653
|
-
|
|
654
|
-
id:
|
|
680
|
+
let $ = w, _e = z.isPending || B.isPending, ve = (e) => {
|
|
681
|
+
K(null), z.mutate({
|
|
682
|
+
id: $.id,
|
|
655
683
|
status: e
|
|
656
|
-
}, { onError: (e) =>
|
|
684
|
+
}, { onError: (e) => K(e instanceof Error ? e.message : y("relationships.detail.transitionError", "Transition failed")) });
|
|
657
685
|
}, ye = () => {
|
|
658
|
-
|
|
659
|
-
}, be = [
|
|
660
|
-
let t = new Date(e.occursAt).getTime(),
|
|
686
|
+
K(null), B.mutate($.id, { onError: (e) => K(e instanceof Error ? e.message : y("relationships.detail.cancelError", "Cancel failed")) });
|
|
687
|
+
}, be = [...$.renewalEvents ?? []].sort((e, t) => new Date(e.occursAt).getTime() - new Date(t.occursAt).getTime()).map((e) => {
|
|
688
|
+
let t = new Date(e.occursAt).getTime(), n = !Number.isNaN(t) && t > Date.now();
|
|
661
689
|
return {
|
|
662
|
-
title:
|
|
663
|
-
sub: `${
|
|
664
|
-
meta: e.amount == null ? void 0 :
|
|
665
|
-
tone:
|
|
690
|
+
title: h(e.eventType),
|
|
691
|
+
sub: `${m(e.occursAt)}${e.detail ? ` · ${e.detail}` : ""}`,
|
|
692
|
+
meta: e.amount == null ? void 0 : o(e.amount, e.currency ?? $.currency),
|
|
693
|
+
tone: n ? "warning" : "muted"
|
|
666
694
|
};
|
|
667
|
-
}), xe =
|
|
695
|
+
}), xe = $.autoRenew ? /* @__PURE__ */ H("span", {
|
|
668
696
|
className: "inline-flex items-center rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-xs font-medium text-status-success-text",
|
|
669
|
-
children:
|
|
670
|
-
}) : /* @__PURE__ */
|
|
697
|
+
children: y("relationships.detail.autoRenewOn", "On")
|
|
698
|
+
}) : /* @__PURE__ */ H("span", {
|
|
671
699
|
className: "inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
672
|
-
children:
|
|
673
|
-
}), Se =
|
|
674
|
-
return /* @__PURE__ */
|
|
675
|
-
title:
|
|
676
|
-
description:
|
|
677
|
-
actions: /* @__PURE__ */
|
|
700
|
+
children: y("relationships.detail.autoRenewOff", "Off")
|
|
701
|
+
}), Se = se.filter((e) => T($.status, e.status)), Ce = $.plan?.features ?? [];
|
|
702
|
+
return /* @__PURE__ */ U(r, {
|
|
703
|
+
title: $.label,
|
|
704
|
+
description: $.provider?.name ?? y(oe[$.kind], h($.kind)),
|
|
705
|
+
actions: /* @__PURE__ */ U("div", {
|
|
678
706
|
className: "flex items-center gap-2",
|
|
679
707
|
children: [
|
|
680
|
-
/* @__PURE__ */
|
|
708
|
+
/* @__PURE__ */ U("button", {
|
|
681
709
|
type: "button",
|
|
682
|
-
onClick: () =>
|
|
710
|
+
onClick: () => J(!0),
|
|
683
711
|
className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
684
712
|
children: [
|
|
685
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ H(ee, { className: "h-4 w-4" }),
|
|
686
714
|
" ",
|
|
687
|
-
|
|
715
|
+
y("relationships.detail.edit", "Edit")
|
|
688
716
|
]
|
|
689
717
|
}),
|
|
690
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ U("button", {
|
|
691
719
|
type: "button",
|
|
692
720
|
"data-testid": "negotiate-bill",
|
|
693
|
-
onClick: () =>
|
|
721
|
+
onClick: () => C(`/negotiations/new?relationshipId=${encodeURIComponent($.id)}`),
|
|
694
722
|
className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
695
723
|
children: [
|
|
696
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ H(L, { className: "h-4 w-4" }),
|
|
697
725
|
" ",
|
|
698
|
-
|
|
726
|
+
y("relationships.detail.negotiate", "Negotiate this bill")
|
|
699
727
|
]
|
|
700
728
|
}),
|
|
701
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ U("button", {
|
|
702
730
|
type: "button",
|
|
703
731
|
"data-testid": "request-procurement",
|
|
704
|
-
onClick: () =>
|
|
732
|
+
onClick: () => C(`/procurement/new?relationshipId=${encodeURIComponent($.id)}`),
|
|
705
733
|
className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
706
734
|
children: [
|
|
707
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ H(N, { className: "h-4 w-4" }),
|
|
708
736
|
" ",
|
|
709
|
-
|
|
737
|
+
y("relationships.detail.procurement", "Ask an expert to negotiate")
|
|
710
738
|
]
|
|
711
739
|
}),
|
|
712
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ U("button", {
|
|
713
741
|
type: "button",
|
|
714
|
-
onClick: () =>
|
|
742
|
+
onClick: () => C("/relationships"),
|
|
715
743
|
className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
716
744
|
children: [
|
|
717
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ H(j, { className: "rtl:rotate-180 h-4 w-4" }),
|
|
718
746
|
" ",
|
|
719
|
-
|
|
747
|
+
y("relationships.detail.back", "Back")
|
|
720
748
|
]
|
|
721
749
|
})
|
|
722
750
|
]
|
|
723
751
|
}),
|
|
724
752
|
children: [
|
|
725
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ H(W, {
|
|
726
754
|
treatment: "glass",
|
|
727
755
|
glow: !0,
|
|
728
756
|
className: "p-5 sm:p-6",
|
|
729
|
-
children: /* @__PURE__ */
|
|
757
|
+
children: /* @__PURE__ */ U("div", {
|
|
730
758
|
className: "flex flex-col gap-5 lg:flex-row lg:items-start lg:justify-between",
|
|
731
|
-
children: [/* @__PURE__ */
|
|
759
|
+
children: [/* @__PURE__ */ U("div", {
|
|
732
760
|
className: "min-w-0",
|
|
733
761
|
children: [
|
|
734
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ H("p", {
|
|
735
763
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
736
|
-
children:
|
|
764
|
+
children: y(oe[$.kind], h($.kind))
|
|
737
765
|
}),
|
|
738
|
-
/* @__PURE__ */
|
|
766
|
+
/* @__PURE__ */ U("div", {
|
|
739
767
|
className: "mt-2 flex flex-wrap items-center gap-3",
|
|
740
|
-
children: [/* @__PURE__ */
|
|
768
|
+
children: [/* @__PURE__ */ U("span", {
|
|
741
769
|
className: "text-3xl font-bold tabular-nums text-text-primary",
|
|
742
|
-
children: [
|
|
770
|
+
children: [o($.amount, $.currency), /* @__PURE__ */ H("span", {
|
|
743
771
|
className: "text-base font-normal text-text-secondary",
|
|
744
|
-
children:
|
|
772
|
+
children: _($.interval)
|
|
745
773
|
})]
|
|
746
|
-
}), /* @__PURE__ */
|
|
774
|
+
}), /* @__PURE__ */ H(i, { status: $.status })]
|
|
747
775
|
}),
|
|
748
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ U("div", {
|
|
749
777
|
className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-text-secondary",
|
|
750
778
|
children: [
|
|
751
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ U("span", {
|
|
752
780
|
className: "inline-flex items-center gap-1.5",
|
|
753
|
-
children: [/* @__PURE__ */
|
|
781
|
+
children: [/* @__PURE__ */ H(P, { className: "h-3.5 w-3.5" }), $.renewsAt ? y("relationships.detail.renews", "Renews {{date}}", { date: m($.renewsAt) }) : y("relationships.detail.noRenewalScheduled", "No renewal scheduled")]
|
|
754
782
|
}),
|
|
755
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ U("span", {
|
|
756
784
|
className: "inline-flex items-center gap-1.5",
|
|
757
|
-
children: [/* @__PURE__ */
|
|
785
|
+
children: [/* @__PURE__ */ H(te, { className: "h-3.5 w-3.5" }), h($.discoverySource)]
|
|
758
786
|
}),
|
|
759
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ U("span", {
|
|
760
788
|
className: "inline-flex items-center gap-1.5",
|
|
761
789
|
children: [
|
|
762
|
-
|
|
790
|
+
y("relationships.detail.autoRenew", "Auto-renew"),
|
|
763
791
|
" ",
|
|
764
792
|
xe
|
|
765
793
|
]
|
|
766
794
|
})
|
|
767
795
|
]
|
|
768
796
|
}),
|
|
769
|
-
|
|
797
|
+
$.tags.length > 0 && /* @__PURE__ */ U("div", {
|
|
770
798
|
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
771
|
-
children: [/* @__PURE__ */
|
|
799
|
+
children: [/* @__PURE__ */ H(ne, { className: "h-3.5 w-3.5 text-text-secondary" }), $.tags.map((e) => /* @__PURE__ */ H("span", {
|
|
772
800
|
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
|
|
773
801
|
children: e
|
|
774
802
|
}, e))]
|
|
775
803
|
})
|
|
776
804
|
]
|
|
777
|
-
}), /* @__PURE__ */
|
|
805
|
+
}), /* @__PURE__ */ U("div", {
|
|
778
806
|
className: "grid shrink-0 grid-cols-2 gap-2 sm:flex sm:flex-wrap lg:flex-col lg:items-stretch",
|
|
779
807
|
children: [Se.map((e) => {
|
|
780
808
|
let t = e.icon;
|
|
781
|
-
return /* @__PURE__ */
|
|
809
|
+
return /* @__PURE__ */ U("button", {
|
|
782
810
|
type: "button",
|
|
783
811
|
disabled: _e,
|
|
784
812
|
onClick: () => ve(e.status),
|
|
785
813
|
className: "inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm sm:min-h-0 sm:text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
|
|
786
814
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
815
|
+
/* @__PURE__ */ H(t, { className: "h-3.5 w-3.5" }),
|
|
788
816
|
" ",
|
|
789
|
-
|
|
817
|
+
y(e.labelKey, e.defaultLabel)
|
|
790
818
|
]
|
|
791
819
|
}, e.status);
|
|
792
|
-
}),
|
|
820
|
+
}), T($.status, "CANCELLED") && /* @__PURE__ */ U("button", {
|
|
793
821
|
type: "button",
|
|
794
822
|
disabled: _e,
|
|
795
823
|
onClick: ye,
|
|
796
824
|
className: "inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-3 py-1.5 text-sm sm:min-h-0 sm:text-xs font-medium text-status-error-text hover:opacity-90 disabled:opacity-50",
|
|
797
825
|
children: [
|
|
798
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ H(M, { className: "h-3.5 w-3.5" }),
|
|
799
827
|
" ",
|
|
800
|
-
|
|
828
|
+
y("relationships.detail.actions.cancel", "Cancel")
|
|
801
829
|
]
|
|
802
830
|
})]
|
|
803
831
|
})]
|
|
804
832
|
})
|
|
805
833
|
}),
|
|
806
|
-
|
|
834
|
+
G && /* @__PURE__ */ H("div", {
|
|
807
835
|
className: "mt-4 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
808
|
-
children:
|
|
836
|
+
children: G
|
|
809
837
|
}),
|
|
810
|
-
/* @__PURE__ */
|
|
838
|
+
/* @__PURE__ */ U("div", {
|
|
811
839
|
className: "mt-6 grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
812
|
-
children: [/* @__PURE__ */
|
|
840
|
+
children: [/* @__PURE__ */ U("div", {
|
|
813
841
|
className: "space-y-4 lg:col-span-2",
|
|
814
842
|
children: [
|
|
815
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ U("div", {
|
|
816
844
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
817
|
-
children: [/* @__PURE__ */
|
|
845
|
+
children: [/* @__PURE__ */ U(W, {
|
|
818
846
|
treatment: "metric",
|
|
819
847
|
className: "p-5",
|
|
820
848
|
children: [
|
|
821
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ U("div", {
|
|
822
850
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
823
851
|
children: [
|
|
824
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ H(F, { className: "h-4 w-4 text-text-secondary" }),
|
|
825
853
|
" ",
|
|
826
|
-
|
|
854
|
+
y("relationships.detail.sections.planPricing", "Plan & pricing")
|
|
827
855
|
]
|
|
828
856
|
}),
|
|
829
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ U("div", {
|
|
830
858
|
className: "mt-3",
|
|
831
859
|
children: [
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
label:
|
|
834
|
-
value:
|
|
860
|
+
/* @__PURE__ */ H(X, {
|
|
861
|
+
label: y("relationships.detail.info.plan", "Plan"),
|
|
862
|
+
value: $.plan?.name ?? "—"
|
|
835
863
|
}),
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
label:
|
|
838
|
-
value: /* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ H(X, {
|
|
865
|
+
label: y("relationships.detail.info.price", "Price"),
|
|
866
|
+
value: /* @__PURE__ */ U(ae, { children: [o($.amount, $.currency), /* @__PURE__ */ H("span", {
|
|
839
867
|
className: "font-normal text-text-secondary",
|
|
840
|
-
children:
|
|
868
|
+
children: _($.interval)
|
|
841
869
|
})] })
|
|
842
870
|
}),
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
label:
|
|
845
|
-
value:
|
|
871
|
+
/* @__PURE__ */ H(X, {
|
|
872
|
+
label: y("relationships.detail.info.billingInterval", "Billing interval"),
|
|
873
|
+
value: h($.interval)
|
|
846
874
|
}),
|
|
847
|
-
/* @__PURE__ */
|
|
848
|
-
label:
|
|
849
|
-
value:
|
|
875
|
+
/* @__PURE__ */ H(X, {
|
|
876
|
+
label: y("relationships.detail.info.provider", "Provider"),
|
|
877
|
+
value: $.provider?.name ?? "—"
|
|
850
878
|
})
|
|
851
879
|
]
|
|
852
880
|
}),
|
|
853
|
-
|
|
881
|
+
Ce.length > 0 && /* @__PURE__ */ H("div", {
|
|
854
882
|
className: "mt-3 flex flex-wrap gap-1.5",
|
|
855
|
-
children:
|
|
883
|
+
children: Ce.map((e) => /* @__PURE__ */ H("span", {
|
|
856
884
|
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
|
|
857
885
|
children: e
|
|
858
886
|
}, e))
|
|
859
887
|
})
|
|
860
888
|
]
|
|
861
|
-
}), /* @__PURE__ */
|
|
889
|
+
}), /* @__PURE__ */ U(W, {
|
|
862
890
|
treatment: "metric",
|
|
863
891
|
className: "p-5",
|
|
864
|
-
children: [/* @__PURE__ */
|
|
892
|
+
children: [/* @__PURE__ */ U("div", {
|
|
865
893
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
866
894
|
children: [
|
|
867
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ H(re, { className: "h-4 w-4 text-text-secondary" }),
|
|
868
896
|
" ",
|
|
869
|
-
|
|
897
|
+
y("relationships.detail.sections.paymentBilling", "Payment & billing")
|
|
870
898
|
]
|
|
871
|
-
}), /* @__PURE__ */
|
|
899
|
+
}), /* @__PURE__ */ U("div", {
|
|
872
900
|
className: "mt-3",
|
|
873
901
|
children: [
|
|
874
|
-
/* @__PURE__ */
|
|
875
|
-
label:
|
|
876
|
-
value:
|
|
902
|
+
/* @__PURE__ */ H(X, {
|
|
903
|
+
label: y("relationships.detail.info.currency", "Currency"),
|
|
904
|
+
value: $.currency
|
|
877
905
|
}),
|
|
878
|
-
/* @__PURE__ */
|
|
879
|
-
label:
|
|
906
|
+
/* @__PURE__ */ H(X, {
|
|
907
|
+
label: y("relationships.detail.info.autoRenew", "Auto-renew"),
|
|
880
908
|
value: xe
|
|
881
909
|
}),
|
|
882
|
-
/* @__PURE__ */
|
|
883
|
-
label:
|
|
884
|
-
value:
|
|
910
|
+
/* @__PURE__ */ H(X, {
|
|
911
|
+
label: y("relationships.detail.info.nextRenewal", "Next renewal"),
|
|
912
|
+
value: $.renewsAt ? m($.renewsAt) : "—"
|
|
885
913
|
}),
|
|
886
|
-
/* @__PURE__ */
|
|
887
|
-
label:
|
|
888
|
-
value:
|
|
914
|
+
/* @__PURE__ */ H(X, {
|
|
915
|
+
label: y("relationships.detail.info.started", "Started"),
|
|
916
|
+
value: $.startedAt ? m($.startedAt) : "—"
|
|
889
917
|
}),
|
|
890
|
-
|
|
891
|
-
label:
|
|
892
|
-
value:
|
|
918
|
+
$.trialEndsAt && /* @__PURE__ */ H(X, {
|
|
919
|
+
label: y("relationships.detail.info.trialEnds", "Trial ends"),
|
|
920
|
+
value: m($.trialEndsAt)
|
|
893
921
|
})
|
|
894
922
|
]
|
|
895
923
|
})]
|
|
896
924
|
})]
|
|
897
925
|
}),
|
|
898
|
-
(
|
|
926
|
+
(ge.data?.items.length ?? 0) > 0 && /* @__PURE__ */ U(l, {
|
|
899
927
|
className: "mt-0",
|
|
900
|
-
title:
|
|
901
|
-
description:
|
|
902
|
-
children: [/* @__PURE__ */
|
|
928
|
+
title: y("relationships.detail.sections.aiRecommendations", "AI recommendations"),
|
|
929
|
+
description: y("relationships.detail.sections.aiRecommendationsDescription", "Open recommendations about this subscription. You can also make any of these changes by hand above."),
|
|
930
|
+
children: [/* @__PURE__ */ H(O, { className: "mb-3" }), /* @__PURE__ */ H("div", {
|
|
903
931
|
className: "grid grid-cols-1 gap-3",
|
|
904
932
|
"data-testid": "relationship-decisions",
|
|
905
|
-
children:
|
|
933
|
+
children: ge.data?.items.map((e) => /* @__PURE__ */ H(D, { decision: e }, e.id))
|
|
906
934
|
})]
|
|
907
935
|
}),
|
|
908
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ H(l, {
|
|
909
937
|
className: "mt-0",
|
|
910
|
-
title:
|
|
911
|
-
description:
|
|
912
|
-
action: /* @__PURE__ */
|
|
938
|
+
title: y("relationships.detail.sections.entitlements", "Entitlements"),
|
|
939
|
+
description: y("relationships.detail.sections.entitlementsDescription", "What this relationship grants you"),
|
|
940
|
+
action: /* @__PURE__ */ U("button", {
|
|
913
941
|
type: "button",
|
|
914
|
-
onClick: () =>
|
|
942
|
+
onClick: () => Z(!0),
|
|
915
943
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
916
944
|
children: [
|
|
917
|
-
/* @__PURE__ */ V
|
|
945
|
+
/* @__PURE__ */ H(V, { className: "h-3.5 w-3.5" }),
|
|
918
946
|
" ",
|
|
919
|
-
|
|
947
|
+
y("relationships.detail.sections.addEntitlement", "Add entitlement")
|
|
920
948
|
]
|
|
921
949
|
}),
|
|
922
|
-
children:
|
|
950
|
+
children: !$.entitlements || $.entitlements.length === 0 ? /* @__PURE__ */ H(a, {
|
|
923
951
|
illustration: "empty-data",
|
|
924
|
-
title:
|
|
925
|
-
description:
|
|
926
|
-
}) : /* @__PURE__ */
|
|
952
|
+
title: y("relationships.detail.empty.noEntitlementsTitle", "No entitlements"),
|
|
953
|
+
description: y("relationships.detail.empty.noEntitlementsDescription", "Entitlements (seats, quotas, feature access) will appear here.")
|
|
954
|
+
}) : /* @__PURE__ */ H("div", {
|
|
927
955
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
928
|
-
children:
|
|
956
|
+
children: $.entitlements.map((e) => {
|
|
929
957
|
let t = e.quota != null && e.quota > 0;
|
|
930
|
-
return /* @__PURE__ */
|
|
958
|
+
return /* @__PURE__ */ U(W, {
|
|
931
959
|
treatment: "plain",
|
|
932
960
|
className: "p-4",
|
|
933
961
|
children: [
|
|
934
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ U("div", {
|
|
935
963
|
className: "flex items-start justify-between gap-2",
|
|
936
|
-
children: [/* @__PURE__ */
|
|
964
|
+
children: [/* @__PURE__ */ H("p", {
|
|
937
965
|
className: "min-w-0 truncate text-sm font-medium text-text-primary",
|
|
938
966
|
children: e.name
|
|
939
|
-
}), /* @__PURE__ */
|
|
967
|
+
}), /* @__PURE__ */ H(i, { status: e.isActive ? "ACTIVE" : "DISABLED" })]
|
|
940
968
|
}),
|
|
941
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ H("p", {
|
|
942
970
|
className: "mt-1 text-xs text-text-secondary",
|
|
943
|
-
children:
|
|
971
|
+
children: h(e.type)
|
|
944
972
|
}),
|
|
945
|
-
t && /* @__PURE__ */
|
|
973
|
+
t && /* @__PURE__ */ U("div", {
|
|
946
974
|
className: "mt-3",
|
|
947
|
-
children: [/* @__PURE__ */
|
|
975
|
+
children: [/* @__PURE__ */ U("div", {
|
|
948
976
|
className: "flex items-center justify-between text-xs text-text-secondary",
|
|
949
|
-
children: [/* @__PURE__ */
|
|
977
|
+
children: [/* @__PURE__ */ U("span", { children: [
|
|
950
978
|
e.used,
|
|
951
979
|
" / ",
|
|
952
980
|
e.quota,
|
|
953
981
|
e.unit ? ` ${e.unit}` : ""
|
|
954
|
-
] }), /* @__PURE__ */
|
|
982
|
+
] }), /* @__PURE__ */ U("span", {
|
|
955
983
|
className: "tabular-nums",
|
|
956
984
|
children: [Math.round(e.used / e.quota * 100), "%"]
|
|
957
985
|
})]
|
|
958
|
-
}), /* @__PURE__ */
|
|
986
|
+
}), /* @__PURE__ */ H(d, {
|
|
987
|
+
label: y("common.quotaUtilization", "Quota utilization"),
|
|
959
988
|
value: e.used,
|
|
960
989
|
max: e.quota,
|
|
961
990
|
tone: e.used / e.quota >= .9 ? "negative" : e.used / e.quota >= .7 ? "warning" : "accent",
|
|
@@ -967,23 +996,23 @@ function Z() {
|
|
|
967
996
|
})
|
|
968
997
|
})
|
|
969
998
|
}),
|
|
970
|
-
/* @__PURE__ */
|
|
999
|
+
/* @__PURE__ */ H(l, {
|
|
971
1000
|
className: "mt-0",
|
|
972
|
-
title:
|
|
973
|
-
description:
|
|
974
|
-
action: /* @__PURE__ */
|
|
1001
|
+
title: y("relationships.detail.sections.assets", "Assets"),
|
|
1002
|
+
description: y("relationships.detail.sections.assetsDescription", "Invoices, contracts, licenses and credentials"),
|
|
1003
|
+
action: /* @__PURE__ */ U("button", {
|
|
975
1004
|
type: "button",
|
|
976
|
-
onClick: () =>
|
|
1005
|
+
onClick: () => Q(!0),
|
|
977
1006
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
978
1007
|
children: [
|
|
979
|
-
/* @__PURE__ */ V
|
|
1008
|
+
/* @__PURE__ */ H(V, { className: "h-3.5 w-3.5" }),
|
|
980
1009
|
" ",
|
|
981
|
-
|
|
1010
|
+
y("relationships.detail.sections.attachAsset", "Attach asset")
|
|
982
1011
|
]
|
|
983
1012
|
}),
|
|
984
1013
|
children: (() => {
|
|
985
|
-
let e =
|
|
986
|
-
return e.length > 0 || t.length > 0 ? /* @__PURE__ */
|
|
1014
|
+
let e = $.assets ?? [], t = he.data?.items ?? [];
|
|
1015
|
+
return e.length > 0 || t.length > 0 ? /* @__PURE__ */ H(W, {
|
|
987
1016
|
treatment: "plain",
|
|
988
1017
|
className: "divide-y divide-border-subtle p-0",
|
|
989
1018
|
children: [...e.map((e) => ({
|
|
@@ -994,89 +1023,90 @@ function Z() {
|
|
|
994
1023
|
kind: "invoice",
|
|
995
1024
|
sort: new Date(e.createdAt).getTime() || 0,
|
|
996
1025
|
invoice: e
|
|
997
|
-
}))].sort((e, t) => t.sort - e.sort).map((e) => e.kind === "asset" ? /* @__PURE__ */
|
|
998
|
-
}) : /* @__PURE__ */
|
|
1026
|
+
}))].sort((e, t) => t.sort - e.sort).map((e) => e.kind === "asset" ? /* @__PURE__ */ H(fe, { asset: e.asset }, `a-${e.asset.id}`) : /* @__PURE__ */ H(pe, { invoice: e.invoice }, `i-${e.invoice.id}`))
|
|
1027
|
+
}) : /* @__PURE__ */ H(a, {
|
|
999
1028
|
illustration: "empty-data",
|
|
1000
|
-
title:
|
|
1001
|
-
description:
|
|
1029
|
+
title: y("relationships.detail.empty.noAssetsTitle", "No assets attached"),
|
|
1030
|
+
description: y("relationships.detail.empty.noAssetsDescription", "Attach invoices, contracts, licenses or receipts to this relationship.")
|
|
1002
1031
|
});
|
|
1003
1032
|
})()
|
|
1004
1033
|
}),
|
|
1005
|
-
|
|
1034
|
+
$.notes && /* @__PURE__ */ U(W, {
|
|
1006
1035
|
treatment: "plain",
|
|
1007
1036
|
className: "p-4",
|
|
1008
|
-
children: [/* @__PURE__ */
|
|
1037
|
+
children: [/* @__PURE__ */ H("p", {
|
|
1009
1038
|
className: "text-xs font-medium text-text-secondary",
|
|
1010
|
-
children:
|
|
1011
|
-
}), /* @__PURE__ */
|
|
1039
|
+
children: y("relationships.detail.sections.notes", "Notes")
|
|
1040
|
+
}), /* @__PURE__ */ H("p", {
|
|
1012
1041
|
className: "mt-1 whitespace-pre-wrap text-sm text-text-primary",
|
|
1013
|
-
children:
|
|
1042
|
+
children: $.notes
|
|
1014
1043
|
})]
|
|
1015
1044
|
})
|
|
1016
1045
|
]
|
|
1017
|
-
}), /* @__PURE__ */
|
|
1046
|
+
}), /* @__PURE__ */ U("div", {
|
|
1018
1047
|
className: "space-y-4",
|
|
1019
|
-
children: [/* @__PURE__ */
|
|
1048
|
+
children: [/* @__PURE__ */ U(W, {
|
|
1020
1049
|
treatment: "metric",
|
|
1021
1050
|
className: "p-5",
|
|
1022
|
-
children: [/* @__PURE__ */
|
|
1051
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1023
1052
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1024
1053
|
children: [
|
|
1025
|
-
/* @__PURE__ */
|
|
1054
|
+
/* @__PURE__ */ H(A, { className: "h-4 w-4 text-text-secondary" }),
|
|
1026
1055
|
" ",
|
|
1027
|
-
|
|
1056
|
+
y("relationships.detail.sections.healthScore", "Health score")
|
|
1028
1057
|
]
|
|
1029
|
-
}),
|
|
1058
|
+
}), $.healthScore == null ? /* @__PURE__ */ H("p", {
|
|
1030
1059
|
className: "mt-4 text-sm text-text-secondary",
|
|
1031
|
-
children:
|
|
1032
|
-
}) : /* @__PURE__ */
|
|
1060
|
+
children: y("relationships.detail.empty.noHealthScore", "Not scored yet. A health score appears once Subscriber Bot has enough signal.")
|
|
1061
|
+
}) : /* @__PURE__ */ U("div", {
|
|
1033
1062
|
className: "mt-4 flex flex-col items-center",
|
|
1034
1063
|
children: [
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
value:
|
|
1064
|
+
/* @__PURE__ */ H(u, {
|
|
1065
|
+
value: $.healthScore,
|
|
1037
1066
|
max: 100,
|
|
1038
1067
|
size: 160,
|
|
1039
|
-
label:
|
|
1068
|
+
label: y("relationships.detail.outOf100", "of 100")
|
|
1040
1069
|
}),
|
|
1041
|
-
/* @__PURE__ */
|
|
1070
|
+
/* @__PURE__ */ H("div", {
|
|
1042
1071
|
className: "mt-2 w-full",
|
|
1043
|
-
children: /* @__PURE__ */
|
|
1044
|
-
|
|
1072
|
+
children: /* @__PURE__ */ H(d, {
|
|
1073
|
+
label: y("common.healthScore", "Health score"),
|
|
1074
|
+
value: $.healthScore,
|
|
1045
1075
|
max: 100,
|
|
1046
|
-
tone:
|
|
1076
|
+
tone: ce($.healthScore)
|
|
1047
1077
|
})
|
|
1048
1078
|
}),
|
|
1049
|
-
/* @__PURE__ */
|
|
1079
|
+
/* @__PURE__ */ H("p", {
|
|
1050
1080
|
className: "mt-3 text-center text-xs text-text-secondary",
|
|
1051
1081
|
"data-testid": "health-score-basis",
|
|
1052
|
-
children:
|
|
1082
|
+
children: y("relationships.detail.healthScoreBasis", "Computed from usage, payment history, price stability and overlap with your other subscriptions.")
|
|
1053
1083
|
})
|
|
1054
1084
|
]
|
|
1055
1085
|
})]
|
|
1056
|
-
}), /* @__PURE__ */
|
|
1086
|
+
}), /* @__PURE__ */ U(W, {
|
|
1057
1087
|
treatment: "metric",
|
|
1058
1088
|
className: "p-5",
|
|
1059
1089
|
children: [
|
|
1060
|
-
/* @__PURE__ */
|
|
1090
|
+
/* @__PURE__ */ U("div", {
|
|
1061
1091
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1062
1092
|
children: [
|
|
1063
|
-
/* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ H(P, { className: "h-4 w-4 text-text-secondary" }),
|
|
1064
1094
|
" ",
|
|
1065
|
-
|
|
1095
|
+
y("relationships.detail.sections.renewalTimeline", "Renewal timeline")
|
|
1066
1096
|
]
|
|
1067
1097
|
}),
|
|
1068
|
-
/* @__PURE__ */
|
|
1098
|
+
/* @__PURE__ */ H("p", {
|
|
1069
1099
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
1070
|
-
children:
|
|
1100
|
+
children: y("relationships.detail.sections.renewalTimelineDescription", "Detected renewals and price changes")
|
|
1071
1101
|
}),
|
|
1072
|
-
be.length === 0 ? /* @__PURE__ */
|
|
1102
|
+
be.length === 0 ? /* @__PURE__ */ H("div", {
|
|
1073
1103
|
className: "mt-4",
|
|
1074
|
-
children: /* @__PURE__ */
|
|
1104
|
+
children: /* @__PURE__ */ H(a, {
|
|
1075
1105
|
illustration: "empty-calendar",
|
|
1076
|
-
title:
|
|
1077
|
-
description:
|
|
1106
|
+
title: y("relationships.detail.empty.noRenewalEventsTitle", "No renewal events"),
|
|
1107
|
+
description: y("relationships.detail.empty.noRenewalEventsDescription", "Renewals and price changes will appear here as they're detected.")
|
|
1078
1108
|
})
|
|
1079
|
-
}) : /* @__PURE__ */
|
|
1109
|
+
}) : /* @__PURE__ */ H(f, {
|
|
1080
1110
|
items: be,
|
|
1081
1111
|
className: "mt-4"
|
|
1082
1112
|
})
|
|
@@ -1084,22 +1114,22 @@ function Z() {
|
|
|
1084
1114
|
})]
|
|
1085
1115
|
})]
|
|
1086
1116
|
}),
|
|
1087
|
-
|
|
1088
|
-
relationship:
|
|
1089
|
-
onClose: () =>
|
|
1117
|
+
q && /* @__PURE__ */ H(le, {
|
|
1118
|
+
relationship: $,
|
|
1119
|
+
onClose: () => J(!1)
|
|
1090
1120
|
}),
|
|
1091
|
-
|
|
1092
|
-
relationshipId:
|
|
1093
|
-
onClose: () =>
|
|
1121
|
+
Y && /* @__PURE__ */ H(ue, {
|
|
1122
|
+
relationshipId: $.id,
|
|
1123
|
+
onClose: () => Z(!1)
|
|
1094
1124
|
}),
|
|
1095
|
-
|
|
1096
|
-
relationshipId:
|
|
1097
|
-
onClose: () =>
|
|
1125
|
+
me && /* @__PURE__ */ H(de, {
|
|
1126
|
+
relationshipId: $.id,
|
|
1127
|
+
onClose: () => Q(!1)
|
|
1098
1128
|
})
|
|
1099
1129
|
]
|
|
1100
1130
|
});
|
|
1101
1131
|
}
|
|
1102
1132
|
//#endregion
|
|
1103
|
-
export {
|
|
1133
|
+
export { me as RelationshipDetailPage };
|
|
1104
1134
|
|
|
1105
1135
|
//# sourceMappingURL=RelationshipDetailPage.js.map
|