everest-npm-features 0.0.3 → 0.0.5

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.
Files changed (66) hide show
  1. package/dist/Cancel-kWZwZbQf.js +8 -0
  2. package/dist/Delete-BbHDZPfy.js +8 -0
  3. package/dist/{PlayArrow-D_p2nwO8.js → PlayArrow-Dwss80PJ.js} +1 -1
  4. package/dist/assets/index10.css +1 -1
  5. package/dist/assets/index11.css +1 -0
  6. package/dist/assets/index6.css +1 -1
  7. package/dist/assets/index7.css +1 -1
  8. package/dist/assets/index8.css +1 -1
  9. package/dist/assets/index9.css +1 -1
  10. package/dist/{auth-DDk8JxR-.js → auth-NmISGQ2S.js} +1 -1
  11. package/dist/{bank-BvPXd5sM.js → bank-CRy2oyUW.js} +1 -1
  12. package/dist/components/Account/index.js +9 -8
  13. package/dist/components/History/index.js +3 -3
  14. package/dist/components/MoveToEthereumOrEverChain/index.js +3 -3
  15. package/dist/components/Profile/documents.js +5 -4
  16. package/dist/components/Profile/index.js +3 -3
  17. package/dist/components/Receive/index.js +2 -2
  18. package/dist/components/RocketRamp/Buy/cardPayment.js +3 -3
  19. package/dist/components/RocketRamp/Buy/confirmTransaction.js +3 -3
  20. package/dist/components/RocketRamp/Buy/form.d.ts +1 -1
  21. package/dist/components/RocketRamp/Buy/form.js +4 -4
  22. package/dist/components/RocketRamp/Buy/index.d.ts +1 -0
  23. package/dist/components/RocketRamp/Buy/index.js +11 -8
  24. package/dist/components/RocketRamp/Buy/types.d.ts +1 -0
  25. package/dist/components/RocketRamp/Dashboard/index.js +54 -24
  26. package/dist/components/RocketRamp/MinimalKyc/form.d.ts +5 -0
  27. package/dist/components/RocketRamp/MinimalKyc/form.js +233 -0
  28. package/dist/components/RocketRamp/MinimalKyc/index.d.ts +2 -3
  29. package/dist/components/RocketRamp/MinimalKyc/index.js +17 -252
  30. package/dist/components/RocketRamp/SignIn/index.js +2 -2
  31. package/dist/components/RocketRamp/SignIn/loginForm.js +2 -2
  32. package/dist/components/RocketRamp/SignIn/otpForm.js +24 -23
  33. package/dist/components/RocketRamp/SignUp/email.js +2 -2
  34. package/dist/components/RocketRamp/SignUp/index.js +66 -66
  35. package/dist/components/RocketRamp/SignUp/personalInfo.js +2 -2
  36. package/dist/components/RocketRamp/SignUp/validateEmail.js +15 -14
  37. package/dist/components/RocketRamp/Transactions/index.js +2 -2
  38. package/dist/components/Send/index.js +3 -3
  39. package/dist/components/Shared/ConnectWallet/index.js +1 -1
  40. package/dist/components/Shared/addBank.js +2 -2
  41. package/dist/components/Shared/connectPlaidBank.js +2 -2
  42. package/dist/components/SignIn/index.js +2 -2
  43. package/dist/components/SignUp/index.js +3 -3
  44. package/dist/components/Stake/index.js +3 -3
  45. package/dist/components/Swap/index.js +2 -2
  46. package/dist/components/WalletPortfolio/index.js +3 -3
  47. package/dist/{constants-SKm7VF9k.js → constants-Bg2zYFVK.js} +6 -6
  48. package/dist/{documents-7w9u2Oig.js → documents-BGFSTan8.js} +26 -25
  49. package/dist/hooks/useRrDialog/index.d.ts +5 -0
  50. package/dist/hooks/useRrDialog/index.js +82 -0
  51. package/dist/hooks/useRrDialog/types.d.ts +15 -0
  52. package/dist/hooks/useRrDialog/types.js +1 -0
  53. package/dist/index-zP3Vu4Cl.js +816 -0
  54. package/dist/main.js +1 -1
  55. package/dist/{order-CO4ra5N-.js → order-CtACU1eX.js} +1 -1
  56. package/dist/{stake-DHpsHQbJ.js → stake-CQWZT4ug.js} +1 -1
  57. package/dist/store.d.ts +24 -1
  58. package/dist/{user-CeKqBfJU.js → user-Djw_k_OF.js} +7 -7
  59. package/dist/util/constants.d.ts +3 -0
  60. package/dist/util/constants.js +58 -55
  61. package/dist/util/functions.d.ts +2 -0
  62. package/dist/util/functions.js +48 -37
  63. package/dist/{wallet-BtAQ78cv.js → wallet-CmeFL8-U.js} +1 -1
  64. package/package.json +2 -1
  65. package/dist/Cancel-BMPJ8ZAg.js +0 -11
  66. package/dist/index-BhmBCie8.js +0 -796
@@ -1,796 +0,0 @@
1
- import { jsxs as r, Fragment as P, jsx as e } from "react/jsx-runtime";
2
- import { useState as c, useEffect as v } from "react";
3
- import Se from "./hoc/withThemeProvider.js";
4
- import { P as Me, F as Re } from "./PlayArrow-D_p2nwO8.js";
5
- import { I as Oe } from "./Info-CkE3Gsf2.js";
6
- import { G as we } from "./generic-token-B_ptO5yb.js";
7
- import J from "./components/RocketRamp/Shared/Input/index.js";
8
- import { ID_TOKEN_SYMBOL as le, FIAT_TO_EVER_ID as Z, FIAT_TO_TOKEN as ee, ESTIMATE_TOOLTIP_TEXT as Be, VISA_PAYMENT as Ve, VISA_PAYMENT_ACTIVE as Le, SEPA_PAYMENT as We, SEPA_PAYMENT_ACTIVE as Ye, PAYMENT_BANK as me, SEPA_ICON as De, VISA_ICON as ye, PAYMENT_PROVIDER_CHECKOUT as de } from "./util/constants.js";
9
- import { a7 as qe } from "./constants-SKm7VF9k.js";
10
- import { a as $e, b as xe, c as Ke, d as Ge, e as ue } from "./order-CO4ra5N-.js";
11
- import Ue from "./components/Shared/tooltip.js";
12
- import { getCurrencySymbol as ge, removeExtraSpace as je } from "./util/functions.js";
13
- import te from "./components/RocketRamp/Shared/Button/index.js";
14
- import _e from "./components/RocketRamp/Shared/backBtn.js";
15
- import { T as s } from "./Typography-Dx54MRM5.js";
16
- import { B as f } from "./Box-BOgpENcC.js";
17
- import { G as o } from "./Grid2-B0mJbwjl.js";
18
- import { C as I } from "./CircularProgress-BAEiXRSn.js";
19
- import "@incodetech/welcome";
20
- import "./axios-BEX6n2A7.js";
21
- import { useSnackBar as He } from "./hooks/useSnackBar.js";
22
- import "./components/SignUp/pin.js";
23
- import { u as Xe, a as j } from "./react-redux-B4BZippc.js";
24
- import './assets/main.css';import './assets/index8.css';/* empty css */
25
- import "./util/conversions.js";
26
- import "./index-CAoLi5Qq.js";
27
- import "./react-webcam-B3cXh1XT.js";
28
- import "./components/Shared/transition.js";
29
- import "./components/Shared/pin.js";
30
- import "./moment-h96o7c8I.js";
31
- import "./index.esm-BsMAMhYW.js";
32
- import "./web3-u4qDZYpo.js";
33
- import "./index-B8QKlEgj.js";
34
- import { c as Qe } from "./createSvgIcon-jkXneOQN.js";
35
- import { s as pe, p as Je, h as Ze, v as et } from "./index-ceeCtFuh.js";
36
- import { I as tt } from "./TextField-BqIvz6Zw.js";
37
- import { F as rt } from "./FormControl-Nd-4LC8N.js";
38
- import { S as nt } from "./Select-DTQDmdn_.js";
39
- import { M as he } from "./MenuItem-D12FP5Iq.js";
40
- import { L as at } from "./ListItemIcon-JAntieDc.js";
41
- import { I as fe } from "./IconButton-DAR3jsEV.js";
42
- const it = (C) => ({
43
- type: qe,
44
- payload: C
45
- }), w = {
46
- "confirm-payment": "_confirm-payment_alxbn_1",
47
- "confirm-transaction-network": "_confirm-transaction-network_alxbn_33",
48
- "buy-info": "_buy-info_alxbn_57"
49
- }, ot = ({
50
- setScreen: C,
51
- orderData: g,
52
- dispatch: u,
53
- fiatAssets: _,
54
- cryptoAssets: y,
55
- getCryptoAssets: n,
56
- showAlertMessage: x,
57
- partnerKey: z
58
- }) => {
59
- const b = "USD", d = ge(b), p = _.fiats, N = _.loader, k = y.featureTokens.list, m = y.featureTokens.default, H = y.loader, M = g.loader, E = g.estimate, R = E.crypto_out_amount, B = E.conversion_price, V = E.total_fee;
60
- let L = 0, W = 0;
61
- const K = E.fee_breakdown;
62
- for (let t = 0; t < K.length; t++) {
63
- const a = K[t];
64
- a.name === "ev_fee" ? L = Number(a.value) : a.name === "network_fee" && (W = Number(a.value));
65
- }
66
- const [h, Y] = c({
67
- symbol: ""
68
- }), [T, G] = c(E.fiat_amount || "50"), [D, S] = c(!1), [A, i] = c(0), [F, X] = c(0), [U, Q] = c([]), [ne, Ce] = c(!1), [ae, ve] = c(50), [ie, Ne] = c(3e3), [oe, Ee] = c(50), [se, ke] = c(3e3), [Te, q] = c("");
69
- v(() => {
70
- if (E.crypto_currency) {
71
- const t = k.find(
72
- (a) => a.symbol === E.crypto_currency
73
- );
74
- Y(t);
75
- } else
76
- m && m.id && Y(m);
77
- }, [m, E.crypto_currency]), v(() => {
78
- F && n(F);
79
- }, [F]), v(() => {
80
- if (p.length === 0)
81
- return;
82
- const t = [];
83
- for (let a = 0; a < p.length; a++) {
84
- if (p[a].symbol === b) {
85
- const l = p[a].payment_options;
86
- X(p[a].id);
87
- let $ = !1;
88
- for (let O = 0; O < l.length; O++) {
89
- const ce = l[O];
90
- ce.active && (t.push(ce), l[O].id === A && ($ = !0));
91
- }
92
- $ || i(t[0].id);
93
- }
94
- Q(t);
95
- }
96
- }, [b, p]), v(() => {
97
- if (h && h.id && T && A && F) {
98
- u($e()), S(!1), q("");
99
- const t = setTimeout(() => {
100
- Ae();
101
- }, 1e3);
102
- return () => clearTimeout(t);
103
- }
104
- }, [h, T, A, k, F]);
105
- const Ae = () => {
106
- var $;
107
- const t = parseFloat(T);
108
- if (h.symbol === le) {
109
- if (ae > t)
110
- return q(
111
- `Minimum value should be greater than ${d + ae}`
112
- ), S(!0), !1;
113
- if (ie * 1 < t)
114
- return q(
115
- `Maximum value should be less than ${d + ie}`
116
- ), S(!0), !1;
117
- } else {
118
- if (oe * 1 > t)
119
- return q(
120
- `Minimum value should be greater than ${d + oe}`
121
- ), S(!0), !1;
122
- if (se * 1 < t)
123
- return q(
124
- `Maximum value should be less than ${d + se}`
125
- ), S(!0), !1;
126
- }
127
- const a = U.find((O) => O.id === A), l = a.payment_type;
128
- u(
129
- xe({
130
- apiKey: z,
131
- transaction_type: h.symbol === le ? Z : ee,
132
- coin_amount: T,
133
- exchange: h.exchange,
134
- payment_type: l,
135
- fiat_ccy: b,
136
- crypto_ccy: h.symbol,
137
- network: ($ = h.network) == null ? void 0 : $.name,
138
- payment_provider: a.payment_provider
139
- })
140
- );
141
- }, Fe = ({ value: t, label: a }) => {
142
- let l;
143
- if (a === "credit_debit_card" ? (l = Ve, A === t && (l = Le)) : (l = We, A === t && (l = Ye)), a)
144
- return /* @__PURE__ */ e(
145
- f,
146
- {
147
- mt: 0.5,
148
- sx: { cursor: "pointer" },
149
- onClick: () => i(t * 1),
150
- children: /* @__PURE__ */ e("img", { src: l, alt: "payment", width: "90%" })
151
- }
152
- );
153
- };
154
- v(() => {
155
- const t = g.types.length;
156
- if (t > 0)
157
- for (let a = 0; a < t; a++) {
158
- const l = g.types[a];
159
- if (l.type === Z) {
160
- ve(parseFloat(l.min_deposit_amount)), Ne(parseFloat(l.max_deposit_amount));
161
- break;
162
- }
163
- if (l.type === ee) {
164
- Ee(parseFloat(l.min_deposit_amount)), ke(parseFloat(l.max_deposit_amount));
165
- break;
166
- }
167
- }
168
- }, [g.types]);
169
- const Ie = (t) => {
170
- const a = t.target.value;
171
- a ? /^([0-9.,]+)$/.test(a) && G(a) : G("");
172
- }, Pe = (t) => {
173
- const a = k.find((l) => l.symbol === t);
174
- Y(a);
175
- }, ze = () => {
176
- if (!h.id)
177
- return x({ message: "Please select token" }), !1;
178
- if (!A)
179
- return x({ message: "Please select payment method" }), !1;
180
- if (!T)
181
- return x({ message: "Please enter amount" }), !1;
182
- if (!R)
183
- return x({
184
- message: "Please wait for the estimate to be calculated and then press next"
185
- }), !1;
186
- C(be);
187
- };
188
- return /* @__PURE__ */ r(P, { children: [
189
- /* @__PURE__ */ r(o, { mt: 0.5, spacing: 1, container: !0, children: [
190
- /* @__PURE__ */ e(o, { size: { xs: 3.5 }, children: /* @__PURE__ */ r(f, { className: w["buy-info"], children: [
191
- /* @__PURE__ */ e(s, { variant: "2xl", children: /* @__PURE__ */ e("strong", { children: "Buy Credits" }) }),
192
- /* @__PURE__ */ r(s, { variant: "md", children: [
193
- "1 credit = ",
194
- B,
195
- d
196
- ] })
197
- ] }) }),
198
- /* @__PURE__ */ e(o, { size: { xs: 6 }, children: /* @__PURE__ */ r(
199
- f,
200
- {
201
- className: w["buy-info"],
202
- sx: {
203
- padding: "0px 50px !important",
204
- alignItems: "center"
205
- },
206
- children: [
207
- /* @__PURE__ */ e(s, { variant: "md", children: "MAX amount you can request:" }),
208
- /* @__PURE__ */ e(s, { variant: "md", children: "267 credits" })
209
- ]
210
- }
211
- ) }),
212
- /* @__PURE__ */ e(o, { size: { xs: 2.5 }, children: /* @__PURE__ */ r(
213
- f,
214
- {
215
- className: w["buy-info"],
216
- sx: {
217
- background: "black !important",
218
- color: "white !important"
219
- },
220
- children: [
221
- /* @__PURE__ */ e(s, { variant: "md", className: "text-right", children: "Game Balance" }),
222
- /* @__PURE__ */ e(s, { variant: "lg", className: "text-right", children: "34" })
223
- ]
224
- }
225
- ) })
226
- ] }),
227
- /* @__PURE__ */ e(o, { mt: 2, spacing: 2, container: !0, children: /* @__PURE__ */ e(o, { size: { xs: 6 }, children: /* @__PURE__ */ e(
228
- J,
229
- {
230
- label: "You Pay",
231
- value: T,
232
- onChange: Ie,
233
- type: "text",
234
- labelFontWeight: 600,
235
- error: D,
236
- errorText: Te,
237
- required: !0,
238
- fullWidth: !0
239
- }
240
- ) }) }),
241
- /* @__PURE__ */ r(f, { className: "text-left", mt: 3, children: [
242
- /* @__PURE__ */ e(s, { variant: "sm", fontWeight: 600, children: "Select Payment Method" }),
243
- N ? /* @__PURE__ */ e(I, { sx: { ml: 1, mt: 3 }, size: 50 }) : /* @__PURE__ */ e(o, { mt: 0.5, container: !0, children: U.map((t) => /* @__PURE__ */ e(o, { size: { xs: 2.5 }, children: /* @__PURE__ */ e(
244
- Fe,
245
- {
246
- label: t.payment_type,
247
- value: t.id
248
- }
249
- ) }, t.id)) })
250
- ] }),
251
- /* @__PURE__ */ r(o, { mt: 3, spacing: 2, container: !0, children: [
252
- /* @__PURE__ */ e(o, { size: { xs: 6 }, children: /* @__PURE__ */ e(
253
- J,
254
- {
255
- label: "You Receive",
256
- labelFontWeight: 600,
257
- value: R && (+R * 1).toFixed(5),
258
- type: "text",
259
- error: D,
260
- readOnly: !0,
261
- required: !0,
262
- fullWidth: !0
263
- }
264
- ) }),
265
- /* @__PURE__ */ e(o, { size: { xs: 5 }, className: "content-center", children: H ? /* @__PURE__ */ e(I, { sx: { ml: 1 }, size: 30 }) : /* @__PURE__ */ r(P, { children: [
266
- /* @__PURE__ */ e(tt, { children: " " }),
267
- /* @__PURE__ */ e(rt, { variant: "outlined", fullWidth: !0, children: /* @__PURE__ */ r(
268
- nt,
269
- {
270
- sx: { marginTop: "-2px" },
271
- inputProps: {
272
- sx: {
273
- display: "flex",
274
- alignItems: "center",
275
- padding: "10px"
276
- }
277
- },
278
- value: h.symbol,
279
- onChange: (t) => Pe(t.target.value),
280
- children: [
281
- /* @__PURE__ */ e(he, { value: "", children: "Please select" }),
282
- k.map((t) => /* @__PURE__ */ r(he, { value: t.symbol, children: [
283
- /* @__PURE__ */ e(at, { className: "dropdown-list-item", children: /* @__PURE__ */ e(
284
- "img",
285
- {
286
- src: t.icon_uri,
287
- onError: ({ currentTarget: a }) => {
288
- a.onerror = null, a.src = we;
289
- },
290
- alt: "tokenImg",
291
- width: "36",
292
- height: "36"
293
- }
294
- ) }),
295
- /* @__PURE__ */ e("span", { children: t.name })
296
- ] }, t.id))
297
- ]
298
- }
299
- ) })
300
- ] }) })
301
- ] }),
302
- /* @__PURE__ */ e(f, { mt: 3, sx: { color: "#1A202C" }, children: /* @__PURE__ */ r(o, { container: !0, children: [
303
- /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 12 }, children: /* @__PURE__ */ r(
304
- fe,
305
- {
306
- sx: { padding: "0" },
307
- onClick: () => Ce((t) => !t),
308
- disableFocusRipple: !0,
309
- disableRipple: !0,
310
- children: [
311
- /* @__PURE__ */ e(s, { variant: "md", fontWeight: 500, children: "Fee Calculation" }),
312
- /* @__PURE__ */ e(
313
- Me,
314
- {
315
- sx: {
316
- transform: `rotate(${ne ? "90" : "0"}deg)`,
317
- fontSize: "15px"
318
- }
319
- }
320
- )
321
- ]
322
- }
323
- ) }),
324
- ne && /* @__PURE__ */ r(P, { children: [
325
- /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: "Everest Fee" }) }),
326
- /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ r(s, { variant: "caption", children: [
327
- d,
328
- M ? /* @__PURE__ */ e(
329
- I,
330
- {
331
- sx: { ml: 1 },
332
- size: 15,
333
- color: "primary"
334
- }
335
- ) : L.toFixed(2)
336
- ] }) }),
337
- /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: "Network Fee" }) }),
338
- /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ r(s, { variant: "caption", children: [
339
- d,
340
- M ? /* @__PURE__ */ e(
341
- I,
342
- {
343
- sx: { ml: 1 },
344
- size: 15,
345
- color: "primary"
346
- }
347
- ) : W.toFixed(2)
348
- ] }) })
349
- ] }),
350
- /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: "Total Fees" }) }),
351
- /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ r(s, { variant: "caption", children: [
352
- d,
353
- M ? /* @__PURE__ */ e(I, { sx: { ml: 1 }, size: 15, color: "primary" }) : Number(V).toFixed(2)
354
- ] }) }),
355
- h && /* @__PURE__ */ r(P, { children: [
356
- /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ r(s, { variant: "caption", children: [
357
- "1 ",
358
- h.symbol,
359
- " ",
360
- /* @__PURE__ */ e(
361
- Ue,
362
- {
363
- title: Be,
364
- placement: "right",
365
- children: /* @__PURE__ */ e(fe, { className: "info-fee-icon", children: /* @__PURE__ */ e(
366
- Oe,
367
- {
368
- sx: {
369
- fontSize: "14px"
370
- }
371
- }
372
- ) })
373
- }
374
- )
375
- ] }) }),
376
- /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ r(s, { variant: "caption", children: [
377
- d,
378
- M ? /* @__PURE__ */ e(
379
- I,
380
- {
381
- sx: { ml: 1 },
382
- size: 15,
383
- color: "primary"
384
- }
385
- ) : Number(B).toFixed(2)
386
- ] }) })
387
- ] })
388
- ] }) }),
389
- /* @__PURE__ */ e(f, { mt: 4, children: /* @__PURE__ */ e(
390
- te,
391
- {
392
- onClick: ze,
393
- disabled: D || !R,
394
- fullWidth: !0,
395
- children: /* @__PURE__ */ e("strong", { children: "Next" })
396
- }
397
- ) })
398
- ] });
399
- }, st = ({
400
- setScreen: C,
401
- partnerKey: g,
402
- orderData: u,
403
- dispatch: _,
404
- walletAddress: y
405
- }) => {
406
- const n = u.estimate, x = u.create.order_id, z = u.loader, b = n.fiat_amount, d = ge(n.fiat_currency), [p, N] = c(!1);
407
- v(() => {
408
- x && p && C(mt);
409
- }, [x]), v(() => {
410
- k();
411
- }, []);
412
- const k = () => {
413
- _(
414
- xe({
415
- ...n,
416
- apiKey: g,
417
- transaction_type: n.transaction_type,
418
- coin_amount: n.fiat_amount,
419
- exchange: n.exchange,
420
- payment_type: n.payment_type,
421
- fiat_ccy: n.fiat_currency,
422
- crypto_ccy: n.crypto_currency,
423
- network: n.network,
424
- payment_provider: n.payment_provider
425
- })
426
- );
427
- }, m = () => {
428
- _(
429
- Ke({
430
- apiKey: g,
431
- quoteId: n.quote_id,
432
- walletAddress: y
433
- })
434
- ), N(!0);
435
- };
436
- return /* @__PURE__ */ r(P, { children: [
437
- /* @__PURE__ */ e(_e, { onClickHandler: () => C(re) }),
438
- /* @__PURE__ */ e(s, { mt: 2, variant: "sm", fontWeight: 600, children: "Using payment method" }),
439
- /* @__PURE__ */ r(f, { mt: 2, className: w["confirm-payment"], children: [
440
- /* @__PURE__ */ e(
441
- "img",
442
- {
443
- src: n.payment_type === me ? De : ye,
444
- width: 100,
445
- alt: "payment"
446
- }
447
- ),
448
- /* @__PURE__ */ e(s, { variant: "caption", component: "span", children: /* @__PURE__ */ e("strong", { children: n.payment_type === me ? "Bank Account" : "Debit Card" }) })
449
- ] }),
450
- /* @__PURE__ */ e(s, { mt: 4, variant: "sm", fontWeight: 600, children: "To Wallet Address" }),
451
- /* @__PURE__ */ e(
452
- f,
453
- {
454
- mt: 2,
455
- className: w["confirm-payment"],
456
- sx: { width: "100% !important" },
457
- children: /* @__PURE__ */ e(s, { variant: "caption", component: "p", children: /* @__PURE__ */ e("strong", { children: y }) })
458
- }
459
- ),
460
- /* @__PURE__ */ e(s, { mt: 3, variant: "sm", fontWeight: 600, component: "p", children: "Order Estimate Details" }),
461
- /* @__PURE__ */ e(f, { sx: { color: "#A6A6A6" }, children: /* @__PURE__ */ r(o, { container: !0, children: [
462
- /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ r(s, { variant: "caption", children: [
463
- n.crypto_currency.toUpperCase(),
464
- " @",
465
- " ",
466
- Number(n.conversion_price).toFixed(2),
467
- " ",
468
- n.fiat_currency
469
- ] }) }),
470
- /* @__PURE__ */ e(o, { className: "flex-right", size: { xs: 6 }, children: /* @__PURE__ */ e(
471
- "span",
472
- {
473
- className: w["confirm-transaction-network"],
474
- style: {
475
- backgroundColor: n.network === "Ethereum" ? "#A1A9DC" : "#5D8CCC"
476
- },
477
- children: n.network
478
- }
479
- ) }),
480
- /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ r(s, { variant: "caption", children: [
481
- Number(n.crypto_out_amount).toFixed(5),
482
- " ",
483
- n.crypto_currency.toUpperCase()
484
- ] }) }),
485
- /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ r(s, { variant: "caption", children: [
486
- (Number(b) - Number(n.total_fee)).toFixed(2),
487
- " ",
488
- n.fiat_currency
489
- ] }) }),
490
- /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: "Total Fees" }) }),
491
- /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ r(s, { variant: "caption", children: [
492
- Number(n.total_fee).toFixed(2),
493
- " ",
494
- n.fiat_currency
495
- ] }) }),
496
- /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: /* @__PURE__ */ e("strong", { children: "Order Total" }) }) }),
497
- /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: /* @__PURE__ */ r("strong", { children: [
498
- d,
499
- Number(b).toFixed(2),
500
- " ",
501
- n.fiat_currency
502
- ] }) }) })
503
- ] }) }),
504
- /* @__PURE__ */ e(f, { mt: 4, children: /* @__PURE__ */ e(
505
- te,
506
- {
507
- onClick: m,
508
- disabled: z,
509
- fullWidth: !0,
510
- children: /* @__PURE__ */ e("strong", { children: z ? /* @__PURE__ */ r(P, { children: [
511
- /* @__PURE__ */ e(I, { size: 15, color: "inherit" }),
512
- " Processing..."
513
- ] }) : "Payment Details" })
514
- }
515
- ) })
516
- ] });
517
- }, ct = Qe(/* @__PURE__ */ e("path", {
518
- d: "M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"
519
- }), "ErrorOutline"), lt = ({
520
- checkoutKey: C,
521
- setScreen: g,
522
- showAlertMessage: u,
523
- rrBaseUrl: _,
524
- orderData: y,
525
- dispatch: n
526
- }) => {
527
- const x = y.estimate, z = y.create.order_id, b = y.payment, [d, p] = c(!0), [N, k] = c(""), [m, H] = c(!1), [M, E] = c({
528
- name: "",
529
- billingAddress: {
530
- addressLine1: ""
531
- }
532
- }), [R, B] = c(!1), [V, L] = c(!0), [W, K] = c(!0), [h, Y] = c(!0), [T, G] = c(!0);
533
- v(() => {
534
- b._links.redirect.href && window.location.replace(b._links.redirect.href);
535
- }, [b]), v(() => {
536
- E({
537
- name: N,
538
- billingAddress: {
539
- addressLine1: ""
540
- }
541
- });
542
- }, [N]), v(() => {
543
- !W && !h && !T && N !== "" ? V && L(!1) : V || L(!0);
544
- }, [N, W, h, T]);
545
- const D = (i, F, X, U = /./) => {
546
- if (i !== "" && !U.test(i))
547
- return !1;
548
- F(i);
549
- const Q = typeof i == "string" ? je(i) : i;
550
- X(!Q);
551
- }, S = (i) => {
552
- if (i && i.element)
553
- switch (i.element) {
554
- case "card-number":
555
- K(i.isEmpty || !i.isValid);
556
- break;
557
- case "expiry-date":
558
- Y(i.isEmpty || !i.isValid);
559
- break;
560
- case "cvv":
561
- G(i.isEmpty || !i.isValid);
562
- break;
563
- default:
564
- console.log("NOOP");
565
- break;
566
- }
567
- }, A = (i) => {
568
- if (i === "") {
569
- u({ message: "Error processing card" }), B(!1), g(re);
570
- return;
571
- }
572
- const F = {
573
- token: i,
574
- amount: Number(x.fiat_amount),
575
- currency: x.fiat_currency,
576
- reference: z,
577
- success_url: `${_}/dashboard`,
578
- fail_url: `${_}/dashboard?status=failed`
579
- };
580
- n(Ge(F));
581
- };
582
- return /* @__PURE__ */ r(P, { children: [
583
- /* @__PURE__ */ e(_e, { onClickHandler: () => g(be) }),
584
- /* @__PURE__ */ r(s, { className: "text-center", variant: "subtitle1", mt: 2, children: [
585
- /* @__PURE__ */ e("img", { src: ye, width: 140, alt: "Debit Card" }),
586
- /* @__PURE__ */ e("br", {}),
587
- /* @__PURE__ */ e("b", { children: "Debit Card" })
588
- ] }),
589
- /* @__PURE__ */ r(
590
- s,
591
- {
592
- className: "text-center d-flex items-center",
593
- variant: "caption",
594
- mt: 2,
595
- children: [
596
- /* @__PURE__ */ e(ct, {}),
597
- "   ",
598
- /* @__PURE__ */ e("b", { style: { marginTop: "3px" }, children: "Fiat purchasing is not available for users with Chase and Citi bank accounts" })
599
- ]
600
- }
601
- ),
602
- x.payment_provider === de && d && /* @__PURE__ */ e(f, { className: "text-center", mt: 8, children: /* @__PURE__ */ e(I, {}) }),
603
- /* @__PURE__ */ e(f, { mt: 2, children: x.payment_provider === de && /* @__PURE__ */ r(
604
- pe,
605
- {
606
- config: {
607
- debug: !1,
608
- publicKey: C,
609
- acceptedPaymentMethods: ["Visa", "Mastercard"],
610
- cardholder: M,
611
- localization: {
612
- cardNumberPlaceholder: "Card number",
613
- expiryMonthPlaceholder: "MM",
614
- expiryYearPlaceholder: "YY",
615
- cvvPlaceholder: "CVV"
616
- },
617
- style: {
618
- base: {
619
- color: "black",
620
- fontSize: "18px"
621
- },
622
- // autofill: {
623
- // backgroundColor: "yellow",
624
- // },
625
- // hover: {
626
- // color: "blue",
627
- // },
628
- focus: {
629
- color: "blue"
630
- },
631
- valid: {
632
- color: "green"
633
- },
634
- invalid: {
635
- color: "red"
636
- },
637
- placeholder: {
638
- base: {
639
- color: "gray",
640
- marginLeft: "20px"
641
- }
642
- }
643
- }
644
- },
645
- ready: () => {
646
- p(!1);
647
- },
648
- frameValidationChanged: (i) => {
649
- S(i);
650
- },
651
- cardSubmitted: () => {
652
- B(!0);
653
- },
654
- cardTokenized: (i) => {
655
- A(i.token);
656
- },
657
- cardTokenizationFailed: (i) => {
658
- alert("card tokenization failed"), console.log(i);
659
- },
660
- children: [
661
- /* @__PURE__ */ e(
662
- J,
663
- {
664
- label: "Name on Card",
665
- value: N,
666
- onChange: (i) => D(i.target.value, k, H),
667
- error: m
668
- }
669
- ),
670
- /* @__PURE__ */ e(
671
- Je,
672
- {
673
- style: {
674
- height: "4em",
675
- margin: "20px 0",
676
- padding: "20px",
677
- border: "1px solid #999"
678
- }
679
- }
680
- ),
681
- /* @__PURE__ */ e(
682
- Ze,
683
- {
684
- style: {
685
- height: "4em",
686
- margin: "20px 0",
687
- padding: "20px",
688
- border: "1px solid #999"
689
- }
690
- }
691
- ),
692
- /* @__PURE__ */ e(
693
- et,
694
- {
695
- style: {
696
- height: "4em",
697
- margin: "20px 0",
698
- padding: "20px",
699
- border: "1px solid #999"
700
- }
701
- }
702
- ),
703
- /* @__PURE__ */ e(
704
- te,
705
- {
706
- onClick: () => {
707
- pe.submitCard();
708
- },
709
- fullWidth: !0,
710
- disabled: V,
711
- children: /* @__PURE__ */ e("strong", { children: R ? /* @__PURE__ */ r(P, { children: [
712
- /* @__PURE__ */ e(I, { size: 15, color: "inherit" }),
713
- " Processing..."
714
- ] }) : "Pay" })
715
- }
716
- )
717
- ]
718
- }
719
- ) }),
720
- /* @__PURE__ */ e(f, { mt: 8, children: /* @__PURE__ */ e("div", { id: "st-animated-card" }) })
721
- ] });
722
- }, re = "FORM_SCREEN", be = "CONFIRM_SCREEN", mt = "PAYMENT_SCREEN", dt = ({ partnerKey: C, rrBaseUrl: g }) => {
723
- const u = Xe(), _ = j((m) => m.order), y = _.error, n = j(
724
- (m) => m.user.profile.everWalletAddress
725
- ), x = j(
726
- (m) => m.fiatAssets
727
- ), z = j(
728
- (m) => m.cryptoAssets
729
- ), [b, d] = c(re), { showAlertMessage: p, snackBar: N } = He();
730
- return v(() => {
731
- y && p({ message: y });
732
- }, [y]), v(() => {
733
- u(it()), u(ue(ee)), u(ue(Z));
734
- }, []), /* @__PURE__ */ r(P, { children: [
735
- N,
736
- /* @__PURE__ */ e(
737
- f,
738
- {
739
- sx: {
740
- padding: { xs: "1rem", md: "2rem" },
741
- backgroundColor: "#FFFFFF",
742
- borderRadius: "1rem",
743
- boxShadow: "0px 0px 64px 0px rgba(247, 247, 248, 1)"
744
- },
745
- children: {
746
- FORM_SCREEN: /* @__PURE__ */ e(
747
- ot,
748
- {
749
- showAlertMessage: p,
750
- setScreen: d,
751
- fiatAssets: x,
752
- cryptoAssets: z,
753
- orderData: _,
754
- dispatch: u,
755
- getCryptoAssets: (m) => {
756
- u(Re({ type: "buy", id: m, partnerKey: C }));
757
- },
758
- partnerKey: C
759
- }
760
- ),
761
- CONFIRM_SCREEN: /* @__PURE__ */ e(
762
- st,
763
- {
764
- partnerKey: C,
765
- setScreen: d,
766
- showAlertMessage: p,
767
- orderData: _,
768
- dispatch: u,
769
- walletAddress: n
770
- }
771
- ),
772
- PAYMENT_SCREEN: /* @__PURE__ */ e(
773
- lt,
774
- {
775
- checkoutKey: "pk_sbox_xnmwsvzydkhjeyi34z4b6ea5qi4",
776
- setScreen: d,
777
- showAlertMessage: p,
778
- orderData: _,
779
- rrBaseUrl: g,
780
- dispatch: u
781
- }
782
- )
783
- }[b]
784
- }
785
- )
786
- ] });
787
- }, Zt = Se(dt);
788
- export {
789
- ot as B,
790
- lt as C,
791
- re as F,
792
- mt as P,
793
- st as a,
794
- be as b,
795
- Zt as i
796
- };