@trustware/sdk-staging 1.1.8-staging.6 → 1.1.8-staging.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/widget.cjs CHANGED
@@ -543,20 +543,12 @@ var init_styles = __esm({
543
543
  });
544
544
 
545
545
  // src/config/defaults.ts
546
- var DEFAULT_SLIPPAGE, DEFAULT_AUTO_DETECT_PROVIDER, DEFAULT_THEME, DEFAULT_MESSAGES;
546
+ var DEFAULT_SLIPPAGE, DEFAULT_AUTO_DETECT_PROVIDER, DEFAULT_MESSAGES;
547
547
  var init_defaults = __esm({
548
548
  "src/config/defaults.ts"() {
549
549
  "use strict";
550
550
  DEFAULT_SLIPPAGE = 1;
551
551
  DEFAULT_AUTO_DETECT_PROVIDER = false;
552
- DEFAULT_THEME = {
553
- primaryColor: "#4F46E5",
554
- secondaryColor: "#6366F1",
555
- backgroundColor: "#FFFFFF",
556
- textColor: "#111827",
557
- borderColor: "#E5E7EB",
558
- radius: 8
559
- };
560
552
  DEFAULT_MESSAGES = {
561
553
  title: "Trustware SDK",
562
554
  description: "Seamlessly bridge assets across chains with Trustware."
@@ -593,7 +585,7 @@ var init_constants = __esm({
593
585
  "src/constants.ts"() {
594
586
  "use strict";
595
587
  SDK_NAME = "@trustware/sdk";
596
- SDK_VERSION = "1.1.8-staging.6";
588
+ SDK_VERSION = "1.1.8-staging.7";
597
589
  API_ROOT = "https://bv-staging-api.trustware.io";
598
590
  GTM_ID = "GTM-TZDGNCXB";
599
591
  API_PREFIX = "/api";
@@ -2869,14 +2861,7 @@ function useTrustwareConfig() {
2869
2861
  options: {}
2870
2862
  },
2871
2863
  autoDetectProvider: false,
2872
- theme: {
2873
- primaryColor: "#4F46E5",
2874
- secondaryColor: "#6366F1",
2875
- backgroundColor: "#FFFFFF",
2876
- textColor: "#111827",
2877
- borderColor: "#E5E7EB",
2878
- radius: 8
2879
- },
2864
+ theme: "system",
2880
2865
  messages: {
2881
2866
  title: "Trustware SDK",
2882
2867
  description: "Seamlessly bridge assets across chains with Trustware."
@@ -3393,10 +3378,26 @@ function compareChainPopularity(a, b) {
3393
3378
  if (rankA === null && rankB !== null) return 1;
3394
3379
  return 0;
3395
3380
  }
3396
- function sortTokensByPopularity(tokens) {
3381
+ function sortTokensByPopularity(tokens, options) {
3382
+ const nativeSet = options?.nativeAddresses ?? /* @__PURE__ */ new Set();
3383
+ const nativeSymbolSet = options?.nativeSymbols ?? /* @__PURE__ */ new Set();
3384
+ const featuredMap = options?.featuredAddresses ?? /* @__PURE__ */ new Map();
3385
+ const getMajorRank = (token) => {
3386
+ const addr = normalizeAddress3(token.address);
3387
+ if (nativeSet.has(addr)) return 0;
3388
+ if (nativeSymbolSet.has(normalizeSymbol(token.symbol))) return 0;
3389
+ if (featuredMap.has(addr)) return 1;
3390
+ return getGroupRank(token) + 2;
3391
+ };
3397
3392
  return tokens.map((token, index) => ({ token, index })).sort((a, b) => {
3398
- const rankDiff = getGroupRank(a.token) - getGroupRank(b.token);
3399
- if (rankDiff !== 0) return rankDiff;
3393
+ const majorA = getMajorRank(a.token);
3394
+ const majorB = getMajorRank(b.token);
3395
+ if (majorA !== majorB) return majorA - majorB;
3396
+ if (majorA === 1) {
3397
+ const orderA = featuredMap.get(normalizeAddress3(a.token.address)) ?? 0;
3398
+ const orderB = featuredMap.get(normalizeAddress3(b.token.address)) ?? 0;
3399
+ return orderA - orderB;
3400
+ }
3400
3401
  const chainPopularityDiff = compareChainPopularity(a.token, b.token);
3401
3402
  if (chainPopularityDiff !== 0) return chainPopularityDiff;
3402
3403
  const symbolDiff = compareText(a.token.symbol, b.token.symbol);
@@ -3455,6 +3456,1004 @@ var init_tokenPopularity = __esm({
3455
3456
  }
3456
3457
  });
3457
3458
 
3459
+ // src/widget/data/featuredAssets.json
3460
+ var featuredAssets_default;
3461
+ var init_featuredAssets = __esm({
3462
+ "src/widget/data/featuredAssets.json"() {
3463
+ featuredAssets_default = {
3464
+ "1": {
3465
+ top: [
3466
+ {
3467
+ symbol: "AAVE",
3468
+ address: "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9"
3469
+ },
3470
+ {
3471
+ symbol: "LINK",
3472
+ address: "0x514910771af9ca656af840dff83e8264ecf986ca"
3473
+ },
3474
+ {
3475
+ symbol: "UNI",
3476
+ address: "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"
3477
+ },
3478
+ {
3479
+ symbol: "CRV",
3480
+ address: "0xd533a949740bb3306d119cc777fa900ba034cd52"
3481
+ },
3482
+ {
3483
+ symbol: "LDO",
3484
+ address: "0x5a98fcbea516cf06857215779fd812ca3bef1b32"
3485
+ },
3486
+ {
3487
+ symbol: "GRT",
3488
+ address: "0xc944e90c64b2c07662a292be6244bdf05cda44a7"
3489
+ },
3490
+ {
3491
+ symbol: "RENDER",
3492
+ address: "0x6de037ef9ad2725eb40118bb1702ebb27e4aeb24"
3493
+ },
3494
+ {
3495
+ symbol: "PENDLE",
3496
+ address: "0x808507121b80c02388fad14726482e061b8da827"
3497
+ },
3498
+ {
3499
+ symbol: "MKR",
3500
+ address: "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2"
3501
+ },
3502
+ {
3503
+ symbol: "COMP",
3504
+ address: "0xc00e94cb662c3520282e6f5717214004a7f26888"
3505
+ },
3506
+ {
3507
+ symbol: "1INCH",
3508
+ address: "0x111111111117dc0aa78b770fa6a738034120c302"
3509
+ },
3510
+ {
3511
+ symbol: "BAL",
3512
+ address: "0xba100000625a3754423978a60c9317c58a424e3d"
3513
+ },
3514
+ {
3515
+ symbol: "SUSHI",
3516
+ address: "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2"
3517
+ },
3518
+ {
3519
+ symbol: "CAKE",
3520
+ address: "0x152649ea73beab28c5b49b26eb48f7ead6d4c898"
3521
+ },
3522
+ {
3523
+ symbol: "YFI",
3524
+ address: "0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e"
3525
+ }
3526
+ ],
3527
+ stables: [
3528
+ {
3529
+ symbol: "USDT",
3530
+ address: "0xdac17f958d2ee523a2206206994597c13d831ec7"
3531
+ },
3532
+ {
3533
+ symbol: "USDC",
3534
+ address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
3535
+ },
3536
+ {
3537
+ symbol: "DAI",
3538
+ address: "0x6b175474e89094c44da98b954eedeac495271d0f"
3539
+ },
3540
+ {
3541
+ symbol: "USDe",
3542
+ address: "0x4c9edd5852cd905f086c759e8383e09bff1e68b3"
3543
+ },
3544
+ {
3545
+ symbol: "PYUSD",
3546
+ address: "0x6c3ea9036406852006290770bedfcaba0e23a0e8"
3547
+ },
3548
+ {
3549
+ symbol: "FDUSD",
3550
+ address: "0xc5f0f7b66764f6ec8c8dff7ba683102295e16409"
3551
+ },
3552
+ {
3553
+ symbol: "USDS",
3554
+ address: "0xdc035d45d973e3ec169d2276ddab16f1e407384f"
3555
+ },
3556
+ {
3557
+ symbol: "EURC",
3558
+ address: "0x1abaea1f7c830bd89acc67ec4af516284b1bc33c"
3559
+ },
3560
+ {
3561
+ symbol: "crvUSD",
3562
+ address: "0xf939e0a03fb07f59a73314e73794be0e57ac1b4e"
3563
+ },
3564
+ {
3565
+ symbol: "TUSD",
3566
+ address: "0x0000000000085d4780b73119b644ae5ecd22b376"
3567
+ }
3568
+ ]
3569
+ },
3570
+ "10": {
3571
+ top: [
3572
+ {
3573
+ symbol: "OP",
3574
+ address: "0x4200000000000000000000000000000000000042"
3575
+ },
3576
+ {
3577
+ symbol: "AAVE",
3578
+ address: "0x76fb31fb4af56892a25e32cfc43de717950c9278"
3579
+ },
3580
+ {
3581
+ symbol: "LINK",
3582
+ address: "0x350a791bfc2c21f9ed5d10980dad2e2638ffa7f6"
3583
+ },
3584
+ {
3585
+ symbol: "CRV",
3586
+ address: "0x0994206dfe8de6ec6920ff4d779b0d950605fb53"
3587
+ },
3588
+ {
3589
+ symbol: "LDO",
3590
+ address: "0xfdb794692724153d1488ccdbe0c56c252596735f"
3591
+ },
3592
+ {
3593
+ symbol: "ZRO",
3594
+ address: "0x6985884c4392d348587b19cb9eaaf157f13271cd"
3595
+ },
3596
+ {
3597
+ symbol: "STG",
3598
+ address: "0x296f55f8fb28e498b858d0bcda06d955b2cb3f97"
3599
+ }
3600
+ ],
3601
+ stables: [
3602
+ {
3603
+ symbol: "USDT",
3604
+ address: "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58"
3605
+ },
3606
+ {
3607
+ symbol: "USDC",
3608
+ address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85"
3609
+ },
3610
+ {
3611
+ symbol: "DAI",
3612
+ address: "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1"
3613
+ },
3614
+ {
3615
+ symbol: "FRAX",
3616
+ address: "0x2e3d870790dc77a83dd1d18184acc7439a53f475"
3617
+ },
3618
+ {
3619
+ symbol: "LUSD",
3620
+ address: "0xc40f949f8a4e094d1b49a23ea9241d289b7b2819"
3621
+ },
3622
+ {
3623
+ symbol: "MIM",
3624
+ address: "0xb153fb3d196a8eb25522705560ac152eeec57901"
3625
+ },
3626
+ {
3627
+ symbol: "sUSD",
3628
+ address: "0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9"
3629
+ }
3630
+ ]
3631
+ },
3632
+ "100": {
3633
+ top: [],
3634
+ stables: [
3635
+ {
3636
+ symbol: "USDT",
3637
+ address: "0x4ecaba5870353805a9f068101a40e0f32ed605c6"
3638
+ },
3639
+ {
3640
+ symbol: "USDC",
3641
+ address: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83"
3642
+ }
3643
+ ]
3644
+ },
3645
+ "1284": {
3646
+ top: [
3647
+ {
3648
+ symbol: "WELL",
3649
+ address: "0x511ab53f793683763e5a8829738301368a2411e3"
3650
+ }
3651
+ ],
3652
+ stables: [
3653
+ {
3654
+ symbol: "xcUSDC",
3655
+ address: "0xffffffff7d2b0b761af01ca8e25242976ac0ad7d"
3656
+ },
3657
+ {
3658
+ symbol: "FRAX",
3659
+ address: "0x322e86852e492a7ee17f28a78c663da38fb33bfb"
3660
+ }
3661
+ ]
3662
+ },
3663
+ "13371": {
3664
+ top: [],
3665
+ stables: [
3666
+ {
3667
+ symbol: "USDT",
3668
+ address: "0x68bcc7f1190af20e7b572bcfb431c3ac10a936ab"
3669
+ },
3670
+ {
3671
+ symbol: "USDC",
3672
+ address: "0x6de8acc0d406837030ce4dd28e7c08c5a96a30d2"
3673
+ }
3674
+ ]
3675
+ },
3676
+ "137": {
3677
+ top: [
3678
+ {
3679
+ symbol: "AAVE",
3680
+ address: "0xd6df932a45c0f255f85145f286ea0b292b21c90b"
3681
+ },
3682
+ {
3683
+ symbol: "LINK",
3684
+ address: "0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39"
3685
+ },
3686
+ {
3687
+ symbol: "UNI",
3688
+ address: "0xb33eaad8d922b1083446dc23f610c2567fb5180f"
3689
+ },
3690
+ {
3691
+ symbol: "CRV",
3692
+ address: "0x172370d5cd63279efa6d502dab29171933a610af"
3693
+ },
3694
+ {
3695
+ symbol: "LDO",
3696
+ address: "0xc3c7d422809852031b44ab29eec9f1eff2a58756"
3697
+ },
3698
+ {
3699
+ symbol: "GRT",
3700
+ address: "0x5fe2b58c013d7601147dcdd68c143a77499f5531"
3701
+ },
3702
+ {
3703
+ symbol: "RENDER",
3704
+ address: "0x61299774020da444af134c82fa83e3810b309991"
3705
+ },
3706
+ {
3707
+ symbol: "ZRO",
3708
+ address: "0x6985884c4392d348587b19cb9eaaf157f13271cd"
3709
+ },
3710
+ {
3711
+ symbol: "STG",
3712
+ address: "0x2f6f07cdcf3588944bf4c42ac74ff24bf56e7590"
3713
+ },
3714
+ {
3715
+ symbol: "MANA",
3716
+ address: "0xa1c57f48f0deb89f569dfbe6e2b7f46d33606fd4"
3717
+ },
3718
+ {
3719
+ symbol: "TEL",
3720
+ address: "0xdf7837de1f2fa4631d716cf2502f8b230f1dcc32"
3721
+ },
3722
+ {
3723
+ symbol: "BONK",
3724
+ address: "0xe5b49820e5a1063f6f4ddf851327b5e8b2301048"
3725
+ }
3726
+ ],
3727
+ stables: [
3728
+ {
3729
+ symbol: "USDT",
3730
+ address: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f"
3731
+ },
3732
+ {
3733
+ symbol: "USDC",
3734
+ address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"
3735
+ },
3736
+ {
3737
+ symbol: "DAI",
3738
+ address: "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063"
3739
+ },
3740
+ {
3741
+ symbol: "CRVUSD",
3742
+ address: "0xc4ce1d6f5d98d65ee25cf85e9f2e9dcfee6cb5d6"
3743
+ }
3744
+ ]
3745
+ },
3746
+ "143": {
3747
+ top: [],
3748
+ stables: [
3749
+ {
3750
+ symbol: "USDC",
3751
+ address: "0x754704bc059f8c67012fed69bc8a327a5aafb603"
3752
+ }
3753
+ ]
3754
+ },
3755
+ "146": {
3756
+ top: [],
3757
+ stables: [
3758
+ {
3759
+ symbol: "USDT",
3760
+ address: "0x6047828dc181963ba44974801ff68e538da5eaf9"
3761
+ },
3762
+ {
3763
+ symbol: "USDC",
3764
+ address: "0x29219dd400f2bf60e5a23d13be72b486d4038894"
3765
+ }
3766
+ ]
3767
+ },
3768
+ "1868": {
3769
+ top: [],
3770
+ stables: [
3771
+ {
3772
+ symbol: "USDT",
3773
+ address: "0x3a337a6ada9d885b6ad95ec48f9b75f197b5ae35"
3774
+ }
3775
+ ]
3776
+ },
3777
+ "2222": {
3778
+ top: [],
3779
+ stables: [
3780
+ {
3781
+ symbol: "USDt",
3782
+ address: "0x919c1c267bc06a7039e03fcc2ef738525769109c"
3783
+ },
3784
+ {
3785
+ symbol: "MIM",
3786
+ address: "0x471ee749ba270eb4c1165b5ad95e614947f6fceb"
3787
+ }
3788
+ ]
3789
+ },
3790
+ "250": {
3791
+ top: [
3792
+ {
3793
+ symbol: "STG",
3794
+ address: "0x2f6f07cdcf3588944bf4c42ac74ff24bf56e7590"
3795
+ }
3796
+ ],
3797
+ stables: [
3798
+ {
3799
+ symbol: "MIM",
3800
+ address: "0x82f0b8b456c1a451378467398982d4834b6829c1"
3801
+ }
3802
+ ]
3803
+ },
3804
+ "252": {
3805
+ top: [
3806
+ {
3807
+ symbol: "CRV",
3808
+ address: "0x331b9182088e2a7d6d3fe4742aba1fb231aecc56"
3809
+ }
3810
+ ],
3811
+ stables: [
3812
+ {
3813
+ symbol: "frxUSD",
3814
+ address: "0xfc00000000000000000000000000000000000001"
3815
+ }
3816
+ ]
3817
+ },
3818
+ "295": {
3819
+ top: [],
3820
+ stables: [
3821
+ {
3822
+ symbol: "USDC",
3823
+ address: "0x000000000000000000000000000000000006f89a"
3824
+ }
3825
+ ]
3826
+ },
3827
+ "314": {
3828
+ top: [],
3829
+ stables: [
3830
+ {
3831
+ symbol: "ceUSDC",
3832
+ address: "0x2421db204968a367cc2c866cd057fa754cb84edf"
3833
+ }
3834
+ ]
3835
+ },
3836
+ "3338": {
3837
+ top: [],
3838
+ stables: [
3839
+ {
3840
+ symbol: "USDT",
3841
+ address: "0xf4d9235269a96aadafc9adae454a0618ebe37949"
3842
+ },
3843
+ {
3844
+ symbol: "USDC",
3845
+ address: "0xbba60da06c2c5424f03f7434542280fcad453d10"
3846
+ }
3847
+ ]
3848
+ },
3849
+ "42161": {
3850
+ top: [
3851
+ {
3852
+ symbol: "AAVE",
3853
+ address: "0xba5ddd1f9d7f570dc94a51479a000e3bce967196"
3854
+ },
3855
+ {
3856
+ symbol: "LINK",
3857
+ address: "0xf97f4df75117a78c1a5a0dbb814af92458539fb4"
3858
+ },
3859
+ {
3860
+ symbol: "UNI",
3861
+ address: "0xfa7f8980b0f1e64a2062791cc3b0871572f1f7f0"
3862
+ },
3863
+ {
3864
+ symbol: "CRV",
3865
+ address: "0x11cdb42b0eb46d95f990bedd4695a6e3fa034978"
3866
+ },
3867
+ {
3868
+ symbol: "GRT",
3869
+ address: "0x9623063377ad1b27544c965ccd7342f7ea7e88c7"
3870
+ },
3871
+ {
3872
+ symbol: "PENDLE",
3873
+ address: "0x0c880f6761f1af8d9aa9c466984b80dab9a8c9e8"
3874
+ },
3875
+ {
3876
+ symbol: "SUSHI",
3877
+ address: "0xd4d42f0b6def4ce0383636770ef773390d85c61a"
3878
+ },
3879
+ {
3880
+ symbol: "CAKE",
3881
+ address: "0x1b896893dfc86bb67cf57767298b9073d2c1ba2c"
3882
+ },
3883
+ {
3884
+ symbol: "ZRO",
3885
+ address: "0x6985884c4392d348587b19cb9eaaf157f13271cd"
3886
+ },
3887
+ {
3888
+ symbol: "STG",
3889
+ address: "0x6694340fc020c5e6b96567843da2df01b2ce1eb6"
3890
+ },
3891
+ {
3892
+ symbol: "ARB",
3893
+ address: "0x912ce59144191c1204e64559fe8253a0e49e6548"
3894
+ },
3895
+ {
3896
+ symbol: "cbBTC",
3897
+ address: "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf"
3898
+ },
3899
+ {
3900
+ symbol: "BONK",
3901
+ address: "0x09199d9a5f4448d0848e4395d065e1ad9c4a1f74"
3902
+ }
3903
+ ],
3904
+ stables: [
3905
+ {
3906
+ symbol: "USDT",
3907
+ address: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"
3908
+ },
3909
+ {
3910
+ symbol: "USDC",
3911
+ address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831"
3912
+ },
3913
+ {
3914
+ symbol: "DAI",
3915
+ address: "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1"
3916
+ },
3917
+ {
3918
+ symbol: "PYUSD",
3919
+ address: "0x46850ad61c2b7d64d08c9c754f45254596696984"
3920
+ },
3921
+ {
3922
+ symbol: "USDD",
3923
+ address: "0x680447595e8b7b3aa1b43beb9f6098c79ac2ab3f"
3924
+ },
3925
+ {
3926
+ symbol: "FRAX",
3927
+ address: "0x17fc002b466eec40dae837fc4be5c67993ddbd6f"
3928
+ },
3929
+ {
3930
+ symbol: "LUSD",
3931
+ address: "0x93b346b6bc2548da6a1e7d98e9a421b42541425b"
3932
+ },
3933
+ {
3934
+ symbol: "MIM",
3935
+ address: "0xfea7a6a0b346362bf88a9e4a88416b77a57d6c2a"
3936
+ }
3937
+ ]
3938
+ },
3939
+ "42220": {
3940
+ top: [],
3941
+ stables: [
3942
+ {
3943
+ symbol: "USDT",
3944
+ address: "0x48065fbbe25f71c9282ddf5e1cd6d6a887483d5e"
3945
+ },
3946
+ {
3947
+ symbol: "USDC",
3948
+ address: "0xceba9300f2b948710d2653dd7b07f33a8b32118c"
3949
+ }
3950
+ ]
3951
+ },
3952
+ "43114": {
3953
+ top: [
3954
+ {
3955
+ symbol: "PENDLE",
3956
+ address: "0xfb98b335551a418cd0737375a2ea0ded62ea213b"
3957
+ },
3958
+ {
3959
+ symbol: "ZRO",
3960
+ address: "0x6985884c4392d348587b19cb9eaaf157f13271cd"
3961
+ },
3962
+ {
3963
+ symbol: "STG",
3964
+ address: "0x2f6f07cdcf3588944bf4c42ac74ff24bf56e7590"
3965
+ }
3966
+ ],
3967
+ stables: [
3968
+ {
3969
+ symbol: "USDT",
3970
+ address: "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7"
3971
+ },
3972
+ {
3973
+ symbol: "USDC",
3974
+ address: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e"
3975
+ },
3976
+ {
3977
+ symbol: "EURC",
3978
+ address: "0xc891eb4cbdeff6e073e859e987815ed1505c2acd"
3979
+ },
3980
+ {
3981
+ symbol: "FRAX",
3982
+ address: "0xd24c2ad096400b6fbcd2ad8b24e7acbc21a1da64"
3983
+ },
3984
+ {
3985
+ symbol: "MIM",
3986
+ address: "0x130966628846bfd36ff31a822705796e8cb8c18d"
3987
+ }
3988
+ ]
3989
+ },
3990
+ "5000": {
3991
+ top: [],
3992
+ stables: [
3993
+ {
3994
+ symbol: "USDT",
3995
+ address: "0x201eba5cc46d216ce6dc03f6a759e8e766e956ae"
3996
+ },
3997
+ {
3998
+ symbol: "USDC",
3999
+ address: "0x09bc4e0d864854c6afb6eb9a9cdf58ac190d0df9"
4000
+ },
4001
+ {
4002
+ symbol: "mUSD",
4003
+ address: "0xab575258d37eaa5c8956efabe71f4ee8f6397cf3"
4004
+ }
4005
+ ]
4006
+ },
4007
+ "534352": {
4008
+ top: [],
4009
+ stables: [
4010
+ {
4011
+ symbol: "USDT",
4012
+ address: "0xf55bec9cafdbe8730f096aa55dad6d22d44099df"
4013
+ },
4014
+ {
4015
+ symbol: "USDC",
4016
+ address: "0x06efdbff2a14a7c8e15944d1f4a48f9f95f663a4"
4017
+ }
4018
+ ]
4019
+ },
4020
+ "56": {
4021
+ top: [
4022
+ {
4023
+ symbol: "AAVE",
4024
+ address: "0xfb6115445bff7b52feb98650c87f44907e58f802"
4025
+ },
4026
+ {
4027
+ symbol: "LINK",
4028
+ address: "0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd"
4029
+ },
4030
+ {
4031
+ symbol: "UNI",
4032
+ address: "0xbf5140a22578168fd562dccf235e5d43a02ce9b1"
4033
+ },
4034
+ {
4035
+ symbol: "PENDLE",
4036
+ address: "0xb3ed0a426155b79b898849803e3b36552f7ed507"
4037
+ },
4038
+ {
4039
+ symbol: "COMP",
4040
+ address: "0x52ce071bd9b1c4b00a0b92d298c512478cad67e8"
4041
+ },
4042
+ {
4043
+ symbol: "CAKE",
4044
+ address: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82"
4045
+ },
4046
+ {
4047
+ symbol: "ZRO",
4048
+ address: "0x6985884c4392d348587b19cb9eaaf157f13271cd"
4049
+ },
4050
+ {
4051
+ symbol: "STG",
4052
+ address: "0xb0d502e938ed5f4df2e681fe6e419ff29631d62b"
4053
+ },
4054
+ {
4055
+ symbol: "AXS",
4056
+ address: "0x715d400f88c167884bbcc41c5fea407ed4d2f8a0"
4057
+ },
4058
+ {
4059
+ symbol: "BONK",
4060
+ address: "0xa697e272a73744b343528c3bc4702f2565b2f422"
4061
+ }
4062
+ ],
4063
+ stables: [
4064
+ {
4065
+ symbol: "USDT",
4066
+ address: "0x55d398326f99059ff775485246999027b3197955"
4067
+ },
4068
+ {
4069
+ symbol: "USDC",
4070
+ address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"
4071
+ },
4072
+ {
4073
+ symbol: "FDUSD",
4074
+ address: "0xc5f0f7b66764f6ec8c8dff7ba683102295e16409"
4075
+ },
4076
+ {
4077
+ symbol: "TUSD",
4078
+ address: "0x40af3827f39d0eacbf4a168f8d4ee67c121d11c9"
4079
+ }
4080
+ ]
4081
+ },
4082
+ "59144": {
4083
+ top: [
4084
+ {
4085
+ symbol: "Cake",
4086
+ address: "0x0d1e753a25ebda689453309112904807625befbe"
4087
+ }
4088
+ ],
4089
+ stables: [
4090
+ {
4091
+ symbol: "USDC",
4092
+ address: "0x176211869ca2b568f2a7d4ee941e073a821ee1ff"
4093
+ }
4094
+ ]
4095
+ },
4096
+ "80094": {
4097
+ top: [],
4098
+ stables: [
4099
+ {
4100
+ symbol: "MIM",
4101
+ address: "0x5b82028cfc477c4e7dda7ff33d59a23fa7be002a"
4102
+ }
4103
+ ]
4104
+ },
4105
+ "8453": {
4106
+ top: [
4107
+ {
4108
+ symbol: "AAVE",
4109
+ address: "0x63706e401c06ac8513145b7687a14804d17f814b"
4110
+ },
4111
+ {
4112
+ symbol: "PENDLE",
4113
+ address: "0xa99f6e6785da0f5d6fb42495fe424bce029eeb3e"
4114
+ },
4115
+ {
4116
+ symbol: "COMP",
4117
+ address: "0x9e1028f5f1d5ede59748ffcee5532509976840e0"
4118
+ },
4119
+ {
4120
+ symbol: "CAKE",
4121
+ address: "0x3055913c90fcc1a6ce9a358911721eeb942013a1"
4122
+ },
4123
+ {
4124
+ symbol: "YFI",
4125
+ address: "0x9eaf8c1e34f05a589eda6bafdf391cf6ad3cb239"
4126
+ },
4127
+ {
4128
+ symbol: "ZRO",
4129
+ address: "0x6985884c4392d348587b19cb9eaaf157f13271cd"
4130
+ },
4131
+ {
4132
+ symbol: "STG",
4133
+ address: "0xe3b53af74a4bf62ae5511055290838050bf764df"
4134
+ },
4135
+ {
4136
+ symbol: "cbBTC",
4137
+ address: "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf"
4138
+ },
4139
+ {
4140
+ symbol: "AERO",
4141
+ address: "0x940181a94a35a4569e4529a3cdfb74e38fd98631"
4142
+ },
4143
+ {
4144
+ symbol: "VIRTUAL",
4145
+ address: "0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b"
4146
+ },
4147
+ {
4148
+ symbol: "MORPHO",
4149
+ address: "0xbaa5cc21fd487b8fcc2f632f3f4e8d37262a0842"
4150
+ },
4151
+ {
4152
+ symbol: "BRETT",
4153
+ address: "0x532f27101965dd16442e59d40670faf5ebb142e4"
4154
+ },
4155
+ {
4156
+ symbol: "DEGEN",
4157
+ address: "0x4ed4e862860bed51a9570b96d89af5e1b0efefed"
4158
+ },
4159
+ {
4160
+ symbol: "WELL",
4161
+ address: "0xa88594d404727625a9437c3f886c7643872296ae"
4162
+ },
4163
+ {
4164
+ symbol: "ZORA",
4165
+ address: "0x1111111111166b7fe7bd91427724b487980afc69"
4166
+ }
4167
+ ],
4168
+ stables: [
4169
+ {
4170
+ symbol: "USDC",
4171
+ address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
4172
+ },
4173
+ {
4174
+ symbol: "DAI",
4175
+ address: "0x50c5725949a6f0c72e6c4a641f24049a917db0cb"
4176
+ },
4177
+ {
4178
+ symbol: "USDS",
4179
+ address: "0x820c137fa70c8691f0e44dc420a5e53c168921dc"
4180
+ },
4181
+ {
4182
+ symbol: "EURC",
4183
+ address: "0x60a3e35cc302bfa44cb288bc5a4f316fdb1adb42"
4184
+ }
4185
+ ]
4186
+ },
4187
+ "999": {
4188
+ top: [
4189
+ {
4190
+ symbol: "AXL",
4191
+ address: "0xc4dc717136b8fd754df181d122914c2866f11a79"
4192
+ }
4193
+ ],
4194
+ stables: [
4195
+ {
4196
+ symbol: "USDC",
4197
+ address: "0xb88339cb7199b77e23db6e890353e22632ba630f"
4198
+ }
4199
+ ]
4200
+ },
4201
+ "agoric-3": {
4202
+ top: [],
4203
+ stables: [
4204
+ {
4205
+ symbol: "USDC",
4206
+ address: "ibc/FE98AAD68F02F03565E9FA39A5E627946699B2B07115889ED812D8BA639576A9"
4207
+ }
4208
+ ]
4209
+ },
4210
+ "archway-1": {
4211
+ top: [],
4212
+ stables: [
4213
+ {
4214
+ symbol: "USDC",
4215
+ address: "ibc/43897B9739BD63E3A08A88191999C632E052724AB96BD4C74AE31375C991F48D"
4216
+ }
4217
+ ]
4218
+ },
4219
+ "axelar-dojo-1": {
4220
+ top: [],
4221
+ stables: [
4222
+ {
4223
+ symbol: "USDe",
4224
+ address: "usde-wei"
4225
+ }
4226
+ ]
4227
+ },
4228
+ "core-1": {
4229
+ top: [],
4230
+ stables: [
4231
+ {
4232
+ symbol: "USDT",
4233
+ address: "ibc/C559977F5797BDC1D74C0836A10C379C991D664166CB60D776A83029852431B4"
4234
+ },
4235
+ {
4236
+ symbol: "USDC",
4237
+ address: "ibc/B3792E4A62DF4A934EF2DF5968556DB56F5776ED25BDE11188A4F58A7DD406F0"
4238
+ }
4239
+ ]
4240
+ },
4241
+ "cosmoshub-4": {
4242
+ top: [],
4243
+ stables: [
4244
+ {
4245
+ symbol: "USDC",
4246
+ address: "ibc/F663521BF1836B00F5F177680F74BFB9A8B5654A694D0D2BC249E03CF2509013"
4247
+ }
4248
+ ]
4249
+ },
4250
+ "crescent-1": {
4251
+ top: [
4252
+ {
4253
+ symbol: "AXL",
4254
+ address: "ibc/0634D0993744740D675AD01E81156EAC945AEAAE17C074918DC7FF52F41B263E"
4255
+ }
4256
+ ],
4257
+ stables: []
4258
+ },
4259
+ "dydx-mainnet-1": {
4260
+ top: [],
4261
+ stables: [
4262
+ {
4263
+ symbol: "USDC",
4264
+ address: "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5"
4265
+ }
4266
+ ]
4267
+ },
4268
+ "dymension_1100-1": {
4269
+ top: [],
4270
+ stables: [
4271
+ {
4272
+ symbol: "USDC",
4273
+ address: "ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4"
4274
+ }
4275
+ ]
4276
+ },
4277
+ "elys-1": {
4278
+ top: [
4279
+ {
4280
+ symbol: "LINK",
4281
+ address: "ibc/2A20C613F2BA256BE9FAD791B0743FBC4FE3C998EDF9234D969172F7D42FB8E7"
4282
+ }
4283
+ ],
4284
+ stables: [
4285
+ {
4286
+ symbol: "USDC",
4287
+ address: "ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349"
4288
+ }
4289
+ ]
4290
+ },
4291
+ "juno-1": {
4292
+ top: [
4293
+ {
4294
+ symbol: "AXL",
4295
+ address: "ibc/EBE900AED8FF6BB2E186B17B066138F647CDD9647EF4FBE2DE6C8D4013A2C990"
4296
+ }
4297
+ ],
4298
+ stables: [
4299
+ {
4300
+ symbol: "USDC",
4301
+ address: "ibc/4A482FA914A4B9B05801ED81C33713899F322B24F76A06F4B8FE872485EA22FF"
4302
+ }
4303
+ ]
4304
+ },
4305
+ "kaiyo-1": {
4306
+ top: [
4307
+ {
4308
+ symbol: "AXL",
4309
+ address: "ibc/C01154C2547F4CB10A985EA78E7CD4BA891C1504360703A37E1D7043F06B5E1F"
4310
+ }
4311
+ ],
4312
+ stables: [
4313
+ {
4314
+ symbol: "USDC",
4315
+ address: "ibc/FE98AAD68F02F03565E9FA39A5E627946699B2B07115889ED812D8BA639576A9"
4316
+ }
4317
+ ]
4318
+ },
4319
+ "kava_2222-10": {
4320
+ top: [],
4321
+ stables: [
4322
+ {
4323
+ symbol: "USDT",
4324
+ address: "erc20/tether/usdt"
4325
+ }
4326
+ ]
4327
+ },
4328
+ "lava-mainnet-1": {
4329
+ top: [
4330
+ {
4331
+ symbol: "OPaxl",
4332
+ address: "ibc/8F54CE650A35D2B04630DD57F91D6552E7FCA9002DBF1CFBA1254675C194C8C8"
4333
+ }
4334
+ ],
4335
+ stables: []
4336
+ },
4337
+ "migaloo-1": {
4338
+ top: [],
4339
+ stables: [
4340
+ {
4341
+ symbol: "USDC",
4342
+ address: "ibc/BC5C0BAFD19A5E4133FDA0F3E04AE1FBEE75A4A226554B2CBB021089FF2E1F8A"
4343
+ }
4344
+ ]
4345
+ },
4346
+ "neutron-1": {
4347
+ top: [
4348
+ {
4349
+ symbol: "AXL",
4350
+ address: "ibc/C0E66D1C81D8AAF0E6896E05190FDFBC222367148F86AC3EA679C28327A763CD"
4351
+ }
4352
+ ],
4353
+ stables: [
4354
+ {
4355
+ symbol: "USDC",
4356
+ address: "ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81"
4357
+ }
4358
+ ]
4359
+ },
4360
+ "noble-1": {
4361
+ top: [],
4362
+ stables: [
4363
+ {
4364
+ symbol: "USDY",
4365
+ address: "ausdy"
4366
+ }
4367
+ ]
4368
+ },
4369
+ "osmosis-1": {
4370
+ top: [
4371
+ {
4372
+ symbol: "AXL",
4373
+ address: "ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E"
4374
+ }
4375
+ ],
4376
+ stables: [
4377
+ {
4378
+ symbol: "USDT",
4379
+ address: "ibc/4ABBEF4C8926DDDB320AE5188CFD63267ABBCEFC0583E4AE05D6E5AA2401DDAB"
4380
+ },
4381
+ {
4382
+ symbol: "USDC",
4383
+ address: "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4"
4384
+ },
4385
+ {
4386
+ symbol: "USDY",
4387
+ address: "ibc/23104D411A6EB6031FA92FB75F227422B84989969E91DCAD56A535DD7FF0A373"
4388
+ }
4389
+ ]
4390
+ },
4391
+ "phoenix-1": {
4392
+ top: [],
4393
+ stables: [
4394
+ {
4395
+ symbol: "USDC",
4396
+ address: "ibc/2C962DAB9F57FE0921435426AE75196009FAA1981BF86991203C8411F8980FDB"
4397
+ }
4398
+ ]
4399
+ },
4400
+ "ssc-1": {
4401
+ top: [
4402
+ {
4403
+ symbol: "UNI",
4404
+ address: "ibc/E4859520008F30CAB8A6548A390BC10C45F667A26A5A22D8891A79589DF57C41"
4405
+ }
4406
+ ],
4407
+ stables: [
4408
+ {
4409
+ symbol: "USDT",
4410
+ address: "ibc/B5F6DCC4FEF6BBBC356C67C46072AB3C01443FB5E3D19538C52A3CD439BE6BE3"
4411
+ },
4412
+ {
4413
+ symbol: "USDC",
4414
+ address: "ibc/37EF240838413BD7D3496183213F7F0F483EC7A330328F16AD901A1AC1450F72"
4415
+ },
4416
+ {
4417
+ symbol: "USDe",
4418
+ address: "ibc/23B8A6E4D4AD864A4DF7FBBC40818473691395EF9B6D8B8277037D536417768E"
4419
+ },
4420
+ {
4421
+ symbol: "USDY",
4422
+ address: "ibc/2115CC1B823DE5CC635692CB95E50E1C601A9B432703F7A611B4E492A914D968"
4423
+ }
4424
+ ]
4425
+ },
4426
+ "stargaze-1": {
4427
+ top: [],
4428
+ stables: [
4429
+ {
4430
+ symbol: "USDC",
4431
+ address: "ibc/4A1C18CA7F50544760CF306189B810CE4C1CB156C7FC870143D401FE7280E591"
4432
+ }
4433
+ ]
4434
+ },
4435
+ "umee-1": {
4436
+ top: [
4437
+ {
4438
+ symbol: "AXL",
4439
+ address: "ibc/D1CB2804AA5EB64D503F28E8DF3552F8A4D642802B66EFE50DE432B755F37AE1"
4440
+ }
4441
+ ],
4442
+ stables: []
4443
+ },
4444
+ "xion-mainnet-1": {
4445
+ top: [],
4446
+ stables: [
4447
+ {
4448
+ symbol: "USDC",
4449
+ address: "ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349"
4450
+ }
4451
+ ]
4452
+ }
4453
+ };
4454
+ }
4455
+ });
4456
+
3458
4457
  // src/core/useTokens.ts
3459
4458
  function mapTokenDefToToken(tokenDef) {
3460
4459
  return {
@@ -3576,13 +4575,40 @@ function useTokens(chainId) {
3576
4575
  setIsLoadingMore(false);
3577
4576
  }
3578
4577
  };
4578
+ const featuredAddresses = (0, import_react5.useMemo)(() => {
4579
+ const key = chainId?.toString() ?? "";
4580
+ const chain = FEATURED[key];
4581
+ if (!chain) return /* @__PURE__ */ new Map();
4582
+ const map = /* @__PURE__ */ new Map();
4583
+ let order = 0;
4584
+ for (const s of chain.stables) map.set(s.address.toLowerCase(), order++);
4585
+ for (const t of chain.top) map.set(t.address.toLowerCase(), order++);
4586
+ return map;
4587
+ }, [chainId]);
4588
+ const nativeSymbols = (0, import_react5.useMemo)(() => {
4589
+ if (!chainId) return /* @__PURE__ */ new Set();
4590
+ const chain = chainMap.get(chainId.toString());
4591
+ const sym = chain?.nativeCurrency?.symbol;
4592
+ if (!sym) return /* @__PURE__ */ new Set();
4593
+ return /* @__PURE__ */ new Set([sym.toUpperCase()]);
4594
+ }, [chainId, chainMap]);
3579
4595
  const filteredTokens = (0, import_react5.useMemo)(() => {
3580
4596
  const query = searchQuery.toLowerCase().trim();
3581
4597
  const source = query.length === 0 || tokensPaginationEnabled ? tokens : tokens.filter(
3582
4598
  (token) => token.symbol.toLowerCase().includes(query) || token.name.toLowerCase().includes(query) || token.address.toLowerCase().includes(query)
3583
4599
  );
3584
- return sortTokensByPopularity(source);
3585
- }, [tokens, searchQuery, tokensPaginationEnabled]);
4600
+ return sortTokensByPopularity(source, {
4601
+ nativeAddresses: NATIVE_ADDRESSES,
4602
+ nativeSymbols,
4603
+ featuredAddresses
4604
+ });
4605
+ }, [
4606
+ tokens,
4607
+ searchQuery,
4608
+ tokensPaginationEnabled,
4609
+ nativeSymbols,
4610
+ featuredAddresses
4611
+ ]);
3586
4612
  return {
3587
4613
  tokens,
3588
4614
  filteredTokens,
@@ -3595,7 +4621,7 @@ function useTokens(chainId) {
3595
4621
  isLoadingMore
3596
4622
  };
3597
4623
  }
3598
- var import_react5, DEFAULT_PAGE_LIMIT;
4624
+ var import_react5, FEATURED, NATIVE_ADDRESSES, DEFAULT_PAGE_LIMIT;
3599
4625
  var init_useTokens = __esm({
3600
4626
  "src/core/useTokens.ts"() {
3601
4627
  "use strict";
@@ -3604,6 +4630,15 @@ var init_useTokens = __esm({
3604
4630
  init_useChains();
3605
4631
  init_tokenPopularity();
3606
4632
  init_store();
4633
+ init_chainHelpers();
4634
+ init_featuredAssets();
4635
+ FEATURED = featuredAssets_default;
4636
+ NATIVE_ADDRESSES = /* @__PURE__ */ new Set([
4637
+ NATIVE_EVM2.toLowerCase(),
4638
+ NATIVE_SOLANA2.toLowerCase(),
4639
+ // Some EVM chains (e.g. ZKsync, HyperEVM) use the zero address for the native token
4640
+ "0x0000000000000000000000000000000000000000"
4641
+ ]);
3607
4642
  DEFAULT_PAGE_LIMIT = 100;
3608
4643
  }
3609
4644
  });
@@ -7072,7 +8107,7 @@ function resolveConfig(input) {
7072
8107
  ...input.routes.options
7073
8108
  }
7074
8109
  };
7075
- const theme = deepMerge(DEFAULT_THEME, input.theme);
8110
+ const theme = input.theme ?? "system";
7076
8111
  const messages = deepMerge(DEFAULT_MESSAGES, input.messages);
7077
8112
  const retry = {
7078
8113
  autoRetry: input.retry?.autoRetry ?? DEFAULT_RETRY_CONFIG.autoRetry,
@@ -7150,10 +8185,7 @@ var init_store = __esm({
7150
8185
  ...this._cfg,
7151
8186
  ...patch,
7152
8187
  routes: { ...this._cfg.routes, ...patch.routes ?? {} },
7153
- theme: {
7154
- ...this._cfg.theme,
7155
- ...patch.theme ?? {}
7156
- },
8188
+ theme: patch.theme ?? this._cfg.theme,
7157
8189
  messages: {
7158
8190
  ...this._cfg.messages,
7159
8191
  ...patch.messages ?? {}
@@ -7553,27 +8585,38 @@ var init_useDepositNavigationState = __esm({
7553
8585
  });
7554
8586
 
7555
8587
  // src/widget/state/deposit/useThemePreference.ts
7556
- function getInitialTheme() {
7557
- if (typeof window === "undefined") {
7558
- return "light";
7559
- }
8588
+ function resolveConfigTheme(configTheme) {
8589
+ if (typeof window === "undefined") return "light";
8590
+ if (configTheme !== "system") return configTheme;
7560
8591
  try {
7561
8592
  const stored = localStorage.getItem(THEME_STORAGE_KEY);
7562
- if (stored === "light" || stored === "dark") {
7563
- return stored;
7564
- }
8593
+ if (stored === "light" || stored === "dark") return stored;
7565
8594
  } catch {
7566
8595
  }
7567
- if (typeof window !== "undefined" && window.matchMedia) {
7568
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
7569
- }
7570
- return "light";
8596
+ return window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
7571
8597
  }
7572
- function useThemePreference() {
7573
- const [resolvedTheme, setResolvedTheme] = (0, import_react14.useState)("light");
7574
- (0, import_react15.useEffect)(() => {
7575
- setResolvedTheme(getInitialTheme());
7576
- }, []);
8598
+ function useThemePreference(configTheme = "system") {
8599
+ const [resolvedTheme, setResolvedTheme] = (0, import_react14.useState)(
8600
+ () => resolveConfigTheme(configTheme)
8601
+ );
8602
+ (0, import_react14.useEffect)(() => {
8603
+ setResolvedTheme(resolveConfigTheme(configTheme));
8604
+ }, [configTheme]);
8605
+ (0, import_react14.useEffect)(() => {
8606
+ if (configTheme !== "system") return;
8607
+ if (typeof window === "undefined" || !window.matchMedia) return;
8608
+ try {
8609
+ const stored = localStorage.getItem(THEME_STORAGE_KEY);
8610
+ if (stored === "light" || stored === "dark") return;
8611
+ } catch {
8612
+ }
8613
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
8614
+ const handler = (e2) => {
8615
+ setResolvedTheme(e2.matches ? "dark" : "light");
8616
+ };
8617
+ mediaQuery.addEventListener("change", handler);
8618
+ return () => mediaQuery.removeEventListener("change", handler);
8619
+ }, [configTheme]);
7577
8620
  const toggleTheme = (0, import_react14.useCallback)(() => {
7578
8621
  setResolvedTheme((current) => {
7579
8622
  const nextTheme = current === "light" ? "dark" : "light";
@@ -7589,28 +8632,27 @@ function useThemePreference() {
7589
8632
  toggleTheme
7590
8633
  };
7591
8634
  }
7592
- var import_react14, import_react15, THEME_STORAGE_KEY;
8635
+ var import_react14, THEME_STORAGE_KEY;
7593
8636
  var init_useThemePreference = __esm({
7594
8637
  "src/widget/state/deposit/useThemePreference.ts"() {
7595
8638
  "use strict";
7596
8639
  import_react14 = require("react");
7597
- import_react15 = require("react");
7598
8640
  THEME_STORAGE_KEY = "trustware-widget-theme";
7599
8641
  }
7600
8642
  });
7601
8643
 
7602
8644
  // src/widget/state/deposit/useWalletSessionState.ts
7603
8645
  function useWalletSessionState() {
7604
- const [selectedWallet, setSelectedWallet] = (0, import_react16.useState)(walletManager.wallet);
7605
- const [walletAddress, setWalletAddress] = (0, import_react16.useState)(null);
7606
- const [walletStatus, setWalletStatus] = (0, import_react16.useState)(
8646
+ const [selectedWallet, setSelectedWallet] = (0, import_react15.useState)(walletManager.wallet);
8647
+ const [walletAddress, setWalletAddress] = (0, import_react15.useState)(null);
8648
+ const [walletStatus, setWalletStatus] = (0, import_react15.useState)(
7607
8649
  walletManager.status
7608
8650
  );
7609
8651
  const { detected } = useWalletDetection();
7610
- (0, import_react16.useEffect)(() => {
8652
+ (0, import_react15.useEffect)(() => {
7611
8653
  walletManager.setDetected(detected);
7612
8654
  }, [detected]);
7613
- (0, import_react16.useEffect)(() => {
8655
+ (0, import_react15.useEffect)(() => {
7614
8656
  const unsubscribe = walletManager.onChange((status) => {
7615
8657
  setWalletStatus(status);
7616
8658
  setSelectedWallet(walletManager.wallet);
@@ -7631,13 +8673,13 @@ function useWalletSessionState() {
7631
8673
  unsubscribe();
7632
8674
  };
7633
8675
  }, []);
7634
- const connectWallet = (0, import_react16.useCallback)(async (wallet) => {
8676
+ const connectWallet = (0, import_react15.useCallback)(async (wallet) => {
7635
8677
  await walletManager.connectDetected(wallet);
7636
8678
  const error = walletManager.error;
7637
8679
  const api = walletManager.wallet;
7638
8680
  return { error, api };
7639
8681
  }, []);
7640
- const disconnectWallet = (0, import_react16.useCallback)(async () => {
8682
+ const disconnectWallet = (0, import_react15.useCallback)(async () => {
7641
8683
  await walletManager.disconnect();
7642
8684
  }, []);
7643
8685
  return {
@@ -7648,11 +8690,11 @@ function useWalletSessionState() {
7648
8690
  disconnectWallet
7649
8691
  };
7650
8692
  }
7651
- var import_react16;
8693
+ var import_react15;
7652
8694
  var init_useWalletSessionState = __esm({
7653
8695
  "src/widget/state/deposit/useWalletSessionState.ts"() {
7654
8696
  "use strict";
7655
- import_react16 = require("react");
8697
+ import_react15 = require("react");
7656
8698
  init_wallets();
7657
8699
  }
7658
8700
  });
@@ -7664,7 +8706,7 @@ function useWalletConnect({
7664
8706
  }) {
7665
8707
  const walletConnectCfg = TrustwareConfigStore.peek()?.walletConnect;
7666
8708
  const connectWC = useWalletConnectConnect(walletConnectCfg);
7667
- const WalletConnect = (0, import_react17.useCallback)(async () => {
8709
+ const WalletConnect = (0, import_react16.useCallback)(async () => {
7668
8710
  if (walletManager.status === "connected" && walletManager.connectedVia === "walletconnect") {
7669
8711
  const address = walletManager.identity?.addresses[0]?.address ?? null;
7670
8712
  if (address) {
@@ -7684,7 +8726,7 @@ function useWalletConnect({
7684
8726
  setWalletType("other");
7685
8727
  }
7686
8728
  }, [connectWC, setCurrentStep, setWalletType]);
7687
- const disconnectWalletConnect = (0, import_react17.useCallback)(async () => {
8729
+ const disconnectWalletConnect = (0, import_react16.useCallback)(async () => {
7688
8730
  await walletManager.disconnect();
7689
8731
  setWalletType("other");
7690
8732
  setCurrentStep("home");
@@ -7696,11 +8738,11 @@ function useWalletConnect({
7696
8738
  disconnectWalletConnect
7697
8739
  };
7698
8740
  }
7699
- var import_react17;
8741
+ var import_react16;
7700
8742
  var init_useWalletConnect = __esm({
7701
8743
  "src/widget/state/deposit/useWalletConnect.ts"() {
7702
8744
  "use strict";
7703
- import_react17 = require("react");
8745
+ import_react16 = require("react");
7704
8746
  init_config2();
7705
8747
  init_wallets();
7706
8748
  }
@@ -7721,7 +8763,8 @@ function DepositProvider({
7721
8763
  resetNavigation,
7722
8764
  setCurrentStepInternal
7723
8765
  } = useDepositNavigationState(initialStep);
7724
- const { resolvedTheme, toggleTheme } = useThemePreference();
8766
+ const config = useTrustwareConfig();
8767
+ const { resolvedTheme, toggleTheme } = useThemePreference(config.theme);
7725
8768
  const {
7726
8769
  selectedWallet,
7727
8770
  walletAddress: otherWalletAddress,
@@ -7729,21 +8772,21 @@ function DepositProvider({
7729
8772
  connectWallet,
7730
8773
  disconnectWallet
7731
8774
  } = useWalletSessionState();
7732
- const [amountInputMode, setAmountInputMode] = (0, import_react18.useState)(
8775
+ const [amountInputMode, setAmountInputMode] = (0, import_react17.useState)(
7733
8776
  "usd"
7734
8777
  );
7735
- const [walletType, setWalletType] = (0, import_react18.useState)(
8778
+ const [walletType, setWalletType] = (0, import_react17.useState)(
7736
8779
  "other"
7737
8780
  );
7738
8781
  const { walletConnectAddress, WalletConnect, disconnectWalletConnect } = useWalletConnect({
7739
8782
  setWalletType,
7740
8783
  setCurrentStep
7741
8784
  });
7742
- const [selectedToken, setSelectedToken] = (0, import_react18.useState)(null);
7743
- const [selectedChain, setSelectedChain] = (0, import_react18.useState)(null);
7744
- const [amount, setAmount] = (0, import_react18.useState)("");
7745
- const [selectedNamespace, setSelectedNamespace] = (0, import_react18.useState)("evm");
7746
- const walletAddress = (0, import_react18.useMemo)(
8785
+ const [selectedToken, setSelectedToken] = (0, import_react17.useState)(null);
8786
+ const [selectedChain, setSelectedChain] = (0, import_react17.useState)(null);
8787
+ const [amount, setAmount] = (0, import_react17.useState)("");
8788
+ const [selectedNamespace, setSelectedNamespace] = (0, import_react17.useState)("evm");
8789
+ const walletAddress = (0, import_react17.useMemo)(
7747
8790
  () => walletType === "walletconnect" ? walletConnectAddress : otherWalletAddress,
7748
8791
  [walletType, walletConnectAddress, otherWalletAddress]
7749
8792
  );
@@ -7760,12 +8803,12 @@ function DepositProvider({
7760
8803
  selectedToken,
7761
8804
  setSelectedToken
7762
8805
  });
7763
- const [transactionStatus, setTransactionStatus] = (0, import_react18.useState)("idle");
7764
- const [transactionHash, setTransactionHash] = (0, import_react18.useState)(null);
7765
- const [errorMessage, setErrorMessage] = (0, import_react18.useState)(null);
7766
- const [intentId, setIntentId] = (0, import_react18.useState)(null);
7767
- const [paymentMethod, setPaymentMethod] = (0, import_react18.useState)("crypto");
7768
- const resetState = import_react18.default.useCallback(() => {
8806
+ const [transactionStatus, setTransactionStatus] = (0, import_react17.useState)("idle");
8807
+ const [transactionHash, setTransactionHash] = (0, import_react17.useState)(null);
8808
+ const [errorMessage, setErrorMessage] = (0, import_react17.useState)(null);
8809
+ const [intentId, setIntentId] = (0, import_react17.useState)(null);
8810
+ const [paymentMethod, setPaymentMethod] = (0, import_react17.useState)("crypto");
8811
+ const resetState = import_react17.default.useCallback(() => {
7769
8812
  resetNavigation();
7770
8813
  setSelectedToken(null);
7771
8814
  setSelectedChain(null);
@@ -7778,7 +8821,7 @@ function DepositProvider({
7778
8821
  setPaymentMethod("crypto");
7779
8822
  reloadWalletTokens();
7780
8823
  }, [reloadWalletTokens, resetNavigation]);
7781
- const navigationValue = (0, import_react18.useMemo)(
8824
+ const navigationValue = (0, import_react17.useMemo)(
7782
8825
  () => ({
7783
8826
  currentStep,
7784
8827
  setCurrentStep,
@@ -7798,7 +8841,7 @@ function DepositProvider({
7798
8841
  stepHistory
7799
8842
  ]
7800
8843
  );
7801
- const walletValue = (0, import_react18.useMemo)(
8844
+ const walletValue = (0, import_react17.useMemo)(
7802
8845
  () => ({
7803
8846
  selectedWallet,
7804
8847
  walletAddress,
@@ -7833,7 +8876,7 @@ function DepositProvider({
7833
8876
  setSelectedNamespace
7834
8877
  ]
7835
8878
  );
7836
- const formValue = (0, import_react18.useMemo)(
8879
+ const formValue = (0, import_react17.useMemo)(
7837
8880
  () => ({
7838
8881
  selectedToken,
7839
8882
  setSelectedToken,
@@ -7855,7 +8898,7 @@ function DepositProvider({
7855
8898
  setPaymentMethod
7856
8899
  ]
7857
8900
  );
7858
- const transactionValue = (0, import_react18.useMemo)(
8901
+ const transactionValue = (0, import_react17.useMemo)(
7859
8902
  () => ({
7860
8903
  transactionStatus,
7861
8904
  setTransactionStatus,
@@ -7868,14 +8911,14 @@ function DepositProvider({
7868
8911
  }),
7869
8912
  [errorMessage, intentId, transactionHash, transactionStatus]
7870
8913
  );
7871
- const uiValue = (0, import_react18.useMemo)(
8914
+ const uiValue = (0, import_react17.useMemo)(
7872
8915
  () => ({
7873
8916
  resolvedTheme,
7874
8917
  toggleTheme
7875
8918
  }),
7876
8919
  [resolvedTheme, toggleTheme]
7877
8920
  );
7878
- const value = (0, import_react18.useMemo)(
8921
+ const value = (0, import_react17.useMemo)(
7879
8922
  () => ({
7880
8923
  ...navigationValue,
7881
8924
  ...walletValue,
@@ -7888,7 +8931,7 @@ function DepositProvider({
7888
8931
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DepositNavigationContext.Provider, { value: navigationValue, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DepositWalletContext.Provider, { value: walletValue, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DepositFormContext.Provider, { value: formValue, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DepositTransactionContext.Provider, { value: transactionValue, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DepositUiContext.Provider, { value: uiValue, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DepositContext.Provider, { value, children }) }) }) }) }) });
7889
8932
  }
7890
8933
  function useRequiredContext(context, name) {
7891
- const value = (0, import_react18.useContext)(context);
8934
+ const value = (0, import_react17.useContext)(context);
7892
8935
  if (value === void 0) {
7893
8936
  throw new Error(`${name} must be used within a DepositProvider`);
7894
8937
  }
@@ -7909,11 +8952,11 @@ function useDepositTransaction() {
7909
8952
  function useDepositUi() {
7910
8953
  return useRequiredContext(DepositUiContext, "useDepositUi");
7911
8954
  }
7912
- var import_react18, import_jsx_runtime2, DepositContext, DepositNavigationContext, DepositWalletContext, DepositFormContext, DepositTransactionContext, DepositUiContext;
8955
+ var import_react17, import_jsx_runtime2, DepositContext, DepositNavigationContext, DepositWalletContext, DepositFormContext, DepositTransactionContext, DepositUiContext;
7913
8956
  var init_DepositContext = __esm({
7914
8957
  "src/widget/context/DepositContext.tsx"() {
7915
8958
  "use strict";
7916
- import_react18 = __toESM(require("react"), 1);
8959
+ import_react17 = __toESM(require("react"), 1);
7917
8960
  init_provider();
7918
8961
  init_useDepositNavigationState();
7919
8962
  init_useThemePreference();
@@ -7921,15 +8964,16 @@ var init_DepositContext = __esm({
7921
8964
  init_useWalletTokenState();
7922
8965
  init_useWalletConnect();
7923
8966
  init_wallets();
8967
+ init_useTrustwareConfig();
7924
8968
  import_jsx_runtime2 = require("react/jsx-runtime");
7925
- DepositContext = (0, import_react18.createContext)(
8969
+ DepositContext = (0, import_react17.createContext)(
7926
8970
  void 0
7927
8971
  );
7928
- DepositNavigationContext = (0, import_react18.createContext)(void 0);
7929
- DepositWalletContext = (0, import_react18.createContext)(void 0);
7930
- DepositFormContext = (0, import_react18.createContext)(void 0);
7931
- DepositTransactionContext = (0, import_react18.createContext)(void 0);
7932
- DepositUiContext = (0, import_react18.createContext)(void 0);
8972
+ DepositNavigationContext = (0, import_react17.createContext)(void 0);
8973
+ DepositWalletContext = (0, import_react17.createContext)(void 0);
8974
+ DepositFormContext = (0, import_react17.createContext)(void 0);
8975
+ DepositTransactionContext = (0, import_react17.createContext)(void 0);
8976
+ DepositUiContext = (0, import_react17.createContext)(void 0);
7933
8977
  }
7934
8978
  });
7935
8979
 
@@ -7942,7 +8986,7 @@ function AmountSlider({
7942
8986
  style,
7943
8987
  disabled = false
7944
8988
  }) {
7945
- const generateTickMarks = (0, import_react19.useCallback)(
8989
+ const generateTickMarks = (0, import_react18.useCallback)(
7946
8990
  (minValue, maxValue) => {
7947
8991
  const range = maxValue - minValue;
7948
8992
  if (range <= 0) {
@@ -7990,25 +9034,25 @@ function AmountSlider({
7990
9034
  },
7991
9035
  []
7992
9036
  );
7993
- const tickMarks = (0, import_react19.useMemo)(
9037
+ const tickMarks = (0, import_react18.useMemo)(
7994
9038
  () => generateTickMarks(min, max),
7995
9039
  [generateTickMarks, min, max]
7996
9040
  );
7997
- const getPercentage = (0, import_react19.useCallback)(() => {
9041
+ const getPercentage = (0, import_react18.useCallback)(() => {
7998
9042
  const range = max - min;
7999
9043
  if (range <= 0) return 0;
8000
9044
  const clampedValue = Math.min(Math.max(value, min), max);
8001
9045
  return (clampedValue - min) / range * 100;
8002
9046
  }, [max, min, value]);
8003
- const percentage = (0, import_react19.useMemo)(() => getPercentage(), [getPercentage]);
8004
- const handleChange = (0, import_react19.useCallback)(
9047
+ const percentage = (0, import_react18.useMemo)(() => getPercentage(), [getPercentage]);
9048
+ const handleChange = (0, import_react18.useCallback)(
8005
9049
  (e2) => {
8006
9050
  const newValue = Math.min(Math.max(Number(e2.target.value), min), max);
8007
9051
  onChange(newValue);
8008
9052
  },
8009
9053
  [onChange, min, max]
8010
9054
  );
8011
- const handleTickClick = (0, import_react19.useCallback)(
9055
+ const handleTickClick = (0, import_react18.useCallback)(
8012
9056
  (tickValue) => {
8013
9057
  if (disabled) return;
8014
9058
  onChange(tickValue);
@@ -8223,11 +9267,11 @@ function AmountSlider({
8223
9267
  )
8224
9268
  ] }) });
8225
9269
  }
8226
- var import_react19, import_jsx_runtime3, roundToNiceNumber, formatValue;
9270
+ var import_react18, import_jsx_runtime3, roundToNiceNumber, formatValue;
8227
9271
  var init_AmountSlider = __esm({
8228
9272
  "src/widget/components/AmountSlider.tsx"() {
8229
9273
  "use strict";
8230
- import_react19 = require("react");
9274
+ import_react18 = require("react");
8231
9275
  init_styles();
8232
9276
  import_jsx_runtime3 = require("react/jsx-runtime");
8233
9277
  roundToNiceNumber = (value, range) => {
@@ -8311,8 +9355,8 @@ function AmountInputDisplay({
8311
9355
  style,
8312
9356
  inputAriaLabel = "Deposit amount"
8313
9357
  }) {
8314
- const [isEditing, setIsEditing] = (0, import_react20.useState)(false);
8315
- const inputRef = (0, import_react20.useRef)(null);
9358
+ const [isEditing, setIsEditing] = (0, import_react19.useState)(false);
9359
+ const inputRef = (0, import_react19.useRef)(null);
8316
9360
  const handleAmountClick = () => {
8317
9361
  if (isFixedAmount) return;
8318
9362
  const isZeroish = !amount || parseFloat(amount) === 0;
@@ -8428,11 +9472,11 @@ function AmountInputDisplay({
8428
9472
  }
8429
9473
  );
8430
9474
  }
8431
- var import_react20, import_jsx_runtime4;
9475
+ var import_react19, import_jsx_runtime4;
8432
9476
  var init_AmountInputDisplay = __esm({
8433
9477
  "src/widget/components/AmountInputDisplay.tsx"() {
8434
9478
  "use strict";
8435
- import_react20 = require("react");
9479
+ import_react19 = require("react");
8436
9480
  init_styles();
8437
9481
  import_jsx_runtime4 = require("react/jsx-runtime");
8438
9482
  }
@@ -8554,8 +9598,8 @@ function ConfettiEffect({
8554
9598
  clearDelay = 3e3,
8555
9599
  pieceCount = 50
8556
9600
  }) {
8557
- const [pieces, setPieces] = (0, import_react21.useState)([]);
8558
- (0, import_react21.useEffect)(() => {
9601
+ const [pieces, setPieces] = (0, import_react20.useState)([]);
9602
+ (0, import_react20.useEffect)(() => {
8559
9603
  if (isActive) {
8560
9604
  const colors2 = [
8561
9605
  "#10b981",
@@ -8631,22 +9675,22 @@ function ConfettiEffect({
8631
9675
  }
8632
9676
  );
8633
9677
  }
8634
- var import_react21, import_jsx_runtime6, ConfettiEffect_default;
9678
+ var import_react20, import_jsx_runtime6, ConfettiEffect_default;
8635
9679
  var init_ConfettiEffect = __esm({
8636
9680
  "src/widget/components/ConfettiEffect.tsx"() {
8637
9681
  "use strict";
8638
- import_react21 = require("react");
9682
+ import_react20 = require("react");
8639
9683
  import_jsx_runtime6 = require("react/jsx-runtime");
8640
9684
  ConfettiEffect_default = ConfettiEffect;
8641
9685
  }
8642
9686
  });
8643
9687
 
8644
9688
  // src/widget/components/Dialog.tsx
8645
- var import_react22, import_jsx_runtime7, Dialog;
9689
+ var import_react21, import_jsx_runtime7, Dialog;
8646
9690
  var init_Dialog = __esm({
8647
9691
  "src/widget/components/Dialog.tsx"() {
8648
9692
  "use strict";
8649
- import_react22 = require("react");
9693
+ import_react21 = require("react");
8650
9694
  init_styles();
8651
9695
  import_jsx_runtime7 = require("react/jsx-runtime");
8652
9696
  Dialog = ({
@@ -8659,11 +9703,11 @@ var init_Dialog = __esm({
8659
9703
  confirmText = "Close Anyway",
8660
9704
  isDark = false
8661
9705
  }) => {
8662
- const dialogRef = (0, import_react22.useRef)(null);
8663
- const overlayRef = (0, import_react22.useRef)(null);
8664
- const firstButtonRef = (0, import_react22.useRef)(null);
8665
- const lastButtonRef = (0, import_react22.useRef)(null);
8666
- (0, import_react22.useEffect)(() => {
9706
+ const dialogRef = (0, import_react21.useRef)(null);
9707
+ const overlayRef = (0, import_react21.useRef)(null);
9708
+ const firstButtonRef = (0, import_react21.useRef)(null);
9709
+ const lastButtonRef = (0, import_react21.useRef)(null);
9710
+ (0, import_react21.useEffect)(() => {
8667
9711
  const handleEscape = (e2) => {
8668
9712
  if (e2.key === "Escape" && open) {
8669
9713
  e2.preventDefault();
@@ -8677,7 +9721,7 @@ var init_Dialog = __esm({
8677
9721
  document.removeEventListener("keydown", handleEscape);
8678
9722
  };
8679
9723
  }, [open, onCancel]);
8680
- (0, import_react22.useEffect)(() => {
9724
+ (0, import_react21.useEffect)(() => {
8681
9725
  const handleTabKey = (e2) => {
8682
9726
  if (!open) return;
8683
9727
  if (e2.key === "Tab") {
@@ -8701,7 +9745,7 @@ var init_Dialog = __esm({
8701
9745
  document.removeEventListener("keydown", handleTabKey);
8702
9746
  };
8703
9747
  }, [open]);
8704
- (0, import_react22.useEffect)(() => {
9748
+ (0, import_react21.useEffect)(() => {
8705
9749
  if (open) {
8706
9750
  const originalStyle = window.getComputedStyle(document.body).overflow;
8707
9751
  document.body.style.overflow = "hidden";
@@ -9021,33 +10065,33 @@ function SwipeToConfirmTokens({
9021
10065
  style,
9022
10066
  text
9023
10067
  }) {
9024
- const [dragX, setDragX] = (0, import_react23.useState)(0);
9025
- const [isDragging, setIsDragging] = (0, import_react23.useState)(false);
9026
- const [isComplete, setIsComplete] = (0, import_react23.useState)(false);
9027
- const trackRef = (0, import_react23.useRef)(null);
9028
- const thumbRef = (0, import_react23.useRef)(null);
9029
- const [isLongPressing, setIsLongPressing] = (0, import_react23.useState)(false);
9030
- const [longPressProgress, setLongPressProgress] = (0, import_react23.useState)(0);
9031
- const longPressTimerRef = (0, import_react23.useRef)(null);
9032
- const longPressStartRef = (0, import_react23.useRef)(null);
9033
- const longPressAnimationRef = (0, import_react23.useRef)(null);
10068
+ const [dragX, setDragX] = (0, import_react22.useState)(0);
10069
+ const [isDragging, setIsDragging] = (0, import_react22.useState)(false);
10070
+ const [isComplete, setIsComplete] = (0, import_react22.useState)(false);
10071
+ const trackRef = (0, import_react22.useRef)(null);
10072
+ const thumbRef = (0, import_react22.useRef)(null);
10073
+ const [isLongPressing, setIsLongPressing] = (0, import_react22.useState)(false);
10074
+ const [longPressProgress, setLongPressProgress] = (0, import_react22.useState)(0);
10075
+ const longPressTimerRef = (0, import_react22.useRef)(null);
10076
+ const longPressStartRef = (0, import_react22.useRef)(null);
10077
+ const longPressAnimationRef = (0, import_react22.useRef)(null);
9034
10078
  const LONG_PRESS_DURATION = 1500;
9035
10079
  const thumbSize = 48;
9036
10080
  const padding = 4;
9037
10081
  const threshold = 0.8;
9038
- const getMaxDrag = (0, import_react23.useCallback)(() => {
10082
+ const getMaxDrag = (0, import_react22.useCallback)(() => {
9039
10083
  if (!trackRef.current) return 0;
9040
10084
  return trackRef.current.offsetWidth - thumbSize - padding * 2;
9041
10085
  }, []);
9042
- const getProgress = (0, import_react23.useCallback)(() => {
10086
+ const getProgress = (0, import_react22.useCallback)(() => {
9043
10087
  const maxDrag = getMaxDrag();
9044
10088
  return maxDrag > 0 ? dragX / maxDrag : 0;
9045
10089
  }, [dragX, getMaxDrag]);
9046
- const handleDragStart = (0, import_react23.useCallback)(() => {
10090
+ const handleDragStart = (0, import_react22.useCallback)(() => {
9047
10091
  if (disabled || isComplete) return;
9048
10092
  setIsDragging(true);
9049
10093
  }, [disabled, isComplete]);
9050
- const handleDragMove = (0, import_react23.useCallback)(
10094
+ const handleDragMove = (0, import_react22.useCallback)(
9051
10095
  (clientX) => {
9052
10096
  if (!isDragging || !trackRef.current || isComplete) return;
9053
10097
  const rect = trackRef.current.getBoundingClientRect();
@@ -9058,7 +10102,7 @@ function SwipeToConfirmTokens({
9058
10102
  },
9059
10103
  [isDragging, isComplete, getMaxDrag]
9060
10104
  );
9061
- const handleDragEnd = (0, import_react23.useCallback)(() => {
10105
+ const handleDragEnd = (0, import_react22.useCallback)(() => {
9062
10106
  if (!isDragging) return;
9063
10107
  setIsDragging(false);
9064
10108
  const progress2 = getProgress();
@@ -9071,14 +10115,14 @@ function SwipeToConfirmTokens({
9071
10115
  setDragX(0);
9072
10116
  }
9073
10117
  }, [isDragging, getProgress, getMaxDrag, onConfirm]);
9074
- const triggerConfirmation = (0, import_react23.useCallback)(() => {
10118
+ const triggerConfirmation = (0, import_react22.useCallback)(() => {
9075
10119
  if (isComplete) return;
9076
10120
  setDragX(getMaxDrag());
9077
10121
  setIsComplete(true);
9078
10122
  if (navigator.vibrate) navigator.vibrate(50);
9079
10123
  setTimeout(() => onConfirm(), 150);
9080
10124
  }, [isComplete, getMaxDrag, onConfirm]);
9081
- const cancelLongPress = (0, import_react23.useCallback)(() => {
10125
+ const cancelLongPress = (0, import_react22.useCallback)(() => {
9082
10126
  setIsLongPressing(false);
9083
10127
  setLongPressProgress(0);
9084
10128
  longPressStartRef.current = null;
@@ -9091,7 +10135,7 @@ function SwipeToConfirmTokens({
9091
10135
  longPressAnimationRef.current = null;
9092
10136
  }
9093
10137
  }, []);
9094
- const startLongPress = (0, import_react23.useCallback)(() => {
10138
+ const startLongPress = (0, import_react22.useCallback)(() => {
9095
10139
  if (disabled || isComplete || isDragging) return;
9096
10140
  setIsLongPressing(true);
9097
10141
  longPressStartRef.current = Date.now();
@@ -9109,7 +10153,7 @@ function SwipeToConfirmTokens({
9109
10153
  };
9110
10154
  longPressAnimationRef.current = requestAnimationFrame(animateProgress);
9111
10155
  }, [disabled, isComplete, isDragging, triggerConfirmation, cancelLongPress]);
9112
- const handleKeyDown = (0, import_react23.useCallback)(
10156
+ const handleKeyDown = (0, import_react22.useCallback)(
9113
10157
  (e2) => {
9114
10158
  if (disabled || isComplete) return;
9115
10159
  if (e2.key === "Enter" || e2.key === " ") {
@@ -9119,7 +10163,7 @@ function SwipeToConfirmTokens({
9119
10163
  },
9120
10164
  [disabled, isComplete, startLongPress]
9121
10165
  );
9122
- const handleKeyUp = (0, import_react23.useCallback)(
10166
+ const handleKeyUp = (0, import_react22.useCallback)(
9123
10167
  (e2) => {
9124
10168
  if (e2.key === "Enter" || e2.key === " ") {
9125
10169
  e2.preventDefault();
@@ -9128,7 +10172,7 @@ function SwipeToConfirmTokens({
9128
10172
  },
9129
10173
  [cancelLongPress]
9130
10174
  );
9131
- (0, import_react23.useEffect)(() => {
10175
+ (0, import_react22.useEffect)(() => {
9132
10176
  return () => {
9133
10177
  if (longPressTimerRef.current) clearTimeout(longPressTimerRef.current);
9134
10178
  if (longPressAnimationRef.current)
@@ -9139,15 +10183,15 @@ function SwipeToConfirmTokens({
9139
10183
  e2.preventDefault();
9140
10184
  handleDragStart();
9141
10185
  };
9142
- const handleMouseMove = (0, import_react23.useCallback)(
10186
+ const handleMouseMove = (0, import_react22.useCallback)(
9143
10187
  (e2) => handleDragMove(e2.clientX),
9144
10188
  [handleDragMove]
9145
10189
  );
9146
- const handleMouseUp = (0, import_react23.useCallback)(() => handleDragEnd(), [handleDragEnd]);
10190
+ const handleMouseUp = (0, import_react22.useCallback)(() => handleDragEnd(), [handleDragEnd]);
9147
10191
  const handleTouchStart = () => handleDragStart();
9148
10192
  const handleTouchMove = (e2) => handleDragMove(e2.touches[0].clientX);
9149
10193
  const handleTouchEnd = () => handleDragEnd();
9150
- (0, import_react23.useEffect)(() => {
10194
+ (0, import_react22.useEffect)(() => {
9151
10195
  if (isDragging) {
9152
10196
  window.addEventListener("mousemove", handleMouseMove);
9153
10197
  window.addEventListener("mouseup", handleMouseUp);
@@ -9159,8 +10203,8 @@ function SwipeToConfirmTokens({
9159
10203
  }, [isDragging, handleMouseMove, handleMouseUp]);
9160
10204
  const progress = getProgress();
9161
10205
  const effectiveProgress = isLongPressing ? longPressProgress : progress;
9162
- const [blinkOpacity, setBlinkOpacity] = (0, import_react23.useState)(1);
9163
- (0, import_react23.useEffect)(() => {
10206
+ const [blinkOpacity, setBlinkOpacity] = (0, import_react22.useState)(1);
10207
+ (0, import_react22.useEffect)(() => {
9164
10208
  if (disabled || isComplete || isDragging || isLongPressing) {
9165
10209
  setBlinkOpacity(1);
9166
10210
  return;
@@ -9521,11 +10565,11 @@ function SwipeToConfirmTokens({
9521
10565
  }
9522
10566
  );
9523
10567
  }
9524
- var import_react23, import_jsx_runtime9;
10568
+ var import_react22, import_jsx_runtime9;
9525
10569
  var init_SwipeToConfirmTokens = __esm({
9526
10570
  "src/widget/components/SwipeToConfirmTokens.tsx"() {
9527
10571
  "use strict";
9528
- import_react23 = require("react");
10572
+ import_react22 = require("react");
9529
10573
  init_styles();
9530
10574
  init_components();
9531
10575
  import_jsx_runtime9 = require("react/jsx-runtime");
@@ -9634,14 +10678,14 @@ function ToastItem({
9634
10678
  duration = 4e3,
9635
10679
  onDismiss
9636
10680
  }) {
9637
- const [isExiting, setIsExiting] = (0, import_react24.useState)(false);
9638
- (0, import_react24.useEffect)(() => {
10681
+ const [isExiting, setIsExiting] = (0, import_react23.useState)(false);
10682
+ (0, import_react23.useEffect)(() => {
9639
10683
  const timer = setTimeout(() => {
9640
10684
  setIsExiting(true);
9641
10685
  }, duration);
9642
10686
  return () => clearTimeout(timer);
9643
10687
  }, [duration]);
9644
- (0, import_react24.useEffect)(() => {
10688
+ (0, import_react23.useEffect)(() => {
9645
10689
  if (isExiting) {
9646
10690
  const exitTimer = setTimeout(() => {
9647
10691
  onDismiss(id);
@@ -9840,8 +10884,8 @@ function toast(data) {
9840
10884
  };
9841
10885
  }
9842
10886
  function ToastContainer() {
9843
- const [activeToasts, setActiveToasts] = (0, import_react24.useState)([]);
9844
- (0, import_react24.useEffect)(() => {
10887
+ const [activeToasts, setActiveToasts] = (0, import_react23.useState)([]);
10888
+ (0, import_react23.useEffect)(() => {
9845
10889
  const listener = (newToasts) => {
9846
10890
  setActiveToasts(newToasts);
9847
10891
  };
@@ -9853,7 +10897,7 @@ function ToastContainer() {
9853
10897
  }
9854
10898
  };
9855
10899
  }, []);
9856
- const handleDismiss = (0, import_react24.useCallback)((id) => {
10900
+ const handleDismiss = (0, import_react23.useCallback)((id) => {
9857
10901
  toasts = toasts.filter((t) => t.id !== id);
9858
10902
  notifyListeners();
9859
10903
  }, []);
@@ -9888,11 +10932,11 @@ function ToastContainer() {
9888
10932
  }
9889
10933
  );
9890
10934
  }
9891
- var import_react24, import_jsx_runtime11, variantStyles, listeners, toasts, toastId;
10935
+ var import_react23, import_jsx_runtime11, variantStyles, listeners, toasts, toastId;
9892
10936
  var init_Toast = __esm({
9893
10937
  "src/widget/components/Toast.tsx"() {
9894
10938
  "use strict";
9895
- import_react24 = require("react");
10939
+ import_react23 = require("react");
9896
10940
  init_styles();
9897
10941
  import_jsx_runtime11 = require("react/jsx-runtime");
9898
10942
  variantStyles = {
@@ -9933,10 +10977,10 @@ function TokenSwipePill({
9933
10977
  walletAddress,
9934
10978
  style
9935
10979
  }) {
9936
- const [isDragging, setIsDragging] = (0, import_react25.useState)(false);
9937
- const [dragOffset, setDragOffset] = (0, import_react25.useState)(0);
9938
- const startXRef = (0, import_react25.useRef)(0);
9939
- const containerRef = (0, import_react25.useRef)(null);
10980
+ const [isDragging, setIsDragging] = (0, import_react24.useState)(false);
10981
+ const [dragOffset, setDragOffset] = (0, import_react24.useState)(0);
10982
+ const startXRef = (0, import_react24.useRef)(0);
10983
+ const containerRef = (0, import_react24.useRef)(null);
9940
10984
  const currentIndex = tokens.findIndex(
9941
10985
  (t) => normalizeAddress2(
9942
10986
  t.address,
@@ -9957,11 +11001,11 @@ function TokenSwipePill({
9957
11001
  }
9958
11002
  return pos;
9959
11003
  };
9960
- const handleDragStart = (0, import_react25.useCallback)((clientX) => {
11004
+ const handleDragStart = (0, import_react24.useCallback)((clientX) => {
9961
11005
  setIsDragging(true);
9962
11006
  startXRef.current = clientX;
9963
11007
  }, []);
9964
- const handleDragMove = (0, import_react25.useCallback)(
11008
+ const handleDragMove = (0, import_react24.useCallback)(
9965
11009
  (clientX) => {
9966
11010
  if (!isDragging) return;
9967
11011
  const delta = startXRef.current - clientX;
@@ -9969,7 +11013,7 @@ function TokenSwipePill({
9969
11013
  },
9970
11014
  [isDragging]
9971
11015
  );
9972
- const handleDragEnd = (0, import_react25.useCallback)(() => {
11016
+ const handleDragEnd = (0, import_react24.useCallback)(() => {
9973
11017
  if (!isDragging) return;
9974
11018
  setIsDragging(false);
9975
11019
  if (Math.abs(dragOffset) > swipeThreshold) {
@@ -9987,13 +11031,13 @@ function TokenSwipePill({
9987
11031
  e2.preventDefault();
9988
11032
  handleDragStart(e2.clientX);
9989
11033
  };
9990
- const handleMouseMove = (0, import_react25.useCallback)(
11034
+ const handleMouseMove = (0, import_react24.useCallback)(
9991
11035
  (e2) => {
9992
11036
  handleDragMove(e2.clientX);
9993
11037
  },
9994
11038
  [handleDragMove]
9995
11039
  );
9996
- const handleMouseUp = (0, import_react25.useCallback)(() => {
11040
+ const handleMouseUp = (0, import_react24.useCallback)(() => {
9997
11041
  handleDragEnd();
9998
11042
  }, [handleDragEnd]);
9999
11043
  const handleTouchStart = (e2) => {
@@ -10007,7 +11051,7 @@ function TokenSwipePill({
10007
11051
  const handleTouchEnd = () => {
10008
11052
  handleDragEnd();
10009
11053
  };
10010
- (0, import_react25.useEffect)(() => {
11054
+ (0, import_react24.useEffect)(() => {
10011
11055
  if (isDragging) {
10012
11056
  window.addEventListener("mousemove", handleMouseMove);
10013
11057
  window.addEventListener("mouseup", handleMouseUp);
@@ -10021,7 +11065,7 @@ function TokenSwipePill({
10021
11065
  const getChainInitials = (chain) => {
10022
11066
  return chain?.slice(0, 2).toUpperCase();
10023
11067
  };
10024
- const chainBadge = (0, import_react25.useMemo)(() => {
11068
+ const chainBadge = (0, import_react24.useMemo)(() => {
10025
11069
  const url = selectedToken.chainData?.chainIconURI || selectedToken.chainData?.iconUrl;
10026
11070
  return url?.toString();
10027
11071
  }, [selectedToken]);
@@ -10307,7 +11351,7 @@ function TokenSwipePill({
10307
11351
  const token = tokens[index];
10308
11352
  const prevIndex = uniqueIndices[i - 1];
10309
11353
  const showGap = i > 0 && index - prevIndex > 1;
10310
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react25.default.Fragment, { children: [
11354
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react24.default.Fragment, { children: [
10311
11355
  showGap && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
10312
11356
  "span",
10313
11357
  {
@@ -10487,11 +11531,11 @@ function TokenSwipePill({
10487
11531
  }
10488
11532
  );
10489
11533
  }
10490
- var import_react25, import_jsx_runtime12, MAX_VISIBLE_DOTS;
11534
+ var import_react24, import_jsx_runtime12, MAX_VISIBLE_DOTS;
10491
11535
  var init_TokenSwipePill = __esm({
10492
11536
  "src/widget/components/TokenSwipePill.tsx"() {
10493
11537
  "use strict";
10494
- import_react25 = __toESM(require("react"), 1);
11538
+ import_react24 = __toESM(require("react"), 1);
10495
11539
  init_styles();
10496
11540
  init_chainHelpers();
10497
11541
  init_components();
@@ -10533,14 +11577,14 @@ function TransactionSteps({
10533
11577
  style,
10534
11578
  stepLabels
10535
11579
  }) {
10536
- const labels = (0, import_react26.useMemo)(
11580
+ const labels = (0, import_react25.useMemo)(
10537
11581
  () => ({
10538
11582
  ...DEFAULT_LABELS,
10539
11583
  ...stepLabels
10540
11584
  }),
10541
11585
  [stepLabels]
10542
11586
  );
10543
- const steps = (0, import_react26.useMemo)(
11587
+ const steps = (0, import_react25.useMemo)(
10544
11588
  () => getSteps(transactionStatus, labels),
10545
11589
  [transactionStatus, labels]
10546
11590
  );
@@ -10697,11 +11741,11 @@ function TransactionSteps({
10697
11741
  }
10698
11742
  );
10699
11743
  }
10700
- var import_react26, import_jsx_runtime13, DEFAULT_LABELS;
11744
+ var import_react25, import_jsx_runtime13, DEFAULT_LABELS;
10701
11745
  var init_TransactionSteps = __esm({
10702
11746
  "src/widget/components/TransactionSteps.tsx"() {
10703
11747
  "use strict";
10704
- import_react26 = require("react");
11748
+ import_react25 = require("react");
10705
11749
  init_styles();
10706
11750
  import_jsx_runtime13 = require("react/jsx-runtime");
10707
11751
  DEFAULT_LABELS = {
@@ -10720,8 +11764,8 @@ function WidgetContainer({
10720
11764
  className,
10721
11765
  style
10722
11766
  }) {
10723
- const [resolvedTheme, setResolvedTheme] = (0, import_react27.useState)("light");
10724
- (0, import_react27.useEffect)(() => {
11767
+ const [resolvedTheme, setResolvedTheme] = (0, import_react26.useState)("light");
11768
+ (0, import_react26.useEffect)(() => {
10725
11769
  if (theme === "system") {
10726
11770
  const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
10727
11771
  setResolvedTheme(mediaQuery.matches ? "dark" : "light");
@@ -10770,11 +11814,11 @@ function WidgetContainer({
10770
11814
  )
10771
11815
  ] });
10772
11816
  }
10773
- var import_react27, import_jsx_runtime14, INJECTED_STYLES;
11817
+ var import_react26, import_jsx_runtime14, INJECTED_STYLES;
10774
11818
  var init_WidgetContainer = __esm({
10775
11819
  "src/widget/components/WidgetContainer.tsx"() {
10776
11820
  "use strict";
10777
- import_react27 = require("react");
11821
+ import_react26 = require("react");
10778
11822
  init_Toast();
10779
11823
  init_styles();
10780
11824
  init_styles();
@@ -11018,18 +12062,18 @@ function ImageLoader({
11018
12062
  onLoad,
11019
12063
  onError
11020
12064
  }) {
11021
- const [status, setStatus] = (0, import_react28.useState)("idle");
11022
- const [attempt, setAttempt] = (0, import_react28.useState)(0);
11023
- const [srcIsEmpty, setSrcIsEmpty] = (0, import_react28.useState)(false);
11024
- const imgRef = (0, import_react28.useRef)(null);
11025
- const observerRef = (0, import_react28.useRef)(null);
11026
- const onLoadRef = (0, import_react28.useRef)(onLoad);
11027
- const onErrorRef = (0, import_react28.useRef)(onError);
11028
- (0, import_react28.useEffect)(() => {
12065
+ const [status, setStatus] = (0, import_react27.useState)("idle");
12066
+ const [attempt, setAttempt] = (0, import_react27.useState)(0);
12067
+ const [srcIsEmpty, setSrcIsEmpty] = (0, import_react27.useState)(false);
12068
+ const imgRef = (0, import_react27.useRef)(null);
12069
+ const observerRef = (0, import_react27.useRef)(null);
12070
+ const onLoadRef = (0, import_react27.useRef)(onLoad);
12071
+ const onErrorRef = (0, import_react27.useRef)(onError);
12072
+ (0, import_react27.useEffect)(() => {
11029
12073
  onLoadRef.current = onLoad;
11030
12074
  onErrorRef.current = onError;
11031
12075
  }, [onLoad, onError]);
11032
- (0, import_react28.useEffect)(() => {
12076
+ (0, import_react27.useEffect)(() => {
11033
12077
  if (status === "error" && attempt < retry) {
11034
12078
  const timer = setTimeout(() => {
11035
12079
  setAttempt((prev) => prev + 1);
@@ -11038,7 +12082,7 @@ function ImageLoader({
11038
12082
  return () => clearTimeout(timer);
11039
12083
  }
11040
12084
  }, [status, attempt, retry, retryDelay]);
11041
- const loadImage = (0, import_react28.useCallback)(() => {
12085
+ const loadImage = (0, import_react27.useCallback)(() => {
11042
12086
  if (!src) {
11043
12087
  setSrcIsEmpty(true);
11044
12088
  return;
@@ -11056,7 +12100,7 @@ function ImageLoader({
11056
12100
  onErrorRef.current?.();
11057
12101
  };
11058
12102
  }, [src]);
11059
- (0, import_react28.useEffect)(() => {
12103
+ (0, import_react27.useEffect)(() => {
11060
12104
  if (!lazy3) {
11061
12105
  const timer = setTimeout(() => loadImage(), 0);
11062
12106
  return () => clearTimeout(timer);
@@ -11077,7 +12121,7 @@ function ImageLoader({
11077
12121
  }
11078
12122
  return () => observerRef.current?.disconnect();
11079
12123
  }, [lazy3, src, loadImage]);
11080
- const showFallback = (0, import_react28.useMemo)(() => {
12124
+ const showFallback = (0, import_react27.useMemo)(() => {
11081
12125
  return (status === "error" && attempt >= retry || srcIsEmpty) && Fallback;
11082
12126
  }, [status, attempt, retry, srcIsEmpty, Fallback]);
11083
12127
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: imgRef, style: { position: "relative" }, children: [
@@ -11115,11 +12159,11 @@ function ImageLoader({
11115
12159
  showFallback && Fallback
11116
12160
  ] });
11117
12161
  }
11118
- var import_react28, import_jsx_runtime17;
12162
+ var import_react27, import_jsx_runtime17;
11119
12163
  var init_ImageLoader = __esm({
11120
12164
  "src/widget/components/ImageLoader.tsx"() {
11121
12165
  "use strict";
11122
- import_react28 = require("react");
12166
+ import_react27 = require("react");
11123
12167
  import_jsx_runtime17 = require("react/jsx-runtime");
11124
12168
  }
11125
12169
  });
@@ -11633,8 +12677,8 @@ function ChainItem({
11633
12677
  src: chain.chainIconURI,
11634
12678
  alt: label,
11635
12679
  style: {
11636
- width: "2rem",
11637
- height: "2rem",
12680
+ width: "1.5rem",
12681
+ height: "1.5rem",
11638
12682
  borderRadius: "9999px",
11639
12683
  objectFit: "cover",
11640
12684
  flexShrink: 0
@@ -11644,8 +12688,8 @@ function ChainItem({
11644
12688
  "div",
11645
12689
  {
11646
12690
  style: {
11647
- width: "2rem",
11648
- height: "2rem",
12691
+ width: "1.5rem",
12692
+ height: "1.5rem",
11649
12693
  borderRadius: "9999px",
11650
12694
  backgroundColor: colors.muted,
11651
12695
  display: "flex",
@@ -11723,6 +12767,81 @@ function ChainItem({
11723
12767
  String(key)
11724
12768
  );
11725
12769
  }
12770
+ function SectionLabel({
12771
+ children,
12772
+ icon
12773
+ }) {
12774
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
12775
+ "div",
12776
+ {
12777
+ style: {
12778
+ display: "flex",
12779
+ alignItems: "center",
12780
+ gap: "0.25rem",
12781
+ padding: `${spacing[1.5]} ${spacing[3]}`,
12782
+ marginTop: spacing[2]
12783
+ },
12784
+ children: [
12785
+ icon === "spark" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
12786
+ "svg",
12787
+ {
12788
+ style: {
12789
+ width: "0.75rem",
12790
+ height: "0.75rem",
12791
+ color: colors.primary,
12792
+ flexShrink: 0
12793
+ },
12794
+ viewBox: "0 0 24 24",
12795
+ fill: "none",
12796
+ stroke: "currentColor",
12797
+ strokeWidth: 2,
12798
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
12799
+ "path",
12800
+ {
12801
+ strokeLinecap: "round",
12802
+ strokeLinejoin: "round",
12803
+ d: "M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09Z"
12804
+ }
12805
+ )
12806
+ }
12807
+ ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
12808
+ "svg",
12809
+ {
12810
+ style: {
12811
+ width: "0.75rem",
12812
+ height: "0.75rem",
12813
+ color: colors.primary,
12814
+ flexShrink: 0
12815
+ },
12816
+ viewBox: "0 0 24 24",
12817
+ fill: "none",
12818
+ stroke: "currentColor",
12819
+ strokeWidth: 2,
12820
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
12821
+ "path",
12822
+ {
12823
+ strokeLinecap: "round",
12824
+ strokeLinejoin: "round",
12825
+ d: "M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"
12826
+ }
12827
+ )
12828
+ }
12829
+ ),
12830
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
12831
+ "span",
12832
+ {
12833
+ style: {
12834
+ fontSize: "10px",
12835
+ fontWeight: fontWeight.medium,
12836
+ color: colors.primary
12837
+ },
12838
+ children
12839
+ }
12840
+ )
12841
+ ]
12842
+ }
12843
+ );
12844
+ }
11726
12845
  function ChainSelectorPanel({
11727
12846
  error,
11728
12847
  isChainSelected,
@@ -11731,6 +12850,21 @@ function ChainSelectorPanel({
11731
12850
  otherChains,
11732
12851
  popularChains
11733
12852
  }) {
12853
+ const [chainSearch, setChainSearch] = (0, import_react28.useState)("");
12854
+ const filteredPopular = (0, import_react28.useMemo)(() => {
12855
+ if (!chainSearch) return popularChains;
12856
+ const q = chainSearch.toLowerCase();
12857
+ return popularChains.filter(
12858
+ (c) => resolveChainLabel(c).toLowerCase().includes(q)
12859
+ );
12860
+ }, [popularChains, chainSearch]);
12861
+ const filteredOther = (0, import_react28.useMemo)(() => {
12862
+ if (!chainSearch) return otherChains;
12863
+ const q = chainSearch.toLowerCase();
12864
+ return otherChains.filter(
12865
+ (c) => resolveChainLabel(c).toLowerCase().includes(q)
12866
+ );
12867
+ }, [otherChains, chainSearch]);
11734
12868
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
11735
12869
  "div",
11736
12870
  {
@@ -11746,22 +12880,58 @@ function ChainSelectorPanel({
11746
12880
  "div",
11747
12881
  {
11748
12882
  style: {
11749
- padding: `${spacing[2]} ${spacing[3]}`,
11750
- borderBottom: `1px solid rgba(63, 63, 70, 0.5)`
12883
+ padding: `${spacing[2]} ${spacing[2]}`,
12884
+ borderBottom: `1px solid ${colors.border}`
11751
12885
  },
11752
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11753
- "span",
11754
- {
11755
- style: {
11756
- fontSize: fontSize.xs,
11757
- fontWeight: fontWeight.medium,
11758
- color: colors.mutedForeground,
11759
- textTransform: "uppercase",
11760
- letterSpacing: "0.05em"
11761
- },
11762
- children: "Chain"
11763
- }
11764
- )
12886
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { position: "relative" }, children: [
12887
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
12888
+ "svg",
12889
+ {
12890
+ style: {
12891
+ position: "absolute",
12892
+ left: spacing[2.5],
12893
+ top: "50%",
12894
+ transform: "translateY(-50%)",
12895
+ width: "1rem",
12896
+ height: "1rem",
12897
+ color: colors.mutedForeground,
12898
+ pointerEvents: "none"
12899
+ },
12900
+ viewBox: "0 0 24 24",
12901
+ fill: "none",
12902
+ stroke: "currentColor",
12903
+ strokeWidth: 2,
12904
+ children: [
12905
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
12906
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { strokeLinecap: "round", d: "m21 21-4.35-4.35" })
12907
+ ]
12908
+ }
12909
+ ),
12910
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
12911
+ "input",
12912
+ {
12913
+ type: "text",
12914
+ placeholder: "Chain",
12915
+ value: chainSearch,
12916
+ onChange: (e2) => setChainSearch(e2.target.value),
12917
+ style: {
12918
+ width: "100%",
12919
+ boxSizing: "border-box",
12920
+ paddingLeft: spacing[8],
12921
+ paddingRight: spacing[3],
12922
+ paddingTop: spacing[2],
12923
+ paddingBottom: spacing[2],
12924
+ fontSize: fontSize.sm,
12925
+ backgroundColor: colors.muted,
12926
+ border: `1px solid ${colors.border}`,
12927
+ borderRadius: borderRadius.lg,
12928
+ color: colors.foreground,
12929
+ outline: "none",
12930
+ transition: "all 0.2s"
12931
+ }
12932
+ }
12933
+ )
12934
+ ] })
11765
12935
  }
11766
12936
  ),
11767
12937
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -11849,21 +13019,9 @@ function ChainSelectorPanel({
11849
13019
  ]
11850
13020
  }
11851
13021
  ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
11852
- popularChains.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { marginBottom: spacing[2] }, children: [
11853
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { padding: `${spacing[1.5]} ${spacing[3]}` }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11854
- "span",
11855
- {
11856
- style: {
11857
- fontSize: "10px",
11858
- fontWeight: fontWeight.medium,
11859
- color: "rgba(161, 161, 170, 0.7)",
11860
- textTransform: "uppercase",
11861
- letterSpacing: "0.05em"
11862
- },
11863
- children: "Popular"
11864
- }
11865
- ) }),
11866
- popularChains.map((chain, idx) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
13022
+ filteredPopular.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
13023
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SectionLabel, { icon: "spark", children: "Popular chains" }),
13024
+ filteredPopular.map((chain, idx) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11867
13025
  ChainItem,
11868
13026
  {
11869
13027
  chain,
@@ -11876,30 +13034,9 @@ function ChainSelectorPanel({
11876
13034
  )
11877
13035
  ))
11878
13036
  ] }),
11879
- otherChains.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
11880
- popularChains.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11881
- "div",
11882
- {
11883
- style: {
11884
- padding: `${spacing[1.5]} ${spacing[3]}`,
11885
- marginTop: spacing[2]
11886
- },
11887
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11888
- "span",
11889
- {
11890
- style: {
11891
- fontSize: "10px",
11892
- fontWeight: fontWeight.medium,
11893
- color: "rgba(161, 161, 170, 0.7)",
11894
- textTransform: "uppercase",
11895
- letterSpacing: "0.05em"
11896
- },
11897
- children: "All Chains"
11898
- }
11899
- )
11900
- }
11901
- ),
11902
- otherChains.map((chain, idx) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
13037
+ filteredOther.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
13038
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SectionLabel, { icon: "sort", children: "Chains A-Z" }),
13039
+ filteredOther.map((chain, idx) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11903
13040
  ChainItem,
11904
13041
  {
11905
13042
  chain,
@@ -11912,21 +13049,21 @@ function ChainSelectorPanel({
11912
13049
  )
11913
13050
  ))
11914
13051
  ] }),
11915
- popularChains.length === 0 && otherChains.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
13052
+ filteredPopular.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11916
13053
  "div",
11917
13054
  {
11918
13055
  style: {
11919
- padding: `${spacing[3]} ${spacing[4]}`,
13056
+ padding: `${spacing[3]} ${spacing[2]}`,
11920
13057
  textAlign: "center"
11921
13058
  },
11922
13059
  children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11923
13060
  "p",
11924
13061
  {
11925
13062
  style: {
11926
- fontSize: fontSize.sm,
13063
+ fontSize: fontSize.xs,
11927
13064
  color: colors.mutedForeground
11928
13065
  },
11929
- children: "No chains available"
13066
+ children: "No chains found"
11930
13067
  }
11931
13068
  )
11932
13069
  }
@@ -11938,10 +13075,11 @@ function ChainSelectorPanel({
11938
13075
  }
11939
13076
  );
11940
13077
  }
11941
- var import_jsx_runtime21;
13078
+ var import_react28, import_jsx_runtime21;
11942
13079
  var init_ChainSelectorPanel = __esm({
11943
13080
  "src/widget/features/token-selection/components/ChainSelectorPanel.tsx"() {
11944
13081
  "use strict";
13082
+ import_react28 = require("react");
11945
13083
  init_utils2();
11946
13084
  init_styles();
11947
13085
  import_jsx_runtime21 = require("react/jsx-runtime");
@@ -11998,8 +13136,8 @@ function TokenSearchInput({
11998
13136
  paddingTop: spacing[2],
11999
13137
  paddingBottom: spacing[2],
12000
13138
  fontSize: fontSize.sm,
12001
- backgroundColor: "rgba(63, 63, 70, 0.5)",
12002
- border: `1px solid rgba(63, 63, 70, 0.5)`,
13139
+ backgroundColor: colors.muted,
13140
+ border: `1px solid ${colors.border}`,
12003
13141
  borderRadius: borderRadius.lg,
12004
13142
  color: colors.foreground,
12005
13143
  outline: "none",
@@ -12475,6 +13613,86 @@ var init_WalletTokenListItem = __esm({
12475
13613
  });
12476
13614
 
12477
13615
  // src/widget/features/token-selection/components/TokenSelectorPanel.tsx
13616
+ function TokenSectionLabel({
13617
+ children,
13618
+ icon
13619
+ }) {
13620
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
13621
+ "div",
13622
+ {
13623
+ style: {
13624
+ display: "flex",
13625
+ alignItems: "center",
13626
+ gap: "0.375rem",
13627
+ paddingLeft: spacing[3],
13628
+ paddingRight: spacing[3],
13629
+ paddingTop: spacing[1],
13630
+ paddingBottom: spacing[1],
13631
+ marginTop: spacing[1],
13632
+ marginBottom: spacing[1]
13633
+ },
13634
+ children: [
13635
+ icon === "wallet" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13636
+ "svg",
13637
+ {
13638
+ style: {
13639
+ width: "0.75rem",
13640
+ height: "0.75rem",
13641
+ color: colors.primary,
13642
+ flexShrink: 0
13643
+ },
13644
+ viewBox: "0 0 24 24",
13645
+ fill: "none",
13646
+ stroke: "currentColor",
13647
+ strokeWidth: 2,
13648
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13649
+ "path",
13650
+ {
13651
+ strokeLinecap: "round",
13652
+ strokeLinejoin: "round",
13653
+ d: "M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18-3H3m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6"
13654
+ }
13655
+ )
13656
+ }
13657
+ ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13658
+ "svg",
13659
+ {
13660
+ style: {
13661
+ width: "0.75rem",
13662
+ height: "0.75rem",
13663
+ color: colors.primary,
13664
+ flexShrink: 0
13665
+ },
13666
+ viewBox: "0 0 24 24",
13667
+ fill: "none",
13668
+ stroke: "currentColor",
13669
+ strokeWidth: 2,
13670
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13671
+ "path",
13672
+ {
13673
+ strokeLinecap: "round",
13674
+ strokeLinejoin: "round",
13675
+ d: "M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09Z"
13676
+ }
13677
+ )
13678
+ }
13679
+ ),
13680
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13681
+ "span",
13682
+ {
13683
+ style: {
13684
+ fontSize: "0.75rem",
13685
+ lineHeight: "1rem",
13686
+ fontWeight: fontWeight.medium,
13687
+ color: colors.primary
13688
+ },
13689
+ children
13690
+ }
13691
+ )
13692
+ ]
13693
+ }
13694
+ );
13695
+ }
12478
13696
  function TokenSelectorPanel({
12479
13697
  filteredTokens,
12480
13698
  filteredWalletTokens,
@@ -12487,9 +13705,10 @@ function TokenSelectorPanel({
12487
13705
  searchQuery,
12488
13706
  selectedChain,
12489
13707
  setSearchQuery,
12490
- tokensError,
12491
- walletAddress
13708
+ tokensError
12492
13709
  }) {
13710
+ const hasWalletTokens = filteredWalletTokens.length > 0;
13711
+ const hasPopularTokens = filteredTokens.length > 0;
12493
13712
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
12494
13713
  "div",
12495
13714
  {
@@ -12500,61 +13719,20 @@ function TokenSelectorPanel({
12500
13719
  overflow: "hidden"
12501
13720
  },
12502
13721
  children: [
12503
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
13722
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12504
13723
  "div",
12505
13724
  {
12506
13725
  style: {
12507
- padding: `${spacing[2]} ${spacing[3]}`,
12508
- borderBottom: `1px solid rgba(63, 63, 70, 0.5)`
13726
+ padding: `${spacing[2]} ${spacing[2]}`,
13727
+ borderBottom: `1px solid ${colors.border}`
12509
13728
  },
12510
- children: [
12511
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
12512
- "div",
12513
- {
12514
- style: {
12515
- display: "flex",
12516
- alignItems: "center",
12517
- gap: spacing[2],
12518
- marginBottom: spacing[2]
12519
- },
12520
- children: [
12521
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12522
- "span",
12523
- {
12524
- style: {
12525
- fontSize: fontSize.xs,
12526
- fontWeight: fontWeight.medium,
12527
- color: colors.mutedForeground,
12528
- textTransform: "uppercase",
12529
- letterSpacing: "0.05em"
12530
- },
12531
- children: "Token"
12532
- }
12533
- ),
12534
- walletAddress && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12535
- "span",
12536
- {
12537
- style: {
12538
- fontSize: "10px",
12539
- color: colors.primary,
12540
- backgroundColor: "rgba(59, 130, 246, 0.1)",
12541
- padding: `${spacing[0.5]} ${spacing[1.5]}`,
12542
- borderRadius: borderRadius.md
12543
- },
12544
- children: "Wallet Connected"
12545
- }
12546
- )
12547
- ]
12548
- }
12549
- ),
12550
- selectedChain ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12551
- TokenSearchInput,
12552
- {
12553
- searchQuery,
12554
- setSearchQuery
12555
- }
12556
- ) : null
12557
- ]
13729
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13730
+ TokenSearchInput,
13731
+ {
13732
+ searchQuery,
13733
+ setSearchQuery
13734
+ }
13735
+ )
12558
13736
  }
12559
13737
  ),
12560
13738
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
@@ -12563,115 +13741,99 @@ function TokenSelectorPanel({
12563
13741
  style: {
12564
13742
  flex: 1,
12565
13743
  overflowY: "auto",
12566
- padding: `${spacing[2]} ${spacing[1]}`
13744
+ padding: `${spacing[1]} ${spacing[1]}`
12567
13745
  },
12568
- children: !selectedChain || isLoadingTokens || tokensError || filteredTokens.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13746
+ children: !selectedChain ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12569
13747
  TokenSelectorStateView,
12570
13748
  {
12571
13749
  isLoadingTokens,
12572
13750
  searchQuery,
12573
13751
  setSearchQuery,
12574
- state: !selectedChain ? "no-chain" : tokensError ? "error" : "empty",
12575
- tokensError
13752
+ state: "no-chain",
13753
+ tokensError: null
12576
13754
  }
12577
- ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
12578
- "div",
13755
+ ) : isLoadingTokens && !hasWalletTokens ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13756
+ TokenSelectorStateView,
12579
13757
  {
12580
- style: {
12581
- display: "flex",
12582
- flexDirection: "column",
12583
- gap: spacing[0.5]
12584
- },
12585
- children: [
12586
- filteredWalletTokens.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12587
- "div",
12588
- {
12589
- style: {
12590
- display: "flex",
12591
- alignItems: "center",
12592
- gap: "0.375rem",
12593
- paddingLeft: "0.5rem",
12594
- paddingRight: "0.5rem",
12595
- marginBottom: spacing[2]
12596
- },
12597
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12598
- "span",
12599
- {
12600
- style: {
12601
- fontSize: "0.75rem",
12602
- lineHeight: "1rem",
12603
- color: colors.primary
12604
- },
12605
- children: "Your tokens"
12606
- }
12607
- )
12608
- }
12609
- ) : null,
12610
- filteredWalletTokens.map((token, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12611
- WalletTokenListItem,
12612
- {
12613
- token,
12614
- onSelect: onSelectWalletToken
13758
+ isLoadingTokens: true,
13759
+ searchQuery,
13760
+ setSearchQuery,
13761
+ state: "empty",
13762
+ tokensError: null
13763
+ }
13764
+ ) : tokensError && !hasWalletTokens ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13765
+ TokenSelectorStateView,
13766
+ {
13767
+ isLoadingTokens: false,
13768
+ searchQuery,
13769
+ setSearchQuery,
13770
+ state: "error",
13771
+ tokensError
13772
+ }
13773
+ ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { display: "flex", flexDirection: "column" }, children: [
13774
+ hasWalletTokens && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
13775
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TokenSectionLabel, { icon: "wallet", children: "Your tokens" }),
13776
+ filteredWalletTokens.map((token, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13777
+ WalletTokenListItem,
13778
+ {
13779
+ token,
13780
+ onSelect: onSelectWalletToken
13781
+ },
13782
+ `${token.address}-${i}`
13783
+ ))
13784
+ ] }),
13785
+ isLoadingTokens ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13786
+ TokenSelectorStateView,
13787
+ {
13788
+ isLoadingTokens: true,
13789
+ searchQuery,
13790
+ setSearchQuery,
13791
+ state: "empty",
13792
+ tokensError: null
13793
+ }
13794
+ ) : hasPopularTokens ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
13795
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TokenSectionLabel, { icon: "spark", children: "Popular tokens" }),
13796
+ filteredTokens.map((token, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13797
+ AvailableTokenListItem,
13798
+ {
13799
+ token,
13800
+ onSelect: onSelectToken
13801
+ },
13802
+ `${token.address}-${i}`
13803
+ )),
13804
+ hasNextPage ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13805
+ "button",
13806
+ {
13807
+ type: "button",
13808
+ onClick: () => {
13809
+ void loadMore();
12615
13810
  },
12616
- `${token.address}-${i}`
12617
- )),
12618
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12619
- "div",
12620
- {
12621
- style: {
12622
- display: "flex",
12623
- alignItems: "center",
12624
- gap: "0.375rem",
12625
- paddingLeft: "0.5rem",
12626
- paddingRight: "0.5rem",
12627
- marginBottom: spacing[2]
12628
- },
12629
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12630
- "span",
12631
- {
12632
- style: {
12633
- fontSize: "0.75rem",
12634
- lineHeight: "1rem",
12635
- color: colors.primary
12636
- },
12637
- children: "Popular tokens"
12638
- }
12639
- )
12640
- }
12641
- ),
12642
- filteredTokens.map((token, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12643
- AvailableTokenListItem,
12644
- {
12645
- token,
12646
- onSelect: onSelectToken
13811
+ disabled: isLoadingMore,
13812
+ style: {
13813
+ marginTop: spacing[2],
13814
+ marginLeft: spacing[2],
13815
+ marginRight: spacing[2],
13816
+ padding: `${spacing[2]} ${spacing[3]}`,
13817
+ borderRadius: borderRadius.lg,
13818
+ border: `1px solid ${colors.border}`,
13819
+ backgroundColor: colors.card,
13820
+ color: colors.foreground,
13821
+ cursor: isLoadingMore ? "wait" : "pointer"
12647
13822
  },
12648
- `${token.address}-${i}`
12649
- )),
12650
- hasNextPage ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12651
- "button",
12652
- {
12653
- type: "button",
12654
- onClick: () => {
12655
- void loadMore();
12656
- },
12657
- disabled: isLoadingMore,
12658
- style: {
12659
- marginTop: spacing[2],
12660
- marginLeft: spacing[2],
12661
- marginRight: spacing[2],
12662
- padding: `${spacing[2]} ${spacing[3]}`,
12663
- borderRadius: borderRadius.lg,
12664
- border: `1px solid ${colors.border}`,
12665
- backgroundColor: colors.card,
12666
- color: colors.foreground,
12667
- cursor: isLoadingMore ? "wait" : "pointer"
12668
- },
12669
- children: isLoadingMore ? "Loading more..." : "Load more"
12670
- }
12671
- ) : null
12672
- ]
12673
- }
12674
- )
13823
+ children: isLoadingMore ? "Loading more..." : "Load more"
13824
+ }
13825
+ ) : null
13826
+ ] }) : !hasWalletTokens ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
13827
+ TokenSelectorStateView,
13828
+ {
13829
+ isLoadingTokens: false,
13830
+ searchQuery,
13831
+ setSearchQuery,
13832
+ state: "empty",
13833
+ tokensError: null
13834
+ }
13835
+ ) : null
13836
+ ] })
12675
13837
  }
12676
13838
  )
12677
13839
  ]
@@ -31222,29 +32384,7 @@ function SwapTokenSelect({
31222
32384
  popularChains
31223
32385
  }
31224
32386
  ),
31225
- localChain === null ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
31226
- "div",
31227
- {
31228
- style: {
31229
- flex: 1,
31230
- display: "flex",
31231
- alignItems: "center",
31232
- justifyContent: "center",
31233
- padding: spacing[4]
31234
- },
31235
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
31236
- "p",
31237
- {
31238
- style: {
31239
- fontSize: fontSize.sm,
31240
- color: colors.mutedForeground,
31241
- textAlign: "center"
31242
- },
31243
- children: "Select a chain to see tokens"
31244
- }
31245
- )
31246
- }
31247
- ) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
32387
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
31248
32388
  TokenSelectorPanel,
31249
32389
  {
31250
32390
  filteredTokens: visibleTokens,
@@ -31436,58 +32576,38 @@ function SwapWalletSelector({
31436
32576
  children: "Connect Wallet"
31437
32577
  }
31438
32578
  ),
31439
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
32579
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
31440
32580
  "div",
31441
32581
  {
31442
32582
  style: {
31443
- position: "relative",
31444
32583
  display: "flex",
31445
32584
  alignItems: "center",
31446
- borderRadius: "9999px",
31447
- background: colors.background,
31448
- border: `1px solid ${colors.mutedForeground}`,
31449
- padding: "3px"
32585
+ borderRadius: borderRadius.lg,
32586
+ backgroundColor: colors.muted,
32587
+ padding: "3px",
32588
+ gap: "2px"
31450
32589
  },
31451
- children: [
31452
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
31453
- "div",
31454
- {
31455
- style: {
31456
- position: "absolute",
31457
- top: 3,
31458
- bottom: 3,
31459
- width: "calc(50% - 3px)",
31460
- borderRadius: "9999px",
31461
- background: `linear-gradient(to bottom, ${colors.zinc[100]}, ${colors.zinc[200]})`,
31462
- border: `1px solid ${colors.mutedForeground}`,
31463
- transition: "transform 300ms ease-out",
31464
- transform: selectedNamespace === "evm" ? "translateX(0)" : "translateX(100%)"
31465
- }
31466
- }
31467
- ),
31468
- tabs.map((t) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
31469
- "button",
31470
- {
31471
- onClick: () => setSelectedNamespace(t.id),
31472
- style: {
31473
- position: "relative",
31474
- zIndex: 10,
31475
- padding: "4px 11px",
31476
- fontSize: "10px",
31477
- outline: "none",
31478
- fontWeight: 600,
31479
- borderRadius: "9999px",
31480
- background: "transparent",
31481
- border: "none",
31482
- cursor: "pointer",
31483
- transition: "color 200ms",
31484
- color: selectedNamespace === t.id ? colors.black : colors.mutedForeground
31485
- },
31486
- children: t.label
32590
+ children: tabs.map((t) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
32591
+ "button",
32592
+ {
32593
+ onClick: () => setSelectedNamespace(t.id),
32594
+ style: {
32595
+ padding: `${spacing[1]} ${spacing[3]}`,
32596
+ fontSize: fontSize.sm,
32597
+ fontWeight: fontWeight.medium,
32598
+ borderRadius: borderRadius.md,
32599
+ background: selectedNamespace === t.id ? colors.card : "transparent",
32600
+ border: selectedNamespace === t.id ? `1px solid ${colors.border}` : "1px solid transparent",
32601
+ cursor: "pointer",
32602
+ transition: "all 0.15s",
32603
+ color: selectedNamespace === t.id ? colors.foreground : colors.mutedForeground,
32604
+ boxShadow: selectedNamespace === t.id ? "0 1px 3px rgba(0,0,0,0.08)" : "none",
32605
+ outline: "none"
31487
32606
  },
31488
- t.id
31489
- ))
31490
- ]
32607
+ children: t.label
32608
+ },
32609
+ t.id
32610
+ ))
31491
32611
  }
31492
32612
  )
31493
32613
  ]
@@ -32088,7 +33208,7 @@ function RateRow({ label, value }) {
32088
33208
  );
32089
33209
  }
32090
33210
  function SwapMode({
32091
- theme = "system",
33211
+ theme: themeProp,
32092
33212
  style
32093
33213
  }) {
32094
33214
  const [stage, setStage] = (0, import_react46.useState)("home");
@@ -32137,7 +33257,11 @@ function SwapMode({
32137
33257
  const settingsRef = (0, import_react46.useRef)(null);
32138
33258
  const currencyDropdownRef = (0, import_react46.useRef)(null);
32139
33259
  const { emitEvent } = useTrustware();
32140
- const { features } = useTrustwareConfig();
33260
+ const { features, theme: configTheme } = useTrustwareConfig();
33261
+ const effectiveThemeSetting = themeProp ?? configTheme ?? "system";
33262
+ const { resolvedTheme, toggleTheme } = useThemePreference(
33263
+ effectiveThemeSetting
33264
+ );
32141
33265
  const defaultDestRef = features.swapDefaultDestToken;
32142
33266
  const lockDestToken = features.swapLockDestToken && !!defaultDestRef;
32143
33267
  const allowedDestTokens = features.swapAllowedDestTokens;
@@ -32703,7 +33827,7 @@ function SwapMode({
32703
33827
  return () => document.removeEventListener("mousedown", handler);
32704
33828
  }, [showCurrencyDropdown]);
32705
33829
  if (stage === "select-from") {
32706
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33830
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
32707
33831
  SwapTokenSelect,
32708
33832
  {
32709
33833
  side: "from",
@@ -32721,7 +33845,7 @@ function SwapMode({
32721
33845
  ) });
32722
33846
  }
32723
33847
  if (stage === "select-to" && !lockDestToken) {
32724
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33848
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
32725
33849
  SwapTokenSelect,
32726
33850
  {
32727
33851
  side: "to",
@@ -32740,7 +33864,7 @@ function SwapMode({
32740
33864
  ) });
32741
33865
  }
32742
33866
  if (stage === "connect-wallet") {
32743
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(WidgetContainer, { theme, style, children: [
33867
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(WidgetContainer, { theme: resolvedTheme, style, children: [
32744
33868
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
32745
33869
  SwapWalletSelector,
32746
33870
  {
@@ -32783,7 +33907,7 @@ function SwapMode({
32783
33907
  const offset = circ - progress / 100 * circ;
32784
33908
  const isApproving = txStatus === "approving";
32785
33909
  const title = isApproving ? "Approving..." : "Order Submitted";
32786
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { padding: `${spacing[5]} ${spacing[6]} ${spacing[6]}` }, children: [
33910
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { padding: `${spacing[5]} ${spacing[6]} ${spacing[6]}` }, children: [
32787
33911
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
32788
33912
  "div",
32789
33913
  {
@@ -33233,7 +34357,7 @@ function SwapMode({
33233
34357
  dateStyle: "medium",
33234
34358
  timeStyle: "short"
33235
34359
  }) ?? null;
33236
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { position: "relative", overflow: "hidden" }, children: [
34360
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { position: "relative", overflow: "hidden" }, children: [
33237
34361
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react46.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ConfettiEffect3, { isActive: true, pieceCount: 60, clearDelay: 4e3 }) }),
33238
34362
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { padding: `${spacing[6]} ${spacing[6]} 0` }, children: [
33239
34363
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
@@ -33312,30 +34436,58 @@ function SwapMode({
33312
34436
  fontSize: fontSize.sm
33313
34437
  },
33314
34438
  children: [
33315
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { color: colors.mutedForeground }, children: "You sold" }),
33316
34439
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
33317
- "span",
34440
+ "div",
33318
34441
  {
33319
34442
  style: {
33320
- display: "inline-flex",
34443
+ display: "flex",
33321
34444
  alignItems: "center",
33322
- gap: spacing[2],
34445
+ gap: spacing[2]
34446
+ },
34447
+ children: [
34448
+ fromToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { position: "relative", flexShrink: 0 }, children: [
34449
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34450
+ "img",
34451
+ {
34452
+ src: fromToken.iconUrl,
34453
+ alt: "",
34454
+ style: {
34455
+ width: "1.375rem",
34456
+ height: "1.375rem",
34457
+ borderRadius: "9999px"
34458
+ }
34459
+ }
34460
+ ),
34461
+ fromChain?.chainIconURI && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34462
+ "img",
34463
+ {
34464
+ src: fromChain.chainIconURI,
34465
+ alt: "",
34466
+ style: {
34467
+ position: "absolute",
34468
+ bottom: -2,
34469
+ right: -2,
34470
+ width: "0.625rem",
34471
+ height: "0.625rem",
34472
+ borderRadius: "9999px",
34473
+ border: `1.5px solid ${colors.background}`,
34474
+ objectFit: "cover"
34475
+ }
34476
+ }
34477
+ )
34478
+ ] }),
34479
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { color: colors.mutedForeground }, children: "You sold" })
34480
+ ]
34481
+ }
34482
+ ),
34483
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34484
+ "span",
34485
+ {
34486
+ style: {
33323
34487
  fontWeight: fontWeight.semibold,
33324
34488
  color: colors.foreground
33325
34489
  },
33326
34490
  children: [
33327
- fromToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33328
- "img",
33329
- {
33330
- src: fromToken.iconUrl,
33331
- style: {
33332
- width: "1.25rem",
33333
- height: "1.25rem",
33334
- borderRadius: "9999px"
33335
- },
33336
- alt: ""
33337
- }
33338
- ),
33339
34491
  fmtAmount(tokenSellNum, 4),
33340
34492
  " ",
33341
34493
  fromToken?.symbol
@@ -33356,30 +34508,58 @@ function SwapMode({
33356
34508
  marginTop: spacing[3]
33357
34509
  },
33358
34510
  children: [
33359
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { color: colors.mutedForeground }, children: "Received" }),
33360
34511
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
33361
- "span",
34512
+ "div",
33362
34513
  {
33363
34514
  style: {
33364
- display: "inline-flex",
34515
+ display: "flex",
33365
34516
  alignItems: "center",
33366
- gap: spacing[2],
34517
+ gap: spacing[2]
34518
+ },
34519
+ children: [
34520
+ toToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { position: "relative", flexShrink: 0 }, children: [
34521
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34522
+ "img",
34523
+ {
34524
+ src: toToken.iconUrl,
34525
+ alt: "",
34526
+ style: {
34527
+ width: "1.375rem",
34528
+ height: "1.375rem",
34529
+ borderRadius: "9999px"
34530
+ }
34531
+ }
34532
+ ),
34533
+ toChain?.chainIconURI && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34534
+ "img",
34535
+ {
34536
+ src: toChain.chainIconURI,
34537
+ alt: "",
34538
+ style: {
34539
+ position: "absolute",
34540
+ bottom: -2,
34541
+ right: -2,
34542
+ width: "0.625rem",
34543
+ height: "0.625rem",
34544
+ borderRadius: "9999px",
34545
+ border: `1.5px solid ${colors.background}`,
34546
+ objectFit: "cover"
34547
+ }
34548
+ }
34549
+ )
34550
+ ] }),
34551
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { color: colors.mutedForeground }, children: "Received" })
34552
+ ]
34553
+ }
34554
+ ),
34555
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34556
+ "span",
34557
+ {
34558
+ style: {
33367
34559
  fontWeight: fontWeight.semibold,
33368
34560
  color: colors.foreground
33369
34561
  },
33370
34562
  children: [
33371
- toToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33372
- "img",
33373
- {
33374
- src: toToken.iconUrl,
33375
- style: {
33376
- width: "1.25rem",
33377
- height: "1.25rem",
33378
- borderRadius: "9999px"
33379
- },
33380
- alt: ""
33381
- }
33382
- ),
33383
34563
  finalToAmount !== null ? fmtAmount(finalToAmount, 4) : "\u2014",
33384
34564
  " ",
33385
34565
  toToken?.symbol
@@ -33430,13 +34610,6 @@ function SwapMode({
33430
34610
  value: effectiveRate
33431
34611
  }
33432
34612
  ),
33433
- (fromChain?.networkName ?? fromChain?.axelarChainName) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33434
- SuccessReceiptRow,
33435
- {
33436
- label: "Network",
33437
- value: fromChain?.networkName ?? fromChain?.axelarChainName
33438
- }
33439
- ),
33440
34613
  completedStr && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SuccessReceiptRow, { label: "Completed", value: completedStr }),
33441
34614
  txHash && (() => {
33442
34615
  const srcUrl = buildExplorerUrl(
@@ -33745,7 +34918,7 @@ function SwapMode({
33745
34918
  ] }) });
33746
34919
  }
33747
34920
  if (stage === "error") {
33748
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34921
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
33749
34922
  "div",
33750
34923
  {
33751
34924
  style: {
@@ -33879,422 +35052,408 @@ function SwapMode({
33879
35052
  if (stage === "review") {
33880
35053
  const reviewToAmount = toAmount ?? displayToAmount;
33881
35054
  const reviewToUsd = toUsd > 0 ? toUsd : displayToUsd;
33882
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { padding: `${spacing[5]} ${spacing[6]} ${spacing[6]}` }, children: [
33883
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
33884
- "div",
33885
- {
33886
- style: {
33887
- display: "flex",
33888
- alignItems: "center",
33889
- justifyContent: "space-between",
33890
- marginBottom: spacing[5]
33891
- },
33892
- children: [
33893
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33894
- "span",
33895
- {
33896
- style: {
33897
- fontSize: fontSize.sm,
33898
- fontWeight: fontWeight.medium,
33899
- color: colors.mutedForeground
33900
- },
33901
- children: "You're swapping"
33902
- }
33903
- ),
33904
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33905
- "button",
33906
- {
33907
- onClick: () => setStage("home"),
33908
- style: {
33909
- width: "2rem",
33910
- height: "2rem",
33911
- borderRadius: "9999px",
33912
- display: "flex",
33913
- alignItems: "center",
33914
- justifyContent: "center",
33915
- backgroundColor: "transparent",
33916
- border: 0,
33917
- cursor: "pointer"
33918
- },
33919
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33920
- "svg",
35055
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35056
+ "div",
35057
+ {
35058
+ style: {
35059
+ padding: `${spacing[5]} ${spacing[6]} ${spacing[6]}`,
35060
+ maxHeight: "85vh",
35061
+ overflowY: "auto"
35062
+ },
35063
+ children: [
35064
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35065
+ "div",
35066
+ {
35067
+ style: {
35068
+ display: "flex",
35069
+ alignItems: "center",
35070
+ justifyContent: "space-between",
35071
+ marginBottom: spacing[5]
35072
+ },
35073
+ children: [
35074
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35075
+ "span",
33921
35076
  {
33922
35077
  style: {
33923
- width: "1.25rem",
33924
- height: "1.25rem",
33925
- color: colors.foreground
35078
+ fontSize: fontSize.sm,
35079
+ fontWeight: fontWeight.medium,
35080
+ color: colors.mutedForeground
33926
35081
  },
33927
- viewBox: "0 0 24 24",
33928
- fill: "none",
33929
- stroke: "currentColor",
33930
- strokeWidth: 2,
33931
- strokeLinecap: "round",
33932
- strokeLinejoin: "round",
33933
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M18 6L6 18M6 6l12 12" })
35082
+ children: "You're swapping"
35083
+ }
35084
+ ),
35085
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35086
+ "button",
35087
+ {
35088
+ onClick: () => setStage("home"),
35089
+ style: {
35090
+ width: "2rem",
35091
+ height: "2rem",
35092
+ borderRadius: "9999px",
35093
+ display: "flex",
35094
+ alignItems: "center",
35095
+ justifyContent: "center",
35096
+ backgroundColor: "transparent",
35097
+ border: 0,
35098
+ cursor: "pointer"
35099
+ },
35100
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35101
+ "svg",
35102
+ {
35103
+ style: {
35104
+ width: "1.25rem",
35105
+ height: "1.25rem",
35106
+ color: colors.foreground
35107
+ },
35108
+ viewBox: "0 0 24 24",
35109
+ fill: "none",
35110
+ stroke: "currentColor",
35111
+ strokeWidth: 2,
35112
+ strokeLinecap: "round",
35113
+ strokeLinejoin: "round",
35114
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M18 6L6 18M6 6l12 12" })
35115
+ }
35116
+ )
33934
35117
  }
33935
35118
  )
33936
- }
33937
- )
33938
- ]
33939
- }
33940
- ),
33941
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
33942
- "div",
33943
- {
33944
- style: {
33945
- display: "flex",
33946
- alignItems: "center",
33947
- justifyContent: "space-between"
33948
- },
33949
- children: [
33950
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
33951
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
33952
- "p",
33953
- {
33954
- style: {
33955
- fontSize: "1.75rem",
33956
- fontWeight: fontWeight.semibold,
33957
- color: colors.foreground,
33958
- lineHeight: 1.2
33959
- },
33960
- children: [
33961
- fmtAmount(tokenSellNum, 5),
33962
- " ",
33963
- fromToken?.symbol
33964
- ]
33965
- }
33966
- ),
33967
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33968
- "p",
33969
- {
33970
- style: {
33971
- fontSize: fontSize.sm,
33972
- color: colors.mutedForeground,
33973
- marginTop: "0.125rem"
33974
- },
33975
- children: fmtLocal(fromUsd)
33976
- }
33977
- )
33978
- ] }),
33979
- fromToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33980
- TokenIcon,
33981
- {
33982
- icon: fromToken.iconUrl,
33983
- chainIcon: fromChain?.chainIconURI,
33984
- size: "lg"
33985
- }
33986
- )
33987
- ]
33988
- }
33989
- ),
33990
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33991
- "div",
33992
- {
33993
- style: {
33994
- display: "flex",
33995
- justifyContent: "center",
33996
- margin: `${spacing[3]} 0`
33997
- },
33998
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33999
- "svg",
35119
+ ]
35120
+ }
35121
+ ),
35122
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35123
+ "div",
34000
35124
  {
34001
35125
  style: {
34002
- width: "1rem",
34003
- height: "1rem",
34004
- color: colors.mutedForeground
35126
+ display: "flex",
35127
+ alignItems: "center",
35128
+ justifyContent: "space-between"
34005
35129
  },
34006
- viewBox: "0 0 24 24",
34007
- fill: "none",
34008
- stroke: "currentColor",
34009
- strokeWidth: 2,
34010
- strokeLinecap: "round",
34011
- strokeLinejoin: "round",
34012
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M12 5v14m-7-7l7 7 7-7" })
35130
+ children: [
35131
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
35132
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35133
+ "p",
35134
+ {
35135
+ style: {
35136
+ fontSize: "1.75rem",
35137
+ fontWeight: fontWeight.semibold,
35138
+ color: colors.foreground,
35139
+ lineHeight: 1.2
35140
+ },
35141
+ children: [
35142
+ fmtAmount(tokenSellNum, 5),
35143
+ " ",
35144
+ fromToken?.symbol
35145
+ ]
35146
+ }
35147
+ ),
35148
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35149
+ "p",
35150
+ {
35151
+ style: {
35152
+ fontSize: fontSize.sm,
35153
+ color: colors.mutedForeground,
35154
+ marginTop: "0.125rem"
35155
+ },
35156
+ children: fmtLocal(fromUsd)
35157
+ }
35158
+ )
35159
+ ] }),
35160
+ fromToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35161
+ TokenIcon,
35162
+ {
35163
+ icon: fromToken.iconUrl,
35164
+ chainIcon: fromChain?.chainIconURI,
35165
+ size: "lg"
35166
+ }
35167
+ )
35168
+ ]
34013
35169
  }
34014
- )
34015
- }
34016
- ),
34017
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34018
- "div",
34019
- {
34020
- style: {
34021
- display: "flex",
34022
- alignItems: "center",
34023
- justifyContent: "space-between"
34024
- },
34025
- children: [
34026
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
34027
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34028
- "p",
34029
- {
34030
- style: {
34031
- fontSize: "1.75rem",
34032
- fontWeight: fontWeight.semibold,
34033
- color: colors.foreground,
34034
- lineHeight: 1.2
34035
- },
34036
- children: [
34037
- reviewToAmount !== null ? fmtAmount(reviewToAmount, 5) : "\u2014",
34038
- " ",
34039
- toToken?.symbol
34040
- ]
34041
- }
34042
- ),
34043
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34044
- "p",
35170
+ ),
35171
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35172
+ "div",
35173
+ {
35174
+ style: {
35175
+ display: "flex",
35176
+ justifyContent: "center",
35177
+ margin: `${spacing[3]} 0`
35178
+ },
35179
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35180
+ "svg",
34045
35181
  {
34046
35182
  style: {
34047
- fontSize: fontSize.sm,
34048
- color: colors.mutedForeground,
34049
- marginTop: "0.125rem"
35183
+ width: "1rem",
35184
+ height: "1rem",
35185
+ color: colors.mutedForeground
34050
35186
  },
34051
- children: fmtLocal(reviewToUsd)
35187
+ viewBox: "0 0 24 24",
35188
+ fill: "none",
35189
+ stroke: "currentColor",
35190
+ strokeWidth: 2,
35191
+ strokeLinecap: "round",
35192
+ strokeLinejoin: "round",
35193
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M12 5v14m-7-7l7 7 7-7" })
34052
35194
  }
34053
35195
  )
34054
- ] }),
34055
- toToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34056
- TokenIcon,
34057
- {
34058
- icon: toToken.iconUrl,
34059
- chainIcon: toChain?.chainIconURI,
34060
- size: "lg"
34061
- }
34062
- )
34063
- ]
34064
- }
34065
- ),
34066
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34067
- "button",
34068
- {
34069
- onClick: () => setShowReviewDetails((v) => !v),
34070
- style: {
34071
- margin: `${spacing[5]} 0`,
34072
- display: "flex",
34073
- alignItems: "center",
34074
- gap: spacing[2],
34075
- width: "100%",
34076
- background: "none",
34077
- border: 0,
34078
- cursor: "pointer",
34079
- color: colors.foreground,
34080
- fontSize: fontSize.sm,
34081
- fontWeight: fontWeight.medium
34082
- },
34083
- children: [
34084
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34085
- "div",
34086
- {
34087
- style: { flex: 1, height: "1px", backgroundColor: colors.border }
34088
- }
34089
- ),
34090
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34091
- "span",
34092
- {
34093
- style: {
34094
- display: "flex",
34095
- alignItems: "center",
34096
- gap: "0.25rem",
34097
- padding: `0 ${spacing[2]}`,
34098
- whiteSpace: "nowrap"
34099
- },
34100
- children: [
34101
- showReviewDetails ? "Show less" : "Show more",
34102
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34103
- "svg",
35196
+ }
35197
+ ),
35198
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35199
+ "div",
35200
+ {
35201
+ style: {
35202
+ display: "flex",
35203
+ alignItems: "center",
35204
+ justifyContent: "space-between"
35205
+ },
35206
+ children: [
35207
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
35208
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35209
+ "p",
34104
35210
  {
34105
35211
  style: {
34106
- width: "0.875rem",
34107
- height: "0.875rem",
34108
- transform: showReviewDetails ? "rotate(180deg)" : void 0,
34109
- transition: "transform 0.2s"
35212
+ fontSize: "1.75rem",
35213
+ fontWeight: fontWeight.semibold,
35214
+ color: colors.foreground,
35215
+ lineHeight: 1.2
34110
35216
  },
34111
- viewBox: "0 0 24 24",
34112
- fill: "none",
34113
- stroke: "currentColor",
34114
- strokeWidth: 2,
34115
- strokeLinecap: "round",
34116
- strokeLinejoin: "round",
34117
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M6 9l6 6 6-6" })
35217
+ children: [
35218
+ reviewToAmount !== null ? fmtAmount(reviewToAmount, 5) : "\u2014",
35219
+ " ",
35220
+ toToken?.symbol
35221
+ ]
34118
35222
  }
34119
35223
  ),
34120
- route.data && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34121
- "svg",
35224
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35225
+ "p",
34122
35226
  {
34123
- width: "14",
34124
- height: "14",
34125
- viewBox: "0 0 14 14",
34126
35227
  style: {
34127
- transform: "rotate(-90deg)",
34128
- flexShrink: 0,
34129
- opacity: 0.75,
34130
- marginLeft: "0.125rem"
35228
+ fontSize: fontSize.sm,
35229
+ color: colors.mutedForeground,
35230
+ marginTop: "0.125rem"
34131
35231
  },
34132
- children: [
34133
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34134
- "circle",
34135
- {
34136
- cx: "7",
34137
- cy: "7",
34138
- r: "5",
34139
- fill: "none",
34140
- stroke: "hsl(var(--tw-border))",
34141
- strokeWidth: "1.5"
34142
- }
34143
- ),
34144
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34145
- "circle",
34146
- {
34147
- cx: "7",
34148
- cy: "7",
34149
- r: "5",
34150
- fill: "none",
34151
- stroke: quoteAge >= QUOTE_TTL - 10 ? colors.destructive : colors.primary,
34152
- strokeWidth: "1.5",
34153
- strokeLinecap: "round",
34154
- strokeDasharray: "31.416",
34155
- strokeDashoffset: 31.416 * (quoteAge / QUOTE_TTL),
34156
- style: { transition: "stroke-dashoffset 1s linear" }
34157
- }
34158
- )
34159
- ]
35232
+ children: fmtLocal(reviewToUsd)
34160
35233
  }
34161
35234
  )
34162
- ]
34163
- }
34164
- ),
34165
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34166
- "div",
34167
- {
34168
- style: { flex: 1, height: "1px", backgroundColor: colors.border }
34169
- }
34170
- )
34171
- ]
34172
- }
34173
- ),
34174
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34175
- "div",
34176
- {
34177
- style: {
34178
- display: "flex",
34179
- flexDirection: "column",
34180
- gap: spacing[3],
34181
- fontSize: fontSize.sm
34182
- },
34183
- children: [
34184
- showReviewDetails && exchangeRate !== null && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34185
- ReviewDetailRow,
34186
- {
34187
- label: "Rate",
34188
- tooltip: "Current exchange rate between the two tokens",
34189
- value: `1 ${fromToken?.symbol} = ${fmtAmount(1 / (exchangeRate ?? 1), 4)} ${toToken?.symbol} ($${fmtAmount(fromTokenPriceUSD, 2)})`
34190
- }
34191
- ),
34192
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34193
- ReviewDetailRow,
34194
- {
34195
- label: "Fee",
34196
- tooltip: "Protocol fee charged by the bridge or DEX",
34197
- value: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34198
- "span",
35235
+ ] }),
35236
+ toToken?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35237
+ TokenIcon,
34199
35238
  {
34200
- style: {
34201
- color: colors.foreground,
34202
- fontWeight: fontWeight.medium
34203
- },
34204
- children: protocolFeeUsd !== null ? fmtLocal(protocolFeeUsd) : "Free"
35239
+ icon: toToken.iconUrl,
35240
+ chainIcon: toChain?.chainIconURI,
35241
+ size: "lg"
34205
35242
  }
34206
35243
  )
34207
- }
34208
- ),
34209
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34210
- ReviewDetailRow,
34211
- {
34212
- label: "Network cost",
34213
- tooltip: "Estimated gas fee paid to the blockchain network",
34214
- value: isGasSponsored ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SponsoredBadge, {}) : networkCostUsd !== null ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35244
+ ]
35245
+ }
35246
+ ),
35247
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35248
+ "button",
35249
+ {
35250
+ onClick: () => setShowReviewDetails((v) => !v),
35251
+ style: {
35252
+ margin: `${spacing[5]} 0`,
35253
+ display: "flex",
35254
+ alignItems: "center",
35255
+ gap: spacing[2],
35256
+ width: "100%",
35257
+ background: "none",
35258
+ border: 0,
35259
+ cursor: "pointer",
35260
+ color: colors.mutedForeground,
35261
+ fontSize: fontSize.sm,
35262
+ fontWeight: fontWeight.medium,
35263
+ padding: 0
35264
+ },
35265
+ children: [
35266
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35267
+ "div",
35268
+ {
35269
+ style: { flex: 1, height: "1px", backgroundColor: colors.border }
35270
+ }
35271
+ ),
35272
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34215
35273
  "span",
34216
35274
  {
34217
35275
  style: {
34218
35276
  display: "flex",
34219
35277
  alignItems: "center",
34220
35278
  gap: "0.25rem",
34221
- color: colors.mutedForeground
35279
+ padding: `0 ${spacing[2]}`,
35280
+ whiteSpace: "nowrap"
34222
35281
  },
34223
35282
  children: [
34224
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GasIcon, { size: "0.875rem" }),
34225
- fmtLocal(networkCostUsd)
35283
+ showReviewDetails ? "Hide details" : "View details",
35284
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35285
+ "svg",
35286
+ {
35287
+ style: {
35288
+ width: "0.875rem",
35289
+ height: "0.875rem",
35290
+ transform: showReviewDetails ? "rotate(180deg)" : void 0,
35291
+ transition: "transform 0.2s"
35292
+ },
35293
+ viewBox: "0 0 24 24",
35294
+ fill: "none",
35295
+ stroke: "currentColor",
35296
+ strokeWidth: 2,
35297
+ strokeLinecap: "round",
35298
+ strokeLinejoin: "round",
35299
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M6 9l6 6 6-6" })
35300
+ }
35301
+ ),
35302
+ route.data && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35303
+ "svg",
35304
+ {
35305
+ width: "14",
35306
+ height: "14",
35307
+ viewBox: "0 0 14 14",
35308
+ style: {
35309
+ transform: "rotate(-90deg)",
35310
+ flexShrink: 0,
35311
+ opacity: 0.75,
35312
+ marginLeft: "0.125rem"
35313
+ },
35314
+ children: [
35315
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35316
+ "circle",
35317
+ {
35318
+ cx: "7",
35319
+ cy: "7",
35320
+ r: "5",
35321
+ fill: "none",
35322
+ stroke: "hsl(var(--tw-border))",
35323
+ strokeWidth: "1.5"
35324
+ }
35325
+ ),
35326
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35327
+ "circle",
35328
+ {
35329
+ cx: "7",
35330
+ cy: "7",
35331
+ r: "5",
35332
+ fill: "none",
35333
+ stroke: quoteAge >= QUOTE_TTL - 10 ? colors.destructive : colors.primary,
35334
+ strokeWidth: "1.5",
35335
+ strokeLinecap: "round",
35336
+ strokeDasharray: "31.416",
35337
+ strokeDashoffset: 31.416 * (quoteAge / QUOTE_TTL),
35338
+ style: { transition: "stroke-dashoffset 1s linear" }
35339
+ }
35340
+ )
35341
+ ]
35342
+ }
35343
+ )
34226
35344
  ]
34227
35345
  }
34228
- ) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { color: colors.mutedForeground }, children: "\u2014" })
34229
- }
34230
- ),
34231
- showReviewDetails && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
34232
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34233
- ReviewDetailRow,
34234
- {
34235
- label: "Max slippage",
34236
- tooltip: "Max price movement allowed before the swap automatically reverts",
34237
- value: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34238
- "span",
34239
- {
34240
- style: {
34241
- display: "flex",
34242
- alignItems: "center",
34243
- gap: spacing[1.5]
34244
- },
34245
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { style: { color: colors.mutedForeground }, children: [
34246
- slippage,
34247
- "%"
34248
- ] })
34249
- }
34250
- )
34251
- }
34252
- ),
34253
- (routePath || route.data?.route?.provider) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34254
- ReviewDetailRow,
34255
- {
34256
- label: "Route",
34257
- tooltip: "Protocol or bridge used to execute your swap",
34258
- value: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34259
- "span",
34260
- {
34261
- style: {
34262
- color: colors.foreground,
34263
- overflow: "hidden",
34264
- textOverflow: "ellipsis",
34265
- whiteSpace: "nowrap",
34266
- maxWidth: "200px",
34267
- display: "inline-block",
34268
- verticalAlign: "bottom"
34269
- },
34270
- title: routePath ?? route.data?.route?.provider,
34271
- children: routePath ?? route.data?.route?.provider
34272
- }
34273
- )
34274
- }
34275
- )
34276
- ] })
34277
- ]
34278
- }
34279
- ),
34280
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34281
- SwapActionArea,
34282
- {
34283
- fromTokenSymbol: fromToken?.symbol ?? "",
34284
- allowanceStatus: execution.allowanceStatus,
34285
- txStatus: execution.txStatus,
34286
- isSubmitting: execution.isSubmitting,
34287
- isGasSponsored,
34288
- onExecute: () => void handleExecute()
34289
- }
34290
- )
34291
- ] }) });
35346
+ ),
35347
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35348
+ "div",
35349
+ {
35350
+ style: { flex: 1, height: "1px", backgroundColor: colors.border }
35351
+ }
35352
+ )
35353
+ ]
35354
+ }
35355
+ ),
35356
+ showReviewDetails && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35357
+ "div",
35358
+ {
35359
+ style: {
35360
+ display: "flex",
35361
+ flexDirection: "column",
35362
+ gap: spacing[3],
35363
+ fontSize: fontSize.sm,
35364
+ marginBottom: spacing[2]
35365
+ },
35366
+ children: [
35367
+ exchangeRate !== null && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35368
+ ReviewDetailRow,
35369
+ {
35370
+ label: "Rate",
35371
+ tooltip: "Current exchange rate between the two tokens",
35372
+ value: `1 ${fromToken?.symbol} = ${fmtAmount(1 / (exchangeRate ?? 1), 4)} ${toToken?.symbol} ($${fmtAmount(fromTokenPriceUSD, 2)})`
35373
+ }
35374
+ ),
35375
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35376
+ ReviewDetailRow,
35377
+ {
35378
+ label: "Fee",
35379
+ tooltip: "Protocol fee charged by the bridge or DEX",
35380
+ value: protocolFeeUsd !== null ? fmtLocal(protocolFeeUsd) : "Free"
35381
+ }
35382
+ ),
35383
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35384
+ ReviewDetailRow,
35385
+ {
35386
+ label: "Network cost",
35387
+ tooltip: "Estimated gas fee paid to the blockchain network",
35388
+ value: isGasSponsored ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SponsoredBadge, {}) : networkCostUsd !== null ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35389
+ "span",
35390
+ {
35391
+ style: {
35392
+ display: "flex",
35393
+ alignItems: "center",
35394
+ gap: "0.25rem"
35395
+ },
35396
+ children: [
35397
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GasIcon, { size: "0.875rem" }),
35398
+ fmtLocal(networkCostUsd)
35399
+ ]
35400
+ }
35401
+ ) : "\u2014"
35402
+ }
35403
+ ),
35404
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35405
+ ReviewDetailRow,
35406
+ {
35407
+ label: "Max slippage",
35408
+ tooltip: "Max price movement allowed before the swap automatically reverts",
35409
+ value: `${slippage}%`
35410
+ }
35411
+ ),
35412
+ (routePath || route.data?.route?.provider) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35413
+ ReviewDetailRow,
35414
+ {
35415
+ label: "Route",
35416
+ tooltip: "Protocol or bridge used to execute your swap",
35417
+ value: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35418
+ "span",
35419
+ {
35420
+ style: {
35421
+ overflow: "hidden",
35422
+ textOverflow: "ellipsis",
35423
+ whiteSpace: "nowrap",
35424
+ maxWidth: "200px",
35425
+ display: "inline-block",
35426
+ verticalAlign: "bottom"
35427
+ },
35428
+ title: routePath ?? route.data?.route?.provider,
35429
+ children: routePath ?? route.data?.route?.provider
35430
+ }
35431
+ )
35432
+ }
35433
+ )
35434
+ ]
35435
+ }
35436
+ ),
35437
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35438
+ SwapActionArea,
35439
+ {
35440
+ fromTokenSymbol: fromToken?.symbol ?? "",
35441
+ allowanceStatus: execution.allowanceStatus,
35442
+ txStatus: execution.txStatus,
35443
+ isSubmitting: execution.isSubmitting,
35444
+ isGasSponsored,
35445
+ onExecute: () => void handleExecute()
35446
+ }
35447
+ )
35448
+ ]
35449
+ }
35450
+ ) });
34292
35451
  }
34293
35452
  const ctaLabel = !hasTokens ? "Get started" : !hasAmount ? "Enter an amount" : insufficient ? `Insufficient ${fromToken?.symbol} balance` : !isConnected ? "Connect Wallet" : needsDestAddress && !isValidDestAddress ? `Enter ${toChain?.networkName ?? "destination"} address` : "Review";
34294
35453
  const ctaDisabled = !hasTokens || !hasAmount || insufficient || isConnected && needsDestAddress && !isValidDestAddress;
34295
35454
  const ctaAction = !isConnected ? handleConnectAndReview : () => void handleReview();
34296
35455
  const showRateRow = hasTokens && exchangeRate !== null;
34297
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35456
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
34298
35457
  "div",
34299
35458
  {
34300
35459
  style: { display: "flex", flexDirection: "column", minHeight: "500px" },
@@ -34420,6 +35579,91 @@ function SwapMode({
34420
35579
  zIndex: 100
34421
35580
  },
34422
35581
  children: [
35582
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35583
+ "p",
35584
+ {
35585
+ style: {
35586
+ fontSize: fontSize.xs,
35587
+ fontWeight: fontWeight.semibold,
35588
+ color: colors.mutedForeground,
35589
+ textTransform: "uppercase",
35590
+ letterSpacing: "0.06em",
35591
+ marginBottom: spacing[3]
35592
+ },
35593
+ children: "Appearance"
35594
+ }
35595
+ ),
35596
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style: { marginBottom: spacing[4] }, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35597
+ "div",
35598
+ {
35599
+ style: {
35600
+ display: "flex",
35601
+ alignItems: "center",
35602
+ justifyContent: "space-between"
35603
+ },
35604
+ children: [
35605
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
35606
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35607
+ "p",
35608
+ {
35609
+ style: {
35610
+ fontSize: fontSize.sm,
35611
+ fontWeight: fontWeight.medium,
35612
+ color: colors.foreground
35613
+ },
35614
+ children: "Dark mode"
35615
+ }
35616
+ ),
35617
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35618
+ "p",
35619
+ {
35620
+ style: {
35621
+ fontSize: "0.625rem",
35622
+ color: colors.mutedForeground,
35623
+ marginTop: "2px"
35624
+ },
35625
+ children: resolvedTheme === "dark" ? "Dark theme active" : "Light theme active"
35626
+ }
35627
+ )
35628
+ ] }),
35629
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35630
+ "button",
35631
+ {
35632
+ role: "switch",
35633
+ "aria-checked": resolvedTheme === "dark",
35634
+ onClick: toggleTheme,
35635
+ style: {
35636
+ width: "2.5rem",
35637
+ height: "1.375rem",
35638
+ borderRadius: "9999px",
35639
+ backgroundColor: resolvedTheme === "dark" ? colors.primary : colors.muted,
35640
+ border: 0,
35641
+ cursor: "pointer",
35642
+ position: "relative",
35643
+ transition: "background-color 0.2s",
35644
+ flexShrink: 0
35645
+ },
35646
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35647
+ "span",
35648
+ {
35649
+ style: {
35650
+ position: "absolute",
35651
+ top: "0.1875rem",
35652
+ left: resolvedTheme === "dark" ? "calc(100% - 1rem - 0.1875rem)" : "0.1875rem",
35653
+ width: "1rem",
35654
+ height: "1rem",
35655
+ borderRadius: "9999px",
35656
+ backgroundColor: colors.primaryForeground,
35657
+ transition: "left 0.2s",
35658
+ display: "block"
35659
+ }
35660
+ }
35661
+ )
35662
+ }
35663
+ )
35664
+ ]
35665
+ }
35666
+ ) }),
34423
35667
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
34424
35668
  "p",
34425
35669
  {
@@ -35274,7 +36518,8 @@ function SwapMode({
35274
36518
  fontSize: fontSize.base,
35275
36519
  fontWeight: fontWeight.semibold,
35276
36520
  border: 0,
35277
- transition: "all 0.2s"
36521
+ transition: "all 0.2s",
36522
+ marginBottom: spacing[3]
35278
36523
  },
35279
36524
  !ctaDisabled ? {
35280
36525
  backgroundColor: colors.primary,
@@ -35572,12 +36817,15 @@ function SwapActionArea({
35572
36817
  fontSize: fontSize.xs,
35573
36818
  color: colors.mutedForeground,
35574
36819
  textAlign: "center",
35575
- marginTop: spacing[2]
36820
+ marginTop: spacing[2],
36821
+ whiteSpace: "nowrap",
36822
+ overflow: "hidden",
36823
+ textOverflow: "ellipsis"
35576
36824
  },
35577
36825
  children: [
35578
- "You'll approve ",
36826
+ "Approve ",
35579
36827
  fromTokenSymbol,
35580
- " spend, then confirm the swap \u2014 2 wallet steps."
36828
+ " access, then confirm swap \u2014 2 steps."
35581
36829
  ]
35582
36830
  }
35583
36831
  )
@@ -35792,7 +37040,14 @@ function ReviewDetailRow({
35792
37040
  value,
35793
37041
  tooltip
35794
37042
  }) {
35795
- const [tipVisible, setTipVisible] = (0, import_react46.useState)(false);
37043
+ const iconRef = (0, import_react46.useRef)(null);
37044
+ const [tipPos, setTipPos] = (0, import_react46.useState)(null);
37045
+ const handleMouseEnter = () => {
37046
+ if (!tooltip || !iconRef.current) return;
37047
+ const r = iconRef.current.getBoundingClientRect();
37048
+ setTipPos({ x: r.left + r.width / 2, y: r.top - 8 });
37049
+ };
37050
+ const handleMouseLeave = () => setTipPos(null);
35796
37051
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35797
37052
  "div",
35798
37053
  {
@@ -35813,66 +37068,65 @@ function ReviewDetailRow({
35813
37068
  },
35814
37069
  children: [
35815
37070
  label,
35816
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
37071
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35817
37072
  "span",
35818
37073
  {
35819
- style: {
35820
- position: "relative",
35821
- display: "inline-flex",
35822
- alignItems: "center"
35823
- },
35824
- onMouseEnter: () => setTipVisible(true),
35825
- onMouseLeave: () => setTipVisible(false),
35826
- children: [
35827
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
35828
- "svg",
35829
- {
35830
- style: {
35831
- width: "0.875rem",
35832
- height: "0.875rem",
35833
- opacity: 0.6,
35834
- cursor: tooltip ? "help" : "default"
35835
- },
35836
- viewBox: "0 0 24 24",
35837
- fill: "none",
35838
- stroke: "currentColor",
35839
- strokeWidth: 2,
35840
- strokeLinecap: "round",
35841
- strokeLinejoin: "round",
35842
- children: [
35843
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
35844
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M12 16v-4M12 8h.01" })
35845
- ]
35846
- }
35847
- ),
35848
- tooltip && tipVisible && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
35849
- "span",
35850
- {
35851
- style: {
35852
- position: "absolute",
35853
- bottom: "calc(100% + 6px)",
35854
- left: "50%",
35855
- transform: "translateX(-50%)",
35856
- backgroundColor: "hsl(var(--tw-foreground))",
35857
- color: "hsl(var(--tw-background))",
35858
- fontSize: "0.6875rem",
35859
- lineHeight: 1.4,
35860
- padding: "0.25rem 0.5rem",
35861
- borderRadius: "0.375rem",
35862
- whiteSpace: "nowrap",
35863
- pointerEvents: "none",
35864
- zIndex: 50
35865
- },
35866
- children: tooltip
35867
- }
35868
- )
35869
- ]
37074
+ ref: iconRef,
37075
+ style: { display: "inline-flex", alignItems: "center" },
37076
+ onMouseEnter: handleMouseEnter,
37077
+ onMouseLeave: handleMouseLeave,
37078
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
37079
+ "svg",
37080
+ {
37081
+ style: {
37082
+ width: "0.875rem",
37083
+ height: "0.875rem",
37084
+ opacity: 0.6,
37085
+ cursor: tooltip ? "help" : "default"
37086
+ },
37087
+ viewBox: "0 0 24 24",
37088
+ fill: "none",
37089
+ stroke: "currentColor",
37090
+ strokeWidth: 2,
37091
+ strokeLinecap: "round",
37092
+ strokeLinejoin: "round",
37093
+ children: [
37094
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
37095
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M12 16v-4M12 8h.01" })
37096
+ ]
37097
+ }
37098
+ )
35870
37099
  }
35871
37100
  )
35872
37101
  ]
35873
37102
  }
35874
37103
  ),
35875
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { color: colors.mutedForeground }, children: value })
37104
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { color: colors.foreground, fontWeight: fontWeight.medium }, children: value }),
37105
+ tooltip && tipPos && typeof document !== "undefined" && import_react_dom.default.createPortal(
37106
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
37107
+ "span",
37108
+ {
37109
+ style: {
37110
+ position: "fixed",
37111
+ left: tipPos.x,
37112
+ top: tipPos.y,
37113
+ transform: "translate(-50%, -100%)",
37114
+ backgroundColor: "hsl(220 15% 15%)",
37115
+ color: "#fff",
37116
+ fontSize: "0.6875rem",
37117
+ lineHeight: 1.4,
37118
+ padding: "0.3rem 0.6rem",
37119
+ borderRadius: "0.375rem",
37120
+ whiteSpace: "nowrap",
37121
+ pointerEvents: "none",
37122
+ zIndex: 99999,
37123
+ boxShadow: "0 4px 12px rgba(0,0,0,0.25)"
37124
+ },
37125
+ children: tooltip
37126
+ }
37127
+ ),
37128
+ document.body
37129
+ )
35876
37130
  ]
35877
37131
  }
35878
37132
  );
@@ -36066,15 +37320,17 @@ function ProcessingStepLine({ done }) {
36066
37320
  }
36067
37321
  );
36068
37322
  }
36069
- var import_react46, import_jsx_runtime56, ConfettiEffect3, QUOTE_TTL, PERCENT_OPTIONS;
37323
+ var import_react46, import_react_dom, import_jsx_runtime56, ConfettiEffect3, QUOTE_TTL, PERCENT_OPTIONS;
36070
37324
  var init_SwapMode = __esm({
36071
37325
  "src/modes/swap/SwapMode.tsx"() {
36072
37326
  "use strict";
36073
37327
  import_react46 = require("react");
37328
+ import_react_dom = __toESM(require("react-dom"), 1);
36074
37329
  init_styles();
36075
37330
  init_utils();
36076
37331
  init_components();
36077
37332
  init_registryClient();
37333
+ init_useThemePreference();
36078
37334
  init_useWalletSessionState();
36079
37335
  init_useWalletTokenState();
36080
37336
  init_hooks2();
@@ -36254,7 +37510,7 @@ var init_TrustwareWidgetV2 = __esm({
36254
37510
  zIndex: 12
36255
37511
  };
36256
37512
  TrustwareWidgetV2 = (0, import_react47.forwardRef)(function TrustwareWidgetV22({
36257
- theme = "system",
37513
+ theme,
36258
37514
  style,
36259
37515
  initialStep = "home",
36260
37516
  defaultOpen = true,