@embarkai/ui-kit 0.4.51 → 0.4.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -815,7 +815,7 @@ var init_iframe_mpc_client = __esm({
815
815
  });
816
816
 
817
817
  // src/internal/constants.ts
818
- var import_lucide_react, LOCAL_COLOR_MODE_KEY, LOOCAL_BACKUP_STATUS_KEY, DEFAULT_AUTH_MENU_HEIGHT, DEFAULT_MAIN_MENU_HEIGHT, MAX_CONTENT_HEIGHT, MAIN_DIALOG_ANIMATION_SPEED, Y_ANIMATION_SETUP, BLOCKSCOUT_QUERY_STALE_TIME, BLOCKSCOUT_QUERY_GC_TIME, BLOCKSCOUT_REFRESH_DEBOUNCE, IPFS_GATEWAY, PROVIDERS_META;
818
+ var import_lucide_react, LOCAL_COLOR_MODE_KEY, LOOCAL_BACKUP_STATUS_KEY, DEFAULT_AUTH_MENU_HEIGHT, DEFAULT_MAIN_MENU_HEIGHT, MAX_CONTENT_HEIGHT, MAIN_DIALOG_ANIMATION_SPEED, Y_ANIMATION_SETUP, BLOCKSCOUT_QUERY_STALE_TIME, BLOCKSCOUT_QUERY_GC_TIME, BLOCKSCOUT_REFRESH_DEBOUNCE, IPFS_GATEWAY, PROVIDERS_META, WRAPPED_TOKENS;
819
819
  var init_constants = __esm({
820
820
  "src/internal/constants.ts"() {
821
821
  import_lucide_react = require("lucide-react");
@@ -842,6 +842,7 @@ var init_constants = __esm({
842
842
  // Alias for twitter (API uses 'x')
843
843
  wallet: { name: "Wallet", icon: import_lucide_react.Wallet2, description: "External wallet (EOA)" }
844
844
  };
845
+ WRAPPED_TOKENS = ["WETH", "WBTC", "WBNB", "WLUMIA"];
845
846
  }
846
847
  });
847
848
 
@@ -11454,7 +11455,7 @@ function ChainItem(props) {
11454
11455
  children: name
11455
11456
  }
11456
11457
  ),
11457
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Badge, { variant: "secondary", children: badge })
11458
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Badge, { variant: badge.toLowerCase() === "mainnet" ? "success" : "secondary", children: badge })
11458
11459
  ] }),
11459
11460
  isActiveChain && paymasterAddress && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] text-xs", children: [
11460
11461
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "flex-none uppercase", children: "Paymaster" }),
@@ -11578,7 +11579,7 @@ function ChainsMenu() {
11578
11579
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11579
11580
  Switch,
11580
11581
  {
11581
- labels: { checked: "ALL", unchecked: "MAINNETS" },
11582
+ labels: { checked: "MAINNETS", unchecked: "ALL" },
11582
11583
  checked: isTestnets,
11583
11584
  onChange: () => setIsTestnets(!isTestnets)
11584
11585
  }
@@ -17914,7 +17915,7 @@ function isAssetRateAvailable(symbol) {
17914
17915
  }
17915
17916
  }
17916
17917
  function checkWrapedTokenSymbol(symbol) {
17917
- if (WRAPPED_SYMBOLS.includes(symbol)) {
17918
+ if (WRAPPED_TOKENS.includes(symbol)) {
17918
17919
  return symbol.slice(1);
17919
17920
  }
17920
17921
  return symbol.toUpperCase();
@@ -18066,10 +18067,11 @@ function PortfolioItem(props) {
18066
18067
  }
18067
18068
  );
18068
18069
  }
18069
- var import_react_query38, import_lucide_react50, import_viem9, import_jsx_runtime83, WRAPPED_SYMBOLS, SKIP_SYMBOLS2, ASSETS_RATES_QUERY_KEY;
18070
+ var import_react_query38, import_lucide_react50, import_viem9, import_jsx_runtime83, SKIP_SYMBOLS2, ASSETS_RATES_QUERY_KEY;
18070
18071
  var init_PortfolioItem = __esm({
18071
18072
  "src/internal/components/PortfolioMenu/PortfolioItem.tsx"() {
18072
18073
  init_ProviderContext();
18074
+ init_constants();
18073
18075
  import_react_query38 = require("@tanstack/react-query");
18074
18076
  import_lucide_react50 = require("lucide-react");
18075
18077
  import_viem9 = require("viem");
@@ -18081,7 +18083,6 @@ var init_PortfolioItem = __esm({
18081
18083
  init_truncateMiddle();
18082
18084
  init_BalanceView2();
18083
18085
  import_jsx_runtime83 = require("react/jsx-runtime");
18084
- WRAPPED_SYMBOLS = ["WETH", "WBTC", "WBNB", "WLUMIA"];
18085
18086
  SKIP_SYMBOLS2 = ["TEST"];
18086
18087
  ASSETS_RATES_QUERY_KEY = "lumia-passport-assets-rates-query-key";
18087
18088
  }
@@ -18393,17 +18394,11 @@ var init_ReceiveMenu2 = __esm({
18393
18394
  });
18394
18395
 
18395
18396
  // src/internal/components/SecurityMenu/constants.ts
18396
- var KEYSHARE_RECOVERY_STATS_QUERY, CONNECTED_TRUSTED_APPS_QUERY, WELL_KNOWN_PROJECTS;
18397
+ var KEYSHARE_RECOVERY_STATS_QUERY, CONNECTED_TRUSTED_APPS_QUERY;
18397
18398
  var init_constants5 = __esm({
18398
18399
  "src/internal/components/SecurityMenu/constants.ts"() {
18399
18400
  KEYSHARE_RECOVERY_STATS_QUERY = "keyshare-recovery-stats-query";
18400
18401
  CONNECTED_TRUSTED_APPS_QUERY = "connected-trusted-apps-query";
18401
- WELL_KNOWN_PROJECTS = {
18402
- // '327733f6-2e85-4afc-a505-e2c55d0a2659': 'https://staging-hub.lumia.org',
18403
- "11062797-f0a6-4737-bad8-086d1125dde1": "https://parlay.money",
18404
- "f7a70f92-58e9-4fe9-b713-61c27a24e3d6": "https://embark-demo-dapp.pages.dev"
18405
- // https://account.embarkai.io
18406
- };
18407
18402
  }
18408
18403
  });
18409
18404
 
@@ -18461,7 +18456,7 @@ var init_hooks2 = __esm({
18461
18456
  function Application(props) {
18462
18457
  const { projectId, logo, name, appUrl, trustedAuthorizedApp, firstConnectedAt, untrustApp } = props;
18463
18458
  const { t } = useT();
18464
- const projectUrl = appUrl || WELL_KNOWN_PROJECTS[projectId] || null;
18459
+ const projectUrl = appUrl || null;
18465
18460
  return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
18466
18461
  "div",
18467
18462
  {
@@ -18577,7 +18572,6 @@ var init_ConnectedApps = __esm({
18577
18572
  import_lucide_react53 = require("lucide-react");
18578
18573
  init_button();
18579
18574
  init_highlight();
18580
- init_constants5();
18581
18575
  init_hooks2();
18582
18576
  import_jsx_runtime86 = require("react/jsx-runtime");
18583
18577
  }
@@ -19447,7 +19441,6 @@ function useAvailableSenders() {
19447
19441
  return;
19448
19442
  }
19449
19443
  lastCalcedSenders.current = sendersAccumulator.map((s) => `${s.name}-${s.address}`);
19450
- console.info("[SENDER SELECTOR] setting bridge senders", sendersAccumulator);
19451
19444
  useBridgeStore.getState().setBridgeSenders(sendersAccumulator);
19452
19445
  useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
19453
19446
  }, [address, profiles]);
@@ -20070,7 +20063,11 @@ function useHyperlaneRoutes() {
20070
20063
  retry: false,
20071
20064
  enabled: !!address && page === "send" /* SEND */ && flow === "bridge",
20072
20065
  queryKey: [HYPERLANE_WARP_ROUTES_QUERY_KEY, address],
20073
- queryFn: async () => getHyperlaneWarpRoutes()
20066
+ queryFn: async () => {
20067
+ const warpRoutes = await getHyperlaneWarpRoutes();
20068
+ useFlowSelectorStore.getState().setRenderKey(`hyperlane-bridge-warp-routes-loaded-${Date.now()}`);
20069
+ return warpRoutes;
20070
+ }
20074
20071
  });
20075
20072
  (0, import_react66.useEffect)(() => {
20076
20073
  if (!errorWarpRoutes) return;
@@ -20174,6 +20171,12 @@ var init_ResolveChainIcon = __esm({
20174
20171
  });
20175
20172
 
20176
20173
  // src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts
20174
+ function checkWrapedTokenSymbol2(symbol) {
20175
+ if (WRAPPED_TOKENS.includes(symbol)) {
20176
+ return symbol.slice(1);
20177
+ }
20178
+ return symbol.toUpperCase();
20179
+ }
20177
20180
  function useBridgeBalance(hyperlaneWarpRoutes) {
20178
20181
  const qc = (0, import_react_query46.useQueryClient)();
20179
20182
  const { t } = useT();
@@ -20199,7 +20202,7 @@ function useBridgeBalance(hyperlaneWarpRoutes) {
20199
20202
  enabled: bridgeSender === "embarkai-wallet" && !!selectedWarpRoute && !!address && !!originChain,
20200
20203
  address
20201
20204
  });
20202
- const embarkTokenBalanace = assets.find((a) => a.symbol === selectedWarpRoute?.symbol);
20205
+ const embarkTokenBalanace = assets.find((a) => selectedWarpRoute?.symbol === checkWrapedTokenSymbol2(a.symbol));
20203
20206
  const originChainMeta = CHAINS_UI_META[originChain];
20204
20207
  const isSelectedTokenNative = selectedWarpRoute?.symbol?.toUpperCase() === originChainMeta?.chain?.nativeCurrency?.symbol?.toUpperCase();
20205
20208
  const { data: externalBalanceData, isLoading: isExternalBalanceLoading } = (0, import_react_query46.useQuery)({
@@ -20310,6 +20313,7 @@ function useBridgeBalance(hyperlaneWarpRoutes) {
20310
20313
  var import_core6, import_react_query46, import_react68, import_viem13, import_wagmi5, EXTERNAL_WALLET_BRIDGING_BALANCE_QUERY, EXTERNAL_WALLET_BRIDGING_NATIVE_BALANCE_QUERY;
20311
20314
  var init_useBridgeBalance = __esm({
20312
20315
  "src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts"() {
20316
+ init_constants();
20313
20317
  init_SessionContext();
20314
20318
  init_i18n();
20315
20319
  import_core6 = require("@embarkai/core");
@@ -20330,10 +20334,10 @@ var init_useBridgeBalance = __esm({
20330
20334
 
20331
20335
  // src/internal/components/SendMenu/hyperbridge/steps/SelectStep.tsx
20332
20336
  function SelectStep(props) {
20333
- const { swapChains, hyperlaneWarpRoutes, isLoadingWarpRoutes, handleQuoteEstimation } = props;
20337
+ const { swapChains, hyperlaneWarpRoutes = [], isLoadingWarpRoutes, handleQuoteEstimation } = props;
20334
20338
  const { t } = useT();
20335
20339
  const {
20336
- bridgeSenders,
20340
+ bridgeSenders = [],
20337
20341
  bridgeSender,
20338
20342
  originChain,
20339
20343
  destinationChain,
@@ -21245,12 +21249,11 @@ function HyperlaneBridge() {
21245
21249
  const { hyperlaneWarpRoutes, isLoadingWarpRoutes } = useHyperlaneRoutes();
21246
21250
  const { directWalletProfile } = useAvailableSenders();
21247
21251
  useMenuTitle(hyperlaneWarpRoutes);
21248
- (0, import_react72.useEffect)(
21249
- () => () => {
21252
+ (0, import_react72.useEffect)(() => {
21253
+ return () => {
21250
21254
  useBridgeStore.getState().resetSelections();
21251
- },
21252
- []
21253
- );
21255
+ };
21256
+ }, []);
21254
21257
  return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
21255
21258
  bridgeStep === "sender-selector" && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SenderSelector, { directWalletProfile }),
21256
21259
  bridgeStep === "select" && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
@@ -21434,7 +21437,7 @@ function useNicknameResolve(input, options) {
21434
21437
  }, [normalized, isNicknameInput, enabled]);
21435
21438
  const query = (0, import_react_query48.useQuery)({
21436
21439
  queryKey: [...QUERY_KEYS.nicknameResolve(debouncedInput), chainId],
21437
- queryFn: () => resolveNickname(debouncedInput, chainId),
21440
+ queryFn: async () => await resolveNickname(debouncedInput, chainId),
21438
21441
  enabled: enabled && isNicknameInput && debouncedInput.length > 0,
21439
21442
  staleTime: 1e3 * 60 * 5,
21440
21443
  // 5 minutes - addresses don't change often
@@ -21472,8 +21475,8 @@ var init_useNicknameResolve = __esm({
21472
21475
  import_react74 = require("react");
21473
21476
  init_nickname();
21474
21477
  init_profile();
21475
- init_nickname_validation();
21476
21478
  init_nickname_fingerprint();
21479
+ init_nickname_validation();
21477
21480
  DEBOUNCE_MS2 = 300;
21478
21481
  }
21479
21482
  });
@@ -21924,76 +21927,81 @@ var init_AssetList = __esm({
21924
21927
  function NicknameData(props) {
21925
21928
  const { resolvedNicknameData, isNicknameInput } = props;
21926
21929
  const {
21930
+ data: nicknameData,
21927
21931
  resolvedAddress,
21928
21932
  isResolving,
21933
+ isFingerprintVerified,
21929
21934
  isNotFound,
21930
21935
  isWalletNotSetup,
21931
- isFrozen,
21932
- isFingerprintVerified,
21933
- data: nicknameData
21936
+ isFrozen
21934
21937
  } = resolvedNicknameData;
21935
- if (!isNicknameInput) return null;
21936
- if (resolvedAddress && !isResolving && nicknameData)
21937
- return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] rounded-[var(--ui-kit-el-bdrs)] px-[var(--ui-kit-gap)]", children: [
21938
- nicknameData.avatarSvg ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
21939
- "img",
21938
+ (0, import_react77.useEffect)(() => {
21939
+ if (!resolvedNicknameData?.data?.fingerprint || !isNicknameInput) return;
21940
+ useFlowSelectorStore.getState().setRenderKey(`nickname-resolved-${Date.now()}`);
21941
+ }, [resolvedNicknameData, isNicknameInput]);
21942
+ (0, import_react77.useEffect)(() => {
21943
+ if (isResolving) return;
21944
+ let errMessage = null;
21945
+ switch (true) {
21946
+ case isNotFound:
21947
+ errMessage = "Nickname not found";
21948
+ break;
21949
+ case isWalletNotSetup:
21950
+ errMessage = "This user has not set up wallet yet";
21951
+ break;
21952
+ case isFrozen:
21953
+ errMessage = "This handle is frozen. Proceed with caution.";
21954
+ break;
21955
+ default:
21956
+ errMessage = null;
21957
+ }
21958
+ if (!errMessage) return;
21959
+ useFlowSelectorStore.getState().setError(errMessage);
21960
+ }, [isResolving, isNotFound, isWalletNotSetup, isFrozen]);
21961
+ if (isResolving || !isNicknameInput || !resolvedAddress || !nicknameData) return null;
21962
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] rounded-[var(--ui-kit-el-bdrs)] px-[var(--ui-kit-gap)]", children: [
21963
+ nicknameData.avatarSvg ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
21964
+ "img",
21965
+ {
21966
+ src: nicknameData.avatarSvg,
21967
+ alt: nicknameData.handle,
21968
+ className: "w-12 h-12 rounded-full object-cover flex-shrink-0",
21969
+ onError: (e) => {
21970
+ e.currentTarget.onerror = null;
21971
+ e.currentTarget.src = no_image_default;
21972
+ }
21973
+ }
21974
+ ) : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "w-12 h-12 rounded-full bg-[var(--ui-kit-secondary)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.AtSign, { className: "w-5 h-5" }) }),
21975
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex flex-col gap-1", children: [
21976
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] text-[10px] text-[var(--ui-kit-bg-success)]", children: [
21977
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.CheckCircle2, { className: "w-4 h-4 flex-shrink-0" }),
21978
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { children: nicknameData.handle })
21979
+ ] }),
21980
+ nicknameData.fingerprint && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
21981
+ "div",
21940
21982
  {
21941
- src: nicknameData.avatarSvg,
21942
- alt: nicknameData.handle,
21943
- className: "w-12 h-12 rounded-full object-cover flex-shrink-0",
21944
- onError: (e) => {
21945
- e.currentTarget.onerror = null;
21946
- e.currentTarget.src = no_image_default;
21947
- }
21983
+ className: cn(
21984
+ "flex items-center gap-[var(--ui-kit-gap)] text-[10px]",
21985
+ isFingerprintVerified ? "text-[var(--ui-kit-bg-success)]" : "text-[var(--ui-kit-bg-error)]"
21986
+ ),
21987
+ children: [
21988
+ isFingerprintVerified ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.ShieldCheck, { className: "w-4 h-4 flex-shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.ShieldAlert, { className: "w-4 h-4 flex-shrink-0" }),
21989
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { children: `${resolvedAddress.slice(0, 6)}...${resolvedAddress.slice(-4)} : ` }),
21990
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { children: isFingerprintVerified ? "Verified" : "FAILED" })
21991
+ ]
21948
21992
  }
21949
- ) : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "w-12 h-12 rounded-full bg-[var(--ui-kit-secondary)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.AtSign, { className: "w-5 h-5" }) }),
21950
- /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex flex-col gap-1", children: [
21951
- /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] text-[10px] text-[var(--ui-kit-bg-success)]", children: [
21952
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.CheckCircle2, { className: "w-4 h-4 flex-shrink-0" }),
21953
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { children: nicknameData.handle })
21954
- ] }),
21955
- nicknameData.fingerprint && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
21956
- "div",
21957
- {
21958
- className: cn(
21959
- "flex items-center gap-[var(--ui-kit-gap)] text-[10px]",
21960
- isFingerprintVerified ? "text-[var(--ui-kit-bg-success)]" : "text-[var(--ui-kit-bg-error)]"
21961
- ),
21962
- children: [
21963
- isFingerprintVerified ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.ShieldCheck, { className: "w-4 h-4 flex-shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.ShieldAlert, { className: "w-4 h-4 flex-shrink-0" }),
21964
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { children: `${resolvedAddress.slice(0, 6)}...${resolvedAddress.slice(-4)} : ` }),
21965
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { children: isFingerprintVerified ? "Verified" : "FAILED" })
21966
- ]
21967
- }
21968
- )
21969
- ] })
21970
- ] });
21971
- if (isFrozen && !isResolving) {
21972
- return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Highlight, { type: "warning", className: "flex gap-[var(--ui-kit-gap)]", children: [
21973
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.AlertTriangle, { className: "w-4 h-4" }),
21974
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { children: "This handle is frozen. Proceed with caution." })
21975
- ] });
21976
- }
21977
- if (isWalletNotSetup && !isResolving) {
21978
- return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
21979
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.AlertCircle, { className: "w-4 h-4" }),
21980
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { children: "This user has not set up wallet yet" })
21981
- ] });
21982
- }
21983
- if (isNotFound && !isResolving) {
21984
- return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
21985
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_lucide_react67.AlertCircle, { className: "w-4 h-4" }),
21986
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { children: "Nickname not found" })
21987
- ] });
21988
- }
21993
+ )
21994
+ ] })
21995
+ ] });
21989
21996
  }
21990
- var import_lucide_react67, import_jsx_runtime107;
21997
+ var import_lucide_react67, import_react77, import_jsx_runtime107;
21991
21998
  var init_NicknameData = __esm({
21992
21999
  "src/internal/components/SendMenu/send/components/NicknameData.tsx"() {
21993
22000
  import_lucide_react67 = require("lucide-react");
22001
+ import_react77 = require("react");
21994
22002
  init_no_image();
21995
22003
  init_utils2();
21996
- init_highlight();
22004
+ init_useFlowSelector();
21997
22005
  import_jsx_runtime107 = require("react/jsx-runtime");
21998
22006
  }
21999
22007
  });
@@ -22226,14 +22234,8 @@ var init_InputSendStep = __esm({
22226
22234
 
22227
22235
  // src/internal/components/SendMenu/send/sendSteps/ConfirmSendStep.tsx
22228
22236
  function ConfirmSendStep(props) {
22229
- const {
22230
- sendTransaction,
22231
- refreshBalances,
22232
- erc3643Compliance,
22233
- isNicknameInput,
22234
- resolvedNicknameData,
22235
- isTransactionPending
22236
- } = props;
22237
+ const { sendTransaction, erc3643Compliance, isNicknameInput, resolvedNicknameData } = props;
22238
+ const { t } = useT();
22237
22239
  const chainConfig = useSession((st) => st.chainConfig);
22238
22240
  const { resolvedAddress, isFrozen, isFingerprintVerified, data: nicknameData } = resolvedNicknameData || {};
22239
22241
  const { canTransfer: erc3643CanTransfer } = erc3643Compliance || {};
@@ -22242,25 +22244,31 @@ function ConfirmSendStep(props) {
22242
22244
  const isNft = isNftAsset3(selectedAsset);
22243
22245
  const isSecurity = isSecurityToken2(selectedAsset);
22244
22246
  const effectiveAddress = isNicknameInput ? resolvedAddress : recipient;
22245
- const handleConfirm = async () => {
22246
- if (!effectiveAddress || !selectedAsset) return;
22247
- setTxStep("pending");
22248
- const txAmount = isNft ? "1" : amount;
22249
- const hash = await sendTransaction({
22250
- to: effectiveAddress,
22251
- value: txAmount,
22252
- assetType: selectedAsset.type,
22253
- tokenAddress: selectedAsset.address,
22254
- tokenId: selectedAsset.tokenId,
22255
- decimals: selectedAsset.decimals
22256
- });
22257
- if (hash) {
22258
- setTxStep("success");
22259
- setTimeout(() => refreshBalances(), 3e3);
22260
- } else {
22261
- setTxStep("input");
22247
+ const { mutate: handleConfirm, isPending: isTransactionPending } = (0, import_react_query49.useMutation)({
22248
+ mutationFn: async () => {
22249
+ if (!effectiveAddress || !selectedAsset) return;
22250
+ setTxStep("pending");
22251
+ const txAmount = isNft ? "1" : amount;
22252
+ return await sendTransaction({
22253
+ to: effectiveAddress,
22254
+ value: txAmount,
22255
+ assetType: selectedAsset.type,
22256
+ tokenAddress: selectedAsset.address,
22257
+ tokenId: selectedAsset.tokenId,
22258
+ decimals: selectedAsset.decimals
22259
+ });
22260
+ },
22261
+ onSuccess: (hash) => {
22262
+ if (hash) {
22263
+ setTxStep("success");
22264
+ } else {
22265
+ setTxStep("input");
22266
+ }
22267
+ },
22268
+ onError: (error) => {
22269
+ useFlowSelectorStore.getState().setError(error?.message || "Transaction failed");
22262
22270
  }
22263
- };
22271
+ });
22264
22272
  return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_jsx_runtime109.Fragment, { children: [
22265
22273
  isNicknameInput && isFrozen && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(Highlight, { type: "warning", className: "flex gap-[var(--ui-kit-gap)]", children: [
22266
22274
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react69.AlertTriangle, { className: "h-4 w-4" }),
@@ -22326,7 +22334,7 @@ function ConfirmSendStep(props) {
22326
22334
  ] }) : (
22327
22335
  // Fungible token details
22328
22336
  /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex justify-between leading-5 gap-[var(--ui-kit-gap)]", children: [
22329
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "text-[10px] text-[var(--ui-kit-fg-muted)]", children: "Amount:" }),
22337
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "text-[10px] text-[var(--ui-kit-fg-muted)]", children: t("passport:common.amount") }),
22330
22338
  /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: "text-sm font-bold", children: [
22331
22339
  amount,
22332
22340
  " ",
@@ -22335,7 +22343,7 @@ function ConfirmSendStep(props) {
22335
22343
  ] })
22336
22344
  ),
22337
22345
  /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex justify-between leading-5 gap-[var(--ui-kit-gap)]", children: [
22338
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "text-[10px] text-[var(--ui-kit-fg-muted)]", children: "Network:" }),
22346
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "text-[10px] text-[var(--ui-kit-fg-muted)]", children: t("passport:common.network") }),
22339
22347
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "text-sm font-bold", children: chainConfig.name })
22340
22348
  ] })
22341
22349
  ] })
@@ -22361,7 +22369,7 @@ function ConfirmSendStep(props) {
22361
22369
  ) : (
22362
22370
  // Fungible token details
22363
22371
  /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex justify-between leading-5 gap-[var(--ui-kit-gap)]", children: [
22364
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "text-[var(--ui-kit-fg-muted)]", children: "Amount:" }),
22372
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "text-[var(--ui-kit-fg-muted)]", children: t("passport:common.amount") }),
22365
22373
  /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: "font-semibold", children: [
22366
22374
  amount,
22367
22375
  " ",
@@ -22370,26 +22378,38 @@ function ConfirmSendStep(props) {
22370
22378
  ] })
22371
22379
  ),
22372
22380
  /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex justify-between leading-5 gap-[var(--ui-kit-gap)]", children: [
22373
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "text-[var(--ui-kit-fg-muted)]", children: "Network:" }),
22381
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "text-[var(--ui-kit-fg-muted)]", children: t("passport:common.network") }),
22374
22382
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { children: chainConfig.name })
22375
22383
  ] })
22376
22384
  ] })
22377
22385
  ] }) }),
22378
- /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(Button, { onClick: handleConfirm, disabled: isTransactionPending, className: "w-full", size: "large", children: [
22379
- isTransactionPending && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react69.Loader, { className: "h-4 w-4 animate-spin" }),
22380
- "CONFIRM"
22381
- ] })
22386
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
22387
+ Button,
22388
+ {
22389
+ onClick: () => handleConfirm(),
22390
+ disabled: isTransactionPending,
22391
+ className: "w-full",
22392
+ size: "large",
22393
+ children: [
22394
+ isTransactionPending && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react69.Loader, { className: "h-4 w-4 animate-spin" }),
22395
+ t("passport:common.confirm")
22396
+ ]
22397
+ }
22398
+ )
22382
22399
  ] });
22383
22400
  }
22384
- var import_lucide_react69, import_jsx_runtime109;
22401
+ var import_react_query49, import_lucide_react69, import_jsx_runtime109;
22385
22402
  var init_ConfirmSendStep = __esm({
22386
22403
  "src/internal/components/SendMenu/send/sendSteps/ConfirmSendStep.tsx"() {
22387
22404
  init_SessionContext();
22405
+ init_i18n();
22406
+ import_react_query49 = require("@tanstack/react-query");
22388
22407
  import_lucide_react69 = require("lucide-react");
22389
22408
  init_priceFormatter();
22390
22409
  init_utils2();
22391
22410
  init_button();
22392
22411
  init_highlight();
22412
+ init_useFlowSelector();
22393
22413
  init_useSendStore();
22394
22414
  init_utils9();
22395
22415
  import_jsx_runtime109 = require("react/jsx-runtime");
@@ -22412,7 +22432,7 @@ function SendMenu() {
22412
22432
  const { t } = useT();
22413
22433
  const {
22414
22434
  assets,
22415
- refreshBalances,
22435
+ // refreshBalances,
22416
22436
  isLoading: isAssetsLoading
22417
22437
  } = useBlockscoutAssets({
22418
22438
  address
@@ -22424,10 +22444,10 @@ function SendMenu() {
22424
22444
  userOpHash,
22425
22445
  reset
22426
22446
  } = useSendTransaction();
22427
- (0, import_react77.useEffect)(() => {
22447
+ (0, import_react78.useEffect)(() => {
22428
22448
  useFlowSelectorStore.getState().setIsUiLocked(isAssetsLoading || isTransactionPending);
22429
22449
  }, [isAssetsLoading, isTransactionPending]);
22430
- (0, import_react77.useEffect)(() => {
22450
+ (0, import_react78.useEffect)(() => {
22431
22451
  useFlowSelectorStore.getState().setError(sendTransactionError || null);
22432
22452
  }, [sendTransactionError]);
22433
22453
  const {
@@ -22442,7 +22462,7 @@ function SendMenu() {
22442
22462
  } = useSendStore();
22443
22463
  const isNft = isNftAsset3(selectedAsset);
22444
22464
  const isSecurity = isSecurityToken2(selectedAsset);
22445
- (0, import_react77.useEffect)(
22465
+ (0, import_react78.useEffect)(
22446
22466
  () => () => {
22447
22467
  setSelectedAsset(null);
22448
22468
  setRecipient("");
@@ -22452,18 +22472,20 @@ function SendMenu() {
22452
22472
  },
22453
22473
  []
22454
22474
  );
22455
- (0, import_react77.useEffect)(() => {
22456
- const shouldSetNativeAsset = assets.length > 0 && !selectedAsset;
22457
- if (!shouldSetNativeAsset) return;
22458
- const native = assets.find((a) => a.type === "native");
22475
+ (0, import_react78.useEffect)(() => {
22476
+ const shouldNativeDefaultAsset = assets.length > 0 && !selectedAsset;
22477
+ if (!shouldNativeDefaultAsset) return;
22478
+ const chainNativeCurrency = useSession.getState().chainConfig?.nativeCurrency;
22479
+ const native = assets.find((a) => a.type === "native" && a.symbol === chainNativeCurrency?.symbol);
22459
22480
  if (isBalance(native)) return setSelectedAsset(native);
22460
22481
  const erc20 = assets.find((a) => a.type === "erc20");
22461
22482
  if (isBalance(erc20)) return setSelectedAsset(erc20);
22483
+ setSelectedAsset(assets[0]);
22462
22484
  }, [assets, selectedAsset]);
22463
22485
  const isNicknameInput = looksLikeNickname(recipient);
22464
22486
  const resolvedNicknameData = useNicknameResolve(recipient, { enabled: isNicknameInput, chainId: activeChainId });
22465
22487
  const effectiveAddress = isNicknameInput ? resolvedNicknameData?.resolvedAddress : recipient;
22466
- const complianceAmount = (0, import_react77.useMemo)(() => {
22488
+ const complianceAmount = (0, import_react78.useMemo)(() => {
22467
22489
  if (!isSecurity || !amount || !selectedAsset) return void 0;
22468
22490
  try {
22469
22491
  return (0, import_viem18.parseUnits)(amount, selectedAsset.decimals || 18);
@@ -22478,7 +22500,7 @@ function SendMenu() {
22478
22500
  enabled: isSecurity && !!effectiveAddress && !!complianceAmount,
22479
22501
  chainId: activeChainId
22480
22502
  });
22481
- (0, import_react77.useEffect)(() => {
22503
+ (0, import_react78.useEffect)(() => {
22482
22504
  const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
22483
22505
  switch (true) {
22484
22506
  case txStep === "select-asset":
@@ -22516,11 +22538,9 @@ function SendMenu() {
22516
22538
  ConfirmSendStep,
22517
22539
  {
22518
22540
  sendTransaction,
22519
- refreshBalances,
22520
22541
  erc3643Compliance,
22521
22542
  isNicknameInput,
22522
- resolvedNicknameData,
22523
- isTransactionPending
22543
+ resolvedNicknameData
22524
22544
  }
22525
22545
  ),
22526
22546
  txStep === "pending" && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(Highlight, { type: "info", className: "flex gap-[var(--ui-kit-gap)]", children: [
@@ -22542,7 +22562,7 @@ function SendMenu() {
22542
22562
  ] })
22543
22563
  ] });
22544
22564
  }
22545
- var import_lucide_react70, import_react77, import_viem18, import_jsx_runtime110;
22565
+ var import_lucide_react70, import_react78, import_viem18, import_jsx_runtime110;
22546
22566
  var init_SendMenu = __esm({
22547
22567
  "src/internal/components/SendMenu/send/SendMenu.tsx"() {
22548
22568
  init_SessionContext();
@@ -22551,7 +22571,7 @@ var init_SendMenu = __esm({
22551
22571
  init_useSendTransaction();
22552
22572
  init_useT();
22553
22573
  import_lucide_react70 = require("lucide-react");
22554
- import_react77 = require("react");
22574
+ import_react78 = require("react");
22555
22575
  import_viem18 = require("viem");
22556
22576
  init_useBlockscoutAssets();
22557
22577
  init_useLayoutDataStore();
@@ -22636,7 +22656,7 @@ function SendFlowSelector() {
22636
22656
  const error = useFlowSelectorStore((st) => st.error);
22637
22657
  const menuTitle = useFlowSelectorStore((st) => st.menuTitle);
22638
22658
  const selectorFlow = useFlowSelectorStore((st) => st.flow);
22639
- (0, import_react78.useEffect)(
22659
+ (0, import_react79.useEffect)(
22640
22660
  () => () => {
22641
22661
  useFlowSelectorStore.getState().setError(null);
22642
22662
  },
@@ -22713,12 +22733,12 @@ function SendFlowSelector() {
22713
22733
  }
22714
22734
  );
22715
22735
  }
22716
- var import_lucide_react71, import_react78, import_jsx_runtime111, SELECTOR_FLOW;
22736
+ var import_lucide_react71, import_react79, import_jsx_runtime111, SELECTOR_FLOW;
22717
22737
  var init_SendFlowSelector = __esm({
22718
22738
  "src/internal/components/SendMenu/SendFlowSelector.tsx"() {
22719
22739
  init_i18n();
22720
22740
  import_lucide_react71 = require("lucide-react");
22721
- import_react78 = require("react");
22741
+ import_react79 = require("react");
22722
22742
  init_useLayoutDataStore();
22723
22743
  init_useLayoutStore();
22724
22744
  init_utils2();
@@ -22773,12 +22793,12 @@ function getServerSnapshot() {
22773
22793
  return false;
22774
22794
  }
22775
22795
  function useProMode() {
22776
- return (0, import_react79.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
22796
+ return (0, import_react80.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
22777
22797
  }
22778
- var import_react79, STORAGE_KEY, EVENT_NAME;
22798
+ var import_react80, STORAGE_KEY, EVENT_NAME;
22779
22799
  var init_pro_mode = __esm({
22780
22800
  "src/internal/lib/pro-mode.ts"() {
22781
- import_react79 = require("react");
22801
+ import_react80 = require("react");
22782
22802
  STORAGE_KEY = "embarkai_pro_mode";
22783
22803
  EVENT_NAME = "embarkai-pro-mode-changed";
22784
22804
  }
@@ -22820,7 +22840,7 @@ function useSettingsButtons() {
22820
22840
  if (proMode) {
22821
22841
  settingsButtons.push({ id: "devices" /* DEVICES */, name: "Guardians", Icon: import_lucide_react73.HardDrive });
22822
22842
  }
22823
- (0, import_react80.useEffect)(() => {
22843
+ (0, import_react81.useEffect)(() => {
22824
22844
  const cssvEl = document.querySelector(".embarkai-ui-scope");
22825
22845
  if (!cssvEl || !window?.getComputedStyle) {
22826
22846
  return;
@@ -22842,7 +22862,7 @@ function SettingsMenu() {
22842
22862
  const setPage = useLayoutDataStore((st) => st.setPage);
22843
22863
  const settingsButtons = useSettingsButtons();
22844
22864
  useProvidersList();
22845
- (0, import_react_query49.useQuery)({
22865
+ (0, import_react_query50.useQuery)({
22846
22866
  retry: 1,
22847
22867
  enabled: !!address,
22848
22868
  queryKey: [QUERY_KEYS.nicknameInfo, address],
@@ -22884,15 +22904,15 @@ function SettingsMenu() {
22884
22904
  }
22885
22905
  );
22886
22906
  }
22887
- var import_react_query49, import_lucide_react73, import_react80, import_jsx_runtime112;
22907
+ var import_react_query50, import_lucide_react73, import_react81, import_jsx_runtime112;
22888
22908
  var init_SettingsMenu = __esm({
22889
22909
  "src/internal/components/SettingsMenu/SettingsMenu.tsx"() {
22890
22910
  init_ProviderContext();
22891
22911
  init_SessionContext();
22892
22912
  init_i18n();
22893
- import_react_query49 = require("@tanstack/react-query");
22913
+ import_react_query50 = require("@tanstack/react-query");
22894
22914
  import_lucide_react73 = require("lucide-react");
22895
- import_react80 = require("react");
22915
+ import_react81 = require("react");
22896
22916
  init_nickname();
22897
22917
  init_profile();
22898
22918
  init_useLayoutDataStore();
@@ -23758,26 +23778,26 @@ var init_TransactionsGroup = __esm({
23758
23778
 
23759
23779
  // src/internal/components/TransactionsMenu/TransactionsMenu.tsx
23760
23780
  function TransactionsMenu() {
23761
- const qc = (0, import_react_query50.useQueryClient)();
23781
+ const qc = (0, import_react_query51.useQueryClient)();
23762
23782
  const address = useSession((st) => st.address);
23763
23783
  const chainConfig = useSession((st) => st.chainConfig);
23764
23784
  const { t } = useT();
23765
23785
  const setPage = useLayoutDataStore((st) => st.setPage);
23766
23786
  const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
23767
- const [expandedGroups, setExpandedGroups] = (0, import_react81.useState)({});
23787
+ const [expandedGroups, setExpandedGroups] = (0, import_react82.useState)({});
23768
23788
  const historySupported = isTransactionHistorySupported(chainConfig?.id);
23769
23789
  const {
23770
23790
  data: txHistoryGroups = [],
23771
23791
  isLoading: isTxHistoryLoading,
23772
23792
  isFetching: isTxHistoryFetching,
23773
23793
  error: txHistoryError
23774
- } = (0, import_react_query50.useQuery)({
23794
+ } = (0, import_react_query51.useQuery)({
23775
23795
  retry: false,
23776
23796
  enabled: !!address && !!chainConfig?.id && historySupported,
23777
23797
  queryKey: [TRANSACTIONS_HISTORY_QUERY_KEY, chainConfig.id, address],
23778
23798
  queryFn: () => getTransactionsListQuery({ address, chainConfig })
23779
23799
  });
23780
- const refreshTxHistory = (0, import_react81.useCallback)(
23800
+ const refreshTxHistory = (0, import_react82.useCallback)(
23781
23801
  () => qc.invalidateQueries({ queryKey: [TRANSACTIONS_HISTORY_QUERY_KEY, chainConfig.id, address] }),
23782
23802
  [qc, chainConfig.id, address]
23783
23803
  );
@@ -23826,14 +23846,14 @@ function TransactionsMenu() {
23826
23846
  }
23827
23847
  );
23828
23848
  }
23829
- var import_react_query50, import_lucide_react76, import_react81, import_jsx_runtime115;
23849
+ var import_react_query51, import_lucide_react76, import_react82, import_jsx_runtime115;
23830
23850
  var init_TransactionsMenu = __esm({
23831
23851
  "src/internal/components/TransactionsMenu/TransactionsMenu.tsx"() {
23832
23852
  init_SessionContext();
23833
23853
  init_i18n();
23834
- import_react_query50 = require("@tanstack/react-query");
23854
+ import_react_query51 = require("@tanstack/react-query");
23835
23855
  import_lucide_react76 = require("lucide-react");
23836
- import_react81 = require("react");
23856
+ import_react82 = require("react");
23837
23857
  init_useLayoutDataStore();
23838
23858
  init_useLayoutStore();
23839
23859
  init_Expandable2();
@@ -24031,7 +24051,7 @@ function usePageMapper() {
24031
24051
  setIsDialogOpen,
24032
24052
  setIsDialogClosing
24033
24053
  } = useLayoutStore();
24034
- const closeDialog = (0, import_react82.useCallback)(() => {
24054
+ const closeDialog = (0, import_react83.useCallback)(() => {
24035
24055
  setIsDialogClosing(true);
24036
24056
  setTimeout(() => {
24037
24057
  setDialogContent(null);
@@ -24042,7 +24062,7 @@ function usePageMapper() {
24042
24062
  setIsDialogOpen(false);
24043
24063
  }, CLEAR_DIALOG_TIMEOUT);
24044
24064
  }, [setDialogContent, setDialogDescription, setDialogTitle, setIsDialogForced, setIsDialogOpen, setIsDialogClosing]);
24045
- const openDialog = (0, import_react82.useCallback)(
24065
+ const openDialog = (0, import_react83.useCallback)(
24046
24066
  (pageItem) => {
24047
24067
  const PageContentComponent = pageItem.component;
24048
24068
  setDialogTitle(pageItem.title);
@@ -24052,7 +24072,7 @@ function usePageMapper() {
24052
24072
  },
24053
24073
  [setDialogContent, setDialogDescription, setDialogTitle, setIsDialogOpen]
24054
24074
  );
24055
- (0, import_react82.useEffect)(() => {
24075
+ (0, import_react83.useEffect)(() => {
24056
24076
  if (page === null) return closeDialog();
24057
24077
  const pageItem = PAGE_MAP[page];
24058
24078
  if (!pageItem) {
@@ -24063,10 +24083,10 @@ function usePageMapper() {
24063
24083
  openDialog(pageItem);
24064
24084
  }, [page, closeDialog, openDialog]);
24065
24085
  }
24066
- var import_react82, import_jsx_runtime116, CLEAR_DIALOG_TIMEOUT;
24086
+ var import_react83, import_jsx_runtime116, CLEAR_DIALOG_TIMEOUT;
24067
24087
  var init_usePageMapper = __esm({
24068
24088
  "src/internal/hooks/usePageMapper.tsx"() {
24069
- import_react82 = require("react");
24089
+ import_react83 = require("react");
24070
24090
  init_PageMap();
24071
24091
  init_constants();
24072
24092
  init_useLayoutDataStore();
@@ -24082,32 +24102,32 @@ function useSettingsNotifications() {
24082
24102
  const setSettingsNotifications = useLayoutDataStore((st) => st.setSettingsNotifications);
24083
24103
  const providers = import_auth23.jwtTokenManager.getProviders();
24084
24104
  const hasEmail = providers.includes("email");
24085
- const { data: userProfile = null } = (0, import_react_query51.useQuery)({
24105
+ const { data: userProfile = null } = (0, import_react_query52.useQuery)({
24086
24106
  retry: false,
24087
24107
  enabled: !!address,
24088
24108
  queryKey: [QUERY_KEYS.userProfile, address],
24089
24109
  queryFn: getUserProfile
24090
24110
  });
24091
- (0, import_react83.useEffect)(() => {
24111
+ (0, import_react84.useEffect)(() => {
24092
24112
  const isKYCVerified = userProfile?.kycDetails?.kycStatus === "verified";
24093
24113
  setSettingsNotifications({
24094
24114
  ...COMPLETE_KYC_PROGRESS,
24095
24115
  status: isKYCVerified ? "resolved" : "active"
24096
24116
  });
24097
24117
  }, [userProfile, setSettingsNotifications]);
24098
- (0, import_react83.useEffect)(() => {
24118
+ (0, import_react84.useEffect)(() => {
24099
24119
  setSettingsNotifications({
24100
24120
  ...EMAIL_NOT_CONNECTED_NOTIFICATION,
24101
24121
  status: hasEmail ? "resolved" : "active"
24102
24122
  });
24103
24123
  }, [hasEmail, setSettingsNotifications]);
24104
24124
  }
24105
- var import_react_query51, import_react83, EMAIL_NOT_CONNECTED_NOTIFICATION, COMPLETE_KYC_PROGRESS;
24125
+ var import_react_query52, import_react84, EMAIL_NOT_CONNECTED_NOTIFICATION, COMPLETE_KYC_PROGRESS;
24106
24126
  var init_useSettingsNotifications = __esm({
24107
24127
  "src/internal/hooks/useSettingsNotifications.ts"() {
24108
24128
  init_SessionContext();
24109
- import_react_query51 = require("@tanstack/react-query");
24110
- import_react83 = require("react");
24129
+ import_react_query52 = require("@tanstack/react-query");
24130
+ import_react84 = require("react");
24111
24131
  init_auth();
24112
24132
  init_profile();
24113
24133
  init_useLayoutDataStore();
@@ -24130,7 +24150,7 @@ var init_package = __esm({
24130
24150
  "package.json"() {
24131
24151
  package_default = {
24132
24152
  name: "@embarkai/ui-kit",
24133
- version: "0.4.51",
24153
+ version: "0.4.52",
24134
24154
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
24135
24155
  type: "module",
24136
24156
  main: "./dist/index.cjs",
@@ -24232,7 +24252,7 @@ var init_package = __esm({
24232
24252
 
24233
24253
  // src/internal/components/Footer/Footer.tsx
24234
24254
  function Footer() {
24235
- const qc = (0, import_react_query52.useQueryClient)();
24255
+ const qc = (0, import_react_query53.useQueryClient)();
24236
24256
  const { callbacksRef } = useProviderConfig();
24237
24257
  const { t } = useT();
24238
24258
  const address = useSession((st) => st.address);
@@ -24249,7 +24269,7 @@ function Footer() {
24249
24269
  }
24250
24270
  }
24251
24271
  });
24252
- const { mutate: disconnect, isPending: isDisconnecting } = (0, import_react_query52.useMutation)({
24272
+ const { mutate: disconnect, isPending: isDisconnecting } = (0, import_react_query53.useMutation)({
24253
24273
  mutationFn: async (disconnectAddress) => {
24254
24274
  if (!disconnectAddress) throw new Error("No address to disconnect");
24255
24275
  const { setError, setStatus, setIsLoading } = useSession.getState();
@@ -24335,7 +24355,7 @@ function Footer() {
24335
24355
  }
24336
24356
  );
24337
24357
  }
24338
- var import_react_query52, import_lucide_react77, import_wagmi7, import_jsx_runtime117;
24358
+ var import_react_query53, import_lucide_react77, import_wagmi7, import_jsx_runtime117;
24339
24359
  var init_Footer = __esm({
24340
24360
  "src/internal/components/Footer/Footer.tsx"() {
24341
24361
  init_package();
@@ -24343,7 +24363,7 @@ var init_Footer = __esm({
24343
24363
  init_ProviderContext();
24344
24364
  init_SessionContext();
24345
24365
  init_i18n();
24346
- import_react_query52 = require("@tanstack/react-query");
24366
+ import_react_query53 = require("@tanstack/react-query");
24347
24367
  import_lucide_react77 = require("lucide-react");
24348
24368
  import_wagmi7 = require("wagmi");
24349
24369
  init_auth();
@@ -24376,11 +24396,11 @@ function Header() {
24376
24396
  const chainConfig = useSession((st) => st.chainConfig);
24377
24397
  const { t } = useT();
24378
24398
  const proMode = useProMode();
24379
- const [proToast, setProToast] = (0, import_react84.useState)(false);
24380
- const [copied, setCopied] = (0, import_react84.useState)(false);
24381
- const clickCountRef = (0, import_react84.useRef)(0);
24382
- const clickTimerRef = (0, import_react84.useRef)(null);
24383
- const handleAvatarClick = (0, import_react84.useCallback)(() => {
24399
+ const [proToast, setProToast] = (0, import_react85.useState)(false);
24400
+ const [copied, setCopied] = (0, import_react85.useState)(false);
24401
+ const clickCountRef = (0, import_react85.useRef)(0);
24402
+ const clickTimerRef = (0, import_react85.useRef)(null);
24403
+ const handleAvatarClick = (0, import_react85.useCallback)(() => {
24384
24404
  clickCountRef.current += 1;
24385
24405
  if (clickTimerRef.current) {
24386
24406
  clearTimeout(clickTimerRef.current);
@@ -24398,7 +24418,7 @@ function Header() {
24398
24418
  }, 1e3);
24399
24419
  }
24400
24420
  }, []);
24401
- const { data: profile, isLoading: isProfileLoading } = (0, import_react_query53.useQuery)({
24421
+ const { data: profile, isLoading: isProfileLoading } = (0, import_react_query54.useQuery)({
24402
24422
  retry: false,
24403
24423
  enabled: !!address,
24404
24424
  queryKey: [QUERY_KEYS.userProfile, address],
@@ -24480,7 +24500,7 @@ function Header() {
24480
24500
  }
24481
24501
  );
24482
24502
  }
24483
- var import_react_query53, import_lucide_react78, import_react84, import_jsx_runtime118;
24503
+ var import_react_query54, import_lucide_react78, import_react85, import_jsx_runtime118;
24484
24504
  var init_Header = __esm({
24485
24505
  "src/internal/components/Header/Header.tsx"() {
24486
24506
  init_lumia2();
@@ -24488,9 +24508,9 @@ var init_Header = __esm({
24488
24508
  init_ProviderContext();
24489
24509
  init_SessionContext();
24490
24510
  init_useT();
24491
- import_react_query53 = require("@tanstack/react-query");
24511
+ import_react_query54 = require("@tanstack/react-query");
24492
24512
  import_lucide_react78 = require("lucide-react");
24493
- import_react84 = require("react");
24513
+ import_react85 = require("react");
24494
24514
  init_icons();
24495
24515
  init_auth();
24496
24516
  init_profile();
@@ -24521,7 +24541,7 @@ function useDecideContentStyles() {
24521
24541
  style: (0, import_lodash_es10.merge)({}, mobileStyles)
24522
24542
  };
24523
24543
  }
24524
- var DialogPrimitive, import_lodash_es10, import_lucide_react79, import_react85, import_jsx_runtime119, Dialog, DialogPortal, DialogOverlay, CONTENT_BG_SETUP, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription;
24544
+ var DialogPrimitive, import_lodash_es10, import_lucide_react79, import_react86, import_jsx_runtime119, Dialog, DialogPortal, DialogOverlay, CONTENT_BG_SETUP, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription;
24525
24545
  var init_dialog = __esm({
24526
24546
  "src/internal/components/ui/dialog.tsx"() {
24527
24547
  init_utils2();
@@ -24530,14 +24550,14 @@ var init_dialog = __esm({
24530
24550
  DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
24531
24551
  import_lodash_es10 = require("lodash-es");
24532
24552
  import_lucide_react79 = require("lucide-react");
24533
- import_react85 = require("react");
24553
+ import_react86 = require("react");
24534
24554
  init_useLayoutDataStore();
24535
24555
  init_useLayoutStore();
24536
24556
  init_button();
24537
24557
  import_jsx_runtime119 = require("react/jsx-runtime");
24538
24558
  Dialog = DialogPrimitive.Root;
24539
24559
  DialogPortal = DialogPrimitive.Portal;
24540
- DialogOverlay = (0, import_react85.forwardRef)(
24560
+ DialogOverlay = (0, import_react86.forwardRef)(
24541
24561
  ({ className, closing, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
24542
24562
  DialogPrimitive.Overlay,
24543
24563
  {
@@ -24559,7 +24579,7 @@ var init_dialog = __esm({
24559
24579
  border: "1px solid var(--ui-kit-bd)",
24560
24580
  boxShadow: "var(--ui-kit-shadow, 0px 4px 10px var(--ui-kit-shadow-c, rgba(0, 0, 0, 0.1)))"
24561
24581
  };
24562
- DialogContent = (0, import_react85.forwardRef)(
24582
+ DialogContent = (0, import_react86.forwardRef)(
24563
24583
  ({ className, children, colorMode, ...props }, ref) => {
24564
24584
  const { t, i18n } = useT();
24565
24585
  const isSessionLoading = useSession((st) => st.isLoading);
@@ -24662,7 +24682,7 @@ var init_dialog = __esm({
24662
24682
  DialogHeader.displayName = "DialogHeader";
24663
24683
  DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
24664
24684
  DialogFooter.displayName = "DialogFooter";
24665
- DialogTitle = (0, import_react85.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
24685
+ DialogTitle = (0, import_react86.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
24666
24686
  DialogPrimitive.Title,
24667
24687
  {
24668
24688
  ref,
@@ -24671,7 +24691,7 @@ var init_dialog = __esm({
24671
24691
  }
24672
24692
  ));
24673
24693
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
24674
- DialogDescription = (0, import_react85.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(DialogPrimitive.Description, { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
24694
+ DialogDescription = (0, import_react86.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(DialogPrimitive.Description, { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
24675
24695
  DialogDescription.displayName = DialogPrimitive.Description.displayName;
24676
24696
  }
24677
24697
  });
@@ -24696,7 +24716,7 @@ function Dialog2() {
24696
24716
  const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
24697
24717
  const setPage = useLayoutDataStore((st) => st.setPage);
24698
24718
  const { colorMode, isDialogOpen, dialogTitle, dialogDescription, dialogContent, isDialogForced, setIsSettings } = useLayoutStore();
24699
- (0, import_react86.useEffect)(() => setIsSettings(!!session), [session, setIsSettings]);
24719
+ (0, import_react87.useEffect)(() => setIsSettings(!!session), [session, setIsSettings]);
24700
24720
  usePageMapper();
24701
24721
  useAutoConnect();
24702
24722
  useBackupStatusChanges();
@@ -24734,13 +24754,13 @@ function Dialog2() {
24734
24754
  }
24735
24755
  );
24736
24756
  }
24737
- var import_framer_motion, import_react86, import_jsx_runtime121;
24757
+ var import_framer_motion, import_react87, import_jsx_runtime121;
24738
24758
  var init_Dialog = __esm({
24739
24759
  "src/internal/components/Dialog/Dialog.tsx"() {
24740
24760
  init_ProviderContext();
24741
24761
  init_SessionContext();
24742
24762
  import_framer_motion = require("framer-motion");
24743
- import_react86 = require("react");
24763
+ import_react87 = require("react");
24744
24764
  init_constants();
24745
24765
  init_useAutoConnect();
24746
24766
  init_useBackupStatusChanges();
@@ -24766,14 +24786,14 @@ var init_Dialog2 = __esm({
24766
24786
  });
24767
24787
 
24768
24788
  // src/internal/components/TssManager.tsx
24769
- var import_react87, TssManagerWithRef;
24789
+ var import_react88, TssManagerWithRef;
24770
24790
  var init_TssManager = __esm({
24771
24791
  "src/internal/components/TssManager.tsx"() {
24772
24792
  init_SessionContext();
24773
- import_react87 = __toESM(require("react"), 1);
24793
+ import_react88 = __toESM(require("react"), 1);
24774
24794
  init_auth();
24775
24795
  init_clients();
24776
- TssManagerWithRef = import_react87.default.forwardRef((props, ref) => {
24796
+ TssManagerWithRef = import_react88.default.forwardRef((props, ref) => {
24777
24797
  const { mpcPin } = props;
24778
24798
  const usePaymaster = useSession((st) => st.usePaymaster);
24779
24799
  const publicClient = useSession((st) => st.publicClient);
@@ -24781,14 +24801,14 @@ var init_TssManager = __esm({
24781
24801
  const setStatus = useSession((st) => st.setStatus);
24782
24802
  const setSession = useSession((st) => st.setSession);
24783
24803
  const setAddress = useSession((st) => st.setAddress);
24784
- const onSessionCreated = (0, import_react87.useCallback)(
24804
+ const onSessionCreated = (0, import_react88.useCallback)(
24785
24805
  (session, address) => {
24786
24806
  setSession(session);
24787
24807
  setAddress(address);
24788
24808
  },
24789
24809
  [setSession, setAddress]
24790
24810
  );
24791
- const createSessionWithKeyshare = import_react87.default.useCallback(
24811
+ const createSessionWithKeyshare = import_react88.default.useCallback(
24792
24812
  async (userId, hasServerKeyshare, isNewUser) => {
24793
24813
  setStatus("checking key management setup...");
24794
24814
  await ensureKeyshare(userId, hasServerKeyshare, setStatus, isNewUser);
@@ -24813,7 +24833,7 @@ var init_TssManager = __esm({
24813
24833
  },
24814
24834
  [setStatus, usePaymaster, activeChainId, publicClient, mpcPin]
24815
24835
  );
24816
- import_react87.default.useImperativeHandle(ref, () => ({ createSessionWithKeyshare }), [createSessionWithKeyshare]);
24836
+ import_react88.default.useImperativeHandle(ref, () => ({ createSessionWithKeyshare }), [createSessionWithKeyshare]);
24817
24837
  return null;
24818
24838
  });
24819
24839
  }
@@ -24821,7 +24841,7 @@ var init_TssManager = __esm({
24821
24841
 
24822
24842
  // src/internal/components/WalletConnectHandler.tsx
24823
24843
  function WalletConnectHandler() {
24824
- const qc = (0, import_react_query54.useQueryClient)();
24844
+ const qc = (0, import_react_query55.useQueryClient)();
24825
24845
  const { callbacksRef } = useProviderConfig();
24826
24846
  const passportWalletAddress = useSession((st) => st.address);
24827
24847
  const { address: walletAddress, isConnected, chain, connector } = (0, import_wagmi8.useAccount)();
@@ -24841,7 +24861,7 @@ function WalletConnectHandler() {
24841
24861
  const projectId = providerConfig?.projectId;
24842
24862
  const setExternalWallet = useExternalWalletStore((st) => st.setExternalWallet);
24843
24863
  const setPendingWalletLogin = useLayoutDataStore((st) => st.setPendingWalletLogin);
24844
- const onLinkingComplete = (0, import_react88.useCallback)(
24864
+ const onLinkingComplete = (0, import_react89.useCallback)(
24845
24865
  async (success) => {
24846
24866
  setIsWalletLinking(false);
24847
24867
  if (!success && !passportWalletAddress) {
@@ -24870,10 +24890,10 @@ function WalletConnectHandler() {
24870
24890
  },
24871
24891
  [qc, passportWalletAddress, setProviderType, setPage, setIsWalletLinking]
24872
24892
  );
24873
- const [hasStartedLinking, setHasStartedLinking] = import_react88.default.useState(false);
24874
- const [modalWasOpened, setModalWasOpened] = import_react88.default.useState(false);
24875
- const [pendingModalOpen, setPendingModalOpen] = import_react88.default.useState(false);
24876
- (0, import_react88.useEffect)(() => {
24893
+ const [hasStartedLinking, setHasStartedLinking] = import_react89.default.useState(false);
24894
+ const [modalWasOpened, setModalWasOpened] = import_react89.default.useState(false);
24895
+ const [pendingModalOpen, setPendingModalOpen] = import_react89.default.useState(false);
24896
+ (0, import_react89.useEffect)(() => {
24877
24897
  if (isWalletLinking && !hasStartedLinking) {
24878
24898
  console.log("[WalletConnectHandler] Starting wallet link flow:", {
24879
24899
  isConnected,
@@ -24911,18 +24931,18 @@ function WalletConnectHandler() {
24911
24931
  setProviderType,
24912
24932
  walletMode
24913
24933
  ]);
24914
- (0, import_react88.useEffect)(() => {
24934
+ (0, import_react89.useEffect)(() => {
24915
24935
  if (pendingModalOpen && !isConnected && openConnectModal) {
24916
24936
  setPendingModalOpen(false);
24917
24937
  openConnectModal();
24918
24938
  }
24919
24939
  }, [pendingModalOpen, isConnected, openConnectModal]);
24920
- (0, import_react88.useEffect)(() => {
24940
+ (0, import_react89.useEffect)(() => {
24921
24941
  if (connectModalOpen && hasStartedLinking) {
24922
24942
  setModalWasOpened(true);
24923
24943
  }
24924
24944
  }, [connectModalOpen, hasStartedLinking]);
24925
- (0, import_react88.useEffect)(() => {
24945
+ (0, import_react89.useEffect)(() => {
24926
24946
  if (modalWasOpened && !connectModalOpen && !isConnected && isWalletLinking) {
24927
24947
  console.log("[WalletConnectHandler] Modal closed without connecting");
24928
24948
  onLinkingComplete(false);
@@ -24930,7 +24950,7 @@ function WalletConnectHandler() {
24930
24950
  setModalWasOpened(false);
24931
24951
  }
24932
24952
  }, [connectModalOpen, modalWasOpened, isConnected, isWalletLinking]);
24933
- (0, import_react88.useEffect)(() => {
24953
+ (0, import_react89.useEffect)(() => {
24934
24954
  if (isWalletLinking) {
24935
24955
  const timeout = setTimeout(() => {
24936
24956
  console.warn("[WalletConnectHandler] Wallet linking timed out, resetting state");
@@ -24949,7 +24969,7 @@ function WalletConnectHandler() {
24949
24969
  }
24950
24970
  }, [isWalletLinking, setIsWalletLinking, disconnect]);
24951
24971
  const isAuthFlow = !passportWalletAddress;
24952
- const { mutate: handleWalletSign, isPending: isWalletSigning } = (0, import_react_query54.useMutation)({
24972
+ const { mutate: handleWalletSign, isPending: isWalletSigning } = (0, import_react_query55.useMutation)({
24953
24973
  mutationFn: async (payload) => {
24954
24974
  const { chainId, signingWalletAddress } = payload;
24955
24975
  if (!signingWalletAddress || !chainId) {
@@ -25050,7 +25070,7 @@ function WalletConnectHandler() {
25050
25070
  setPage(passportWalletAddress ? "manage-wallet" /* MANAGE_WALLET */ : "auth" /* AUTH */);
25051
25071
  }
25052
25072
  });
25053
- (0, import_react88.useEffect)(() => {
25073
+ (0, import_react89.useEffect)(() => {
25054
25074
  if (!!chain?.id && isConnected && walletAddress && isWalletLinking && hasStartedLinking && modalWasOpened && !pendingModalOpen) {
25055
25075
  console.log("[WalletConnectHandler] handleWalletSign triggered");
25056
25076
  if (!passportWalletAddress) {
@@ -25060,7 +25080,7 @@ function WalletConnectHandler() {
25060
25080
  handleWalletSign({ chainId: chain.id, signingWalletAddress: walletAddress });
25061
25081
  }
25062
25082
  }, [chain, isConnected, walletAddress, isWalletLinking, hasStartedLinking, modalWasOpened, pendingModalOpen]);
25063
- (0, import_react88.useEffect)(() => {
25083
+ (0, import_react89.useEffect)(() => {
25064
25084
  if (isConnected && !chain?.id && isWalletLinking && hasStartedLinking && !connectModalOpen && !isWalletSigning) {
25065
25085
  const timeout = setTimeout(() => {
25066
25086
  console.warn("[WalletConnectHandler] Wallet connected but chain info missing, resetting");
@@ -25082,15 +25102,15 @@ function WalletConnectHandler() {
25082
25102
  ]);
25083
25103
  return null;
25084
25104
  }
25085
- var import_rainbowkit2, import_react_query54, import_react88, import_wagmi8;
25105
+ var import_rainbowkit2, import_react_query55, import_react89, import_wagmi8;
25086
25106
  var init_WalletConnectHandler = __esm({
25087
25107
  "src/internal/components/WalletConnectHandler.tsx"() {
25088
25108
  init_ProviderContext();
25089
25109
  init_SessionContext();
25090
25110
  init_linkedProfiles();
25091
25111
  import_rainbowkit2 = require("@rainbow-me/rainbowkit");
25092
- import_react_query54 = require("@tanstack/react-query");
25093
- import_react88 = __toESM(require("react"), 1);
25112
+ import_react_query55 = require("@tanstack/react-query");
25113
+ import_react89 = __toESM(require("react"), 1);
25094
25114
  import_wagmi8 = require("wagmi");
25095
25115
  init_wallet();
25096
25116
  init_AuthMenu2();
@@ -25111,13 +25131,13 @@ function DirectWalletHandler() {
25111
25131
  const setExternalChainId = useExternalWalletStore((st) => st.setExternalChainId);
25112
25132
  const setConfigMode = useExternalWalletStore((st) => st.setConfigMode);
25113
25133
  const setActiveMode = useExternalWalletStore((st) => st.setActiveMode);
25114
- (0, import_react89.useEffect)(() => {
25134
+ (0, import_react90.useEffect)(() => {
25115
25135
  setConfigMode(walletMode);
25116
25136
  if (walletMode !== "both") {
25117
25137
  setActiveMode(walletMode);
25118
25138
  }
25119
25139
  }, [walletMode, setConfigMode, setActiveMode]);
25120
- (0, import_react89.useEffect)(() => {
25140
+ (0, import_react90.useEffect)(() => {
25121
25141
  if (isConnected && address && !isExternalConnected && connector && chain?.id) {
25122
25142
  setExternalWallet({
25123
25143
  address,
@@ -25126,17 +25146,17 @@ function DirectWalletHandler() {
25126
25146
  });
25127
25147
  }
25128
25148
  }, [isConnected, address, isExternalConnected, connector, chain?.id, setExternalWallet]);
25129
- (0, import_react89.useEffect)(() => {
25149
+ (0, import_react90.useEffect)(() => {
25130
25150
  if (isExternalConnected && !isConnected) {
25131
25151
  clearExternalWallet();
25132
25152
  }
25133
25153
  }, [isConnected, isExternalConnected, clearExternalWallet]);
25134
- (0, import_react89.useEffect)(() => {
25154
+ (0, import_react90.useEffect)(() => {
25135
25155
  if (isExternalConnected && isConnected && chain?.id) {
25136
25156
  setExternalChainId(chain.id);
25137
25157
  }
25138
25158
  }, [chain?.id, isConnected, isExternalConnected, setExternalChainId]);
25139
- (0, import_react89.useEffect)(() => {
25159
+ (0, import_react90.useEffect)(() => {
25140
25160
  if (isExternalConnected && isConnected && address && address !== externalAddress && connector && chain?.id) {
25141
25161
  setExternalWallet({
25142
25162
  address,
@@ -25147,10 +25167,10 @@ function DirectWalletHandler() {
25147
25167
  }, [address, isConnected, isExternalConnected, externalAddress, chain?.id, connector, setExternalWallet]);
25148
25168
  return null;
25149
25169
  }
25150
- var import_react89, import_wagmi9;
25170
+ var import_react90, import_wagmi9;
25151
25171
  var init_DirectWalletHandler = __esm({
25152
25172
  "src/internal/components/DirectWalletHandler.tsx"() {
25153
- import_react89 = require("react");
25173
+ import_react90 = require("react");
25154
25174
  import_wagmi9 = require("wagmi");
25155
25175
  init_ProviderContext();
25156
25176
  init_useExternalWalletStore();
@@ -25175,7 +25195,7 @@ function waitForStoreHydration() {
25175
25195
  }
25176
25196
  function SessionProvider({ children }) {
25177
25197
  const config = useProviderConfig().config;
25178
- return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_react90.Fragment, { children: [
25198
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_react91.Fragment, { children: [
25179
25199
  children,
25180
25200
  config.current?.wallet?.enabled && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(WalletConnectHandler, {}),
25181
25201
  config.current?.wallet?.enabled && (config.current?.wallet?.mode === "direct" || config.current?.wallet?.mode === "both") && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(DirectWalletHandler, {}),
@@ -25190,11 +25210,11 @@ function SessionProvider({ children }) {
25190
25210
  /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Dialog2, {})
25191
25211
  ] });
25192
25212
  }
25193
- var import_read21, import_react90, import_zustand13, import_middleware4, import_jsx_runtime122, useSession, requireActiveChainId;
25213
+ var import_read21, import_react91, import_zustand13, import_middleware4, import_jsx_runtime122, useSession, requireActiveChainId;
25194
25214
  var init_SessionContext = __esm({
25195
25215
  "src/context/SessionContext.tsx"() {
25196
25216
  import_read21 = require("@embarkai/core/read");
25197
- import_react90 = require("react");
25217
+ import_react91 = require("react");
25198
25218
  import_zustand13 = require("zustand");
25199
25219
  import_middleware4 = require("zustand/middleware");
25200
25220
  init_BalanceFeedProvider2();
@@ -27863,7 +27883,7 @@ var init_rainbowkit = __esm({
27863
27883
  function RainbowKitProvider({ children }) {
27864
27884
  const config = useProviderConfig().config;
27865
27885
  const colorMode = useLayoutStore((st) => st.colorMode);
27866
- const rainbowConfig = (0, import_react91.useMemo)(
27886
+ const rainbowConfig = (0, import_react92.useMemo)(
27867
27887
  () => createRainbowConfig({
27868
27888
  projectId: config.current?.wallet?.walletConnectProjectId,
27869
27889
  allowedWallets: config.current?.wallet?.allowedWallets,
@@ -27877,7 +27897,7 @@ function RainbowKitProvider({ children }) {
27877
27897
  config.current?.wallet?.walletConnectProjectId
27878
27898
  ]
27879
27899
  );
27880
- const customTheme = (0, import_react91.useMemo)(() => {
27900
+ const customTheme = (0, import_react92.useMemo)(() => {
27881
27901
  if (!config.current?.wallet?.enabled) return {};
27882
27902
  return colorMode === "dark" ? {
27883
27903
  ...(0, import_rainbowkit4.darkTheme)(),
@@ -27894,11 +27914,11 @@ function RainbowKitProvider({ children }) {
27894
27914
  if (!config.current?.wallet?.enabled) return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_jsx_runtime123.Fragment, { children });
27895
27915
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_wagmi11.WagmiProvider, { config: rainbowConfig, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_rainbowkit4.RainbowKitProvider, { theme: customTheme, modalSize: "compact", showRecentTransactions: true, children }) });
27896
27916
  }
27897
- var import_rainbowkit4, import_react91, import_wagmi11, import_styles, import_jsx_runtime123;
27917
+ var import_rainbowkit4, import_react92, import_wagmi11, import_styles, import_jsx_runtime123;
27898
27918
  var init_RainbowKitContext = __esm({
27899
27919
  "src/context/RainbowKitContext.tsx"() {
27900
27920
  import_rainbowkit4 = require("@rainbow-me/rainbowkit");
27901
- import_react91 = require("react");
27921
+ import_react92 = require("react");
27902
27922
  import_wagmi11 = require("wagmi");
27903
27923
  init_rainbowkit();
27904
27924
  init_useLayoutStore();
@@ -27954,10 +27974,10 @@ function clearLegacyWagmiStorage() {
27954
27974
  }
27955
27975
  function Provider(props) {
27956
27976
  const { children, projectId, initialConfig = {}, callbacks } = props;
27957
- const callbacksRef = (0, import_react92.useRef)(callbacks);
27958
- (0, import_react92.useEffect)(() => notifyNoProjetctId(projectId), [projectId]);
27959
- const config = (0, import_react92.useRef)((0, import_lodash_es11.merge)({}, DEFAULT_PROVIDER_CONFIG, { projectId }, initialConfig));
27960
- const updateConfig = (0, import_react92.useCallback)((updates) => {
27977
+ const callbacksRef = (0, import_react93.useRef)(callbacks);
27978
+ (0, import_react93.useEffect)(() => notifyNoProjetctId(projectId), [projectId]);
27979
+ const config = (0, import_react93.useRef)((0, import_lodash_es11.merge)({}, DEFAULT_PROVIDER_CONFIG, { projectId }, initialConfig));
27980
+ const updateConfig = (0, import_react93.useCallback)((updates) => {
27961
27981
  const prev = config.current;
27962
27982
  const next = { ...prev };
27963
27983
  if (updates.projectId !== void 0) next.projectId = updates.projectId;
@@ -27991,12 +28011,12 @@ function Provider(props) {
27991
28011
  if (updates.translations) next.translations = { ...next.translations, ...updates.translations };
27992
28012
  config.current = next;
27993
28013
  }, []);
27994
- const updateCallbacks = (0, import_react92.useCallback)((updates) => {
28014
+ const updateCallbacks = (0, import_react93.useCallback)((updates) => {
27995
28015
  const prev = callbacksRef.current;
27996
28016
  const next = updates ? { ...prev, ...updates } : void 0;
27997
28017
  callbacksRef.current = next;
27998
28018
  }, []);
27999
- (0, import_react92.useEffect)(() => {
28019
+ (0, import_react93.useEffect)(() => {
28000
28020
  if (typeof window === "undefined" || !projectId) return;
28001
28021
  const mergedConfig = (0, import_lodash_es11.merge)(DEFAULT_PROVIDER_CONFIG, initialConfig);
28002
28022
  updateConfig(mergedConfig);
@@ -28016,7 +28036,7 @@ function Provider(props) {
28016
28036
  useSession.getState().setActiveChainId(mergedConfig.network.chainId);
28017
28037
  }
28018
28038
  }, [projectId, initialConfig]);
28019
- (0, import_react92.useEffect)(() => {
28039
+ (0, import_react93.useEffect)(() => {
28020
28040
  if (typeof window === "undefined" || !projectId) return;
28021
28041
  try {
28022
28042
  (0, import_error_tracking4.initSdkErrorTracking)();
@@ -28045,7 +28065,7 @@ function Provider(props) {
28045
28065
  console.error("[PROVIDER] Error setting up iframe manager:", error);
28046
28066
  }
28047
28067
  }, [projectId]);
28048
- const contextValue = (0, import_react92.useMemo)(
28068
+ const contextValue = (0, import_react93.useMemo)(
28049
28069
  () => ({
28050
28070
  config,
28051
28071
  updateConfig,
@@ -28066,12 +28086,12 @@ function Provider(props) {
28066
28086
  /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(WagmiProvider2, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(UIContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(SessionProvider, { children }) }) })
28067
28087
  );
28068
28088
  }
28069
- var import_error_tracking4, import_lodash_es11, import_react92, import_jsx_runtime125, UIContext, useProviderConfig;
28089
+ var import_error_tracking4, import_lodash_es11, import_react93, import_jsx_runtime125, UIContext, useProviderConfig;
28070
28090
  var init_ProviderContext = __esm({
28071
28091
  "src/context/ProviderContext.tsx"() {
28072
28092
  import_error_tracking4 = require("@embarkai/core/internal/error-tracking");
28073
28093
  import_lodash_es11 = require("lodash-es");
28074
- import_react92 = require("react");
28094
+ import_react93 = require("react");
28075
28095
  init_initial();
28076
28096
  init_iframe_manager();
28077
28097
  init_RainbowKitContext();
@@ -28079,9 +28099,9 @@ var init_ProviderContext = __esm({
28079
28099
  init_utils11();
28080
28100
  init_WagmiContext();
28081
28101
  import_jsx_runtime125 = require("react/jsx-runtime");
28082
- UIContext = (0, import_react92.createContext)(void 0);
28102
+ UIContext = (0, import_react93.createContext)(void 0);
28083
28103
  useProviderConfig = () => {
28084
- const ctx = (0, import_react92.useContext)(UIContext);
28104
+ const ctx = (0, import_react93.useContext)(UIContext);
28085
28105
  if (!ctx) throw new Error("useProviderConfig must be used within a Provider");
28086
28106
  return ctx;
28087
28107
  };
@@ -28111,6 +28131,7 @@ __export(index_exports, {
28111
28131
  UserOperationTimeoutError: () => UserOperationTimeoutError,
28112
28132
  UserRejectedError: () => UserRejectedError,
28113
28133
  WALLET_ICONS: () => WALLET_ICONS,
28134
+ WRAPPED_TOKENS: () => WRAPPED_TOKENS,
28114
28135
  combineI18NResources: () => combineI18NResources,
28115
28136
  createAccountAbstractionError: () => createAccountAbstractionError,
28116
28137
  deployAccount: () => deployAccount,
@@ -28189,9 +28210,9 @@ init_ProviderContext();
28189
28210
  // src/components/ConnectWalletButton.tsx
28190
28211
  init_lumia2();
28191
28212
  init_embarkAI2();
28192
- var import_react_query55 = require("@tanstack/react-query");
28213
+ var import_react_query56 = require("@tanstack/react-query");
28193
28214
  var import_lucide_react80 = require("lucide-react");
28194
- var import_react93 = require("react");
28215
+ var import_react94 = require("react");
28195
28216
  init_SessionContext();
28196
28217
  init_auth();
28197
28218
  init_profile();
@@ -28224,15 +28245,15 @@ function ConnectWalletButton(props) {
28224
28245
  const colorMode = useLayoutStore((st) => st.colorMode);
28225
28246
  const { session, address, hasServerVault, isLoading, isIframeReady, status, setUsePaymaster } = useSession();
28226
28247
  const connectButtonLabel = getFormattedStatus(label || "Connect", status, isIframeReady);
28227
- (0, import_react93.useEffect)(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
28228
- const { data: profile, isLoading: isProfileLoading } = (0, import_react_query55.useQuery)({
28248
+ (0, import_react94.useEffect)(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
28249
+ const { data: profile, isLoading: isProfileLoading } = (0, import_react_query56.useQuery)({
28229
28250
  retry: false,
28230
28251
  enabled: !!address,
28231
28252
  queryKey: [QUERY_KEYS.userProfile, address],
28232
28253
  queryFn: getUserProfile
28233
28254
  });
28234
28255
  const displayName = profile?.nicknameDisplay || profile?.displayName || import_auth23.jwtTokenManager.getDisplayName();
28235
- const indicators = (0, import_react93.useMemo)(() => {
28256
+ const indicators = (0, import_react94.useMemo)(() => {
28236
28257
  const userId = session?.mpcUserId;
28237
28258
  if (!userId) return { server: false, local: false, backup: false };
28238
28259
  const server = import_auth23.jwtTokenManager.getHasKeyshare() ?? false;
@@ -28414,7 +28435,7 @@ var useActiveChainId = () => useSession((st) => st.activeChainId);
28414
28435
  var useHydrated = () => useSession((st) => st.hasHydrated);
28415
28436
 
28416
28437
  // src/hooks/useOpenPage.ts
28417
- var import_react94 = require("react");
28438
+ var import_react95 = require("react");
28418
28439
  init_SessionContext();
28419
28440
  init_useLayoutDataStore();
28420
28441
  function useOpenPage() {
@@ -28422,7 +28443,7 @@ function useOpenPage() {
28422
28443
  const setPage = useLayoutDataStore((st) => st.setPage);
28423
28444
  const setPageParams = useLayoutDataStore((st) => st.setPageParams);
28424
28445
  const address = useSession((st) => st.address);
28425
- const open = (0, import_react94.useCallback)(
28446
+ const open = (0, import_react95.useCallback)(
28426
28447
  (passportPage, params) => {
28427
28448
  if (!address) return setPage("auth" /* AUTH */);
28428
28449
  if (!!address && passportPage === "auth" /* AUTH */) return setPage("manage-wallet" /* MANAGE_WALLET */);
@@ -28431,7 +28452,7 @@ function useOpenPage() {
28431
28452
  },
28432
28453
  [setPage, setPageParams, address]
28433
28454
  );
28434
- const close = (0, import_react94.useCallback)(() => setPage(null), [setPage]);
28455
+ const close = (0, import_react95.useCallback)(() => setPage(null), [setPage]);
28435
28456
  return { open, close, isOpen: page !== null };
28436
28457
  }
28437
28458
 
@@ -28892,14 +28913,14 @@ var Hash = ({
28892
28913
  };
28893
28914
 
28894
28915
  // src/internal/components/TransactionsMenu/TransactionsList.tsx
28895
- var import_react95 = require("react");
28916
+ var import_react96 = require("react");
28896
28917
  init_base2();
28897
28918
  var import_jsx_runtime132 = require("react/jsx-runtime");
28898
28919
  var TransactionsList = ({ address, itemsCount = 10 }) => {
28899
- const [transactions, setTransactions] = (0, import_react95.useState)([]);
28900
- const [loading, setLoading] = (0, import_react95.useState)(true);
28901
- const [error, setError] = (0, import_react95.useState)(null);
28902
- (0, import_react95.useEffect)(() => {
28920
+ const [transactions, setTransactions] = (0, import_react96.useState)([]);
28921
+ const [loading, setLoading] = (0, import_react96.useState)(true);
28922
+ const [error, setError] = (0, import_react96.useState)(null);
28923
+ (0, import_react96.useEffect)(() => {
28903
28924
  const fetchTransactions2 = async () => {
28904
28925
  try {
28905
28926
  setLoading(true);
@@ -29190,13 +29211,13 @@ function useUserOpStatus(options = {}) {
29190
29211
  init_useErc3643Compliance();
29191
29212
 
29192
29213
  // src/hooks/useWalletMode.ts
29193
- var import_react96 = require("react");
29214
+ var import_react97 = require("react");
29194
29215
  init_useExternalWalletStore();
29195
29216
  function useWalletMode() {
29196
29217
  const configMode = useExternalWalletStore((st) => st.configMode);
29197
29218
  const activeMode = useExternalWalletStore((st) => st.activeMode);
29198
29219
  const setActiveMode = useExternalWalletStore((st) => st.setActiveMode);
29199
- const switchMode = (0, import_react96.useCallback)(
29220
+ const switchMode = (0, import_react97.useCallback)(
29200
29221
  (mode) => {
29201
29222
  if (configMode !== "both") return;
29202
29223
  setActiveMode(mode);
@@ -29212,7 +29233,7 @@ function useWalletMode() {
29212
29233
  }
29213
29234
 
29214
29235
  // src/hooks/useDirectWallet.ts
29215
- var import_react97 = require("react");
29236
+ var import_react98 = require("react");
29216
29237
  var import_rainbowkit6 = require("@rainbow-me/rainbowkit");
29217
29238
  var import_wagmi13 = require("wagmi");
29218
29239
  init_useExternalWalletStore();
@@ -29226,13 +29247,13 @@ function useDirectWallet() {
29226
29247
  const { disconnect: wagmiDisconnect } = (0, import_wagmi13.useDisconnect)();
29227
29248
  const { openConnectModal } = (0, import_rainbowkit6.useConnectModal)();
29228
29249
  const setIsWalletLinking = useLayoutDataStore((st) => st.setIsWalletLinking);
29229
- const connect = (0, import_react97.useCallback)(() => {
29250
+ const connect = (0, import_react98.useCallback)(() => {
29230
29251
  setIsWalletLinking(true);
29231
29252
  }, [setIsWalletLinking]);
29232
- const reconnect = (0, import_react97.useCallback)(() => {
29253
+ const reconnect = (0, import_react98.useCallback)(() => {
29233
29254
  if (openConnectModal) openConnectModal();
29234
29255
  }, [openConnectModal]);
29235
- const disconnect = (0, import_react97.useCallback)(() => {
29256
+ const disconnect = (0, import_react98.useCallback)(() => {
29236
29257
  wagmiDisconnect();
29237
29258
  clearExternalWallet();
29238
29259
  }, [wagmiDisconnect, clearExternalWallet]);
@@ -29248,7 +29269,7 @@ function useDirectWallet() {
29248
29269
  }
29249
29270
 
29250
29271
  // src/hooks/useSendDirectTransaction.ts
29251
- var import_react98 = require("react");
29272
+ var import_react99 = require("react");
29252
29273
  var import_viem20 = require("viem");
29253
29274
  var import_wagmi14 = require("wagmi");
29254
29275
  init_useExternalWalletStore();
@@ -29257,10 +29278,10 @@ function useSendDirectTransaction() {
29257
29278
  const externalChainId = useExternalWalletStore((st) => st.externalChainId);
29258
29279
  const { sendTransactionAsync } = (0, import_wagmi14.useSendTransaction)();
29259
29280
  const { switchChainAsync } = (0, import_wagmi14.useSwitchChain)();
29260
- const [isPending, setIsPending] = (0, import_react98.useState)(false);
29261
- const [error, setError] = (0, import_react98.useState)(null);
29262
- const [txHash, setTxHash] = (0, import_react98.useState)(null);
29263
- const sendTransaction = (0, import_react98.useCallback)(
29281
+ const [isPending, setIsPending] = (0, import_react99.useState)(false);
29282
+ const [error, setError] = (0, import_react99.useState)(null);
29283
+ const [txHash, setTxHash] = (0, import_react99.useState)(null);
29284
+ const sendTransaction = (0, import_react99.useCallback)(
29264
29285
  async (params) => {
29265
29286
  if (!isConnected) {
29266
29287
  setError("No external wallet connected");
@@ -29294,7 +29315,7 @@ function useSendDirectTransaction() {
29294
29315
  },
29295
29316
  [isConnected, externalChainId, sendTransactionAsync, switchChainAsync]
29296
29317
  );
29297
- const reset = (0, import_react98.useCallback)(() => {
29318
+ const reset = (0, import_react99.useCallback)(() => {
29298
29319
  setError(null);
29299
29320
  setTxHash(null);
29300
29321
  setIsPending(false);
@@ -29303,7 +29324,7 @@ function useSendDirectTransaction() {
29303
29324
  }
29304
29325
 
29305
29326
  // src/hooks/useTransferToLinkedWallet.ts
29306
- var import_react99 = require("react");
29327
+ var import_react100 = require("react");
29307
29328
  var import_viem21 = require("viem");
29308
29329
  init_SessionContext();
29309
29330
  init_account2();
@@ -29322,14 +29343,14 @@ var ERC20_TRANSFER_ABI2 = [
29322
29343
  function useTransferToLinkedWallet() {
29323
29344
  const session = useSession((st) => st.session);
29324
29345
  const { profiles } = useLinkedProfiles();
29325
- const [isPending, setIsPending] = (0, import_react99.useState)(false);
29326
- const [error, setError] = (0, import_react99.useState)(null);
29327
- const [userOpHash, setUserOpHash] = (0, import_react99.useState)(null);
29328
- const linkedWallets = (0, import_react99.useMemo)(
29346
+ const [isPending, setIsPending] = (0, import_react100.useState)(false);
29347
+ const [error, setError] = (0, import_react100.useState)(null);
29348
+ const [userOpHash, setUserOpHash] = (0, import_react100.useState)(null);
29349
+ const linkedWallets = (0, import_react100.useMemo)(
29329
29350
  () => (profiles || []).filter((p) => p.provider === "wallet" && p.externalId).map((p) => p.externalId),
29330
29351
  [profiles]
29331
29352
  );
29332
- const transfer = (0, import_react99.useCallback)(
29353
+ const transfer = (0, import_react100.useCallback)(
29333
29354
  async (params) => {
29334
29355
  if (!session) {
29335
29356
  setError("No active session");
@@ -29380,7 +29401,7 @@ function useTransferToLinkedWallet() {
29380
29401
  },
29381
29402
  [session, linkedWallets]
29382
29403
  );
29383
- const reset = (0, import_react99.useCallback)(() => {
29404
+ const reset = (0, import_react100.useCallback)(() => {
29384
29405
  setError(null);
29385
29406
  setUserOpHash(null);
29386
29407
  setIsPending(false);
@@ -29404,7 +29425,7 @@ function useNativeWalletSignature() {
29404
29425
 
29405
29426
  // src/hooks/useLogout.ts
29406
29427
  var import_auth25 = require("@embarkai/core/auth");
29407
- var import_react100 = require("react");
29428
+ var import_react101 = require("react");
29408
29429
  var import_wagmi16 = require("wagmi");
29409
29430
  init_ProviderContext();
29410
29431
  init_SessionContext();
@@ -29424,7 +29445,7 @@ function useLogout() {
29424
29445
  }
29425
29446
  }
29426
29447
  });
29427
- const logout2 = (0, import_react100.useCallback)(async () => {
29448
+ const logout2 = (0, import_react101.useCallback)(async () => {
29428
29449
  const { setSession, setIsLoading, setAddress, setStatus, setError } = useSession.getState();
29429
29450
  const prevAddress = address;
29430
29451
  let userId = null;
@@ -29542,7 +29563,7 @@ function useTransactions() {
29542
29563
 
29543
29564
  // src/modules/assets.ts
29544
29565
  init_SessionContext();
29545
- var import_react101 = __toESM(require("react"), 1);
29566
+ var import_react102 = __toESM(require("react"), 1);
29546
29567
  var import_viem23 = require("viem");
29547
29568
  var import_wagmi18 = require("wagmi");
29548
29569
  var COMMON_TOKENS = [
@@ -29698,7 +29719,7 @@ function useTokenBalance(tokenAddress, userAddress) {
29698
29719
  }
29699
29720
  });
29700
29721
  const { tokenInfo } = useTokenInfo(tokenAddress);
29701
- const formattedBalance = import_react101.default.useMemo(() => {
29722
+ const formattedBalance = import_react102.default.useMemo(() => {
29702
29723
  if (!balance || !tokenInfo) return "0";
29703
29724
  return (0, import_viem23.formatUnits)(balance, tokenInfo.decimals);
29704
29725
  }, [balance, tokenInfo]);
@@ -29768,6 +29789,7 @@ init_tokens();
29768
29789
  init_wallets();
29769
29790
 
29770
29791
  // src/index.ts
29792
+ init_constants();
29771
29793
  init_i18n();
29772
29794
 
29773
29795
  // src/internal/exportedQueryKeys.ts
@@ -29811,6 +29833,7 @@ autorun();
29811
29833
  UserOperationTimeoutError,
29812
29834
  UserRejectedError,
29813
29835
  WALLET_ICONS,
29836
+ WRAPPED_TOKENS,
29814
29837
  combineI18NResources,
29815
29838
  createAccountAbstractionError,
29816
29839
  deployAccount,