@burdenoff/microfe-billing 2026.913.1 → 2026.914.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/BillingAdminRoutes.js +84 -71
- package/dist/billing/BillingAdminRoutes.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +90 -87
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +97 -58
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +22 -19
- package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.js +174 -157
- package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +189 -182
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +293 -274
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +140 -250
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
- package/dist/billing/modules/earnings/api.js +79 -42
- package/dist/billing/modules/earnings/api.js.map +1 -1
- package/dist/billing/modules/earnings/index.js +4 -3
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +103 -310
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +545 -0
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -0
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +246 -196
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +44 -28
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +317 -270
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +153 -150
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/usage/hooks/useUsage.js +74 -48
- package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
- package/dist/generated/global-operations.js +220 -183
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -5,66 +5,66 @@ import { formatDate as r, formatRelativeTime as i } from "../../../shared/utils/
|
|
|
5
5
|
import { directBillingGraphqlRequest as a } from "../../../shared/utils/directBillingGraphql.js";
|
|
6
6
|
import "../../../shared/utils/index.js";
|
|
7
7
|
import { useBillingPermissions as ee } from "../../../hooks/useBillingPermissions.js";
|
|
8
|
-
import { CreditWithdrawalHistoryDocument as o, GetCreditBalanceByTypeDocument as s, RequestCreditWithdrawalDocument as
|
|
9
|
-
import { useDefaultBillingAccount as
|
|
8
|
+
import { CreditWithdrawalHistoryDocument as o, GetCreditBalanceByTypeDocument as s, RequestCreditWithdrawalDocument as te, useGetCostOfCreditsCheckoutQuery as ne } from "../../../../generated/global-operations.js";
|
|
9
|
+
import { useBillingAccount as re, useBillingAccounts as ie, useDefaultBillingAccount as ae } from "../../subscriptions/hooks/useSubscriptions.js";
|
|
10
10
|
import "../../subscriptions/hooks/index.js";
|
|
11
|
-
import { addPayoutAccount as
|
|
12
|
-
import { useEffect as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { EmphasisPanel as
|
|
11
|
+
import { addPayoutAccount as oe, fetchPayoutAccounts as se } from "../../earnings/api.js";
|
|
12
|
+
import { useEffect as c, useState as l } from "react";
|
|
13
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
14
|
+
import { EmphasisPanel as ce, IllustratedEmptyState as le, PagePurpose as ue } from "@burdenoff/fe-libs/ui";
|
|
15
15
|
//#region src/billing/modules/credits/pages/CreditWithdrawalPage.tsx
|
|
16
|
-
async function
|
|
16
|
+
async function de(e, t) {
|
|
17
17
|
return (await a({
|
|
18
18
|
...t,
|
|
19
19
|
query: s,
|
|
20
20
|
variables: { billingAccountId: e }
|
|
21
21
|
})).getCreditBalanceByType;
|
|
22
22
|
}
|
|
23
|
-
async function
|
|
23
|
+
async function fe(e, t) {
|
|
24
24
|
return (await a({
|
|
25
25
|
...t,
|
|
26
|
-
query:
|
|
26
|
+
query: te,
|
|
27
27
|
variables: { input: e }
|
|
28
28
|
})).requestCreditWithdrawal;
|
|
29
29
|
}
|
|
30
|
-
async function
|
|
30
|
+
async function pe(e, t) {
|
|
31
31
|
return (await a({
|
|
32
32
|
...t,
|
|
33
33
|
query: o,
|
|
34
34
|
variables: { billingAccountId: e }
|
|
35
35
|
})).myPayoutRequests.items;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
38
|
-
let i = /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
37
|
+
var p = ({ label: e, value: t, description: n, highlight: r }) => {
|
|
38
|
+
let i = /* @__PURE__ */ f(u, { children: [
|
|
39
|
+
/* @__PURE__ */ d("p", {
|
|
40
40
|
className: "text-sm text-text-secondary",
|
|
41
41
|
children: e
|
|
42
42
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ f("p", {
|
|
44
44
|
className: `text-2xl font-bold mt-1 ${r ? "text-text-link" : "text-text-primary"}`,
|
|
45
45
|
children: [
|
|
46
46
|
t.toLocaleString(),
|
|
47
47
|
" ",
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ d("span", {
|
|
49
49
|
className: "text-base font-normal",
|
|
50
50
|
children: "credits"
|
|
51
51
|
})
|
|
52
52
|
]
|
|
53
53
|
}),
|
|
54
|
-
n && /* @__PURE__ */
|
|
54
|
+
n && /* @__PURE__ */ d("p", {
|
|
55
55
|
className: "text-xs text-text-secondary mt-1",
|
|
56
56
|
children: n
|
|
57
57
|
})
|
|
58
58
|
] });
|
|
59
|
-
return r ? /* @__PURE__ */
|
|
59
|
+
return r ? /* @__PURE__ */ d(ce, {
|
|
60
60
|
className: "p-5",
|
|
61
61
|
children: i
|
|
62
|
-
}) : /* @__PURE__ */
|
|
62
|
+
}) : /* @__PURE__ */ d("div", {
|
|
63
63
|
className: "border border-border-subtle rounded-lg p-5 bg-bg-surface",
|
|
64
64
|
children: i
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
-
function
|
|
67
|
+
function me(e) {
|
|
68
68
|
switch (e.toUpperCase()) {
|
|
69
69
|
case "PAID": return t.success.text;
|
|
70
70
|
case "APPROVED":
|
|
@@ -76,7 +76,7 @@ function le(e) {
|
|
|
76
76
|
default: return "text-text-secondary";
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function he(e) {
|
|
80
80
|
switch (e.toUpperCase()) {
|
|
81
81
|
case "PAID": return `${t.success.bg} ${t.success.text}`;
|
|
82
82
|
case "APPROVED":
|
|
@@ -88,8 +88,8 @@ function ue(e) {
|
|
|
88
88
|
default: return "bg-bg-sunken text-text-secondary";
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
var
|
|
92
|
-
let a = ee(), {
|
|
91
|
+
var m = () => {
|
|
92
|
+
let a = ee(), { billingAccounts: o } = ie(), [s, te] = l(void 0), { billingAccount: ce, isLoading: m } = ae(), { billingAccount: ge, isLoading: _e } = re(s), h = s ? ge : ce, g = s ? _e : m, { apiGatewayUrl: ve, authToken: ye, orgId: be } = e(), { emit: _ } = n(), [v, xe] = l(null), [Se, y] = l(!1), [b, x] = l(null), [Ce, we] = l([]), [Te, S] = l(!1), [C, Ee] = l([]), [De, Oe] = l(!1), [w, T] = l(""), [E, D] = l(""), [O, k] = l(""), [A, j] = l(!1), [M, N] = l(null), [ke, P] = l(!1), [F, I] = l(!1), [L, R] = l({
|
|
93
93
|
label: "",
|
|
94
94
|
type: "BANK_ACCOUNT",
|
|
95
95
|
accountHolderName: "",
|
|
@@ -99,73 +99,73 @@ var de = () => {
|
|
|
99
99
|
upiId: "",
|
|
100
100
|
country: "",
|
|
101
101
|
currency: "USD"
|
|
102
|
-
}), [
|
|
103
|
-
apiGatewayUrl:
|
|
104
|
-
authToken:
|
|
105
|
-
orgId:
|
|
106
|
-
}),
|
|
107
|
-
if (
|
|
102
|
+
}), [z, B] = l(!1), [V, H] = l(null), U = h?.id, W = () => ({
|
|
103
|
+
apiGatewayUrl: ve,
|
|
104
|
+
authToken: ye,
|
|
105
|
+
orgId: be
|
|
106
|
+
}), G = async () => {
|
|
107
|
+
if (U) {
|
|
108
108
|
y(!0), x(null);
|
|
109
109
|
try {
|
|
110
|
-
|
|
110
|
+
xe(await de(U, W()));
|
|
111
111
|
} catch (e) {
|
|
112
112
|
x(e instanceof Error ? e.message : "Failed to load balance");
|
|
113
113
|
} finally {
|
|
114
114
|
y(!1);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
},
|
|
118
|
-
if (
|
|
117
|
+
}, K = async () => {
|
|
118
|
+
if (U) {
|
|
119
119
|
S(!0);
|
|
120
120
|
try {
|
|
121
|
-
let e = await
|
|
122
|
-
|
|
121
|
+
let e = await se(U, W());
|
|
122
|
+
we(e);
|
|
123
123
|
let t = e.find((e) => e.isDefault) ?? e[0];
|
|
124
|
-
t &&
|
|
124
|
+
t && T(t.id);
|
|
125
125
|
} catch {} finally {
|
|
126
126
|
S(!1);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
},
|
|
130
|
-
if (
|
|
131
|
-
|
|
129
|
+
}, q = async () => {
|
|
130
|
+
if (U) {
|
|
131
|
+
Oe(!0);
|
|
132
132
|
try {
|
|
133
|
-
|
|
133
|
+
Ee(await pe(U, W()));
|
|
134
134
|
} catch {} finally {
|
|
135
|
-
|
|
135
|
+
Oe(!1);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
};
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}, [
|
|
142
|
-
|
|
139
|
+
c(() => {
|
|
140
|
+
U && (G(), K(), q());
|
|
141
|
+
}, [U]), c(() => {
|
|
142
|
+
h?.currency && R((e) => ({
|
|
143
143
|
...e,
|
|
144
|
-
currency:
|
|
144
|
+
currency: h.currency ?? "USD"
|
|
145
145
|
}));
|
|
146
|
-
}, [
|
|
147
|
-
let
|
|
148
|
-
if (
|
|
149
|
-
|
|
146
|
+
}, [h?.currency]);
|
|
147
|
+
let Ae = async () => {
|
|
148
|
+
if (U) {
|
|
149
|
+
H(null), B(!0);
|
|
150
150
|
try {
|
|
151
|
-
let e =
|
|
152
|
-
await
|
|
153
|
-
billingAccountId:
|
|
154
|
-
label:
|
|
155
|
-
type:
|
|
156
|
-
accountHolderName:
|
|
157
|
-
country:
|
|
158
|
-
currency:
|
|
159
|
-
...
|
|
160
|
-
accountNumber:
|
|
161
|
-
...e ? { ifsc:
|
|
151
|
+
let e = L.country.trim().toUpperCase() === "IN" || L.country.trim().toLowerCase() === "india";
|
|
152
|
+
await oe({
|
|
153
|
+
billingAccountId: U,
|
|
154
|
+
label: L.label,
|
|
155
|
+
type: L.type,
|
|
156
|
+
accountHolderName: L.accountHolderName,
|
|
157
|
+
country: L.country || void 0,
|
|
158
|
+
currency: L.currency,
|
|
159
|
+
...L.type === "BANK_ACCOUNT" && {
|
|
160
|
+
accountNumber: L.accountNumber,
|
|
161
|
+
...e ? { ifsc: L.ifscCode } : { routingNumber: L.routingNumber }
|
|
162
162
|
},
|
|
163
|
-
...
|
|
164
|
-
},
|
|
163
|
+
...L.type === "UPI" && { upiId: L.upiId }
|
|
164
|
+
}, W()), _("billing.payout_account.added", {
|
|
165
165
|
route: "/billing/credits/withdraw",
|
|
166
|
-
entityId:
|
|
166
|
+
entityId: U,
|
|
167
167
|
source: "credit-withdrawal"
|
|
168
|
-
}), await
|
|
168
|
+
}), await K(), I(!1), R({
|
|
169
169
|
label: "",
|
|
170
170
|
type: "BANK_ACCOUNT",
|
|
171
171
|
accountHolderName: "",
|
|
@@ -177,54 +177,54 @@ var de = () => {
|
|
|
177
177
|
currency: "USD"
|
|
178
178
|
});
|
|
179
179
|
} catch (e) {
|
|
180
|
-
|
|
180
|
+
H(e instanceof Error ? e.message : "Failed to add account");
|
|
181
181
|
} finally {
|
|
182
|
-
|
|
182
|
+
B(!1);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
},
|
|
186
|
-
if (!
|
|
187
|
-
let e = parseFloat(
|
|
185
|
+
}, je = async () => {
|
|
186
|
+
if (!U || !w) return;
|
|
187
|
+
let e = parseFloat(E);
|
|
188
188
|
if (!(!e || e <= 0)) {
|
|
189
|
-
|
|
189
|
+
N(null), j(!0);
|
|
190
190
|
try {
|
|
191
191
|
_("billing.credits.withdrawal_requested", {
|
|
192
192
|
route: "/billing/credits/withdraw",
|
|
193
|
-
entityId: (await
|
|
194
|
-
billingAccountId:
|
|
193
|
+
entityId: (await fe({
|
|
194
|
+
billingAccountId: U,
|
|
195
195
|
creditAmount: e,
|
|
196
|
-
payoutAccountId:
|
|
197
|
-
notes:
|
|
198
|
-
},
|
|
196
|
+
payoutAccountId: w,
|
|
197
|
+
notes: O || void 0
|
|
198
|
+
}, W())).id,
|
|
199
199
|
source: "credit-withdrawal",
|
|
200
200
|
amount: e
|
|
201
|
-
}),
|
|
201
|
+
}), P(!0), D(""), k(""), await G(), await q();
|
|
202
202
|
} catch (e) {
|
|
203
|
-
|
|
203
|
+
N(e instanceof Error ? e.message : "Withdrawal request failed");
|
|
204
204
|
} finally {
|
|
205
|
-
|
|
205
|
+
j(!1);
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
},
|
|
208
|
+
}, J = h?.currency ?? "USD", Y = parseFloat(E) || 0, { data: Me, loading: Ne } = ne({
|
|
209
209
|
variables: {
|
|
210
|
-
creditAmount:
|
|
211
|
-
currency:
|
|
210
|
+
creditAmount: Y,
|
|
211
|
+
currency: J
|
|
212
212
|
},
|
|
213
|
-
skip:
|
|
214
|
-
}),
|
|
215
|
-
if (!a.canWithdrawCredits) return /* @__PURE__ */
|
|
213
|
+
skip: Y <= 0 || !h
|
|
214
|
+
}), Pe = Me?.getCostOfCredits?.amount;
|
|
215
|
+
if (!a.canWithdrawCredits) return /* @__PURE__ */ d("div", {
|
|
216
216
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
217
|
-
children: /* @__PURE__ */
|
|
217
|
+
children: /* @__PURE__ */ f("div", {
|
|
218
218
|
className: "text-center space-y-2",
|
|
219
219
|
children: [
|
|
220
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ d("div", {
|
|
221
221
|
className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
|
|
222
|
-
children: /* @__PURE__ */
|
|
222
|
+
children: /* @__PURE__ */ d("svg", {
|
|
223
223
|
className: "size-6 text-text-secondary",
|
|
224
224
|
fill: "none",
|
|
225
225
|
viewBox: "0 0 24 24",
|
|
226
226
|
stroke: "currentColor",
|
|
227
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ d("path", {
|
|
228
228
|
strokeLinecap: "round",
|
|
229
229
|
strokeLinejoin: "round",
|
|
230
230
|
strokeWidth: 2,
|
|
@@ -232,132 +232,144 @@ var de = () => {
|
|
|
232
232
|
})
|
|
233
233
|
})
|
|
234
234
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ d("h2", {
|
|
236
236
|
className: "text-lg font-semibold text-text-primary",
|
|
237
237
|
children: "Access Denied"
|
|
238
238
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ d("p", {
|
|
240
240
|
className: "text-sm text-text-secondary",
|
|
241
241
|
children: "You don't have permission to withdraw credits."
|
|
242
242
|
})
|
|
243
243
|
]
|
|
244
244
|
})
|
|
245
245
|
});
|
|
246
|
-
if (!
|
|
246
|
+
if (!g && !h) return /* @__PURE__ */ d("div", {
|
|
247
247
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
248
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ f("div", {
|
|
249
249
|
className: "text-center space-y-2",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ d("h2", {
|
|
251
251
|
className: "text-lg font-semibold text-text-primary",
|
|
252
252
|
children: "No Billing Account"
|
|
253
|
-
}), /* @__PURE__ */
|
|
253
|
+
}), /* @__PURE__ */ d("p", {
|
|
254
254
|
className: "text-sm text-text-secondary",
|
|
255
255
|
children: "You need a billing account to withdraw credits."
|
|
256
256
|
})]
|
|
257
257
|
})
|
|
258
258
|
});
|
|
259
|
-
if (
|
|
259
|
+
if (g && !h) return /* @__PURE__ */ f("div", {
|
|
260
260
|
className: "space-y-6 px-6 lg:px-8 py-6",
|
|
261
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ d("div", { className: "h-8 w-64 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ d("div", {
|
|
262
262
|
className: "grid grid-cols-2 lg:grid-cols-4 gap-4",
|
|
263
263
|
children: [
|
|
264
264
|
1,
|
|
265
265
|
2,
|
|
266
266
|
3,
|
|
267
267
|
4
|
|
268
|
-
].map((e) => /* @__PURE__ */
|
|
268
|
+
].map((e) => /* @__PURE__ */ f("div", {
|
|
269
269
|
className: "border border-border-subtle rounded-lg p-5",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ d("div", { className: "h-4 w-24 bg-bg-sunken animate-pulse rounded mb-2" }), /* @__PURE__ */ d("div", { className: "h-8 w-32 bg-bg-sunken animate-pulse rounded" })]
|
|
271
271
|
}, e))
|
|
272
272
|
})]
|
|
273
273
|
});
|
|
274
|
-
let
|
|
275
|
-
return /* @__PURE__ */
|
|
274
|
+
let X = v?.withdrawable ?? 0, Z = .005, Fe = Y > 0 && Y <= X + Z, Q = Ce.filter((e) => e.status !== "ARCHIVED"), $ = A ? null : Q.length === 0 ? "Add a payout method above before requesting a withdrawal." : w ? Y > 0 ? Y > X + Z ? `Amount exceeds your withdrawable balance of ${X.toLocaleString()} credits.` : null : "Enter an amount to withdraw." : "Select a payout method above.";
|
|
275
|
+
return /* @__PURE__ */ f("div", {
|
|
276
276
|
className: "space-y-6 px-6 lg:px-8 py-6",
|
|
277
277
|
children: [
|
|
278
|
-
/* @__PURE__ */ p("div", { children: [
|
|
279
|
-
/* @__PURE__ */ f("h1", {
|
|
280
|
-
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
281
|
-
children: "Withdraw Credits"
|
|
282
|
-
}),
|
|
283
|
-
/* @__PURE__ */ f("p", {
|
|
284
|
-
className: "text-sm text-text-secondary mt-1",
|
|
285
|
-
children: "Convert your withdrawable credits (purchased & earned) to a payout"
|
|
286
|
-
}),
|
|
287
|
-
/* @__PURE__ */ f(ae, {
|
|
288
|
-
className: "mt-3",
|
|
289
|
-
children: "Turn the credits you bought or earned (from sales and referrals) back into real money. Add a bank account or UPI as a payout destination, request a withdrawal for any amount up to your withdrawable balance, and track each request here until it is paid. Granted credits (coupons, admin grants) are not withdrawable."
|
|
290
|
-
})
|
|
291
|
-
] }),
|
|
292
278
|
/* @__PURE__ */ f("div", {
|
|
279
|
+
className: "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",
|
|
280
|
+
children: [/* @__PURE__ */ f("div", { children: [
|
|
281
|
+
/* @__PURE__ */ d("h1", {
|
|
282
|
+
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
283
|
+
children: "Withdraw Credits"
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ d("p", {
|
|
286
|
+
className: "text-sm text-text-secondary mt-1",
|
|
287
|
+
children: "Convert your withdrawable credits (purchased & earned) to a payout"
|
|
288
|
+
}),
|
|
289
|
+
/* @__PURE__ */ d(ue, {
|
|
290
|
+
className: "mt-3",
|
|
291
|
+
children: "Turn the credits you bought or earned (from sales and referrals) back into real money. Add a bank account or UPI as a payout destination, request a withdrawal for any amount up to your withdrawable balance, and track each request here until it is paid. Granted credits (coupons, admin grants) are not withdrawable."
|
|
292
|
+
})
|
|
293
|
+
] }), o.length > 1 && /* @__PURE__ */ d("select", {
|
|
294
|
+
value: h?.id ?? "",
|
|
295
|
+
onChange: (e) => te(e.target.value),
|
|
296
|
+
"aria-label": "Switch billing account",
|
|
297
|
+
className: "px-3 py-2 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] w-full sm:min-w-[200px] sm:w-auto",
|
|
298
|
+
children: o.map((e) => /* @__PURE__ */ d("option", {
|
|
299
|
+
value: e.id,
|
|
300
|
+
children: e.name
|
|
301
|
+
}, e.id))
|
|
302
|
+
})]
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ d("div", {
|
|
293
305
|
className: "grid grid-cols-2 lg:grid-cols-4 gap-4",
|
|
294
|
-
children:
|
|
306
|
+
children: Se ? [
|
|
295
307
|
1,
|
|
296
308
|
2,
|
|
297
309
|
3,
|
|
298
310
|
4
|
|
299
|
-
].map((e) => /* @__PURE__ */
|
|
311
|
+
].map((e) => /* @__PURE__ */ f("div", {
|
|
300
312
|
className: "border border-border-subtle rounded-lg p-5",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
302
|
-
}, e)) : b ? /* @__PURE__ */
|
|
313
|
+
children: [/* @__PURE__ */ d("div", { className: "h-4 w-20 bg-bg-sunken animate-pulse rounded mb-2" }), /* @__PURE__ */ d("div", { className: "h-8 w-28 bg-bg-sunken animate-pulse rounded" })]
|
|
314
|
+
}, e)) : b ? /* @__PURE__ */ d("div", {
|
|
303
315
|
className: "col-span-4 text-sm text-status-error-text",
|
|
304
316
|
children: b
|
|
305
|
-
}) : /* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */
|
|
317
|
+
}) : /* @__PURE__ */ f(u, { children: [
|
|
318
|
+
/* @__PURE__ */ d(p, {
|
|
307
319
|
label: "Purchased",
|
|
308
320
|
value: v?.purchased ?? 0,
|
|
309
321
|
description: "From credit purchases"
|
|
310
322
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ d(p, {
|
|
312
324
|
label: "Earned",
|
|
313
325
|
value: v?.earned ?? 0,
|
|
314
326
|
description: "From sales & referrals"
|
|
315
327
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ d(p, {
|
|
317
329
|
label: "Granted",
|
|
318
330
|
value: v?.granted ?? 0,
|
|
319
331
|
description: "Coupons & admin grants — non-withdrawable"
|
|
320
332
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ d(p, {
|
|
322
334
|
label: "Withdrawable",
|
|
323
|
-
value:
|
|
335
|
+
value: X,
|
|
324
336
|
description: "Purchased + earned",
|
|
325
337
|
highlight: !0
|
|
326
338
|
})
|
|
327
339
|
] })
|
|
328
340
|
}),
|
|
329
|
-
|
|
341
|
+
ke && /* @__PURE__ */ f("div", {
|
|
330
342
|
className: "flex items-center gap-3 p-4 rounded-lg bg-status-success-bg-subtle border border-status-success-border text-status-success-text",
|
|
331
343
|
children: [
|
|
332
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ d("svg", {
|
|
333
345
|
className: "size-5 shrink-0",
|
|
334
346
|
fill: "none",
|
|
335
347
|
viewBox: "0 0 24 24",
|
|
336
348
|
stroke: "currentColor",
|
|
337
|
-
children: /* @__PURE__ */
|
|
349
|
+
children: /* @__PURE__ */ d("path", {
|
|
338
350
|
strokeLinecap: "round",
|
|
339
351
|
strokeLinejoin: "round",
|
|
340
352
|
strokeWidth: 2,
|
|
341
353
|
d: "M5 13l4 4L19 7"
|
|
342
354
|
})
|
|
343
355
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
|
|
345
357
|
className: "font-medium",
|
|
346
358
|
children: "Withdrawal request submitted"
|
|
347
|
-
}), /* @__PURE__ */
|
|
359
|
+
}), /* @__PURE__ */ d("p", {
|
|
348
360
|
className: "text-sm opacity-80",
|
|
349
361
|
children: "Our team will review and process your request."
|
|
350
362
|
})] }),
|
|
351
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ d("button", {
|
|
352
364
|
type: "button",
|
|
353
|
-
onClick: () =>
|
|
365
|
+
onClick: () => P(!1),
|
|
354
366
|
className: "ml-auto text-current opacity-60 hover:opacity-100",
|
|
355
|
-
children: /* @__PURE__ */
|
|
367
|
+
children: /* @__PURE__ */ d("svg", {
|
|
356
368
|
className: "size-4",
|
|
357
369
|
fill: "none",
|
|
358
370
|
viewBox: "0 0 24 24",
|
|
359
371
|
stroke: "currentColor",
|
|
360
|
-
children: /* @__PURE__ */
|
|
372
|
+
children: /* @__PURE__ */ d("path", {
|
|
361
373
|
strokeLinecap: "round",
|
|
362
374
|
strokeLinejoin: "round",
|
|
363
375
|
strokeWidth: 2,
|
|
@@ -367,82 +379,82 @@ var de = () => {
|
|
|
367
379
|
})
|
|
368
380
|
]
|
|
369
381
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ f("div", {
|
|
371
383
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ f("div", {
|
|
373
385
|
className: "space-y-4",
|
|
374
386
|
children: [
|
|
375
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ f("div", {
|
|
376
388
|
className: "flex items-center justify-between",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
389
|
+
children: [/* @__PURE__ */ d("h2", {
|
|
378
390
|
className: "text-base font-semibold text-text-primary",
|
|
379
391
|
children: "Payout Account"
|
|
380
|
-
}), /* @__PURE__ */
|
|
392
|
+
}), /* @__PURE__ */ d("button", {
|
|
381
393
|
type: "button",
|
|
382
|
-
onClick: () =>
|
|
394
|
+
onClick: () => I((e) => !e),
|
|
383
395
|
className: "text-sm text-text-link hover:underline",
|
|
384
|
-
children:
|
|
396
|
+
children: F ? "Cancel" : "+ Add new"
|
|
385
397
|
})]
|
|
386
398
|
}),
|
|
387
|
-
|
|
399
|
+
F && /* @__PURE__ */ f("div", {
|
|
388
400
|
className: "border border-border-subtle rounded-lg p-4 space-y-3 bg-bg-sunken",
|
|
389
401
|
children: [
|
|
390
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ d("h3", {
|
|
391
403
|
className: "text-sm font-medium text-text-primary",
|
|
392
404
|
children: "New Payout Account"
|
|
393
405
|
}),
|
|
394
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
395
407
|
className: "block text-xs text-text-secondary mb-1",
|
|
396
408
|
children: "Label"
|
|
397
|
-
}), /* @__PURE__ */
|
|
409
|
+
}), /* @__PURE__ */ d("input", {
|
|
398
410
|
type: "text",
|
|
399
|
-
value:
|
|
400
|
-
onChange: (e) =>
|
|
411
|
+
value: L.label,
|
|
412
|
+
onChange: (e) => R((t) => ({
|
|
401
413
|
...t,
|
|
402
414
|
label: e.target.value
|
|
403
415
|
})),
|
|
404
416
|
placeholder: "e.g. My Bank Account",
|
|
405
417
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
406
418
|
})] }),
|
|
407
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
408
420
|
className: "block text-xs text-text-secondary mb-1",
|
|
409
421
|
children: "Account Holder Name"
|
|
410
|
-
}), /* @__PURE__ */
|
|
422
|
+
}), /* @__PURE__ */ d("input", {
|
|
411
423
|
type: "text",
|
|
412
|
-
value:
|
|
413
|
-
onChange: (e) =>
|
|
424
|
+
value: L.accountHolderName,
|
|
425
|
+
onChange: (e) => R((t) => ({
|
|
414
426
|
...t,
|
|
415
427
|
accountHolderName: e.target.value
|
|
416
428
|
})),
|
|
417
429
|
placeholder: "Full name as on bank account",
|
|
418
430
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
419
431
|
})] }),
|
|
420
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ f("div", {
|
|
421
433
|
className: "grid grid-cols-2 gap-3",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
423
435
|
className: "block text-xs text-text-secondary mb-1",
|
|
424
436
|
children: "Type"
|
|
425
|
-
}), /* @__PURE__ */
|
|
426
|
-
value:
|
|
427
|
-
onChange: (e) =>
|
|
437
|
+
}), /* @__PURE__ */ f("select", {
|
|
438
|
+
value: L.type,
|
|
439
|
+
onChange: (e) => R((t) => ({
|
|
428
440
|
...t,
|
|
429
441
|
type: e.target.value
|
|
430
442
|
})),
|
|
431
443
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ d("option", {
|
|
433
445
|
value: "BANK_ACCOUNT",
|
|
434
446
|
children: "Bank Account"
|
|
435
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ d("option", {
|
|
436
448
|
value: "UPI",
|
|
437
449
|
children: "UPI"
|
|
438
450
|
})]
|
|
439
|
-
})] }), /* @__PURE__ */
|
|
451
|
+
})] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
440
452
|
className: "block text-xs text-text-secondary mb-1",
|
|
441
453
|
children: "Country"
|
|
442
|
-
}), /* @__PURE__ */
|
|
454
|
+
}), /* @__PURE__ */ d("input", {
|
|
443
455
|
type: "text",
|
|
444
|
-
value:
|
|
445
|
-
onChange: (e) =>
|
|
456
|
+
value: L.country,
|
|
457
|
+
onChange: (e) => R((t) => ({
|
|
446
458
|
...t,
|
|
447
459
|
country: e.target.value
|
|
448
460
|
})),
|
|
@@ -450,94 +462,94 @@ var de = () => {
|
|
|
450
462
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
451
463
|
})] })]
|
|
452
464
|
}),
|
|
453
|
-
|
|
465
|
+
L.type === "BANK_ACCOUNT" && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
454
466
|
className: "block text-xs text-text-secondary mb-1",
|
|
455
467
|
children: "Account Number"
|
|
456
|
-
}), /* @__PURE__ */
|
|
468
|
+
}), /* @__PURE__ */ d("input", {
|
|
457
469
|
type: "text",
|
|
458
|
-
value:
|
|
459
|
-
onChange: (e) =>
|
|
470
|
+
value: L.accountNumber,
|
|
471
|
+
onChange: (e) => R((t) => ({
|
|
460
472
|
...t,
|
|
461
473
|
accountNumber: e.target.value
|
|
462
474
|
})),
|
|
463
475
|
placeholder: "Account number",
|
|
464
476
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
465
|
-
})] }),
|
|
477
|
+
})] }), L.country.trim().toUpperCase() === "IN" || L.country.trim().toLowerCase() === "india" ? /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
466
478
|
className: "block text-xs text-text-secondary mb-1",
|
|
467
479
|
children: "IFSC Code"
|
|
468
|
-
}), /* @__PURE__ */
|
|
480
|
+
}), /* @__PURE__ */ d("input", {
|
|
469
481
|
type: "text",
|
|
470
|
-
value:
|
|
471
|
-
onChange: (e) =>
|
|
482
|
+
value: L.ifscCode,
|
|
483
|
+
onChange: (e) => R((t) => ({
|
|
472
484
|
...t,
|
|
473
485
|
ifscCode: e.target.value.toUpperCase()
|
|
474
486
|
})),
|
|
475
487
|
placeholder: "e.g. SBIN0001234",
|
|
476
488
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
477
|
-
})] }) : /* @__PURE__ */
|
|
489
|
+
})] }) : /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
478
490
|
className: "block text-xs text-text-secondary mb-1",
|
|
479
491
|
children: "Routing Number"
|
|
480
|
-
}), /* @__PURE__ */
|
|
492
|
+
}), /* @__PURE__ */ d("input", {
|
|
481
493
|
type: "text",
|
|
482
|
-
value:
|
|
483
|
-
onChange: (e) =>
|
|
494
|
+
value: L.routingNumber,
|
|
495
|
+
onChange: (e) => R((t) => ({
|
|
484
496
|
...t,
|
|
485
497
|
routingNumber: e.target.value
|
|
486
498
|
})),
|
|
487
499
|
placeholder: "Routing / sort code",
|
|
488
500
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
489
501
|
})] })] }),
|
|
490
|
-
|
|
502
|
+
L.type === "UPI" && /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
491
503
|
className: "block text-xs text-text-secondary mb-1",
|
|
492
504
|
children: "UPI ID"
|
|
493
|
-
}), /* @__PURE__ */
|
|
505
|
+
}), /* @__PURE__ */ d("input", {
|
|
494
506
|
type: "text",
|
|
495
|
-
value:
|
|
496
|
-
onChange: (e) =>
|
|
507
|
+
value: L.upiId,
|
|
508
|
+
onChange: (e) => R((t) => ({
|
|
497
509
|
...t,
|
|
498
510
|
upiId: e.target.value
|
|
499
511
|
})),
|
|
500
512
|
placeholder: "yourname@upi",
|
|
501
513
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
502
514
|
})] }),
|
|
503
|
-
|
|
515
|
+
V && /* @__PURE__ */ d("p", {
|
|
504
516
|
className: "text-xs text-status-error-text",
|
|
505
|
-
children:
|
|
517
|
+
children: V
|
|
506
518
|
}),
|
|
507
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ d("button", {
|
|
508
520
|
type: "button",
|
|
509
|
-
onClick: () => void
|
|
510
|
-
disabled:
|
|
521
|
+
onClick: () => void Ae(),
|
|
522
|
+
disabled: z || !L.label || !L.accountHolderName,
|
|
511
523
|
className: "w-full 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",
|
|
512
|
-
children:
|
|
524
|
+
children: z ? "Saving…" : "Save Account"
|
|
513
525
|
})
|
|
514
526
|
]
|
|
515
527
|
}),
|
|
516
|
-
|
|
528
|
+
Te ? /* @__PURE__ */ d("div", {
|
|
517
529
|
className: "space-y-2",
|
|
518
|
-
children: [1, 2].map((e) => /* @__PURE__ */
|
|
519
|
-
}) :
|
|
530
|
+
children: [1, 2].map((e) => /* @__PURE__ */ d("div", { className: "h-16 border border-border-subtle rounded-lg bg-bg-sunken animate-pulse" }, e))
|
|
531
|
+
}) : Q.length === 0 && !F ? /* @__PURE__ */ d(le, {
|
|
520
532
|
illustration: "empty-generic",
|
|
521
533
|
title: "No payout accounts yet",
|
|
522
534
|
description: "Add a bank account or UPI to receive your withdrawn credits.",
|
|
523
|
-
action: /* @__PURE__ */
|
|
535
|
+
action: /* @__PURE__ */ d("button", {
|
|
524
536
|
type: "button",
|
|
525
|
-
onClick: () =>
|
|
537
|
+
onClick: () => I(!0),
|
|
526
538
|
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",
|
|
527
539
|
children: "Add a bank account or UPI"
|
|
528
540
|
})
|
|
529
|
-
}) : /* @__PURE__ */
|
|
541
|
+
}) : /* @__PURE__ */ d("div", {
|
|
530
542
|
className: "space-y-2",
|
|
531
|
-
children:
|
|
543
|
+
children: Q.map((e) => /* @__PURE__ */ d("button", {
|
|
532
544
|
type: "button",
|
|
533
|
-
onClick: () =>
|
|
534
|
-
className: `w-full text-left p-4 border rounded-lg transition-colors ${
|
|
535
|
-
children: /* @__PURE__ */
|
|
545
|
+
onClick: () => T(e.id),
|
|
546
|
+
className: `w-full text-left p-4 border rounded-lg transition-colors ${w === e.id ? "border-border-strong bg-[var(--color-accent-soft)]" : "border-border-subtle bg-bg-surface hover:border-border-strong"}`,
|
|
547
|
+
children: /* @__PURE__ */ f("div", {
|
|
536
548
|
className: "flex items-center justify-between",
|
|
537
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
|
|
538
550
|
className: "text-sm font-medium text-text-primary",
|
|
539
551
|
children: e.label
|
|
540
|
-
}), /* @__PURE__ */
|
|
552
|
+
}), /* @__PURE__ */ f("p", {
|
|
541
553
|
className: "text-xs text-text-secondary mt-0.5",
|
|
542
554
|
children: [
|
|
543
555
|
e.type.replaceAll("_", " "),
|
|
@@ -545,23 +557,23 @@ var de = () => {
|
|
|
545
557
|
e.accountLast4 ? ` ···${e.accountLast4}` : "",
|
|
546
558
|
e.country ? ` · ${e.country}` : ""
|
|
547
559
|
]
|
|
548
|
-
})] }), /* @__PURE__ */
|
|
560
|
+
})] }), /* @__PURE__ */ f("div", {
|
|
549
561
|
className: "flex items-center gap-2",
|
|
550
562
|
children: [
|
|
551
|
-
e.isDefault && /* @__PURE__ */
|
|
563
|
+
e.isDefault && /* @__PURE__ */ d("span", {
|
|
552
564
|
className: "text-xs px-2 py-0.5 rounded bg-[var(--color-accent-soft)] text-text-link font-medium",
|
|
553
565
|
children: "Default"
|
|
554
566
|
}),
|
|
555
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ d("span", {
|
|
556
568
|
className: `text-xs px-2 py-0.5 rounded font-medium ${e.status === "ACTIVE" ? `${t.success.bg} ${t.success.text}` : e.status === "PENDING_VERIFICATION" ? `${t.warning.bg} ${t.warning.text}` : `${t.error.bg} ${t.error.text}`}`,
|
|
557
569
|
children: e.status.replaceAll("_", " ").toLowerCase()
|
|
558
570
|
}),
|
|
559
|
-
|
|
571
|
+
w === e.id && /* @__PURE__ */ d("svg", {
|
|
560
572
|
className: "size-4 text-text-link shrink-0",
|
|
561
573
|
fill: "none",
|
|
562
574
|
viewBox: "0 0 24 24",
|
|
563
575
|
stroke: "currentColor",
|
|
564
|
-
children: /* @__PURE__ */
|
|
576
|
+
children: /* @__PURE__ */ d("path", {
|
|
565
577
|
strokeLinecap: "round",
|
|
566
578
|
strokeLinejoin: "round",
|
|
567
579
|
strokeWidth: 2,
|
|
@@ -574,50 +586,50 @@ var de = () => {
|
|
|
574
586
|
}, e.id))
|
|
575
587
|
})
|
|
576
588
|
]
|
|
577
|
-
}), /* @__PURE__ */
|
|
589
|
+
}), /* @__PURE__ */ f("div", {
|
|
578
590
|
className: "space-y-4",
|
|
579
|
-
children: [/* @__PURE__ */
|
|
591
|
+
children: [/* @__PURE__ */ d("h2", {
|
|
580
592
|
className: "text-base font-semibold text-text-primary",
|
|
581
593
|
children: "Request Withdrawal"
|
|
582
|
-
}), /* @__PURE__ */
|
|
594
|
+
}), /* @__PURE__ */ f("div", {
|
|
583
595
|
className: "border border-border-subtle rounded-lg p-5 bg-bg-surface space-y-4",
|
|
584
596
|
children: [
|
|
585
|
-
/* @__PURE__ */
|
|
586
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ f("div", { children: [
|
|
598
|
+
/* @__PURE__ */ d("label", {
|
|
587
599
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
588
600
|
children: "Credits to Withdraw"
|
|
589
601
|
}),
|
|
590
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ d("input", {
|
|
591
603
|
type: "number",
|
|
592
604
|
min: 1,
|
|
593
|
-
max:
|
|
605
|
+
max: X,
|
|
594
606
|
step: 1,
|
|
595
|
-
value:
|
|
596
|
-
onChange: (e) =>
|
|
607
|
+
value: E,
|
|
608
|
+
onChange: (e) => D(e.target.value),
|
|
597
609
|
placeholder: "Enter credit amount",
|
|
598
610
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
599
611
|
}),
|
|
600
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ f("p", {
|
|
601
613
|
className: "text-xs text-text-secondary mt-1",
|
|
602
614
|
children: [
|
|
603
615
|
"Max withdrawable:",
|
|
604
616
|
" ",
|
|
605
|
-
/* @__PURE__ */
|
|
617
|
+
/* @__PURE__ */ f("span", {
|
|
606
618
|
className: "font-medium",
|
|
607
|
-
children: [
|
|
619
|
+
children: [X.toLocaleString(), " credits"]
|
|
608
620
|
})
|
|
609
621
|
]
|
|
610
622
|
}),
|
|
611
|
-
|
|
623
|
+
Y > 0 && Y <= X + Z && /* @__PURE__ */ d("p", {
|
|
612
624
|
className: "text-xs text-text-secondary mt-1",
|
|
613
|
-
children:
|
|
625
|
+
children: Ne ? "Calculating…" : Pe == null ? null : /* @__PURE__ */ f(u, { children: [
|
|
614
626
|
"Estimated payout:",
|
|
615
627
|
" ",
|
|
616
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ d("span", {
|
|
617
629
|
className: "font-semibold text-text-primary",
|
|
618
|
-
children:
|
|
630
|
+
children: Pe.toLocaleString(void 0, {
|
|
619
631
|
style: "currency",
|
|
620
|
-
currency:
|
|
632
|
+
currency: J,
|
|
621
633
|
minimumFractionDigits: 2,
|
|
622
634
|
maximumFractionDigits: 2
|
|
623
635
|
})
|
|
@@ -626,70 +638,77 @@ var de = () => {
|
|
|
626
638
|
"at the current credit rate"
|
|
627
639
|
] })
|
|
628
640
|
}),
|
|
629
|
-
|
|
641
|
+
Y > 0 && Y > X + Z && /* @__PURE__ */ d("p", {
|
|
630
642
|
className: "text-xs text-status-error-text mt-1",
|
|
631
643
|
children: "Amount exceeds your withdrawable balance"
|
|
632
644
|
})
|
|
633
645
|
] }),
|
|
634
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("label", {
|
|
635
647
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
636
|
-
children: ["Notes ", /* @__PURE__ */
|
|
648
|
+
children: ["Notes ", /* @__PURE__ */ d("span", {
|
|
637
649
|
className: "text-text-secondary font-normal",
|
|
638
650
|
children: "(optional)"
|
|
639
651
|
})]
|
|
640
|
-
}), /* @__PURE__ */
|
|
641
|
-
value:
|
|
642
|
-
onChange: (e) =>
|
|
652
|
+
}), /* @__PURE__ */ d("textarea", {
|
|
653
|
+
value: O,
|
|
654
|
+
onChange: (e) => k(e.target.value),
|
|
643
655
|
placeholder: "Any notes for this withdrawal request",
|
|
644
656
|
rows: 2,
|
|
645
657
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none"
|
|
646
658
|
})] }),
|
|
647
|
-
|
|
659
|
+
M && /* @__PURE__ */ d("div", {
|
|
648
660
|
className: "p-3 rounded-button bg-status-error-bg-subtle border border-status-error-border",
|
|
649
|
-
children: /* @__PURE__ */
|
|
661
|
+
children: /* @__PURE__ */ d("p", {
|
|
650
662
|
className: "text-sm text-status-error-text",
|
|
651
|
-
children:
|
|
663
|
+
children: M
|
|
652
664
|
})
|
|
653
665
|
}),
|
|
654
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ f("div", {
|
|
655
667
|
className: "pt-1 border-t border-border-subtle",
|
|
656
|
-
children: [
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
668
|
+
children: [
|
|
669
|
+
/* @__PURE__ */ f("p", {
|
|
670
|
+
className: "text-xs text-text-secondary mb-3",
|
|
671
|
+
children: [
|
|
672
|
+
"Credits will be converted to ",
|
|
673
|
+
J,
|
|
674
|
+
" at the current credit rate. Withdrawals are reviewed before processing and may take 3–5 business days."
|
|
675
|
+
]
|
|
676
|
+
}),
|
|
677
|
+
$ && /* @__PURE__ */ d("p", {
|
|
678
|
+
className: "text-xs text-status-warning-text mb-2",
|
|
679
|
+
children: $
|
|
680
|
+
}),
|
|
681
|
+
/* @__PURE__ */ d("button", {
|
|
682
|
+
type: "button",
|
|
683
|
+
onClick: () => void je(),
|
|
684
|
+
disabled: A || !Fe || !w || Q.length === 0,
|
|
685
|
+
className: "w-full py-2.5 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",
|
|
686
|
+
children: A ? "Submitting…" : "Request Withdrawal"
|
|
687
|
+
})
|
|
688
|
+
]
|
|
670
689
|
})
|
|
671
690
|
]
|
|
672
691
|
})]
|
|
673
692
|
})]
|
|
674
693
|
}),
|
|
675
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ f("div", {
|
|
676
695
|
className: "space-y-3",
|
|
677
|
-
children: [/* @__PURE__ */
|
|
696
|
+
children: [/* @__PURE__ */ f("div", {
|
|
678
697
|
className: "flex items-center justify-between",
|
|
679
|
-
children: [/* @__PURE__ */
|
|
698
|
+
children: [/* @__PURE__ */ d("h2", {
|
|
680
699
|
className: "text-base font-semibold text-text-primary",
|
|
681
700
|
children: "Withdrawal History"
|
|
682
|
-
}), /* @__PURE__ */
|
|
701
|
+
}), /* @__PURE__ */ d("button", {
|
|
683
702
|
type: "button",
|
|
684
|
-
onClick: () => void
|
|
703
|
+
onClick: () => void q(),
|
|
685
704
|
className: "text-sm text-text-secondary hover:text-text-primary transition-colors",
|
|
686
705
|
"aria-label": "Refresh withdrawal history",
|
|
687
|
-
children: /* @__PURE__ */
|
|
706
|
+
children: /* @__PURE__ */ d("svg", {
|
|
688
707
|
className: "size-4",
|
|
689
708
|
fill: "none",
|
|
690
709
|
viewBox: "0 0 24 24",
|
|
691
710
|
stroke: "currentColor",
|
|
692
|
-
children: /* @__PURE__ */
|
|
711
|
+
children: /* @__PURE__ */ d("path", {
|
|
693
712
|
strokeLinecap: "round",
|
|
694
713
|
strokeLinejoin: "round",
|
|
695
714
|
strokeWidth: 2,
|
|
@@ -697,51 +716,51 @@ var de = () => {
|
|
|
697
716
|
})
|
|
698
717
|
})
|
|
699
718
|
})]
|
|
700
|
-
}),
|
|
719
|
+
}), De ? /* @__PURE__ */ d("div", {
|
|
701
720
|
className: "space-y-2",
|
|
702
721
|
children: [
|
|
703
722
|
1,
|
|
704
723
|
2,
|
|
705
724
|
3
|
|
706
|
-
].map((e) => /* @__PURE__ */
|
|
707
|
-
}) : C.length === 0 ? /* @__PURE__ */
|
|
725
|
+
].map((e) => /* @__PURE__ */ d("div", { className: "h-16 border border-border-subtle rounded-lg bg-bg-sunken animate-pulse" }, e))
|
|
726
|
+
}) : C.length === 0 ? /* @__PURE__ */ d(le, {
|
|
708
727
|
illustration: "empty-data",
|
|
709
728
|
title: "No withdrawal requests yet",
|
|
710
729
|
description: "Once you request a withdrawal, its status will appear here."
|
|
711
|
-
}) : /* @__PURE__ */
|
|
730
|
+
}) : /* @__PURE__ */ d("div", {
|
|
712
731
|
className: "border border-border-subtle rounded-lg overflow-hidden",
|
|
713
|
-
children: /* @__PURE__ */
|
|
732
|
+
children: /* @__PURE__ */ f("table", {
|
|
714
733
|
className: "w-full text-sm",
|
|
715
|
-
children: [/* @__PURE__ */
|
|
734
|
+
children: [/* @__PURE__ */ d("thead", {
|
|
716
735
|
className: "bg-bg-sunken border-b border-border-subtle",
|
|
717
|
-
children: /* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */
|
|
736
|
+
children: /* @__PURE__ */ f("tr", { children: [
|
|
737
|
+
/* @__PURE__ */ d("th", {
|
|
719
738
|
className: "text-left px-4 py-3 text-xs font-medium text-text-secondary uppercase tracking-wide",
|
|
720
739
|
children: "Amount"
|
|
721
740
|
}),
|
|
722
|
-
/* @__PURE__ */
|
|
741
|
+
/* @__PURE__ */ d("th", {
|
|
723
742
|
className: "text-left px-4 py-3 text-xs font-medium text-text-secondary uppercase tracking-wide",
|
|
724
743
|
children: "Status"
|
|
725
744
|
}),
|
|
726
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ d("th", {
|
|
727
746
|
className: "text-left px-4 py-3 text-xs font-medium text-text-secondary uppercase tracking-wide hidden sm:table-cell",
|
|
728
747
|
children: "Payout Account"
|
|
729
748
|
}),
|
|
730
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ d("th", {
|
|
731
750
|
className: "text-left px-4 py-3 text-xs font-medium text-text-secondary uppercase tracking-wide hidden md:table-cell",
|
|
732
751
|
children: "Requested"
|
|
733
752
|
}),
|
|
734
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ d("th", {
|
|
735
754
|
className: "text-left px-4 py-3 text-xs font-medium text-text-secondary uppercase tracking-wide hidden md:table-cell",
|
|
736
755
|
children: "Completed"
|
|
737
756
|
})
|
|
738
757
|
] })
|
|
739
|
-
}), /* @__PURE__ */
|
|
758
|
+
}), /* @__PURE__ */ d("tbody", {
|
|
740
759
|
className: "divide-y divide-border-subtle",
|
|
741
|
-
children: C.map((e) => /* @__PURE__ */
|
|
760
|
+
children: C.map((e) => /* @__PURE__ */ f("tr", {
|
|
742
761
|
className: "hover:bg-bg-sunken transition-colors",
|
|
743
762
|
children: [
|
|
744
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ f("td", {
|
|
745
764
|
className: "px-4 py-3 font-medium text-text-primary",
|
|
746
765
|
children: [
|
|
747
766
|
e.requestedAmount.toLocaleString(),
|
|
@@ -749,32 +768,32 @@ var de = () => {
|
|
|
749
768
|
e.currency
|
|
750
769
|
]
|
|
751
770
|
}),
|
|
752
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ f("td", {
|
|
753
772
|
className: "px-4 py-3",
|
|
754
|
-
children: [/* @__PURE__ */
|
|
755
|
-
className: `inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${
|
|
773
|
+
children: [/* @__PURE__ */ d("span", {
|
|
774
|
+
className: `inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${he(e.status)}`,
|
|
756
775
|
children: e.status.charAt(0) + e.status.slice(1).toLowerCase()
|
|
757
|
-
}), e.failureReason && /* @__PURE__ */
|
|
776
|
+
}), e.failureReason && /* @__PURE__ */ d("p", {
|
|
758
777
|
className: "text-xs text-status-error-text mt-0.5 max-w-[180px] truncate",
|
|
759
778
|
title: e.failureReason,
|
|
760
779
|
children: e.failureReason
|
|
761
780
|
})]
|
|
762
781
|
}),
|
|
763
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ d("td", {
|
|
764
783
|
className: "px-4 py-3 text-text-secondary hidden sm:table-cell",
|
|
765
|
-
children: e.payoutAccount ? /* @__PURE__ */
|
|
784
|
+
children: e.payoutAccount ? /* @__PURE__ */ f("span", { children: [e.payoutAccount.label, e.payoutAccount.accountLast4 ? ` ···${e.payoutAccount.accountLast4}` : ""] }) : "—"
|
|
766
785
|
}),
|
|
767
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ d("td", {
|
|
768
787
|
className: "px-4 py-3 text-text-secondary hidden md:table-cell",
|
|
769
|
-
children: /* @__PURE__ */
|
|
788
|
+
children: /* @__PURE__ */ d("span", {
|
|
770
789
|
title: r(e.createdAt, "long"),
|
|
771
790
|
children: i(e.createdAt)
|
|
772
791
|
})
|
|
773
792
|
}),
|
|
774
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ d("td", {
|
|
775
794
|
className: "px-4 py-3 text-text-secondary hidden md:table-cell",
|
|
776
|
-
children: e.paidAt ? /* @__PURE__ */
|
|
777
|
-
className:
|
|
795
|
+
children: e.paidAt ? /* @__PURE__ */ d("span", {
|
|
796
|
+
className: me("PAID"),
|
|
778
797
|
children: r(e.paidAt, "short")
|
|
779
798
|
}) : "—"
|
|
780
799
|
})
|
|
@@ -788,6 +807,6 @@ var de = () => {
|
|
|
788
807
|
});
|
|
789
808
|
};
|
|
790
809
|
//#endregion
|
|
791
|
-
export {
|
|
810
|
+
export { m as CreditWithdrawalPage };
|
|
792
811
|
|
|
793
812
|
//# sourceMappingURL=CreditWithdrawalPage.js.map
|