@blockend/widget 1.0.53 → 1.0.55-beta.1
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/{AllRoutes-D7SQ_djS.js → AllRoutes-D6S-NFxZ.js} +9 -9
- package/dist/{Box-eYBli8DE.js → Box-DESo1bHm.js} +6 -6
- package/dist/EstGas-Dy3XfCzY.js +1496 -0
- package/dist/{Grow-DIpP1jgy.js → Grow-DzEr7XrA.js} +2 -2
- package/dist/{InputComp-CqKp9s9s.js → InputComp-GcnDqx_s.js} +3 -3
- package/dist/{LoadRoute-U-YYy2K3.js → LoadRoute-BmUgvDid.js} +4 -4
- package/dist/{QuotesProgress-zqHV9NVn.js → QuotesProgress-E5JnUMS0.js} +1 -1
- package/dist/{SwapAsset-BELTzo8V.js → SwapAsset-MBXcdeBf.js} +1 -1
- package/dist/{Tooltip-DHYTtHrE.js → Tooltip-DSAJT2x7.js} +3 -3
- package/dist/TxnButton-Br8R19rF.js +215 -0
- package/dist/{add-BwIWDVOf.js → add-BryKCrpI.js} +1 -1
- package/dist/{all-wallets-BV7E6F_5.js → all-wallets-BMVOK2Ci.js} +1 -1
- package/dist/{app-store-YEMLMArP.js → app-store-3WurbJdI.js} +1 -1
- package/dist/{apple-CgQVpLw3.js → apple-eM872Ubz.js} +1 -1
- package/dist/{arrow-bottom-CRrVrT6a.js → arrow-bottom-HMc73fJ8.js} +1 -1
- package/dist/{arrow-bottom-circle-uSjT8Rwu.js → arrow-bottom-circle-B1N_R8Ux.js} +1 -1
- package/dist/{arrow-left-CCnLL3nn.js → arrow-left-Q7GAZkD7.js} +1 -1
- package/dist/{arrow-right-DlnbfdJg.js → arrow-right-ft3TcIM3.js} +1 -1
- package/dist/{arrow-top-D-LM7HS0.js → arrow-top-C2xmF6tK.js} +1 -1
- package/dist/{bank-a2jDISgY.js → bank-Bk-2ZR5E.js} +1 -1
- package/dist/{basic-BPGeEjKa.js → basic-CWrKgDAB.js} +3 -3
- package/dist/{browser-CkPcErHl.js → browser-BFB3TFfv.js} +1 -1
- package/dist/{card-D7wnivhY.js → card-DCx59si8.js} +1 -1
- package/dist/{ccip-CHcnnTPb.js → ccip-CXr08uP1.js} +16 -16
- package/dist/{checkmark-Cs2cMRQF.js → checkmark-BGsuJuhE.js} +1 -1
- package/dist/{checkmark-bold-CqH2C5X1.js → checkmark-bold-DvjIl-51.js} +1 -1
- package/dist/{chevron-bottom-DgUwkJku.js → chevron-bottom-DAEnG7QP.js} +1 -1
- package/dist/{chevron-left-BcVL0AJj.js → chevron-left-D33h2ppx.js} +1 -1
- package/dist/{chevron-right-B2gAVYyw.js → chevron-right-C8Z_feNK.js} +1 -1
- package/dist/{chevron-top-CbzTNOsN.js → chevron-top-DwDMd3p9.js} +1 -1
- package/dist/{chrome-store-ClqKW_b4.js → chrome-store-B7ZDs2Fj.js} +1 -1
- package/dist/{clock-CZ61HTR5.js → clock-DnELUxSR.js} +1 -1
- package/dist/{close-BK4LD1ho.js → close-Dnt29Pss.js} +1 -1
- package/dist/{coinPlaceholder-BV1cYtd2.js → coinPlaceholder-C09pzuXv.js} +1 -1
- package/dist/{compass-DBPni3SF.js → compass-D8ZY16nH.js} +1 -1
- package/dist/{copy-DtT5Ilfh.js → copy-DEh4RBKI.js} +1 -1
- package/dist/{core-DW1LfS8S.js → core-CgIQaiRa.js} +16 -17
- package/dist/{cursor-DFsOHbuU.js → cursor-BtzkAOER.js} +1 -1
- package/dist/{cursor-transparent-B1EDdNh4.js → cursor-transparent-B0nCflmb.js} +1 -1
- package/dist/{desktop-BSVZc50y.js → desktop-toTG92uH.js} +1 -1
- package/dist/{disconnect-viKgGwNY.js → disconnect-C97lbAtY.js} +1 -1
- package/dist/{discord-CbPDNoe9.js → discord-BNJ3JePY.js} +1 -1
- package/dist/{down-BdHOrfT4.js → down-BFx-Bg5Q.js} +2 -2
- package/dist/{etherscan-BzCPwNdI.js → etherscan-CK87TQMS.js} +1 -1
- package/dist/{exclamation-triangle-BLtYhryv.js → exclamation-triangle-LWnOk0uz.js} +1 -1
- package/dist/{extension-D51cnS_y.js → extension-5eIZU28A.js} +1 -1
- package/dist/{external-link-1EdliA4O.js → external-link-DDlCfigP.js} +1 -1
- package/dist/{facebook-CFlh7Dpj.js → facebook-1lTMXKeH.js} +1 -1
- package/dist/{farcaster-mcqUptUZ.js → farcaster-Di2TUKlZ.js} +1 -1
- package/dist/{filters-3wQB0cY5.js → filters-B_THnHaX.js} +1 -1
- package/dist/{getChainIds-BANkCOEE.js → getChainIds-CeLEUxe0.js} +69 -69
- package/dist/getCosmosAddress-B8s9Ycj4.js +6075 -0
- package/dist/{github-BZ6HjM3r.js → github-D5B1FE4K.js} +1 -1
- package/dist/{google-DDSxVvC_.js → google-C8_WSUfw.js} +1 -1
- package/dist/{hamburger-CzgucnXk.js → hamburger-BzMrQx9y.js} +5 -5
- package/dist/{help-circle-D5aDSl5K.js → help-circle-C-ZOzjAP.js} +1 -1
- package/dist/{id-CYNm8Iqt.js → id-BynpKmej.js} +1 -1
- package/dist/{image-CQMOZulk.js → image-BRYUh760.js} +1 -1
- package/dist/{index-C5kvo12a.js → index-A8ClQmZo.js} +1 -1
- package/dist/{index-3VdzF1gV.js → index-BFUVWgoD.js} +78 -78
- package/dist/{index-Df1lOqUE.js → index-BK0BZT6j.js} +2600 -2622
- package/dist/index-C5bv1F_u.js +48843 -0
- package/dist/{index-C1UDOLq9.js → index-CN6pVc2G.js} +233 -241
- package/dist/index-CZwuzz6v.js +6712 -0
- package/dist/{index-CEbOV6hy.js → index-DHYWnqST.js} +1 -1
- package/dist/{index-DMD0kcnG.js → index-Dnyeih-W.js} +884 -813
- package/dist/{index-DlGQW646.js → index-DpHhW0_2.js} +2 -2
- package/dist/{index-oTak4j0W.js → index-SkYFFVLL.js} +11 -11
- package/dist/index-krrwn6Pi.js +206 -0
- package/dist/{index.es-BhN1DTXX.js → index.es-DB9y_DEM.js} +1 -1
- package/dist/index.es-vIyUKt0W.js +13232 -0
- package/dist/index.es.js +3 -2
- package/dist/{info-jv27M7m3.js → info-DSQyHS8b.js} +1 -1
- package/dist/{info-circle-CUy7raCU.js → info-circle-BfpWcI4c.js} +1 -1
- package/dist/{lightbulb-Dg84wz9J.js → lightbulb-DEMYYsZd.js} +1 -1
- package/dist/{mail-BmvI1eEM.js → mail-DNZ2to_6.js} +1 -1
- package/dist/{mobile-nbT-f90s.js → mobile-qsyS8oMK.js} +1 -1
- package/dist/{more-D5N_--2B.js → more-CnBuKwll.js} +1 -1
- package/dist/{network-placeholder-Dqj58Jvo.js → network-placeholder-DhJITakA.js} +1 -1
- package/dist/{nftPlaceholder-CwRHJWFO.js → nftPlaceholder-DD3-Cc9U.js} +1 -1
- package/dist/{off-CbNfAER2.js → off-CBApAdDk.js} +1 -1
- package/dist/{play-store-S7vuVGZC.js → play-store-DDoeRc-b.js} +1 -1
- package/dist/{plus-Dm_WFpLs.js → plus-C3J-XWCn.js} +1 -1
- package/dist/{qr-code-C57hb-Nm.js → qr-code-CEoOYtHk.js} +1 -1
- package/dist/{recycle-horizontal-C5RQV_TS.js → recycle-horizontal-BHJ_s9Yx.js} +1 -1
- package/dist/{refresh-BkmZxxGf.js → refresh-CtzOoHls.js} +1 -1
- package/dist/{reown-logo-qD9cAPWZ.js → reown-logo-BOj4YDUQ.js} +1 -1
- package/dist/{search-REmhFYCv.js → search--Miza3A_.js} +1 -1
- package/dist/{send-BeT9MX93.js → send-Bhl1lz4j.js} +1 -1
- package/dist/{swapHorizontal-DOphmFlr.js → swapHorizontal-CCvKCngz.js} +1 -1
- package/dist/{swapHorizontalBold-AuZckFTe.js → swapHorizontalBold-B90V-dXL.js} +1 -1
- package/dist/{swapHorizontalMedium-O3G4LtoW.js → swapHorizontalMedium-CYjeHjnI.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-BTI3vDN8.js → swapHorizontalRoundedBold-DSMWeXdW.js} +1 -1
- package/dist/{swapVertical-C7PVGBzc.js → swapVertical-DOJUNIvk.js} +1 -1
- package/dist/{telegram-vQ5xN0Ac.js → telegram-CufEY_4d.js} +1 -1
- package/dist/{three-dots-Bfs9BhnJ.js → three-dots-J2ngva7G.js} +1 -1
- package/dist/{twitch-3OzmB49Y.js → twitch-B4vTKVf5.js} +1 -1
- package/dist/{twitterIcon-B5PBw26A.js → twitterIcon-DLrxpAGg.js} +1 -1
- package/dist/{unsupportedProp-CdKLbhlE.js → unsupportedProp-BLzY2-w_.js} +1 -1
- package/dist/{useRegisterError-DY4SqZO0.js → useRegisterError-Cf6oylnR.js} +1 -1
- package/dist/{verify-Rne5G5VT.js → verify-CbHqPQKs.js} +1 -1
- package/dist/{verify-filled-D7HTBXJf.js → verify-filled-CzKx9Cph.js} +1 -1
- package/dist/{w3m-modal-w8n6vImv.js → w3m-modal-DhpjK4cG.js} +2 -2
- package/dist/{wallet-a9Xlbfi8.js → wallet-CvIeO6On.js} +1 -1
- package/dist/{wallet-placeholder-BeGMf_JP.js → wallet-placeholder-BqELXTBj.js} +1 -1
- package/dist/{walletconnect-CnA6lXAN.js → walletconnect-BN4c4XQ5.js} +1 -1
- package/dist/{warning-circle-oQbNOUJk.js → warning-circle--dqxXujk.js} +1 -1
- package/dist/widget.css +1 -1
- package/dist/{x-0bdSPLtI.js → x-CkCp5gtL.js} +1 -1
- package/package.json +4 -2
- package/dist/EstGas-uPThONt-.js +0 -20281
- package/dist/TxnButton-CtczuoSf.js +0 -223
- package/dist/getCosmosAddress-BOA-n4al.js +0 -9566
- package/dist/index-B705NMZ_.js +0 -160
- package/dist/index-CmMHlKPv.js +0 -206
- package/dist/index-DTish3yr.js +0 -1014
- package/dist/index-DaSDqtx4.js +0 -30694
- package/dist/index.es-BjSHM6VO.js +0 -11678
@@ -1,7 +1,7 @@
|
|
1
|
-
import { b as G, g as U, p as P,
|
1
|
+
import { b as G, g as U, p as P, z as H, i as q, _ as J, d as u, s as W, e as M, f as d, h as K, r as Q, j as m, P as i } from "./index-C5bv1F_u.js";
|
2
2
|
import * as v from "react";
|
3
3
|
import { jsx as V, jsxs as X } from "react/jsx-runtime";
|
4
|
-
import { B as Y } from "./getChainIds-
|
4
|
+
import { B as Y } from "./getChainIds-CeLEUxe0.js";
|
5
5
|
function Z(o) {
|
6
6
|
return U("MuiButton", o);
|
7
7
|
}
|
@@ -1,22 +1,22 @@
|
|
1
1
|
import { jsx as u, jsxs as B, Fragment as Ke } from "react/jsx-runtime";
|
2
|
-
import { a as to, _ as yr, e as wr, T as no, g as vr, h as oo, b as ro, j as Gt, k as Sn, r as xr, B as Cr, u as ao, i as Dr, d as Sr } from "./useRegisterError-
|
3
|
-
import { P as Zt, i as kr, b as kn, F as so, u as We, f as Qt, L as Tt, O as Pr, c as Mr, I as Rr, S as Or, d as Tr, H as Ir } from "./hamburger-
|
4
|
-
import {
|
2
|
+
import { a as to, _ as yr, e as wr, T as no, g as vr, h as oo, b as ro, j as Gt, k as Sn, r as xr, B as Cr, u as ao, i as Dr, d as Sr } from "./useRegisterError-Cf6oylnR.js";
|
3
|
+
import { P as Zt, i as kr, b as kn, F as so, u as We, f as Qt, L as Tt, O as Pr, c as Mr, I as Rr, S as Or, d as Tr, H as Ir } from "./hamburger-BzMrQx9y.js";
|
4
|
+
import { q as Vr, t as Nr, v as Fr, p as ie, _ as te, d as f, P as t, b as Se, g as Me, i as Re, s as _, e as le, f as se, h as Oe, j as De, r as Er, w as Ar, x as ge, y as it, L as $r, u as Ce, c as Xt, S as Lr, l as Br } from "./index-C5bv1F_u.js";
|
5
5
|
import * as b from "react";
|
6
6
|
import Pn, { useState as Ye, useEffect as lt, useRef as jr } from "react";
|
7
7
|
import { useQuery as io, useQueryClient as zr, useInfiniteQuery as Wr } from "@tanstack/react-query";
|
8
8
|
import { useAccount as lo } from "wagmi";
|
9
9
|
import { useDynamicContext as co } from "@dynamic-labs/sdk-react-core";
|
10
10
|
import { useAccount as uo } from "graz";
|
11
|
-
import { T as Qe, S as _r } from "./index-
|
12
|
-
import { c as $e } from "./index-
|
13
|
-
import { B as wt, F as xt, M as qr, a as Hr, e as Ur, T as po, b as Yr } from "./getChainIds-
|
14
|
-
import { a as fo, b as Le, G as Kr, P as Gr } from "./Grow-
|
15
|
-
import { B as Pt, u as Zr } from "./index-
|
16
|
-
import { u as Qr } from "./unsupportedProp-
|
11
|
+
import { T as Qe, S as _r } from "./index-Dnyeih-W.js";
|
12
|
+
import { c as $e } from "./index-DHYWnqST.js";
|
13
|
+
import { B as wt, F as xt, M as qr, a as Hr, e as Ur, T as po, b as Yr } from "./getChainIds-CeLEUxe0.js";
|
14
|
+
import { a as fo, b as Le, G as Kr, P as Gr } from "./Grow-DzEr7XrA.js";
|
15
|
+
import { B as Pt, u as Zr } from "./index-DpHhW0_2.js";
|
16
|
+
import { u as Qr } from "./unsupportedProp-BLzY2-w_.js";
|
17
17
|
import { S as Xr } from "./shareicon-CG3v7iKI.js";
|
18
|
-
import { O as Mn } from "./index-
|
19
|
-
import { L as Jr } from "./index.es-
|
18
|
+
import { O as Mn } from "./index-A8ClQmZo.js";
|
19
|
+
import { L as Jr } from "./index.es-DB9y_DEM.js";
|
20
20
|
function ea(e) {
|
21
21
|
return e !== "ownerState" && e !== "theme" && e !== "sx" && e !== "as";
|
22
22
|
}
|
@@ -0,0 +1,206 @@
|
|
1
|
+
import { jsxs as c, jsx as r, Fragment as A } from "react/jsx-runtime";
|
2
|
+
import O, { useContext as J, useState as y, useEffect as g, useRef as K } from "react";
|
3
|
+
import { a as Q, e as V, T as W, H as X, b as F, c as Y, E as Z, d as R } from "./EstGas-Dy3XfCzY.js";
|
4
|
+
import { u as s, l as ee } from "./index-C5bv1F_u.js";
|
5
|
+
import { i as U, C as L, A as te } from "./useRegisterError-Cf6oylnR.js";
|
6
|
+
import { B as re } from "./Box-DESo1bHm.js";
|
7
|
+
function ne() {
|
8
|
+
var d, w, a, e, u, b, m, p, x, l, h, C, v, S;
|
9
|
+
const t = s((T) => T.persist), n = s((T) => T.configuration), { defaultCoin: i } = U;
|
10
|
+
let f = (a = (w = (d = t == null ? void 0 : t.route) == null ? void 0 : d.providerDetails) == null ? void 0 : w.logoUrl) != null && a.length ? (u = (e = t == null ? void 0 : t.route) == null ? void 0 : e.providerDetails) == null ? void 0 : u.logoUrl : i;
|
11
|
+
return ee.isEmpty(t.route) ? /* @__PURE__ */ r(A, {}) : /* @__PURE__ */ c("div", { className: "bw-relative bw-mt-4 bw-flex bw-justify-center ", children: [
|
12
|
+
/* @__PURE__ */ r(
|
13
|
+
"div",
|
14
|
+
{
|
15
|
+
style: {
|
16
|
+
boxShadow: n && n.customTheme && ((m = (b = n.customTheme) == null ? void 0 : b.shadow) == null ? void 0 : m.boxShadow) || "1px 1px 10px 3px rgba(0, 0, 0, 0.15)"
|
17
|
+
},
|
18
|
+
className: "bw-w-[200px] bw-rounded-[50%] bw-absolute bw-right-auto bw-z-0 bw-left-auto bw-h-[40px]"
|
19
|
+
}
|
20
|
+
),
|
21
|
+
/* @__PURE__ */ c("div", { className: "bw-flex bw-relative bw-bg-background-container bw-z-10 bw-mx-auto bw-h-[41px] bw-w-[70%] bw-border-[0.5px] bw-border-border-primary bw-border-r-0 bw-border-l-0 bw-items-center bw-gap-x-1", children: [
|
22
|
+
" ",
|
23
|
+
/* @__PURE__ */ c("p", { className: "bw-text-sm bw-w-full bw-text-center bw-flex bw-justify-center bw-items-center bw-font-normal bw-my-1 bw-text-text-primary", children: [
|
24
|
+
/* @__PURE__ */ r("span", { className: "bw-text-sm bw-font-light", children: "via" }),
|
25
|
+
" ",
|
26
|
+
/* @__PURE__ */ r("img", { src: f, className: "bw-rounded-[50%] bw-mx-[4px] bw-min-w-[18px] bw-max-h-[18px] bw-min-h-[18px]", width: 18, height: 18 }),
|
27
|
+
((x = (p = t == null ? void 0 : t.route) == null ? void 0 : p.providerDetails) == null ? void 0 : x.name) || "",
|
28
|
+
": ",
|
29
|
+
(l = t == null ? void 0 : t.route) == null ? void 0 : l.protocolsUsed[0],
|
30
|
+
((C = (h = t == null ? void 0 : t.route) == null ? void 0 : h.protocolsUsed) == null ? void 0 : C.length) <= 1 ? "" : /* @__PURE__ */ c("span", { className: "bw-ml-1 bw-text-xs bw-font-normal bw-leading-6", children: [
|
31
|
+
`+${((S = (v = t == null ? void 0 : t.route) == null ? void 0 : v.protocolsUsed) == null ? void 0 : S.length) - 1}`,
|
32
|
+
" More"
|
33
|
+
] }),
|
34
|
+
" "
|
35
|
+
] }),
|
36
|
+
" "
|
37
|
+
] })
|
38
|
+
] });
|
39
|
+
}
|
40
|
+
let E;
|
41
|
+
function oe() {
|
42
|
+
var u, b, m, p, x;
|
43
|
+
const t = s((l) => l.configuration), n = s((l) => l.persist), i = s((l) => l.setPersist), { isErrorMessage: f } = J(Q), d = Math.floor(((/* @__PURE__ */ new Date()).getTime() - n.quoteStartTime) / 1e3);
|
44
|
+
let w = ((u = n == null ? void 0 : n.route) == null ? void 0 : u.deadline) || 60;
|
45
|
+
const [a, e] = y(w);
|
46
|
+
return g(() => {
|
47
|
+
d && e(w - d);
|
48
|
+
}, []), g(() => (E = setInterval(() => {
|
49
|
+
e((l) => {
|
50
|
+
var h;
|
51
|
+
return l <= 0 ? (clearInterval(E), i({
|
52
|
+
...(h = s.getState()) == null ? void 0 : h.persist,
|
53
|
+
isQuoteTimer: !1,
|
54
|
+
showAcceptQuote: !0,
|
55
|
+
quoteStartTime: (/* @__PURE__ */ new Date()).getTime()
|
56
|
+
}), 0) : l - 1;
|
57
|
+
});
|
58
|
+
}, 1e3), () => clearInterval(E)), []), g(() => {
|
59
|
+
(f || !n.isQuoteTimer) && clearInterval(E);
|
60
|
+
}, [f, n.isQuoteTimer]), !(n != null && n.hash) && n.quote === "enable" ? /* @__PURE__ */ c("div", { className: "bw-absolute bw-top-0 bw-right-0 ", children: [
|
61
|
+
/* @__PURE__ */ r("svg", { className: "bw-absolute bw-w-[20px] bw-h-[20px]", children: /* @__PURE__ */ c("linearGradient", { id: "linearColors", x1: "0", y1: "0", x2: "1", y2: "1", children: [
|
62
|
+
/* @__PURE__ */ r("stop", { offset: "1%", stopColor: (b = t == null ? void 0 : t.gradientStyle) != null && b.spinnerColor ? (m = t == null ? void 0 : t.gradientStyle) == null ? void 0 : m.spinnerColor : "#A45EFF" }),
|
63
|
+
/* @__PURE__ */ r("stop", { offset: "90%", stopColor: (p = t == null ? void 0 : t.gradientStyle) != null && p.spinnerColor ? (x = t == null ? void 0 : t.gradientStyle) == null ? void 0 : x.stopColor : "#2CFFE4" })
|
64
|
+
] }) }),
|
65
|
+
/* @__PURE__ */ c(
|
66
|
+
re,
|
67
|
+
{
|
68
|
+
sx: {
|
69
|
+
position: "relative",
|
70
|
+
display: "inline-flex"
|
71
|
+
},
|
72
|
+
children: [
|
73
|
+
/* @__PURE__ */ r(
|
74
|
+
L,
|
75
|
+
{
|
76
|
+
variant: "determinate",
|
77
|
+
sx: {
|
78
|
+
color: "var(--tw-border-primary)"
|
79
|
+
},
|
80
|
+
size: 20,
|
81
|
+
thickness: 2,
|
82
|
+
value: 100
|
83
|
+
}
|
84
|
+
),
|
85
|
+
/* @__PURE__ */ r(
|
86
|
+
L,
|
87
|
+
{
|
88
|
+
variant: "determinate",
|
89
|
+
size: 20,
|
90
|
+
thickness: 5,
|
91
|
+
value: a / w * 100,
|
92
|
+
sx: {
|
93
|
+
"svg circle": { stroke: "url(#linearColors)" },
|
94
|
+
position: "absolute",
|
95
|
+
left: 0,
|
96
|
+
[`& .${te.circle}`]: {
|
97
|
+
strokeLinecap: "round"
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
)
|
102
|
+
]
|
103
|
+
}
|
104
|
+
)
|
105
|
+
] }) : /* @__PURE__ */ r(A, {});
|
106
|
+
}
|
107
|
+
const ae = O.memo(function({ handleOpenExchange: t, amount: n, route: i, resetAmount: f, resetBalance: d, setExchange: w }) {
|
108
|
+
var k, D;
|
109
|
+
const a = s((o) => o.setPersist), e = s((o) => o.persist), u = s((o) => o.fromChain), b = s((o) => o.fromCoin), m = s((o) => o.toChain), p = s((o) => o.toCoin), [x, l] = y(!1), [h, C] = y(!1), [v, S] = y(!1), [T, q] = y({}), B = !e.stepData, { txnupdate: G, refunded: H } = U;
|
110
|
+
g(() => {
|
111
|
+
var o, j, M, z;
|
112
|
+
i != null && i.routeId && a({
|
113
|
+
...(o = s.getState()) == null ? void 0 : o.persist,
|
114
|
+
routeId: i == null ? void 0 : i.routeId,
|
115
|
+
route: i,
|
116
|
+
toChain: m,
|
117
|
+
toCoin: p,
|
118
|
+
fromChain: u,
|
119
|
+
fromCoin: b,
|
120
|
+
amount: n,
|
121
|
+
quote: "enable",
|
122
|
+
openAt: (/* @__PURE__ */ new Date()).getTime(),
|
123
|
+
startTime: ((z = (M = (j = s) == null ? void 0 : j.getState()) == null ? void 0 : M.persist) == null ? void 0 : z.startTime) || (/* @__PURE__ */ new Date()).getTime()
|
124
|
+
});
|
125
|
+
}, [i]);
|
126
|
+
function I(o) {
|
127
|
+
l(o);
|
128
|
+
}
|
129
|
+
function N() {
|
130
|
+
((e == null ? void 0 : e.openAt) + 60 * 60 * 1e3 - (/* @__PURE__ */ new Date()).getTime()) / 1e3 / 60 <= 0 && document.visibilityState === "visible" && (a({ allSteps: { steps: null, currentStep: 0 }, stepData: {} }), t(), f());
|
131
|
+
}
|
132
|
+
g(() => (e != null && e.openAt && window.addEventListener("visibilitychange", N), () => {
|
133
|
+
window.removeEventListener("visibilitychange", N);
|
134
|
+
}), [e == null ? void 0 : e.openAt]), g(() => (e != null && e.openAt && window.addEventListener("load", N), () => {
|
135
|
+
window.removeEventListener("load", N);
|
136
|
+
}), [e == null ? void 0 : e.openAt]);
|
137
|
+
function _(o) {
|
138
|
+
C(o);
|
139
|
+
}
|
140
|
+
function $(o) {
|
141
|
+
S(o);
|
142
|
+
}
|
143
|
+
function P() {
|
144
|
+
t(), a({ allSteps: { steps: null, currentStep: 0 }, stepData: {} }), h && d();
|
145
|
+
}
|
146
|
+
return /* @__PURE__ */ r(V, { children: /* @__PURE__ */ r(W.Provider, { value: { isTxnSuccessful: h, handleTxnSuccess: _ }, children: /* @__PURE__ */ r(Q.Provider, { value: { isErrorMessage: v, handleErrorMessage: $, errorMessage: T, setErrorMessage: q }, children: /* @__PURE__ */ c("div", { className: "bw-w-full bw-relative bw-min-h-[610px] ", children: [
|
147
|
+
/* @__PURE__ */ r(X, { handleBack: P }),
|
148
|
+
/* @__PURE__ */ r("div", { className: "bw-mt-[-20px] ", children: /* @__PURE__ */ r(ne, {}) }),
|
149
|
+
e != null && e.isQuoteTimer ? /* @__PURE__ */ r(oe, {}) : /* @__PURE__ */ r(A, {}),
|
150
|
+
/* @__PURE__ */ r("div", { className: "bw-flex bw-justify-between bw-items-center" }),
|
151
|
+
/* @__PURE__ */ c("div", { className: "bw-flex bw-w-full bw-mt-4 bw-justify-between bw-items-center", children: [
|
152
|
+
/* @__PURE__ */ c("div", { className: "bw-w-[40%] md:bw-w-auto", children: [
|
153
|
+
/* @__PURE__ */ r("p", { className: "bw-text-xs bw-mb-1 bw-text-text-secondary bw-font-medium", children: "Send" }),
|
154
|
+
/* @__PURE__ */ r(F, { amount: e == null ? void 0 : e.amount, coinData: e.fromCoin, chainData: e.fromChain, field: "from" })
|
155
|
+
] }),
|
156
|
+
v ? /* @__PURE__ */ r("div", { className: "bw-border bw-mt-5 bw-w-[65px] bw-h-[65px] bw-flex bw-items-center bw-justify-center bw-rounded-[50%] bw-bg-background-container bw-relative bw-z-10 hover:bw-opacity-100 bw-border-border-primary ", children: ((k = e == null ? void 0 : e.statusData) == null ? void 0 : k.status) === "refunded" ? /* @__PURE__ */ r("img", { src: H, width: 33, height: 30, alt: "img" }) : /* @__PURE__ */ r("img", { src: G, width: 33, height: 30, alt: "img" }) }) : /* @__PURE__ */ r(Y, { isTimerStarted: (e == null ? void 0 : e.isTimerStarted) || x, startTimer: I, error: v }),
|
157
|
+
/* @__PURE__ */ r("div", { className: "bw-w-full bw-z-0 md:bw-w-full bw-mt-5 bw-absolute bw-h-[1px] bw-bg-border-primary " }),
|
158
|
+
/* @__PURE__ */ c("div", { className: "bw-w-[40%] md:bw-w-auto", children: [
|
159
|
+
/* @__PURE__ */ r("p", { className: "bw-text-xs bw-mb-1 bw-text-text-secondary bw-font-medium", children: "Receive" }),
|
160
|
+
/* @__PURE__ */ r(F, { amount: Number(((D = e == null ? void 0 : e.route) == null ? void 0 : D.outputAmountDisplay) || ""), coinData: e == null ? void 0 : e.toCoin, chainData: e == null ? void 0 : e.toChain, field: "to" })
|
161
|
+
] })
|
162
|
+
] }),
|
163
|
+
/* @__PURE__ */ c("div", { className: "bw-h-[320px] bw-pr-1 bw-flex bw-flex-col bw-mt-8 bw-overflow-y-auto", children: [
|
164
|
+
B ? /* @__PURE__ */ r(A, {}) : /* @__PURE__ */ r(Z, {}),
|
165
|
+
/* @__PURE__ */ r(R, { handleOpenExchange: t, setExchange: w, amount: n, startTimer: I, handleBack: P, isTimerStarted: (e == null ? void 0 : e.isTimerStarted) || x })
|
166
|
+
] })
|
167
|
+
] }) }) }) });
|
168
|
+
});
|
169
|
+
function me({
|
170
|
+
handleConfirmClose: t,
|
171
|
+
routesData: n,
|
172
|
+
amount: i,
|
173
|
+
resetAmount: f,
|
174
|
+
resetBalance: d,
|
175
|
+
handleStopRoute: w
|
176
|
+
}) {
|
177
|
+
const a = K();
|
178
|
+
g(() => {
|
179
|
+
var b, m;
|
180
|
+
!a.current && Number(
|
181
|
+
((b = a == null ? void 0 : a.current) == null ? void 0 : b.minOutputAmount) || ((m = a == null ? void 0 : a.current) == null ? void 0 : m.outputAmountDisplay)
|
182
|
+
) !== Number((n == null ? void 0 : n.minOutputAmount) || (n == null ? void 0 : n.outputAmountDisplay)) && (a.current = n);
|
183
|
+
}, [n]), g(() => {
|
184
|
+
w(!0);
|
185
|
+
}, []);
|
186
|
+
function e() {
|
187
|
+
w(!1), t(!1);
|
188
|
+
}
|
189
|
+
function u() {
|
190
|
+
t(!1);
|
191
|
+
}
|
192
|
+
return /* @__PURE__ */ r(
|
193
|
+
ae,
|
194
|
+
{
|
195
|
+
handleOpenExchange: e,
|
196
|
+
amount: i,
|
197
|
+
route: n,
|
198
|
+
resetAmount: f,
|
199
|
+
resetBalance: d,
|
200
|
+
setExchange: u
|
201
|
+
}
|
202
|
+
);
|
203
|
+
}
|
204
|
+
export {
|
205
|
+
me as default
|
206
|
+
};
|