@nowramp/form 0.1.73 → 0.1.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9,13 +9,13 @@
9
9
  document.head.appendChild(s);
10
10
  })();
11
11
  import { jsx as e, jsxs as o, Fragment as J } from "react/jsx-runtime";
12
- import ve, { useState as v, useRef as I, useCallback as B, useEffect as W, useMemo as Y, useReducer as ua, useContext as ma, createContext as fa } from "react";
13
- import { RampApi as Qe } from "@nowramp/sdk";
12
+ import de, { useState as v, useRef as O, useCallback as P, useEffect as Y, useMemo as Z, useReducer as ua, useContext as ma, createContext as fa } from "react";
13
+ import { RampApi as ze } from "@nowramp/sdk";
14
14
  import { createPortal as Ut } from "react-dom";
15
15
  function ha(t, a, n) {
16
- const [r, i] = v(null), [c, m] = v(!0), [s, u] = v(null), f = I(null);
17
- (!f.current || f.current !== t) && (f.current = new Qe({ apiKey: "", ...t }));
18
- const h = B(async () => {
16
+ const [r, l] = v(null), [c, m] = v(!0), [s, u] = v(null), f = O(null);
17
+ (!f.current || f.current !== t) && (f.current = new ze({ apiKey: "", ...t }));
18
+ const h = P(async () => {
19
19
  if (!t.projectId) {
20
20
  u(new Error("projectId is required")), m(!1);
21
21
  return;
@@ -25,22 +25,22 @@ function ha(t, a, n) {
25
25
  const d = {};
26
26
  a && (d.orderType = a), n && (d.country = n);
27
27
  const p = await f.current.getSupported(d);
28
- i(p);
28
+ l(p);
29
29
  } catch (d) {
30
30
  u(d instanceof Error ? d : new Error("Failed to fetch config"));
31
31
  } finally {
32
32
  m(!1);
33
33
  }
34
34
  }, [t.projectId, a, n]);
35
- return W(() => {
35
+ return Y(() => {
36
36
  h();
37
37
  }, [h]), { config: r, loading: c, error: s, refetch: h };
38
38
  }
39
39
  function pa(t, a) {
40
- const [n, r] = v(null), [i, c] = v(!1), [m, s] = v(null), u = I(null), f = I(""), h = `${t.apiUrl}|${t.projectId}`;
41
- (!u.current || f.current !== h) && (u.current = new Qe({ apiKey: "", ...t }), f.current = h);
42
- const d = I(0);
43
- W(() => {
40
+ const [n, r] = v(null), [l, c] = v(!1), [m, s] = v(null), u = O(null), f = O(""), h = `${t.apiUrl}|${t.projectId}`;
41
+ (!u.current || f.current !== h) && (u.current = new ze({ apiKey: "", ...t }), f.current = h);
42
+ const d = O(0);
43
+ Y(() => {
44
44
  const g = ++d.current;
45
45
  if (!a || !t.projectId) {
46
46
  r(null), c(!1);
@@ -55,7 +55,7 @@ function pa(t, a) {
55
55
  }
56
56
  );
57
57
  }, [t.projectId, a == null ? void 0 : a.fiatCurrency, a == null ? void 0 : a.fiatAmount, a == null ? void 0 : a.cryptoAmount, a == null ? void 0 : a.cryptoCurrency, a == null ? void 0 : a.network, a == null ? void 0 : a.paymentMethodId, a == null ? void 0 : a.country, a == null ? void 0 : a.orderType]);
58
- const p = B(async () => {
58
+ const p = P(async () => {
59
59
  if (!(!a || !t.projectId)) {
60
60
  c(!0), s(null);
61
61
  try {
@@ -68,13 +68,13 @@ function pa(t, a) {
68
68
  }
69
69
  }
70
70
  }, [t.projectId, a]);
71
- return { quotes: n, loading: i, error: m, refetch: p };
71
+ return { quotes: n, loading: l, error: m, refetch: p };
72
72
  }
73
73
  function ya(t) {
74
- const [a, n] = v(null), [r, i] = v(!1), [c, m] = v(null), s = I(null), u = I(""), f = `${t.apiUrl}|${t.projectId}`;
75
- (!s.current || u.current !== f) && (s.current = new Qe({ apiKey: "", ...t }), u.current = f);
76
- const h = B(async (p) => {
77
- i(!0), m(null);
74
+ const [a, n] = v(null), [r, l] = v(!1), [c, m] = v(null), s = O(null), u = O(""), f = `${t.apiUrl}|${t.projectId}`;
75
+ (!s.current || u.current !== f) && (s.current = new ze({ apiKey: "", ...t }), u.current = f);
76
+ const h = P(async (p) => {
77
+ l(!0), m(null);
78
78
  try {
79
79
  const g = await s.current.createCheckoutIntent(p);
80
80
  return n(g), g;
@@ -82,22 +82,22 @@ function ya(t) {
82
82
  const A = g instanceof Error ? g : new Error("Failed to create checkout intent");
83
83
  throw m(A), A;
84
84
  } finally {
85
- i(!1);
85
+ l(!1);
86
86
  }
87
- }, []), d = B(() => {
87
+ }, []), d = P(() => {
88
88
  n(null), m(null);
89
89
  }, []);
90
90
  return { order: a, loading: r, error: c, createOrder: h, reset: d };
91
91
  }
92
92
  function xa(t, a, n) {
93
- const [r, i] = v(null), [c, m] = v(!1), [s, u] = v(null), f = I(null);
94
- f.current || (f.current = new Qe({ apiKey: "", projectId: "", ...t }));
95
- const h = B(async () => {
93
+ const [r, l] = v(null), [c, m] = v(!1), [s, u] = v(null), f = O(null);
94
+ f.current || (f.current = new ze({ apiKey: "", projectId: "", ...t }));
95
+ const h = P(async () => {
96
96
  if (a) {
97
97
  m(!0), u(null);
98
98
  try {
99
99
  const d = await f.current.getTransaction(a);
100
- i(d);
100
+ l(d);
101
101
  } catch (d) {
102
102
  u(d instanceof Error ? d : new Error("Failed to fetch status"));
103
103
  } finally {
@@ -105,7 +105,7 @@ function xa(t, a, n) {
105
105
  }
106
106
  }
107
107
  }, [a]);
108
- return W(() => {
108
+ return Y(() => {
109
109
  if (!a) return;
110
110
  const d = (n == null ? void 0 : n.initialDelay) ?? 0;
111
111
  if (d > 0) {
@@ -113,14 +113,14 @@ function xa(t, a, n) {
113
113
  return () => clearTimeout(p);
114
114
  }
115
115
  h();
116
- }, [h, a, n == null ? void 0 : n.initialDelay]), W(() => {
116
+ }, [h, a, n == null ? void 0 : n.initialDelay]), Y(() => {
117
117
  if (!a || !(n != null && n.pollInterval) || !r || ["completed", "failed", "cancelled", "expired", "refunded"].includes(r.status))
118
118
  return;
119
119
  const p = setInterval(h, n.pollInterval);
120
120
  return () => clearInterval(p);
121
121
  }, [a, n == null ? void 0 : n.pollInterval, r == null ? void 0 : r.status, h]), { status: r, loading: c, error: s, refetch: h };
122
122
  }
123
- const Ye = [
123
+ const Ze = [
124
124
  { code: "ad", name: "Andorra", defaultFiat: "EUR" },
125
125
  { code: "ae", name: "United Arab Emirates", defaultFiat: "AED" },
126
126
  { code: "af", name: "Afghanistan", defaultFiat: "USD" },
@@ -313,7 +313,7 @@ const Ye = [
313
313
  { code: "zm", name: "Zambia", defaultFiat: "USD" },
314
314
  { code: "zw", name: "Zimbabwe", defaultFiat: "USD" }
315
315
  ], st = Object.fromEntries(
316
- Ye.map((t) => [t.code, t])
316
+ Ze.map((t) => [t.code, t])
317
317
  );
318
318
  function ot(t, a) {
319
319
  if (!t) return "USD";
@@ -409,7 +409,7 @@ function Ca({
409
409
  apiUrl: a = "https://api.nowramp.com",
410
410
  assetBaseUrl: n = "",
411
411
  flowType: r = "buy",
412
- customerId: i = "",
412
+ customerId: l = "",
413
413
  brandId: c,
414
414
  defaultFiatCurrency: m = "USD",
415
415
  defaultCryptoCurrency: s = "BTC",
@@ -422,201 +422,214 @@ function Ca({
422
422
  fieldLocks: A,
423
423
  statusPollInterval: E = 5e3,
424
424
  onComplete: R,
425
- onError: P,
426
- children: ne
425
+ onError: _,
426
+ children: ae
427
427
  }) {
428
- const V = Y(() => ({ apiUrl: a, projectId: t }), [a, t]), Z = u || (s ? s.toLowerCase() : ""), q = r === "sell", G = q ? !!h : !!f, y = (q ? !!(G && s && Z) : !!(G && s && Z && d)) && p ? "confirm" : "amount", L = f || (r === "buy" ? "250" : ""), [l, M] = ua(ga, {
428
+ const j = Z(() => ({ apiUrl: a, projectId: t }), [a, t]), Q = u || (s ? s.toLowerCase() : ""), q = r === "sell", $ = q ? !!h : !!f, y = (q ? !!($ && s && Q) : !!($ && s && Q && d)) && p ? "confirm" : "amount", k = f || (r === "buy" ? "250" : ""), [i, I] = ua(ga, {
429
429
  ...Vt,
430
430
  step: y,
431
431
  flowType: r,
432
432
  fiatCurrency: m,
433
433
  cryptoCurrency: s,
434
- network: Z,
435
- fiatAmount: Dt(L, 2),
434
+ network: Q,
435
+ fiatAmount: Dt(k, 2),
436
436
  cryptoAmount: Dt(h, 6),
437
437
  walletAddress: d,
438
- customerId: i,
438
+ customerId: l,
439
439
  // If defaultCountry is provided, set it immediately with 'manual' source to skip auto-detection
440
440
  ...g ? { country: g.toLowerCase(), countrySource: "manual" } : {}
441
- }), w = l.flowType === "sell", {
441
+ }), b = i.flowType === "sell", {
442
442
  config: S,
443
- loading: he,
444
- error: pe
445
- } = ha(V, l.flowType, l.country || void 0), ye = I(!1);
446
- ve.useEffect(() => {
447
- var D;
448
- if (ye.current || !(S != null && S.detectedCountry) || l.country) return;
449
- ye.current = !0;
450
- const C = S.detectedCountry.toLowerCase();
451
- M({ type: "SET_COUNTRY_AUTO", country: C });
452
- const b = (D = S.fiats) == null ? void 0 : D.map((F) => F.code), U = ot(C, b);
453
- U !== l.fiatCurrency && M({ type: "SET_FIAT_CURRENCY", currency: U });
454
- }, [S, l.country, l.fiatCurrency]);
455
- const ie = I(!1);
456
- ve.useEffect(() => {
443
+ loading: ge,
444
+ error: Ce
445
+ } = ha(j, i.flowType, i.country || void 0), Se = O(!1);
446
+ de.useEffect(() => {
457
447
  var U;
458
- if (ie.current || !g || !((U = S == null ? void 0 : S.fiats) != null && U.length)) return;
459
- ie.current = !0;
460
- const C = S.fiats.map((D) => D.code), b = ot(g, C);
461
- b !== l.fiatCurrency && M({ type: "SET_FIAT_CURRENCY", currency: b });
462
- }, [g, S, l.fiatCurrency]);
463
- const se = I(l.country);
464
- ve.useEffect(() => {
448
+ if (Se.current || !(S != null && S.detectedCountry) || i.country) return;
449
+ Se.current = !0;
450
+ const C = S.detectedCountry.toLowerCase();
451
+ I({ type: "SET_COUNTRY_AUTO", country: C });
452
+ const w = (U = S.fiats) == null ? void 0 : U.map((D) => D.code), L = ot(C, w);
453
+ L !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: L });
454
+ }, [S, i.country, i.fiatCurrency]);
455
+ const oe = O(!1);
456
+ de.useEffect(() => {
457
+ var L;
458
+ if (oe.current || !g || !((L = S == null ? void 0 : S.fiats) != null && L.length)) return;
459
+ oe.current = !0;
460
+ const C = S.fiats.map((U) => U.code), w = ot(g, C);
461
+ w !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: w });
462
+ }, [g, S, i.fiatCurrency]);
463
+ const me = O(i.country);
464
+ de.useEffect(() => {
465
+ var L;
466
+ if (i.country === me.current || (me.current = i.country, i.countrySource === "manual" && (ie.current = !1), i.countrySource !== "manual") || !((L = S == null ? void 0 : S.fiats) != null && L.length)) return;
467
+ const C = S.fiats.map((U) => U.code), w = ot(i.country, C);
468
+ w !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: w });
469
+ }, [i.country, i.countrySource, S, i.fiatCurrency]);
470
+ const M = O(i.fiatCurrency);
471
+ de.useEffect(() => {
465
472
  var U;
466
- if (l.country === se.current || (se.current = l.country, l.countrySource !== "manual") || !((U = S == null ? void 0 : S.fiats) != null && U.length)) return;
467
- const C = S.fiats.map((D) => D.code), b = ot(l.country, C);
468
- b !== l.fiatCurrency && M({ type: "SET_FIAT_CURRENCY", currency: b });
469
- }, [l.country, l.countrySource, S, l.fiatCurrency]), ve.useEffect(() => {
470
- var U, D, F;
471
- if (!S || !l.cryptoCurrency || l.network) return;
472
- const C = (U = S.cryptos) == null ? void 0 : U.find(($) => $.code === l.cryptoCurrency), b = ((D = C == null ? void 0 : C.networks) == null ? void 0 : D.find(($) => $.isDefault)) || ((F = C == null ? void 0 : C.networks) == null ? void 0 : F[0]);
473
- b != null && b.id && M({ type: "SET_NETWORK", network: b.id });
474
- }, [S, l.cryptoCurrency, l.network]), ve.useEffect(() => {
475
- var F, $;
476
- if (!((F = S == null ? void 0 : S.paymentMethods) != null && F.length)) return;
477
- const C = l.fiatCurrency, b = S.paymentMethods;
478
- if (l.paymentMethodId && b.some(
479
- (K) => K.id === l.paymentMethodId && K.supportedFiats.includes(C)
473
+ if (i.fiatCurrency === M.current || (M.current = i.fiatCurrency, b || !((U = S == null ? void 0 : S.fiats) != null && U.length) || !i.fiatAmount)) return;
474
+ const C = S.fiats.find((D) => D.code === i.fiatCurrency);
475
+ if (!(C != null && C.minAmount)) return;
476
+ const w = parseFloat(i.fiatAmount), L = parseFloat(C.minAmount);
477
+ !isNaN(w) && !isNaN(L) && w < L && I({ type: "SET_FIAT_AMOUNT", amount: String(Math.ceil(L)) });
478
+ }, [i.fiatCurrency, i.fiatAmount, S, b]), de.useEffect(() => {
479
+ var L, U, D;
480
+ if (!S || !i.cryptoCurrency || i.network) return;
481
+ const C = (L = S.cryptos) == null ? void 0 : L.find((F) => F.code === i.cryptoCurrency), w = ((U = C == null ? void 0 : C.networks) == null ? void 0 : U.find((F) => F.isDefault)) || ((D = C == null ? void 0 : C.networks) == null ? void 0 : D[0]);
482
+ w != null && w.id && I({ type: "SET_NETWORK", network: w.id });
483
+ }, [S, i.cryptoCurrency, i.network]), de.useEffect(() => {
484
+ var D, F;
485
+ if (!((D = S == null ? void 0 : S.paymentMethods) != null && D.length)) return;
486
+ const C = i.fiatCurrency, w = S.paymentMethods;
487
+ if (i.paymentMethodId && w.some(
488
+ (W) => W.id === i.paymentMethodId && W.supportedFiats.includes(C)
480
489
  ))
481
490
  return;
482
- const D = b.find(
483
- (Q) => Q.supportedFiats.includes(C) && (Q.id.includes("card") || Q.id.includes("debit"))
484
- ) || b.find((Q) => Q.supportedFiats.includes(C));
485
- M({ type: "SET_PAYMENT_METHOD", methodId: (D == null ? void 0 : D.id) || (($ = b[0]) == null ? void 0 : $.id) || "" });
486
- }, [S, l.fiatCurrency, l.paymentMethodId]);
487
- const k = Y(() => {
488
- if (w) {
489
- if (!l.cryptoAmount) return null;
490
- const F = parseFloat(l.cryptoAmount);
491
- return isNaN(F) || F <= 0 ? "Enter a valid amount" : null;
491
+ const U = w.find(
492
+ (B) => B.supportedFiats.includes(C) && (B.id.includes("card") || B.id.includes("debit"))
493
+ ) || w.find((B) => B.supportedFiats.includes(C));
494
+ I({ type: "SET_PAYMENT_METHOD", methodId: (U == null ? void 0 : U.id) || ((F = w[0]) == null ? void 0 : F.id) || "" });
495
+ }, [S, i.fiatCurrency, i.paymentMethodId]);
496
+ const ee = Z(() => {
497
+ if (b) {
498
+ if (!i.cryptoAmount) return null;
499
+ const D = parseFloat(i.cryptoAmount);
500
+ return isNaN(D) || D <= 0 ? "Enter a valid amount" : null;
492
501
  }
493
- if (!S || !l.fiatAmount) return null;
494
- const C = parseFloat(l.fiatAmount);
502
+ if (!S || !i.fiatAmount) return null;
503
+ const C = parseFloat(i.fiatAmount);
495
504
  if (isNaN(C)) return null;
496
- const b = S.fiats.find((F) => F.code === l.fiatCurrency);
497
- if (!b) return null;
498
- const U = parseFloat(b.minAmount), D = parseFloat(b.maxAmount);
499
- return !isNaN(U) && C < U ? `Minimum amount is ${b.minAmount} ${l.fiatCurrency}` : !isNaN(D) && C > D ? `Maximum amount is ${b.maxAmount} ${l.fiatCurrency}` : null;
500
- }, [S, l.fiatAmount, l.fiatCurrency, l.cryptoAmount, w]), be = Y(() => {
501
- const C = w ? !!l.cryptoAmount : !!l.fiatAmount;
502
- return !S || !C || !l.cryptoCurrency || !l.network || k ? null : {
503
- fiatCurrency: l.fiatCurrency,
504
- ...w ? { cryptoAmount: l.cryptoAmount } : { fiatAmount: l.fiatAmount },
505
- cryptoCurrency: l.cryptoCurrency,
506
- network: l.network,
507
- paymentMethodId: l.paymentMethodId || void 0,
508
- country: l.country || void 0,
509
- orderType: l.flowType
505
+ const w = S.fiats.find((D) => D.code === i.fiatCurrency);
506
+ if (!w) return null;
507
+ const L = parseFloat(w.minAmount), U = parseFloat(w.maxAmount);
508
+ return !isNaN(L) && C < L ? `Minimum amount is ${w.minAmount} ${i.fiatCurrency}` : !isNaN(U) && C > U ? `Maximum amount is ${w.maxAmount} ${i.fiatCurrency}` : null;
509
+ }, [S, i.fiatAmount, i.fiatCurrency, i.cryptoAmount, b]), G = Z(() => {
510
+ const C = b ? !!i.cryptoAmount : !!i.fiatAmount;
511
+ return !S || !C || !i.cryptoCurrency || !i.network || ee || S.detectedCountry && i.countrySource === "" && !g ? null : {
512
+ fiatCurrency: i.fiatCurrency,
513
+ ...b ? { cryptoAmount: i.cryptoAmount } : { fiatAmount: i.fiatAmount },
514
+ cryptoCurrency: i.cryptoCurrency,
515
+ network: i.network,
516
+ paymentMethodId: i.paymentMethodId || void 0,
517
+ country: i.country || void 0,
518
+ orderType: i.flowType
510
519
  };
511
- }, [S, l.fiatCurrency, l.fiatAmount, l.cryptoAmount, l.cryptoCurrency, l.network, l.paymentMethodId, l.country, k, w, l.flowType]), {
512
- quotes: j,
513
- loading: re,
514
- error: Ne,
515
- refetch: Ee
516
- } = pa(V, be), {
517
- order: de,
518
- loading: xe,
519
- error: O,
520
- createOrder: we
521
- } = ya(V), _e = 15e3, {
522
- status: ee,
523
- loading: Ve
520
+ }, [S, i.fiatCurrency, i.fiatAmount, i.cryptoAmount, i.cryptoCurrency, i.network, i.paymentMethodId, i.country, i.countrySource, ee, b, i.flowType, g]), {
521
+ quotes: X,
522
+ loading: fe,
523
+ error: he,
524
+ refetch: Le
525
+ } = pa(j, G), ie = O(!1);
526
+ de.useEffect(() => {
527
+ ie.current || i.countrySource === "auto" && (fe || !G || he || !X || X.bestQuote || i.fiatCurrency !== "USD" && (ie.current = !0, I({ type: "SET_FIAT_CURRENCY", currency: "USD" }), I({ type: "SET_FIAT_AMOUNT", amount: "250" })));
528
+ }, [X, fe, he, G, i.countrySource, i.fiatCurrency]);
529
+ const {
530
+ order: H,
531
+ loading: Ue,
532
+ error: Ee,
533
+ createOrder: De
534
+ } = ya(j), Ke = 15e3, {
535
+ status: ne,
536
+ loading: _e
524
537
  } = xa(
525
538
  { apiUrl: a },
526
- (de == null ? void 0 : de.orderId) ?? null,
527
- { pollInterval: E, initialDelay: _e }
539
+ (H == null ? void 0 : H.orderId) ?? null,
540
+ { pollInterval: E, initialDelay: Ke }
528
541
  );
529
- ve.useEffect(() => {
530
- (ee == null ? void 0 : ee.status) === "completed" && R && R(ee);
531
- }, [ee == null ? void 0 : ee.status, R]), ve.useEffect(() => {
532
- const C = pe || O;
533
- C && P && P(C);
534
- }, [pe, O, P]);
535
- const Fe = p || (S == null ? void 0 : S.defaultGateway) || null, Me = I(Fe);
536
- Me.current = Fe;
537
- const Ae = I(j);
538
- Ae.current = j;
539
- const Re = I(c);
540
- Re.current = c;
541
- const ze = B(async () => {
542
- var b, U, D;
543
- const C = ((b = l.selectedQuote) == null ? void 0 : b.gatewayId) || ((D = (U = Ae.current) == null ? void 0 : U.bestQuote) == null ? void 0 : D.gatewayId) || Me.current;
544
- if (!C || !l.walletAddress) {
545
- const F = [!C && "gateway", !l.walletAddress && "walletAddress"].filter(Boolean).join(", ");
546
- M({ type: "SET_ERROR", message: `Missing required fields: ${F}` });
542
+ de.useEffect(() => {
543
+ (ne == null ? void 0 : ne.status) === "completed" && R && R(ne);
544
+ }, [ne == null ? void 0 : ne.status, R]), de.useEffect(() => {
545
+ const C = Ce || Ee;
546
+ C && _ && _(C);
547
+ }, [Ce, Ee, _]);
548
+ const ve = p || (S == null ? void 0 : S.defaultGateway) || null, Fe = O(ve);
549
+ Fe.current = ve;
550
+ const Ve = O(X);
551
+ Ve.current = X;
552
+ const le = O(c);
553
+ le.current = c;
554
+ const Me = P(async () => {
555
+ var w, L, U;
556
+ const C = ((w = i.selectedQuote) == null ? void 0 : w.gatewayId) || ((U = (L = Ve.current) == null ? void 0 : L.bestQuote) == null ? void 0 : U.gatewayId) || Fe.current;
557
+ if (!C || !i.walletAddress) {
558
+ const D = [!C && "gateway", !i.walletAddress && "walletAddress"].filter(Boolean).join(", ");
559
+ I({ type: "SET_ERROR", message: `Missing required fields: ${D}` });
547
560
  return;
548
561
  }
549
562
  try {
550
- await we({
563
+ await De({
551
564
  gateway: C,
552
- customerId: l.customerId || void 0,
553
- fiatCurrency: l.fiatCurrency,
554
- ...w ? { cryptoAmount: l.cryptoAmount } : { fiatAmount: l.fiatAmount },
555
- cryptoCurrency: l.cryptoCurrency,
556
- network: l.network,
557
- walletAddress: l.walletAddress,
558
- paymentMethodId: l.paymentMethodId || void 0,
559
- email: l.email || void 0,
560
- orderType: l.flowType,
561
- ...Re.current ? { metadata: { brand: Re.current } } : {}
562
- }), M({ type: "SET_STEP", step: "checkout" });
563
- } catch (F) {
564
- const $ = F instanceof Error ? F.message : "Failed to create order";
565
- /wallet|address/i.test($) ? M({ type: "SET_WALLET_ERROR", message: $.replace(/^Failed to create checkout intent:\s*/i, "") }) : M({ type: "SET_ERROR", message: $ });
565
+ customerId: i.customerId || void 0,
566
+ fiatCurrency: i.fiatCurrency,
567
+ ...b ? { cryptoAmount: i.cryptoAmount } : { fiatAmount: i.fiatAmount },
568
+ cryptoCurrency: i.cryptoCurrency,
569
+ network: i.network,
570
+ walletAddress: i.walletAddress,
571
+ paymentMethodId: i.paymentMethodId || void 0,
572
+ email: i.email || void 0,
573
+ orderType: i.flowType,
574
+ ...le.current ? { metadata: { brand: le.current } } : {}
575
+ }), I({ type: "SET_STEP", step: "checkout" });
576
+ } catch (D) {
577
+ const F = D instanceof Error ? D.message : "Failed to create order";
578
+ /wallet|address/i.test(F) ? I({ type: "SET_WALLET_ERROR", message: F.replace(/^Failed to create checkout intent:\s*/i, "") }) : I({ type: "SET_ERROR", message: F });
566
579
  }
567
- }, [l, we, w]), ge = B((C) => {
568
- M({ type: "SET_STEP", step: C });
569
- }, []), Ie = B(() => {
570
- const C = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], b = C.indexOf(l.step);
571
- b > 0 && M({ type: "SET_STEP", step: C[b - 1] });
572
- }, [l.step, w]), Je = Y(() => {
573
- const C = w ? !!l.cryptoAmount : !!l.fiatAmount;
574
- switch (l.step) {
580
+ }, [i, De, b]), Je = P((C) => {
581
+ I({ type: "SET_STEP", step: C });
582
+ }, []), qe = P(() => {
583
+ const C = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], w = C.indexOf(i.step);
584
+ w > 0 && I({ type: "SET_STEP", step: C[w - 1] });
585
+ }, [i.step, b]), je = Z(() => {
586
+ const C = b ? !!i.cryptoAmount : !!i.fiatAmount;
587
+ switch (i.step) {
575
588
  case "confirm":
576
- return !!(C && l.cryptoCurrency && l.network && l.walletAddress && !k);
589
+ return !!(C && i.cryptoCurrency && i.network && i.walletAddress && !ee);
577
590
  case "amount":
578
- return !!(C && l.cryptoCurrency && l.network && !k);
591
+ return !!(C && i.cryptoCurrency && i.network && !ee);
579
592
  case "quotes":
580
- return !!l.selectedQuote;
593
+ return !!i.selectedQuote;
581
594
  case "wallet":
582
- return !!l.walletAddress;
595
+ return !!i.walletAddress;
583
596
  default:
584
597
  return !1;
585
598
  }
586
- }, [l, k, w]), qe = {
587
- apiConfig: V,
599
+ }, [i, ee, b]), ce = {
600
+ apiConfig: j,
588
601
  assetBaseUrl: n,
589
602
  config: S,
590
- configLoading: he,
591
- configError: pe,
592
- state: l,
593
- dispatch: M,
594
- quotes: j,
595
- quotesLoading: re,
596
- quotesError: Ne,
597
- fetchQuotes: Ee,
598
- order: de,
599
- orderLoading: xe,
600
- orderError: O,
601
- createOrder: ze,
602
- orderStatus: ee,
603
- orderStatusLoading: Ve,
603
+ configLoading: ge,
604
+ configError: Ce,
605
+ state: i,
606
+ dispatch: I,
607
+ quotes: X,
608
+ quotesLoading: fe,
609
+ quotesError: he,
610
+ fetchQuotes: Le,
611
+ order: H,
612
+ orderLoading: Ue,
613
+ orderError: Ee,
614
+ createOrder: Me,
615
+ orderStatus: ne,
616
+ orderStatusLoading: _e,
604
617
  fieldLocks: A || null,
605
- defaultGateway: Fe,
606
- amountError: k,
607
- goToStep: ge,
608
- goBack: Ie,
609
- canProceed: Je
618
+ defaultGateway: ve,
619
+ amountError: ee,
620
+ goToStep: Je,
621
+ goBack: qe,
622
+ canProceed: je
610
623
  };
611
- return /* @__PURE__ */ e(jt.Provider, { value: qe, children: ne });
624
+ return /* @__PURE__ */ e(jt.Provider, { value: ce, children: ae });
612
625
  }
613
- function Ue() {
626
+ function Te() {
614
627
  const t = ma(jt);
615
628
  if (!t)
616
629
  throw new Error("useRamp must be used within a RampProvider");
617
630
  return t;
618
631
  }
619
- const Oe = {
632
+ const Be = {
620
633
  // Canonical IDs (returned by the API — lowercase full names)
621
634
  // These cover cases where the canonical ID differs from the legacy uppercase key
622
635
  ethereum: { name: "Ethereum (ERC20)", shortName: "Ethereum", icon: "eth" },
@@ -971,9 +984,9 @@ const Oe = {
971
984
  { code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
972
985
  { code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
973
986
  { code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
974
- ], va = Object.fromEntries(
987
+ ], Sa = Object.fromEntries(
975
988
  Gt.map((t) => [t.code, t.name])
976
- ), Sa = {
989
+ ), va = {
977
990
  AED: "ae",
978
991
  ALL: "al",
979
992
  ARS: "ar",
@@ -1012,14 +1025,14 @@ function $t(t, a = "") {
1012
1025
  return `${a}/crypto-icons/${t.toLowerCase()}.svg`;
1013
1026
  }
1014
1027
  function ba(t, a = "") {
1015
- const n = Sa[t] || "us";
1028
+ const n = va[t] || "us";
1016
1029
  return `${a}/flags/${n}.svg`;
1017
1030
  }
1018
- function Ze(t) {
1019
- return Oe[t] || Oe[t.toLowerCase()] || Oe[t.toUpperCase()] || Oe[t.toUpperCase().replace(/-/g, "_")] || Oe[t.toLowerCase().replace(/-/g, "_")];
1031
+ function Qe(t) {
1032
+ return Be[t] || Be[t.toLowerCase()] || Be[t.toUpperCase()] || Be[t.toUpperCase().replace(/-/g, "_")] || Be[t.toLowerCase().replace(/-/g, "_")];
1020
1033
  }
1021
1034
  function it(t, a = "") {
1022
- const n = Ze(t);
1035
+ const n = Qe(t);
1023
1036
  return n ? `${a}/crypto-icons/${n.icon}.svg` : `${a}/crypto-icons/${t.toLowerCase()}.svg`;
1024
1037
  }
1025
1038
  const Ft = [
@@ -1096,7 +1109,7 @@ function lt(t) {
1096
1109
  const a = t.toPrecision(4);
1097
1110
  return parseFloat(a).toString();
1098
1111
  }
1099
- const ce = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), Bt = 10, Ot = 1e-4, wa = (() => {
1112
+ const ue = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), Bt = 10, Ot = 1e-4, wa = (() => {
1100
1113
  const t = [];
1101
1114
  for (const a of Gt)
1102
1115
  for (const n of a.chains)
@@ -1108,16 +1121,16 @@ function Wt({
1108
1121
  alt: a,
1109
1122
  size: n,
1110
1123
  className: r = "",
1111
- background: i
1124
+ background: l
1112
1125
  }) {
1113
- const [c, m] = v(!1), [s, u] = v(!1), f = I(t);
1126
+ const [c, m] = v(!1), [s, u] = v(!1), f = O(t);
1114
1127
  f.current !== t && (f.current = t, m(!1), u(!1));
1115
- const h = B(() => m(!0), []), d = B(() => u(!0), []);
1128
+ const h = P(() => m(!0), []), d = P(() => u(!0), []);
1116
1129
  return /* @__PURE__ */ o(
1117
1130
  "div",
1118
1131
  {
1119
1132
  className: `relative rounded-full shrink-0 ${r}`,
1120
- style: { width: n, height: n, background: i },
1133
+ style: { width: n, height: n, background: l },
1121
1134
  children: [
1122
1135
  !c && !s && /* @__PURE__ */ e(
1123
1136
  "div",
@@ -1281,7 +1294,7 @@ function Da({ size: t = 32 }) {
1281
1294
  );
1282
1295
  }
1283
1296
  function Fa({ size: t = 32 }) {
1284
- const a = t * 0.56, n = a * 0.65, r = Math.max(2, a * 0.1), i = a * 0.2;
1297
+ const a = t * 0.56, n = a * 0.65, r = Math.max(2, a * 0.1), l = a * 0.2;
1285
1298
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center shrink-0", style: { width: t, height: t }, children: [
1286
1299
  /* @__PURE__ */ e(
1287
1300
  "div",
@@ -1314,7 +1327,7 @@ function Fa({ size: t = 32 }) {
1314
1327
  height: n,
1315
1328
  background: "#252525",
1316
1329
  borderRadius: r,
1317
- marginLeft: -i,
1330
+ marginLeft: -l,
1318
1331
  position: "relative",
1319
1332
  zIndex: 1,
1320
1333
  display: "flex",
@@ -1341,7 +1354,7 @@ function pn({ size: t = 18 }) {
1341
1354
  }
1342
1355
  );
1343
1356
  }
1344
- function Pe() {
1357
+ function He() {
1345
1358
  return /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "var(--t-text-secondary)", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
1346
1359
  }
1347
1360
  function Pt() {
@@ -1425,11 +1438,11 @@ function Pa({
1425
1438
  onOpenModal: n,
1426
1439
  fiatCurrency: r
1427
1440
  }) {
1428
- const i = Y(
1441
+ const l = Z(
1429
1442
  () => t.filter((m) => m.supportedFiats.includes(r)),
1430
1443
  [t, r]
1431
- ), c = i.find((m) => m.id === a) || i[0];
1432
- return i.length === 0 ? /* @__PURE__ */ e(
1444
+ ), c = l.find((m) => m.id === a) || l[0];
1445
+ return l.length === 0 ? /* @__PURE__ */ e(
1433
1446
  "div",
1434
1447
  {
1435
1448
  className: "flex items-center justify-between px-[18px] pt-[12px] pb-[14px]",
@@ -1465,7 +1478,7 @@ function Pa({
1465
1478
  /* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
1466
1479
  /* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: c && Zt(c.id, c.icon, 20) }),
1467
1480
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: c ? Yt(c.id, c.name) : "Select" }),
1468
- /* @__PURE__ */ e(Pe, {})
1481
+ /* @__PURE__ */ e(He, {})
1469
1482
  ] })
1470
1483
  ]
1471
1484
  }
@@ -1477,8 +1490,8 @@ function Ka({
1477
1490
  redirectDelay: n = 3e3
1478
1491
  }) {
1479
1492
  var p;
1480
- const { order: r, orderStatus: i, goToStep: c, goBack: m } = Ue(), [s, u] = v(!1), [f, h] = v(null), d = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1481
- if (W(() => {
1493
+ const { order: r, orderStatus: l, goToStep: c, goBack: m } = Te(), [s, u] = v(!1), [f, h] = v(null), d = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1494
+ if (Y(() => {
1482
1495
  if ((r == null ? void 0 : r.checkout.method) === "redirect" && a && !d) {
1483
1496
  h(Math.ceil(n / 1e3));
1484
1497
  const g = setTimeout(() => {
@@ -1490,9 +1503,9 @@ function Ka({
1490
1503
  clearTimeout(g), clearInterval(A);
1491
1504
  };
1492
1505
  }
1493
- }, [r, a, n, d]), W(() => {
1494
- i && (i.status === "completed" ? c("complete") : ["failed", "cancelled", "expired"].includes(i.status) && c("error"));
1495
- }, [i == null ? void 0 : i.status, c]), !r)
1506
+ }, [r, a, n, d]), Y(() => {
1507
+ l && (l.status === "completed" ? c("complete") : ["failed", "cancelled", "expired"].includes(l.status) && c("error"));
1508
+ }, [l == null ? void 0 : l.status, c]), !r)
1496
1509
  return /* @__PURE__ */ o(
1497
1510
  "div",
1498
1511
  {
@@ -1814,16 +1827,16 @@ function Ka({
1814
1827
  }
1815
1828
  function _a(t, a) {
1816
1829
  const n = new URL("/en/partner/widget", t);
1817
- for (const [r, i] of Object.entries(a))
1818
- i != null && i !== "" && n.searchParams.set(r, String(i));
1830
+ for (const [r, l] of Object.entries(a))
1831
+ l != null && l !== "" && n.searchParams.set(r, String(l));
1819
1832
  return n.toString();
1820
1833
  }
1821
1834
  function Va({ className: t = "" }) {
1822
- const { orderStatus: a, orderStatusLoading: n, goToStep: r } = Ue();
1823
- W(() => {
1835
+ const { orderStatus: a, orderStatusLoading: n, goToStep: r } = Te();
1836
+ Y(() => {
1824
1837
  a && (a.status === "completed" ? r("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && r("error"));
1825
1838
  }, [a == null ? void 0 : a.status, r]);
1826
- const i = () => {
1839
+ const l = () => {
1827
1840
  if (!a) return "Processing your order...";
1828
1841
  switch (a.status) {
1829
1842
  case "pending":
@@ -1836,28 +1849,28 @@ function Va({ className: t = "" }) {
1836
1849
  };
1837
1850
  return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
1838
1851
  /* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ e("div", { className: "nramp-spinner-large nramp-spinner" }) }),
1839
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: i() }),
1852
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: l() }),
1840
1853
  n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
1841
1854
  a && /* @__PURE__ */ o("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1842
- /* @__PURE__ */ e(Le, { label: "Order ID", value: a.orderId, mono: !0 }),
1843
- /* @__PURE__ */ e(Le, { label: "Provider", value: a.gateway }),
1855
+ /* @__PURE__ */ e(Re, { label: "Order ID", value: a.orderId, mono: !0 }),
1856
+ /* @__PURE__ */ e(Re, { label: "Provider", value: a.gateway }),
1844
1857
  /* @__PURE__ */ e(
1845
- Le,
1858
+ Re,
1846
1859
  {
1847
1860
  label: "Amount",
1848
1861
  value: `${a.fiatAmount} ${a.fiatCurrency}`
1849
1862
  }
1850
1863
  ),
1851
1864
  /* @__PURE__ */ e(
1852
- Le,
1865
+ Re,
1853
1866
  {
1854
1867
  label: "Receiving",
1855
1868
  value: `${a.cryptoAmount || "..."} ${a.cryptoCurrency}`
1856
1869
  }
1857
1870
  ),
1858
- /* @__PURE__ */ e(Le, { label: "Network", value: a.network }),
1871
+ /* @__PURE__ */ e(Re, { label: "Network", value: a.network }),
1859
1872
  /* @__PURE__ */ e(
1860
- Le,
1873
+ Re,
1861
1874
  {
1862
1875
  label: "To Address",
1863
1876
  value: `${a.walletAddress.slice(0, 10)}...${a.walletAddress.slice(-8)}`,
@@ -1871,7 +1884,7 @@ function Va({ className: t = "" }) {
1871
1884
  ] })
1872
1885
  ] });
1873
1886
  }
1874
- function Le({ label: t, value: a, mono: n }) {
1887
+ function Re({ label: t, value: a, mono: n }) {
1875
1888
  return /* @__PURE__ */ o(
1876
1889
  "div",
1877
1890
  {
@@ -1897,8 +1910,8 @@ function ja({
1897
1910
  onDone: n,
1898
1911
  doneButtonText: r = "Done"
1899
1912
  }) {
1900
- const { orderStatus: i, state: c, dispatch: m } = Ue(), s = c.flowType === "sell", u = () => {
1901
- if (!(i != null && i.transactionHash)) return null;
1913
+ const { orderStatus: l, state: c, dispatch: m } = Te(), s = c.flowType === "sell", u = () => {
1914
+ if (!(l != null && l.transactionHash)) return null;
1902
1915
  if (!a) {
1903
1916
  const d = {
1904
1917
  ethereum: "https://etherscan.io/tx/{txHash}",
@@ -1911,9 +1924,9 @@ function ja({
1911
1924
  avalanche: "https://snowtrace.io/tx/{txHash}",
1912
1925
  fantom: "https://ftmscan.com/tx/{txHash}"
1913
1926
  };
1914
- return (d[c.network] || d.ethereum).replace("{txHash}", i.transactionHash);
1927
+ return (d[c.network] || d.ethereum).replace("{txHash}", l.transactionHash);
1915
1928
  }
1916
- return a.replace("{txHash}", i.transactionHash);
1929
+ return a.replace("{txHash}", l.transactionHash);
1917
1930
  }, f = () => {
1918
1931
  n ? n() : m({ type: "RESET" });
1919
1932
  }, h = u();
@@ -1927,47 +1940,47 @@ function ja({
1927
1940
  }
1928
1941
  ),
1929
1942
  /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: s ? "Sale Complete!" : "Purchase Complete!" }),
1930
- /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: s ? `Your ${(i == null ? void 0 : i.fiatCurrency) || c.fiatCurrency} payout is being processed.` : `Your ${(i == null ? void 0 : i.cryptoCurrency) || c.cryptoCurrency} has been sent to your wallet.` }),
1931
- i && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1943
+ /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: s ? `Your ${(l == null ? void 0 : l.fiatCurrency) || c.fiatCurrency} payout is being processed.` : `Your ${(l == null ? void 0 : l.cryptoCurrency) || c.cryptoCurrency} has been sent to your wallet.` }),
1944
+ l && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1932
1945
  /* @__PURE__ */ e(
1933
- me,
1946
+ ye,
1934
1947
  {
1935
1948
  label: s ? "Amount Sold" : "Amount Received",
1936
- value: `${i.cryptoAmount} ${i.cryptoCurrency}`,
1949
+ value: `${l.cryptoAmount} ${l.cryptoCurrency}`,
1937
1950
  highlight: !0
1938
1951
  }
1939
1952
  ),
1940
1953
  /* @__PURE__ */ e(
1941
- me,
1954
+ ye,
1942
1955
  {
1943
1956
  label: s ? "Payout Amount" : "Amount Paid",
1944
- value: `${i.fiatAmount} ${i.fiatCurrency}`
1957
+ value: `${l.fiatAmount} ${l.fiatCurrency}`
1945
1958
  }
1946
1959
  ),
1947
- /* @__PURE__ */ e(me, { label: "Network", value: i.network }),
1960
+ /* @__PURE__ */ e(ye, { label: "Network", value: l.network }),
1948
1961
  /* @__PURE__ */ e(
1949
- me,
1962
+ ye,
1950
1963
  {
1951
1964
  label: "Wallet",
1952
- value: `${i.walletAddress.slice(0, 10)}...${i.walletAddress.slice(-8)}`,
1965
+ value: `${l.walletAddress.slice(0, 10)}...${l.walletAddress.slice(-8)}`,
1953
1966
  mono: !0
1954
1967
  }
1955
1968
  ),
1956
- i.transactionHash && /* @__PURE__ */ e(
1957
- me,
1969
+ l.transactionHash && /* @__PURE__ */ e(
1970
+ ye,
1958
1971
  {
1959
1972
  label: "Transaction",
1960
- value: `${i.transactionHash.slice(0, 10)}...${i.transactionHash.slice(-8)}`,
1973
+ value: `${l.transactionHash.slice(0, 10)}...${l.transactionHash.slice(-8)}`,
1961
1974
  mono: !0
1962
1975
  }
1963
1976
  ),
1964
- /* @__PURE__ */ e(me, { label: "Provider", value: i.gateway }),
1965
- /* @__PURE__ */ e(me, { label: "Order ID", value: i.orderId, mono: !0 }),
1966
- i.completedAt && /* @__PURE__ */ e(
1967
- me,
1977
+ /* @__PURE__ */ e(ye, { label: "Provider", value: l.gateway }),
1978
+ /* @__PURE__ */ e(ye, { label: "Order ID", value: l.orderId, mono: !0 }),
1979
+ l.completedAt && /* @__PURE__ */ e(
1980
+ ye,
1968
1981
  {
1969
1982
  label: "Completed",
1970
- value: new Date(i.completedAt).toLocaleString()
1983
+ value: new Date(l.completedAt).toLocaleString()
1971
1984
  }
1972
1985
  )
1973
1986
  ] }),
@@ -1995,7 +2008,7 @@ function ja({
1995
2008
  ] })
1996
2009
  ] });
1997
2010
  }
1998
- function me({ label: t, value: a, mono: n, highlight: r }) {
2011
+ function ye({ label: t, value: a, mono: n, highlight: r }) {
1999
2012
  return /* @__PURE__ */ o(
2000
2013
  "div",
2001
2014
  {
@@ -2020,9 +2033,9 @@ function Ga({
2020
2033
  onRetry: a,
2021
2034
  supportEmail: n = "support@nowramp.com"
2022
2035
  }) {
2023
- const { state: r, orderStatus: i, dispatch: c, goToStep: m } = Ue(), s = r.flowType === "sell", u = () => {
2024
- if (i)
2025
- switch (i.status) {
2036
+ const { state: r, orderStatus: l, dispatch: c, goToStep: m } = Te(), s = r.flowType === "sell", u = () => {
2037
+ if (l)
2038
+ switch (l.status) {
2026
2039
  case "failed":
2027
2040
  return "Payment Failed";
2028
2041
  case "cancelled":
@@ -2037,8 +2050,8 @@ function Ga({
2037
2050
  return "Something Went Wrong";
2038
2051
  }, f = () => {
2039
2052
  if (r.errorMessage) return r.errorMessage;
2040
- if (i)
2041
- switch (i.status) {
2053
+ if (l)
2054
+ switch (l.status) {
2042
2055
  case "failed":
2043
2056
  return s ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
2044
2057
  case "cancelled":
@@ -2067,9 +2080,9 @@ function Ga({
2067
2080
  ),
2068
2081
  /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: u() }),
2069
2082
  /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: f() }),
2070
- i && /* @__PURE__ */ e("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", children: [
2083
+ l && /* @__PURE__ */ e("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", children: [
2071
2084
  /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
2072
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: i.orderId })
2085
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: l.orderId })
2073
2086
  ] }) }),
2074
2087
  /* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
2075
2088
  /* @__PURE__ */ e(
@@ -2105,9 +2118,9 @@ function Ga({
2105
2118
  }
2106
2119
  )
2107
2120
  ] }),
2108
- i && /* @__PURE__ */ o("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
2121
+ l && /* @__PURE__ */ o("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
2109
2122
  "Reference: ",
2110
- i.orderId
2123
+ l.orderId
2111
2124
  ] })
2112
2125
  ] })
2113
2126
  ] });
@@ -2119,23 +2132,23 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
2119
2132
  var q;
2120
2133
  const {
2121
2134
  config: r,
2122
- configLoading: i,
2135
+ configLoading: l,
2123
2136
  state: c,
2124
2137
  defaultGateway: m,
2125
2138
  quotes: s,
2126
2139
  fetchQuotes: u,
2127
2140
  createOrder: f,
2128
2141
  orderLoading: h
2129
- } = Ue(), d = c.flowType === "sell", [p, g] = v(null), A = r == null ? void 0 : r.gateways.find((G) => G.id === m), E = (q = s == null ? void 0 : s.bestQuote) != null && q.exchangeRate ? parseFloat(s.bestQuote.exchangeRate) : null, R = parseFloat(c.fiatAmount) || 0, P = !!(a && n && !d && Xt(c.cryptoCurrency) && E), ne = P && c.cryptoCurrency.toUpperCase().includes(c.fiatCurrency.toUpperCase()), V = P && R > 0 ? lt(ne ? R : R / E) : null, Z = async () => {
2142
+ } = Te(), d = c.flowType === "sell", [p, g] = v(null), A = r == null ? void 0 : r.gateways.find(($) => $.id === m), E = (q = s == null ? void 0 : s.bestQuote) != null && q.exchangeRate ? parseFloat(s.bestQuote.exchangeRate) : null, R = parseFloat(c.fiatAmount) || 0, _ = !!(a && n && !d && Xt(c.cryptoCurrency) && E), ae = _ && c.cryptoCurrency.toUpperCase().includes(c.fiatCurrency.toUpperCase()), j = _ && R > 0 ? lt(ae ? R : R / E) : null, Q = async () => {
2130
2143
  g(null);
2131
2144
  try {
2132
2145
  u(), await f();
2133
- } catch (G) {
2134
- const fe = G instanceof Error ? G.message : "Failed to create order";
2135
- g(fe);
2146
+ } catch ($) {
2147
+ const xe = $ instanceof Error ? $.message : "Failed to create order";
2148
+ g(xe);
2136
2149
  }
2137
2150
  };
2138
- return i ? /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
2151
+ return l ? /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
2139
2152
  /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
2140
2153
  /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
2141
2154
  ] }) : /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
@@ -2149,21 +2162,21 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
2149
2162
  ] })
2150
2163
  ] }),
2151
2164
  d ? /* @__PURE__ */ o(J, { children: [
2152
- /* @__PURE__ */ e(Se, { label: "You sell", value: `${c.cryptoAmount} ${c.cryptoCurrency}`, highlight: !0 }),
2153
- /* @__PURE__ */ e(Se, { label: "You receive", value: `${c.fiatCurrency} payout` })
2165
+ /* @__PURE__ */ e(Ne, { label: "You sell", value: `${c.cryptoAmount} ${c.cryptoCurrency}`, highlight: !0 }),
2166
+ /* @__PURE__ */ e(Ne, { label: "You receive", value: `${c.fiatCurrency} payout` })
2154
2167
  ] }) : /* @__PURE__ */ o(J, { children: [
2155
- /* @__PURE__ */ e(Se, { label: "You pay", value: `${c.fiatAmount} ${c.fiatCurrency}`, highlight: !0 }),
2168
+ /* @__PURE__ */ e(Ne, { label: "You pay", value: `${c.fiatAmount} ${c.fiatCurrency}`, highlight: !0 }),
2156
2169
  /* @__PURE__ */ e(
2157
- Se,
2170
+ Ne,
2158
2171
  {
2159
2172
  label: "You receive",
2160
- value: V ? `${V} ${c.cryptoCurrency}` : `${c.cryptoCurrency} on ${c.network}`
2173
+ value: j ? `${j} ${c.cryptoCurrency}` : `${c.cryptoCurrency} on ${c.network}`
2161
2174
  }
2162
2175
  ),
2163
- /* @__PURE__ */ e(Se, { label: "Wallet", value: Kt(c.walletAddress), mono: !0 }),
2164
- P && V && /* @__PURE__ */ o("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: [
2176
+ /* @__PURE__ */ e(Ne, { label: "Wallet", value: Kt(c.walletAddress), mono: !0 }),
2177
+ _ && j && /* @__PURE__ */ o("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: [
2165
2178
  "Charged amount from provider may differ. The rest up to ",
2166
- V,
2179
+ j,
2167
2180
  " ",
2168
2181
  c.cryptoCurrency,
2169
2182
  " will be credited to your ",
@@ -2171,8 +2184,8 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
2171
2184
  " account."
2172
2185
  ] })
2173
2186
  ] }),
2174
- /* @__PURE__ */ e(Se, { label: "Network", value: c.network }),
2175
- d && c.walletAddress && /* @__PURE__ */ e(Se, { label: "Refund address", value: Kt(c.walletAddress), mono: !0 })
2187
+ /* @__PURE__ */ e(Ne, { label: "Network", value: c.network }),
2188
+ d && c.walletAddress && /* @__PURE__ */ e(Ne, { label: "Refund address", value: Kt(c.walletAddress), mono: !0 })
2176
2189
  ] }),
2177
2190
  p && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: p }),
2178
2191
  /* @__PURE__ */ e(
@@ -2181,7 +2194,7 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
2181
2194
  className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
2182
2195
  style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: h ? 0.7 : 1 },
2183
2196
  disabled: h,
2184
- onClick: Z,
2197
+ onClick: Q,
2185
2198
  children: h ? /* @__PURE__ */ o(J, { children: [
2186
2199
  /* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
2187
2200
  "Processing..."
@@ -2190,7 +2203,7 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
2190
2203
  )
2191
2204
  ] });
2192
2205
  }
2193
- function Se({ label: t, value: a, mono: n, highlight: r }) {
2206
+ function Ne({ label: t, value: a, mono: n, highlight: r }) {
2194
2207
  return /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
2195
2208
  /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
2196
2209
  /* @__PURE__ */ e(
@@ -2203,25 +2216,25 @@ function Se({ label: t, value: a, mono: n, highlight: r }) {
2203
2216
  )
2204
2217
  ] });
2205
2218
  }
2206
- function He({
2219
+ function Oe({
2207
2220
  isOpen: t,
2208
2221
  onClose: a,
2209
2222
  children: n
2210
2223
  }) {
2211
- const [r, i] = v(!1), [c, m] = v(!1);
2212
- W(() => {
2224
+ const [r, l] = v(!1), [c, m] = v(!1);
2225
+ Y(() => {
2213
2226
  if (t)
2214
- i(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
2227
+ l(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
2215
2228
  else if (r) {
2216
2229
  m(!1);
2217
- const u = setTimeout(() => i(!1), 250);
2230
+ const u = setTimeout(() => l(!1), 250);
2218
2231
  return () => clearTimeout(u);
2219
2232
  }
2220
2233
  }, [t]);
2221
- const s = B(() => {
2234
+ const s = P(() => {
2222
2235
  m(!1), setTimeout(() => a(), 250);
2223
2236
  }, [a]);
2224
- return W(() => {
2237
+ return Y(() => {
2225
2238
  if (!t) return;
2226
2239
  const u = (f) => {
2227
2240
  f.key === "Escape" && s();
@@ -2245,7 +2258,7 @@ function He({
2245
2258
  }
2246
2259
  function Xa({ char: t, height: a = 38 }) {
2247
2260
  const n = "0123456789", r = n.indexOf(t);
2248
- return r === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: a, lineHeight: `${a}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${r * a}px)` }, children: n.split("").map((i) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: i }, i)) }) });
2261
+ return r === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: a, lineHeight: `${a}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${r * a}px)` }, children: n.split("").map((l) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: l }, l)) }) });
2249
2262
  }
2250
2263
  function Wa({
2251
2264
  value: t,
@@ -2253,9 +2266,9 @@ function Wa({
2253
2266
  className: n = "",
2254
2267
  style: r = {}
2255
2268
  }) {
2256
- return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...r }, children: t.split("").map((i, c) => /* @__PURE__ */ e(Xa, { char: i, height: a }, c)) });
2269
+ return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...r }, children: t.split("").map((l, c) => /* @__PURE__ */ e(Xa, { char: l, height: a }, c)) });
2257
2270
  }
2258
- function _({
2271
+ function V({
2259
2272
  w: t,
2260
2273
  h: a,
2261
2274
  className: n = ""
@@ -2265,33 +2278,33 @@ function _({
2265
2278
  function Ya() {
2266
2279
  return /* @__PURE__ */ o("div", { className: "flex-1 px-5 flex flex-col", children: [
2267
2280
  /* @__PURE__ */ o("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
2268
- /* @__PURE__ */ e(_, { w: 70, h: 14, className: "mb-3" }),
2281
+ /* @__PURE__ */ e(V, { w: 70, h: 14, className: "mb-3" }),
2269
2282
  /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
2270
- /* @__PURE__ */ e(_, { w: 120, h: 32 }),
2271
- /* @__PURE__ */ e(_, { w: 75, h: 32 })
2283
+ /* @__PURE__ */ e(V, { w: 120, h: 32 }),
2284
+ /* @__PURE__ */ e(V, { w: 75, h: 32 })
2272
2285
  ] })
2273
2286
  ] }),
2274
2287
  /* @__PURE__ */ o("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
2275
- /* @__PURE__ */ e(_, { w: 50, h: 14, className: "mb-3" }),
2288
+ /* @__PURE__ */ e(V, { w: 50, h: 14, className: "mb-3" }),
2276
2289
  /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
2277
- /* @__PURE__ */ e(_, { w: 180, h: 32 }),
2278
- /* @__PURE__ */ e(_, { w: 85, h: 32 })
2290
+ /* @__PURE__ */ e(V, { w: 180, h: 32 }),
2291
+ /* @__PURE__ */ e(V, { w: 85, h: 32 })
2279
2292
  ] })
2280
2293
  ] }),
2281
2294
  /* @__PURE__ */ o("div", { className: "flex justify-between mt-3 px-[2px]", children: [
2282
- /* @__PURE__ */ e(_, { w: 140, h: 12 }),
2283
- /* @__PURE__ */ e(_, { w: 90, h: 12 })
2295
+ /* @__PURE__ */ e(V, { w: 140, h: 12 }),
2296
+ /* @__PURE__ */ e(V, { w: 90, h: 12 })
2284
2297
  ] }),
2285
2298
  /* @__PURE__ */ o("div", { className: "mt-8", children: [
2286
- /* @__PURE__ */ e(_, { w: 65, h: 14, className: "mb-2.5" }),
2287
- /* @__PURE__ */ e(_, { w: "100%", h: 47 })
2299
+ /* @__PURE__ */ e(V, { w: 65, h: 14, className: "mb-2.5" }),
2300
+ /* @__PURE__ */ e(V, { w: "100%", h: 47 })
2288
2301
  ] }),
2289
2302
  /* @__PURE__ */ e("div", { className: "flex-1" }),
2290
- /* @__PURE__ */ e(_, { w: "100%", h: 60, className: "mb-2" }),
2303
+ /* @__PURE__ */ e(V, { w: "100%", h: 60, className: "mb-2" }),
2291
2304
  /* @__PURE__ */ e("div", { className: "text-center py-3", children: /* @__PURE__ */ e("span", { className: "text-[11px]", style: { color: "var(--t-text-tertiary)" }, children: "Powered by NowRamp" }) })
2292
2305
  ] });
2293
2306
  }
2294
- function De({ onClick: t }) {
2307
+ function ke({ onClick: t }) {
2295
2308
  return /* @__PURE__ */ e(
2296
2309
  "button",
2297
2310
  {
@@ -2304,12 +2317,12 @@ function De({ onClick: t }) {
2304
2317
  }
2305
2318
  );
2306
2319
  }
2307
- function Ke({
2320
+ function Pe({
2308
2321
  value: t,
2309
2322
  onChange: a,
2310
2323
  placeholder: n = ""
2311
2324
  }) {
2312
- const [r, i] = v(!1);
2325
+ const [r, l] = v(!1);
2313
2326
  return /* @__PURE__ */ o("div", { className: "relative mx-5 mb-5", children: [
2314
2327
  /* @__PURE__ */ e(
2315
2328
  "input",
@@ -2317,8 +2330,8 @@ function Ke({
2317
2330
  type: "text",
2318
2331
  value: t,
2319
2332
  onChange: (c) => a(c.target.value),
2320
- onFocus: () => i(!0),
2321
- onBlur: () => i(!1),
2333
+ onFocus: () => l(!0),
2334
+ onBlur: () => l(!1),
2322
2335
  placeholder: n,
2323
2336
  style: { height: 47, borderRadius: 4.5, border: `1px solid ${r ? "var(--t-border-focus)" : "var(--t-border)"}`, outline: "none", boxShadow: "none", color: "var(--t-text)", padding: `0 ${t ? 40 : 14}px 0 14px`, fontSize: 14, backgroundColor: "transparent" },
2324
2337
  className: "w-full outline-none transition-colors"
@@ -2340,22 +2353,22 @@ function Za({
2340
2353
  onSelect: a,
2341
2354
  currencies: n,
2342
2355
  assetBaseUrl: r = "",
2343
- selectedCode: i
2356
+ selectedCode: l
2344
2357
  }) {
2345
- const [c, m] = v(""), s = Y(() => {
2358
+ const [c, m] = v(""), s = Z(() => {
2346
2359
  if (!n || n.length === 0) return Ft;
2347
2360
  const f = new Map(Ft.map((h) => [h.code, h.name]));
2348
2361
  return n.map((h) => ({
2349
2362
  code: h.code,
2350
2363
  name: h.name || f.get(h.code) || h.code
2351
2364
  }));
2352
- }, [n]), u = Y(() => {
2365
+ }, [n]), u = Z(() => {
2353
2366
  const f = c.trim().toLowerCase();
2354
2367
  if (!f) {
2355
- if (i) {
2356
- const h = s.find((d) => d.code === i);
2368
+ if (l) {
2369
+ const h = s.find((d) => d.code === l);
2357
2370
  if (h) {
2358
- const d = s.filter((p) => p.code !== i);
2371
+ const d = s.filter((p) => p.code !== l);
2359
2372
  return [h, ...d];
2360
2373
  }
2361
2374
  }
@@ -2364,9 +2377,9 @@ function Za({
2364
2377
  return s.filter(
2365
2378
  (h) => h.code.toLowerCase().includes(f) || h.name.toLowerCase().includes(f)
2366
2379
  );
2367
- }, [s, c, i]);
2380
+ }, [s, c, l]);
2368
2381
  return /* @__PURE__ */ o(J, { children: [
2369
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2382
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: t }) }),
2370
2383
  /* @__PURE__ */ e(
2371
2384
  "h2",
2372
2385
  {
@@ -2381,10 +2394,10 @@ function Za({
2381
2394
  children: "Select fiat currency"
2382
2395
  }
2383
2396
  ),
2384
- /* @__PURE__ */ e(Ke, { value: c, onChange: m }),
2397
+ /* @__PURE__ */ e(Pe, { value: c, onChange: m }),
2385
2398
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2386
2399
  u.map((f, h) => {
2387
- const d = f.name !== f.code ? f.name : "", p = i === f.code;
2400
+ const d = f.name !== f.code ? f.name : "", p = l === f.code;
2388
2401
  return /* @__PURE__ */ o("div", { children: [
2389
2402
  /* @__PURE__ */ o(
2390
2403
  "button",
@@ -2423,11 +2436,11 @@ function Za({
2423
2436
  ] })
2424
2437
  ] });
2425
2438
  }
2426
- function _t({ src: t, alt: a, size: n, className: r, style: i }) {
2427
- const [c, m] = v(!1), [s, u] = v(!1), f = I(t);
2439
+ function _t({ src: t, alt: a, size: n, className: r, style: l }) {
2440
+ const [c, m] = v(!1), [s, u] = v(!1), f = O(t);
2428
2441
  f.current !== t && (f.current = t, m(!1), u(!1));
2429
- const h = B(() => m(!0), []), d = B(() => u(!0), []);
2430
- return /* @__PURE__ */ o("div", { className: r, style: { ...i, width: n, height: n, position: "relative" }, children: [
2442
+ const h = P(() => m(!0), []), d = P(() => u(!0), []);
2443
+ return /* @__PURE__ */ o("div", { className: r, style: { ...l, width: n, height: n, position: "relative" }, children: [
2431
2444
  !c && !s && /* @__PURE__ */ e(
2432
2445
  "div",
2433
2446
  {
@@ -2457,12 +2470,12 @@ function _t({ src: t, alt: a, size: n, className: r, style: i }) {
2457
2470
  )
2458
2471
  ] });
2459
2472
  }
2460
- function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: i, selectedChain: c }) {
2461
- const [m, s] = v(""), u = Y(() => {
2473
+ function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: l, selectedChain: c }) {
2474
+ const [m, s] = v(""), u = Z(() => {
2462
2475
  if (!n || n.length === 0) return wa;
2463
2476
  const d = [];
2464
2477
  for (const p of n) {
2465
- const g = p.networks || [], A = p.name || va[p.code] || p.code;
2478
+ const g = p.networks || [], A = p.name || Sa[p.code] || p.code;
2466
2479
  if (g.length === 0)
2467
2480
  d.push({ code: p.code, name: A, chain: p.code, popular: !1 });
2468
2481
  else
@@ -2478,14 +2491,14 @@ function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2478
2491
  }
2479
2492
  }
2480
2493
  return d;
2481
- }, [n]), f = B((d, p) => i === d && c === p, [i, c]), h = Y(() => {
2494
+ }, [n]), f = P((d, p) => l === d && c === p, [l, c]), h = Z(() => {
2482
2495
  var A;
2483
2496
  const d = m.trim().toLowerCase();
2484
2497
  if (!d) {
2485
- if (i && c) {
2486
- const E = u.find((R) => R.code === i && R.chain === c);
2498
+ if (l && c) {
2499
+ const E = u.find((R) => R.code === l && R.chain === c);
2487
2500
  if (E) {
2488
- const R = u.filter((P) => !(P.code === i && P.chain === c));
2501
+ const R = u.filter((_) => !(_.code === l && _.chain === c));
2489
2502
  return [E, ...R];
2490
2503
  }
2491
2504
  }
@@ -2493,15 +2506,15 @@ function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2493
2506
  }
2494
2507
  const p = d.split(/\s+/), g = [];
2495
2508
  for (const E of u) {
2496
- const R = Ze(E.chain), P = R ? R.name.toLowerCase() : "", ne = ((A = R == null ? void 0 : R.shortName) == null ? void 0 : A.toLowerCase()) || "", V = E.chain.toLowerCase(), Z = E.code.toLowerCase(), q = E.name.toLowerCase(), G = [Z, q, P, ne, V];
2497
- if (!p.every((L) => G.some((l) => l.includes(L)))) continue;
2509
+ const R = Qe(E.chain), _ = R ? R.name.toLowerCase() : "", ae = ((A = R == null ? void 0 : R.shortName) == null ? void 0 : A.toLowerCase()) || "", j = E.chain.toLowerCase(), Q = E.code.toLowerCase(), q = E.name.toLowerCase(), $ = [Q, q, _, ae, j];
2510
+ if (!p.every((k) => $.some((i) => i.includes(k)))) continue;
2498
2511
  let y = 0;
2499
- Z === d ? y += 100 : Z.startsWith(p[0]) && (y += 50), E.popular && (y += 10), p.length > 1 && (P.includes(p[1]) || ne.includes(p[1]) || V.includes(p[1])) && (y += 25), g.push({ item: E, score: y });
2512
+ Q === d ? y += 100 : Q.startsWith(p[0]) && (y += 50), E.popular && (y += 10), p.length > 1 && (_.includes(p[1]) || ae.includes(p[1]) || j.includes(p[1])) && (y += 25), g.push({ item: E, score: y });
2500
2513
  }
2501
2514
  return g.sort((E, R) => R.score - E.score), g.map((E) => E.item);
2502
- }, [u, m, i, c]);
2515
+ }, [u, m, l, c]);
2503
2516
  return /* @__PURE__ */ o(J, { children: [
2504
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2517
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: t }) }),
2505
2518
  /* @__PURE__ */ e(
2506
2519
  "h2",
2507
2520
  {
@@ -2510,10 +2523,10 @@ function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2510
2523
  children: "Select crypto currency"
2511
2524
  }
2512
2525
  ),
2513
- /* @__PURE__ */ e(Ke, { value: m, onChange: s }),
2526
+ /* @__PURE__ */ e(Pe, { value: m, onChange: s }),
2514
2527
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2515
2528
  h.map((d, p) => {
2516
- const g = Ze(d.chain), A = (g == null ? void 0 : g.name) || d.chainName || d.chain, E = d.name !== d.code ? d.name : "", R = f(d.code, d.chain);
2529
+ const g = Qe(d.chain), A = (g == null ? void 0 : g.name) || d.chainName || d.chain, E = d.name !== d.code ? d.name : "", R = f(d.code, d.chain);
2517
2530
  return /* @__PURE__ */ o("div", { children: [
2518
2531
  /* @__PURE__ */ o(
2519
2532
  "button",
@@ -2607,8 +2620,8 @@ function za({
2607
2620
  onSelect: n,
2608
2621
  onClose: r
2609
2622
  }) {
2610
- const [i, c] = v(""), m = Y(() => {
2611
- const s = i.trim().toLowerCase();
2623
+ const [l, c] = v(""), m = Z(() => {
2624
+ const s = l.trim().toLowerCase();
2612
2625
  if (!s) {
2613
2626
  if (a) {
2614
2627
  const u = t.find((f) => f.id === a);
@@ -2622,9 +2635,9 @@ function za({
2622
2635
  return t.filter(
2623
2636
  (u) => u.id.toLowerCase().includes(s) || u.name.toLowerCase().includes(s) || u.description && u.description.toLowerCase().includes(s)
2624
2637
  );
2625
- }, [t, i, a]);
2638
+ }, [t, l, a]);
2626
2639
  return /* @__PURE__ */ o(J, { children: [
2627
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: r }) }),
2640
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: r }) }),
2628
2641
  /* @__PURE__ */ e(
2629
2642
  "h2",
2630
2643
  {
@@ -2633,7 +2646,7 @@ function za({
2633
2646
  children: "Choose payment method"
2634
2647
  }
2635
2648
  ),
2636
- /* @__PURE__ */ e(Ke, { value: i, onChange: c }),
2649
+ /* @__PURE__ */ e(Pe, { value: l, onChange: c }),
2637
2650
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2638
2651
  m.map((s, u) => {
2639
2652
  const f = s.id === a, h = Yt(s.id, s.name);
@@ -2730,7 +2743,7 @@ function en({
2730
2743
  darkMode: a,
2731
2744
  onToggleDarkMode: n,
2732
2745
  skinId: r,
2733
- onSelectSkin: i,
2746
+ onSelectSkin: l,
2734
2747
  showThemeToggle: c = !0,
2735
2748
  country: m,
2736
2749
  countryName: s,
@@ -2739,7 +2752,7 @@ function en({
2739
2752
  }) {
2740
2753
  const [h, d] = v(!1);
2741
2754
  return /* @__PURE__ */ o(J, { children: [
2742
- /* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2755
+ /* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: t }) }),
2743
2756
  /* @__PURE__ */ o("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
2744
2757
  u && /* @__PURE__ */ o(J, { children: [
2745
2758
  /* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ o(
@@ -2844,24 +2857,24 @@ function an({
2844
2857
  assetBaseUrl: n = "",
2845
2858
  selectedCode: r
2846
2859
  }) {
2847
- const [i, c] = v(""), m = Y(() => {
2848
- const s = i.trim().toLowerCase();
2860
+ const [l, c] = v(""), m = Z(() => {
2861
+ const s = l.trim().toLowerCase();
2849
2862
  if (!s) {
2850
2863
  if (r) {
2851
2864
  const u = r.toLowerCase(), f = st[u];
2852
2865
  if (f) {
2853
- const h = Ye.filter((d) => d.code !== u);
2866
+ const h = Ze.filter((d) => d.code !== u);
2854
2867
  return [f, ...h];
2855
2868
  }
2856
2869
  }
2857
- return Ye;
2870
+ return Ze;
2858
2871
  }
2859
- return Ye.filter(
2872
+ return Ze.filter(
2860
2873
  (u) => u.name.toLowerCase().includes(s) || u.code.includes(s) || u.defaultFiat.toLowerCase().includes(s)
2861
2874
  );
2862
- }, [i, r]);
2875
+ }, [l, r]);
2863
2876
  return /* @__PURE__ */ o(J, { children: [
2864
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2877
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: t }) }),
2865
2878
  /* @__PURE__ */ e(
2866
2879
  "h2",
2867
2880
  {
@@ -2876,7 +2889,7 @@ function an({
2876
2889
  children: "Select your country"
2877
2890
  }
2878
2891
  ),
2879
- /* @__PURE__ */ e(Ke, { value: i, onChange: c }),
2892
+ /* @__PURE__ */ e(Pe, { value: l, onChange: c }),
2880
2893
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2881
2894
  m.map((s, u) => {
2882
2895
  const f = (r == null ? void 0 : r.toLowerCase()) === s.code;
@@ -2919,7 +2932,7 @@ function an({
2919
2932
  ] });
2920
2933
  }
2921
2934
  function nn({ code: t, size: a = 32, baseUrl: n = "" }) {
2922
- const [r, i] = v(!1);
2935
+ const [r, l] = v(!1);
2923
2936
  return r ? /* @__PURE__ */ e(
2924
2937
  "div",
2925
2938
  {
@@ -2944,7 +2957,7 @@ function nn({ code: t, size: a = 32, baseUrl: n = "" }) {
2944
2957
  width: a,
2945
2958
  height: a,
2946
2959
  style: { width: a, height: a, borderRadius: "50%", objectFit: "cover" },
2947
- onError: () => i(!0)
2960
+ onError: () => l(!0)
2948
2961
  }
2949
2962
  );
2950
2963
  }
@@ -2953,7 +2966,7 @@ function rn({
2953
2966
  theme: a = "dark",
2954
2967
  skinId: n = "mono",
2955
2968
  accentColor: r,
2956
- bgColor: i,
2969
+ bgColor: l,
2957
2970
  bgImage: c,
2958
2971
  borderColor: m,
2959
2972
  borderRadius: s,
@@ -2966,184 +2979,184 @@ function rn({
2966
2979
  showFlowToggle: A = !0,
2967
2980
  showSettings: E = !0,
2968
2981
  showThemeToggle: R = !0,
2969
- autoRedirect: P = !1,
2970
- explorerUrl: ne,
2971
- doneButtonText: V = "Done",
2972
- supportEmail: Z,
2982
+ autoRedirect: _ = !1,
2983
+ explorerUrl: ae,
2984
+ doneButtonText: j = "Done",
2985
+ supportEmail: Q,
2973
2986
  stablecoinParity: q,
2974
- partnerName: G,
2975
- onDone: fe
2987
+ partnerName: $,
2988
+ onDone: xe
2976
2989
  }) {
2977
2990
  var bt, Nt, Et, wt, At, Rt, Tt, kt, Lt;
2978
2991
  const {
2979
2992
  state: y,
2980
- dispatch: L,
2981
- config: l,
2982
- configLoading: M,
2983
- quotes: w,
2993
+ dispatch: k,
2994
+ config: i,
2995
+ configLoading: I,
2996
+ quotes: b,
2984
2997
  quotesLoading: S,
2985
- quotesError: he,
2986
- fetchQuotes: pe,
2987
- createOrder: ye,
2988
- orderLoading: ie,
2989
- amountError: se,
2990
- fieldLocks: k,
2991
- apiConfig: be,
2992
- assetBaseUrl: j
2993
- } = Ue(), [re, Ne] = v(a === "dark"), [Ee, de] = v(n), [xe, O] = v(null), [we, _e] = v(!1), [ee, Ve] = v(!1), [Fe, Me] = v(!1), [Ae, Re] = v(!1), [ze, ge] = v(null), [Ie, Je] = v(!0), [qe, C] = v(!1), [b, U] = v(!1), D = I(null), F = I(), $ = I(y.flowType);
2994
- W(() => {
2995
- Ne(a === "dark");
2996
- }, [a]), W(() => {
2997
- const x = setTimeout(() => Je(!1), M ? 0 : 800);
2998
+ quotesError: ge,
2999
+ fetchQuotes: Ce,
3000
+ createOrder: Se,
3001
+ orderLoading: oe,
3002
+ amountError: me,
3003
+ fieldLocks: M,
3004
+ apiConfig: ee,
3005
+ assetBaseUrl: G
3006
+ } = Te(), [X, fe] = v(a === "dark"), [he, Le] = v(n), [ie, H] = v(null), [Ue, Ee] = v(!1), [De, Ke] = v(!1), [ne, _e] = v(!1), [ve, Fe] = v(!1), [Ve, le] = v(null), [Me, Je] = v(!0), [qe, je] = v(!1), [ce, C] = v(!1), w = O(null), L = O(), U = O(y.flowType);
3007
+ Y(() => {
3008
+ fe(a === "dark");
3009
+ }, [a]), Y(() => {
3010
+ const x = setTimeout(() => Je(!1), I ? 0 : 800);
2998
3011
  return () => clearTimeout(x);
2999
- }, [M]), W(() => {
3000
- if ($.current !== y.flowType && !Ie) {
3001
- $.current = y.flowType, C(!0), _e(!1), Ve(!1);
3002
- const x = setTimeout(() => C(!1), 350);
3012
+ }, [I]), Y(() => {
3013
+ if (U.current !== y.flowType && !Me) {
3014
+ U.current = y.flowType, je(!0), Ee(!1), Ke(!1);
3015
+ const x = setTimeout(() => je(!1), 350);
3003
3016
  return () => clearTimeout(x);
3004
3017
  }
3005
- $.current = y.flowType;
3006
- }, [y.flowType, Ie]);
3007
- const Q = y.flowType, K = Q === "buy", X = y.cryptoCurrency || "BTC", te = y.fiatCurrency || "USD", et = K ? y.fiatAmount : y.cryptoAmount, z = Ea(et), ue = (bt = w == null ? void 0 : w.bestQuote) != null && bt.exchangeRate ? parseFloat(w.bestQuote.exchangeRate) : null, je = I(null);
3008
- ue && X && te && (je.current = { rate: ue, crypto: X, fiat: te });
3009
- const ut = Y(() => {
3010
- if (w != null && w.bestQuote) {
3011
- const x = K ? w.bestQuote.cryptoAmount : w.bestQuote.fiatAmount;
3018
+ U.current = y.flowType;
3019
+ }, [y.flowType, Me]);
3020
+ const D = y.flowType, F = D === "buy", B = y.cryptoCurrency || "BTC", W = y.fiatCurrency || "USD", et = F ? y.fiatAmount : y.cryptoAmount, z = Ea(et), pe = (bt = b == null ? void 0 : b.bestQuote) != null && bt.exchangeRate ? parseFloat(b.bestQuote.exchangeRate) : null, Ge = O(null);
3021
+ pe && B && W && (Ge.current = { rate: pe, crypto: B, fiat: W });
3022
+ const ut = Z(() => {
3023
+ if (b != null && b.bestQuote) {
3024
+ const x = F ? b.bestQuote.cryptoAmount : b.bestQuote.fiatAmount;
3012
3025
  if (x) return x;
3013
3026
  }
3014
3027
  return "0";
3015
- }, [w, K]), Be = !!(q && G && K && Xt(X) && ue), Qt = Be && X.toUpperCase().includes(te.toUpperCase()), mt = Be && z > 0 ? lt(Qt ? z : z / ue) : null, zt = Be && mt ? mt : ut, Jt = Y(() => {
3016
- var H, oe, ke;
3017
- const x = ue || ((H = je.current) == null ? void 0 : H.rate), N = ue ? X : (oe = je.current) == null ? void 0 : oe.crypto, T = ue ? te : (ke = je.current) == null ? void 0 : ke.fiat;
3028
+ }, [b, F]), Ie = !!(q && $ && F && Xt(B) && pe), Qt = Ie && B.toUpperCase().includes(W.toUpperCase()), mt = Ie && z > 0 ? lt(Qt ? z : z / pe) : null, zt = Ie && mt ? mt : ut, Jt = Z(() => {
3029
+ var K, re, Ae;
3030
+ const x = pe || ((K = Ge.current) == null ? void 0 : K.rate), N = pe ? B : (re = Ge.current) == null ? void 0 : re.crypto, T = pe ? W : (Ae = Ge.current) == null ? void 0 : Ae.fiat;
3018
3031
  return !x || !N || !T ? "" : `1 ${N} ≈ ${x.toFixed(2)} ${T}`;
3019
- }, [X, te, ue]);
3020
- W(() => {
3032
+ }, [B, W, pe]);
3033
+ Y(() => {
3021
3034
  const x = y.walletAddress.trim(), N = y.network;
3022
3035
  if (!x || x.length < 10) {
3023
- ge(null), L({ type: "SET_WALLET_ERROR", message: "" });
3036
+ le(null), k({ type: "SET_WALLET_ERROR", message: "" });
3024
3037
  return;
3025
3038
  }
3026
- Re(!0), ge(null);
3039
+ Fe(!0), le(null);
3027
3040
  const T = new AbortController();
3028
- return clearTimeout(F.current), F.current = setTimeout(async () => {
3029
- var H, oe, ke;
3041
+ return clearTimeout(L.current), L.current = setTimeout(async () => {
3042
+ var K, re, Ae;
3030
3043
  try {
3031
- const nt = await (await fetch(`${be.apiUrl}/public/validate/address`, {
3044
+ const nt = await (await fetch(`${ee.apiUrl}/public/validate/address`, {
3032
3045
  method: "POST",
3033
3046
  headers: { "Content-Type": "application/json" },
3034
3047
  body: JSON.stringify({ address: x, ...N ? { network: N } : {} }),
3035
3048
  signal: T.signal
3036
- })).json(), rt = ((H = nt.data) == null ? void 0 : H.attributes) || nt.data || nt;
3049
+ })).json(), rt = ((K = nt.data) == null ? void 0 : K.attributes) || nt.data || nt;
3037
3050
  if (rt.isValid)
3038
- ge(!0), L({ type: "SET_WALLET_ERROR", message: "" });
3051
+ le(!0), k({ type: "SET_WALLET_ERROR", message: "" });
3039
3052
  else {
3040
- ge(!1);
3041
- const da = ((oe = rt.errors) == null ? void 0 : oe[0]) || ((ke = rt.details) == null ? void 0 : ke.formatMessage) || "Invalid wallet address";
3042
- L({ type: "SET_WALLET_ERROR", message: da });
3053
+ le(!1);
3054
+ const da = ((re = rt.errors) == null ? void 0 : re[0]) || ((Ae = rt.details) == null ? void 0 : Ae.formatMessage) || "Invalid wallet address";
3055
+ k({ type: "SET_WALLET_ERROR", message: da });
3043
3056
  }
3044
3057
  } catch (at) {
3045
3058
  if (at instanceof DOMException && at.name === "AbortError") return;
3046
- ge(null);
3059
+ le(null);
3047
3060
  } finally {
3048
- T.signal.aborted || Re(!1);
3061
+ T.signal.aborted || Fe(!1);
3049
3062
  }
3050
3063
  }, 500), () => {
3051
- clearTimeout(F.current), T.abort();
3064
+ clearTimeout(L.current), T.abort();
3052
3065
  };
3053
- }, [y.walletAddress, y.network, be.apiUrl]);
3054
- const ft = !et || z === 0, ht = z > 0 && (K ? z < Bt : z < Ot), pt = !!se || ht || we && ft, qt = z > 0 && !se && !ht, tt = y.walletAddress.trim().length >= 10 && ze !== !1 && !Ae, Ge = qt && tt && !!y.cryptoCurrency && !!y.network, ea = (x) => {
3066
+ }, [y.walletAddress, y.network, ee.apiUrl]);
3067
+ const ft = !et || z === 0, ht = z > 0 && (F ? z < Bt : z < Ot), pt = !!me || ht || Ue && ft, qt = z > 0 && !me && !ht, tt = y.walletAddress.trim().length >= 10 && Ve !== !1 && !ve, $e = qt && tt && !!y.cryptoCurrency && !!y.network, ea = (x) => {
3055
3068
  let N = x.target.value.replace(/[^0-9.,]/g, "");
3056
- const T = K ? 2 : 6, H = N.indexOf(".");
3057
- H !== -1 && N.length - H - 1 > T && (N = N.slice(0, H + T + 1)), L(K ? { type: "SET_FIAT_AMOUNT", amount: N } : { type: "SET_CRYPTO_AMOUNT", amount: N });
3069
+ const T = F ? 2 : 6, K = N.indexOf(".");
3070
+ K !== -1 && N.length - K - 1 > T && (N = N.slice(0, K + T + 1)), k(F ? { type: "SET_FIAT_AMOUNT", amount: N } : { type: "SET_CRYPTO_AMOUNT", amount: N });
3058
3071
  }, yt = (x) => {
3059
- x !== Q && L({ type: "SET_FLOW_TYPE", flowType: x });
3060
- }, ta = B(
3072
+ x !== D && k({ type: "SET_FLOW_TYPE", flowType: x });
3073
+ }, ta = P(
3061
3074
  (x) => {
3062
- L({ type: "SET_FIAT_CURRENCY", currency: x });
3075
+ k({ type: "SET_FIAT_CURRENCY", currency: x });
3063
3076
  },
3064
- [L]
3065
- ), aa = B(
3077
+ [k]
3078
+ ), aa = P(
3066
3079
  (x, N) => {
3067
- L({ type: "SET_CRYPTO_CURRENCY", currency: x }), L({ type: "SET_CRYPTO_CHAIN", chain: N });
3080
+ k({ type: "SET_CRYPTO_CURRENCY", currency: x }), k({ type: "SET_CRYPTO_CHAIN", chain: N });
3068
3081
  },
3069
- [L]
3070
- ), na = B(
3082
+ [k]
3083
+ ), na = P(
3071
3084
  (x) => {
3072
- L({ type: "SET_PAYMENT_METHOD", methodId: x });
3085
+ k({ type: "SET_PAYMENT_METHOD", methodId: x });
3073
3086
  },
3074
- [L]
3075
- ), ra = B(
3087
+ [k]
3088
+ ), ra = P(
3076
3089
  (x) => {
3077
- L({ type: "SET_COUNTRY", country: x }), O(null);
3090
+ k({ type: "SET_COUNTRY", country: x }), H(null);
3078
3091
  },
3079
- [L]
3080
- ), oa = B(() => {
3081
- O(null), setTimeout(() => O("country"), 280);
3092
+ [k]
3093
+ ), oa = P(() => {
3094
+ H(null), setTimeout(() => H("country"), 280);
3082
3095
  }, []), ia = y.country ? (Nt = st[y.country.toLowerCase()]) == null ? void 0 : Nt.name : void 0, la = () => {
3083
- Ge && (U(!0), pe());
3096
+ $e && (C(!0), Ce());
3084
3097
  };
3085
- W(() => {
3098
+ Y(() => {
3086
3099
  var x;
3087
- if (!(!b || S)) {
3088
- if (w != null && w.bestQuote)
3089
- U(!1), L({ type: "SELECT_QUOTE", quote: w.bestQuote }), ye().catch(() => {
3100
+ if (!(!ce || S)) {
3101
+ if (b != null && b.bestQuote)
3102
+ C(!1), k({ type: "SELECT_QUOTE", quote: b.bestQuote }), Se().catch(() => {
3090
3103
  });
3091
- else if (he)
3092
- U(!1), L({ type: "SET_ERROR", message: he.message || "No quotes available" });
3093
- else if (w && !w.bestQuote) {
3094
- U(!1);
3095
- const N = (x = w.unavailableGateways) == null ? void 0 : x.map((H) => H.reason).filter(Boolean), T = N != null && N.length ? `No providers available: ${N.join("; ")}` : "No providers available for this currency/network combination";
3096
- L({ type: "SET_ERROR", message: T });
3104
+ else if (ge)
3105
+ C(!1), k({ type: "SET_ERROR", message: ge.message || "No quotes available" });
3106
+ else if (b && !b.bestQuote) {
3107
+ C(!1);
3108
+ const N = (x = b.unavailableGateways) == null ? void 0 : x.map((K) => K.reason).filter(Boolean), T = N != null && N.length ? `No providers available: ${N.join("; ")}` : "No providers available for this currency/network combination";
3109
+ k({ type: "SET_ERROR", message: T });
3097
3110
  }
3098
3111
  }
3099
- }, [b, w, S, he, L, ye]);
3100
- const xt = re ? "theme-dark" : "theme-light", $e = Mt.find((x) => x.id === Ee) || Mt[0], ca = $e.accent === null, sa = r ? ce(r) : !1, gt = (x) => {
3101
- const N = x.replace("#", ""), T = parseInt(N.substring(0, 2), 16), H = parseInt(N.substring(2, 4), 16), oe = parseInt(N.substring(4, 6), 16);
3102
- return (0.299 * T + 0.587 * H + 0.114 * oe) / 255 > 0.5 ? "#000000" : "#ffffff";
3112
+ }, [ce, b, S, ge, k, Se]);
3113
+ const xt = X ? "theme-dark" : "theme-light", Xe = Mt.find((x) => x.id === he) || Mt[0], ca = Xe.accent === null, sa = r ? ue(r) : !1, gt = (x) => {
3114
+ const N = x.replace("#", ""), T = parseInt(N.substring(0, 2), 16), K = parseInt(N.substring(2, 4), 16), re = parseInt(N.substring(4, 6), 16);
3115
+ return (0.299 * T + 0.587 * K + 0.114 * re) / 255 > 0.5 ? "#000000" : "#ffffff";
3103
3116
  }, Ct = sa ? { "--t-accent": r, "--t-cta-bg": r, "--t-cta-text": gt(r) } : ca ? {
3104
- "--t-accent": re ? "#ffffff" : "#111111",
3105
- "--t-cta-bg": re ? "#ffffff" : "#111111",
3106
- "--t-cta-text": re ? "#000000" : "#ffffff"
3117
+ "--t-accent": X ? "#ffffff" : "#111111",
3118
+ "--t-cta-bg": X ? "#ffffff" : "#111111",
3119
+ "--t-cta-text": X ? "#000000" : "#ffffff"
3107
3120
  } : {
3108
- "--t-accent": $e.accent,
3109
- "--t-cta-bg": $e.accent,
3110
- "--t-cta-text": gt($e.accent)
3111
- }, ae = {};
3112
- u && ce(u) && (ae["--t-surface"] = u, ae["--t-modal-bg"] = u), f && ce(f) && (ae["--t-pill-bg"] = f, ae["--t-close-bg"] = f), h && ce(h) && (ae["--t-text"] = h), d && ce(d) && (ae["--t-text-secondary"] = d), p && ce(p) && (ae["--t-text-muted"] = p, ae["--t-text-tertiary"] = p), g && ce(g) && (ae["--t-success"] = g);
3113
- const Ce = {};
3114
- i && ce(i) ? Ce.backgroundColor = i : Ce.backgroundColor = "var(--t-bg)", c && (c.startsWith("https://") || c.startsWith("data:image/")) && (Ce.backgroundImage = `url(${c})`, Ce.backgroundSize = "cover", Ce.backgroundPosition = "center");
3115
- const Xe = re ? "#ffffff" : "#111111", We = {};
3116
- m && ce(m) && (We.border = `1px solid ${m}`), s && (We.borderRadius = s);
3117
- const vt = y.step === "checkout" ? /* @__PURE__ */ e(Ka, { autoRedirect: P }) : y.step === "processing" ? /* @__PURE__ */ e(Va, {}) : y.step === "complete" ? /* @__PURE__ */ e(ja, { explorerUrl: ne, doneButtonText: V, onDone: fe }) : y.step === "error" ? /* @__PURE__ */ e(Ga, { supportEmail: Z }) : y.step === "confirm" ? /* @__PURE__ */ e($a, { stablecoinParity: Be, partnerName: G }) : null;
3118
- if (vt)
3121
+ "--t-accent": Xe.accent,
3122
+ "--t-cta-bg": Xe.accent,
3123
+ "--t-cta-text": gt(Xe.accent)
3124
+ }, te = {};
3125
+ u && ue(u) && (te["--t-surface"] = u, te["--t-modal-bg"] = u), f && ue(f) && (te["--t-pill-bg"] = f, te["--t-close-bg"] = f), h && ue(h) && (te["--t-text"] = h), d && ue(d) && (te["--t-text-secondary"] = d), p && ue(p) && (te["--t-text-muted"] = p, te["--t-text-tertiary"] = p), g && ue(g) && (te["--t-success"] = g);
3126
+ const be = {};
3127
+ l && ue(l) ? be.backgroundColor = l : be.backgroundColor = "var(--t-bg)", c && (c.startsWith("https://") || c.startsWith("data:image/")) && (be.backgroundImage = `url(${c})`, be.backgroundSize = "cover", be.backgroundPosition = "center");
3128
+ const We = X ? "#ffffff" : "#111111", Ye = {};
3129
+ m && ue(m) && (Ye.border = `1px solid ${m}`), s && (Ye.borderRadius = s);
3130
+ const St = y.step === "checkout" ? /* @__PURE__ */ e(Ka, { autoRedirect: _ }) : y.step === "processing" ? /* @__PURE__ */ e(Va, {}) : y.step === "complete" ? /* @__PURE__ */ e(ja, { explorerUrl: ae, doneButtonText: j, onDone: xe }) : y.step === "error" ? /* @__PURE__ */ e(Ga, { supportEmail: Q }) : y.step === "confirm" ? /* @__PURE__ */ e($a, { stablecoinParity: Ie, partnerName: $ }) : null;
3131
+ if (St)
3119
3132
  return /* @__PURE__ */ e(
3120
3133
  "div",
3121
3134
  {
3122
3135
  className: `${xt} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
3123
3136
  style: {
3124
3137
  fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
3125
- ...Ce,
3138
+ ...be,
3126
3139
  ...Ct,
3127
- ...ae,
3128
- ...We
3140
+ ...te,
3141
+ ...Ye
3129
3142
  },
3130
- children: vt
3143
+ children: St
3131
3144
  }
3132
3145
  );
3133
- const le = y.network, Te = le ? Ze(le) : null, St = (Te == null ? void 0 : Te.shortName) || (Te == null ? void 0 : Te.name) || le;
3146
+ const se = y.network, we = se ? Qe(se) : null, vt = (we == null ? void 0 : we.shortName) || (we == null ? void 0 : we.name) || se;
3134
3147
  return /* @__PURE__ */ o(
3135
3148
  "div",
3136
3149
  {
3137
3150
  className: `${xt} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
3138
3151
  style: {
3139
3152
  fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
3140
- ...Ce,
3153
+ ...be,
3141
3154
  ...Ct,
3142
- ...ae,
3143
- ...We
3155
+ ...te,
3156
+ ...Ye
3144
3157
  },
3145
3158
  children: [
3146
- E && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${A ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Ma, { onClick: () => O("settings") }) }),
3159
+ E && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${A ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Ma, { onClick: () => H("settings") }) }),
3147
3160
  A ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
3148
3161
  /* @__PURE__ */ o("div", { className: "flex", style: { width: 165 }, children: [
3149
3162
  /* @__PURE__ */ e(
@@ -3151,7 +3164,7 @@ function rn({
3151
3164
  {
3152
3165
  onClick: () => yt("buy"),
3153
3166
  className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
3154
- style: { color: Q === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
3167
+ style: { color: D === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
3155
3168
  children: "Buy"
3156
3169
  }
3157
3170
  ),
@@ -3160,7 +3173,7 @@ function rn({
3160
3173
  {
3161
3174
  onClick: () => yt("sell"),
3162
3175
  className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
3163
- style: { color: Q === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
3176
+ style: { color: D === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
3164
3177
  children: "Sell"
3165
3178
  }
3166
3179
  )
@@ -3173,14 +3186,14 @@ function rn({
3173
3186
  className: "absolute top-0 h-full transition-all duration-300 ease-in-out",
3174
3187
  style: {
3175
3188
  width: "50%",
3176
- left: Q === "buy" ? "0%" : "50%",
3189
+ left: D === "buy" ? "0%" : "50%",
3177
3190
  background: "var(--t-accent)"
3178
3191
  }
3179
3192
  }
3180
3193
  )
3181
3194
  ] })
3182
3195
  ] }) : null,
3183
- Ie || qe || M ? /* @__PURE__ */ e(Ya, {}) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
3196
+ Me || qe || I ? /* @__PURE__ */ e(Ya, {}) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
3184
3197
  /* @__PURE__ */ o(
3185
3198
  "div",
3186
3199
  {
@@ -3188,7 +3201,7 @@ function rn({
3188
3201
  style: {
3189
3202
  background: "var(--t-surface)",
3190
3203
  borderRadius: 5,
3191
- border: we && pt ? "1px solid #EF4444" : "1px solid transparent",
3204
+ border: Ue && pt ? "1px solid #EF4444" : "1px solid transparent",
3192
3205
  minHeight: 102
3193
3206
  },
3194
3207
  children: [
@@ -3197,22 +3210,22 @@ function rn({
3197
3210
  /* @__PURE__ */ e(
3198
3211
  "input",
3199
3212
  {
3200
- ref: D,
3213
+ ref: w,
3201
3214
  type: "text",
3202
3215
  value: et,
3203
3216
  onChange: ea,
3204
- onBlur: () => _e(!0),
3205
- placeholder: K ? "250" : "0.01",
3217
+ onBlur: () => Ee(!0),
3218
+ placeholder: F ? "250" : "0.01",
3206
3219
  className: "bg-transparent outline-none w-0 flex-1 mr-3",
3207
3220
  style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px", padding: 0, border: "none", borderRadius: 0, backgroundColor: "transparent", height: "auto", width: 0 },
3208
3221
  inputMode: "decimal",
3209
- disabled: !!((Et = k == null ? void 0 : k.sourceAmount) != null && Et.locked)
3222
+ disabled: !!((Et = M == null ? void 0 : M.sourceAmount) != null && Et.locked)
3210
3223
  }
3211
3224
  ),
3212
- K ? /* @__PURE__ */ o(
3225
+ F ? /* @__PURE__ */ o(
3213
3226
  "button",
3214
3227
  {
3215
- onClick: () => O("fiat"),
3228
+ onClick: () => H("fiat"),
3216
3229
  className: "flex items-center gap-1.5 shrink-0 transition-colors",
3217
3230
  style: {
3218
3231
  background: "var(--t-pill-bg)",
@@ -3221,18 +3234,18 @@ function rn({
3221
3234
  paddingLeft: 10,
3222
3235
  paddingRight: 10
3223
3236
  },
3224
- disabled: !!((wt = k == null ? void 0 : k.sourceCurrency) != null && wt.locked),
3237
+ disabled: !!((wt = M == null ? void 0 : M.sourceCurrency) != null && wt.locked),
3225
3238
  children: [
3226
- /* @__PURE__ */ e(ct, { currencyCode: te, size: 16, baseUrl: j }),
3227
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: te }),
3228
- /* @__PURE__ */ e(Pe, {})
3239
+ /* @__PURE__ */ e(ct, { currencyCode: W, size: 16, baseUrl: G }),
3240
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: We }, children: W }),
3241
+ /* @__PURE__ */ e(He, {})
3229
3242
  ]
3230
3243
  }
3231
3244
  ) : /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
3232
3245
  /* @__PURE__ */ o(
3233
3246
  "button",
3234
3247
  {
3235
- onClick: () => O("crypto"),
3248
+ onClick: () => H("crypto"),
3236
3249
  className: "flex items-center gap-1.5 transition-colors",
3237
3250
  style: {
3238
3251
  background: "var(--t-pill-bg)",
@@ -3241,34 +3254,34 @@ function rn({
3241
3254
  paddingLeft: 10,
3242
3255
  paddingRight: 10
3243
3256
  },
3244
- disabled: !!((At = k == null ? void 0 : k.destinationCurrency) != null && At.locked),
3257
+ disabled: !!((At = M == null ? void 0 : M.destinationCurrency) != null && At.locked),
3245
3258
  children: [
3246
- /* @__PURE__ */ e(Ht, { ticker: X, size: 16, baseUrl: j }),
3247
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: X }),
3248
- /* @__PURE__ */ e(Pe, {})
3259
+ /* @__PURE__ */ e(Ht, { ticker: B, size: 16, baseUrl: G }),
3260
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: We }, children: B }),
3261
+ /* @__PURE__ */ e(He, {})
3249
3262
  ]
3250
3263
  }
3251
3264
  ),
3252
- le && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3265
+ se && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3253
3266
  /* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
3254
3267
  "img",
3255
3268
  {
3256
- src: it(le, j),
3257
- alt: le,
3269
+ src: it(se, G),
3270
+ alt: se,
3258
3271
  width: 14,
3259
3272
  height: 14,
3260
3273
  className: "rounded-full",
3261
3274
  style: { width: 14, height: 14 }
3262
3275
  }
3263
3276
  ) }),
3264
- /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: St })
3277
+ /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: vt })
3265
3278
  ] })
3266
3279
  ] })
3267
3280
  ] })
3268
3281
  ]
3269
3282
  }
3270
3283
  ),
3271
- we && pt && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: se || (ft ? "Amount should be more than 0" : K ? `Minimum amount is ${Bt} ${te}` : `Minimum amount is ${Ot} ${X}`) }),
3284
+ Ue && pt && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: me || (ft ? "Amount should be more than 0" : F ? `Minimum amount is ${Bt} ${W}` : `Minimum amount is ${Ot} ${B}`) }),
3272
3285
  /* @__PURE__ */ o(
3273
3286
  "div",
3274
3287
  {
@@ -3285,7 +3298,7 @@ function rn({
3285
3298
  children: [
3286
3299
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
3287
3300
  /* @__PURE__ */ o("div", { className: "flex items-start justify-between", children: [
3288
- S && !b ? /* @__PURE__ */ e(_, { w: 180, h: 32 }) : /* @__PURE__ */ e(
3301
+ S && !ce ? /* @__PURE__ */ e(V, { w: 180, h: 32 }) : /* @__PURE__ */ e(
3289
3302
  Wa,
3290
3303
  {
3291
3304
  value: z > 0 ? zt : "0",
@@ -3294,11 +3307,11 @@ function rn({
3294
3307
  style: { color: z > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
3295
3308
  }
3296
3309
  ),
3297
- K ? /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
3310
+ F ? /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
3298
3311
  /* @__PURE__ */ o(
3299
3312
  "button",
3300
3313
  {
3301
- onClick: () => O("crypto"),
3314
+ onClick: () => H("crypto"),
3302
3315
  className: "flex items-center gap-1.5 transition-colors",
3303
3316
  style: {
3304
3317
  background: "var(--t-pill-bg)",
@@ -3307,32 +3320,32 @@ function rn({
3307
3320
  paddingLeft: 10,
3308
3321
  paddingRight: 10
3309
3322
  },
3310
- disabled: !!((Rt = k == null ? void 0 : k.destinationCurrency) != null && Rt.locked),
3323
+ disabled: !!((Rt = M == null ? void 0 : M.destinationCurrency) != null && Rt.locked),
3311
3324
  children: [
3312
- /* @__PURE__ */ e(Ht, { ticker: X, size: 16, baseUrl: j }),
3313
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: X }),
3314
- /* @__PURE__ */ e(Pe, {})
3325
+ /* @__PURE__ */ e(Ht, { ticker: B, size: 16, baseUrl: G }),
3326
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: We }, children: B }),
3327
+ /* @__PURE__ */ e(He, {})
3315
3328
  ]
3316
3329
  }
3317
3330
  ),
3318
- le && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3331
+ se && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3319
3332
  /* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
3320
3333
  "img",
3321
3334
  {
3322
- src: it(le, j),
3323
- alt: le,
3335
+ src: it(se, G),
3336
+ alt: se,
3324
3337
  width: 14,
3325
3338
  height: 14,
3326
3339
  className: "rounded-full",
3327
3340
  style: { width: 14, height: 14 }
3328
3341
  }
3329
3342
  ) }),
3330
- /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: St })
3343
+ /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: vt })
3331
3344
  ] })
3332
3345
  ] }) : /* @__PURE__ */ o(
3333
3346
  "button",
3334
3347
  {
3335
- onClick: () => O("fiat"),
3348
+ onClick: () => H("fiat"),
3336
3349
  className: "flex items-center gap-1.5 shrink-0 transition-colors",
3337
3350
  style: {
3338
3351
  background: "var(--t-pill-bg)",
@@ -3341,11 +3354,11 @@ function rn({
3341
3354
  paddingLeft: 10,
3342
3355
  paddingRight: 10
3343
3356
  },
3344
- disabled: !!((Tt = k == null ? void 0 : k.sourceCurrency) != null && Tt.locked),
3357
+ disabled: !!((Tt = M == null ? void 0 : M.sourceCurrency) != null && Tt.locked),
3345
3358
  children: [
3346
- /* @__PURE__ */ e(ct, { currencyCode: te, size: 16, baseUrl: j }),
3347
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: te }),
3348
- /* @__PURE__ */ e(Pe, {})
3359
+ /* @__PURE__ */ e(ct, { currencyCode: W, size: 16, baseUrl: G }),
3360
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: We }, children: W }),
3361
+ /* @__PURE__ */ e(He, {})
3349
3362
  ]
3350
3363
  }
3351
3364
  )
@@ -3353,7 +3366,7 @@ function rn({
3353
3366
  ]
3354
3367
  }
3355
3368
  ),
3356
- Be && z > 0 && (w == null ? void 0 : w.bestQuote) && /* @__PURE__ */ o(
3369
+ Ie && z > 0 && (b == null ? void 0 : b.bestQuote) && /* @__PURE__ */ o(
3357
3370
  "div",
3358
3371
  {
3359
3372
  className: "flex items-start gap-2 mt-[2px] px-[14px] py-[10px]",
@@ -3367,13 +3380,13 @@ function rn({
3367
3380
  "You will be charged for ",
3368
3381
  ut,
3369
3382
  " ",
3370
- X,
3383
+ B,
3371
3384
  ", the rest up to ",
3372
3385
  lt(z),
3373
3386
  " ",
3374
- te,
3387
+ W,
3375
3388
  " will be credited to your ",
3376
- G,
3389
+ $,
3377
3390
  " account"
3378
3391
  ] })
3379
3392
  ]
@@ -3385,38 +3398,38 @@ function rn({
3385
3398
  className: "flex items-center justify-between mt-[2px] px-[18px] pt-[12px] pb-[14px]",
3386
3399
  style: {
3387
3400
  background: "var(--t-surface)",
3388
- ...(kt = l == null ? void 0 : l.paymentMethods) != null && kt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
3401
+ ...(kt = i == null ? void 0 : i.paymentMethods) != null && kt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
3389
3402
  },
3390
3403
  children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: g ? "var(--t-success)" : "var(--t-text-secondary)" }, children: Jt || " " })
3391
3404
  }
3392
3405
  ),
3393
- (l == null ? void 0 : l.paymentMethods) && l.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
3406
+ (i == null ? void 0 : i.paymentMethods) && i.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
3394
3407
  Pa,
3395
3408
  {
3396
- methods: l.paymentMethods,
3409
+ methods: i.paymentMethods,
3397
3410
  selectedId: y.paymentMethodId,
3398
- onOpenModal: () => O("payment"),
3411
+ onOpenModal: () => H("payment"),
3399
3412
  fiatCurrency: y.fiatCurrency
3400
3413
  }
3401
3414
  ) }),
3402
3415
  /* @__PURE__ */ o("div", { className: "mt-8", children: [
3403
- /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: K ? "Receiving wallet address" : "Sending wallet address" }),
3416
+ /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: F ? "Receiving wallet address" : "Sending wallet address" }),
3404
3417
  /* @__PURE__ */ e(
3405
3418
  "input",
3406
3419
  {
3407
3420
  type: "text",
3408
3421
  value: y.walletAddress,
3409
- onChange: (x) => L({ type: "SET_WALLET_ADDRESS", address: x.target.value }),
3410
- onFocus: () => Me(!0),
3422
+ onChange: (x) => k({ type: "SET_WALLET_ADDRESS", address: x.target.value }),
3423
+ onFocus: () => _e(!0),
3411
3424
  onBlur: () => {
3412
- Me(!1), Ve(!0);
3425
+ _e(!1), Ke(!0);
3413
3426
  },
3414
- placeholder: K ? "Enter your receiving address" : "Enter your sending address",
3427
+ placeholder: F ? "Enter your receiving address" : "Enter your sending address",
3415
3428
  spellCheck: !1,
3416
3429
  autoComplete: "off",
3417
3430
  className: "w-full bg-transparent text-[13px] outline-none transition-colors",
3418
3431
  style: {
3419
- border: y.walletError || ee && !tt ? "1px solid #EF4444" : Fe ? "1px solid var(--t-border-focus)" : "1px solid var(--t-border)",
3432
+ border: y.walletError || De && !tt ? "1px solid #EF4444" : ne ? "1px solid var(--t-border-focus)" : "1px solid var(--t-border)",
3420
3433
  outline: "none",
3421
3434
  boxShadow: "none",
3422
3435
  borderRadius: 3.5,
@@ -3426,16 +3439,16 @@ function rn({
3426
3439
  fontSize: 13,
3427
3440
  backgroundColor: "transparent"
3428
3441
  },
3429
- disabled: !!((Lt = k == null ? void 0 : k.destinationAddress) != null && Lt.locked)
3442
+ disabled: !!((Lt = M == null ? void 0 : M.destinationAddress) != null && Lt.locked)
3430
3443
  }
3431
3444
  ),
3432
- y.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: y.walletError }) : ee && !tt && !Ae ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : Ae && y.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
3445
+ y.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: y.walletError }) : De && !tt && !ve ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : ve && y.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
3433
3446
  ] }),
3434
3447
  /* @__PURE__ */ e("div", { className: "flex-1", style: { minHeight: 16 } }),
3435
3448
  /* @__PURE__ */ e(
3436
3449
  "button",
3437
3450
  {
3438
- disabled: !Ge || ie || b,
3451
+ disabled: !$e || oe || ce,
3439
3452
  onClick: la,
3440
3453
  className: "w-full font-semibold text-[16px] transition-all",
3441
3454
  style: {
@@ -3443,15 +3456,15 @@ function rn({
3443
3456
  borderRadius: 5,
3444
3457
  background: "var(--t-cta-bg)",
3445
3458
  color: "var(--t-cta-text)",
3446
- opacity: Ge && !ie && !b ? 1 : 0.4,
3447
- cursor: Ge && !ie && !b ? "pointer" : "not-allowed"
3459
+ opacity: $e && !oe && !ce ? 1 : 0.4,
3460
+ cursor: $e && !oe && !ce ? "pointer" : "not-allowed"
3448
3461
  },
3449
- children: b ? "Getting best price..." : ie ? "Processing..." : K ? `Buy ${X}` : `Sell ${X}`
3462
+ children: ce ? "Getting best price..." : oe ? "Processing..." : F ? `Buy ${B}` : `Sell ${B}`
3450
3463
  }
3451
3464
  ),
3452
3465
  /* @__PURE__ */ e("div", { className: "text-center py-3", children: /* @__PURE__ */ e("span", { className: "text-[11px]", style: { color: "var(--t-text-tertiary)" }, children: "Powered by NowRamp" }) })
3453
- ] }, Q),
3454
- /* @__PURE__ */ e(He, { isOpen: xe === "fiat", onClose: () => O(null), children: (x) => {
3466
+ ] }, D),
3467
+ /* @__PURE__ */ e(Oe, { isOpen: ie === "fiat", onClose: () => H(null), children: (x) => {
3455
3468
  var N;
3456
3469
  return /* @__PURE__ */ e(
3457
3470
  Za,
@@ -3460,41 +3473,41 @@ function rn({
3460
3473
  onSelect: (T) => {
3461
3474
  ta(T), x();
3462
3475
  },
3463
- currencies: (N = l == null ? void 0 : l.fiats) == null ? void 0 : N.map((T) => ({ code: T.code, name: T.code })),
3464
- assetBaseUrl: j,
3476
+ currencies: (N = i == null ? void 0 : i.fiats) == null ? void 0 : N.map((T) => ({ code: T.code, name: T.code })),
3477
+ assetBaseUrl: G,
3465
3478
  selectedCode: y.fiatCurrency
3466
3479
  }
3467
3480
  );
3468
3481
  } }),
3469
- /* @__PURE__ */ e(He, { isOpen: xe === "crypto", onClose: () => O(null), children: (x) => {
3482
+ /* @__PURE__ */ e(Oe, { isOpen: ie === "crypto", onClose: () => H(null), children: (x) => {
3470
3483
  var N;
3471
3484
  return /* @__PURE__ */ e(
3472
3485
  Qa,
3473
3486
  {
3474
3487
  onClose: x,
3475
- onSelect: (T, H) => {
3476
- aa(T, H), x();
3488
+ onSelect: (T, K) => {
3489
+ aa(T, K), x();
3477
3490
  },
3478
- cryptos: (N = l == null ? void 0 : l.cryptos) == null ? void 0 : N.map((T) => {
3479
- var H;
3491
+ cryptos: (N = i == null ? void 0 : i.cryptos) == null ? void 0 : N.map((T) => {
3492
+ var K;
3480
3493
  return {
3481
3494
  code: T.code,
3482
3495
  name: T.code,
3483
- networks: (H = T.networks) == null ? void 0 : H.map((oe) => ({ code: oe.id, name: oe.name }))
3496
+ networks: (K = T.networks) == null ? void 0 : K.map((re) => ({ code: re.id, name: re.name }))
3484
3497
  };
3485
3498
  }),
3486
- assetBaseUrl: j,
3499
+ assetBaseUrl: G,
3487
3500
  selectedCode: y.cryptoCurrency,
3488
3501
  selectedChain: y.network
3489
3502
  }
3490
3503
  );
3491
3504
  } }),
3492
- /* @__PURE__ */ e(He, { isOpen: xe === "payment", onClose: () => O(null), children: (x) => {
3505
+ /* @__PURE__ */ e(Oe, { isOpen: ie === "payment", onClose: () => H(null), children: (x) => {
3493
3506
  var N;
3494
3507
  return /* @__PURE__ */ e(
3495
3508
  za,
3496
3509
  {
3497
- methods: ((N = l == null ? void 0 : l.paymentMethods) == null ? void 0 : N.filter((T) => T.supportedFiats.includes(y.fiatCurrency))) || [],
3510
+ methods: ((N = i == null ? void 0 : i.paymentMethods) == null ? void 0 : N.filter((T) => T.supportedFiats.includes(y.fiatCurrency))) || [],
3498
3511
  selectedId: y.paymentMethodId,
3499
3512
  onSelect: (T) => {
3500
3513
  na(T), x();
@@ -3503,31 +3516,31 @@ function rn({
3503
3516
  }
3504
3517
  );
3505
3518
  } }),
3506
- /* @__PURE__ */ e(He, { isOpen: xe === "settings", onClose: () => O(null), children: (x) => /* @__PURE__ */ e(
3519
+ /* @__PURE__ */ e(Oe, { isOpen: ie === "settings", onClose: () => H(null), children: (x) => /* @__PURE__ */ e(
3507
3520
  en,
3508
3521
  {
3509
3522
  onClose: x,
3510
- darkMode: re,
3511
- onToggleDarkMode: Ne,
3512
- skinId: Ee,
3523
+ darkMode: X,
3524
+ onToggleDarkMode: fe,
3525
+ skinId: he,
3513
3526
  onSelectSkin: (N) => {
3514
- de(N);
3527
+ Le(N);
3515
3528
  },
3516
3529
  showThemeToggle: R,
3517
3530
  country: y.country,
3518
3531
  countryName: ia,
3519
3532
  onLocationPress: oa,
3520
- assetBaseUrl: j
3533
+ assetBaseUrl: G
3521
3534
  }
3522
3535
  ) }),
3523
- /* @__PURE__ */ e(He, { isOpen: xe === "country", onClose: () => O(null), children: (x) => /* @__PURE__ */ e(
3536
+ /* @__PURE__ */ e(Oe, { isOpen: ie === "country", onClose: () => H(null), children: (x) => /* @__PURE__ */ e(
3524
3537
  an,
3525
3538
  {
3526
3539
  onClose: x,
3527
3540
  onSelect: (N) => {
3528
3541
  ra(N), x();
3529
3542
  },
3530
- assetBaseUrl: j,
3543
+ assetBaseUrl: G,
3531
3544
  selectedCode: y.country
3532
3545
  }
3533
3546
  ) })
@@ -3540,7 +3553,7 @@ function on({
3540
3553
  apiUrl: a,
3541
3554
  assetBaseUrl: n,
3542
3555
  flowType: r,
3543
- customerId: i,
3556
+ customerId: l,
3544
3557
  brandId: c,
3545
3558
  defaultFiatCurrency: m,
3546
3559
  defaultCryptoCurrency: s,
@@ -3553,31 +3566,31 @@ function on({
3553
3566
  fieldLocks: A,
3554
3567
  statusPollInterval: E,
3555
3568
  onComplete: R,
3556
- onError: P,
3557
- className: ne,
3558
- theme: V,
3559
- skinId: Z,
3569
+ onError: _,
3570
+ className: ae,
3571
+ theme: j,
3572
+ skinId: Q,
3560
3573
  accentColor: q,
3561
- bgColor: G,
3562
- bgImage: fe,
3574
+ bgColor: $,
3575
+ bgImage: xe,
3563
3576
  borderColor: y,
3564
- borderRadius: L,
3565
- surfaceColor: l,
3566
- inputBgColor: M,
3567
- textColor: w,
3577
+ borderRadius: k,
3578
+ surfaceColor: i,
3579
+ inputBgColor: I,
3580
+ textColor: b,
3568
3581
  textSecondaryColor: S,
3569
- textMutedColor: he,
3570
- successColor: pe,
3571
- showFlowToggle: ye,
3572
- showSettings: ie,
3573
- showThemeToggle: se,
3574
- autoRedirect: k,
3575
- explorerUrl: be,
3576
- doneButtonText: j,
3577
- supportEmail: re,
3578
- stablecoinParity: Ne,
3579
- partnerName: Ee,
3580
- onDone: de
3582
+ textMutedColor: ge,
3583
+ successColor: Ce,
3584
+ showFlowToggle: Se,
3585
+ showSettings: oe,
3586
+ showThemeToggle: me,
3587
+ autoRedirect: M,
3588
+ explorerUrl: ee,
3589
+ doneButtonText: G,
3590
+ supportEmail: X,
3591
+ stablecoinParity: fe,
3592
+ partnerName: he,
3593
+ onDone: Le
3581
3594
  }) {
3582
3595
  return /* @__PURE__ */ e(
3583
3596
  Ca,
@@ -3586,7 +3599,7 @@ function on({
3586
3599
  apiUrl: a,
3587
3600
  assetBaseUrl: n,
3588
3601
  flowType: r,
3589
- customerId: i,
3602
+ customerId: l,
3590
3603
  brandId: c,
3591
3604
  defaultFiatCurrency: m,
3592
3605
  defaultCryptoCurrency: s,
@@ -3599,34 +3612,34 @@ function on({
3599
3612
  fieldLocks: A,
3600
3613
  statusPollInterval: E,
3601
3614
  onComplete: R,
3602
- onError: P,
3615
+ onError: _,
3603
3616
  children: /* @__PURE__ */ e(
3604
3617
  rn,
3605
3618
  {
3606
- className: ne,
3607
- theme: V,
3608
- skinId: Z,
3619
+ className: ae,
3620
+ theme: j,
3621
+ skinId: Q,
3609
3622
  accentColor: q,
3610
- bgColor: G,
3611
- bgImage: fe,
3623
+ bgColor: $,
3624
+ bgImage: xe,
3612
3625
  borderColor: y,
3613
- borderRadius: L,
3614
- surfaceColor: l,
3615
- inputBgColor: M,
3616
- textColor: w,
3626
+ borderRadius: k,
3627
+ surfaceColor: i,
3628
+ inputBgColor: I,
3629
+ textColor: b,
3617
3630
  textSecondaryColor: S,
3618
- textMutedColor: he,
3619
- successColor: pe,
3620
- showFlowToggle: ye,
3621
- showSettings: ie,
3622
- showThemeToggle: se,
3623
- autoRedirect: k,
3624
- explorerUrl: be,
3625
- doneButtonText: j,
3626
- supportEmail: re,
3627
- stablecoinParity: Ne,
3628
- partnerName: Ee,
3629
- onDone: de
3631
+ textMutedColor: ge,
3632
+ successColor: Ce,
3633
+ showFlowToggle: Se,
3634
+ showSettings: oe,
3635
+ showThemeToggle: me,
3636
+ autoRedirect: M,
3637
+ explorerUrl: ee,
3638
+ doneButtonText: G,
3639
+ supportEmail: X,
3640
+ stablecoinParity: fe,
3641
+ partnerName: he,
3642
+ onDone: Le
3630
3643
  }
3631
3644
  )
3632
3645
  }
@@ -3644,7 +3657,7 @@ function xn({
3644
3657
  active: a,
3645
3658
  onClick: n,
3646
3659
  darkMode: r,
3647
- dimmed: i
3660
+ dimmed: l
3648
3661
  }) {
3649
3662
  const c = t.accent === null, m = 32;
3650
3663
  return /* @__PURE__ */ o(
@@ -3652,7 +3665,7 @@ function xn({
3652
3665
  {
3653
3666
  onClick: n,
3654
3667
  className: "relative shrink-0",
3655
- style: { width: m, height: m, opacity: i ? 0.4 : 1, transition: "opacity 0.2s" },
3668
+ style: { width: m, height: m, opacity: l ? 0.4 : 1, transition: "opacity 0.2s" },
3656
3669
  children: [
3657
3670
  c ? /* @__PURE__ */ o("svg", { width: m, height: m, viewBox: "0 0 32 32", children: [
3658
3671
  /* @__PURE__ */ e("clipPath", { id: "mono-left", children: /* @__PURE__ */ e("rect", { x: "0", y: "0", width: "16", height: "32" }) }),
@@ -3661,7 +3674,7 @@ function xn({
3661
3674
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#ffffff", clipPath: "url(#mono-right)" }),
3662
3675
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke: r ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.1)", strokeWidth: "1" })
3663
3676
  ] }) : /* @__PURE__ */ e("svg", { width: m, height: m, viewBox: "0 0 32 32", children: /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: t.accent }) }),
3664
- a && !i && /* @__PURE__ */ e(
3677
+ a && !l && /* @__PURE__ */ e(
3665
3678
  "div",
3666
3679
  {
3667
3680
  className: "absolute inset-0 rounded-full",
@@ -3704,14 +3717,14 @@ function sn() {
3704
3717
  background: "var(--t-surface)"
3705
3718
  },
3706
3719
  children: [
3707
- /* @__PURE__ */ e(_, { w: 36, h: 36, className: "rounded-full shrink-0" }),
3720
+ /* @__PURE__ */ e(V, { w: 36, h: 36, className: "rounded-full shrink-0" }),
3708
3721
  /* @__PURE__ */ o("div", { className: "flex-1", children: [
3709
- /* @__PURE__ */ e(_, { w: 90, h: 14, className: "mb-1.5" }),
3710
- /* @__PURE__ */ e(_, { w: 60, h: 12 })
3722
+ /* @__PURE__ */ e(V, { w: 90, h: 14, className: "mb-1.5" }),
3723
+ /* @__PURE__ */ e(V, { w: 60, h: 12 })
3711
3724
  ] }),
3712
3725
  /* @__PURE__ */ o("div", { className: "text-right", children: [
3713
- /* @__PURE__ */ e(_, { w: 40, h: 10, className: "mb-1.5" }),
3714
- /* @__PURE__ */ e(_, { w: 80, h: 14 })
3726
+ /* @__PURE__ */ e(V, { w: 40, h: 10, className: "mb-1.5" }),
3727
+ /* @__PURE__ */ e(V, { w: 80, h: 14 })
3715
3728
  ] })
3716
3729
  ]
3717
3730
  },
@@ -3723,15 +3736,15 @@ function gn({
3723
3736
  onSelect: a,
3724
3737
  quotes: n,
3725
3738
  quotesLoading: r,
3726
- cryptoCurrency: i
3739
+ cryptoCurrency: l
3727
3740
  }) {
3728
- const [c, m] = v(""), s = Y(() => {
3741
+ const [c, m] = v(""), s = Z(() => {
3729
3742
  if (!(n != null && n.quotes)) return [];
3730
3743
  const u = c.trim().toLowerCase();
3731
3744
  return u ? n.quotes.filter((f) => f.gatewayName.toLowerCase().includes(u)) : n.quotes;
3732
3745
  }, [n, c]);
3733
3746
  return /* @__PURE__ */ o(J, { children: [
3734
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
3747
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: t }) }),
3735
3748
  /* @__PURE__ */ e(
3736
3749
  "h2",
3737
3750
  {
@@ -3740,7 +3753,7 @@ function gn({
3740
3753
  children: "Choose Ramp"
3741
3754
  }
3742
3755
  ),
3743
- /* @__PURE__ */ e(Ke, { value: c, onChange: m }),
3756
+ /* @__PURE__ */ e(Pe, { value: c, onChange: m }),
3744
3757
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
3745
3758
  r ? /* @__PURE__ */ e(sn, {}) : s.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: n && n.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : s.map((u, f) => {
3746
3759
  const h = f === 0, d = parseFloat(u.cryptoAmount), p = d >= 1 ? d.toFixed(4) : d.toPrecision(6);
@@ -3766,7 +3779,7 @@ function gn({
3766
3779
  /* @__PURE__ */ o("div", { className: "text-right shrink-0", children: [
3767
3780
  /* @__PURE__ */ e("div", { className: "text-[11px]", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
3768
3781
  /* @__PURE__ */ o("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
3769
- i,
3782
+ l,
3770
3783
  " ",
3771
3784
  p
3772
3785
  ] })
@@ -3795,19 +3808,19 @@ export {
3795
3808
  Xa as AnimatedDigit,
3796
3809
  Wa as AnimatedNumber,
3797
3810
  Ta as ApplePayIcon,
3798
- Oe as BLOCKCHAINS,
3811
+ Be as BLOCKCHAINS,
3799
3812
  Aa as BankIcon,
3800
- Ye as COUNTRIES,
3813
+ Ze as COUNTRIES,
3801
3814
  st as COUNTRY_MAP,
3802
3815
  wa as CRYPTO_CHAIN_COMBOS,
3803
3816
  Gt as CRYPTO_CURRENCIES,
3804
3817
  Fa as CardIcon,
3805
3818
  yn as CheckoutForm,
3806
3819
  Ka as CheckoutStep,
3807
- Pe as ChevronDown,
3820
+ He as ChevronDown,
3808
3821
  Pt as ChevronRight,
3809
3822
  gn as ChooseRampModal,
3810
- De as CloseButton,
3823
+ ke as CloseButton,
3811
3824
  pn as CoinifyIcon,
3812
3825
  ja as CompleteStep,
3813
3826
  $a as ConfirmStep,
@@ -3817,7 +3830,7 @@ export {
3817
3830
  Ia as DarkModeIcon,
3818
3831
  Ga as ErrorStep,
3819
3832
  Ft as FIAT_CURRENCIES,
3820
- Sa as FIAT_TO_COUNTRY,
3833
+ va as FIAT_TO_COUNTRY,
3821
3834
  Za as FiatCurrencyModal,
3822
3835
  ct as FiatFlag,
3823
3836
  Ya as FormSkeleton,
@@ -3825,7 +3838,7 @@ export {
3825
3838
  ka as GooglePayIcon,
3826
3839
  It as MOCK_RATES,
3827
3840
  Ma as MenuIcon,
3828
- He as Modal,
3841
+ Oe as Modal,
3829
3842
  La as PayPalIcon,
3830
3843
  Pa as PaymentMethodSelector,
3831
3844
  Va as ProcessingStep,
@@ -3833,9 +3846,9 @@ export {
3833
3846
  Ca as RampProvider,
3834
3847
  Ra as RevolutIcon,
3835
3848
  Mt as SKINS,
3836
- Ke as SearchInput,
3849
+ Pe as SearchInput,
3837
3850
  en as SettingsScreen,
3838
- _ as Skeleton,
3851
+ V as Skeleton,
3839
3852
  xn as SkinSwatch,
3840
3853
  Ja as ToggleSwitch,
3841
3854
  lt as formatOutput,
@@ -3849,7 +3862,7 @@ export {
3849
3862
  Ea as parseAmount,
3850
3863
  ya as useCheckoutIntent,
3851
3864
  pa as useQuotes,
3852
- Ue as useRamp,
3865
+ Te as useRamp,
3853
3866
  ha as useRampConfig,
3854
3867
  xa as useTransaction
3855
3868
  };