@nowramp/form 0.1.81 → 0.1.83

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 l, Fragment as ee } from "react/jsx-runtime";
12
- import Ce, { useState as N, useRef as I, useCallback as K, useEffect as Z, useMemo as G, useReducer as xa, useContext as va, createContext as ba } from "react";
12
+ import ge, { useState as N, useRef as I, useCallback as P, useEffect as Z, useMemo as j, useReducer as xa, useContext as va, createContext as ba } from "react";
13
13
  import { RampApi as at } from "@nowramp/sdk";
14
14
  import { createPortal as Pt } from "react-dom";
15
15
  function Sa(t, a, n) {
16
16
  const [r, o] = N(null), [d, u] = N(!0), [i, s] = N(null), m = I(null);
17
17
  (!m.current || m.current !== t) && (m.current = new at({ apiKey: "", ...t }));
18
- const h = K(async () => {
18
+ const h = P(async () => {
19
19
  if (!t.projectId) {
20
20
  s(new Error("projectId is required")), u(!1);
21
21
  return;
@@ -24,8 +24,8 @@ function Sa(t, a, n) {
24
24
  try {
25
25
  const f = {};
26
26
  a && (f.orderType = a), n && (f.country = n);
27
- const p = await m.current.getSupported(f);
28
- o(p);
27
+ const y = await m.current.getSupported(f);
28
+ o(y);
29
29
  } catch (f) {
30
30
  s(f instanceof Error ? f : new Error("Failed to fetch config"));
31
31
  } finally {
@@ -55,7 +55,7 @@ function Na(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 = K(async () => {
58
+ const y = P(async () => {
59
59
  if (!(!a || !t.projectId)) {
60
60
  d(!0), i(null);
61
61
  try {
@@ -68,15 +68,15 @@ function Na(t, a) {
68
68
  }
69
69
  }
70
70
  }, [t.projectId, a]);
71
- return { quotes: n, loading: o, error: u, refetch: p };
71
+ return { quotes: n, loading: o, error: u, refetch: y };
72
72
  }
73
73
  function wa(t) {
74
74
  const [a, n] = N(null), [r, o] = N(!1), [d, u] = N(null), i = I(null), s = I(""), m = `${t.apiUrl}|${t.projectId}`;
75
75
  (!i.current || s.current !== m) && (i.current = new at({ apiKey: "", ...t }), s.current = m);
76
- const h = K(async (p) => {
76
+ const h = P(async (y) => {
77
77
  o(!0), u(null);
78
78
  try {
79
- const x = await i.current.createCheckoutIntent(p);
79
+ const x = await i.current.createCheckoutIntent(y);
80
80
  return n(x), x;
81
81
  } catch (x) {
82
82
  const C = x instanceof Error ? x : new Error("Failed to create checkout intent");
@@ -84,7 +84,7 @@ function wa(t) {
84
84
  } finally {
85
85
  o(!1);
86
86
  }
87
- }, []), f = K(() => {
87
+ }, []), f = P(() => {
88
88
  n(null), u(null);
89
89
  }, []);
90
90
  return { order: a, loading: r, error: d, createOrder: h, reset: f };
@@ -92,7 +92,7 @@ function wa(t) {
92
92
  function Ea(t, a, n) {
93
93
  const [r, o] = N(null), [d, u] = N(!1), [i, s] = N(null), m = I(null);
94
94
  m.current || (m.current = new at({ apiKey: "", projectId: "", ...t }));
95
- const h = K(async () => {
95
+ const h = P(async () => {
96
96
  if (a) {
97
97
  u(!0), s(null);
98
98
  try {
@@ -109,15 +109,15 @@ function Ea(t, a, n) {
109
109
  if (!a) return;
110
110
  const f = (n == null ? void 0 : n.initialDelay) ?? 0;
111
111
  if (f > 0) {
112
- const p = setTimeout(h, f);
113
- return () => clearTimeout(p);
112
+ const y = setTimeout(h, f);
113
+ return () => clearTimeout(y);
114
114
  }
115
115
  h();
116
116
  }, [h, a, n == null ? void 0 : n.initialDelay]), Z(() => {
117
117
  if (!a || !(n != null && n.pollInterval) || !r || ["completed", "failed", "cancelled", "expired", "refunded"].includes(r.status))
118
118
  return;
119
- const p = setInterval(h, n.pollInterval);
120
- return () => clearInterval(p);
119
+ const y = setInterval(h, n.pollInterval);
120
+ return () => clearInterval(y);
121
121
  }, [a, n == null ? void 0 : n.pollInterval, r == null ? void 0 : r.status, h]), { status: r, loading: d, error: i, refetch: h };
122
122
  }
123
123
  const et = [
@@ -420,6 +420,19 @@ function Kt(t, a) {
420
420
  function Ua(t, a, n) {
421
421
  return !t && !!a && !a.bestQuote && !!n;
422
422
  }
423
+ function Fa(t, a) {
424
+ if (!t.length) return null;
425
+ if (a) {
426
+ const r = t.find((o) => o.gatewayId === a);
427
+ if (r != null && r.reason) return r.reason;
428
+ }
429
+ const n = t.map((r, o) => ({ reason: r.reason, score: r.reason ? Da(r.reason) : 99, idx: o })).filter((r) => r.reason);
430
+ return n.length ? (n.sort((r, o) => r.score - o.score || r.idx - o.idx), n[0].reason) : null;
431
+ }
432
+ function Da(t) {
433
+ const a = t.toLowerCase();
434
+ return /amount|out of range for|minimum|maximum/.test(a) ? 1 : /currency|pair|network|chain/.test(a) ? 2 : /country|region|location/.test(a) ? 3 : /does not support|unsupported/.test(a) ? 4 : 5;
435
+ }
423
436
  const Qt = {
424
437
  step: "amount",
425
438
  flowType: "buy",
@@ -439,7 +452,7 @@ const Qt = {
439
452
  countrySource: "",
440
453
  errorMessage: null
441
454
  };
442
- function Fa(t, a) {
455
+ function Ma(t, a) {
443
456
  var n, r, o, d, u, i, s, m;
444
457
  switch (a.type) {
445
458
  case "SET_STEP":
@@ -501,7 +514,7 @@ function Fa(t, a) {
501
514
  }
502
515
  }
503
516
  const zt = ba(null);
504
- function Da({
517
+ function Ia({
505
518
  projectId: t,
506
519
  apiUrl: a = "https://api.nowramp.com",
507
520
  assetBaseUrl: n = "",
@@ -514,15 +527,15 @@ function Da({
514
527
  defaultFiatAmount: m = "",
515
528
  defaultCryptoAmount: h = "",
516
529
  defaultWalletAddress: f = "",
517
- defaultGateway: p,
530
+ defaultGateway: y,
518
531
  defaultCountry: x,
519
532
  fieldLocks: C,
520
- statusPollInterval: A = 5e3,
533
+ statusPollInterval: E = 5e3,
521
534
  onComplete: k,
522
- onError: V,
523
- children: oe
535
+ onError: _,
536
+ children: ie
524
537
  }) {
525
- const $ = G(() => ({ apiUrl: a, projectId: t }), [a, t]), z = s || (i ? i.toLowerCase() : ""), te = r === "sell", X = te ? !!h : !!m, v = (te ? !!(X && i && z) : !!(X && i && z && f)) && p ? "confirm" : "amount", L = m || (r === "buy" ? "250" : ""), [c, U] = xa(Fa, {
538
+ const G = j(() => ({ apiUrl: a, projectId: t }), [a, t]), z = s || (i ? i.toLowerCase() : ""), te = r === "sell", X = te ? !!h : !!m, v = (te ? !!(X && i && z) : !!(X && i && z && f)) && y ? "confirm" : "amount", L = m || (r === "buy" ? "250" : ""), [c, U] = xa(Ma, {
526
539
  ...Qt,
527
540
  step: v,
528
541
  flowType: r,
@@ -538,75 +551,75 @@ function Da({
538
551
  }), w = c.flowType === "sell", {
539
552
  config: b,
540
553
  loading: J,
541
- error: ve
542
- } = Sa($, c.flowType, c.country || void 0), be = I(!1);
543
- Ce.useEffect(() => {
554
+ error: be
555
+ } = Sa(G, c.flowType, c.country || void 0), Se = I(!1);
556
+ ge.useEffect(() => {
544
557
  var F;
545
- if (be.current || !(b != null && b.detectedCountry) || c.country) return;
546
- be.current = !0;
547
- const y = b.detectedCountry.toLowerCase();
548
- U({ type: "SET_COUNTRY_AUTO", country: y });
549
- const E = (F = b.fiats) == null ? void 0 : F.map((M) => M.code), R = mt(y, E);
558
+ if (Se.current || !(b != null && b.detectedCountry) || c.country) return;
559
+ Se.current = !0;
560
+ const p = b.detectedCountry.toLowerCase();
561
+ U({ type: "SET_COUNTRY_AUTO", country: p });
562
+ const A = (F = b.fiats) == null ? void 0 : F.map((M) => M.code), R = mt(p, A);
550
563
  R !== c.fiatCurrency && U({ type: "SET_FIAT_CURRENCY", currency: R });
551
564
  }, [b, c.country, c.fiatCurrency]);
552
- const ce = I(!1);
553
- Ce.useEffect(() => {
565
+ const se = I(!1);
566
+ ge.useEffect(() => {
554
567
  var R;
555
- if (ce.current || !x || !((R = b == null ? void 0 : b.fiats) != null && R.length)) return;
556
- ce.current = !0;
557
- const y = b.fiats.map((F) => F.code), E = mt(x, y);
558
- E !== c.fiatCurrency && U({ type: "SET_FIAT_CURRENCY", currency: E });
568
+ if (se.current || !x || !((R = b == null ? void 0 : b.fiats) != null && R.length)) return;
569
+ se.current = !0;
570
+ const p = b.fiats.map((F) => F.code), A = mt(x, p);
571
+ A !== c.fiatCurrency && U({ type: "SET_FIAT_CURRENCY", currency: A });
559
572
  }, [x, b, c.fiatCurrency]);
560
573
  const pe = I(c.country);
561
- Ce.useEffect(() => {
574
+ ge.useEffect(() => {
562
575
  var R;
563
- if (c.country === pe.current || (pe.current = c.country, c.countrySource === "manual" && (de.current = !1), c.countrySource !== "manual") || !((R = b == null ? void 0 : b.fiats) != null && R.length)) return;
564
- const y = b.fiats.map((F) => F.code), E = mt(c.country, y);
565
- E !== c.fiatCurrency && U({ type: "SET_FIAT_CURRENCY", currency: E });
576
+ if (c.country === pe.current || (pe.current = c.country, c.countrySource === "manual" && (Ie.current = !1), c.countrySource !== "manual") || !((R = b == null ? void 0 : b.fiats) != null && R.length)) return;
577
+ const p = b.fiats.map((F) => F.code), A = mt(c.country, p);
578
+ A !== c.fiatCurrency && U({ type: "SET_FIAT_CURRENCY", currency: A });
566
579
  }, [c.country, c.countrySource, b, c.fiatCurrency]);
567
580
  const D = I(c.fiatCurrency);
568
- Ce.useEffect(() => {
581
+ ge.useEffect(() => {
569
582
  var F;
570
583
  if (c.fiatCurrency === D.current || (D.current = c.fiatCurrency, w || !((F = b == null ? void 0 : b.fiats) != null && F.length) || !c.fiatAmount)) return;
571
- const y = b.fiats.find((M) => M.code === c.fiatCurrency);
572
- if (!(y != null && y.minAmount)) return;
573
- const E = parseFloat(c.fiatAmount), R = parseFloat(y.minAmount);
574
- !isNaN(E) && !isNaN(R) && E < R && U({ type: "SET_FIAT_AMOUNT", amount: String(Math.ceil(R)) });
584
+ const p = b.fiats.find((M) => M.code === c.fiatCurrency);
585
+ if (!(p != null && p.minAmount)) return;
586
+ const A = parseFloat(c.fiatAmount), R = parseFloat(p.minAmount);
587
+ !isNaN(A) && !isNaN(R) && A < R && U({ type: "SET_FIAT_AMOUNT", amount: String(Math.ceil(R)) });
575
588
  }, [c.fiatCurrency, c.fiatAmount, b, w]);
576
- const { availableFiats: ae, availableCryptos: B, availablePaymentMethods: se } = G(() => {
589
+ const { availableFiats: ae, availableCryptos: O, availablePaymentMethods: de } = j(() => {
577
590
  var R, F, M;
578
591
  if (!b)
579
592
  return { availableFiats: [], availableCryptos: [], availablePaymentMethods: [] };
580
- let y;
593
+ let p;
581
594
  if (c.cryptoCurrency && c.network) {
582
- const T = (R = b.cryptos) == null ? void 0 : R.find((Y) => Y.code === c.cryptoCurrency), P = (F = T == null ? void 0 : T.networks) == null ? void 0 : F.find((Y) => Y.id === c.network);
583
- !T || !P ? y = [] : y = P.providers;
595
+ const T = (R = b.cryptos) == null ? void 0 : R.find((Y) => Y.code === c.cryptoCurrency), H = (F = T == null ? void 0 : T.networks) == null ? void 0 : F.find((Y) => Y.id === c.network);
596
+ !T || !H ? p = [] : p = H.providers;
584
597
  }
585
- let E;
598
+ let A;
586
599
  if (c.fiatCurrency) {
587
- const T = (M = b.fiats) == null ? void 0 : M.find((P) => P.code === c.fiatCurrency);
588
- T ? E = T.providers : E = [];
600
+ const T = (M = b.fiats) == null ? void 0 : M.find((H) => H.code === c.fiatCurrency);
601
+ T ? A = T.providers : A = [];
589
602
  }
590
603
  return {
591
- availableFiats: Aa(b.fiats ?? [], y),
592
- availableCryptos: Ra(b.cryptos ?? [], E),
604
+ availableFiats: Aa(b.fiats ?? [], p),
605
+ availableCryptos: Ra(b.cryptos ?? [], A),
593
606
  availablePaymentMethods: ka(
594
607
  b.paymentMethods ?? [],
595
- y,
608
+ p,
596
609
  c.fiatCurrency
597
610
  )
598
611
  };
599
- }, [b, c.cryptoCurrency, c.network, c.fiatCurrency]), Me = G(() => {
600
- var y, E, R;
612
+ }, [b, c.cryptoCurrency, c.network, c.fiatCurrency]), Me = j(() => {
613
+ var p, A, R;
601
614
  return J || !b ? !1 : La(
602
615
  b,
603
616
  { cryptoCurrency: c.cryptoCurrency, network: c.network, fiatCurrency: c.fiatCurrency },
604
617
  {
605
- cryptoLocked: !!((y = C == null ? void 0 : C.destinationCurrency) != null && y.locked),
606
- networkLocked: !!((E = C == null ? void 0 : C.network) != null && E.locked),
618
+ cryptoLocked: !!((p = C == null ? void 0 : C.destinationCurrency) != null && p.locked),
619
+ networkLocked: !!((A = C == null ? void 0 : C.network) != null && A.locked),
607
620
  fiatLocked: !!((R = C == null ? void 0 : C.sourceCurrency) != null && R.locked)
608
621
  },
609
- { availableFiats: ae, availableCryptos: B, availablePaymentMethods: se }
622
+ { availableFiats: ae, availableCryptos: O, availablePaymentMethods: de }
610
623
  );
611
624
  }, [
612
625
  J,
@@ -616,32 +629,32 @@ function Da({
616
629
  c.network,
617
630
  c.fiatCurrency,
618
631
  ae,
619
- B,
620
- se
632
+ O,
633
+ de
621
634
  ]);
622
- Ce.useEffect(() => {
623
- var E, R, F;
624
- if (J || ae.length === 0 && B.length === 0) return;
625
- const y = Ta(
635
+ ge.useEffect(() => {
636
+ var A, R, F;
637
+ if (J || ae.length === 0 && O.length === 0) return;
638
+ const p = Ta(
626
639
  {
627
640
  cryptoCurrency: c.cryptoCurrency,
628
641
  network: c.network,
629
642
  fiatCurrency: c.fiatCurrency,
630
643
  paymentMethodId: c.paymentMethodId
631
644
  },
632
- { availableFiats: ae, availableCryptos: B, availablePaymentMethods: se },
645
+ { availableFiats: ae, availableCryptos: O, availablePaymentMethods: de },
633
646
  {
634
- cryptoLocked: !!((E = C == null ? void 0 : C.destinationCurrency) != null && E.locked),
647
+ cryptoLocked: !!((A = C == null ? void 0 : C.destinationCurrency) != null && A.locked),
635
648
  networkLocked: !!((R = C == null ? void 0 : C.network) != null && R.locked),
636
649
  fiatLocked: !!((F = C == null ? void 0 : C.sourceCurrency) != null && F.locked)
637
650
  }
638
651
  );
639
- y && (y.cryptoCurrency !== void 0 && U({ type: "SET_CRYPTO_CURRENCY", currency: y.cryptoCurrency }), y.network !== void 0 && U({ type: "SET_NETWORK", network: y.network }), y.fiatCurrency !== void 0 && U({ type: "SET_FIAT_CURRENCY", currency: y.fiatCurrency }), y.paymentMethodId !== void 0 && U({ type: "SET_PAYMENT_METHOD", methodId: y.paymentMethodId }));
652
+ p && (p.cryptoCurrency !== void 0 && U({ type: "SET_CRYPTO_CURRENCY", currency: p.cryptoCurrency }), p.network !== void 0 && U({ type: "SET_NETWORK", network: p.network }), p.fiatCurrency !== void 0 && U({ type: "SET_FIAT_CURRENCY", currency: p.fiatCurrency }), p.paymentMethodId !== void 0 && U({ type: "SET_PAYMENT_METHOD", methodId: p.paymentMethodId }));
640
653
  }, [
641
654
  J,
642
655
  ae,
643
- B,
644
- se,
656
+ O,
657
+ de,
645
658
  c.cryptoCurrency,
646
659
  c.network,
647
660
  c.fiatCurrency,
@@ -649,22 +662,22 @@ function Da({
649
662
  C,
650
663
  U
651
664
  ]);
652
- const Q = G(() => {
665
+ const Q = j(() => {
653
666
  if (w) {
654
667
  if (!c.cryptoAmount) return null;
655
668
  const M = parseFloat(c.cryptoAmount);
656
669
  return isNaN(M) || M <= 0 ? "Enter a valid amount" : null;
657
670
  }
658
671
  if (!b || !c.fiatAmount) return null;
659
- const y = parseFloat(c.fiatAmount);
660
- if (isNaN(y)) return null;
661
- const E = b.fiats.find((M) => M.code === c.fiatCurrency);
662
- if (!E) return null;
663
- const R = parseFloat(E.minAmount), F = parseFloat(E.maxAmount);
664
- return !isNaN(R) && y < R ? `Minimum amount is ${E.minAmount} ${c.fiatCurrency}` : !isNaN(F) && y > F ? `Maximum amount is ${E.maxAmount} ${c.fiatCurrency}` : null;
665
- }, [b, c.fiatAmount, c.fiatCurrency, c.cryptoAmount, w]), ne = G(() => {
666
- const y = w ? !!c.cryptoAmount : !!c.fiatAmount;
667
- return !b || !y || !c.fiatCurrency || !c.cryptoCurrency || !c.network || Q || b.detectedCountry && c.countrySource === "" && !x ? null : {
672
+ const p = parseFloat(c.fiatAmount);
673
+ if (isNaN(p)) return null;
674
+ const A = b.fiats.find((M) => M.code === c.fiatCurrency);
675
+ if (!A) return null;
676
+ const R = parseFloat(A.minAmount), F = parseFloat(A.maxAmount);
677
+ return !isNaN(R) && p < R ? `Minimum amount is ${A.minAmount} ${c.fiatCurrency}` : !isNaN(F) && p > F ? `Maximum amount is ${A.maxAmount} ${c.fiatCurrency}` : null;
678
+ }, [b, c.fiatAmount, c.fiatCurrency, c.cryptoAmount, w]), ne = j(() => {
679
+ const p = w ? !!c.cryptoAmount : !!c.fiatAmount;
680
+ return !b || !p || !c.fiatCurrency || !c.cryptoCurrency || !c.network || Q || b.detectedCountry && c.countrySource === "" && !x ? null : {
668
681
  fiatCurrency: c.fiatCurrency,
669
682
  ...w ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
670
683
  cryptoCurrency: c.cryptoCurrency,
@@ -674,52 +687,54 @@ function Da({
674
687
  orderType: c.flowType
675
688
  };
676
689
  }, [b, c.fiatCurrency, c.fiatAmount, c.cryptoAmount, c.cryptoCurrency, c.network, c.paymentMethodId, c.country, c.countrySource, Q, w, c.flowType, x]), {
677
- quotes: O,
678
- loading: Ae,
679
- error: ie,
680
- refetch: $e
681
- } = Na($, ne), Re = Ua(Ae, O, ne), rt = G(() => !Re || !(O != null && O.unavailableGateways) ? [] : [...new Set(
682
- O.unavailableGateways.map((E) => E.reason).filter(Boolean)
683
- )].slice(0, 2), [Re, O]), de = I(!1);
684
- Ce.useEffect(() => {
685
- de.current || c.countrySource === "auto" && (Ae || !ne || ie || !O || O.bestQuote || c.fiatCurrency !== "USD" && (de.current = !0, U({ type: "SET_FIAT_CURRENCY", currency: "USD" }), U({ type: "SET_FIAT_AMOUNT", amount: "250" })));
686
- }, [O, Ae, ie, ne, c.countrySource, c.fiatCurrency]);
690
+ quotes: B,
691
+ loading: Re,
692
+ error: le,
693
+ refetch: We
694
+ } = Na(G, ne), ke = Ua(Re, B, ne), Ie = I(!1);
695
+ ge.useEffect(() => {
696
+ Ie.current || c.countrySource === "auto" && (Re || !ne || le || !B || B.bestQuote || c.fiatCurrency !== "USD" && (Ie.current = !0, U({ type: "SET_FIAT_CURRENCY", currency: "USD" }), U({ type: "SET_FIAT_AMOUNT", amount: "250" })));
697
+ }, [B, Re, le, ne, c.countrySource, c.fiatCurrency]);
687
698
  const {
688
- order: H,
689
- loading: Ie,
690
- error: ke,
699
+ order: ce,
700
+ loading: $,
701
+ error: Ne,
691
702
  createOrder: Be
692
- } = wa($), We = 15e3, {
693
- status: le,
694
- loading: Xe
703
+ } = wa(G), Xe = 15e3, {
704
+ status: re,
705
+ loading: rt
695
706
  } = Ea(
696
707
  { apiUrl: a },
697
- (H == null ? void 0 : H.orderId) ?? null,
698
- { pollInterval: A, initialDelay: We }
708
+ (ce == null ? void 0 : ce.orderId) ?? null,
709
+ { pollInterval: E, initialDelay: Xe }
699
710
  );
700
- Ce.useEffect(() => {
701
- (le == null ? void 0 : le.status) === "completed" && k && k(le);
702
- }, [le == null ? void 0 : le.status, k]), Ce.useEffect(() => {
703
- const y = ve || ke;
704
- y && V && V(y);
705
- }, [ve, ke, V]);
706
- const Se = p || (b == null ? void 0 : b.defaultGateway) || null, Oe = I(Se);
707
- Oe.current = Se;
708
- const Ye = I(O);
709
- Ye.current = O;
711
+ ge.useEffect(() => {
712
+ (re == null ? void 0 : re.status) === "completed" && k && k(re);
713
+ }, [re == null ? void 0 : re.status, k]), ge.useEffect(() => {
714
+ const p = be || Ne;
715
+ p && _ && _(p);
716
+ }, [be, Ne, _]);
717
+ const ye = y || (b == null ? void 0 : b.defaultGateway) || null, Oe = j(() => {
718
+ if (!ke || !(B != null && B.unavailableGateways)) return null;
719
+ const p = B.preferredGatewayId || ye;
720
+ return Fa(B.unavailableGateways, p);
721
+ }, [ke, B, ye]), He = I(ye);
722
+ He.current = ye;
723
+ const Ye = I(B);
724
+ Ye.current = B;
710
725
  const ue = I(d);
711
726
  ue.current = d;
712
- const He = K(async () => {
713
- var E, R, F;
714
- const y = ((E = c.selectedQuote) == null ? void 0 : E.gatewayId) || ((F = (R = Ye.current) == null ? void 0 : R.bestQuote) == null ? void 0 : F.gatewayId) || Oe.current;
715
- if (!y || !c.walletAddress) {
716
- const M = [!y && "gateway", !c.walletAddress && "walletAddress"].filter(Boolean).join(", ");
727
+ const Pe = P(async () => {
728
+ var A, R, F;
729
+ const p = ((A = c.selectedQuote) == null ? void 0 : A.gatewayId) || ((F = (R = Ye.current) == null ? void 0 : R.bestQuote) == null ? void 0 : F.gatewayId) || He.current;
730
+ if (!p || !c.walletAddress) {
731
+ const M = [!p && "gateway", !c.walletAddress && "walletAddress"].filter(Boolean).join(", ");
717
732
  U({ type: "SET_ERROR", message: `Missing required fields: ${M}` });
718
733
  return;
719
734
  }
720
735
  try {
721
736
  await Be({
722
- gateway: y,
737
+ gateway: p,
723
738
  customerId: c.customerId || void 0,
724
739
  fiatCurrency: c.fiatCurrency,
725
740
  ...w ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
@@ -735,18 +750,18 @@ function Da({
735
750
  const T = M instanceof Error ? M.message : "Failed to create order";
736
751
  /wallet|address/i.test(T) ? U({ type: "SET_WALLET_ERROR", message: T.replace(/^Failed to create checkout intent:\s*/i, "") }) : U({ type: "SET_ERROR", message: T });
737
752
  }
738
- }, [c, Be, w]), ot = K((y) => {
739
- U({ type: "SET_STEP", step: y });
740
- }, []), it = K(() => {
741
- const y = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], E = y.indexOf(c.step);
742
- E > 0 && U({ type: "SET_STEP", step: y[E - 1] });
743
- }, [c.step, w]), Ze = G(() => {
744
- const y = w ? !!c.cryptoAmount : !!c.fiatAmount;
753
+ }, [c, Be, w]), ot = P((p) => {
754
+ U({ type: "SET_STEP", step: p });
755
+ }, []), it = P(() => {
756
+ const p = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], A = p.indexOf(c.step);
757
+ A > 0 && U({ type: "SET_STEP", step: p[A - 1] });
758
+ }, [c.step, w]), Ze = j(() => {
759
+ const p = w ? !!c.cryptoAmount : !!c.fiatAmount;
745
760
  switch (c.step) {
746
761
  case "confirm":
747
- return !!(y && c.cryptoCurrency && c.network && c.walletAddress && !Q);
762
+ return !!(p && c.cryptoCurrency && c.network && c.walletAddress && !Q);
748
763
  case "amount":
749
- return !!(y && c.cryptoCurrency && c.network && !Q);
764
+ return !!(p && c.cryptoCurrency && c.network && !Q);
750
765
  case "quotes":
751
766
  return !!c.selectedQuote;
752
767
  case "wallet":
@@ -755,37 +770,37 @@ function Da({
755
770
  return !1;
756
771
  }
757
772
  }, [c, Q, w]), me = {
758
- apiConfig: $,
773
+ apiConfig: G,
759
774
  assetBaseUrl: n,
760
775
  config: b,
761
776
  configLoading: J,
762
- configError: ve,
777
+ configError: be,
763
778
  state: c,
764
779
  dispatch: U,
765
- quotes: O,
766
- quotesLoading: Ae,
767
- quotesError: ie,
768
- fetchQuotes: $e,
769
- order: H,
770
- orderLoading: Ie,
771
- orderError: ke,
772
- createOrder: He,
773
- orderStatus: le,
774
- orderStatusLoading: Xe,
780
+ quotes: B,
781
+ quotesLoading: Re,
782
+ quotesError: le,
783
+ fetchQuotes: We,
784
+ order: ce,
785
+ orderLoading: $,
786
+ orderError: Ne,
787
+ createOrder: Pe,
788
+ orderStatus: re,
789
+ orderStatusLoading: rt,
775
790
  fieldLocks: C || null,
776
- defaultGateway: Se,
791
+ defaultGateway: ye,
777
792
  availableFiats: ae,
778
- availableCryptos: B,
779
- availablePaymentMethods: se,
793
+ availableCryptos: O,
794
+ availablePaymentMethods: de,
780
795
  selectionUnsupported: Me,
781
- quotesEmpty: Re,
782
- unavailableReasons: rt,
796
+ quotesEmpty: ke,
797
+ bestUnavailableReason: Oe,
783
798
  amountError: Q,
784
799
  goToStep: ot,
785
800
  goBack: it,
786
801
  canProceed: Ze
787
802
  };
788
- return /* @__PURE__ */ e(zt.Provider, { value: me, children: oe });
803
+ return /* @__PURE__ */ e(zt.Provider, { value: me, children: ie });
789
804
  }
790
805
  function Fe() {
791
806
  const t = va(zt);
@@ -793,7 +808,7 @@ function Fe() {
793
808
  throw new Error("useRamp must be used within a RampProvider");
794
809
  return t;
795
810
  }
796
- const _e = {
811
+ const Ve = {
797
812
  // Canonical IDs (returned by the API — lowercase full names)
798
813
  // These cover cases where the canonical ID differs from the legacy uppercase key
799
814
  ethereum: { name: "Ethereum (ERC20)", shortName: "Ethereum", icon: "eth" },
@@ -1148,9 +1163,9 @@ const _e = {
1148
1163
  { code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
1149
1164
  { code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
1150
1165
  { code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
1151
- ], Ma = Object.fromEntries(
1166
+ ], Ba = Object.fromEntries(
1152
1167
  Jt.map((t) => [t.code, t.name])
1153
- ), Ia = {
1168
+ ), Oa = {
1154
1169
  AED: "ae",
1155
1170
  ALL: "al",
1156
1171
  ARS: "ar",
@@ -1188,12 +1203,12 @@ const _e = {
1188
1203
  function qt(t, a = "") {
1189
1204
  return `${a}/crypto-icons/${t.toLowerCase()}.svg`;
1190
1205
  }
1191
- function Ba(t, a = "") {
1192
- const n = Ia[t] || "us";
1206
+ function Ha(t, a = "") {
1207
+ const n = Oa[t] || "us";
1193
1208
  return `${a}/flags/${n}.svg`;
1194
1209
  }
1195
1210
  function tt(t) {
1196
- return _e[t] || _e[t.toLowerCase()] || _e[t.toUpperCase()] || _e[t.toUpperCase().replace(/-/g, "_")] || _e[t.toLowerCase().replace(/-/g, "_")];
1211
+ return Ve[t] || Ve[t.toLowerCase()] || Ve[t.toUpperCase()] || Ve[t.toUpperCase().replace(/-/g, "_")] || Ve[t.toLowerCase().replace(/-/g, "_")];
1197
1212
  }
1198
1213
  function ft(t, a = "") {
1199
1214
  const n = tt(t);
@@ -1228,7 +1243,7 @@ const _t = [
1228
1243
  XRP: { USD: 0.4081, EUR: 0.4432, GBP: 0.5153, JPY: 273e-5, CAD: 0.2948, AUD: 0.2614, BRL: 0.0707, CHF: 0.463, MXN: 0.01992, INR: 486e-5, ARS: 35e-5, ALL: 433e-5 },
1229
1244
  DOGE: { USD: 3.896, EUR: 4.232, GBP: 4.92, JPY: 0.02607, CAD: 2.815, AUD: 2.496, BRL: 0.675, CHF: 4.421, MXN: 0.1902, INR: 0.04641, ARS: 3345e-6, ALL: 0.04134 },
1230
1245
  ADA: { USD: 1.333, EUR: 1.448, GBP: 1.683, JPY: 892e-5, CAD: 0.963, AUD: 0.854, BRL: 0.2309, CHF: 1.512, MXN: 0.0651, INR: 0.01588, ARS: 1145e-6, ALL: 0.01414 }
1231
- }, Oa = /* @__PURE__ */ new Set([
1246
+ }, Pa = /* @__PURE__ */ new Set([
1232
1247
  "USDC",
1233
1248
  "USDT",
1234
1249
  "DAI",
@@ -1256,13 +1271,13 @@ const _t = [
1256
1271
  "ZCHF"
1257
1272
  ]);
1258
1273
  function ea(t) {
1259
- return Oa.has(t.toUpperCase());
1274
+ return Pa.has(t.toUpperCase());
1260
1275
  }
1261
- function kn(t, a) {
1276
+ function Ln(t, a) {
1262
1277
  var n, r;
1263
1278
  return ((n = jt[t]) == null ? void 0 : n[a]) ?? ((r = jt.USDC) == null ? void 0 : r[a]) ?? 1;
1264
1279
  }
1265
- function Ha(t) {
1280
+ function Ka(t) {
1266
1281
  return parseFloat(t.replace(/,/g, "")) || 0;
1267
1282
  }
1268
1283
  function ht(t) {
@@ -1273,7 +1288,7 @@ function ht(t) {
1273
1288
  const a = t.toPrecision(4);
1274
1289
  return parseFloat(a).toString();
1275
1290
  }
1276
- const he = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), Gt = 10, $t = 1e-4, Pa = (() => {
1291
+ const he = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), Gt = 10, $t = 1e-4, _a = (() => {
1277
1292
  const t = [];
1278
1293
  for (const a of Jt)
1279
1294
  for (const n of a.chains)
@@ -1289,7 +1304,7 @@ function ta({
1289
1304
  }) {
1290
1305
  const [d, u] = N(!1), [i, s] = N(!1), m = I(t);
1291
1306
  m.current !== t && (m.current = t, u(!1), s(!1));
1292
- const h = K(() => u(!0), []), f = K(() => s(!0), []);
1307
+ const h = P(() => u(!0), []), f = P(() => s(!0), []);
1293
1308
  return /* @__PURE__ */ l(
1294
1309
  "div",
1295
1310
  {
@@ -1346,7 +1361,7 @@ function pt({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
1346
1361
  return /* @__PURE__ */ e(
1347
1362
  ta,
1348
1363
  {
1349
- src: Ba(t, n),
1364
+ src: Ha(t, n),
1350
1365
  alt: t,
1351
1366
  size: a
1352
1367
  }
@@ -1358,7 +1373,7 @@ function gt({ size: t = 32, color: a = "#888" }) {
1358
1373
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "8", stroke: "white", strokeWidth: "1.5", fill: "none" })
1359
1374
  ] });
1360
1375
  }
1361
- function Ka({ size: t = 24 }) {
1376
+ function Va({ size: t = 24 }) {
1362
1377
  return /* @__PURE__ */ e(
1363
1378
  "div",
1364
1379
  {
@@ -1375,7 +1390,7 @@ function Ka({ size: t = 24 }) {
1375
1390
  }
1376
1391
  );
1377
1392
  }
1378
- function _a({ size: t = 32 }) {
1393
+ function ja({ size: t = 32 }) {
1379
1394
  return /* @__PURE__ */ e(
1380
1395
  "div",
1381
1396
  {
@@ -1385,7 +1400,7 @@ function _a({ size: t = 32 }) {
1385
1400
  }
1386
1401
  );
1387
1402
  }
1388
- function Va({ size: t = 32 }) {
1403
+ function Ga({ size: t = 32 }) {
1389
1404
  return /* @__PURE__ */ e(
1390
1405
  "div",
1391
1406
  {
@@ -1401,7 +1416,7 @@ function Va({ size: t = 32 }) {
1401
1416
  }
1402
1417
  );
1403
1418
  }
1404
- function ja({ size: t = 32 }) {
1419
+ function $a({ size: t = 32 }) {
1405
1420
  return /* @__PURE__ */ e(
1406
1421
  "div",
1407
1422
  {
@@ -1416,7 +1431,7 @@ function ja({ size: t = 32 }) {
1416
1431
  }
1417
1432
  );
1418
1433
  }
1419
- function Ga({ size: t = 32 }) {
1434
+ function Wa({ size: t = 32 }) {
1420
1435
  return /* @__PURE__ */ e(
1421
1436
  "div",
1422
1437
  {
@@ -1426,7 +1441,7 @@ function Ga({ size: t = 32 }) {
1426
1441
  }
1427
1442
  );
1428
1443
  }
1429
- function $a({ size: t = 32 }) {
1444
+ function Xa({ size: t = 32 }) {
1430
1445
  return /* @__PURE__ */ e(
1431
1446
  "div",
1432
1447
  {
@@ -1442,7 +1457,7 @@ function $a({ size: t = 32 }) {
1442
1457
  }
1443
1458
  );
1444
1459
  }
1445
- function Wa({ size: t = 32 }) {
1460
+ function Ya({ size: t = 32 }) {
1446
1461
  const a = t * 0.8;
1447
1462
  return /* @__PURE__ */ e(
1448
1463
  "div",
@@ -1457,7 +1472,7 @@ function Wa({ size: t = 32 }) {
1457
1472
  }
1458
1473
  );
1459
1474
  }
1460
- function Xa({ size: t = 32 }) {
1475
+ function Za({ size: t = 32 }) {
1461
1476
  const a = t * 0.56, n = a * 0.65, r = Math.max(2, a * 0.1), o = a * 0.2;
1462
1477
  return /* @__PURE__ */ l("div", { className: "flex items-center justify-center shrink-0", style: { width: t, height: t }, children: [
1463
1478
  /* @__PURE__ */ e(
@@ -1508,7 +1523,7 @@ function Xa({ size: t = 32 }) {
1508
1523
  )
1509
1524
  ] });
1510
1525
  }
1511
- function Tn({ size: t = 18 }) {
1526
+ function Un({ size: t = 18 }) {
1512
1527
  return /* @__PURE__ */ e(
1513
1528
  "div",
1514
1529
  {
@@ -1518,13 +1533,13 @@ function Tn({ size: t = 18 }) {
1518
1533
  }
1519
1534
  );
1520
1535
  }
1521
- function je() {
1536
+ function Ge() {
1522
1537
  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" }) });
1523
1538
  }
1524
1539
  function Xt() {
1525
1540
  return /* @__PURE__ */ e("svg", { width: "8", height: "14", viewBox: "0 0 8 14", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L7 7L1 13", stroke: "var(--t-icon-stroke)", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
1526
1541
  }
1527
- function Ya({ onClick: t }) {
1542
+ function Qa({ onClick: t }) {
1528
1543
  return /* @__PURE__ */ e("button", { onClick: t, className: "hover:opacity-70 transition-opacity", children: /* @__PURE__ */ e("svg", { width: "24", height: "16", viewBox: "0 0 24 16", fill: "none", children: /* @__PURE__ */ e(
1529
1544
  "path",
1530
1545
  {
@@ -1533,7 +1548,7 @@ function Ya({ onClick: t }) {
1533
1548
  }
1534
1549
  ) }) });
1535
1550
  }
1536
- function Za({ size: t = 40 }) {
1551
+ function za({ size: t = 40 }) {
1537
1552
  return /* @__PURE__ */ e(
1538
1553
  "div",
1539
1554
  {
@@ -1546,29 +1561,29 @@ function Za({ size: t = 40 }) {
1546
1561
  }
1547
1562
  );
1548
1563
  }
1549
- function Qa(t, a = 32) {
1564
+ function Ja(t, a = 32) {
1550
1565
  switch (t) {
1551
1566
  case "revolut":
1552
- return /* @__PURE__ */ e(_a, { size: a });
1567
+ return /* @__PURE__ */ e(ja, { size: a });
1553
1568
  case "applepay":
1554
- return /* @__PURE__ */ e(Va, { size: a });
1569
+ return /* @__PURE__ */ e(Ga, { size: a });
1555
1570
  case "card":
1556
- return /* @__PURE__ */ e(Xa, { size: a });
1571
+ return /* @__PURE__ */ e(Za, { size: a });
1557
1572
  case "googlepay":
1558
- return /* @__PURE__ */ e(ja, { size: a });
1573
+ return /* @__PURE__ */ e($a, { size: a });
1559
1574
  case "paypal":
1560
- return /* @__PURE__ */ e(Ga, { size: a });
1575
+ return /* @__PURE__ */ e(Wa, { size: a });
1561
1576
  case "bank":
1562
- return /* @__PURE__ */ e(Ka, { size: a });
1577
+ return /* @__PURE__ */ e(Va, { size: a });
1563
1578
  case "visa":
1564
- return /* @__PURE__ */ e($a, { size: a });
1579
+ return /* @__PURE__ */ e(Xa, { size: a });
1565
1580
  case "mastercard":
1566
- return /* @__PURE__ */ e(Wa, { size: a });
1581
+ return /* @__PURE__ */ e(Ya, { size: a });
1567
1582
  default:
1568
1583
  return /* @__PURE__ */ e(gt, { size: a });
1569
1584
  }
1570
1585
  }
1571
- const za = {
1586
+ const qa = {
1572
1587
  "debit-credit-card": "card",
1573
1588
  "bank-transfer": "bank",
1574
1589
  "ach-bank-transfer": "bank",
@@ -1579,7 +1594,7 @@ const za = {
1579
1594
  "google-pay": "googlepay",
1580
1595
  paypal: "paypal",
1581
1596
  revolut: "revolut"
1582
- }, Ja = {
1597
+ }, en = {
1583
1598
  "debit-credit-card": "Card",
1584
1599
  "bank-transfer": "Bank Transfer",
1585
1600
  "ach-bank-transfer": "ACH",
@@ -1590,19 +1605,19 @@ const za = {
1590
1605
  revolut: "Revolut"
1591
1606
  };
1592
1607
  function aa(t, a) {
1593
- return Ja[t] || a;
1608
+ return en[t] || a;
1594
1609
  }
1595
1610
  function na(t, a, n = 24) {
1596
- const r = za[t];
1597
- return r ? Qa(r, n) : a ? /* @__PURE__ */ e("img", { src: a, alt: "", width: n, height: n, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e(gt, { size: n });
1611
+ const r = qa[t];
1612
+ return r ? Ja(r, n) : a ? /* @__PURE__ */ e("img", { src: a, alt: "", width: n, height: n, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e(gt, { size: n });
1598
1613
  }
1599
- function qa({
1614
+ function tn({
1600
1615
  methods: t,
1601
1616
  selectedId: a,
1602
1617
  onOpenModal: n,
1603
1618
  fiatCurrency: r
1604
1619
  }) {
1605
- const o = G(
1620
+ const o = j(
1606
1621
  () => t.filter((u) => u.supportedFiats.includes(r)),
1607
1622
  [t, r]
1608
1623
  ), d = o.find((u) => u.id === a) || o[0];
@@ -1642,18 +1657,18 @@ function qa({
1642
1657
  /* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
1643
1658
  /* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: d && na(d.id, d.icon, 20) }),
1644
1659
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: d ? aa(d.id, d.name) : "Select" }),
1645
- /* @__PURE__ */ e(je, {})
1660
+ /* @__PURE__ */ e(Ge, {})
1646
1661
  ] })
1647
1662
  ]
1648
1663
  }
1649
1664
  ) });
1650
1665
  }
1651
- function en({
1666
+ function an({
1652
1667
  className: t = "",
1653
1668
  autoRedirect: a = !1,
1654
1669
  redirectDelay: n = 3e3
1655
1670
  }) {
1656
- var p;
1671
+ var y;
1657
1672
  const { order: r, orderStatus: o, goToStep: d, goBack: u } = Fe(), [i, s] = N(!1), [m, h] = N(null), f = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1658
1673
  if (Z(() => {
1659
1674
  if ((r == null ? void 0 : r.checkout.method) === "redirect" && a && !f) {
@@ -1661,7 +1676,7 @@ function en({
1661
1676
  const x = setTimeout(() => {
1662
1677
  window.location.href = r.checkout.url;
1663
1678
  }, n), C = setInterval(() => {
1664
- h((A) => A && A > 1 ? A - 1 : null);
1679
+ h((E) => E && E > 1 ? E - 1 : null);
1665
1680
  }, 1e3);
1666
1681
  return () => {
1667
1682
  clearTimeout(x), clearInterval(C);
@@ -1723,7 +1738,7 @@ function en({
1723
1738
  }
1724
1739
  );
1725
1740
  if (r.checkout.method === "iframe") {
1726
- const x = r.checkout.url, C = ((p = r.checkout.allowedFeatures) == null ? void 0 : p.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
1741
+ const x = r.checkout.url, C = ((y = r.checkout.allowedFeatures) == null ? void 0 : y.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
1727
1742
  return Pt(
1728
1743
  /* @__PURE__ */ l(
1729
1744
  "div",
@@ -1871,7 +1886,7 @@ function en({
1871
1886
  }
1872
1887
  );
1873
1888
  if (r.checkout.method === "widget" && r.widgetConfig) {
1874
- const x = tn(r.checkout.url, r.widgetConfig);
1889
+ const x = nn(r.checkout.url, r.widgetConfig);
1875
1890
  return Pt(
1876
1891
  /* @__PURE__ */ l(
1877
1892
  "div",
@@ -1989,13 +2004,13 @@ function en({
1989
2004
  }
1990
2005
  );
1991
2006
  }
1992
- function tn(t, a) {
2007
+ function nn(t, a) {
1993
2008
  const n = new URL("/en/partner/widget", t);
1994
2009
  for (const [r, o] of Object.entries(a))
1995
2010
  o != null && o !== "" && n.searchParams.set(r, String(o));
1996
2011
  return n.toString();
1997
2012
  }
1998
- function an({ className: t = "" }) {
2013
+ function rn({ className: t = "" }) {
1999
2014
  const { orderStatus: a, orderStatusLoading: n, goToStep: r } = Fe();
2000
2015
  Z(() => {
2001
2016
  a && (a.status === "completed" ? r("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && r("error"));
@@ -2068,7 +2083,7 @@ function Ue({ label: t, value: a, mono: n }) {
2068
2083
  }
2069
2084
  );
2070
2085
  }
2071
- function nn({
2086
+ function on({
2072
2087
  className: t = "",
2073
2088
  explorerUrl: a,
2074
2089
  onDone: n,
@@ -2107,7 +2122,7 @@ function nn({
2107
2122
  /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: i ? `Your ${(o == null ? void 0 : o.fiatCurrency) || d.fiatCurrency} payout is being processed.` : `Your ${(o == null ? void 0 : o.cryptoCurrency) || d.cryptoCurrency} has been sent to your wallet.` }),
2108
2123
  o && /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
2109
2124
  /* @__PURE__ */ e(
2110
- ge,
2125
+ xe,
2111
2126
  {
2112
2127
  label: i ? "Amount Sold" : "Amount Received",
2113
2128
  value: `${o.cryptoAmount} ${o.cryptoCurrency}`,
@@ -2115,15 +2130,15 @@ function nn({
2115
2130
  }
2116
2131
  ),
2117
2132
  /* @__PURE__ */ e(
2118
- ge,
2133
+ xe,
2119
2134
  {
2120
2135
  label: i ? "Payout Amount" : "Amount Paid",
2121
2136
  value: `${o.fiatAmount} ${o.fiatCurrency}`
2122
2137
  }
2123
2138
  ),
2124
- /* @__PURE__ */ e(ge, { label: "Network", value: o.network }),
2139
+ /* @__PURE__ */ e(xe, { label: "Network", value: o.network }),
2125
2140
  /* @__PURE__ */ e(
2126
- ge,
2141
+ xe,
2127
2142
  {
2128
2143
  label: "Wallet",
2129
2144
  value: `${o.walletAddress.slice(0, 10)}...${o.walletAddress.slice(-8)}`,
@@ -2131,17 +2146,17 @@ function nn({
2131
2146
  }
2132
2147
  ),
2133
2148
  o.transactionHash && /* @__PURE__ */ e(
2134
- ge,
2149
+ xe,
2135
2150
  {
2136
2151
  label: "Transaction",
2137
2152
  value: `${o.transactionHash.slice(0, 10)}...${o.transactionHash.slice(-8)}`,
2138
2153
  mono: !0
2139
2154
  }
2140
2155
  ),
2141
- /* @__PURE__ */ e(ge, { label: "Provider", value: o.gateway }),
2142
- /* @__PURE__ */ e(ge, { label: "Order ID", value: o.orderId, mono: !0 }),
2156
+ /* @__PURE__ */ e(xe, { label: "Provider", value: o.gateway }),
2157
+ /* @__PURE__ */ e(xe, { label: "Order ID", value: o.orderId, mono: !0 }),
2143
2158
  o.completedAt && /* @__PURE__ */ e(
2144
- ge,
2159
+ xe,
2145
2160
  {
2146
2161
  label: "Completed",
2147
2162
  value: new Date(o.completedAt).toLocaleString()
@@ -2172,7 +2187,7 @@ function nn({
2172
2187
  ] })
2173
2188
  ] });
2174
2189
  }
2175
- function ge({ label: t, value: a, mono: n, highlight: r }) {
2190
+ function xe({ label: t, value: a, mono: n, highlight: r }) {
2176
2191
  return /* @__PURE__ */ l(
2177
2192
  "div",
2178
2193
  {
@@ -2192,7 +2207,7 @@ function ge({ label: t, value: a, mono: n, highlight: r }) {
2192
2207
  }
2193
2208
  );
2194
2209
  }
2195
- function rn({
2210
+ function ln({
2196
2211
  className: t = "",
2197
2212
  onRetry: a,
2198
2213
  supportEmail: n = "support@nowramp.com"
@@ -2292,7 +2307,7 @@ function rn({
2292
2307
  function Yt(t) {
2293
2308
  return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
2294
2309
  }
2295
- function on({ className: t = "", stablecoinParity: a, partnerName: n }) {
2310
+ function cn({ className: t = "", stablecoinParity: a, partnerName: n }) {
2296
2311
  var te;
2297
2312
  const {
2298
2313
  config: r,
@@ -2303,13 +2318,13 @@ function on({ className: t = "", stablecoinParity: a, partnerName: n }) {
2303
2318
  fetchQuotes: s,
2304
2319
  createOrder: m,
2305
2320
  orderLoading: h
2306
- } = Fe(), f = d.flowType === "sell", [p, x] = N(null), C = r == null ? void 0 : r.gateways.find((X) => X.id === u), A = (te = i == null ? void 0 : i.bestQuote) != null && te.exchangeRate ? parseFloat(i.bestQuote.exchangeRate) : null, k = parseFloat(d.fiatAmount) || 0, V = !!(a && n && !f && ea(d.cryptoCurrency) && A), oe = V && d.cryptoCurrency.toUpperCase().includes(d.fiatCurrency.toUpperCase()), $ = V && k > 0 ? ht(oe ? k : k / A) : null, z = async () => {
2321
+ } = Fe(), f = d.flowType === "sell", [y, x] = N(null), C = r == null ? void 0 : r.gateways.find((X) => X.id === u), E = (te = i == null ? void 0 : i.bestQuote) != null && te.exchangeRate ? parseFloat(i.bestQuote.exchangeRate) : null, k = parseFloat(d.fiatAmount) || 0, _ = !!(a && n && !f && ea(d.cryptoCurrency) && E), ie = _ && d.cryptoCurrency.toUpperCase().includes(d.fiatCurrency.toUpperCase()), G = _ && k > 0 ? ht(ie ? k : k / E) : null, z = async () => {
2307
2322
  x(null);
2308
2323
  try {
2309
2324
  s(), await m();
2310
2325
  } catch (X) {
2311
- const xe = X instanceof Error ? X.message : "Failed to create order";
2312
- x(xe);
2326
+ const ve = X instanceof Error ? X.message : "Failed to create order";
2327
+ x(ve);
2313
2328
  }
2314
2329
  };
2315
2330
  return o ? /* @__PURE__ */ l("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
@@ -2326,21 +2341,21 @@ function on({ className: t = "", stablecoinParity: a, partnerName: n }) {
2326
2341
  ] })
2327
2342
  ] }),
2328
2343
  f ? /* @__PURE__ */ l(ee, { children: [
2329
- /* @__PURE__ */ e(Ee, { label: "You sell", value: `${d.cryptoAmount} ${d.cryptoCurrency}`, highlight: !0 }),
2330
- /* @__PURE__ */ e(Ee, { label: "You receive", value: `${d.fiatCurrency} payout` })
2344
+ /* @__PURE__ */ e(Ae, { label: "You sell", value: `${d.cryptoAmount} ${d.cryptoCurrency}`, highlight: !0 }),
2345
+ /* @__PURE__ */ e(Ae, { label: "You receive", value: `${d.fiatCurrency} payout` })
2331
2346
  ] }) : /* @__PURE__ */ l(ee, { children: [
2332
- /* @__PURE__ */ e(Ee, { label: "You pay", value: `${d.fiatAmount} ${d.fiatCurrency}`, highlight: !0 }),
2347
+ /* @__PURE__ */ e(Ae, { label: "You pay", value: `${d.fiatAmount} ${d.fiatCurrency}`, highlight: !0 }),
2333
2348
  /* @__PURE__ */ e(
2334
- Ee,
2349
+ Ae,
2335
2350
  {
2336
2351
  label: "You receive",
2337
- value: $ ? `${$} ${d.cryptoCurrency}` : `${d.cryptoCurrency} on ${d.network}`
2352
+ value: G ? `${G} ${d.cryptoCurrency}` : `${d.cryptoCurrency} on ${d.network}`
2338
2353
  }
2339
2354
  ),
2340
- /* @__PURE__ */ e(Ee, { label: "Wallet", value: Yt(d.walletAddress), mono: !0 }),
2341
- V && $ && /* @__PURE__ */ l("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: [
2355
+ /* @__PURE__ */ e(Ae, { label: "Wallet", value: Yt(d.walletAddress), mono: !0 }),
2356
+ _ && G && /* @__PURE__ */ l("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: [
2342
2357
  "Charged amount from provider may differ. The rest up to ",
2343
- $,
2358
+ G,
2344
2359
  " ",
2345
2360
  d.cryptoCurrency,
2346
2361
  " will be credited to your ",
@@ -2348,10 +2363,10 @@ function on({ className: t = "", stablecoinParity: a, partnerName: n }) {
2348
2363
  " account."
2349
2364
  ] })
2350
2365
  ] }),
2351
- /* @__PURE__ */ e(Ee, { label: "Network", value: d.network }),
2352
- f && d.walletAddress && /* @__PURE__ */ e(Ee, { label: "Refund address", value: Yt(d.walletAddress), mono: !0 })
2366
+ /* @__PURE__ */ e(Ae, { label: "Network", value: d.network }),
2367
+ f && d.walletAddress && /* @__PURE__ */ e(Ae, { label: "Refund address", value: Yt(d.walletAddress), mono: !0 })
2353
2368
  ] }),
2354
- p && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: p }),
2369
+ y && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: y }),
2355
2370
  /* @__PURE__ */ e(
2356
2371
  "button",
2357
2372
  {
@@ -2367,7 +2382,7 @@ function on({ className: t = "", stablecoinParity: a, partnerName: n }) {
2367
2382
  )
2368
2383
  ] });
2369
2384
  }
2370
- function Ee({ label: t, value: a, mono: n, highlight: r }) {
2385
+ function Ae({ label: t, value: a, mono: n, highlight: r }) {
2371
2386
  return /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
2372
2387
  /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
2373
2388
  /* @__PURE__ */ e(
@@ -2380,7 +2395,7 @@ function Ee({ label: t, value: a, mono: n, highlight: r }) {
2380
2395
  )
2381
2396
  ] });
2382
2397
  }
2383
- function Ve({
2398
+ function je({
2384
2399
  isOpen: t,
2385
2400
  onClose: a,
2386
2401
  children: n
@@ -2395,7 +2410,7 @@ function Ve({
2395
2410
  return () => clearTimeout(s);
2396
2411
  }
2397
2412
  }, [t]);
2398
- const i = K(() => {
2413
+ const i = P(() => {
2399
2414
  u(!1), setTimeout(() => a(), 250);
2400
2415
  }, [a]);
2401
2416
  return Z(() => {
@@ -2420,51 +2435,51 @@ function Ve({
2420
2435
  }
2421
2436
  ) : null;
2422
2437
  }
2423
- function ln({ char: t, height: a = 38 }) {
2438
+ function sn({ char: t, height: a = 38 }) {
2424
2439
  const n = "0123456789", r = n.indexOf(t);
2425
2440
  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((o) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: o }, o)) }) });
2426
2441
  }
2427
- function cn({
2442
+ function dn({
2428
2443
  value: t,
2429
2444
  height: a = 38,
2430
2445
  className: n = "",
2431
2446
  style: r = {}
2432
2447
  }) {
2433
- return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...r }, children: t.split("").map((o, d) => /* @__PURE__ */ e(ln, { char: o, height: a }, d)) });
2448
+ return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...r }, children: t.split("").map((o, d) => /* @__PURE__ */ e(sn, { char: o, height: a }, d)) });
2434
2449
  }
2435
- function j({
2450
+ function V({
2436
2451
  w: t,
2437
2452
  h: a,
2438
2453
  className: n = ""
2439
2454
  }) {
2440
2455
  return /* @__PURE__ */ e("div", { className: `skeleton ${n}`, style: { width: t, height: a } });
2441
2456
  }
2442
- function sn() {
2457
+ function un() {
2443
2458
  return /* @__PURE__ */ l("div", { className: "flex-1 px-5 flex flex-col", children: [
2444
2459
  /* @__PURE__ */ l("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
2445
- /* @__PURE__ */ e(j, { w: 70, h: 14, className: "mb-3" }),
2460
+ /* @__PURE__ */ e(V, { w: 70, h: 14, className: "mb-3" }),
2446
2461
  /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
2447
- /* @__PURE__ */ e(j, { w: 120, h: 32 }),
2448
- /* @__PURE__ */ e(j, { w: 75, h: 32 })
2462
+ /* @__PURE__ */ e(V, { w: 120, h: 32 }),
2463
+ /* @__PURE__ */ e(V, { w: 75, h: 32 })
2449
2464
  ] })
2450
2465
  ] }),
2451
2466
  /* @__PURE__ */ l("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
2452
- /* @__PURE__ */ e(j, { w: 50, h: 14, className: "mb-3" }),
2467
+ /* @__PURE__ */ e(V, { w: 50, h: 14, className: "mb-3" }),
2453
2468
  /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
2454
- /* @__PURE__ */ e(j, { w: 180, h: 32 }),
2455
- /* @__PURE__ */ e(j, { w: 85, h: 32 })
2469
+ /* @__PURE__ */ e(V, { w: 180, h: 32 }),
2470
+ /* @__PURE__ */ e(V, { w: 85, h: 32 })
2456
2471
  ] })
2457
2472
  ] }),
2458
2473
  /* @__PURE__ */ l("div", { className: "flex justify-between mt-3 px-[2px]", children: [
2459
- /* @__PURE__ */ e(j, { w: 140, h: 12 }),
2460
- /* @__PURE__ */ e(j, { w: 90, h: 12 })
2474
+ /* @__PURE__ */ e(V, { w: 140, h: 12 }),
2475
+ /* @__PURE__ */ e(V, { w: 90, h: 12 })
2461
2476
  ] }),
2462
2477
  /* @__PURE__ */ l("div", { className: "mt-8", children: [
2463
- /* @__PURE__ */ e(j, { w: 65, h: 14, className: "mb-2.5" }),
2464
- /* @__PURE__ */ e(j, { w: "100%", h: 47 })
2478
+ /* @__PURE__ */ e(V, { w: 65, h: 14, className: "mb-2.5" }),
2479
+ /* @__PURE__ */ e(V, { w: "100%", h: 47 })
2465
2480
  ] }),
2466
2481
  /* @__PURE__ */ e("div", { className: "flex-1" }),
2467
- /* @__PURE__ */ e(j, { w: "100%", h: 60, className: "mb-2" }),
2482
+ /* @__PURE__ */ e(V, { w: "100%", h: 60, className: "mb-2" }),
2468
2483
  /* @__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" }) })
2469
2484
  ] });
2470
2485
  }
@@ -2481,7 +2496,7 @@ function De({ onClick: t }) {
2481
2496
  }
2482
2497
  );
2483
2498
  }
2484
- function Ge({
2499
+ function $e({
2485
2500
  value: t,
2486
2501
  onChange: a,
2487
2502
  placeholder: n = ""
@@ -2512,27 +2527,27 @@ function Ge({
2512
2527
  )
2513
2528
  ] });
2514
2529
  }
2515
- function dn({
2530
+ function mn({
2516
2531
  onClose: t,
2517
2532
  onSelect: a,
2518
2533
  currencies: n,
2519
2534
  assetBaseUrl: r = "",
2520
2535
  selectedCode: o
2521
2536
  }) {
2522
- const [d, u] = N(""), i = G(() => {
2537
+ const [d, u] = N(""), i = j(() => {
2523
2538
  if (!n || n.length === 0) return _t;
2524
2539
  const m = new Map(_t.map((h) => [h.code, h.name]));
2525
2540
  return n.map((h) => ({
2526
2541
  code: h.code,
2527
2542
  name: h.name || m.get(h.code) || h.code
2528
2543
  }));
2529
- }, [n]), s = G(() => {
2544
+ }, [n]), s = j(() => {
2530
2545
  const m = d.trim().toLowerCase();
2531
2546
  if (!m) {
2532
2547
  if (o) {
2533
2548
  const h = i.find((f) => f.code === o);
2534
2549
  if (h) {
2535
- const f = i.filter((p) => p.code !== o);
2550
+ const f = i.filter((y) => y.code !== o);
2536
2551
  return [h, ...f];
2537
2552
  }
2538
2553
  }
@@ -2558,10 +2573,10 @@ function dn({
2558
2573
  children: "Select fiat currency"
2559
2574
  }
2560
2575
  ),
2561
- /* @__PURE__ */ e(Ge, { value: d, onChange: u }),
2576
+ /* @__PURE__ */ e($e, { value: d, onChange: u }),
2562
2577
  /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2563
2578
  s.map((m, h) => {
2564
- const f = m.name !== m.code ? m.name : "", p = o === m.code;
2579
+ const f = m.name !== m.code ? m.name : "", y = o === m.code;
2565
2580
  return /* @__PURE__ */ l("div", { children: [
2566
2581
  /* @__PURE__ */ l(
2567
2582
  "button",
@@ -2575,7 +2590,7 @@ function dn({
2575
2590
  /* @__PURE__ */ e("span", { className: "font-semibold text-[15px]", children: m.code }),
2576
2591
  f && /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: f })
2577
2592
  ] }),
2578
- p && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className: "shrink-0", children: /* @__PURE__ */ e(
2593
+ y && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className: "shrink-0", children: /* @__PURE__ */ e(
2579
2594
  "path",
2580
2595
  {
2581
2596
  d: "M13.5 4.5L6 12L2.5 8.5",
@@ -2603,7 +2618,7 @@ function dn({
2603
2618
  function Zt({ src: t, alt: a, size: n, className: r, style: o }) {
2604
2619
  const [d, u] = N(!1), [i, s] = N(!1), m = I(t);
2605
2620
  m.current !== t && (m.current = t, u(!1), s(!1));
2606
- const h = K(() => u(!0), []), f = K(() => s(!0), []);
2621
+ const h = P(() => u(!0), []), f = P(() => s(!0), []);
2607
2622
  return /* @__PURE__ */ l("div", { className: r, style: { ...o, width: n, height: n, position: "relative" }, children: [
2608
2623
  !d && !i && /* @__PURE__ */ e(
2609
2624
  "div",
@@ -2634,48 +2649,48 @@ function Zt({ src: t, alt: a, size: n, className: r, style: o }) {
2634
2649
  )
2635
2650
  ] });
2636
2651
  }
2637
- function un({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: o, selectedChain: d }) {
2638
- const [u, i] = N(""), s = G(() => {
2639
- if (!n || n.length === 0) return Pa;
2652
+ function fn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: o, selectedChain: d }) {
2653
+ const [u, i] = N(""), s = j(() => {
2654
+ if (!n || n.length === 0) return _a;
2640
2655
  const f = [];
2641
- for (const p of n) {
2642
- const x = p.networks || [], C = p.name || Ma[p.code] || p.code;
2656
+ for (const y of n) {
2657
+ const x = y.networks || [], C = y.name || Ba[y.code] || y.code;
2643
2658
  if (x.length === 0)
2644
- f.push({ code: p.code, name: C, chain: p.code, popular: !1 });
2659
+ f.push({ code: y.code, name: C, chain: y.code, popular: !1 });
2645
2660
  else
2646
- for (const A of x) {
2647
- const k = A.code || A.id || A.name || p.code;
2661
+ for (const E of x) {
2662
+ const k = E.code || E.id || E.name || y.code;
2648
2663
  f.push({
2649
- code: p.code,
2664
+ code: y.code,
2650
2665
  name: C,
2651
2666
  chain: k,
2652
- chainName: A.name,
2667
+ chainName: E.name,
2653
2668
  popular: !1
2654
2669
  });
2655
2670
  }
2656
2671
  }
2657
2672
  return f;
2658
- }, [n]), m = K((f, p) => o === f && d === p, [o, d]), h = G(() => {
2673
+ }, [n]), m = P((f, y) => o === f && d === y, [o, d]), h = j(() => {
2659
2674
  var C;
2660
2675
  const f = u.trim().toLowerCase();
2661
2676
  if (!f) {
2662
2677
  if (o && d) {
2663
- const A = s.find((k) => k.code === o && k.chain === d);
2664
- if (A) {
2665
- const k = s.filter((V) => !(V.code === o && V.chain === d));
2666
- return [A, ...k];
2678
+ const E = s.find((k) => k.code === o && k.chain === d);
2679
+ if (E) {
2680
+ const k = s.filter((_) => !(_.code === o && _.chain === d));
2681
+ return [E, ...k];
2667
2682
  }
2668
2683
  }
2669
2684
  return s;
2670
2685
  }
2671
- const p = f.split(/\s+/), x = [];
2672
- for (const A of s) {
2673
- const k = tt(A.chain), V = k ? k.name.toLowerCase() : "", oe = ((C = k == null ? void 0 : k.shortName) == null ? void 0 : C.toLowerCase()) || "", $ = A.chain.toLowerCase(), z = A.code.toLowerCase(), te = A.name.toLowerCase(), X = [z, te, V, oe, $];
2674
- if (!p.every((L) => X.some((c) => c.includes(L)))) continue;
2686
+ const y = f.split(/\s+/), x = [];
2687
+ for (const E of s) {
2688
+ const k = tt(E.chain), _ = k ? k.name.toLowerCase() : "", ie = ((C = k == null ? void 0 : k.shortName) == null ? void 0 : C.toLowerCase()) || "", G = E.chain.toLowerCase(), z = E.code.toLowerCase(), te = E.name.toLowerCase(), X = [z, te, _, ie, G];
2689
+ if (!y.every((L) => X.some((c) => c.includes(L)))) continue;
2675
2690
  let v = 0;
2676
- z === f ? v += 100 : z.startsWith(p[0]) && (v += 50), A.popular && (v += 10), p.length > 1 && (V.includes(p[1]) || oe.includes(p[1]) || $.includes(p[1])) && (v += 25), x.push({ item: A, score: v });
2691
+ z === f ? v += 100 : z.startsWith(y[0]) && (v += 50), E.popular && (v += 10), y.length > 1 && (_.includes(y[1]) || ie.includes(y[1]) || G.includes(y[1])) && (v += 25), x.push({ item: E, score: v });
2677
2692
  }
2678
- return x.sort((A, k) => k.score - A.score), x.map((A) => A.item);
2693
+ return x.sort((E, k) => k.score - E.score), x.map((E) => E.item);
2679
2694
  }, [s, u, o, d]);
2680
2695
  return /* @__PURE__ */ l(ee, { children: [
2681
2696
  /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
@@ -2687,10 +2702,10 @@ function un({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2687
2702
  children: "Select crypto currency"
2688
2703
  }
2689
2704
  ),
2690
- /* @__PURE__ */ e(Ge, { value: u, onChange: i }),
2705
+ /* @__PURE__ */ e($e, { value: u, onChange: i }),
2691
2706
  /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2692
- h.map((f, p) => {
2693
- const x = tt(f.chain), C = (x == null ? void 0 : x.name) || f.chainName || f.chain, A = f.name !== f.code ? f.name : "", k = m(f.code, f.chain);
2707
+ h.map((f, y) => {
2708
+ const x = tt(f.chain), C = (x == null ? void 0 : x.name) || f.chainName || f.chain, E = f.name !== f.code ? f.name : "", k = m(f.code, f.chain);
2694
2709
  return /* @__PURE__ */ l("div", { children: [
2695
2710
  /* @__PURE__ */ l(
2696
2711
  "button",
@@ -2746,12 +2761,12 @@ function un({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2746
2761
  children: f.code
2747
2762
  }
2748
2763
  ),
2749
- A && /* @__PURE__ */ e(
2764
+ E && /* @__PURE__ */ e(
2750
2765
  "span",
2751
2766
  {
2752
2767
  className: "text-[13px]",
2753
2768
  style: { color: "var(--t-text-secondary)" },
2754
- children: A
2769
+ children: E
2755
2770
  }
2756
2771
  )
2757
2772
  ] }) }),
@@ -2771,20 +2786,20 @@ function un({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2771
2786
  ]
2772
2787
  }
2773
2788
  ),
2774
- p < h.length - 1 && /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" } })
2789
+ y < h.length - 1 && /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" } })
2775
2790
  ] }, `${f.code}-${f.chain}`);
2776
2791
  }),
2777
2792
  h.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
2778
2793
  ] })
2779
2794
  ] });
2780
2795
  }
2781
- function mn({
2796
+ function hn({
2782
2797
  methods: t,
2783
2798
  selectedId: a,
2784
2799
  onSelect: n,
2785
2800
  onClose: r
2786
2801
  }) {
2787
- const [o, d] = N(""), u = G(() => {
2802
+ const [o, d] = N(""), u = j(() => {
2788
2803
  const i = o.trim().toLowerCase();
2789
2804
  if (!i) {
2790
2805
  if (a) {
@@ -2810,7 +2825,7 @@ function mn({
2810
2825
  children: "Choose payment method"
2811
2826
  }
2812
2827
  ),
2813
- /* @__PURE__ */ e(Ge, { value: o, onChange: d }),
2828
+ /* @__PURE__ */ e($e, { value: o, onChange: d }),
2814
2829
  /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2815
2830
  u.map((i, s) => {
2816
2831
  const m = i.id === a, h = aa(i.id, i.name);
@@ -2868,7 +2883,7 @@ function mn({
2868
2883
  ] })
2869
2884
  ] });
2870
2885
  }
2871
- function fn({
2886
+ function pn({
2872
2887
  checked: t,
2873
2888
  onChange: a,
2874
2889
  accentColor: n = "var(--t-accent)"
@@ -2898,11 +2913,11 @@ function fn({
2898
2913
  }
2899
2914
  );
2900
2915
  }
2901
- const hn = [
2916
+ const yn = [
2902
2917
  { label: "Privacy policy", href: "https://nowramp.com/privacy-policy" },
2903
2918
  { label: "Terms of use", href: "https://nowramp.com/terms-and-conditions" }
2904
2919
  ];
2905
- function pn({
2920
+ function Cn({
2906
2921
  onClose: t,
2907
2922
  darkMode: a,
2908
2923
  onToggleDarkMode: n,
@@ -2937,7 +2952,7 @@ function pn({
2937
2952
  style: { width: 40, height: 40, borderRadius: "50%", objectFit: "cover" },
2938
2953
  onError: () => f(!0)
2939
2954
  }
2940
- ) : /* @__PURE__ */ e(yn, { size: 40 }),
2955
+ ) : /* @__PURE__ */ e(gn, { size: 40 }),
2941
2956
  /* @__PURE__ */ l("div", { className: "text-left", children: [
2942
2957
  /* @__PURE__ */ e(
2943
2958
  "span",
@@ -2966,7 +2981,7 @@ function pn({
2966
2981
  d && /* @__PURE__ */ l(ee, { children: [
2967
2982
  /* @__PURE__ */ e("div", { style: { borderTop: s ? "none" : "1px solid var(--t-divider)" }, children: /* @__PURE__ */ l("div", { className: "flex items-center justify-between w-full py-5", children: [
2968
2983
  /* @__PURE__ */ l("div", { className: "flex items-center gap-3.5", children: [
2969
- /* @__PURE__ */ e(Za, { size: 40 }),
2984
+ /* @__PURE__ */ e(za, { size: 40 }),
2970
2985
  /* @__PURE__ */ e(
2971
2986
  "span",
2972
2987
  {
@@ -2976,15 +2991,15 @@ function pn({
2976
2991
  }
2977
2992
  )
2978
2993
  ] }),
2979
- /* @__PURE__ */ e(fn, { checked: a, onChange: n, accentColor: "#4CD964" })
2994
+ /* @__PURE__ */ e(pn, { checked: a, onChange: n, accentColor: "#4CD964" })
2980
2995
  ] }) }),
2981
2996
  /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
2982
2997
  ] }),
2983
- hn.map((p) => /* @__PURE__ */ l("div", { children: [
2998
+ yn.map((y) => /* @__PURE__ */ l("div", { children: [
2984
2999
  /* @__PURE__ */ l(
2985
3000
  "a",
2986
3001
  {
2987
- href: p.href,
3002
+ href: y.href,
2988
3003
  target: "_blank",
2989
3004
  rel: "noopener noreferrer",
2990
3005
  className: "flex items-center justify-between w-full py-5 transition-colors",
@@ -2995,7 +3010,7 @@ function pn({
2995
3010
  {
2996
3011
  className: "font-medium text-[15px]",
2997
3012
  style: { color: "var(--t-text)" },
2998
- children: p.label
3013
+ children: y.label
2999
3014
  }
3000
3015
  ),
3001
3016
  /* @__PURE__ */ e(Xt, {})
@@ -3003,11 +3018,11 @@ function pn({
3003
3018
  }
3004
3019
  ),
3005
3020
  /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
3006
- ] }, p.label))
3021
+ ] }, y.label))
3007
3022
  ] })
3008
3023
  ] });
3009
3024
  }
3010
- function yn({ size: t = 40 }) {
3025
+ function gn({ size: t = 40 }) {
3011
3026
  return /* @__PURE__ */ l("svg", { width: t, height: t, viewBox: "0 0 40 40", fill: "none", children: [
3012
3027
  /* @__PURE__ */ e("circle", { cx: "20", cy: "20", r: "18", stroke: "var(--t-text-secondary)", strokeWidth: "1.5", fill: "none" }),
3013
3028
  /* @__PURE__ */ e("ellipse", { cx: "20", cy: "20", rx: "9", ry: "18", stroke: "var(--t-text-secondary)", strokeWidth: "1.5", fill: "none" }),
@@ -3015,13 +3030,13 @@ function yn({ size: t = 40 }) {
3015
3030
  /* @__PURE__ */ e("path", { d: "M5 12h30M5 28h30", stroke: "var(--t-text-secondary)", strokeWidth: "1.2" })
3016
3031
  ] });
3017
3032
  }
3018
- function Cn({
3033
+ function xn({
3019
3034
  onClose: t,
3020
3035
  onSelect: a,
3021
3036
  assetBaseUrl: n = "",
3022
3037
  selectedCode: r
3023
3038
  }) {
3024
- const [o, d] = N(""), u = G(() => {
3039
+ const [o, d] = N(""), u = j(() => {
3025
3040
  const i = o.trim().toLowerCase();
3026
3041
  if (!i) {
3027
3042
  if (r) {
@@ -3053,7 +3068,7 @@ function Cn({
3053
3068
  children: "Select your country"
3054
3069
  }
3055
3070
  ),
3056
- /* @__PURE__ */ e(Ge, { value: o, onChange: d }),
3071
+ /* @__PURE__ */ e($e, { value: o, onChange: d }),
3057
3072
  /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
3058
3073
  u.map((i, s) => {
3059
3074
  const m = (r == null ? void 0 : r.toLowerCase()) === i.code;
@@ -3065,7 +3080,7 @@ function Cn({
3065
3080
  className: "flex items-center w-full transition-colors rounded-lg hover-item",
3066
3081
  style: { color: "var(--t-text)", gap: 14, padding: "18px 8px", margin: "0 -8px" },
3067
3082
  children: [
3068
- /* @__PURE__ */ e(gn, { code: i.code, size: 32, baseUrl: n }),
3083
+ /* @__PURE__ */ e(vn, { code: i.code, size: 32, baseUrl: n }),
3069
3084
  /* @__PURE__ */ l("div", { className: "text-left flex-1", children: [
3070
3085
  /* @__PURE__ */ e("span", { className: "font-semibold text-[15px]", children: i.name }),
3071
3086
  /* @__PURE__ */ e("span", { className: "text-[13px] ml-2", style: { color: "var(--t-text-secondary)" }, children: i.defaultFiat })
@@ -3095,7 +3110,7 @@ function Cn({
3095
3110
  ] })
3096
3111
  ] });
3097
3112
  }
3098
- function gn({ code: t, size: a = 32, baseUrl: n = "" }) {
3113
+ function vn({ code: t, size: a = 32, baseUrl: n = "" }) {
3099
3114
  const [r, o] = N(!1);
3100
3115
  return r ? /* @__PURE__ */ e(
3101
3116
  "div",
@@ -3125,7 +3140,7 @@ function gn({ code: t, size: a = 32, baseUrl: n = "" }) {
3125
3140
  }
3126
3141
  );
3127
3142
  }
3128
- function xn({
3143
+ function bn({
3129
3144
  className: t = "",
3130
3145
  theme: a = "dark",
3131
3146
  skinId: n = "mono",
@@ -3138,18 +3153,18 @@ function xn({
3138
3153
  inputBgColor: m,
3139
3154
  textColor: h,
3140
3155
  textSecondaryColor: f,
3141
- textMutedColor: p,
3156
+ textMutedColor: y,
3142
3157
  successColor: x,
3143
3158
  showFlowToggle: C = !0,
3144
- showSettings: A = !0,
3159
+ showSettings: E = !0,
3145
3160
  showThemeToggle: k = !0,
3146
- autoRedirect: V = !1,
3147
- explorerUrl: oe,
3148
- doneButtonText: $ = "Done",
3161
+ autoRedirect: _ = !1,
3162
+ explorerUrl: ie,
3163
+ doneButtonText: G = "Done",
3149
3164
  supportEmail: z,
3150
3165
  stablecoinParity: te,
3151
3166
  partnerName: X,
3152
- onDone: xe
3167
+ onDone: ve
3153
3168
  }) {
3154
3169
  var Lt, Ut, Ft, Dt, Mt, It, Bt, Ot, Ht;
3155
3170
  const {
@@ -3160,146 +3175,146 @@ function xn({
3160
3175
  quotes: w,
3161
3176
  quotesLoading: b,
3162
3177
  quotesError: J,
3163
- fetchQuotes: ve,
3164
- createOrder: be,
3165
- orderLoading: ce,
3178
+ fetchQuotes: be,
3179
+ createOrder: Se,
3180
+ orderLoading: se,
3166
3181
  amountError: pe,
3167
3182
  fieldLocks: D,
3168
3183
  apiConfig: ae,
3169
- assetBaseUrl: B,
3170
- availableFiats: se,
3184
+ assetBaseUrl: O,
3185
+ availableFiats: de,
3171
3186
  availableCryptos: Me,
3172
3187
  availablePaymentMethods: Q,
3173
3188
  selectionUnsupported: ne,
3174
- quotesEmpty: O,
3175
- unavailableReasons: Ae
3176
- } = Fe(), [ie, $e] = N(a === "dark"), [Re, rt] = N(n), [de, H] = N(null), [Ie, ke] = N(!1), [Be, We] = N(!1), [le, Xe] = N(!1), [Se, Oe] = N(!1), [Ye, ue] = N(null), [He, ot] = N(!0), [it, Ze] = N(!1), [me, y] = N(!1), E = I(null), R = I(), F = I(v.flowType);
3189
+ quotesEmpty: B,
3190
+ bestUnavailableReason: Re
3191
+ } = Fe(), [le, We] = N(a === "dark"), [ke, Ie] = N(n), [ce, $] = N(null), [Ne, Be] = N(!1), [Xe, re] = N(!1), [rt, ye] = N(!1), [Oe, He] = N(!1), [Ye, ue] = N(null), [Pe, ot] = N(!0), [it, Ze] = N(!1), [me, p] = N(!1), A = I(null), R = I(), F = I(v.flowType);
3177
3192
  Z(() => {
3178
- $e(a === "dark");
3193
+ We(a === "dark");
3179
3194
  }, [a]), Z(() => {
3180
3195
  const g = setTimeout(() => ot(!1), U ? 0 : 800);
3181
3196
  return () => clearTimeout(g);
3182
3197
  }, [U]), Z(() => {
3183
- if (F.current !== v.flowType && !He) {
3184
- F.current = v.flowType, Ze(!0), ke(!1), We(!1);
3198
+ if (F.current !== v.flowType && !Pe) {
3199
+ F.current = v.flowType, Ze(!0), Be(!1), re(!1);
3185
3200
  const g = setTimeout(() => Ze(!1), 350);
3186
3201
  return () => clearTimeout(g);
3187
3202
  }
3188
3203
  F.current = v.flowType;
3189
- }, [v.flowType, He]);
3190
- const M = v.flowType, T = M === "buy", P = v.cryptoCurrency || "BTC", Y = v.fiatCurrency || "USD", lt = T ? v.fiatAmount : v.cryptoAmount, q = Ha(lt), ye = (Lt = w == null ? void 0 : w.bestQuote) != null && Lt.exchangeRate ? parseFloat(w.bestQuote.exchangeRate) : null, Pe = I(null);
3191
- ye && P && Y && (Pe.current = { rate: ye, crypto: P, fiat: Y }), Z(() => {
3192
- (O || J) && (Pe.current = null);
3193
- }, [O, J]);
3194
- const xt = G(() => {
3204
+ }, [v.flowType, Pe]);
3205
+ const M = v.flowType, T = M === "buy", H = v.cryptoCurrency || "BTC", Y = v.fiatCurrency || "USD", lt = T ? v.fiatAmount : v.cryptoAmount, q = Ka(lt), Ce = (Lt = w == null ? void 0 : w.bestQuote) != null && Lt.exchangeRate ? parseFloat(w.bestQuote.exchangeRate) : null, Ke = I(null);
3206
+ Ce && H && Y && (Ke.current = { rate: Ce, crypto: H, fiat: Y }), Z(() => {
3207
+ (B || J) && (Ke.current = null);
3208
+ }, [B, J]);
3209
+ const xt = j(() => {
3195
3210
  if (w != null && w.bestQuote) {
3196
3211
  const g = T ? w.bestQuote.cryptoAmount : w.bestQuote.fiatAmount;
3197
3212
  if (g) return g;
3198
3213
  }
3199
3214
  return "0";
3200
- }, [w, T]), Ke = !!(te && X && T && ea(P) && ye), ra = Ke && P.toUpperCase().includes(Y.toUpperCase()), vt = Ke && q > 0 ? ht(ra ? q : q / ye) : null, oa = Ke && vt ? vt : xt, ia = G(() => {
3201
- var W, we, Le;
3202
- const g = ye || ((W = Pe.current) == null ? void 0 : W.rate), S = ye ? P : (we = Pe.current) == null ? void 0 : we.crypto, _ = ye ? Y : (Le = Pe.current) == null ? void 0 : Le.fiat;
3203
- return !g || !S || !_ ? "" : `1 ${S} ≈ ${g.toFixed(2)} ${_}`;
3204
- }, [P, Y, ye]);
3215
+ }, [w, T]), _e = !!(te && X && T && ea(H) && Ce), ra = _e && H.toUpperCase().includes(Y.toUpperCase()), vt = _e && q > 0 ? ht(ra ? q : q / Ce) : null, oa = _e && vt ? vt : xt, ia = j(() => {
3216
+ var W, Ee, Le;
3217
+ const g = Ce || ((W = Ke.current) == null ? void 0 : W.rate), S = Ce ? H : (Ee = Ke.current) == null ? void 0 : Ee.crypto, K = Ce ? Y : (Le = Ke.current) == null ? void 0 : Le.fiat;
3218
+ return !g || !S || !K ? "" : `1 ${S} ≈ ${g.toFixed(2)} ${K}`;
3219
+ }, [H, Y, Ce]);
3205
3220
  Z(() => {
3206
3221
  const g = v.walletAddress.trim(), S = v.network;
3207
3222
  if (!g || g.length < 10) {
3208
3223
  ue(null), L({ type: "SET_WALLET_ERROR", message: "" });
3209
3224
  return;
3210
3225
  }
3211
- Oe(!0), ue(null);
3212
- const _ = new AbortController();
3226
+ He(!0), ue(null);
3227
+ const K = new AbortController();
3213
3228
  return clearTimeout(R.current), R.current = setTimeout(async () => {
3214
- var W, we, Le;
3229
+ var W, Ee, Le;
3215
3230
  try {
3216
3231
  const dt = await (await fetch(`${ae.apiUrl}/public/validate/address`, {
3217
3232
  method: "POST",
3218
3233
  headers: { "Content-Type": "application/json" },
3219
3234
  body: JSON.stringify({ address: g, ...S ? { network: S } : {} }),
3220
- signal: _.signal
3235
+ signal: K.signal
3221
3236
  })).json(), ut = ((W = dt.data) == null ? void 0 : W.attributes) || dt.data || dt;
3222
3237
  if (ut.isValid)
3223
3238
  ue(!0), L({ type: "SET_WALLET_ERROR", message: "" });
3224
3239
  else {
3225
3240
  ue(!1);
3226
- const ga = ((we = ut.errors) == null ? void 0 : we[0]) || ((Le = ut.details) == null ? void 0 : Le.formatMessage) || "Invalid wallet address";
3241
+ const ga = ((Ee = ut.errors) == null ? void 0 : Ee[0]) || ((Le = ut.details) == null ? void 0 : Le.formatMessage) || "Invalid wallet address";
3227
3242
  L({ type: "SET_WALLET_ERROR", message: ga });
3228
3243
  }
3229
3244
  } catch (st) {
3230
3245
  if (st instanceof DOMException && st.name === "AbortError") return;
3231
3246
  ue(null);
3232
3247
  } finally {
3233
- _.signal.aborted || Oe(!1);
3248
+ K.signal.aborted || He(!1);
3234
3249
  }
3235
3250
  }, 500), () => {
3236
- clearTimeout(R.current), _.abort();
3251
+ clearTimeout(R.current), K.abort();
3237
3252
  };
3238
3253
  }, [v.walletAddress, v.network, ae.apiUrl]);
3239
- const bt = !lt || q === 0, St = q > 0 && (T ? q < Gt : q < $t), Nt = !!pe || St || Ie && bt, la = q > 0 && !pe && !St, ct = v.walletAddress.trim().length >= 10 && Ye !== !1 && !Se, Qe = la && ct && !!v.cryptoCurrency && !!v.network, ca = (g) => {
3254
+ const bt = !lt || q === 0, St = q > 0 && (T ? q < Gt : q < $t), Nt = !!pe || St || Ne && bt, la = q > 0 && !pe && !St, ct = v.walletAddress.trim().length >= 10 && Ye !== !1 && !Oe, Qe = la && ct && !!v.cryptoCurrency && !!v.network, ca = (g) => {
3240
3255
  let S = g.target.value.replace(/[^0-9.,]/g, "");
3241
- const _ = T ? 2 : 6, W = S.indexOf(".");
3242
- W !== -1 && S.length - W - 1 > _ && (S = S.slice(0, W + _ + 1)), L(T ? { type: "SET_FIAT_AMOUNT", amount: S } : { type: "SET_CRYPTO_AMOUNT", amount: S });
3256
+ const K = T ? 2 : 6, W = S.indexOf(".");
3257
+ W !== -1 && S.length - W - 1 > K && (S = S.slice(0, W + K + 1)), L(T ? { type: "SET_FIAT_AMOUNT", amount: S } : { type: "SET_CRYPTO_AMOUNT", amount: S });
3243
3258
  }, wt = (g) => {
3244
3259
  g !== M && L({ type: "SET_FLOW_TYPE", flowType: g, fieldLocks: D });
3245
- }, sa = K(
3260
+ }, sa = P(
3246
3261
  (g) => {
3247
3262
  L({ type: "SET_FIAT_CURRENCY", currency: g });
3248
3263
  },
3249
3264
  [L]
3250
- ), da = K(
3265
+ ), da = P(
3251
3266
  (g, S) => {
3252
3267
  L({ type: "SET_CRYPTO_CURRENCY", currency: g }), L({ type: "SET_CRYPTO_CHAIN", chain: S });
3253
3268
  },
3254
3269
  [L]
3255
- ), ua = K(
3270
+ ), ua = P(
3256
3271
  (g) => {
3257
3272
  L({ type: "SET_PAYMENT_METHOD", methodId: g });
3258
3273
  },
3259
3274
  [L]
3260
- ), ma = K(
3275
+ ), ma = P(
3261
3276
  (g) => {
3262
- L({ type: "SET_COUNTRY", country: g }), H(null);
3277
+ L({ type: "SET_COUNTRY", country: g }), $(null);
3263
3278
  },
3264
3279
  [L]
3265
- ), fa = K(() => {
3266
- H(null), setTimeout(() => H("country"), 280);
3280
+ ), fa = P(() => {
3281
+ $(null), setTimeout(() => $("country"), 280);
3267
3282
  }, []), ha = v.country ? (Ut = yt[v.country.toLowerCase()]) == null ? void 0 : Ut.name : void 0, pa = () => {
3268
- Qe && (y(!0), ve());
3283
+ Qe && (p(!0), be());
3269
3284
  };
3270
3285
  Z(() => {
3271
3286
  var g;
3272
3287
  if (!(!me || b)) {
3273
3288
  if (w != null && w.bestQuote)
3274
- y(!1), L({ type: "SELECT_QUOTE", quote: w.bestQuote }), be().catch(() => {
3289
+ p(!1), L({ type: "SELECT_QUOTE", quote: w.bestQuote }), Se().catch(() => {
3275
3290
  });
3276
3291
  else if (J)
3277
- y(!1), L({ type: "SET_ERROR", message: J.message || "No quotes available" });
3292
+ p(!1), L({ type: "SET_ERROR", message: J.message || "No quotes available" });
3278
3293
  else if (w && !w.bestQuote) {
3279
- y(!1);
3280
- const S = (g = w.unavailableGateways) == null ? void 0 : g.map((W) => W.reason).filter(Boolean), _ = S != null && S.length ? `No providers available: ${S.join("; ")}` : "No providers available for this currency/network combination";
3281
- L({ type: "SET_ERROR", message: _ });
3294
+ p(!1);
3295
+ const S = (g = w.unavailableGateways) == null ? void 0 : g.map((W) => W.reason).filter(Boolean), K = S != null && S.length ? `No providers available: ${S.join("; ")}` : "No providers available for this currency/network combination";
3296
+ L({ type: "SET_ERROR", message: K });
3282
3297
  }
3283
3298
  }
3284
- }, [me, w, b, J, L, be]);
3285
- const Et = ie ? "theme-dark" : "theme-light", ze = Vt.find((g) => g.id === Re) || Vt[0], ya = ze.accent === null, Ca = r ? he(r) : !1, At = (g) => {
3286
- const S = g.replace("#", ""), _ = parseInt(S.substring(0, 2), 16), W = parseInt(S.substring(2, 4), 16), we = parseInt(S.substring(4, 6), 16);
3287
- return (0.299 * _ + 0.587 * W + 0.114 * we) / 255 > 0.5 ? "#000000" : "#ffffff";
3299
+ }, [me, w, b, J, L, Se]);
3300
+ const Et = le ? "theme-dark" : "theme-light", ze = Vt.find((g) => g.id === ke) || Vt[0], ya = ze.accent === null, Ca = r ? he(r) : !1, At = (g) => {
3301
+ const S = g.replace("#", ""), K = parseInt(S.substring(0, 2), 16), W = parseInt(S.substring(2, 4), 16), Ee = parseInt(S.substring(4, 6), 16);
3302
+ return (0.299 * K + 0.587 * W + 0.114 * Ee) / 255 > 0.5 ? "#000000" : "#ffffff";
3288
3303
  }, Rt = Ca ? { "--t-accent": r, "--t-cta-bg": r, "--t-cta-text": At(r) } : ya ? {
3289
- "--t-accent": ie ? "#ffffff" : "#111111",
3290
- "--t-cta-bg": ie ? "#ffffff" : "#111111",
3291
- "--t-cta-text": ie ? "#000000" : "#ffffff"
3304
+ "--t-accent": le ? "#ffffff" : "#111111",
3305
+ "--t-cta-bg": le ? "#ffffff" : "#111111",
3306
+ "--t-cta-text": le ? "#000000" : "#ffffff"
3292
3307
  } : {
3293
3308
  "--t-accent": ze.accent,
3294
3309
  "--t-cta-bg": ze.accent,
3295
3310
  "--t-cta-text": At(ze.accent)
3296
- }, re = {};
3297
- s && he(s) && (re["--t-surface"] = s, re["--t-modal-bg"] = s), m && he(m) && (re["--t-pill-bg"] = m, re["--t-close-bg"] = m), h && he(h) && (re["--t-text"] = h), f && he(f) && (re["--t-text-secondary"] = f), p && he(p) && (re["--t-text-muted"] = p, re["--t-text-tertiary"] = p), x && he(x) && (re["--t-success"] = x);
3298
- const Ne = {};
3299
- o && he(o) ? Ne.backgroundColor = o : Ne.backgroundColor = "var(--t-bg)", d && (d.startsWith("https://") || d.startsWith("data:image/")) && (Ne.backgroundImage = `url(${d})`, Ne.backgroundSize = "cover", Ne.backgroundPosition = "center");
3300
- const Je = ie ? "#ffffff" : "#111111", qe = {};
3311
+ }, oe = {};
3312
+ s && he(s) && (oe["--t-surface"] = s, oe["--t-modal-bg"] = s), m && he(m) && (oe["--t-pill-bg"] = m, oe["--t-close-bg"] = m), h && he(h) && (oe["--t-text"] = h), f && he(f) && (oe["--t-text-secondary"] = f), y && he(y) && (oe["--t-text-muted"] = y, oe["--t-text-tertiary"] = y), x && he(x) && (oe["--t-success"] = x);
3313
+ const we = {};
3314
+ o && he(o) ? we.backgroundColor = o : we.backgroundColor = "var(--t-bg)", d && (d.startsWith("https://") || d.startsWith("data:image/")) && (we.backgroundImage = `url(${d})`, we.backgroundSize = "cover", we.backgroundPosition = "center");
3315
+ const Je = le ? "#ffffff" : "#111111", qe = {};
3301
3316
  u && he(u) && (qe.border = `1px solid ${u}`), i && (qe.borderRadius = i);
3302
- const kt = v.step === "checkout" ? /* @__PURE__ */ e(en, { autoRedirect: V }) : v.step === "processing" ? /* @__PURE__ */ e(an, {}) : v.step === "complete" ? /* @__PURE__ */ e(nn, { explorerUrl: oe, doneButtonText: $, onDone: xe }) : v.step === "error" ? /* @__PURE__ */ e(rn, { supportEmail: z }) : v.step === "confirm" ? /* @__PURE__ */ e(on, { stablecoinParity: Ke, partnerName: X }) : null;
3317
+ const kt = v.step === "checkout" ? /* @__PURE__ */ e(an, { autoRedirect: _ }) : v.step === "processing" ? /* @__PURE__ */ e(rn, {}) : v.step === "complete" ? /* @__PURE__ */ e(on, { explorerUrl: ie, doneButtonText: G, onDone: ve }) : v.step === "error" ? /* @__PURE__ */ e(ln, { supportEmail: z }) : v.step === "confirm" ? /* @__PURE__ */ e(cn, { stablecoinParity: _e, partnerName: X }) : null;
3303
3318
  if (kt)
3304
3319
  return /* @__PURE__ */ e(
3305
3320
  "div",
@@ -3307,9 +3322,9 @@ function xn({
3307
3322
  className: `${Et} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
3308
3323
  style: {
3309
3324
  fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
3310
- ...Ne,
3325
+ ...we,
3311
3326
  ...Rt,
3312
- ...re,
3327
+ ...oe,
3313
3328
  ...qe
3314
3329
  },
3315
3330
  children: kt
@@ -3322,13 +3337,13 @@ function xn({
3322
3337
  className: `${Et} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
3323
3338
  style: {
3324
3339
  fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
3325
- ...Ne,
3340
+ ...we,
3326
3341
  ...Rt,
3327
- ...re,
3342
+ ...oe,
3328
3343
  ...qe
3329
3344
  },
3330
3345
  children: [
3331
- A && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${C ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Ya, { onClick: () => H("settings") }) }),
3346
+ E && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${C ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Qa, { onClick: () => $("settings") }) }),
3332
3347
  C ? /* @__PURE__ */ l("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
3333
3348
  /* @__PURE__ */ l("div", { className: "flex", style: { width: 165 }, children: [
3334
3349
  /* @__PURE__ */ e(
@@ -3365,7 +3380,7 @@ function xn({
3365
3380
  )
3366
3381
  ] })
3367
3382
  ] }) : null,
3368
- He || it || U ? /* @__PURE__ */ e(sn, {}) : /* @__PURE__ */ l("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
3383
+ Pe || it || U ? /* @__PURE__ */ e(un, {}) : /* @__PURE__ */ l("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
3369
3384
  /* @__PURE__ */ l(
3370
3385
  "div",
3371
3386
  {
@@ -3373,7 +3388,7 @@ function xn({
3373
3388
  style: {
3374
3389
  background: "var(--t-surface)",
3375
3390
  borderRadius: 5,
3376
- border: Ie && Nt ? "1px solid #EF4444" : "1px solid transparent",
3391
+ border: Ne && Nt ? "1px solid #EF4444" : "1px solid transparent",
3377
3392
  minHeight: 102
3378
3393
  },
3379
3394
  children: [
@@ -3382,11 +3397,11 @@ function xn({
3382
3397
  /* @__PURE__ */ e(
3383
3398
  "input",
3384
3399
  {
3385
- ref: E,
3400
+ ref: A,
3386
3401
  type: "text",
3387
3402
  value: lt,
3388
3403
  onChange: ca,
3389
- onBlur: () => ke(!0),
3404
+ onBlur: () => Be(!0),
3390
3405
  placeholder: T ? "250" : "0.01",
3391
3406
  className: "bg-transparent outline-none w-0 flex-1 mr-3",
3392
3407
  style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px", padding: 0, border: "none", borderRadius: 0, backgroundColor: "transparent", height: "auto", width: 0 },
@@ -3397,7 +3412,7 @@ function xn({
3397
3412
  T ? /* @__PURE__ */ l(
3398
3413
  "button",
3399
3414
  {
3400
- onClick: () => H("fiat"),
3415
+ onClick: () => $("fiat"),
3401
3416
  className: "flex items-center gap-1.5 shrink-0 transition-colors",
3402
3417
  style: {
3403
3418
  background: "var(--t-pill-bg)",
@@ -3408,16 +3423,16 @@ function xn({
3408
3423
  },
3409
3424
  disabled: !!((Dt = D == null ? void 0 : D.sourceCurrency) != null && Dt.locked),
3410
3425
  children: [
3411
- /* @__PURE__ */ e(pt, { currencyCode: Y, size: 16, baseUrl: B }),
3426
+ /* @__PURE__ */ e(pt, { currencyCode: Y, size: 16, baseUrl: O }),
3412
3427
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Je }, children: Y }),
3413
- /* @__PURE__ */ e(je, {})
3428
+ /* @__PURE__ */ e(Ge, {})
3414
3429
  ]
3415
3430
  }
3416
3431
  ) : /* @__PURE__ */ l("div", { className: "flex flex-col items-end shrink-0", children: [
3417
3432
  /* @__PURE__ */ l(
3418
3433
  "button",
3419
3434
  {
3420
- onClick: () => H("crypto"),
3435
+ onClick: () => $("crypto"),
3421
3436
  className: "flex items-center gap-1.5 transition-colors",
3422
3437
  style: {
3423
3438
  background: "var(--t-pill-bg)",
@@ -3428,9 +3443,9 @@ function xn({
3428
3443
  },
3429
3444
  disabled: !!((Mt = D == null ? void 0 : D.destinationCurrency) != null && Mt.locked),
3430
3445
  children: [
3431
- /* @__PURE__ */ e(Wt, { ticker: P, size: 16, baseUrl: B }),
3432
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Je }, children: P }),
3433
- /* @__PURE__ */ e(je, {})
3446
+ /* @__PURE__ */ e(Wt, { ticker: H, size: 16, baseUrl: O }),
3447
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Je }, children: H }),
3448
+ /* @__PURE__ */ e(Ge, {})
3434
3449
  ]
3435
3450
  }
3436
3451
  ),
@@ -3438,7 +3453,7 @@ function xn({
3438
3453
  /* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
3439
3454
  "img",
3440
3455
  {
3441
- src: ft(fe, B),
3456
+ src: ft(fe, O),
3442
3457
  alt: fe,
3443
3458
  width: 14,
3444
3459
  height: 14,
@@ -3453,7 +3468,7 @@ function xn({
3453
3468
  ]
3454
3469
  }
3455
3470
  ),
3456
- Ie && Nt && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: pe || (bt ? "Amount should be more than 0" : T ? `Minimum amount is ${Gt} ${Y}` : `Minimum amount is ${$t} ${P}`) }),
3471
+ Ne && Nt && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: pe || (bt ? "Amount should be more than 0" : T ? `Minimum amount is ${Gt} ${Y}` : `Minimum amount is ${$t} ${H}`) }),
3457
3472
  /* @__PURE__ */ l(
3458
3473
  "div",
3459
3474
  {
@@ -3470,8 +3485,8 @@ function xn({
3470
3485
  children: [
3471
3486
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
3472
3487
  /* @__PURE__ */ l("div", { className: "flex items-start justify-between", children: [
3473
- b && !me ? /* @__PURE__ */ e(j, { w: 180, h: 32 }) : /* @__PURE__ */ e(
3474
- cn,
3488
+ b && !me ? /* @__PURE__ */ e(V, { w: 180, h: 32 }) : /* @__PURE__ */ e(
3489
+ dn,
3475
3490
  {
3476
3491
  value: q > 0 ? oa : "0",
3477
3492
  height: 32,
@@ -3483,7 +3498,7 @@ function xn({
3483
3498
  /* @__PURE__ */ l(
3484
3499
  "button",
3485
3500
  {
3486
- onClick: () => H("crypto"),
3501
+ onClick: () => $("crypto"),
3487
3502
  className: "flex items-center gap-1.5 transition-colors",
3488
3503
  style: {
3489
3504
  background: "var(--t-pill-bg)",
@@ -3494,9 +3509,9 @@ function xn({
3494
3509
  },
3495
3510
  disabled: !!((It = D == null ? void 0 : D.destinationCurrency) != null && It.locked),
3496
3511
  children: [
3497
- /* @__PURE__ */ e(Wt, { ticker: P, size: 16, baseUrl: B }),
3498
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Je }, children: P }),
3499
- /* @__PURE__ */ e(je, {})
3512
+ /* @__PURE__ */ e(Wt, { ticker: H, size: 16, baseUrl: O }),
3513
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Je }, children: H }),
3514
+ /* @__PURE__ */ e(Ge, {})
3500
3515
  ]
3501
3516
  }
3502
3517
  ),
@@ -3504,7 +3519,7 @@ function xn({
3504
3519
  /* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
3505
3520
  "img",
3506
3521
  {
3507
- src: ft(fe, B),
3522
+ src: ft(fe, O),
3508
3523
  alt: fe,
3509
3524
  width: 14,
3510
3525
  height: 14,
@@ -3517,7 +3532,7 @@ function xn({
3517
3532
  ] }) : /* @__PURE__ */ l(
3518
3533
  "button",
3519
3534
  {
3520
- onClick: () => H("fiat"),
3535
+ onClick: () => $("fiat"),
3521
3536
  className: "flex items-center gap-1.5 shrink-0 transition-colors",
3522
3537
  style: {
3523
3538
  background: "var(--t-pill-bg)",
@@ -3528,9 +3543,9 @@ function xn({
3528
3543
  },
3529
3544
  disabled: !!((Bt = D == null ? void 0 : D.sourceCurrency) != null && Bt.locked),
3530
3545
  children: [
3531
- /* @__PURE__ */ e(pt, { currencyCode: Y, size: 16, baseUrl: B }),
3546
+ /* @__PURE__ */ e(pt, { currencyCode: Y, size: 16, baseUrl: O }),
3532
3547
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Je }, children: Y }),
3533
- /* @__PURE__ */ e(je, {})
3548
+ /* @__PURE__ */ e(Ge, {})
3534
3549
  ]
3535
3550
  }
3536
3551
  )
@@ -3538,15 +3553,15 @@ function xn({
3538
3553
  ]
3539
3554
  }
3540
3555
  ),
3541
- O && q > 0 && /* @__PURE__ */ e(
3556
+ B && q > 0 && /* @__PURE__ */ e(
3542
3557
  "div",
3543
3558
  {
3544
3559
  className: "px-[18px] py-[10px] mt-[2px]",
3545
3560
  style: { background: "var(--t-surface)", fontSize: 12, color: "#EF4444", lineHeight: "16px" },
3546
- children: Ae[0] || "No providers available for this combination"
3561
+ children: Re || "No providers available for this combination"
3547
3562
  }
3548
3563
  ),
3549
- Ke && q > 0 && (w == null ? void 0 : w.bestQuote) && /* @__PURE__ */ l(
3564
+ _e && q > 0 && (w == null ? void 0 : w.bestQuote) && /* @__PURE__ */ l(
3550
3565
  "div",
3551
3566
  {
3552
3567
  className: "flex items-start gap-2 mt-[2px] px-[14px] py-[10px]",
@@ -3560,7 +3575,7 @@ function xn({
3560
3575
  "You will be charged for ",
3561
3576
  xt,
3562
3577
  " ",
3563
- P,
3578
+ H,
3564
3579
  ", the rest up to ",
3565
3580
  ht(q),
3566
3581
  " ",
@@ -3584,11 +3599,11 @@ function xn({
3584
3599
  }
3585
3600
  ),
3586
3601
  (Q.length > 0 || (c == null ? void 0 : c.paymentMethods) && c.paymentMethods.length > 0) && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: Q.length > 0 ? /* @__PURE__ */ e(
3587
- qa,
3602
+ tn,
3588
3603
  {
3589
3604
  methods: Q,
3590
3605
  selectedId: v.paymentMethodId,
3591
- onOpenModal: () => H("payment"),
3606
+ onOpenModal: () => $("payment"),
3592
3607
  fiatCurrency: v.fiatCurrency
3593
3608
  }
3594
3609
  ) : /* @__PURE__ */ e(
@@ -3611,16 +3626,16 @@ function xn({
3611
3626
  type: "text",
3612
3627
  value: v.walletAddress,
3613
3628
  onChange: (g) => L({ type: "SET_WALLET_ADDRESS", address: g.target.value }),
3614
- onFocus: () => Xe(!0),
3629
+ onFocus: () => ye(!0),
3615
3630
  onBlur: () => {
3616
- Xe(!1), We(!0);
3631
+ ye(!1), re(!0);
3617
3632
  },
3618
3633
  placeholder: T ? "Enter your receiving address" : "Enter your sending address",
3619
3634
  spellCheck: !1,
3620
3635
  autoComplete: "off",
3621
3636
  className: "w-full bg-transparent text-[13px] outline-none transition-colors",
3622
3637
  style: {
3623
- border: v.walletError || Be && !ct ? "1px solid #EF4444" : le ? "1px solid var(--t-border-focus)" : "1px solid var(--t-border)",
3638
+ border: v.walletError || Xe && !ct ? "1px solid #EF4444" : rt ? "1px solid var(--t-border-focus)" : "1px solid var(--t-border)",
3624
3639
  outline: "none",
3625
3640
  boxShadow: "none",
3626
3641
  borderRadius: 3.5,
@@ -3633,7 +3648,7 @@ function xn({
3633
3648
  disabled: !!((Ht = D == null ? void 0 : D.destinationAddress) != null && Ht.locked)
3634
3649
  }
3635
3650
  ),
3636
- v.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: v.walletError }) : Be && !ct && !Se ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : Se && v.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
3651
+ v.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: v.walletError }) : Xe && !ct && !Oe ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : Oe && v.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
3637
3652
  ] }),
3638
3653
  /* @__PURE__ */ e("div", { className: "flex-1", style: { minHeight: 16 } }),
3639
3654
  ne && /* @__PURE__ */ l("div", { className: "text-[12px] text-center mb-2", style: { color: "#EF4444" }, children: [
@@ -3644,7 +3659,7 @@ function xn({
3644
3659
  /* @__PURE__ */ e(
3645
3660
  "button",
3646
3661
  {
3647
- disabled: !Qe || ce || me || ne || O,
3662
+ disabled: !Qe || se || me || ne || B,
3648
3663
  onClick: pa,
3649
3664
  className: "w-full font-semibold text-[16px] transition-all",
3650
3665
  style: {
@@ -3652,48 +3667,48 @@ function xn({
3652
3667
  borderRadius: 5,
3653
3668
  background: "var(--t-cta-bg)",
3654
3669
  color: "var(--t-cta-text)",
3655
- opacity: Qe && !ce && !me && !ne && !O ? 1 : 0.4,
3656
- cursor: Qe && !ce && !me && !ne && !O ? "pointer" : "not-allowed"
3670
+ opacity: Qe && !se && !me && !ne && !B ? 1 : 0.4,
3671
+ cursor: Qe && !se && !me && !ne && !B ? "pointer" : "not-allowed"
3657
3672
  },
3658
- children: me ? "Getting best price..." : ce ? "Processing..." : T ? `Buy ${P}` : `Sell ${P}`
3673
+ children: me ? "Getting best price..." : se ? "Processing..." : T ? `Buy ${H}` : `Sell ${H}`
3659
3674
  }
3660
3675
  ),
3661
3676
  /* @__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" }) })
3662
3677
  ] }, M),
3663
- /* @__PURE__ */ e(Ve, { isOpen: de === "fiat", onClose: () => H(null), children: (g) => /* @__PURE__ */ e(
3664
- dn,
3678
+ /* @__PURE__ */ e(je, { isOpen: ce === "fiat", onClose: () => $(null), children: (g) => /* @__PURE__ */ e(
3679
+ mn,
3665
3680
  {
3666
3681
  onClose: g,
3667
3682
  onSelect: (S) => {
3668
3683
  sa(S), g();
3669
3684
  },
3670
- currencies: se.map((S) => ({ code: S.code, name: S.code })),
3671
- assetBaseUrl: B,
3685
+ currencies: de.map((S) => ({ code: S.code, name: S.code })),
3686
+ assetBaseUrl: O,
3672
3687
  selectedCode: v.fiatCurrency
3673
3688
  }
3674
3689
  ) }),
3675
- /* @__PURE__ */ e(Ve, { isOpen: de === "crypto", onClose: () => H(null), children: (g) => /* @__PURE__ */ e(
3676
- un,
3690
+ /* @__PURE__ */ e(je, { isOpen: ce === "crypto", onClose: () => $(null), children: (g) => /* @__PURE__ */ e(
3691
+ fn,
3677
3692
  {
3678
3693
  onClose: g,
3679
- onSelect: (S, _) => {
3680
- da(S, _), g();
3694
+ onSelect: (S, K) => {
3695
+ da(S, K), g();
3681
3696
  },
3682
3697
  cryptos: Me.map((S) => {
3683
- var _;
3698
+ var K;
3684
3699
  return {
3685
3700
  code: S.code,
3686
3701
  name: S.code,
3687
- networks: (_ = S.networks) == null ? void 0 : _.map((W) => ({ code: W.id, name: W.name }))
3702
+ networks: (K = S.networks) == null ? void 0 : K.map((W) => ({ code: W.id, name: W.name }))
3688
3703
  };
3689
3704
  }),
3690
- assetBaseUrl: B,
3705
+ assetBaseUrl: O,
3691
3706
  selectedCode: v.cryptoCurrency,
3692
3707
  selectedChain: v.network
3693
3708
  }
3694
3709
  ) }),
3695
- /* @__PURE__ */ e(Ve, { isOpen: de === "payment", onClose: () => H(null), children: (g) => /* @__PURE__ */ e(
3696
- mn,
3710
+ /* @__PURE__ */ e(je, { isOpen: ce === "payment", onClose: () => $(null), children: (g) => /* @__PURE__ */ e(
3711
+ hn,
3697
3712
  {
3698
3713
  methods: Q,
3699
3714
  selectedId: v.paymentMethodId,
@@ -3703,31 +3718,31 @@ function xn({
3703
3718
  onClose: g
3704
3719
  }
3705
3720
  ) }),
3706
- /* @__PURE__ */ e(Ve, { isOpen: de === "settings", onClose: () => H(null), children: (g) => /* @__PURE__ */ e(
3707
- pn,
3721
+ /* @__PURE__ */ e(je, { isOpen: ce === "settings", onClose: () => $(null), children: (g) => /* @__PURE__ */ e(
3722
+ Cn,
3708
3723
  {
3709
3724
  onClose: g,
3710
- darkMode: ie,
3711
- onToggleDarkMode: $e,
3712
- skinId: Re,
3725
+ darkMode: le,
3726
+ onToggleDarkMode: We,
3727
+ skinId: ke,
3713
3728
  onSelectSkin: (S) => {
3714
- rt(S);
3729
+ Ie(S);
3715
3730
  },
3716
3731
  showThemeToggle: k,
3717
3732
  country: v.country,
3718
3733
  countryName: ha,
3719
3734
  onLocationPress: fa,
3720
- assetBaseUrl: B
3735
+ assetBaseUrl: O
3721
3736
  }
3722
3737
  ) }),
3723
- /* @__PURE__ */ e(Ve, { isOpen: de === "country", onClose: () => H(null), children: (g) => /* @__PURE__ */ e(
3724
- Cn,
3738
+ /* @__PURE__ */ e(je, { isOpen: ce === "country", onClose: () => $(null), children: (g) => /* @__PURE__ */ e(
3739
+ xn,
3725
3740
  {
3726
3741
  onClose: g,
3727
3742
  onSelect: (S) => {
3728
3743
  ma(S), g();
3729
3744
  },
3730
- assetBaseUrl: B,
3745
+ assetBaseUrl: O,
3731
3746
  selectedCode: v.country
3732
3747
  }
3733
3748
  ) })
@@ -3735,7 +3750,7 @@ function xn({
3735
3750
  }
3736
3751
  );
3737
3752
  }
3738
- function vn({
3753
+ function Sn({
3739
3754
  projectId: t,
3740
3755
  apiUrl: a,
3741
3756
  assetBaseUrl: n,
@@ -3748,18 +3763,18 @@ function vn({
3748
3763
  defaultFiatAmount: m,
3749
3764
  defaultCryptoAmount: h,
3750
3765
  defaultWalletAddress: f,
3751
- defaultGateway: p,
3766
+ defaultGateway: y,
3752
3767
  defaultCountry: x,
3753
3768
  fieldLocks: C,
3754
- statusPollInterval: A,
3769
+ statusPollInterval: E,
3755
3770
  onComplete: k,
3756
- onError: V,
3757
- className: oe,
3758
- theme: $,
3771
+ onError: _,
3772
+ className: ie,
3773
+ theme: G,
3759
3774
  skinId: z,
3760
3775
  accentColor: te,
3761
3776
  bgColor: X,
3762
- bgImage: xe,
3777
+ bgImage: ve,
3763
3778
  borderColor: v,
3764
3779
  borderRadius: L,
3765
3780
  surfaceColor: c,
@@ -3767,20 +3782,20 @@ function vn({
3767
3782
  textColor: w,
3768
3783
  textSecondaryColor: b,
3769
3784
  textMutedColor: J,
3770
- successColor: ve,
3771
- showFlowToggle: be,
3772
- showSettings: ce,
3785
+ successColor: be,
3786
+ showFlowToggle: Se,
3787
+ showSettings: se,
3773
3788
  showThemeToggle: pe,
3774
3789
  autoRedirect: D,
3775
3790
  explorerUrl: ae,
3776
- doneButtonText: B,
3777
- supportEmail: se,
3791
+ doneButtonText: O,
3792
+ supportEmail: de,
3778
3793
  stablecoinParity: Me,
3779
3794
  partnerName: Q,
3780
3795
  onDone: ne
3781
3796
  }) {
3782
3797
  return /* @__PURE__ */ e(
3783
- Da,
3798
+ Ia,
3784
3799
  {
3785
3800
  projectId: t,
3786
3801
  apiUrl: a,
@@ -3794,21 +3809,21 @@ function vn({
3794
3809
  defaultFiatAmount: m,
3795
3810
  defaultCryptoAmount: h,
3796
3811
  defaultWalletAddress: f,
3797
- defaultGateway: p,
3812
+ defaultGateway: y,
3798
3813
  defaultCountry: x,
3799
3814
  fieldLocks: C,
3800
- statusPollInterval: A,
3815
+ statusPollInterval: E,
3801
3816
  onComplete: k,
3802
- onError: V,
3817
+ onError: _,
3803
3818
  children: /* @__PURE__ */ e(
3804
- xn,
3819
+ bn,
3805
3820
  {
3806
- className: oe,
3807
- theme: $,
3821
+ className: ie,
3822
+ theme: G,
3808
3823
  skinId: z,
3809
3824
  accentColor: te,
3810
3825
  bgColor: X,
3811
- bgImage: xe,
3826
+ bgImage: ve,
3812
3827
  borderColor: v,
3813
3828
  borderRadius: L,
3814
3829
  surfaceColor: c,
@@ -3816,14 +3831,14 @@ function vn({
3816
3831
  textColor: w,
3817
3832
  textSecondaryColor: b,
3818
3833
  textMutedColor: J,
3819
- successColor: ve,
3820
- showFlowToggle: be,
3821
- showSettings: ce,
3834
+ successColor: be,
3835
+ showFlowToggle: Se,
3836
+ showSettings: se,
3822
3837
  showThemeToggle: pe,
3823
3838
  autoRedirect: D,
3824
3839
  explorerUrl: ae,
3825
- doneButtonText: B,
3826
- supportEmail: se,
3840
+ doneButtonText: O,
3841
+ supportEmail: de,
3827
3842
  stablecoinParity: Me,
3828
3843
  partnerName: Q,
3829
3844
  onDone: ne
@@ -3832,14 +3847,14 @@ function vn({
3832
3847
  }
3833
3848
  );
3834
3849
  }
3835
- function Ln({
3850
+ function Fn({
3836
3851
  submitButtonText: t,
3837
3852
  rateRefreshInterval: a,
3838
3853
  ...n
3839
3854
  }) {
3840
- return /* @__PURE__ */ e(vn, { ...n });
3855
+ return /* @__PURE__ */ e(Sn, { ...n });
3841
3856
  }
3842
- function Un({
3857
+ function Dn({
3843
3858
  skin: t,
3844
3859
  active: a,
3845
3860
  onClick: n,
@@ -3872,13 +3887,13 @@ function Un({
3872
3887
  }
3873
3888
  );
3874
3889
  }
3875
- function bn({ quote: t }) {
3890
+ function Nn({ quote: t }) {
3876
3891
  return t.isBestRate ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Best price" }) : t.isRecommended ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Recommended" }) : t.rank && t.rank <= 3 ? /* @__PURE__ */ l("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: [
3877
3892
  "#",
3878
3893
  t.rank
3879
3894
  ] }) : null;
3880
3895
  }
3881
- function Sn({ quote: t }) {
3896
+ function wn({ quote: t }) {
3882
3897
  return t.gatewayLogo ? /* @__PURE__ */ e(
3883
3898
  "img",
3884
3899
  {
@@ -3891,7 +3906,7 @@ function Sn({ quote: t }) {
3891
3906
  }
3892
3907
  ) : /* @__PURE__ */ e(gt, { size: 36 });
3893
3908
  }
3894
- function Nn() {
3909
+ function En() {
3895
3910
  return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ l(
3896
3911
  "div",
3897
3912
  {
@@ -3904,28 +3919,28 @@ function Nn() {
3904
3919
  background: "var(--t-surface)"
3905
3920
  },
3906
3921
  children: [
3907
- /* @__PURE__ */ e(j, { w: 36, h: 36, className: "rounded-full shrink-0" }),
3922
+ /* @__PURE__ */ e(V, { w: 36, h: 36, className: "rounded-full shrink-0" }),
3908
3923
  /* @__PURE__ */ l("div", { className: "flex-1", children: [
3909
- /* @__PURE__ */ e(j, { w: 90, h: 14, className: "mb-1.5" }),
3910
- /* @__PURE__ */ e(j, { w: 60, h: 12 })
3924
+ /* @__PURE__ */ e(V, { w: 90, h: 14, className: "mb-1.5" }),
3925
+ /* @__PURE__ */ e(V, { w: 60, h: 12 })
3911
3926
  ] }),
3912
3927
  /* @__PURE__ */ l("div", { className: "text-right", children: [
3913
- /* @__PURE__ */ e(j, { w: 40, h: 10, className: "mb-1.5" }),
3914
- /* @__PURE__ */ e(j, { w: 80, h: 14 })
3928
+ /* @__PURE__ */ e(V, { w: 40, h: 10, className: "mb-1.5" }),
3929
+ /* @__PURE__ */ e(V, { w: 80, h: 14 })
3915
3930
  ] })
3916
3931
  ]
3917
3932
  },
3918
3933
  t
3919
3934
  )) });
3920
3935
  }
3921
- function Fn({
3936
+ function Mn({
3922
3937
  onClose: t,
3923
3938
  onSelect: a,
3924
3939
  quotes: n,
3925
3940
  quotesLoading: r,
3926
3941
  cryptoCurrency: o
3927
3942
  }) {
3928
- const [d, u] = N(""), i = G(() => {
3943
+ const [d, u] = N(""), i = j(() => {
3929
3944
  if (!(n != null && n.quotes)) return [];
3930
3945
  const s = d.trim().toLowerCase();
3931
3946
  return s ? n.quotes.filter((m) => m.gatewayName.toLowerCase().includes(s)) : n.quotes;
@@ -3940,10 +3955,10 @@ function Fn({
3940
3955
  children: "Choose Ramp"
3941
3956
  }
3942
3957
  ),
3943
- /* @__PURE__ */ e(Ge, { value: d, onChange: u }),
3958
+ /* @__PURE__ */ e($e, { value: d, onChange: u }),
3944
3959
  /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
3945
- r ? /* @__PURE__ */ e(Nn, {}) : i.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" }) : i.map((s, m) => {
3946
- const h = m === 0, f = parseFloat(s.cryptoAmount), p = f >= 1 ? f.toFixed(4) : f.toPrecision(6);
3960
+ r ? /* @__PURE__ */ e(En, {}) : i.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" }) : i.map((s, m) => {
3961
+ const h = m === 0, f = parseFloat(s.cryptoAmount), y = f >= 1 ? f.toFixed(4) : f.toPrecision(6);
3947
3962
  return /* @__PURE__ */ l(
3948
3963
  "button",
3949
3964
  {
@@ -3958,17 +3973,17 @@ function Fn({
3958
3973
  background: h ? "transparent" : "var(--t-surface)"
3959
3974
  },
3960
3975
  children: [
3961
- /* @__PURE__ */ e(Sn, { quote: s }),
3976
+ /* @__PURE__ */ e(wn, { quote: s }),
3962
3977
  /* @__PURE__ */ l("div", { className: "text-left flex-1 min-w-0", children: [
3963
3978
  /* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: s.gatewayName }),
3964
- /* @__PURE__ */ e(bn, { quote: s })
3979
+ /* @__PURE__ */ e(Nn, { quote: s })
3965
3980
  ] }),
3966
3981
  /* @__PURE__ */ l("div", { className: "text-right shrink-0", children: [
3967
3982
  /* @__PURE__ */ e("div", { className: "text-[11px]", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
3968
3983
  /* @__PURE__ */ l("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
3969
3984
  o,
3970
3985
  " ",
3971
- p
3986
+ y
3972
3987
  ] })
3973
3988
  ] })
3974
3989
  ]
@@ -3992,61 +4007,61 @@ function Fn({
3992
4007
  ] });
3993
4008
  }
3994
4009
  export {
3995
- ln as AnimatedDigit,
3996
- cn as AnimatedNumber,
3997
- Va as ApplePayIcon,
3998
- _e as BLOCKCHAINS,
3999
- Ka as BankIcon,
4010
+ sn as AnimatedDigit,
4011
+ dn as AnimatedNumber,
4012
+ Ga as ApplePayIcon,
4013
+ Ve as BLOCKCHAINS,
4014
+ Va as BankIcon,
4000
4015
  et as COUNTRIES,
4001
4016
  yt as COUNTRY_MAP,
4002
- Pa as CRYPTO_CHAIN_COMBOS,
4017
+ _a as CRYPTO_CHAIN_COMBOS,
4003
4018
  Jt as CRYPTO_CURRENCIES,
4004
- Xa as CardIcon,
4005
- Ln as CheckoutForm,
4006
- en as CheckoutStep,
4007
- je as ChevronDown,
4019
+ Za as CardIcon,
4020
+ Fn as CheckoutForm,
4021
+ an as CheckoutStep,
4022
+ Ge as ChevronDown,
4008
4023
  Xt as ChevronRight,
4009
- Fn as ChooseRampModal,
4024
+ Mn as ChooseRampModal,
4010
4025
  De as CloseButton,
4011
- Tn as CoinifyIcon,
4012
- nn as CompleteStep,
4013
- on as ConfirmStep,
4014
- Cn as CountryPickerModal,
4015
- un as CryptoCurrencyModal,
4026
+ Un as CoinifyIcon,
4027
+ on as CompleteStep,
4028
+ cn as ConfirmStep,
4029
+ xn as CountryPickerModal,
4030
+ fn as CryptoCurrencyModal,
4016
4031
  Wt as CryptoIcon,
4017
- Za as DarkModeIcon,
4018
- rn as ErrorStep,
4032
+ za as DarkModeIcon,
4033
+ ln as ErrorStep,
4019
4034
  _t as FIAT_CURRENCIES,
4020
- Ia as FIAT_TO_COUNTRY,
4021
- dn as FiatCurrencyModal,
4035
+ Oa as FIAT_TO_COUNTRY,
4036
+ mn as FiatCurrencyModal,
4022
4037
  pt as FiatFlag,
4023
- sn as FormSkeleton,
4038
+ un as FormSkeleton,
4024
4039
  gt as GenericCoinIcon,
4025
- ja as GooglePayIcon,
4040
+ $a as GooglePayIcon,
4026
4041
  jt as MOCK_RATES,
4027
- Ya as MenuIcon,
4028
- Ve as Modal,
4029
- Ga as PayPalIcon,
4030
- qa as PaymentMethodSelector,
4031
- an as ProcessingStep,
4032
- vn as RampForm,
4033
- Da as RampProvider,
4034
- _a as RevolutIcon,
4042
+ Qa as MenuIcon,
4043
+ je as Modal,
4044
+ Wa as PayPalIcon,
4045
+ tn as PaymentMethodSelector,
4046
+ rn as ProcessingStep,
4047
+ Sn as RampForm,
4048
+ Ia as RampProvider,
4049
+ ja as RevolutIcon,
4035
4050
  Vt as SKINS,
4036
- Ge as SearchInput,
4037
- pn as SettingsScreen,
4038
- j as Skeleton,
4039
- Un as SkinSwatch,
4040
- fn as ToggleSwitch,
4051
+ $e as SearchInput,
4052
+ Cn as SettingsScreen,
4053
+ V as Skeleton,
4054
+ Dn as SkinSwatch,
4055
+ pn as ToggleSwitch,
4041
4056
  ht as formatOutput,
4042
4057
  ft as getChainIconUrl,
4043
4058
  qt as getCryptoIconUrl,
4044
4059
  mt as getDefaultFiatForCountry,
4045
- Ba as getFiatFlagUrl,
4046
- kn as getMockRate,
4047
- Qa as getPaymentIcon,
4060
+ Ha as getFiatFlagUrl,
4061
+ Ln as getMockRate,
4062
+ Ja as getPaymentIcon,
4048
4063
  ea as isStablecoin,
4049
- Ha as parseAmount,
4064
+ Ka as parseAmount,
4050
4065
  wa as useCheckoutIntent,
4051
4066
  Na as useQuotes,
4052
4067
  Fe as useRamp,