@imtbl/sdk 1.77.7-alpha.1 → 1.77.7

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 (57) hide show
  1. package/dist/{blockchain_data-Dg9Q9V5S.js → blockchain_data-B8XMnSWf.js} +2 -2
  2. package/dist/blockchain_data.js +3 -3
  3. package/dist/browser/checkout/{AddTokensWidget-TbB4PmLW.js → AddTokensWidget-BAbeB6QF.js} +408 -5
  4. package/dist/browser/checkout/{BridgeWidget-BhrCocw2.js → BridgeWidget-CrLjoZj2.js} +8 -7
  5. package/dist/browser/checkout/{CommerceWidget-Be5DHzdC.js → CommerceWidget-CJXKumJj.js} +16 -15
  6. package/dist/browser/checkout/{FeesBreakdown-Ck9YzdSC.js → FeesBreakdown-BypWN9Iy.js} +1 -1
  7. package/dist/browser/checkout/{HandoverContent-DB23bXer.js → HandoverContent-DQ1dvn2V.js} +1 -1
  8. package/dist/browser/checkout/{OnRampWidget-CqVk3g3X.js → OnRampWidget-JJO1UCrW.js} +3 -3
  9. package/dist/browser/checkout/{SaleWidget-BN4NOhbW.js → SaleWidget-Bpmzfc7A.js} +13 -12
  10. package/dist/browser/checkout/{SpendingCapHero-CPvvFrji.js → SpendingCapHero-Br5Uv8YR.js} +1 -1
  11. package/dist/browser/checkout/{SwapWidget-CwFYyKSt.js → SwapWidget-BmfIQSUe.js} +8 -7
  12. package/dist/browser/checkout/{TokenImage-BKsKixKT.js → TokenImage-z4OoDdYE.js} +1 -1
  13. package/dist/browser/checkout/{TopUpView-B4EZHPvY.js → TopUpView-B4eXJlqS.js} +2 -1
  14. package/dist/browser/checkout/{WalletApproveHero--5umxYJp.js → WalletApproveHero-83IoWlwV.js} +3 -3
  15. package/dist/browser/checkout/{WalletWidget-DVqX_Zms.js → WalletWidget-ComOLNY_.js} +3 -3
  16. package/dist/browser/checkout/{auto-track-B82Gtc5w.js → auto-track-B1yl_Cb9.js} +1 -1
  17. package/dist/browser/checkout/{index-BsW6upSH.js → index-B3rZfPee.js} +1 -1
  18. package/dist/browser/checkout/{index-CwvzJ6GW.js → index-Bud6ZDGR.js} +1 -1
  19. package/dist/browser/checkout/{index-CE6PQBKk.js → index-CxRI6mbM.js} +1 -1
  20. package/dist/browser/checkout/{index-C0AbsZnL.js → index-D5flYG_V.js} +1 -1
  21. package/dist/browser/checkout/{index-AFLAGIsQ.js → index-DPJLapbR.js} +1 -1
  22. package/dist/browser/checkout/{index-Ba4jcykl.js → index-DURgDDlD.js} +1 -1
  23. package/dist/browser/checkout/{index-Smb16jHM.js → index-DWFmOHWm.js} +1 -1
  24. package/dist/browser/checkout/{index-uoFT0va2.js → index-QnoQrLJ7.js} +626 -1680
  25. package/dist/browser/checkout/index-aJ1AhJ6L.js +394 -0
  26. package/dist/browser/checkout/{index-Bkd29y5M.js → index-hJJjTrqc.js} +2 -2
  27. package/dist/browser/checkout/{index.umd-DHRFESK1.js → index.umd-CO9CmHyp.js} +1 -1
  28. package/dist/browser/checkout/sdk.js +4 -4
  29. package/dist/browser/checkout/{useInterval-DoDljSUa.js → useInterval-Cs241Eva.js} +1 -1
  30. package/dist/browser/checkout/widgets-esm.js +1 -1
  31. package/dist/browser/checkout/widgets.js +646 -907
  32. package/dist/{checkout-CzqSs99h.js → checkout-BEnRmmWy.js} +5 -5
  33. package/dist/checkout.js +5 -5
  34. package/dist/{config-BJw9K8Po.js → config-j-wtV9bL.js} +1 -1
  35. package/dist/config.js +1 -1
  36. package/dist/{index-BxzTAKIm.js → index-BHMSlzV7.js} +4 -4
  37. package/dist/{index-CV8VqwDA.js → index-D3ERw9s5.js} +1 -1
  38. package/dist/{index-Bb-CtrNx.js → index-DaGRx7tS.js} +1 -1
  39. package/dist/{index-B2PvtsjM.js → index-DyUG4OFL.js} +3 -3
  40. package/dist/{index-DBVlwCPH.js → index-QwdUj2PO.js} +1 -1
  41. package/dist/{index-evZUxrpM.js → index-knWuA9k4.js} +1 -1
  42. package/dist/index.browser.js +4 -4
  43. package/dist/index.browser.js.map +1 -1
  44. package/dist/index.cjs +7 -7
  45. package/dist/index.js +14 -14
  46. package/dist/{minting_backend-Dy__LL73.js → minting_backend-mtmfZp09.js} +3 -3
  47. package/dist/minting_backend.js +5 -5
  48. package/dist/{orderbook-BS6_rEkr.js → orderbook-DoIjVZXk.js} +1 -1
  49. package/dist/orderbook.js +2 -2
  50. package/dist/{passport-CZQMKlmP.js → passport-BcbwvHFF.js} +3 -3
  51. package/dist/passport.js +4 -4
  52. package/dist/version.json +1 -1
  53. package/dist/{webhook-DXOqOK9I.js → webhook-qIYejhx3.js} +1 -1
  54. package/dist/webhook.js +2 -2
  55. package/dist/{x-x_2w6MwN.js → x-JXuh6vIe.js} +3 -3
  56. package/dist/x.js +4 -4
  57. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { A as APIError, B as BlockchainData } from './index-B2PvtsjM.js';
2
- import { i as index } from './index-evZUxrpM.js';
1
+ import { A as APIError, B as BlockchainData } from './index-DyUG4OFL.js';
2
+ import { i as index } from './index-knWuA9k4.js';
3
3
 
4
4
  var blockchain_data = /*#__PURE__*/Object.freeze({
5
5
  __proto__: null,
@@ -1,6 +1,6 @@
1
- export { A as APIError, B as BlockchainData } from './index-B2PvtsjM.js';
2
- export { i as Types } from './index-evZUxrpM.js';
3
- import './index-Bb-CtrNx.js';
1
+ export { A as APIError, B as BlockchainData } from './index-DyUG4OFL.js';
2
+ export { i as Types } from './index-knWuA9k4.js';
3
+ import './index-DaGRx7tS.js';
4
4
  import 'axios';
5
5
  import 'lru-memorise';
6
6
  import 'global-const';
@@ -1,8 +1,9 @@
1
- import { r as reactExports, I as IMTBLWidgetEvents, A as AddTokensEventType, y as commonjsGlobal, z as getDefaultExportFromCjs, D as parseUnits, F as BigNumber, G as useProvidersContext, H as dist, J as formatUnits, K as isPassportProvider, M as SQUID_NATIVE_TOKEN, p as jsx, q as jsxs, N as Box, u as useTranslation, Q as Drawer, R as Divider, T as Heading, U as Button, X as useAnalytics, Y as WalletDrawer, Z as UnableToConnectDrawer, _ as Fragment, $ as WalletProviderRdns, a0 as UserJourney, a1 as removeSpace, a2 as getProviderSlugFromRdns, a3 as Web3Provider, a4 as connectEIP6963Provider, a5 as identifyUser, a6 as ConnectEIP6963ProviderError, a7 as ProvidersContextActions, a8 as MenuItem, k as ChainId, a9 as commonjsRequire, aa as getRemoteImage, ab as vFlex, ac as OnboardingPagination, ad as ViewContext, ae as useHandover, af as HandoverTarget, ag as EventTargetContext, ah as AddTokensErrorTypes, V as ViewActions, ai as getRemoteRive, aj as APPROVE_TXN_ANIMATION, ak as keyframes, al as getDefaultTokenImage, am as TokenFilterTypes, i as getL2ChainId, an as isNativeToken, ao as getTokenImageByAddress, ap as TOKEN_PRIORITY_ORDER, aq as AddTokensActions, ar as SmartClone, as as FramedImage, at as FramedIcon, au as ButtCon, av as TextInput, aw as VerticalMenu, ax as Body, ay as EllipsizedText, az as Tooltip, aA as Sticker, aB as getRouteAndTokenBalances, aC as getRemoteVideo, aD as Stack, aE as fetchRiskAssessment, aF as isAddressSanctioned, aG as AddTokensContext, aH as useInjectedProviders, aI as trackFlow, aJ as AddTokensExperiments, aK as HeroFormControl, aL as getFormattedAmounts, aM as SimpleLayout, n as SharedViews, aN as orchestrationEvents, aO as HeroTextInput, aP as SquidFooter, aQ as RouteOptionsDrawer, aR as TOOLKIT_SQUID_URL, aS as merge, aT as SvgIcon, aU as trackError, aV as MaxUint256, aW as WalletWarningHero, aX as getFormattedNumber, aY as FIXED_HANDOVER_DURATION, aZ as EXECUTE_TXN_ANIMATION, a_ as Link, a$ as Trans, b0 as getTotalRouteFees, b1 as hFlex, b2 as t, b3 as getDurationFormatted, b4 as PriceDisplay, L as LoadingView, b5 as Icon, b6 as useTheme, b7 as viewReducer, b8 as initialViewState, b9 as addTokensReducer, ba as initialAddTokensState, bb as useSquid, bc as useTokens, bd as v4, be as Environment, bf as isValidAddress, bg as amountInputValidation, bh as fetchChains, bi as CloudImage, E as ErrorView, bj as ServiceUnavailableErrorView } from './index-uoFT0va2.js';
2
- import { r as retry, T as TokenImage } from './TokenImage-BKsKixKT.js';
3
- import { H as HandoverContent } from './HandoverContent-DB23bXer.js';
4
- import { C as Contract } from './index-Smb16jHM.js';
5
- import { F as FeesBreakdown } from './FeesBreakdown-Ck9YzdSC.js';
1
+ import { r as reactExports, I as IMTBLWidgetEvents, A as AddTokensEventType, y as commonjsGlobal, z as getDefaultExportFromCjs, D as BigNumber, F as useProvidersContext, G as dist, H as isPassportProvider, J as SQUID_NATIVE_TOKEN, p as jsx, q as jsxs, K as Box, u as useTranslation, M as Drawer, N as Divider, Q as Heading, R as Button, T as useAnalytics, U as WalletDrawer, X as UnableToConnectDrawer, Y as Fragment, Z as WalletProviderRdns, _ as UserJourney, $ as removeSpace, a0 as getProviderSlugFromRdns, a1 as Web3Provider, a2 as connectEIP6963Provider, a3 as identifyUser, a4 as ConnectEIP6963ProviderError, a5 as ProvidersContextActions, a6 as MenuItem, k as ChainId, a7 as commonjsRequire, a8 as getRemoteImage, a9 as vFlex, aa as OnboardingPagination, ab as ViewContext, ac as useHandover, ad as HandoverTarget, ae as EventTargetContext, V as ViewActions, af as getRemoteRive, ag as APPROVE_TXN_ANIMATION, ah as Trans, ai as Link, aj as Body, ak as keyframes, al as getDefaultTokenImage, am as TokenFilterTypes, i as getL2ChainId, an as isNativeToken, ao as getTokenImageByAddress, ap as TOKEN_PRIORITY_ORDER, aq as SmartClone, ar as FramedImage, as as FramedIcon, at as ButtCon, au as TextInput, av as VerticalMenu, aw as EllipsizedText, ax as Tooltip, ay as Sticker, az as tokenValueFormat, aA as DEFAULT_TOKEN_FORMATTING_DECIMALS, aB as Stack, aC as hFlex, aD as centerFlexChildren, aE as Icon, aF as Badge, aG as getRemoteVideo, aH as FramedVideo, aI as listVariants, aJ as motion, aK as listItemVariants, aL as Banner, aM as fetchRiskAssessment, aN as isAddressSanctioned, aO as useInjectedProviders, aP as trackFlow, aQ as HeroFormControl, aR as SimpleLayout, n as SharedViews, aS as orchestrationEvents, aT as HeroTextInput, aU as TOOLKIT_SQUID_URL, aV as merge, aW as SvgIcon, aX as trackError, aY as MaxUint256, aZ as WalletWarningHero, a_ as FIXED_HANDOVER_DURATION, a$ as EXECUTE_TXN_ANIMATION, b0 as t, b1 as PriceDisplay, L as LoadingView, b2 as useTheme, b3 as viewReducer, b4 as initialViewState, b5 as useSquid, b6 as useTokens, b7 as Environment, b8 as isValidAddress, b9 as amountInputValidation, ba as fetchChains, bb as CloudImage, E as ErrorView, bc as ServiceUnavailableErrorView } from './index-QnoQrLJ7.js';
2
+ import { r as retry, T as TokenImage } from './TokenImage-z4OoDdYE.js';
3
+ import { p as parseUnits, f as formatUnits } from './index-aJ1AhJ6L.js';
4
+ import { H as HandoverContent } from './HandoverContent-DQ1dvn2V.js';
5
+ import { C as Contract } from './index-DWFmOHWm.js';
6
+ import { F as FeesBreakdown } from './FeesBreakdown-BypWN9Iy.js';
6
7
 
7
8
  /**
8
9
  * The function `useInterval` sets up an interval that repeatedly calls a given callback function with
@@ -31,6 +32,70 @@ function useInterval(callback, interval) {
31
32
  return intervalRef;
32
33
  }
33
34
 
35
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
36
+ // require the crypto API and do not support built-in fallback to lower quality random number
37
+ // generators (like Math.random()).
38
+ var getRandomValues;
39
+ var rnds8 = new Uint8Array(16);
40
+ function rng() {
41
+ // lazy load so that environments that need to polyfill have a chance to do so
42
+ if (!getRandomValues) {
43
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
44
+ // find the complete implementation of crypto (msCrypto) on IE11.
45
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
46
+
47
+ if (!getRandomValues) {
48
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
49
+ }
50
+ }
51
+
52
+ return getRandomValues(rnds8);
53
+ }
54
+
55
+ var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
56
+
57
+ function validate(uuid) {
58
+ return typeof uuid === 'string' && REGEX.test(uuid);
59
+ }
60
+
61
+ /**
62
+ * Convert array of 16 byte values to UUID string format of the form:
63
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
64
+ */
65
+
66
+ var byteToHex = [];
67
+
68
+ for (var i = 0; i < 256; ++i) {
69
+ byteToHex.push((i + 0x100).toString(16).substr(1));
70
+ }
71
+
72
+ function stringify(arr) {
73
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
74
+ // Note: Be careful editing this code! It's been tuned for performance
75
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
76
+ var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
77
+ // of the following:
78
+ // - One or more input array values don't map to a hex octet (leading to
79
+ // "undefined" in the uuid)
80
+ // - Invalid input values for the RFC `version` or `variant` fields
81
+
82
+ if (!validate(uuid)) {
83
+ throw TypeError('Stringified UUID is invalid');
84
+ }
85
+
86
+ return uuid;
87
+ }
88
+
89
+ function v4(options, buf, offset) {
90
+ options = options || {};
91
+ var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
92
+
93
+ rnds[6] = rnds[6] & 0x0f | 0x40;
94
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
95
+
96
+ return stringify(rnds);
97
+ }
98
+
34
99
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
35
100
  function sendAddTokensCloseEvent(eventTarget) {
36
101
  const closeWidgetEvent = new CustomEvent(IMTBLWidgetEvents.IMTBL_ADD_TOKENS_WIDGET_EVENT, {
@@ -91,6 +156,108 @@ const sendAddTokensFailedEvent = (eventTarget, reason) => {
91
156
  eventTarget.dispatchEvent(failedEvent);
92
157
  };
93
158
 
159
+ const initialAddTokensState = {
160
+ id: '',
161
+ allowedTokens: null,
162
+ squid: null,
163
+ chains: null,
164
+ balances: null,
165
+ tokens: null,
166
+ routes: [],
167
+ selectedRouteData: undefined,
168
+ selectedToken: undefined,
169
+ selectedAmount: '',
170
+ isSwapAvailable: undefined,
171
+ experiments: undefined,
172
+ };
173
+ var AddTokensActions;
174
+ (function (AddTokensActions) {
175
+ AddTokensActions["SET_ID"] = "SET_ID";
176
+ AddTokensActions["SET_ALLOWED_TOKENS"] = "SET_ALLOWED_TOKENS";
177
+ AddTokensActions["SET_SQUID"] = "SET_SQUID";
178
+ AddTokensActions["SET_CHAINS"] = "SET_CHAINS";
179
+ AddTokensActions["SET_BALANCES"] = "SET_BALANCES";
180
+ AddTokensActions["SET_TOKENS"] = "SET_TOKENS";
181
+ AddTokensActions["SET_ROUTES"] = "SET_ROUTES";
182
+ AddTokensActions["SET_SELECTED_ROUTE_DATA"] = "SET_SELECTED_ROUTE_DATA";
183
+ AddTokensActions["SET_SELECTED_TOKEN"] = "SET_SELECTED_TOKEN";
184
+ AddTokensActions["SET_SELECTED_AMOUNT"] = "SET_SELECTED_AMOUNT";
185
+ AddTokensActions["SET_IS_SWAP_AVAILABLE"] = "SET_IS_SWAP_AVAILABLE";
186
+ AddTokensActions["SET_EXPERIMENTS"] = "SET_EXPERIMENTS";
187
+ })(AddTokensActions || (AddTokensActions = {}));
188
+ // eslint-disable-next-line @typescript-eslint/naming-convention
189
+ const AddTokensContext = reactExports.createContext({
190
+ addTokensState: initialAddTokensState,
191
+ addTokensDispatch: () => { },
192
+ });
193
+ AddTokensContext.displayName = 'AddTokensContext';
194
+ const addTokensReducer = (state, action) => {
195
+ switch (action.payload.type) {
196
+ case AddTokensActions.SET_ID:
197
+ return {
198
+ ...state,
199
+ id: action.payload.id,
200
+ };
201
+ case AddTokensActions.SET_ALLOWED_TOKENS:
202
+ return {
203
+ ...state,
204
+ allowedTokens: action.payload.allowedTokens,
205
+ };
206
+ case AddTokensActions.SET_SQUID:
207
+ return {
208
+ ...state,
209
+ squid: action.payload.squid,
210
+ };
211
+ case AddTokensActions.SET_CHAINS:
212
+ return {
213
+ ...state,
214
+ chains: action.payload.chains,
215
+ };
216
+ case AddTokensActions.SET_BALANCES:
217
+ return {
218
+ ...state,
219
+ balances: action.payload.balances,
220
+ };
221
+ case AddTokensActions.SET_TOKENS:
222
+ return {
223
+ ...state,
224
+ tokens: action.payload.tokens,
225
+ };
226
+ case AddTokensActions.SET_ROUTES:
227
+ return {
228
+ ...state,
229
+ routes: action.payload.routes,
230
+ };
231
+ case AddTokensActions.SET_SELECTED_ROUTE_DATA:
232
+ return {
233
+ ...state,
234
+ selectedRouteData: action.payload.selectedRouteData,
235
+ };
236
+ case AddTokensActions.SET_SELECTED_TOKEN:
237
+ return {
238
+ ...state,
239
+ selectedToken: action.payload.selectedToken,
240
+ };
241
+ case AddTokensActions.SET_SELECTED_AMOUNT:
242
+ return {
243
+ ...state,
244
+ selectedAmount: action.payload.selectedAmount,
245
+ };
246
+ case AddTokensActions.SET_IS_SWAP_AVAILABLE:
247
+ return {
248
+ ...state,
249
+ isSwapAvailable: action.payload.isSwapAvailable,
250
+ };
251
+ case AddTokensActions.SET_EXPERIMENTS:
252
+ return {
253
+ ...state,
254
+ experiments: action.payload.experiments,
255
+ };
256
+ default:
257
+ return state;
258
+ }
259
+ };
260
+
94
261
  var AddTokensWidgetViews;
95
262
  (function (AddTokensWidgetViews) {
96
263
  AddTokensWidgetViews["ADD_TOKENS"] = "ADD_TOKENS";
@@ -763,6 +930,31 @@ const useRoutes = () => {
763
930
  };
764
931
  };
765
932
 
933
+ var FiatOptionType;
934
+ (function (FiatOptionType) {
935
+ FiatOptionType["CREDIT"] = "credit";
936
+ FiatOptionType["DEBIT"] = "debit";
937
+ })(FiatOptionType || (FiatOptionType = {}));
938
+ var AddTokensErrorTypes;
939
+ (function (AddTokensErrorTypes) {
940
+ AddTokensErrorTypes["DEFAULT"] = "DEFAULT_ERROR";
941
+ AddTokensErrorTypes["INVALID_PARAMETERS"] = "INVALID_PARAMETERS";
942
+ AddTokensErrorTypes["SERVICE_BREAKDOWN"] = "SERVICE_BREAKDOWN";
943
+ AddTokensErrorTypes["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
944
+ AddTokensErrorTypes["UNRECOGNISED_CHAIN"] = "UNRECOGNISED_CHAIN";
945
+ AddTokensErrorTypes["PROVIDER_ERROR"] = "PROVIDER_ERROR";
946
+ AddTokensErrorTypes["WALLET_FAILED"] = "WALLET_FAILED";
947
+ AddTokensErrorTypes["WALLET_REJECTED"] = "WALLET_REJECTED";
948
+ AddTokensErrorTypes["WALLET_REJECTED_NO_FUNDS"] = "WALLET_REJECTED_NO_FUNDS";
949
+ AddTokensErrorTypes["WALLET_POPUP_BLOCKED"] = "WALLET_POPUP_BLOCKED";
950
+ AddTokensErrorTypes["ENVIRONMENT_ERROR"] = "ENVIRONMENT_ERROR";
951
+ AddTokensErrorTypes["ROUTE_ERROR"] = "ROUTE_ERROR";
952
+ })(AddTokensErrorTypes || (AddTokensErrorTypes = {}));
953
+ var AddTokensExperiments;
954
+ (function (AddTokensExperiments) {
955
+ AddTokensExperiments["PRESELECTED_TOKEN"] = "addTokensPreselectedToken";
956
+ })(AddTokensExperiments || (AddTokensExperiments = {}));
957
+
766
958
  function WarningHero() {
767
959
  return (jsx(Box, { testId: "warning-hero", sx: {
768
960
  display: 'flex',
@@ -3994,6 +4186,16 @@ const useError = (environment) => {
3994
4186
  };
3995
4187
  };
3996
4188
 
4189
+ function SquidFooter() {
4190
+ const { t } = useTranslation();
4191
+ return (jsx(Body, { size: "xSmall", sx: {
4192
+ textAlign: 'center',
4193
+ color: 'base.color.text.body.secondary',
4194
+ }, children: jsx(Trans, { i18nKey: t('views.ADD_TOKENS.footer.body'), components: {
4195
+ squidLink: jsx(Link, { size: "xSmall", rc: jsx("a", { target: "_blank", href: " https://app.squidrouter.com", rel: "noreferrer" }) }),
4196
+ } }) }));
4197
+ }
4198
+
3997
4199
  const PULSE_SHADOW = keyframes `
3998
4200
  0% {
3999
4201
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
@@ -4195,6 +4397,207 @@ function SelectedWallet({ label, caption, children, onClick, providerInfo, chain
4195
4397
  }, children: [getMenuItemImage(), jsx(MenuItem.Label, { children: label }), providerInfo?.name ? (jsxs(MenuItem.Caption, { children: [providerInfo?.name, ' • ', jsx(EllipsizedText, { text: providerInfo.address ?? '', sx: { c: 'inherit', fontSize: 'inherit' } })] })) : (jsx(MenuItem.Caption, { children: caption })), jsx(MenuItem.BottomSlot, { children: children })] }));
4196
4398
  }
4197
4399
 
4400
+ /**
4401
+ * Formats a number to a string with a maximum number of decimals
4402
+ * removing trailing zeros
4403
+ */
4404
+ const getFormattedAmounts = (value, maxDecimals = DEFAULT_TOKEN_FORMATTING_DECIMALS) => {
4405
+ const amount = typeof value === 'number' ? value : parseFloat(value);
4406
+ if (Number.isNaN(amount)) {
4407
+ return '-.--';
4408
+ }
4409
+ if (amount > 0 && amount < 1) {
4410
+ return tokenValueFormat(value, maxDecimals).replace(/\.?0+$/, '');
4411
+ }
4412
+ return tokenValueFormat(amount, maxDecimals);
4413
+ };
4414
+ /**
4415
+ * Converts a crypto amount to a formatted string
4416
+ */
4417
+ function getFormattedNumber(value, decimals, maxDecimals = 5) {
4418
+ const amount = String(value);
4419
+ let formattedValue = '';
4420
+ try {
4421
+ if (Number.isNaN(amount) || !decimals) {
4422
+ throw new Error('Invalid amount or decimals');
4423
+ }
4424
+ formattedValue = formatUnits(BigNumber.from(amount), decimals)
4425
+ .toString();
4426
+ }
4427
+ catch {
4428
+ return '-.--';
4429
+ }
4430
+ return getFormattedAmounts(formattedValue, maxDecimals);
4431
+ }
4432
+
4433
+ const emptyRouteBalance = {
4434
+ routeBalance: getFormattedAmounts(''),
4435
+ routeBalanceUsd: getFormattedAmounts(''),
4436
+ fromAmount: getFormattedAmounts(''),
4437
+ fromAmountUsd: getFormattedAmounts(''),
4438
+ };
4439
+ function getRouteAndTokenBalances(routeData) {
4440
+ if (!routeData) {
4441
+ return emptyRouteBalance;
4442
+ }
4443
+ const usdPrice = routeData?.route.route.estimate.fromToken.usdPrice;
4444
+ if (!usdPrice) {
4445
+ return emptyRouteBalance;
4446
+ }
4447
+ const { balance } = routeData.amountData;
4448
+ const routeBalance = getFormattedNumber(balance.balance, balance?.decimals, balance?.decimals);
4449
+ const routeBalanceUsd = (parseFloat(routeBalance) * usdPrice).toString();
4450
+ const fromAmount = getFormattedNumber(routeData.route.route.estimate.fromAmount, routeData.route.route.estimate.fromToken.decimals);
4451
+ const fromAmountUsd = getFormattedAmounts(routeData.route.route.estimate.fromAmountUSD ?? '');
4452
+ return {
4453
+ fromAmount,
4454
+ fromAmountUsd,
4455
+ routeBalance: getFormattedAmounts(routeBalance),
4456
+ routeBalanceUsd: getFormattedAmounts(routeBalanceUsd),
4457
+ };
4458
+ }
4459
+
4460
+ /**
4461
+ * Get the total fees for a route
4462
+ */
4463
+ function getTotalRouteFees(route) {
4464
+ const [fees, feesUsd] = route?.route.estimate.feeCosts.reduce(([acc, accUsd], fee) => [
4465
+ acc + parseFloat(fee.amount),
4466
+ accUsd + parseFloat(fee.amountUsd),
4467
+ ], [0, 0]) ?? [0, 0];
4468
+ const [gasFees, gasFeesUsd] = route?.route.estimate.gasCosts.reduce(([acc, accUsd], fee) => [
4469
+ acc + parseFloat(fee.amount),
4470
+ accUsd + parseFloat(fee.amountUsd),
4471
+ ], [0, 0]) ?? [0, 0];
4472
+ const totalFees = fees + gasFees;
4473
+ const totalFeesUsd = feesUsd + gasFeesUsd;
4474
+ return {
4475
+ fees,
4476
+ feesUsd,
4477
+ gasFees,
4478
+ gasFeesUsd,
4479
+ totalFees,
4480
+ totalFeesUsd,
4481
+ };
4482
+ }
4483
+
4484
+ function getDurationFormatted(estimatedRouteDuration, minutesText, minuteText, secondText) {
4485
+ const seconds = estimatedRouteDuration;
4486
+ if (seconds >= 60) {
4487
+ const minutes = Math.round(seconds / 60);
4488
+ return minutes === 1 ? `1 ${minuteText}` : `${minutes} ${minutesText}`;
4489
+ }
4490
+ return `${seconds.toFixed(0)}${secondText}`;
4491
+ }
4492
+
4493
+ function RouteOption({ routeData, onClick, chains, disabled = false, isFastest = false, size = 'small', rc = jsx("span", {}), selected = false, }) {
4494
+ const { t } = useTranslation();
4495
+ const { fromToken } = routeData.amountData;
4496
+ const { estimate } = routeData.route.route;
4497
+ const chain = chains?.find((c) => c.id === fromToken.chainId);
4498
+ const estimatedDurationFormatted = getDurationFormatted(estimate.estimatedRouteDuration, t('views.ADD_TOKENS.routeSelection.minutesText'), t('views.ADD_TOKENS.routeSelection.minuteText'), t('views.ADD_TOKENS.routeSelection.secondsText'));
4499
+ const { totalFeesUsd } = reactExports.useMemo(() => getTotalRouteFees(routeData.route), [routeData]);
4500
+ const { routeBalanceUsd, fromAmount, fromAmountUsd } = reactExports.useMemo(() => getRouteAndTokenBalances(routeData), [routeData]);
4501
+ const handleClick = () => {
4502
+ onClick(routeData);
4503
+ };
4504
+ const menuItemProps = {
4505
+ selected,
4506
+ disabled,
4507
+ emphasized: true,
4508
+ rc,
4509
+ size,
4510
+ onClick: disabled ? undefined : handleClick,
4511
+ };
4512
+ return (jsxs(MenuItem, { ...menuItemProps, children: [jsx(MenuItem.Label, { children: fromToken.name }), chain && (jsxs(Sticker, { position: { x: 'right', y: 'bottom' }, children: [jsx(Sticker.FramedImage, { use: jsx("img", { src: chain.iconUrl, alt: chain.name }), size: "xSmall" }), jsx(MenuItem.FramedImage, { circularFrame: true, use: jsx("img", { src: fromToken.iconUrl, alt: fromToken.name }) })] })), jsxs(MenuItem.Caption, { children: [`${t('views.ADD_TOKENS.fees.balance')} ${t('views.ADD_TOKENS.fees.fiatPricePrefix')} $${routeBalanceUsd}`, routeData.isInsufficientGas && (jsxs(Fragment, { children: [jsx("br", {}), jsx("span", { style: { color: '#FF637F' }, children: t('views.ADD_TOKENS.noGasRouteMessage', {
4513
+ token: routeData.route.route.estimate.gasCosts[0].token.symbol,
4514
+ }) })] }))] }), jsx(MenuItem.PriceDisplay, { price: fromAmount, children: jsx(MenuItem.PriceDisplay.Caption, { children: `${t('views.ADD_TOKENS.fees.fiatPricePrefix')} $${fromAmountUsd}` }) }), jsxs(MenuItem.BottomSlot, { children: [jsx(MenuItem.BottomSlot.Divider, {}), jsxs(Stack, { rc: jsx("span", {}), direction: "row", justifyContent: "space-between", sx: {
4515
+ w: '100%',
4516
+ }, children: [jsxs(Body, { sx: {
4517
+ ...hFlex,
4518
+ ...centerFlexChildren,
4519
+ gap: 'base.spacing.x1',
4520
+ c: 'base.color.text.body.secondary',
4521
+ }, size: "xSmall", children: [jsx(Icon, { icon: "Countdown", sx: {
4522
+ w: 'base.icon.size.200',
4523
+ fill: 'base.color.text.body.secondary',
4524
+ }, variant: "bold" }), estimatedDurationFormatted] }), jsxs(Body, { size: "xSmall", sx: { ...hFlex, ...centerFlexChildren }, children: [isFastest && (jsx(Badge, { badgeContent: t('views.ADD_TOKENS.routeSelection.fastestBadge'), variant: "emphasis", sx: { mr: 'base.spacing.x2' } })), `${t('views.ADD_TOKENS.fees.fee')} ${t('views.ADD_TOKENS.fees.fiatPricePrefix')}
4525
+ $${getFormattedAmounts(totalFeesUsd)}`] })] })] })] }));
4526
+ }
4527
+
4528
+ function FiatOption({ type, onClick, disabled = false, size = 'small', rc = jsx("span", {}), }) {
4529
+ const { t } = useTranslation();
4530
+ const icon = {
4531
+ [FiatOptionType.DEBIT]: 'BankCard',
4532
+ [FiatOptionType.CREDIT]: 'Craft',
4533
+ };
4534
+ const handleClick = () => {
4535
+ onClick?.(type);
4536
+ };
4537
+ const menuItemProps = {
4538
+ disabled,
4539
+ emphasized: true,
4540
+ onClick: disabled ? undefined : handleClick,
4541
+ size,
4542
+ rc,
4543
+ };
4544
+ return (jsxs(MenuItem, { ...menuItemProps, children: [jsx(MenuItem.FramedIcon, { icon: icon[type], variant: "bold", emphasized: false }), jsx(MenuItem.Label, { children: t(`views.ADD_TOKENS.drawer.options.${type}.heading`) }), jsx(MenuItem.Caption, { children: t(`views.ADD_TOKENS.drawer.options.${type}.${disabled ? 'disabledCaption' : 'caption'}`) }), !disabled && jsx(MenuItem.IntentIcon, {})] }));
4545
+ }
4546
+
4547
+ const defaultFiatOptions = [
4548
+ FiatOptionType.DEBIT,
4549
+ FiatOptionType.CREDIT,
4550
+ ];
4551
+ function RouteOptions({ checkout, routes, chains, onCardClick, onRouteClick, size, showOnrampOption, insufficientBalance, selectedIndex, }) {
4552
+ const { t } = useTranslation();
4553
+ // @NOTE: early exit with loading related UI, when the
4554
+ // routes are not yet available
4555
+ if (!routes?.length && !insufficientBalance) {
4556
+ return (jsxs(Stack, { sx: { pt: 'base.spacing.x3' }, alignItems: "stretch", gap: "base.spacing.x1", children: [jsx(MenuItem, { shimmer: "withBottomSlot", size: "small", emphasized: true }), jsx(MenuItem, { shimmer: "withBottomSlot", size: "small", emphasized: true }), jsxs(Body, { sx: { textAlign: 'center', mt: 'base.spacing.x6' }, size: "small", children: [t('views.ADD_TOKENS.drawer.options.loadingText1'), jsx("br", {}), t('views.ADD_TOKENS.drawer.options.loadingText2')] }), jsx(FramedVideo, { mimeType: "video/mp4", videoUrl: getRemoteVideo(checkout.config.environment, '/loading_bubble-small.mp4'), sx: { alignSelf: 'center', mt: 'base.spacing.x2' }, size: "large", circularFrame: true })] }));
4557
+ }
4558
+ const noRoutes = !(!insufficientBalance || routes?.length);
4559
+ return (jsxs(Stack, { sx: { py: 'base.spacing.x3' }, alignItems: "stretch", gap: "base.spacing.x1", testId: "options-list", justifyContent: "center", rc: jsx(motion.div, { variants: listVariants, initial: "hidden", animate: "show" }), children: [routes?.map((routeData, index) => (jsx(RouteOption, { size: size, routeData: routeData, chains: chains, onClick: () => onRouteClick(routeData, index), isFastest: index === 0, selected: index === selectedIndex, rc: jsx(motion.div, { variants: listItemVariants }) }, `route-option-${routeData.amountData.fromToken.chainId}-${routeData.amountData.fromToken.address}`))), noRoutes && (jsxs(Banner, { children: [jsx(Banner.Icon, { icon: "InformationCircle" }), jsx(Banner.Title, { children: t('views.ADD_TOKENS.drawer.options.noRoutes.heading') }), jsx(Banner.Caption, { children: t('views.ADD_TOKENS.drawer.options.noRoutes.caption') })] })), showOnrampOption && (jsxs(Fragment, { children: [jsx(Divider, { size: "xSmall", sx: { my: 'base.spacing.x2' }, children: t('views.ADD_TOKENS.drawer.options.moreOptionsDividerText') }), defaultFiatOptions.map((type, idx) => (jsx(FiatOption, { type: type, size: size, onClick: onCardClick, rc: jsx(motion.div, { custom: idx, variants: listItemVariants }) }, `fiat-option-${type}`)))] }))] }));
4560
+ }
4561
+
4562
+ function RouteOptionsDrawer({ checkout, routes, visible, onClose, onRouteClick, onCardClick, showOnrampOption,
4563
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4564
+ showSwapOption,
4565
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4566
+ showBridgeOption, insufficientBalance, }) {
4567
+ const { t } = useTranslation();
4568
+ const { track } = useAnalytics();
4569
+ const { addTokensState: { id, chains }, } = reactExports.useContext(AddTokensContext);
4570
+ const { providersState: { fromProviderInfo, fromAddress }, } = useProvidersContext();
4571
+ const selectedRouteIndex = reactExports.useRef(0);
4572
+ const handleOnRouteClick = (route, index) => {
4573
+ selectedRouteIndex.current = index;
4574
+ onRouteClick(route);
4575
+ };
4576
+ reactExports.useEffect(() => {
4577
+ if (!visible) {
4578
+ return;
4579
+ }
4580
+ track({
4581
+ userJourney: UserJourney.ADD_TOKENS,
4582
+ screen: 'InputScreen',
4583
+ control: 'RoutesMenu',
4584
+ controlType: 'MenuItem',
4585
+ action: 'Opened',
4586
+ extras: {
4587
+ contextId: id,
4588
+ showOnrampOption: Boolean(showOnrampOption),
4589
+ showSwapOption: Boolean(showSwapOption),
4590
+ insufficientBalance: Boolean(insufficientBalance),
4591
+ routesAvailable: routes?.length ?? 0,
4592
+ },
4593
+ });
4594
+ }, [visible]);
4595
+ return (jsx(Drawer, { size: "full", visible: visible, showHeaderBar: false, onCloseDrawer: onClose, children: jsxs(Drawer.Content, { rc: jsx(motion.div, { variants: listVariants, initial: "hidden", animate: "show" }), sx: {
4596
+ pt: 'base.spacing.x3',
4597
+ px: 'base.spacing.x3',
4598
+ }, children: [jsxs(MenuItem, { size: "xSmall", children: [jsx(MenuItem.FramedImage, { padded: true, emphasized: true, use: (jsx("img", { src: fromProviderInfo?.icon, alt: fromProviderInfo?.name })), sx: { mx: 'base.spacing.x2' } }), jsx(MenuItem.Label, { children: t('views.ADD_TOKENS.drawer.options.heading') }), jsxs(MenuItem.Caption, { children: [fromProviderInfo?.name, ' • ', jsx(EllipsizedText, { text: fromAddress ?? '', sx: { c: 'inherit', fontSize: 'inherit' } })] }), jsx(MenuItem.StatefulButtCon, { icon: "ChevronExpand", onClick: onClose })] }), jsx(RouteOptions, { size: "small", checkout: checkout, routes: routes, chains: chains, onCardClick: onCardClick, onRouteClick: handleOnRouteClick, showOnrampOption: showOnrampOption, insufficientBalance: insufficientBalance, selectedIndex: selectedRouteIndex.current })] }) }));
4599
+ }
4600
+
4198
4601
  function SelectedRouteOptionContainer({ children, onClick, selected, }) {
4199
4602
  return (jsx(Stack, { direction: "row", alignItems: "center", gap: "base.spacing.x4", sx: {
4200
4603
  ml: ({ base }) => (selected
@@ -1,10 +1,11 @@
1
- import { bY as axios, bZ as CheckoutErrorType, b_ as IMMUTABLE_API_BASE_URL, r as reactExports, I as IMTBLWidgetEvents, B as BridgeEventType, q as jsxs, p as jsx, b$ as ShimmerBox, a8 as MenuItem, aD as Stack, u as useTranslation, ax as Body, U as Button, N as Box, c0 as PASSPORT_URL, a_ as Link, c1 as getChainIdBySlug, c2 as getChainImage, c3 as networkName, as as FramedImage, ay as EllipsizedText, b5 as Icon, X as useAnalytics, a0 as UserJourney, c4 as Accordion, R as Divider, ad as ViewContext, _ as Fragment, V as ViewActions, c5 as useWalletConnect, c6 as isWalletConnectProvider, c7 as Logo, c8 as RawImage, bN as CryptoFiatContext, c9 as AXELAR_SCAN_URL, an as isNativeToken, ao as getTokenImageByAddress, ca as getNativeSymbolByChainSlug, J as formatUnits, bm as calculateCryptoToFiat, ag as EventTargetContext, K as isPassportProvider, j as getL1ChainId, am as TokenFilterTypes, i as getL2ChainId, $ as WalletProviderRdns, a3 as Web3Provider, aH as useInjectedProviders, bt as HeaderNavigation, bz as FooterLogo, Y as WalletDrawer, aM as SimpleLayout, cb as getChainSlugById, cc as JsonRpcProvider, bU as CryptoFiatActions, cd as DEFAULT_TRANSACTIONS_RETRY_POLICY, L as LoadingView, k as ChainId, ce as getChainNameById, b6 as useTheme, T as Heading, cf as getWalletProviderNameByProvider, cg as isMetaMaskProvider, ch as WalletProviderName, Q as Drawer, au as ButtCon, ci as ButtonNavigationStyles, aN as orchestrationEvents, bC as tokenValueFormat, cj as formatZeroAmount, ck as NATIVE, aE as fetchRiskAssessment, bg as amountInputValidation, aa as getRemoteImage, bi as CloudImage, cl as ETH_TOKEN_SYMBOL, F as BigNumber, be as Environment, D as parseUnits, cm as GasEstimateType, cn as DEFAULT_TOKEN_DECIMALS, co as DEFAULT_QUOTE_REFRESH_INTERVAL, cp as addChainChangedListener, cq as removeChainChangedListener, aF as isAddressSanctioned, cr as IMX_TOKEN_SYMBOL, n as SharedViews, cs as dist, ct as CHECKOUT_CDN_BASE_URL, cu as heroBackGroundStyles, cv as heroImageStyles, cw as Badge, cx as SimpleTextBody, cy as FooterButton, cz as getEthTokenImage, cA as WITHDRAWAL_CLAIM_GAS_LIMIT, al as getDefaultTokenImage, b7 as viewReducer, b8 as initialViewState, cB as BridgeConfiguration, cC as ImmutableConfiguration, cD as TokenBridge, cE as StatusView, bA as StatusType, E as ErrorView, bj as ServiceUnavailableErrorView, bX as CryptoFiatProvider, cF as ETH_SEPOLIA_TO_ZKEVM_TESTNET, cG as ETH_SEPOLIA_TO_ZKEVM_DEVNET, cH as ETH_MAINNET_TO_ZKEVM_MAINNET } from './index-uoFT0va2.js';
2
- import { T as TokenImage, r as retry } from './TokenImage-BKsKixKT.js';
3
- import { B as BridgeWidgetViews, T as TopUpView } from './TopUpView-B4EZHPvY.js';
4
- import { S as SelectForm, T as TextInputForm, a as TransactionRejected, g as getAllowedBalances, F as Fees, N as NetworkSwitchDrawer, W as WalletApproveHero } from './WalletApproveHero--5umxYJp.js';
5
- import { u as useInterval } from './useInterval-DoDljSUa.js';
6
- import { C as Contract } from './index-Smb16jHM.js';
7
- import './FeesBreakdown-Ck9YzdSC.js';
1
+ import { bN as axios, bO as CheckoutErrorType, bP as IMMUTABLE_API_BASE_URL, r as reactExports, I as IMTBLWidgetEvents, B as BridgeEventType, q as jsxs, p as jsx, bQ as ShimmerBox, a6 as MenuItem, aB as Stack, u as useTranslation, aj as Body, R as Button, K as Box, bR as PASSPORT_URL, ai as Link, bS as getChainIdBySlug, bT as getChainImage, bU as networkName, ar as FramedImage, aw as EllipsizedText, aE as Icon, T as useAnalytics, _ as UserJourney, bV as Accordion, N as Divider, ab as ViewContext, Y as Fragment, V as ViewActions, bW as useWalletConnect, bX as isWalletConnectProvider, bY as Logo, bZ as RawImage, bC as CryptoFiatContext, b_ as AXELAR_SCAN_URL, an as isNativeToken, ao as getTokenImageByAddress, b$ as getNativeSymbolByChainSlug, bf as calculateCryptoToFiat, ae as EventTargetContext, H as isPassportProvider, j as getL1ChainId, am as TokenFilterTypes, i as getL2ChainId, Z as WalletProviderRdns, a1 as Web3Provider, aO as useInjectedProviders, bm as HeaderNavigation, bp as FooterLogo, U as WalletDrawer, aR as SimpleLayout, c0 as getChainSlugById, c1 as JsonRpcProvider, bJ as CryptoFiatActions, c2 as DEFAULT_TRANSACTIONS_RETRY_POLICY, L as LoadingView, k as ChainId, c3 as getChainNameById, b2 as useTheme, Q as Heading, c4 as getWalletProviderNameByProvider, c5 as isMetaMaskProvider, c6 as WalletProviderName, M as Drawer, at as ButtCon, c7 as ButtonNavigationStyles, aS as orchestrationEvents, az as tokenValueFormat, c8 as formatZeroAmount, c9 as NATIVE, aM as fetchRiskAssessment, b9 as amountInputValidation, a8 as getRemoteImage, bb as CloudImage, ca as ETH_TOKEN_SYMBOL, D as BigNumber, b7 as Environment, cb as GasEstimateType, cc as DEFAULT_TOKEN_DECIMALS, cd as DEFAULT_QUOTE_REFRESH_INTERVAL, ce as addChainChangedListener, cf as removeChainChangedListener, aN as isAddressSanctioned, cg as IMX_TOKEN_SYMBOL, n as SharedViews, ch as dist, ci as CHECKOUT_CDN_BASE_URL, cj as heroBackGroundStyles, ck as heroImageStyles, aF as Badge, cl as SimpleTextBody, cm as FooterButton, cn as getEthTokenImage, co as WITHDRAWAL_CLAIM_GAS_LIMIT, al as getDefaultTokenImage, b3 as viewReducer, b4 as initialViewState, cp as BridgeConfiguration, cq as ImmutableConfiguration, cr as TokenBridge, cs as StatusView, bq as StatusType, E as ErrorView, bc as ServiceUnavailableErrorView, bM as CryptoFiatProvider, ct as ETH_SEPOLIA_TO_ZKEVM_TESTNET, cu as ETH_SEPOLIA_TO_ZKEVM_DEVNET, cv as ETH_MAINNET_TO_ZKEVM_MAINNET } from './index-QnoQrLJ7.js';
2
+ import { T as TokenImage, r as retry } from './TokenImage-z4OoDdYE.js';
3
+ import { B as BridgeWidgetViews, T as TopUpView } from './TopUpView-B4eXJlqS.js';
4
+ import { f as formatUnits, p as parseUnits } from './index-aJ1AhJ6L.js';
5
+ import { S as SelectForm, T as TextInputForm, a as TransactionRejected, g as getAllowedBalances, F as Fees, N as NetworkSwitchDrawer, W as WalletApproveHero } from './WalletApproveHero-83IoWlwV.js';
6
+ import { u as useInterval } from './useInterval-Cs241Eva.js';
7
+ import { C as Contract } from './index-DWFmOHWm.js';
8
+ import './FeesBreakdown-BypWN9Iy.js';
8
9
 
9
10
  // This module is intended to unwrap Axios default export as named.
10
11
  // Keep top-level export same with static properties
@@ -1,18 +1,19 @@
1
- import { I as IMTBLWidgetEvents, C as CommerceFlowType, P as ProviderEventType, a as CommerceEventType, b as ConnectEventType, c as CommerceFailureEventType, d as CommerceSuccessEventType, W as WalletEventType, e as CommerceUserActionEventType, S as SwapEventType, A as AddTokensEventType, B as BridgeEventType, O as OnRampEventType, f as SaleEventType, g as PurchaseEventType, h as OrchestrationEventType, r as reactExports, V as ViewActions, i as getL2ChainId, j as getL1ChainId, k as ChainId, u as useTranslation, l as useViewState, m as useEventTargetState, n as SharedViews, o as commerceFlows, p as jsx, q as jsxs, L as LoadingView, E as ErrorView, s as ConnectWidget, t as ProvidersContextProvider, v as PurchaseWidget, w as ConnectLoader, x as ViewContextProvider } from './index-uoFT0va2.js';
2
- import SwapWidget from './SwapWidget-CwFYyKSt.js';
3
- import BridgeWidget from './BridgeWidget-BhrCocw2.js';
4
- import { O as OnRampWidget } from './OnRampWidget-CqVk3g3X.js';
5
- import WalletWidget from './WalletWidget-DVqX_Zms.js';
6
- import SaleWidget from './SaleWidget-BN4NOhbW.js';
7
- import AddTokensWidget from './AddTokensWidget-TbB4PmLW.js';
8
- import './WalletApproveHero--5umxYJp.js';
9
- import './TokenImage-BKsKixKT.js';
10
- import './FeesBreakdown-Ck9YzdSC.js';
11
- import './useInterval-DoDljSUa.js';
12
- import './TopUpView-B4EZHPvY.js';
13
- import './SpendingCapHero-CPvvFrji.js';
14
- import './index-Smb16jHM.js';
15
- import './HandoverContent-DB23bXer.js';
1
+ import { I as IMTBLWidgetEvents, C as CommerceFlowType, P as ProviderEventType, a as CommerceEventType, b as ConnectEventType, c as CommerceFailureEventType, d as CommerceSuccessEventType, W as WalletEventType, e as CommerceUserActionEventType, S as SwapEventType, A as AddTokensEventType, B as BridgeEventType, O as OnRampEventType, f as SaleEventType, g as PurchaseEventType, h as OrchestrationEventType, r as reactExports, V as ViewActions, i as getL2ChainId, j as getL1ChainId, k as ChainId, u as useTranslation, l as useViewState, m as useEventTargetState, n as SharedViews, o as commerceFlows, p as jsx, q as jsxs, L as LoadingView, E as ErrorView, s as ConnectWidget, t as ProvidersContextProvider, v as PurchaseWidget, w as ConnectLoader, x as ViewContextProvider } from './index-QnoQrLJ7.js';
2
+ import SwapWidget from './SwapWidget-BmfIQSUe.js';
3
+ import BridgeWidget from './BridgeWidget-CrLjoZj2.js';
4
+ import { O as OnRampWidget } from './OnRampWidget-JJO1UCrW.js';
5
+ import WalletWidget from './WalletWidget-ComOLNY_.js';
6
+ import SaleWidget from './SaleWidget-Bpmzfc7A.js';
7
+ import AddTokensWidget from './AddTokensWidget-BAbeB6QF.js';
8
+ import './WalletApproveHero-83IoWlwV.js';
9
+ import './TokenImage-z4OoDdYE.js';
10
+ import './FeesBreakdown-BypWN9Iy.js';
11
+ import './useInterval-Cs241Eva.js';
12
+ import './index-aJ1AhJ6L.js';
13
+ import './TopUpView-B4eXJlqS.js';
14
+ import './SpendingCapHero-Br5Uv8YR.js';
15
+ import './index-DWFmOHWm.js';
16
+ import './HandoverContent-DQ1dvn2V.js';
16
17
 
17
18
  const sendCheckoutEvent = (eventTarget, detail) => {
18
19
  const event = new CustomEvent(IMTBLWidgetEvents.IMTBL_COMMERCE_WIDGET_EVENT, { detail });
@@ -1,4 +1,4 @@
1
- import { q as jsxs, p as jsx, ax as Body, b4 as PriceDisplay, N as Box, u as useTranslation, Q as Drawer, a8 as MenuItem, _ as Fragment, R as Divider, bC as tokenValueFormat, cj as formatZeroAmount, bz as FooterLogo } from './index-uoFT0va2.js';
1
+ import { q as jsxs, p as jsx, aj as Body, b1 as PriceDisplay, K as Box, u as useTranslation, M as Drawer, a6 as MenuItem, Y as Fragment, N as Divider, az as tokenValueFormat, c8 as formatZeroAmount, bp as FooterLogo } from './index-QnoQrLJ7.js';
2
2
 
3
3
  const feesBreakdownContentStyles = {
4
4
  display: 'flex',
@@ -1,4 +1,4 @@
1
- import { q as jsxs, N as Box, p as jsx, T as Heading, ax as Body, U as Button } from './index-uoFT0va2.js';
1
+ import { q as jsxs, K as Box, p as jsx, Q as Heading, aj as Body, R as Button } from './index-QnoQrLJ7.js';
2
2
 
3
3
  function HandoverContent({ headingText, subheadingText, primaryButtonText, onPrimaryButtonClick, secondaryButtonText, onSecondaryButtonClick, }) {
4
4
  return (jsxs(Box, { sx: {
@@ -1,6 +1,6 @@
1
- import { cZ as global, X as useAnalytics, r as reactExports, bO as ConnectLoaderContext, ag as EventTargetContext, u as useTranslation, ad as ViewContext, n as SharedViews, aE as fetchRiskAssessment, aF as isAddressSanctioned, V as ViewActions, c_ as ExchangeType, p as jsx, aM as SimpleLayout, bt as HeaderNavigation, c$ as sendOnRampWidgetCloseEvent, aN as orchestrationEvents, I as IMTBLWidgetEvents, N as Box, a0 as UserJourney, bz as FooterLogo, q as jsxs, cx as SimpleTextBody, b7 as viewReducer, b8 as initialViewState, ck as NATIVE, L as LoadingView, d0 as sendOnRampSuccessEvent, bA as StatusType, cE as StatusView, d1 as sendOnRampFailedEvent, bj as ServiceUnavailableErrorView } from './index-uoFT0va2.js';
2
- import { O as OnRampWidgetViews, T as TopUpView } from './TopUpView-B4EZHPvY.js';
3
- import { S as SpendingCapHero } from './SpendingCapHero-CPvvFrji.js';
1
+ import { cN as global, T as useAnalytics, r as reactExports, bD as ConnectLoaderContext, ae as EventTargetContext, u as useTranslation, ab as ViewContext, n as SharedViews, aM as fetchRiskAssessment, aN as isAddressSanctioned, V as ViewActions, cO as ExchangeType, p as jsx, aR as SimpleLayout, bm as HeaderNavigation, cP as sendOnRampWidgetCloseEvent, aS as orchestrationEvents, I as IMTBLWidgetEvents, K as Box, _ as UserJourney, bp as FooterLogo, q as jsxs, cl as SimpleTextBody, b3 as viewReducer, b4 as initialViewState, c9 as NATIVE, L as LoadingView, cQ as sendOnRampSuccessEvent, bq as StatusType, cs as StatusView, cR as sendOnRampFailedEvent, bc as ServiceUnavailableErrorView } from './index-QnoQrLJ7.js';
2
+ import { O as OnRampWidgetViews, T as TopUpView } from './TopUpView-B4eXJlqS.js';
3
+ import { S as SpendingCapHero } from './SpendingCapHero-Br5Uv8YR.js';
4
4
 
5
5
  function isNull(arg) {
6
6
  return arg === null;
@@ -1,15 +1,16 @@
1
- import { be as Environment, F as BigNumber, r as reactExports, bk as compareStr, ad as ViewContext, V as ViewActions, aE as fetchRiskAssessment, p as jsx, bl as SalePaymentTypes, a0 as UserJourney, u as useTranslation, bm as calculateCryptoToFiat, X as useAnalytics, ag as EventTargetContext, bn as sendSaleWidgetCloseEvent, bo as sendSaleSuccessEvent, bp as sendSaleFailedEvent, bq as sendSaleTransactionSuccessEvent, br as sendSalePaymentMethodEvent, bs as sendSalePaymentTokenEvent, bt as HeaderNavigation, q as jsxs, bu as LoadingOverlay, N as Box, _ as Fragment, aM as SimpleLayout, ae as useHandover, af as HandoverTarget, ai as getRemoteRive, T as Heading, bv as HandoverDuration, K as isPassportProvider, a8 as MenuItem, bw as motion, bx as listVariants, by as listItemVariants, aF as isAddressSanctioned, n as SharedViews, bz as FooterLogo, bA as StatusType, bB as prettyFormatNumber, bC as tokenValueFormat, bD as ShimmerCircle, U as Button, aD as Stack, bE as FundingStepType, bF as abbreviateWalletAddress, J as formatUnits, Q as Drawer, bG as Caption, R as Divider, bH as tokenSymbolNameOverrides, bI as ItemType, bJ as TransactionOrGasType, bK as GasTokenType, bL as RoutingOutcomeType, an as isNativeToken, ao as getTokenImageByAddress, bM as isGasFree, bN as CryptoFiatContext, bO as ConnectLoaderContext, bP as eventTargetReducer, bQ as initialEventTargetState, j as getL1ChainId, i as getL2ChainId, I as IMTBLWidgetEvents, bR as EventTargetActions, L as LoadingView, k as ChainId, bS as ConnectWidgetViews, s as ConnectWidget, S as SwapEventType, O as OnRampEventType, B as BridgeEventType, b as ConnectEventType, bT as ConnectLoaderActions, bU as CryptoFiatActions, au as ButtCon, ax as Body, bV as widgetTheme, b7 as viewReducer, b8 as initialViewState, bW as BlockExplorerService, bj as ServiceUnavailableErrorView, bX as CryptoFiatProvider } from './index-uoFT0va2.js';
2
- import { C as Contract } from './index-Smb16jHM.js';
3
- import { u as useTransakEvents, O as OnRampWidget } from './OnRampWidget-CqVk3g3X.js';
4
- import { H as HandoverContent } from './HandoverContent-DB23bXer.js';
5
- import { u as useMount, T as TopUpView } from './TopUpView-B4EZHPvY.js';
6
- import { T as TokenImage } from './TokenImage-BKsKixKT.js';
7
- import { F as Fees } from './WalletApproveHero--5umxYJp.js';
8
- import BridgeWidget from './BridgeWidget-BhrCocw2.js';
9
- import SwapWidget from './SwapWidget-CwFYyKSt.js';
10
- import './SpendingCapHero-CPvvFrji.js';
11
- import './FeesBreakdown-Ck9YzdSC.js';
12
- import './useInterval-DoDljSUa.js';
1
+ import { b7 as Environment, D as BigNumber, r as reactExports, bd as compareStr, ab as ViewContext, V as ViewActions, aM as fetchRiskAssessment, p as jsx, be as SalePaymentTypes, _ as UserJourney, u as useTranslation, bf as calculateCryptoToFiat, T as useAnalytics, ae as EventTargetContext, bg as sendSaleWidgetCloseEvent, bh as sendSaleSuccessEvent, bi as sendSaleFailedEvent, bj as sendSaleTransactionSuccessEvent, bk as sendSalePaymentMethodEvent, bl as sendSalePaymentTokenEvent, bm as HeaderNavigation, q as jsxs, bn as LoadingOverlay, K as Box, Y as Fragment, aR as SimpleLayout, ac as useHandover, ad as HandoverTarget, af as getRemoteRive, Q as Heading, bo as HandoverDuration, H as isPassportProvider, a6 as MenuItem, aJ as motion, aI as listVariants, aK as listItemVariants, aN as isAddressSanctioned, n as SharedViews, bp as FooterLogo, bq as StatusType, br as prettyFormatNumber, az as tokenValueFormat, bs as ShimmerCircle, R as Button, aB as Stack, bt as FundingStepType, bu as abbreviateWalletAddress, M as Drawer, bv as Caption, N as Divider, bw as tokenSymbolNameOverrides, bx as ItemType, by as TransactionOrGasType, bz as GasTokenType, bA as RoutingOutcomeType, an as isNativeToken, ao as getTokenImageByAddress, bB as isGasFree, bC as CryptoFiatContext, bD as ConnectLoaderContext, bE as eventTargetReducer, bF as initialEventTargetState, j as getL1ChainId, i as getL2ChainId, I as IMTBLWidgetEvents, bG as EventTargetActions, L as LoadingView, k as ChainId, bH as ConnectWidgetViews, s as ConnectWidget, S as SwapEventType, O as OnRampEventType, B as BridgeEventType, b as ConnectEventType, bI as ConnectLoaderActions, bJ as CryptoFiatActions, at as ButtCon, aj as Body, bK as widgetTheme, b3 as viewReducer, b4 as initialViewState, bL as BlockExplorerService, bc as ServiceUnavailableErrorView, bM as CryptoFiatProvider } from './index-QnoQrLJ7.js';
2
+ import { C as Contract } from './index-DWFmOHWm.js';
3
+ import { u as useTransakEvents, O as OnRampWidget } from './OnRampWidget-JJO1UCrW.js';
4
+ import { H as HandoverContent } from './HandoverContent-DQ1dvn2V.js';
5
+ import { u as useMount, T as TopUpView } from './TopUpView-B4eXJlqS.js';
6
+ import { T as TokenImage } from './TokenImage-z4OoDdYE.js';
7
+ import { f as formatUnits } from './index-aJ1AhJ6L.js';
8
+ import { F as Fees } from './WalletApproveHero-83IoWlwV.js';
9
+ import BridgeWidget from './BridgeWidget-CrLjoZj2.js';
10
+ import SwapWidget from './SwapWidget-BmfIQSUe.js';
11
+ import './SpendingCapHero-Br5Uv8YR.js';
12
+ import './FeesBreakdown-BypWN9Iy.js';
13
+ import './useInterval-Cs241Eva.js';
13
14
 
14
15
  var SaleWidgetViews;
15
16
  (function (SaleWidgetViews) {