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