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