@nowramp/form 0.1.35 → 0.1.37
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 +1627 -1385
- package/dist/index.js.map +1 -1
- package/dist/nowramp-form.iife.js +12 -12
- package/dist/nowramp-form.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4,127 +4,127 @@
|
|
|
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}.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-2{padding-left:.5rem;padding-right:.5rem}.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-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.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-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.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-\\[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-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}.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-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.hover\\:opacity-70:hover{opacity:.7}
|
|
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}.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}.gap-4{gap:1rem}.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-2{padding-left:.5rem;padding-right:.5rem}.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-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.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-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.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-\\[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-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}.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-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.hover\\:opacity-70:hover{opacity:.7}
|
|
8
8
|
}`;
|
|
9
9
|
document.head.appendChild(s);
|
|
10
10
|
})();
|
|
11
|
-
import { jsx as e, jsxs as
|
|
12
|
-
import
|
|
13
|
-
import { RampApi as
|
|
14
|
-
function
|
|
15
|
-
const [n,
|
|
16
|
-
(!
|
|
17
|
-
const
|
|
11
|
+
import { jsx as e, jsxs as l, Fragment as J } from "react/jsx-runtime";
|
|
12
|
+
import ke, { useState as N, useRef as D, useCallback as _, useEffect as U, useMemo as F, useReducer as Rt, useContext as kt, createContext as Lt } from "react";
|
|
13
|
+
import { RampApi as Me } from "@nowramp/sdk";
|
|
14
|
+
function It(t, a) {
|
|
15
|
+
const [n, s] = N(null), [r, u] = N(!0), [m, i] = N(null), o = D(null);
|
|
16
|
+
(!o.current || o.current !== t) && (o.current = new Me({ apiKey: "", ...t }));
|
|
17
|
+
const d = _(async () => {
|
|
18
18
|
if (!t.projectId) {
|
|
19
|
-
|
|
19
|
+
i(new Error("projectId is required")), u(!1);
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
u(!0), i(null);
|
|
23
23
|
try {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
} catch (
|
|
27
|
-
|
|
24
|
+
const h = await o.current.getSupported(a);
|
|
25
|
+
s(h);
|
|
26
|
+
} catch (h) {
|
|
27
|
+
i(h instanceof Error ? h : new Error("Failed to fetch config"));
|
|
28
28
|
} finally {
|
|
29
|
-
|
|
29
|
+
u(!1);
|
|
30
30
|
}
|
|
31
31
|
}, [t.projectId, a]);
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
}, [
|
|
32
|
+
return U(() => {
|
|
33
|
+
d();
|
|
34
|
+
}, [d]), { config: n, loading: r, error: m, refetch: d };
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const [n,
|
|
38
|
-
(!
|
|
39
|
-
const f =
|
|
40
|
-
|
|
36
|
+
function Mt(t, a) {
|
|
37
|
+
const [n, s] = N(null), [r, u] = N(!1), [m, i] = N(null), o = D(null), d = D(""), h = `${t.apiUrl}|${t.projectId}`;
|
|
38
|
+
(!o.current || d.current !== h) && (o.current = new Me({ apiKey: "", ...t }), d.current = h);
|
|
39
|
+
const f = D(0);
|
|
40
|
+
U(() => {
|
|
41
41
|
const g = ++f.current;
|
|
42
42
|
if (!a || !t.projectId) {
|
|
43
|
-
|
|
43
|
+
s(null), u(!1);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
(
|
|
48
|
-
f.current === g && (
|
|
46
|
+
u(!0), i(null), o.current.getQuotes(a).then(
|
|
47
|
+
(p) => {
|
|
48
|
+
f.current === g && (s(p), u(!1));
|
|
49
49
|
},
|
|
50
|
-
(
|
|
51
|
-
f.current === g && (
|
|
50
|
+
(p) => {
|
|
51
|
+
f.current === g && (i(p instanceof Error ? p : new Error("Failed to fetch quotes")), s(null), u(!1));
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
54
|
}, [t.projectId, a == null ? void 0 : a.fiatCurrency, a == null ? void 0 : a.fiatAmount, a == null ? void 0 : a.cryptoAmount, a == null ? void 0 : a.cryptoCurrency, a == null ? void 0 : a.network, a == null ? void 0 : a.paymentMethodId, a == null ? void 0 : a.country, a == null ? void 0 : a.orderType]);
|
|
55
|
-
const x =
|
|
55
|
+
const x = _(async () => {
|
|
56
56
|
if (!(!a || !t.projectId)) {
|
|
57
|
-
|
|
57
|
+
u(!0), i(null);
|
|
58
58
|
try {
|
|
59
|
-
const g = await
|
|
60
|
-
|
|
59
|
+
const g = await o.current.getQuotes(a);
|
|
60
|
+
s(g);
|
|
61
61
|
} catch (g) {
|
|
62
|
-
|
|
62
|
+
i(g instanceof Error ? g : new Error("Failed to fetch quotes"));
|
|
63
63
|
} finally {
|
|
64
|
-
|
|
64
|
+
u(!1);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}, [t.projectId, a]);
|
|
68
|
-
return { quotes: n, loading: r, error:
|
|
68
|
+
return { quotes: n, loading: r, error: m, refetch: x };
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const [a, n] =
|
|
72
|
-
(!
|
|
73
|
-
const
|
|
74
|
-
r(!0),
|
|
70
|
+
function Bt(t) {
|
|
71
|
+
const [a, n] = N(null), [s, r] = N(!1), [u, m] = N(null), i = D(null), o = D(""), d = `${t.apiUrl}|${t.projectId}`;
|
|
72
|
+
(!i.current || o.current !== d) && (i.current = new Me({ apiKey: "", ...t }), o.current = d);
|
|
73
|
+
const h = _(async (x) => {
|
|
74
|
+
r(!0), m(null);
|
|
75
75
|
try {
|
|
76
|
-
const g = await
|
|
76
|
+
const g = await i.current.createCheckoutIntent(x);
|
|
77
77
|
return n(g), g;
|
|
78
78
|
} catch (g) {
|
|
79
|
-
const
|
|
80
|
-
throw
|
|
79
|
+
const p = g instanceof Error ? g : new Error("Failed to create checkout intent");
|
|
80
|
+
throw m(p), p;
|
|
81
81
|
} finally {
|
|
82
82
|
r(!1);
|
|
83
83
|
}
|
|
84
|
-
}, []), f =
|
|
85
|
-
n(null),
|
|
84
|
+
}, []), f = _(() => {
|
|
85
|
+
n(null), m(null);
|
|
86
86
|
}, []);
|
|
87
|
-
return { order: a, loading:
|
|
87
|
+
return { order: a, loading: s, error: u, createOrder: h, reset: f };
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
const [
|
|
91
|
-
|
|
92
|
-
const
|
|
89
|
+
function Ot(t, a, n) {
|
|
90
|
+
const [s, r] = N(null), [u, m] = N(!1), [i, o] = N(null), d = D(null);
|
|
91
|
+
d.current || (d.current = new Me({ apiKey: "", projectId: "", ...t }));
|
|
92
|
+
const h = _(async () => {
|
|
93
93
|
if (a) {
|
|
94
|
-
|
|
94
|
+
m(!0), o(null);
|
|
95
95
|
try {
|
|
96
|
-
const f = await
|
|
96
|
+
const f = await d.current.getTransaction(a);
|
|
97
97
|
r(f);
|
|
98
98
|
} catch (f) {
|
|
99
|
-
|
|
99
|
+
o(f instanceof Error ? f : new Error("Failed to fetch status"));
|
|
100
100
|
} finally {
|
|
101
|
-
|
|
101
|
+
m(!1);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}, [a]);
|
|
105
|
-
return
|
|
105
|
+
return U(() => {
|
|
106
106
|
if (!a) return;
|
|
107
107
|
const f = (n == null ? void 0 : n.initialDelay) ?? 0;
|
|
108
108
|
if (f > 0) {
|
|
109
|
-
const x = setTimeout(
|
|
109
|
+
const x = setTimeout(h, f);
|
|
110
110
|
return () => clearTimeout(x);
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
}, [
|
|
114
|
-
if (!a || !(n != null && n.pollInterval) || !
|
|
112
|
+
h();
|
|
113
|
+
}, [h, a, n == null ? void 0 : n.initialDelay]), U(() => {
|
|
114
|
+
if (!a || !(n != null && n.pollInterval) || !s || ["completed", "failed", "cancelled", "expired", "refunded"].includes(s.status))
|
|
115
115
|
return;
|
|
116
|
-
const x = setInterval(
|
|
116
|
+
const x = setInterval(h, n.pollInterval);
|
|
117
117
|
return () => clearInterval(x);
|
|
118
|
-
}, [a, n == null ? void 0 : n.pollInterval,
|
|
118
|
+
}, [a, n == null ? void 0 : n.pollInterval, s == null ? void 0 : s.status, h]), { status: s, loading: u, error: i, refetch: h };
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function lt(t, a) {
|
|
121
121
|
if (!t) return t;
|
|
122
122
|
const n = t.indexOf(".");
|
|
123
123
|
if (n === -1) return t;
|
|
124
|
-
let
|
|
125
|
-
return
|
|
124
|
+
let s = t;
|
|
125
|
+
return s.length - n - 1 > a && (s = s.slice(0, n + a + 1)), s = s.replace(/0+$/, "").replace(/\.$/, ""), s;
|
|
126
126
|
}
|
|
127
|
-
const
|
|
127
|
+
const ht = {
|
|
128
128
|
step: "amount",
|
|
129
129
|
flowType: "buy",
|
|
130
130
|
fiatCurrency: "USD",
|
|
@@ -142,7 +142,7 @@ const mt = {
|
|
|
142
142
|
country: "",
|
|
143
143
|
errorMessage: null
|
|
144
144
|
};
|
|
145
|
-
function
|
|
145
|
+
function Pt(t, a) {
|
|
146
146
|
switch (a.type) {
|
|
147
147
|
case "SET_STEP":
|
|
148
148
|
return { ...t, step: a.step, errorMessage: null };
|
|
@@ -152,6 +152,7 @@ function Bt(t, a) {
|
|
|
152
152
|
flowType: a.flowType,
|
|
153
153
|
fiatAmount: "",
|
|
154
154
|
cryptoAmount: "",
|
|
155
|
+
paymentMethodId: "",
|
|
155
156
|
selectedQuote: null,
|
|
156
157
|
selectedProvider: null,
|
|
157
158
|
errorMessage: null
|
|
@@ -191,799 +192,193 @@ function Bt(t, a) {
|
|
|
191
192
|
case "CLEAR_ERROR":
|
|
192
193
|
return { ...t, errorMessage: null };
|
|
193
194
|
case "RESET":
|
|
194
|
-
return
|
|
195
|
+
return ht;
|
|
195
196
|
default:
|
|
196
197
|
return t;
|
|
197
198
|
}
|
|
198
199
|
}
|
|
199
|
-
const
|
|
200
|
-
function
|
|
200
|
+
const ft = Lt(null);
|
|
201
|
+
function Ht({
|
|
201
202
|
projectId: t,
|
|
202
203
|
apiUrl: a = "https://api.nowramp.com",
|
|
203
204
|
assetBaseUrl: n = "",
|
|
204
|
-
flowType:
|
|
205
|
+
flowType: s = "buy",
|
|
205
206
|
customerId: r = "",
|
|
206
|
-
defaultFiatCurrency:
|
|
207
|
-
defaultCryptoCurrency:
|
|
208
|
-
defaultNetwork:
|
|
209
|
-
defaultFiatAmount:
|
|
210
|
-
defaultCryptoAmount:
|
|
211
|
-
defaultWalletAddress:
|
|
207
|
+
defaultFiatCurrency: u = "USD",
|
|
208
|
+
defaultCryptoCurrency: m = "BTC",
|
|
209
|
+
defaultNetwork: i = "",
|
|
210
|
+
defaultFiatAmount: o = "",
|
|
211
|
+
defaultCryptoAmount: d = "",
|
|
212
|
+
defaultWalletAddress: h = "",
|
|
212
213
|
defaultGateway: f,
|
|
213
214
|
fieldLocks: x,
|
|
214
215
|
statusPollInterval: g = 5e3,
|
|
215
|
-
onComplete:
|
|
216
|
+
onComplete: p,
|
|
216
217
|
onError: b,
|
|
217
|
-
children:
|
|
218
|
+
children: S
|
|
218
219
|
}) {
|
|
219
|
-
const
|
|
220
|
-
...
|
|
221
|
-
step:
|
|
222
|
-
flowType:
|
|
223
|
-
fiatCurrency:
|
|
224
|
-
cryptoCurrency:
|
|
225
|
-
network:
|
|
226
|
-
fiatAmount:
|
|
227
|
-
cryptoAmount:
|
|
228
|
-
walletAddress:
|
|
220
|
+
const P = F(() => ({ apiUrl: a, projectId: t }), [a, t]), w = i || (m ? m.toLowerCase() : ""), G = s === "sell", Q = G ? !!d : !!o, z = (G ? !!(Q && m && w) : !!(Q && m && w && h)) && f ? "confirm" : "amount", [c, O] = Rt(Pt, {
|
|
221
|
+
...ht,
|
|
222
|
+
step: z,
|
|
223
|
+
flowType: s,
|
|
224
|
+
fiatCurrency: u,
|
|
225
|
+
cryptoCurrency: m,
|
|
226
|
+
network: w,
|
|
227
|
+
fiatAmount: lt(o, 2),
|
|
228
|
+
cryptoAmount: lt(d, 6),
|
|
229
|
+
walletAddress: h,
|
|
229
230
|
customerId: r
|
|
230
|
-
}),
|
|
231
|
-
config:
|
|
232
|
-
loading:
|
|
233
|
-
error:
|
|
234
|
-
} =
|
|
235
|
-
|
|
236
|
-
var R, k,
|
|
237
|
-
if (!
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
}, [
|
|
241
|
-
|
|
242
|
-
if (
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
231
|
+
}), C = c.flowType === "sell", {
|
|
232
|
+
config: L,
|
|
233
|
+
loading: K,
|
|
234
|
+
error: X
|
|
235
|
+
} = It(P, c.flowType);
|
|
236
|
+
ke.useEffect(() => {
|
|
237
|
+
var R, k, T;
|
|
238
|
+
if (!L || !c.cryptoCurrency || c.network) return;
|
|
239
|
+
const v = (R = L.cryptos) == null ? void 0 : R.find((H) => H.code === c.cryptoCurrency), E = ((k = v == null ? void 0 : v.networks) == null ? void 0 : k.find((H) => H.isDefault)) || ((T = v == null ? void 0 : v.networks) == null ? void 0 : T[0]);
|
|
240
|
+
E != null && E.id && O({ type: "SET_NETWORK", network: E.id });
|
|
241
|
+
}, [L, c.cryptoCurrency, c.network]), ke.useEffect(() => {
|
|
242
|
+
var k, T;
|
|
243
|
+
if (!((k = L == null ? void 0 : L.paymentMethods) != null && k.length)) return;
|
|
244
|
+
const v = c.fiatCurrency, E = L.paymentMethods;
|
|
245
|
+
if (c.paymentMethodId && E.some(
|
|
246
|
+
(W) => W.id === c.paymentMethodId && W.supportedFiats.includes(v)
|
|
247
|
+
))
|
|
248
|
+
return;
|
|
249
|
+
const R = E.find((H) => H.supportedFiats.includes(v));
|
|
250
|
+
O({ type: "SET_PAYMENT_METHOD", methodId: (R == null ? void 0 : R.id) || ((T = E[0]) == null ? void 0 : T.id) || "" });
|
|
251
|
+
}, [L, c.fiatCurrency, c.paymentMethodId]);
|
|
252
|
+
const $ = F(() => {
|
|
253
|
+
if (C) {
|
|
254
|
+
if (!c.cryptoAmount) return null;
|
|
255
|
+
const T = parseFloat(c.cryptoAmount);
|
|
256
|
+
return isNaN(T) || T <= 0 ? "Enter a valid amount" : null;
|
|
246
257
|
}
|
|
247
|
-
if (!
|
|
248
|
-
const
|
|
249
|
-
if (isNaN(
|
|
250
|
-
const
|
|
251
|
-
if (!
|
|
252
|
-
const R = parseFloat(
|
|
253
|
-
return !isNaN(R) &&
|
|
254
|
-
}, [
|
|
255
|
-
const
|
|
256
|
-
return !
|
|
257
|
-
fiatCurrency:
|
|
258
|
-
...
|
|
259
|
-
cryptoCurrency:
|
|
260
|
-
network:
|
|
261
|
-
paymentMethodId:
|
|
262
|
-
country:
|
|
263
|
-
orderType:
|
|
258
|
+
if (!L || !c.fiatAmount) return null;
|
|
259
|
+
const v = parseFloat(c.fiatAmount);
|
|
260
|
+
if (isNaN(v)) return null;
|
|
261
|
+
const E = L.fiats.find((T) => T.code === c.fiatCurrency);
|
|
262
|
+
if (!E) return null;
|
|
263
|
+
const R = parseFloat(E.minAmount), k = parseFloat(E.maxAmount);
|
|
264
|
+
return !isNaN(R) && v < R ? `Minimum amount is ${E.minAmount} ${c.fiatCurrency}` : !isNaN(k) && v > k ? `Maximum amount is ${E.maxAmount} ${c.fiatCurrency}` : null;
|
|
265
|
+
}, [L, c.fiatAmount, c.fiatCurrency, c.cryptoAmount, C]), Ne = F(() => {
|
|
266
|
+
const v = C ? !!c.cryptoAmount : !!c.fiatAmount;
|
|
267
|
+
return !L || !v || !c.cryptoCurrency || !c.network || $ ? null : {
|
|
268
|
+
fiatCurrency: c.fiatCurrency,
|
|
269
|
+
...C ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
|
|
270
|
+
cryptoCurrency: c.cryptoCurrency,
|
|
271
|
+
network: c.network,
|
|
272
|
+
paymentMethodId: c.paymentMethodId || void 0,
|
|
273
|
+
country: c.country || void 0,
|
|
274
|
+
orderType: c.flowType
|
|
264
275
|
};
|
|
265
|
-
}, [
|
|
266
|
-
quotes:
|
|
276
|
+
}, [L, c.fiatCurrency, c.fiatAmount, c.cryptoAmount, c.cryptoCurrency, c.network, c.paymentMethodId, c.country, $, C, c.flowType]), {
|
|
277
|
+
quotes: he,
|
|
267
278
|
loading: fe,
|
|
268
279
|
error: Y,
|
|
269
280
|
refetch: ye
|
|
270
|
-
} =
|
|
271
|
-
order:
|
|
272
|
-
loading:
|
|
273
|
-
error:
|
|
274
|
-
createOrder:
|
|
275
|
-
} =
|
|
281
|
+
} = Mt(P, Ne), {
|
|
282
|
+
order: ae,
|
|
283
|
+
loading: Ce,
|
|
284
|
+
error: se,
|
|
285
|
+
createOrder: ce
|
|
286
|
+
} = Bt(P), be = 15e3, {
|
|
276
287
|
status: V,
|
|
277
|
-
loading:
|
|
278
|
-
} =
|
|
288
|
+
loading: ne
|
|
289
|
+
} = Ot(
|
|
279
290
|
{ apiUrl: a },
|
|
280
|
-
(
|
|
281
|
-
{ pollInterval: g, initialDelay:
|
|
291
|
+
(ae == null ? void 0 : ae.orderId) ?? null,
|
|
292
|
+
{ pollInterval: g, initialDelay: be }
|
|
282
293
|
);
|
|
283
|
-
|
|
284
|
-
(V == null ? void 0 : V.status) === "completed" &&
|
|
285
|
-
}, [V == null ? void 0 : V.status,
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
}, [
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
const
|
|
294
|
-
var
|
|
295
|
-
const
|
|
296
|
-
if (!
|
|
297
|
-
const
|
|
298
|
-
|
|
294
|
+
ke.useEffect(() => {
|
|
295
|
+
(V == null ? void 0 : V.status) === "completed" && p && p(V);
|
|
296
|
+
}, [V == null ? void 0 : V.status, p]), ke.useEffect(() => {
|
|
297
|
+
const v = X || se;
|
|
298
|
+
v && b && b(v);
|
|
299
|
+
}, [X, se, b]);
|
|
300
|
+
const re = f || (L == null ? void 0 : L.defaultGateway) || null, Ee = D(re);
|
|
301
|
+
Ee.current = re;
|
|
302
|
+
const Ae = D(he);
|
|
303
|
+
Ae.current = he;
|
|
304
|
+
const we = _(async () => {
|
|
305
|
+
var E, R, k;
|
|
306
|
+
const v = ((E = c.selectedQuote) == null ? void 0 : E.gatewayId) || ((k = (R = Ae.current) == null ? void 0 : R.bestQuote) == null ? void 0 : k.gatewayId) || Ee.current;
|
|
307
|
+
if (!v || !c.walletAddress) {
|
|
308
|
+
const T = [!v && "gateway", !c.walletAddress && "walletAddress"].filter(Boolean).join(", ");
|
|
309
|
+
O({ type: "SET_ERROR", message: `Missing required fields: ${T}` });
|
|
299
310
|
return;
|
|
300
311
|
}
|
|
301
312
|
try {
|
|
302
|
-
await
|
|
303
|
-
gateway:
|
|
304
|
-
|
|
305
|
-
fiatCurrency:
|
|
306
|
-
...
|
|
307
|
-
cryptoCurrency:
|
|
308
|
-
network:
|
|
309
|
-
walletAddress:
|
|
310
|
-
paymentMethodId:
|
|
311
|
-
email:
|
|
312
|
-
orderType:
|
|
313
|
-
}),
|
|
314
|
-
} catch (
|
|
315
|
-
const
|
|
316
|
-
/wallet|address/i.test(
|
|
313
|
+
await ce({
|
|
314
|
+
gateway: v,
|
|
315
|
+
customerId: c.customerId || void 0,
|
|
316
|
+
fiatCurrency: c.fiatCurrency,
|
|
317
|
+
...C ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
|
|
318
|
+
cryptoCurrency: c.cryptoCurrency,
|
|
319
|
+
network: c.network,
|
|
320
|
+
walletAddress: c.walletAddress,
|
|
321
|
+
paymentMethodId: c.paymentMethodId || void 0,
|
|
322
|
+
email: c.email || void 0,
|
|
323
|
+
orderType: c.flowType
|
|
324
|
+
}), O({ type: "SET_STEP", step: "checkout" });
|
|
325
|
+
} catch (T) {
|
|
326
|
+
const H = T instanceof Error ? T.message : "Failed to create order";
|
|
327
|
+
/wallet|address/i.test(H) ? O({ type: "SET_WALLET_ERROR", message: H.replace(/^Failed to create checkout intent:\s*/i, "") }) : O({ type: "SET_ERROR", message: H });
|
|
317
328
|
}
|
|
318
|
-
}, [
|
|
319
|
-
|
|
320
|
-
}, []), ie =
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
}, [
|
|
324
|
-
const
|
|
325
|
-
switch (
|
|
329
|
+
}, [c, ce, C]), q = _((v) => {
|
|
330
|
+
O({ type: "SET_STEP", step: v });
|
|
331
|
+
}, []), ie = _(() => {
|
|
332
|
+
const v = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], E = v.indexOf(c.step);
|
|
333
|
+
E > 0 && O({ type: "SET_STEP", step: v[E - 1] });
|
|
334
|
+
}, [c.step, C]), Oe = F(() => {
|
|
335
|
+
const v = C ? !!c.cryptoAmount : !!c.fiatAmount;
|
|
336
|
+
switch (c.step) {
|
|
326
337
|
case "confirm":
|
|
327
|
-
return !!(
|
|
338
|
+
return !!(v && c.cryptoCurrency && c.network && c.walletAddress && !$);
|
|
328
339
|
case "amount":
|
|
329
|
-
return !!(
|
|
340
|
+
return !!(v && c.cryptoCurrency && c.network && !$);
|
|
330
341
|
case "quotes":
|
|
331
|
-
return !!
|
|
342
|
+
return !!c.selectedQuote;
|
|
332
343
|
case "wallet":
|
|
333
|
-
return !!
|
|
344
|
+
return !!c.walletAddress;
|
|
334
345
|
default:
|
|
335
346
|
return !1;
|
|
336
347
|
}
|
|
337
|
-
}, [
|
|
338
|
-
apiConfig:
|
|
348
|
+
}, [c, $, C]), xe = {
|
|
349
|
+
apiConfig: P,
|
|
339
350
|
assetBaseUrl: n,
|
|
340
|
-
config:
|
|
341
|
-
configLoading:
|
|
342
|
-
configError:
|
|
343
|
-
state:
|
|
344
|
-
dispatch:
|
|
345
|
-
quotes:
|
|
351
|
+
config: L,
|
|
352
|
+
configLoading: K,
|
|
353
|
+
configError: X,
|
|
354
|
+
state: c,
|
|
355
|
+
dispatch: O,
|
|
356
|
+
quotes: he,
|
|
346
357
|
quotesLoading: fe,
|
|
347
358
|
quotesError: Y,
|
|
348
359
|
fetchQuotes: ye,
|
|
349
|
-
order:
|
|
350
|
-
orderLoading:
|
|
351
|
-
orderError:
|
|
352
|
-
createOrder:
|
|
360
|
+
order: ae,
|
|
361
|
+
orderLoading: Ce,
|
|
362
|
+
orderError: se,
|
|
363
|
+
createOrder: we,
|
|
353
364
|
orderStatus: V,
|
|
354
|
-
orderStatusLoading:
|
|
365
|
+
orderStatusLoading: ne,
|
|
355
366
|
fieldLocks: x || null,
|
|
356
|
-
defaultGateway:
|
|
357
|
-
amountError:
|
|
358
|
-
goToStep:
|
|
367
|
+
defaultGateway: re,
|
|
368
|
+
amountError: $,
|
|
369
|
+
goToStep: q,
|
|
359
370
|
goBack: ie,
|
|
360
|
-
canProceed:
|
|
371
|
+
canProceed: Oe
|
|
361
372
|
};
|
|
362
|
-
return /* @__PURE__ */ e(
|
|
373
|
+
return /* @__PURE__ */ e(ft.Provider, { value: xe, children: S });
|
|
363
374
|
}
|
|
364
|
-
function
|
|
365
|
-
const t =
|
|
375
|
+
function pe() {
|
|
376
|
+
const t = kt(ft);
|
|
366
377
|
if (!t)
|
|
367
378
|
throw new Error("useRamp must be used within a RampProvider");
|
|
368
379
|
return t;
|
|
369
380
|
}
|
|
370
|
-
|
|
371
|
-
className: t = "",
|
|
372
|
-
iframeHeight: a = 600,
|
|
373
|
-
autoRedirect: n = !1,
|
|
374
|
-
redirectDelay: l = 3e3
|
|
375
|
-
}) {
|
|
376
|
-
var g;
|
|
377
|
-
const { order: r, orderStatus: d, goToStep: u, goBack: m } = he(), [c, i] = C(!1), [p, f] = C(null), x = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
|
|
378
|
-
if (H(() => {
|
|
379
|
-
if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !x) {
|
|
380
|
-
f(Math.ceil(l / 1e3));
|
|
381
|
-
const h = setTimeout(() => {
|
|
382
|
-
window.location.href = r.checkout.url;
|
|
383
|
-
}, l), b = setInterval(() => {
|
|
384
|
-
f((L) => L && L > 1 ? L - 1 : null);
|
|
385
|
-
}, 1e3);
|
|
386
|
-
return () => {
|
|
387
|
-
clearTimeout(h), clearInterval(b);
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
}, [r, n, l, x]), H(() => {
|
|
391
|
-
d && (d.status === "completed" ? u("complete") : ["failed", "cancelled", "expired"].includes(d.status) && u("error"));
|
|
392
|
-
}, [d == null ? void 0 : d.status, u]), !r)
|
|
393
|
-
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-8 ${t}`, style: { color: "var(--t-text)" }, children: [
|
|
394
|
-
/* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "No order found" }),
|
|
395
|
-
/* @__PURE__ */ e(
|
|
396
|
-
"button",
|
|
397
|
-
{
|
|
398
|
-
className: "font-semibold text-[14px] transition-all",
|
|
399
|
-
style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)", paddingLeft: 24, paddingRight: 24 },
|
|
400
|
-
onClick: m,
|
|
401
|
-
children: "Go Back"
|
|
402
|
-
}
|
|
403
|
-
)
|
|
404
|
-
] });
|
|
405
|
-
if (x)
|
|
406
|
-
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-8 text-center ${t}`, style: { color: "var(--t-text)" }, children: [
|
|
407
|
-
/* @__PURE__ */ e("div", { className: "text-[48px] mb-4", children: "⏰" }),
|
|
408
|
-
/* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Checkout Expired" }),
|
|
409
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: "The checkout link has expired. Please try again." }),
|
|
410
|
-
/* @__PURE__ */ e(
|
|
411
|
-
"button",
|
|
412
|
-
{
|
|
413
|
-
className: "w-full font-semibold text-[16px] transition-all",
|
|
414
|
-
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
|
|
415
|
-
onClick: m,
|
|
416
|
-
children: "Start Over"
|
|
417
|
-
}
|
|
418
|
-
)
|
|
419
|
-
] });
|
|
420
|
-
if (r.checkout.method === "iframe")
|
|
421
|
-
return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ o("div", { className: "relative flex-1", style: { height: a, borderRadius: 5, overflow: "hidden", background: "var(--t-surface)" }, children: [
|
|
422
|
-
!c && /* @__PURE__ */ o("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
423
|
-
/* @__PURE__ */ e("div", { className: "nramp-spinner" }),
|
|
424
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
|
|
425
|
-
] }),
|
|
426
|
-
/* @__PURE__ */ e(
|
|
427
|
-
"iframe",
|
|
428
|
-
{
|
|
429
|
-
src: r.checkout.url,
|
|
430
|
-
style: {
|
|
431
|
-
display: c ? "block" : "none",
|
|
432
|
-
width: "100%",
|
|
433
|
-
height: "100%",
|
|
434
|
-
border: "none"
|
|
435
|
-
},
|
|
436
|
-
allow: ((g = r.checkout.allowedFeatures) == null ? void 0 : g.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
|
|
437
|
-
onLoad: () => i(!0),
|
|
438
|
-
title: "Provider Checkout"
|
|
439
|
-
}
|
|
440
|
-
)
|
|
441
|
-
] }) });
|
|
442
|
-
if (r.checkout.method === "redirect")
|
|
443
|
-
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-8 text-center ${t}`, style: { color: "var(--t-text)" }, children: [
|
|
444
|
-
/* @__PURE__ */ e("div", { className: "text-[48px] mb-4", children: "🔗" }),
|
|
445
|
-
/* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Complete Payment" }),
|
|
446
|
-
/* @__PURE__ */ o("p", { className: "text-[14px] mb-4", style: { color: "var(--t-text-secondary)" }, children: [
|
|
447
|
-
"You'll be redirected to ",
|
|
448
|
-
r.gateway,
|
|
449
|
-
" to complete your payment."
|
|
450
|
-
] }),
|
|
451
|
-
p !== null && /* @__PURE__ */ o("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: [
|
|
452
|
-
"Redirecting in ",
|
|
453
|
-
p,
|
|
454
|
-
"..."
|
|
455
|
-
] }),
|
|
456
|
-
/* @__PURE__ */ o(
|
|
457
|
-
"a",
|
|
458
|
-
{
|
|
459
|
-
href: r.checkout.url,
|
|
460
|
-
className: "w-full font-semibold text-[16px] flex items-center justify-center transition-all",
|
|
461
|
-
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", textDecoration: "none" },
|
|
462
|
-
target: "_blank",
|
|
463
|
-
rel: "noopener noreferrer",
|
|
464
|
-
children: [
|
|
465
|
-
"Continue to ",
|
|
466
|
-
r.gateway
|
|
467
|
-
]
|
|
468
|
-
}
|
|
469
|
-
),
|
|
470
|
-
/* @__PURE__ */ e(
|
|
471
|
-
"button",
|
|
472
|
-
{
|
|
473
|
-
className: "w-full font-semibold text-[14px] mt-2 transition-all",
|
|
474
|
-
style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)" },
|
|
475
|
-
onClick: m,
|
|
476
|
-
children: "Cancel"
|
|
477
|
-
}
|
|
478
|
-
)
|
|
479
|
-
] });
|
|
480
|
-
if (r.checkout.method === "widget" && r.widgetConfig) {
|
|
481
|
-
const h = Pt(r.checkout.url, r.widgetConfig);
|
|
482
|
-
return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ o("div", { className: "relative flex-1", style: { height: a, borderRadius: 5, overflow: "hidden", background: "var(--t-surface)" }, children: [
|
|
483
|
-
!c && /* @__PURE__ */ o("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
484
|
-
/* @__PURE__ */ e("div", { className: "nramp-spinner" }),
|
|
485
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
|
|
486
|
-
] }),
|
|
487
|
-
/* @__PURE__ */ e(
|
|
488
|
-
"iframe",
|
|
489
|
-
{
|
|
490
|
-
src: h,
|
|
491
|
-
style: {
|
|
492
|
-
display: c ? "block" : "none",
|
|
493
|
-
width: "100%",
|
|
494
|
-
height: "100%",
|
|
495
|
-
border: "none"
|
|
496
|
-
},
|
|
497
|
-
allow: "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
|
|
498
|
-
onLoad: () => i(!0),
|
|
499
|
-
title: "Payment Checkout"
|
|
500
|
-
}
|
|
501
|
-
)
|
|
502
|
-
] }) });
|
|
503
|
-
}
|
|
504
|
-
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-8 ${t}`, style: { color: "var(--t-text)" }, children: [
|
|
505
|
-
/* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "Unknown checkout method" }),
|
|
506
|
-
/* @__PURE__ */ e(
|
|
507
|
-
"button",
|
|
508
|
-
{
|
|
509
|
-
className: "font-semibold text-[14px] transition-all",
|
|
510
|
-
style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)", paddingLeft: 24, paddingRight: 24 },
|
|
511
|
-
onClick: m,
|
|
512
|
-
children: "Go Back"
|
|
513
|
-
}
|
|
514
|
-
)
|
|
515
|
-
] });
|
|
516
|
-
}
|
|
517
|
-
function Pt(t, a) {
|
|
518
|
-
const n = new URL("/en/partner/widget", t);
|
|
519
|
-
for (const [l, r] of Object.entries(a))
|
|
520
|
-
r != null && r !== "" && n.searchParams.set(l, String(r));
|
|
521
|
-
return n.toString();
|
|
522
|
-
}
|
|
523
|
-
function Ht({ className: t = "" }) {
|
|
524
|
-
const { orderStatus: a, orderStatusLoading: n, goToStep: l } = he();
|
|
525
|
-
H(() => {
|
|
526
|
-
a && (a.status === "completed" ? l("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && l("error"));
|
|
527
|
-
}, [a == null ? void 0 : a.status, l]);
|
|
528
|
-
const r = () => {
|
|
529
|
-
if (!a) return "Processing your order...";
|
|
530
|
-
switch (a.status) {
|
|
531
|
-
case "pending":
|
|
532
|
-
return "Waiting for payment confirmation...";
|
|
533
|
-
case "processing":
|
|
534
|
-
return "Processing your transaction...";
|
|
535
|
-
default:
|
|
536
|
-
return "Processing...";
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
|
|
540
|
-
/* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ e("div", { className: "nramp-spinner-large nramp-spinner" }) }),
|
|
541
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: r() }),
|
|
542
|
-
n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
|
|
543
|
-
a && /* @__PURE__ */ o("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
544
|
-
/* @__PURE__ */ e(me, { label: "Order ID", value: a.orderId, mono: !0 }),
|
|
545
|
-
/* @__PURE__ */ e(me, { label: "Provider", value: a.gateway }),
|
|
546
|
-
/* @__PURE__ */ e(
|
|
547
|
-
me,
|
|
548
|
-
{
|
|
549
|
-
label: "Amount",
|
|
550
|
-
value: `${a.fiatAmount} ${a.fiatCurrency}`
|
|
551
|
-
}
|
|
552
|
-
),
|
|
553
|
-
/* @__PURE__ */ e(
|
|
554
|
-
me,
|
|
555
|
-
{
|
|
556
|
-
label: "Receiving",
|
|
557
|
-
value: `${a.cryptoAmount || "..."} ${a.cryptoCurrency}`
|
|
558
|
-
}
|
|
559
|
-
),
|
|
560
|
-
/* @__PURE__ */ e(me, { label: "Network", value: a.network }),
|
|
561
|
-
/* @__PURE__ */ e(
|
|
562
|
-
me,
|
|
563
|
-
{
|
|
564
|
-
label: "To Address",
|
|
565
|
-
value: `${a.walletAddress.slice(0, 10)}...${a.walletAddress.slice(-8)}`,
|
|
566
|
-
mono: !0
|
|
567
|
-
}
|
|
568
|
-
)
|
|
569
|
-
] }),
|
|
570
|
-
/* @__PURE__ */ o("div", { className: "mt-6", children: [
|
|
571
|
-
/* @__PURE__ */ e("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "This usually takes a few minutes." }),
|
|
572
|
-
/* @__PURE__ */ e("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: "You can safely close this page - we'll send you an email when complete." })
|
|
573
|
-
] })
|
|
574
|
-
] });
|
|
575
|
-
}
|
|
576
|
-
function me({ label: t, value: a, mono: n }) {
|
|
577
|
-
return /* @__PURE__ */ o(
|
|
578
|
-
"div",
|
|
579
|
-
{
|
|
580
|
-
className: "flex justify-between items-center py-2",
|
|
581
|
-
style: { borderBottom: "1px solid var(--t-divider)" },
|
|
582
|
-
children: [
|
|
583
|
-
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
|
|
584
|
-
/* @__PURE__ */ e(
|
|
585
|
-
"span",
|
|
586
|
-
{
|
|
587
|
-
className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
|
|
588
|
-
style: { color: "var(--t-text)" },
|
|
589
|
-
children: a
|
|
590
|
-
}
|
|
591
|
-
)
|
|
592
|
-
]
|
|
593
|
-
}
|
|
594
|
-
);
|
|
595
|
-
}
|
|
596
|
-
function Ut({
|
|
597
|
-
className: t = "",
|
|
598
|
-
explorerUrl: a,
|
|
599
|
-
onDone: n,
|
|
600
|
-
doneButtonText: l = "Done"
|
|
601
|
-
}) {
|
|
602
|
-
const { orderStatus: r, state: d, dispatch: u } = he(), m = d.flowType === "sell", c = () => {
|
|
603
|
-
if (!(r != null && r.transactionHash)) return null;
|
|
604
|
-
if (!a) {
|
|
605
|
-
const f = {
|
|
606
|
-
ethereum: "https://etherscan.io/tx/{txHash}",
|
|
607
|
-
polygon: "https://polygonscan.com/tx/{txHash}",
|
|
608
|
-
arbitrum: "https://arbiscan.io/tx/{txHash}",
|
|
609
|
-
optimism: "https://optimistic.etherscan.io/tx/{txHash}",
|
|
610
|
-
base: "https://basescan.org/tx/{txHash}",
|
|
611
|
-
bitcoin: "https://mempool.space/tx/{txHash}",
|
|
612
|
-
solana: "https://solscan.io/tx/{txHash}",
|
|
613
|
-
avalanche: "https://snowtrace.io/tx/{txHash}",
|
|
614
|
-
fantom: "https://ftmscan.com/tx/{txHash}"
|
|
615
|
-
};
|
|
616
|
-
return (f[d.network] || f.ethereum).replace("{txHash}", r.transactionHash);
|
|
617
|
-
}
|
|
618
|
-
return a.replace("{txHash}", r.transactionHash);
|
|
619
|
-
}, i = () => {
|
|
620
|
-
n ? n() : u({ type: "RESET" });
|
|
621
|
-
}, p = c();
|
|
622
|
-
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
|
|
623
|
-
/* @__PURE__ */ e(
|
|
624
|
-
"div",
|
|
625
|
-
{
|
|
626
|
-
className: "flex items-center justify-center mb-5",
|
|
627
|
-
style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-success, #10b981)" },
|
|
628
|
-
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" }) })
|
|
629
|
-
}
|
|
630
|
-
),
|
|
631
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: m ? "Sale Complete!" : "Purchase Complete!" }),
|
|
632
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: m ? `Your ${(r == null ? void 0 : r.fiatCurrency) || d.fiatCurrency} payout is being processed.` : `Your ${(r == null ? void 0 : r.cryptoCurrency) || d.cryptoCurrency} has been sent to your wallet.` }),
|
|
633
|
-
r && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
634
|
-
/* @__PURE__ */ e(
|
|
635
|
-
q,
|
|
636
|
-
{
|
|
637
|
-
label: m ? "Amount Sold" : "Amount Received",
|
|
638
|
-
value: `${r.cryptoAmount} ${r.cryptoCurrency}`,
|
|
639
|
-
highlight: !0
|
|
640
|
-
}
|
|
641
|
-
),
|
|
642
|
-
/* @__PURE__ */ e(
|
|
643
|
-
q,
|
|
644
|
-
{
|
|
645
|
-
label: m ? "Payout Amount" : "Amount Paid",
|
|
646
|
-
value: `${r.fiatAmount} ${r.fiatCurrency}`
|
|
647
|
-
}
|
|
648
|
-
),
|
|
649
|
-
/* @__PURE__ */ e(q, { label: "Network", value: r.network }),
|
|
650
|
-
/* @__PURE__ */ e(
|
|
651
|
-
q,
|
|
652
|
-
{
|
|
653
|
-
label: "Wallet",
|
|
654
|
-
value: `${r.walletAddress.slice(0, 10)}...${r.walletAddress.slice(-8)}`,
|
|
655
|
-
mono: !0
|
|
656
|
-
}
|
|
657
|
-
),
|
|
658
|
-
r.transactionHash && /* @__PURE__ */ e(
|
|
659
|
-
q,
|
|
660
|
-
{
|
|
661
|
-
label: "Transaction",
|
|
662
|
-
value: `${r.transactionHash.slice(0, 10)}...${r.transactionHash.slice(-8)}`,
|
|
663
|
-
mono: !0
|
|
664
|
-
}
|
|
665
|
-
),
|
|
666
|
-
/* @__PURE__ */ e(q, { label: "Provider", value: r.gateway }),
|
|
667
|
-
/* @__PURE__ */ e(q, { label: "Order ID", value: r.orderId, mono: !0 }),
|
|
668
|
-
r.completedAt && /* @__PURE__ */ e(
|
|
669
|
-
q,
|
|
670
|
-
{
|
|
671
|
-
label: "Completed",
|
|
672
|
-
value: new Date(r.completedAt).toLocaleString()
|
|
673
|
-
}
|
|
674
|
-
)
|
|
675
|
-
] }),
|
|
676
|
-
/* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
|
|
677
|
-
p && /* @__PURE__ */ e(
|
|
678
|
-
"a",
|
|
679
|
-
{
|
|
680
|
-
href: p,
|
|
681
|
-
target: "_blank",
|
|
682
|
-
rel: "noopener noreferrer",
|
|
683
|
-
className: "w-full font-semibold text-[14px] flex items-center justify-center transition-all",
|
|
684
|
-
style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)", textDecoration: "none" },
|
|
685
|
-
children: "View on Explorer"
|
|
686
|
-
}
|
|
687
|
-
),
|
|
688
|
-
/* @__PURE__ */ e(
|
|
689
|
-
"button",
|
|
690
|
-
{
|
|
691
|
-
className: "w-full font-semibold text-[16px] transition-all",
|
|
692
|
-
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
|
|
693
|
-
onClick: i,
|
|
694
|
-
children: l
|
|
695
|
-
}
|
|
696
|
-
)
|
|
697
|
-
] })
|
|
698
|
-
] });
|
|
699
|
-
}
|
|
700
|
-
function q({ label: t, value: a, mono: n, highlight: l }) {
|
|
701
|
-
return /* @__PURE__ */ o(
|
|
702
|
-
"div",
|
|
703
|
-
{
|
|
704
|
-
className: "flex justify-between items-center py-2",
|
|
705
|
-
style: { borderBottom: "1px solid var(--t-divider)" },
|
|
706
|
-
children: [
|
|
707
|
-
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
|
|
708
|
-
/* @__PURE__ */ e(
|
|
709
|
-
"span",
|
|
710
|
-
{
|
|
711
|
-
className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
|
|
712
|
-
style: { color: l ? "var(--t-success, #10b981)" : "var(--t-text)" },
|
|
713
|
-
children: a
|
|
714
|
-
}
|
|
715
|
-
)
|
|
716
|
-
]
|
|
717
|
-
}
|
|
718
|
-
);
|
|
719
|
-
}
|
|
720
|
-
function Dt({
|
|
721
|
-
className: t = "",
|
|
722
|
-
onRetry: a,
|
|
723
|
-
supportEmail: n = "support@nowramp.com"
|
|
724
|
-
}) {
|
|
725
|
-
const { state: l, orderStatus: r, dispatch: d, goToStep: u } = he(), m = l.flowType === "sell", c = () => {
|
|
726
|
-
if (r)
|
|
727
|
-
switch (r.status) {
|
|
728
|
-
case "failed":
|
|
729
|
-
return "Payment Failed";
|
|
730
|
-
case "cancelled":
|
|
731
|
-
return "Order Cancelled";
|
|
732
|
-
case "expired":
|
|
733
|
-
return "Order Expired";
|
|
734
|
-
case "refunded":
|
|
735
|
-
return "Order Refunded";
|
|
736
|
-
default:
|
|
737
|
-
return "Something Went Wrong";
|
|
738
|
-
}
|
|
739
|
-
return "Something Went Wrong";
|
|
740
|
-
}, i = () => {
|
|
741
|
-
if (l.errorMessage) return l.errorMessage;
|
|
742
|
-
if (r)
|
|
743
|
-
switch (r.status) {
|
|
744
|
-
case "failed":
|
|
745
|
-
return m ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
|
|
746
|
-
case "cancelled":
|
|
747
|
-
return m ? "Your sale was cancelled. No crypto was transferred." : "Your order was cancelled. No payment was processed.";
|
|
748
|
-
case "expired":
|
|
749
|
-
return m ? "Your order has expired. Please start a new sale." : "Your order has expired. Please start a new purchase.";
|
|
750
|
-
case "refunded":
|
|
751
|
-
return m ? "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.";
|
|
752
|
-
default:
|
|
753
|
-
return "An unexpected error occurred. Please try again.";
|
|
754
|
-
}
|
|
755
|
-
return "An unexpected error occurred. Please try again.";
|
|
756
|
-
}, p = () => {
|
|
757
|
-
d({ type: "CLEAR_ERROR" }), a ? a() : (d({ type: "RESET" }), u("amount"));
|
|
758
|
-
}, f = () => {
|
|
759
|
-
d({ type: "RESET" }), u("amount");
|
|
760
|
-
};
|
|
761
|
-
return /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
|
|
762
|
-
/* @__PURE__ */ e(
|
|
763
|
-
"div",
|
|
764
|
-
{
|
|
765
|
-
className: "flex items-center justify-center mb-5",
|
|
766
|
-
style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-error, #EF4444)" },
|
|
767
|
-
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" }) })
|
|
768
|
-
}
|
|
769
|
-
),
|
|
770
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: c() }),
|
|
771
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: i() }),
|
|
772
|
-
r && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
773
|
-
/* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
774
|
-
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
|
|
775
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: r.orderId })
|
|
776
|
-
] }),
|
|
777
|
-
/* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", children: [
|
|
778
|
-
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Status" }),
|
|
779
|
-
/* @__PURE__ */ e(
|
|
780
|
-
"span",
|
|
781
|
-
{
|
|
782
|
-
className: "text-[12px] font-medium px-2 py-0.5",
|
|
783
|
-
style: { background: "rgba(239,68,68,0.15)", color: "#EF4444", borderRadius: 4 },
|
|
784
|
-
children: r.gatewayStatus
|
|
785
|
-
}
|
|
786
|
-
)
|
|
787
|
-
] })
|
|
788
|
-
] }),
|
|
789
|
-
/* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
|
|
790
|
-
/* @__PURE__ */ e(
|
|
791
|
-
"button",
|
|
792
|
-
{
|
|
793
|
-
className: "w-full font-semibold text-[16px] transition-all",
|
|
794
|
-
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
|
|
795
|
-
onClick: p,
|
|
796
|
-
children: "Try Again"
|
|
797
|
-
}
|
|
798
|
-
),
|
|
799
|
-
/* @__PURE__ */ e(
|
|
800
|
-
"button",
|
|
801
|
-
{
|
|
802
|
-
className: "w-full font-semibold text-[14px] transition-all",
|
|
803
|
-
style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)" },
|
|
804
|
-
onClick: f,
|
|
805
|
-
children: "Start Over"
|
|
806
|
-
}
|
|
807
|
-
)
|
|
808
|
-
] }),
|
|
809
|
-
/* @__PURE__ */ o("div", { className: "mt-6", children: [
|
|
810
|
-
/* @__PURE__ */ o("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: [
|
|
811
|
-
"Need help? Contact",
|
|
812
|
-
" ",
|
|
813
|
-
/* @__PURE__ */ e(
|
|
814
|
-
"a",
|
|
815
|
-
{
|
|
816
|
-
href: `mailto:${n}`,
|
|
817
|
-
className: "underline",
|
|
818
|
-
style: { color: "var(--t-accent)" },
|
|
819
|
-
children: n
|
|
820
|
-
}
|
|
821
|
-
)
|
|
822
|
-
] }),
|
|
823
|
-
r && /* @__PURE__ */ o("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
|
|
824
|
-
"Reference: ",
|
|
825
|
-
r.orderId
|
|
826
|
-
] })
|
|
827
|
-
] })
|
|
828
|
-
] });
|
|
829
|
-
}
|
|
830
|
-
function ot(t) {
|
|
831
|
-
return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
|
|
832
|
-
}
|
|
833
|
-
function Ft({ className: t = "" }) {
|
|
834
|
-
const {
|
|
835
|
-
config: a,
|
|
836
|
-
configLoading: n,
|
|
837
|
-
state: l,
|
|
838
|
-
defaultGateway: r,
|
|
839
|
-
fetchQuotes: d,
|
|
840
|
-
createOrder: u,
|
|
841
|
-
orderLoading: m
|
|
842
|
-
} = he(), c = l.flowType === "sell", [i, p] = C(null), f = a == null ? void 0 : a.gateways.find((g) => g.id === r), x = async () => {
|
|
843
|
-
p(null);
|
|
844
|
-
try {
|
|
845
|
-
d(), await u();
|
|
846
|
-
} catch (g) {
|
|
847
|
-
const h = g instanceof Error ? g.message : "Failed to create order";
|
|
848
|
-
p(h);
|
|
849
|
-
}
|
|
850
|
-
};
|
|
851
|
-
return n ? /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
|
|
852
|
-
/* @__PURE__ */ e("div", { className: "nramp-spinner" }),
|
|
853
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
|
|
854
|
-
] }) : /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
|
|
855
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: c ? "Confirm Sale" : "Confirm Purchase" }),
|
|
856
|
-
/* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
857
|
-
f && /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
858
|
-
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Provider" }),
|
|
859
|
-
/* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
|
|
860
|
-
f.logo && /* @__PURE__ */ e("img", { src: f.logo, alt: f.name, width: 20, height: 20, style: { borderRadius: 4 } }),
|
|
861
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: f.name })
|
|
862
|
-
] })
|
|
863
|
-
] }),
|
|
864
|
-
c ? /* @__PURE__ */ o(le, { children: [
|
|
865
|
-
/* @__PURE__ */ e(oe, { label: "You sell", value: `${l.cryptoAmount} ${l.cryptoCurrency}`, highlight: !0 }),
|
|
866
|
-
/* @__PURE__ */ e(oe, { label: "You receive", value: `${l.fiatCurrency} payout` })
|
|
867
|
-
] }) : /* @__PURE__ */ o(le, { children: [
|
|
868
|
-
/* @__PURE__ */ e(oe, { label: "You pay", value: `${l.fiatAmount} ${l.fiatCurrency}`, highlight: !0 }),
|
|
869
|
-
/* @__PURE__ */ e(oe, { label: "You receive", value: `${l.cryptoCurrency} on ${l.network}` }),
|
|
870
|
-
/* @__PURE__ */ e(oe, { label: "Wallet", value: ot(l.walletAddress), mono: !0 })
|
|
871
|
-
] }),
|
|
872
|
-
/* @__PURE__ */ e(oe, { label: "Network", value: l.network }),
|
|
873
|
-
c && l.walletAddress && /* @__PURE__ */ e(oe, { label: "Refund address", value: ot(l.walletAddress), mono: !0 })
|
|
874
|
-
] }),
|
|
875
|
-
i && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: i }),
|
|
876
|
-
/* @__PURE__ */ e(
|
|
877
|
-
"button",
|
|
878
|
-
{
|
|
879
|
-
className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
|
|
880
|
-
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: m ? 0.7 : 1 },
|
|
881
|
-
disabled: m,
|
|
882
|
-
onClick: x,
|
|
883
|
-
children: m ? /* @__PURE__ */ o(le, { children: [
|
|
884
|
-
/* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
|
|
885
|
-
"Processing..."
|
|
886
|
-
] }) : c ? "Confirm & Sell" : "Confirm & Pay"
|
|
887
|
-
}
|
|
888
|
-
)
|
|
889
|
-
] });
|
|
890
|
-
}
|
|
891
|
-
function oe({ label: t, value: a, mono: n, highlight: l }) {
|
|
892
|
-
return /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
893
|
-
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
|
|
894
|
-
/* @__PURE__ */ e(
|
|
895
|
-
"span",
|
|
896
|
-
{
|
|
897
|
-
className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
|
|
898
|
-
style: { color: l ? "var(--t-success, #10b981)" : "var(--t-text)" },
|
|
899
|
-
children: a
|
|
900
|
-
}
|
|
901
|
-
)
|
|
902
|
-
] });
|
|
903
|
-
}
|
|
904
|
-
function De({
|
|
905
|
-
isOpen: t,
|
|
906
|
-
onClose: a,
|
|
907
|
-
children: n
|
|
908
|
-
}) {
|
|
909
|
-
const [l, r] = C(!1), [d, u] = C(!1);
|
|
910
|
-
H(() => {
|
|
911
|
-
if (t)
|
|
912
|
-
r(!0), requestAnimationFrame(() => requestAnimationFrame(() => u(!0)));
|
|
913
|
-
else if (l) {
|
|
914
|
-
u(!1);
|
|
915
|
-
const c = setTimeout(() => r(!1), 250);
|
|
916
|
-
return () => clearTimeout(c);
|
|
917
|
-
}
|
|
918
|
-
}, [t]);
|
|
919
|
-
const m = $(() => {
|
|
920
|
-
u(!1), setTimeout(() => a(), 250);
|
|
921
|
-
}, [a]);
|
|
922
|
-
return l ? /* @__PURE__ */ e(
|
|
923
|
-
"div",
|
|
924
|
-
{
|
|
925
|
-
className: "absolute inset-0 z-20 transition-opacity duration-250",
|
|
926
|
-
style: { opacity: d ? 1 : 0 },
|
|
927
|
-
children: /* @__PURE__ */ e(
|
|
928
|
-
"div",
|
|
929
|
-
{
|
|
930
|
-
className: "absolute inset-0 flex flex-col transition-transform duration-250 ease-out",
|
|
931
|
-
style: { background: "var(--t-modal-bg)", transform: d ? "translateY(0)" : "translateY(24px)" },
|
|
932
|
-
children: typeof n == "function" ? n(m) : n
|
|
933
|
-
}
|
|
934
|
-
)
|
|
935
|
-
}
|
|
936
|
-
) : null;
|
|
937
|
-
}
|
|
938
|
-
function Kt({ char: t, height: a = 38 }) {
|
|
939
|
-
const n = "0123456789", l = n.indexOf(t);
|
|
940
|
-
return l === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: a, lineHeight: `${a}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${l * a}px)` }, children: n.split("").map((r) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: r }, r)) }) });
|
|
941
|
-
}
|
|
942
|
-
function _t({
|
|
943
|
-
value: t,
|
|
944
|
-
height: a = 38,
|
|
945
|
-
className: n = "",
|
|
946
|
-
style: l = {}
|
|
947
|
-
}) {
|
|
948
|
-
return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...l }, children: t.split("").map((r, d) => /* @__PURE__ */ e(Kt, { char: r, height: a }, d)) });
|
|
949
|
-
}
|
|
950
|
-
function B({
|
|
951
|
-
w: t,
|
|
952
|
-
h: a,
|
|
953
|
-
className: n = ""
|
|
954
|
-
}) {
|
|
955
|
-
return /* @__PURE__ */ e("div", { className: `skeleton ${n}`, style: { width: t, height: a } });
|
|
956
|
-
}
|
|
957
|
-
function Xt() {
|
|
958
|
-
return /* @__PURE__ */ o("div", { className: "flex-1 px-5 flex flex-col", children: [
|
|
959
|
-
/* @__PURE__ */ o("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
|
|
960
|
-
/* @__PURE__ */ e(B, { w: 70, h: 14, className: "mb-3" }),
|
|
961
|
-
/* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
|
|
962
|
-
/* @__PURE__ */ e(B, { w: 120, h: 32 }),
|
|
963
|
-
/* @__PURE__ */ e(B, { w: 75, h: 32 })
|
|
964
|
-
] })
|
|
965
|
-
] }),
|
|
966
|
-
/* @__PURE__ */ o("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
|
|
967
|
-
/* @__PURE__ */ e(B, { w: 50, h: 14, className: "mb-3" }),
|
|
968
|
-
/* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
|
|
969
|
-
/* @__PURE__ */ e(B, { w: 180, h: 32 }),
|
|
970
|
-
/* @__PURE__ */ e(B, { w: 85, h: 32 })
|
|
971
|
-
] })
|
|
972
|
-
] }),
|
|
973
|
-
/* @__PURE__ */ o("div", { className: "flex justify-between mt-3 px-[2px]", children: [
|
|
974
|
-
/* @__PURE__ */ e(B, { w: 140, h: 12 }),
|
|
975
|
-
/* @__PURE__ */ e(B, { w: 90, h: 12 })
|
|
976
|
-
] }),
|
|
977
|
-
/* @__PURE__ */ o("div", { className: "mt-8", children: [
|
|
978
|
-
/* @__PURE__ */ e(B, { w: 65, h: 14, className: "mb-2.5" }),
|
|
979
|
-
/* @__PURE__ */ e(B, { w: "100%", h: 47 })
|
|
980
|
-
] }),
|
|
981
|
-
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
982
|
-
/* @__PURE__ */ e(B, { w: "100%", h: 60, className: "mb-2" }),
|
|
983
|
-
/* @__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" }) })
|
|
984
|
-
] });
|
|
985
|
-
}
|
|
986
|
-
const Re = {
|
|
381
|
+
const Ie = {
|
|
987
382
|
ETH: { name: "Ethereum (ERC20)", shortName: "Ethereum", icon: "eth" },
|
|
988
383
|
BSC: { name: "Binance Smart Chain (BEP20)", shortName: "Binance", icon: "bnb" },
|
|
989
384
|
BTC: { name: "Bitcoin", icon: "btc" },
|
|
@@ -1117,7 +512,7 @@ const Re = {
|
|
|
1117
512
|
OKC: { name: "OKX Chain", icon: "eth" },
|
|
1118
513
|
UNI_CHAIN: { name: "UNI", icon: "uni" },
|
|
1119
514
|
ZEC: { name: "ZCash", icon: "zec" }
|
|
1120
|
-
},
|
|
515
|
+
}, Ut = [
|
|
1121
516
|
// --- Popular / Top coins ---
|
|
1122
517
|
{ code: "BTC", name: "Bitcoin", chains: ["BTC", "LN"], popular: !0 },
|
|
1123
518
|
{ code: "ETH", name: "Ethereum", chains: ["ETH", "ARB", "BASE", "BSC", "OPTIMISM", "LINEA", "ZKSYNC", "LRC", "STARK", "APE", "ECLIPSE", "FUEL", "INK", "SOPHON", "UNICHAIN", "WLD"], popular: !0 },
|
|
@@ -1310,7 +705,7 @@ const Re = {
|
|
|
1310
705
|
{ code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
|
|
1311
706
|
{ code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
|
|
1312
707
|
{ code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
|
|
1313
|
-
],
|
|
708
|
+
], Dt = {
|
|
1314
709
|
USD: "us",
|
|
1315
710
|
EUR: "eu",
|
|
1316
711
|
GBP: "gb",
|
|
@@ -1324,18 +719,18 @@ const Re = {
|
|
|
1324
719
|
ARS: "ar",
|
|
1325
720
|
ALL: "al"
|
|
1326
721
|
};
|
|
1327
|
-
function
|
|
722
|
+
function yt(t, a = "") {
|
|
1328
723
|
return `${a}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
1329
724
|
}
|
|
1330
|
-
function
|
|
1331
|
-
const n =
|
|
725
|
+
function Ft(t, a = "") {
|
|
726
|
+
const n = Dt[t] || "us";
|
|
1332
727
|
return `${a}/flags/${n}.svg`;
|
|
1333
728
|
}
|
|
1334
|
-
function
|
|
1335
|
-
const n =
|
|
729
|
+
function _e(t, a = "") {
|
|
730
|
+
const n = Ie[t];
|
|
1336
731
|
return n ? `${a}/crypto-icons/${n.icon}.svg` : `${a}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
1337
732
|
}
|
|
1338
|
-
const
|
|
733
|
+
const st = [
|
|
1339
734
|
{ code: "ALL", name: "Albania Lek" },
|
|
1340
735
|
{ code: "ARS", name: "Argentina Peso" },
|
|
1341
736
|
{ code: "AUD", name: "Australian Dollar" },
|
|
@@ -1355,7 +750,7 @@ const lt = [
|
|
|
1355
750
|
{ id: "orange", name: "Orange", accent: "#F59E0B" },
|
|
1356
751
|
{ id: "rose", name: "Rose", accent: "#F43F5E" },
|
|
1357
752
|
{ id: "mono", name: "Mono", accent: null }
|
|
1358
|
-
],
|
|
753
|
+
], it = {
|
|
1359
754
|
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 },
|
|
1360
755
|
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 },
|
|
1361
756
|
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 },
|
|
@@ -1365,14 +760,14 @@ const lt = [
|
|
|
1365
760
|
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 },
|
|
1366
761
|
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 }
|
|
1367
762
|
};
|
|
1368
|
-
function
|
|
1369
|
-
var n,
|
|
1370
|
-
return ((n =
|
|
763
|
+
function Aa(t, a) {
|
|
764
|
+
var n, s;
|
|
765
|
+
return ((n = it[t]) == null ? void 0 : n[a]) ?? ((s = it.USDC) == null ? void 0 : s[a]) ?? 1;
|
|
1371
766
|
}
|
|
1372
|
-
function
|
|
767
|
+
function Kt(t) {
|
|
1373
768
|
return parseFloat(t.replace(/,/g, "")) || 0;
|
|
1374
769
|
}
|
|
1375
|
-
function
|
|
770
|
+
function wa(t) {
|
|
1376
771
|
if (t === 0) return "0";
|
|
1377
772
|
if (t >= 1e3) return t.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
1378
773
|
if (t >= 1) return t.toFixed(2);
|
|
@@ -1380,18 +775,18 @@ function ga(t) {
|
|
|
1380
775
|
const a = t.toPrecision(4);
|
|
1381
776
|
return parseFloat(a).toString();
|
|
1382
777
|
}
|
|
1383
|
-
const
|
|
778
|
+
const Ke = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), dt = 10, ut = 1e-4, _t = (() => {
|
|
1384
779
|
const t = [];
|
|
1385
|
-
for (const a of
|
|
780
|
+
for (const a of Ut)
|
|
1386
781
|
for (const n of a.chains)
|
|
1387
782
|
t.push({ code: a.code, name: a.name, chain: n, popular: a.popular });
|
|
1388
783
|
return t;
|
|
1389
784
|
})();
|
|
1390
|
-
function
|
|
785
|
+
function mt({ ticker: t, size: a = 32, baseUrl: n = "" }) {
|
|
1391
786
|
return /* @__PURE__ */ e(
|
|
1392
787
|
"img",
|
|
1393
788
|
{
|
|
1394
|
-
src:
|
|
789
|
+
src: yt(t, n),
|
|
1395
790
|
alt: t,
|
|
1396
791
|
width: a,
|
|
1397
792
|
height: a,
|
|
@@ -1400,11 +795,11 @@ function ut({ ticker: t, size: a = 32, baseUrl: n = "" }) {
|
|
|
1400
795
|
}
|
|
1401
796
|
);
|
|
1402
797
|
}
|
|
1403
|
-
function
|
|
798
|
+
function Xe({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
|
|
1404
799
|
return /* @__PURE__ */ e(
|
|
1405
800
|
"img",
|
|
1406
801
|
{
|
|
1407
|
-
src:
|
|
802
|
+
src: Ft(t, n),
|
|
1408
803
|
alt: t,
|
|
1409
804
|
width: a,
|
|
1410
805
|
height: a,
|
|
@@ -1413,14 +808,14 @@ function _e({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
|
|
|
1413
808
|
}
|
|
1414
809
|
);
|
|
1415
810
|
}
|
|
1416
|
-
function
|
|
1417
|
-
return /* @__PURE__ */
|
|
811
|
+
function $e({ size: t = 32, color: a = "#888" }) {
|
|
812
|
+
return /* @__PURE__ */ l("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
|
|
1418
813
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: a }),
|
|
1419
814
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "8", stroke: "white", strokeWidth: "1.5", fill: "none" })
|
|
1420
815
|
] });
|
|
1421
816
|
}
|
|
1422
|
-
function
|
|
1423
|
-
return /* @__PURE__ */
|
|
817
|
+
function Xt({ size: t = 24 }) {
|
|
818
|
+
return /* @__PURE__ */ l("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
|
|
1424
819
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: "#0077FF" }),
|
|
1425
820
|
/* @__PURE__ */ e("path", { d: "M8 15l8-6 8 6H8z", fill: "white" }),
|
|
1426
821
|
/* @__PURE__ */ e("rect", { x: "10", y: "16", width: "2", height: "6", fill: "white" }),
|
|
@@ -1429,7 +824,7 @@ function jt({ size: t = 24 }) {
|
|
|
1429
824
|
/* @__PURE__ */ e("rect", { x: "8", y: "22", width: "16", height: "2", rx: "0.5", fill: "white" })
|
|
1430
825
|
] });
|
|
1431
826
|
}
|
|
1432
|
-
function
|
|
827
|
+
function $t({ size: t = 32 }) {
|
|
1433
828
|
return /* @__PURE__ */ e(
|
|
1434
829
|
"div",
|
|
1435
830
|
{
|
|
@@ -1439,7 +834,7 @@ function Qt({ size: t = 32 }) {
|
|
|
1439
834
|
}
|
|
1440
835
|
);
|
|
1441
836
|
}
|
|
1442
|
-
function
|
|
837
|
+
function Gt({ size: t = 32 }) {
|
|
1443
838
|
return /* @__PURE__ */ e(
|
|
1444
839
|
"div",
|
|
1445
840
|
{
|
|
@@ -1449,156 +844,985 @@ function Zt({ size: t = 32 }) {
|
|
|
1449
844
|
}
|
|
1450
845
|
);
|
|
1451
846
|
}
|
|
1452
|
-
function
|
|
1453
|
-
return /* @__PURE__ */
|
|
847
|
+
function jt({ size: t = 32 }) {
|
|
848
|
+
return /* @__PURE__ */ l(
|
|
849
|
+
"div",
|
|
850
|
+
{
|
|
851
|
+
className: "rounded-full bg-white flex items-center justify-center shrink-0",
|
|
852
|
+
style: { width: t, height: t, fontSize: t * 0.28, fontWeight: 700, color: "#333" },
|
|
853
|
+
children: [
|
|
854
|
+
"G",
|
|
855
|
+
/* @__PURE__ */ e("span", { style: { color: "#4285F4", fontSize: t * 0.2 }, children: "Pay" })
|
|
856
|
+
]
|
|
857
|
+
}
|
|
858
|
+
);
|
|
859
|
+
}
|
|
860
|
+
function Yt({ size: t = 32 }) {
|
|
861
|
+
return /* @__PURE__ */ e(
|
|
862
|
+
"div",
|
|
863
|
+
{
|
|
864
|
+
className: "rounded-full flex items-center justify-center shrink-0",
|
|
865
|
+
style: { width: t, height: t, background: "#003087" },
|
|
866
|
+
children: /* @__PURE__ */ e("span", { className: "text-white font-bold", style: { fontSize: t * 0.38 }, children: "P" })
|
|
867
|
+
}
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
function Vt({ size: t = 32 }) {
|
|
871
|
+
return /* @__PURE__ */ e(
|
|
872
|
+
"div",
|
|
873
|
+
{
|
|
874
|
+
className: "rounded-full flex items-center justify-center shrink-0",
|
|
875
|
+
style: { width: t, height: t, background: "var(--t-card-icon-bg)" },
|
|
876
|
+
children: /* @__PURE__ */ l("svg", { width: t * 0.55, height: t * 0.55, viewBox: "0 0 18 14", fill: "none", children: [
|
|
877
|
+
/* @__PURE__ */ e("rect", { x: "0.5", y: "0.5", width: "17", height: "13", rx: "2", stroke: "var(--t-card-icon-stroke)" }),
|
|
878
|
+
/* @__PURE__ */ e("rect", { y: "3", width: "18", height: "3", fill: "var(--t-card-icon-stroke)" })
|
|
879
|
+
] })
|
|
880
|
+
}
|
|
881
|
+
);
|
|
882
|
+
}
|
|
883
|
+
function Sa({ size: t = 18 }) {
|
|
884
|
+
return /* @__PURE__ */ e(
|
|
885
|
+
"div",
|
|
886
|
+
{
|
|
887
|
+
className: "rounded-full bg-white flex items-center justify-center shrink-0",
|
|
888
|
+
style: { width: t, height: t },
|
|
889
|
+
children: /* @__PURE__ */ e("span", { className: "text-black font-bold", style: { fontSize: t * 0.55 }, children: "C" })
|
|
890
|
+
}
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
function ge() {
|
|
894
|
+
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" }) });
|
|
895
|
+
}
|
|
896
|
+
function Wt() {
|
|
897
|
+
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" }) });
|
|
898
|
+
}
|
|
899
|
+
function Qt({ onClick: t }) {
|
|
900
|
+
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(
|
|
901
|
+
"path",
|
|
902
|
+
{
|
|
903
|
+
d: "M4 0.799805H20C21.7673 0.799805 23.2002 2.23269 23.2002 4V12C23.2002 13.7673 21.7673 15.2002 20 15.2002H4C2.23269 15.2002 0.799805 13.7673 0.799805 12V4C0.799805 2.23269 2.23269 0.799805 4 0.799805Z",
|
|
904
|
+
stroke: "var(--t-icon-stroke)",
|
|
905
|
+
strokeWidth: "1.6"
|
|
906
|
+
}
|
|
907
|
+
) }) });
|
|
908
|
+
}
|
|
909
|
+
function Zt({ size: t = 40 }) {
|
|
910
|
+
return /* @__PURE__ */ e(
|
|
911
|
+
"div",
|
|
912
|
+
{
|
|
913
|
+
className: "rounded-full flex items-center justify-center shrink-0",
|
|
914
|
+
style: { width: t, height: t, background: "var(--t-surface)" },
|
|
915
|
+
children: /* @__PURE__ */ l("svg", { width: t * 0.5, height: t * 0.5, viewBox: "0 0 20 20", fill: "none", children: [
|
|
916
|
+
/* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "7.5", stroke: "var(--t-text)", strokeWidth: "1.5" }),
|
|
917
|
+
/* @__PURE__ */ e("path", { d: "M10 2.5A7.5 7.5 0 0 1 10 17.5", fill: "var(--t-text)" })
|
|
918
|
+
] })
|
|
919
|
+
}
|
|
920
|
+
);
|
|
921
|
+
}
|
|
922
|
+
function Jt(t, a = 32) {
|
|
923
|
+
switch (t) {
|
|
924
|
+
case "revolut":
|
|
925
|
+
return /* @__PURE__ */ e($t, { size: a });
|
|
926
|
+
case "applepay":
|
|
927
|
+
return /* @__PURE__ */ e(Gt, { size: a });
|
|
928
|
+
case "card":
|
|
929
|
+
return /* @__PURE__ */ e(Vt, { size: a });
|
|
930
|
+
case "googlepay":
|
|
931
|
+
return /* @__PURE__ */ e(jt, { size: a });
|
|
932
|
+
case "paypal":
|
|
933
|
+
return /* @__PURE__ */ e(Yt, { size: a });
|
|
934
|
+
case "bank":
|
|
935
|
+
return /* @__PURE__ */ e(Xt, { size: a });
|
|
936
|
+
default:
|
|
937
|
+
return /* @__PURE__ */ e($e, { size: a });
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
function Le({
|
|
941
|
+
isOpen: t,
|
|
942
|
+
onClose: a,
|
|
943
|
+
children: n
|
|
944
|
+
}) {
|
|
945
|
+
const [s, r] = N(!1), [u, m] = N(!1);
|
|
946
|
+
U(() => {
|
|
947
|
+
if (t)
|
|
948
|
+
r(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
|
|
949
|
+
else if (s) {
|
|
950
|
+
m(!1);
|
|
951
|
+
const o = setTimeout(() => r(!1), 250);
|
|
952
|
+
return () => clearTimeout(o);
|
|
953
|
+
}
|
|
954
|
+
}, [t]);
|
|
955
|
+
const i = _(() => {
|
|
956
|
+
m(!1), setTimeout(() => a(), 250);
|
|
957
|
+
}, [a]);
|
|
958
|
+
return s ? /* @__PURE__ */ e(
|
|
959
|
+
"div",
|
|
960
|
+
{
|
|
961
|
+
className: "absolute inset-0 z-20 transition-opacity duration-250",
|
|
962
|
+
style: { opacity: u ? 1 : 0 },
|
|
963
|
+
children: /* @__PURE__ */ e(
|
|
964
|
+
"div",
|
|
965
|
+
{
|
|
966
|
+
className: "absolute inset-0 flex flex-col transition-transform duration-250 ease-out",
|
|
967
|
+
style: { background: "var(--t-modal-bg)", transform: u ? "translateY(0)" : "translateY(24px)" },
|
|
968
|
+
children: typeof n == "function" ? n(i) : n
|
|
969
|
+
}
|
|
970
|
+
)
|
|
971
|
+
}
|
|
972
|
+
) : null;
|
|
973
|
+
}
|
|
974
|
+
function ve({ onClick: t }) {
|
|
975
|
+
return /* @__PURE__ */ e(
|
|
976
|
+
"button",
|
|
977
|
+
{
|
|
978
|
+
onClick: t,
|
|
979
|
+
className: "flex items-center justify-center transition-colors rounded-full shrink-0",
|
|
980
|
+
style: { width: 30, height: 30, backgroundColor: "var(--t-close-bg)" },
|
|
981
|
+
onMouseEnter: (a) => a.currentTarget.style.backgroundColor = "var(--t-close-hover)",
|
|
982
|
+
onMouseLeave: (a) => a.currentTarget.style.backgroundColor = "var(--t-close-bg)",
|
|
983
|
+
children: /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L9 9M9 1L1 9", stroke: "var(--t-icon-close)", strokeWidth: "1.4", strokeLinecap: "round" }) })
|
|
984
|
+
}
|
|
985
|
+
);
|
|
986
|
+
}
|
|
987
|
+
function Be({
|
|
988
|
+
value: t,
|
|
989
|
+
onChange: a,
|
|
990
|
+
placeholder: n = ""
|
|
991
|
+
}) {
|
|
992
|
+
return /* @__PURE__ */ l("div", { className: "relative mx-5 mb-5", children: [
|
|
993
|
+
/* @__PURE__ */ e(
|
|
994
|
+
"input",
|
|
995
|
+
{
|
|
996
|
+
type: "text",
|
|
997
|
+
value: t,
|
|
998
|
+
onChange: (s) => a(s.target.value),
|
|
999
|
+
placeholder: n,
|
|
1000
|
+
style: { height: 47, borderRadius: 4.5, borderColor: "var(--t-border)", color: "var(--t-text)", paddingLeft: 14, paddingRight: t ? 40 : 14, fontSize: 14 },
|
|
1001
|
+
className: "w-full bg-transparent border outline-none transition-colors"
|
|
1002
|
+
}
|
|
1003
|
+
),
|
|
1004
|
+
t && /* @__PURE__ */ e(
|
|
1005
|
+
"button",
|
|
1006
|
+
{
|
|
1007
|
+
onClick: () => a(""),
|
|
1008
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center transition-colors rounded",
|
|
1009
|
+
style: { width: 22, height: 22, backgroundColor: "var(--t-close-bg)", borderRadius: 4 },
|
|
1010
|
+
children: /* @__PURE__ */ e("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L7 7M7 1L1 7", stroke: "var(--t-icon-close)", strokeWidth: "1.2", strokeLinecap: "round" }) })
|
|
1011
|
+
}
|
|
1012
|
+
)
|
|
1013
|
+
] });
|
|
1014
|
+
}
|
|
1015
|
+
function zt({
|
|
1016
|
+
methods: t,
|
|
1017
|
+
selectedId: a,
|
|
1018
|
+
onSelect: n,
|
|
1019
|
+
onClose: s
|
|
1020
|
+
}) {
|
|
1021
|
+
const [r, u] = N(""), m = F(() => {
|
|
1022
|
+
const i = r.trim().toLowerCase();
|
|
1023
|
+
return i ? t.filter(
|
|
1024
|
+
(o) => o.id.toLowerCase().includes(i) || o.name.toLowerCase().includes(i) || o.description && o.description.toLowerCase().includes(i)
|
|
1025
|
+
) : t;
|
|
1026
|
+
}, [t, r]);
|
|
1027
|
+
return /* @__PURE__ */ l(J, { children: [
|
|
1028
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: s }) }),
|
|
1029
|
+
/* @__PURE__ */ e(
|
|
1030
|
+
"h2",
|
|
1031
|
+
{
|
|
1032
|
+
className: "text-center text-[17px] font-medium mt-2 mb-6",
|
|
1033
|
+
style: { color: "var(--t-text)" },
|
|
1034
|
+
children: "Choose payment method"
|
|
1035
|
+
}
|
|
1036
|
+
),
|
|
1037
|
+
/* @__PURE__ */ e(Be, { value: r, onChange: u }),
|
|
1038
|
+
/* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
1039
|
+
m.map((i) => {
|
|
1040
|
+
const o = i.id === a;
|
|
1041
|
+
return /* @__PURE__ */ l(
|
|
1042
|
+
"button",
|
|
1043
|
+
{
|
|
1044
|
+
onClick: () => n(i.id),
|
|
1045
|
+
className: "flex items-center gap-4 w-full transition-colors",
|
|
1046
|
+
style: {
|
|
1047
|
+
color: "var(--t-text)",
|
|
1048
|
+
paddingTop: 18,
|
|
1049
|
+
paddingBottom: 18
|
|
1050
|
+
},
|
|
1051
|
+
children: [
|
|
1052
|
+
/* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", style: { width: 32, height: 32 }, children: xt(i.id, i.icon, 32) }),
|
|
1053
|
+
/* @__PURE__ */ e("span", { className: "text-left flex-1", children: /* @__PURE__ */ e(
|
|
1054
|
+
"span",
|
|
1055
|
+
{
|
|
1056
|
+
className: "font-semibold text-[15px] leading-tight",
|
|
1057
|
+
style: { color: o ? "var(--t-accent)" : "var(--t-text)" },
|
|
1058
|
+
children: i.name
|
|
1059
|
+
}
|
|
1060
|
+
) })
|
|
1061
|
+
]
|
|
1062
|
+
},
|
|
1063
|
+
i.id
|
|
1064
|
+
);
|
|
1065
|
+
}),
|
|
1066
|
+
m.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No payment methods found" })
|
|
1067
|
+
] })
|
|
1068
|
+
] });
|
|
1069
|
+
}
|
|
1070
|
+
const qt = {
|
|
1071
|
+
"debit-credit-card": "card",
|
|
1072
|
+
"bank-transfer": "bank",
|
|
1073
|
+
"apple-pay": "applepay",
|
|
1074
|
+
"google-pay": "googlepay",
|
|
1075
|
+
paypal: "paypal",
|
|
1076
|
+
revolut: "revolut"
|
|
1077
|
+
};
|
|
1078
|
+
function xt(t, a, n = 24) {
|
|
1079
|
+
const s = qt[t];
|
|
1080
|
+
return s ? Jt(s, n) : a ? /* @__PURE__ */ e("img", { src: a, alt: "", width: n, height: n, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e($e, { size: n });
|
|
1081
|
+
}
|
|
1082
|
+
function ea({
|
|
1083
|
+
methods: t,
|
|
1084
|
+
selectedId: a,
|
|
1085
|
+
onSelect: n,
|
|
1086
|
+
fiatCurrency: s
|
|
1087
|
+
}) {
|
|
1088
|
+
const [r, u] = N(!1), m = F(
|
|
1089
|
+
() => t.filter((o) => o.supportedFiats.includes(s)),
|
|
1090
|
+
[t, s]
|
|
1091
|
+
), i = m.find((o) => o.id === a) || m[0];
|
|
1092
|
+
return m.length === 0 ? /* @__PURE__ */ e(
|
|
1093
|
+
"div",
|
|
1094
|
+
{
|
|
1095
|
+
className: "flex items-center justify-between px-[18px] pt-[12px] pb-[14px]",
|
|
1096
|
+
style: {
|
|
1097
|
+
background: "var(--t-surface)",
|
|
1098
|
+
borderBottomLeftRadius: 5,
|
|
1099
|
+
borderBottomRightRadius: 5
|
|
1100
|
+
},
|
|
1101
|
+
children: /* @__PURE__ */ l("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: [
|
|
1102
|
+
"No payment methods available for ",
|
|
1103
|
+
s
|
|
1104
|
+
] })
|
|
1105
|
+
}
|
|
1106
|
+
) : /* @__PURE__ */ l(J, { children: [
|
|
1107
|
+
/* @__PURE__ */ l(
|
|
1108
|
+
"div",
|
|
1109
|
+
{
|
|
1110
|
+
role: "button",
|
|
1111
|
+
tabIndex: 0,
|
|
1112
|
+
onClick: () => u(!0),
|
|
1113
|
+
onKeyDown: (o) => {
|
|
1114
|
+
(o.key === "Enter" || o.key === " ") && u(!0);
|
|
1115
|
+
},
|
|
1116
|
+
className: "flex items-center justify-between w-full px-[18px] transition-colors",
|
|
1117
|
+
style: {
|
|
1118
|
+
background: "var(--t-surface)",
|
|
1119
|
+
borderBottomLeftRadius: 5,
|
|
1120
|
+
borderBottomRightRadius: 5,
|
|
1121
|
+
cursor: "pointer",
|
|
1122
|
+
height: 42
|
|
1123
|
+
},
|
|
1124
|
+
children: [
|
|
1125
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Payment method" }),
|
|
1126
|
+
/* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
|
|
1127
|
+
/* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: i && xt(i.id, i.icon, 20) }),
|
|
1128
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: (i == null ? void 0 : i.name) || "Select" }),
|
|
1129
|
+
/* @__PURE__ */ e(ge, {})
|
|
1130
|
+
] })
|
|
1131
|
+
]
|
|
1132
|
+
}
|
|
1133
|
+
),
|
|
1134
|
+
/* @__PURE__ */ e(Le, { isOpen: r, onClose: () => u(!1), children: (o) => /* @__PURE__ */ e(
|
|
1135
|
+
zt,
|
|
1136
|
+
{
|
|
1137
|
+
methods: m,
|
|
1138
|
+
selectedId: a,
|
|
1139
|
+
onSelect: (d) => {
|
|
1140
|
+
n(d), o();
|
|
1141
|
+
},
|
|
1142
|
+
onClose: o
|
|
1143
|
+
}
|
|
1144
|
+
) })
|
|
1145
|
+
] });
|
|
1146
|
+
}
|
|
1147
|
+
function ta({
|
|
1148
|
+
className: t = "",
|
|
1149
|
+
iframeHeight: a = 600,
|
|
1150
|
+
autoRedirect: n = !1,
|
|
1151
|
+
redirectDelay: s = 3e3
|
|
1152
|
+
}) {
|
|
1153
|
+
var g;
|
|
1154
|
+
const { order: r, orderStatus: u, goToStep: m, goBack: i } = pe(), [o, d] = N(!1), [h, f] = N(null), x = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
|
|
1155
|
+
if (U(() => {
|
|
1156
|
+
if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !x) {
|
|
1157
|
+
f(Math.ceil(s / 1e3));
|
|
1158
|
+
const p = setTimeout(() => {
|
|
1159
|
+
window.location.href = r.checkout.url;
|
|
1160
|
+
}, s), b = setInterval(() => {
|
|
1161
|
+
f((S) => S && S > 1 ? S - 1 : null);
|
|
1162
|
+
}, 1e3);
|
|
1163
|
+
return () => {
|
|
1164
|
+
clearTimeout(p), clearInterval(b);
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
}, [r, n, s, x]), U(() => {
|
|
1168
|
+
u && (u.status === "completed" ? m("complete") : ["failed", "cancelled", "expired"].includes(u.status) && m("error"));
|
|
1169
|
+
}, [u == null ? void 0 : u.status, m]), !r)
|
|
1170
|
+
return /* @__PURE__ */ l(
|
|
1171
|
+
"div",
|
|
1172
|
+
{
|
|
1173
|
+
className: `flex flex-col items-center justify-center p-8 ${t}`,
|
|
1174
|
+
style: { color: "var(--t-text)" },
|
|
1175
|
+
children: [
|
|
1176
|
+
/* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "No order found" }),
|
|
1177
|
+
/* @__PURE__ */ e(
|
|
1178
|
+
"button",
|
|
1179
|
+
{
|
|
1180
|
+
className: "font-semibold text-[14px] transition-all",
|
|
1181
|
+
style: {
|
|
1182
|
+
height: 48,
|
|
1183
|
+
borderRadius: 5,
|
|
1184
|
+
background: "var(--t-surface)",
|
|
1185
|
+
color: "var(--t-text)",
|
|
1186
|
+
paddingLeft: 24,
|
|
1187
|
+
paddingRight: 24
|
|
1188
|
+
},
|
|
1189
|
+
onClick: i,
|
|
1190
|
+
children: "Go Back"
|
|
1191
|
+
}
|
|
1192
|
+
)
|
|
1193
|
+
]
|
|
1194
|
+
}
|
|
1195
|
+
);
|
|
1196
|
+
if (x)
|
|
1197
|
+
return /* @__PURE__ */ l(
|
|
1198
|
+
"div",
|
|
1199
|
+
{
|
|
1200
|
+
className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
|
|
1201
|
+
style: { color: "var(--t-text)" },
|
|
1202
|
+
children: [
|
|
1203
|
+
/* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Checkout expired" }),
|
|
1204
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: "The session has expired. Please try again." }),
|
|
1205
|
+
/* @__PURE__ */ e(
|
|
1206
|
+
"button",
|
|
1207
|
+
{
|
|
1208
|
+
className: "w-full font-semibold text-[16px] transition-all",
|
|
1209
|
+
style: {
|
|
1210
|
+
height: 60,
|
|
1211
|
+
borderRadius: 5,
|
|
1212
|
+
background: "var(--t-cta-bg)",
|
|
1213
|
+
color: "var(--t-cta-text)"
|
|
1214
|
+
},
|
|
1215
|
+
onClick: i,
|
|
1216
|
+
children: "Start over"
|
|
1217
|
+
}
|
|
1218
|
+
)
|
|
1219
|
+
]
|
|
1220
|
+
}
|
|
1221
|
+
);
|
|
1222
|
+
if (r.checkout.method === "iframe")
|
|
1223
|
+
return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ l(
|
|
1224
|
+
"div",
|
|
1225
|
+
{
|
|
1226
|
+
className: "relative flex-1",
|
|
1227
|
+
style: {
|
|
1228
|
+
height: a,
|
|
1229
|
+
borderRadius: 5,
|
|
1230
|
+
overflow: "hidden",
|
|
1231
|
+
background: "var(--t-surface)"
|
|
1232
|
+
},
|
|
1233
|
+
children: [
|
|
1234
|
+
!o && /* @__PURE__ */ l("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
1235
|
+
/* @__PURE__ */ e("div", { className: "nramp-spinner" }),
|
|
1236
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
|
|
1237
|
+
] }),
|
|
1238
|
+
/* @__PURE__ */ e(
|
|
1239
|
+
"iframe",
|
|
1240
|
+
{
|
|
1241
|
+
src: r.checkout.url,
|
|
1242
|
+
style: {
|
|
1243
|
+
display: o ? "block" : "none",
|
|
1244
|
+
width: "100%",
|
|
1245
|
+
height: "100%",
|
|
1246
|
+
border: "none"
|
|
1247
|
+
},
|
|
1248
|
+
allow: ((g = r.checkout.allowedFeatures) == null ? void 0 : g.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
|
|
1249
|
+
onLoad: () => d(!0),
|
|
1250
|
+
title: "Provider Checkout"
|
|
1251
|
+
}
|
|
1252
|
+
)
|
|
1253
|
+
]
|
|
1254
|
+
}
|
|
1255
|
+
) });
|
|
1256
|
+
if (r.checkout.method === "redirect")
|
|
1257
|
+
return /* @__PURE__ */ l(
|
|
1258
|
+
"div",
|
|
1259
|
+
{
|
|
1260
|
+
className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
|
|
1261
|
+
style: { color: "var(--t-text)" },
|
|
1262
|
+
children: [
|
|
1263
|
+
/* @__PURE__ */ e("div", { className: "text-[48px] mb-4", children: "🔗" }),
|
|
1264
|
+
/* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Complete Payment" }),
|
|
1265
|
+
/* @__PURE__ */ l("p", { className: "text-[14px] mb-4", style: { color: "var(--t-text-secondary)" }, children: [
|
|
1266
|
+
"You'll be redirected to ",
|
|
1267
|
+
r.gateway,
|
|
1268
|
+
" to complete your payment."
|
|
1269
|
+
] }),
|
|
1270
|
+
h !== null && /* @__PURE__ */ l("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: [
|
|
1271
|
+
"Redirecting in ",
|
|
1272
|
+
h,
|
|
1273
|
+
"..."
|
|
1274
|
+
] }),
|
|
1275
|
+
/* @__PURE__ */ l(
|
|
1276
|
+
"a",
|
|
1277
|
+
{
|
|
1278
|
+
href: r.checkout.url,
|
|
1279
|
+
className: "w-full font-semibold text-[16px] flex items-center justify-center transition-all",
|
|
1280
|
+
style: {
|
|
1281
|
+
height: 60,
|
|
1282
|
+
borderRadius: 5,
|
|
1283
|
+
background: "var(--t-cta-bg)",
|
|
1284
|
+
color: "var(--t-cta-text)",
|
|
1285
|
+
textDecoration: "none"
|
|
1286
|
+
},
|
|
1287
|
+
target: "_blank",
|
|
1288
|
+
rel: "noopener noreferrer",
|
|
1289
|
+
children: [
|
|
1290
|
+
"Continue to ",
|
|
1291
|
+
r.gateway
|
|
1292
|
+
]
|
|
1293
|
+
}
|
|
1294
|
+
),
|
|
1295
|
+
/* @__PURE__ */ e(
|
|
1296
|
+
"button",
|
|
1297
|
+
{
|
|
1298
|
+
className: "w-full font-semibold text-[14px] mt-2 transition-all",
|
|
1299
|
+
style: {
|
|
1300
|
+
height: 48,
|
|
1301
|
+
borderRadius: 5,
|
|
1302
|
+
background: "var(--t-surface)",
|
|
1303
|
+
color: "var(--t-text)"
|
|
1304
|
+
},
|
|
1305
|
+
onClick: i,
|
|
1306
|
+
children: "Cancel"
|
|
1307
|
+
}
|
|
1308
|
+
)
|
|
1309
|
+
]
|
|
1310
|
+
}
|
|
1311
|
+
);
|
|
1312
|
+
if (r.checkout.method === "widget" && r.widgetConfig) {
|
|
1313
|
+
const p = aa(r.checkout.url, r.widgetConfig);
|
|
1314
|
+
return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ l(
|
|
1315
|
+
"div",
|
|
1316
|
+
{
|
|
1317
|
+
className: "relative flex-1",
|
|
1318
|
+
style: {
|
|
1319
|
+
height: a,
|
|
1320
|
+
borderRadius: 5,
|
|
1321
|
+
overflow: "hidden",
|
|
1322
|
+
background: "var(--t-surface)"
|
|
1323
|
+
},
|
|
1324
|
+
children: [
|
|
1325
|
+
!o && /* @__PURE__ */ l("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
1326
|
+
/* @__PURE__ */ e("div", { className: "nramp-spinner" }),
|
|
1327
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
|
|
1328
|
+
] }),
|
|
1329
|
+
/* @__PURE__ */ e(
|
|
1330
|
+
"iframe",
|
|
1331
|
+
{
|
|
1332
|
+
src: p,
|
|
1333
|
+
style: {
|
|
1334
|
+
display: o ? "block" : "none",
|
|
1335
|
+
width: "100%",
|
|
1336
|
+
height: "100%",
|
|
1337
|
+
border: "none"
|
|
1338
|
+
},
|
|
1339
|
+
allow: "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
|
|
1340
|
+
onLoad: () => d(!0),
|
|
1341
|
+
title: "Payment Checkout"
|
|
1342
|
+
}
|
|
1343
|
+
)
|
|
1344
|
+
]
|
|
1345
|
+
}
|
|
1346
|
+
) });
|
|
1347
|
+
}
|
|
1348
|
+
return /* @__PURE__ */ l(
|
|
1349
|
+
"div",
|
|
1350
|
+
{
|
|
1351
|
+
className: `flex flex-col items-center justify-center p-8 ${t}`,
|
|
1352
|
+
style: { color: "var(--t-text)" },
|
|
1353
|
+
children: [
|
|
1354
|
+
/* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "Unknown checkout method" }),
|
|
1355
|
+
/* @__PURE__ */ e(
|
|
1356
|
+
"button",
|
|
1357
|
+
{
|
|
1358
|
+
className: "font-semibold text-[14px] transition-all",
|
|
1359
|
+
style: {
|
|
1360
|
+
height: 48,
|
|
1361
|
+
borderRadius: 5,
|
|
1362
|
+
background: "var(--t-surface)",
|
|
1363
|
+
color: "var(--t-text)",
|
|
1364
|
+
paddingLeft: 24,
|
|
1365
|
+
paddingRight: 24
|
|
1366
|
+
},
|
|
1367
|
+
onClick: i,
|
|
1368
|
+
children: "Go Back"
|
|
1369
|
+
}
|
|
1370
|
+
)
|
|
1371
|
+
]
|
|
1372
|
+
}
|
|
1373
|
+
);
|
|
1374
|
+
}
|
|
1375
|
+
function aa(t, a) {
|
|
1376
|
+
const n = new URL("/en/partner/widget", t);
|
|
1377
|
+
for (const [s, r] of Object.entries(a))
|
|
1378
|
+
r != null && r !== "" && n.searchParams.set(s, String(r));
|
|
1379
|
+
return n.toString();
|
|
1380
|
+
}
|
|
1381
|
+
function na({ className: t = "" }) {
|
|
1382
|
+
const { orderStatus: a, orderStatusLoading: n, goToStep: s } = pe();
|
|
1383
|
+
U(() => {
|
|
1384
|
+
a && (a.status === "completed" ? s("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && s("error"));
|
|
1385
|
+
}, [a == null ? void 0 : a.status, s]);
|
|
1386
|
+
const r = () => {
|
|
1387
|
+
if (!a) return "Processing your order...";
|
|
1388
|
+
switch (a.status) {
|
|
1389
|
+
case "pending":
|
|
1390
|
+
return "Waiting for payment confirmation...";
|
|
1391
|
+
case "processing":
|
|
1392
|
+
return "Processing your transaction...";
|
|
1393
|
+
default:
|
|
1394
|
+
return "Processing...";
|
|
1395
|
+
}
|
|
1396
|
+
};
|
|
1397
|
+
return /* @__PURE__ */ l("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
|
|
1398
|
+
/* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ e("div", { className: "nramp-spinner-large nramp-spinner" }) }),
|
|
1399
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: r() }),
|
|
1400
|
+
n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
|
|
1401
|
+
a && /* @__PURE__ */ l("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1402
|
+
/* @__PURE__ */ e(me, { label: "Order ID", value: a.orderId, mono: !0 }),
|
|
1403
|
+
/* @__PURE__ */ e(me, { label: "Provider", value: a.gateway }),
|
|
1404
|
+
/* @__PURE__ */ e(
|
|
1405
|
+
me,
|
|
1406
|
+
{
|
|
1407
|
+
label: "Amount",
|
|
1408
|
+
value: `${a.fiatAmount} ${a.fiatCurrency}`
|
|
1409
|
+
}
|
|
1410
|
+
),
|
|
1411
|
+
/* @__PURE__ */ e(
|
|
1412
|
+
me,
|
|
1413
|
+
{
|
|
1414
|
+
label: "Receiving",
|
|
1415
|
+
value: `${a.cryptoAmount || "..."} ${a.cryptoCurrency}`
|
|
1416
|
+
}
|
|
1417
|
+
),
|
|
1418
|
+
/* @__PURE__ */ e(me, { label: "Network", value: a.network }),
|
|
1419
|
+
/* @__PURE__ */ e(
|
|
1420
|
+
me,
|
|
1421
|
+
{
|
|
1422
|
+
label: "To Address",
|
|
1423
|
+
value: `${a.walletAddress.slice(0, 10)}...${a.walletAddress.slice(-8)}`,
|
|
1424
|
+
mono: !0
|
|
1425
|
+
}
|
|
1426
|
+
)
|
|
1427
|
+
] }),
|
|
1428
|
+
/* @__PURE__ */ l("div", { className: "mt-6", children: [
|
|
1429
|
+
/* @__PURE__ */ e("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "This usually takes a few minutes." }),
|
|
1430
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: "You can safely close this page - we'll send you an email when complete." })
|
|
1431
|
+
] })
|
|
1432
|
+
] });
|
|
1433
|
+
}
|
|
1434
|
+
function me({ label: t, value: a, mono: n }) {
|
|
1435
|
+
return /* @__PURE__ */ l(
|
|
1436
|
+
"div",
|
|
1437
|
+
{
|
|
1438
|
+
className: "flex justify-between items-center py-2",
|
|
1439
|
+
style: { borderBottom: "1px solid var(--t-divider)" },
|
|
1440
|
+
children: [
|
|
1441
|
+
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
|
|
1442
|
+
/* @__PURE__ */ e(
|
|
1443
|
+
"span",
|
|
1444
|
+
{
|
|
1445
|
+
className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
|
|
1446
|
+
style: { color: "var(--t-text)" },
|
|
1447
|
+
children: a
|
|
1448
|
+
}
|
|
1449
|
+
)
|
|
1450
|
+
]
|
|
1451
|
+
}
|
|
1452
|
+
);
|
|
1453
|
+
}
|
|
1454
|
+
function ra({
|
|
1455
|
+
className: t = "",
|
|
1456
|
+
explorerUrl: a,
|
|
1457
|
+
onDone: n,
|
|
1458
|
+
doneButtonText: s = "Done"
|
|
1459
|
+
}) {
|
|
1460
|
+
const { orderStatus: r, state: u, dispatch: m } = pe(), i = u.flowType === "sell", o = () => {
|
|
1461
|
+
if (!(r != null && r.transactionHash)) return null;
|
|
1462
|
+
if (!a) {
|
|
1463
|
+
const f = {
|
|
1464
|
+
ethereum: "https://etherscan.io/tx/{txHash}",
|
|
1465
|
+
polygon: "https://polygonscan.com/tx/{txHash}",
|
|
1466
|
+
arbitrum: "https://arbiscan.io/tx/{txHash}",
|
|
1467
|
+
optimism: "https://optimistic.etherscan.io/tx/{txHash}",
|
|
1468
|
+
base: "https://basescan.org/tx/{txHash}",
|
|
1469
|
+
bitcoin: "https://mempool.space/tx/{txHash}",
|
|
1470
|
+
solana: "https://solscan.io/tx/{txHash}",
|
|
1471
|
+
avalanche: "https://snowtrace.io/tx/{txHash}",
|
|
1472
|
+
fantom: "https://ftmscan.com/tx/{txHash}"
|
|
1473
|
+
};
|
|
1474
|
+
return (f[u.network] || f.ethereum).replace("{txHash}", r.transactionHash);
|
|
1475
|
+
}
|
|
1476
|
+
return a.replace("{txHash}", r.transactionHash);
|
|
1477
|
+
}, d = () => {
|
|
1478
|
+
n ? n() : m({ type: "RESET" });
|
|
1479
|
+
}, h = o();
|
|
1480
|
+
return /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
|
|
1481
|
+
/* @__PURE__ */ e(
|
|
1482
|
+
"div",
|
|
1483
|
+
{
|
|
1484
|
+
className: "flex items-center justify-center mb-5",
|
|
1485
|
+
style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-success, #10b981)" },
|
|
1486
|
+
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" }) })
|
|
1487
|
+
}
|
|
1488
|
+
),
|
|
1489
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: i ? "Sale Complete!" : "Purchase Complete!" }),
|
|
1490
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: i ? `Your ${(r == null ? void 0 : r.fiatCurrency) || u.fiatCurrency} payout is being processed.` : `Your ${(r == null ? void 0 : r.cryptoCurrency) || u.cryptoCurrency} has been sent to your wallet.` }),
|
|
1491
|
+
r && /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1492
|
+
/* @__PURE__ */ e(
|
|
1493
|
+
te,
|
|
1494
|
+
{
|
|
1495
|
+
label: i ? "Amount Sold" : "Amount Received",
|
|
1496
|
+
value: `${r.cryptoAmount} ${r.cryptoCurrency}`,
|
|
1497
|
+
highlight: !0
|
|
1498
|
+
}
|
|
1499
|
+
),
|
|
1500
|
+
/* @__PURE__ */ e(
|
|
1501
|
+
te,
|
|
1502
|
+
{
|
|
1503
|
+
label: i ? "Payout Amount" : "Amount Paid",
|
|
1504
|
+
value: `${r.fiatAmount} ${r.fiatCurrency}`
|
|
1505
|
+
}
|
|
1506
|
+
),
|
|
1507
|
+
/* @__PURE__ */ e(te, { label: "Network", value: r.network }),
|
|
1508
|
+
/* @__PURE__ */ e(
|
|
1509
|
+
te,
|
|
1510
|
+
{
|
|
1511
|
+
label: "Wallet",
|
|
1512
|
+
value: `${r.walletAddress.slice(0, 10)}...${r.walletAddress.slice(-8)}`,
|
|
1513
|
+
mono: !0
|
|
1514
|
+
}
|
|
1515
|
+
),
|
|
1516
|
+
r.transactionHash && /* @__PURE__ */ e(
|
|
1517
|
+
te,
|
|
1518
|
+
{
|
|
1519
|
+
label: "Transaction",
|
|
1520
|
+
value: `${r.transactionHash.slice(0, 10)}...${r.transactionHash.slice(-8)}`,
|
|
1521
|
+
mono: !0
|
|
1522
|
+
}
|
|
1523
|
+
),
|
|
1524
|
+
/* @__PURE__ */ e(te, { label: "Provider", value: r.gateway }),
|
|
1525
|
+
/* @__PURE__ */ e(te, { label: "Order ID", value: r.orderId, mono: !0 }),
|
|
1526
|
+
r.completedAt && /* @__PURE__ */ e(
|
|
1527
|
+
te,
|
|
1528
|
+
{
|
|
1529
|
+
label: "Completed",
|
|
1530
|
+
value: new Date(r.completedAt).toLocaleString()
|
|
1531
|
+
}
|
|
1532
|
+
)
|
|
1533
|
+
] }),
|
|
1534
|
+
/* @__PURE__ */ l("div", { className: "w-full flex flex-col gap-2", children: [
|
|
1535
|
+
h && /* @__PURE__ */ e(
|
|
1536
|
+
"a",
|
|
1537
|
+
{
|
|
1538
|
+
href: h,
|
|
1539
|
+
target: "_blank",
|
|
1540
|
+
rel: "noopener noreferrer",
|
|
1541
|
+
className: "w-full font-semibold text-[14px] flex items-center justify-center transition-all",
|
|
1542
|
+
style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)", textDecoration: "none" },
|
|
1543
|
+
children: "View on Explorer"
|
|
1544
|
+
}
|
|
1545
|
+
),
|
|
1546
|
+
/* @__PURE__ */ e(
|
|
1547
|
+
"button",
|
|
1548
|
+
{
|
|
1549
|
+
className: "w-full font-semibold text-[16px] transition-all",
|
|
1550
|
+
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
|
|
1551
|
+
onClick: d,
|
|
1552
|
+
children: s
|
|
1553
|
+
}
|
|
1554
|
+
)
|
|
1555
|
+
] })
|
|
1556
|
+
] });
|
|
1557
|
+
}
|
|
1558
|
+
function te({ label: t, value: a, mono: n, highlight: s }) {
|
|
1559
|
+
return /* @__PURE__ */ l(
|
|
1454
1560
|
"div",
|
|
1455
1561
|
{
|
|
1456
|
-
className: "
|
|
1457
|
-
style: {
|
|
1562
|
+
className: "flex justify-between items-center py-2",
|
|
1563
|
+
style: { borderBottom: "1px solid var(--t-divider)" },
|
|
1458
1564
|
children: [
|
|
1459
|
-
"
|
|
1460
|
-
/* @__PURE__ */ e(
|
|
1565
|
+
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
|
|
1566
|
+
/* @__PURE__ */ e(
|
|
1567
|
+
"span",
|
|
1568
|
+
{
|
|
1569
|
+
className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
|
|
1570
|
+
style: { color: s ? "var(--t-success, #10b981)" : "var(--t-text)" },
|
|
1571
|
+
children: a
|
|
1572
|
+
}
|
|
1573
|
+
)
|
|
1461
1574
|
]
|
|
1462
1575
|
}
|
|
1463
1576
|
);
|
|
1464
1577
|
}
|
|
1465
|
-
function
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1578
|
+
function oa({
|
|
1579
|
+
className: t = "",
|
|
1580
|
+
onRetry: a,
|
|
1581
|
+
supportEmail: n = "support@nowramp.com"
|
|
1582
|
+
}) {
|
|
1583
|
+
const { state: s, orderStatus: r, dispatch: u, goToStep: m } = pe(), i = s.flowType === "sell", o = () => {
|
|
1584
|
+
if (r)
|
|
1585
|
+
switch (r.status) {
|
|
1586
|
+
case "failed":
|
|
1587
|
+
return "Payment Failed";
|
|
1588
|
+
case "cancelled":
|
|
1589
|
+
return "Order Cancelled";
|
|
1590
|
+
case "expired":
|
|
1591
|
+
return "Order Expired";
|
|
1592
|
+
case "refunded":
|
|
1593
|
+
return "Order Refunded";
|
|
1594
|
+
default:
|
|
1595
|
+
return "Something Went Wrong";
|
|
1596
|
+
}
|
|
1597
|
+
return "Something Went Wrong";
|
|
1598
|
+
}, d = () => {
|
|
1599
|
+
if (s.errorMessage) return s.errorMessage;
|
|
1600
|
+
if (r)
|
|
1601
|
+
switch (r.status) {
|
|
1602
|
+
case "failed":
|
|
1603
|
+
return i ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
|
|
1604
|
+
case "cancelled":
|
|
1605
|
+
return i ? "Your sale was cancelled. No crypto was transferred." : "Your order was cancelled. No payment was processed.";
|
|
1606
|
+
case "expired":
|
|
1607
|
+
return i ? "Your order has expired. Please start a new sale." : "Your order has expired. Please start a new purchase.";
|
|
1608
|
+
case "refunded":
|
|
1609
|
+
return i ? "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.";
|
|
1610
|
+
default:
|
|
1611
|
+
return "An unexpected error occurred. Please try again.";
|
|
1612
|
+
}
|
|
1613
|
+
return "An unexpected error occurred. Please try again.";
|
|
1614
|
+
}, h = () => {
|
|
1615
|
+
u({ type: "CLEAR_ERROR" }), a ? a() : (u({ type: "RESET" }), m("amount"));
|
|
1616
|
+
}, f = () => {
|
|
1617
|
+
u({ type: "RESET" }), m("amount");
|
|
1618
|
+
};
|
|
1619
|
+
return /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
|
|
1620
|
+
/* @__PURE__ */ e(
|
|
1621
|
+
"div",
|
|
1622
|
+
{
|
|
1623
|
+
className: "flex items-center justify-center mb-5",
|
|
1624
|
+
style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-error, #EF4444)" },
|
|
1625
|
+
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" }) })
|
|
1626
|
+
}
|
|
1627
|
+
),
|
|
1628
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: o() }),
|
|
1629
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: d() }),
|
|
1630
|
+
r && /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1631
|
+
/* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
1632
|
+
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
|
|
1633
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: r.orderId })
|
|
1634
|
+
] }),
|
|
1635
|
+
/* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", children: [
|
|
1636
|
+
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Status" }),
|
|
1637
|
+
/* @__PURE__ */ e(
|
|
1638
|
+
"span",
|
|
1639
|
+
{
|
|
1640
|
+
className: "text-[12px] font-medium px-2 py-0.5",
|
|
1641
|
+
style: { background: "rgba(239,68,68,0.15)", color: "#EF4444", borderRadius: 4 },
|
|
1642
|
+
children: r.gatewayStatus
|
|
1643
|
+
}
|
|
1644
|
+
)
|
|
1484
1645
|
] })
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
"
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1646
|
+
] }),
|
|
1647
|
+
/* @__PURE__ */ l("div", { className: "w-full flex flex-col gap-2", children: [
|
|
1648
|
+
/* @__PURE__ */ e(
|
|
1649
|
+
"button",
|
|
1650
|
+
{
|
|
1651
|
+
className: "w-full font-semibold text-[16px] transition-all",
|
|
1652
|
+
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
|
|
1653
|
+
onClick: h,
|
|
1654
|
+
children: "Try Again"
|
|
1655
|
+
}
|
|
1656
|
+
),
|
|
1657
|
+
/* @__PURE__ */ e(
|
|
1658
|
+
"button",
|
|
1659
|
+
{
|
|
1660
|
+
className: "w-full font-semibold text-[14px] transition-all",
|
|
1661
|
+
style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)" },
|
|
1662
|
+
onClick: f,
|
|
1663
|
+
children: "Start Over"
|
|
1664
|
+
}
|
|
1665
|
+
)
|
|
1666
|
+
] }),
|
|
1667
|
+
/* @__PURE__ */ l("div", { className: "mt-6", children: [
|
|
1668
|
+
/* @__PURE__ */ l("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: [
|
|
1669
|
+
"Need help? Contact",
|
|
1670
|
+
" ",
|
|
1671
|
+
/* @__PURE__ */ e(
|
|
1672
|
+
"a",
|
|
1673
|
+
{
|
|
1674
|
+
href: `mailto:${n}`,
|
|
1675
|
+
className: "underline",
|
|
1676
|
+
style: { color: "var(--t-accent)" },
|
|
1677
|
+
children: n
|
|
1678
|
+
}
|
|
1679
|
+
)
|
|
1680
|
+
] }),
|
|
1681
|
+
r && /* @__PURE__ */ l("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
|
|
1682
|
+
"Reference: ",
|
|
1683
|
+
r.orderId
|
|
1523
1684
|
] })
|
|
1524
|
-
}
|
|
1525
|
-
);
|
|
1685
|
+
] })
|
|
1686
|
+
] });
|
|
1526
1687
|
}
|
|
1527
|
-
function
|
|
1528
|
-
|
|
1529
|
-
case "revolut":
|
|
1530
|
-
return /* @__PURE__ */ e(Qt, { size: a });
|
|
1531
|
-
case "applepay":
|
|
1532
|
-
return /* @__PURE__ */ e(Zt, { size: a });
|
|
1533
|
-
case "card":
|
|
1534
|
-
return /* @__PURE__ */ e(qt, { size: a });
|
|
1535
|
-
case "googlepay":
|
|
1536
|
-
return /* @__PURE__ */ e(Jt, { size: a });
|
|
1537
|
-
case "paypal":
|
|
1538
|
-
return /* @__PURE__ */ e(zt, { size: a });
|
|
1539
|
-
case "bank":
|
|
1540
|
-
return /* @__PURE__ */ e(jt, { size: a });
|
|
1541
|
-
default:
|
|
1542
|
-
return /* @__PURE__ */ e(ft, { size: a });
|
|
1543
|
-
}
|
|
1688
|
+
function pt(t) {
|
|
1689
|
+
return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
|
|
1544
1690
|
}
|
|
1545
|
-
function
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1691
|
+
function la({ className: t = "" }) {
|
|
1692
|
+
const {
|
|
1693
|
+
config: a,
|
|
1694
|
+
configLoading: n,
|
|
1695
|
+
state: s,
|
|
1696
|
+
defaultGateway: r,
|
|
1697
|
+
fetchQuotes: u,
|
|
1698
|
+
createOrder: m,
|
|
1699
|
+
orderLoading: i
|
|
1700
|
+
} = pe(), o = s.flowType === "sell", [d, h] = N(null), f = a == null ? void 0 : a.gateways.find((g) => g.id === r), x = async () => {
|
|
1701
|
+
h(null);
|
|
1702
|
+
try {
|
|
1703
|
+
u(), await m();
|
|
1704
|
+
} catch (g) {
|
|
1705
|
+
const p = g instanceof Error ? g.message : "Failed to create order";
|
|
1706
|
+
h(p);
|
|
1555
1707
|
}
|
|
1556
|
-
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1708
|
+
};
|
|
1709
|
+
return n ? /* @__PURE__ */ l("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
|
|
1710
|
+
/* @__PURE__ */ e("div", { className: "nramp-spinner" }),
|
|
1711
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
|
|
1712
|
+
] }) : /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
|
|
1713
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: o ? "Confirm Sale" : "Confirm Purchase" }),
|
|
1714
|
+
/* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1715
|
+
f && /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
1716
|
+
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Provider" }),
|
|
1717
|
+
/* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
|
|
1718
|
+
f.logo && /* @__PURE__ */ e("img", { src: f.logo, alt: f.name, width: 20, height: 20, style: { borderRadius: 4 } }),
|
|
1719
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: f.name })
|
|
1720
|
+
] })
|
|
1721
|
+
] }),
|
|
1722
|
+
o ? /* @__PURE__ */ l(J, { children: [
|
|
1723
|
+
/* @__PURE__ */ e(le, { label: "You sell", value: `${s.cryptoAmount} ${s.cryptoCurrency}`, highlight: !0 }),
|
|
1724
|
+
/* @__PURE__ */ e(le, { label: "You receive", value: `${s.fiatCurrency} payout` })
|
|
1725
|
+
] }) : /* @__PURE__ */ l(J, { children: [
|
|
1726
|
+
/* @__PURE__ */ e(le, { label: "You pay", value: `${s.fiatAmount} ${s.fiatCurrency}`, highlight: !0 }),
|
|
1727
|
+
/* @__PURE__ */ e(le, { label: "You receive", value: `${s.cryptoCurrency} on ${s.network}` }),
|
|
1728
|
+
/* @__PURE__ */ e(le, { label: "Wallet", value: pt(s.walletAddress), mono: !0 })
|
|
1729
|
+
] }),
|
|
1730
|
+
/* @__PURE__ */ e(le, { label: "Network", value: s.network }),
|
|
1731
|
+
o && s.walletAddress && /* @__PURE__ */ e(le, { label: "Refund address", value: pt(s.walletAddress), mono: !0 })
|
|
1732
|
+
] }),
|
|
1733
|
+
d && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: d }),
|
|
1564
1734
|
/* @__PURE__ */ e(
|
|
1565
|
-
"
|
|
1735
|
+
"button",
|
|
1566
1736
|
{
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1737
|
+
className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
|
|
1738
|
+
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: i ? 0.7 : 1 },
|
|
1739
|
+
disabled: i,
|
|
1740
|
+
onClick: x,
|
|
1741
|
+
children: i ? /* @__PURE__ */ l(J, { children: [
|
|
1742
|
+
/* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
|
|
1743
|
+
"Processing..."
|
|
1744
|
+
] }) : o ? "Confirm & Sell" : "Confirm & Pay"
|
|
1573
1745
|
}
|
|
1574
|
-
)
|
|
1575
|
-
|
|
1576
|
-
|
|
1746
|
+
)
|
|
1747
|
+
] });
|
|
1748
|
+
}
|
|
1749
|
+
function le({ label: t, value: a, mono: n, highlight: s }) {
|
|
1750
|
+
return /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
1751
|
+
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
|
|
1752
|
+
/* @__PURE__ */ e(
|
|
1753
|
+
"span",
|
|
1577
1754
|
{
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
children: /* @__PURE__ */ e("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L7 7M7 1L1 7", stroke: "var(--t-icon-close)", strokeWidth: "1.2", strokeLinecap: "round" }) })
|
|
1755
|
+
className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
|
|
1756
|
+
style: { color: s ? "var(--t-success, #10b981)" : "var(--t-text)" },
|
|
1757
|
+
children: a
|
|
1582
1758
|
}
|
|
1583
1759
|
)
|
|
1584
1760
|
] });
|
|
1585
1761
|
}
|
|
1586
|
-
function
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1762
|
+
function sa({ char: t, height: a = 38 }) {
|
|
1763
|
+
const n = "0123456789", s = n.indexOf(t);
|
|
1764
|
+
return s === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: a, lineHeight: `${a}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${s * a}px)` }, children: n.split("").map((r) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: r }, r)) }) });
|
|
1765
|
+
}
|
|
1766
|
+
function ca({
|
|
1767
|
+
value: t,
|
|
1768
|
+
height: a = 38,
|
|
1769
|
+
className: n = "",
|
|
1770
|
+
style: s = {}
|
|
1771
|
+
}) {
|
|
1772
|
+
return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...s }, children: t.split("").map((r, u) => /* @__PURE__ */ e(sa, { char: r, height: a }, u)) });
|
|
1773
|
+
}
|
|
1774
|
+
function M({
|
|
1775
|
+
w: t,
|
|
1776
|
+
h: a,
|
|
1777
|
+
className: n = ""
|
|
1778
|
+
}) {
|
|
1779
|
+
return /* @__PURE__ */ e("div", { className: `skeleton ${n}`, style: { width: t, height: a } });
|
|
1780
|
+
}
|
|
1781
|
+
function ia() {
|
|
1782
|
+
return /* @__PURE__ */ l("div", { className: "flex-1 px-5 flex flex-col", children: [
|
|
1783
|
+
/* @__PURE__ */ l("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
|
|
1784
|
+
/* @__PURE__ */ e(M, { w: 70, h: 14, className: "mb-3" }),
|
|
1785
|
+
/* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
|
|
1786
|
+
/* @__PURE__ */ e(M, { w: 120, h: 32 }),
|
|
1787
|
+
/* @__PURE__ */ e(M, { w: 75, h: 32 })
|
|
1788
|
+
] })
|
|
1789
|
+
] }),
|
|
1790
|
+
/* @__PURE__ */ l("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
|
|
1791
|
+
/* @__PURE__ */ e(M, { w: 50, h: 14, className: "mb-3" }),
|
|
1792
|
+
/* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
|
|
1793
|
+
/* @__PURE__ */ e(M, { w: 180, h: 32 }),
|
|
1794
|
+
/* @__PURE__ */ e(M, { w: 85, h: 32 })
|
|
1795
|
+
] })
|
|
1796
|
+
] }),
|
|
1797
|
+
/* @__PURE__ */ l("div", { className: "flex justify-between mt-3 px-[2px]", children: [
|
|
1798
|
+
/* @__PURE__ */ e(M, { w: 140, h: 12 }),
|
|
1799
|
+
/* @__PURE__ */ e(M, { w: 90, h: 12 })
|
|
1800
|
+
] }),
|
|
1801
|
+
/* @__PURE__ */ l("div", { className: "mt-8", children: [
|
|
1802
|
+
/* @__PURE__ */ e(M, { w: 65, h: 14, className: "mb-2.5" }),
|
|
1803
|
+
/* @__PURE__ */ e(M, { w: "100%", h: 47 })
|
|
1804
|
+
] }),
|
|
1805
|
+
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
1806
|
+
/* @__PURE__ */ e(M, { w: "100%", h: 60, className: "mb-2" }),
|
|
1807
|
+
/* @__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" }) })
|
|
1808
|
+
] });
|
|
1809
|
+
}
|
|
1810
|
+
function da({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: s = "" }) {
|
|
1811
|
+
const [r, u] = N(""), m = F(() => {
|
|
1812
|
+
if (!n || n.length === 0) return st;
|
|
1813
|
+
const o = new Map(st.map((d) => [d.code, d.name]));
|
|
1814
|
+
return n.map((d) => ({
|
|
1815
|
+
code: d.code,
|
|
1816
|
+
name: d.name || o.get(d.code) || d.code
|
|
1593
1817
|
}));
|
|
1594
|
-
}, [n]),
|
|
1595
|
-
const
|
|
1596
|
-
return
|
|
1597
|
-
(
|
|
1598
|
-
) :
|
|
1599
|
-
}, [
|
|
1600
|
-
return /* @__PURE__ */
|
|
1601
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
1818
|
+
}, [n]), i = F(() => {
|
|
1819
|
+
const o = r.trim().toLowerCase();
|
|
1820
|
+
return o ? m.filter(
|
|
1821
|
+
(d) => d.code.toLowerCase().includes(o) || d.name.toLowerCase().includes(o)
|
|
1822
|
+
) : m;
|
|
1823
|
+
}, [m, r]);
|
|
1824
|
+
return /* @__PURE__ */ l(J, { children: [
|
|
1825
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
|
|
1602
1826
|
/* @__PURE__ */ e(
|
|
1603
1827
|
"h2",
|
|
1604
1828
|
{
|
|
@@ -1607,64 +1831,64 @@ function na({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: l = "" }) {
|
|
|
1607
1831
|
children: "Select fiat currency"
|
|
1608
1832
|
}
|
|
1609
1833
|
),
|
|
1610
|
-
/* @__PURE__ */ e(
|
|
1611
|
-
/* @__PURE__ */
|
|
1612
|
-
|
|
1834
|
+
/* @__PURE__ */ e(Be, { value: r, onChange: u }),
|
|
1835
|
+
/* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
1836
|
+
i.map((o) => /* @__PURE__ */ l(
|
|
1613
1837
|
"button",
|
|
1614
1838
|
{
|
|
1615
|
-
onClick: () => a(
|
|
1839
|
+
onClick: () => a(o.code),
|
|
1616
1840
|
className: "flex items-center gap-3.5 w-full py-3.5 transition-colors",
|
|
1617
1841
|
style: { color: "var(--t-text)" },
|
|
1618
1842
|
children: [
|
|
1619
|
-
/* @__PURE__ */ e(
|
|
1620
|
-
/* @__PURE__ */
|
|
1621
|
-
/* @__PURE__ */ e("div", { className: "font-semibold text-[15px] leading-tight", children:
|
|
1622
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children:
|
|
1843
|
+
/* @__PURE__ */ e(Xe, { currencyCode: o.code, size: 32, baseUrl: s }),
|
|
1844
|
+
/* @__PURE__ */ l("div", { className: "text-left", children: [
|
|
1845
|
+
/* @__PURE__ */ e("div", { className: "font-semibold text-[15px] leading-tight", children: o.code }),
|
|
1846
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: o.name })
|
|
1623
1847
|
] })
|
|
1624
1848
|
]
|
|
1625
1849
|
},
|
|
1626
|
-
|
|
1850
|
+
o.code
|
|
1627
1851
|
)),
|
|
1628
|
-
|
|
1852
|
+
i.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
|
|
1629
1853
|
] })
|
|
1630
1854
|
] });
|
|
1631
1855
|
}
|
|
1632
|
-
function
|
|
1633
|
-
const [r,
|
|
1634
|
-
if (!n || n.length === 0) return
|
|
1635
|
-
const
|
|
1636
|
-
for (const
|
|
1637
|
-
const
|
|
1638
|
-
if (
|
|
1639
|
-
|
|
1856
|
+
function ua({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: s = "" }) {
|
|
1857
|
+
const [r, u] = N(""), m = F(() => {
|
|
1858
|
+
if (!n || n.length === 0) return _t;
|
|
1859
|
+
const o = [];
|
|
1860
|
+
for (const d of n) {
|
|
1861
|
+
const h = d.networks || [];
|
|
1862
|
+
if (h.length === 0)
|
|
1863
|
+
o.push({ code: d.code, name: d.name || d.code, chain: d.code, popular: !1 });
|
|
1640
1864
|
else
|
|
1641
|
-
for (const f of
|
|
1642
|
-
const x = f.code || f.id || f.name ||
|
|
1643
|
-
|
|
1644
|
-
code:
|
|
1645
|
-
name:
|
|
1865
|
+
for (const f of h) {
|
|
1866
|
+
const x = f.code || f.id || f.name || d.code;
|
|
1867
|
+
o.push({
|
|
1868
|
+
code: d.code,
|
|
1869
|
+
name: d.name || d.code,
|
|
1646
1870
|
chain: x,
|
|
1647
1871
|
chainName: f.name,
|
|
1648
1872
|
popular: !1
|
|
1649
1873
|
});
|
|
1650
1874
|
}
|
|
1651
1875
|
}
|
|
1652
|
-
return
|
|
1653
|
-
}, [n]),
|
|
1876
|
+
return o;
|
|
1877
|
+
}, [n]), i = F(() => {
|
|
1654
1878
|
var f;
|
|
1655
|
-
const
|
|
1656
|
-
if (!
|
|
1657
|
-
const
|
|
1658
|
-
for (const x of
|
|
1659
|
-
const g =
|
|
1660
|
-
if (!
|
|
1661
|
-
let
|
|
1662
|
-
|
|
1879
|
+
const o = r.trim().toLowerCase();
|
|
1880
|
+
if (!o) return m;
|
|
1881
|
+
const d = o.split(/\s+/), h = [];
|
|
1882
|
+
for (const x of m) {
|
|
1883
|
+
const g = Ie[x.chain], p = g ? g.name.toLowerCase() : "", b = ((f = g == null ? void 0 : g.shortName) == null ? void 0 : f.toLowerCase()) || "", S = x.chain.toLowerCase(), P = x.code.toLowerCase(), w = x.name.toLowerCase(), G = [P, w, p, b, S];
|
|
1884
|
+
if (!d.every((z) => G.some((c) => c.includes(z)))) continue;
|
|
1885
|
+
let j = 0;
|
|
1886
|
+
P === o ? j += 100 : P.startsWith(d[0]) && (j += 50), x.popular && (j += 10), d.length > 1 && (p.includes(d[1]) || b.includes(d[1]) || S.includes(d[1])) && (j += 25), h.push({ item: x, score: j });
|
|
1663
1887
|
}
|
|
1664
|
-
return
|
|
1665
|
-
}, [
|
|
1666
|
-
return /* @__PURE__ */
|
|
1667
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
1888
|
+
return h.sort((x, g) => g.score - x.score), h.map((x) => x.item);
|
|
1889
|
+
}, [m, r]);
|
|
1890
|
+
return /* @__PURE__ */ l(J, { children: [
|
|
1891
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
|
|
1668
1892
|
/* @__PURE__ */ e(
|
|
1669
1893
|
"h2",
|
|
1670
1894
|
{
|
|
@@ -1673,22 +1897,22 @@ function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
|
|
|
1673
1897
|
children: "Select crypto currency"
|
|
1674
1898
|
}
|
|
1675
1899
|
),
|
|
1676
|
-
/* @__PURE__ */ e(
|
|
1677
|
-
/* @__PURE__ */
|
|
1678
|
-
|
|
1679
|
-
const
|
|
1680
|
-
return /* @__PURE__ */
|
|
1900
|
+
/* @__PURE__ */ e(Be, { value: r, onChange: u }),
|
|
1901
|
+
/* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
1902
|
+
i.map((o) => {
|
|
1903
|
+
const d = Ie[o.chain], h = (d == null ? void 0 : d.name) || o.chainName || o.chain;
|
|
1904
|
+
return /* @__PURE__ */ l(
|
|
1681
1905
|
"button",
|
|
1682
1906
|
{
|
|
1683
|
-
onClick: () => a(
|
|
1907
|
+
onClick: () => a(o.code, o.chain),
|
|
1684
1908
|
className: "flex items-center gap-3.5 w-full py-3.5 transition-colors",
|
|
1685
1909
|
children: [
|
|
1686
|
-
/* @__PURE__ */
|
|
1910
|
+
/* @__PURE__ */ l("div", { className: "relative shrink-0", style: { width: 40, height: 40 }, children: [
|
|
1687
1911
|
/* @__PURE__ */ e(
|
|
1688
1912
|
"img",
|
|
1689
1913
|
{
|
|
1690
|
-
src:
|
|
1691
|
-
alt:
|
|
1914
|
+
src: yt(o.code, s),
|
|
1915
|
+
alt: o.code,
|
|
1692
1916
|
width: 32,
|
|
1693
1917
|
height: 32,
|
|
1694
1918
|
className: "rounded-full absolute top-0 left-0",
|
|
@@ -1698,8 +1922,8 @@ function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
|
|
|
1698
1922
|
/* @__PURE__ */ e(
|
|
1699
1923
|
"img",
|
|
1700
1924
|
{
|
|
1701
|
-
src:
|
|
1702
|
-
alt:
|
|
1925
|
+
src: _e(o.chain, s),
|
|
1926
|
+
alt: o.chain,
|
|
1703
1927
|
width: 16,
|
|
1704
1928
|
height: 16,
|
|
1705
1929
|
className: "rounded-full absolute",
|
|
@@ -1713,28 +1937,28 @@ function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
|
|
|
1713
1937
|
}
|
|
1714
1938
|
)
|
|
1715
1939
|
] }),
|
|
1716
|
-
/* @__PURE__ */
|
|
1940
|
+
/* @__PURE__ */ l("div", { className: "text-left flex-1 min-w-0", children: [
|
|
1717
1941
|
/* @__PURE__ */ e(
|
|
1718
1942
|
"div",
|
|
1719
1943
|
{
|
|
1720
1944
|
className: "font-semibold text-[15px] leading-tight",
|
|
1721
1945
|
style: { color: "var(--t-text)" },
|
|
1722
|
-
children:
|
|
1946
|
+
children: o.code
|
|
1723
1947
|
}
|
|
1724
1948
|
),
|
|
1725
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children:
|
|
1949
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: o.name })
|
|
1726
1950
|
] }),
|
|
1727
|
-
/* @__PURE__ */ e("div", { className: "text-right shrink-0", children: /* @__PURE__ */ e("div", { className: "text-[13px]", style: { color: "var(--t-text-muted)" }, children:
|
|
1951
|
+
/* @__PURE__ */ e("div", { className: "text-right shrink-0", children: /* @__PURE__ */ e("div", { className: "text-[13px]", style: { color: "var(--t-text-muted)" }, children: h }) })
|
|
1728
1952
|
]
|
|
1729
1953
|
},
|
|
1730
|
-
`${
|
|
1954
|
+
`${o.code}-${o.chain}`
|
|
1731
1955
|
);
|
|
1732
1956
|
}),
|
|
1733
|
-
|
|
1957
|
+
i.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
|
|
1734
1958
|
] })
|
|
1735
1959
|
] });
|
|
1736
1960
|
}
|
|
1737
|
-
function
|
|
1961
|
+
function ma({
|
|
1738
1962
|
checked: t,
|
|
1739
1963
|
onChange: a,
|
|
1740
1964
|
accentColor: n = "var(--t-accent)"
|
|
@@ -1764,23 +1988,23 @@ function oa({
|
|
|
1764
1988
|
}
|
|
1765
1989
|
);
|
|
1766
1990
|
}
|
|
1767
|
-
const
|
|
1991
|
+
const pa = [
|
|
1768
1992
|
{ label: "Privacy policy", href: "https://nowramp.com/privacy-policy" },
|
|
1769
1993
|
{ label: "Terms of use", href: "https://nowramp.com/terms-and-conditions" }
|
|
1770
1994
|
];
|
|
1771
|
-
function
|
|
1995
|
+
function ha({
|
|
1772
1996
|
onClose: t,
|
|
1773
1997
|
darkMode: a,
|
|
1774
1998
|
onToggleDarkMode: n,
|
|
1775
|
-
skinId:
|
|
1999
|
+
skinId: s,
|
|
1776
2000
|
onSelectSkin: r
|
|
1777
2001
|
}) {
|
|
1778
|
-
return /* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(
|
|
1780
|
-
/* @__PURE__ */
|
|
1781
|
-
/* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */ e(
|
|
2002
|
+
return /* @__PURE__ */ l(J, { children: [
|
|
2003
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
|
|
2004
|
+
/* @__PURE__ */ l("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
|
|
2005
|
+
/* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ l("div", { className: "flex items-center justify-between w-full py-5", children: [
|
|
2006
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-3.5", children: [
|
|
2007
|
+
/* @__PURE__ */ e(Zt, { size: 40 }),
|
|
1784
2008
|
/* @__PURE__ */ e(
|
|
1785
2009
|
"span",
|
|
1786
2010
|
{
|
|
@@ -1790,14 +2014,14 @@ function ca({
|
|
|
1790
2014
|
}
|
|
1791
2015
|
)
|
|
1792
2016
|
] }),
|
|
1793
|
-
/* @__PURE__ */ e(
|
|
2017
|
+
/* @__PURE__ */ e(ma, { checked: a, onChange: n, accentColor: "#4CD964" })
|
|
1794
2018
|
] }) }),
|
|
1795
2019
|
/* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } }),
|
|
1796
|
-
|
|
1797
|
-
/* @__PURE__ */
|
|
2020
|
+
pa.map((u) => /* @__PURE__ */ l("div", { children: [
|
|
2021
|
+
/* @__PURE__ */ l(
|
|
1798
2022
|
"a",
|
|
1799
2023
|
{
|
|
1800
|
-
href:
|
|
2024
|
+
href: u.href,
|
|
1801
2025
|
target: "_blank",
|
|
1802
2026
|
rel: "noopener noreferrer",
|
|
1803
2027
|
className: "flex items-center justify-between w-full py-5 transition-colors",
|
|
@@ -1807,201 +2031,206 @@ function ca({
|
|
|
1807
2031
|
{
|
|
1808
2032
|
className: "font-medium text-[15px]",
|
|
1809
2033
|
style: { color: "var(--t-text)" },
|
|
1810
|
-
children:
|
|
2034
|
+
children: u.label
|
|
1811
2035
|
}
|
|
1812
2036
|
),
|
|
1813
|
-
/* @__PURE__ */ e(
|
|
2037
|
+
/* @__PURE__ */ e(Wt, {})
|
|
1814
2038
|
]
|
|
1815
2039
|
}
|
|
1816
2040
|
),
|
|
1817
2041
|
/* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
|
|
1818
|
-
] },
|
|
2042
|
+
] }, u.label))
|
|
1819
2043
|
] })
|
|
1820
2044
|
] });
|
|
1821
2045
|
}
|
|
1822
|
-
function
|
|
2046
|
+
function fa({
|
|
1823
2047
|
className: t = "",
|
|
1824
2048
|
theme: a = "dark",
|
|
1825
2049
|
skinId: n = "mono",
|
|
1826
|
-
accentColor:
|
|
2050
|
+
accentColor: s,
|
|
1827
2051
|
bgColor: r,
|
|
1828
|
-
bgImage:
|
|
1829
|
-
borderColor:
|
|
1830
|
-
borderRadius:
|
|
1831
|
-
showFlowToggle:
|
|
1832
|
-
autoRedirect:
|
|
1833
|
-
explorerUrl:
|
|
2052
|
+
bgImage: u,
|
|
2053
|
+
borderColor: m,
|
|
2054
|
+
borderRadius: i,
|
|
2055
|
+
showFlowToggle: o = !0,
|
|
2056
|
+
autoRedirect: d = !1,
|
|
2057
|
+
explorerUrl: h,
|
|
1834
2058
|
doneButtonText: f = "Done",
|
|
1835
2059
|
supportEmail: x,
|
|
1836
2060
|
onDone: g
|
|
1837
2061
|
}) {
|
|
1838
|
-
var
|
|
2062
|
+
var ze, qe, et, tt, at, nt, rt, ot;
|
|
1839
2063
|
const {
|
|
1840
|
-
state:
|
|
2064
|
+
state: p,
|
|
1841
2065
|
dispatch: b,
|
|
1842
|
-
config:
|
|
1843
|
-
configLoading:
|
|
1844
|
-
quotes:
|
|
2066
|
+
config: S,
|
|
2067
|
+
configLoading: P,
|
|
2068
|
+
quotes: w,
|
|
1845
2069
|
quotesLoading: G,
|
|
1846
|
-
quotesError:
|
|
1847
|
-
fetchQuotes:
|
|
1848
|
-
createOrder:
|
|
1849
|
-
orderLoading:
|
|
1850
|
-
amountError:
|
|
1851
|
-
fieldLocks:
|
|
1852
|
-
apiConfig:
|
|
1853
|
-
assetBaseUrl:
|
|
1854
|
-
} =
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
}, [a]),
|
|
1858
|
-
const y = setTimeout(() =>
|
|
2070
|
+
quotesError: Q,
|
|
2071
|
+
fetchQuotes: j,
|
|
2072
|
+
createOrder: z,
|
|
2073
|
+
orderLoading: c,
|
|
2074
|
+
amountError: O,
|
|
2075
|
+
fieldLocks: C,
|
|
2076
|
+
apiConfig: L,
|
|
2077
|
+
assetBaseUrl: K
|
|
2078
|
+
} = pe(), [X, $] = N(a === "dark"), [Ne, he] = N(n), [fe, Y] = N(null), [ye, ae] = N(!1), [Ce, se] = N(!1), [ce, be] = N(!1), [V, ne] = N(null), [re, Ee] = N(!0), [Ae, we] = N(!1), [q, ie] = N(!1), Oe = D(null), xe = D(), v = D(p.flowType);
|
|
2079
|
+
U(() => {
|
|
2080
|
+
$(a === "dark");
|
|
2081
|
+
}, [a]), U(() => {
|
|
2082
|
+
const y = setTimeout(() => Ee(!1), P ? 0 : 800);
|
|
1859
2083
|
return () => clearTimeout(y);
|
|
1860
|
-
}, [
|
|
1861
|
-
if (
|
|
1862
|
-
|
|
1863
|
-
const y = setTimeout(() =>
|
|
2084
|
+
}, [P]), U(() => {
|
|
2085
|
+
if (v.current !== p.flowType && !re) {
|
|
2086
|
+
v.current = p.flowType, we(!0), ae(!1), se(!1);
|
|
2087
|
+
const y = setTimeout(() => we(!1), 350);
|
|
1864
2088
|
return () => clearTimeout(y);
|
|
1865
2089
|
}
|
|
1866
|
-
|
|
1867
|
-
}, [
|
|
1868
|
-
const
|
|
1869
|
-
de && k &&
|
|
1870
|
-
const
|
|
1871
|
-
if (
|
|
1872
|
-
const y = R ?
|
|
2090
|
+
v.current = p.flowType;
|
|
2091
|
+
}, [p.flowType, re]);
|
|
2092
|
+
const E = p.flowType, R = E === "buy", k = p.cryptoCurrency || "BTC", T = p.fiatCurrency || "USD", H = R ? p.fiatAmount : p.cryptoAmount, W = Kt(H), de = (ze = w == null ? void 0 : w.bestQuote) != null && ze.exchangeRate ? parseFloat(w.bestQuote.exchangeRate) : null, Se = D(null);
|
|
2093
|
+
de && k && T && (Se.current = { rate: de, crypto: k, fiat: T });
|
|
2094
|
+
const gt = F(() => {
|
|
2095
|
+
if (w != null && w.bestQuote) {
|
|
2096
|
+
const y = R ? w.bestQuote.cryptoAmount : w.bestQuote.fiatAmount;
|
|
1873
2097
|
if (y) return y;
|
|
1874
2098
|
}
|
|
1875
2099
|
return "0";
|
|
1876
|
-
}, [
|
|
1877
|
-
var
|
|
1878
|
-
const y = de || ((
|
|
1879
|
-
return !y || !
|
|
1880
|
-
}, [k,
|
|
1881
|
-
|
|
1882
|
-
const y =
|
|
2100
|
+
}, [w, R]), vt = F(() => {
|
|
2101
|
+
var B, ee, Ue;
|
|
2102
|
+
const y = de || ((B = Se.current) == null ? void 0 : B.rate), A = de ? k : (ee = Se.current) == null ? void 0 : ee.crypto, I = de ? T : (Ue = Se.current) == null ? void 0 : Ue.fiat;
|
|
2103
|
+
return !y || !A || !I ? "" : `1 ${A} ≈ ${y.toFixed(2)} ${I}`;
|
|
2104
|
+
}, [k, T, de]);
|
|
2105
|
+
U(() => {
|
|
2106
|
+
const y = p.walletAddress.trim(), A = p.network;
|
|
1883
2107
|
if (!y || y.length < 10) {
|
|
1884
|
-
|
|
2108
|
+
ne(null), b({ type: "SET_WALLET_ERROR", message: "" });
|
|
1885
2109
|
return;
|
|
1886
2110
|
}
|
|
1887
|
-
return
|
|
1888
|
-
var
|
|
2111
|
+
return be(!0), ne(null), clearTimeout(xe.current), xe.current = setTimeout(async () => {
|
|
2112
|
+
var I, B, ee;
|
|
1889
2113
|
try {
|
|
1890
|
-
const
|
|
2114
|
+
const De = await (await fetch(`${L.apiUrl}/public/validate/address`, {
|
|
1891
2115
|
method: "POST",
|
|
1892
2116
|
headers: { "Content-Type": "application/json" },
|
|
1893
|
-
body: JSON.stringify({ address: y, ...
|
|
1894
|
-
})).json(),
|
|
1895
|
-
if (
|
|
1896
|
-
|
|
2117
|
+
body: JSON.stringify({ address: y, ...A ? { network: A } : {} })
|
|
2118
|
+
})).json(), Fe = ((I = De.data) == null ? void 0 : I.attributes) || De.data || De;
|
|
2119
|
+
if (Fe.isValid)
|
|
2120
|
+
ne(!0), b({ type: "SET_WALLET_ERROR", message: "" });
|
|
1897
2121
|
else {
|
|
1898
|
-
|
|
1899
|
-
const
|
|
1900
|
-
b({ type: "SET_WALLET_ERROR", message:
|
|
2122
|
+
ne(!1);
|
|
2123
|
+
const Tt = ((B = Fe.errors) == null ? void 0 : B[0]) || ((ee = Fe.details) == null ? void 0 : ee.formatMessage) || "Invalid wallet address";
|
|
2124
|
+
b({ type: "SET_WALLET_ERROR", message: Tt });
|
|
1901
2125
|
}
|
|
1902
2126
|
} catch {
|
|
1903
|
-
|
|
2127
|
+
ne(null);
|
|
1904
2128
|
} finally {
|
|
1905
|
-
|
|
2129
|
+
be(!1);
|
|
1906
2130
|
}
|
|
1907
2131
|
}, 500), () => clearTimeout(xe.current);
|
|
1908
|
-
}, [
|
|
1909
|
-
const
|
|
1910
|
-
let
|
|
1911
|
-
const
|
|
1912
|
-
|
|
1913
|
-
},
|
|
1914
|
-
y !==
|
|
1915
|
-
},
|
|
2132
|
+
}, [p.walletAddress, p.network, L.apiUrl]);
|
|
2133
|
+
const Ge = !H || W === 0, je = W > 0 && (R ? W < dt : W < ut), Ye = !!O || je || ye && Ge, Nt = W > 0 && !O && !je, Pe = p.walletAddress.trim().length >= 10 && V !== !1 && !ce, Te = Nt && Pe && !!p.cryptoCurrency && !!p.network, Ct = (y) => {
|
|
2134
|
+
let A = y.target.value.replace(/[^0-9.,]/g, "");
|
|
2135
|
+
const I = R ? 2 : 6, B = A.indexOf(".");
|
|
2136
|
+
B !== -1 && A.length - B - 1 > I && (A = A.slice(0, B + I + 1)), b(R ? { type: "SET_FIAT_AMOUNT", amount: A } : { type: "SET_CRYPTO_AMOUNT", amount: A });
|
|
2137
|
+
}, Ve = (y) => {
|
|
2138
|
+
y !== E && b({ type: "SET_FLOW_TYPE", flowType: y });
|
|
2139
|
+
}, bt = _(
|
|
1916
2140
|
(y) => {
|
|
1917
2141
|
b({ type: "SET_FIAT_CURRENCY", currency: y });
|
|
1918
2142
|
},
|
|
1919
2143
|
[b]
|
|
1920
|
-
),
|
|
1921
|
-
(y,
|
|
1922
|
-
b({ type: "SET_CRYPTO_CURRENCY", currency: y }), b({ type: "SET_CRYPTO_CHAIN", chain:
|
|
2144
|
+
), Et = _(
|
|
2145
|
+
(y, A) => {
|
|
2146
|
+
b({ type: "SET_CRYPTO_CURRENCY", currency: y }), b({ type: "SET_CRYPTO_CHAIN", chain: A });
|
|
1923
2147
|
},
|
|
1924
2148
|
[b]
|
|
1925
|
-
),
|
|
1926
|
-
|
|
2149
|
+
), At = _(
|
|
2150
|
+
(y) => {
|
|
2151
|
+
b({ type: "SET_PAYMENT_METHOD", methodId: y });
|
|
2152
|
+
},
|
|
2153
|
+
[b]
|
|
2154
|
+
), wt = () => {
|
|
2155
|
+
Te && (ie(!0), j());
|
|
1927
2156
|
};
|
|
1928
|
-
|
|
2157
|
+
U(() => {
|
|
1929
2158
|
var y;
|
|
1930
|
-
if (!(!
|
|
1931
|
-
if (
|
|
1932
|
-
ie(!1), b({ type: "SELECT_QUOTE", quote:
|
|
2159
|
+
if (!(!q || G)) {
|
|
2160
|
+
if (w != null && w.bestQuote)
|
|
2161
|
+
ie(!1), b({ type: "SELECT_QUOTE", quote: w.bestQuote }), z().catch(() => {
|
|
1933
2162
|
});
|
|
1934
|
-
else if (
|
|
1935
|
-
ie(!1), b({ type: "SET_ERROR", message:
|
|
1936
|
-
else if (
|
|
2163
|
+
else if (Q)
|
|
2164
|
+
ie(!1), b({ type: "SET_ERROR", message: Q.message || "No quotes available" });
|
|
2165
|
+
else if (w && !w.bestQuote) {
|
|
1937
2166
|
ie(!1);
|
|
1938
|
-
const
|
|
1939
|
-
b({ type: "SET_ERROR", message:
|
|
2167
|
+
const A = (y = w.unavailableGateways) == null ? void 0 : y.map((B) => B.reason).filter(Boolean), I = A != null && A.length ? `No providers available: ${A.join("; ")}` : "No providers available for this currency/network combination";
|
|
2168
|
+
b({ type: "SET_ERROR", message: I });
|
|
1940
2169
|
}
|
|
1941
2170
|
}
|
|
1942
|
-
}, [
|
|
1943
|
-
const
|
|
1944
|
-
"--t-accent":
|
|
1945
|
-
"--t-cta-bg":
|
|
1946
|
-
"--t-cta-text":
|
|
2171
|
+
}, [q, w, G, Q, b, z]);
|
|
2172
|
+
const We = X ? "theme-dark" : "theme-light", He = ct.find((y) => y.id === Ne) || ct[0], St = He.accent === null, Qe = (s ? Ke(s) : !1) ? { "--t-accent": s, "--t-cta-bg": s, "--t-cta-text": "#ffffff" } : St ? {
|
|
2173
|
+
"--t-accent": X ? "#ffffff" : "#111111",
|
|
2174
|
+
"--t-cta-bg": X ? "#ffffff" : "#111111",
|
|
2175
|
+
"--t-cta-text": X ? "#000000" : "#ffffff"
|
|
1947
2176
|
} : {
|
|
1948
|
-
"--t-accent":
|
|
1949
|
-
"--t-cta-bg":
|
|
2177
|
+
"--t-accent": He.accent,
|
|
2178
|
+
"--t-cta-bg": He.accent,
|
|
1950
2179
|
"--t-cta-text": "#ffffff"
|
|
1951
|
-
},
|
|
1952
|
-
r &&
|
|
1953
|
-
const
|
|
1954
|
-
|
|
1955
|
-
const
|
|
1956
|
-
if (
|
|
2180
|
+
}, oe = {};
|
|
2181
|
+
r && Ke(r) ? oe.backgroundColor = r : oe.backgroundColor = "var(--t-bg)", u && (oe.backgroundImage = `url(${u})`, oe.backgroundSize = "cover", oe.backgroundPosition = "center");
|
|
2182
|
+
const Re = {};
|
|
2183
|
+
m && Ke(m) && (Re.border = `1px solid ${m}`), i && (Re.borderRadius = i);
|
|
2184
|
+
const Ze = p.step === "checkout" ? /* @__PURE__ */ e(ta, { autoRedirect: d }) : p.step === "processing" ? /* @__PURE__ */ e(na, {}) : p.step === "complete" ? /* @__PURE__ */ e(ra, { explorerUrl: h, doneButtonText: f, onDone: g }) : p.step === "error" ? /* @__PURE__ */ e(oa, { supportEmail: x }) : p.step === "confirm" ? /* @__PURE__ */ e(la, {}) : null;
|
|
2185
|
+
if (Ze)
|
|
1957
2186
|
return /* @__PURE__ */ e(
|
|
1958
2187
|
"div",
|
|
1959
2188
|
{
|
|
1960
|
-
className: `${
|
|
2189
|
+
className: `${We} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
|
|
1961
2190
|
style: {
|
|
1962
2191
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
1963
|
-
...
|
|
1964
|
-
...
|
|
1965
|
-
...
|
|
2192
|
+
...oe,
|
|
2193
|
+
...Qe,
|
|
2194
|
+
...Re
|
|
1966
2195
|
},
|
|
1967
|
-
children:
|
|
2196
|
+
children: Ze
|
|
1968
2197
|
}
|
|
1969
2198
|
);
|
|
1970
|
-
const
|
|
1971
|
-
return /* @__PURE__ */
|
|
2199
|
+
const Z = p.network, ue = Z ? Ie[Z] : null, Je = (ue == null ? void 0 : ue.shortName) || (ue == null ? void 0 : ue.name) || Z;
|
|
2200
|
+
return /* @__PURE__ */ l(
|
|
1972
2201
|
"div",
|
|
1973
2202
|
{
|
|
1974
|
-
className: `${
|
|
2203
|
+
className: `${We} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
|
|
1975
2204
|
style: {
|
|
1976
2205
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
1977
|
-
...
|
|
1978
|
-
...
|
|
1979
|
-
...
|
|
2206
|
+
...oe,
|
|
2207
|
+
...Qe,
|
|
2208
|
+
...Re
|
|
1980
2209
|
},
|
|
1981
2210
|
children: [
|
|
1982
|
-
/* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${
|
|
1983
|
-
|
|
1984
|
-
/* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${o ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Qt, { onClick: () => Y("settings") }) }),
|
|
2212
|
+
o ? /* @__PURE__ */ l("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
|
|
2213
|
+
/* @__PURE__ */ l("div", { className: "flex", style: { width: 165 }, children: [
|
|
1985
2214
|
/* @__PURE__ */ e(
|
|
1986
2215
|
"button",
|
|
1987
2216
|
{
|
|
1988
|
-
onClick: () =>
|
|
2217
|
+
onClick: () => Ve("buy"),
|
|
1989
2218
|
className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
|
|
1990
|
-
style: { color:
|
|
2219
|
+
style: { color: E === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
|
|
1991
2220
|
children: "Buy"
|
|
1992
2221
|
}
|
|
1993
2222
|
),
|
|
1994
2223
|
/* @__PURE__ */ e(
|
|
1995
2224
|
"button",
|
|
1996
2225
|
{
|
|
1997
|
-
onClick: () =>
|
|
2226
|
+
onClick: () => Ve("sell"),
|
|
1998
2227
|
className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
|
|
1999
|
-
style: { color:
|
|
2228
|
+
style: { color: E === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
|
|
2000
2229
|
children: "Sell"
|
|
2001
2230
|
}
|
|
2002
2231
|
)
|
|
2003
2232
|
] }),
|
|
2004
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ l("div", { className: "relative", style: { width: 165, height: 1 }, children: [
|
|
2005
2234
|
/* @__PURE__ */ e("div", { className: "absolute inset-0", style: { background: "var(--t-divider)" } }),
|
|
2006
2235
|
/* @__PURE__ */ e(
|
|
2007
2236
|
"div",
|
|
@@ -2009,42 +2238,42 @@ function sa({
|
|
|
2009
2238
|
className: "absolute top-0 h-full transition-all duration-300 ease-in-out",
|
|
2010
2239
|
style: {
|
|
2011
2240
|
width: "50%",
|
|
2012
|
-
left:
|
|
2241
|
+
left: E === "buy" ? "0%" : "50%",
|
|
2013
2242
|
background: "var(--t-accent)"
|
|
2014
2243
|
}
|
|
2015
2244
|
}
|
|
2016
2245
|
)
|
|
2017
2246
|
] })
|
|
2018
2247
|
] }) : null,
|
|
2019
|
-
|
|
2020
|
-
/* @__PURE__ */
|
|
2248
|
+
re || Ae || P ? /* @__PURE__ */ e(ia, {}) : /* @__PURE__ */ l("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
|
|
2249
|
+
/* @__PURE__ */ l(
|
|
2021
2250
|
"div",
|
|
2022
2251
|
{
|
|
2023
2252
|
className: "px-[18px] pt-[14px] pb-[18px]",
|
|
2024
2253
|
style: {
|
|
2025
2254
|
background: "var(--t-surface)",
|
|
2026
2255
|
borderRadius: 5,
|
|
2027
|
-
border: ye &&
|
|
2256
|
+
border: ye && Ye ? "1px solid #EF4444" : "1px solid transparent"
|
|
2028
2257
|
},
|
|
2029
2258
|
children: [
|
|
2030
2259
|
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You spend" }),
|
|
2031
|
-
/* @__PURE__ */
|
|
2260
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
2032
2261
|
/* @__PURE__ */ e(
|
|
2033
2262
|
"input",
|
|
2034
2263
|
{
|
|
2035
|
-
ref:
|
|
2264
|
+
ref: Oe,
|
|
2036
2265
|
type: "text",
|
|
2037
|
-
value:
|
|
2038
|
-
onChange:
|
|
2039
|
-
onBlur: () =>
|
|
2266
|
+
value: H,
|
|
2267
|
+
onChange: Ct,
|
|
2268
|
+
onBlur: () => ae(!0),
|
|
2040
2269
|
placeholder: R ? "250" : "0.01",
|
|
2041
2270
|
className: "bg-transparent outline-none w-0 flex-1 mr-3",
|
|
2042
2271
|
style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px" },
|
|
2043
2272
|
inputMode: "decimal",
|
|
2044
|
-
disabled: !!((
|
|
2273
|
+
disabled: !!((qe = C == null ? void 0 : C.sourceAmount) != null && qe.locked)
|
|
2045
2274
|
}
|
|
2046
2275
|
),
|
|
2047
|
-
R ? /* @__PURE__ */
|
|
2276
|
+
R ? /* @__PURE__ */ l(
|
|
2048
2277
|
"button",
|
|
2049
2278
|
{
|
|
2050
2279
|
onClick: () => Y("fiat"),
|
|
@@ -2056,15 +2285,15 @@ function sa({
|
|
|
2056
2285
|
paddingLeft: 10,
|
|
2057
2286
|
paddingRight: 10
|
|
2058
2287
|
},
|
|
2059
|
-
disabled: !!((
|
|
2288
|
+
disabled: !!((et = C == null ? void 0 : C.sourceCurrency) != null && et.locked),
|
|
2060
2289
|
children: [
|
|
2061
|
-
/* @__PURE__ */ e(
|
|
2062
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2063
|
-
/* @__PURE__ */ e(
|
|
2290
|
+
/* @__PURE__ */ e(Xe, { currencyCode: T, size: 16, baseUrl: K }),
|
|
2291
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: T }),
|
|
2292
|
+
/* @__PURE__ */ e(ge, {})
|
|
2064
2293
|
]
|
|
2065
2294
|
}
|
|
2066
|
-
) : /* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
2295
|
+
) : /* @__PURE__ */ l("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
2296
|
+
/* @__PURE__ */ l(
|
|
2068
2297
|
"button",
|
|
2069
2298
|
{
|
|
2070
2299
|
onClick: () => Y("crypto"),
|
|
@@ -2076,35 +2305,35 @@ function sa({
|
|
|
2076
2305
|
paddingLeft: 10,
|
|
2077
2306
|
paddingRight: 10
|
|
2078
2307
|
},
|
|
2079
|
-
disabled: !!((
|
|
2308
|
+
disabled: !!((tt = C == null ? void 0 : C.destinationCurrency) != null && tt.locked),
|
|
2080
2309
|
children: [
|
|
2081
|
-
/* @__PURE__ */ e(
|
|
2310
|
+
/* @__PURE__ */ e(mt, { ticker: k, size: 16, baseUrl: K }),
|
|
2082
2311
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k }),
|
|
2083
|
-
/* @__PURE__ */ e(
|
|
2312
|
+
/* @__PURE__ */ e(ge, {})
|
|
2084
2313
|
]
|
|
2085
2314
|
}
|
|
2086
2315
|
),
|
|
2087
|
-
|
|
2316
|
+
Z && /* @__PURE__ */ l("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
|
|
2088
2317
|
/* @__PURE__ */ e(
|
|
2089
2318
|
"img",
|
|
2090
2319
|
{
|
|
2091
|
-
src:
|
|
2092
|
-
alt:
|
|
2320
|
+
src: _e(Z, K),
|
|
2321
|
+
alt: Z,
|
|
2093
2322
|
width: 14,
|
|
2094
2323
|
height: 14,
|
|
2095
2324
|
className: "rounded-full",
|
|
2096
2325
|
style: { width: 14, height: 14 }
|
|
2097
2326
|
}
|
|
2098
2327
|
),
|
|
2099
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children:
|
|
2328
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: Je })
|
|
2100
2329
|
] })
|
|
2101
2330
|
] })
|
|
2102
2331
|
] })
|
|
2103
2332
|
]
|
|
2104
2333
|
}
|
|
2105
2334
|
),
|
|
2106
|
-
ye &&
|
|
2107
|
-
/* @__PURE__ */
|
|
2335
|
+
ye && Ye && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: O || (Ge ? "Amount should be more than 0" : R ? `Minimum amount is ${dt} ${T}` : `Minimum amount is ${ut} ${k}`) }),
|
|
2336
|
+
/* @__PURE__ */ l(
|
|
2108
2337
|
"div",
|
|
2109
2338
|
{
|
|
2110
2339
|
className: "px-[18px] pt-[12px] pb-[14px]",
|
|
@@ -2118,18 +2347,18 @@ function sa({
|
|
|
2118
2347
|
},
|
|
2119
2348
|
children: [
|
|
2120
2349
|
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
|
|
2121
|
-
/* @__PURE__ */
|
|
2122
|
-
G ? /* @__PURE__ */ e(
|
|
2123
|
-
|
|
2350
|
+
/* @__PURE__ */ l("div", { className: "flex items-start justify-between", children: [
|
|
2351
|
+
G ? /* @__PURE__ */ e(M, { w: 180, h: 32 }) : /* @__PURE__ */ e(
|
|
2352
|
+
ca,
|
|
2124
2353
|
{
|
|
2125
|
-
value:
|
|
2354
|
+
value: W > 0 ? gt : "0",
|
|
2126
2355
|
height: 32,
|
|
2127
2356
|
className: "font-semibold",
|
|
2128
|
-
style: { color:
|
|
2357
|
+
style: { color: W > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
|
|
2129
2358
|
}
|
|
2130
2359
|
),
|
|
2131
|
-
R ? /* @__PURE__ */
|
|
2132
|
-
/* @__PURE__ */
|
|
2360
|
+
R ? /* @__PURE__ */ l("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
2361
|
+
/* @__PURE__ */ l(
|
|
2133
2362
|
"button",
|
|
2134
2363
|
{
|
|
2135
2364
|
onClick: () => Y("crypto"),
|
|
@@ -2141,29 +2370,29 @@ function sa({
|
|
|
2141
2370
|
paddingLeft: 10,
|
|
2142
2371
|
paddingRight: 10
|
|
2143
2372
|
},
|
|
2144
|
-
disabled: !!((
|
|
2373
|
+
disabled: !!((at = C == null ? void 0 : C.destinationCurrency) != null && at.locked),
|
|
2145
2374
|
children: [
|
|
2146
|
-
/* @__PURE__ */ e(
|
|
2375
|
+
/* @__PURE__ */ e(mt, { ticker: k, size: 16, baseUrl: K }),
|
|
2147
2376
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k }),
|
|
2148
|
-
/* @__PURE__ */ e(
|
|
2377
|
+
/* @__PURE__ */ e(ge, {})
|
|
2149
2378
|
]
|
|
2150
2379
|
}
|
|
2151
2380
|
),
|
|
2152
|
-
|
|
2381
|
+
Z && /* @__PURE__ */ l("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
|
|
2153
2382
|
/* @__PURE__ */ e(
|
|
2154
2383
|
"img",
|
|
2155
2384
|
{
|
|
2156
|
-
src:
|
|
2157
|
-
alt:
|
|
2385
|
+
src: _e(Z, K),
|
|
2386
|
+
alt: Z,
|
|
2158
2387
|
width: 14,
|
|
2159
2388
|
height: 14,
|
|
2160
2389
|
className: "rounded-full",
|
|
2161
2390
|
style: { width: 14, height: 14 }
|
|
2162
2391
|
}
|
|
2163
2392
|
),
|
|
2164
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children:
|
|
2393
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: Je })
|
|
2165
2394
|
] })
|
|
2166
|
-
] }) : /* @__PURE__ */
|
|
2395
|
+
] }) : /* @__PURE__ */ l(
|
|
2167
2396
|
"button",
|
|
2168
2397
|
{
|
|
2169
2398
|
onClick: () => Y("fiat"),
|
|
@@ -2175,11 +2404,11 @@ function sa({
|
|
|
2175
2404
|
paddingLeft: 10,
|
|
2176
2405
|
paddingRight: 10
|
|
2177
2406
|
},
|
|
2178
|
-
disabled: !!((
|
|
2407
|
+
disabled: !!((nt = C == null ? void 0 : C.sourceCurrency) != null && nt.locked),
|
|
2179
2408
|
children: [
|
|
2180
|
-
/* @__PURE__ */ e(
|
|
2181
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2182
|
-
/* @__PURE__ */ e(
|
|
2409
|
+
/* @__PURE__ */ e(Xe, { currencyCode: T, size: 16, baseUrl: K }),
|
|
2410
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: T }),
|
|
2411
|
+
/* @__PURE__ */ e(ge, {})
|
|
2183
2412
|
]
|
|
2184
2413
|
}
|
|
2185
2414
|
)
|
|
@@ -2191,100 +2420,112 @@ function sa({
|
|
|
2191
2420
|
"div",
|
|
2192
2421
|
{
|
|
2193
2422
|
className: "flex items-center justify-between mt-[2px] px-[18px] pt-[12px] pb-[14px]",
|
|
2194
|
-
style: {
|
|
2195
|
-
|
|
2423
|
+
style: {
|
|
2424
|
+
background: "var(--t-surface)",
|
|
2425
|
+
...(rt = S == null ? void 0 : S.paymentMethods) != null && rt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
|
|
2426
|
+
},
|
|
2427
|
+
children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: vt || " " })
|
|
2196
2428
|
}
|
|
2197
2429
|
),
|
|
2198
|
-
/* @__PURE__ */
|
|
2430
|
+
(S == null ? void 0 : S.paymentMethods) && S.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
|
|
2431
|
+
ea,
|
|
2432
|
+
{
|
|
2433
|
+
methods: S.paymentMethods,
|
|
2434
|
+
selectedId: p.paymentMethodId,
|
|
2435
|
+
onSelect: At,
|
|
2436
|
+
fiatCurrency: p.fiatCurrency
|
|
2437
|
+
}
|
|
2438
|
+
) }),
|
|
2439
|
+
/* @__PURE__ */ l("div", { className: "mt-8", children: [
|
|
2199
2440
|
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "Wallet address" }),
|
|
2200
2441
|
/* @__PURE__ */ e(
|
|
2201
2442
|
"input",
|
|
2202
2443
|
{
|
|
2203
2444
|
type: "text",
|
|
2204
|
-
value:
|
|
2445
|
+
value: p.walletAddress,
|
|
2205
2446
|
onChange: (y) => b({ type: "SET_WALLET_ADDRESS", address: y.target.value }),
|
|
2206
|
-
onBlur: () =>
|
|
2447
|
+
onBlur: () => se(!0),
|
|
2207
2448
|
placeholder: "Enter your wallet address",
|
|
2208
2449
|
spellCheck: !1,
|
|
2209
2450
|
autoComplete: "off",
|
|
2210
2451
|
className: "w-full bg-transparent text-[13px] outline-none transition-colors",
|
|
2211
2452
|
style: {
|
|
2212
|
-
border:
|
|
2453
|
+
border: p.walletError || Ce && !Pe ? "1px solid #EF4444" : "1px solid var(--t-border)",
|
|
2213
2454
|
borderRadius: 3.5,
|
|
2214
2455
|
height: 47,
|
|
2215
2456
|
paddingLeft: 14,
|
|
2216
2457
|
paddingRight: 14,
|
|
2217
2458
|
color: "var(--t-text)"
|
|
2218
2459
|
},
|
|
2219
|
-
disabled: !!((
|
|
2460
|
+
disabled: !!((ot = C == null ? void 0 : C.destinationAddress) != null && ot.locked)
|
|
2220
2461
|
}
|
|
2221
2462
|
),
|
|
2222
|
-
|
|
2463
|
+
p.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: p.walletError }) : Ce && !Pe && !ce ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : ce && p.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
|
|
2223
2464
|
] }),
|
|
2224
2465
|
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
2225
2466
|
/* @__PURE__ */ e(
|
|
2226
2467
|
"button",
|
|
2227
2468
|
{
|
|
2228
|
-
disabled: !
|
|
2229
|
-
onClick:
|
|
2469
|
+
disabled: !Te || c || q,
|
|
2470
|
+
onClick: wt,
|
|
2230
2471
|
className: "w-full font-semibold text-[16px] transition-all",
|
|
2231
2472
|
style: {
|
|
2232
2473
|
height: 60,
|
|
2233
2474
|
borderRadius: 5,
|
|
2234
2475
|
background: "var(--t-cta-bg)",
|
|
2235
2476
|
color: "var(--t-cta-text)",
|
|
2236
|
-
opacity:
|
|
2237
|
-
cursor:
|
|
2477
|
+
opacity: Te && !c && !q ? 1 : 0.4,
|
|
2478
|
+
cursor: Te && !c && !q ? "pointer" : "not-allowed"
|
|
2238
2479
|
},
|
|
2239
|
-
children:
|
|
2480
|
+
children: q ? "Getting best price..." : c ? "Processing..." : R ? `Buy ${k}` : `Sell ${k}`
|
|
2240
2481
|
}
|
|
2241
2482
|
),
|
|
2242
2483
|
/* @__PURE__ */ e("div", { className: "text-center py-3", children: /* @__PURE__ */ e("span", { className: "text-[11px]", style: { color: "var(--t-text-tertiary)" }, children: "Powered by NowRamp" }) })
|
|
2243
|
-
] },
|
|
2244
|
-
/* @__PURE__ */ e(
|
|
2245
|
-
var
|
|
2484
|
+
] }, E),
|
|
2485
|
+
/* @__PURE__ */ e(Le, { isOpen: fe === "fiat", onClose: () => Y(null), children: (y) => {
|
|
2486
|
+
var A;
|
|
2246
2487
|
return /* @__PURE__ */ e(
|
|
2247
|
-
|
|
2488
|
+
da,
|
|
2248
2489
|
{
|
|
2249
2490
|
onClose: y,
|
|
2250
|
-
onSelect: (
|
|
2251
|
-
|
|
2491
|
+
onSelect: (I) => {
|
|
2492
|
+
bt(I), y();
|
|
2252
2493
|
},
|
|
2253
|
-
currencies: (
|
|
2254
|
-
assetBaseUrl:
|
|
2494
|
+
currencies: (A = S == null ? void 0 : S.fiats) == null ? void 0 : A.map((I) => ({ code: I.code, name: I.code })),
|
|
2495
|
+
assetBaseUrl: K
|
|
2255
2496
|
}
|
|
2256
2497
|
);
|
|
2257
2498
|
} }),
|
|
2258
|
-
/* @__PURE__ */ e(
|
|
2259
|
-
var
|
|
2499
|
+
/* @__PURE__ */ e(Le, { isOpen: fe === "crypto", onClose: () => Y(null), children: (y) => {
|
|
2500
|
+
var A;
|
|
2260
2501
|
return /* @__PURE__ */ e(
|
|
2261
|
-
|
|
2502
|
+
ua,
|
|
2262
2503
|
{
|
|
2263
2504
|
onClose: y,
|
|
2264
|
-
onSelect: (
|
|
2265
|
-
|
|
2505
|
+
onSelect: (I, B) => {
|
|
2506
|
+
Et(I, B), y();
|
|
2266
2507
|
},
|
|
2267
|
-
cryptos: (
|
|
2268
|
-
var
|
|
2508
|
+
cryptos: (A = S == null ? void 0 : S.cryptos) == null ? void 0 : A.map((I) => {
|
|
2509
|
+
var B;
|
|
2269
2510
|
return {
|
|
2270
|
-
code:
|
|
2271
|
-
name:
|
|
2272
|
-
networks: (
|
|
2511
|
+
code: I.code,
|
|
2512
|
+
name: I.code,
|
|
2513
|
+
networks: (B = I.networks) == null ? void 0 : B.map((ee) => ({ code: ee.id, name: ee.name }))
|
|
2273
2514
|
};
|
|
2274
2515
|
}),
|
|
2275
|
-
assetBaseUrl:
|
|
2516
|
+
assetBaseUrl: K
|
|
2276
2517
|
}
|
|
2277
2518
|
);
|
|
2278
2519
|
} }),
|
|
2279
|
-
/* @__PURE__ */ e(
|
|
2280
|
-
|
|
2520
|
+
/* @__PURE__ */ e(Le, { isOpen: fe === "settings", onClose: () => Y(null), children: (y) => /* @__PURE__ */ e(
|
|
2521
|
+
ha,
|
|
2281
2522
|
{
|
|
2282
2523
|
onClose: y,
|
|
2283
|
-
darkMode:
|
|
2284
|
-
onToggleDarkMode:
|
|
2285
|
-
skinId:
|
|
2286
|
-
onSelectSkin: (
|
|
2287
|
-
|
|
2524
|
+
darkMode: X,
|
|
2525
|
+
onToggleDarkMode: $,
|
|
2526
|
+
skinId: Ne,
|
|
2527
|
+
onSelectSkin: (A) => {
|
|
2528
|
+
he(A);
|
|
2288
2529
|
}
|
|
2289
2530
|
}
|
|
2290
2531
|
) })
|
|
@@ -2292,108 +2533,108 @@ function sa({
|
|
|
2292
2533
|
}
|
|
2293
2534
|
);
|
|
2294
2535
|
}
|
|
2295
|
-
function
|
|
2536
|
+
function ya({
|
|
2296
2537
|
projectId: t,
|
|
2297
2538
|
apiUrl: a,
|
|
2298
2539
|
assetBaseUrl: n,
|
|
2299
|
-
flowType:
|
|
2540
|
+
flowType: s,
|
|
2300
2541
|
customerId: r,
|
|
2301
|
-
defaultFiatCurrency:
|
|
2302
|
-
defaultCryptoCurrency:
|
|
2303
|
-
defaultNetwork:
|
|
2304
|
-
defaultFiatAmount:
|
|
2305
|
-
defaultCryptoAmount:
|
|
2306
|
-
defaultWalletAddress:
|
|
2542
|
+
defaultFiatCurrency: u,
|
|
2543
|
+
defaultCryptoCurrency: m,
|
|
2544
|
+
defaultNetwork: i,
|
|
2545
|
+
defaultFiatAmount: o,
|
|
2546
|
+
defaultCryptoAmount: d,
|
|
2547
|
+
defaultWalletAddress: h,
|
|
2307
2548
|
defaultGateway: f,
|
|
2308
2549
|
fieldLocks: x,
|
|
2309
2550
|
statusPollInterval: g,
|
|
2310
|
-
onComplete:
|
|
2551
|
+
onComplete: p,
|
|
2311
2552
|
onError: b,
|
|
2312
|
-
className:
|
|
2313
|
-
theme:
|
|
2314
|
-
skinId:
|
|
2553
|
+
className: S,
|
|
2554
|
+
theme: P,
|
|
2555
|
+
skinId: w,
|
|
2315
2556
|
accentColor: G,
|
|
2316
|
-
bgColor:
|
|
2317
|
-
bgImage:
|
|
2318
|
-
borderColor:
|
|
2319
|
-
borderRadius:
|
|
2320
|
-
showFlowToggle:
|
|
2321
|
-
autoRedirect:
|
|
2322
|
-
explorerUrl:
|
|
2323
|
-
doneButtonText:
|
|
2324
|
-
supportEmail:
|
|
2325
|
-
onDone:
|
|
2557
|
+
bgColor: Q,
|
|
2558
|
+
bgImage: j,
|
|
2559
|
+
borderColor: z,
|
|
2560
|
+
borderRadius: c,
|
|
2561
|
+
showFlowToggle: O,
|
|
2562
|
+
autoRedirect: C,
|
|
2563
|
+
explorerUrl: L,
|
|
2564
|
+
doneButtonText: K,
|
|
2565
|
+
supportEmail: X,
|
|
2566
|
+
onDone: $
|
|
2326
2567
|
}) {
|
|
2327
2568
|
return /* @__PURE__ */ e(
|
|
2328
|
-
|
|
2569
|
+
Ht,
|
|
2329
2570
|
{
|
|
2330
2571
|
projectId: t,
|
|
2331
2572
|
apiUrl: a,
|
|
2332
2573
|
assetBaseUrl: n,
|
|
2333
|
-
flowType:
|
|
2574
|
+
flowType: s,
|
|
2334
2575
|
customerId: r,
|
|
2335
|
-
defaultFiatCurrency:
|
|
2336
|
-
defaultCryptoCurrency:
|
|
2337
|
-
defaultNetwork:
|
|
2338
|
-
defaultFiatAmount:
|
|
2339
|
-
defaultCryptoAmount:
|
|
2340
|
-
defaultWalletAddress:
|
|
2576
|
+
defaultFiatCurrency: u,
|
|
2577
|
+
defaultCryptoCurrency: m,
|
|
2578
|
+
defaultNetwork: i,
|
|
2579
|
+
defaultFiatAmount: o,
|
|
2580
|
+
defaultCryptoAmount: d,
|
|
2581
|
+
defaultWalletAddress: h,
|
|
2341
2582
|
defaultGateway: f,
|
|
2342
2583
|
fieldLocks: x,
|
|
2343
2584
|
statusPollInterval: g,
|
|
2344
|
-
onComplete:
|
|
2585
|
+
onComplete: p,
|
|
2345
2586
|
onError: b,
|
|
2346
2587
|
children: /* @__PURE__ */ e(
|
|
2347
|
-
|
|
2588
|
+
fa,
|
|
2348
2589
|
{
|
|
2349
|
-
className:
|
|
2350
|
-
theme:
|
|
2351
|
-
skinId:
|
|
2590
|
+
className: S,
|
|
2591
|
+
theme: P,
|
|
2592
|
+
skinId: w,
|
|
2352
2593
|
accentColor: G,
|
|
2353
|
-
bgColor:
|
|
2354
|
-
bgImage:
|
|
2355
|
-
borderColor:
|
|
2356
|
-
borderRadius:
|
|
2357
|
-
showFlowToggle:
|
|
2358
|
-
autoRedirect:
|
|
2359
|
-
explorerUrl:
|
|
2360
|
-
doneButtonText:
|
|
2361
|
-
supportEmail:
|
|
2362
|
-
onDone:
|
|
2594
|
+
bgColor: Q,
|
|
2595
|
+
bgImage: j,
|
|
2596
|
+
borderColor: z,
|
|
2597
|
+
borderRadius: c,
|
|
2598
|
+
showFlowToggle: O,
|
|
2599
|
+
autoRedirect: C,
|
|
2600
|
+
explorerUrl: L,
|
|
2601
|
+
doneButtonText: K,
|
|
2602
|
+
supportEmail: X,
|
|
2603
|
+
onDone: $
|
|
2363
2604
|
}
|
|
2364
2605
|
)
|
|
2365
2606
|
}
|
|
2366
2607
|
);
|
|
2367
2608
|
}
|
|
2368
|
-
function
|
|
2609
|
+
function Ta({
|
|
2369
2610
|
submitButtonText: t,
|
|
2370
2611
|
rateRefreshInterval: a,
|
|
2371
2612
|
...n
|
|
2372
2613
|
}) {
|
|
2373
|
-
return /* @__PURE__ */ e(
|
|
2614
|
+
return /* @__PURE__ */ e(ya, { ...n });
|
|
2374
2615
|
}
|
|
2375
|
-
function
|
|
2616
|
+
function Ra({
|
|
2376
2617
|
skin: t,
|
|
2377
2618
|
active: a,
|
|
2378
2619
|
onClick: n,
|
|
2379
|
-
darkMode:
|
|
2620
|
+
darkMode: s,
|
|
2380
2621
|
dimmed: r
|
|
2381
2622
|
}) {
|
|
2382
|
-
const
|
|
2383
|
-
return /* @__PURE__ */
|
|
2623
|
+
const u = t.accent === null, m = 32;
|
|
2624
|
+
return /* @__PURE__ */ l(
|
|
2384
2625
|
"button",
|
|
2385
2626
|
{
|
|
2386
2627
|
onClick: n,
|
|
2387
2628
|
className: "relative shrink-0",
|
|
2388
|
-
style: { width:
|
|
2629
|
+
style: { width: m, height: m, opacity: r ? 0.4 : 1, transition: "opacity 0.2s" },
|
|
2389
2630
|
children: [
|
|
2390
|
-
|
|
2631
|
+
u ? /* @__PURE__ */ l("svg", { width: m, height: m, viewBox: "0 0 32 32", children: [
|
|
2391
2632
|
/* @__PURE__ */ e("clipPath", { id: "mono-left", children: /* @__PURE__ */ e("rect", { x: "0", y: "0", width: "16", height: "32" }) }),
|
|
2392
2633
|
/* @__PURE__ */ e("clipPath", { id: "mono-right", children: /* @__PURE__ */ e("rect", { x: "16", y: "0", width: "16", height: "32" }) }),
|
|
2393
2634
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#111111", clipPath: "url(#mono-left)" }),
|
|
2394
2635
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#ffffff", clipPath: "url(#mono-right)" }),
|
|
2395
|
-
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke:
|
|
2396
|
-
] }) : /* @__PURE__ */ e("svg", { width:
|
|
2636
|
+
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke: s ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.1)", strokeWidth: "1" })
|
|
2637
|
+
] }) : /* @__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 }) }),
|
|
2397
2638
|
a && !r && /* @__PURE__ */ e(
|
|
2398
2639
|
"div",
|
|
2399
2640
|
{
|
|
@@ -2405,13 +2646,13 @@ function ba({
|
|
|
2405
2646
|
}
|
|
2406
2647
|
);
|
|
2407
2648
|
}
|
|
2408
|
-
function
|
|
2409
|
-
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__ */
|
|
2649
|
+
function xa({ quote: t }) {
|
|
2650
|
+
return t.isBestRate ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Best price" }) : t.isRecommended ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Recommended" }) : t.rank && t.rank <= 3 ? /* @__PURE__ */ l("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: [
|
|
2410
2651
|
"#",
|
|
2411
2652
|
t.rank
|
|
2412
2653
|
] }) : null;
|
|
2413
2654
|
}
|
|
2414
|
-
function
|
|
2655
|
+
function ga({ quote: t }) {
|
|
2415
2656
|
return t.gatewayLogo ? /* @__PURE__ */ e(
|
|
2416
2657
|
"img",
|
|
2417
2658
|
{
|
|
@@ -2422,10 +2663,10 @@ function ua({ quote: t }) {
|
|
|
2422
2663
|
className: "rounded-full shrink-0",
|
|
2423
2664
|
style: { width: 36, height: 36 }
|
|
2424
2665
|
}
|
|
2425
|
-
) : /* @__PURE__ */ e(
|
|
2666
|
+
) : /* @__PURE__ */ e($e, { size: 36 });
|
|
2426
2667
|
}
|
|
2427
|
-
function
|
|
2428
|
-
return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */
|
|
2668
|
+
function va() {
|
|
2669
|
+
return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ l(
|
|
2429
2670
|
"div",
|
|
2430
2671
|
{
|
|
2431
2672
|
className: "w-full flex items-center gap-3.5",
|
|
@@ -2437,34 +2678,34 @@ function ma() {
|
|
|
2437
2678
|
background: "var(--t-surface)"
|
|
2438
2679
|
},
|
|
2439
2680
|
children: [
|
|
2440
|
-
/* @__PURE__ */ e(
|
|
2441
|
-
/* @__PURE__ */
|
|
2442
|
-
/* @__PURE__ */ e(
|
|
2443
|
-
/* @__PURE__ */ e(
|
|
2681
|
+
/* @__PURE__ */ e(M, { w: 36, h: 36, className: "rounded-full shrink-0" }),
|
|
2682
|
+
/* @__PURE__ */ l("div", { className: "flex-1", children: [
|
|
2683
|
+
/* @__PURE__ */ e(M, { w: 90, h: 14, className: "mb-1.5" }),
|
|
2684
|
+
/* @__PURE__ */ e(M, { w: 60, h: 12 })
|
|
2444
2685
|
] }),
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */ e(
|
|
2447
|
-
/* @__PURE__ */ e(
|
|
2686
|
+
/* @__PURE__ */ l("div", { className: "text-right", children: [
|
|
2687
|
+
/* @__PURE__ */ e(M, { w: 40, h: 10, className: "mb-1.5" }),
|
|
2688
|
+
/* @__PURE__ */ e(M, { w: 80, h: 14 })
|
|
2448
2689
|
] })
|
|
2449
2690
|
]
|
|
2450
2691
|
},
|
|
2451
2692
|
t
|
|
2452
2693
|
)) });
|
|
2453
2694
|
}
|
|
2454
|
-
function
|
|
2695
|
+
function ka({
|
|
2455
2696
|
onClose: t,
|
|
2456
2697
|
onSelect: a,
|
|
2457
2698
|
quotes: n,
|
|
2458
|
-
quotesLoading:
|
|
2699
|
+
quotesLoading: s,
|
|
2459
2700
|
cryptoCurrency: r
|
|
2460
2701
|
}) {
|
|
2461
|
-
const [
|
|
2702
|
+
const [u, m] = N(""), i = F(() => {
|
|
2462
2703
|
if (!(n != null && n.quotes)) return [];
|
|
2463
|
-
const
|
|
2464
|
-
return
|
|
2465
|
-
}, [n,
|
|
2466
|
-
return /* @__PURE__ */
|
|
2467
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2704
|
+
const o = u.trim().toLowerCase();
|
|
2705
|
+
return o ? n.quotes.filter((d) => d.gatewayName.toLowerCase().includes(o)) : n.quotes;
|
|
2706
|
+
}, [n, u]);
|
|
2707
|
+
return /* @__PURE__ */ l(J, { children: [
|
|
2708
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
|
|
2468
2709
|
/* @__PURE__ */ e(
|
|
2469
2710
|
"h2",
|
|
2470
2711
|
{
|
|
@@ -2473,32 +2714,32 @@ function Ea({
|
|
|
2473
2714
|
children: "Choose Ramp"
|
|
2474
2715
|
}
|
|
2475
2716
|
),
|
|
2476
|
-
/* @__PURE__ */ e(
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
|
|
2479
|
-
const
|
|
2480
|
-
return /* @__PURE__ */
|
|
2717
|
+
/* @__PURE__ */ e(Be, { value: u, onChange: m }),
|
|
2718
|
+
/* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
|
|
2719
|
+
s ? /* @__PURE__ */ e(va, {}) : i.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: n && n.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : i.map((o, d) => {
|
|
2720
|
+
const h = d === 0, f = parseFloat(o.cryptoAmount), x = f >= 1 ? f.toFixed(4) : f.toPrecision(6);
|
|
2721
|
+
return /* @__PURE__ */ l(
|
|
2481
2722
|
"button",
|
|
2482
2723
|
{
|
|
2483
|
-
onClick: () => a(
|
|
2724
|
+
onClick: () => a(o),
|
|
2484
2725
|
className: "w-full flex items-center gap-3.5 transition-colors",
|
|
2485
2726
|
style: {
|
|
2486
|
-
borderRadius:
|
|
2487
|
-
height:
|
|
2727
|
+
borderRadius: h ? 4.5 : 5,
|
|
2728
|
+
height: h ? 63 : 64,
|
|
2488
2729
|
paddingLeft: 16,
|
|
2489
2730
|
paddingRight: 16,
|
|
2490
|
-
border:
|
|
2491
|
-
background:
|
|
2731
|
+
border: h ? "1px solid var(--t-border)" : "1px solid transparent",
|
|
2732
|
+
background: h ? "transparent" : "var(--t-surface)"
|
|
2492
2733
|
},
|
|
2493
2734
|
children: [
|
|
2494
|
-
/* @__PURE__ */ e(
|
|
2495
|
-
/* @__PURE__ */
|
|
2496
|
-
/* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children:
|
|
2497
|
-
/* @__PURE__ */ e(
|
|
2735
|
+
/* @__PURE__ */ e(ga, { quote: o }),
|
|
2736
|
+
/* @__PURE__ */ l("div", { className: "text-left flex-1 min-w-0", children: [
|
|
2737
|
+
/* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: o.gatewayName }),
|
|
2738
|
+
/* @__PURE__ */ e(xa, { quote: o })
|
|
2498
2739
|
] }),
|
|
2499
|
-
/* @__PURE__ */
|
|
2740
|
+
/* @__PURE__ */ l("div", { className: "text-right shrink-0", children: [
|
|
2500
2741
|
/* @__PURE__ */ e("div", { className: "text-[11px]", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
|
|
2501
|
-
/* @__PURE__ */
|
|
2742
|
+
/* @__PURE__ */ l("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
|
|
2502
2743
|
r,
|
|
2503
2744
|
" ",
|
|
2504
2745
|
x
|
|
@@ -2506,78 +2747,79 @@ function Ea({
|
|
|
2506
2747
|
] })
|
|
2507
2748
|
]
|
|
2508
2749
|
},
|
|
2509
|
-
|
|
2750
|
+
o.gatewayId
|
|
2510
2751
|
);
|
|
2511
2752
|
}),
|
|
2512
|
-
!
|
|
2753
|
+
!s && (n == null ? void 0 : n.unavailableGateways) && n.unavailableGateways.length > 0 && /* @__PURE__ */ e("div", { className: "pt-3", children: n.unavailableGateways.map((o) => /* @__PURE__ */ l(
|
|
2513
2754
|
"div",
|
|
2514
2755
|
{
|
|
2515
2756
|
className: "flex items-center justify-between py-2 text-[12px]",
|
|
2516
2757
|
style: { color: "var(--t-text-muted)" },
|
|
2517
2758
|
children: [
|
|
2518
|
-
/* @__PURE__ */ e("span", { children:
|
|
2519
|
-
/* @__PURE__ */ e("span", { children:
|
|
2759
|
+
/* @__PURE__ */ e("span", { children: o.gatewayName }),
|
|
2760
|
+
/* @__PURE__ */ e("span", { children: o.reason })
|
|
2520
2761
|
]
|
|
2521
2762
|
},
|
|
2522
|
-
|
|
2763
|
+
o.gatewayId
|
|
2523
2764
|
)) })
|
|
2524
2765
|
] })
|
|
2525
2766
|
] });
|
|
2526
2767
|
}
|
|
2527
2768
|
export {
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2769
|
+
sa as AnimatedDigit,
|
|
2770
|
+
ca as AnimatedNumber,
|
|
2771
|
+
Gt as ApplePayIcon,
|
|
2772
|
+
Ie as BLOCKCHAINS,
|
|
2773
|
+
Xt as BankIcon,
|
|
2774
|
+
_t as CRYPTO_CHAIN_COMBOS,
|
|
2775
|
+
Ut as CRYPTO_CURRENCIES,
|
|
2776
|
+
Vt as CardIcon,
|
|
2777
|
+
Ta as CheckoutForm,
|
|
2778
|
+
ta as CheckoutStep,
|
|
2779
|
+
ge as ChevronDown,
|
|
2780
|
+
Wt as ChevronRight,
|
|
2781
|
+
ka as ChooseRampModal,
|
|
2782
|
+
ve as CloseButton,
|
|
2783
|
+
Sa as CoinifyIcon,
|
|
2784
|
+
ra as CompleteStep,
|
|
2785
|
+
la as ConfirmStep,
|
|
2786
|
+
ua as CryptoCurrencyModal,
|
|
2787
|
+
mt as CryptoIcon,
|
|
2788
|
+
Zt as DarkModeIcon,
|
|
2789
|
+
oa as ErrorStep,
|
|
2790
|
+
st as FIAT_CURRENCIES,
|
|
2791
|
+
Dt as FIAT_TO_COUNTRY,
|
|
2792
|
+
da as FiatCurrencyModal,
|
|
2793
|
+
Xe as FiatFlag,
|
|
2794
|
+
ia as FormSkeleton,
|
|
2795
|
+
$e as GenericCoinIcon,
|
|
2796
|
+
jt as GooglePayIcon,
|
|
2797
|
+
it as MOCK_RATES,
|
|
2798
|
+
Qt as MenuIcon,
|
|
2799
|
+
Le as Modal,
|
|
2800
|
+
Yt as PayPalIcon,
|
|
2801
|
+
ea as PaymentMethodSelector,
|
|
2802
|
+
na as ProcessingStep,
|
|
2803
|
+
ya as RampForm,
|
|
2804
|
+
Ht as RampProvider,
|
|
2805
|
+
$t as RevolutIcon,
|
|
2564
2806
|
ct as SKINS,
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2807
|
+
Be as SearchInput,
|
|
2808
|
+
ha as SettingsScreen,
|
|
2809
|
+
M as Skeleton,
|
|
2810
|
+
Ra as SkinSwatch,
|
|
2811
|
+
ma as ToggleSwitch,
|
|
2812
|
+
wa as formatOutput,
|
|
2813
|
+
_e as getChainIconUrl,
|
|
2814
|
+
yt as getCryptoIconUrl,
|
|
2815
|
+
Ft as getFiatFlagUrl,
|
|
2816
|
+
Aa as getMockRate,
|
|
2817
|
+
Jt as getPaymentIcon,
|
|
2818
|
+
Kt as parseAmount,
|
|
2819
|
+
Bt as useCheckoutIntent,
|
|
2820
|
+
Mt as useQuotes,
|
|
2821
|
+
pe as useRamp,
|
|
2822
|
+
It as useRampConfig,
|
|
2823
|
+
Ot as useTransaction
|
|
2582
2824
|
};
|
|
2583
2825
|
//# sourceMappingURL=index.js.map
|