mantur-components 0.1.9 → 0.1.11
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 +40 -1
- package/dist/api.d.ts +120 -1
- package/dist/header/ManturHeader.d.ts +1 -1
- package/dist/header/components/RechargeModal.d.ts +6 -3
- package/dist/header/components/StripePaymentModal.d.ts +12 -0
- package/dist/header/mock.d.ts +11 -15
- package/dist/index.d.ts +5 -1
- package/dist/mantur-components.js +1793 -517
- package/dist/mantur-components.umd.cjs +4 -1
- package/dist/types.d.ts +16 -0
- package/dist/utils/stripe-payment-window.d.ts +13 -0
- package/package.json +7 -2
|
@@ -1,53 +1,67 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { Avatar as
|
|
3
|
-
import { IconCheckCircleFill as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useTheme as
|
|
1
|
+
import e, { useCallback as t, useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
|
+
import { Alert as o, Avatar as s, Button as c, Card as l, DatePicker as u, Divider as d, Dropdown as f, Form as p, Grid as m, Input as h, Menu as g, Message as _, Modal as v, Pagination as y, Select as b, Spin as x, Table as S, Tabs as C, Tag as w, Typography as T, Upload as E } from "@arco-design/web-react";
|
|
3
|
+
import { IconCheckCircleFill as D, IconDown as O, IconEdit as k, IconFile as A, IconLanguage as j, IconMoonFill as M, IconPlus as N, IconPoweroff as P, IconSunFill as F, IconUpload as I } from "@arco-design/web-react/icon";
|
|
4
|
+
import { useTranslation as ee } from "react-i18next";
|
|
5
|
+
import { jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
6
|
+
import { useTheme as te } from "next-themes";
|
|
7
7
|
//#region \0rolldown/runtime.js
|
|
8
|
-
var
|
|
9
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
8
|
+
var ne = Object.create, z = Object.defineProperty, re = Object.getOwnPropertyDescriptor, B = Object.getOwnPropertyNames, ie = Object.getPrototypeOf, V = Object.prototype.hasOwnProperty, H = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), U = (e, t, n, r) => {
|
|
9
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = B(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !V.call(e, s) && s !== n && z(e, s, {
|
|
10
10
|
get: ((e) => t[e]).bind(null, s),
|
|
11
|
-
enumerable: !(r =
|
|
11
|
+
enumerable: !(r = re(t, s)) || r.enumerable
|
|
12
12
|
});
|
|
13
13
|
return e;
|
|
14
|
-
},
|
|
14
|
+
}, W = (e, t, n) => (n = e == null ? {} : ne(ie(e)), U(t || !e || !e.__esModule ? z(n, "default", {
|
|
15
15
|
value: e,
|
|
16
16
|
enumerable: !0
|
|
17
|
-
}) : n, e)),
|
|
18
|
-
function
|
|
19
|
-
return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ :
|
|
17
|
+
}) : n, e)), ae = "/api", oe = "/billing/accounts/me", se = "mantur-points-refresh", ce = "mantur-recharge-order-created", G = "mantur-tenant-context-change";
|
|
18
|
+
function le() {
|
|
19
|
+
return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ : ae;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return typeof window < "u" && window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ ? window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ :
|
|
21
|
+
function ue() {
|
|
22
|
+
return typeof window < "u" && window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ ? window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ : oe;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function de(e) {
|
|
25
|
+
let t = new URLSearchParams();
|
|
26
|
+
Object.entries(e).forEach(([e, n]) => {
|
|
27
|
+
if (n !== void 0) {
|
|
28
|
+
if (Array.isArray(n)) {
|
|
29
|
+
n.length > 0 && t.set(e, n.join(","));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
t.set(e, String(n));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
let n = t.toString();
|
|
36
|
+
return n ? `?${n}` : "";
|
|
37
|
+
}
|
|
38
|
+
function fe(e) {
|
|
25
39
|
if (typeof document > "u") return;
|
|
26
40
|
let t = `${encodeURIComponent(e)}=`;
|
|
27
41
|
return document.cookie.split("; ").find((e) => e.startsWith(t))?.slice(t.length);
|
|
28
42
|
}
|
|
29
|
-
function
|
|
43
|
+
function pe(e) {
|
|
30
44
|
if (typeof document > "u") return;
|
|
31
45
|
let t = encodeURIComponent(e), n = window.location.hostname, r = [void 0, n], i = n.split(".");
|
|
32
46
|
i.length >= 2 && r.push(`.${i.slice(-2).join(".")}`), r.forEach((e) => {
|
|
33
47
|
document.cookie = `${t}=; path=/; max-age=0${e ? `; domain=${e}` : ""}`;
|
|
34
48
|
});
|
|
35
49
|
}
|
|
36
|
-
function
|
|
50
|
+
function me(e) {
|
|
37
51
|
let t = JSON.parse(e || "null");
|
|
38
52
|
if (!t) throw Error("Request failed");
|
|
39
53
|
if (t.code !== 0) throw Error(t.message || "Request failed");
|
|
40
54
|
return t;
|
|
41
55
|
}
|
|
42
56
|
async function K(e, t = {}) {
|
|
43
|
-
let n =
|
|
57
|
+
let n = fe("front-token"), r = fe("Accept-Language"), i = t.headers || {};
|
|
44
58
|
return n && (i.Authorization = decodeURIComponent(n)), r && (i["Accept-Language"] = decodeURIComponent(r)), new Promise((n, r) => {
|
|
45
59
|
let a = new XMLHttpRequest();
|
|
46
|
-
a.open(t.method || "GET", `${
|
|
60
|
+
a.open(t.method || "GET", `${le()}${e}`, !0), a.timeout = t.timeout || 1e4, Object.entries(i).forEach(([e, t]) => {
|
|
47
61
|
a.setRequestHeader(e, t);
|
|
48
62
|
}), a.onload = () => {
|
|
49
63
|
try {
|
|
50
|
-
let e =
|
|
64
|
+
let e = me(a.responseText);
|
|
51
65
|
if (a.status < 200 || a.status >= 300) {
|
|
52
66
|
r(Error(e.message || a.statusText));
|
|
53
67
|
return;
|
|
@@ -59,16 +73,16 @@ async function K(e, t = {}) {
|
|
|
59
73
|
}, a.onerror = () => r(/* @__PURE__ */ Error("Network request failed")), a.ontimeout = () => r(/* @__PURE__ */ Error("Network request timed out")), a.send(t.body ?? null);
|
|
60
74
|
});
|
|
61
75
|
}
|
|
62
|
-
async function
|
|
76
|
+
async function he() {
|
|
63
77
|
try {
|
|
64
78
|
await K("/auth/front-logout", { method: "DELETE" });
|
|
65
79
|
} catch (e) {
|
|
66
80
|
console.warn("Logout request failed, continuing local logout.", e);
|
|
67
81
|
} finally {
|
|
68
|
-
|
|
82
|
+
pe("front-token"), pe("refreshToken"), typeof window < "u" && window.location.reload();
|
|
69
83
|
}
|
|
70
84
|
}
|
|
71
|
-
async function
|
|
85
|
+
async function ge(e) {
|
|
72
86
|
let t;
|
|
73
87
|
if (e.avatarFile) {
|
|
74
88
|
let n = new FormData();
|
|
@@ -83,25 +97,57 @@ async function de(e) {
|
|
|
83
97
|
body: JSON.stringify({ nickname: e.nickname })
|
|
84
98
|
})).data || t;
|
|
85
99
|
}
|
|
86
|
-
function
|
|
100
|
+
function _e(e) {
|
|
87
101
|
let t = (...t) => {
|
|
88
102
|
let n = t.map((t) => e?.[t]).find((e) => e !== void 0);
|
|
89
103
|
return typeof n == "number" ? n : Number(n || 0);
|
|
90
104
|
};
|
|
91
105
|
return {
|
|
92
|
-
total: t("total", "totalPoints", "balance", "points"),
|
|
93
|
-
recharge: t("recharge", "rechargePoints", "paidPoints"),
|
|
94
|
-
gifted: t("gifted", "giftedPoints", "bonusPoints")
|
|
106
|
+
total: t("total", "totalPoints", "totalBalance", "balance", "points"),
|
|
107
|
+
recharge: t("recharge", "rechargePoints", "rechargeBalance", "paidPoints"),
|
|
108
|
+
gifted: t("gifted", "giftedPoints", "giftBalance", "bonusPoints")
|
|
95
109
|
};
|
|
96
110
|
}
|
|
97
|
-
async function
|
|
98
|
-
return
|
|
111
|
+
async function ve() {
|
|
112
|
+
return _e((await K(ue())).data);
|
|
113
|
+
}
|
|
114
|
+
async function q() {
|
|
115
|
+
let e = await ve();
|
|
116
|
+
return typeof window < "u" && window.dispatchEvent(new CustomEvent(se, { detail: e })), e;
|
|
117
|
+
}
|
|
118
|
+
async function ye() {
|
|
119
|
+
return (await K("/billing/packages")).data || [];
|
|
120
|
+
}
|
|
121
|
+
async function be(e) {
|
|
122
|
+
return (await K("/billing/recharge/orders", {
|
|
123
|
+
method: "POST",
|
|
124
|
+
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
125
|
+
body: JSON.stringify(e)
|
|
126
|
+
})).data;
|
|
127
|
+
}
|
|
128
|
+
async function xe(e) {
|
|
129
|
+
return (await K(`/billing/recharge/orders/${encodeURIComponent(e)}`)).data;
|
|
130
|
+
}
|
|
131
|
+
async function Se() {
|
|
132
|
+
return (await K("/billing/pricing/charge-points")).data || [];
|
|
133
|
+
}
|
|
134
|
+
async function Ce(e) {
|
|
135
|
+
return (await K(`/billing/pricing/charge-points/${encodeURIComponent(e)}`)).data;
|
|
99
136
|
}
|
|
100
|
-
async function
|
|
101
|
-
|
|
102
|
-
return typeof window < "u" && window.dispatchEvent(new CustomEvent(U, { detail: e })), e;
|
|
137
|
+
async function we() {
|
|
138
|
+
return (await K("/billing/accounts/me")).data;
|
|
103
139
|
}
|
|
104
|
-
function
|
|
140
|
+
async function Te(e) {
|
|
141
|
+
return (await K(`/billing/accounts/me/ledger${de({
|
|
142
|
+
pageNum: e.pageNum,
|
|
143
|
+
pageSize: e.pageSize,
|
|
144
|
+
directions: e.directions,
|
|
145
|
+
bizTypes: e.bizTypes,
|
|
146
|
+
fromTime: e.fromTime,
|
|
147
|
+
toTime: e.toTime
|
|
148
|
+
})}`)).data || { records: [] };
|
|
149
|
+
}
|
|
150
|
+
function Ee(e, t) {
|
|
105
151
|
return t?.tenantId ? e.find((e) => e.tenantId === t.tenantId) || {
|
|
106
152
|
tenantId: t.tenantId,
|
|
107
153
|
tenantName: t.tenantName || t.tenantId,
|
|
@@ -111,37 +157,37 @@ function he(e, t) {
|
|
|
111
157
|
}))
|
|
112
158
|
} : e.find((e) => e.isOwner) || e[0];
|
|
113
159
|
}
|
|
114
|
-
function
|
|
115
|
-
typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(
|
|
160
|
+
function De(e) {
|
|
161
|
+
typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(G, { detail: e })));
|
|
116
162
|
}
|
|
117
|
-
async function
|
|
163
|
+
async function Oe() {
|
|
118
164
|
return (await K("/users/me/tenants")).data || [];
|
|
119
165
|
}
|
|
120
|
-
async function
|
|
166
|
+
async function ke() {
|
|
121
167
|
return (await K("/auth/current-tenant")).data;
|
|
122
168
|
}
|
|
123
|
-
async function
|
|
169
|
+
async function Ae(e) {
|
|
124
170
|
return (await K(`/auth/current-tenant/${e}`, { method: "PUT" })).data;
|
|
125
171
|
}
|
|
126
|
-
async function
|
|
127
|
-
let [t, n] = await Promise.all([
|
|
172
|
+
async function je(e = "refresh") {
|
|
173
|
+
let [t, n] = await Promise.all([Oe(), ke()]), r = {
|
|
128
174
|
tenants: t,
|
|
129
|
-
currentTenant:
|
|
175
|
+
currentTenant: Ee(t, n),
|
|
130
176
|
auth: n,
|
|
131
177
|
reason: e
|
|
132
178
|
};
|
|
133
|
-
return
|
|
179
|
+
return De(r), r;
|
|
134
180
|
}
|
|
135
|
-
async function
|
|
136
|
-
let t = await
|
|
181
|
+
async function Me(e) {
|
|
182
|
+
let t = await Ae(e), n = await Oe(), r = {
|
|
137
183
|
tenants: n,
|
|
138
|
-
currentTenant:
|
|
184
|
+
currentTenant: Ee(n, t),
|
|
139
185
|
auth: t,
|
|
140
186
|
reason: "switch"
|
|
141
187
|
};
|
|
142
|
-
return
|
|
188
|
+
return De(r), r;
|
|
143
189
|
}
|
|
144
|
-
var
|
|
190
|
+
var Ne = {
|
|
145
191
|
title: "Mantur",
|
|
146
192
|
switchTeam: "Switch Team",
|
|
147
193
|
personalSettings: "Personal Settings",
|
|
@@ -178,6 +224,17 @@ var xe = {
|
|
|
178
224
|
rechargeHint: "Recharge points are valid for 2 years after arrival.",
|
|
179
225
|
payNow: "Pay Now",
|
|
180
226
|
rechargeSuccess: "Recharge successful",
|
|
227
|
+
rechargeOrderCreated: "Recharge order created. Continue to complete payment.",
|
|
228
|
+
stripePaymentTitle: "Stripe Payment",
|
|
229
|
+
stripePaymentDescription: "Complete card payment. Points will be credited automatically after payment succeeds.",
|
|
230
|
+
stripePay: "Confirm Payment",
|
|
231
|
+
stripePaymentLoading: "Loading Stripe payment...",
|
|
232
|
+
stripePaymentConfigMissing: "Stripe publishable key is not configured",
|
|
233
|
+
stripePaymentClientSecretMissing: "Stripe payment credential is missing from the order",
|
|
234
|
+
stripeCheckoutClientSecretInvalid: "Invalid Stripe payment credential. The backend must return a Checkout Session client_secret that starts with cs_.",
|
|
235
|
+
stripePaymentProcessing: "Payment is processing. Please refresh points later.",
|
|
236
|
+
stripePaymentFailed: "Payment failed. Please try again.",
|
|
237
|
+
stripePaymentLoadFailed: "Failed to load Stripe payment. Please refresh and try again.",
|
|
181
238
|
customRechargeAmount: "Custom Amount",
|
|
182
239
|
customRechargeDescription: "Enter the recharge amount you need. Minimum $10 USD.",
|
|
183
240
|
customRechargeMinError: "Minimum recharge is $10 USD",
|
|
@@ -200,10 +257,10 @@ var xe = {
|
|
|
200
257
|
pointsDeductionTip: "Points expiring soon are deducted first.",
|
|
201
258
|
pointsNoteTitle: "Note",
|
|
202
259
|
pointsAccountNote: "Points are attached to your personal account. You recharge, consume, and manage them yourself. Others cannot recharge or use them for you. Recharge points are valid for 2 years; gifted points follow the validity set by operations."
|
|
203
|
-
},
|
|
260
|
+
}, Pe = {
|
|
204
261
|
languageZh: "中文",
|
|
205
262
|
languageEn: "English"
|
|
206
|
-
},
|
|
263
|
+
}, Fe = {
|
|
207
264
|
title: "漫途",
|
|
208
265
|
switchTeam: "切换团队",
|
|
209
266
|
personalSettings: "个人设置",
|
|
@@ -240,6 +297,17 @@ var xe = {
|
|
|
240
297
|
rechargeHint: "充值积分有效期 2 年(自到账日起算),支付后不可退换。",
|
|
241
298
|
payNow: "立即支付",
|
|
242
299
|
rechargeSuccess: "充值成功",
|
|
300
|
+
rechargeOrderCreated: "充值订单已创建,请继续完成支付",
|
|
301
|
+
stripePaymentTitle: "Stripe 支付",
|
|
302
|
+
stripePaymentDescription: "请完成银行卡支付,支付成功后积分将自动到账。",
|
|
303
|
+
stripePay: "确认支付",
|
|
304
|
+
stripePaymentLoading: "正在加载 Stripe 支付组件...",
|
|
305
|
+
stripePaymentConfigMissing: "Stripe publishable key 未配置",
|
|
306
|
+
stripePaymentClientSecretMissing: "订单缺少 Stripe 支付凭证",
|
|
307
|
+
stripeCheckoutClientSecretInvalid: "Stripe 支付凭证类型不正确,请后端返回 Checkout Session 的 client_secret(cs_ 开头)",
|
|
308
|
+
stripePaymentProcessing: "支付处理中,请稍后刷新积分",
|
|
309
|
+
stripePaymentFailed: "支付失败,请重试",
|
|
310
|
+
stripePaymentLoadFailed: "Stripe 支付组件加载失败,请刷新后重试",
|
|
243
311
|
customRechargeAmount: "自定义金额",
|
|
244
312
|
customRechargeDescription: "按需输入充值金额,最低 $10 USD 起充",
|
|
245
313
|
customRechargeMinError: "最低充值 $10 USD",
|
|
@@ -262,70 +330,120 @@ var xe = {
|
|
|
262
330
|
pointsDeductionTip: "优先扣减即将到期的积分",
|
|
263
331
|
pointsNoteTitle: "说明",
|
|
264
332
|
pointsAccountNote: "积分账户挂在你的个人账号上,自己充值、自己消耗、自己负责;他人不能代充、不能代用。充值积分有效期固定 2 年;赠送积分有效期由后台运营发放时设置。"
|
|
265
|
-
},
|
|
333
|
+
}, Ie = {
|
|
266
334
|
languageZh: "中文",
|
|
267
335
|
languageEn: "English"
|
|
268
|
-
},
|
|
336
|
+
}, Le = "i18nextLng", Re = "manturLanguageSource", ze = "mantur-language-change", Be = {
|
|
269
337
|
"zh-CN": {
|
|
270
|
-
...
|
|
271
|
-
...
|
|
338
|
+
...Fe,
|
|
339
|
+
...Ie
|
|
272
340
|
},
|
|
273
341
|
"en-US": {
|
|
274
|
-
...
|
|
275
|
-
...
|
|
342
|
+
...Ne,
|
|
343
|
+
...Pe
|
|
276
344
|
}
|
|
277
345
|
};
|
|
278
|
-
function
|
|
346
|
+
function J(e) {
|
|
279
347
|
return e?.toLowerCase().startsWith("en") ? "en-US" : "zh-CN";
|
|
280
348
|
}
|
|
281
|
-
function
|
|
282
|
-
return typeof window > "u" ? "zh-CN" :
|
|
349
|
+
function Ve() {
|
|
350
|
+
return typeof window > "u" ? "zh-CN" : J(window.localStorage.getItem("i18nextLng") || document.documentElement.lang || navigator.language);
|
|
283
351
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
352
|
+
function He(e) {
|
|
353
|
+
return Be[J(e)];
|
|
286
354
|
}
|
|
287
355
|
//#endregion
|
|
288
356
|
//#region src/lang-switch/LangSwitch.tsx
|
|
289
|
-
var
|
|
290
|
-
function
|
|
357
|
+
var Ue = Le, We = Re;
|
|
358
|
+
function Ge(e, t) {
|
|
291
359
|
document.cookie = `${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/`;
|
|
292
360
|
}
|
|
293
|
-
function
|
|
294
|
-
let { i18n: e } =
|
|
295
|
-
return
|
|
296
|
-
r(
|
|
297
|
-
}, [e.language]), /* @__PURE__ */
|
|
298
|
-
droplist: /* @__PURE__ */
|
|
299
|
-
selectedKeys: [
|
|
361
|
+
function Ke() {
|
|
362
|
+
let { i18n: e } = ee(), [t, r] = a(() => Ve()), i = He(t);
|
|
363
|
+
return n(() => {
|
|
364
|
+
r(J(e.language));
|
|
365
|
+
}, [e.language]), /* @__PURE__ */ L(f, {
|
|
366
|
+
droplist: /* @__PURE__ */ R(g, {
|
|
367
|
+
selectedKeys: [t],
|
|
300
368
|
onClickMenuItem: (t) => {
|
|
301
|
-
let n =
|
|
302
|
-
localStorage.setItem(
|
|
369
|
+
let n = J(t);
|
|
370
|
+
localStorage.setItem(Ue, t), localStorage.setItem(We, "manual"), r(n), e.changeLanguage(t), Ge("Accept-Language", t), window.dispatchEvent(new CustomEvent(ze, { detail: n })), window.location.reload();
|
|
303
371
|
},
|
|
304
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ L(g.Item, { children: i.languageZh }, "zh-CN"), /* @__PURE__ */ L(g.Item, { children: i.languageEn }, "en-US")]
|
|
305
373
|
}),
|
|
306
374
|
trigger: "click",
|
|
307
375
|
position: "br",
|
|
308
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ L(c, {
|
|
309
377
|
shape: "circle",
|
|
310
|
-
icon: /* @__PURE__ */
|
|
378
|
+
icon: /* @__PURE__ */ L(j, {})
|
|
311
379
|
})
|
|
312
380
|
});
|
|
313
381
|
}
|
|
314
382
|
//#endregion
|
|
315
383
|
//#region src/theme-switch/ThemeSwitch.tsx
|
|
316
|
-
function
|
|
317
|
-
let { resolvedTheme: e, setTheme: t } =
|
|
318
|
-
return /* @__PURE__ */
|
|
384
|
+
function qe() {
|
|
385
|
+
let { resolvedTheme: e, setTheme: t } = te();
|
|
386
|
+
return /* @__PURE__ */ L(c, {
|
|
319
387
|
shape: "circle",
|
|
320
|
-
icon:
|
|
388
|
+
icon: L(e === "light" ? M : F, {}),
|
|
321
389
|
onClick: () => {
|
|
322
390
|
t(e === "light" ? "dark" : "light");
|
|
323
391
|
}
|
|
324
392
|
});
|
|
325
393
|
}
|
|
326
394
|
//#endregion
|
|
395
|
+
//#region src/utils/url.ts
|
|
396
|
+
var Je = () => {
|
|
397
|
+
if (typeof window > "u" || !window.location?.href) throw Error("redirectToManturMain requires currentUrl when window.location is unavailable.");
|
|
398
|
+
return window.location.href;
|
|
399
|
+
}, Ye = (e, t) => {
|
|
400
|
+
let n = e.split(".");
|
|
401
|
+
return n.length <= 1 ? t : [t, ...n.slice(1)].join(".");
|
|
402
|
+
}, Xe = (e) => `${e.pathname}${e.search}${e.hash}`;
|
|
403
|
+
function Ze(e, t, n = {}) {
|
|
404
|
+
let r = new URL(n.currentUrl || Je()), i = new URL(r.toString()), a = e?.trim();
|
|
405
|
+
a ? i.hostname = Ye(r.hostname, a) : i.port = "80";
|
|
406
|
+
let o = Xe(r);
|
|
407
|
+
i.pathname = "/login", i.searchParams.set("app", t?.trim()), i.searchParams.set("redirect", o);
|
|
408
|
+
let s = i.toString();
|
|
409
|
+
return n.navigate !== !1 && typeof window < "u" && (window.location.href = s), s;
|
|
410
|
+
}
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region src/utils/stripe-payment-window.ts
|
|
413
|
+
var Qe = "mantur-stripe-payment-window", $e = "/stripe-payment";
|
|
414
|
+
function et(e) {
|
|
415
|
+
if (!e || typeof e != "object") return !1;
|
|
416
|
+
let t = e;
|
|
417
|
+
return t.source === "mantur-components" && t.type === "mantur-stripe-payment-window" && (t.action === "close" || t.action === "success" || t.action === "failed");
|
|
418
|
+
}
|
|
419
|
+
function tt(e = "close", t) {
|
|
420
|
+
if (typeof window > "u") return;
|
|
421
|
+
let n = {
|
|
422
|
+
source: "mantur-components",
|
|
423
|
+
type: Qe,
|
|
424
|
+
action: e,
|
|
425
|
+
orderNo: t
|
|
426
|
+
}, r = window.location.origin;
|
|
427
|
+
window.opener?.postMessage(n, r), window.parent && window.parent !== window && window.parent.postMessage(n, r);
|
|
428
|
+
}
|
|
429
|
+
function nt() {
|
|
430
|
+
return typeof window > "u" ? void 0 : window.__MANTUR_MAIN_PREFIX__ || void 0;
|
|
431
|
+
}
|
|
432
|
+
function rt() {
|
|
433
|
+
return typeof window > "u" ? "mantur" : window.__MANTUR_APP_NAME__ || "mantur";
|
|
434
|
+
}
|
|
435
|
+
function it(e) {
|
|
436
|
+
let t = e.clientSecret || e.stripeClientSecret;
|
|
437
|
+
if (typeof window > "u" || !e.orderNo || !t) return;
|
|
438
|
+
let n = new URL($e, window.location.href);
|
|
439
|
+
return n.searchParams.set("orderNo", e.orderNo), n.searchParams.set("clientSecret", t), e.amount !== void 0 && n.searchParams.set("amount", String(e.amount)), e.points !== void 0 && n.searchParams.set("points", String(e.points)), Ze(nt(), rt(), {
|
|
440
|
+
currentUrl: n,
|
|
441
|
+
navigate: !1
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
//#endregion
|
|
327
445
|
//#region src/header/mock.ts
|
|
328
|
-
var
|
|
446
|
+
var at = [
|
|
329
447
|
{
|
|
330
448
|
id: "points-500",
|
|
331
449
|
points: 500,
|
|
@@ -342,7 +460,7 @@ var Z = [
|
|
|
342
460
|
price: 50,
|
|
343
461
|
recommended: !0
|
|
344
462
|
}
|
|
345
|
-
],
|
|
463
|
+
], ot = [
|
|
346
464
|
{
|
|
347
465
|
id: "recharge-1",
|
|
348
466
|
type: "income",
|
|
@@ -415,31 +533,31 @@ var Z = [
|
|
|
415
533
|
badgeKind: "deducted",
|
|
416
534
|
badgeText: "已扣除"
|
|
417
535
|
}
|
|
418
|
-
], { RangePicker:
|
|
419
|
-
function
|
|
536
|
+
], { RangePicker: st } = u, ct = 21, lt = 7;
|
|
537
|
+
function ut(e) {
|
|
420
538
|
return e === "recharge" ? "arcoblue" : e === "gift" ? "cyan" : e === "expired" ? "gray" : "orange";
|
|
421
539
|
}
|
|
422
|
-
function
|
|
423
|
-
let [
|
|
424
|
-
let [e, t] =
|
|
425
|
-
return
|
|
426
|
-
let r =
|
|
540
|
+
function dt({ visible: e, points: t, text: n, onCancel: i, onRecharge: o }) {
|
|
541
|
+
let [s, u] = a("all"), [d, f] = a("all"), [p, h] = a(["2026-04-15", "2026-05-15"]), [g, x] = a(1), E = (e) => new Intl.NumberFormat().format(e), D = r(() => {
|
|
542
|
+
let [e, t] = p;
|
|
543
|
+
return ot.filter((n) => {
|
|
544
|
+
let r = s === "all" || n.type === s, i = d === "all" || n.source === d, a = !e || n.date >= e, o = !t || n.date <= t;
|
|
427
545
|
return r && i && a && o;
|
|
428
546
|
});
|
|
429
547
|
}, [
|
|
430
|
-
|
|
548
|
+
p,
|
|
431
549
|
d,
|
|
432
|
-
|
|
550
|
+
s
|
|
433
551
|
]), O = [
|
|
434
552
|
{
|
|
435
|
-
title:
|
|
553
|
+
title: n.pointsDetail,
|
|
436
554
|
dataIndex: "name",
|
|
437
|
-
render: (e, t) => /* @__PURE__ */
|
|
555
|
+
render: (e, t) => /* @__PURE__ */ R("div", {
|
|
438
556
|
className: "min-w-0",
|
|
439
|
-
children: [/* @__PURE__ */
|
|
557
|
+
children: [/* @__PURE__ */ L(T.Text, {
|
|
440
558
|
className: "font-medium!",
|
|
441
559
|
children: t.name
|
|
442
|
-
}), /* @__PURE__ */
|
|
560
|
+
}), /* @__PURE__ */ L(T.Text, {
|
|
443
561
|
type: "secondary",
|
|
444
562
|
className: "mt-1 block! text-xs!",
|
|
445
563
|
children: t.meta
|
|
@@ -447,188 +565,188 @@ function ze({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
447
565
|
})
|
|
448
566
|
},
|
|
449
567
|
{
|
|
450
|
-
title:
|
|
568
|
+
title: n.pointsUnit,
|
|
451
569
|
dataIndex: "amount",
|
|
452
570
|
width: 120,
|
|
453
571
|
align: "right",
|
|
454
|
-
render: (e, t) => /* @__PURE__ */
|
|
572
|
+
render: (e, t) => /* @__PURE__ */ R(T.Text, {
|
|
455
573
|
className: `font-semibold! ${t.amount > 0 ? "text-arco-success-6!" : "text-arco-danger-6!"}`,
|
|
456
574
|
children: [t.amount > 0 ? "+" : "", E(t.amount)]
|
|
457
575
|
})
|
|
458
576
|
},
|
|
459
577
|
{
|
|
460
|
-
title:
|
|
578
|
+
title: n.source,
|
|
461
579
|
dataIndex: "badgeText",
|
|
462
580
|
width: 110,
|
|
463
581
|
align: "right",
|
|
464
|
-
render: (e, t) => /* @__PURE__ */
|
|
465
|
-
color:
|
|
582
|
+
render: (e, t) => /* @__PURE__ */ L(w, {
|
|
583
|
+
color: ut(t.badgeKind),
|
|
466
584
|
children: t.badgeText
|
|
467
585
|
})
|
|
468
586
|
}
|
|
469
587
|
];
|
|
470
|
-
return /* @__PURE__ */
|
|
471
|
-
title:
|
|
588
|
+
return /* @__PURE__ */ L(v, {
|
|
589
|
+
title: n.pointsDetail,
|
|
472
590
|
visible: e,
|
|
473
|
-
footer: /* @__PURE__ */
|
|
591
|
+
footer: /* @__PURE__ */ R("div", {
|
|
474
592
|
className: "flex justify-end gap-2",
|
|
475
|
-
children: [/* @__PURE__ */
|
|
476
|
-
onClick:
|
|
477
|
-
children:
|
|
478
|
-
}), /* @__PURE__ */
|
|
593
|
+
children: [/* @__PURE__ */ L(c, {
|
|
594
|
+
onClick: i,
|
|
595
|
+
children: n.close
|
|
596
|
+
}), /* @__PURE__ */ L(c, {
|
|
479
597
|
type: "primary",
|
|
480
|
-
icon: /* @__PURE__ */
|
|
598
|
+
icon: /* @__PURE__ */ L(N, {}),
|
|
481
599
|
onClick: () => {
|
|
482
|
-
|
|
600
|
+
i(), o();
|
|
483
601
|
},
|
|
484
|
-
children:
|
|
602
|
+
children: n.recharge
|
|
485
603
|
})]
|
|
486
604
|
}),
|
|
487
|
-
onCancel:
|
|
605
|
+
onCancel: i,
|
|
488
606
|
style: {
|
|
489
607
|
width: 780,
|
|
490
608
|
maxWidth: "calc(100vw - 48px)"
|
|
491
609
|
},
|
|
492
|
-
children: /* @__PURE__ */
|
|
610
|
+
children: /* @__PURE__ */ R("div", {
|
|
493
611
|
className: "max-h-[70vh] overflow-y-auto",
|
|
494
612
|
children: [
|
|
495
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ R(l, {
|
|
496
614
|
bordered: !1,
|
|
497
615
|
className: "from-arco-primary-light-1/40 to-cyan-400/5 rounded-none! bg-linear-to-br!",
|
|
498
616
|
children: [
|
|
499
|
-
/* @__PURE__ */
|
|
617
|
+
/* @__PURE__ */ L(T.Text, {
|
|
500
618
|
type: "secondary",
|
|
501
619
|
className: "text-xs!",
|
|
502
|
-
children:
|
|
620
|
+
children: n.totalBalance
|
|
503
621
|
}),
|
|
504
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ R("div", {
|
|
505
623
|
className: "mt-1.5 mb-3.5 ",
|
|
506
|
-
children: [/* @__PURE__ */
|
|
624
|
+
children: [/* @__PURE__ */ L(T.Text, {
|
|
507
625
|
className: "text-3xl! font-bold!",
|
|
508
626
|
children: E(t.total)
|
|
509
|
-
}), /* @__PURE__ */
|
|
627
|
+
}), /* @__PURE__ */ R(T.Text, {
|
|
510
628
|
type: "secondary",
|
|
511
629
|
className: "ml-2 text-sm! ",
|
|
512
|
-
children: ["🪙 ",
|
|
630
|
+
children: ["🪙 ", n.pointsUnit]
|
|
513
631
|
})]
|
|
514
632
|
}),
|
|
515
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ R(m.Row, {
|
|
516
634
|
gutter: 12,
|
|
517
|
-
children: [/* @__PURE__ */
|
|
635
|
+
children: [/* @__PURE__ */ L(m.Col, {
|
|
518
636
|
span: 12,
|
|
519
|
-
children: /* @__PURE__ */
|
|
637
|
+
children: /* @__PURE__ */ R(l, {
|
|
520
638
|
size: "small",
|
|
521
|
-
children: [/* @__PURE__ */
|
|
639
|
+
children: [/* @__PURE__ */ R("div", {
|
|
522
640
|
className: "mb-1 flex items-center justify-between",
|
|
523
|
-
children: [/* @__PURE__ */
|
|
641
|
+
children: [/* @__PURE__ */ L(T.Text, {
|
|
524
642
|
type: "secondary",
|
|
525
643
|
className: "text-xs!",
|
|
526
|
-
children:
|
|
527
|
-
}), /* @__PURE__ */
|
|
644
|
+
children: n.rechargePoints
|
|
645
|
+
}), /* @__PURE__ */ L(w, {
|
|
528
646
|
color: "arcoblue",
|
|
529
|
-
children:
|
|
647
|
+
children: n.sourceRecharge
|
|
530
648
|
})]
|
|
531
|
-
}), /* @__PURE__ */
|
|
649
|
+
}), /* @__PURE__ */ L(T.Text, {
|
|
532
650
|
className: "text-lg! font-semibold!",
|
|
533
651
|
children: E(t.recharge)
|
|
534
652
|
})]
|
|
535
653
|
})
|
|
536
|
-
}), /* @__PURE__ */
|
|
654
|
+
}), /* @__PURE__ */ L(m.Col, {
|
|
537
655
|
span: 12,
|
|
538
|
-
children: /* @__PURE__ */
|
|
656
|
+
children: /* @__PURE__ */ R(l, {
|
|
539
657
|
size: "small",
|
|
540
|
-
children: [/* @__PURE__ */
|
|
658
|
+
children: [/* @__PURE__ */ R("div", {
|
|
541
659
|
className: "mb-1 flex items-center justify-between",
|
|
542
|
-
children: [/* @__PURE__ */
|
|
660
|
+
children: [/* @__PURE__ */ L(T.Text, {
|
|
543
661
|
type: "secondary",
|
|
544
662
|
className: "text-xs!",
|
|
545
|
-
children:
|
|
546
|
-
}), /* @__PURE__ */
|
|
663
|
+
children: n.giftedPoints
|
|
664
|
+
}), /* @__PURE__ */ L(w, {
|
|
547
665
|
color: "success",
|
|
548
|
-
children:
|
|
666
|
+
children: n.sourceGifted
|
|
549
667
|
})]
|
|
550
|
-
}), /* @__PURE__ */
|
|
668
|
+
}), /* @__PURE__ */ L(T.Text, {
|
|
551
669
|
className: "text-lg! font-semibold!",
|
|
552
670
|
children: E(t.gifted)
|
|
553
671
|
})]
|
|
554
672
|
})
|
|
555
673
|
})]
|
|
556
674
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ L(T.Text, {
|
|
558
676
|
type: "secondary",
|
|
559
677
|
className: "mt-2.5 block! text-xs!",
|
|
560
|
-
children:
|
|
678
|
+
children: n.pointsDeductionTip
|
|
561
679
|
})
|
|
562
680
|
]
|
|
563
681
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ R("div", {
|
|
565
683
|
className: "px-6 py-4",
|
|
566
684
|
children: [
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
activeTab:
|
|
685
|
+
/* @__PURE__ */ R(C, {
|
|
686
|
+
activeTab: s,
|
|
569
687
|
onChange: (e) => u(e),
|
|
570
688
|
children: [
|
|
571
|
-
/* @__PURE__ */
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ L(C.TabPane, { title: n.all }, "all"),
|
|
690
|
+
/* @__PURE__ */ L(C.TabPane, { title: n.income }, "income"),
|
|
691
|
+
/* @__PURE__ */ L(C.TabPane, { title: n.expense }, "expense")
|
|
574
692
|
]
|
|
575
693
|
}),
|
|
576
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ R("div", {
|
|
577
695
|
className: "mt-2 mb-3.5 flex flex-wrap items-center gap-2.5",
|
|
578
696
|
children: [
|
|
579
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ R(b, {
|
|
580
698
|
value: d,
|
|
581
699
|
style: { width: 140 },
|
|
582
|
-
onChange: (e) =>
|
|
700
|
+
onChange: (e) => f(e),
|
|
583
701
|
children: [
|
|
584
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ L(b.Option, {
|
|
585
703
|
value: "all",
|
|
586
|
-
children:
|
|
704
|
+
children: n.sourceAll
|
|
587
705
|
}),
|
|
588
|
-
/* @__PURE__ */
|
|
706
|
+
/* @__PURE__ */ L(b.Option, {
|
|
589
707
|
value: "recharge",
|
|
590
|
-
children:
|
|
708
|
+
children: n.sourceRecharge
|
|
591
709
|
}),
|
|
592
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ L(b.Option, {
|
|
593
711
|
value: "gift",
|
|
594
|
-
children:
|
|
712
|
+
children: n.sourceGifted
|
|
595
713
|
})
|
|
596
714
|
]
|
|
597
715
|
}),
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
value:
|
|
600
|
-
onChange: (e) =>
|
|
716
|
+
/* @__PURE__ */ L(st, {
|
|
717
|
+
value: p,
|
|
718
|
+
onChange: (e) => h(e),
|
|
601
719
|
style: { width: 260 }
|
|
602
720
|
}),
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
onClick: () =>
|
|
605
|
-
children:
|
|
721
|
+
/* @__PURE__ */ L(c, {
|
|
722
|
+
onClick: () => _.success(n.refreshed),
|
|
723
|
+
children: n.query
|
|
606
724
|
})
|
|
607
725
|
]
|
|
608
726
|
}),
|
|
609
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ L(S, {
|
|
610
728
|
rowKey: "id",
|
|
611
729
|
columns: O,
|
|
612
730
|
data: D,
|
|
613
731
|
pagination: !1,
|
|
614
732
|
border: !1
|
|
615
733
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ L(y, {
|
|
617
735
|
className: "mt-3 flex justify-center!",
|
|
618
|
-
current:
|
|
619
|
-
pageSize:
|
|
620
|
-
total:
|
|
621
|
-
onChange:
|
|
736
|
+
current: g,
|
|
737
|
+
pageSize: lt,
|
|
738
|
+
total: ct,
|
|
739
|
+
onChange: x
|
|
622
740
|
})
|
|
623
741
|
]
|
|
624
742
|
}),
|
|
625
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ L(l, {
|
|
626
744
|
bordered: !1,
|
|
627
745
|
className: "bg-arco-primary-light-1/30 rounded-none!",
|
|
628
|
-
children: /* @__PURE__ */
|
|
746
|
+
children: /* @__PURE__ */ R(T.Text, {
|
|
629
747
|
type: "secondary",
|
|
630
748
|
className: "text-xs! leading-6!",
|
|
631
|
-
children: [/* @__PURE__ */
|
|
749
|
+
children: [/* @__PURE__ */ R("strong", { children: [n.pointsNoteTitle, ":"] }), n.pointsAccountNote]
|
|
632
750
|
})
|
|
633
751
|
})
|
|
634
752
|
]
|
|
@@ -637,17 +755,17 @@ function ze({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
637
755
|
}
|
|
638
756
|
//#endregion
|
|
639
757
|
//#region src/labels.ts
|
|
640
|
-
var
|
|
641
|
-
function
|
|
758
|
+
var ft = Ne;
|
|
759
|
+
function pt(e) {
|
|
642
760
|
return {
|
|
643
|
-
...
|
|
761
|
+
...ft,
|
|
644
762
|
...e
|
|
645
763
|
};
|
|
646
764
|
}
|
|
647
765
|
//#endregion
|
|
648
766
|
//#region src/header/components/ProfileModal.tsx
|
|
649
|
-
var
|
|
650
|
-
function
|
|
767
|
+
var mt = 2048, ht = 2 * 1024 * 1024;
|
|
768
|
+
function gt(e) {
|
|
651
769
|
return new Promise((t, n) => {
|
|
652
770
|
let r = URL.createObjectURL(e), i = new Image();
|
|
653
771
|
i.onload = () => {
|
|
@@ -660,80 +778,80 @@ function We(e) {
|
|
|
660
778
|
}, i.src = r;
|
|
661
779
|
});
|
|
662
780
|
}
|
|
663
|
-
function
|
|
664
|
-
let u =
|
|
665
|
-
|
|
781
|
+
function _t({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
782
|
+
let u = pt(r), [d] = p.useForm(), [f, m] = a(!1), [g, y] = a(null), [b, x] = a(null), S = i(null);
|
|
783
|
+
n(() => () => {
|
|
666
784
|
S.current &&= (URL.revokeObjectURL(S.current), null);
|
|
667
|
-
}, []),
|
|
668
|
-
e && (
|
|
785
|
+
}, []), n(() => {
|
|
786
|
+
e && (d.setFieldsValue({ nickname: t?.nickname || t?.username || "" }), y(null), x((e) => (e && URL.revokeObjectURL(e), S.current = null, null)));
|
|
669
787
|
}, [
|
|
670
788
|
e,
|
|
671
|
-
|
|
672
|
-
|
|
789
|
+
t,
|
|
790
|
+
d
|
|
673
791
|
]);
|
|
674
|
-
let
|
|
675
|
-
console.error(t),
|
|
676
|
-
},
|
|
677
|
-
|
|
792
|
+
let C = (e, t) => {
|
|
793
|
+
console.error(t), _.error(e);
|
|
794
|
+
}, w = (e) => {
|
|
795
|
+
_.success(e);
|
|
678
796
|
};
|
|
679
|
-
return /* @__PURE__ */
|
|
797
|
+
return /* @__PURE__ */ L(v, {
|
|
680
798
|
title: u.profileTitle,
|
|
681
799
|
visible: e,
|
|
682
800
|
onOk: async () => {
|
|
683
801
|
try {
|
|
684
|
-
let e = await
|
|
685
|
-
|
|
802
|
+
let e = await d.validate();
|
|
803
|
+
m(!0), await l({
|
|
686
804
|
nickname: e.nickname,
|
|
687
|
-
avatarFile:
|
|
688
|
-
}),
|
|
805
|
+
avatarFile: g
|
|
806
|
+
}), w(u.profileUpdateSuccess), o();
|
|
689
807
|
} catch (e) {
|
|
690
|
-
e instanceof Error &&
|
|
808
|
+
e instanceof Error && C(e.message || u.error, e);
|
|
691
809
|
} finally {
|
|
692
|
-
|
|
810
|
+
m(!1);
|
|
693
811
|
}
|
|
694
812
|
},
|
|
695
|
-
onCancel:
|
|
696
|
-
confirmLoading:
|
|
813
|
+
onCancel: o,
|
|
814
|
+
confirmLoading: f,
|
|
697
815
|
okText: u.profileSave,
|
|
698
816
|
cancelText: u.profileCancel,
|
|
699
|
-
children: /* @__PURE__ */
|
|
700
|
-
form:
|
|
817
|
+
children: /* @__PURE__ */ R(p, {
|
|
818
|
+
form: d,
|
|
701
819
|
layout: "vertical",
|
|
702
|
-
children: [/* @__PURE__ */
|
|
820
|
+
children: [/* @__PURE__ */ L(p.Item, {
|
|
703
821
|
label: u.profileNickname,
|
|
704
822
|
field: "nickname",
|
|
705
823
|
rules: [{
|
|
706
824
|
required: !0,
|
|
707
825
|
message: u.profileNicknamePlaceholder
|
|
708
826
|
}],
|
|
709
|
-
children: /* @__PURE__ */
|
|
827
|
+
children: /* @__PURE__ */ L(h, {
|
|
710
828
|
placeholder: u.profileNicknamePlaceholder,
|
|
711
829
|
allowClear: !0
|
|
712
830
|
})
|
|
713
|
-
}), /* @__PURE__ */
|
|
831
|
+
}), /* @__PURE__ */ L(p.Item, {
|
|
714
832
|
label: u.profileAvatar,
|
|
715
|
-
children: /* @__PURE__ */
|
|
833
|
+
children: /* @__PURE__ */ R("div", {
|
|
716
834
|
className: "flex flex-col gap-2",
|
|
717
|
-
children: [/* @__PURE__ */
|
|
835
|
+
children: [/* @__PURE__ */ R("div", {
|
|
718
836
|
className: "flex items-center gap-3",
|
|
719
|
-
children: [/* @__PURE__ */
|
|
837
|
+
children: [/* @__PURE__ */ L(s, {
|
|
720
838
|
size: 64,
|
|
721
839
|
className: "shrink-0 bg-arco-primary-light-1!",
|
|
722
|
-
children: b ||
|
|
723
|
-
src: b ||
|
|
840
|
+
children: b || t?.avatar ? /* @__PURE__ */ L("img", {
|
|
841
|
+
src: b || t?.avatar,
|
|
724
842
|
alt: "",
|
|
725
843
|
className: "block h-full w-full object-cover"
|
|
726
|
-
}) :
|
|
727
|
-
}), /* @__PURE__ */
|
|
844
|
+
}) : t?.nickname?.[0] || t?.username?.[0] || "U"
|
|
845
|
+
}), /* @__PURE__ */ L(E, {
|
|
728
846
|
accept: "image/*",
|
|
729
847
|
showUploadList: !1,
|
|
730
848
|
beforeUpload: async (e) => {
|
|
731
|
-
if (e.size >
|
|
849
|
+
if (e.size > ht) return C(u.profileAvatarTooLarge), !1;
|
|
732
850
|
try {
|
|
733
|
-
let { width: t, height: n } = await
|
|
734
|
-
if (t >
|
|
851
|
+
let { width: t, height: n } = await gt(e);
|
|
852
|
+
if (t > mt || n > mt) return C(u.profileAvatarDimensionExceeded), !1;
|
|
735
853
|
} catch (e) {
|
|
736
|
-
return
|
|
854
|
+
return C(u.profileAvatarInvalidImage, e), !1;
|
|
737
855
|
}
|
|
738
856
|
return x((t) => {
|
|
739
857
|
t && URL.revokeObjectURL(t);
|
|
@@ -741,14 +859,14 @@ function Ge({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
741
859
|
return S.current = n, n;
|
|
742
860
|
}), y(e), !1;
|
|
743
861
|
},
|
|
744
|
-
children: /* @__PURE__ */
|
|
862
|
+
children: /* @__PURE__ */ L(c, {
|
|
745
863
|
type: "outline",
|
|
746
864
|
size: "small",
|
|
747
|
-
icon: /* @__PURE__ */
|
|
865
|
+
icon: /* @__PURE__ */ L(I, {}),
|
|
748
866
|
children: u.profileUploadAvatar
|
|
749
867
|
})
|
|
750
868
|
})]
|
|
751
|
-
}), /* @__PURE__ */
|
|
869
|
+
}), /* @__PURE__ */ L("span", {
|
|
752
870
|
className: "text-xs text-arco-text-3",
|
|
753
871
|
children: u.profileAvatarHint
|
|
754
872
|
})]
|
|
@@ -759,53 +877,70 @@ function Ge({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
759
877
|
}
|
|
760
878
|
//#endregion
|
|
761
879
|
//#region src/header/components/UserAvatar.tsx
|
|
762
|
-
function
|
|
880
|
+
function vt(e) {
|
|
763
881
|
return e?.nickname?.[0] || e?.username?.[0] || "U";
|
|
764
882
|
}
|
|
765
|
-
function
|
|
766
|
-
return /* @__PURE__ */
|
|
883
|
+
function yt({ user: e, size: t, className: n = "" }) {
|
|
884
|
+
return /* @__PURE__ */ L(s, {
|
|
767
885
|
size: t,
|
|
768
886
|
className: `bg-arco-primary/20! text-arco-primary-6 border-2 font-bold ${n}`,
|
|
769
|
-
children: e?.avatar ? /* @__PURE__ */
|
|
887
|
+
children: e?.avatar ? /* @__PURE__ */ L("img", {
|
|
770
888
|
src: e.avatar,
|
|
771
889
|
alt: "avatar",
|
|
772
890
|
className: "h-full w-full object-cover"
|
|
773
|
-
}) :
|
|
891
|
+
}) : vt(e)
|
|
774
892
|
});
|
|
775
893
|
}
|
|
776
894
|
//#endregion
|
|
777
895
|
//#region src/header/components/RechargeModal.tsx
|
|
778
|
-
|
|
779
|
-
|
|
896
|
+
var bt = {
|
|
897
|
+
minHeight: 292,
|
|
898
|
+
height: "100%",
|
|
899
|
+
display: "flex",
|
|
900
|
+
flexDirection: "column",
|
|
901
|
+
justifyContent: "space-between"
|
|
902
|
+
}, xt = "relative h-full! min-h-[292px]! w-full! overflow-hidden rounded-lg! border shadow-sm! transition-all duration-200 before:absolute before:inset-x-0 before:top-0 before:h-1 before:bg-linear-to-r before:from-arco-primary before:to-transparent hover:shadow-md! [&_.arco-card-body]:flex! [&_.arco-card-body]:h-full! [&_.arco-card-body]:flex-col! [&_.arco-card-body]:justify-between!";
|
|
903
|
+
function St({ visible: e, user: t, points: r, text: o, packages: s, packageLoading: u = !1, submitting: d = !1, onCancel: f, onPay: p }) {
|
|
904
|
+
let [g, _] = a(at[2].id), [y, b] = a(""), x = i(null), S = s?.length ? s : at, C = (e) => new Intl.NumberFormat().format(e), E = y.trim(), O = Number(E), k = E.length > 0, A = g === "custom", j = k && Number.isFinite(O) && Number.isInteger(O) && O >= 10, M = S.find((e) => e.id === g), N = A && j ? {
|
|
780
905
|
id: "custom",
|
|
781
|
-
price:
|
|
782
|
-
points:
|
|
906
|
+
price: O,
|
|
907
|
+
points: O * 100,
|
|
783
908
|
custom: !0
|
|
784
|
-
} :
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
909
|
+
} : M, P = N ? `${o.payNow} · $${N.price}` : k ? o.customRechargeMinError : o.selectRechargePackage;
|
|
910
|
+
n(() => {
|
|
911
|
+
!e || A || S.some((e) => e.id === g) || _((S.find((e) => e.recommended) || S[0])?.id || "custom");
|
|
912
|
+
}, [
|
|
913
|
+
S,
|
|
914
|
+
A,
|
|
915
|
+
g,
|
|
916
|
+
e
|
|
917
|
+
]);
|
|
918
|
+
let F = (e) => {
|
|
919
|
+
_(e), b("");
|
|
920
|
+
}, I = () => {
|
|
921
|
+
_("custom"), b((e) => e || "10"), x.current?.focus();
|
|
788
922
|
};
|
|
789
|
-
return /* @__PURE__ */
|
|
790
|
-
title:
|
|
923
|
+
return /* @__PURE__ */ L(v, {
|
|
924
|
+
title: o.rechargeTitle,
|
|
791
925
|
visible: e,
|
|
792
|
-
footer: /* @__PURE__ */
|
|
926
|
+
footer: /* @__PURE__ */ R("div", {
|
|
793
927
|
className: "mx-auto flex max-w-7xl items-center justify-between gap-5",
|
|
794
|
-
children: [/* @__PURE__ */
|
|
928
|
+
children: [/* @__PURE__ */ L("span", {
|
|
795
929
|
className: "text-arco-text-2 text-sm leading-6",
|
|
796
|
-
children:
|
|
797
|
-
}), /* @__PURE__ */
|
|
930
|
+
children: o.rechargeHint
|
|
931
|
+
}), /* @__PURE__ */ L(c, {
|
|
798
932
|
type: "primary",
|
|
799
933
|
size: "large",
|
|
800
934
|
className: "min-w-48! font-bold!",
|
|
801
|
-
disabled: !
|
|
935
|
+
disabled: !N || u || d,
|
|
936
|
+
loading: d,
|
|
802
937
|
onClick: () => {
|
|
803
|
-
|
|
938
|
+
N && p(N);
|
|
804
939
|
},
|
|
805
|
-
children:
|
|
940
|
+
children: P
|
|
806
941
|
})]
|
|
807
942
|
}),
|
|
808
|
-
onCancel:
|
|
943
|
+
onCancel: f,
|
|
809
944
|
alignCenter: !1,
|
|
810
945
|
wrapClassName: "overflow-hidden!",
|
|
811
946
|
style: {
|
|
@@ -815,165 +950,164 @@ function qe({ visible: e, user: t, points: n, text: a, onCancel: c, onPay: l })
|
|
|
815
950
|
paddingBottom: 0
|
|
816
951
|
},
|
|
817
952
|
className: "top-0! m-0! flex! h-screen! w-screen! max-w-none! flex-col! [&_.arco-modal-body]:min-h-0! [&_.arco-modal-body]:flex-1! [&_.arco-modal-body]:overflow-hidden! [&_.arco-modal-body]:p-0! [&_.arco-modal-close-icon]:top-1.5! [&_.arco-modal-close-icon]:right-4! [&_.arco-modal-close-icon]:inline-flex! [&_.arco-modal-close-icon]:h-9! [&_.arco-modal-close-icon]:w-9! [&_.arco-modal-close-icon]:items-center! [&_.arco-modal-close-icon]:justify-center! [&_.arco-modal-close-icon]:rounded-lg! [&_.arco-modal-close-icon]:text-lg! [&_.arco-modal-close-icon]:leading-9! [&_.arco-modal-close-icon]:transition-colors [&_.arco-modal-close-icon:hover]:bg-arco-fill-2 [&_.arco-modal-close-icon:hover]:text-arco-primary-6 [&_.arco-modal-close-icon_svg]:h-[18px]! [&_.arco-modal-close-icon_svg]:w-[18px]! [&_.arco-modal-content]:flex! [&_.arco-modal-content]:h-auto! [&_.arco-modal-content]:min-h-0! [&_.arco-modal-content]:flex-1! [&_.arco-modal-content]:flex-col! [&_.arco-modal-content]:overflow-hidden! [&_.arco-modal-content]:rounded-none! [&_.arco-modal-footer]:shrink-0! [&_.arco-modal-header]:shrink-0!",
|
|
818
|
-
children: /* @__PURE__ */
|
|
953
|
+
children: /* @__PURE__ */ R("div", {
|
|
819
954
|
className: "mx-auto flex h-full w-full max-w-7xl flex-col items-center ",
|
|
820
|
-
children: [/* @__PURE__ */
|
|
955
|
+
children: [/* @__PURE__ */ R("div", {
|
|
821
956
|
className: "w-full border-arco-border-1 bg-arco-fill-1 text-arco-text-2 flex items-center gap-2.5 rounded-lg border px-3.5 py-3 text-sm",
|
|
822
|
-
children: [/* @__PURE__ */
|
|
957
|
+
children: [/* @__PURE__ */ L(yt, {
|
|
823
958
|
user: t,
|
|
824
959
|
size: 32,
|
|
825
960
|
className: "shrink-0"
|
|
826
|
-
}), /* @__PURE__ */
|
|
961
|
+
}), /* @__PURE__ */ R("span", { children: [
|
|
827
962
|
t?.nickname || t?.username,
|
|
828
963
|
" · ",
|
|
829
|
-
|
|
964
|
+
o.currentBalance,
|
|
830
965
|
" ",
|
|
831
|
-
/* @__PURE__ */
|
|
966
|
+
/* @__PURE__ */ L("strong", {
|
|
832
967
|
className: "text-arco-text-1",
|
|
833
|
-
children:
|
|
968
|
+
children: C(r.total)
|
|
834
969
|
}),
|
|
835
970
|
" ",
|
|
836
|
-
|
|
971
|
+
o.pointsUnit
|
|
837
972
|
] })]
|
|
838
|
-
}), /* @__PURE__ */
|
|
973
|
+
}), /* @__PURE__ */ L("div", {
|
|
839
974
|
className: "mt-6 w-full",
|
|
840
|
-
children: /* @__PURE__ */
|
|
975
|
+
children: /* @__PURE__ */ R(m.Row, {
|
|
841
976
|
gutter: [16, 16],
|
|
842
|
-
|
|
977
|
+
style: { alignItems: "stretch" },
|
|
978
|
+
children: [S.map((e) => /* @__PURE__ */ L(m.Col, {
|
|
843
979
|
xs: 24,
|
|
844
980
|
sm: 12,
|
|
845
981
|
lg: 6,
|
|
846
|
-
|
|
982
|
+
style: { display: "flex" },
|
|
983
|
+
children: /* @__PURE__ */ R(l, {
|
|
847
984
|
hoverable: !0,
|
|
985
|
+
loading: u,
|
|
848
986
|
role: "button",
|
|
849
987
|
tabIndex: 0,
|
|
850
|
-
onClick: () =>
|
|
988
|
+
onClick: () => F(e.id),
|
|
851
989
|
onKeyDown: (t) => {
|
|
852
|
-
(t.key === "Enter" || t.key === " ") &&
|
|
853
|
-
},
|
|
854
|
-
bodyStyle: {
|
|
855
|
-
minHeight: 192,
|
|
856
|
-
display: "flex",
|
|
857
|
-
flexDirection: "column",
|
|
858
|
-
justifyContent: "space-between"
|
|
990
|
+
(t.key === "Enter" || t.key === " ") && F(e.id);
|
|
859
991
|
},
|
|
860
|
-
|
|
992
|
+
bodyStyle: bt,
|
|
993
|
+
className: `${xt} border-arco-border-2! bg-arco-bg-2! cursor-pointer ${g === e.id ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : "hover:border-arco-primary-6!"}`,
|
|
861
994
|
children: [
|
|
862
|
-
|
|
863
|
-
"recommended" in e && e.recommended ? /* @__PURE__ */
|
|
995
|
+
g === e.id ? /* @__PURE__ */ L(D, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
|
|
996
|
+
"recommended" in e && e.recommended ? /* @__PURE__ */ L(w, {
|
|
864
997
|
color: "arcoblue",
|
|
865
998
|
className: "absolute top-4 right-4 text-xs! font-bold!",
|
|
866
999
|
children: "HOT"
|
|
867
1000
|
}) : null,
|
|
868
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ R("div", {
|
|
869
1002
|
className: "min-w-0 pr-16",
|
|
870
|
-
children: [/* @__PURE__ */
|
|
1003
|
+
children: [/* @__PURE__ */ R(T.Text, {
|
|
871
1004
|
className: "flex items-center text-3xl! leading-tight! font-bold!",
|
|
872
|
-
children: [
|
|
1005
|
+
children: [C(e.points), /* @__PURE__ */ L("span", {
|
|
873
1006
|
className: "ml-1 text-2xl",
|
|
874
1007
|
children: "🪙"
|
|
875
1008
|
})]
|
|
876
|
-
}), /* @__PURE__ */
|
|
1009
|
+
}), /* @__PURE__ */ L(T.Text, {
|
|
877
1010
|
type: "secondary",
|
|
878
1011
|
className: "mt-1 block! text-sm!",
|
|
879
|
-
children:
|
|
1012
|
+
children: o.pointsUnit
|
|
880
1013
|
})]
|
|
881
1014
|
}),
|
|
882
|
-
/* @__PURE__ */
|
|
1015
|
+
/* @__PURE__ */ L("div", {
|
|
883
1016
|
className: "mt-7 flex w-full justify-end",
|
|
884
|
-
children: /* @__PURE__ */
|
|
1017
|
+
children: /* @__PURE__ */ R(T.Text, {
|
|
885
1018
|
className: "text-arco-primary-6! text-right text-2xl! leading-tight! font-bold!",
|
|
886
1019
|
children: ["$", e.price]
|
|
887
1020
|
})
|
|
888
1021
|
})
|
|
889
1022
|
]
|
|
890
1023
|
})
|
|
891
|
-
}, e.id)), /* @__PURE__ */
|
|
1024
|
+
}, e.id)), /* @__PURE__ */ L(m.Col, {
|
|
892
1025
|
xs: 24,
|
|
893
1026
|
sm: 12,
|
|
894
1027
|
lg: 6,
|
|
895
|
-
|
|
1028
|
+
style: { display: "flex" },
|
|
1029
|
+
children: /* @__PURE__ */ R(l, {
|
|
896
1030
|
role: "button",
|
|
897
1031
|
tabIndex: 0,
|
|
898
|
-
onClick:
|
|
1032
|
+
onClick: I,
|
|
899
1033
|
onKeyDown: (e) => {
|
|
900
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
901
|
-
},
|
|
902
|
-
bodyStyle: {
|
|
903
|
-
minHeight: 192,
|
|
904
|
-
display: "flex",
|
|
905
|
-
flexDirection: "column",
|
|
906
|
-
justifyContent: "space-between"
|
|
1034
|
+
(e.key === "Enter" || e.key === " ") && I();
|
|
907
1035
|
},
|
|
908
|
-
|
|
1036
|
+
bodyStyle: bt,
|
|
1037
|
+
className: `${xt} cursor-text ${j ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : k && A ? "border-arco-danger-6! bg-arco-bg-1! hover:border-arco-danger-6!" : "border-arco-primary-6/30! bg-arco-primary-light-1/20! hover:border-arco-primary-6!"}`,
|
|
909
1038
|
children: [
|
|
910
|
-
|
|
911
|
-
/* @__PURE__ */
|
|
1039
|
+
j ? /* @__PURE__ */ L(D, { className: "text-arco-primary-6! absolute top-4 right-4 text-xl" }) : null,
|
|
1040
|
+
/* @__PURE__ */ R("div", {
|
|
912
1041
|
className: "flex min-w-0 flex-col gap-2.5",
|
|
913
1042
|
children: [
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1043
|
+
/* @__PURE__ */ R("div", {
|
|
1044
|
+
className: "flex min-w-0 flex-col gap-2.5 pr-8",
|
|
1045
|
+
children: [/* @__PURE__ */ L(w, {
|
|
1046
|
+
color: "arcoblue",
|
|
1047
|
+
className: "w-fit text-xs! font-bold!",
|
|
1048
|
+
children: o.customRechargeAmount
|
|
1049
|
+
}), /* @__PURE__ */ L(T.Text, {
|
|
1050
|
+
type: "secondary",
|
|
1051
|
+
className: "block! text-sm! leading-5! ",
|
|
1052
|
+
children: o.customRechargeDescription
|
|
1053
|
+
})]
|
|
923
1054
|
}),
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
className: "
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
1055
|
+
/* @__PURE__ */ L("div", {
|
|
1056
|
+
className: "mt-1",
|
|
1057
|
+
onClick: (e) => e.stopPropagation(),
|
|
1058
|
+
children: /* @__PURE__ */ L(h, {
|
|
1059
|
+
ref: x,
|
|
1060
|
+
type: "text",
|
|
1061
|
+
inputMode: "numeric",
|
|
1062
|
+
pattern: "[0-9]*",
|
|
1063
|
+
value: y,
|
|
1064
|
+
placeholder: "10",
|
|
1065
|
+
onFocus: I,
|
|
1066
|
+
onChange: (e) => {
|
|
1067
|
+
_("custom"), b(e.replace(/\D/g, ""));
|
|
1068
|
+
},
|
|
1069
|
+
prefix: /* @__PURE__ */ L("span", {
|
|
1070
|
+
className: "text-arco-primary-6 text-base font-semibold",
|
|
929
1071
|
children: "$"
|
|
930
1072
|
}),
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
|
|
933
|
-
type: "number",
|
|
934
|
-
min: 10,
|
|
935
|
-
step: 1,
|
|
936
|
-
value: p,
|
|
937
|
-
placeholder: "10",
|
|
938
|
-
onFocus: () => d("custom"),
|
|
939
|
-
onChange: (e) => {
|
|
940
|
-
d("custom"), m(e.target.value);
|
|
941
|
-
},
|
|
942
|
-
onClick: (e) => e.stopPropagation(),
|
|
943
|
-
className: `bg-arco-bg-2 text-arco-text-1 w-full rounded-md border px-7 py-2.5 pr-14 text-lg font-bold outline-none transition-colors [font-family:var(--font-display)] focus:border-arco-primary-6 ${b && C && !T ? "border-arco-danger-6!" : "border-arco-border-2!"}`
|
|
944
|
-
}),
|
|
945
|
-
/* @__PURE__ */ F("span", {
|
|
946
|
-
className: "text-arco-text-3 pointer-events-none absolute top-1/2 right-3.5 -translate-y-1/2 text-xs font-medium",
|
|
1073
|
+
suffix: /* @__PURE__ */ L("span", {
|
|
1074
|
+
className: "text-arco-primary-6 text-xs font-semibold",
|
|
947
1075
|
children: "USD"
|
|
948
|
-
})
|
|
949
|
-
|
|
1076
|
+
}),
|
|
1077
|
+
height: 48,
|
|
1078
|
+
status: k && A && !j ? "error" : void 0,
|
|
1079
|
+
className: `w-full! rounded-md! shadow-[0_0_0_3px_rgb(var(--primary-6)/8%)] transition-all [&_.arco-input]:text-xl! [&_.arco-input]:font-bold! [&_.arco-input]:text-arco-text-1! [&_.arco-input]:[font-family:var(--font-display)] [&_.arco-input-inner-wrapper]:border-2! [&_.arco-input-inner-wrapper]:bg-arco-bg-1! [&_.arco-input-inner-wrapper]:px-3! [&_.arco-input-inner-wrapper]:shadow-none! [&_.arco-input-inner-wrapper-focus]:border-arco-primary-6! [&_.arco-input-inner-wrapper-focus]:shadow-[0_0_0_4px_rgb(var(--primary-6)/14%)]! ${k && A && !j ? "[&_.arco-input-inner-wrapper]:border-arco-danger-6! shadow-[0_0_0_3px_rgb(var(--danger-6)/12%)]" : "[&_.arco-input-inner-wrapper]:border-arco-primary-6/50!"}`
|
|
1080
|
+
})
|
|
950
1081
|
}),
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
1082
|
+
/* @__PURE__ */ L("div", {
|
|
1083
|
+
className: "h-4",
|
|
1084
|
+
children: /* @__PURE__ */ L(T.Text, {
|
|
1085
|
+
type: "error",
|
|
1086
|
+
className: `block! text-xs! leading-4! transition-opacity ${k && A && !j ? "opacity-100" : "opacity-0"}`,
|
|
1087
|
+
children: o.customRechargeMinError
|
|
1088
|
+
})
|
|
1089
|
+
})
|
|
956
1090
|
]
|
|
957
1091
|
}),
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
className: "
|
|
1092
|
+
/* @__PURE__ */ R("div", {
|
|
1093
|
+
className: "border-arco-primary-6/20! bg-arco-bg-1!/80 mt-3 rounded-md border px-3.5 py-3 shadow-sm",
|
|
960
1094
|
children: [
|
|
961
|
-
/* @__PURE__ */
|
|
1095
|
+
/* @__PURE__ */ L(T.Text, {
|
|
962
1096
|
type: "secondary",
|
|
963
1097
|
className: "block! text-xs!",
|
|
964
|
-
children:
|
|
1098
|
+
children: o.customRechargeEstimate
|
|
965
1099
|
}),
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
className: "text-arco-primary-6! mt-
|
|
968
|
-
children: [
|
|
1100
|
+
/* @__PURE__ */ R(T.Text, {
|
|
1101
|
+
className: "text-arco-primary-6! mt-1 block! text-xl! leading-tight! font-bold!",
|
|
1102
|
+
children: [j ? C(O * 100) : "-", /* @__PURE__ */ L("span", {
|
|
969
1103
|
className: "text-arco-text-3 ml-1 text-xs font-normal",
|
|
970
|
-
children:
|
|
1104
|
+
children: o.pointsUnit
|
|
971
1105
|
})]
|
|
972
1106
|
}),
|
|
973
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ L(T.Text, {
|
|
974
1108
|
type: "secondary",
|
|
975
1109
|
className: "mt-0.5 block! text-[10px]!",
|
|
976
|
-
children:
|
|
1110
|
+
children: o.customRechargeRate
|
|
977
1111
|
})
|
|
978
1112
|
]
|
|
979
1113
|
})
|
|
@@ -986,93 +1120,1176 @@ function qe({ visible: e, user: t, points: n, text: a, onCancel: c, onPay: l })
|
|
|
986
1120
|
});
|
|
987
1121
|
}
|
|
988
1122
|
//#endregion
|
|
1123
|
+
//#region node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
1124
|
+
var Ct = /* @__PURE__ */ H(((e) => {
|
|
1125
|
+
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
1126
|
+
function b(e) {
|
|
1127
|
+
if (typeof e == "object" && e) {
|
|
1128
|
+
var t = e.$$typeof;
|
|
1129
|
+
switch (t) {
|
|
1130
|
+
case n: switch (e = e.type, e) {
|
|
1131
|
+
case l:
|
|
1132
|
+
case u:
|
|
1133
|
+
case i:
|
|
1134
|
+
case o:
|
|
1135
|
+
case a:
|
|
1136
|
+
case f: return e;
|
|
1137
|
+
default: switch (e &&= e.$$typeof, e) {
|
|
1138
|
+
case c:
|
|
1139
|
+
case d:
|
|
1140
|
+
case h:
|
|
1141
|
+
case m:
|
|
1142
|
+
case s: return e;
|
|
1143
|
+
default: return t;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
case r: return t;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
function x(e) {
|
|
1151
|
+
return b(e) === u;
|
|
1152
|
+
}
|
|
1153
|
+
e.AsyncMode = l, e.ConcurrentMode = u, e.ContextConsumer = c, e.ContextProvider = s, e.Element = n, e.ForwardRef = d, e.Fragment = i, e.Lazy = h, e.Memo = m, e.Portal = r, e.Profiler = o, e.StrictMode = a, e.Suspense = f, e.isAsyncMode = function(e) {
|
|
1154
|
+
return x(e) || b(e) === l;
|
|
1155
|
+
}, e.isConcurrentMode = x, e.isContextConsumer = function(e) {
|
|
1156
|
+
return b(e) === c;
|
|
1157
|
+
}, e.isContextProvider = function(e) {
|
|
1158
|
+
return b(e) === s;
|
|
1159
|
+
}, e.isElement = function(e) {
|
|
1160
|
+
return typeof e == "object" && !!e && e.$$typeof === n;
|
|
1161
|
+
}, e.isForwardRef = function(e) {
|
|
1162
|
+
return b(e) === d;
|
|
1163
|
+
}, e.isFragment = function(e) {
|
|
1164
|
+
return b(e) === i;
|
|
1165
|
+
}, e.isLazy = function(e) {
|
|
1166
|
+
return b(e) === h;
|
|
1167
|
+
}, e.isMemo = function(e) {
|
|
1168
|
+
return b(e) === m;
|
|
1169
|
+
}, e.isPortal = function(e) {
|
|
1170
|
+
return b(e) === r;
|
|
1171
|
+
}, e.isProfiler = function(e) {
|
|
1172
|
+
return b(e) === o;
|
|
1173
|
+
}, e.isStrictMode = function(e) {
|
|
1174
|
+
return b(e) === a;
|
|
1175
|
+
}, e.isSuspense = function(e) {
|
|
1176
|
+
return b(e) === f;
|
|
1177
|
+
}, e.isValidElementType = function(e) {
|
|
1178
|
+
return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
|
|
1179
|
+
}, e.typeOf = b;
|
|
1180
|
+
})), wt = /* @__PURE__ */ H(((e) => {
|
|
1181
|
+
process.env.NODE_ENV !== "production" && (function() {
|
|
1182
|
+
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
1183
|
+
function b(e) {
|
|
1184
|
+
return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
|
|
1185
|
+
}
|
|
1186
|
+
function x(e) {
|
|
1187
|
+
if (typeof e == "object" && e) {
|
|
1188
|
+
var t = e.$$typeof;
|
|
1189
|
+
switch (t) {
|
|
1190
|
+
case n:
|
|
1191
|
+
var p = e.type;
|
|
1192
|
+
switch (p) {
|
|
1193
|
+
case l:
|
|
1194
|
+
case u:
|
|
1195
|
+
case i:
|
|
1196
|
+
case o:
|
|
1197
|
+
case a:
|
|
1198
|
+
case f: return p;
|
|
1199
|
+
default:
|
|
1200
|
+
var g = p && p.$$typeof;
|
|
1201
|
+
switch (g) {
|
|
1202
|
+
case c:
|
|
1203
|
+
case d:
|
|
1204
|
+
case h:
|
|
1205
|
+
case m:
|
|
1206
|
+
case s: return g;
|
|
1207
|
+
default: return t;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
case r: return t;
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
var S = l, C = u, w = c, T = s, E = n, D = d, O = i, k = h, A = m, j = r, M = o, N = a, P = f, F = !1;
|
|
1215
|
+
function I(e) {
|
|
1216
|
+
return F || (F = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), ee(e) || x(e) === l;
|
|
1217
|
+
}
|
|
1218
|
+
function ee(e) {
|
|
1219
|
+
return x(e) === u;
|
|
1220
|
+
}
|
|
1221
|
+
function L(e) {
|
|
1222
|
+
return x(e) === c;
|
|
1223
|
+
}
|
|
1224
|
+
function R(e) {
|
|
1225
|
+
return x(e) === s;
|
|
1226
|
+
}
|
|
1227
|
+
function te(e) {
|
|
1228
|
+
return typeof e == "object" && !!e && e.$$typeof === n;
|
|
1229
|
+
}
|
|
1230
|
+
function ne(e) {
|
|
1231
|
+
return x(e) === d;
|
|
1232
|
+
}
|
|
1233
|
+
function z(e) {
|
|
1234
|
+
return x(e) === i;
|
|
1235
|
+
}
|
|
1236
|
+
function re(e) {
|
|
1237
|
+
return x(e) === h;
|
|
1238
|
+
}
|
|
1239
|
+
function B(e) {
|
|
1240
|
+
return x(e) === m;
|
|
1241
|
+
}
|
|
1242
|
+
function ie(e) {
|
|
1243
|
+
return x(e) === r;
|
|
1244
|
+
}
|
|
1245
|
+
function V(e) {
|
|
1246
|
+
return x(e) === o;
|
|
1247
|
+
}
|
|
1248
|
+
function H(e) {
|
|
1249
|
+
return x(e) === a;
|
|
1250
|
+
}
|
|
1251
|
+
function U(e) {
|
|
1252
|
+
return x(e) === f;
|
|
1253
|
+
}
|
|
1254
|
+
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = ee, e.isContextConsumer = L, e.isContextProvider = R, e.isElement = te, e.isForwardRef = ne, e.isFragment = z, e.isLazy = re, e.isMemo = B, e.isPortal = ie, e.isProfiler = V, e.isStrictMode = H, e.isSuspense = U, e.isValidElementType = b, e.typeOf = x;
|
|
1255
|
+
})();
|
|
1256
|
+
})), Tt = /* @__PURE__ */ H(((e, t) => {
|
|
1257
|
+
process.env.NODE_ENV === "production" ? t.exports = Ct() : t.exports = wt();
|
|
1258
|
+
})), Et = /* @__PURE__ */ H(((e, t) => {
|
|
1259
|
+
var n = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
|
|
1260
|
+
function a(e) {
|
|
1261
|
+
if (e == null) throw TypeError("Object.assign cannot be called with null or undefined");
|
|
1262
|
+
return Object(e);
|
|
1263
|
+
}
|
|
1264
|
+
function o() {
|
|
1265
|
+
try {
|
|
1266
|
+
if (!Object.assign) return !1;
|
|
1267
|
+
var e = /* @__PURE__ */ new String("abc");
|
|
1268
|
+
if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5") return !1;
|
|
1269
|
+
for (var t = {}, n = 0; n < 10; n++) t["_" + String.fromCharCode(n)] = n;
|
|
1270
|
+
if (Object.getOwnPropertyNames(t).map(function(e) {
|
|
1271
|
+
return t[e];
|
|
1272
|
+
}).join("") !== "0123456789") return !1;
|
|
1273
|
+
var r = {};
|
|
1274
|
+
return "abcdefghijklmnopqrst".split("").forEach(function(e) {
|
|
1275
|
+
r[e] = e;
|
|
1276
|
+
}), Object.keys(Object.assign({}, r)).join("") === "abcdefghijklmnopqrst";
|
|
1277
|
+
} catch {
|
|
1278
|
+
return !1;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
t.exports = o() ? Object.assign : function(e, t) {
|
|
1282
|
+
for (var o, s = a(e), c, l = 1; l < arguments.length; l++) {
|
|
1283
|
+
for (var u in o = Object(arguments[l]), o) r.call(o, u) && (s[u] = o[u]);
|
|
1284
|
+
if (n) {
|
|
1285
|
+
c = n(o);
|
|
1286
|
+
for (var d = 0; d < c.length; d++) i.call(o, c[d]) && (s[c[d]] = o[c[d]]);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
return s;
|
|
1290
|
+
};
|
|
1291
|
+
})), Dt = /* @__PURE__ */ H(((e, t) => {
|
|
1292
|
+
t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
1293
|
+
})), Ot = /* @__PURE__ */ H(((e, t) => {
|
|
1294
|
+
t.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1295
|
+
})), kt = /* @__PURE__ */ H(((e, t) => {
|
|
1296
|
+
var n = function() {};
|
|
1297
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1298
|
+
var r = Dt(), i = {}, a = Ot();
|
|
1299
|
+
n = function(e) {
|
|
1300
|
+
var t = "Warning: " + e;
|
|
1301
|
+
typeof console < "u" && console.error(t);
|
|
1302
|
+
try {
|
|
1303
|
+
throw Error(t);
|
|
1304
|
+
} catch {}
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
function o(e, t, o, s, c) {
|
|
1308
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1309
|
+
for (var l in e) if (a(e, l)) {
|
|
1310
|
+
var u;
|
|
1311
|
+
try {
|
|
1312
|
+
if (typeof e[l] != "function") {
|
|
1313
|
+
var d = Error((s || "React class") + ": " + o + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1314
|
+
throw d.name = "Invariant Violation", d;
|
|
1315
|
+
}
|
|
1316
|
+
u = e[l](t, l, s, o, null, r);
|
|
1317
|
+
} catch (e) {
|
|
1318
|
+
u = e;
|
|
1319
|
+
}
|
|
1320
|
+
if (u && !(u instanceof Error) && n((s || "React class") + ": type specification of " + o + " `" + l + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof u + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."), u instanceof Error && !(u.message in i)) {
|
|
1321
|
+
i[u.message] = !0;
|
|
1322
|
+
var f = c ? c() : "";
|
|
1323
|
+
n("Failed " + o + " type: " + u.message + (f ?? ""));
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
o.resetWarningCache = function() {
|
|
1329
|
+
process.env.NODE_ENV !== "production" && (i = {});
|
|
1330
|
+
}, t.exports = o;
|
|
1331
|
+
})), At = /* @__PURE__ */ H(((e, t) => {
|
|
1332
|
+
var n = Tt(), r = Et(), i = Dt(), a = Ot(), o = kt(), s = function() {};
|
|
1333
|
+
process.env.NODE_ENV !== "production" && (s = function(e) {
|
|
1334
|
+
var t = "Warning: " + e;
|
|
1335
|
+
typeof console < "u" && console.error(t);
|
|
1336
|
+
try {
|
|
1337
|
+
throw Error(t);
|
|
1338
|
+
} catch {}
|
|
1339
|
+
});
|
|
1340
|
+
function c() {
|
|
1341
|
+
return null;
|
|
1342
|
+
}
|
|
1343
|
+
t.exports = function(e, t) {
|
|
1344
|
+
var l = typeof Symbol == "function" && Symbol.iterator, u = "@@iterator";
|
|
1345
|
+
function d(e) {
|
|
1346
|
+
var t = e && (l && e[l] || e[u]);
|
|
1347
|
+
if (typeof t == "function") return t;
|
|
1348
|
+
}
|
|
1349
|
+
var f = "<<anonymous>>", p = {
|
|
1350
|
+
array: _("array"),
|
|
1351
|
+
bigint: _("bigint"),
|
|
1352
|
+
bool: _("boolean"),
|
|
1353
|
+
func: _("function"),
|
|
1354
|
+
number: _("number"),
|
|
1355
|
+
object: _("object"),
|
|
1356
|
+
string: _("string"),
|
|
1357
|
+
symbol: _("symbol"),
|
|
1358
|
+
any: v(),
|
|
1359
|
+
arrayOf: y,
|
|
1360
|
+
element: b(),
|
|
1361
|
+
elementType: x(),
|
|
1362
|
+
instanceOf: S,
|
|
1363
|
+
node: E(),
|
|
1364
|
+
objectOf: w,
|
|
1365
|
+
oneOf: C,
|
|
1366
|
+
oneOfType: T,
|
|
1367
|
+
shape: O,
|
|
1368
|
+
exact: k
|
|
1369
|
+
};
|
|
1370
|
+
function m(e, t) {
|
|
1371
|
+
return e === t ? e !== 0 || 1 / e == 1 / t : e !== e && t !== t;
|
|
1372
|
+
}
|
|
1373
|
+
function h(e, t) {
|
|
1374
|
+
this.message = e, this.data = t && typeof t == "object" ? t : {}, this.stack = "";
|
|
1375
|
+
}
|
|
1376
|
+
h.prototype = Error.prototype;
|
|
1377
|
+
function g(e) {
|
|
1378
|
+
if (process.env.NODE_ENV !== "production") var n = {}, r = 0;
|
|
1379
|
+
function a(a, o, c, l, u, d, p) {
|
|
1380
|
+
if (l ||= f, d ||= c, p !== i) {
|
|
1381
|
+
if (t) {
|
|
1382
|
+
var m = /* @__PURE__ */ Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");
|
|
1383
|
+
throw m.name = "Invariant Violation", m;
|
|
1384
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
1385
|
+
var g = l + ":" + c;
|
|
1386
|
+
!n[g] && r < 3 && (s("You are manually calling a React.PropTypes validation function for the `" + d + "` prop on `" + l + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."), n[g] = !0, r++);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
return o[c] == null ? a ? o[c] === null ? new h("The " + u + " `" + d + "` is marked as required " + ("in `" + l + "`, but its value is `null`.")) : new h("The " + u + " `" + d + "` is marked as required in " + ("`" + l + "`, but its value is `undefined`.")) : null : e(o, c, l, u, d);
|
|
1390
|
+
}
|
|
1391
|
+
var o = a.bind(null, !1);
|
|
1392
|
+
return o.isRequired = a.bind(null, !0), o;
|
|
1393
|
+
}
|
|
1394
|
+
function _(e) {
|
|
1395
|
+
function t(t, n, r, i, a, o) {
|
|
1396
|
+
var s = t[n];
|
|
1397
|
+
if (M(s) !== e) {
|
|
1398
|
+
var c = N(s);
|
|
1399
|
+
return new h("Invalid " + i + " `" + a + "` of type " + ("`" + c + "` supplied to `" + r + "`, expected ") + ("`" + e + "`."), { expectedType: e });
|
|
1400
|
+
}
|
|
1401
|
+
return null;
|
|
1402
|
+
}
|
|
1403
|
+
return g(t);
|
|
1404
|
+
}
|
|
1405
|
+
function v() {
|
|
1406
|
+
return g(c);
|
|
1407
|
+
}
|
|
1408
|
+
function y(e) {
|
|
1409
|
+
function t(t, n, r, a, o) {
|
|
1410
|
+
if (typeof e != "function") return new h("Property `" + o + "` of component `" + r + "` has invalid PropType notation inside arrayOf.");
|
|
1411
|
+
var s = t[n];
|
|
1412
|
+
if (!Array.isArray(s)) {
|
|
1413
|
+
var c = M(s);
|
|
1414
|
+
return new h("Invalid " + a + " `" + o + "` of type " + ("`" + c + "` supplied to `" + r + "`, expected an array."));
|
|
1415
|
+
}
|
|
1416
|
+
for (var l = 0; l < s.length; l++) {
|
|
1417
|
+
var u = e(s, l, r, a, o + "[" + l + "]", i);
|
|
1418
|
+
if (u instanceof Error) return u;
|
|
1419
|
+
}
|
|
1420
|
+
return null;
|
|
1421
|
+
}
|
|
1422
|
+
return g(t);
|
|
1423
|
+
}
|
|
1424
|
+
function b() {
|
|
1425
|
+
function t(t, n, r, i, a) {
|
|
1426
|
+
var o = t[n];
|
|
1427
|
+
if (!e(o)) {
|
|
1428
|
+
var s = M(o);
|
|
1429
|
+
return new h("Invalid " + i + " `" + a + "` of type " + ("`" + s + "` supplied to `" + r + "`, expected a single ReactElement."));
|
|
1430
|
+
}
|
|
1431
|
+
return null;
|
|
1432
|
+
}
|
|
1433
|
+
return g(t);
|
|
1434
|
+
}
|
|
1435
|
+
function x() {
|
|
1436
|
+
function e(e, t, r, i, a) {
|
|
1437
|
+
var o = e[t];
|
|
1438
|
+
if (!n.isValidElementType(o)) {
|
|
1439
|
+
var s = M(o);
|
|
1440
|
+
return new h("Invalid " + i + " `" + a + "` of type " + ("`" + s + "` supplied to `" + r + "`, expected a single ReactElement type."));
|
|
1441
|
+
}
|
|
1442
|
+
return null;
|
|
1443
|
+
}
|
|
1444
|
+
return g(e);
|
|
1445
|
+
}
|
|
1446
|
+
function S(e) {
|
|
1447
|
+
function t(t, n, r, i, a) {
|
|
1448
|
+
if (!(t[n] instanceof e)) {
|
|
1449
|
+
var o = e.name || f, s = F(t[n]);
|
|
1450
|
+
return new h("Invalid " + i + " `" + a + "` of type " + ("`" + s + "` supplied to `" + r + "`, expected ") + ("instance of `" + o + "`."));
|
|
1451
|
+
}
|
|
1452
|
+
return null;
|
|
1453
|
+
}
|
|
1454
|
+
return g(t);
|
|
1455
|
+
}
|
|
1456
|
+
function C(e) {
|
|
1457
|
+
if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? s("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).") : s("Invalid argument supplied to oneOf, expected an array.")), c;
|
|
1458
|
+
function t(t, n, r, i, a) {
|
|
1459
|
+
for (var o = t[n], s = 0; s < e.length; s++) if (m(o, e[s])) return null;
|
|
1460
|
+
var c = JSON.stringify(e, function(e, t) {
|
|
1461
|
+
return N(t) === "symbol" ? String(t) : t;
|
|
1462
|
+
});
|
|
1463
|
+
return new h("Invalid " + i + " `" + a + "` of value `" + String(o) + "` " + ("supplied to `" + r + "`, expected one of " + c + "."));
|
|
1464
|
+
}
|
|
1465
|
+
return g(t);
|
|
1466
|
+
}
|
|
1467
|
+
function w(e) {
|
|
1468
|
+
function t(t, n, r, o, s) {
|
|
1469
|
+
if (typeof e != "function") return new h("Property `" + s + "` of component `" + r + "` has invalid PropType notation inside objectOf.");
|
|
1470
|
+
var c = t[n], l = M(c);
|
|
1471
|
+
if (l !== "object") return new h("Invalid " + o + " `" + s + "` of type " + ("`" + l + "` supplied to `" + r + "`, expected an object."));
|
|
1472
|
+
for (var u in c) if (a(c, u)) {
|
|
1473
|
+
var d = e(c, u, r, o, s + "." + u, i);
|
|
1474
|
+
if (d instanceof Error) return d;
|
|
1475
|
+
}
|
|
1476
|
+
return null;
|
|
1477
|
+
}
|
|
1478
|
+
return g(t);
|
|
1479
|
+
}
|
|
1480
|
+
function T(e) {
|
|
1481
|
+
if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), c;
|
|
1482
|
+
for (var t = 0; t < e.length; t++) {
|
|
1483
|
+
var n = e[t];
|
|
1484
|
+
if (typeof n != "function") return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + P(n) + " at index " + t + "."), c;
|
|
1485
|
+
}
|
|
1486
|
+
function r(t, n, r, o, s) {
|
|
1487
|
+
for (var c = [], l = 0; l < e.length; l++) {
|
|
1488
|
+
var u = e[l], d = u(t, n, r, o, s, i);
|
|
1489
|
+
if (d == null) return null;
|
|
1490
|
+
d.data && a(d.data, "expectedType") && c.push(d.data.expectedType);
|
|
1491
|
+
}
|
|
1492
|
+
var f = c.length > 0 ? ", expected one of type [" + c.join(", ") + "]" : "";
|
|
1493
|
+
return new h("Invalid " + o + " `" + s + "` supplied to " + ("`" + r + "`" + f + "."));
|
|
1494
|
+
}
|
|
1495
|
+
return g(r);
|
|
1496
|
+
}
|
|
1497
|
+
function E() {
|
|
1498
|
+
function e(e, t, n, r, i) {
|
|
1499
|
+
return A(e[t]) ? null : new h("Invalid " + r + " `" + i + "` supplied to " + ("`" + n + "`, expected a ReactNode."));
|
|
1500
|
+
}
|
|
1501
|
+
return g(e);
|
|
1502
|
+
}
|
|
1503
|
+
function D(e, t, n, r, i) {
|
|
1504
|
+
return new h((e || "React class") + ": " + t + " type `" + n + "." + r + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + i + "`.");
|
|
1505
|
+
}
|
|
1506
|
+
function O(e) {
|
|
1507
|
+
function t(t, n, r, a, o) {
|
|
1508
|
+
var s = t[n], c = M(s);
|
|
1509
|
+
if (c !== "object") return new h("Invalid " + a + " `" + o + "` of type `" + c + "` " + ("supplied to `" + r + "`, expected `object`."));
|
|
1510
|
+
for (var l in e) {
|
|
1511
|
+
var u = e[l];
|
|
1512
|
+
if (typeof u != "function") return D(r, a, o, l, N(u));
|
|
1513
|
+
var d = u(s, l, r, a, o + "." + l, i);
|
|
1514
|
+
if (d) return d;
|
|
1515
|
+
}
|
|
1516
|
+
return null;
|
|
1517
|
+
}
|
|
1518
|
+
return g(t);
|
|
1519
|
+
}
|
|
1520
|
+
function k(e) {
|
|
1521
|
+
function t(t, n, o, s, c) {
|
|
1522
|
+
var l = t[n], u = M(l);
|
|
1523
|
+
if (u !== "object") return new h("Invalid " + s + " `" + c + "` of type `" + u + "` " + ("supplied to `" + o + "`, expected `object`."));
|
|
1524
|
+
for (var d in r({}, t[n], e)) {
|
|
1525
|
+
var f = e[d];
|
|
1526
|
+
if (a(e, d) && typeof f != "function") return D(o, s, c, d, N(f));
|
|
1527
|
+
if (!f) return new h("Invalid " + s + " `" + c + "` key `" + d + "` supplied to `" + o + "`.\nBad object: " + JSON.stringify(t[n], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(e), null, " "));
|
|
1528
|
+
var p = f(l, d, o, s, c + "." + d, i);
|
|
1529
|
+
if (p) return p;
|
|
1530
|
+
}
|
|
1531
|
+
return null;
|
|
1532
|
+
}
|
|
1533
|
+
return g(t);
|
|
1534
|
+
}
|
|
1535
|
+
function A(t) {
|
|
1536
|
+
switch (typeof t) {
|
|
1537
|
+
case "number":
|
|
1538
|
+
case "string":
|
|
1539
|
+
case "undefined": return !0;
|
|
1540
|
+
case "boolean": return !t;
|
|
1541
|
+
case "object":
|
|
1542
|
+
if (Array.isArray(t)) return t.every(A);
|
|
1543
|
+
if (t === null || e(t)) return !0;
|
|
1544
|
+
var n = d(t);
|
|
1545
|
+
if (n) {
|
|
1546
|
+
var r = n.call(t), i;
|
|
1547
|
+
if (n !== t.entries) {
|
|
1548
|
+
for (; !(i = r.next()).done;) if (!A(i.value)) return !1;
|
|
1549
|
+
} else for (; !(i = r.next()).done;) {
|
|
1550
|
+
var a = i.value;
|
|
1551
|
+
if (a && !A(a[1])) return !1;
|
|
1552
|
+
}
|
|
1553
|
+
} else return !1;
|
|
1554
|
+
return !0;
|
|
1555
|
+
default: return !1;
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
function j(e, t) {
|
|
1559
|
+
return e === "symbol" ? !0 : t ? t["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && t instanceof Symbol : !1;
|
|
1560
|
+
}
|
|
1561
|
+
function M(e) {
|
|
1562
|
+
var t = typeof e;
|
|
1563
|
+
return Array.isArray(e) ? "array" : e instanceof RegExp ? "object" : j(t, e) ? "symbol" : t;
|
|
1564
|
+
}
|
|
1565
|
+
function N(e) {
|
|
1566
|
+
if (e == null) return "" + e;
|
|
1567
|
+
var t = M(e);
|
|
1568
|
+
if (t === "object") {
|
|
1569
|
+
if (e instanceof Date) return "date";
|
|
1570
|
+
if (e instanceof RegExp) return "regexp";
|
|
1571
|
+
}
|
|
1572
|
+
return t;
|
|
1573
|
+
}
|
|
1574
|
+
function P(e) {
|
|
1575
|
+
var t = N(e);
|
|
1576
|
+
switch (t) {
|
|
1577
|
+
case "array":
|
|
1578
|
+
case "object": return "an " + t;
|
|
1579
|
+
case "boolean":
|
|
1580
|
+
case "date":
|
|
1581
|
+
case "regexp": return "a " + t;
|
|
1582
|
+
default: return t;
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
function F(e) {
|
|
1586
|
+
return !e.constructor || !e.constructor.name ? f : e.constructor.name;
|
|
1587
|
+
}
|
|
1588
|
+
return p.checkPropTypes = o, p.resetWarningCache = o.resetWarningCache, p.PropTypes = p, p;
|
|
1589
|
+
};
|
|
1590
|
+
})), jt = /* @__PURE__ */ H(((e, t) => {
|
|
1591
|
+
var n = Dt();
|
|
1592
|
+
function r() {}
|
|
1593
|
+
function i() {}
|
|
1594
|
+
i.resetWarningCache = r, t.exports = function() {
|
|
1595
|
+
function e(e, t, r, i, a, o) {
|
|
1596
|
+
if (o !== n) {
|
|
1597
|
+
var s = /* @__PURE__ */ Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
|
|
1598
|
+
throw s.name = "Invariant Violation", s;
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
e.isRequired = e;
|
|
1602
|
+
function t() {
|
|
1603
|
+
return e;
|
|
1604
|
+
}
|
|
1605
|
+
var a = {
|
|
1606
|
+
array: e,
|
|
1607
|
+
bigint: e,
|
|
1608
|
+
bool: e,
|
|
1609
|
+
func: e,
|
|
1610
|
+
number: e,
|
|
1611
|
+
object: e,
|
|
1612
|
+
string: e,
|
|
1613
|
+
symbol: e,
|
|
1614
|
+
any: e,
|
|
1615
|
+
arrayOf: t,
|
|
1616
|
+
element: e,
|
|
1617
|
+
elementType: e,
|
|
1618
|
+
instanceOf: t,
|
|
1619
|
+
node: e,
|
|
1620
|
+
objectOf: t,
|
|
1621
|
+
oneOf: t,
|
|
1622
|
+
oneOfType: t,
|
|
1623
|
+
shape: t,
|
|
1624
|
+
exact: t,
|
|
1625
|
+
checkPropTypes: i,
|
|
1626
|
+
resetWarningCache: r
|
|
1627
|
+
};
|
|
1628
|
+
return a.PropTypes = a, a;
|
|
1629
|
+
};
|
|
1630
|
+
})), Y = /* @__PURE__ */ W((/* @__PURE__ */ H(((e, t) => {
|
|
1631
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1632
|
+
var n = Tt();
|
|
1633
|
+
t.exports = At()(n.isElement, !0);
|
|
1634
|
+
} else t.exports = jt()();
|
|
1635
|
+
})))(), 1);
|
|
1636
|
+
function Mt(e, t) {
|
|
1637
|
+
var n = Object.keys(e);
|
|
1638
|
+
if (Object.getOwnPropertySymbols) {
|
|
1639
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
1640
|
+
t && (r = r.filter(function(t) {
|
|
1641
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
1642
|
+
})), n.push.apply(n, r);
|
|
1643
|
+
}
|
|
1644
|
+
return n;
|
|
1645
|
+
}
|
|
1646
|
+
function Nt(e) {
|
|
1647
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1648
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
1649
|
+
t % 2 ? Mt(Object(n), !0).forEach(function(t) {
|
|
1650
|
+
Ft(e, t, n[t]);
|
|
1651
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Mt(Object(n)).forEach(function(t) {
|
|
1652
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
return e;
|
|
1656
|
+
}
|
|
1657
|
+
function Pt(e) {
|
|
1658
|
+
"@babel/helpers - typeof";
|
|
1659
|
+
return Pt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1660
|
+
return typeof e;
|
|
1661
|
+
} : function(e) {
|
|
1662
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1663
|
+
}, Pt(e);
|
|
1664
|
+
}
|
|
1665
|
+
function Ft(e, t, n) {
|
|
1666
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
1667
|
+
value: n,
|
|
1668
|
+
enumerable: !0,
|
|
1669
|
+
configurable: !0,
|
|
1670
|
+
writable: !0
|
|
1671
|
+
}) : e[t] = n, e;
|
|
1672
|
+
}
|
|
1673
|
+
function It(e, t) {
|
|
1674
|
+
if (e == null) return {};
|
|
1675
|
+
var n = {}, r = Object.keys(e), i, a;
|
|
1676
|
+
for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
|
|
1677
|
+
return n;
|
|
1678
|
+
}
|
|
1679
|
+
function Lt(e, t) {
|
|
1680
|
+
if (e == null) return {};
|
|
1681
|
+
var n = It(e, t), r, i;
|
|
1682
|
+
if (Object.getOwnPropertySymbols) {
|
|
1683
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
1684
|
+
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
|
|
1685
|
+
}
|
|
1686
|
+
return n;
|
|
1687
|
+
}
|
|
1688
|
+
function Rt(e, t) {
|
|
1689
|
+
return zt(e) || Bt(e, t) || Vt(e, t) || Ut();
|
|
1690
|
+
}
|
|
1691
|
+
function zt(e) {
|
|
1692
|
+
if (Array.isArray(e)) return e;
|
|
1693
|
+
}
|
|
1694
|
+
function Bt(e, t) {
|
|
1695
|
+
var n = e && (typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]);
|
|
1696
|
+
if (n != null) {
|
|
1697
|
+
var r = [], i = !0, a = !1, o, s;
|
|
1698
|
+
try {
|
|
1699
|
+
for (n = n.call(e); !(i = (o = n.next()).done) && (r.push(o.value), !(t && r.length === t)); i = !0);
|
|
1700
|
+
} catch (e) {
|
|
1701
|
+
a = !0, s = e;
|
|
1702
|
+
} finally {
|
|
1703
|
+
try {
|
|
1704
|
+
!i && n.return != null && n.return();
|
|
1705
|
+
} finally {
|
|
1706
|
+
if (a) throw s;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
return r;
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
function Vt(e, t) {
|
|
1713
|
+
if (e) {
|
|
1714
|
+
if (typeof e == "string") return Ht(e, t);
|
|
1715
|
+
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
1716
|
+
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
1717
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ht(e, t);
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
function Ht(e, t) {
|
|
1721
|
+
(t == null || t > e.length) && (t = e.length);
|
|
1722
|
+
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
1723
|
+
return r;
|
|
1724
|
+
}
|
|
1725
|
+
function Ut() {
|
|
1726
|
+
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1727
|
+
}
|
|
1728
|
+
var X = function(t, n, r) {
|
|
1729
|
+
var i = !!r, a = e.useRef(r);
|
|
1730
|
+
e.useEffect(function() {
|
|
1731
|
+
a.current = r;
|
|
1732
|
+
}, [r]), e.useEffect(function() {
|
|
1733
|
+
if (!i || !t) return function() {};
|
|
1734
|
+
var e = function() {
|
|
1735
|
+
a.current && a.current.apply(a, arguments);
|
|
1736
|
+
};
|
|
1737
|
+
return t.on(n, e), function() {
|
|
1738
|
+
t.off(n, e);
|
|
1739
|
+
};
|
|
1740
|
+
}, [
|
|
1741
|
+
i,
|
|
1742
|
+
n,
|
|
1743
|
+
t,
|
|
1744
|
+
a
|
|
1745
|
+
]);
|
|
1746
|
+
}, Wt = function(t) {
|
|
1747
|
+
var n = e.useRef(t);
|
|
1748
|
+
return e.useEffect(function() {
|
|
1749
|
+
n.current = t;
|
|
1750
|
+
}, [t]), n.current;
|
|
1751
|
+
}, Z = function(e) {
|
|
1752
|
+
return e !== null && Pt(e) === "object";
|
|
1753
|
+
}, Gt = function(e) {
|
|
1754
|
+
return Z(e) && typeof e.then == "function";
|
|
1755
|
+
}, Kt = function(e) {
|
|
1756
|
+
return Z(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
|
|
1757
|
+
}, qt = "[object Object]", Jt = function e(t, n) {
|
|
1758
|
+
if (!Z(t) || !Z(n)) return t === n;
|
|
1759
|
+
var r = Array.isArray(t);
|
|
1760
|
+
if (r !== Array.isArray(n)) return !1;
|
|
1761
|
+
var i = Object.prototype.toString.call(t) === qt;
|
|
1762
|
+
if (i !== (Object.prototype.toString.call(n) === qt)) return !1;
|
|
1763
|
+
if (!i && !r) return t === n;
|
|
1764
|
+
var a = Object.keys(t), o = Object.keys(n);
|
|
1765
|
+
if (a.length !== o.length) return !1;
|
|
1766
|
+
for (var s = {}, c = 0; c < a.length; c += 1) s[a[c]] = !0;
|
|
1767
|
+
for (var l = 0; l < o.length; l += 1) s[o[l]] = !0;
|
|
1768
|
+
var u = Object.keys(s);
|
|
1769
|
+
if (u.length !== a.length) return !1;
|
|
1770
|
+
var d = t, f = n;
|
|
1771
|
+
return u.every(function(t) {
|
|
1772
|
+
return e(d[t], f[t]);
|
|
1773
|
+
});
|
|
1774
|
+
}, Yt = function(e, t, n) {
|
|
1775
|
+
return Z(e) ? Object.keys(e).reduce(function(r, i) {
|
|
1776
|
+
var a = !Z(t) || !Jt(e[i], t[i]);
|
|
1777
|
+
return n.includes(i) ? (a && console.warn(`Unsupported prop change: options.${i} is not a mutable property.`), r) : a ? Nt(Nt({}, r || {}), {}, Ft({}, i, e[i])) : r;
|
|
1778
|
+
}, null) : null;
|
|
1779
|
+
}, Xt = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", Zt = function(e) {
|
|
1780
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Xt;
|
|
1781
|
+
if (e === null || Kt(e)) return e;
|
|
1782
|
+
throw Error(t);
|
|
1783
|
+
}, Qt = function(e) {
|
|
1784
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Xt;
|
|
1785
|
+
if (Gt(e)) return {
|
|
1786
|
+
tag: "async",
|
|
1787
|
+
stripePromise: Promise.resolve(e).then(function(e) {
|
|
1788
|
+
return Zt(e, t);
|
|
1789
|
+
})
|
|
1790
|
+
};
|
|
1791
|
+
var n = Zt(e, t);
|
|
1792
|
+
return n === null ? { tag: "empty" } : {
|
|
1793
|
+
tag: "sync",
|
|
1794
|
+
stripe: n
|
|
1795
|
+
};
|
|
1796
|
+
}, $t = function(e) {
|
|
1797
|
+
!e || !e._registerWrapper || !e.registerAppInfo || (e._registerWrapper({
|
|
1798
|
+
name: "react-stripe-js",
|
|
1799
|
+
version: "6.4.0"
|
|
1800
|
+
}), e.registerAppInfo({
|
|
1801
|
+
name: "react-stripe-js",
|
|
1802
|
+
version: "6.4.0",
|
|
1803
|
+
url: "https://stripe.com/docs/stripe-js/react"
|
|
1804
|
+
}));
|
|
1805
|
+
}, en = /* @__PURE__ */ e.createContext(null);
|
|
1806
|
+
en.displayName = "ElementsContext";
|
|
1807
|
+
var tn = function(e, t) {
|
|
1808
|
+
if (!e) throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);
|
|
1809
|
+
return e;
|
|
1810
|
+
}, nn = function(t) {
|
|
1811
|
+
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
1812
|
+
return Qt(n);
|
|
1813
|
+
}, [n]), o = Rt(e.useState(function() {
|
|
1814
|
+
return {
|
|
1815
|
+
stripe: a.tag === "sync" ? a.stripe : null,
|
|
1816
|
+
elements: a.tag === "sync" ? a.stripe.elements(r) : null
|
|
1817
|
+
};
|
|
1818
|
+
}), 2), s = o[0], c = o[1];
|
|
1819
|
+
e.useEffect(function() {
|
|
1820
|
+
var e = !0, t = function(e) {
|
|
1821
|
+
c(function(t) {
|
|
1822
|
+
return t.stripe ? t : {
|
|
1823
|
+
stripe: e,
|
|
1824
|
+
elements: e.elements(r)
|
|
1825
|
+
};
|
|
1826
|
+
});
|
|
1827
|
+
};
|
|
1828
|
+
return a.tag === "async" && !s.stripe ? a.stripePromise.then(function(n) {
|
|
1829
|
+
n && e && t(n);
|
|
1830
|
+
}) : a.tag === "sync" && !s.stripe && t(a.stripe), function() {
|
|
1831
|
+
e = !1;
|
|
1832
|
+
};
|
|
1833
|
+
}, [
|
|
1834
|
+
a,
|
|
1835
|
+
s,
|
|
1836
|
+
r
|
|
1837
|
+
]);
|
|
1838
|
+
var l = Wt(n);
|
|
1839
|
+
e.useEffect(function() {
|
|
1840
|
+
l !== null && l !== n && console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
|
|
1841
|
+
}, [l, n]);
|
|
1842
|
+
var u = Wt(r);
|
|
1843
|
+
return e.useEffect(function() {
|
|
1844
|
+
if (s.elements) {
|
|
1845
|
+
var e = Yt(r, u, ["clientSecret", "fonts"]);
|
|
1846
|
+
e && s.elements.update(e);
|
|
1847
|
+
}
|
|
1848
|
+
}, [
|
|
1849
|
+
r,
|
|
1850
|
+
u,
|
|
1851
|
+
s.elements
|
|
1852
|
+
]), e.useEffect(function() {
|
|
1853
|
+
$t(s.stripe);
|
|
1854
|
+
}, [s.stripe]), /* @__PURE__ */ e.createElement(en.Provider, { value: s }, i);
|
|
1855
|
+
};
|
|
1856
|
+
nn.propTypes = {
|
|
1857
|
+
stripe: Y.default.any,
|
|
1858
|
+
options: Y.default.object
|
|
1859
|
+
};
|
|
1860
|
+
var rn = function(t) {
|
|
1861
|
+
return tn(e.useContext(en), t);
|
|
1862
|
+
}, an = function(e) {
|
|
1863
|
+
var t = e.children;
|
|
1864
|
+
return t(rn("mounts <ElementsConsumer>"));
|
|
1865
|
+
};
|
|
1866
|
+
an.propTypes = { children: Y.default.func.isRequired };
|
|
1867
|
+
var on = /* @__PURE__ */ e.createContext(null);
|
|
1868
|
+
on.displayName = "CheckoutContext";
|
|
1869
|
+
var sn = function(t) {
|
|
1870
|
+
var n = e.useContext(on), r = e.useContext(en);
|
|
1871
|
+
if (n) {
|
|
1872
|
+
if (r) throw Error(`You cannot wrap the part of your app that ${t} in both a checkout provider and <Elements> provider.`);
|
|
1873
|
+
return n;
|
|
1874
|
+
} else return tn(r, t);
|
|
1875
|
+
}, cn = ["mode"], ln = function(e) {
|
|
1876
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1877
|
+
}, Q = function(t, n, r) {
|
|
1878
|
+
var i = `${ln(t)}Element`, a = n ? function(t) {
|
|
1879
|
+
sn(`mounts <${i}>`);
|
|
1880
|
+
var n = t.id, r = t.className;
|
|
1881
|
+
return /* @__PURE__ */ e.createElement("div", {
|
|
1882
|
+
id: n,
|
|
1883
|
+
className: r
|
|
1884
|
+
});
|
|
1885
|
+
} : function(n) {
|
|
1886
|
+
var r = n.id, a = n.className, o = n.options, s = o === void 0 ? {} : o, c = n.onBlur, l = n.onFocus, u = n.onReady, d = n.onChange, f = n.onEscape, p = n.onClick, m = n.onLoadError, h = n.onLoaderStart, g = n.onNetworksChange, _ = n.onConfirm, v = n.onCancel, y = n.onShippingAddressChange, b = n.onShippingRateChange, x = n.onSavedPaymentMethodRemove, S = n.onSavedPaymentMethodUpdate, C = n.onAvailablePaymentMethodsChange, w = sn(`mounts <${i}>`), T = "elements" in w ? w.elements : null, E = "checkoutState" in w ? w.checkoutState : null, D = E?.type === "success" || E?.type === "loading" ? E.sdk : null, O = Rt(e.useState(null), 2), k = O[0], A = O[1], j = e.useRef(null), M = e.useRef(null);
|
|
1887
|
+
X(k, "blur", c), X(k, "focus", l), X(k, "escape", f), X(k, "click", p), X(k, "loaderror", m), X(k, "loaderstart", h), X(k, "networkschange", g), X(k, "confirm", _), X(k, "cancel", v), X(k, "shippingaddresschange", y), X(k, "shippingratechange", b), X(k, "savedpaymentmethodremove", x), X(k, "savedpaymentmethodupdate", S), X(k, "availablepaymentmethodschange", C), X(k, "change", d);
|
|
1888
|
+
var N;
|
|
1889
|
+
u && (N = t === "expressCheckout" ? u : function() {
|
|
1890
|
+
u(k);
|
|
1891
|
+
}), X(k, "ready", N), e.useLayoutEffect(function() {
|
|
1892
|
+
if (j.current === null && M.current !== null && (T || D)) {
|
|
1893
|
+
var e = null;
|
|
1894
|
+
if (D) {
|
|
1895
|
+
var n = D, r = D;
|
|
1896
|
+
switch (t) {
|
|
1897
|
+
case "paymentForm":
|
|
1898
|
+
e = r.createForm(s);
|
|
1899
|
+
break;
|
|
1900
|
+
case "payment":
|
|
1901
|
+
e = n.createPaymentElement(s);
|
|
1902
|
+
break;
|
|
1903
|
+
case "address":
|
|
1904
|
+
if ("mode" in s) {
|
|
1905
|
+
var a = s.mode, o = Lt(s, cn);
|
|
1906
|
+
if (a === "shipping") e = n.createShippingAddressElement(o);
|
|
1907
|
+
else if (a === "billing") e = n.createBillingAddressElement(o);
|
|
1908
|
+
else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
|
|
1909
|
+
} else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");
|
|
1910
|
+
break;
|
|
1911
|
+
case "expressCheckout":
|
|
1912
|
+
e = n.createExpressCheckoutElement(s);
|
|
1913
|
+
break;
|
|
1914
|
+
case "currencySelector":
|
|
1915
|
+
e = D.createCurrencySelectorElement();
|
|
1916
|
+
break;
|
|
1917
|
+
case "taxId":
|
|
1918
|
+
e = n.createTaxIdElement(s);
|
|
1919
|
+
break;
|
|
1920
|
+
case "contactDetails":
|
|
1921
|
+
e = n.createContactDetailsElement();
|
|
1922
|
+
break;
|
|
1923
|
+
default: throw Error(`<${i}> is not supported inside a checkout provider. Use an <Elements> provider instead.`);
|
|
1924
|
+
}
|
|
1925
|
+
} else T && (e = T.create(t, s));
|
|
1926
|
+
j.current = e, A(e), e && e.mount(M.current);
|
|
1927
|
+
}
|
|
1928
|
+
}, [
|
|
1929
|
+
T,
|
|
1930
|
+
D,
|
|
1931
|
+
s
|
|
1932
|
+
]);
|
|
1933
|
+
var P = Wt(s);
|
|
1934
|
+
return e.useEffect(function() {
|
|
1935
|
+
if (j.current) {
|
|
1936
|
+
var e = Yt(s, P, ["paymentRequest"]);
|
|
1937
|
+
e && "update" in j.current && j.current.update(e);
|
|
1938
|
+
}
|
|
1939
|
+
}, [s, P]), e.useLayoutEffect(function() {
|
|
1940
|
+
return function() {
|
|
1941
|
+
if (j.current && typeof j.current.destroy == "function") try {
|
|
1942
|
+
j.current.destroy(), j.current = null;
|
|
1943
|
+
} catch {}
|
|
1944
|
+
};
|
|
1945
|
+
}, []), /* @__PURE__ */ e.createElement("div", {
|
|
1946
|
+
id: r,
|
|
1947
|
+
className: a,
|
|
1948
|
+
ref: M
|
|
1949
|
+
});
|
|
1950
|
+
};
|
|
1951
|
+
return a.propTypes = {
|
|
1952
|
+
id: Y.default.string,
|
|
1953
|
+
className: Y.default.string,
|
|
1954
|
+
onChange: Y.default.func,
|
|
1955
|
+
onBlur: Y.default.func,
|
|
1956
|
+
onFocus: Y.default.func,
|
|
1957
|
+
onReady: Y.default.func,
|
|
1958
|
+
onEscape: Y.default.func,
|
|
1959
|
+
onClick: Y.default.func,
|
|
1960
|
+
onLoadError: Y.default.func,
|
|
1961
|
+
onLoaderStart: Y.default.func,
|
|
1962
|
+
onNetworksChange: Y.default.func,
|
|
1963
|
+
onConfirm: Y.default.func,
|
|
1964
|
+
onCancel: Y.default.func,
|
|
1965
|
+
onShippingAddressChange: Y.default.func,
|
|
1966
|
+
onShippingRateChange: Y.default.func,
|
|
1967
|
+
onSavedPaymentMethodRemove: Y.default.func,
|
|
1968
|
+
onSavedPaymentMethodUpdate: Y.default.func,
|
|
1969
|
+
onAvailablePaymentMethodsChange: Y.default.func,
|
|
1970
|
+
options: Y.default.object
|
|
1971
|
+
}, a.displayName = i, a.__elementType = t, a;
|
|
1972
|
+
}, $ = typeof window > "u", un = /* @__PURE__ */ e.createContext(null);
|
|
1973
|
+
un.displayName = "EmbeddedCheckoutProviderContext";
|
|
1974
|
+
var dn = function() {
|
|
1975
|
+
var t = e.useContext(un);
|
|
1976
|
+
if (!t) throw Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");
|
|
1977
|
+
return t;
|
|
1978
|
+
}, fn = "Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", pn = function(t) {
|
|
1979
|
+
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
1980
|
+
return Qt(n, fn);
|
|
1981
|
+
}, [n]), o = e.useRef(null), s = e.useRef(null), c = Rt(e.useState({ embeddedCheckout: null }), 2), l = c[0], u = c[1];
|
|
1982
|
+
e.useEffect(function() {
|
|
1983
|
+
if (!(s.current || o.current)) {
|
|
1984
|
+
var e = function(e) {
|
|
1985
|
+
s.current || o.current || (s.current = e, o.current = s.current.createEmbeddedCheckoutPage(r).then(function(e) {
|
|
1986
|
+
u({ embeddedCheckout: e });
|
|
1987
|
+
}));
|
|
1988
|
+
};
|
|
1989
|
+
a.tag === "async" && !s.current && (r.clientSecret || r.fetchClientSecret) ? a.stripePromise.then(function(t) {
|
|
1990
|
+
t && e(t);
|
|
1991
|
+
}) : a.tag === "sync" && !s.current && (r.clientSecret || r.fetchClientSecret) && e(a.stripe);
|
|
1992
|
+
}
|
|
1993
|
+
}, [
|
|
1994
|
+
a,
|
|
1995
|
+
r,
|
|
1996
|
+
l,
|
|
1997
|
+
s
|
|
1998
|
+
]), e.useEffect(function() {
|
|
1999
|
+
return function() {
|
|
2000
|
+
l.embeddedCheckout ? (o.current = null, l.embeddedCheckout.destroy()) : o.current && o.current.then(function() {
|
|
2001
|
+
o.current = null, l.embeddedCheckout && l.embeddedCheckout.destroy();
|
|
2002
|
+
});
|
|
2003
|
+
};
|
|
2004
|
+
}, [l.embeddedCheckout]), e.useEffect(function() {
|
|
2005
|
+
$t(s);
|
|
2006
|
+
}, [s]);
|
|
2007
|
+
var d = Wt(n);
|
|
2008
|
+
e.useEffect(function() {
|
|
2009
|
+
d !== null && d !== n && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.");
|
|
2010
|
+
}, [d, n]);
|
|
2011
|
+
var f = Wt(r);
|
|
2012
|
+
return e.useEffect(function() {
|
|
2013
|
+
if (f != null) {
|
|
2014
|
+
if (r == null) {
|
|
2015
|
+
console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.");
|
|
2016
|
+
return;
|
|
2017
|
+
}
|
|
2018
|
+
r.clientSecret === void 0 && r.fetchClientSecret === void 0 && console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."), f.clientSecret != null && r.clientSecret !== f.clientSecret && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."), f.fetchClientSecret != null && r.fetchClientSecret !== f.fetchClientSecret && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."), f.onComplete != null && r.onComplete !== f.onComplete && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it."), f.onShippingDetailsChange != null && r.onShippingDetailsChange !== f.onShippingDetailsChange && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it."), f.onLineItemsChange != null && r.onLineItemsChange !== f.onLineItemsChange && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.");
|
|
2019
|
+
}
|
|
2020
|
+
}, [f, r]), /* @__PURE__ */ e.createElement(un.Provider, { value: l }, i);
|
|
2021
|
+
}, mn = $ ? function(t) {
|
|
2022
|
+
var n = t.id, r = t.className;
|
|
2023
|
+
return dn(), /* @__PURE__ */ e.createElement("div", {
|
|
2024
|
+
id: n,
|
|
2025
|
+
className: r
|
|
2026
|
+
});
|
|
2027
|
+
} : function(t) {
|
|
2028
|
+
var n = t.id, r = t.className, i = dn().embeddedCheckout, a = e.useRef(!1), o = e.useRef(null);
|
|
2029
|
+
return e.useLayoutEffect(function() {
|
|
2030
|
+
return !a.current && i && o.current !== null && (i.mount(o.current), a.current = !0), function() {
|
|
2031
|
+
if (a.current && i) try {
|
|
2032
|
+
i.unmount(), a.current = !1;
|
|
2033
|
+
} catch {}
|
|
2034
|
+
};
|
|
2035
|
+
}, [i]), /* @__PURE__ */ e.createElement("div", {
|
|
2036
|
+
ref: o,
|
|
2037
|
+
id: n,
|
|
2038
|
+
className: r
|
|
2039
|
+
});
|
|
2040
|
+
};
|
|
2041
|
+
Q("auBankAccount", $), Q("card", $), Q("cardNumber", $), Q("cardExpiry", $), Q("cardCvc", $), Q("iban", $), Q("payment", $), Q("expressCheckout", $), Q("paymentRequestButton", $), Q("linkAuthentication", $), Q("contactDetails", $), Q("address", $), Q("shippingAddress", $), Q("paymentMethodMessaging", $), Q("taxId", $), Q("issuingCardNumberDisplay", $), Q("issuingCardCvcDisplay", $), Q("issuingCardExpiryDisplay", $), Q("issuingCardPinDisplay", $), Q("issuingCardCopyButton", $);
|
|
2042
|
+
//#endregion
|
|
2043
|
+
//#region node_modules/@stripe/stripe-js/dist/index.mjs
|
|
2044
|
+
function hn(e) {
|
|
2045
|
+
"@babel/helpers - typeof";
|
|
2046
|
+
return hn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2047
|
+
return typeof e;
|
|
2048
|
+
} : function(e) {
|
|
2049
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2050
|
+
}, hn(e);
|
|
2051
|
+
}
|
|
2052
|
+
var gn = "dahlia", _n = function(e) {
|
|
2053
|
+
return e === 3 ? "v3" : e;
|
|
2054
|
+
}, vn = "https://js.stripe.com", yn = `${vn}/${gn}/stripe.js`, bn = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, xn = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, Sn = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", Cn = function(e) {
|
|
2055
|
+
return bn.test(e) || xn.test(e);
|
|
2056
|
+
}, wn = function() {
|
|
2057
|
+
for (var e = document.querySelectorAll(`script[src^="${vn}"]`), t = 0; t < e.length; t++) {
|
|
2058
|
+
var n = e[t];
|
|
2059
|
+
if (Cn(n.src)) return n;
|
|
2060
|
+
}
|
|
2061
|
+
return null;
|
|
2062
|
+
}, Tn = function(e) {
|
|
2063
|
+
var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
|
|
2064
|
+
n.src = `${yn}${t}`;
|
|
2065
|
+
var r = document.head || document.body;
|
|
2066
|
+
if (!r) throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
2067
|
+
return r.appendChild(n), n;
|
|
2068
|
+
}, En = function(e, t) {
|
|
2069
|
+
!e || !e._registerWrapper || e._registerWrapper({
|
|
2070
|
+
name: "stripe-js",
|
|
2071
|
+
version: "9.6.0",
|
|
2072
|
+
startTime: t
|
|
2073
|
+
});
|
|
2074
|
+
}, Dn = null, On = null, kn = null, An = function(e) {
|
|
2075
|
+
return function(t) {
|
|
2076
|
+
e(Error("Failed to load Stripe.js", { cause: t }));
|
|
2077
|
+
};
|
|
2078
|
+
}, jn = function(e, t) {
|
|
2079
|
+
return function() {
|
|
2080
|
+
window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
|
|
2081
|
+
};
|
|
2082
|
+
}, Mn = function(e) {
|
|
2083
|
+
return Dn === null ? (Dn = new Promise(function(t, n) {
|
|
2084
|
+
if (typeof window > "u" || typeof document > "u") {
|
|
2085
|
+
t(null);
|
|
2086
|
+
return;
|
|
2087
|
+
}
|
|
2088
|
+
if (window.Stripe && e && console.warn(Sn), window.Stripe) {
|
|
2089
|
+
t(window.Stripe);
|
|
2090
|
+
return;
|
|
2091
|
+
}
|
|
2092
|
+
try {
|
|
2093
|
+
var r = wn();
|
|
2094
|
+
if (r && e) console.warn(Sn);
|
|
2095
|
+
else if (!r) r = Tn(e);
|
|
2096
|
+
else if (r && kn !== null && On !== null) {
|
|
2097
|
+
var i;
|
|
2098
|
+
r.removeEventListener("load", kn), r.removeEventListener("error", On), (i = r.parentNode) == null || i.removeChild(r), r = Tn(e);
|
|
2099
|
+
}
|
|
2100
|
+
kn = jn(t, n), On = An(n), r.addEventListener("load", kn), r.addEventListener("error", On);
|
|
2101
|
+
} catch (e) {
|
|
2102
|
+
n(e);
|
|
2103
|
+
return;
|
|
2104
|
+
}
|
|
2105
|
+
}), Dn.catch(function(e) {
|
|
2106
|
+
return Dn = null, Promise.reject(e);
|
|
2107
|
+
})) : Dn;
|
|
2108
|
+
}, Nn = function(e, t, n) {
|
|
2109
|
+
if (e === null) return null;
|
|
2110
|
+
var r = t[0];
|
|
2111
|
+
if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${hn(r)} instead.`);
|
|
2112
|
+
var i = r.match(/^pk_test/), a = _n(e.version), o = gn;
|
|
2113
|
+
i && a !== o && console.warn(`Stripe.js@${a} was loaded on the page, but @stripe/stripe-js@9.6.0 expected Stripe.js@${o}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);
|
|
2114
|
+
var s = e.apply(void 0, t);
|
|
2115
|
+
return En(s, n), s;
|
|
2116
|
+
}, Pn, Fn = !1, In = function() {
|
|
2117
|
+
return Pn || (Pn = Mn(null).catch(function(e) {
|
|
2118
|
+
return Pn = null, Promise.reject(e);
|
|
2119
|
+
}), Pn);
|
|
2120
|
+
};
|
|
2121
|
+
Promise.resolve().then(function() {
|
|
2122
|
+
return In();
|
|
2123
|
+
}).catch(function(e) {
|
|
2124
|
+
Fn || console.warn(e);
|
|
2125
|
+
});
|
|
2126
|
+
var Ln = function() {
|
|
2127
|
+
var e = [...arguments];
|
|
2128
|
+
Fn = !0;
|
|
2129
|
+
var t = Date.now();
|
|
2130
|
+
return In().then(function(n) {
|
|
2131
|
+
return Nn(n, e, t);
|
|
2132
|
+
});
|
|
2133
|
+
};
|
|
2134
|
+
//#endregion
|
|
2135
|
+
//#region src/header/components/StripePaymentModal.tsx
|
|
2136
|
+
function Rn({ visible: e, publishableKey: s, order: c, text: l, onCancel: u, onSuccess: d }) {
|
|
2137
|
+
let f = r(() => s ? Ln(s) : null, [s]), [p, m] = a(""), h = i(d), g = c?.clientSecret || c?.stripeClientSecret, _ = t(() => {
|
|
2138
|
+
h.current();
|
|
2139
|
+
}, []), y = r(() => g ? {
|
|
2140
|
+
clientSecret: g,
|
|
2141
|
+
onComplete: _
|
|
2142
|
+
} : void 0, [g, _]);
|
|
2143
|
+
n(() => {
|
|
2144
|
+
h.current = d;
|
|
2145
|
+
}, [d]), n(() => {
|
|
2146
|
+
if (m(""), !f) return;
|
|
2147
|
+
let e = !0;
|
|
2148
|
+
return f.then((t) => {
|
|
2149
|
+
e && !t && m(l.stripePaymentLoadFailed);
|
|
2150
|
+
}).catch((t) => {
|
|
2151
|
+
e && m(t instanceof Error ? t.message : l.stripePaymentLoadFailed);
|
|
2152
|
+
}), () => {
|
|
2153
|
+
e = !1;
|
|
2154
|
+
};
|
|
2155
|
+
}, [f, l.stripePaymentLoadFailed]);
|
|
2156
|
+
let b = s ? g ? g.startsWith("cs_") ? p ? /* @__PURE__ */ L(o, {
|
|
2157
|
+
type: "error",
|
|
2158
|
+
content: p
|
|
2159
|
+
}) : !f || !y ? /* @__PURE__ */ L("div", {
|
|
2160
|
+
className: "flex min-h-30 items-center justify-center",
|
|
2161
|
+
children: /* @__PURE__ */ L(x, { tip: l.stripePaymentLoading })
|
|
2162
|
+
}) : /* @__PURE__ */ R("div", {
|
|
2163
|
+
className: "flex h-full w-full flex-col gap-4",
|
|
2164
|
+
children: [/* @__PURE__ */ L(T.Text, {
|
|
2165
|
+
type: "secondary",
|
|
2166
|
+
className: "text-sm! leading-6!",
|
|
2167
|
+
children: l.stripePaymentDescription
|
|
2168
|
+
}), /* @__PURE__ */ L(pn, {
|
|
2169
|
+
stripe: f,
|
|
2170
|
+
options: y,
|
|
2171
|
+
children: /* @__PURE__ */ L(mn, { className: "min-h-[620px] w-full flex-1" })
|
|
2172
|
+
}, g)]
|
|
2173
|
+
}) : /* @__PURE__ */ L(o, {
|
|
2174
|
+
type: "error",
|
|
2175
|
+
content: l.stripeCheckoutClientSecretInvalid
|
|
2176
|
+
}) : /* @__PURE__ */ L(o, {
|
|
2177
|
+
type: "error",
|
|
2178
|
+
content: l.stripePaymentClientSecretMissing
|
|
2179
|
+
}) : /* @__PURE__ */ L(o, {
|
|
2180
|
+
type: "error",
|
|
2181
|
+
content: l.stripePaymentConfigMissing
|
|
2182
|
+
});
|
|
2183
|
+
return /* @__PURE__ */ L(v, {
|
|
2184
|
+
title: l.stripePaymentTitle,
|
|
2185
|
+
visible: e,
|
|
2186
|
+
footer: null,
|
|
2187
|
+
onCancel: u,
|
|
2188
|
+
alignCenter: !1,
|
|
2189
|
+
wrapStyle: { padding: 0 },
|
|
2190
|
+
style: {
|
|
2191
|
+
width: "100vw",
|
|
2192
|
+
maxWidth: "100vw",
|
|
2193
|
+
height: "100vh",
|
|
2194
|
+
top: 0,
|
|
2195
|
+
margin: 0,
|
|
2196
|
+
padding: 0
|
|
2197
|
+
},
|
|
2198
|
+
className: "flex! flex-col rounded-none! [&_.arco-modal-content]:flex-1 [&_.arco-modal-content]:overflow-auto",
|
|
2199
|
+
focusLock: !1,
|
|
2200
|
+
children: b
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
//#endregion
|
|
989
2204
|
//#region src/header/components/UserMenu.tsx
|
|
990
|
-
function
|
|
991
|
-
let
|
|
992
|
-
return /* @__PURE__ */
|
|
2205
|
+
function zn({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: o }) {
|
|
2206
|
+
let s = (e) => new Intl.NumberFormat().format(e);
|
|
2207
|
+
return /* @__PURE__ */ R("div", {
|
|
993
2208
|
className: "w-80 overflow-hidden rounded-xl border border-arco-border-2 bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)]",
|
|
994
2209
|
children: [
|
|
995
|
-
/* @__PURE__ */
|
|
2210
|
+
/* @__PURE__ */ R("div", {
|
|
996
2211
|
className: "flex items-center gap-3 px-6 pt-5 pb-4",
|
|
997
|
-
children: [/* @__PURE__ */
|
|
2212
|
+
children: [/* @__PURE__ */ L(yt, {
|
|
998
2213
|
user: e,
|
|
999
2214
|
size: 48,
|
|
1000
2215
|
className: "shrink-0"
|
|
1001
|
-
}), /* @__PURE__ */
|
|
2216
|
+
}), /* @__PURE__ */ R("div", {
|
|
1002
2217
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
1003
|
-
children: [/* @__PURE__ */
|
|
2218
|
+
children: [/* @__PURE__ */ R("div", {
|
|
1004
2219
|
className: "flex min-w-0 items-center gap-1.5",
|
|
1005
|
-
children: [/* @__PURE__ */
|
|
2220
|
+
children: [/* @__PURE__ */ L("span", {
|
|
1006
2221
|
className: "text-arco-text-1 truncate text-base leading-6 font-bold",
|
|
1007
2222
|
children: e?.nickname || e?.username
|
|
1008
|
-
}), /* @__PURE__ */
|
|
2223
|
+
}), /* @__PURE__ */ L(c, {
|
|
1009
2224
|
type: "text",
|
|
1010
2225
|
size: "mini",
|
|
1011
|
-
icon: /* @__PURE__ */
|
|
2226
|
+
icon: /* @__PURE__ */ L(k, {}),
|
|
1012
2227
|
className: "text-arco-text-3 h-6! min-w-6! px-0!",
|
|
1013
2228
|
onClick: r
|
|
1014
2229
|
})]
|
|
1015
|
-
}), e?.email ? /* @__PURE__ */
|
|
2230
|
+
}), e?.email ? /* @__PURE__ */ L("span", {
|
|
1016
2231
|
className: "text-arco-text-3 truncate text-xs leading-5",
|
|
1017
2232
|
children: e.email
|
|
1018
2233
|
}) : null]
|
|
1019
2234
|
})]
|
|
1020
2235
|
}),
|
|
1021
|
-
/* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ L(d, { className: "m-0!" }),
|
|
2237
|
+
/* @__PURE__ */ R("ul", {
|
|
1023
2238
|
className: "flex flex-col gap-3.5 px-6 py-4",
|
|
1024
2239
|
children: [
|
|
1025
|
-
/* @__PURE__ */
|
|
2240
|
+
/* @__PURE__ */ R("li", {
|
|
1026
2241
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
1027
|
-
children: [/* @__PURE__ */
|
|
2242
|
+
children: [/* @__PURE__ */ L("span", { children: n.myPoints }), /* @__PURE__ */ L("strong", {
|
|
1028
2243
|
className: "text-arco-primary-6 text-base font-bold",
|
|
1029
|
-
children:
|
|
2244
|
+
children: s(t.total)
|
|
1030
2245
|
})]
|
|
1031
2246
|
}),
|
|
1032
|
-
/* @__PURE__ */
|
|
2247
|
+
/* @__PURE__ */ R("li", {
|
|
1033
2248
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
1034
|
-
children: [/* @__PURE__ */
|
|
2249
|
+
children: [/* @__PURE__ */ L("span", { children: n.rechargePoints }), /* @__PURE__ */ L("strong", {
|
|
1035
2250
|
className: "text-arco-text-1 text-base font-bold",
|
|
1036
|
-
children:
|
|
2251
|
+
children: s(t.recharge)
|
|
1037
2252
|
})]
|
|
1038
2253
|
}),
|
|
1039
|
-
/* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ R("li", {
|
|
1040
2255
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
1041
|
-
children: [/* @__PURE__ */
|
|
2256
|
+
children: [/* @__PURE__ */ L("span", { children: n.giftedPoints }), /* @__PURE__ */ L("strong", {
|
|
1042
2257
|
className: "text-arco-text-1 text-base font-bold",
|
|
1043
|
-
children:
|
|
2258
|
+
children: s(t.gifted)
|
|
1044
2259
|
})]
|
|
1045
2260
|
})
|
|
1046
2261
|
]
|
|
1047
2262
|
}),
|
|
1048
|
-
/* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */
|
|
2263
|
+
/* @__PURE__ */ L(d, { className: "m-0!" }),
|
|
2264
|
+
/* @__PURE__ */ R("div", {
|
|
1050
2265
|
className: "flex flex-col gap-2 px-6 py-4",
|
|
1051
|
-
children: [/* @__PURE__ */
|
|
2266
|
+
children: [/* @__PURE__ */ L(c, {
|
|
1052
2267
|
type: "primary",
|
|
1053
2268
|
long: !0,
|
|
1054
|
-
icon: /* @__PURE__ */
|
|
1055
|
-
|
|
2269
|
+
icon: /* @__PURE__ */ L(N, {}),
|
|
2270
|
+
shape: "round",
|
|
2271
|
+
className: "h-10! font-medium!",
|
|
1056
2272
|
onClick: i,
|
|
1057
2273
|
children: n.recharge
|
|
1058
|
-
}), /* @__PURE__ */
|
|
2274
|
+
}), /* @__PURE__ */ L(c, {
|
|
1059
2275
|
long: !0,
|
|
1060
|
-
|
|
1061
|
-
|
|
2276
|
+
shape: "round",
|
|
2277
|
+
icon: /* @__PURE__ */ L(A, {}),
|
|
2278
|
+
className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! font-medium!",
|
|
1062
2279
|
onClick: a,
|
|
1063
2280
|
children: n.pointsDetail
|
|
1064
2281
|
})]
|
|
1065
2282
|
}),
|
|
1066
|
-
/* @__PURE__ */
|
|
1067
|
-
/* @__PURE__ */
|
|
2283
|
+
/* @__PURE__ */ L(d, { className: "m-0!" }),
|
|
2284
|
+
/* @__PURE__ */ L("div", {
|
|
1068
2285
|
className: "px-6 py-4",
|
|
1069
|
-
children: /* @__PURE__ */
|
|
1070
|
-
icon: /* @__PURE__ */
|
|
2286
|
+
children: /* @__PURE__ */ L(c, {
|
|
2287
|
+
icon: /* @__PURE__ */ L(P, {}),
|
|
1071
2288
|
type: "text",
|
|
1072
2289
|
status: "danger",
|
|
1073
2290
|
long: !0,
|
|
1074
2291
|
className: "flex! items-center justify-start gap-2 text-sm text-arco-text-2",
|
|
1075
|
-
onClick: () => void
|
|
2292
|
+
onClick: () => void o?.(),
|
|
1076
2293
|
children: n.logout
|
|
1077
2294
|
})
|
|
1078
2295
|
})
|
|
@@ -1081,246 +2298,322 @@ function Je({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPo
|
|
|
1081
2298
|
}
|
|
1082
2299
|
//#endregion
|
|
1083
2300
|
//#region src/header/ManturHeader.tsx
|
|
1084
|
-
var
|
|
2301
|
+
var Bn = "https://mantur.ai/images/logo.png", Vn = [
|
|
1085
2302
|
"from-arco-primary-light-1 to-arco-primary-light-2 text-arco-primary-6",
|
|
1086
2303
|
"from-arco-success-light-1 to-arco-success-light-2 text-arco-success-6",
|
|
1087
2304
|
"from-arco-warning-light-1 to-arco-warning-light-2 text-arco-warning-6",
|
|
1088
2305
|
"from-arco-danger-light-1 to-arco-danger-light-2 text-arco-danger-6"
|
|
1089
2306
|
];
|
|
1090
|
-
function
|
|
1091
|
-
return `flex h-8 min-h-8 w-8 min-w-8 flex-none items-center justify-center rounded-lg bg-linear-to-br font-bold leading-none ${
|
|
2307
|
+
function Hn(e, t = !1) {
|
|
2308
|
+
return `flex h-8 min-h-8 w-8 min-w-8 flex-none items-center justify-center rounded-lg bg-linear-to-br font-bold leading-none ${Vn[e % Vn.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
|
|
1092
2309
|
}
|
|
1093
|
-
function
|
|
2310
|
+
function Un(e) {
|
|
1094
2311
|
return e?.tenantName?.[0]?.toUpperCase() || "T";
|
|
1095
2312
|
}
|
|
1096
|
-
function
|
|
2313
|
+
function Wn(e, t, n) {
|
|
1097
2314
|
let r = e?.roles?.map((e) => e.roleName).filter(Boolean);
|
|
1098
2315
|
return r?.length ? r.join(", ") : e?.isOwner ? t : n;
|
|
1099
2316
|
}
|
|
1100
|
-
function
|
|
1101
|
-
|
|
2317
|
+
function Gn(e) {
|
|
2318
|
+
return e?.paymentUrl || e?.checkoutUrl || e?.url || e?.returnUrl;
|
|
2319
|
+
}
|
|
2320
|
+
function Kn(e) {
|
|
2321
|
+
return e?.clientSecret || e?.stripeClientSecret;
|
|
2322
|
+
}
|
|
2323
|
+
function qn(e) {
|
|
2324
|
+
return e || (typeof window > "u" ? "popup=yes,width=1440,height=960,left=0,top=0" : `popup=yes,width=${window.screen?.availWidth || window.innerWidth || 1440},height=${window.screen?.availHeight || window.innerHeight || 960},left=0,top=0`);
|
|
2325
|
+
}
|
|
2326
|
+
function Jn({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantContextChange: l, stripePublishableKey: u, stripePaymentWindowFeatures: d }) {
|
|
2327
|
+
let [p, m] = a(() => Ve()), h = He(p), [v, y] = a(!1), [b, x] = a(!1), [S, C] = a(!1), [w, T] = a(e), [E, D] = a([]), [k, A] = a(), [j, M] = a(!1), [N, P] = a(!1), [F, I] = a(!1), [ee, te] = a([]), [ne, z] = a(), re = i(l), B = i(null), ie = u || (typeof window < "u" ? window.__MANTUR_COMPONENTS_STRIPE_PUBLISHABLE_KEY__ : void 0) || "pk_test_51TJ8JiERSsQknDG7bJSIX81RFq3LcCfUXCV7mh0cQsZ2dwmYcJ5Ki6bPXynNvdyZEEBE83I6I719NIFyO9Qreey700yPAul8sv", [V, H] = a({
|
|
1102
2328
|
total: 0,
|
|
1103
2329
|
recharge: 0,
|
|
1104
2330
|
gifted: 0
|
|
1105
|
-
}),
|
|
1106
|
-
total:
|
|
1107
|
-
recharge:
|
|
1108
|
-
gifted:
|
|
1109
|
-
},
|
|
1110
|
-
let t = await
|
|
1111
|
-
return t &&
|
|
2331
|
+
}), U = k?.tenantId || "", W = o, ae = {
|
|
2332
|
+
total: V.total ?? 0,
|
|
2333
|
+
recharge: V.recharge ?? 0,
|
|
2334
|
+
gifted: V.gifted ?? 0
|
|
2335
|
+
}, oe = async (e) => {
|
|
2336
|
+
let t = await ge(e);
|
|
2337
|
+
return t && T(t), t;
|
|
1112
2338
|
};
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
}, [
|
|
1116
|
-
|
|
2339
|
+
n(() => {
|
|
2340
|
+
T(e);
|
|
2341
|
+
}, [e]), n(() => {
|
|
2342
|
+
re.current = l;
|
|
1117
2343
|
}, [l]);
|
|
1118
|
-
let
|
|
1119
|
-
|
|
2344
|
+
let G = t((e) => {
|
|
2345
|
+
D(e.tenants), A(e.currentTenant), re.current?.(e);
|
|
1120
2346
|
}, []);
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
console.warn("Failed to refresh Mantur tenant context.", e),
|
|
1124
|
-
}).finally(() =>
|
|
1125
|
-
}, [
|
|
2347
|
+
n(() => {
|
|
2348
|
+
M(!0), je().then(G).catch((e) => {
|
|
2349
|
+
console.warn("Failed to refresh Mantur tenant context.", e), _.error(h.error);
|
|
2350
|
+
}).finally(() => M(!1));
|
|
2351
|
+
}, [G, h.error]), n(() => {
|
|
1126
2352
|
let e = (e) => {
|
|
1127
|
-
e instanceof CustomEvent &&
|
|
2353
|
+
e instanceof CustomEvent && H(e.detail);
|
|
1128
2354
|
};
|
|
1129
|
-
return window.addEventListener(
|
|
2355
|
+
return window.addEventListener(se, e), q().catch((e) => {
|
|
1130
2356
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
1131
2357
|
}), () => {
|
|
1132
|
-
window.removeEventListener(
|
|
2358
|
+
window.removeEventListener(se, e);
|
|
1133
2359
|
};
|
|
1134
|
-
}, []),
|
|
2360
|
+
}, []), n(() => {
|
|
1135
2361
|
let e = (e) => {
|
|
1136
|
-
|
|
2362
|
+
m(e instanceof CustomEvent ? J(e.detail) : Ve());
|
|
1137
2363
|
};
|
|
1138
|
-
return window.addEventListener(
|
|
1139
|
-
window.removeEventListener(
|
|
2364
|
+
return window.addEventListener(ze, e), window.addEventListener("storage", e), () => {
|
|
2365
|
+
window.removeEventListener(ze, e), window.removeEventListener("storage", e);
|
|
1140
2366
|
};
|
|
1141
|
-
}, [])
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
2367
|
+
}, []), n(() => {
|
|
2368
|
+
let e = (e) => {
|
|
2369
|
+
e.origin === window.location.origin && (B.current && e.source !== B.current || et(e.data) && (B.current?.close(), B.current = null, z(void 0), e.data.action === "success" && _.success(h.rechargeSuccess), q().catch((e) => {
|
|
2370
|
+
console.warn("Failed to refresh Mantur user points.", e);
|
|
2371
|
+
})));
|
|
2372
|
+
};
|
|
2373
|
+
return window.addEventListener("message", e), () => {
|
|
2374
|
+
window.removeEventListener("message", e);
|
|
2375
|
+
};
|
|
2376
|
+
}, [h.rechargeSuccess]), n(() => {
|
|
2377
|
+
b && (P(!0), ye().then((e) => {
|
|
2378
|
+
let t = e.filter((e) => e.id && e.amount !== void 0 && e.points !== void 0).sort((e, t) => (e.sortOrder ?? 0) - (t.sortOrder ?? 0)).map((e) => ({
|
|
2379
|
+
id: e.id,
|
|
2380
|
+
packageCode: e.packageCode,
|
|
2381
|
+
packageName: e.packageName,
|
|
2382
|
+
packageNameEn: e.packageNameEn,
|
|
2383
|
+
price: Number(e.amount || 0),
|
|
2384
|
+
points: Number(e.points || 0),
|
|
2385
|
+
recommended: e.isRecommended,
|
|
2386
|
+
sortOrder: e.sortOrder
|
|
2387
|
+
}));
|
|
2388
|
+
t.length > 0 && te(t);
|
|
2389
|
+
}).catch((e) => {
|
|
2390
|
+
console.warn("Failed to load Mantur recharge packages.", e);
|
|
2391
|
+
}).finally(() => P(!1)));
|
|
2392
|
+
}, [b]);
|
|
2393
|
+
let le = (e) => {
|
|
2394
|
+
_.success(e);
|
|
2395
|
+
}, ue = (e, t) => {
|
|
2396
|
+
console.error(t), _.error(e);
|
|
2397
|
+
}, de = t(async (e) => {
|
|
2398
|
+
if (!W && e !== U) try {
|
|
2399
|
+
M(!0), G(await Me(e)), le(h.switchedToTeam);
|
|
1149
2400
|
} catch (e) {
|
|
1150
|
-
|
|
2401
|
+
ue(h.error, e);
|
|
1151
2402
|
} finally {
|
|
1152
|
-
|
|
2403
|
+
M(!1);
|
|
1153
2404
|
}
|
|
1154
2405
|
}, [
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
]),
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
2406
|
+
G,
|
|
2407
|
+
U,
|
|
2408
|
+
W,
|
|
2409
|
+
h.error,
|
|
2410
|
+
h.switchedToTeam
|
|
2411
|
+
]), fe = async (e) => {
|
|
2412
|
+
try {
|
|
2413
|
+
I(!0);
|
|
2414
|
+
let t = await be({ ..."custom" in e && e.custom ? { customAmount: e.price } : { packageId: e.id } });
|
|
2415
|
+
if (!t) {
|
|
2416
|
+
_.error(h.stripePaymentClientSecretMissing);
|
|
2417
|
+
return;
|
|
2418
|
+
}
|
|
2419
|
+
typeof window < "u" && window.dispatchEvent(new CustomEvent(ce, { detail: t })), _.success(h.rechargeOrderCreated), x(!1);
|
|
2420
|
+
let n = Gn(t);
|
|
2421
|
+
if (Kn(t)) {
|
|
2422
|
+
let e = it(t);
|
|
2423
|
+
if (e) {
|
|
2424
|
+
let t = window.open(e, "mantur-stripe-payment", qn(d));
|
|
2425
|
+
if (t) {
|
|
2426
|
+
B.current = t, t.focus();
|
|
2427
|
+
return;
|
|
2428
|
+
}
|
|
2429
|
+
window.location.href = e;
|
|
2430
|
+
return;
|
|
2431
|
+
}
|
|
2432
|
+
z(t);
|
|
2433
|
+
return;
|
|
2434
|
+
}
|
|
2435
|
+
if (n) {
|
|
2436
|
+
window.location.href = n;
|
|
2437
|
+
return;
|
|
2438
|
+
}
|
|
2439
|
+
_.error(h.stripePaymentClientSecretMissing);
|
|
2440
|
+
} catch (e) {
|
|
2441
|
+
ue(h.error, e);
|
|
2442
|
+
} finally {
|
|
2443
|
+
I(!1);
|
|
2444
|
+
}
|
|
2445
|
+
}, pe = r(() => /* @__PURE__ */ R(g, {
|
|
1168
2446
|
className: "w-56 rounded-xl bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)] [&_.arco-menu-inner]:px-2 [&_.arco-menu-inner]:py-1",
|
|
1169
|
-
selectedKeys:
|
|
1170
|
-
onClickMenuItem:
|
|
1171
|
-
children: [/* @__PURE__ */
|
|
2447
|
+
selectedKeys: U ? [U] : [],
|
|
2448
|
+
onClickMenuItem: de,
|
|
2449
|
+
children: [/* @__PURE__ */ L("div", {
|
|
1172
2450
|
className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
|
|
1173
|
-
children:
|
|
1174
|
-
}),
|
|
2451
|
+
children: h.switchTeam
|
|
2452
|
+
}), E.map((e, t) => /* @__PURE__ */ L(g.Item, {
|
|
1175
2453
|
className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
|
|
1176
|
-
children: /* @__PURE__ */
|
|
2454
|
+
children: /* @__PURE__ */ R("div", {
|
|
1177
2455
|
className: "flex w-full items-center gap-3 leading-normal",
|
|
1178
|
-
children: [/* @__PURE__ */
|
|
1179
|
-
className:
|
|
1180
|
-
children:
|
|
1181
|
-
}), /* @__PURE__ */
|
|
2456
|
+
children: [/* @__PURE__ */ L("div", {
|
|
2457
|
+
className: Hn(t),
|
|
2458
|
+
children: Un(e)
|
|
2459
|
+
}), /* @__PURE__ */ R("div", {
|
|
1182
2460
|
className: "flex min-w-0 flex-col justify-center gap-0.75",
|
|
1183
|
-
children: [/* @__PURE__ */
|
|
2461
|
+
children: [/* @__PURE__ */ L("span", {
|
|
1184
2462
|
className: "text-sm leading-5 font-medium text-arco-text-1",
|
|
1185
2463
|
children: e.tenantName
|
|
1186
|
-
}), /* @__PURE__ */
|
|
2464
|
+
}), /* @__PURE__ */ L("span", {
|
|
1187
2465
|
className: "text-xs leading-4 text-arco-text-3",
|
|
1188
|
-
children:
|
|
2466
|
+
children: Wn(e, h.owner, h.member)
|
|
1189
2467
|
})]
|
|
1190
2468
|
})]
|
|
1191
2469
|
})
|
|
1192
2470
|
}, e.tenantId))]
|
|
1193
2471
|
}), [
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
]),
|
|
1199
|
-
user:
|
|
1200
|
-
points:
|
|
1201
|
-
text:
|
|
1202
|
-
onEditProfile: () =>
|
|
1203
|
-
onRecharge: () =>
|
|
1204
|
-
onPointsDetail: () =>
|
|
1205
|
-
onLogout:
|
|
1206
|
-
}),
|
|
1207
|
-
return /* @__PURE__ */
|
|
2472
|
+
de,
|
|
2473
|
+
U,
|
|
2474
|
+
E,
|
|
2475
|
+
h
|
|
2476
|
+
]), me = /* @__PURE__ */ L(zn, {
|
|
2477
|
+
user: w,
|
|
2478
|
+
points: ae,
|
|
2479
|
+
text: h,
|
|
2480
|
+
onEditProfile: () => y(!0),
|
|
2481
|
+
onRecharge: () => x(!0),
|
|
2482
|
+
onPointsDetail: () => C(!0),
|
|
2483
|
+
onLogout: he
|
|
2484
|
+
}), K = Math.max(0, E.findIndex((e) => e.tenantId === k?.tenantId));
|
|
2485
|
+
return /* @__PURE__ */ R("div", {
|
|
1208
2486
|
className: "flex h-20 items-center justify-between bg-transparent pr-8 shadow-[0_2px_10px_rgb(0_0_0/2%)] backdrop-blur-md max-md:pr-4",
|
|
1209
2487
|
children: [
|
|
1210
|
-
/* @__PURE__ */
|
|
2488
|
+
/* @__PURE__ */ R("div", {
|
|
1211
2489
|
className: "flex items-center gap-6",
|
|
1212
|
-
children: [/* @__PURE__ */
|
|
2490
|
+
children: [/* @__PURE__ */ R("div", {
|
|
1213
2491
|
className: "flex w-65 items-center gap-3 px-8 max-md:w-auto max-md:px-4",
|
|
1214
|
-
children: [/* @__PURE__ */
|
|
2492
|
+
children: [/* @__PURE__ */ L("div", {
|
|
1215
2493
|
className: "relative flex w-12 items-center justify-center overflow-hidden ",
|
|
1216
|
-
children: /* @__PURE__ */
|
|
1217
|
-
src:
|
|
2494
|
+
children: /* @__PURE__ */ L("img", {
|
|
2495
|
+
src: Bn,
|
|
1218
2496
|
alt: "logo",
|
|
1219
2497
|
className: "w-full object-contain",
|
|
1220
2498
|
onError: (e) => {
|
|
1221
2499
|
e.currentTarget.style.display = "none";
|
|
1222
2500
|
}
|
|
1223
2501
|
})
|
|
1224
|
-
}), s ?? /* @__PURE__ */
|
|
2502
|
+
}), s ?? /* @__PURE__ */ L("span", {
|
|
1225
2503
|
className: "text-lg font-bold tracking-normal text-arco-text-1",
|
|
1226
|
-
children:
|
|
2504
|
+
children: h.title
|
|
1227
2505
|
})]
|
|
1228
|
-
}), /* @__PURE__ */
|
|
1229
|
-
droplist:
|
|
2506
|
+
}), /* @__PURE__ */ L(f, {
|
|
2507
|
+
droplist: pe,
|
|
1230
2508
|
trigger: "click",
|
|
1231
2509
|
position: "bl",
|
|
1232
|
-
disabled:
|
|
1233
|
-
children: /* @__PURE__ */
|
|
1234
|
-
"aria-disabled":
|
|
1235
|
-
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${
|
|
2510
|
+
disabled: W,
|
|
2511
|
+
children: /* @__PURE__ */ R("div", {
|
|
2512
|
+
"aria-disabled": W,
|
|
2513
|
+
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${W ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
|
|
1236
2514
|
children: [
|
|
1237
|
-
/* @__PURE__ */
|
|
1238
|
-
className:
|
|
1239
|
-
children:
|
|
2515
|
+
/* @__PURE__ */ L("div", {
|
|
2516
|
+
className: Hn(K, !0),
|
|
2517
|
+
children: Un(k)
|
|
1240
2518
|
}),
|
|
1241
|
-
/* @__PURE__ */
|
|
2519
|
+
/* @__PURE__ */ R("div", {
|
|
1242
2520
|
className: "flex min-w-0 flex-col",
|
|
1243
|
-
children: [/* @__PURE__ */
|
|
2521
|
+
children: [/* @__PURE__ */ L("span", {
|
|
1244
2522
|
className: "text-xs leading-none font-bold text-arco-text-1",
|
|
1245
|
-
children:
|
|
1246
|
-
}), /* @__PURE__ */
|
|
2523
|
+
children: j ? h.loading : k?.tenantName || h.loading
|
|
2524
|
+
}), /* @__PURE__ */ L("span", {
|
|
1247
2525
|
className: "mt-1 text-[10px] leading-none text-arco-text-3",
|
|
1248
|
-
children:
|
|
2526
|
+
children: Wn(k, h.owner, h.member)
|
|
1249
2527
|
})]
|
|
1250
2528
|
}),
|
|
1251
|
-
/* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ L(O, { className: "ml-1 text-arco-text-3" })
|
|
1252
2530
|
]
|
|
1253
2531
|
})
|
|
1254
2532
|
})]
|
|
1255
2533
|
}),
|
|
1256
|
-
/* @__PURE__ */
|
|
2534
|
+
/* @__PURE__ */ L("div", {
|
|
1257
2535
|
className: "flex-1",
|
|
1258
2536
|
children: c
|
|
1259
2537
|
}),
|
|
1260
|
-
/* @__PURE__ */
|
|
2538
|
+
/* @__PURE__ */ R("div", {
|
|
1261
2539
|
className: "flex items-center gap-4",
|
|
1262
|
-
children: [/* @__PURE__ */
|
|
2540
|
+
children: [/* @__PURE__ */ R("div", {
|
|
1263
2541
|
className: "flex items-center gap-4",
|
|
1264
|
-
children: [/* @__PURE__ */
|
|
1265
|
-
}), /* @__PURE__ */
|
|
1266
|
-
droplist:
|
|
2542
|
+
children: [/* @__PURE__ */ L(qe, {}), /* @__PURE__ */ L(Ke, {})]
|
|
2543
|
+
}), /* @__PURE__ */ L(f, {
|
|
2544
|
+
droplist: me,
|
|
1267
2545
|
trigger: "click",
|
|
1268
2546
|
position: "br",
|
|
1269
2547
|
onVisibleChange: (e) => {
|
|
1270
|
-
e &&
|
|
2548
|
+
e && q().catch((e) => {
|
|
1271
2549
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
1272
2550
|
});
|
|
1273
2551
|
},
|
|
1274
|
-
children: /* @__PURE__ */
|
|
2552
|
+
children: /* @__PURE__ */ R("div", {
|
|
1275
2553
|
className: "hover:bg-arco-fill-2 flex cursor-pointer items-center gap-2.5 rounded-full border border-transparent p-1 pr-2 transition-all",
|
|
1276
2554
|
children: [
|
|
1277
|
-
/* @__PURE__ */
|
|
2555
|
+
/* @__PURE__ */ R("div", {
|
|
1278
2556
|
className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
|
|
1279
|
-
children: [/* @__PURE__ */
|
|
1280
|
-
user:
|
|
2557
|
+
children: [/* @__PURE__ */ L(yt, {
|
|
2558
|
+
user: w,
|
|
1281
2559
|
size: 36
|
|
1282
|
-
}), /* @__PURE__ */
|
|
2560
|
+
}), /* @__PURE__ */ L("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
|
|
1283
2561
|
}),
|
|
1284
|
-
/* @__PURE__ */
|
|
2562
|
+
/* @__PURE__ */ L("div", {
|
|
1285
2563
|
className: "hidden flex-col md:flex",
|
|
1286
|
-
children: /* @__PURE__ */
|
|
2564
|
+
children: /* @__PURE__ */ L("span", {
|
|
1287
2565
|
className: "text-arco-text-1 text-sm font-medium",
|
|
1288
|
-
children:
|
|
2566
|
+
children: w?.nickname || w?.username
|
|
1289
2567
|
})
|
|
1290
2568
|
}),
|
|
1291
|
-
/* @__PURE__ */
|
|
2569
|
+
/* @__PURE__ */ L(O, { className: "text-arco-text-3 ml-1" })
|
|
1292
2570
|
]
|
|
1293
2571
|
})
|
|
1294
2572
|
})]
|
|
1295
2573
|
}),
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
visible: g,
|
|
1298
|
-
user: S,
|
|
1299
|
-
labels: p,
|
|
1300
|
-
onCancel: () => _(!1),
|
|
1301
|
-
onSubmit: z
|
|
1302
|
-
}),
|
|
1303
|
-
/* @__PURE__ */ F(qe, {
|
|
2574
|
+
/* @__PURE__ */ L(_t, {
|
|
1304
2575
|
visible: v,
|
|
1305
|
-
user:
|
|
1306
|
-
|
|
1307
|
-
text: p,
|
|
2576
|
+
user: w,
|
|
2577
|
+
labels: h,
|
|
1308
2578
|
onCancel: () => y(!1),
|
|
1309
|
-
|
|
2579
|
+
onSubmit: oe
|
|
1310
2580
|
}),
|
|
1311
|
-
/* @__PURE__ */
|
|
2581
|
+
/* @__PURE__ */ L(St, {
|
|
1312
2582
|
visible: b,
|
|
1313
|
-
|
|
1314
|
-
|
|
2583
|
+
user: w,
|
|
2584
|
+
points: ae,
|
|
2585
|
+
text: h,
|
|
2586
|
+
packages: ee,
|
|
2587
|
+
packageLoading: N,
|
|
2588
|
+
submitting: F,
|
|
1315
2589
|
onCancel: () => x(!1),
|
|
1316
|
-
|
|
2590
|
+
onPay: fe
|
|
2591
|
+
}),
|
|
2592
|
+
/* @__PURE__ */ L(dt, {
|
|
2593
|
+
visible: S,
|
|
2594
|
+
points: ae,
|
|
2595
|
+
text: h,
|
|
2596
|
+
onCancel: () => C(!1),
|
|
2597
|
+
onRecharge: () => x(!0)
|
|
2598
|
+
}),
|
|
2599
|
+
/* @__PURE__ */ L(Rn, {
|
|
2600
|
+
visible: !!ne,
|
|
2601
|
+
publishableKey: ie,
|
|
2602
|
+
order: ne,
|
|
2603
|
+
text: h,
|
|
2604
|
+
onCancel: () => z(void 0),
|
|
2605
|
+
onSuccess: () => {
|
|
2606
|
+
_.success(h.rechargeSuccess), z(void 0), q().catch((e) => {
|
|
2607
|
+
console.warn("Failed to refresh Mantur user points.", e);
|
|
2608
|
+
});
|
|
2609
|
+
}
|
|
1317
2610
|
})
|
|
1318
2611
|
]
|
|
1319
2612
|
});
|
|
1320
2613
|
}
|
|
1321
2614
|
//#endregion
|
|
1322
2615
|
//#region src/utils/date.ts
|
|
1323
|
-
var
|
|
2616
|
+
var Yn = /* @__PURE__ */ W((/* @__PURE__ */ H(((e, t) => {
|
|
1324
2617
|
(function(n, r) {
|
|
1325
2618
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
1326
2619
|
})(e, (function() {
|
|
@@ -1615,27 +2908,10 @@ var et = /* @__PURE__ */ re((/* @__PURE__ */ te(((e, t) => {
|
|
|
1615
2908
|
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
1616
2909
|
}));
|
|
1617
2910
|
})))(), 1);
|
|
1618
|
-
function
|
|
2911
|
+
function Xn(e, t = "datetime", n) {
|
|
1619
2912
|
if (!e) return "-";
|
|
1620
|
-
let r = (n ?
|
|
1621
|
-
return (0,
|
|
1622
|
-
}
|
|
1623
|
-
//#endregion
|
|
1624
|
-
//#region src/utils/url.ts
|
|
1625
|
-
var nt = () => {
|
|
1626
|
-
if (typeof window > "u" || !window.location?.href) throw Error("redirectToManturMain requires currentUrl when window.location is unavailable.");
|
|
1627
|
-
return window.location.href;
|
|
1628
|
-
}, rt = (e, t) => {
|
|
1629
|
-
let n = e.split(".");
|
|
1630
|
-
return n.length <= 1 ? t : [t, ...n.slice(1)].join(".");
|
|
1631
|
-
}, it = (e) => `${e.pathname}${e.search}${e.hash}`;
|
|
1632
|
-
function at(e, t, n = {}) {
|
|
1633
|
-
let r = new URL(n.currentUrl || nt()), i = new URL(r.toString()), a = e?.trim();
|
|
1634
|
-
a ? i.hostname = rt(r.hostname, a) : i.port = "80";
|
|
1635
|
-
let o = it(r);
|
|
1636
|
-
i.pathname = "/login", i.searchParams.set("app", t?.trim()), i.searchParams.set("redirect", o);
|
|
1637
|
-
let s = i.toString();
|
|
1638
|
-
return n.navigate !== !1 && typeof window < "u" && (window.location.href = s), s;
|
|
2913
|
+
let r = (n ? J(n) : Ve()).startsWith("en"), i = t === "date" ? r ? "MM/DD/YYYY" : "YYYY-MM-DD" : r ? "MM/DD/YYYY HH:mm:ss" : "YYYY-MM-DD HH:mm:ss";
|
|
2914
|
+
return (0, Yn.default)(e).format(i);
|
|
1639
2915
|
}
|
|
1640
2916
|
//#endregion
|
|
1641
|
-
export { $e as ManturHeader,
|
|
2917
|
+
export { se as MANTUR_POINTS_REFRESH_EVENT, ce as MANTUR_RECHARGE_ORDER_CREATED_EVENT, $e as MANTUR_STRIPE_PAYMENT_ROUTE, Qe as MANTUR_STRIPE_PAYMENT_WINDOW_MESSAGE_TYPE, G as MANTUR_TENANT_CONTEXT_CHANGE_EVENT, Jn as ManturHeader, be as createManturRechargeOrder, Xn as formatDateByLang, we as getManturBillingAccount, Te as getManturBillingLedger, ye as getManturBillingPackages, Ce as getManturPricingChargePoint, Se as getManturPricingChargePoints, xe as getManturRechargeOrder, et as isManturStripePaymentWindowMessage, tt as postManturStripePaymentWindowMessage, Ze as redirectToManturMain, je as refreshManturTenantContext, q as refreshManturUserPoints, it as resolveManturStripePaymentPageUrl };
|