@swype-org/react-sdk 0.1.183 → 0.1.189

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2324,16 +2324,98 @@ var mascotStyle = {
2324
2324
  width: 28,
2325
2325
  height: 28
2326
2326
  };
2327
- function ScreenHeader({ title, right, onBack, badge }) {
2327
+ function SettingsMenu({ onLogout }) {
2328
+ const { tokens } = useSwypeConfig();
2329
+ const [open, setOpen] = react.useState(false);
2330
+ const menuRef = react.useRef(null);
2331
+ const toggle = react.useCallback(() => setOpen((prev) => !prev), []);
2332
+ react.useEffect(() => {
2333
+ if (!open) return;
2334
+ const handleClickOutside = (e) => {
2335
+ if (menuRef.current && !menuRef.current.contains(e.target)) {
2336
+ setOpen(false);
2337
+ }
2338
+ };
2339
+ document.addEventListener("mousedown", handleClickOutside);
2340
+ return () => document.removeEventListener("mousedown", handleClickOutside);
2341
+ }, [open]);
2342
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: menuRef, style: containerStyle4, children: [
2343
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: toggle, style: triggerStyle(tokens.text), "aria-label": "Settings", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: [
2344
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "5", r: "2", fill: "currentColor" }),
2345
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "2", fill: "currentColor" }),
2346
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "19", r: "2", fill: "currentColor" })
2347
+ ] }) }),
2348
+ open && /* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownStyle(tokens), children: /* @__PURE__ */ jsxRuntime.jsxs(
2349
+ "button",
2350
+ {
2351
+ type: "button",
2352
+ onClick: () => {
2353
+ setOpen(false);
2354
+ onLogout();
2355
+ },
2356
+ style: menuItemStyle(tokens),
2357
+ children: [
2358
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", style: { marginRight: 8, flexShrink: 0 }, children: [
2359
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4", stroke: tokens.error, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
2360
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "16 17 21 12 16 7", stroke: tokens.error, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
2361
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12", stroke: tokens.error, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
2362
+ ] }),
2363
+ "Log out"
2364
+ ]
2365
+ }
2366
+ ) })
2367
+ ] });
2368
+ }
2369
+ var containerStyle4 = {
2370
+ position: "relative"
2371
+ };
2372
+ var triggerStyle = (color) => ({
2373
+ background: "transparent",
2374
+ border: "none",
2375
+ cursor: "pointer",
2376
+ padding: 4,
2377
+ color,
2378
+ display: "flex",
2379
+ alignItems: "center",
2380
+ justifyContent: "center"
2381
+ });
2382
+ var dropdownStyle = (tokens) => ({
2383
+ position: "absolute",
2384
+ right: 0,
2385
+ top: "100%",
2386
+ marginTop: 4,
2387
+ minWidth: 140,
2388
+ background: tokens.bgCard,
2389
+ border: `1px solid ${tokens.border}`,
2390
+ borderRadius: 12,
2391
+ boxShadow: tokens.shadow,
2392
+ zIndex: 100,
2393
+ overflow: "hidden"
2394
+ });
2395
+ var menuItemStyle = (tokens) => ({
2396
+ width: "100%",
2397
+ display: "flex",
2398
+ alignItems: "center",
2399
+ padding: "12px 16px",
2400
+ background: "transparent",
2401
+ border: "none",
2402
+ cursor: "pointer",
2403
+ fontFamily: "inherit",
2404
+ fontSize: "0.85rem",
2405
+ fontWeight: 500,
2406
+ color: tokens.error
2407
+ });
2408
+ function ScreenHeader({ title, right, onBack, badge, onLogout }) {
2328
2409
  const { tokens } = useSwypeConfig();
2329
2410
  const flowPhase = useFlowPhase();
2411
+ const rightContent = onLogout ? /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) : right;
2330
2412
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: headerStyle, children: [
2331
2413
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: leftSlotStyle, children: onBack && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onBack, style: backButtonStyle(tokens.text), "aria-label": "Go back", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 18l-6-6 6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }) }),
2332
2414
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: centerSlotStyle, children: flowPhase ? /* @__PURE__ */ jsxRuntime.jsx(StepProgress, { phase: flowPhase }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2333
2415
  title && /* @__PURE__ */ jsxRuntime.jsx("span", { style: titleStyle(tokens.text), children: title }),
2334
2416
  badge && /* @__PURE__ */ jsxRuntime.jsx("span", { style: badgeStyle(tokens.textMuted), children: badge })
2335
2417
  ] }) }),
2336
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: rightSlotStyle, children: right })
2418
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: rightSlotStyle, children: rightContent })
2337
2419
  ] });
2338
2420
  }
2339
2421
  var headerStyle = {
@@ -2374,7 +2456,7 @@ var badgeStyle = (color) => ({
2374
2456
  });
2375
2457
  function PoweredByFooter() {
2376
2458
  const { tokens } = useSwypeConfig();
2377
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle4(tokens.textMuted), children: [
2459
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle5(tokens.textMuted), children: [
2378
2460
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: rowStyle, children: [
2379
2461
  /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
2380
2462
  "path",
@@ -2388,7 +2470,7 @@ function PoweredByFooter() {
2388
2470
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: pillStyle(tokens.textMuted, tokens.border), children: "Beta Version" })
2389
2471
  ] });
2390
2472
  }
2391
- var containerStyle4 = (color) => ({
2473
+ var containerStyle5 = (color) => ({
2392
2474
  display: "flex",
2393
2475
  flexDirection: "column",
2394
2476
  alignItems: "center",
@@ -2487,12 +2569,12 @@ var defaultIcon = /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "18", height: "
2487
2569
  ) });
2488
2570
  function InfoBanner({ children, icon }) {
2489
2571
  const { tokens } = useSwypeConfig();
2490
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle5(tokens.accent), children: [
2572
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle6(tokens.accent), children: [
2491
2573
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: iconStyle, children: icon ?? defaultIcon }),
2492
2574
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: textStyle, children })
2493
2575
  ] });
2494
2576
  }
2495
- var containerStyle5 = (accent) => ({
2577
+ var containerStyle6 = (accent) => ({
2496
2578
  display: "flex",
2497
2579
  alignItems: "flex-start",
2498
2580
  gap: 10,
@@ -2510,7 +2592,7 @@ var iconStyle = {
2510
2592
  };
2511
2593
  var textStyle = { flex: 1 };
2512
2594
  function WarningBanner({ title, children }) {
2513
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle6, children: [
2595
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle7, children: [
2514
2596
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: headerStyle2, children: [
2515
2597
  /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", style: iconStyle2, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z", fill: "#F57C00" }) }),
2516
2598
  /* @__PURE__ */ jsxRuntime.jsx("strong", { children: title })
@@ -2518,7 +2600,7 @@ function WarningBanner({ title, children }) {
2518
2600
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: bodyStyle2, children })
2519
2601
  ] });
2520
2602
  }
2521
- var containerStyle6 = {
2603
+ var containerStyle7 = {
2522
2604
  padding: "14px 16px",
2523
2605
  background: "#FFF8E1",
2524
2606
  border: "1px solid #FFE082",
@@ -2597,7 +2679,7 @@ function OtpInput({ value, onChange, length = 6, disabled }) {
2597
2679
  onChange(pasted);
2598
2680
  focusInput(Math.min(pasted.length, length - 1));
2599
2681
  }, [onChange, length, focusInput]);
2600
- return /* @__PURE__ */ jsxRuntime.jsx("div", { style: containerStyle7, children: digits.map((digit, i) => /* @__PURE__ */ jsxRuntime.jsx(
2682
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: containerStyle8, children: digits.map((digit, i) => /* @__PURE__ */ jsxRuntime.jsx(
2601
2683
  "input",
2602
2684
  {
2603
2685
  ref: (el) => {
@@ -2618,7 +2700,7 @@ function OtpInput({ value, onChange, length = 6, disabled }) {
2618
2700
  i
2619
2701
  )) });
2620
2702
  }
2621
- var containerStyle7 = {
2703
+ var containerStyle8 = {
2622
2704
  display: "flex",
2623
2705
  gap: 8,
2624
2706
  justifyContent: "center",
@@ -2632,365 +2714,14 @@ var inputStyle = (tokens, filled) => ({
2632
2714
  borderRadius: 12,
2633
2715
  border: `1.5px solid ${filled ? tokens.borderFocus : tokens.border}`,
2634
2716
  background: tokens.bgInput,
2635
- color: tokens.text,
2636
- fontSize: "1.25rem",
2637
- fontWeight: 600,
2638
- fontFamily: "inherit",
2639
- textAlign: "center",
2640
- outline: "none",
2641
- caretColor: tokens.borderFocus,
2642
- transition: "border-color 0.15s ease"
2643
- });
2644
- function SourceCard({
2645
- name,
2646
- address,
2647
- verified,
2648
- accounts,
2649
- selectedAccountId,
2650
- depositAmount,
2651
- onSelectAccount,
2652
- onAuthorizeAccount,
2653
- onAddProvider
2654
- }) {
2655
- const { tokens } = useSwypeConfig();
2656
- const [open, setOpen] = react.useState(false);
2657
- const containerRef = react.useRef(null);
2658
- const hasDropdown = accounts != null && accounts.length > 0;
2659
- react.useEffect(() => {
2660
- if (!open) return;
2661
- const handleClick = (e) => {
2662
- if (containerRef.current && !containerRef.current.contains(e.target)) {
2663
- setOpen(false);
2664
- }
2665
- };
2666
- document.addEventListener("mousedown", handleClick);
2667
- return () => document.removeEventListener("mousedown", handleClick);
2668
- }, [open]);
2669
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, style: { position: "relative" }, children: [
2670
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: cardContainerStyle(tokens), children: [
2671
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: leftStyle, children: [
2672
- KNOWN_LOGOS[name.toLowerCase()] ? /* @__PURE__ */ jsxRuntime.jsx(
2673
- "img",
2674
- {
2675
- src: KNOWN_LOGOS[name.toLowerCase()],
2676
- alt: name,
2677
- style: logoImgStyle
2678
- }
2679
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: iconStyle3(tokens.textMuted), children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
2680
- "path",
2681
- {
2682
- d: "M21 7H3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zm0 8H3V9h18v6z",
2683
- fill: "currentColor"
2684
- }
2685
- ) }) }),
2686
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2687
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: nameRowStyle, children: [
2688
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: nameStyle(tokens.text), children: name }),
2689
- verified && /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z", fill: tokens.accent }) })
2690
- ] }),
2691
- address && /* @__PURE__ */ jsxRuntime.jsx("span", { style: addressStyle(tokens.textMuted), children: address })
2692
- ] })
2693
- ] }),
2694
- hasDropdown && /* @__PURE__ */ jsxRuntime.jsxs(
2695
- "button",
2696
- {
2697
- type: "button",
2698
- onClick: () => setOpen(!open),
2699
- style: changeStyle(tokens.accent),
2700
- children: [
2701
- "Change source",
2702
- /* @__PURE__ */ jsxRuntime.jsx(
2703
- "svg",
2704
- {
2705
- width: "10",
2706
- height: "10",
2707
- viewBox: "0 0 24 24",
2708
- fill: "none",
2709
- style: {
2710
- marginLeft: 4,
2711
- transform: open ? "rotate(180deg)" : "rotate(0deg)",
2712
- transition: "transform 0.15s ease"
2713
- },
2714
- children: /* @__PURE__ */ jsxRuntime.jsx(
2715
- "path",
2716
- {
2717
- d: "M7 10l5 5 5-5",
2718
- stroke: tokens.accent,
2719
- strokeWidth: "2.5",
2720
- strokeLinecap: "round",
2721
- strokeLinejoin: "round"
2722
- }
2723
- )
2724
- }
2725
- )
2726
- ]
2727
- }
2728
- )
2729
- ] }),
2730
- open && hasDropdown && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: dropdownStyle(tokens), children: [
2731
- accounts.map((account) => {
2732
- const preferredWallet = getPreferredDepositWallet(account, depositAmount ?? 0);
2733
- const active = hasActiveDepositWallet(account);
2734
- const isSelected = account.id === selectedAccountId;
2735
- const displayName = account.nickname ?? account.name;
2736
- const walletAddress = preferredWallet ? getWalletAddress(preferredWallet) : null;
2737
- const hasAllowance = active && account.remainingAllowance != null;
2738
- const exceedsLimit = hasAllowance && depositAmount != null && depositAmount > account.remainingAllowance;
2739
- return /* @__PURE__ */ jsxRuntime.jsxs(
2740
- "button",
2741
- {
2742
- type: "button",
2743
- onClick: () => {
2744
- if (active) {
2745
- onSelectAccount?.(account.id);
2746
- } else {
2747
- onAuthorizeAccount?.(account.id);
2748
- }
2749
- setOpen(false);
2750
- },
2751
- style: dropdownRowStyle(tokens, active, isSelected),
2752
- children: [
2753
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: dropdownRowLeftStyle, children: [
2754
- KNOWN_LOGOS[account.name.toLowerCase()] ? /* @__PURE__ */ jsxRuntime.jsx(
2755
- "img",
2756
- {
2757
- src: KNOWN_LOGOS[account.name.toLowerCase()],
2758
- alt: account.name,
2759
- style: dropdownLogoStyle
2760
- }
2761
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownFallbackIconStyle(active ? tokens.textMuted : tokens.border), children: account.name.charAt(0) }),
2762
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: dropdownNameColumnStyle, children: [
2763
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: dropdownNameStyle(active ? tokens.text : tokens.textMuted), children: displayName }),
2764
- walletAddress && /* @__PURE__ */ jsxRuntime.jsx("span", { style: dropdownAddressStyle(active ? tokens.textMuted : tokens.border), children: walletAddress }),
2765
- hasAllowance && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: remainingAllowanceStyle(exceedsLimit ? tokens.warning : tokens.textMuted), children: [
2766
- "$",
2767
- account.remainingAllowance.toFixed(2),
2768
- " remaining"
2769
- ] })
2770
- ] })
2771
- ] }),
2772
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownRowRightStyle, children: active ? exceedsLimit ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: exceedsLimitBadgeStyle(tokens), children: "Exceeds limit" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: activeBadgeStyle(tokens), children: "Active" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: inactiveBadgeStyle(tokens), children: "Setup incomplete" }) })
2773
- ]
2774
- },
2775
- account.id
2776
- );
2777
- }),
2778
- onAddProvider && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2779
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownDividerStyle(tokens.border) }),
2780
- /* @__PURE__ */ jsxRuntime.jsxs(
2781
- "button",
2782
- {
2783
- type: "button",
2784
- onClick: () => {
2785
- onAddProvider();
2786
- setOpen(false);
2787
- },
2788
- style: addProviderStyle(tokens),
2789
- children: [
2790
- /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }) }),
2791
- "Add Account"
2792
- ]
2793
- }
2794
- )
2795
- ] })
2796
- ] })
2797
- ] });
2798
- }
2799
- var cardContainerStyle = (tokens) => ({
2800
- display: "flex",
2801
- alignItems: "center",
2802
- justifyContent: "space-between",
2803
- padding: "12px 16px",
2804
- background: tokens.bgInput,
2805
- border: `1px solid ${tokens.border}`,
2806
- borderRadius: 16
2807
- });
2808
- var leftStyle = {
2809
- display: "flex",
2810
- alignItems: "center",
2811
- gap: 10
2812
- };
2813
- var logoImgStyle = {
2814
- width: 20,
2815
- height: 20,
2816
- borderRadius: "50%",
2817
- objectFit: "contain"
2818
- };
2819
- var iconStyle3 = (color) => ({
2820
- color,
2821
- display: "flex",
2822
- alignItems: "center"
2823
- });
2824
- var nameRowStyle = {
2825
- display: "flex",
2826
- alignItems: "center",
2827
- gap: 4
2828
- };
2829
- var nameStyle = (color) => ({
2830
- fontWeight: 600,
2831
- fontSize: "0.9rem",
2832
- color
2833
- });
2834
- var addressStyle = (color) => ({
2835
- fontSize: "0.72rem",
2836
- color,
2837
- fontFamily: '"SF Mono", "Fira Code", monospace'
2838
- });
2839
- var changeStyle = (color) => ({
2840
- display: "flex",
2841
- alignItems: "center",
2842
- background: "transparent",
2843
- border: "none",
2844
- color,
2845
- fontWeight: 600,
2846
- fontSize: "0.82rem",
2847
- cursor: "pointer",
2848
- fontFamily: "inherit",
2849
- padding: 0
2850
- });
2851
- var dropdownStyle = (tokens) => ({
2852
- position: "absolute",
2853
- top: "100%",
2854
- left: 0,
2855
- right: 0,
2856
- marginTop: 4,
2857
- background: tokens.bgCard,
2858
- border: `1px solid ${tokens.border}`,
2859
- borderRadius: tokens.radiusLg,
2860
- boxShadow: tokens.shadowLg,
2861
- zIndex: 50,
2862
- overflow: "hidden"
2863
- });
2864
- var dropdownRowStyle = (tokens, active, isSelected) => ({
2865
- display: "flex",
2866
- alignItems: "center",
2867
- justifyContent: "space-between",
2868
- width: "100%",
2869
- padding: "10px 14px",
2870
- background: isSelected ? tokens.accent + "12" : "transparent",
2871
- border: "none",
2872
- borderBottom: `1px solid ${tokens.border}`,
2873
- cursor: "pointer",
2874
- fontFamily: "inherit",
2875
- fontSize: "0.85rem",
2876
- textAlign: "left",
2877
- outline: "none",
2878
- opacity: active ? 1 : 0.55,
2879
- transition: "background 0.1s ease"
2880
- });
2881
- var dropdownRowLeftStyle = {
2882
- display: "flex",
2883
- alignItems: "center",
2884
- gap: 10,
2885
- minWidth: 0,
2886
- flex: 1
2887
- };
2888
- var dropdownRowRightStyle = {
2889
- display: "flex",
2890
- alignItems: "center",
2891
- gap: 8,
2892
- flexShrink: 0
2893
- };
2894
- var dropdownLogoStyle = {
2895
- width: 20,
2896
- height: 20,
2897
- borderRadius: "50%",
2898
- objectFit: "contain",
2899
- flexShrink: 0
2900
- };
2901
- var dropdownFallbackIconStyle = (color) => ({
2902
- width: 20,
2903
- height: 20,
2904
- borderRadius: "50%",
2905
- display: "flex",
2906
- alignItems: "center",
2907
- justifyContent: "center",
2908
- fontSize: "0.72rem",
2909
- fontWeight: 700,
2910
- color,
2911
- flexShrink: 0
2912
- });
2913
- var dropdownNameColumnStyle = {
2914
- display: "flex",
2915
- flexDirection: "column",
2916
- gap: 2,
2917
- minWidth: 0
2918
- };
2919
- var dropdownNameStyle = (color) => ({
2920
- fontWeight: 500,
2921
- color,
2922
- whiteSpace: "nowrap",
2923
- overflow: "hidden",
2924
- textOverflow: "ellipsis"
2925
- });
2926
- var dropdownAddressStyle = (color) => ({
2927
- fontSize: "0.72rem",
2928
- color,
2929
- fontFamily: '"SF Mono", "Fira Code", monospace',
2930
- whiteSpace: "nowrap",
2931
- overflow: "hidden",
2932
- textOverflow: "ellipsis"
2933
- });
2934
- var activeBadgeStyle = (tokens) => ({
2935
- fontSize: "0.6rem",
2936
- fontWeight: 600,
2937
- color: tokens.success,
2938
- background: tokens.successBg,
2939
- padding: "2px 7px",
2940
- borderRadius: 999,
2941
- textTransform: "uppercase",
2942
- letterSpacing: "0.03em",
2943
- whiteSpace: "nowrap"
2944
- });
2945
- var inactiveBadgeStyle = (tokens) => ({
2946
- fontSize: "0.6rem",
2947
- fontWeight: 600,
2948
- color: tokens.warning,
2949
- background: tokens.warningBg ?? `${tokens.warning}1a`,
2950
- padding: "2px 7px",
2951
- borderRadius: 999,
2952
- textTransform: "uppercase",
2953
- letterSpacing: "0.03em",
2954
- whiteSpace: "nowrap"
2955
- });
2956
- var dropdownDividerStyle = (borderColor) => ({
2957
- height: 0,
2958
- borderTop: `1px solid ${borderColor}`
2959
- });
2960
- var remainingAllowanceStyle = (color) => ({
2961
- fontSize: "0.68rem",
2962
- color,
2963
- fontWeight: 500,
2964
- whiteSpace: "nowrap",
2965
- overflow: "hidden",
2966
- textOverflow: "ellipsis"
2967
- });
2968
- var exceedsLimitBadgeStyle = (tokens) => ({
2969
- fontSize: "0.6rem",
2970
- fontWeight: 600,
2971
- color: tokens.warning,
2972
- background: tokens.warningBg ?? `${tokens.warning}1a`,
2973
- padding: "2px 7px",
2974
- borderRadius: 999,
2975
- textTransform: "uppercase",
2976
- letterSpacing: "0.03em",
2977
- whiteSpace: "nowrap"
2978
- });
2979
- var addProviderStyle = (tokens) => ({
2980
- display: "flex",
2981
- alignItems: "center",
2982
- gap: 8,
2983
- width: "100%",
2984
- padding: "10px 14px",
2985
- background: "transparent",
2986
- border: "none",
2987
- color: tokens.accent,
2717
+ color: tokens.text,
2718
+ fontSize: "1.25rem",
2988
2719
  fontWeight: 600,
2989
- fontSize: "0.85rem",
2990
- cursor: "pointer",
2991
2720
  fontFamily: "inherit",
2992
- textAlign: "left",
2993
- outline: "none"
2721
+ textAlign: "center",
2722
+ outline: "none",
2723
+ caretColor: tokens.borderFocus,
2724
+ transition: "border-color 0.15s ease"
2994
2725
  });
2995
2726
  function StepList({ steps }) {
2996
2727
  const { tokens } = useSwypeConfig();
@@ -3001,11 +2732,11 @@ function StepList({ steps }) {
3001
2732
  /* @__PURE__ */ jsxRuntime.jsx(
3002
2733
  "div",
3003
2734
  {
3004
- style: isActive ? activeBadgeContainerStyle : badgeStyle2(
3005
- isComplete ? tokens.accent : tokens.border,
2735
+ style: badgeStyle2(
2736
+ isComplete || isActive ? tokens.accent : tokens.border,
3006
2737
  isComplete
3007
2738
  ),
3008
- children: isComplete ? /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z", fill: "#fff" }) }) : isActive ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: activeDotStyle(tokens.accent) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: badgeNumberStyle, children: i + 1 })
2739
+ children: isComplete ? /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z", fill: "#fff" }) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: isActive ? activeBadgeNumberStyle(tokens.accent) : badgeNumberStyle, children: i + 1 })
3009
2740
  }
3010
2741
  ),
3011
2742
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: labelContainerStyle, children: [
@@ -3036,26 +2767,16 @@ var badgeStyle2 = (color, filled) => ({
3036
2767
  justifyContent: "center",
3037
2768
  flexShrink: 0
3038
2769
  });
3039
- var activeBadgeContainerStyle = {
3040
- width: 28,
3041
- height: 28,
3042
- display: "flex",
3043
- alignItems: "center",
3044
- justifyContent: "center",
3045
- flexShrink: 0
3046
- };
3047
- var activeDotStyle = (color) => ({
3048
- width: 8,
3049
- height: 8,
3050
- borderRadius: "50%",
3051
- backgroundColor: color,
3052
- display: "block"
3053
- });
3054
2770
  var badgeNumberStyle = {
3055
2771
  fontSize: "0.75rem",
3056
2772
  fontWeight: 600,
3057
2773
  color: "inherit"
3058
2774
  };
2775
+ var activeBadgeNumberStyle = (color) => ({
2776
+ fontSize: "0.75rem",
2777
+ fontWeight: 600,
2778
+ color
2779
+ });
3059
2780
  var labelContainerStyle = {
3060
2781
  display: "flex",
3061
2782
  flexDirection: "column"
@@ -3069,87 +2790,6 @@ var detailStyle = (color) => ({
3069
2790
  fontSize: "0.75rem",
3070
2791
  color
3071
2792
  });
3072
- function SettingsMenu({ onLogout }) {
3073
- const { tokens } = useSwypeConfig();
3074
- const [open, setOpen] = react.useState(false);
3075
- const menuRef = react.useRef(null);
3076
- const toggle = react.useCallback(() => setOpen((prev) => !prev), []);
3077
- react.useEffect(() => {
3078
- if (!open) return;
3079
- const handleClickOutside = (e) => {
3080
- if (menuRef.current && !menuRef.current.contains(e.target)) {
3081
- setOpen(false);
3082
- }
3083
- };
3084
- document.addEventListener("mousedown", handleClickOutside);
3085
- return () => document.removeEventListener("mousedown", handleClickOutside);
3086
- }, [open]);
3087
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: menuRef, style: containerStyle8, children: [
3088
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: toggle, style: triggerStyle(tokens.text), "aria-label": "Settings", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: [
3089
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "5", r: "2", fill: "currentColor" }),
3090
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "2", fill: "currentColor" }),
3091
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "19", r: "2", fill: "currentColor" })
3092
- ] }) }),
3093
- open && /* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownStyle2(tokens), children: /* @__PURE__ */ jsxRuntime.jsxs(
3094
- "button",
3095
- {
3096
- type: "button",
3097
- onClick: () => {
3098
- setOpen(false);
3099
- onLogout();
3100
- },
3101
- style: menuItemStyle(tokens),
3102
- children: [
3103
- /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", style: { marginRight: 8, flexShrink: 0 }, children: [
3104
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4", stroke: tokens.error, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
3105
- /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "16 17 21 12 16 7", stroke: tokens.error, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
3106
- /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12", stroke: tokens.error, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
3107
- ] }),
3108
- "Log out"
3109
- ]
3110
- }
3111
- ) })
3112
- ] });
3113
- }
3114
- var containerStyle8 = {
3115
- position: "relative"
3116
- };
3117
- var triggerStyle = (color) => ({
3118
- background: "transparent",
3119
- border: "none",
3120
- cursor: "pointer",
3121
- padding: 4,
3122
- color,
3123
- display: "flex",
3124
- alignItems: "center",
3125
- justifyContent: "center"
3126
- });
3127
- var dropdownStyle2 = (tokens) => ({
3128
- position: "absolute",
3129
- right: 0,
3130
- top: "100%",
3131
- marginTop: 4,
3132
- minWidth: 140,
3133
- background: tokens.bgCard,
3134
- border: `1px solid ${tokens.border}`,
3135
- borderRadius: 12,
3136
- boxShadow: tokens.shadow,
3137
- zIndex: 100,
3138
- overflow: "hidden"
3139
- });
3140
- var menuItemStyle = (tokens) => ({
3141
- width: "100%",
3142
- display: "flex",
3143
- alignItems: "center",
3144
- padding: "12px 16px",
3145
- background: "transparent",
3146
- border: "none",
3147
- cursor: "pointer",
3148
- fontFamily: "inherit",
3149
- fontSize: "0.85rem",
3150
- fontWeight: 500,
3151
- color: tokens.error
3152
- });
3153
2793
  function LoginScreen({
3154
2794
  authInput,
3155
2795
  onAuthInputChange,
@@ -3441,6 +3081,7 @@ var resendStyle = (color, disabled) => ({
3441
3081
  function PasskeyScreen({
3442
3082
  onCreatePasskey,
3443
3083
  onBack,
3084
+ onLogout,
3444
3085
  creating,
3445
3086
  error,
3446
3087
  popupFallback = false,
@@ -3457,7 +3098,7 @@ function PasskeyScreen({
3457
3098
  /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
3458
3099
  ] }),
3459
3100
  children: [
3460
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack }),
3101
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack, onLogout }),
3461
3102
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle4, children: [
3462
3103
  /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle3(tokens.text), children: "Secure your account with a passkey" }),
3463
3104
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle2(tokens), children: error })
@@ -3547,7 +3188,8 @@ function WalletPickerScreen({
3547
3188
  onPrepareProvider,
3548
3189
  onSelectProvider,
3549
3190
  onContinueConnection,
3550
- onBack
3191
+ onBack,
3192
+ onLogout
3551
3193
  }) {
3552
3194
  const { tokens } = useSwypeConfig();
3553
3195
  const [hoveredId, setHoveredId] = react.useState(null);
@@ -3584,7 +3226,7 @@ function WalletPickerScreen({
3584
3226
  const selectedProvider = displayProviders.find((p) => p.id === selectedProviderId);
3585
3227
  if (loading) {
3586
3228
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { children: [
3587
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Swype", onBack }),
3229
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Swype", onBack, onLogout }),
3588
3230
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center", padding: "48px 0", flex: 1, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { label: "Connecting..." }) })
3589
3231
  ] });
3590
3232
  }
@@ -3614,7 +3256,7 @@ function WalletPickerScreen({
3614
3256
  /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
3615
3257
  ] }),
3616
3258
  children: [
3617
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Swype", onBack }),
3259
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Swype", onBack, onLogout }),
3618
3260
  hasPending && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3619
3261
  /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Continue where you left off" }),
3620
3262
  /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle2(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
@@ -3636,7 +3278,7 @@ function WalletPickerScreen({
3636
3278
  {
3637
3279
  src: KNOWN_LOGOS[acct.name.toLowerCase()],
3638
3280
  alt: acct.name,
3639
- style: logoImgStyle2
3281
+ style: logoImgStyle
3640
3282
  }
3641
3283
  ) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: emojiStyle, children: WALLET_EMOJIS[acct.name.toLowerCase()] ?? acct.name.charAt(0) }) }),
3642
3284
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: pendingInfoStyle, children: [
@@ -3697,10 +3339,10 @@ function WalletPickerScreen({
3697
3339
  {
3698
3340
  src: logoSrc,
3699
3341
  alt: p.name,
3700
- style: logoImgStyle2
3342
+ style: logoImgStyle
3701
3343
  }
3702
3344
  ) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: emojiStyle, children: emoji }),
3703
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: nameStyle2(tokens.text), children: p.name })
3345
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: nameStyle(tokens.text), children: p.name })
3704
3346
  ]
3705
3347
  },
3706
3348
  p.id
@@ -3753,13 +3395,13 @@ var emojiStyle = {
3753
3395
  fontSize: "1.75rem",
3754
3396
  lineHeight: 1
3755
3397
  };
3756
- var logoImgStyle2 = {
3398
+ var logoImgStyle = {
3757
3399
  width: 32,
3758
3400
  height: 32,
3759
3401
  borderRadius: 8,
3760
3402
  objectFit: "contain"
3761
3403
  };
3762
- var nameStyle2 = (color) => ({
3404
+ var nameStyle = (color) => ({
3763
3405
  fontSize: "0.88rem",
3764
3406
  fontWeight: 600,
3765
3407
  color
@@ -3882,6 +3524,7 @@ function SetupScreen({
3882
3524
  availableBalance,
3883
3525
  onSetupOneTap,
3884
3526
  onBack,
3527
+ onLogout,
3885
3528
  onAdvanced,
3886
3529
  loading,
3887
3530
  error
@@ -3890,12 +3533,14 @@ function SetupScreen({
3890
3533
  const effectiveMax = DEFAULT_MAX;
3891
3534
  const effectiveMin = Math.min(ABSOLUTE_MIN, effectiveMax);
3892
3535
  const [limit, setLimit] = react.useState(() => Math.min(availableBalance, effectiveMax));
3536
+ const [activePreset, setActivePreset] = react.useState(null);
3893
3537
  const [editing, setEditing] = react.useState(false);
3894
3538
  const [inputValue, setInputValue] = react.useState("");
3895
3539
  const inputRef = react.useRef(null);
3896
3540
  const startEditing = react.useCallback(() => {
3897
3541
  setInputValue(limit.toFixed(2));
3898
3542
  setEditing(true);
3543
+ setActivePreset(null);
3899
3544
  requestAnimationFrame(() => inputRef.current?.focus());
3900
3545
  }, [limit]);
3901
3546
  const commitEdit = react.useCallback(() => {
@@ -3903,16 +3548,17 @@ function SetupScreen({
3903
3548
  if (!isNaN(parsed)) {
3904
3549
  setLimit(Math.min(effectiveMax, Math.max(effectiveMin, Math.round(parsed * 100) / 100)));
3905
3550
  }
3551
+ setActivePreset(null);
3906
3552
  setEditing(false);
3907
3553
  }, [inputValue, effectiveMax, effectiveMin]);
3908
3554
  const selectPreset = (value) => {
3909
3555
  setLimit(Math.min(value, effectiveMax));
3556
+ setActivePreset(value);
3910
3557
  };
3911
3558
  const selectMax = () => {
3912
3559
  setLimit(Math.min(availableBalance, effectiveMax));
3560
+ setActivePreset("max");
3913
3561
  };
3914
- const isPresetActive = (value) => Math.abs(limit - value) < 5e-3;
3915
- const isMaxActive = Math.abs(limit - Math.min(availableBalance, effectiveMax)) < 5e-3 && !PRESETS.some((p) => isPresetActive(p));
3916
3562
  return /* @__PURE__ */ jsxRuntime.jsxs(
3917
3563
  ScreenLayout,
3918
3564
  {
@@ -3929,7 +3575,7 @@ function SetupScreen({
3929
3575
  /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
3930
3576
  ] }),
3931
3577
  children: [
3932
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack }),
3578
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack, onLogout }),
3933
3579
  /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle5(tokens.text), children: "Set Spending Limit" }),
3934
3580
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle3(tokens), children: error }),
3935
3581
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: amountRowStyle, children: [
@@ -3990,7 +3636,7 @@ function SetupScreen({
3990
3636
  {
3991
3637
  type: "button",
3992
3638
  onClick: () => selectPreset(value),
3993
- style: presetButtonStyle(tokens, isPresetActive(value)),
3639
+ style: presetButtonStyle(tokens, activePreset === value),
3994
3640
  children: [
3995
3641
  "$",
3996
3642
  value.toLocaleString()
@@ -4003,7 +3649,7 @@ function SetupScreen({
4003
3649
  {
4004
3650
  type: "button",
4005
3651
  onClick: selectMax,
4006
- style: presetButtonStyle(tokens, isMaxActive),
3652
+ style: presetButtonStyle(tokens, activePreset === "max"),
4007
3653
  children: "Max"
4008
3654
  }
4009
3655
  )
@@ -4128,7 +3774,7 @@ function SetupStatusScreen({
4128
3774
  { label: "Done", status: "pending" }
4129
3775
  ];
4130
3776
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { children: [
4131
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
3777
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
4132
3778
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle5, children: [
4133
3779
  /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
4134
3780
  /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle6(tokens.text), children: "Setting up One-Tap..." }),
@@ -4191,9 +3837,6 @@ var waitHintStyle = (color) => ({
4191
3837
  var MIN_DEPOSIT = 0.25;
4192
3838
  function DepositScreen({
4193
3839
  merchantName,
4194
- sourceName,
4195
- sourceAddress,
4196
- sourceVerified,
4197
3840
  availableBalance,
4198
3841
  remainingLimit,
4199
3842
  tokenCount,
@@ -4217,7 +3860,7 @@ function DepositScreen({
4217
3860
  const { tokens } = useSwypeConfig();
4218
3861
  const amount = initialAmount;
4219
3862
  const isLowBalance = availableBalance < MIN_DEPOSIT;
4220
- const exceedsLimit = amount > remainingLimit && !isLowBalance;
3863
+ const exceedsLimit = remainingLimit != null && amount > remainingLimit && !isLowBalance;
4221
3864
  const canDeposit = amount >= MIN_DEPOSIT && !exceedsLimit && !isLowBalance && !processing;
4222
3865
  const headerTitle = merchantName ? `Deposit to ${merchantName}` : "Deposit";
4223
3866
  if (isLowBalance) {
@@ -4231,21 +3874,7 @@ function DepositScreen({
4231
3874
  /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
4232
3875
  ] }),
4233
3876
  children: [
4234
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: headerTitle, onBack, right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
4235
- /* @__PURE__ */ jsxRuntime.jsx(
4236
- SourceCard,
4237
- {
4238
- name: sourceName,
4239
- address: sourceAddress,
4240
- verified: sourceVerified,
4241
- accounts,
4242
- selectedAccountId,
4243
- depositAmount: amount,
4244
- onSelectAccount,
4245
- onAuthorizeAccount,
4246
- onAddProvider
4247
- }
4248
- ),
3877
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: headerTitle, onBack, onLogout }),
4249
3878
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: lowBalanceAmountDisplayStyle, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: lowBalanceAmountStyle, children: [
4250
3879
  "$",
4251
3880
  amount.toFixed(2)
@@ -4277,7 +3906,6 @@ function DepositScreen({
4277
3906
  }
4278
3907
  );
4279
3908
  }
4280
- const providerLogo = KNOWN_LOGOS[sourceName.toLowerCase()];
4281
3909
  return /* @__PURE__ */ jsxRuntime.jsxs(
4282
3910
  ScreenLayout,
4283
3911
  {
@@ -4288,7 +3916,7 @@ function DepositScreen({
4288
3916
  "Your deposit of $",
4289
3917
  amount.toFixed(2),
4290
3918
  " exceeds your One-Tap limit of $",
4291
- remainingLimit.toFixed(2),
3919
+ remainingLimit?.toFixed(2) ?? "0.00",
4292
3920
  ". Increase your limit to continue."
4293
3921
  ] })
4294
3922
  ] }) : /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: () => onDeposit(amount), disabled: !canDeposit, loading: processing, children: "Confirm" }),
@@ -4296,7 +3924,6 @@ function DepositScreen({
4296
3924
  ] }),
4297
3925
  children: [
4298
3926
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack }),
4299
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: mascotWrapStyle, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: SWYPE_MASCOT, alt: "Swype", style: mascotStyle3 }) }),
4300
3927
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: depositCardStyle(tokens), children: [
4301
3928
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: depositLabelStyle(tokens.textMuted), children: "Depositing" }),
4302
3929
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: amountRowStyle2, children: [
@@ -4325,17 +3952,69 @@ function DepositScreen({
4325
3952
  ]
4326
3953
  }
4327
3954
  )
4328
- ] }),
4329
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: walletBalanceRowStyle, children: [
4330
- providerLogo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: providerLogo, alt: sourceName, style: providerLogoStyle }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: providerFallbackStyle(tokens.textMuted), children: sourceName.charAt(0) }),
4331
- /* @__PURE__ */ jsxRuntime.jsxs("span", { style: walletBalanceStyle(tokens.text), children: [
4332
- "$",
4333
- availableBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
4334
- ] }),
4335
- /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.4 }, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 10l5-5 5 5M7 14l5 5 5-5", stroke: tokens.textMuted, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
4336
3955
  ] })
4337
3956
  ] }),
4338
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: spendingLimitStyle(tokens.textMuted), children: [
3957
+ accounts && accounts.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: accountSectionStyle, children: [
3958
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: accountSectionLabelStyle(tokens.textMuted), children: "Choose account" }),
3959
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: accountListStyle(tokens), children: [
3960
+ accounts.map((account) => {
3961
+ const preferredWallet = getPreferredDepositWallet(account, amount);
3962
+ const active = hasActiveDepositWallet(account);
3963
+ const isSelected = account.id === selectedAccountId;
3964
+ const walletAddress = preferredWallet ? getWalletAddress(preferredWallet) : null;
3965
+ const truncatedAddress = walletAddress ? `${walletAddress.slice(0, 6)}...${walletAddress.slice(-4)}` : null;
3966
+ const accountBalance = account.wallets.reduce(
3967
+ (sum, w) => sum + w.balance.available.amount,
3968
+ 0
3969
+ );
3970
+ const providerLogo = KNOWN_LOGOS[account.name.toLowerCase()];
3971
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3972
+ "button",
3973
+ {
3974
+ type: "button",
3975
+ onClick: () => {
3976
+ if (active) {
3977
+ onSelectAccount?.(account.id);
3978
+ } else {
3979
+ onAuthorizeAccount?.(account.id);
3980
+ }
3981
+ },
3982
+ style: accountRowStyle(tokens),
3983
+ children: [
3984
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: accountRowLeftStyle, children: [
3985
+ providerLogo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: providerLogo, alt: account.name, style: accountLogoStyle }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: accountFallbackIconStyle(tokens.textMuted), children: account.name.charAt(0) }),
3986
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: accountInfoStyle, children: [
3987
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: accountAddressStyle(tokens.text), children: truncatedAddress ?? account.nickname ?? account.name }),
3988
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: accountBalanceTextStyle(tokens.textMuted), children: [
3989
+ "$",
3990
+ accountBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
3991
+ ] })
3992
+ ] })
3993
+ ] }),
3994
+ isSelected ? /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
3995
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "11", fill: tokens.success }),
3996
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 11l3 3 5-5", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
3997
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: radioEmptyStyle(tokens.border) })
3998
+ ]
3999
+ },
4000
+ account.id
4001
+ );
4002
+ }),
4003
+ onAddProvider && /* @__PURE__ */ jsxRuntime.jsxs(
4004
+ "button",
4005
+ {
4006
+ type: "button",
4007
+ onClick: onAddProvider,
4008
+ style: addAccountBtnStyle(tokens),
4009
+ children: [
4010
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }) }),
4011
+ "Add Account"
4012
+ ]
4013
+ }
4014
+ )
4015
+ ] })
4016
+ ] }),
4017
+ remainingLimit != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: spendingLimitStyle(tokens.textMuted), children: [
4339
4018
  "Spending Limit",
4340
4019
  " ",
4341
4020
  /* @__PURE__ */ jsxRuntime.jsxs("strong", { style: { color: tokens.text }, children: [
@@ -4348,15 +4027,6 @@ function DepositScreen({
4348
4027
  }
4349
4028
  );
4350
4029
  }
4351
- var mascotWrapStyle = {
4352
- display: "flex",
4353
- justifyContent: "center",
4354
- marginBottom: 16
4355
- };
4356
- var mascotStyle3 = {
4357
- width: 36,
4358
- height: 36
4359
- };
4360
4030
  var depositCardStyle = (tokens) => ({
4361
4031
  background: tokens.bgInput,
4362
4032
  border: `1px solid ${tokens.border}`,
@@ -4402,33 +4072,102 @@ var checkBadgeStyle2 = {
4402
4072
  bottom: -1,
4403
4073
  right: -3
4404
4074
  };
4405
- var walletBalanceRowStyle = {
4075
+ var accountSectionStyle = {
4076
+ marginBottom: 20
4077
+ };
4078
+ var accountSectionLabelStyle = (color) => ({
4079
+ fontSize: "0.78rem",
4080
+ fontWeight: 500,
4081
+ color,
4082
+ marginBottom: 8
4083
+ });
4084
+ var accountListStyle = (tokens) => ({
4085
+ background: tokens.bgInput,
4086
+ border: `1px solid ${tokens.border}`,
4087
+ borderRadius: tokens.radiusLg,
4088
+ overflow: "hidden"
4089
+ });
4090
+ var accountRowStyle = (tokens, isSelected) => ({
4406
4091
  display: "flex",
4407
4092
  alignItems: "center",
4408
- gap: 8
4093
+ justifyContent: "space-between",
4094
+ width: "100%",
4095
+ padding: "14px 16px",
4096
+ background: "transparent",
4097
+ border: "none",
4098
+ borderBottom: `1px solid ${tokens.border}`,
4099
+ cursor: "pointer",
4100
+ fontFamily: "inherit",
4101
+ textAlign: "left",
4102
+ outline: "none"
4103
+ });
4104
+ var accountRowLeftStyle = {
4105
+ display: "flex",
4106
+ alignItems: "center",
4107
+ gap: 12,
4108
+ minWidth: 0,
4109
+ flex: 1
4409
4110
  };
4410
- var providerLogoStyle = {
4411
- width: 18,
4412
- height: 18,
4111
+ var accountLogoStyle = {
4112
+ width: 28,
4113
+ height: 28,
4413
4114
  borderRadius: "50%",
4414
- objectFit: "contain"
4115
+ objectFit: "contain",
4116
+ flexShrink: 0
4415
4117
  };
4416
- var providerFallbackStyle = (color) => ({
4417
- width: 18,
4418
- height: 18,
4118
+ var accountFallbackIconStyle = (color) => ({
4119
+ width: 28,
4120
+ height: 28,
4419
4121
  borderRadius: "50%",
4420
4122
  display: "flex",
4421
4123
  alignItems: "center",
4422
4124
  justifyContent: "center",
4423
- fontSize: "0.65rem",
4125
+ fontSize: "0.75rem",
4424
4126
  fontWeight: 700,
4425
4127
  color,
4426
4128
  flexShrink: 0
4427
4129
  });
4428
- var walletBalanceStyle = (color) => ({
4429
- fontSize: "0.9rem",
4130
+ var accountInfoStyle = {
4131
+ display: "flex",
4132
+ flexDirection: "column",
4133
+ gap: 2,
4134
+ minWidth: 0
4135
+ };
4136
+ var accountAddressStyle = (color) => ({
4430
4137
  fontWeight: 600,
4431
- color
4138
+ fontSize: "0.88rem",
4139
+ color,
4140
+ whiteSpace: "nowrap",
4141
+ overflow: "hidden",
4142
+ textOverflow: "ellipsis"
4143
+ });
4144
+ var accountBalanceTextStyle = (color) => ({
4145
+ fontSize: "0.76rem",
4146
+ color,
4147
+ fontWeight: 500
4148
+ });
4149
+ var radioEmptyStyle = (borderColor) => ({
4150
+ width: 22,
4151
+ height: 22,
4152
+ borderRadius: "50%",
4153
+ border: `2px solid ${borderColor}`,
4154
+ flexShrink: 0
4155
+ });
4156
+ var addAccountBtnStyle = (tokens) => ({
4157
+ display: "flex",
4158
+ alignItems: "center",
4159
+ gap: 8,
4160
+ width: "100%",
4161
+ padding: "12px 16px",
4162
+ background: "transparent",
4163
+ border: "none",
4164
+ color: tokens.accent,
4165
+ fontWeight: 600,
4166
+ fontSize: "0.85rem",
4167
+ cursor: "pointer",
4168
+ fontFamily: "inherit",
4169
+ textAlign: "left",
4170
+ outline: "none"
4432
4171
  });
4433
4172
  var spendingLimitStyle = (color) => ({
4434
4173
  textAlign: "center",
@@ -4548,12 +4287,7 @@ function SuccessScreen({
4548
4287
  /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
4549
4288
  ] }),
4550
4289
  children: [
4551
- /* @__PURE__ */ jsxRuntime.jsx(
4552
- ScreenHeader,
4553
- {
4554
- right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout })
4555
- }
4556
- ),
4290
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
4557
4291
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle6, children: [
4558
4292
  succeeded ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4559
4293
  /* @__PURE__ */ jsxRuntime.jsx(IconCircle, { variant: "success", size: 64, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z", fill: tokens.success }) }) }),
@@ -4720,7 +4454,7 @@ function SelectSourceScreen({
4720
4454
  {
4721
4455
  title: "Select Source",
4722
4456
  onBack,
4723
- right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout })
4457
+ onLogout
4724
4458
  }
4725
4459
  ),
4726
4460
  /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle5(tokens.textMuted), children: "Choose which chain and token to pay from." }),
@@ -5087,12 +4821,13 @@ function buildSteps(phase) {
5087
4821
  }
5088
4822
  function TransferStatusScreen({
5089
4823
  phase,
5090
- error
4824
+ error,
4825
+ onLogout
5091
4826
  }) {
5092
4827
  const { tokens } = useSwypeConfig();
5093
4828
  const steps = buildSteps(phase);
5094
4829
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {}), children: [
5095
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, {}),
4830
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
5096
4831
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle7, children: [
5097
4832
  /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 64 }),
5098
4833
  /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle9(tokens.text), children: "Depositing your money..." }),
@@ -5161,6 +4896,7 @@ function OpenWalletScreen({
5161
4896
  walletName,
5162
4897
  deeplinkUri,
5163
4898
  loading,
4899
+ useDeeplink = true,
5164
4900
  error,
5165
4901
  onRetryStatus,
5166
4902
  onBack,
@@ -5171,16 +4907,44 @@ function OpenWalletScreen({
5171
4907
  const logoSrc = walletName ? KNOWN_LOGOS[walletName.toLowerCase()] : void 0;
5172
4908
  const autoOpenedRef = react.useRef(null);
5173
4909
  react.useEffect(() => {
5174
- if (loading || !deeplinkUri || autoOpenedRef.current === deeplinkUri) return;
4910
+ if (!useDeeplink || loading || !deeplinkUri || autoOpenedRef.current === deeplinkUri) return;
5175
4911
  autoOpenedRef.current = deeplinkUri;
5176
4912
  triggerDeeplink(deeplinkUri);
5177
- }, [loading, deeplinkUri]);
4913
+ }, [useDeeplink, loading, deeplinkUri]);
5178
4914
  const handleOpen = react.useCallback(() => {
5179
4915
  const opened = window.open(deeplinkUri, "_blank");
5180
4916
  if (!opened && window === window.parent) {
5181
4917
  window.location.href = deeplinkUri;
5182
4918
  }
5183
4919
  }, [deeplinkUri]);
4920
+ if (!useDeeplink) {
4921
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4922
+ ScreenLayout,
4923
+ {
4924
+ footer: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: footerContentStyle, children: [
4925
+ error && /* @__PURE__ */ jsxRuntime.jsx(InfoBanner, { children: error }),
4926
+ /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
4927
+ ] }),
4928
+ children: [
4929
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
4930
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle8, children: [
4931
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: logoCircleStyle(tokens.bgInput), children: logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 32 }) }),
4932
+ /* @__PURE__ */ jsxRuntime.jsxs("h2", { style: headingStyle10(tokens.text), children: [
4933
+ "Setting up ",
4934
+ displayName,
4935
+ "..."
4936
+ ] }),
4937
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle7(tokens.textSecondary), children: "Approve the connection in your wallet extension." }),
4938
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: waitingBadgeStyle(tokens), children: [
4939
+ /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 14 }),
4940
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Waiting for authorization..." })
4941
+ ] }),
4942
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: waitHintStyle2(tokens.textMuted), children: "Usually takes a few seconds" })
4943
+ ] })
4944
+ ]
4945
+ }
4946
+ );
4947
+ }
5184
4948
  return /* @__PURE__ */ jsxRuntime.jsxs(
5185
4949
  ScreenLayout,
5186
4950
  {
@@ -5195,7 +4959,7 @@ function OpenWalletScreen({
5195
4959
  /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
5196
4960
  ] }),
5197
4961
  children: [
5198
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack, right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
4962
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack, onLogout }),
5199
4963
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle8, children: [
5200
4964
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: logoCircleStyle(tokens.bgInput), children: logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 32 }) }),
5201
4965
  /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle10(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
@@ -5270,6 +5034,11 @@ var hintStyle = (color) => ({
5270
5034
  color,
5271
5035
  margin: "8px 0 0"
5272
5036
  });
5037
+ var waitHintStyle2 = (color) => ({
5038
+ fontSize: "0.82rem",
5039
+ color,
5040
+ margin: "16px 0 0"
5041
+ });
5273
5042
  function ConfirmSignScreen({
5274
5043
  walletName,
5275
5044
  signing,
@@ -5289,7 +5058,7 @@ function ConfirmSignScreen({
5289
5058
  !error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: hintStyle2(tokens.textMuted), children: "You may be prompted for biometric verification" })
5290
5059
  ] }),
5291
5060
  children: [
5292
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { right: /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { onLogout }) }),
5061
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
5293
5062
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle9, children: [
5294
5063
  logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle3 }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
5295
5064
  /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle11(tokens.text), children: "Wallet authorized" }),
@@ -5368,6 +5137,7 @@ function TokenPickerScreen({
5368
5137
  onSelectAuthorized,
5369
5138
  onAuthorizeToken,
5370
5139
  onBack,
5140
+ onLogout,
5371
5141
  depositAmount
5372
5142
  }) {
5373
5143
  const { tokens: t } = useSwypeConfig();
@@ -5396,8 +5166,8 @@ function TokenPickerScreen({
5396
5166
  }
5397
5167
  };
5398
5168
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {}), children: [
5399
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack }),
5400
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: mascotWrapStyle2, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: SWYPE_MASCOT, alt: "Swype", style: mascotImgStyle }) }),
5169
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack, onLogout }),
5170
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: mascotWrapStyle, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: SWYPE_MASCOT, alt: "Swype", style: mascotImgStyle }) }),
5401
5171
  depositAmount != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: depositCardStyle2(t), children: [
5402
5172
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: depositLabelStyle2(t.textMuted), children: "Depositing" }),
5403
5173
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: depositAmountRowStyle, children: [
@@ -5450,7 +5220,7 @@ function TokenPickerScreen({
5450
5220
  }) })
5451
5221
  ] });
5452
5222
  }
5453
- var mascotWrapStyle2 = {
5223
+ var mascotWrapStyle = {
5454
5224
  display: "flex",
5455
5225
  justifyContent: "center",
5456
5226
  marginBottom: 16
@@ -5634,8 +5404,6 @@ function StepRendererContent({
5634
5404
  pendingConnections,
5635
5405
  depositEligibleAccounts,
5636
5406
  sourceName,
5637
- sourceAddress,
5638
- sourceVerified,
5639
5407
  maxSourceBalance,
5640
5408
  tokenCount,
5641
5409
  selectedAccount,
@@ -5701,6 +5469,7 @@ function StepRendererContent({
5701
5469
  {
5702
5470
  onCreatePasskey: handlers.onRegisterPasskey,
5703
5471
  onBack: handlers.onLogout,
5472
+ onLogout: handlers.onLogout,
5704
5473
  creating: state.registeringPasskey,
5705
5474
  error: state.error,
5706
5475
  popupFallback: state.passkeyPopupNeeded,
@@ -5714,6 +5483,7 @@ function StepRendererContent({
5714
5483
  {
5715
5484
  onCreatePasskey: handlers.onRegisterPasskey,
5716
5485
  onBack: handlers.onLogout,
5486
+ onLogout: handlers.onLogout,
5717
5487
  creating: state.verifyingPasskeyPopup,
5718
5488
  error: state.error,
5719
5489
  popupFallback: true,
@@ -5734,21 +5504,26 @@ function StepRendererContent({
5734
5504
  onPrepareProvider: handlers.onPrepareProvider,
5735
5505
  onSelectProvider: handlers.onSelectProvider,
5736
5506
  onContinueConnection: handlers.onContinueConnection,
5737
- onBack: () => handlers.onNavigate(state.activeCredentialId ? "deposit" : "create-passkey")
5507
+ onBack: () => handlers.onNavigate(state.activeCredentialId ? "deposit" : "create-passkey"),
5508
+ onLogout: handlers.onLogout
5738
5509
  }
5739
5510
  );
5740
5511
  }
5741
5512
  if (step === "open-wallet") {
5742
5513
  const providerName = state.providers.find((p) => p.id === state.selectedProviderId)?.name ?? null;
5514
+ const useDeeplink = !shouldUseWalletConnector({
5515
+ userAgent: typeof navigator === "undefined" ? void 0 : navigator.userAgent
5516
+ });
5743
5517
  return /* @__PURE__ */ jsxRuntime.jsx(
5744
5518
  OpenWalletScreen,
5745
5519
  {
5746
5520
  walletName: providerName,
5747
5521
  deeplinkUri: state.deeplinkUri ?? "",
5748
- loading: state.creatingTransfer || !state.deeplinkUri,
5749
- error: state.error || pollingError,
5750
- onRetryStatus: handlers.onRetryMobileStatus,
5751
- onBack: () => handlers.onNavigate("wallet-picker"),
5522
+ loading: useDeeplink ? state.creatingTransfer || !state.deeplinkUri : state.creatingTransfer,
5523
+ useDeeplink,
5524
+ error: state.error || (useDeeplink ? pollingError : authExecutorError),
5525
+ onRetryStatus: useDeeplink ? handlers.onRetryMobileStatus : void 0,
5526
+ onBack: useDeeplink ? () => handlers.onNavigate("wallet-picker") : void 0,
5752
5527
  onLogout: handlers.onLogout
5753
5528
  }
5754
5529
  );
@@ -5812,11 +5587,8 @@ function StepRendererContent({
5812
5587
  DepositScreen,
5813
5588
  {
5814
5589
  merchantName,
5815
- sourceName,
5816
- sourceAddress,
5817
- sourceVerified,
5818
5590
  availableBalance: selectedSource ? selectedSource.balance.available.amount : selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : maxSourceBalance,
5819
- remainingLimit: selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? state.oneTapLimit,
5591
+ remainingLimit: selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? null,
5820
5592
  tokenCount,
5821
5593
  initialAmount: parsedAmt,
5822
5594
  processing: state.creatingTransfer,
@@ -5849,6 +5621,7 @@ function StepRendererContent({
5849
5621
  onSelectAuthorized: handlers.onSelectAuthorizedToken,
5850
5622
  onAuthorizeToken: handlers.onAuthorizeToken,
5851
5623
  onBack: () => handlers.onNavigate(state.previousStep === "setup" ? "setup" : "deposit"),
5624
+ onLogout: handlers.onLogout,
5852
5625
  depositAmount: depositAmount ?? void 0
5853
5626
  }
5854
5627
  );
@@ -5896,7 +5669,8 @@ function StepRendererContent({
5896
5669
  merchantName,
5897
5670
  sourceName,
5898
5671
  remainingLimit: succeeded ? (() => {
5899
- const limit = selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? state.oneTapLimit;
5672
+ const limit = selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? null;
5673
+ if (limit == null) return null;
5900
5674
  return limit > displayAmount ? limit - displayAmount : 0;
5901
5675
  })() : void 0,
5902
5676
  onDone: onDismiss ?? handlers.onNewPayment,
@@ -5910,11 +5684,8 @@ function StepRendererContent({
5910
5684
  DepositScreen,
5911
5685
  {
5912
5686
  merchantName,
5913
- sourceName,
5914
- sourceAddress,
5915
- sourceVerified,
5916
5687
  availableBalance: 0,
5917
- remainingLimit: selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? state.oneTapLimit,
5688
+ remainingLimit: selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? null,
5918
5689
  tokenCount,
5919
5690
  initialAmount: depositAmount ?? 5,
5920
5691
  processing: false,
@@ -5970,7 +5741,7 @@ var PaymentErrorBoundary = class extends react.Component {
5970
5741
  return this.props.children;
5971
5742
  }
5972
5743
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle9, children: [
5973
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: iconStyle4, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 24 24", fill: "none", children: [
5744
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: iconStyle3, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 24 24", fill: "none", children: [
5974
5745
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "#ef4444", strokeWidth: "1.5" }),
5975
5746
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 8v5", stroke: "#ef4444", strokeWidth: "1.5", strokeLinecap: "round" }),
5976
5747
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "16", r: "0.75", fill: "#ef4444" })
@@ -5992,7 +5763,7 @@ var containerStyle9 = {
5992
5763
  maxWidth: 420,
5993
5764
  margin: "0 auto"
5994
5765
  };
5995
- var iconStyle4 = {
5766
+ var iconStyle3 = {
5996
5767
  marginBottom: 20
5997
5768
  };
5998
5769
  var headingStyle12 = {
@@ -6034,8 +5805,6 @@ function useDerivedState(state) {
6034
5805
  return selectedWallet.sources.find((s) => s.token.status === "AUTHORIZED") ?? selectedWallet.sources[0] ?? null;
6035
5806
  }, [selectedWallet, state.selectedTokenSymbol]);
6036
5807
  const sourceName = selectedAccount?.name ?? selectedWallet?.chain.name ?? "Wallet";
6037
- const sourceAddress = selectedWallet ? `${selectedWallet.name.slice(0, 6)}...${selectedWallet.name.slice(-4)}` : void 0;
6038
- const sourceVerified = selectedWallet?.status === "ACTIVE";
6039
5808
  const pendingConnections = react.useMemo(
6040
5809
  () => state.accounts.filter(
6041
5810
  (a) => a.wallets.length > 0 && !a.wallets.some((w) => w.status === "ACTIVE")
@@ -6077,8 +5846,6 @@ function useDerivedState(state) {
6077
5846
  selectedWallet,
6078
5847
  selectedSource,
6079
5848
  sourceName,
6080
- sourceAddress,
6081
- sourceVerified,
6082
5849
  pendingConnections,
6083
5850
  depositEligibleAccounts,
6084
5851
  maxSourceBalance,
@@ -6705,7 +6472,7 @@ function useProviderHandlers(deps) {
6705
6472
  });
6706
6473
  if (!isMobile) {
6707
6474
  dispatch({ type: "PAY_STARTED", isSetupRedirect: false });
6708
- dispatch({ type: "NAVIGATE", step: "setup-status" });
6475
+ dispatch({ type: "NAVIGATE", step: "open-wallet" });
6709
6476
  }
6710
6477
  try {
6711
6478
  let accountId;
@@ -6860,7 +6627,7 @@ function useProviderHandlers(deps) {
6860
6627
  dispatch({ type: "MOBILE_DEEPLINK_READY", deeplinkUri: session.uri });
6861
6628
  triggerDeeplink(session.uri);
6862
6629
  } else {
6863
- dispatch({ type: "NAVIGATE", step: "setup-status" });
6630
+ dispatch({ type: "NAVIGATE", step: "open-wallet" });
6864
6631
  await authExecutor.executeSessionById(session.id);
6865
6632
  await reloadAccounts();
6866
6633
  dispatch({ type: "NAVIGATE", step: "deposit" });
@@ -6953,7 +6720,7 @@ function useProviderHandlers(deps) {
6953
6720
  dispatch({ type: "MOBILE_DEEPLINK_READY", deeplinkUri: session.uri });
6954
6721
  triggerDeeplink(session.uri);
6955
6722
  } else {
6956
- dispatch({ type: "NAVIGATE", step: "setup-status" });
6723
+ dispatch({ type: "NAVIGATE", step: "open-wallet" });
6957
6724
  await authExecutor.executeSessionById(session.id);
6958
6725
  await reloadAccounts();
6959
6726
  dispatch({ type: "SELECT_TOKEN", walletId: _walletId, tokenSymbol });
@@ -7028,7 +6795,7 @@ function useOneTapSetupHandlers(deps) {
7028
6795
  }
7029
6796
  oneTapLimitSavedDuringSetupRef.current = true;
7030
6797
  authExecutor.resolveSelectSource({ chainName, tokenSymbol });
7031
- dispatch({ type: "NAVIGATE", step: "setup-status" });
6798
+ dispatch({ type: "NAVIGATE", step: "open-wallet" });
7032
6799
  } else if (authExecutor.pendingOneTapSetup) {
7033
6800
  authExecutor.resolveOneTapSetup();
7034
6801
  } else {
@@ -7666,7 +7433,7 @@ function usePaymentEffects(deps) {
7666
7433
  useWalletConnector: useWalletConnectorProp,
7667
7434
  userAgent: typeof navigator === "undefined" ? void 0 : navigator.userAgent
7668
7435
  });
7669
- if (isDesktop && state.step === "setup-status") {
7436
+ if (isDesktop && (state.step === "setup-status" || state.step === "open-wallet")) {
7670
7437
  preSelectSourceStepRef.current = state.step;
7671
7438
  dispatch({ type: "NAVIGATE", step: "setup" });
7672
7439
  return;
@@ -7681,7 +7448,7 @@ function usePaymentEffects(deps) {
7681
7448
  const pendingOneTapSetupAction = authExecutor.pendingOneTapSetup;
7682
7449
  const preOneTapSetupStepRef = react.useRef(null);
7683
7450
  react.useEffect(() => {
7684
- if (pendingOneTapSetupAction && state.step === "setup-status") {
7451
+ if (pendingOneTapSetupAction && (state.step === "setup-status" || state.step === "open-wallet")) {
7685
7452
  if (oneTapLimitSavedDuringSetupRef.current) {
7686
7453
  oneTapLimitSavedDuringSetupRef.current = false;
7687
7454
  authExecutor.resolveOneTapSetup();
@@ -7934,8 +7701,6 @@ function SwypePaymentInner({
7934
7701
  pendingConnections: derived.pendingConnections,
7935
7702
  depositEligibleAccounts: derived.depositEligibleAccounts,
7936
7703
  sourceName: derived.sourceName,
7937
- sourceAddress: derived.sourceAddress,
7938
- sourceVerified: derived.sourceVerified,
7939
7704
  maxSourceBalance: derived.maxSourceBalance,
7940
7705
  tokenCount: derived.tokenCount,
7941
7706
  selectedAccount: derived.selectedAccount,