@burdenoff/microfe-billing 2026.1113.4 → 2026.1114.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +293 -291
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +25 -24
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +25 -24
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/billing/hooks/index.js +5 -5
- package/dist/billing/modules/billing/hooks/useInvoices.js +20 -39
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/index.js +14 -14
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +92 -89
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +2 -2
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +140 -140
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +16 -15
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +164 -137
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +444 -594
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +20 -20
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +32 -32
- package/dist/billing/modules/settings/pages/SettingsPage.js +4 -4
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +577 -640
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/shared/components/HeaderActions.d.ts +10 -0
- package/dist/billing/shared/components/HeaderActions.js +33 -0
- package/dist/billing/shared/components/HeaderActions.js.map +1 -0
- package/dist/billing/shared/components/index.d.ts +1 -0
- package/dist/billing/shared/components/index.js +2 -1
- package/dist/billing/shared/utils/format.js +4 -16
- package/dist/billing/shared/utils/format.js.map +1 -1
- package/dist/billing/shared/utils/index.js +8 -8
- package/dist/generated/global-operations.js +286 -294
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +1 -1
- package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +0 -46
- package/dist/billing/modules/dashboard/utils/overviewSummary.js +0 -37
- package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +0 -1
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +0 -30
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +0 -20
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +0 -1
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
import { PageHeader as e } from "../../../shared/components/PageHeader.js";
|
|
2
2
|
import { useBillingNavigate as t } from "../../../hooks/useBillingNavigate.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useIsFluidgridsVariant as
|
|
3
|
+
import { useBillingPermissions as n } from "../../../hooks/useBillingPermissions.js";
|
|
4
|
+
import { formatCurrency as r, formatDateTime as i } from "../../../shared/utils/format.js";
|
|
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 o } from "../../../shared/utils/accessRules.js";
|
|
9
|
+
import { useCreateRefundRecordMutation as ee, useGetBillingAccountsCheckoutQuery as te, useGetRefundRecordsQuery as ne, useGetTransactionLazyQuery as s } from "../../../../generated/global-operations.js";
|
|
10
|
+
import { RefundRecordStatus as c } from "../../../../generated/global-types.js";
|
|
11
|
+
import { useEffect as l, useMemo as re, useRef as u, useState as d } from "react";
|
|
12
|
+
import { IllustratedEmptyState as ie, PagePurpose as ae } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { CheckCircle as f, Clock as p, CreditCard as oe, Loader2 as m, PlusCircle as se, Search as h, X as g, XCircle as _ } from "lucide-react";
|
|
14
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
15
|
+
import { useI18n as ce } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
16
16
|
// src/billing/modules/billing/pages/UserRefundsPage.tsx
|
|
17
|
-
var
|
|
18
|
-
[
|
|
17
|
+
var b = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, x = {
|
|
18
|
+
[c.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__ */ v(p, { className: e })
|
|
22
22
|
},
|
|
23
|
-
[
|
|
23
|
+
[c.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__ */ v(m, { className: `${e} animate-spin` })
|
|
27
27
|
},
|
|
28
|
-
[
|
|
28
|
+
[c.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__ */ v(f, { className: e })
|
|
32
32
|
},
|
|
33
|
-
[
|
|
33
|
+
[c.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__ */ v(_, { className: e })
|
|
37
37
|
},
|
|
38
|
-
[
|
|
38
|
+
[c.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__ */ v(_, { className: e })
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
function
|
|
45
|
-
let t =
|
|
44
|
+
function le({ status: e }) {
|
|
45
|
+
let t = x[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__ */ v(p, { className: e })
|
|
49
49
|
}, n = t.icon;
|
|
50
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ y("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__ */ v(n, { className: "size-3" }), t.label]
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
var S = () => {
|
|
56
|
-
let { t:
|
|
57
|
-
let n =
|
|
56
|
+
let { t: p } = ce(), _ = (e, t) => {
|
|
57
|
+
let n = p(e);
|
|
58
58
|
return n === e ? t : n;
|
|
59
|
-
},
|
|
60
|
-
|
|
59
|
+
}, x = t(), S = n(), C = o(a(), S.canProcessRefund), [w, T] = d(!1), [E, D] = d(""), [O, k] = d(null), [ue, A] = d(!1), [j, M] = d(""), [N, P] = d(""), [F, I] = d(null), [L, R] = d(!1), { data: z, loading: B } = te({ fetchPolicy: "cache-and-network" }), V = re(() => z?.getBillingAccountsByOrg ?? [], [z]), [H, U] = d(void 0);
|
|
60
|
+
l(() => {
|
|
61
61
|
!H && V.length > 0 && U(V[0].id);
|
|
62
62
|
}, [V, H]);
|
|
63
|
-
let W = V.find((e) => e.id === H), [de, { data: G, loading: K, error: q }] =
|
|
64
|
-
|
|
63
|
+
let W = V.find((e) => e.id === H), [de, { data: G, loading: K, error: q }] = s({ fetchPolicy: "network-only" }), fe = u("");
|
|
64
|
+
l(() => {
|
|
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(""));
|
|
@@ -77,10 +77,10 @@ var S = () => {
|
|
|
77
77
|
billingAccountId: t
|
|
78
78
|
} });
|
|
79
79
|
}, pe = (e) => {
|
|
80
|
-
D(e), k(null), A(!1), P(""),
|
|
80
|
+
D(e), k(null), A(!1), P(""), b.test(e.trim()) && H && J(e.trim(), H);
|
|
81
81
|
}, me = (e) => {
|
|
82
|
-
U(e), k(null), A(!1), P(""),
|
|
83
|
-
}, { data:
|
|
82
|
+
U(e), k(null), A(!1), P(""), b.test(E.trim()) && J(E.trim(), e);
|
|
83
|
+
}, { data: Y, loading: he, refetch: ge } = ne({
|
|
84
84
|
variables: {
|
|
85
85
|
billingAccountId: H,
|
|
86
86
|
pageSize: 20,
|
|
@@ -88,7 +88,7 @@ var S = () => {
|
|
|
88
88
|
},
|
|
89
89
|
skip: !H,
|
|
90
90
|
fetchPolicy: "cache-and-network"
|
|
91
|
-
}),
|
|
91
|
+
}), X = Y?.getRefundRecords.records ?? [], [_e, { loading: Z }] = ee({ refetchQueries: ["GetRefundRecords"] }), ve = (e) => e ? e.stripePaymentId ? {
|
|
92
92
|
provider: "STRIPE",
|
|
93
93
|
gatewayPaymentId: e.stripePaymentId
|
|
94
94
|
} : e.razorpayPaymentId ? {
|
|
@@ -99,25 +99,25 @@ var S = () => {
|
|
|
99
99
|
I("Enter a valid transaction ID, an amount, and a reason.");
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
let t =
|
|
102
|
+
let t = ve(O);
|
|
103
103
|
if (!t) {
|
|
104
104
|
I("No payment gateway info found for this transaction. Please contact support.");
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
let
|
|
108
|
-
if (isNaN(
|
|
109
|
-
else if (
|
|
107
|
+
let n = parseFloat(N);
|
|
108
|
+
if (isNaN(n) || n <= 0) I("Please enter a valid amount greater than 0.");
|
|
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 _e({ variables: {
|
|
112
112
|
billingAccountId: H,
|
|
113
113
|
provider: t.provider,
|
|
114
114
|
gatewayPaymentId: t.gatewayPaymentId,
|
|
115
|
-
amount:
|
|
115
|
+
amount: n,
|
|
116
116
|
currency: O.currency ?? W?.currency ?? "USD",
|
|
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 ge();
|
|
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__ */
|
|
129
|
+
return /* @__PURE__ */ y("div", {
|
|
130
130
|
className: "space-y-6 p-6 max-w-3xl",
|
|
131
131
|
children: [
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
title:
|
|
134
|
-
description:
|
|
135
|
-
actions: !w && C ? /* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ v(e, {
|
|
133
|
+
title: _("billing.refunds.title", "Refunds"),
|
|
134
|
+
description: _("billing.refunds.description", "View your refund requests and submit new ones"),
|
|
135
|
+
actions: !w && C ? /* @__PURE__ */ y("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__ */ v(se, { className: "size-4" }), _("billing.refunds.requestRefund", "Request Refund")]
|
|
142
142
|
}) : void 0
|
|
143
143
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
!B && V.length > 1 && /* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ v(ae, { children: _("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__ */ y("div", {
|
|
146
146
|
className: "flex items-center gap-3",
|
|
147
147
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ v(oe, { className: "size-4 text-text-secondary shrink-0" }),
|
|
149
|
+
/* @__PURE__ */ v("label", {
|
|
150
150
|
htmlFor: "accountSwitch",
|
|
151
151
|
className: "text-sm text-text-secondary shrink-0",
|
|
152
|
-
children:
|
|
152
|
+
children: _("billing.refunds.account", "Billing account")
|
|
153
153
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ v("select", {
|
|
155
155
|
id: "accountSwitch",
|
|
156
156
|
value: H ?? "",
|
|
157
157
|
onChange: (e) => me(e.target.value),
|
|
158
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__ */
|
|
159
|
+
children: V.map((e) => /* @__PURE__ */ y("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__ */ y("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__ */ y("div", {
|
|
175
175
|
className: "flex items-center gap-2",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ v(f, { className: "size-4 text-status-success-text" }), /* @__PURE__ */ v("p", {
|
|
177
177
|
className: "text-sm text-status-success-text font-medium",
|
|
178
|
-
children:
|
|
178
|
+
children: _("billing.refunds.submitted", "Refund request submitted. Our team will review it shortly.")
|
|
179
179
|
})]
|
|
180
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ v("button", {
|
|
181
181
|
type: "button",
|
|
182
182
|
onClick: () => R(!1),
|
|
183
183
|
className: "text-status-success-text hover:opacity-70",
|
|
184
|
-
children: /* @__PURE__ */ g
|
|
184
|
+
children: /* @__PURE__ */ v(g, { className: "size-4" })
|
|
185
185
|
})]
|
|
186
186
|
}),
|
|
187
|
-
w && /* @__PURE__ */
|
|
187
|
+
w && /* @__PURE__ */ y("div", {
|
|
188
188
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ y("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__ */ v("h2", {
|
|
192
192
|
className: "font-semibold text-text-primary",
|
|
193
|
-
children:
|
|
194
|
-
}), /* @__PURE__ */
|
|
193
|
+
children: _("billing.refunds.newRequest", "New Refund Request")
|
|
194
|
+
}), /* @__PURE__ */ v("button", {
|
|
195
195
|
type: "button",
|
|
196
196
|
onClick: $,
|
|
197
197
|
className: "p-1 rounded hover:bg-bg-sunken transition-colors",
|
|
198
|
-
children: /* @__PURE__ */ g
|
|
198
|
+
children: /* @__PURE__ */ v(g, { className: "size-4 text-text-secondary" })
|
|
199
199
|
})]
|
|
200
|
-
}), /* @__PURE__ */
|
|
200
|
+
}), /* @__PURE__ */ y("form", {
|
|
201
201
|
onSubmit: ye,
|
|
202
202
|
className: "p-4 space-y-4",
|
|
203
203
|
children: [
|
|
204
|
-
F && /* @__PURE__ */
|
|
204
|
+
F && /* @__PURE__ */ v("div", {
|
|
205
205
|
className: "p-3 rounded-lg border border-status-error-border bg-status-error-bg/10",
|
|
206
|
-
children: /* @__PURE__ */
|
|
206
|
+
children: /* @__PURE__ */ v("p", {
|
|
207
207
|
className: "text-sm text-status-error-text",
|
|
208
208
|
children: F
|
|
209
209
|
})
|
|
210
210
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ y("div", { children: [
|
|
212
|
+
/* @__PURE__ */ y("label", {
|
|
213
213
|
htmlFor: "txnId",
|
|
214
214
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
215
|
-
children: [
|
|
215
|
+
children: [_("billing.refunds.transactionId", "Transaction ID"), " *"]
|
|
216
216
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ y("div", {
|
|
218
218
|
className: "relative",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ v("input", {
|
|
220
220
|
id: "txnId",
|
|
221
221
|
type: "text",
|
|
222
222
|
value: E,
|
|
223
223
|
onChange: (e) => pe(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__ */ v("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__ */ v(m, { className: "size-4 animate-spin" }) : /* @__PURE__ */ v(h, { className: "size-4" })
|
|
229
229
|
})]
|
|
230
230
|
}),
|
|
231
|
-
O && /* @__PURE__ */
|
|
231
|
+
O && /* @__PURE__ */ y("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__ */ y("div", {
|
|
234
234
|
className: "flex items-center gap-2",
|
|
235
235
|
children: [
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ v(f, { className: "size-3.5 text-status-success-text shrink-0" }),
|
|
237
|
+
/* @__PURE__ */ v("span", {
|
|
238
238
|
className: "font-medium text-text-primary",
|
|
239
|
-
children:
|
|
239
|
+
children: r(O.amount, O.currency)
|
|
240
240
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ v("span", {
|
|
242
242
|
className: "text-text-secondary",
|
|
243
243
|
children: "·"
|
|
244
244
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ v("span", {
|
|
246
246
|
className: "text-text-secondary",
|
|
247
|
-
children:
|
|
247
|
+
children: i(O.createdAt)
|
|
248
248
|
}),
|
|
249
|
-
O.stripePaymentId && /* @__PURE__ */
|
|
249
|
+
O.stripePaymentId && /* @__PURE__ */ v("span", {
|
|
250
250
|
className: "text-xs text-text-secondary",
|
|
251
251
|
children: "Stripe"
|
|
252
252
|
}),
|
|
253
|
-
O.razorpayPaymentId && /* @__PURE__ */
|
|
253
|
+
O.razorpayPaymentId && /* @__PURE__ */ v("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__ */ v("p", {
|
|
259
259
|
className: "text-xs text-text-secondary pl-5",
|
|
260
260
|
children: O.description
|
|
261
261
|
})]
|
|
262
262
|
}),
|
|
263
|
-
ue && E.length > 0 && !K && /* @__PURE__ */
|
|
263
|
+
ue && E.length > 0 && !K && /* @__PURE__ */ v("p", {
|
|
264
264
|
className: "mt-1 text-xs text-status-error-text",
|
|
265
|
-
children:
|
|
265
|
+
children: _("billing.refunds.txnNotFound", "Transaction not found in this billing account.")
|
|
266
266
|
}),
|
|
267
|
-
!
|
|
267
|
+
!b.test(E.trim()) && E.length > 4 && /* @__PURE__ */ v("p", {
|
|
268
268
|
className: "mt-1 text-xs text-text-secondary",
|
|
269
|
-
children:
|
|
269
|
+
children: _("billing.refunds.txnIdHint", "Transaction IDs look like: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
|
|
270
270
|
})
|
|
271
271
|
] }),
|
|
272
|
-
O && /* @__PURE__ */
|
|
272
|
+
O && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
273
273
|
htmlFor: "refundAmount",
|
|
274
274
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
275
|
-
children: [
|
|
276
|
-
}), /* @__PURE__ */
|
|
275
|
+
children: [_("billing.refunds.amount", "Refund Amount"), " *"]
|
|
276
|
+
}), /* @__PURE__ */ y("div", {
|
|
277
277
|
className: "flex items-center gap-2",
|
|
278
278
|
children: [
|
|
279
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ v("input", {
|
|
280
280
|
id: "refundAmount",
|
|
281
281
|
type: "number",
|
|
282
282
|
step: "0.01",
|
|
@@ -288,114 +288,114 @@ 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__ */ v("span", {
|
|
292
292
|
className: "text-sm text-text-secondary",
|
|
293
293
|
children: O.currency ?? W?.currency ?? "USD"
|
|
294
294
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ y("span", {
|
|
296
296
|
className: "text-xs text-text-secondary",
|
|
297
|
-
children: ["max ",
|
|
297
|
+
children: ["max ", r(O.amount, O.currency)]
|
|
298
298
|
})
|
|
299
299
|
]
|
|
300
300
|
})] }),
|
|
301
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
302
302
|
htmlFor: "reason",
|
|
303
303
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
304
|
-
children: [
|
|
305
|
-
}), /* @__PURE__ */
|
|
304
|
+
children: [_("billing.refunds.reason", "Reason for refund"), " *"]
|
|
305
|
+
}), /* @__PURE__ */ v("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: _("billing.refunds.reasonPlaceholder", "Describe why you are requesting a refund...")
|
|
313
313
|
})] }),
|
|
314
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ y("div", {
|
|
315
315
|
className: "flex items-center gap-3 pt-1",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ v("button", {
|
|
317
317
|
type: "submit",
|
|
318
|
-
disabled:
|
|
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:
|
|
321
|
-
}), /* @__PURE__ */
|
|
320
|
+
children: Z ? _("billing.refunds.submitting", "Submitting...") : _("billing.refunds.submitRequest", "Submit Request")
|
|
321
|
+
}), /* @__PURE__ */ v("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: _("billing.common.cancel", "Cancel")
|
|
326
326
|
})]
|
|
327
327
|
})
|
|
328
328
|
]
|
|
329
329
|
})]
|
|
330
330
|
}),
|
|
331
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ y("div", {
|
|
332
332
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
|
|
333
|
-
children: [/* @__PURE__ */
|
|
333
|
+
children: [/* @__PURE__ */ v("div", {
|
|
334
334
|
className: "p-4 border-b border-border-subtle bg-bg-sunken",
|
|
335
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ v("h2", {
|
|
336
336
|
className: "font-semibold text-text-primary",
|
|
337
|
-
children:
|
|
337
|
+
children: _("billing.refunds.history", "Refund History")
|
|
338
338
|
})
|
|
339
|
-
}), B ||
|
|
339
|
+
}), B || he ? /* @__PURE__ */ v("div", {
|
|
340
340
|
className: "p-8 flex items-center justify-center",
|
|
341
|
-
children: /* @__PURE__ */
|
|
342
|
-
}) :
|
|
341
|
+
children: /* @__PURE__ */ v(m, { className: "size-5 animate-spin text-text-secondary" })
|
|
342
|
+
}) : X.length === 0 ? /* @__PURE__ */ v(ie, {
|
|
343
343
|
illustration: "empty-data",
|
|
344
|
-
title:
|
|
345
|
-
description:
|
|
346
|
-
}) : /* @__PURE__ */
|
|
344
|
+
title: _("billing.refunds.noRefunds", "No refund requests yet"),
|
|
345
|
+
description: _("billing.refunds.noRefundsHint", "If you have an issue with a payment, click \"Request Refund\" to get started.")
|
|
346
|
+
}) : /* @__PURE__ */ v("ul", {
|
|
347
347
|
className: "divide-y divide-border-subtle",
|
|
348
|
-
children:
|
|
348
|
+
children: X.map((e) => /* @__PURE__ */ y("li", {
|
|
349
349
|
className: "flex items-start gap-4 p-4 hover:bg-bg-sunken transition-colors",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ y("div", {
|
|
351
351
|
className: "flex-1 min-w-0",
|
|
352
352
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ y("div", {
|
|
354
354
|
className: "flex items-center gap-2 flex-wrap",
|
|
355
355
|
children: [
|
|
356
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ v("span", {
|
|
357
357
|
className: "text-sm font-medium text-text-primary",
|
|
358
|
-
children:
|
|
358
|
+
children: r(e.amount, e.currency)
|
|
359
359
|
}),
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
e.purchaseDetail && /* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ v(le, { status: e.status }),
|
|
361
|
+
e.purchaseDetail && /* @__PURE__ */ v("span", {
|
|
362
362
|
className: "text-xs text-text-secondary truncate",
|
|
363
363
|
children: e.purchaseDetail
|
|
364
364
|
})
|
|
365
365
|
]
|
|
366
366
|
}),
|
|
367
|
-
e.reason && /* @__PURE__ */
|
|
367
|
+
e.reason && /* @__PURE__ */ v("p", {
|
|
368
368
|
className: "text-xs text-text-secondary mt-1 line-clamp-2",
|
|
369
369
|
children: e.reason
|
|
370
370
|
}),
|
|
371
|
-
e.errorMessage && e.status ===
|
|
371
|
+
e.errorMessage && e.status === c.Failed && /* @__PURE__ */ v("p", {
|
|
372
372
|
className: "text-xs text-status-error-text mt-1",
|
|
373
373
|
children: e.errorMessage
|
|
374
374
|
})
|
|
375
375
|
]
|
|
376
|
-
}), /* @__PURE__ */
|
|
376
|
+
}), /* @__PURE__ */ y("div", {
|
|
377
377
|
className: "text-right shrink-0",
|
|
378
|
-
children: [/* @__PURE__ */
|
|
378
|
+
children: [/* @__PURE__ */ v("p", {
|
|
379
379
|
className: "text-xs text-text-secondary",
|
|
380
|
-
children:
|
|
381
|
-
}), e.processedAt && /* @__PURE__ */
|
|
380
|
+
children: i(e.createdAt)
|
|
381
|
+
}), e.processedAt && /* @__PURE__ */ y("p", {
|
|
382
382
|
className: "text-xs text-text-secondary mt-0.5",
|
|
383
|
-
children: ["Processed ",
|
|
383
|
+
children: ["Processed ", i(e.processedAt)]
|
|
384
384
|
})]
|
|
385
385
|
})]
|
|
386
386
|
}, e.id))
|
|
387
387
|
})]
|
|
388
388
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ y("p", {
|
|
390
390
|
className: "text-xs text-text-secondary",
|
|
391
391
|
children: [
|
|
392
|
-
|
|
392
|
+
_("billing.refunds.footer", "Refund requests are reviewed by our team within 3–5 business days. For urgent issues, contact support."),
|
|
393
393
|
" ",
|
|
394
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ v("button", {
|
|
395
395
|
type: "button",
|
|
396
|
-
onClick: () =>
|
|
396
|
+
onClick: () => x("/transactions/" + H),
|
|
397
397
|
className: "underline hover:no-underline",
|
|
398
|
-
children:
|
|
398
|
+
children: _("billing.refunds.viewTransactions", "View all transactions")
|
|
399
399
|
})
|
|
400
400
|
]
|
|
401
401
|
})
|