@embarkai/ui-kit 0.4.53 → 0.4.54

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.js CHANGED
@@ -2421,10 +2421,50 @@ var init_useAutoConnect = __esm({
2421
2421
  }
2422
2422
  });
2423
2423
 
2424
+ // src/hooks/useOpenPage.ts
2425
+ import { useCallback as useCallback3, useEffect as useEffect4, useRef as useRef3 } from "react";
2426
+ function useOpenPage() {
2427
+ const page = useLayoutDataStore((st) => st.page);
2428
+ const setPage = useLayoutDataStore((st) => st.setPage);
2429
+ const setPageParams = useLayoutDataStore((st) => st.setPageParams);
2430
+ const address = useSession((st) => st.address);
2431
+ const open = useCallback3(
2432
+ (passportPage, params) => {
2433
+ if (!address) return setPage("auth" /* AUTH */);
2434
+ if (!!address && passportPage === "auth" /* AUTH */) return setPage("manage-wallet" /* MANAGE_WALLET */);
2435
+ setPage(passportPage);
2436
+ if (!!params) setPageParams(params);
2437
+ },
2438
+ [setPage, setPageParams, address]
2439
+ );
2440
+ const close = useCallback3(() => {
2441
+ setPageParams(null);
2442
+ setPage(null);
2443
+ }, [setPage, setPageParams]);
2444
+ return { open, close, isOpen: page !== null };
2445
+ }
2446
+ function usePageParams() {
2447
+ const currentParams = useRef3({});
2448
+ useEffect4(() => {
2449
+ const { pageParams, setPageParams } = useLayoutDataStore.getState();
2450
+ if (!pageParams) return;
2451
+ currentParams.current = pageParams;
2452
+ setPageParams(null);
2453
+ }, []);
2454
+ return currentParams.current;
2455
+ }
2456
+ var init_useOpenPage = __esm({
2457
+ "src/hooks/useOpenPage.ts"() {
2458
+ init_SessionContext();
2459
+ init_useLayoutDataStore();
2460
+ }
2461
+ });
2462
+
2424
2463
  // src/internal/hooks/useBackupStatusChanges.ts
2425
2464
  import { useMutation as useMutation2 } from "@tanstack/react-query";
2426
- import { useEffect as useEffect4 } from "react";
2465
+ import { useEffect as useEffect5 } from "react";
2427
2466
  function useBackupStatusChanges() {
2467
+ const { open: openPage } = useOpenPage();
2428
2468
  const { mutate: handleBackupStatusChanged } = useMutation2({
2429
2469
  mutationFn: async (event) => {
2430
2470
  const customEvent = event;
@@ -2443,14 +2483,14 @@ function useBackupStatusChanges() {
2443
2483
  const isNewUserTouched = localStorage.getItem(NEW_USER_TOUCHED_KEY) === "true";
2444
2484
  if (!isNewUserTouched && !!jwt?.isNewUser) {
2445
2485
  localStorage.setItem(NEW_USER_TOUCHED_KEY, "true");
2446
- useLayoutDataStore.getState().setPage("nickname-settings" /* NICKNAME_SETTINGS */);
2486
+ openPage("nickname-settings" /* NICKNAME_SETTINGS */, { isInitialUser: true });
2447
2487
  }
2448
2488
  if (!!isNewUserTouched && !jwt?.isNewUser) {
2449
2489
  localStorage.removeItem(NEW_USER_TOUCHED_KEY);
2450
2490
  }
2451
2491
  } else {
2452
2492
  setHasServerVault(false);
2453
- useLayoutDataStore.getState().setPage("keysare-backup" /* KEYSARE_BACKUP */);
2493
+ openPage("keysare-backup" /* KEYSARE_BACKUP */);
2454
2494
  console.warn("[BACKUP STATUS] No recovery data found in vault, marking as no-server-vault");
2455
2495
  }
2456
2496
  },
@@ -2459,7 +2499,7 @@ function useBackupStatusChanges() {
2459
2499
  console.warn("[BACKUP STATUS] Failed to fetch initial vault status:", error);
2460
2500
  }
2461
2501
  });
2462
- useEffect4(() => {
2502
+ useEffect5(() => {
2463
2503
  window.addEventListener("lumia-passport-backup-status-changed", handleBackupStatusChanged);
2464
2504
  return () => {
2465
2505
  window.removeEventListener("lumia-passport-backup-status-changed", handleBackupStatusChanged);
@@ -2470,9 +2510,9 @@ var NEW_USER_TOUCHED_KEY;
2470
2510
  var init_useBackupStatusChanges = __esm({
2471
2511
  "src/internal/hooks/useBackupStatusChanges.ts"() {
2472
2512
  init_SessionContext();
2513
+ init_useOpenPage();
2473
2514
  init_auth();
2474
2515
  init_vaultClient();
2475
- init_useLayoutDataStore();
2476
2516
  NEW_USER_TOUCHED_KEY = "embarkai-is-new-user-touhced";
2477
2517
  }
2478
2518
  });
@@ -2512,12 +2552,12 @@ var init_useLayoutStore = __esm({
2512
2552
 
2513
2553
  // src/internal/hooks/useDetectMaxScrollHeight.ts
2514
2554
  import { debounce } from "lodash-es";
2515
- import { useCallback as useCallback3, useEffect as useEffect5 } from "react";
2555
+ import { useCallback as useCallback4, useEffect as useEffect6 } from "react";
2516
2556
  function useDetectMaxScrollHeight() {
2517
2557
  const page = useLayoutDataStore((state) => state.page);
2518
2558
  const setIsMobileView = useLayoutStore((state) => state.setIsMobileView);
2519
2559
  const setMaxScrollHeight = useLayoutStore((state) => state.setMaxScrollHeight);
2520
- const onResize = useCallback3(
2560
+ const onResize = useCallback4(
2521
2561
  debounce(({ width, height }) => {
2522
2562
  const headerHeight = page === "auth" /* AUTH */ || page === "keyshare-restore" /* KEYSHARE_RESTORE */ ? 0 : 116;
2523
2563
  const limContentHeight = height * 0.92 - headerHeight - 57;
@@ -2526,7 +2566,7 @@ function useDetectMaxScrollHeight() {
2526
2566
  }, DEBOUNCE_DELAY),
2527
2567
  [page, setMaxScrollHeight, setIsMobileView]
2528
2568
  );
2529
- useEffect5(() => {
2569
+ useEffect6(() => {
2530
2570
  const obs = new ResizeObserver(([entry]) => onResize(entry.contentRect));
2531
2571
  const doc = window.document.getElementsByTagName("html")[0];
2532
2572
  if (doc) obs.observe(doc);
@@ -2544,11 +2584,11 @@ var init_useDetectMaxScrollHeight = __esm({
2544
2584
  });
2545
2585
 
2546
2586
  // src/internal/hooks/useListenIframeAuthEvents.ts
2547
- import { useCallback as useCallback4, useEffect as useEffect6 } from "react";
2587
+ import { useCallback as useCallback5, useEffect as useEffect7 } from "react";
2548
2588
  function useListenIframeAuthEvents() {
2549
2589
  const setPage = useLayoutDataStore((state) => state.setPage);
2550
2590
  const setIsIframeReady = useSession((state) => state.setIsIframeReady);
2551
- const handleIframeMessage = useCallback4(
2591
+ const handleIframeMessage = useCallback5(
2552
2592
  (event) => {
2553
2593
  const type = event.data?.type?.startsWith?.("LUMIA_PASSPORT_") ? event.data.type.replace("LUMIA_PASSPORT_", "IFRAME_MSG_") : event.data?.type;
2554
2594
  if (type === "IFRAME_MSG_IFRAME_READY") {
@@ -2564,7 +2604,7 @@ function useListenIframeAuthEvents() {
2564
2604
  },
2565
2605
  [setPage, setIsIframeReady]
2566
2606
  );
2567
- useEffect6(() => {
2607
+ useEffect7(() => {
2568
2608
  window.addEventListener("message", handleIframeMessage);
2569
2609
  return () => window.removeEventListener("message", handleIframeMessage);
2570
2610
  }, [handleIframeMessage]);
@@ -5053,19 +5093,19 @@ var init_utils2 = __esm({
5053
5093
  });
5054
5094
 
5055
5095
  // src/internal/components/Expandable/hooks/useExpandable.ts
5056
- import { useCallback as useCallback5, useEffect as useEffect7, useRef as useRef3 } from "react";
5096
+ import { useCallback as useCallback6, useEffect as useEffect8, useRef as useRef4 } from "react";
5057
5097
  var useExpandable;
5058
5098
  var init_useExpandable = __esm({
5059
5099
  "src/internal/components/Expandable/hooks/useExpandable.ts"() {
5060
5100
  useExpandable = (props) => {
5061
5101
  const { isExpanded = false, children, initHeight = 0, minHeight = 0 } = props;
5062
- const expandableRef = useRef3(null);
5063
- const contentRef = useRef3(null);
5064
- useEffect7(() => {
5102
+ const expandableRef = useRef4(null);
5103
+ const contentRef = useRef4(null);
5104
+ useEffect8(() => {
5065
5105
  if (!expandableRef.current) return;
5066
5106
  expandableRef.current.style.setProperty("--ifo-basic-expandable-h", `${initHeight}px )`);
5067
5107
  }, []);
5068
- const setExpandableHeight = useCallback5(
5108
+ const setExpandableHeight = useCallback6(
5069
5109
  (isExpnd) => {
5070
5110
  if (!contentRef.current || !expandableRef.current) return;
5071
5111
  expandableRef.current.style.setProperty(
@@ -5076,7 +5116,7 @@ var init_useExpandable = __esm({
5076
5116
  // ON_RESIZE_DELEAY),
5077
5117
  [minHeight]
5078
5118
  );
5079
- useEffect7(() => {
5119
+ useEffect8(() => {
5080
5120
  if (!contentRef.current || !expandableRef.current) return;
5081
5121
  const obs = new ResizeObserver(() => setExpandableHeight(isExpanded));
5082
5122
  obs.observe(expandableRef.current);
@@ -5586,6 +5626,10 @@ var init_en = __esm({
5586
5626
  checkingAvailability: "Checking availability...",
5587
5627
  nicknameAvailable: "Nickname is available",
5588
5628
  nicknameNotAvailable: "This nickname is not available"
5629
+ },
5630
+ initialUser: {
5631
+ welcome: "Your nickname is set as {{nickname}}",
5632
+ message: 'Change & Save on your demand, and "Continue":'
5589
5633
  }
5590
5634
  },
5591
5635
  profilesMenu: {
@@ -5921,6 +5965,10 @@ var init_ru = __esm({
5921
5965
  checkingAvailability: "\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E\u0441\u0442\u0438...",
5922
5966
  nicknameAvailable: "\u041D\u0438\u043A\u043D\u0435\u0439\u043C \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D",
5923
5967
  nicknameNotAvailable: "\u042D\u0442\u043E\u0442 \u043D\u0438\u043A\u043D\u0435\u0439\u043C \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D"
5968
+ },
5969
+ initialUser: {
5970
+ welcome: "\u0412\u0430\u0448 \u043D\u0438\u043A\u043D\u0435\u0439\u043C \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D \u043A\u0430\u043A {{nickname}}",
5971
+ message: '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u0435 \u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u043F\u043E \u0432\u0430\u0448\u0435\u043C\u0443 \u0436\u0435\u043B\u0430\u043D\u0438\u044E, \u0438 \u0437\u0430\u0442\u0435\u043C "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C":'
5924
5972
  }
5925
5973
  },
5926
5974
  profilesMenu: {
@@ -6256,6 +6304,10 @@ var init_zh = __esm({
6256
6304
  checkingAvailability: "\u6B63\u5728\u68C0\u67E5\u53EF\u7528\u6027...",
6257
6305
  nicknameAvailable: "\u6635\u79F0\u53EF\u7528",
6258
6306
  nicknameNotAvailable: "\u6B64\u6635\u79F0\u4E0D\u53EF\u7528"
6307
+ },
6308
+ initialUser: {
6309
+ welcome: "\u60A8\u7684\u6635\u79F0\u5DF2\u8BBE\u7F6E\u4E3A {{nickname}}",
6310
+ message: "\u6839\u636E\u60A8\u7684\u9700\u6C42\u66F4\u6539\u5E76\u4FDD\u5B58\uFF0C\u7136\u540E\u70B9\u51FB\u201C\u7EE7\u7EED\u201D\uFF1A"
6259
6311
  }
6260
6312
  },
6261
6313
  profilesMenu: {
@@ -6596,7 +6648,7 @@ var init_icons = __esm({
6596
6648
 
6597
6649
  // src/internal/components/AuthMenu/PassKeyStep.tsx
6598
6650
  import { ArrowLeft, Key as Key2 } from "lucide-react";
6599
- import { useCallback as useCallback6 } from "react";
6651
+ import { useCallback as useCallback7 } from "react";
6600
6652
  import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
6601
6653
  function normalizeWebAuthnError(err) {
6602
6654
  const raw = err?.message || String(err || "");
@@ -6621,7 +6673,7 @@ function PassKeyStep(props) {
6621
6673
  const setIsLoading = useSession((st) => st.setIsLoading);
6622
6674
  const autoCloseOnSuccess = !recoveryUserId;
6623
6675
  const { passkeyStatus, setStep, setPasskeyStatus, setAlert, setEmail, setFailedType } = useAuthStore();
6624
- const onPasskeyRegister = useCallback6(async () => {
6676
+ const onPasskeyRegister = useCallback7(async () => {
6625
6677
  setAlert(null);
6626
6678
  setPasskeyStatus("registering passkey...");
6627
6679
  setIsLoading(true);
@@ -6680,7 +6732,7 @@ function PassKeyStep(props) {
6680
6732
  setIsLoading(false);
6681
6733
  }
6682
6734
  }, [onAuthSuccess, setPage]);
6683
- const onPasskeyAuth = useCallback6(async () => {
6735
+ const onPasskeyAuth = useCallback7(async () => {
6684
6736
  setAlert(null);
6685
6737
  setPasskeyStatus("checking available passkeys...");
6686
6738
  setIsLoading(true);
@@ -6813,7 +6865,7 @@ var init_PassKeyStep = __esm({
6813
6865
  });
6814
6866
 
6815
6867
  // src/internal/components/ui/input.tsx
6816
- import React4, { useImperativeHandle as useImperativeHandle2, useRef as useRef4 } from "react";
6868
+ import React4, { useImperativeHandle as useImperativeHandle2, useRef as useRef5 } from "react";
6817
6869
  import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
6818
6870
  var Input;
6819
6871
  var init_input = __esm({
@@ -6821,7 +6873,7 @@ var init_input = __esm({
6821
6873
  init_utils2();
6822
6874
  Input = React4.forwardRef((props, ref) => {
6823
6875
  const { className, disabled, error, Icon: Icon2, element, inputClassName, ...inputProps } = props;
6824
- const internalRef = useRef4(null);
6876
+ const internalRef = useRef5(null);
6825
6877
  useImperativeHandle2(ref, () => internalRef.current);
6826
6878
  return /* @__PURE__ */ jsxs9("div", { className: cn("w-full flex flex-col gap-1", className), children: [
6827
6879
  /* @__PURE__ */ jsxs9(
@@ -6871,14 +6923,14 @@ var init_input = __esm({
6871
6923
  // src/internal/components/AuthMenu/SignInStep/Email.tsx
6872
6924
  import { useMutation as useMutation3 } from "@tanstack/react-query";
6873
6925
  import { ChevronRight, Loader as Loader2, Mail as Mail2 } from "lucide-react";
6874
- import { useEffect as useEffect8, useRef as useRef5 } from "react";
6926
+ import { useEffect as useEffect9, useRef as useRef6 } from "react";
6875
6927
  import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
6876
6928
  function Email() {
6877
6929
  const { callbacksRef } = useProviderConfig();
6878
6930
  const { t } = useT();
6879
- const focusRef = useRef5(null);
6880
- const inputRef = useRef5(null);
6881
- const buttonRef = useRef5(null);
6931
+ const focusRef = useRef6(null);
6932
+ const inputRef = useRef6(null);
6933
+ const buttonRef = useRef6(null);
6882
6934
  const isLoading = useSession((st) => st.isLoading);
6883
6935
  const setIsLoading = useSession((st) => st.setIsLoading);
6884
6936
  const isMobileView = useLayoutStore((st) => st.isMobileView);
@@ -6934,7 +6986,7 @@ function Email() {
6934
6986
  setIsLoading(false);
6935
6987
  }
6936
6988
  });
6937
- useEffect8(() => {
6989
+ useEffect9(() => {
6938
6990
  if (!focusRef.current || !isMobileView) return;
6939
6991
  focusRef.current?.focus();
6940
6992
  setTimeout(() => {
@@ -7142,7 +7194,7 @@ var init_utils4 = __esm({
7142
7194
  });
7143
7195
 
7144
7196
  // src/internal/components/AuthMenu/SignInStep/Social.tsx
7145
- import { useCallback as useCallback7 } from "react";
7197
+ import { useCallback as useCallback8 } from "react";
7146
7198
  import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
7147
7199
  function Social(props) {
7148
7200
  const { pendingLoginResponseRef, onAuthSuccess } = props;
@@ -7152,7 +7204,7 @@ function Social(props) {
7152
7204
  const setIsLoading = useSession((st) => st.setIsLoading);
7153
7205
  const setIsWalletLinking = useLayoutDataStore((st) => st.setIsWalletLinking);
7154
7206
  const { alert: alert2, setStep, setEmail, setFailedType, setAlert, setPasskeyStatus } = useAuthStore();
7155
- const onSocialAuth = useCallback7(
7207
+ const onSocialAuth = useCallback8(
7156
7208
  async (providerId) => {
7157
7209
  const normalizedProviderId = providerId.toLowerCase();
7158
7210
  const provider = config.current?.social?.providers?.find(
@@ -7642,18 +7694,18 @@ var init_constants4 = __esm({
7642
7694
 
7643
7695
  // src/internal/components/AuthMenu/useAuthMenuHanders.ts
7644
7696
  import { useQueryClient as useQueryClient2 } from "@tanstack/react-query";
7645
- import { useCallback as useCallback8, useRef as useRef6, useState as useState2 } from "react";
7697
+ import { useCallback as useCallback9, useRef as useRef7, useState as useState2 } from "react";
7646
7698
  function useAuthMenuHandlers() {
7647
7699
  const { config, callbacksRef } = useProviderConfig();
7648
7700
  const qc = useQueryClient2();
7649
- const pendingLoginResponseRef = useRef6(null);
7701
+ const pendingLoginResponseRef = useRef7(null);
7650
7702
  const [telegramCleanup, setTelegramCleanup] = useState2(null);
7651
7703
  const usePaymaster = useSession((st) => st.usePaymaster);
7652
7704
  const publicClient = useSession((st) => st.publicClient);
7653
7705
  const activeChainId = useSession((st) => st.activeChainId);
7654
7706
  const setStep = useAuthStore((st) => st.setStep);
7655
7707
  const setAlert = useAuthStore((st) => st.setAlert);
7656
- const createSessionWithKeyshare = useCallback8(
7708
+ const createSessionWithKeyshare = useCallback9(
7657
7709
  async (userId, hasServerKeyshare, isNewUser) => {
7658
7710
  const { setStatus } = useSession.getState();
7659
7711
  try {
@@ -7695,7 +7747,7 @@ function useAuthMenuHandlers() {
7695
7747
  },
7696
7748
  [usePaymaster, activeChainId]
7697
7749
  );
7698
- const onAuthSuccess = useCallback8(async () => {
7750
+ const onAuthSuccess = useCallback9(async () => {
7699
7751
  const {
7700
7752
  //
7701
7753
  setSession,
@@ -7802,7 +7854,7 @@ function useAuthMenuHandlers() {
7802
7854
  setStep("signin");
7803
7855
  }
7804
7856
  }, [qc, setStep, setAlert, createSessionWithKeyshare]);
7805
- const goBackToSignIn = useCallback8(() => {
7857
+ const goBackToSignIn = useCallback9(() => {
7806
7858
  setStep("signin");
7807
7859
  setAlert(null);
7808
7860
  if (telegramCleanup) {
@@ -7829,7 +7881,7 @@ var init_useAuthMenuHanders = __esm({
7829
7881
  });
7830
7882
 
7831
7883
  // src/internal/components/AuthMenu/VerifyStep/VerificationCodeInput.tsx
7832
- import { useEffect as useEffect9, useRef as useRef7, useState as useState3 } from "react";
7884
+ import { useEffect as useEffect10, useRef as useRef8, useState as useState3 } from "react";
7833
7885
  import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
7834
7886
  var getRemainingSeconds, VerificationCodeInput;
7835
7887
  var init_VerificationCodeInput = __esm({
@@ -7845,12 +7897,12 @@ var init_VerificationCodeInput = __esm({
7845
7897
  const setAlert = useAuthStore((st) => st.setAlert);
7846
7898
  const [expiresAt, setExpiresAt] = useState3(() => Date.now() + Math.max(0, expiresIn) * 1e3);
7847
7899
  const [timeLeft, setTimeLeft] = useState3(() => getRemainingSeconds(expiresAt));
7848
- useEffect9(() => {
7900
+ useEffect10(() => {
7849
7901
  const nextExpiresAt = Date.now() + Math.max(0, expiresIn) * 1e3;
7850
7902
  setExpiresAt(nextExpiresAt);
7851
7903
  setTimeLeft(getRemainingSeconds(nextExpiresAt));
7852
7904
  }, [expiresIn]);
7853
- useEffect9(() => {
7905
+ useEffect10(() => {
7854
7906
  let intervalId;
7855
7907
  const syncTimeLeft = () => {
7856
7908
  const remaining = getRemainingSeconds(expiresAt);
@@ -7871,10 +7923,10 @@ var init_VerificationCodeInput = __esm({
7871
7923
  document.removeEventListener("visibilitychange", syncTimeLeft);
7872
7924
  };
7873
7925
  }, [expiresAt]);
7874
- const lastSubmittedRef = useRef7(null);
7875
- const inputsRef = useRef7([]);
7926
+ const lastSubmittedRef = useRef8(null);
7927
+ const inputsRef = useRef8([]);
7876
7928
  const [digits, setDigits] = useState3(["", "", "", "", "", ""]);
7877
- useEffect9(() => {
7929
+ useEffect10(() => {
7878
7930
  const code = digits.join("");
7879
7931
  if (code.length === 6 && digits.every((d) => d !== "") && !isLoading) {
7880
7932
  if (lastSubmittedRef.current !== code) {
@@ -7883,7 +7935,7 @@ var init_VerificationCodeInput = __esm({
7883
7935
  }
7884
7936
  }
7885
7937
  }, [digits, isLoading, onVerifyCode]);
7886
- useEffect9(() => {
7938
+ useEffect10(() => {
7887
7939
  const t2 = setTimeout(() => {
7888
7940
  inputsRef.current[0]?.focus();
7889
7941
  }, 0);
@@ -8180,7 +8232,7 @@ var init_VerifyStep2 = __esm({
8180
8232
 
8181
8233
  // src/internal/components/AuthMenu/AuthMenu.tsx
8182
8234
  import { AlertTriangle as AlertTriangle2, Loader as Loader4 } from "lucide-react";
8183
- import { useEffect as useEffect10, useMemo } from "react";
8235
+ import { useEffect as useEffect11, useMemo } from "react";
8184
8236
  import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
8185
8237
  var AuthMenu;
8186
8238
  var init_AuthMenu = __esm({
@@ -8207,7 +8259,7 @@ var init_AuthMenu = __esm({
8207
8259
  const setPendingWalletLogin = useLayoutDataStore((st) => st.setPendingWalletLogin);
8208
8260
  const { step, alert: alert2, setStep, setPasskeyStatus, setEmail, setAlert } = useAuthStore();
8209
8261
  const { pendingLoginResponseRef, onAuthSuccess, goBackToSignIn } = useAuthMenuHandlers();
8210
- useEffect10(() => {
8262
+ useEffect11(() => {
8211
8263
  if (!pendingWalletLogin) return;
8212
8264
  const loginResponse = pendingWalletLogin;
8213
8265
  setPendingWalletLogin(null);
@@ -8217,7 +8269,7 @@ var init_AuthMenu = __esm({
8217
8269
  onAuthSuccess();
8218
8270
  });
8219
8271
  }, [pendingWalletLogin]);
8220
- useEffect10(() => {
8272
+ useEffect11(() => {
8221
8273
  setTransitionPageHeight(DEFAULT_AUTH_MENU_HEIGHT);
8222
8274
  return () => {
8223
8275
  setStep("signin");
@@ -8792,7 +8844,7 @@ var init_useBuyMenuStore = __esm({
8792
8844
  // src/internal/components/BuyMenu/components/CryptoSelector.tsx
8793
8845
  import { debounce as debounce2, toPairs } from "lodash-es";
8794
8846
  import { InfoIcon, PointerIcon, SearchIcon } from "lucide-react";
8795
- import { useCallback as useCallback9, useMemo as useMemo2, useState as useState6 } from "react";
8847
+ import { useCallback as useCallback10, useMemo as useMemo2, useState as useState6 } from "react";
8796
8848
  import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
8797
8849
  function CryptoItem(props) {
8798
8850
  const { symbol, network } = props;
@@ -8832,7 +8884,7 @@ function CryptoSelector(props) {
8832
8884
  const chainConfig = useSession((st) => st.chainConfig);
8833
8885
  const [searchValue, setSearchValue] = useState6("");
8834
8886
  const [target, setTarget] = useState6("");
8835
- const setSearchDebounced = useCallback9(
8887
+ const setSearchDebounced = useCallback10(
8836
8888
  debounce2((value) => {
8837
8889
  setTarget(value);
8838
8890
  useBuyMenuStore.getState().setRenderKey(`on-ramp-crypto-selector-${Date.now()}`);
@@ -9017,7 +9069,7 @@ var init_ResolvedFiatIcon = __esm({
9017
9069
  // src/internal/components/BuyMenu/components/FiatSelector.tsx
9018
9070
  import { debounce as debounce3 } from "lodash-es";
9019
9071
  import { PointerIcon as PointerIcon2, SearchIcon as SearchIcon2 } from "lucide-react";
9020
- import { useCallback as useCallback10, useMemo as useMemo3, useState as useState7 } from "react";
9072
+ import { useCallback as useCallback11, useMemo as useMemo3, useState as useState7 } from "react";
9021
9073
  import { Fragment as Fragment9, jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
9022
9074
  function getCurrencyName(ticker, locale = "en") {
9023
9075
  try {
@@ -9057,7 +9109,7 @@ function FiatSelector(props) {
9057
9109
  const locale = i18n.resolvedLanguage || "en";
9058
9110
  const [searchValue, setSearchValue] = useState7("");
9059
9111
  const [target, setTarget] = useState7("");
9060
- const setSearchDebounced = useCallback10(
9112
+ const setSearchDebounced = useCallback11(
9061
9113
  debounce3((value) => {
9062
9114
  setTarget(value);
9063
9115
  useBuyMenuStore.getState().setRenderKey(`on-ramp-fiat-selector-${Date.now()}`);
@@ -9678,7 +9730,7 @@ import { useInfiniteQuery } from "@tanstack/react-query";
9678
9730
  import dayjs from "dayjs";
9679
9731
  import { debounce as debounce4 } from "lodash-es";
9680
9732
  import { DownloadIcon, ExternalLinkIcon, LoaderIcon as LoaderIcon2 } from "lucide-react";
9681
- import { useCallback as useCallback11, useEffect as useEffect11, useMemo as useMemo4 } from "react";
9733
+ import { useCallback as useCallback12, useEffect as useEffect12, useMemo as useMemo4 } from "react";
9682
9734
  import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
9683
9735
  function getStatusVariant(status) {
9684
9736
  switch (status) {
@@ -9813,13 +9865,13 @@ function BinanceTxHistory() {
9813
9865
  () => historyData?.pages?.map((p) => p.data).flat(Infinity) || [],
9814
9866
  [historyData]
9815
9867
  );
9816
- const updateExpandable = useCallback11(
9868
+ const updateExpandable = useCallback12(
9817
9869
  debounce4(() => {
9818
9870
  useBuyMenuStore.getState().setRenderKey(`binance-history-loaded-${Date.now()}`);
9819
9871
  }, 200),
9820
9872
  []
9821
9873
  );
9822
- useEffect11(() => {
9874
+ useEffect12(() => {
9823
9875
  if (isTxDataLoading || !txList?.length || txList.length > 10) return;
9824
9876
  updateExpandable();
9825
9877
  }, [isTxDataLoading, txList]);
@@ -9866,11 +9918,11 @@ var init_BinanceTxHistory = __esm({
9866
9918
 
9867
9919
  // src/internal/components/BuyMenu/binance/useBinanceSseTracing.ts
9868
9920
  import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
9869
- import { useEffect as useEffect12, useRef as useRef8 } from "react";
9921
+ import { useEffect as useEffect13, useRef as useRef9 } from "react";
9870
9922
  function useBinanceSseTxTracing(walletAddress) {
9871
9923
  const qc = useQueryClient4();
9872
- const debounceRef = useRef8(null);
9873
- useEffect12(() => {
9924
+ const debounceRef = useRef9(null);
9925
+ useEffect13(() => {
9874
9926
  if (!walletAddress) return;
9875
9927
  const iframeManager = getIframeManager();
9876
9928
  if (!iframeManager) return;
@@ -9912,7 +9964,7 @@ var init_utils6 = __esm({
9912
9964
  // src/internal/components/BuyMenu/binance/Binance.tsx
9913
9965
  import { useMutation as useMutation6, useQuery as useQuery2, useQueryClient as useQueryClient5 } from "@tanstack/react-query";
9914
9966
  import { LoaderIcon as LoaderIcon3 } from "lucide-react";
9915
- import { useEffect as useEffect13 } from "react";
9967
+ import { useEffect as useEffect14 } from "react";
9916
9968
  import { Fragment as Fragment11, jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
9917
9969
  function Binance() {
9918
9970
  const qc = useQueryClient5();
@@ -9934,7 +9986,7 @@ function Binance() {
9934
9986
  } = useBuyMenuStore();
9935
9987
  const paymentMode = useBinanceStore((st) => st.paymentMode);
9936
9988
  const isCurrurenciesSelected = !!selectedCrypto && !!selectedFiat;
9937
- useEffect13(() => {
9989
+ useEffect14(() => {
9938
9990
  if (!isCurrurenciesSelected) return;
9939
9991
  useBuyMenuStore.getState().setRenderKey(`${selectedCrypto}-${selectedFiat}-${Date.now()}`);
9940
9992
  }, [isCurrurenciesSelected]);
@@ -9969,7 +10021,7 @@ function Binance() {
9969
10021
  });
9970
10022
  const paymentModes = paymentModesData?.data?.paymentMethods || [];
9971
10023
  const selectedPaymentMode = paymentModes?.find((el) => getPayMethodID(el) === paymentMode) || null;
9972
- useEffect13(() => {
10024
+ useEffect14(() => {
9973
10025
  useBuyMenuStore.getState().setMinAmount(Number(selectedPaymentMode?.fiatMinLimit || "0"));
9974
10026
  }, [selectedPaymentMode]);
9975
10027
  const { mutate: estimateQuote, isPending: isQuoteEstimating } = useMutation6({
@@ -9997,21 +10049,21 @@ function Binance() {
9997
10049
  }
9998
10050
  });
9999
10051
  const availableFiats = (tradingPairsData?.data?.fiatCurrencies || []).map((ticker) => ({ ticker }));
10000
- useEffect13(() => {
10052
+ useEffect14(() => {
10001
10053
  if (!!selectedFiat || !availableFiats?.length) return;
10002
10054
  const targetFiat = availableFiats.find((item) => item.ticker === "USD" || item.ticker === "EUR") || availableFiats[0];
10003
10055
  useBuyMenuStore.getState().setSelectedFiat(targetFiat.ticker);
10004
10056
  }, [availableFiats, selectedFiat]);
10005
- useEffect13(() => {
10057
+ useEffect14(() => {
10006
10058
  if (!!selectedCrypto || !networkAvailableCryptoList?.length) return;
10007
10059
  useBuyMenuStore.getState().setSelectedCrypto(networkAvailableCryptoList[0].cryptoCurrency);
10008
10060
  }, [networkAvailableCryptoList, selectedCrypto]);
10009
- useEffect13(() => {
10061
+ useEffect14(() => {
10010
10062
  if (!!paymentMode || !paymentModes.length) return;
10011
10063
  const targetPaymentMode = paymentModes.find((item) => item.payMethodCode === PREFERRED_PAYMENT_METHOD) || paymentModes[0];
10012
10064
  useBinanceStore.getState().setPaymentMode(getPayMethodID(targetPaymentMode));
10013
10065
  }, [paymentModes]);
10014
- useEffect13(() => {
10066
+ useEffect14(() => {
10015
10067
  return () => {
10016
10068
  useBinanceStore.getState().setPaymentMode(null);
10017
10069
  qc.resetQueries({ queryKey: [QUERY_KEYS2.binanceTradingPairs] });
@@ -10333,7 +10385,7 @@ var init_FinchPaySummary = __esm({
10333
10385
  import { useInfiniteQuery as useInfiniteQuery2 } from "@tanstack/react-query";
10334
10386
  import dayjs2 from "dayjs";
10335
10387
  import { LoaderIcon as LoaderIcon4 } from "lucide-react";
10336
- import { useCallback as useCallback12, useState as useState8 } from "react";
10388
+ import { useCallback as useCallback13, useState as useState8 } from "react";
10337
10389
  import { jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
10338
10390
  function getStatusVariant2(status) {
10339
10391
  switch (status) {
@@ -10435,7 +10487,7 @@ function FinchPayTxHistory() {
10435
10487
  const pageCount = loadedPages[loadedPages.length - 1]?.pageCount || 1;
10436
10488
  const txList = loadedPages.map((p) => p.data)[cursor - 1] || [];
10437
10489
  console.log("[FINCHPAY] txList", txData);
10438
- const handleNextPage = useCallback12(
10490
+ const handleNextPage = useCallback13(
10439
10491
  async (curCursor, curPageParams) => {
10440
10492
  const maxLoadedPage = Math.max(...curPageParams);
10441
10493
  if (curCursor !== maxLoadedPage) {
@@ -10526,11 +10578,11 @@ var init_networks = __esm({
10526
10578
 
10527
10579
  // src/internal/components/BuyMenu/finchpay/useFinchpaySseTxTracing.ts
10528
10580
  import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
10529
- import { useEffect as useEffect14, useRef as useRef9 } from "react";
10581
+ import { useEffect as useEffect15, useRef as useRef10 } from "react";
10530
10582
  function useFinchpaySseTxTracing(walletAddress) {
10531
10583
  const qc = useQueryClient6();
10532
- const debounceRef = useRef9(null);
10533
- useEffect14(() => {
10584
+ const debounceRef = useRef10(null);
10585
+ useEffect15(() => {
10534
10586
  if (!walletAddress) return;
10535
10587
  const iframeManager = getIframeManager();
10536
10588
  if (!iframeManager) return;
@@ -10579,7 +10631,7 @@ var init_utils7 = __esm({
10579
10631
  // src/internal/components/BuyMenu/finchpay/FinchPay.tsx
10580
10632
  import { useQuery as useQuery3, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
10581
10633
  import { DollarSign, LoaderIcon as LoaderIcon5 } from "lucide-react";
10582
- import { useEffect as useEffect15 } from "react";
10634
+ import { useEffect as useEffect16 } from "react";
10583
10635
  import { Fragment as Fragment12, jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
10584
10636
  function FinchPay() {
10585
10637
  const qc = useQueryClient7();
@@ -10655,11 +10707,11 @@ function FinchPay() {
10655
10707
  })
10656
10708
  });
10657
10709
  const minimum = Number(limitsData?.min_amount || "0");
10658
- useEffect15(() => {
10710
+ useEffect16(() => {
10659
10711
  if (minimum <= 0) return;
10660
10712
  useBuyMenuStore.getState().setMinAmount(minimum);
10661
10713
  }, [minimum]);
10662
- useEffect15(() => {
10714
+ useEffect16(() => {
10663
10715
  if (srcInputAmount >= minimum) return;
10664
10716
  useBuyMenuStore.getState().setRenderKey(`finchpay-input-minimum-warning-${Date.now()}`);
10665
10717
  }, [minimum, srcInputAmount]);
@@ -10687,23 +10739,23 @@ function FinchPay() {
10687
10739
  // defaults to CARD estimation, widgetUrl
10688
10740
  })
10689
10741
  });
10690
- useEffect15(() => {
10742
+ useEffect16(() => {
10691
10743
  const { error: errorTitle, message: errorMessage } = handleErrors([currenciesError, limitsError, estimateError]);
10692
10744
  if (!errorTitle && !errorMessage) return;
10693
10745
  console.error(`[BuyModal][Binance] ${errorTitle}: ${errorMessage}`);
10694
10746
  useBuyMenuStore.getState().setError(errorMessage);
10695
10747
  }, [currenciesError, limitsError, estimateError]);
10696
- useEffect15(() => {
10748
+ useEffect16(() => {
10697
10749
  if (!!selectedFiat || currenciesData.fiats.length === 0) return;
10698
10750
  const fallbackFiat = currenciesData.fiats[0];
10699
10751
  const targetFiat = currenciesData.fiats.find((f) => f.ticker.toUpperCase() === "USD") || fallbackFiat;
10700
10752
  useBuyMenuStore.getState().setSelectedFiat(targetFiat.ticker);
10701
10753
  }, [currenciesData, selectedFiat]);
10702
- useEffect15(() => {
10754
+ useEffect16(() => {
10703
10755
  if (!!selectedCrypto || currenciesData.currentNetworkCoins.length === 0) return;
10704
10756
  useBuyMenuStore.getState().setSelectedCrypto(currenciesData.currentNetworkCoins[0].ticker);
10705
10757
  }, [currenciesData, selectedCrypto]);
10706
- useEffect15(() => {
10758
+ useEffect16(() => {
10707
10759
  return () => {
10708
10760
  qc.resetQueries({ queryKey: [QUERY_KEYS2.finchPayCurrencies] });
10709
10761
  qc.resetQueries({ queryKey: [QUERY_KEYS2.finchPayLimits] });
@@ -10970,7 +11022,7 @@ var init_debounce = __esm({
10970
11022
  });
10971
11023
 
10972
11024
  // src/internal/components/BuyMenu/useHandleInputAmount.ts
10973
- import { useCallback as useCallback13, useEffect as useEffect16, useRef as useRef10 } from "react";
11025
+ import { useCallback as useCallback14, useEffect as useEffect17, useRef as useRef11 } from "react";
10974
11026
  var ON_INPUT_QUERY_DELAY, useHandleInputAmount;
10975
11027
  var init_useHandleInputAmount = __esm({
10976
11028
  "src/internal/components/BuyMenu/useHandleInputAmount.ts"() {
@@ -10979,11 +11031,11 @@ var init_useHandleInputAmount = __esm({
10979
11031
  init_useBuyMenuStore();
10980
11032
  ON_INPUT_QUERY_DELAY = 1500;
10981
11033
  useHandleInputAmount = () => {
10982
- const lastRampProviderRef = useRef10(DEFAULT_PROVIDER2);
11034
+ const lastRampProviderRef = useRef11(DEFAULT_PROVIDER2);
10983
11035
  const rampProvider = useBuyMenuStore((st) => st.rampProvider);
10984
11036
  const srcInputAmount = useBuyMenuStore((st) => st.srcInputAmount);
10985
11037
  const minAmount = useBuyMenuStore((st) => st.minAmount);
10986
- const setQueryAmountDebounced = useCallback13(
11038
+ const setQueryAmountDebounced = useCallback14(
10987
11039
  debounce5((inputAmount) => {
10988
11040
  const checkedValue = Math.ceil(Math.max(inputAmount, minAmount));
10989
11041
  useBuyMenuStore.getState().setSrcInputAmount(checkedValue);
@@ -10991,8 +11043,8 @@ var init_useHandleInputAmount = __esm({
10991
11043
  }, ON_INPUT_QUERY_DELAY),
10992
11044
  [minAmount]
10993
11045
  );
10994
- useEffect16(() => setQueryAmountDebounced(srcInputAmount), [srcInputAmount, setQueryAmountDebounced]);
10995
- useEffect16(() => {
11046
+ useEffect17(() => setQueryAmountDebounced(srcInputAmount), [srcInputAmount, setQueryAmountDebounced]);
11047
+ useEffect17(() => {
10996
11048
  if (lastRampProviderRef.current === rampProvider) return;
10997
11049
  const {
10998
11050
  setIsProviderSummary,
@@ -11356,7 +11408,7 @@ var init_truncateMiddle = __esm({
11356
11408
  // src/internal/components/ChainsMenu/ChainItem.tsx
11357
11409
  import { getChainConfig as getChainConfig7 } from "@embarkai/core/read";
11358
11410
  import { Copy, ExternalLink, Loader as Loader6 } from "lucide-react";
11359
- import { useRef as useRef11, useState as useState9 } from "react";
11411
+ import { useRef as useRef12, useState as useState9 } from "react";
11360
11412
  import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
11361
11413
  function getPaymasterExplorerUrl(chainId, paymasterAddress) {
11362
11414
  const chainConfig = getChainConfig7(chainId);
@@ -11379,7 +11431,7 @@ function ChainItem(props) {
11379
11431
  const isSessionLoading = useSession((st) => st.isLoading);
11380
11432
  const activeChainId = useSession((st) => st.activeChainId);
11381
11433
  const [copiedChainId, setCopiedChainId] = useState9(null);
11382
- const copiedResetTimerRef = useRef11(null);
11434
+ const copiedResetTimerRef = useRef12(null);
11383
11435
  const isActiveChain = activeChainId === chainId;
11384
11436
  const paymasterAddress = isActiveChain ? activePaymasterData?.address : null;
11385
11437
  const paymasterExplorerUrl = paymasterAddress ? getPaymasterExplorerUrl(chainId, paymasterAddress) : null;
@@ -12351,7 +12403,7 @@ var init_guardian_backup = __esm({
12351
12403
  });
12352
12404
 
12353
12405
  // src/internal/components/DevicesMenu/DeviceManageScreen.tsx
12354
- import { useCallback as useCallback14, useEffect as useEffect17, useRef as useRef12, useState as useState12 } from "react";
12406
+ import { useCallback as useCallback15, useEffect as useEffect18, useRef as useRef13, useState as useState12 } from "react";
12355
12407
  import { ArrowLeft as ArrowLeft7, Cpu, Download, HardDrive, Loader2 as Loader23, Trash2, Upload } from "lucide-react";
12356
12408
  import { Fragment as Fragment15, jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
12357
12409
  function formatSize(bytes) {
@@ -12366,19 +12418,19 @@ function DeviceManageScreen() {
12366
12418
  const userId = session?.mpcUserId || "";
12367
12419
  const deviceId = pageParams?.deviceId;
12368
12420
  const deviceName = pageParams?.deviceName;
12369
- const guardianRef = useRef12(null);
12421
+ const guardianRef = useRef13(null);
12370
12422
  const [screen, setScreen] = useState12({ step: "connecting" });
12371
12423
  const [actionState, setActionState] = useState12(null);
12372
12424
  const [password, setPassword] = useState12("");
12373
12425
  const [statusMessage, setStatusMessage] = useState12(null);
12374
12426
  const [errorMessage, setErrorMessage] = useState12(null);
12375
12427
  const [waitingConfirm, setWaitingConfirm] = useState12(false);
12376
- useEffect17(() => {
12428
+ useEffect18(() => {
12377
12429
  if (!statusMessage) return;
12378
12430
  const t = setTimeout(() => setStatusMessage(null), 3e3);
12379
12431
  return () => clearTimeout(t);
12380
12432
  }, [statusMessage]);
12381
- useEffect17(() => {
12433
+ useEffect18(() => {
12382
12434
  if (!deviceId || !isWebSerialAvailable()) {
12383
12435
  setScreen({ step: "error", message: "WebSerial not available" });
12384
12436
  return;
@@ -12410,7 +12462,7 @@ function DeviceManageScreen() {
12410
12462
  guardianRef.current?.close();
12411
12463
  };
12412
12464
  }, [deviceId]);
12413
- const refreshList = useCallback14(async () => {
12465
+ const refreshList = useCallback15(async () => {
12414
12466
  const guardian = guardianRef.current;
12415
12467
  if (!guardian || screen.step !== "connected") return;
12416
12468
  try {
@@ -12419,7 +12471,7 @@ function DeviceManageScreen() {
12419
12471
  } catch {
12420
12472
  }
12421
12473
  }, [screen]);
12422
- const handleBackup = useCallback14(async () => {
12474
+ const handleBackup = useCallback15(async () => {
12423
12475
  const guardian = guardianRef.current;
12424
12476
  const iframe4 = getIframeManager();
12425
12477
  if (!guardian || !iframe4 || !userId) return;
@@ -12443,7 +12495,7 @@ function DeviceManageScreen() {
12443
12495
  setActionState(null);
12444
12496
  }
12445
12497
  }, [password, userId, refreshList]);
12446
- const handleOverwrite = useCallback14(async () => {
12498
+ const handleOverwrite = useCallback15(async () => {
12447
12499
  const guardian = guardianRef.current;
12448
12500
  const iframe4 = getIframeManager();
12449
12501
  if (!guardian || !iframe4 || !userId) return;
@@ -12463,7 +12515,7 @@ function DeviceManageScreen() {
12463
12515
  setActionState(null);
12464
12516
  }
12465
12517
  }, [password, userId, refreshList]);
12466
- const handleDelete = useCallback14(async (keyshareId) => {
12518
+ const handleDelete = useCallback15(async (keyshareId) => {
12467
12519
  const guardian = guardianRef.current;
12468
12520
  if (!guardian) return;
12469
12521
  setActionState({ action: "delete", keyshareId, substep: "confirm-device" });
@@ -12643,7 +12695,7 @@ var init_DeviceManageScreen = __esm({
12643
12695
  });
12644
12696
 
12645
12697
  // src/internal/components/DevicesMenu/DeviceRestoreScreen.tsx
12646
- import { useCallback as useCallback15, useState as useState13 } from "react";
12698
+ import { useCallback as useCallback16, useState as useState13 } from "react";
12647
12699
  import { AlertTriangle as AlertTriangle3, ArrowLeft as ArrowLeft8, Download as Download2, Loader2 as Loader24 } from "lucide-react";
12648
12700
  import { Fragment as Fragment16, jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
12649
12701
  function DeviceRestoreScreen() {
@@ -12659,7 +12711,7 @@ function DeviceRestoreScreen() {
12659
12711
  const [isWorking, setIsWorking] = useState13(false);
12660
12712
  const [statusMessage, setStatusMessage] = useState13(null);
12661
12713
  const [errorMessage, setErrorMessage] = useState13(null);
12662
- const handleRestore = useCallback15(async () => {
12714
+ const handleRestore = useCallback16(async () => {
12663
12715
  if (!password || !keyshareId || !userId) return;
12664
12716
  const iframe4 = getIframeManager();
12665
12717
  if (!iframe4) {
@@ -12963,7 +13015,7 @@ var init_useRestoreStore = __esm({
12963
13015
  });
12964
13016
 
12965
13017
  // src/internal/components/KeyshareRestoreMenu/hooks/useOnRestoreSuccess.ts
12966
- import { useCallback as useCallback16 } from "react";
13018
+ import { useCallback as useCallback17 } from "react";
12967
13019
  function useOnRestoreSuccess() {
12968
13020
  const { config, callbacksRef } = useProviderConfig();
12969
13021
  const setIsDialogForced = useLayoutStore((st) => st.setIsDialogForced);
@@ -12979,7 +13031,7 @@ function useOnRestoreSuccess() {
12979
13031
  setStatus
12980
13032
  } = useSession();
12981
13033
  const { setError, setSuccess } = useRestoreStore();
12982
- const createSessionWithKeyshare = useCallback16(
13034
+ const createSessionWithKeyshare = useCallback17(
12983
13035
  async (userId, hasServerKeyshare, isNewUser) => {
12984
13036
  try {
12985
13037
  try {
@@ -13020,7 +13072,7 @@ function useOnRestoreSuccess() {
13020
13072
  },
13021
13073
  [setStatus, usePaymaster, activeChainId, publicClient]
13022
13074
  );
13023
- const onRestoreSuccess = useCallback16(async () => {
13075
+ const onRestoreSuccess = useCallback17(async () => {
13024
13076
  const { verifyToken: verifyToken2, jwtTokenManager: jwtTokenManager4 } = await Promise.resolve().then(() => (init_auth(), auth_exports));
13025
13077
  const verify = await verifyToken2();
13026
13078
  const hasServerKeyshare = verify?.hasKeyshare ?? jwtTokenManager4.getHasKeyshare() ?? false;
@@ -13506,7 +13558,7 @@ var init_cloudStorage = __esm({
13506
13558
 
13507
13559
  // src/internal/components/KeyshareRestoreMenu/hooks/useCreateBackup.ts
13508
13560
  import { useMutation as useMutation9, useQueryClient as useQueryClient9 } from "@tanstack/react-query";
13509
- import { useCallback as useCallback17, useEffect as useEffect18 } from "react";
13561
+ import { useCallback as useCallback18, useEffect as useEffect19 } from "react";
13510
13562
  function useCreateBackup() {
13511
13563
  const qc = useQueryClient9();
13512
13564
  const session = useSession((st) => st.session);
@@ -13515,7 +13567,7 @@ function useCreateBackup() {
13515
13567
  const usePasskey = useRestoreStore((st) => st.usePasskey);
13516
13568
  const restorePassword = useRestoreStore((st) => st.restorePassword);
13517
13569
  const selectedCloudProvider = useRestoreStore((st) => st.selectedCloudProvider);
13518
- useEffect18(() => {
13570
+ useEffect19(() => {
13519
13571
  if (!hasServerVault) {
13520
13572
  useRestoreStore.getState().setMethod("server");
13521
13573
  useLayoutStore.getState().setIsDialogForced(true);
@@ -13523,7 +13575,7 @@ function useCreateBackup() {
13523
13575
  }, [hasServerVault]);
13524
13576
  const recoveryUserId = useSession((st) => st.recoveryUserId);
13525
13577
  const passportUserId = session?.mpcUserId || recoveryUserId || "";
13526
- const onBackupSuccess = useCallback17(() => {
13578
+ const onBackupSuccess = useCallback18(() => {
13527
13579
  console.log("[EMBARKAI BACKUP] Backup created successfully");
13528
13580
  }, [hasServerVault]);
13529
13581
  const { mutate: createPasswordBackup, isPending: isPasswordBackupCreating } = useMutation9({
@@ -13810,7 +13862,7 @@ var init_useRestoreAccount = __esm({
13810
13862
  });
13811
13863
 
13812
13864
  // src/internal/components/KeyshareRestoreMenu/hooks/useValidateFileBackup.ts
13813
- import { useEffect as useEffect19 } from "react";
13865
+ import { useEffect as useEffect20 } from "react";
13814
13866
  function validateRestoreFileFormat(parsedData) {
13815
13867
  if (typeof parsedData !== "object" || parsedData === null) return false;
13816
13868
  const data = parsedData;
@@ -13820,7 +13872,7 @@ function useValidateFileBackup() {
13820
13872
  const restoreFile = useRestoreStore((st) => st.restoreFile);
13821
13873
  const setError = useRestoreStore((st) => st.setError);
13822
13874
  const setUsePasskey = useRestoreStore((st) => st.setUsePasskey);
13823
- useEffect19(() => {
13875
+ useEffect20(() => {
13824
13876
  if (!restoreFile) {
13825
13877
  return;
13826
13878
  }
@@ -13946,7 +13998,7 @@ var init_MethodSelector = __esm({
13946
13998
 
13947
13999
  // src/internal/components/KeyshareRestoreMenu/components/PasswordPasskey.tsx
13948
14000
  import { ChevronRight as ChevronRight2, Eye, EyeOff, Info as Info3, Key as Key4, Loader as Loader8, Plus } from "lucide-react";
13949
- import { useEffect as useEffect20, useRef as useRef13 } from "react";
14001
+ import { useEffect as useEffect21, useRef as useRef14 } from "react";
13950
14002
  import { Fragment as Fragment18, jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
13951
14003
  function PasswordPasskey(props) {
13952
14004
  const { t } = useT();
@@ -13961,7 +14013,7 @@ function PasswordPasskey(props) {
13961
14013
  onCreatePasskey
13962
14014
  } = props;
13963
14015
  const hasServerVault = useSession((st) => st.hasServerVault);
13964
- const actionRef = useRef13(null);
14016
+ const actionRef = useRef14(null);
13965
14017
  const {
13966
14018
  showPassword,
13967
14019
  restorePassword,
@@ -13975,7 +14027,7 @@ function PasswordPasskey(props) {
13975
14027
  } = useRestoreStore();
13976
14028
  const { config } = useProviderConfig();
13977
14029
  const isPasskeyEnabled = config.current.passkey.enabled;
13978
- useEffect20(() => {
14030
+ useEffect21(() => {
13979
14031
  if (!isPasskeyEnabled && usePasskey) setUsePasskey(false);
13980
14032
  }, [isPasskeyEnabled, usePasskey]);
13981
14033
  return /* @__PURE__ */ jsxs53(Fragment18, { children: [
@@ -14303,7 +14355,7 @@ var init_File = __esm({
14303
14355
  import { useQueryClient as useQueryClient10 } from "@tanstack/react-query";
14304
14356
  import dayjs3 from "dayjs";
14305
14357
  import { Download as Download3, Key as Key5, Upload as Upload3 } from "lucide-react";
14306
- import { useEffect as useEffect21 } from "react";
14358
+ import { useEffect as useEffect22 } from "react";
14307
14359
  import { Fragment as Fragment21, jsx as jsx62, jsxs as jsxs56 } from "react/jsx-runtime";
14308
14360
  function Server(props) {
14309
14361
  const { isLoading, mode = "restore", serverHandler, createPasskeyHandler } = props;
@@ -14313,7 +14365,7 @@ function Server(props) {
14313
14365
  const usePasskey = useRestoreStore((st) => st.usePasskey);
14314
14366
  const setUsePasskey = useRestoreStore((st) => st.setUsePasskey);
14315
14367
  const serverRecoveryStatus = qc.getQueryData([CHECK_BACKUP_QUERY_KEY, address]);
14316
- useEffect21(() => {
14368
+ useEffect22(() => {
14317
14369
  if (mode === "backup" || !serverRecoveryStatus?.created?.encryptionMethod) return;
14318
14370
  setUsePasskey(serverRecoveryStatus.created.encryptionMethod === "passkey");
14319
14371
  }, [mode, serverRecoveryStatus, setUsePasskey]);
@@ -14496,7 +14548,7 @@ var init_select = __esm({
14496
14548
  // src/internal/components/KeyshareRestoreMenu/methods/Cloud.tsx
14497
14549
  import { useQuery as useQuery6 } from "@tanstack/react-query";
14498
14550
  import { ArrowLeft as ArrowLeft10, CloudDownload, CloudUpload, Loader as Loader9 } from "lucide-react";
14499
- import { useEffect as useEffect22 } from "react";
14551
+ import { useEffect as useEffect23 } from "react";
14500
14552
  import { Fragment as Fragment22, jsx as jsx64, jsxs as jsxs58 } from "react/jsx-runtime";
14501
14553
  function Cloud2(props) {
14502
14554
  const { isLoading, mode = "restore", cloudHandler } = props;
@@ -14517,7 +14569,7 @@ function Cloud2(props) {
14517
14569
  return availableProviders.map((p) => ({ id: p.id, name: p.name, available: p.isAvailable() }));
14518
14570
  }
14519
14571
  });
14520
- useEffect22(() => {
14572
+ useEffect23(() => {
14521
14573
  if (isCloudProvidersLoading) return;
14522
14574
  if (!!cloudProvidersError) {
14523
14575
  console.error("[KeyshareBackup] Failed to load cloud providers:", cloudProvidersError);
@@ -14757,7 +14809,7 @@ var init_methods = __esm({
14757
14809
  // src/internal/components/KeyshareRestoreMenu/KeyshareRestoreMenu.tsx
14758
14810
  import { useMutation as useMutation11, useQuery as useQuery7, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
14759
14811
  import { AlertCircle as AlertCircle2, CheckCircle2, CloudDownload as CloudDownload2, Loader as Loader10, UserCircle as UserCircle2 } from "lucide-react";
14760
- import { useEffect as useEffect23 } from "react";
14812
+ import { useEffect as useEffect24 } from "react";
14761
14813
  import { useDisconnect } from "wagmi";
14762
14814
  import { Fragment as Fragment24, jsx as jsx66, jsxs as jsxs60 } from "react/jsx-runtime";
14763
14815
  var RESTORE_COMPONENTS, KeyshareRestoreMenu;
@@ -14794,7 +14846,7 @@ var init_KeyshareRestoreMenu = __esm({
14794
14846
  const error = useRestoreStore((st) => st.error);
14795
14847
  const success = useRestoreStore((st) => st.success);
14796
14848
  const currentRestoreMethod = useRestoreStore((st) => st.method);
14797
- useEffect23(() => {
14849
+ useEffect24(() => {
14798
14850
  const { setIsDialogForced } = useLayoutStore.getState();
14799
14851
  const { setRestorePassword, setRestoreFile, setShowPassword, setUsePasskey, setMethod } = useRestoreStore.getState();
14800
14852
  setIsDialogForced(true);
@@ -14834,7 +14886,7 @@ var init_KeyshareRestoreMenu = __esm({
14834
14886
  queryFn: async () => await getShareRecoveryStats()
14835
14887
  });
14836
14888
  const hasServerBackup = serverRecoveryStatus?.created || serverRecoveryStatus?.devices?.length > 0;
14837
- useEffect23(() => {
14889
+ useEffect24(() => {
14838
14890
  if (!!hasServerBackup) useRestoreStore.getState().setMethod("server");
14839
14891
  }, [hasServerBackup]);
14840
14892
  const { mutate: disconnect, isPending: isDisconnecting } = useMutation11({
@@ -14981,7 +15033,7 @@ var init_KeyshareRestoreMenu = __esm({
14981
15033
  // src/internal/components/KeyshareRestoreMenu/KeyshareBackupMenu.tsx
14982
15034
  import { useQuery as useQuery8 } from "@tanstack/react-query";
14983
15035
  import { AlertCircle as AlertCircle3, ArrowLeft as ArrowLeft11, CheckCircle2 as CheckCircle22, Loader as Loader11, LockIcon } from "lucide-react";
14984
- import { useEffect as useEffect24 } from "react";
15036
+ import { useEffect as useEffect25 } from "react";
14985
15037
  import { Fragment as Fragment25, jsx as jsx67, jsxs as jsxs61 } from "react/jsx-runtime";
14986
15038
  function KeyshareBackupMenu() {
14987
15039
  const address = useSession((st) => st.address);
@@ -14992,7 +15044,7 @@ function KeyshareBackupMenu() {
14992
15044
  const currentBackupMethod = useRestoreStore((st) => st.method);
14993
15045
  const error = useRestoreStore((st) => st.error);
14994
15046
  const success = useRestoreStore((st) => st.success);
14995
- useEffect24(() => {
15047
+ useEffect25(() => {
14996
15048
  const { setSuccess, setError, setRestorePassword, setRestoreFile, setShowPassword, setUsePasskey, setMethod } = useRestoreStore.getState();
14997
15049
  return () => {
14998
15050
  setSuccess(null);
@@ -15011,7 +15063,7 @@ function KeyshareBackupMenu() {
15011
15063
  queryFn: async () => await getShareRecoveryStats()
15012
15064
  });
15013
15065
  const hasRecoveryData = serverRecoveryStatus?.created || serverRecoveryStatus?.devices?.length > 0;
15014
- useEffect24(() => {
15066
+ useEffect25(() => {
15015
15067
  if (!!hasRecoveryData) useRestoreStore.getState().setMethod("server");
15016
15068
  }, [hasRecoveryData]);
15017
15069
  const {
@@ -15164,7 +15216,7 @@ var init_KeyshareRestoreMenu2 = __esm({
15164
15216
  });
15165
15217
 
15166
15218
  // src/hooks/useColorMode.ts
15167
- import { useCallback as useCallback18, useEffect as useEffect25 } from "react";
15219
+ import { useCallback as useCallback19, useEffect as useEffect26 } from "react";
15168
15220
  function useColorMode() {
15169
15221
  const {
15170
15222
  config: { current: config }
@@ -15172,14 +15224,14 @@ function useColorMode() {
15172
15224
  const preferedColorMode = config?.preferedColorMode;
15173
15225
  const colorMode = useLayoutStore((st) => st.colorMode);
15174
15226
  const handleStoreColorMode = useLayoutStore((st) => st.setColorMode);
15175
- const setColorMode = useCallback18(
15227
+ const setColorMode = useCallback19(
15176
15228
  (mode) => {
15177
15229
  localStorage.setItem(LOCAL_COLOR_MODE_KEY, mode);
15178
15230
  handleStoreColorMode(mode);
15179
15231
  },
15180
15232
  [handleStoreColorMode]
15181
15233
  );
15182
- useEffect25(() => {
15234
+ useEffect26(() => {
15183
15235
  let targetColorMode = localStorage.getItem(LOCAL_COLOR_MODE_KEY);
15184
15236
  if (!targetColorMode && !preferedColorMode) {
15185
15237
  const systemMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
@@ -15294,17 +15346,17 @@ var init_SumsubIframeManager = __esm({
15294
15346
  });
15295
15347
 
15296
15348
  // src/internal/components/KYC/useSumsubIframe.ts
15297
- import { useEffect as useEffect26, useRef as useRef14, useState as useState17 } from "react";
15349
+ import { useEffect as useEffect27, useRef as useRef15, useState as useState17 } from "react";
15298
15350
  function useSumsubIframe({ iframeUrl }) {
15299
15351
  const config = useProviderConfig().config;
15300
15352
  const { colorMode } = useColorMode();
15301
- const iframeRef = useRef14(null);
15353
+ const iframeRef = useRef15(null);
15302
15354
  const [isLoading, setIsLoading] = useState17(true);
15303
15355
  const [error, setError] = useState17(null);
15304
15356
  const [height, setHeight] = useState17(0);
15305
15357
  const [status, setStatus] = useState17("");
15306
15358
  const levelName = config.current?.kyc?.options?.levelName;
15307
- useEffect26(() => {
15359
+ useEffect27(() => {
15308
15360
  setError(null);
15309
15361
  setIsLoading(true);
15310
15362
  setStatus("Preparing verification...");
@@ -15616,14 +15668,14 @@ var init_useProvidersList = __esm({
15616
15668
 
15617
15669
  // src/internal/components/MainMenu/MainMenu.tsx
15618
15670
  import { ChevronLeft, ChevronRight as ChevronRight3, DollarSign as DollarSign2, Wallet2 as Wallet23 } from "lucide-react";
15619
- import { useEffect as useEffect27 } from "react";
15671
+ import { useEffect as useEffect28 } from "react";
15620
15672
  import { jsx as jsx72, jsxs as jsxs66 } from "react/jsx-runtime";
15621
15673
  function MainMenu() {
15622
15674
  const address = useSession((st) => st.address);
15623
15675
  const { t } = useT();
15624
15676
  const setPage = useLayoutDataStore((st) => st.setPage);
15625
15677
  const setTransitionPageHeight = useLayoutDataStore((st) => st.setTransitionPageHeight);
15626
- useEffect27(() => setTransitionPageHeight(DEFAULT_MAIN_MENU_HEIGHT), []);
15678
+ useEffect28(() => setTransitionPageHeight(DEFAULT_MAIN_MENU_HEIGHT), []);
15627
15679
  useProvidersList();
15628
15680
  return /* @__PURE__ */ jsx72("div", { className: "w-full p-[var(--ui-kit-pd)] flex flex-col gap-[var(--ui-kit-gap)]", children: /* @__PURE__ */ jsx72("div", { className: "w-full grid grid-cols-4 gap-0 md:gap-[var(--ui-kit-gap)] py-[10px] md:py-1", children: MAIN_MENU_BUTTONS.map(({ id, label, icon: Icon2 }) => /* @__PURE__ */ jsxs66(
15629
15681
  Button,
@@ -15668,7 +15720,7 @@ var init_MainMenu2 = __esm({
15668
15720
 
15669
15721
  // src/modules/linkedProfiles.ts
15670
15722
  import { useQuery as useQuery11, useQueryClient as useQueryClient12 } from "@tanstack/react-query";
15671
- import { useCallback as useCallback19 } from "react";
15723
+ import { useCallback as useCallback20 } from "react";
15672
15724
  function useLinkedProfiles() {
15673
15725
  const qc = useQueryClient12();
15674
15726
  const address = useSession((st) => st.address);
@@ -15692,7 +15744,7 @@ function useLinkedProfiles() {
15692
15744
  }
15693
15745
  });
15694
15746
  const { profiles = [], avatar = null } = data || {};
15695
- const refresh = useCallback19(async () => {
15747
+ const refresh = useCallback20(async () => {
15696
15748
  await qc.invalidateQueries({ queryKey: [LINKED_PROFILES_QUERY_KEY, address] });
15697
15749
  }, [qc, address]);
15698
15750
  return { profiles, avatar, isLoading, isFetching, error, refresh };
@@ -16170,7 +16222,7 @@ var init_EmailNotConnectedWarning = __esm({
16170
16222
 
16171
16223
  // src/internal/components/ManageWalletMenu/hooks/useLinkSocial.ts
16172
16224
  import { useQueryClient as useQueryClient15 } from "@tanstack/react-query";
16173
- import React21, { useEffect as useEffect28 } from "react";
16225
+ import React21, { useEffect as useEffect29 } from "react";
16174
16226
  function normalizeSocialLinkError(message) {
16175
16227
  if (message === "X_ALREADY_LINKED") {
16176
16228
  return "This X account is already linked to another account";
@@ -16246,7 +16298,7 @@ function useLinkSocial() {
16246
16298
  [config.social?.providers]
16247
16299
  );
16248
16300
  const [socialLinkStarted, setSocialLinkStarted] = React21.useState(false);
16249
- useEffect28(() => {
16301
+ useEffect29(() => {
16250
16302
  const key = providerType?.toLowerCase();
16251
16303
  console.log("[useLinkSocial] Effect triggered:", { key, linkIsLoading, socialLinkStarted, isWalletLinking });
16252
16304
  if (isWalletLinking) {
@@ -16329,7 +16381,7 @@ var init_telegram2 = __esm({
16329
16381
 
16330
16382
  // src/internal/components/ManageWalletMenu/hooks/useLinkTelegram.ts
16331
16383
  import { useQueryClient as useQueryClient16 } from "@tanstack/react-query";
16332
- import { useCallback as useCallback20, useEffect as useEffect29, useState as useState18 } from "react";
16384
+ import { useCallback as useCallback21, useEffect as useEffect30, useState as useState18 } from "react";
16333
16385
  function useLinkTelegram() {
16334
16386
  const {
16335
16387
  config: { current: config },
@@ -16340,7 +16392,7 @@ function useLinkTelegram() {
16340
16392
  const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
16341
16393
  const { providerType, linkIsLoading, setLinkIsLoading, setProviderType, setAlert } = useManageWalletStore();
16342
16394
  const setPage = useLayoutDataStore((st) => st.setPage);
16343
- const handleLinkTelegram = useCallback20(async () => {
16395
+ const handleLinkTelegram = useCallback21(async () => {
16344
16396
  try {
16345
16397
  if (shouldBlockSocialAuthInTelegram("telegram")) {
16346
16398
  setAlert(buildTelegramBrowserRestriction("Telegram", "linking"));
@@ -16388,7 +16440,7 @@ function useLinkTelegram() {
16388
16440
  }
16389
16441
  }, [config.social?.providers]);
16390
16442
  const [telegramLinkStarted, setTelegramLinkStarted] = useState18(false);
16391
- useEffect29(() => {
16443
+ useEffect30(() => {
16392
16444
  console.log("[useLinkTelegram] Effect triggered:", {
16393
16445
  providerType,
16394
16446
  linkIsLoading,
@@ -16405,7 +16457,7 @@ function useLinkTelegram() {
16405
16457
  handleLinkTelegram();
16406
16458
  }
16407
16459
  }, [providerType, handleLinkTelegram, linkIsLoading, telegramLinkStarted, isWalletLinking]);
16408
- useEffect29(() => {
16460
+ useEffect30(() => {
16409
16461
  if (providerType !== "telegram") {
16410
16462
  setTelegramLinkStarted(false);
16411
16463
  }
@@ -16949,7 +17001,7 @@ var init_nickname_validation = __esm({
16949
17001
  // src/internal/components/NicknameMenu/NicknameEditForm.tsx
16950
17002
  import { useMutation as useMutation16, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
16951
17003
  import { AtSign, Check as Check2, ChevronRight as ChevronRight5, Copy as Copy2, Loader as Loader17 } from "lucide-react";
16952
- import { useCallback as useCallback21, useState as useState20 } from "react";
17004
+ import { useCallback as useCallback22, useState as useState20 } from "react";
16953
17005
  import { Fragment as Fragment29, jsx as jsx80, jsxs as jsxs74 } from "react/jsx-runtime";
16954
17006
  function NicknameEditForm(props) {
16955
17007
  const {
@@ -17000,7 +17052,7 @@ function NicknameEditForm(props) {
17000
17052
  );
17001
17053
  }
17002
17054
  });
17003
- const handleInputChange = useCallback21(
17055
+ const handleInputChange = useCallback22(
17004
17056
  (e) => {
17005
17057
  const value = e.target.value;
17006
17058
  setInputValue(value);
@@ -17014,7 +17066,7 @@ function NicknameEditForm(props) {
17014
17066
  },
17015
17067
  [clientError, isNicknameChangeError, isNicknameChangeSuccess, reset, t]
17016
17068
  );
17017
- const handleSubmit = useCallback21(
17069
+ const handleSubmit = useCallback22(
17018
17070
  (e) => {
17019
17071
  if (!canChange) return;
17020
17072
  e.preventDefault();
@@ -17097,19 +17149,19 @@ var init_NicknameEditForm = __esm({
17097
17149
 
17098
17150
  // src/internal/components/NicknameMenu/useNickname.ts
17099
17151
  import { useQuery as useQuery12 } from "@tanstack/react-query";
17100
- import { useEffect as useEffect30, useState as useState21 } from "react";
17152
+ import { useEffect as useEffect31, useState as useState21 } from "react";
17101
17153
  function useNicknameForm(currentNickname) {
17102
17154
  const [inputValue, setInputValue] = useState21("");
17103
17155
  const normalizedInputValue = normalizeNickname(inputValue);
17104
17156
  const validation = validateNickname(inputValue);
17105
17157
  const isValidForCheck = validation.valid && normalizedInputValue.length > 0;
17106
- useEffect30(() => {
17158
+ useEffect31(() => {
17107
17159
  setInputValue(currentNickname);
17108
17160
  }, [currentNickname]);
17109
17161
  const [queryInputValue, setQueryInputValue] = useState21("");
17110
17162
  const isSameAsCurrentNickname = normalizedInputValue === currentNickname.toLowerCase();
17111
17163
  const shouldCheckAvailability = validation.valid && !isSameAsCurrentNickname && inputValue.length > 0;
17112
- useEffect30(() => {
17164
+ useEffect31(() => {
17113
17165
  if (!isValidForCheck || !shouldCheckAvailability) {
17114
17166
  setQueryInputValue("");
17115
17167
  return;
@@ -17151,10 +17203,11 @@ var init_useNickname = __esm({
17151
17203
  // src/internal/components/NicknameMenu/NicknameMenu.tsx
17152
17204
  import { useQuery as useQuery13 } from "@tanstack/react-query";
17153
17205
  import dayjs4 from "dayjs";
17154
- import { AlertTriangle as AlertTriangle5, ArrowLeft as ArrowLeft15, Info as Info4, Loader as Loader18 } from "lucide-react";
17206
+ import { ArrowLeft as ArrowLeft15, Info as Info4, Loader as Loader18 } from "lucide-react";
17155
17207
  import { useState as useState22 } from "react";
17156
17208
  import { jsx as jsx81, jsxs as jsxs75 } from "react/jsx-runtime";
17157
17209
  function NicknameMenu() {
17210
+ const { isInitialUser } = usePageParams();
17158
17211
  const address = useSession((st) => st.address);
17159
17212
  const { t } = useT();
17160
17213
  const [clientError, setClientError] = useState22(null);
@@ -17236,10 +17289,27 @@ function NicknameMenu() {
17236
17289
  /* @__PURE__ */ jsx81("strong", { className: "text-[var(--ui-kit-fg)]", children: nicknameInfo.changeCount })
17237
17290
  ] })
17238
17291
  ] }),
17239
- !!resolvedError?.length && /* @__PURE__ */ jsxs75(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
17240
- /* @__PURE__ */ jsx81(AlertTriangle5, { className: "w-4 h-4 flex-none" }),
17241
- /* @__PURE__ */ jsx81("span", { children: resolvedError })
17242
- ] })
17292
+ isInitialUser && /* @__PURE__ */ jsxs75(Highlight, { type: "success", children: [
17293
+ /* @__PURE__ */ jsx81("p", {
17294
+ //@ts-expect-error i18n typings
17295
+ children: t("passport:nicknameMenu.initialUser.welcome", {
17296
+ nickname: nicknameInfo?.handle || "N/A"
17297
+ })
17298
+ }),
17299
+ /* @__PURE__ */ jsx81("p", { children: t("passport:nicknameMenu.initialUser.message") }),
17300
+ /* @__PURE__ */ jsx81(
17301
+ Button,
17302
+ {
17303
+ variant: "default-glow",
17304
+ size: "large",
17305
+ title: t("passport:common.continue"),
17306
+ onClick: () => setPage(null),
17307
+ className: "w-full",
17308
+ children: t("passport:common.continue")
17309
+ }
17310
+ )
17311
+ ] }),
17312
+ !!resolvedError?.length && /* @__PURE__ */ jsx81(Highlight, { type: "error", children: resolvedError })
17243
17313
  ] })
17244
17314
  }
17245
17315
  );
@@ -17247,6 +17317,7 @@ function NicknameMenu() {
17247
17317
  var init_NicknameMenu = __esm({
17248
17318
  "src/internal/components/NicknameMenu/NicknameMenu.tsx"() {
17249
17319
  init_SessionContext();
17320
+ init_useOpenPage();
17250
17321
  init_i18n();
17251
17322
  init_nickname();
17252
17323
  init_profile();
@@ -17416,7 +17487,7 @@ var init_useWatchTokens = __esm({
17416
17487
  // src/internal/hooks/useBlockscoutAssets.ts
17417
17488
  import { createBlockscoutClient } from "@embarkai/core/clients";
17418
17489
  import { useQuery as useQuery15 } from "@tanstack/react-query";
17419
- import { useCallback as useCallback22, useMemo as useMemo10, useRef as useRef15 } from "react";
17490
+ import { useCallback as useCallback23, useMemo as useMemo10, useRef as useRef16 } from "react";
17420
17491
  import { formatEther, formatUnits as formatUnits3 } from "viem";
17421
17492
  function resolveIpfsUri(uri) {
17422
17493
  if (!uri) return "";
@@ -17552,7 +17623,7 @@ function useBlockscoutAssets(options) {
17552
17623
  () => blockscoutApiUrl ? createBlockscoutClient({ baseUrl: blockscoutApiUrl }) : null,
17553
17624
  [blockscoutApiUrl]
17554
17625
  );
17555
- const lastRefreshRef = useRef15(0);
17626
+ const lastRefreshRef = useRef16(0);
17556
17627
  const {
17557
17628
  assets: watchTokenAssets,
17558
17629
  isLoading: watchTokensLoading,
@@ -17723,7 +17794,7 @@ function useBlockscoutAssets(options) {
17723
17794
  if (!tokensError) return null;
17724
17795
  return createError(tokensError);
17725
17796
  }, [tokensError]);
17726
- const refreshBalances = useCallback22(async () => {
17797
+ const refreshBalances = useCallback23(async () => {
17727
17798
  const now = Date.now();
17728
17799
  if (now - lastRefreshRef.current < BLOCKSCOUT_REFRESH_DEBOUNCE) {
17729
17800
  return;
@@ -17731,7 +17802,7 @@ function useBlockscoutAssets(options) {
17731
17802
  lastRefreshRef.current = now;
17732
17803
  await Promise.all([refetchNative(), refetchTokens(), refetchNfts(), refetchWatchTokens()]);
17733
17804
  }, [refetchNative, refetchTokens, refetchNfts, refetchWatchTokens]);
17734
- const getTokenBalance = useCallback22(
17805
+ const getTokenBalance = useCallback23(
17735
17806
  (tokenAddress) => {
17736
17807
  return assets.find((a) => a.address?.toLowerCase() === tokenAddress.toLowerCase()) || null;
17737
17808
  },
@@ -18038,7 +18109,7 @@ var init_PortfolioItem = __esm({
18038
18109
  // src/internal/components/PortfolioMenu/PortfolioMenu.tsx
18039
18110
  import { useQueryClient as useQueryClient19 } from "@tanstack/react-query";
18040
18111
  import { AlertCircle as AlertCircle4, ArrowLeft as ArrowLeft16, Gem, Loader as Loader19, RefreshCw as RefreshCw2 } from "lucide-react";
18041
- import { useCallback as useCallback23 } from "react";
18112
+ import { useCallback as useCallback24 } from "react";
18042
18113
  import { jsx as jsx84, jsxs as jsxs78 } from "react/jsx-runtime";
18043
18114
  function PortfolioMenu() {
18044
18115
  const { assets: projectAssets = [] } = useProviderConfig().config.current?.projectAssets || {};
@@ -18058,7 +18129,7 @@ function PortfolioMenu() {
18058
18129
  enabled: !!address
18059
18130
  });
18060
18131
  const shownProjectAssests = projectAssets.filter((asset) => !asset.hideInPortfolio);
18061
- const refreshAllAssetsBalances = useCallback23(() => {
18132
+ const refreshAllAssetsBalances = useCallback24(() => {
18062
18133
  Promise.all(shownProjectAssests.map((asset) => qc.invalidateQueries({ queryKey: asset.balanceQueryKey })));
18063
18134
  refreshBlockscoutBalances();
18064
18135
  }, [qc, shownProjectAssests, refreshBlockscoutBalances]);
@@ -18213,7 +18284,7 @@ var init_nickname_fingerprint = __esm({
18213
18284
  // src/internal/components/ReceiveMenu/ReceiveMenu.tsx
18214
18285
  import { ArrowLeft as ArrowLeft17, CheckCircle2 as CheckCircle23, Copy as Copy3, Info as Info5, Loader as Loader20, Shield } from "lucide-react";
18215
18286
  import QRCode from "qrcode";
18216
- import { useCallback as useCallback24, useEffect as useEffect31, useMemo as useMemo11, useState as useState23 } from "react";
18287
+ import { useCallback as useCallback25, useEffect as useEffect32, useMemo as useMemo11, useState as useState23 } from "react";
18217
18288
  import { Fragment as Fragment31, jsx as jsx85, jsxs as jsxs79 } from "react/jsx-runtime";
18218
18289
  function ReceiveMenu() {
18219
18290
  const session = useSession((st) => st.session);
@@ -18235,7 +18306,7 @@ function ReceiveMenu() {
18235
18306
  return null;
18236
18307
  }
18237
18308
  }, [session?.ownerAddress]);
18238
- useEffect31(() => {
18309
+ useEffect32(() => {
18239
18310
  if (open && address) {
18240
18311
  QRCode.toDataURL(address, {
18241
18312
  width: 200,
@@ -18248,7 +18319,7 @@ function ReceiveMenu() {
18248
18319
  });
18249
18320
  }
18250
18321
  }, [open, address]);
18251
- const handleCopy = useCallback24(async () => {
18322
+ const handleCopy = useCallback25(async () => {
18252
18323
  if (!address) return;
18253
18324
  try {
18254
18325
  await navigator.clipboard.writeText(address);
@@ -18258,7 +18329,7 @@ function ReceiveMenu() {
18258
18329
  console.error("Failed to copy address:", error);
18259
18330
  }
18260
18331
  }, [address]);
18261
- const handleCopyFingerprint = useCallback24(async () => {
18332
+ const handleCopyFingerprint = useCallback25(async () => {
18262
18333
  if (!fingerprint) return;
18263
18334
  try {
18264
18335
  await navigator.clipboard.writeText(fingerprint);
@@ -19105,7 +19176,7 @@ var init_useBridgeStore = __esm({
19105
19176
  // src/internal/components/SendMenu/hyperbridge/components/SenderSelector.tsx
19106
19177
  import { useConnectModal } from "@rainbow-me/rainbowkit";
19107
19178
  import { useMutation as useMutation18 } from "@tanstack/react-query";
19108
- import { useEffect as useEffect32, useRef as useRef16, useState as useState25 } from "react";
19179
+ import { useEffect as useEffect33, useRef as useRef17, useState as useState25 } from "react";
19109
19180
  import { useSignMessage } from "wagmi";
19110
19181
  import { jsx as jsx92, jsxs as jsxs86 } from "react/jsx-runtime";
19111
19182
  function SenderSelector(props) {
@@ -19116,12 +19187,12 @@ function SenderSelector(props) {
19116
19187
  const { openConnectModal } = useConnectModal();
19117
19188
  const directWalletAddress = useExternalWalletStore((st) => st.externalAddress);
19118
19189
  const directWalletIsConnected = useExternalWalletStore((st) => st.isExternalConnected);
19119
- const pendingWalletRef = useRef16(null);
19190
+ const pendingWalletRef = useRef17(null);
19120
19191
  const originChain = useBridgeStore((st) => st.originChain);
19121
19192
  const bridgeSender = useBridgeStore((st) => st.bridgeSender);
19122
19193
  const bridgeSenders = useBridgeStore((st) => st.bridgeSenders);
19123
19194
  const [walletMessage, setWalletMessage] = useState25(null);
19124
- useEffect32(() => {
19195
+ useEffect33(() => {
19125
19196
  useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
19126
19197
  }, [walletMessage]);
19127
19198
  const { mutate: loginDirectWallet, isPending: isDirectWalletLoggingIn } = useMutation18({
@@ -19177,7 +19248,7 @@ function SenderSelector(props) {
19177
19248
  setWalletMessage(error instanceof Error ? error.message : "Wallet login failed. Please try again.");
19178
19249
  }
19179
19250
  });
19180
- useEffect32(() => {
19251
+ useEffect33(() => {
19181
19252
  const pendingProfile = pendingWalletRef.current;
19182
19253
  if (!pendingProfile || !directWalletIsConnected || !directWalletAddress) return;
19183
19254
  if (directWalletAddress.toLowerCase() !== pendingProfile.externalId?.toLowerCase()) return;
@@ -19350,12 +19421,12 @@ var init_wallets = __esm({
19350
19421
  });
19351
19422
 
19352
19423
  // src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
19353
- import { useEffect as useEffect33, useRef as useRef17 } from "react";
19424
+ import { useEffect as useEffect34, useRef as useRef18 } from "react";
19354
19425
  function useAvailableSenders() {
19355
19426
  const address = useSession((st) => st.address);
19356
19427
  const { profiles } = useLinkedProfiles();
19357
- const lastCalcedSenders = useRef17([]);
19358
- useEffect33(() => {
19428
+ const lastCalcedSenders = useRef18([]);
19429
+ useEffect34(() => {
19359
19430
  const sendersAccumulator = [
19360
19431
  {
19361
19432
  type: "embarkai-wallet",
@@ -19717,7 +19788,7 @@ var init_utils8 = __esm({
19717
19788
  // src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneHistory.ts
19718
19789
  import { useInfiniteQuery as useInfiniteQuery3 } from "@tanstack/react-query";
19719
19790
  import { debounce as debounce6 } from "lodash-es";
19720
- import { useCallback as useCallback25, useEffect as useEffect34, useMemo as useMemo12 } from "react";
19791
+ import { useCallback as useCallback26, useEffect as useEffect35, useMemo as useMemo12 } from "react";
19721
19792
  function useHyperlaneHistory() {
19722
19793
  const address = useSession((st) => st.address);
19723
19794
  const page = useLayoutDataStore((st) => st.page);
@@ -19737,13 +19808,13 @@ function useHyperlaneHistory() {
19737
19808
  () => txHistoryData?.pages?.map((p) => p.data).flat(Infinity) || [],
19738
19809
  [txHistoryData]
19739
19810
  );
19740
- const updateExpandable = useCallback25(
19811
+ const updateExpandable = useCallback26(
19741
19812
  debounce6(() => {
19742
19813
  useFlowSelectorStore.getState().setRenderKey(`hyperlane-history-loaded-${Date.now()}`);
19743
19814
  }, 250),
19744
19815
  []
19745
19816
  );
19746
- useEffect34(() => {
19817
+ useEffect35(() => {
19747
19818
  if (isBridgeTxHistoryLoading || txList.length === 0) return;
19748
19819
  updateExpandable();
19749
19820
  }, [isBridgeTxHistoryLoading, txList]);
@@ -19779,7 +19850,7 @@ var init_useOperationHashesStore = __esm({
19779
19850
 
19780
19851
  // src/internal/components/SendMenu/hyperbridge/hooks/useBridge.ts
19781
19852
  import { useMutation as useMutation19, useQueryClient as useQueryClient21 } from "@tanstack/react-query";
19782
- import { useCallback as useCallback26 } from "react";
19853
+ import { useCallback as useCallback27 } from "react";
19783
19854
  import { useSwitchChain, useWalletClient } from "wagmi";
19784
19855
  function useBridge() {
19785
19856
  const qc = useQueryClient21();
@@ -19787,7 +19858,7 @@ function useBridge() {
19787
19858
  const address = useSession((st) => st.address);
19788
19859
  const { data: walletClient } = useWalletClient();
19789
19860
  const { switchChainAsync } = useSwitchChain();
19790
- const swapDirection = useCallback26(() => {
19861
+ const swapDirection = useCallback27(() => {
19791
19862
  const {
19792
19863
  bridgeStep,
19793
19864
  originChain,
@@ -19839,7 +19910,7 @@ function useBridge() {
19839
19910
  useFlowSelectorStore.getState().setError(error instanceof Error ? error.message : String(error));
19840
19911
  }
19841
19912
  });
19842
- const handleQuoteEstimation = useCallback26((amnt) => {
19913
+ const handleQuoteEstimation = useCallback27((amnt) => {
19843
19914
  const { originChain, destinationChain, bridgeSender } = useBridgeStore.getState();
19844
19915
  if (!amnt || !Number(amnt)) {
19845
19916
  useBridgeStore.getState().setQuote(null);
@@ -19983,7 +20054,7 @@ var init_useBridge = __esm({
19983
20054
 
19984
20055
  // src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneRoutes.ts
19985
20056
  import { useQuery as useQuery19 } from "@tanstack/react-query";
19986
- import { useEffect as useEffect35 } from "react";
20057
+ import { useEffect as useEffect36 } from "react";
19987
20058
  function useHyperlaneRoutes() {
19988
20059
  const address = useSession((st) => st.address);
19989
20060
  const page = useLayoutDataStore((st) => st.page);
@@ -20003,7 +20074,7 @@ function useHyperlaneRoutes() {
20003
20074
  return warpRoutes;
20004
20075
  }
20005
20076
  });
20006
- useEffect35(() => {
20077
+ useEffect36(() => {
20007
20078
  if (!errorWarpRoutes) return;
20008
20079
  useFlowSelectorStore.getState().setError(errorWarpRoutes.message);
20009
20080
  const { resetSelections, setRecipient, setOriginChain, setDestinationChain } = useBridgeStore.getState();
@@ -20012,7 +20083,7 @@ function useHyperlaneRoutes() {
20012
20083
  setOriginChain(null);
20013
20084
  setDestinationChain(null);
20014
20085
  }, [errorWarpRoutes]);
20015
- useEffect35(() => {
20086
+ useEffect36(() => {
20016
20087
  if (!!hyperRoute || !hyperlaneWarpRoutes.length) return;
20017
20088
  const warpRouteToAutoSelect = hyperlaneWarpRoutes.find((route) => route.routeId === hyperRoute);
20018
20089
  if (!warpRouteToAutoSelect) return;
@@ -20045,13 +20116,13 @@ var init_useHyperlaneRoutes = __esm({
20045
20116
  });
20046
20117
 
20047
20118
  // src/internal/components/SendMenu/hyperbridge/hooks/useMenuTitle.ts
20048
- import { useEffect as useEffect36 } from "react";
20119
+ import { useEffect as useEffect37 } from "react";
20049
20120
  function useMenuTitle(warpRoutes) {
20050
20121
  const { t } = useT();
20051
20122
  const bridgeStep = useBridgeStore((st) => st.bridgeStep);
20052
20123
  const hyperRoute = useBridgeStore((st) => st.hyperRoute);
20053
20124
  const hyperRouteMeta = warpRoutes?.length ? warpRoutes.find((route) => route.routeId === hyperRoute) : null;
20054
- useEffect36(() => {
20125
+ useEffect37(() => {
20055
20126
  const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
20056
20127
  switch (true) {
20057
20128
  case bridgeStep === "sender-selector":
@@ -20103,7 +20174,7 @@ var init_ResolveChainIcon = __esm({
20103
20174
  // src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts
20104
20175
  import { CHAINS_BROWSERS_TRANSPORTS as CHAINS_BROWSERS_TRANSPORTS2 } from "@embarkai/core";
20105
20176
  import { useQuery as useQuery20, useQueryClient as useQueryClient22 } from "@tanstack/react-query";
20106
- import { useCallback as useCallback27, useEffect as useEffect37 } from "react";
20177
+ import { useCallback as useCallback28, useEffect as useEffect38 } from "react";
20107
20178
  import { createPublicClient as createPublicClient2, erc20Abi as erc20Abi2, formatUnits as formatUnits7, http as http3 } from "viem";
20108
20179
  import { useSwitchChain as useSwitchChain2 } from "wagmi";
20109
20180
  function checkWrapedTokenSymbol2(symbol) {
@@ -20198,7 +20269,7 @@ function useBridgeBalance(hyperlaneWarpRoutes) {
20198
20269
  };
20199
20270
  }
20200
20271
  });
20201
- const refreshRouteTokenBalance = useCallback27(
20272
+ const refreshRouteTokenBalance = useCallback28(
20202
20273
  (senderWallet) => {
20203
20274
  switch (true) {
20204
20275
  case senderWallet === "embarkai-wallet":
@@ -20214,7 +20285,7 @@ function useBridgeBalance(hyperlaneWarpRoutes) {
20214
20285
  },
20215
20286
  [refreshBalances, qc]
20216
20287
  );
20217
- useEffect37(() => {
20288
+ useEffect38(() => {
20218
20289
  if (!bridgeSender || !originChain) return;
20219
20290
  switch (bridgeSender) {
20220
20291
  case "embarkai-wallet":
@@ -21170,7 +21241,7 @@ var init_steps = __esm({
21170
21241
  });
21171
21242
 
21172
21243
  // src/internal/components/SendMenu/hyperbridge/HyperlaneBridge.tsx
21173
- import { useEffect as useEffect38 } from "react";
21244
+ import { useEffect as useEffect39 } from "react";
21174
21245
  import { Fragment as Fragment38, jsx as jsx102, jsxs as jsxs94 } from "react/jsx-runtime";
21175
21246
  function HyperlaneBridge() {
21176
21247
  const bridgeStep = useBridgeStore((st) => st.bridgeStep);
@@ -21178,7 +21249,7 @@ function HyperlaneBridge() {
21178
21249
  const { hyperlaneWarpRoutes, isLoadingWarpRoutes } = useHyperlaneRoutes();
21179
21250
  const { directWalletProfile } = useAvailableSenders();
21180
21251
  useMenuTitle(hyperlaneWarpRoutes);
21181
- useEffect38(() => {
21252
+ useEffect39(() => {
21182
21253
  return () => {
21183
21254
  useBridgeStore.getState().resetSelections();
21184
21255
  };
@@ -21224,14 +21295,14 @@ var init_HyperlaneBridge = __esm({
21224
21295
  });
21225
21296
 
21226
21297
  // src/internal/components/SendMenu/hyperbridge/components/HistorySwitch.tsx
21227
- import { useRef as useRef18 } from "react";
21298
+ import { useRef as useRef19 } from "react";
21228
21299
  import { jsx as jsx103 } from "react/jsx-runtime";
21229
21300
  function BridgeHistorySwitch(props) {
21230
21301
  const { disabled } = props;
21231
21302
  const selectorFlow = useFlowSelectorStore((st) => st.flow);
21232
21303
  const isUiLocked = useFlowSelectorStore((st) => st.isUiLocked);
21233
21304
  const bridgeStep = useBridgeStore((st) => st.bridgeStep);
21234
- const lastBridgeStepRef = useRef18(null);
21305
+ const lastBridgeStepRef = useRef19(null);
21235
21306
  if (selectorFlow !== "bridge" || bridgeStep === "confirm" || bridgeStep === "success" || bridgeStep === "sender-selector" || bridgeStep === "select-token" || bridgeStep === "tx-history-details") {
21236
21307
  return null;
21237
21308
  }
@@ -21333,7 +21404,7 @@ var init_useErc3643Compliance = __esm({
21333
21404
 
21334
21405
  // src/hooks/useNicknameResolve.ts
21335
21406
  import { useQuery as useQuery21 } from "@tanstack/react-query";
21336
- import { useEffect as useEffect39, useMemo as useMemo14, useState as useState28 } from "react";
21407
+ import { useEffect as useEffect40, useMemo as useMemo14, useState as useState28 } from "react";
21337
21408
  function looksLikeNickname(input) {
21338
21409
  if (!input) return false;
21339
21410
  if (input.startsWith("0x")) return false;
@@ -21347,7 +21418,7 @@ function useNicknameResolve(input, options) {
21347
21418
  const [isDebouncing, setIsDebouncing] = useState28(false);
21348
21419
  const normalized = normalizeNickname(input);
21349
21420
  const isNicknameInput = looksLikeNickname(input) && normalized.length >= 3;
21350
- useEffect39(() => {
21421
+ useEffect40(() => {
21351
21422
  if (!isNicknameInput || !enabled) {
21352
21423
  setDebouncedInput("");
21353
21424
  setIsDebouncing(false);
@@ -21407,7 +21478,7 @@ var init_useNicknameResolve = __esm({
21407
21478
  });
21408
21479
 
21409
21480
  // src/hooks/useSendTransaction.ts
21410
- import { useCallback as useCallback28, useState as useState29 } from "react";
21481
+ import { useCallback as useCallback29, useState as useState29 } from "react";
21411
21482
  import { encodeFunctionData as encodeFunctionData2, isAddress, parseEther as parseEther2, parseUnits } from "viem";
21412
21483
  function useSendTransaction() {
21413
21484
  const session = useSession((st) => st.session);
@@ -21415,7 +21486,7 @@ function useSendTransaction() {
21415
21486
  const [isLoading, setIsLoading] = useState29(false);
21416
21487
  const [error, setError] = useState29(null);
21417
21488
  const [userOpHash, setUserOpHash] = useState29(null);
21418
- const sendTransaction = useCallback28(
21489
+ const sendTransaction = useCallback29(
21419
21490
  async (params) => {
21420
21491
  if (!session || !address) {
21421
21492
  setError("No active session");
@@ -21512,7 +21583,7 @@ function useSendTransaction() {
21512
21583
  },
21513
21584
  [session, address]
21514
21585
  );
21515
- const reset = useCallback28(() => {
21586
+ const reset = useCallback29(() => {
21516
21587
  setError(null);
21517
21588
  setUserOpHash(null);
21518
21589
  setIsLoading(false);
@@ -21846,7 +21917,7 @@ var init_AssetList = __esm({
21846
21917
 
21847
21918
  // src/internal/components/SendMenu/send/components/NicknameData.tsx
21848
21919
  import { AtSign as AtSign2, CheckCircle2 as CheckCircle24, ShieldAlert, ShieldCheck as ShieldCheck2 } from "lucide-react";
21849
- import { useEffect as useEffect40 } from "react";
21920
+ import { useEffect as useEffect41 } from "react";
21850
21921
  import { jsx as jsx107, jsxs as jsxs98 } from "react/jsx-runtime";
21851
21922
  function NicknameData(props) {
21852
21923
  const { resolvedNicknameData, isNicknameInput } = props;
@@ -21859,11 +21930,11 @@ function NicknameData(props) {
21859
21930
  isWalletNotSetup,
21860
21931
  isFrozen
21861
21932
  } = resolvedNicknameData;
21862
- useEffect40(() => {
21933
+ useEffect41(() => {
21863
21934
  if (!resolvedNicknameData?.data?.fingerprint || !isNicknameInput) return;
21864
21935
  useFlowSelectorStore.getState().setRenderKey(`nickname-resolved-${Date.now()}`);
21865
21936
  }, [resolvedNicknameData, isNicknameInput]);
21866
- useEffect40(() => {
21937
+ useEffect41(() => {
21867
21938
  if (isResolving) return;
21868
21939
  let errMessage = null;
21869
21940
  switch (true) {
@@ -22153,7 +22224,7 @@ var init_InputSendStep = __esm({
22153
22224
 
22154
22225
  // src/internal/components/SendMenu/send/sendSteps/ConfirmSendStep.tsx
22155
22226
  import { useMutation as useMutation20 } from "@tanstack/react-query";
22156
- import { AlertTriangle as AlertTriangle6, AtSign as AtSign4, Loader as Loader29, Shield as Shield2, ShieldAlert as ShieldAlert2, ShieldCheck as ShieldCheck3 } from "lucide-react";
22227
+ import { AlertTriangle as AlertTriangle5, AtSign as AtSign4, Loader as Loader29, Shield as Shield2, ShieldAlert as ShieldAlert2, ShieldCheck as ShieldCheck3 } from "lucide-react";
22157
22228
  import { Fragment as Fragment41, jsx as jsx109, jsxs as jsxs100 } from "react/jsx-runtime";
22158
22229
  function ConfirmSendStep(props) {
22159
22230
  const { sendTransaction, erc3643Compliance, isNicknameInput, resolvedNicknameData } = props;
@@ -22193,7 +22264,7 @@ function ConfirmSendStep(props) {
22193
22264
  });
22194
22265
  return /* @__PURE__ */ jsxs100(Fragment41, { children: [
22195
22266
  isNicknameInput && isFrozen && /* @__PURE__ */ jsxs100(Highlight, { type: "warning", className: "flex gap-[var(--ui-kit-gap)]", children: [
22196
- /* @__PURE__ */ jsx109(AlertTriangle6, { className: "h-4 w-4" }),
22267
+ /* @__PURE__ */ jsx109(AlertTriangle5, { className: "h-4 w-4" }),
22197
22268
  /* @__PURE__ */ jsx109("span", { children: "This handle is frozen. Proceed with caution." })
22198
22269
  ] }),
22199
22270
  isSecurity && erc3643CanTransfer && /* @__PURE__ */ jsxs100(Highlight, { type: "success", className: "flex gap-[var(--ui-kit-gap)]", children: [
@@ -22344,7 +22415,7 @@ var init_sendSteps = __esm({
22344
22415
 
22345
22416
  // src/internal/components/SendMenu/send/SendMenu.tsx
22346
22417
  import { CheckCircle2 as CheckCircle26, Loader as Loader30 } from "lucide-react";
22347
- import { useEffect as useEffect41, useMemo as useMemo15 } from "react";
22418
+ import { useEffect as useEffect42, useMemo as useMemo15 } from "react";
22348
22419
  import { parseUnits as parseUnits2 } from "viem";
22349
22420
  import { Fragment as Fragment42, jsx as jsx110, jsxs as jsxs101 } from "react/jsx-runtime";
22350
22421
  function SendMenu() {
@@ -22366,10 +22437,10 @@ function SendMenu() {
22366
22437
  userOpHash,
22367
22438
  reset
22368
22439
  } = useSendTransaction();
22369
- useEffect41(() => {
22440
+ useEffect42(() => {
22370
22441
  useFlowSelectorStore.getState().setIsUiLocked(isAssetsLoading || isTransactionPending);
22371
22442
  }, [isAssetsLoading, isTransactionPending]);
22372
- useEffect41(() => {
22443
+ useEffect42(() => {
22373
22444
  useFlowSelectorStore.getState().setError(sendTransactionError || null);
22374
22445
  }, [sendTransactionError]);
22375
22446
  const {
@@ -22384,7 +22455,7 @@ function SendMenu() {
22384
22455
  } = useSendStore();
22385
22456
  const isNft = isNftAsset3(selectedAsset);
22386
22457
  const isSecurity = isSecurityToken2(selectedAsset);
22387
- useEffect41(
22458
+ useEffect42(
22388
22459
  () => () => {
22389
22460
  setSelectedAsset(null);
22390
22461
  setRecipient("");
@@ -22394,7 +22465,7 @@ function SendMenu() {
22394
22465
  },
22395
22466
  []
22396
22467
  );
22397
- useEffect41(() => {
22468
+ useEffect42(() => {
22398
22469
  const shouldNativeDefaultAsset = assets.length > 0 && !selectedAsset;
22399
22470
  if (!shouldNativeDefaultAsset) return;
22400
22471
  const chainNativeCurrency = useSession.getState().chainConfig?.nativeCurrency;
@@ -22422,7 +22493,7 @@ function SendMenu() {
22422
22493
  enabled: isSecurity && !!effectiveAddress && !!complianceAmount,
22423
22494
  chainId: activeChainId
22424
22495
  });
22425
- useEffect41(() => {
22496
+ useEffect42(() => {
22426
22497
  const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
22427
22498
  switch (true) {
22428
22499
  case txStep === "select-asset":
@@ -22513,7 +22584,7 @@ var init_send = __esm({
22513
22584
 
22514
22585
  // src/internal/components/SendMenu/SendFlowSelector.tsx
22515
22586
  import { ArrowLeft as ArrowLeft19, ArrowRightIcon as ArrowRightIcon2, ArrowRightLeftIcon as ArrowRightLeftIcon2, InfoIcon as InfoIcon5 } from "lucide-react";
22516
- import { useEffect as useEffect42 } from "react";
22587
+ import { useEffect as useEffect43 } from "react";
22517
22588
  import { jsx as jsx111, jsxs as jsxs102 } from "react/jsx-runtime";
22518
22589
  function SelectorFlowButtons() {
22519
22590
  const { t } = useT();
@@ -22576,7 +22647,7 @@ function SendFlowSelector() {
22576
22647
  const error = useFlowSelectorStore((st) => st.error);
22577
22648
  const menuTitle = useFlowSelectorStore((st) => st.menuTitle);
22578
22649
  const selectorFlow = useFlowSelectorStore((st) => st.flow);
22579
- useEffect42(
22650
+ useEffect43(
22580
22651
  () => () => {
22581
22652
  useFlowSelectorStore.getState().setError(null);
22582
22653
  },
@@ -22742,7 +22813,7 @@ var init_constants6 = __esm({
22742
22813
  // src/internal/components/SettingsMenu/SettingsMenu.tsx
22743
22814
  import { useQuery as useQuery22 } from "@tanstack/react-query";
22744
22815
  import { ArrowLeft as ArrowLeft20, HardDrive as HardDrive3 } from "lucide-react";
22745
- import { useEffect as useEffect43 } from "react";
22816
+ import { useEffect as useEffect44 } from "react";
22746
22817
  import { jsx as jsx112, jsxs as jsxs103 } from "react/jsx-runtime";
22747
22818
  function useSettingsButtons() {
22748
22819
  const config = useProviderConfig().config;
@@ -22761,7 +22832,7 @@ function useSettingsButtons() {
22761
22832
  if (proMode) {
22762
22833
  settingsButtons.push({ id: "devices" /* DEVICES */, name: "Guardians", Icon: HardDrive3 });
22763
22834
  }
22764
- useEffect43(() => {
22835
+ useEffect44(() => {
22765
22836
  const cssvEl = document.querySelector(".embarkai-ui-scope");
22766
22837
  if (!cssvEl || !window?.getComputedStyle) {
22767
22838
  return;
@@ -23700,7 +23771,7 @@ var init_TransactionsGroup = __esm({
23700
23771
  // src/internal/components/TransactionsMenu/TransactionsMenu.tsx
23701
23772
  import { useQuery as useQuery23, useQueryClient as useQueryClient24 } from "@tanstack/react-query";
23702
23773
  import { ArrowLeft as ArrowLeft22, Loader as Loader31, RefreshCw as RefreshCw3, XCircle } from "lucide-react";
23703
- import { useCallback as useCallback29, useState as useState31 } from "react";
23774
+ import { useCallback as useCallback30, useState as useState31 } from "react";
23704
23775
  import { jsx as jsx115, jsxs as jsxs106 } from "react/jsx-runtime";
23705
23776
  function TransactionsMenu() {
23706
23777
  const qc = useQueryClient24();
@@ -23722,7 +23793,7 @@ function TransactionsMenu() {
23722
23793
  queryKey: [TRANSACTIONS_HISTORY_QUERY_KEY, chainConfig.id, address],
23723
23794
  queryFn: () => getTransactionsListQuery({ address, chainConfig })
23724
23795
  });
23725
- const refreshTxHistory = useCallback29(
23796
+ const refreshTxHistory = useCallback30(
23726
23797
  () => qc.invalidateQueries({ queryKey: [TRANSACTIONS_HISTORY_QUERY_KEY, chainConfig.id, address] }),
23727
23798
  [qc, chainConfig.id, address]
23728
23799
  );
@@ -23961,7 +24032,7 @@ var init_PageMap = __esm({
23961
24032
  });
23962
24033
 
23963
24034
  // src/internal/hooks/usePageMapper.tsx
23964
- import { useCallback as useCallback30, useEffect as useEffect44 } from "react";
24035
+ import { useCallback as useCallback31, useEffect as useEffect45 } from "react";
23965
24036
  import { jsx as jsx116 } from "react/jsx-runtime";
23966
24037
  function usePageMapper() {
23967
24038
  const page = useLayoutDataStore((st) => st.page);
@@ -23973,7 +24044,7 @@ function usePageMapper() {
23973
24044
  setIsDialogOpen,
23974
24045
  setIsDialogClosing
23975
24046
  } = useLayoutStore();
23976
- const closeDialog = useCallback30(() => {
24047
+ const closeDialog = useCallback31(() => {
23977
24048
  setIsDialogClosing(true);
23978
24049
  setTimeout(() => {
23979
24050
  setDialogContent(null);
@@ -23984,7 +24055,7 @@ function usePageMapper() {
23984
24055
  setIsDialogOpen(false);
23985
24056
  }, CLEAR_DIALOG_TIMEOUT);
23986
24057
  }, [setDialogContent, setDialogDescription, setDialogTitle, setIsDialogForced, setIsDialogOpen, setIsDialogClosing]);
23987
- const openDialog = useCallback30(
24058
+ const openDialog = useCallback31(
23988
24059
  (pageItem) => {
23989
24060
  const PageContentComponent = pageItem.component;
23990
24061
  setDialogTitle(pageItem.title);
@@ -23994,7 +24065,7 @@ function usePageMapper() {
23994
24065
  },
23995
24066
  [setDialogContent, setDialogDescription, setDialogTitle, setIsDialogOpen]
23996
24067
  );
23997
- useEffect44(() => {
24068
+ useEffect45(() => {
23998
24069
  if (page === null) return closeDialog();
23999
24070
  const pageItem = PAGE_MAP[page];
24000
24071
  if (!pageItem) {
@@ -24018,7 +24089,7 @@ var init_usePageMapper = __esm({
24018
24089
 
24019
24090
  // src/internal/hooks/useSettingsNotifications.ts
24020
24091
  import { useQuery as useQuery24 } from "@tanstack/react-query";
24021
- import { useEffect as useEffect45 } from "react";
24092
+ import { useEffect as useEffect46 } from "react";
24022
24093
  function useSettingsNotifications() {
24023
24094
  const address = useSession((st) => st.address);
24024
24095
  const setSettingsNotifications = useLayoutDataStore((st) => st.setSettingsNotifications);
@@ -24030,14 +24101,14 @@ function useSettingsNotifications() {
24030
24101
  queryKey: [QUERY_KEYS.userProfile, address],
24031
24102
  queryFn: getUserProfile
24032
24103
  });
24033
- useEffect45(() => {
24104
+ useEffect46(() => {
24034
24105
  const isKYCVerified = userProfile?.kycDetails?.kycStatus === "verified";
24035
24106
  setSettingsNotifications({
24036
24107
  ...COMPLETE_KYC_PROGRESS,
24037
24108
  status: isKYCVerified ? "resolved" : "active"
24038
24109
  });
24039
24110
  }, [userProfile, setSettingsNotifications]);
24040
- useEffect45(() => {
24111
+ useEffect46(() => {
24041
24112
  setSettingsNotifications({
24042
24113
  ...EMAIL_NOT_CONNECTED_NOTIFICATION,
24043
24114
  status: hasEmail ? "resolved" : "active"
@@ -24070,7 +24141,7 @@ var init_package = __esm({
24070
24141
  "package.json"() {
24071
24142
  package_default = {
24072
24143
  name: "@embarkai/ui-kit",
24073
- version: "0.4.53",
24144
+ version: "0.4.54",
24074
24145
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
24075
24146
  type: "module",
24076
24147
  main: "./dist/index.cjs",
@@ -24307,7 +24378,7 @@ var init_Footer2 = __esm({
24307
24378
  // src/internal/components/Header/Header.tsx
24308
24379
  import { useQuery as useQuery25 } from "@tanstack/react-query";
24309
24380
  import { Copy as Copy5, Loader as Loader33 } from "lucide-react";
24310
- import { useCallback as useCallback31, useRef as useRef19, useState as useState32 } from "react";
24381
+ import { useCallback as useCallback32, useRef as useRef20, useState as useState32 } from "react";
24311
24382
  import { Fragment as Fragment44, jsx as jsx118, jsxs as jsxs108 } from "react/jsx-runtime";
24312
24383
  function formatAddress2(addr) {
24313
24384
  if (!addr) return "";
@@ -24321,9 +24392,9 @@ function Header() {
24321
24392
  const proMode = useProMode();
24322
24393
  const [proToast, setProToast] = useState32(false);
24323
24394
  const [copied, setCopied] = useState32(false);
24324
- const clickCountRef = useRef19(0);
24325
- const clickTimerRef = useRef19(null);
24326
- const handleAvatarClick = useCallback31(() => {
24395
+ const clickCountRef = useRef20(0);
24396
+ const clickTimerRef = useRef20(null);
24397
+ const handleAvatarClick = useCallback32(() => {
24327
24398
  clickCountRef.current += 1;
24328
24399
  if (clickTimerRef.current) {
24329
24400
  clearTimeout(clickTimerRef.current);
@@ -24625,7 +24696,7 @@ var init_visually_hidden = __esm({
24625
24696
 
24626
24697
  // src/internal/components/Dialog/Dialog.tsx
24627
24698
  import { AnimatePresence, motion } from "framer-motion";
24628
- import { useEffect as useEffect46 } from "react";
24699
+ import { useEffect as useEffect47 } from "react";
24629
24700
  import { jsx as jsx121, jsxs as jsxs110 } from "react/jsx-runtime";
24630
24701
  function Dialog2() {
24631
24702
  const config = useProviderConfig().config;
@@ -24637,7 +24708,7 @@ function Dialog2() {
24637
24708
  const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
24638
24709
  const setPage = useLayoutDataStore((st) => st.setPage);
24639
24710
  const { colorMode, isDialogOpen, dialogTitle, dialogDescription, dialogContent, isDialogForced, setIsSettings } = useLayoutStore();
24640
- useEffect46(() => setIsSettings(!!session), [session, setIsSettings]);
24711
+ useEffect47(() => setIsSettings(!!session), [session, setIsSettings]);
24641
24712
  usePageMapper();
24642
24713
  useAutoConnect();
24643
24714
  useBackupStatusChanges();
@@ -24703,7 +24774,7 @@ var init_Dialog2 = __esm({
24703
24774
  });
24704
24775
 
24705
24776
  // src/internal/components/TssManager.tsx
24706
- import React26, { useCallback as useCallback32 } from "react";
24777
+ import React26, { useCallback as useCallback33 } from "react";
24707
24778
  var TssManagerWithRef;
24708
24779
  var init_TssManager = __esm({
24709
24780
  "src/internal/components/TssManager.tsx"() {
@@ -24718,7 +24789,7 @@ var init_TssManager = __esm({
24718
24789
  const setStatus = useSession((st) => st.setStatus);
24719
24790
  const setSession = useSession((st) => st.setSession);
24720
24791
  const setAddress = useSession((st) => st.setAddress);
24721
- const onSessionCreated = useCallback32(
24792
+ const onSessionCreated = useCallback33(
24722
24793
  (session, address) => {
24723
24794
  setSession(session);
24724
24795
  setAddress(address);
@@ -24759,7 +24830,7 @@ var init_TssManager = __esm({
24759
24830
  // src/internal/components/WalletConnectHandler.tsx
24760
24831
  import { useConnectModal as useConnectModal2 } from "@rainbow-me/rainbowkit";
24761
24832
  import { useMutation as useMutation22, useQueryClient as useQueryClient26 } from "@tanstack/react-query";
24762
- import React27, { useCallback as useCallback33, useEffect as useEffect47 } from "react";
24833
+ import React27, { useCallback as useCallback34, useEffect as useEffect48 } from "react";
24763
24834
  import { useAccount, useDisconnect as useDisconnect4, useSignMessage as useSignMessage2 } from "wagmi";
24764
24835
  function WalletConnectHandler() {
24765
24836
  const qc = useQueryClient26();
@@ -24782,7 +24853,7 @@ function WalletConnectHandler() {
24782
24853
  const projectId = providerConfig?.projectId;
24783
24854
  const setExternalWallet = useExternalWalletStore((st) => st.setExternalWallet);
24784
24855
  const setPendingWalletLogin = useLayoutDataStore((st) => st.setPendingWalletLogin);
24785
- const onLinkingComplete = useCallback33(
24856
+ const onLinkingComplete = useCallback34(
24786
24857
  async (success) => {
24787
24858
  setIsWalletLinking(false);
24788
24859
  if (!success && !passportWalletAddress) {
@@ -24814,7 +24885,7 @@ function WalletConnectHandler() {
24814
24885
  const [hasStartedLinking, setHasStartedLinking] = React27.useState(false);
24815
24886
  const [modalWasOpened, setModalWasOpened] = React27.useState(false);
24816
24887
  const [pendingModalOpen, setPendingModalOpen] = React27.useState(false);
24817
- useEffect47(() => {
24888
+ useEffect48(() => {
24818
24889
  if (isWalletLinking && !hasStartedLinking) {
24819
24890
  console.log("[WalletConnectHandler] Starting wallet link flow:", {
24820
24891
  isConnected,
@@ -24852,18 +24923,18 @@ function WalletConnectHandler() {
24852
24923
  setProviderType,
24853
24924
  walletMode
24854
24925
  ]);
24855
- useEffect47(() => {
24926
+ useEffect48(() => {
24856
24927
  if (pendingModalOpen && !isConnected && openConnectModal) {
24857
24928
  setPendingModalOpen(false);
24858
24929
  openConnectModal();
24859
24930
  }
24860
24931
  }, [pendingModalOpen, isConnected, openConnectModal]);
24861
- useEffect47(() => {
24932
+ useEffect48(() => {
24862
24933
  if (connectModalOpen && hasStartedLinking) {
24863
24934
  setModalWasOpened(true);
24864
24935
  }
24865
24936
  }, [connectModalOpen, hasStartedLinking]);
24866
- useEffect47(() => {
24937
+ useEffect48(() => {
24867
24938
  if (modalWasOpened && !connectModalOpen && !isConnected && isWalletLinking) {
24868
24939
  console.log("[WalletConnectHandler] Modal closed without connecting");
24869
24940
  onLinkingComplete(false);
@@ -24871,7 +24942,7 @@ function WalletConnectHandler() {
24871
24942
  setModalWasOpened(false);
24872
24943
  }
24873
24944
  }, [connectModalOpen, modalWasOpened, isConnected, isWalletLinking]);
24874
- useEffect47(() => {
24945
+ useEffect48(() => {
24875
24946
  if (isWalletLinking) {
24876
24947
  const timeout = setTimeout(() => {
24877
24948
  console.warn("[WalletConnectHandler] Wallet linking timed out, resetting state");
@@ -24991,7 +25062,7 @@ function WalletConnectHandler() {
24991
25062
  setPage(passportWalletAddress ? "manage-wallet" /* MANAGE_WALLET */ : "auth" /* AUTH */);
24992
25063
  }
24993
25064
  });
24994
- useEffect47(() => {
25065
+ useEffect48(() => {
24995
25066
  if (!!chain?.id && isConnected && walletAddress && isWalletLinking && hasStartedLinking && modalWasOpened && !pendingModalOpen) {
24996
25067
  console.log("[WalletConnectHandler] handleWalletSign triggered");
24997
25068
  if (!passportWalletAddress) {
@@ -25001,7 +25072,7 @@ function WalletConnectHandler() {
25001
25072
  handleWalletSign({ chainId: chain.id, signingWalletAddress: walletAddress });
25002
25073
  }
25003
25074
  }, [chain, isConnected, walletAddress, isWalletLinking, hasStartedLinking, modalWasOpened, pendingModalOpen]);
25004
- useEffect47(() => {
25075
+ useEffect48(() => {
25005
25076
  if (isConnected && !chain?.id && isWalletLinking && hasStartedLinking && !connectModalOpen && !isWalletSigning) {
25006
25077
  const timeout = setTimeout(() => {
25007
25078
  console.warn("[WalletConnectHandler] Wallet connected but chain info missing, resetting");
@@ -25037,7 +25108,7 @@ var init_WalletConnectHandler = __esm({
25037
25108
  });
25038
25109
 
25039
25110
  // src/internal/components/DirectWalletHandler.tsx
25040
- import { useEffect as useEffect48 } from "react";
25111
+ import { useEffect as useEffect49 } from "react";
25041
25112
  import { useAccount as useAccount2 } from "wagmi";
25042
25113
  function DirectWalletHandler() {
25043
25114
  const walletMode = useProviderConfig().config.current?.wallet?.mode || "linked";
@@ -25049,13 +25120,13 @@ function DirectWalletHandler() {
25049
25120
  const setExternalChainId = useExternalWalletStore((st) => st.setExternalChainId);
25050
25121
  const setConfigMode = useExternalWalletStore((st) => st.setConfigMode);
25051
25122
  const setActiveMode = useExternalWalletStore((st) => st.setActiveMode);
25052
- useEffect48(() => {
25123
+ useEffect49(() => {
25053
25124
  setConfigMode(walletMode);
25054
25125
  if (walletMode !== "both") {
25055
25126
  setActiveMode(walletMode);
25056
25127
  }
25057
25128
  }, [walletMode, setConfigMode, setActiveMode]);
25058
- useEffect48(() => {
25129
+ useEffect49(() => {
25059
25130
  if (isConnected && address && !isExternalConnected && connector && chain?.id) {
25060
25131
  setExternalWallet({
25061
25132
  address,
@@ -25064,17 +25135,17 @@ function DirectWalletHandler() {
25064
25135
  });
25065
25136
  }
25066
25137
  }, [isConnected, address, isExternalConnected, connector, chain?.id, setExternalWallet]);
25067
- useEffect48(() => {
25138
+ useEffect49(() => {
25068
25139
  if (isExternalConnected && !isConnected) {
25069
25140
  clearExternalWallet();
25070
25141
  }
25071
25142
  }, [isConnected, isExternalConnected, clearExternalWallet]);
25072
- useEffect48(() => {
25143
+ useEffect49(() => {
25073
25144
  if (isExternalConnected && isConnected && chain?.id) {
25074
25145
  setExternalChainId(chain.id);
25075
25146
  }
25076
25147
  }, [chain?.id, isConnected, isExternalConnected, setExternalChainId]);
25077
- useEffect48(() => {
25148
+ useEffect49(() => {
25078
25149
  if (isExternalConnected && isConnected && address && address !== externalAddress && connector && chain?.id) {
25079
25150
  setExternalWallet({
25080
25151
  address,
@@ -27901,11 +27972,11 @@ import { initSdkErrorTracking } from "@embarkai/core/internal/error-tracking";
27901
27972
  import { merge as merge3 } from "lodash-es";
27902
27973
  import {
27903
27974
  createContext,
27904
- useCallback as useCallback34,
27975
+ useCallback as useCallback35,
27905
27976
  useContext,
27906
- useEffect as useEffect49,
27977
+ useEffect as useEffect50,
27907
27978
  useMemo as useMemo17,
27908
- useRef as useRef20
27979
+ useRef as useRef21
27909
27980
  } from "react";
27910
27981
  import { jsx as jsx125 } from "react/jsx-runtime";
27911
27982
  function clearLegacyWagmiStorage() {
@@ -27925,10 +27996,10 @@ function clearLegacyWagmiStorage() {
27925
27996
  }
27926
27997
  function Provider(props) {
27927
27998
  const { children, projectId, initialConfig = {}, callbacks } = props;
27928
- const callbacksRef = useRef20(callbacks);
27929
- useEffect49(() => notifyNoProjetctId(projectId), [projectId]);
27930
- const config = useRef20(merge3({}, DEFAULT_PROVIDER_CONFIG, { projectId }, initialConfig));
27931
- const updateConfig = useCallback34((updates) => {
27999
+ const callbacksRef = useRef21(callbacks);
28000
+ useEffect50(() => notifyNoProjetctId(projectId), [projectId]);
28001
+ const config = useRef21(merge3({}, DEFAULT_PROVIDER_CONFIG, { projectId }, initialConfig));
28002
+ const updateConfig = useCallback35((updates) => {
27932
28003
  const prev = config.current;
27933
28004
  const next = { ...prev };
27934
28005
  if (updates.projectId !== void 0) next.projectId = updates.projectId;
@@ -27962,12 +28033,12 @@ function Provider(props) {
27962
28033
  if (updates.translations) next.translations = { ...next.translations, ...updates.translations };
27963
28034
  config.current = next;
27964
28035
  }, []);
27965
- const updateCallbacks = useCallback34((updates) => {
28036
+ const updateCallbacks = useCallback35((updates) => {
27966
28037
  const prev = callbacksRef.current;
27967
28038
  const next = updates ? { ...prev, ...updates } : void 0;
27968
28039
  callbacksRef.current = next;
27969
28040
  }, []);
27970
- useEffect49(() => {
28041
+ useEffect50(() => {
27971
28042
  if (typeof window === "undefined" || !projectId) return;
27972
28043
  const mergedConfig = merge3(DEFAULT_PROVIDER_CONFIG, initialConfig);
27973
28044
  updateConfig(mergedConfig);
@@ -27987,7 +28058,7 @@ function Provider(props) {
27987
28058
  useSession.getState().setActiveChainId(mergedConfig.network.chainId);
27988
28059
  }
27989
28060
  }, [projectId, initialConfig]);
27990
- useEffect49(() => {
28061
+ useEffect50(() => {
27991
28062
  if (typeof window === "undefined" || !projectId) return;
27992
28063
  try {
27993
28064
  initSdkErrorTracking();
@@ -28077,7 +28148,7 @@ init_pro_mode();
28077
28148
  init_utils2();
28078
28149
  import { useQuery as useQuery26 } from "@tanstack/react-query";
28079
28150
  import { Cloud as Cloud4, Laptop as Laptop2, Loader as Loader34, Shield as Shield3 } from "lucide-react";
28080
- import { useEffect as useEffect50, useMemo as useMemo18 } from "react";
28151
+ import { useEffect as useEffect51, useMemo as useMemo18 } from "react";
28081
28152
  import { Fragment as Fragment47, jsx as jsx126, jsxs as jsxs112 } from "react/jsx-runtime";
28082
28153
  function getFormattedStatus(label, status, showStatus) {
28083
28154
  const isStatus = showStatus && status && status !== "idle" && status !== "ready";
@@ -28097,7 +28168,7 @@ function ConnectWalletButton(props) {
28097
28168
  const colorMode = useLayoutStore((st) => st.colorMode);
28098
28169
  const { session, address, hasServerVault, isLoading, isIframeReady, status, setUsePaymaster } = useSession();
28099
28170
  const connectButtonLabel = getFormattedStatus(label || "Connect", status, isIframeReady);
28100
- useEffect50(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
28171
+ useEffect51(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
28101
28172
  const { data: profile, isLoading: isProfileLoading } = useQuery26({
28102
28173
  retry: false,
28103
28174
  enabled: !!address,
@@ -28289,29 +28360,8 @@ var useHasServerVault = () => useSession((st) => st.hasServerVault);
28289
28360
  var useActiveChainId = () => useSession((st) => st.activeChainId);
28290
28361
  var useHydrated = () => useSession((st) => st.hasHydrated);
28291
28362
 
28292
- // src/hooks/useOpenPage.ts
28293
- init_SessionContext();
28294
- init_useLayoutDataStore();
28295
- import { useCallback as useCallback35 } from "react";
28296
- function useOpenPage() {
28297
- const page = useLayoutDataStore((st) => st.page);
28298
- const setPage = useLayoutDataStore((st) => st.setPage);
28299
- const setPageParams = useLayoutDataStore((st) => st.setPageParams);
28300
- const address = useSession((st) => st.address);
28301
- const open = useCallback35(
28302
- (passportPage, params) => {
28303
- if (!address) return setPage("auth" /* AUTH */);
28304
- if (!!address && passportPage === "auth" /* AUTH */) return setPage("manage-wallet" /* MANAGE_WALLET */);
28305
- setPage(passportPage);
28306
- if (!!params) setPageParams(params);
28307
- },
28308
- [setPage, setPageParams, address]
28309
- );
28310
- const close = useCallback35(() => setPage(null), [setPage]);
28311
- return { open, close, isOpen: page !== null };
28312
- }
28313
-
28314
28363
  // src/index.ts
28364
+ init_useOpenPage();
28315
28365
  init_useColorMode();
28316
28366
 
28317
28367
  // src/components/ThemeToggle.tsx
@@ -28769,13 +28819,13 @@ var Hash = ({
28769
28819
 
28770
28820
  // src/internal/components/TransactionsMenu/TransactionsList.tsx
28771
28821
  init_base2();
28772
- import { useEffect as useEffect52, useState as useState36 } from "react";
28822
+ import { useEffect as useEffect53, useState as useState36 } from "react";
28773
28823
  import { jsx as jsx132, jsxs as jsxs116 } from "react/jsx-runtime";
28774
28824
  var TransactionsList = ({ address, itemsCount = 10 }) => {
28775
28825
  const [transactions, setTransactions] = useState36([]);
28776
28826
  const [loading, setLoading] = useState36(true);
28777
28827
  const [error, setError] = useState36(null);
28778
- useEffect52(() => {
28828
+ useEffect53(() => {
28779
28829
  const fetchTransactions2 = async () => {
28780
28830
  try {
28781
28831
  setLoading(true);