@burdenoff/microfe-billing 2026.1114.2 → 2026.1114.4
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/billing/modules/billing/pages/InvoicesListPage.js +131 -120
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +143 -140
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +59 -67
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +282 -277
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/settings/index.js +3 -3
- package/dist/billing/modules/settings/pages/SettingsPage.js +192 -179
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +6 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +77 -78
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +65 -59
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,63 +5,63 @@ import { formatCurrency as r, formatDateTime as i } from "../../../shared/utils/
|
|
|
5
5
|
import { useIsFluidgridsVariant as a } from "../../../hooks/useBillingVariant.js";
|
|
6
6
|
import "../../../shared/utils/index.js";
|
|
7
7
|
import "../../../shared/components/index.js";
|
|
8
|
-
import { canShowRefundRequest as
|
|
9
|
-
import { useCreateRefundRecordMutation as
|
|
10
|
-
import { RefundRecordStatus as
|
|
11
|
-
import { useEffect as
|
|
12
|
-
import { IllustratedEmptyState as
|
|
13
|
-
import { CheckCircle as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import { useI18n as
|
|
8
|
+
import { canShowRefundRequest as ee } from "../../../shared/utils/accessRules.js";
|
|
9
|
+
import { useCreateRefundRecordMutation as o, useGetBillingAccountsCheckoutQuery as te, useGetRefundRecordsQuery as ne, useGetTransactionLazyQuery as re } from "../../../../generated/global-operations.js";
|
|
10
|
+
import { RefundRecordStatus as s } from "../../../../generated/global-types.js";
|
|
11
|
+
import { useEffect as c, useMemo as ie, useRef as ae, useState as l } from "react";
|
|
12
|
+
import { IllustratedEmptyState as oe, PagePurpose as se } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { CheckCircle as u, Clock as d, CreditCard as f, Loader2 as p, PlusCircle as ce, Search as le, X as m, XCircle as h } from "lucide-react";
|
|
14
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
15
|
+
import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
16
16
|
// src/billing/modules/billing/pages/UserRefundsPage.tsx
|
|
17
|
-
var
|
|
18
|
-
[
|
|
17
|
+
var y = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, b = {
|
|
18
|
+
[s.Pending]: {
|
|
19
19
|
label: "In Review",
|
|
20
20
|
className: "bg-status-warning-bg/20 text-status-warning-text border-status-warning-border",
|
|
21
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
21
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(d, { className: e })
|
|
22
22
|
},
|
|
23
|
-
[
|
|
23
|
+
[s.Processing]: {
|
|
24
24
|
label: "Processing",
|
|
25
25
|
className: "bg-action-primary-bg/15 text-action-primary-bg border-action-primary-bg/30",
|
|
26
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
26
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(p, { className: `${e} animate-spin` })
|
|
27
27
|
},
|
|
28
|
-
[
|
|
28
|
+
[s.Completed]: {
|
|
29
29
|
label: "Refunded",
|
|
30
30
|
className: "bg-status-success-bg/20 text-status-success-text border-status-success-border",
|
|
31
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
31
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(u, { className: e })
|
|
32
32
|
},
|
|
33
|
-
[
|
|
33
|
+
[s.Failed]: {
|
|
34
34
|
label: "Failed",
|
|
35
35
|
className: "bg-status-error-bg/20 text-status-error-text border-status-error-border",
|
|
36
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
36
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(h, { className: e })
|
|
37
37
|
},
|
|
38
|
-
[
|
|
38
|
+
[s.Skipped]: {
|
|
39
39
|
label: "Closed",
|
|
40
40
|
className: "bg-bg-sunken text-text-secondary border-border-subtle",
|
|
41
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
41
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(h, { className: e })
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
function
|
|
45
|
-
let t =
|
|
44
|
+
function ue({ status: e }) {
|
|
45
|
+
let t = b[e] ?? {
|
|
46
46
|
label: e,
|
|
47
47
|
className: "bg-bg-sunken text-text-secondary border-border-subtle",
|
|
48
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
48
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(d, { className: e })
|
|
49
49
|
}, n = t.icon;
|
|
50
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ _("span", {
|
|
51
51
|
className: `inline-flex items-center gap-1 px-2 py-0.5 rounded-full border text-xs font-medium ${t.className}`,
|
|
52
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ g(n, { className: "size-3" }), t.label]
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
var
|
|
56
|
-
let { t:
|
|
57
|
-
let n =
|
|
55
|
+
var x = () => {
|
|
56
|
+
let { t: d } = v(), h = (e, t) => {
|
|
57
|
+
let n = d(e);
|
|
58
58
|
return n === e ? t : n;
|
|
59
|
-
},
|
|
60
|
-
|
|
59
|
+
}, b = t(), x = n(), S = a(), C = ee(S, x.canProcessRefund), [w, T] = l(!1), [E, D] = l(""), [O, k] = l(null), [de, A] = l(!1), [j, M] = l(""), [N, P] = l(""), [F, I] = l(null), [L, R] = l(!1), { data: z, loading: B } = te({ fetchPolicy: "cache-and-network" }), V = ie(() => z?.getBillingAccountsByOrg ?? [], [z]), [H, U] = l(void 0);
|
|
60
|
+
c(() => {
|
|
61
61
|
!H && V.length > 0 && U(V[0].id);
|
|
62
62
|
}, [V, H]);
|
|
63
|
-
let W = V.find((e) => e.id === H), [
|
|
64
|
-
|
|
63
|
+
let W = V.find((e) => e.id === H), [fe, { data: G, loading: K, error: q }] = re({ fetchPolicy: "network-only" }), pe = ae("");
|
|
64
|
+
c(() => {
|
|
65
65
|
if (K) return;
|
|
66
66
|
let e = G?.getTransaction;
|
|
67
67
|
e ? (k(e), A(!1), P(String(e.amount))) : (G !== void 0 || q) && (k(null), A(!0), P(""));
|
|
@@ -72,15 +72,15 @@ var S = () => {
|
|
|
72
72
|
]);
|
|
73
73
|
let J = (e, t) => {
|
|
74
74
|
let n = `${e}::${t}`;
|
|
75
|
-
|
|
75
|
+
pe.current = n, k(null), A(!1), P(""), fe({ variables: {
|
|
76
76
|
id: e,
|
|
77
77
|
billingAccountId: t
|
|
78
78
|
} });
|
|
79
|
-
}, pe = (e) => {
|
|
80
|
-
D(e), k(null), A(!1), P(""), b.test(e.trim()) && H && J(e.trim(), H);
|
|
81
79
|
}, me = (e) => {
|
|
82
|
-
|
|
83
|
-
},
|
|
80
|
+
D(e), k(null), A(!1), P(""), y.test(e.trim()) && H && J(e.trim(), H);
|
|
81
|
+
}, he = (e) => {
|
|
82
|
+
U(e), k(null), A(!1), P(""), y.test(E.trim()) && J(E.trim(), e);
|
|
83
|
+
}, { data: Y, loading: ge, refetch: _e } = ne({
|
|
84
84
|
variables: {
|
|
85
85
|
billingAccountId: H,
|
|
86
86
|
pageSize: 20,
|
|
@@ -88,18 +88,18 @@ var S = () => {
|
|
|
88
88
|
},
|
|
89
89
|
skip: !H,
|
|
90
90
|
fetchPolicy: "cache-and-network"
|
|
91
|
-
}), X = Y?.getRefundRecords.records ?? [], [
|
|
91
|
+
}), X = Y?.getRefundRecords.records ?? [], [ve, { loading: Z }] = o({ refetchQueries: ["GetRefundRecords"] }), ye = (e) => e ? e.stripePaymentId ? {
|
|
92
92
|
provider: "STRIPE",
|
|
93
93
|
gatewayPaymentId: e.stripePaymentId
|
|
94
94
|
} : e.razorpayPaymentId ? {
|
|
95
95
|
provider: "RAZORPAY",
|
|
96
96
|
gatewayPaymentId: e.razorpayPaymentId
|
|
97
|
-
} : null : null,
|
|
97
|
+
} : null : null, be = async (e) => {
|
|
98
98
|
if (e.preventDefault(), I(null), !O || !j.trim() || !N) {
|
|
99
99
|
I("Enter a valid transaction ID, an amount, and a reason.");
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
let t =
|
|
102
|
+
let t = ye(O);
|
|
103
103
|
if (!t) {
|
|
104
104
|
I("No payment gateway info found for this transaction. Please contact support.");
|
|
105
105
|
return;
|
|
@@ -108,7 +108,7 @@ var S = () => {
|
|
|
108
108
|
if (isNaN(n) || n <= 0) I("Please enter a valid amount greater than 0.");
|
|
109
109
|
else if (n > O.amount) I(`Cannot exceed the original payment amount (${r(O.amount, O.currency)}).`);
|
|
110
110
|
else try {
|
|
111
|
-
await
|
|
111
|
+
await ve({ variables: {
|
|
112
112
|
billingAccountId: H,
|
|
113
113
|
provider: t.provider,
|
|
114
114
|
gatewayPaymentId: t.gatewayPaymentId,
|
|
@@ -117,7 +117,7 @@ var S = () => {
|
|
|
117
117
|
transactionId: O.id,
|
|
118
118
|
reason: j.trim(),
|
|
119
119
|
notes: "Requested by user via billing portal"
|
|
120
|
-
} }), R(!0), T(!1), Q(), await
|
|
120
|
+
} }), R(!0), T(!1), Q(), await _e();
|
|
121
121
|
} catch (e) {
|
|
122
122
|
I(e instanceof Error ? e.message : "Failed to submit refund request.");
|
|
123
123
|
}
|
|
@@ -126,37 +126,37 @@ var S = () => {
|
|
|
126
126
|
}, $ = () => {
|
|
127
127
|
T(!1), R(!1), Q();
|
|
128
128
|
};
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
className: "space-y-6 p-6 max-w-3xl",
|
|
129
|
+
return /* @__PURE__ */ _("div", {
|
|
130
|
+
className: S ? "space-y-6 px-4 py-6 sm:px-6 lg:px-8" : "space-y-6 p-6 max-w-3xl",
|
|
131
131
|
children: [
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
title:
|
|
134
|
-
description:
|
|
135
|
-
actions: !w && C ? /* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ g(e, {
|
|
133
|
+
title: h("billing.refunds.title", "Refunds"),
|
|
134
|
+
description: h("billing.refunds.description", "View your refund requests and submit new ones"),
|
|
135
|
+
actions: !w && C ? /* @__PURE__ */ _("button", {
|
|
136
136
|
type: "button",
|
|
137
137
|
onClick: () => {
|
|
138
138
|
T(!0), R(!1);
|
|
139
139
|
},
|
|
140
140
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
|
|
141
|
-
children: [/* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ g(ce, { className: "size-4" }), h("billing.refunds.requestRefund", "Request Refund")]
|
|
142
142
|
}) : void 0
|
|
143
143
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
!B && V.length > 1 && /* @__PURE__ */
|
|
146
|
-
className: "flex items-center gap-3",
|
|
144
|
+
/* @__PURE__ */ g(se, { children: h("billing.refunds.userPurpose", "Request money back for a payment and follow where each request stands. Paste the transaction ID of the charge you want refunded, tell us how much and why, and track every request here from \"In Review\" through to \"Refunded\".") }),
|
|
145
|
+
!B && V.length > 1 && /* @__PURE__ */ _("div", {
|
|
146
|
+
className: S ? "flex flex-wrap items-center gap-x-3 gap-y-2" : "flex items-center gap-3",
|
|
147
147
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ g(f, { className: "size-4 text-text-secondary shrink-0" }),
|
|
149
|
+
/* @__PURE__ */ g("label", {
|
|
150
150
|
htmlFor: "accountSwitch",
|
|
151
151
|
className: "text-sm text-text-secondary shrink-0",
|
|
152
|
-
children:
|
|
152
|
+
children: h("billing.refunds.account", "Billing account")
|
|
153
153
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ g("select", {
|
|
155
155
|
id: "accountSwitch",
|
|
156
156
|
value: H ?? "",
|
|
157
|
-
onChange: (e) =>
|
|
158
|
-
className: "flex-1 px-3 py-1.5 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary
|
|
159
|
-
children: V.map((e) => /* @__PURE__ */
|
|
157
|
+
onChange: (e) => he(e.target.value),
|
|
158
|
+
className: `${S ? "min-w-0 basis-full truncate sm:basis-auto sm:max-w-lg " : ""}flex-1 px-3 py-1.5 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary`,
|
|
159
|
+
children: V.map((e) => /* @__PURE__ */ _("option", {
|
|
160
160
|
value: e.id,
|
|
161
161
|
children: [
|
|
162
162
|
e.name,
|
|
@@ -169,114 +169,114 @@ var S = () => {
|
|
|
169
169
|
})
|
|
170
170
|
]
|
|
171
171
|
}),
|
|
172
|
-
L && /* @__PURE__ */
|
|
172
|
+
L && /* @__PURE__ */ _("div", {
|
|
173
173
|
className: "flex items-center justify-between p-4 rounded-lg border border-status-success-border bg-status-success-bg/10",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ _("div", {
|
|
175
175
|
className: "flex items-center gap-2",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ g(u, { className: "size-4 text-status-success-text" }), /* @__PURE__ */ g("p", {
|
|
177
177
|
className: "text-sm text-status-success-text font-medium",
|
|
178
|
-
children:
|
|
178
|
+
children: h("billing.refunds.submitted", "Refund request submitted. Our team will review it shortly.")
|
|
179
179
|
})]
|
|
180
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ g("button", {
|
|
181
181
|
type: "button",
|
|
182
182
|
onClick: () => R(!1),
|
|
183
183
|
className: "text-status-success-text hover:opacity-70",
|
|
184
|
-
children: /* @__PURE__ */
|
|
184
|
+
children: /* @__PURE__ */ g(m, { className: "size-4" })
|
|
185
185
|
})]
|
|
186
186
|
}),
|
|
187
|
-
w && /* @__PURE__ */
|
|
187
|
+
w && /* @__PURE__ */ _("div", {
|
|
188
188
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ _("div", {
|
|
190
190
|
className: "flex items-center justify-between p-4 border-b border-border-subtle bg-bg-sunken",
|
|
191
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ g("h2", {
|
|
192
192
|
className: "font-semibold text-text-primary",
|
|
193
|
-
children:
|
|
194
|
-
}), /* @__PURE__ */
|
|
193
|
+
children: h("billing.refunds.newRequest", "New Refund Request")
|
|
194
|
+
}), /* @__PURE__ */ g("button", {
|
|
195
195
|
type: "button",
|
|
196
196
|
onClick: $,
|
|
197
197
|
className: "p-1 rounded hover:bg-bg-sunken transition-colors",
|
|
198
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ g(m, { className: "size-4 text-text-secondary" })
|
|
199
199
|
})]
|
|
200
|
-
}), /* @__PURE__ */
|
|
201
|
-
onSubmit:
|
|
200
|
+
}), /* @__PURE__ */ _("form", {
|
|
201
|
+
onSubmit: be,
|
|
202
202
|
className: "p-4 space-y-4",
|
|
203
203
|
children: [
|
|
204
|
-
F && /* @__PURE__ */
|
|
204
|
+
F && /* @__PURE__ */ g("div", {
|
|
205
205
|
className: "p-3 rounded-lg border border-status-error-border bg-status-error-bg/10",
|
|
206
|
-
children: /* @__PURE__ */
|
|
206
|
+
children: /* @__PURE__ */ g("p", {
|
|
207
207
|
className: "text-sm text-status-error-text",
|
|
208
208
|
children: F
|
|
209
209
|
})
|
|
210
210
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ _("div", { children: [
|
|
212
|
+
/* @__PURE__ */ _("label", {
|
|
213
213
|
htmlFor: "txnId",
|
|
214
214
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
215
|
-
children: [
|
|
215
|
+
children: [h("billing.refunds.transactionId", "Transaction ID"), " *"]
|
|
216
216
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ _("div", {
|
|
218
218
|
className: "relative",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ g("input", {
|
|
220
220
|
id: "txnId",
|
|
221
221
|
type: "text",
|
|
222
222
|
value: E,
|
|
223
|
-
onChange: (e) =>
|
|
223
|
+
onChange: (e) => me(e.target.value),
|
|
224
224
|
placeholder: "Paste your transaction ID...",
|
|
225
225
|
className: "w-full pl-3 pr-9 py-2 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm font-mono"
|
|
226
|
-
}), /* @__PURE__ */
|
|
226
|
+
}), /* @__PURE__ */ g("div", {
|
|
227
227
|
className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary",
|
|
228
|
-
children: K ? /* @__PURE__ */
|
|
228
|
+
children: K ? /* @__PURE__ */ g(p, { className: "size-4 animate-spin" }) : /* @__PURE__ */ g(le, { className: "size-4" })
|
|
229
229
|
})]
|
|
230
230
|
}),
|
|
231
|
-
O && /* @__PURE__ */
|
|
231
|
+
O && /* @__PURE__ */ _("div", {
|
|
232
232
|
className: "mt-2 p-3 rounded-button border border-status-success-border bg-status-success-bg/10 text-sm space-y-0.5",
|
|
233
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ _("div", {
|
|
234
234
|
className: "flex items-center gap-2",
|
|
235
235
|
children: [
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ g(u, { className: "size-3.5 text-status-success-text shrink-0" }),
|
|
237
|
+
/* @__PURE__ */ g("span", {
|
|
238
238
|
className: "font-medium text-text-primary",
|
|
239
239
|
children: r(O.amount, O.currency)
|
|
240
240
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ g("span", {
|
|
242
242
|
className: "text-text-secondary",
|
|
243
243
|
children: "·"
|
|
244
244
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ g("span", {
|
|
246
246
|
className: "text-text-secondary",
|
|
247
247
|
children: i(O.createdAt)
|
|
248
248
|
}),
|
|
249
|
-
O.stripePaymentId && /* @__PURE__ */
|
|
249
|
+
O.stripePaymentId && /* @__PURE__ */ g("span", {
|
|
250
250
|
className: "text-xs text-text-secondary",
|
|
251
251
|
children: "Stripe"
|
|
252
252
|
}),
|
|
253
|
-
O.razorpayPaymentId && /* @__PURE__ */
|
|
253
|
+
O.razorpayPaymentId && /* @__PURE__ */ g("span", {
|
|
254
254
|
className: "text-xs text-text-secondary",
|
|
255
255
|
children: "Razorpay"
|
|
256
256
|
})
|
|
257
257
|
]
|
|
258
|
-
}), O.description && /* @__PURE__ */
|
|
258
|
+
}), O.description && /* @__PURE__ */ g("p", {
|
|
259
259
|
className: "text-xs text-text-secondary pl-5",
|
|
260
260
|
children: O.description
|
|
261
261
|
})]
|
|
262
262
|
}),
|
|
263
|
-
|
|
263
|
+
de && E.length > 0 && !K && /* @__PURE__ */ g("p", {
|
|
264
264
|
className: "mt-1 text-xs text-status-error-text",
|
|
265
|
-
children:
|
|
265
|
+
children: h("billing.refunds.txnNotFound", "Transaction not found in this billing account.")
|
|
266
266
|
}),
|
|
267
|
-
!
|
|
267
|
+
!y.test(E.trim()) && E.length > 4 && /* @__PURE__ */ g("p", {
|
|
268
268
|
className: "mt-1 text-xs text-text-secondary",
|
|
269
|
-
children:
|
|
269
|
+
children: h("billing.refunds.txnIdHint", "Transaction IDs look like: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
|
|
270
270
|
})
|
|
271
271
|
] }),
|
|
272
|
-
O && /* @__PURE__ */
|
|
272
|
+
O && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
273
273
|
htmlFor: "refundAmount",
|
|
274
274
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
275
|
-
children: [
|
|
276
|
-
}), /* @__PURE__ */
|
|
275
|
+
children: [h("billing.refunds.amount", "Refund Amount"), " *"]
|
|
276
|
+
}), /* @__PURE__ */ _("div", {
|
|
277
277
|
className: "flex items-center gap-2",
|
|
278
278
|
children: [
|
|
279
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ g("input", {
|
|
280
280
|
id: "refundAmount",
|
|
281
281
|
type: "number",
|
|
282
282
|
step: "0.01",
|
|
@@ -288,97 +288,100 @@ var S = () => {
|
|
|
288
288
|
className: "w-40 px-3 py-2 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm",
|
|
289
289
|
placeholder: "0.00"
|
|
290
290
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ g("span", {
|
|
292
292
|
className: "text-sm text-text-secondary",
|
|
293
293
|
children: O.currency ?? W?.currency ?? "USD"
|
|
294
294
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ _("span", {
|
|
296
296
|
className: "text-xs text-text-secondary",
|
|
297
297
|
children: ["max ", r(O.amount, O.currency)]
|
|
298
298
|
})
|
|
299
299
|
]
|
|
300
300
|
})] }),
|
|
301
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
302
302
|
htmlFor: "reason",
|
|
303
303
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
304
|
-
children: [
|
|
305
|
-
}), /* @__PURE__ */
|
|
304
|
+
children: [h("billing.refunds.reason", "Reason for refund"), " *"]
|
|
305
|
+
}), /* @__PURE__ */ g("textarea", {
|
|
306
306
|
id: "reason",
|
|
307
307
|
value: j,
|
|
308
308
|
onChange: (e) => M(e.target.value),
|
|
309
309
|
required: !0,
|
|
310
310
|
rows: 3,
|
|
311
311
|
className: "w-full px-3 py-2 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm resize-none",
|
|
312
|
-
placeholder:
|
|
312
|
+
placeholder: h("billing.refunds.reasonPlaceholder", "Describe why you are requesting a refund...")
|
|
313
313
|
})] }),
|
|
314
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ _("div", {
|
|
315
315
|
className: "flex items-center gap-3 pt-1",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ g("button", {
|
|
317
317
|
type: "submit",
|
|
318
318
|
disabled: Z || !O || !j.trim() || !N,
|
|
319
319
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
320
|
-
children: Z ?
|
|
321
|
-
}), /* @__PURE__ */
|
|
320
|
+
children: Z ? h("billing.refunds.submitting", "Submitting...") : h("billing.refunds.submitRequest", "Submit Request")
|
|
321
|
+
}), /* @__PURE__ */ g("button", {
|
|
322
322
|
type: "button",
|
|
323
323
|
onClick: $,
|
|
324
324
|
className: "px-4 py-2 text-sm border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
325
|
-
children:
|
|
325
|
+
children: h("billing.common.cancel", "Cancel")
|
|
326
326
|
})]
|
|
327
327
|
})
|
|
328
328
|
]
|
|
329
329
|
})]
|
|
330
330
|
}),
|
|
331
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ _("div", {
|
|
332
332
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
|
|
333
|
-
children: [/* @__PURE__ */
|
|
333
|
+
children: [/* @__PURE__ */ g("div", {
|
|
334
334
|
className: "p-4 border-b border-border-subtle bg-bg-sunken",
|
|
335
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ g("h2", {
|
|
336
336
|
className: "font-semibold text-text-primary",
|
|
337
|
-
children:
|
|
337
|
+
children: h("billing.refunds.history", "Refund History")
|
|
338
338
|
})
|
|
339
|
-
}), B ||
|
|
339
|
+
}), B || ge ? /* @__PURE__ */ g("div", {
|
|
340
340
|
className: "p-8 flex items-center justify-center",
|
|
341
|
-
children: /* @__PURE__ */
|
|
342
|
-
}) : X.length === 0 ? /* @__PURE__ */
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
341
|
+
children: /* @__PURE__ */ g(p, { className: "size-5 animate-spin text-text-secondary" })
|
|
342
|
+
}) : X.length === 0 ? /* @__PURE__ */ g("div", {
|
|
343
|
+
className: S ? "flex justify-center px-4 py-10 text-center" : void 0,
|
|
344
|
+
children: /* @__PURE__ */ g(oe, {
|
|
345
|
+
illustration: "empty-data",
|
|
346
|
+
title: h("billing.refunds.noRefunds", "No refund requests yet"),
|
|
347
|
+
description: h("billing.refunds.noRefundsHint", "If you have an issue with a payment, click \"Request Refund\" to get started.")
|
|
348
|
+
})
|
|
349
|
+
}) : /* @__PURE__ */ g("ul", {
|
|
347
350
|
className: "divide-y divide-border-subtle",
|
|
348
|
-
children: X.map((e) => /* @__PURE__ */
|
|
349
|
-
className:
|
|
350
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: X.map((e) => /* @__PURE__ */ _("li", {
|
|
352
|
+
className: `flex gap-4 p-4 hover:bg-bg-sunken transition-colors ${S ? "flex-col gap-2 sm:flex-row sm:items-start sm:gap-4" : "items-start"}`,
|
|
353
|
+
children: [/* @__PURE__ */ _("div", {
|
|
351
354
|
className: "flex-1 min-w-0",
|
|
352
355
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ _("div", {
|
|
354
357
|
className: "flex items-center gap-2 flex-wrap",
|
|
355
358
|
children: [
|
|
356
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ g("span", {
|
|
357
360
|
className: "text-sm font-medium text-text-primary",
|
|
358
361
|
children: r(e.amount, e.currency)
|
|
359
362
|
}),
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
e.purchaseDetail && /* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ g(ue, { status: e.status }),
|
|
364
|
+
e.purchaseDetail && /* @__PURE__ */ g("span", {
|
|
362
365
|
className: "text-xs text-text-secondary truncate",
|
|
363
366
|
children: e.purchaseDetail
|
|
364
367
|
})
|
|
365
368
|
]
|
|
366
369
|
}),
|
|
367
|
-
e.reason && /* @__PURE__ */
|
|
370
|
+
e.reason && /* @__PURE__ */ g("p", {
|
|
368
371
|
className: "text-xs text-text-secondary mt-1 line-clamp-2",
|
|
369
372
|
children: e.reason
|
|
370
373
|
}),
|
|
371
|
-
e.errorMessage && e.status ===
|
|
374
|
+
e.errorMessage && e.status === s.Failed && /* @__PURE__ */ g("p", {
|
|
372
375
|
className: "text-xs text-status-error-text mt-1",
|
|
373
376
|
children: e.errorMessage
|
|
374
377
|
})
|
|
375
378
|
]
|
|
376
|
-
}), /* @__PURE__ */
|
|
377
|
-
className: "text-right shrink-0",
|
|
378
|
-
children: [/* @__PURE__ */
|
|
379
|
+
}), /* @__PURE__ */ _("div", {
|
|
380
|
+
className: S ? "shrink-0 sm:text-right" : "text-right shrink-0",
|
|
381
|
+
children: [/* @__PURE__ */ g("p", {
|
|
379
382
|
className: "text-xs text-text-secondary",
|
|
380
383
|
children: i(e.createdAt)
|
|
381
|
-
}), e.processedAt && /* @__PURE__ */
|
|
384
|
+
}), e.processedAt && /* @__PURE__ */ _("p", {
|
|
382
385
|
className: "text-xs text-text-secondary mt-0.5",
|
|
383
386
|
children: ["Processed ", i(e.processedAt)]
|
|
384
387
|
})]
|
|
@@ -386,22 +389,22 @@ var S = () => {
|
|
|
386
389
|
}, e.id))
|
|
387
390
|
})]
|
|
388
391
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ _("p", {
|
|
390
393
|
className: "text-xs text-text-secondary",
|
|
391
394
|
children: [
|
|
392
|
-
|
|
395
|
+
h("billing.refunds.footer", "Refund requests are reviewed by our team within 3–5 business days. For urgent issues, contact support."),
|
|
393
396
|
" ",
|
|
394
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ g("button", {
|
|
395
398
|
type: "button",
|
|
396
|
-
onClick: () =>
|
|
399
|
+
onClick: () => b("/transactions/" + H),
|
|
397
400
|
className: "underline hover:no-underline",
|
|
398
|
-
children:
|
|
401
|
+
children: h("billing.refunds.viewTransactions", "View all transactions")
|
|
399
402
|
})
|
|
400
403
|
]
|
|
401
404
|
})
|
|
402
405
|
]
|
|
403
406
|
});
|
|
404
407
|
};
|
|
405
|
-
export {
|
|
408
|
+
export { x as UserRefundsPage };
|
|
406
409
|
|
|
407
410
|
//# sourceMappingURL=UserRefundsPage.js.map
|