@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
|
@@ -1,369 +1,368 @@
|
|
|
1
1
|
import { AccessDenied as e } from "../../../shared/components/AccessDenied.js";
|
|
2
2
|
import { PageHeader as t } from "../../../shared/components/PageHeader.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ServerError as i } from "../../../shared/components/ServerError.js";
|
|
3
|
+
import { statusTokens as n } from "../../../shared/utils/tokens.js";
|
|
4
|
+
import { ServerError as r } from "../../../shared/components/ServerError.js";
|
|
6
5
|
import "../../../shared/components/index.js";
|
|
7
|
-
import { formatCurrency as
|
|
8
|
-
import { isServerError as
|
|
6
|
+
import { formatCurrency as i, formatDateTime as a } from "../../../shared/utils/format.js";
|
|
7
|
+
import { isServerError as o } from "../../../shared/utils/error.js";
|
|
9
8
|
import "../../../shared/utils/index.js";
|
|
10
|
-
import { useBillingPermissions as
|
|
11
|
-
import { GetTransactionDocument as
|
|
12
|
-
import { useRefunds as
|
|
9
|
+
import { useBillingPermissions as s } from "../../../hooks/useBillingPermissions.js";
|
|
10
|
+
import { GetTransactionDocument as c } from "../../../../generated/global-operations.js";
|
|
11
|
+
import { useRefunds as l } from "../hooks/useRefunds.js";
|
|
13
12
|
import "../hooks/index.js";
|
|
14
|
-
import { useCallback as
|
|
15
|
-
import { AlertTriangle as
|
|
16
|
-
import { Fragment as
|
|
17
|
-
import { useI18n as
|
|
18
|
-
import { CTAOverflowMenu as
|
|
19
|
-
import { useApolloClient as
|
|
13
|
+
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
14
|
+
import { AlertTriangle as h, Ban as g, CheckCircle as _, ChevronLeft as v, ChevronRight as y, Clock as b, Download as x, Eye as S, Filter as C, Loader2 as w, MoreHorizontal as T, Play as E, Plus as ee, RefreshCw as te, RotateCcw as D, Search as O, SkipForward as k, X as A, XCircle as j } from "lucide-react";
|
|
15
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
16
|
+
import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
17
|
+
import { CTAOverflowMenu as re, IllustratedEmptyState as ie, PagePurpose as ae, ResponsiveTable as oe } from "@burdenoff/fe-libs/ui";
|
|
18
|
+
import { useApolloClient as F } from "@apollo/client/react";
|
|
20
19
|
//#region src/billing/modules/billing/pages/RefundsPage.tsx
|
|
21
|
-
var
|
|
20
|
+
var I = {
|
|
22
21
|
PENDING: {
|
|
23
22
|
label: "Pending",
|
|
24
23
|
color: "yellow",
|
|
25
|
-
icon:
|
|
24
|
+
icon: b
|
|
26
25
|
},
|
|
27
26
|
PROCESSING: {
|
|
28
27
|
label: "Processing",
|
|
29
28
|
color: "blue",
|
|
30
|
-
icon:
|
|
29
|
+
icon: w
|
|
31
30
|
},
|
|
32
31
|
COMPLETED: {
|
|
33
32
|
label: "Completed",
|
|
34
33
|
color: "green",
|
|
35
|
-
icon:
|
|
34
|
+
icon: _
|
|
36
35
|
},
|
|
37
36
|
FAILED: {
|
|
38
37
|
label: "Failed",
|
|
39
38
|
color: "red",
|
|
40
|
-
icon:
|
|
39
|
+
icon: j
|
|
41
40
|
},
|
|
42
41
|
SKIPPED: {
|
|
43
42
|
label: "Skipped",
|
|
44
43
|
color: "gray",
|
|
45
|
-
icon:
|
|
44
|
+
icon: g
|
|
46
45
|
}
|
|
47
|
-
},
|
|
46
|
+
}, L = {
|
|
48
47
|
MANUAL: "Manual",
|
|
49
48
|
WEBHOOK_RECOVERY: "Webhook Recovery",
|
|
50
49
|
SUBSCRIPTION_CANCEL: "Subscription Cancel",
|
|
51
50
|
DUPLICATE_PAYMENT: "Duplicate Payment"
|
|
52
|
-
},
|
|
51
|
+
}, se = ["stripe", "razorpay"], R = (e) => {
|
|
53
52
|
let t = {
|
|
54
|
-
yellow: `${
|
|
55
|
-
blue: `${
|
|
56
|
-
green: `${
|
|
57
|
-
red: `${
|
|
58
|
-
gray: `${
|
|
53
|
+
yellow: `${n.warning.bg} ${n.warning.text}`,
|
|
54
|
+
blue: `${n.info.bg} ${n.info.text}`,
|
|
55
|
+
green: `${n.success.bg} ${n.success.text}`,
|
|
56
|
+
red: `${n.error.bg} ${n.error.text}`,
|
|
57
|
+
gray: `${n.neutral.bg} ${n.neutral.text}`
|
|
59
58
|
};
|
|
60
59
|
return t[e] || t.gray;
|
|
61
|
-
},
|
|
62
|
-
let [s, c] =
|
|
63
|
-
|
|
60
|
+
}, ce = ({ record: e, onViewDetails: t, onProcess: r, onSkip: i, onRetry: a, isProcessing: o }) => {
|
|
61
|
+
let [s, c] = m(!1), l = p(null);
|
|
62
|
+
d(() => {
|
|
64
63
|
let e = (e) => {
|
|
65
64
|
l.current && !l.current.contains(e.target) && c(!1);
|
|
66
65
|
};
|
|
67
66
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
68
67
|
}, []);
|
|
69
|
-
let u = e.status === "PENDING",
|
|
70
|
-
return /* @__PURE__ */
|
|
68
|
+
let u = e.status === "PENDING", f = e.status === "PENDING", h = e.status === "FAILED";
|
|
69
|
+
return /* @__PURE__ */ P("div", {
|
|
71
70
|
className: "relative",
|
|
72
71
|
ref: l,
|
|
73
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ N("button", {
|
|
74
73
|
type: "button",
|
|
75
74
|
onClick: () => c(!s),
|
|
76
75
|
disabled: o,
|
|
77
76
|
className: "p-1.5 rounded-md hover:bg-bg-sunken/50 transition-colors disabled:opacity-50",
|
|
78
77
|
"aria-label": "Refund actions",
|
|
79
|
-
children: o ? /* @__PURE__ */
|
|
80
|
-
}), s && /* @__PURE__ */
|
|
78
|
+
children: o ? /* @__PURE__ */ N(w, { className: "size-4 animate-spin text-text-muted" }) : /* @__PURE__ */ N(T, { className: "size-4 text-text-muted" })
|
|
79
|
+
}), s && /* @__PURE__ */ P("div", {
|
|
81
80
|
className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] bg-bg-elevated border border-border-subtle rounded-input shadow-[var(--shadow-elevation-3)] py-1",
|
|
82
81
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ P("button", {
|
|
84
83
|
type: "button",
|
|
85
84
|
onClick: () => {
|
|
86
85
|
t(), c(!1);
|
|
87
86
|
},
|
|
88
87
|
className: "w-full flex items-center gap-2 px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken/50 transition-colors",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ N(S, { className: "size-4" }), "View Details"]
|
|
90
89
|
}),
|
|
91
|
-
u && /* @__PURE__ */
|
|
90
|
+
u && /* @__PURE__ */ P("button", {
|
|
92
91
|
type: "button",
|
|
93
92
|
onClick: () => {
|
|
94
|
-
|
|
93
|
+
r(), c(!1);
|
|
95
94
|
},
|
|
96
|
-
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${
|
|
97
|
-
children: [/* @__PURE__ */
|
|
95
|
+
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${n.success.text} hover:bg-bg-sunken/50 transition-colors`,
|
|
96
|
+
children: [/* @__PURE__ */ N(E, { className: "size-4" }), "Process Refund"]
|
|
98
97
|
}),
|
|
99
|
-
|
|
98
|
+
f && /* @__PURE__ */ P("button", {
|
|
100
99
|
type: "button",
|
|
101
100
|
onClick: () => {
|
|
102
101
|
i(), c(!1);
|
|
103
102
|
},
|
|
104
|
-
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${
|
|
105
|
-
children: [/* @__PURE__ */
|
|
103
|
+
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${n.warning.text} hover:bg-bg-sunken/50 transition-colors`,
|
|
104
|
+
children: [/* @__PURE__ */ N(k, { className: "size-4" }), "Skip Refund"]
|
|
106
105
|
}),
|
|
107
|
-
|
|
106
|
+
h && /* @__PURE__ */ P("button", {
|
|
108
107
|
type: "button",
|
|
109
108
|
onClick: () => {
|
|
110
109
|
a(), c(!1);
|
|
111
110
|
},
|
|
112
|
-
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${
|
|
113
|
-
children: [/* @__PURE__ */
|
|
111
|
+
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${n.info.text} hover:bg-bg-sunken/50 transition-colors`,
|
|
112
|
+
children: [/* @__PURE__ */ N(D, { className: "size-4" }), "Retry Refund"]
|
|
114
113
|
})
|
|
115
114
|
]
|
|
116
115
|
})]
|
|
117
116
|
});
|
|
118
|
-
},
|
|
117
|
+
}, z = {
|
|
119
118
|
provider: "stripe",
|
|
120
119
|
gatewayPaymentId: "",
|
|
121
120
|
amount: 0,
|
|
122
121
|
currency: "USD"
|
|
123
|
-
},
|
|
124
|
-
let
|
|
125
|
-
s(""),
|
|
122
|
+
}, le = ({ isOpen: e, onClose: t, onSubmit: n, isSubmitting: r }) => {
|
|
123
|
+
let a = F(), [o, s] = m(""), [l, d] = m(null), [f, p] = m(null), [h, g] = m(!1), [v, y] = m(z), b = () => {
|
|
124
|
+
s(""), d(null), p(null), y(z);
|
|
126
125
|
}, x = () => {
|
|
127
126
|
b(), t();
|
|
128
|
-
}, S =
|
|
127
|
+
}, S = u(async (e) => {
|
|
129
128
|
let t = e.trim();
|
|
130
129
|
if (t) {
|
|
131
|
-
g(!0), p(null),
|
|
130
|
+
g(!0), p(null), d(null);
|
|
132
131
|
try {
|
|
133
|
-
let { data: e } = await
|
|
134
|
-
query:
|
|
132
|
+
let { data: e } = await a.query({
|
|
133
|
+
query: c,
|
|
135
134
|
variables: { id: t },
|
|
136
135
|
fetchPolicy: "network-only"
|
|
137
136
|
}), n = e?.getTransaction ?? null;
|
|
138
137
|
if (!n) {
|
|
139
|
-
p("Transaction not found. Check the ID and try again."), y(
|
|
138
|
+
p("Transaction not found. Check the ID and try again."), y(z);
|
|
140
139
|
return;
|
|
141
140
|
}
|
|
142
|
-
let r = n.metadata,
|
|
143
|
-
|
|
141
|
+
let r = n.metadata, i = typeof r?.total == "number" ? r.total : n.amount;
|
|
142
|
+
d({
|
|
144
143
|
id: n.id,
|
|
145
144
|
billingAccountId: n.billingAccountId,
|
|
146
145
|
amount: n.amount,
|
|
147
|
-
totalAmount:
|
|
146
|
+
totalAmount: i,
|
|
148
147
|
currency: n.currency,
|
|
149
148
|
description: n.description ?? null,
|
|
150
149
|
razorpayPaymentId: n.razorpayPaymentId ?? null,
|
|
151
150
|
stripePaymentId: n.stripePaymentId ?? null,
|
|
152
151
|
metadata: n.metadata ?? null
|
|
153
152
|
});
|
|
154
|
-
let o = n.razorpayPaymentId ? "razorpay" : "stripe", s = n.razorpayPaymentId ?? n.stripePaymentId ?? "",
|
|
153
|
+
let o = n.razorpayPaymentId ? "razorpay" : "stripe", s = n.razorpayPaymentId ?? n.stripePaymentId ?? "", l = r?.purchaseType ?? "", u = n.description ?? "";
|
|
155
154
|
y({
|
|
156
155
|
transactionId: n.id,
|
|
157
156
|
billingAccountId: n.billingAccountId,
|
|
158
157
|
provider: o,
|
|
159
158
|
gatewayPaymentId: s,
|
|
160
159
|
currency: n.currency,
|
|
161
|
-
amount:
|
|
162
|
-
purchaseType:
|
|
163
|
-
purchaseDetail:
|
|
160
|
+
amount: i,
|
|
161
|
+
purchaseType: l,
|
|
162
|
+
purchaseDetail: u,
|
|
164
163
|
reason: "",
|
|
165
164
|
notes: ""
|
|
166
165
|
});
|
|
167
166
|
} catch {
|
|
168
|
-
p("Failed to look up transaction. Ensure the ID is correct."), y(
|
|
167
|
+
p("Failed to look up transaction. Ensure the ID is correct."), y(z);
|
|
169
168
|
} finally {
|
|
170
169
|
g(!1);
|
|
171
170
|
}
|
|
172
171
|
}
|
|
173
|
-
}, [
|
|
174
|
-
e.preventDefault(), await n(
|
|
172
|
+
}, [a]), C = async (e) => {
|
|
173
|
+
e.preventDefault(), await n(v), b();
|
|
175
174
|
};
|
|
176
175
|
if (!e) return null;
|
|
177
|
-
let
|
|
178
|
-
return /* @__PURE__ */
|
|
176
|
+
let T = l?.totalAmount ?? void 0, E = T !== void 0 && v.amount > T + .01;
|
|
177
|
+
return /* @__PURE__ */ P("div", {
|
|
179
178
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
180
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ N("div", {
|
|
181
180
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
182
181
|
onClick: x
|
|
183
|
-
}), /* @__PURE__ */
|
|
182
|
+
}), /* @__PURE__ */ P("div", {
|
|
184
183
|
className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] max-w-lg w-full mx-4 max-h-[90vh] overflow-auto",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ P("div", {
|
|
186
185
|
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ N("h2", {
|
|
188
187
|
className: "text-lg font-semibold",
|
|
189
188
|
children: "Create Manual Refund"
|
|
190
|
-
}), /* @__PURE__ */
|
|
189
|
+
}), /* @__PURE__ */ N("button", {
|
|
191
190
|
type: "button",
|
|
192
191
|
onClick: x,
|
|
193
192
|
className: "p-1 rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
194
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ N(A, { className: "size-5" })
|
|
195
194
|
})]
|
|
196
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ P("form", {
|
|
197
196
|
onSubmit: C,
|
|
198
197
|
className: "p-4 space-y-4",
|
|
199
198
|
children: [
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ P("div", { children: [
|
|
200
|
+
/* @__PURE__ */ N("label", {
|
|
202
201
|
className: "block text-sm font-medium mb-1",
|
|
203
202
|
children: "Transaction ID *"
|
|
204
203
|
}),
|
|
205
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ P("div", {
|
|
206
205
|
className: "flex gap-2",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ N("input", {
|
|
208
207
|
type: "text",
|
|
209
208
|
value: o,
|
|
210
209
|
onChange: (e) => {
|
|
211
|
-
s(e.target.value),
|
|
210
|
+
s(e.target.value), d(null), p(null);
|
|
212
211
|
},
|
|
213
212
|
onBlur: () => S(o),
|
|
214
213
|
className: "flex-1 px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
215
214
|
placeholder: "Paste transaction UUID...",
|
|
216
215
|
required: !0
|
|
217
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ N("button", {
|
|
218
217
|
type: "button",
|
|
219
218
|
onClick: () => S(o),
|
|
220
|
-
disabled: !o.trim() ||
|
|
219
|
+
disabled: !o.trim() || h,
|
|
221
220
|
className: "px-3 py-2 border border-border-subtle rounded-md hover:bg-bg-sunken/50 transition-colors disabled:opacity-50 flex items-center gap-1 text-sm",
|
|
222
|
-
children:
|
|
221
|
+
children: h ? /* @__PURE__ */ N(w, { className: "size-4 animate-spin" }) : /* @__PURE__ */ N(O, { className: "size-4" })
|
|
223
222
|
})]
|
|
224
223
|
}),
|
|
225
|
-
f && /* @__PURE__ */
|
|
224
|
+
f && /* @__PURE__ */ N("p", {
|
|
226
225
|
className: "text-xs text-status-error-text mt-1",
|
|
227
226
|
children: f
|
|
228
227
|
}),
|
|
229
|
-
|
|
228
|
+
h && /* @__PURE__ */ N("p", {
|
|
230
229
|
className: "text-xs text-text-muted mt-1",
|
|
231
230
|
children: "Looking up transaction…"
|
|
232
231
|
})
|
|
233
232
|
] }),
|
|
234
|
-
|
|
235
|
-
/* @__PURE__ */
|
|
233
|
+
l && /* @__PURE__ */ P(M, { children: [
|
|
234
|
+
/* @__PURE__ */ P("div", {
|
|
236
235
|
className: "p-3 bg-status-success-bg-subtle border border-border-subtle rounded-md text-sm space-y-1",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ P("div", {
|
|
238
237
|
className: "flex items-center gap-2 text-status-success-text font-medium",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
240
|
-
}), /* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ N(_, { className: "size-4" }), "Transaction found"]
|
|
239
|
+
}), /* @__PURE__ */ P("div", {
|
|
241
240
|
className: "text-text-muted grid grid-cols-2 gap-x-4 gap-y-0.5 mt-1",
|
|
242
241
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ P("span", { children: [
|
|
244
243
|
"Account:",
|
|
245
244
|
" ",
|
|
246
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ P("span", {
|
|
247
246
|
className: "text-text-primary font-mono text-xs",
|
|
248
|
-
children: [
|
|
247
|
+
children: [l.billingAccountId.slice(0, 16), "…"]
|
|
249
248
|
})
|
|
250
249
|
] }),
|
|
251
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ P("span", { children: [
|
|
252
251
|
"Paid:",
|
|
253
252
|
" ",
|
|
254
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ N("span", {
|
|
255
254
|
className: "text-text-primary",
|
|
256
|
-
children:
|
|
255
|
+
children: i(l.totalAmount, l.currency)
|
|
257
256
|
})
|
|
258
257
|
] }),
|
|
259
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ P("span", { children: [
|
|
260
259
|
"Provider:",
|
|
261
260
|
" ",
|
|
262
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ N("span", {
|
|
263
262
|
className: "text-text-primary capitalize",
|
|
264
|
-
children:
|
|
263
|
+
children: v.provider
|
|
265
264
|
})
|
|
266
265
|
] }),
|
|
267
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ P("span", { children: ["Currency: ", /* @__PURE__ */ N("span", {
|
|
268
267
|
className: "text-text-primary",
|
|
269
|
-
children:
|
|
268
|
+
children: l.currency
|
|
270
269
|
})] })
|
|
271
270
|
]
|
|
272
271
|
})]
|
|
273
272
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ P("div", {
|
|
275
274
|
className: "grid grid-cols-2 gap-3",
|
|
276
|
-
children: [/* @__PURE__ */
|
|
275
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
277
276
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
278
277
|
children: "Provider"
|
|
279
|
-
}), /* @__PURE__ */
|
|
278
|
+
}), /* @__PURE__ */ N("div", {
|
|
280
279
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm capitalize",
|
|
281
|
-
children:
|
|
282
|
-
})] }), /* @__PURE__ */
|
|
280
|
+
children: v.provider
|
|
281
|
+
})] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
283
282
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
284
283
|
children: "Currency"
|
|
285
|
-
}), /* @__PURE__ */
|
|
284
|
+
}), /* @__PURE__ */ N("div", {
|
|
286
285
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm",
|
|
287
|
-
children:
|
|
286
|
+
children: v.currency
|
|
288
287
|
})] })]
|
|
289
288
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
291
290
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
292
291
|
children: "Gateway Payment ID"
|
|
293
|
-
}), /* @__PURE__ */
|
|
292
|
+
}), /* @__PURE__ */ N("div", {
|
|
294
293
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm font-mono truncate",
|
|
295
|
-
children:
|
|
294
|
+
children: v.gatewayPaymentId
|
|
296
295
|
})] }),
|
|
297
|
-
|
|
296
|
+
v.purchaseType && /* @__PURE__ */ P("div", {
|
|
298
297
|
className: "grid grid-cols-2 gap-3",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
298
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
300
299
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
301
300
|
children: "Purchase Type"
|
|
302
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ N("div", {
|
|
303
302
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm",
|
|
304
|
-
children:
|
|
305
|
-
})] }), /* @__PURE__ */
|
|
303
|
+
children: v.purchaseType
|
|
304
|
+
})] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
306
305
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
307
306
|
children: "Purchase Detail"
|
|
308
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ N("div", {
|
|
309
308
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm truncate",
|
|
310
|
-
children:
|
|
309
|
+
children: v.purchaseDetail || "—"
|
|
311
310
|
})] })]
|
|
312
311
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ P("div", { children: [
|
|
313
|
+
/* @__PURE__ */ P("label", {
|
|
315
314
|
className: "block text-sm font-medium mb-1",
|
|
316
|
-
children: ["Refund Amount *", /* @__PURE__ */
|
|
315
|
+
children: ["Refund Amount *", /* @__PURE__ */ P("span", {
|
|
317
316
|
className: "text-xs text-text-muted ml-1",
|
|
318
317
|
children: [
|
|
319
318
|
"(max ",
|
|
320
|
-
|
|
319
|
+
i(T, v.currency),
|
|
321
320
|
")"
|
|
322
321
|
]
|
|
323
322
|
})]
|
|
324
323
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ N("input", {
|
|
326
325
|
type: "number",
|
|
327
326
|
step: "0.01",
|
|
328
327
|
min: "0.01",
|
|
329
|
-
max:
|
|
330
|
-
value:
|
|
328
|
+
max: T,
|
|
329
|
+
value: v.amount,
|
|
331
330
|
onChange: (e) => y({
|
|
332
|
-
...
|
|
331
|
+
...v,
|
|
333
332
|
amount: parseFloat(e.target.value) || 0
|
|
334
333
|
}),
|
|
335
334
|
className: `w-full px-3 py-2 border rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${E ? "border-status-error-text" : "border-border-subtle"}`,
|
|
336
335
|
required: !0
|
|
337
336
|
}),
|
|
338
|
-
E && /* @__PURE__ */
|
|
337
|
+
E && /* @__PURE__ */ P("p", {
|
|
339
338
|
className: "text-xs text-status-error-text mt-1",
|
|
340
339
|
children: [
|
|
341
340
|
"Amount cannot exceed the original payment of",
|
|
342
341
|
" ",
|
|
343
|
-
|
|
342
|
+
i(T, v.currency)
|
|
344
343
|
]
|
|
345
344
|
})
|
|
346
345
|
] }),
|
|
347
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
348
347
|
className: "block text-sm font-medium mb-1",
|
|
349
348
|
children: "Reason"
|
|
350
|
-
}), /* @__PURE__ */
|
|
349
|
+
}), /* @__PURE__ */ N("input", {
|
|
351
350
|
type: "text",
|
|
352
|
-
value:
|
|
351
|
+
value: v.reason || "",
|
|
353
352
|
onChange: (e) => y({
|
|
354
|
-
...
|
|
353
|
+
...v,
|
|
355
354
|
reason: e.target.value
|
|
356
355
|
}),
|
|
357
356
|
className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
358
357
|
placeholder: "Reason for refund"
|
|
359
358
|
})] }),
|
|
360
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
361
360
|
className: "block text-sm font-medium mb-1",
|
|
362
361
|
children: "Notes"
|
|
363
|
-
}), /* @__PURE__ */
|
|
364
|
-
value:
|
|
362
|
+
}), /* @__PURE__ */ N("textarea", {
|
|
363
|
+
value: v.notes || "",
|
|
365
364
|
onChange: (e) => y({
|
|
366
|
-
...
|
|
365
|
+
...v,
|
|
367
366
|
notes: e.target.value
|
|
368
367
|
}),
|
|
369
368
|
className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none",
|
|
@@ -371,67 +370,67 @@ var R = {
|
|
|
371
370
|
placeholder: "Internal notes"
|
|
372
371
|
})] })
|
|
373
372
|
] }),
|
|
374
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ P("div", {
|
|
375
374
|
className: "flex gap-2 pt-2",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ N("button", {
|
|
377
376
|
type: "button",
|
|
378
377
|
onClick: x,
|
|
379
378
|
className: "flex-1 py-2 px-4 border border-border-subtle rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
380
379
|
children: "Cancel"
|
|
381
|
-
}), /* @__PURE__ */
|
|
380
|
+
}), /* @__PURE__ */ P("button", {
|
|
382
381
|
type: "submit",
|
|
383
|
-
disabled: r || !
|
|
382
|
+
disabled: r || !l || !v.gatewayPaymentId || v.amount <= 0 || E,
|
|
384
383
|
className: "flex-1 py-2 px-4 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bgHover transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",
|
|
385
|
-
children: [r && /* @__PURE__ */
|
|
384
|
+
children: [r && /* @__PURE__ */ N(w, { className: "size-4 animate-spin" }), "Create Refund"]
|
|
386
385
|
})]
|
|
387
386
|
})
|
|
388
387
|
]
|
|
389
388
|
})]
|
|
390
389
|
})]
|
|
391
390
|
});
|
|
392
|
-
},
|
|
393
|
-
let [s, c] =
|
|
394
|
-
return !e || !t ? null : /* @__PURE__ */
|
|
391
|
+
}, ue = ({ isOpen: e, record: t, onClose: r, onSubmit: a, isSubmitting: o }) => {
|
|
392
|
+
let [s, c] = m("");
|
|
393
|
+
return !e || !t ? null : /* @__PURE__ */ P("div", {
|
|
395
394
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
396
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ N("div", {
|
|
397
396
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
398
|
-
onClick:
|
|
399
|
-
}), /* @__PURE__ */
|
|
397
|
+
onClick: r
|
|
398
|
+
}), /* @__PURE__ */ P("div", {
|
|
400
399
|
className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] max-w-md w-full mx-4",
|
|
401
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ P("div", {
|
|
402
401
|
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ N("h2", {
|
|
404
403
|
className: "text-lg font-semibold",
|
|
405
404
|
children: "Skip Refund"
|
|
406
|
-
}), /* @__PURE__ */
|
|
405
|
+
}), /* @__PURE__ */ N("button", {
|
|
407
406
|
type: "button",
|
|
408
|
-
onClick:
|
|
407
|
+
onClick: r,
|
|
409
408
|
className: "p-1 rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
410
|
-
children: /* @__PURE__ */
|
|
409
|
+
children: /* @__PURE__ */ N(A, { className: "size-5" })
|
|
411
410
|
})]
|
|
412
|
-
}), /* @__PURE__ */
|
|
411
|
+
}), /* @__PURE__ */ P("form", {
|
|
413
412
|
onSubmit: async (e) => {
|
|
414
|
-
e.preventDefault(), await
|
|
413
|
+
e.preventDefault(), await a(s), c("");
|
|
415
414
|
},
|
|
416
415
|
className: "p-4 space-y-4",
|
|
417
416
|
children: [
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
className: `p-3 ${
|
|
420
|
-
children: /* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ N("div", {
|
|
418
|
+
className: `p-3 ${n.warning.bg} border ${n.warning.border} rounded-md`,
|
|
419
|
+
children: /* @__PURE__ */ P("div", {
|
|
421
420
|
className: "flex items-start gap-2",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
423
|
-
className: `text-sm font-medium ${
|
|
421
|
+
children: [/* @__PURE__ */ N(h, { className: `size-5 ${n.warning.icon} mt-0.5` }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
422
|
+
className: `text-sm font-medium ${n.warning.text}`,
|
|
424
423
|
children: "You are about to skip this refund"
|
|
425
|
-
}), /* @__PURE__ */
|
|
426
|
-
className: `text-sm ${
|
|
427
|
-
children: ["Amount: ",
|
|
424
|
+
}), /* @__PURE__ */ P("p", {
|
|
425
|
+
className: `text-sm ${n.warning.text} mt-1`,
|
|
426
|
+
children: ["Amount: ", i(t.amount, t.currency)]
|
|
428
427
|
})] })]
|
|
429
428
|
})
|
|
430
429
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
432
431
|
className: "block text-sm font-medium mb-1",
|
|
433
432
|
children: "Reason for skipping *"
|
|
434
|
-
}), /* @__PURE__ */
|
|
433
|
+
}), /* @__PURE__ */ N("textarea", {
|
|
435
434
|
value: s,
|
|
436
435
|
onChange: (e) => c(e.target.value),
|
|
437
436
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface resize-none",
|
|
@@ -439,180 +438,180 @@ var R = {
|
|
|
439
438
|
placeholder: "Explain why this refund is being skipped...",
|
|
440
439
|
required: !0
|
|
441
440
|
})] }),
|
|
442
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ P("div", {
|
|
443
442
|
className: "flex gap-2",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
443
|
+
children: [/* @__PURE__ */ N("button", {
|
|
445
444
|
type: "button",
|
|
446
|
-
onClick:
|
|
445
|
+
onClick: r,
|
|
447
446
|
className: "flex-1 py-2 px-4 border border-border-subtle rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
448
447
|
children: "Cancel"
|
|
449
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ P("button", {
|
|
450
449
|
type: "submit",
|
|
451
450
|
disabled: o || !s.trim(),
|
|
452
|
-
className: `flex-1 py-2 px-4 ${
|
|
453
|
-
children: [o && /* @__PURE__ */
|
|
451
|
+
className: `flex-1 py-2 px-4 ${n.warning.dot} text-action-primary-text rounded-md hover:opacity-90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2`,
|
|
452
|
+
children: [o && /* @__PURE__ */ N(w, { className: "size-4 animate-spin" }), "Skip Refund"]
|
|
454
453
|
})]
|
|
455
454
|
})
|
|
456
455
|
]
|
|
457
456
|
})]
|
|
458
457
|
})]
|
|
459
458
|
});
|
|
460
|
-
},
|
|
459
|
+
}, de = ({ record: e, onClose: t }) => {
|
|
461
460
|
if (!e) return null;
|
|
462
|
-
let
|
|
463
|
-
return /* @__PURE__ */
|
|
461
|
+
let r = I[e.status].icon;
|
|
462
|
+
return /* @__PURE__ */ P("div", {
|
|
464
463
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
465
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ N("div", {
|
|
466
465
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
467
466
|
onClick: t
|
|
468
|
-
}), /* @__PURE__ */
|
|
467
|
+
}), /* @__PURE__ */ P("div", {
|
|
469
468
|
className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] max-w-lg w-full mx-4 max-h-[90vh] overflow-auto",
|
|
470
469
|
children: [
|
|
471
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ P("div", {
|
|
472
471
|
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
473
|
-
children: [/* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ N("h2", {
|
|
474
473
|
className: "text-lg font-semibold",
|
|
475
474
|
children: "Refund Details"
|
|
476
|
-
}), /* @__PURE__ */
|
|
475
|
+
}), /* @__PURE__ */ N("button", {
|
|
477
476
|
type: "button",
|
|
478
477
|
onClick: t,
|
|
479
478
|
className: "p-1 rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
480
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ N(A, { className: "size-5" })
|
|
481
480
|
})]
|
|
482
481
|
}),
|
|
483
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ P("div", {
|
|
484
483
|
className: "p-4 space-y-4",
|
|
485
484
|
children: [
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
-
className: `flex items-center gap-2 p-3 rounded-md ${
|
|
488
|
-
children: [/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ P("div", {
|
|
486
|
+
className: `flex items-center gap-2 p-3 rounded-md ${R(I[e.status].color)}`,
|
|
487
|
+
children: [/* @__PURE__ */ N(r, { className: "size-5" }), /* @__PURE__ */ N("span", {
|
|
489
488
|
className: "font-medium",
|
|
490
|
-
children:
|
|
489
|
+
children: I[e.status].label
|
|
491
490
|
})]
|
|
492
491
|
}),
|
|
493
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ P("div", {
|
|
494
493
|
className: "grid grid-cols-2 gap-4",
|
|
495
|
-
children: [/* @__PURE__ */
|
|
494
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
496
495
|
className: "text-xs text-text-muted mb-1",
|
|
497
496
|
children: "Refund ID"
|
|
498
|
-
}), /* @__PURE__ */
|
|
497
|
+
}), /* @__PURE__ */ N("p", {
|
|
499
498
|
className: "text-sm font-mono break-all",
|
|
500
499
|
children: e.id
|
|
501
|
-
})] }), /* @__PURE__ */
|
|
500
|
+
})] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
502
501
|
className: "text-xs text-text-muted mb-1",
|
|
503
502
|
children: "Source"
|
|
504
|
-
}), /* @__PURE__ */
|
|
503
|
+
}), /* @__PURE__ */ N("p", {
|
|
505
504
|
className: "text-sm",
|
|
506
|
-
children:
|
|
505
|
+
children: L[e.source]
|
|
507
506
|
})] })]
|
|
508
507
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ P("div", {
|
|
510
509
|
className: "grid grid-cols-2 gap-4",
|
|
511
|
-
children: [/* @__PURE__ */
|
|
510
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
512
511
|
className: "text-xs text-text-muted mb-1",
|
|
513
512
|
children: "Amount"
|
|
514
|
-
}), /* @__PURE__ */
|
|
513
|
+
}), /* @__PURE__ */ N("p", {
|
|
515
514
|
className: "text-lg font-semibold",
|
|
516
|
-
children:
|
|
517
|
-
})] }), /* @__PURE__ */
|
|
515
|
+
children: i(e.amount, e.currency)
|
|
516
|
+
})] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
518
517
|
className: "text-xs text-text-muted mb-1",
|
|
519
518
|
children: "Provider"
|
|
520
|
-
}), /* @__PURE__ */
|
|
519
|
+
}), /* @__PURE__ */ N("p", {
|
|
521
520
|
className: "text-sm capitalize",
|
|
522
521
|
children: e.provider
|
|
523
522
|
})] })]
|
|
524
523
|
}),
|
|
525
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ P("div", {
|
|
526
525
|
className: "grid grid-cols-2 gap-4",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
526
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
528
527
|
className: "text-xs text-text-muted mb-1",
|
|
529
528
|
children: "Gateway Payment ID"
|
|
530
|
-
}), /* @__PURE__ */
|
|
529
|
+
}), /* @__PURE__ */ N("p", {
|
|
531
530
|
className: "text-sm font-mono break-all",
|
|
532
531
|
children: e.gatewayPaymentId
|
|
533
|
-
})] }), e.gatewayOrderId && /* @__PURE__ */
|
|
532
|
+
})] }), e.gatewayOrderId && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
534
533
|
className: "text-xs text-text-muted mb-1",
|
|
535
534
|
children: "Gateway Order ID"
|
|
536
|
-
}), /* @__PURE__ */
|
|
535
|
+
}), /* @__PURE__ */ N("p", {
|
|
537
536
|
className: "text-sm font-mono break-all",
|
|
538
537
|
children: e.gatewayOrderId
|
|
539
538
|
})] })]
|
|
540
539
|
}),
|
|
541
|
-
e.gatewayRefundId && /* @__PURE__ */
|
|
540
|
+
e.gatewayRefundId && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
542
541
|
className: "text-xs text-text-muted mb-1",
|
|
543
542
|
children: "Gateway Refund ID"
|
|
544
|
-
}), /* @__PURE__ */
|
|
543
|
+
}), /* @__PURE__ */ N("p", {
|
|
545
544
|
className: "text-sm font-mono break-all",
|
|
546
545
|
children: e.gatewayRefundId
|
|
547
546
|
})] }),
|
|
548
|
-
(e.purchaseType || e.purchaseDetail) && /* @__PURE__ */
|
|
547
|
+
(e.purchaseType || e.purchaseDetail) && /* @__PURE__ */ P("div", {
|
|
549
548
|
className: "grid grid-cols-2 gap-4",
|
|
550
|
-
children: [e.purchaseType && /* @__PURE__ */
|
|
549
|
+
children: [e.purchaseType && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
551
550
|
className: "text-xs text-text-muted mb-1",
|
|
552
551
|
children: "Purchase Type"
|
|
553
|
-
}), /* @__PURE__ */
|
|
552
|
+
}), /* @__PURE__ */ N("p", {
|
|
554
553
|
className: "text-sm",
|
|
555
554
|
children: e.purchaseType
|
|
556
|
-
})] }), e.purchaseDetail && /* @__PURE__ */
|
|
555
|
+
})] }), e.purchaseDetail && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
557
556
|
className: "text-xs text-text-muted mb-1",
|
|
558
557
|
children: "Purchase Detail"
|
|
559
|
-
}), /* @__PURE__ */
|
|
558
|
+
}), /* @__PURE__ */ N("p", {
|
|
560
559
|
className: "text-sm",
|
|
561
560
|
children: e.purchaseDetail
|
|
562
561
|
})] })]
|
|
563
562
|
}),
|
|
564
|
-
e.reason && /* @__PURE__ */
|
|
563
|
+
e.reason && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
565
564
|
className: "text-xs text-text-muted mb-1",
|
|
566
565
|
children: "Reason"
|
|
567
|
-
}), /* @__PURE__ */
|
|
566
|
+
}), /* @__PURE__ */ N("p", {
|
|
568
567
|
className: "text-sm",
|
|
569
568
|
children: e.reason
|
|
570
569
|
})] }),
|
|
571
|
-
e.notes && /* @__PURE__ */
|
|
570
|
+
e.notes && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
572
571
|
className: "text-xs text-text-muted mb-1",
|
|
573
572
|
children: "Notes"
|
|
574
|
-
}), /* @__PURE__ */
|
|
573
|
+
}), /* @__PURE__ */ N("p", {
|
|
575
574
|
className: "text-sm",
|
|
576
575
|
children: e.notes
|
|
577
576
|
})] }),
|
|
578
|
-
e.errorMessage && /* @__PURE__ */
|
|
579
|
-
className: `p-3 ${
|
|
580
|
-
children: [/* @__PURE__ */
|
|
581
|
-
className: `text-xs ${
|
|
577
|
+
e.errorMessage && /* @__PURE__ */ P("div", {
|
|
578
|
+
className: `p-3 ${n.error.bg} border ${n.error.border} rounded-md`,
|
|
579
|
+
children: [/* @__PURE__ */ N("p", {
|
|
580
|
+
className: `text-xs ${n.error.text} mb-1`,
|
|
582
581
|
children: "Error Message"
|
|
583
|
-
}), /* @__PURE__ */
|
|
584
|
-
className: `text-sm ${
|
|
582
|
+
}), /* @__PURE__ */ N("p", {
|
|
583
|
+
className: `text-sm ${n.error.text}`,
|
|
585
584
|
children: e.errorMessage
|
|
586
585
|
})]
|
|
587
586
|
}),
|
|
588
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ P("div", {
|
|
589
588
|
className: "grid grid-cols-2 gap-4 pt-2 border-t border-border-subtle",
|
|
590
|
-
children: [/* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
591
590
|
className: "text-xs text-text-muted mb-1",
|
|
592
591
|
children: "Created At"
|
|
593
|
-
}), /* @__PURE__ */
|
|
592
|
+
}), /* @__PURE__ */ N("p", {
|
|
594
593
|
className: "text-sm",
|
|
595
|
-
children:
|
|
596
|
-
})] }), e.processedAt && /* @__PURE__ */
|
|
594
|
+
children: a(e.createdAt)
|
|
595
|
+
})] }), e.processedAt && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
597
596
|
className: "text-xs text-text-muted mb-1",
|
|
598
597
|
children: "Processed At"
|
|
599
|
-
}), /* @__PURE__ */
|
|
598
|
+
}), /* @__PURE__ */ N("p", {
|
|
600
599
|
className: "text-sm",
|
|
601
|
-
children:
|
|
600
|
+
children: a(e.processedAt)
|
|
602
601
|
})] })]
|
|
603
602
|
}),
|
|
604
|
-
e.retryCount > 0 && /* @__PURE__ */
|
|
603
|
+
e.retryCount > 0 && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
605
604
|
className: "text-xs text-text-muted mb-1",
|
|
606
605
|
children: "Retry Count"
|
|
607
|
-
}), /* @__PURE__ */
|
|
606
|
+
}), /* @__PURE__ */ N("p", {
|
|
608
607
|
className: "text-sm",
|
|
609
608
|
children: e.retryCount
|
|
610
609
|
})] })
|
|
611
610
|
]
|
|
612
611
|
}),
|
|
613
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ N("div", {
|
|
614
613
|
className: "p-4 border-t border-border-subtle",
|
|
615
|
-
children: /* @__PURE__ */
|
|
614
|
+
children: /* @__PURE__ */ N("button", {
|
|
616
615
|
type: "button",
|
|
617
616
|
onClick: t,
|
|
618
617
|
className: "w-full py-2 px-4 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bgHover transition-colors",
|
|
@@ -622,7 +621,7 @@ var R = {
|
|
|
622
621
|
]
|
|
623
622
|
})]
|
|
624
623
|
});
|
|
625
|
-
},
|
|
624
|
+
}, B = {
|
|
626
625
|
PENDING: {
|
|
627
626
|
label: "Pending",
|
|
628
627
|
status: "PENDING"
|
|
@@ -639,95 +638,95 @@ var R = {
|
|
|
639
638
|
label: "All",
|
|
640
639
|
status: void 0
|
|
641
640
|
}
|
|
642
|
-
},
|
|
643
|
-
let { t:
|
|
644
|
-
let
|
|
645
|
-
return
|
|
646
|
-
},
|
|
647
|
-
...
|
|
648
|
-
status:
|
|
641
|
+
}, V = () => {
|
|
642
|
+
let { t: n } = ne(), c = (e, t) => {
|
|
643
|
+
let r = n(e);
|
|
644
|
+
return r === e ? t : r;
|
|
645
|
+
}, u = s(), [d, p] = m("PENDING"), [h, g] = m(""), [_, b] = m({}), [S, T] = m(!1), [E, D] = m(null), [k, j] = m(!1), [M, F] = m(!1), [z, V] = m(null), [fe, H] = m(null), { records: U, stats: W, pagination: G, isLoading: pe, recordsError: K, unprocessedWebhooks: q, refetch: J, goToNextPage: me, goToPreviousPage: he, setFilters: Y, createRefundRecord: ge, processRefund: _e, skipRefund: ve, retryRefund: ye, createRefundRecordsFromFailedWebhooks: be, isCreating: xe, isProcessing: Se, isCreatingFromWebhooks: X } = l({ filters: f(() => ({
|
|
646
|
+
..._,
|
|
647
|
+
status: B[d].status
|
|
649
648
|
}), [
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
649
|
+
d,
|
|
650
|
+
_.source,
|
|
651
|
+
_.provider,
|
|
652
|
+
_.billingAccountId,
|
|
653
|
+
_.fromDate,
|
|
654
|
+
_.toDate
|
|
656
655
|
]) });
|
|
657
|
-
if (!
|
|
658
|
-
if (
|
|
656
|
+
if (!u.canViewPayments) return /* @__PURE__ */ N(e, { message: "You don't have permission to view refunds." });
|
|
657
|
+
if (K && o(K)) return /* @__PURE__ */ N("div", {
|
|
659
658
|
className: "p-6",
|
|
660
|
-
children: /* @__PURE__ */
|
|
659
|
+
children: /* @__PURE__ */ N(r, {
|
|
661
660
|
title: "Server Unavailable",
|
|
662
661
|
message: "Unable to load refunds. The server might be down or experiencing issues.",
|
|
663
|
-
onRetry: () =>
|
|
662
|
+
onRetry: () => J(),
|
|
664
663
|
showRetry: !0
|
|
665
664
|
})
|
|
666
665
|
});
|
|
667
|
-
let
|
|
668
|
-
|
|
669
|
-
},
|
|
666
|
+
let Z = (e) => {
|
|
667
|
+
p(e), b({}), g("");
|
|
668
|
+
}, Q = (e, t) => {
|
|
670
669
|
if (e === "status") return;
|
|
671
670
|
let n = {
|
|
672
|
-
...
|
|
671
|
+
..._,
|
|
673
672
|
[e]: t || void 0
|
|
674
673
|
};
|
|
675
|
-
|
|
674
|
+
b(n), Y({
|
|
676
675
|
...n,
|
|
677
|
-
status:
|
|
676
|
+
status: B[d].status
|
|
678
677
|
});
|
|
679
|
-
},
|
|
678
|
+
}, Ce = async (e) => {
|
|
680
679
|
try {
|
|
681
|
-
await
|
|
680
|
+
await ge(e), j(!1);
|
|
682
681
|
} catch (e) {
|
|
683
682
|
console.error("Failed to create refund:", e);
|
|
684
683
|
}
|
|
685
|
-
},
|
|
686
|
-
|
|
684
|
+
}, we = async (e) => {
|
|
685
|
+
H(e.id);
|
|
687
686
|
try {
|
|
688
|
-
let t = await
|
|
687
|
+
let t = await _e(e.id);
|
|
689
688
|
!t.success && t.error && console.error("Refund processing failed:", t.error);
|
|
690
689
|
} catch (e) {
|
|
691
690
|
console.error("Failed to process refund:", e);
|
|
692
691
|
} finally {
|
|
693
|
-
|
|
692
|
+
H(null);
|
|
694
693
|
}
|
|
695
|
-
},
|
|
696
|
-
if (
|
|
697
|
-
await
|
|
694
|
+
}, Te = async (e) => {
|
|
695
|
+
if (z) try {
|
|
696
|
+
await ve(z.id, e), F(!1), V(null);
|
|
698
697
|
} catch (e) {
|
|
699
698
|
console.error("Failed to skip refund:", e);
|
|
700
699
|
}
|
|
701
|
-
},
|
|
702
|
-
|
|
700
|
+
}, Ee = async (e) => {
|
|
701
|
+
H(e.id);
|
|
703
702
|
try {
|
|
704
|
-
let t = await
|
|
703
|
+
let t = await ye(e.id);
|
|
705
704
|
!t.success && t.error && console.error("Refund retry failed:", t.error);
|
|
706
705
|
} catch (e) {
|
|
707
706
|
console.error("Failed to retry refund:", e);
|
|
708
707
|
} finally {
|
|
709
|
-
|
|
708
|
+
H(null);
|
|
710
709
|
}
|
|
711
|
-
},
|
|
710
|
+
}, De = async () => {
|
|
712
711
|
try {
|
|
713
|
-
await
|
|
712
|
+
await be();
|
|
714
713
|
} catch (e) {
|
|
715
714
|
console.error("Failed to create refunds from webhooks:", e);
|
|
716
715
|
}
|
|
717
|
-
},
|
|
716
|
+
}, $ = h ? U.filter((e) => e.gatewayPaymentId.toLowerCase().includes(h.toLowerCase()) || e.gatewayOrderId?.toLowerCase().includes(h.toLowerCase()) || e.reason?.toLowerCase().includes(h.toLowerCase())) : U, Oe = [
|
|
718
717
|
{
|
|
719
718
|
key: "date",
|
|
720
719
|
header: "Date",
|
|
721
720
|
priority: "primary",
|
|
722
721
|
cellClassName: "whitespace-nowrap",
|
|
723
|
-
cell: (e) => /* @__PURE__ */
|
|
722
|
+
cell: (e) => /* @__PURE__ */ P("div", {
|
|
724
723
|
className: "flex flex-col",
|
|
725
|
-
children: [/* @__PURE__ */
|
|
724
|
+
children: [/* @__PURE__ */ N("span", {
|
|
726
725
|
className: "text-sm text-text-primary",
|
|
727
|
-
children:
|
|
728
|
-
}), /* @__PURE__ */
|
|
726
|
+
children: a(e.createdAt).split(" ")[0]
|
|
727
|
+
}), /* @__PURE__ */ N("span", {
|
|
729
728
|
className: "text-xs text-text-muted",
|
|
730
|
-
children:
|
|
729
|
+
children: a(e.createdAt).split(" ")[1]
|
|
731
730
|
})]
|
|
732
731
|
})
|
|
733
732
|
},
|
|
@@ -736,12 +735,12 @@ var R = {
|
|
|
736
735
|
header: "Status",
|
|
737
736
|
cellClassName: "whitespace-nowrap",
|
|
738
737
|
cell: (e) => {
|
|
739
|
-
let t =
|
|
740
|
-
return /* @__PURE__ */
|
|
741
|
-
className: `inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded ${
|
|
742
|
-
children: [/* @__PURE__ */
|
|
738
|
+
let t = I[e.status].icon;
|
|
739
|
+
return /* @__PURE__ */ P("span", {
|
|
740
|
+
className: `inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded ${R(I[e.status].color)}`,
|
|
741
|
+
children: [/* @__PURE__ */ N(t, { className: "size-3" }), /* @__PURE__ */ N("span", {
|
|
743
742
|
className: "hidden sm:inline",
|
|
744
|
-
children:
|
|
743
|
+
children: I[e.status].label
|
|
745
744
|
})]
|
|
746
745
|
});
|
|
747
746
|
}
|
|
@@ -751,9 +750,9 @@ var R = {
|
|
|
751
750
|
header: "Source",
|
|
752
751
|
priority: "hidden-on-mobile",
|
|
753
752
|
cellClassName: "whitespace-nowrap",
|
|
754
|
-
cell: (e) => /* @__PURE__ */
|
|
753
|
+
cell: (e) => /* @__PURE__ */ N("span", {
|
|
755
754
|
className: "text-sm text-text-muted",
|
|
756
|
-
children:
|
|
755
|
+
children: L[e.source]
|
|
757
756
|
})
|
|
758
757
|
},
|
|
759
758
|
{
|
|
@@ -761,7 +760,7 @@ var R = {
|
|
|
761
760
|
header: "Provider",
|
|
762
761
|
priority: "hidden-on-mobile",
|
|
763
762
|
cellClassName: "whitespace-nowrap",
|
|
764
|
-
cell: (e) => /* @__PURE__ */
|
|
763
|
+
cell: (e) => /* @__PURE__ */ N("span", {
|
|
765
764
|
className: "text-sm text-text-primary capitalize",
|
|
766
765
|
children: e.provider
|
|
767
766
|
})
|
|
@@ -770,7 +769,7 @@ var R = {
|
|
|
770
769
|
key: "paymentId",
|
|
771
770
|
header: "Payment ID",
|
|
772
771
|
cellClassName: "whitespace-nowrap max-w-[120px] sm:max-w-[200px] truncate",
|
|
773
|
-
cell: (e) => /* @__PURE__ */
|
|
772
|
+
cell: (e) => /* @__PURE__ */ N("span", {
|
|
774
773
|
className: "text-sm font-mono text-text-muted",
|
|
775
774
|
children: e.gatewayPaymentId
|
|
776
775
|
})
|
|
@@ -780,9 +779,9 @@ var R = {
|
|
|
780
779
|
header: "Amount",
|
|
781
780
|
headerClassName: "text-right",
|
|
782
781
|
cellClassName: "text-right whitespace-nowrap",
|
|
783
|
-
cell: (e) => /* @__PURE__ */
|
|
782
|
+
cell: (e) => /* @__PURE__ */ N("span", {
|
|
784
783
|
className: "text-sm font-medium tabular-nums",
|
|
785
|
-
children:
|
|
784
|
+
children: i(e.amount, e.currency)
|
|
786
785
|
})
|
|
787
786
|
},
|
|
788
787
|
{
|
|
@@ -790,26 +789,26 @@ var R = {
|
|
|
790
789
|
header: "Reason",
|
|
791
790
|
priority: "hidden-on-mobile",
|
|
792
791
|
cellClassName: "max-w-[200px] truncate",
|
|
793
|
-
cell: (e) => /* @__PURE__ */
|
|
792
|
+
cell: (e) => /* @__PURE__ */ N("span", {
|
|
794
793
|
className: "text-sm text-text-muted",
|
|
795
794
|
children: e.reason || "-"
|
|
796
795
|
})
|
|
797
796
|
}
|
|
798
|
-
],
|
|
797
|
+
], ke = (e) => /* @__PURE__ */ N(ce, {
|
|
799
798
|
record: e,
|
|
800
|
-
onViewDetails: () =>
|
|
801
|
-
onProcess: () =>
|
|
799
|
+
onViewDetails: () => D(e),
|
|
800
|
+
onProcess: () => we(e),
|
|
802
801
|
onSkip: () => {
|
|
803
|
-
|
|
802
|
+
V(e), F(!0);
|
|
804
803
|
},
|
|
805
|
-
onRetry: () =>
|
|
806
|
-
isProcessing:
|
|
804
|
+
onRetry: () => Ee(e),
|
|
805
|
+
isProcessing: fe === e.id
|
|
807
806
|
});
|
|
808
|
-
return
|
|
807
|
+
return pe ? /* @__PURE__ */ P("div", {
|
|
809
808
|
className: "space-y-6 p-6",
|
|
810
809
|
children: [
|
|
811
|
-
/* @__PURE__ */
|
|
812
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ N("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }),
|
|
811
|
+
/* @__PURE__ */ N("div", {
|
|
813
812
|
className: "grid grid-cols-5 gap-4",
|
|
814
813
|
children: [
|
|
815
814
|
1,
|
|
@@ -817,9 +816,9 @@ var R = {
|
|
|
817
816
|
3,
|
|
818
817
|
4,
|
|
819
818
|
5
|
|
820
|
-
].map((e) => /* @__PURE__ */
|
|
819
|
+
].map((e) => /* @__PURE__ */ N("div", { className: "h-24 bg-bg-sunken animate-pulse rounded-lg" }, e))
|
|
821
820
|
}),
|
|
822
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ N("div", {
|
|
823
822
|
className: "space-y-2",
|
|
824
823
|
children: [
|
|
825
824
|
1,
|
|
@@ -827,46 +826,47 @@ var R = {
|
|
|
827
826
|
3,
|
|
828
827
|
4,
|
|
829
828
|
5
|
|
830
|
-
].map((e) => /* @__PURE__ */
|
|
829
|
+
].map((e) => /* @__PURE__ */ N("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
|
|
831
830
|
})
|
|
832
831
|
]
|
|
833
|
-
}) : /* @__PURE__ */
|
|
832
|
+
}) : /* @__PURE__ */ P("div", {
|
|
834
833
|
className: "space-y-6 p-6",
|
|
835
834
|
children: [
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
title:
|
|
835
|
+
/* @__PURE__ */ N(t, {
|
|
836
|
+
title: c("billing.refunds.title", "Refund Management"),
|
|
838
837
|
description: "View and manage refund records",
|
|
839
|
-
actions: /* @__PURE__ */
|
|
838
|
+
actions: /* @__PURE__ */ N(re, {
|
|
840
839
|
primary: {
|
|
841
840
|
label: "Create Manual Refund",
|
|
842
|
-
onSelect: () =>
|
|
843
|
-
icon: /* @__PURE__ */
|
|
841
|
+
onSelect: () => j(!0),
|
|
842
|
+
icon: /* @__PURE__ */ N(ee, { className: "size-4" })
|
|
844
843
|
},
|
|
845
|
-
actions: [...
|
|
846
|
-
label: `Import ${
|
|
847
|
-
onSelect:
|
|
848
|
-
disabled:
|
|
849
|
-
icon:
|
|
844
|
+
actions: [...q.length > 0 ? [{
|
|
845
|
+
label: `Import ${q.length} Failed Webhooks`,
|
|
846
|
+
onSelect: De,
|
|
847
|
+
disabled: X,
|
|
848
|
+
icon: X ? /* @__PURE__ */ N(w, { className: "size-4 animate-spin" }) : /* @__PURE__ */ N(x, { className: "size-4" })
|
|
850
849
|
}] : [], {
|
|
851
850
|
label: "Refresh",
|
|
852
851
|
onSelect: () => {
|
|
853
|
-
|
|
852
|
+
J();
|
|
854
853
|
},
|
|
855
|
-
icon: /* @__PURE__ */
|
|
854
|
+
icon: /* @__PURE__ */ N(te, { className: "size-4" })
|
|
856
855
|
}]
|
|
857
856
|
})
|
|
858
857
|
}),
|
|
859
|
-
/* @__PURE__ */
|
|
858
|
+
/* @__PURE__ */ N(ae, { children: c("billing.refunds.purpose", "Track and act on every refund across all billing accounts — manual refunds, ones triggered by cancellations, and those recovered from failed payment-gateway webhooks. Use it to process pending refunds, retry failed ones, skip a refund with a reason, or create a manual refund for a specific transaction.") }),
|
|
859
|
+
/* @__PURE__ */ N("div", {
|
|
860
860
|
className: "border-b border-border-subtle",
|
|
861
|
-
children: /* @__PURE__ */
|
|
861
|
+
children: /* @__PURE__ */ N("div", {
|
|
862
862
|
className: "flex flex-wrap gap-2 sm:gap-0",
|
|
863
|
-
children: Object.keys(
|
|
864
|
-
let t =
|
|
865
|
-
return /* @__PURE__ */
|
|
863
|
+
children: Object.keys(B).map((e) => {
|
|
864
|
+
let t = d === e, n = W ? e === "PENDING" ? W.pending : e === "COMPLETED" ? W.completed : e === "FAILED" ? W.failed : W.pending + W.processing + W.completed + W.failed + W.skipped : 0;
|
|
865
|
+
return /* @__PURE__ */ P("button", {
|
|
866
866
|
type: "button",
|
|
867
|
-
onClick: () =>
|
|
867
|
+
onClick: () => Z(e),
|
|
868
868
|
className: `flex items-center gap-2 px-4 py-3 text-sm font-medium border-b-2 transition-colors whitespace-nowrap ${t ? "border-action-primary-bg text-text-link" : "border-transparent text-text-muted hover:text-text-primary hover:border-border-subtle"}`,
|
|
869
|
-
children: [
|
|
869
|
+
children: [B[e].label, W && /* @__PURE__ */ N("span", {
|
|
870
870
|
className: `px-2 py-0.5 text-xs rounded-full ${t ? "bg-[var(--color-accent-soft)] text-text-link" : "bg-bg-sunken text-text-muted"}`,
|
|
871
871
|
children: n
|
|
872
872
|
})]
|
|
@@ -874,97 +874,97 @@ var R = {
|
|
|
874
874
|
})
|
|
875
875
|
})
|
|
876
876
|
}),
|
|
877
|
-
/* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ P("div", {
|
|
878
878
|
className: "flex flex-col sm:flex-row gap-4",
|
|
879
879
|
children: [
|
|
880
|
-
/* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ P("div", {
|
|
881
881
|
className: "relative flex-1",
|
|
882
|
-
children: [/* @__PURE__ */
|
|
882
|
+
children: [/* @__PURE__ */ N(O, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-muted" }), /* @__PURE__ */ N("input", {
|
|
883
883
|
type: "text",
|
|
884
884
|
placeholder: "Search by payment ID, order ID, or reason...",
|
|
885
|
-
value:
|
|
886
|
-
onChange: (e) =>
|
|
885
|
+
value: h,
|
|
886
|
+
onChange: (e) => g(e.target.value),
|
|
887
887
|
className: "w-full pl-[3.25rem] pr-4 py-2 border border-border-subtle rounded-md bg-bg-surface"
|
|
888
888
|
})]
|
|
889
889
|
}),
|
|
890
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ P("button", {
|
|
891
891
|
type: "button",
|
|
892
|
-
onClick: () =>
|
|
893
|
-
className: `inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md border transition-colors ${
|
|
892
|
+
onClick: () => T(!S),
|
|
893
|
+
className: `inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md border transition-colors ${S ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link" : "border-border-subtle bg-bg-surface hover:bg-bg-sunken/50"}`,
|
|
894
894
|
children: [
|
|
895
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ N(C, { className: "size-4" }),
|
|
896
896
|
"Filters",
|
|
897
|
-
Object.values(
|
|
897
|
+
Object.values(_).filter(Boolean).length > 0 && /* @__PURE__ */ N("span", {
|
|
898
898
|
className: "px-1.5 py-0.5 text-xs rounded-full bg-action-primary-bg text-action-primary-text",
|
|
899
|
-
children: Object.values(
|
|
899
|
+
children: Object.values(_).filter(Boolean).length
|
|
900
900
|
})
|
|
901
901
|
]
|
|
902
902
|
}),
|
|
903
|
-
Object.values(
|
|
903
|
+
Object.values(_).filter(Boolean).length > 0 && /* @__PURE__ */ P("button", {
|
|
904
904
|
type: "button",
|
|
905
905
|
onClick: () => {
|
|
906
|
-
|
|
906
|
+
b({}), Y({});
|
|
907
907
|
},
|
|
908
908
|
className: "inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md text-text-muted hover:text-text-primary transition-colors",
|
|
909
|
-
children: [/* @__PURE__ */
|
|
909
|
+
children: [/* @__PURE__ */ N(A, { className: "size-4" }), "Clear"]
|
|
910
910
|
})
|
|
911
911
|
]
|
|
912
912
|
}),
|
|
913
|
-
|
|
913
|
+
S && /* @__PURE__ */ P("div", {
|
|
914
914
|
className: "p-4 border border-border-subtle rounded-lg bg-bg-sunken/30 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
915
915
|
children: [
|
|
916
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
917
917
|
className: "block text-sm font-medium mb-1",
|
|
918
918
|
children: "Source"
|
|
919
|
-
}), /* @__PURE__ */
|
|
920
|
-
value:
|
|
921
|
-
onChange: (e) =>
|
|
919
|
+
}), /* @__PURE__ */ P("select", {
|
|
920
|
+
value: _.source || "",
|
|
921
|
+
onChange: (e) => Q("source", e.target.value),
|
|
922
922
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface",
|
|
923
|
-
children: [/* @__PURE__ */
|
|
923
|
+
children: [/* @__PURE__ */ N("option", {
|
|
924
924
|
value: "",
|
|
925
925
|
children: "All Sources"
|
|
926
|
-
}), Object.entries(
|
|
926
|
+
}), Object.entries(L).map(([e, t]) => /* @__PURE__ */ N("option", {
|
|
927
927
|
value: e,
|
|
928
928
|
children: t
|
|
929
929
|
}, e))]
|
|
930
930
|
})] }),
|
|
931
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
932
932
|
className: "block text-sm font-medium mb-1",
|
|
933
933
|
children: "Provider"
|
|
934
|
-
}), /* @__PURE__ */
|
|
935
|
-
value:
|
|
936
|
-
onChange: (e) =>
|
|
934
|
+
}), /* @__PURE__ */ P("select", {
|
|
935
|
+
value: _.provider || "",
|
|
936
|
+
onChange: (e) => Q("provider", e.target.value),
|
|
937
937
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface",
|
|
938
|
-
children: [/* @__PURE__ */
|
|
938
|
+
children: [/* @__PURE__ */ N("option", {
|
|
939
939
|
value: "",
|
|
940
940
|
children: "All Providers"
|
|
941
|
-
}),
|
|
941
|
+
}), se.map((e) => /* @__PURE__ */ N("option", {
|
|
942
942
|
value: e,
|
|
943
943
|
children: e.charAt(0).toUpperCase() + e.slice(1)
|
|
944
944
|
}, e))]
|
|
945
945
|
})] }),
|
|
946
|
-
/* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ P("div", {
|
|
947
947
|
className: "sm:col-span-2 lg:col-span-1",
|
|
948
|
-
children: [/* @__PURE__ */
|
|
948
|
+
children: [/* @__PURE__ */ N("label", {
|
|
949
949
|
className: "block text-sm font-medium mb-1",
|
|
950
950
|
children: "Date Range"
|
|
951
|
-
}), /* @__PURE__ */
|
|
951
|
+
}), /* @__PURE__ */ P("div", {
|
|
952
952
|
className: "flex flex-col sm:flex-row items-start sm:items-center gap-2",
|
|
953
953
|
children: [
|
|
954
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ N("input", {
|
|
955
955
|
type: "date",
|
|
956
|
-
value:
|
|
957
|
-
onChange: (e) =>
|
|
956
|
+
value: _.fromDate ? _.fromDate.split("T")[0] : "",
|
|
957
|
+
onChange: (e) => Q("fromDate", e.target.value ? new Date(e.target.value).toISOString() : void 0),
|
|
958
958
|
className: "w-full sm:flex-1 p-2 border border-border-subtle rounded-md bg-bg-surface text-sm"
|
|
959
959
|
}),
|
|
960
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ N("span", {
|
|
961
961
|
className: "text-text-muted hidden sm:inline",
|
|
962
962
|
children: "-"
|
|
963
963
|
}),
|
|
964
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ N("input", {
|
|
965
965
|
type: "date",
|
|
966
|
-
value:
|
|
967
|
-
onChange: (e) =>
|
|
966
|
+
value: _.toDate ? _.toDate.split("T")[0] : "",
|
|
967
|
+
onChange: (e) => Q("toDate", e.target.value ? new Date(e.target.value).toISOString() : void 0),
|
|
968
968
|
className: "w-full sm:flex-1 p-2 border border-border-subtle rounded-md bg-bg-surface text-sm"
|
|
969
969
|
})
|
|
970
970
|
]
|
|
@@ -972,104 +972,104 @@ var R = {
|
|
|
972
972
|
})
|
|
973
973
|
]
|
|
974
974
|
}),
|
|
975
|
-
|
|
976
|
-
|
|
975
|
+
$.length === 0 ? /* @__PURE__ */ N(ie, {
|
|
976
|
+
illustration: Object.values(_).filter(Boolean).length > 0 ? "empty-search" : "empty-data",
|
|
977
977
|
title: "No refund records found",
|
|
978
|
-
description: Object.values(
|
|
979
|
-
}) : /* @__PURE__ */
|
|
978
|
+
description: Object.values(_).filter(Boolean).length > 0 ? "Try adjusting your filters." : d === "PENDING" ? "No pending refunds to process." : "Refund records will appear here when created."
|
|
979
|
+
}) : /* @__PURE__ */ N("div", {
|
|
980
980
|
className: "border border-border-subtle rounded-lg overflow-hidden",
|
|
981
|
-
children: /* @__PURE__ */
|
|
982
|
-
columns:
|
|
983
|
-
data:
|
|
981
|
+
children: /* @__PURE__ */ N(oe, {
|
|
982
|
+
columns: Oe,
|
|
983
|
+
data: $,
|
|
984
984
|
rowKey: (e) => e.id,
|
|
985
|
-
rowActions:
|
|
985
|
+
rowActions: ke
|
|
986
986
|
})
|
|
987
987
|
}),
|
|
988
|
-
|
|
988
|
+
G.totalCount > 0 && /* @__PURE__ */ P("div", {
|
|
989
989
|
className: "flex flex-col sm:flex-row items-center justify-between gap-4 border-t border-border-subtle pt-4",
|
|
990
|
-
children: [/* @__PURE__ */
|
|
990
|
+
children: [/* @__PURE__ */ P("p", {
|
|
991
991
|
className: "text-sm text-text-muted text-center sm:text-left",
|
|
992
992
|
children: [
|
|
993
993
|
"Showing ",
|
|
994
|
-
|
|
994
|
+
G.page * G.pageSize + 1,
|
|
995
995
|
" to",
|
|
996
996
|
" ",
|
|
997
|
-
Math.min((
|
|
997
|
+
Math.min((G.page + 1) * G.pageSize, G.totalCount),
|
|
998
998
|
" of",
|
|
999
999
|
" ",
|
|
1000
|
-
|
|
1000
|
+
G.totalCount,
|
|
1001
1001
|
" refunds"
|
|
1002
1002
|
]
|
|
1003
|
-
}), /* @__PURE__ */
|
|
1003
|
+
}), /* @__PURE__ */ P("div", {
|
|
1004
1004
|
className: "flex items-center gap-2",
|
|
1005
1005
|
children: [
|
|
1006
|
-
/* @__PURE__ */
|
|
1006
|
+
/* @__PURE__ */ P("button", {
|
|
1007
1007
|
type: "button",
|
|
1008
|
-
onClick:
|
|
1009
|
-
disabled: !
|
|
1008
|
+
onClick: he,
|
|
1009
|
+
disabled: !G.hasPrevious,
|
|
1010
1010
|
className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-button border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
1011
|
-
children: [/* @__PURE__ */
|
|
1011
|
+
children: [/* @__PURE__ */ N(v, { className: "size-4" }), /* @__PURE__ */ N("span", {
|
|
1012
1012
|
className: "hidden sm:inline",
|
|
1013
1013
|
children: "Previous"
|
|
1014
1014
|
})]
|
|
1015
1015
|
}),
|
|
1016
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ P("span", {
|
|
1017
1017
|
className: "text-sm text-text-muted px-2",
|
|
1018
1018
|
children: [
|
|
1019
|
-
/* @__PURE__ */
|
|
1019
|
+
/* @__PURE__ */ N("span", {
|
|
1020
1020
|
className: "hidden sm:inline",
|
|
1021
1021
|
children: "Page "
|
|
1022
1022
|
}),
|
|
1023
|
-
|
|
1023
|
+
G.page + 1,
|
|
1024
1024
|
" ",
|
|
1025
|
-
/* @__PURE__ */
|
|
1025
|
+
/* @__PURE__ */ N("span", {
|
|
1026
1026
|
className: "hidden sm:inline",
|
|
1027
1027
|
children: "of"
|
|
1028
1028
|
}),
|
|
1029
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ N("span", {
|
|
1030
1030
|
className: "sm:hidden",
|
|
1031
1031
|
children: "/"
|
|
1032
1032
|
}),
|
|
1033
1033
|
" ",
|
|
1034
|
-
Math.ceil(
|
|
1034
|
+
Math.ceil(G.totalCount / G.pageSize)
|
|
1035
1035
|
]
|
|
1036
1036
|
}),
|
|
1037
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ P("button", {
|
|
1038
1038
|
type: "button",
|
|
1039
|
-
onClick:
|
|
1040
|
-
disabled: !
|
|
1039
|
+
onClick: me,
|
|
1040
|
+
disabled: !G.hasMore,
|
|
1041
1041
|
className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-button border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
1042
|
-
children: [/* @__PURE__ */
|
|
1042
|
+
children: [/* @__PURE__ */ N("span", {
|
|
1043
1043
|
className: "hidden sm:inline",
|
|
1044
1044
|
children: "Next"
|
|
1045
|
-
}), /* @__PURE__ */
|
|
1045
|
+
}), /* @__PURE__ */ N(y, { className: "size-4" })]
|
|
1046
1046
|
})
|
|
1047
1047
|
]
|
|
1048
1048
|
})]
|
|
1049
1049
|
}),
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
isOpen:
|
|
1052
|
-
onClose: () =>
|
|
1053
|
-
onSubmit:
|
|
1054
|
-
isSubmitting:
|
|
1050
|
+
/* @__PURE__ */ N(le, {
|
|
1051
|
+
isOpen: k,
|
|
1052
|
+
onClose: () => j(!1),
|
|
1053
|
+
onSubmit: Ce,
|
|
1054
|
+
isSubmitting: xe
|
|
1055
1055
|
}),
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
isOpen:
|
|
1058
|
-
record:
|
|
1056
|
+
/* @__PURE__ */ N(ue, {
|
|
1057
|
+
isOpen: M,
|
|
1058
|
+
record: z,
|
|
1059
1059
|
onClose: () => {
|
|
1060
|
-
|
|
1060
|
+
F(!1), V(null);
|
|
1061
1061
|
},
|
|
1062
|
-
onSubmit:
|
|
1063
|
-
isSubmitting:
|
|
1062
|
+
onSubmit: Te,
|
|
1063
|
+
isSubmitting: Se
|
|
1064
1064
|
}),
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
record:
|
|
1067
|
-
onClose: () =>
|
|
1065
|
+
/* @__PURE__ */ N(de, {
|
|
1066
|
+
record: E,
|
|
1067
|
+
onClose: () => D(null)
|
|
1068
1068
|
})
|
|
1069
1069
|
]
|
|
1070
1070
|
});
|
|
1071
1071
|
};
|
|
1072
1072
|
//#endregion
|
|
1073
|
-
export {
|
|
1073
|
+
export { V as RefundsPage };
|
|
1074
1074
|
|
|
1075
1075
|
//# sourceMappingURL=RefundsPage.js.map
|