@aurora-is-near/intents-swap-widget 3.18.3 → 3.19.0

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.
Files changed (131) hide show
  1. package/dist/components/AllNetworksIcon.js +11 -0
  2. package/dist/components/AllNetworksIcon.js.map +1 -0
  3. package/dist/components/ChainShortcut.d.ts +15 -0
  4. package/dist/components/ChainShortcut.js +57 -0
  5. package/dist/components/ChainShortcut.js.map +1 -0
  6. package/dist/components/index.d.ts +2 -0
  7. package/dist/components/index.js +21 -17
  8. package/dist/components/index.js.map +1 -1
  9. package/dist/{config-BMvXuF1-.js → config-C47AYcMK.js} +913 -898
  10. package/dist/config-C47AYcMK.js.map +1 -0
  11. package/dist/config.d.ts +2 -0
  12. package/dist/config.js +2 -2
  13. package/dist/errors.js +1 -1
  14. package/dist/ext/alchemy/index.js +1 -1
  15. package/dist/ext/index.js +1 -1
  16. package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
  17. package/dist/features/BalanceRpcLoader/index.js +1 -1
  18. package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
  19. package/dist/features/ChainsDropdown/ChainItem.d.ts +1 -0
  20. package/dist/features/ChainsDropdown/ChainItem.js +23 -14
  21. package/dist/features/ChainsDropdown/ChainItem.js.map +1 -1
  22. package/dist/features/ChainsDropdown/index.js +61 -94
  23. package/dist/features/ChainsDropdown/index.js.map +1 -1
  24. package/dist/features/ChainsSelector/index.d.ts +15 -0
  25. package/dist/features/ChainsSelector/index.js +108 -0
  26. package/dist/features/ChainsSelector/index.js.map +1 -0
  27. package/dist/features/DepositMethodSwitcher.js +1 -1
  28. package/dist/features/ErrorBoundary.js +1 -1
  29. package/dist/features/ExternalDeposit.js +4 -3
  30. package/dist/features/ExternalDeposit.js.map +1 -1
  31. package/dist/features/SendAddress/index.js +1 -1
  32. package/dist/features/SendAddress/useNotification.js +1 -1
  33. package/dist/features/SubmitButton/index.js +1 -1
  34. package/dist/features/SuccessScreen/index.js +1 -1
  35. package/dist/features/SuccessScreen/useSummaryItemsCount.js +1 -1
  36. package/dist/features/SwapDirectionSwitcher.js +1 -1
  37. package/dist/features/SwapQuote/SwapQuote.js +1 -1
  38. package/dist/features/SwapQuote/index.js +1 -1
  39. package/dist/features/TokenInput/TokenInput.js +1 -1
  40. package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
  41. package/dist/features/TokenInput/TokenInputSource.js +1 -1
  42. package/dist/features/TokenInput/TokenInputTarget.js +1 -1
  43. package/dist/features/TokenInput/WalletBalance.js +1 -1
  44. package/dist/features/TokenInput/hooks/index.js +1 -1
  45. package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
  46. package/dist/features/TokenInput/index.js +1 -1
  47. package/dist/features/TokensList/TokenItem.js +1 -1
  48. package/dist/features/TokensList/TokensList.js +1 -1
  49. package/dist/features/TokensList/index.js +1 -1
  50. package/dist/features/TokensModal.js +62 -64
  51. package/dist/features/TokensModal.js.map +1 -1
  52. package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +5 -4
  53. package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js.map +1 -1
  54. package/dist/features/WalletCompatibilityCheck/index.js +1 -1
  55. package/dist/features/index.js +1 -1
  56. package/dist/hooks/index.js +1 -1
  57. package/dist/hooks/useAllTokens.js +1 -1
  58. package/dist/hooks/useChains.js +1 -1
  59. package/dist/hooks/useCompatibilityCheck.js +1 -1
  60. package/dist/hooks/useDefaultToken.js +1 -1
  61. package/dist/hooks/useExternalDepositStatus/index.js +1 -1
  62. package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
  63. package/dist/hooks/useIntentsBalance.js +1 -1
  64. package/dist/hooks/useIsCompatibilityCheckRequired.js +1 -1
  65. package/dist/hooks/useMakeDepositAddress.js +1 -1
  66. package/dist/hooks/useMakeIntentsTransfer.js +1 -1
  67. package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
  68. package/dist/hooks/useMakeQuote.js +1 -1
  69. package/dist/hooks/useMakeQuoteTransfer.js +1 -1
  70. package/dist/hooks/useMakeTransfer.js +1 -1
  71. package/dist/hooks/useMergedBalance.js +1 -1
  72. package/dist/hooks/useSwitchChain.js +1 -1
  73. package/dist/hooks/useTheme.js +1 -1
  74. package/dist/hooks/useTokenInputPair.js +1 -1
  75. package/dist/hooks/useTokens.js +1 -1
  76. package/dist/hooks/useTokensFiltered.d.ts +3 -1
  77. package/dist/hooks/useTokensFiltered.js +1 -1
  78. package/dist/hooks/useTokensIntentsUnique.js +1 -1
  79. package/dist/index.js +74 -70
  80. package/dist/index.js.map +1 -1
  81. package/dist/machine/effects/index.js +1 -1
  82. package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
  83. package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
  84. package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
  85. package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
  86. package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
  87. package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
  88. package/dist/machine/effects/useWalletConnEffect.js +1 -1
  89. package/dist/machine/events/index.js +1 -1
  90. package/dist/machine/events/tokenSelect.js +1 -1
  91. package/dist/machine/events/validateInputAndMoveTo.js +1 -1
  92. package/dist/machine/events/validateInputs.js +1 -1
  93. package/dist/machine/index.js +1 -1
  94. package/dist/machine/snap.js +1 -1
  95. package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
  96. package/dist/machine/subscriptions/index.js +1 -1
  97. package/dist/styles.css +1 -1
  98. package/dist/theme/ThemeProvider.js +1 -1
  99. package/dist/types/config.d.ts +3 -0
  100. package/dist/types/localisation.d.ts +1 -1
  101. package/dist/utils/intents/signers/near.js +1 -1
  102. package/dist/utils/intents/signers/privy.js +1 -1
  103. package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
  104. package/dist/utils/tokens/sort.d.ts +2 -1
  105. package/dist/utils/tokens/sort.js +55 -24
  106. package/dist/utils/tokens/sort.js.map +1 -1
  107. package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +2 -2
  108. package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
  109. package/dist/widgets/WidgetSwap/WidgetSwapContent.js +2 -2
  110. package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
  111. package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +2 -2
  112. package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
  113. package/package.json +1 -1
  114. package/src/components/AllNetworksIcon.tsx +8 -0
  115. package/src/components/ChainShortcut.tsx +67 -0
  116. package/src/components/index.ts +2 -0
  117. package/src/config.tsx +13 -0
  118. package/src/features/ChainsDropdown/ChainItem.tsx +17 -4
  119. package/src/features/ChainsDropdown/index.tsx +10 -41
  120. package/src/features/ChainsSelector/index.tsx +113 -0
  121. package/src/features/TokensList/TokensList.tsx +2 -1
  122. package/src/features/TokensModal.tsx +29 -29
  123. package/src/hooks/useTokensFiltered.ts +4 -0
  124. package/src/types/config.ts +8 -0
  125. package/src/types/localisation.ts +1 -0
  126. package/src/utils/tokens/sort.ts +107 -20
  127. package/dist/config-BMvXuF1-.js.map +0 -1
  128. package/dist/features/ChainsDropdown/AllNetworksIcon.js +0 -7
  129. package/dist/features/ChainsDropdown/AllNetworksIcon.js.map +0 -1
  130. package/src/features/ChainsDropdown/AllNetworksIcon.tsx +0 -7
  131. /package/dist/{features/ChainsDropdown → components}/AllNetworksIcon.d.ts +0 -0
@@ -1,89 +1,88 @@
1
- import { p as ct } from "./index-xuotMAFm.js";
2
- import { jsx as o, jsxs as h, Fragment as Kt } from "react/jsx-runtime";
3
- import Ht from "i18next";
1
+ import { p as lt } from "./index-xuotMAFm.js";
2
+ import { jsx as o, jsxs as T, Fragment as Ht } from "react/jsx-runtime";
3
+ import Gt from "i18next";
4
4
  import { deepClone as ke } from "valtio/utils";
5
5
  import { snapshot as Ee, useSnapshot as me, proxy as dt } from "valtio";
6
- import { HelmetProvider as Gt, Helmet as jt } from "react-helmet-async";
7
- import { memo as zt, useEffect as R, useMemo as L, useRef as X, useCallback as le, useState as te, useId as Yt, createContext as ut, useContext as Xt } from "react";
8
- import { useQuery as Re, useInfiniteQuery as Zt, useQueryClient as Jt, QueryClient as en, QueryClientProvider as tn } from "@tanstack/react-query";
9
- import { Trans as nn, I18nextProvider as rn } from "react-i18next";
10
- import { useTypedTranslation as $, initLocalisation as sn } from "./localisation.js";
6
+ import { HelmetProvider as jt, Helmet as zt } from "react-helmet-async";
7
+ import { memo as Yt, useEffect as R, useMemo as L, useRef as Z, useCallback as ce, useState as ne, useId as Xt, createContext as ut, useContext as Zt } from "react";
8
+ import { useQuery as Re, useInfiniteQuery as Jt, useQueryClient as en, QueryClient as tn, QueryClientProvider as nn } from "@tanstack/react-query";
9
+ import { Trans as rn, I18nextProvider as sn } from "react-i18next";
10
+ import { useTypedTranslation as K, initLocalisation as an } from "./localisation.js";
11
11
  import { logger as E } from "./logger.js";
12
- import { getTonTokenBalance as an } from "./utils/ton/getTonTokenBalance.js";
13
- import { getSolanaTokenBalance as on } from "./utils/solana/getSolanaTokenBalance.js";
12
+ import { getTonTokenBalance as on } from "./utils/ton/getTonTokenBalance.js";
13
+ import { getSolanaTokenBalance as cn } from "./utils/solana/getSolanaTokenBalance.js";
14
14
  import { useWalletAddressForToken as mt } from "./hooks/useWalletAddressForToken.js";
15
15
  import "@headlessui/react";
16
16
  import "@material-symbols-svg/react-rounded/icons/chevron-left";
17
17
  import "framer-motion";
18
18
  import "./features/ChainsDropdown/ChainItem.js";
19
- import "@material-symbols-svg/react-rounded/icons/target";
20
- import { cn as K } from "./utils/cn.js";
21
- import { OneClickService as ln, QuoteRequest as W, GetExecutionStatusResponse as ee } from "@defuse-protocol/one-click-sdk-typescript";
22
- import { CHAINS_LIST as ft, DEFAULT_CHAINS_ORDER as pt, CHAIN_POA_MAP as Tt, POA_EVM_CHAIN_ID as ht, CHAIN_BASE_TOKENS as cn, EVM_CHAIN_IDS_MAP as Ae, CHAIN_IDS_MAP as dn, EVM_CHAINS as un } from "./constants/chains.js";
19
+ import { cn as H } from "./utils/cn.js";
20
+ import { OneClickService as ln, QuoteRequest as W, GetExecutionStatusResponse as te } from "@defuse-protocol/one-click-sdk-typescript";
21
+ import { CHAINS_LIST as ft, DEFAULT_CHAINS_ORDER as pt, CHAIN_POA_MAP as ht, POA_EVM_CHAIN_ID as Tt, CHAIN_BASE_TOKENS as dn, EVM_CHAIN_IDS_MAP as Ae, CHAIN_IDS_MAP as un, EVM_CHAINS as mn } from "./constants/chains.js";
23
22
  import "use-debounce";
24
23
  import "@material-symbols-svg/react-rounded/icons/wand-shine";
25
- import { derive as mn } from "derive-valtio";
26
- import { getIsNativeNearDeposit as fn } from "./machine/computed/getIsNativeNearDeposit.js";
27
- import { getIsDirectTokenOnNearDeposit as pn } from "./machine/computed/getIsDirectTokenOnNearDeposit.js";
24
+ import { derive as fn } from "derive-valtio";
25
+ import { getIsNativeNearDeposit as pn } from "./machine/computed/getIsNativeNearDeposit.js";
26
+ import { getIsDirectTokenOnNearDeposit as hn } from "./machine/computed/getIsDirectTokenOnNearDeposit.js";
28
27
  import "ethers";
29
- import { moveTo as F, machine as J } from "./machine/machine.js";
28
+ import { moveTo as F, machine as ee } from "./machine/machine.js";
30
29
  import Tn from "lodash.once";
31
- import { guardStates as x } from "./machine/guards/index.js";
32
- import { parse as hn } from "./ext/alchemy/parse.js";
33
- import { createLoader as gn } from "./ext/alchemy/load.js";
34
- import { isAlchemySupportedChain as In } from "./ext/alchemy/types.js";
35
- import { fireEvent as T } from "./machine/events/utils/fireEvent.js";
36
- import { NATIVE_NEAR_DUMB_ASSET_ID as G, TOKENS_DATA as Ce, WNEAR_ASSET_ID as Se } from "./constants/tokens.js";
37
- import { isValidChain as wn } from "./utils/checkers/isValidChain.js";
38
- import { useWalletBalance as De } from "./hooks/useWalletBalance.js";
39
- import { getIntentsAccountId as ne } from "./utils/intents/getIntentsAccountId.js";
40
- import { getIntentsBalances as kn } from "./utils/intents/getIntentsBalance.js";
41
- import { notReachable as ve } from "./utils/notReachable.js";
42
- import { getTokenBalanceKey as z } from "./utils/intents/getTokenBalanceKey.js";
30
+ import { guardStates as O } from "./machine/guards/index.js";
31
+ import { parse as gn } from "./ext/alchemy/parse.js";
32
+ import { createLoader as In } from "./ext/alchemy/load.js";
33
+ import { isAlchemySupportedChain as wn } from "./ext/alchemy/types.js";
34
+ import { fireEvent as h } from "./machine/events/utils/fireEvent.js";
35
+ import { NATIVE_NEAR_DUMB_ASSET_ID as j, TOKENS_DATA as Ce, WNEAR_ASSET_ID as Se } from "./constants/tokens.js";
36
+ import { isValidChain as kn } from "./utils/checkers/isValidChain.js";
37
+ import { useWalletBalance as ve } from "./hooks/useWalletBalance.js";
38
+ import { getIntentsAccountId as re } from "./utils/intents/getIntentsAccountId.js";
39
+ import { getIntentsBalances as An } from "./utils/intents/getIntentsBalance.js";
40
+ import { notReachable as De } from "./utils/notReachable.js";
41
+ import { getTokenBalanceKey as Y } from "./utils/intents/getTokenBalanceKey.js";
43
42
  import { isDryQuote as xe } from "./machine/guards/checks/isDryQuote.js";
44
43
  import { snakeCase as gt } from "change-case";
45
- import An, { CanceledError as It, AxiosError as wt } from "axios";
44
+ import Sn, { CanceledError as It, AxiosError as wt } from "axios";
46
45
  import { oneClickApi as Ne, bridgeApi as kt } from "./network.js";
47
- import { formatBigToHuman as Y } from "./utils/formatters/formatBigToHuman.js";
46
+ import { formatBigToHuman as X } from "./utils/formatters/formatBigToHuman.js";
48
47
  import { getDryQuoteAddress as Ge } from "./utils/getDryQuoteAddress.js";
49
- import { isEvmChain as H } from "./utils/evm/isEvmChain.js";
50
- import { checkNearAccountExists as Sn } from "./utils/near/checkNearAccountExists.js";
51
- import { isNotEmptyAmount as re } from "./utils/checkers/isNotEmptyAmount.js";
48
+ import { isEvmChain as G } from "./utils/evm/isEvmChain.js";
49
+ import { checkNearAccountExists as Nn } from "./utils/near/checkNearAccountExists.js";
50
+ import { isNotEmptyAmount as se } from "./utils/checkers/isNotEmptyAmount.js";
52
51
  import { isValidBigint as At } from "./utils/checkers/isValidBigint.js";
53
52
  import { isNearAddress as St } from "./utils/near/isNearAddress.js";
54
53
  import { isBalanceSufficient as Oe } from "./machine/guards/checks/isBalanceSufficient.js";
55
- import { isQuoteError as Fe, isTransferError as Le, isAsyncSendAddressValidationError as Nn } from "./machine/errors.js";
54
+ import { isQuoteError as Fe, isTransferError as Le, isAsyncSendAddressValidationError as _n } from "./machine/errors.js";
56
55
  import { isSolanaAddress as Nt } from "./utils/solana/isSolanaAddress.js";
57
56
  import { isEvmAddress as _t } from "./utils/evm/isEvmAddress.js";
58
- import { getMainTokenByChain as _n } from "./utils/tokens/getMainTokenByChain.js";
59
- import { getDefaultIntentsToken as yn } from "./utils/tokens/getDefaultIntentsToken.js";
60
- import { getTokenWithHighBalance as bn } from "./utils/tokens/getTokenWithHighBalance.js";
61
- import { isQuoteIdle as En } from "./machine/subscriptions/checkers/isQuoteIdle.js";
62
- import { isInputChanged as Rn } from "./machine/subscriptions/checkers/isInputChanged.js";
63
- import { isErrorChanged as Cn } from "./machine/subscriptions/checkers/isErrorChanged.js";
57
+ import { getMainTokenByChain as yn } from "./utils/tokens/getMainTokenByChain.js";
58
+ import { getDefaultIntentsToken as bn } from "./utils/tokens/getDefaultIntentsToken.js";
59
+ import { getTokenWithHighBalance as En } from "./utils/tokens/getTokenWithHighBalance.js";
60
+ import { isQuoteIdle as Rn } from "./machine/subscriptions/checkers/isQuoteIdle.js";
61
+ import { isInputChanged as Cn } from "./machine/subscriptions/checkers/isInputChanged.js";
62
+ import { isErrorChanged as vn } from "./machine/subscriptions/checkers/isErrorChanged.js";
64
63
  import { isOnlyErrorChanged as Dn } from "./machine/subscriptions/checkers/isOnlyErrorChanged.js";
65
- import { isValidInitialState as vn } from "./machine/subscriptions/checkers/isValidInitialState.js";
66
- import { isWalletDisconnected as xn } from "./machine/subscriptions/checkers/isWalletDisconnected.js";
67
- import { isSendAddressForbidden as On } from "./machine/subscriptions/checkers/isSendAddressForbidden.js";
68
- import { isAmountChangedFromQuote as Fn } from "./machine/subscriptions/checkers/isAmountChangedFromQuote.js";
69
- import { reset as Ln } from "./machine/events/reset.js";
64
+ import { isValidInitialState as xn } from "./machine/subscriptions/checkers/isValidInitialState.js";
65
+ import { isWalletDisconnected as On } from "./machine/subscriptions/checkers/isWalletDisconnected.js";
66
+ import { isSendAddressForbidden as Fn } from "./machine/subscriptions/checkers/isSendAddressForbidden.js";
67
+ import { isAmountChangedFromQuote as Ln } from "./machine/subscriptions/checkers/isAmountChangedFromQuote.js";
68
+ import { reset as Bn } from "./machine/events/reset.js";
70
69
  import { tokenSelectRotate as _e } from "./machine/events/tokenSelectRotate.js";
71
- import { errorSet as Bn } from "./machine/events/errorSet.js";
72
- import { quoteSet as qn } from "./machine/events/quoteSet.js";
73
- import { addressSet as Un } from "./machine/events/addressSet.js";
74
- import { tokenSetAmount as Pn } from "./machine/events/tokenSetAmount.js";
75
- import { quoteSetStatus as Wn } from "./machine/events/quoteSetStatus.js";
76
- import { depositTypeSet as Vn } from "./machine/events/depositTypeSet.js";
77
- import { externalDepositTxSet as Mn } from "./machine/events/externalDepositTxSet.js";
78
- import { setInputsValidating as Qn } from "./machine/events/setInputsValidating.js";
79
- import { walletAddressSet as $n } from "./machine/events/walletAddressSet.js";
80
- import { tokenSetBalance as Kn } from "./machine/events/tokenSetBalance.js";
81
- import { transferSetStatus as Hn } from "./machine/events/transferSetStatus.js";
82
- import { getUsdTradeDelta as Gn } from "./machine/computed/getUsdTradeDelta.js";
83
- import { getIsDirectNonNearWithdrawal as jn } from "./machine/computed/getIsDirectNonNearWithdrawal.js";
84
- import { getIsDirectTokenOnNearTransfer as zn } from "./machine/computed/getIsDirectTokenOnNearTransfer.js";
85
- import { getIsDirectNearTokenWithdrawal as Yn } from "./machine/computed/getIsDirectNearTokenWithdrawal.js";
86
- import { getIsSameAssetDiffChainWithdrawal as Xn } from "./machine/computed/getIsSameAssetDiffChainWithdrawal.js";
70
+ import { errorSet as qn } from "./machine/events/errorSet.js";
71
+ import { quoteSet as Un } from "./machine/events/quoteSet.js";
72
+ import { addressSet as Pn } from "./machine/events/addressSet.js";
73
+ import { tokenSetAmount as Wn } from "./machine/events/tokenSetAmount.js";
74
+ import { quoteSetStatus as Vn } from "./machine/events/quoteSetStatus.js";
75
+ import { depositTypeSet as Mn } from "./machine/events/depositTypeSet.js";
76
+ import { externalDepositTxSet as Qn } from "./machine/events/externalDepositTxSet.js";
77
+ import { setInputsValidating as $n } from "./machine/events/setInputsValidating.js";
78
+ import { walletAddressSet as Kn } from "./machine/events/walletAddressSet.js";
79
+ import { tokenSetBalance as Hn } from "./machine/events/tokenSetBalance.js";
80
+ import { transferSetStatus as Gn } from "./machine/events/transferSetStatus.js";
81
+ import { getUsdTradeDelta as jn } from "./machine/computed/getUsdTradeDelta.js";
82
+ import { getIsDirectNonNearWithdrawal as zn } from "./machine/computed/getIsDirectNonNearWithdrawal.js";
83
+ import { getIsDirectTokenOnNearTransfer as Yn } from "./machine/computed/getIsDirectTokenOnNearTransfer.js";
84
+ import { getIsDirectNearTokenWithdrawal as Xn } from "./machine/computed/getIsDirectNearTokenWithdrawal.js";
85
+ import { getIsSameAssetDiffChainWithdrawal as Zn } from "./machine/computed/getIsSameAssetDiffChainWithdrawal.js";
87
86
  import "./components/Input.js";
88
87
  import "@material-symbols-svg/react-rounded/icons/close";
89
88
  import "@material-symbols-svg/react-rounded/icons/emergency";
@@ -92,126 +91,127 @@ import "@material-symbols-svg/react-rounded/icons/verified";
92
91
  import "viem";
93
92
  import { Button as A } from "./components/Button.js";
94
93
  import { TinyNumber as Be } from "./components/TinyNumber.js";
95
- import { ErrorMessage as j } from "./components/ErrorMessage.js";
94
+ import { ErrorMessage as z } from "./components/ErrorMessage.js";
96
95
  import { FT_DEPOSIT_GAS as je, FT_TRANSFER_GAS as ze } from "./utils/near/config.js";
97
96
  import { a as qe } from "./index-DEq3oXQF.js";
98
97
  import { z as oe } from "zod";
99
- import { decodeQueryResult as Zn } from "./utils/near/decodeQueryResult.js";
100
- import { nearRpcClient as Jn } from "./utils/near/rpc.js";
101
- import { getNearNep141MinStorageBalance as er } from "./utils/near/getNearNep141MinStorageBalance.js";
102
- import { isErrorLikeObject as ce } from "./utils/isErrorLikeObject.js";
98
+ import { decodeQueryResult as Jn } from "./utils/near/decodeQueryResult.js";
99
+ import { nearRpcClient as er } from "./utils/near/rpc.js";
100
+ import { getNearNep141MinStorageBalance as tr } from "./utils/near/getNearNep141MinStorageBalance.js";
101
+ import { isErrorLikeObject as le } from "./utils/isErrorLikeObject.js";
103
102
  import { isUserDeniedSigning as de } from "./utils/checkers/isUserDeniedSigning.js";
104
103
  import { INTENTS_CONTRACT as ye } from "./constants/intents.js";
105
104
  import { isEvmBaseToken as yt } from "./utils/evm/isEvmBaseToken.js";
106
- import { useMakeEvmTransfer as tr } from "./hooks/useMakeEvmTransfer.js";
107
- import { useMakeSolanaTransfer as nr } from "./hooks/useMakeSolanaTransfer.js";
108
- import { createIntentSignerNEP413 as rr, IntentsSDK as sr, createNearWithdrawalRoute as ar, createInternalTransferRoute as or, MinWithdrawalAmountError as ir, FeeExceedsAmountError as lr } from "@defuse-protocol/intents-sdk";
109
- import { generateRandomBytes as cr } from "./utils/near/getRandomBytes.js";
110
- import { IntentSignerSolana as dr } from "./utils/intents/signers/solana.js";
105
+ import { useMakeEvmTransfer as nr } from "./hooks/useMakeEvmTransfer.js";
106
+ import { useMakeSolanaTransfer as rr } from "./hooks/useMakeSolanaTransfer.js";
107
+ import { createIntentSignerNEP413 as sr, IntentsSDK as ar, createNearWithdrawalRoute as or, createInternalTransferRoute as ir, MinWithdrawalAmountError as cr, FeeExceedsAmountError as lr } from "@defuse-protocol/intents-sdk";
108
+ import { generateRandomBytes as dr } from "./utils/near/getRandomBytes.js";
109
+ import { IntentSignerSolana as ur } from "./utils/intents/signers/solana.js";
111
110
  import { localStorageTyped as Ye } from "./utils/localstorage.js";
112
- import { queryContract as ur } from "./utils/near/queryContract.js";
111
+ import { queryContract as mr } from "./utils/near/queryContract.js";
113
112
  import { utils as Xe } from "@defuse-protocol/internal-utils";
114
- import { getTransactionLink as mr } from "./utils/formatters/getTransactionLink.js";
115
- import { switchEthereumChain as fr } from "./utils/evm/switchEthereumChain.js";
113
+ import { getTransactionLink as fr } from "./utils/formatters/getTransactionLink.js";
114
+ import { switchEthereumChain as pr } from "./utils/evm/switchEthereumChain.js";
116
115
  import "@material-symbols-svg/react-rounded/w700";
117
116
  import "copy-text-to-clipboard";
118
117
  import "@material-symbols-svg/react-rounded/icons/content-copy";
119
- import { Notes as he } from "./components/Notes.js";
118
+ import { Notes as Te } from "./components/Notes.js";
120
119
  import "@material-symbols-svg/react-rounded/icons/progress-activity";
121
120
  import "bs58";
122
121
  import "viem/chains";
123
122
  import "browser-or-node";
124
123
  import { SwapQuoteSkeleton as bt } from "./features/SwapQuote/SwapQuoteSkeleton.js";
125
- import { Accordion as pr } from "./components/Accordion.js";
124
+ import { Accordion as hr } from "./components/Accordion.js";
126
125
  import { formatUsdAmount as Ze } from "./utils/formatters/formatUsdAmount.js";
127
126
  import { formatTinyNumber as Tr } from "./utils/formatters/formatTinyNumber.js";
128
- import hr from "clsx";
129
- import { Skeleton as gr } from "./components/Skeleton.js";
130
- import { getBalancePortion as Ir } from "./features/TokenInput/utils/getBalancePortion.js";
131
- import { getUsdDisplayAmount as wr } from "./features/TokenInput/utils/getUsdDisplayAmount.js";
127
+ import gr from "clsx";
128
+ import { Skeleton as Ir } from "./components/Skeleton.js";
129
+ import { getBalancePortion as wr } from "./features/TokenInput/utils/getBalancePortion.js";
130
+ import { getUsdDisplayAmount as kr } from "./features/TokenInput/utils/getUsdDisplayAmount.js";
132
131
  import { TokenInputHeading as Et } from "./features/TokenInput/TokenInputHeading.js";
133
- import { noop as kr } from "./utils/noop.js";
132
+ import { noop as Ar } from "./utils/noop.js";
134
133
  import { Card as fe } from "./components/Card.js";
135
134
  import { Badge as Je } from "./components/Badge.js";
136
135
  import { TokenIcon as Rt } from "./components/TokenIcon.js";
137
- import { InputAmount as Ar } from "./components/InputAmount.js";
138
- import { TokenInputSkeleton as Sr } from "./features/TokenInput/TokenInputSkeleton.js";
139
- import { getUsdDisplayBalance as Nr } from "./utils/formatters/getUsdDisplayBalance.js";
140
- import { VList as _r } from "virtua";
141
- import { useFocusOnList as yr } from "./features/TokensList/hooks/useFocusOnList.js";
136
+ import { InputAmount as Sr } from "./components/InputAmount.js";
137
+ import { TokenInputSkeleton as Nr } from "./features/TokenInput/TokenInputSkeleton.js";
138
+ import { getUsdDisplayBalance as _r } from "./utils/formatters/getUsdDisplayBalance.js";
139
+ import { VList as yr } from "virtua";
140
+ import { useFocusOnList as br } from "./features/TokensList/hooks/useFocusOnList.js";
142
141
  import { TokensListPlaceholder as be } from "./features/TokensList/TokensListPlaceholder.js";
143
- import { MAX_LIST_VIEW_AREA_HEIGHT as br, TOKEN_ITEM_HEIGHT as Er, LIST_CONTAINER_ID as Rr } from "./features/TokensList/constants.js";
144
- import { getGroupHeadersTotalIndexes as Cr } from "./features/TokensList/utils/getGroupHeadersTotalIndexes.js";
142
+ import { MAX_LIST_VIEW_AREA_HEIGHT as Er, TOKEN_ITEM_HEIGHT as Rr, LIST_CONTAINER_ID as Cr } from "./features/TokensList/constants.js";
143
+ import { getGroupHeadersTotalIndexes as vr } from "./features/TokensList/utils/getGroupHeadersTotalIndexes.js";
145
144
  import { getFirstGroupItemTotalIndex as Dr } from "./features/TokensList/utils/getFirstGroupItemTotalIndex.js";
146
- import { getListItemsTotalCount as vr } from "./features/TokensList/utils/getListItemsTotalCount.js";
147
- import { getTokenByTotalIndex as xr } from "./features/TokensList/utils/getTokenByTotalIndex.js";
148
- import { getListTotalHeight as Or } from "./features/TokensList/utils/getListTotalHeight.js";
149
- import { getListState as Fr } from "./features/TokensList/utils/getListState.js";
150
- import { Hr as Lr } from "./components/Hr.js";
151
- import { createTokenSorter as Br } from "./utils/tokens/sort.js";
145
+ import { getListItemsTotalCount as xr } from "./features/TokensList/utils/getListItemsTotalCount.js";
146
+ import { getTokenByTotalIndex as Or } from "./features/TokensList/utils/getTokenByTotalIndex.js";
147
+ import { getListTotalHeight as Fr } from "./features/TokensList/utils/getListTotalHeight.js";
148
+ import { getListState as Lr } from "./features/TokensList/utils/getListState.js";
149
+ import { Hr as Br } from "./components/Hr.js";
150
+ import { createTokenSorter as qr } from "./utils/tokens/sort.js";
152
151
  import { createFilterByIntents as et } from "./utils/tokens/filterByIntents.js";
153
- import { createFilterBySearch as qr } from "./utils/tokens/filterBySearchString.js";
154
- import { createFilterBySelectedChain as Ur } from "./utils/tokens/filterBySelectedChain.js";
152
+ import { createFilterBySearch as Ur } from "./utils/tokens/filterBySearchString.js";
153
+ import { createFilterBySelectedChain as Pr } from "./utils/tokens/filterBySelectedChain.js";
155
154
  import "@material-symbols-svg/react-rounded/icons/search";
155
+ import "./components/ChainShortcut.js";
156
156
  import "@material-symbols-svg/react-rounded/icons/arrow-downward";
157
157
  import "qrcode.react";
158
158
  import "@material-symbols-svg/react-rounded/icons/cached";
159
- import { CheckCircleFillW700 as Pr } from "@material-symbols-svg/react-rounded/icons/check-circle";
160
- import { createColorPalette as Wr } from "./theme/createColorPalette.js";
159
+ import { CheckCircleFillW700 as Wr } from "@material-symbols-svg/react-rounded/icons/check-circle";
160
+ import { createColorPalette as Vr } from "./theme/createColorPalette.js";
161
161
  import "@material-symbols-svg/react-rounded/icons/qr-code";
162
162
  import "@material-symbols-svg/react-rounded/icons/wallet";
163
- import { AccountBalanceWalletFillW700 as Vr } from "@material-symbols-svg/react-rounded/icons/account-balance-wallet";
164
- import { ArmingCountdownFillW700 as Mr } from "@material-symbols-svg/react-rounded/icons/arming-countdown";
165
- import { BeenhereFillW700 as Qr } from "@material-symbols-svg/react-rounded/icons/beenhere";
166
- import { EncryptedFillW700 as $r } from "@material-symbols-svg/react-rounded/icons/encrypted";
167
- import { GppBadFillW700 as Kr } from "@material-symbols-svg/react-rounded/icons/gpp-bad";
168
- import { useTimer as Hr } from "use-timer";
163
+ import { AccountBalanceWalletFillW700 as Mr } from "@material-symbols-svg/react-rounded/icons/account-balance-wallet";
164
+ import { ArmingCountdownFillW700 as Qr } from "@material-symbols-svg/react-rounded/icons/arming-countdown";
165
+ import { BeenhereFillW700 as $r } from "@material-symbols-svg/react-rounded/icons/beenhere";
166
+ import { EncryptedFillW700 as Kr } from "@material-symbols-svg/react-rounded/icons/encrypted";
167
+ import { GppBadFillW700 as Hr } from "@material-symbols-svg/react-rounded/icons/gpp-bad";
168
+ import { useTimer as Gr } from "use-timer";
169
169
  import { useHandleKeyDown as Ct } from "./hooks/useHandleKeyDown.js";
170
- import { CloseButton as Dt } from "./components/CloseButton.js";
171
- import { DEFAULT_RPCS as Gr } from "./rpcs.js";
172
- import { useAddClassToPortal as jr } from "./hooks/useAddClassToPortal.js";
173
- import { ErrorBoundary as zr } from "react-error-boundary";
174
- import { isEvmToken as Yr } from "./utils/evm/isEvmToken.js";
175
- import { getEvmMainTokenBalance as Xr } from "./utils/evm/getEvmMainTokenBalance.js";
176
- import { getNativeNearBalance as Zr } from "./utils/near/getNativeNearBalance.js";
177
- import { getNearTokenBalance as Jr } from "./utils/near/getNearTokenBalance.js";
178
- import { getEvmTokenBalance as es } from "./utils/evm/getEvmTokenBalance.js";
179
- function ts({ rpcs: e, token: t, connectedWallets: s }) {
180
- const { walletSupportedChains: r, tonCenterApiKey: n, alchemyApiKey: a } = b(), { walletAddress: c } = mt(s, t);
170
+ import { CloseButton as vt } from "./components/CloseButton.js";
171
+ import { DEFAULT_RPCS as jr } from "./rpcs.js";
172
+ import { useAddClassToPortal as zr } from "./hooks/useAddClassToPortal.js";
173
+ import { ErrorBoundary as Yr } from "react-error-boundary";
174
+ import { isEvmToken as Xr } from "./utils/evm/isEvmToken.js";
175
+ import { getEvmMainTokenBalance as Zr } from "./utils/evm/getEvmMainTokenBalance.js";
176
+ import { getNativeNearBalance as Jr } from "./utils/near/getNativeNearBalance.js";
177
+ import { getNearTokenBalance as es } from "./utils/near/getNearTokenBalance.js";
178
+ import { getEvmTokenBalance as ts } from "./utils/evm/getEvmTokenBalance.js";
179
+ function ns({ rpcs: e, token: t, connectedWallets: s }) {
180
+ const { walletSupportedChains: r, tonCenterApiKey: n, alchemyApiKey: a } = y(), { walletAddress: l } = mt(s, t);
181
181
  return Re({
182
182
  retry: 2,
183
- enabled: !!c && Object.keys(e).includes(t.blockchain),
183
+ enabled: !!l && Object.keys(e).includes(t.blockchain),
184
184
  queryKey: ["tokenBalance", t.assetId, s],
185
185
  queryFn: async () => {
186
- if (!c)
186
+ if (!l)
187
187
  return null;
188
188
  if (t.blockchain === "near" && r.includes(t.blockchain))
189
- return !e.near || e.near.length === 0 ? null : t.assetId === G ? Zr(c, e.near) : Jr(t, c, e.near);
190
- if (!r.includes("eth") && H(t.blockchain))
189
+ return !e.near || e.near.length === 0 ? null : t.assetId === j ? Jr(l, e.near) : es(t, l, e.near);
190
+ if (!r.includes("eth") && G(t.blockchain))
191
191
  return null;
192
- if (H(t.blockchain) && yt(t)) {
193
- const l = e[t.blockchain] ?? [];
194
- return l.length > 0 ? Xr(c, l[0]) : null;
192
+ if (G(t.blockchain) && yt(t)) {
193
+ const c = e[t.blockchain] ?? [];
194
+ return c.length > 0 ? Zr(l, c[0]) : null;
195
195
  }
196
- if (Yr(t) || H(t.blockchain)) {
197
- const l = e[t.blockchain] ?? [];
198
- return l.length > 0 ? es(t, c, l[0]) : null;
196
+ if (Xr(t) || G(t.blockchain)) {
197
+ const c = e[t.blockchain] ?? [];
198
+ return c.length > 0 ? ts(t, l, c[0]) : null;
199
199
  }
200
- return t.blockchain === "ton" ? an(t, c, n) : t.blockchain === "sol" && r.includes(t.blockchain) ? on(t, c, a) : (E.warn(
200
+ return t.blockchain === "ton" ? on(t, l, n) : t.blockchain === "sol" && r.includes(t.blockchain) ? cn(t, l, a) : (E.warn(
201
201
  `Failed to fetch token balance for ${t.symbol} on ${t.blockchain}`
202
202
  ), null);
203
203
  }
204
204
  });
205
205
  }
206
- const ns = ({
206
+ const rs = ({
207
207
  rpcs: e,
208
208
  token: t,
209
209
  onBalancesLoaded: s
210
210
  }) => (R(() => {
211
211
  t.isIntent || !Object.keys(e).includes(t.blockchain) || s({ [t.assetId]: "0" });
212
- }, [t.assetId]), null), vt = zt(
212
+ }, [t.assetId]), null), Dt = Yt(
213
213
  ({ rpcs: e, token: t, connectedWallets: s, onBalancesLoaded: r }) => {
214
- const { data: n } = ts({
214
+ const { data: n } = ns({
215
215
  rpcs: e,
216
216
  token: t,
217
217
  connectedWallets: s
@@ -222,68 +222,68 @@ const ns = ({
222
222
  },
223
223
  (e, t) => e.token.assetId === t.token.assetId && e.connectedWallets === t.connectedWallets
224
224
  );
225
- vt.displayName = "TokenBalanceLoader";
226
- const tt = Object.assign(vt, {
227
- Zero: ns
228
- }), rs = (e) => {
225
+ Dt.displayName = "TokenBalanceLoader";
226
+ const tt = Object.assign(Dt, {
227
+ Zero: rs
228
+ }), ss = (e) => {
229
229
  const t = e.toLowerCase();
230
230
  return Ce[t]?.icon ?? "";
231
- }, ss = (e) => `${e?.charAt(0).toUpperCase()}${e?.slice(1)}`, as = (e) => Ce[e]?.name ?? e, V = (e) => {
231
+ }, as = (e) => `${e?.charAt(0).toUpperCase()}${e?.slice(1)}`, os = (e) => Ce[e]?.name ?? e, V = (e) => {
232
232
  const {
233
233
  showIntentTokens: t,
234
234
  allowedTokensList: s,
235
235
  allowedSourceTokensList: r,
236
236
  allowedTargetTokensList: n,
237
237
  filterTokens: a,
238
- fetchSourceTokens: c,
239
- fetchTargetTokens: l
240
- } = b(), { data: d, ...u } = Re({
238
+ fetchSourceTokens: l,
239
+ fetchTargetTokens: c
240
+ } = y(), { data: d, ...m } = Re({
241
241
  queryKey: ["tokens", e].filter(Boolean),
242
- queryFn: async () => e === "source" && c ? c() : e === "target" && l ? l() : ln.getTokens()
242
+ queryFn: async () => e === "source" && l ? l() : e === "target" && c ? c() : ln.getTokens()
243
243
  }), i = L(() => {
244
244
  if (!d)
245
245
  return [];
246
- const f = d.map((m) => {
247
- const w = m.blockchain.toLowerCase();
248
- return !wn(w) || s && !s.includes(m.assetId) || e === "source" && r && !r.includes(m.assetId) || e === "target" && n && !n.includes(m.assetId) ? null : {
249
- assetId: m.assetId,
250
- symbol: m.symbol,
251
- decimals: m.decimals,
252
- price: m.price,
253
- blockchain: w,
246
+ const u = d.map((f) => {
247
+ const g = f.blockchain.toLowerCase();
248
+ return !kn(g) || s && !s.includes(f.assetId) || e === "source" && r && !r.includes(f.assetId) || e === "target" && n && !n.includes(f.assetId) ? null : {
249
+ assetId: f.assetId,
250
+ symbol: f.symbol,
251
+ decimals: f.decimals,
252
+ price: f.price,
253
+ blockchain: g,
254
254
  isIntent: !1,
255
- icon: m.icon ?? rs(m.symbol),
256
- name: as(m.symbol),
257
- chainName: ft[m.blockchain]?.label ?? ss(m.blockchain),
258
- contractAddress: m.contractAddress
255
+ icon: f.icon ?? ss(f.symbol),
256
+ name: os(f.symbol),
257
+ chainName: ft[f.blockchain]?.label ?? as(f.blockchain),
258
+ contractAddress: f.contractAddress
259
259
  };
260
- }).filter((m) => !!m).filter(a ?? (() => !0)), p = f.filter(
261
- (m) => m.symbol.toLowerCase() !== "wnear"
262
- ), I = f.find((m) => m.symbol.toLowerCase() === "wnear");
263
- return I && p.push({
260
+ }).filter((f) => !!f).filter(a ?? (() => !0)), p = u.filter(
261
+ (f) => f.symbol.toLowerCase() !== "wnear"
262
+ ), w = u.find((f) => f.symbol.toLowerCase() === "wnear");
263
+ return w && p.push({
264
264
  name: "NEAR",
265
265
  symbol: "NEAR",
266
266
  chainName: "Near",
267
267
  blockchain: "near",
268
- assetId: G,
268
+ assetId: j,
269
269
  icon: Ce.near?.icon ?? "",
270
- price: I?.price ?? 0,
271
- contractAddress: I?.contractAddress,
270
+ price: w?.price ?? 0,
271
+ contractAddress: w?.contractAddress,
272
272
  isIntent: !1,
273
273
  decimals: 24
274
274
  }), t ? [
275
275
  ...p,
276
276
  // add intents tokens to the full list
277
- ...f.map(
278
- (m) => m.symbol.toLowerCase() === "wnear" ? { ...m, symbol: "NEAR", name: "NEAR", isIntent: !0 } : { ...m, isIntent: !0 }
277
+ ...u.map(
278
+ (f) => f.symbol.toLowerCase() === "wnear" ? { ...f, symbol: "NEAR", name: "NEAR", isIntent: !0 } : { ...f, isIntent: !0 }
279
279
  )
280
280
  ] : p;
281
281
  }, [d, t, a]);
282
282
  return {
283
- ...u,
283
+ ...m,
284
284
  tokens: i
285
285
  };
286
- }, os = () => {
286
+ }, is = () => {
287
287
  const { tokens: e } = V(), { tokens: t } = V("source"), { tokens: s } = V("target");
288
288
  return { tokens: L(() => {
289
289
  const n = {};
@@ -292,8 +292,8 @@ const tt = Object.assign(vt, {
292
292
  ...t || [],
293
293
  ...s || []
294
294
  ].forEach((a) => {
295
- const c = `${a.assetId}-${a.isIntent}`;
296
- n[c] = a;
295
+ const l = `${a.assetId}-${a.isIntent}`;
296
+ n[l] = a;
297
297
  }), Object.values(n);
298
298
  }, [e, t, s]) };
299
299
  }, ge = [
@@ -301,7 +301,7 @@ const tt = Object.assign(vt, {
301
301
  { near: ["USDT", "USDC", "AURORA"] },
302
302
  { arb: ["ARB", "ETH", "USDT", "USDC"] },
303
303
  { btc: ["BTC"] }
304
- ], is = (e) => [...e].sort((t, s) => {
304
+ ], cs = (e) => [...e].sort((t, s) => {
305
305
  const r = ge.findIndex(
306
306
  (d) => Object.keys(d)[0] === t.blockchain
307
307
  ), n = ge.findIndex(
@@ -309,154 +309,154 @@ const tt = Object.assign(vt, {
309
309
  );
310
310
  if (r !== n)
311
311
  return r === -1 ? 1 : n === -1 ? -1 : r - n;
312
- const a = ge[r]?.[t.blockchain] ?? [], c = a.indexOf(t.symbol), l = a.indexOf(s.symbol);
313
- return c === -1 && l === -1 ? 0 : c === -1 ? 1 : l === -1 ? -1 : c - l;
312
+ const a = ge[r]?.[t.blockchain] ?? [], l = a.indexOf(t.symbol), c = a.indexOf(s.symbol);
313
+ return l === -1 && c === -1 ? 0 : l === -1 ? 1 : c === -1 ? -1 : l - c;
314
314
  }), ls = ({ rpcs: e, connectedWallets: t }) => {
315
- const { tokens: s } = os(), { walletSupportedChains: r } = b(), { setWalletBalance: n } = De(t);
316
- return L(() => is(s), [s]).map((c) => r.includes(c.blockchain) ? /* @__PURE__ */ o(
315
+ const { tokens: s } = is(), { walletSupportedChains: r } = y(), { setWalletBalance: n } = ve(t);
316
+ return L(() => cs(s), [s]).map((l) => r.includes(l.blockchain) ? /* @__PURE__ */ o(
317
317
  tt,
318
318
  {
319
319
  rpcs: e,
320
- token: c,
320
+ token: l,
321
321
  connectedWallets: t,
322
- onBalancesLoaded: (l) => n(t, l)
322
+ onBalancesLoaded: (c) => n(t, c)
323
323
  },
324
- z(c)
324
+ Y(l)
325
325
  ) : /* @__PURE__ */ o(
326
326
  tt.Zero,
327
327
  {
328
328
  rpcs: e,
329
- token: c,
330
- onBalancesLoaded: (l) => n(t, l)
329
+ token: l,
330
+ onBalancesLoaded: (c) => n(t, c)
331
331
  },
332
- z(c)
332
+ Y(l)
333
333
  ));
334
334
  };
335
- function cs(e, t) {
335
+ function ds(e, t) {
336
336
  const s = Array.from(
337
337
  /* @__PURE__ */ new Set([...t ?? [], ...pt])
338
338
  ), r = new Map(s.map((n, a) => [n, a]));
339
339
  return [...e].sort((n, a) => {
340
- const c = r.has(n.id) ? r.get(n.id) : 1 / 0, l = r.has(a.id) ? r.get(a.id) : 1 / 0;
341
- return c !== l ? c - l : n.id.localeCompare(a.id, void 0, { sensitivity: "base" });
340
+ const l = r.has(n.id) ? r.get(n.id) : 1 / 0, c = r.has(a.id) ? r.get(a.id) : 1 / 0;
341
+ return l !== c ? l - c : n.id.localeCompare(a.id, void 0, { sensitivity: "base" });
342
342
  });
343
343
  }
344
- const ds = (e) => {
344
+ const us = (e) => {
345
345
  const {
346
346
  chainsOrder: t,
347
347
  allowedChainsList: s,
348
348
  allowedSourceChainsList: r,
349
349
  allowedTargetChainsList: n
350
- } = b(), { tokens: a } = V();
350
+ } = y(), { tokens: a } = V();
351
351
  return L(() => {
352
- const c = Array.from(
353
- new Set(a.map((l) => ft[l.blockchain]))
354
- ).filter((l) => !(s && !s.includes(l.id) || e === "source" && r && !r.includes(l.id) || e === "target" && n && !n.includes(l.id)));
355
- return cs(c, t);
352
+ const l = Array.from(
353
+ new Set(a.map((c) => ft[c.blockchain]))
354
+ ).filter((c) => !(s && !s.includes(c.id) || e === "source" && r && !r.includes(c.id) || e === "target" && n && !n.includes(c.id)));
355
+ return ds(l, t);
356
356
  }, [a, t, s]);
357
357
  }, nt = 3, xt = ({
358
358
  connectedWallets: e,
359
359
  alchemyApiKey: t,
360
360
  ...s
361
361
  }) => {
362
- const { ctx: r } = _(), { tokens: n } = V(), { walletSupportedChains: a } = b(), { setWalletBalance: c } = De(e), l = s.isEnabled && !!Object.values(e).length && a.length > 0, d = Zt({
362
+ const { ctx: r } = _(), { tokens: n } = V(), { walletSupportedChains: a } = y(), { setWalletBalance: l } = ve(e), c = s.isEnabled && !!Object.values(e).length && a.length > 0, d = Jt({
363
363
  initialPageParam: null,
364
- enabled: !!l && !!t,
364
+ enabled: !!c && !!t,
365
365
  queryKey: ["walletTokensBalance", e],
366
- queryFn: async ({ pageParam: i }) => gn({ alchemyApiKey: t })({
366
+ queryFn: async ({ pageParam: i }) => In({ alchemyApiKey: t })({
367
367
  pageParam: i ? `${i}` : null,
368
368
  connectedWallets: e,
369
369
  walletSupportedChains: a
370
370
  }),
371
- getNextPageParam: (i, f) => {
372
- if (i.pageKey && !(f.length >= nt))
371
+ getNextPageParam: (i, u) => {
372
+ if (i.pageKey && !(u.length >= nt))
373
373
  return i.pageKey;
374
374
  }
375
375
  });
376
376
  R(() => {
377
- l && d.data && d.hasNextPage && d.data.pages.length < nt && !d.isFetchingNextPage && d.fetchNextPage();
378
- }, [l, d]);
379
- const u = L(() => {
377
+ c && d.data && d.hasNextPage && d.data.pages.length < nt && !d.isFetchingNextPage && d.fetchNextPage();
378
+ }, [c, d]);
379
+ const m = L(() => {
380
380
  if (!d.data?.pages)
381
381
  return {};
382
- const i = hn(
382
+ const i = gn(
383
383
  n,
384
- d.data.pages.flatMap((f) => f.data)
384
+ d.data.pages.flatMap((u) => u.data)
385
385
  );
386
- return n.forEach((f) => {
387
- In(f.blockchain) && !(f.assetId in i) && (i[f.assetId] = "0");
386
+ return n.forEach((u) => {
387
+ wn(u.blockchain) && !(u.assetId in i) && (i[u.assetId] = "0");
388
388
  }), i;
389
389
  }, [d.data, n]);
390
390
  return R(() => {
391
- x(r, ["initial_wallet"]) && (c(e, u), r.sourceToken && Object.keys(u).includes(r.sourceToken.assetId) && T("tokenSetBalance", u[r.sourceToken.assetId]));
392
- }, [u]), {
391
+ O(r, ["initial_wallet"]) && (l(e, m), r.sourceToken && Object.keys(m).includes(r.sourceToken.assetId) && h("tokenSetBalance", m[r.sourceToken.assetId]));
392
+ }, [m]), {
393
393
  status: d.status,
394
394
  refetch: d.refetch,
395
- balances: u
395
+ balances: m
396
396
  };
397
397
  }, pe = () => {
398
- const { intentsAccountType: e } = b(), {
398
+ const { intentsAccountType: e } = y(), {
399
399
  ctx: { walletAddress: t }
400
- } = _(), { tokens: s } = V(), r = s.filter((l) => l.isIntent).map((l) => l.assetId), n = ne({
400
+ } = _(), { tokens: s } = V(), r = s.filter((c) => c.isIntent).map((c) => c.assetId), n = re({
401
401
  walletAddress: t,
402
402
  addressType: e
403
403
  }), a = Re({
404
404
  enabled: !!t && !!n && s.length > 0,
405
405
  queryKey: ["intentsBalances", n],
406
- queryFn: async () => n ? await kn(n, r) : {}
407
- }), c = L(() => {
406
+ queryFn: async () => n ? await An(n, r) : {}
407
+ }), l = L(() => {
408
408
  switch (a.status) {
409
409
  case "error":
410
410
  return E.error("Unable to load intents balances:", a.error), {};
411
411
  case "success":
412
412
  return Object.fromEntries(
413
- Object.entries(a.data).map(([l, d]) => [
414
- `intent-${l}`,
413
+ Object.entries(a.data).map(([c, d]) => [
414
+ `intent-${c}`,
415
415
  d
416
416
  ])
417
417
  );
418
418
  case "pending":
419
419
  return {};
420
420
  default:
421
- return ve(a, { throwError: !1 }), {};
421
+ return De(a, { throwError: !1 }), {};
422
422
  }
423
423
  }, [a]) ?? {};
424
424
  return {
425
425
  ...a,
426
- intentBalances: c
426
+ intentBalances: l
427
427
  };
428
- }, us = ({
428
+ }, ms = ({
429
429
  isEnabled: e,
430
430
  alchemyApiKey: t
431
431
  }) => {
432
- const { connectedWallets: s } = b(), { ctx: r } = _(), n = Jt(), { refetch: a } = pe(), { refetch: c } = xt({
432
+ const { connectedWallets: s } = y(), { ctx: r } = _(), n = en(), { refetch: a } = pe(), { refetch: l } = xt({
433
433
  isEnabled: e,
434
434
  connectedWallets: s,
435
435
  alchemyApiKey: t ?? ""
436
436
  });
437
437
  R(() => {
438
- const l = x(r, ["transfer_success"]);
439
- !e || !l || (async () => (await a(), t && (await new Promise((d) => {
438
+ const c = O(r, ["transfer_success"]);
439
+ !e || !c || (async () => (await a(), t && (await new Promise((d) => {
440
440
  setTimeout(d, 1e4);
441
- }), await c()), await n.invalidateQueries({ queryKey: ["tokenBalance"] })))();
441
+ }), await l()), await n.invalidateQueries({ queryKey: ["tokenBalance"] })))();
442
442
  }, [r.state, e, t]);
443
- }, Te = () => {
444
- const { connectedWallets: e } = b(), { intentBalances: t } = pe(), { walletBalance: s } = De(e);
443
+ }, he = () => {
444
+ const { connectedWallets: e } = y(), { intentBalances: t } = pe(), { walletBalance: s } = ve(e);
445
445
  return { mergedBalance: L(
446
446
  () => ({ ...s, ...t }),
447
447
  [s, t]
448
448
  ) };
449
- }, ms = ({ isEnabled: e }) => {
450
- const { ctx: t } = _(), { mergedBalance: s } = Te();
449
+ }, fs = ({ isEnabled: e }) => {
450
+ const { ctx: t } = _(), { mergedBalance: s } = he();
451
451
  R(() => {
452
452
  if (!e)
453
453
  return;
454
454
  if (!t.sourceToken || !t.walletAddress) {
455
- T("tokenSetBalance", void 0);
455
+ h("tokenSetBalance", void 0);
456
456
  return;
457
457
  }
458
- const r = z(t.sourceToken);
459
- T("tokenSetBalance", s[r]);
458
+ const r = Y(t.sourceToken);
459
+ h("tokenSetBalance", s[r]);
460
460
  }, [s, t.sourceToken]);
461
461
  }, rt = {
462
462
  // cbBTC (eth)
@@ -473,7 +473,7 @@ const ds = (e) => {
473
473
  "nep245:v2_1.omni.hot.tg:56_SZzgw3HSudhZcTwPWUTi2RJB19t": "nep141:wrap.near",
474
474
  // BTC (near)
475
475
  "nep141:btc.omft.near": "nep141:nbtc.bridge.near"
476
- }, fs = ({
476
+ }, ps = ({
477
477
  isEnabled: e
478
478
  }) => {
479
479
  const { ctx: t } = _(), { tokens: s } = V();
@@ -481,76 +481,76 @@ const ds = (e) => {
481
481
  if (!e)
482
482
  return;
483
483
  if (!t.sourceToken) {
484
- T("tokenSelect", { variant: "target", token: void 0 });
484
+ h("tokenSelect", { variant: "target", token: void 0 });
485
485
  return;
486
486
  }
487
487
  const { sourceToken: r } = t;
488
488
  if (t.sourceToken.assetId in rt) {
489
- const l = s.find(
489
+ const c = s.find(
490
490
  (d) => d.isIntent && d.assetId === rt[r.assetId]
491
491
  );
492
- T("tokenSelect", {
492
+ h("tokenSelect", {
493
493
  variant: "target",
494
- token: l
494
+ token: c
495
495
  });
496
496
  return;
497
497
  }
498
498
  const n = s.find(
499
- (l) => l.isIntent && l.symbol === r.symbol && l.blockchain === "near"
499
+ (c) => c.isIntent && c.symbol === r.symbol && c.blockchain === "near"
500
500
  );
501
501
  if (n) {
502
- T("tokenSelect", { variant: "target", token: n });
502
+ h("tokenSelect", { variant: "target", token: n });
503
503
  return;
504
504
  }
505
505
  const a = s.find(
506
- (l) => l.isIntent && l.assetId === r.assetId
507
- ), c = s.find(
508
- (l) => l.isIntent && l.symbol === "USDC" && l.blockchain === "near"
506
+ (c) => c.isIntent && c.assetId === r.assetId
507
+ ), l = s.find(
508
+ (c) => c.isIntent && c.symbol === "USDC" && c.blockchain === "near"
509
509
  );
510
- T("tokenSelect", {
510
+ h("tokenSelect", {
511
511
  variant: "target",
512
- token: a ?? c
512
+ token: a ?? l
513
513
  });
514
514
  }, [s, t.sourceToken]);
515
- }, ps = ({ isEnabled: e }) => {
516
- const { connectedWallets: t } = b(), { ctx: s, state: r } = _(), { walletAddress: n } = mt(
515
+ }, hs = ({ isEnabled: e }) => {
516
+ const { connectedWallets: t } = y(), { ctx: s, state: r } = _(), { walletAddress: n } = mt(
517
517
  t,
518
518
  s.sourceToken
519
519
  );
520
520
  R(() => {
521
521
  if (!e)
522
522
  return;
523
- T("walletAddressSet", n), x(s, ["initial_dry", "initial_wallet"]) && (r === "initial_wallet" && !n ? F("initial_dry") : r === "initial_dry" && n && F("initial_wallet"));
523
+ h("walletAddressSet", n), O(s, ["initial_dry", "initial_wallet"]) && (r === "initial_wallet" && !n ? F("initial_dry") : r === "initial_dry" && n && F("initial_wallet"));
524
524
  }, [e, n, s, r]);
525
525
  }, Ts = (e) => (["depositAddress"].forEach((t) => {
526
526
  if (!(t in e))
527
527
  return E.error(`Missing ${t} in quote response`), !1;
528
- }), !0), hs = () => {
528
+ }), !0), gs = () => {
529
529
  const { ctx: e } = _(), {
530
530
  walletSupportedChains: t,
531
531
  intentsAccountType: s,
532
532
  appName: r,
533
533
  appFees: n,
534
534
  fetchQuote: a,
535
- slippageTolerance: c
536
- } = b(), l = xe(e), d = X(null), u = X(new AbortController()), i = L(() => async (p, I) => {
537
- const { signal: m } = u.current;
535
+ slippageTolerance: l
536
+ } = y(), c = xe(e), d = Z(null), m = Z(new AbortController()), i = L(() => async (p, w) => {
537
+ const { signal: f } = m.current;
538
538
  return a ? a(p, {
539
- ...I,
540
- signal: m
539
+ ...w,
540
+ signal: f
541
541
  }) : (await Ne.post(
542
542
  "https://1click.chaindefuser.com/v0/quote",
543
543
  p,
544
- { signal: m }
544
+ { signal: f }
545
545
  )).data.quote;
546
546
  }, [Ne]);
547
547
  return {
548
548
  make: async ({
549
549
  message: p,
550
- quoteType: I = "exact_in",
551
- options: m = {}
550
+ quoteType: w = "exact_in",
551
+ options: f = {}
552
552
  } = {}) => {
553
- if (!x(e, [
553
+ if (!O(e, [
554
554
  "input_valid_dry",
555
555
  "input_valid_external",
556
556
  "input_valid_internal",
@@ -558,50 +558,50 @@ const ds = (e) => {
558
558
  "quote_success_external"
559
559
  ])) {
560
560
  const S = `Unable to run quote in current state ${e.state}`;
561
- throw E.error(`[WIDGET] ${S}`), new U({
561
+ throw E.error(`[WIDGET] ${S}`), new q({
562
562
  code: "QUOTE_INVALID_INITIAL",
563
- meta: { isDry: l, message: S }
563
+ meta: { isDry: c, message: S }
564
564
  });
565
565
  }
566
- const k = ne({
566
+ const k = re({
567
567
  addressType: s,
568
- walletAddress: l ? (
568
+ walletAddress: c ? (
569
569
  // address on the target chain should be a dry quote recipient
570
570
  Ge(e.targetToken.blockchain)
571
571
  ) : e.walletAddress ?? ""
572
- }), y = k && (e.sourceToken.isIntent || !t.includes(e.sourceToken.blockchain)), q = () => l ? Ge(
572
+ }), b = k && (e.sourceToken.isIntent || !t.includes(e.sourceToken.blockchain)), B = () => c ? Ge(
573
573
  e.sourceToken.blockchain,
574
574
  e.sourceToken.isIntent
575
- ) : y ? k : e.walletAddress ?? "";
575
+ ) : b ? k : e.walletAddress ?? "";
576
576
  if (!k) {
577
577
  const S = "No corresponding intents account to run a quote";
578
- throw E.error(`[WIDGET] ${S}`), new U({
578
+ throw E.error(`[WIDGET] ${S}`), new q({
579
579
  code: "QUOTE_INVALID_INITIAL",
580
- meta: { isDry: l, message: S }
580
+ meta: { isDry: c, message: S }
581
581
  });
582
582
  }
583
- d.current && (u.current.abort("Abort previous quote (auto)"), u.current = new AbortController());
583
+ d.current && (m.current.abort("Abort previous quote (auto)"), m.current = new AbortController());
584
584
  let D;
585
- const B = {
585
+ const C = {
586
586
  // Settings
587
- dry: l,
588
- slippageTolerance: c,
587
+ dry: c,
588
+ slippageTolerance: l,
589
589
  deadline: new Date(Date.now() + 3600 * 1e3).toISOString(),
590
590
  // 1 hour
591
- swapType: I === "exact_out" ? W.swapType.EXACT_OUTPUT : W.swapType.EXACT_INPUT,
591
+ swapType: w === "exact_out" ? W.swapType.EXACT_OUTPUT : W.swapType.EXACT_INPUT,
592
592
  // Target
593
- destinationAsset: e.targetToken.assetId === G ? Se : e.targetToken.assetId,
593
+ destinationAsset: e.targetToken.assetId === j ? Se : e.targetToken.assetId,
594
594
  // Source
595
- originAsset: e.sourceToken.assetId === G ? Se : e.sourceToken.assetId,
596
- amount: I === "exact_out" ? e.targetTokenAmount : e.sourceTokenAmount,
595
+ originAsset: e.sourceToken.assetId === j ? Se : e.sourceToken.assetId,
596
+ amount: w === "exact_out" ? e.targetTokenAmount : e.sourceTokenAmount,
597
597
  // Experimental
598
598
  quoteWaitingTimeMs: 0
599
599
  };
600
- p && (B.customRecipientMsg = p), r && (B.referral = gt(r)), n && (B.appFees = [...n]);
600
+ p && (C.customRecipientMsg = p), r && (C.referral = gt(r)), n && (C.appFees = [...n]);
601
601
  try {
602
602
  e.sourceToken.isIntent && e.targetToken.isIntent && (d.current = i(
603
603
  {
604
- ...B,
604
+ ...C,
605
605
  recipient: k,
606
606
  recipientType: W.recipientType.INTENTS,
607
607
  depositType: W.depositType.INTENTS,
@@ -609,48 +609,48 @@ const ds = (e) => {
609
609
  refundTo: k,
610
610
  refundType: W.refundType.INTENTS
611
611
  },
612
- m
612
+ f
613
613
  ), D = await d.current), d.current = i(
614
614
  {
615
- ...B,
615
+ ...C,
616
616
  recipient: !e.targetToken.isIntent && e.sendAddress ? e.sendAddress : k,
617
617
  recipientType: e.targetToken.isIntent ? W.recipientType.INTENTS : W.recipientType.DESTINATION_CHAIN,
618
618
  depositType: e.sourceToken.isIntent ? W.depositType.INTENTS : W.depositType.ORIGIN_CHAIN,
619
619
  // Refund
620
- refundTo: q(),
621
- refundType: y ? W.refundType.INTENTS : W.refundType.ORIGIN_CHAIN
620
+ refundTo: B(),
621
+ refundType: b ? W.refundType.INTENTS : W.refundType.ORIGIN_CHAIN
622
622
  },
623
- m
623
+ f
624
624
  ), D = await d.current;
625
625
  } catch (S) {
626
626
  if (S instanceof It)
627
627
  return;
628
628
  E.error("Quote error: ", S);
629
- let O = S instanceof Error ? S.message : "";
629
+ let U = S instanceof Error ? S.message : "";
630
630
  if (S instanceof wt) {
631
- if (O = S.response?.data.message || O, O.includes("Amount is too low")) {
632
- const se = O.match(/\d+/), ae = se ? se[0] : void 0;
633
- throw new U({
631
+ if (U = S.response?.data.message || U, U.includes("Amount is too low")) {
632
+ const Q = U.match(/\d+/), ae = Q ? Q[0] : void 0;
633
+ throw new q({
634
634
  code: "QUOTE_AMOUNT_IS_TOO_LOW",
635
635
  meta: {
636
- minAmount: (ae && Y(ae, e.sourceToken.decimals)) ?? "0"
636
+ minAmount: (ae && X(ae, e.sourceToken.decimals)) ?? "0"
637
637
  }
638
638
  });
639
639
  }
640
- throw O.includes("recipient is not valid") ? new U({
640
+ throw U.includes("recipient is not valid") ? new q({
641
641
  code: "TOKEN_IS_NOT_SUPPORTED"
642
- }) : O.includes("Failed to get a deposit address") ? new U({
642
+ }) : U.includes("Failed to get a deposit address") ? new q({
643
643
  code: "QUOTE_NO_ONE_TIME_ADDRESS"
644
644
  }) : S;
645
645
  }
646
- throw new U({
646
+ throw new q({
647
647
  code: "QUOTE_FAILED",
648
648
  meta: {
649
- message: O || "Failed to fetch quote. Please try again."
649
+ message: U || "Failed to fetch quote. Please try again."
650
650
  }
651
651
  });
652
652
  }
653
- return l ? {
653
+ return c ? {
654
654
  dry: !0,
655
655
  ...D,
656
656
  deadline: void 0,
@@ -663,14 +663,14 @@ const ds = (e) => {
663
663
  });
664
664
  },
665
665
  cancel: () => {
666
- u.current.abort("Abort quote manually"), u.current = new AbortController();
666
+ m.current.abort("Abort quote manually"), m.current = new AbortController();
667
667
  }
668
668
  };
669
- }, gs = () => {
670
- const { ctx: e } = _(), { intentsAccountType: t } = b(), { isNativeNearDeposit: s } = Z(), r = ne({
669
+ }, Is = () => {
670
+ const { ctx: e } = _(), { intentsAccountType: t } = y(), { isNativeNearDeposit: s } = J(), r = re({
671
671
  addressType: t,
672
672
  walletAddress: e.walletAddress ?? ""
673
- }), n = X(null), a = X(new AbortController()), c = L(() => async (d) => kt.post(
673
+ }), n = Z(null), a = Z(new AbortController()), l = L(() => async (d) => kt.post(
674
674
  "",
675
675
  {
676
676
  id: 1,
@@ -689,7 +689,7 @@ const ds = (e) => {
689
689
  ), [Ne]);
690
690
  return {
691
691
  make: async () => {
692
- if (!x(e, [
692
+ if (!O(e, [
693
693
  "input_valid_dry",
694
694
  "input_valid_external",
695
695
  "input_valid_internal",
@@ -697,13 +697,13 @@ const ds = (e) => {
697
697
  "quote_success_external"
698
698
  ])) {
699
699
  const i = `Unable to run quote in current state ${e.state}`;
700
- throw E.error(`[WIDGET] ${i}`), new U({
700
+ throw E.error(`[WIDGET] ${i}`), new q({
701
701
  code: "QUOTE_INVALID_INITIAL",
702
702
  meta: { isDry: !1, message: i }
703
703
  });
704
704
  }
705
705
  if (s && !e.isDepositFromExternalWallet || !s && e.sourceToken.assetId !== e.targetToken.assetId)
706
- throw new U({
706
+ throw new q({
707
707
  code: "QUOTE_INVALID_INITIAL",
708
708
  meta: {
709
709
  isDry: !1,
@@ -711,7 +711,7 @@ const ds = (e) => {
711
711
  }
712
712
  });
713
713
  if (e.sourceToken.isIntent)
714
- throw new U({
714
+ throw new q({
715
715
  code: "QUOTE_INVALID_INITIAL",
716
716
  meta: {
717
717
  isDry: !1,
@@ -719,7 +719,7 @@ const ds = (e) => {
719
719
  }
720
720
  });
721
721
  if (!e.isDepositFromExternalWallet && e.sourceToken.blockchain === "near")
722
- throw new U({
722
+ throw new q({
723
723
  code: "QUOTE_INVALID_INITIAL",
724
724
  meta: {
725
725
  isDry: !1,
@@ -728,36 +728,36 @@ const ds = (e) => {
728
728
  });
729
729
  if (!r) {
730
730
  const i = "No corresponding intents account to run a quote";
731
- throw E.error(`[WIDGET] ${i}`), new U({
731
+ throw E.error(`[WIDGET] ${i}`), new q({
732
732
  code: "QUOTE_INVALID_INITIAL",
733
733
  meta: { isDry: !1, message: i }
734
734
  });
735
735
  }
736
736
  n.current && (a.current.abort("Abort previous quote (auto)"), a.current = new AbortController());
737
- let u = Tt[e.targetToken.blockchain];
738
- if (!u)
739
- if (H(e.targetToken.blockchain))
740
- u = ht;
737
+ let m = ht[e.targetToken.blockchain];
738
+ if (!m)
739
+ if (G(e.targetToken.blockchain))
740
+ m = Tt;
741
741
  else
742
- throw new U({
742
+ throw new q({
743
743
  code: "QUOTE_INVALID_INITIAL",
744
744
  meta: { isDry: !1, message: "Chain is not supported by POA" }
745
745
  });
746
746
  try {
747
- return n.current = c({
748
- chain: u,
747
+ return n.current = l({
748
+ chain: m,
749
749
  accountId: r
750
750
  }), {
751
751
  depositAddress: (await n.current).data.result.address,
752
752
  amountIn: e.sourceTokenAmount,
753
753
  amountOut: e.targetTokenAmount,
754
754
  amountInUsd: `${parseFloat(
755
- Y(e.sourceTokenAmount, e.sourceToken.decimals)
755
+ X(e.sourceTokenAmount, e.sourceToken.decimals)
756
756
  ) * e.sourceToken.price}`,
757
757
  amountOutUsd: `${parseFloat(
758
- Y(e.targetTokenAmount, e.targetToken.decimals)
758
+ X(e.targetTokenAmount, e.targetToken.decimals)
759
759
  ) * e.targetToken.price}`,
760
- amountOutFormatted: Y(
760
+ amountOutFormatted: X(
761
761
  e.targetTokenAmount,
762
762
  e.targetToken.decimals
763
763
  ),
@@ -770,11 +770,11 @@ const ds = (e) => {
770
770
  if (i instanceof It)
771
771
  return;
772
772
  if (E.error(i), i instanceof wt) {
773
- const f = i.response?.data.message || i.message;
774
- throw new U({
773
+ const u = i.response?.data.message || i.message;
774
+ throw new q({
775
775
  code: "QUOTE_FAILED",
776
776
  meta: {
777
- message: f ?? "Failed to fetch quote. Please try again."
777
+ message: u ?? "Failed to fetch quote. Please try again."
778
778
  }
779
779
  });
780
780
  }
@@ -785,51 +785,51 @@ const ds = (e) => {
785
785
  }
786
786
  };
787
787
  }, st = (e) => {
788
- T("errorSet", e), T("quoteSet", void 0), T("quoteSetStatus", "idle"), T("transferSetStatus", { status: "idle" });
788
+ h("errorSet", e), h("quoteSet", void 0), h("quoteSetStatus", "idle"), h("transferSetStatus", { status: "idle" });
789
789
  }, at = async (e) => {
790
790
  if (!e.sendAddress)
791
791
  return;
792
792
  let t = !1;
793
793
  try {
794
- T("setInputsValidating", !0), t = await Sn(e.sendAddress);
794
+ h("setInputsValidating", !0), t = await Nn(e.sendAddress);
795
795
  } catch {
796
796
  st({
797
797
  code: "SEND_ADDRESS_IS_NOT_VERIFIED",
798
798
  meta: { address: e.sendAddress, chain: "near" }
799
- }), T("setInputsValidating", !1), F("initial_wallet");
799
+ }), h("setInputsValidating", !1), F("initial_wallet");
800
800
  return;
801
801
  }
802
- if (T("setInputsValidating", !1), !t) {
802
+ if (h("setInputsValidating", !1), !t) {
803
803
  st({
804
804
  code: "SEND_ADDRESS_IS_NOT_FOUND",
805
805
  meta: { address: e.sendAddress, chain: "near" }
806
806
  }), F("initial_wallet");
807
807
  return;
808
808
  }
809
- e.error ? Nn(e.error) && (T("errorSet", null), F("input_valid_external")) : F("input_valid_external");
809
+ e.error ? _n(e.error) && (h("errorSet", null), F("input_valid_external")) : F("input_valid_external");
810
810
  }, Ot = (e) => {
811
- const t = x(e, ["initial_dry"]), s = x(e, ["input_valid_dry"]);
811
+ const t = O(e, ["initial_dry"]), s = O(e, ["input_valid_dry"]);
812
812
  if (!t && !s)
813
813
  return;
814
814
  let r;
815
- return t && (e.sourceToken ? e.targetToken ? re(e.sourceTokenAmount) ? e.walletAddress && !Oe(e) && (r = { code: "SOURCE_BALANCE_INSUFFICIENT" }) : r = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : r = { code: "TARGET_TOKEN_IS_EMPTY" } : r = { code: "SOURCE_TOKEN_IS_EMPTY" }), !s && r ? T("errorSet", r) : e.error && !Fe(e.error) && !Le(e.error) && T("errorSet", null), s && r?.code === "SOURCE_BALANCE_INSUFFICIENT" && T("errorSet", r), s;
815
+ return t && (e.sourceToken ? e.targetToken ? se(e.sourceTokenAmount) ? e.walletAddress && !Oe(e) && (r = { code: "SOURCE_BALANCE_INSUFFICIENT" }) : r = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : r = { code: "TARGET_TOKEN_IS_EMPTY" } : r = { code: "SOURCE_TOKEN_IS_EMPTY" }), !s && r ? h("errorSet", r) : e.error && !Fe(e.error) && !Le(e.error) && h("errorSet", null), s && r?.code === "SOURCE_BALANCE_INSUFFICIENT" && h("errorSet", r), s;
816
816
  }, Ft = (e) => {
817
- const t = x(e, ["initial_wallet"]), s = x(e, ["input_valid_external"]);
817
+ const t = O(e, ["initial_wallet"]), s = O(e, ["input_valid_external"]);
818
818
  if (!t && !s)
819
819
  return;
820
820
  const r = e.sourceTokenBalance;
821
821
  let n;
822
- return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? n = { code: "SOURCE_TOKEN_IS_INTENT" } : re(e.sourceTokenAmount) ? e.sendAddress ? e.targetToken.blockchain === "near" ? St(e.sendAddress) ? at(e) : n = {
822
+ return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? n = { code: "SOURCE_TOKEN_IS_INTENT" } : se(e.sourceTokenAmount) ? e.sendAddress ? e.targetToken.blockchain === "near" ? St(e.sendAddress) ? at(e) : n = {
823
823
  code: "SEND_ADDRESS_IS_INVALID",
824
824
  meta: { address: e.sendAddress, chain: "near" }
825
- } : e.isDepositFromExternalWallet || (!r || !At(r) ? n = { code: "INVALID_SOURCE_BALANCE" } : Oe(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SEND_ADDRESS_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), s && e.targetToken.blockchain === "near" && at(e), !s && n ? T("errorSet", n) : e.error && !Fe(e.error) && !Le(e.error) && T("errorSet", null), s;
825
+ } : e.isDepositFromExternalWallet || (!r || !At(r) ? n = { code: "INVALID_SOURCE_BALANCE" } : Oe(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SEND_ADDRESS_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), s && e.targetToken.blockchain === "near" && at(e), !s && n ? h("errorSet", n) : e.error && !Fe(e.error) && !Le(e.error) && h("errorSet", null), s;
826
826
  }, Lt = (e) => {
827
- const t = x(e, ["initial_wallet"]), s = x(e, ["input_valid_internal"]);
827
+ const t = O(e, ["initial_wallet"]), s = O(e, ["input_valid_internal"]);
828
828
  if (!t && !s)
829
829
  return;
830
830
  const r = e.sourceTokenBalance;
831
831
  let n;
832
- return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? re(e.sourceTokenAmount) ? e.isDepositFromExternalWallet || (!r || !At(r) ? n = { code: "INVALID_SOURCE_BALANCE" } : Oe(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_NOT_INTENT" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), !s && n ? T("errorSet", n) : e.error && !Fe(e.error) && !Le(e.error) && T("errorSet", null), s;
832
+ return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? se(e.sourceTokenAmount) ? e.isDepositFromExternalWallet || (!r || !At(r) ? n = { code: "INVALID_SOURCE_BALANCE" } : Oe(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_NOT_INTENT" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), !s && n ? h("errorSet", n) : e.error && !Fe(e.error) && !Le(e.error) && h("errorSet", null), s;
833
833
  }, Bt = (e) => {
834
834
  const t = xe(e), s = !t && e.targetToken?.isIntent === !0, r = !t && e.targetToken?.isIntent === !1;
835
835
  if (t) {
@@ -837,7 +837,7 @@ const ds = (e) => {
837
837
  return F(n ? "input_valid_dry" : "initial_dry");
838
838
  }
839
839
  r && Ft(e) ? F("input_valid_external") : s && Lt(e) ? F("input_valid_internal") : F("initial_wallet");
840
- }, Is = ({
840
+ }, ws = ({
841
841
  isEnabled: e,
842
842
  message: t,
843
843
  type: s = "exact_in",
@@ -845,31 +845,31 @@ const ds = (e) => {
845
845
  }) => {
846
846
  const { ctx: n } = _(), {
847
847
  isNativeNearDeposit: a,
848
- isDirectNonNearWithdrawal: c,
849
- isDirectTokenOnNearDeposit: l,
848
+ isDirectNonNearWithdrawal: l,
849
+ isDirectTokenOnNearDeposit: c,
850
850
  isDirectNearTokenWithdrawal: d,
851
- isDirectTokenOnNearTransfer: u,
851
+ isDirectTokenOnNearTransfer: m,
852
852
  isSameAssetDiffChainWithdrawal: i
853
- } = Z(), f = xe(n), p = e && !n.areInputsValidating && (i || (l || a) && n.isDepositFromExternalWallet || !d && !c && !l && !u), { make: I, cancel: m } = hs(), { make: w, cancel: k } = gs(), y = X(null), q = () => {
854
- m(), k();
853
+ } = J(), u = xe(n), p = e && !n.areInputsValidating && (i || (c || a) && n.isDepositFromExternalWallet || !d && !l && !c && !m), { make: w, cancel: f } = gs(), { make: g, cancel: k } = Is(), b = Z(null), B = () => {
854
+ f(), k();
855
855
  };
856
856
  R(() => {
857
- const B = x(n, ["input_valid_dry"]), S = x(n, ["input_valid_external"]), O = x(n, ["input_valid_internal"]);
858
- (f && !B || !f && n.targetToken?.isIntent && !O || !f && !n.targetToken?.isIntent && !S || n.areInputsValidating) && q();
859
- }, [q, f, n]);
860
- const D = le(
861
- async (B) => {
857
+ const C = O(n, ["input_valid_dry"]), S = O(n, ["input_valid_external"]), U = O(n, ["input_valid_internal"]);
858
+ (u && !C || !u && n.targetToken?.isIntent && !U || !u && !n.targetToken?.isIntent && !S || n.areInputsValidating) && B();
859
+ }, [B, u, n]);
860
+ const D = ce(
861
+ async (C) => {
862
862
  try {
863
863
  let S;
864
864
  if (n.sourceToken?.assetId === n.targetToken?.assetId || a && n.isDepositFromExternalWallet) {
865
- if (f)
865
+ if (u)
866
866
  return;
867
- T("quoteSetStatus", "pending"), S = await w();
867
+ h("quoteSetStatus", "pending"), S = await g();
868
868
  } else
869
- T("quoteSetStatus", "pending"), S = await I({ message: t, quoteType: s, options: B });
869
+ h("quoteSetStatus", "pending"), S = await w({ message: t, quoteType: s, options: C });
870
870
  if (!S)
871
871
  return;
872
- if (T("quoteSetStatus", "success"), T("quoteSet", S), !f && n.error?.code !== "SOURCE_BALANCE_INSUFFICIENT" && T("errorSet", null), T("tokenSetAmount", {
872
+ if (h("quoteSetStatus", "success"), h("quoteSet", S), !u && n.error?.code !== "SOURCE_BALANCE_INSUFFICIENT" && h("errorSet", null), h("tokenSetAmount", {
873
873
  variant: "target",
874
874
  amount: S.amountOut
875
875
  }), n.state === "input_valid_dry") {
@@ -878,48 +878,48 @@ const ds = (e) => {
878
878
  }
879
879
  n.targetToken?.isIntent ? F("quote_success_internal") : F("quote_success_external");
880
880
  } catch (S) {
881
- if (S instanceof U) {
881
+ if (S instanceof q) {
882
882
  if (S.data.code === "QUOTE_INVALID_INITIAL") {
883
- T("quoteSetStatus", "idle"), T("quoteSet", void 0), T("errorSet", null);
883
+ h("quoteSetStatus", "idle"), h("quoteSet", void 0), h("errorSet", null);
884
884
  return;
885
885
  }
886
- T("quoteSetStatus", "error"), T("quoteSet", void 0), T("errorSet", S.data), Bt(n);
886
+ h("quoteSetStatus", "error"), h("quoteSet", void 0), h("errorSet", S.data), Bt(n);
887
887
  return;
888
888
  }
889
- E.error("Unhandled error in useMakeQuoteEffect:", S), T("quoteSetStatus", "error"), T("quoteSet", void 0), T("errorSet", {
889
+ E.error("Unhandled error in useMakeQuoteEffect:", S), h("quoteSetStatus", "error"), h("quoteSet", void 0), h("errorSet", {
890
890
  code: "QUOTE_FAILED",
891
891
  meta: { message: "Unknown error" }
892
892
  });
893
893
  }
894
894
  },
895
- [n, f, w, I, t, s, p]
895
+ [n, u, g, w, t, s, p]
896
896
  );
897
897
  R(() => {
898
- !p || !(f ? n.state === "input_valid_dry" : n.state === "input_valid_external" && !n.targetToken?.isIntent || n.state === "input_valid_internal" && n.targetToken?.isIntent) || n.quoteStatus !== "error" && (a && !n.isDepositFromExternalWallet || D({ isRefetch: !1 }));
899
- }, [p, D, q, n.sourceToken, n.targetToken]), R(() => {
900
- const B = () => {
901
- y.current && (clearInterval(y.current), y.current = null);
898
+ !p || !(u ? n.state === "input_valid_dry" : n.state === "input_valid_external" && !n.targetToken?.isIntent || n.state === "input_valid_internal" && n.targetToken?.isIntent) || n.quoteStatus !== "error" && (a && !n.isDepositFromExternalWallet || D({ isRefetch: !1 }));
899
+ }, [p, D, B, n.sourceToken, n.targetToken]), R(() => {
900
+ const C = () => {
901
+ b.current && (clearInterval(b.current), b.current = null);
902
902
  };
903
- return n.state !== "quote_success_internal" && n.state !== "quote_success_external" || !r || (y.current = setInterval(async () => {
903
+ return n.state !== "quote_success_internal" && n.state !== "quote_success_external" || !r || (b.current = setInterval(async () => {
904
904
  await D({ isRefetch: !0 });
905
- }, r)), B;
906
- }, [p, D, q, n.state]);
905
+ }, r)), C;
906
+ }, [p, D, B, n.state]);
907
907
  }, Ie = {
908
908
  sol: "sol",
909
909
  evm: "eth",
910
910
  near: "near"
911
- }, ws = ({
911
+ }, ks = ({
912
912
  isEnabled: e,
913
913
  skipIntents: t = !1,
914
914
  target: s = "none"
915
915
  }) => {
916
- const { tokens: r } = V(), { ctx: n, state: a } = _(), { intentBalances: c } = pe(), { walletSupportedChains: l, chainsFilter: d, intentsAccountType: u } = b(), i = bn({
916
+ const { tokens: r } = V(), { ctx: n, state: a } = _(), { intentBalances: l } = pe(), { walletSupportedChains: c, chainsFilter: d, intentsAccountType: m } = y(), i = En({
917
917
  tokens: r,
918
- walletSupportedChains: l,
919
- balances: c,
918
+ walletSupportedChains: c,
919
+ balances: l,
920
920
  across: "intents"
921
- }), [f, p] = L(() => !n.walletAddress && !t ? [
922
- { token: yn({ tokens: r }), status: "loaded" },
921
+ }), [u, p] = L(() => !n.walletAddress && !t ? [
922
+ { token: bn({ tokens: r }), status: "loaded" },
923
923
  { token: void 0, status: "loaded" }
924
924
  ] : d.source.intents !== "none" && !t ? i ? [
925
925
  { token: i, status: "loaded" },
@@ -928,9 +928,9 @@ const ds = (e) => {
928
928
  { token: void 0, status: "loading" },
929
929
  { token: void 0, status: "loading" }
930
930
  ] : [
931
- { token: _n({
931
+ { token: yn({
932
932
  tokens: r,
933
- walletSupportedChains: l
933
+ walletSupportedChains: c
934
934
  }), status: "loaded" },
935
935
  { token: void 0, status: "loaded" }
936
936
  ], [
@@ -939,104 +939,104 @@ const ds = (e) => {
939
939
  d,
940
940
  n.walletAddress,
941
941
  i,
942
- l,
942
+ c,
943
943
  a
944
944
  ]);
945
945
  R(() => {
946
946
  if (!e)
947
947
  return;
948
- if (x(n, ["initial_dry", "initial_wallet"]) && (f.status === "loaded" && !n.sourceToken && T("tokenSelect", {
948
+ if (O(n, ["initial_dry", "initial_wallet"]) && (u.status === "loaded" && !n.sourceToken && h("tokenSelect", {
949
949
  variant: "source",
950
- token: f.token
951
- }), p.status === "loaded" && f.status === "loaded" && !n.targetToken)) {
952
- let w = p.token;
950
+ token: u.token
951
+ }), p.status === "loaded" && u.status === "loaded" && !n.targetToken)) {
952
+ let g = p.token;
953
953
  if (s === "same-asset")
954
- if (f.token?.isIntent) {
955
- if (!u)
954
+ if (u.token?.isIntent) {
955
+ if (!m)
956
956
  throw new Error(
957
957
  "Intents account type is required to select same-asset target token"
958
958
  );
959
- w = r.find(
960
- (k) => !k.isIntent && k.symbol === n.sourceToken?.symbol && k.blockchain === Ie[u]
959
+ g = r.find(
960
+ (k) => !k.isIntent && k.symbol === n.sourceToken?.symbol && k.blockchain === Ie[m]
961
961
  );
962
962
  } else
963
- w = r.find(
963
+ g = r.find(
964
964
  (k) => k.isIntent && k.symbol === n.sourceToken?.symbol
965
965
  );
966
- T("tokenSelect", {
966
+ h("tokenSelect", {
967
967
  variant: "target",
968
- token: w
968
+ token: g
969
969
  });
970
970
  }
971
- }, [n, f, p, e]);
972
- const I = (m, w) => {
971
+ }, [n, u, p, e]);
972
+ const w = (f, g) => {
973
973
  const k = r.find(
974
- (y) => !y.isIntent && y.blockchain === Ie[m] && y.symbol.toLowerCase() === cn[Ie[m]]?.toLowerCase()
975
- ) ?? w;
976
- T("tokenSelect", {
974
+ (b) => !b.isIntent && b.blockchain === Ie[f] && b.symbol.toLowerCase() === dn[Ie[f]]?.toLowerCase()
975
+ ) ?? g;
976
+ h("tokenSelect", {
977
977
  variant: "source",
978
978
  token: k
979
979
  });
980
980
  };
981
981
  return R(() => {
982
- const m = x(n, ["initial_dry", "initial_wallet"]);
983
- if (!e || !m)
982
+ const f = O(n, ["initial_dry", "initial_wallet"]);
983
+ if (!e || !f)
984
984
  return;
985
- const w = r.find(
986
- (y) => y.isIntent && y.symbol === "AURORA" && y.blockchain === "near"
985
+ const g = r.find(
986
+ (b) => b.isIntent && b.symbol === "AURORA" && b.blockchain === "near"
987
987
  ), k = setTimeout(() => {
988
- f.token || (!t && i ? T("tokenSelect", {
988
+ u.token || (!t && i ? h("tokenSelect", {
989
989
  variant: "source",
990
990
  token: i
991
- }) : l.length && u ? I(u, w) : n.walletAddress && Nt(n.walletAddress) ? I("sol", w) : n.walletAddress && _t(n.walletAddress) ? I("evm", w) : n.walletAddress && St(n.walletAddress) ? I("near", w) : T("tokenSelect", {
991
+ }) : c.length && m ? w(m, g) : n.walletAddress && Nt(n.walletAddress) ? w("sol", g) : n.walletAddress && _t(n.walletAddress) ? w("evm", g) : n.walletAddress && St(n.walletAddress) ? w("near", g) : h("tokenSelect", {
992
992
  variant: "source",
993
- token: w
993
+ token: g
994
994
  }));
995
995
  }, 3e3);
996
996
  return () => clearTimeout(k);
997
- }, [r, f, t]), { source: n.sourceToken, target: n.targetToken };
998
- }, ks = ({
997
+ }, [r, u, t]), { source: n.sourceToken, target: n.targetToken };
998
+ }, As = ({
999
999
  isEnabled: e,
1000
1000
  alchemyApiKey: t
1001
1001
  }) => {
1002
- const { connectedWallets: s } = b();
1002
+ const { connectedWallets: s } = y();
1003
1003
  xt({
1004
1004
  isEnabled: e,
1005
1005
  connectedWallets: s,
1006
1006
  alchemyApiKey: t ?? ""
1007
1007
  });
1008
- }, As = (e, t) => {
1008
+ }, Ss = (e, t) => {
1009
1009
  const { config: s } = Ee(Ve);
1010
1010
  return e.targetToken && !e.sendAddress && !!e.walletAddress && !e.targetToken.isIntent && !t.find((r) => r?.key === "sendAddress") && s.walletSupportedChains.includes(e.targetToken.blockchain);
1011
- }, Ss = ({ debug: e }) => {
1012
- J.onContextChange((t, s) => {
1011
+ }, Ns = ({ debug: e }) => {
1012
+ ee.onContextChange((t, s) => {
1013
1013
  const r = s;
1014
- if (e && E.debug("[WIDGET] Context changed", r), e && t.error && Cn(r) && E.debug(`[WIDGET] Error set to ${t.error.code}`), Dn(r) || Fn(t, r, e))
1014
+ if (e && E.debug("[WIDGET] Context changed", r), e && t.error && vn(r) && E.debug(`[WIDGET] Error set to ${t.error.code}`), Dn(r) || Ln(t, r, e))
1015
1015
  return;
1016
- if (xn(t, r)) {
1017
- T("reset", { clearWalletAddress: !0 }), F("initial_dry");
1016
+ if (On(t, r)) {
1017
+ h("reset", { clearWalletAddress: !0 }), F("initial_dry");
1018
1018
  return;
1019
1019
  }
1020
- const { isChanged: n, isDry: a } = Rn(t, r);
1020
+ const { isChanged: n, isDry: a } = Cn(t, r);
1021
1021
  if (n) {
1022
- if (vn(t)) {
1023
- const c = a ? "initial_dry" : "initial_wallet";
1024
- F(c, {
1022
+ if (xn(t)) {
1023
+ const l = a ? "initial_dry" : "initial_wallet";
1024
+ F(l, {
1025
1025
  onMoved: () => {
1026
1026
  e && E.debug(
1027
- `[WIDGET] Inputs changed. State moved to ${c}`
1027
+ `[WIDGET] Inputs changed. State moved to ${l}`
1028
1028
  );
1029
1029
  }
1030
1030
  });
1031
1031
  }
1032
- En(t) || (t.quote = void 0, t.quoteStatus = "idle", t.transferStatus = { status: "idle" }), On(t) && (t.sendAddress = void 0), As(t, r) && (t.sendAddress = t.walletAddress), Bt(t);
1032
+ Rn(t) || (t.quote = void 0, t.quoteStatus = "idle", t.transferStatus = { status: "idle" }), Fn(t) && (t.sendAddress = void 0), Ss(t, r) && (t.sendAddress = t.walletAddress), Bt(t);
1033
1033
  }
1034
1034
  });
1035
- }, Ns = ({ debug: e }) => {
1036
- J.onTransition((t, s) => {
1035
+ }, _s = ({ debug: e }) => {
1036
+ ee.onTransition((t, s) => {
1037
1037
  e && E.debug(`===> [WIDGET] State moved from ${t} to ${s}`);
1038
1038
  });
1039
- }, _s = (e, t) => {
1039
+ }, ys = (e, t) => {
1040
1040
  const { variant: s, token: r } = t, { config: n } = Ee(Ve);
1041
1041
  switch (s) {
1042
1042
  case "source":
@@ -1060,20 +1060,20 @@ const ds = (e) => {
1060
1060
  e.targetToken = r;
1061
1061
  break;
1062
1062
  default:
1063
- ve(s, { throwError: !1 });
1063
+ De(s, { throwError: !1 });
1064
1064
  }
1065
- }, v = (e, t) => J.on(
1065
+ }, x = (e, t) => ee.on(
1066
1066
  e,
1067
- (s, r) => t(s, r, J)
1068
- ), ys = () => {
1069
- v("quoteSetStatus", Wn), v("walletAddressSet", $n), v("transferSetStatus", Hn), v("tokenSelectRotate", _e), v("tokenSetBalance", Kn), v("tokenSetAmount", Pn), v("depositTypeSet", Vn), v("setInputsValidating", Qn), v("externalDepositTxSet", Mn), v("tokenSelect", _s), v("addressSet", Un), v("errorSet", Bn), v("quoteSet", qn), v("reset", Ln), v("validateDryInputs", Ot), v("validateExternalInputs", Ft), v("validateInternalInputs", Lt);
1070
- }, bs = Tn(({ debug: e }) => {
1067
+ (s, r) => t(s, r, ee)
1068
+ ), bs = () => {
1069
+ x("quoteSetStatus", Vn), x("walletAddressSet", Kn), x("transferSetStatus", Gn), x("tokenSelectRotate", _e), x("tokenSetBalance", Hn), x("tokenSetAmount", Wn), x("depositTypeSet", Mn), x("setInputsValidating", $n), x("externalDepositTxSet", Qn), x("tokenSelect", ys), x("addressSet", Pn), x("errorSet", qn), x("quoteSet", Un), x("reset", Bn), x("validateDryInputs", Ot), x("validateExternalInputs", Ft), x("validateInternalInputs", Lt);
1070
+ }, Es = Tn(({ debug: e }) => {
1071
1071
  e && E.debug(
1072
- "[WIDGET] Debug mode is enabled (package version: 3.18.3)"
1073
- ), ys(), Ns({ debug: e }), Ss({ debug: e });
1074
- }), Dl = ({ listenTo: e, debug: t = !1 }) => {
1072
+ "[WIDGET] Debug mode is enabled (package version: 3.19.0)"
1073
+ ), bs(), _s({ debug: e }), Ns({ debug: e });
1074
+ }), Dc = ({ listenTo: e, debug: t = !1 }) => {
1075
1075
  R(() => {
1076
- bs({ debug: t });
1076
+ Es({ debug: t });
1077
1077
  }, [t]);
1078
1078
  const s = e.find(
1079
1079
  (a) => Array.isArray(a) && a[0] === "setBalancesUsingAlchemyExt"
@@ -1082,34 +1082,34 @@ const ds = (e) => {
1082
1082
  ), n = e.find(
1083
1083
  (a) => Array.isArray(a) && a[0] === "makeQuote"
1084
1084
  );
1085
- ks({
1085
+ As({
1086
1086
  isEnabled: !!s,
1087
1087
  alchemyApiKey: s?.[1].alchemyApiKey
1088
- }), ws({
1088
+ }), ks({
1089
1089
  isEnabled: !!r,
1090
1090
  skipIntents: r?.[1].skipIntents,
1091
1091
  target: r?.[1].target
1092
- }), Is({
1092
+ }), ws({
1093
1093
  isEnabled: !!n,
1094
1094
  message: n?.[1].message,
1095
1095
  type: n?.[1].type,
1096
1096
  refetchQuoteInterval: n?.[1].refetchQuoteInterval
1097
- }), ps({
1097
+ }), hs({
1098
1098
  isEnabled: e.includes("checkWalletConnection")
1099
- }), ms({
1100
- isEnabled: e.includes("setSourceTokenBalance")
1101
1099
  }), fs({
1100
+ isEnabled: e.includes("setSourceTokenBalance")
1101
+ }), ps({
1102
1102
  isEnabled: e.includes("setSourceTokenIntentsTarget")
1103
- }), us({
1103
+ }), ms({
1104
1104
  isEnabled: e.includes("updateBalances"),
1105
1105
  alchemyApiKey: s?.[1].alchemyApiKey
1106
1106
  });
1107
- }, Es = J.getStore();
1107
+ }, Rs = ee.getStore();
1108
1108
  class M extends Error {
1109
1109
  context;
1110
1110
  _is_widget_error = !0;
1111
1111
  constructor(t, s) {
1112
- super(t), this.name = "WidgetError", this.cause = s?.cause, this.context = Ee(Es).context;
1112
+ super(t), this.name = "WidgetError", this.cause = s?.cause, this.context = Ee(Rs).context;
1113
1113
  }
1114
1114
  }
1115
1115
  class qt extends M {
@@ -1118,49 +1118,49 @@ class qt extends M {
1118
1118
  super(t.code), this.data = t, this.name = "MachineError";
1119
1119
  }
1120
1120
  }
1121
- class U extends qt {
1121
+ class q extends qt {
1122
1122
  constructor(t) {
1123
1123
  super(t), this.name = "QuoteError";
1124
1124
  }
1125
1125
  }
1126
- class g extends qt {
1126
+ class I extends qt {
1127
1127
  constructor(t) {
1128
1128
  super(t), this.name = "TransferError";
1129
1129
  }
1130
1130
  }
1131
- const vl = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, Q = J.getStore(), Rs = mn({
1132
- usdTradeDelta: (e) => Gn(e(Q.context)),
1133
- isDirectNearTokenWithdrawal: (e) => Yn(e(Q.context)),
1134
- isDirectNonNearWithdrawal: (e) => jn(e(Q.context)),
1135
- isDirectTokenOnNearDeposit: (e) => pn(e(Q.context)),
1136
- isNativeNearDeposit: (e) => fn(e(Q.context)),
1137
- isSameAssetDiffChainWithdrawal: (e) => Xn(e(Q.context)),
1138
- isDirectTokenOnNearTransfer: (e) => zn(e(Q.context))
1139
- }), Z = () => me(Rs), _ = () => {
1140
- const e = me(Q);
1131
+ const xc = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, $ = ee.getStore(), Cs = fn({
1132
+ usdTradeDelta: (e) => jn(e($.context)),
1133
+ isDirectNearTokenWithdrawal: (e) => Xn(e($.context)),
1134
+ isDirectNonNearWithdrawal: (e) => zn(e($.context)),
1135
+ isDirectTokenOnNearDeposit: (e) => hn(e($.context)),
1136
+ isNativeNearDeposit: (e) => pn(e($.context)),
1137
+ isSameAssetDiffChainWithdrawal: (e) => Zn(e($.context)),
1138
+ isDirectTokenOnNearTransfer: (e) => Yn(e($.context))
1139
+ }), J = () => me(Cs), _ = () => {
1140
+ const e = me($);
1141
1141
  return {
1142
1142
  state: e.state,
1143
1143
  ctx: e.context
1144
1144
  };
1145
- }, xl = (e) => {
1146
- const t = me(Q);
1147
- if (!x(t.context, [e]))
1145
+ }, Oc = (e) => {
1146
+ const t = me($);
1147
+ if (!O(t.context, [e]))
1148
1148
  throw new M(
1149
1149
  `[WIDGET] Attempt to access snapshot for ${e} state while context does not match`
1150
1150
  );
1151
1151
  return t.context;
1152
- }, Cs = async ({
1152
+ }, vs = async ({
1153
1153
  contractId: e,
1154
1154
  accountId: t
1155
1155
  }) => {
1156
1156
  try {
1157
- const s = { account_id: t }, r = qe.from(JSON.stringify(s)).toString("base64"), n = await Jn.query({
1157
+ const s = { account_id: t }, r = qe.from(JSON.stringify(s)).toString("base64"), n = await er.query({
1158
1158
  request_type: "call_function",
1159
1159
  method_name: "storage_balance_of",
1160
1160
  account_id: e,
1161
1161
  args_base64: r,
1162
1162
  finality: "optimistic"
1163
- }), a = Zn(
1163
+ }), a = Jn(
1164
1164
  n,
1165
1165
  oe.union([oe.null(), oe.object({ total: oe.string() })])
1166
1166
  );
@@ -1170,36 +1170,36 @@ const vl = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e
1170
1170
  }
1171
1171
  };
1172
1172
  function Ds(e) {
1173
- const { ctx: t } = _(), { isNativeNearDeposit: s } = Z(), r = t.sourceToken?.contractAddress, n = t.quote?.amountIn ?? t.sourceTokenAmount;
1173
+ const { ctx: t } = _(), { isNativeNearDeposit: s } = J(), r = t.sourceToken?.contractAddress, n = t.quote?.amountIn ?? t.sourceTokenAmount;
1174
1174
  return {
1175
- make: async (c, l) => {
1175
+ make: async (l, c) => {
1176
1176
  if (!e)
1177
- throw new g({
1177
+ throw new I({
1178
1178
  code: "TRANSFER_INVALID_INITIAL",
1179
1179
  meta: { message: "No connected wallet to sign a transfer." }
1180
1180
  });
1181
- if (!r && t.sourceToken?.assetId !== G)
1182
- throw new g({
1181
+ if (!r && t.sourceToken?.assetId !== j)
1182
+ throw new I({
1183
1183
  code: "TRANSFER_INVALID_INITIAL",
1184
1184
  meta: { message: "No token selected to transfer." }
1185
1185
  });
1186
- if (!c)
1187
- throw new g({
1186
+ if (!l)
1187
+ throw new I({
1188
1188
  code: "TRANSFER_INVALID_INITIAL",
1189
1189
  meta: { message: "No recipient address to transfer." }
1190
1190
  });
1191
1191
  if (!n)
1192
- throw new g({
1192
+ throw new I({
1193
1193
  code: "TRANSFER_INVALID_INITIAL",
1194
1194
  meta: { message: "No amount to transfer." }
1195
1195
  });
1196
1196
  const d = e();
1197
- if (t.sourceToken.assetId === G && t.targetToken?.assetId !== Se) {
1197
+ if (t.sourceToken.assetId === j && t.targetToken?.assetId !== Se) {
1198
1198
  const i = await d.signAndSendTransactions({
1199
1199
  transactions: [
1200
1200
  {
1201
1201
  signerId: t.walletAddress,
1202
- receiverId: c,
1202
+ receiverId: l,
1203
1203
  actions: [
1204
1204
  {
1205
1205
  type: "Transfer",
@@ -1222,10 +1222,10 @@ function Ds(e) {
1222
1222
  intent: void 0
1223
1223
  };
1224
1224
  }
1225
- const u = [];
1225
+ const m = [];
1226
1226
  if (t.targetToken && s)
1227
1227
  try {
1228
- u.push({
1228
+ m.push({
1229
1229
  type: "FunctionCall",
1230
1230
  params: {
1231
1231
  methodName: "near_deposit",
@@ -1233,7 +1233,7 @@ function Ds(e) {
1233
1233
  deposit: n,
1234
1234
  args: {}
1235
1235
  }
1236
- }), u.push({
1236
+ }), m.push({
1237
1237
  type: "FunctionCall",
1238
1238
  params: {
1239
1239
  methodName: "ft_transfer_call",
@@ -1242,8 +1242,8 @@ function Ds(e) {
1242
1242
  gas: ze,
1243
1243
  args: {
1244
1244
  amount: n,
1245
- receiver_id: c,
1246
- msg: l ?? ""
1245
+ receiver_id: l,
1246
+ msg: c ?? ""
1247
1247
  }
1248
1248
  }
1249
1249
  });
@@ -1251,7 +1251,7 @@ function Ds(e) {
1251
1251
  transactions: [
1252
1252
  {
1253
1253
  receiverId: "wrap.near",
1254
- actions: u
1254
+ actions: m
1255
1255
  }
1256
1256
  ]
1257
1257
  });
@@ -1261,96 +1261,96 @@ function Ds(e) {
1261
1261
  transactionLink: `https://nearblocks.io/txns/${i[0].transaction?.hash}`,
1262
1262
  intent: void 0
1263
1263
  };
1264
- throw new g({
1264
+ throw new I({
1265
1265
  code: "NO_DEPOSIT_RESULT"
1266
1266
  });
1267
1267
  } catch (i) {
1268
- if (ce(i) && de(i))
1268
+ if (le(i) && de(i))
1269
1269
  return;
1270
- throw E.error("[TRANSFER ERROR]", i), new g({
1270
+ throw E.error("[TRANSFER ERROR]", i), new I({
1271
1271
  code: "DIRECT_TRANSFER_ERROR"
1272
1272
  });
1273
1273
  }
1274
1274
  if (!r)
1275
- throw new g({
1275
+ throw new I({
1276
1276
  code: "TRANSFER_INVALID_INITIAL",
1277
1277
  meta: { message: "No token selected to transfer." }
1278
1278
  });
1279
1279
  try {
1280
- const [i, f] = await Promise.all([
1281
- er({
1280
+ const [i, u] = await Promise.all([
1281
+ tr({
1282
1282
  contractId: r
1283
1283
  }),
1284
- Cs({
1284
+ vs({
1285
1285
  contractId: r,
1286
- accountId: c
1286
+ accountId: l
1287
1287
  })
1288
- ]), p = i - f;
1289
- p > 0n && u.push({
1288
+ ]), p = i - u;
1289
+ p > 0n && m.push({
1290
1290
  type: "FunctionCall",
1291
1291
  params: {
1292
1292
  methodName: "storage_deposit",
1293
- args: { account_id: c },
1293
+ args: { account_id: l },
1294
1294
  gas: je,
1295
1295
  deposit: p.toString()
1296
1296
  }
1297
- }), u.push({
1297
+ }), m.push({
1298
1298
  type: "FunctionCall",
1299
1299
  params: {
1300
1300
  methodName: "ft_transfer_call",
1301
1301
  args: {
1302
- receiver_id: c,
1302
+ receiver_id: l,
1303
1303
  amount: n,
1304
- msg: l ?? ""
1304
+ msg: c ?? ""
1305
1305
  },
1306
1306
  gas: ze,
1307
1307
  deposit: "1"
1308
1308
  }
1309
1309
  });
1310
- const I = await d.signAndSendTransactions({
1310
+ const w = await d.signAndSendTransactions({
1311
1311
  transactions: [
1312
1312
  {
1313
1313
  receiverId: r,
1314
- actions: u
1314
+ actions: m
1315
1315
  }
1316
1316
  ]
1317
1317
  });
1318
- if (I?.[0]?.transaction?.hash)
1318
+ if (w?.[0]?.transaction?.hash)
1319
1319
  return {
1320
- hash: I[0].transaction?.hash ?? "",
1321
- transactionLink: `https://nearblocks.io/txns/${I[0].transaction?.hash}`,
1320
+ hash: w[0].transaction?.hash ?? "",
1321
+ transactionLink: `https://nearblocks.io/txns/${w[0].transaction?.hash}`,
1322
1322
  intent: void 0
1323
1323
  };
1324
- throw new g({
1324
+ throw new I({
1325
1325
  code: "NO_DEPOSIT_RESULT"
1326
1326
  });
1327
1327
  } catch (i) {
1328
- if (ce(i) && de(i))
1328
+ if (le(i) && de(i))
1329
1329
  return;
1330
- throw E.error("[TRANSFER ERROR]", i), new g({
1330
+ throw E.error("[TRANSFER ERROR]", i), new I({
1331
1331
  code: "DIRECT_TRANSFER_ERROR"
1332
1332
  });
1333
1333
  }
1334
1334
  }
1335
1335
  };
1336
1336
  }
1337
- const vs = ({
1337
+ const xs = ({
1338
1338
  makeTransfer: e,
1339
1339
  providers: t
1340
1340
  }) => {
1341
- const { ctx: s } = _(), { alchemyApiKey: r } = b(), { make: n } = tr({
1341
+ const { ctx: s } = _(), { alchemyApiKey: r } = y(), { make: n } = nr({
1342
1342
  provider: t?.evm
1343
- }), { make: a } = nr({
1343
+ }), { make: a } = rr({
1344
1344
  provider: t?.sol,
1345
1345
  alchemyApiKey: r
1346
- }), c = (d) => {
1346
+ }), l = (d) => {
1347
1347
  if (e)
1348
1348
  return e;
1349
1349
  if (_t(d))
1350
1350
  return n;
1351
1351
  if (Nt(d))
1352
1352
  return a;
1353
- throw new g({
1353
+ throw new I({
1354
1354
  code: "TRANSFER_INVALID_INITIAL",
1355
1355
  meta: { message: "No transfer function established." }
1356
1356
  });
@@ -1358,21 +1358,21 @@ const vs = ({
1358
1358
  return { make: async () => {
1359
1359
  if (!s.sourceToken) {
1360
1360
  const i = "No token selected to transfer.";
1361
- throw new g({
1361
+ throw new I({
1362
1362
  code: "TRANSFER_INVALID_INITIAL",
1363
1363
  meta: { message: i }
1364
1364
  });
1365
1365
  }
1366
1366
  if (!s.quote) {
1367
1367
  const i = "Quote is required for a transfer.";
1368
- throw new g({
1368
+ throw new I({
1369
1369
  code: "TRANSFER_INVALID_INITIAL",
1370
1370
  meta: { message: i }
1371
1371
  });
1372
1372
  }
1373
1373
  if (!s.quote.depositAddress) {
1374
1374
  const i = "Quote has no deposit address. Make sure not dry.";
1375
- throw new g({
1375
+ throw new I({
1376
1376
  code: "TRANSFER_INVALID_INITIAL",
1377
1377
  meta: { message: i }
1378
1378
  });
@@ -1382,18 +1382,18 @@ const vs = ({
1382
1382
  decimals: s.sourceToken.decimals,
1383
1383
  address: s.quote.depositAddress,
1384
1384
  chain: s.sourceToken.blockchain,
1385
- evmChainId: H(s.sourceToken.blockchain) ? Ae[s.sourceToken.blockchain] : null,
1385
+ evmChainId: G(s.sourceToken.blockchain) ? Ae[s.sourceToken.blockchain] : null,
1386
1386
  isNativeEvmTokenTransfer: !!s.sourceToken && yt(s.sourceToken),
1387
- tokenAddress: s.sourceToken.assetId === G ? G : s.sourceToken.contractAddress,
1387
+ tokenAddress: s.sourceToken.assetId === j ? j : s.sourceToken.contractAddress,
1388
1388
  sourceAssetId: s.sourceToken.assetId,
1389
1389
  targetAssetId: s.targetToken.assetId
1390
- }, u = c(d.address);
1390
+ }, m = l(d.address);
1391
1391
  try {
1392
- const i = await u(d);
1392
+ const i = await m(d);
1393
1393
  if (!i) {
1394
1394
  if (e)
1395
1395
  return;
1396
- throw E.error("[TRANSFER ERROR]", "No deposit result"), new g({
1396
+ throw E.error("[TRANSFER ERROR]", "No deposit result"), new I({
1397
1397
  code: "NO_DEPOSIT_RESULT"
1398
1398
  });
1399
1399
  }
@@ -1404,26 +1404,26 @@ const vs = ({
1404
1404
  };
1405
1405
  } catch (i) {
1406
1406
  E.error("[TRANSFER ERROR]", i, { error: i });
1407
- let f = "Failed to make a transfer. Please try again.";
1408
- const p = ce(i) && de(i);
1407
+ let u = "Failed to make a transfer. Please try again.";
1408
+ const p = le(i) && de(i);
1409
1409
  if (p)
1410
1410
  return;
1411
- throw An.isAxiosError(i) ? (f = i.response?.data?.detail ?? i.message ?? "Failed to make deposit. Please try again.", new g({
1411
+ throw Sn.isAxiosError(i) ? (u = i.response?.data?.detail ?? i.message ?? "Failed to make deposit. Please try again.", new I({
1412
1412
  code: "QUOTE_ERROR",
1413
- meta: { message: f }
1414
- })) : f === "No quotes found" ? new g({
1413
+ meta: { message: u }
1414
+ })) : u === "No quotes found" ? new I({
1415
1415
  code: "NO_QUOTE_FOUND"
1416
- }) : i instanceof Error && !p ? new g({
1416
+ }) : i instanceof Error && !p ? new I({
1417
1417
  code: "QUOTE_ERROR",
1418
1418
  meta: { message: i.message }
1419
- }) : new g({
1419
+ }) : new I({
1420
1420
  code: "QUOTE_ERROR",
1421
1421
  meta: { message: "Unknown quote transfer error" }
1422
1422
  });
1423
1423
  }
1424
1424
  } };
1425
1425
  };
1426
- class xs {
1426
+ class Os {
1427
1427
  constructor(t, s) {
1428
1428
  this.account = t, this.provider = s;
1429
1429
  }
@@ -1452,10 +1452,10 @@ class xs {
1452
1452
  };
1453
1453
  }
1454
1454
  }
1455
- const Os = ({
1455
+ const Fs = ({
1456
1456
  walletAddress: e,
1457
1457
  getProvider: t
1458
- }) => rr({
1458
+ }) => sr({
1459
1459
  accountId: e,
1460
1460
  signMessage: async (s) => {
1461
1461
  const r = t();
@@ -1479,25 +1479,25 @@ const Os = ({
1479
1479
  signature: n.signature
1480
1480
  };
1481
1481
  }
1482
- }), Fs = (e, t) => {
1482
+ }), Ls = (e, t) => {
1483
1483
  if (t) {
1484
1484
  if (e.sendAddress)
1485
1485
  return e.sendAddress;
1486
- throw new g({
1486
+ throw new I({
1487
1487
  code: "TRANSFER_INVALID_INITIAL",
1488
1488
  meta: { message: "Send to address is required for a direct transfer" }
1489
1489
  });
1490
1490
  }
1491
1491
  if (!e.quote || e.quote.dry)
1492
- throw new g({
1492
+ throw new I({
1493
1493
  code: "TRANSFER_INVALID_INITIAL",
1494
1494
  meta: { message: "Quote is required for intents non-direct transfer" }
1495
1495
  });
1496
1496
  return e.quote.depositAddress;
1497
- }, Ls = async (e, t) => {
1497
+ }, Bs = async (e, t) => {
1498
1498
  let s = Ye.getItem("nearWalletsPk")[t];
1499
1499
  if (!e.signMessage)
1500
- throw new g({
1500
+ throw new I({
1501
1501
  code: "DIRECT_TRANSFER_ERROR",
1502
1502
  meta: { message: "Your wallet doesn't support signing messages" }
1503
1503
  });
@@ -1506,10 +1506,10 @@ const Os = ({
1506
1506
  const a = await e.signMessage({
1507
1507
  message: "Authenticate",
1508
1508
  recipient: "intents.near",
1509
- nonce: qe.from(cr(32))
1509
+ nonce: qe.from(dr(32))
1510
1510
  });
1511
1511
  if (!a)
1512
- throw new g({
1512
+ throw new I({
1513
1513
  code: "DIRECT_TRANSFER_ERROR",
1514
1514
  meta: { message: "Signing message failed" }
1515
1515
  });
@@ -1517,16 +1517,16 @@ const Os = ({
1517
1517
  [t]: a.publicKey
1518
1518
  });
1519
1519
  } catch {
1520
- throw new g({
1520
+ throw new I({
1521
1521
  code: "DIRECT_TRANSFER_ERROR",
1522
1522
  meta: { message: "Your wallet doesn't support signing messages" }
1523
1523
  });
1524
1524
  }
1525
- const r = ne({
1525
+ const r = re({
1526
1526
  walletAddress: t,
1527
1527
  addressType: "near"
1528
1528
  });
1529
- if (!await ur({
1529
+ if (!await mr({
1530
1530
  contractId: ye,
1531
1531
  methodName: "has_public_key",
1532
1532
  args: {
@@ -1555,33 +1555,33 @@ const Os = ({
1555
1555
  ]
1556
1556
  });
1557
1557
  } catch {
1558
- throw new g({
1558
+ throw new I({
1559
1559
  code: "DIRECT_TRANSFER_ERROR",
1560
1560
  meta: { message: "Unable to add public key to intents account" }
1561
1561
  });
1562
1562
  }
1563
- }, Bs = ({ providers: e }) => {
1564
- const { ctx: t } = _(), { appName: s, intentsAccountType: r } = b(), {
1563
+ }, qs = ({ providers: e }) => {
1564
+ const { ctx: t } = _(), { appName: s, intentsAccountType: r } = y(), {
1565
1565
  isNativeNearDeposit: n,
1566
1566
  isDirectNearTokenWithdrawal: a,
1567
- isDirectNonNearWithdrawal: c
1568
- } = Z();
1567
+ isDirectNonNearWithdrawal: l
1568
+ } = J();
1569
1569
  return { make: async ({
1570
1570
  message: d,
1571
- onPending: u
1571
+ onPending: m
1572
1572
  }) => {
1573
1573
  if (!t.walletAddress)
1574
- throw new g({
1574
+ throw new I({
1575
1575
  code: "TRANSFER_INVALID_INITIAL",
1576
1576
  meta: { message: "No connected wallet to sign a transfer." }
1577
1577
  });
1578
1578
  if (!t.sourceToken || !t.targetToken)
1579
- throw new g({
1579
+ throw new I({
1580
1580
  code: "TRANSFER_INVALID_INITIAL",
1581
1581
  meta: { message: "No token selected to transfer." }
1582
1582
  });
1583
1583
  if (!t.sourceToken.isIntent)
1584
- throw new g({
1584
+ throw new I({
1585
1585
  code: "TRANSFER_INVALID_INITIAL",
1586
1586
  meta: {
1587
1587
  message: "For not intents source token use useMakeQuoteTransfer instead"
@@ -1589,115 +1589,115 @@ const Os = ({
1589
1589
  });
1590
1590
  let i;
1591
1591
  if (!r)
1592
- throw new g({
1592
+ throw new I({
1593
1593
  code: "TRANSFER_INVALID_INITIAL",
1594
1594
  meta: { message: "Intents account type is not defined" }
1595
1595
  });
1596
1596
  switch (r) {
1597
1597
  case "evm":
1598
1598
  if (!e?.evm)
1599
- throw new g({
1599
+ throw new I({
1600
1600
  code: "TRANSFER_INVALID_INITIAL",
1601
1601
  meta: { message: "No EVM provider configured" }
1602
1602
  });
1603
- i = new xs(
1603
+ i = new Os(
1604
1604
  { walletAddress: t.walletAddress },
1605
1605
  e.evm
1606
1606
  );
1607
1607
  break;
1608
1608
  case "sol":
1609
1609
  if (!e?.sol)
1610
- throw new g({
1610
+ throw new I({
1611
1611
  code: "TRANSFER_INVALID_INITIAL",
1612
1612
  meta: { message: "No SOL provider configured" }
1613
1613
  });
1614
- i = new dr(
1614
+ i = new ur(
1615
1615
  { walletAddress: t.walletAddress },
1616
1616
  e.sol
1617
1617
  );
1618
1618
  break;
1619
1619
  case "near": {
1620
1620
  if (!e?.near)
1621
- throw new g({
1621
+ throw new I({
1622
1622
  code: "TRANSFER_INVALID_INITIAL",
1623
1623
  meta: { message: "No NEAR provider configured" }
1624
1624
  });
1625
- await Ls(e.near(), t.walletAddress), i = Os({
1625
+ await Bs(e.near(), t.walletAddress), i = Fs({
1626
1626
  walletAddress: t.walletAddress,
1627
1627
  getProvider: e.near
1628
1628
  });
1629
1629
  break;
1630
1630
  }
1631
1631
  default:
1632
- ve(r);
1632
+ De(r);
1633
1633
  }
1634
- const f = new sr({ referral: gt(s) });
1635
- f.setIntentSigner(i);
1634
+ const u = new ar({ referral: gt(s) });
1635
+ u.setIntentSigner(i);
1636
1636
  let p;
1637
- n ? p = void 0 : a ? p = ar(d ?? void 0) : c ? p = void 0 : p = or();
1638
- const I = {
1637
+ n ? p = void 0 : a ? p = or(d ?? void 0) : l ? p = void 0 : p = ir();
1638
+ const w = {
1639
1639
  assetId: t.sourceToken.assetId,
1640
1640
  amount: BigInt(t.sourceTokenAmount),
1641
- destinationAddress: Fs(
1641
+ destinationAddress: Ls(
1642
1642
  t,
1643
- a || c
1643
+ a || l
1644
1644
  ),
1645
1645
  destinationMemo: void 0,
1646
1646
  feeInclusive: !1,
1647
1647
  routeConfig: p
1648
1648
  };
1649
- u("WAITING_CONFIRMATION");
1649
+ m("WAITING_CONFIRMATION");
1650
1650
  try {
1651
- const m = await f.estimateWithdrawalFee({
1652
- withdrawalParams: I
1653
- }), { intentHash: w } = await f.signAndSendWithdrawalIntent({
1654
- withdrawalParams: I,
1655
- feeEstimation: m
1651
+ const f = await u.estimateWithdrawalFee({
1652
+ withdrawalParams: w
1653
+ }), { intentHash: g } = await u.signAndSendWithdrawalIntent({
1654
+ withdrawalParams: w,
1655
+ feeEstimation: f
1656
1656
  });
1657
- u("PROCESSING");
1658
- const k = await f.waitForIntentSettlement({ intentHash: w }), y = await f.waitForWithdrawalCompletion({
1659
- withdrawalParams: I,
1657
+ m("PROCESSING");
1658
+ const k = await u.waitForIntentSettlement({ intentHash: g }), b = await u.waitForWithdrawalCompletion({
1659
+ withdrawalParams: w,
1660
1660
  intentTx: k
1661
1661
  });
1662
1662
  return {
1663
1663
  intent: k.hash,
1664
1664
  // no hash means completion not trackable for this bridge
1665
- hash: y.hash ?? "",
1666
- transactionLink: y.hash ? mr(
1667
- dn[t.targetToken.blockchain],
1668
- y.hash
1665
+ hash: b.hash ?? "",
1666
+ transactionLink: b.hash ? fr(
1667
+ un[t.targetToken.blockchain],
1668
+ b.hash
1669
1669
  ) : ""
1670
1670
  };
1671
- } catch (m) {
1672
- if (E.error("[TRANSFER ERROR]", m), m instanceof ir)
1673
- throw new g({
1671
+ } catch (f) {
1672
+ if (E.error("[TRANSFER ERROR]", f), f instanceof cr)
1673
+ throw new I({
1674
1674
  code: "MIN_WITHDRAWAL_AMOUNT_ERROR",
1675
1675
  meta: {
1676
- minAmount: Y(
1677
- m.minAmount.toString(),
1676
+ minAmount: X(
1677
+ f.minAmount.toString(),
1678
1678
  t.sourceToken.decimals
1679
1679
  )
1680
1680
  }
1681
1681
  });
1682
- if (m instanceof lr)
1683
- throw new g({
1682
+ if (f instanceof lr)
1683
+ throw new I({
1684
1684
  code: "TRANSFER_INVALID_INITIAL",
1685
1685
  meta: { message: "Fee is above the maximum allowed" }
1686
1686
  });
1687
- if (ce(m)) {
1688
- if (m.message.includes("Fee is not estimated"))
1689
- throw new g({
1687
+ if (le(f)) {
1688
+ if (f.message.includes("Fee is not estimated"))
1689
+ throw new I({
1690
1690
  code: "FEES_NOT_ESTIMATED"
1691
1691
  });
1692
- if (de(m))
1692
+ if (de(f))
1693
1693
  return;
1694
1694
  }
1695
- throw new g({
1695
+ throw new I({
1696
1696
  code: "DIRECT_TRANSFER_ERROR"
1697
1697
  });
1698
1698
  }
1699
1699
  } };
1700
- }, qs = ({
1700
+ }, Us = ({
1701
1701
  message: e,
1702
1702
  providers: t,
1703
1703
  makeTransfer: s
@@ -1705,83 +1705,83 @@ const Os = ({
1705
1705
  const { ctx: r } = _(), {
1706
1706
  isDirectTokenOnNearDeposit: n,
1707
1707
  isDirectTokenOnNearTransfer: a,
1708
- isNativeNearDeposit: c
1709
- } = Z(), { make: l } = Bs({ providers: t }), { make: d } = vs({
1708
+ isNativeNearDeposit: l
1709
+ } = J(), { make: c } = qs({ providers: t }), { make: d } = xs({
1710
1710
  makeTransfer: s,
1711
1711
  providers: t
1712
- }), { make: u } = Ds(
1712
+ }), { make: m } = Ds(
1713
1713
  t?.near
1714
1714
  );
1715
1715
  return { make: async () => {
1716
1716
  if (!r.targetToken)
1717
1717
  return;
1718
- let f;
1718
+ let u;
1719
1719
  try {
1720
- if (T("transferSetStatus", {
1720
+ if (h("transferSetStatus", {
1721
1721
  status: "pending",
1722
1722
  reason: "WAITING_CONFIRMATION"
1723
1723
  }), r.sourceToken?.isIntent)
1724
- f = await l({
1724
+ u = await c({
1725
1725
  message: e,
1726
1726
  onPending: (p) => {
1727
- T("transferSetStatus", {
1727
+ h("transferSetStatus", {
1728
1728
  status: "pending",
1729
1729
  reason: p
1730
1730
  });
1731
1731
  }
1732
1732
  });
1733
- else if ((c || n) && !r.isDepositFromExternalWallet)
1734
- f = await u(
1733
+ else if ((l || n) && !r.isDepositFromExternalWallet)
1734
+ u = await m(
1735
1735
  r.sendAddress ?? ye,
1736
1736
  e
1737
1737
  );
1738
1738
  else if (a) {
1739
1739
  if (!r.sendAddress)
1740
- throw new g({
1740
+ throw new I({
1741
1741
  code: "TRANSFER_INVALID_INITIAL",
1742
1742
  meta: { message: "No recipient address to transfer" }
1743
1743
  });
1744
- f = await u(
1744
+ u = await m(
1745
1745
  r.sendAddress,
1746
1746
  e
1747
1747
  );
1748
1748
  } else
1749
- f = await d();
1749
+ u = await d();
1750
1750
  } catch (p) {
1751
- p instanceof g && (E.error(p.data), T("transferSetStatus", { status: "error" }), T("errorSet", p.data));
1751
+ p instanceof I && (E.error(p.data), h("transferSetStatus", { status: "error" }), h("errorSet", p.data));
1752
1752
  }
1753
- if (!f) {
1754
- T("transferSetStatus", { status: "idle" });
1753
+ if (!u) {
1754
+ h("transferSetStatus", { status: "idle" });
1755
1755
  return;
1756
1756
  }
1757
- return T("transferSetStatus", { status: "success" }), F("transfer_success"), f;
1757
+ return h("transferSetStatus", { status: "success" }), F("transfer_success"), u;
1758
1758
  } };
1759
- }, Us = async (e) => {
1759
+ }, Ps = async (e) => {
1760
1760
  if (!e)
1761
1761
  return;
1762
1762
  const t = await e.request({
1763
1763
  method: "eth_chainId"
1764
1764
  });
1765
1765
  return parseInt(t, 16);
1766
- }, Ps = ({ providers: e }) => {
1767
- const { ctx: t } = _(), [s, r] = te(!1), [n, a] = te(!1), c = le(async () => {
1766
+ }, Ws = ({ providers: e }) => {
1767
+ const { ctx: t } = _(), [s, r] = ne(!1), [n, a] = ne(!1), l = ce(async () => {
1768
1768
  const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
1769
1769
  if (!t.sourceToken || !d)
1770
1770
  return !1;
1771
- const u = await Us(d);
1772
- if (!H(t.sourceToken.blockchain))
1771
+ const m = await Ps(d);
1772
+ if (!G(t.sourceToken.blockchain))
1773
1773
  return !1;
1774
1774
  const i = Ae[t.sourceToken.blockchain];
1775
- return !i || !u ? !1 : u !== i;
1776
- }, [t.sourceToken, e]), l = le(async () => {
1775
+ return !i || !m ? !1 : m !== i;
1776
+ }, [t.sourceToken, e]), c = ce(async () => {
1777
1777
  const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
1778
- if (!t.sourceToken || !d || !H(t.sourceToken.blockchain))
1778
+ if (!t.sourceToken || !d || !G(t.sourceToken.blockchain))
1779
1779
  return !1;
1780
- const u = Ae[t.sourceToken.blockchain];
1781
- if (!u)
1780
+ const m = Ae[t.sourceToken.blockchain];
1781
+ if (!m)
1782
1782
  return !1;
1783
1783
  try {
1784
- return r(!0), await fr(u, d), !0;
1784
+ return r(!0), await pr(m, d), !0;
1785
1785
  } catch (i) {
1786
1786
  return E.error("Failed to switch chain:", i), !1;
1787
1787
  } finally {
@@ -1789,17 +1789,17 @@ const Os = ({
1789
1789
  }
1790
1790
  }, [t.sourceToken, e]);
1791
1791
  return R(() => {
1792
- c().then(a);
1793
- }, [c]), {
1792
+ l().then(a);
1793
+ }, [l]), {
1794
1794
  isSwitchingChainRequired: n,
1795
- switchChain: l,
1795
+ switchChain: c,
1796
1796
  isSwitchingChain: s
1797
1797
  };
1798
1798
  }, N = {
1799
1799
  size: "lg",
1800
1800
  variant: "primary"
1801
1801
  }, Ue = (e) => {
1802
- const { t } = $();
1802
+ const { t } = K();
1803
1803
  if (e.error?.code === "TOKEN_IS_NOT_SUPPORTED")
1804
1804
  return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.invalidAddress", "Invalid address") });
1805
1805
  if (e.state === "initial_wallet" && e.error?.code === "SEND_ADDRESS_IS_EMPTY")
@@ -1815,12 +1815,12 @@ const Os = ({
1815
1815
  chain: e.error.meta.chain.toUpperCase()
1816
1816
  }) });
1817
1817
  if (e.error?.code === "QUOTE_AMOUNT_IS_TOO_LOW" || e.error?.code === "MIN_WITHDRAWAL_AMOUNT_ERROR")
1818
- return /* @__PURE__ */ h("div", { className: "gap-sw-md flex flex-col", children: [
1818
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1819
1819
  /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.amountTooLow.label", "Amount is too low") }),
1820
- /* @__PURE__ */ o(j, { children: /* @__PURE__ */ h(nn, { i18nKey: "submit.error.amountTooLow.message", children: [
1820
+ /* @__PURE__ */ o(z, { children: /* @__PURE__ */ T(rn, { i18nKey: "submit.error.amountTooLow.message", children: [
1821
1821
  "Amount you entered is very low. Please try increasing it",
1822
1822
  " ",
1823
- /* @__PURE__ */ h("span", { className: "text-nowrap", children: [
1823
+ /* @__PURE__ */ T("span", { className: "text-nowrap", children: [
1824
1824
  "above ",
1825
1825
  /* @__PURE__ */ o(Be, { value: e.error.meta.minAmount ?? "0" }),
1826
1826
  " ",
@@ -1830,71 +1830,71 @@ const Os = ({
1830
1830
  ] }) })
1831
1831
  ] });
1832
1832
  if (e.quoteStatus === "error")
1833
- return /* @__PURE__ */ h("div", { className: "gap-sw-md flex flex-col", children: [
1833
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1834
1834
  /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.quoteFailed.label", "Quote failed") }),
1835
- /* @__PURE__ */ o(j, { children: t(
1835
+ /* @__PURE__ */ o(z, { children: t(
1836
1836
  "submit.error.quoteFailed.message",
1837
1837
  "We couldn’t finalize your quote. Please try again or adjust your values."
1838
1838
  ) })
1839
1839
  ] });
1840
1840
  if (e.error?.code === "TRANSFER_INVALID_INITIAL")
1841
- return /* @__PURE__ */ h("div", { className: "gap-sw-md flex flex-col", children: [
1841
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1842
1842
  /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.invalidTransferData.label", "Invalid transfer data") }),
1843
- e.error.meta?.message ? /* @__PURE__ */ o(j, { children: e.error.meta.message }) : null
1843
+ e.error.meta?.message ? /* @__PURE__ */ o(z, { children: e.error.meta.message }) : null
1844
1844
  ] });
1845
1845
  if (e.error?.code === "EXTERNAL_TRANSFER_FAILED")
1846
1846
  return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.externalTransferFailed.label", "Transfer failed") });
1847
1847
  if (e.error?.code === "EXTERNAL_TRANSFER_INCOMPLETE")
1848
- return /* @__PURE__ */ h("div", { className: "gap-sw-md flex flex-col", children: [
1848
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1849
1849
  /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.externalTransferFailed.label", "Transfer failed") }),
1850
- /* @__PURE__ */ o(j, { children: t(
1850
+ /* @__PURE__ */ o(z, { children: t(
1851
1851
  "submit.error.externalTransferFailed.incompleteMessage",
1852
1852
  "Incomplete transfer. Deposited amount will be refunded."
1853
1853
  ) })
1854
1854
  ] });
1855
1855
  if (e.error?.code === "EXTERNAL_TRANSFER_REFUNDED")
1856
- return /* @__PURE__ */ h("div", { className: "gap-sw-md flex flex-col", children: [
1856
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1857
1857
  /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.externalTransferFailed.label", "Transfer failed") }),
1858
- /* @__PURE__ */ o(j, { children: t(
1858
+ /* @__PURE__ */ o(z, { children: t(
1859
1859
  "submit.error.externalTransferFailed.refundedMessage",
1860
1860
  "Deposited amount will be refunded."
1861
1861
  ) })
1862
1862
  ] });
1863
1863
  if (e.error?.code === "DIRECT_TRANSFER_ERROR")
1864
- return /* @__PURE__ */ h("div", { className: "gap-sw-md flex flex-col", children: [
1864
+ return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1865
1865
  /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.transferFailed.label", "Transfer failed") }),
1866
- e.error.meta?.message ? /* @__PURE__ */ o(j, { children: e.error.meta.message }) : null
1866
+ e.error.meta?.message ? /* @__PURE__ */ o(z, { children: e.error.meta.message }) : null
1867
1867
  ] });
1868
1868
  if (e.error?.code === "SOURCE_BALANCE_INSUFFICIENT")
1869
1869
  return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.insufficientBalance", "Insufficient balance") });
1870
- }, Ws = ({ onClick: e }) => {
1871
- const { t } = $();
1870
+ }, Vs = ({ onClick: e }) => {
1871
+ const { t } = K();
1872
1872
  return /* @__PURE__ */ o(A, { state: "disabled", ...N, onClick: e, children: t("submit.error.connectWallet", "Connect wallet") });
1873
- }, Vs = () => {
1873
+ }, Ms = () => {
1874
1874
  const { ctx: e } = _();
1875
1875
  return Ue(e) ?? null;
1876
- }, Ms = (e) => {
1877
- const { providers: t, makeTransfer: s, onSuccess: r } = e, { ctx: n } = _(), { t: a } = $(), {
1878
- isNativeNearDeposit: c,
1879
- isDirectNonNearWithdrawal: l,
1876
+ }, Qs = (e) => {
1877
+ const { providers: t, makeTransfer: s, onSuccess: r } = e, { ctx: n } = _(), { t: a } = K(), {
1878
+ isNativeNearDeposit: l,
1879
+ isDirectNonNearWithdrawal: c,
1880
1880
  isDirectTokenOnNearDeposit: d,
1881
- isDirectNearTokenWithdrawal: u
1882
- } = Z(), { make: i } = qs({ providers: t, makeTransfer: s }), { isSwitchingChainRequired: f, switchChain: p, isSwitchingChain: I } = Ps({ providers: t }), m = Ue(n), w = async () => {
1883
- if (f && !await p())
1881
+ isDirectNearTokenWithdrawal: m
1882
+ } = J(), { make: i } = Us({ providers: t, makeTransfer: s }), { isSwitchingChainRequired: u, switchChain: p, isSwitchingChain: w } = Ws({ providers: t }), f = Ue(n), g = async () => {
1883
+ if (u && !await p())
1884
1884
  return;
1885
1885
  const k = await i();
1886
1886
  k && r(k);
1887
1887
  };
1888
1888
  if (!n.targetToken)
1889
1889
  return /* @__PURE__ */ o(A, { ...N, state: "disabled", children: a("submit.disabled.selectTokenToReceive", "Select token to receive") });
1890
- if (!re(n.sourceTokenAmount))
1890
+ if (!se(n.sourceTokenAmount))
1891
1891
  return /* @__PURE__ */ o(A, { ...N, state: "disabled", children: a("submit.disabled.enterAmount", "Enter amount") });
1892
1892
  if (n.areInputsValidating)
1893
1893
  return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.validating", "Validating...") });
1894
- if (I)
1894
+ if (w)
1895
1895
  return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.switchingChain", "Switching network...") });
1896
- if (!f && m)
1897
- return m;
1896
+ if (!u && f)
1897
+ return f;
1898
1898
  if (n.transferStatus.status === "pending")
1899
1899
  switch (n.transferStatus.reason) {
1900
1900
  case "WAITING_CONFIRMATION":
@@ -1903,9 +1903,9 @@ const Os = ({
1903
1903
  default:
1904
1904
  return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.transfer.finalizing", "Finalizing transfer") });
1905
1905
  }
1906
- return n.transferStatus.status === "error" ? /* @__PURE__ */ h("div", { className: "gap-sw-md flex flex-col", children: [
1906
+ return n.transferStatus.status === "error" ? /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1907
1907
  /* @__PURE__ */ o(A, { ...N, children: e.label }),
1908
- /* @__PURE__ */ o(j, { children: (() => {
1908
+ /* @__PURE__ */ o(z, { children: (() => {
1909
1909
  switch (n.error?.code) {
1910
1910
  case "FEES_NOT_ESTIMATED":
1911
1911
  return a(
@@ -1919,15 +1919,15 @@ const Os = ({
1919
1919
  );
1920
1920
  }
1921
1921
  })() })
1922
- ] }) : n.quoteStatus === "pending" ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: n.quote ? a("submit.pending.quote.refreshing", "Refreshing quote") : a("submit.pending.quote.finalizing", "Finalizing quote") }) : n.error ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : !n.quote && !l && !d && !u && !c ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : /* @__PURE__ */ o(A, { ...N, onClick: w, children: e.label });
1923
- }, Qs = (e) => {
1924
- const { t } = $(), { ctx: s } = _(), r = Ue(s);
1925
- return s.isDepositFromExternalWallet ? re(s.sourceTokenAmount) ? s.externalDepositTxReceived ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.processing", "Processing") }) : /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.waiting", "Waiting for transaction") }) : /* @__PURE__ */ o(A, { ...N, state: "disabled", children: t("submit.disabled.enterAmount", "Enter amount") }) : r || /* @__PURE__ */ o(Ms, { ...e });
1922
+ ] }) : n.quoteStatus === "pending" ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: n.quote ? a("submit.pending.quote.refreshing", "Refreshing quote") : a("submit.pending.quote.finalizing", "Finalizing quote") }) : n.error ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : !n.quote && !c && !d && !m && !l ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : /* @__PURE__ */ o(A, { ...N, onClick: g, children: e.label });
1926
1923
  }, $s = (e) => {
1927
- const { ctx: t } = _(), s = b();
1928
- return t.walletAddress ? /* @__PURE__ */ o(Qs, { ...e }) : /* @__PURE__ */ o(Ws, { onClick: s.onWalletSignin });
1924
+ const { t } = K(), { ctx: s } = _(), r = Ue(s);
1925
+ return s.isDepositFromExternalWallet ? se(s.sourceTokenAmount) ? s.externalDepositTxReceived ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.processing", "Processing") }) : /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.waiting", "Waiting for transaction") }) : /* @__PURE__ */ o(A, { ...N, state: "disabled", children: t("submit.disabled.enterAmount", "Enter amount") }) : r || /* @__PURE__ */ o(Qs, { ...e });
1926
+ }, Ks = (e) => {
1927
+ const { ctx: t } = _(), s = y();
1928
+ return t.walletAddress ? /* @__PURE__ */ o($s, { ...e }) : /* @__PURE__ */ o(Vs, { onClick: s.onWalletSignin });
1929
1929
  };
1930
- $s.Error = Vs;
1930
+ Ks.Error = Ms;
1931
1931
  const ot = [
1932
1932
  "nep141:eth-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
1933
1933
  // cbBTC (eth)
@@ -1941,7 +1941,7 @@ const ot = [
1941
1941
  // NEAR (bsc)
1942
1942
  "nep141:eth-0xe0f63a424a4439cbe457d80e4f4b51ad25b2c56c.omft.near"
1943
1943
  // SPX (eth)
1944
- ], Ks = () => {
1944
+ ], Hs = () => {
1945
1945
  const { tokens: e } = V();
1946
1946
  return {
1947
1947
  uniqueIntentsTokens: L(() => {
@@ -1951,72 +1951,74 @@ const ot = [
1951
1951
  return [...t, ...r];
1952
1952
  }, [e])
1953
1953
  };
1954
- }, Hs = ({
1954
+ }, Gs = ({
1955
1955
  variant: e,
1956
1956
  search: t,
1957
1957
  selectedChain: s,
1958
1958
  chainsFilter: r,
1959
- walletSupportedChains: n
1959
+ walletSupportedChains: n,
1960
+ priorityAssets: a
1960
1961
  }) => {
1961
- ds(e);
1962
- const { tokens: a } = V(e), { mergedBalance: c } = Te(), { intentBalances: l } = pe(), { uniqueIntentsTokens: d } = Ks(), u = Br(
1962
+ us(e);
1963
+ const { tokens: l } = V(e), { mergedBalance: c } = he(), { intentBalances: d } = pe(), { uniqueIntentsTokens: m } = Hs(), i = qr(
1963
1964
  c,
1964
1965
  n,
1965
- t
1966
- ), i = a.filter(qr({ search: t })).filter(
1967
- Ur({
1966
+ t,
1967
+ a
1968
+ ), u = l.filter(Ur({ search: t })).filter(
1969
+ Pr({
1968
1970
  selectedChain: s,
1969
1971
  chainsFilter: r,
1970
1972
  walletSupportedChains: n,
1971
- intentBalances: l,
1972
- uniqueIntentTokenIds: d.map((f) => f.assetId)
1973
+ intentBalances: d,
1974
+ uniqueIntentTokenIds: m.map((p) => p.assetId)
1973
1975
  })
1974
1976
  );
1975
1977
  return {
1976
- all: i.sort(u),
1977
- intents: i.filter(et({ isIntent: !0 })).sort(u),
1978
- wallet: i.filter(et({ isIntent: !1 })).sort(u)
1978
+ all: u.sort(i),
1979
+ intents: u.filter(et({ isIntent: !0 })).sort(i),
1980
+ wallet: u.filter(et({ isIntent: !1 })).sort(i)
1979
1981
  };
1980
- }, Gs = (e, t) => {
1982
+ }, js = (e, t) => {
1981
1983
  const s = t.assetId.substring(t.assetId.indexOf(":") + 1), r = (a) => {
1982
- const c = (u) => u.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), l = c(t.amount), d = c(
1984
+ const l = (m) => m.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), c = l(t.amount), d = l(
1983
1985
  a.amount.toLocaleString("en-US", {
1984
1986
  useGrouping: !1,
1985
1987
  maximumFractionDigits: 20
1986
1988
  })
1987
1989
  );
1988
- return l.startsWith(d) || d.startsWith(l);
1990
+ return c.startsWith(d) || d.startsWith(c);
1989
1991
  }, n = (a) => new Date(a.created_at) >= new Date(t.initiatedAtDate);
1990
1992
  return (e.result.deposits || []).find(
1991
1993
  (a) => a.chain === t.chainId && a.account_id === t.intentsAccountId && a.address === t.depositAddress && a.near_token_id === s && n(a) && r(a)
1992
1994
  );
1993
- }, js = {
1994
- CREDITED: ee.status.PROCESSING,
1995
- PENDING: ee.status.PROCESSING,
1996
- COMPLETED: ee.status.SUCCESS,
1997
- FAILED: ee.status.FAILED
1998
- }, Ol = ({ depositAddress: e }) => {
1999
- const { ctx: t } = _(), { intentsAccountType: s } = b(), [r, n] = te(null), a = ne({
1995
+ }, zs = {
1996
+ CREDITED: te.status.PROCESSING,
1997
+ PENDING: te.status.PROCESSING,
1998
+ COMPLETED: te.status.SUCCESS,
1999
+ FAILED: te.status.FAILED
2000
+ }, Fc = ({ depositAddress: e }) => {
2001
+ const { ctx: t } = _(), { intentsAccountType: s } = y(), [r, n] = ne(null), a = re({
2000
2002
  addressType: s,
2001
2003
  walletAddress: t.walletAddress
2002
2004
  });
2003
2005
  return { pollDepositStatus: async ({
2004
- blockchain: l,
2006
+ blockchain: c,
2005
2007
  amount: d,
2006
- assetId: u
2008
+ assetId: m
2007
2009
  }) => {
2008
2010
  if (!a)
2009
2011
  throw new M("Unknown intents account for POA deposit check");
2010
- let i = Tt[l];
2012
+ let i = ht[c];
2011
2013
  if (!i)
2012
- if (H(l))
2013
- i = ht;
2014
+ if (G(c))
2015
+ i = Tt;
2014
2016
  else
2015
2017
  throw new M(
2016
- `Unknown chain for POA deposit check ${l}`
2018
+ `Unknown chain for POA deposit check ${c}`
2017
2019
  );
2018
- const f = r ?? (/* @__PURE__ */ new Date()).toUTCString();
2019
- r || n(f);
2020
+ const u = r ?? (/* @__PURE__ */ new Date()).toUTCString();
2021
+ r || n(u);
2020
2022
  const p = await kt.post("", {
2021
2023
  id: 1,
2022
2024
  jsonrpc: "2.0",
@@ -2027,61 +2029,61 @@ const ot = [
2027
2029
  chain: i
2028
2030
  }
2029
2031
  ]
2030
- }), I = Gs(p.data, {
2032
+ }), w = js(p.data, {
2031
2033
  intentsAccountId: a,
2032
- initiatedAtDate: f,
2034
+ initiatedAtDate: u,
2033
2035
  depositAddress: e,
2034
2036
  chainId: i,
2035
- assetId: u,
2037
+ assetId: m,
2036
2038
  amount: d
2037
2039
  });
2038
- return I ? {
2039
- status: js[I.status],
2040
+ return w ? {
2041
+ status: zs[w.status],
2040
2042
  swapDetails: {
2041
2043
  intentHashes: [""],
2042
- destinationChainTxHashes: [{ hash: I.tx_hash ?? "" }]
2044
+ destinationChainTxHashes: [{ hash: w.tx_hash ?? "" }]
2043
2045
  }
2044
2046
  } : {
2045
- status: ee.status.PENDING_DEPOSIT,
2047
+ status: te.status.PENDING_DEPOSIT,
2046
2048
  swapDetails: {
2047
2049
  destinationChainTxHashes: [{ hash: "" }],
2048
2050
  intentHashes: [""]
2049
2051
  }
2050
2052
  };
2051
2053
  } };
2052
- }, zs = ({ className: e }) => {
2053
- const { t } = $(), { slippageTolerance: s } = b(), { ctx: r } = _(), n = r.sourceToken && r.targetToken && r.sourceToken.price / r.targetToken.price;
2054
+ }, Ys = ({ className: e }) => {
2055
+ const { t } = K(), { slippageTolerance: s } = y(), { ctx: r } = _(), n = r.sourceToken && r.targetToken && r.sourceToken.price / r.targetToken.price;
2054
2056
  return r.sourceToken ? /* @__PURE__ */ o(
2055
- pr,
2057
+ hr,
2056
2058
  {
2057
2059
  expandedByDefault: !1,
2058
2060
  expandedHeightPx: r.walletAddress ? 80 : 50,
2059
2061
  isBadgeLoading: r.quoteStatus === "pending",
2060
2062
  badge: r.quote ? `~ ${r.quote.timeEstimate} sec` : void 0,
2061
2063
  className: e,
2062
- title: r.sourceToken && r.targetToken ? /* @__PURE__ */ h("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
2064
+ title: r.sourceToken && r.targetToken ? /* @__PURE__ */ T("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
2063
2065
  `1 ${r.sourceToken.symbol} ≈ `,
2064
2066
  " ",
2065
2067
  Tr(n ?? 0),
2066
2068
  " ",
2067
2069
  `${r.targetToken.symbol}`,
2068
2070
  /* @__PURE__ */ o("span", { className: "text-sw-gray-50", children: ` (${Ze(r.sourceToken.price)})` })
2069
- ] }) : /* @__PURE__ */ h("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
2071
+ ] }) : /* @__PURE__ */ T("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
2070
2072
  `1 ${r.sourceToken.symbol} ≈ `,
2071
2073
  " ",
2072
2074
  Ze(r.sourceToken.price),
2073
2075
  " USD"
2074
2076
  ] }),
2075
- children: /* @__PURE__ */ h(he, { children: [
2077
+ children: /* @__PURE__ */ T(Te, { children: [
2076
2078
  /* @__PURE__ */ o(
2077
- he.Item,
2079
+ Te.Item,
2078
2080
  {
2079
2081
  label: t("quote.result.maxSlippage.label", "Max slippage"),
2080
2082
  value: `${(s / 100).toFixed(2)}%`
2081
2083
  }
2082
2084
  ),
2083
2085
  !!r.walletAddress && /* @__PURE__ */ o(
2084
- he.Item,
2086
+ Te.Item,
2085
2087
  {
2086
2088
  isLoading: r.quoteStatus === "pending",
2087
2089
  label: t("quote.result.processingTime.label", "Processing time"),
@@ -2091,21 +2093,21 @@ const ot = [
2091
2093
  ] })
2092
2094
  }
2093
2095
  ) : /* @__PURE__ */ o(bt, {});
2094
- }, Fl = Object.assign(zs, {
2096
+ }, Lc = Object.assign(Ys, {
2095
2097
  Skeleton: bt
2096
- }), Ys = ({
2098
+ }), Xs = ({
2097
2099
  token: e,
2098
2100
  balance: t,
2099
2101
  isNotSufficient: s = !1,
2100
2102
  onClick: r
2101
2103
  }) => {
2102
- const n = b();
2103
- return !e.isIntent && !n.walletSupportedChains.includes(e.blockchain) ? /* @__PURE__ */ o("span", {}) : t === void 0 ? /* @__PURE__ */ o(gr, { width: 100 }) : /* @__PURE__ */ o(
2104
+ const n = y();
2105
+ return !e.isIntent && !n.walletSupportedChains.includes(e.blockchain) ? /* @__PURE__ */ o("span", {}) : t === void 0 ? /* @__PURE__ */ o(Ir, { width: 100 }) : /* @__PURE__ */ o(
2104
2106
  "span",
2105
2107
  {
2106
2108
  onClick: t ? r : void 0,
2107
2109
  style: t ? { borderBottomWidth: "2px", borderStyle: "dotted" } : void 0,
2108
- className: hr("text-sw-label-sm", {
2110
+ className: gr("text-sw-label-sm", {
2109
2111
  "text-sw-status-error": s,
2110
2112
  "text-sw-gray-100": !s,
2111
2113
  "cursor-pointer": !!t && !!r
@@ -2126,46 +2128,46 @@ const ot = [
2126
2128
  quoteUsdDelta: r,
2127
2129
  quoteUsdValue: n,
2128
2130
  state: a = "default",
2129
- showBalance: c = !0,
2130
- showQuickBalanceActions: l = !0,
2131
+ showBalance: l = !0,
2132
+ showQuickBalanceActions: c = !0,
2131
2133
  heading: d,
2132
- onMsg: u
2134
+ onMsg: m
2133
2135
  }) => {
2134
- const i = Yt(), { ctx: f } = _(), { t: p } = $(), { hideTokenInputHeadings: I } = b(), m = wr(e, s, n), w = (k) => {
2135
- u({
2136
+ const i = Xt(), { ctx: u } = _(), { t: p } = K(), { hideTokenInputHeadings: w } = y(), f = kr(e, s, n), g = (k) => {
2137
+ m({
2136
2138
  type: "on_change_amount",
2137
- amount: Ir(t, e.decimals, k)
2139
+ amount: wr(t, e.decimals, k)
2138
2140
  });
2139
2141
  };
2140
- return /* @__PURE__ */ h(fe, { className: "flex flex-col", "aria-label": d, children: [
2141
- !I && /* @__PURE__ */ o(Et, { children: d }),
2142
- /* @__PURE__ */ h(
2142
+ return /* @__PURE__ */ T(fe, { className: "flex flex-col", "aria-label": d, children: [
2143
+ !w && /* @__PURE__ */ o(Et, { children: d }),
2144
+ /* @__PURE__ */ T(
2143
2145
  "div",
2144
2146
  {
2145
- className: K(
2147
+ className: H(
2146
2148
  "flex items-center justify-between",
2147
- !I && "mt-sw-2xl"
2149
+ !w && "mt-sw-2xl"
2148
2150
  ),
2149
2151
  children: [
2150
2152
  /* @__PURE__ */ o(
2151
- Ar,
2153
+ Sr,
2152
2154
  {
2153
2155
  value: s,
2154
2156
  name: i,
2155
- setValue: kr,
2157
+ setValue: Ar,
2156
2158
  placeholder: "0",
2157
2159
  state: a === "default" || a === "disabled" ? a : "error",
2158
2160
  onChange: (k) => {
2159
- u({ type: "on_change_amount", amount: k.target.value });
2161
+ m({ type: "on_change_amount", amount: k.target.value });
2160
2162
  }
2161
2163
  }
2162
2164
  ),
2163
- /* @__PURE__ */ h(
2165
+ /* @__PURE__ */ T(
2164
2166
  "button",
2165
2167
  {
2166
2168
  type: "button",
2167
- onClick: a === "disabled" ? void 0 : () => u({ type: "on_click_select_token" }),
2168
- className: K(
2169
+ onClick: a === "disabled" ? void 0 : () => m({ type: "on_click_select_token" }),
2170
+ className: H(
2169
2171
  "gap-sw-md pl-sw-sm pr-sw-md flex h-[36px] min-w-[80px] shrink-0 items-center rounded-sw-md transition-colors bg-sw-gray-800 hover:bg-sw-gray-700 group",
2170
2172
  {
2171
2173
  "cursor-pointer": a !== "disabled",
@@ -2188,13 +2190,13 @@ const ot = [
2188
2190
  ]
2189
2191
  }
2190
2192
  ),
2191
- /* @__PURE__ */ h("div", { className: "gap-sw-sm min-h-sw-2xl flex items-center justify-between mt-sw-lg", children: [
2192
- /* @__PURE__ */ h("div", { className: "gap-sw-md flex items-center", children: [
2193
- /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-100", children: m }),
2193
+ /* @__PURE__ */ T("div", { className: "gap-sw-sm min-h-sw-2xl flex items-center justify-between mt-sw-lg", children: [
2194
+ /* @__PURE__ */ T("div", { className: "gap-sw-md flex items-center", children: [
2195
+ /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-100", children: f }),
2194
2196
  r ? /* @__PURE__ */ o(
2195
2197
  "span",
2196
2198
  {
2197
- className: K("text-sw-label-sm text-nowrap", {
2199
+ className: H("text-sw-label-sm text-nowrap", {
2198
2200
  "text-sw-gray-400": r >= -2 && r <= 2,
2199
2201
  "text-sw-status-success": r > 2,
2200
2202
  "text-sw-status-error": r <= -5,
@@ -2204,22 +2206,22 @@ const ot = [
2204
2206
  }
2205
2207
  ) : null
2206
2208
  ] }),
2207
- /* @__PURE__ */ h("div", { className: "gap-sw-sm flex items-center", children: [
2208
- e && !!f.walletAddress && c && /* @__PURE__ */ o(
2209
- Ys,
2209
+ /* @__PURE__ */ T("div", { className: "gap-sw-sm flex items-center", children: [
2210
+ e && !!u.walletAddress && l && /* @__PURE__ */ o(
2211
+ Xs,
2210
2212
  {
2211
2213
  token: e,
2212
2214
  balance: t,
2213
2215
  isNotSufficient: a === "error-balance",
2214
- onClick: () => w(1)
2216
+ onClick: () => g(1)
2215
2217
  }
2216
2218
  ),
2217
- !!t && c && l && /* @__PURE__ */ h(Kt, { children: [
2219
+ !!t && l && c && /* @__PURE__ */ T(Ht, { children: [
2218
2220
  /* @__PURE__ */ o(
2219
2221
  Je,
2220
2222
  {
2221
2223
  isClickable: a !== "disabled",
2222
- onClick: () => w(2),
2224
+ onClick: () => g(2),
2223
2225
  children: p("tokens.input.half.label", "50%")
2224
2226
  }
2225
2227
  ),
@@ -2227,18 +2229,18 @@ const ot = [
2227
2229
  Je,
2228
2230
  {
2229
2231
  isClickable: a !== "disabled",
2230
- onClick: () => w(1),
2232
+ onClick: () => g(1),
2231
2233
  children: p("tokens.input.max.label", "Max")
2232
2234
  }
2233
2235
  )
2234
2236
  ] }),
2235
- !c && /* @__PURE__ */ o("div", { className: "rounded-full bg-sw-gray-700 py-sw-xs px-sw-sm flex items-center justify-center", children: /* @__PURE__ */ o("span", { className: "text-sw-gray-100 text-sw-label-sm", children: p("tokens.input.externalBalance.label", "External balance") }) })
2237
+ !l && /* @__PURE__ */ o("div", { className: "rounded-full bg-sw-gray-700 py-sw-xs px-sw-sm flex items-center justify-center", children: /* @__PURE__ */ o("span", { className: "text-sw-gray-100 text-sw-label-sm", children: p("tokens.input.externalBalance.label", "External balance") }) })
2236
2238
  ] })
2237
2239
  ] })
2238
2240
  ] });
2239
2241
  }, We = ({ onMsg: e, heading: t }) => {
2240
- const { hideTokenInputHeadings: s } = b();
2241
- return /* @__PURE__ */ h(
2242
+ const { hideTokenInputHeadings: s } = y();
2243
+ return /* @__PURE__ */ T(
2242
2244
  fe,
2243
2245
  {
2244
2246
  isClickable: !0,
@@ -2246,10 +2248,10 @@ const ot = [
2246
2248
  onClick: () => e({ type: "on_click_select_token" }),
2247
2249
  children: [
2248
2250
  !s && /* @__PURE__ */ o(Et, { children: t }),
2249
- /* @__PURE__ */ h(
2251
+ /* @__PURE__ */ T(
2250
2252
  "div",
2251
2253
  {
2252
- className: K(
2254
+ className: H(
2253
2255
  "flex items-center justify-between",
2254
2256
  !s && "mt-sw-2xl"
2255
2257
  ),
@@ -2279,18 +2281,18 @@ const ot = [
2279
2281
  }
2280
2282
  );
2281
2283
  }, Ut = (e) => {
2282
- const { mergedBalance: t } = Te(), [s, r] = te(
2283
- e ? t[z(e)] : void 0
2284
+ const { mergedBalance: t } = he(), [s, r] = ne(
2285
+ e ? t[Y(e)] : void 0
2284
2286
  );
2285
2287
  return R(() => {
2286
2288
  let n;
2287
2289
  if (e) {
2288
- const a = t[z(e)];
2290
+ const a = t[Y(e)];
2289
2291
  a ? n = setTimeout(() => {
2290
2292
  r(a);
2291
2293
  }, 0) : n = setTimeout(() => {
2292
2294
  r(
2293
- e ? t[z(e)] ?? 0 : 0
2295
+ e ? t[Y(e)] ?? 0 : 0
2294
2296
  );
2295
2297
  }, 2e3);
2296
2298
  }
@@ -2306,7 +2308,7 @@ const ot = [
2306
2308
  const n = r.length === 1 ? s[0] : null;
2307
2309
  n && t({ type: "on_select_token", token: n });
2308
2310
  }, [s]);
2309
- }, Xs = ({
2311
+ }, Zs = ({
2310
2312
  onMsg: e,
2311
2313
  isChanging: t = !0,
2312
2314
  showBalance: s = !0,
@@ -2314,7 +2316,7 @@ const ot = [
2314
2316
  }) => {
2315
2317
  const { ctx: n } = _(), a = Ut(n.sourceToken);
2316
2318
  Pt("source", e);
2317
- const c = L(() => {
2319
+ const l = L(() => {
2318
2320
  if (!t && n.quoteStatus === "pending")
2319
2321
  return "disabled";
2320
2322
  if (!n.error)
@@ -2329,22 +2331,22 @@ const ot = [
2329
2331
  {
2330
2332
  heading: r,
2331
2333
  token: n.sourceToken,
2332
- state: c,
2334
+ state: l,
2333
2335
  balance: a,
2334
2336
  showBalance: s,
2335
2337
  showQuickBalanceActions: !0,
2336
- value: Y(n.sourceTokenAmount, n.sourceToken?.decimals),
2338
+ value: X(n.sourceTokenAmount, n.sourceToken?.decimals),
2337
2339
  onMsg: e
2338
2340
  }
2339
2341
  ) : /* @__PURE__ */ o(We, { heading: r, onMsg: e });
2340
- }, Zs = ({
2342
+ }, Js = ({
2341
2343
  isChanging: e = !1,
2342
2344
  onMsg: t,
2343
2345
  heading: s
2344
2346
  }) => {
2345
- const { ctx: r } = _(), { usdTradeDelta: n } = Z(), a = Ut(r.targetToken);
2347
+ const { ctx: r } = _(), { usdTradeDelta: n } = J(), a = Ut(r.targetToken);
2346
2348
  Pt("target", t);
2347
- const c = L(() => !e && r.quoteStatus === "pending" ? "disabled" : "default", [e, r.quoteStatus]);
2349
+ const l = L(() => !e && r.quoteStatus === "pending" ? "disabled" : "default", [e, r.quoteStatus]);
2348
2350
  return r.targetToken ? /* @__PURE__ */ o(
2349
2351
  Pe,
2350
2352
  {
@@ -2353,17 +2355,17 @@ const ot = [
2353
2355
  balance: a,
2354
2356
  quoteUsdDelta: n?.percentage,
2355
2357
  quoteUsdValue: r.quote && parseFloat(r.quote.amountOutUsd),
2356
- value: Y(r.targetTokenAmount, r.targetToken?.decimals),
2357
- state: c,
2358
+ value: X(r.targetTokenAmount, r.targetToken?.decimals),
2359
+ state: l,
2358
2360
  showQuickBalanceActions: !1,
2359
2361
  showBalance: !0,
2360
2362
  onMsg: t
2361
2363
  }
2362
2364
  ) : /* @__PURE__ */ o(We, { heading: s, onMsg: t });
2363
- }, Js = ({ token: e, heading: t, ...s }) => e ? /* @__PURE__ */ o(Pe, { ...s, token: e, heading: t }) : /* @__PURE__ */ o(We, { onMsg: s.onMsg, heading: t }), Ll = Object.assign(Js, {
2364
- Skeleton: Sr,
2365
- Source: Xs,
2366
- Target: Zs
2365
+ }, ea = ({ token: e, heading: t, ...s }) => e ? /* @__PURE__ */ o(Pe, { ...s, token: e, heading: t }) : /* @__PURE__ */ o(We, { onMsg: s.onMsg, heading: t }), Bc = Object.assign(ea, {
2366
+ Skeleton: Nr,
2367
+ Source: Zs,
2368
+ Target: Js
2367
2369
  }), Wt = ({
2368
2370
  token: e,
2369
2371
  balance: t,
@@ -2371,13 +2373,13 @@ const ot = [
2371
2373
  isNotSelectable: r,
2372
2374
  isFocused: n,
2373
2375
  className: a,
2374
- onMsg: c
2376
+ onMsg: l
2375
2377
  }) => {
2376
- const { ctx: l } = _(), { walletSupportedChains: d, appName: u } = b(), i = Nr(t, e), f = d.includes(e.blockchain) || e.isIntent, p = t !== "0" && t !== 0 && t !== void 0;
2377
- return /* @__PURE__ */ o("li", { className: "list-none group", children: /* @__PURE__ */ h(
2378
+ const { ctx: c } = _(), { walletSupportedChains: d, appName: m } = y(), i = _r(t, e), u = d.includes(e.blockchain) || e.isIntent, p = t !== "0" && t !== 0 && t !== void 0;
2379
+ return /* @__PURE__ */ o("li", { className: "list-none group", children: /* @__PURE__ */ T(
2378
2380
  "div",
2379
2381
  {
2380
- className: K(
2382
+ className: H(
2381
2383
  "gap-sw-lg p-sw-lg flex justify-between rounded-sw-md transition-colors",
2382
2384
  {
2383
2385
  "cursor-not-allowed": r,
@@ -2386,32 +2388,32 @@ const ot = [
2386
2388
  },
2387
2389
  a
2388
2390
  ),
2389
- onClick: () => !r && c({ type: "on_select_token", token: e }),
2391
+ onClick: () => !r && l({ type: "on_select_token", token: e }),
2390
2392
  children: [
2391
2393
  /* @__PURE__ */ o(
2392
2394
  Rt,
2393
2395
  {
2394
2396
  token: e,
2395
2397
  chainShowIcon: !e.isIntent,
2396
- className: K("group-hover:border-sw-gray-800 transition-colors", {
2398
+ className: H("group-hover:border-sw-gray-800 transition-colors", {
2397
2399
  "border-sw-gray-800": n,
2398
2400
  "border-sw-gray-900": !n
2399
2401
  })
2400
2402
  }
2401
2403
  ),
2402
- /* @__PURE__ */ h("div", { className: "gap-sw-xs mr-auto flex flex-col", children: [
2404
+ /* @__PURE__ */ T("div", { className: "gap-sw-xs mr-auto flex flex-col", children: [
2403
2405
  /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: e.name }),
2404
- e.isIntent ? /* @__PURE__ */ h("div", { className: "flex items-center gap-sw-xs", children: [
2406
+ e.isIntent ? /* @__PURE__ */ T("div", { className: "flex items-center gap-sw-xs", children: [
2405
2407
  /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-300", children: e.symbol }),
2406
2408
  " ",
2407
- /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${u} ${e.chainName.toLowerCase() !== "near" && p ? `(${e.chainName})` : ""}` })
2408
- ] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-sw-xs", children: [
2409
+ /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${m} ${e.chainName.toLowerCase() !== "near" && p ? `(${e.chainName})` : ""}` })
2410
+ ] }) : /* @__PURE__ */ T("div", { className: "flex items-center gap-sw-xs", children: [
2409
2411
  /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-300", children: e.symbol }),
2410
2412
  " ",
2411
2413
  /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${e.chainName}` })
2412
2414
  ] })
2413
2415
  ] }),
2414
- f && !!l.walletAddress && s && /* @__PURE__ */ h("div", { className: "gap-sw-xs flex flex-col items-end", children: [
2416
+ u && !!c.walletAddress && s && /* @__PURE__ */ T("div", { className: "gap-sw-xs flex flex-col items-end", children: [
2415
2417
  t === void 0 && !e.isIntent ? /* @__PURE__ */ o("span", { className: "h-[16px] w-[60px] animate-pulse rounded-full bg-sw-gray-700" }) : /* @__PURE__ */ o("span", { className: "h-[16px] text-sw-label-md text-sw-gray-50", children: p && /* @__PURE__ */ o(
2416
2418
  Be,
2417
2419
  {
@@ -2424,56 +2426,57 @@ const ot = [
2424
2426
  ]
2425
2427
  }
2426
2428
  ) });
2427
- }, ea = ({
2429
+ }, ta = ({
2428
2430
  variant: e,
2429
2431
  search: t,
2430
2432
  className: s,
2431
2433
  groupTokens: r,
2432
2434
  showBalances: n,
2433
2435
  chainsFilter: a,
2434
- selectedChain: c,
2435
- chainIsNotSupported: l,
2436
+ selectedChain: l,
2437
+ chainIsNotSupported: c,
2436
2438
  onMsg: d
2437
2439
  }) => {
2438
- const { t: u } = $(), { ctx: i } = _(), { walletSupportedChains: f, appName: p } = b(), { mergedBalance: I } = Te(), m = Hs({
2440
+ const { t: m } = K(), { ctx: i } = _(), { walletSupportedChains: u, appName: p, priorityAssets: w = [] } = y(), { mergedBalance: f } = he(), g = Gs({
2439
2441
  variant: e,
2440
2442
  search: t,
2441
2443
  chainsFilter: a,
2442
- selectedChain: c,
2443
- walletSupportedChains: f
2444
- }), w = i.walletAddress ? r : !1, k = Fr(m.all, t), y = X(null), [q, D] = te(-1), B = L(
2445
- () => [{ tokens: m.all }],
2446
- [m.all]
2447
- ), S = L(() => [
2448
- ...m.intents.length > 0 ? [
2449
- { label: p, count: m.intents.length },
2450
- { tokens: m.intents }
2444
+ selectedChain: l,
2445
+ walletSupportedChains: u,
2446
+ priorityAssets: w
2447
+ }), k = i.walletAddress ? r : !1, b = Lr(g.all, t), B = Z(null), [D, C] = ne(-1), S = L(
2448
+ () => [{ tokens: g.all }],
2449
+ [g.all]
2450
+ ), U = L(() => [
2451
+ ...g.intents.length > 0 ? [
2452
+ { label: p, count: g.intents.length },
2453
+ { tokens: g.intents }
2451
2454
  ] : [],
2452
- ...m.wallet.length > 0 ? [
2455
+ ...g.wallet.length > 0 ? [
2453
2456
  {
2454
- label: l ? null : "Connected wallet",
2455
- count: m.wallet.length
2457
+ label: c ? null : "Connected wallet",
2458
+ count: g.wallet.length
2456
2459
  },
2457
- { tokens: m.wallet }
2460
+ { tokens: g.wallet }
2458
2461
  ] : []
2459
- ].filter(Boolean), [m.wallet, m.intents, l]), O = w ? S : B, se = Or(O), ae = vr(O), Me = Cr(O), Mt = le(() => {
2460
- D(-1);
2462
+ ].filter(Boolean), [g.wallet, g.intents, c]), Q = k ? U : S, ae = Fr(Q), Mt = xr(Q), Me = vr(Q), Qt = ce(() => {
2463
+ C(-1);
2461
2464
  }, []);
2462
- switch (yr({
2463
- listRef: y.current,
2464
- initialFocusedIndex: w ? 1 : 0,
2465
- onFocus: (P) => D(P),
2466
- onBlur: Mt
2467
- }), k) {
2465
+ switch (br({
2466
+ listRef: B.current,
2467
+ initialFocusedIndex: k ? 1 : 0,
2468
+ onFocus: (P) => C(P),
2469
+ onBlur: Qt
2470
+ }), b) {
2468
2471
  case "EMPTY_SEARCH":
2469
2472
  return /* @__PURE__ */ o(
2470
2473
  be,
2471
2474
  {
2472
2475
  hasAction: !0,
2473
2476
  actionType: "outlined",
2474
- actionLabel: u("tokens.list.searchReset.label", "Clear search"),
2475
- heading: u("tokens.list.searchEmpty.label", "No results"),
2476
- subHeading: u(
2477
+ actionLabel: m("tokens.list.searchReset.label", "Clear search"),
2478
+ heading: m("tokens.list.searchEmpty.label", "No results"),
2479
+ subHeading: m(
2477
2480
  "tokens.list.searchEmpty.subLabel",
2478
2481
  "Try another search or check if a specific network is selected."
2479
2482
  ),
@@ -2482,28 +2485,28 @@ const ot = [
2482
2485
  }
2483
2486
  );
2484
2487
  case "HAS_TOKENS":
2485
- return /* @__PURE__ */ o("div", { className: K("gap-sw-lg flex flex-col", s), children: /* @__PURE__ */ o(
2486
- _r,
2488
+ return /* @__PURE__ */ o("div", { className: H("gap-sw-lg flex flex-col", s), children: /* @__PURE__ */ o(
2489
+ yr,
2487
2490
  {
2488
- ref: y,
2491
+ ref: B,
2489
2492
  tabIndex: 0,
2490
- id: Rr,
2491
- itemSize: Er,
2493
+ id: Cr,
2494
+ itemSize: Rr,
2492
2495
  className: "hide-scrollbar",
2493
2496
  style: {
2494
2497
  minHeight: 200,
2495
- height: se,
2496
- maxHeight: br,
2498
+ height: ae,
2499
+ maxHeight: Er,
2497
2500
  overflowAnchor: "none",
2498
2501
  outline: "none"
2499
2502
  },
2500
2503
  onKeyDown: (P) => {
2501
- if (y.current)
2504
+ if (B.current)
2502
2505
  switch (P.code) {
2503
2506
  case "ArrowUp": {
2504
2507
  P.preventDefault();
2505
- let C = Math.max(q - 1, 0);
2506
- w && Me.includes(C) && (C = C === 0 ? 1 : C - 1), D(C), y.current?.scrollToIndex(C, {
2508
+ let v = Math.max(D - 1, 0);
2509
+ k && Me.includes(v) && (v = v === 0 ? 1 : v - 1), C(v), B.current?.scrollToIndex(v, {
2507
2510
  align: "center",
2508
2511
  smooth: !0
2509
2512
  });
@@ -2511,8 +2514,8 @@ const ot = [
2511
2514
  }
2512
2515
  case "ArrowDown": {
2513
2516
  P.preventDefault();
2514
- let C = Math.min(q + 1, ae - 1);
2515
- w && Me.includes(C) && (C = C === 0 ? 1 : C + 1), D(C), y.current?.scrollToIndex(C, {
2517
+ let v = Math.min(D + 1, Mt - 1);
2518
+ k && Me.includes(v) && (v = v === 0 ? 1 : v + 1), C(v), B.current?.scrollToIndex(v, {
2516
2519
  align: "center",
2517
2520
  smooth: !0
2518
2521
  });
@@ -2520,38 +2523,38 @@ const ot = [
2520
2523
  }
2521
2524
  case "Enter": {
2522
2525
  P.preventDefault();
2523
- const C = xr(O, q);
2524
- C && d({ type: "on_select_token", token: C });
2526
+ const v = Or(Q, D);
2527
+ v && d({ type: "on_select_token", token: v });
2525
2528
  break;
2526
2529
  }
2527
2530
  }
2528
2531
  },
2529
- children: O.map(
2530
- ({ label: P, count: C, tokens: Qe }, $e) => {
2531
- const Qt = Dr(
2532
- O,
2532
+ children: Q.map(
2533
+ ({ label: P, count: v, tokens: Qe }, $e) => {
2534
+ const $t = Dr(
2535
+ Q,
2533
2536
  $e
2534
2537
  );
2535
- return P !== void 0 ? P ? /* @__PURE__ */ h(
2538
+ return P !== void 0 ? P ? /* @__PURE__ */ T(
2536
2539
  "header",
2537
2540
  {
2538
2541
  className: "pb-sw-lg pt-sw-sm flex flex-col",
2539
2542
  children: [
2540
- /* @__PURE__ */ o(Lr, {}),
2541
- /* @__PURE__ */ o("span", { className: "text-sw-label-sm pt-sw-xl text-sw-gray-100", children: `${P} — ${C}` })
2543
+ /* @__PURE__ */ o(Br, {}),
2544
+ /* @__PURE__ */ o("span", { className: "text-sw-label-sm pt-sw-xl text-sw-gray-100", children: `${P} — ${v}` })
2542
2545
  ]
2543
2546
  },
2544
2547
  P
2545
- ) : /* @__PURE__ */ o("header", {}, $e) : Qe ? Qe.map((Ke, $t) => {
2546
- const He = z(Ke);
2548
+ ) : /* @__PURE__ */ o("header", {}, $e) : Qe ? Qe.map((Ke, Kt) => {
2549
+ const He = Y(Ke);
2547
2550
  return /* @__PURE__ */ o(
2548
2551
  Wt,
2549
2552
  {
2550
2553
  token: Ke,
2551
2554
  showBalance: n,
2552
- balance: I[He],
2553
- isFocused: q === Qt + $t,
2554
- isNotSelectable: l && !!i.walletAddress,
2555
+ balance: f[He],
2556
+ isFocused: D === $t + Kt,
2557
+ isNotSelectable: c && !!i.walletAddress,
2555
2558
  onMsg: d
2556
2559
  },
2557
2560
  He
@@ -2567,62 +2570,62 @@ const ot = [
2567
2570
  be,
2568
2571
  {
2569
2572
  className: "pt-sw-5xl pb-sw-5xl",
2570
- subHeading: u(
2573
+ subHeading: m(
2571
2574
  "tokens.list.noBalanceOnApp.subLabel",
2572
2575
  "Deposit funds to get started"
2573
2576
  ),
2574
- heading: u("tokens.list.noBalanceOnApp.label", {
2577
+ heading: m("tokens.list.noBalanceOnApp.label", {
2575
2578
  defaultValue: "You have no balances on {{appName}}",
2576
2579
  appName: p
2577
2580
  })
2578
2581
  }
2579
2582
  );
2580
2583
  }
2581
- }, Bl = Object.assign(ea, {
2584
+ }, qc = Object.assign(ta, {
2582
2585
  Placeholder: be,
2583
2586
  Item: Wt
2584
2587
  }), ie = (e, t, s) => {
2585
2588
  let r = document.body;
2586
2589
  s instanceof HTMLElement && (r = s), r.style.setProperty(`--c-sw-${e}`, t);
2587
- }, ta = (e, t, s) => {
2590
+ }, na = (e, t, s) => {
2588
2591
  Object.entries(e).forEach(([r, n]) => {
2589
2592
  ie(`${t}-${r}`, n, s);
2590
2593
  });
2591
2594
  }, it = (e, t, s, r, n) => {
2592
- const a = Wr(r, n, t);
2593
- a && ta(a, e, s);
2594
- }, na = (e, t) => {
2595
+ const a = Vr(r, n, t);
2596
+ a && na(a, e, s);
2597
+ }, ra = (e, t) => {
2595
2598
  const {
2596
2599
  primaryColor: s,
2597
2600
  surfaceColor: r,
2598
2601
  successColor: n,
2599
2602
  warningColor: a,
2600
- errorColor: c,
2601
- colorScheme: l = "dark"
2603
+ errorColor: l,
2604
+ colorScheme: c = "dark"
2602
2605
  } = t;
2603
- s && it("accent", 500, e, s, l), r && it("gray", 950, e, r, l), n && ie("status-success", n, e), a && ie("status-warning", a, e), c && ie("status-error", c, e);
2604
- }, ra = ut(void 0), sa = ({ children: e, theme: t }) => {
2605
- const { themeParentElementSelector: s } = b(), r = L(() => t, [t]);
2606
+ s && it("accent", 500, e, s, c), r && it("gray", 950, e, r, c), n && ie("status-success", n, e), a && ie("status-warning", a, e), l && ie("status-error", l, e);
2607
+ }, sa = ut(void 0), aa = ({ children: e, theme: t }) => {
2608
+ const { themeParentElementSelector: s } = y(), r = L(() => t, [t]);
2606
2609
  return R(() => {
2607
2610
  if (t) {
2608
2611
  const n = s ? document.querySelector(s) : null;
2609
- na(n, t);
2612
+ ra(n, t);
2610
2613
  }
2611
- }, [t]), /* @__PURE__ */ o(ra.Provider, { value: r, children: /* @__PURE__ */ o("div", { className: "sw", children: e }) });
2614
+ }, [t]), /* @__PURE__ */ o(sa.Provider, { value: r, children: /* @__PURE__ */ o("div", { className: "sw", children: e }) });
2612
2615
  }, we = ({
2613
2616
  text: e,
2614
2617
  icon: t
2615
- }) => /* @__PURE__ */ h("li", { className: "flex items-center gap-sw-md", children: [
2618
+ }) => /* @__PURE__ */ T("li", { className: "flex items-center gap-sw-md", children: [
2616
2619
  t && /* @__PURE__ */ o(t, { size: 20, className: "text-sw-gray-300" }),
2617
2620
  /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: e })
2618
- ] }), lt = ({
2621
+ ] }), ct = ({
2619
2622
  label: e,
2620
2623
  icon: t,
2621
2624
  className: s
2622
- }) => /* @__PURE__ */ h(
2625
+ }) => /* @__PURE__ */ T(
2623
2626
  "div",
2624
2627
  {
2625
- className: K(
2628
+ className: H(
2626
2629
  "rounded-sw-lg flex align-center justify-center gap-sw-md w-full py-sw-2xl",
2627
2630
  s
2628
2631
  ),
@@ -2631,10 +2634,10 @@ const ot = [
2631
2634
  /* @__PURE__ */ o("span", { className: "text-sw-label-md", children: e })
2632
2635
  ]
2633
2636
  }
2634
- ), aa = ({ isSigned: e, isSigning: t, onMsg: s }) => {
2635
- const { t: r } = $(), n = () => s({ type: "on_close" });
2637
+ ), oa = ({ isSigned: e, isSigning: t, onMsg: s }) => {
2638
+ const { t: r } = K(), n = () => s({ type: "on_close" });
2636
2639
  Ct("Escape", n);
2637
- const a = Hr({
2640
+ const a = Gr({
2638
2641
  endTime: 0,
2639
2642
  autostart: !1,
2640
2643
  timerType: "DECREMENTAL",
@@ -2643,16 +2646,16 @@ const ot = [
2643
2646
  });
2644
2647
  return R(() => {
2645
2648
  e ? a.start() : a.reset();
2646
- }, [e]), /* @__PURE__ */ h(fe, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2649
+ }, [e]), /* @__PURE__ */ T(fe, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2647
2650
  /* @__PURE__ */ o(
2648
- Dt,
2651
+ vt,
2649
2652
  {
2650
2653
  onClick: n,
2651
2654
  className: "absolute top-sw-2xl right-sw-2xl"
2652
2655
  }
2653
2656
  ),
2654
- /* @__PURE__ */ o(Mr, { size: 48, className: "text-sw-status-warning" }),
2655
- /* @__PURE__ */ h("header", { className: "flex flex-col gap-sw-lg", children: [
2657
+ /* @__PURE__ */ o(Qr, { size: 48, className: "text-sw-status-warning" }),
2658
+ /* @__PURE__ */ T("header", { className: "flex flex-col gap-sw-lg", children: [
2656
2659
  /* @__PURE__ */ o("h1", { className: "text-sw-label-lg text-sw-gray-50", children: r(
2657
2660
  "walletCompatibility.modal.title.initial",
2658
2661
  "Verify your wallet to continue"
@@ -2662,7 +2665,7 @@ const ot = [
2662
2665
  "Please sign a message to verify your wallet. This confirms your wallet is compatible and lets us securely read your public key."
2663
2666
  ) })
2664
2667
  ] }),
2665
- /* @__PURE__ */ h("ul", { className: "flex flex-col gap-sw-xl", children: [
2668
+ /* @__PURE__ */ T("ul", { className: "flex flex-col gap-sw-xl", children: [
2666
2669
  /* @__PURE__ */ o(
2667
2670
  we,
2668
2671
  {
@@ -2670,7 +2673,7 @@ const ot = [
2670
2673
  "walletCompatibility.modal.feature.secureTransactions",
2671
2674
  "Read-only signature – no gas required."
2672
2675
  ),
2673
- icon: Qr
2676
+ icon: $r
2674
2677
  }
2675
2678
  ),
2676
2679
  /* @__PURE__ */ o(
@@ -2680,7 +2683,7 @@ const ot = [
2680
2683
  "walletCompatibility.modal.feature.fullAccess",
2681
2684
  "No access to your funds, no hidden permissions."
2682
2685
  ),
2683
- icon: $r
2686
+ icon: Kr
2684
2687
  }
2685
2688
  ),
2686
2689
  /* @__PURE__ */ o(
@@ -2690,24 +2693,24 @@ const ot = [
2690
2693
  "walletCompatibility.modal.feature.fundProtection",
2691
2694
  "Only checks whether your wallet is supported."
2692
2695
  ),
2693
- icon: Vr
2696
+ icon: Mr
2694
2697
  }
2695
2698
  )
2696
2699
  ] }),
2697
- e ? /* @__PURE__ */ h("div", { className: "flex flex-col gap-sw-xl mt-sw-lg w-full", children: [
2700
+ e ? /* @__PURE__ */ T("div", { className: "flex flex-col gap-sw-xl mt-sw-lg w-full", children: [
2698
2701
  /* @__PURE__ */ o(
2699
- lt,
2702
+ ct,
2700
2703
  {
2701
2704
  label: r(
2702
2705
  "walletCompatibility.modal.button.verified",
2703
2706
  "Wallet verified"
2704
2707
  ),
2705
2708
  className: "bg-sw-status-success text-sw-gray-950",
2706
- icon: Pr
2709
+ icon: Wr
2707
2710
  }
2708
2711
  ),
2709
2712
  a.status === "RUNNING" && /* @__PURE__ */ o(
2710
- lt,
2713
+ ct,
2711
2714
  {
2712
2715
  className: "text-sw-gray-400",
2713
2716
  label: r("walletCompatibility.modal.button.closeTimer", {
@@ -2716,7 +2719,7 @@ const ot = [
2716
2719
  })
2717
2720
  }
2718
2721
  )
2719
- ] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-sw-xl mt-sw-lg", children: [
2722
+ ] }) : /* @__PURE__ */ T("div", { className: "flex flex-col gap-sw-xl mt-sw-lg", children: [
2720
2723
  /* @__PURE__ */ o(
2721
2724
  A,
2722
2725
  {
@@ -2741,18 +2744,18 @@ const ot = [
2741
2744
  )
2742
2745
  ] })
2743
2746
  ] });
2744
- }, oa = ({ onMsg: e }) => {
2745
- const { t } = $(), s = () => e({ type: "on_close" });
2746
- return Ct("Escape", s), /* @__PURE__ */ h(fe, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2747
+ }, ia = ({ onMsg: e }) => {
2748
+ const { t } = K(), s = () => e({ type: "on_close" });
2749
+ return Ct("Escape", s), /* @__PURE__ */ T(fe, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2747
2750
  /* @__PURE__ */ o(
2748
- Dt,
2751
+ vt,
2749
2752
  {
2750
2753
  onClick: s,
2751
2754
  className: "absolute top-sw-2xl right-sw-2xl"
2752
2755
  }
2753
2756
  ),
2754
- /* @__PURE__ */ o(Kr, { size: 48, className: "text-sw-status-error" }),
2755
- /* @__PURE__ */ h("header", { className: "flex flex-col gap-sw-lg", children: [
2757
+ /* @__PURE__ */ o(Hr, { size: 48, className: "text-sw-status-error" }),
2758
+ /* @__PURE__ */ T("header", { className: "flex flex-col gap-sw-lg", children: [
2756
2759
  /* @__PURE__ */ o("h1", { className: "text-sw-label-lg text-sw-gray-50", children: t(
2757
2760
  "walletCompatibility.modal.title.error",
2758
2761
  "Unable to verify wallet"
@@ -2766,7 +2769,7 @@ const ot = [
2766
2769
  "If the issue continues, please try another wallet."
2767
2770
  ) })
2768
2771
  ] }),
2769
- /* @__PURE__ */ h("div", { className: "flex flex-col gap-sw-xl mt-sw-lg", children: [
2772
+ /* @__PURE__ */ T("div", { className: "flex flex-col gap-sw-xl mt-sw-lg", children: [
2770
2773
  /* @__PURE__ */ o(
2771
2774
  A,
2772
2775
  {
@@ -2787,9 +2790,9 @@ const ot = [
2787
2790
  )
2788
2791
  ] })
2789
2792
  ] });
2790
- }, ql = Object.assign(aa, {
2791
- Error: oa
2792
- }), ia = (e) => null, la = (e) => (t) => {
2793
+ }, Uc = Object.assign(oa, {
2794
+ Error: ia
2795
+ }), ca = (e) => null, la = (e) => (t) => {
2793
2796
  if (t instanceof M)
2794
2797
  throw t;
2795
2798
  const s = new M(
@@ -2797,48 +2800,60 @@ const ot = [
2797
2800
  { cause: t }
2798
2801
  );
2799
2802
  throw s.context = e, s;
2800
- }, ca = ({ children: e }) => {
2803
+ }, da = ({ children: e }) => {
2801
2804
  const { ctx: t } = _();
2802
2805
  return /* @__PURE__ */ o(
2803
- zr,
2806
+ Yr,
2804
2807
  {
2805
- FallbackComponent: ia,
2808
+ FallbackComponent: ca,
2806
2809
  onError: la(t),
2807
2810
  children: e
2808
2811
  }
2809
2812
  );
2810
- }, da = new en({
2813
+ }, ua = new tn({
2811
2814
  defaultOptions: {
2812
2815
  queries: {
2813
2816
  staleTime: 2e3 * 60,
2814
- retry: ct.env.NODE_ENV === "test" ? !1 : 3
2817
+ retry: lt.env.NODE_ENV === "test" ? !1 : 3
2815
2818
  }
2816
2819
  }
2817
- }), ua = ["fms", "abg", "stjack", "noear", "testnebula"], ue = {
2820
+ }), ma = ["fms", "abg", "stjack", "noear", "testnebula"], ue = {
2818
2821
  appName: "Unknown",
2819
2822
  slippageTolerance: 100,
2820
2823
  // 1%
2821
2824
  intentsAccountType: "evm",
2822
- walletSupportedChains: un,
2825
+ walletSupportedChains: mn,
2823
2826
  connectedWallets: {},
2824
2827
  enableAutoTokensSwitching: !0,
2825
2828
  showIntentTokens: !0,
2826
2829
  chainsOrder: pt,
2827
- filterTokens: (e) => !ua.includes(e.symbol.toLocaleLowerCase()),
2830
+ filterTokens: (e) => !ma.includes(e.symbol.toLocaleLowerCase()),
2828
2831
  chainsFilter: {
2829
2832
  source: { external: "wallet-supported", intents: "none" },
2830
2833
  target: { external: "all", intents: "none" }
2834
+ },
2835
+ topChainShortcuts: (e) => {
2836
+ switch (e) {
2837
+ case "evm":
2838
+ return ["eth", "arb", "avax", "base"];
2839
+ case "sol":
2840
+ return ["sol", "eth", "btc", "near"];
2841
+ case "near":
2842
+ return ["near", "sol", "eth", "btc"];
2843
+ default:
2844
+ return ["eth", "btc", "sol", "near"];
2845
+ }
2831
2846
  }
2832
2847
  }, Vt = ut({
2833
2848
  config: ue
2834
2849
  }), Ve = dt({
2835
2850
  config: ue
2836
- }), b = () => {
2837
- const e = Xt(Vt);
2851
+ }), y = () => {
2852
+ const e = Zt(Vt);
2838
2853
  return me(e).config;
2839
- }, ma = (e) => {
2854
+ }, fa = (e) => {
2840
2855
  Ve.config = ke(e);
2841
- }, Ul = ({
2856
+ }, Pc = ({
2842
2857
  children: e,
2843
2858
  config: t,
2844
2859
  balanceViaRpc: s = !0,
@@ -2847,7 +2862,7 @@ const ot = [
2847
2862
  rpcs: n,
2848
2863
  theme: a
2849
2864
  }) => {
2850
- const c = X(
2865
+ const l = Z(
2851
2866
  dt({
2852
2867
  config: ke({
2853
2868
  ...ue,
@@ -2856,100 +2871,100 @@ const ot = [
2856
2871
  })
2857
2872
  );
2858
2873
  return R(() => {
2859
- const l = ke({
2874
+ const c = ke({
2860
2875
  ...ue,
2861
2876
  ...t
2862
2877
  });
2863
- Object.assign(c.current.config, l), ma(l);
2864
- }, [t]), sn(r ?? {}), jr("headlessui-portal-root", "sw"), /* @__PURE__ */ o(tn, { client: da, children: /* @__PURE__ */ o(rn, { i18n: Ht, children: /* @__PURE__ */ h(Vt.Provider, { value: c.current, children: [
2865
- /* @__PURE__ */ h(Gt, { children: [
2866
- /* @__PURE__ */ h(jt, { children: [
2878
+ Object.assign(l.current.config, c), fa(c);
2879
+ }, [t]), an(r ?? {}), zr("headlessui-portal-root", "sw"), /* @__PURE__ */ o(nn, { client: ua, children: /* @__PURE__ */ o(sn, { i18n: Gt, children: /* @__PURE__ */ T(Vt.Provider, { value: l.current, children: [
2880
+ /* @__PURE__ */ T(jt, { children: [
2881
+ /* @__PURE__ */ T(zt, { children: [
2867
2882
  /* @__PURE__ */ o("link", { rel: "preconnect", href: "https://rsms.me/" }),
2868
2883
  /* @__PURE__ */ o("link", { rel: "stylesheet", href: "https://rsms.me/inter/inter.css" })
2869
2884
  ] }),
2870
- /* @__PURE__ */ o(sa, { theme: a, children: ct.env.NODE_ENV === "test" ? e : /* @__PURE__ */ o(ca, { children: e }) })
2885
+ /* @__PURE__ */ o(aa, { theme: a, children: lt.env.NODE_ENV === "test" ? e : /* @__PURE__ */ o(da, { children: e }) })
2871
2886
  ] }),
2872
2887
  s && /* @__PURE__ */ o(
2873
2888
  ls,
2874
2889
  {
2875
- rpcs: n ?? Gr,
2890
+ rpcs: n ?? jr,
2876
2891
  connectedWallets: t.connectedWallets ?? {}
2877
2892
  }
2878
2893
  )
2879
2894
  ] }) }) });
2880
2895
  };
2881
2896
  export {
2882
- Cs as $,
2883
- Ol as A,
2897
+ vs as $,
2898
+ Fc as A,
2884
2899
  ls as B,
2885
- ra as C,
2886
- ts as D,
2900
+ sa as C,
2901
+ ns as D,
2887
2902
  tt as E,
2888
- us as F,
2889
- ms as G,
2890
- fs as H,
2891
- ps as I,
2892
- gs as J,
2903
+ ms as F,
2904
+ fs as G,
2905
+ ps as H,
2906
+ hs as I,
2907
+ Is as J,
2893
2908
  Ot as K,
2894
2909
  Ft as L,
2895
2910
  qt as M,
2896
2911
  Lt as N,
2897
2912
  Bt as O,
2898
- Is as P,
2899
- U as Q,
2900
- ws as R,
2901
- $s as S,
2902
- Js as T,
2903
- ks as U,
2904
- As as V,
2905
- Ul as W,
2906
- Ss as X,
2907
- Ns as Y,
2908
- _s as Z,
2909
- ys as _,
2910
- xl as a,
2913
+ ws as P,
2914
+ q as Q,
2915
+ ks as R,
2916
+ Ks as S,
2917
+ ea as T,
2918
+ As as U,
2919
+ Ss as V,
2920
+ Pc as W,
2921
+ Ns as X,
2922
+ _s as Y,
2923
+ ys as Z,
2924
+ bs as _,
2925
+ Oc as a,
2911
2926
  Ds as a0,
2912
- xs as a1,
2913
- Os as a2,
2914
- Ks as a3,
2915
- zs as a4,
2916
- Ys as a5,
2927
+ Os as a1,
2928
+ Fs as a2,
2929
+ Hs as a3,
2930
+ Ys as a4,
2931
+ Xs as a5,
2917
2932
  Pe as a6,
2918
2933
  We as a7,
2919
2934
  Pt as a8,
2920
- Xs as a9,
2921
- Zs as aa,
2935
+ Zs as a9,
2936
+ Js as aa,
2922
2937
  Wt as ab,
2923
- ea as ac,
2924
- sa as ad,
2925
- aa as ae,
2926
- oa as af,
2927
- ca as ag,
2938
+ ta as ac,
2939
+ aa as ad,
2940
+ oa as ae,
2941
+ ia as af,
2942
+ da as ag,
2928
2943
  Ve as ah,
2929
2944
  _ as b,
2930
- Dl as c,
2931
- ds as d,
2932
- os as e,
2945
+ Dc as c,
2946
+ us as d,
2947
+ is as e,
2933
2948
  pe as f,
2934
- Bs as g,
2935
- hs as h,
2936
- qs as i,
2937
- vs as j,
2938
- Te as k,
2939
- Ps as l,
2940
- Hs as m,
2949
+ qs as g,
2950
+ gs as h,
2951
+ Us as i,
2952
+ xs as j,
2953
+ he as k,
2954
+ Ws as l,
2955
+ Gs as m,
2941
2956
  V as n,
2942
- Fl as o,
2943
- Ll as p,
2944
- Bl as q,
2945
- bs as r,
2957
+ Lc as o,
2958
+ Bc as p,
2959
+ qc as q,
2960
+ Es as r,
2946
2961
  Ut as s,
2947
2962
  xt as t,
2948
- Z as u,
2963
+ J as u,
2949
2964
  M as v,
2950
- g as w,
2951
- vl as x,
2952
- b as y,
2953
- ql as z
2965
+ I as w,
2966
+ xc as x,
2967
+ y,
2968
+ Uc as z
2954
2969
  };
2955
- //# sourceMappingURL=config-BMvXuF1-.js.map
2970
+ //# sourceMappingURL=config-C47AYcMK.js.map