@cedros/login-react 0.0.46 → 0.0.48
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/README.md +32 -2
- package/dist/AdminWithdrawalHistory-CgYehfMH.js +948 -0
- package/dist/AdminWithdrawalHistory-CgYehfMH.js.map +1 -0
- package/dist/AdminWithdrawalHistory-zDUhPDNi.cjs +1 -0
- package/dist/AdminWithdrawalHistory-zDUhPDNi.cjs.map +1 -0
- package/dist/EmailRegisterForm-ByYQ43yL.cjs +1 -0
- package/dist/EmailRegisterForm-ByYQ43yL.cjs.map +1 -0
- package/dist/EmailRegisterForm-DMUcNQT-.js +781 -0
- package/dist/EmailRegisterForm-DMUcNQT-.js.map +1 -0
- package/dist/GoogleLoginButton-DEwtBp56.cjs +1 -0
- package/dist/GoogleLoginButton-DEwtBp56.cjs.map +1 -0
- package/dist/{GoogleLoginButton-C1WNu7W3.js → GoogleLoginButton-DwyxvhnL.js} +82 -80
- package/dist/GoogleLoginButton-DwyxvhnL.js.map +1 -0
- package/dist/{PermissionsSection-mm9hfp-u.js → PermissionsSection-0oNHPZzL.js} +383 -415
- package/dist/PermissionsSection-0oNHPZzL.js.map +1 -0
- package/dist/PermissionsSection-CZsJuxo4.cjs +1 -0
- package/dist/PermissionsSection-CZsJuxo4.cjs.map +1 -0
- package/dist/SolanaLoginButton-2504p6cr.cjs +1 -0
- package/dist/SolanaLoginButton-2504p6cr.cjs.map +1 -0
- package/dist/SolanaLoginButton-C7Kc_m6n.js +234 -0
- package/dist/SolanaLoginButton-C7Kc_m6n.js.map +1 -0
- package/dist/{TeamSection-Km7EwLWD.cjs → TeamSection-DN8PEHH3.cjs} +1 -1
- package/dist/{TeamSection-Km7EwLWD.cjs.map → TeamSection-DN8PEHH3.cjs.map} +1 -1
- package/dist/{TeamSection-C_eODdLU.js → TeamSection-gUyP4YDM.js} +1 -1
- package/dist/{TeamSection-C_eODdLU.js.map → TeamSection-gUyP4YDM.js.map} +1 -1
- package/dist/{UsersSection-C1Tt0ePx.cjs → UsersSection-8wLuD0fr.cjs} +1 -1
- package/dist/{UsersSection-C1Tt0ePx.cjs.map → UsersSection-8wLuD0fr.cjs.map} +1 -1
- package/dist/{UsersSection-Ct_E-MBF.js → UsersSection-CnsFrG-6.js} +1 -1
- package/dist/{UsersSection-Ct_E-MBF.js.map → UsersSection-CnsFrG-6.js.map} +1 -1
- package/dist/{WithdrawalsSection-BN-FjTEV.js → WithdrawalsSection-BCG_-DAP.js} +1 -1
- package/dist/{WithdrawalsSection-BN-FjTEV.js.map → WithdrawalsSection-BCG_-DAP.js.map} +1 -1
- package/dist/{WithdrawalsSection-BhuCwFat.cjs → WithdrawalsSection-DKpL2mt8.cjs} +1 -1
- package/dist/{WithdrawalsSection-BhuCwFat.cjs.map → WithdrawalsSection-DKpL2mt8.cjs.map} +1 -1
- package/dist/admin-only.cjs +1 -1
- package/dist/admin-only.js +1 -1
- package/dist/email-only.cjs +1 -1
- package/dist/email-only.d.ts +10 -2
- package/dist/email-only.js +2 -2
- package/dist/google-only.cjs +1 -1
- package/dist/google-only.d.ts +7 -2
- package/dist/google-only.js +2 -2
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +182 -11
- package/dist/index.js +5000 -4409
- package/dist/index.js.map +1 -1
- package/dist/login-react.css +1 -1
- package/dist/{plugin-Ci67QMGG.cjs → plugin-C7dru1t-.cjs} +1 -1
- package/dist/{plugin-Ci67QMGG.cjs.map → plugin-C7dru1t-.cjs.map} +1 -1
- package/dist/{plugin-Cm8Q6O4-.js → plugin-DivbaxSZ.js} +1 -1
- package/dist/{plugin-Cm8Q6O4-.js.map → plugin-DivbaxSZ.js.map} +1 -1
- package/dist/solana-only.cjs +1 -1
- package/dist/solana-only.d.ts +6 -1
- package/dist/solana-only.js +2 -2
- package/dist/useAuth-2vgrAH-M.cjs +1 -0
- package/dist/useAuth-2vgrAH-M.cjs.map +1 -0
- package/dist/{useAuth-l-itM5am.js → useAuth-CNflw856.js} +465 -469
- package/dist/useAuth-CNflw856.js.map +1 -0
- package/dist/useServerFeatures-9_aNPaa6.cjs +1 -0
- package/dist/useServerFeatures-9_aNPaa6.cjs.map +1 -0
- package/dist/useServerFeatures-DSkYdan-.js +82 -0
- package/dist/useServerFeatures-DSkYdan-.js.map +1 -0
- package/dist/{useUsersStatsSummary-BGeh3RnI.js → useUsersStatsSummary-B4_RBEYy.js} +504 -442
- package/dist/useUsersStatsSummary-B4_RBEYy.js.map +1 -0
- package/dist/useUsersStatsSummary-CHRMrlk4.cjs +1 -0
- package/dist/useUsersStatsSummary-CHRMrlk4.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/AdminWithdrawalHistory-B2EY2ZmH.cjs +0 -1
- package/dist/AdminWithdrawalHistory-B2EY2ZmH.cjs.map +0 -1
- package/dist/AdminWithdrawalHistory-C76bkbjX.js +0 -916
- package/dist/AdminWithdrawalHistory-C76bkbjX.js.map +0 -1
- package/dist/EmailRegisterForm-p2X5QP58.js +0 -750
- package/dist/EmailRegisterForm-p2X5QP58.js.map +0 -1
- package/dist/EmailRegisterForm-xFb6MaVA.cjs +0 -1
- package/dist/EmailRegisterForm-xFb6MaVA.cjs.map +0 -1
- package/dist/GoogleLoginButton-2zNTIKMm.cjs +0 -1
- package/dist/GoogleLoginButton-2zNTIKMm.cjs.map +0 -1
- package/dist/GoogleLoginButton-C1WNu7W3.js.map +0 -1
- package/dist/PermissionsSection-4zcE9Zs9.cjs +0 -1
- package/dist/PermissionsSection-4zcE9Zs9.cjs.map +0 -1
- package/dist/PermissionsSection-mm9hfp-u.js.map +0 -1
- package/dist/SolanaLoginButton-CqdzSSeJ.cjs +0 -1
- package/dist/SolanaLoginButton-CqdzSSeJ.cjs.map +0 -1
- package/dist/SolanaLoginButton-CyeX35eU.js +0 -232
- package/dist/SolanaLoginButton-CyeX35eU.js.map +0 -1
- package/dist/sanitization-Bo_tn-L2.cjs +0 -1
- package/dist/sanitization-Bo_tn-L2.cjs.map +0 -1
- package/dist/sanitization-CQ-H1MSg.js +0 -39
- package/dist/sanitization-CQ-H1MSg.js.map +0 -1
- package/dist/useAuth-B1yS_YiD.cjs +0 -1
- package/dist/useAuth-B1yS_YiD.cjs.map +0 -1
- package/dist/useAuth-l-itM5am.js.map +0 -1
- package/dist/useUsersStatsSummary-BGeh3RnI.js.map +0 -1
- package/dist/useUsersStatsSummary-DnsYtFGX.cjs +0 -1
- package/dist/useUsersStatsSummary-DnsYtFGX.cjs.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as V } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { A as Ze, h as
|
|
2
|
+
import { useState as g, useMemo as re, useCallback as S, useEffect as I } from "react";
|
|
3
|
+
import { A as Ze, h as E, u as Ce } from "./useCedrosLogin-CFfID-0i.js";
|
|
4
4
|
import { u as ze } from "./useSystemSettings-rgskaDqP.js";
|
|
5
5
|
class Se {
|
|
6
6
|
client;
|
|
7
|
-
constructor(s,
|
|
8
|
-
this.client = new Ze({ baseUrl: s, timeoutMs:
|
|
7
|
+
constructor(s, a, n, o) {
|
|
8
|
+
this.client = new Ze({ baseUrl: s, timeoutMs: a, retryAttempts: n, getAccessToken: o });
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* List all users in the system
|
|
12
12
|
*/
|
|
13
13
|
async listUsers(s) {
|
|
14
14
|
try {
|
|
15
|
-
const
|
|
16
|
-
s?.limit &&
|
|
17
|
-
const
|
|
18
|
-
return await this.client.get(
|
|
19
|
-
} catch (
|
|
20
|
-
throw
|
|
15
|
+
const a = new URLSearchParams();
|
|
16
|
+
s?.limit && a.set("limit", String(s.limit)), s?.offset && a.set("offset", String(s.offset));
|
|
17
|
+
const n = a.toString(), o = `/admin/users${n ? `?${n}` : ""}`;
|
|
18
|
+
return await this.client.get(o);
|
|
19
|
+
} catch (a) {
|
|
20
|
+
throw E(a, "Failed to list users");
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -26,28 +26,28 @@ class Se {
|
|
|
26
26
|
async getUser(s) {
|
|
27
27
|
try {
|
|
28
28
|
return await this.client.get(`/admin/users/${s}`);
|
|
29
|
-
} catch (
|
|
30
|
-
throw
|
|
29
|
+
} catch (a) {
|
|
30
|
+
throw E(a, "Failed to get user");
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Set a user's system admin status
|
|
35
35
|
*/
|
|
36
|
-
async setSystemAdmin(s,
|
|
36
|
+
async setSystemAdmin(s, a) {
|
|
37
37
|
try {
|
|
38
|
-
await this.client.patch(`/admin/users/${s}/system-admin`, { isAdmin:
|
|
39
|
-
} catch (
|
|
40
|
-
throw
|
|
38
|
+
await this.client.patch(`/admin/users/${s}/system-admin`, { isAdmin: a });
|
|
39
|
+
} catch (n) {
|
|
40
|
+
throw E(n, "Failed to update system admin status");
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Update a user's profile
|
|
45
45
|
*/
|
|
46
|
-
async updateUser(s,
|
|
46
|
+
async updateUser(s, a) {
|
|
47
47
|
try {
|
|
48
|
-
return await this.client.patch(`/admin/users/${s}`,
|
|
49
|
-
} catch (
|
|
50
|
-
throw
|
|
48
|
+
return await this.client.patch(`/admin/users/${s}`, a);
|
|
49
|
+
} catch (n) {
|
|
50
|
+
throw E(n, "Failed to update user");
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -56,8 +56,8 @@ class Se {
|
|
|
56
56
|
async deleteUser(s) {
|
|
57
57
|
try {
|
|
58
58
|
await this.client.delete(`/admin/users/${s}`);
|
|
59
|
-
} catch (
|
|
60
|
-
throw
|
|
59
|
+
} catch (a) {
|
|
60
|
+
throw E(a, "Failed to delete user");
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
@@ -66,84 +66,84 @@ class Se {
|
|
|
66
66
|
async forcePasswordReset(s) {
|
|
67
67
|
try {
|
|
68
68
|
await this.client.post(`/admin/users/${s}/force-password-reset`, {});
|
|
69
|
-
} catch (
|
|
70
|
-
throw
|
|
69
|
+
} catch (a) {
|
|
70
|
+
throw E(a, "Failed to send password reset email");
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Adjust a user's credits
|
|
75
75
|
*/
|
|
76
|
-
async adjustCredits(s,
|
|
76
|
+
async adjustCredits(s, a) {
|
|
77
77
|
try {
|
|
78
|
-
await this.client.post(`/admin/users/${s}/credits`,
|
|
79
|
-
} catch (
|
|
80
|
-
throw
|
|
78
|
+
await this.client.post(`/admin/users/${s}/credits`, a);
|
|
79
|
+
} catch (n) {
|
|
80
|
+
throw E(n, "Failed to adjust credits");
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Get a user's deposit history
|
|
85
85
|
*/
|
|
86
|
-
async getUserDeposits(s,
|
|
86
|
+
async getUserDeposits(s, a) {
|
|
87
87
|
try {
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
return await this.client.get(
|
|
92
|
-
} catch (
|
|
93
|
-
throw
|
|
88
|
+
const n = new URLSearchParams();
|
|
89
|
+
a?.limit && n.set("limit", String(a.limit)), a?.offset && n.set("offset", String(a.offset));
|
|
90
|
+
const o = n.toString(), p = `/admin/users/${s}/deposits${o ? `?${o}` : ""}`;
|
|
91
|
+
return await this.client.get(p);
|
|
92
|
+
} catch (n) {
|
|
93
|
+
throw E(n, "Failed to get user deposits");
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* Get a user's credit stats and transaction history
|
|
98
98
|
*/
|
|
99
|
-
async getUserCredits(s,
|
|
99
|
+
async getUserCredits(s, a) {
|
|
100
100
|
try {
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
return await this.client.get(
|
|
105
|
-
} catch (
|
|
106
|
-
throw
|
|
101
|
+
const n = new URLSearchParams();
|
|
102
|
+
a?.limit && n.set("limit", String(a.limit)), a?.offset && n.set("offset", String(a.offset));
|
|
103
|
+
const o = n.toString(), p = `/admin/users/${s}/credits${o ? `?${o}` : ""}`;
|
|
104
|
+
return await this.client.get(p);
|
|
105
|
+
} catch (n) {
|
|
106
|
+
throw E(n, "Failed to get user credits");
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Get a user's withdrawal history
|
|
111
111
|
*/
|
|
112
|
-
async getUserWithdrawalHistory(s,
|
|
112
|
+
async getUserWithdrawalHistory(s, a) {
|
|
113
113
|
try {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
return await this.client.get(
|
|
118
|
-
} catch (
|
|
119
|
-
throw
|
|
114
|
+
const n = new URLSearchParams();
|
|
115
|
+
a?.limit && n.set("limit", String(a.limit)), a?.offset && n.set("offset", String(a.offset));
|
|
116
|
+
const o = n.toString(), p = `/admin/users/${s}/withdrawal-history${o ? `?${o}` : ""}`;
|
|
117
|
+
return await this.client.get(p);
|
|
118
|
+
} catch (n) {
|
|
119
|
+
throw E(n, "Failed to get user withdrawal history");
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
123
|
* Get a user's chat history (from cedros-pay)
|
|
124
124
|
* Only available when cedros-pay is enabled.
|
|
125
125
|
*/
|
|
126
|
-
async getUserChats(s,
|
|
126
|
+
async getUserChats(s, a) {
|
|
127
127
|
try {
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
return await this.client.get(
|
|
132
|
-
} catch (
|
|
133
|
-
throw
|
|
128
|
+
const n = new URLSearchParams();
|
|
129
|
+
a?.limit && n.set("limit", String(a.limit)), a?.offset && n.set("offset", String(a.offset));
|
|
130
|
+
const o = n.toString(), p = `/admin/users/${s}/chats${o ? `?${o}` : ""}`;
|
|
131
|
+
return await this.client.get(p);
|
|
132
|
+
} catch (n) {
|
|
133
|
+
throw E(n, "Failed to get user chat history");
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* Get the list of users directly referred by a given user
|
|
138
138
|
*/
|
|
139
|
-
async getUserReferrals(s,
|
|
139
|
+
async getUserReferrals(s, a) {
|
|
140
140
|
try {
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
return await this.client.get(
|
|
145
|
-
} catch (
|
|
146
|
-
throw
|
|
141
|
+
const n = new URLSearchParams();
|
|
142
|
+
a?.limit && n.set("limit", String(a.limit)), a?.offset && n.set("offset", String(a.offset));
|
|
143
|
+
const o = n.toString(), p = `/admin/users/${s}/referrals${o ? `?${o}` : ""}`;
|
|
144
|
+
return await this.client.get(p);
|
|
145
|
+
} catch (n) {
|
|
146
|
+
throw E(n, "Failed to get user referrals");
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
@@ -152,8 +152,8 @@ class Se {
|
|
|
152
152
|
async getUserKyc(s) {
|
|
153
153
|
try {
|
|
154
154
|
return await this.client.get(`/admin/users/${s}/kyc`);
|
|
155
|
-
} catch (
|
|
156
|
-
throw
|
|
155
|
+
} catch (a) {
|
|
156
|
+
throw E(a, "Failed to get user KYC data");
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
/**
|
|
@@ -162,11 +162,11 @@ class Se {
|
|
|
162
162
|
* @param userId - target user ID
|
|
163
163
|
* @param status - new status: "none" | "verified" | "failed"
|
|
164
164
|
*/
|
|
165
|
-
async overrideUserKyc(s,
|
|
165
|
+
async overrideUserKyc(s, a) {
|
|
166
166
|
try {
|
|
167
|
-
await this.client.post(`/admin/users/${s}/kyc/override`, { status:
|
|
168
|
-
} catch (
|
|
169
|
-
throw
|
|
167
|
+
await this.client.post(`/admin/users/${s}/kyc/override`, { status: a });
|
|
168
|
+
} catch (n) {
|
|
169
|
+
throw E(n, "Failed to override KYC status");
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
@@ -177,8 +177,8 @@ class Se {
|
|
|
177
177
|
return await this.client.get(
|
|
178
178
|
`/admin/users/${s}/accreditation`
|
|
179
179
|
);
|
|
180
|
-
} catch (
|
|
181
|
-
throw
|
|
180
|
+
} catch (a) {
|
|
181
|
+
throw E(a, "Failed to get user accreditation data");
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
/**
|
|
@@ -190,16 +190,16 @@ class Se {
|
|
|
190
190
|
* @param rejectionReason - required when approved is false
|
|
191
191
|
* @param expiryDays - override default expiry (approve only)
|
|
192
192
|
*/
|
|
193
|
-
async reviewAccreditation(s,
|
|
193
|
+
async reviewAccreditation(s, a, n, o, p) {
|
|
194
194
|
try {
|
|
195
195
|
await this.client.post(`/admin/accreditation/${s}/review`, {
|
|
196
|
-
approved:
|
|
197
|
-
reviewerNotes:
|
|
198
|
-
rejectionReason:
|
|
199
|
-
expiryDays:
|
|
196
|
+
approved: a,
|
|
197
|
+
reviewerNotes: n,
|
|
198
|
+
rejectionReason: o,
|
|
199
|
+
expiryDays: p
|
|
200
200
|
});
|
|
201
|
-
} catch (
|
|
202
|
-
throw
|
|
201
|
+
} catch (b) {
|
|
202
|
+
throw E(b, "Failed to review accreditation submission");
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
@@ -208,11 +208,11 @@ class Se {
|
|
|
208
208
|
* @param userId - target user ID
|
|
209
209
|
* @param status - new status: "none" | "approved" | "rejected"
|
|
210
210
|
*/
|
|
211
|
-
async overrideAccreditationStatus(s,
|
|
211
|
+
async overrideAccreditationStatus(s, a) {
|
|
212
212
|
try {
|
|
213
|
-
await this.client.post(`/admin/users/${s}/accreditation/override`, { status:
|
|
214
|
-
} catch (
|
|
215
|
-
throw
|
|
213
|
+
await this.client.post(`/admin/users/${s}/accreditation/override`, { status: a });
|
|
214
|
+
} catch (n) {
|
|
215
|
+
throw E(n, "Failed to override accreditation status");
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
@@ -222,7 +222,7 @@ class Se {
|
|
|
222
222
|
try {
|
|
223
223
|
return await this.client.get("/admin/users/stats");
|
|
224
224
|
} catch (s) {
|
|
225
|
-
throw
|
|
225
|
+
throw E(s, "Failed to get user stats");
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
@@ -231,14 +231,14 @@ class Se {
|
|
|
231
231
|
* @param limit - page size (default 20)
|
|
232
232
|
* @param offset - pagination offset
|
|
233
233
|
*/
|
|
234
|
-
async listPendingAccreditations(s = 20,
|
|
234
|
+
async listPendingAccreditations(s = 20, a = 0) {
|
|
235
235
|
try {
|
|
236
|
-
const
|
|
237
|
-
return
|
|
238
|
-
`/admin/accreditation/pending?${
|
|
236
|
+
const n = new URLSearchParams();
|
|
237
|
+
return n.set("limit", String(s)), n.set("offset", String(a)), await this.client.get(
|
|
238
|
+
`/admin/accreditation/pending?${n.toString()}`
|
|
239
239
|
);
|
|
240
|
-
} catch (
|
|
241
|
-
throw
|
|
240
|
+
} catch (n) {
|
|
241
|
+
throw E(n, "Failed to list pending accreditations");
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
@@ -251,8 +251,8 @@ class Se {
|
|
|
251
251
|
return await this.client.get(
|
|
252
252
|
`/admin/accreditation/${s}`
|
|
253
253
|
);
|
|
254
|
-
} catch (
|
|
255
|
-
throw
|
|
254
|
+
} catch (a) {
|
|
255
|
+
throw E(a, "Failed to get accreditation submission");
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
@@ -266,8 +266,8 @@ class Se {
|
|
|
266
266
|
return (await this.client.get(
|
|
267
267
|
`/admin/accreditation/documents/${s}/url`
|
|
268
268
|
)).url;
|
|
269
|
-
} catch (
|
|
270
|
-
throw
|
|
269
|
+
} catch (a) {
|
|
270
|
+
throw E(a, "Failed to get document URL");
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
@@ -277,7 +277,7 @@ class Se {
|
|
|
277
277
|
try {
|
|
278
278
|
return await this.client.get("/admin/sanctions/stats");
|
|
279
279
|
} catch (s) {
|
|
280
|
-
throw
|
|
280
|
+
throw E(s, "Failed to get sanctions stats");
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
/**
|
|
@@ -287,12 +287,74 @@ class Se {
|
|
|
287
287
|
try {
|
|
288
288
|
await this.client.post("/admin/sanctions/refresh", {});
|
|
289
289
|
} catch (s) {
|
|
290
|
-
throw
|
|
290
|
+
throw E(s, "Failed to refresh sanctions cache");
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
// ==========================================================================
|
|
294
|
+
// Signup gating / access codes
|
|
295
|
+
// ==========================================================================
|
|
296
|
+
/**
|
|
297
|
+
* Get signup stats for the current period.
|
|
298
|
+
*
|
|
299
|
+
* @returns count, limit, period, periodStart
|
|
300
|
+
*/
|
|
301
|
+
async getSignupStats() {
|
|
302
|
+
try {
|
|
303
|
+
return await this.client.get("/admin/signup-stats");
|
|
304
|
+
} catch (s) {
|
|
305
|
+
throw E(s, "Failed to get signup stats");
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* List access codes with optional type filter.
|
|
310
|
+
*
|
|
311
|
+
* @param limit - page size (default 20)
|
|
312
|
+
* @param offset - pagination offset (default 0)
|
|
313
|
+
* @param codeType - filter by type: 'limited' | 'user_invite' etc.
|
|
314
|
+
*/
|
|
315
|
+
async listAccessCodes(s = 20, a = 0, n) {
|
|
316
|
+
try {
|
|
317
|
+
const o = new URLSearchParams();
|
|
318
|
+
return o.set("limit", String(s)), o.set("offset", String(a)), n && o.set("type", n), await this.client.get(
|
|
319
|
+
`/admin/access-codes?${o.toString()}`
|
|
320
|
+
);
|
|
321
|
+
} catch (o) {
|
|
322
|
+
throw E(o, "Failed to list access codes");
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Create a new admin-managed access code.
|
|
327
|
+
*
|
|
328
|
+
* @param code - the code string
|
|
329
|
+
* @param maxUses - max redemptions (null for unlimited)
|
|
330
|
+
* @param expiresAt - optional ISO expiry timestamp
|
|
331
|
+
*/
|
|
332
|
+
async createAccessCode(s, a, n) {
|
|
333
|
+
try {
|
|
334
|
+
return await this.client.post("/admin/access-codes", {
|
|
335
|
+
code: s,
|
|
336
|
+
maxUses: a,
|
|
337
|
+
expiresAt: n
|
|
338
|
+
});
|
|
339
|
+
} catch (o) {
|
|
340
|
+
throw E(o, "Failed to create access code");
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Delete an access code by ID.
|
|
345
|
+
*
|
|
346
|
+
* @param id - access code UUID
|
|
347
|
+
*/
|
|
348
|
+
async deleteAccessCode(s) {
|
|
349
|
+
try {
|
|
350
|
+
await this.client.delete(`/admin/access-codes/${s}`);
|
|
351
|
+
} catch (a) {
|
|
352
|
+
throw E(a, "Failed to delete access code");
|
|
291
353
|
}
|
|
292
354
|
}
|
|
293
355
|
}
|
|
294
|
-
function
|
|
295
|
-
const { config: t, _internal: s } = Ce(), [
|
|
356
|
+
function be() {
|
|
357
|
+
const { config: t, _internal: s } = Ce(), [a, n] = g([]), [o, p] = g(0), [b, c] = g(!1), [d, f] = g(null), [$, L] = g({}), y = re(
|
|
296
358
|
() => new Se(
|
|
297
359
|
t.serverUrl,
|
|
298
360
|
t.requestTimeout,
|
|
@@ -300,161 +362,161 @@ function ve() {
|
|
|
300
362
|
s?.getAccessToken
|
|
301
363
|
),
|
|
302
364
|
[t.serverUrl, t.requestTimeout, t.retryAttempts, s]
|
|
303
|
-
),
|
|
304
|
-
async (
|
|
305
|
-
c(!0), f(null),
|
|
365
|
+
), F = S(
|
|
366
|
+
async (m) => {
|
|
367
|
+
c(!0), f(null), L(m || {});
|
|
306
368
|
try {
|
|
307
|
-
const i = await y.listUsers(
|
|
308
|
-
return
|
|
369
|
+
const i = await y.listUsers(m);
|
|
370
|
+
return n(i.users), p(i.total), i;
|
|
309
371
|
} catch (i) {
|
|
310
|
-
const
|
|
311
|
-
throw f(
|
|
372
|
+
const l = i instanceof Error ? i : new Error("Failed to list users");
|
|
373
|
+
throw f(l), l;
|
|
312
374
|
} finally {
|
|
313
375
|
c(!1);
|
|
314
376
|
}
|
|
315
377
|
},
|
|
316
378
|
[y]
|
|
317
379
|
), A = S(
|
|
318
|
-
async (
|
|
380
|
+
async (m) => {
|
|
319
381
|
c(!0), f(null);
|
|
320
382
|
try {
|
|
321
|
-
return await y.getUser(
|
|
383
|
+
return await y.getUser(m);
|
|
322
384
|
} catch (i) {
|
|
323
|
-
const
|
|
324
|
-
throw f(
|
|
385
|
+
const l = i instanceof Error ? i : new Error("Failed to get user");
|
|
386
|
+
throw f(l), l;
|
|
325
387
|
} finally {
|
|
326
388
|
c(!1);
|
|
327
389
|
}
|
|
328
390
|
},
|
|
329
391
|
[y]
|
|
330
|
-
),
|
|
331
|
-
async (
|
|
392
|
+
), U = S(
|
|
393
|
+
async (m, i) => {
|
|
332
394
|
c(!0), f(null);
|
|
333
395
|
try {
|
|
334
|
-
await y.setSystemAdmin(
|
|
335
|
-
(
|
|
396
|
+
await y.setSystemAdmin(m, i), n(
|
|
397
|
+
(l) => l.map((v) => v.id === m ? { ...v, isSystemAdmin: i } : v)
|
|
336
398
|
);
|
|
337
|
-
} catch (
|
|
338
|
-
const
|
|
339
|
-
throw f(
|
|
399
|
+
} catch (l) {
|
|
400
|
+
const v = l instanceof Error ? l : new Error("Failed to update admin status");
|
|
401
|
+
throw f(v), v;
|
|
340
402
|
} finally {
|
|
341
403
|
c(!1);
|
|
342
404
|
}
|
|
343
405
|
},
|
|
344
406
|
[y]
|
|
345
407
|
), R = S(
|
|
346
|
-
async (
|
|
408
|
+
async (m, i) => {
|
|
347
409
|
c(!0), f(null);
|
|
348
410
|
try {
|
|
349
|
-
const
|
|
350
|
-
return
|
|
351
|
-
} catch (
|
|
352
|
-
const
|
|
353
|
-
throw f(
|
|
411
|
+
const l = await y.updateUser(m, i);
|
|
412
|
+
return n((v) => v.map((q) => q.id === m ? l : q)), l;
|
|
413
|
+
} catch (l) {
|
|
414
|
+
const v = l instanceof Error ? l : new Error("Failed to update user");
|
|
415
|
+
throw f(v), v;
|
|
354
416
|
} finally {
|
|
355
417
|
c(!1);
|
|
356
418
|
}
|
|
357
419
|
},
|
|
358
420
|
[y]
|
|
359
421
|
), w = S(
|
|
360
|
-
async (
|
|
422
|
+
async (m) => {
|
|
361
423
|
c(!0), f(null);
|
|
362
424
|
try {
|
|
363
|
-
await y.deleteUser(
|
|
425
|
+
await y.deleteUser(m), n((i) => i.filter((l) => l.id !== m)), p((i) => i - 1);
|
|
364
426
|
} catch (i) {
|
|
365
|
-
const
|
|
366
|
-
throw f(
|
|
427
|
+
const l = i instanceof Error ? i : new Error("Failed to delete user");
|
|
428
|
+
throw f(l), l;
|
|
367
429
|
} finally {
|
|
368
430
|
c(!1);
|
|
369
431
|
}
|
|
370
432
|
},
|
|
371
433
|
[y]
|
|
372
434
|
), N = S(
|
|
373
|
-
async (
|
|
435
|
+
async (m) => {
|
|
374
436
|
c(!0), f(null);
|
|
375
437
|
try {
|
|
376
|
-
await y.forcePasswordReset(
|
|
438
|
+
await y.forcePasswordReset(m);
|
|
377
439
|
} catch (i) {
|
|
378
|
-
const
|
|
379
|
-
throw f(
|
|
440
|
+
const l = i instanceof Error ? i : new Error("Failed to send password reset");
|
|
441
|
+
throw f(l), l;
|
|
380
442
|
} finally {
|
|
381
443
|
c(!1);
|
|
382
444
|
}
|
|
383
445
|
},
|
|
384
446
|
[y]
|
|
385
447
|
), C = S(
|
|
386
|
-
async (
|
|
448
|
+
async (m, i, l) => {
|
|
387
449
|
c(!0), f(null);
|
|
388
450
|
try {
|
|
389
|
-
await y.adjustCredits(
|
|
390
|
-
} catch (
|
|
391
|
-
const q =
|
|
451
|
+
await y.adjustCredits(m, { amount: i, reason: l });
|
|
452
|
+
} catch (v) {
|
|
453
|
+
const q = v instanceof Error ? v : new Error("Failed to adjust credits");
|
|
392
454
|
throw f(q), q;
|
|
393
455
|
} finally {
|
|
394
456
|
c(!1);
|
|
395
457
|
}
|
|
396
458
|
},
|
|
397
459
|
[y]
|
|
398
|
-
),
|
|
399
|
-
async (
|
|
460
|
+
), P = S(
|
|
461
|
+
async (m, i) => {
|
|
400
462
|
c(!0), f(null);
|
|
401
463
|
try {
|
|
402
|
-
return await y.getUserDeposits(
|
|
403
|
-
} catch (
|
|
404
|
-
const
|
|
405
|
-
throw f(
|
|
464
|
+
return await y.getUserDeposits(m, i);
|
|
465
|
+
} catch (l) {
|
|
466
|
+
const v = l instanceof Error ? l : new Error("Failed to get user deposits");
|
|
467
|
+
throw f(v), v;
|
|
406
468
|
} finally {
|
|
407
469
|
c(!1);
|
|
408
470
|
}
|
|
409
471
|
},
|
|
410
472
|
[y]
|
|
411
473
|
), _ = S(
|
|
412
|
-
async (
|
|
474
|
+
async (m, i) => {
|
|
413
475
|
c(!0), f(null);
|
|
414
476
|
try {
|
|
415
|
-
return await y.getUserCredits(
|
|
416
|
-
} catch (
|
|
417
|
-
const
|
|
418
|
-
throw f(
|
|
477
|
+
return await y.getUserCredits(m, i);
|
|
478
|
+
} catch (l) {
|
|
479
|
+
const v = l instanceof Error ? l : new Error("Failed to get user credits");
|
|
480
|
+
throw f(v), v;
|
|
419
481
|
} finally {
|
|
420
482
|
c(!1);
|
|
421
483
|
}
|
|
422
484
|
},
|
|
423
485
|
[y]
|
|
424
486
|
), O = S(
|
|
425
|
-
async (
|
|
487
|
+
async (m, i) => {
|
|
426
488
|
c(!0), f(null);
|
|
427
489
|
try {
|
|
428
|
-
return await y.getUserWithdrawalHistory(
|
|
429
|
-
} catch (
|
|
430
|
-
const
|
|
431
|
-
throw f(
|
|
490
|
+
return await y.getUserWithdrawalHistory(m, i);
|
|
491
|
+
} catch (l) {
|
|
492
|
+
const v = l instanceof Error ? l : new Error("Failed to get user withdrawal history");
|
|
493
|
+
throw f(v), v;
|
|
432
494
|
} finally {
|
|
433
495
|
c(!1);
|
|
434
496
|
}
|
|
435
497
|
},
|
|
436
498
|
[y]
|
|
437
499
|
), x = S(
|
|
438
|
-
async (
|
|
500
|
+
async (m, i) => {
|
|
439
501
|
c(!0), f(null);
|
|
440
502
|
try {
|
|
441
|
-
return await y.getUserChats(
|
|
442
|
-
} catch (
|
|
443
|
-
const
|
|
444
|
-
throw f(
|
|
503
|
+
return await y.getUserChats(m, i);
|
|
504
|
+
} catch (l) {
|
|
505
|
+
const v = l instanceof Error ? l : new Error("Failed to get user chat history");
|
|
506
|
+
throw f(v), v;
|
|
445
507
|
} finally {
|
|
446
508
|
c(!1);
|
|
447
509
|
}
|
|
448
510
|
},
|
|
449
511
|
[y]
|
|
450
512
|
), M = S(
|
|
451
|
-
async (
|
|
513
|
+
async (m, i) => {
|
|
452
514
|
c(!0), f(null);
|
|
453
515
|
try {
|
|
454
|
-
return await y.getUserReferrals(
|
|
455
|
-
} catch (
|
|
456
|
-
const
|
|
457
|
-
throw f(
|
|
516
|
+
return await y.getUserReferrals(m, i);
|
|
517
|
+
} catch (l) {
|
|
518
|
+
const v = l instanceof Error ? l : new Error("Failed to get user referrals");
|
|
519
|
+
throw f(v), v;
|
|
458
520
|
} finally {
|
|
459
521
|
c(!1);
|
|
460
522
|
}
|
|
@@ -464,30 +526,30 @@ function ve() {
|
|
|
464
526
|
c(!0), f(null);
|
|
465
527
|
try {
|
|
466
528
|
return await y.getStats();
|
|
467
|
-
} catch (
|
|
468
|
-
const i =
|
|
529
|
+
} catch (m) {
|
|
530
|
+
const i = m instanceof Error ? m : new Error("Failed to get user stats");
|
|
469
531
|
throw f(i), i;
|
|
470
532
|
} finally {
|
|
471
533
|
c(!1);
|
|
472
534
|
}
|
|
473
535
|
}, [y]), u = S(async () => {
|
|
474
|
-
await
|
|
475
|
-
}, [
|
|
536
|
+
await F($);
|
|
537
|
+
}, [F, $]), k = S(() => {
|
|
476
538
|
f(null);
|
|
477
539
|
}, []);
|
|
478
540
|
return {
|
|
479
|
-
users:
|
|
480
|
-
total:
|
|
481
|
-
isLoading:
|
|
482
|
-
error:
|
|
483
|
-
listUsers:
|
|
541
|
+
users: a,
|
|
542
|
+
total: o,
|
|
543
|
+
isLoading: b,
|
|
544
|
+
error: d,
|
|
545
|
+
listUsers: F,
|
|
484
546
|
getUser: A,
|
|
485
|
-
setSystemAdmin:
|
|
547
|
+
setSystemAdmin: U,
|
|
486
548
|
updateUser: R,
|
|
487
549
|
deleteUser: w,
|
|
488
550
|
forcePasswordReset: N,
|
|
489
551
|
adjustCredits: C,
|
|
490
|
-
getUserDeposits:
|
|
552
|
+
getUserDeposits: P,
|
|
491
553
|
getUserCredits: _,
|
|
492
554
|
getUserWithdrawalHistory: O,
|
|
493
555
|
getUserChats: x,
|
|
@@ -513,42 +575,42 @@ function tt(t) {
|
|
|
513
575
|
function St({
|
|
514
576
|
pageSize: t = 20,
|
|
515
577
|
refreshInterval: s = 0,
|
|
516
|
-
currentUserId:
|
|
517
|
-
className:
|
|
518
|
-
onLoad:
|
|
519
|
-
onUserClick:
|
|
578
|
+
currentUserId: a,
|
|
579
|
+
className: n = "",
|
|
580
|
+
onLoad: o,
|
|
581
|
+
onUserClick: p
|
|
520
582
|
}) {
|
|
521
|
-
const { users:
|
|
583
|
+
const { users: b, total: c, isLoading: d, error: f, listUsers: $, clearError: L } = be(), [y, F] = g(0), [A, U] = g(null), [R, w] = g("createdAt"), [N, C] = g("desc"), P = (u) => {
|
|
522
584
|
R === u ? C(N === "asc" ? "desc" : "asc") : (w(u), C("desc"));
|
|
523
|
-
}, _ = re(() => [...
|
|
524
|
-
let
|
|
585
|
+
}, _ = re(() => [...b].sort((u, k) => {
|
|
586
|
+
let m, i;
|
|
525
587
|
switch (R) {
|
|
526
588
|
case "name":
|
|
527
|
-
|
|
589
|
+
m = (u.name || u.email || "").toLowerCase(), i = (k.name || k.email || "").toLowerCase();
|
|
528
590
|
break;
|
|
529
591
|
case "createdAt":
|
|
530
|
-
|
|
592
|
+
m = new Date(u.createdAt).getTime(), i = new Date(k.createdAt).getTime();
|
|
531
593
|
break;
|
|
532
594
|
case "lastLoginAt":
|
|
533
|
-
|
|
595
|
+
m = u.lastLoginAt ? new Date(u.lastLoginAt).getTime() : 0, i = k.lastLoginAt ? new Date(k.lastLoginAt).getTime() : 0;
|
|
534
596
|
break;
|
|
535
597
|
case "balanceLamports":
|
|
536
|
-
|
|
598
|
+
m = u.balanceLamports ?? 0, i = k.balanceLamports ?? 0;
|
|
537
599
|
break;
|
|
538
600
|
default:
|
|
539
601
|
return 0;
|
|
540
602
|
}
|
|
541
|
-
return
|
|
542
|
-
}), [
|
|
603
|
+
return m < i ? N === "asc" ? -1 : 1 : m > i ? N === "asc" ? 1 : -1 : 0;
|
|
604
|
+
}), [b, R, N]), O = S(async () => {
|
|
543
605
|
try {
|
|
544
606
|
const u = await $({ limit: t, offset: y });
|
|
545
|
-
|
|
607
|
+
o?.(u), U(null);
|
|
546
608
|
} catch (u) {
|
|
547
|
-
|
|
609
|
+
U(u instanceof Error ? u.message : "Failed to load users");
|
|
548
610
|
}
|
|
549
|
-
}, [t, y, $,
|
|
611
|
+
}, [t, y, $, o]);
|
|
550
612
|
I(() => {
|
|
551
|
-
|
|
613
|
+
F(0);
|
|
552
614
|
}, [t]), I(() => {
|
|
553
615
|
O();
|
|
554
616
|
}, [O]), I(() => {
|
|
@@ -558,9 +620,9 @@ function St({
|
|
|
558
620
|
}, [s, O]);
|
|
559
621
|
const x = Math.ceil(c / t), M = Math.floor(y / t) + 1, K = (u) => {
|
|
560
622
|
const k = (u - 1) * t;
|
|
561
|
-
|
|
623
|
+
F(Math.max(0, Math.min(k, Math.max(0, c - 1))));
|
|
562
624
|
};
|
|
563
|
-
return A || f ? /* @__PURE__ */ r("div", { className: `cedros-admin-user-list cedros-admin-user-list-error ${
|
|
625
|
+
return A || f ? /* @__PURE__ */ r("div", { className: `cedros-admin-user-list cedros-admin-user-list-error ${n}`, children: [
|
|
564
626
|
/* @__PURE__ */ e("p", { className: "cedros-admin-error", children: A || f?.message }),
|
|
565
627
|
/* @__PURE__ */ e(
|
|
566
628
|
"button",
|
|
@@ -568,15 +630,15 @@ function St({
|
|
|
568
630
|
type: "button",
|
|
569
631
|
className: "cedros-button cedros-button-outline",
|
|
570
632
|
onClick: () => {
|
|
571
|
-
|
|
633
|
+
L(), U(null), O();
|
|
572
634
|
},
|
|
573
635
|
children: "Retry"
|
|
574
636
|
}
|
|
575
637
|
)
|
|
576
|
-
] }) :
|
|
638
|
+
] }) : d && b.length === 0 ? /* @__PURE__ */ r("div", { className: `cedros-admin-user-list cedros-admin-user-list-loading ${n}`, children: [
|
|
577
639
|
/* @__PURE__ */ e("span", { className: "cedros-admin-loading-indicator" }),
|
|
578
640
|
/* @__PURE__ */ e("span", { className: "cedros-admin-loading-text", children: "Loading users..." })
|
|
579
|
-
] }) : /* @__PURE__ */ r("div", { className: `cedros-admin-user-list ${
|
|
641
|
+
] }) : /* @__PURE__ */ r("div", { className: `cedros-admin-user-list ${n}`, children: [
|
|
580
642
|
/* @__PURE__ */ r("div", { className: "cedros-admin-user-list-header", children: [
|
|
581
643
|
/* @__PURE__ */ e("h4", { className: "cedros-admin-user-list-title", children: "All Users" }),
|
|
582
644
|
/* @__PURE__ */ r("div", { className: "cedros-admin-user-list-actions", children: [
|
|
@@ -591,15 +653,15 @@ function St({
|
|
|
591
653
|
type: "button",
|
|
592
654
|
className: "cedros-admin__stats-bar-refresh",
|
|
593
655
|
onClick: O,
|
|
594
|
-
disabled:
|
|
656
|
+
disabled: d,
|
|
595
657
|
title: "Refresh list",
|
|
596
658
|
"aria-label": "Refresh list",
|
|
597
|
-
children:
|
|
659
|
+
children: d ? "..." : "↻"
|
|
598
660
|
}
|
|
599
661
|
)
|
|
600
662
|
] })
|
|
601
663
|
] }),
|
|
602
|
-
|
|
664
|
+
b.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin-empty", children: /* @__PURE__ */ e("p", { className: "cedros-admin-empty-message", children: "No users found." }) }) : /* @__PURE__ */ r(V, { children: [
|
|
603
665
|
/* @__PURE__ */ r("div", { className: "cedros-admin-user-table", children: [
|
|
604
666
|
/* @__PURE__ */ r("div", { className: "cedros-admin-user-thead", children: [
|
|
605
667
|
/* @__PURE__ */ e("div", { className: "cedros-admin-user-th", children: /* @__PURE__ */ r(
|
|
@@ -607,7 +669,7 @@ function St({
|
|
|
607
669
|
{
|
|
608
670
|
type: "button",
|
|
609
671
|
className: `cedros-admin-sort-button ${R === "name" ? "cedros-admin-sort-active" : ""}`,
|
|
610
|
-
onClick: () =>
|
|
672
|
+
onClick: () => P("name"),
|
|
611
673
|
"aria-label": "Sort by user",
|
|
612
674
|
children: [
|
|
613
675
|
"User",
|
|
@@ -621,7 +683,7 @@ function St({
|
|
|
621
683
|
{
|
|
622
684
|
type: "button",
|
|
623
685
|
className: `cedros-admin-sort-button ${R === "createdAt" ? "cedros-admin-sort-active" : ""}`,
|
|
624
|
-
onClick: () =>
|
|
686
|
+
onClick: () => P("createdAt"),
|
|
625
687
|
"aria-label": "Sort by registered date",
|
|
626
688
|
children: [
|
|
627
689
|
"Registered",
|
|
@@ -635,7 +697,7 @@ function St({
|
|
|
635
697
|
{
|
|
636
698
|
type: "button",
|
|
637
699
|
className: `cedros-admin-sort-button ${R === "lastLoginAt" ? "cedros-admin-sort-active" : ""}`,
|
|
638
|
-
onClick: () =>
|
|
700
|
+
onClick: () => P("lastLoginAt"),
|
|
639
701
|
"aria-label": "Sort by last login",
|
|
640
702
|
children: [
|
|
641
703
|
"Last Login",
|
|
@@ -649,7 +711,7 @@ function St({
|
|
|
649
711
|
{
|
|
650
712
|
type: "button",
|
|
651
713
|
className: `cedros-admin-sort-button ${R === "balanceLamports" ? "cedros-admin-sort-active" : ""}`,
|
|
652
|
-
onClick: () =>
|
|
714
|
+
onClick: () => P("balanceLamports"),
|
|
653
715
|
"aria-label": "Sort by balance",
|
|
654
716
|
children: [
|
|
655
717
|
"Balance",
|
|
@@ -660,17 +722,17 @@ function St({
|
|
|
660
722
|
) })
|
|
661
723
|
] }),
|
|
662
724
|
_.map((u) => {
|
|
663
|
-
const k = u.id ===
|
|
725
|
+
const k = u.id === a;
|
|
664
726
|
return /* @__PURE__ */ r(
|
|
665
727
|
"div",
|
|
666
728
|
{
|
|
667
729
|
className: `cedros-admin-user-row ${k ? "cedros-admin-user-row-current" : ""}`,
|
|
668
|
-
onClick: () =>
|
|
669
|
-
onKeyDown: (
|
|
670
|
-
(
|
|
730
|
+
onClick: () => p?.(u),
|
|
731
|
+
onKeyDown: (m) => {
|
|
732
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), p?.(u));
|
|
671
733
|
},
|
|
672
|
-
role:
|
|
673
|
-
tabIndex:
|
|
734
|
+
role: p ? "button" : void 0,
|
|
735
|
+
tabIndex: p ? 0 : void 0,
|
|
674
736
|
children: [
|
|
675
737
|
/* @__PURE__ */ r("div", { className: "cedros-admin-user-td cedros-admin-user-info", children: [
|
|
676
738
|
/* @__PURE__ */ e("div", { className: "cedros-admin-user-avatar", children: u.picture ? /* @__PURE__ */ e(
|
|
@@ -733,7 +795,7 @@ function St({
|
|
|
733
795
|
] })
|
|
734
796
|
] });
|
|
735
797
|
}
|
|
736
|
-
function
|
|
798
|
+
function pe(t) {
|
|
737
799
|
return new Date(t).toLocaleDateString(void 0, {
|
|
738
800
|
year: "numeric",
|
|
739
801
|
month: "short",
|
|
@@ -780,14 +842,14 @@ function at(t, s) {
|
|
|
780
842
|
REFUND: "Credit refunded"
|
|
781
843
|
}[t.toUpperCase()] || "—";
|
|
782
844
|
}
|
|
783
|
-
function ae({ currentPage: t, totalPages: s, total:
|
|
845
|
+
function ae({ currentPage: t, totalPages: s, total: a, onPageChange: n }) {
|
|
784
846
|
return /* @__PURE__ */ r("div", { className: "cedros-admin-pagination", children: [
|
|
785
847
|
/* @__PURE__ */ e(
|
|
786
848
|
"button",
|
|
787
849
|
{
|
|
788
850
|
type: "button",
|
|
789
851
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
790
|
-
onClick: () =>
|
|
852
|
+
onClick: () => n(t - 1),
|
|
791
853
|
disabled: t <= 1,
|
|
792
854
|
children: "Previous"
|
|
793
855
|
}
|
|
@@ -798,7 +860,7 @@ function ae({ currentPage: t, totalPages: s, total: n, onPageChange: a }) {
|
|
|
798
860
|
" of ",
|
|
799
861
|
s,
|
|
800
862
|
" (",
|
|
801
|
-
|
|
863
|
+
a,
|
|
802
864
|
" total)"
|
|
803
865
|
] }),
|
|
804
866
|
/* @__PURE__ */ e(
|
|
@@ -806,7 +868,7 @@ function ae({ currentPage: t, totalPages: s, total: n, onPageChange: a }) {
|
|
|
806
868
|
{
|
|
807
869
|
type: "button",
|
|
808
870
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
809
|
-
onClick: () =>
|
|
871
|
+
onClick: () => n(t + 1),
|
|
810
872
|
disabled: t >= s,
|
|
811
873
|
children: "Next"
|
|
812
874
|
}
|
|
@@ -816,15 +878,15 @@ function ae({ currentPage: t, totalPages: s, total: n, onPageChange: a }) {
|
|
|
816
878
|
function nt({
|
|
817
879
|
deposits: t,
|
|
818
880
|
total: s,
|
|
819
|
-
currentPage:
|
|
820
|
-
totalPages:
|
|
821
|
-
onPageChange:
|
|
822
|
-
isLoading:
|
|
823
|
-
error:
|
|
881
|
+
currentPage: a,
|
|
882
|
+
totalPages: n,
|
|
883
|
+
onPageChange: o,
|
|
884
|
+
isLoading: p,
|
|
885
|
+
error: b,
|
|
824
886
|
onRetry: c
|
|
825
887
|
}) {
|
|
826
|
-
return
|
|
827
|
-
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children:
|
|
888
|
+
return b ? /* @__PURE__ */ r("div", { className: "cedros-admin-tab-error", children: [
|
|
889
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children: b }),
|
|
828
890
|
/* @__PURE__ */ e(
|
|
829
891
|
"button",
|
|
830
892
|
{
|
|
@@ -834,7 +896,7 @@ function nt({
|
|
|
834
896
|
children: "Retry"
|
|
835
897
|
}
|
|
836
898
|
)
|
|
837
|
-
] }) :
|
|
899
|
+
] }) : p && t.length === 0 ? /* @__PURE__ */ r("div", { className: "cedros-admin-tab-loading", children: [
|
|
838
900
|
/* @__PURE__ */ e("span", { className: "cedros-admin-loading-indicator" }),
|
|
839
901
|
/* @__PURE__ */ e("span", { children: "Loading deposits..." })
|
|
840
902
|
] }) : s === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin-empty-message", children: "No deposits found." }) : /* @__PURE__ */ r(V, { children: [
|
|
@@ -845,19 +907,19 @@ function nt({
|
|
|
845
907
|
/* @__PURE__ */ e("div", { className: "cedros-admin-list-th", children: "Status" }),
|
|
846
908
|
/* @__PURE__ */ e("div", { className: "cedros-admin-list-th", children: "Transaction" })
|
|
847
909
|
] }),
|
|
848
|
-
t.map((
|
|
849
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: j(
|
|
850
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: st(
|
|
851
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: /* @__PURE__ */ e("span", { className: `cedros-admin-status-badge cedros-admin-status-${
|
|
852
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td cedros-admin-list-td-actions", children:
|
|
853
|
-
/* @__PURE__ */ r("span", { className: "cedros-admin-list-td-mono", title:
|
|
854
|
-
|
|
910
|
+
t.map((d) => /* @__PURE__ */ r("div", { className: "cedros-admin-list-row", children: [
|
|
911
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: j(d.createdAt) }),
|
|
912
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: st(d.amountLamports) }),
|
|
913
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: /* @__PURE__ */ e("span", { className: `cedros-admin-status-badge cedros-admin-status-${d.status}`, children: d.status }) }),
|
|
914
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td cedros-admin-list-td-actions", children: d.txSignature ? /* @__PURE__ */ r(V, { children: [
|
|
915
|
+
/* @__PURE__ */ r("span", { className: "cedros-admin-list-td-mono", title: d.txSignature, children: [
|
|
916
|
+
d.txSignature.slice(0, 8),
|
|
855
917
|
"..."
|
|
856
918
|
] }),
|
|
857
919
|
/* @__PURE__ */ e(
|
|
858
920
|
"a",
|
|
859
921
|
{
|
|
860
|
-
href: `https://orbmarkets.io/tx/${
|
|
922
|
+
href: `https://orbmarkets.io/tx/${d.txSignature}`,
|
|
861
923
|
target: "_blank",
|
|
862
924
|
rel: "noopener noreferrer",
|
|
863
925
|
className: "cedros-admin-icon-link",
|
|
@@ -867,15 +929,15 @@ function nt({
|
|
|
867
929
|
}
|
|
868
930
|
)
|
|
869
931
|
] }) : /* @__PURE__ */ e("span", { className: "cedros-admin-list-td-muted", children: "—" }) })
|
|
870
|
-
] },
|
|
932
|
+
] }, d.id))
|
|
871
933
|
] }),
|
|
872
|
-
|
|
934
|
+
n > 1 && /* @__PURE__ */ e(
|
|
873
935
|
ae,
|
|
874
936
|
{
|
|
875
|
-
currentPage:
|
|
876
|
-
totalPages:
|
|
937
|
+
currentPage: a,
|
|
938
|
+
totalPages: n,
|
|
877
939
|
total: s,
|
|
878
|
-
onPageChange:
|
|
940
|
+
onPageChange: o
|
|
879
941
|
}
|
|
880
942
|
)
|
|
881
943
|
] });
|
|
@@ -883,15 +945,15 @@ function nt({
|
|
|
883
945
|
function it({
|
|
884
946
|
transactions: t,
|
|
885
947
|
total: s,
|
|
886
|
-
currentPage:
|
|
887
|
-
totalPages:
|
|
888
|
-
onPageChange:
|
|
889
|
-
isLoading:
|
|
890
|
-
error:
|
|
948
|
+
currentPage: a,
|
|
949
|
+
totalPages: n,
|
|
950
|
+
onPageChange: o,
|
|
951
|
+
isLoading: p,
|
|
952
|
+
error: b,
|
|
891
953
|
onRetry: c
|
|
892
954
|
}) {
|
|
893
|
-
return
|
|
894
|
-
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children:
|
|
955
|
+
return b ? /* @__PURE__ */ r("div", { className: "cedros-admin-tab-error", children: [
|
|
956
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children: b }),
|
|
895
957
|
/* @__PURE__ */ e(
|
|
896
958
|
"button",
|
|
897
959
|
{
|
|
@@ -901,7 +963,7 @@ function it({
|
|
|
901
963
|
children: "Retry"
|
|
902
964
|
}
|
|
903
965
|
)
|
|
904
|
-
] }) :
|
|
966
|
+
] }) : p && t.length === 0 ? /* @__PURE__ */ r("div", { className: "cedros-admin-tab-loading", children: [
|
|
905
967
|
/* @__PURE__ */ e("span", { className: "cedros-admin-loading-indicator" }),
|
|
906
968
|
/* @__PURE__ */ e("span", { children: "Loading transactions..." })
|
|
907
969
|
] }) : s === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin-empty-message", children: "No credit transactions found." }) : /* @__PURE__ */ r(V, { children: [
|
|
@@ -912,35 +974,35 @@ function it({
|
|
|
912
974
|
/* @__PURE__ */ e("div", { className: "cedros-admin-list-th", children: "Description" }),
|
|
913
975
|
/* @__PURE__ */ e("div", { className: "cedros-admin-list-th", children: "Amount" })
|
|
914
976
|
] }),
|
|
915
|
-
t.map((
|
|
916
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: j(
|
|
977
|
+
t.map((d) => /* @__PURE__ */ r("div", { className: "cedros-admin-list-row", children: [
|
|
978
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: j(d.createdAt) }),
|
|
917
979
|
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: /* @__PURE__ */ e(
|
|
918
980
|
"span",
|
|
919
981
|
{
|
|
920
|
-
className: `cedros-admin-tx-type cedros-admin-tx-type-${
|
|
921
|
-
children: rt(
|
|
982
|
+
className: `cedros-admin-tx-type cedros-admin-tx-type-${d.txType.toLowerCase()}`,
|
|
983
|
+
children: rt(d.txType)
|
|
922
984
|
}
|
|
923
985
|
) }),
|
|
924
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: at(
|
|
986
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: at(d.txType, d.referenceType) }),
|
|
925
987
|
/* @__PURE__ */ r(
|
|
926
988
|
"div",
|
|
927
989
|
{
|
|
928
|
-
className: `cedros-admin-list-td ${
|
|
990
|
+
className: `cedros-admin-list-td ${d.amountLamports >= 0 ? "cedros-admin-amount-positive" : "cedros-admin-amount-negative"}`,
|
|
929
991
|
children: [
|
|
930
|
-
|
|
931
|
-
se(
|
|
992
|
+
d.amountLamports >= 0 ? "+" : "",
|
|
993
|
+
se(d.amountLamports)
|
|
932
994
|
]
|
|
933
995
|
}
|
|
934
996
|
)
|
|
935
|
-
] },
|
|
997
|
+
] }, d.id))
|
|
936
998
|
] }),
|
|
937
|
-
|
|
999
|
+
n > 1 && /* @__PURE__ */ e(
|
|
938
1000
|
ae,
|
|
939
1001
|
{
|
|
940
|
-
currentPage:
|
|
941
|
-
totalPages:
|
|
1002
|
+
currentPage: a,
|
|
1003
|
+
totalPages: n,
|
|
942
1004
|
total: s,
|
|
943
|
-
onPageChange:
|
|
1005
|
+
onPageChange: o
|
|
944
1006
|
}
|
|
945
1007
|
)
|
|
946
1008
|
] });
|
|
@@ -948,15 +1010,15 @@ function it({
|
|
|
948
1010
|
function ct({
|
|
949
1011
|
sessions: t,
|
|
950
1012
|
total: s,
|
|
951
|
-
currentPage:
|
|
952
|
-
totalPages:
|
|
953
|
-
onPageChange:
|
|
954
|
-
isLoading:
|
|
955
|
-
error:
|
|
1013
|
+
currentPage: a,
|
|
1014
|
+
totalPages: n,
|
|
1015
|
+
onPageChange: o,
|
|
1016
|
+
isLoading: p,
|
|
1017
|
+
error: b,
|
|
956
1018
|
onRetry: c
|
|
957
1019
|
}) {
|
|
958
|
-
return
|
|
959
|
-
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children:
|
|
1020
|
+
return b ? /* @__PURE__ */ r("div", { className: "cedros-admin-tab-error", children: [
|
|
1021
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children: b }),
|
|
960
1022
|
/* @__PURE__ */ e(
|
|
961
1023
|
"button",
|
|
962
1024
|
{
|
|
@@ -966,7 +1028,7 @@ function ct({
|
|
|
966
1028
|
children: "Retry"
|
|
967
1029
|
}
|
|
968
1030
|
)
|
|
969
|
-
] }) :
|
|
1031
|
+
] }) : p && t.length === 0 ? /* @__PURE__ */ r("div", { className: "cedros-admin-tab-loading", children: [
|
|
970
1032
|
/* @__PURE__ */ e("span", { className: "cedros-admin-loading-indicator" }),
|
|
971
1033
|
/* @__PURE__ */ e("span", { children: "Loading chat history..." })
|
|
972
1034
|
] }) : s === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin-empty-message", children: "No chat sessions found." }) : /* @__PURE__ */ r(V, { children: [
|
|
@@ -976,19 +1038,19 @@ function ct({
|
|
|
976
1038
|
/* @__PURE__ */ e("div", { className: "cedros-admin-list-th", children: "Session" }),
|
|
977
1039
|
/* @__PURE__ */ e("div", { className: "cedros-admin-list-th", children: "Messages" })
|
|
978
1040
|
] }),
|
|
979
|
-
t.map((
|
|
980
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: j(
|
|
981
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children:
|
|
982
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children:
|
|
983
|
-
] },
|
|
1041
|
+
t.map((d) => /* @__PURE__ */ r("div", { className: "cedros-admin-list-row", children: [
|
|
1042
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: j(d.createdAt) }),
|
|
1043
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: d.title || `Chat ${d.id.slice(0, 8)}...` }),
|
|
1044
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: d.messageCount })
|
|
1045
|
+
] }, d.id))
|
|
984
1046
|
] }),
|
|
985
|
-
|
|
1047
|
+
n > 1 && /* @__PURE__ */ e(
|
|
986
1048
|
ae,
|
|
987
1049
|
{
|
|
988
|
-
currentPage:
|
|
989
|
-
totalPages:
|
|
1050
|
+
currentPage: a,
|
|
1051
|
+
totalPages: n,
|
|
990
1052
|
total: s,
|
|
991
|
-
onPageChange:
|
|
1053
|
+
onPageChange: o
|
|
992
1054
|
}
|
|
993
1055
|
)
|
|
994
1056
|
] });
|
|
@@ -996,15 +1058,15 @@ function ct({
|
|
|
996
1058
|
function ot({
|
|
997
1059
|
referrals: t,
|
|
998
1060
|
total: s,
|
|
999
|
-
currentPage:
|
|
1000
|
-
totalPages:
|
|
1001
|
-
onPageChange:
|
|
1002
|
-
isLoading:
|
|
1003
|
-
error:
|
|
1061
|
+
currentPage: a,
|
|
1062
|
+
totalPages: n,
|
|
1063
|
+
onPageChange: o,
|
|
1064
|
+
isLoading: p,
|
|
1065
|
+
error: b,
|
|
1004
1066
|
onRetry: c
|
|
1005
1067
|
}) {
|
|
1006
|
-
return
|
|
1007
|
-
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children:
|
|
1068
|
+
return b ? /* @__PURE__ */ r("div", { className: "cedros-admin-tab-error", children: [
|
|
1069
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children: b }),
|
|
1008
1070
|
/* @__PURE__ */ e(
|
|
1009
1071
|
"button",
|
|
1010
1072
|
{
|
|
@@ -1014,7 +1076,7 @@ function ot({
|
|
|
1014
1076
|
children: "Retry"
|
|
1015
1077
|
}
|
|
1016
1078
|
)
|
|
1017
|
-
] }) :
|
|
1079
|
+
] }) : p && t.length === 0 ? /* @__PURE__ */ r("div", { className: "cedros-admin-tab-loading", children: [
|
|
1018
1080
|
/* @__PURE__ */ e("span", { className: "cedros-admin-loading-indicator" }),
|
|
1019
1081
|
/* @__PURE__ */ e("span", { children: "Loading referrals..." })
|
|
1020
1082
|
] }) : s === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin-empty-message", children: "No referred users found." }) : /* @__PURE__ */ r(V, { children: [
|
|
@@ -1025,20 +1087,20 @@ function ot({
|
|
|
1025
1087
|
/* @__PURE__ */ e("div", { className: "cedros-admin-list-th", children: "Joined" }),
|
|
1026
1088
|
/* @__PURE__ */ e("div", { className: "cedros-admin-list-th", children: "Last Login" })
|
|
1027
1089
|
] }),
|
|
1028
|
-
t.map((
|
|
1029
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children:
|
|
1030
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children:
|
|
1031
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children:
|
|
1032
|
-
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children:
|
|
1033
|
-
] },
|
|
1090
|
+
t.map((d) => /* @__PURE__ */ r("div", { className: "cedros-admin-list-row", children: [
|
|
1091
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: d.name || "—" }),
|
|
1092
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: d.email || "—" }),
|
|
1093
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: pe(d.createdAt) }),
|
|
1094
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin-list-td", children: d.lastLoginAt ? j(d.lastLoginAt) : "—" })
|
|
1095
|
+
] }, d.id))
|
|
1034
1096
|
] }),
|
|
1035
|
-
|
|
1097
|
+
n > 1 && /* @__PURE__ */ e(
|
|
1036
1098
|
ae,
|
|
1037
1099
|
{
|
|
1038
|
-
currentPage:
|
|
1039
|
-
totalPages:
|
|
1100
|
+
currentPage: a,
|
|
1101
|
+
totalPages: n,
|
|
1040
1102
|
total: s,
|
|
1041
|
-
onPageChange:
|
|
1103
|
+
onPageChange: o
|
|
1042
1104
|
}
|
|
1043
1105
|
)
|
|
1044
1106
|
] });
|
|
@@ -1051,19 +1113,19 @@ const dt = [
|
|
|
1051
1113
|
function lt({
|
|
1052
1114
|
kycData: t,
|
|
1053
1115
|
userKycStatus: s,
|
|
1054
|
-
userKycVerifiedAt:
|
|
1055
|
-
userKycExpiresAt:
|
|
1056
|
-
error:
|
|
1057
|
-
onRetry:
|
|
1058
|
-
onOverride:
|
|
1116
|
+
userKycVerifiedAt: a,
|
|
1117
|
+
userKycExpiresAt: n,
|
|
1118
|
+
error: o,
|
|
1119
|
+
onRetry: p,
|
|
1120
|
+
onOverride: b
|
|
1059
1121
|
}) {
|
|
1060
|
-
const [c,
|
|
1122
|
+
const [c, d] = g("none"), [f, $] = g(!1), [L, y] = g(null), F = t?.status ?? s ?? "none", A = t?.verifiedAt ?? a, U = t?.expiresAt ?? n, R = async () => {
|
|
1061
1123
|
if (window.confirm(
|
|
1062
1124
|
`Override KYC status to "${c}" for this user?`
|
|
1063
1125
|
)) {
|
|
1064
1126
|
$(!0), y(null);
|
|
1065
1127
|
try {
|
|
1066
|
-
await
|
|
1128
|
+
await b(c);
|
|
1067
1129
|
} catch (N) {
|
|
1068
1130
|
y(N instanceof Error ? N.message : "Override failed");
|
|
1069
1131
|
} finally {
|
|
@@ -1071,14 +1133,14 @@ function lt({
|
|
|
1071
1133
|
}
|
|
1072
1134
|
}
|
|
1073
1135
|
};
|
|
1074
|
-
return
|
|
1075
|
-
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children:
|
|
1136
|
+
return o ? /* @__PURE__ */ r("div", { className: "cedros-admin-tab-error", children: [
|
|
1137
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children: o }),
|
|
1076
1138
|
/* @__PURE__ */ e(
|
|
1077
1139
|
"button",
|
|
1078
1140
|
{
|
|
1079
1141
|
type: "button",
|
|
1080
1142
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
1081
|
-
onClick:
|
|
1143
|
+
onClick: p,
|
|
1082
1144
|
children: "Retry"
|
|
1083
1145
|
}
|
|
1084
1146
|
)
|
|
@@ -1089,15 +1151,15 @@ function lt({
|
|
|
1089
1151
|
/* @__PURE__ */ r("div", { className: "cedros-kyc-admin-tab-summary", children: [
|
|
1090
1152
|
/* @__PURE__ */ r("div", { className: "cedros-kyc-admin-tab-row", children: [
|
|
1091
1153
|
/* @__PURE__ */ e("span", { className: "cedros-kyc-admin-tab-label", children: "Status" }),
|
|
1092
|
-
/* @__PURE__ */ e("span", { className: `cedros-admin-status-badge cedros-kyc-status-${
|
|
1154
|
+
/* @__PURE__ */ e("span", { className: `cedros-admin-status-badge cedros-kyc-status-${F}`, children: F })
|
|
1093
1155
|
] }),
|
|
1094
1156
|
A && /* @__PURE__ */ r("div", { className: "cedros-kyc-admin-tab-row", children: [
|
|
1095
1157
|
/* @__PURE__ */ e("span", { className: "cedros-kyc-admin-tab-label", children: "Verified at" }),
|
|
1096
1158
|
/* @__PURE__ */ e("span", { children: j(A) })
|
|
1097
1159
|
] }),
|
|
1098
|
-
|
|
1160
|
+
U && /* @__PURE__ */ r("div", { className: "cedros-kyc-admin-tab-row", children: [
|
|
1099
1161
|
/* @__PURE__ */ e("span", { className: "cedros-kyc-admin-tab-label", children: "Expires at" }),
|
|
1100
|
-
/* @__PURE__ */ e("span", { children: j(
|
|
1162
|
+
/* @__PURE__ */ e("span", { children: j(U) })
|
|
1101
1163
|
] })
|
|
1102
1164
|
] }),
|
|
1103
1165
|
/* @__PURE__ */ r("div", { className: "cedros-kyc-admin-override", children: [
|
|
@@ -1107,7 +1169,7 @@ function lt({
|
|
|
1107
1169
|
{
|
|
1108
1170
|
className: "cedros-kyc-admin-override-select",
|
|
1109
1171
|
value: c,
|
|
1110
|
-
onChange: (w) =>
|
|
1172
|
+
onChange: (w) => d(w.target.value),
|
|
1111
1173
|
disabled: f,
|
|
1112
1174
|
"aria-label": "Select KYC override status",
|
|
1113
1175
|
children: dt.map((w) => /* @__PURE__ */ e("option", { value: w.value, children: w.label }, w.value))
|
|
@@ -1123,7 +1185,7 @@ function lt({
|
|
|
1123
1185
|
children: f ? "Saving..." : "Apply Override"
|
|
1124
1186
|
}
|
|
1125
1187
|
),
|
|
1126
|
-
|
|
1188
|
+
L && /* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children: L })
|
|
1127
1189
|
] }),
|
|
1128
1190
|
t && t.sessions.length > 0 ? /* @__PURE__ */ r("div", { className: "cedros-admin-list-table", children: [
|
|
1129
1191
|
/* @__PURE__ */ r("div", { className: "cedros-admin-list-thead", children: [
|
|
@@ -1157,39 +1219,39 @@ const mt = [
|
|
|
1157
1219
|
function ut({
|
|
1158
1220
|
accreditationData: t,
|
|
1159
1221
|
userAccreditationStatus: s,
|
|
1160
|
-
userAccreditationVerifiedAt:
|
|
1161
|
-
userAccreditationExpiresAt:
|
|
1162
|
-
error:
|
|
1163
|
-
onRetry:
|
|
1164
|
-
onOverride:
|
|
1222
|
+
userAccreditationVerifiedAt: a,
|
|
1223
|
+
userAccreditationExpiresAt: n,
|
|
1224
|
+
error: o,
|
|
1225
|
+
onRetry: p,
|
|
1226
|
+
onOverride: b,
|
|
1165
1227
|
onReview: c
|
|
1166
1228
|
}) {
|
|
1167
|
-
const [
|
|
1229
|
+
const [d, f] = g("none"), [$, L] = g(!1), [y, F] = g(null), [A, U] = g(null), [R, w] = g(""), [N, C] = g(""), [P, _] = g(!1), [O, x] = g(null), M = t?.status ?? s ?? "none", K = t?.verifiedAt ?? a, u = t?.expiresAt ?? n, k = async () => {
|
|
1168
1230
|
if (window.confirm(
|
|
1169
|
-
`Override accreditation status to "${
|
|
1231
|
+
`Override accreditation status to "${d}" for this user?`
|
|
1170
1232
|
)) {
|
|
1171
|
-
|
|
1233
|
+
L(!0), F(null);
|
|
1172
1234
|
try {
|
|
1173
|
-
await
|
|
1174
|
-
} catch (
|
|
1175
|
-
|
|
1235
|
+
await b(d);
|
|
1236
|
+
} catch (l) {
|
|
1237
|
+
F(l instanceof Error ? l.message : "Override failed");
|
|
1176
1238
|
} finally {
|
|
1177
|
-
|
|
1239
|
+
L(!1);
|
|
1178
1240
|
}
|
|
1179
1241
|
}
|
|
1180
|
-
},
|
|
1181
|
-
const
|
|
1242
|
+
}, m = async (i, l) => {
|
|
1243
|
+
const v = l ? "approve" : "reject";
|
|
1182
1244
|
if (window.confirm(
|
|
1183
|
-
`${
|
|
1245
|
+
`${v.charAt(0).toUpperCase() + v.slice(1)} this submission?`
|
|
1184
1246
|
)) {
|
|
1185
1247
|
_(!0), x(null);
|
|
1186
1248
|
try {
|
|
1187
1249
|
await c(
|
|
1188
1250
|
i,
|
|
1189
|
-
|
|
1251
|
+
l,
|
|
1190
1252
|
R || void 0,
|
|
1191
|
-
|
|
1192
|
-
),
|
|
1253
|
+
l ? void 0 : N || void 0
|
|
1254
|
+
), U(null), w(""), C("");
|
|
1193
1255
|
} catch (Y) {
|
|
1194
1256
|
x(Y instanceof Error ? Y.message : "Review failed");
|
|
1195
1257
|
} finally {
|
|
@@ -1197,14 +1259,14 @@ function ut({
|
|
|
1197
1259
|
}
|
|
1198
1260
|
}
|
|
1199
1261
|
};
|
|
1200
|
-
return
|
|
1201
|
-
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children:
|
|
1262
|
+
return o ? /* @__PURE__ */ r("div", { className: "cedros-admin-tab-error", children: [
|
|
1263
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children: o }),
|
|
1202
1264
|
/* @__PURE__ */ e(
|
|
1203
1265
|
"button",
|
|
1204
1266
|
{
|
|
1205
1267
|
type: "button",
|
|
1206
1268
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
1207
|
-
onClick:
|
|
1269
|
+
onClick: p,
|
|
1208
1270
|
children: "Retry"
|
|
1209
1271
|
}
|
|
1210
1272
|
)
|
|
@@ -1238,7 +1300,7 @@ function ut({
|
|
|
1238
1300
|
"select",
|
|
1239
1301
|
{
|
|
1240
1302
|
className: "cedros-kyc-admin-override-select",
|
|
1241
|
-
value:
|
|
1303
|
+
value: d,
|
|
1242
1304
|
onChange: (i) => f(i.target.value),
|
|
1243
1305
|
disabled: $,
|
|
1244
1306
|
"aria-label": "Select accreditation override status",
|
|
@@ -1282,7 +1344,7 @@ function ut({
|
|
|
1282
1344
|
{
|
|
1283
1345
|
type: "button",
|
|
1284
1346
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
1285
|
-
onClick: () =>
|
|
1347
|
+
onClick: () => U(A === i.id ? null : i.id),
|
|
1286
1348
|
children: "Review"
|
|
1287
1349
|
}
|
|
1288
1350
|
) })
|
|
@@ -1300,7 +1362,7 @@ function ut({
|
|
|
1300
1362
|
value: R,
|
|
1301
1363
|
onChange: (i) => w(i.target.value),
|
|
1302
1364
|
placeholder: "Optional internal notes",
|
|
1303
|
-
disabled:
|
|
1365
|
+
disabled: P
|
|
1304
1366
|
}
|
|
1305
1367
|
),
|
|
1306
1368
|
/* @__PURE__ */ e("label", { className: "cedros-kyc-admin-tab-label", htmlFor: "review-rejection", children: "Rejection reason (shown to user if rejected)" }),
|
|
@@ -1313,7 +1375,7 @@ function ut({
|
|
|
1313
1375
|
value: N,
|
|
1314
1376
|
onChange: (i) => C(i.target.value),
|
|
1315
1377
|
placeholder: "Required when rejecting",
|
|
1316
|
-
disabled:
|
|
1378
|
+
disabled: P
|
|
1317
1379
|
}
|
|
1318
1380
|
),
|
|
1319
1381
|
/* @__PURE__ */ r("div", { className: "cedros-accreditation-review-actions", children: [
|
|
@@ -1322,9 +1384,9 @@ function ut({
|
|
|
1322
1384
|
{
|
|
1323
1385
|
type: "button",
|
|
1324
1386
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
1325
|
-
onClick: () =>
|
|
1326
|
-
disabled:
|
|
1327
|
-
children:
|
|
1387
|
+
onClick: () => m(A, !0),
|
|
1388
|
+
disabled: P,
|
|
1389
|
+
children: P ? "Saving..." : "Approve"
|
|
1328
1390
|
}
|
|
1329
1391
|
),
|
|
1330
1392
|
/* @__PURE__ */ e(
|
|
@@ -1332,9 +1394,9 @@ function ut({
|
|
|
1332
1394
|
{
|
|
1333
1395
|
type: "button",
|
|
1334
1396
|
className: "cedros-button cedros-button-outline cedros-button-sm cedros-admin-btn-danger",
|
|
1335
|
-
onClick: () =>
|
|
1336
|
-
disabled:
|
|
1337
|
-
children:
|
|
1397
|
+
onClick: () => m(A, !1),
|
|
1398
|
+
disabled: P || !N.trim(),
|
|
1399
|
+
children: P ? "Saving..." : "Reject"
|
|
1338
1400
|
}
|
|
1339
1401
|
)
|
|
1340
1402
|
] }),
|
|
@@ -1366,20 +1428,20 @@ function ht({ user: t, isCurrentUser: s }) {
|
|
|
1366
1428
|
t.isSystemAdmin && /* @__PURE__ */ e("div", { className: "cedros-admin-user-detail-badges", children: /* @__PURE__ */ e("span", { className: "cedros-admin-admin-badge cedros-admin-admin-badge-yes", children: "System Admin" }) }),
|
|
1367
1429
|
/* @__PURE__ */ r("div", { className: "cedros-admin-user-detail-methods", children: [
|
|
1368
1430
|
/* @__PURE__ */ e("span", { className: "cedros-admin-user-detail-methods-label", children: "Auth Methods:" }),
|
|
1369
|
-
t.authMethods.length > 0 ? t.authMethods.map((
|
|
1431
|
+
t.authMethods.length > 0 ? t.authMethods.map((a) => /* @__PURE__ */ e(
|
|
1370
1432
|
"span",
|
|
1371
1433
|
{
|
|
1372
|
-
className: `cedros-admin-auth-badge cedros-admin-auth-badge-${
|
|
1373
|
-
children:
|
|
1434
|
+
className: `cedros-admin-auth-badge cedros-admin-auth-badge-${a}`,
|
|
1435
|
+
children: a
|
|
1374
1436
|
},
|
|
1375
|
-
|
|
1437
|
+
a
|
|
1376
1438
|
)) : /* @__PURE__ */ e("span", { className: "cedros-admin-auth-badge cedros-admin-auth-badge-none", children: "none" })
|
|
1377
1439
|
] }),
|
|
1378
1440
|
/* @__PURE__ */ r("p", { className: "cedros-admin-user-detail-dates", children: [
|
|
1379
1441
|
"Registered: ",
|
|
1380
|
-
|
|
1442
|
+
pe(t.createdAt),
|
|
1381
1443
|
" | Updated: ",
|
|
1382
|
-
|
|
1444
|
+
pe(t.updatedAt)
|
|
1383
1445
|
] }),
|
|
1384
1446
|
t.referralCode && /* @__PURE__ */ r("div", { className: "cedros-admin-user-detail-referral", children: [
|
|
1385
1447
|
/* @__PURE__ */ e("span", { className: "cedros-admin-user-detail-referral-label", children: "Referral:" }),
|
|
@@ -1407,7 +1469,7 @@ function ht({ user: t, isCurrentUser: s }) {
|
|
|
1407
1469
|
] })
|
|
1408
1470
|
] });
|
|
1409
1471
|
}
|
|
1410
|
-
function ft({ credits: t, creditsError: s, onRetry:
|
|
1472
|
+
function ft({ credits: t, creditsError: s, onRetry: a }) {
|
|
1411
1473
|
return s ? /* @__PURE__ */ r("div", { className: "cedros-admin-stats-error", children: [
|
|
1412
1474
|
/* @__PURE__ */ e("p", { className: "cedros-admin-error-inline", children: s }),
|
|
1413
1475
|
/* @__PURE__ */ e(
|
|
@@ -1415,7 +1477,7 @@ function ft({ credits: t, creditsError: s, onRetry: n }) {
|
|
|
1415
1477
|
{
|
|
1416
1478
|
type: "button",
|
|
1417
1479
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
1418
|
-
onClick:
|
|
1480
|
+
onClick: a,
|
|
1419
1481
|
children: "Retry"
|
|
1420
1482
|
}
|
|
1421
1483
|
)
|
|
@@ -1448,25 +1510,25 @@ function ft({ credits: t, creditsError: s, onRetry: n }) {
|
|
|
1448
1510
|
function yt({
|
|
1449
1511
|
activeTab: t,
|
|
1450
1512
|
onTabChange: s,
|
|
1451
|
-
cedrosPayEnabled:
|
|
1452
|
-
user:
|
|
1453
|
-
deposits:
|
|
1454
|
-
credits:
|
|
1455
|
-
chats:
|
|
1513
|
+
cedrosPayEnabled: a,
|
|
1514
|
+
user: n,
|
|
1515
|
+
deposits: o,
|
|
1516
|
+
credits: p,
|
|
1517
|
+
chats: b,
|
|
1456
1518
|
referrals: c,
|
|
1457
|
-
kycData:
|
|
1519
|
+
kycData: d,
|
|
1458
1520
|
accreditationData: f,
|
|
1459
1521
|
depositsError: $,
|
|
1460
|
-
creditsError:
|
|
1522
|
+
creditsError: L,
|
|
1461
1523
|
chatsError: y,
|
|
1462
|
-
referralsError:
|
|
1524
|
+
referralsError: F,
|
|
1463
1525
|
kycError: A,
|
|
1464
|
-
accreditationError:
|
|
1526
|
+
accreditationError: U,
|
|
1465
1527
|
depositsCurrentPage: R,
|
|
1466
1528
|
depositsTotalPages: w,
|
|
1467
1529
|
onDepositsPageChange: N,
|
|
1468
1530
|
transactionsCurrentPage: C,
|
|
1469
|
-
transactionsTotalPages:
|
|
1531
|
+
transactionsTotalPages: P,
|
|
1470
1532
|
onTransactionsPageChange: _,
|
|
1471
1533
|
chatsCurrentPage: O,
|
|
1472
1534
|
chatsTotalPages: x,
|
|
@@ -1474,10 +1536,10 @@ function yt({
|
|
|
1474
1536
|
referralsCurrentPage: K,
|
|
1475
1537
|
referralsTotalPages: u,
|
|
1476
1538
|
onReferralsPageChange: k,
|
|
1477
|
-
isLoading:
|
|
1539
|
+
isLoading: m,
|
|
1478
1540
|
onRetryDeposits: i,
|
|
1479
|
-
onRetryCredits:
|
|
1480
|
-
onRetryChats:
|
|
1541
|
+
onRetryCredits: l,
|
|
1542
|
+
onRetryChats: v,
|
|
1481
1543
|
onRetryReferrals: q,
|
|
1482
1544
|
onRetryKyc: Y,
|
|
1483
1545
|
onRetryAccreditation: ne,
|
|
@@ -1495,7 +1557,7 @@ function yt({
|
|
|
1495
1557
|
onClick: () => s("deposits"),
|
|
1496
1558
|
children: [
|
|
1497
1559
|
"Deposits (",
|
|
1498
|
-
|
|
1560
|
+
o?.total ?? 0,
|
|
1499
1561
|
")"
|
|
1500
1562
|
]
|
|
1501
1563
|
}
|
|
@@ -1508,12 +1570,12 @@ function yt({
|
|
|
1508
1570
|
onClick: () => s("transactions"),
|
|
1509
1571
|
children: [
|
|
1510
1572
|
"Credits (",
|
|
1511
|
-
|
|
1573
|
+
p?.totalTransactions ?? 0,
|
|
1512
1574
|
")"
|
|
1513
1575
|
]
|
|
1514
1576
|
}
|
|
1515
1577
|
),
|
|
1516
|
-
|
|
1578
|
+
a && /* @__PURE__ */ r(
|
|
1517
1579
|
"button",
|
|
1518
1580
|
{
|
|
1519
1581
|
type: "button",
|
|
@@ -1521,7 +1583,7 @@ function yt({
|
|
|
1521
1583
|
onClick: () => s("chats"),
|
|
1522
1584
|
children: [
|
|
1523
1585
|
"Chats (",
|
|
1524
|
-
|
|
1586
|
+
b?.total ?? 0,
|
|
1525
1587
|
")"
|
|
1526
1588
|
]
|
|
1527
1589
|
}
|
|
@@ -1534,7 +1596,7 @@ function yt({
|
|
|
1534
1596
|
onClick: () => s("referrals"),
|
|
1535
1597
|
children: [
|
|
1536
1598
|
"Referrals (",
|
|
1537
|
-
c?.total ??
|
|
1599
|
+
c?.total ?? n.referralCount ?? 0,
|
|
1538
1600
|
")"
|
|
1539
1601
|
]
|
|
1540
1602
|
}
|
|
@@ -1547,7 +1609,7 @@ function yt({
|
|
|
1547
1609
|
onClick: () => s("kyc"),
|
|
1548
1610
|
children: [
|
|
1549
1611
|
"KYC (",
|
|
1550
|
-
|
|
1612
|
+
d?.totalSessions ?? 0,
|
|
1551
1613
|
")"
|
|
1552
1614
|
]
|
|
1553
1615
|
}
|
|
@@ -1570,12 +1632,12 @@ function yt({
|
|
|
1570
1632
|
t === "deposits" && /* @__PURE__ */ e(
|
|
1571
1633
|
nt,
|
|
1572
1634
|
{
|
|
1573
|
-
deposits:
|
|
1574
|
-
total:
|
|
1635
|
+
deposits: o?.deposits ?? [],
|
|
1636
|
+
total: o?.total ?? 0,
|
|
1575
1637
|
currentPage: R,
|
|
1576
1638
|
totalPages: w,
|
|
1577
1639
|
onPageChange: N,
|
|
1578
|
-
isLoading:
|
|
1640
|
+
isLoading: m,
|
|
1579
1641
|
error: $,
|
|
1580
1642
|
onRetry: i
|
|
1581
1643
|
}
|
|
@@ -1583,27 +1645,27 @@ function yt({
|
|
|
1583
1645
|
t === "transactions" && /* @__PURE__ */ e(
|
|
1584
1646
|
it,
|
|
1585
1647
|
{
|
|
1586
|
-
transactions:
|
|
1587
|
-
total:
|
|
1648
|
+
transactions: p?.transactions ?? [],
|
|
1649
|
+
total: p?.totalTransactions ?? 0,
|
|
1588
1650
|
currentPage: C,
|
|
1589
|
-
totalPages:
|
|
1651
|
+
totalPages: P,
|
|
1590
1652
|
onPageChange: _,
|
|
1591
|
-
error:
|
|
1592
|
-
onRetry:
|
|
1593
|
-
isLoading:
|
|
1653
|
+
error: L,
|
|
1654
|
+
onRetry: l,
|
|
1655
|
+
isLoading: m
|
|
1594
1656
|
}
|
|
1595
1657
|
),
|
|
1596
|
-
t === "chats" &&
|
|
1658
|
+
t === "chats" && a && /* @__PURE__ */ e(
|
|
1597
1659
|
ct,
|
|
1598
1660
|
{
|
|
1599
|
-
sessions:
|
|
1600
|
-
total:
|
|
1661
|
+
sessions: b?.sessions ?? [],
|
|
1662
|
+
total: b?.total ?? 0,
|
|
1601
1663
|
currentPage: O,
|
|
1602
1664
|
totalPages: x,
|
|
1603
1665
|
onPageChange: M,
|
|
1604
1666
|
error: y,
|
|
1605
|
-
onRetry:
|
|
1606
|
-
isLoading:
|
|
1667
|
+
onRetry: v,
|
|
1668
|
+
isLoading: m
|
|
1607
1669
|
}
|
|
1608
1670
|
),
|
|
1609
1671
|
t === "referrals" && /* @__PURE__ */ e(
|
|
@@ -1614,18 +1676,18 @@ function yt({
|
|
|
1614
1676
|
currentPage: K,
|
|
1615
1677
|
totalPages: u,
|
|
1616
1678
|
onPageChange: k,
|
|
1617
|
-
error:
|
|
1679
|
+
error: F,
|
|
1618
1680
|
onRetry: q,
|
|
1619
|
-
isLoading:
|
|
1681
|
+
isLoading: m
|
|
1620
1682
|
}
|
|
1621
1683
|
),
|
|
1622
1684
|
t === "kyc" && /* @__PURE__ */ e(
|
|
1623
1685
|
lt,
|
|
1624
1686
|
{
|
|
1625
|
-
kycData:
|
|
1626
|
-
userKycStatus:
|
|
1627
|
-
userKycVerifiedAt:
|
|
1628
|
-
userKycExpiresAt:
|
|
1687
|
+
kycData: d,
|
|
1688
|
+
userKycStatus: n.kycStatus,
|
|
1689
|
+
userKycVerifiedAt: n.kycVerifiedAt,
|
|
1690
|
+
userKycExpiresAt: n.kycExpiresAt,
|
|
1629
1691
|
error: A,
|
|
1630
1692
|
onRetry: Y,
|
|
1631
1693
|
onOverride: G
|
|
@@ -1635,10 +1697,10 @@ function yt({
|
|
|
1635
1697
|
ut,
|
|
1636
1698
|
{
|
|
1637
1699
|
accreditationData: f,
|
|
1638
|
-
userAccreditationStatus:
|
|
1639
|
-
userAccreditationVerifiedAt:
|
|
1640
|
-
userAccreditationExpiresAt:
|
|
1641
|
-
error:
|
|
1700
|
+
userAccreditationStatus: n.accreditationStatus,
|
|
1701
|
+
userAccreditationVerifiedAt: n.accreditationVerifiedAt,
|
|
1702
|
+
userAccreditationExpiresAt: n.accreditationExpiresAt,
|
|
1703
|
+
error: U,
|
|
1642
1704
|
onRetry: ne,
|
|
1643
1705
|
onOverride: H,
|
|
1644
1706
|
onReview: Q
|
|
@@ -1650,45 +1712,45 @@ function yt({
|
|
|
1650
1712
|
function At({
|
|
1651
1713
|
userId: t,
|
|
1652
1714
|
onBack: s,
|
|
1653
|
-
currentUserId:
|
|
1654
|
-
onEditUser:
|
|
1655
|
-
onAdjustCredits:
|
|
1656
|
-
cedrosPayEnabled:
|
|
1657
|
-
className:
|
|
1715
|
+
currentUserId: a,
|
|
1716
|
+
onEditUser: n,
|
|
1717
|
+
onAdjustCredits: o,
|
|
1718
|
+
cedrosPayEnabled: p = !1,
|
|
1719
|
+
className: b = ""
|
|
1658
1720
|
}) {
|
|
1659
|
-
const { config: c, _internal:
|
|
1721
|
+
const { config: c, _internal: d } = Ce(), {
|
|
1660
1722
|
isLoading: f,
|
|
1661
1723
|
getUser: $,
|
|
1662
|
-
getUserDeposits:
|
|
1724
|
+
getUserDeposits: L,
|
|
1663
1725
|
getUserCredits: y,
|
|
1664
|
-
getUserChats:
|
|
1726
|
+
getUserChats: F,
|
|
1665
1727
|
getUserReferrals: A,
|
|
1666
|
-
deleteUser:
|
|
1728
|
+
deleteUser: U,
|
|
1667
1729
|
forcePasswordReset: R,
|
|
1668
1730
|
clearError: w
|
|
1669
|
-
} =
|
|
1731
|
+
} = be(), N = re(
|
|
1670
1732
|
() => new Se(
|
|
1671
1733
|
c.serverUrl,
|
|
1672
1734
|
c.requestTimeout,
|
|
1673
1735
|
c.retryAttempts,
|
|
1674
|
-
|
|
1736
|
+
d?.getAccessToken
|
|
1675
1737
|
),
|
|
1676
|
-
[c.serverUrl, c.requestTimeout, c.retryAttempts,
|
|
1677
|
-
), [C,
|
|
1738
|
+
[c.serverUrl, c.requestTimeout, c.retryAttempts, d]
|
|
1739
|
+
), [C, P] = g(null), [_, O] = g(null), [x, M] = g(null), [K, u] = g(null), [k, m] = g(null), [i, l] = g(null), [v, q] = g(null), [Y, ne] = g("deposits"), [G, H] = g(null), [Q, X] = g(null), [Ae, ie] = g(null), [Ee, ce] = g(null), [Ue, oe] = g(null), [Re, Z] = g(null), [ke, J] = g(null), [z, ee] = g(!1), [de, $e] = g(0), [le, Fe] = g(0), [me, Le] = g(0), [ue, Pe] = g(0), D = 10, he = S(async () => {
|
|
1678
1740
|
try {
|
|
1679
1741
|
const h = await $(t);
|
|
1680
|
-
|
|
1742
|
+
P(h), H(null);
|
|
1681
1743
|
} catch (h) {
|
|
1682
1744
|
H(h instanceof Error ? h.message : "Failed to load user");
|
|
1683
1745
|
}
|
|
1684
1746
|
}, [t, $]), fe = S(async () => {
|
|
1685
1747
|
try {
|
|
1686
|
-
const T = await
|
|
1748
|
+
const T = await L(t, { limit: D, offset: de });
|
|
1687
1749
|
M(T), ie(null);
|
|
1688
1750
|
} catch (h) {
|
|
1689
1751
|
ie(h instanceof Error ? h.message : "Failed to load deposits");
|
|
1690
1752
|
}
|
|
1691
|
-
}, [t,
|
|
1753
|
+
}, [t, L, de]), te = S(async () => {
|
|
1692
1754
|
try {
|
|
1693
1755
|
const T = await y(t, { limit: D, offset: le });
|
|
1694
1756
|
O(T), X(null);
|
|
@@ -1696,24 +1758,24 @@ function At({
|
|
|
1696
1758
|
X(h instanceof Error ? h.message : "Failed to load credits");
|
|
1697
1759
|
}
|
|
1698
1760
|
}, [t, y, le]), ye = S(async () => {
|
|
1699
|
-
if (
|
|
1761
|
+
if (p)
|
|
1700
1762
|
try {
|
|
1701
|
-
const T = await
|
|
1763
|
+
const T = await F(t, { limit: D, offset: me });
|
|
1702
1764
|
u(T), ce(null);
|
|
1703
1765
|
} catch (h) {
|
|
1704
1766
|
ce(h instanceof Error ? h.message : "Failed to load chat history");
|
|
1705
1767
|
}
|
|
1706
|
-
}, [t,
|
|
1768
|
+
}, [t, F, me, p]), ge = S(async () => {
|
|
1707
1769
|
try {
|
|
1708
1770
|
const T = await A(t, { limit: D, offset: ue });
|
|
1709
|
-
|
|
1771
|
+
m(T), oe(null);
|
|
1710
1772
|
} catch (h) {
|
|
1711
1773
|
oe(h instanceof Error ? h.message : "Failed to load referrals");
|
|
1712
1774
|
}
|
|
1713
1775
|
}, [t, A, ue]), W = S(async () => {
|
|
1714
1776
|
try {
|
|
1715
1777
|
const h = await N.getUserKyc(t);
|
|
1716
|
-
|
|
1778
|
+
l(h), Z(null);
|
|
1717
1779
|
} catch (h) {
|
|
1718
1780
|
Z(h instanceof Error ? h.message : "Failed to load KYC data");
|
|
1719
1781
|
}
|
|
@@ -1764,11 +1826,11 @@ function At({
|
|
|
1764
1826
|
[t, N, W]
|
|
1765
1827
|
);
|
|
1766
1828
|
I(() => {
|
|
1767
|
-
he(), fe(), te(),
|
|
1768
|
-
}, [he, fe, te, ye,
|
|
1829
|
+
he(), fe(), te(), ge(), W(), B(), p && ye();
|
|
1830
|
+
}, [he, fe, te, ye, ge, W, B, p]);
|
|
1769
1831
|
const xe = async () => {
|
|
1770
1832
|
if (!C) return;
|
|
1771
|
-
if (C.id ===
|
|
1833
|
+
if (C.id === a) {
|
|
1772
1834
|
alert("You cannot delete your own account");
|
|
1773
1835
|
return;
|
|
1774
1836
|
}
|
|
@@ -1781,7 +1843,7 @@ function At({
|
|
|
1781
1843
|
)) {
|
|
1782
1844
|
ee(!0);
|
|
1783
1845
|
try {
|
|
1784
|
-
await
|
|
1846
|
+
await U(C.id), s();
|
|
1785
1847
|
} catch {
|
|
1786
1848
|
} finally {
|
|
1787
1849
|
ee(!1);
|
|
@@ -1801,9 +1863,9 @@ function At({
|
|
|
1801
1863
|
ee(!1);
|
|
1802
1864
|
}
|
|
1803
1865
|
}
|
|
1804
|
-
}, _e = x ? Math.ceil(x.total / D) : 0, Ke = Math.floor(de / D) + 1, je = _ ? Math.ceil(_.totalTransactions / D) : 0, qe = Math.floor(le / D) + 1, Ve = K ? Math.ceil(K.total / D) : 0, Be = Math.floor(me / D) + 1, Ye = k ? Math.ceil(k.total / D) : 0, Ie = Math.floor(ue / D) + 1, He = (h) => $e((h - 1) * D), Je = (h) =>
|
|
1866
|
+
}, _e = x ? Math.ceil(x.total / D) : 0, Ke = Math.floor(de / D) + 1, je = _ ? Math.ceil(_.totalTransactions / D) : 0, qe = Math.floor(le / D) + 1, Ve = K ? Math.ceil(K.total / D) : 0, Be = Math.floor(me / D) + 1, Ye = k ? Math.ceil(k.total / D) : 0, Ie = Math.floor(ue / D) + 1, He = (h) => $e((h - 1) * D), Je = (h) => Fe((h - 1) * D), We = (h) => Le((h - 1) * D), Ge = (h) => Pe((h - 1) * D);
|
|
1805
1867
|
if (G)
|
|
1806
|
-
return /* @__PURE__ */ r("div", { className: `cedros-admin-user-detail cedros-admin-user-detail-error ${
|
|
1868
|
+
return /* @__PURE__ */ r("div", { className: `cedros-admin-user-detail cedros-admin-user-detail-error ${b}`, children: [
|
|
1807
1869
|
/* @__PURE__ */ e(
|
|
1808
1870
|
"button",
|
|
1809
1871
|
{
|
|
@@ -1827,12 +1889,12 @@ function At({
|
|
|
1827
1889
|
)
|
|
1828
1890
|
] });
|
|
1829
1891
|
if (f && !C)
|
|
1830
|
-
return /* @__PURE__ */ r("div", { className: `cedros-admin-user-detail cedros-admin-user-detail-loading ${
|
|
1892
|
+
return /* @__PURE__ */ r("div", { className: `cedros-admin-user-detail cedros-admin-user-detail-loading ${b}`, children: [
|
|
1831
1893
|
/* @__PURE__ */ e("span", { className: "cedros-admin-loading-indicator" }),
|
|
1832
1894
|
/* @__PURE__ */ e("span", { className: "cedros-admin-loading-text", children: "Loading user..." })
|
|
1833
1895
|
] });
|
|
1834
1896
|
if (!C)
|
|
1835
|
-
return /* @__PURE__ */ r("div", { className: `cedros-admin-user-detail ${
|
|
1897
|
+
return /* @__PURE__ */ r("div", { className: `cedros-admin-user-detail ${b}`, children: [
|
|
1836
1898
|
/* @__PURE__ */ e(
|
|
1837
1899
|
"button",
|
|
1838
1900
|
{
|
|
@@ -1844,8 +1906,8 @@ function At({
|
|
|
1844
1906
|
),
|
|
1845
1907
|
/* @__PURE__ */ e("p", { className: "cedros-admin-empty-message", children: "User not found." })
|
|
1846
1908
|
] });
|
|
1847
|
-
const
|
|
1848
|
-
return /* @__PURE__ */ r("div", { className: `cedros-admin-user-detail ${
|
|
1909
|
+
const ve = C.id === a;
|
|
1910
|
+
return /* @__PURE__ */ r("div", { className: `cedros-admin-user-detail ${b}`, children: [
|
|
1849
1911
|
/* @__PURE__ */ r("div", { className: "cedros-admin-user-detail-header", children: [
|
|
1850
1912
|
/* @__PURE__ */ e(
|
|
1851
1913
|
"button",
|
|
@@ -1857,12 +1919,12 @@ function At({
|
|
|
1857
1919
|
}
|
|
1858
1920
|
),
|
|
1859
1921
|
/* @__PURE__ */ r("div", { className: "cedros-admin-user-detail-actions", children: [
|
|
1860
|
-
|
|
1922
|
+
n && /* @__PURE__ */ e(
|
|
1861
1923
|
"button",
|
|
1862
1924
|
{
|
|
1863
1925
|
type: "button",
|
|
1864
1926
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
1865
|
-
onClick: () =>
|
|
1927
|
+
onClick: () => n(C),
|
|
1866
1928
|
disabled: z,
|
|
1867
1929
|
children: "Edit"
|
|
1868
1930
|
}
|
|
@@ -1877,17 +1939,17 @@ function At({
|
|
|
1877
1939
|
children: "Reset Password"
|
|
1878
1940
|
}
|
|
1879
1941
|
),
|
|
1880
|
-
|
|
1942
|
+
o && /* @__PURE__ */ e(
|
|
1881
1943
|
"button",
|
|
1882
1944
|
{
|
|
1883
1945
|
type: "button",
|
|
1884
1946
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
1885
|
-
onClick: () =>
|
|
1947
|
+
onClick: () => o(C),
|
|
1886
1948
|
disabled: z,
|
|
1887
1949
|
children: "Adjust Credits"
|
|
1888
1950
|
}
|
|
1889
1951
|
),
|
|
1890
|
-
!
|
|
1952
|
+
!ve && !C.isSystemAdmin && /* @__PURE__ */ e(
|
|
1891
1953
|
"button",
|
|
1892
1954
|
{
|
|
1893
1955
|
type: "button",
|
|
@@ -1899,7 +1961,7 @@ function At({
|
|
|
1899
1961
|
)
|
|
1900
1962
|
] })
|
|
1901
1963
|
] }),
|
|
1902
|
-
/* @__PURE__ */ e(ht, { user: C, isCurrentUser:
|
|
1964
|
+
/* @__PURE__ */ e(ht, { user: C, isCurrentUser: ve }),
|
|
1903
1965
|
/* @__PURE__ */ e(
|
|
1904
1966
|
ft,
|
|
1905
1967
|
{
|
|
@@ -1915,14 +1977,14 @@ function At({
|
|
|
1915
1977
|
{
|
|
1916
1978
|
activeTab: Y,
|
|
1917
1979
|
onTabChange: ne,
|
|
1918
|
-
cedrosPayEnabled:
|
|
1980
|
+
cedrosPayEnabled: p,
|
|
1919
1981
|
user: C,
|
|
1920
1982
|
deposits: x,
|
|
1921
1983
|
credits: _,
|
|
1922
1984
|
chats: K,
|
|
1923
1985
|
referrals: k,
|
|
1924
1986
|
kycData: i,
|
|
1925
|
-
accreditationData:
|
|
1987
|
+
accreditationData: v,
|
|
1926
1988
|
depositsError: Ae,
|
|
1927
1989
|
creditsError: Q,
|
|
1928
1990
|
chatsError: Ee,
|
|
@@ -1952,7 +2014,7 @@ function At({
|
|
|
1952
2014
|
ce(null), ye();
|
|
1953
2015
|
},
|
|
1954
2016
|
onRetryReferrals: () => {
|
|
1955
|
-
oe(null),
|
|
2017
|
+
oe(null), ge();
|
|
1956
2018
|
},
|
|
1957
2019
|
onRetryKyc: () => {
|
|
1958
2020
|
Z(null), W();
|
|
@@ -1967,14 +2029,14 @@ function At({
|
|
|
1967
2029
|
)
|
|
1968
2030
|
] });
|
|
1969
2031
|
}
|
|
1970
|
-
const
|
|
2032
|
+
const gt = ["email", "google", "apple", "solana", "webauthn", "sso"], pt = {
|
|
1971
2033
|
email: "Email Users",
|
|
1972
2034
|
google: "Google Users",
|
|
1973
2035
|
apple: "Apple Users",
|
|
1974
2036
|
solana: "Solana Users",
|
|
1975
2037
|
webauthn: "Passkey Users",
|
|
1976
2038
|
sso: "SSO Provider Users"
|
|
1977
|
-
},
|
|
2039
|
+
}, bt = {
|
|
1978
2040
|
email: "auth_email_enabled",
|
|
1979
2041
|
google: "auth_google_enabled",
|
|
1980
2042
|
apple: "auth_apple_enabled",
|
|
@@ -1983,43 +2045,43 @@ const pt = ["email", "google", "apple", "solana", "webauthn", "sso"], bt = {
|
|
|
1983
2045
|
sso: "feature_sso"
|
|
1984
2046
|
};
|
|
1985
2047
|
function Et() {
|
|
1986
|
-
const { getStats: t } =
|
|
2048
|
+
const { getStats: t } = be(), { fetchSettings: s, getValue: a } = ze(), [n, o] = g(null), [p, b] = g(!1), [c, d] = g(null), [f, $] = g(!1);
|
|
1987
2049
|
I(() => {
|
|
1988
2050
|
f || (s(), $(!0));
|
|
1989
2051
|
}, [s, f]);
|
|
1990
|
-
const
|
|
2052
|
+
const L = S(
|
|
1991
2053
|
(A) => {
|
|
1992
|
-
const
|
|
1993
|
-
return
|
|
2054
|
+
const U = a(A);
|
|
2055
|
+
return U === void 0 ? !1 : U === "true" || U === "1";
|
|
1994
2056
|
},
|
|
1995
|
-
[
|
|
2057
|
+
[a]
|
|
1996
2058
|
), y = S(async () => {
|
|
1997
|
-
|
|
2059
|
+
b(!0), d(null);
|
|
1998
2060
|
try {
|
|
1999
2061
|
const A = await t();
|
|
2000
|
-
|
|
2062
|
+
o(A);
|
|
2001
2063
|
} catch (A) {
|
|
2002
|
-
|
|
2064
|
+
d(A instanceof Error ? A.message : "Failed to load user stats");
|
|
2003
2065
|
} finally {
|
|
2004
|
-
|
|
2066
|
+
b(!1);
|
|
2005
2067
|
}
|
|
2006
2068
|
}, [t]);
|
|
2007
2069
|
return I(() => {
|
|
2008
2070
|
y();
|
|
2009
2071
|
}, [y]), { statsItems: re(() => {
|
|
2010
|
-
const A = [{ label: "Total Users", value:
|
|
2011
|
-
return
|
|
2012
|
-
|
|
2013
|
-
label:
|
|
2014
|
-
value:
|
|
2072
|
+
const A = [{ label: "Total Users", value: n?.total ?? "—" }];
|
|
2073
|
+
return gt.forEach((U) => {
|
|
2074
|
+
L(bt[U]) && A.push({
|
|
2075
|
+
label: pt[U],
|
|
2076
|
+
value: n?.authMethodCounts[U] ?? 0
|
|
2015
2077
|
});
|
|
2016
2078
|
}), A;
|
|
2017
|
-
}, [
|
|
2079
|
+
}, [n, L]), isLoading: p, error: c, refresh: y };
|
|
2018
2080
|
}
|
|
2019
2081
|
export {
|
|
2020
2082
|
At as A,
|
|
2021
2083
|
St as a,
|
|
2022
2084
|
Se as b,
|
|
2023
|
-
|
|
2085
|
+
be as c,
|
|
2024
2086
|
Et as u
|
|
2025
2087
|
};
|