@nowramp/form 0.1.48 → 0.1.49
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.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1198 -977
- package/dist/index.js.map +1 -1
- package/dist/nowramp-form.iife.js +11 -11
- package/dist/nowramp-form.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4,128 +4,128 @@
|
|
|
4
4
|
if(document.getElementById(id))return;
|
|
5
5
|
var s=document.createElement('style');
|
|
6
6
|
s.id=id;
|
|
7
|
-
s.textContent=`@layer nowramp-form{.theme-dark{--t-bg: #000000;--t-surface: rgba(255,255,255,.1);--t-surface-hover: rgba(255,255,255,.14);--t-text: #ffffff;--t-text-secondary: rgba(255,255,255,.4);--t-text-tertiary: rgba(255,255,255,.3);--t-text-muted: rgba(255,255,255,.5);--t-border: rgba(255,255,255,.2);--t-border-focus: rgba(255,255,255,.5);--t-pill-bg: rgba(255,255,255,.1);--t-pill-hover: rgba(255,255,255,.15);--t-badge-bg: rgba(255,255,255,.15);--t-divider: rgba(255,255,255,.2);--t-close-bg: rgba(255,255,255,.1);--t-close-hover: rgba(255,255,255,.2);--t-icon-stroke: rgba(255,255,255,.4);--t-icon-close: rgba(255,255,255,.6);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: rgba(255,255,255,.9);--t-cta-active: rgba(255,255,255,.8);--t-modal-bg: #000000;--t-chain-border: #000000;--t-skeleton-from: rgba(255,255,255,.06);--t-skeleton-mid: rgba(255,255,255,.12);--t-scrollbar: rgba(255,255,255,.15);--t-card-icon-bg: rgba(255,255,255,.1);--t-card-icon-stroke: rgba(255,255,255,.6);--t-success: #10b981;--t-error: #EF4444}.theme-light{--t-bg: #F2F3F5;--t-surface: rgba(0,0,0,.05);--t-surface-hover: rgba(0,0,0,.08);--t-text: #111111;--t-text-secondary: rgba(0,0,0,.45);--t-text-tertiary: rgba(0,0,0,.3);--t-text-muted: rgba(0,0,0,.5);--t-border: rgba(0,0,0,.12);--t-border-focus: rgba(0,0,0,.3);--t-pill-bg: rgba(0,0,0,.06);--t-pill-hover: rgba(0,0,0,.1);--t-badge-bg: rgba(0,0,0,.08);--t-divider: rgba(0,0,0,.1);--t-close-bg: rgba(0,0,0,.06);--t-close-hover: rgba(0,0,0,.12);--t-icon-stroke: rgba(0,0,0,.35);--t-icon-close: rgba(0,0,0,.5);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: #222222;--t-cta-active: #333333;--t-modal-bg: #F2F3F5;--t-chain-border: #F2F3F5;--t-skeleton-from: rgba(0,0,0,.04);--t-skeleton-mid: rgba(0,0,0,.08);--t-scrollbar: rgba(0,0,0,.12);--t-card-icon-bg: rgba(0,0,0,.06);--t-card-icon-stroke: rgba(0,0,0,.5);--t-success: #10b981;--t-error: #EF4444}.custom-scroll::-webkit-scrollbar{width:4px}.custom-scroll::-webkit-scrollbar-track{background:transparent}.custom-scroll::-webkit-scrollbar-thumb{background:var(--t-scrollbar);border-radius:2px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.skeleton{background:linear-gradient(90deg,var(--t-skeleton-from) 25%,var(--t-skeleton-mid) 50%,var(--t-skeleton-from) 75%);background-size:200% 100%;animation:shimmer 1.5s ease-in-out infinite;border-radius:4px}@keyframes fadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.tab-fade-in{animation:fadeIn .3s ease-out both}.digit-slot{display:inline-block;overflow:hidden;vertical-align:top}.digit-slot-inner{transition:transform .35s cubic-bezier(.33,1,.68,1)}@keyframes nramp-spin{to{transform:rotate(360deg)}}.nramp-spinner{width:40px;height:40px;border:3px solid var(--t-border);border-top-color:var(--t-accent);border-radius:50%;animation:nramp-spin .8s linear infinite;margin:0 auto}.nramp-spinner-large{width:60px;height:60px;border-width:4px}.nramp-spinner-inline{width:16px;height:16px;border-width:2px;display:inline-block}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-3{right:.75rem}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[3px\\]{top:3px}.z-20{z-index:20}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\\[2px\\]{margin-top:2px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-\\[640px\\]{height:640px}.h-full{height:100%}.min-h-\\[640px\\]{min-height:640px}.w-0{width:0px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\\[390px\\]{max-width:390px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-3\\.5{gap:.875rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-white\\/20{border-color:#fff3}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-12{padding:3rem}.p-8{padding:2rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\\[18px\\]{padding-left:18px;padding-right:18px}.px-\\[2px\\]{padding-left:2px;padding-right:2px}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-
|
|
7
|
+
s.textContent=`@layer nowramp-form{.theme-dark{--t-bg: #000000;--t-surface: rgba(255,255,255,.1);--t-surface-hover: rgba(255,255,255,.14);--t-text: #ffffff;--t-text-secondary: rgba(255,255,255,.4);--t-text-tertiary: rgba(255,255,255,.3);--t-text-muted: rgba(255,255,255,.5);--t-border: rgba(255,255,255,.2);--t-border-focus: rgba(255,255,255,.5);--t-pill-bg: rgba(255,255,255,.1);--t-pill-hover: rgba(255,255,255,.15);--t-badge-bg: rgba(255,255,255,.15);--t-divider: rgba(255,255,255,.2);--t-close-bg: rgba(255,255,255,.1);--t-close-hover: rgba(255,255,255,.2);--t-icon-stroke: rgba(255,255,255,.4);--t-icon-close: rgba(255,255,255,.6);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: rgba(255,255,255,.9);--t-cta-active: rgba(255,255,255,.8);--t-modal-bg: #000000;--t-chain-border: #000000;--t-skeleton-from: rgba(255,255,255,.06);--t-skeleton-mid: rgba(255,255,255,.12);--t-scrollbar: rgba(255,255,255,.15);--t-card-icon-bg: rgba(255,255,255,.1);--t-card-icon-stroke: rgba(255,255,255,.6);--t-success: #10b981;--t-error: #EF4444}.theme-light{--t-bg: #F2F3F5;--t-surface: rgba(0,0,0,.05);--t-surface-hover: rgba(0,0,0,.08);--t-text: #111111;--t-text-secondary: rgba(0,0,0,.45);--t-text-tertiary: rgba(0,0,0,.3);--t-text-muted: rgba(0,0,0,.5);--t-border: rgba(0,0,0,.12);--t-border-focus: rgba(0,0,0,.3);--t-pill-bg: rgba(0,0,0,.06);--t-pill-hover: rgba(0,0,0,.1);--t-badge-bg: rgba(0,0,0,.08);--t-divider: rgba(0,0,0,.1);--t-close-bg: rgba(0,0,0,.06);--t-close-hover: rgba(0,0,0,.12);--t-icon-stroke: rgba(0,0,0,.35);--t-icon-close: rgba(0,0,0,.5);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: #222222;--t-cta-active: #333333;--t-modal-bg: #F2F3F5;--t-chain-border: #F2F3F5;--t-skeleton-from: rgba(0,0,0,.04);--t-skeleton-mid: rgba(0,0,0,.08);--t-scrollbar: rgba(0,0,0,.12);--t-card-icon-bg: rgba(0,0,0,.06);--t-card-icon-stroke: rgba(0,0,0,.5);--t-success: #10b981;--t-error: #EF4444}.custom-scroll::-webkit-scrollbar{width:4px}.custom-scroll::-webkit-scrollbar-track{background:transparent}.custom-scroll::-webkit-scrollbar-thumb{background:var(--t-scrollbar);border-radius:2px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.skeleton{background:linear-gradient(90deg,var(--t-skeleton-from) 25%,var(--t-skeleton-mid) 50%,var(--t-skeleton-from) 75%);background-size:200% 100%;animation:shimmer 1.5s ease-in-out infinite;border-radius:4px}@keyframes fadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.tab-fade-in{animation:fadeIn .3s ease-out both}.digit-slot{display:inline-block;overflow:hidden;vertical-align:top}.digit-slot-inner{transition:transform .35s cubic-bezier(.33,1,.68,1)}@keyframes nramp-spin{to{transform:rotate(360deg)}}.nramp-spinner{width:40px;height:40px;border:3px solid var(--t-border);border-top-color:var(--t-accent);border-radius:50%;animation:nramp-spin .8s linear infinite;margin:0 auto}.nramp-spinner-large{width:60px;height:60px;border-width:4px}.nramp-spinner-inline{width:16px;height:16px;border-width:2px;display:inline-block}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-3{right:.75rem}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[3px\\]{top:3px}.z-20{z-index:20}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\\[2px\\]{margin-top:2px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-\\[640px\\]{height:640px}.h-full{height:100%}.min-h-\\[640px\\]{min-height:640px}.w-0{width:0px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\\[390px\\]{max-width:390px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-3\\.5{gap:.875rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-white\\/20{border-color:#fff3}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-12{padding:3rem}.p-8{padding:2rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\\[18px\\]{padding-left:18px;padding-right:18px}.px-\\[2px\\]{padding-left:2px;padding-right:2px}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-1{padding-bottom:.25rem}.pb-2\\.5{padding-bottom:.625rem}.pb-5{padding-bottom:1.25rem}.pb-\\[14px\\]{padding-bottom:14px}.pb-\\[18px\\]{padding-bottom:18px}.pt-3{padding-top:.75rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pt-\\[12px\\]{padding-top:12px}.pt-\\[14px\\]{padding-top:14px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[17px\\]{font-size:17px}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[48px\\]{font-size:48px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.hover-item{transition:background-color .15s ease}.hover-item:hover{background-color:var(--t-hover-bg, rgba(255, 255, 255, .05))}.hover\\:opacity-70:hover{opacity:.7}
|
|
8
8
|
}`;
|
|
9
9
|
document.head.appendChild(s);
|
|
10
10
|
})();
|
|
11
|
-
import { jsx as e, jsxs as o, Fragment as
|
|
12
|
-
import
|
|
13
|
-
import { RampApi as
|
|
14
|
-
import { createPortal as
|
|
15
|
-
function
|
|
16
|
-
const [a, r] =
|
|
17
|
-
(!
|
|
18
|
-
const
|
|
11
|
+
import { jsx as e, jsxs as o, Fragment as te } from "react/jsx-runtime";
|
|
12
|
+
import De, { useState as v, useRef as X, useCallback as O, useEffect as _, useMemo as j, useReducer as $t, useContext as Wt, createContext as jt } from "react";
|
|
13
|
+
import { RampApi as Ke } from "@nowramp/sdk";
|
|
14
|
+
import { createPortal as yt } from "react-dom";
|
|
15
|
+
function Vt(t, n) {
|
|
16
|
+
const [a, r] = v(null), [l, u] = v(!0), [m, s] = v(null), i = X(null);
|
|
17
|
+
(!i.current || i.current !== t) && (i.current = new Ke({ apiKey: "", ...t }));
|
|
18
|
+
const h = O(async () => {
|
|
19
19
|
if (!t.projectId) {
|
|
20
|
-
|
|
20
|
+
s(new Error("projectId is required")), u(!1);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
u(!0), s(null);
|
|
24
24
|
try {
|
|
25
|
-
const
|
|
26
|
-
r(
|
|
27
|
-
} catch (
|
|
28
|
-
|
|
25
|
+
const p = await i.current.getSupported(n);
|
|
26
|
+
r(p);
|
|
27
|
+
} catch (p) {
|
|
28
|
+
s(p instanceof Error ? p : new Error("Failed to fetch config"));
|
|
29
29
|
} finally {
|
|
30
|
-
|
|
30
|
+
u(!1);
|
|
31
31
|
}
|
|
32
32
|
}, [t.projectId, n]);
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
}
|
|
37
|
-
function
|
|
38
|
-
const [a, r] =
|
|
39
|
-
(!
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const
|
|
33
|
+
return _(() => {
|
|
34
|
+
h();
|
|
35
|
+
}, [h]), { config: a, loading: l, error: m, refetch: h };
|
|
36
|
+
}
|
|
37
|
+
function Gt(t, n) {
|
|
38
|
+
const [a, r] = v(null), [l, u] = v(!1), [m, s] = v(null), i = X(null), h = X(""), p = `${t.apiUrl}|${t.projectId}`;
|
|
39
|
+
(!i.current || h.current !== p) && (i.current = new Ke({ apiKey: "", ...t }), h.current = p);
|
|
40
|
+
const d = X(0);
|
|
41
|
+
_(() => {
|
|
42
|
+
const y = ++d.current;
|
|
43
43
|
if (!n || !t.projectId) {
|
|
44
|
-
r(null),
|
|
44
|
+
r(null), u(!1);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
(
|
|
49
|
-
|
|
47
|
+
u(!0), s(null), i.current.getQuotes(n).then(
|
|
48
|
+
(w) => {
|
|
49
|
+
d.current === y && (r(w), u(!1));
|
|
50
50
|
},
|
|
51
|
-
(
|
|
52
|
-
|
|
51
|
+
(w) => {
|
|
52
|
+
d.current === y && (s(w instanceof Error ? w : new Error("Failed to fetch quotes")), r(null), u(!1));
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
}, [t.projectId, n == null ? void 0 : n.fiatCurrency, n == null ? void 0 : n.fiatAmount, n == null ? void 0 : n.cryptoAmount, n == null ? void 0 : n.cryptoCurrency, n == null ? void 0 : n.network, n == null ? void 0 : n.paymentMethodId, n == null ? void 0 : n.country, n == null ? void 0 : n.orderType]);
|
|
56
|
-
const
|
|
56
|
+
const f = O(async () => {
|
|
57
57
|
if (!(!n || !t.projectId)) {
|
|
58
|
-
|
|
58
|
+
u(!0), s(null);
|
|
59
59
|
try {
|
|
60
|
-
const
|
|
61
|
-
r(
|
|
62
|
-
} catch (
|
|
63
|
-
|
|
60
|
+
const y = await i.current.getQuotes(n);
|
|
61
|
+
r(y);
|
|
62
|
+
} catch (y) {
|
|
63
|
+
s(y instanceof Error ? y : new Error("Failed to fetch quotes"));
|
|
64
64
|
} finally {
|
|
65
|
-
|
|
65
|
+
u(!1);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}, [t.projectId, n]);
|
|
69
|
-
return { quotes: a, loading: l, error:
|
|
69
|
+
return { quotes: a, loading: l, error: m, refetch: f };
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
const [n, a] =
|
|
73
|
-
(!
|
|
74
|
-
const
|
|
75
|
-
l(!0),
|
|
71
|
+
function Yt(t) {
|
|
72
|
+
const [n, a] = v(null), [r, l] = v(!1), [u, m] = v(null), s = X(null), i = X(""), h = `${t.apiUrl}|${t.projectId}`;
|
|
73
|
+
(!s.current || i.current !== h) && (s.current = new Ke({ apiKey: "", ...t }), i.current = h);
|
|
74
|
+
const p = O(async (f) => {
|
|
75
|
+
l(!0), m(null);
|
|
76
76
|
try {
|
|
77
|
-
const
|
|
78
|
-
return a(
|
|
79
|
-
} catch (
|
|
80
|
-
const
|
|
81
|
-
throw
|
|
77
|
+
const y = await s.current.createCheckoutIntent(f);
|
|
78
|
+
return a(y), y;
|
|
79
|
+
} catch (y) {
|
|
80
|
+
const w = y instanceof Error ? y : new Error("Failed to create checkout intent");
|
|
81
|
+
throw m(w), w;
|
|
82
82
|
} finally {
|
|
83
83
|
l(!1);
|
|
84
84
|
}
|
|
85
|
-
}, []),
|
|
86
|
-
a(null),
|
|
85
|
+
}, []), d = O(() => {
|
|
86
|
+
a(null), m(null);
|
|
87
87
|
}, []);
|
|
88
|
-
return { order: n, loading: r, error:
|
|
88
|
+
return { order: n, loading: r, error: u, createOrder: p, reset: d };
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
const [r, l] =
|
|
92
|
-
|
|
93
|
-
const
|
|
90
|
+
function Qt(t, n, a) {
|
|
91
|
+
const [r, l] = v(null), [u, m] = v(!1), [s, i] = v(null), h = X(null);
|
|
92
|
+
h.current || (h.current = new Ke({ apiKey: "", projectId: "", ...t }));
|
|
93
|
+
const p = O(async () => {
|
|
94
94
|
if (n) {
|
|
95
|
-
|
|
95
|
+
m(!0), i(null);
|
|
96
96
|
try {
|
|
97
|
-
const
|
|
98
|
-
l(
|
|
99
|
-
} catch (
|
|
100
|
-
|
|
97
|
+
const d = await h.current.getTransaction(n);
|
|
98
|
+
l(d);
|
|
99
|
+
} catch (d) {
|
|
100
|
+
i(d instanceof Error ? d : new Error("Failed to fetch status"));
|
|
101
101
|
} finally {
|
|
102
|
-
|
|
102
|
+
m(!1);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}, [n]);
|
|
106
|
-
return
|
|
106
|
+
return _(() => {
|
|
107
107
|
if (!n) return;
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
110
|
-
const
|
|
111
|
-
return () => clearTimeout(
|
|
108
|
+
const d = (a == null ? void 0 : a.initialDelay) ?? 0;
|
|
109
|
+
if (d > 0) {
|
|
110
|
+
const f = setTimeout(p, d);
|
|
111
|
+
return () => clearTimeout(f);
|
|
112
112
|
}
|
|
113
|
-
|
|
114
|
-
}, [
|
|
113
|
+
p();
|
|
114
|
+
}, [p, n, a == null ? void 0 : a.initialDelay]), _(() => {
|
|
115
115
|
if (!n || !(a != null && a.pollInterval) || !r || ["completed", "failed", "cancelled", "expired", "refunded"].includes(r.status))
|
|
116
116
|
return;
|
|
117
|
-
const
|
|
118
|
-
return () => clearInterval(
|
|
119
|
-
}, [n, a == null ? void 0 : a.pollInterval, r == null ? void 0 : r.status,
|
|
117
|
+
const f = setInterval(p, a.pollInterval);
|
|
118
|
+
return () => clearInterval(f);
|
|
119
|
+
}, [n, a == null ? void 0 : a.pollInterval, r == null ? void 0 : r.status, p]), { status: r, loading: u, error: s, refetch: p };
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function xt(t, n) {
|
|
122
122
|
if (!t) return t;
|
|
123
123
|
const a = t.indexOf(".");
|
|
124
124
|
if (a === -1) return t;
|
|
125
125
|
let r = t;
|
|
126
126
|
return r.length - a - 1 > n && (r = r.slice(0, a + n + 1)), r = r.replace(/0+$/, "").replace(/\.$/, ""), r;
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const St = {
|
|
129
129
|
step: "amount",
|
|
130
130
|
flowType: "buy",
|
|
131
131
|
fiatCurrency: "USD",
|
|
@@ -143,7 +143,7 @@ const yt = {
|
|
|
143
143
|
country: "",
|
|
144
144
|
errorMessage: null
|
|
145
145
|
};
|
|
146
|
-
function
|
|
146
|
+
function Zt(t, n) {
|
|
147
147
|
switch (n.type) {
|
|
148
148
|
case "SET_STEP":
|
|
149
149
|
return { ...t, step: n.step, errorMessage: null };
|
|
@@ -193,154 +193,158 @@ function Ut(t, n) {
|
|
|
193
193
|
case "CLEAR_ERROR":
|
|
194
194
|
return { ...t, errorMessage: null };
|
|
195
195
|
case "RESET":
|
|
196
|
-
return
|
|
196
|
+
return St;
|
|
197
197
|
default:
|
|
198
198
|
return t;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
const
|
|
202
|
-
function
|
|
201
|
+
const Rt = jt(null);
|
|
202
|
+
function zt({
|
|
203
203
|
projectId: t,
|
|
204
204
|
apiUrl: n = "https://api.nowramp.com",
|
|
205
205
|
assetBaseUrl: a = "",
|
|
206
206
|
flowType: r = "buy",
|
|
207
207
|
customerId: l = "",
|
|
208
|
+
brandId: u,
|
|
208
209
|
defaultFiatCurrency: m = "USD",
|
|
209
|
-
defaultCryptoCurrency:
|
|
210
|
-
defaultNetwork:
|
|
211
|
-
defaultFiatAmount:
|
|
212
|
-
defaultCryptoAmount:
|
|
213
|
-
defaultWalletAddress:
|
|
210
|
+
defaultCryptoCurrency: s = "BTC",
|
|
211
|
+
defaultNetwork: i = "",
|
|
212
|
+
defaultFiatAmount: h = "",
|
|
213
|
+
defaultCryptoAmount: p = "",
|
|
214
|
+
defaultWalletAddress: d = "",
|
|
214
215
|
defaultGateway: f,
|
|
215
|
-
fieldLocks:
|
|
216
|
-
statusPollInterval:
|
|
217
|
-
onComplete:
|
|
218
|
-
onError:
|
|
219
|
-
children:
|
|
216
|
+
fieldLocks: y,
|
|
217
|
+
statusPollInterval: w = 5e3,
|
|
218
|
+
onComplete: b,
|
|
219
|
+
onError: T,
|
|
220
|
+
children: Q
|
|
220
221
|
}) {
|
|
221
|
-
const
|
|
222
|
-
...
|
|
223
|
-
step:
|
|
222
|
+
const Z = j(() => ({ apiUrl: n, projectId: t }), [n, t]), q = i || (s ? s.toLowerCase() : ""), ee = r === "sell", se = ee ? !!p : !!h, L = (ee ? !!(se && s && q) : !!(se && s && q && d)) && f ? "confirm" : "amount", S = h || (r === "buy" ? "250" : ""), [c, C] = $t(Zt, {
|
|
223
|
+
...St,
|
|
224
|
+
step: L,
|
|
224
225
|
flowType: r,
|
|
225
226
|
fiatCurrency: m,
|
|
226
|
-
cryptoCurrency:
|
|
227
|
-
network:
|
|
228
|
-
fiatAmount:
|
|
229
|
-
cryptoAmount:
|
|
230
|
-
walletAddress:
|
|
227
|
+
cryptoCurrency: s,
|
|
228
|
+
network: q,
|
|
229
|
+
fiatAmount: xt(S, 2),
|
|
230
|
+
cryptoAmount: xt(p, 6),
|
|
231
|
+
walletAddress: d,
|
|
231
232
|
customerId: l
|
|
232
|
-
}),
|
|
233
|
+
}), P = c.flowType === "sell", {
|
|
233
234
|
config: I,
|
|
234
|
-
loading:
|
|
235
|
-
error:
|
|
236
|
-
} =
|
|
237
|
-
|
|
238
|
-
var
|
|
235
|
+
loading: Se,
|
|
236
|
+
error: ie
|
|
237
|
+
} = Vt(Z, c.flowType);
|
|
238
|
+
De.useEffect(() => {
|
|
239
|
+
var U, K, M;
|
|
239
240
|
if (!I || !c.cryptoCurrency || c.network) return;
|
|
240
|
-
const
|
|
241
|
-
A != null && A.id &&
|
|
242
|
-
}, [I, c.cryptoCurrency, c.network]),
|
|
243
|
-
var
|
|
244
|
-
if (!((
|
|
245
|
-
const
|
|
241
|
+
const N = (U = I.cryptos) == null ? void 0 : U.find((F) => F.code === c.cryptoCurrency), A = ((K = N == null ? void 0 : N.networks) == null ? void 0 : K.find((F) => F.isDefault)) || ((M = N == null ? void 0 : N.networks) == null ? void 0 : M[0]);
|
|
242
|
+
A != null && A.id && C({ type: "SET_NETWORK", network: A.id });
|
|
243
|
+
}, [I, c.cryptoCurrency, c.network]), De.useEffect(() => {
|
|
244
|
+
var M, F;
|
|
245
|
+
if (!((M = I == null ? void 0 : I.paymentMethods) != null && M.length)) return;
|
|
246
|
+
const N = c.fiatCurrency, A = I.paymentMethods;
|
|
246
247
|
if (c.paymentMethodId && A.some(
|
|
247
|
-
(
|
|
248
|
+
(D) => D.id === c.paymentMethodId && D.supportedFiats.includes(N)
|
|
248
249
|
))
|
|
249
250
|
return;
|
|
250
|
-
const
|
|
251
|
-
(
|
|
252
|
-
) || A.find((
|
|
253
|
-
|
|
251
|
+
const K = A.find(
|
|
252
|
+
(W) => W.supportedFiats.includes(N) && (W.id.includes("card") || W.id.includes("debit"))
|
|
253
|
+
) || A.find((W) => W.supportedFiats.includes(N));
|
|
254
|
+
C({ type: "SET_PAYMENT_METHOD", methodId: (K == null ? void 0 : K.id) || ((F = A[0]) == null ? void 0 : F.id) || "" });
|
|
254
255
|
}, [I, c.fiatCurrency, c.paymentMethodId]);
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
256
|
+
const $ = j(() => {
|
|
257
|
+
if (P) {
|
|
257
258
|
if (!c.cryptoAmount) return null;
|
|
258
|
-
const
|
|
259
|
-
return isNaN(
|
|
259
|
+
const M = parseFloat(c.cryptoAmount);
|
|
260
|
+
return isNaN(M) || M <= 0 ? "Enter a valid amount" : null;
|
|
260
261
|
}
|
|
261
262
|
if (!I || !c.fiatAmount) return null;
|
|
262
|
-
const
|
|
263
|
-
if (isNaN(
|
|
264
|
-
const A = I.fiats.find((
|
|
263
|
+
const N = parseFloat(c.fiatAmount);
|
|
264
|
+
if (isNaN(N)) return null;
|
|
265
|
+
const A = I.fiats.find((M) => M.code === c.fiatCurrency);
|
|
265
266
|
if (!A) return null;
|
|
266
|
-
const
|
|
267
|
-
return !isNaN(
|
|
268
|
-
}, [I, c.fiatAmount, c.fiatCurrency, c.cryptoAmount,
|
|
269
|
-
const
|
|
270
|
-
return !I || !
|
|
267
|
+
const U = parseFloat(A.minAmount), K = parseFloat(A.maxAmount);
|
|
268
|
+
return !isNaN(U) && N < U ? `Minimum amount is ${A.minAmount} ${c.fiatCurrency}` : !isNaN(K) && N > K ? `Maximum amount is ${A.maxAmount} ${c.fiatCurrency}` : null;
|
|
269
|
+
}, [I, c.fiatAmount, c.fiatCurrency, c.cryptoAmount, P]), ue = j(() => {
|
|
270
|
+
const N = P ? !!c.cryptoAmount : !!c.fiatAmount;
|
|
271
|
+
return !I || !N || !c.cryptoCurrency || !c.network || $ ? null : {
|
|
271
272
|
fiatCurrency: c.fiatCurrency,
|
|
272
|
-
...
|
|
273
|
+
...P ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
|
|
273
274
|
cryptoCurrency: c.cryptoCurrency,
|
|
274
275
|
network: c.network,
|
|
275
276
|
paymentMethodId: c.paymentMethodId || void 0,
|
|
276
277
|
country: c.country || void 0,
|
|
277
278
|
orderType: c.flowType
|
|
278
279
|
};
|
|
279
|
-
}, [I, c.fiatCurrency, c.fiatAmount, c.cryptoAmount, c.cryptoCurrency, c.network, c.paymentMethodId, c.country,
|
|
280
|
-
quotes:
|
|
281
|
-
loading:
|
|
282
|
-
error:
|
|
283
|
-
refetch:
|
|
284
|
-
} =
|
|
280
|
+
}, [I, c.fiatCurrency, c.fiatAmount, c.cryptoAmount, c.cryptoCurrency, c.network, c.paymentMethodId, c.country, $, P, c.flowType]), {
|
|
281
|
+
quotes: k,
|
|
282
|
+
loading: xe,
|
|
283
|
+
error: V,
|
|
284
|
+
refetch: ne
|
|
285
|
+
} = Gt(Z, ue), {
|
|
285
286
|
order: ae,
|
|
286
|
-
loading:
|
|
287
|
-
error:
|
|
288
|
-
createOrder:
|
|
289
|
-
} =
|
|
287
|
+
loading: ge,
|
|
288
|
+
error: Re,
|
|
289
|
+
createOrder: me
|
|
290
|
+
} = Yt(Z), G = 15e3, {
|
|
290
291
|
status: Y,
|
|
291
|
-
loading:
|
|
292
|
-
} =
|
|
292
|
+
loading: Me
|
|
293
|
+
} = Qt(
|
|
293
294
|
{ apiUrl: n },
|
|
294
295
|
(ae == null ? void 0 : ae.orderId) ?? null,
|
|
295
|
-
{ pollInterval:
|
|
296
|
+
{ pollInterval: w, initialDelay: G }
|
|
296
297
|
);
|
|
297
|
-
|
|
298
|
-
(Y == null ? void 0 : Y.status) === "completed" &&
|
|
299
|
-
}, [Y == null ? void 0 : Y.status,
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
}, [
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
298
|
+
De.useEffect(() => {
|
|
299
|
+
(Y == null ? void 0 : Y.status) === "completed" && b && b(Y);
|
|
300
|
+
}, [Y == null ? void 0 : Y.status, b]), De.useEffect(() => {
|
|
301
|
+
const N = ie || Re;
|
|
302
|
+
N && T && T(N);
|
|
303
|
+
}, [ie, Re, T]);
|
|
304
|
+
const ve = f || (I == null ? void 0 : I.defaultGateway) || null, Te = X(ve);
|
|
305
|
+
Te.current = ve;
|
|
306
|
+
const Ne = X(k);
|
|
307
|
+
Ne.current = k;
|
|
308
|
+
const be = X(u);
|
|
309
|
+
be.current = u;
|
|
310
|
+
const _e = O(async () => {
|
|
311
|
+
var A, U, K;
|
|
312
|
+
const N = ((A = c.selectedQuote) == null ? void 0 : A.gatewayId) || ((K = (U = Ne.current) == null ? void 0 : U.bestQuote) == null ? void 0 : K.gatewayId) || Te.current;
|
|
313
|
+
if (!N || !c.walletAddress) {
|
|
314
|
+
const M = [!N && "gateway", !c.walletAddress && "walletAddress"].filter(Boolean).join(", ");
|
|
315
|
+
C({ type: "SET_ERROR", message: `Missing required fields: ${M}` });
|
|
313
316
|
return;
|
|
314
317
|
}
|
|
315
318
|
try {
|
|
316
|
-
await
|
|
317
|
-
gateway:
|
|
319
|
+
await me({
|
|
320
|
+
gateway: N,
|
|
318
321
|
customerId: c.customerId || void 0,
|
|
319
322
|
fiatCurrency: c.fiatCurrency,
|
|
320
|
-
...
|
|
323
|
+
...P ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
|
|
321
324
|
cryptoCurrency: c.cryptoCurrency,
|
|
322
325
|
network: c.network,
|
|
323
326
|
walletAddress: c.walletAddress,
|
|
324
327
|
paymentMethodId: c.paymentMethodId || void 0,
|
|
325
328
|
email: c.email || void 0,
|
|
326
|
-
orderType: c.flowType
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
329
|
+
orderType: c.flowType,
|
|
330
|
+
...be.current ? { metadata: { brand: be.current } } : {}
|
|
331
|
+
}), C({ type: "SET_STEP", step: "checkout" });
|
|
332
|
+
} catch (M) {
|
|
333
|
+
const F = M instanceof Error ? M.message : "Failed to create order";
|
|
334
|
+
/wallet|address/i.test(F) ? C({ type: "SET_WALLET_ERROR", message: F.replace(/^Failed to create checkout intent:\s*/i, "") }) : C({ type: "SET_ERROR", message: F });
|
|
331
335
|
}
|
|
332
|
-
}, [c,
|
|
333
|
-
|
|
334
|
-
}, []),
|
|
335
|
-
const
|
|
336
|
-
A > 0 &&
|
|
337
|
-
}, [c.step,
|
|
338
|
-
const
|
|
336
|
+
}, [c, me, P]), pe = O((N) => {
|
|
337
|
+
C({ type: "SET_STEP", step: N });
|
|
338
|
+
}, []), ke = O(() => {
|
|
339
|
+
const N = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], A = N.indexOf(c.step);
|
|
340
|
+
A > 0 && C({ type: "SET_STEP", step: N[A - 1] });
|
|
341
|
+
}, [c.step, P]), Xe = j(() => {
|
|
342
|
+
const N = P ? !!c.cryptoAmount : !!c.fiatAmount;
|
|
339
343
|
switch (c.step) {
|
|
340
344
|
case "confirm":
|
|
341
|
-
return !!(
|
|
345
|
+
return !!(N && c.cryptoCurrency && c.network && c.walletAddress && !$);
|
|
342
346
|
case "amount":
|
|
343
|
-
return !!(
|
|
347
|
+
return !!(N && c.cryptoCurrency && c.network && !$);
|
|
344
348
|
case "quotes":
|
|
345
349
|
return !!c.selectedQuote;
|
|
346
350
|
case "wallet":
|
|
@@ -348,40 +352,40 @@ function Kt({
|
|
|
348
352
|
default:
|
|
349
353
|
return !1;
|
|
350
354
|
}
|
|
351
|
-
}, [c,
|
|
352
|
-
apiConfig:
|
|
355
|
+
}, [c, $, P]), $e = {
|
|
356
|
+
apiConfig: Z,
|
|
353
357
|
assetBaseUrl: a,
|
|
354
358
|
config: I,
|
|
355
|
-
configLoading:
|
|
356
|
-
configError:
|
|
359
|
+
configLoading: Se,
|
|
360
|
+
configError: ie,
|
|
357
361
|
state: c,
|
|
358
|
-
dispatch:
|
|
359
|
-
quotes:
|
|
360
|
-
quotesLoading:
|
|
361
|
-
quotesError:
|
|
362
|
-
fetchQuotes:
|
|
362
|
+
dispatch: C,
|
|
363
|
+
quotes: k,
|
|
364
|
+
quotesLoading: xe,
|
|
365
|
+
quotesError: V,
|
|
366
|
+
fetchQuotes: ne,
|
|
363
367
|
order: ae,
|
|
364
|
-
orderLoading:
|
|
365
|
-
orderError:
|
|
366
|
-
createOrder:
|
|
368
|
+
orderLoading: ge,
|
|
369
|
+
orderError: Re,
|
|
370
|
+
createOrder: _e,
|
|
367
371
|
orderStatus: Y,
|
|
368
|
-
orderStatusLoading:
|
|
369
|
-
fieldLocks:
|
|
370
|
-
defaultGateway:
|
|
371
|
-
amountError:
|
|
372
|
-
goToStep:
|
|
373
|
-
goBack:
|
|
374
|
-
canProceed:
|
|
372
|
+
orderStatusLoading: Me,
|
|
373
|
+
fieldLocks: y || null,
|
|
374
|
+
defaultGateway: ve,
|
|
375
|
+
amountError: $,
|
|
376
|
+
goToStep: pe,
|
|
377
|
+
goBack: ke,
|
|
378
|
+
canProceed: Xe
|
|
375
379
|
};
|
|
376
|
-
return /* @__PURE__ */ e(
|
|
380
|
+
return /* @__PURE__ */ e(Rt.Provider, { value: $e, children: Q });
|
|
377
381
|
}
|
|
378
|
-
function
|
|
379
|
-
const t =
|
|
382
|
+
function we() {
|
|
383
|
+
const t = Wt(Rt);
|
|
380
384
|
if (!t)
|
|
381
385
|
throw new Error("useRamp must be used within a RampProvider");
|
|
382
386
|
return t;
|
|
383
387
|
}
|
|
384
|
-
const
|
|
388
|
+
const Ze = {
|
|
385
389
|
ETH: { name: "Ethereum (ERC20)", shortName: "Ethereum", icon: "eth" },
|
|
386
390
|
BSC: { name: "Binance Smart Chain (BEP20)", shortName: "Binance", icon: "bnb" },
|
|
387
391
|
BTC: { name: "Bitcoin", icon: "btc" },
|
|
@@ -515,7 +519,7 @@ const Fe = {
|
|
|
515
519
|
OKC: { name: "OKX Chain", icon: "eth" },
|
|
516
520
|
UNI_CHAIN: { name: "UNI", icon: "uni" },
|
|
517
521
|
ZEC: { name: "ZCash", icon: "zec" }
|
|
518
|
-
},
|
|
522
|
+
}, Tt = [
|
|
519
523
|
// --- Popular / Top coins ---
|
|
520
524
|
{ code: "BTC", name: "Bitcoin", chains: ["BTC", "LN"], popular: !0 },
|
|
521
525
|
{ code: "ETH", name: "Ethereum", chains: ["ETH", "ARB", "BASE", "BSC", "OPTIMISM", "LINEA", "ZKSYNC", "LRC", "STARK", "APE", "ECLIPSE", "FUEL", "INK", "SOPHON", "UNICHAIN", "WLD"], popular: !0 },
|
|
@@ -708,7 +712,9 @@ const Fe = {
|
|
|
708
712
|
{ code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
|
|
709
713
|
{ code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
|
|
710
714
|
{ code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
|
|
711
|
-
],
|
|
715
|
+
], Jt = Object.fromEntries(
|
|
716
|
+
Tt.map((t) => [t.code, t.name])
|
|
717
|
+
), qt = {
|
|
712
718
|
AED: "ae",
|
|
713
719
|
ALL: "al",
|
|
714
720
|
ARS: "ar",
|
|
@@ -743,21 +749,21 @@ const Fe = {
|
|
|
743
749
|
VND: "vn",
|
|
744
750
|
ZAR: "za"
|
|
745
751
|
};
|
|
746
|
-
function
|
|
752
|
+
function kt(t, n = "") {
|
|
747
753
|
return `${n}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
748
754
|
}
|
|
749
|
-
function
|
|
750
|
-
const a =
|
|
755
|
+
function en(t, n = "") {
|
|
756
|
+
const a = qt[t] || "us";
|
|
751
757
|
return `${n}/flags/${a}.svg`;
|
|
752
758
|
}
|
|
753
|
-
function
|
|
754
|
-
return
|
|
759
|
+
function Ue(t) {
|
|
760
|
+
return Ze[t] || Ze[t.toUpperCase()] || Ze[t.toUpperCase().replace(/-/g, "_")];
|
|
755
761
|
}
|
|
756
|
-
function
|
|
757
|
-
const a =
|
|
762
|
+
function ze(t, n = "") {
|
|
763
|
+
const a = Ue(t);
|
|
758
764
|
return a ? `${n}/crypto-icons/${a.icon}.svg` : `${n}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
759
765
|
}
|
|
760
|
-
const
|
|
766
|
+
const gt = [
|
|
761
767
|
{ code: "ALL", name: "Albania Lek" },
|
|
762
768
|
{ code: "ARS", name: "Argentina Peso" },
|
|
763
769
|
{ code: "AUD", name: "Australian Dollar" },
|
|
@@ -770,14 +776,14 @@ const it = [
|
|
|
770
776
|
{ code: "CHF", name: "Swiss Franc" },
|
|
771
777
|
{ code: "MXN", name: "Mexican Peso" },
|
|
772
778
|
{ code: "INR", name: "Indian Rupee" }
|
|
773
|
-
],
|
|
779
|
+
], vt = [
|
|
774
780
|
{ id: "blue", name: "Blue", accent: "#0077FF" },
|
|
775
781
|
{ id: "violet", name: "Violet", accent: "#7C3AED" },
|
|
776
782
|
{ id: "green", name: "Green", accent: "#10B981" },
|
|
777
783
|
{ id: "orange", name: "Orange", accent: "#F59E0B" },
|
|
778
784
|
{ id: "rose", name: "Rose", accent: "#F43F5E" },
|
|
779
785
|
{ id: "mono", name: "Mono", accent: null }
|
|
780
|
-
],
|
|
786
|
+
], Nt = {
|
|
781
787
|
USDC: { USD: 0.9962, EUR: 1.0814, GBP: 1.2573, JPY: 667e-5, CAD: 0.7198, AUD: 0.6384, BRL: 0.1726, CHF: 1.1306, MXN: 0.0487, INR: 0.01187, ARS: 855e-6, ALL: 0.01058 },
|
|
782
788
|
USDT: { USD: 0.9958, EUR: 1.081, GBP: 1.2568, JPY: 666e-5, CAD: 0.7194, AUD: 0.638, BRL: 0.1724, CHF: 1.1301, MXN: 0.0486, INR: 0.01186, ARS: 854e-6, ALL: 0.01057 },
|
|
783
789
|
BTC: { USD: 104e-7, EUR: 1129e-8, GBP: 1313e-8, JPY: 696e-10, CAD: 751e-8, AUD: 666e-8, BRL: 18e-7, CHF: 118e-7, MXN: 508e-9, INR: 124e-9, ARS: 892e-11, ALL: 11e-8 },
|
|
@@ -787,14 +793,14 @@ const it = [
|
|
|
787
793
|
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 },
|
|
788
794
|
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 }
|
|
789
795
|
};
|
|
790
|
-
function
|
|
796
|
+
function Xn(t, n) {
|
|
791
797
|
var a, r;
|
|
792
|
-
return ((a =
|
|
798
|
+
return ((a = Nt[t]) == null ? void 0 : a[n]) ?? ((r = Nt.USDC) == null ? void 0 : r[n]) ?? 1;
|
|
793
799
|
}
|
|
794
|
-
function
|
|
800
|
+
function tn(t) {
|
|
795
801
|
return parseFloat(t.replace(/,/g, "")) || 0;
|
|
796
802
|
}
|
|
797
|
-
function
|
|
803
|
+
function $n(t) {
|
|
798
804
|
if (t === 0) return "0";
|
|
799
805
|
if (t >= 1e3) return t.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
800
806
|
if (t >= 1) return t.toFixed(2);
|
|
@@ -802,46 +808,91 @@ function In(t) {
|
|
|
802
808
|
const n = t.toPrecision(4);
|
|
803
809
|
return parseFloat(n).toString();
|
|
804
810
|
}
|
|
805
|
-
const
|
|
811
|
+
const le = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), bt = 10, Ct = 1e-4, nn = (() => {
|
|
806
812
|
const t = [];
|
|
807
|
-
for (const n of
|
|
813
|
+
for (const n of Tt)
|
|
808
814
|
for (const a of n.chains)
|
|
809
815
|
t.push({ code: n.code, name: n.name, chain: a, popular: n.popular });
|
|
810
816
|
return t;
|
|
811
817
|
})();
|
|
812
|
-
function
|
|
818
|
+
function Lt({
|
|
819
|
+
src: t,
|
|
820
|
+
alt: n,
|
|
821
|
+
size: a,
|
|
822
|
+
className: r = "",
|
|
823
|
+
background: l
|
|
824
|
+
}) {
|
|
825
|
+
const [u, m] = v(!1), [s, i] = v(!1), h = O(() => m(!0), []), p = O(() => i(!0), []);
|
|
826
|
+
return /* @__PURE__ */ o(
|
|
827
|
+
"div",
|
|
828
|
+
{
|
|
829
|
+
className: `relative rounded-full shrink-0 ${r}`,
|
|
830
|
+
style: { width: a, height: a, background: l },
|
|
831
|
+
children: [
|
|
832
|
+
!u && !s && /* @__PURE__ */ e(
|
|
833
|
+
"div",
|
|
834
|
+
{
|
|
835
|
+
className: "absolute inset-0 rounded-full animate-pulse",
|
|
836
|
+
style: { background: "var(--t-pill-bg, #333)" }
|
|
837
|
+
}
|
|
838
|
+
),
|
|
839
|
+
s ? /* @__PURE__ */ e(
|
|
840
|
+
"div",
|
|
841
|
+
{
|
|
842
|
+
className: "absolute inset-0 rounded-full flex items-center justify-center font-bold",
|
|
843
|
+
style: {
|
|
844
|
+
background: "var(--t-pill-bg, #333)",
|
|
845
|
+
color: "var(--t-text-muted)",
|
|
846
|
+
fontSize: Math.max(8, a * 0.35)
|
|
847
|
+
},
|
|
848
|
+
children: n.slice(0, 3)
|
|
849
|
+
}
|
|
850
|
+
) : /* @__PURE__ */ e(
|
|
851
|
+
"img",
|
|
852
|
+
{
|
|
853
|
+
src: t,
|
|
854
|
+
alt: n,
|
|
855
|
+
width: a,
|
|
856
|
+
height: a,
|
|
857
|
+
loading: "lazy",
|
|
858
|
+
onLoad: h,
|
|
859
|
+
onError: p,
|
|
860
|
+
className: `rounded-full ${u ? "opacity-100" : "opacity-0"}`,
|
|
861
|
+
style: { width: a, height: a, transition: "opacity 0.15s ease-in" }
|
|
862
|
+
}
|
|
863
|
+
)
|
|
864
|
+
]
|
|
865
|
+
}
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
function Et({ ticker: t, size: n = 32, baseUrl: a = "" }) {
|
|
813
869
|
return /* @__PURE__ */ e(
|
|
814
|
-
|
|
870
|
+
Lt,
|
|
815
871
|
{
|
|
816
|
-
src:
|
|
872
|
+
src: kt(t, a),
|
|
817
873
|
alt: t,
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
className: "rounded-full shrink-0",
|
|
821
|
-
style: { width: n, height: n }
|
|
874
|
+
size: n,
|
|
875
|
+
background: "#ffffff"
|
|
822
876
|
}
|
|
823
877
|
);
|
|
824
878
|
}
|
|
825
|
-
function
|
|
879
|
+
function Je({ currencyCode: t, size: n = 16, baseUrl: a = "" }) {
|
|
826
880
|
return /* @__PURE__ */ e(
|
|
827
|
-
|
|
881
|
+
Lt,
|
|
828
882
|
{
|
|
829
|
-
src:
|
|
883
|
+
src: en(t, a),
|
|
830
884
|
alt: t,
|
|
831
|
-
|
|
832
|
-
height: n,
|
|
833
|
-
className: "rounded-full shrink-0",
|
|
834
|
-
style: { width: n, height: n }
|
|
885
|
+
size: n
|
|
835
886
|
}
|
|
836
887
|
);
|
|
837
888
|
}
|
|
838
|
-
function
|
|
889
|
+
function qe({ size: t = 32, color: n = "#888" }) {
|
|
839
890
|
return /* @__PURE__ */ o("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
|
|
840
891
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: n }),
|
|
841
892
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "8", stroke: "white", strokeWidth: "1.5", fill: "none" })
|
|
842
893
|
] });
|
|
843
894
|
}
|
|
844
|
-
function
|
|
895
|
+
function an({ size: t = 24 }) {
|
|
845
896
|
return /* @__PURE__ */ o("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
|
|
846
897
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: "#0077FF" }),
|
|
847
898
|
/* @__PURE__ */ e("path", { d: "M8 15l8-6 8 6H8z", fill: "white" }),
|
|
@@ -851,7 +902,7 @@ function Gt({ size: t = 24 }) {
|
|
|
851
902
|
/* @__PURE__ */ e("rect", { x: "8", y: "22", width: "16", height: "2", rx: "0.5", fill: "white" })
|
|
852
903
|
] });
|
|
853
904
|
}
|
|
854
|
-
function
|
|
905
|
+
function rn({ size: t = 32 }) {
|
|
855
906
|
return /* @__PURE__ */ e(
|
|
856
907
|
"div",
|
|
857
908
|
{
|
|
@@ -861,7 +912,7 @@ function Wt({ size: t = 32 }) {
|
|
|
861
912
|
}
|
|
862
913
|
);
|
|
863
914
|
}
|
|
864
|
-
function
|
|
915
|
+
function on({ size: t = 32 }) {
|
|
865
916
|
return /* @__PURE__ */ e(
|
|
866
917
|
"div",
|
|
867
918
|
{
|
|
@@ -871,7 +922,7 @@ function jt({ size: t = 32 }) {
|
|
|
871
922
|
}
|
|
872
923
|
);
|
|
873
924
|
}
|
|
874
|
-
function
|
|
925
|
+
function ln({ size: t = 32 }) {
|
|
875
926
|
return /* @__PURE__ */ o(
|
|
876
927
|
"div",
|
|
877
928
|
{
|
|
@@ -884,7 +935,7 @@ function Yt({ size: t = 32 }) {
|
|
|
884
935
|
}
|
|
885
936
|
);
|
|
886
937
|
}
|
|
887
|
-
function
|
|
938
|
+
function sn({ size: t = 32 }) {
|
|
888
939
|
return /* @__PURE__ */ e(
|
|
889
940
|
"div",
|
|
890
941
|
{
|
|
@@ -894,7 +945,7 @@ function Qt({ size: t = 32 }) {
|
|
|
894
945
|
}
|
|
895
946
|
);
|
|
896
947
|
}
|
|
897
|
-
function
|
|
948
|
+
function cn({ size: t = 32 }) {
|
|
898
949
|
return /* @__PURE__ */ e(
|
|
899
950
|
"div",
|
|
900
951
|
{
|
|
@@ -907,7 +958,7 @@ function Zt({ size: t = 32 }) {
|
|
|
907
958
|
}
|
|
908
959
|
);
|
|
909
960
|
}
|
|
910
|
-
function
|
|
961
|
+
function Wn({ size: t = 18 }) {
|
|
911
962
|
return /* @__PURE__ */ e(
|
|
912
963
|
"div",
|
|
913
964
|
{
|
|
@@ -917,13 +968,13 @@ function Mn({ size: t = 18 }) {
|
|
|
917
968
|
}
|
|
918
969
|
);
|
|
919
970
|
}
|
|
920
|
-
function
|
|
971
|
+
function Le() {
|
|
921
972
|
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" }) });
|
|
922
973
|
}
|
|
923
|
-
function
|
|
974
|
+
function dn() {
|
|
924
975
|
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" }) });
|
|
925
976
|
}
|
|
926
|
-
function
|
|
977
|
+
function un({ onClick: t }) {
|
|
927
978
|
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(
|
|
928
979
|
"path",
|
|
929
980
|
{
|
|
@@ -932,7 +983,7 @@ function Jt({ onClick: t }) {
|
|
|
932
983
|
}
|
|
933
984
|
) }) });
|
|
934
985
|
}
|
|
935
|
-
function
|
|
986
|
+
function mn({ size: t = 40 }) {
|
|
936
987
|
return /* @__PURE__ */ e(
|
|
937
988
|
"div",
|
|
938
989
|
{
|
|
@@ -945,32 +996,32 @@ function qt({ size: t = 40 }) {
|
|
|
945
996
|
}
|
|
946
997
|
);
|
|
947
998
|
}
|
|
948
|
-
function
|
|
999
|
+
function pn(t, n = 32) {
|
|
949
1000
|
switch (t) {
|
|
950
1001
|
case "revolut":
|
|
951
|
-
return /* @__PURE__ */ e(
|
|
1002
|
+
return /* @__PURE__ */ e(rn, { size: n });
|
|
952
1003
|
case "applepay":
|
|
953
|
-
return /* @__PURE__ */ e(
|
|
1004
|
+
return /* @__PURE__ */ e(on, { size: n });
|
|
954
1005
|
case "card":
|
|
955
|
-
return /* @__PURE__ */ e(
|
|
1006
|
+
return /* @__PURE__ */ e(cn, { size: n });
|
|
956
1007
|
case "googlepay":
|
|
957
|
-
return /* @__PURE__ */ e(
|
|
1008
|
+
return /* @__PURE__ */ e(ln, { size: n });
|
|
958
1009
|
case "paypal":
|
|
959
|
-
return /* @__PURE__ */ e(
|
|
1010
|
+
return /* @__PURE__ */ e(sn, { size: n });
|
|
960
1011
|
case "bank":
|
|
961
|
-
return /* @__PURE__ */ e(
|
|
1012
|
+
return /* @__PURE__ */ e(an, { size: n });
|
|
962
1013
|
default:
|
|
963
|
-
return /* @__PURE__ */ e(
|
|
1014
|
+
return /* @__PURE__ */ e(qe, { size: n });
|
|
964
1015
|
}
|
|
965
1016
|
}
|
|
966
|
-
const
|
|
1017
|
+
const hn = {
|
|
967
1018
|
"debit-credit-card": "card",
|
|
968
1019
|
"bank-transfer": "bank",
|
|
969
1020
|
"apple-pay": "applepay",
|
|
970
1021
|
"google-pay": "googlepay",
|
|
971
1022
|
paypal: "paypal",
|
|
972
1023
|
revolut: "revolut"
|
|
973
|
-
},
|
|
1024
|
+
}, fn = {
|
|
974
1025
|
"debit-credit-card": "Card",
|
|
975
1026
|
"bank-transfer": "Bank Transfer",
|
|
976
1027
|
"ach-bank-transfer": "ACH",
|
|
@@ -980,23 +1031,23 @@ const tn = {
|
|
|
980
1031
|
paypal: "PayPal",
|
|
981
1032
|
revolut: "Revolut"
|
|
982
1033
|
};
|
|
983
|
-
function
|
|
984
|
-
return
|
|
1034
|
+
function It(t, n) {
|
|
1035
|
+
return fn[t] || n;
|
|
985
1036
|
}
|
|
986
|
-
function
|
|
987
|
-
const r =
|
|
988
|
-
return r ?
|
|
1037
|
+
function Mt(t, n, a = 24) {
|
|
1038
|
+
const r = hn[t];
|
|
1039
|
+
return r ? pn(r, a) : n ? /* @__PURE__ */ e("img", { src: n, alt: "", width: a, height: a, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e(qe, { size: a });
|
|
989
1040
|
}
|
|
990
|
-
function
|
|
1041
|
+
function yn({
|
|
991
1042
|
methods: t,
|
|
992
1043
|
selectedId: n,
|
|
993
1044
|
onOpenModal: a,
|
|
994
1045
|
fiatCurrency: r
|
|
995
1046
|
}) {
|
|
996
|
-
const l =
|
|
997
|
-
() => t.filter((
|
|
1047
|
+
const l = j(
|
|
1048
|
+
() => t.filter((m) => m.supportedFiats.includes(r)),
|
|
998
1049
|
[t, r]
|
|
999
|
-
),
|
|
1050
|
+
), u = l.find((m) => m.id === n) || l[0];
|
|
1000
1051
|
return l.length === 0 ? /* @__PURE__ */ e(
|
|
1001
1052
|
"div",
|
|
1002
1053
|
{
|
|
@@ -1011,14 +1062,14 @@ function an({
|
|
|
1011
1062
|
r
|
|
1012
1063
|
] })
|
|
1013
1064
|
}
|
|
1014
|
-
) : /* @__PURE__ */ e(
|
|
1065
|
+
) : /* @__PURE__ */ e(te, { children: /* @__PURE__ */ o(
|
|
1015
1066
|
"div",
|
|
1016
1067
|
{
|
|
1017
1068
|
role: "button",
|
|
1018
1069
|
tabIndex: 0,
|
|
1019
1070
|
onClick: a,
|
|
1020
|
-
onKeyDown: (
|
|
1021
|
-
(
|
|
1071
|
+
onKeyDown: (m) => {
|
|
1072
|
+
(m.key === "Enter" || m.key === " ") && a();
|
|
1022
1073
|
},
|
|
1023
1074
|
className: "flex items-center justify-between w-full px-[18px] transition-colors",
|
|
1024
1075
|
style: {
|
|
@@ -1031,36 +1082,36 @@ function an({
|
|
|
1031
1082
|
children: [
|
|
1032
1083
|
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Payment method" }),
|
|
1033
1084
|
/* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
|
|
1034
|
-
/* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children:
|
|
1035
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
1036
|
-
/* @__PURE__ */ e(
|
|
1085
|
+
/* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: u && Mt(u.id, u.icon, 20) }),
|
|
1086
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: u ? It(u.id, u.name) : "Select" }),
|
|
1087
|
+
/* @__PURE__ */ e(Le, {})
|
|
1037
1088
|
] })
|
|
1038
1089
|
]
|
|
1039
1090
|
}
|
|
1040
1091
|
) });
|
|
1041
1092
|
}
|
|
1042
|
-
function
|
|
1093
|
+
function xn({
|
|
1043
1094
|
className: t = "",
|
|
1044
1095
|
autoRedirect: n = !1,
|
|
1045
1096
|
redirectDelay: a = 3e3
|
|
1046
1097
|
}) {
|
|
1047
|
-
var
|
|
1048
|
-
const { order: r, orderStatus: l, goToStep:
|
|
1049
|
-
if (
|
|
1050
|
-
if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !
|
|
1051
|
-
|
|
1052
|
-
const
|
|
1098
|
+
var f;
|
|
1099
|
+
const { order: r, orderStatus: l, goToStep: u, goBack: m } = we(), [s, i] = v(!1), [h, p] = v(null), d = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
|
|
1100
|
+
if (_(() => {
|
|
1101
|
+
if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !d) {
|
|
1102
|
+
p(Math.ceil(a / 1e3));
|
|
1103
|
+
const y = setTimeout(() => {
|
|
1053
1104
|
window.location.href = r.checkout.url;
|
|
1054
|
-
}, a),
|
|
1055
|
-
|
|
1105
|
+
}, a), w = setInterval(() => {
|
|
1106
|
+
p((b) => b && b > 1 ? b - 1 : null);
|
|
1056
1107
|
}, 1e3);
|
|
1057
1108
|
return () => {
|
|
1058
|
-
clearTimeout(
|
|
1109
|
+
clearTimeout(y), clearInterval(w);
|
|
1059
1110
|
};
|
|
1060
1111
|
}
|
|
1061
|
-
}, [r, n, a,
|
|
1062
|
-
l && (l.status === "completed" ?
|
|
1063
|
-
}, [l == null ? void 0 : l.status,
|
|
1112
|
+
}, [r, n, a, d]), _(() => {
|
|
1113
|
+
l && (l.status === "completed" ? u("complete") : ["failed", "cancelled", "expired"].includes(l.status) && u("error"));
|
|
1114
|
+
}, [l == null ? void 0 : l.status, u]), !r)
|
|
1064
1115
|
return /* @__PURE__ */ o(
|
|
1065
1116
|
"div",
|
|
1066
1117
|
{
|
|
@@ -1080,14 +1131,14 @@ function rn({
|
|
|
1080
1131
|
paddingLeft: 24,
|
|
1081
1132
|
paddingRight: 24
|
|
1082
1133
|
},
|
|
1083
|
-
onClick:
|
|
1134
|
+
onClick: m,
|
|
1084
1135
|
children: "Go Back"
|
|
1085
1136
|
}
|
|
1086
1137
|
)
|
|
1087
1138
|
]
|
|
1088
1139
|
}
|
|
1089
1140
|
);
|
|
1090
|
-
if (
|
|
1141
|
+
if (d)
|
|
1091
1142
|
return /* @__PURE__ */ o(
|
|
1092
1143
|
"div",
|
|
1093
1144
|
{
|
|
@@ -1106,7 +1157,7 @@ function rn({
|
|
|
1106
1157
|
background: "var(--t-cta-bg)",
|
|
1107
1158
|
color: "var(--t-cta-text)"
|
|
1108
1159
|
},
|
|
1109
|
-
onClick:
|
|
1160
|
+
onClick: m,
|
|
1110
1161
|
children: "Start over"
|
|
1111
1162
|
}
|
|
1112
1163
|
)
|
|
@@ -1114,8 +1165,8 @@ function rn({
|
|
|
1114
1165
|
}
|
|
1115
1166
|
);
|
|
1116
1167
|
if (r.checkout.method === "iframe") {
|
|
1117
|
-
const
|
|
1118
|
-
return
|
|
1168
|
+
const y = r.checkout.url, w = ((f = r.checkout.allowedFeatures) == null ? void 0 : f.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
|
|
1169
|
+
return yt(
|
|
1119
1170
|
/* @__PURE__ */ o(
|
|
1120
1171
|
"div",
|
|
1121
1172
|
{
|
|
@@ -1143,7 +1194,7 @@ function rn({
|
|
|
1143
1194
|
children: /* @__PURE__ */ o(
|
|
1144
1195
|
"button",
|
|
1145
1196
|
{
|
|
1146
|
-
onClick:
|
|
1197
|
+
onClick: m,
|
|
1147
1198
|
style: {
|
|
1148
1199
|
display: "flex",
|
|
1149
1200
|
alignItems: "center",
|
|
@@ -1166,7 +1217,7 @@ function rn({
|
|
|
1166
1217
|
}
|
|
1167
1218
|
),
|
|
1168
1219
|
/* @__PURE__ */ o("div", { style: { flex: 1, position: "relative", overflow: "hidden" }, children: [
|
|
1169
|
-
!
|
|
1220
|
+
!s && /* @__PURE__ */ o(
|
|
1170
1221
|
"div",
|
|
1171
1222
|
{
|
|
1172
1223
|
style: {
|
|
@@ -1186,15 +1237,15 @@ function rn({
|
|
|
1186
1237
|
/* @__PURE__ */ e(
|
|
1187
1238
|
"iframe",
|
|
1188
1239
|
{
|
|
1189
|
-
src:
|
|
1240
|
+
src: y,
|
|
1190
1241
|
style: {
|
|
1191
|
-
display:
|
|
1242
|
+
display: s ? "block" : "none",
|
|
1192
1243
|
width: "100%",
|
|
1193
1244
|
height: "100%",
|
|
1194
1245
|
border: "none"
|
|
1195
1246
|
},
|
|
1196
|
-
allow:
|
|
1197
|
-
onLoad: () =>
|
|
1247
|
+
allow: w,
|
|
1248
|
+
onLoad: () => i(!0),
|
|
1198
1249
|
title: "Provider Checkout"
|
|
1199
1250
|
}
|
|
1200
1251
|
)
|
|
@@ -1219,9 +1270,9 @@ function rn({
|
|
|
1219
1270
|
r.gateway,
|
|
1220
1271
|
" to complete your payment."
|
|
1221
1272
|
] }),
|
|
1222
|
-
|
|
1273
|
+
h !== null && /* @__PURE__ */ o("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: [
|
|
1223
1274
|
"Redirecting in ",
|
|
1224
|
-
|
|
1275
|
+
h,
|
|
1225
1276
|
"..."
|
|
1226
1277
|
] }),
|
|
1227
1278
|
/* @__PURE__ */ o(
|
|
@@ -1254,7 +1305,7 @@ function rn({
|
|
|
1254
1305
|
background: "var(--t-surface)",
|
|
1255
1306
|
color: "var(--t-text)"
|
|
1256
1307
|
},
|
|
1257
|
-
onClick:
|
|
1308
|
+
onClick: m,
|
|
1258
1309
|
children: "Cancel"
|
|
1259
1310
|
}
|
|
1260
1311
|
)
|
|
@@ -1262,8 +1313,8 @@ function rn({
|
|
|
1262
1313
|
}
|
|
1263
1314
|
);
|
|
1264
1315
|
if (r.checkout.method === "widget" && r.widgetConfig) {
|
|
1265
|
-
const
|
|
1266
|
-
return
|
|
1316
|
+
const y = gn(r.checkout.url, r.widgetConfig);
|
|
1317
|
+
return yt(
|
|
1267
1318
|
/* @__PURE__ */ o(
|
|
1268
1319
|
"div",
|
|
1269
1320
|
{
|
|
@@ -1291,7 +1342,7 @@ function rn({
|
|
|
1291
1342
|
children: /* @__PURE__ */ o(
|
|
1292
1343
|
"button",
|
|
1293
1344
|
{
|
|
1294
|
-
onClick:
|
|
1345
|
+
onClick: m,
|
|
1295
1346
|
style: {
|
|
1296
1347
|
display: "flex",
|
|
1297
1348
|
alignItems: "center",
|
|
@@ -1314,7 +1365,7 @@ function rn({
|
|
|
1314
1365
|
}
|
|
1315
1366
|
),
|
|
1316
1367
|
/* @__PURE__ */ o("div", { style: { flex: 1, position: "relative", overflow: "hidden" }, children: [
|
|
1317
|
-
!
|
|
1368
|
+
!s && /* @__PURE__ */ o(
|
|
1318
1369
|
"div",
|
|
1319
1370
|
{
|
|
1320
1371
|
style: {
|
|
@@ -1334,15 +1385,15 @@ function rn({
|
|
|
1334
1385
|
/* @__PURE__ */ e(
|
|
1335
1386
|
"iframe",
|
|
1336
1387
|
{
|
|
1337
|
-
src:
|
|
1388
|
+
src: y,
|
|
1338
1389
|
style: {
|
|
1339
|
-
display:
|
|
1390
|
+
display: s ? "block" : "none",
|
|
1340
1391
|
width: "100%",
|
|
1341
1392
|
height: "100%",
|
|
1342
1393
|
border: "none"
|
|
1343
1394
|
},
|
|
1344
1395
|
allow: "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
|
|
1345
|
-
onLoad: () =>
|
|
1396
|
+
onLoad: () => i(!0),
|
|
1346
1397
|
title: "Payment Checkout"
|
|
1347
1398
|
}
|
|
1348
1399
|
)
|
|
@@ -1372,7 +1423,7 @@ function rn({
|
|
|
1372
1423
|
paddingLeft: 24,
|
|
1373
1424
|
paddingRight: 24
|
|
1374
1425
|
},
|
|
1375
|
-
onClick:
|
|
1426
|
+
onClick: m,
|
|
1376
1427
|
children: "Go Back"
|
|
1377
1428
|
}
|
|
1378
1429
|
)
|
|
@@ -1380,15 +1431,15 @@ function rn({
|
|
|
1380
1431
|
}
|
|
1381
1432
|
);
|
|
1382
1433
|
}
|
|
1383
|
-
function
|
|
1434
|
+
function gn(t, n) {
|
|
1384
1435
|
const a = new URL("/en/partner/widget", t);
|
|
1385
1436
|
for (const [r, l] of Object.entries(n))
|
|
1386
1437
|
l != null && l !== "" && a.searchParams.set(r, String(l));
|
|
1387
1438
|
return a.toString();
|
|
1388
1439
|
}
|
|
1389
|
-
function
|
|
1390
|
-
const { orderStatus: n, orderStatusLoading: a, goToStep: r } =
|
|
1391
|
-
|
|
1440
|
+
function vn({ className: t = "" }) {
|
|
1441
|
+
const { orderStatus: n, orderStatusLoading: a, goToStep: r } = we();
|
|
1442
|
+
_(() => {
|
|
1392
1443
|
n && (n.status === "completed" ? r("complete") : ["failed", "cancelled", "expired", "refunded"].includes(n.status) && r("error"));
|
|
1393
1444
|
}, [n == null ? void 0 : n.status, r]);
|
|
1394
1445
|
const l = () => {
|
|
@@ -1407,25 +1458,25 @@ function ln({ className: t = "" }) {
|
|
|
1407
1458
|
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: l() }),
|
|
1408
1459
|
a && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
|
|
1409
1460
|
n && /* @__PURE__ */ o("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1410
|
-
/* @__PURE__ */ e(
|
|
1411
|
-
/* @__PURE__ */ e(
|
|
1461
|
+
/* @__PURE__ */ e(Ae, { label: "Order ID", value: n.orderId, mono: !0 }),
|
|
1462
|
+
/* @__PURE__ */ e(Ae, { label: "Provider", value: n.gateway }),
|
|
1412
1463
|
/* @__PURE__ */ e(
|
|
1413
|
-
|
|
1464
|
+
Ae,
|
|
1414
1465
|
{
|
|
1415
1466
|
label: "Amount",
|
|
1416
1467
|
value: `${n.fiatAmount} ${n.fiatCurrency}`
|
|
1417
1468
|
}
|
|
1418
1469
|
),
|
|
1419
1470
|
/* @__PURE__ */ e(
|
|
1420
|
-
|
|
1471
|
+
Ae,
|
|
1421
1472
|
{
|
|
1422
1473
|
label: "Receiving",
|
|
1423
1474
|
value: `${n.cryptoAmount || "..."} ${n.cryptoCurrency}`
|
|
1424
1475
|
}
|
|
1425
1476
|
),
|
|
1426
|
-
/* @__PURE__ */ e(
|
|
1477
|
+
/* @__PURE__ */ e(Ae, { label: "Network", value: n.network }),
|
|
1427
1478
|
/* @__PURE__ */ e(
|
|
1428
|
-
|
|
1479
|
+
Ae,
|
|
1429
1480
|
{
|
|
1430
1481
|
label: "To Address",
|
|
1431
1482
|
value: `${n.walletAddress.slice(0, 10)}...${n.walletAddress.slice(-8)}`,
|
|
@@ -1439,7 +1490,7 @@ function ln({ className: t = "" }) {
|
|
|
1439
1490
|
] })
|
|
1440
1491
|
] });
|
|
1441
1492
|
}
|
|
1442
|
-
function
|
|
1493
|
+
function Ae({ label: t, value: n, mono: a }) {
|
|
1443
1494
|
return /* @__PURE__ */ o(
|
|
1444
1495
|
"div",
|
|
1445
1496
|
{
|
|
@@ -1459,16 +1510,16 @@ function pe({ label: t, value: n, mono: a }) {
|
|
|
1459
1510
|
}
|
|
1460
1511
|
);
|
|
1461
1512
|
}
|
|
1462
|
-
function
|
|
1513
|
+
function Nn({
|
|
1463
1514
|
className: t = "",
|
|
1464
1515
|
explorerUrl: n,
|
|
1465
1516
|
onDone: a,
|
|
1466
1517
|
doneButtonText: r = "Done"
|
|
1467
1518
|
}) {
|
|
1468
|
-
const { orderStatus: l, state:
|
|
1519
|
+
const { orderStatus: l, state: u, dispatch: m } = we(), s = u.flowType === "sell", i = () => {
|
|
1469
1520
|
if (!(l != null && l.transactionHash)) return null;
|
|
1470
1521
|
if (!n) {
|
|
1471
|
-
const
|
|
1522
|
+
const d = {
|
|
1472
1523
|
ethereum: "https://etherscan.io/tx/{txHash}",
|
|
1473
1524
|
polygon: "https://polygonscan.com/tx/{txHash}",
|
|
1474
1525
|
arbitrum: "https://arbiscan.io/tx/{txHash}",
|
|
@@ -1479,12 +1530,12 @@ function sn({
|
|
|
1479
1530
|
avalanche: "https://snowtrace.io/tx/{txHash}",
|
|
1480
1531
|
fantom: "https://ftmscan.com/tx/{txHash}"
|
|
1481
1532
|
};
|
|
1482
|
-
return (
|
|
1533
|
+
return (d[u.network] || d.ethereum).replace("{txHash}", l.transactionHash);
|
|
1483
1534
|
}
|
|
1484
1535
|
return n.replace("{txHash}", l.transactionHash);
|
|
1485
|
-
},
|
|
1486
|
-
a ? a() :
|
|
1487
|
-
},
|
|
1536
|
+
}, h = () => {
|
|
1537
|
+
a ? a() : m({ type: "RESET" });
|
|
1538
|
+
}, p = i();
|
|
1488
1539
|
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
|
|
1489
1540
|
/* @__PURE__ */ e(
|
|
1490
1541
|
"div",
|
|
@@ -1494,27 +1545,27 @@ function sn({
|
|
|
1494
1545
|
children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: "32", height: "32", fill: "white", children: /* @__PURE__ */ e("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" }) })
|
|
1495
1546
|
}
|
|
1496
1547
|
),
|
|
1497
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children:
|
|
1498
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children:
|
|
1548
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: s ? "Sale Complete!" : "Purchase Complete!" }),
|
|
1549
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: s ? `Your ${(l == null ? void 0 : l.fiatCurrency) || u.fiatCurrency} payout is being processed.` : `Your ${(l == null ? void 0 : l.cryptoCurrency) || u.cryptoCurrency} has been sent to your wallet.` }),
|
|
1499
1550
|
l && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1500
1551
|
/* @__PURE__ */ e(
|
|
1501
|
-
|
|
1552
|
+
de,
|
|
1502
1553
|
{
|
|
1503
|
-
label:
|
|
1554
|
+
label: s ? "Amount Sold" : "Amount Received",
|
|
1504
1555
|
value: `${l.cryptoAmount} ${l.cryptoCurrency}`,
|
|
1505
1556
|
highlight: !0
|
|
1506
1557
|
}
|
|
1507
1558
|
),
|
|
1508
1559
|
/* @__PURE__ */ e(
|
|
1509
|
-
|
|
1560
|
+
de,
|
|
1510
1561
|
{
|
|
1511
|
-
label:
|
|
1562
|
+
label: s ? "Payout Amount" : "Amount Paid",
|
|
1512
1563
|
value: `${l.fiatAmount} ${l.fiatCurrency}`
|
|
1513
1564
|
}
|
|
1514
1565
|
),
|
|
1515
|
-
/* @__PURE__ */ e(
|
|
1566
|
+
/* @__PURE__ */ e(de, { label: "Network", value: l.network }),
|
|
1516
1567
|
/* @__PURE__ */ e(
|
|
1517
|
-
|
|
1568
|
+
de,
|
|
1518
1569
|
{
|
|
1519
1570
|
label: "Wallet",
|
|
1520
1571
|
value: `${l.walletAddress.slice(0, 10)}...${l.walletAddress.slice(-8)}`,
|
|
@@ -1522,17 +1573,17 @@ function sn({
|
|
|
1522
1573
|
}
|
|
1523
1574
|
),
|
|
1524
1575
|
l.transactionHash && /* @__PURE__ */ e(
|
|
1525
|
-
|
|
1576
|
+
de,
|
|
1526
1577
|
{
|
|
1527
1578
|
label: "Transaction",
|
|
1528
1579
|
value: `${l.transactionHash.slice(0, 10)}...${l.transactionHash.slice(-8)}`,
|
|
1529
1580
|
mono: !0
|
|
1530
1581
|
}
|
|
1531
1582
|
),
|
|
1532
|
-
/* @__PURE__ */ e(
|
|
1533
|
-
/* @__PURE__ */ e(
|
|
1583
|
+
/* @__PURE__ */ e(de, { label: "Provider", value: l.gateway }),
|
|
1584
|
+
/* @__PURE__ */ e(de, { label: "Order ID", value: l.orderId, mono: !0 }),
|
|
1534
1585
|
l.completedAt && /* @__PURE__ */ e(
|
|
1535
|
-
|
|
1586
|
+
de,
|
|
1536
1587
|
{
|
|
1537
1588
|
label: "Completed",
|
|
1538
1589
|
value: new Date(l.completedAt).toLocaleString()
|
|
@@ -1540,10 +1591,10 @@ function sn({
|
|
|
1540
1591
|
)
|
|
1541
1592
|
] }),
|
|
1542
1593
|
/* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
|
|
1543
|
-
|
|
1594
|
+
p && /* @__PURE__ */ e(
|
|
1544
1595
|
"a",
|
|
1545
1596
|
{
|
|
1546
|
-
href:
|
|
1597
|
+
href: p,
|
|
1547
1598
|
target: "_blank",
|
|
1548
1599
|
rel: "noopener noreferrer",
|
|
1549
1600
|
className: "w-full font-semibold text-[14px] flex items-center justify-center transition-all",
|
|
@@ -1556,14 +1607,14 @@ function sn({
|
|
|
1556
1607
|
{
|
|
1557
1608
|
className: "w-full font-semibold text-[16px] transition-all",
|
|
1558
1609
|
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
|
|
1559
|
-
onClick:
|
|
1610
|
+
onClick: h,
|
|
1560
1611
|
children: r
|
|
1561
1612
|
}
|
|
1562
1613
|
)
|
|
1563
1614
|
] })
|
|
1564
1615
|
] });
|
|
1565
1616
|
}
|
|
1566
|
-
function
|
|
1617
|
+
function de({ label: t, value: n, mono: a, highlight: r }) {
|
|
1567
1618
|
return /* @__PURE__ */ o(
|
|
1568
1619
|
"div",
|
|
1569
1620
|
{
|
|
@@ -1583,12 +1634,12 @@ function ne({ label: t, value: n, mono: a, highlight: r }) {
|
|
|
1583
1634
|
}
|
|
1584
1635
|
);
|
|
1585
1636
|
}
|
|
1586
|
-
function
|
|
1637
|
+
function bn({
|
|
1587
1638
|
className: t = "",
|
|
1588
1639
|
onRetry: n,
|
|
1589
1640
|
supportEmail: a = "support@nowramp.com"
|
|
1590
1641
|
}) {
|
|
1591
|
-
const { state: r, orderStatus: l, dispatch:
|
|
1642
|
+
const { state: r, orderStatus: l, dispatch: u, goToStep: m } = we(), s = r.flowType === "sell", i = () => {
|
|
1592
1643
|
if (l)
|
|
1593
1644
|
switch (l.status) {
|
|
1594
1645
|
case "failed":
|
|
@@ -1603,26 +1654,26 @@ function cn({
|
|
|
1603
1654
|
return "Something Went Wrong";
|
|
1604
1655
|
}
|
|
1605
1656
|
return "Something Went Wrong";
|
|
1606
|
-
},
|
|
1657
|
+
}, h = () => {
|
|
1607
1658
|
if (r.errorMessage) return r.errorMessage;
|
|
1608
1659
|
if (l)
|
|
1609
1660
|
switch (l.status) {
|
|
1610
1661
|
case "failed":
|
|
1611
|
-
return
|
|
1662
|
+
return s ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
|
|
1612
1663
|
case "cancelled":
|
|
1613
|
-
return
|
|
1664
|
+
return s ? "Your sale was cancelled. No crypto was transferred." : "Your order was cancelled. No payment was processed.";
|
|
1614
1665
|
case "expired":
|
|
1615
|
-
return
|
|
1666
|
+
return s ? "Your order has expired. Please start a new sale." : "Your order has expired. Please start a new purchase.";
|
|
1616
1667
|
case "refunded":
|
|
1617
|
-
return
|
|
1668
|
+
return s ? "Your crypto has been returned. The funds should appear in your wallet shortly." : "Your payment has been refunded. The funds should appear in your account within 5-10 business days.";
|
|
1618
1669
|
default:
|
|
1619
1670
|
return "An unexpected error occurred. Please try again.";
|
|
1620
1671
|
}
|
|
1621
1672
|
return "An unexpected error occurred. Please try again.";
|
|
1622
|
-
},
|
|
1623
|
-
|
|
1624
|
-
},
|
|
1625
|
-
|
|
1673
|
+
}, p = () => {
|
|
1674
|
+
u({ type: "CLEAR_ERROR" }), n ? n() : (u({ type: "RESET" }), m("amount"));
|
|
1675
|
+
}, d = () => {
|
|
1676
|
+
u({ type: "RESET" }), m("amount");
|
|
1626
1677
|
};
|
|
1627
1678
|
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
|
|
1628
1679
|
/* @__PURE__ */ e(
|
|
@@ -1633,8 +1684,8 @@ function cn({
|
|
|
1633
1684
|
children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: "32", height: "32", fill: "white", children: /* @__PURE__ */ e("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" }) })
|
|
1634
1685
|
}
|
|
1635
1686
|
),
|
|
1636
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children:
|
|
1637
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children:
|
|
1687
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: i() }),
|
|
1688
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: h() }),
|
|
1638
1689
|
l && /* @__PURE__ */ e("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", children: [
|
|
1639
1690
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
|
|
1640
1691
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: l.orderId })
|
|
@@ -1645,7 +1696,7 @@ function cn({
|
|
|
1645
1696
|
{
|
|
1646
1697
|
className: "w-full font-semibold text-[16px] transition-all",
|
|
1647
1698
|
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
|
|
1648
|
-
onClick:
|
|
1699
|
+
onClick: p,
|
|
1649
1700
|
children: "Try Again"
|
|
1650
1701
|
}
|
|
1651
1702
|
),
|
|
@@ -1654,7 +1705,7 @@ function cn({
|
|
|
1654
1705
|
{
|
|
1655
1706
|
className: "w-full font-semibold text-[14px] transition-all",
|
|
1656
1707
|
style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)" },
|
|
1657
|
-
onClick:
|
|
1708
|
+
onClick: d,
|
|
1658
1709
|
children: "Start Over"
|
|
1659
1710
|
}
|
|
1660
1711
|
)
|
|
@@ -1680,68 +1731,68 @@ function cn({
|
|
|
1680
1731
|
] })
|
|
1681
1732
|
] });
|
|
1682
1733
|
}
|
|
1683
|
-
function
|
|
1734
|
+
function At(t) {
|
|
1684
1735
|
return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
|
|
1685
1736
|
}
|
|
1686
|
-
function
|
|
1737
|
+
function Cn({ className: t = "" }) {
|
|
1687
1738
|
const {
|
|
1688
1739
|
config: n,
|
|
1689
1740
|
configLoading: a,
|
|
1690
1741
|
state: r,
|
|
1691
1742
|
defaultGateway: l,
|
|
1692
|
-
fetchQuotes:
|
|
1693
|
-
createOrder:
|
|
1694
|
-
orderLoading:
|
|
1695
|
-
} =
|
|
1696
|
-
|
|
1743
|
+
fetchQuotes: u,
|
|
1744
|
+
createOrder: m,
|
|
1745
|
+
orderLoading: s
|
|
1746
|
+
} = we(), i = r.flowType === "sell", [h, p] = v(null), d = n == null ? void 0 : n.gateways.find((y) => y.id === l), f = async () => {
|
|
1747
|
+
p(null);
|
|
1697
1748
|
try {
|
|
1698
|
-
|
|
1699
|
-
} catch (
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1749
|
+
u(), await m();
|
|
1750
|
+
} catch (y) {
|
|
1751
|
+
const w = y instanceof Error ? y.message : "Failed to create order";
|
|
1752
|
+
p(w);
|
|
1702
1753
|
}
|
|
1703
1754
|
};
|
|
1704
1755
|
return a ? /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
|
|
1705
1756
|
/* @__PURE__ */ e("div", { className: "nramp-spinner" }),
|
|
1706
1757
|
/* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
|
|
1707
1758
|
] }) : /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
|
|
1708
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children:
|
|
1759
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: i ? "Confirm Sale" : "Confirm Purchase" }),
|
|
1709
1760
|
/* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1710
|
-
|
|
1761
|
+
d && /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
1711
1762
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Provider" }),
|
|
1712
1763
|
/* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
|
|
1713
|
-
|
|
1714
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
1764
|
+
d.logo && /* @__PURE__ */ e("img", { src: d.logo, alt: d.name, width: 20, height: 20, style: { borderRadius: 4 } }),
|
|
1765
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: d.name })
|
|
1715
1766
|
] })
|
|
1716
1767
|
] }),
|
|
1717
|
-
|
|
1718
|
-
/* @__PURE__ */ e(
|
|
1719
|
-
/* @__PURE__ */ e(
|
|
1720
|
-
] }) : /* @__PURE__ */ o(
|
|
1721
|
-
/* @__PURE__ */ e(
|
|
1722
|
-
/* @__PURE__ */ e(
|
|
1723
|
-
/* @__PURE__ */ e(
|
|
1768
|
+
i ? /* @__PURE__ */ o(te, { children: [
|
|
1769
|
+
/* @__PURE__ */ e(ye, { label: "You sell", value: `${r.cryptoAmount} ${r.cryptoCurrency}`, highlight: !0 }),
|
|
1770
|
+
/* @__PURE__ */ e(ye, { label: "You receive", value: `${r.fiatCurrency} payout` })
|
|
1771
|
+
] }) : /* @__PURE__ */ o(te, { children: [
|
|
1772
|
+
/* @__PURE__ */ e(ye, { label: "You pay", value: `${r.fiatAmount} ${r.fiatCurrency}`, highlight: !0 }),
|
|
1773
|
+
/* @__PURE__ */ e(ye, { label: "You receive", value: `${r.cryptoCurrency} on ${r.network}` }),
|
|
1774
|
+
/* @__PURE__ */ e(ye, { label: "Wallet", value: At(r.walletAddress), mono: !0 })
|
|
1724
1775
|
] }),
|
|
1725
|
-
/* @__PURE__ */ e(
|
|
1726
|
-
|
|
1776
|
+
/* @__PURE__ */ e(ye, { label: "Network", value: r.network }),
|
|
1777
|
+
i && r.walletAddress && /* @__PURE__ */ e(ye, { label: "Refund address", value: At(r.walletAddress), mono: !0 })
|
|
1727
1778
|
] }),
|
|
1728
|
-
|
|
1779
|
+
h && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: h }),
|
|
1729
1780
|
/* @__PURE__ */ e(
|
|
1730
1781
|
"button",
|
|
1731
1782
|
{
|
|
1732
1783
|
className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
|
|
1733
|
-
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity:
|
|
1734
|
-
disabled:
|
|
1735
|
-
onClick:
|
|
1736
|
-
children:
|
|
1784
|
+
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: s ? 0.7 : 1 },
|
|
1785
|
+
disabled: s,
|
|
1786
|
+
onClick: f,
|
|
1787
|
+
children: s ? /* @__PURE__ */ o(te, { children: [
|
|
1737
1788
|
/* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
|
|
1738
1789
|
"Processing..."
|
|
1739
|
-
] }) :
|
|
1790
|
+
] }) : i ? "Confirm & Sell" : "Confirm & Pay"
|
|
1740
1791
|
}
|
|
1741
1792
|
)
|
|
1742
1793
|
] });
|
|
1743
1794
|
}
|
|
1744
|
-
function
|
|
1795
|
+
function ye({ label: t, value: n, mono: a, highlight: r }) {
|
|
1745
1796
|
return /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
1746
1797
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
|
|
1747
1798
|
/* @__PURE__ */ e(
|
|
@@ -1754,95 +1805,95 @@ function se({ label: t, value: n, mono: a, highlight: r }) {
|
|
|
1754
1805
|
)
|
|
1755
1806
|
] });
|
|
1756
1807
|
}
|
|
1757
|
-
function
|
|
1808
|
+
function He({
|
|
1758
1809
|
isOpen: t,
|
|
1759
1810
|
onClose: n,
|
|
1760
1811
|
children: a
|
|
1761
1812
|
}) {
|
|
1762
|
-
const [r, l] =
|
|
1763
|
-
|
|
1813
|
+
const [r, l] = v(!1), [u, m] = v(!1);
|
|
1814
|
+
_(() => {
|
|
1764
1815
|
if (t)
|
|
1765
|
-
l(!0), requestAnimationFrame(() => requestAnimationFrame(() =>
|
|
1816
|
+
l(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
|
|
1766
1817
|
else if (r) {
|
|
1767
|
-
|
|
1768
|
-
const
|
|
1769
|
-
return () => clearTimeout(
|
|
1818
|
+
m(!1);
|
|
1819
|
+
const i = setTimeout(() => l(!1), 250);
|
|
1820
|
+
return () => clearTimeout(i);
|
|
1770
1821
|
}
|
|
1771
1822
|
}, [t]);
|
|
1772
|
-
const
|
|
1773
|
-
|
|
1823
|
+
const s = O(() => {
|
|
1824
|
+
m(!1), setTimeout(() => n(), 250);
|
|
1774
1825
|
}, [n]);
|
|
1775
|
-
return
|
|
1826
|
+
return _(() => {
|
|
1776
1827
|
if (!t) return;
|
|
1777
|
-
const
|
|
1778
|
-
|
|
1828
|
+
const i = (h) => {
|
|
1829
|
+
h.key === "Escape" && s();
|
|
1779
1830
|
};
|
|
1780
|
-
return window.addEventListener("keydown",
|
|
1781
|
-
}, [t,
|
|
1831
|
+
return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
|
|
1832
|
+
}, [t, s]), r ? /* @__PURE__ */ e(
|
|
1782
1833
|
"div",
|
|
1783
1834
|
{
|
|
1784
1835
|
className: "absolute inset-0 z-20 transition-opacity duration-250",
|
|
1785
|
-
style: { opacity:
|
|
1836
|
+
style: { opacity: u ? 1 : 0 },
|
|
1786
1837
|
children: /* @__PURE__ */ e(
|
|
1787
1838
|
"div",
|
|
1788
1839
|
{
|
|
1789
1840
|
className: "absolute inset-0 flex flex-col transition-transform duration-250 ease-out",
|
|
1790
|
-
style: { background: "var(--t-modal-bg)", transform:
|
|
1791
|
-
children: typeof a == "function" ? a(
|
|
1841
|
+
style: { background: "var(--t-modal-bg)", transform: u ? "translateY(0)" : "translateY(24px)" },
|
|
1842
|
+
children: typeof a == "function" ? a(s) : a
|
|
1792
1843
|
}
|
|
1793
1844
|
)
|
|
1794
1845
|
}
|
|
1795
1846
|
) : null;
|
|
1796
1847
|
}
|
|
1797
|
-
function
|
|
1848
|
+
function En({ char: t, height: n = 38 }) {
|
|
1798
1849
|
const a = "0123456789", r = a.indexOf(t);
|
|
1799
1850
|
return r === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: n, lineHeight: `${n}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${r * n}px)` }, children: a.split("").map((l) => /* @__PURE__ */ e("span", { className: "block", style: { height: n, lineHeight: `${n}px` }, children: l }, l)) }) });
|
|
1800
1851
|
}
|
|
1801
|
-
function
|
|
1852
|
+
function An({
|
|
1802
1853
|
value: t,
|
|
1803
1854
|
height: n = 38,
|
|
1804
1855
|
className: a = "",
|
|
1805
1856
|
style: r = {}
|
|
1806
1857
|
}) {
|
|
1807
|
-
return /* @__PURE__ */ e("span", { className: a, style: { display: "inline-flex", ...r }, children: t.split("").map((l,
|
|
1858
|
+
return /* @__PURE__ */ e("span", { className: a, style: { display: "inline-flex", ...r }, children: t.split("").map((l, u) => /* @__PURE__ */ e(En, { char: l, height: n }, u)) });
|
|
1808
1859
|
}
|
|
1809
|
-
function
|
|
1860
|
+
function B({
|
|
1810
1861
|
w: t,
|
|
1811
1862
|
h: n,
|
|
1812
1863
|
className: a = ""
|
|
1813
1864
|
}) {
|
|
1814
1865
|
return /* @__PURE__ */ e("div", { className: `skeleton ${a}`, style: { width: t, height: n } });
|
|
1815
1866
|
}
|
|
1816
|
-
function
|
|
1867
|
+
function wn() {
|
|
1817
1868
|
return /* @__PURE__ */ o("div", { className: "flex-1 px-5 flex flex-col", children: [
|
|
1818
1869
|
/* @__PURE__ */ o("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
|
|
1819
|
-
/* @__PURE__ */ e(
|
|
1870
|
+
/* @__PURE__ */ e(B, { w: 70, h: 14, className: "mb-3" }),
|
|
1820
1871
|
/* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
|
|
1821
|
-
/* @__PURE__ */ e(
|
|
1822
|
-
/* @__PURE__ */ e(
|
|
1872
|
+
/* @__PURE__ */ e(B, { w: 120, h: 32 }),
|
|
1873
|
+
/* @__PURE__ */ e(B, { w: 75, h: 32 })
|
|
1823
1874
|
] })
|
|
1824
1875
|
] }),
|
|
1825
1876
|
/* @__PURE__ */ o("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
|
|
1826
|
-
/* @__PURE__ */ e(
|
|
1877
|
+
/* @__PURE__ */ e(B, { w: 50, h: 14, className: "mb-3" }),
|
|
1827
1878
|
/* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
|
|
1828
|
-
/* @__PURE__ */ e(
|
|
1829
|
-
/* @__PURE__ */ e(
|
|
1879
|
+
/* @__PURE__ */ e(B, { w: 180, h: 32 }),
|
|
1880
|
+
/* @__PURE__ */ e(B, { w: 85, h: 32 })
|
|
1830
1881
|
] })
|
|
1831
1882
|
] }),
|
|
1832
1883
|
/* @__PURE__ */ o("div", { className: "flex justify-between mt-3 px-[2px]", children: [
|
|
1833
|
-
/* @__PURE__ */ e(
|
|
1834
|
-
/* @__PURE__ */ e(
|
|
1884
|
+
/* @__PURE__ */ e(B, { w: 140, h: 12 }),
|
|
1885
|
+
/* @__PURE__ */ e(B, { w: 90, h: 12 })
|
|
1835
1886
|
] }),
|
|
1836
1887
|
/* @__PURE__ */ o("div", { className: "mt-8", children: [
|
|
1837
|
-
/* @__PURE__ */ e(
|
|
1838
|
-
/* @__PURE__ */ e(
|
|
1888
|
+
/* @__PURE__ */ e(B, { w: 65, h: 14, className: "mb-2.5" }),
|
|
1889
|
+
/* @__PURE__ */ e(B, { w: "100%", h: 47 })
|
|
1839
1890
|
] }),
|
|
1840
1891
|
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
1841
|
-
/* @__PURE__ */ e(
|
|
1892
|
+
/* @__PURE__ */ e(B, { w: "100%", h: 60, className: "mb-2" }),
|
|
1842
1893
|
/* @__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" }) })
|
|
1843
1894
|
] });
|
|
1844
1895
|
}
|
|
1845
|
-
function
|
|
1896
|
+
function Ie({ onClick: t }) {
|
|
1846
1897
|
return /* @__PURE__ */ e(
|
|
1847
1898
|
"button",
|
|
1848
1899
|
{
|
|
@@ -1855,7 +1906,7 @@ function ve({ onClick: t }) {
|
|
|
1855
1906
|
}
|
|
1856
1907
|
);
|
|
1857
1908
|
}
|
|
1858
|
-
function
|
|
1909
|
+
function Fe({
|
|
1859
1910
|
value: t,
|
|
1860
1911
|
onChange: n,
|
|
1861
1912
|
placeholder: a = ""
|
|
@@ -1883,88 +1934,172 @@ function Be({
|
|
|
1883
1934
|
)
|
|
1884
1935
|
] });
|
|
1885
1936
|
}
|
|
1886
|
-
function
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1937
|
+
function Sn({
|
|
1938
|
+
onClose: t,
|
|
1939
|
+
onSelect: n,
|
|
1940
|
+
currencies: a,
|
|
1941
|
+
assetBaseUrl: r = "",
|
|
1942
|
+
selectedCode: l
|
|
1943
|
+
}) {
|
|
1944
|
+
const [u, m] = v(""), s = j(() => {
|
|
1945
|
+
if (!a || a.length === 0) return gt;
|
|
1946
|
+
const h = new Map(gt.map((p) => [p.code, p.name]));
|
|
1947
|
+
return a.map((p) => ({
|
|
1948
|
+
code: p.code,
|
|
1949
|
+
name: p.name || h.get(p.code) || p.code
|
|
1893
1950
|
}));
|
|
1894
|
-
}, [a]),
|
|
1895
|
-
const
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1951
|
+
}, [a]), i = j(() => {
|
|
1952
|
+
const h = u.trim().toLowerCase();
|
|
1953
|
+
if (!h) {
|
|
1954
|
+
if (l) {
|
|
1955
|
+
const p = s.find((d) => d.code === l);
|
|
1956
|
+
if (p) {
|
|
1957
|
+
const d = s.filter((f) => f.code !== l);
|
|
1958
|
+
return [p, ...d];
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
return s;
|
|
1962
|
+
}
|
|
1963
|
+
return s.filter(
|
|
1964
|
+
(p) => p.code.toLowerCase().includes(h) || p.name.toLowerCase().includes(h)
|
|
1965
|
+
);
|
|
1966
|
+
}, [s, u, l]);
|
|
1967
|
+
return /* @__PURE__ */ o(te, { children: [
|
|
1968
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Ie, { onClick: t }) }),
|
|
1902
1969
|
/* @__PURE__ */ e(
|
|
1903
1970
|
"h2",
|
|
1904
1971
|
{
|
|
1905
1972
|
className: "text-center text-[17px] font-medium mt-2 mb-6",
|
|
1906
|
-
style: {
|
|
1973
|
+
style: {
|
|
1974
|
+
color: "var(--t-text)",
|
|
1975
|
+
fontSize: 17,
|
|
1976
|
+
fontWeight: 500,
|
|
1977
|
+
marginTop: 8,
|
|
1978
|
+
marginBottom: 24
|
|
1979
|
+
},
|
|
1907
1980
|
children: "Select fiat currency"
|
|
1908
1981
|
}
|
|
1909
1982
|
),
|
|
1910
|
-
/* @__PURE__ */ e(
|
|
1983
|
+
/* @__PURE__ */ e(Fe, { value: u, onChange: m }),
|
|
1911
1984
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
1912
|
-
|
|
1913
|
-
"
|
|
1914
|
-
{
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1985
|
+
i.map((h, p) => {
|
|
1986
|
+
const d = h.name !== h.code ? h.name : "", f = l === h.code;
|
|
1987
|
+
return /* @__PURE__ */ o("div", { children: [
|
|
1988
|
+
/* @__PURE__ */ o(
|
|
1989
|
+
"button",
|
|
1990
|
+
{
|
|
1991
|
+
onClick: () => n(h.code),
|
|
1992
|
+
className: "flex items-center w-full transition-colors rounded-lg hover-item",
|
|
1993
|
+
style: { color: "var(--t-text)", gap: 14, padding: "18px 8px", margin: "0 -8px" },
|
|
1994
|
+
children: [
|
|
1995
|
+
/* @__PURE__ */ e(Je, { currencyCode: h.code, size: 32, baseUrl: r }),
|
|
1996
|
+
/* @__PURE__ */ o("div", { className: "text-left flex-1 flex items-center gap-2", children: [
|
|
1997
|
+
/* @__PURE__ */ e("span", { className: "font-semibold text-[15px]", children: h.code }),
|
|
1998
|
+
d && /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: d })
|
|
1999
|
+
] }),
|
|
2000
|
+
f && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className: "shrink-0", children: /* @__PURE__ */ e(
|
|
2001
|
+
"path",
|
|
2002
|
+
{
|
|
2003
|
+
d: "M13.5 4.5L6 12L2.5 8.5",
|
|
2004
|
+
stroke: "var(--t-success, #4CD964)",
|
|
2005
|
+
strokeWidth: "2",
|
|
2006
|
+
strokeLinecap: "round",
|
|
2007
|
+
strokeLinejoin: "round"
|
|
2008
|
+
}
|
|
2009
|
+
) })
|
|
2010
|
+
]
|
|
2011
|
+
}
|
|
2012
|
+
),
|
|
2013
|
+
p < i.length - 1 && /* @__PURE__ */ e(
|
|
2014
|
+
"div",
|
|
2015
|
+
{
|
|
2016
|
+
style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" }
|
|
2017
|
+
}
|
|
2018
|
+
)
|
|
2019
|
+
] }, h.code);
|
|
2020
|
+
}),
|
|
2021
|
+
i.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
|
|
1929
2022
|
] })
|
|
1930
2023
|
] });
|
|
1931
2024
|
}
|
|
1932
|
-
function
|
|
1933
|
-
const [
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
2025
|
+
function wt({ src: t, alt: n, size: a, className: r, style: l }) {
|
|
2026
|
+
const [u, m] = v(!1), [s, i] = v(!1), h = O(() => m(!0), []), p = O(() => i(!0), []);
|
|
2027
|
+
return /* @__PURE__ */ o("div", { className: r, style: { ...l, width: a, height: a, position: "relative" }, children: [
|
|
2028
|
+
!u && !s && /* @__PURE__ */ e(
|
|
2029
|
+
"div",
|
|
2030
|
+
{
|
|
2031
|
+
className: "absolute inset-0 rounded-full animate-pulse",
|
|
2032
|
+
style: { background: "var(--t-pill-bg, #333)" }
|
|
2033
|
+
}
|
|
2034
|
+
),
|
|
2035
|
+
s ? /* @__PURE__ */ e(
|
|
2036
|
+
"div",
|
|
2037
|
+
{
|
|
2038
|
+
className: "absolute inset-0 rounded-full flex items-center justify-center text-[10px] font-bold",
|
|
2039
|
+
style: { background: "var(--t-pill-bg, #333)", color: "var(--t-text-muted)" },
|
|
2040
|
+
children: n.slice(0, 3)
|
|
2041
|
+
}
|
|
2042
|
+
) : /* @__PURE__ */ e(
|
|
2043
|
+
"img",
|
|
2044
|
+
{
|
|
2045
|
+
src: t,
|
|
2046
|
+
alt: n,
|
|
2047
|
+
width: a,
|
|
2048
|
+
height: a,
|
|
2049
|
+
loading: "lazy",
|
|
2050
|
+
onLoad: h,
|
|
2051
|
+
onError: p,
|
|
2052
|
+
className: `rounded-full ${u ? "opacity-100" : "opacity-0"}`,
|
|
2053
|
+
style: { width: a, height: a, transition: "opacity 0.15s ease-in" }
|
|
2054
|
+
}
|
|
2055
|
+
)
|
|
2056
|
+
] });
|
|
2057
|
+
}
|
|
2058
|
+
function Rn({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: r = "", selectedCode: l, selectedChain: u }) {
|
|
2059
|
+
const [m, s] = v(""), i = j(() => {
|
|
2060
|
+
if (!a || a.length === 0) return nn;
|
|
2061
|
+
const d = [];
|
|
2062
|
+
for (const f of a) {
|
|
2063
|
+
const y = f.networks || [], w = f.name || Jt[f.code] || f.code;
|
|
2064
|
+
if (y.length === 0)
|
|
2065
|
+
d.push({ code: f.code, name: w, chain: f.code, popular: !1 });
|
|
1940
2066
|
else
|
|
1941
|
-
for (const
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1944
|
-
code:
|
|
1945
|
-
name:
|
|
1946
|
-
chain:
|
|
1947
|
-
chainName:
|
|
2067
|
+
for (const b of y) {
|
|
2068
|
+
const T = b.code || b.id || b.name || f.code;
|
|
2069
|
+
d.push({
|
|
2070
|
+
code: f.code,
|
|
2071
|
+
name: w,
|
|
2072
|
+
chain: T,
|
|
2073
|
+
chainName: b.name,
|
|
1948
2074
|
popular: !1
|
|
1949
2075
|
});
|
|
1950
2076
|
}
|
|
1951
2077
|
}
|
|
1952
|
-
return
|
|
1953
|
-
}, [a]), u =
|
|
1954
|
-
var
|
|
1955
|
-
const
|
|
1956
|
-
if (!
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2078
|
+
return d;
|
|
2079
|
+
}, [a]), h = O((d, f) => l === d && u === f, [l, u]), p = j(() => {
|
|
2080
|
+
var w;
|
|
2081
|
+
const d = m.trim().toLowerCase();
|
|
2082
|
+
if (!d) {
|
|
2083
|
+
if (l && u) {
|
|
2084
|
+
const b = i.find((T) => T.code === l && T.chain === u);
|
|
2085
|
+
if (b) {
|
|
2086
|
+
const T = i.filter((Q) => !(Q.code === l && Q.chain === u));
|
|
2087
|
+
return [b, ...T];
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
return i;
|
|
2091
|
+
}
|
|
2092
|
+
const f = d.split(/\s+/), y = [];
|
|
2093
|
+
for (const b of i) {
|
|
2094
|
+
const T = Ue(b.chain), Q = T ? T.name.toLowerCase() : "", Z = ((w = T == null ? void 0 : T.shortName) == null ? void 0 : w.toLowerCase()) || "", q = b.chain.toLowerCase(), ee = b.code.toLowerCase(), se = b.name.toLowerCase(), g = [ee, se, Q, Z, q];
|
|
2095
|
+
if (!f.every((c) => g.some((C) => C.includes(c)))) continue;
|
|
2096
|
+
let S = 0;
|
|
2097
|
+
ee === d ? S += 100 : ee.startsWith(f[0]) && (S += 50), b.popular && (S += 10), f.length > 1 && (Q.includes(f[1]) || Z.includes(f[1]) || q.includes(f[1])) && (S += 25), y.push({ item: b, score: S });
|
|
1963
2098
|
}
|
|
1964
|
-
return
|
|
1965
|
-
}, [
|
|
1966
|
-
return /* @__PURE__ */ o(
|
|
1967
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2099
|
+
return y.sort((b, T) => T.score - b.score), y.map((b) => b.item);
|
|
2100
|
+
}, [i, m, l, u]);
|
|
2101
|
+
return /* @__PURE__ */ o(te, { children: [
|
|
2102
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Ie, { onClick: t }) }),
|
|
1968
2103
|
/* @__PURE__ */ e(
|
|
1969
2104
|
"h2",
|
|
1970
2105
|
{
|
|
@@ -1973,81 +2108,121 @@ function fn({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: r = "" }) {
|
|
|
1973
2108
|
children: "Select crypto currency"
|
|
1974
2109
|
}
|
|
1975
2110
|
),
|
|
1976
|
-
/* @__PURE__ */ e(
|
|
2111
|
+
/* @__PURE__ */ e(Fe, { value: m, onChange: s }),
|
|
1977
2112
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
1978
|
-
|
|
1979
|
-
const
|
|
1980
|
-
return /* @__PURE__ */ o(
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
alt: s.chain,
|
|
2003
|
-
width: 16,
|
|
2004
|
-
height: 16,
|
|
2005
|
-
className: "rounded-full absolute",
|
|
2006
|
-
style: {
|
|
2007
|
-
width: 16,
|
|
2008
|
-
height: 16,
|
|
2009
|
-
bottom: 0,
|
|
2010
|
-
right: 0,
|
|
2011
|
-
border: "2px solid var(--t-chain-border)"
|
|
2113
|
+
p.map((d, f) => {
|
|
2114
|
+
const y = Ue(d.chain), w = (y == null ? void 0 : y.name) || d.chainName || d.chain, b = d.name !== d.code ? d.name : "", T = h(d.code, d.chain);
|
|
2115
|
+
return /* @__PURE__ */ o("div", { children: [
|
|
2116
|
+
/* @__PURE__ */ o(
|
|
2117
|
+
"button",
|
|
2118
|
+
{
|
|
2119
|
+
onClick: () => n(d.code, d.chain),
|
|
2120
|
+
className: "flex items-center w-full transition-colors rounded-lg hover-item",
|
|
2121
|
+
style: { gap: 14, padding: "18px 8px", margin: "0 -8px" },
|
|
2122
|
+
children: [
|
|
2123
|
+
/* @__PURE__ */ o("div", { className: "relative shrink-0", style: { width: 40, height: 40 }, children: [
|
|
2124
|
+
/* @__PURE__ */ e(
|
|
2125
|
+
"div",
|
|
2126
|
+
{
|
|
2127
|
+
className: "absolute top-0 left-0",
|
|
2128
|
+
style: { background: "#ffffff", borderRadius: "50%" },
|
|
2129
|
+
children: /* @__PURE__ */ e(
|
|
2130
|
+
wt,
|
|
2131
|
+
{
|
|
2132
|
+
src: kt(d.code, r),
|
|
2133
|
+
alt: d.code,
|
|
2134
|
+
size: 32
|
|
2135
|
+
}
|
|
2136
|
+
)
|
|
2012
2137
|
}
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2138
|
+
),
|
|
2139
|
+
/* @__PURE__ */ e(
|
|
2140
|
+
"div",
|
|
2141
|
+
{
|
|
2142
|
+
className: "absolute",
|
|
2143
|
+
style: {
|
|
2144
|
+
bottom: 0,
|
|
2145
|
+
right: 0,
|
|
2146
|
+
border: "2px solid var(--t-surface, #1C1C22)",
|
|
2147
|
+
borderRadius: "50%",
|
|
2148
|
+
background: "#ffffff"
|
|
2149
|
+
},
|
|
2150
|
+
children: /* @__PURE__ */ e(
|
|
2151
|
+
wt,
|
|
2152
|
+
{
|
|
2153
|
+
src: ze(d.chain, r),
|
|
2154
|
+
alt: d.chain,
|
|
2155
|
+
size: 16
|
|
2156
|
+
}
|
|
2157
|
+
)
|
|
2158
|
+
}
|
|
2159
|
+
)
|
|
2160
|
+
] }),
|
|
2161
|
+
/* @__PURE__ */ e("div", { className: "text-left flex-1 min-w-0", children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
2162
|
+
/* @__PURE__ */ e(
|
|
2163
|
+
"span",
|
|
2164
|
+
{
|
|
2165
|
+
className: "font-semibold text-[15px]",
|
|
2166
|
+
style: { color: "var(--t-text)" },
|
|
2167
|
+
children: d.code
|
|
2168
|
+
}
|
|
2169
|
+
),
|
|
2170
|
+
b && /* @__PURE__ */ e(
|
|
2171
|
+
"span",
|
|
2172
|
+
{
|
|
2173
|
+
className: "text-[13px]",
|
|
2174
|
+
style: { color: "var(--t-text-secondary)" },
|
|
2175
|
+
children: b
|
|
2176
|
+
}
|
|
2177
|
+
)
|
|
2178
|
+
] }) }),
|
|
2179
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
2180
|
+
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: w }),
|
|
2181
|
+
T && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
2182
|
+
"path",
|
|
2183
|
+
{
|
|
2184
|
+
d: "M13.5 4.5L6 12L2.5 8.5",
|
|
2185
|
+
stroke: "var(--t-success, #4CD964)",
|
|
2186
|
+
strokeWidth: "2",
|
|
2187
|
+
strokeLinecap: "round",
|
|
2188
|
+
strokeLinejoin: "round"
|
|
2189
|
+
}
|
|
2190
|
+
) })
|
|
2191
|
+
] })
|
|
2192
|
+
]
|
|
2193
|
+
}
|
|
2194
|
+
),
|
|
2195
|
+
f < p.length - 1 && /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" } })
|
|
2196
|
+
] }, `${d.code}-${d.chain}`);
|
|
2032
2197
|
}),
|
|
2033
|
-
|
|
2198
|
+
p.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
|
|
2034
2199
|
] })
|
|
2035
2200
|
] });
|
|
2036
2201
|
}
|
|
2037
|
-
function
|
|
2202
|
+
function Tn({
|
|
2038
2203
|
methods: t,
|
|
2039
2204
|
selectedId: n,
|
|
2040
2205
|
onSelect: a,
|
|
2041
2206
|
onClose: r
|
|
2042
2207
|
}) {
|
|
2043
|
-
const [l,
|
|
2044
|
-
const
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2208
|
+
const [l, u] = v(""), m = j(() => {
|
|
2209
|
+
const s = l.trim().toLowerCase();
|
|
2210
|
+
if (!s) {
|
|
2211
|
+
if (n) {
|
|
2212
|
+
const i = t.find((h) => h.id === n);
|
|
2213
|
+
if (i) {
|
|
2214
|
+
const h = t.filter((p) => p.id !== n);
|
|
2215
|
+
return [i, ...h];
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
return t;
|
|
2219
|
+
}
|
|
2220
|
+
return t.filter(
|
|
2221
|
+
(i) => i.id.toLowerCase().includes(s) || i.name.toLowerCase().includes(s) || i.description && i.description.toLowerCase().includes(s)
|
|
2222
|
+
);
|
|
2223
|
+
}, [t, l, n]);
|
|
2224
|
+
return /* @__PURE__ */ o(te, { children: [
|
|
2225
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Ie, { onClick: r }) }),
|
|
2051
2226
|
/* @__PURE__ */ e(
|
|
2052
2227
|
"h2",
|
|
2053
2228
|
{
|
|
@@ -2056,56 +2231,65 @@ function yn({
|
|
|
2056
2231
|
children: "Choose payment method"
|
|
2057
2232
|
}
|
|
2058
2233
|
),
|
|
2059
|
-
/* @__PURE__ */ e(
|
|
2234
|
+
/* @__PURE__ */ e(Fe, { value: l, onChange: u }),
|
|
2060
2235
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2061
|
-
|
|
2062
|
-
const
|
|
2063
|
-
return /* @__PURE__ */ o(
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
color: "var(--t-text)",
|
|
2070
|
-
|
|
2071
|
-
},
|
|
2072
|
-
children: [
|
|
2073
|
-
/* @__PURE__ */ e(
|
|
2074
|
-
"span",
|
|
2075
|
-
{
|
|
2076
|
-
className: "flex items-center justify-center shrink-0 mt-0.5",
|
|
2077
|
-
style: { width: 32, height: 32 },
|
|
2078
|
-
children: Ct(u.id, u.icon, 32)
|
|
2079
|
-
}
|
|
2080
|
-
),
|
|
2081
|
-
/* @__PURE__ */ o("div", { className: "text-left flex-1", children: [
|
|
2236
|
+
m.map((s, i) => {
|
|
2237
|
+
const h = s.id === n, p = It(s.id, s.name);
|
|
2238
|
+
return /* @__PURE__ */ o("div", { children: [
|
|
2239
|
+
/* @__PURE__ */ o(
|
|
2240
|
+
"button",
|
|
2241
|
+
{
|
|
2242
|
+
onClick: () => a(s.id),
|
|
2243
|
+
className: `flex w-full transition-colors rounded-lg hover-item ${s.description ? "items-start" : "items-center"}`,
|
|
2244
|
+
style: { color: "var(--t-text)", gap: 14, padding: "18px 8px", margin: "0 -8px" },
|
|
2245
|
+
children: [
|
|
2082
2246
|
/* @__PURE__ */ e(
|
|
2083
|
-
"
|
|
2247
|
+
"span",
|
|
2084
2248
|
{
|
|
2085
|
-
className:
|
|
2086
|
-
style: {
|
|
2087
|
-
children:
|
|
2249
|
+
className: `flex items-center justify-center shrink-0 ${s.description ? "mt-0.5" : ""}`,
|
|
2250
|
+
style: { width: 32, height: 32 },
|
|
2251
|
+
children: Mt(s.id, s.icon, 32)
|
|
2088
2252
|
}
|
|
2089
2253
|
),
|
|
2090
|
-
|
|
2091
|
-
|
|
2254
|
+
/* @__PURE__ */ o("div", { className: "text-left flex-1", children: [
|
|
2255
|
+
/* @__PURE__ */ e(
|
|
2256
|
+
"div",
|
|
2257
|
+
{
|
|
2258
|
+
className: "font-semibold text-[15px] leading-tight",
|
|
2259
|
+
style: { color: "var(--t-text)" },
|
|
2260
|
+
children: p
|
|
2261
|
+
}
|
|
2262
|
+
),
|
|
2263
|
+
s.description && /* @__PURE__ */ e(
|
|
2264
|
+
"div",
|
|
2265
|
+
{
|
|
2266
|
+
className: "text-[13px] leading-snug mt-1",
|
|
2267
|
+
style: { color: "var(--t-text-secondary)" },
|
|
2268
|
+
children: s.description
|
|
2269
|
+
}
|
|
2270
|
+
)
|
|
2271
|
+
] }),
|
|
2272
|
+
h && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className: "shrink-0 mt-1", children: /* @__PURE__ */ e(
|
|
2273
|
+
"path",
|
|
2092
2274
|
{
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2275
|
+
d: "M13.5 4.5L6 12L2.5 8.5",
|
|
2276
|
+
stroke: "var(--t-success, #4CD964)",
|
|
2277
|
+
strokeWidth: "2",
|
|
2278
|
+
strokeLinecap: "round",
|
|
2279
|
+
strokeLinejoin: "round"
|
|
2096
2280
|
}
|
|
2097
|
-
)
|
|
2098
|
-
]
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
);
|
|
2281
|
+
) })
|
|
2282
|
+
]
|
|
2283
|
+
}
|
|
2284
|
+
),
|
|
2285
|
+
i < m.length - 1 && /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" } })
|
|
2286
|
+
] }, s.id);
|
|
2103
2287
|
}),
|
|
2104
|
-
|
|
2288
|
+
m.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No payment methods found" })
|
|
2105
2289
|
] })
|
|
2106
2290
|
] });
|
|
2107
2291
|
}
|
|
2108
|
-
function
|
|
2292
|
+
function kn({
|
|
2109
2293
|
checked: t,
|
|
2110
2294
|
onChange: n,
|
|
2111
2295
|
accentColor: a = "var(--t-accent)"
|
|
@@ -2135,36 +2319,39 @@ function xn({
|
|
|
2135
2319
|
}
|
|
2136
2320
|
);
|
|
2137
2321
|
}
|
|
2138
|
-
const
|
|
2322
|
+
const Ln = [
|
|
2139
2323
|
{ label: "Privacy policy", href: "https://nowramp.com/privacy-policy" },
|
|
2140
2324
|
{ label: "Terms of use", href: "https://nowramp.com/terms-and-conditions" }
|
|
2141
2325
|
];
|
|
2142
|
-
function
|
|
2326
|
+
function In({
|
|
2143
2327
|
onClose: t,
|
|
2144
2328
|
darkMode: n,
|
|
2145
2329
|
onToggleDarkMode: a,
|
|
2146
2330
|
skinId: r,
|
|
2147
|
-
onSelectSkin: l
|
|
2331
|
+
onSelectSkin: l,
|
|
2332
|
+
showThemeToggle: u = !0
|
|
2148
2333
|
}) {
|
|
2149
|
-
return /* @__PURE__ */ o(
|
|
2150
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2334
|
+
return /* @__PURE__ */ o(te, { children: [
|
|
2335
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(Ie, { onClick: t }) }),
|
|
2151
2336
|
/* @__PURE__ */ o("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
|
|
2152
|
-
|
|
2153
|
-
/* @__PURE__ */ o("div", { className: "flex items-center
|
|
2154
|
-
/* @__PURE__ */
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2337
|
+
u && /* @__PURE__ */ o(te, { children: [
|
|
2338
|
+
/* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between w-full py-5", children: [
|
|
2339
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-3.5", children: [
|
|
2340
|
+
/* @__PURE__ */ e(mn, { size: 40 }),
|
|
2341
|
+
/* @__PURE__ */ e(
|
|
2342
|
+
"span",
|
|
2343
|
+
{
|
|
2344
|
+
className: "font-medium text-[15px]",
|
|
2345
|
+
style: { color: "var(--t-text)" },
|
|
2346
|
+
children: "Dark Mode"
|
|
2347
|
+
}
|
|
2348
|
+
)
|
|
2349
|
+
] }),
|
|
2350
|
+
/* @__PURE__ */ e(kn, { checked: n, onChange: a, accentColor: "#4CD964" })
|
|
2351
|
+
] }) }),
|
|
2352
|
+
/* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
|
|
2353
|
+
] }),
|
|
2354
|
+
Ln.map((m) => /* @__PURE__ */ o("div", { children: [
|
|
2168
2355
|
/* @__PURE__ */ o(
|
|
2169
2356
|
"a",
|
|
2170
2357
|
{
|
|
@@ -2182,7 +2369,7 @@ function vn({
|
|
|
2182
2369
|
children: m.label
|
|
2183
2370
|
}
|
|
2184
2371
|
),
|
|
2185
|
-
/* @__PURE__ */ e(
|
|
2372
|
+
/* @__PURE__ */ e(dn, {})
|
|
2186
2373
|
]
|
|
2187
2374
|
}
|
|
2188
2375
|
),
|
|
@@ -2191,189 +2378,201 @@ function vn({
|
|
|
2191
2378
|
] })
|
|
2192
2379
|
] });
|
|
2193
2380
|
}
|
|
2194
|
-
function
|
|
2381
|
+
function Mn({
|
|
2195
2382
|
className: t = "",
|
|
2196
2383
|
theme: n = "dark",
|
|
2197
2384
|
skinId: a = "mono",
|
|
2198
2385
|
accentColor: r,
|
|
2199
2386
|
bgColor: l,
|
|
2200
|
-
bgImage:
|
|
2201
|
-
borderColor:
|
|
2202
|
-
borderRadius:
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2387
|
+
bgImage: u,
|
|
2388
|
+
borderColor: m,
|
|
2389
|
+
borderRadius: s,
|
|
2390
|
+
surfaceColor: i,
|
|
2391
|
+
inputBgColor: h,
|
|
2392
|
+
textColor: p,
|
|
2393
|
+
textSecondaryColor: d,
|
|
2394
|
+
textMutedColor: f,
|
|
2395
|
+
successColor: y,
|
|
2396
|
+
showFlowToggle: w = !0,
|
|
2397
|
+
showSettings: b = !0,
|
|
2398
|
+
showThemeToggle: T = !0,
|
|
2399
|
+
autoRedirect: Q = !1,
|
|
2400
|
+
explorerUrl: Z,
|
|
2401
|
+
doneButtonText: q = "Done",
|
|
2402
|
+
supportEmail: ee,
|
|
2403
|
+
onDone: se
|
|
2209
2404
|
}) {
|
|
2210
|
-
var
|
|
2405
|
+
var it, ct, dt, ut, mt, pt, ht, ft;
|
|
2211
2406
|
const {
|
|
2212
|
-
state:
|
|
2213
|
-
dispatch:
|
|
2214
|
-
config:
|
|
2215
|
-
configLoading:
|
|
2216
|
-
quotes:
|
|
2217
|
-
quotesLoading:
|
|
2218
|
-
quotesError:
|
|
2219
|
-
fetchQuotes:
|
|
2220
|
-
createOrder:
|
|
2221
|
-
orderLoading:
|
|
2222
|
-
amountError:
|
|
2223
|
-
fieldLocks:
|
|
2224
|
-
apiConfig:
|
|
2225
|
-
assetBaseUrl:
|
|
2226
|
-
} =
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
}, [n]),
|
|
2230
|
-
const
|
|
2231
|
-
return () => clearTimeout(
|
|
2232
|
-
}, [
|
|
2233
|
-
if (
|
|
2234
|
-
|
|
2235
|
-
const
|
|
2236
|
-
return () => clearTimeout(
|
|
2407
|
+
state: g,
|
|
2408
|
+
dispatch: L,
|
|
2409
|
+
config: S,
|
|
2410
|
+
configLoading: c,
|
|
2411
|
+
quotes: C,
|
|
2412
|
+
quotesLoading: P,
|
|
2413
|
+
quotesError: I,
|
|
2414
|
+
fetchQuotes: Se,
|
|
2415
|
+
createOrder: ie,
|
|
2416
|
+
orderLoading: $,
|
|
2417
|
+
amountError: ue,
|
|
2418
|
+
fieldLocks: k,
|
|
2419
|
+
apiConfig: xe,
|
|
2420
|
+
assetBaseUrl: V
|
|
2421
|
+
} = we(), [ne, ae] = v(n === "dark"), [ge, Re] = v(a), [me, G] = v(null), [Y, Me] = v(!1), [ve, Te] = v(!1), [Ne, be] = v(!1), [_e, pe] = v(null), [ke, Xe] = v(!0), [$e, N] = v(!1), [A, U] = v(!1), K = X(null), M = X(), F = X(g.flowType);
|
|
2422
|
+
_(() => {
|
|
2423
|
+
ae(n === "dark");
|
|
2424
|
+
}, [n]), _(() => {
|
|
2425
|
+
const x = setTimeout(() => Xe(!1), c ? 0 : 800);
|
|
2426
|
+
return () => clearTimeout(x);
|
|
2427
|
+
}, [c]), _(() => {
|
|
2428
|
+
if (F.current !== g.flowType && !ke) {
|
|
2429
|
+
F.current = g.flowType, N(!0), Me(!1), Te(!1);
|
|
2430
|
+
const x = setTimeout(() => N(!1), 350);
|
|
2431
|
+
return () => clearTimeout(x);
|
|
2237
2432
|
}
|
|
2238
|
-
|
|
2239
|
-
}, [
|
|
2240
|
-
const
|
|
2241
|
-
|
|
2242
|
-
const
|
|
2243
|
-
if (
|
|
2244
|
-
const
|
|
2245
|
-
if (
|
|
2433
|
+
F.current = g.flowType;
|
|
2434
|
+
}, [g.flowType, ke]);
|
|
2435
|
+
const W = g.flowType, D = W === "buy", z = g.cryptoCurrency || "BTC", re = g.fiatCurrency || "USD", We = D ? g.fiatAmount : g.cryptoAmount, he = tn(We), Ce = (it = C == null ? void 0 : C.bestQuote) != null && it.exchangeRate ? parseFloat(C.bestQuote.exchangeRate) : null, Be = X(null);
|
|
2436
|
+
Ce && z && re && (Be.current = { rate: Ce, crypto: z, fiat: re });
|
|
2437
|
+
const Bt = j(() => {
|
|
2438
|
+
if (C != null && C.bestQuote) {
|
|
2439
|
+
const x = D ? C.bestQuote.cryptoAmount : C.bestQuote.fiatAmount;
|
|
2440
|
+
if (x) return x;
|
|
2246
2441
|
}
|
|
2247
2442
|
return "0";
|
|
2248
|
-
}, [
|
|
2249
|
-
var
|
|
2250
|
-
const
|
|
2251
|
-
return !
|
|
2252
|
-
}, [
|
|
2253
|
-
|
|
2254
|
-
const
|
|
2255
|
-
if (!
|
|
2256
|
-
|
|
2443
|
+
}, [C, D]), Ot = j(() => {
|
|
2444
|
+
var H, ce, Ge;
|
|
2445
|
+
const x = Ce || ((H = Be.current) == null ? void 0 : H.rate), E = Ce ? z : (ce = Be.current) == null ? void 0 : ce.crypto, R = Ce ? re : (Ge = Be.current) == null ? void 0 : Ge.fiat;
|
|
2446
|
+
return !x || !E || !R ? "" : `1 ${E} ≈ ${x.toFixed(2)} ${R}`;
|
|
2447
|
+
}, [z, re, Ce]);
|
|
2448
|
+
_(() => {
|
|
2449
|
+
const x = g.walletAddress.trim(), E = g.network;
|
|
2450
|
+
if (!x || x.length < 10) {
|
|
2451
|
+
pe(null), L({ type: "SET_WALLET_ERROR", message: "" });
|
|
2257
2452
|
return;
|
|
2258
2453
|
}
|
|
2259
|
-
return be(!0),
|
|
2260
|
-
var
|
|
2454
|
+
return be(!0), pe(null), clearTimeout(M.current), M.current = setTimeout(async () => {
|
|
2455
|
+
var R, H, ce;
|
|
2261
2456
|
try {
|
|
2262
|
-
const
|
|
2457
|
+
const Ye = await (await fetch(`${xe.apiUrl}/public/validate/address`, {
|
|
2263
2458
|
method: "POST",
|
|
2264
2459
|
headers: { "Content-Type": "application/json" },
|
|
2265
|
-
body: JSON.stringify({ address:
|
|
2266
|
-
})).json(),
|
|
2267
|
-
if (
|
|
2268
|
-
|
|
2460
|
+
body: JSON.stringify({ address: x, ...E ? { network: E } : {} })
|
|
2461
|
+
})).json(), Qe = ((R = Ye.data) == null ? void 0 : R.attributes) || Ye.data || Ye;
|
|
2462
|
+
if (Qe.isValid)
|
|
2463
|
+
pe(!0), L({ type: "SET_WALLET_ERROR", message: "" });
|
|
2269
2464
|
else {
|
|
2270
|
-
|
|
2271
|
-
const
|
|
2272
|
-
|
|
2465
|
+
pe(!1);
|
|
2466
|
+
const Xt = ((H = Qe.errors) == null ? void 0 : H[0]) || ((ce = Qe.details) == null ? void 0 : ce.formatMessage) || "Invalid wallet address";
|
|
2467
|
+
L({ type: "SET_WALLET_ERROR", message: Xt });
|
|
2273
2468
|
}
|
|
2274
2469
|
} catch {
|
|
2275
|
-
|
|
2470
|
+
pe(null);
|
|
2276
2471
|
} finally {
|
|
2277
2472
|
be(!1);
|
|
2278
2473
|
}
|
|
2279
|
-
}, 500), () => clearTimeout(
|
|
2280
|
-
}, [
|
|
2281
|
-
const
|
|
2282
|
-
let E =
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2285
|
-
},
|
|
2286
|
-
|
|
2287
|
-
},
|
|
2288
|
-
(
|
|
2289
|
-
|
|
2474
|
+
}, 500), () => clearTimeout(M.current);
|
|
2475
|
+
}, [g.walletAddress, g.network, xe.apiUrl]);
|
|
2476
|
+
const et = !We || he === 0, tt = he > 0 && (D ? he < bt : he < Ct), nt = !!ue || tt || Y && et, Pt = he > 0 && !ue && !tt, je = g.walletAddress.trim().length >= 10 && _e !== !1 && !Ne, Oe = Pt && je && !!g.cryptoCurrency && !!g.network, Dt = (x) => {
|
|
2477
|
+
let E = x.target.value.replace(/[^0-9.,]/g, "");
|
|
2478
|
+
const R = D ? 2 : 6, H = E.indexOf(".");
|
|
2479
|
+
H !== -1 && E.length - H - 1 > R && (E = E.slice(0, H + R + 1)), L(D ? { type: "SET_FIAT_AMOUNT", amount: E } : { type: "SET_CRYPTO_AMOUNT", amount: E });
|
|
2480
|
+
}, at = (x) => {
|
|
2481
|
+
x !== W && L({ type: "SET_FLOW_TYPE", flowType: x });
|
|
2482
|
+
}, Ht = O(
|
|
2483
|
+
(x) => {
|
|
2484
|
+
L({ type: "SET_FIAT_CURRENCY", currency: x });
|
|
2290
2485
|
},
|
|
2291
|
-
[
|
|
2292
|
-
),
|
|
2293
|
-
(
|
|
2294
|
-
|
|
2486
|
+
[L]
|
|
2487
|
+
), Ut = O(
|
|
2488
|
+
(x, E) => {
|
|
2489
|
+
L({ type: "SET_CRYPTO_CURRENCY", currency: x }), L({ type: "SET_CRYPTO_CHAIN", chain: E });
|
|
2295
2490
|
},
|
|
2296
|
-
[
|
|
2297
|
-
),
|
|
2298
|
-
(
|
|
2299
|
-
|
|
2491
|
+
[L]
|
|
2492
|
+
), Kt = O(
|
|
2493
|
+
(x) => {
|
|
2494
|
+
L({ type: "SET_PAYMENT_METHOD", methodId: x });
|
|
2300
2495
|
},
|
|
2301
|
-
[
|
|
2302
|
-
),
|
|
2303
|
-
|
|
2496
|
+
[L]
|
|
2497
|
+
), Ft = () => {
|
|
2498
|
+
Oe && (U(!0), Se());
|
|
2304
2499
|
};
|
|
2305
|
-
|
|
2306
|
-
var
|
|
2307
|
-
if (!(!
|
|
2308
|
-
if (
|
|
2309
|
-
|
|
2500
|
+
_(() => {
|
|
2501
|
+
var x;
|
|
2502
|
+
if (!(!A || P)) {
|
|
2503
|
+
if (C != null && C.bestQuote)
|
|
2504
|
+
U(!1), L({ type: "SELECT_QUOTE", quote: C.bestQuote }), ie().catch(() => {
|
|
2310
2505
|
});
|
|
2311
|
-
else if (
|
|
2312
|
-
|
|
2313
|
-
else if (
|
|
2314
|
-
|
|
2315
|
-
const E = (
|
|
2316
|
-
|
|
2506
|
+
else if (I)
|
|
2507
|
+
U(!1), L({ type: "SET_ERROR", message: I.message || "No quotes available" });
|
|
2508
|
+
else if (C && !C.bestQuote) {
|
|
2509
|
+
U(!1);
|
|
2510
|
+
const E = (x = C.unavailableGateways) == null ? void 0 : x.map((H) => H.reason).filter(Boolean), R = E != null && E.length ? `No providers available: ${E.join("; ")}` : "No providers available for this currency/network combination";
|
|
2511
|
+
L({ type: "SET_ERROR", message: R });
|
|
2317
2512
|
}
|
|
2318
2513
|
}
|
|
2319
|
-
}, [
|
|
2320
|
-
const
|
|
2321
|
-
"--t-accent":
|
|
2322
|
-
"--t-cta-bg":
|
|
2323
|
-
"--t-cta-text":
|
|
2514
|
+
}, [A, C, P, I, L, ie]);
|
|
2515
|
+
const rt = ne ? "theme-dark" : "theme-light", Ve = vt.find((x) => x.id === ge) || vt[0], _t = Ve.accent === null, ot = (r ? le(r) : !1) ? { "--t-accent": r, "--t-cta-bg": r, "--t-cta-text": "#ffffff" } : _t ? {
|
|
2516
|
+
"--t-accent": ne ? "#ffffff" : "#111111",
|
|
2517
|
+
"--t-cta-bg": ne ? "#ffffff" : "#111111",
|
|
2518
|
+
"--t-cta-text": ne ? "#000000" : "#ffffff"
|
|
2324
2519
|
} : {
|
|
2325
|
-
"--t-accent":
|
|
2326
|
-
"--t-cta-bg":
|
|
2520
|
+
"--t-accent": Ve.accent,
|
|
2521
|
+
"--t-cta-bg": Ve.accent,
|
|
2327
2522
|
"--t-cta-text": "#ffffff"
|
|
2328
|
-
},
|
|
2329
|
-
|
|
2330
|
-
const
|
|
2331
|
-
|
|
2332
|
-
const
|
|
2333
|
-
|
|
2523
|
+
}, J = {};
|
|
2524
|
+
i && le(i) && (J["--t-surface"] = i, J["--t-modal-bg"] = i), h && le(h) && (J["--t-pill-bg"] = h, J["--t-close-bg"] = h), p && le(p) && (J["--t-text"] = p), d && le(d) && (J["--t-text-secondary"] = d), f && le(f) && (J["--t-text-muted"] = f, J["--t-text-tertiary"] = f), y && le(y) && (J["--t-success"] = y);
|
|
2525
|
+
const fe = {};
|
|
2526
|
+
l && le(l) ? fe.backgroundColor = l : fe.backgroundColor = "var(--t-bg)", u && (fe.backgroundImage = `url(${u})`, fe.backgroundSize = "cover", fe.backgroundPosition = "center");
|
|
2527
|
+
const Pe = {};
|
|
2528
|
+
m && le(m) && (Pe.border = `1px solid ${m}`), s && (Pe.borderRadius = s);
|
|
2529
|
+
const lt = g.step === "checkout" ? /* @__PURE__ */ e(xn, { autoRedirect: Q }) : g.step === "processing" ? /* @__PURE__ */ e(vn, {}) : g.step === "complete" ? /* @__PURE__ */ e(Nn, { explorerUrl: Z, doneButtonText: q, onDone: se }) : g.step === "error" ? /* @__PURE__ */ e(bn, { supportEmail: ee }) : g.step === "confirm" ? /* @__PURE__ */ e(Cn, {}) : null;
|
|
2530
|
+
if (lt)
|
|
2334
2531
|
return /* @__PURE__ */ e(
|
|
2335
2532
|
"div",
|
|
2336
2533
|
{
|
|
2337
|
-
className: `${
|
|
2534
|
+
className: `${rt} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
|
|
2338
2535
|
style: {
|
|
2339
2536
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
2340
|
-
...
|
|
2341
|
-
...
|
|
2342
|
-
...
|
|
2537
|
+
...fe,
|
|
2538
|
+
...ot,
|
|
2539
|
+
...J,
|
|
2540
|
+
...Pe
|
|
2343
2541
|
},
|
|
2344
|
-
children:
|
|
2542
|
+
children: lt
|
|
2345
2543
|
}
|
|
2346
2544
|
);
|
|
2347
|
-
const
|
|
2545
|
+
const oe = g.network, Ee = oe ? Ue(oe) : null, st = (Ee == null ? void 0 : Ee.shortName) || (Ee == null ? void 0 : Ee.name) || oe;
|
|
2348
2546
|
return /* @__PURE__ */ o(
|
|
2349
2547
|
"div",
|
|
2350
2548
|
{
|
|
2351
|
-
className: `${
|
|
2549
|
+
className: `${rt} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
|
|
2352
2550
|
style: {
|
|
2353
2551
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
2354
|
-
...
|
|
2355
|
-
...
|
|
2356
|
-
...
|
|
2552
|
+
...fe,
|
|
2553
|
+
...ot,
|
|
2554
|
+
...J,
|
|
2555
|
+
...Pe
|
|
2357
2556
|
},
|
|
2358
2557
|
children: [
|
|
2359
|
-
/* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${
|
|
2360
|
-
|
|
2558
|
+
b && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${w ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(un, { onClick: () => G("settings") }) }),
|
|
2559
|
+
w ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
|
|
2361
2560
|
/* @__PURE__ */ o("div", { className: "flex", style: { width: 165 }, children: [
|
|
2362
2561
|
/* @__PURE__ */ e(
|
|
2363
2562
|
"button",
|
|
2364
2563
|
{
|
|
2365
|
-
onClick: () =>
|
|
2564
|
+
onClick: () => at("buy"),
|
|
2366
2565
|
className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
|
|
2367
|
-
style: { color:
|
|
2566
|
+
style: { color: W === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
|
|
2368
2567
|
children: "Buy"
|
|
2369
2568
|
}
|
|
2370
2569
|
),
|
|
2371
2570
|
/* @__PURE__ */ e(
|
|
2372
2571
|
"button",
|
|
2373
2572
|
{
|
|
2374
|
-
onClick: () =>
|
|
2573
|
+
onClick: () => at("sell"),
|
|
2375
2574
|
className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
|
|
2376
|
-
style: { color:
|
|
2575
|
+
style: { color: W === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
|
|
2377
2576
|
children: "Sell"
|
|
2378
2577
|
}
|
|
2379
2578
|
)
|
|
@@ -2386,14 +2585,14 @@ function Cn({
|
|
|
2386
2585
|
className: "absolute top-0 h-full transition-all duration-300 ease-in-out",
|
|
2387
2586
|
style: {
|
|
2388
2587
|
width: "50%",
|
|
2389
|
-
left:
|
|
2588
|
+
left: W === "buy" ? "0%" : "50%",
|
|
2390
2589
|
background: "var(--t-accent)"
|
|
2391
2590
|
}
|
|
2392
2591
|
}
|
|
2393
2592
|
)
|
|
2394
2593
|
] })
|
|
2395
2594
|
] }) : null,
|
|
2396
|
-
|
|
2595
|
+
ke || $e || c ? /* @__PURE__ */ e(wn, {}) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
|
|
2397
2596
|
/* @__PURE__ */ o(
|
|
2398
2597
|
"div",
|
|
2399
2598
|
{
|
|
@@ -2401,7 +2600,7 @@ function Cn({
|
|
|
2401
2600
|
style: {
|
|
2402
2601
|
background: "var(--t-surface)",
|
|
2403
2602
|
borderRadius: 5,
|
|
2404
|
-
border:
|
|
2603
|
+
border: Y && nt ? "1px solid #EF4444" : "1px solid transparent",
|
|
2405
2604
|
minHeight: 102
|
|
2406
2605
|
},
|
|
2407
2606
|
children: [
|
|
@@ -2410,22 +2609,22 @@ function Cn({
|
|
|
2410
2609
|
/* @__PURE__ */ e(
|
|
2411
2610
|
"input",
|
|
2412
2611
|
{
|
|
2413
|
-
ref:
|
|
2612
|
+
ref: K,
|
|
2414
2613
|
type: "text",
|
|
2415
|
-
value:
|
|
2416
|
-
onChange:
|
|
2417
|
-
onBlur: () =>
|
|
2418
|
-
placeholder:
|
|
2614
|
+
value: We,
|
|
2615
|
+
onChange: Dt,
|
|
2616
|
+
onBlur: () => Me(!0),
|
|
2617
|
+
placeholder: D ? "250" : "0.01",
|
|
2419
2618
|
className: "bg-transparent outline-none w-0 flex-1 mr-3",
|
|
2420
2619
|
style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px", padding: 0, border: "none", borderRadius: 0, backgroundColor: "transparent", height: "auto", width: 0 },
|
|
2421
2620
|
inputMode: "decimal",
|
|
2422
|
-
disabled: !!((
|
|
2621
|
+
disabled: !!((ct = k == null ? void 0 : k.sourceAmount) != null && ct.locked)
|
|
2423
2622
|
}
|
|
2424
2623
|
),
|
|
2425
|
-
|
|
2624
|
+
D ? /* @__PURE__ */ o(
|
|
2426
2625
|
"button",
|
|
2427
2626
|
{
|
|
2428
|
-
onClick: () =>
|
|
2627
|
+
onClick: () => G("fiat"),
|
|
2429
2628
|
className: "flex items-center gap-1.5 shrink-0 transition-colors",
|
|
2430
2629
|
style: {
|
|
2431
2630
|
background: "var(--t-pill-bg)",
|
|
@@ -2434,18 +2633,18 @@ function Cn({
|
|
|
2434
2633
|
paddingLeft: 10,
|
|
2435
2634
|
paddingRight: 10
|
|
2436
2635
|
},
|
|
2437
|
-
disabled: !!((
|
|
2636
|
+
disabled: !!((dt = k == null ? void 0 : k.sourceCurrency) != null && dt.locked),
|
|
2438
2637
|
children: [
|
|
2439
|
-
/* @__PURE__ */ e(
|
|
2440
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2441
|
-
/* @__PURE__ */ e(
|
|
2638
|
+
/* @__PURE__ */ e(Je, { currencyCode: re, size: 16, baseUrl: V }),
|
|
2639
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: re }),
|
|
2640
|
+
/* @__PURE__ */ e(Le, {})
|
|
2442
2641
|
]
|
|
2443
2642
|
}
|
|
2444
2643
|
) : /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
2445
2644
|
/* @__PURE__ */ o(
|
|
2446
2645
|
"button",
|
|
2447
2646
|
{
|
|
2448
|
-
onClick: () =>
|
|
2647
|
+
onClick: () => G("crypto"),
|
|
2449
2648
|
className: "flex items-center gap-1.5 transition-colors",
|
|
2450
2649
|
style: {
|
|
2451
2650
|
background: "var(--t-pill-bg)",
|
|
@@ -2454,34 +2653,34 @@ function Cn({
|
|
|
2454
2653
|
paddingLeft: 10,
|
|
2455
2654
|
paddingRight: 10
|
|
2456
2655
|
},
|
|
2457
|
-
disabled: !!((
|
|
2656
|
+
disabled: !!((ut = k == null ? void 0 : k.destinationCurrency) != null && ut.locked),
|
|
2458
2657
|
children: [
|
|
2459
|
-
/* @__PURE__ */ e(
|
|
2460
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2461
|
-
/* @__PURE__ */ e(
|
|
2658
|
+
/* @__PURE__ */ e(Et, { ticker: z, size: 16, baseUrl: V }),
|
|
2659
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: z }),
|
|
2660
|
+
/* @__PURE__ */ e(Le, {})
|
|
2462
2661
|
]
|
|
2463
2662
|
}
|
|
2464
2663
|
),
|
|
2465
|
-
|
|
2466
|
-
/* @__PURE__ */ e(
|
|
2664
|
+
oe && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
|
|
2665
|
+
/* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
|
|
2467
2666
|
"img",
|
|
2468
2667
|
{
|
|
2469
|
-
src:
|
|
2470
|
-
alt:
|
|
2668
|
+
src: ze(oe, V),
|
|
2669
|
+
alt: oe,
|
|
2471
2670
|
width: 14,
|
|
2472
2671
|
height: 14,
|
|
2473
2672
|
className: "rounded-full",
|
|
2474
2673
|
style: { width: 14, height: 14 }
|
|
2475
2674
|
}
|
|
2476
|
-
),
|
|
2477
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children:
|
|
2675
|
+
) }),
|
|
2676
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: st })
|
|
2478
2677
|
] })
|
|
2479
2678
|
] })
|
|
2480
2679
|
] })
|
|
2481
2680
|
]
|
|
2482
2681
|
}
|
|
2483
2682
|
),
|
|
2484
|
-
|
|
2683
|
+
Y && nt && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: ue || (et ? "Amount should be more than 0" : D ? `Minimum amount is ${bt} ${re}` : `Minimum amount is ${Ct} ${z}`) }),
|
|
2485
2684
|
/* @__PURE__ */ o(
|
|
2486
2685
|
"div",
|
|
2487
2686
|
{
|
|
@@ -2498,20 +2697,20 @@ function Cn({
|
|
|
2498
2697
|
children: [
|
|
2499
2698
|
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
|
|
2500
2699
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between", children: [
|
|
2501
|
-
|
|
2502
|
-
|
|
2700
|
+
P && !A ? /* @__PURE__ */ e(B, { w: 180, h: 32 }) : /* @__PURE__ */ e(
|
|
2701
|
+
An,
|
|
2503
2702
|
{
|
|
2504
|
-
value:
|
|
2703
|
+
value: he > 0 ? Bt : "0",
|
|
2505
2704
|
height: 32,
|
|
2506
2705
|
className: "font-semibold",
|
|
2507
|
-
style: { color:
|
|
2706
|
+
style: { color: he > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
|
|
2508
2707
|
}
|
|
2509
2708
|
),
|
|
2510
|
-
|
|
2709
|
+
D ? /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
2511
2710
|
/* @__PURE__ */ o(
|
|
2512
2711
|
"button",
|
|
2513
2712
|
{
|
|
2514
|
-
onClick: () =>
|
|
2713
|
+
onClick: () => G("crypto"),
|
|
2515
2714
|
className: "flex items-center gap-1.5 transition-colors",
|
|
2516
2715
|
style: {
|
|
2517
2716
|
background: "var(--t-pill-bg)",
|
|
@@ -2520,32 +2719,32 @@ function Cn({
|
|
|
2520
2719
|
paddingLeft: 10,
|
|
2521
2720
|
paddingRight: 10
|
|
2522
2721
|
},
|
|
2523
|
-
disabled: !!((
|
|
2722
|
+
disabled: !!((mt = k == null ? void 0 : k.destinationCurrency) != null && mt.locked),
|
|
2524
2723
|
children: [
|
|
2525
|
-
/* @__PURE__ */ e(
|
|
2526
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2527
|
-
/* @__PURE__ */ e(
|
|
2724
|
+
/* @__PURE__ */ e(Et, { ticker: z, size: 16, baseUrl: V }),
|
|
2725
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: z }),
|
|
2726
|
+
/* @__PURE__ */ e(Le, {})
|
|
2528
2727
|
]
|
|
2529
2728
|
}
|
|
2530
2729
|
),
|
|
2531
|
-
|
|
2532
|
-
/* @__PURE__ */ e(
|
|
2730
|
+
oe && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
|
|
2731
|
+
/* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
|
|
2533
2732
|
"img",
|
|
2534
2733
|
{
|
|
2535
|
-
src:
|
|
2536
|
-
alt:
|
|
2734
|
+
src: ze(oe, V),
|
|
2735
|
+
alt: oe,
|
|
2537
2736
|
width: 14,
|
|
2538
2737
|
height: 14,
|
|
2539
2738
|
className: "rounded-full",
|
|
2540
2739
|
style: { width: 14, height: 14 }
|
|
2541
2740
|
}
|
|
2542
|
-
),
|
|
2543
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children:
|
|
2741
|
+
) }),
|
|
2742
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: st })
|
|
2544
2743
|
] })
|
|
2545
2744
|
] }) : /* @__PURE__ */ o(
|
|
2546
2745
|
"button",
|
|
2547
2746
|
{
|
|
2548
|
-
onClick: () =>
|
|
2747
|
+
onClick: () => G("fiat"),
|
|
2549
2748
|
className: "flex items-center gap-1.5 shrink-0 transition-colors",
|
|
2550
2749
|
style: {
|
|
2551
2750
|
background: "var(--t-pill-bg)",
|
|
@@ -2554,11 +2753,11 @@ function Cn({
|
|
|
2554
2753
|
paddingLeft: 10,
|
|
2555
2754
|
paddingRight: 10
|
|
2556
2755
|
},
|
|
2557
|
-
disabled: !!((
|
|
2756
|
+
disabled: !!((pt = k == null ? void 0 : k.sourceCurrency) != null && pt.locked),
|
|
2558
2757
|
children: [
|
|
2559
|
-
/* @__PURE__ */ e(
|
|
2560
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2561
|
-
/* @__PURE__ */ e(
|
|
2758
|
+
/* @__PURE__ */ e(Je, { currencyCode: re, size: 16, baseUrl: V }),
|
|
2759
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: re }),
|
|
2760
|
+
/* @__PURE__ */ e(Le, {})
|
|
2562
2761
|
]
|
|
2563
2762
|
}
|
|
2564
2763
|
)
|
|
@@ -2572,35 +2771,35 @@ function Cn({
|
|
|
2572
2771
|
className: "flex items-center justify-between mt-[2px] px-[18px] pt-[12px] pb-[14px]",
|
|
2573
2772
|
style: {
|
|
2574
2773
|
background: "var(--t-surface)",
|
|
2575
|
-
...(
|
|
2774
|
+
...(ht = S == null ? void 0 : S.paymentMethods) != null && ht.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
|
|
2576
2775
|
},
|
|
2577
|
-
children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children:
|
|
2776
|
+
children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: y ? "var(--t-success)" : "var(--t-text-secondary)" }, children: Ot || " " })
|
|
2578
2777
|
}
|
|
2579
2778
|
),
|
|
2580
|
-
(
|
|
2581
|
-
|
|
2779
|
+
(S == null ? void 0 : S.paymentMethods) && S.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
|
|
2780
|
+
yn,
|
|
2582
2781
|
{
|
|
2583
|
-
methods:
|
|
2584
|
-
selectedId:
|
|
2585
|
-
onOpenModal: () =>
|
|
2586
|
-
fiatCurrency:
|
|
2782
|
+
methods: S.paymentMethods,
|
|
2783
|
+
selectedId: g.paymentMethodId,
|
|
2784
|
+
onOpenModal: () => G("payment"),
|
|
2785
|
+
fiatCurrency: g.fiatCurrency
|
|
2587
2786
|
}
|
|
2588
2787
|
) }),
|
|
2589
2788
|
/* @__PURE__ */ o("div", { className: "mt-8", children: [
|
|
2590
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children:
|
|
2789
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: D ? "Receiving wallet address" : "Sending wallet address" }),
|
|
2591
2790
|
/* @__PURE__ */ e(
|
|
2592
2791
|
"input",
|
|
2593
2792
|
{
|
|
2594
2793
|
type: "text",
|
|
2595
|
-
value:
|
|
2596
|
-
onChange: (
|
|
2597
|
-
onBlur: () =>
|
|
2598
|
-
placeholder:
|
|
2794
|
+
value: g.walletAddress,
|
|
2795
|
+
onChange: (x) => L({ type: "SET_WALLET_ADDRESS", address: x.target.value }),
|
|
2796
|
+
onBlur: () => Te(!0),
|
|
2797
|
+
placeholder: D ? "Enter your receiving address" : "Enter your sending address",
|
|
2599
2798
|
spellCheck: !1,
|
|
2600
2799
|
autoComplete: "off",
|
|
2601
2800
|
className: "w-full bg-transparent text-[13px] outline-none transition-colors",
|
|
2602
2801
|
style: {
|
|
2603
|
-
border:
|
|
2802
|
+
border: g.walletError || ve && !je ? "1px solid #EF4444" : "1px solid var(--t-border)",
|
|
2604
2803
|
borderRadius: 3.5,
|
|
2605
2804
|
height: 47,
|
|
2606
2805
|
padding: "0 14px",
|
|
@@ -2608,198 +2807,220 @@ function Cn({
|
|
|
2608
2807
|
fontSize: 13,
|
|
2609
2808
|
backgroundColor: "transparent"
|
|
2610
2809
|
},
|
|
2611
|
-
disabled: !!((
|
|
2810
|
+
disabled: !!((ft = k == null ? void 0 : k.destinationAddress) != null && ft.locked)
|
|
2612
2811
|
}
|
|
2613
2812
|
),
|
|
2614
|
-
|
|
2813
|
+
g.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: g.walletError }) : ve && !je && !Ne ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : Ne && g.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
|
|
2615
2814
|
] }),
|
|
2616
2815
|
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
2617
2816
|
/* @__PURE__ */ e(
|
|
2618
2817
|
"button",
|
|
2619
2818
|
{
|
|
2620
|
-
disabled: !
|
|
2621
|
-
onClick:
|
|
2819
|
+
disabled: !Oe || $ || A,
|
|
2820
|
+
onClick: Ft,
|
|
2622
2821
|
className: "w-full font-semibold text-[16px] transition-all",
|
|
2623
2822
|
style: {
|
|
2624
2823
|
height: 60,
|
|
2625
2824
|
borderRadius: 5,
|
|
2626
2825
|
background: "var(--t-cta-bg)",
|
|
2627
2826
|
color: "var(--t-cta-text)",
|
|
2628
|
-
opacity:
|
|
2629
|
-
cursor:
|
|
2827
|
+
opacity: Oe && !$ && !A ? 1 : 0.4,
|
|
2828
|
+
cursor: Oe && !$ && !A ? "pointer" : "not-allowed"
|
|
2630
2829
|
},
|
|
2631
|
-
children:
|
|
2830
|
+
children: A ? "Getting best price..." : $ ? "Processing..." : D ? `Buy ${z}` : `Sell ${z}`
|
|
2632
2831
|
}
|
|
2633
2832
|
),
|
|
2634
2833
|
/* @__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" }) })
|
|
2635
|
-
] },
|
|
2636
|
-
/* @__PURE__ */ e(
|
|
2834
|
+
] }, W),
|
|
2835
|
+
/* @__PURE__ */ e(He, { isOpen: me === "fiat", onClose: () => G(null), children: (x) => {
|
|
2637
2836
|
var E;
|
|
2638
2837
|
return /* @__PURE__ */ e(
|
|
2639
|
-
|
|
2838
|
+
Sn,
|
|
2640
2839
|
{
|
|
2641
|
-
onClose:
|
|
2642
|
-
onSelect: (
|
|
2643
|
-
|
|
2840
|
+
onClose: x,
|
|
2841
|
+
onSelect: (R) => {
|
|
2842
|
+
Ht(R), x();
|
|
2644
2843
|
},
|
|
2645
|
-
currencies: (E =
|
|
2646
|
-
assetBaseUrl:
|
|
2844
|
+
currencies: (E = S == null ? void 0 : S.fiats) == null ? void 0 : E.map((R) => ({ code: R.code, name: R.code })),
|
|
2845
|
+
assetBaseUrl: V,
|
|
2846
|
+
selectedCode: g.fiatCurrency
|
|
2647
2847
|
}
|
|
2648
2848
|
);
|
|
2649
2849
|
} }),
|
|
2650
|
-
/* @__PURE__ */ e(
|
|
2850
|
+
/* @__PURE__ */ e(He, { isOpen: me === "crypto", onClose: () => G(null), children: (x) => {
|
|
2651
2851
|
var E;
|
|
2652
2852
|
return /* @__PURE__ */ e(
|
|
2653
|
-
|
|
2853
|
+
Rn,
|
|
2654
2854
|
{
|
|
2655
|
-
onClose:
|
|
2656
|
-
onSelect: (
|
|
2657
|
-
|
|
2855
|
+
onClose: x,
|
|
2856
|
+
onSelect: (R, H) => {
|
|
2857
|
+
Ut(R, H), x();
|
|
2658
2858
|
},
|
|
2659
|
-
cryptos: (E =
|
|
2660
|
-
var
|
|
2859
|
+
cryptos: (E = S == null ? void 0 : S.cryptos) == null ? void 0 : E.map((R) => {
|
|
2860
|
+
var H;
|
|
2661
2861
|
return {
|
|
2662
|
-
code:
|
|
2663
|
-
name:
|
|
2664
|
-
networks: (
|
|
2862
|
+
code: R.code,
|
|
2863
|
+
name: R.code,
|
|
2864
|
+
networks: (H = R.networks) == null ? void 0 : H.map((ce) => ({ code: ce.id, name: ce.name }))
|
|
2665
2865
|
};
|
|
2666
2866
|
}),
|
|
2667
|
-
assetBaseUrl:
|
|
2867
|
+
assetBaseUrl: V,
|
|
2868
|
+
selectedCode: g.cryptoCurrency,
|
|
2869
|
+
selectedChain: g.network
|
|
2668
2870
|
}
|
|
2669
2871
|
);
|
|
2670
2872
|
} }),
|
|
2671
|
-
/* @__PURE__ */ e(
|
|
2873
|
+
/* @__PURE__ */ e(He, { isOpen: me === "payment", onClose: () => G(null), children: (x) => {
|
|
2672
2874
|
var E;
|
|
2673
2875
|
return /* @__PURE__ */ e(
|
|
2674
|
-
|
|
2876
|
+
Tn,
|
|
2675
2877
|
{
|
|
2676
|
-
methods: ((E =
|
|
2677
|
-
selectedId:
|
|
2678
|
-
onSelect: (
|
|
2679
|
-
|
|
2878
|
+
methods: ((E = S == null ? void 0 : S.paymentMethods) == null ? void 0 : E.filter((R) => R.supportedFiats.includes(g.fiatCurrency))) || [],
|
|
2879
|
+
selectedId: g.paymentMethodId,
|
|
2880
|
+
onSelect: (R) => {
|
|
2881
|
+
Kt(R), x();
|
|
2680
2882
|
},
|
|
2681
|
-
onClose:
|
|
2883
|
+
onClose: x
|
|
2682
2884
|
}
|
|
2683
2885
|
);
|
|
2684
2886
|
} }),
|
|
2685
|
-
/* @__PURE__ */ e(
|
|
2686
|
-
|
|
2887
|
+
/* @__PURE__ */ e(He, { isOpen: me === "settings", onClose: () => G(null), children: (x) => /* @__PURE__ */ e(
|
|
2888
|
+
In,
|
|
2687
2889
|
{
|
|
2688
|
-
onClose:
|
|
2689
|
-
darkMode:
|
|
2690
|
-
onToggleDarkMode:
|
|
2691
|
-
skinId:
|
|
2890
|
+
onClose: x,
|
|
2891
|
+
darkMode: ne,
|
|
2892
|
+
onToggleDarkMode: ae,
|
|
2893
|
+
skinId: ge,
|
|
2692
2894
|
onSelectSkin: (E) => {
|
|
2693
|
-
|
|
2694
|
-
}
|
|
2895
|
+
Re(E);
|
|
2896
|
+
},
|
|
2897
|
+
showThemeToggle: T
|
|
2695
2898
|
}
|
|
2696
2899
|
) })
|
|
2697
2900
|
]
|
|
2698
2901
|
}
|
|
2699
2902
|
);
|
|
2700
2903
|
}
|
|
2701
|
-
function
|
|
2904
|
+
function Bn({
|
|
2702
2905
|
projectId: t,
|
|
2703
2906
|
apiUrl: n,
|
|
2704
2907
|
assetBaseUrl: a,
|
|
2705
2908
|
flowType: r,
|
|
2706
2909
|
customerId: l,
|
|
2910
|
+
brandId: u,
|
|
2707
2911
|
defaultFiatCurrency: m,
|
|
2708
|
-
defaultCryptoCurrency:
|
|
2709
|
-
defaultNetwork:
|
|
2710
|
-
defaultFiatAmount:
|
|
2711
|
-
defaultCryptoAmount:
|
|
2712
|
-
defaultWalletAddress:
|
|
2912
|
+
defaultCryptoCurrency: s,
|
|
2913
|
+
defaultNetwork: i,
|
|
2914
|
+
defaultFiatAmount: h,
|
|
2915
|
+
defaultCryptoAmount: p,
|
|
2916
|
+
defaultWalletAddress: d,
|
|
2713
2917
|
defaultGateway: f,
|
|
2714
|
-
fieldLocks:
|
|
2715
|
-
statusPollInterval:
|
|
2716
|
-
onComplete:
|
|
2717
|
-
onError:
|
|
2718
|
-
className:
|
|
2719
|
-
theme:
|
|
2720
|
-
skinId:
|
|
2721
|
-
accentColor:
|
|
2722
|
-
bgColor:
|
|
2723
|
-
bgImage:
|
|
2724
|
-
borderColor:
|
|
2725
|
-
borderRadius:
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2918
|
+
fieldLocks: y,
|
|
2919
|
+
statusPollInterval: w,
|
|
2920
|
+
onComplete: b,
|
|
2921
|
+
onError: T,
|
|
2922
|
+
className: Q,
|
|
2923
|
+
theme: Z,
|
|
2924
|
+
skinId: q,
|
|
2925
|
+
accentColor: ee,
|
|
2926
|
+
bgColor: se,
|
|
2927
|
+
bgImage: g,
|
|
2928
|
+
borderColor: L,
|
|
2929
|
+
borderRadius: S,
|
|
2930
|
+
surfaceColor: c,
|
|
2931
|
+
inputBgColor: C,
|
|
2932
|
+
textColor: P,
|
|
2933
|
+
textSecondaryColor: I,
|
|
2934
|
+
textMutedColor: Se,
|
|
2935
|
+
successColor: ie,
|
|
2936
|
+
showFlowToggle: $,
|
|
2937
|
+
showSettings: ue,
|
|
2938
|
+
showThemeToggle: k,
|
|
2939
|
+
autoRedirect: xe,
|
|
2940
|
+
explorerUrl: V,
|
|
2941
|
+
doneButtonText: ne,
|
|
2942
|
+
supportEmail: ae,
|
|
2943
|
+
onDone: ge
|
|
2732
2944
|
}) {
|
|
2733
2945
|
return /* @__PURE__ */ e(
|
|
2734
|
-
|
|
2946
|
+
zt,
|
|
2735
2947
|
{
|
|
2736
2948
|
projectId: t,
|
|
2737
2949
|
apiUrl: n,
|
|
2738
2950
|
assetBaseUrl: a,
|
|
2739
2951
|
flowType: r,
|
|
2740
2952
|
customerId: l,
|
|
2953
|
+
brandId: u,
|
|
2741
2954
|
defaultFiatCurrency: m,
|
|
2742
|
-
defaultCryptoCurrency:
|
|
2743
|
-
defaultNetwork:
|
|
2744
|
-
defaultFiatAmount:
|
|
2745
|
-
defaultCryptoAmount:
|
|
2746
|
-
defaultWalletAddress:
|
|
2955
|
+
defaultCryptoCurrency: s,
|
|
2956
|
+
defaultNetwork: i,
|
|
2957
|
+
defaultFiatAmount: h,
|
|
2958
|
+
defaultCryptoAmount: p,
|
|
2959
|
+
defaultWalletAddress: d,
|
|
2747
2960
|
defaultGateway: f,
|
|
2748
|
-
fieldLocks:
|
|
2749
|
-
statusPollInterval:
|
|
2750
|
-
onComplete:
|
|
2751
|
-
onError:
|
|
2961
|
+
fieldLocks: y,
|
|
2962
|
+
statusPollInterval: w,
|
|
2963
|
+
onComplete: b,
|
|
2964
|
+
onError: T,
|
|
2752
2965
|
children: /* @__PURE__ */ e(
|
|
2753
|
-
|
|
2966
|
+
Mn,
|
|
2754
2967
|
{
|
|
2755
|
-
className:
|
|
2756
|
-
theme:
|
|
2757
|
-
skinId:
|
|
2758
|
-
accentColor:
|
|
2759
|
-
bgColor:
|
|
2760
|
-
bgImage:
|
|
2761
|
-
borderColor:
|
|
2762
|
-
borderRadius:
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2968
|
+
className: Q,
|
|
2969
|
+
theme: Z,
|
|
2970
|
+
skinId: q,
|
|
2971
|
+
accentColor: ee,
|
|
2972
|
+
bgColor: se,
|
|
2973
|
+
bgImage: g,
|
|
2974
|
+
borderColor: L,
|
|
2975
|
+
borderRadius: S,
|
|
2976
|
+
surfaceColor: c,
|
|
2977
|
+
inputBgColor: C,
|
|
2978
|
+
textColor: P,
|
|
2979
|
+
textSecondaryColor: I,
|
|
2980
|
+
textMutedColor: Se,
|
|
2981
|
+
successColor: ie,
|
|
2982
|
+
showFlowToggle: $,
|
|
2983
|
+
showSettings: ue,
|
|
2984
|
+
showThemeToggle: k,
|
|
2985
|
+
autoRedirect: xe,
|
|
2986
|
+
explorerUrl: V,
|
|
2987
|
+
doneButtonText: ne,
|
|
2988
|
+
supportEmail: ae,
|
|
2989
|
+
onDone: ge
|
|
2769
2990
|
}
|
|
2770
2991
|
)
|
|
2771
2992
|
}
|
|
2772
2993
|
);
|
|
2773
2994
|
}
|
|
2774
|
-
function
|
|
2995
|
+
function jn({
|
|
2775
2996
|
submitButtonText: t,
|
|
2776
2997
|
rateRefreshInterval: n,
|
|
2777
2998
|
...a
|
|
2778
2999
|
}) {
|
|
2779
|
-
return /* @__PURE__ */ e(
|
|
3000
|
+
return /* @__PURE__ */ e(Bn, { ...a });
|
|
2780
3001
|
}
|
|
2781
|
-
function
|
|
3002
|
+
function Vn({
|
|
2782
3003
|
skin: t,
|
|
2783
3004
|
active: n,
|
|
2784
3005
|
onClick: a,
|
|
2785
3006
|
darkMode: r,
|
|
2786
3007
|
dimmed: l
|
|
2787
3008
|
}) {
|
|
2788
|
-
const
|
|
3009
|
+
const u = t.accent === null, m = 32;
|
|
2789
3010
|
return /* @__PURE__ */ o(
|
|
2790
3011
|
"button",
|
|
2791
3012
|
{
|
|
2792
3013
|
onClick: a,
|
|
2793
3014
|
className: "relative shrink-0",
|
|
2794
|
-
style: { width:
|
|
3015
|
+
style: { width: m, height: m, opacity: l ? 0.4 : 1, transition: "opacity 0.2s" },
|
|
2795
3016
|
children: [
|
|
2796
|
-
|
|
3017
|
+
u ? /* @__PURE__ */ o("svg", { width: m, height: m, viewBox: "0 0 32 32", children: [
|
|
2797
3018
|
/* @__PURE__ */ e("clipPath", { id: "mono-left", children: /* @__PURE__ */ e("rect", { x: "0", y: "0", width: "16", height: "32" }) }),
|
|
2798
3019
|
/* @__PURE__ */ e("clipPath", { id: "mono-right", children: /* @__PURE__ */ e("rect", { x: "16", y: "0", width: "16", height: "32" }) }),
|
|
2799
3020
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#111111", clipPath: "url(#mono-left)" }),
|
|
2800
3021
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#ffffff", clipPath: "url(#mono-right)" }),
|
|
2801
3022
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke: r ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.1)", strokeWidth: "1" })
|
|
2802
|
-
] }) : /* @__PURE__ */ e("svg", { width:
|
|
3023
|
+
] }) : /* @__PURE__ */ e("svg", { width: m, height: m, viewBox: "0 0 32 32", children: /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: t.accent }) }),
|
|
2803
3024
|
n && !l && /* @__PURE__ */ e(
|
|
2804
3025
|
"div",
|
|
2805
3026
|
{
|
|
@@ -2811,13 +3032,13 @@ function On({
|
|
|
2811
3032
|
}
|
|
2812
3033
|
);
|
|
2813
3034
|
}
|
|
2814
|
-
function
|
|
3035
|
+
function On({ quote: t }) {
|
|
2815
3036
|
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__ */ o("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: [
|
|
2816
3037
|
"#",
|
|
2817
3038
|
t.rank
|
|
2818
3039
|
] }) : null;
|
|
2819
3040
|
}
|
|
2820
|
-
function
|
|
3041
|
+
function Pn({ quote: t }) {
|
|
2821
3042
|
return t.gatewayLogo ? /* @__PURE__ */ e(
|
|
2822
3043
|
"img",
|
|
2823
3044
|
{
|
|
@@ -2828,9 +3049,9 @@ function En({ quote: t }) {
|
|
|
2828
3049
|
className: "rounded-full shrink-0",
|
|
2829
3050
|
style: { width: 36, height: 36 }
|
|
2830
3051
|
}
|
|
2831
|
-
) : /* @__PURE__ */ e(
|
|
3052
|
+
) : /* @__PURE__ */ e(qe, { size: 36 });
|
|
2832
3053
|
}
|
|
2833
|
-
function
|
|
3054
|
+
function Dn() {
|
|
2834
3055
|
return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ o(
|
|
2835
3056
|
"div",
|
|
2836
3057
|
{
|
|
@@ -2843,34 +3064,34 @@ function An() {
|
|
|
2843
3064
|
background: "var(--t-surface)"
|
|
2844
3065
|
},
|
|
2845
3066
|
children: [
|
|
2846
|
-
/* @__PURE__ */ e(
|
|
3067
|
+
/* @__PURE__ */ e(B, { w: 36, h: 36, className: "rounded-full shrink-0" }),
|
|
2847
3068
|
/* @__PURE__ */ o("div", { className: "flex-1", children: [
|
|
2848
|
-
/* @__PURE__ */ e(
|
|
2849
|
-
/* @__PURE__ */ e(
|
|
3069
|
+
/* @__PURE__ */ e(B, { w: 90, h: 14, className: "mb-1.5" }),
|
|
3070
|
+
/* @__PURE__ */ e(B, { w: 60, h: 12 })
|
|
2850
3071
|
] }),
|
|
2851
3072
|
/* @__PURE__ */ o("div", { className: "text-right", children: [
|
|
2852
|
-
/* @__PURE__ */ e(
|
|
2853
|
-
/* @__PURE__ */ e(
|
|
3073
|
+
/* @__PURE__ */ e(B, { w: 40, h: 10, className: "mb-1.5" }),
|
|
3074
|
+
/* @__PURE__ */ e(B, { w: 80, h: 14 })
|
|
2854
3075
|
] })
|
|
2855
3076
|
]
|
|
2856
3077
|
},
|
|
2857
3078
|
t
|
|
2858
3079
|
)) });
|
|
2859
3080
|
}
|
|
2860
|
-
function
|
|
3081
|
+
function Gn({
|
|
2861
3082
|
onClose: t,
|
|
2862
3083
|
onSelect: n,
|
|
2863
3084
|
quotes: a,
|
|
2864
3085
|
quotesLoading: r,
|
|
2865
3086
|
cryptoCurrency: l
|
|
2866
3087
|
}) {
|
|
2867
|
-
const [
|
|
3088
|
+
const [u, m] = v(""), s = j(() => {
|
|
2868
3089
|
if (!(a != null && a.quotes)) return [];
|
|
2869
|
-
const
|
|
2870
|
-
return
|
|
2871
|
-
}, [a,
|
|
2872
|
-
return /* @__PURE__ */ o(
|
|
2873
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
3090
|
+
const i = u.trim().toLowerCase();
|
|
3091
|
+
return i ? a.quotes.filter((h) => h.gatewayName.toLowerCase().includes(i)) : a.quotes;
|
|
3092
|
+
}, [a, u]);
|
|
3093
|
+
return /* @__PURE__ */ o(te, { children: [
|
|
3094
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Ie, { onClick: t }) }),
|
|
2874
3095
|
/* @__PURE__ */ e(
|
|
2875
3096
|
"h2",
|
|
2876
3097
|
{
|
|
@@ -2879,112 +3100,112 @@ function Pn({
|
|
|
2879
3100
|
children: "Choose Ramp"
|
|
2880
3101
|
}
|
|
2881
3102
|
),
|
|
2882
|
-
/* @__PURE__ */ e(
|
|
3103
|
+
/* @__PURE__ */ e(Fe, { value: u, onChange: m }),
|
|
2883
3104
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
|
|
2884
|
-
r ? /* @__PURE__ */ e(
|
|
2885
|
-
const
|
|
3105
|
+
r ? /* @__PURE__ */ e(Dn, {}) : s.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: a && a.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : s.map((i, h) => {
|
|
3106
|
+
const p = h === 0, d = parseFloat(i.cryptoAmount), f = d >= 1 ? d.toFixed(4) : d.toPrecision(6);
|
|
2886
3107
|
return /* @__PURE__ */ o(
|
|
2887
3108
|
"button",
|
|
2888
3109
|
{
|
|
2889
|
-
onClick: () => n(
|
|
3110
|
+
onClick: () => n(i),
|
|
2890
3111
|
className: "w-full flex items-center gap-3.5 transition-colors",
|
|
2891
3112
|
style: {
|
|
2892
|
-
borderRadius:
|
|
2893
|
-
height:
|
|
3113
|
+
borderRadius: p ? 4.5 : 5,
|
|
3114
|
+
height: p ? 63 : 64,
|
|
2894
3115
|
paddingLeft: 16,
|
|
2895
3116
|
paddingRight: 16,
|
|
2896
|
-
border:
|
|
2897
|
-
background:
|
|
3117
|
+
border: p ? "1px solid var(--t-border)" : "1px solid transparent",
|
|
3118
|
+
background: p ? "transparent" : "var(--t-surface)"
|
|
2898
3119
|
},
|
|
2899
3120
|
children: [
|
|
2900
|
-
/* @__PURE__ */ e(
|
|
3121
|
+
/* @__PURE__ */ e(Pn, { quote: i }),
|
|
2901
3122
|
/* @__PURE__ */ o("div", { className: "text-left flex-1 min-w-0", children: [
|
|
2902
|
-
/* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children:
|
|
2903
|
-
/* @__PURE__ */ e(
|
|
3123
|
+
/* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: i.gatewayName }),
|
|
3124
|
+
/* @__PURE__ */ e(On, { quote: i })
|
|
2904
3125
|
] }),
|
|
2905
3126
|
/* @__PURE__ */ o("div", { className: "text-right shrink-0", children: [
|
|
2906
3127
|
/* @__PURE__ */ e("div", { className: "text-[11px]", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
|
|
2907
3128
|
/* @__PURE__ */ o("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
|
|
2908
3129
|
l,
|
|
2909
3130
|
" ",
|
|
2910
|
-
|
|
3131
|
+
f
|
|
2911
3132
|
] })
|
|
2912
3133
|
] })
|
|
2913
3134
|
]
|
|
2914
3135
|
},
|
|
2915
|
-
|
|
3136
|
+
i.gatewayId
|
|
2916
3137
|
);
|
|
2917
3138
|
}),
|
|
2918
|
-
!r && (a == null ? void 0 : a.unavailableGateways) && a.unavailableGateways.length > 0 && /* @__PURE__ */ e("div", { className: "pt-3", children: a.unavailableGateways.map((
|
|
3139
|
+
!r && (a == null ? void 0 : a.unavailableGateways) && a.unavailableGateways.length > 0 && /* @__PURE__ */ e("div", { className: "pt-3", children: a.unavailableGateways.map((i) => /* @__PURE__ */ o(
|
|
2919
3140
|
"div",
|
|
2920
3141
|
{
|
|
2921
3142
|
className: "flex items-center justify-between py-2 text-[12px]",
|
|
2922
3143
|
style: { color: "var(--t-text-muted)" },
|
|
2923
3144
|
children: [
|
|
2924
|
-
/* @__PURE__ */ e("span", { children:
|
|
2925
|
-
/* @__PURE__ */ e("span", { children:
|
|
3145
|
+
/* @__PURE__ */ e("span", { children: i.gatewayName }),
|
|
3146
|
+
/* @__PURE__ */ e("span", { children: i.reason })
|
|
2926
3147
|
]
|
|
2927
3148
|
},
|
|
2928
|
-
|
|
3149
|
+
i.gatewayId
|
|
2929
3150
|
)) })
|
|
2930
3151
|
] })
|
|
2931
3152
|
] });
|
|
2932
3153
|
}
|
|
2933
3154
|
export {
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
3155
|
+
En as AnimatedDigit,
|
|
3156
|
+
An as AnimatedNumber,
|
|
3157
|
+
on as ApplePayIcon,
|
|
3158
|
+
Ze as BLOCKCHAINS,
|
|
3159
|
+
an as BankIcon,
|
|
3160
|
+
nn as CRYPTO_CHAIN_COMBOS,
|
|
3161
|
+
Tt as CRYPTO_CURRENCIES,
|
|
3162
|
+
cn as CardIcon,
|
|
3163
|
+
jn as CheckoutForm,
|
|
3164
|
+
xn as CheckoutStep,
|
|
3165
|
+
Le as ChevronDown,
|
|
3166
|
+
dn as ChevronRight,
|
|
3167
|
+
Gn as ChooseRampModal,
|
|
3168
|
+
Ie as CloseButton,
|
|
3169
|
+
Wn as CoinifyIcon,
|
|
3170
|
+
Nn as CompleteStep,
|
|
3171
|
+
Cn as ConfirmStep,
|
|
3172
|
+
Rn as CryptoCurrencyModal,
|
|
3173
|
+
Et as CryptoIcon,
|
|
3174
|
+
mn as DarkModeIcon,
|
|
3175
|
+
bn as ErrorStep,
|
|
3176
|
+
gt as FIAT_CURRENCIES,
|
|
3177
|
+
qt as FIAT_TO_COUNTRY,
|
|
3178
|
+
Sn as FiatCurrencyModal,
|
|
3179
|
+
Je as FiatFlag,
|
|
3180
|
+
wn as FormSkeleton,
|
|
3181
|
+
qe as GenericCoinIcon,
|
|
3182
|
+
ln as GooglePayIcon,
|
|
3183
|
+
Nt as MOCK_RATES,
|
|
3184
|
+
un as MenuIcon,
|
|
3185
|
+
He as Modal,
|
|
3186
|
+
sn as PayPalIcon,
|
|
3187
|
+
yn as PaymentMethodSelector,
|
|
3188
|
+
vn as ProcessingStep,
|
|
3189
|
+
Bn as RampForm,
|
|
3190
|
+
zt as RampProvider,
|
|
3191
|
+
rn as RevolutIcon,
|
|
3192
|
+
vt as SKINS,
|
|
3193
|
+
Fe as SearchInput,
|
|
3194
|
+
In as SettingsScreen,
|
|
3195
|
+
B as Skeleton,
|
|
3196
|
+
Vn as SkinSwatch,
|
|
3197
|
+
kn as ToggleSwitch,
|
|
3198
|
+
$n as formatOutput,
|
|
3199
|
+
ze as getChainIconUrl,
|
|
3200
|
+
kt as getCryptoIconUrl,
|
|
3201
|
+
en as getFiatFlagUrl,
|
|
3202
|
+
Xn as getMockRate,
|
|
3203
|
+
pn as getPaymentIcon,
|
|
3204
|
+
tn as parseAmount,
|
|
3205
|
+
Yt as useCheckoutIntent,
|
|
3206
|
+
Gt as useQuotes,
|
|
3207
|
+
we as useRamp,
|
|
3208
|
+
Vt as useRampConfig,
|
|
3209
|
+
Qt as useTransaction
|
|
2989
3210
|
};
|
|
2990
3211
|
//# sourceMappingURL=index.js.map
|