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