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